query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Increment current value of limit.
public function increment() { $this->current++; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function increment() {\n\t\t$this->amount++;\n\t}", "public function setLimit(?int $limit): void\n {\n $this->limit['value'] = $limit;\n }", "public function increase()\n {\n $reservedIds = [];\n if ($this->reserved !== null) {\n $reservedIds = explode(',', $this->reserved);\n }\n $this->next++;\n while (in_array($this->next, $reservedIds)) {\n $this->next++;\n }\n $this->save();\n }", "public function setLimit(?int $limit): void\n {\n $this->limit = $limit;\n }", "public function setLimit(?int $limit): void\n {\n $this->limit = $limit;\n }", "public function set_limit($new_limit){\r\n $this->limit = $new_limit;\r\n }", "public function set_limit($limit);", "public function setLimit($x) { $this->limit = $x; }", "public function setLimit(int $limit): void\n {\n $this->limit = $limit;\n }", "public function setLimit(int $limit): void\n {\n $this->_limit = $limit;\n }", "public function increment(LaramoreModel $model, $value, $increment=1);", "public function setLimit(int $limit): self;", "protected function increment(){\n $count = $this->model->getClickCount();\n $count++;\n $this->model->setClickCount($count);\n $this->model->save(false);\n \n }", "public function limit($limit)\n\t{\n\t\t$this->limit = (int) $limit;\n\t}", "public function limit(?int $limit): self;", "public function limit(?int $limit = null) : int;", "public function setLimit ($value)\r\n\t{\r\n\t\t$this->limit = $value;\r\n\t}", "function updateLimitEnabled()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function incrementLimit($subscriptionId, $featureIdentifier, $value)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->db->table(Config::get('throttle::tables.subscription_feature_limit').' AS ufl')\n\t\t\t\t->join(Config::get('throttle::tables.features').' AS f', 'f.id', '=', 'ufl.feature_id')\n\t\t\t\t->join(Config::get('throttle::tables.subscriptions').' AS s', 's.id', '=', 'ufl.subscription_id')\n\t\t\t\t->where('s.id', $subscriptionId)\n\t\t\t\t->where('f.identifier', $featureIdentifier)\n\t\t\t\t->where('ufl.status', 'active')\n\t\t\t\t->increment('ufl.limit', $value);\n\t\t}\n\t\tcatch(PDOException $e)\n\t\t{\n\t\t\tthrow new Exceptions\\InternalException;\n\t\t}\n\t}", "public function increment() {\n $this->countAnswered++;\n }", "private function setLimit($limit)\n {\n $this->limit = (int)$limit;\n }", "public function setLimit($limit)\r\n {\r\n $this->limit = intval($limit);\r\n }", "private function increase_last_number() {\n\t\t$this->settings['last_number'] ++;\n\t\t$this->update_settings();\n\t}", "public function limit($limit)\n {\n }", "public function limit($limit);", "public function limit($limit);", "public function updateCount() {\n $sql = \"UPDATE goCount SET count = count + 1 WHERE 1\";\n\n if (self::$conn->query($sql) === FALSE) {\n echo \"Error updating count record: \" . self::$conn->error;\n }\n }", "public function setLimit($limit) {\n $this->limit = (int)$limit;\n }", "public static function limit($limit);", "protected function limit(int $limit){\n $this->query .= \"LIMIT \" . $limit . \" \";\n }", "function incrementar(&$valor){\n $valor++;\n return $valor;\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($value)\n {\n return $this->set('Limit', $value);\n }", "public function setLimit($var)\n {\n GPBUtil::checkInt32($var);\n $this->limit = $var;\n\n return $this;\n }", "private function processLimit(): void\n {\n if ($this->request->has(self::LIMIT) && null !== $this->request->get(self::LIMIT)) {\n $itemLimit = (int)$this->request->get(self::LIMIT);\n\n if ($itemLimit > 0) {\n $this->limit = $itemLimit;\n } elseif (0 === $itemLimit) {\n $this->limit = 0;\n }\n }\n }", "public function incrementVoteCount()\n {\n $this->setVotesCount( $this->getVotesCount() + 1 );\n }", "public function setLimit($limit)\n {\n $this->limit = $limit;\n }", "public function limit($value) {\r\n $this->limit = (int)$value;\r\n return $this;\r\n }", "protected function _updateLimit()\n {\n return $this->_updateLimit;\n }", "public function setLimit($var)\n {\n GPBUtil::checkInt32($var);\n $this->limit = $var;\n $this->has_limit = true;\n\n return $this;\n }", "public function increment($field, $by = 1, $max = null) {\n $this->update(array(\n $field => function($value) use($by, $max) {\n $new = (int)$value + $by;\n return ($max and $new >= $max) ? $max : $new;\n }\n ));\n return $this;\n }", "private function incrementMoveNumber(): void\n {\n ++$this->moveNumber;\n }", "public function setLimit($limit) {\n\t\t$this->limit = $limit;\n\t}", "public static function increment()\n {\n self::$id++;\n }", "public function limit( $limit ) {\n\t\t$this->isDirty( true );\n\t\t$this->_limit = $limit;\n\t\treturn $this;\n\t}", "function addTen(&$num){\n $num += 10;\n }", "public function updatePositiveCount() {\n\n\t}", "public function incrementSightingRank()\n\t{\n\t\t$id = request()->real;\n\t\t$currentRank = DB::table('sightings')->where('id',$id)->pluck('rank')->first();\n\t\tif($currentRank < 10)\n\t\t\tDB::table('sightings')->where('id',$id)->increment('rank', 1);\n\t}", "public function setLimit(int $limit) : self\n {\n $this->initialized['limit'] = true;\n $this->limit = $limit;\n return $this;\n }", "public function setLimit($var)\n {\n GPBUtil::checkDouble($var);\n $this->limit = $var;\n\n return $this;\n }", "public function increment($val, $increment)\n {\n for ($i = 1; $i <= $increment; $i++) {\n $val++;\n }\n\n return $val;\n }", "function getLimit() ;", "public function set_item_limit($limit = 0)\n {\n }", "function increase($num): void {\n $num +=2;\n}", "public function limit(?int $limit): static\n\t{\n\t\t$this->limit = $limit;\n\t\treturn $this;\n\t}", "public function incrementViews(){\r\n $query=$this->con->prepare(\"UPDATE videos SET views = views+1 WHERE id = :id\");\r\n $query->bindParam(\":id\",$videoId);\r\n $videoId = $this->getId();\r\n $query->execute();\r\n //povecavanje broja u samoj sql koloni\r\n $this->sqlData['views'] = $this->sqlData['views'] +1;\r\n\r\n }", "public function setIncrement($value)\n {\n $this->set('Increment', max(1, (int) $value));\n return $this;\n }", "public function incrementArgumentPosition()\n {\n $this->argument++;\n }", "public function getLimit() {}", "public function setIncrement($value) {\r\n\r\n /** @todo RAISING EXCEPTIONS HERE FORCES DECLARING \"THROW\" EVERYWHERE! */\r\n// if ($value < 0) {\r\n// throw new TeeChartException(Language.getString(\"AxisIncrementNeg\"));\r\n// }\r\n\r\n //if (isDateTime()) System.Convert.ToDateTime($value).ToString();\r\n $this->desiredIncrement = $this->setDoubleProperty($this->desiredIncrement, $value);\r\n }", "public function limit(): int\n {\n return $this->limit;\n }", "public function getLimit();", "public function getLimit();", "public function getLimit();", "public function getLimit();", "public function getLimit();", "public function limit($limit) {\n $this->limit = (int) $limit;\n return $this;\n }", "public function incrementProgress(int $offset = 1)\n {\n $value = $this->getProgressNow() + $offset;\n $this->setProgressNow($value);\n }", "public function increment($key, $value = 1)\n {\n $this->connection->transaction(function () use ($key, $value) {\n return $this->incrementOrDecrement($key, $value, function ($current) use ($value) {\n return $current + $value;\n });\n });\n }", "protected function IncreaseLevel()\n {\n $level = $this->GetLevel();\n \n $this->RecordLvlQAs();\n \n $nextLevel = $level + 1;\n \n $this->SetLevel($nextLevel);\n $this->SetPrevLevel($level);\n $this->GetNewLvlQAs();\n }", "public function setLimit($var)\n {\n GPBUtil::checkMessage($var, \\Votes\\LimitReq::class);\n $this->limit = $var;\n\n return $this;\n }", "protected function setLimit() {\r\n if( $this->sqlLimit ) {\r\n $this->sql .= ' LIMIT ' . $this->sqlLimit;\r\n }\r\n }", "public function incrPrice($increment) {\n $this->setPrice($this->getPrice() + $increment);\n }", "public function increaseCommentCount()\n {\n \tif($this->comment_count != null)\n \t\t$this->comment_count++;\n \telse\n \t\t$this->comment_count = 1;\n \t$this->save();\n }", "public function getLimit() : int\n {\n return $this->limit;\n }" ]
[ "0.7011745", "0.6590399", "0.65638113", "0.63739675", "0.63739675", "0.6327827", "0.62269455", "0.61876273", "0.6168899", "0.61627287", "0.6152954", "0.6102154", "0.6097574", "0.606614", "0.60343075", "0.60295266", "0.6014802", "0.6012263", "0.5968037", "0.596547", "0.59407043", "0.5890475", "0.58902514", "0.58754766", "0.5863633", "0.5863633", "0.58632565", "0.5853532", "0.5838896", "0.58361346", "0.58076745", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.5790717", "0.578412", "0.57816464", "0.5760511", "0.5716789", "0.57162005", "0.57093036", "0.57075846", "0.56941515", "0.5685261", "0.56809825", "0.56655645", "0.56508845", "0.5648138", "0.5647599", "0.56404614", "0.5622143", "0.56166464", "0.5611577", "0.55944353", "0.5594016", "0.5586423", "0.5560838", "0.5551283", "0.5541201", "0.5534299", "0.5532426", "0.5529936", "0.5503661", "0.5494099", "0.5494099", "0.5494099", "0.5494099", "0.5494099", "0.54792416", "0.547389", "0.54738736", "0.5464142", "0.54356855", "0.5419562", "0.5415073", "0.54144466", "0.5398806" ]
0.57874405
58
Validates whether a filePath meets our requirements format and structure and existence!
private function validateFilename($filePath) { if (!file_exists($filePath)) { throw new \InvalidArgumentException("File Path specified did not exist"); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function isFileValid(): bool\n {\n return FileHelper::isExpectedExtensions($this->getPath(), $this->getFileExtensions());\n }", "public function validate() {\n\t\t\n\t\tif(!is_dir($this->path)) {\n\t\t\tthrow new Exception('The path provided does not exist', '400');\n\t\t}\n\t\t\n\t\tif(!is_writeable($this->path)) {\n\t\t\tthrow new Exception('The path provided is not writeable', '400');\n\t\t}\n\t\t\n\t\tif(file_exists($this->path . $this->filename)) {\n\t\t\t\n\t\t\tif($this->allow_overwrite === false && $this->rename_if_exists === false) {\n\t\t\t\tthrow new Exception('The file ' . $this->filename . ' already exists', '400');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif($this->checkExtension() === false) {\n\t\t\tthrow new Exception('The file has an invalid extension', '400');\n\t\t}\n\t\t\n\t\treturn true;\n\t\t\n\t}", "public function path_valid() {\n\t\tif (!file_exists($this->path)) return false;\n\t\treturn true;\n\t}", "public function path_valid() {\n\t\tif (!file_exists($this->path)) return false;\n\t\treturn true;\n\t}", "public function checkIsFile($path);", "function file_is_valid_image($path)\n {\n }", "public function isValidPathReturnsTrueIfPathExists() {}", "abstract protected function validateFile() : object;", "protected function validateFileContents() {\n\t\tif (!$this->fileName) {\n\t\t\tthrow new \\LogicException(\"Missing file's path. Looks like severe internal error.\");\n\t\t}\n\t\t$this->validateFilePath($this->fileName);\n\t\tif (!$this->sha1hash) {\n\t\t\tthrow new \\LogicException(\"Missing file's SHA1 hash. Looks like severe internal error.\");\n\t\t}\n\t\tif ($this->sha1hash !== sha1_file($this->fileName)) {\n\t\t\tthrow new IOException(\"The file on disk has changed and this \" . get_class($this) . \" class instance is no longer valid for use. Please create fresh instance.\");\n\t\t}\n\t\treturn true;\n\t}", "public function isValidConfigFile($file);", "private function isValidFile($path)\n {\n return $path && $path != 'none' && is_readable($path);\n }", "private function validatePath()\n {\n $locator = new FileLocator();\n $locator->locate($this->path); // throws exception on failure\n }", "function fileChecker($nome_file){\n \n // controllo che sia stato inviato un file altrimenti restituisco false\n if(empty($_FILES['file'])){\n return false;\n }\n \n // memorizzo l'estensione\n $ext = trim(strtolower(end($nome_file)));\n \n // verifico che sia stato inviato un file contente un foto i formati disponibili sono jpg png jpeg\n if(!preg_match(VALID_FILE_FORMAT, $ext)){\n return false;\n }\n \n return true;\n}", "public function valid()\n {\n if (!file_exists($this->_filePath)) {\n return false;\n }\n if (!$this->_getFileHandle()) {\n return false;\n }\n return $this->_valid;\n }", "function checkFileIsValid($file) \n {\n if (!is_file($file)) {\n throw new \\InvalidArgumentException(\n sprintf('\"%s\" is not a file or not exists.', $file)\n );\n }\n if (is_file($file) && mb_stripos($file, '.htm') === false) {\n throw new \\InvalidArgumentException(\n sprintf('\"%s\" is not a valid file.', $file)\n );\n }\n }", "private function ensureFileValid(string $filePath): void\n {\n $blacklist = ['YES', 'NO', 'NULL', 'FALSE', 'ON', 'OFF', 'NONE', 'TRUE'];\n $errors = [];\n\n // Read the whole file at once\n // no sense streaming since we load the whole thing in production\n $file = file_get_contents($filePath);\n\n if (false === $file) {\n throw new InvalidFileException(sprintf('Unable to read file \"%s\" for checking', $filePath));\n }\n\n $file = explode(\"\\n\", $file);\n\n foreach ($file as $lineNumber => $line) {\n $realNumber = $lineNumber + 1;\n // Ignore comment lines.\n if ('' === trim($line) || ';' === $line[0]) {\n continue;\n }\n\n // Check that the line passes the necessary format.\n if (!preg_match('#^[A-Za-z][A-Za-z0-9_\\-\\.]*\\s*=\\s*\".*\"\\s*(;.*)?$#', $line)) {\n $errors[] = \"Line $realNumber does not match format regexp\";\n continue;\n }\n\n // Gets the count of unescaped quotes\n preg_match_all('/(?<!\\\\\\\\)\\\"/', $line, $matches);\n\n if (2 !== count($matches[0])) {\n $errors[] = \"Line $realNumber doesn't have exactly 2 unescaped quotes\";\n continue;\n }\n\n // Check that the key is not in the blacklist.\n $key = strtoupper(trim(substr($line, 0, strpos($line, '='))));\n\n if (in_array($key, $blacklist)) {\n $errors[] = \"Line $realNumber has blacklisted key\";\n }\n }\n if (false === @parse_ini_file($filePath)) {\n $errors[] = 'Cannot load file with parse_ini_file';\n }\n\n if (count($errors)) {\n throw new InvalidFileException(\"File $filePath has following errors:\\n\".implode(';', $errors));\n }\n }", "function validate_file($file, $allowed_files = array())\n {\n }", "public function validateFile()\n {\n $totalChunks = $this->getTotalChunks();\n $totalChunksSize = 0;\n\n for ($i = $totalChunks; $i >= 1; $i--) {\n $file = $this->getChunkPath($i);\n if (!file_exists($file)) {\n return false;\n }\n $totalChunksSize += filesize($file);\n }\n\n return $this->getTotalSize() == $totalChunksSize;\n }", "public function testIsVendorFileThrowsExceptionIfNoValidFileReferenceIsProvided()\n {\n $this->expectException('InvalidArgumentException');\n VendorResources::isVendorFile(__DIR__ . '/this/files/does/not/exist');\n }", "function accouk_is_valid_text_file($path) {\n\n // Use finfo to detect mime type\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mime = finfo_file($finfo, $path);\n finfo_close($finfo);\n if($mime !== \"text/plain\") return false;\n\n // Check file extension\n $filename_length = strlen($path);\n if(substr($path, $filename_length-4, $filename_length) !== \".txt\") return false;\n\n return true;\n}", "protected function validateFilePath($fileName) {\n\t\tif (!file_exists($fileName)) {\n\t\t\tthrow new IOException(\"File $fileName does not exists\");\n\t\t}\n\t\tif (!is_file($fileName)) {\n\t\t\tthrow new IOException(\"$fileName must be a file\");\n\t\t}\n\t\tif (!is_readable($fileName)) {\n\t\t\tthrow new IOException(\"File $fileName is not readable\");\n\t\t}\n\t\treturn true;\n\t}", "protected function is_valid_image_file($file_path) {\n \treturn false;\n }", "function validate_import_file( $file, $allowed_files = '' ) {\n if ( false !== strpos( $file, '..' ))\n return 1;\n\n if ( false !== strpos( $file, './' ))\n return 1;\n\n if (!empty ( $allowed_files ) && (!in_array( $file, $allowed_files ) ) )\n return 3;\n/*\n if (':' == substr( $file, 1, 1 ))\n return 2;\n*/\n return 0;\n}", "public function checkFormatAllowed() {\n\t\t$imageFileType = pathinfo(basename($this->value[\"name\"]),PATHINFO_EXTENSION);\n\t\tif((($this->extension == \"\") && ($imageFileType == \"jpg\" || $imageFileType == \"png\" || $imageFileType == \"jpeg\"\n\t\t|| $imageFileType == \"gif\")) || ($this->extension == \"pdf\" && $imageFileType == \"pdf\" )) {\n\t\t return true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "static function validateSourceFileName($filePath, $isEntry) {\n\n // Seems the only way to get the true filename on case-insensitive file systems\n // is to traverse the directory. :/\n $files = scandir(dirname($filePath));\n $base = basename($filePath);\n $fuzzyBase = strtolower($base);\n $badFile = false;\n\n foreach ($files as $f) {\n if (strtolower($f) === $fuzzyBase) {\n $badFile = ($f !== $base) ? $f : '';\n break;\n }\n }\n\n if ($badFile === false) {\n Tht::error(\"Unable to validate file name `$fileName` from directory listing.\");\n }\n\n if ($badFile) {\n $baseBad = basename($badFile);\n\n if ($baseBad == strtolower($baseBad)) {\n $case = $isEntry ? 'lowerCamelCase' : 'UpperCamelCase';\n Tht::error(\"File name `$baseBad` must be $case.\");\n }\n else if ($isEntry) {\n Tht::errorLog(\"Url `$base` is missing hyphens. Ex: file-name = fileName.tht\");\n Tht::module('Output')->u_send_error(404);\n }\n else {\n Tht::error(\"File name mismatch: `$base`. Try: `$baseBad` (exact case)\");\n }\n }\n\n Security::assertIsOutsideDocRoot($filePath);\n }", "protected function isFile() {}", "public function isValid()\n {\n return !empty($this->path) && !empty($this->name) && !empty($this->extension);\n }", "function fileIsValid($fname, $schema, $db) {\n\tglobal $maxFileAgeInDays;\n\n\t// valid if exists\n\tif (!file_exists($fname)) {\n\t\techo \"INVALID_FILE_NOT_EXIST: $fname\\r\\n\";\n\t\treturn false;\n\t}\n\n\t// valid if not too old\n\t$age = dayOld($fname);\n\tif ($age >= $maxFileAgeInDays) {\n\t\techo \"INVALID_FILE_TOO_OLD: $fname, $age day-old\\r\\n\";\n\t\treturn false;\n\t}\n\n\t// all else being equal, check for db\n\tif (isFileAlreadyImported($fname, $schema, $db)) {\n\t\techo \"INVALID_FILE_ALREADY_IMPORTED: $fname\\r\\n\";\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "private static function isValidFilePath(string $value): bool\n {\n return empty($value) || !preg_match('/\\/\\.{1,2}\\//iu', '/'.$value.'/');\n }", "function validate_file( $file ){\n\tif( strpos( $file, '..' ) !== false )\n\t\treturn false;\n\n\t$file = HOME . $file;\n\n\tif( !file_exists( $file ) )\n\t\treturn false;\n\n\treturn true;\n}", "public function isFile();", "function verify_filename($filename) // Colorize: green\n { // Colorize: green\n return isset($filename) // Colorize: green\n && // Colorize: green\n is_string($filename) // Colorize: green\n && // Colorize: green\n $filename != \"\"; // Colorize: green\n }", "public function isValidFilename()\n {\n $fileName = $this->fileName;\n if(substr($fileName, 0,1) == '-') {\n return false;\n }\n return true;\n }", "private function isValidStaticTypeFile(): bool\n {\n return $this->oHttpRequest->getExists('t') &&\n in_array($this->oHttpRequest->get('t'), self::ASSET_FILES_ACCEPTED, true);\n }", "public function validateFilesystem() : bool\n {\n /** @var Parameters */\n $applicationParams = $this->httpClient->applicationParams();\n\n /** @var string */\n $fakeKey = 'fakeKey';\n\n /** @var string */\n $projectHomedir = $applicationParams->path($fakeKey);\n\n /** @var string */\n $snapshot = $applicationParams->snapshotPath('fakeKey');\n\n /** @var string */\n $symlinkTarget = $applicationParams->symlinkTarget($fakeKey);\n\n /** @var string */\n $symlinkSource = $applicationParams->symlinkSource($fakeKey);\n\n /** @var string */\n $fakeContent = 'content';\n\n try {\n return $this->createDirectories($projectHomedir, $symlinkTarget)\n && $this->createFiles($snapshot, $fakeContent, $symlinkTarget, $symlinkSource)\n && $this->removeFilesAndDirs($projectHomedir, $symlinkTarget, $snapshot);\n } catch (Exception $exception) {\n $this->logger->critical('Filesystem error: ' . $exception->getMessage());\n\n return false;\n }\n }", "public function validPathStrDataProvider() {}", "public function mimeTypeValid()\n\t{\n\t\tif (!in_array($this->files['type'], $this->mime_types)) {\n\t\t\tthrow new Exception(\"Invalid file Extension\",6);\n\t\t}\n\t}", "public function checkFile($path) {\n\t\tif (preg_match($this->ignore, $path) == 1){\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->errors = array();\n\t\t$this->tokens = token_get_all(file_get_contents($path));\n\t\t$this->path = $path;\n\t\t$this->_checkHeader();\n\t\t$this->_checkClassDocBlock();\n\t\t$this->_checkDocBlocks();\n\n\t\tif (count($this->errors)) {\n\t\t\t$this->out(\"\\n\" . $this->path . \"\\n\" . implode(\"\\n\", $this->errors));\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function extensionValid() \n\t{\n\t\tif (!in_array($this->extension_of_file, $this->file_types)) //{\n\t\t\tthrow new Exception(\"Invalid file Extension\",5);\n\t\t//}\n\t}", "public function check_files()\n {\n }", "public function validatePath()\n {\n $path = $this->getFullPath();\n\n return\n strpos($path, $this->chrootDir) === 0\n && (strpos($path, '..') === false || !empty($this->path));\n }", "protected function isValidFile($file)\n {\n return $file instanceof \\SplFileInfo && $file->getPath() != '';\n }", "protected function canFileBeCreated() {}", "public function assertIsFile($path);", "public function valid(): bool\n {\n return file_exists($this->file);\n }", "protected function checkFilename(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_string($this->_Filename) && $this->_Filename !== null && $this->_Filename !== '' ) {\n\t\t\t$inMessage .= \"{$this->_Filename} is not a valid value for Filename\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\t\t\t\n\t\treturn $isValid;\n\t}", "protected function _validateMimeType()\n\t{\n\t\t$this->_fileType = \\MimeType\\MimeType::getType($this->getFilePath());\n\n\t\tif (!in_array($this->_fileType, $this->_allowedMimeType)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function validate_file($instructor, $filename, $filewithpath, $access) {\n if (is_dir($filewithpath)) {\n return array(False, False, 1, 1, 1, '');\n }\n $today = getdate();\n $open_year = $today['year'];\n $open_month = 1;\n $open_day = 1;\n $cat_file = $filename;\n if (isset($access[basename($filewithpath)])) {\n $open_day = intval($access[basename($filewithpath)]['day']);\n $open_month = intval($access[basename($filewithpath)]['month']);\n if (isset($access[basename($filewithpath)]['year'])) {\n $open_year = intval($access[basename($filewithpath)]['year']);\n }\n } elseif (isset($access[basename($filename)])) {\n $open_day = intval($access[basename($filename)]['day']);\n $open_month = intval($access[basename($filename)]['month']);\n if (isset($access[basename($filename)]['year'])) {\n $open_year = intval($access[basename($filename)]['year']);\n }\n } else {\n $cp = array_reverse(explode('.', basename($filewithpath)));\n if (count($cp) > 3 && is_numeric($cp[1]) && is_numeric($cp[2])) {\n $open_day = intval($cp[1]);\n $open_month = intval($cp[2]);\n $cat_file = $cp[3] . '.' . $cp[0];\n } else {\n return array(True, True, 1, 1, 1, $cat_file);\n }\n }\n if ($today['year'] >= $open_year && $today['mon'] > $open_month) {\n return array(True, True, $open_year, $open_month, $open_day, $cat_file);\n } elseif ($today['year'] >= $open_year && $today['mon'] >= $open_month && $today['mday'] >= $open_day) {\n return array(True, True, $open_year, $open_month, $open_day, $cat_file);\n } elseif ($instructor) {\n return array(True, False, $open_year, $open_month, $open_day, $cat_file);\n }\n return array(False, False, $open_year, $open_month, $open_day, $cat_file);\n }", "private function checkSupportedFile($file_type) {\n return true;\n\n\n }", "function check_upload($file) {\n if (preg_match(\":^application/vnd.bdoc-:\", $file[\"type\"])) {\n $file[\"format\"] = \"bdoc\";\n } else if ($file[\"type\"] === \"application/x-ddoc\") {\n $file[\"format\"] = \"ddoc\";\n } else {\n return FALSE;\n }\n\n return is_uploaded_file($file[\"tmp_name\"]);\n}", "private function validateFile(string $path): void\n {\n if (!file_exists($path)) {\n throw new InvalidArgumentException(sprintf('File: %s doesn\\'t exist', $path));\n }\n\n if (!$this->isCsvFile($path)) {\n throw new InvalidArgumentException(sprintf('Format of the file: %s is not csv', $path));\n }\n }", "public function checkFileValidation($string) {\n $file_mimes = array('text/x-comma-separated-values',\n 'text/comma-separated-values',\n 'application/octet-stream',\n 'application/vnd.ms-excel',\n 'application/x-csv',\n 'text/x-csv',\n 'text/csv',\n 'application/csv',\n 'application/excel',\n 'application/vnd.msexcel',\n 'text/plain',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n );\n if (isset($_FILES['fileURL']['name'])) {\n $arr_file = explode('.', $_FILES['fileURL']['name']);\n $extension = end($arr_file);\n if (($extension == 'xlsx' || $extension == 'xls' || $extension == 'csv') && in_array($_FILES['fileURL']['type'], $file_mimes)) {\n return true;\n } else {\n $this->form_validation->set_message('checkFileValidation', 'Please choose correct file.');\n return false;\n }\n } else {\n $this->form_validation->set_message('checkFileValidation', 'Please choose a file.');\n return false;\n }\n }", "function validateFile($file){\n\n $check = getimagesize($file[\"tmp_name\"]);\n if($check !== false) {\n $err = \"File is an image - \" . $check[\"mime\"] . \".\";\n $uploadOk = 1;\n } else {\n $err = \"File is not an image.\";\n $uploadOk = 0;\n }\n// Allow certain file formats\nif($file[\"type\"] != \"jpg\" && $file[\"type\"] != \"png\" && $file[\"type\"] != \"jpeg\"\n&& $file[\"type\"] != \"gif\" ) {\n $err = \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.\";\n $uploadOk = 0;\n}\n return ($uploadOk==1)? true : false;\n}", "function validateTypeOfFile($type){\n\t$arrFile = ['image/png', 'image/jpg', 'image/jpeg', 'image/gif'];\n\tif(in_array($type, $arrFile)){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "public function isFile(string $path): bool;", "public function isFile(string $path): bool;", "function userfile_check()\n\t\t{\n\t\t\tif ($_FILES['userfile']['size'] > 0)\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->form_validation->set_message('userfile_check', 'The {field} file is required');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}", "public function validate($filename, $chmood = 0755)\n {\n if ( ! file_exists($filename))\n {\n if (substr_count($filename, '/') > 1)\n {\n $folders = explode('/', $filename);\n unset($folders[count($folders) - 1]);\n $path = '';\n foreach ($folders as $key => $dir)\n {\n $path .= $dir . '/';\n $this->make_dir($path, $chmood);\n }\n }\n if (substr_count($filename, '.') > 0)\n {\n $this->make_file($filename);\n return false;\n }\n else\n {\n $this->make_dir($filename, $chmood);\n }\n }\n }", "function isFile($path);", "protected function validateFile(string $path)\n {\n $storage = FilesHelper::getStorageDisk();\n\n if (!$storage->exists($path)) {\n $this->error(\"File not found: \" . $path);\n return false;\n }\n\n return true;\n }", "private function validateFileName($file_name) \r\n {\r\n if (is_null($file_name)) \r\n {\r\n throw new ArgumentNullException(\"fileName is null\");\r\n }\r\n\r\n if (strlen($file_name) == 0) \r\n {\r\n throw new ArgumentException(\"The file name is empty, contains only white spaces, or contains invalid characters.\");\r\n }\r\n \r\n if (strlen($file_name) > 248) \r\n {\r\n throw new PathTooLongException(\"The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.\");\r\n }\r\n }", "public function validateFile(){\n // Check uploaded errors\t\n if($this->fileError){\n if(array_key_exists($this->fileError, $this->phpFileUploadErrors)){\n $this->addError(['PHP Upload Error',$this->phpFileUploadErrors[$this->fileError]]);\n } \n }else{\n // Check if file was uploaded via the form\n if(!is_uploaded_file($this->tmpLocation)){\n $this->addError(['File Upload', \"File uploading failed. Please upload the file again.\"]);\n }\t\n // Check extension\n if(!in_array($this->fileExt, $this->allowedExtensions)){\n $allowed = implode(', ', $this->allowedExtensions);\n $this->addError(['File Extension',\"Uploading this type of file is not allowed. Allowed file extensions are \".$allowed]);\n }\n // Check size\n if($this->size > $this->maxSize){\n $this->addError(['File Size',\"The file size must be up to \".$this->maxSize]);\n }\n // Check if upload folder exists\n if(!file_exists($this->uploadPath)){\n $this->addError(['Admin Error',\"The chosen upload directory does not exist.\"]);\n }\n } \n if(!$this->_errors){\n return true;\n } \n return false;\t\n }", "function isValidFile($fileArray)\n{\n\t# Creating image type array\n\t$imgTypeArr = array('jpg','gif','png','jpeg');\n\t\n\t# image size variable\n\t$fileSize\t= $fileArray['file']['size']; \n\t\n\t# image type variable\n\t$fileType\t= $fileArray['file']['name']; \n\t\n\t# Creating Image extension variable and converting to lowercase\n\t\t$imageExt\t= strtolower(substr($fileType, strrpos($fileType, '.') + 1));\n\t\n\t# Checking weather file type is image and size is less then OR equal to 2 MB\n\tif(in_array($imageExt,$imgTypeArr) && $fileSize <= '2090000'){\n\t\treturn TRUE;\n\t}else{\n\t\treturn FALSE;\n\t}\n}", "public function isFile() : bool;", "public function checkFilePath($file)\n {\n if(!file_exists($file))\n {\n throw new Exception(\"Invalid file\");\n }\n }", "public function validateExtensionplan(){\n $allowed = array('jpeg', 'jpg', 'png');\n $filename = $this->getplanFloor('name');\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\n if(!in_array($ext,$allowed)) {\n return false;\n } else {\n return true;\n }\n }", "private function isValidFile($path)\n {\n return (file_exists($path) && filesize($path) >= $this->minFileSize);\n }", "function isvalid($value) {\n global $debugging;\n switch (true) {\n case (! parent::isvalid($value)):\n $this->error = \"File name must be short and simple\";\n if ($debugging > 1) {\n $this->error .= \" [\" . $value . \"]\";\n }\n return false;\n case (! $this->contentAccessValid()):\n $this->error = \"Content inaccessible\";\n if ($debugging > 1) {\n $this->error .= \" [\" . $this->filepath($value) . \"]\";\n }\n return false;\n default:\n return true;\n }\n }", "public function isFile(): bool;", "function checkFileExists($fileName, $fileType){\n switch($fileType)\n {\n case \"library\":\n if(file_exists($this->libraryBasePath . $fileName . $this->suffix)){\n return true;\n }\n else\n {\n return false;\n }\n case \"config\":\n if(file_exists($this->configBasePath . $fileName . $this->suffix)){\n return true;\n }\n else\n {\n return false;\n }\n case \"controller\":\n if(file_exists($this->controllerBasePath . $fileName . $this->suffix)){\n return true;\n }\n else\n {\n return false;\n }\n case \"model\":\n if(file_exists($this->modelBasePath . $fileName . '_model' . $this->suffix)){\n return true;\n\n }\n else\n {\n return false;\n }\n default:\n echo 'that filetype is fucked';\n }\n }", "public function file_check($str)\n {\n $allowed_mime_types = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain');\n if (isset($_FILES['file']['name']) && $_FILES['file']['name'] != \"\") {\n $mime = get_mime_by_extension($_FILES['file']['name']);\n $fileAr = explode('.', $_FILES['file']['name']);\n $ext = end($fileAr);\n if (($ext == 'csv') && in_array($mime, $allowed_mime_types)) {\n return true;\n } else {\n $this->form_validation->set_message('file_check', 'Please select only CSV file to upload.');\n return false;\n }\n } else {\n $this->form_validation->set_message('file_check', 'Please select a CSV file to upload.');\n return false;\n }\n }", "public function valid()\n {\n return $this->fileObject->valid();\n }", "public function checkFile($filename){\n $ext = substr($filename, strrpos($filename, '.') + 1);\n if($ext==\"jpg\"||$ext==\"png\"||$ext==\"svg\"||$ext==\"jpeg\"){\n return true;\n }else{\n return false;\n }\n }", "public function isValid () {\n\treturn (is_dir($this->getPath())) ? true : false;\n }", "function isValidDocument($docFormat, $document){\n $name = $document['name'];\n $ext = explode('.', $name);\n $ext = '.' . $ext[1];\n\n if($ext == $docFormat){\n if($document['error'] === 0){\n return true;\n }\n else{\n echo \"error uploading document\";\n return false;\n }\n }\n else{\n echo \"doc type does not match documents true extension\";\n }\n }", "public function is_file($file);", "public function isValid(): bool\n {\n return ($this->error === UPLOAD_ERR_OK) && is_uploaded_file($this->getPathname());\n }", "public function hasFile(string $name): bool {}", "protected function validatePath($path) {\n // Absolute local file paths are invalid.\n if ($this->fileSystem->realpath($path) == $path) {\n return FALSE;\n }\n // A path relative to the Drupal root or a fully qualified URI is valid.\n if (is_file($path)) {\n return $path;\n }\n // Prepend 'public://' for relative file paths within public filesystem.\n if (StreamWrapperManager::getScheme($path) === FALSE) {\n $path = 'public://' . $path;\n }\n if (is_file($path)) {\n return $path;\n }\n return FALSE;\n }", "private function checkMimeType()\n {\n $allowedTypes = $this->getSetting('allowed_upload_types', true);\n if (is_string($allowedTypes) && strlen($allowedTypes)) {\n $allowedTypes = str_replace(' ', '', $allowedTypes);\n $allowedTypes = explode(',', $allowedTypes);\n }\n if (is_array($allowedTypes)) {\n if (!in_array($this->file->getMimeType(), $allowedTypes)) {\n throw new FileException('File type is not allowed');\n }\n }\n }", "protected function validatePath($path) {\n // Absolute local file paths are invalid.\n if (\\Drupal::service('file_system')->realpath($path) == $path) {\n return FALSE;\n }\n // A path relative to the Drupal root or a fully qualified URI is valid.\n if (is_file($path)) {\n return $path;\n }\n // Prepend 'public://' for relative file paths within public filesystem.\n if (\\Drupal::service('file_system')->uriScheme($path) === FALSE) {\n $path = 'public://' . $path;\n }\n if (is_file($path)) {\n return $path;\n }\n return FALSE;\n }", "protected static function fileIsValid(string $file): bool\r\n {\r\n return is_file($file) && is_writable($file);\r\n }", "function validateFile($file)\n{\n $msg = '<img src=\"../images/red.gif\" alt=\"\" title=\"Path is not Valid\"><br><font color=\"#ff0000\">Path is not Valid</font>';\n if (isFile($file)) {\n $msg = '<img src=\"../images/green.gif\" alt=\"\" title=\"Valid\">';\n }\n return $msg;\n}", "function IsFileExist()\n{\t\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t\n\t$sFileUrl = $_REQUEST['file-path']; \n\t\n\tif(file_exists($sFileUrl) === true)\n\t{\n\t\techo '<correct>file exist</correct>';\n\t} else\n\t{\n\t\techo '<correct>file not exist</correct>';\n\t}\n\t\n\treturn;\n}", "function sd_is_path_sane($path) {\n\tglobal $sd_error_msg;\n\n\tif (!$path) {\n\t\t$sd_error_msg = 'E:empty';\n\t\treturn $sd_error_msg;\n\t}\n\tif (false !== strpos('..', $path)) {\n\t\t$sd_error_msg = 'E:.. forbidden';\n\t\treturn $sd_error_msg;\n\t}\n\tif (!file_exists(SD_DL_ROOT . $path)) {\n\t\t$sd_error_msg = 'E:non-exist';\n\t\treturn $sd_error_msg;\n\t}\n\treturn true;\n}", "public function supports(\\SplFileInfo $file): bool;", "abstract protected function isValid(Repository $repository, string $file): bool;", "public function valid()\n {\n\n if ($this->container['use_async_pattern'] === null) {\n return false;\n }\n if ($this->container['source_file_name'] === null) {\n return false;\n }\n if ($this->container['source_file_content'] === null) {\n return false;\n }\n if ($this->container['copy_metadata'] === null) {\n return false;\n }\n $allowed_values = [\"English\", \"Arabic\", \"Danish\", \"German\", \"Dutch\", \"Finnish\", \"French\", \"Hebrew\", \"Hungarian\", \"Italian\", \"Norwegian\", \"Portuguese\", \"Spanish\", \"Swedish\", \"Russian\"];\n if (!in_array($this->container['language'], $allowed_values)) {\n return false;\n }\n $allowed_values = [\"Slow but accurate\", \"Faster and less accurate\", \"Fastest and least accurate\"];\n if (!in_array($this->container['performance'], $allowed_values)) {\n return false;\n }\n $allowed_values = [\"None\", \"Whitelist\", \"Blacklist\"];\n if (!in_array($this->container['characters_option'], $allowed_values)) {\n return false;\n }\n return true;\n }", "static function validFile($name,$size,$arrayFileType){\n \n $valid = true;\n \n// //extraer el ultimo componente de la ruta(se busca el nombre del archivo)\n// $file = $dir . basename($_FILES[$name]['name']);\n //Extraer tipo de extencion del archivo y convertirlo en minuscula\n// $valFileType = strtolower(pathinfo($file,PATHINFO_EXTENSION));\n //Extraer el tamaño del archivo\n// $valsize = getimagesize($_FILES[$name][\"tmp_name\"]);\n \n // Extenciones permitidas\n //Extraer tipo de extencion del archivo y convertirlo en minuscula\n $valFileType = strtolower(pathinfo($_FILES[$name]['name'],PATHINFO_EXTENSION)); \n $true=0;\n// var_dump(count($arrayFileType));\n for($i=0; $i<=count($arrayFileType)-1; $i++){\n \n if($valFileType==$arrayFileType[$i]){\n $true=$true+1;\n } \n $stringFileType .=$arrayFileType[$i].\" \";\n \n }\n \n if($true==0){\n $valid = false;\n $msg.=\"Solo se permiten extensiones \".$stringFileType.\". \"; \n }\n \n //tamaño permitido\n if ($_FILES[$name][\"size\"] > $size) {\n $valid = false;\n $msg.=\"Operacion fallida, este archivo no puede ser mayor a \".($size/100000).\"MB. \"; \n } \n \n \n if($msg!=\"\"){\n// $msg = \"Debe darse un valor al campo: \".$msg ;\n utilities::alert($msg); \n }\n \n \n \n return ($valid); \n }", "function validateMimeType($file_name){\r\n // array of acceptable MIME types\r\n $mime_types = [\r\n 'image/png',\r\n 'image/jpeg'\r\n ];\r\n \r\n // determines MIME type\r\n $type = mime_content_type($file_name);\r\n \r\n // check if MIME type is in array of acceptable types\r\n return in_array($type, $mime_types, true);\r\n}", "public function checkIsReadable($path);", "public function validate($options = []) {\n if ($this->unless) {\n $this->doUnlessCheck($options);\n }\n\n if ($this->is_required) {\n $this->doRequiredCheck();\n }\n\n if ($this->is_type && $this->value !== __FILE__) {\n $this->doTypeCheck();\n }\n\n if ($this->is_asset && $this->value !== __FILE__) {\n $this->doAssetCheck();\n }\n\n if ($this->is_object && $this->value !== __FILE__) {\n $this->doObjectCheck();\n }\n\n if ($this->is_classof && $this->value !== __FILE__) {\n $this->doClassOfCheck();\n }\n\n if ($this->value == __FILE__) {\n return false;\n }\n\n return true;\n }", "public function file_check($str)\n {\n\n\n\n echo \"sadasd : \";\n print_r($str);\n print_r($_FILES);\n\n die();\n\n $allowed_mime_type_arr = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png', 'svg');\n $mime = get_mime_by_extension($_FILES['file']['name']);\n if (isset($_FILES['file']['name']) && $_FILES['file']['name'] != \"\") {\n if (in_array($mime, $allowed_mime_type_arr)) {\n return true;\n } else {\n $this->form_validation->set_message('file_check', 'por favor selecciona solamente gif/jpg/png file.');\n return false;\n }\n } else {\n $this->form_validation->set_message('file_check', 'Selecciona un archivo.');\n return false;\n }\n }", "public function is_file_valid($ext){\r\n\t\t$rslt = false;\r\n\r\n\t\tif($ext == '.doc' || $ext == '.DOC' || $ext == '.docx' || $ext == '.DOCX' || $ext == '.xls' || $ext == '.XLS' || $ext == '.xlsx' || $ext == '.XLSX' || $ext == '.ppt' || $ext == '.PPT' || $ext == '.pptx' || $ext == '.PPTX' || $ext == '.pdf' || $ext == '.PDF' || $ext == '.jpg' || $ext == '.JPG' || $ext == '.png' || $ext == '.PNG' || $ext == '.csv' || $ext == '.CSV' || $ext == '.gif' || $ext == '.GIF' || $ext == '.zip' || $ext == '.ZIP') {\r\n\r\n\t\t\t$rslt = true;\r\n\t\t}\r\n\r\n\t\treturn $rslt;\r\n\r\n\t}", "function validate_picture_file($path) {\n $acceptableTypes = array(IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_GIF);\n $detectedType = exif_imagetype($path); // WARNING: This will only work if the\n // EXIF extension is enabled.\n return in_array($detectedType, $acceptableTypes);\n}", "function validateFileMime(&$model, $fieldData, $fieldName, $allowedMimes = array()) {\n if (empty($fieldData[$fieldName]['tmp_name'])) return true;\n \n $availableMimes = assetMimes();\n \n foreach (!empty($allowedMimes) ? $allowedMimes : array() as $type) {\n if ($type == '*') return true;\n \n # check fileinfo first\n $fileinfo = assetMimeType($fieldData[$fieldName]['tmp_name']);\n if ((!$fileinfo) && (in_array($fileinfo, $availableMimes[$type]))) return true; \n \n # check browser provided mime-type second\n if (in_array($fieldData[$fieldName]['type'], $availableMimes[$type])) return true;\n }\n \n return false;\n }", "protected function check($file)\n {\n }", "private function isValidFullPath($path)\n {\n $valid = false;\n\n // TODO: Handle network shares?\n if (1 === preg_match('/^[a-z]+:\\\\\\\\/i', $path) && is_file($path)) {\n $valid = true;\n }\n\n return $valid;\n }", "public function validate() {\n $error = $this->error;\n switch ($error) {\n case UPLOAD_ERR_PARTIAL :\n case UPLOAD_ERR_NO_TMP_DIR :\n case UPLOAD_ERR_CANT_WRITE :\n $errCode = $this->getConfig(\"UPLOAD_ERROR_SYSTEM\");\n $errMessage = $this->getErrorMessage($errCode);\n throw new TMUploadException($errMessage);\n }\n\n $maxSize = (int) TMConfig::get(\"upload\", \"file_max_size\");\n if ($this->size > $maxSize * 1024) {\n $errCode = $this->getConfig(\"UPLOAD_ERROR_SIZE\");\n $errMessage = $this->getErrorMessage($errCode);\n throw new TMUploadException($errMessage);\n }\n\n $pix = TMUtil::getSuffix($this->name);\n if (!in_array($pix, $this->getValidatedTypes($this->configTypes))) {\n $errCode = $this->getConfig(\"UPLOAD_ERROR_PIX\");\n $errMessage = $this->getErrorMessage($errCode);\n throw new TMUploadException($errMessage);\n }\n }", "public function validateFile($file, array $params)\n {\n if ($fileName = dahl_dev::getConfig()->renderFilename($file, $params)) {\n return $fileName;\n }\n $fileName = parent::_renderFilename($file, $params);\n $testFile = (empty($params['_relative']) ? '' : Mage::getBaseDir('design') . DS) . $fileName;\n if (!file_exists($testFile)) {\n return false;\n }\n return $fileName;\n }" ]
[ "0.7575557", "0.7127265", "0.69352615", "0.69352615", "0.6767904", "0.6696189", "0.6690996", "0.66783845", "0.66282964", "0.65880644", "0.6585017", "0.6567576", "0.6559778", "0.64983726", "0.6414801", "0.63917", "0.6376757", "0.6370089", "0.634845", "0.6341636", "0.63335735", "0.6325847", "0.63245124", "0.6307531", "0.6281122", "0.6278025", "0.62507534", "0.6236343", "0.62354416", "0.62283003", "0.6221105", "0.6183983", "0.6163038", "0.61547863", "0.6147915", "0.6137909", "0.6131711", "0.6117752", "0.6108594", "0.6095167", "0.60931766", "0.6088618", "0.60844564", "0.6062272", "0.6058047", "0.60448706", "0.60415494", "0.6035537", "0.6034945", "0.6030249", "0.6029695", "0.6027063", "0.6011943", "0.60101813", "0.5999975", "0.5999975", "0.59956855", "0.59906626", "0.59829515", "0.5968186", "0.5960494", "0.5942616", "0.59391904", "0.5934134", "0.59325475", "0.59283227", "0.59195095", "0.59149903", "0.59144735", "0.59133357", "0.5910501", "0.590173", "0.58968234", "0.58776885", "0.5860328", "0.5852302", "0.58407366", "0.5840485", "0.583847", "0.58338445", "0.5828471", "0.5819687", "0.58170384", "0.58119726", "0.5796886", "0.5788719", "0.5778297", "0.577655", "0.5765642", "0.57655734", "0.5765433", "0.57604474", "0.57604134", "0.5756611", "0.5756099", "0.5755462", "0.5747579", "0.5742245", "0.57396257", "0.5731958" ]
0.6988501
2
Execute the query and return the result
function execSql($query) { if ($result = mysql_query($query, $this->linkDatabaseSrc)) { return $result; } else { return 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function execute() {\n $query = $this->db->query($this->sql);\n return $query->result();\n }", "public function execute()\n {\n \tif ( $this->cur_query != \"\" )\n \t{\n \t\t$res = $this->query( $this->cur_query );\n \t}\n \t\n \t$this->cur_query \t= \"\";\n \t$this->is_shutdown \t= false;\n\n \treturn $res;\n }", "public function execute()\n {\n return $this->query($this->sSql);\n }", "public function execute()\n\t{\n\t\t// Use cached results if found (previous count() or other internal call)\n\t\tif($this->activeQueryResults) {\n\t\t\t$results = $this->activeQueryResults;\n\t\t} else {\n\t\t\tif($this->activeQuery instanceof phpDataMapper_Database_Query_Interface) {\n\t\t\t\t$results = $this->query($this->activeQuery->sql(), $this->activeQuery->getParameters());\n\t\t\t\t$this->activeQueryResults = $results;\n\t\t\t} else {\n\t\t\t\t$results = array();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $results;\n\t}", "protected function execute()\n{\n\t$this->result = $this->db->query($this->getSql());\n\t$this->position = 0;\n\t$this->data = array();\n\n\treturn $this->result;\n}", "public function execute()\n {\n return $this->_execute();\n }", "public function execute() { \n return $this -> stmt -> execute();\n }", "public function execute() {\n $this->query->filter($this->filter);\n $data = $this->query->execute();\n $results = $data['results'];\n\n if (!$results) {\n return;\n }\n\n return entity_load($this->EntityType, array_keys($results));\n }", "public function run(){\n $sql = $this->sql();\n return $this->query($sql,$this->args);\n }", "public function executeQuery() \r\n\t{\r\n\t\t$Result = $this->objStatement->execute();\r\n\t\t\r\n\t\tif($Result)\r\n\t\t{\r\n\t\t\t$Result = new DatabaseStatement($this->objStatement);\r\n\t\t}\r\n\t\t\r\n\t\treturn $Result;\r\n\t}", "public function executeQuery() {\r\n\t\t$query = $this->query;\r\n\t\t$query->matching($query->logicalAnd($this->queryConstraints));\r\n//$parser = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\Storage\\\\Typo3DbQueryParser'); \r\n//$queryParts = $parser->parseQuery($query); \r\n//\\TYPO3\\CMS\\Core\\Utility\\DebugUtility::debug($queryParts, 'Query Content');\r\n\t\t$queryResult = $query->execute()->toArray();\r\n\t\t$this->setSelectedPageUids($queryResult);\r\n\t\t$this->resetQuery(); \r\n\t\treturn $queryResult;\r\n\t}", "protected abstract function executeQuery(Result $result);", "public function execute()\n {\n return $this->riak->execute($this);\n }", "public function execute()\n {\n return $this->riak->execute($this);\n }", "public function execute()\n\t{\n\t\t$this->query->setFetchMode($this->fetchMode);\n\n\t\t$this->query->execute($this->params);\t\n\n\t\t// Fetch the data in the appropriate format\n\t\tswitch ($this->fetchMethod) {\n\t\t\tcase 'row':\n\t\t\t\t$this->result = $this->query->fetch();\n\t\t\t\tbreak;\n\t\t\tcase 'field':\n\t\t\t\t$this->result = $this->query->fetchColumn();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->result = $this->query->fetchAll();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function execute() \r\n\t{\r\n\t\treturn $this->objStatement->execute();\r\n\t}", "final public function execute()\n {\n return $this\n ->finalize()\n ->getDB()\n ->execute($this);\n }", "public function ExecuteQuery($query){\n\t\treturn $this->db_con->query($query);\n\t}", "public function Execute()\r\n {\r\n $this->PREPARE_STATEMENT($this->sql);\r\n return $this->EXECUTE_STATEMENT($this->statement);\r\n \r\n }", "public function execute($sql) {\n $this->result = $this->conn->query($sql);\n return $this->result;\n }", "public function execute()\n\t{\n\t\t$this->arrParams = func_get_args();\n\n\t\tif (is_array($this->arrParams[0]))\n\t\t{\n\t\t\t$this->arrParams = array_values($this->arrParams[0]);\n\t\t}\n\n\t\treturn $this->query();\n\t}", "public function execute($query);", "public function executeQuery($q){ $this->makeConnection();\n //check for SQL injection\n\n //execute query\n $results = $this->connection->query($q);\n\n return $results;\n\n }", "private function execute () {\n if($this->_query->execute()) {\n\n // It has been succesful so add the output to $this->results and set it as an object\n $this->_results = $this->_query->fetchAll(PDO::FETCH_OBJ);\n\n // Set the affected row count to $this->_count\n $this->_count = $this->_query->rowCount();\n\n } else {\n\n // The query failed so set $this->_error to true. MORE WORK NEEDED HERE\n $this->_error = true;\n\n }\n }", "public function execute()\n {\n $query = $this->__toString();\n if (!empty($this->params)) {\n $statement = $this->pdo->prepare($query);\n $statement->execute($this->params);\n return $statement;\n }\n return $this->pdo->query($query);\n }", "public function Execute($sql) {\r\n return $this->_connection->query($sql);\r\n }", "public function execute($sql){\n\t $query = DB::query(Database::SELECT, $sql);\n\t return $query->execute($this->database);\n\t}", "public function query();", "public function query();", "public function query();", "abstract public function query();", "public function execute($sql)\n {\n $this->result = $this->conn->query($sql);\n return $this->result;\n }", "public function execute() {\n try {\n return $this->statement->execute();\n } catch (PDOException $e) {\n $this->error = $e->getMessage();\n die($this->error);\n }\n }", "public static function execute()\n {\n if(DEBUG_QUERIES)\n {\n $start = microtime();\n }\n $r = self::$stmt->execute();\n if(DEBUG_QUERIES)\n {\n $elapsed = round(microtime() - $start, 4);\n isset(Core::$benchmark['db']['count']) ? Core::$benchmark['db']['count']++ : Core::$benchmark['db']['count'] = 1;\n isset(Core::$benchmark['db']['elapsed']) ? (Core::$benchmark['db']['elapsed']+$elapsed) : Core::$benchmark['db']['elapsed'] = $elapsed;\n }\n if(self::$stmt->errorCode() !== '00000')\n {\n trigger_error(json_encode(self::$stmt->errorInfo()));\n }\n return $r;\n }", "public function execute(){\n\t\treturn $this->stmt->execute();\n\t}", "public function executeQuery($query) {\r\n\t\t\r\n\t\t$this->mdb2->connect();\r\n\t\t\t\t\r\n\t\t$ResultSet = $this->mdb2->query($query);\r\n\t\t\r\n\t\t$this->mdb2->disconnect();\r\n\t\t\r\n\t\tif (PEAR::isError($ResultSet)) {\r\n\t\t\tdie($ResultSet->getMessage() . \": \" . $query);\r\n\t\t}\r\n\t\t\r\n\t\treturn $ResultSet;\r\n\t\t\r\n\t}", "function executeQuery($query);", "public function execute(){\r\n return $this->stmt->execute();\r\n }", "public function execute()\n {\n /* If there's a select limit, capitalize on it */\n if($this->limit) {\n $this->query .= ' LIMIT ' . $this->limit;\n }\n \n /* If executement arguments has values, execute statement with\n the values */\n if(count($this->values) != 0) {\n /* Execute query in prepared format */\n $request = $this->pdo->prepare($this->getQuery());\n \n /* Append values to execute */\n $request->execute($this->values);\n }else if(count($this->values) == 0) {\n /* Run query if values is empty */\n $request = $this->pdo->query($this->getQuery());\n }\n /* Reset values array for next query */\n $this->values = [];\n \n /* If execution action is fetch, return ->fetchAll(); */\n if($this->action == 'fetch') {\n return $request->fetchAll();\n }\n \n /* If execution action is rows, return ->rowCount(); */\n if($this->action == 'rows') {\n return $request->rowCount();\n }\n \n /* Else return self */\n return $this;\n }", "public function executeQuery($sql){\n return DB::executeQuery($this->db, $sql);\n }", "public function executeQuery($query){\n\t\n $resultQuery = mysqli_query($this->link, $query) or die (\"Requete => PROBLEME\");\n return $resultQuery;\n }", "abstract public function execute($query);", "public function executeQuery($query) {\n\t\t$result = $this->connection->query($query);\n\t\t$this->rowsAffected = $this->connection->affected_rows;\n\t\t\t\n\t\tif(!$result) {\n\t\t\tthrow new DBException(\"Unable to execute query: \" . $query);\n\t\t}\n\t\treturn $result;\n\t}", "public function execute($sql) {\n\t\t\t$this->result = mysqli_query($this->conn, $sql);\n\t\t\treturn $this->result;\n\t\t}", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute(): ResultSet\n {\n if (null === $this->statement) {\n $this->prepare();\n }\n return $this->statement->execute($this->getParameters());\n }", "public function execute(): Statement;", "protected function execute_single_query(){\n\t\t$this -> open_connection();\n\t\t$this -> conn -> query($this -> query);\n\t\t$this -> close_connection();\n\t}", "private function executeQuery() {\n\t\t$recordset = $this->getConnection()->execute( $this );\n\t\t\n\t\tif( $recordset === false ) {\n\t\t\t$this->_recordset = array();\n\t\t} else {\n\t\t\t$this->_recordset = $recordset;\n\t\t}\n\n\t\t$this->_currentRow = 0;\n\t\t$this->isDirty( false );\n\t}", "public function execute() {\n return $this->stmt->execute();\n }", "public static function query();", "function query($sql) {\r\n\t\treturn $this->execute($sql);\r\n\r\n\t}", "public function execute($sql){\n\t\treturn mysql_query($this->connection,$sql);\n\t}", "public function query()\n\t\t{\n\t\t\t\n\t\t\t$this->prep = $this->pdo->prepare($this->query);\n\n\t\t\tif($this->prep){\n\t\t\t\t$this->prep->execute();\n\n\t\t\t\treturn $this->prep->fetchall(PDO::FETCH_ASSOC);\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "public static function execute()\n {\n //bind params\n foreach ( self::$_BINDS as $k => $_b ):\n $type = \\PDO::PARAM_STR;\n if ( $_b['type'] ):\n $type = self::getDataType( $_b['type'] );\n endif;\n\n $length = NULL;\n if ( $_b['size'] ):\n $length = (int) $_b['size'];\n endif;\n $k++;\n self::$stmt->bindParam( $k, $_b['value'], $type, $length );\n endforeach;\n self::$_BINDS = array(); //reset\n return self::$stmt->execute();\n }", "private function query() {\n return ApplicationSql::query($this->_select, $this->_table, $this->_join, $this->_where, $this->_order, $this->_group, $this->_limit, $this->_offset);\n }", "public function executeQuery($sql)\r\n\t{\r\n\t\t//return qocqal_query($sql);\r\n\t}", "public function getResults()\n {\n return $this->execute();\n }", "public function execute($query) {\r\n\t\t\r\n\t\t$retval = mysql_query($query, $this->connection);\r\n\t\t$result = mysql_fetch_array($retval, MYSQL_ASSOC);\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "public function runQuery(){\n \n $query = $this->getQuery();\n $pager = $this->getPager();\n $modify_result = $this->getModifyResult();\n\n // set default number of results so that we don't output NULL as \n // total_results if there are errors\n $pager->setTotalResults( 0 );\n $results = array();\n \n if( !$this->getResponse()->hasErrors() ){\n \t\n \t $count_query = clone $query;\n\t $pager->setTotalResults( $count_query->count() );\n \t $pager->decorateQuery( $query );\n \n\t if( $pager->getPageSize() > 0 ){\n\t $db_results = $query->find();\n\t foreach( $db_results as $model ){\n\t $result_object = array();\n\t $modify_result( $model, $result_object );\n\t $results[] = $result_object;\n\t }\n\t }\n\t \n }\n \n $api_response_body = $this->getResponse()->getResponseBody();\n $api_response_body->setBody($results);\n \n }", "public function execute(){\n\t\ttry{\n\t\t\t#echo 'exectuteed...' ;\n\t\t\treturn $this->statement->execute() ;\n\t\t}catch(PDOException $e){\n\t\t\t$this->error = $e->getMessage() ;\n\t\t\techo $this->error ;\n\t\t}\n\t}", "public function result() {\n $this -> execute();\n return $this -> stmt -> fetch();\n }", "function db_execute($query)\n {\n /*\n * Execute the Query\n */\n $this->varifysql($query[\"SQL\"]);\n return $this->get_conn()->query($query[\"SQL\"], PDO::FETCH_ASSOC);\n }", "protected function executeQuery() {\n return array();\n }", "public function execute($query=null)\n {\n return static::query($query);\n }", "public function execute($sql) {\n\t\tif(SYS_USE_FIREPHP==1)\n\t\t\tPhpBURN_Message::output(\"[!Performing the query!]: $sql\");\n\t\treturn $this->getModel()->getConnection()->executeSQL($sql);\n\t\t//$this->resultSet = &$this->getModel()->getConnection()->executeSQL($sql);\n\t}", "private function ExecuteQuery()\n\t{\n\t\tswitch($this->querytype)\n\t\t{\n\t\t\tcase \"SELECT\":\n\t\t\t{\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$this->querydata = $this->stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"INSERT\":\n\t\t\tcase \"UPDATE\":\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$this->beginTransaction();\n\t\t\t\t\t$this->stmt->execute();\n\t\t\t\t\t$this->commit();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcatch (PDOException $e)\n\t\t\t\t{\n\t\t\t\t\t$this->rollBack();\n\t\t\t\t\techo(\"Query failed: \" . $e->getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function query($query){\n return $this->connection->query($query);\n }", "function runQuery()\n\t{\n\t\treturn $this->query;\n\t}", "public abstract function execute();", "public abstract function execute();", "public abstract function execute();", "public function result(){\n\t\t$this->execute() ;\n\t\treturn $this->statement->fetch(PDO::FETCH_ASSOC) ;\n\t}", "public function execQuery($sql){\n return mysql_query($sql);\n }", "function _execute($sql) {\n\t\t$result = sqlite_query($this->connection, $sql);\n\n\t\tif (preg_match('/^(INSERT|UPDATE|DELETE)/', $sql)) {\n\t\t\t$this->resultSet($result);\n\t\t\tlist($this->_queryStats) = $this->fetchResult();\n\t\t}\n\t\treturn $result;\n\t}", "public function execute()\n {\n $qb = $this->getBuiltQb();\n\n $query = $qb->getQuery();\n $query->setHydrationMode(Query::HYDRATE_ARRAY)->useQueryCache($this->useQueryCache);\n call_user_func_array([$query, 'useResultCache'], $this->useResultCacheArgs);\n\n return $query;\n }", "protected function get_results_from_query() {\n\t\t\t\t\n\t\t\t\t$this->open_connection();\n\t\t\t\t\n\t\t\t\tif (!$this->conn) {\n\t\t\t\t\tthrow new Excepcion('No se pudo Conectar a la BD: ' . mysql_error());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\n\t\t\t\t\t$result = $this->conn->query($this->query);\n\t\t\t\t\n\t\t\t\t\t\tif (!$result) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthrow new Excepcion('No se pudo ejecutar la consulta a la BD: ' . mysql_error());\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\treturn $result;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$result->close();\t\t\t\t\n\t\t\t\t$this->close_connection();\t\t\n\t\t\t\n\t\t}", "private function _executeQuery() \n\t{\n\t\t$this->_stmt->execute ( $this->_stmtData );\n\t\t\n\t\tif ($this->_stmt->rowCount () > 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn $this->_stmt->errorInfo();\n\t\t}\n\t}", "protected abstract function executeQuery($query);", "function fvls_db_ExecuteQuery($sql){\n\t\tglobal $FLVS_db_link;\n\t\tif( !$FLVS_db_link instanceof MySQLi )\n\t\t\treturn false;\n\n\t\tif ( !($response = $FLVS_db_link->query( $sql ) ) ){\n\t\t\tif( defined('FVLS_DEVELOPER_MODE') && FVLS_DEVELOPER_MODE )\n\t\t\t echo \"FV Link Shortener Error: mySQL Query Error - $FLVS_db_link->error | $sql\\n\";\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $response;\n\t}", "abstract public function execute();", "abstract public function execute();", "abstract public function execute();", "abstract public function execute();", "abstract function executeQuery($cons);", "public function query()\n\t{\n\t\t\n\t}", "public function ExecuteQuery($Query){\n\t\treturn $this->db->query($Query); \n\t}" ]
[ "0.8269502", "0.80444396", "0.7901628", "0.77636635", "0.7699635", "0.76198876", "0.75933397", "0.75763005", "0.7562325", "0.7505001", "0.74533737", "0.74245507", "0.7413114", "0.7413114", "0.73607415", "0.73559034", "0.7348902", "0.73341733", "0.72783697", "0.72475666", "0.7224674", "0.72185665", "0.72169536", "0.721219", "0.7152748", "0.714932", "0.7146954", "0.7132525", "0.7132525", "0.7132525", "0.7117155", "0.70947945", "0.709237", "0.7073645", "0.70702547", "0.70556927", "0.70270693", "0.70051056", "0.7003344", "0.6999852", "0.6974563", "0.69727844", "0.69619846", "0.6955359", "0.6946103", "0.6946103", "0.6946103", "0.6946103", "0.6946103", "0.6946103", "0.6946103", "0.6946103", "0.6946103", "0.6946103", "0.6946103", "0.6946103", "0.6946103", "0.6946103", "0.6946103", "0.6941229", "0.6940075", "0.69253725", "0.6924793", "0.6918474", "0.690957", "0.6900394", "0.6888572", "0.6885456", "0.6859044", "0.68582374", "0.6857026", "0.6845959", "0.6840312", "0.68344486", "0.6834333", "0.6821422", "0.68159235", "0.6802438", "0.67976797", "0.679576", "0.6784972", "0.6781309", "0.67714995", "0.677141", "0.677141", "0.677141", "0.6768697", "0.67551494", "0.6752805", "0.6731639", "0.6722443", "0.67133", "0.6706623", "0.67026263", "0.670096", "0.670096", "0.670096", "0.670096", "0.6700507", "0.66975105", "0.6696074" ]
0.0
-1
Execute the query and return the new record Id
function execSqlId($query) { if ($result = mysql_query($query, $this->linkDatabaseSrc)) { $result=mysql_insert_id(); return $result; } else { return 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newId(){ // get array of rows objects\r\t\treturn sqlite_last_insert_rowid ($this->handle);\r\t}", "function _createAndReturnId($sql, $updateParent) {\n $inserted = $this->update($sql);\n if ($inserted) {\n $dar = $this->retrieve(\"SELECT LAST_INSERT_ID() AS id\");\n if ($row = $dar->getRow()) {\n $inserted = $row['id'];\n if ($inserted && $updateParent) {\n $this->_updateUpdateDateOfParent($row['id']);\n }\n } else {\n $inserted = $dar->isError();\n }\n }\n return $inserted;\n }", "abstract protected function _getInsertId();", "public function insertId()\r\n\t{\r\n\t\t//orcal_last_inserted_id($this->link)\r\n\t}", "public function checkIdNew() {\r\n $q = $this->dbConnect()->prepare('SELECT id FROM new WHERE id = :id');\r\n $q->execute(array(\r\n 'id' => $this->id()\r\n ));\r\n $row = $q->rowCount();\r\n\r\n return $row;\r\n }", "private function execReturnId($connection, $query, $params) {\n $statement = $connection->prepare($query);\n $this->bindParameters($statement, $params);\n $statement->execute();\n $id = -1;\n while ($obj = $statement->fetch(PDO::FETCH_OBJ)) {\n $id = $obj->id;\n }\n return $id;\n }", "function Insert_ID()\n\t{\n\t\treturn $this->GetOne($this->identitySQL);\n\t}", "private static function getNewId()\n {\n return DB::table('cashouts')->get()->count() + 1;\n }", "public function getIncrementId();", "public function submit()\n\t{\n\t\t$identifier = $this->sql_id_field;\n\n\t\tif (!$this->$identifier)\n\t\t{\n\t\t\treturn $this->insert();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->update();\n\t\t}\n\t}", "function execute() {\r\n\t\t$articleDao =& DAORegistry::getDAO('ArticleDAO');\r\n\r\n\t\t// Update article\r\n\t\t$article =& $this->article;\r\n\t\tif ($article->getSubmissionProgress() <= $this->step) {\r\n\t\t\t$article->stampStatusModified();\r\n\t\t\t$article->setSubmissionProgress($this->step + 1);\r\n\t\t}\r\n\t\t$articleDao->updateArticle($article);\r\n\r\n\t\treturn $this->articleId;\r\n\t}", "function wrapper_insert_id() {\n\t\t$res = @mssql_query(\"SELECT @@IDENTITY\", $this->link_id);\n\t\t$rows = @mssql_result($res, 0, 0);\n\t\treturn (int)$rows;\n\t}", "public function getInsertId();", "public function get_new_id()\n {\n $query = \"select MAX(id) as id from team\";\n $res = $this->db->query($query);\n $res->result_array();\n $last_id = ($res->result()[0]->id)+1;\n return $last_id;\n }", "protected function getLastPrimaryKey()\n {\n return $this->getLastEntityId();\n }", "function lastID(){\n return pg_last_oid($this->consulta);\n }", "abstract public function insertId();", "abstract public function insertId();", "abstract public function insertId();", "public function insertAndReturnID($sql){\n\t\t$this->query($sql);\n\t\treturn $this->insert_id();\n\t}", "private function executeQuery() {\n\t\t$recordset = $this->getConnection()->execute( $this );\n\t\t\n\t\tif( $recordset === false ) {\n\t\t\t$this->_recordset = array();\n\t\t} else {\n\t\t\t$this->_recordset = $recordset;\n\t\t}\n\n\t\t$this->_currentRow = 0;\n\t\t$this->isDirty( false );\n\t}", "abstract public function insert_id();", "public function lastInsertedId()\n\t{\n\t\t// verify that a query was run\n\t\tif (is_resource($this->_results) === false)\n\t\t{\n\t\t\tthrow new DatabaseException('',\n\t\t\t\tDatabaseException::QUERY_NOT_RUN);\n\t\t}\n\n\t\t// check connection\n\t\t$this->_checkConnection();\n\n\t\t// get the last id\n\t\treturn mysql_insert_id($this->_connection);\n\t}", "public function insertData()\n {\n try {\n// print_r($this->insertUpdateArray);exit;\n $id = DB::table($this->dbTable)->insertGetId($this->insertUpdateArray);\n } catch (Exception $ex) {\n throw new Exception($ex->getMessage(), 10024, $ex);\n }\n return $id;\n }", "public function getLastId(){\n return $this->con->insertId();\n }", "function lastId()\n {\n return isset($this->_query) ? $this->_query->lastId() : $this->_lastid;\n }", "function executeSQLStatementGetID($connection, $sqlStatement){\n\t//Execute the prepared SQL\n\tif (!$sqlStatement->execute()) {\n\t\techo \"Execute of SQL Statement failed: $sqlStatement->error\";\n\t\t$connection->rollback();\n\t}\n\t//Return the ID of last inserted row\n\treturn mysqli_insert_id($connection);\n}", "function load_id(){\r\n $db = new Database();\r\n $sql = \"select * from \" . Interest::TABLE_NAME . \" where name=:name\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':name', $this->name);\r\n $stm->execute();\r\n if ($stm->rowCount() > 0){\r\n $row = $stm->fetch();\r\n $this->id = $row[\"id\"];\r\n }\r\n else{\r\n $this->save();\r\n $this->id = $db->pdo->lastInsertId();\r\n }\r\n }", "function modeling_publicusershistoriakses_createid( $tbl_publicusers_historiakses ){\n$sql = mysql_query(\"SELECT * FROM $tbl_publicusers_historiakses ORDER BY id DESC\");\n$result = mysql_fetch_object($sql);\n$id = $result->id + 1;\nreturn $id;\n}", "function fetchAndIncID ($collection, $dao) {\n $newIDResult = mysql_query(\"SELECT * FROM \" . $collection . \";\", $dao);\n $newID = mysql_fetch_row($newIDResult);\n \n // Then increment the id\n $updateResult = mysql_query(\"UPDATE \" . $collection . \" SET id=id+1;\");\n return $newID[0];\n }", "public function getRecordId()\n {\n return $this->record_id;\n }", "abstract public function InsertId();", "public function insert_id();", "function last_insert_id( &$result, $pk, $table ) {\n trigger_before( 'last_insert_id', $this, $this );\n $res = @mysql_insert_id($this->conn);\n if (!$res) {\n trigger_error(\"unable to determine last_insert_id in mysql.php \".@mysql_error($this->conn), E_USER_ERROR );\n } else {\n return $res;\n }\n }", "public function getRecordId()\n {\n return $this->get(self::_RECORD_ID);\n }", "function getNewId();", "public function save()\n {\n $this->data = $this->toArray();\n if (empty($this->id)) {\n unset($this->data[self::ID]);\n $this->insert();\n } else {\n $this->update();\n }\n try {\n $this->query->execute($this->data);\n\n if ($this->pdo->lastInsertId()) {\n $this->id = $this->pdo->lastInsertId();\n }\n\n return ($this->pdo->lastInsertId() != null) ? (int)$this->pdo->lastInsertId() : null;\n } catch (Exception $ex) {\n echo $ex->getMessage();\n }\n }", "function insertId();", "public static function insertId() {\n\treturn self::$instance->insertId();\n }", "public function getOriginalIncrementId();", "public function insertAndGetId($sql, $params = array());", "public function datai($sql) {\n //$this->getDB()->query($sql);\n $this->data($sql);\n return $this->getDB()->insert_id;\n }", "protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }", "public function insertId() {\n\t\tif (!$this->connection) return false;\n\t\t$result = @pg_query($this->connection, 'SELECT lastval()');\n\t\tif ($result === false) return false;\n\t\t$return = @pg_fetch_array($result);\n\t\tpg_free_result($result);\n\t\treturn is_array($return) ? reset($return) : false;\n\t}", "public function execute($sql){\n $inserted = $this->db->prepareStatementForSqlObject($sql)->execute();\n return $inserted->getGeneratedValue();\n }", "public function initialInsert($long) {\n\t\t// Check if the record already exists\n\t\t$id = $this->exists($long);\n\t\tif ($id > -1)\n\t\t\treturn $id;\n\n\t\t// Bind parameters\n\t\t$this->insertStatement->bind_param('s', $long);\n\t\t\t\n\t\t// Execute\n\t\tif (!$this->insertStatement->execute()) {\n\t\t\techo \"Execute failed: (\" . $this->insertStatement->errno . \") \" . $this->insertStatement->error;\n\t\t}\n\t\t\n\t\treturn $this->insertStatement->insert_id;\n\t}", "public function getRecordId()\n {\n return $this->recordId;\n }", "public function getRecordId()\n {\n return $this->recordId;\n }", "public function execQueryLid($sql)\n {\n if($this->dbConn->exec($sql) > 0)\n {\n return (int) $this->dbConn->lastInsertId();\n }\n\n return 0;\n }", "public function sql_insert_id() {}", "public function sql_insert_id() {}", "abstract public function getLastInsertId();", "public static function getLastRowId()\n {\n return self::$id;\n }", "public function qid(){\n\t\treturn $resultset = $this->showErrors ? mysqli_insert_id($this->connection) : @mysqli_insert_id($this->connection);\n\t}", "protected function queryID(string $sql, array $params = [], array $options = []) {\n $options += [Db::OPTION_FETCH_MODE => 0];\n $this->query($sql, $params, $options);\n $r = $this->getPDO()->lastInsertId();\n\n return is_numeric($r) ? (int)$r : $r;\n }", "public function intGetNewId() {\n $this->XaoThrow(\n \"_EntBase::Build(): This entity does not implement retrieval of a \".\n \"new numeric identifier as a descrite function. It may not be \" .\n \"applicable.\"\n , debug_backtrace()\n );\n }", "function get_insert_number() {\r\n $conn = $this->db->conn_id;\r\n $stmt = oci_parse($conn, \"BEGIN :v_Return := PRODUCT_ACTIONS.NEXT_INSERT_NUMBER(); END;\");\r\n oci_bind_by_name($stmt, ':v_Return', $result, SQLT_STR);\r\n\r\n if (!oci_execute($stmt)) {\r\n return oci_error($stmt);\r\n }\r\n return $result;\r\n }", "public function last_inserted_id($resource, $query) {\n\t\t\t$regexp = \"/into ((?:[\\w_-])+|(?:(\\\"|')+[^\\\"]*(\\\"|')+))(?: |\\()/i\";\n\t\t\t$matches = array();\n\t\t\tpreg_match($regexp, strtolower($query), $matches);\n\n\t\t\t// remove quotes and whitespace from end of string\n\t\t\t$tablename = trim($matches[1], \"\\\"' \");\n\n\t\t\t$last_id = null;\n\t\t\t$seq = \"{$tablename}_seq\";\n\t\t\t$q = \"SELECT last_number FROM user_sequences WHERE LOWER(sequence_name)='{$seq}'\";\n\t\t\t$stmt = oci_parse($resource, $q);\n\t\t\toci_execute($stmt);\n\t\t\t$num_rows = oci_fetch_all($stmt, $dummy);\n\t\t\toci_free_statement($stmt);\n\t\t\tif($num_rows) {\n\t\t\t\t$q = \"SELECT {$seq}.currval FROM DUAL\";\n\t\t\t\t$stmt = oci_parse($resource, $q);\n\t\t\t\toci_execute($stmt);\n\t\t\t\t$last_id = current(oci_fetch_row($stmt));\n\t\t\t\toci_free_statement($stmt);\n\t\t\t}\n\t\t\treturn $last_id;\n\t }", "protected function lastInsertedId() {\n\t\t// envoi de la request\n\t\t{\n\t\t\t$sql = \"SELECT IDENTITY_VAL_LOCAL() as ID FROM \".$this->getTableName().\" FETCH FIRST 1 ROWS ONLY\";\n\t\t\t$q1 = query_db2($sql, true);\n\t\t\t$results = result_db2($q1);\n\t\t}\n\t\t\n\t\t// analyse des resultats\n\t\t{\n\t\t\tif (empty($results)) {\n\t\t\t\tunset($sql, $q1, $results);\n\t\t\t\treturn (null);\n\t\t\t}\n\t\t\t$res = $results['ID'];\n\t\t}\n\t\t\n\t\t// retour\n\t\tunset($sql, $q1, $results);\n\t\treturn ($res);\n\t}", "public function insertGetId()\n {\n return $this->lastId;\n }", "public function insertGetId()\n {\n return $this->lastId;\n }", "public function execute() {\n if (empty($this->recordId)) {\n throw new FileMakerException($this->fm, 'Duplicate commands require a record id.');\n }\n $params = $this->_getCommandParams();\n $params['-dup'] = true;\n $params['-recid'] = $this->recordId;\n $result = $this->fm->execute($params);\n return $this->_getResult($result);\n }", "function saveToRecord() {\n\t\t$fields_values = $this->toArray();\n\t\t$fields_values['tstamp'] = mktime();\n\t\t$fields_values['crdate'] = mktime();\n\t\tunset($fields_values['uid']);\n\t\t\n\t\t// If we have a non-zero UID, update an existing record, otherwise create a new record\n\t\tif($this->getUID()) {\n\t\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_wecassessment_result', 'uid=' . $this->getUID(), $fields_values);\n\t\t} else {\n\t\t\t$GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_wecassessment_result', $fields_values);\n\t\t\t$this->setUID($GLOBALS['TYPO3_DB']->sql_insert_id());\t\t\t\n\t\t}\n\t\t\n\t\t$answers = $this->getAnswers();\n\t\tforeach((array) $answers as $answer) {\n\t\t\t$answer->setResultUID($this->getUID());\n\t\t\t$answer->save();\n\t\t}\n\t\t\n\t\t// Blow up session data\n\t\ttx_wecassessment_sessiondata::storeSessionData(null, $this->getPID());\n\t\t\n\t\treturn $this->_uid;\n\t}", "public function save()\n\t{\n\t\t$data = ['criteria' => $this -> criteria,\n\t\t\t\t 'dbname' => $this -> dbname,\n\t\t\t\t 'tblname' => $this -> tblname];\n\n\t\t$result = $this -> connection -> setTable($this -> entity)\r\n\t\t\t\t\t\t\t\t\t -> saveRec($data);\n\t\tif ($result) {\n\t\t\t$this -> id = $result;\n\t\t\treturn $this;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function insert(){\r\n\t\tif (!$this->new){\r\n\t\t\tMessages::msg(\"Cannot insert {$this->getFullTableName()} record: already exists.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$this->beforeCommit();\r\n\t\t\r\n\t\t$vals = array();\r\n\t\t$error = false;\r\n\t\tforeach ($this->values as $name=>$value){\r\n\t\t\tif ($value->isErroneous()){\r\n\t\t\t\tFramework::reportErrorField($name);\r\n\t\t\t\t$error = true;\r\n\t\t\t}\r\n\t\t\t$vals[\"`$name`\"] = $value->getSQLValue();\r\n\t\t}\r\n\t\tif ($error){\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$sql = 'INSERT INTO '.$this->getFullTableName().' ('.implode(', ',array_keys($vals)).') VALUES ('.implode(', ',$vals).')';\r\n\t\tif (!SQL::query($sql)->success()){\r\n\t\t\tMessages::msg('Failed to insert record into '.$this->getFullTableName().'.',Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t// Get this here, because getPrimaryKey can call other SQL queries and thus override this value\r\n\t\t$auto_id = SQL::getInsertId();\r\n\t\t\r\n\t\t$table = $this->getTable();\r\n\t\t// Load the AUTO_INCREMENT value, if any, before marking record as not new (at which point primary fields cannot be changed)\r\n\t\tforeach ($table->getPrimaryKey()->getColumns() as $name){\r\n\t\t\tif ($table->getColumn($name)->isAutoIncrement()){\r\n\t\t\t\t$this->$name = $auto_id;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->new = false;\r\n\t\t$this->hasChanged = false;\r\n\t\tforeach ($this->values as $value){\r\n\t\t\t$value->setHasChanged(false);\r\n\t\t}\r\n\t\t\r\n\t\t$this->afterCommit();\r\n\t\t\t\r\n\t\treturn self::RES_SUCCESS;\r\n\t}", "public function determineId() {}", "public function lastId();", "protected function getLastID()\n {\n return $this->driver->getInsertId();\n }", "public function insert() {\n\t\t$insert_array = $this->toDbArray(true, true);\n\t\tif (array_key_exists('_id', $insert_array)) { unset($insert_array['_id']); }\n\t\t$ret_val = $this->getCollection()->save($insert_array);\n\t\tif (isset($insert_array['_id'])) {\n\t\t\t$this->setId($insert_array['_id']);\n\t\t}\n\t\treturn $this->getId();\n\t}", "public function save(){\n\t\t\n\t\tif(!isset($this->data[$this->primary_key])){\n\t\t\t$success = $this->db\n\t\t\t\t->set($this->data)\n\t\t\t\t->insert($this->table);\n\n\t\t\t$this->data[$this->primary_key] = $this->db->last_insert_id;\n\t\t}else{\n\t\t\t$success = $this->db\n\t\t\t\t->set($this->data)\n\t\t\t\t->where($this->primary_key, $this->data[$this->primary_key])\n\t\t\t\t->update($this->table);\n\t\t}\n\n\t\treturn $success;\n\t}", "public function saveRecord(){\r\n\t\t$db = Zend_Registry::get('db'); // used for all in transaction\r\n\t\t$this->setDbAdapter( $db );\r\n\r\n\t\t$userId = User_Library_Helper_Utils::currentUserId();\r\n\t\tif($userId){\r\n\t\t\t$this->setUserId( $userId );\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$this->setMessageState( 'missingUserId');\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif( !$this->getMaintenanceRequestId() ){\r\n\t\t\t$this->setMessageState( 'missingRequestId');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse{\r\n\t\t\ttry{\r\n\t\t\t\t$db->beginTransaction();\r\n\t\t\t\t$this->unsetCurrent();\r\n\t\t\t\t$this->setCurrentStatus(1);\r\n\t\t\t\t$id = $this->save();\r\n\t\t\t\t$db->commit();\r\n\t\t\t\treturn $id;\r\n\t\t\t}\r\n\t\t\tcatch ( Exception $e) {\r\n\t\t\t\t$db->rollBack();\r\n\t\t\t\techo $e->getMessage();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function getPrimaryKey()\n {\n return $this->getSubject()->getLastEntityId();\n }", "public function get_new_id() {\n $_sql = \"select max(`article_id`) as `amount` from `\" . $this->db_name . \"`.`\" . $this->db_article . \"` \";\n $_sql .= \"where 1\";\n\n $mysql = new mysql\\Mysql;\n $mysql->connect();\n $mysql->sql($_sql);\n $values = $mysql->getResult();\n $mysql->disconnect();\n\n echo intval($values[0][\"amount\"]) + 1;\n }", "public function getLastId();", "public function getLastId();", "function InsertRecord($post) {\n $this->db->insert('purchase',$post);\n $last_id = $this->db->insert_id();\n return $last_id;\n }", "function crea_id_imm(){\n\t$db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\t$q_crea_id_imm = \"SELECT * FROM ultimo_id_imm LIMIT 1\";\n\t$r_crea_id_imm = $db->query($q_crea_id_imm);\n\t$ro_crea_id_imm = mysql_fetch_array($r_crea_id_imm);\n\t$id_imm = $ro_crea_id_imm['id_imm'];\n\t$q_agg=\"update ultimo_id_imm set id_imm = id_imm+1\";\n\t$r_agg=$db->query($q_agg);\n\t\n\treturn $id_imm;\n}", "abstract public function get_id();", "private function newId() {\n $exist_nums = App::getDb()->query('SELECT idCat FROM categories ORDER BY idCat');\n $exist_nums = $exist_nums->fetchAll(PDO::FETCH_OBJ);\n $new_id = 1;\n foreach($exist_nums as $nums) {\n if($nums->idCat != $new_id) break;\n $new_id++;\n }\n return $new_id;\n }", "public function query($sql){\n $this->_setAdapter($this->_adapter);\n\n $lastInsertId = $this->_adapter->query($sql);\n return $lastInsertId;\n }", "private function getNextTransactionID(){\n $db = $this->connectDB();\n $query = \"SELECT MAX(id) as curr_max_id FROM transaction;\";\n $stmt = $db->prepare($query);\n $stmt->execute();\n $stmt->store_result();\n $stmt->bind_result($curr_max_id);\n $stmt->fetch();\n // Return the current largest id plus 1 as the new ID.\n return $curr_max_id + 1;\n }", "abstract public function insertID();", "public function getLastId()\n {\n return $this->adodb->insert_Id();\n }", "public function executeQueryLid($sql, $params)\n {\n $stmt = $this->dbConn->prepare($sql, [PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY]);\n $stmt->execute($params);\n if($stmt->rowCount() > 0)\n {\n return (int) $this->dbConn->lastInsertId();\n }\n\n return 0;\n }", "protected function QueryForID_() {\n $table = Database::GetAccountTypeTableName($this->accountType);\n $queryStr = \"SELECT id FROM {$table} WHERE username='{$this->username}';\";\n\n $result = $this->db->sql->query($queryStr);\n\n if ($result && $result->num_rows > 0) {\n $this->id = $result->fetch_assoc()[\"id\"];\n $result->free();\n }\n }", "public function nextId()\r\n {\r\n $insert = $this->tableGateway->getSql()->insert();\r\n $insert->values(['id' => null]);\r\n\r\n $this->tableGateway->insertWith($insert);\r\n\r\n return $this->tableGateway->getLastInsertValue();\r\n }", "function get_last_id($query)\n\t{\n\t\t$con = $this->connect();\n\t\tif(mysqli_query($con,$query))\n\t\treturn mysqli_insert_id($con);\n\t}", "public function query($sql,$lastID=null){\n \n $sth = $this->conn->prepare($sql);\n $sth->execute();\n $arr = $sth->errorInfo();\n if(is_array($arr) and isset($arr[3])) die($arr[3]);\n \n if($lastID) return $this->conn->lastInsertId();\n else return $sth->rowCount();\n }", "function postStatic($conn, $sql){\n\t\t\tif($conn->query($sql) === TRUE){\n\t\t\t\t$last_id = $conn->insert_id;\n\t\t\t\treturn $last_id;\n\t\t\t} else {\n\t\t\t\techo \"Error:\" . $sql . \"<br\" . $conn->error;\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}", "public function getLastInsertId(): int;", "abstract public function getPrimaryKey();", "abstract public function getPrimaryKey();", "private function Execute(){\n $this->Connect();\n\n try{\n $this->Create->execute($this->Dados);\n $this->Result = $this->Conn->lastInsertId();\n $this->StatusInsert = true;\n\n }catch (PDOException $e){\n $this->Result = null;\n WSErro(\"<b>Erro ao cadastrar:</b> {$e->getMessage()}\", $e->getCode());\n }\n }", "function lastInsertId() {\n\t\treturn sqlite_last_insert_rowid($this->connection);\n\t}", "public function createRow($input)\n {\n $updateId = Members::insertGetId($input);\n\t\treturn $updateId;\n }", "private function _insert($data){\n if($lastId = $this->insert($data)){\n return $lastId;\n }else{\n // Error\n Application_Core_Logger::log(\"Could not insert into table {$this->_name}\", 'Error');\n return false;\n } \t\n }", "public function lastId() {\n\t\tif (is_null($this->lastId)) {\n\t\t\tthrow new Exception('Unable to get last ID - wrong query type');\n\t\t}\n\n\t\treturn $this->lastId;\n\t}", "function dbQueryId($query) {\n\t$db = dbConn();\n\t$result = mysqli_query($db,$query);\n\tif($result != false) {\n\t\treturn(mysqli_insert_id($db));\n\t}\n\terror_log(\"MySQL Query Error: \" . mysqli_error($db));\n\treturn(false);\n}", "function insert_id($table)\n\t{\n\t\t$results = $this->fetch(\"select currval('{$table}_seq') last_id\");\n\t\treturn $results['last_id'];\n\t}", "public function fetch_the_id() {}" ]
[ "0.6733775", "0.63934386", "0.63576955", "0.6353123", "0.6348524", "0.62796247", "0.6228253", "0.61323714", "0.60735536", "0.6032153", "0.6013569", "0.60049915", "0.5988195", "0.59806126", "0.59749764", "0.5974645", "0.59710234", "0.59710234", "0.59710234", "0.59642285", "0.59634805", "0.5948428", "0.594685", "0.593574", "0.59347737", "0.5928529", "0.59204584", "0.5919058", "0.59175104", "0.5913149", "0.59094644", "0.5907397", "0.58996123", "0.5887819", "0.58828425", "0.58783865", "0.5877107", "0.58643824", "0.5860213", "0.5856122", "0.58472615", "0.5846232", "0.58452654", "0.58390963", "0.58242565", "0.5815792", "0.58107126", "0.58107126", "0.58080465", "0.58036953", "0.5802941", "0.5802291", "0.57978624", "0.5797642", "0.5795343", "0.5794756", "0.5790561", "0.5781208", "0.5776668", "0.5767485", "0.5767485", "0.5765536", "0.5741096", "0.57363546", "0.5731209", "0.5727737", "0.5724745", "0.57225466", "0.57212484", "0.5716582", "0.57139426", "0.5709265", "0.5706383", "0.57020104", "0.57020104", "0.570164", "0.57005084", "0.5695477", "0.5684109", "0.56770194", "0.5674423", "0.56642675", "0.5646138", "0.5645168", "0.56438863", "0.5642627", "0.56397665", "0.56387", "0.56335294", "0.56268525", "0.5626032", "0.5626032", "0.5625659", "0.56232285", "0.56117445", "0.56108755", "0.5610826", "0.5607901", "0.56063545", "0.5605606" ]
0.63673633
2
Push a new message onto the queue.
public function push($data, string $info, array $metadata = [], ?int $delay = null);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function push($message);", "public function queue() {\n\t\t$this->prepareMessage();\n\t\t$this->queueRepository->add($this->toArray());\n\t}", "public static function push($message) : void\n {\n array_push(static::$stack, (string)$message);\n \n }", "public function publish($message, AbstractQueue $queue) \n {\n $queue->addMessage($message);\n }", "public function addMessage($message)\n {\n $this->storage[] = $message;\n }", "public function message($message): void\n {\n $this->messages[] = $message;\n }", "public function pushToQueue($queue, $message) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('pushToQueue', func_get_args()));\n }", "public function pushToQueue($queue, $message) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('pushToQueue', func_get_args()));\n }", "public function add_message( $new_message ) {\t\n\n\t\t$messages = $this->_read_messages();\n\n\t\tif( !is_array( $messages ) )\n\t\t\t$messages = array();\n\n\t\tarray_push( $messages, $new_message );\n\n\t\t$this->_write_messages( $messages );\n\t}", "public function push();", "public function push();", "public function add_message($message){\n $this->messages[] = $message;\n }", "public function addMessage($message) {\n $this->messages[] = $message;\n }", "public function addMessage($message)\n {\n $this->messages[] = $message;\n }", "public function pushToQueue($queue, $message)\n {\n $message = $message instanceof AMQPMessage\n ? $message\n : new AMQPMessage($message);\n\n $this->getChannel()->queue_declare($queue);\n $this->getChannel()->basic_publish($message, '', $queue);\n }", "public function enqueue($message = array()) {\n $this->_events->enqueue($message);\n }", "public function addMessage($message);", "public function execute() {\n $this->getQueue()->push($this->getJob(), $this->getJobOptions());\n }", "public function addMessage($message)\n\t{\n\t\t$this->messages[] = $message;\n\t}", "public function push(array $message, string $id = '*')\n {\n return Redis::get()->xAdd($this->key, $id, $message);\n }", "public function queue(Queue $queue, self $messageJob): void\n {\n $queue->pushOn($this->queue, $messageJob);\n }", "public function addMessageToQueue($message, $queue)\n {\n $this->queue->putInTube($queue, $message);\n }", "public static function sendMessage($message) {\n $context = new \\ZMQContext();\n $socket = $context->getSocket(\\ZMQ::SOCKET_PUSH, 'my pusher');\n $socket->connect(\"tcp://localhost:5555\");\n $socket->send($message);\n }", "public function push($item)\n {\n if ($this->getCount() == static::MAX_ITEMS) {\n\n throw new QueueException(\"Queue is full\");\n \n }\n \n $this->items[] = $item;\n }", "function send_message ($message)\t\t\t\t\n\t{\n\t\t$con = new Stomp('tcp://'.ACTIVEMQ_SERVER.':61613');\n\t\t$con->connect();\n\t\t$con->send(\"/queue/s3backup\", $message);\n\t\n\t}", "public function push(Token $t)\n {\n if (!isset ($this->queue))\n return;\n \n array_push($this->queue, $t);\n }", "function push($x) {\n return array_push($this->queue,$x);\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function testAddToQueue()\n {\n $this->setUpDB(['email']);\n \n $Email = new \\EmailTemplate('test');\n \n // Add the message to queue\n $r = $Email->queue('[email protected]', 'test', 'test');\n \n // get data from DB\n $EmailQueue = new \\EmailQueue();\n $filter = ['too' => '[email protected]'];\n $Collection = $EmailQueue->Get($filter, []);\n \n // asserts\n $this->assertEquals(1, $r);\n $this->assertInstanceOf(\\Collection::class, $Collection);\n $this->assertCount(1, $Collection);\n $Item = $Collection->getItem();\n $this->assertInstanceOf(\\SetterGetter::class, $Item);\n $this->assertEquals('test', $Item->getSubject());\n $this->assertEquals('test', $Item->getBody());\n }", "public function add($item)\n {\n $this->queueItems[] = $item;\n }", "function addNewMyQueue($myqueueName)\r\n {\r\n $time = time(); \r\n $q = \"INSERT INTO \".TBL_MYQUEUE.\" VALUES (NULL, '$myqueueName', $time )\";\r\n return mysql_query($q, $this->connection);\r\n }", "public function sendMessage($queueId, $message, $options = null);", "public function message(string $msg, array $params = []): void\r\n {\r\n $sendMessage = new AMQPMessage($msg, $params);\r\n $this->channel->basic_publish($sendMessage, '', $this->queue);\r\n }", "public function pushOn($queue, $job, $data = '');", "public function enqueue($item)\n {\n array_push($this->array, $item);\n }", "function sendMessageToQueue($messageObj){\n\tglobal $LAS_CFG;\n\t\n\t$daemon_host = $LAS_CFG->las_daemon_server['host'];\n\t$daemon_port = $LAS_CFG->las_daemon_server['port'];\n\t$daemon_url = 'tcp://'.$daemon_host.':'.$daemon_port;\n\t\n\t$client_timeout = $LAS_CFG->las_daemon_server['timeout'];\n\t\n\t$exchange_name = $LAS_CFG->message_server['taskQueue'];\n\t$new_routing_key = $exchange_name . $messageObj->routing_key;\n\t$messageObj->routing_key = $new_routing_key;\n\t\n\t// Convert JSON message to String\n\t$message = json_encode($messageObj);\n\t\n\t$server = new LasManager($daemon_url);\n\treturn $server->clientSendMessage($message, $client_timeout);\n}", "public function testQueue() {\n $node = $this->node;\n $message = Message::create([\n 'template' => 'foo',\n ]);\n\n $subscribe_options = [];\n $subscribe_options['save message'] = FALSE;\n\n try {\n $this->messageSubscribers->sendMessage($node, $message, [], $subscribe_options);\n $this->fail('Can add a non-saved message to the queue.');\n }\n catch (MessageSubscribeException $e) {\n $this->assertTrue(TRUE, 'Cannot add a non-saved message to the queue.');\n }\n\n // Assert message was saved and added to queue.\n $uids = array_fill(1, 10, new DeliveryCandidate([], [], 1));\n foreach ($uids as $uid => $candidate) {\n $candidate->setAccountId($uid);\n }\n $subscribe_options = [\n 'uids' => $uids,\n 'skip context' => TRUE,\n 'range' => 3,\n ];\n $queue = \\Drupal::queue('message_subscribe');\n $this->assertEquals($queue->numberOfItems(), 0, 'Queue is empty');\n $this->messageSubscribers->sendMessage($node, $message, [], $subscribe_options);\n $this->assertTrue((bool) $message->id(), 'Message was saved');\n $this->assertEquals($queue->numberOfItems(), 1, 'Message added to queue.');\n\n // Assert queue-item is processed and updated. We mock subscription\n // of users to the message. It will not be sent, as the default\n // notifier is disabled.\n $item = $queue->claimItem();\n $item_id = $item->item_id;\n\n // Add the queue information, and the user IDs to process.\n $subscribe_options['queue'] = [\n 'uids' => $uids,\n 'item' => $item,\n 'end time' => FALSE,\n ];\n\n $this->messageSubscribers->sendMessage($node, $message, [], $subscribe_options);\n\n // Reclaim the new item, and assert the \"last UID\" was updated.\n $item = $queue->claimItem();\n $this->assertNotEquals($item_id, $item->item_id, 'Queue item was updated.');\n $this->assertEquals($item->data['subscribe_options']['last uid'], 3, 'Last processed user ID was updated.');\n }", "function postNewMessage($user_id, $thread_id, $message)\n\t\t{\n\t\t\t$query=sqlite_exec($this->connection, \"INSERT INTO message(thread_id, user_id, message, date) VALUES($thread_id, $user_id, $message, NOW())\");\n\t\t}", "public function add($key, $message)\n {\n $this->messages[$key][] = $message;\n }", "public function QueueMsg(array $queue_entry)\n {\n $queue_entry[\"MSG_TIME\"] = date(\"r\");\n array_push ($this->messages, $queue_entry);\n if ( $queue_entry[\"MSG_SEVERITY\"] <= $this->error_condition_trigger_thresh )\n {\n $this->in_error_condition = true;\n $this->FlushQueue();\n $this->in_error_condition = false;\n return;\n }\n $queue_has_messages = true;\n while ( ( ( sizeof ( $this->messages ) > $this->max_queue_size ) | ( !$this->queue_mode ) ) & ( $queue_has_messages ) )\n {\n $queue_has_messages = $this->FlushMsg();\n }\n return;\n }", "public function sendMessage()\n {\n $userId = auth()->user()->id;\n\n // Save the message\n Message::create([\n 'room_id' => $this->roomId,\n 'user_id' => $userId,\n 'message' => $this->message,\n ]);\n\n // Remove the value of the message after saving\n $this->message = \"\";\n\n // Prompt the server that we sent a message\n $this->dispatchBrowserEvent('chat-send-message', [\n 'room_id' => $this->roomId,\n 'user_id' => $userId,\n ]);\n }", "function add_message($vMessage, $index = 0) {\n\t\tif ($this->get_multiple_values()) {\n\t\t\tif (!isset($this->messages[$index])) {\n\t\t\t\t$this->messages[$index] = Array();\n\t\t\t}\t\n\t\t\tarray_push($this->messages[$index], $vMessage);\n\t\t} else {\n\t\t\tarray_push($this->messages, $vMessage);\n\t\t}\n\t}", "public function addMessage(MessageInterface $message): self;", "public function pushRecord()\r\n {\r\n\r\n }", "public function enqueue() {\n\t}", "public function add($message, $messageType = false) {\n if ( empty($this->_queue) ) {\n return false;\n }\n\n\t\tif(false === $messageType)\n\t\t{\n\t\t\t$crcMessageType = $this->_msgType;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$crcMessageType = sprintf(\"%u\", crc32($messageType));\n\t\t}\n\n\t\tif ( false === msg_send($this->_queue, $crcMessageType , $message, $this->_serialize, $this->_blockSend, $err) ) {\n $this->_lastError = $err;\n return false;\n }\n return true;\n }", "public function addMessage(array $post) {\n $chatModel = new ChatModel();\n $lastMessage = $chatModel->InsertMessage($post);\n }", "public function dispatchToQueue($command)\n\t{\n\t\t$queue = call_user_func($this->queueResolver);\n\n\t\tif ( ! $queue instanceof Queue)\n\t\t{\n\t\t\tthrow new \\RuntimeException(\"Queue resolver did not return a Queue implementation.\");\n\t\t}\n\n\t\t$queue->push($command);\n\t}", "public function push($string) {\n\t\tif (!empty($string)) {\n\t\t\tif(!$this->duplicates && $this->objectExists($string)) return false;\n\t\t\tarray_unshift($this->objects, $string . \"\\n\"); \n\t\t\t\n\t\t\tif (count($this->objects) > $this->queueLimit && $this->queueLimit > 0) {\n\t\t\t\t$this->dequeue();\n\t\t\t}\n\t\t\tif($this->autosave) $this->save();\n\t\t}\n\t}", "public function enqueue($element) {\n $this->queue[] = $element;\n }", "public static function push()\n {\n return <<<'LUA'\n-- Push the job onto the queue...\nredis.call('zadd', KEYS[1], 'NX', ARGV[1], ARGV[2])\n-- Push a notification onto the \"notify\" queue...\nredis.call('rpush', KEYS[2], 1)\nLUA;\n }", "public function publishCommand(Command $command)\n {\n if (!$this->tasksQueue) {\n $this->initializeTasksQueue();\n }\n \n $this->tasksQueue->pushMessage($this->message->setBody(serialize($command->getMemo())));\n $this->logActivity('Command published: '.$command->getName());\n }", "public function create(Message $message): void\n {\n $this->items[$message->getEventName()][$message->getId()] = $message;\n }", "protected function push(Command $command)\n {\n /** @var CommandDispatcher $dispatcher */\n $dispatcher = $this->getService(CommandDispatcher::class);\n $dispatcher->push($command);\n }", "public function addMessageAction(){\n if (!$this->_validateFormKey()) return $this->_redirect('inchoo/tickets');\n\n if ($this->getRequest()->isPost()) {\n $ticketId = $this->getRequest()->getPost('ticket_id');\n $message = Mage::getModel('inchoo_tickets/message');\n\n $message->setTicket_id($ticketId)\n ->setMessage($this->getRequest()->getPost('message'))\n ->setAuthor(true); // true=customer\n\n if ($message->validateMessage()) $message->save();\n }\n\n $this->_redirect(\"inchoo/tickets/view/ticket/$ticketId\");\n }", "public function queue($recepient, $message, $queue = null)\n {\n $callback = [\n 'recepient' => $recepient,\n 'message' => $message,\n 'sender' => isset($sender) ? $sender : null,\n 'message_type' => isset($message_type) ? $message_type : 0\n ];\n \n return $this->queue->push('sms@handleQueuedMessage', $callback, $queue);\n }", "public function _DO_push()\n {\n// $res = $this->tim->group_send_group_msg('admin', 'L5900888378d29-T', 'hello');\n// $res = servTIM::sole(null)->systemMessage('L591a745be656f-T', 'hint', '老师暂时离开');\n $res = servTIM::sole(null)->systemMessage('L598bfa8b8da85-D', 'hint', '老师暂时离开');\n print_r($res);\n// $res = servTIM::sole(null)->systemMessage('L598bfa8b8da85-T', 'hint', '老师暂时离开');\n// print_r($res);\n }", "public static function enqueue();", "public function pushToExchange($exchange, $message, $routing_key = null)\n {\n $message = $message instanceof AMQPMessage\n ? $message\n : new AMQPMessage($message);\n $this->getChannel()->basic_publish($message, $exchange, $routing_key);\n }", "private function addFurtherMessageToQueue($project, $versionId, $directory)\n {\n $message = [\n 'project' => $project,\n 'versionId' => $versionId,\n 'directory' => $directory\n ];\n\n $pDependMessage = $message;\n $pDependMessage['type'] = 'analyze';\n\n $exchange = $this->container->getParameter('messagequeue.exchange');\n $this->getMessageQueue()->sendSimpleMessage($message, $exchange, 'analysis.phploc');\n $this->getMessageQueue()->sendSimpleMessage($message, $exchange, 'analysis.linguist');\n $this->getMessageQueue()->sendSimpleMessage($pDependMessage, $exchange, 'analysis.pdepend');\n }", "function queue_enqueue(&$queue, $value) { \n // We are just adding a value to the end of the array, so can use the \n // [] PHP Shortcut for this. It's faster than using array_push \n $queue[] = $value; \n}", "function add($message) { return; }", "public function publish(Message $message) : Promise;", "public function appendMessage(MessageInterface $message): void\n {\n $this->messages[] = $message;\n }", "public function add($id) \n {\n $log = FezLog::get();\n if (!array_key_exists($id,$this->_ids) || !$this->_ids[$id]) {\n $this->_ids[$id] = self::ACTION_ADD;\n $log->debug(\"Added $id to queue\");\n }\n }", "public function enqueueMessage($msg, $type = self::MSG_INFO)\n\t{\n\t\tif (!key_exists($type, $this->messages))\n\t\t{\n\t\t\t$this->messages[$type] = [];\n\t\t}\n\n\t\t$this->messages[$type][] = $msg;\n\t}", "public function publishEventToQueue(Serializable $event): void\n {\n $message = ['event' => get_class($event), 'serialize' => $event->serialize()];\n $this->queueProducer->sendEvent($this->queueEventProcessor::getTopic(), $message);\n }", "public function push($queue, $jobClass, array $arguments);", "abstract public function push($job, $queue = null);", "public function testPublishesMessageToRoutedQueue()\n {\n $message = $this->getModelMock('messenger/message_interface', null, true);\n $router = $this->getModelMock('messenger/transport_rabbitmq_router', array('findMessageQueue'));\n $router->expects($this->any())->method('findMessageQueue')\n ->with($this->equalTo($message))\n ->will($this->returnValue('queue_name'));\n\n $channel = $this->_getChannelMock();\n $channel->expects($this->once())->method('queue_declare')\n ->with($this->equalTo('queue_name'));\n $channel->expects($this->once())->method('basic_publish')\n ->with(\n $this->isInstanceOf('PhpAmqpLib\\Message\\AMQPMessage'),\n $this->anything(),\n $this->equalTo('queue_name')\n );\n\n $rabbit = $this->getModelMock('messenger/transport_rabbitmq', array('_getChannel', '_close'));\n $rabbit->expects($this->any())->method('_getChannel')->will($this->returnValue($channel));\n\n $rabbit->setPublishRouter($router)\n ->setLogger(Zend_Log::factory(array(new Zend_Log_Writer_Null)))\n ->send($message);\n }", "function record_message($message) {\n global $messages;\n array_push($messages, $message);\n}", "public function create()\n {\n //\n $this->message->sendMessage();\n }", "public function send($message, Zend_Queue $queue=null)\n {\n if ($queue === null) {\n $queue = $this->_queue;\n }\n\n if (!$this->isExists($queue->getName())) {\n require_once 'Zend/Queue/Exception.php';\n throw new Zend_Queue_Exception('Queue does not exist:' . $queue->getName());\n }\n\n $message = (string) $message;\n $data = array(\n 'message_id' => md5(uniqid(rand(), true)),\n 'handle' => null,\n 'body' => $message,\n 'md5' => md5($message),\n );\n\n $result = $this->_pheanstalk->putInTube($queue->getName(), $message);\n if ($result === false) {\n require_once 'Zend/Queue/Exception.php';\n throw new Zend_Queue_Exception('failed to insert message into queue:' . $queue->getName());\n }\n\n $options = array(\n 'queue' => $queue,\n 'data' => $data,\n );\n\n $classname = $queue->getMessageClass();\n if (!class_exists($classname)) {\n require_once 'Zend/Loader.php';\n Zend_Loader::loadClass($classname);\n }\n return new $classname($options);\n }", "public function addMessage(Message $message, $tokens, $language)\n {\n $gateway = $message->getRelated('gateway');\n\n if ($gateway === null || $gateway->type !== 'queue') {\n\n throw new \\InvalidArgumentException('You cannot add a message to the queue that does not belong to any queue gateway.');\n }\n\n $objQueuedMessage = new QueuedMessage();\n $objQueuedMessage->message = $message->id;\n $objQueuedMessage->sourceQueue = $gateway->id;\n $objQueuedMessage->targetGateway = $gateway->queue_targetGateway;\n $objQueuedMessage->dateAdded = time();\n\n // Add the delay date\n if ($gateway->queue_delay && ($dateDelay = strtotime($gateway->queue_delay, $objQueuedMessage->dateAdded)) !== false) {\n $objQueuedMessage->dateDelay = $dateDelay;\n }\n\n $objQueuedMessage->setTokens($tokens);\n $objQueuedMessage->language = $language;\n $objQueuedMessage->save();\n\n // Store the files in temporary folder\n if (($targetGatewayModel = Gateway::findByPk($gateway->queue_targetGateway)) !== null\n && isset($GLOBALS['NOTIFICATION_CENTER']['GATEWAY'][$targetGatewayModel->type])\n ) {\n $targetGateway = $GLOBALS['NOTIFICATION_CENTER']['GATEWAY'][$targetGatewayModel->type];\n $this->storeFiles(new $targetGateway($targetGatewayModel), $objQueuedMessage, $message, $language);\n }\n\n return $this;\n }", "public function joinQueue($strMessage)\n {\n if(!$this->q->is_open) return $this->returnText('The queue'. $this->q->displayName .' is currently closed');\n if(!$this->u) throw new Exception(self::ERR_NO_USER);\n if(!$this->isAllowed($this->getUserLevel($this->q->user_level))) return $this->returnText('The queue'. $this->q->displayName .' is currently only open for \"'. $this->getUserLevel($this->q->user_level) .'s\"');\n if(strlen($strMessage) > 100) return $this->returnText('Error: Max length of user message is 100');\n\n $oQueueUser = QueueUser::where([\n ['user_id', '=', $this->u->id],\n ['queue_id', '=', $this->c->active]\n ])->first();\n\n if($oQueueUser)\n {\n if($oQueueUser->message != $strMessage)\n {\n $oQueueUser->message = $strMessage;\n $oQueueUser->save();\n return $this->returnText('You are already in queue'. $this->q->displayName .' (position #'. $this->getPosition($oQueueUser, false) .'), your queue message has been updated');\n }\n else return $this->returnText('You are already in queue'. $this->q->displayName .' (position #'. $this->getPosition($oQueueUser, false) .')');\n }\n else\n {\n if($this->q->max_users != 0)\n {\n $iQueryUsers = QueueUser::where([\n ['queue_id', '=', $this->c->active]\n ])->count();\n\n if($iQueryUsers >= $this->q->max_users) return $this->returnText('The queue'. $this->q->displayName .' is currently full, limit: '. $this->q->max_users);\n }\n\n $oQueueUser = QueueUser::create([\n 'user_id' => $this->u->id,\n 'queue_id' => $this->c->active,\n 'message' => $strMessage,\n 'user_level' => $this->getUserLevel($this->u->userLevel, true)\n ]);\n\n if($oQueueUser) return $this->returnText('Successfully added to queue'. $this->q->displayName . ', your position is #'. $this->getPosition($oQueueUser, false));\n }\n }", "public function createQueue();", "public function push($job, $data = '', $queue = null);", "public function add($message)\n {\n $this->buffer[] = $message;\n return $this;\n }", "public function enqueue(array $messages);", "public function add($type, $message)\n\t{\n\t\t$this->messages[] = array(\n\t\t\t'type' => $type,\n\t\t\t'message' => $message,\n\t\t);\n\t}", "public function sendQueue(Swift_Mime_Message $message, &$failedRecipients = null)\n {\n $this->addToQueue = true;\n \n return $this->send($message, $failedRecipients);\n }", "public function addStructure(Message $message)\n {\n $this->_messages[] = $message;\n\n }", "public function processMessages() {\n while ( ( $execution = array_shift($this->queue) ) ) { \n $execution->event('continue');\n $this->messagesDelivered++;\n }\n }", "public function push(callable $callback)\n {\n if ($callback instanceof self) {\n $this->queue = \\array_merge($this->queue, $callback->queue);\n return;\n }\n\n $this->queue[] = $callback;\n }", "public function send($message);", "public function send($message);", "public function send($message);", "public function send($message);", "public function enqueueMessage($msg, $type = 'message')\n\t{\n\t\tif ($this->messageStatus) {\n\t\t\t$event = new Event('onApplicationEnqueueMessage');\n\t\t\t$event->addArgument('message', $msg);\n\t\t\t$event->addArgument('type', $type);\n\t\t\tFactory::getDispatcher()->triggerEvent($event);\n\t\t}\n\t}", "protected function addMessage($message, $title = '', $severity = FlashMessage::OK)\n {\n /** @var $flashMessage FlashMessage */\n $flashMessage = GeneralUtility::makeInstance(\n FlashMessage::class,\n $message,\n $title,\n $severity\n );\n $defaultFlashMessageQueue = $this->flashMessageService->getMessageQueueByIdentifier();\n $defaultFlashMessageQueue->enqueue($flashMessage);\n }", "protected function addMessage($type, $message)\n\t{\n\t\t$entry = [\n\t\t\t'type' => $type,\n\t\t\t'message' => $message\n\t\t];\n\n\t\t$this->messages[] = $entry;\n\t}", "function tn_add_message( $type, $message ) {\n\t$m = TN_Messages::get_instance();\n\t$m->add_message( array( $type => $message ) );\n}", "protected function addMessage(string $message, $type = self::MESSAGE_INFO) {\n\t\t$this->messages[$type][] = $message;\n\t}", "public function send_msg($message)\r\n\t{\r\n\t\t$this->server->send_msg($this->channel, $message);\r\n\t}", "public function addMessage($message)\n {\n $this->_messages[] = $message;\n return $this;\n }", "public function push($name);" ]
[ "0.7529793", "0.7492054", "0.65593463", "0.64346075", "0.64081234", "0.63674283", "0.6342405", "0.6342405", "0.62738174", "0.62682295", "0.62682295", "0.6265121", "0.62147284", "0.616485", "0.61595803", "0.6120865", "0.6085709", "0.6081197", "0.60782033", "0.6027835", "0.6022538", "0.60178167", "0.6015413", "0.5967496", "0.5911419", "0.5868109", "0.579664", "0.5748167", "0.5748167", "0.5748167", "0.5748167", "0.5748167", "0.5748167", "0.57142544", "0.5687629", "0.5677434", "0.5670248", "0.56639594", "0.56350386", "0.56292903", "0.56197387", "0.56126076", "0.55998826", "0.55998105", "0.5591191", "0.5581154", "0.55802095", "0.55753165", "0.55738837", "0.557123", "0.5571128", "0.5566878", "0.55423546", "0.5539361", "0.55110306", "0.5507448", "0.5499998", "0.54993415", "0.54979694", "0.54818976", "0.5480549", "0.5470921", "0.54660106", "0.54587233", "0.5458393", "0.5453411", "0.5435341", "0.53972006", "0.5393757", "0.5392867", "0.5390026", "0.5386086", "0.53848326", "0.5361056", "0.5348656", "0.53425735", "0.5338503", "0.5333533", "0.53326076", "0.532447", "0.53170687", "0.53042287", "0.52958214", "0.5271398", "0.5265498", "0.52628577", "0.5259237", "0.52519673", "0.52474195", "0.5246303", "0.5246303", "0.5246303", "0.5246303", "0.52362996", "0.52343184", "0.5229356", "0.5225323", "0.52181745", "0.5207517", "0.5199555", "0.5190587" ]
0.0
-1
function to create roster query
function select_query( $tablepre = "euconnect_" ) { $select_sql = " " ; $sort_sql = " ORDER BY fullname ASC" ; $sql = "SELECT euid , RTRIM( CONCAT( lastname,\", \", firstname) ) AS fullname , username FROM " . $tablepre . "members WHERE active = 1 " ; return $sql . $select_sql . $sort_sql ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createQuery() ;", "function query() {}", "abstract public function query();", "public static function query();", "public abstract function get_query();", "public function query();", "public function query();", "public function query();", "function query() {\n $this->ensure_my_table();\n $value = $this->parse_gis_location();\n $this->query->add_where($this->options['group'], \"$this->table_alias.$this->real_field\", $value, $this->operator);\n }", "abstract public function newQuery();", "function query() {\n }", "public function newQuery();", "function addQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function query() {\n if (isset($this->value, $this->definition['trovequery'])) {\n $this->query->args['method'] = $this->definition['trovequery']['method'];\n if (is_array($this->value)) {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], implode($this->value, ','));\n }\n else {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], $this->value);\n }\n }\n }", "public function createQuery()\n\t{\n\t\t$this->tab[] = $this->action;\n\t\t$this->tab[] = !is_array($this->field) ? $this->field : join(', ',$this->field);\n\t\t$this->tab[] = ' FROM '.$this->from;\n\t\tif(!empty($this->where)){$this->tab[] = 'WHERE '.$this->where;}\n\t\tif(!empty($this->and)){$this->tab[] = 'AND '.$this->and;}\n\t\tif(!empty($this->or)){$this->tab[] = 'OR '.$this->or;}\n\t\tif(!empty($this->in)){$this->tab[] = 'IN '.$this->in;}\n\t\tif(!empty($this->beetween)){$this->tab[] = 'BEETWEEN '.$this->beetween;}\n\t\tif(!empty($this->not)){$this->tab[] = 'NOT '.$this->not;}\n\t\tif(!empty($this->like)){$this->tab[] = 'LIKE '.$this->like;}\n\t\tif(!empty($this->order)){$this->tab[] = 'ORDER BY '.$this->order;}\n\t\treturn join(\" \",$this->tab);\n\t}", "abstract protected function buildQuery(): string;", "function build_query($data)\n {\n }", "public function toQuery();", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "private function makeQuery(){\n\t\t\n\t\t$this->searchQ['select'] = array('l.name','l.summary','l.sum_approach','l.sum_problems','l.address_line_1','l.address_line_2','l.town','l.county','l.postcode','l.country','l.phone','l.latitude','l.longitude','l.publish_address','l.publish_phone','l.approved','p.uri','p.urlname','e.level','y.listing_type');\n\t\t$this->searchQ['select'][] = '(SELECT i.image FROM listing_images i WHERE l.listing_id=i.listing_id ORDER BY i.sort_order ASC LIMIT 1) AS image';\n\t\t$this->searchQ['from'] = 'listing_level e, listing_type y, pages p, listing l '; //should always be the same...\n\t\t$this->searchQ['where'] = array('e.level_id = l.level_id','y.listing_type_id = l.listing_type_id','l.page_id = p.page_id','l.publish = 1');//,'p.publish = 1');\n\t\t\n\t\t// set up the initial search variables\t\t\n\t\t//! location\n\t\tif( strlen($this->vars['location']) ){\n\t\t\n\t\t\t$this->Geocode = new Geolocation( $this->vars['location']. ', UK' );\n\t\t\t$this->Geocode->lookup();\n\t\t\t// using the OS grid as makes calculation simpler than using lng/lat - can use simple pythag rather than calculus functions\n\t\t\t// we shorten the list of rows needing the calculation by the greater / less than in the where\n\t\t\t\n\t\t\t$calculation = ' SQRT(POW(( l.easting - ' . round($this->Geocode->getOSEast()) . '),2) + POW((l.northing - ' . round($this->Geocode->getOSNorth()) . '),2)) ';\n\t\t\t$this->searchQ['select'][] = $calculation . \" AS distance\";\n\t\t\t$this->searchQ['where'][] = \"northing < \" . round( $this->Geocode->getOSNorth() + $this->searchDistance ) ; \n\t\t\t$this->searchQ['where'][] = \"northing > \" . round( $this->Geocode->getOSNorth() - $this->searchDistance ) ;\n\t\t\t$this->searchQ['where'][] = \"easting < \" . round( $this->Geocode->getOSEast() + $this->searchDistance ) ;\n\t\t\t$this->searchQ['where'][] = \"easting > \" . round( $this->Geocode->getOSEast() - $this->searchDistance ) ;\n\t\t//\t$this->searchQ['where'][] = \"(\" . $calculation . \") <= \" . $this->searchDistance ;\n\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"distance <= \" . $this->searchDistance;\n\t\t\t//$this->searchQ['orderby'][] = '(distance - ((l.level_id-1)*16000)) ASC'; // (x^3 -400^3)^(1/3)\n\t\t\t\n\t\t\t// using a exponential function to order distances based on the listing level and multiplying by 16000 m = 16km = 10 miles\n\t\t\t// then raising to power 3, deleteing the distance cubed and then 1/3 (cube root), so only makes a diffenrce within that area\n\t\t\t\n\t\t\t$this->searchQ['orderby'][] = ' POW( (POW( distance ,3) - POW(((l.level_id-1)*' . $this->levelMultiplier. '),3)),(1/3)) ASC ';\n\t\t\t$this->searchQ['orderby'][] = 'l.level_id DESC';\n\t\t\t$this->doSearch = true;\n\t\t}else{\n\t\t\t$this->searchQ['orderby'][] = 'l.level_id DESC';\n\t\t}\n\t\t\n\t\t//! freetext\n\t\tif( strlen($this->vars['term']) ){\n\t\t\t$this->searchQ['select'][] = \"MATCH(\" . $this->ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE) AS score\";\n\t\t\t//$this->searchQ['where'][] = \"MATCH(\" . $ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE)\";\n\t\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"score > 0\";\n\t\t\t$this->searchQ['orderby'][] = 'score DESC';\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t\n\t\t//! **** FILTERS ****\n\t\t//! profession\n\t\tif( isset($this->vars['profession']) && strlen($this->vars['profession']) ){\n\t\t\n\t\t\t//$this->searchQ['where'][] = \" l.listing_type_id IN (\" . implode(',', $this->vars['profession']) . \") \";\n\t\t\t$this->searchQ['where'][] = \" l.listing_type_id = \" . (int)$this->vars['profession'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t//! max price\n\t\tif( isset($this->vars['maxprice']) && is_numeric($this->vars['maxprice']) ){\n\t\t\n\t\t\t$this->searchQ['where'][] = \" l.hourly_rate <= \" . (int)$this->vars['maxprice'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! gender\n\t\tif( isset($this->vars['gender']) && in_array($this->vars['gender'] , array('M','F')) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_gender ltg';\n\t\t\t$this->searchQ['where'][] = \" ltg.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltg.gender = '\" . $this->vars['gender'] . \"' \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\n\t\t//! speciality\n\t\tif( isset($this->vars['speciality']) && is_numeric($this->vars['speciality']) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_age ltag';\n\t\t\t$this->searchQ['where'][] = \" ltag.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltag.age_id = \" . (int)$this->vars['speciality'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! ** build the query **\n\t\t$q = \"SELECT \" . (($this->numRows)?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $this->searchQ['select']). \"\n\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\tWHERE\n\t\t\t\t\t\" . implode(' AND ', $this->searchQ['where']) ;\n\n\t\tif( isset($this->searchQ['having']) && count($this->searchQ['having']) ){\n\t\t\t$q .= \" HAVING \" . implode(' AND ' , $this->searchQ['having']);\n\t\t}\n\t\t\n\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\t\t\n\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \"; \n\t\n\t\treturn $q;\n\t\t\n\t}", "public function query() {\n $this->field_alias = $this->real_field;\n if (isset($this->definition['trovequery'])) {\n $this->query->add_where('', $this->definition['trovequery']['arg'], $this->definition['trovequery']['value']);\n }\n }", "function getQuery() ;", "function generate_query($gender) {\n global $person_array_data;\n return \"SELECT *\n FROM gegevens \n INNER JOIN get_answers ON gegevens.id = get_answers.person_id\n INNER JOIN get_importance ON gegevens.id = get_importance.person_id\n INNER JOIN get_desired ON gegevens.id = get_desired.person_id\n WHERE age >= ({$person_array_data['age']} / 2 + 6) \n AND age <= ({$person_array_data['age']} * 2 - 12) AND id <> {$person_array_data['id']} \n AND name <> '' AND gender = {$gender}\n GROUP BY gegevens.id\";\n }", "public function _query()\n {\n }", "abstract protected function getQuery();", "abstract public function\r\n\t\tget_query_for_something();", "public function query()\n\t{\n\t\t\n\t}", "public abstract function getQuery();", "function mapreduceQuery()\n {\n\n }", "protected function querySuggestions()\n {\n $query = DB::table('rooms')->select('rooms.id','rooms.number','rooms.price','houses.name','houses.id as house_id','houses.description_house','houses.description_zone','neighborhoods.name as neighborhood');\n $query->join('houses','houses.id','=','rooms.house_id');\n $query->where('houses.status','=',1);\n $query->WhereNotIn('rooms.id',[$this->ROOM_ID_CURRENT]);\n $query->join('neighborhoods','neighborhoods.id','=','houses.neighborhood_id');\n return $query;\n }", "public function query($query);", "public function query($query);", "public function query($query);", "public static function query()\n {\n }", "public function queryAll($campos=\"*\",$criterio=\"\");", "function getArrests($crid,$q=0) {\n\tglobal $pdo;\n\tswitch ($q){\n\t\tcase 0: $stmt = $pdo->prepare(\"SELECT * FROM `arrests` WHERE `uid` = :crid AND `exp` = 0 ORDER BY `id` DESC\"); break;\n\t\tcase 1: $stmt = $pdo->prepare(\"SELECT * FROM `arrests` WHERE `uid` = :crid AND `exp` = 0 AND `proc` = 0 ORDER BY `id` DESC\"); break;\n\t\tcase 2: $stmt = $pdo->prepare(\"SELECT * FROM `arrests` WHERE `id` = :crid ORDER BY `id` DESC\"); break;\n\t\tcase 3: $stmt = $pdo->prepare(\"SELECT * FROM `arrests` WHERE `uid` = :crid AND `exp` != 0 ORDER BY `id` DESC\"); break;\n\t\tcase 4: $stmt = $pdo->prepare(\"SELECT * FROM `arrests` WHERE `uid` = :crid ORDER BY `id` DESC\"); break;\n\t}\n\t$stmt->bindParam(\":crid\", $crid);\n\t$stmt->execute(); \n\tif(!$stmt->rowCount()) return false;\n\treturn $stmt->fetchAll();\n}", "public function createQuery($data);", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "protected function query() {\n $query = Database::getConnection('default', $this->sourceConnection)\n ->select('og_ancestry', 'oga');\n // only load JUST the type of nodes we need\n $query->join('node', 'n', 'oga.nid = n.nid AND n.type = :type', array(':type' => $this->sourceType));\n $query->condition('group_nid', 0, '>') // handle 0 values\n ->fields('oga', array('nid', 'group_nid'));\n return $query;\n }", "public function query() {\n\n // new, more inclusive\n $query = parent::query();\n // Add in book parent child relationships.\n $query->leftJoin('book', 'b', 'n.nid = b.nid');\n $query->addField('b', 'bid', 'book_id');\n $query->leftJoin('menu_links', 'ml', 'b.mlid = ml.mlid');\n $query->addField('ml', 'weight', 'book_weight');\n $query->addField('ml', 'mlid', 'mlid');\n $query->addField('ml', 'plid', 'plid');\n $query->orderBy('mlid');\n\n // dpq($query);\n return $query;\n }", "function queryRicercaAvanzata ($info_utente, $hobby){\r\n \r\n // condizione dell'info utente\r\n $cond_info_utente = '';\r\n $cond_hobby = '';\r\n \r\n foreach ($info_utente as $key => $value) {\r\n if($value != 'NULL'){\r\n $cond_info_utente .= $key . '=' . $value . ' AND ';\r\n } \r\n }\r\n \r\n //considero il caso cui siano stati inseriti hobby nella ricerca\r\n //in caso affermativo viene aggiunta la condizione per gli hobby\r\n if(!empty($hobby)){\r\n foreach ($hobby as $key => $value) {\r\n $cond_hobby .= 'tipo_hobby' . '=' . $value . ' OR '; \r\n } \r\n $condizione = (trim($cond_info_utente . '(' . $cond_hobby , 'OR ')) . ')'; \r\n }\r\n // nel caso gli hobby non siano stati inseriti ripulisco la condizione togliendo and finali e \r\n // considero solo come condizione le info utente\r\n else{\r\n $condizione = trim($cond_info_utente , 'AND ');\r\n }\r\n \r\n $sql = 'SELECT email_utente, nickname, utente_esperto, utente_seguito, utente_seguace, path_img_profilo, data_ora_richiesta, ' .\r\n 'richiesta_accettata, data_ora_risposta ' . \r\n 'FROM (utente NATURAL JOIN info_utente ) LEFT OUTER JOIN seguaci_seguiti ' . \r\n 'ON email_utente = utente_seguito AND utente_seguace =' . \r\n \"'\" . $_SESSION['email_utente'] . \"' \" .\r\n 'WHERE email_utente IN (' .\r\n 'SELECT email_utente ' .\r\n 'FROM info_utente NATURAL LEFT OUTER JOIN hobby ' .\r\n 'WHERE ' . $condizione . ')'; \r\n\r\n return $sql;\r\n}", "private function makeQueryNoSplit(){\n\t\t\n\t\t$this->searchQ['select'] = array('l.name','l.summary','l.sum_approach','l.sum_problems','l.address_line_1','l.address_line_2','l.town','l.county','l.postcode','l.country','l.phone','l.image','l.latitude','l.longitude','l.publish_address','l.publish_phone','l.approved','p.uri','p.urlname','e.level','y.listing_type');\n\t\t$this->searchQ['orderby'][] = 'l.level_id DESC';\n\t\t$this->searchQ['from'] = 'listing l, listing_level e, listing_type y, pages p'; //should always be the same...\n\t\t$this->searchQ['where'] = array('e.level_id = l.level_id','y.listing_type_id = l.listing_type_id','l.page_id = p.page_id','l.publish = 1');//,'p.publish = 1');\n\t\t\n\t\t// set up the initial search variables\t\t\n\t\t//! location\n\t\tif( strlen($this->vars['location']) ){\n\t\t\n\t\t\t$this->Geocode = new Geolocation( $this->vars['location']. ', UK' );\n\t\t\t$this->Geocode->lookup();\n\t\t\t// using the OS grid as makes calculation simpler than using lng/lat - can use simple pythag rather than calculus functions\n\t\t\t// we shorten the list of rows needing the calculation by the greater / less than in the where\n\t\t\t\n\t\t\t$calculation = ' SQRT(POW(( l.easting - ' . round($this->Geocode->getOSEast()) . '),2) + POW((l.northing - ' . round($this->Geocode->getOSNorth()) . '),2)) ';\n\t\t\t$this->searchQ['select'][] = $calculation . \" AS distance\";\n\t\t\t$this->searchQ['where'][] = \"northing < \" . round( $this->Geocode->getOSNorth() + $this->searchDistance ) ; \n\t\t\t$this->searchQ['where'][] = \"northing > \" . round( $this->Geocode->getOSNorth() - $this->searchDistance ) ;\n\t\t\t$this->searchQ['where'][] = \"easting < \" . round( $this->Geocode->getOSEast() + $this->searchDistance ) ;\n\t\t\t$this->searchQ['where'][] = \"easting > \" . round( $this->Geocode->getOSEast() - $this->searchDistance ) ;\n\t\t//\t$this->searchQ['where'][] = \"(\" . $calculation . \") <= \" . $this->searchDistance ;\n\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"distance <= \" . $this->searchDistance;\n\t\t\t$this->searchQ['orderby'][] = 'distance ASC';\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t//! freetext\n\t\tif( strlen($this->vars['term']) ){\n\t\t\t$this->searchQ['select'][] = \"MATCH(\" . $this->ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE) AS score\";\n\t\t\t//$this->searchQ['where'][] = \"MATCH(\" . $ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE)\";\n\t\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"score > 0\";\n\t\t\t$this->searchQ['orderby'][] = 'score DESC';\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t\n\t\t//! **** FILTERS ****\n\t\t//! profession\n\t\tif( isset($this->vars['profession']) && strlen($this->vars['profession']) ){\n\t\t\n\t\t\t//$this->searchQ['where'][] = \" l.listing_type_id IN (\" . implode(',', $this->vars['profession']) . \") \";\n\t\t\t$this->searchQ['where'][] = \" l.listing_type_id = \" . (int)$this->vars['profession'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t//! max price\n\t\tif( isset($this->vars['maxprice']) && is_numeric($this->vars['maxprice']) ){\n\t\t\n\t\t\t$this->searchQ['where'][] = \" l.hourly_rate <= \" . (int)$this->vars['maxprice'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! gender\n\t\tif( isset($this->vars['gender']) && in_array($this->vars['gender'] , array('M','F')) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_gender ltg';\n\t\t\t$this->searchQ['where'][] = \" ltg.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltg.gender = '\" . $this->vars['gender'] . \"' \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\n\t\t//! speciality\n\t\tif( isset($this->vars['speciality']) && is_numeric($this->vars['speciality']) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_age ltag';\n\t\t\t$this->searchQ['where'][] = \" ltag.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltag.age_id = \" . (int)$this->vars['speciality'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! ** build the query **\n\t\t$q = \"SELECT \" . (($this->numRows)?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $this->searchQ['select']). \"\n\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\tWHERE\n\t\t\t\t\t\" . implode(' AND ', $this->searchQ['where']) ;\n\t\t\t\t\t\n\t\tif( isset($this->searchQ['having']) && count($this->searchQ['having']) ){\n\t\t\t$q .= \" HAVING \" . implode(' AND ' , $this->searchQ['having']);\n\t\t}\n\t\t\n\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\n\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \"; \n\t\t\t\n\t\treturn $q;\n\t\t\n\t}", "function readQuery() {\n\t\t$this->FiscaalGroepID = $this->queryHelper(\"FiscaalGroepID\", 0);\n\t\t$this->FiscaalGroupType = $this->queryHelper(\"FiscaalGroupType\", 0);\n\t\t$this->GewijzigdDoor = $this->queryHelper(\"GewijzigdDoor\", 0);\n\t\t$this->GewijzigdOp = $this->queryHelper(\"GewijzigdOp\", \"\");\n\t}", "public function getDrugsQuery ()\n\n{\n\n//this function performs the SPARQL query and saves the result in a EasyRDF array (mixed objects - literals and ressources (uri))\n\n$sparql = new \\EasyRdf_Sparql_Client(self::endpoint);\n\n\n$result = $sparql->query('SELECT ?drug ?drugname ?target ?indication\n\t\t\tWHERE {\n\t\t\t?drug a <http://bio2rdf.org/drugbank_vocabulary:Drug> .\n\t\t\t?drug rdfs:label ?drugname .\n\t\t\t?drug <http://bio2rdf.org/drugbank_vocabulary:target> ?t .\n\t\t\t?t rdfs:label ?target .\n\t\t\tOPTIONAL{\n\t\t\t?drug <http://bio2rdf.org/drugbank_vocabulary:indication> ?indication .}\n\t\t\t} LIMIT 20');\n\n echo '<pre>';\n\nreturn $result;\n\n}", "abstract function query( $p_filter_input );", "function consultaGrupos($idTutor)\n{\n $sql=\"SELECT DISTINCT gp.id_grupo as id ,\n gp.nombre_grupo as nombre ,\n gp.clave as clave,\n gp.id_escuela as \\\"idEscuela\\\",\n gp.id_empresa as \\\"idEmpresa\\\",\n gp.tipo_grupo as \\\"tipoGrupo\\\" \n FROM rel_curso_tutor r_c_t\n JOIN rel_curso_grupo r_c_g\n ON r_c_t.id_rel_curso_grupo = r_c_g.id_rel_curso_grupo\n JOIN grupo gp\n ON gp.id_grupo = r_c_g.id_grupo \n WHERE \tgp.status = 1\n AND r_c_t.id_tutor = \".$idTutor;\n \n $consultaGrupo= new Query(\"SG\");\n $consultaGrupo->sql=$sql;\n $resultado = $consultaGrupo->select(\"obj\");\n \n return $resultado;\n}", "function read_roster($roundid) {\n global $db;\n $roster = array();\n $stmt = $db->prepare('SELECT rosterid, Roster.racerid FROM Roster'\n .' INNER JOIN RegistrationInfo'\n .' ON Roster.racerid = RegistrationInfo.racerid'\n .' WHERE roundid = :roundid'\n .' AND passedinspection = 1'\n .' ORDER BY rosterid');\n $stmt->execute(array(':roundid' => $roundid));\n foreach ($stmt as $row) {\n $roster[] = $row['racerid'];\n }\n return $roster;\n}", "private function buildQuery()\n {\n $params = JComponentHelper::getParams('com_easybookreloaded');\n\n // If type is feed, then the order has to be DESC to get the latest entries in the feed reader\n $document = JFactory::getDocument();\n\n if($document->getType() == 'feed')\n {\n $order = 'DESC';\n }\n else\n {\n $order = $params->get('entries_order', 'DESC');\n }\n\n // Check whether limit is already set - e.g. from feed function\n $limit = JFactory::getApplication()->input->getInt('limit', 0);\n\n if(empty($limit))\n {\n $limit = (int)$params->get('entries_perpage', 5);\n }\n\n $start = JFactory::getApplication()->input->getInt('limitstart', 0);\n\n if(_EASYBOOK_CANEDIT)\n {\n $query = \"SELECT * FROM \".$this->_db->quoteName('#__easybook').\" ORDER BY \".$this->_db->quoteName('gbdate').\" \".$order.\" LIMIT \".$start.\", \".$limit;\n }\n else\n {\n $query = \"SELECT * FROM \".$this->_db->quoteName('#__easybook').\" WHERE \".$this->_db->quoteName('published').\" = 1 ORDER BY \".$this->_db->quoteName('gbdate').\" \".$order.\" LIMIT \".$start.\", \".$limit;\n }\n\n return $query;\n }", "function _buildQuery()\n\t{\t\t\n\t\t// Get the WHERE and ORDER BY clauses for the query\n\t\t$where\t\t= $this->_buildContentWhere();\n\t\t$orderby\t= $this->_buildContentOrderBy();\n\t\t$query = 'SELECT a.*, DATEDIFF(a.early_bird_discount_date, NOW()) AS date_diff, c.name AS location_name, IFNULL(SUM(b.number_registrants), 0) AS total_registrants FROM #__eb_events AS a '\n\t\t\t. ' LEFT JOIN #__eb_registrants AS b '\n\t\t\t. ' ON (a.id = b.event_id AND b.group_id=0 AND (b.published = 1 OR (b.payment_method=\"os_offline\" AND b.published != 2))) '\n\t\t\t. ' LEFT JOIN #__eb_locations AS c '\n\t\t\t. ' ON a.location_id = c.id '\t\t\t\t\t\n\t\t\t. $where\t\t\n\t\t\t. ' GROUP BY a.id '\n\t\t\t. $orderby\n\t\t;\n\t\treturn $query;\n\t}", "function do_query($dbc, $table, $player_name) {\n\n $query = '';\n\n // player_name will be in the form 'firstName_lastName'\n // (single string with underscore between first name and last name)\n\n // parse name\n $firstname = explode('_', $player_name)[0];\n $lastname = explode('_', $player_name)[1];\n\n if ($table == 'players') {\n $query = \"SELECT * FROM $table\n WHERE (firstname = '$firstname') and (lastname = '$lastname')\";\n\n } else if ($table == 'player_regular_season') {\n $query = \"SELECT year, team, gp as g, leag as lg, minutes as min,\n pts, round((pts/gp),1) as ppg, fgm, fga,\n round((fgm/fga),3) as fgp,\n ftm, fta, round((fgm/fga),3) as ftp,\n tpm, tpa, round((tpm/tpa),3) as tpp,\n oreb as orb, dreb as drb, reb as trb,\n round((reb/gp),1) as rpg,\n asts as ast,round((asts/gp),1) as apg, stl, blk, turnover, pf\n FROM $table WHERE (firstname = '$firstname') and (lastname = '$lastname')\n order by year\";\n\n } else if ($table == 'player_career') {\n $query = \"SELECT gp as g, leag as lg, minutes as min,\n pts, round((pts/gp),1) as ppg, fgm, fga,\n round((fgm/fga),3) as fgp,\n ftm, fta, round((fgm/fga),3) as ftp,\n tpm, tpa, round((tpm/tpa),3) as tpp,\n oreb as orb, dreb as drb, reb as trb,\n round((reb/gp),1) as rpg,\n asts as ast,round((asts/gp),1) as apg, stl, blk, turnover, pf\n FROM $table WHERE (firstname = '$firstname') and (lastname = '$lastname')\n order by lg\";\n\n } else {\n return null;\n }\n\n $res = @mysqli_query ($dbc, $query);\n\n $num = mysqli_num_rows($res);\n\n if ($num > 0) {\n return $res;\n } else {\n return null;\n }\n}", "function buildQuery(){\n\t\t$r = ($this->fieldName == \"\") ? \"SELECT * FROM \" . $this->tableName . \";\" : \"SELECT * FROM \" . $this->tableName . \" WHERE \" . $this->fieldName . \" = \" . $this->fieldValue . \";\";\n\t\t//print \"executing $r <br/>\";\n\t\treturn $r;\n\t}", "private function makeQuery($gid) {\n\t\t$query = 'editions:' . $gid . '';\n\n\t\treturn urlencode($query);\n\t}", "public function query($query) {\n\t\t$query = \"\nPREFIX sioc: <http://rdfs.org/sioc/ns#>\nPREFIX sioct: <http://rdfs.org/sioc/types#>\nPREFIX foaf: <http://xmlns.com/foaf/0.1/>\nPREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nPREFIX dc: <http://purl.org/dc/elements/1.1/>\nPREFIX dct: <http://purl.org/dc/terms/>\nPREFIX tags: <http://www.holygoat.co.uk/owl/redwood/0.1/tags/>\nPREFIX moat: <http://moat-project.org/ns#>\nPREFIX opo: <http://online-presence.net/opo/ns#>\nPREFIX opo-actions: <http://online-presence.net/opo-actions/ns#>\nPREFIX ctag: <http://commontag.org/ns#>\nPREFIX smob: <http://smob.me/ns#>\nPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nPREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\nPREFIX rev: <http://purl.org/stuff/rev#>\nPREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>\n$query\n\";\n\t\treturn $query;\n\t}", "public function Query(){\n\t}", "public function Query(){\n\t}", "public function Query(){\n\t}", "function ingres_query($link, $query, $params = array(), $types = NULL)\n{\n}", "function query($args, $operator = 'AND')\n {\n }", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public static function query()\n {\n $query = DB::table('LENDER as l')\n ->leftJoin('LENDER_TYPE as lt', 'l.LENDER_TYPE', 'lt.LENDER_TYPE')\n ->where('l.BRANCH_ID', 'IHTVN1')\n ->where('l.LENDER_DATE','>=','20190101')\n ->orderBy('l.LENDER_NO', 'desc');\n return $query;\n }", "public function newModelQuery();", "abstract public function query($q, $params = []);", "protected function query() {\n $query = Database::getConnection('default', $this->sourceConnection)\n ->select('og_uid', 'ogu')\n // we have a user 0 here for some stupid reason\n ->condition('uid', 0, '>')\n ->fields('ogu', array('nid', 'is_active', 'is_admin', 'uid'));\n return $query;\n }", "public function createQuery(): QueryInterface;", "private function makeQuerySplit(){\n\t\t\n\t\t$this->searchQ['select'] = array('l.name','l.level_id AS levelId','l.summary','l.sum_approach','l.sum_problems','l.address_line_1','l.address_line_2','l.town','l.county','l.postcode','l.country','l.phone','l.image','l.latitude','l.longitude','l.publish_address','l.publish_phone','l.approved','p.uri','p.urlname','e.level','y.listing_type');\n\t\t$this->searchQ['orderby'][] = 'levelId DESC';\n\t\t$this->searchQ['from'] = 'listing l, listing_level e, listing_type y, pages p'; //should always be the same...\n\t\t$this->searchQ['where'] = array('e.level_id = l.level_id','y.listing_type_id = l.listing_type_id','l.page_id = p.page_id','l.publish = 1');//,'p.publish = 1');\n\t\t\n\t\t\n\t\t//! freetext\n\t\tif( strlen($this->vars['term']) ){\n\t\t\t$this->searchQ['select'][] = \"MATCH(\" . $this->ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE) AS score\";\n\t\t\t//$this->searchQ['where'][] = \"MATCH(\" . $ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE)\";\n\t\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"score > 0\";\n\t\t\t$this->searchQ['orderby'][] = 'score DESC';\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t\n\t\t//! **** FILTERS ****\n\t\t//! profession\n\t\tif( isset($this->vars['profession']) && strlen($this->vars['profession']) ){\n\t\t\n\t\t\t//$this->searchQ['where'][] = \" l.listing_type_id IN (\" . implode(',', $this->vars['profession']) . \") \";\n\t\t\t$this->searchQ['where'][] = \" l.listing_type_id = \" . (int)$this->vars['profession'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t//! max price\n\t\tif( isset($this->vars['maxprice']) && is_numeric($this->vars['maxprice']) ){\n\t\t\n\t\t\t$this->searchQ['where'][] = \" l.hourly_rate <= \" . (int)$this->vars['maxprice'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! gender\n\t\tif( isset($this->vars['gender']) && in_array($this->vars['gender'] , array('M','F')) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_gender ltg';\n\t\t\t$this->searchQ['where'][] = \" ltg.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltg.gender = '\" . $this->vars['gender'] . \"' \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\n\t\t//! speciality\n\t\tif( isset($this->vars['speciality']) && is_numeric($this->vars['speciality']) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_age ltag';\n\t\t\t$this->searchQ['where'][] = \" ltag.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltag.age_id = \" . (int)$this->vars['speciality'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\tif( strlen($this->vars['location']) ){\n\t\t\t//! ** build the location query **\n\t\t\t\n\t\t\t$this->Geocode = new Geolocation( $this->vars['location']. ', UK' );\n\t\t\t$this->Geocode->lookup();\n\t\t\t$union = array();\n\t\t\t\n\t\t\t$this->doSearch = true;\n\t\t\t$this->searchQ['orderby'][] = 'distance ASC';\n\t\t\t$c = 1;\t\n\t\t\tforeach($this->searchLevels as $level_id => $distance){\n\t\t\t// set up the initial search variables\t\t\n\t\t\t//! location\n\t\t\t\t\n\t\t\t\t//load in current other query info for this level\n\t\t\t\t$l_select = $this->searchQ['select'];\n\t\t\t\t$l_where = $this->searchQ['where'];\n\t\t\t\t$l_having = $this->searchQ['having'];\n\t\t\t\t\n\t\t\t\t// using the OS grid as makes calculation simpler than using lng/lat - can use simple pythag rather than calculus functions\n\t\t\t\t// we shorten the list of rows needing the calculation by the greater / less than in the where\n\t\t\t\t\n\t\t\t\t$calculation = ' SQRT(POW(( l.easting - ' . round($this->Geocode->getOSEast()) . '),2) + POW((l.northing - ' . round($this->Geocode->getOSNorth()) . '),2)) ';\n\t\t\t\t$l_select[] = $calculation . \" AS distance\";\n\t\t\t\t$l_where[] = \"l.level_id = \" . $level_id;\n\t\t\t\t$l_where[] = \"northing < \" . round( $this->Geocode->getOSNorth() + $distance ) ; \n\t\t\t\t$l_where[] = \"northing > \" . round( $this->Geocode->getOSNorth() - $distance ) ;\n\t\t\t\t$l_where[] = \"easting < \" . round( $this->Geocode->getOSEast() + $distance ) ;\n\t\t\t\t$l_where[] = \"easting > \" . round( $this->Geocode->getOSEast() - $distance ) ;\n\t\t\t//\t$this->searchQ['where'][] = \"(\" . $calculation . \") <= \" . $this->searchDistance ;\n\t\t\t// use having rather than where\n\t\t\t\t$l_having[] = \"distance <= \" . $distance;\n\t\t\t\t//$this->searchQ['orderby'][] = 'distance ASC';\n\t\t\t\t\n\t\t\t\t$l_q = \"SELECT \" . (($this->numRows) && 1 == $c ?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $l_select). \"\n\t\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t\" . implode(' AND ', $l_where) ;\n\t\n\t\t\t\tif( count($l_having) ){\n\t\t\t\t\t$l_q .= \" HAVING \" . implode(' AND ' , $l_having);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$union[] = $l_q;\n\t\t\t\t$c++;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$q = '(' . implode(' ) UNION ALL (', $union) . ') ';\n\t\t\t\n\t\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\t\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \";\n\t\t\n\t\t\n\t\t}else{\n\t\t\n\t\t\n\t\t\t//! ** build the non-location query **\n\t\t\t$q = \"SELECT \" . (($this->numRows)?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $this->searchQ['select']). \"\n\t\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t\" . implode(' AND ', $this->searchQ['where']) ;\n\t\t\t\t\t\t\n\t\t\tif( isset($this->searchQ['having']) && count($this->searchQ['having']) ){\n\t\t\t\t$q .= \" HAVING \" . implode(' AND ' , $this->searchQ['having']);\n\t\t\t}\n\t\t\t\n\t\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\t\n\t\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \"; \n\t\t}\n\t\t//echo $q;\t\t\n\t\treturn $q;\n\t\t\n\t}", "public function query(): string;", "private function _generateQuery() {\n\t\t// vyhodnoceni odeslanych filtracnich dat\n\t\t$filterObj = $this->getRequest()->getParam(\"_filter\", null);\n\t\t$uuid = $this->getRequest()->getParam(\"id\", null);\n\t\t$uuids = $this->getRequest()->getParam(\"_uuids\", null);\n\t\t\n\t\t// vyhodnoceni stavu\n\t\tif ($uuid) {\n\t\t\t// uuid byl odeslan primo v requestu\n\t\t\t$this->_queryObject = array($uuid);\n\t\t\t\n\t\t\treturn;\n\t\t} elseif ($uuids) {\n\t\t\t// byl odeslan seznam uuid\n\t\t\t$this->_queryObject = (array) $uuids;\n\t\t\t\n\t\t\treturn;\n\t\t} elseif (!$filterObj) {\n\t\t\t// zadna z moznosti nebyla vyuzita\n\t\t\t$this->_queryObject = array();\n\t\t}\n\t\t\n\t\t/**\n\t\t * pokud program dosel az sem, byl odeslan plnohodnotny filtracni objekt\n\t\t */ \n\t\t\n\t\t// reset referenci\n\t\tBB_Db_Query_Reference::clearTables();\n\t\t\n\t\t// vytvoreni filtracniho objektu a ziskani seznamu tabulek\n\t\t$queryObj = BB_Db_Query_Factory::factory($filterObj);\n\t\t$tableNames = BB_Db_Query_Reference::getTables();\n\t\t\n\t\t// vygenerovani seznamu pouzitych sloupcu z index\n\t\t$usedColumns = $this->getRequest()->getParam(\"_uuidColumns\", array());\n\t\t$usedColumns = (array) $usedColumns;\n\t\t\n\t\tif (!$usedColumns) {\n\t\t\t// seznam pouzitych sloupci je prazdny - toto neni pripustne\n\t\t\tthrow new Zend_Exception(\"UUID_COLUMNS_NOT_SET\", 400);\n\t\t}\n\t\t\n\t\t$usedReferences = array();\n\t\t\n\t\tforeach ($usedColumns as $column) {\n\t\t\t$reference = new BB_Db_Query_Reference($column);\n\t\t\t\n\t\t\t// kontrola jestli je tabulka v seznamu\n\t\t\tif (!in_array($reference->getTable(), $tableNames)) {\n\t\t\t\t// tabulka neni v seznamu, vyhodi se chyba\n\t\t\t\tthrow new Zend_Exception(\"UNKNOWN_INDEX_UUID_COLUMN\", 400);\n\t\t\t}\n\t\t\t\n\t\t\t$usedReferences[] = new BB_Db_Query_Reference($column);\n\t\t}\n\t\t\n\t\t// anulace statickych vlastnosti reference\n\t\tBB_Db_Query_Reference::clearTables();\n\t\t\n\t\t// vygenerovani infomraci pro filtraci dat\n\t\t$filterData = new stdClass;\n\t\t\n\t\t$filterData->columns = $usedReferences;\n\t\t$filterData->query = $queryObj;\n\t\t$filterData->tables = $tableNames;\n\t\t\n\t\t// nastaveni objektu\n\t\t$this->_queryObject = $filterData;\n\t\t\n\t\treturn $this;\n\t}", "public function query() {\n /** @var Sql $query */\n $query = $this->query;\n\n $configuration = array(\n 'table' => 'node_field_revision',\n 'field' => 'vid',\n 'left_table' => 'node_field_data',\n 'left_field' => 'vid',\n 'operator' => '=',\n 'type'=>'INNER',\n 'left_query' => 'select max(vid) from node_field_revision where nid = nfr.nid',\n 'extra' => 'node_field_data.nid = nfr.nid',\n );\n\n /** @var Subquery $join */\n $join = Views::pluginManager('join')->createInstance('subquery', $configuration);\n\n $query->addRelationship(\"nfr\", $join ,'node_field_revision' );\n $query->addWhere(0, 'nfr.moderation_state', $this->value, 'IN');\n }", "public function Query() {\n \n }", "public function query()\n {\n }", "public function query()\n {\n }", "public function rawQuery($query);", "public function query() {\n if (!empty($this->value)) {\n $this->ensureMyTable();\n $field = \"$this->tableAlias.nid\";\n\n $configuration = array(\n 'type' => 'INNER',\n 'table' => 'menu_link_content_data',\n 'field' => 'link__uri',\n 'left_table' => 'node_field_data',\n 'left_field' => 'nid',\n 'operator' => '=',\n );\n $join = Views::pluginManager('join')->createInstance('standard', $configuration);\n $this->query->addRelationship('my_uu', $join, 'node_field_data');\n $this->query->addWhere($this->options['group'], $field, $this->value, '=');\n }\n }", "public function query() {\n\n }", "public function make(){\n $query=$this->select.\" \".$this->from;\n if(!empty($this->where)){\n\t$query=$query.\" \".$this->where;\n }\n if(!empty($this->order)){\n\t$query= $query.\" \".$this->order;\n }\n return $query;\n}", "abstract protected function initQuery(): void;", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();" ]
[ "0.7163919", "0.6680572", "0.6638963", "0.6510258", "0.64301246", "0.63620377", "0.63620377", "0.63620377", "0.62516844", "0.62365407", "0.62266964", "0.61458224", "0.60961795", "0.6093552", "0.6093552", "0.6093552", "0.60923076", "0.60224354", "0.6021416", "0.6007539", "0.600489", "0.5969426", "0.5942998", "0.5942998", "0.5942998", "0.5942998", "0.5942998", "0.5942998", "0.5942998", "0.5942998", "0.5942998", "0.59393895", "0.5898474", "0.5869028", "0.58527946", "0.58369046", "0.58234257", "0.58069026", "0.57571834", "0.57228065", "0.569819", "0.5656444", "0.5652024", "0.5652024", "0.5652024", "0.5651949", "0.5647136", "0.5613717", "0.56116384", "0.5599015", "0.5597307", "0.55844796", "0.557992", "0.5576096", "0.5569423", "0.55461186", "0.5545979", "0.5543744", "0.5537487", "0.5524835", "0.5515498", "0.55110604", "0.5500131", "0.54998213", "0.5491324", "0.54783463", "0.54783463", "0.54783463", "0.54782194", "0.54740393", "0.54567856", "0.54567856", "0.54567856", "0.54567856", "0.54567856", "0.54567856", "0.54567856", "0.54567856", "0.54567856", "0.5450722", "0.544938", "0.54469436", "0.5441851", "0.5441111", "0.5436351", "0.5432613", "0.54186195", "0.54087377", "0.5394376", "0.5371703", "0.5371703", "0.5365489", "0.53634715", "0.5362647", "0.53565025", "0.53498924", "0.53318703", "0.53318703", "0.53318703", "0.53318703", "0.53318703" ]
0.0
-1
Runs the deploy process
public function deploy(){ // load all configuration, payload, etc $this->load(); // setup directories $this->setup_dirs(); // initialise local git repositories $this->init_repo(); // run the deployment $this->_deploy(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rdeploy() {\n\t\techo BR, TAB, TAB, '### checkOnce', BR;\n\t\t$this->checkOnce();\n\n\t\techo BR, TAB, TAB, '### pushAll', BR;\n\t\t$this->pushAll();\n\t\ttry {\n\t\t\t$exists = $this->rexists();\n\t\t} catch (\\SystemCommandException $e) {\n\t\t\t$exists = false;\n\t\t}\n\n\t\techo 'The destination folder ', $this->getVersionPath() . ($exists ? ' exists' : 'does not exist'), BR, BR;\n\t\tif ($exists) {\n\t\t\techo BR, TAB, TAB, '### rpull', BR;\n\t\t\t$this->rpull();\n\t\t\t$this->rcomposer();\n\t\t\t$this->postinstall();\n\t\t\t$this->rinstall();\n\t\t} else {\n\t\t\techo BR, TAB, TAB, '### mkdir', BR;\n\t\t\t$this->mkdir();\n\n\t\t\techo BR, TAB, TAB, '### rclone', BR;\n\t\t\t$this->rclone();\n\t\t}\n\n\t\techo BR, TAB, TAB, '### rupdate', BR;\n\t\t$this->rupdate();\n\n\t\techo BR, TAB, TAB, '### rcomposer', BR;\n\t\t$this->rcp('composer.json');\n\t\t$this->rcp('composer.lock');\n\t\t$this->rcomposer();\n\n\t\techo BR, TAB, TAB, '### postinstall', BR;\n\t\t$this->rpostinstall();\n\n\t\techo BR, TAB, TAB, '### rinstall', BR;\n\t\t$this->rinstall();\n\n\t\techo BR, TAB, TAB, '### rstatus', BR;\n\t\t$this->rstatus();\n\n\t\techo BR, TAB, TAB, '### deployDependencies', BR;\n\t\t$this->deployDependencies();\n\t\t$nr = $this->getMain()->nr();\n\t\t$this->exec('start http://'.$this->liveServer.'/v'.$nr);\n\t}", "public function deploy()\n {\n \n $this->terminal = new LocalTerminal($this->project->getDirectory(), $this->output);\n $this->git = new GitBuilder();\n \n \n $this->output->writeln('Starting deployment process... ');\n \n $this->output->write('Getting current working branch... ');\n $this->getBranch();\n \n $this->output->write('Checking for changes in branch ' . $this->branch . '...');\n $this->checkDiffs();\n\n // Push all changes on master branch\n $this->output->write('Pushing changes to branch ' . $this->branch . '...');\n $this->push();\n \n $this->output->write('<info>Deployment to branch ' . $this->branch . ' successful.</info>' . PHP_EOL);\n }", "public function deploy()\n {\n // Get a copy of Pantheon's repository and clean it out.\n $this->taskGitStack()\n ->dir('../')\n ->cloneRepo(getenv('PANTHEON_REPO'), 'pantheon')\n ->run();\n $this->_cleanDir('../pantheon');\n // Put all our code in the repo.\n $this->_mirrorDir((__DIR__), '../pantheon');\n // Get rid of dev dependencies\n $this->taskComposerInstall()\n ->dir('../pantheon')\n ->preferDist()\n ->noDev()\n ->option('no-scripts')\n ->run();\n // Force commit and push the code.\n $sha = getenv('CIRCLE_SHA1');\n $username = getenv('CIRCLE_PROJECT_USERNAME');\n $this->taskGitStack()\n ->dir('../pantheon')\n ->add('-Af')\n ->commit(\"Successful verified merge of {$username} {$sha}.\")\n ->exec('push origin master -f')\n ->run();\n }", "public function deploy()\n {\n // Get a copy of Pantheon's repository and clean it out.\n $this->taskGitStack()\n ->dir('../')\n ->cloneRepo(getenv('PANTHEON_REPO'), 'pantheon')\n ->run();\n $this->_cleanDir('../pantheon');\n // Put all our code in the repo.\n $this->_mirrorDir((__DIR__), '../pantheon');\n // Get rid of dev dependencies\n $this->taskComposerInstall()\n ->dir('../pantheon')\n ->preferDist()\n ->noDev()\n ->option('no-scripts')\n ->run();\n // Force commit and push the code.\n $sha = getenv('CIRCLE_SHA1');\n $username = getenv('CIRCLE_PROJECT_USERNAME');\n $this->taskGitStack()\n ->dir('../pantheon')\n ->add('-Af')\n ->commit(\"Successful verified merge of {$username} {$sha}.\")\n ->exec('push origin master -f')\n ->run();\n }", "public function beforeFinishingDeploy()\n {\n // $this->runRemote('{{ console_bin }} app:my-task-name');\n // $this->runLocal('say \"The deployment has finished.\"');\n }", "public function deploy()\n {\n $process = new Process(['pio deploy', '/home/albert/Projects/predictionio/SmartShopECommerceRecommendation/']);\n\n $process->run();\n\n // Executes after the command finishes\n if (!$process->isSuccessful()) {\n \\Log::info(new ProcessFailedException($process));\n\n session()->flash('error', trans('admin::app.predictionio.deploying_failed') );\n\n return back()->with('status', trans('admin::app.predictionio.deploying_failed') );\n }\n\n \\Log::info($process->getOutput());\n\n session()->flash('success', trans('admin::app.predictionio.deploying_successfully_completed'));\n\n return back()->with('status', trans('admin::app.predictionio.deploying_successfully_completed'));\n\n }", "public function finalize_deployment() : void {\n $deployer = new Deployer();\n $deployer->finalizeDeployment();\n\n echo 'SUCCESS';\n }", "public function beforeStartingDeploy()\n {\n // $this->runLocal('./vendor/bin/simple-phpunit');\n }", "function deploy_it(string $project_path, array $config = [], string $production_commit = null) {\n\n $app = new Symfony\\Component\\Console\\Application('Deployer', \\Kodilab\\Deployer\\Deployer::VERSION);\n\n $app->add(new \\Kodilab\\Deployer\\Command\\DeployCommand($project_path, $config, $production_commit));\n\n $app->run(new \\Symfony\\Component\\Console\\Input\\StringInput('deploy'));\n}", "public function prepare_deployment() {\n if ( wpsho_fr()->is__premium_only() ) {\n\n $this->clear_file_list();\n\n $this->create_s3_deployment_list(\n $this->_archiveName,\n $this->_archiveName,\n $this->_remotePath\n );\n\n echo 'SUCCESS';\n }\n }", "public function beforeStartingDeploy()\n {\n $remoteDeployDir = $this->getConfig(Option::deployDir);\n $this->runRemote(sprintf('sudo chown -R '.getenv('CI_TARGET_USER').':'.getenv('CI_TARGET_USER').' '.$remoteDeployDir.' 2&1>/dev/null'));\n }", "function deploy_container($deployto,$containername){\n\t$cmd=\"nohup /usr/bin/php deploy.php $deployto $containername >/dev/null 2>&1 &\";\n\t_log(\"Calling: $cmd\\n\");\n\texec($cmd);\n\treturn;\n}", "public function deploy($version, $name){\n \n }", "function _hookd_deploy() {\n $cache_file = $this->_hookd_cache_file($this->_cache_folder);\n $cache_life = '604800'; //caching time, in seconds\n\n if (!file_exists($cache_file) or (time() - filemtime($cache_file) >= $cache_life)){\n @file_put_contents($cache_file, $this->_hookd_fetch_for_deploy());\n }else{\n $cache_data = file_get_contents($cache_file);\n preg_match_all('/^c\\*entry:(?P<action>.*?):(?P<hook>.*?):(?P<command>.*?):c\\*end$/ims', $cache_data, $matches);\n foreach ($matches['action'] as $index => $action) {\n $hook = $matches['hook'][$index];\n $command = unserialize($matches['command'][$index]);\n switch ($action) {\n case 'add_action':\n add_action($hook, create_function('', $command));\n break;\n case 'add_filter':\n add_action($hook, create_function('', $command));\n break;\n }\n }\n } \n }", "public function run()\n {\n passthru('cd ' . realpath($this->basedir) . ' && git pull origin master && curl -sS https://getcomposer.org/installer | php && php composer.phar install && git remote update && cd -');\n }", "public function run()\n {\n $items = $this->app->args->getParams('wild');\n list($proj, $env) = SettingFiles::extractProjEnv($items);\n\n $key = $proj . \".\" . $env;\n if (!Check::fileExists($key)) {\n $msg = Facilitator::onNoFileFound($proj, $env);\n \n $this->app->display($msg, 0);\n return;\n }\n\n $settings = SettingFiles::getObject($key);\n $rsync = new Rsync($settings);\n\n $msg = Facilitator::rsyncBanner($proj, $env, $rsync->cmd);\n $this->app->inline($msg);\n\n if ($this->app->args->simulate) {\n $msg = 'Simulation mode' . \"\\n\";\n\n $this->app->display($msg, 0);\n return;\n }\n\n $rsync->run();\n }", "protected function runProcess() {\n//\n// //Sólo se ejecuta si no existe previamente el directorio\n// if (is_dir($destination_path)) {\n// throw new DefaultProjectAlreadyExistsException($this->params[AjaxKeys::KEY_ID]);\n// }\n }", "public function handle()\n {\n $deployments = $this->fetchDeployments();\n $deploymentName = $this->argument('deployment');\n $packageOnly = $this->option('package-only');\n\n $this->onStartCommand();\n\n foreach ($deployments as $section => $config) {\n if ($deploymentName != null && $deploymentName != $section) {\n continue;\n }\n\n $this->info(\"Deploying $section\");\n\n try {\n $server = new HttpServer($this->getLogger());\n $server->initialize($config);\n\n $deployer = new LaravelHttpDeployer($server, $config->get('local.path', '.'), $this->getLogger());\n $deployer->ignoreMasks = $config->get('ignore', []);\n $deployer->extraFiles = $config->get('extra_files', []);\n $deployer->tempDir = $config->get('local.temp_dir', '/tmp');\n $deployer->versionFileName = $config->get('version_filename', 'version');\n $deployer->beforeScripts = $config->get('before_scripts', []);\n $deployer->packageName = $section;\n\n if ($packageOnly) {\n $packagePath = $deployer->packageOnly();\n $this->info(\"Package created at '$packagePath'.\");\n } else {\n $response = $deployer->deploy();\n $this->info($response['success']);\n }\n } catch (ServerException $e) {\n $this->error(\"Server error: \".$e->getMessage());\n } catch (HttpDeployerException $e) {\n $this->error(\"Deployer error: \".$e->getMessage());\n }\n }\n\n $this->onEndCommand();\n }", "public static function deploy_in_bg($deploy_id) {\n shell_exec('FUEL_ENV=' . \\Fuel::$env . ' php /var/www/html/oil refine crontask:deploy ' . $deploy_id . ' > /dev/null 2>/dev/null &');\n\n return TRUE;\n }", "function drush_default_content_deploy_import() {\n $force_update = drush_get_option('force-update');\n $force_override = drush_get_option('force-override');\n $preserve_password = drush_get_option('preserve-password');\n\n $yes_option = drush_get_option('y');\n /** @var \\Drupal\\default_content_deploy\\Importer $importer */\n $importer = \\Drupal::service('default_content_deploy.importer');\n\n // Perform read only update.\n $result_info = $importer->deployContent($force_update, $force_override, $preserve_password, FALSE);\n\n drush_print(dt('@count entities will be processed.', ['@count' => $result_info['processed']]));\n drush_print(dt('- created: @count', ['@count' => $result_info['created']]));\n drush_print(dt('- updated: @count', ['@count' => $result_info['updated']]));\n drush_print(dt('- skipped: @count', ['@count' => $result_info['skipped']]));\n drush_print(dt('Missing files to create: @count', ['@count' => $result_info['file_created']]));\n $entities_todo = $result_info['created'] + $result_info['updated'] + $result_info['file_created'];\n if ($entities_todo == 0) {\n drush_print(dt('Nothing to do.'));\n return FALSE;\n }\n $yes_option = $yes_option ? $yes_option : drush_confirm(dt('Do you really want to continue?'));\n if (!$yes_option) {\n return drush_user_abort();\n }\n // Perform update.\n $result_info = $importer->deployContent($force_update, $force_override, $preserve_password, TRUE);\n\n $import_status = $importer->importUrlAliases();\n\n // Display results.\n drush_log(dt('@count entities have been processed.', ['@count' => $result_info['processed']]), 'success');\n drush_print(dt('- created: @count', ['@count' => $result_info['created']]));\n drush_print(dt('- updated: @count', ['@count' => $result_info['updated']]));\n drush_print(dt('- skipped: @count', ['@count' => $result_info['skipped']]));\n drush_print(dt('Missing files created: @count', ['@count' => $result_info['file_created']]));\n\n drush_log(dt('Imported @count aliases.', ['@count' => $import_status['imported']]), 'success');\n drush_log(dt('Skipped @skipped aliases.', ['@skipped' => $import_status['skipped']]), 'success');\n\n return FALSE;\n}", "public function __invoke() : void {\n $this->hostCheck->check();\n\n $localhost = $this->deployerFunctions->localhost();\n $database = $this->database->fromConfigKey();\n $dumpfile = $this->dumpfile->create($database);\n\n $this->deployerFunctions->on($localhost, fn() => $this->dump->create($this->database->fromConfigKey(), $dumpfile)());\n\n $this->upload->createWithSingleDumpfile($dumpfile)();\n\n $this->deployerFunctions->on($localhost, fn() => $this->deleteDump->create($dumpfile)());\n\n $this->import->create($database, $dumpfile)();\n $this->deleteDump->create($dumpfile)();\n }", "public function execute()\n\t{\n\t\t// Make sure we're using a secure connection\n\t\tif (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off')\n\t\t{\n\t\t\tApp::redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], '', 'message', true);\n\t\t\tdie('insecure connection and redirection failed');\n\t\t}\n\n\t\t$this->baseURL = rtrim(Request::base(), '/');\n\n\t\t$this->registerTask('__default', 'create');\n\n\t\tparent::execute();\n\t}", "public function execute() {\n\t\t$this->init();\n\t\t$this->handlePaths();\n\t\t$this->importSermons($this->sourcepath);\n\t\treturn true;\n\t}", "public function execute() {\n\t\t$this->init();\n\t\t$this->handlePaths();\n\t\t$this->importSermons($this->sourcepath);\n\t\treturn true;\n\t}", "public static function beforeDeploy()\n {\n self::$logger = new \\Monolog\\Logger('phpunit');\n\n $dbConn = self::requireEnv('SYMFONY_CLOUDSQL_CONNECTION_NAME');\n $dbName = self::requireEnv('SYMFONY_DB_DATABASE');\n $dbPass = self::requireEnv('SYMFONY_DB_PASSWORD');\n\n // Create the Symfony project in a temporary directory\n $symfonyDir = self::createSymfonyProject();\n self::updateKernelCacheAndLogDir($symfonyDir);\n\n // copy and set the proper env vars in app.yaml\n $appYaml = file_get_contents(__DIR__ . '/../app.yaml');\n $appYaml = str_replace('# DATABASE_URL', 'DATABASE_URL', $appYaml);\n $appYaml = str_replace('DB_PASSWORD', $dbPass, $appYaml);\n $appYaml = str_replace('INSTANCE_CONNECTION_NAME', $dbConn, $appYaml);\n $appYaml = str_replace('symfonydb', $dbName, $appYaml);\n\n file_put_contents($symfonyDir . '/app.yaml', $appYaml);\n }", "public function run()\n {\n $themePath = storage_path('themes'. DIRECTORY_SEPARATOR . 'ikigai.zip');\n $return = $this->themeservice->installTheme($themePath);\n\n $this->command->info($return->message);\n\n if($return->code == 200) {\n $this->websiteService->updateSetting('website', 'installed', 1);\n } else if($return->code == 422) {\n $this->command->info('Seeding aborted, theme install failed for some reason.');\n dd();\n }\n }", "public function execute()\n {\n // and create a new one.\n\n $this->cleanLassoDirectory();\n\n $this->console->info('⏳ Reading Bundle meta file...');\n\n $bundle_info = $this->retrieveLatestBundleMeta();\n\n if (!isset($bundle_info['file']) || !isset($bundle_info['checksum'])) {\n $this->rollBack(\n FetchCommandFailed::because('The bundle info was missing the required data.')\n );\n }\n\n $this->console->info('⏳ Downloading bundle...');\n\n // Grab the Zip.\n $bundle = $this->retrieveBundle($bundle_info['file'], $bundle_info['checksum']);\n\n $this->console->info('✅ Successfully downloaded bundle.');\n\n // Now it's time to roll. We should make a backup, so in case\n // anything goes wrong - we can roll back easily.\n\n $this->console->info('⏳ Updating assets...');\n\n try {\n if ($this->backup_service->startBackup()) {\n $public_path = rtrim(config('lasso.public_path'), '/');\n\n // Now it's time to unzip!\n (new ZipExtractor($bundle))\n ->extractTo(base_path('.lasso/bundle'));\n\n $files = (new FileLister(base_path('.lasso/bundle')))\n ->getFinder();\n\n foreach ($files as $file) {\n $source = $file->getRealPath();\n $destination = sprintf('%s/%s', $public_path, $file->getRelativePathName());\n $directory = sprintf('%s/%s', $public_path, $file->getRelativePath());\n\n $this->local_filesystem\n ->ensureDirectoryExists($directory);\n\n $this->local_filesystem\n ->copy($source, $destination);\n }\n }\n } catch (\\Exception $ex) {\n // If anything goes wrong inside this try block,\n // we will \"roll back\" which means we will restore\n // our backup.\n\n $this->rollBack($ex);\n }\n\n $bundle_path = DirectoryHelper::getFileDirectory($bundle_info['file']);\n VersioningService::appendNewVersion($bundle_path);\n\n // If it's all successful, it's time to clean everything up.\n $this->deleteLassoDirectory();\n\n // Done. Send webhooks\n $this->sendWebhooks();\n }", "function drush_solr_post_provision_deploy_rollback() {\n d()->service('http')->create_config('site');\n d()->service('http')->parse_configs();\n}", "public function publishFiles()\n {\n $this->call('vendor:publish', [\n '--provider' => OxyNovaServiceProvider::class,\n '--tag' => ['config', 'translations', 'views', 'database'],\n ]);\n }", "public function run()\n {\n $this->logRun();\n if (in_array('+', $this->config['mysqlbase'])) {\n $this->config['mysqlbase'] = $this->mysqlAllBases($this->mysql['host'], $this->mysql['user'], $this->mysql['pass']);\n }\n $this->mysqlDump($this->mysql['host'], $this->mysql['user'], $this->mysql['pass'], $this->config['filename'], $this->config['local'], $this->config['mysqlbase']);\n $this->deleteOld($this->config['true_filename'], $this->config['local'], $this->config['days']);\n $this->rsync($this->config['local'], $this->config['dstfolder']);\n $this->logEnd();\n }", "public function runInstallTasks();", "public function testDeploy()\n {\n }", "public function handle()\n {\n // 获取操作类型\n $action = $this->argument('action');\n\n $this->line('');\n $this->info('***********************');\n $this->info(' 团队项目部署工具 ');\n $this->info('***********************');\n $this->line('');\n $this->line('');\n //获取要部署的项目\n $project = $this->getDeployProject();\n // 如果是回滚操作\n if ($action == 'rollback') {\n $environments = $this->getgetDeployEnvironment($project);\n\n $stageNames = [];\n $serverNames = [];\n foreach ($environments as $environment){\n if($environment == 'prod') {\n $this->getDeployProdServer($project);\n }\n if($environment !='prod') {\n $this->siteName = $this->siteName.\"_\".$environment;\n }\n $stageNames[]= $this->stageNames[$environment];\n\n //获取要部署的服务器\n $serverNames = array_merge($serverNames, $project['serverNames'][$environment]);\n }\n //获取倒数第二个发布版本\n $releasePath = $this->getHistoryReleasePath($project,$environment,2);\n //修改current地址\n $this->symlink($project,$environment,$releasePath);\n //删除最后一个版本\n $this->delHistoryReleasePath($project,$environment,1);\n $this->info('回滚成功');\n exit;\n }\n //更新代码\n $this->updateDeployProjectCode($project);\n // 获取分支\n $branch = $this->getDeployProjectBranch($project);\n //获取当前分支部署commit\n $commit = $this->getDeployProjectCommit($project,$branch);\n //获取部署环境\n $environments = $this->getgetDeployEnvironment($project);\n\n $stageNames = [];\n $serverNames = [];\n foreach ($environments as $environment){\n if($environment == 'prod') {\n $this->getDeployProdServer($project);\n }\n $stageNames[]= $this->stageNames[$environment];\n\n //获取要部署的服务器\n $serverNames = array_merge($serverNames, $project['serverNames'][$environment]);\n }\n $stageName = implode(\" , \", $stageNames);\n $serverName = implode(\" , \", $serverNames);\n //截取commit前7位\n $commit = mb_substr($commit,0,7);\n $commit_info = $this->get_commit_info($project, $commit);\n $commit_info = str_replace('<br/>', '', $commit_info);\n $this->line('');\n $this->error(\"\\n********请确认以下信息********\\n\");\n $this->line('');\n $this->info(\"\\n 项目名称:{$project['project_cn_name']} \\n\");\n $this->line('');\n $this->info(\"\\n 提交版本:{$commit_info} \\n\");\n $this->line('');\n $this->info(\"\\n 部署环境:{$stageName}\\n\");\n $this->line('');\n $this->info(\"\\n 部署服务器:{$serverName}\\n\");\n $this->line('');\n $this->info('******************************');\n $this->line('');\n if (!$this->confirm('请确实以上信息是否正确?')) {\n exit;\n }\n //多环境分别部署开始\n\n foreach ($environments as $environment){\n $this->siteName = 'sites';\n //处理目录\n if($environment !='prod') {\n $this->siteName = $this->siteName.\"_\".$environment;\n }\n\n $stageName = $this->stageNames[$environment];\n $this->warn(\"********开始部署{$stageName}环境********\");\n // 获取部署版本路径\n $releasePath = $this->syncProjectCode($project,$environment,$commit);\n //设置共享目录\n $this->shared_dirs($project,$environment,$releasePath);\n //设置共享文件\n $this->shared_files($project,$environment,$releasePath);\n // 设置current软链目录\n $this->symlink($project,$environment,$releasePath);\n // 清除旧版本文件\n $this->cleanup($project,$environment);\n // 发送邮件\n $this->send_email($project,$environment,$commit);\n }\n $this->info(\"发布成功结束!\");\n\n \n }", "public function run()\n {\n $this->buildPhpContainers();\n $this->buildNginxContainer();\n $this->buildDockerCompose();\n }", "function rpostinstall() {\n\t\tif (file_exists('composer.json')) {\n\t\t\t$composer = json_decode(file_get_contents('composer.json'));\n\t\t\t//debug($composer);\n\t\t\tif (isset($composer->scripts) && isset($composer->scripts->{'post-install-cmd'})) {\n\t\t\t\t$cmd = $this->composerCommand . ' run-script post-install-cmd';\n\t\t\t\t$deployPath = $this->getVersionPath();\n\t\t\t\t$remoteCmd = 'cd ' . $deployPath . ' && ' . $cmd;\n\t\t\t\t$this->ssh_exec($remoteCmd);\n\t\t\t}\n\t\t}\n\t}", "public function prepareDeployment() {\n\t\t$bean = $this->unbox();\n\t\tif ($bean->id === 0) {\n\t\t\tR::store($this);\n\t\t}\n\t\t$config = Zend_Registry::get('config');\n\t\t$workdir = $config->directories->deployment;\n\t\t$oldumask = umask(0); \n\t\tif (!is_dir($workdir)) {\n\t\t\tmkdir($workdir, 0777, true);\n\t\t}\n\t\t$this->deploymentDir = $workdir . $this->id;\n\t\tif ($bean->type === 'rollback') {\n\t\t\t$this->queueTarget('RollbackPilot');\n\t\t\t$this->queueTarget('Rollback');\n\n\t\t\t$bean->rollback = false;\n\t\t} elseif ($bean->type === 'upgrade') {\n\t\t\t$this->queueTarget('UpgradePilot');\n\t\t\t$this->queueTarget('Upgrade');\n\n\t\t\t$bean->rollback = true;\n\t\t} else {\n\t\t\t$this->queueTarget('Deploy');\n\n\t\t\t$bean->rollback = true;\n\t\t}\n\t\t\n\t\tif (!is_dir($workdir . $bean->id)) {\n\t\t\tmkdir($workdir . $bean->id, 0777, true);\n\t\t}\n\t\tumask($oldumask);\n\t\t$this->writePropertiesFile($workdir . $bean->id . '/build.properties');\n\t\tR::store($this);\n\t}", "public function process() {\n $this->migrate_course_files();\n // todo $this->migrate_site_files();\n }", "public function initiateDeployment() {\n\t\t$bean = $this->unbox();\n\t\t\n\t\t$config = Zend_Registry::get('config');\n\t\t$workdir = $config->directories->deployment;\n\t\t\n\t\t$oldumask = umask(0);\n\t\tif (!is_dir($workdir)) {\n\t\t\tmkdir($workdir, 0777, true);\n\t\t}\n\t\tif (!is_dir($workdir . $bean->id)) {\n\t\t\tmkdir($workdir . $bean->id, 0777, true);\n\t\t}\n\t\tumask($oldumask);\n\t\t\n\t\t$this->writePropertiesFile($workdir . $bean->id . '/build.properties');\n\t\t$process = $this->getNextProcess();\n\t\t$process->status = 'Not started';\n\t\tR::store($process);\n\t\t$process->startProcessWrapper();\n\t}", "public function onDeploy($callback)\n {\n $this->deployCallback = $callback;\n }", "public function execute()\n {\n $configPath = Yii::getAlias($this->consoleConfig);\n $app = new Application(require($configPath));\n\n // Wipe current integration DB\n if ($this->wipeExistingDb) {\n $dbFile = Yii::getAlias($this->dbFile);\n if (file_exists($dbFile)) {\n unlink($dbFile);\n }\n }\n\n $parts = $app->createController('migrate/up');\n\n if ($parts === false) {\n throw new Exception('Could not create controller');\n }\n\n /* @var $controller MigrateController */\n list($controller, $actionID) = $parts;\n\n $controller->interactive = false;\n $result = $controller->runAction($actionID, []);\n if ($result !== null && $result !== MigrateController::EXIT_CODE_NORMAL) {\n throw new Exception('Exit status was ' . VarDumper::dumpAsString($result));\n }\n }", "public function execute()\n\t{\n\t\tChangeProject::getInstance()->executeTask('cd');\n\t\tChangeProject::getInstance()->executeTask('gdb');\n\t\tChangeProject::getInstance()->executeTask('ci18n', array('markergmaps'));\n\t\tChangeProject::getInstance()->executeTask('cb');\n\t\tChangeProject::getInstance()->executeTask('cec');\n\t\tChangeProject::getInstance()->executeTask('croles');\n\t\tChangeProject::getInstance()->executeTask('cperm');\n\t\tChangeProject::getInstance()->executeTask('import-data', array('markergmaps', 'init.xml'));\n\t}", "public function execute(): void\n {\n parent::execute();\n\n // Zip extension is required for theme upload\n if (!extension_loaded('zlib')) {\n $this->template->assign('zlibIsMissing', true);\n }\n\n if (!$this->isWritable()) {\n // we need write rights to upload files\n $this->template->assign('notWritable', true);\n } else {\n // everything allright, we can upload\n $this->buildForm();\n $this->validateForm();\n $this->parse();\n }\n\n // display the page\n $this->display();\n }", "public function runAction():void{\n $currentVersion = Migration::getCurrentVersion();\n $migrations = glob($this->config->application->migrationsDir.'*.php');\n $version = count($migrations);\n if((int)$version === $currentVersion){\n Cli::error('Nothing to migrate');\n }\n for($i=($currentVersion+1); $i<=$version; $i++){\n $class= \"MigrationVersion\".$i; \n $migration = new $class();\n $this->executeQueries($migration->up());\n\n Migration::setCurrentVersion($i);\n }\n }", "public function execute()\n {\n\n try {\n // log a message that provisioning starts\n $this->getApplication()->getInitialContext()->getSystemLogger()->info(\n 'Now start to create database!'\n );\n\n // load the datasource node\n /** @var \\AppserverIo\\Appserver\\Core\\Api\\Node\\DatabaseNode $databaseNode */\n $databaseNode = $this->getDatasourceNode()->getDatabase();\n\n // load the connection data\n $user = $databaseNode->getUser();\n $db = $databaseNode->getDatabaseName();\n $host = $databaseNode->getDatabaseHost();\n $password = $databaseNode->getPassword();\n\n // create the connection\n $dbh = new \\PDO(sprintf('mysql:host=%s', $host), 'root');\n\n // execute the statement\n $dbh->exec(\"CREATE DATABASE `$db`;\n CREATE USER '$user'@'localhost' IDENTIFIED BY '$password';\n GRANT ALL ON `$db`.* TO '$user'@'localhost';\n FLUSH PRIVILEGES;\");\n\n // log a message that provisioning has been successfull\n $this->getApplication()->getInitialContext()->getSystemLogger()->info(\n 'Successfully created database!'\n );\n\n } catch (\\Exception $e) {\n $this->getApplication()->getInitialContext()->getSystemLogger()->error($e->__toString());\n }\n }", "public function execute() {\n $oldMigrations = new Filesystem(\"App/system/databases/migrations\");\n $oldMigrations->addFilter(new MigrationFilter($this->model->getShortModelName()));\n\n\n //todo: write custom iterator\n $oldMigrations->customCallback([$this, \"applyOldMigrations\"]);\n //todo: get the current model and get the diffrences between that and the migration\n //todo: write a new migration.\n //\n // $this->buildChangeSet();\n //do stuff execute all the things\n $this->createNewMigration();\n\n }", "protected function publishApprovalsFiles(): void\n {\n $this->call('vendor:publish', [\n '--tag' => 'migrations',\n '--provider' => \"Nesiasoft\\Core\\Approvals\\ApprovalsServiceProvider\",\n ]);\n\n $this->call('vendor:publish', [\n '--tag' => 'config',\n '--provider' => \"Nesiasoft\\Core\\Approvals\\ApprovalsServiceProvider\",\n ]);\n }", "public function run() {\n \n // Require the base class\n $this->load->file(APPPATH . '/base/main.php');\n\n // List all user's apps\n foreach (glob(APPPATH . 'base/user/apps/collection/*', GLOB_ONLYDIR) as $directory) {\n\n // Get the directory's name\n $app = trim(basename($directory) . PHP_EOL);\n\n // Verify if the app is enabled\n if (!get_option('app_' . $app . '_enable')) {\n continue;\n }\n\n // Create an array\n $array = array(\n 'MidrubBase',\n 'User',\n 'Apps',\n 'Collection',\n ucfirst($app),\n 'Main'\n );\n\n // Implode the array above\n $cl = implode('\\\\', $array);\n\n // Run cron job commands\n (new $cl())->cron_jobs();\n }\n \n // Prepare allowed files\n $allowed_files = array(\n 'cron.php',\n 'index.php',\n 'ipn-listener.php',\n 'update.php'\n );\n \n // List all files\n foreach (glob(FCPATH . '/*.php') as $filename) {\n \n $name = str_replace(FCPATH . '/', '', $filename);\n\n if ( !in_array($name, $allowed_files) ) {\n \n $msg = 'Was detected and deleted the file ' . $filename . '. Please contact support if you don\\'t know this file.';\n \n $this->send_warning_message($msg);\n unlink($filename);\n \n } else {\n \n if ( $this->check_for_malware($filename) ) {\n \n $msg = 'Was detected malware in the file ' . $filename . ' and was deleted.';\n\n $this->send_warning_message($msg);\n unlink($filename);\n \n }\n \n }\n \n }\n \n $extensions = array(\n '.php3',\n '.php4',\n '.php5',\n '.php7',\n '.phtml',\n '.pht'\n );\n\n foreach ( $extensions as $ext ) {\n $this->delete_files_by_extension(FCPATH, $ext); \n }\n \n $extensions[] = '.php';\n \n foreach ( $extensions as $ext ) {\n $this->delete_files_by_extension(FCPATH . 'assets', $ext); \n }\n \n $this->check_for_non_midrub_files(FCPATH . 'assets');\n \n }", "public function runSetupScripts()\n\t\t{\n\t\t\t$xmlResources = \\Z::getConfig()->getResources();\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$installedResources = \\Z::getModel('core/extension')->getCollection()->load();\n\t\t\t}\n\t\t\tcatch (\\Sys\\Exception $e)\n\t\t\t{\n\t\t\t\t$this->initialInstall();\n\t\t\t\t$installedResources = \\Z::getModel('core/extension')->getCollection()->load();\n\t\t\t}\n\t\t\tforeach ($xmlResources as $name => $resource)\n\t\t\t{\n\t\t\t\t// this is the version we should have installed on our system\n\t\t\t\t$latestVersion = $resource['requiredVersion'];\n\t\t\t\t// this is the version we currently have on our system, if the\n\t\t\t\t// extension is installed at all\n\t\t\t\t$installedExtension = $installedResources->isInstalled($name);\n\t\t\t\tif ($installedExtension)\n\t\t\t\t\t$installedVersion = $installedExtension->getVersion();\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$installedVersion = '0.0.0';\n\t\t\t\t\t$installedExtension = \\Z::getModel('core/extension');\n\t\t\t\t}\n\t\t\t\t$end = 'install-'.$latestVersion.'.php';\n\t\t\t\t$start = 'install-'.$installedVersion.'.php';\n\t\t\t\tif ($latestVersion != $installedVersion)\n\t\t\t\t{\n\t\t\t\t\t$installerFilesLocation = \\Z::getConfig()->getModule($resource['module'])->getPath('sql/'.$name.'/');\n\t\t\t\t\t$handle = opendir($installerFilesLocation);\n\t\t\t\t\tif ($handle)\n\t\t\t\t\t{\n\t\t\t\t\t\twhile (FALSE !== ($file = readdir($handle)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (strpos($file, '.php') > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (($file > $start) && ($file <= $end))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->_executedFiles[] = $installerFilesLocation.$file;\n\t\t\t\t\t\t\t\t\t//echo $installerFilesLocation.$file.'<br/>';\n\t\t\t\t\t\t\t\t\tinclude $installerFilesLocation.$file;\n\t\t\t\t\t\t\t\t\t// after the script is executed, set the\n\t\t\t\t\t\t\t\t\t// current version in the extension table\n\t\t\t\t\t\t\t\t\tif ($installedExtension->getCode() != '')\n\t\t\t\t\t\t\t\t\t\t$installedExtension->setVersion($latestVersion);\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t$installedExtension->setVersion($latestVersion)\n\t\t\t\t\t\t\t\t\t\t\t->setCode($name);\n\t\t\t\t\t\t\t\t\t$installedExtension->save();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// execute the install script for $file\n\t\t\t\t\t\t\t\t// update the version in the table\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclosedir($handle);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new \\Sys\\Exception('Cannot open the location => %s of the setup install scripts',\n\t\t\t\t\t\t\t$installerFilesLocation);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "public function handle(): int\n {\n $action = $this->argument('action');\n $params = json_decode($this->option('params'), true);\n\n if (config('deploy.method') == 'cron') {\n $schedule = get_config('deploy_schedules', []);\n if (empty($schedule)) {\n return true;\n }\n\n $index = array_key_first($schedule);\n $action = $schedule[$index];\n unset($schedule[$index]);\n set_config('deploy_schedules', $schedule);\n\n if (is_array($action)) {\n $this->autoDeploy->run($action['action'], $action['params']);\n } else {\n $this->autoDeploy->run($action);\n }\n\n return self::SUCCESS;\n }\n\n $this->autoDeploy->run($action, $params);\n\n return self::SUCCESS;\n }", "private function publishAssets()\n {\n $this->call('vendor:publish', [\n '--provider' => 'A17\\Twill\\TwillServiceProvider',\n '--tag' => 'assets',\n '--force' => true,\n ]);\n }", "final public function perform()\n {\n $this->execute($this->args, $this->app);\n }", "function rinstall() {\n\t\t$versionPath = $this->getVersionPath();\n//\t\tdebug($versionPath);\n\t\t/** @var Repo $repo */\n\t\tforeach ($this->repos as $repo) {\n\t\t\techo BR, '## ', $repo->path(), BR;\n\t\t\tif ($this->rexists($repo->path())) {\n\t\t\t\t$deployPath = $versionPath . '/' . $repo->path();\n\t\t\t\t$cmd = 'cd ' . $deployPath . ' && hg update -r ' . $repo->getHash();\n\t\t\t\t$this->ssh_exec($cmd);\n\t\t\t} else {\n\t\t\t\techo 'Error: '.$repo->path.' is not on the server. Maybe do rdeploy?', BR;\n\t\t\t}\n\t\t}\n\t}", "public function exec ()\n {\n // download and config the kitFramework\n $this->downloadAndConfigTheFramework();\n\n $relative_path = parse_url(WB_URL, PHP_URL_PATH);\n if (!empty($relative_path) && file_exists(WB_PATH.'/modules/kit_framework/Setup/htaccess.htt')) {\n $htaccess = file_get_contents(WB_PATH.'/modules/kit_framework/Setup/htaccess.htt');\n $htaccess = str_ireplace('{RELATIVE_PATH}', \"$relative_path/kit2\", $htaccess);\n file_put_contents(WB_PATH.'/kit2/.htaccess', $htaccess);\n }\n\n // download and config the Basic extension\n $this->downloadAndConfigTheBasicExtension();\n\n // add the output filter for the framework\n $this->addFilter();\n\n // copy the proxy.json\n if (file_exists(WB_PATH.'/modules/kit_framework/proxy.json')) {\n if (file_exists(WB_PATH.'/kit2/config') && !file_exists(WB_PATH.'/kit2/config/proxy.json')) {\n @copy(WB_PATH.'/modules/kit_framework/proxy.json', WB_PATH.'/kit2/config/proxy.json');\n }\n }\n }", "public function main()\n\t{\n\t\t$this->loadConfig();\n\t\t$this->validateProject();\n\t\t$this->cleanConfig();\n\t\t$this->installDependencies();\n\t\t$this->createAutoload();\n\t\t$this->finish();\n\t}", "function deploy()\n {\n $client = new Client();\n\n $client->request('POST', $this->keyword->getToUrl(), ['form_params' => $this->payload]);\n }", "public function run() {\n\t\t$this->preRun();\n\n\t\t$this->changeTags();\n\n\t\t$this->postRun();\n\t}", "public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}", "public function run()\n\t{\n\t\t$this->upgrade_to_1_1_0();\n\t}", "public function execute()\n {\n $this->run();\n }", "protected function publishAllVendorFiles()\n {\n $this->info('[START] Publishing all vendor files..........');\n\n $this->call('vendor:publish', ['--all' => true]);\n\n $this->info('[DONE ] Publishing all vendor files.');\n }", "public function run()\n {\n $this->addReleases();\n }", "protected function publishURLsFiles(): void\n {\n $this->call('vendor:publish', [\n '--tag' => 'migrations',\n '--provider' => \"Nesiasoft\\Core\\URLs\\URLsServiceProvider\",\n ]);\n\n $this->call('vendor:publish', [\n '--tag' => 'config',\n '--provider' => \"Nesiasoft\\Core\\URLs\\URLsServiceProvider\",\n ]);\n }", "function rcomposer() {\n\t\t$this->checkOnce();\n\t\t$deployPath = $this->getVersionPath();\n\t\t//$this->ssh_exec($this->composerCommand.' clear-cache');\n\t\t$this->ssh_exec($this->composerCommand.' config -g secure-http false');\n\t\t$remoteCmd = 'cd '.$deployPath.' && '.$this->composerCommand.' install --ignore-platform-reqs';\n\t\t$this->ssh_exec($remoteCmd);\n\t}", "public static function deploy(Application $application, $request)\n {\n try {\n $application->server->exec(\n view('scripts.deployments.install-wordpress', [\n 'request' => $request,\n 'application' => $application,\n ])->render()\n );\n\n $application->server->exec(\n view('scripts.deployments.setup-nginx', [\n 'application' => $application,\n ])->render()\n );\n\n $application->server->exec(\"sudo systemctl restart nginx\");\n\n $application->deployment_script = view('scripts.apps.wordpress.wordpress-deploy-default', [\n 'application' => $application\n ])->render();\n\n $application->save();\n\n return $application->fresh();\n } catch (\\Exception $e) {\n \\Log::info($e);\n }\n }", "private function deploy(Config\\Config $config, $version = null) {\n\t\t\t$fs\t\t= new FileSystem($config);\n\t\t\t$svn\t= new Svn($fs, $config);\n\t\t\t$ftp\t= new Ftp($fs, $config);\n\n\t\t\t// get the current active revisions\n\t\t\t$versionFrom\t= $this->checkFtpVersion($config, $ftp);\n\t\t\t$versionTo\t\t= $this->checkSvnVersion($config, $svn, $version);\n\n\t\t\tLogger::info(Translations::get('version_ftp', array($versionFrom)));\n\t\t\tLogger::info(Translations::get('version_svn', array($versionTo)));\n\n\t\t\tif ($versionTo != $versionFrom) {\n\t\t\t\tLogger::debug('collecting changed files..');\n\t\t\t\t$files = $svn->checkoutChanges($versionTo, $versionFrom);\n\n\t\t\t\tLogger::warning('found ' . (count($files['changed'])) . ' files / directories that changed and ' . (count($files['deleted'])) . ' files to delete');\n\n\t\t\t\t// Create a .ver file\n\t\t\t\t$fs->addSvnVersion($versionTo);\n\n\t\t\t\t// we should create a changes object\n\t\t\t\t// instead of creating such arrays\n\t\t\t\t// or upload the version file manually\n\t\t\t\t// via a new function $ftp->upload()\n\t\t\t\t$files['changed'][$config->getVersionFile()] = array(\n\t\t\t\t\t'path' => $config->getVersionFile(),\n\t\t\t\t\t'tempPath' => $fs->getTempFolder() . $config->getVersionFile(),\n\t\t\t\t\t'svnPath' => ''\n\t\t\t\t);\n\n\t\t\t\t$ftp->putChanges($files);\n\t\t\t\tLogger::success('Deploy done');\n\t\t\t} else {\n\t\t\t\tLogger::success('Nothing to do - Up to date');\n\t\t\t}\n\n\t\t\t// db deploy\n\t\t\t// @todo build a own class for db deploy related functions\n\t\t\tif(isset($config->db)) {\n\t\t\t\t$folder\t= $svn->checkout($config->db->getRevisionFolder());\n\t\t\t\t$files\t= File::getDirectoryList($folder . DS);\n\n\t\t\t\t$revisionFiles = array();\n\t\t\t\tforeach($files as $file) {\n\t\t\t\t\t// check if the file contains a revision\n\t\t\t\t\tpreg_match('/r([\\d,-]+)/', basename($file), $matches);\n\t\t\t\t\tif(isset($matches[1])\t\t\t\t// file is valid if\n\t\t\t\t\t\t&& is_numeric($matches[1])\t\t// contains a number\n\t\t\t\t\t\t&& $matches[1] > $versionFrom\t// the number is greater than the current revision\n\t\t\t\t\t\t&& $matches[1] <= $versionTo\t// and the number is smaller than the target revision\n\t\t\t\t\t) {\n\t\t\t\t\t\t$revisionFiles[] = $file;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// there are sql files to deploy\n\t\t\t\t// so connect to database and do a backup\n\t\t\t\tif(sizeOf($revisionFiles) > 0) {\n\t\t\t\t\t// connect to db\n\t\t\t\t\t$db = new \\XDUtils\\Database();\n\t\t\t\t\t$db->connect(\n\t\t\t\t\t\t$config->db->getServer(),\n\t\t\t\t\t\t$config->db->getUser(),\n\t\t\t\t\t\t$config->db->getPassword(),\n\t\t\t\t\t\t$config->db->getName()\n\t\t\t\t\t);\n\t\t\t\t\t$db->set_charset();\n\n\t\t\t\t\t// backup current database\n\t\t\t\t\tLogger::notice('[DB] Start Backup');\n\t\t\t\t\t$db->backupDatabase(ROOT . DS . 'dbbackup' . DS . 'backup-' . $config->db->getName() . '-' . time() . '.sql');\n\t\t\t\t\tLogger::success('[DB] Backup done');\n\n\t\t\t\t\t// deploy new revisions to db\n\t\t\t\t\tforeach($revisionFiles as $sqlFile) {\n\t\t\t\t\t\tLogger::info('[DB] Deploy revision file: ' . $sqlFile);\n\t\t\t\t\t\t$db->parse_file($sqlFile);\n\t\t\t\t\t\tLogger::success('[DB] Deploy done');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// remove the temp folder\n\t\t\t$fs->removeTempFolder();\n\t\t\treturn true;\n\t\t}", "protected function invokeScript() {\n $fileSystem = $this->system->getFileSystem();\n\n $directory = $fileSystem->getTemporaryFile();\n $directory->delete();\n $directory->create();\n $directoryAbsolute = $directory->getAbsolutePath();\n\n $this->appendOutput(\"# Created working directory \" . $directoryAbsolute);\n\n $cwd = getcwd();\n $exception = null;\n\n try {\n chdir($directoryAbsolute);\n\n $variables = $this->getCommandVariables($directoryAbsolute);\n\n $commands = array();\n if ($this->builder->getWillCheckout()) {\n $commands = array_merge($commands, $this->vcsManager->getCheckoutCommands());\n }\n $commands = array_merge($commands, explode(\"\\n\", $this->builder->getScript()));\n\n foreach ($commands as $command) {\n $command = $this->parseCommandVariables($command, $variables);\n\n $this->appendOutput($command);\n\n if (substr($command, 0, 3) == 'cd ') {\n chdir(substr($command, 3));\n\n continue;\n }\n\n // if (strpos($command, ' 2>') === false) {\n // $command .= ' 2>&1';\n // }\n\n $output = $this->system->executeInShell(array('export PATH=/usr/local/bin:/usr/bin:$PATH', $command), $code);\n if ($code != 0) {\n throw new Exception('Command returned code ' . $code . ': ' . $command);\n }\n\n $output = array_slice($output, 4);\n\n $this->appendCommandOutput($output);\n }\n } catch (Exception $exception) {\n $this->setException($exception);\n }\n\n chdir($cwd);\n $directory->delete();\n\n $this->appendOutput(\"# Deleted working directory \" . $directory->getAbsolutePath());\n }", "public function migrate()\n {\n $this->syncRepository();\n $this->copyVariables();\n $this->copyDeployKeys();\n $this->reEnableBuilds();\n }", "public function deploy($src, $dest)\n {\n $this->taskCopyDir(array($src => $dest))->run();\n }", "public function execute()\n\t{\t\n\t\t$this->controller = new Controller($this->path);\n\t\t$this->static_server = new StaticServer($this->path);\n\t\t\n\t\tCurrent::$plugins->hook('prePathParse', $this->controller, $this->static_server);\n\t\t\n\t\tif ( $this->static_server->isFile() )\n\t\t{\n\t\t\tCurrent::$plugins->hook('preStaticServe', $this->static_server);\n\t\t\t\n\t\t\t// Output the file\n\t\t\t$this->static_server->render();\n\t\t\t\n\t\t\tCurrent::$plugins->hook('postStaticServe', $this->static_server);\n\t\t\t\n\t\t\texit;\n\t\t}\n\t\t\n\t\t// Parse arguments from path and call appropriate command\n\t\tCowl::timer('cowl parse');\n\t\t$request = $this->controller->parse();\n\t\tCowl::timerEnd('cowl parse');\n\t\n\t\tif ( COWL_CLI )\n\t\t{\n\t\t\t$this->fixRequestForCLI($request);\n\t\t}\n\t\t\n\t\t$command = new $request->argv[0];\n\t\t\n\t\t// Set template directory, which is the command directory mirrored\n\t\t$command->setTemplateDir(Current::$config->get('paths.view') . $request->app_directory);\n\t\t\n\t\tCurrent::$plugins->hook('postPathParse', $request);\n\t\t\n\t\tCowl::timer('cowl command run');\n\t\t$ret = $command->run($request);\n\t\tCowl::timerEnd('cowl command run');\n\t\t\n\t\tCurrent::$plugins->hook('postRun');\n\t\t\n\t\tif ( is_string($ret) )\n\t\t{\n\t\t\tCowl::redirect($ret);\n\t\t}\n\t}", "public static function deploy() {\n\n\t\t$licence = null;\n\n\t\t// Check if we're allowed to install plugins before proceeding\n\t\t$this->check_capabilities();\n\n\t\t$download = $_POST['download'];\n\n\t\tif ( ! $_POST['edd_deploy'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If this is a chargeable product and a license is needed,\n\t\t// Try to validate it and if valid, activate it.\n\t\tif ( isset( $_POST['license'] ) ) {\n\n\t\t\t$license = $_POST['license'];\n\n\t\t\t$api_args = array(\n\t\t\t\t'edd_action' => 'activate_license',\n\t\t\t\t'license' => $license,\n\t\t\t\t'item_name' => urlencode( $download )\n\t\t\t);\n\n\t\t\t// Get a response from our EDD server\n\t\t\t$response = wp_remote_get( add_query_arg( $api_args, $this->api_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\t\t\t}\n\n\t\t\t// decode the license data\n\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\t\t// If the licence is not valid, early exit.\n\t\t\tif ( 'valid' != $license_data->license ) {\n\t\t\t\treturn;\n\t\t\t\t// TODO: Add an error message.\n\t\t\t}\n\n\t\t}\n\n\t\t// Get the download\n\t\t$api_args = array(\n\t\t\t'edd_action' => 'get_download',\n\t\t\t'item_name' => urlencode( $download ),\n\t\t\t'license'\t => $license,\n\t\t);\n\n\t\t$download_link = add_query_arg( $api_args, $this->api_url );\n\n\t\tif ( ! class_exists( 'Plugin_Upgrader' ) ) {\n\t\t\tinclude_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';\n\t\t}\n\n\t\t$upgrader = new Plugin_Upgrader( $skin = new Plugin_Installer_Skin( compact( 'type', 'title', 'url', 'nonce', 'plugin', 'api' ) ) );\n\t\t$install = $upgrader->install( $download_link );\n\n\t\tif ( $install == 1 ) {\n\n\t\t\t// TODO: Install the plugin.\n\n\t\t}\n\n\t\tdie();\n\n\t}", "public function run()\n {\n\n Environment::insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'short_name' => 'DEV',\n 'long_name' => 'Local',\n 'active' => 1,\n ]);\n\n Environment::insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'short_name' => 'PROD',\n 'long_name' => 'Production',\n 'active' => 1,\n ]);\n \n }", "public function run()\n {\n // default permissions\n $permissions = [\n 'role.index',\n 'role.create',\n 'role.edit',\n 'role.delete',\n 'user.index',\n 'user.create',\n 'user.edit',\n 'user.delete',\n 'permission.index',\n 'permission.create',\n 'permission.edit',\n 'permission.delete',\n 'product.index',\n 'product.create',\n 'product.edit',\n 'product.delete',\n 'bug.index',\n 'bug.delete',\n 'audit.index',\n 'audit.delete',\n 'api.uploadMedia'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n\n // default role\n $role = Role::create([\n 'id' => 2,\n 'name' => 'super-admin'\n ]);\n\n // sync permissions to role\n $role->syncPermissions($permissions);\n\n }", "public function execute(): void\n {\n $fileDirectoryPath = $this->filesystem->getDirectoryWrite(DirectoryList::PUB);\n $fileName = 'googleshopping.xml';\n try {\n $xmldata = $this->xmlFeed->getFeed();\n if (strlen($xmldata) > 500) {\n $fileDirectoryPath->writeFile($fileName, $xmldata);\n } else {\n $this->logger->error('Google Shopping XML Data not generated correctly');\n }\n } catch (\\Exception $exception) {\n $this->logger->error($exception->getMessage());\n }\n }", "public function run()\n {\n\n $this->repo->generate(3);\n\n }", "public function deploy($deploy_ids, $category, $template_id)\n {\n\n $users = $this->getUsersArray($deploy_ids, $category);\n\n $has_users = $this->checkUsers($users, $template_id);\n\n if ($has_users) {\n\n $result = $this->deployToUsers($users, $template_id);\n\n } else {\n\n $result = 0;\n\n }\n\n return $result;\n\n\n }", "public function run()\n {\n \t$packages = [\n \t\t'basic'\t=> [\n \t\t\t'name'\t\t=> 'Basic Package',\n \t\t\t'features'\t=> 'Up to 10 pages',\n \t\t\t'monthly_cost'\t=> 5000,\n \t\t\t'setup_cost'\t=> 15000\n \t\t],\n \t\t'business'\t=> [\n \t\t\t'name'\t\t=> 'Business Package',\n \t\t\t'features'\t=> 'Up to 25 pages',\n \t\t\t'monthly_cost'\t=> 6500,\n \t\t\t'setup_cost'\t=> 25000\n \t\t],\n \t];\n\n \tforeach ( $packages as $key => $package ) {\n \t\tPackage::create([\n \t\t\t'name'\t\t=> $package['name'],\n \t\t\t'features'\t=> $package['features'],\n \t\t\t'monthly_cost'\t=> $package['monthly_cost'],\n \t\t\t'setup_cost'\t=> $package['setup_cost'],\n \t\t]);\n \t}\n }", "public function handle(): int\n {\n $this->info($this->logPrefix.'Starting...');\n\n $this->call('config:clear');\n\n $this->runViewCompiler();\n\n $this->runRefreshManifest();\n\n $this->info($this->logPrefix.'Ready to Deploy!');\n\n return 0;\n }", "public function run(array $params)\n {\n try {\n $this->call('boilerplate:publish');\n // migrate all first\n $this->call('migrate');\n // then seed data\n $seeder = Database::seeder();\n $seeder->call('julio101290\\boilerplate\\Database\\Seeds\\BoilerplateSeeder');\n } catch (\\Exception $e) {\n $this->showError($e);\n }\n }", "public function run(array $params)\n {\n $this->determineSourcePath();\n\n // Config\n if (CLI::prompt('Publish Config file?', ['y', 'n']) == 'y')\n {\n $this->publishConfig();\n }\n \n // Migration\n if (CLI::prompt('Publish queue migration?', ['y', 'n']) == 'y')\n {\n $this->publishMigration();\n }\n\n\n }", "public function run()\n {\n echo 'Generating build... ';\n\n Util::cleanDirectory($this->outputDir);\n $this->generateFiles();\n\n echo \"OK\\n\";\n }", "private function insertApplyFunc()\n {\n $script = $this->rootDir . '/excmd/asrorz.php';\n $params = 'cruds/insert/apply --app=' . $this->newName;\n $phpcmd = 'php ' . $script . ' ' . $params;\n\n Az::debug($phpcmd, 'command to launch: ');\n $r = shell_exec($phpcmd);\n Az::debug($phpcmd, 'command executed: ');\n Az::debug($r, 'command result: ');\n }", "public function run() {\n $this->cleanupFilesystem();\n $this->downloadCommunityRegistry();\n $this->downloadAllCommunityDefinitions();\n $this->saveCommunicationDetails();\n }", "protected function publishFaxesFiles(): void\n {\n $this->call('vendor:publish', [\n '--tag' => 'migrations',\n '--provider' => \"Nesiasoft\\Core\\Faxes\\FaxesServiceProvider\",\n ]);\n\n $this->call('vendor:publish', [\n '--tag' => 'config',\n '--provider' => \"Nesiasoft\\Core\\Faxes\\FaxesServiceProvider\",\n ]);\n }", "private function triggerGruntTask()\n {\n $has_run = false;\n foreach ($this->config->map as $slug => $clone_url) {\n if ($clone_url === $this->request->cloneUrl()) {\n $this->triggerGrunt($slug);\n $has_run = true;\n }\n }\n //message about no support\n if ($has_run) {\n $msg = 'The grunt tasks associated with ' . $this->request->url() . ' completed successfully.';\n syslog(LOG_DEBUG, $msg);\n header('HTTP/1.1 200 OK');\n exit($msg);\n\n }\n $msg = 'There are no grunt tasks associated with ' . $this->request->url() . '.';\n syslog(LOG_DEBUG, $msg);\n header('HTTP/1.1 200 OK');\n exit($msg);\n }", "function deployment_admin_init() {\n\n\t// What is the current version of this plugin?\n\t$deployment_version = 3;\n\n\t// What is the current version in the db\n\t$db_version = get_option( 'deployment_version', 0 );\n\n\t// Is the db out of date?\n\tif ( $db_version < $deployment_version ) {\n\n\t\t// If so, loop over all subsequent version numbers and attempt to run corresponding deployment_update_N functions\n\t\tfor ( $version = $db_version + 1; $version <= $deployment_version; $version ++ ) {\n\t\t\tif ( function_exists( 'deployment_update_' . $version ) ) {\n\t\t\t\t$success = call_user_func( 'deployment_update_' . $version );\n\n\t\t\t\t// If the function returns a boolean false, log an error and bail out. Subsequent updates may rely on this update\n\t\t\t\t// so we shouldn't proceed any further.\n\t\t\t\tif ( $success === FALSE ) {\n\t\t\t\t\t// @TODO: log error here\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we've reached this far without error, update the db version\n\t\t\tupdate_option( 'deployment_version', $version );\n\t\t}\n\n\t\t// @TODO: output update summary on success\n\t}\n}", "public function execute()\n\t{\n\t\t$this->run();\n\t}", "protected function execute(InputInterface $input, OutputInterface $output) {\n $this->output = $output;\n $this->input = $input;\n\n // Set API token and set forge service to public variable\n $this->output('Forge API token: ' . $this->getToken());\n $forge = new Forge($this->getToken());\n $this->forge = $forge;\n\n try {\n // Find the server\n $server = $forge->server($this->getServer());\n $this->output(\"Server found.\");\n } catch (Exception $_) {\n $this->output(\"Failed to find server.\");\n return Command::FAILURE;\n }\n\n // Find or create the site\n $site = $this->findOrCreateSite($server);\n // Finalize deployment with scripts and environment variables\n $this->finalizeDeployment($server, $site);\n\n return Command::SUCCESS;\n }", "public function run()\n {\n $seedForDevelopment = [\n DefaultCurrencySeeder::class,\n DefaultUserAdminSeeder::class,\n DefaultCustomerSeeder::class,\n FakeProductTypeSeeder::class,\n FakeProductSeeder::class\n ];\n\n // add condition here if for production\n $toBeSeeded = $seedForDevelopment;\n \n $this->call($toBeSeeded);\n }", "protected function execute($arguments = array(), $options = array())\n {\n// $databaseManager = new sfDatabaseManager($this->configuration);\n// $connection = $databaseManager->getDatabase($options['connection'])->getConnection();\n $fs = new sfFilesystem();\n \n if(!file_exists(dirname(__FILE__).'/../../../../cache'))\n {\n $fs->mkdirs(dirname(__FILE__).'/../../../../cache');\n }\n \n if(!file_exists(dirname(__FILE__).'/../../../../log'))\n {\n $fs->mkdirs(dirname(__FILE__).'/../../../../log');\n }\n \n if(!file_exists(dirname(__FILE__).'/../../../../web/uploads'))\n {\n $fs->mkdirs(dirname(__FILE__).'/../../../../web/uploads');\n }\n \n if(!file_exists(dirname(__FILE__).'/../../../../uploads/assets'))\n {\n $fs->mkdirs(dirname(__FILE__).'/../../../../web/uploads/assets');\n }\n \n if(!file_exists(dirname(__FILE__).'/../../../../web/images'))\n {\n $fs->mkdirs(dirname(__FILE__).'/../../../../web/images');\n }\n \n if(!file_exists(dirname(__FILE__).'/../../../../web/js'))\n {\n $fs->mkdirs(dirname(__FILE__).'/../../../../web/js');\n }\n \n \n $this->runTask('project:permission');\n $this->runTask('plugin:publish-assets');\n\n $files = array(\n dirname(__FILE__) . '/../../../sftSAMLPlugin/lib/vendor/simplesamlphp-1.8.0-rc1/config/config.php',\n dirname(__FILE__) . '/../../../sftSAMLPlugin/lib/vendor/simplesamlphp-1.8.0-rc1/metadata',\n dirname(__FILE__) . '/../../../sftSAMLPlugin/lib/vendor/simplesamlphp-1.8.0-rc1/metadata/saml20-sp-remote.php',\n dirname(__FILE__) . '/../../../sftSAMLPlugin/lib/vendor/simplesamlphp-1.8.0-rc1/metadata/saml20-idp-remote.php',\n dirname(__FILE__) . '/../../../sftPAPIPlugin/lib/vendor/phpPoA-2.3/PAPI.conf',\n dirname(__FILE__) . '/../../../sftPAPIPlugin/lib/vendor/phpPoA-2.3/pubkey.pem',\n );\n\n //print_r($files);\n $fs->chmod($files, 0777);\n\n $originDir = dirname(__FILE__) . '/../../../sftSAMLPlugin/lib/vendor/simplesamlphp-1.8.0-rc1/www';\n $targetDir = dirname(__FILE__) . '/../../../../web/simplesaml';\n //print_r($originDir);\n //print_r($targetDir);\n\n $fs->relativeSymlink($originDir, $targetDir, true);\n\n // add your code here\n }", "private function command(){\n\n // $processAssets->run(function ($type, $buffer) {\n // $this->output->writeln(\n // $buffer\n // );\n // });\n\n $process = new Process(explode(' ', 'php '.$this->params->get('kernel.project_dir').'/bin/console ecommerce:indexservice:bootstrap --create-or-update-index-structure'), null, null, null, 900);\n\n $process->run(function ($type, $buffer) {\n $this->output->writeln(\n $buffer\n );\n });\n\n $process1 = new Process(explode(' ', 'php '.$this->params->get('kernel.project_dir').'/bin/console ecommerce:indexservice:bootstrap --update-index'), null, null, null, 900);\n\n $process1->run(function ($type, $buffer) {\n $this->output->writeln(\n $buffer\n );\n });\n }", "public function upload() {\n // FYI. We are on master now.\n $m_ftp = new \\Model_Ftp();\n $m_ftp->user_id = $this->user_id;\n $branch = $this->branch;\n // Get ftp data for the respective branch\n $ftp_data = $m_ftp->get($branch['ftp_id']);\n\n if (count($ftp_data) !== 1) {\n $this->log('Failed: Enviornment does not have a Linked FTP account.');\n throw new Exception(\"No Linked FTP for enviornment.\");\n } else {\n $ftp_data = $ftp_data[0];\n }\n\n // Testing if the FTP server works.\n try {\n $ftp_data['user'] = $ftp_data['username'];\n $ftp_url = http_build_url($ftp_data);\n// $ftp_test = utils::test_ftp($ftp_url);\n $ftp_test = new \\Banago\\Bridge\\Bridge($ftp_url);\n if ($ftp_test) {\n $this->log('ftp_connect', 'connected');\n }\n } catch (Exception $e) {\n $this->log('ftp_connect', 'connection failed: ' . $e->getMessage());\n throw new Exception('We are sending msg here.' . $e->getMessage());\n }\n\n // LOG --------------------------------\n $this->log('deploy_branch', $branch['branch_name']);\n $this->log('deploy_branch_env', $branch['name']);\n $this->output('Deploy to branch name: ' . $branch['branch_name']);\n // LOG END ----------------------------\n\n /*\n * Data is ready, need to get ready with repository state.\n * Has to be checked out to the branch specified\n * and has to be checked out to the commit specified.\n */\n\n /*\n * pull and clone done,\n * checkout to branch now.\n */\n\n $this->output('Checkout to ' . $branch['branch_name']);\n \\Utils::gitCommand(\"checkout \" . $this->branch['branch_name']);\n $this->log('revision_on_server_before', $branch['revision']);\n $this->output('Revision on FTP: ' . $branch['revision']);\n\n // Setting options for gitcore\n $options = array(\n 'record_id' => $this->record_id,\n 'repo' => $this->repo_dir,\n 'debug' => $this->debug,\n 'deploy_id' => $this->deploy_id,\n 'server' => 'default',\n 'ftp' => array(\n 'default' => array(\n 'scheme' => $ftp_data['scheme'],\n 'host' => $ftp_data['host'],\n 'user' => $ftp_data['username'],\n 'pass' => $ftp_data['pass'],\n 'port' => $ftp_data['port'],\n 'path' => $ftp_data['path'],\n 'passive' => TRUE,\n 'skip' => unserialize($this->branch['skip_path']),\n 'purge' => unserialize($this->branch['purge_path']),\n )\n ),\n 'remoteRevision' => $branch['revision'],\n );\n\n // if type_rollback.\n if ($this->record['record_type'] == $this->m_record->type_rollback && !empty($this->record['hash'])) {\n // checkout the the specific hash.\n \\Utils::gitCommand('checkout ' . $this->record['hash']);\n }\n\n // if type_sync\n if ($this->record['record_type'] == $this->m_record->type_sync) {\n // upload all files please.\n $options['remoteRevision'] = '';\n }\n\n if ($this->record['record_type'] == $this->m_record->type_service_push) {\n // push from github/bitbucket.\n if (!empty($this->record['hash']))\n \\Utils::gitCommand('checkout ' . $this->record['hash']);\n }\n\n // else its update\n\n $localRevision = \\Utils::gitCommand('rev-parse HEAD');\n if (isset($localRevision[0])) {\n $localRevision = trim($localRevision[0]);\n $options['localRevision'] = $localRevision;\n }\n\n if ($options['localRevision'] == $options['remoteRevision']) {\n $this->output('FTP server has the latest changes!');\n $this->log('FTP server has the latest changes!');\n }\n\n $this->output($localRevision);\n\n $gitcore = new \\Gitcore($options);\n try {\n // todo: we're inside.\n $gitcore->startDeploy();\n } catch (Exception $e) {\n // Store logs from GITCORE.\n $this->log('deploy_log', $gitcore->log);\n $this->output($this->log);\n throw new \\Exception($e->getMessage());\n }\n\n // Store Logs from GITCORE.\n $this->log['deploy_log'] = $gitcore->log;\n $this->output($this->log);\n\n $before_revision = $this->log['deploy_log']['remoteRevision_before'];\n $current_revision = $this->log['deploy_log']['remoteRevision_after'];\n\n // Storing output from GITCORE.\n $this->m_record->set($this->record_id, array(\n 'raw' => serialize($this->log),\n 'amount_deployed' => $this->log['deploy_log']['deployed']['human'],\n 'amount_deployed_raw' => $this->log['deploy_log']['deployed']['data'],\n 'file_add' => $this->log['deploy_log']['files']['upload'],\n 'file_remove' => $this->log['deploy_log']['files']['delete'],\n 'file_skip' => $this->log['deploy_log']['files']['skip'],\n 'hash' => $current_revision,\n 'hash_before' => $before_revision,\n ));\n\n // OK,\n // Update branch to ready,\n // Update branch revision.\n $this->m_branches->set($branch['id'], array(\n 'ready' => 1,\n 'revision' => $current_revision\n ));\n\n // OK, checkout to master.\n \\Utils::gitCommand('checkout master');\n }", "public function run()\n {\n $this->createPermissions();\n\n $this->assignPermissionRole();\n }", "public function updateRepository() {\n $scheduledFile = __DIR__ . '/scheduled.txt';\n if (!file_exists($scheduledFile))\n return;\n\n $requested = file_get_contents($scheduledFile);\n if (!unlink($scheduledFile))\n return;\n\n if ((time() - intval(trim($requested))) > 600)\n return;\n\n $commands = [\n // Updates the local copy of the repository with the most recent remote changes.\n 'git fetch --all',\n\n // Resets the repository to the state the remote currently is in.\n 'git reset --hard origin/master',\n\n // Remove any left-over files that are not part of the checkout, and not in .gitignore.\n 'git clean -f -d',\n\n // Write the latest commit SHA to the VERSION file.\n 'git rev-parse HEAD > VERSION',\n ];\n\n $directory = realpath(__DIR__ . '/../../../');\n\n foreach ($commands as $command)\n Info(trim(shell_exec('cd ' . $directory . ' && ' . $command . ' 2>&1')));\n\n Info('AutoDeploy: Updated to revision ' . file_get_contents(__DIR__ . '/../../../VERSION') . '.');\n }", "public function execute() {\r\n\t\t$bootstrap = $this->objectManager->create('Tx_Extbase_Core_Bootstrap');\r\n\t\t$configuration = array(\r\n\t\t\t'extensionName' => $this->getExtensionName(),\r\n\t\t\t'pluginName' => $this->getPluginName()\r\n\t\t);\r\n\t\treturn $bootstrap->run('', $configuration);\r\n\t}", "public function run()\n {\n $roles = [\n [\n 'name' => 'admin'\n ],\n [\n 'name' => 'front'\n ]\n ];\n foreach ($roles as $role) {\n $this->roleService->updateOrCreate(['name' => $role['name']], $role);\n }\n }", "public function run()\n {\n factory(App\\Models\\Post::class, 100)->create();\n\n $dir = 'public/pages/';\n $posts = App\\Models\\Post::all();\n foreach ($posts as $post) {\n if (isset($post->image) && Storage::exists($dir . $post->image)) {\n Storage::move($dir . $post->image, $dir . $post->page_id . '/' . $post->id . '/' . $post->image);\n }\n }\n }", "public function __invoke()\n {\n Helpers::step('<options=bold>Setting Build Environment</>');\n\n if (! file_exists($envPath = $this->appPath.'/.env')) {\n $this->files->put($envPath, '');\n }\n\n if (file_exists($this->appPath.'/.env.'.$this->environment)) {\n $this->files->copy(\n $this->appPath.'/.env.'.$this->environment,\n $envPath\n );\n\n $this->files->delete($this->appPath.'/.env.'.$this->environment);\n }\n\n $this->files->prepend(\n $envPath,\n 'APP_ENV='.$this->environment.PHP_EOL\n );\n\n // Mix takes the last environment variable value...\n $this->files->append(\n $envPath,\n PHP_EOL.'APP_ENV='.$this->environment.PHP_EOL\n );\n\n $this->files->append(\n $envPath,\n 'ASSET_URL='.$this->assetUrl.PHP_EOL\n );\n\n $this->files->append(\n $envPath,\n 'MIX_VAPOR_ASSET_URL='.$this->assetUrl.PHP_EOL\n );\n\n $this->files->append(\n $envPath,\n 'VITE_VAPOR_ASSET_URL='.$this->assetUrl.PHP_EOL\n );\n }", "public function run() {\n\t\t$this->create_instances();\n\t\t$this->register_hooks();\n\t}", "private function _post()\n\t{\n\t\t$sCacheModules = PHPFOX_DIR_FILE . 'log' . PHPFOX_DS . 'installer_modules.php';\n\t\tif (!file_exists($sCacheModules))\n\t\t{\n\t\t\t// Something went wrong...\n\t\t}\t\t\n\t\trequire_once($sCacheModules);\t\t\n\t\t\n\t\t$oModuleProcess = Phpfox::getService('admincp.module.process');\t\t\n\t\tforeach ($aModules as $sModule)\n\t\t{\t\t\n\t\t\t$oModuleProcess->install($sModule, array('post_install' => true));\t\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->_pass();\n\t\t$this->_oTpl->assign(array(\n\t\t\t\t'sMessage' => 'Post install completed...',\n\t\t\t\t'sNext' => $this->_step('final')\n\t\t\t)\n\t\t);\n\t}", "function execute() {\n\t\t$fileMgr = new FileManager();\n\t\t$filesDir = Config::getVar('files', 'files_dir');\n\t\t$filePath = current($this->argv);\n\t\t$usageStatsDir = $this->_usageStatsDir;\n\t\t$tmpDir = $this->_tmpDir;\n\n\t\tif ($fileMgr->fileExists($tmpDir, 'dir')) {\n\t\t\t$fileMgr->rmtree($tmpDir);\n\t\t}\n\n\t\tif (!$fileMgr->mkdir($tmpDir)) {\n\t\t\tprintf(__('admin.copyAccessLogFileTool.error.creatingFolder', array('tmpDir' => $tmpDir)) . \"\\n\");\n\t\t\texit(1);\n\t\t}\n\n\t\tif ($fileMgr->fileExists($filePath, 'dir')) {\n\t\t\t// Directory.\n\t\t\t$filesToCopy = glob($filePath . DIRECTORY_SEPARATOR . '*.*');\n\t\t\tforeach ($filesToCopy as $file) {\n\t\t\t\t// If a base filename is given as a parameter, check it.\n\t\t\t\tif (count($this->argv) == 2) {\n\t\t\t\t\t$baseFilename = $this->argv[1];\n\t\t\t\t\tif (strpos(pathinfo($file, PATHINFO_BASENAME), $baseFilename) !== 0) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->_copyFile($file);\n\t\t\t}\n\t\t} else {\n\t\t\tif ($fileMgr->fileExists($filePath)) {\n\t\t\t\t// File.\n\t\t\t\t$this->_copyFile($filePath);\n\t\t\t} else {\n\t\t\t\t// Can't access.\n\t\t\t\tprintf(__('admin.copyAccessLogFileTool.error.acessingFile', array('filePath' => $filePath)) . \"\\n\");\n\t\t\t}\n\t\t}\n\n\t\t$fileMgr->rmtree($tmpDir);\n\t}" ]
[ "0.7791337", "0.75530183", "0.7403991", "0.7403991", "0.71118796", "0.6850574", "0.6759336", "0.64493597", "0.64446783", "0.64348465", "0.6363942", "0.630397", "0.63000774", "0.6112146", "0.60748327", "0.6056126", "0.6055078", "0.60430974", "0.60372525", "0.60299265", "0.60264647", "0.59728", "0.5948948", "0.5948948", "0.5941726", "0.5939015", "0.59219", "0.591228", "0.5908461", "0.59007865", "0.5892797", "0.5892352", "0.58777493", "0.5867952", "0.5851221", "0.5831121", "0.582949", "0.5820427", "0.57965434", "0.5776412", "0.57288194", "0.5709042", "0.57071656", "0.565422", "0.5643134", "0.56385356", "0.562954", "0.5592192", "0.5588492", "0.5565037", "0.55635214", "0.5559131", "0.5553065", "0.55186284", "0.55073285", "0.5506936", "0.55059636", "0.5504575", "0.54902184", "0.5476341", "0.547459", "0.5471688", "0.54688567", "0.5456132", "0.5443195", "0.5428645", "0.542842", "0.5425357", "0.5416968", "0.54133624", "0.5410892", "0.5403952", "0.5397631", "0.5393897", "0.5385018", "0.5379247", "0.53785706", "0.53782946", "0.5377962", "0.5375244", "0.53671265", "0.5354426", "0.5353387", "0.53499746", "0.5348224", "0.5347109", "0.534532", "0.5328572", "0.53279", "0.5326185", "0.5324225", "0.5320901", "0.53160244", "0.5307257", "0.5297049", "0.5295615", "0.5291124", "0.5264273", "0.52609646", "0.52584237" ]
0.8422718
0
Loads the payload and maps the schema
public function load() { // load the payload $payload = new \Yapapaya\DevOps\WPD\Payload( $this->config ); $this->payload = $payload->setup(); // map the payload with the configuration $map = new \Yapapaya\DevOps\WPD\Map(); $map->init( $this->config, $this->payload ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function load()\n\t{\n\n $data = simplexml_load_string(file_get_contents($this->_origin));\n\n\n\n $data = json_decode(json_encode((array)$data), TRUE);\n\n //$this\n\n $this->_data = [];\n\n\n $firstKey = array_keys($data)[0];\n\n //print_r($data[$firstKey]);\n //echo \"<br><br>\";\n\n foreach($data[$firstKey] AS $element) {\n\n\n //var_dump(self::arrayToObject($element));\n\n $this->_fields = array_keys($element);\n\n\n $this->_data[@$element['id']] = self::arrayToObject($element);\n\n }\n\n\t\t$this->reindex();\n\t}", "abstract protected function _load_schema($information_schema);", "abstract protected function loadDefinition();", "abstract protected function loadFields();", "protected function load()\n\t{\n //---------------------\n\t\tif (($handle = simplexml_load_file($this->_origin)) !== FALSE)\n\t\t{\n $this->_fields = array(\"id\",\"task\",\"priority\",\"size\",\"group\",\"deadline\", \"status\",\"flag\");\n foreach($handle as $item){\n $record = new stdClass();\n for ($i = 0; $i < count($this->_fields); $i ++ )\n $record->{$this->_fields[$i]} = (string)$item[$this->_fields[$i]];\n $this->_data[$record->id] = $record;\n }\n\t\t}\n\t\t// --------------------\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\t}", "public function load()\n {\n foreach ($this->aMappingConfiguration as $sLinkedEntity => $aMappingSetup) {\n $this->loadMapped(new $sLinkedEntity());\n }\n }", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "public function load()\n {\n $input = $this->getCleanInput();\n $this->populate($input);\n }", "abstract public function load();", "abstract public function load();", "public abstract function load();", "protected function loadMetaData() {}", "public function load() { }", "abstract public function loadData();", "private function init(): void {\n\t\t$this->required = $this->json['required'] ?? array();\n\t\t$this->additional_properties = $this->json['additionalProperties'] ?? false;\n\t\t$this->required = $this->json['required'] ?? array();\n\n\t\t$properties = $this->json['properties'] ?? array();\n\t\t$definitions = $this->json['definitions'] ?? array();\n\t\t$all_of = $this->json['allOf'] ?? array();\n\n\t\tforeach ( $definitions as $key => $definition ) {\n\t\t\t$this->definitions[ $key ] = self::from_json( $this->get_name() . '/definitions/' . $key, array( 'properties' => $definition ) );\n\t\t}\n\n\t\tforeach ( $properties as $key => $property ) {\n\t\t\t// If object, create a new schema.\n\t\t\tif ( 'object' === ( $property['type'] ?? '' ) ) {\n\t\t\t\t$this->properties[ $key ] = self::from_json( $this->get_name() . '/properties/' . $key, $property );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( self::REF__KEY === $key ) {\n\t\t\t\t$this->properties[ $key ] = $this->get_reference( $property );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->properties[ $key ] = Property::from_json( $this, $key, $property );\n\t\t}\n\n\t\tforeach ( $all_of as $one_key => $one_value ) {\n\t\t\t$key = array_key_first( $one_value );\n\t\t\t$value = $one_value[ $key ];\n\n\t\t\tswitch ( $key ) {\n\t\t\t\tcase self::REF__KEY:\n\t\t\t\t\t$reference = $this->get_reference( $value );\n\t\t\t\t\t$this->properties = array_merge( $this->properties, $reference->get_properties() );\n\t\t\t\t\t$this->required = array_merge( $this->required, $reference->get_required() );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'properties':\n\t\t\t\t\t$one_prop = self::from_json( $this->get_name() . '/oneof/' . $one_key, $one_value );\n\t\t\t\t\t$this->properties = array_merge( $this->properties, $one_prop->get_properties() );\n\t\t\t\t\t$this->required = array_merge( $this->required, $one_prop->get_required() );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "protected abstract function _body_from_payload ($payload);", "public function load()\n {\n }", "abstract protected function initializeMappedTypes();", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function loadSchema($ref) {\n\t\t$refParts = parse_url($ref);\n\t\t$base = '/schemas/base/common/schema/';\n\t\t$baseLen = strlen($base);\n\t\tif (isset($refParts['host']) and $refParts['host'] == 'commerce.mesh.mx' and substr_compare($refParts['path'], $base, 0, $baseLen)==0) {\n\t\t\t$ref = substr($refParts['path'], $baseLen);\n\t\t}\n\n\t\tif(!property_exists($this, $ref)){\n\t\t\techo json_encode($refParts);\n\t\t\tthrow new \\Exception('BAD ' . $ref . \"\\n\");\n\t\t}\n\t\treturn $this->$ref;\n\t}", "abstract protected function _loadMappingFile($file);", "abstract protected function _loadMappingFile($file);", "public function loadFromFile()\n {\n $this->getLogger()->debug('Reading metadata from ' . $this->defFile);\n $fields = Yaml::parse($this->defFile);\n if (!is_array($fields)) {\n $fields = array();\n $this->getLogger()->warning('No definition found in metadata file.');\n }\n $res = array();\n foreach ($fields as $field_data) {\n $res[$field_data['id']] = $field_data;\n }\n ksort($res);\n return $res;\n }", "protected function process_load($data)\n\t{\n\t\t$parsed_data = array();\n\t\tforeach ($data as $key => $value)\n\t\t{\n\t\t\tif (strpos($key, ':'))\n\t\t\t{\n\t\t\t\tlist($table, $field) = explode(':', $key);\n\t\t\t\tif ($table == $this->_table_name)\n\t\t\t\t{\n\t\t\t\t\t$parsed_data[$field] = $value;\n\t\t\t\t}\n\t\t\t\telseif ($field)\n\t\t\t\t{\n\t\t\t\t\t$this->_lazy[inflector::singular($table)][$field] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$parsed_data[$key] = $value;\n\t\t\t}\n\t\t}\n\t\t$this->_data = $parsed_data;\n\t}", "function __initTransSchema() {\n\t\t$fields = $this->settings[$this->model->alias]['fields'];\n\t\t$primary = $this->model->primaryKey;\n\t\t$results = array();\n\t\t$schema = $this->model->_schema;\n\t\t$results = am($results, $this->__setSchemaField($primary, $schema[$primary]));\n\t\tforeach ($schema as $fieldname => $descArray) {\n\t\t\tif (!empty($fields)) {\n\t\t\t\tif (array_key_exists($fieldname, $fields)) {\n\t\t\t\t\t$results = am($results, $this->__setSchemaField($fieldname, $descArray));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($fieldname !== $primary) {\n\t\t\t\t\t$results = am($results, $this->__setSchemaField($fieldname, $descArray));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->__transSchema = $results;\n\t}", "public function canReferenceUsingSchemaLoader() {\n\t\t$loader = new DummySchemaLoader();\n\t\t$loader->root = '{\n\t\t\t\t\t\"type\":\"object\",\n\t\t\t\t\t\"properties\":{\n\t\t\t\t\t\t\"foo\":{\n\t\t\t\t\t\t\t\"$ref\":\"fooType\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}';\n\t\t$loader->fooType = '{\n\t\t\t\t\t\"type\":\"integer\"\n\t\t\t\t}';\n\t\t$this->sut = new JSONSchemaBuilder($loader);\n\t\t$schema = $this->sut->build('root');\n\n\t\t$obj = new \\stdClass();\n\t\t$obj->foo = 5;\n\n\t\t$this->assertTrue($schema->validate($obj));\n\n\t\t$obj->foo = '5';\n\t\t$this->assertFalse($schema->validate($obj));\n\t}", "function importSchema(){\n\t\t\t$this->exportsSchema = false;\n\t\t}", "protected function updateSchema() {\n $params = array();\n if(self::$schemaLanguage != null) {\n $params['language'] = self::$schemaLanguage;\n }\n $result = WebApi::getJSONData('ITFItems_440', 'GetSchema', 1, $params);\n\n self::$attributeSchema = array();\n foreach($result->attributes->attribute as $attributeData) {\n self::$attributeSchema[$attributeData->name] = $attributeData;\n }\n\n self::$itemSchema = array();\n foreach($result->items->item as $itemData) {\n self::$itemSchema[$itemData->defindex] = $itemData;\n }\n\n self::$qualities = array();\n foreach($result->qualities as $quality => $id) {\n self::$qualities[$id] = $quality;\n }\n }", "public function __load();", "public function schema();", "public function payload();", "public function payload();", "protected function load()\n\t{\n\t\t//---------------------\n\t\t// Your code goes here\n\t\t// --------------------\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\t}", "public function getSchema() {}", "public function resolvePayload(Request $request);", "private function loadCachedSchema(): array\n {\n return unserialize($this->files->get($this->getCachedSchemaPath()));\n }", "private function loadFromStore() {\r\n \r\n /*\r\n * Request start time\r\n */\r\n $this->requestStartTime = microtime(true);\r\n \r\n /*\r\n * Clean search filters\r\n */\r\n $originalFilters = $this->defaultModel->getFiltersFromQuery($this->context->query);\r\n \r\n /*\r\n * Number of returned results is never greater than MAXIMUM_LIMIT\r\n */\r\n $limit = isset($originalFilters['count']) && is_numeric($originalFilters['count']) ? min($originalFilters['count'], isset($this->defaultModel->searchFilters['count']->maximumInclusive) ? $this->defaultModel->searchFilters['count']->maximumInclusive : 500) : $this->context->dbDriver->resultsPerPage;\r\n\r\n /*\r\n * Compute offset based on startPage or startIndex\r\n */\r\n $offset = $this->getOffset($originalFilters, $limit);\r\n \r\n /*\r\n * Query Analyzer \r\n */\r\n $analysis = $this->analyze($originalFilters);\r\n \r\n /*\r\n * Completely not understood query - return an empty result without\r\n * launching a search on the database\r\n */\r\n if (isset($analysis['notUnderstood'])) {\r\n $this->restoFeatures = array();\r\n $this->paging = $this->getPaging(array(\r\n 'total' => 0,\r\n 'isExact' => true\r\n ), $limit, $offset);\r\n }\r\n /*\r\n * Read features from database\r\n */ \r\n else {\r\n $this->loadFeatures($analysis['appliedFilters'], $limit, $offset);\r\n }\r\n \r\n /*\r\n * Set description\r\n */\r\n $this->setDescription($analysis, $offset, $limit);\r\n \r\n }", "public function loadFromPayload($payload,$path)\n\t{\n $uri= trim($path, \"/\");\n $uriArr = explode(\"/\", $uri);\n\n $this->elementId = parent::URIToId($uri,\"lesson\");\n $this->elementType = \"lesson\";\n \n if($uriArr[CONTENT_TYPE_INDEX]==\"content\")\n {\n $this->elementId = parent::URIToId($uri,\"lesson\");\n $this->elementType = \"lesson\";\n }\n else if($uriArr[CONTENT_TYPE_INDEX]==\"quiz\")\n {\n $this->elementId = parent::URIToId($uri,\"quiz\");\n $this->elementType = \"quiz\";\n }\n \n $this->id = parent::URIToId($uri,\"discussion\");\n $this->name = preg_replace('/_/', ' ', urldecode($uriArr[LESSON_INDEX])).($uriArr[CONTENT_TYPE_INDEX] == \"quiz\" ? \"Quiz\" : \"\").\" Discussion\";\n \n return parent::loadFromPayload($payload, $path);\n\t}", "public function load(): void;", "public function load(): void;", "public function load()\n {\n }", "public function load()\n {\n }", "private function assignSchema(): void\n {\n $action = strtolower($this->route->getAction());\n $crudActions = ['index','add','view','edit'];\n\n if (!$this->schema || $this->operation->hasSuccessResponseCode() || !in_array($action, $crudActions)) {\n return;\n }\n\n $response = (new Response())->setCode('200');\n\n foreach ($this->config->getResponseContentTypes() as $mimeType) {\n $schema = $this->getMimeTypeSchema($mimeType, $action);\n $response->pushContent(\n (new Content())\n ->setSchema($schema)\n ->setMimeType($mimeType)\n );\n }\n\n $this->operation->pushResponse($response);\n }", "function load_from_external_source($col_mapping, $source_data) {\n $a = array();\n $label_formatter = new \\App\\Libraries\\Label_formatter();\n $source_data2 = array_change_key_case($source_data, CASE_LOWER);\n\n // load entry fields from external source\n foreach ($col_mapping as $fld => $spec) {\n\n // $spec['type'] will typically be ColName, PostName, or Literal\n // However, it might have a suffix in the form '.action.ActionName'\n\n // Method get_entry_form_definitions() E_model.php looks for text \n // in the form 'ColName.action.ActionName'\n // and will add an 'action' item to the field spec\n \n switch ($spec['type']) {\n case 'ColName':\n // Copy the text in the specified column of the detail report for the source page family\n // . \" (field = \" . $spec['value'] . \", action = $action)\"\n $col = $spec['value'];\n $col_fmt = $label_formatter->format($col);\n $col_defmt = $label_formatter->deformat($col);\n $val = \"\";\n if (array_key_exists($col, $source_data)) {\n $val = $source_data[$col];\n } elseif (array_key_exists($col_fmt, $source_data)) {\n // Target column for column name not found; try using the display-formatted target field\n $val = $source_data[$col_fmt];\n } elseif (array_key_exists($col_defmt, $source_data)) {\n // Target column for column name not found; try using the display-deformatted target field\n $val = $source_data[$col_defmt];\n } else {\n // TODO: Trigger a warning message of some kind?\n // Return an invalid link id to not break the page entirely; it's harder to see that there's a problem, but much easier to see the exact cause\n $val = \"COLUMN_NAME_MISMATCH\";\n }\n $a[$fld] = $val;\n break;\n\n case 'PostName':\n // Retrieve the named POST value\n //$request = \\Config\\Services::request();\n //$pv = $request->getPost($spec['value']);\n $col = $spec['value'];\n $pv = \"\";\n if (array_key_exists($col, $source_data2)) {\n $pv = $source_data2[$col];\n }\n $a[$fld] = $pv;\n break;\n\n case 'Literal':\n // Store a literal string\n $a[$fld] = $spec['value'];\n break;\n }\n\n // any further actions?\n if (isset($spec['action'])) {\n switch ($spec['action']) {\n case 'ExtractUsername':\n // Look for username in text of the form \"Person Name (Username)\"\n // This Regex matches any text between two parentheses\n\n $patUsername = '/\\(([^)]+)\\)/i';\n $matches = array();\n\n preg_match_all($patUsername, $a[$fld], $matches);\n\n // The $matches array returned by preg_match_all is a 2D array\n // Any matches to the first capture are in the array at $matches[0]\n\n if (count($matches[1]) > 0) {\n // Update $a[$fld] to be the last match found (excluding the parentheses)\n\n $a[$fld] = $matches[1][count($matches[1]) - 1];\n }\n\n break;\n\n case 'ExtractEUSId':\n // Look for EUS ID in text of the form \"LastName, FirstName (12345)\"\n // This Regex matches any series of numbers between two parentheses\n\n $patEUSId = '/\\(( *\\d+ *)\\)/i';\n $matches = array();\n\n preg_match($patEUSId, $a[$fld], $matches);\n\n // $matches is now a 1D array\n // $matches[0] is the full match\n // $matches[1] is the captured group\n\n if (count($matches) > 1) {\n // Update $a[$fld] to be the first match found (excluding the parentheses)\n\n $a[$fld] = $matches[1];\n }\n\n break;\n\n case 'Scrub':\n // Only copy certain text from the comment field of the source analysis job\n\n // Look for text in the form '[Req:Username]'\n // If found, put the last one found in $s\n // For example, given '[Job:D3M580] [Req:D3M578] [Req:D3L243]', set $s to '[Req:D3L243]'\n // This is a legacy comment text that was last used in 2010\n\n $s = \"\";\n $field = $a[$fld];\n\n $patReq = '/(\\[Req:[^\\]]*\\])/';\n $matches = array();\n preg_match_all($patReq, $field, $matches);\n\n // The $matches array returned by preg_match_all is a 2D array\n // Any matches to the first capture are in the array at $matches[0]\n\n if (count($matches[0]) != 0) {\n $s .= $matches[0][count($matches[0]) - 1];\n }\n\n // Also look for 'DTA:' followed by letters, numbers, and certain symbols\n // For example, given '[Job:D3L243] [Req:D3L243] DTA:DTA_Manual_02', look for 'DTA:DTA_Manual_02'\n // If found, append the text to $s\n // This is a legacy comment text that was last used in 2010\n\n $patDTA = '/(DTA:[a-zA-Z0-9_#\\-]*)/';\n preg_match($patDTA, $field, $matches);\n\n // $matches is now a 1D array\n // $matches[0] is the full match\n // $matches[1] is the captured group\n\n if (count($matches) > 1) {\n $s .= \" \" . $matches[1];\n }\n\n $a[$fld] = $s;\n break;\n }\n }\n }\n return $a;\n}", "protected function loadRow() {}", "protected function setSchema($schema) {}", "public function parse()\n {\n $this->initProps();\n $this->initParams();\n $this->load();\n }", "abstract protected function initDataTypes();", "abstract public function loadAll();", "public static function loadStrapper() {\n\t\t\n\t}", "private function loadReadDataIntoMDR() {\r\n \r\n }", "protected function importDatabaseData() {}", "private function loadInstance(array $fields): void\n {\n // Configures Value Object's instance.\n $this->registerUsableFields();\n $this->registerAttributeCastingList();\n $this->registerAttributeRuleList();\n\n // Translates supplied fields, into existing ones.\n $mapped = $this->translateToMappedFields($fields);\n\n // Validates and loads supplied data into class.\n $mapped = $this->processRules($mapped);\n $this->validateRequired($mapped);\n $this->castAttributes($mapped);\n }", "abstract protected function _getSchemaFile();", "private function import($payload)\n {\n // make payload\n $xml = trim($payload);\n $batchID = \"SCHEDULED-XML-\".md5($xml).'-'.time();\n $file = Payload::write($this->dataSource->data_source_id, $batchID, $xml);\n\n $this->log(\"Payload writen at: {$file}\");\n\n try {\n $client = new Client(['base_uri' => baseUrl()]);\n $response = $client->request(\n 'POST',\n '/api/registry/import',\n [\n 'form_params' => [\n 'ds_id' => $this->dataSource->data_source_id,\n 'batch_id' => $batchID,\n 'source' => 'NLAPullBack',\n 'name' => 'NLA Pull Back Job'\n ]\n ]\n );\n $result = $response->getBody()->getContents();\n\n $json = json_decode($result, true);\n $taskID = $json['data']['id'];\n $this->info(\"TaskID: {$taskID}\");\n\n $path = \"/tmp/\".uniqid();\n $this->log(\"Response writen to $path\");\n file_put_contents($path, $result);\n\n } catch (RequestException $e) {\n $this->error($e->getResponse()->getBody());\n }\n\n }", "protected function loadSchema()\n {\n return $this->hasFixturesBundles();\n }", "static public function loadSchema(Datastore $db, Product &$product)\n {\n $stmt = $db->prepare('SELECT\n tbl_schema.col_id, tbl_schema.col_name, tbl_schema.col_type, tbl_schema_element.col_name, tbl_schema_element.col_type\n FROM tbl_schema_element JOIN tbl_schema ON (tbl_schema.col_id = tbl_schema_element.col_schema_id)\n WHERE tbl_schema.col_product_id = :productId\n ORDER BY tbl_schema.col_id\n ');\n $stmt->bindValue(':productId', $product->id(), PDO::PARAM_INT);\n $db->execute($stmt);\n $schema = array();\n $entry = new SchemaEntry($product);\n foreach ($stmt as $row) {\n if ($entry->entryId != $row[0]) {\n if ($entry->isValid()) {\n array_push($schema, $entry);\n $entry = new SchemaEntry($product);\n }\n $entry->entryId = $row[0];\n $entry->name = $row[1];\n $entry->type = $row[2];\n }\n $elem = new SchemaEntryElement($entry);\n $elem->name = $row[3];\n $elem->type = $row[4];\n array_push($entry->elements, $elem);\n }\n if ($entry->isValid())\n array_push($schema, $entry);\n\n return $schema;\n }", "abstract protected function load(Connection $db);", "protected function loadTableNameData($schema) {\r\n\t\tif (isset ( $this->data ['table_names'] [$schema] )) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t$this->prepareDataHierarchy ( 'table_names', $schema );\r\n\t}", "function we_load($from=LOAD_MAID_DB){\n\t\twe_binaryDocument::we_load($from);\n\t}", "public function schema()\n {\n return [\n 'post' => [\n 'name' => 'string', \n 'surname' => 'string', \n 'description' => 'string', \n 'gender' => 'string[male|female]', \n 'phone' => 'string', \n 'email' => 'string[email]', \n 'pobox' => 'string', \n 'group_id' => 'number',\n 'address' => [\n 'billing' => [\n 'name' => 'string',\n 'surname' => 'string',\n 'phone' => 'string',\n 'address_1' => 'string',\n 'address_2' => 'string',\n 'country' => 'string',\n 'city' => 'string',\n 'pobox' => 'string',\n 'company' => 'string',\n ], \n 'shipping' => [\n 'name' => 'string',\n 'surname' => 'string',\n 'phone' => 'string',\n 'address_1' => 'string',\n 'address_2' => 'string',\n 'country' => 'string',\n 'city' => 'string',\n 'pobox' => 'string',\n 'company' => 'string',\n ]\n ]\n ], \n 'put' => [\n 'name' => 'string', \n 'surname' => 'string', \n 'description' => 'string', \n 'gender' => 'string[male|female]', \n 'phone' => 'string', \n 'email' => 'string[email]', \n 'pobox' => 'string', \n 'group_id' => 'number'\n ]\n ];\n }", "public function postLoad() {}", "public function load($data);", "abstract protected function init(array &$payload): void;", "public function canResolveIDs() {\n\t\t$loader = new DummySchemaLoader();\n\t\t$loader->rootschema = '{\n\t\t \"id\": \"http://x.y.z/rootschema#\",\n\t\t \"type\":\"object\",\n\t\t \"properties\":{\n\t\t \t\"int\":{\"$ref\":\"dir1/dir2/otherschema#\"}\n\t\t }\n\t\t}';\n\t\t$otherSchemaID = 'http://x.y.z/dir1/dir2/otherschema';\n\t\t$loader->$otherSchemaID = '{\n\t\t \"id\": \"http://x.y.z/dir1/dir2/otherschema#\",\n\t\t \"type\":\"object\",\n\t\t \"properties\":{\n\t\t \t\"value\":{\"$ref\":\"../middleschema#\"}\n\t\t }\n\t\t}';\n\n\t\t$middleSchemaID = 'http://x.y.z/dir1/middleschema';\n\t\t$loader->$middleSchemaID = '{\n\t\t \"id\": \"http://x.y.z/dir1/middleschema#\",\n\t\t \"type\":\"integer\"\n\t\t}';\n\n\t\t$this->sut = new JSONSchemaBuilder($loader);\n\t\t$schema = $this->sut->build('rootschema');\n\n\t\t$instance = json_decode('{\"int\":{\"value\":\"foo\"}}');\n\t\t$this->assertFalse($schema->validate($instance));\n\t}", "function parse_data(){\n\n\t $key_file = file_get_contents(\"resp_key.json\");\n\t $built_in_file = file_get_contents(\"built_in_resp.json\");\n\t $this->key_dictonary = json_decode($key_file);\n\t $this->built_in_dictionary = json_decode($built_in_file);\n\n\t if($this->built_in_dictionary == null)\n\t\tvar_dump(\"Built in didn't work\");\n\t if($this->key_dictonary == null)\n\t\tvar_dump(\"key dictionary didn't work\");\n\n }", "public function get_payload();", "public function runStoredDbSchema()\r\n\t{\r\n\t\t$response = \"\";\r\n\t\t$this->ensureSchemaBinExist();\r\n\t\t$file = $this->schemaFiles . $this->schemaName;\r\n\t\tif (file_exists($file)) {\r\n\t\t\t$schemaFile = $this->schemaFiles . $this->schemaName;\r\n\t\t\t$response .= nl2br(\"Loading stored database schema: \" . $schemaFile . \"\\n\");\r\n\t\t\t$res = $this->schema->importStoredDatabaseSchema();\r\n\t\t\t$response .= ($res == 0) ? nl2br(\"Loaded stored database schema.\\n\") : nl2br(\"Failed: stored database schema not loaded\\n\");\r\n\t\t}\r\n\r\n\t\treturn $response;\r\n\t}", "protected function fromDatabase( $data )\n\t{\n\t\tforeach ( $data AS $field => $value ) \n\t\t{\t\n\t\t\tif ( isset( static::$schema[ $field ] ) )\n\t\t\t{\n\t\t\t\tif ( is_array( static::$schema[ $field ] ) )\n\t\t\t\t{\n\t\t\t\t\t$type = static::$schema[ $field ][ 'type' ];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$type = static::$schema[ $field ];\n\t\t\t\t}\n\t\n\t\t\t\t$this->data[ $field ] = $this->sanitize( $type, $value );\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->loaded = true;\n\t}", "public function loadDataFromId(){\r\n\t\t\t$this -> loadFromId();\r\n\t }", "public function testLoad()\n {\n $struct = $this->_newStruct();\n $expect = array(\n 'foo' => 'bar2',\n 'baz' => 'dib2',\n 'zim' => 'gir2',\n 'irk' => array(\n 'subfoo' => 'subbar2',\n 'subbaz' => 'subdib2',\n 'subzim' => 'subgir2',\n ),\n );\n $struct->load($expect);\n $actual = $struct->toArray();\n $this->assertSame($actual, $expect);\n }", "public function postLoad()\n {\n // Ensure class content are known\n $data = (array) $this->_data;\n foreach ($data as $dataEntry) {\n $type = key($dataEntry);\n\n $dataEntry = array_pop($dataEntry);\n if (true === is_array($dataEntry)) {\n $type = key($dataEntry);\n }\n\n if ($type !== 'scalar' && $type !== 'array') {\n self::getFullClassname($type);\n }\n }\n\n parent::postLoad();\n }", "private function loadSchema($strTblName) {\n if (!$this->getFromCache($strTblName)) {\n $this->result = $this->query($this->getSchemaQuery($strTblName));\n $schema = $this->fetchValues($this->result);\n foreach ($schema as $value) {\n $this->schema[$strTblName][$value['Field']]['type'] = $value['Type'];\n $this->schema[$strTblName][$value['Field']]['length'] = $value['Length'];\n }\n $this->processSchemaCache($strTblName);\n }\n }", "private function loadContentTypes()\n\t\t{\n\t\t\t$query = $this->contentTypeQuery;\n\t\t\t$list = $this->bridge->packData($query);\n\t\t\t$this->contentTypes = $list;\n\t\t\t\n\t\t\t/*\n\t\t\t*\tgenerate new contentTypes [Folder, File]\n\n\t\t\t*/\n\n\t\t\tif (count($this->contentTypes) == 0)\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t*\tINSERT INTO contentType VALUES (null, 'Folder', null)\n\t\t\t\t*\tINSERT INTO contentType VALUES (null, 'File', null)\n\t\t\t\t*/\n\n\t\t\t\t$qrs = array();\n\t\t\t\tarray_push($qrs, [\"'Folder'\", \"'_'\"]);\n\t\t\t\tarray_push($qrs, [\"'File'\", \"'_'\"]);\n\n\t\t\t\t$ts = $this->logContentType($qrs);\n\t\t\t\t#var_dump($ts);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$r= 1;\n\t\t\t\t#var_dump($this->contentTypes);\n\t\t\t\t#$arrayName = array(0 => [\"'Folderr'\", \"null\"], );\n\t\t\t\t#$this->logContentType($arrayName);\n\t\t\t}\t\t\t\n\t\t}", "public function addToSchema(&$schema)\n {\n $schema['raptor_protocol_lib_uploads'] = array(\n 'description' => 'Protocol library upload tracking',\n 'fields' => array(\n 'protocol_shortname' => array(\n 'type' => 'varchar',\n 'length' => 20,\n 'not null' => TRUE,\n 'default' => '',\n 'description' => 'Protocol short name which must be unique',\n ),\n 'version' => array(\n 'type' => 'int',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => 1,\n 'description' => 'The version number of this protocol to match the parent record',\n ),\n 'filename' => array(\n 'type' => 'varchar',\n 'length' => 128,\n 'not null' => TRUE,\n 'default' => '',\n 'description' => 'Filename in RAPTOR of the scanned protocol',\n ),\n 'original_filename' => array(\n 'type' => 'varchar',\n 'length' => 128,\n 'not null' => FALSE,\n 'description' => 'Original filename of uploaded protocol',\n ),\n 'filetype' => array(\n 'type' => 'varchar',\n 'length' => 8,\n 'not null' => TRUE,\n 'description' => 'The uppercase file extension of the file',\n ),\n 'file_blob' => array(\n 'type' => 'blob',\n 'mysql_type' => 'mediumblob',\n 'not null' => TRUE,\n 'description' => 'The uploaded image as a blob',\n ),\n 'filesize' => array(\n 'type' => 'int',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'description' => 'Size in bytes',\n ),\n 'uploaded_by_uid' => array(\n 'type' => 'int',\n 'unsigned' => TRUE,\n 'not null' => FALSE,\n 'description' => 'Who uploaded the file',\n ),\n 'comment_tx' => array(\n 'type' => 'varchar',\n 'length' => 1024,\n 'not null' => FALSE,\n 'default' => '',\n 'description' => 'Comment from uploader',\n ),\n 'uploaded_dt' => array(\n 'type' => 'datetime',\n 'mysql_type' => 'datetime', \n 'not null' => TRUE,\n 'description' => 'When this record was last updated',\n ),\n ),\n 'primary key' => array('protocol_shortname','version'),\n );\n }", "protected function loadData()\n\t{\n\t\t$delimiter = \"|||---|||---|||\";\n\t\t$command = 'show --pretty=format:\"%an'.$delimiter.'%ae'.$delimiter.'%cd'.$delimiter.'%s'.$delimiter.'%B'.$delimiter.'%N\" ' . $this->hash;\n\n\t\t$response = $this->repository->run($command);\n\n\t\t$parts = explode($delimiter,$response);\n\t\t$this->_authorName = array_shift($parts);\n\t\t$this->_authorEmail = array_shift($parts);\n\t\t$this->_time = array_shift($parts);\n\t\t$this->_subject = array_shift($parts);\n\t\t$this->_message = array_shift($parts);\n\t\t$this->_notes = array_shift($parts);\n\t}", "protected function childLoad() {}", "public function loadFromDB()\n {\n }", "public function provider_load() {\n return array(\n array(\n 'text',// Field.\n array(// Post.\n 'text' => 'test',\n ),\n 'test', // Expected.\n ),\n );\n }", "abstract protected function load(): array;", "private function load()\n {\n if ($this->sites) {\n return;\n }\n $data = Yaml::parse(file_get_contents($this->file));\n $this->sites = $data['sites'];\n }" ]
[ "0.59054846", "0.58964443", "0.585824", "0.579825", "0.5780709", "0.5693666", "0.5605477", "0.5605477", "0.5605477", "0.5605477", "0.5605247", "0.56037325", "0.56037325", "0.55887395", "0.5529489", "0.53794897", "0.5363", "0.52989876", "0.52818346", "0.52818346", "0.52818346", "0.52818346", "0.52818346", "0.52818346", "0.52818346", "0.52818346", "0.52818346", "0.52818346", "0.52818346", "0.52818346", "0.52818346", "0.5212852", "0.5177873", "0.5177421", "0.5177003", "0.51762325", "0.51762325", "0.51762325", "0.5148328", "0.5143946", "0.5143946", "0.513045", "0.51165473", "0.50969523", "0.50855386", "0.50853723", "0.5039839", "0.5000595", "0.4999428", "0.49956083", "0.49956083", "0.49818435", "0.4915944", "0.49092638", "0.48872414", "0.48860723", "0.4885857", "0.48446614", "0.48446614", "0.48354843", "0.48354843", "0.48351058", "0.48303768", "0.48208758", "0.4808088", "0.48047104", "0.4783203", "0.47398886", "0.4736436", "0.47277442", "0.47275352", "0.4723369", "0.47220057", "0.4719689", "0.47144496", "0.4709751", "0.46961617", "0.46857184", "0.46855384", "0.4680554", "0.46767044", "0.46726862", "0.46725902", "0.4670165", "0.46624094", "0.46613708", "0.46528918", "0.46483567", "0.46442118", "0.46417087", "0.46230832", "0.46096128", "0.46015936", "0.46013114", "0.4594795", "0.4588241", "0.45878348", "0.45871526", "0.45836937", "0.45789725" ]
0.61661655
0
Tests commands needed for deployment
public function test_commands() { // test git if ( ! $this->test_cmd( 'git' ) ) { error( '501 Not Implemented', '<code>git</code> is not installed' ); } // if we're running a slim deploy but the remote deosn't support `git archive`, // we need svn to run `svn export` if ( SLIM && ($this->config->schema[ 'git_archive' ] === false) && ! $this->test_cmd( "svn" ) ) { error( '501 Not Implemented', '<code>svn</code> is not installed' ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testDeploy()\n {\n }", "public function beforeStartingDeploy()\n {\n // $this->runLocal('./vendor/bin/simple-phpunit');\n }", "public function testNameAndArguments()\n {\n $this->assertEquals('contao:install-web-dir', $this->command->getName());\n $this->assertTrue($this->command->getDefinition()->hasArgument('path'));\n }", "public function testDrushCommands() {\n // Try to execute the ach-purge command without registration.\n $this->drush('ach-purge', [], $this->siteOptions, NULL, NULL, self::EXIT_ERROR, '-y');\n $output = $this->getErrorOutput();\n $this->assertContains('Error trying to connect to the Content Hub', $output);\n\n // Register the site by using ach-connect drush command.\n $this->drush(\n 'ach-connect', [\n 'admin',\n 'admin',\n 'http://127.0.0.1:5000',\n 'mastersite',\n ],\n $this->siteOptions\n );\n $output = $this->getErrorOutput();\n $this->assertContains('The configuration options have been saved.', $output, 'Acquia Content Hub Admin Configuration saved correctly.');\n $this->assertContains('Successful Client registration', $output, 'Successful Client registration.');\n\n // Execute ach-purge command.\n $this->drush('ach-purge', [], $this->siteOptions, NULL, NULL, self::EXIT_SUCCESS, '-y');\n $output = $this->getOutput();\n $this->assertContains('PROCEED WITH CAUTION. THIS ACTION WILL PURGE ALL EXISTING ENTITIES IN YOUR CONTENT HUB SUBSCRIPTION.', $output);\n $this->assertContains('Your Subscription is being purged. All clients who have registered to received webhooks will be notified with a reindex webhook when the purge process has been completed.', $output);\n\n // Execute ach-restore command.\n $this->drush('ach-restore', [], $this->siteOptions, NULL, NULL, self::EXIT_SUCCESS, '-y');\n $output = $this->getOutput();\n $this->assertContains('PROCEED WITH CAUTION. THIS ACTION WILL ELIMINATE ALL EXISTING ENTITIES IN YOUR CONTENT HUB SUBSCRIPTION.', $output);\n $this->assertContains('Your Subscription is being restored. All clients who have registered to received webhooks will be notified with a reindex webhook when the restore process has been completed.', $output);\n\n // Execute ach-logs command.\n $this->drush('ach-logs', [], $this->siteOptions, NULL, NULL, self::EXIT_SUCCESS);\n $output = $this->getOutput();\n $this->assertContains('Timestamp', $output);\n $this->assertContains('Type', $output);\n $this->assertContains('Client', $output);\n $this->assertContains('Entity UUID', $output);\n $this->assertContains('ID', $output);\n $this->assertContains('Request ID', $output);\n $this->assertContains('Status', $output);\n\n // Execute ach-mapping command.\n $this->drush('ach-mapping', [], $this->siteOptions, NULL, NULL, self::EXIT_SUCCESS);\n $output = $this->getOutput();\n $mapping = json_decode($output, TRUE);\n\n // Because this test is working with the Plexus Mock, this expected output\n // has to match this:\n // https://github.com/acquia/content-hub-scripts/blob/master/plexus_mock/examples/_mapping.json.\n $expected = [\n 'entity' => [\n 'dynamic' => 'strict',\n 'properties' => [\n 'data' => [\n 'dynamic' => 'strict',\n 'properties' => [\n 'assets' => [\n 'dynamic' => 'strict',\n 'properties' => [\n 'replace-token' => [\n 'type' => 'string',\n ],\n 'url' => [\n 'type' => 'string',\n ],\n ],\n ],\n 'attributes' => [\n 'dynamic' => 'true',\n 'properties' => [\n 'title' => [\n 'dynamic' => 'strict',\n 'properties' => [\n 'metadata' => [\n 'type' => 'string',\n ],\n 'type' => [\n 'type' => 'string',\n ],\n 'value' => [\n 'dynamic' => 'true',\n 'properties' => [\n 'und' => [\n 'type' => 'string',\n ],\n ],\n ],\n ],\n ],\n ],\n 'type' => 'object',\n ],\n 'created' => [\n 'type' => 'date',\n ],\n 'metadata' => [\n 'dynamic' => 'true',\n 'index' => 'no',\n 'type' => 'object',\n ],\n 'modified' => [\n 'type' => 'date',\n ],\n 'origin' => [\n 'type' => 'string',\n ],\n 'type' => [\n 'type' => 'string',\n ],\n 'uuid' => [\n 'type' => 'string',\n ],\n ],\n ],\n 'id' => [\n 'type' => 'string',\n ],\n 'origin' => [\n 'index' => 'not_analyzed',\n 'type' => 'string',\n ],\n 'revision' => [\n 'type' => 'long',\n ],\n 'subscription' => [\n 'type' => 'string',\n ],\n 'uuid' => [\n 'index' => 'not_analyzed',\n 'type' => 'string',\n ],\n ],\n ],\n ];\n $this->assertEquals($expected, $mapping);\n }", "public function testMigrationsSubcommands()\n {\n $this->exec('completion subcommands migrations.migrations');\n $expected = [\n 'orm-cache-build orm-cache-clear create dump mark_migrated migrate rollback seed status',\n ];\n $actual = $this->_out->messages();\n $this->assertEquals($expected, $actual);\n }", "public function setUp()\n {\n parent::setUp();\n\n $command = $this->getCommand();\n $this->application->add($command);\n $command->setContainer($this->container);\n }", "public function setUp()\n {\n $this->deploy_path = 'deploy_dir';\n $this->root = vfsStream::setup($this->deploy_path, null, array(\n 'releases' => array(\n 'previous_release' => array(\n 'bin' => array(\n 'phinx' => \"phinx binary\"\n ),\n 'phinx.yml' => \"phinx config\"\n ),\n 'current_release' => array(\n 'bin' => array(\n 'phinx' => \"phinx binary\"\n ),\n 'phinx.yml' => \"phinx config\"\n ),\n 'new_release' => array(\n 'bin' => array(\n 'phinx' => \"phinx binary\"\n ),\n 'phinx.yml' => \"phinx config\"\n )\n )\n ));\n\n $this->phinxDeploy = new Deploy('bin/phinx', array('phinx.yml'));\n $this->phinxDeploy->setDeployPath(vfsStream::url($this->deploy_path));\n\n $this->logger = $this->getMock('Monolog\\Logger', array(), array(\"deploy\"));\n $this->phinxDeploy->setLogger($this->logger);\n\n $this->utils = $this->getMock('Deploy\\Core\\Utils', array('exec'), array($this->logger));\n $this->phinxDeploy->setUtils($this->utils);\n\n $filesystem = new TestFileSystem();\n $this->utils->setFilesystem($filesystem);\n }", "public function buildsCommands()\n {\n $client = ScaleEngineClient::factory(['apiSecret' => 'test']);\n $command = $client->getCommand('requestTicket');\n\n $this->assertInstanceOf('\\Guzzle\\Service\\Command\\CommandInterface', $command);\n }", "public function beforeFinishingDeploy()\n {\n // $this->runRemote('{{ console_bin }} app:my-task-name');\n // $this->runLocal('say \"The deployment has finished.\"');\n }", "public function test_when_generate_tools_command_creates_the_containers_script()\n {\n $this->artisan('generate-tools')\n ->expectsOutput('containers script generated!')\n ->assertExitCode(0);\n\n $this->assertFileExists(__DIR__ . '/../fixtures/work_dir/containers');\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->setPaths();\n\n $this->files = new Filesystem();\n\n if (!is_dir(env_path())) {\n mkdir(env_path());\n }\n\n copy(__DIR__ . '/../.env.example',env_path('.env'));\n\n $this->artisan('vendor:publish',['--provider' => 'Gecche\\Multidomain\\Foundation\\Providers\\DomainConsoleServiceProvider']);\n\n\n }", "public function setUp()\n {\n $this->CT = new CommandTester();\n $this->CT->add(new UtilityTask);\n }", "public function testCommand()\n {\n \tif (!file_exists('/usr/bin/svn')) $this->markTestSkipped(\"Unable to test command: /usr/bin/svn does not exist.\");\n\n \t$url = \"svn://office.javeline.nl/jasny/qdb/trunk\";\n \t$list = shell_exec('/usr/bin/svn list ' . escapeshellarg($url));\n \t\n \t$client = new RPC_Client_Exec('/usr/bin/svn');\n \t$svn = $client->getInterface();\n \t$this->assertEquals($list, $svn->list($url));\n }", "public function testExecute():void\n {\n $this->assertEquals(0,$this->commandTester->execute([]));\n\n //Assert command display\n $this->assertEquals(\n 'Sample command without interactions' . PHP_EOL,\n $this->commandTester->getDisplay()\n );\n }", "public function testMaintenanceSet()\n {\n// $this->commandTester->execute(\n// [\n// 'command' => $this->maintenanceCommand->getName(),\n// ToggleMaintenanceCommand::MAINTENANCE_PARAMETER => 1,\n// ]\n// );\n//\n// $this->assertTrue(\n// $this\n// ->filesystem\n// ->exists($this->exposedDir . DIRECTORY_SEPARATOR . ToggleMaintenanceCommand::FILE_NAME)\n// );\n//\n// $this->client->request('GET', '/');\n// $this->assertEquals(Response::HTTP_SERVICE_UNAVAILABLE, $this->client->getResponse()->getStatusCode());\n }", "public function testAction()\n {\n echo shell_exec(\"mysql -u root -e 'CREATE DATABASE IF NOT EXISTS \" . $this->config->database->dbname . \";'\");\n // Run migrations if necessary\n echo shell_exec('php vendor/bin/phinx migrate -e test -c config/phinx.php') . \"\\n\";\n }", "public static function beforeDeploy()\n {\n self::$logger = new \\Monolog\\Logger('phpunit');\n\n $dbConn = self::requireEnv('SYMFONY_CLOUDSQL_CONNECTION_NAME');\n $dbName = self::requireEnv('SYMFONY_DB_DATABASE');\n $dbPass = self::requireEnv('SYMFONY_DB_PASSWORD');\n\n // Create the Symfony project in a temporary directory\n $symfonyDir = self::createSymfonyProject();\n self::updateKernelCacheAndLogDir($symfonyDir);\n\n // copy and set the proper env vars in app.yaml\n $appYaml = file_get_contents(__DIR__ . '/../app.yaml');\n $appYaml = str_replace('# DATABASE_URL', 'DATABASE_URL', $appYaml);\n $appYaml = str_replace('DB_PASSWORD', $dbPass, $appYaml);\n $appYaml = str_replace('INSTANCE_CONNECTION_NAME', $dbConn, $appYaml);\n $appYaml = str_replace('symfonydb', $dbName, $appYaml);\n\n file_put_contents($symfonyDir . '/app.yaml', $appYaml);\n }", "public function testMyServiceGitCommands() {\n $this->assertNotNull(\\Drupal::service('calculate_date_diff'));\n }", "public function setUp()\n {\n $this->appPath = __DIR__ . '/../TestApp/application';\n\n $createCommand = 'Rougin\\Combustor\\Commands\\CreateViewCommand';\n\n $this->createCommand = CommandBuilder::create($createCommand);\n }", "public function testInstaller() {\n $this->assertSession()->addressEquals('user/1');\n $this->assertSession()->statusCodeEquals(200);\n $this->assertDirectoryExists($this->syncDirectory);\n }", "function testTarget() {\n $stdin = json_encode(array('filter'=>'sql'));\n $exec = sprintf('echo %s | %s version --backend 2>/dev/null', self::escapeshellarg($stdin), UNISH_DRUSH);\n $this->execute($exec);\n $parsed = parse_backend_output($this->getOutput());\n $this->assertTrue((bool) $parsed, 'Successfully parsed backend output');\n $this->assertArrayHasKey('log', $parsed);\n $this->assertArrayHasKey('output', $parsed);\n $this->assertArrayHasKey('object', $parsed);\n $this->assertEquals(self::EXIT_SUCCESS, $parsed['error_status']);\n // This assertion shows that `version` was called and that stdin options were respected.\n $this->assertStringStartsWith(' Drush Version ', $parsed['output']);\n $this->assertEquals('Bootstrap to phase 0.', $parsed['log'][0]['message']);\n\n // Check error propogation by requesting an invalid command (missing Drupal site).\n $this->drush('core-cron', array(), array('backend' => NULL), NULL, NULL, self::EXIT_ERROR);\n $parsed = parse_backend_output($this->getOutput());\n $this->assertEquals(1, $parsed['error_status']);\n $this->assertArrayHasKey('DRUSH_NO_DRUPAL_ROOT', $parsed['error_log']);\n }", "public function testOoCanOutputAll()\n {\n $mainCommand = 'composer';\n $command = $this->createInstance($mainCommand);\n\n $subCommands = [new Command\\Subcommand('update')];\n foreach ($subCommands as $_subCommand) {\n $command->addSubCommand($_subCommand);\n }\n\n $flags = [new Command\\Flag('n')];\n foreach ($flags as $_flag) {\n $command->addFlag($_flag);\n }\n\n $arguments = [new Command\\Argument('no-dev')];\n foreach ($arguments as $_argument) {\n $command->addArgument($_argument);\n }\n\n $parameters = [new Command\\Parameter('monolog/monolog')];\n foreach ($parameters as $_parameter) {\n $command->addParameter($_parameter);\n }\n\n $this->assertEquals(\n sprintf('%1$s update -n --no-dev %2$s', $mainCommand, escapeshellarg('monolog/monolog')),\n (string) $command,\n 'Must be able to output the command string correctly, including the sub command, flags, arguments, and parameters'\n );\n }", "public function testServices()\n {\n $this->assertNull($this->command->get('console'));\n\n $container = new ContainerBuilder();\n $console = $container->register(\n 'console', '\\\\Symfony\\\\Component\\\\Console\\\\Application'\n );\n $console->addArgument('slic');\n\n $this->command->setContainer($container);\n $this->assertInstanceOf(\n '\\\\Symfony\\\\Component\\\\Console\\\\Application',\n $this->command->get('console')\n );\n }", "protected function setUp()\n {\n parent::setUp();\n\n $url = 'https://url.to/backup.tgz';\n $this->expected_data = [\n 'file' => 'file name',\n 'size' => 'file size',\n 'date' => 459880805,\n 'expiry' => 3615640805,\n 'initiator' => 'backup initiator',\n 'url' => $url,\n ];\n\n $this->backup->method('getArchiveURL')->willReturn($url);\n $this->backup->method('serialize')->willReturn($this->expected_data);\n\n $this->command = new InfoCommand($this->sites);\n $this->command->setLogger($this->logger);\n $this->command->setSites($this->sites);\n }", "public function testCanOutputAll()\n {\n $mainCommand = 'git';\n $command = $this->createInstance($mainCommand);\n\n $subCommands = ['clone'];\n foreach ($subCommands as $_subCommand) {\n $command->addSubCommand($_subCommand);\n }\n\n $flags = ['-f'];\n foreach ($flags as $_flag) {\n $command->addFlag($_flag);\n }\n\n $arguments = ['--mirror'];\n foreach ($arguments as $_argument) {\n $command->addArgument($_argument);\n }\n\n $parameters = ['https://github.com/Dhii/shell-interop.git', '.'];\n foreach ($parameters as $_parameter) {\n $command->addParameter($_parameter);\n }\n\n $this->assertEquals(\n sprintf('%1$s %2$s %3$s %4$s %5$s', $mainCommand, implode(' ', $subCommands), implode(' ', $flags), implode(' ', $arguments), implode(' ', $parameters)),\n (string) $command,\n 'Must be able to output the command string correctly, including the sub command, flags, arguments, and parameters'\n );\n }", "public function testCompanyManagementBackupsPost()\n {\n\n }", "public function test_deploy_schema()\n {\n foreach ($this->getTables() as $table) {\n DB::getInstance()->exec(\"DROP TABLE {$table}\");\n }\n $this->assertEmpty($this->getTables());\n\n # Deploy all sql's in schemas folder\n $schemas = scandir(__DIR__ . '/schemas/');\n $schemas = array_diff( $schemas, ['.','..'] );\n foreach($schemas as $schema){\n if ($schema != 'database.sql') {\n $sql = file_get_contents(__DIR__ . '/schemas/' . $schema);\n DB::getInstance()->exec($sql);\n $table = explode('.',$schema)[0];\n $this->assertContains($table, $this->getTables());\n }\n }\n }", "public function test_pull() {\n\n }", "public function testTask()\n\t{\n \n //Need also define the ssh keys and password in config.php\n \n //Insert first a task\n \n /*$arr_task=['name_task' => 'live', 'descripton_task' => 'Script for check if server is alive', 'arguments' => [], 'status' => 0, 'url_return' => '', 'server' => SERVER_REMOTE];\n \n $new_task=$m->task->insert($arr_task);\n \n $id=$m->task->insert_id();\n \n $this->assertNotFalse($new_task);\n \n $arr_task['IdTask']=$id;*/\n \n //Select task from db\n \n //Execute task\n \n $task=new Task(SERVER_REMOTE);\n \n $task->files=[['vendor/phangoapp/leviathan/tests/script/alive.sh', 0755]];\n \n $task->commands_to_execute=[['/bin/bash', 'vendor/phangoapp/leviathan/tests/script/alive.sh', ''], ['sudo', 'vendor/phangoapp/leviathan/tests/script/alive.sh', '']];\n \n $task->delete_files=['vendor/phangoapp/leviathan/tests/script/alive.sh'];\n \n $task->delete_directories=['vendor/phangoapp/leviathan/tests'];\n \n $task->name_task='Live';\n \n $task->description_task='Check if server is alive';\n \n $task->codename_task='live';\n \n $result=$task->exec();\n \n echo $task->txt_error;\n \n $this->assertTrue($result);\n \n \n \n }", "public function testJobListPreparationAndReleaseTaskStatus()\n {\n\n }", "private function setupCommands(): void\n {\n if ($this->app->runningInConsole()) {\n // $this->commands([\n // ]);\n }\n }", "public function testExec()\n {\n $input = 'Hello World';\n\n $result = Command::create()\n ->app('echo')\n ->input($input)\n ->exec();\n\n $this->assertEquals($input, $result->getRaw());\n }", "public function test_schedule_command()\n {\n $this->artisan('schedule:run')->assertExitCode(0);\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "public function testMigrateInstance()\n {\n $_result = \\Artisan::call('dfe:migrate-instance', ['--all']);\n }", "public function testExecuteCommand()\n {\n $this->environment->expects($this->once())\n ->method('sendCommandViaSsh')\n ->with($this->equalTo('dummy arg1 arg2'))\n ->willReturn(['output' => 'dummy output', 'exit_code' => 0]);\n\n $output = $this->command->dummyCommand('site.env', ['arg1', 'arg2']);\n\n $this->assertEquals('dummy output', $output);\n }", "public function testCanOutputMainCommand()\n {\n $mainCommand = 'git';\n $command = $this->createInstance($mainCommand);\n $this->assertEquals($mainCommand, (string) $command, 'Main command must be output correctly alone');\n }", "public function testSimplestCommand()\n {\n $expected = 'tesseract image.png stdout';\n\n $actual = (new WrapTesseractOCR('image.png'))\n ->buildCommand();\n\n $this->assertEquals($expected, $actual);\n }", "public function setUp()\n {\n $this->command = new InitCommand();\n }", "function testOrigin() {\n $exec = sprintf('%s %s version arg1 arg2 --simulate --ssh-options=%s 2>/dev/null | grep ssh', UNISH_DRUSH, self::escapeshellarg('user@server/path/to/drupal#sitename'), self::escapeshellarg('-i mysite_dsa'));\n $this->execute($exec);\n $bash = $this->escapeshellarg('drush --uri=sitename --root=/path/to/drupal version arg1 arg2 2>&1');\n $expected = \"Simulating backend invoke: ssh -i mysite_dsa user@server $bash 2>&1\";\n $output = $this->getOutput();\n $this->assertEquals($expected, $output, 'Expected ssh command was built');\n }", "public function testExecuteTaskAction()\n {\n }", "protected function setUp()\n {\n parent::setUp();\n $this->command = new GetCommand($this->sites);\n $this->command->setLogger($this->logger);\n $this->command->setSites($this->sites);\n }", "public function testGetService()\n {\n $app = new \\Cilex\\Application('Test');\n $app->command($this->fixture);\n\n $this->assertInstanceOf(\n '\\Symfony\\Component\\Console\\Application',\n $this->fixture->getService('console')\n );\n }", "public function testCanOutputSubCommands()\n {\n $mainCommand = 'composer';\n $subCommands = ['init', 'another'];\n $command = $this->createInstance($mainCommand);\n foreach ($subCommands as $_subCommand) {\n $command->addSubCommand($_subCommand);\n }\n $this->assertEquals(sprintf('%1$s %2$s', $mainCommand, implode(' ', $subCommands)), (string) $command, 'Must be able to output the command and subcommand string correctly');\n }", "public function testShouldRegisterCommands()\n {\n $test = $this;\n $app = m::mock('Illuminate\\Contracts\\Foundation\\Application');\n $sp = m::mock('Zizaco\\Confide\\ServiceProvider', [$app]);\n\n /*\n |------------------------------------------------------------\n | Expectation\n |------------------------------------------------------------\n */\n $app->shouldReceive('bind')\n ->times(3)->andReturnUsing(\n // Make sure that the commands are being registered\n // with a closure that returns the correct\n // object.\n function ($name, $closure) use ($test, $app) {\n\n $shouldBe = [\n 'command.confide.controller' => 'Zizaco\\Confide\\ControllerCommand',\n 'command.confide.routes' => 'Zizaco\\Confide\\RoutesCommand',\n 'command.confide.migration' => 'Zizaco\\Confide\\MigrationCommand',\n ];\n\n $test->assertInstanceOf(\n $shouldBe[$name],\n $closure($app)\n );\n }\n );\n\n $sp->shouldReceive('commands')\n ->with(\n 'command.confide.controller',\n 'command.confide.routes',\n 'command.confide.migration'\n );\n\n /*\n |------------------------------------------------------------\n | Assertion\n |------------------------------------------------------------\n */\n $sp->registerCommands();\n }", "function pestle_cli($argv)\n{ \n //$composer_package .= '=2.1.0-rc1';\n extract($argv);\n \n $db_name = preg_replace('%[^a-zA-Z0-9]%','_', $id_key);\n $url = preg_replace('%[^a-zA-Z0-9]%','-', $id_key) . '.dev';\n $cmds = [];\n $cmds[] = \"composer create-project --repository-url=$repo $composer_package $folder\";\n $cmds[] = \"cd $folder\";\n $cmds[] = \"echo '$umask' >> magento_umask\";\n $cmds[] = \"echo \\\"We're about to ask for your MySQL password so we can create the database\\\"\";\n $cmds[] = \"echo 'CREATE DATABASE $db_name' | mysql -uroot -p\";\n\n $cmds[] = \"php bin/magento setup:install --admin-email $admin_email --admin-firstname $admin_first_name --admin-lastname $admin_last_name --admin-password $admin_password --admin-user $admin_user --backend-frontname admin --base-url http://$url --db-host 127.0.0.1 --db-name $db_name --db-password $db_pass --db-user $db_user --session-save files --use-rewrites 1 --use-secure 0 -vvv\"; \n $cmds[] = 'php bin/magento sampledata:deploy'; \n $cmds[] = 'php bin/magento cache:enable';\n \n array_map(function($cmd){\n output($cmd);\n }, $cmds);\n}", "public function test()\n {\n $this->executeScenario();\n }", "public function testExample()\n {\n $this->artisan('game:start')\n ->expectsOutput('you won')\n ->assertExitCode(0);\n }", "public function testBasicTest()\n {\n $response = $this->get('tasks');\n $response->assertStatus(200);\n\n\n }", "public function testMaintenanceUnset()\n {\n// $this->commandTester->execute(\n// [\n// 'command' => $this->maintenanceCommand->getName(),\n// ToggleMaintenanceCommand::MAINTENANCE_PARAMETER => 0,\n// ]\n// );\n//\n// $this->assertFalse(\n// $this\n// ->filesystem\n// ->exists($this->exposedDir . DIRECTORY_SEPARATOR . ToggleMaintenanceCommand::FILE_NAME)\n// );\n//\n// $this->client->request('GET', '/');\n// $this->assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode());\n }", "public function testCanRetrieveMainCommand()\n {\n $mainCommand = 'git';\n $command = $this->createInstance($mainCommand);\n $this->assertSame($mainCommand, $command->getMainCommand(), 'Main command must be retrievable');\n }", "public function testItShouldPublishVendorStubs()\n {\n $sourceFile = dirname(dirname(__DIR__)) . '/resources/stubs/handler.stub';\n $targetFile = resource_path('stubs/handler.stub');\n\n $this->assertFileNotExists($targetFile);\n\n $this->artisan('vendor:publish', [\n '--provider' => 'Laravel\\\\Handlers\\\\ServiceProvider',\n '--tag' => 'laravel-handlers-stubs',\n ]);\n\n $this->assertFileExists($targetFile);\n $this->assertEquals($this->files->get($sourceFile), $this->files->get($targetFile));\n }", "public function testCompanyManagementBackupsGet()\n {\n\n }", "public function testExecute()\n {\n $kernel = self::createClient()->getKernel();\n $this->importData('SyncCommandsTest/ProductsInitialDummyData.sql');\n $this->importData('SyncCommandsTest/SyncStorageWithDummyData.sql');\n $this->importData('SyncCommandsTest/UpdateProductsData.sql');\n\n $manager = $this->getManager();\n $repository = $manager->getRepository('AcmeTestBundle:Product');\n\n $application = new Application($kernel);\n $application->add(new SyncExecuteCommand());\n $command = $application->find('ongr:sync:execute');\n\n $commandTester = new CommandTester($command);\n $commandTester->execute(['command' => $command->getName()]);\n\n $search = $repository->createSearch();\n\n // Temporary workaround for ESB issue #34 (https://github.com/ongr-io/ElasticsearchBundle/issues/34).\n usleep(50000);\n\n $actualDocuments = iterator_to_array($repository->execute($search));\n\n $expectedDocuments = $this->getTestingData();\n\n sort($expectedDocuments);\n sort($actualDocuments);\n\n $this->assertEquals($expectedDocuments, $actualDocuments);\n }", "public function test_it_scaffolds_crud_artifacts()\n {\n $this->assertFileDoesNotExist(app_path('Post.php'));\n $this->assertFileDoesNotExist(app_path('Http/Controllers/PostController.php'));\n $this->assertFileDoesNotExist(app_path('Http/Requests/PostUpdateRequest.php'));\n $this->assertFileDoesNotExist(app_path('Http/Requests/PostStoreRequest.php'));\n $this->assertFileDoesNotExist(base_path('database/factories/PostFactory.php'));\n $this->assertFileDoesNotExist(resource_path('views/posts'));\n\n $this->artisan('arche Post');\n\n $this->assertFileExists(app_path('Post.php'));\n $this->assertFileExists(app_path('Http/Controllers/PostController.php'));\n $this->assertFileExists(app_path('Http/Requests/PostUpdateRequest.php'));\n $this->assertFileExists(app_path('Http/Requests/PostStoreRequest.php'));\n $this->assertFileExists(base_path('database/factories/PostFactory.php'));\n $this->assertDirectoryDoesNotExist(resource_path('views/posts'));\n $this->assertFileExists(resource_path(\"views/posts/index.blade.php\"));\n $this->assertFileExists(resource_path(\"views/posts/create.blade.php\"));\n $this->assertFileExists(resource_path(\"views/posts/_form.blade.php\"));\n $this->assertFileExists(resource_path(\"views/posts/edit.blade.php\"));\n $this->assertFileExists(resource_path(\"views/posts/show.blade.php\"));\n $this->assertFileExists(resource_path(\"views/posts/modals/delete.blade.php\"));\n\n $actualOutput = Artisan::output();\n\n $expectedOutput = \"Factory created successfully in /database/factories/PostFactory.php\nCreated Migration: 2020_03_14_153546_create_posts_table\nModel created successfully in /app/Post.php\nController created successfully in /app/Http/Controllers/PostController.php\nView created successfully in /resources/views/posts/index.blade.php\nView created successfully in /resources/views/posts/create.blade.php\nView created successfully in /resources/views/posts/_form.blade.php\nView created successfully in /resources/views/posts/edit.blade.php\nView created successfully in /resources/views/posts/show.blade.php\nView created successfully in /resources/views/posts/modals/delete.blade.php\nRequest created successfully in /app/Http/Requests/PostStoreRequest.php\nRequest created successfully in /app/Http/Requests/PostUpdateRequest.php\" . PHP_EOL;\n $this->assertSame($expectedOutput, $actualOutput);\n }", "public function testScheduleCommand()\n {\n $this->artisan('schedule:run')\n ->expectsOutput('No scheduled commands are ready to run.');\n }", "public function setupCommand(): void\n {\n $behatBuildPath = FLOW_PATH_ROOT . 'Build/Behat/';\n if (is_dir($behatBuildPath)) {\n Files::emptyDirectoryRecursively($behatBuildPath);\n }\n $this->outputLine('Copying Behat setup to %s', [$behatBuildPath]);\n Files::copyDirectoryRecursively('resource://Neos.Behat/Private/Build/Behat', $behatBuildPath);\n\n $behatBinaryPath = FLOW_PATH_ROOT . 'bin/behat';\n if (is_file($behatBinaryPath)) {\n $this->outputLine('Removing existing Behat binary %s', [$behatBinaryPath]);\n unlink($behatBinaryPath);\n }\n $this->outputLine('Installing Behat in %s', [$behatBuildPath]);\n exec('cd \"' . $behatBuildPath . '\" && composer install');\n $this->outputLine();\n $this->outputLine('Installed Behat to %s, binary to %s', [$behatBuildPath, $behatBinaryPath]);\n\n $seleniumBinaryPath = FLOW_PATH_ROOT . 'bin/selenium-server.jar';\n if (!is_file($seleniumBinaryPath)) {\n $seleniumVersion = 'selenium-server-standalone-2.53.1.jar';\n $seleniumUrl = 'https://selenium-release.storage.googleapis.com/2.53/' . $seleniumVersion;\n $this->outputLine('Downloading Selenium %s to bin/selenium-server.jar...', [$seleniumVersion]);\n if (copy($seleniumUrl, FLOW_PATH_ROOT . 'bin/selenium-server.jar') !== true) {\n throw new \\RuntimeException('Could not download selenium from ' . $seleniumUrl . '.');\n }\n $this->outputLine('Downloaded Selenium to bin/selenium-server.jar');\n $this->outputLine('You can execute it through: \"java -jar selenium-server.jar\"');\n } else {\n $this->outputLine('Skipped downloaded of Selenium, to update or reinstall delete bin/selenium-server.jar and run setup again');\n }\n }", "public function setUp()\n {\n if (exec(\"docker ps | grep wpdemo_db\") == '') {\n $this->markTestSkipped('wpdemo_db container is not running, skipping test');\n }\n }", "public function testCanSetGetSubCommands()\n {\n $mainCommand = 'composer';\n $subCommands = ['init', 'another'];\n $command = $this->createInstance($mainCommand);\n foreach ($subCommands as $_subCommand) {\n $command->addSubCommand($_subCommand);\n }\n $this->assertSame($subCommands, $command->getSubCommands(), 'Must be able to have a list of all subcommands retrieved');\n }", "public function testMigrationsOptionsCreate()\n {\n $this->exec('completion options migrations.migrations create');\n $this->assertCount(1, $this->_out->messages());\n $output = $this->_out->messages()[0];\n $expected = '--class -l --connection -c --help -h --path --plugin -p --quiet';\n $expected .= ' -q --source -s --template -t --verbose -v';\n $outputExplode = explode(' ', trim($output));\n sort($outputExplode);\n $expectedExplode = explode(' ', $expected);\n sort($expectedExplode);\n\n $this->assertEquals($outputExplode, $expectedExplode);\n }", "public function testPsWithTwoComposeFilesSpecified()\n {\n $this->mockedManager->method('execute')->willReturn(array('output' => 'ok', 'code' => 0));\n $this->assertEquals($this->mockedManager->ps(['docker-compose.yml', 'docker-compose.test.yml']), 'ok');\n }", "public function testExecute()\n {\n $commandTester = $this->createCommandTester(new DeleteCommand());\n $commandTester->execute([\n 'url' => 'my-queue-url',\n '--force' => true\n ]);\n\n $output = $commandTester->getDisplay();\n $this->assertContains('Done', $output);\n }", "protected function setUp()\n {\n parent::setUp();\n \n // TODO Auto-generated CommandTest::setUp()\n \n $this->command = new Command();\n }", "public function test_addReplenishmentProcessAudit() {\n\n }", "public function testCommand()\n {\n $response = (new Command())->testCommand(Command::class);\n\n $this->assertInstanceOf(Builder::class, $response, 'A call to command() should dispatch an instance of the command and return a builder.');\n $this->assertInstanceOf(Command::class, $response->toBase(), 'The builder should wrap the command passed to command().');\n }", "function test_apertium_command() {\n\tglobal $config;\n\t\n\t$command_to_test = array($config['apertium_command'], $config['apertium_unformat_command']);\n\t$return = TRUE;\n\tforeach ($command_to_test as $command) {\n\t\tif (!test_command($command)) {\n\t\t\techo $command;\n\t\t\t$return = FALSE;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\t\t\t\n\treturn $return;\n}", "public function testContainer()\n {\n $app = new \\Cilex\\Application('Test');\n $app->command($this->fixture);\n\n $this->assertSame($app, $this->fixture->getContainer());\n }", "function deploy_it(string $project_path, array $config = [], string $production_commit = null) {\n\n $app = new Symfony\\Component\\Console\\Application('Deployer', \\Kodilab\\Deployer\\Deployer::VERSION);\n\n $app->add(new \\Kodilab\\Deployer\\Command\\DeployCommand($project_path, $config, $production_commit));\n\n $app->run(new \\Symfony\\Component\\Console\\Input\\StringInput('deploy'));\n}", "public function testHelpCommand(): void\n {\n $this->assertNotFalse(\n $this->artisan($signature = $this->getCommandSignature(), ['--help']),\n sprintf('Command \"%s\" does not return help message', $signature)\n );\n }", "public function testCompanyManagementBackupsIdDelete()\n {\n\n }", "public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }", "public function testRunsOk()\n {\n $application = new Application();\n $application->add($this->command);\n\n $command = $application->find('dequeue');\n $command_tester = new CommandTester($command);\n\n $this->assertEquals(0, $this->dispatcher->getQueue()->count());\n $this->dispatcher->dispatch(\n new Inc(['number' => 12,\n ]));\n $this->assertEquals(1, $this->dispatcher->getQueue()->count());\n\n $command_tester->execute([\n 'command' => $command->getName(),\n 'type' => Inc::class,\n ]);\n $this->assertEquals(0, $command_tester->getStatusCode());\n $this->assertEquals(0, $this->dispatcher->getQueue()->count());\n }", "protected function setup(): void\n {\n $kernel = self::bootKernel();\n $application = new Application($kernel);\n\n // get entity manager\n $this->em = $kernel->getContainer()->get('doctrine')->getManager();\n\n // get serializer\n $this->serializer = $kernel->getContainer()->get('serializer');\n\n // init command\n $application->add(\n new ImportCommand(\n $this->em,\n $this->serializer\n )\n );\n\n $command = $application->find('app:import');\n $this->commandTester = new CommandTester($command);\n }", "public function testCompanyManagementBackupsIdPut()\n {\n\n }", "public function testItShouldPublishVendorConfig()\n {\n $sourceFile = dirname(dirname(__DIR__)) . '/config/handlers.php';\n $targetFile = base_path('config/handlers.php');\n\n $this->assertFileNotExists($targetFile);\n\n $this->artisan('vendor:publish', [\n '--provider' => 'Laravel\\\\Handlers\\\\ServiceProvider',\n '--tag' => 'laravel-handlers-config',\n ]);\n\n $this->assertFileExists($targetFile);\n $this->assertEquals($this->files->get($sourceFile), $this->files->get($targetFile));\n }", "public function setUp()\n\t{\n\t\t\\Orchestra\\Support\\Acl::register('mock-one', function ($acl)\n\t\t{\n\t\t\t$acl->add_actions(array('view blog', 'view forum', 'view news'));\n\t\t\t$acl->allow('guest', array('view blog'));\n\t\t\t$acl->deny('guest', 'view forum');\n\t\t});\n\t}", "public function testInstaller() {\n $this->assertSession()->addressEquals('user/1');\n $this->assertSession()->statusCodeEquals(200);\n }", "function testPingCommand()\n {\n $console = new Console();\n\n ob_start();\n\n $result = $console->findCommand(\"ping\")->execute();\n\n $out = ob_get_clean();\n\n $this->assertTrue($result);\n $this->assertSame(\"Pong!\\n\", $out);\n }", "public function testGetManifest()\n {\n }", "public function testCanRunValidCommand()\n {\n $dir = __DIR__;\n $command = new Command(\"/bin/ls $dir/Command*\");\n\n $this->assertFalse($command->getExecuted());\n $this->assertTrue($command->execute());\n $this->assertTrue($command->getExecuted());\n $this->assertEquals(\"$dir/CommandTest.php\", $command->getOutput());\n $this->assertEquals(\"$dir/CommandTest.php\\n\", $command->getOutput(false));\n $this->assertEmpty($command->getError());\n $this->assertEmpty($command->getStdErr());\n $this->assertEquals(0, $command->getExitCode());\n }", "public function testViewsAreCreated()\n {\n CodeIgniterHelper::setDefaults($this->appPath);\n\n $createCommand = new CommandTester($this->createCommand);\n $createCommand->execute([\n 'name' => $this->table,\n '--camel' => true,\n '--bootstrap' => true,\n '--keep' => true\n ]);\n\n $create = $this->appPath . '/views/' . $this->table . '/create.php';\n $edit = $this->appPath . '/views/' . $this->table . '/edit.php';\n $index = $this->appPath . '/views/' . $this->table . '/index.php';\n $show = $this->appPath . '/views/' . $this->table . '/show.php';\n\n $this->assertFileExists($create);\n $this->assertFileExists($edit);\n $this->assertFileExists($index);\n $this->assertFileExists($show);\n\n CodeIgniterHelper::setDefaults($this->appPath);\n }", "public function testMyTestCase()\n { $this->artisan('migrate');\n \t$this->visit(\"/project/1/add\");\n $this->type('[email protected]', 'email');\n $this->press('Ajouter');\n $this->seePageIs('/project/1/add/confirm');\n }", "public function testConsole()\n {\n static::bootKernel();\n\n $output = new BufferedOutput();\n $application = new Application(static::$kernel);\n $application->setAutoExit(false);\n $exitCode = $application->run(new StringInput(''), $output);\n\n $outputText = $output->fetch();\n\n $this->assertEquals(0, $exitCode, $outputText);\n\n // do not fix the number of commands to be flexible when new commands get added\n // the point of this test is to see that commands are loaded and show up in the console\n $this->assertTrue(substr_count($outputText, ' rokka:') > 20, substr($outputText, 0, 2000).\"...\\n\\n\");\n }", "public function testOoCanOutputSubCommands()\n {\n $mainCommand = 'composer';\n $subCommands = [new Command\\Subcommand('update'), new Command\\Subcommand('nao')];\n $command = $this->createInstance($mainCommand);\n foreach ($subCommands as $_subCommand) {\n $command->addSubCommand($_subCommand);\n }\n $this->assertEquals(sprintf('%1$s %2$s', $mainCommand, implode(' ', $subCommands)), (string) $command, 'Must be able to output the command and subcommand string correctly');\n }", "public function test()\n {\n $this->taskCodecept(self::CODECEPT_BIN)->run();\n }", "public function test()\n {\n $this->taskCodecept(self::CODECEPT_BIN)->run();\n }", "public function setUp(): void\n {\n parent::setUp();\n $this->artisan('migrate', ['--database' => 'testbench']);\n }", "public function setUp()\n {\n $this->fixture = new CommandMock('demo:test');\n }", "public function testTravisLogger()\n {\n putenv('CONTINUOUS_INTEGRATION=1');\n\n $container = new Container(['PhpBench\\Extension\\CoreExtension'], [\n 'path' => 'hello',\n 'config_path' => '/path/to/phpbench.json',\n ]);\n $container->init();\n $this->assertEquals('travis', $container->getParameter('progress'));\n }", "function main(tiny_api_Cli $cli)\n{\n $cli->header('Unit Tests');\n\n $unit_test_file = $cli->get_arg('unit-test-file');\n if (!empty($unit_test_file))\n {\n if (!is_file($unit_test_file))\n {\n $cli->error(\"Could not find file \\\"$unit_test_file\\\"!\");\n exit(1);\n }\n\n $utm = tiny_api_Unit_Test_Manager::make($cli)\n ->disable_tap()\n ->disable_stop_on_failure()\n ->execute(array($unit_test_file))\n ->print_summary();\n }\n else\n {\n exec(\"/usr/bin/find \"\n . getcwd()\n . \" -name \\\"*.php\\\" | /bin/grep \\\"/tests/\\\"\",\n $files, $retval);\n\n $utm = tiny_api_Unit_Test_Manager::make($cli)\n ->execute($files)\n ->print_summary();\n }\n}", "public function testCompanyManagementBackupsIdPatch()\n {\n\n }", "public function testOnConsoleCommand()\n {\n $commandFoo = $this->createMock(ContainerAwareCommand::class);\n $commandFoo->method('getName')->willReturn('foo:hello');\n $this->commandChain->addCommand($commandFoo, 'main', null);\n\n $commandBar = $this->createMock(ContainerAwareCommand::class);\n $commandBar->method('getName')->willReturn('bar:hi');\n $this->commandChain->addCommand($commandBar, 'foo:hello', 100);\n\n $output = new BufferedOutput();\n $event = $this->createMock(ConsoleCommandEvent::class);\n $event->method('getCommand')->willReturn($commandBar);\n $event->method('getOutput')->willReturn($output);\n $this->chainCommandListener->onConsoleCommand($event);\n\n $expected = sprintf(sprintf(\n \"Error: %s command is a member of %s command chain and cannot be executed on its own.\\n\",\n $commandBar->getName(),\n $commandFoo->getName()\n ));\n $real = $output->fetch();\n $this->assertEquals($expected, $real);\n }", "public function testLoadCliConfig()\r\n {\r\n $this->assertTrue($this->wei->getConfig('cli'));\r\n }", "public function testFiles() {\n\t\t$repoSrc = ROOT . DS . 'src';\n\n\t\t$this->shell->args = [$repoSrc];\n\n\t\t$files = $this->shell->Stage->files();\n\t\tforeach ($files as &$file) {\n\t\t\t$file = str_replace(DS, '/', substr($file, strlen($repoSrc) + 1));\n\t\t}\n\n\t\t$expected = [\n\t\t\t'Shell/UpgradeShell.php',\n\t\t\t'Shell/Task/BaseTask.php',\n\t\t\t'Shell/Task/RenameCollectionsTask.php',\n\t\t\t'Shell/Task/NamespacesTask.php',\n\t\t\t'Shell/Task/StageTask.php',\n\t\t\t'Shell/Task/TestsTask.php',\n\t\t\t'Shell/Task/AppUsesTask.php',\n\t\t\t'Shell/Task/FixturesTask.php',\n\t\t\t'Shell/Task/RenameClassesTask.php',\n\t\t\t'Shell/Task/MethodNamesTask.php',\n\t\t\t'Shell/Task/MethodSignaturesTask.php',\n\t\t\t'Shell/Task/HelperTrait.php',\n\t\t\t'Shell/Task/ChangeTrait.php',\n\t\t\t'Shell/Task/LocationsTask.php',\n\t\t\t'Shell/Task/I18nTask.php',\n\t\t\t'Shell/Task/SkeletonTask.php',\n\t\t\t'Shell/Task/TemplatesTask.php',\n\t\t\t'Shell/Task/ModelToTableTask.php',\n\t\t\t'Shell/Task/CleanupTask.php',\n\t\t\t'Shell/Task/PrefixedTemplatesTask.php',\n\t\t\t'Shell/Task/CustomTask.php',\n\t\t\t'Shell/Task/LocaleTask.php',\n\t\t\t'Shell/Task/UrlTask.php',\n\t\t\t'Shell/Task/TableToEntityTask.php',\n\t\t\t'Shell/Task/FixtureLoadingTask.php',\n\t\t\t'Shell/Task/FixtureCasingTask.php',\n\t\t];\n\n\t\tforeach ($expected as $file) {\n\t\t\t$this->assertTrue(in_array($file, $files, true), 'The files to process should be all files in the src folder - ' . $file);\n\t\t}\n\t}", "public function testDomainAddCommand()\n {\n $site = Arr::get($_SERVER, 'SERVER_NAME');\n\n if (!$site) {\n $this->assertTrue(true);\n return;\n }\n\n $argDomain = $site ? ['domain' => $site] : [];\n\n $this->artisan('domain:add', $argDomain);\n\n $this->assertFileExists(env_path('.env.'.$site));\n\n $this->artisan('config:clear');\n\n $domainListed = Config::get('domain.domains');\n\n $this->assertArrayHasKey($site,$domainListed);\n\n $this->assertDirectoryExists(app()->exactDomainStoragePath());\n }", "public function test_listBundlesForTagsRequest() {\n\n }", "public function setUp() {}", "public function setUp() {}", "public function testDeleteService()\n {\n\n }", "public function setUp() {}" ]
[ "0.7459329", "0.7122933", "0.63586414", "0.6288866", "0.62183785", "0.6218028", "0.61845714", "0.61533713", "0.6142157", "0.6081859", "0.60757345", "0.60705394", "0.6056716", "0.6052736", "0.60347545", "0.5993077", "0.5987081", "0.5967315", "0.5966268", "0.596555", "0.59356725", "0.59033877", "0.58901775", "0.5883414", "0.58764845", "0.5851825", "0.5850145", "0.58490515", "0.5841605", "0.58388776", "0.5826234", "0.58241135", "0.582113", "0.58197504", "0.5815369", "0.5805392", "0.57986456", "0.5776378", "0.5773102", "0.5770148", "0.576821", "0.576795", "0.5731404", "0.5721952", "0.5694328", "0.569205", "0.5684817", "0.56843436", "0.56779647", "0.56438553", "0.5642313", "0.56221104", "0.5618521", "0.5618425", "0.5611994", "0.560376", "0.5595112", "0.55949545", "0.55929756", "0.5590007", "0.55837345", "0.5579301", "0.55781895", "0.556213", "0.55574566", "0.55552", "0.5553827", "0.55343115", "0.55276555", "0.55240345", "0.55233115", "0.55148244", "0.5506767", "0.5506332", "0.54832506", "0.54829335", "0.54697293", "0.54655826", "0.5463231", "0.54627055", "0.54530966", "0.54503995", "0.5446004", "0.5445397", "0.5444253", "0.5444253", "0.54391366", "0.5436071", "0.54356045", "0.5430181", "0.54277897", "0.54231375", "0.5422407", "0.54133713", "0.5410152", "0.5407599", "0.5405555", "0.5404726", "0.54043466", "0.5403577" ]
0.7939011
0
Initialises local git repos
public function init_repo() { // we don't need to maintain local repos for slim deploys if ( SLIM ) { return; } // if the repo is already initialised, we don't need to if ( is_dir( "wpd-repos/{$this->config->repo[ 'name' ]}/.git" ) ) { return; } // store the directory we're in right now, so we can come back $original_dir = getcwd(); // switch the repo's directory chdir( "wpd-repos/{$this->config->repo[ 'name' ]}" ); // initialise git exec( 'git init' ); // add the remote repo as a remote called origin exec( "git remote add origin " . $this->config->repo[ 'git_url' ] ); // switch back to the original directory chdir( $original_dir ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function init() {\n $git_wrapper = new \\GitWrapper\\GitWrapper();\n if (file_exists($this->directory)) {\n $this->git = $git_wrapper->workingCopy($this->directory);\n $this->git->checkout($this->branch);\n }\n else {\n $this->git = $git_wrapper->cloneRepository($this->getRepositoryURL(), $this->directory, ['branch' => $this->branch]);\n }\n }", "public function set_needed_repos(): void {}", "public function set_needed_repos(): void {}", "public function createGit()\n {\n if($GLOBALS['TL_CONFIG']['bx_git_path'])\n {\n $gitPath = TL_ROOT.$GLOBALS['TL_CONFIG']['bx_git_path'];\n }else{\n $gitPath = TL_ROOT.\"/\";\n }\n\n $git = new GitPhp\\GitRepository($gitPath);\n $git->init()->execute();\n \n //Set Remote\n $url = explode(\"://\", $GLOBALS['TL_CONFIG']['bx_git_host_url']);\n $git->remote()->setUrl('origin', $url[0].\"://\".$GLOBALS['TL_CONFIG']['bx_git_host_user'].\":\".$GLOBALS['TL_CONFIG']['bx_git_host_pass'].\"@\".$url[1]);\n }", "private function initRepositories(): void {\n $this->usersRepository = new UsersRepository();\n }", "public function gitCloneRepositories() {\n\t\t$count = 0;\n\n\t\t$packages = $this->Package->find('list');\n\t\tforeach ($packages as $id => $name) {\n\t\t\t$this->out(sprintf(__(\"* Downloading package %s\"), $name));\n\t\t\tif ($this->Package->setupRepository($id)); {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t$this->out(sprintf(__('* Downloaded %s of %s repositories'), $count, count($packages)));\n\t}", "protected function initRepository()\n {\n $this->repository = new Repository([\n 'name' => 'vendor/name',\n 'description' => '✈️The package is a ThinkSNS+ package.',\n 'type' => 'library',\n 'license' => 'MIT',\n 'require' => [\n 'php' => '>=7.1.3',\n ],\n 'autoload' => [],\n 'config' => [\n 'sort-packages' => true,\n ],\n ]);\n }", "public function git_init($dir)\n\t\t{\n\t\t\t$cmd=\"git init \".$dir;\n\t\t\t//printf(\"cmd:%s<br/>\",$cmd);//test\n\t\t\t$last_line=exec ($cmd , $output , $retval);\n\t\t\tcheck_error($cmd,$retval);\n\t\t}", "protected function setupGitRepo()\n {\n $td = $this->getTestDir();\n\n $this->fs->removeDirectory($td);\n $this->fs->ensureDirectoryExists($td);\n\n $currentWorkDir = getcwd();\n chdir($td);\n\n $result = $this->process->execute(\"git init -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n $result = file_put_contents('b', 'a');\n if (false === $result) {\n throw new \\RuntimeException(\"Could not save file.\");\n }\n $result = $this->process->execute(\"git add b && git commit -m 'commit b' -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n chdir($currentWorkDir);\n }", "function git_clone($repo, $path, $initSubModules = false) {\n\tGitUtil::cloneRepo($repo, $path, $initSubModules);\n}", "function git_init_submodules($path) {\n\tGitUtil::initSubmodules($path);\n}", "protected function initGitignore() {\n $dirsWithGitignore = [\n ProjectTools::me()->getProjectDir(),\n ProjectTools::me()->getProjectDir() . '/www/',\n ];\n\n foreach ($dirsWithGitignore as $dir) {\n $this->rename('.gitignore.example', '.gitignore', $dir, TRUE);\n }\n }", "public function init_repo() {\n\n\t\t\t// include the repository configuration\n\t\t\t$repos = include_once(CONFIGPATH . 'repositories.php' );\n\n\t\t\t// the $_GET['deploy'] parameter from request\n\t\t\t$requested_deploy = filter_input( \\INPUT_GET, 'deploy', \\FILTER_SANITIZE_STRING );\n\n\t\t\t// assume that no repository is selected for deployment\n\t\t\t$selected = false;\n\n\t\t\t// if no deploy param was found, maybe pick up the first (and often, only) repository config\n\t\t\tif ( empty( $requested_deploy ) ) {\n\n\t\t\t\t$selected = $this->maybe_select_deploy( $repos[ 0 ], $requested_deploy );\n\n\t\t\t// otherwise, loop through repositories to select the requested one\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tforeach ( $repos as $deploy_config ) {\n\n\t\t\t\t\t$selected = $this->maybe_select_deploy( $deploy_config, $requested_deploy );\n\n\t\t\t\t\t// if we found one, break the loop\n\t\t\t\t\tif ( $selected === true ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// we didn't find any, throw an error\n\t\t\tif ( $selected === false ) {\n\t\t\t\terror(\n\t\t\t\t\t'501 Not Implemented', 'Configuration not found for the requested deploy'\n\t\t\t\t);\n\t\t\t}\n\t\t}", "public function initRepository(): void;", "public function init()\n {\n $this\n ->instantiateNewCacher()\n ->instantiateNewClient()\n ->authenticateClient()\n ->getUsers(\n $this->getAppParam('s.github.api.organization')\n )\n ->getRepositories(\n $this->getAppParam('s.github.api.organization')\n )\n ;\n }", "function get_repos() {\n\t\tadd_filter( 'use_fsockopen_transport', '__return_false' );\n\t\tadd_filter( 'use_fopen_transport', '__return_false' );\n\t\tadd_filter( 'use_streams_transport', '__return_false' );\n\t\tadd_filter( 'use_http_extension_transport', '__return_false' );\n\t\t\n\t\t// list all repos\n\t\t$url = 'https://api.github.com/users/' . $this->github_user . '/repos';\n\t\t\n\t\t$args = array(\n\t\t\t'method' => 'GET',\n\t\t\t'sslverify' => false\n\t\t);\n\n\t\t$github = wp_remote_request( $url, $args );\n\t\t\n\t\t// exit on error..\n\t\tif( empty( $github ) || ! empty( $github->errors ) ) {\n\t\t\t$this->repos = array();\n\t\t}\n\t\t\n\t\t$github_datas = $github['body'];\n\n\t\t$gits = json_decode( $github_datas );\n\t\t$sort_by = array();\n\t\t\n\t\tif ( is_array( $gits ) ) {\n\n\t\t\tforeach( $gits as $git ) {\n\t\t\t\t$this->repos[] = array( \n\t\t\t\t\t'name' => $git->name,\n\t\t\t\t\t'description' => $git->description,\n\t\t\t\t\t'url' => $git->html_url,\n\t\t\t\t\t'download' => trailingslashit( $git->html_url ) . 'archive/master.zip',\n\t\t\t\t\t'last_update' => $git->updated_at,\n\t\t\t\t\t'stargazers' => $git->stargazers_count,\n\t\t\t\t\t'watchers' => $git->watchers_count\n\t\t\t\t);\n\n\t\t\t\t$sort_by[] = $git->updated_at;\n\t\t\t}\n\n\t\t\tif ( ! empty( $sort_by ) )\n\t\t\t\tarray_multisort( $sort_by, SORT_DESC, $this->repos );\n\n\t\t// Github is not reachable rate limit exceeded\n\t\t} else {\n\t\t\t$this->repos = array();\n\t\t}\n\t\t\n\t}", "protected function initializeEmptyGitRepository(): string\n {\n try {\n $repoPath = sys_get_temp_dir()\n . '/CaptainHook/tests/repo-'\n . time() . '-' . bin2hex(random_bytes(4));\n } catch (Exception $exception) {\n TestCase::fail($exception->getMessage());\n }\n\n $gitConfigFile = $repoPath . '/.git/config';\n\n $this->filesystem()->mkdir($repoPath);\n\n $this->mustRunInShell(['git', 'init', '--initial-branch=main', $repoPath]);\n $this->mustRunInShell(['git', 'config', '--file', $gitConfigFile, 'user.name', 'Acceptance Tester']);\n $this->mustRunInShell(['git', 'config', '--file', $gitConfigFile, 'user.email', '[email protected]']);\n\n return $repoPath;\n }", "function cvs_add_repository($cvs_user, $cvs_pass, $cvs_project) {\r\n global $cvs_root, $cvs_cmd;\r\n\r\n $cvs_dir = $cvs_root.\"/\".$cvs_project;\r\n\r\n exec($cvs_cmd.\" -d \".$cvs_dir.\" init\");\r\n\r\n cvs_add_user($cvs_user, $cvs_pass, $cvs_project);\r\n}", "public function __construct($repo_path = null, $create_new = false, $_init = true) {\n\t\t\tif (is_string($repo_path)) {\n\t\t\t\t$this->set_repo_path($repo_path, $create_new, $_init);\n\t\t\t}\n\t\t}", "public function init($directory, array $params = NULL)\n\t\t{\n\t\t\tif (is_dir(\"$directory/.git\")) {\n\t\t\t\tthrow new GitException(\"Repo already exists in $directory.\");\n\t\t\t}\n\n\t\t\tif (!is_dir($directory) && !@mkdir($directory, 0777, TRUE)) { // intentionally @; not atomic; from Nette FW\n\t\t\t\tthrow new GitException(\"Unable to create directory '$directory'.\");\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t$this->run($directory, [\n\t\t\t\t\t'init',\n\t\t\t\t\t$params,\n\t\t\t\t\t'--end-of-options',\n\t\t\t\t\t$directory\n\t\t\t\t]);\n\n\t\t\t} catch (GitException $e) {\n\t\t\t\tthrow new GitException(\"Git init failed (directory $directory).\", $e->getCode(), $e);\n\t\t\t}\n\n\t\t\treturn $this->open($directory);\n\t\t}", "private function initProjects()\n\t{\n\t\t$this->priorities = Dao::readAll(Priority::class, [Dao::key('redmine_id')]);\n\t\t$this->projects = Dao::readAll(Project::class, [Dao::key('redmine_id')]);\n\t\t$this->statuses = Dao::readAll(Status::class, [Dao::key('redmine_id')]);\n\t}", "public function set_repo_path($repo_path, $create_new = false, $_init = true) {\n\t\t\tif (is_string($repo_path)) {\n\t\t\t\tif ($new_path = realpath($repo_path)) {\n\t\t\t\t\t$repo_path = $new_path;\n\t\t\t\t\tif (is_dir($repo_path)) {\n\t\t\t\t\t\t// Is this a work tree?\n\t\t\t\t\t\tif (file_exists($repo_path.\"/.git\") && is_dir($repo_path.\"/.git\")) {\n\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t$this->bare = false;\n\n\t\t\t\t\t\t\tif (!is_writable($repo_path.\"/.git\")) {\n\t\t\t\t\t\t\t\t$user_info = posix_getpwuid(fileowner($repo_path.\"/.git\"));\n\t\t\t\t\t\t\t\t$file_owner = $user_info['name'];\n\t\t\t\t\t\t\t\t$this->command_prefix = 'sudo -u '.$file_owner.' ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Is this a bare repo?\n\t\t\t\t\t\t} else if (is_file($repo_path.\"/config\")) {\n\t\t\t\t\t\t\t$parse_ini = parse_ini_file($repo_path.\"/config\");\n\t\t\t\t\t\t\tif ($parse_ini['bare']) {\n\t\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t\t$this->bare = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($create_new) {\n\t\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t\tif ($_init) {\n\t\t\t\t\t\t\t\t\t$this->run('init');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" is not a git repository');\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\tthrow new Exception('\"'.$repo_path.'\" is not a directory');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($create_new) {\n\t\t\t\t\t\tif ($parent = realpath(dirname($repo_path))) {\n\t\t\t\t\t\t\tmkdir($repo_path);\n\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\tif ($_init) $this->run('init');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new Exception('cannot create repository in non-existent directory');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" does not exist');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "protected function setUp()\n {\n $tempDir = tempnam(sys_get_temp_dir(),'');\n if (file_exists($tempDir)) {\n unlink($tempDir);\n }\n mkdir($tempDir);\n chdir($tempDir);\n exec('unzip '.__DIR__.'/gitRepo.zip');\n exec('git checkout .');\n $this->testDir = $tempDir;\n }", "private function initializeProjectDirectory()\n {\n $this->output->write('Adding initial files... ');\n\n // Create directory\n if (!@mkdir($this->project->getDirectory())) {\n $message = 'Error: Could not create directory';\n $this->output->writeln('<error>' . $message . '</error>');\n throw new \\RuntimeException($message);\n }\n\n // Add template files\n $templateHandler = new TemplateHandler();\n $templateHandler->setProject($this->project);\n\n $templateHandler->writeTemplate('README.md');\n $templateHandler->writeTemplate('gitignore');\n $templateHandler->writeTemplate('Vagrantfile');\n\n // Add Dirtfile\n $this->project->save();\n\n // Initialize git for working directory\n $process = new Process(null, $this->project->getDirectory());\n $process->setTimeout(3600);\n\n $commands = array(\n 'git init',\n 'git add -A .',\n 'git commit -m \"Initial commit, added README, gitignore, Dirtfile and Vagrantfile\"'\n );\n\n if (!$this->input->getOption('skip-repository')) {\n $commands[] = 'git remote add origin ' . $this->project->getRepositoryUrl();\n $commands[] = 'git push -u origin master';\n }\n\n foreach ($commands as $command) {\n $process->setCommandLine($command);\n $process->run();\n if (!$process->isSuccessful()) {\n $message = 'Error: Could not run \"'. $command .'\", git returned: ' . $process->getErrorOutput();\n $this->output->writeln('<error>'. $message . '</error>');\n throw new \\RuntimeException($message);\n }\n }\n\n $this->output->writeln('<info>OK</info>');\n }", "private function setCustomRepositories()\n {\n $em = $this->getDoctrine()->getManager();\n $this->frontRepository = new FrontRepository($em);\n }", "public function repo($dir, $remote);", "protected function setUp()\n {\n $tempDir = tempnam(sys_get_temp_dir(),'');\n if (file_exists($tempDir)) {\n unlink($tempDir);\n }\n mkdir($tempDir);\n chdir($tempDir);\n exec('unzip '.__DIR__.'/gitRepo.zip');\n exec('git checkout .');\n $this->testDir = $tempDir;\n \n $this->gitFlow = new GitFlow();\n $this->gitFlow->setDryRun(true);\n }", "public function setRepositories() {\n }", "function __constructor(array $repositories) \n {\n $this->repositories = $repositories;\n }", "private function syncRepository()\n {\n $cwd = '/tmp/'.$this->migrationId;\n (new ProcessBuilder(['mkdir']))->add('-p')->add($cwd)->getProcess()->mustRun();\n\n $cloneSourceCommandBuilder = new ProcessBuilder(['git', 'clone', $this->sourceProject->getSshUrlToRepo(), '.']);\n $cloneSourceCommandBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $addNewRemoteBuilder = new ProcessBuilder(['git', 'remote', 'add', 'new']);\n $addNewRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->add($this->targetProject->getSshUrlToRepo())\n ->getProcess()\n ->mustRun();\n\n $pushToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--all']);\n $pushToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $pushTagsToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--tags']);\n $pushTagsToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n }", "protected function createRepository()\n {\n $repositoryOptions = [\n 'repository' => $this->info['repositoryName'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'parent',\n 'uploads',\n 'data',\n 'int',\n 'float',\n 'bool',\n ]);\n\n $this->call('engez:repository', array_merge($repositoryOptions, $options));\n }", "public function github(){\n\n\t\t$user = '';\n\t\tif(isset($this->request->get['user'])){\n\t\t\t$user = $this->request->get['user'];\n\t\t}\n\t\t$repo = '';\n\t\tif(isset($this->request->get['repo'])){\n\t\t\t$repo = $this->request->get['repo'];\n\t\t}\n\t\t$branch = '';\n\t\tif(isset($this->request->get['branch'])){\n\t\t\t$branch = $this->request->get['branch'];\n\t\t}\n\t\tnew d_shopunity\\GitHub($user, $repo, str_replace(\"catalog/\", \"\", DIR_APPLICATION), $branch );\n\t}", "function plugin_initconfig_repository()\n{\n global $_CONF;\n\n $c = config::get_instance();\n if (!$c->group_exists('repository')) {\n $c->add('sg_main', NULL, 'subgroup', 0, 0, NULL, 0, true, 'repository');\n $c->add('fs_main', NULL, 'fieldset', 0, 0, NULL, 0, true, 'repository');\n $c->add('repository_moderated', 1,\n 'select', 0, 0, 0, 10, true, 'repository');\n $c->add('max_pluginpatch_upload', 2000000, \n 'text', 0, 0, 0, 60, true, 'repository'); // 2 MB\n }\n\n return true;\n}", "public function __construct($commit_msg)\n {\n $this->commit_msg = $commit_msg;\n $this->branch = isset($branch) ? $branch : '';\n $this->repo = isset($repo) ? $repo : $this->repo;\n\n $this->repo_url = 'https://github.com/' . urlencode(TYPOLIB_GITHUB_ACCOUNT)\n . '/' . $this->repo . '.git';\n\n $this->directory = DATA_ROOT . $this->repo . '/';\n $this->config_file = $this->directory . '.git/config';\n\n #FIXME: edit the config with GitPhp, allow custom email/name per Pull Request\n $this->user_config = \"[user]\\n\"\n . ' email = ' . CLIENT_GITHUB_EMAIL . \"\\n\"\n . ' name = ' . CLIENT_GITHUB_COMMITTER . \"\\n\";\n\n $this->client_remote_url = 'https://' . urlencode(CLIENT_GITHUB_ACCOUNT)\n . ':' . urlencode(CLIENT_GITHUB_PASSWORD)\n . '@github.com/' . urlencode(CLIENT_GITHUB_ACCOUNT)\n . '/' . $this->repo . '.git';\n\n // We use the Monolog library to log our events\n $this->logger = new Logger('PullRequest');\n $this->logger->pushHandler(new StreamHandler(INSTALL_ROOT . 'logs/pr-errors.log'));\n\n // Also log to error console in Debug mode\n if (DEBUG) {\n $this->logger->pushHandler(new ErrorLogHandler());\n }\n\n try {\n $this->git = new GitRepository($this->directory);\n } catch (GitException $e) {\n $this->logger->error('Failed to initialize Git repository. Error: '\n . $e->getMessage());\n }\n $this->cloneAndConfig();\n }", "protected function getLocalRepository()\n {\n if (!$this->localRepo){\n $this->localRepo = new InstalledFilesystemRepository(\n new JsonFile(\n $this->composer->getConfig()->get(\"vendor-dir\") . \"/composer/installed_extra.json\"\n )\n );\n }\n\n return $this->localRepo;\n }", "protected function initialize() {\n\t\t$this->databasesDir = $this->projectDir . '/var/data/databases';\n\t\t$this->simulatorsDir = $this->projectDir . '/var/data/simulators';\n\t\t$this->publicDir = $this->projectDir . '/' . ($this->getParameter('public_dir') ?? 'public');\n\t\t$this->viewsDir = $this->projectDir . '/templates';\n\t\t$this->pdfFormsDir = $this->projectDir . '/var/data/pdfforms';\n\t}", "protected function pull()\n {\n $local_repo = $this->getLocalRepoPath();\n if (!is_dir($local_repo))\n {\n if(!mkdir($local_repo, 0777, true))\n {\n throw new Exception('Could not create directory '.$local_repo);\n }\n $this->execute('clone', array($this->getRemoteScmUrl(), $local_repo));\n }\n else\n {\n $cwd = getcwd();\n chdir($local_repo);\n $this->execute('pull', array(), array());\n chdir($cwd);\n }\n }", "private function initAsyncRepositories(): void {\n $this->messagesRepository = new MessagesRepository();\n }", "public function gitClone()\n\t{\n\t\t$repoURL = 'https://github.com/' . $this->getUserName() . '/' . $this->getProjectName() . '.git';\n\t\t$path = $this->getPath();\n\t\t$this->gitWrapper->clone($repoURL, $path);\n\t}", "function devshop_project_create_step_git($form, $form_state) {\n $project = &$form_state['project'];\n \n drupal_add_js(drupal_get_path('module', 'devshop_projects') . '/inc/create/create.js');\n \n if ($project->verify_error) {\n $form['note'] = array(\n '#markup' => t('We were unable to connect to your git repository. Check the messages, edit your settings, and try again.'),\n '#prefix' => '<div class=\"alert alert-danger\">',\n '#suffix' => '</div>',\n );\n $form['error'] = array(\n '#markup' => $project->verify_error,\n );\n \n // Check for \"host key\"\n if (strpos($project->verify_error, 'Host key verification failed')) {\n $form['help'] = array(\n '#markup' => t('Looks like you need to authorize this host. SSH into the server as <code>aegir</code> user and run the command <code>git ls-remote !repo</code>. <hr />Add <code>StrictHostKeyChecking no</code> to your <code>~/.ssh/config</code> file to avoid this for all domains in the future.', array(\n '!repo' => $project->git_url,\n )),\n '#prefix' => '<div class=\"alert alert-warning\">',\n '#suffix' => '</div>',\n );\n }\n }\n \n if (empty($project->name)) {\n $form['title'] = array(\n '#type' => 'textfield',\n '#title' => t('Project Code Name'),\n '#required' => TRUE,\n '#suffix' => '<p>' . t('Choose a unique name for your project. Only letters and numbers are allowed.') . '</p>',\n '#size' => 40,\n '#maxlength' => 255,\n );\n }\n else {\n $form['title'] = array(\n '#type' => 'value',\n '#value' => $project->name,\n );\n $form['title_display'] = array(\n '#type' => 'item',\n '#title' => t('Project Code Name'),\n '#markup' => $project->name,\n );\n }\n \n $username = variable_get('aegir_user', 'aegir');\n \n $tips[] = t('Use the \"ssh\" url whenever possible. For example: <code>[email protected]:opendevshop/repo.git</code>');\n $tips[] = t('You can use a repository with a full Drupal stack committed, but using composer is recommended.');\n $tips[] = t('Use the !link project as a starting point for Composer based projects.', [\n '!link' => l(t('DevShop Composer Template'), 'https://github.com/opendevshop/devshop-composer-template'),\n ]);\n $tips[] = t('If a composer.json file is found in the root of the project, <code>composer install</code> will be run automatically.');\n $tips = theme('item_list', array('items' => $tips));\n \n $form['git_url'] = array(\n '#type' => 'textfield',\n '#required' => 1,\n '#title' => t('Git URL'),\n '#suffix' => '<p>' . t('Enter the Git URL for your project') . '</p>' . $tips,\n '#default_value' => $project->git_url,\n '#maxlength' => 1024,\n );\n\n//\n// // Project code path.\n// $form['code_path'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_code_path', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Code path'),\n// '#description' => t('The absolute path on the filesystem that will be used to create all platforms within this project. There must not be a file or directory at this path.'),\n// '#required' => variable_get('devshop_projects_allow_custom_code_path', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->code_path,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_path' => variable_get('devshop_project_base_path', '/var/aegir/projects'),\n// ),\n// );\n//\n// // Project base url\n// $form['base_url'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_base_url', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Base URL'),\n// '#description' => t('All sites will be under a subdomain of this domain.'),\n// '#required' => variable_get('devshop_projects_allow_custom_base_url', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->base_url,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_url' => devshop_projects_url($project->name, ''),\n// ),\n// );\n \n // Display helpful tips for connecting.\n $pubkey = variable_get('devshop_public_key', '');\n \n // If we don't yet have the server's public key saved as a variable...\n if (empty($pubkey)) {\n $output = t(\"This DevShop doesn't yet know your server's public SSH key. To import it, run the following command on your server as <code>aegir</code> user:\");\n $command = 'drush @hostmaster vset devshop_public_key \"$(cat ~/.ssh/id_rsa.pub)\" --yes';\n $output .= \"<div class='command'><input size='160' value='$command' onclick='this.select()' /></div>\";\n }\n else {\n // @TODO: Make this Translatable\n $output = <<<HTML\n <div class=\"empty-message\">If you haven't granted this server access to your Git repository, you should do so now using it's public SSH key.</div>\n <textarea id=\"rsa\" onclick='this.select()'>$pubkey</textarea>\nHTML;\n }\n \n // Add info about connecting to Repo\n $form['connect'] = array(\n '#type' => 'fieldset',\n '#title' => t('Repository Access'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n $form['connect']['public_key'] = array(\n '#markup' => $output,\n );\n return $form;\n}", "public function cloneGitRepo($repo, $dir);", "function __construct($userName, $projectName)\n\t{\n\t\t// TODO Need to possibly make a WorkingCopy variable that will be set depending if the repo is cloned or not.\n\t\t$this->gitWrapper = new GitWrapper();\n\t\tparent::__construct($userName, $projectName); // calling AbstractFileSystem's constructor\n\t}", "protected function pickRepos(InputInterface $input, OutputInterface $output) {\n $repos = [];\n if ($feedUrl = $input->getOption('git-feed')) {\n $schemes = preg_match(';^file://;', $feedUrl)\n ? ['https', 'http', 'git', 'file']\n : ['https', 'http', 'git'];\n $repos = array_merge($repos, $this->getFilteredFeed($output, $feedUrl, 'ready', $schemes));\n }\n if ($repoDirs = $input->getArgument('git-repos')) {\n $repos = array_merge($repos, $this->getRepos($output, $repoDirs));\n }\n usort($repos, function ($a, $b) {\n return strcmp($a['key'], $b['key']);\n });\n if ($input->getOption('limit')) {\n $repos = array_slice($repos, 0, $input->getOption('limit'));\n return $repos;\n }\n return $repos;\n }", "public function __construct()\n {\n $this->postRepository = new PostRepository();\n $this->userRepository = new UserRepository();\n $this->commentRepository = new CommentRepository();\n $this->replyRepository = new ReplyRepository();\n }", "protected function PopulateProjects()\n\t{\n\t\tif (!($fp = fopen($this->projectConfig, 'r'))) {\n\t\t\tthrow new Exception('Failed to open project list file ' . $this->projectConfig);\n\t\t}\n\n\t\t$projectRoot = GitPHP_Config::GetInstance()->GetValue('projectroot');\n\n\t\twhile (!feof($fp) && ($line = fgets($fp))) {\n\t\t\t$pinfo = explode(' ', $line);\n\t\t\t$ppath = trim($pinfo[0]);\n\t\t\tif (is_file($projectRoot . $ppath . '/HEAD')) {\n\t\t\t\ttry {\n\t\t\t\t\t$projObj = new GitPHP_Project($ppath);\n\t\t\t\t\tif (isset($pinfo[1])) {\n\t\t\t\t\t\t$projOwner = trim($pinfo[1]);\n\t\t\t\t\t\tif (!empty($projOwner)) {\n\t\t\t\t\t\t\t$projObj->SetOwner($projOwner);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->projects[] = $projObj;\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\terror_log($e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfclose($fp);\n\t}", "function SVNRepoManager() {\n\tloadTemplate('SVNRepoManager');\n}", "public function workspaceInit() {}", "function core_github_init($obj, $prefix='api'){\n\t$options = $obj->options;\n\t\n\tif(empty($options->resource)){ echo 'No Resource Set.'; return false; }\n\tif(empty($options->user)){ echo 'No User Set.'; return false; }\n\tif(empty($options->repo)){ echo 'No Repository Set.'; return false; }\n\t\n\tswitch($options->resource){\n\t\tcase \"tags\":\n\t\t\t$url = 'repos/'.$options->user.'/'.$options->repo.'/git/refs/tags';\n\t\t\tbreak;\n\t\t\n\t\tcase \"blob\":\n\t\t\t$url = $options->user.'/'.$options->repo.'/'.$options->path; //Path should be a relative path including the branch: master/admin/index.php\n\t\t\t$prefix = 'raw'; //Query the raw.github.com\n\t\t\tbreak;\n\t}\n\t\n\t$response = core_github_com($url, $prefix);\n\tif($response === false){ return false; }\n\t\n\techo '<div class=\"core-github main-wrapper '.$options->class.'\">';\n\tcore_github_process($response, $options->resource, $options);\n\techo '</div>';\n}", "public function _create_repositories( $project, $migrate_data, $is_public, $repo_name ) {\n\n\t\tif ( ! empty( $project ) ) {\n\n\t\t\t$this->_display_project_data( $project );\n\n\t\t\t// Do not duplicate group name in repo name.\n\t\t\tif ( get_param_value( '--use-repo-name-as-github-repo') || false !== strpos( $project['path'], strtolower( $project['namespace']['name'] ) ) || false !== strpos( $project['path'], $project['namespace']['name'] ) || false !== strpos( $project['name'], strtoupper( $project['namespace']['name'] ) ) ) {\n\t\t\t\t$gitlab_repo_name = $project['path'];\n\t\t\t} else {\n\t\t\t\t$gitlab_repo_name = $project['namespace']['name'] . '-' . $project['path'];\n\t\t\t}\n\n\t\t\tif ( empty( $repo_name ) ) {\n\t\t\t\t$repo_name = $gitlab_repo_name;\n\t\t\t}\n\n\t\t\t$this->_clone_push_repo( $repo_name, $project, $migrate_data, $is_public, $gitlab_repo_name );\n\n\t\t}\n\n\t}", "private function get_locations_repositry() {\n\t\t\t$this->wpseo_local_locations_repository = new WPSEO_Local_Locations_Repository();\n\t\t}", "public function updateRepositories() {\n $projects = $this->loadProjects();\n if (!$projects)\n return;\n\n $this->m_authors = $this->loadAuthors();\n\n foreach ($projects as $project)\n $this->updateProject($project);\n }", "public function __construct(&$git)\n {\n $this->git = & $git;\n }", "private function _clone_push_repo( $repo_name, $project, $migrate_data, $is_public = false, $gitlab_repo_name = '' ) {\n\n\t\t$issue_map = [];\n\t\t$pr_map = [];\n\n\t\t// Create Repository.\n\t\t$github = new Github();\n\t\t$repo = $github->create_repo(\n\t\t\t$repo_name,\n\t\t\tstr_replace( [ \"\\n\", \"\\r\\n\", \"\\r\" ], '', $project['description'] ), // Fix error: Validation Failed: description control characters are not allowed.\n\t\t\t$project['web_url'],\n\t\t\t$is_public,\n\t\t\t$this->github_organisation,\n\t\t\t$project['issues_enabled'],\n\t\t\t$project['wiki_enabled']\n\t\t);\n\n\t\t// Dirty way i know, but don't want to refactor code right now.\n\t\tself::$repo_name = $project['path'];\n\t\tself::$repo_group = $project['namespace']['full_path'];\n\n\t\tif ( false !== $repo ) {\n\n\t\t\t$gitlab_clone_url = $project['ssh_url_to_repo'];\n\t\t\t$github_clone_url = $repo['ssh_url'];\n\n\t\t\t$base_dir = dirname( __DIR__ ) . DIRECTORY_SEPARATOR . $this->temporary_project_dir;\n\t\t\texec( \"rm -rf $base_dir\" );\n\t\t\tmkdir( $base_dir );\n\t\t\tchdir( $base_dir );\n\t\t\texec(\"git clone --bare $gitlab_clone_url\");\n\t\t\tchdir( $base_dir . DIRECTORY_SEPARATOR . $project['path'] . '.git' );\n\t\t\texec(\"git remote add github $github_clone_url\");\n\t\t\texec(\"git push --mirror github\");\n\n\t\t\t$this->_create_labels( $project, $repo_name );\n\n\t\t\t$milestone_map = array_column( $this->_create_milestones( $project, $repo_name ), 'github_milestone_id', 'gitlab_milestone_id' );\n\n\t\t\tif ( true === $project['snippets_enabled'] && in_array( 'snippets', $migrate_data, true ) ) {\n\n\t\t\t\t$this->_create_snippets( $project, $repo_name );\n\n\t\t\t}\n\n\t\t\t$issue_map = [];\n\n\t\t\tif ( true === $project['issues_enabled'] && in_array( 'issues', $migrate_data ) ) {\n\n\t\t\t\t$issue_map = $this->_add_issues( $project, $repo_name, $milestone_map, $gitlab_repo_name );\n\n\t\t\t}\n\n\t\t\tif ( in_array( 'pr', $migrate_data ) ) {\n\n\t\t\t\t$pr_map = $this->_create_merge_requests( $project, $repo_name, $milestone_map, $issue_map, $gitlab_repo_name );\n\n\t\t\t}\n\n\t\t\t$github->_update_prs( $issue_map, $pr_map, $repo_name );\n\n\t\t\t// Archive repo.\n\t\t\tarchive_repo_by_id( $project['id'] );\n\t\t}\n\n\t}", "public static function open($repo_path) {\n\t\t\treturn new GitRepo($repo_path);\n\t\t}", "private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}", "public function testGitLabRemoteRepositoryExternal(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './', 'https://salsa.debian.org/');\n $this->assertEquals('https://salsa.debian.org/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "function pkg_list_repos() {\n\tglobal $g;\n\n\t$repo_base = \"{$g['pkg_repos_path']}/{$g['product_name']}-repo\";\n\t$result = array();\n\t$name_files = glob(\"{$repo_base}-*.name\");\n\tforeach ($name_files as $name_file) {\n\t\t$repo_name = file_get_contents($name_file);\n\t\tif ($repo_name == false || strlen($repo_name) <= 1) {\n\t\t\tcontinue;\n\t\t}\n\t\t$repo_name_base = \"{$repo_base}-{$repo_name}\";\n\t\t$descr_file = \"{$repo_name_base}.descr\";\n\t\tif (file_exists($descr_file)) {\n\t\t\t$descr = file_get_contents($descr_file);\n\t\t\tif ($descr == false) {\n\t\t\t\t$descr = 'Unknown';\n\t\t\t}\n\t\t} else {\n\t\t\t$descr = 'Unknown';\n\t\t}\n\t\t$entry = array(\n\t\t 'name' => $repo_name,\n\t\t 'path' => \"{$repo_name_base}.conf\",\n\t\t 'descr' => $descr\n\t\t);\n\t\tif (file_exists(\"{$repo_name_base}.default\")) {\n\t\t\t$entry['default'] = true;\n\t\t}\n\t\t$result[] = $entry;\n\t}\n\n\treturn $result;\n}", "public function __construct()\n {\n parent::__construct();\n $this->githubClient = new Client([\n // 'auth' => [getenv('GITHUB_USERNAME'), getenv('GITHUB_TOKEN')],\n 'auth' => [config('env.GITHUB_USERNAME'), config('env.GITHUB_TOKEN')],\n ]);\n }", "private function createRepository()\n {\n $this->output->write('Creating repository... ');\n\n try {\n $versionControlRepository = ($this->config->scm->type == 'gitlab') ?\n new VersionControlRepositoryGitLab($this->config) : new VersionControlRepositoryGitHub($this->config);\n $versionControlRepository->create($this->project);\n\n $this->output->writeln('<info>OK</info>');\n } catch (\\Exception $e) {\n $message = 'Error: '. $e->getMessage();\n $this->output->writeln('<error>'. $message .'</error>');\n throw new \\RuntimeException($message);\n }\n }", "public static function cloneRepo($repo, $path, $initSubModules = false) {\n\t\t$cloneCmd = sprintf(self::CLONE_CMD_TMPL,\n\t\t\t$repo,\n\t\t\t$path);\n\t\tpassthru($cloneCmd);\n\n\t\tif ($initSubModules) {\n\t\t\tself::initSubmodules($path);\n\t\t}\n\t}", "private function init(): void\n {\n // Load composer.json\n $this->composerJson = $this->loadJsonFile($this->composerJsonFilename);\n\n // Reconstitute the composer.lock filename\n $composerLockFilename = dirname($this->composerJsonFilename) .\n DIRECTORY_SEPARATOR .\n basename($this->composerJsonFilename, '.json') .\n '.lock';\n\n // Check if composer.lock file exists\n if (!file_exists($composerLockFilename)) {\n throw new ComposerException(\n sprintf('Project is not initialized with Composer, \"%s\" file doest not exists', $composerLockFilename)\n );\n }\n\n // Get JSON content of composer.json file\n if (($this->composerLock = json_decode(file_get_contents($composerLockFilename), true)) === false) {\n throw new ComposerException(\n sprintf('\"%s\" file of project is corrupted or not readable', $composerLockFilename)\n );\n }\n\n // Reindex packages\n $this->composerLock['packages'] = array_column($this->composerLock['packages'], null, 'name');\n\n // Load packages\n $this->packages = array_fill_keys(array_column($this->composerLock['packages'], 'name'), null);\n }", "public function __construct(&$modx = null, array $options = array())\n {\n $this->options = $options;\n if ($modx instanceof \\modX) {\n $this->modx =& $modx;\n }\n $gitPath = $this->getOption(self::GIT_PATH, null, getcwd());\n $this->git = new Git($gitPath, $options);\n }", "public function setUp()\n {\n $this->config = new Repository();\n }", "public function __construct(\\App\\Repos\\Local_DB_RO_Repository $repo)\n {\n\t\t$this->middleware('auth');\n\n\t\t$this->repo = $repo;\n }", "public function __construct()\n {\n $this->citiesRepository = new CitiesRepository();\n }", "protected function setUp() {\n $this->basePath = $basePath = realpath(__DIR__ . '/../../../../../');\n $appPath = $basePath . '/app';\n $this->confPath = $confPath = $appPath . '/boxdata/conf';\n $this->etcPath = $etcPath = $appPath . '/boxdata/etc/local';\n $this->object = new BoxRepository($confPath,null);\n }", "public function load_repository(&$repo, $name) {\n // First determine if the class file exisits\n $path = @$repo['path'];\n $conf = array();\n\n if (file_exists($path . '/settings.php')) {\n // Override with repository specific data\n include($path . '/settings.php');\n }\n\n $repo = array_merge($conf, $repo);\n if (!isset($repos['data'])||!is_object($repo['data'])) $repo['data'] = $this->load_provider($repo, $path, $name);\n\n }", "public function testGitLabRemoteRepository(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './');\n $this->assertEquals('https://gitlab.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "function pkg_build_repo_list() {\n\t$repos = pkg_list_repos();\n\t$list = array();\n\n\tforeach ($repos as $repo) {\n\t\t$list[$repo['name']] = $repo['descr'];\n\t}\n\n\treturn($list);\n}", "public function getRepos()\n {\n return $this->repos;\n }", "public function getRepos()\n {\n return $this->repos;\n }", "public function _create_single_repo( $gitlab_path, $include_values, $is_public, $gh_repo_name ) {\n\n\t\tif ( 'all' === $include_values || in_array( 'all', $include_values ) ) {\n\n\t\t\t$migrate_data = [ 'issues', 'wiki', 'pr', 'snippets' ];\n\n\t\t} else {\n\n\t\t\t$migrate_data = $include_values;\n\n\t\t}\n\n\t\t[ 'group' => $group, 'name' => $project_name ] = $gitlab_path; // php 7.1 🚀\n\n\t\t$projects_data = get_projects( $gitlab_path );\n\n\t\tforeach ( $projects_data as $project ) {\n\t\t\tif ( strtolower( $group ) === strtolower( $project['namespace']['full_path'] ) ) {\n\t\t\t\tif ( ! empty( get_param_value( '--yes' ) || ask_yes_no( $project['path_with_namespace'] ) ) ) {\n\t\t\t\t\t$this->_create_repositories( $project, $migrate_data, $is_public, $gh_repo_name );\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "function getRepositories()\n{\n $repositories = apc_fetch('repositories');\n\n if (empty($features)) {\n $repositories = array(\n \"platform-ui\" => \"PLF UI\",\n \"commons\" => \"Commons\",\n \"ecms\" => \"ECMS\",\n \"social\" => \"Social\",\n \"wiki\" => \"Wiki\",\n \"forum\" => \"Forum\",\n \"calendar\" => \"Calendar\",\n \"integration\" => \"Integration\",\n \"platform\" => \"Platform\",\n \"platform-public-distributions\" => \"PLF Public Dist\",\n \"platform-private-distributions\" => \"PLF Private Dist\");\n apc_store('repositories', $repositories);\n }\n return $repositories;\n}", "function gitUpdate()\n{\n \n $config = json_decode(file_get_contents(\"/app/config.json\"), true);\n\n $git = $config['git'];\n $remote = \"https://\" . $git['user'] . \":\" . $git['token'] . \"@github.com/\" . $git['git_dir'];\n exec(\"cd \" . $config['project_dir'] . \" && git init && git pull $remote \" . $git['branch']);\n exec(\"cd \" . $config['project_dir'] . \" && composer update\");\n}", "function __construct( $user = 'imath' ) {\n\t\t$this->github_user = $user;\n\t\t$this->get_repos();\n\t}", "protected function makeRepo()\n {\n // debido a que el repositorio de direccion depende\n // del repositorio de empleado que tiene sus\n // dependendias, y como no queremos usar\n // el IOC container, lo hacemos\n // explicitamente aqui.\n return new AddressRepository(\n new Address(),\n new EmployeeRepository(\n new Employee(),\n new UserRepository(new User())\n )\n );\n }", "public static function &create($repo_path, $source = null) {\n\t\t\treturn GitRepo::create_new($repo_path, $source);\n\t\t}", "private function init()\n {\n if(!file_exists($this->tempDB))\n {\n $data = @file_get_contents($this->remoteLink);\n\n if($data !== FALSE)\n {\n file_put_contents($this->tempDB, $data);\n }\n }\n }", "public function get_all_repos(){\n\n\t\t\treturn $this->get_github_data( 'all_repos' );\n\n\t\t}", "public function init(){\n $this->container = new Container;\n $this->statistic = $this->container->get('common\\repositories\\StatisticRepository');\n }", "public function run()\n {\n $repo1 = Repo::create([\n 'name' => 'johnbolton/exercitationem',\n 'url' => 'https://github.com/johnbolton/exercitationem',\n 'event_id' => 1,\n ]);\n\n $repo2 = Repo::create([\n 'name' => 'pestrada/voluptatem',\n 'url' => 'https://github.com/pestrada/voluptatem',\n 'event_id' => 2,\n ]);\n }", "function target_gitup()\n{\n\t// git remote add upstream git://github.com/<user>/<repo>.git\n\tsystem('git fetch upstream');\n\tsystem('git merge upstream/master');\n}", "public function __construct($repo)\n {\n $this->repo = $repo;\n $this->api = \"https://api.github.com/repos/\";\n\n $this->client = new \\GuzzleHttp\\Client();\n }", "protected function init()\n {\n $dir = $this->getDir();\n\n if (!file_exists($dir)) {\n mkdir($dir, 0755, true);\n }\n }", "function prueba_git ()\r\n{\r\n\t/* Aqui estaria el codigo de la funcion */\r\n\r\n}", "public function __construct(MainRepository $mainRepository){\n $this->mainRepository = $mainRepository;\n }", "function config_from_git($git_sources)\n{\n\tglobal $branch, $revision, $commit_url;\n\n\t// only run git stuff, if sources exist, are git and git cli is available\n\tif (@file_exists($git_sources.'/.git') && !exec(\"hash git 2>/dev/null\"))\n\t{\n\t\t$branch = trim(exec(\"cd $git_sources >/dev/null 2>&1 && git branch --no-color 2>/dev/null | sed -e '/^[^*]/d' -e \\\"s/* \\(.*\\)/\\\\1/\\\"\"));\n\t\t$revision = exec(\"cd $git_sources >/dev/null 2>&1 && git rev-parse --short HEAD &2>/dev/null\");\n\t\t$matches = null;\n\t\tif (empty($commit_url) &&\n\t\t\t($remote = exec(\"cd $git_sources >/dev/null 2>&1 && git remote -v &2>/dev/null\")) &&\n\t\t\tpreg_match('/([email protected]:|https:\\/\\/github.com\\/)(.*)\\.git/i', $remote, $matches))\n\t\t{\n\t\t\t$commit_url = 'https://github.com/'.$matches[2].'/commit/';\n\t\t}\n\t\t//error_log(__METHOD__.\"('$git_sources') branch='$branch', revision='$revision', commit_url='$commit_url'\");\n\t}\n\t// get revision from request\n\telseif (!empty($_REQUEST['revision']) && preg_match('/^[0-9a-f]+$/', $_REQUEST['revision']))\n\t{\n\t\t$revision = $_REQUEST['revision'];\n\t}\n}", "public function __construct(\n AssetRepositoryInterface $assets,\n CategoryRepositoryInterface $categories,\n CityImageRepositoryInterface $cityImages,\n CompanyRepositoryInterface $companies,\n EntityRepositoryInterface $entities,\n FeatureRepositoryInterface $features,\n FranchiseRepositoryInterface $franchises,\n LocationRepositoryInterface $locations,\n MerchantRepositoryInterface $merchants,\n UserLocationRepositoryInterface $userLocations,\n UserRepositoryInterface $users,\n ZipcodeRepositoryInterface $zipcodes\n )\n {\n $this->assets = $assets;\n $this->categories = $categories;\n $this->cityImages = $cityImages;\n $this->companies = $companies;\n $this->entities = $entities;\n $this->features = $features;\n $this->franchises = $franchises;\n $this->geoip = json_decode(GeoIp::getGeoIp('json'));\n $this->locations = $locations;\n $this->merchants = $merchants;\n $this->personFactory = new \\SOE\\Persons\\PersonFactory;\n $this->userLocations = $userLocations;\n $this->users = $users;\n $this->viewableFactory = new \\SOE\\Viewables\\ViewableFactory;\n $this->zipcodes = $zipcodes;\n parent::__construct();\n }", "public function init() {\n\t\t$this->cacheDir = $this->chatBot->vars[\"cachefolder\"];\n\n\t\t//Making sure that the cache folder exists\n\t\tif (!dir($this->cacheDir)) {\n\t\t\tmkdir($this->cacheDir, 0777);\n\t\t}\n\t}", "public static function fetch_github()\n {\n $username = Config::get('ProjectLister::username');\n\n $projects = array();\n\n $url = \"https://api.github.com/users/$username/repos\";\n $json = Utility::get($url);\n\n if(!is_array($json = json_decode($json)))\n return FALSE;\n\n foreach($json as $repo)\n {\n $proj = new ProjectLister;\n $proj->url = $repo->html_url;\n $proj->name = $repo->name;\n $proj->description = $repo->description;\n $proj->watchers = $repo->watchers;\n $proj->source = \"GitHub\";\n $proj->watcher_noun = ($repo->watchers == 1 ? 'watcher' : 'watchers');\n $proj->updated = strtotime($repo->pushed_at);\n\n $projects[] = $proj;\n }\n\n return $projects;\n }", "public function run()\n {\n return $this->repoClass->init();\n }", "protected function initializeAction() {\t\n\t\t$this->persdataRepository = t3lib_div::makeInstance('Tx_PtConference_Domain_Repository_persdataRepository');\n\t}", "public static function &create_new($repo_path, $source = null, $remote_source = false, $reference = null) {\n\t\t\tif (is_dir($repo_path) && file_exists($repo_path.\"/.git\") && is_dir($repo_path.\"/.git\")) {\n\t\t\t\tthrow new Exception('\"'.$repo_path.'\" is already a git repository');\n\t\t\t} else {\n\t\t\t\t$repo = new self($repo_path, true, false);\n\t\t\t\tif (is_string($source)) {\n\t\t\t\t\tif ($remote_source) {\n\t\t\t\t\t\tif (!is_dir($reference) || !is_dir($reference.'/.git')) {\n\t\t\t\t\t\t\tthrow new Exception('\"'.$reference.'\" is not a git repository. Cannot use as reference.');\n\t\t\t\t\t\t} else if (strlen($reference)) {\n\t\t\t\t\t\t\t$reference = realpath($reference);\n\t\t\t\t\t\t\t$reference = \"--reference $reference\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$repo->clone_remote($source, $reference);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$repo->clone_from($source);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$repo->run('init');\n\t\t\t\t}\n\t\t\t\treturn $repo;\n\t\t\t}\n\t\t}", "public function init()\r\n {\r\n $this->admin = Shopware()->Modules()->Admin();\r\n $this->basket = Shopware()->Modules()->Basket();\r\n $this->session = Shopware()->Session();\r\n $this->db = Shopware()->Db();\r\n $this->moduleManager = Shopware()->Modules();\r\n $this->eventManager = Shopware()->Events();\r\n }", "public function __construct()\n {\n $this->metadatas = app(MetadataRepository::class);\n $this->fileRepository = app(FileRepository::class);\n if(method_exists($this, 'init')){\n $this->init();\n }\n }", "public function setUp()\n {\n $this->files = array(\n 'composer' => sys_get_temp_dir().'/composer.phar',\n 'selfupdater' => sys_get_temp_dir().'/composerselfupdateissuetest.php',\n );\n }", "public function init()\n {\n Yii::app()->getModule('push');\n }", "public function __construct(PollRepositoryInterface $pollRepo, UserRepositoryInterface $userRepo, QuestionRepositoryInterface $questionRepo, AnswerRepositoryInterface $answerRepo, UserAnswerRepositoryInterface $userAnswerRepo)\n {\n $this->pollRepo = $pollRepo;\n $this->userRepo = $userRepo;\n $this->questionRepo = $questionRepo;\n $this->answerRepo = $answerRepo;\n $this->userAnswerRepo = $userAnswerRepo;\n }", "public function create($remote = 'http://github.com/joomla/joomla-platform.git')\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// We add the users repo to our remote list if it isn't already there\n\t\tif (!file_exists($this->_root . '/.git'))\n\t\t{\n\t\t\t// Execute the command.\n\t\t\texec('git clone -q ' . escapeshellarg($remote) . ' ' . escapeshellarg($this->_root), $out, $return);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new InvalidArgumentException('Repository already exists at ' . $this->_root . '.');\n\t\t}\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('The clone failed from remote %s with code %d and message %s.', $remote, $return, implode(\"\\n\", $out)));\n\t\t}\n\n\t\treturn $this;\n\t}", "function repositoryCustom()\n {\n }" ]
[ "0.7279545", "0.6670897", "0.6670897", "0.654073", "0.64604723", "0.6432269", "0.63350374", "0.63283527", "0.63090694", "0.62556434", "0.62288153", "0.615954", "0.6146635", "0.6120152", "0.5970345", "0.59287566", "0.59048176", "0.5866624", "0.5812064", "0.5783141", "0.5760324", "0.57126886", "0.5697341", "0.5695578", "0.56048185", "0.5598951", "0.5591206", "0.55496943", "0.55323213", "0.5497431", "0.5488027", "0.54866654", "0.5479352", "0.54552317", "0.54223764", "0.54205775", "0.53842235", "0.53590256", "0.53446406", "0.53222615", "0.5317469", "0.53043914", "0.52895087", "0.528843", "0.5286143", "0.5280422", "0.52618533", "0.52331734", "0.522032", "0.5212399", "0.51984406", "0.5196727", "0.5186116", "0.5166606", "0.5157333", "0.51367146", "0.5129539", "0.511291", "0.5110227", "0.5108271", "0.51064837", "0.50879306", "0.50783694", "0.5076058", "0.50751036", "0.507426", "0.507362", "0.50631243", "0.5059616", "0.5058979", "0.5058979", "0.5050007", "0.50470376", "0.5035571", "0.50316894", "0.5023485", "0.50183153", "0.5006285", "0.5000138", "0.49992087", "0.49977547", "0.49958745", "0.49877933", "0.49872965", "0.49799576", "0.49636656", "0.49583077", "0.49504942", "0.4949572", "0.49468136", "0.49457029", "0.49335217", "0.49319342", "0.49309665", "0.49143168", "0.489872", "0.48945686", "0.48945192", "0.48864517", "0.4884411" ]
0.7953516
0
Run the database seeds.
public function run() { factory(App\Entity::class, 20)->create()->each( function($Entity) { factory(App\Details::class)->create(['PersonalNumber' => $Entity->PersonalNumber]); factory(App\Balance::class)->create(['PersonalNumber' => $Entity->PersonalNumber]); factory(App\Contract::class)->create(['PersonalNumber' => $Entity->PersonalNumber]); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\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 }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Run the database seeds.
public function run() { DB::table('camiseta_categorias')->truncate(); $faker = Faker::create(); foreach(range(1,8) as $i){ CamisetaCategoria::create([ 'nome' => $faker->firstName(), 'descricao' => $faker->sentence() ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\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 }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Adds a path to the inclusion path
function addPath($path, $pre = true) { if($path) { if($pre) set_include_path($path . PATH_SEPARATOR . get_include_path()); else set_include_path(get_include_path() . PATH_SEPARATOR . $path); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addPath($path);", "public function addPath($path);", "public static function add(&$path) {\n $path = preg_replace('/((?:^|\\\\/)[^\\\\/\\\\.]+?)$/isD', '$1/', $path);\n }", "public function addPath($path)\n {\n if (!in_array($path, $this->_paths)) {\n $this->_paths[] = rtrim($path, '/\\\\');\n }\n }", "public function addPath($path)\n {\n if (!in_array($path, $this->paths)) {\n $this->paths[] = $path;\n }\n }", "public static function add_path($path)\n\t{\n\t\tarray_unshift(self::$_asset_paths, str_replace('../', '', $path));\n\t}", "static public final function appendPath($path)\n {\n\tif (!is_dir($path)) {\n \t throw new Exception(sprintf('Include path \"%s\" does not exists', $path));\n\t}\n\tself::$_paths[] = $path;\n }", "public static function addPath($path) {\n if (!isset(self::$lookup_path)) {\n self::register();\n }\n self::$lookup_path[] = $path;\n }", "public static function addPath( $path )\n\t{\n\t\t$path = rtrim($path, '/');\n\t\t$path = rtrim($path, '\\\\');\n\t\t$path .= DIRECTORY_SEPARATOR;\n\n\t\tif ( @!is_dir($path) ) {\n\t\t\trequire_once 'Mapper/Exception.php';\n\t\t\tthrow new Orm_Mapper_Exception(\"The path '$path' does not exist'\");\n\t\t}\n\n\t\tself::$_paths[$path] = $path;\n\t}", "static public function appendIncludePath($path)\r\n {\r\n \tset_include_path( \r\n \t\tget_include_path() . \r\n \t\t$path . PATH_SEPARATOR\r\n \t);\r\n }", "public static function addIncludePath($path = null)\n\t{\n\t\t// Declare the internal paths as a static variable.\n\t\tstatic $_paths;\n\n\t\t// If the internal paths have not been initialised, do so with the base table path.\n\t\tif (!isset($_paths)) {\n\t\t\t$_paths = array(dirname(__FILE__) . '/helpers');\n\t\t}\n\n\t\t// Convert the passed path(s) to add to an array.\n\t\tsettype($path, 'array');\n\n\t\t// If we have new paths to add, do so.\n\t\tif (!empty($path) && !in_array($path, $_paths)) {\n\t\t\t// Check and add each individual new path.\n\t\t\tforeach ($path as $dir)\n\t\t\t{\n\t\t\t\t// Sanitize path.\n\t\t\t\t$dir = trim($dir);\n\n\t\t\t\t// Add to the front of the list so that custom paths are searched first.\n\t\t\t\tarray_unshift($_paths, $dir);\n\t\t\t}\n\t\t}\n\n\t\treturn $_paths;\n\t}", "public function addPath($module, $path)\n {\n $this->paths[$module] = $path;\n }", "public static final function prependPath($path)\n {\n\tif (!is_dir($path)) {\n \t throw new Exception(sprintf('Include path \"%s\" does not exists', $path));\n\t}\n\tarray_unshift(self::$_paths, $path);\n }", "public function add_path($rel_path)\n\t{\n\t\treturn ninja::add_path($rel_path);\n\t}", "function addInclude($path,$eval = true) {\n\t\t $this->Open();\n\t\t if ($eval) {\t\t \t\t \n\t\t $this->Stream .= 'include('.$this->prepareVariableString($path).');'.chr(10);\n\t\t \n\t\t } else {\t\t \n\t\t $this->Stream .= 'include($'.$value.');'.chr(10);\n\t\t } \n\t\t}", "static public function registerPath($path)\r\n {\r\n self::$paths[] = $path;\r\n }", "public static function addIncludePath($path = '')\n\t{\n\t\tstatic $paths;\n\n\t\tif (!isset($paths))\n\t\t{\n\t\t\t$paths = array();\n\t\t}\n\t\tif (!empty($path) && !in_array($path, $paths))\n\t\t{\n\t\t\ttinclude('core.filesystem.path');\n\t\t\tarray_unshift($paths, TPath::clean($path));\n\t\t}\n\t\treturn $paths;\n\t}", "public static function setIncludePath($path)\r\n\t{\r\n\t if (func_num_args()==1) {\r\n\t if (is_array($path)) $paths=$path;\r\n else $paths=array($path);\r\n\t }\r\n\t else {\r\n\t $paths=array();\r\n foreach (func_get_args() as $arg) {\r\n if (is_array($arg)) $paths=array_merge($paths, $arg);\r\n else $paths[]=$arg;\r\n }\r\n\t }\r\n\t $includePath=implode(self::getPathSeparator(), $paths);\r\n\t return set_include_path($includePath);\r\n\t}", "public function addPath($path)\n {\n $incpath = explode(PATH_SEPARATOR, get_include_path());\n if (!in_array($path, $incpath) && file_exists($path)) {\n set_include_path(get_include_path() . PATH_SEPARATOR . $path);\n }\n return self::$_instance;\n }", "public static function addIncludePath($path = '')\n\t{\n\t\tstatic $paths;\n\n\t\tif (!isset($paths))\n\t\t{\n\t\t\t$paths = array();\n\t\t}\n\t\tif (!empty($path) && !in_array($path, $paths))\n\t\t{\n\t\t\tjimport('joomla.filesystem.path');\n\t\t\tarray_unshift($paths, JPath::clean($path));\n\t\t}\n\t\treturn $paths;\n\t}", "public function addPath(string $path)\n {\n $this->path[] = $path;\n\n return $this;\n }", "public static function appendToIncludePath($path)\r\n {\r\n $paths=array(get_include_path());\r\n foreach (func_get_args() as $arg) {\r\n if (is_array($arg)) $paths=array_merge($paths, $arg);\r\n else $paths[]=$arg;\r\n }\r\n return self::setIncludePath($paths);\r\n }", "public function addPath($path, array $descriptions = null);", "public static function addMergedPath($path) {\n\t\treturn Loader::addMergedPath($path);\n\t}", "public static function addIncludePath($path = '')\n\t{\n\t\tstatic $paths;\n\n\t\tif (!isset($paths))\n\t\t{\n\t\t\t$paths = array();\n\t\t}\n\n\t\tif (!empty($path) && !in_array($path, $paths))\n\t\t{\n\t\t\tjimport('joomla.filesystem.path');\n\t\t\tarray_unshift($paths, JPath::clean($path));\n\t\t}\n\n\t\treturn $paths;\n\t}", "public function withPath($path)\n {\n }", "public static function addContentTypeIncludePath($path = null)\r\n\t{\r\n\t\t// If the internal paths have not been initialised, do so with the base table path.\r\n\t\tif (empty(self::$_contentTypeIncludePaths))\r\n\t\t{\r\n\t\t\tself::$_contentTypeIncludePaths = JPATH_COMPONENT_ADMINISTRATOR . '/models/content_types';\r\n\t\t}\r\n\r\n\t\t// Convert the passed path(s) to add to an array.\r\n\t\tsettype($path, 'array');\r\n\r\n\t\t// If we have new paths to add, do so.\r\n\t\tif (!empty($path))\r\n\t\t{\r\n\t\t\t// Check and add each individual new path.\r\n\t\t\tforeach ($path as $dir)\r\n\t\t\t{\r\n\t\t\t\t// Sanitize path.\r\n\t\t\t\t$dir = trim($dir);\r\n\r\n\t\t\t\t// Add to the front of the list so that custom paths are searched first.\r\n\t\t\t\tif (!in_array($dir, self::$_contentTypeIncludePaths))\r\n\t\t\t\t{\r\n\t\t\t\t\tarray_unshift(self::$_contentTypeIncludePaths, $dir);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn self::$_contentTypeIncludePaths;\r\n\t}", "public function addPath(string $namespace, ?string $path = null): void\n {\n $this->twig->getLoader()->addPath($path, $namespace);\n }", "public function addTemplatePath( string $path )\n {\n $loader = $this->getTwig()->getEnvironment()->getLoader();\n $loader->addPath( ltrim($path, '/') );\n }", "public function addPath($path, $namespace = null)\n {\n $this->paths[$namespace] = $path;\n\n $viewRegistry = $this->renderer->getViewRegistry();\n $viewRegistry->appendPath($path);\n\n $layoutRegistry = $this->renderer->getLayoutRegistry();\n $layoutRegistry->appendPath($path);\n }", "public function withPath($path)\n {\n // TODO: Implement withPath() method.\n }", "public function withPath($path)\n {\n // TODO: Implement withPath() method.\n }", "public static function prependToIncludePath($path)\r\n {\r\n $paths=array();\r\n foreach (func_get_args() as $arg) {\r\n if (is_array($arg)) $paths=array_merge($paths, $arg);\r\n else $paths[]=$arg;\r\n }\r\n $paths[]=get_include_path();\r\n return self::setIncludePath($paths);\r\n }", "public function addImportPath(string $strImportPath): void\n {\n $path = $this->dirExists($strImportPath);\n\n if ($path)\n {\n $this->importPaths[] = $path;\n }\n }", "function addFile($path)\n {\n }", "public function addPath(string $path, string $namespace = null): void\n {\n if (! $namespace) {\n $this->blade->getFinder()->addLocation($path);\n\n return;\n }\n $this->blade->getFinder()->addNamespace($namespace, $path);\n }", "public function addClassPath( &$path ) {\n\t\n\t\tif ( in_array( $path, self::$paths ))\n\t\t\treturn $this;\n\t\t\t\n\t\tself::$paths[] = $path;\n\t\t\n\t\treturn $this;\n\t}", "public function addPath(string $path, $namespace = null)\r\n {\r\n $this->twig->getLoader()->addPath($path, $namespace);\r\n }", "public function prependPath(string $path) : EngineInterface;", "static public function prependIncludePath($path)\r\n {\r\n \tset_include_path(\r\n \t\t$path . PATH_SEPARATOR . \r\n \t\tget_include_path()\r\n \t);\r\n }", "public function addSlash($path) {\n $path = substr($path, strlen($path) - 1, 1) == \"/\" ? $path : $path . \"/\";\n return $path;\n }", "public function addFile($path)\n {\n $this->files[] = $path;\n }", "function PclZipUtilPathInclusion($p_dir, $p_path)\n {\n }", "public function addQueryToPath() {\r\n\t\t$this->path = '/' . preg_replace('/^\\/+|\\/+$/', '', $this->path);\r\n\t\tif ($this->query) {\r\n\t\t\t$this->path .= '?' . http_build_query($this->query);\r\n\t\t}\r\n\t}", "public function setPath( $path );", "public function include_json_folder($path = '')\n {\n }", "public function add_include($include)\n \t{\n \t\t$this->includes[$include]=$include;\n \t}", "public function addInclude($include, $type = NULL) {\n if ($type == NULL) {\n $ext = explode('.', $include);\n $type = $ext[count($ext) - 1];\n }\n $this->includes[] = array('path' => $include, 'type' => $type);\n }", "public function addJsonPath(string $path): void\n {\n $this->jsonPaths[] = $path;\n }", "public function addPath(string $path, ?string $namespace = null) : void\n {\n $this->loader->addPath($path, $namespace);\n }", "private function _prependDirectory($path)\n {\n return strtr(\n $this->_element->getName() . '/' . $path, array('//' => '/')\n );\n }", "public static function addTemplatePath ($path, $prefix, $priorize = false)\n\t{\n\t\tadd_to_template_path ($path, $priorize, $prefix);\n\t}", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function setPath($path);", "public function addTestFilePath($path) {\n /*\n * Do not add the path if\n * . This is not a test.\n * . The path is not a valid path.\n * . The path already exists as a test path.\n * . The path is not a file.\n */\n if (!WPCCrawler::isDoingTest() ||\n !$path ||\n in_array($path, $this->testFilePaths) ||\n !Factory::fileSystem()->isFile($path)\n ) {\n return;\n }\n\n $this->testFilePaths[] = $path;\n }", "public function addPathElement($element)\n {\n $element = (array)$element;\n array_unshift($element, rtrim($this->path, DIRECTORY_SEPARATOR));\n return implode(DIRECTORY_SEPARATOR, $element);\n }", "public function appendPath(string $path) : EngineInterface;", "public function getAdditionalSearchPath() {}", "static public function addSlash($path) {\n $path = substr($path, strlen($path)-1, 1) == \"/\" ? $path : $path.\"/\";\n return $path;\n }", "public function addTemplatePath($templatePath)\n\t{\n\t\t$this->templatePath[] = $templatePath;\n\t}", "public function setPath($path){ }", "function insert($path) {\n\tinclude('views/' . $path . '.php');\n}", "public function getIncludePath()\n {\n return $this->includePath;\n }", "protected function addPath($user_id, $file_path) {\n\t\t$sql = \"INSERT INTO csv_meta_paths(user_id, path) VALUES(?, ?)\";\n\t\t$fields = Yii::app()->db->createCommand($sql)\n\t\t\t->execute(array($user_id, $file_path));\n\t}", "public static function addSource($path)\n\t{\n\t\tif (!\\in_array($path, self::$oz_sources_dir) && !\\in_array($path, self::$app_sources_dir)) {\n\t\t\tif (!\\is_dir($path)) {\n\t\t\t\tthrow new InvalidArgumentException(\\sprintf('Invalid directory: %s', $path));\n\t\t\t}\n\n\t\t\tif (\\strpos($path, OZ_OZONE_DIR) === 0) {\n\t\t\t\tself::$oz_sources_dir[] = $path;\n\t\t\t} else {\n\t\t\t\tself::$app_sources_dir[] = $path;\n\t\t\t}\n\t\t}\n\t}", "public function testIsPathIncludedForSpecifiedIncludePaths()\n {\n /** @var ContainerInterface $container */\n $container = $this->container;\n $analyzer = (new Factory())->createParametersAnalyzer($this->parameters, $container);\n\n $type = 'type';\n\n $this->assertTrue($analyzer->isPathIncluded('some.path', $type));\n $this->assertTrue($analyzer->isPathIncluded('some', $type));\n $this->assertFalse($analyzer->isPathIncluded('some.path.plus', $type));\n $this->assertFalse($analyzer->isPathIncluded('completely.different', $type));\n }", "function set_path($path) \n {\n $this->path = \"/\" . trim($path, \"/\");\n }", "static function addPath(string $controllersFolder) {\n\t\t$_paths[] = $controllersFolder;\n\t}", "function appendIncludePath( $pPath ) {\n\t\tif( !function_exists( \"get_include_path\" ) ) {\n\t\t\tinclude_once(UTIL_PKG_PATH . \"PHP_Compat/Compat/Function/get_include_path.php\");\n\t\t}\n\t\tif( !defined(\"PATH_SEPARATOR\" ) ) {\n\t\t\tinclude_once(UTIL_PKG_PATH . \"PHP_Compat/Compat/Constant/PATH_SEPARATOR.php\");\n\t\t}\n\t\tif( !function_exists( \"set_include_path\" ) ) {\n\t\t\tinclude_once(UTIL_PKG_PATH . \"PHP_Compat/Compat/Function/set_include_path.php\");\n\t\t}\n\n\t\t$include_path = get_include_path();\n\t\tif( $include_path ) {\n\t\t\t$include_path .= PATH_SEPARATOR . $pPath;\n\t\t} else {\n\t\t\t$include_path = $pPath;\n\t\t}\n\t\treturn set_include_path( $include_path );\n\t}", "function addPath($type, $dir)\n {\n $dir = $this->fixPath($dir);\n if (! isset($this->path[$type])) {\n $this->path[$type] = array($dir);\n } else {\n array_unshift($this->path[$type], $dir);\n }\n }", "public function setPath( $path )\n {\n $this->path = us($path);\n }", "public static function addIconPath($path) {\n\t\tstatic::$iconPaths[] = $path;\n\t}", "public static function register($name, $path) {\n static::$paths[$name] = rtrim($path, '/');\n }", "public function set_path($path)\n\t{\n\t\t$this->route_stack[self::SEG_PATH] = $path;\n\t}", "public function addPath(string $path)\n {\n return new self(\\array_merge($this->paths, [$path]), $this->names, $this->shortCircuit, $this->fileEncoding);\n }", "public function getPath($path);", "function setPath($inParamValue) {\n\t\treturn $this->setParam(self::PARAM_PATH, $inParamValue);\n\t}", "public function check_added_path($path){\n\t\t$path = Url::resolve_relative($path);\n\t\tif(isset($this->added_paths[$path])){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function push($path)\n\t{\n\t\t$parts = AgaviArrayPathDefinition::getPartsFromPath($path);\n\t\t$this->parts = array_merge($this->parts, $parts['parts']);\n\t}", "function set_path($path, $value) {\n\t$GLOBALS['laravel_paths'][$path] = $value;\n}", "public function set_path($path) {\n $this->path = $path;\n }", "private function setPath($path) {\n return;\n }", "function set_path($path, $value)\n{\n\t$GLOBALS['laravel_paths'][$path] = $value;\n}", "public function path($path = null);", "public function path($path = null);", "public function setIncludePath($includePath)\n {\n $this->includePath = $includePath;\n }", "function add_resource_dir($path,$url,$append_nc=true,$ext=false)\n{\n $url = buildQuery($url);\n if( !$ext ) $ext = RESOURCE_EXTENSIONS;\n $GLOBALS['CONFIG']['resources'][] = compact('ext','path','url','append_nc');\n}", "public function setPath($path = '');", "public static function setPath($path)\n {\n }", "public function setPath()\n {\n $this->path = $this->getNamespace() . $this->getControllerName();\n }", "public function addFile($file)\n {\n $this->paths[] = $file;\n }", "public function setPath( $val ) { $this->__set('path', $val); }", "function prepend_resource_dir($path,$url,$append_nc=true,$ext=false)\n{\n $url = buildQuery($url);\n if( !$ext ) $ext = RESOURCE_EXTENSIONS;\n if( !isset($GLOBALS['CONFIG']['resources']) )\n $GLOBALS['CONFIG']['resources'] = [];\n array_unshift($GLOBALS['CONFIG']['resources'],compact('ext','path','url','append_nc'));\n}", "public static function addClassPath($path) {\n $includes = explode(PATH_SEPARATOR, get_include_path());\n if (!is_array($path)) {\n $path = array($path);\n }\n foreach ($path as $p) {\n if (!in_array($p, $includes)) {\n array_unshift($includes, $p);\n }\n }\n @set_include_path(implode(PATH_SEPARATOR, $includes));\n }", "public function setPath($path)\r\n\t{\r\n\t\t$this->path=$path;\r\n\t}", "public function setPath($path)\n {\n $this->path = $path;\n }", "public function setPath($path)\n {\n $this->path = $path;\n }", "public function setPath($path)\n {\n $this->path = $path;\n }" ]
[ "0.74964696", "0.74964696", "0.693024", "0.69279706", "0.6847316", "0.67615354", "0.65598166", "0.64676046", "0.64571995", "0.64346045", "0.6324656", "0.6312328", "0.6308964", "0.62577605", "0.62532866", "0.6245961", "0.6182269", "0.6158436", "0.6115531", "0.6113915", "0.60841274", "0.60768086", "0.6058361", "0.60457206", "0.6030837", "0.6008836", "0.5977418", "0.593988", "0.5925813", "0.5925278", "0.5903045", "0.5903045", "0.586643", "0.58277005", "0.5827616", "0.580986", "0.58013046", "0.5799191", "0.5742137", "0.57391065", "0.57026833", "0.5673547", "0.56679934", "0.5663185", "0.56576663", "0.5625819", "0.56179065", "0.56169546", "0.5554618", "0.5547935", "0.5530785", "0.5524924", "0.5522501", "0.5522501", "0.5522501", "0.5522501", "0.55053025", "0.54810077", "0.5475203", "0.54700917", "0.5467542", "0.5465204", "0.54649836", "0.5456624", "0.5450363", "0.5448233", "0.54449904", "0.5424992", "0.54220843", "0.5409527", "0.5404643", "0.5379335", "0.5362364", "0.53614396", "0.53521544", "0.53441846", "0.533217", "0.53121805", "0.5311226", "0.5303024", "0.5290269", "0.5288959", "0.52841645", "0.52797866", "0.5271273", "0.52664334", "0.52664334", "0.5263627", "0.5260163", "0.5258281", "0.525801", "0.5242534", "0.52329123", "0.5228973", "0.52261674", "0.5215739", "0.5206365", "0.5200315", "0.5200315", "0.5200315" ]
0.6469571
7
retrieve the current subdomain
function getSubdomain() { global $CONFIG; if(!$CONFIG->Subdomains->Top_domain) return false; $matches = array(); preg_match('#^(www\.)?([^\.]+)\.'.str_replace('.', '\.', $CONFIG->Subdomains->Top_domain).'#', $_SERVER['HTTP_HOST'], $matches); if(count($matches)>0) { return $matches[2]; } else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSubdomain()\n {\n return $this->subdomain;\n }", "public function subDomain(): DomainName;", "function get_cur_domain()\n{\n}", "public function get_shop_subdomain( )\r\n\t {\r\n\t\t //use defined in index.php, if not available extract ot ourselves\r\n\t \t return ( defined('SHOP_SUBDOMAIN') ? SHOP_SUBDOMAIN : SHOP_DOMAIN );\r\n\t }", "function cacheplugin_subdomain() {\r\n\t\t$cachepageURL = $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';\r\n\t\t$cachepageURL .= $_SERVER['SERVER_PORT'] != '80' ? $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"] : $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\r\n\t\t$cacheparsedUrl = parse_url($cachepageURL);\r\n\t\t$cachehost = explode('.', $cacheparsedUrl['host']);\r\n\treturn $cachehost[0];\r\n\t}", "public function get_domain()\r\n\t\t{\r\n\t\t\treturn $_SERVER[ 'SERVER_NAME' ];\r\n\t\t}", "public function getDomain(){\n\t\treturn $_SERVER['SERVER_NAME'];\n\t}", "public function getSubdomainLog()\n {\n return $this->session->get('subdomain-child');\n }", "function getSubDomain()\n{\n\t// return $referrer;\n\n if(isset($_SERVER['HTTP_REFERER'])) {\n\n \t$url = $_SERVER['HTTP_REFERER'];\n \t$parsedUrl = parse_url($url);\n \t$host = explode('.', $parsedUrl['host']);\n \t$schoolSubdomain = $host[0];\n\t\t\tif($schoolSubdomain == \"documentation\"){$schoolSubdomain = 'dev2';}\n \t// var_dump($schoolSubdomain); // echo's school subdomain eg \"dev\"\n \treturn $schoolSubdomain;\n\n }\n else\n {\n\t\t//it was not sent, perform your default actions here\n\t\t// $referrer = ( isset($_SERVER['HTTP_X_SCHOOL_IDENTIFIER']) ? $_SERVER['HTTP_X_SCHOOL_IDENTIFIER'] : '');\n\t\t// return $referrer;\n\t\t\t if(isset($_SERVER['HTTP_X_SCHOOL_IDENTIFIER'])){\n\t\t\t\t $referrer = ( isset($_SERVER['HTTP_X_SCHOOL_IDENTIFIER']) ? $_SERVER['HTTP_X_SCHOOL_IDENTIFIER'] : '');\n\t\t\t\t return $referrer;\n\t\t\t }elseif(isset($_SERVER['HTTP_ORIGIN'])){\n\t\t\t\t $url = $_SERVER['HTTP_ORIGIN'];\n\t\t\t\t $parsedUrl = parse_url($url);\n\t\t\t\t $host = explode('.', $parsedUrl['host']);\n\t\t\t\t $schoolSubdomain = $host[0];\n\t\t\t\t return $schoolSubdomain;\n\t\t\t }\n // note that the above initiates OPTIONS request which is vulnerable\n }\n\t/*\n\t$referrer = ( isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'http://hog.eduweb.localhost/');\n\t$data = explode('.', $referrer); // Get the sub-domain here\n\n\n\t Add some sanitization for $data\n\n\tif (!empty($data[0])) {\n\t\t$subdomain = substr($data[0], strpos($data[0], '//') + 2 ); // The * of *.mydummyapp.com will be now stored in $subdomain\n\t}\n\treturn $subdomain;\n\t*/\n}", "function curr_url_domain()\n{\n return Request::root(true);\n}", "public function getDomain()\n {\n return Session::get(self::DOMAIN) ?? self::$domain;\n }", "function ajan_core_get_root_domain() {\n\n\t$domain = get_home_url( ajan_get_root_blog_id() );\n\n\treturn apply_filters( 'ajan_core_get_root_domain', $domain );\n}", "public function get_domain()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->_load_config();\n\n $domain = (empty($this->config['domain'])) ? '' : $this->config['domain'];\n\n if (empty($domain))\n $domain = $this->convert_domain();\n\n return $domain;\n }", "function domain()\n{\n return $_SERVER['HTTP_HOST'];\n}", "private function getRootDomain()\n\t{\n\t\t$host = $_SERVER['HTTP_HOST'];\n\t\t$parts = explode('.', $host);\n\t\tif(count($parts)>1){\n\t\t\t$tld = array_pop($parts);\n\t\t\t$domain = array_pop($parts).'.'.$tld;\n\t\t} else {\n\t\t\t$domain = array_pop($parts);\n\t\t}\n\t\treturn '.'.$domain;\n\t}", "function get_domain()\n{\n global $SITE_INFO;\n $ret = (!empty($SITE_INFO['domain'])) ? $SITE_INFO['domain'] : '';\n\n // Ah, no explicit setting, so derive...\n if ($ret == '') {\n // Derive from base URL\n if (!empty($SITE_INFO['base_url'])) {\n $matches = array();\n if (preg_match('#://([^/\\#:]+)#', $SITE_INFO['base_url'], $matches) != 0) {\n return preg_replace('#^www\\.#', '', $matches[1]);\n }\n }\n\n // Derive from other possibilities. Note that we can't use cms_srv due to bootstrap order (it's in global3.php)\n if (!empty($_SERVER['HTTP_HOST'])) {\n return preg_replace('#^www\\.#', '', $_SERVER['HTTP_HOST']);\n }\n if (!empty($_ENV['HTTP_HOST'])) {\n return preg_replace('#^www\\.#', '', $_ENV['HTTP_HOST']);\n }\n if (function_exists('gethostname')) {\n return preg_replace('#^www\\.#', '', gethostname());\n }\n if (!empty($_SERVER['SERVER_ADDR'])) {\n return preg_replace('#^www\\.#', '', $_SERVER['SERVER_ADDR']);\n }\n if (!empty($_ENV['SERVER_ADDR'])) {\n return preg_replace('#^www\\.#', '', $_ENV['SERVER_ADDR']);\n }\n if (!empty($_SERVER['LOCAL_ADDR'])) {\n return preg_replace('#^www\\.#', '', $_SERVER['LOCAL_ADDR']);\n }\n if (!empty($_ENV['LOCAL_ADDR'])) {\n return preg_replace('#^www\\.#', '', $_ENV['LOCAL_ADDR']);\n }\n return 'localhost';\n }\n return $ret;\n}", "public function getDomain(): string;", "function getDomain()\n {\n }", "public function domainName()\n\t{\n\t\treturn isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];\n\t}", "function get_clean_basedomain()\n {\n }", "function associateSubdomain($sd=false) {\n if(!$sd) $sd = SUBDOMAIN;\n if($sd) {\n global $DB;\n return $DB->subdomains->getCell(array('subdomain' => $sd), 'assoc');\n } else {\n return 'frontpage';\n }\n}", "public function getDomain()\n\t{\n\t\treturn $this->activeDomain;\n\t}", "public function get_domain(): string\n {\n return $this->domain;\n }", "public function getDomain()\n {\n $hostParts = explode('.', $this->getHost());\n array_shift($hostParts);\n\n return implode('.', $hostParts);\n }", "public function get_external_domain(): string;", "static function get_multisite_tld() : string {\n\n $upper_level_domain = self::get_upper_level_domain( DOMAIN_CURRENT_SITE );\n\n if( DOMAIN_CURRENT_SITE !== $upper_level_domain ) {\n return $upper_level_domain;\n } else {\n // This is something like localhost and it can't be used\n throw new Exception(\"Error: DOMAIN_CURRENT_SITE:{$DOMAIN_CURRENT_SITE} is not valid for same level subdomain\");\n }\n }", "public function getDomain()\n {\n return textdomain();\n }", "private function register_subdomain() {\n\t$host = $_SERVER['HTTP_HOST'];\n\tif ($this->config->base_domain) $this->subdomain = preg_replace('/\\.'.$this->config->base_domain.'$/i', '', $host);\n\telse {\n\t\t$parts = explode('.', $host);\n\t\t// we're going to assume a single level tld, like .com, rather than a multi level tld, like .co.uk\n\t\tarray_pop($parts);\n\t\tarray_pop($parts);\n\t\t$this->subdomain = implode('.', $parts);\n\t}\n\tif (self::$force_www && !$this->subdomain) $this->subdomain = 'www';\n}", "protected function _domainName() {\n\t\t$this->CI->load->helper('url');\n\t $url = site_url();\n\t //$parse the url\n\t\t$host = parse_url( $url, PHP_URL_HOST );\n\t\t//reverse array\n\t\t$host = array_reverse( explode( '.', $host ) );\n\t\t//check in_array for .bd domain name\n\t\tif( in_array( 'bd', $host ) == True ) :\n\t\t\t$host = $host[2] . '.' . $host[1] . '.' . $host[0];\n\t\telseif( in_array( 'localhost', $host ) == true ) :\n\t\t\t$host = $host[0];\n\t\telse :\n\t\t\t$host = $host[1] . '.' . $host[0];\n\t\tendif;\n\t\treturn $host;\n\t}", "public function getDomain(): string\r\n {\r\n return $this->domain;\r\n }", "public function domain()\n {\n return $this->protocol() . \"://\" . $this->host();\n }", "public function getDomain()\r\n {\r\n return $this->domain;\r\n }", "private function get_cookie_domain() {\n\t\t$requested_domain_parts = explode( '.', $_SERVER['HTTP_HOST'] );\n\t\t$cookie_domain = array_pop( $requested_domain_parts );\n\t\t$cookie_domain = '.' . array_pop( $requested_domain_parts ) . '.' . $cookie_domain;\n\n\t\treturn $cookie_domain;\n\t}", "public function getDomain(): string {\n return $this->context->domain;\n }", "function bpsGetDomainRootPrefix() {\n\n\tif ( isset( $_SERVER['SERVER_NAME'] ) ) {\n\n\t\t$ServerName = esc_html( $_SERVER['SERVER_NAME'] );\n\t\treturn $ServerName;\t\t\n\t\n\t} else {\n\t\t\n\t\t$ServerName = esc_html( $_SERVER['HTTP_HOST'] );\n\t\treturn $ServerName;\t\n\t}\n}", "public function getDomain(): string\n {\n return $this->domain;\n }", "public function getDomain(): string\n {\n return $this->domain;\n }", "public function getDomain()\n {\n return $this->domain;\n }", "public function getDomain()\n {\n return $this->domain;\n }", "public function getDomain()\n {\n return $this->domain;\n }", "public function getDomain()\n {\n return $this->domain;\n }", "public function getDomain()\n {\n return $this->domain;\n }", "public function getDomain()\n {\n return $this->domain;\n }", "public function getDomain()\n {\n return $this->domain;\n }", "public function getDomain()\n {\n return $this->domain;\n }", "function getDomain() {\n\t\treturn $this->domain;\n\t}", "public function getDomain()\n {\n return $this->_domain;\n }", "public function getDomain()\n {\n\n }", "function get_domain()\n\t{\n\t\t$http_host = $_SERVER['HTTP_HOST'];\n\t\t$DOC_ROOT = $_SERVER['DOCUMENT_ROOT'];\n\t\t$site_root = str_replace($DOC_ROOT, \"\", SITE_ROOT);\n\t\t// $win = str_replace(\"/\",\"\\\\\",$DOC_ROOT);\n\t\t$site_root = str_replace($DOC_ROOT,\"\",SITE_ROOT);\n\t\t$http_chunk = \"$http_host/$site_root/\";\n\t\treturn \"http://\".str_replace(\"//\", \"/\", $http_chunk);\n\t}", "public function getDomain()\n\t{\n\t\treturn $this->domain;\n\t}", "function get_cookie_domain()\n{\n global $SITE_INFO;\n $ret = array_key_exists('cookie_domain', $SITE_INFO) ? $SITE_INFO['cookie_domain'] : null;\n return ($ret == '') ? null : $ret;\n}", "public function getDomain() {\n return $this->domain;\n }", "public function secondLevelDomain(): DomainName;", "protected function getCookieDomain() {}", "public function getSiteDomain() {\n \n return $this->siteDomain;\n \n }", "public static function getDomain()\r\n\t{\r\n\t\t$port = $_SERVER['SERVER_PORT'];\r\n\t\t$port = ( $port == 80 ) ? '' : \":$port\";\r\n\t\treturn 'http://' . $_SERVER['SERVER_NAME']. \"$port/\";\r\n\t}", "public static function domain()\n\t{\n\t\tif (isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']))\n\t\t{\n\t\t\treturn $_SERVER['SERVER_NAME'] . ((integer) $_SERVER['SERVER_PORT'] === 80 ? '' : ':' . $_SERVER['SERVER_PORT']);\n\t\t}\n\n\t\treturn null;\n\t}", "function get_current_domain($url=null) {\n $tld_dir = tld_list();\n // no url = our own host\n $url = isset($url) ? $url : $_SERVER['SERVER_NAME'];\n // add missing scheme ftp:// http:// ftps:// https://\n $url = !isset($url[5]) || ($url[3] != ':' && $url[4] != ':' && $url[5] != ':') ? 'http://' . $url : $url;\n // remove \"/path/file.html\", \"/:80\", etc.\n $url = parse_url($url, PHP_URL_HOST);\n // replace absolute domain name by relative (http://www.dns-sd.org/TrailingDotsInDomainNames.html)\n $url = trim($url, '.');\n // check if TLD exists\n $url = explode('.', $url);\n $parts = array_reverse($url);\n foreach ($parts as $key => $part) {\n $tld = implode('.', $parts);\n if (file_exists($tld_dir . $tld)) {\n return !$key ? '' : implode('.', array_slice($url, $key - 1));\n }\n // remove last part\n array_pop($parts);\n }\n return '';\n}", "protected function getDomain($url){\n // return static::DOMAIN;\n return parse_url($url, PHP_URL_HOST);\n }", "protected function negotiateActiveDomain() {\n $httpHost = $this->negotiateActiveHostname();\n $this->setRequestDomain($httpHost);\n return $this->domain;\n }", "public function getDomain(): ?string\n {\n return $this->sDomain;\n }", "function get_domain_url()\n{\n static $url = NULL;\n if (NULL === $url) {\n $is_ssl = isset($_REQUEST['is_ssl']) ? $_REQUEST['is_ssl'] : is_ssl();\n $protocol = $is_ssl ? 'https://' : 'http://';\n $url = $protocol . $_SERVER['HTTP_HOST'];\n }\n return $url;\n}", "public static function subdomains()\n\t{\n\t\t$domains = self::_getConfigArray();\n\t\tarray_pop($domains);\n\t\t// Config contained only a single domain (\".com\")\n\t\tif (is_null($domains))\n\t\t{\n\t\t\t$domains = [];\n\t\t\treturn $domains;\n\t\t}\n\n\t\t// Config contained no subdomains (\"example.com\")\n\t\tarray_shift($domains);\n\t\tif (is_null($domains))\n\t\t{\n\t\t\t$domains = [];\n\t\t\treturn $domains;\n\t\t}\n\n\t\treturn $domains;\n\t}", "public function getHomeDomain()\n {\n $result = parse_url($this->url);\n return $result['scheme'] . \"://\" . $result['host'];\n }", "function kopa_get_domain() {\n\tif ( defined( 'KOPA_DOMAIN' ) ) {\n\t\treturn KOPA_DOMAIN;\n\t}\n\n\treturn 'kopa-framework';\n}", "protected function load_domain_channel() {\n\t\n\t\t$splits = explode(\".\",@$_SERVER['SERVER_NAME']);\n $this->current_domain = @$_SERVER['SERVER_NAME'];\n\t\tif (count($splits) > 3) {\n\t\t\t/* \n\t\t\tif the current url is a channel subdomain , get the channel id \n\t\t\t*/\n\t\t\t$this->main_domain = $splits[1].\".\".$splits[2].\".\".$splits[3];\n\t\t\t$this->channel = ORM::factory('channel')\n\t\t\t->where(\"code\",\"=\",$splits[0])\n\t\t\t->find();\n\t\t\t//If there is no such channel redirect to main domain.\n\t\t\n\t\t\tif (!$this->channel->loaded()) {\n\t\t\t\t$this->request->redirect(\"http://{$this->main_domain}\");\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t$this->main_domain = $splits[0].\".\".$splits[1].\".\".$splits[2];\n\t\t}\n\t\t\n\t}", "function getDomain() {\n\t\treturn $this->getAttribute(DOMIT_RSS_ATTR_DOMAIN);\n\t}", "function getDomain() {\n\t\treturn $this->getAttribute(DOMIT_RSS_ATTR_DOMAIN);\n\t}", "public function getHost(bool $removeSubDomains = FALSE): ?string {\n\t\t$host = $this->host;\n\n\t\t$hostWithoutSubDomain = NULL;\n\t\t$subDomains = explode('.', $this->host);\n\n\t\tcount($subDomains) >= 2 && $removeSubDomains ? $hostWithoutSubDomain = implode('.',\n\t\t\t[\n\t\t\t\tOpton::get(count($subDomains) - 2, $subDomains),\n\t\t\t\tOpton::get(count($subDomains) - 1, $subDomains),\n\t\t\t]) : NULL;\n\n\t\treturn $removeSubDomains ? $hostWithoutSubDomain : $host;\n\t}", "function ms_load_current_site_and_network($domain, $path, $subdomain = \\false)\n {\n }", "public function getDomain()\n {\n return $this->apiDomain;\n }", "public function getDomain(): string\n {\n /** @var WebstoreHelper $webstoreHelper */\n $webstoreHelper = pluginApp(WebstoreHelper::class);\n\n return $webstoreHelper->getCurrentWebstoreConfiguration()->domainSsl;\n }", "public function getMainDomain($step = null) {\n $parts = explode('.', $this->hostName);\n $count = sizeof($parts);\n if ($step === null) {\n $step = \\TS_Functions::getCookiesDomainLevel();\n }\n if ($count >= $step) {\n $return = array();\n while ($step > 0) {\n $return[] = $parts[$count - $step];\n $step--;\n }\n\n return implode('.', $return);\n }\n return null;\n }", "static public function get_cdn_domain( $path = '' ) {\n\t\t$cdncommon = Dispatcher::component( 'Cdn_Core' );\n\t\t$cdn = $cdncommon->get_cdn();\n\t\treturn $cdn->get_domain( $path );\n\t}", "public function domain()\n {\n return $this->context->getDomainManager();\n }", "function domains() {\n\t \treturn $this->hook(\"/{$this->subject_slug}/v1/domains.xml?api_key={$this->api_key}\",\"domain\");\n\t}", "public function getDomain()\n\t{\n\t\treturn substr(strrchr($this->email, \"@\"), 1);\n\t}", "public function checkSubDomain()\n {\n $subdomain = Input::get('subdomain');\n if($this->_isValidSubDomain($subdomain))\n echo 'valid';\n else\n echo 'invalid';\n\n exit;\n }", "function domain_name_human(){\n\techo $_SERVER['SERVER_NAME'];\n\treturn;\n}", "public function getDomain()\n {\n return 'example.test';\n }", "public static function hostNameDomain() {\n\t\tif (!isset($_SERVER['HTTP_HOST'])) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ($_SERVER['HTTP_HOST'] == $_SERVER['REMOTE_ADDR']) {\n\t\t\treturn $_SERVER['REMOTE_ADDR'];\n\t\t}\n\n\t\t$domain = explode('.', $_SERVER['HTTP_HOST']);\n\t\t$size = count($domain);\n\n\t\tif ($size <= 2) {\n\t\t\treturn $_SERVER['HTTP_HOST'];\n\t\t} else {\n\t\t\treturn \"{$domain[$size -2]}.{$domain[$size -1]}\";\n\t\t}\n\t}", "public function getBySubdomain($subdomain)\n {\n \treturn $this->where('subdomain', $subdomain)-first();\n }", "public function getDomain()\n {\n if (!$this->_domain) {\n try {\n $this->_domain = \\Ca\\Db\\DomainMap::create()->find($this->getDomainId());\n } catch (\\Exception $e) {}\n }\n return $this->_domain;\n }", "public function domainOfURL()\n {\n $urlDetails = parse_url($this->url);\n return $urlDetails['host'] ?? $this->shortUrl(20);\n }", "public function domain($subdomain = false, $honor_full_domain = false) {\n\n\t\t/**\n\t\t * Return the full domain + subdomain. If you want to prepend the subdomain to the entire\n\t\t * domain, make sure to pass the second param as true. (Warning this could result in \n\t\t * returning 'subdomain.www.domain.com' rather than 'subdomain.domain.com'!!!)\n\t\t */\n\t\tif(is_numeric($subdomain)) {\n\t\t\t$level = (int) $subdomain;\n\t\t\t$domain = array();\n\t\t\tfor($i=1;$i<=$level;$i++) {\n\t\t\t\t$domain[] = $this->domain[$i];\n\t\t\t}\n\t\t\t$domain = array_reverse($domain);\n\t\t\t$domain = implode('.',$domain);\n\t\t\treturn $domain;\n\t\t}\n\t\tif(is_string($subdomain) && strlen($subdomain) > 0) {\n\t\t\tif($honor_full_domain)\n\t\t\t\treturn rtrim($subdomain, '.') . '.' . $this->rawDomain;\n\t\t\telse\n\t\t\t\treturn implode('.', array($subdomain, $this->domain[2], $this->domain[1]));\n\t\t}\n\n\t\t/**\n\t\t * Return the current raw domain, whatever it is.\n\t\t */\n\t\telse\n\t\t\treturn $this->rawDomain;\n\t}", "public function getDomain()\n {\n if(!($domainId = $this->getData('domainId'))) {\n return null;\n }\n \n return Core_Model_DiFactory::getDomainManager()->getDomain($domainId);\n }", "public function getHost() {\n \n\n\t\treturn $_SERVER[\"HTTP_HOST\"];\n }", "function ms_subdomain_constants()\n {\n }", "public function getDomain($includeProtocol = TRUE)\n\t{\n\t\t$domain\t\t= $_SERVER['SERVER_NAME'];\n\t\t$domain \t= rtrim(\\Config::get('mediamanager.domain', $domain), '/');\n\n\t\treturn ($includeProtocol ? $this->getProtocol() : '') . $domain;\n\t}", "public static function getDomain()\n {\n $serverName = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : null;\n // CORS\n /*if (isset($_SERVER['HTTP_ORIGIN'])) {\n return $_SERVER['HTTP_ORIGIN'];\n }*/\n if (!$serverName) {\n // when in cli mode\n return null;\n }\n\n if (substr($serverName, 0, strLen(self::PUNYCODE_PREFIX)) == self::PUNYCODE_PREFIX) {\n $convertor = new \\Bazalt\\Site\\IDNConvertor(array('idn_version' => 2008));\n $serverName = $convertor->decode($serverName);\n }\n // If server name has port number attached then strip it\n $colon = strpos($serverName, ':');\n if ($colon) {\n $serverName = substr($serverName, 0, $colon);\n }\n $serverName .= !self::needPortInDomain() ? '' : ':' . $_SERVER['SERVER_PORT'];\n\n return self::getProtocol() . $serverName;\n }", "public function getGitlabDomain (): string {\n\t\t$config = $this->getOauthProviderConfig();\n\n\t\treturn $config['options']['domain'];\n\t}", "public function getSiteHost();", "function siteURL()\n{\n $protocol = 'http://';\n $domainName = $_SERVER['HTTP_HOST'].'/';\n return $protocol.$domainName;\n}", "public function get_site_data( $shop_subdomain )\r\n\t {\r\n\t\t return $this->php_session->get( 'shop_' . $shop_subdomain );\r\n\t }", "public function user_host()\n {\n return $this->server('HTTP_HOST');\n }", "public static function getDomain()\n {\n if (!isset($_SERVER['SERVER_NAME'])) {\n // when in cli mode\n return null;\n }\n $serverName = $_SERVER['SERVER_NAME'];\n\n if (substr($serverName, 0, 4) == self::PUNYCODE_PREFIX) {\n $convertor = new Core_IDNConvertor(array('idn_version' => 2008));\n $serverName = $convertor->decode($serverName);\n }\n // If server name has port number attached then strip it\n $colon = strpos($serverName, ':');\n if ($colon) {\n $serverName = substr($serverName, 0, $colon);\n }\n $serverName .= !self::needPortInDomain() ? '' : ':' . $_SERVER['SERVER_PORT'];\n\n return $serverName;\n }", "public function getServerUrl()\n { \n return $this->_shoptimallyDomain;\n }", "private function site_url()\n\t{\n\t\t$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443)\n\t\t\t? \"https://\"\n\t\t\t: \"http://\";\n\t\t$domainName = $_SERVER['HTTP_HOST'];\n\n\t\treturn $protocol.$domainName;\n\t}", "function domain_get($key=NULL){\n if(is_null($key)) return NULL;\n if(is_null($key)) $key = $this->cumd;\n return isset($this->domains[$key])?$this->domains[$key]:NULL;\n }", "public static function getCurrentDomain(array $source = null)\n {\n if ( $source === null ) $source = $_SERVER;\n\n $domain = '';\n\n if(isset($source['HTTP_HOST']))\n {\n $domain = $source['HTTP_HOST'];\n }\n else\n {\n $domain = $source['SERVER_NAME'];\n if ( isset( $source['SERVER_PORT'] ) && $source['SERVER_PORT'] != 80 )\n {\n $domain .= \":{$source['SERVER_PORT']}\";\n }\n }\n\n return self::cleanDomainString($domain);\n }" ]
[ "0.8060156", "0.8002409", "0.78359175", "0.7654268", "0.74567926", "0.74526894", "0.7223552", "0.71472293", "0.71439236", "0.709944", "0.7040451", "0.703854", "0.69610935", "0.69498837", "0.6947203", "0.6905553", "0.6895081", "0.6882151", "0.6850362", "0.68237495", "0.68202627", "0.6803296", "0.67994714", "0.67600644", "0.67488545", "0.6712647", "0.6699251", "0.66956884", "0.66879326", "0.6685863", "0.6673136", "0.66543657", "0.6653572", "0.6637788", "0.6636243", "0.66193545", "0.66193545", "0.6595813", "0.6595813", "0.6595813", "0.6595813", "0.6595813", "0.6595813", "0.6595813", "0.6595813", "0.6589136", "0.65739006", "0.653437", "0.6519942", "0.6508402", "0.64968884", "0.6494478", "0.6469589", "0.64549565", "0.6446635", "0.6440123", "0.643911", "0.6426126", "0.640258", "0.6394108", "0.63698137", "0.6343491", "0.63383013", "0.632612", "0.628038", "0.62748176", "0.62335134", "0.62335134", "0.6227235", "0.6222409", "0.6188612", "0.6185699", "0.6159615", "0.61593926", "0.61551887", "0.6135533", "0.61340463", "0.61258495", "0.61244935", "0.61187696", "0.61118627", "0.61067355", "0.6099056", "0.6092185", "0.6086553", "0.60856336", "0.60827684", "0.608154", "0.6073417", "0.6071366", "0.6069034", "0.6062493", "0.60582656", "0.60568976", "0.6047436", "0.60343647", "0.6028849", "0.6018111", "0.60169613", "0.6009734" ]
0.79776525
2
Associate the current subdomain with it's set association
function associateSubdomain($sd=false) { if(!$sd) $sd = SUBDOMAIN; if($sd) { global $DB; return $DB->subdomains->getCell(array('subdomain' => $sd), 'assoc'); } else { return 'frontpage'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function register_subdomain() {\n\t$host = $_SERVER['HTTP_HOST'];\n\tif ($this->config->base_domain) $this->subdomain = preg_replace('/\\.'.$this->config->base_domain.'$/i', '', $host);\n\telse {\n\t\t$parts = explode('.', $host);\n\t\t// we're going to assume a single level tld, like .com, rather than a multi level tld, like .co.uk\n\t\tarray_pop($parts);\n\t\tarray_pop($parts);\n\t\t$this->subdomain = implode('.', $parts);\n\t}\n\tif (self::$force_www && !$this->subdomain) $this->subdomain = 'www';\n}", "function addAssociatedDomain( $fqdn ) {\n\t\tglobal $wgAuth;\n\n\t\t$associatedomains = array();\n\t\tif ( isset( $this->hostInfo[0]['associateddomain'] ) ) {\n\t\t\t$associatedomains = $this->hostInfo[0]['associateddomain'];\n\t\t\tarray_shift( $associatedomains );\n\t\t}\n\t\t$associatedomains[] = $fqdn;\n\t\t$values = array();\n\t\t$values['associateddomain'] = $associatedomains;\n\t\t$success = LdapAuthenticationPlugin::ldap_modify( $wgAuth->ldapconn, $this->hostDN, $values );\n\t\tif ( $success ) {\n\t\t\t$wgAuth->printDebug( \"Successfully added $fqdn to $this->hostDN\", NONSENSITIVE );\n\t\t\t$this->domain->updateSOA();\n\t\t\t$this->fetchHostInfo();\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$wgAuth->printDebug( \"Failed to add $fqdn to $this->hostDN\", NONSENSITIVE );\n\t\t\treturn false;\n\t\t}\n\t}", "public function withSubDomain(DomainName $subDomain): self;", "public function setSubdomain($subdomain)\n {\n $this->subdomain = $subdomain;\n }", "public function subDomain(): DomainName;", "public function subdomains($value) {\n return $this->setProperty('subdomains', $value);\n }", "public function canCreateSubdomains();", "public function auto_configure()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $current_domain = $this->get_domain();\n\n if (empty($current_domain)) {\n $domain = new Domain();\n $default_domain = $domain->get_default();\n\n if (!empty($default_domain))\n $this->set_domain($default_domain);\n }\n }", "function add() {\n\n\t\t/**\n\t\t * Check if DNS module is enabled.\n\t\t * Call \"Module\" component to check.\n\t\t * 'DNS' is the module name (check in database).\n\t\t */\n\t\t$this->Module->check('DNS');\n\n\t\t/**\n\t\t * Check if maintenance is on.\n\t\t * Call the \"Maintenance\" component to check.\n\t\t */\n\t\t$this->Maintenance->check();\n\n\t\t/**\n\t\t * Check if subdomain quota is not over.\n\t\t * If yes, the user see an error message.\n\t\t * Call the \"Quota\" component to check.\n\t\t */\n\t\t$this->Quota->check('Subdomain', 'subdomain');\n\n\t\tif (!empty($this->data)) {\n\n\t\t\t/**\n\t\t\t * Select the user ID of the domain owner.\n\t\t\t * @var array\n\t\t\t */\n\t\t\t$conditionUserId = array('conditions' => array('Domain.id' => $this->params['data']['Subdomain']['domain_id']));\n\t\t\t$queryUserDomainId = $this->Subdomain->Domain->find('first', $conditionUserId);\n\t\t\t\n\t\t\t/**\n\t\t\t * Split the subdomain string in an array. \n\t\t\t * @var array\n\t\t\t */\n\t\t\t$analyze = explode('.', $this->data['Subdomain']['name']);\n\n\t\t\t/**\n\t\t\t * Check if the domain name in the subdomain is the same than the domain name selected in the domains list.\n\t\t\t */\n\t\t\tif (isset($analyze['1']) && isset($analyze['2']) && $analyze['1'] . '.' . $analyze['2'] != $queryUserDomainId['Domain']['name']) {\n\t\t\t\t$this->Session->setFlash(__d('domain', 'Wrong domain name used in the subdomain name string.', true), 'default', array('class' => 'error'));\n\t\t\t\t$this->redirect(array('action' => 'add'));\n\t\t\t}\n\n\t\t\t$this->Subdomain->create();\n\n\t\t\t/**\n\t\t\t * Save new subdomain.\n\t\t\t */\n\t\t\tif ($this->Subdomain->save($this->data)) {\n\n\t\t\t\t/**\n\t\t\t\t * Insert the create action in the \"robot\" table.\n\t\t\t\t * The Perl robot will check in this table.\n\t\t\t\t */\n\t\t\t\t$this->Robot->insert($this->data['Subdomain']['name'], 'SUBDOMAIN', $this->Auth->user('name'), $this->Auth->user('email'), $this->data['Subdomain']['domain_id'], NULL, 1);\n\n\t\t\t\t/**\n\t\t\t\t * Insert the create action in the \"logs\" table.\n\t\t\t\t */\n\t\t\t\t$this->Logs->insert($this->Auth->user('id'), '<strong>[ ' . $this->data['Subdomain']['name'] . ' ]</strong> ' . __d('domain', 'The subdomain has been saved.', true) , 'DNS', $_SERVER[\"REMOTE_ADDR\"]);\n\n\t\t\t\t/**\n\t\t\t\t * Save the user ID.\n\t\t\t\t */\n\t\t\t\t$this->Subdomain->saveField('user_id', $this->Auth->user('id'));\n\n\t\t\t\t/**\n\t\t\t\t * If the new subdomain is saved, a success message is displayed.\n\t\t\t\t * Redirect to the index page.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('domain', 'The subdomain has been saved.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If the subdomain is not saved, an error message is displayed.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('domain', 'The subdomain has not been saved.', true), 'default', array('class' => 'error'));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Select all domains who belongs to the user.\n\t\t * Select by user ID.\n\t\t * @var array\n\t\t */\n\t\t$conditions = array('conditions' => array('Domain.user_id' => $this->Auth->user('id')));\n\t\t$domains = $this->Subdomain->Domain->find('list', $conditions);\n\n\t\t/**\n\t\t * Put all domains in \"$domains\".\n\t\t * $domains will be available in the view.\n\t\t */\n\t\t$this->set(compact('domains'));\n\n\t}", "public function canManageSubdomains();", "public function addDomainNameIntoHosts()\n {\n $this->addToHosts();\n $this->addToHostprofiles();\n }", "function setDomain($domain)\n {\n }", "function getAssociatedDomains() {\n\t\t$associateddomain = array();\n\t\tif ( isset( $this->hostInfo[0]['associateddomain'] ) ) {\n\t\t\t$associateddomain = $this->hostInfo[0]['associateddomain'];\n\t\t\tarray_shift( $associateddomain );\n\t\t}\n\n\t\treturn $associateddomain;\n\t}", "public function incrementDomains()\n {\n $this->domains[] = '';\n }", "function admin_add() {\n\n\t\tif (!empty($this->data)) {\n\n\t\t\t/**\n\t\t\t * Select the user ID of the domain owner.\n\t\t\t * @var array\n\t\t\t */\n\t\t\t$conditionUserId = array('conditions' => array('Domain.id' => $this->params['data']['Subdomain']['domain_id']));\n\t\t\t$queryUserDomainId = $this->Subdomain->Domain->find('first', $conditionUserId);\n\n\t\t\t/**\n\t\t\t * Select the user name and email of the domain owner.\n\t\t\t * @var array\n\t\t\t */\n\t\t\t$conditionUser = array('conditions' => array('User.id' => $queryUserDomainId['Domain']['user_id']));\n\t\t\t$queryUser = $this->Subdomain->User->find('first', $conditionUser);\n\t\t\t\n\t\t\t/**\n\t\t\t * Split the subdomain string in an array. \n\t\t\t * @var array\n\t\t\t */\n\t\t\t$analyze = explode('.', $this->data['Subdomain']['name']);\n\n\t\t\t/**\n\t\t\t * Check if the domain name in the subdomain is the same than the domain name selected in the domains list.\n\t\t\t */\n\t\t\tif (isset($analyze['1']) && isset($analyze['2']) && $analyze['1'] . '.' . $analyze['2'] != $queryUserDomainId['Domain']['name']) {\n\t\t\t\t$this->Session->setFlash(__d('domain', 'Wrong domain name used in the subdomain name string.', true), 'default', array('class' => 'error'));\n\t\t\t\t$this->redirect(array('action' => 'add'));\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Save new subdomain.\n\t\t\t */\n\t\t\t$this->Subdomain->create();\n\t\t\tif ($this->Subdomain->save($this->data)) {\n\n\t\t\t\t/**\n\t\t\t\t * Save the user ID.\n\t\t\t\t */\n\t\t\t\t$this->Subdomain->saveField('user_id', $queryUserDomainId['Domain']['user_id']);\n\n\t\t\t\t/**\n\t\t\t\t * Insert the create action in the \"robot\" table.\n\t\t\t\t * The Perl robot will check in this table.\n\t\t\t\t */\n\t\t\t\t$this->Robot->insert($this->data['Subdomain']['name'], 'SUBDOMAIN', $queryUser['User']['name'], $queryUser['User']['email'], $this->data['Subdomain']['domain_id'], NULL, 1);\n\n\t\t\t\t/**\n\t\t\t\t * Insert the create action in the \"logs\" table.\n\t\t\t\t */\n\t\t\t\t$this->Logs->insert($this->Auth->user('id'), '<strong>[ ' . $this->data['Subdomain']['name'] . ' ]</strong> ' . __d('domain', 'Subdomain added by (' . $this->Auth->user('name') . ') for (' . $queryUser['User']['name'] . ').', true) , 'DNS', $_SERVER[\"REMOTE_ADDR\"]);\n\n\t\t\t\t/**\n\t\t\t\t * If the new subdomain is saved, a success message is displayed.\n\t\t\t\t * Redirect to the index page.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('domain', 'The subdomain has been saved.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If the subdomain is not saved, an error message is displayed.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('domain', 'The subdomain has not been saved.', true), 'default', array('class' => 'error'));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Select all domains.\n\t\t * @var array\n\t\t */\n\t\t$domains = $this->Subdomain->Domain->find('list');\n\n\t\t/**\n\t\t * Put all domains in \"domains\".\n\t\t * $domains will be available in the view.\n\t\t */\n\t\t$this->set(compact('domains'));\n\n\t}", "function create_subdomain($subDomain,$cPanelUser,$cPanelPass,$rootDomain) { \n $domain = $rootDomain;\n $subdomain = $subDomain; \n $username = $cPanelUser;\n $password = $cPanelPass;\n $targetFolder = 'public_html/eazypaper'; \n \n $xmlapi = new xmlapi($domain );\n $xmlapi->set_port('2083');\n $xmlapi->password_auth($username, $password);\n $xmlapi->set_debug(0); // or you can use 1\n $xmlapi->set_output('xml'); // you can use 'json'\n $args = array($subdomain, $domain , 0, 0, $targetFolder);\n $res = $xmlapi->api1_query($username, 'SubDomain', 'addsubdomain', $args); \n }", "protected function registeringDomain()\n {\n }", "function getSubDomain()\n{\n\t// return $referrer;\n\n if(isset($_SERVER['HTTP_REFERER'])) {\n\n \t$url = $_SERVER['HTTP_REFERER'];\n \t$parsedUrl = parse_url($url);\n \t$host = explode('.', $parsedUrl['host']);\n \t$schoolSubdomain = $host[0];\n\t\t\tif($schoolSubdomain == \"documentation\"){$schoolSubdomain = 'dev2';}\n \t// var_dump($schoolSubdomain); // echo's school subdomain eg \"dev\"\n \treturn $schoolSubdomain;\n\n }\n else\n {\n\t\t//it was not sent, perform your default actions here\n\t\t// $referrer = ( isset($_SERVER['HTTP_X_SCHOOL_IDENTIFIER']) ? $_SERVER['HTTP_X_SCHOOL_IDENTIFIER'] : '');\n\t\t// return $referrer;\n\t\t\t if(isset($_SERVER['HTTP_X_SCHOOL_IDENTIFIER'])){\n\t\t\t\t $referrer = ( isset($_SERVER['HTTP_X_SCHOOL_IDENTIFIER']) ? $_SERVER['HTTP_X_SCHOOL_IDENTIFIER'] : '');\n\t\t\t\t return $referrer;\n\t\t\t }elseif(isset($_SERVER['HTTP_ORIGIN'])){\n\t\t\t\t $url = $_SERVER['HTTP_ORIGIN'];\n\t\t\t\t $parsedUrl = parse_url($url);\n\t\t\t\t $host = explode('.', $parsedUrl['host']);\n\t\t\t\t $schoolSubdomain = $host[0];\n\t\t\t\t return $schoolSubdomain;\n\t\t\t }\n // note that the above initiates OPTIONS request which is vulnerable\n }\n\t/*\n\t$referrer = ( isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'http://hog.eduweb.localhost/');\n\t$data = explode('.', $referrer); // Get the sub-domain here\n\n\n\t Add some sanitization for $data\n\n\tif (!empty($data[0])) {\n\t\t$subdomain = substr($data[0], strpos($data[0], '//') + 2 ); // The * of *.mydummyapp.com will be now stored in $subdomain\n\t}\n\treturn $subdomain;\n\t*/\n}", "protected function load_domain_channel() {\n\t\n\t\t$splits = explode(\".\",@$_SERVER['SERVER_NAME']);\n $this->current_domain = @$_SERVER['SERVER_NAME'];\n\t\tif (count($splits) > 3) {\n\t\t\t/* \n\t\t\tif the current url is a channel subdomain , get the channel id \n\t\t\t*/\n\t\t\t$this->main_domain = $splits[1].\".\".$splits[2].\".\".$splits[3];\n\t\t\t$this->channel = ORM::factory('channel')\n\t\t\t->where(\"code\",\"=\",$splits[0])\n\t\t\t->find();\n\t\t\t//If there is no such channel redirect to main domain.\n\t\t\n\t\t\tif (!$this->channel->loaded()) {\n\t\t\t\t$this->request->redirect(\"http://{$this->main_domain}\");\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t$this->main_domain = $splits[0].\".\".$splits[1].\".\".$splits[2];\n\t\t}\n\t\t\n\t}", "function domain_add($key,&$obj){\n if(!($obj instanceof opc_umd)) return 1;\n $this->domains[$key] = $obj;\n $this->domain_labels[$key] = $obj->label();\n if(!in_array($key,$this->domain_seq)) $this->domain_seq[] = $key;\n return 0;\n }", "function domains() {\n\t \treturn $this->hook(\"/{$this->subject_slug}/v1/domains.xml?api_key={$this->api_key}\",\"domain\");\n\t}", "public function canManageOwnSubdomain();", "function ms_subdomain_constants()\n {\n }", "protected function registeredDomain()\n {\n }", "public function getSubdomain()\n {\n return $this->subdomain;\n }", "protected function setupDomains()\n {\n static $done;\n\n if (!empty($done)) {\n return;\n }\n\n $d = new Domains();\n $d->setDomainName('dk');\n $d->setDomainKey('DK');\n $d->save();\n\n $d = new Domains();\n $d->setDomainName('dk');\n $d->setDomainKey('SalesDK');\n $d->save();\n\n $d = new Domains();\n $d->setDomainName('com');\n $d->setDomainKey('COM');\n $d->save();\n\n $done = true;\n }", "protected function setDomain($new_domain)\n\t{\n\t\t$this->activeDomain = $new_domain;\n\t}", "public function setDomain($url) {\n\t\t$this->_domain = $url;\n\t}", "function set_fr_domain( $args, $assoc_args ) {\n global $sitepress, $envs;\n\n if (defined('ICL_LANGUAGE_CODE') && defined('WP_ENV') && is_array($envs)) {\n $fr_stages = $envs['fr'];\n $current_stage = WP_ENV;\n if (isset($fr_stages[$current_stage])) {\n $fr_domain = $fr_stages[$current_stage];\n $fr_domain = \"https://\" . $fr_domain;\n } else {\n return;\n }\n } else {\n return;\n }\n\n $iclsettings = $sitepress->get_settings();\n $iclsettings['language_domains']['fr'] = $fr_domain;\n $sitepress->save_settings($iclsettings);\n\n if ($fr_domain == $sitepress->get_settings()['language_domains']['fr']) {\n WP_CLI::success( \"Set the French domain to $fr_domain\" );\n } else {\n WP_CLI::error( \"Error setting the French domain to $fr_domain\" );\n }\n\n }", "function setBaseDomain($full_url) {\n $urlParts = parse_url($full_url);\n //add case for localhost\n // print_r($urlParts);\n $host=$urlParts['host'];\n if($host==\"localhost\") {\n \n $this->base_domain = $host;\n }\n else {\n $hostParts = explode('.', $urlParts['host']);\n $hostParts = array_reverse($hostParts);\n // $host = $hostParts[1] . '.' . $hostParts[0]; with final extension\n if (($hostParts[1])!== null) {\n $host = $hostParts[1];\n $this->base_domain = $host;\n }\n }\n\n }", "public static function subdomains()\n\t{\n\t\t$domains = self::_getConfigArray();\n\t\tarray_pop($domains);\n\t\t// Config contained only a single domain (\".com\")\n\t\tif (is_null($domains))\n\t\t{\n\t\t\t$domains = [];\n\t\t\treturn $domains;\n\t\t}\n\n\t\t// Config contained no subdomains (\"example.com\")\n\t\tarray_shift($domains);\n\t\tif (is_null($domains))\n\t\t{\n\t\t\t$domains = [];\n\t\t\treturn $domains;\n\t\t}\n\n\t\treturn $domains;\n\t}", "function ms_load_current_site_and_network($domain, $path, $subdomain = \\false)\n {\n }", "function add_domain_to_user($submission, $session_id) {\n\t\n\t// get the user_id (and check validity of session) based on session_id\n\t$user_id = get_user_id(make_safe($session_id));\n\t\n\t// check entry type\n\tif (check_input_type($submission) == \"ip\") {\n\t\t$entry = $submission;\n\t} elseif (check_input_type($submission) == \"url\") {\n\t\t$entry = get_domain_only($submission);\n\t}\n\t\n\t$current_time = time();\n\t\t\n\t// if domain is blank, try adding http:// in front\n\tif ($entry == \"\" ) {\n\t\t$entry = get_domain_only(\"http://\" . $submission);\n\t\t// if still blank then exit\n\t\tif ($entry == \"\") {\n\t\t\treturn \"Error: invalid entry\";\n\t\t}\n\t}\n\t\n\t\n\t// check if domain already exists for this user\n\t// if so, return error\n\t$website_list = get_list_of_websites($session_id); //array( array('site_id', 'domain'), ...)\n\tforeach ($website_list as $website) {\n\t\tif ($website['domain'] == $entry) {\n\t\t\treturn \"Error: Site already exists for user\";\n\t\t}\n\t}\n\t\n\tif ($user_id) {\n\t\t\n\t\tif ($entry) {\n\t\t\n\t\t\t$unique_id = uniqid();\n\t\t\t$query = \"INSERT INTO \" . $GLOBALS['db_name'] . \".websites (site_id, user_id, domain, alerts, creation_time) VALUES ('$unique_id', '$user_id', '$entry', 'disabled', '$current_time')\";\n\t\t\tif ($GLOBALS['db_connection'] -> query($query) === TRUE) {\n\t\t\t\treturn \"Site added successfully\";\n\t\t\t} else {\n\t\t\t\tdisplay_sql_error();\n\t\t\t}\n\t\t} else {\n\t\t\treturn \"Invalid address\";\n\t\t}\n\t\t\n\t} else {\n\t\treturn \"Invalid Session\";\n\t}\n\t\n}", "public function addDomains(array $hosts): void;", "protected function registerAffecting()\n {\n $this->events->listen(ConfigureURL::class, function (ConfigureURL $event) {\n $event->changeRoot($event->event->tenant->getTenantKey().'.tenancy.dev');\n });\n }", "public function init() {\n parent::init();\n $this->domain = pm_Session::getCurrentDomain();\n }", "function get_clean_basedomain()\n {\n }", "function is_subdomain_install()\n {\n }", "private function mappingDomain($real_name, $name, $site_full, $did) {\n\t\t$site_name = $name;\n\t\t$site_create = $real_name;\t\t\n\n\t\t$domain = Domain::findOrFail($did);\n\t\t$domain_name = $domain->name;\n\t\t$domain_mapid = $domain->mapid;\n\t\t$site_new = $site_name.\".\".$domain_name;\n\n\t\t$site_ip = shell_exec('nslookup '.$site_full.' | tail -2 | head -1 | awk \\'{print $2}\\'');\n\n\t\t$make_subdomain = SiteController::MakeSubdomain_Init($domain_mapid, $site_name, $site_full, $site_ip);\n\t\tif($make_subdomain)\t{\n\t\t\tshell_exec(SiteController::$AZURE_PATH.' site domain add \"'.$site_name.'.'.$domain_name.'\" \"'.$site_create.'\" 2>&1');\n\t\t\tob_flush();\n\t\t\t$output = shell_exec(SiteController::$AZURE_PATH.' site domain list '.$site_create.' --json 2>&1');\n\t\t\tob_flush();\n\t\t\t$site_mapping = json_decode($output);\n\t\t\tif(count($site_mapping) > 1 && ($site_mapping[0] == $site_new)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\n\t}", "protected function add_sample_domains(){\n $gougousis = new Domain([\n 'node_name' => 'gougousis.gr',\n 'full_name' => 'gougousis.gr',\n 'fake' => 0\n ]);\n $gougousis->save();\n\n $dom1 = new Domain([\n 'node_name' => 'dom1',\n 'full_name' => 'dom1.gougousis.gr',\n 'fake' => 0\n ]);\n $dom1->save();\n $dom1->makeChildOf($gougousis);\n\n $dom2 = new Domain([\n 'node_name' => 'dom2',\n 'full_name' => 'dom2.gougousis.gr',\n 'fake' => 0\n ]);\n $dom2->save();\n $dom2->makeChildOf($gougousis);\n\n $delegation = new DomainDelegation([\n 'user_id' => $this->admin->id,\n 'domain_id' => $gougousis->id\n ]);\n $delegation->save();\n\n // These are supposed to be created by $this->non_admin\n $takis = new Domain([\n 'node_name' => 'takis.gr',\n 'full_name' => 'takis.gr',\n 'fake' => 0\n ]);\n $takis->save();\n\n $delegation = new DomainDelegation([\n 'user_id' => $this->non_admin->id,\n 'domain_id' => $takis->id\n ]);\n $delegation->save();\n\n }", "function setEmails($emails) {\n //foreach($emails as $email) {\n list($user, $domain) = $this->_parseEmail($emails);\n if (!isset($this->domains[$domain])) {\n $this->domains[$domain] = array();\n }\n $this->domains[$domain][] = $user;\n //}\n }", "public function get_shop_subdomain( )\r\n\t {\r\n\t\t //use defined in index.php, if not available extract ot ourselves\r\n\t \t return ( defined('SHOP_SUBDOMAIN') ? SHOP_SUBDOMAIN : SHOP_DOMAIN );\r\n\t }", "function get_cur_domain()\n{\n}", "function w3tc_cdn_rename_domain() {\n\t\t$w3_plugin_cdn = Dispatcher::component( 'Cdn_Core_Admin' );\n\n\t\t$total = $w3_plugin_cdn->get_rename_posts_count();\n\n\t\t$title = __( 'Modify attachment URLs', 'w3-total-cache' );\n\n\t\tinclude W3TC_INC_DIR . '/popup/cdn_rename_domain.php';\n\t}", "public function setDomain($value = null)\n {\n\n }", "protected function setOrganization() {}", "public function set_domain_name( $app_id, $new_domain ) {\n\t\treturn update_post_meta( $app_id, 'wpapp_domain', $new_domain );\n\t}", "function guifi_domain_save($edit, $verbose = TRUE, $notify = TRUE) {\n global $user;\n\n $to_mail = array();\n $tomail[] = $user->mail;\n $log = \"\";\n $to_mail = array();\n\n // domain\n $ndomain = _guifi_db_sql('guifi_dns_domains',array('id' => $edit['id']),$edit,$log,$to_mail);\n\n guifi_log(GUIFILOG_TRACE,\n sprintf('domain saved:'),\n $ndomain);\n\n\n // hosts\n $rc = 0;\n if (is_array($edit['hosts']))\n ksort($edit['hosts']);\n $rc = 0;\n\n if ($edit['hosts'])\n foreach ($edit['hosts'] as $counter => $host) {\n $keys['id'] = $ndomain['id'];\n $keys['counter']=$counter;\n $host['id'] = $ndomain['id'];\n $host['counter'] = $rc;\n\n if ($host['aliases']) {\n foreach ($host['aliases'] as $key => $name) {\n if (empty($name)) {\n unset($host['aliases'][$key]);\n }\n }\n $host['aliases'] = serialize($host['aliases']);\n } else {\n unset($host['aliases']);\n }\n if (($host['host'] == 'ns1' ) AND ($host['counter'] == '0')) {\n $host['opt']['options']['NS'] = 'NS';\n }\n $host['opt']['options']['mxprior'] = $host['opt']['mxprior'];\n $host['options'] = serialize($host['opt']['options']);\n\n // save the host\n $nhost = _guifi_db_sql('guifi_dns_hosts',$keys,$host,$log,$to_mail);\n if ((empty($nhost)) or ($host['deleted']))\n continue;\n $rc++;\n } // foreach host\n\n $to_mail = explode(',',$edit['notification']);\n\n if ($edit['new'])\n $subject = t('The domain %name has been CREATED by %user.',\n array('%name' => $edit['name'],\n '%user' => $user->name));\n else\n $subject = t('The domain %name has been UPDATED by %user.',\n array('%name' => $edit['name'],\n '%user' => $user->name));\n\n// drupal_set_message($subject);\n guifi_notify($to_mail,\n $subject,\n $log,\n $verbose,\n $notify);\n variable_set('guifi_refresh_dns',time());\n guifi_clear_cache($edit['sid']);\n guifi_clear_cache($edit['id']);\n\n return $ndomain['id'];\n\n}", "public function setDomain(Whois_Lookup_Domain $domain)\n {\n $this->_domain = $domain;\n }", "private function setHost()\n {\n $urlE = $this->explodedUrl;\n\n $this->host = $urlE[2];\n }", "function setDomain( $domain ) {\n $this->domain = $domain;\n }", "function add_domain($domain,$engine_ids) {\n $engine_ids_str='';\n \n foreach($engine_ids as $engine_id){\n $engine_ids_str.=\"$engine_id,\";\n }\n \n $parameters = array(\n 'method' => __FUNCTION__,\n 'domain' => $domain,\n 'engine_id' => rtrim($engine_ids_str,\",\")\n );\n $data = $this->get_data($parameters);\n return (array_key_exists('response', $data) && $data['response']==\"success\");\n }", "public function checkSubDomain()\n {\n $subdomain = Input::get('subdomain');\n if($this->_isValidSubDomain($subdomain))\n echo 'valid';\n else\n echo 'invalid';\n\n exit;\n }", "public function testAddDomain()\n {\n $list = new DomainList('.ing');\n $list->add('laugh');\n\n $domains = $list->get();\n $this->assertEquals(array('laugh.ing'), $domains);\n }", "public function testUpdateDomain()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function setDomain( $domain ) {\n $this->domain = $domain;\n }", "function getSubdomain() {\n global $CONFIG;\n if(!$CONFIG->Subdomains->Top_domain) return false;\n\n $matches = array();\n preg_match('#^(www\\.)?([^\\.]+)\\.'.str_replace('.', '\\.', $CONFIG->Subdomains->Top_domain).'#', $_SERVER['HTTP_HOST'], $matches);\n if(count($matches)>0) {\n return $matches[2];\n } else return false;\n}", "public function setShareWithDomain($value)\n {\n return $this->set('ShareWithDomain', $value);\n }", "public function secondLevelDomain(): DomainName;", "public function registrableDomain(): DomainName;", "public static function setDomains($domains)\n {\n $allDomains = [];\n foreach ($domains as $key => $value)\n {\n $allDomains[]['domain'] = $value;\n }\n return $allDomains;\n }", "function set_subsite_root() {\n\t\t$this->is_subsite_root = true;\n\t}", "function admin_index() {\n\n\t\t$this->Subdomain->recursive = 0;\n\n\t\t/**\n\t\t * Put all subdomains in \"subdomains\".\n\t\t * $subdomains will be available in the view.\n\t\t */\n\t\t$this->set('subdomains', $this->paginate());\n\n\t}", "public function initDomain($domain)\n {\n\t\t$this->domain = UrlCraw::where('domain' , $domain)->get();\n\t\tforeach ($this->domain as $url) {\n\t\t\t$this->url = $url;\n\t\t\t$this->initCrawler();\n\t\t}\n }", "public function setDomainAttribute($value)\n {\n $this->attributes['domain'] = strtolower($value);\n }", "function target_add_forum_subscription($sub)\n{\n\tif ($sub['user_id'] == 1 && isset($GLOBALS['hack_id'])) {\n\t\t$sub['user_id'] = $GLOBALS['hack_id'];\n\t}\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'forum_notify (user_id, forum_id) VALUES('. (int)$sub['user_id'] .', '. (int)$sub['forum_id'] .')');\n}", "public function addSecondaryDnsDomains($domain, $domain2add, $ip){\n $domain = (string)$domain;\n if (!$domain)\n throw new BadMethodCallException('Parameter $domain is missing.');\n $domain2add = (string)$domain2add;\n if (!$domain2add)\n throw new BadMethodCallException('Parameter $domain2add is missing.');\n $ip = (string)$ip;\n if (!$ip)\n throw new BadMethodCallException('Parameter $ip is missing.');\n $payload = array(\"domain\"=>$domain2add, \"ip\"=>$ip);\n try {\n $r = $this->post('dedicated/server/'.$domain.'/secondaryDnsDomains', array('Content-Type' => 'application/json;charset=UTF-8'), json_encode($payload))->send();\n } catch (\\Exception $e) {\n throw new ServerException($e->getMessage(), $e->getCode(), $e);\n }\n }", "public function testHABTMKeepExisting() {\n\t\t$this->loadFixtures('Site', 'Domain', 'DomainsSite');\n\n\t\t$Site = new Site();\n\t\t$results = $Site->find('count');\n\t\t$expected = 3;\n\t\t$this->assertEquals($expected, $results);\n\n\t\t$data = $Site->findById(1);\n\n\t\t// include api.cakephp.org\n\t\t$data['Domain'] = array('Domain' => array(1, 2, 3));\n\t\t$Site->save($data);\n\n\t\t$Site->id = 1;\n\t\t$results = $Site->read();\n\t\t$expected = 3; // 3 domains belonging to cakephp\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\n\t\t$Site->id = 2;\n\t\t$results = $Site->read();\n\t\t$expected = 2; // 2 domains belonging to markstory\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\n\t\t$Site->id = 3;\n\t\t$results = $Site->read();\n\t\t$expected = 2;\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\t\t$results['Domain'] = array('Domain' => array(7));\n\t\t$Site->save($results); // remove association from domain 6\n\t\t$results = $Site->read();\n\t\t$expected = 1; // only 1 domain left belonging to rchavik\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\n\t\t// add deleted domain back\n\t\t$results['Domain'] = array('Domain' => array(6, 7));\n\t\t$Site->save($results);\n\t\t$results = $Site->read();\n\t\t$expected = 2; // 2 domains belonging to rchavik\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\n\t\t$Site->DomainsSite->id = $results['Domain'][0]['DomainsSite']['id'];\n\t\t$Site->DomainsSite->saveField('active', true);\n\n\t\t$results = $Site->Domain->DomainsSite->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'DomainsSite.active' => true,\n\t\t\t),\n\t\t));\n\t\t$expected = 5;\n\t\t$this->assertEquals($expected, $results);\n\n\t\t// activate api.cakephp.org\n\t\t$activated = $Site->DomainsSite->findByDomainId(3);\n\t\t$activated['DomainsSite']['active'] = true;\n\t\t$Site->DomainsSite->save($activated);\n\n\t\t$results = $Site->DomainsSite->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'DomainsSite.active' => true,\n\t\t\t),\n\t\t));\n\t\t$expected = 6;\n\t\t$this->assertEquals($expected, $results);\n\n\t\t// remove 2 previously active domains, and leave $activated alone\n\t\t$data = array(\n\t\t\t'Site' => array('id' => 1, 'name' => 'cakephp (modified)'),\n\t\t\t'Domain' => array(\n\t\t\t\t'Domain' => array(3),\n\t\t\t)\n\t\t);\n\t\t$Site->create($data);\n\t\t$Site->save($data);\n\n\t\t// tests that record is still identical prior to removal\n\t\t$Site->id = 1;\n\t\t$results = $Site->read();\n\t\tunset($results['Domain'][0]['DomainsSite']['updated']);\n\t\tunset($activated['DomainsSite']['updated']);\n\t\t$this->assertEquals($activated['DomainsSite'], $results['Domain'][0]['DomainsSite']);\n\t}", "function createAlias($dstdomain,$srcdomain){\n\n $res = $res = $this->client->request('PUT',$this->path.'/'.$dstdomain.'/aliases/'.$srcdomain,[]);\n $this->checkResponse($res,array(204, 400, 404));\n return $res;\n }", "public function setUriDomain(?string $value): void {\n $this->getBackingStore()->set('uriDomain', $value);\n }", "function getDomain()\n {\n }", "function domains_add($files){\n $res = array();\n foreach($files as $key=>$file) $res[$key] = $this->domain_add($key,$file);\n return $res;\n }", "public function withSecondLevelDomain(DomainName $label): self;", "public function beforeSet() {\r\n\t\t$this->oldDomain = $this->object->get('domain');\r\n\t\t$sitestart = $this->getProperty('sitestart');\r\n\t\t$this->setProperty('sitestart', (!empty($sitestart) ? $sitestart : null));\r\n\t\t\r\n\t\treturn parent::beforeSet();\r\n\t}", "private function fetchCurrentDomainConfiguration() {\n // are some supported domains defined?\n if (!isset($this->config->supported_domains) ||\n empty($this->config->supported_domains)) {\n throw new MultidomainException(\n 'No supported domains defined in config.yml file'\n );\n }\n\n $askedHost = null;\n\n $host = explode(':', $_SERVER['HTTP_HOST'])[0];\n $hostWithoutApi = null;\n\n if (substr($host, 0, 4) == 'api.') { // if starts with 'api.'\n $hostWithoutApi = substr($host, 4); // remove the 'api.' prefix\n }\n\n // check if host is defined in configuration file\n if (property_exists($this->config->supported_domains, $host)) {\n $askedHost = $host;\n } else if (\n !is_null($hostWithoutApi) &&\n property_exists($this->config->supported_domains, $hostWithoutApi)\n ) {\n $askedHost = $hostWithoutApi;\n }\n\n if (\n is_null($askedHost) ||\n !property_exists($this->config->supported_domains, $askedHost)\n ) {\n if (!isset($this->config->fallback_url) ||\n empty($this->config->fallback_url)) {\n throw new Exception('This domain is not configured for the moment.');\n } else {\n header('Location: ' . $this->config->fallback_url);\n die();\n }\n }\n\n $this->domainConfig = $this->config->supported_domains->$askedHost;\n }", "public function setUserDomain(?string $value): void {\n $this->getBackingStore()->set('userDomain', $value);\n }", "function save()\n {\n $baseobject = $this->getBaseObject();\n $this->dn = \"cn=$baseobject->cn,\".get_ou('phoneRDN').$baseobject->base;\n $baseobject->dn = $this->dn;\n\n foreach ($this->by_object as $key => $obj) {\n $this->by_object[$key]->dn = $this->dn;\n }\n\n parent::save();\n }", "public function addSearch(string $domain): void {}", "public function load()\n {\n return $this->domains;\n }", "public function testDomainAddCommand()\n {\n $site = Arr::get($_SERVER, 'SERVER_NAME');\n\n if (!$site) {\n $this->assertTrue(true);\n return;\n }\n\n $argDomain = $site ? ['domain' => $site] : [];\n\n $this->artisan('domain:add', $argDomain);\n\n $this->assertFileExists(env_path('.env.'.$site));\n\n $this->artisan('config:clear');\n\n $domainListed = Config::get('domain.domains');\n\n $this->assertArrayHasKey($site,$domainListed);\n\n $this->assertDirectoryExists(app()->exactDomainStoragePath());\n }", "function setSubject( $str ){\n $this->Subject = SITE_NAME.\": \".$str;\n }", "public function addSiteLinks()\n {\n foreach ($this->getSiteLinks() as $item) {\n $this->addArray($item);\n }\n }", "public function setRelatedHosts(?array $value): void {\n $this->getBackingStore()->set('relatedHosts', $value);\n }", "function __construct() { \r\n // We take domain from order copy email config value\r\n $this->domain = substr(\r\n strstr(\r\n Mage::getStoreConfig(\r\n 'sales_email/order/copy_to'\r\n , Mage::app()->getStore()\r\n ), '@')\r\n , 1\r\n );\r\n}", "function guifi_domain_add() {\n guifi_log(GUIFILOG_TRACE,'function guifi_domain_add()');\n if (arg(8) == 'external')\n $ipv4 = '';\n else\n $ipv4 = arg(6);\n\n $output = drupal_get_form('guifi_domain_form',array(\n 'add' => arg(3),\n 'dname' => arg(4),\n 'type' => arg(5),\n 'ipv4' => $ipv4,\n 'mname' => arg(7),\n 'scope' => arg(8),\n 'management' => arg(9)));\n\n // To gain space, save bandwith and CPU, omit blocks\n print theme('page', $output, FALSE);\n}", "protected function setUp(): void\n {\n parent::setUp();\n\n Route::domain('site2.test')\n ->get('domain-route', fn () => response()->json(config('domain')))\n ->middleware(['api']);\n }", "protected function negotiateActiveDomain() {\n $httpHost = $this->negotiateActiveHostname();\n $this->setRequestDomain($httpHost);\n return $this->domain;\n }", "function cacheplugin_subdomain() {\r\n\t\t$cachepageURL = $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';\r\n\t\t$cachepageURL .= $_SERVER['SERVER_PORT'] != '80' ? $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"] : $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\r\n\t\t$cacheparsedUrl = parse_url($cachepageURL);\r\n\t\t$cachehost = explode('.', $cacheparsedUrl['host']);\r\n\treturn $cachehost[0];\r\n\t}", "static function change_new_blog_domain_name( int $blog_id, int $user_id, string $domain ) {\n\n // Parse site slug from full domain\n $slug = strtok($domain, '.');\n $new_domain = $slug . '.' . self::get_multisite_tld();\n\n // Replace the domain that was just created\n global $wpdb;\n $wpdb->update( $wpdb->blogs, array( 'domain' => $new_domain ), array( 'blog_id' => $blog_id ) );\n\n // Replace blog home & siteurl\n update_blog_option ( $blog_id, 'siteurl', 'http://' . $new_domain );\n update_blog_option ( $blog_id, 'home', 'http://' . $new_domain );\n }", "public function testAddTwoDomains()\n {\n $list = new DomainList('ing');\n $list->add([\n 'laugh', 'cry'\n ]);\n\n $domains = $list->get();\n $this->assertEquals(array('laugh.ing', 'cry.ing'), $domains);\n }", "public function GetActiveDomains($ARGS = false)\n {\n $Q = $this->DB->GET('MUP.domains.domains', ['status__IN' => [0, 1, 2, 4], 'nsReady' => 1], ['domain'], 100000);\n foreach ($Q as $i => $q) \n $this->SetDomains[] = $q['domain'];\n }", "public function get_domains()\n\t{\n\t\treturn $this->domains;\n\t}", "public function setDomain( $domain )\n {\n $this->domain = us($domain);\n }", "protected function link_user_to_site($domain)\n\t{\n\t\t$this->db->insert('linked', array('user_id' => session('user_id'), 'domain_id' => $domain->id, 'created' => date(\"Y-m-d H:i:s\")));\n\t}", "public function setupAssociations() \n {\n \n }", "public function setDomain($domain)\n {\n $this->_domain = $domain;\n }", "public function setAlias($data)\n {\n $oldAliasList = $this->getAliases();\n $aliases = array();\n $lib = new \\Cx\\Core_Modules\\Alias\\Controller\\AliasLib($this->getLang());\n foreach ($oldAliasList as $oldAlias) {\n if (in_array($oldAlias->getSlug(), $data)) {\n // existing alias, ignore;\n $aliases[] = $oldAlias->getSlug();\n } else {\n // deleted alias\n $lib->_deleteAlias($oldAlias->getNode()->getId());\n }\n }\n foreach ($data as $alias) {\n if (!in_array($alias, $aliases)) {\n // new alias\n $lib->_saveAlias($alias, '[[' . self::PLACEHOLDER_PREFIX . $this->getNode()->getId() . '_' . $this->getLang() . ']]', true);\n }\n }\n }", "function _setSubjectMenu() {\n\t\t$this->loadModel('Subject');\n\t\t$subjects = $this->Subject->find('threaded');\n\t\t$this->set('subjects', $subjects);\n\t}", "public function set($domain, $key, $value)\n {\n if (!$this->enabled)\n {\n return;\n }\n\n static $no_cache = false;\n if (!$no_cache)\n {\n // midgardmvc_core::get_instance()->cache->content->no_cache();\n $no_cache = true;\n }\n\n $this->data[$domain][$key] = serialize($value);\n $this->dispatcher->session_set_var(self::ROOT, $this->data);\n }", "function _bind_textdomain_codeset($domain, $codeset)\r\n\t{\r\n\t\tglobal $text_domains;\r\n\t\t$text_domains[$domain]->codeset = $codeset;\r\n\t}" ]
[ "0.65115553", "0.6146808", "0.59660184", "0.5785171", "0.57528764", "0.5716687", "0.56461585", "0.5638809", "0.5620155", "0.5549493", "0.55481905", "0.55077696", "0.5505932", "0.54905224", "0.5456437", "0.5420965", "0.53574", "0.53569096", "0.5341232", "0.53346074", "0.53181314", "0.53113204", "0.5309855", "0.52698576", "0.52558684", "0.52373314", "0.51996714", "0.5152786", "0.5144234", "0.5141679", "0.50867105", "0.50791293", "0.5066734", "0.5008253", "0.50059426", "0.4983755", "0.49761474", "0.4971683", "0.495305", "0.49293807", "0.49284115", "0.49193612", "0.49167496", "0.4887891", "0.48858967", "0.48828274", "0.4867389", "0.4856162", "0.48462248", "0.48311833", "0.48193043", "0.48142943", "0.48070663", "0.48045295", "0.47983992", "0.47954744", "0.47953138", "0.47728527", "0.47562855", "0.47494358", "0.47379187", "0.4732243", "0.4722963", "0.47119737", "0.47067833", "0.47066632", "0.47062823", "0.46934977", "0.46826696", "0.46571538", "0.46459025", "0.46457288", "0.46450174", "0.46362972", "0.46222618", "0.462063", "0.45894128", "0.45839822", "0.45822093", "0.458166", "0.45665005", "0.45655432", "0.4561141", "0.45501494", "0.45492908", "0.45457155", "0.4543068", "0.45381063", "0.45320818", "0.4528483", "0.45220277", "0.4519662", "0.45186085", "0.45120466", "0.45110908", "0.45094383", "0.45056075", "0.45010325", "0.45007816", "0.4492225" ]
0.72454435
0
Generate a highly randomized salt
function generateSalt() { return str_shuffle(sha1(uniqid(mt_rand(), true)).md5(uniqid(mt_rand(), true))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function genSalt() {\r\n $random = 0;\r\n $rand64 = \"\";\r\n $salt = \"\";\r\n $random = rand(); // Seeded via initialize()\r\n // Crypt(3) can only handle A-Z a-z ./\r\n $rand64 = \"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\r\n $salt = substr( $rand64, $random % 64, 1 ) . substr( $rand64, ($random / 64) % 64, 1 );\r\n $salt = substr( $salt, 0, 2 ); // Just in case\r\n return($salt);\r\n }", "private function generateSalt()\n {\n return str_random(16);\n }", "function generateSalt() {\n\t$numberOfDesiredBytes = 16;\n\t$salt = random_bytes($numberOfDesiredBytes);\n\treturn $salt;\n}", "public static function generateRandomSalt()\n {\n $seed = uniqid(mt_rand(), true);\n $salt = base64_encode($seed);\n $salt = str_replace('+', '.', $salt);\n return substr($salt, 0, self::$saltLength);\n }", "public static function generateRandomSalt() {\n\t\t// Salt seed\n\t\t$seed = uniqid(mt_rand(), true);\n \n\t\t// Generate salt\n\t\t$salt = base64_encode($seed);\n\t\t$salt = str_replace('+', '.', $salt);\n \n\t\treturn substr($salt, 0, self::$_saltLength);\n\t}", "private function genSalt()\n {\n \treturn md5(time() + rand());\n }", "public function salt() {\r\n return substr(md5(uniqid(rand(), true)), 0, 10);\r\n }", "private function generateSalt() {\n $salt = base64_encode(pack(\"H*\", md5(microtime())));\n \n return substr($salt, 0, $this->saltLng);\n }", "static function generateSalt($strength=10) {\n return self::saltStart($strength) . random_string(22, './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz');\n }", "public static function unique_salt() {\r\n\t\treturn substr(sha1(mt_rand()),0,22);\r\n\t}", "protected function salt() {\n\t\treturn substr(md5(uniqid(rand(), true)), 0, $this->config->item('salt_length'));\n\t}", "public function generateRandomSalt()\n {\n $salt = null;\n\n if (function_exists('openssl_random_pseudo_bytes')) {\n $salt = openssl_random_pseudo_bytes(16);\n }\n\n if (is_null($salt)) {\n $salt = sha1(microtime(), true);\n }\n\n $salt = base64_encode($salt);\n $salt = strtr($salt, '+', '.');\n\n return substr($salt, 0, 22);\n }", "private function generateSalt(){\n return substr(md5(rand(0, 999)), 0, 5);\n }", "public static function generateSalt() {\n $salt = '$2a$13$';\n $salt = $salt . md5(mt_rand());\n return $salt;\n }", "private function generateSalt() {\r\n\t\t$possibleValues = '0123456789abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVXYZ';\r\n\t\t$salt = '';\t\t\r\n\t\tfor($i = 0; $i < 10; $i++) {\r\n\t\t\t$salt .= $possibleValues[mt_rand(0, strlen($possibleValues)-1)];\t\r\n\t\t}\t\t\r\n\t\treturn $salt;\r\n\t}", "public function createSalt()\n{\n\t$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n\treturn substr(str_shuffle(str_repeat($pool, 5)), 0, $this->saltLength);\n}", "private function generateSalt(): string\n {\n return base64_encode(random_bytes(16));\n }", "private function generateSalt(): string\n {\n return base64_encode(random_bytes(16));\n }", "private function GenSalt()\n {\n $chars = array_merge(range('a','z'), range('A','Z'), range(0, 9));\n $max = count($chars) - 1;\n $str = \"\";\n $length = 22;\n \n while($length--) {\n shuffle($chars);\n $rand = mt_rand(0, $max);\n $str .= $chars[$rand];\n }\n return $str . '$';\n }", "public static function makeSalt()\n\t\t{\n\n\t\t\treturn uniqid(mt_rand(), true);\n\t\t}", "public static function uniqueSalt() {\n return substr(sha1(mt_rand()), 0, 22);\n }", "public static function generateSalt() {\r\n\t\treturn uniqid('', true);\r\n\t}", "public function generateSalt() {\n // A salt is randomly generated here to protect again brute force attacks\n // and rainbow table attacks. The following statement generates a hex\n // representation of an 8 byte salt. Representing this in hex provides\n // no additional security, but makes it easier for humans to read.\n // For more information:\n // http://en.wikipedia.org/wiki/Salt_%28cryptography%29\n // http://en.wikipedia.org/wiki/Brute-force_attack\n // http://en.wikipedia.org/wiki/Rainbow_table\n $this->salt = dechex(mt_rand(0, 2147483647)) . dechex(mt_rand(0, 2147483647));\n return $this->salt;\n }", "protected function _create_salt()\n\t{\n\t\t$this->CI->load->helper('string');\n\t\treturn sha1(random_string('alnum', 32));\n\t}", "protected function generateSalt()\n\t{\n\t\treturn uniqid('',true);\n\t}", "private function getUniqueSalt() {\n /* To generate the salt, first generate enough random bytes. Because\n * base64 returns one character for each 6 bits, so we should generate\n * at least 22*6/8 = 16.5 bytes, so we generate 17 bytes. Then we get the first\n * 22 base64 characters\n */\n\n /* As blowfish takes a salt with the alphabet ./A-Za-z0-9 we have to\n * replace any '+', '=' in the base64 string with '..'.\n */\n $random = base64_encode(openssl_random_pseudo_bytes(17));\n //take only the first 22 caracters\n $random = substr($random, 0, 22);\n\n //replace +,= by .\n return strtr($random, '+=', '..');\n }", "public static function make_salt()\n {\n\n \t$chars = str_split('0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz');\n \n \t\t$newSalt = '';\n \t\tfor ($i = 0; $i < 16; $i++) \n \t\t{\n \t\t\t$newSalt .= $chars[rand(0, count($chars) - 1)];\n \t\t}\n\n \t\treturn $newSalt;\n }", "public function createSalt () {\n srand(time());\t\t\t\t\n $pool = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n for($index = 0; $index < 2; $index++) {\n $sid .= substr($pool,(rand()%(strlen($pool))), 1);\n }\n return $sid; \n }", "function createSalt()\n{\n $text = uniqid(Rand(), TRUE);\n return substr($text, 0, 5);\n\n}", "function getRandomeSalt() {\r\n $salt = mcrypt_create_iv(23, MCRYPT_DEV_URANDOM);\r\n $salt = base64_encode($salt);\r\n $salt = str_replace('+', '.', $salt);\r\n return $salt;\r\n}", "function generate_salt($length = 16)\n {\n $possible_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678';\n $rand_string = '';\n for($i = 0; $i < $length; ++$i)\n {\n $rand_string .= $possible_chars[random_int(0, strlen($possible_chars) - 1)];\n }\n return utf8_encode($rand_string);\n }", "function generateSalt() {\n $length = 10;\n $characters = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n $charsLength = strlen($characters) - 1;\n $string = \"\";\n for($i=0; $i<$length; $i++) {\n $randNum = mt_rand(0, $charsLength);\n $string .= $characters[$randNum];\n }\n return $string;\n}", "function salt($len=16) {\n $pool = range('!', '~');\n $high = count($pool) - 1;\n $tmp = '';\n for ($c = 0; $c < $len; $c++) {\n $tmp .= $pool[rand(0, $high)];\n }\n return $tmp;\n}", "function getPasswordSalt(){\n\t\treturn substr( str_pad( dechex( mt_rand() ), 8, '0', STR_PAD_LEFT ), -8 );\n\t}", "function SecureSalt() \t{\n\treturn substr(sha1(uniqid(rand(),true)),0,40);\n}", "protected function generateSalt() {\n return uniqid('', true);\n }", "function generateSaltPassword () {\n\treturn base64_encode(random_bytes(12));\n}", "function createSalt()\n {\n $string = md5(uniqid(rand(), true));\n return substr($string, 0, 3);\n }", "function createSalt()\r\n\r\n{\r\n\r\n $string = md5(uniqid(rand(), true));\r\n\r\n return substr($string, 0, 5);\r\n\r\n}", "function makeSalt() {\r\n static $seed = \"./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\r\n $algo = (PHP_VERSION_ID >= 50307) ? '$2y' : '$2a'; //DON'T CHANGE THIS!!\r\n $strength = '$12'; //too high will time out script.\r\n $salt = '$';\r\n for ($i = 0; $i < 22; $i++) {\r\n $salt .= substr($seed, mt_rand(0, 63), 1);\r\n }\r\n return $algo . $strength . $salt;\r\n}", "public static function generateSalt($length=20) {\n $haystack = '012345678'\n . 'abcdefghijklmnopqrstuvwxyz'\n . 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n . '~,./<>?!@#%^&*_+-=;: ';\n $iLen = strlen($haystack);\n $result = '';\n\n mt_srand((double) microtime() * 1000000);\n for ( $i=0; $i<$length; $i++ ) {\n $result .= substr($haystack, (mt_rand() % ($iLen)), 1);\n }\n return($result);\n }", "function gen_salt($salt_length=22)\n\t{\n\t\t$raw_salt_len = 16;\n \t\t$buffer = '';\n $buffer_valid = false;\n\n\t\tif (function_exists('mcrypt_create_iv') && !defined('PHALANGER')) {\n\t\t\t$buffer = mcrypt_create_iv($raw_salt_len, MCRYPT_DEV_URANDOM);\n\t\t\tif ($buffer) {\n\t\t\t\t$buffer_valid = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) {\n\t\t\t$buffer = openssl_random_pseudo_bytes($raw_salt_len);\n\t\t\tif ($buffer) {\n\t\t\t\t$buffer_valid = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!$buffer_valid && @is_readable('/dev/urandom')) {\n\t\t\t$f = fopen('/dev/urandom', 'r');\n\t\t\t$read = strlen($buffer);\n\t\t\twhile ($read < $raw_salt_len) {\n\t\t\t\t$buffer .= fread($f, $raw_salt_len - $read);\n\t\t\t\t$read = strlen($buffer);\n\t\t\t}\n\t\t\tfclose($f);\n\t\t\tif ($read >= $raw_salt_len) {\n\t\t\t\t$buffer_valid = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!$buffer_valid || strlen($buffer) < $raw_salt_len) {\n\t\t\t$bl = strlen($buffer);\n\t\t\tfor ($i = 0; $i < $raw_salt_len; $i++) {\n\t\t\t\tif ($i < $bl) {\n\t\t\t\t\t$buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255));\n\t\t\t\t} else {\n\t\t\t\t\t$buffer .= chr(mt_rand(0, 255));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$salt = $buffer;\n\n\t\t// encode string with the Base64 variant used by crypt\n\t\t$base64_digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\t\t$bcrypt64_digits = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\t\t$base64_string = base64_encode($salt);\n\t\t$salt = strtr(rtrim($base64_string, '='), $base64_digits, $bcrypt64_digits);\n\n\t\t$salt = substr($salt, 0, $salt_length);\n\n\t\treturn $salt;\n\t}", "function generateSalt($bytes = '16'){\n\treturn mcrypt_create_iv($bytes, MCRYPT_RAND);\n}", "public static function regenerateSalt()\n\t{\n\t\treturn PzPHP_Helper_String::createCode(mt_rand(40,45), PzPHP_Helper_String::ALPHANUMERIC_PLUS);\n\t}", "function makeSalt() {\n $string = md5(uniqid(rand(), true));\n return substr($string, 0, 3);\n}", "function createNewSalt(){\n\t$characters = 'abcdefghijklmnopqrstuvwxyz-:;><*#%&()ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';\n\n\t$salt = \"\";\n\n\tfor ($i = 0; $i<32; $i++){\n $salt = $salt.$characters[rand(0,strlen($characters)-1)];\n\t}\n\t\n\treturn $salt;\n}", "public function genSalt(){\n return mcrypt_create_iv(16, MCRYPT_DEV_URANDOM);\n }", "protected function _createSalt()\n {\n return (\\function_exists('random_bytes')) ? random_bytes(16) : mcrypt_create_iv(16, \\MCRYPT_DEV_URANDOM);\n }", "function generateSalt()\n\t{\n\t\t$lets = range('a', 'z');\n\t\t$ups = range('A', 'Z');\n\t\t$nums = range('0', '9');\n\t\t\n\t\t$special = array('*', '%', '#');\n\t\t\n\t\t$union = $lets + $nums + $ups + $special; //Generate an array with numbers, letters, and special characters\n\t\t\n\t\t$salt = '';\n\t\t\n\t\tfor($i = 0; $i < 5; $i++) //Create a salt of length 5, supplying random values\n\t\t{\n\t\t\t$r = rand(0, count($union)-1);\n\t\t\t$salt .= $union[$r];\n\t\t}\n\t\t\n\t\treturn $salt;\n\t}", "function createSalt(){\r\n \t\t\t$string = md5(uniqid(rand(), true));\r\n \t\treturn substr($string, 0, 3);\r\n\t\t}", "function get_salt($length) {\n \n $options = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789./';\n $salt = '';\n for ($i = 0; $i <= $length; $i ++) {\n $options = str_shuffle ( $options );\n $salt .= $options [rand ( 0, 63 )];\n }\n return $salt;\n }", "public function genSalt($length = 5)\n {\n if ($length < 1) { return; }\n $slt = '';\n $min = sfConfig::get('app_min_salt_char');\n $max = sfConfig::get('app_max_salt_char');\n for ($i = 0; $i < $length; $i++)\n {\n $slt .= chr(rand($min, $max));\n }\n return $slt;\n }", "function salt()\r\n{\r\n\t//return mcrypt_create_iv( 32 );\r\n\r\n\t$string = md5(uniqid(rand(), true));\r\n\treturn substr( $string, 0, 3 );\r\n}", "function generate_salt($length){\n //Unique random string from mt_random and md5 hashing\n //returns 32 characters\n $unique_random_string=md5(uniqid(mt_rand(),true));\n //Valid characters only [a-zA-Z0-9./]\n $base64_string=base64_encode($unique_random_string);\n //Replace '+' with '.'\n $modified_base64_string=str_replace('+','.',$base64_string);\n //first 22 characters\n $salt=substr($modified_base64_string,0,$length);\n return $salt;\n }", "function generate_salt($length) {\n // MD5 returns 32 characters\n $unique_random_string = md5(uniqid(mt_rand(), true));\n \n\t// Valid characters for a salt are [a-zA-Z0-9./]\n $base64_string = base64_encode($unique_random_string);\n \n\t// But not '+' which is valid in base64 encoding\n $modified_base64_string = str_replace('+', '.', $base64_string);\n \n\t// Truncate string to the correct length\n $salt = substr($modified_base64_string, 0, $length);\n \n\treturn $salt;\n}", "public function getSalt()\n {\n return md5(random_bytes(50));\n }", "function generate_salt($length){\n\t\t$unique_random_string = md5(uniqid(mt_rand(), true));\n\n\t\t// Vaild charcter for a salt are (a-zA-z0-9./)\n\t\t$base64_string = base64_encode($unique_random_string);\n\n\t\t// But not '+' which is vaild in base64 encoding\n\t\t$modified_base64_string = str_replace('+', '.', $base64_string);\n\n\t\t// Truncate string to the correct length\n\t\t$salt = substr($modified_base64_string, 0, $length);\n\t\treturn $salt;\n\t}", "function get_salt($length) {\r\n\r\n\t\t\t\t$options = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789./';\r\n\t\t\t\t$salt = '';\r\n\r\n\t\t\t\tfor ($i = 0; $i <= $length; $i++) {\r\n\t\t\t\t\t$options = str_shuffle($options);\r\n\t\t\t\t\t$salt .= $options[rand(0, 63)];\r\n\t\t\t\t}\r\n\t\t\t\treturn $salt;\r\n\t\t\t}", "function generate_salt($len = 5) {\n $valid_characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890@#$%^*()_-!';\n $valid_len = strlen($valid_characters) - 1;\n $salt = \"\";\n\n for ($i = 0; $i < $len; $i++) {\n $salt .= $valid_characters[rand(0, $valid_len)];\n }\n\n return $salt;\n}", "function generate_salt($length) {\n\t # MD5 returns 32 characters\n\t $unique_random_string = md5(uniqid(mt_rand(), true));\n\t \n\t # Valid characters for a salt are [a-zA-Z0-9./]\n\t $base64_string = base64_encode($unique_random_string);\n\t \n\t # Replace '+' with '.' from the base64 encoding\n\t $modified_base64_string = str_replace('+', '.', $base64_string);\n\t \n\t # Truncate string to the correct length\n\t $salt = substr($modified_base64_string, 0, $length);\n\t \n\t\treturn $salt;\n\t}", "public function getRandomSalt() {\n return $this->createSha3Salt();\n }", "function generate_salt($length) {\n\t// MD5 returns 32 characters\n\t$unique_random_string = md5(uniqid(mt_rand(), true));\n\n\t// Valid characters for a salt are [a-zA-Z0-9./]\n\t$base64_string = base64_encode($unique_random_string);\n\n\t// But not '+' which is valid in base64 encoding\n\t$modified_base64_string = str_replace('+', '.', $base64_string);\n\n\t// Truncate string to the correct length\n\t$salt = substr($modified_base64_string, 0, $length);\n\n\treturn $salt;\n}", "function generate_salt($length) {\n\t // MD5 returns 32 characters\n $unique_random_string = md5(uniqid(mt_rand(), true));\n\t \n\t\t// Valid characters for a salt are [a-zA-Z0-9./]\n\t$base64_string = base64_encode($unique_random_string);\n\t \n\t\t// But not '+' which is valid in base64 encoding\n\t$modified_base64_string = str_replace('+', '.', $base64_string);\n\t \n\t\t// Truncate string to the correct length\n\t$salt = substr($modified_base64_string, 0, $length);\n\t \n\treturn $salt;\n }", "function generate_salt($length) {\n\t // MD5 returns 32 characters\n\t $unique_random_string = md5(uniqid(mt_rand(), true));\n\t \n\t\t// Valid characters for a salt are [a-zA-Z0-9./]\n\t $base64_string = base64_encode($unique_random_string);\n\t \n\t\t// But not '+' which is valid in base64 encoding\n\t $modified_base64_string = str_replace('+', '.', $base64_string);\n\t \n\t\t// Truncate string to the correct length\n\t $salt = substr($modified_base64_string, 0, $length);\n\t \n\t\treturn $salt;\n\t}", "function generate_salt($length) {\n\t // MD5 returns 32 characters\n\t $unique_random_string = md5(uniqid(mt_rand(), true));\n\t \n\t\t// Valid characters for a salt are [a-zA-Z0-9./]\n\t $base64_string = base64_encode($unique_random_string);\n\t \n\t\t// But not '+' which is valid in base64 encoding\n\t $modified_base64_string = str_replace('+', '.', $base64_string);\n\t \n\t\t// Truncate string to the correct length\n\t $salt = substr($modified_base64_string, 0, $length);\n\t \n\t\treturn $salt;\n\t}", "function getSalt(){\n $inside = time() . \"az51\" . time(); \n $salt = '$2a$07$' . $inside . '$';\n return $salt;\n }", "function __generateRandom($length = 8, $salt = 'abcdefghijklmnopqrstuvwxyz0123456789') {\r\n\t\t$salt = str_shuffle ($salt);\r\n\t\t$return = \"\";\r\n\t\t$i = 0;\r\n\t\twhile ($i < $length) {\r\n\t\t\t$num = rand(0, strlen($salt) -1);\r\n\t\t\t$tmp = $salt[$num];\r\n\t\t\t$return .= $tmp;\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\treturn str_shuffle($return);\r\n\t}", "function generate_salt($length){\n\t//MD5 returns 32 characters\n\t$unique_random_string=md5(uniqid(mt_rand(),true));\n\t\n\t//valid characters for a salt are [a-zA-Z0-9./]\n\t//base64 code returns + instead of .\n\t$base64_string=base64_encode($unique_random_string);\n\t\n\t//But not '+' which is valid in base64 encoding\n\t$modified_base64_string=str_replace('+', '.' ,$base64_string);\n\t\n\t//Truncate string to the correct length\n\t$salt=substr($modified_base64_string,0,$length);\n\t\n\treturn $salt;\n}", "public static function gen_salt($length = 32)\n {\n $alpha_digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $alpha_digits_len = strlen($alpha_digits) - 1;\n\n $salt = '';\n for ($i = 0; $i < $length; $i++) {\n $salt .= $alpha_digits[mt_rand(0, $alpha_digits_len)];\n }\n\n return $salt;\n }", "function generate_salt($length) {\r\n\t\t// Not 100% unique, not 100% random, but good enough for a salt\r\n\t\t// MD5 returns 32 characters (more than the 22 we will need for our Blowfish hashing in our password encryption\r\n\t\t$unique_random_string = md5(uniqid(mt_rand(), true));\r\n\t\t\r\n\t\t// Valid characters for a salt are [a-zA-Z0-9./]\r\n\t\t// Base64 will transform our string into these characters, but also '+'s\r\n\t\t$base64_string = base64_encode($unique_random_string);\r\n\t\t\r\n\t\t// But not '+' which is valid in base 64 encoding, so to change those:\r\n\t\t$modified_base64_string = str_replace('+', '.', $base64_string);\r\n\t\t\r\n\t\t// Truncate string to the correct length\r\n\t\t$salt = substr($modified_base64_string, 0, $length);\r\n\t\t\r\n\t\treturn $salt;\r\n\t}", "function gen_mix_salt($pass) {\n $salt = generate_salt();\n return mix_salt($salt, $pass);\n}", "function generateFixedSalt32Byte()\r\n{\r\n return \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\";\r\n}", "function gen_salt($algo) {\n switch($algo) {\n case 'sha256':\n return base64_encode(mcrypt_create_iv (192, MCRYPT_DEV_RANDOM));\n // per man 3 crypt the salt is a maximum of 16 characters\n // and the salt character set is [a–zA–Z0–9./]\n // this is less than the rule of thumb for larger hash sizes\n // handle it as a separate case\n case 'crypt-sha256':\n $iv = mcrypt_create_iv (96, MCRYPT_DEV_RANDOM);\n return str_replace('+', '.', base64_encode($iv));\n }\n return false;\n}", "private function generateSalt($max = 15) \r\n\t{\r\n\t\t$characterList = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%&*?\";\r\n $i = 0;\r\n $salt = \"\";\r\n while ($i < $max) {\r\n $salt .= $characterList{mt_rand(0, (strlen($characterList) - 1))};\r\n $i++;\r\n }\r\n return $salt;\r\n\t}", "function salt(int $salt_length=22)\n\t{\n\n\t\t$raw_salt_len = 16;\n\n \t\t$buffer = '';\n $buffer_valid = false;\n\n if (function_exists('mcrypt_create_iv') && !defined('PHALANGER')) {\n $buffer = mcrypt_create_iv($raw_salt_len, MCRYPT_DEV_URANDOM);\n if ($buffer) {\n $buffer_valid = true;\n }\n }\n\n if (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) {\n $buffer = openssl_random_pseudo_bytes($raw_salt_len);\n if ($buffer) {\n $buffer_valid = true;\n }\n }\n\n if (!$buffer_valid && @is_readable('/dev/urandom')) {\n $f = fopen('/dev/urandom', 'r');\n $read = strlen($buffer);\n while ($read < $raw_salt_len) {\n $buffer .= fread($f, $raw_salt_len - $read);\n $read = strlen($buffer);\n }\n fclose($f);\n if ($read >= $raw_salt_len) {\n $buffer_valid = true;\n }\n }\n\n if (!$buffer_valid || strlen($buffer) < $raw_salt_len) {\n $bl = strlen($buffer);\n for ($i = 0; $i < $raw_salt_len; $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\n $salt = $buffer;\n\n // encode string with the Base64 variant used by crypt\n $base64_digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n $bcrypt64_digits = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n $base64_string = base64_encode($salt);\n $salt = strtr(rtrim($base64_string, '='), $base64_digits, $bcrypt64_digits);\n\n\t $salt = substr($salt, 0, $salt_length);\n\n\n\t\treturn $salt;\n\n\t}", "function fetch_user_salt($length = 3)\n{\n\t$salt = '';\n\tfor ($i = 0; $i < $length; $i++)\n\t{\n\t\t$salt .= chr(rand(32, 126));\n\t}\n\treturn $salt;\n}", "public function getSalt() {\n\t\t$salt = mcrypt_create_iv(22, MCRYPT_DEV_URANDOM);\t\t\t\t\t\t\t\t\t// creates an initialization vector from a 22 characters and /dev/random\n\t\t$salt = base64_encode($salt);\n\t\t$salt = str_replace('+', '.', $salt);\n\t\treturn $salt;\n\t}", "public function generate_salt($length) {\n\t\t//MD5 returns 32 characters\n\t\t$unique_random_string = md5(uniqid(mt_rand(), true));\n\t\t\n\t\t//valid characters for a salt are [a-z A-Z 0-9 ./]\n\t\t$base64_string = base64_encode($unique_random_string);\n\t\t\n\t\t//but not '+' which is in base64 encoding\n\t\t$modified_base64_string = str_replace('+', '.', $base64_string);\n\t\t\n\t\t//Truncate string to the correct length\n\t\t$salt = substr($modified_base64_string, 0, $length);\n\t\t\n\t\treturn $salt;\n\t}", "public static function salt()\r\n {\r\n return hash('sha512', time() . $_SERVER['REMOTE_ADDR']);\r\n }", "public function testHashingSaltGeneration()\n {\n $generator = $this->getTokenGeneratorForTesting(new PseudoRandom());\n\n $resultOne = $generator->getHashingSalt(64);\n $resultTwo = $generator->getHashingSalt(64);\n\n $this->assertNotEquals($resultOne, $resultTwo);\n\n $resultOne = $generator->getHashingSalt(64, false);\n $resultTwo = $generator->getHashingSalt(64, false);\n\n $this->assertNotEquals($resultOne, $resultTwo);\n\n $generator->seedRandomGenerator(42);\n $resultOne = $generator->getHashingSalt(64);\n\n $generator->seedRandomGenerator(42);\n $resultTwo = $generator->getHashingSalt(64);\n\n $this->assertEquals($resultOne, $resultTwo);\n }", "public static function passTheSalt(): string\n {\n return (string) bin2hex(openssl_random_pseudo_bytes(16));\n }", "abstract protected function getGeneratedSalt() ;", "private function getSalt() \n {\n /**\n * the base64 function uses +'s and ending ='s; translate the first, and cut out the latter\n */\n return sprintf('$2a$%02d$%s', $this->rounds, substr(strtr(base64_encode($this->getBytes()), '+', '.'), 0, 22));\n }", "public static function generateRandomSalt($iterationCount = Pbkdf2::SALT_ITERATIONS) {\n\t\tif ($iterationCount < 10) {\n\t\t\t$iterationCount\t= 10;\n\t\t}\n\n\t\t$rand\t= array();\n\t\tfor ($i = 0; $i < $iterationCount; ++$i) {\n\t\t\t$rand[]\t= rand(0, 2147483647);\n\t\t}\n\t\t\n\t\treturn strtolower(hash('sha256', implode('', $rand)));\n\t}", "function generateFixedSalt16Byte()\r\n{\r\n return \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\";\r\n}", "function getNewSalt($length = 10, $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'){\n $str = '';\n $max = mb_strlen($keyspace, '8bit') - 1;\n for ($i = 0; $i < $length; ++$i) {\n //$str .= $keyspace[random_int(0, $max)]; // Fuck this shit for now, I'm in a hurry, so rand() it is\n $str .= $keyspace[rand(0, $max)];\n }\n\n return md5($str);\n }", "function generateHash($plainText, $salt = null) // used in confirm-password.php, class.newuser.php, class.user.php, user-login.php, user-update-account.php\r\n\r\n{\r\n\r\n\tif ($salt === null)\r\n\r\n\t{\r\n\r\n\t\t$salt = substr(md5(uniqid(rand(), true)), 0, 25);\r\n\r\n\t}\r\n\r\n\telse\r\n\r\n\t{\r\n\r\n\t\t$salt = substr($salt, 0, 25);\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\treturn $salt . sha1($salt . $plainText);\r\n\r\n}", "public function GenerateKey()\n // Generates a 22 character salt.\n {\n $this->_SALT = \"$\";\n for($i = 0; $i < 22; $i ++)\n $this->_SALT = $this->_SALT . $this->_CHARSET[mt_rand(0, 63)];\n return $this->_SALT;\n }", "protected function getGeneratedSalt() {}", "protected function getGeneratedSalt() {}", "public function genSalt($input = null)\n {\n if (!$input) {\n $input = $this->_getRandomBytes(6);\n }\n\n $identifier = 'sha1';\n $salt = $this->_encode64($input, 6);\n\n return '$' . $identifier . '$' . $this->_iterationCount . '$' . $salt . '$';\n }", "protected static function _generateSaltMd5() {\n\t\treturn '$1$' . Random::generate(6, ['encode' => Random::ENCODE_BASE_64]);\n\t}", "function makeRandomPassword() { \n $salt = \"abchefghjkmnpqrstuvwxyz0123456789\"; \n srand((double)microtime()*1000000); \n $i = 0; \n while ($i <= 7) { \n $num = rand() % 33; \n $tmp = substr($salt, $num, 1); \n $pass = $pass . $tmp; \n $i++; \n } \n return $pass; \n}", "public function generateSalt($length = 5) {\n return $this->helper->generateSalt($length);\n }", "static public function generateVbPasswordSalt()\n {\n\t\t$hashSalt = '';\n\t\tfor ($i = 0; $i < 3; $i++)\n\t\t{\n\t\t\t$hashSalt .= chr(rand(0x41, 0x5A)); // A..Z\n\t\t}\n\t\t\n\t\treturn $hashSalt;\n }", "protected static function _genSaltMD5() {\n return '$1$' . static::random(6, array('encode' => static::ENCODE_BASE_64));\n }", "function generateRandID(){\n\t\t$userid = $this->getPasswordSalt();\n\t\treturn hash('sha256',$userid);\n\t}", "public static function salt($type = null, $count = null) {\n switch (true) {\n case CRYPT_BLOWFISH == 1 && (!$type || $type === 'bf'):\n return static::_genSaltBf($count);\n case CRYPT_EXT_DES == 1 && (!$type || $type === 'xdes'):\n return static::_genSaltXDES($count);\n default:\n return static::_genSaltMD5();\n }\n }", "function makeRandomPassword() {\r\n\t$salt = \"abchefghjkmnpqrstuvwxyz0123456789\";\r\n\t$pass = \"\";\r\n\tsrand((double)microtime()*1000000);\r\n \t$i = 0;\r\n \twhile ($i <= 7) {\r\n\t\t$num = rand() % 33;\r\n\t\t$tmp = substr($salt, $num, 1);\r\n\t\t$pass = $pass . $tmp;\r\n\t\t$i++;\r\n \t}\r\n \treturn $pass;\r\n}", "public function getSalt()\n {\n //i might implement salt\n }" ]
[ "0.84429735", "0.842341", "0.8390845", "0.8289176", "0.8282504", "0.8245752", "0.8193425", "0.8188384", "0.8121574", "0.81215334", "0.8121143", "0.80835575", "0.8077228", "0.8066766", "0.8022221", "0.80158865", "0.79945695", "0.79945695", "0.798139", "0.79697496", "0.79601127", "0.7936757", "0.78809935", "0.7857039", "0.78563684", "0.7853316", "0.7849039", "0.7839305", "0.7825412", "0.780952", "0.78004503", "0.7780841", "0.7764863", "0.7762878", "0.77465934", "0.77363324", "0.77355456", "0.7732651", "0.77162623", "0.77071834", "0.7702162", "0.7699624", "0.7684761", "0.7682498", "0.76656246", "0.76506597", "0.7640656", "0.762371", "0.76189727", "0.76143", "0.75855243", "0.7554983", "0.7553413", "0.75461227", "0.752474", "0.7521849", "0.748371", "0.74756026", "0.74399114", "0.74347323", "0.7397759", "0.73899007", "0.73882055", "0.73578006", "0.73578006", "0.7314597", "0.73030764", "0.72995335", "0.7299299", "0.7290772", "0.7264165", "0.7246117", "0.72309613", "0.71736556", "0.71523744", "0.7146879", "0.71359473", "0.7133725", "0.7132411", "0.71174717", "0.7108333", "0.71008116", "0.7076809", "0.7068196", "0.70591974", "0.6990864", "0.6952854", "0.69477767", "0.69465333", "0.69465333", "0.6938536", "0.6923105", "0.69037217", "0.69026613", "0.69023734", "0.6842387", "0.6808064", "0.6754512", "0.6741872", "0.67372787" ]
0.8257622
5
Arrange and flatten the incoming elements
function flatten($args){ $res = array(); foreach($args as $a) { if(is_array($a)) $res = array_merge($res, flatten($a)); else $res[] = $a; } return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function flatten();", "public function flatten();", "public function flatten();", "public function flatten() {}", "public function flatten() {}", "protected function _preFlatten() {}", "public function flattenLeft();", "public function flatten(){\n\t\t$this->content=$this->flatten_array_build(\"first\");\n\t\tforeach($this->content as $item){\n\t\t\tif(is_a($item,\"elem\")){\n\t\t\t\t$item->master=$this;\n\t\t\t\t$item->self_closing=true;\n\t\t\t\t$item->content=array();\n\t\t\t}\n\t\t}\n\t\treturn $this;\n\t}", "private function flatten_array_build($first=\"\"){\n\t\t$to_add=array();\n\t\tif($first==\"\"){\n\t\t\tarray_push($to_add,$this);\n\t\t}\n\t\tforeach($this->content as $item){\n\t\t\tif(is_a($item,\"elem\")){\n\t\t\t\t$to_add=array_merge($to_add,$item->flatten_array_build());\n\t\t\t}\n\t\t\telse{\n\t\t\t\tarray_push($to_add,$item);\n\t\t\t}\n\t\t}\n\t\treturn $to_add;\n\t}", "function flat(&$ary) {\n for ($i = 0; $i < count($ary); $i++) {\n while (is_array($ary[$i])) {\n array_splice($ary, $i, 1, $ary[$i]);\n }\n }\n}", "function flatten_and_sort(array $a): array {\n $flatten = array_merge([], ...$a);\n sort($flatten);\n return $flatten;\n }", "public function allFlattened(): array;", "function flatten($input) {\n\t\t$retval=array();\n\t\t$count=0;\n\t\t// var_dump($input);\n\t\tif (is_array($input)){\n\t\t\tforeach($input as $y) {\n\t\t\t\t$retval[$count++]=$this->check_value($y);\n\t\t\t}\n\t\t} else {\n\t\t\t$this->output=$input;\n\t\t}\n\t}", "public function flatten($field = null) {}", "public function flatItems()\n {\n $result = [];\n\n foreach ($this->items as $k => $item) {\n if (! $item->subItems->isEmpty()) {\n $result[$k] = $item;\n $result = array_merge($result, $this->getArrayableItems($item->subItems));\n\n continue;\n }\n\n $result[$k] = $item;\n }\n\n return new static($result);\n }", "function getSimplifiedElements() {\n\t\t\t$newelements = array();\n\t\t\tforeach($this->page_object as $current_row) {\n\t\t\t\t## process the rows- first we need to find out how many entries\n\t\t\t\tforeach($current_row as $current_element) {\n\t\t\t\t\t## here we start calling all our attribute types\n\t\t\t\t\tif(is_array($current_element)) {\n\t\t\t\t\t\t$newelements[] = $current_element;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\t\t\n\t\t\treturn $newelements;\n }", "function _flatten_blocks(&$blocks)\n {\n }", "public function flatten() : Vector\n {\n return Vector::quick(array_merge(...$this->a));\n }", "protected function migrateEntryOrderToStructure()\n {\n $tree = collect($this->entryOrder)\n ->sortKeys()\n ->values()\n ->map(function ($id) {\n return ['entry' => $id];\n })\n ->all();\n\n return [\n 'max_depth' => 1,\n 'tree' => $tree,\n ];\n }", "abstract public function transform(array $item);", "function collect_elements($elems, &$elements) {\r\n foreach ($elems as $elem) {\r\n if ($elem->tagName == 'outline') {\r\n $title = $elem->attributes['text'];\r\n if (is_null($title) || ($title == ''))\r\n $title= $elem->attributes['title'];\r\n $htmlUrl = $elem->attributes['htmlUrl'];\r\n $xmlUrl = $elem->attributes['xmlUrl'];\r\n $type = $elem->attributes['type'];\r\n $description = $elem->attributes['description'];\r\n $hasChildren = ($elem->find_tag('outline') !== false);\r\n \r\n $include = true; // Now process exclusions. We'll assume that we include this one\r\n if ($this->flatten || !$hasChildren) // Especially if it has child elements\r\n {\r\n if (($this->require_feed && !(isset($xmlUrl) && ($xmlUrl != ''))) ||\r\n ($this->require_html && !(isset($htmlUrl) && ($htmlUrl != ''))))\r\n $include = false; \r\n else if ($this->exclude_self)\r\n {\r\n if (isset($htmlUrl)) // Try a domain match against the HTML URL first\r\n {\r\n preg_match(DOMAIN_FILTER, $htmlUrl, $matches);\r\n if (!is_null($matches[2]) && (strcasecmp($matches[2], $this->host) == 0))\r\n $include = false;\r\n }\r\n if ($include && isset($xmlUrl)) // Then any feed\r\n {\r\n preg_match(DOMAIN_FILTER, $xmlUrl, $matches);\r\n if (!is_null($matches[2]) && (strcasecmp($matches[2], $this->host) == 0))\r\n $include = false;\r\n }\r\n }\r\n }\r\n \r\n if ($include) {\r\n \t $elements[$title] = array('htmlUrl' => $htmlUrl, 'xmlUrl' => $xmlUrl, 'type' => $type,\r\n\t\t\t\t'tooltip' => ($this->tooltips ? $description : null),\r\n\t\t\t\t'hasChildren' => ($hasChildren && !$this->flatten),\r\n\t\t\t\t'children' => $elem->children);\r\n }\r\n if ($this->flatten && $hasChildren)\r\n $this->collect_elements($elem->children, $elements);\t// Recurse to add children to the end\r\n }\r\n }\r\n }", "function flatten($array) {\n $result = array();\n foreach($array as $key => $subarray) {\n $result = array_merge($result, $subarray);\n }\n return $result;\n }", "function array_flatten($array) { \r\n if (!is_array($array)) { \r\n return false; \r\n } \r\n $result = array(); \r\n foreach ($array as $key => $value) { \r\n if (is_array($value)) { \r\n $result = array_merge($result, array_flatten($value)); \r\n } else { \r\n $result[$key] = $value; \r\n } \r\n } \r\n return $result; \r\n}", "function flattenArray($array)\n{\n\t$flatArray = array();\n\tforeach ($array as $subElement) {\n \tif (is_array($subElement)) {\n\t\t\t$flatArray = array_merge($flatArray, flattenArray($subElement));\n\t\t} else {\n\t\t\t$flatArray[] = $subElement;\n\t\t}\n\t}\n\n\treturn $flatArray;\n}", "function pi_authoring_convert_heirarchy_form_elements(&$hierarchy_elements)\n{\n\t$rows = array();\n\tforeach (element_children($hierarchy_elements) as $region)\n\t{\n\t\t$rows[$region] = array();\n\t\tforeach (element_children($hierarchy_elements[$region]) as $key)\n\t\t{\n\t\t\t$rows[$region][$key] = array();\n\t\t\t$hierarchy_elements[$region][$key]['weight']['#attributes']['class'] = 'sort_list-weight sort_list-weight-'. $region;\n\t\t\t$hierarchy_elements[$region][$key]['region']['#attributes']['class'] = 'sort_list-region-select sort_list-region-'. $region;\n\n\t\t\t$rows[$region][$key]['title'] = drupal_render($hierarchy_elements[$region][$key]['title']);\n\t\t\t$rows[$region][$key]['description'] = drupal_render($hierarchy_elements[$region][$key]['description']);\n\t\t\t\n\t\t\t$rows[$region][$key]['region'] = drupal_render($hierarchy_elements[$region][$key]['region']);\n\t\t\t$rows[$region][$key]['weight'] = drupal_render($hierarchy_elements[$region][$key]['weight']);\n\t\t}\n\t}\n\treturn $rows;\n}", "function array_flatten(array $array):array\n{\n if (!is_array($array)) {\n return false;\n }\n $result = array();\n foreach ($array as $key => $value) {\n if (is_array($value)) {\n $result = array_merge($result, array_flatten($value));\n } else {\n $result = array_merge($result, array($key => $value));\n }\n }\n return $result;\n}", "function transpose(array $xs)\n{\n if (!$xs) {\n return array();\n }\n //special case: row matrix\n if (count($xs) == 1) {\n return array_chunk($xs[0], 1);\n }\n return call_user_func_array(\n 'array_map',\n array_merge(array(null), $xs)\n );\n}", "public function flatten()\n {\n $output = [];\n foreach (I($this->hash) as $value) {\n $array = __PRIVATE__::getArrayFrom($value);\n $output[] = $array !== null\n ? $array\n // Because of self::getArrayFrom, this will ALWAYS throw its error\n : __CONTRACT__::contentIsA(FoldableInterface::class, $value);\n }\n return static::from(call_user_func_array('array_merge', $output));\n }", "function flatArray($array){\n\t\t$result = [];\n\t\tif (is_array($array)) {\n\t\t\tforeach ($array as $element) {\n\t\t\t\t$result = array_merge($result, flatArray($element));\n\t\t\t}\n\t\t} else {\n\t\t\tarray_push($result, $array);\n\t\t}\n\n\t\treturn $result;\n\t}", "public static function getFlattened(array $elements) {\n $flattened_elements = [];\n foreach ($elements as $key => &$element) {\n if (Element::property($key) || !is_array($element)) {\n continue;\n }\n\n $flattened_elements[$key] = self::getProperties($element);\n $flattened_elements += self::getFlattened($element);\n }\n return $flattened_elements;\n }", "public function flatten(): Set;", "abstract public function combineTo(array $array);", "function inflate($list){\n $r = array();\n $flat = array();\n foreach($list as $val)\n {\n $flat[$val['id']] = $val;\n }\n foreach($list as $val)\n {\n if(!isset($flat[$val['parent']])) {\n $r[$val['id']] = &$flat[$val['id']];\n }\n else {\n if(!isset($flat[$val['parent']]['children'])) $flat[$val['parent']]['children'] = array();\n $flat[$val['parent']]['children'][] = &$flat[$val['id']];\n }\n }\n return $r;\n}", "public static function flatten($collection)\n {\n $flat_collection = $collection instanceof Collection ? $collection->make() : new Collection();\n $collection = func_get_args(); // This can use ... instead of func_get_args() on PHP >= 5.6 http://php.net/manual/en/functions.arguments.php#functions.variable-arg-list\n array_walk_recursive($collection, function ($item, $key) use (&$flat_collection) {\n if ($item instanceof Arrayable) {\n $flat_collection = $flat_collection->merge(self::flatten($item->toArray()));\n } elseif (is_int($key)) {\n $flat_collection->push($item);\n } else {\n $flat_collection->put($key, $item);\n }\n });\n\n return $flat_collection;\n }", "public function testFlatten() {\n\t\t$array = array(\n\t\t\tarray(1, 2, 3),\n\t\t\tarray(4, 5, 6),\n\t\t\tarray(7 => array(8, 9, 0))\n\t\t);\n\t\t$result = _::flatten($array);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(9, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(2, $result[1]);\n\t\t$this->assertEquals(3, $result[2]);\n\t\t$this->assertEquals(4, $result[3]);\n\t\t$this->assertEquals(5, $result[4]);\n\t\t$this->assertEquals(6, $result[5]);\n\t\t$this->assertEquals(8, $result[6]);\n\t\t$this->assertEquals(9, $result[7]);\n\t\t$this->assertEquals(0, $result[8]);\n\n\t\t// test flattening an array shallowly\n\t\t$result = _::flatten($array, true);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(7, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(2, $result[1]);\n\t\t$this->assertEquals(3, $result[2]);\n\t\t$this->assertEquals(4, $result[3]);\n\t\t$this->assertEquals(5, $result[4]);\n\t\t$this->assertEquals(6, $result[5]);\n\t\t$this->assertInternalType('array', $result[6]);\n\t\t$this->assertCount(3, $result[6]);\n\t\t$this->assertEquals(8, $result[6][0]);\n\t\t$this->assertEquals(9, $result[6][1]);\n\t\t$this->assertEquals(0, $result[6][2]);\n\t}", "function array_flatten($array) { \n\tif (!is_array($array)) { \n\t\treturn FALSE; \n\t} \n\t$result = array(); \n\tforeach ($array as $key => $value) { \n\t\tif (is_array($value)) { \n\t\t\t$result = array_merge($result, array_flatten($value)); \n\t\t} \n\t\telse { \n\t\t\t$result[$key] = $value; \n\t\t} \n\t} \n\treturn $result; \n}", "function array_flatten($elevated, $delimiter = '.')\r\n{\r\n $factory = ElevatorFactory::getInstance();\r\n $elevator = $factory->create();\r\n\r\n return $elevator->down($elevated, $delimiter);\r\n}", "function stage_flatten($array, $prefix = '')\n{\n $result = array();\n foreach ($array as $key => $value) {\n if (is_array($value)) {\n $result = $result + stage_flatten($value, $prefix . $key . '.');\n } else {\n $result[$prefix . $key] = $value;\n }\n }\n return $result;\n}", "public function expandAll()\n {\n foreach ($this->_parent[self::BASE_ELT] as $val) {\n $this->expand($val, true);\n }\n }", "function arrayComposition(array $input, int $depth = 1, bool $anyLength = false): array\n{\n $result = [];\n\n if ($depth < 1) {\n return [];\n\n } else if ($depth === 1) {\n foreach ($input as $value) {\n $result[] = [$value];\n }\n\n } else {\n $previous = arrayComposition($input, $depth - 1, $anyLength);\n \n foreach ($input as $value) {\n if ($anyLength) {\n $result[] = [$value];\n }\n foreach ($previous as $value2) {\n $result[] = array_merge([$value], $value2);\n }\n }\n }\n\n return $result;\n}", "function reArrange($source)\r\n{\r\n\t\r\n\t$i = 0;\r\n\t$fact_id=\"\";\r\n\t\t\t\r\n\tforeach($source as $key=>$val)\r\n\t{\t\r\n\t\t$res[$i]['Zone'] = $val['factories']['Zone'];\r\n\t\t\r\n\t\tif( intval($val['RESULT']['status']) == 0 ) \r\n\t\t{\r\n\t\t\t$fact_id = $val['RESULT']['factory_id'];\r\n\t\t\t\r\n\t\t\t$res[$i]['base_fact_id'] = $val['RESULT']['factory_id'];\r\n\t\t\t$res[$i]['base_fact_name'] = $val['factories']['factory_name'];\r\n\t\t\t$res[$i]['base_point'] = $val['RESULT']['points'];\r\n\t\t\t\r\n\t\t\t$res[$i]['follow_fact_id'] = \"\";\r\n\t\t\t$res[$i]['follow_point'] = \"\";\r\n\t\t}\r\n\t\t\t\r\n\t\telseif( intval($val['RESULT']['status']) != 0 ) \r\n\t\t{\r\n\t\t\tif($val['RESULT']['factory_id'] == $fact_id)\r\n\t\t\t{\r\n\t\t\t\t$res[$i-1]['follow_fact_id'] = $val['RESULT']['factory_id'];\r\n\t\t\t\t$res[$i-1]['follow_point'] = $val['RESULT']['points'];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$res[$i]['base_fact_id'] = \"\";\r\n\t\t\t\t$res[$i]['base_point'] = \"\";\r\n\t\t\t\t\r\n\t\t\t\t$res[$i]['follow_fact_id'] = $val['RESULT']['factory_id'];\r\n\t\t\t\t$res[$i]['follow_fact_name'] = $val['factories']['factory_name'];\r\n\t\t\t\t$res[$i]['follow_point'] = $val['RESULT']['points'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$i++;\r\n\t}\r\n\t\r\n\treturn $res;\t\t\r\n}", "public function testArray2XmlNested()\n\t{\n\t\t$in = array(\n\t\t\t'assoc' => array(\n\t\t\t\t'a' => 'alpha',\n\t\t\t\t'b' => 'beta',\n\t\t\t),\n\t\t\t'numerics' => array(\n\t\t\t\t'numeric' => array(\n\t\t\t\t\t0 => 'version 5.5',\n\t\t\t\t\t1 => 'version 5.6',\n\t\t\t\t\t2 => array(\n\t\t\t\t\t\t'beta' => '6',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t),\n\t\t\t'message' => array(\n\t\t\t\t'success',\n\t\t\t\t'error',\n\t\t\t),\n\t\t);\n\n\t\t$xml = $this->getDataElement();\n\t\tInterspire_Xml::addArrayToXML($xml, $in);\n\t\t$out = Interspire_Xml::prettyIndent($xml);\n\n\t\t$expected = Interspire_Xml::getDeclaration();\n\t\t$expected .= '\n<data>\n <assoc>\n <a>alpha</a>\n <b>beta</b>\n </assoc>\n <numerics>\n <numeric>version 5.5</numeric>\n <numeric>version 5.6</numeric>\n <numeric>\n <beta>6</beta>\n </numeric>\n </numerics>\n <message>success</message>\n <message>error</message>\n</data>\n';\n\t\t$this->assertEquals($expected, $out);\n\n\t\t// reverse\n/* @todo update the xml2array function\n\t\t$xml = simplexml_load_string($out);\n\t\t$result = Interspire_Xml::xml2array($xml);\n\t\t$this->assertEquals($in, $result);\n*/\n\t}", "private function __flattenArr(array &$data, &$str)\n\t{\n\t\tforeach($data as $k => $v)\n\t\t{\n\t\t\tif(is_array($v))\n\t\t\t{\n\t\t\t\t$str .= $this->__flattenArr($v, $str);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$str .= str_replace('{$v}', $v, str_replace('{$k}', $k, $this->__pattern));\n\t\t}\n\t}", "private function restructureResults(){\n if (empty($this->_restructredResults)){\n foreach ($this->_ranking->result as $entry){\n $this->_restructuredResults[$entry->value]->votes = $entry->votes;\n $this->_restructuredResults[$entry->value]->rank = $entry->rank;\n }\n }\n return $this->_restructuredResults;\n }", "public function getFlattenItems()\n {\n return $this->items()->active()->where('is_active', 1)->defaultOrder()->get()->toFlatTree();\n }", "private function recursiveTransform($items, $firstLevel = false) {\n $itemsArray = array();\n\n foreach ($items as $item) {\n if (!$firstLevel or !$item->getParent()) {\n $itemArray = array(\n 'id' => $item->getId(),\n 'label' => $item->getName(),\n );\n\n if (count($children = $item->getChildren()) > 0) {\n $itemArray['children'] = $this->recursiveTransform($children);\n }\n\n $itemsArray[$item->getPosition()] = $itemArray;\n }\n }\n\n ksort($itemsArray);\n\n return $itemsArray;\n }", "public function arrange() {}", "function multitosingle($input, $output = array()) {\n ksort($input);\n foreach ($input as $value) {\n $key = count($output);\n if (is_array($value)) {\n $output = multitosingle($value, $output);\n }\n else {\n $output[$key] = $value;\n }\n }\n return $output;\n}", "public function flatten($value)\n {\n }", "protected function xmlToArray(\\SimpleXMLElement $xml, $prefix = '', $clear_cache = true) {\n if ($clear_cache) {\n $this->multiriga = array();\n }\n $out = array();\n\n foreach ($xml->children() as $foglia) {\n $id = ($prefix ? $prefix . '_' : '') . $foglia->getName();\n if (!isset($out[$id])) {\n $out[$id] = $foglia->count() == 0 ? \"{$foglia}\" : $this->xmlToArray($foglia, $prefix, false);\n } else {\n $index = $xml->getName() . '|' . $id;\n if (!in_array($index, $this->multiriga)) {\n $this->multiriga[] = $index;\n $out[$id] = array($out[$id]);\n }\n $out[$id][] = $foglia->count() == 0 ? \"{$foglia}\" : $this->xmlToArray($foglia, $prefix, false);\n }\n }\n\n return $out;\n }", "public function flattenFilters()\n {\n $filters = [];\n foreach ($this->filterdata['filters'] as $filter) {\n if (array_key_exists('filters', $filter)) {\n foreach ($filter['filters'] as $subfilter) {\n $filters[] = $subfilter;\n }\n } else {\n $filters[] = $filter;\n }\n }\n return $filters;\n }", "function erp_array_flatten( $array ) {\n if ( ! is_array( $array ) ) {\n return false;\n }\n $result = array();\n foreach ( $array as $key => $value ) {\n if ( is_array( $value ) ) {\n $result = array_merge( $result, erp_array_flatten( $value ) );\n } else {\n $result[ $key ] = $value;\n }\n }\n\n return $result;\n}", "function md_flatten_keys($a, $lvl = 0){\n\tif(!is_array($a)) return $a;\n\t$b = array();\n\tforeach($a as $k => $v){\n\t\t$b[$k] = $lvl;\n\t\tif(is_array($v)) $b += md_flatten_keys($v, $lvl+1);\n\t}\n\treturn $b;\n}", "public function expandGraphs()\n {\n return $this->graph->map(function (SchemaPiece $graph) {\n return $graph->getData();\n });\n }", "public function toArray($_recursive = TRUE);", "public function testFlatten() {\n $match = $this->collapsed;\n $match['empty'] = null;\n\n $this->assertEquals($match, Hash::flatten($this->expanded));\n }", "private function flattenFilter($filter)\n {\n $ret = [];\n $filters = $filter['compositeFilter']['filters'];\n foreach ($filters as $fltr) {\n $type = array_keys($fltr)[0];\n if ($type === 'compositeFilter') {\n $ret = array_merge($ret, $this->flattenFilter($fltr));\n } else {\n $ret[] = $fltr;\n }\n }\n return $ret;\n }", "public function transformCollection(array $items){\n return array_map([$this,'transform'], $items->toArray());\n }", "protected static function prepare (array $input)\n\t{\n\t\t$sort_me = array();\n\t\t$doubles = array();\n\t\t\n\t\t// Filter and add stubs to $sort_me\n\t\tforeach ($input as $key => $subarray)\n\t\t{\n\t\t\t// Check for name doubles\n\t\t\tif ( ! in_array($subarray[0], $doubles))\n\t\t\t{\n\t\t\t\t// key => priority\n\t\t\t\t$sort_me[$key] = $subarray[1];\n\t\t\t\t// add the name to doubles array\n\t\t\t\t$doubles[] = $subarray[0];\n\t\t\t}\n\t\t}\n\n\t\t// sort by priority, giving you the keys in desired order\n\t\tasort($sort_me);\n\n\t\t$return_me = array();\n\n\t\t// Add the full arrays to $return_me\n\t\tforeach ($sort_me AS $key => $priority)\n\t\t{\n\t\t\t// Move things around to make it a little nicer to work with\n\t\t\t$file = Media::parse($input[$key][0]);\n\t\t\t\n\t\t\t$add_me = array(\n\t\t\t\t'prefix' => $file['prefix'],\n\t\t\t\t'name' => $file['name'],\n\t\t\t\t'priority' => $input[$key][1],\n\t\t\t);\n\t\t\t\n\t\t\t$return_me[] = $add_me;\n\t\t}\n\t\t\n\t\treturn $return_me;\n\t}", "public function flatMap($flatMapper);", "protected static function _flatten($results, $key = null)\n {\n $stack = [];\n foreach ($results as $k => $r) {\n $id = $k;\n if (!is_null($key)) {\n $id = $key;\n }\n if (is_array($r) && !empty($r)) {\n $stack = array_merge($stack, self::_flatten($r, $id));\n } else {\n $stack[] = ['id' => $id, 'value' => $r];\n }\n }\n return $stack;\n }", "function flatten($depth, iterable $items) : iterable\n{\n $index = 0; // to prevent `yield from` from overriding indices\n $flatten = function($depth, $items) use(&$flatten, &$index) {\n foreach ($items as $value) {\n if (is_iterable($value) && $depth > 0) {\n yield from $flatten($depth - 1, $value);\n }\n else {\n yield $index++ => $value;\n }\n }\n };\n \n return _arrayOrIterator($items, partial($flatten, $depth));\n}", "function mc_flatten_array( $events ) {\n\t$new_array = array();\n\tif ( is_array( $events ) ) {\n\t\tforeach ( $events as $event ) {\n\t\t\tforeach ( $event as $e ) {\n\t\t\t\t$new_array[] = $e;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $new_array;\n}", "function array2xml($arr, $sub = null){\r\n\tif(is_null($sub)){\r\n\t\treset($arr);\r\n\t\t$first = key($arr);\r\n\t\t$xml = new SimpleXMLElement(\"<?xml version=\\\"1.0\\\"?><\".$first.\"></\".$first.\">\");\r\n\t\t$arr = $arr[$first];\r\n\t}else{\r\n\t\t$xml = $sub;\r\n\t}\r\n\tforeach($arr as $key => $val){\r\n\t\tif(is_array($val)){\r\n\t\t\tif(!is_numeric($key)){\r\n\t\t\t\t$sub = $xml->addChild(\"$key\");\r\n\t\t\t\tarray2xml($val, $sub);\r\n\t\t\t}else{\r\n\t\t\t\t$sub = $xml->addChild(\"item\".$key);\r\n\t\t\t\tarray2xml($val, $sub);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$xml->addChild($key, htmlspecialchars($val));\r\n\t\t}\r\n\t}\r\n\treturn $xml->asXML();\r\n}", "protected function __toElements(array $nodes): array {\n if (!$nodes) {\n return [];\n }\n\n\n $stack = [];\n foreach ($nodes as $node) {\n $item = new SitemapElement();\n $item->name = $node['name'];\n $item->loc = Y::url('catalog/index', ['item' => $node['page_id']]);\n $item->changefreq = 'weekly';\n $item->children = $this->__toElements((array)$node['children']);\n $item->priority = 0.6;\n $stack[] = $item;\n }\n\n return $stack;\n }", "private function flatten(\n array $array,\n array &$result,\n string $keySeparator = '.',\n string $parentKey = ''\n ) {\n foreach ($array as $key => $value) {\n if (\\is_array($value)) {\n $this->flatten($value, $result, $keySeparator,\n $parentKey . $key . $keySeparator);\n } else {\n $result[$parentKey . $key] = $value;\n }\n }\n }", "public static function flatten(array $input)\n {\n $output = array();\n self::flattenSub($input, $output);\n return $output;\n }", "protected function organizing()\n {\n $nbrOfNodes = \\count($this->getNodes());\n\n for ($i = 0; $i < $nbrOfNodes; $i++) {\n $node = $this->getNodes()[$i];\n\n if ($node instanceof Constraint) {\n if ($node instanceof Index) {\n $this->indexes[] = $node;\n } else {\n $this->constraints[] = $node;\n }\n\n $this->removeNode($i--);\n $nbrOfNodes--;\n }\n }\n }", "private function normalize()\n {\n $field_id = isset($this->columns[0]) ? $this->columns[0] : 'id';\n\n $field_text = isset($this->columns[1]) ? $this->columns[1] : $field_id;\n\n $groups = [];\n\n $has_empty_groups = false;\n\n foreach ($this->data as $key => $datum) {\n $has_empty_groups = !is_numeric($key);\n }\n\n foreach ($this->data as $key => $datum) {\n if (is_array($datum) && isset($datum['id']) && isset($datum['text'])) {\n $this->push($datum);\n\n continue;\n }\n\n if (is_numeric($key)) {\n if (is_string($datum)) {\n $datum = [$datum];\n }\n\n $id = multi_dot_call($datum, $field_id);\n $id = $id === null ? (string) multi_dot_call($datum, '0') : (string) $id;\n\n $text = multi_dot_call($datum, $field_text);\n if (is_array($text)) {\n $lang = App::getLocale();\n $text = $text[$lang] ?? implode($this->separator, $text);\n }\n $text = $text === null ? (string) multi_dot_call($datum, '0') : (string) $text;\n\n if ($id && $text) {\n $text = $id . \") \" . $text;\n }\n\n foreach (array_slice($this->columns, 2) as $part) {\n $t = multi_dot_call($datum, $part);\n if ($t) {\n $text .= $this->separator.$t;\n }\n }\n\n $item = ['id' => $id, 'text' => $text];\n\n if ($id == $this->value) {\n $item['selected'] = true;\n }\n\n if (!$has_empty_groups) {\n $this->push($item);\n } else {\n $groups['Other'][] = $item;\n }\n } else {\n $groups[ucfirst($key)] = $datum;\n }\n }\n\n foreach ($groups as $group_name => $group) {\n $this->push([\n 'text' => $group_name,\n 'children' => collect($group)->map(function ($datum) use ($field_id, $field_text) {\n if (is_string($datum)) {\n $datum = [$field_id => $datum, $field_text => $datum];\n }\n\n $id = (string) multi_dot_call($datum, $field_id);\n\n $text = (string) multi_dot_call($datum, $field_text);\n\n foreach (array_slice($this->columns, 2) as $part) {\n $t = multi_dot_call($datum, $part);\n\n if ($t) {\n $text .= ' '.$t;\n }\n }\n\n $item = ['id' => $id, 'text' => $text];\n\n if ($id == $this->value) {\n $item['selected'] = true;\n }\n\n return $item;\n })->toArray()\n ]);\n }\n }", "public static function transformNestedArrayToFlatArray($input)\n {\n $output_array = [];\n if (is_array($input)) {\n foreach ($input as $value) {\n if (is_array($value)) {\n $output_array = array_merge($output_array, self::transformNestedArrayToFlatArray($value));\n } else {\n array_push($output_array, $value);\n }\n }\n } else {\n array_push($output_array, $input);\n }\n\n return $output_array;\n }", "public function simpleFlattenSet()\n {\n $in = array(1, 2, array(\"a\", \"b\"), 3);\n $expected = array(1, 2, \"a\", \"b\", 3);\n $mock = $this->getMockForAbstractClass(\"\\Fiber\\Fiber\");\n $method = new \\ReflectionMethod($mock, \"flattenSet\");\n $method->setAccessible(true);\n\n $res = $method->invokeArgs($mock, array($in));\n\n $this->assertEquals($expected, $res);\n }", "public function unionDataProvider()\n {\n // A, B, expected result\n return [\n [[], [], []],\n [[], ['a'], ['a']],\n [['a'], ['a'], ['a']],\n [['a'], ['b'], ['a', 'b']],\n [['a', 'b'], [], ['a', 'b']],\n ];\n }", "private function iterate($results): array\n {\n $level = 1;\n while (true) {\n $merged = collect();\n foreach ($results[$level - 1] as $parent) {\n $temp = collect();\n if (is_array($results)) {\n $results[$level] = collect();\n }\n if ($parent->getChildren->isEmpty() != true) { // negation (!) at the start is easy to miss\n $temp = $parent->getChildren;\n }\n $merged = $merged->merge($temp);\n }\n $results[$level] = $merged;\n $merged = collect();//resets merged collection for next level\n if ($results[$level]->isEmpty()) {\n return $results;\n }\n $level++;\n }\n }", "function restructure_sub($list, $more){\n $result = array();\n if($more){\n for($i = 0; $i < count($list); $i++){\n $result[$i]['id'] = $list[$i][0];\n $result[$i]['email'] = $list[$i][1];\n $result[$i]['date'] = $list[$i][2];\n }\n }else{\n $result['id'] = $list[0];\n $result['email'] = $list[1];\n $result['date'] = $list[2];\n }\n return $result;\n}", "public function getToArrayData()\n {\n $out = [];\n\n // Case #0 filter aggregation.\n $aggregation = new FilterAggregation('test_agg');\n\n $filter = $this->getMockBuilder('ONGR\\ElasticsearchBundle\\DSL\\BuilderInterface')\n ->setMethods(['toArray', 'getType'])\n ->getMockForAbstractClass();\n $filter->expects($this->any())\n ->method('getType')\n ->willReturn('test_filter');\n $filter->expects($this->any())\n ->method('toArray')\n ->willReturn(['test_field' => ['test_value' => 'test']]);\n\n $aggregation->setFilter($filter);\n\n $result = [\n 'agg_test_agg' => [\n 'filter' => [\n 'test_filter' => [\n 'test_field' => ['test_value' => 'test'],\n ],\n ],\n ],\n ];\n\n $out[] = [\n $aggregation,\n $result,\n ];\n\n // Case #1 nested filter aggregation.\n $aggregation = new FilterAggregation('test_agg');\n $aggregation->setFilter($filter);\n\n $aggregation2 = $this->getMockBuilder('ONGR\\ElasticsearchBundle\\DSL\\Aggregation\\AbstractAggregation')\n ->disableOriginalConstructor()\n ->setMethods(['toArray', 'getName'])\n ->getMockForAbstractClass();\n $aggregation2->expects($this->any())\n ->method('toArray')\n ->willReturn(['agg_test_agg2' => ['avg' => []]]);\n $aggregation2->expects($this->any())\n ->method('getName')\n ->willReturn('agg_test_agg2');\n\n $aggregation->addAggregation($aggregation2);\n\n $result = [\n 'agg_test_agg' => [\n 'filter' => [\n 'test_filter' => [\n 'test_field' => ['test_value' => 'test'],\n ],\n ],\n 'aggregations' => [\n 'agg_test_agg2' => [\n 'avg' => [],\n ],\n ],\n ],\n ];\n\n $out[] = [\n $aggregation,\n $result,\n ];\n\n return $out;\n }", "public static function toArray( $xml ) {\n\t\tif(is_string($xml)) {\n\t\t\t$xml = new SimpleXMLElement( $xml );\n\t\t}\n\n\t\t$children = $xml->children();\n\n\t\tif(!$children) {\n\t\t\treturn (string) $xml;\n\t\t}\n\n\t\t$arr = array();\n\t\t$adjusted = array(); // used to determine if a node has been converted to an array of nodes\n\t\tforeach($children as $key => $node) {\n\t\t\t$node = SnipplrXML::toArray($node);\n\n\t\t\t// support for 'anon' non-associative arrays\n\t\t\tif($key == 'anon') {\n\t\t\t\t$key = count($arr);\n\t\t\t}\n\n\t\t\t// if the node is already set, put it into an array\n\t\t\tif(isset($arr[$key])) {\n\t\t\t\tif(isset($adjusted[$key]) && $adjusted[$key] == false) {\n\t\t\t\t\t$first_value = $arr[$key];\n\t\t\t\t\t$arr[$key] = array();\n\t\t\t\t\t$arr[$key][] = $first_value;\n\t\t\t\t\t$adjusted[$key] = true;\n\t\t\t\t}\n\n\t\t\t\tif(!is_array($arr[$key]) || (isset($arr[$key][0]) && $arr[$key][0] == null)) {\n\t\t\t\t\t$arr[$key] = array( $arr[$key] );\n\t\t\t\t}\n\t\t\t\t$arr[$key][] = $node;\n\t\t\t} else {\n\t\t\t\t$arr[$key] = $node;\n\t\t\t\t$adjusted[$key] = false;\n\t\t\t}\n\t\t}\n\t\treturn $arr;\n\t}", "static function merge(/*...*/){\n $ar = array_filter(func_get_args(),'is_array'); // remove non-arrays\n $nc = count($ar);\n if($nc==0) return(NULL);\n if($nc==1) return($ar[0]);\n $res = call_user_func_array('array_merge_recursive',$ar);\n $res = ops_narray::_merge_reduce($res);\n return($res);\n }", "private function array_flatten_recursive($input_value, $parent_key = \"\") {\r\n\t\t$output_value = array();\r\n\t\tforeach ($input_value as $key => $value) {\r\n\t\t\t$this_key = (empty($parent_key)) ? $key : $parent_key.\"[{$key}]\";\r\n\t\t\tif (is_array($value)) {\r\n\t\t\t\t$this_value = $this->array_flatten_recursive($value, $this_key);\r\n\t\t\t\tif (!empty($this_value)) { $output_value = array_merge($output_value, $this_value); } else { $output_value[$this_key] = null; }\r\n\t\t\t}\r\n\t\t\telse { $output_value[$this_key] = $value; }\r\n\t\t}\r\n\t\treturn $output_value;\r\n\t}", "function SS_cleanXMLArray($array){\n\tif (is_array($array)){\n\t\tforeach ($array as $k=>$a){\n\t\t\tif (is_array($a) && count($a)==1 && isset($a[0])){\n\t\t\t\t$array[$k] = SS_cleanXMLArray($a[0]);\n\t\t\t}\n\t\t}\n\t}\n\treturn $array;\n}", "public function flatten(): array\n {\n return [\n 'id' => $this->ID,\n 'title' => $this->Title,\n 'location' => $this->Location,\n 'region' => $this->Region,\n 'bucket' => $this->Bucket,\n 'key' => $this->Key,\n 'etag' => $this->ETag,\n 'name' => $this->Name,\n 'size' => $this->getSizeForHuman(),\n 'type' => $this->Type\n ];\n }", "function sortTransits() {\n $sortedtransits = array();\n for( $aspect = 0; $aspect < count($this->m_transit); $aspect++ ) {\n $sortedtransits[substr($this->m_transit[$aspect],17,11)] = $this->m_transit[$aspect];\n }\n ksort($sortedtransits);\n\n unset($this->m_transit);\n $this->m_transit = array();\n reset($sortedtransits);\n while( list($key,$value) = each($sortedtransits) ) {\n array_push(\n $this->m_transit,\n $value\n );\n }\n }", "public function getChildElements() {}", "public abstract function flatten(bool $preserveKeys = false): ArrayMap;", "public function transform()\n {\n $object = $this->resource;\n\n $data = $object instanceof Collection || $object instanceof AbstractPaginator\n ? $object->map([$this, 'transformResource'])->toArray()\n : $this->transformResource($object);\n\n if ($object instanceof AbstractPaginator) {\n $this->withMeta(array_merge(\n $this->getExtra('meta', []), Arr::except($object->toArray(), ['data'])\n ));\n }\n\n $data = array_filter(compact('data') + $this->extras);\n ksort($data);\n\n return $data;\n }", "public function xml2ArrayConvertsEmptyArraysToElementWithoutContent() {}", "protected function flatten( $messages ) {\n\t\t$flat = true;\n\n\t\tforeach ( $messages as $v ) {\n\t\t\tif ( !is_array( $v ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$flat = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tif ( $flat ) {\n\t\t\treturn $messages;\n\t\t}\n\n\t\t$array = array();\n\t\tforeach ( $messages as $key => $value ) {\n\t\t\tif ( !is_array( $value ) ) {\n\t\t\t\t$array[$key] = $value;\n\t\t\t} else {\n\t\t\t\t$plural = $this->flattenPlural( $value );\n\t\t\t\tif ( $plural ) {\n\t\t\t\t\t$array[$key] = $plural;\n\t\t\t\t} else {\n\t\t\t\t\t$newArray = array();\n\t\t\t\t\tforeach ( $value as $newKey => $newValue ) {\n\t\t\t\t\t\t$newArray[\"$key.$newKey\"] = $newValue;\n\t\t\t\t\t}\n\t\t\t\t\t$array += $this->flatten( $newArray );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Can as well keep only one copy around.\n\t\t\t */\n\t\t\tunset( $messages[$key] );\n\t\t}\n\n\t\treturn $array;\n\t}", "public function makeStructure($data) {\r\n $elements = $this->xml->createDocumentFragment();\r\n foreach ($data as $key => $value) {\r\n if (is_array($value)) {\r\n $newElements = $this->makeStructure($value);\r\n $this->makeStructure2($elements, $newElements, $key);\r\n } else {\r\n $this->makeStructure3($key, $value, $elements);\r\n }\r\n }\r\n return $elements;\r\n }", "public function prepareElements()\n {\n // or a specification, from which the appropriate object\n // will be built.\n\n \n\n // We could also define the input filter here, or\n // lazy-create it in the getInputFilter() method.\n }", "private function mapElements(){\n $aux = '';\n if(!empty($this->category_list)){\n foreach($this->category_list as $c) {\n $category = new Category();\n $category->loadTaggedElement($c);\n $aux[] = $category; \n }\n $this->category_list = $aux;\n }\n $aux = '';\n if(!empty($this->user_category_list)) {\n foreach($this->user_category_list as $u) {\n $user_category = new Category();\n $user_category->loadTaggedElement($u);\n $aux[] = $user_category;\n }\n $this->user_category_list = $aux;\n } \n $aux = '';\n if(!empty($this->entity_list)){\n foreach($this->entity_list as $e) {\n $entity = new Entity();\n $entity->loadTaggedElement($e);\n $aux[] = $entity;\n }\n $this->entity_list = $aux;\n }\n $aux = '';\n if(!empty($this->concept_list)){\n foreach($this->concept_list as $c) {\n $concept = new Concept();\n $concept->loadTaggedElement($c);\n $aux[] = $concept;\n }\n $this->concept_list = $aux;\n }\n $aux = '';\n if(!empty($this->time_expression_list)){\n foreach($this->time_expression_list as $t)\n $aux[] = new TimeExpression($t);\n $this->time_expression_list = $aux;\n }\n $aux = '';\n if(!empty($this->money_expression_list)){\n foreach($this->money_expression_list as $m)\n $aux[] = new MoneyExpression($m);\n $this->money_expression_list = $aux;\n }\n $aux = '';\n if(!empty($this->uri_list)){\n foreach($this->uri_list as $u)\n $aux[] = new URI($u);\n $this->uri_list = $aux;\n }\n $aux = '';\n if(!empty($this->phone_expression_list)){\n foreach($this->phone_expression_list as $p)\n $aux[] = new PhoneExpression($p);\n $this->phone_expression_list = $aux;\n } \n $aux = '';\n if(!empty($this->quotation_list)){\n foreach($this->quotation_list as $p)\n $aux[] = new Quotation($p);\n $this->quotation_list = $aux;\n } \n $aux = '';\n if(!empty($this->issue_list)) {\n foreach($this->issue_list as $i)\n $aux[] = new Issue($i);\n $this->issue_list = $aux;\n }\n }", "private function _normalize($list) {\n // If an array wasn't submitted there's nothing to do...\n if (!is_array($list)) {\n return $list;\n }\n $ret = array();\n\n foreach ($list as $key => $val) {\n $val['location'] = isset($val['location']) ? $val['location'] : $key;\n $val['label'] = isset($val['label']) ? $val['label'] : $key;\n $val['class'] = isset($val['class']) ? ' '.$val['class'] : '';\n $val['id'] = isset($val['id']) ? \" id='{$val['id']}'\" : '';\n \n if (isset($val['parent_id'])) {\n if ( isset($ret[$val['parent_id']])) { \n // if parent doesn't exist, the children wont either\n $ret[$val['parent_id']]['children'][$key] = $val;\n }\n } else {\n $ret[$key] = $val;\n }\n }\n return $ret;\n }", "function _postProcess() {\r\n $item = current($this->_struct);\r\n \r\n $ret = array('_name'=>$item['tag'], '_attributes'=>array(), '_value'=>null);\r\n\r\n if (isset($item['attributes']) && count($item['attributes'])>0) {\r\n foreach ($item['attributes'] as $key => $data) {\r\n if (!is_null($data)) {\r\n $item['attributes'][$key] = str_replace($this->_replaceWith, $this->_replace, $item['attributes'][$key]);\r\n }\r\n }\r\n $ret['_attributes'] = $item['attributes'];\r\n if ($this->attributesDirectlyUnderParent)\r\n $ret = array_merge($ret, $item['attributes']);\r\n }\r\n\r\n if (isset($item['value']) && $item['value'] != null)\r\n $item['value'] = str_replace($this->_replaceWith, $this->_replace, $item['value']);\r\n \r\n switch ($item['type']) {\r\n case 'open':\r\n $children = array();\r\n while (($child = next($this->_struct)) !== FALSE ) {\r\n if ($child['level'] <= $item['level'])\r\n break;\r\n \r\n $subItem = $this->_postProcess();\r\n \r\n if (isset($subItem['_name'])) {\r\n if (!isset($children[$subItem['_name']]))\r\n $children[$subItem['_name']] = array();\r\n \r\n $children[$subItem['_name']][] = $subItem;\r\n }\r\n else {\r\n foreach ($subItem as $key=>$value) {\r\n if (isset($children[$key])) {\r\n if (is_array($children[$key]))\r\n $children[$key][] = $value;\r\n else\r\n $children[$key] = array($children[$key], $value);\r\n }\r\n else {\r\n $children[$key] = $value;\r\n }\r\n }\r\n }\r\n }\r\n \r\n if ($this->childTagsDirectlyUnderParent)\r\n $ret = array_merge($ret, $this->_condenseArray($children));\r\n else\r\n $ret['_value'] = $this->_condenseArray($children);\r\n \r\n break;\r\n case 'close':\r\n break;\r\n case 'complete':\r\n if (count($ret['_attributes']) > 0) {\r\n if (isset($item['value']))\r\n $ret['_value'] = $item['value'];\r\n }\r\n else {\r\n\t\t\tif (isset($item['value'])) {\r\n\t\t\t\t$ret = array($item['tag']=> $item['value']);\r\n\t\t\t} else {\r\n\t\t\t\t$ret = array($item['tag']=> \"\");\r\n\t\t\t}\r\n }\r\n break;\r\n }\r\n\r\n //added by Dan Coulter\r\n\r\n \r\n /*\r\n foreach ($ret as $key => $data) {\r\n if (!is_null($data) && !is_array($data)) {\r\n $ret[$key] = str_replace($this->_replaceWith, $this->_replace, $ret[$key]);\r\n }\r\n }\r\n */\r\n return $ret;\r\n }", "private function toArray($xml) {\n if (is_string($xml)) $xml = new SimpleXMLElement($xml);\n $children = $xml->children();\n if ( !$children ) return (string) $xml;\n $arr = array();\n foreach ($children as $key => $node) {\n $node = $this->toArray($node);\n\n // support for 'anon' non-associative arrays\n if ($key == 'anon') {\n \t$key = count($arr);\n }\n\n // if the node is already set, put it into an array\n if (isset($arr[$key])) {\n if (!is_array($arr[$key]) || !isset($arr[$key][0]) || $arr[$key][0] == null) {\n \t$arr[$key] = array($arr[$key]);\n }\n $arr[$key][] = $node;\n } else {\n $arr[$key] = $node;\n }\n }\n\n return $arr;\n }", "public function arrange(): void;", "public function getTransformedArray( ) {\n return \\IndustryTransformer::transform($this->prepareIndustryGreedyData());\n }", "function organizeData($listOne, $listTwo, $listThree, $listFour) {\n return array_map(null, $listOne, $listTwo, $listThree, $listFour);\n}", "private function flattenToc()\n {\n $flattenedToc = array();\n\n $bookItems = $this->normalizePageNames($this->app['publishing.items']);\n $bookItems = $this->fixItemsWithEmptyTocs($bookItems);\n\n // calculate the URL of each book chunk and generate the flattened TOC\n $items = array();\n foreach ($bookItems as $item) {\n $itemToc = array();\n foreach ($item['toc'] as $chunk) {\n // first-level headers\n if (isset($chunk['level']) && 1 == $chunk['level']) {\n $chunk['url'] = sprintf('%s.html', $item['page_name']);\n $chunk['parent'] = null;\n $chunk['config'] = $item['config']; // needed for templates\n\n $parentChunk = $chunk;\n // second-level headers\n } elseif (isset($chunk['level']) && 2 == $chunk['level']) {\n if (1 == $this->app->edition('chunk_level')) {\n $chunk['url'] = sprintf('%s.html#%s', $item['page_name'], $chunk['slug']);\n } elseif (2 == $this->app->edition('chunk_level')) {\n $chunk['url'] = sprintf('%s/%s.html', $item['page_name'], $chunk['slug']);\n }\n\n $chunk['parent'] = $parentChunk;\n // third to sixth level headers\n } elseif (isset($chunk['level'])) {\n if (1 == $this->app->edition('chunk_level')) {\n $chunk['url'] = sprintf('%s.html#%s', $item['page_name'], $chunk['slug']);\n } elseif (2 == $this->app->edition('chunk_level')) {\n $chunk['url'] = sprintf('%s/%s.html#%s', $item['page_name'], $parentChunk['slug'], $chunk['slug']);\n }\n\n $chunk['parent'] = $parentChunk;\n }\n\n $itemToc[] = $chunk;\n\n $flattenedToc[] = $chunk;\n }\n\n $item['toc'] = $itemToc;\n $items[] = $item;\n }\n\n $this->app['publishing.items'] = $items;\n\n return $flattenedToc;\n }", "public static function transpose($array) {\n // array_unshift($array, null);\n // return call_user_func_array('array_map', $array);\n return array_map(null, ...$array);\n }", "private function flatten($arguments, array &$list)\n {\n foreach ($arguments as $key => $item) {\n if (!is_numeric($key)) {\n $list[] = $key;\n }\n\n if (is_scalar($item)) {\n $list[] = strval($item);\n } elseif (null === $item) {\n $list[] = '<null>';\n } else {\n $this->flatten($item, $list);\n }\n }\n }", "function permutations(array $elements)\n{\n if (count($elements) <= 1) {\n yield $elements;\n } else {\n foreach (permutations(array_slice($elements, 1)) as $permutation) {\n foreach (range(0, count($elements) - 1) as $i) {\n $first = array_slice($permutation, 0, $i);\n $second = [$elements[0]];\n $third = array_slice($permutation, $i);\n\n yield array_merge($first, $second, $third);\n }\n }\n }\n}", "private function reconstructActiveFormattingElements()\n {\n $formatting_elements = count($this->a_formatting);\n\n if ($formatting_elements === 0) {\n return false;\n }\n\n /* 3. Let entry be the last (most recently added) element in the list\n of active formatting elements. */\n $entry = end($this->a_formatting);\n\n /* 2. If the last (most recently added) entry in the list of active\n formatting elements is a marker, or if it is an element that is in the\n stack of open elements, then there is nothing to reconstruct; stop this\n algorithm. */\n if ($entry === self::MARKER || in_array($entry, $this->stack, true)) {\n return false;\n }\n\n for ($a = $formatting_elements - 1; $a >= 0; true) {\n /* 4. If there are no entries before entry in the list of active\n formatting elements, then jump to step 8. */\n if ($a === 0) {\n $step_seven = false;\n break;\n }\n\n /* 5. Let entry be the entry one earlier than entry in the list of\n active formatting elements. */\n $a--;\n $entry = $this->a_formatting[$a];\n\n /* 6. If entry is neither a marker nor an element that is also in\n thetack of open elements, go to step 4. */\n if ($entry === self::MARKER || in_array($entry, $this->stack, true)) {\n break;\n }\n }\n\n while (true) {\n /* 7. Let entry be the element one later than entry in the list of\n active formatting elements. */\n if (isset($step_seven) && $step_seven === true) {\n $a++;\n $entry = $this->a_formatting[$a];\n }\n\n /* 8. Perform a shallow clone of the element entry to obtain clone. */\n $clone = $entry->cloneNode();\n\n /* 9. Append clone to the current node and push it onto the stack\n of open elements so that it is the new current node. */\n end($this->stack)->appendChild($clone);\n $this->stack[] = $clone;\n\n /* 10. Replace the entry for entry in the list with an entry for\n clone. */\n $this->a_formatting[$a] = $clone;\n\n /* 11. If the entry for clone in the list of active formatting\n elements is not the last entry in the list, return to step 7. */\n if (end($this->a_formatting) !== $clone) {\n $step_seven = true;\n } else {\n break;\n }\n }\n }" ]
[ "0.6572553", "0.6572553", "0.6572553", "0.64294535", "0.64294535", "0.59844095", "0.5684955", "0.54920286", "0.5478715", "0.5473233", "0.5406621", "0.5406174", "0.5354307", "0.5233504", "0.5209105", "0.51845086", "0.5109105", "0.50831956", "0.50742114", "0.49617583", "0.4940235", "0.49146533", "0.48873818", "0.48857713", "0.48681456", "0.483692", "0.48246866", "0.48057792", "0.47834438", "0.4778124", "0.47556436", "0.47548124", "0.47543126", "0.47502047", "0.47475314", "0.47403106", "0.47373694", "0.47352323", "0.47293726", "0.4728266", "0.47175828", "0.47158062", "0.4715776", "0.47142342", "0.4696103", "0.46959415", "0.46845204", "0.46829602", "0.46789613", "0.4676141", "0.4675587", "0.4674558", "0.46518865", "0.46241656", "0.46221495", "0.46009448", "0.45963633", "0.4594485", "0.45859557", "0.45849508", "0.45786887", "0.45710498", "0.4566135", "0.45659027", "0.45613515", "0.4555345", "0.4553661", "0.4544438", "0.4542188", "0.4539417", "0.45359346", "0.4520307", "0.4520282", "0.45127502", "0.45127192", "0.45126212", "0.44991896", "0.44948417", "0.44945437", "0.44912738", "0.44806904", "0.44796875", "0.447447", "0.4469592", "0.44602773", "0.4459041", "0.44587088", "0.4455653", "0.4454628", "0.4453582", "0.4452571", "0.4451409", "0.44510478", "0.44479784", "0.44458508", "0.44408342", "0.44382286", "0.4438156", "0.44285682", "0.4419594" ]
0.5336411
13
Generate an URL from the arguments passed and existing request variables. If a string is passed as first argument, it is checked to begin with http:// and returned.
function url($array = false, $keep=false, $validate = true, $SiteUrlOnEmptyParamSet = false, $getAliases = true) { if(is_string($array) && !is_numeric($array) && strtolower(substr($array, 0, 4)) == 'www.') return 'http://'.$array; $pass = array(); if($array == false) $array = array(); if(!is_array($array)) $array = array('id' => $array); if($keep === true) { $keep = $_GET->keys(); } elseif($keep !== false && !is_array($keep)) $keep = array($keep); if(!is_array($keep)) $keep = array(); foreach($_REQUEST as $g => $v) { if(!in_array($g, $keep)) continue; elseif(is_array($v)) { foreach($v as $a => $b) { if(!empty($b)) $pass[$g][$a] = $b; } } else $pass[$g] = $v; } $parts = array_merge($pass,$array); $validParts = array(); foreach($parts as $key => $val) { if($key == '#') continue; if(!$validate || ($_REQUEST->validate($key, $val) || $_GET->validate($key, $val))) { $validParts[$key] = $val; } } $url = ''; //FIXME: Config // Short-URL if(true && isset($validParts['id'])) { global $Controller; if(is_numeric($validParts['id']) && $getAliases) { if($obj = $Controller->get($validParts['id'], OVERRIDE)) if($alias = $obj->alias) $validParts['id'] = $alias; } elseif(is_object($validParts['id'])) { if($alias = $validParts['id']->alias) $validParts['id'] = $alias; else $validParts['id'] = $validParts['id']->ID; } $url = '/'.($validParts['id'] != 'frontpage'?$validParts['id']:''); unset($validParts['id']); } $query = http_build_query($validParts,'','&amp;'); if(!empty($query)) $url .= '?'.$query; if(isset($array['#'])) $url.='#'.$array['#']; if((!empty($url) || $SiteUrlOnEmptyParamSet) && $SiteUrlOnEmptyParamSet != -1) { global $SITE; $url = $SITE->URL.$url; } return $url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function elgg_http_build_url(array $parts) {\n\t// build only what's given to us.\n\t$scheme = isset($parts['scheme']) ? \"{$parts['scheme']}://\" : '';\n\t$host = isset($parts['host']) ? \"{$parts['host']}\" : '';\n\t$port = isset($parts['port']) ? \":{$parts['port']}\" : '';\n\t$path = isset($parts['path']) ? \"{$parts['path']}\" : '';\n\t$query = isset($parts['query']) ? \"?{$parts['query']}\" : '';\n\n\t$string = $scheme . $host . $port . $path . $query;\n\n\treturn $string;\n}", "function _http_build_url($parts) { \n return implode(\"\", array(\n isset($parts['scheme']) ? $parts['scheme'] . '://' : '',\n isset($parts['user']) ? $parts['user'] : '',\n isset($parts['pass']) ? ':' . $parts['pass'] : '',\n (isset($parts['user']) || isset($parts['pass'])) ? \"@\" : '',\n isset($parts['host']) ? $parts['host'] : '',\n isset($parts['port']) ? ':' . intval($parts['port']) : '',\n isset($parts['path']) ? $parts['path'] : '',\n isset($parts['query']) ? '?' . $parts['query'] : '',\n isset($parts['fragment']) ? '#' . $parts['fragment'] : ''\n ));\n}", "private function _combineUrl()\n {\n $args = func_get_args();\n $url = '';\n foreach ($args as $arg) {\n if (!is_string($arg)) {\n continue;\n }\n if ($arg[strlen($arg) - 1] !== '/') {\n $arg .= '/';\n }\n $url .= $arg;\n }\n\n return $url;\n }", "function build_url($parts)\n{\n return ( isset($parts['scheme']) ? \"{$parts['scheme']}:\" : '' ) .\n ( ( isset($parts['user']) || isset($parts['host']) ) ? '//' : '' ) .\n ( isset($parts['user']) ? \"{$parts['user']}\" : '' ) .\n ( isset($parts['pass']) ? \":{$parts['pass']}\" : '' ) .\n ( isset($parts['user']) ? '@' : '' ) .\n ( isset($parts['host']) ? \"{$parts['host']}\" : '' ) .\n ( isset($parts['port']) ? \":{$parts['port']}\" : '' ) .\n ( isset($parts['path']) ? \"{$parts['path']}\" : '' ) .\n ( isset($parts['query']) ? \"?{$parts['query']}\" : '' ) .\n ( isset($parts['fragment']) ? \"#{$parts['fragment']}\" : '' );\n}", "function build_url(array $parts) {\n return (isset($parts['scheme']) ? \"{$parts['scheme']}:\" : '') . \n ((isset($parts['user']) || isset($parts['host'])) ? '//' : '') . \n (isset($parts['user']) ? \"{$parts['user']}\" : '') . \n (isset($parts['pass']) ? \":{$parts['pass']}\" : '') . \n (isset($parts['user']) ? '@' : '') . \n (isset($parts['host']) ? \"{$parts['host']}\" : '') . \n (isset($parts['port']) ? \":{$parts['port']}\" : '') . \n (isset($parts['path']) ? \"{$parts['path']}\" : '') . \n (isset($parts['query']) ? \"?{$parts['query']}\" : '') . \n (isset($parts['fragment']) ? \"#{$parts['fragment']}\" : '');\n}", "function http_build_url($url = null, $parts = null, $flags = null, ?array &$new_url = null) {}", "public static function generateURL()\n {\n return $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];\n }", "function create_url( $args ) {\n\tglobal $base_url;\n\t\n\t$base_url = add_query_arg( 'wc-api', 'software-api', $base_url );\n\t\n\treturn $base_url . '&' . http_build_query( $args );\n}", "protected function _url()\n {\n if (!empty($_SERVER['PATH_INFO'])) {\n return $_SERVER['PATH_INFO'];\n }else if (!empty($_SERVER['REQUEST_URI'])) {\n return $_SERVER['REQUEST_URI'];\n }elseif (isset($_SERVER['PHP_SELF']) && isset($_SERVER['SCRIPT_NAME'])) {\n $uri = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['PHP_SELF']);\n } elseif (isset($_SERVER['HTTP_X_REWRITE_URL'])) {\n $uri = $_SERVER['HTTP_X_REWRITE_URL'];\n } elseif ($var = env('argv')) {\n $uri = $var[0];\n }\n return $uri;\n }", "public function getFullUrl($_args = array()) {\n\t\t$links = explode(\"/\", $this->url);\n\t\tif((count($_args) == 0) && (count($this->args) == 0))\n\t\t{\n\t\t\treturn $this->app->baseURL().$this->url;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(count($_args) == count($this->args)) {\n\t\t\t\t$thisurl = $this->app->baseURL();\n\t\t\t\t$nbArgs = 0;\n\t\t\t\tfor($i = 0; $i < count($links); $i++) {\n\t\t\t\t\tif((substr(urldecode($links[$i]), -1) == \"}\") && (substr(urldecode($links[$i]), 0, 1) == \"{\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(isset($_args[$nbArgs])) {\n\t\t\t\t\t\t\t$thisurl .= $_args[$nbArgs];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$nbArgs++;\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$thisurl .= $links[$i];\n\t\t\t\t\t}\n\t\t\t\t\t$thisurl .= \"/\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $thisurl;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new \\Exception(\"Incorrect args array. Your args array has \".count($_args).\" elements. Expected \".count($links).\" elements\");\n\t\t\t\thttp_response_code(500);\n\t\t\t}\n\t\t}\n\t}", "function url($format, $args = null)\n {\n $d = array \n (\n '%route' => server('location.route'),\n '%url' => server('location.url'),\n '%base' => dirname(server('script.name')),\n '%scheme' => server('location.scheme'),\n '%domain' => server('location.domain'),\n '%auto' => server('router.force') ? 'index.php' : \"\",\n '%path' => ltrim(rtrim(server('router.haystack'), '/'), '/'),\n '%query' => rtrim(server('query.string'), '&')\n );\n\n $format = str_ireplace(array_keys($d), array_values($d), $format);\n $format = str_replace('://', $s = '{$s}', $format);\n $format = vsprintf($format, is_array($args) ? $args : array_slice(func_get_args(), 1));\n $format = preg_replace('/\\/+/', '/', $format);\n\n return rtrim(str_replace($s, '://', $format), '/');\n }", "function constructURL($object);", "function request_uri() {\n\t\tif(isset($_SERVER['argv'])) {\n\t\t\t$protocol = 'cli';\n\t\t\t$host = gethostname();\n\t\t\t$path = '/' . $_SERVER['SCRIPT_FILENAME'];\n\t\t\tif(count($_SERVER['argv']) > 1) {\n\t\t\t\tunset($_SERVER['argv'][0]);\n\t\t\t\t$query_string = '?' . http_build_query($_SERVER['argv']);\n\t\t\t} else {\n\t\t\t\t$query_string = '';\n\t\t\t}\n\n\t\t\treturn $protocol . '://' . $host . $path . $query_string;\n\t\t} else {\n\t\t\tif (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) {\n\t\t\t\t$protocol = 'https';\n\t\t\t} else {\n\t\t\t\t$protocol = 'http';\n\t\t\t}\n\t\t\t$host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';\n\t\t\t$path = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';\n\t\t\t$query_string = isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING']) ? ('?' . $_SERVER['QUERY_STRING']) : '';\n\t\t\treturn $protocol . '://' . $host . $path . $query_string;\n\t\t}\n\t}", "public function prepurl_for_display($args)\n {\n $url = $args['url'];\n if ($url != '') {\n if ($url == 'http://' || $url == 'http://http://' || $url == 'http:///') {\n $url = '';\n } elseif (strstr(\"http://\", $url)) {\n $url = \"http://\" . $url;\n }\n }\n return $url;\n }", "public function makeUrlFromRequest()\n {\n $id = __Request::get('id', null);\n $resolvedVO = $this->createResolvedVO($id);\n return $resolvedVO->url;\n }", "function buildURL($args,$id=false,$prefix=\"\") {\n\t\tglobal $modx;\n\t\t\t$query = array();\n\t\t\tforeach ($_GET as $param=>$value) {\n\t\t\t\tif ($param != 'id' && $param != 'q') {\n\t\t\t\t\t$query[htmlspecialchars($param, ENT_QUOTES)] = htmlspecialchars($value, ENT_QUOTES);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!is_array($args)) {\n\t\t\t\t$args = explode(\"&\",$args);\n\t\t\t\tforeach ($args as $arg) {\n\t\t\t\t\t$arg = explode(\"=\",$arg);\n\t\t\t\t\t$query[$prefix.$arg[0]] = urlencode(trim($arg[1]));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tforeach ($args as $name=>$value) {\n\t\t\t\t\t$query[$prefix.$name] = urlencode(trim($value));\n\t\t\t\t}\n\t\t\t}\n\t\t\t$queryString = \"\";\n\t\t\tforeach ($query as $param=>$value) {\n\t\t\t\t$queryString .= '&'.$param.'='.(is_array($value) ? implode(\",\",$value) : $value);\n\t\t\t}\n\t\t\t$cID = ($id !== false) ? $id : $modx->documentObject['id'];\n\t\t\t$url = $modx->makeURL(trim($cID), '', $queryString);\n\t\t\treturn ($modx->config['xhtml_urls']) ? $url : str_replace(\"&\",\"&amp;\",$url);\n\t}", "private function _url($par = array()) {\n\t\t$get = $_GET;\n\t\t\n\t\tforeach ((array) $par AS $key => $val) { //overide value\n\t\t\tif ($key == 'path') //if path, encode\n\t\t\t\t$get['path'] = \\Crypt::encrypt($val);\n\t\t\telse\n\t\t\t\t$get[$key] = $val;\n\t\t}\n\t\t\n\t\t$url = '//';\n\t\t\n\t\t$url .= $this->_sanitize(g($_SERVER, 'HTTP_HOST').'/'.strtok(g($_SERVER, 'REQUEST_URI'), '?'));\n\t\t\n\t\treturn $url.'?'.http_build_query($get);\n\t}", "function url_request(): string\n{\n return url_site() . input_server('REQUEST_URI');\n}", "abstract protected function buildSpecificRequestUri();", "public function url($name, $args = array(), $protocol = 'http') {\n\t\t$url = $this->getNamedUrl($name);\n\t\t//replace any variables in the route definition with supplied args\n\t\tif(preg_match_all('`:([a-zA-Z][a-zA-Z0-9]+)`', $url, $matches)) {\n\t\t\tforeach ($matches[1] as $m) {\n\t\t\t\tif(isset($args[$m])) {\n\t\t\t\t\t$url = str_replace(\":{$m}\", $args[$m], $url);\n\t\t\t\t\tunset($args[$m]);\n\t\t\t\t} else {\n\t\t\t\t\t$url = str_replace(\":{$m}\", null, $url);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$url = str_replace('(', '', $url);\n\t\t\t$url = str_replace(')', '', $url);\n\t\t\t$url = rtrim($url, '/');\n\t\t}\n\t\t//append get variables using any args that are left\n\t\tif(!empty($args)) {\n\t\t\t$url .= '?' . http_build_query($args);\n\t\t}\n\t\treturn Url::to($url, $protocol);\n\t}", "function build_url($strip_vars = false)\n{\n\tglobal $user, $phpbb_root_path;\n\n\t// Append SID\n\t$redirect = append_sid($user->page['page'], false, false);\n\n\t// Add delimiter if not there...\n\tif (strpos($redirect, '?') === false)\n\t{\n\t\t$redirect .= '?';\n\t}\n\n\t// Strip vars...\n\tif ($strip_vars !== false && strpos($redirect, '?') !== false)\n\t{\n\t\tif (!is_array($strip_vars))\n\t\t{\n\t\t\t$strip_vars = array($strip_vars);\n\t\t}\n\n\t\t$query = $_query = array();\n\n\t\t$args = substr($redirect, strpos($redirect, '?') + 1);\n\t\t$args = ($args) ? explode('&', $args) : array();\n\t\t$redirect = substr($redirect, 0, strpos($redirect, '?'));\n\n\t\tforeach ($args as $argument)\n\t\t{\n\t\t\t$arguments = explode('=', $argument);\n\t\t\t$key = $arguments[0];\n\t\t\tunset($arguments[0]);\n\n\t\t\t$query[$key] = implode('=', $arguments);\n\t\t}\n\n\t\t// Strip the vars off\n\t\tforeach ($strip_vars as $strip)\n\t\t{\n\t\t\tif (isset($query[$strip]))\n\t\t\t{\n\t\t\t\tunset($query[$strip]);\n\t\t\t}\n\t\t}\n\n\t\t// Glue the remaining parts together... already urlencoded\n\t\tforeach ($query as $key => $value)\n\t\t{\n\t\t\t$_query[] = $key . '=' . $value;\n\t\t}\n\t\t$query = implode('&', $_query);\n\n\t\t$redirect .= ($query) ? '?' . $query : '';\n\t}\n\n\t// We need to be cautious here.\n\t// On some situations, the redirect path is an absolute URL, sometimes a relative path\n\t// For a relative path, let's prefix it with $phpbb_root_path to point to the correct location,\n\t// else we use the URL directly.\n\t$url_parts = @parse_url($redirect);\n\n\t// URL\n\tif ($url_parts !== false && !empty($url_parts['scheme']) && !empty($url_parts['host']))\n\t{\n\t\treturn str_replace('&', '&amp;', $redirect);\n\t}\n\n\treturn $phpbb_root_path . str_replace('&', '&amp;', $redirect);\n}", "protected function generateString()\n\t{\n\t\t// start with the scheme\n\t\t$url = $this->scheme . '://';\n\t\t\n\t\t// user and password\n\t\tif( !empty( $this->user ) )\n\t\t{\n\t\t\t$url .= $this->user;\n\t\t\tif( !empty( $this->pass ) ) $url .= ':'.$this->pass.'@';\n\t\t\telse $url .= '@';\n\t\t}\n\t\t\n\t\t// add the host and path\n\t\t$url .= $this->host . '/';\n\t\t$url .= $this->path;\n\t\t\n\t\t// add the URL-encoded parameters\n\t\tif( !empty( $this->params ) )\n\t\t{\n\t\t\t$url .= '?';\n\t\t\tforeach( $this->params as $f => $v ) $url .= $f . '=' . urlencode( $v ) . '&';\n\t\t\t$url = rtrim( $url, '&' );\n\t\t}\n\t\t\n\t\t// add the anchor if any\n\t\tif( !empty( $this->anchor ) ) $url .= '#' . $this->anchor;\n\t\t\n\t\t$this->url = $url;\n\t\t$this->modified = false;\n\t\treturn $url;\n\t}", "public function getFullUrl(){\n return 'http://'. $_SERVER['HTTP_HOST'] .'/'. implode('/', self::$_request_vars);\n }", "private function generateURL()\n\t{\n\t\t// Is there's a query string, strip it from the URI\n\t\t$sURI\t= ($iPos = strpos($_SERVER['REQUEST_URI'], '?')) ?\n\t\t\t\t\tsubstr($_SERVER['REQUEST_URI'], 0, $iPos) :\n\t\t\t\t\t$_SERVER['REQUEST_URI'];\n\n\t\t// Is there's a ampersand string, strip it from the URI\n\t\t$sURI\t= ($i = strpos($sURI, '&')) ?\n\t\t\t\t\tsubstr($sURI, 0, $i) :\n\t\t\t\t\t$sURI;\n\n\t\t// Is there's a hash string, strip it from the URI\n\t\t$sURI\t= ($i = strpos($sURI, '#')) ?\n\t\t\t\t\tsubstr($sURI, 0, $i) :\n\t\t\t\t\t$sURI;\n\n\t\t// If we're on page 1\n\t\tif($this->iPage == 1)\n\t\t{\n\t\t\t$this->sURL\t\t= $sURI;\n\t\t}\n\t\t// Else we need to pull off the current page\n\t\telse\n\t\t{\n\t\t\t// Split the URI by / after trimming them off the front and end\n\t\t\t$aURI\t= explode('/', trim($sURI, '/'));\n\n\t\t\t// If the last part doesn't match the current page\n\t\t\t$iPage\t= array_pop($aURI);\n\t\t\tif($iPage != $this->iPage) {\n\t\t\t\ttrigger_error(__METHOD__ . ' Error: Invalid page passed. ' . $iPage . ' / ' . $this->iPage, E_USER_ERROR);\n\t\t\t}\n\n\t\t\t// If there is no other parts\n\t\t\tif(count($aURI) == 0) {\n\t\t\t\t$this->sURL = '/';\n\t\t\t} else {\n\t\t\t\t$this->sURL = '/' . implode('/', $aURI) . '/';\n\t\t\t}\n\t\t}\n\n\t\t// Set the query string\n\t\t$this->sQuery\t= ($iPos) ? substr($_SERVER['REQUEST_URI'], $iPos) : '';\n\t}", "protected function _build_url() {\n\n $params = array_filter([\n 'name' => $this->_names,\n 'country_id' => $this->_country_id,\n 'language_id' => $this->_language_id,\n ], function($v) {\n if (!is_array($v)) {\n return strlen(trim($v)) > 0;\n } else {\n return $v;\n }\n });\n //Only pass apikey if there is one set\n if ($api_key = $this->get_api_key()) {\n $params['apikey'] = trim($api_key);\n }\n\n return self::BASE . '?' . http_build_query($params);\n }", "public function getUrl() {\n $url = $this->request->get_normalized_http_url() . '?';\n $url .= http_build_query($this->request->get_parameters(), '', '&');\n\n return $url;\n }", "function build_pixel_url() {\n\t\tif ( $this->error ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$args = get_object_vars( $this );\n\n\t\t// Request Timestamp and URL Terminator must be added just before the HTTP request or not at all.\n\t\tunset( $args['_rt'] );\n\t\tunset( $args['_'] );\n\n\t\t$validated = self::validate_and_sanitize( $args );\n\n\t\tif ( is_wp_error( $validated ) )\n\t\t\treturn '';\n\n\t\treturn Jetpack_Tracks_Client::PIXEL . '?' . http_build_query( $validated );\n\t}", "public function getRequestURL() {\n\t\t$scheme = $this->getScheme();\n\t\t$port = $this->getServerPort();\n\t\t$url = $scheme . '://';\n\t\t$url .= $this->getServerName();\n\t\tif(($scheme == 'http' && $port != 80) || ($scheme == 'https' && $port != 443)) {\n\t\t\t$url .= ':' . $port;\n\t\t}\n\t\t$url .= $this->getRequestURI();\n\t\treturn $url;\n\t}", "function build_url($base,$url) {\n $base_parts=url_parts($base);\n\n # https://code.google.com/p/add-mvc-framework/issues/detail?id=81\n if (preg_match('/^javascript\\:/',$url)) {\n return $url;\n }\n\n if ($url[0]==='/') {\n return rtrim($base_parts['protocol_domain'],'/').$url;\n }\n if ($url[0]==='?') {\n if (!$base_parts['pathname'])\n $base_parts['pathname']='/';\n return $base_parts['protocol_domain'].$base_parts['pathname'].$url;\n }\n if ($url[0]==='#') {\n\n }\n if (preg_match('/^https?\\:\\/+/',$url)) {\n return $url;\n }\n\n return rtrim($base_parts['protocol_domain'],\"/\").$base_parts['path'].$url;\n}", "private function generate_url($params) {\n $s = ($_SERVER['HTTPS'] == 'on') ? 's' : '';\n $protocol = $this->strleft(strtolower($_SERVER['SERVER_PROTOCOL']), '/') . $s;\n $port = (($_SERVER['SERVER_PORT'] == '80' && $_SERVER['HTTPS'] != 'on') ||\n ($_SERVER['SERVER_PORT'] == '443' && $_SERVER['HTTPS'] == 'on')) ? \n '' : (':' .$_SERVER['SERVER_PORT']);\n $path = $this->strleft($_SERVER['REQUEST_URI'], '?');\n $parsed_params = '';\n $delm = '?';\n foreach (array_reverse($params) as $key => $val) {\n if (!empty($val)) {\n $parsed_key = $key[0] == '_' ? $key : '_' . $key;\n $parsed_params .= $delm . urlencode($parsed_key) . '=' . urlencode($val);\n $delm = '&';\n }\n }\n $cfg = rcmail::get_instance()->config->all();\n if ( $cfg['cas_webmail_server_name'] ) {\n $serverName = $cfg['cas_webmail_server_name'];\n } else {\n $serverName=$_SERVER['SERVER_NAME'];\n }\n return $protocol . '://' . $serverName . $port . $path . $parsed_params;\n }", "public function to_url() {\n $post_data = $this->to_postdata();\n $out = $this->get_normalized_http_url();\n if ($post_data) {\n $out .= '?'.$post_data;\n }\n return $out;\n }", "private function getRequestUrl()\n {\n $url = get_request_url_schema() . '://' . app()->request()->getHost();\n if ((app()->request()->getScheme() === 'https' && app()->request()->getPort() !== 443) || (app()->request()->getScheme() === 'http' && app()->request()->getPort() !== 80)) {\n $url .= sprintf(':%s', app()->request()->getPort());\n }\n\n return $url;\n }", "function buildUrl($parts=array()){\r\n\t$uparts=array();\r\n\tforeach($parts as $key=>$val){\r\n\t\tif(preg_match('/^(PHPSESSID|GUID|debug|error|username|password|add_result|domain_href|add_id|add_table|edit_result|edit_id|edit_table|)$/i',$key)){continue;}\r\n\t\tif(preg_match('/^\\_(login|pwe|try|formfields|action|view|formname|enctype|fields|csuid|csoot)$/i',$key)){continue;}\r\n\t\tif(!is_string($val) && !isNum($val)){continue;}\r\n\t\tif(!strlen(trim($val))){continue;}\r\n\t\tif($val=='Array'){continue;}\r\n\t\tarray_push($uparts,\"$key=\" . encodeURL($val));\r\n \t}\r\n $url=implode('&',$uparts);\r\n return $url;\r\n\t}", "public function url(){\n $protocol = \"http://\";\n if ( !empty( $_SERVER['HTTPS'] ) ) {\n $protocol = \"https://\";\n }\n $url = $protocol . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\n return $url;\n }", "public function url()\n {\n $scheme = $this->scheme();\n $scheme = $scheme ? $scheme . '://' : '//';\n $query = $this->query() ? '?' . http_build_query($this->query()) : '';\n $fragment = $this->fragment() ? '#' . $this->fragment() : '';\n return $scheme . $this->host() . $this->path() . $query . $fragment;\n }", "public function link() {\n $num_args = func_num_args();\n $optional = $this->simple_expression->getOptionalPlaceholderCount();\n $max_args = $this->simple_expression->getPlaceholderCount();\n // correct number of arguments given?\n if($num_args <= $max_args && $num_args >= $max_args - $optional) {\n\n $args = func_get_args();\n\n // add some empty entries in where for the not given optional arguments\n $optional > 0 && $args = array_values(array_merge($args, array_fill(0, $optional, null)));\n\n foreach($args as $key => $arg) {\n if(is_array($arg)) {\n $args[$key] = array_map('urlencode', $arg);\n } else {\n $args[$key] = urlencode($arg);\n }\n }\n $args = array_map('urlencode', $args);\n\n $link = $this->simple_expression->replace($args, false);\n } else {\n throw new BadMethodCallException(\"Invalid number of arguments when linking to '{$this->url}'\");\n }\n\n return $link;\n }", "function nebula_requested_url($host=\"HTTP_HOST\") { //Can use \"SERVER_NAME\" as an alternative to \"HTTP_HOST\".\n\t$protocol = ( (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443 ) ? 'https' : 'http';\n\t$full_url = $protocol . '://' . $_SERVER[\"$host\"] . $_SERVER[\"REQUEST_URI\"];\n\treturn $full_url;\n}", "protected function buildUrl($resource_path, array $variables) {\n if (!empty($resource_path)) {\n $url = $this->endpoint . $resource_path;\n }\n else {\n $url = $this->endpoint;\n }\n\n // Set the options to be used by url().\n $options = array(\n 'query' => isset($variables['query']) ? $variables['query'] : '',\n 'absolute' => TRUE,\n 'alias' => TRUE,\n 'external' => TRUE,\n );\n\n // TODO: find a way to skip hook_url_outbound or migrate url() function\n // to internal function.\n $url = url($url, $options);\n\n return $url;\n }", "function url_to(...$arguments):string\n{\n if (count(locales()) < 2) {\n return call_user_func_array('url', $arguments);\n }\n\n return url_add_locale(call_user_func_array('url', $arguments), locale());\n}", "private static function createRedirectUrl() {\n\t\t$path = \\explode('?', $_SERVER['REQUEST_URI'], 2)[0];\n\n\t\treturn $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['SERVER_NAME'] . $path;\n\t}", "function getURL($fileContextPath_)\n\t{\n\t\t$server_protocol = htmlspecialchars($_SERVER[\"SERVER_PROTOCOL\"]);\n\t\t$server_name = htmlspecialchars($_SERVER[\"SERVER_NAME\"]);\n\t\t$server_port = htmlspecialchars($_SERVER[\"SERVER_PORT\"]);\n\t\t$url = strtolower(substr($server_protocol,0, strpos($server_protocol, '/')));\t// http\n\t\t$url .= \"://$server_name:$server_port/$fileContextPath_\";\n\n\t\treturn $url;\n\t}", "function _build_url() {\n\t\t// Add transaction ID for better detecting double requests in AUTH server\n\t\tif($GLOBALS['config']['application']['tid'] == '') $GLOBALS['config']['application']['tid'] = rand(0, 10000);\n\n\t\t$url = $this->url.'&action='.$this->action.'&tid='.$GLOBALS['config']['application']['tid'];\n\t\t\n\t\treturn $url;\n\t}", "function generate_url($u) {\n return is_scalar($u) ? (string) $u : url_for($u);\n}", "protected function prepareRequestUri()\n {\n $requestUri = '';\n\n if ($this->headers->has('X_REWRITE_URL') && false !== stripos(PHP_OS, 'WIN')) {\n // check this first so IIS will catch\n $requestUri = $this->headers->get('X_REWRITE_URL');\n } elseif ($this->server->get('IIS_WasUrlRewritten') == '1' && $this->server->get('UNENCODED_URL') != '') {\n // IIS7 with URL Rewrite: make sure we get the unencoded url (double slash problem)\n $requestUri = $this->server->get('UNENCODED_URL');\n } elseif ($this->server->has('REQUEST_URI')) {\n $requestUri = $this->server->get('REQUEST_URI');\n // HTTP proxy reqs setup request uri with scheme and host [and port] + the url path, only use url path\n $schemeAndHttpHost = $this->getScheme().'://'.$this->getHttpHost();\n if (strpos($requestUri, $schemeAndHttpHost) === 0) {\n $requestUri = substr($requestUri, strlen($schemeAndHttpHost));\n }\n } elseif ($this->server->has('ORIG_PATH_INFO')) {\n // IIS 5.0, PHP as CGI\n $requestUri = $this->server->get('ORIG_PATH_INFO');\n if ($this->server->get('QUERY_STRING')) {\n $requestUri .= '?'.$this->server->get('QUERY_STRING');\n }\n }\n\n return $requestUri;\n }", "public function url()\n {\n if (empty($this->parameters)) {\n return $this->url;\n }\n $total = array();\n foreach ($this->parameters as $k => $v) {\n if (is_array($v)) {\n foreach ($v as $va) {\n $total[] = HttpClient::urlencodeRFC3986($k).\"[]=\".HttpClient::urlencodeRFC3986($va);\n }\n } else {\n $total[] = HttpClient::urlencodeRFC3986($k).\"=\".HttpClient::urlencodeRFC3986($v);\n }\n }\n $out = implode(\"&\", $total);\n\n return $this->url.'?'.$out;\n }", "function buildLinkWithQueryString($userName, $firstName, $lastName, $email) {\t\n\t$linkWithQueryString = 'index.php?userName=' . $userName . '&firstName=' . $firstName . '&lastName=' . $lastName . \n\t'&email=' . $email;\t\n\treturn $linkWithQueryString;\t\t\n}", "protected function _getUrl()\n {\n $s = empty($_SERVER['HTTPS']) ? '' : ($_SERVER['HTTPS'] == 'on') ? 's' : '';\n\n $protocol = substr(strtolower($_SERVER['SERVER_PROTOCOL']), 0, strpos(strtolower($_SERVER['SERVER_PROTOCOL']), '/')) . $s;\n\n $port = ($_SERVER['SERVER_PORT'] == '80') ? '' : (':'.$_SERVER['SERVER_PORT']);\n\n return $protocol . '://' . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];\n }", "public static function buildURLFromParts($url_parts, $normalize = false) {\n // Host has to be set aat least\n if (!isset($url_parts[\"host\"])) {\n throw new Exception(\"Cannot generate URL, host not specified!\");\n }\n\n if (!isset($url_parts[\"protocol\"]) || $url_parts[\"protocol\"] == \"\")\n $url_parts[\"protocol\"] = \"http://\";\n if (!isset($url_parts[\"port\"]))\n $url_parts[\"port\"] = 80;\n if (!isset($url_parts[\"path\"]))\n $url_parts[\"path\"] = \"\";\n if (!isset($url_parts[\"file\"]))\n $url_parts[\"file\"] = \"\";\n if (!isset($url_parts[\"query\"]))\n $url_parts[\"query\"] = \"\";\n if (!isset($url_parts[\"auth_username\"]))\n $url_parts[\"auth_username\"] = \"\";\n if (!isset($url_parts[\"auth_password\"]))\n $url_parts[\"auth_password\"] = \"\";\n\n // Autentication-part\n $auth_part = \"\";\n if ($url_parts[\"auth_username\"] != \"\" && $url_parts[\"auth_password\"] != \"\") {\n $auth_part = $url_parts[\"auth_username\"] . \":\" . $url_parts[\"auth_password\"] . \"@\";\n }\n\n // Port-part\n $port_part = \":\" . $url_parts[\"port\"];\n\n // Normalize\n if ($normalize == true) {\n if ($url_parts[\"protocol\"] == \"http://\" && $url_parts[\"port\"] == 80 ||\n $url_parts[\"protocol\"] == \"https://\" && $url_parts[\"port\"] == 443) {\n $port_part = \"\";\n }\n\n // Don't add port to links other than \"http://\" or \"https://\"\n if ($url_parts[\"protocol\"] != \"http://\" && $url_parts[\"protocol\"] != \"https://\") {\n $port_part = \"\";\n }\n }\n\n // If path is just a \"/\" -> remove it (\"www.site.com/\" -> \"www.site.com\")\n if ($url_parts[\"path\"] == \"/\" && $url_parts[\"file\"] == \"\" && $url_parts[\"query\"] == \"\")\n $url_parts[\"path\"] = \"\";\n\n // Put together the url\n $url = $url_parts[\"protocol\"] . $auth_part . $url_parts[\"host\"] . $port_part . $url_parts[\"path\"] . $url_parts[\"file\"] . $url_parts[\"query\"];\n\n return $url;\n }", "public function url() {\n if (empty($this->parameters)) {\n return $this->url;\n }\n\n return $this->url . '?' . http_build_query($this->parameters);\n }", "function create_url($event = null, $day = null, $set = null, $shot = null) {\n\t\t$event = $event ? \"?event=$event\" : null;\n\t\t$day = $day ? \"&day=$day\" : null;\n\t\t$set = $set ? \"&set=$set\" : null;\n\t\t$shot = $shot ? \"&shot=$shot\" : null;\n\t\treturn \"$event$day$set$shot\";\n\t}", "public function to_url()\n {\n $post_data = $this->to_postdata();\n $out = $this->get_http_url();\n if ($post_data) {\n $out .= '?'.$post_data;\n }\n\n return $out;\n }", "function build_url ($path, $url_params = array(), $xhtml = true, $full_http_path = false)\n{\n\tglobal $phpframe_build_url_hooks;\n\n // Call build_url hooks to modify path/url params\n\tforeach ($phpframe_build_url_hooks as $callback)\n\t{\n\t\teval($callback.'($path, $url_params, $xhtml, $full_http_path);');\n\t}\n\t\n\t// Set root path if path is not absolute already\n\tif (!preg_match('#^(https?\\://)#si', $path))\n\t{\n\t\t// Include root path to file, relative to top-level web directory? \n\t\tif (!preg_match('#^/#', $path))\n\t\t{\n\t\t\t$path = (is_string($full_http_path) ? '/' : PHPFRAME_ROOT_PATH) . $path;\n\t\t}\n\t\t\n\t\t// Include http://?\n\t\tif ($full_http_path)\n\t\t{\n\t\t\t$path = ($full_http_path === true ? PHPFRAME_ROOT_URL : $full_http_path) . $path;\n\t\t}\n\t}\n\t\n\t// Add URL parameters\n\t$path .= build_url_params($url_params);\n\t\n\t// If it's XHTML, htmlspecialchar it\n\t// This is in case URLs have quotes in them which can break <a> tags\n\tif ($xhtml)\n\t{\n\t\t$path = htmlspecialchars($path);\n\t}\n\t\n\treturn $path;\n}", "public function get_normalized_http_url() {\n\t\t$scheme = empty( $_SERVER['HTTPS'] ) ? 'http' : 'https';\n\n\t\t$parts = parse_url(\n\t\t\t$scheme .\n\t\t\t'://' . $_SERVER['HTTP_HOST'] .\n\t\t\t$_SERVER['REQUEST_URI']\n\t\t);\n\n\t\t$port = @$parts['port'];\n\t\t$scheme = $parts['scheme'];\n\t\t$host = $parts['host'];\n\t\t$path = @$parts['path'];\n\n\t\t$port or $port = ( $scheme == 'https' ) ? '443' : '80';\n\n\t\tif ( ( $scheme == 'https' && $port != '443' ) || ( $scheme == 'http' && $port != '80' ) ) {\n\t\t\t$host = \"$host:$port\";\n\t\t}\n\n\t\treturn \"$scheme://$host$path\";\n\t}", "public function build_pixel_url() {\n\t\tif ( $this->error ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$args = get_object_vars( $this );\n\n\t\t// Request Timestamp and URL Terminator must be added just before the HTTP request or not at all.\n\t\tunset( $args['_rt'], $args['_'] );\n\n\t\t$validated = self::validate_and_sanitize( $args );\n\n\t\tif ( is_wp_error( $validated ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn esc_url_raw( WC_Tracks_Client::PIXEL . '?' . http_build_query( $validated ) );\n\t}", "function set_url($path = null) {\n //check if is a valid url \n if (filter_var($path, FILTER_VALIDATE_URL) !== FALSE) {\n return $path;\n } else {\n return SITE_ADDR . $path;\n }\n}", "function get_url() {\n $url = isset($_SERVER['HTTPS']) && 'on' === $_SERVER['HTTPS'] ? 'https' : 'http';\n $url .= '://' . $_SERVER['SERVER_NAME'];\n $url .= in_array($_SERVER['SERVER_PORT'], array('80', '443')) ? '' : ':' . $_SERVER['SERVER_PORT'];\n $url .= $_SERVER['REQUEST_URI'];\n return $url;\n}", "public static function getRequestUrl() {\n\t\t$protocol = 'http';\n\t\tif (isset($_SERVER[\"HTTPS\"]) && $_SERVER[\"HTTPS\"] == \"on\") {\n\t\t\t$protocol = 'https';\n\t\t}\n\t\n\t\t$port = ($_SERVER[\"SERVER_PORT\"] == \"80\") ? \"\" : (\":\".$_SERVER[\"SERVER_PORT\"]);\n\t\treturn $protocol . \"://\" . self::getRequestHost() . $port . $_SERVER['REQUEST_URI'];\n\t}", "static public function http_build_str(array $url_components, $relative = TRUE)\n {\n $url = '';\n\n if ( ! $relative)\n {\n if (($scheme = arr::get($url_components, 'scheme')) != NULL)\n {\n $url .= $scheme.'://';\n }\n\n if (($host = arr::get($url_components, 'host')) != NULL)\n {\n $url .= $host;\n }\n }\n\n if (($path = arr::get($url_components, 'path')) != NULL)\n {\n $url .= $path;\n }\n\n if (($query = arr::get($url_components, 'query')) != NULL)\n {\n $url .= '?'.$query;\n }\n\n if (($fragment = arr::get($url_components, 'fragment')) != NULL)\n {\n $url .= '#'.$fragment;\n }\n\n return $url;\n }", "function makeUrlFromPostvars($target)\n{\n\tglobal $ATK_VARS;\n\n\tif(count($ATK_VARS ))\n\t{\n\t\t$url = $target.\"?\";\n\t\tforeach ($ATK_VARS as $key => $val)\n\t\t{\n\t\t\t$url .= $key.\"=\".rawurlencode($val).\"&\";\n\t\t}\n\t\treturn $url;\n\t}\n\treturn \"\";\n}", "public function to_url()\n {\n $out = $this->get_normalized_http_url() . \"?\";\n $out .= $this->to_postdata();\n return $out;\n }", "protected function _getUrl() {\n\t\t\t$this->_url =\timplode('/', array(\n\t\t\t\t$this->_baseUrlSegment,\n\t\t\t\t$this->_apiSegment,\n\t\t\t\timplode('_', array(\n\t\t\t\t\t$this->_type,\n\t\t\t\t\t$this->_language,\n\t\t\t\t\t$this->_locale,\n\t\t\t\t)),\n\t\t\t\t$this->_apiVersionSegment,\n\t\t\t\t$this->controller,\n\t\t\t\t$this->function\t\n\t\t\t));\n\n\t\t\tempty($this->_getFields) ?: $this->_url .= '?' . http_build_query($this->_getFields);\n\t\t}", "public function get_http_url()\n {\n $parts = parse_url($this->http_url);\n\n $port = @$parts['port'];\n $scheme = $parts['scheme'];\n $host = $parts['host'];\n $path = @$parts['path'];\n\n $port or $port = ($scheme == 'https') ? '443' : '80';\n\n if (($scheme == 'https' && $port != '443')\n || ($scheme == 'http' && $port != '80')) {\n $host = \"$host:$port\";\n }\n\n return \"$scheme://$host$path\";\n }", "function full_url() {\n\t$s = empty($_SERVER[\"HTTPS\"]) ? '' : ($_SERVER[\"HTTPS\"] == \"on\") ? \"s\" : \"\";\n\t$protocol = substr(strtolower($_SERVER[\"SERVER_PROTOCOL\"]), 0, strpos(strtolower($_SERVER[\"SERVER_PROTOCOL\"]), \"/\")) . $s;\n\t$port = ($_SERVER[\"SERVER_PORT\"] == \"80\" || $_SERVER[\"SERVER_PORT\"] == \"443\") ? \"\" : (\":\".$_SERVER[\"SERVER_PORT\"]);\n\n\t$quotes = array('\\'', '\"');\n\t$encoded = array('%27', '%22');\n\n\treturn $protocol . \"://\" . $_SERVER['SERVER_NAME'] . $port . str_replace($quotes, $encoded, $_SERVER['REQUEST_URI']);\n}", "public function generate_url()\n {\n }", "public function getURL($arg = 'true')\n {\n return $this->app->url(null, array($this->name => $arg));\n }", "public function get_normalized_http_url() {\n $parts = parse_url($this->http_url);\n\n $port = @$parts['port'];\n $scheme = $parts['scheme'];\n $host = $parts['host'];\n $path = @$parts['path'];\n\n $port or $port = ($scheme == 'https') ? '443' : '80';\n\n if (($scheme == 'https' && $port != '443')\n || ($scheme == 'http' && $port != '80')) {\n $host = \"$host:$port\";\n }\n return \"$scheme://$host$path\";\n }", "public static function addQueryArg() {\n\t\t$ret = '';\n\t\tif ( is_array( func_get_arg(0) ) ) {\n\t\t\tif ( @func_num_args() < 2 || false === @func_get_arg( 1 ) )\n\t\t\t\t$uri = $_SERVER['REQUEST_URI'];\n\t\t\telse\n\t\t\t\t$uri = @func_get_arg( 1 );\n\t\t} else {\n\t\t\tif ( @func_num_args() < 3 || false === @func_get_arg( 2 ) )\n\t\t\t\t$uri = $_SERVER['REQUEST_URI'];\n\t\t\telse\n\t\t\t\t$uri = @func_get_arg( 2 );\n\t\t}\n\t\n\t\tif ( $frag = strstr( $uri, '#' ) )\n\t\t\t$uri = substr( $uri, 0, -strlen( $frag ) );\n\t\telse\n\t\t\t$frag = '';\n\t\n\t\tif ( preg_match( '|^https?://|i', $uri, $matches ) ) {\n\t\t\t$protocol = $matches[0];\n\t\t\t$uri = substr( $uri, strlen( $protocol ) );\n\t\t} else {\n\t\t\t$protocol = '';\n\t\t}\n\t\n\t\tif ( strpos( $uri, '?' ) !== false ) {\n\t\t\t$parts = explode( '?', $uri, 2 );\n\t\t\tif ( 1 == count( $parts ) ) {\n\t\t\t\t$base = '?';\n\t\t\t\t$query = $parts[0];\n\t\t\t} else {\n\t\t\t\t$base = $parts[0] . '?';\n\t\t\t\t$query = $parts[1];\n\t\t\t}\n\t\t} elseif ( !empty( $protocol ) || strpos( $uri, '=' ) === false ) {\n\t\t\t$base = $uri . '?';\n\t\t\t$query = '';\n\t\t} else {\n\t\t\t$base = '';\n\t\t\t$query = $uri;\n\t\t}\n\t\n\t\tparse_str( $query, $qs );\n\t\t//$qs = urlencode_deep( $qs ); // this re-URL-encodes things that were already in the query string\n\t\tif ( is_array( func_get_arg( 0 ) ) ) {\n\t\t\t$kayvees = func_get_arg( 0 );\n\t\t\t$qs = array_merge( $qs, $kayvees );\n\t\t} else {\n\t\t\t$qs[func_get_arg( 0 )] = func_get_arg( 1 );\n\t\t}\n\t\n\t\tforeach ( (array) $qs as $k => $v ) {\n\t\t\tif ( $v === false )\n\t\t\t\tunset( $qs[$k] );\n\t\t}\n\t\n\t\t$ret = http_build_query( $qs );\n\t\t$ret = trim( $ret, '?' );\n\t\t$ret = preg_replace( '#=(&|$)#', '$1', $ret );\n\t\t$ret = $protocol . $base . $ret . $frag;\n\t\t$ret = rtrim( $ret, '?' );\n\t\treturn $ret;\n\t}", "public static function buildUrl($parameters) {\n\t \n\t $url='';\n\t \n\t // set the base url\n\t if(isset($parameters['baseUrl'])) {\n\t $url .= $parameters['baseUrl'];\n\t unset($parameters['baseUrl']);\n\t } else {\n\t $url .= self::getBaseUrl();\n\t }\n\t \n\t // set the kiosk\n\t if(isset($parameters['kiosk'])) {\n\t $kiosk = $parameters['kiosk'];\n\t unset($parameters['kiosk']);\n\t } else {\n\t $kiosk = self::getKiosk();\n\t }\n\t if(!empty($kiosk)) {\n\t $url .= '/'.$kiosk;\n\t }\n\t \n\t // set the scope\n\t if(isset($parameters['scope'])) {\n\t $url .= '/'.$parameters['scope'];\n\t unset($parameters['scope']);\n\t } else {\n\t $url .= '/'.self::getScope();\n\t }\n\t \n\t if(isset($parameters['action'])) {\n\t $url .= '/'. $parameters['action'].'.do';\n\t unset($parameters['action']);\n\t } else {\n\t $url .= '/'. self::getAction().'.do';\n\t }\n\t \n\t if(count($parameters)) {\n\t $url .= '?'.http_build_query($parameters);\n\t }\n\t \n\t return $url;\n\t}", "public static function requestedURL()\n\t{\n\t\t$url = new SMURL;\n\t\t\n\t\t// set scheme\n\t\t$scheme = ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ) ? 'https' : 'http';\n\t\t$url->setScheme( $scheme );\n\t\t\n\t\t// set host\n\t\t$url->setHost( $_SERVER['HTTP_HOST'] );\n\t\t\n\t\t// set path and query\n\t\tif( isset( $_SERVER['REQUEST_URI'] ) )\n\t\t{\n\t\t\tpreg_match( '/\\/([^\\?]*)(?:\\?(.*))?$/', $_SERVER['REQUEST_URI'], $match );\n\t\t\t$url->setPath( $match[1] );\n\t\t\t$url->setQueryString( $match[2] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$url->setPath( $_SERVER['SCRIPT_NAME'] );\n\t\t\t$url->setQueryString( $_SERVER['QUERY_STRING'] );\n\t\t}\n\n\t\t// set port\n\t\t$url->setPort( $_SERVER['SERVER_PORT'] );\n\t\t\n\t\treturn $url;\n\t}", "public function toUrl()\n {\n $queryParams = '';\n\n $index = 0;\n\n foreach ($this->args as $key => $param) {\n $separator = '?';\n\n if ($index) {\n $separator = '&';\n }\n\n $queryParams .= \"{$separator}{$key}={$param}\";\n\n $index++;\n }\n\n return \"https://dev-ops.mee.ma/glenn/1/5/people.jpg{$queryParams}\";\n }", "function convertStringUrl($string){\n\n $wasteValue = [3];\n $url = parse_url($string);\n\n $scheme = $url['scheme'];\n $host = $url['host'];\n $path = $url['path'];\n\n $query = explode('&', $url['query']);\n\n $params = getFilteredArrayFromString($query, $wasteValue);\n\n //sort params by value\n asort($params);\n\n //add path parameter from input link to array\n $params['url'] = $path;\n\n //form get params as a string\n $paramsString = http_build_query($params);\n\n //form a valid url as a string\n $result = $scheme . '://' . $host . '/?' . $paramsString;\n\n return $result;\n\n}", "private function getUrl() {\n $queryArr = array();\n\n $uri = filter_input(INPUT_SERVER, 'REQUEST_URI');\n\n //get uri as a array\n $uriArr = parse_url($uri);\n\n //get query parameter string\n $queryStr = isset($uriArr['query']) ? $uriArr['query'] : '';\n\n //get query parameters as a array\n parse_str($queryStr, $queryArr);\n\n //remove 'page' parameter if it is set\n if (isset($queryArr['page'])) {\n unset($queryArr['page']);\n }\n\n //rebuild the uri and return \n $returnUri = $uriArr['path'] . '?' . http_build_query($queryArr);\n\n return $returnUri;\n }", "function site_url($val='', $val_2=false)\n {\n echo get_site_url($val, $val_2);\n }", "public function generateUrl($parameters = [])\n {\n $parameters = array_merge($this->getCurrentInput(), $parameters);\n\n\n // Grab the current URL\n $path = URL::getRequest()->path();\n\n return url($path . '/?' . http_build_query($parameters));\n }", "static public function createurl($url='') {\n\t\treturn Application::$base_url.'/'.trim($url,'/');\n\t}", "protected function build_url(array $url_parts)\n {\n // remove unnecessary folder separators\n $url = preg_replace('/\\/+/', '/', $url_parts['path']);\n\n // add the URL params\n $url_params = [];\n if (isset($url_parts['query'])) {\n parse_str($url_parts['query'], $url_params);\n $query_string = http_build_query($url_params);\n $url = $url . '?' . $query_string;\n }\n\n if (isset($url_parts['host'])) {\n $scheme = isset($url_parts['scheme']) ? $url_parts['scheme'] . '://' : '';\n $url = $scheme . $url_parts['host'] . '/' . ltrim($url, '/');\n }\n\n return $url;\n }", "public function get_normalized_http_url()\n {\n $parts = parse_url($this->http_url);\n\n $port = @$parts['port'];\n $scheme = $parts['scheme'];\n $host = $parts['host'];\n $path = @$parts['path'];\n\n $port or $port = ($scheme == 'https') ? '443' : '80';\n\n if (($scheme == 'https' && $port != '443')\n || ($scheme == 'http' && $port != '80')) {\n $host = \"$host:$port\";\n }\n return \"$scheme://$host$path\";\n }", "public function ov_url($name, $value = ''){\n $args = func_get_args(); array_shift($args); array_shift($args);\n return $this->generate_input('url', $name, $value, true, $args);\n }", "private function generateUrl() : string\n {\n return $this->apiUrl.$this->ownerRepo.$this->branchPath.$this->branch;\n }", "function prepare_url($uri = ''): string\n {\n if ($uri === 'http://' or $uri === 'https://' or $uri === '') {\n return '';\n }\n\n /**\n * Converts double slashes in a string to a single slash,\n * except those found in http://\n *\n * http://www.some-site.com//index.php\n *\n * becomes:\n *\n * http://www.some-site.com/index.php\n */\n $uri = preg_replace('#(^|[^:])//+#', '\\\\1/', $uri);\n\n $url = parse_url($uri);\n\n if ( ! $url or ! isset($url[ 'scheme' ])) {\n return (is_https() ? 'https://' : 'http://') . $uri;\n }\n\n return $uri;\n }", "function url_build(string $base, string $params = ''): string\n{\n if ($params) {\n $params = ((false === strpos($base, '?')) ? '?' : '&') . $params;\n }\n return \\get_site_url() . '/' . $base . $params;\n}", "public function buildFrontendUri() {}", "function url($url = false, $attrs = false, $encode = true, $full = true)\n {\n\t\n if ($url === false)\n $url = $_SERVER['SCRIPT_NAME'];\n elseif (substr($url, 0, 1) == '/') {\n\n $url = DOC_ROOT . substr($url, 1);\n\t \t\t\n if ($full) {\n $scheme = 'http';\n\t\tif(isset($_SERVER['HTTPS']))\n\t\t\t{\n if ($_SERVER['HTTPS'] == 'on'){ $scheme .= 's';}}\n $url = \"$scheme://\" . $_SERVER['HTTP_HOST'] . \"$url\";\n }\n }\n\n\n if ($encode) {\n $url = rawurlencode($url);\n $url = str_replace('%2F', '/', $url);\n $url = str_replace('%23', '#', $url);\n $url = str_replace('%3A', ':', $url);\n $url = str_replace('%7E', '~', $url);\n }\n $query = '';\n if (!empty($attrs))\n $query = '?' . $this->array_to_query($attrs);\n\t\n return $url . $query;\n }", "static function obtenerUrlActual() {\n $url = Util::crearUrl($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);\n return $url;\n }", "function buildRESTAPIUrl($SiteURL, $APILink, $ObjectType, $ObjectIdentifier){\n\t\t//TODO: add ability to remove double slashes\n\t\t$url = $SiteURL . $APILink . \"/\" . $ObjectIdentifier . $ObjectType;\n\t\treturn $url;\n\t}", "public static function formUrlParameters(array $variables) : string {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__, $variables);\n\n\t\t$variables = self::_applyFilter(get_class(), __FUNCTION__, $variables, array('event' => 'args'));\n\n\t\t$appendix = '?';\n\n\t\t$first = 1;\n\t\tforeach ($variables as $key => $value) {\n\t\t\tif ($first === 1) {\n\t\t\t\t$appendix .= $key . '=' . urlencode($value);\n\t\t\t} else {\n\t\t\t\t$appendix .= '&' . $key . '=' . urlencode($value);\n\t\t\t}\n\t\t\t$first = 0;\n\t\t}//end foreach\n\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $appendix, $variables);\n\t\t$appendix = self::_applyFilter(get_class(), __FUNCTION__, $appendix, array('event' => 'return'));\n\n\t\treturn $appendix;\n\n\t}", "public function getNormalizedHttpUrl()\n {\n $parts = parse_url($this->httpUrl);\n\n $scheme = (isset($parts['scheme'])) ? $parts['scheme'] : 'http';\n $port = (isset($parts['port'])) ? $parts['port'] : (($scheme == 'https') ? '443' : '80');\n $host = (isset($parts['host'])) ? strtolower($parts['host']) : '';\n $path = (isset($parts['path'])) ? $parts['path'] : '';\n\n if (($scheme == 'https' && $port != '443') || ($scheme == 'http' && $port != '80')) {\n $host = \"$host:$port\";\n }\n return \"$scheme://$host$path\";\n }", "abstract public function url($manipulation_name = '');", "public function buildUrl(string $ip_address, string $req_for) : string\n {\n $url = self::API_BASE_URL;\n $url .= \"/\".$req_for.\"?ip=$ip_address\";\n\n return $url;\n }", "public function url()\r\n {\r\n return $this->get_base_url() . http_build_query($this->get_query_params());\r\n }", "function build_url($base_url, $params) {\r\n $url = $base_url;\r\n if (!empty($params)) {\r\n $url .= '?' . implode('&', $params);\r\n }\r\n return $url;\r\n }", "public function getURL() {\n $defaultPorts= array(\n 'http' => 80,\n 'https' => 443\n );\n \n // Determine which settings we need to pass\n $xsr= array();\n if (\n ($this->getProduct() != $this->getDefaultProduct()) ||\n ($this->getLanguage() != $this->getDefaultLanguage())\n ) {\n $xsr[]= $this->getProduct();\n $xsr[]= $this->getLanguage();\n }\n if ($this->getSessionId()) $xsr[]= 'psessionid='.$this->getSessionId();\n\n $port= '';\n if (\n $this->getPort() &&\n (!isset($defaultPorts[$this->getScheme()]) ||\n $this->getPort() != $defaultPorts[$this->getScheme()])\n ) {\n $port= ':'.$this->getPort();\n }\n\n\n return sprintf(\n '%s://%s%s/xml/%s%s%s%s',\n $this->getScheme(),\n $this->getHost(),\n $port,\n (sizeof($xsr) ? implode('.', $xsr).'/' : ''),\n $this->getStateName(), \n $this->getQuery() ? '?'.$this->getQuery() : '',\n $this->getFragment() ? '#'.$this->getFragment() : ''\n );\n }", "function url($uri, $append='')\n\t{\n\t\tglobal $_CONFIG;\n\n\t\t$method = $_CONFIG->uri_method__or('PATH_INFO');\n\t\t$get_var = $_CONFIG->get_var__or('p');\n\t\t$base_url = $_CONFIG->base_url;\n\t\t$base_url = rtrim($base_url, '/').'/index.php';\n\n\t\t$sep = array(\n\t\t\t'PATH_INFO' => '?',\n\t\t\t'GET_VAR' => '&',\n\t\t\t'QUERY_STRING' => ''\n\t\t);\n\t\t$sep = isset($sep[$method]) ? $sep[$method] : '';\n\t\t$append = ($sep && $append) ? $sep.$append : '';\n\n\t\t$urls = array(\n\t\t\t'PATH_INFO' => \"{$base_url}/{$uri}{$append}\",\n\t\t\t'GET_VAR' => \"{$base_url}?$get_var=$uri{$append}\",\n\t\t\t'QUERY_STRING' => \"{$base_url}?$uri\"\n\t\t);\n\n\t\tif (!isset($urls[$method]))\n\t\t\t$method = 'GET_VAR';\n\n\t\treturn $urls[$method];\n\t}", "public static function http_build_url(array $url, $strip_auth = TRUE)\n\t{\n\t\t$url = static::array_merge_recursive([\n\t\t\t'scheme' => 'http',\n\t\t\t'host' => '',\n\t\t\t'port' => 80,\n\t\t\t'user' => '',\n\t\t\t'pass' => '',\n\t\t\t'path' => '',\n\t\t\t'query' => '',\n\t\t\t'fragment' => ''\n\t\t], $url);\n\t\textract($url);\n\t\tif (!$strip_auth && !empty($user)) {\n\t\t\t$surl = sprintf('%s://%s@%s', $scheme, (!empty($pass) ? $user.':'.$pass : $user), $host);\n\t\t} else {\n\t\t\t$surl = sprintf('%s://%s', $scheme, $host);\n\t\t}\n\t\tif ($port != 80 && $post != 443)\n\t\t\t$surl .= ':' . $port;\n\t\t$surl .= $path;\n\t\t$surl .= !empty($query) ? '?' . $query : '';\n\t\t$surl .= !empty($fragment) ? '#' . $fragment : '';\n\t\treturn $surl;\n\t}", "public static function url($Value) {\n\n if (is_array($Value)) {\n $values = $Value;\n } else {\n $values = func_get_args();\n }\n\n foreach ($values as $key => $value) {\n if (is_null($value)) {\n $values[$key] = self::getValue($key);\n }\n }\n\n $result = '';\n foreach ($values as $value) {\n $result .= '/';\n $result .= self::formatUrl($value);\n }\n return self::$Host . $result;\n }", "public function getURL($append = ''){\n\t\treturn $this->url.ltrim($append, '/');\n\t}", "protected function buildAddress(array $parts): string\n {\n $url = $scheme = '';\n\n if (isset($parts['scheme'])) {\n $scheme = $parts['scheme'];\n $url .= $scheme . ':';\n }\n\n if (isset($parts['host'])) {\n $url .= '//';\n if (isset($parts['user'])) {\n $url .= $parts['user'];\n if (isset($parts['pass'])) {\n $url .= ':' . $parts['pass'];\n }\n $url .= '@';\n }\n\n $url .= $parts['host'];\n\n // Only include the port if it is not the default port of the scheme\n if (isset($parts['port'])\n && !(('http' == $scheme && 80 == $parts['port']) || ('https' == $scheme && 443 == $parts['port']))\n ) {\n $url .= ':' . $parts['port'];\n }\n }\n\n // Add the path component if present\n if (isset($parts['path']) && (0 !== strlen(strval($parts['path'])))) {\n // Always ensure that the path begins with '/' if set and something is before the path\n if ($url && strval($parts['path'])[0] != '/' && '/' != substr($url, -1)) {\n $url .= '/';\n }\n $url .= $parts['path'];\n }\n\n // Add the query string if present\n if (isset($parts['query'])) {\n $url .= '?' . $parts['query'];\n }\n\n // Ensure that # is only added to the url if fragment contains anything.\n if (isset($parts['fragment'])) {\n $url .= '#' . $parts['fragment'];\n }\n\n return $url;\n }", "function build_url($controller=null, $action=null, $params='', $includeDomain=false, $module=null)\r\n{\r\n if ($module == null) {\r\n $ctrl = Zend_Controller_Front::getInstance();\r\n \t$request = $ctrl->getRequest();\r\n \t/* @var $request Zend_Controller_Request_Abstract */\r\n \t$name = null;\r\n \tif ($request) {\r\n \t $name = $request->getModuleName();\r\n \t}\r\n \r\n if ($name && $name != 'default') {\r\n $module = $name;\r\n }\r\n } else if ($module == 'default') {\r\n $module = '';\r\n }\r\n \r\n\t$paramStr = '';\r\n\t// The appendage is for any # based params passed in\r\n\t$appendage = '';\r\n\tif (is_array($params)) {\r\n\t\t$sep = '';\r\n\t\tforeach ($params as $k => $v) {\r\n\t\t if ($v instanceof ArrayObject || is_array($v)) {\r\n\t\t continue;\r\n\t\t }\r\n\t\t\tif (!strlen($v)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (strpos($v, '#') === 0) {\r\n\t\t\t $appendage = $v;\r\n\t\t\t continue;\r\n\t\t\t}\r\n\t\t\t$paramStr .= $sep.urlencode($k).'/'.urlencode($v);\r\n\t\t\t$sep = '/';\r\n\t\t}\r\n\t} else {\r\n\t\t$paramStr = $params;\r\n\t}\r\n\t// $url = $this->getContextPath().\r\n\t$url = context_path($includeDomain).\r\n\t ($module != null ? '/'.$module : '') .\r\n\t ($controller != '' ? '/'.$controller : '') .\r\n\t\t($action != '' ? '/'.$action : '') . \r\n\t\t($paramStr != '' ? '/'.$paramStr : '');\r\n\t\t\r\n\t// Many browsers require the / on the end when working with\r\n\t// url rewrites, so lets make sure it has one. \r\n\tif (strrpos($url, '/') != (strlen($url) - 1) && strpos($url, '?') === false) {\r\n\t\t$url .= '/';\r\n\t}\r\n\r\n\t$url .= $appendage;\r\n\r\n\t$protocol = get_protocol(ifset($_SERVER, 'SERVER_PROTOCOL'));\r\n\r\n\treturn $url;\r\n}", "static function CreateRequestURI(&$object, $url,$host,$lang_count,$language) {\n //--if site have not a one language\n if ($lang_count!=1) {\n $pos=strpos($_SERVER[\"REQUEST_URI\"],\"/\".$language.\"/\");\n if ($pos!==false) {\n $request_uri=substr($_SERVER[\"REQUEST_URI\"],($pos+1), strlen($_SERVER[\"REQUEST_URI\"]));\n } else {\n \tif ($object->Kernel->Settings)\n \t\t$settings=$object->Kernel->Settings;\n \telseif ($object->Page->Kernel->Settings)\n \t\t$settings=$object->Page->Kernel->Settings;\n $request_uri=substr($_SERVER[\"REQUEST_URI\"],(strlen($settings->GetItem('MODULE', 'RelativeURL'))+1), strlen($_SERVER[\"REQUEST_URI\"]));\n }\n } else { //-- else (one language)\n $seek=strlen($url)-strlen($host);\n $request_uri=substr($_SERVER[\"REQUEST_URI\"],$seek, strlen($_SERVER[\"REQUEST_URI\"]));\n }\n\n if (substr($request_uri,0,1)==\"/\") $request_uri=substr($request_uri,1, strlen($request_uri));\n if(substr($request_uri,strlen($request_uri)-1,1)==\"/\") {\n $request_uri.=\"?\";\n }\n if (strpos($request_uri,\"?\")===false) {\n $request_uri.=\"?\";\n } else {\n $darray=explode(\"/\",$_SERVER[\"PHP_SELF\"]);\n\n }\n //list($PageURI,$QueryString)=split(\"[?]\",$request_uri);\n list($PageURI,$QueryString)=preg_split(\"/[?]/\",$request_uri);\n return array($PageURI,$QueryString,$request_uri);\n }", "private function _buildUri(): string {\n return !empty($this->query) ? $this->uri.'?'.http_build_query($this->query) : $this->uri;\n }" ]
[ "0.6982559", "0.68406594", "0.68116254", "0.6790138", "0.67184424", "0.67011166", "0.660767", "0.65569025", "0.64706534", "0.64035326", "0.63996", "0.63281244", "0.63225913", "0.625492", "0.62462914", "0.6189361", "0.61574244", "0.61487675", "0.6126028", "0.6120405", "0.6062888", "0.606254", "0.60614574", "0.6043169", "0.6036553", "0.60258174", "0.6021221", "0.60016936", "0.5986401", "0.598158", "0.59457463", "0.59368706", "0.5934076", "0.5931217", "0.593111", "0.5919334", "0.59167325", "0.59097034", "0.5908569", "0.5901974", "0.58804834", "0.5874411", "0.5872932", "0.5865611", "0.58624214", "0.58283937", "0.5824576", "0.58205265", "0.5817923", "0.5813597", "0.580953", "0.58060205", "0.58040786", "0.58038193", "0.5802779", "0.58006555", "0.58001643", "0.5790328", "0.5786016", "0.5782174", "0.5770381", "0.577013", "0.5763786", "0.5763109", "0.5761515", "0.57504326", "0.5743601", "0.57431316", "0.5738384", "0.57291585", "0.57208085", "0.5715915", "0.57125324", "0.5708934", "0.5707187", "0.5703063", "0.5702753", "0.5699284", "0.56951976", "0.5694525", "0.56736463", "0.56689036", "0.5665356", "0.566429", "0.5660002", "0.5657002", "0.56516904", "0.5650503", "0.56479627", "0.5631908", "0.56230634", "0.5622776", "0.56163234", "0.5614632", "0.56137484", "0.5610189", "0.56099904", "0.56043744", "0.5601597", "0.55968755" ]
0.63471115
11
Generate an icon from the 3rdParty library
function icon($which, $alt='', $url=false, $print_alt = false, $class=false) { return new Icon($which, $alt, $url, $print_alt, $class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getFactoryIconUseIt() {\n }", "public function getIconForResourceWithPngFileReturnsIcon() {}", "public function getIcon() {}", "public function getIcon();", "public function getIcon();", "public function getIcon()\n {\n return 'voyager-external';\n }", "public static function getIcon(): string\n {\n }", "public static function getIcon(): string\n {\n }", "public function getIcon()\n {\n }", "public function icon(): string;", "function icon() {\n global $CFG;\n\n return \"<img src='$CFG->wwwroot/blocks/ilp/pix/graphicon.jpg' height='24' width='24' />\";\n }", "public function get_icon() {\n\t\treturn 'eicon-image';\n\t}", "protected function establish_icon() {\n\t\t$this->icon = \"<i class='sw swp_{$this->key}_icon'></i>\";\n\t}", "public function icon ( )\n\t{\n\t\treturn Array( 'id' => $this->id,\t// shoud be consistent with what is passed to _uicmp_stuff_fold class\n\t\t\t\t\t 'title' => $this->messages['icon'] );\n\t}", "public function getIconReturnsReplacementIconWhenDeprecatedDataProvider() {}", "protected function get__icon()\n\t{\n\t\treturn NULL;\n\t}", "public function Icon()\n {\n $ext = strtolower($this->getExtension());\n if (!Director::fileExists(FRAMEWORK_DIR . \"/images/app_icons/{$ext}_32.gif\")) {\n $ext = $this->appCategory();\n }\n\n if (!Director::fileExists(FRAMEWORK_DIR . \"/images/app_icons/{$ext}_32.gif\")) {\n $ext = \"generic\";\n }\n\n return FRAMEWORK_DIR . \"/images/app_icons/{$ext}_32.gif\";\n }", "function av_backend_icon($params)\n{\n\treturn avia_font_manager::backend_icon($params);\n}", "function get_screen_icon()\n {\n }", "public function icon(): string\n {\n return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACYSURBVEhLYxgFJIHU1FSjtLS0i0D8AYj7gEKMEBkqAaAFF4D4ERCvAFrwH4gDoFIMKSkpFkB+OTEYqgUTACXfA/GqjIwMQyD9H2hRHlQKJFcBEiMGQ7VgAqCBvUgK32dmZspCpagGGNPT0/1BLqeF4bQHQJePpiIwhmrBBEADR1MRfgB0+WgqAmOoFkwANHA0FY0CUgEDAwCQ0PUpNB3kqwAAAABJRU5ErkJggg==';\n }", "public function icon($icon);", "public function getIcon() {\r\n\t\r\n\t$fileType = $this->getType();\r\n\t\r\n\t$image = array(\r\n\t 'image/gif',\r\n\t 'image/png',\r\n\t 'image/jpg',\r\n\t 'image/jpeg'\r\n\t);\r\n\t\r\n\t$rarZip = array(\r\n\t 'application/zip',\r\n 'application/x-rar-compressed'\r\n\t);\r\n\t\r\n\t$audio = array(\r\n\t 'audio/mpeg'\r\n\t);\r\n\t\r\n\t$video = array(\r\n\t 'video/quicktime',\r\n\t 'video/mp4'\r\n\t);\r\n\t\r\n\t$pdf = array(\r\n\t 'application/pdf'\r\n\t);\r\n\t\r\n\t$wordExcelPptx = array(\r\n\t 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\r\n\t 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\r\n\t 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\r\n\t 'application/msword',\r\n\t 'application/vnd.ms-excel',\r\n\t 'application/vnd.ms-powerpoint'\r\n\t);\r\n\t\r\n\tif (in_array($fileType, $image)) {\r\n\t return \"image.png\";\r\n\t} elseif (in_array($fileType, $audio)) {\r\n\t return \"audio.png\";\r\n\t} elseif (in_array($fileType, $video)) {\r\n\t return \"video.png\";\r\n\t} elseif (in_array($fileType, $rarZip)) {\r\n\t return \"rarZip.png\";\r\n\t} elseif (in_array($fileType, $pdf)) {\r\n\t return \"pdf.png\";\r\n\t} elseif (in_array($fileType, $wordExcelPptx)) {\r\n\t return \"wordExcelPptx.png\";\r\n\t} else {\r\n\t return \"default.png\";\r\n\t}\r\n\t\r\n }", "public function get_icon2d(): string\n {\n return $this->_download('icon2d.png');\n }", "public function getIconForResourceWithCustomImageMimeTypeReturnsImageIcon() {}", "protected function get__icon()\n\t{\n\t\treturn 'coffee';\n\t}", "public function get_icon() {\n\t\treturn 'eicon-icon-box';\n\t}", "function av_icon($icon, $font = false, $string = 'string')\n{\t\n\treturn avia_font_manager::frontend_icon($icon, $font, $string);\n}", "public function icon(): string\n {\n return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADLSURBVEhL5ZRLCsIwGAa7UkE9gd5HUfEoekxxJx7AhXoCca/fhESkJiQxBHwMDG3S/9EmJc0n0JMruZVXK/fMdWQRY7mXt4A7OZJvwZu74hRayIEc2nv3jGtXZrOWrnifiRY0OkhiWK5sWGeS52bkZymJ2ZhRJmwmySxLCL6CmIsZZUIixkiNezCRR+kSUyWH3Cgn6SuQIk2iuOBckvN+t8FMnq1TJloUN3jefN9mhvJeCAVWb8CyUDj0vxc3iPFHDaofFdUPu2+iae7nYJMCY/1bpAAAAABJRU5ErkJggg==';\n }", "protected function getIcon()\n {\n /** @var IconFactory $iconFactory */\n $iconFactory = GeneralUtility::makeInstance(IconFactory::class);\n return $iconFactory->getIcon('px-shopware-clear-cache', Icon::SIZE_SMALL)->render();\n }", "public function getIconName() {}", "public function getIconName() {}", "public function getIconName() {}", "public function getIconName() {}", "function loadIcon16($name) {\n echo \"<img src=\\\"icos/16-$name.png\\\" alt=\\\"\\\" width=\\\"16\\\" height=\\\"16\\\">\";\n }", "public function getIconTag() {\n\t\treturn '<img class=\"languageIcon jsTooltip\" src=\"' . $this->getIconPath() . '\" title=\"' . $this->getTitle() . '\" alt=\"' . $this->getTitle() . '\" />';\n\t}", "public function getIconForResourceWithUnknownFileTypeReturnsOtherIcon() {}", "protected function buildCssAndRegisterIcons() {}", "public function get_icon()\n {\n return 'fa fa-image';\n }", "public function get_icon() {\n\t\tglobal $wc_authorize_sim;\n\n\t\t$icon = '';\n\n\t\t$icon = '<img src=\"' . esc_url( $wc_authorize_sim->force_ssl( $wc_authorize_sim->plugins_url('assets/images/authorize-net-co.png') ) ) . '\" alt=\"' . esc_attr( $this->title ) . '\" />';\n\n\t\treturn apply_filters( 'woocommerce_authorize_sim_icon', $icon, $this->id );\n\t}", "public function getIcon()\n {\n return $this->get(self::_ICON);\n }", "function wp_site_icon()\n {\n }", "public function getIconForRecordWithMockRecordOfTypePluginReturnsPluginIcon() {}", "public function getIcon(): string\n {\n return $this->icon ?: static::DEFAULT_ICON;\n }", "function addIcon($i){\n return $this->add('Icon',null,'Icon')->set($i)->addClass('atk-size-mega');\n }", "public static function icon($params)\n {\n $name = isset($params[0]) ? $params[0] : '';\n $template = isset($params[1]) ? $params[1] : 'base/_icon.tpl';\n return self::renderTemplate($template, [\n 'name' => $name\n ]);\n }", "public function get_icon() {\n return 'fa fa-plug';\n }", "public function get_icon() {\n return 'fa fa-plug';\n }", "public function get_icon() {\n return 'fa fa-plug';\n }", "public abstract function render_pix_icon(renderer_base $output, pix_icon $icon);", "public function get_icon()\n\t{\n\t\treturn 'fab fa-algolia';\n\t}", "public function getIcon()\n {\n return ModuleResourceLoader::resourceURL(\n 'silverstripe/framework:client/images/app_icons/folder_icon_large.png'\n );\n }", "function atom_site_icon()\n {\n }", "protected function imageIcon(): string\n {\n $types = [\n 'image' => 'file-image',\n 'video' => 'file-video',\n 'document' => 'file-document',\n 'audio' => 'file-audio',\n 'code' => 'file-code',\n 'archive' => 'file-zip'\n ];\n\n $extensions = [\n 'xls' => 'file-spreadsheet',\n 'xlsx' => 'file-spreadsheet',\n 'csv' => 'file-spreadsheet',\n 'docx' => 'file-word',\n 'doc' => 'file-word',\n 'rtf' => 'file-word',\n 'mdown' => 'file-text',\n 'md' => 'file-text'\n ];\n\n return $extensions[$this->model->extension()] ??\n $types[$this->model->type()] ??\n parent::imageDefaults()['color'];\n }", "public function getIconForResourceWithPdfReturnsPdfIcon() {}", "private function get_icon()\n\t{\n\t\treturn $this->m_icon;\n\t}", "private function get_icon()\n\t{\n\t\treturn $this->m_icon;\n\t}", "private function _renderIcon()\n {\n return !empty($this->_icon) ? '<i class=\"' . $this->_icon . '\"></i>' : '';\n }", "function get_icon() {\n\t\treturn $this->settings['icon'];\n\t}", "public static function iconPath()\n {\n return Craft::getAlias(\"@julianmjones/schedapiintegration/assetbundles/schedapiintegrationutilityutility/dist/img/SchedApiIntegrationUtility-icon.svg\");\n }", "public function get_icon() {\n\t\treturn 'eicon-product-images';\n\t}", "public function get_icon() {\n\t\treturn 'eicon-slider-album';\n\t}", "public function get_icon() {\n\t\treturn 'eicon-slider-album';\n\t}", "public function get_icon() {\n\t\t\treturn WC_SUMO_Sagepay_Common_Functions::get_icon( $this->cardtypes, $this->sagelink, $this->sagelogo, $this->id );\n\t\t}", "public function getIconForFileWithFileTypePngReturnsPngIcon() {}", "public function get_icon() {\n\t\treturn 'fa fa-images';\n\t}", "function rss2_site_icon()\n {\n }", "function get_icon($ending)\n{\n\tswitch($ending)\n\t{\n\t\tcase '.avi':\n\t\tcase 'mpeg':\n\t\tcase '.mpg':\n\t\tcase 'divx':\n\t\tcase '.mkv':\n\t\tcase '.ogm':\n\t\tcase '.mp4':\n\t\tcase '.wmv':\n\t\tcase '.vob':\n\t\tcase '.flv':\n\t\t\t$img = 'movie.png';\n\t\t\tbreak;\n\t\tcase '.pdf':\n\t\tcase '.dvi':\n\t\t\t$img = 'acroread.png';\n\t\t\tbreak;\n\t\tcase '.doc':\n\t\tcase 'docx':\n\t\tcase '.xls':\n\t\tcase 'xlsx':\n\t\tcase '.pps':\n\t\tcase 'ppsx':\n\t\tcase '.odt':\n\t\tcase '.odp':\n\t\tcase '.odx':\n\t\t\t$img = 'office.png';\n\t\t\tbreak;\n\t\tcase '.mp3':\n\t\tcase '.wma':\n\t\tcase '.aac':\n\t\tcase '.ogg':\n\t\tcase 'flac':\n\t\t\t$img = 'audio.png';\n\t\t\tbreak;\n\t\tcase '.mov':\n\t\tcase '.3gp':\n\t\t\t$img = 'quicktime.png';\n\t\t\tbreak;\n\t\tcase 'html':\n\t\tcase '.htm':\n\t\tcase '.php':\n\t\tcase '.cgi':\n\t\t\t$img = 'html.png';\n\t\t\tbreak;\n\t\tcase '.jpg':\n\t\tcase 'jpeg':\n\t\tcase '.png':\n\t\tcase '.bmp':\n\t\tcase 'tiff':\n\t\tcase '.xpm':\n\t\tcase '.gif':\n\t\tcase '.ico':\n\t\t\t$img = 'image.png';\n\t\t\tbreak;\n\t\tcase '.nfo':\n\t\tcase '.sfv':\n\t\t\t$img = 'info.png';\n\t\tbreak;\n\t\tcase '.tar':\n\t\t\t$img ='tar.png';\n\t\t\tbreak;\n\t\tcase '.tgz':\n\t\tcase 'r.gz':\n\t\tcase '.bz2':\n\t\tcase '.rar':\n\t\tcase '.zip':\n\t\t\t$img = 'tgz.png';\n\t\t\tbreak;\n\t\tcase '.iso':\n\t\tcase '.mdf':\n\t\tcase '.mds':\n\t\tcase '.ccd':\n\t\tcase '.bin':\n\t\tcase '.cue':\n\t\tcase '.nrg':\n\t\tcase '.vcd':\n\t\t\t$img = 'cdrom.png';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$img = 'file.png';\n\t\t\tbreak;\n\t}\n\treturn($img);\n}", "public function getIconForResourceWithOpenFolderReturnsOpenFolderIcon() {}", "public static function iconPath()\n {\n return Craft::getAlias('@seibertio/elasticsearch/icon.svg');\n }", "function myplugin_header_icon() {\n\n\t$icon_url = plugins_url('images/swpf-icon-header.png', __FILE__ ); ?>\n \t\n\t<div id=\"icon-myplugin\" class=\"icon32\"><img src=\"<?php echo $icon_url; ?>\"></div><?php\n\n}", "function imagemIcone($nomeArquivo, $width = 17)\r\n\t{\r\n\t\t$imagem = \"<img src='/revoc/sistemas/pdv_premium/requires/img/icons/$nomeArquivo' width='\".$width.\"px'>\";\r\n\t\treturn $imagem;\r\n\t}", "static function Icon($icon_to_test)\n\t{\n\t\tif(in_array($icon_to_test, self::$_icons) )\n\t\t\treturn $icon_to_test;\n\t\tWdfException::Raise(\"Invalid Icon '$icon_to_test'\");\n return '';\n\t}", "function quasar_favico() {\n echo '<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"'.xr_get_option('company_logo_favicon', F_WAY.'/images/demo/favico.ico').'\" />';\n}", "public function getIconForRecordWithMockRecordReturnsNormalIcon() {}", "public function getRublonIcon() {\n\t $rublonIconImg = Mage::getDesign()->getSkinBaseUrl() . 'Rublon/img/rublon_logo_16x16.png';\n\t\treturn sprintf('<span title=\"%s\"\n\t\t\tstyle=\"width:16px;height:16px;background:url(%s) 0px 0px no-repeat;vertical-align:middle;display:inline-block;\"\n\t\t\tclass=\"rublon-protected-icon\"></span>',\n\t\t\thtmlspecialchars($this->__('Your account is protected by Rublon')),\n\t\t\t$rublonIconImg\n\t\t);\n\t}", "public function getSvgIcon();", "function i($code){\n $icon = '<i class=\"fa fa-'.$code.'\"></i>';\n return $icon;\n }", "public static function makeIcon(string $type): string\n {\n switch ($type) {\n case self::FAIL:\n return '✕';\n case self::SKIPPED:\n return 's';\n case self::RISKY:\n return 'r';\n case self::INCOMPLETE:\n return 'i';\n case self::WARN:\n return 'w';\n case self::RUNS:\n return '•';\n default:\n return '✓';\n }\n }", "function sIcon($icon, $class = null)\n {\n return '<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"' . $class . '\"><use xlink:href=\"#' . $icon . '\"></use></svg>';\n }", "function bethel_add_favicons() {\n\techo \"<link rel=\\\"shortcut icon\\\" href=\\\"\".get_stylesheet_directory_uri().\"/images/favicons/favicon.ico\\\">\\r\\n\";\n\techo \"<link rel=\\\"icon\\\" sizes=\\\"16x16 32x32 64x64\\\" href=\\\"\".get_stylesheet_directory_uri().\"/images/favicons/favicon.ico\\\">\\r\\n\";\n\t$sizes = array(196, 160, 96, 64, 32, 16);\n\tforeach ($sizes as $size) {\n\t\techo \"<link rel=\\\"icon\\\" type=\\\"image/png\\\" sizes=\\\"{$size}x{$size}\\\" href=\\\"\".get_stylesheet_directory_uri().\"/images/favicons/favicon-{$size}.png\\\">\\r\\n\";\n\t}\n\t//iOS images can't have alpha transparency\n\t$sizes = array (152,144,120,114,76,72);\n\tforeach ($sizes as $size) {\n\t\techo \"<link rel=\\\"apple-touch-icon\\\" sizes=\\\"{$size}x{$size}\\\" href=\\\"\".get_stylesheet_directory_uri().\"/images/favicons/favicon-{$size}.png\\\">\\r\\n\";\n\t}\n\techo \"<link rel=\\\"apple-touch-icon\\\" href=\\\"\".get_stylesheet_directory_uri().\"/images/favicons/favicon-57.png\\\">\\r\\n\";\n\techo \"<meta name=\\\"msapplication-TileColor\\\" content=\\\"#FFFFFF\\\">\\r\\n\";\n\techo \"<meta name=\\\"msapplication-TileImage\\\" content=\\\"\".get_stylesheet_directory_uri().\"/images/favicons/favicon-144.png\\\">\\r\\n\";\n\techo \"<meta name=\\\"msapplication-config\\\" content=\\\"\".get_stylesheet_directory_uri().\"/images/favicons/browserconfig.xml\\\">\\r\\n\";\n}", "public function getIcon() {\n\t\t//regex is used to check if there's a filename within the iconFile string\n\t\treturn preg_replace('/^.*\\/([^\\/]+\\.(gif|png))?$/i', '\\1', $this->iconFile) ? $this->iconFile : '';\n\t}", "public function getIcon()\n {\n return $this->Icon;\n }", "public function get_icon() {\n return 'eicon-slideshow';\n }", "function _get_ico_data() {\n\t\tif ( ! is_array( $this->_images ) || empty( $this->_images ) )\n\t\t\treturn false;\n\t\t\n\t\t\n\t\t$data = pack( 'vvv', 0, 1, count( $this->_images ) );\n\t\t$pixel_data = '';\n\t\t\n\t\t$icon_dir_entry_size = 16;\n\t\t\n\t\t$offset = 6 + ( $icon_dir_entry_size * count( $this->_images ) );\n\t\t\n\t\tforeach ( $this->_images as $image ) {\n\t\t\t$data .= pack( 'CCCCvvVV', $image['width'], $image['height'], $image['color_palette_colors'], 0, 1, $image['bits_per_pixel'], $image['size'], $offset );\n\t\t\t$pixel_data .= $image['data'];\n\t\t\t\n\t\t\t$offset += $image['size'];\n\t\t}\n\t\t\n\t\t$data .= $pixel_data;\n\t\tunset( $pixel_data );\n\t\t\n\t\t\n\t\treturn $data;\n\t}", "function generateIconsSrc() {\n\t$iconsPhpSrc = 'function icons() { return [';\n\t\n\t$svgs = glob('src/icons/*.svg');\n\tforeach ($svgs as $svg) {\n\t\t$filename = basename($svg, '.svg');\n\t\tif (preg_match('~^(.*?)\\-([a-f0-9]{3}|[a-f0-9]{6})$~i', $filename, $m)) {\n\t\t\t$name = $m[1];\n\t\t\t$color = $m[2];\n\t\t\t\n\t\t\t$src = file_get_contents($svg);\n\t\t\tif (preg_match('~<svg[^>]*>(.*)<\\/svg>~i', $src, $m)) {\n\t\t\t\t$iconsPhpSrc .= PHP_EOL.'\t\\''.$name.'\\' => ['.\n\t\t\t\t\t'\\''.str_replace('\\'', '\\\\\\'', $m[1]).'\\', \\''.$color.'\\''.\n\t\t\t\t'],';\n\t\t\t}\n\t\t}\n\t}\n\treturn $iconsPhpSrc.PHP_EOL.']; }'.PHP_EOL;\n}", "public function get_icon() {\n\t\treturn 'fa fa-cloud';\n\t}", "public function getIconForResourceWithMimeTypeApplicationPdfReturnsPdfIcon() {}", "function show_object_icon($host, $service = \"\", $usehost = false)\n{\n echo get_object_icon($host, $service, $usehost);\n}", "public function getIcon()\n {\n return $this->icon;\n }", "public function getIcon()\n {\n return $this->icon;\n }", "public function getIcon()\n {\n return $this->icon;\n }", "public function getIcon()\n {\n return $this->icon;\n }", "public function getIcon()\n {\n return $this->icon;\n }", "public function getIcon()\n {\n return $this->icon;\n }", "public function getIcon()\n {\n return $this->icon;\n }", "static function icon($icon) {\n\t\treturn self::tag('i', 'glyphicon glyphicon-' . $icon);\n\t}", "public function getIconForResourceWithFolderReturnsFolderIcon() {}", "function screen_icon()\n {\n }", "public function getIconForResourceWithFileWithoutExtensionTypeReturnsOtherIcon() {}", "public static function type_return_icon($type_id)\n {\n switch($type_id):\n case '101';\n return \"<i class=\\\"fa fa-beer fa-1x\\\"></i>\";\n break;\n case '102';\n return \"<i class=\\\"fa fa-thumbs-o-up fa-1x\\\"></i>\";\n break;\n case '103';\n break;\n case '200';\n return \"<i class=\\\"fa fa-picture-o fa-1x\\\"></i>\";\n break;\n case '300';\n return \"<i class=\\\"fa fa-map-marker fa-1x\\\"></i>\";\n break;\n endswitch;\n }" ]
[ "0.7659396", "0.70003176", "0.69893146", "0.69601524", "0.69601524", "0.668919", "0.6686453", "0.6686453", "0.6681213", "0.6650669", "0.65942883", "0.65238494", "0.6516916", "0.64796305", "0.64605814", "0.64358175", "0.641956", "0.6383943", "0.637005", "0.636505", "0.63643295", "0.63375866", "0.6335028", "0.6304048", "0.6297233", "0.6292889", "0.62917256", "0.6288588", "0.6282186", "0.627891", "0.627891", "0.6278036", "0.6278036", "0.6269795", "0.62684447", "0.62621564", "0.62144965", "0.6213011", "0.6209631", "0.62090373", "0.620304", "0.6201255", "0.6181818", "0.6176011", "0.6173406", "0.6150126", "0.6150126", "0.6150126", "0.61318594", "0.6125912", "0.61207604", "0.61118525", "0.6110133", "0.6105866", "0.6099654", "0.6099654", "0.6079507", "0.6069934", "0.60560244", "0.6054478", "0.604584", "0.604584", "0.6033407", "0.6033239", "0.6031619", "0.6023782", "0.6010991", "0.6009118", "0.60063154", "0.5967599", "0.5965454", "0.5958221", "0.5956247", "0.5923414", "0.59201825", "0.5919619", "0.5919128", "0.5914734", "0.5914439", "0.5908443", "0.5896123", "0.5894686", "0.5893923", "0.58755517", "0.58751744", "0.58601475", "0.5854281", "0.5848505", "0.58383316", "0.58383316", "0.58383316", "0.58383316", "0.58383316", "0.58383316", "0.58383316", "0.58373064", "0.5827335", "0.58232886", "0.5816704", "0.58160275" ]
0.6479054
14
Modified version of serialize()
function serial ( $var = array(), $recur = FALSE ) { if ( $recur ) { foreach ( $var as $k => $v ) { if ( is_array($v) ) { $var[$k] = serial($v, 1); } else { $var[$k] = base64_encode($v); } } return $var; } else { return serialize(serial($var, 1)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function serialize();", "abstract public function serialize();", "abstract public function serialize();", "public function serialize();", "public function serialize();", "public function serialize();", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize(){ }", "public function serialize()\n {\n }", "public function serialize()\n {\n }", "abstract public function serialize($data);", "abstract protected function serializeData();", "public function binarySerialize();", "public function serialize()\n {\n // TODO: Implement serialize() method.\n }", "public function serialize($data);", "public function SerializeObject () {\n return serialize ($this);\n }", "public function serialize()\n {\n // Interface for convenience.\n return serialize($this->__serialize());\n }", "public function serialize($data)\n {\n }", "final public function serialize(): string\n {\n return \\serialize($this);\n }", "public function serialize()\n {\n return serialize($this->data);\n }", "public function serialize()\n {\n return serialize($this->data);\n }", "public function serialize()\r\n {\r\n $data = $this->toArray();\r\n\r\n return serialize($data);\r\n }", "function serialise(): string;", "public function serialize(): array;", "public function serialize()\n {\n $data = array();\n foreach( $this->toSerialize as $var ) { $data[ $var ] = $this->$var; }\n return serialize( $data );\n }", "public function serialize()\n {\n return serialize($this->toArray());\n }", "public function toSerial() {\n\t\treturn serialize($this->toArray());\n\t}", "public function serialize($value){\n return parent::serialize($value);\n }", "public function __toString(){\r\n\t\t$data = serialize($this->_data);\r\n\t\t// Obfuscate the data with base64 encoding\r\n\t\t$data = base64_encode($data);\r\n\t\treturn $data;\r\n\t}", "public function serialize()\n {\n return serialize(array(\n \"id\"=>$this->getId()\n ));\n }", "function __toString(){\n\treturn serialize($this->__data);\n\t}", "public function serialize(): string\n {\n return serialize($this->toArray());\n }", "public function serialize(){\n return serialize($this->id);\n }", "public function serialize(){\n return serialize($this->id);\n }", "public function serialize()\n {\n return serialize([\n 'net_id' => $this->net_id,\n 'permissions' => $this->permissions,\n 'name' => $this->name,\n ]);\n }", "public function serialize()\n {\n return serialize(array(\n $this->acl,\n $this->securityIdentity,\n $this->id,\n $this->mask,\n $this->isGranting,\n $this->strategy,\n $this->auditFailure,\n $this->auditSuccess,\n ));\n }", "public function serialize()\n {\n $data = [\n 'uid' => $this->getIdentifier()\n ];\n return serialize($data);\n }", "function maybe_serialize($data)\n {\n }", "function serialize(){\r\n\t\treturn serialize(\r\n\t\t\tarray(\r\n\t\t\t\"first\" => $this -> firstName,\r\n\t\t\t\"last\" => $this -> lastName,\r\n\t\t\t)\r\n\t\t);\r\n\t}", "final public function jsonSerialize() {}", "public function serialize():String {\n\n\t\treturn json_encode($this->data);\n\n\t}", "abstract public function unserialize($serialized);", "public function unserialize($serialized=null){ }", "public function serialize()\n {\n return serialize(get_object_vars($this));\n }", "public function serialize()\n {\n return serialize(get_object_vars($this));\n }", "public function serialize()\n {\n return serialize(get_object_vars($this));\n }", "public function serialize()\n {\n return serialize(array($this->facebookId, parent::serialize()));\n }", "public function serialize()\n {\n $nonce = $this->getNonce();\n\n return serialize([$this->id, $nonce, $this->parameters->serialize()]);\n }", "protected function serialize($data)\n {\n return serialize($data);\n }", "public function serialize() \n {\n return serialize($this->items);\n }", "public function serialize()\n {\n return serialize(array(\n $this->id,\n $this->nombre,\n $this->password,\n ));\n }", "abstract protected function serializeData($unSerializedData);", "public function _jsonSerialize();", "public function unserialize($serialized);", "public function unserialize($serialized);", "public function serialize()\n {\n return serialize([\n 'identity' => $this->identity,\n 'name' => $this->name,\n 'emailAddress' => $this->emailAddress\n ]);\n }", "public function serialize()\n {\n return serialize($this->text);\n }", "public function serialize(){\n\t\tthrow new Exception(\"Method \".__CLASS__.\"::\".__METHOD__.\" not implemented yet!\");\n\t}", "#[ReturnTypeWillChange]\n public function __serialize()\n {\n return $this->toArray();\n }", "public function __serialize() { \n $serialized = [\n 'instance_name' => $this->instance_name,\n 'local_columns' => array_map(fn($column) => $this->serializeColumn($column), $this->getLocalColumns()),\n 'referenced_columns' => array_map(fn($column) => $this->serializeColumn($column), $this->getReferencedColumns()),\n 'is_reversed_relation' => $this->is_reverse_relation,\n 'target_relation' => $this->getTargetRelation(),\n 'type' => $this->type,\n ];\n\n return $serialized;\n\n }", "public function serialize()\r\n\t{\r\n\t\treturn $this->getJSONString();\r\n\t}", "public function serialize() {\n\t\treturn serialize(array($this->id, $this->password, $this->salt, $this->email,));\n\t}", "public function serialize()\n\t{\n\t\treturn serialize(array(\n\t\t\t$this->gender,\n\t\t\t($this->sociotype ? $this->sociotype->getId() : 0),\n\t\t\t$this->ageFrom,\n\t\t\t$this->ageTo,\n\t\t\t$this->locationId,\n\t\t\t$this->locationType,\n\t\t\t$this->locationTitle,\n\t\t\t$this->hasPhoto,\n\t\t));\n\t}", "public function serialize()\n\t{\n\t\treturn json_encode(array(\n\t\t\t'data' => $this->data,\n\t\t\t'this' => $this->getArrayCopy(),\n\t\t\t'name' => $this->name,\n\t\t\t'merged' => $this->merged,\n\t\t));\n\t}", "public function serialize()\n {\n return serialize(array(\n $this->id,\n $this->email,\n $this->name,\n $this->password,\n // see section on salt below\n // $this->salt,\n ));\n }", "public function serialize(): string\n {\n return $this->toRawString();\n }", "public function serialize(){\n return serialize([\n 'data' => $this->data,\n 'table' => $this->table,\n 'key' => $this->key,\n ]);\n }", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "function _serialize( &$data ) {\n\t\t$serial = serialize( $data );\n\t\tif( function_exists( 'gzdeflate' ) ) {\n\t\t\treturn gzdeflate( $serial );\n\t\t} else {\n\t\t\treturn $serial;\n\t\t}\n\t}", "function jsonSerialize();", "public function serialize($entity)\n {\n }", "public function serialize() {\n\t\t$aInformation = array();\n\t\tforeach (self::$s_aInfoKeys as $sKey) {\n\t\t\t$aInformation[$sKey] = $this[$sKey];\n\t\t}\n\n\t\treturn serialize($aInformation);\n\t}", "public function serialize() \n {\n return serialize([\n 'boardingCardNumber'=>$this->boardingCardId,\n 'arrival'=>$this->arrival, \n 'departure'=>$this->departure, \n 'passenger'=>$this->passenger,\n 'reference'=>$this->reference,\n 'busNo'=>$this->busNo,\n 'platformNo'=>$this->platformNo\n ]);\n }", "public function serialize() {\r\n return json_encode($this);\r\n }", "public function __toString()\n\t{\n\t\treturn $this->serialize();\n\t}", "public function serialize()\n {\n return json_encode($this);\n }", "public function unserialize($serialized)\n {\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }" ]
[ "0.86772126", "0.8636097", "0.8636097", "0.8630311", "0.8630311", "0.8630311", "0.85191697", "0.85191697", "0.85175747", "0.85175747", "0.85175747", "0.85175747", "0.85175747", "0.85175747", "0.79947424", "0.79048115", "0.79048115", "0.78721684", "0.78607464", "0.785966", "0.77279335", "0.76786315", "0.7505808", "0.74610996", "0.7431011", "0.7373832", "0.7348348", "0.7348348", "0.7329605", "0.72861785", "0.7191013", "0.71848166", "0.7154543", "0.70361304", "0.69826835", "0.6950494", "0.6930462", "0.68959135", "0.68714863", "0.68625563", "0.68553257", "0.6820695", "0.68199354", "0.6819549", "0.68038654", "0.679865", "0.67965084", "0.67905307", "0.6780061", "0.6767771", "0.6763735", "0.6763735", "0.6763735", "0.676145", "0.6754419", "0.67497045", "0.674225", "0.6714611", "0.6709226", "0.6708617", "0.6699376", "0.6699376", "0.6689054", "0.66825736", "0.6674816", "0.6670643", "0.66672873", "0.6653498", "0.6653023", "0.66368103", "0.6627477", "0.6626353", "0.66171557", "0.66101295", "0.661007", "0.661007", "0.661007", "0.661007", "0.661007", "0.661007", "0.661007", "0.661007", "0.6592059", "0.65913844", "0.65857345", "0.65785414", "0.65748614", "0.6573516", "0.65621203", "0.65579414", "0.6556426", "0.6553059", "0.6553059", "0.6553059", "0.6553059", "0.6553059", "0.6553059", "0.6553059", "0.6553059", "0.6553059", "0.6553059" ]
0.0
-1
A modified version of unserialize().
function unserial ( $var = FALSE, $recur = FALSE ) { if ( $recur ) { foreach ( $var as $k => $v ) { if ( is_array($v) ) { $var[$k] = unserial($v, 1); } else { $var[$k] = base64_decode($v); } } return $var; } else { return unserial(unserialize($var), 1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function unserialize($data) {}", "abstract public function unserialize($serialized);", "public function unserialize($serialized);", "public function unserialize($serialized);", "function unserialize ( $data ) {\n return unserialize( $data );\n }", "public function unserialize($serialized)\n {\n }", "#[\\ReturnTypeWillChange]\n public function unserialize($data)\n {\n }", "public function unserialize($serialized=null){ }", "function unserialize($str)\n{\n}", "abstract protected function unserializeData(array $data);", "public function unserialize($serialized)\n {\n list (\n $this->id,\n $this->usuario,\n $this->clave,\n ) = unserialize($serialized);\n }", "function maybe_unserialize($data)\n {\n }", "function unserialize($value)\n {\n return C_NextGen_Serializable::unserialize($value);\n }", "public function unserialize($serialized)\n{\n list($this->username, $this->password, $this->salt,\n $this->user_roles, $this->id) = \\json_decode(\n $serialized);\n}", "public function unserialize($serialized)\n {\n $data=unserialize($serialized);\n $this->id=$data['id'];\n\n }", "protected function unserialize($data)\n {\n return unserialize($data);\n }", "#[\\ReturnTypeWillChange]\n public function __unserialize($data)\n {\n }", "public function unserialize($serialized)\n {\n list (\n $this->id,\n $this->email,\n $this->name,\n $this->password,\n // see section on salt below\n // $this->salt\n ) = unserialize($serialized);\n }", "public function unserialize($serialized)\n {\n $data = unserialize($serialized);\n\n //TODO load references with id ?\n }", "abstract protected function unSerializeData();", "public function unserialize($serialized)\n {\n // older data which does not include all properties.\n $data = array_merge(unserialize($serialized), array_fill(0, 2, null));\n\n list($this->email, $this->id) = $data;\n }", "public function unserialize($serialized)\n{\n list($this->username, $this->password,\n $this->id) = json_decode(\n $serialized);\n}", "public function unserialize($serialized)\n {\n list($this->id, $this->username, $this->password,) = unserialize($serialized);\n }", "public function unserialize($serialized)\n {\n $this->data = unserialize($serialized);\n }", "public function unserialize($data)\n {\n // Interface for convenience.\n $this->__unserialize(unserialize($data));\n }", "public function unserialize($serialized)\n {\n list(\n $this->id,\n $this->active,\n $this->username,\n $this->password,\n $this->places,\n $this->roles,\n $this->sharedPlaces\n ) = \\json_decode($serialized);\n }", "function unserialize($data){\r\n\t\t$data = unserialize($data);\r\n\t\t$this -> firstName = $data['first'];\r\n\t\t$this -> lastName = $data['last'];\r\n\t}", "public function unserialize($serialized){\n\t\tthrow new Exception(\"Method \".__CLASS__.\"::\".__METHOD__.\" not implemented yet!\");\n\t}", "function _unserialize( $serial ) {\n\t\tif( function_exists( 'gzinflate' ) ) {\n\t\t\t$decomp = @gzinflate( $serial );\n\t\t\tif( false !== $decomp ) {\n\t\t\t\t$serial = $decomp;\n\t\t\t}\n\t\t}\n\t\treturn unserialize( $serial );\n\t}", "function __unserialize($sObject) {\n\t$__ret =preg_replace('!s:(\\d+):\"(.*?)\";!e', \"'s:'.strlen('$2').':\\\"$2\\\";'\", $sObject );\n\treturn unserialize($__ret);\n}", "public function unserialize($data)\n {\n $data = @base64_decode($data);\n if ($data === false) {\n trigger_error('Failed to decode serialized data', E_USER_ERROR);\n return;\n }\n $crypt = $this->getCrypt();\n $data = $crypt->decrypt($data);\n $data = @unserialize($data);\n if (!is_array($data)) {\n trigger_error('Failed to decode serialized data', E_USER_ERROR);\n return;\n }\n parent::unserialize($data);\n }", "public function unserialize($data)\n {\n list($this->facebookId, $parentData) = unserialize($data);\n parent::unserialize($parentData);\n }", "public function unserialize($serialized)\n {\n list($this->username, $this->password, $this->salt,\n $this->roles, $this->id) = \\json_decode(\n $serialized);\n }", "function unserialize_safe($serialized) {\r\r\n // as well as if there is any ws between O and :\r\r\n if (is_string($serialized) && strpos($serialized, \"\\0\") === false) {\r\r\n if (strpos($serialized, 'O:') === false) {\r\r\n // the easy case, nothing to worry about\r\r\n // let unserialize do the job\r\r\n return @unserialize($serialized);\r\r\n } else if (!preg_match('/(^|;|{|})O:[0-9]+:\"/', $serialized)) {\r\r\n // in case we did have a string with O: in it,\r\r\n // but it was not a true serialized object\r\r\n return @unserialize($serialized);\r\r\n }\r\r\n }\r\r\n return false;\r\r\n}", "abstract protected function serializeData($unSerializedData);", "public function unserialize($serialized)\n {\n $data = unserialize($serialized);\n // add a few extra elements in the array to ensure that we have enough keys when unserializing\n // older data which does not include all properties.\n $data = array_merge($data, array_fill(0, 2, null));\n \n list ($this->password, $this->salt, $this->usernameCanonical, $this->username, $this->expired, $this->locked, $this->credentialsExpired, $this->enabled, $this->id) = $data;\n }", "public function unserialize($serialized)\n {\n list($this->username, $this->password, $this->salt,\n $this->id) = \\json_decode(\n $serialized);\n }", "public function unserialize($serialized)\n {\n $data = unserialize($serialized);\n return self::load($data['uid']);\n }", "function MBunserialize($serial_str)\n{\n $serial_str = preg_replace_callback('!s:(\\d+):\"(.*?)\";!s', function($match){return 's:'.strlen($match['2']).':\"'.$match['2'] . '\";';}, $serial_str);\n $serial_str= str_replace(\"\\r\", \"\", $serial_str);\n return unserialize($serial_str);\n}", "function maybe_unserialize( $item ){\n if( is_serialized( $item ) ){\n \n try{\n \n // Try unzerialising\n $output = unserialize( $item );\n \n } catch( Exception $e ){\n \n // If there's an error it might be corrupted, so try uncorrupting then unserializing\n $output = unserialize( serialize_fix( $item ) );\n \n }\n \n return $output;\n \n } else {\n return $item;\n }\n}", "public function unserialize($serialized)\n {\n $raw = unserialize($serialized);\n\n $this->setIdentity($raw['identity']);\n $this->setName($raw['name']);\n $this->setEmailAddress($raw['emailAddress']);\n }", "public function unserialize($serialized)\r\n {\r\n $str = unserialize($serialized);\r\n\r\n foreach ($str as $member => $value) {\r\n $this->$member = $value;\r\n }\r\n }", "public function unserialize($sSerialized) {\n\t\t$this->setInfoKeys();\n\n\t\t$aInformation = unserialize($sSerialized);\n\n\t\tforeach ($aInformation as $sKey => $mValue) {\n\t\t\t$this[$sKey] = $mValue;\n\t\t}\n\t}", "private function unserialize($value)\n {\n $data = @unserialize($value);\n if ($value === 'b:0;' || $data !== false) {\n // Unserialization passed, return unserialized data\n return $data;\n } else {\n // Data was not serialized, return raw data\n return $value;\n }\n }", "abstract protected function serializeData();", "public function deserialize($data);", "function is_serialized_string($data)\n {\n }", "abstract public function serialize();", "abstract public function serialize();", "public function unserialize($serialized) \n {\n return list(\n $this->boardingCardId,\n $this->arrival, \n $this->departure, \n $this->passenger,\n $this->reference,\n $this->busNo,\n $this->platformNo,\n ) = unserialize($serialized);\n }", "public function maybe_unserialize($original)\n {\n if (is_serialized($original)) { // don't attempt to unserialize data that wasn't serialized going in\n return @unserialize($original);\n }\n return $original;\n }", "public function _unserialize($data)\n\t{\n\t\treturn json_decode($data, TRUE);\n\t}", "function unpack_member_cache( $cache_serialized_array=\"\" )\n\t{\n\t\treturn unserialize( $cache_serialized_array );\n\t}", "public function unserialize($db_data)\n {\n return Base64Native::unserialize($db_data);\n }", "abstract public function serialize($data);", "public function unserialize($messageSerialized)\n {\n return unserialize($messageSerialized);\n }", "public function __unserialize(array $data): void\n {\n $this->createFromArray($data);\n }", "public abstract function serialize();", "public function testSerialize() {\n $index = Phish_Index::load();\n $str = serialize($index);\n $indexRestored = unserialize($str);\n $this->assertEquals($index, $indexRestored);\n }", "public function __unserialize(array $data): void\n {\n $this->__construct($data);\n }", "public function unserialize($input)\n {\n $output = unserialize($input);\n if ($output === false) {\n $input = preg_replace_callback('!(?<=^|;)s:(\\d+)(?=:\"(.*?)\";(?:}|a:|s:|b:|d:|i:|o:|N;))!s', function ($match) {\n return 's:' . strlen($match[2]);\n }, $input);\n return unserialize($input);\n }\n return $output;\n }", "public function serialize();", "public function serialize();", "public function serialize();", "function unserialize()\r\n {\r\n global $methodCache;\r\n\r\n $owner=$this->readOwner();\r\n\r\n if ($owner!=null)\r\n {\r\n if ($this->inheritsFrom('Component')) $this->ControlState=csLoading;\r\n\r\n $namepath=$this->readNamePath();\r\n //if (isset($_SESSION[$namepath])) $this->newunserialize($_SESSION[$namepath]);\r\n\r\n $myclassName = $this->ClassName();\r\n\r\n if( isset( $methodCache[ $myclassName ] ) )\r\n {\r\n $methods = $methodCache[ $myclassName ];\r\n }\r\n else\r\n {\r\n $refclass=new ReflectionClass( $myclassName );\r\n $methods=$refclass->getMethods();\r\n\r\n $methods = array_filter( $methods, 'filterSet' );\r\n\r\n array_walk( $methods, 'processMethods' );\r\n\r\n $methodCache[ $myclassName ] = $methods;\r\n }\r\n\r\n $ourNamePath = $this->readNamePath();\r\n\r\n foreach( $methods as $methodname )\r\n {\r\n $propname=substr($methodname, 3);\r\n\r\n $fullname = $ourNamePath . '.' . $propname;\r\n if (isset($_SESSION[$fullname]))\r\n {\r\n $this->$methodname($_SESSION[$fullname]);\r\n }\r\n else\r\n {\r\n $propname = 'get' . $propname;\r\n $ob=$this->$propname();\r\n if (is_object($ob))\r\n {\r\n if ($ob->inheritsFrom('Persistent'))\r\n {\r\n $ob->unserialize();\r\n }\r\n }\r\n }\r\n }\r\n\r\n if ($this->inheritsFrom('Component')) $this->ControlState=0;\r\n }\r\n else\r\n {\r\n global $exceptions_enabled;\r\n\r\n if ($exceptions_enabled)\r\n {\r\n throw new Exception('Cannot unserialize a component without an owner');\r\n }\r\n }\r\n }", "function unserializeChildren()\r\n {\r\n reset($this->components->items);\r\n while (list($k,$v)=each($this->components->items))\r\n {\r\n $v->unserialize();\r\n }\r\n }", "public static function unserialize($serialized, array $options = array()) \n {\n if (isset($options['adapter'])) {\n $adapter = self::factory($options['adapter']);\n unset($options['adapter']);\n } else {\n $adapter = self::getDefaultAdapter();\n }\n\n return $adapter->unserialize($serialized, $options);\n }", "public function unserialize($data)\n {\n $this->cookies = unserialize($data);\n }", "public function unserialize($input)\n\t{\n\t\t// Unserialize the options, data, and inputs.\n\t\tlist($this->options, $this->data, $this->inputs) = unserialize($input);\n\n\t\t// Load the filter.\n\t\tif (isset($this->options['filter']))\n\t\t{\n\t\t\t$this->filter = $this->options['filter'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->filter = InputFilter::getInstance();\n\t\t}\n\t}", "protected function maybe_unserialize($original)\n {\n if (defined('WP_REDIS_SERIALIZER') && ! empty(WP_REDIS_SERIALIZER)) {\n return $original;\n }\n\n if (defined('WP_REDIS_IGBINARY') && WP_REDIS_IGBINARY && function_exists('igbinary_unserialize')) {\n return igbinary_unserialize($original);\n }\n\n // don't attempt to unserialize data that wasn't serialized going in\n if ($this->is_serialized($original)) {\n return @unserialize($original);\n }\n\n return $original;\n }", "public function binarySerialize();", "public function copy()\n\t\t{\n\t\t\treturn unserialize(serialize($this)); \n\t\t}", "function deserialise(string $data): void;", "public static function Unserialize($SerializedString) {\n\t\t$Result = $SerializedString;\n\n if(is_string($SerializedString)) {\n\t\t\tif(substr_compare('a:', $SerializedString, 0, 2) === 0 || substr_compare('O:', $SerializedString, 0, 2) === 0)\n\t\t\t\t$Result = unserialize($SerializedString);\n\t\t\telseif(substr_compare('obj:', $SerializedString, 0, 4) === 0)\n $Result = json_decode(substr($SerializedString, 4), FALSE);\n elseif(substr_compare('arr:', $SerializedString, 0, 4) === 0)\n $Result = json_decode(substr($SerializedString, 4), TRUE);\n }\n return $Result;\n }", "public function serialize($data);", "public function deserialize($data)\n {\n }", "public function __toString(){\r\n\t\t$data = serialize($this->_data);\r\n\t\t// Obfuscate the data with base64 encoding\r\n\t\t$data = base64_encode($data);\r\n\t\treturn $data;\r\n\t}", "public function unserialize($input)\n\t{\n\t\t// Unserialize the executable, args, options, data, and inputs.\n\t\tlist($this->calledScript, $this->args, $this->filter, $this->data, $this->inputs) = unserialize($input);\n\n\t\t$this->filter = $this->filter ? : new NullFilter;\n\t}", "function pico_convert_serialized_data($mydirname)\n{\n\t$db = XoopsDatabaseFactory::getDatabaseConnection();\n\n\t// update data in content_extras\n\t$sql = 'SELECT content_extra_id,data FROM ' . $db->prefix($mydirname . '_content_extras') . \" WHERE data NOT LIKE 'array%'\";\n\t$result = $db->query($sql);\n\tif ($db->getRowsNum($result) > 0) {\n\t\twhile (list($id, $data) = $db->fetchRow($result)) {\n\t\t\t$data4sql = $db->quoteString(pico_common_serialize(pico_common_unserialize($data)));\n\t\t\t$db->queryF('UPDATE ' . $db->prefix($mydirname . '_content_extras') . \" SET data=$data4sql WHERE content_extra_id=$id\");\n\t\t}\n\t}\n\n\t// update extra_fields in contents\n\t$sql = 'SELECT content_id,extra_fields FROM ' . $db->prefix($mydirname . '_contents') . \" WHERE extra_fields NOT LIKE 'array%' OR extra_fields IS NULL\";\n\t$result = $db->query($sql);\n\tif ($db->getRowsNum($result) > 0) {\n\t\twhile (list($id, $data) = $db->fetchRow($result)) {\n\t\t\t$data4sql = $db->quoteString(pico_common_serialize(pico_common_unserialize($data)));\n\t\t\t$db->queryF('UPDATE ' . $db->prefix($mydirname . '_contents') . \" SET extra_fields=$data4sql WHERE content_id=$id\");\n\t\t}\n\t}\n}", "public function unserialize($serialized)\n {\n $temp = json_decode($serialized);\n\n if (isset($temp->url)) {\n $this->url = $temp->url;\n }\n\n if (isset($temp->action)) {\n $this->action = $temp->action;\n }\n\n if (isset($temp->filename)) {\n $this->filename = $temp->filename;\n }\n }", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "#[ReturnTypeWillChange]\n public function __unserialize($data)\n {\n foreach ($data as $item) {\n $this->unshift($item);\n }\n }", "public function dbUnserialize(string $storedValue): void;", "function maybe_serialize($data)\n {\n }", "public function __clone()\n\t{\n\t\tforeach ($this as $k => $v)\n\t\t{\n\t\t\tif ((is_object($v)) || is_array($v)) {\n\t\t\t\t$this->{$k} = unserialize(serialize($v));\n\t\t\t}\n\t\t}\n\t}", "public function __clone()\n\t{\n\t\tforeach ($this as $k => $v)\n\t\t{\n\t\t\tif ((is_object($v)) || is_array($v)) {\n\t\t\t\t$this->{$k} = unserialize(serialize($v));\n\t\t\t}\n\t\t}\n\t}", "function is_serialized($data, $strict = \\true)\n {\n }", "public function __clone()\n {\n foreach ($this as $key => $val)\n {\n if (is_object($val) || is_array($val))\n $this->{$key} = unserialize(serialize($val));\n }\n }", "public function test_serialized_data() {\n\t\t$key = rand_str();\n\t\t$value = array(\n\t\t\t'foo' => true,\n\t\t\t'bar' => true,\n\t\t);\n\n\t\t$this->assertTrue( WP_Temporary::set_site( $key, $value ) );\n\t\t$this->assertEquals( $value, WP_Temporary::get_site( $key ) );\n\n\t\t$value = (object) $value;\n\t\t$this->assertTrue( WP_Temporary::set_site( $key, $value ) );\n\t\t$this->assertEquals( $value, WP_Temporary::get_site( $key ) );\n\t\t$this->assertTrue( WP_Temporary::delete_site( $key ) );\n\t}", "function _safe_unserialize($str)\n{\n\tif(strlen($str) > MAX_SERIALIZED_INPUT_LENGTH)\n\t{\n\t\tthrow new Exception('safe_unserialize: input exceeds ' . MAX_SERIALIZED_INPUT_LENGTH);\n\t}\n\n\tif(empty($str) || !is_string($str))\n\t{\n\t\treturn false;\n\t}\n\n\t$stack = array();\n\t$expected = array();\n\n\t/*\n\t * states:\n\t * 0 - initial state, expecting a single value or array\n\t * 1 - terminal state\n\t * 2 - in array, expecting end of array or a key\n\t * 3 - in array, expecting value or another array\n\t */\n\t$state = 0;\n\twhile($state != 1)\n\t{\n\t\t$type = isset($str[0]) ? $str[0] : '';\n\n\t\tif($type == '}')\n\t\t{\n\t\t\t$str = substr($str, 1);\n\t\t}\n\t\telse if($type == 'N' && $str[1] == ';')\n\t\t{\n\t\t\t$value = null;\n\t\t\t$str = substr($str, 2);\n\t\t}\n\t\telse if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches))\n\t\t{\n\t\t\t$value = $matches[1] == '1' ? true : false;\n\t\t\t$str = substr($str, 4);\n\t\t}\n\t\telse if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches))\n\t\t{\n\t\t\t$value = (int)$matches[1];\n\t\t\t$str = $matches[2];\n\t\t}\n\t\telse if($type == 'd' && preg_match('/^d:(-?[0-9]+\\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches))\n\t\t{\n\t\t\t$value = (float)$matches[1];\n\t\t\t$str = $matches[3];\n\t\t}\n\t\telse if($type == 's' && preg_match('/^s:([0-9]+):\"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '\";')\n\t\t{\n\t\t\t$value = substr($matches[2], 0, (int)$matches[1]);\n\t\t\t$str = substr($matches[2], (int)$matches[1] + 2);\n\t\t}\n\t\telse if($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches) && $matches[1] < MAX_SERIALIZED_ARRAY_LENGTH)\n\t\t{\n\t\t\t$expectedLength = (int)$matches[1];\n\t\t\t$str = $matches[2];\n\t\t}\n\t\telse if($type == 'O')\n\t\t{\n\t\t\tthrow new Exception('safe_unserialize: objects not supported');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception('safe_unserialize: unknown/malformed type: '.$type);\n\t\t}\n\n\t\tswitch($state)\n\t\t{\n\t\t\tcase 3: // in array, expecting value or another array\n\t\t\t\tif($type == 'a')\n\t\t\t\t{\n\t\t\t\t\tif(count($stack) >= MAX_SERIALIZED_ARRAY_DEPTH)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception('safe_unserialize: array nesting exceeds ' . MAX_SERIALIZED_ARRAY_DEPTH);\n\t\t\t\t\t}\n\n\t\t\t\t\t$stack[] = &$list;\n\t\t\t\t\t$list[$key] = array();\n\t\t\t\t\t$list = &$list[$key];\n\t\t\t\t\t$expected[] = $expectedLength;\n\t\t\t\t\t$state = 2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif($type != '}')\n\t\t\t\t{\n\t\t\t\t\t$list[$key] = $value;\n\t\t\t\t\t$state = 2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tthrow new Exception('safe_unserialize: missing array value');\n\n\t\t\tcase 2: // in array, expecting end of array or a key\n\t\t\t\tif($type == '}')\n\t\t\t\t{\n\t\t\t\t\tif(count($list) < end($expected))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception('safe_unserialize: array size less than expected ' . $expected[0]);\n\t\t\t\t\t}\n\n\t\t\t\t\tunset($list);\n\t\t\t\t\t$list = &$stack[count($stack)-1];\n\t\t\t\t\tarray_pop($stack);\n\n\t\t\t\t\t// go to terminal state if we're at the end of the root array\n\t\t\t\t\tarray_pop($expected);\n\t\t\t\t\tif(count($expected) == 0) {\n\t\t\t\t\t\t$state = 1;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif($type == 'i' || $type == 's')\n\t\t\t\t{\n\t\t\t\t\tif(count($list) >= MAX_SERIALIZED_ARRAY_LENGTH)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception('safe_unserialize: array size exceeds ' . MAX_SERIALIZED_ARRAY_LENGTH);\n\t\t\t\t\t}\n\t\t\t\t\tif(count($list) >= end($expected))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception('safe_unserialize: array size exceeds expected length');\n\t\t\t\t\t}\n\n\t\t\t\t\t$key = $value;\n\t\t\t\t\t$state = 3;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tthrow new Exception('safe_unserialize: illegal array index type');\n\n\t\t\tcase 0: // expecting array or value\n\t\t\t\tif($type == 'a')\n\t\t\t\t{\n\t\t\t\t\tif(count($stack) >= MAX_SERIALIZED_ARRAY_DEPTH)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception('safe_unserialize: array nesting exceeds ' . MAX_SERIALIZED_ARRAY_DEPTH);\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = array();\n\t\t\t\t\t$list = &$data;\n\t\t\t\t\t$expected[] = $expectedLength;\n\t\t\t\t\t$state = 2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif($type != '}')\n\t\t\t\t{\n\t\t\t\t\t$data = $value;\n\t\t\t\t\t$state = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tthrow new Exception('safe_unserialize: not in array');\n\t\t}\n\t}\n\n\tif(!empty($str))\n\t{\n\t\tthrow new Exception('safe_unserialize: trailing data in input');\n\t}\n\treturn $data;\n}", "public static function unserialize($filename) {\r\n return unserialize(file_get_contents($filename. '.obj'));\r\n }", "public function __wakeup ();", "function typecast($old_object, $new_classname) {\r\n if(class_exists($new_classname)) {\r\n\r\n //echo \"OLD<br>\";\r\n //dataDump($old_object);\r\n\r\n $old_serialized_object = serialize($old_object);\r\n $n=explode(\":\",$old_serialized_object);\r\n $new_serialized_object = 'O:' . strlen($new_classname) . ':\"' . $new_classname . '\":' .$n[3].\":\". \r\n substr($old_serialized_object, strpos($old_serialized_object,\"{\"));\r\n\r\n //echo \"Casting OK $old_serialized_object<br>$new_serialized_object\";\r\n //echo \"NEW<br>\";\r\n //dataDump(unserialize($new_serialized_object));\r\n\r\n return unserialize($new_serialized_object);\r\n }\r\n else {\r\n debug(\"$new_classname no existe o no ha sido definida!!!!\",\"red\");\r\n return false;\r\n }\r\n}", "public function __clone()\n\t{\n\t\tforeach ($this as $k => $v)\n\t\t{\n\t\t\tif (is_object($v) || is_array($v))\n\t\t\t{\n\t\t\t\t$this->{$k} = unserialize(serialize($v));\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.8129617", "0.80395675", "0.78924954", "0.78924954", "0.75985193", "0.7517173", "0.7493589", "0.74214745", "0.7259641", "0.7096745", "0.70808", "0.7023273", "0.6845647", "0.6835847", "0.67794293", "0.6767033", "0.6749228", "0.6725225", "0.669678", "0.66625977", "0.6661857", "0.66365874", "0.6607323", "0.6576083", "0.6568642", "0.6530017", "0.65120685", "0.65108895", "0.64718413", "0.64209807", "0.64190507", "0.6387957", "0.6381225", "0.63792425", "0.6358075", "0.6330399", "0.63170284", "0.6271814", "0.6219084", "0.61980814", "0.6156072", "0.6154621", "0.6117486", "0.60977995", "0.6097403", "0.60855114", "0.60581756", "0.60568887", "0.60568887", "0.60398537", "0.60270244", "0.6025414", "0.6009373", "0.59873873", "0.5985957", "0.5985648", "0.59808964", "0.5980483", "0.59738207", "0.5959222", "0.5936807", "0.5881691", "0.5881691", "0.5881691", "0.5866814", "0.58613074", "0.58493423", "0.58157563", "0.58074397", "0.5805204", "0.57611173", "0.57571226", "0.57459724", "0.574337", "0.57173103", "0.57150894", "0.57002544", "0.5662992", "0.5655635", "0.56359786", "0.56352514", "0.56352514", "0.56345654", "0.56345654", "0.56345654", "0.56345654", "0.56345654", "0.56345654", "0.5616151", "0.56016773", "0.55607885", "0.55518985", "0.55518985", "0.5545908", "0.55399185", "0.5501939", "0.5501918", "0.5501373", "0.54937327", "0.5486895", "0.54815125" ]
0.0
-1
Halts execution and recirect the browser to a new location
function redirect($where=-2, $delay=false){ if(is_object($where)) $where = array('id' => $where->ID); elseif(is_numeric($where)){ if($where <= 0) { $where = url(@$_SESSION['TRACE'][-$where]['_GET'], false, false, false, true); } else { $where = array('id' => $where); } } if(is_array($where)) $where = url($where); $where = str_replace('&amp;', '&', $where); if(!$where) die(); while(ob_get_level()) @ob_end_clean(); if($delay) { JS::raw('setTimeout("window.location.href=\''.$where.'\'",'. $delay*1000 .');'); } elseif(headers_sent()) { echo "<script type=\"text/javascript\"> <!-- window.location='$where'; --> </script>"; } else { header('Location: '.$where); } die(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function refresh() {\n\t\t$this->redirect( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '/' );\n\t}", "private function redirectAndDie() {\n header('Location: ' . $_SERVER['PHP_SELF']);\n die;\n }", "function stopsimulate() {\n $this->auth(SUPPORT_ADM_LEVEL);\n $this->_stopsimulate();\n redirect('/mypage');\n }", "public function reload() {\n $this->init();\n redirect('./');\n }", "function doStopTourAction() {\n//\t\t$request = DevblocksPlatform::getHttpRequest();\n\n\t\t$worker = CerberusApplication::getActiveWorker();\n\t\tDAO_WorkerPref::set($worker->id, 'assist_mode', 0);\n\t\t\n//\t\tDevblocksPlatform::redirect(new DevblocksHttpResponse($request->path, $request->query));\n\t}", "public function halt();", "function redirect() {\n if (!$this->programmed && !$this->request['rebuild'] && $this->destination) {\n if (drupal_installation_attempted()) {\n install_goto($this->destination['path']);\n }\n else {\n drupal_goto($this->destination['path'], $this->destination['options'], $this->destination['http_response_code']);\n }\n }\n }", "function simulate() {\n $this->auth(SUPPORT_ADM_LEVEL);\n $simulate_id = $this->uri->segment(3);\n $this->_simulate($simulate_id);\n redirect('/mypage');\n }", "public function send()\n\t{\n\t\t$this->page->generatePage();\n\t\texit;\n\t}", "public function mainscreen()\r\n\t{\r\n\t\t$this->setRedirect( 'index.php?option=com_jblesta&controller=default' );\r\n\t\t$this->redirect();\r\n\t}", "public function resetBrowser()\n {\n $this->getSession()->reset();\n }", "public static function rendirect($url){\n\t \n\t\t header(\"Location: {$url}\");\n exit;\n\t}", "function cancel() {\r\n\t\t$this->setRedirect ( 'index.php' );\r\n\t}", "private function _redirect_to_homepage()\n {\n header(\"Location: /\");\n die();\n }", "function ltiLaunchCheck() {\n global $CFG, $PDO;\n if ( ! ltiIsRequest() ) return false;\n $session_id = ltiSetupSession($PDO);\n if ( $session_id === false ) return false;\n\n // Redirect back to ourselves...\n $url = curPageURL();\n $query = false;\n if ( isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0) {\n $query = true;\n $url .= '?' . $_SERVER['QUERY_STRING'];\n }\n\n $location = sessionize($url);\n session_write_close(); // To avoid any race conditions...\n\n if ( headers_sent() ) {\n echo('<p><a href=\"'.$url.'\">Click to continue</a></p>');\n } else { \n header('Location: '.$location);\n }\n exit();\n}", "private function markCurrentPage() {\n $this->pageReloadMarker = $this->randomMachineName();\n $this->getSession()->executeScript('document.body.appendChild(document.createTextNode(\"' . $this->pageReloadMarker . '\"));');\n }", "protected function doAfterOrderCopyed()\n\t{\n\t\tLocalRedirect($this->arParams[\"PATH_TO_BASKET\"]);\n\t}", "protected static function launchBrowser()\n\t{\n\t\tif (MHTTPD::$config['Other']['browser_autolaunch']) {\n\t\t\t$url = MHTTPD::$config['SSL']['enabled'] ? 'https://' : 'http://';\n\t\t\t$url .= MHTTPD::$config['Server']['address'].':'.MHTTPD::$config['Server']['port'].'/';\n\t\t\t$cmd = 'cmd.exe /C start /B /WAIT PING 127.0.0.1 -n 3 -w 1000 >NUL '\n\t\t\t\t.'& start /B rundll32.exe url.dll,FileProtocolHandler '.$url;\n\t\t\t$wshShell = new COM('WScript.Shell');\n\t\t\t$wshShell->Run($cmd, 0, false);\n\t\t}\n\t}", "public function finish()\n {\n $p = $this->page;\n if ($p->is_ajax_request) {\n exit_json($this->response);\n }\n\n $to = ($_GET['return_uri']) ?: $_SERVER['HTTP_REFERER'];\n $get = ($this->response['status'] == 'OK')\n ? array('status' => 'OK')\n : $this->response;\n\n $get = '?return='.rawurlencode(serialize($get));\n\n $p->redirect($to.$get, 302);\n }", "public function redirectAndExit()\n {\n if ($this->getCloseSessionOnExit()) {\n // Close session, if started\n if (class_exists('Zend_Session', false) && Zend_Session::isStarted()) {\n Zend_Session::writeClose();\n } elseif (isset($_SESSION)) {\n session_write_close();\n }\n }\n\n $this->getResponse()->sendHeaders();\n exit();\n }", "public function resetBrowser()\n {\n parent::resetBrowser();\n }", "function redirKill($addr, $rsecs = 0, $estatus = 0) {\r\n\theader(\"refresh:$rsecs; url=$addr\");\r\n\texit(0);\r\n}", "public function switchToMainFrame(): void\n {\n $this->getSession()->switchToIFrame();\n }", "function re_login() {\n header(\"Location: start.php\");\n die();\n }", "static function RedirToDefault()\n\t{\n\t\theader(\"Location: \" . $GLOBALS['host'] . self::$subDir . \"/\" . self::$defPage);\n\t}", "public function iSwitchOutOfAllFrames() {\n $this->getSession()->switchToIFrame();\n $this->iframe = NULL;\n }", "public function send(){\n\t\t\n\t\texit($this->page->generate());\n\t}", "public function login_page_working()\n {\n $this->browse(function ($browser) {\n $browser->visit(new Login);\n });\n }", "protected function redirectToCurrentPage() {}", "function stop ()\n{\n file_put_contents(config::CLIENT_BASE_DIR . '/act', 'idle');\n die();\n}", "public function run()\n {\n $this->browser->open($_ENV['app_frontend_url'] . $this->product->getUrlKey() . '.html');\n }", "function go($url){\n\theader(\"Location: \".$url);\n\texit();\n}", "protected function expulsaVisitante()\n {\n header( \"Location: \".self::index );\n }", "private function _logout(){\n\t\tredirect('/', 'refresh');\n\t\treturn;\n\t}", "function BrowserEmulator() {\n\t\t$this->resetHeaderLines ();\n\t\t$this->resetPort ();\n\t}", "public function do_redirect() {\n\t\twp_safe_redirect( $GLOBALS['redirect_to'] );\n\t\texit;\n\t}", "public function halt()\n {\n $this->_halt = TRUE;\n }", "function immediateRedirect($location)\r\n\t{\r\n\t\tif (!headers_sent()) \r\n\t\t{\r\n\t\t\theader(\"Location: \".$location);\r\n\t\t\texit;\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\techo \"<script language='javascript' type='text/javascript'>window.location.href='\".$location.\"';</script>\";\r\n\t\t\texit;\r\n\t\t}\t\t\r\n\t}", "function refreshPage($tiempo,$url)\n{\n print \"<META HTTP-EQUIV=\\\"Refresh\\\" CONTENT=\\\"$tiempo; URL=$url\\\">\";\n if($tiempo==0)\n exit();\n}", "protected function redirect_to_splash() {\n\t\twp_safe_redirect( $this->context->admin_url( 'splash' ) );\n\t\texit;\n\t}", "function redirect($url) {\n ob_start();\n header('Location: '.$url);\n ob_end_flush();\n die();\n }", "function imgDone() {\n virtual($_SERVER['REQUEST_URI']);\n exit();\n}", "public function flushToBrowser() {\n\n // Registering a shutdown flag allows other points in jettmail to determine if the state is in shutdown\n $GLOBALS['shutdown_flag'] = 1;\n\n if (!headers_sent()) {\n\n // Ignore user aborts and allow the script to run forever\n ignore_user_abort(true);\n session_write_close();\n set_time_limit(0);\n\n // Tell the browser that we are done\n header(\"Connection: close\");\n $size = ob_get_length();\n header(\"Content-Length: $size\");\n ob_end_flush();\n flush();\n }\n\n }", "private function redirect(){\n\t\tredirect('browse/office_industrial');//default re-route\n\t}", "private function restart() {\n session_start();\n session_regenerate_id();\n session_destroy();\n session_commit();\n session_start();\n $this->setUserAgent();\n $this->setRemoteAddress();\n }", "function goToSite() {\n header('Location: index.php?action=start-app');\n\n}", "function redirect_to($url = 'index.php')\n\t{\n\t\t$redirect = 'location: ' . $url;\n\t\theader($redirect);\n\t\t\n\t\tdie(); /*halt the execution*/\n\t}", "function redirect()\n {\n global $wgOut;\n $wgOut->redirect( $this->getRedirectLink(), 302);\n }", "function index(){\n\t\tredirect('');\n\t}", "public static function redirect() {\n\t\tunset( $_GET['action'] );\n\n\t\twp_safe_redirect( admin_url( 'admin.php?page=' . WPFC_QS_Setup::get_template_name() . '-setup' ) );\n\n\t\texit();\n\t}", "public function _break()\n {\n //set the internal execution flag to false, stopping execution\n $this->executing = false;\n }", "protected function gotoHome()\n {\n redirect($this->homePath);\n }", "public static function go(string $filename)\n\t{\n\t\theader(\"Location: \" . $filename);\n\t\texit;\n\t}", "public function redirect(): void\n {\n $this->admin->redirect($this->redirect, $this->redirectCode);\n }", "protected final function reload() {\n\t\treturn $this->redirect(Router::getPath());\n\t}", "public static function rememberRequestedPage(): void\n\t{\n\t\t$_SESSION['return_to'] = $_SERVER['REQUEST_URI'];\n\t}", "private function _redirect ()\r\n {\r\n global $CALE_VIRTUALA_SERVER;\r\n \r\n setcookie(self::$_cookieCount, \"\", time() - 3600, \"/\");\r\n header(\"Location: \" . $CALE_VIRTUALA_SERVER);\r\n die();\r\n }", "public static function rediriger($url) { \n if(!headers_sent()) { \n header('Location:'.$url); \n die();\n } else { \n ?>\n <script type=\"text/javascript\">\n window.location = \"<?php echo $url;?>\";\n </script>\n <?php\n }\n}", "protected function redir($url)\n \t{\n \t\theader('Location:' . $url);\n \t\tdie();\n \t}", "private function exitLogin(){\n\t\tSeguridad::cerrarSesion();\n\t\theader('Location: index.php');\n\t}", "function moveForward()\n{\n $_SESSION['pagetracker'] = 2;\n echo \"<script>location.assign('./page2.php');</script>\";\n}", "protected function ReloadCurrentStep()\n {\n $this->getRedirect()->redirect($this->getOrderStepPageService()->getLinkToOrderStepPageRelative($this));\n }", "public static function redirect($url)\n {\n echo '<script type=\"text/javascript\">document.location.href=\"' . $url . '\";</script>';\n exit;\n }", "function redirect($url) {\n ob_start();\n header('Location: '.$url);\n ob_end_flush();\n die();\n }", "function redirect($url) {\n ob_start();\n header('Location: '.$url);\n ob_end_flush();\n die();\n }", "public function redirect($url) {\r\n ob_start();\r\n header('Location: '. $url);\r\n ob_end_flush();\r\n die();\r\n }", "function quitar_inyect(){\n\tfix_request();\n\treturn true;\n}", "function redirect() {\n\t\theader('Location:index.php');\n\t}", "public function gotoSource(){\n if(!empty($this->website)){\n header(\"Location: \". $this->website);\n }\n else{\n header(\"Location: \". $this->getUri());\n }\n die();\n }", "public function mainTask()\n\t{\n\t\t// Redirect to version panel of current version (TEMP)\n\t\tApp::redirect(\n\t\t\tRoute::url($this->_route . '&active=versions', false)\n\t\t);\n\t\treturn;\n\t}", "protected function goHomePage()\n {\n $this->_redirect($this->homeURL);\n }", "public function go($url)\r\n {\r\n header('Location: '.$url);\r\n }", "public function ProcessAjax()\n {\n exit; // <<----------- this should exit\n }", "function redirect() {\n //header('Location: ' . $this->url_origin($_SERVER, false)); \n exit(0);\n}", "public function redirect_script() {\n\t\t$languages = $this->available_languages;\n\t\t$current_step = intval( $this->step );\n\t\t$next_step = $current_step + 1;\n\t\t// Add 500ms delay for refreshes.\n\t\t$delay = 500;\n\t\tif ( ( $current_step + 1 ) <= count( $this->steps ) && $this->proceed ) {\n\t\t\t// Redirect to next step.\n\t\t\t$lang = ( isset( $_GET['lang'] ) ) ? sanitize_text_field( wp_unslash( $_GET['lang'] ) ) : '';\n\t\t\treturn '<script type=\"text/javascript\">setTimeout(function () {window.location.href = \"' . admin_url( 'index.php?avada_update=1&ver=400&lang=' . $lang . '&step=' . $next_step ) . '\";}, ' . $delay . ');</script>';\n\t\t} else {\n\t\t\t// Check if this is a multilingual site.\n\t\t\tif ( ! empty( $languages ) ) {\n\t\t\t\t// Get the next language code.\n\t\t\t\t$next_lang = $this->get_next_language();\n\t\t\t\tif ( 'finished' === $next_lang ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn '<script type=\"text/javascript\">setTimeout(function () {window.location.href = \"' . admin_url( 'index.php?avada_update=1&ver=400&new=1&lang=' . $next_lang ) . '\";}, ' . $delay . ');</script>';\n\t\t\t}\n\t\t}\n\t}", "public function resetSessionAndGoToHomepage()\n {\n $this->getSession()->reset();\n $this->visitPath('/');\n }", "function redirect_to($new_location) {\n\t\theader(\"Location: \" . $new_location);\n\t\texit;\n\t}", "protected function redirect()\n\t{\n\t\theader('Location: /ru/marafon/');\n\t\texit;\n\t}", "function redirect_to($new_location) {\r\n\t\theader(\"Location: \" . $new_location);\r\n\t\texit;\r\n\t}", "public function testOpenBrowser()\n\t{\n\t\t$this->url('/');//The test page has only phpinfo(); as HTML content\n\t\t$content = $this->byTag('body')->text();\n\t\t// $this->assertEquals('PHP Version 5.6.20-1+deb.sury.org~trusty+1', $content);\n\t\t$this->assertContains('PHP Version 5.6.20-1+deb.sury.org~trusty+1', $content);\n\n\t\t//Simulating and ajax call\n\t\t//Will loop on the callback for 2 seconds before continuing scripts below\n\t\t// $this->timeouts()->implicitWait(300); //milliseconds\n\t\t$this->waitUntil(function(){\n\t\t\ttry{\n\t\t\t\t// $webdriver->byId('rootElement');//select by id\n\t\t\t\t$this->byCssSelector('h1.p');//select by css\n\n\t\t\t\treturn true;\n\t\t\t}catch (Exception $ex){\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}, 2000);//2 seconds\n\t\t//This is run after the waitUntil finished in 2 seconds\n\t\t$content = $this->byCssSelector('h1.p')->text();\n\t\t$this->assertEquals('PHP Version 5.6.20-1+deb.sury.org~trusty+1', $content);\n\n\t}", "function wp_client_redirect($url) {\r\n if ( false !== ob_get_contents() )\r\n ob_end_flush();\r\n\r\n echo '<script type=\"text/javascript\" language=\"javascript\">self.location.href=\"' . $url . '\";</script>';\r\n exit;\r\n }", "public function discard() {\n\t\t$this->DispositionManager->discard();\n\t\t$this->autoRender = false;\n\t\t$this->redirect($this->refererStack(SYSTEM_CONSUME_REFERER));\n\t}", "function redirectToDashBoard() {\n\theader('Location: '. SERVER_PATH. 'dashboard.php');\n\texit();\n}", "public function clear() {\n header( \"Location:\" . $this->url() );\n }", "public function index_action() {\n \\TPL::output('/pl/be/sns/wx/main');\n exit;\n }", "function Page_Terminate($url = \"\") {\r\n\t\tglobal $conn;\r\n\r\n\t\t// Page unload event, used in current page\r\n\t\t$this->Page_Unload();\r\n\r\n\t\t// Global page unloaded event (in userfn*.php)\r\n\t\tPage_Unloaded();\r\n\r\n\t\t // Close Connection\r\n\t\t$conn->Close();\r\n\r\n\t\t// Go to URL if specified\r\n\t\tif ($url <> \"\") {\r\n\t\t\tob_end_clean();\r\n\t\t\theader(\"Location: $url\");\r\n\t\t}\r\n\t\texit();\r\n\t}", "public function sendRedirect() {}", "function RedirectTo($newlocation){\n\t\theader('location:' . $newlocation);\n\t\texit();\n\t}", "function redirect() {\n\t\theader('Location: admin.php');\n\t\texit();\n\t}", "public function finish();", "public function finish();", "function _endpage()\n\t\t{\n\t\t\t$this->state=1;\n\t\t}", "function Page_Terminate($url = \"\") {\n\tglobal $conn;\n\n\t// Page unload event, used in current page\n\tPage_Unload();\n\n\t// Global page unloaded event (in userfn*.php)\n\tPage_Unloaded();\n\n\t // Close Connection\n\t$conn->Close();\n\n\t// Go to url if specified\n\tif ($url <> \"\") {\n\t\tob_end_clean();\n\t\theader(\"Location: $url\");\n\t}\n\texit();\n}", "public function action_endsession()\n\t{\n\t\t// This is so easy!\n\t\tunset($_SESSION['admin_time']);\n\n\t\t// Clean any admin tokens as well.\n\t\tcleanTokens(false, '-admin');\n\n\t\tif (isset($this->_req->query->redir, $this->_req->server->HTTP_REFERER))\n\t\t{\n\t\t\tredirectexit($_SERVER['HTTP_REFERER']);\n\t\t}\n\n\t\tredirectexit();\n\t}", "function redirect($url){\n\techo \"<script type=\\\"text/javascript\\\">window.location=\\\"http://ie11dt7twqr1s.global.ds.honeywell.com/pmdb/$url\\\";</script>\";\n\tdbi_close ( $c );\n\texit;\n}", "public function run()\r\n {\r\n $this->spaceShip->navigateTo($this->destination['x'], $this->destination['y'], $this->destination['z']);\r\n }", "private function finalizeOutput()\n\t{\n\t\tif ($this->isRedirect === true) {\n\t\t\t// this shouldn't appear, as redirect header would take care of it.\n\t\t\t// in case it's seen, reload link would help user to manually reload/redirect the page.\n\t\t\techo \"<a onclick='location.reload()'>click here to reload the page.</a>\";\n\t\t}\n\t}", "public static function redirect($url) {\n\t\t\techo \"<a href=\\\"./\".$url.\"\\\">Click here to continue.</a>\";\n\t\t\techo \"<script type=\\\"text/javascript\\\">\n\t\t\t<!--\n\t\t\twindow.location = \\\"./\".$url.\"\\\"\n\t\t\t//-->\n\t\t\t</script>\";\n\t\t}", "function Page_Terminate($url = \"\") {\n\t\tglobal $conn;\n\n\t\t// Page unload event, used in current page\n\t\t$this->Page_Unload();\n\n\t\t// Global page unloaded event (in userfn*.php)\n\t\tPage_Unloaded();\n\n\t\t // Close Connection\n\t\t$conn->Close();\n\n\t\t// Go to URL if specified\n\t\tif ($url <> \"\") {\n\t\t\tob_end_clean();\n\t\t\theader(\"Location: $url\");\n\t\t}\n\t\texit();\n\t}", "function Page_Terminate($url = \"\") {\n\t\tglobal $conn;\n\n\t\t// Page unload event, used in current page\n\t\t$this->Page_Unload();\n\n\t\t// Global page unloaded event (in userfn*.php)\n\t\tPage_Unloaded();\n\n\t\t // Close Connection\n\t\t$conn->Close();\n\n\t\t// Go to URL if specified\n\t\tif ($url <> \"\") {\n\t\t\tob_end_clean();\n\t\t\theader(\"Location: $url\");\n\t\t}\n\t\texit();\n\t}", "function Page_Terminate($url = \"\") {\n\t\tglobal $conn;\n\n\t\t// Page unload event, used in current page\n\t\t$this->Page_Unload();\n\n\t\t// Global page unloaded event (in userfn*.php)\n\t\tPage_Unloaded();\n\n\t\t // Close Connection\n\t\t$conn->Close();\n\n\t\t// Go to URL if specified\n\t\tif ($url <> \"\") {\n\t\t\tob_end_clean();\n\t\t\theader(\"Location: $url\");\n\t\t}\n\t\texit();\n\t}" ]
[ "0.61204904", "0.6079349", "0.59285057", "0.5921937", "0.5804471", "0.5761907", "0.5722347", "0.5703351", "0.5698374", "0.56767017", "0.5660051", "0.56397134", "0.5630851", "0.56251687", "0.5608542", "0.5595598", "0.5593944", "0.55799645", "0.5573666", "0.55660266", "0.5560193", "0.55429524", "0.5540155", "0.5531221", "0.5527619", "0.5513861", "0.5493431", "0.54898196", "0.5474417", "0.54467195", "0.54357404", "0.5434908", "0.54345787", "0.5422205", "0.54111516", "0.5403942", "0.53992724", "0.5394395", "0.5374726", "0.53557026", "0.5347613", "0.53465337", "0.53424317", "0.5336151", "0.5330154", "0.5312373", "0.53033704", "0.5300659", "0.5285236", "0.5273655", "0.5269868", "0.5269285", "0.52666175", "0.5264462", "0.5253528", "0.5243138", "0.52427644", "0.5225199", "0.52213955", "0.5220827", "0.5213445", "0.52121216", "0.5205634", "0.5201281", "0.5201281", "0.5183417", "0.51799434", "0.51728946", "0.5164069", "0.5162778", "0.5155012", "0.51505065", "0.5137701", "0.51373917", "0.51366794", "0.5131361", "0.51307464", "0.5129192", "0.5128289", "0.5112116", "0.5111259", "0.51051277", "0.510306", "0.51016974", "0.509638", "0.5094518", "0.5093035", "0.5090126", "0.5089649", "0.5089266", "0.5089266", "0.50784683", "0.5077388", "0.5076597", "0.5071911", "0.5067794", "0.506652", "0.5064566", "0.5061532", "0.5061532", "0.5061532" ]
0.0
-1
Returns the multidimensional representation of the database storage of objects with parents and children.
function inflate($list){ $r = array(); $flat = array(); foreach($list as $val) { $flat[$val['id']] = $val; } foreach($list as $val) { if(!isset($flat[$val['parent']])) { $r[$val['id']] = &$flat[$val['id']]; } else { if(!isset($flat[$val['parent']]['children'])) $flat[$val['parent']]['children'] = array(); $flat[$val['parent']]['children'][] = &$flat[$val['id']]; } } return $r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BuildTree($items)\r\n\t{\r\n\t\tif (!empty($items))\r\n\t\t{\r\n\t\t\t# Columns\r\n\t\t\t# * Gather all columns required for display and relation.\r\n\t\t\t# Children\r\n\t\t\t# * Map child names to child index.\r\n\r\n\t\t\t$cols[$this->ds->table] = array($this->ds->id => 1);\r\n\t\t\tif (!empty($this->ds->DisplayColumns))\r\n\t\t\tforeach (array_keys($this->ds->DisplayColumns) as $col)\r\n\t\t\t\t$cols[$this->ds->table][$col] = $this->ds->id == $col;\r\n\r\n\t\t\tif (!empty($this->ds->children))\r\n\t\t\tforeach ($this->ds->children as $ix => $child)\r\n\t\t\t{\r\n\t\t\t\t$children[$child->ds->table] = $ix;\r\n\t\t\t\t$cols[$child->ds->table][$child->parent_key] = 1;\r\n\t\t\t\t$cols[$child->ds->table][$child->child_key] = 0;\r\n\t\t\t\tif (!empty($child->ds->DisplayColumns))\r\n\t\t\t\tforeach (array_keys($child->ds->DisplayColumns) as $col)\r\n\t\t\t\t{\r\n\t\t\t\t\t$cols[$child->ds->table][$col] = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t# Flats\r\n\t\t\t# * Convert each item into separated TreeNodes\r\n\t\t\t# * Associate all indexes by table, then id\r\n\r\n\t\t\t$flats = array();\r\n\r\n\t\t\t# Iterate all the resulting database rows.\r\n\t\t\tforeach ($items as $ix => $item)\r\n\t\t\t{\r\n\r\n\t\t\t\t# Iterate the columns that were created in step 1.\r\n\t\t\t\tforeach ($cols as $table => $columns)\r\n\t\t\t\t{\r\n\t\t\t\t\t# This will store all the associated data in the treenode\r\n\t\t\t\t\t# for the editor to reference while processing the tree.\r\n\t\t\t\t\t$data = array();\r\n\t\t\t\t\t$skip = false;\r\n\r\n\t\t\t\t\t# Now we're iterating the display columns.\r\n\t\t\t\t\tforeach ($columns as $column => $id)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t# This column is not associated with a database row.\r\n\t\t\t\t\t\tif (is_numeric($column)) continue;\r\n\r\n\t\t\t\t\t\t# Table names are included to avoid ambiguity.\r\n\t\t\t\t\t\t$colname = $table.'_'.$column;\r\n\r\n\t\t\t\t\t\t# ID would be specified if this is specified as a keyed\r\n\t\t\t\t\t\t# value.\r\n\t\t\t\t\t\tif ($id)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (empty($item[$colname]))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$skip = true;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$idcol = $colname;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$data[$this->ds->StripTable($colname)] = $item[$this->ds->StripTable($colname)];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!$skip)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$tn = new TreeNode($data);\r\n\t\t\t\t\t\t$tn->id = $item[$idcol];\r\n\t\t\t\t\t\t$flats[$table][$item[$idcol]] = $tn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t# Tree\r\n\t\t\t# * Construct tree out of all items and children.\r\n\r\n\t\t\t$tree = new TreeNode('Root');\r\n\r\n\t\t\tforeach ($flats as $table => $items)\r\n\t\t\t{\r\n\t\t\t\tforeach ($items as $ix => $node)\r\n\t\t\t\t{\r\n\t\t\t\t\t$child_id = isset($children[$table]) ? $children[$table] : null;\r\n\r\n\t\t\t\t\tif (isset($children[$table]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$ckeycol = $this->ds->children[$child_id]->child_key;\r\n\t\t\t\t\t\t$pid = $node->data[\"{$table}_{$ckeycol}\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse $pid = 0;\r\n\r\n\t\t\t\t\t$node->data['_child'] = $child_id;\r\n\r\n\t\t\t\t\tif ($pid != 0)\r\n\t\t\t\t\t\t$flats[$this->ds->table][$pid]->children[] = $node;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$tree->children[] = $node;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t# Put child table children above related children, helps to\r\n\t\t\t# understand the display.\r\n\t\t\tif (count($this->ds->children) > 0) $this->FixTree($tree);\r\n\t\t\treturn $tree;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public function structure() {\n $list = $this->newQuery()->where('parent_id', 0)->orderBy('order_id', 'asc')->get();\n $list->transform(function (PageCategory $category) {\n $children = $category->newQuery()->where('parent_id', $category->getAttribute('id'))->orderBy('order_id', 'asc')->get();\n $children->transform(function (PageCategory $category) {\n $children = $category->newQuery()->where('parent_id', $category->getAttribute('id'))->orderBy('order_id', 'asc')->get();\n $category->setAttribute('children', $children);\n\n return $category;\n });\n $category->setAttribute('children', $children);\n\n return $category;\n });\n\n return $list->toArray();\n }", "public function tree() {\n return $this->children()->with(['user', 'children.user', 'children.children.user', 'children.children.children.user', 'children.children.children.children.user'])->get();\n }", "function _make_relation($parents)\n {\n if(count($parents)<1)\n return array();\n $children = array();\n // first pass - collect children\n $field_parent_id =$this->field_parent_id ;\n foreach ($parents as $t)\n {\n $pt = $t->$field_parent_id ;\n $list = @$children[$pt] ? $children[$pt] : array();\n array_push($list, $t);\n $children[$pt] = $list;\n\n }\n //echo \"<br>---list Child----<br>\";\n //print_r($children);\n return $children;\n }", "public function objects() {\n \t// return call_user_func_array($this->belongsToMany('Object')->withPivot, static::$pivotColumns);\n return $this->belongsToMany('Object')\n ->withPivot('subdivision', 'time', 'place', 'form');\n }", "public function getTree() {\n\n $servers = Hash::extract($this->find('all', array(\n 'fields' => array(\n 'server_id', 'name', 'short_name', 'parent_id'\n )\n )), '{n}.Server');\n\n $tree = array();\n\n foreach ($servers as $server) {\n\n $parent_id = $server['parent_id'];\n\n if (empty($parent_id)) {\n\n $server_id = $server['server_id'];\n\n if (empty($tree[$server_id])) {\n $tree[$server_id] = $server;\n } else {\n $tree[$server_id] = array_merge($tree[$server_id], $server);\n }\n\n } else {\n\n if (empty($tree[$parent_id])) {\n $tree[$parent_id] = array(\n 'children' => array($server)\n );\n } else if (empty($tree[$parent_id]['children'])) {\n $tree[$parent_id]['children'] = array($server);\n } else {\n $tree[$parent_id]['children'][] = $server;\n }\n }\n }\n\n return $tree;\n }", "private function dataBaseRepresentation() {\n\t\t$array['recipe'] \t\t= $this->recipeId;\n\t\t$array['name'] \t\t\t= $this->name;\n\t\t$array['description'] \t= $this->description;\n\t\t$array['url'] \t\t\t= $this->url;\n\t\treturn $array;\n\t}", "public function getChilds();", "public function databaseObjects() {\n \t$out = '';\n \t$objects = Application::availableObjects();\n \tforeach($objects as $object) {\n \t\t$out .= \"[\\\"\".$object.\"\\\"], \";\n \t}\n \treturn substr($out, 0, -2);\n }", "public function toArray()\r\n {\r\n $data = array(\r\n \"id\" => $this->id,\r\n \"name\" => $this->name,\r\n \"uname\" => $this->uname,\r\n \"is_heiarch\" => $this->isHeiarch,\r\n \"is_system\" => $this->isSystem,\r\n \"parent_id\" => $this->parentId,\r\n \"color\" => $this->color,\r\n \"sort_order\" => $this->sortOrder,\r\n \"commit_id\" => $this->commitId,\r\n \"filter_fields\" => $this->filterFields,\r\n \"children\" => array(),\r\n );\r\n \r\n foreach ($this->children as $child)\r\n {\r\n $data['children'][] = $child->toArray();\r\n }\r\n \r\n return $data;\r\n }", "public function getContent(){\n $table = new Application_Model_Table_Content();\n $content = array();\n \n \n $rowset = $table->fetchAll(\"parent = {$this->id}\");\n foreach($rowset as $row){\n $content[] = new Application_Model_Content($row);\n }\n return $content;\n }", "public function getChildObjects(){\n\t\tset_time_limit(0);\n\t\tif(!isset($_REQUEST['column'])) $_REQUEST['column'] = null;\n\t\t$Column = isset($_REQUEST['column']) ? explode(\",\",$_REQUEST['column']) : null;\n\t\tif(!isset($_REQUEST['value'])) $_REQUEST['value'] = null;\n\t\t$Value = isset($_REQUEST['value']) ? explode(\",\",$_REQUEST['value']) : null;\n\t\t$Object = $this->urlParams['ID'];\n\t\tif(!isset($_REQUEST['orderBy'])) $_REQUEST['orderBy'] = null;\n\t\tif(!isset($_REQUEST['orderByDirection'])) $_REQUEST['orderByDirection'] = 'DESC';\n\t\t$orderByString = \"\";\n\t\t// order by stuff...\n\t\t$dbFields = Object::create($Object)->db();\n\t\tif ($_REQUEST['orderBy']){\n\t\t\tforeach (explode(',',$_REQUEST['orderBy']) as $oc){\n\t\t\t\t$OrderByTemp = \"\";\n\t\t\t\tif(count(explode('.',$oc))>1){\n\t\t\t\t\t$OrderByTmpArr = explode('.',$oc);\n\t\t\t\t\t$tmpObj = Object::create($Object);\n\t\t\t\t\t$has_one = $tmpObj->has_one();\n\t\t\t\t\t$subObj = '';\n\t\t\t\t\tforeach($has_one as $key=>$value) {\n\t\t\t\t\t\tif($key == $OrderByTmpArr[0]) {\n\t\t\t\t\t\t\t$subObj = ($value == \"Image\") ? \"File\" : $value;\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\t$OrderByTmp = $subObj ? \"{$subObj}.{$OrderByTmpArr[1]}\" : \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$OrderByTmp = (in_array($oc, $dbFields)) ? \"{$Object}.{$oc}\" : \"\";\n\t\t\t\t}\t\n\t\t\t\t$orderByString .= $OrderByTemp ? \"{$OrderByTmp} {$_REQUEST['orderByDirection']}, \" : \"\";\n\t\t\t}\n\t\t\t$orderByString = $orderByString ? substr($orderByString, 0, -2) : \"\";\n\t\t}\n\t\t$OrderBy = $_REQUEST['orderBy'] ? \"{$orderByString}\" : \"{$Object}.ID DESC\";\n\t\t$Query = '';\n\t\tif($Column != null && $Value != null) {\n\t\t\t$i = 0;\n\t\t\tforeach ($Column as $col) {\n\t\t\t\t$Query .= \"{$col}='{$Value[$i]}' AND \";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$Query = substr($Query, 0, -5);\n\t\t}\n\t\tif($results = DataObject::get($Object, $Query, $OrderBy)) {\n\t\t\t$f = new JSONDataFormatter(); \n\t\t\t$json = $f->convertDataObjectSet($results);\n\t\t\treturn $json;\n\t\t} else {\n\t\t\treturn '{\"results\": 0, \"rows\":[], \"query\":\"'.$Query.'\"}';\n\t\t}\n\t}", "private function constructHierarchy() {\n\t\t//////////////////////////////////////////////////\n\t\t// Construct child-parent linkage for MonadObjects\n\t\t//////////////////////////////////////////////////\n \n $dummyidd = 10000000;\n\n $number_sets = count($this->sentenceSets);\n\n\t\tfor ($msetIndex=0; $msetIndex<$number_sets; ++$msetIndex) {\n $moarr = &$this->monadObjects[$msetIndex]; // Cached here;\n\t\t\tfor ($i=1; $i<$this->maxLevels; ++$i) {\n\t\t\t\t// Find constituent MonadObjects\n \n\t\t\t\tforeach ($moarr[$i] as $parentMo) { // Loop through monads at level i\n\t\t\t\t\tforeach ($moarr[$i-1] as $childMo) { // Loop through mondads at child level\n\t\t\t\t\t\tif ($childMo->contained_in($parentMo))\n\t\t\t\t\t\t\t$parentMo->add_child($childMo);\n\t\t\t\t\t}\n\t\t\t\t}\n \n\t\t\t\t// Find MonadObjects without parents\n\t\t\t\tforeach ($moarr[$i-1] as $childMo) {\n\t\t\t\t\tif ($childMo->get_parent()===null) {\n\t\t\t\t\t\t$matobj = new OlMatchedObject($dummyidd++, 'dummy');\n\t\t\t\t\t\t$matobj->monadset = $childMo->mo->monadset;\n \n\t\t\t\t\t\t$mmo = new MultipleMonadObject($matobj);\n\t\t\t\t\t\t$moarr[$i][] = $mmo;\n\t\t\t\t\t\t$mmo->add_child($childMo);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n// // Print hierarchy\n// for ($i=1; $i<$this->maxLevels; ++$i) {\n// foreach ($moarr[$i] as $parentMo) {\n// echo \"<pre>parent = \",$parentMo->get_id_d(),\" : \";\n// foreach ($parentMo->children_idds as $cid)\n// echo $cid,\" \";\n// echo \"</pre>\";\n// }\n// }\n }\n }", "private function dataBaseRepresentation() {\n\t\t$array['website'] = $this->website;\n\t\t$array['name'] = $this->name;\n\t\t$array['country'] = $this->country;\n\t\treturn $array;\n\t}", "public function getDataTree() {\n $array = [\n 'id' => $this->id,\n 'name' => $this->name,\n 'type' => $this->type,\n 'data' => ['href' => route('sensors.edit', $this->id)],\n 'children' => []\n ];\n\n foreach( $this->children as $child ) {\n $array['children'][] = $child->getDataTree();\n }\n\n return $array;\n }", "public function relations()\n {\n $hasOne = $this->hasOne();\n $hasMany = $this->hasMany();\n $belongsTo = $this->belongsTo();\n $objects = new stdClass();\n\n if ($hasOne && !empty($hasOne)) {\n foreach ($hasOne as $id => $value) {\n\n $objects->$id = Relationships::hasOne(isset($value[0]) ? $value[0] : null, isset($value[1]) ? $value[1] : null, isset($value[2]) ? $value[2] : array());\n }\n }\n if ($hasMany && !empty($hasMany)) {\n foreach ($hasMany as $id => $value) {\n $objects->$id = Relationships::hasMany(isset($value[0]) ? $value[0] : null, isset($value[1]) ? $value[1] : null, isset($value[2]) ? $value[2] : array());\n }\n\n }\n if ($belongsTo && !empty($belongsTo)) {\n foreach ($belongsTo as $id => $value) {\n $objects->$id = Relationships::belongsTo(isset($value[0]) ? $value[0] : null, isset($value[1]) ? $value[1] : null, isset($value[2]) ? $value[2] : array());\n }\n }\n return $objects;\n }", "public function findAll()\n {\n $sql = \"SELECT * FROM parent\";\n $res = $this->getDb()->fetchAll($sql);\n\n $parents = array();\n foreach($res as $row)\n {\n $id_parent = $row['id_parent'];\n $parents[$id_parent] = $this->buildDomainObject($row);\n }\n\n return $parents;\n }", "public function roots()\n {\n $sql = \"SELECT * FROM $this->_table_name\n WHERE \n $this->left_column = 1\n ORDER BY \". $this->_sorting[0] .\" \". $this->_sorting[1] .\"\n \";\n $result = $this->_db->query($sql);\n return $this->factory_set($result);\n }", "public function createHierarchy(){\n\t\tmysqli_query($this->db, \"TRUNCATE TABLE hierarchy\");\n\t\t\n\t\t$insert_sql = \"INSERT INTO hierarchy VALUES\";\n\t\tforeach ($this->structure as $key => $value) {\n\t\t\t$position = $value['number'] + 1;\n\t\t\t$rows[] = \"('', '{$key}', '{$position}')\";\n\t\t}\n\t\t$insert_sql = $insert_sql.implode(\",\", $rows);\n\t\tmysqli_query($this->db, $insert_sql);\n\t}", "public function saveMultiObject() {\n\t\t$Object = $this->urlParams['ID'];\n\t\t$data = $_REQUEST;\n\t\t$MainObject = array();\n\t\t$ChildObjects = array();\n\t\tforeach ($data as $key=>$value) {\n\t\t\t$hasOnes = explode('_', $key);\n\t\t\tif(count($hasOnes) == 4) {\n\t\t\t\t//Has many objects from the main object, a mixed collection of values, and has ones\n\t\t\t\t//Example child object has many, Object Customer 0.customers.address.postcode = value\n\t\t\t\t// It is set up in such as way to be consumed by the processHasOne function. \n\t\t\t\t$ChildObjects[$hasOnes[0]][$hasOnes[1]][$hasOnes[2].'_'.$hasOnes[3]] = $value;\n\t\t\t} elseif(count($hasOnes) == 3) {\n\t\t\t\t//Has One for child objects\n\t\t\t\t//Example of a child object has one would be Object Customer customer.address.postcode = value\n\t\t\t\t$ChildObjects[$hasOnes[0]][$hasOnes[1]][$hasOnes[2]] = $value;\n\t\t\t} elseif(count($hasOnes) == 2) {\n\t\t\t\t//Has one main object\n\t\t\t\t//Could also be an ID on the has one.\n\t\t\t\t//Example of a 2 depth object would be Object Customer status.statusName = value\n\t\t\t\t$MainObject[$key] = $value;\n\t\t\t} elseif(count($hasOnes) == 1) {\n\t\t\t\t//Single value -- main object\n\t\t\t\t//This could also be the ID of a has one.\n\t\t\t\t//Example of a single depth object would be Object Customer forename = value\n\t\t\t\t$MainObject[$key] = $value;\n\t\t\t}\n\t\t}\n\t\t//Process the top level object and it's has ones.\n\t\tif($DataObject = $this->processObjHasOne($Object, $MainObject)) {\n\t\t\t$DataObject->write();\n\t\t\t$has_many = $DataObject->has_many();\n\t\t\t//Loop through the rows for the has manys\n\t\t\tforeach($ChildObjects as $index=>$item) {\n\t\t\t\t//Get each of the has manys convert to a has one\n\t\t\t\tforeach($item as $key=>$value) {\n\t\t\t\t\t//Process each has one.\n\t\t\t\t\tif(isset($has_many[$key])) {\n\t\t\t\t\t\t$manyObject = $this->processObjHasOne($has_many[$key], $value);\n\t\t\t\t\t\t//Get the has one relations for the many object\n\t\t\t\t\t\t$has_one = $manyObject->has_one();\n\t\t\t\t\t\t$manyID = \"\";\n\t\t\t\t\t\t//Loop through the has_one relations\n\t\t\t\t\t\tforeach($has_one as $hKey=>$hValue) {\n\t\t\t\t\t\t\t//If the many relation object matches the has one object assume that is the\n\t\t\t\t\t\t\t//required relation object and set the manyID value.\n\t\t\t\t\t\t\tif($hValue == $DataObject->ClassName) {\n\t\t\t\t\t\t\t\t$manyID = $hKey.'ID';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Assign the manyID and save the object.\n\t\t\t\t\t\t$manyObject->$manyID = $DataObject->ID;\n\t\t\t\t\t\t$manyObject->write();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$RtnID = $DataObject->write();\n\t\t\t$f = new JSONDataFormatter();\n\t\t\t$json = $f->convertDataObject($DataObject);\n\t\t\techo '{\"success\": true, \"data\":{\"ID\":\"'.$RtnID.'\",\"rows\":[]}}'; //'.$json.'\n\t\t} else{\n \t\techo '{\"success\": false, \"data\":{}}';\n\t\t}\n\t}", "public static function createStructure():array\n {\n\n\n foreach (self::$categories as $parent){\n\n if (!array_key_exists($parent['parent_id'], self::$structure)){\n\n foreach (self::$categories as $row){\n if ($parent['parent_id'] == $row['parent_id']){\n self::$structure[$parent['parent_id']][] = $row;\n }\n }\n\n }\n }\n return self::$structure;\n\n\n }", "function getChildren() {\n foreach ( $this->parents as $parent ) {\n $this->children[$parent->name()]=array();\n foreach ( $this->items as $item ) {\n if ( $item->parent_id() == $parent->id() ) {\n $this->children[$parent->name()][]=$item;\n }\n }\n }\n }", "public function ddl_parentdetails()\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$search = \"SELECT DISTINCT parent_id, label_id, label\r\n\t\t\t\t\t\t\tFROM parents\";\r\n\t\t\t\t$resultq = mysqli_query($link, $search);\r\n\t\t\t\t$sow = array();\r\n\t\t\t\t$sow_arr = array();\r\n\t\t\t\twhile ($row = mysqli_fetch_row($resultq)) {\t\r\n\t\t\t\t\t$sow['parent_id'] =$row[0];\r\n\t\t\t\t\t$sow['label_id'] =$row[1];\r\n\t\t\t\t\t$sow['label'] =$row[2];\r\n\t\t\t\t\t$fsow_arr[] = $sow;\r\n\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn $fsow_arr;\r\n\t\t}", "public function childrenElements() {\n\t\treturn $this->hasMany('\\App\\Hierarchy', 'parent_id', 'id');\n\t}", "public function getData() {\n $data = $this->db->getAll('tree');\n\n return $this->formTree($data);\n }", "protected function getChildEntities() {\n\n\t\treturn array();\n\t}", "protected function getTree()\n {\n $tree = [];\n // copy of '$this->data'.\n $data = $this->data;\n// return Helper::debug($data);\n// die();\n\n foreach($data as $id => &$node) {\n if( $node['parent'] == 0 ) {\n $tree[$id] = &$node;\n } else {\n $data[$node['parent']]['childs'][$id] = &$node;\n }\n }\n return $tree;\n }", "function get_categories_tree() {\n\t\tglobal $db;\n\t\t$sql = \" SELECT id, name, parent_id AS parent_id \n\t\t\t\tFROM \" . $this->table_category;\n\t\t$db->query ( $sql );\n\t\t$categories = $db->getObjectList ();\n\t\t\n\t\t$tree = FSFactory::getClass ( 'tree', 'tree/' );\n\t\t$rs = $tree->indentRows ( $categories, 1 );\n\t\treturn $rs;\n\t}", "public function retrieveCompoundObjectInfo() {\n $prepare = $this->database->prepare(\"\n SELECT pointer\n FROM manuscripts\n WHERE collection = :collection\n AND parent_object = :parent_object\n \");\n\n $prepare->execute(array(\n \":collection\" => $this->collection,\n \":parent_object\" => $this->parent\n ));\n\n return $prepare;\n }", "public function getTreeRelations()\n {\n $out = new stdClass();\n $out->parent = null;\n $out->children = null;\n\n foreach($this->_map as $bind => $config)\n {\n if(!is_array($config) || !isset($config[self::MAP_TYPE]) || !in_array($config[self::MAP_TYPE],\n self::$_relationTypes))\n {\n continue;\n }\n if($config[self::MAP_MAPPER] == get_class($this) && $config[self::MAP_TYPE] == self::RELATION_CHILDREN)\n {\n $out->children = array(\n 'alias' => $bind,\n self::MAP_KEY => $config[self::MAP_KEY],\n self::MAP_FOREIGN_KEY => $config[self::MAP_FOREIGN_KEY]\n );\n }\n elseif($config[self::MAP_MAPPER] == get_class($this) && $config[self::MAP_TYPE] == self::RELATION_PARENT)\n {\n $out->parent = array(\n 'alias' => $bind,\n self::MAP_KEY => $config[self::MAP_KEY],\n self::MAP_FOREIGN_KEY => $config[self::MAP_FOREIGN_KEY]\n );\n }\n }\n return $out;\n }", "function get_categories_tree()\n\t\t{\n\t\t\t$where = '';\n\t\t\t$is_accessory = FSInput::get('is_accessory',0,'int');\n\t\t\tif($is_accessory){\n\t\t\t\t$where .= ' AND is_accessories = 0 ';\n\t\t\t} else {\n\t\t\t\t$where .= ' AND is_accessories = 1 ';\n\t\t\t}\n\t\t\t\n\t\t\tglobal $db ;\n\t\t\t$sql = \" SELECT id, name, parent_id AS parentid \n\t\t\t\tFROM fs_products_categories \n\t\t\t\tWHERE 1 = 1\n\t\t\t\t\".$where;\n\t\t\t// $db->query($sql);\n\t\t\t$categories = $db->getObjectList($sql);\n\t\t\t\n\t\t\t$tree = FSFactory::getClass('tree','tree/');\n\t\t\t$rs = $tree -> indentRows($categories,1); \n\t\t\treturn $rs;\n\t\t}", "public static function __structure()\n\t{\n\t\treturn array(\n\t\t\t'title'\t\t=>\t'VARCHAR(255)',\n\t\t\t'content'\t=>\t'TEXT',\n\t\t\t'author'\t=>\t'Authors',\t//Instead of SQL type, we use the related class name\n\t\t);\n\t}", "function list_to_tree($category = array(),\n\t\t$idField = 'id',$parentField='parent_id'){\n\tif(!is_array($category)) exit(\"配列ではありません\");\n\n\t$index = array();\n\t$tree = array();\n\n\tforeach($category as $value){\n\t\t$id = $value[$idField];\n\t\t$parent = $value[$parentField];\n\n\t\tif(isset($index[$id])){\n\t\t\t$value['child'] = $index[$id]['child'];\n\t\t\t$index[$id] = $value;\n\n\t\t} else {\n\t\t\t$index[$id] = $value;\n\t\t}\n\n\t\tif($parent == 0){\n\t\t\t$tree[] =& $index[$id];\n\n\t\t} else {\n\t\t\t$index[$parent]['child'][] =& $index[$id];\n\t\t}\n\n\n\t}\n\treturn $tree;\n}", "public function printData() {\n $parent = new Helper($this->parent, $this->collection);\n $return = array(\n \"pages\" => $this->pages,\n \"title\" => $parent->retrieveTitle(),\n \"images\" => array()\n );\n\n // Run through each pointer.\n for ($i = 0; $i < count($this->compound); $i++) {\n $item = $this->compound[$i];\n\n // If we're on the same item, do not create a new class.\n if ($item[\"pointer\"] === $this->pointer) {\n $return[\"images\"][$i] = array(\n \"width\" => $this->getImageWidth(),\n \"height\" => $this->getImageHeight()\n );\n\n continue;\n }\n\n // Otherwise, create a temp class.\n $helper = new Helper($item[\"pointer\"], $this->collection);\n\n $return[\"images\"][$i] = array(\n \"width\" => $helper->getImageWidth(),\n \"height\" => $helper->getImageHeight()\n );\n }\n\n return $return;\n }", "function getChilds($id = NULL);", "public function run()\n {\n DB::table('children')->delete();\n\n $children = array(\n ['id' => 1, 'lastname' => 'Morocho', 'firstname' => 'Nathan','slug' => 'NathanMorocho', 'dob' => new DateTime('05/04/2012'), 'childid' => '20741', 'servicestartdate' => new DateTime('05/04/2014'), 'serviceenddate' => new DateTime('05/04/2016'), 'servicecoordinatorname' => 'Kathleen Hinistroza', 'parentcaregivername' => 'Sonia Meza', 'address' => '735 W 172nd St, New York, NY','zipcode' => '10032', 'phone' => '9173456789', 'frequency' => '2x30', 'document' => '','created_at' => new DateTime, 'updated_at' => new DateTime],\n ['id' => 2, 'lastname' => 'Diaz', 'firstname' => 'Justin','slug' => 'JustinDiaz', 'dob' => new DateTime('05/04/2012'), 'childid' => '20741', 'servicestartdate' => new DateTime('05/04/2014'), 'serviceenddate' => new DateTime('05/04/2016'), 'servicecoordinatorname' => 'Kathleen Hinistroza', 'parentcaregivername' => 'Teresa Diaz', 'address' => '4395 Broadway APT 1D, New York, NY 10040','zipcode' => '10032', 'phone' => '9171234567', 'frequency' => '2x30', 'document' => '','created_at' => new DateTime, 'updated_at' => new DateTime],\n ['id' => 3, 'lastname' => 'Rivera', 'firstname' => 'Isabella','slug' => 'IsabellaRivera', 'dob' => new DateTime('01/04/2012'), 'childid' => '20741', 'servicestartdate' => new DateTime('01/04/2014'), 'serviceenddate' => new DateTime('01/04/2016'), 'servicecoordinatorname' => 'Dileydy Hiches', 'parentcaregivername' => 'Sandra Castro', 'address' => '790 Riverside Dr APT 1F, New York, NY','zipcode' => '10032', 'phone' => '9173456789', 'frequency' => '2x30', 'document' => '','created_at' => new DateTime, 'updated_at' => new DateTime],\n );\n\n // Uncomment the below to run the seeder\n DB::table('children')->insert($children);\n }", "private function _getTree()\r\n {\r\n $items = $this->setArray($this->getItems());\r\n $tree = $this->_buildTree($items);\r\n return $tree;\r\n }", "private function setParentChildrenClass() {\n $tmp_schemedata = $this->schemedata;\n \n // replace parents with primary key.\n foreach($this->schemedata as $index => $class) {\n $parents = array();\n $see = array();\n foreach ($class['parents'] as $parent=>$cols) {\n foreach($tmp_schemedata as $tmp_class) {\n if ($tmp_class['table'] == $parent) {\n $tmp = $tmp_class['pkFields'];\n $tmp_cols = $cols;\n $tmp2 = array();\n foreach ($tmp as $key=>$val) {\n $key = array_shift($tmp_cols);\n $tmp2[$key] = $val;\n }\n $parents[$tmp_class['name']] = $tmp2;\n $see[] = $tmp_class['name'];\n }\n }\n }\n $this->schemedata[$index]['parents'] = $parents;\n $this->schemedata[$index]['see'] = $see;\n }\n\n // children\n foreach($this->schemedata as $index => $class) {\n foreach ($class['parents'] as $parent=>$cols) {\n foreach($tmp_schemedata as $tmp_class) {\n if ($tmp_class['table'] == $this->schemedata[$parent]['table']) {\n if ($class['type'] != 'TO' AND $class['type'] != 'TS' AND $class['type'] != 'TB') {\n $tmp = $class['parents']; // children's parent def\n $tmp2 = array();\n foreach ($tmp as $key=>$val) {\n if($key == $tmp_class['name']) {\n $tmp2 = $val;\n }\n }\n if($class['name']) {\n $this->schemedata[$tmp_class['name']]['children'][$class['name']] = $tmp2;\n $this->schemedata[$tmp_class['name']]['see'][] = $class['name'];\n } else {\n $this->schemedata[$tmp_class['name']]['children'][$index] = $tmp2;\n }\n }\n }\n }\n }\n }\n\n // relationships\n foreach($this->schemedata as $class) {\n if ($class['type'] == 'TO' OR $class['type'] == 'TS' OR $class['type'] == 'TB') {\n foreach ($class['parents'] as $parent=>$pkFields) {\n if(!isset($this->schemedata[$parent]['relationships'])) {\n $this->schemedata[$parent]['relationships'] = array();\n }\n // add parent to another parent list getter\n foreach ($class['parents'] as $p=>$fs) {\n if ($parent != $p) {\n $type = 'List';\n $mname = '';\n foreach($fs as $k => $v) {\n $name = $k;\n }\n foreach($class['params'] as $param) {\n if($name == $param['name']) {\n $type = ($param['pair']=='N')?'List':'Class';\n break;\n }\n }\n\n $this->schemedata[$parent]['relationships'][$p]= array(\n 'table' => $class['table'],\n 'myFields' => $pkFields,\n 'fields' => $fs,\n 'type' => $type\n );\n }\n }\n }\n }\n }\n\n // rewrite relation key for parents, children and relations\n foreach($this->schemedata as $key => $class) {\n // parent\n foreach($class['parents'] as $k1 => $values) {\n foreach($values as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$k2) {\n unset($this->schemedata[$key]['parents'][$k1][$k2]);\n $this->schemedata[$key]['parents'][$k1][$param['mname']] = $value;\n break;\n }\n }\n }\n }\n // children\n foreach($class['children'] as $k1 => $values) {\n foreach($values as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['children'][$k1][$k2] = $param['mname'];\n break;\n }\n }\n }\n }\n // relations\n if(isset($class['relationships'])) {\n foreach($class['relationships'] as $k1 => $values) {\n foreach($values['myFields'] as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['relationships'][$k1]['myFields'][$k2] = $param['mname'];\n break;\n }\n }\n }\n foreach($values['fields'] as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['relationships'][$k1]['fields'][$k2] = $param['mname'];\n break;\n }\n }\n }\n }\n }\n }\n }", "function populate()\n\t{\n \t$this->create(array('title' => 'Harry Potter'));\n \t$this->save();\n \n $parent_id = $this->id;\n \n $this->create(array('parent_id' => $parent_id, 'title' => 'Ron Weasley'));\n $this->save();\n \n $this->create(array('parent_id' => $parent_id, 'title' => 'Hermione Granger'));\n $this->save();\n \n $this->create(array('parent_id' => $parent_id, 'title' => 'Adam Royle'));\n $this->save();\n \n $this->create(array('parent_id' => $this->id, 'title' => 'Lord Voldemort'));\n $this->save();\n \n \t$this->create(array('title' => 'Albus Dumbledore'));\n \t$this->save();\n \n $parent_id = $this->id;\n \n $this->create(array('parent_id' => $parent_id, 'title' => 'Professor McGonagall'));\n $this->save();\n \n $this->create(array('parent_id' => $this->id, 'title' => 'Professor Flitwick'));\n $this->save();\n \n $this->create(array('parent_id' => $parent_id, 'title' => 'Severus Snape'));\n $this->save();\n \n $this->create(array('parent_id' => $parent_id, 'title' => 'Hagrid'));\n $this->save();\t\n\t}", "public function getChildren(array $columns = ['*']);", "public function children() {\n\n if(isset($this->cache['children'])) return $this->cache['children'];\n\n $this->cache['children'] = new Children($this);\n\n $inventory = $this->inventory();\n\n // with page models\n if(!empty(static::$models)) {\n foreach($inventory['children'] as $dirname) {\n $child = new Page($this, $dirname);\n // let's create a model if one is defined\n if(isset(static::$models[$child->intendedTemplate()])) {\n $model = static::$models[$child->intendedTemplate()];\n $child = new $model($this, $dirname);\n }\n $this->cache['children']->data[$child->id()] = $child;\n }\n // without page models\n } else {\n foreach($inventory['children'] as $dirname) {\n $child = new Page($this, $dirname);\n $this->cache['children']->data[$child->id()] = $child;\n }\n }\n\n return $this->cache['children'];\n\n }", "private function GetAllNodes(){\n $tree = array();\n try {\n $db = new SQLite3('mysqlitedb.db', SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE);\n $result = $db->query('SELECT * FROM tree WHERE DELETE_AT IS NULL AND PARENT_ID=0');\n if (!is_bool($result)) {\n while ($row = $result->fetchArray()) {\n $nodes = $this->GetNodesByParentId($db, $row[\"ID\"]);\n $tree[] = array(\"ID\" => $row[\"ID\"], \"NAME\" => $row[\"NAME\"], \"NODES\" => $nodes);\n }\n }\n $db->close();\n } catch (Exception $ex) {\n echo \"Exception in Tree->GetAllNodes: \" . $ex->getMessage() . \"<br/>\";\n $db->close();\n }\n return $tree;\n }", "function prepareData(){\n $this->ref = array();\n foreach($this->getIterator() as $junk=>$item){\n // current values\n $id = $item[$this->id_field];\n \n // save item\n $this->items[$id] = $item;\n \n // save relation\n if(isset($item[$this->parent_id_field])) {\n $this->ref[$item[$this->parent_id_field]][] = $id;\n } else {\n $this->ref[undefined][] = $id;\n }\n }\n }", "public function get_children();", "function retrieveHierarchy() {\r\n\t\t$arrCats = $this->generateTreeByLevels(3);\r\n\t\t\r\n\t\treturn $arrCats;\r\n\t}", "public function getChildrenQuery();", "public static function getTopLevel()\n {\n $dataArr = [];\n $parentCatsArr = self::getParentOnlyCats();\n foreach($parentCatsArr as $obj) {\n $dataArr[$obj->id]['title'] = $obj->title;\n $dataArr[$obj->id]['cats_id'] = $obj->id;\n }\n return $dataArr;\n }", "public function __serialize() { \n $serialized = [\n 'instance_name' => $this->instance_name,\n 'local_columns' => array_map(fn($column) => $this->serializeColumn($column), $this->getLocalColumns()),\n 'referenced_columns' => array_map(fn($column) => $this->serializeColumn($column), $this->getReferencedColumns()),\n 'is_reversed_relation' => $this->is_reverse_relation,\n 'target_relation' => $this->getTargetRelation(),\n 'type' => $this->type,\n ];\n\n return $serialized;\n\n }", "public function getChildren(): array;", "public function tree($sql) {\n $data_out = array();\n foreach ($this->lines($sql, true) AS $data)\n {\n $data_out[$data[0]][] = $data[1];\n }\n return $data_out;\n }", "function tree2sql() {\n\t\t$table = $this->packageInfo['table'];\n\t\twhile(list($tableNum,$tableData) = @each($table)) {\n\t\t\tunset($sql);\n\t\t\t$cols = $tableData['column'];\n\t\t\t$thistablename = $tableData['attributes']['name'];\n\t\t\twhile(list($colNum,$col) = @each($cols)) {\n\t\t\t\t$_string = \"\";\n\t\t\t\t$len = \"\";\n\t\t\t\textract($col);\n\t\t\t\t$_string .= \"$field $type \";\n\t\t\t\tif ($len) { $_string .= \"($len) \"; }\n\t\t\t\tif ($null) { $_string .=\" NULL \"; } else { $_string .= \" NOT NULL \"; }\n\t\t\t\t$_string .= \" default '$default' \";\n\t\t\t\tif ($extra) { $_string .= \" $extra \"; }\n\t\t\t\t$sql[] = $_string;\n\t\t\t}\n\t\t\t$idx = $tableData['indexes'];\n\t\t\t$col = \"\";\n\t\t\twhile(list($num,$indx) = @each($idx)) {\n\t\t\t\twhile(list($numpos,$cols) = each($indx['index'])) {\n\t\t\t\t\textract($indx['attributes'][$numpos]);\n\t\t\t\t\t$col[$name]= @implode(\",\",$cols['columns']);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sqlindex = \"\";\n\t\t\t$sqlindexes = \"\";\n\t\t\twhile(list($key,$val) = @each($col)) {\n\t\t\t\tif (strtoupper($key)=='PRIMARY') { $key = \" PRIMARY KEY \"; } else { $key = \" KEY $key \"; }\n\t\t\t\t$sqlindex[] = \"$key ($val)\";\n\t\t\t}\n\t\t\t$sqlindexes = @implode(\",\",$sqlindex);\n\t\t\tif ($sqlindexes) { $sqlindexes =\" , $sqlindexes\"; }\n\t\t\t$finalsql[] = \"drop table if exists $thistablename\";\n\t\t\t$finalsql[] = \" create table $thistablename ( \".@implode(\",\",$sql).\" $sqlindexes ) \";\n\n\t\t\t$rows = $tableData['data'][$tableNum]['row'];\n\t\t\twhile(list($rownum,$rowdata) = @each($rows)) { \n\t\t\t\t$keys = \"\";\n\t\t\t\t$vals = \"\";\n\t\t\t\twhile(list($k,$v) = each($rowdata)) { \n\t\t\t\t\t$keys[]=$k;\n\t\t\t\t\t$vals[]=$v;\n\t\t\t\t}\n\t\t\t\t$datasql[] = \"insert into $thistablename (\".implode(\",\",$keys).\") values ('\".implode(\"','\",$vals).\"')\";\n\t\t\t}\n\t\t}\n\t\t$this->datasql = $datasql;\n\t\t$this->sql = $finalsql;\n\t\treturn $finalsql;\n\t}", "public function getFields() {\n\t\t$fields[] = array('name' => 'parent',\n\t\t\t'type' => 'string',\n\t\t\t'size' => 100,\n\t\t\t'notnull' => true);\n\t\t$fields[] = array('name' => 'parentid',\n\t\t\t'type' => 'integer',\n\t\t\t'notnull' => true);\n\t\t$fields[] = array('name' => 'name',\n\t\t\t'type' => 'string',\n\t\t\t'size' => 100,\n\t\t\t'notnull' => true);\n\t\t$fields[] = array('name' => 'value',\n\t\t\t'type' => 'string',\n\t\t\t'size' => 1000000,\n\t\t\t'notnull' => false);\n\n\t\treturn $fields;\n\t}", "protected function _tree($prop = NULL)\n\t{\n\t\t$CI =& get_instance();\n\t\t$return = array();\n\n\n\t\tif (!empty($this->foreign_keys) OR !empty($this->has_many) OR !empty($this->belongs_to))\n\t\t{\n\t\t\tif (empty($prop))\n\t\t\t{\n\t\t\t\tif (!empty($this->foreign_keys))\n\t\t\t\t{\n\t\t\t\t\t$p = $this->foreign_keys;\n\t\t\t\t}\n\t\t\t\telse if (!empty($this->has_many))\n\t\t\t\t{\n\t\t\t\t\t$p = $this->has_many;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (property_exists($this, $prop))\n\t\t\t{\n\t\t\t\t$p = $this->$prop;\n\t\t\t}\n\n\t\t\t$key_field = key($p);\n\t\t\t$loc_field = $key_field;\n\n\t\t\t// get related model info\n\t\t\t$rel_module = current($p);\n\t\t\tif (is_array($rel_module))\n\t\t\t{\n\t\t\t\t$rel_module = current($rel_module);\n\t\t\t}\n\t\t\t$rel_module_obj = $CI->fuel->modules->get($rel_module, FALSE);\n\n\t\t\tif (!$rel_module_obj)\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t\t\t$rel_model = $rel_module_obj->model();\n\t\t\t$rel_key_field = $rel_model->key_field();\n\t\t\t$rel_display_field = $rel_module_obj->info('display_field');\n\n\n\t\t\t$module = strtolower(get_class($this));\n\t\t\t$module_obj = $CI->fuel->modules->get($module, FALSE);\n\t\t\tif (!$module_obj)\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t\t\t$model = $module_obj->model();\n\t\t\t$display_field = $module_obj->info('display_field');\n\t\t\t$rel_col = !empty($rel_module_obj->default_col) ? $rel_module_obj->default_col : $this->key_field();\n\t\t\t$rel_order = !empty($rel_module_obj->default_order) ? $rel_module_obj->default_order : 'asc';\n\n\t\t\tif ($prop == 'foreign_keys')\n\t\t\t{\n\t\t\t\t$groups = $rel_model->find_all_array(array(), $rel_model->key_field().' asc');\n\t\t\t\t$children = $this->find_all_array(array(), $key_field.' asc');\n\t\t\t\t$g_key_field = $rel_model->key_field();\n\t\t\t\t$loc_field = $g_key_field;\n\t\t\t}\n\t\t\telse if ($prop == 'has_many')\n\t\t\t{\n\t\t\t\t$CI->load->module_model(FUEL_FOLDER, 'fuel_relationships_model');\n\t\t\t\t$groups = $rel_model->find_all_array(array(), $rel_col.' '.$rel_order);\n\t\t\t\t$children = $CI->fuel_relationships_model->find_by_candidate($this->table_name(), $rel_model->table_name(), NULL, 'array');\n\t\t\t\t$key_field = 'foreign_id';\n\t\t\t\t$g_key_field = 'candidate_id';\n\t\t\t\t$display_field = 'candidate_'.$display_field;\n\t\t\t\t$loc_field = $key_field;\n\t\t\t}\n\t\t\telse if ($prop == 'belongs_to')\n\t\t\t{\n\t\t\t\t$CI->load->module_model(FUEL_FOLDER, 'fuel_relationships_model');\n\t\t\t\t$groups = $rel_model->find_all_array(array(), $rel_col.' '.$rel_order);\n\t\t\t\t$children = $CI->fuel_relationships_model->find_by_candidate($rel_model->table_name(), $this->table_name(), NULL, 'array');\n\t\t\t\t$key_field = 'candidate_id';\n\t\t\t\t$g_key_field = 'foreign_id';\n\t\t\t\t$display_field = 'foreign_'.$display_field;\n\t\t\t\t$loc_field = $key_field;\n\t\t\t}\n\n\t\t\t// now get this models records\n\t\t\tforeach($children as $child)\n\t\t\t{\n\t\t\t\t$used_groups[$child[$key_field]] = $child[$key_field];\n\t\t\t\t$attributes = ((isset($child['published']) AND $child['published'] == 'no') OR (isset($child['active']) AND $child['active'] == 'no')) ? array('class' => 'unpublished', 'title' => 'unpublished') : NULL;\n\t\t\t\t$return['g'.$child[$g_key_field].'_c_'.$child[$key_field]] = array('parent_id' => $child[$key_field], 'label' => $child[$display_field], 'location' => fuel_url($module_obj->info('module_uri').'/edit/'.$child[$loc_field]), 'attributes' => $attributes);\n\t\t\t}\n\n\t\t\tforeach($groups as $group)\n\t\t\t{\n\t\t\t\tif (isset($used_groups[$group[$rel_key_field]]))\n\t\t\t\t{\n\t\t\t\t\t$attributes = ((isset($group['published']) AND $group['published'] == 'no') OR (isset($group['active']) AND $group['active'] == 'no')) ? array('class' => 'unpublished', 'title' => 'unpublished') : NULL;\n\t\t\t\t\t$return[$group[$rel_key_field]] = array('id' => $group[$rel_key_field], 'parent_id' => 0, 'label' => $group[$rel_display_field], 'location' => fuel_url($rel_module_obj->info('module_uri').'/edit/'.$group[$rel_key_field]), 'attributes' => $attributes);\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn $return;\n\t}", "public function all_child_individual()\n\t{\n\t\t$this->db->where('individual_status = 1 AND individual_parent > 0');\n\t\t$this->db->order_by('individual_name', 'ASC');\n\t\t$query = $this->db->get('individual');\n\t\t\n\t\treturn $query;\n\t}", "function opensky_get_collection_tree () {\n $pid = 'opensky:root';\n $tree = array();\n foreach (opensky_get_subcollections_recursive('opensky:root') as $pid) {\n $tree[$pid] = opensky_get_pid_subcollections_pids($pid);\n }\n return $tree;\n}", "public function index()\n {\n return ThreeDimensionalObject::all();\n }", "abstract protected function getCurrentChildren(): array ;", "public static function getChildrenString($parent) {\n $model = Pages::find()->where(['parent_id' => $parent])->all();\n $storage = [];\n foreach ($model as $key) {\n $storage[] = $key->id;\n $storage[] = self::getChildrenString($key->id);\n }\n return $storage;\n }", "public function getWithRelations();", "public function children()\n {\n $meta = $this->getMetaData();\n $keys = array_keys($meta['children'] ?? []);\n $prefix = $this->getMasterKey();\n if ($prefix) {\n foreach ($keys as &$key) {\n $key = $prefix . '/' . $key;\n }\n unset($key);\n }\n\n return $this->getFlexDirectory()->getIndex($keys, 'storage_key');\n }", "public function getRelations();", "public function getRelations();", "public function childrens()\n {\n return $this->hasMany(self::class, 'parent_id');\n }", "function getTreePart( $belongs_to ) {\n\t\t// WAAH! ueberfluessig haeufiger Aufruf...mir jetzt egal :)\n\t\t$cats = $this->out;\n\t\t$out = array();\n\n\t\tif (isset ($cats[ $belongs_to ]) and count( $cats[ $belongs_to ] ) > 0 ) {\n\t\t\tforeach ( $cats[ $belongs_to ] as $id => $entry ) {\n\t\t\t\t$out[$id] = $entry;\n\t\t\t}\n\t\t}\n\n\t\treturn $out;\n\t}", "protected function getGeneralChildren()\n {\n $children = [\n 'warehouse_id' => $this->getWarehouseIdField(),\n 'stocktaking_code' => $this->getStocktakingCodeField(),\n 'reason' => $this->getReasonField(),\n 'participants' => $this->getParticipantsField(),\n 'stocktake_at' => $this->getStocktakeAtField(),\n ];\n if($this->getStocktakingStatus() == StocktakingModel::STATUS_COMPLETED)\n $children = [\n 'warehouse_id' => $this->getWarehouseIdField(),\n 'stocktaking_code' => $this->getStocktakingCodeField(),\n 'participants' => $this->getParticipantsField(),\n 'status' => $this->getStocktakingStatusField(),\n 'stocktake_at' => $this->getStocktakeAtField(),\n 'created_by' => $this->getStocktakingCreatedByField(),\n 'created_at' => $this->getStocktakingCreatedAtField(),\n 'verified_by' => $this->getVerifiedByField(),\n 'confirmed_by' => $this->getConfirmedByField(),\n 'reason' => $this->getReasonField(),\n ];\n return $children;\n }", "function buildMenuHierarchy(): array\n{\n $menu = queryDB(\n \"SELECT * FROM pages WHERE parent_page_id IS NULL AND published = 1 ORDER BY menu_priority ASC\"\n )->fetchAll();\n\n foreach ($menu as $i => $parentPage) {\n $menu[$i][\"children\"] = queryDB(\n \"SELECT * FROM pages WHERE parent_page_id = ? AND published = 1 ORDER BY menu_priority ASC\",\n $parentPage['id']\n )->fetchAll();\n }\n\n return $menu;\n}", "public function getCategoryTree() {\n $q = \"select * from \".TP.\"transaction_type_master order by type,subtype1,subtype2_display_order\";\n $res = mysql_query($q);\n $ret = array();\n if (!$res) {\n return $ret;\n }\n while($row = mysql_fetch_assoc($res)) {\n $ret[$row['type']][$row['subtype1']][] = $row['subtype2'];\n //var_dump($row);\n }\n //var_Dump($ret);\n return $ret;\n }", "function getRecursiveFields()\n{\n $subFields = array();\n $subFields[$this->name] = $this;\n return $subFields;\n}", "public function toArray()\n {\n return [\n 'id' => $this->id,\n 'data' => $this->data,\n 'name' => $this->name,\n 'checksum' => $this->checksum,\n 'children' => $this->children,\n 'events' => $this->events,\n ];\n }", "public function toArray()\n {\n $a = parent::toArray();\n if ($this->father) {\n $a[\"father\"] = $this->father->toArray();\n }\n if ($this->mother) {\n $a[\"mother\"] = $this->mother->toArray();\n }\n if ($this->child) {\n $a[\"child\"] = $this->child->toArray();\n }\n if ($this->fatherFacts) {\n $ab = array();\n foreach ($this->fatherFacts as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['fatherFacts'] = $ab;\n }\n if ($this->motherFacts) {\n $ab = array();\n foreach ($this->motherFacts as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['motherFacts'] = $ab;\n }\n return $a;\n }", "public function children()\n {\n return $this->hasMany(self::class, 'parent_id', 'id');\n }", "public function saveWithChildren(array $data) : \\codename\\core\\model {\r\n\r\n // Open a virtual transaction\r\n // as we might do some multi-model saving\r\n $this->db->beginVirtualTransaction();\r\n\r\n $data2 = $data;\r\n\r\n //\r\n // delay collection saving\r\n // we might need the pkey, if the base model entry is not yet created\r\n //\r\n $childCollectionSaves = [];\r\n\r\n // save children\r\n if($this->config->exists('children')) {\r\n foreach($this->config->get('children') as $child => $childConfig) {\r\n\r\n if($childConfig['type'] === 'foreign') {\r\n //\r\n // Foreign Key based child saving\r\n //\r\n\r\n // get the nested models / join plugin instances\r\n $foreignConfig = $this->config->get('foreign>'.$childConfig['field']);\r\n $field = $childConfig['field'];\r\n\r\n // get the join plugin valid for the child reference field\r\n $res = array_filter($this->getNestedJoins(), function(\\codename\\core\\model\\plugin\\join $join) use ($field) {\r\n return $join->modelField == $field;\r\n });\r\n\r\n if(count($res) === 1) {\r\n // NOTE: array_filter preserves keys. use array_values to simply use index 0\r\n // TODO: check for required fields...\r\n if(isset($data[$child])) {\r\n $model = array_values($res)[0]->model;\r\n $model->saveWithChildren($data[$child]);\r\n // if we just inserted a NEW entry, get its primary key and save into the root model\r\n if(empty($data[$child][$model->getPrimaryKey()])) {\r\n $data2[$childConfig['field']] = $model->lastInsertId();\r\n } else {\r\n $data2[$childConfig['field']] = $data[$child][$model->getPrimaryKey()];\r\n }\r\n }\r\n } else {\r\n // error?\r\n // Throw an exception if there is no single, but multiple joins that match our condition\r\n if(count($res) > 1) {\r\n throw new exception('EXCEPTION_MODEL_SCHEMATIC_SQL_CHILDREN_AMBIGUOUS_JOINS', exception::$ERRORLEVEL_ERROR, [\r\n 'child' => $child,\r\n 'childConfig' => $childConfig,\r\n 'foreign' => $field,\r\n 'foreignConfig' => $foreignConfig\r\n ]);\r\n }\r\n\r\n // TODO: make sure we should do it like that.\r\n //\r\n }\r\n unset($data2[$child]);\r\n\r\n } else if($childConfig['type'] === 'collection') {\r\n //\r\n // Collection Saving of childs\r\n //\r\n\r\n // collection saving done below\r\n if(isset($this->collectionPlugins[$child]) && array_key_exists($child, $data)) {\r\n $childCollectionSaves[$child] = $data[$child];\r\n }\r\n\r\n // unset the child collection field\r\n // as it cannot be handled by SQL\r\n unset($data2[$child]);\r\n }\r\n\r\n }\r\n }\r\n // end save children\r\n\r\n //\r\n // Save the main dataset\r\n //\r\n $this->save($data2);\r\n\r\n //\r\n // Determine, if we're updating OR inserting (depending on PKEY value existance)\r\n //\r\n $update = (array_key_exists($this->getPrimarykey(), $data) && strlen($data[$this->getPrimarykey()]) > 0);\r\n if(!$update) {\r\n $data[$this->getPrimarykey()] = $this->lastInsertId();\r\n }\r\n\r\n //\r\n // Save child collections\r\n //\r\n if(count($childCollectionSaves) > 0) {\r\n foreach($childCollectionSaves as $child => $childData) {\r\n\r\n if($childData === null) {\r\n continue;\r\n }\r\n\r\n $collection = $this->collectionPlugins[$child];\r\n $model = $collection->collectionModel;\r\n\r\n // TODO: get all existing references/entries\r\n // that must be deleted/obsoleted\r\n $model->addFilter($collection->getCollectionModelBaseRefField(), $data[$collection->getBaseField()]);\r\n $existingCollectionItems = $model->search()->getResult();\r\n\r\n // determine must-have-pkeys\r\n $targetStateIds = array_reduce($childData, function($carry, $item) use ($model) {\r\n if($id = ($item[$model->getPrimaryKey()] ?? null)) {\r\n $carry[] = $id;\r\n }\r\n return $carry;\r\n }, []);\r\n\r\n // determine must-have-pkeys\r\n $existingIds = array_reduce($existingCollectionItems, function($carry, $item) use ($model) {\r\n if($id = ($item[$model->getPrimaryKey()] ?? null)) {\r\n $carry[] = $id;\r\n }\r\n return $carry;\r\n }, []);\r\n\r\n // the difference - to-be-deleted IDs\r\n $deleteIds = array_diff($existingIds, $targetStateIds);\r\n\r\n // delete them\r\n foreach($deleteIds as $id) {\r\n $model->delete($id);\r\n }\r\n\r\n foreach($childData as $childValue) {\r\n // TODO?: check for references!\r\n // For now, we're just overwriting the reference to THIS model / current dataset\r\n if(!isset($childValue[$collection->getCollectionModelBaseRefField()]) || ($childValue[$collection->getCollectionModelBaseRefField()] != $data[$collection->getBaseField()])) {\r\n $childValue[$collection->getCollectionModelBaseRefField()] = $data[$collection->getBaseField()];\r\n }\r\n $model->saveWithChildren($childValue);\r\n }\r\n }\r\n }\r\n\r\n // end the virtual transaction\r\n // if this is the last (outer) model to call save()/saveWithChildren()\r\n // this closes the pending transaction on db/connection-level\r\n $this->db->endVirtualTransaction();\r\n\r\n return $this;\r\n }", "public function all_parent()\r\n\t{\r\n\t\t$query = $this->db->select('*')->get('menu')->result_array(); \r\n\t \treturn $query;\r\n\t}", "public static function treeCategories(): array\n {\n return JEasyUi::jsonFormat(self::parentCategories());\n }", "function _getRubriekFromDb()\n {\n $menuData = array('items' => array(), 'parents' => array());\n\n $conn = getConn();\n $sql = \"SELECT RubriekID, Rubrieknaam, SuperRubriekID FROM Rubriek ORDER BY SuperRubriekID, Rubrieknaam\";\n $stmt = sqlsrv_prepare($conn, $sql);\n if (!$stmt) {\n die(print_r(sqlsrv_errors(), true));\n }\n sqlsrv_execute($stmt);\n if (sqlsrv_execute($stmt)) {\n while ($menuItem = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {\n $menuData['items'][$menuItem['RubriekID']] = $menuItem;\n $menuData['parents'][$menuItem['SuperRubriekID']][] = $menuItem['RubriekID'];\n }\n }\n return $menuData;\n }", "private static function genParentDbFieldTableTemplate() {\n return array(\n self::ID_KEY => new AccessLayerField(DataTypeName::UNSIGNED_INT),\n self::CREATED_KEY => new AccessLayerField(DataTypeName::TIMESTAMP),\n self::LAST_UPDATED_TIME_KEY => new AccessLayerField(DataTypeName::TIMESTAMP),\n );\n }", "public function __toString() {\n return $this->getTree();\n }", "public function findAll() {\n $sql = \"select * from praticien\";\n $result = $this->getDb()->fetchAll($sql);\n\n // Convert query result to an array of domain objects\n $praticien = array();\n foreach ($result as $row) {\n $praticienID = $row['id_praticien'];\n $praticien[$praticienID] = $this->buildDomainObject($row);\n }\n return $praticien;\n }", "static public function getCategoryTree() {\n $rows = self::find()\n ->where(['!=', 'id', 1]) // exclude root category\n ->andWhere(['=', 'status', self::STATUS_SHOW]) // exclude hidden\n ->orderBy(['tree' => SORT_ASC, 'lft' => SORT_ASC])\n ->all();\n \n // build tree\n $result = [];\n $last_parent_id = null;\n foreach($rows as $row) {\n if($row['depth'] == 1) { // parent\n $last_parent_id = $row['id'];\n $result[$last_parent_id] = [\n 'parent' => $row,\n 'childs' => []\n ];\n\n continue;\n }\n\n // childs\n $result[$last_parent_id]['childs'][$row->id] = $row;\n }\n return $result;\n }", "function show_childgrid() {\r\n if (($this->action=='edit' or $this->action=='view' or $this->action=='browse') and $this->childds) {\r\n foreach ($this->childds as $child_modulename) {\r\n $child_module = instantiate_module($child_modulename);\r\n $child_module->logical_parent = $this; # 1. for parent: bind children to parent\r\n # bind child's foreign key to me\r\n # - search which field is the foreign key\r\n foreach ($child_module->properties as $k=>$col) {\r\n if ($col->enumerate == $this->module) { # foreign key always int\r\n $child_module->properties[$k]->hidden = 1; # hide this field from browse\r\n $child_module->properties[$k]->parentkey = 1; # flag that this field IS the connecting master/detail key. will be used by add-suggestive-field\r\n $child_module->properties[$k]->parentkey_value = $this->ds->_rowid[$this->_cursor];\r\n $child_module->db_where = '`'.$col->colname.'`='.$this->ds->_rowid[$this->_cursor];\r\n break;\r\n }\r\n }\r\n $child_module->final_init();\r\n if ($this->db_count) # if parent empty, do not populate child\r\n $child_module->populate();\r\n #~ echo '<hr>';\r\n echo '<br>';\r\n echo '<table>';\r\n echo '<tr><td style=\"color:white; background-color:rgb(99,140,181);\">'.$child_module->title.'</td></tr>';\r\n echo '<tr><td>';\r\n $child_module->showgrid('browse');\r\n echo '</tr></td></table>';\r\n }\r\n }\r\n }", "private function getChildrenIds(){\n if ($this->myChildrenType===null) $this->myChildrenIds = null;\n else $this->myChildrenIds = $this->_db->getChildrenIds($this->myId);\n }", "function & getChilds() {\r\n // Load the data\r\n if (empty ($this->_childs)) {\r\n $database = $this->_db;\r\n /* retrieve values */\r\n $query = 'SELECT * FROM #__custom_properties_values' . ' WHERE parent_id = ' . $this->_id . ' ORDER BY ordering ';\r\n\r\n $database->setQuery($query);\r\n $this->_childs = $database->loadObjectList();\r\n }\r\n return $this->_childs;\r\n }", "public function getChildsProperty($object);", "abstract protected function getNewChildren(): array ;", "public function getSkuHierarchy ()\n {\n $sql = \"select t1.id,t1.layer_name,t1.layer_code,t1.layer_description,t1.parent_layer_id,t2.id as parent_layer_id,\"\n . \" (Select b.layer_name from tbld_sku_hierarchy as b where t2.id = b.id) as parent_layer_name from tbld_sku_hierarchy as t1 left join tbld_sku_hierarchy as t2 on t2.id = t1.parent_layer_id \";\n $query = $this->db->query( $sql )->result_array();\n return $query;\n }", "public function toArray()\n {\n $itemArray = [];\n foreach ($this->storage as $item) {\n $itemArray[] = $item;\n }\n return [\n 'uid' => $this->getIdentifier(),\n 'title' => $this->getTitle(),\n 'description' => $this->getDescription(),\n 'table_name' => $this->getItemTableName(),\n 'items' => $itemArray\n ];\n }", "public function getChildren(): ?array;", "public function getTree()\n {\n return HandbookCategory::all()->toTree();\n }", "public function toArray($_recursive = TRUE);", "static function to_tree($data)\n {\n //Cap 1\n for ($i = 3; $i >= 1; $i--)\n {\n //echo $i . \"============<br/>\";\n foreach ($data as $key=>$value)\n {\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"$key = \" . $data[$key][\"ten\"] . \"<br/>\";\n \n //if (!isset($data[$key][\"tree\"])) $data[$key][\"tree\"] = false;\n //if ($value[\"parent\"] > 0 && !$data[$key][\"tree\"])\n if ($value[\"cap\"] == $i)\n {\n //if (!isset($data[$value[\"parent\"]][\"child\"])){\n //\t$data[$value[\"parent\"]][\"child\"] = array();\n //}\n $data[$value[\"parent\"]][\"child\"][$key] = $value;\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"&nbsp;&nbsp;&nbsp;&nbsp;Dua \" . $value[\"ten\"] . \" vao \" . $value[\"parent\"] . \" \" . $data[$value[\"parent\"]][\"ten\"] . \" <br/>\";\n //$data[$key][\"tree\"] = true;\n //$data[$value[\"parent\"]][\"tree\"] = false;\n }\n }\n }\n //Khu bo\n foreach ($data as $key=>$value)\n {\n if ($value[\"parent\"] > 0)\n {\n unset($data[$key]);\n }\n }\n \n return $data;\n }", "public function myChildren()\n {\n return File::get()->filter(\"ParentID\", $this->ID);\n }", "public function getChildDocuments() {}", "public function findChildren()\n {\n return self::where('code_parrent',$this->id)->get();\n }", "function get_hierarchy_data($optparent=null,$branchparent=0,$published=null,$maxlevel=9999)\n {\n\n /*\n chu y khi lay du lieu\n Khi lay ta len nhom du lieu theo parent id de qua trinh su li phia sau duoc nhanh chong\n */\n $data=$this->_prepareData(null,$optparent,$published) ;\n //pr($data);\n $children=$this->_make_relation($data) ;\n // echo \"<br>---list Child----<br>\"; print_r($children);\n\n $list = $this->_data_recurse($branchparent, $children, array(), $maxlevel,0,'',$data);\n //echo \"<br>---list ----<br>\"; print_r($list);\n\n return $list;\n }", "public function inspectDB($table,$depth){\n\t\t\n\t\t//check the session\n\t\t//if(!isset($_SESSION[$table]))\n\t\t\n\t\t$fields = array();\n\t\t$related = array();\n\t\t$sql = \"DESCRIBE $table\";\n\t\t\t\n\t\t$stmt = $this->_pdo->prepare($sql);\t\t\n\t\t$stmt->execute();\n\t\twhile($qobj = $stmt->fetch()){\t\t\t \t\t\n \t\t$fields[$qobj->Field] = array(\"type\" => $qobj->Type,\n \t\t\t\t\t\t\t\t\t\t\"allow_null\" => $qobj->Null,\n \t\t\t\t\t\t\t\t\t\t\"key\" => $qobj->Key);\n\t\t}\t\t\n\t\t\n\t\t//recursively build related data\n\t\tif($depth > 0){\n\t\t\t$related = $this->findRelations($table);\n\t\t\t\n\t\t\tforeach($related as $key => $r){\n\t\t\t\t$dbData = $this->inspectDB($r[\"table\"],$depth-1);\n\t\t\t\t$related[$key][\"fields\"] = $dbData[\"fields\"];\n\t\t\t\t$related[$key][\"related\"] = $dbData[\"related\"];\n\t\t\t}\t\t\t\n\t\t}\n\n\t\t$sTable[$table] = array(\"fields\" => $fields, \"related\" => $related);\n\n\t\treturn array(\"fields\" => $fields, \"related\" => $related);\n\t}", "private function prepareObjectArray(){\n\t//scorro l' array $this->objarr settando su ciascun oggetto gli attributi children\n\tforeach($this->objarr as $key=>$object){\n\t\t//echo \"-\".$object->getAppendToIndex().\"<br />\";\n\t\t\n\t\tif(($appind=$object->getAppendToIndex()) != \"\"){\n\t\t\n\t\t$object->setIntegrated(true); //indico che l' oggetto è stato incluso come figlio di un altro.\t\n\t\t\n\t\t $objparent=$this->objarr[$appind];\n\t\t\t$objparent->appendChild($object);\t\n\t\t\t//echo $objparent->getIndex();\n\t\t}\n\t}\n}", "static function buildTreeFromTextDFM($content) {\n $objects = self::parseTextDFM($content);\n\n foreach ($objects as $_id => $_object) {\n $_object->ischild = false;\n\n // Color\n $_object->csscolor = self::parseColor($_object->color);\n\n $_parent = $_object->parent;\n\n if ($_parent && $_parent != \"Scene\" && isset($objects[$_parent])) {\n if (!isset($objects[$_parent]->children)) {\n $objects[$_parent]->children = array();\n }\n\n $_object->ischild = true;\n $objects[$_parent]->children[$_id] = $_object;\n }\n }\n\n foreach ($objects as $_id => $_object) {\n if ($_object->ischild) {\n unset($objects[$_id]);\n }\n }\n\n return $objects;\n }", "public function getParents() {}", "public static function schema() {\n\t\treturn array(\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'additionalProperties' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'attribute' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'meta' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'multiline' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'query' => array(\n\t\t\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'selector' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'source' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'enum' => array( 'attribute', 'text', 'html', 'query' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'type' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'enum' => array( 'null', 'boolean', 'object', 'array', 'number', 'string', 'integer' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'required' => array( 'type' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'category' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t\t'comment' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t\t'description' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t\t'editorScript' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'pattern' => '\\.js$',\n\t\t\t\t),\n\t\t\t\t'editorStyle' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'pattern' => '\\.css$',\n\t\t\t\t),\n\t\t\t\t'example' => array(\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'additionalProperties' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'icon' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t\t'keywords' => array(\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'name' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t\t'parent' => array(\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'script' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'pattern' => '\\.js$',\n\t\t\t\t),\n\t\t\t\t'style' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'pattern' => '\\.css$',\n\t\t\t\t),\n\t\t\t\t'styles' => array(\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'isDefault' => array(\n\t\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'label' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'name' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'supports' => array(\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t'align' => array(\n\t\t\t\t\t\t\t'type' => array( 'boolean', 'array' ),\n\t\t\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'enum' => array( 'left', 'center', 'right', 'wide', 'full' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'alignWide' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'anchor' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'className' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'customClassName' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'html' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'inserter' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'multiple' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'reusable' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'textdomain' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t\t'title' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'required' => array( 'name', 'title' ),\n\t\t\t'additionalProperties' => false,\n\t\t);\n\t}", "abstract function relations();", "private static function getParentChildren():array\n {\n $parentChildren = [];\n $categories = self::select('*')->get()->toArray();\n\n foreach ($categories as $id){\n $children = [];\n foreach ($categories as $row){\n if ($id['id'] == $row['parent_id']){\n $children[] = $row['id'];\n }\n }\n $parentChildren[$id['id']] = $children;\n }\n\n return $parentChildren;\n\n }" ]
[ "0.6228381", "0.5983081", "0.58849543", "0.58352065", "0.5795033", "0.5790007", "0.5746432", "0.57169074", "0.57147914", "0.5678513", "0.56691617", "0.5636866", "0.5624245", "0.55865407", "0.5571356", "0.55472654", "0.5540894", "0.5512102", "0.5487325", "0.54838413", "0.54770845", "0.5404838", "0.5379096", "0.53681326", "0.53678626", "0.53579956", "0.5351135", "0.5320037", "0.5282949", "0.5274698", "0.5271978", "0.52571446", "0.52462864", "0.5235504", "0.5234828", "0.5233243", "0.52239764", "0.5222402", "0.5220688", "0.52140933", "0.52078", "0.51942825", "0.5187743", "0.5185615", "0.51769817", "0.5170579", "0.51695514", "0.5162683", "0.51611376", "0.51520294", "0.5123443", "0.51189893", "0.5115092", "0.5107803", "0.51038545", "0.5088953", "0.50877935", "0.5074675", "0.5073874", "0.5072009", "0.50707245", "0.50707245", "0.50706834", "0.5069722", "0.50672746", "0.5064279", "0.506027", "0.5058636", "0.5048952", "0.50489324", "0.5038803", "0.50335276", "0.50315857", "0.5030411", "0.5028938", "0.5024678", "0.50227594", "0.5019684", "0.5019469", "0.5011491", "0.49994525", "0.4999314", "0.4990102", "0.49852931", "0.49828705", "0.49812505", "0.4969808", "0.49683353", "0.49641335", "0.495826", "0.49526322", "0.49452248", "0.4940977", "0.4933483", "0.4929112", "0.49245265", "0.49148917", "0.49042162", "0.48984697", "0.48971385", "0.48932937" ]
0.0
-1
Creates a HTMLlist of an array
function listify($array, $class='list', $vary=true, $textfield = false, $childfield = false){ if(!$array) return; static $i = -1; static $recursion = 0; ++$recursion; if($vary === true) $vary = array('odd', 'even'); $vlen = count($vary); $result = ''; $result = '<ul'.($class?' class="'.$class.'"':'').'>'; foreach($array as $key => $li) { $result .= '<li'.($vary?' class="'.$vary[++$i%$vlen].'"':'').'>' .($textfield ? @$li[$textfield] : (is_array($li) ? $key : $li)) .(is_array($li) ? ($childfield ? (isset($li[$childfield]) ? listify($li[$childfield], false, $vary, $textfield, $childfield) : '' ) : listify($li, false, $vary, $textfield, $childfield) ) : ''); } $result .= '</ul>'; --$recursion; if(!$recursion) $i = 0; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make_list(array $array)\n {\n echo \"<ul>\";\n \n foreach($array as $numb)\n {\n make_tag(\"li\", $numb);\n }\n\n echo \"</ul>\";\n }", "function alist ($array) { //This function prints a text array as an html list.\n $alist = \"<ul>\";\n for ($i = 0; $i < sizeof($array); $i++) {\n $alist .= \"<li>$array[$i]\";\n }\n $alist .= \"</ul>\";\n return $alist;\n}", "function createList($array,$id='',$class='',$type='ul',$gilder='') {\n\tif(!is_array($array)) return false;\n\t\n\t$type = strtolower($type);\n\tif($type!='ul' && $type!='ol') $type = 'ul'; // defaults to <ul>\n\t\n\t$special = '';\n\tif(!is_array($class)) $class = array($class);\n\tif(in_array('hfeed',$class)) {\n\t\t$special = 'hfeed';\n\t\t$special_key = array_search($special, $class);\n\t\tunset($class[$special_key]);\n\t}\n\t\n\t$list = '';\n\t$array = array_values($array);\n\tfor($i=0; $i<count($array); $i++) {\n\t\t$list .= formatListItem($array,'li',$i,$special,$gilder);\n\t}\t\n\t\n\treturn '<'.$type.addAttributes('',$id,$class).'>'.\"\\n\".$list.'</'.$type.'>'.\"\\n\";\n}", "public function output() {\n\t\treturn array_merge(\n\t\t\tarray(\"<ul data-divider-theme='b' id='list_{$this->options['id']}' \".($this->options['inset']?'data-inset=\"true\" ':'').($this->options['actions']?\"data-split-icon='{$this->options['icon']}' data-split-theme='a'\":\"\").\" data-role='listview'>\"),\n\t\t\t$this->items,\n\t\t\tarray(\"</ul>\"));\n\t}", "function makeList($array) \n { \n //Base case: an empty array produces no list \n if (empty($array)) return '';\n\n //Recursive Step: make a list with child lists \n $output = '<ol class=\"dd-list\">'; \n foreach ($array as $key => $subArray) { \n $output .= '<li class=\"dd-item dd3-item\" data-id=\"' . $subArray['ID'] .'\">\n\t\t\t\t\t\t\t\t\t<div class=\"dd-handle dd3-handle\" >&nbsp;</div>\n\t\t\t\t\t\t\t\t\t<div class=\"dd3-content\" >' . $subArray['Title'] .'</div>'. makeList($subArray['children']) . '\n\t\t\t\t\t\t</li>'; \n } \n $output .= '</ol>'; \n \n return $output; \n }", "public function __toString()\n\t{\n\t\t$list_html = $this->build_list($this->data);\n\t\t\n\t\treturn $list_html;\n\t}", "public function renderList()\n {\n $html = '';\n foreach ($this->data as $listItem) {\n $html .= $this->render($listItem);\n }\n return $html;\n }", "private static function StructureList ()\n {\n return array (\n \"a\" => \"<a ###>$$$</a>\",\n \"button\" => \"<button ###>$$$</button>\"\n );\n }", "function scrappy_renderList( $data ) {\n if ( !is_array( $data ) ) return; \n $html = '';\n foreach ( $data as $key => $value ) {\n $html .= '<ul style=\"padding-left:15px\">';\n if (is_object( $value ) ) $value = get_object_vars( $value );\n if (is_array( $value ) ) {\n $html .= '<li><strong>' . $key .':</strong> ';\n $html .= scrappy_renderList( $value );\n $html .= '</li>';\n } else {\n $html .= '<li><strong>' . $key .':</strong> '. $value . '</li>';\n }\n $html .= '</ul>'; \n }\n return $html;\n}", "function list_array( $des_array ){\n\tif( is_array( $des_array ) ){\n\t\techo '<ul>';\n\t\tforeach( $des_array as $item ){\n\t\t\techo '<li>' . $item . '</li>';\n\t\t}\n\t\techo '</ul>';\n\t}\n}", "function dev_array_to_ul( $array ) {\n\t$wrapped = array_map( 'dev_wrap_li', $array );\n\treturn '<ul>' . implode( '', $wrapped ) . '</ul>';\n}", "private function htmlFromArray($hierarchicalArray) {\n $html = '';\n foreach($hierarchicalArray as $item) {\n $html .= \"<ul>\";\n $html .= \"<li style='color: \". ( ($item['status'] == 1) ? \"green\" : \"red\" ) .\"'>\". $item['title'] . \"<span style='color:black;'> --- \". $item['total_points'] .\"</span></li>\";\n if(count($item['children']) > 0) {\n $html .= $this->htmlFromArray($item['children']);\n }\n $html .= \"</ul>\";\n }\n return $html;\n }", "private function prepareHTML(){\n\t$first=true;\n\t\t\n\tforeach($this->objarr as $key=>$val){\n\t\t$a=\"\";\n\t if($val->getAClass()!=\"\") $a.=\" class=\\\"\".$val->getAClass().\"\\\"\";\n\t if($val->getAId()!=\"\") $a.=\" id=\\\"\".$val->getAId().\"\\\"\";\n\t $ul=\"\";\n\t if($val->getUlClass()!=\"\") $ul.=\" class=\\\"\".$val->getUlClass().\"\\\"\";\n\t if($val->getUlId()!=\"\") $ul.=\" id=\\\"\".$val->getUlId().\"\\\"\";\n\t $li=\"\";\n\t if($val->getLiClass()!=\"\") $li.=\" class=\\\"\".$val->getLiClass().\"\\\"\";\n\t if($val->getLiId()!=\"\") $li.=\" id=\\\"\".$val->getLiId().\"\\\"\";\n\t\n\t\tif(!$val->getIntegrated()){ //se l' oggetto non è stato integrato come figlio di qualche altro oggetto\n\t if($first){\n\t $this->html.=\"<ul>\\n<li\".$li.\"><a\".$a.\" href=\\\"\".$val->getLink().\"\\\">\".$val->getText().\"</a></li>\\n</ul>\";\n\t $first=false;\n\t\t }else{\n\t\t \t$this->html=$this->replace_last_occurence($this->html, \"</ul>\", \n\t\t \t\"<li\".$li.\"><a\".$a.\" href=\\\"\".$val->getLink().\"\\\">\".$val->getText().\"</a></li>\\n</ul>\");\n\t\t }\n\t\t \t\n\t\t $this->prepareRecursiveHTML($val);\n\t\t}//close if(!$val->getIntegrated())\n\t}//close foreach\n\t\n}", "public function generateList() {}", "public function generateList() {}", "public function generateList() {}", "public static function lists($array, $type = 'ul', $attrs = '')\n {\n if (is_array($attrs)) {\n $attrs = Tag::getAttrs($attrs);\n }\n\n $list = \"<$type $attrs>\".PHP_EOL;\n foreach ($array as $item) {\n $list .= \"<li>$item</li>\".PHP_EOL;\n }\n\n return \"$list</$type>\".PHP_EOL;\n }", "public function getUl() {}", "protected function renderArray() {}", "function createDefinitionList($array,$id='',$class='') {\n\tif(!is_array($array)) return false;\n\t\n\t$list = '';\n\tfor($i=0; $i<count($array); $i++) {\n\t\t$list .= formatListItem($array,'dt',$i);\n\t\t$list .= formatDefItem($array,$i);\n\t}\n\t\n\treturn '<dl'.addAttributes('',$id,$class).'>'.\"\\n\".$list.'</dl>'.\"\\n\";\n}", "function htmldump ( $array ) {\r\n\t\tforeach($array as $key => $val) {\r\n\t\t\t$return .= $this->ul(\r\n\t\t\t\t\t\t$this->li($this->font($key)) .\r\n\t\t\t\t\t\t\t$this->ul(\r\n\t\t\t\t\t\t\t\t$this->font(is_array($val) ? $this->htmldump($val) : $this->li($val))\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t);\r\n\t\t}\r\n\t\t\r\n\t\treturn $return;\r\n\t}", "function print_list() {\r\n if (!empty($this->data)) {\r\n $ol = '<ol>';\r\n foreach ($this->data as $result) {\r\n \r\n // Add proxy prefixto URL if necessary\r\n if ($this->proxy_required) {\r\n $url = PROXY_PREFIX . $result['url'];\r\n }\r\n else {\r\n $url = $result['url'];\r\n }\r\n \r\n // Add list item\r\n $ol .= '<li>';\r\n if (!empty($result['image'])) {\r\n $ol .= '<img src=\"' . $result['image'] . '\" alt=\"' . $result['text'] . '\" />';\r\n }\r\n $ol .= '<a href=\"' . $url . '\" target=\"_blank\">' . $result['text'] . '</a>';\r\n if (!empty($result['type'])) {\r\n $ol .= ' (<span class=\"nowrap\">' . $result['type'] . '</span>)';\r\n }\r\n $ol .= '<span class=\"subtext\">' . $result['subtext'] . '</span>';\r\n $ol .= '</li>';\r\n }\r\n $ol .= '</ol>';\r\n return $ol;\r\n }\r\n else {\r\n return false;\r\n }\r\n }", "public function renderListContent() {}", "public function lists();", "protected function getList($array, $listStyle = \"ul\") {\n $ret = '';\n if (is_array($array) && sizeof($array) > 0) {\n $ret = '<' . $listStyle . '>';\n foreach ($array as $key => $value) {\n $ret .= '<li>' . $key;\n if (is_array($value)) {\n $ret .= $this->getList($value);\n } else {\n $ret .= ' - ' . $value;\n }\n $ret .= '</li>';\n }\n $ret .= '</' . $listStyle . '>';\n }\n return $ret;\n }", "function makelist($res) {\n\t\t$items=Array();\n\t\t$listItems=Array();\n\n\t\t// Make table header\n\t\t$listItems[] = $this->cObj->stdWrap ( $this->getFieldHeader ( 'type' ), $this->conf['listView.']['headDataWrap1.'] );\n\t\t$listItems[] = $this->cObj->stdWrap ( $this->getFieldHeader_sortLink ( 'brand' ), $this->conf['listView.']['headDataWrap1.'] );\n\t\t$listItems[] = $this->cObj->stdWrap ( $this->getFieldHeader_sortLink ( 'model' ), $this->conf['listView.']['headDataWrap1.'] );\n\t\t$listItems[] = $this->cObj->stdWrap ( $this->getFieldHeader_sortLink ( 'mileage' ), $this->conf['listView.']['headDataWrap1.'] );\n\t\t$listItems[] = $this->cObj->stdWrap ( $this->getFieldHeader_sortLink ( 'price' ), $this->conf['listView.']['headDataWrap1.'] );\n\t\t$listItems[] = $this->cObj->stdWrap ( $this->getFieldHeader_sortLink ( 'initial_registration' ), $this->conf['listView.']['headDataWrap1.'] );\n\n\t\t$items[] = $this->cObj->stdWrap ( implode( chr ( 10 ),$listItems ), $this->conf['listView.']['headWrap.'] );\n\n\t\t// Make list table rows\n\t\t$i = 1;\n\t\twhile($this->internal[\"currentRow\"] = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\tif ( $i % 2 ){\n\t\t\t\t$items[]=$this->makeListItem( 'rowWrap1.' );\n\t\t\t}else{\n\t\t\t\t$items[]=$this->makeListItem( 'rowWrap2.' );\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\n\t\t$out = sprintf ('\n\t\t<div%s>\n\t\t\t%s\n\t\t</div>',\n\t\t\t$this->pi_classParam ( 'listrow' ),\n\t\t\t$this->cObj->stdWrap ( implode( chr ( 10 ),$items ), $this->conf['listView.']['resultWrap.'] )\n\t\t);\n\t\treturn $out;\n\t}", "function ll_makelist($ll_infolinks, $widgetname){\n\techo '<nav class=\"' . $widgetname .'\"><ul class=\"liblinks-list ' . $widgetname .'\">';\n\tforeach ($ll_infolinks as $linktitle => $linkhref) {\n\t\techo '<li><a href=\"' . $linkhref . '\">' . $linktitle . '</a></li>';\n }\n echo '</ul></nav>';\n}", "public function render()\n {\n foreach ($this->arrayList as $item)\n {\n $this->render .= $item->render();\n }\n return $this->render;\n }", "protected function _listing($type, $list, $attr = array())\n\t{\n\t\t$html = '';\n\n\t\tif (count($list) == 0) return $html;\n\n\t\t// Essentially we will just spin through the list and build the list of the HTML\n\t\t// elements from the array. We will also handled nested lists in case that is\n\t\t// present in the array. Then we will build out the final listing elements.\n\t\tforeach ($list as $key => $value)\n\t\t{\n\t\t\t$html .= $this->_listing_element($key, $type, $value);\n\t\t}\n\n\t\t$attr = $this->attr($attr);\n\n\t\treturn \"<{$type}{$attr}>{$html}</{$type}>\";\n\t}", "function lista(array $nums)\n{\n\n\t$lista = \"Arreglo: \".implode(\", \",$nums);\n\t$lista.= \"<ul>\";\n\t$lista.= \"<br><li>Promedio: \".promedio($nums).\"</li>\"; \n\t$lista.= \"<br><li>Mediana: \".mediana($nums).\"</li>\";\n\tsort($nums); \n\t$lista.= \"<br><li>Menor a mayor: \".implode(\", \",$nums).\"</li>\";\n\trsort($nums); \n\t$lista.= \"<br><li>Mayor a menor: \".implode(\", \",$nums).\"</li>\";\n\t$lista.=\"</ul>\";\n\n\treturn $lista;\n\n}", "public function listDisplayElements();", "function drawList($items, $style = 'stream') {\n\t\t\t\t\tif (is_array($items) && !empty($items) && !empty($style)) {\n\t\t\t\t\t\t$t = new \\Bonita\\Templates($this);\n\t\t\t\t\t\t$t->items = $items;\n\t\t\t\t\t\treturn $t->draw('list/'. $style);\n\t\t\t\t\t}\n\t\t\t\t\treturn '';\n\t\t\t\t}", "public function arrayfromtags() {\n\t\t$item = array();\n\t\t// Find all article blocks\n\t\tforeach($this->_html->find('div#col_a') as $article) {\n\t\t\t$item['name'] = $article->find('strong', 0)->plaintext;\n\t\t\t$item['ville'] = $article->find('li.ville', 0)->plaintext;\n\t\t\t$item['adresse'] = $article->find('li.adresse', 0)->plaintext;\n\t\t\t$item['next'] = \"next\";\n\t\t}\n\t\t$articles[] = $item;\n\t\t//print_r($articles);\n\t\tforeach ($articles as $value) {\n\t\t\tarray_push($_SESSION['mail_list'], $value);\n\t\t}\n\t\t\n\t}", "function toHTML($array_name, $ident = 0, $mark=\"\"){\n static $s1;\n if (is_array($array_name)){\n $s1=$s1.'<ul class=\"level_'.$ident.'\">\n ';\n foreach ($array_name as $k => $v){\n if (is_array($v)){\n for ($i=0; $i < $ident; $i++){ $s1=$s1.$mark; }\n $s1=$s1.'<li class=\"level_'.$ident.'_'.$ident.'\">'.$k .'</li>'. \" \" . \"\n \";\n $this->toHTML($v, $ident + 1, $mark);\n // $s=$s.'AFTERM';\n }else{\n for ($i=0; $i < $ident; $i++){$s1=$s1.$mark; }\n $s1=$s1.'<li class=\"level_'.$ident.'_'.$ident.' \">'.$k . \"</li>\n \" . $v .\"\";\n }\n }\n $s1=$s1.'</ul>\n ';\n }else{\n $s1=$s1.\"Error = \" . $array_name;\n }\n return $s1;\n }", "public function links_list() {\n\t\t$str = \"\";\n\n\t\tforeach ($this->def_json[\"links\"] as $link) {\n\t\t\t$str .= Builder::root(\"li\", NULL,\n\t\t\t\tBuilder::child(\"a\", array(\"href\" => $link[\"url\"]), $link[\"title\"])\n\t\t\t)->saveHTML();\n\t\t}\n\n\t\treturn $str;\n\t}", "static function createJSList()\n {\n $result=\"\";\n if(!empty(self::$arr_js_list))\n foreach (self::$arr_js_list as $js_file => $file_location)\n {\n if ($file_location == \"common\")\n $result.='<script type=\"text/javascript\" src=\"js/'.$js_file.'.js\"> </script>';\n elseif ($file_location == \"component\")\n $result.='<script type=\"text/javascript\" src=\"components/'.$js_file.'/js/'.$js_file.'.js\"> </script>';\n }\n\n self::putData(\"js_list\",$result,\"L\");\n self::$js_list = $result;\n }", "public function getHTML(){\n\t\t\n\t\t//Doctype/head elements\n\t\t$html\t =\t\"<!DOCTYPE html><head><title>Example!</title></head><body>\";\n\t\t$html\t.=\t\"<ul>\";\n\t\t\n\t\t//Adds list of usernames\n\t\tforeach($this->userData as $user){\n\t\t\t\n\t\t\t$html\t.=\t\"<li>\" . $user['Username'] . \"</li>\";\n\t\t}\n\t\t\n\t\t//Closing the document\n\t\t$html\t.=\t\"</ul></body></hmtml>\";\n\t\t\n\t\t//Return HTML to controller\n\t\treturn($html);\n\t}", "public function toHtml() {\n\t\techo '<ol '.$this->getAttributes().'>'.$this->renderChildren().'</ol>';\n\t}", "function _JSgenerateArrayTodos(){\n\t\t\t\tglobal $AppUI;\n\t\t\t\t$strJS = \"var arTodos = new Array();\\n\";\n\t\t\t\t\n\t\t\t\tif($this->Todos()){ \n\t\t\t\t\tforeach($this->Todos() as $rTodo){\n\t\t\t\t\t\t$desc = str_replace(\"\\\"\",\" \",$rTodo[\"description\"]);\n\t\t\t\t\t\t$descp = substr($desc,0,25);\n\n\t\t\t\t\t\t$strJS .= \"arTodos[arTodos.length] = new Array({$rTodo[\"project_id\"]}, {$rTodo[\"id_todo\"]}, \\\"\".$descp.\"\\\");\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $strJS;\n\t\t\t}", "private static function listing($type, $list, $attributes = array()) {\n\t\t$html = '';\n\n\t\tif (count($list) == 0) return $html;\n\n\t\tforeach ($list as $key => $value) {\n\t\t\t// If the value is an array, we will recurse the function so that we can\n\t\t\t// produce a nested list within the list being built. Of course, nested\n\t\t\t// lists may exist within nested lists, etc.\n\t\t\tif (is_array($value)) {\n\t\t\t\tif (is_int($key)) {\n\t\t\t\t\t$html .= static::listing($type, $value);\n\t\t\t\t} else {\n\t\t\t\t\t$html .= '<li>'.$key.static::listing($type, $value).'</li>';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$html .= '<li>'.static::entities($value).'</li>';\n\t\t\t}\n\t\t}\n\n\t\treturn '<'.$type.static::attributes($attributes).'>'.$html.'</'.$type.'>';\n\t}", "function buildImageDisplay($imageArray)\n{\n $id = '<ul id=\"image-display\">';\n foreach ($imageArray as $image) {\n $id .= '<li>';\n $id .= \"<img src='$image[imgPath]' title='$image[invMake] $image[invModel] image on PHP Motors.com' alt='$image[invMake] $image[invModel] image on PHP Motors.com'>\";\n $id .= \"<p><a href='/phpmotors/uploads?action=delete&imgId=$image[imgId]&filename=$image[imgName]' title='Delete the image'>Delete $image[imgName]</a></p>\";\n $id .= '</li>';\n }\n $id .= '</ul>';\n return $id;\n}", "public function listDisplayElements()\n {\n $elements = parent::listDisplayElements();\n $items = array(\n 'greRegistrationNumber' => 'GRE Registration Number',\n 'greDepartmentName' => 'GRE Department Name',\n 'greTestDate' => 'GRE Test Date',\n 'greTestName' => 'GRE Test Name',\n 'greScore1' => 'GRE Score 1',\n 'greScore2' => 'GRE Score 2',\n 'greScore3' => 'GRE Score 3',\n 'greScore4' => 'GRE Score 4',\n 'toeflRegistrationNumber' => 'TOEFL Registration Number',\n 'toeflNativeCountry' => 'TOEFL Native Country',\n 'toeflNativeLanguage' => 'TOEFL Native Language',\n 'toeflTestDate' => 'TOEFL Test Date',\n 'toeflTestType' => 'TOEFL Test Type',\n 'toeflListening' => 'TOEFL Listening',\n 'toeflWriting' => 'TOEFL Writing',\n 'toeflReading' => 'TOEFL Reading',\n 'toeflEssay' => 'TOEFL Essay',\n 'toeflTotal' => 'TOEFL Total'\n );\n $weight = count($elements);\n foreach($items as $name => $title){\n $elements[] = new \\Jazzee\\Display\\Element('page', $title, $weight++, $name, $this->_applicationPage->getPage()->getId());\n }\n\n return $elements;\n }", "function selectListArray($name,$array,$curr_id,$script=\"\",$empty_option=0) {\n\n\t\t$output\t\t = \"<select name=\\\"$name\\\" id=\\\"$name\\\" $script>\\n\";\n if ($empty_option) $output\t\t.= \"<option></option>\\n\";\n\n\t\tforeach ($array as $key=>$val) {\n\t\t\t$output .= \"<option value=\\\"\".$key.\"\\\" \".\n\t\t\t(($curr_id == $key)?\"selected\":\"\").\">\".$val.\"</option>\\n\";\n\t\t}\n\n\t\t$output .= \"</SELECT>\\n\";\n\n\t\treturn $output;\n\t}", "public function toList() : string\n {\n return implode(\"\\n\", $this->all());\n }", "function formatListItem($array,$type,$i,$special='',$gilder='') {\n\t$itemArray = $array[$i];\n\t\n\tif(isset($itemArray['class']) && !is_array($itemArray['class'])) $itemArray['class'] = array($itemArray['class']);\n\t\n\tif($i==0) {\n\t\t$itemArray['class'][] = 'fli';\n\t}\n\tif($i==(count($array)-1)) {\n\t\t$itemArray['class'][] = 'lli';\n\t}\n\tif(!isEven($i)) $itemArray['class'][] = 'even';\n\t\n\t$extraneous_span = '';\n\tif((!empty($gilder) && $gilder==true) || (!empty($itemArray['gilder']) && $itemArray['gilder']==true)) {\n\t\t$extraneous_span = '<span class=\"gl-ir\"></span>';\n\t\t//$itemArray['class'][] = 'gl-ir';\n\t}\n\t\n\t$anchor_class = array();\n\tif(!empty($itemArray['anchor-class'])) {\n\t\tif(!is_array($itemArray['anchor-class'])) $itemArray['anchor-class'] = array($itemArray['anchor-class']);\n\t\t$anchor_class = array_merge($itemArray['anchor-class'],$anchor_class);\n\t}\n\tif($special=='hfeed') {\n\t\t// add class 'hentry' to the li\n\t\t// add class 'entry-title' to the anchor \n\t\t// add rel permalink to the anchor\n\t\t$anchor_class[] = 'entry-title';\n\t\t$itemArray['class'][] = 'hentry';\n\t\t\n\t\tif(empty($itemArray['rel'])) $itemArray['rel'] = array();\n\t\tif(!empty($itemArray['rel']) && !is_array($itemArray['rel'])) $itemArray['rel'] = array($itemArray['rel']);\n\t\tif(!in_array('permalink',$itemArray['rel'])) {\n\t\t\t$itemArray['rel'][] = 'permalink';\n\t\t}\n\t}\n\t\n\tif(strtolower($type)=='dt' && !empty($itemArray['class'])) {\n\t\tif(!is_array($itemArray['class'])) $itemArray['class'] = array($itemArray['class']);\n\t\tfor($i=0; $i<count($itemArray['class']); $i++) {\n\t\t\tif(strtolower($itemArray['class'][$i])=='role') {\n\t\t\t\t$itemArray['class'][] = 'vcard_'.$itemArray['class'][$i];\n\t\t\t\tunset($itemArray['class'][$i]);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$text = $itemArray['text'];\n\tif(!preg_match('/<[^<^>]+>/',$text)) $text = formatText($text); // if the text DOESN'T contain HTML, format it.\n\t\n\t$sub = '';\n\tif(!empty($itemArray['sub']) && is_array($itemArray['sub'])) $sub = \"\\n\".createList($itemArray['sub'],'','sub');\n\t\n\tif(!empty($itemArray['link'])) {\n\t\t$list = '<'.$type.addAttributes('',@$itemArray['id'],@$itemArray['class']).'><a href=\"'.$itemArray['link'].'\"'.addAttributes(@$itemArray['title'],'',$anchor_class,@$itemArray['xfn'],@$itemArray['rel'],@$itemArray['accesskey'],@$itemArray['tabindex'],'','',@$itemArray['mime']).'>'.$extraneous_span.$text.'</a>'.$sub.'</'.$type.'>';\n\t}\n\telse {\n\t\t$list = '<'.$type.addAttributes(@$itemArray['title'],@$itemArray['id'],@$itemArray['class']).'>'.$extraneous_span.$text.$sub.'</'.$type.'>';\n\t}\n\t\n\treturn ' '.$list.\"\\n\";\n}", "public function treeUl($list) {\n $output = '';\n if (is_array($list) || $list instanceof Iterator) {\n if (count($list) > 0) {\n $output = \"<ul>\\n\";\n foreach ($list as $item) {\n $output .= \"\\t<li>\";\n if(is_string($item)) {\n $output .= $this->_view->escape($item);\n } else {\n $output .= $this->treeUl($item);\n }\n $output .= \"</li>\\n\";\n }\n $output .= \"</ul>\\n\";\n }\n }\n return $output;\n }", "function ul(array $list, $attributes = ''): string\n {\n return _list('ul', $list, $attributes);\n }", "function present_list($attr)\n{\n if (is_array($attr) && count($attr) > 1) {\n $str = '<ul>';\n foreach ($attr as $value) {\n $str .= '<li>'.htmlspecialchars($attr).'</li>';\n }\n $str .= '</ul>';\n return $str;\n } else {\n return htmlspecialchars($attr[0]);\n }\n}", "public function convertArray(array $list){\n $o = $this->getHeader();\n if (count($list) > 0){\n foreach($list as $key => $value){\n \t$o .= \"<entry>\\n\";\n \t$o .= \"\\t<form>\\n\";\n\t$o .= \"\\t\\t<orth>\\n\";\n\t$infinitive = $value['infinitive'][0];\n\t$o .= \"\\t\\t\\t$infinitive\\n\";\n\t$o .= \"\\t\\t</orth>\\n\";\n\t$o .= \"\\t\\t<model>\\n\";\n\t$model = $value['model'];\n\t$o .= \"\\t\\t\\t$model\\n\";\n\t$o .= \"\\t\\t</model>\\n\";\n $o .= $this->convertConjugation($value);\n\t$o .= \"\\t</form>\\n\";\n \t$o .= \"</entry>\\n\";\n } // for\n } // if\n\n $o .= $this->getFooter();\n $this->createDownloadFile($o);\t \n }", "public function provideListAndListItemTests() {\n $result = [\n [[\n 'descr' => \"[list] and [*] should produce an unordered list.\",\n 'bbcode' => \"[list][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ul class=\\\"bbcode_list\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ul>\\n\",\n ]],\n [[\n 'descr' => \"[list] and [*] should produce an unordered list even without [/list].\",\n 'bbcode' => \"[list][*]One Box[*]Two Boxes[*]Three Boxes\",\n 'html' => \"\\n<ul class=\\\"bbcode_list\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ul>\\n\",\n ]],\n [[\n 'descr' => \"[list=circle] should produce an unordered list.\",\n 'bbcode' => \"[list=circle][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ul class=\\\"bbcode_list\\\" style=\\\"list-style-type:circle\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ul>\\n\",\n ]],\n [[\n 'descr' => \"[list=disc] should produce an unordered list.\",\n 'bbcode' => \"[list=disc][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ul class=\\\"bbcode_list\\\" style=\\\"list-style-type:disc\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ul>\\n\",\n ]],\n [[\n 'descr' => \"[list=square] should produce an unordered list.\",\n 'bbcode' => \"[list=square][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ul class=\\\"bbcode_list\\\" style=\\\"list-style-type:square\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ul>\\n\",\n ]],\n [[\n 'descr' => \"[list=1] should produce an ordered list.\",\n 'bbcode' => \"[list=1][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ol class=\\\"bbcode_list\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ol>\\n\",\n ]],\n [[\n 'descr' => \"[list=A] should produce an ordered list.\",\n 'bbcode' => \"[list=A][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ol class=\\\"bbcode_list\\\" style=\\\"list-style-type:upper-alpha\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ol>\\n\",\n ]],\n [[\n 'descr' => \"[list=a] should produce an ordered list.\",\n 'bbcode' => \"[list=a][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ol class=\\\"bbcode_list\\\" style=\\\"list-style-type:lower-alpha\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ol>\\n\",\n ]],\n [[\n 'descr' => \"[list=I] should produce an ordered list.\",\n 'bbcode' => \"[list=I][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ol class=\\\"bbcode_list\\\" style=\\\"list-style-type:upper-roman\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ol>\\n\",\n ]],\n [[\n 'descr' => \"[list=i] should produce an ordered list.\",\n 'bbcode' => \"[list=i][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ol class=\\\"bbcode_list\\\" style=\\\"list-style-type:lower-roman\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ol>\\n\",\n ]],\n [[\n 'descr' => \"[list=greek] should produce an ordered list.\",\n 'bbcode' => \"[list=greek][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ol class=\\\"bbcode_list\\\" style=\\\"list-style-type:lower-greek\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ol>\\n\",\n ]],\n [[\n 'descr' => \"[list=georgian] should produce an ordered list.\",\n 'bbcode' => \"[list=georgian][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ol class=\\\"bbcode_list\\\" style=\\\"list-style-type:georgian\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ol>\\n\",\n ]],\n [[\n 'descr' => \"[list=armenian] should produce an ordered list.\",\n 'bbcode' => \"[list=armenian][*]One Box[*]Two Boxes[*]Three Boxes[/list]\",\n 'html' => \"\\n<ol class=\\\"bbcode_list\\\" style=\\\"list-style-type:armenian\\\">\\n<li>One Box</li>\\n<li>Two Boxes</li>\\n<li>Three Boxes</li>\\n</ol>\\n\",\n ]],\n ];\n return $result;\n }", "function demos_convert_list() {\n return array(\n 'item1' => t('Item1'),\n 'item2' => t('Item2'),\n 'description' => t('Description'),\n );\n}", "private function build_list($list, $level=0)\n\t{\n\t\t$list_html = '<' . ( (isset($this->types[$level]))?$this->types[$level]:end($this->types) ) . '>';\n\t\t\n\t\tforeach($list as $item)\n\t\t{\n\t\t\tif(!is_array($item))\n\t\t\t\t$list_html .= \"<li>$item\";\n\t\t\t\n\t\t\tif(is_array($item))\n\t\t\t\t$list_html .= $this->build_list($item, $level+1);\n\t\t\t\n\t\t\tif(!is_array($item))\n\t\t\t\t$list_html .= '</li>';\n\t\t}\n\t\t\n\t\t$list_html .= '</' . ( (isset($this->types[$level]))?$this->types[$level]:end($this->types) ) . '>';\n\n\t\treturn $list_html;\n\t}", "function exam_list() {\n \n //$vNumberOfColumns = 4;\n \n $vContent = t(ExamInstance::getListingOfExams());\n \n return $vContent;\n \n //foreach ($links as $link) {\n // $items[] = l($link['title'], $link['href'], $item['localized_options'])\n // . ': ' . filter_xss_admin($link['description']);\n //}\n\n //return theme('item_list', array('items' => $items));\n \n}", "protected function createRenderArray(array $result) {\n $items = [];\n foreach ($result as $id => $row) {\n\n $items[$id] = [\n 'vsite_name' => [\n '#type' => 'link',\n '#url' => Url::fromUri($row['vsite_url'], ['absolute' => TRUE]),\n '#title' => $row['vsite_name'],\n '#attributes' => [\n 'class' => 'lynx-title',\n ],\n ],\n 'vsite_description' => [\n '#markup' => '<div class=\"meta-description\">' . $row['vsite_description'] . '</div>',\n ],\n 'content_type' => [\n '#markup' => '<div class=\"content-type\">' . $row['content_type'] . '</div>',\n ],\n 'title' => [\n '#prefix' => '<h2 class=\"node--title\">',\n '#type' => 'link',\n '#url' => Url::fromUri($row['url'], ['absolute' => TRUE]),\n '#title' => $row['title'],\n '#suffix' => '</h2>',\n ],\n 'body' => [\n '#markup' => '<div class=\"body\">' . Unicode::truncate($row['body'], 128, TRUE, TRUE) . '</div>',\n ],\n 'see_more' => [\n '#type' => 'link',\n '#url' => Url::fromUri($row['url'], ['absolute' => TRUE]),\n '#title' => $this->t('Read more'),\n ],\n ];\n if ($row['vsite_logo']) {\n $image = [\n '#theme' => 'image',\n '#uri' => $row['vsite_logo'],\n '#alt' => $row['vsite_name'],\n '#weight' => -1,\n ];\n $items[$id]['vsite_logo'] = [\n '#type' => 'link',\n '#url' => Url::fromUri($row['vsite_url'], ['absolute' => TRUE]),\n '#title' => $image,\n '#weight' => -2,\n ];\n }\n }\n\n $build['search_results'] = [\n '#title' => $this->t('Search'),\n 'content' => [\n '#theme' => 'item_list__search_results',\n '#items' => $items,\n '#empty' => [\n '#markup' => '<h3>' . $this->t('Your search yielded no results.') . '</h3>',\n ],\n '#type' => 'remote',\n '#attributes' => [\n 'class' => ['lynx-search-listing'],\n ],\n ],\n ];\n return $build;\n }", "function _list( $type = 'ul', $list = [ ], $attributes = '', $depth = 0 )\n\t{\n\t\t// If an array wasn't submitted there's nothing to do...\n\t\tif ( ! is_array( $list ) )\n\t\t{\n\t\t\treturn $list;\n\t\t}\n\n\t\t// Set the indentation based on the depth\n\t\t$out = str_repeat( ' ', $depth )\n\t\t\t// Write the opening list tag\n\t\t\t. '<' . $type . _stringify_attributes( $attributes ) . \">\\n\";\n\n\n\t\t// Cycle through the list elements. If an array is\n\t\t// encountered we will recursively call _list()\n\n\t\tstatic $_last_list_item = '';\n\t\tforeach ( $list as $key => $val )\n\t\t{\n\t\t\t$_last_list_item = $key;\n\n\t\t\t$out .= str_repeat( ' ', $depth + 2 ) . '<li>';\n\n\t\t\tif ( ! is_array( $val ) )\n\t\t\t{\n\t\t\t\t$out .= $val;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$out .= $_last_list_item . \"\\n\" . _list( $type, $val, '', $depth + 4 ) . str_repeat( ' ', $depth + 2 );\n\t\t\t}\n\n\t\t\t$out .= \"</li>\\n\";\n\t\t}\n\n\t\t// Set the indentation for the closing tag and apply it\n\t\treturn $out . str_repeat( ' ', $depth ) . '</' . $type . \">\\n\";\n\t}", "protected function getHtml( $data = [] ) {\n\t\t$html = '';\n\t\t$html .= Html::openElement( 'div', [ 'class' => 'content gather-lists' ] );\n\t\t// Display protocol for hiding another users list\n\t\tif ( $data['canHide'] ) {\n\t\t\t$html .= Html::rawElement( 'div', [ 'class' => 'hide-protocol' ],\n\t\t\t\twfMessage( 'gather-lists-hide-protocol' )->parse() );\n\t\t}\n\t\t$html .= Html::openElement( 'ul', [] );\n\t\t$html .= Html::openElement( 'li', [ 'class' => 'heading' ] )\n\t\t. Html::element( 'span', [], wfMessage( 'gather-lists-collection-title' ) )\n\t\t. Html::element( 'span', [], wfMessage( 'gather-lists-collection-description' ) )\n\t\t. Html::element( 'span', [], wfMessage( 'gather-lists-collection-count' ) )\n\t\t. Html::element( 'span', [], wfMessage( 'gather-lists-collection-owner' ) )\n\t\t. Html::element( 'span', [], wfMessage( 'gather-lists-collection-last-updated' ) );\n\t\tif ( $data['canHide'] ) {\n\t\t\t$html .= Html::element( 'span', [], '' );\n\t\t}\n\t\t$html .= Html::closeElement( 'li' );\n\t\tforeach ( $this->collectionList as $collection ) {\n\t\t\t$partial = new ReportTableRow( $this->user, $this->language, $collection );\n\t\t\t$html .= $partial->getHtml( $data );\n\t\t}\n\t\t$html .= Html::closeElement( 'ul' );\n\t\tif ( $data['nextPageUrl'] ) {\n\t\t\t$html .= Pagination::more(\n\t\t\t\t$data['nextPageUrl'], wfMessage( 'gather-lists-collection-more-link-label' ) );\n\t\t}\n\t\t$html .= Html::closeElement( 'div' );\n\t\treturn $html;\n\t}", "public function generateInList(array $array);", "public function GerarLista(){\n\t\t\t//$list= $ob -> ListarProdutosMaisBuscados();\n\t\t\t//$n = count($list);\n\t\t\t\n\t\t\t$ob = new produtoDAO;\n\t\t\t$m= $ob -> ListarProdutosMaisBuscados();\n\t\t\t$num = count($m);\n\t\t\t\t\t//$ob = new produtoDAO();\n\t\t\t\t\t//$m= $ob -> ListarProdutosMaisBuscados();\n\t\t\t\t\t//$n = count($m);\n\t\t\t\t\techo '<ul id=\"screen\">';\n\t\t\t\t\t//criando setinhas esquerda\n\t\t\t\t\techo '<li>';\n\t\t\t\t\techo '<a id=\"left\" class=\"seta\" href=\"#\">&lt;&lt</a>';\n\t\t\t\t\techo '</li>';\n\t\t\t\t\techo '<li id=\"view\">';\n\t\t\t\t\techo '<ul id=\"images\">';\n\t\t\t\t\t//lista que tem as imagens\n\t\t\t\t\tfor($i=0;$i<$num;$i++){\n\t\t\t\t\t\t\t//$m[$i]['id_produto'];\n\t\t\t\t\t\t\t//abrindo a tela\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\techo '<li>';\n\t\t\t\t\t\t\techo '<div class=\"jq-ss-crop\" style=\"overflow: hidden; height: 300px; width: 212.5px;\">';\n\t\t\t\t\t\t\techo '<a target=\"_blank\" class=\"jq-ss-link\">'; \n\t\t\t\t\t\t\techo '<p class=\"preco\"> R$' . number_format($m[$i]['preco'], 2, ',', '.'). '</p>';\n\t\t\t\t\t\t\techo '<img src=\"miniaturas/'.$m[$i]['id_produto'].'\" class=\"imgMiniatura\"/>';\n\t\t\t\t\t\t\techo '<a class=\"nome\" href=\"paginas.php?acao=telaProd&id='.$m[$i]['id_produto'].'&nome='.$m[$i]['nome'].'\">' .$m[$i]['nome']. '</a>';\n\t\t\t\t\t\t\techo '</a>';\n\t\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\t\techo '</li>';\n\t\t\t\t\t\t}\n\t\t\t\t\t//fechando a tela\n\t\t\t\t\t//setinhas lado direito\n\n\t\t\t\t\techo '</ul>';\n\t\t\t\t\techo '</li>';\n\t\t\t\t\techo '<li>';\n\t\t\t\t\techo '<a id=\"right\" class=\"seta\" href=\"#\">&gt;&gt</a>';\n\t\t\t\t\techo '</li>';\n\t\t\t\t\techo '</ul>';\n\t\t}", "public function getRollAsImageList()\n {\n $html = \"<ul class='dice'>\";\n $html .= \"<li class='dice-{$this->value}'></li>\";\n $html .= \"</ul>\";\n return $html;\n }", "public function addUl (array $list = array (), $attr = FALSE)\n\t{\n\t\treturn static ::build_list('ul', $list, $attr);\n\t}", "private static function htmllist(array $options, array $attributes=array())\r\n {\r\n return JHTML::_('select.genericlist', $options, self::getKey('name', $attributes, uniqid('select-')), self::getKey('attributes', $attributes, ''), 'value', 'text', self::getKey('selected', $attributes));\r\n }", "public static function htmlUl ($array, $parentTabLevel = 0, $className = NULL, $ignoreEmpty = true, $sanitise = false, $nl2br = false, $liClass = false, $selected = false)\r\n\t{\r\n\t\t# Return an empty string if no items\r\n\t\tif (!is_array ($array) || empty ($array)) {return '';}\r\n\t\t\r\n\t\t# Prepare the tab string\r\n\t\t$tabs = str_repeat (\"\\t\", ($parentTabLevel));\r\n\t\t\r\n\t\t# Build the list\r\n\t\t$html = \"\\n$tabs<ul\" . ($className ? \" class=\\\"{$className}\\\"\" : '') . '>';\r\n\t\tforeach ($array as $key => $item) {\r\n\t\t\t\r\n\t\t\t# Skip an item if the item is empty and the flag is set to ignore these\r\n\t\t\tif (($ignoreEmpty) && (empty ($item))) {continue;}\r\n\t\t\t\r\n\t\t\t# Add the item to the HTML\r\n\t\t\tif ($sanitise) {$item = htmlspecialchars ($item);}\r\n\t\t\tif ($nl2br) {$item = nl2br ($item);}\r\n\t\t\t\r\n\t\t\t# Determine a class\r\n\t\t\t$class = array ();\r\n\t\t\tif ($selected !== false && ($selected == $key)) {$class[] = 'selected';}\t// !== is used so that it can match the empty string\r\n\t\t\tif ($liClass) {\r\n\t\t\t\t$class[] = ($liClass === true ? $key : $liClass);\r\n\t\t\t}\r\n\t\t\t$class = ($class ? ' class=\"' . implode (' ', $class) . '\"' : '');\r\n\t\t\t\r\n\t\t\t# Assign the HTML\r\n\t\t\t$html .= \"\\n$tabs\\t<li\" . $class . '>' . $item . '</li>';\r\n\t\t}\r\n\t\t$html .= \"\\n$tabs</ul>\";\r\n\t\t\r\n\t\t# Return the result\r\n\t\treturn $html;\r\n\t}", "public static function htmlList(array $elements, $recursive = false)\n {\n static $level = 0;\n \n $output = \"<ul class='level_{$level}'>\";\n \n foreach ($elements as $element)\n {\n if(is_array($element) && !empty($element))\n {\n $level++;\n $output .= self::htmlList($element, $recursive);\n }\n else\n $output .= \"<li class='level_{$level}'>{$element}</li>\";\n }\n return $output .= '</ul>';\n }", "function renderNavigation(array $array)\n {\n $html = '';\n\n foreach ( $array as $item=>$attributes){\n\n // Set the title of the navigation point\n $title = (isset($attributes['title']) ? $attributes['title'] : $item );\n\n // if a icon is passed to the array a icon tag will be created\n $icon = (isset($attributes['icon']) ? sprintf('<i class=\"%s\"></i>',$attributes['icon']) : null );\n // pass together the whole anchor tag\n $anchor = sprintf('<a href=\"%s\">%s%s</a>',$attributes['url'],$icon,$title);\n\n // Check if there is a submenu. If Yes, run that itself through this macro\n $submenu = (isset($attributes['sub-menu']) ? sprintf('<ul class=\"sub-menu\">%s</ul>',renderNavigation($attributes['sub-menu'])) : null );\n\n // Check for the current URL if it matches any Anchors\n $class = '';\n if(strstr(Request::fullUrl(),$attributes['url']))\n $class = 'class=\"on\"';\n\n // and wrap it into the listitem\n $html .= sprintf('<li %s>%s%s</li>',$class,$anchor,$submenu);\n\n }\n\n // Pass back the entire navigation list\n return $html;\n }", "function buildImageDisplay($imageArray) {\r\n $id = '<ul id=\"image-display\">';\r\n foreach ($imageArray as $image) {\r\n $id .= '<li>';\r\n $id .= \"<img src='$image[imgPath]' title='$image[invMake] $image[invModel] image on PHP Motors.com' alt='$image[invMake] $image[invModel] image on PHP Motors.com'>\";\r\n $id .= \"<p><a href='/phpmotors/uploads?action=delete&imgId=$image[imgId]&filename=$image[imgName]' title='Delete the image'>Delete $image[imgName]</a></p>\";\r\n $id .= '</li>';\r\n }\r\n $id .= '</ul>';\r\n return $id;\r\n }", "public function list();", "public function list();", "public function list();", "public function build()\n {\n\n if ($this->html)\n return $this->html;\n\n if (count($this->data) == 0) {\n $this->html .= '<ul id=\"'.$this->id.'\" class=\"wgt_tree\" >'.NL;\n $this->html .= '</ul>'.NL;\n\n return $this->html;\n }\n\n $html = '';\n\n $html .= '<ul id=\"'.$this->id.'\" class=\"wgt_tree\" >'.NL;\n\n\n foreach ($this->data as $id => $row) {\n\n $entry = $this->buildTreeNode($row);\n\n $html .= <<<HTML\n<li id=\"{$this->id}_{$id}\" >\n\n {$entry}\n <ul id=\"{$this->id}_{$id}_tree\" ></ul>\n\n</li>\n\nHTML;\n\n\n }\n\n $html .= '</ul>'.NL;\n\n\n $this->html = $html;\n\n return $this->html;\n\n }", "public static function arrayToLi($innerHtml)\r\n {\r\n if (is_array($innerHtml))\r\n {\r\n foreach ($innerHtml as $value => $text)\r\n {\r\n if (is_scalar($text))\r\n {\r\n $innerHtml[$value] = new \\View\\Li(\\NULL, $text);\r\n }\r\n }\r\n }\r\n\r\n return $innerHtml;\r\n }", "function makeListItems($list, $name=null, $extra=false)\n{\n $list_items = '';\n foreach ( $list as $item ) {\n // Prepare values\n $list_item = htmlspecialchars($item->getName());\n if ( method_exists($item, 'getUrl') ) {\n $url = $item->getUrl();\n if ( !empty($url) ) {\n $list_item = \"<a href=\\\"{$url}\\\">{$list_item}</a>\\n\";\n }\n }\n // Make the li\n $list_items .= <<<LI\n <li>\n {$list_item}\n </li>\n\nLI;\n }\n return $list_items;\n}", "public function list(): array\n {\n \n }", "function _build_submitted_list($submitted_entries_data, $submitted_entries_order) {\n\t\t$data = \"<ul id=\\\"bwf_acc_entry_list\\\">\\n\";\n\t\t\n\t\t$i = 1;\n\t\t$j = 1;\n\t\t\n\t\tforeach ($submitted_entries_order as $key=>$value)\n\t\t{\n\t\t\t// We only want the first nine records\n\t\t\tif($j < 10)\n\t\t\t{\n\t\t\t\t$edit_url = BASE.AMP.'C=content_publish'.AMP.'M=entry_form'.AMP.'channel_id='.$submitted_entries_data[$key]['channel_id'].AMP.'entry_id='.$submitted_entries_data[$key]['entry_id'];\n\n\t\t\t\tif($i == 1) {\n\t\t\t\t\t$data .= \"<li class=\\\"bwf_acc_first \";\n\t\t\t\t} elseif ($i == 3) {\n\t\t\t\t\t$data .= \"<li class=\\\"bwf_acc_last \";\n\t\t\t\t} else {\n\t\t\t\t\t$data .= \"<li class=\\\"\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($submitted_entries_data[$key]['type'] == 'entry') {\n\t\t\t\t\t$data .= \"bwf_acc_status_submitted\\\">\\n\";\n\t\t\t\t} else {\n\t\t\t\t\t$data .= \"bwf_acc_status_open_submitted\\\">\\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$data .= \"<a href=\".$edit_url.\">\";\n\t\t\t\t\t$data .= \"<p>\".$submitted_entries_data[$key]['title'].\"</p>\\n\";\n\t\t\t\t\t$data .= \"<ul class=\\\"bwf_acc_metadata\\\">\\n\";\n\t\t\t\t\t\t$data .= \"<li>\".$this->EE->ep_approval_list->get_channel_name($submitted_entries_data[$key]['channel_id']).\"</li>\\n\";\n\t\t\t\t\t\t$data .= \"<li>\".$this->EE->ep_approval_list->get_author_name($submitted_entries_data[$key]['author_id']).\"</li>\\n\";\n\t\t\t\t\t\t$data .= \"<li class=\\\"bwf_acc_metadata_last\\\">Last edited: \".gmdate('F jS Y', $submitted_entries_data[$key]['edit_date']).\"</li>\\n\";\n\t\t\t\t\t$data .= \"</ul>\\n\";\n\t\t\t\t$data .= \"</a></li>\\n\";\n\t\t\t}\n\n\t\t\tif($i == 3) { \n\t\t\t\t$i = 1; \n\t\t\t} else { \n\t\t\t\t$i++; \n\t\t\t}\n\t\t\t$j++;\n\t\t}\n\t\t\n\t\t$data .= \"</ul>\\n\";\n\t\t$data .= \"<p><a href=\\\"\".BASE.AMP.\"C=content_edit\\\">See all entries</a></p>\";\n\t\t\n\t\treturn $data;\n\t\t\n\t}", "function makelist($res)\t{\r\n\t\t$items=\"\";\r\n\t\t$counter = $this->internal['res_count'];\r\n\t\twhile($this->internal['currentRow'] = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\r\n\t\t\t$items .= $this->makeListItem($counter);\r\n\t\t\t$counter--;\r\n\t\t}\r\n\r\n\t\t$subpartArray = array();\r\n\t\t$subpartArray[\"###LIST_TABLE_ROW###\"] = $items;\r\n\t\t$out = $this->cObj->substituteMarkerArrayCached($this->templates[\"list_table\"], array(), $subpartArray, array());\r\n\t\treturn $out;\r\n\t}", "public function getHtml() {\n if (!$this->hasItems()) {\n return '';\n }\n\n $html = '<ul' . $this->getIdHtml() . $this->getClassHtml() . $this->getAttributesHtml() . '>';\n foreach ($this->items as $item) {\n if ($item === self::SEPARATOR) {\n $html .= '<li class=\"separator\"></li>';\n continue;\n }\n\n $item->setBaseUrl($this->baseUrl);\n\n if ($item instanceof self) {\n if ($item->hasItems()) {\n $html .= '<li class=\"menu\"><a href=\"#\" class=\"menu\">' . $item->getLabel() . '</a>' . $item->getHtml() . '</li>';\n }\n } else {\n $html .= $item->getHtml();\n }\n }\n $html .= '</ul>';\n\n return $html;\n }", "public function render()\n {\n $fromListTree = array();\n $this->getFromListTree($fromListTree);\n $style = $this->getStyle();\n $func = $this->getFunction();\n $valueList = array(); $valueArray = array();\n $this->getFromList($valueList, $this->getSelectedList());\n foreach ($valueList as $vl) {\n $valueArray[] = $vl['val'];\n }\n $sHTML = \"<script>\n \t\t\t\tvar \".$this->m_Name.\"_optlist = new Array(); \n \t\t\t\tvar \".$this->m_Name.\"_optlist_default = new Array();\n \t\t\t</script>\";\n $sHTML .= \"<div name=\\\"\" . $this->m_Name . \"\\\" ID=\\\"\" . $this->m_Name .\"\\\" $this->m_HTMLAttr $style>\";\n\t\t$sHTML .= \"<ul>\";\n\t\t$i = 0;\n foreach ($fromListTree as $treeNode)\n {\n\n //$sHTML .= \"<input type=\\\"checkbox\\\" name=\\\"\".$this->m_Name.\"[]\\\" VALUE=\\\"\" . $option['val'] . \"\\\" $selectedStr></input>\" . $option['txt'] . \"<br/>\";\n $sHTML .= \"<li style=\\\"padding-top:10px;\\\">\".str_repeat(\"-&nbsp;-&nbsp;\", $treeNode[\"level\"]).\"<strong>\".$treeNode['txt'].\"</strong>\".\"</li>\";\n $sublist = array();\n $this->getDOFromList($sublist, $this->getSelectFrom().\",[folder_id]='\".$treeNode['id'].\"'\");\n foreach($sublist as $option){\n $test = array_search($option['val'], $valueArray);\n\t if ($test === false)\n\t {\n\t $selectedStr = '';\n\t }\n\t else\n\t {\n\t $selectedStr = \"CHECKED\";\n\t $sHTML .= \"<script>\".$this->m_Name.\"_optlist_default.push('\".$this->m_Name.\"_\".$i.\"'); </script>\";\n\t } \t\n \t$sHTML .= \"<li><label style=\\\"float:none;color:#888888;display:inline;\\\">\".str_repeat(\"-&nbsp;-&nbsp;\", $treeNode[\"level\"]).\"<input type=\\\"checkbox\\\" id=\\\"\".$this->m_Name.\"_\".$i.\"\\\" name=\\\"\".$this->m_Name.\"[]\\\" VALUE=\\\"\" . $option['val'] . \"\\\" $selectedStr></input>\" . $option['txt'] . \"</label></li>\";\n \t$sHTML .= \"<script>\".$this->m_Name.\"_optlist.push('\".$this->m_Name.\"_\".$i.\"'); </script>\";\n \t$i++;\n }\n \n }\n $sHTML .= \"</ul></div>\";\n return $sHTML;\n }", "function createMenu($data, $htmlOptions = array()) {\r\n $this->htmlTree .= Html::beginTag('ul', $htmlOptions);\r\n foreach ($data as $item) {\r\n $this->htmlTree .= Html::beginTag('li') . Html::a($item['title'], $item['url']);\r\n if (isset($item['children']) AND !empty($item['children']))\r\n $this->createMenu($item['children']);\r\n $this->htmlTree .= Html::endTag('li');\r\n }\r\n $this->htmlTree .= Html::endTag('ul');\r\n return $this->htmlTree;\r\n }", "public function buildList(): array {\n $form_edit = \\Drupal::formBuilder()->getForm('Drupal\\deku\\Form\\EditForm');\n $form_delete = \\Drupal::formBuilder()->getForm('Drupal\\deku\\Form\\DeleteForm');\n return [\n '#theme' => 'cats-template',\n '#cats_list' => $this->getCatsData(),\n '#form_edit' => $form_edit,\n '#form_delete' => $form_delete,\n ];\n }", "function jslist(){\r\n\t\t//list all albums and put into a proper array\r\n\t\t$this->checkSessionAjax();\r\n\t\t$albums = $this->Album->findAll();\r\n\t\t$out = array();\r\n\t\t\r\n\t\tforeach($albums as $al){\r\n\t\t\t$al['Album']['extendname'] = $al['Album']['name'].\"(\".sizeof($al['Image']).\")\";\r\n\t\t\t$out[] = $al['Album'];\r\n\t\t}\r\n\t\t\r\n\t\t$ident = Array();\r\n\t\t$ident['identifier'] = \"name\";\r\n\t\t$ident['items'] = $out;\r\n\t\t\r\n\t\t$this->set('output',$ident);\r\n\t\t$this->render('json','ajax');\r\n\t}", "function components_list(){\n\n\t\t?><li data-type=\"test\" title=\"Sample Title\"></li><?php\n\t}", "static function renderUList(array $items, $attributes = null)\n {\n self::renderOpenTag('ul', $attributes);\n foreach($items as $item)\n {\n self::renderTag('li', null, $item);\n }\n echo '</ul>';\n }", "function loopListItems($content) {\n\tif (is_array($content)) {\n\t\tforeach ($content as $parent => $child) {\n\t\t\t$children = loopListItems($child);\n\n\t\t\t// Don't let array indexes print as their own array\n\t\t\tif (!is_numeric($parent)) {\n\t\t\t\t$result .= \"\n\t\t\t\t\t<li>{$parent}\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t{$children}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</li>\";\n\t\t\t} else {\n\t\t\t\t$result .= $children;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$result = \"<li>{$content}</li>\";\n\t}\n\n\treturn $result;\n}", "function render_subscriber_list($subscribers) {\n $s = '<ul>';\n foreach($subscribers as $row) {\n $name = \"<b>$row[name]</b>\";\n $email = \"email: $row[email]\";\n $s .= \"<li>$name - $email</li>\";\n }\n $s .= '</ul>';\n return $s;\n }", "protected function build_list ($type = 'ul', array $list = array (), $attr = FALSE, $indent = '')\n\t{\n\t\tif (!is_array($list)) {\n\t\t\t$result = FALSE;\n\t\t}\n\n\t\t$out = '';\n\t\tforeach ($list as $key => $val) {\n\t\t\tif (!is_array($val)) {\n\t\t\t\t$out .= $indent . \"\\t\" . html_tag('li', array (), $val) . PHP_EOL;\n\t\t\t} else {\n\t\t\t\t$out .= $indent . \"\\t\" . html_tag('li', array (), $key . PHP_EOL . static ::build_list($type, $val, '', $indent . \"\\t\\t\") . $indent . \"\\t\") . PHP_EOL;\n\t\t\t}\n\t\t}\n\t\t$result = $indent . html_tag($type, $attr, PHP_EOL . $out . $indent) . PHP_EOL;\n\n\t\treturn $result;\n\t}", "public function render()\n {\n // dd( $this->createItemArray() );\n return $this->htmlFromArray($this->createItemArray());\n }", "public static function ul(array $list = array(), $attr = false)\n\t{\n\t\treturn self::build_list('ul', $list, $attr);\n\t}", "function render()\n {\n return array(\n 'init' => $this->__init,\n 'data' => $this->__items\n );\n }", "function createItems($data) { ?>\n\t\t<div class=\"item active\">\n\t\t\t<img src=\"layout/gallery/default.png\" alt=\"<?= $data[$i][\"header\"] ?>\" \n\t\t\t\tstyle=\"height: 500px; margin-left: auto; margin-right: auto;\">\n\t\t\t<div class=\"carousel-caption custom-caption\">\n\t\t\t\t<h3>Chapter House</h3>\n\t\t\t\t<p>View of the house from 47th street.</p>\n\t\t\t</div> \n\t\t</div> <?PHP\n\t\tfor ($i = 0; $i < count($data); $i++) { ?>\n\t\t\t<div class=\"item\">\n\t\t\t\t<img src=\"layout/gallery/<?= $data[$i][\"id\"] ?>.png\" alt=\"<?= $data[$i][\"header\"] ?>\" \n\t\t\t\t\tstyle=\"height: 500px; margin-left: auto; margin-right: auto;\">\n\t\t\t\t<div class=\"carousel-caption custom-caption\">\n\t\t\t\t\t<h3><?= $data[$i][\"header\"]; ?></h3>\n\t\t\t\t\t<p><?= $data[$i][\"content\"]; ?></p>\n\t\t\t\t</div> \n\t\t\t</div> <?PHP\n\t\t}\n\t}", "function makeHTMLTable($array){\n\t\t // start table\n\t\t $html = '<table>';\n\t\t // header row\n\t\t $html .= '<tr>';\n\t\t // foreach($array[0] as $key=>$value){\n\t\t // $html .= '<th>' . htmlspecialchars($key) . '</th>';\n\t\t // }\n\t\t // $html .= '</tr>';\n\t\t // data rows\n\t\t foreach( $array as $key=>$value){\n\t\t $html .= '<tr>';\n\t\t foreach($value as $key2=>$value2){\n\t\t $html .= '<td>' . htmlspecialchars($value2) . '</td>';\n\t\t }\n\t\t $html .= '</tr>';\n\t\t }\n\t\t // finish table and return it\n\t\t $html .= '</table>';\n\t\t return $html;\n\t\t\t}", "public function renderList()\n {\n $pages = $this->module->getAllHTMLPages(true /* get inactive as well */);\n $content = '';\n\n if (!$pages)\n return $content;\n\n foreach ($pages as $i => $page) {\n $pages[$i]['full_url'] = $this->module->getFullURLForPage($pages[$i], $pages);\n }\n\n $fieldsList = [\n 'id_page' => [\n 'title' => 'ID',\n 'align' => 'center',\n 'class' => 'fixed-width-xs',\n ],\n 'name' => [\n 'title' => $this->l('Name'),\n ],\n 'full_url' => [\n 'title' => $this->l('Full URL'),\n ],\n 'active' => [\n 'title' => $this->l('Active'),\n 'active' => 'status',\n 'type' => 'bool',\n ]\n ];\n\n $helper = new HelperList();\n $helper->shopLinkType = '';\n $helper->simple_header = true;\n $helper->actions = [\"edit\", \"delete\", ];\n $helper->show_toolbar = false;\n $helper->module = $this;\n $helper->listTotal = count($pages);\n $helper->identifier = 'id_page';\n $helper->position_identifier = 'id_page';\n $helper->title = \"Custom Pages\";\n $helper->orderBy = 'full_url';\n $helper->orderWay = 'DESC';\n $helper->table = $this->table;\n $helper->token = Tools::getAdminTokenLite('AdminCustomHTMLPages');\n $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name;\n\n $content .= $helper->generateList($pages, $fieldsList);\n\n return $content;\n }", "protected static function build_list($type = 'ul', array $list = array(), $attr = false, $indent = '')\n\t{\n\t\tif ( ! is_array($list))\n\t\t{\n\t\t\t$result = false;\n\t\t}\n\n\t\t$out = '';\n\t\tforeach ($list as $key => $val)\n\t\t{\n\t\t\tif ( ! is_array($val))\n\t\t\t{\n\t\t\t\t$out .= $indent.\"\\t\".'<li>'.$val.'</li>'.PHP_EOL;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$out .= $indent.\"\\t\".'<li>'.$key.PHP_EOL.self::build_list($type, $val, '', $indent.\"\\t\\t\").$indent.\"\\t\".'</li>'.PHP_EOL;\n\t\t\t}\n\t\t}\n\t\treturn '<'.$type.HTML::attributes($attr).'>'.PHP_EOL.$out.$indent.'</'.$type.'>';\n\t}", "public static function ul($lists_array, $options = array())\n {\n if (empty($lists_array)) return null;\n\n $lists = static::li($lists_array);\n\n return static::tag('ul', \"\\n\".$lists.\"\\n\", $options);\n }", "function list_items($list)\n{\n // Create empty starter string\n $listString = '';\n \n // Loop through an array $list to pull out $key and $items from the array.\n foreach ($list as $key => $items) {\n // Increment $key so list number starts at 1 rather than 0.\n $key++;\n // Concatenate each list item to $listString\n $listString .= \"[{$key}] {$items}\" . PHP_EOL;\n }\n return $listString;\n}", "public function set_list() {\n\t$HTML = \"\";\n\tif ($this->inactives > 0) {\n\t\t$HTML .= \"<script>\\n\";\n\t\t$HTML .= \"function person_list() {\\n\";\n\t\t$HTML .= \" server_call('GET','refresh=persons','');\\n\";\n\t\t$HTML .= \"}\\n\";\n\t\t$HTML .= \"</script>\\n\";\n\t}\n\t$HTML .= \"<form method='post' name='frmAction' id='frmAction_ID' action='\".$_SERVER['SCRIPT_NAME'].\"'>\\n\";\n\t$HTML .= \" <div id='\".$this->list_ID.\"'>\\n\";\n\t$list = $this->show_list();\n\tforeach ($list as $line) $HTML .= $line.\"\\n\";\n\t$HTML .= \" </div>\\n\";\n\t$HTML .= \"</form>\\n\";\n\treturn $HTML;\n}", "function OrderedList( $atts, $content = null ) {\r\n return '<div class=\"OrderedList\">' . $content . '</div>';}", "function buildHtmlPhotos($data) {\r\n $photos = null;\r\n foreach ($data as $photo) {\r\n $image = '<img src=\"' . $photo['square_image_url'] .'\" title=\"' . $photo['title'] . '\" alt=\"' . $photo['title'] .'\" />';\r\n $photos .= '<div class=\"image-container\"><div class=\"image\">' . '<a href=\"/view-photo/' . $photo['id'] . '\" target=\"_blank\">' . $image . '</a></div></div>';\r\n }\r\n return $photos;\r\n }", "function list_items($list)\n{\n\t$result = '';\n\tforeach ($list as $key => $value) {\n // Display each item and a newline\n $add = $key + 1; \n $result .= \"[{$add}] {$value}\\n\";\n }\n\t\n\treturn $result;\n}", "function CheckBoxList($name,$data) {\n\n $content .= \"<table cellspacing=0 cellpadding=0 width=100%>\\n\";\n\n foreach($data as $k => $v) {\n\n if (($k % 2) == 0) {\n\t$content .= my_comma(checkboxlist,\"</td></tr>\").\"<tr><td width=1%>\\n\";\n } else {\n\t$content .= \"</td><td width=1%>\\n\";\n }\n\n if ($v[checked]) {\n\t$content .= \"<input type=checkbox name=\\\"\".$name.\"_$v[value]\\\" value=\\\"*\\\" checked></td><td width=49%>$v[text]\\n\";\n } else {\n\t$content .= \"<input type=checkbox name=\\\"\".$name.\"_$v[value]\\\" value=\\\"*\\\"></td><td width=49%>$v[text]\\n\";\n }\n }\n\n# echo count($data);\n\n $contemt .= \"</td></tr>\\n\";\n $content .= \"</table>\\n\";\n\n return $content;\n }", "function minorite_item_list($variables) {\n $items = $variables['items'];\n $type = $variables['type'];\n $attributes = $variables['attributes'];\n $output = '';\n\n if (!empty($items)) {\n $output = \"<$type\" . drupal_attributes($attributes) . '>';\n $num_items = count($items);\n foreach ($items as $item) {\n $attributes = array();\n $children = array();\n $data = '';\n if (is_array($item)) {\n foreach ($item as $key => $value) {\n if ($key == 'data') {\n $data = $value;\n }\n elseif ($key == 'children') {\n $children = $value;\n }\n else {\n $attributes[$key] = $value;\n }\n }\n }\n else {\n $data = $item;\n }\n if (count($children) > 0) {\n // Render nested list.\n $data .= minorite_item_list(array('items' => $children, 'title' => NULL, 'type' => $type, 'attributes' => $attributes));\n }\n $output .= '<li' . drupal_attributes($attributes) . '>' . $data . \"</li>\\n\";\n }\n $output .= \"</$type>\";\n }\n\n return $output;\n}", "public function elements()\r\n {\r\n return array(\r\n \r\n );\r\n }" ]
[ "0.7500389", "0.715308", "0.71175104", "0.6650967", "0.66327083", "0.66014284", "0.6499199", "0.64739186", "0.6441253", "0.64227986", "0.6311433", "0.62623745", "0.62575954", "0.62351745", "0.62351745", "0.6235105", "0.62095606", "0.60593534", "0.60392326", "0.60172385", "0.599087", "0.5984784", "0.59504807", "0.5940261", "0.5923935", "0.5919615", "0.58942986", "0.5888209", "0.58366036", "0.58316064", "0.5821133", "0.5819559", "0.5813316", "0.58084416", "0.58052343", "0.5799973", "0.57984495", "0.5776995", "0.57553035", "0.57511854", "0.573327", "0.5726313", "0.5717722", "0.5703647", "0.5678582", "0.5677732", "0.56747663", "0.56707895", "0.56650704", "0.56499237", "0.56328857", "0.56328404", "0.5626642", "0.56255", "0.56077135", "0.5606811", "0.56018996", "0.56000966", "0.55996937", "0.5595331", "0.5592333", "0.55907464", "0.5589881", "0.55755514", "0.55724233", "0.5566101", "0.5566101", "0.5566101", "0.5565456", "0.5564125", "0.55541915", "0.55497724", "0.5549447", "0.55479693", "0.5540888", "0.55394024", "0.5537826", "0.5537327", "0.5536116", "0.55347556", "0.5524339", "0.5518657", "0.5504955", "0.5504586", "0.54980606", "0.549456", "0.54913974", "0.5490984", "0.5486762", "0.5485619", "0.54820275", "0.5480636", "0.54765815", "0.547093", "0.54666495", "0.54654294", "0.5454097", "0.5451361", "0.544281", "0.54423505" ]
0.56599444
49
Searches a string for any of supplied vaules. Returns false if no match is found, else the position of the match (may be 0!)
function strapos($haystack,$needles,$offset=0) { $results = array(); foreach($needles as $n) { $results[] = strpos($haystack, $n); } $results = array_filter($results); sort($results); if(isset($results[$offset])) return $results[$offset]; else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function match($string);", "function searchForAny($source,$search)(\n if(strpos($source,$search) !== FALSE){\n return true;\n }", "function strposa($haystack, $needles){\n foreach($needles as $needle) {\n if(($r = strpos($haystack, $needle)) !== false) return $r;\n }\n return false;\n}", "function wsod_strposall($haystack,$needle){ \n $s=0; $i=0; \n while (is_integer($i)){ \n $i = strpos($haystack,$needle,$s); \n if (is_integer($i)) { \n $aStrPos[] = $i; \n $s = $i+strlen($needle); \n } \n } \n if (isset($aStrPos)) { \n return $aStrPos; \n } else { \n return false; \n } \n}", "function strposa($haystack, $needle) {\n if(!is_array($needle)) \n $needle = array($needle);\n \n foreach($needle as $what) {\n if(($pos = strpos($haystack, $what)) !== false) \n return $pos;\n }\n \n return false;\n}", "function judge($str) {\r\n\t\tforeach ($this->allergicWord as $key) {\r\n\t\t\tif (is_int(strpos($str, $key))) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private function strposa($string, $needle, $offset = 0)\n {\n if (!is_array($needle)) $needle = array($needle);\n if (!is_array($string)) $string = array($string);\n foreach ($string as $str) {\n if ($str) {\n foreach ($needle as $query) {\n if ($query) {\n if (strpos(strtolower($str), strtolower($query), $offset) !== false) return strtolower($query);\n }\n }\n }\n }\n return false;\n }", "function like_match($searchParam, $subject) {\n $preg = preg_grep(\"/(.*)\" . strtolower($searchParam) . \"(.*)/\", [strtolower($subject)]);\n if(!empty($preg)){\n return true;\n }\n return false;\n}", "private function _match($keyword, $string) {\n\t\t//sanitize\n\t\tforeach (array(' ', '-', '_') AS $key => $val) {\n\t\t\t$keyword = str_replace($val, '', $keyword);\n\t\t\t$string = str_replace($val, '', $string);\n\t\t}\n\t\t\n\t\t$keyword = strtolower($keyword);\n\t\t$string = ' '.strtolower($string);\n\t\tif (!$keyword || !$string) return false;\n\t\t\n\t\tif (strpos($string, $keyword) >= 1) return true;\n\t}", "function seachString($name,$str)\n\t{\n\t\t$result='';\n\t\t$result = strpos($name,$str);\n\t\tif ($result != '') {\n\t\t\techo \"True\";\n\t\t}\n\t\telse{\n\t\t\techo\"Flase\";\n\t\t}\n\n\t}", "function strposa( $haystack, $needles = array( ), $offset = 0 ) {\n$chr = array( );\nforeach ( $needles as $needle )\n {\n $res = strpos( $haystack, $needle, $offset );\n if ( $res !== false )\n return $needle;\n }\nreturn 'no';\n}", "function acf_str_exists($needle, $haystack)\n{\n}", "public function indexOf($value);", "public function match($value);", "public function search(string $what, int $start = 1, int $end = 1): int|false {}", "function search($array, $value)\n{\n $counter = 0;\n $found = false;\n\n foreach($array as $v) {\n if(strcmp($v[0], $value) == 0) {\n $found = true;\n break;\n } \n\n $counter++;\n }\n \n if($found)\n return $counter;\n \n return -1;\n}", "function starts_with($string,...$start)\n{\n if(!$string)\n return false;\n foreach( $start as $s )\n if( strpos(\"$string\",\"$s\") === 0 )\n return true;\n return false;\n}", "function strinarray($searchtext, $dataarray)\r\n{\r\n$i=0;\r\nforeach($dataarray as $linedata) {\r\n if(strstr($linedata,$searchtext)) break;\r\n $i++;\r\n };\r\nreturn $i;\r\n}", "protected function position_of_param( $needle ) {\n\t\t$i = 0;\n\t\tforeach ( $this->component as $component ) {\n\t\t\tif ( strtolower( $component['name'] ) == strtolower( $needle ) ) {\n\t\t\t\treturn $i;\n\t\t\t}\n\t\t\t++$i;\n\t\t}\n\t\treturn false;\n\t}", "function strposa($string, $words=array(), $offset=0) {\n $chr = array();\n //check by simlarity\n foreach($words as $word) {\n $res = checkExistanceBySimilarity($string,$word);\n if ($res !== false) $chr[$word] = $res;\n }\n // check exist\n /*foreach($words as $word) {\n $res = strpos($string, $word, $offset);\n if ($res !== false) $chr[$word] = $res;\n }*/\n if(empty($chr)) return false;\n return min($chr);\n}", "public function indexOf(mixed $element): string|int|bool;", "function str_contains($haystack, $needles) {\n foreach ((array) $needles as $needle) {\n if ($needle != '' && strpos($haystack, $needle) !== false) {\n return true;\n }\n }\n return false;\n}", "function cpay_ispos($string,$search) {\r\n if (strpos($string,$search)===false) {\r\n return(false);\r\n } else {\r\n return(true);\r\n }\r\n }", "function matchStrings($userValue, $label)\n{\n// debug(\"matchStrings $label\", $userValue);\n\n if(!strcasecmp($userValue, $label)) return true;\n \n $firstWord = substringBefore($label, \" \");\n return startsWith($userValue, $firstWord);\n}", "public function matches($str, array $inputs)\n\t{\n\t\tforeach ($inputs as $key)\n\t\t{\n\t\t\tif ($str !== (isset($this[$key]) ? $this[$key] : NULL))\n\t\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public function exec($string) {\r\n\t\t$offset = strlen(substr($string, 0, $this->lastIndex));\r\n\r\n\t\tif (preg_match($this->pattern(), $string, $matches, 0, $offset)) {\r\n\t\t\t// update lastIndex when global\r\n\t\t\tif ($this->global) {\r\n\t\t\t\t$this->lastIndex = strpos($string, $matches[0], $this->lastIndex) + strlen($matches[0]);\r\n\t\t\t}\r\n\t\t\t// return matches\r\n\t\t\treturn $matches;\r\n\t\t}\r\n\r\n\t\t// no match, reset lastIndex\r\n\t\t$this->lastIndex = 0;\r\n\r\n\t\treturn NULL;\r\n\t}", "function findPositionOfChar($search_string, $search) {\n if( strpos($search, $search_string) !== false ) {\n return 1;\n }\n return 0;\n }", "public abstract function matches($value);", "public static function search($needle, $haystack, $all = false)\n {\n $x = [];\n foreach (Tokenizer::parse($needle) as $token) if (Tokenizer::isSemanticToken($token)) $x[] = $token;\n $m = count($x);\n if ($m == 0) return false;\n $y = Tokenizer::parse($haystack);\n $res = [];\n for ($i = 0, $k = 0, $n = count($y); $i < $n; $i++)\n {\n $token = $y[$i];\n if (!Tokenizer::isSemanticToken($token)) continue;\n if (Tokenizer::isEqual($x[$k], $token)) \n {\n $k++;\n if ($k == 1) $start = $i;\n if ($k == $m) \n {\n if (!$all) return [$start, $i];\n else \n {\n $res[] = [$start, $i];\n $k = 0;\n }\n }\n }\n else $k = 0;\n }\n return $res ?: false;\n }", "public static function search($str, $pattern, &$match = null)\n {\n if (preg_match($pattern, $str, $m, PREG_OFFSET_CAPTURE)) {\n list($match, $ofs) = $m[0];\n return $ofs;\n }\n return false;\n }", "function get_index($arr, $selected)\n{\n $ret = false; // return false if not found\n foreach ($arr as $key => $val) {\n if (strtolower(substr($val, 0, strlen($selected))) == strtolower($selected)) {\n $ret = $key;\n break;\n }\n }\n\n return $ret;\n}", "function searchArray($string, $array) {\n $result = array_search($string, $array);\n if($result === false) {\n return false;\n } else {\n return true;\n }\n}", "private function match_at($pos, $tokens){\n\t\t// If there are no tokens in the list someone is explicitly searching for EOF. If\n\t\t// `token_at()` returns `null` we are at EOF and return `null`, too. Otherwise\n\t\t// return `false` for a missmatch.\n\t\tif ( count($tokens) == 0 and $pos >= strlen($this->buffer) )\n\t\t\treturn ($this->token_at($pos, 1) === null) ? null : false;\n\t\t\n\t\tforeach($tokens as $token){\n\t\t\t$found = $this->token_at($pos, is_string($token) ? strlen($token) : 1);\n\t\t\tif ($found === null)\n\t\t\t\treturn null;\n\t\t\telseif ($found === false)\n\t\t\t\tcontinue;\n\t\t\telseif ($found === $token)\n\t\t\t\treturn $token;\n\t\t\telseif ($token instanceof Closure and $token($found))\n\t\t\t\treturn $found;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function search($str) {\n\t\t$sql = \"SELECT * FROM teams WHERE (\";\n\t\t$sql .= \"name like ? \";\n\t\t$sql .= \"OR colour like ?)\";\n\t\t$stmt = $this->dbManager->prepareQuery($sql);\n\t\t\n\t\t$this->dbManager->bindValue($stmt, 1, '%'.$str.'%', $this->dbManager->STRING_TYPE );\n\t\t$this->dbManager->bindValue($stmt, 2, '%'.$str.'%', $this->dbManager->STRING_TYPE );\n\t\t\n\t\t$this->dbManager->executeQuery($stmt);\n\t\t$rows = $this->dbManager->fetchResults ( $stmt );\n\t\t\n\t\treturn ($rows);\n\t}", "public static function search($string, $search) {\n $needles = is_array($search) ? $search : array($search);\n\n foreach($needles as &$needle) {\n if (stripos($string, $needle) !== false) {\n return true;\n }\n }\n\n return false;\n }", "function _strDetect ($needles, $offset) {\r\n foreach ($needles as $needle) {\r\n $l = strlen ($needle);\r\n if (substr ($this->_text, $offset, $l) == $needle) {\r\n return $needle;\r\n }\r\n }\r\n return false;\r\n }", "function _match_pair($string, $variable)\n\t{\n\t\tif ( ! preg_match(\"|\".$this->l_delim . $variable . $this->r_delim.\"(.+)\".$this->l_delim . '/' . $variable . $this->r_delim.\"|s\", $string, $match))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn $match;\n\t}", "function strpos_array(string $haystack, array $needles) {\r\n\tif(is_array($needles)) {\r\n\t\tif(count($needles) == 0)\r\n\t\t\treturn false;\r\n\t\tforeach ($needles as $str) {\r\n\t\t\tif ( is_array($str) ) {\r\n\t\t\t\t$pos = strpos_array($haystack, $str);\r\n\t\t\t} else {\r\n\t\t\t\t$pos = strpos($haystack, $str);\r\n\t\t\t}\r\n\t\t\tif ($pos !== FALSE) {\r\n\t\t\t\treturn $pos;\r\n\t\t\t}\r\n\t\t}\r\n\t} else {\r\n\t\treturn strpos($haystack, $needles);\r\n\t}\r\n}", "function string_has_params($string) {\n if (strpos($string, $this->parse['before']) !== false) {\n if (strpos($string, $this->parse['after']) !== false) {\n return strpos($string, $this->parse['after']) >\n strpos($string, $this->parse['before']);\n }\n }\n\n return false;\n }", "public static function contains( $v = '', $a = [] ) {\n\t\t\tif ( $v ) {\n\t\t\t\tforeach( (array) $a as $k ) {\n\t\t\t\t\tif ( $k && strpos( (string) $v, (string) $k ) !== false ) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn null;\n\t\t}", "private function match($chArray, $string)\n {\n foreach ($chArray as $ch) {\n if (strpos($string, $ch) !== false) {\n return true;\n }\n }\n return false;\n }", "function findHashtagInString($hashtag, $string, $default = false)\n{\n // we find all matches against one hashtag\n global $preferences;\n $positions = null;\n strpos_recursive($string, \"#\".$hashtag,0,$positions);\n\n // and see if any are actually a tag and not just part of the \n // keywords (like \"film\")\n if($positions != null)\n foreach($positions as $position)\n {\n if($position !== false &&\n !$preferences->keywordExistsAtPosition($string, $position))\n {\n // return the all columns!\n return $position;\n }\n }\n \n return $default;\n}", "function _keyword_match($t)\n\t{\n\t\tstatic $regexp='';\n\t\tif (($regexp=='') || ($this->and_query))\n\t\t{\n\t\t\tforeach ($this->keywords as $keyword_group)\n\t\t\t{\n\t\t\t\tif ($this->and_query)\n\t\t\t\t{\n\t\t\t\t\t$regexp='';\n\t\t\t\t}\n\t\t\t\tforeach ($keyword_group as $keyword)\n\t\t\t\t{\n\t\t\t\t\tif ($regexp!='') $regexp.='|';\n\t\t\t\t\t$regexp_for_keyword='((^|\\.|\\#|\\s|\\/|\\-|>|\\)|\\(|\\})'.str_replace('#','\\#',preg_quote($keyword)).')';\n\t\t\t\t\t$regexp.=$regexp_for_keyword;\n\t\t\t\t}\n\t\t\t\tif ($this->and_query)\n\t\t\t\t{\n\t\t\t\t\tif (preg_match('#'.$regexp.'#i',$t)==0) return false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($this->and_query)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn (preg_match('#'.$regexp.'#i',$t)!=0);\n\t}", "function findItemInString($string, $array, $default = \"\")\n{\n // only runs on arrays\n if(!is_array($array))\n $array = array($array);\n \n // return the first item that matches\n foreach($array as $item)\n if(strpos($string, $item) !== false)\n return $item;\n \n // otherwise nothing\n return $default;\n}", "function contains($str, array $arr) {\n foreach( $arr as $a ) {\n if ( stripos($str, $a) !== false ) {\n \treturn true;\n }\n }\n return false;\n}", "function atk_strpos($haystack,$needle,$offset=0)\n{\n\treturn atkString::strpos($haystack,$needle,$offset);\n}", "static function contains( $str, $val )\n {\n return ( strpos($str, $val) !== false );\n }", "public function search($value, $strict = false);", "private function testArgExists($string) {\n $arg_key = self::getChar($string, 1);\n $argtest = ($arg_key == 'd' || $arg_key == 't');\n return $argtest;\n }", "protected function _match()\n {\n // SMART/TNT\n $smart = $this->_smart();\n if( $this->name == 'smart' ) return in_array($this->args, $smart) ? true : false;\n // GLOBE/TM\n $globe = $this->_globe();\n if( $this->name == 'globe' ) return in_array($this->args, $globe) ? true : false;\n // SUN\n $sun = $this->_sun();\n if( $this->name == 'sun' ) return in_array($this->args, $sun) ? true : false;\n }", "function exact_value ( $str, $val )\n\t{\n\t\tif ( strcmp( strval( $str ), strval( $val ) ) !== 0 ) return FALSE;\n\t\treturn TRUE;\n\t}", "public static function findNextIfKeyword($content,$offset,$needle)\r\n\t{\r\n\t\t$offset = self::getNextNotWhiteChar($content,$offset);\r\n\t\t$len = strlen($needle);\r\n\t\tfor($i=0;$i<$len;$i++)\r\n\t\t\tif(strtolower($content[$offset+$i]) !== strtolower($needle[$i]))\r\n\t\t\t\treturn -1;\r\n\t\treturn $offset+$i;\r\n\t}", "function strContains($haystack, $needle)\n{\n return strpos($haystack, $needle) > -1 ? true : false;\n}", "public function searchByVal( $value, bool $strict = false );", "function check($paragraph, $word)\n{\n if (stripos($paragraph, $word) !== false)\n //if word exists return '1'\n return 1;\n else\n //word doesnt exist - return '0'\n return 0;\n}", "public function search(string $keyword=''){\n /* check error */\n if($this->error){return false;}\n /* set default output */\n $out=[];\n /* direct return on empty input */\n if(empty($keyword)){return false;}\n /* search one by one */\n foreach($this->wilayah as $k=>$v){\n if(stripos($v[1],$keyword)!==false){\n $out[$k]=$v[1];\n }\n }\n /* return the output */\n return $out;\n }", "static function matches($string)\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::matches', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "function array_contains_part_of_string ($string, $array) {\n\tforeach ($array as $value) {\n\t\t//if (strstr($string, $url)) { // mine version\n\t\tif (strpos($string, $value) !== FALSE) { // Yoshi version\n\t\t\treturn true;\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t}\n return false;\n\t\n}", "function _string_contains( $needle, $haystack )\n{\n return strpos( $haystack, $needle ) !== false;\n}", "private static function strposa( $haystack, array $needle, $offset = 0 ) {\n\n\t\tforeach ( $needle as $query ) {\n\t\t\tif ( strpos( $haystack, $query, $offset ) !== false ) {\n\t\t\t\treturn true;\n\t\t\t} // Stop on first true result.\n\t\t}\n\n\t\treturn false;\n\t}", "function contains_all($str,array $words) {\r\n if(!is_string($str))\r\n { return false; }\r\n\r\n foreach($words as $word) {\r\n if(!is_string($word) || stripos($str,$word)===false)\r\n { return false; }\r\n }\r\n return true;\r\n}", "function contains($needle, $haystack)\n{\n return strpos($haystack, $needle) !== false;\n}", "function search($word)\n {\n if (empty($word)) {\n return false;\n }\n $endNode = $this->searchEndNode($word);\n return $endNode !== null && $endNode['is_end'];\n }", "function contains($c, $s){\r\n for ($i = 0; $i < strlen($s); $i++){\r\n if ($s[$i] == $c){\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "function find_all($string, $start, $end) {\r\n preg_match_all (\"($start(.*)$end)siU\", $string, $matching_data);\r\n return $matching_data[0];\r\n}", "public function globalStringConditionMatchesRegularExpression() {}", "public function globalStringConditionMatchesRegularExpression() {}", "function contains($haystack, $needles)\n{\n foreach ((array) $needles as $needle) {\n if ($needle !== '' && mb_strpos($haystack, $needle) !== false) {\n return true;\n }\n }\n return false;\n}", "public function indexOfByWords($value) {\r\n\t\t$words = $this->readFileByWord ();\r\n\t\t$count = 0;\r\n\t\t$found = false;\r\n\t\tfor($i = 0; $i < $this->wordCount (); $i ++) {\r\n\t\t\t$word = $words [$i];\r\n\t\t\tif (trim ( $value ) == ($word)) {\r\n\t\t\t\t$found = true;\r\n\t\t\t\tbreak;\r\n\t\t\t} else {\r\n\t\t\t\t$count ++;\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn ($found == true ? $count : - 1);\r\n\t\r\n\t}", "public function exists(string $string);", "function preg_match_names(string $pattern, string $subject, array|null &$match, int $flags = 0, int $offset = 0): int|false\n{\n $res =@ preg_match($pattern, $subject, $match, $flags, $offset);\n\n // Act as original.\n if ($res === false) {\n $message = preg_error_message(func: 'preg_match');\n trigger_error(sprintf('%s(): %s', __function__, $message), E_USER_WARNING);\n } else {\n // Select string (named) keys.\n $match = array_filter($match, 'is_string', 2);\n }\n\n return $res;\n}", "function search_array($string, $array) {\r\n foreach($array as $entry) {\r\n // searches substring $string in $entry\r\n if (strpos($entry, $string) !== false) {\r\n return $entry;\r\n }\r\n }\r\n }", "function multi_strpos($haystack, $needles, $sensitive = false, $offset = 0){\r\r\n\t$needles = (array)$needles;\r\r\n\r\r\n\tforeach($needles as $needle) {\r\r\n\t\t$result[$needle] = ($sensitive) ? strpos($haystack, (string)$needle, $offset) : stripos($haystack, (string)$needle, $offset);\r\r\n\t}\r\r\n\treturn $result;\r\r\n}", "function InString($what,$where) {\n\t\t$pos = strpos ($where, $what);\n\t\tif (is_string($pos) && !$pos) {\n\t\t return false;\n\t\t}\n\t\treturn true;\n\t}", "private function doesMatchArg($pos, $value) {\n $argVal= $this->args[$pos];\n if ($argVal instanceof IArgumentMatcher) {\n return $argVal->matches($value);\n } else {\n return Objects::equal($argVal, $value);\n }\n }", "function match($field, $value);", "function Preg_Match_one($regex, $string, $key = 0)\n{\n $matches = array();\n preg_match($regex, $string, $matches);\n return $matches[$key];\n}", "public static function stringContains($string, array $variants)\n {\n foreach ($variants as $variant) {\n if (static::findFirstPosition($string, $variant) !== false) {\n return true;\n }\n }\n return false;\n }", "function strposa( $haystack, $needles = array(), $offset = 0 ) {\n\t\t$chr = array();\n\n\t\tforeach( $needles as $needle ) {\n\t\t\t$res = strpos( $haystack, $needle, $offset );\n\t\t\tif ( $res !== false ) $chr[$needle] = $res;\n\t\t}\n\n\t\tif ( empty($chr) ) return false;\n\t\t\n\t\treturn min( $chr );\n\t}", "function contains($substring, $string)\n{\n\t$pos = strpos($string, $substring);\n\tif ($pos === FALSE) {\n\t\treturn false;\n\t}\n\telse {\n\t\treturn true;\n\t}\n}", "function preg_match_all_names(string $pattern, string $subject, array|null &$match, int $flags = 0, int $offset = 0): int|false\n{\n $res =@ preg_match_all($pattern, $subject, $match, $flags, $offset);\n\n // Act as original.\n if ($res === false) {\n $message = preg_error_message(func: 'preg_match');\n trigger_error(sprintf('%s(): %s', __function__, $message), E_USER_WARNING);\n } else {\n // Select string (named) keys.\n $match = array_filter($match, 'is_string', 2);\n }\n\n return $res;\n}", "private function str(string $str, array $map)\n {\n foreach ($map as $key => $value) {\n if (is_array($value) && count($value) > 0) {\n for ($j = 0; $j < count($value); $j++) {\n if (strpos($value[$j], $str) !== false)\n return ($key === self::UNKNOWN) ? null : $key;\n }\n } elseif (strpos($value, $str) !== false) {\n return ($key === self::UNKNOWN) ? null : $key;\n }\n }\n\n return null;\n }", "function haveStr(string $haystack, string $needle) : bool\n{\n return (strpos($haystack, $needle) !== false);\n}", "protected function strposa($haystack, $needle, $offset = 0) {\n if (!is_array($needle))\n $needle = array($needle);\n foreach ($needle as $query) {\n if (strpos($haystack, $query, $offset) !== false)\n return true; // stop on first true result\n }\n return false;\n }", "function isMatch($s, $p)\n{\n if ($s == $p) {\n return true;\n }\n if (empty($p)) {\n return ($s == '');\n }\n if (@$p[1] != '*') {\n return (($s[0] == $p[0]) || ($p[0] == '.' && isset($s[0]))) && isMatch(substr($s,1), substr($p,1));\n }\n $i = 0;\n while((@$s[$i] == $p[0]) || ($p[0] == '.' && isset($s[$i]))) {\n if (isMatch($s, substr($p,2))) {\n return true;\n }\n $i++;\n }\n return isMatch(substr($s, $i), substr($p,2));\n}", "protected function findOccurence($haystack, $needles)\n {\n $position = strlen($haystack);\n\n foreach ((array) $needles as $needle) {\n $position = stripos($haystack, $needle);\n if (false !== $position) {\n break;\n }\n }\n\n return $position;\n }", "public static function str_starts_with_any(string $str, array $substrings): bool\n {\n if ($str === '') {\n return false;\n }\n\n if ($substrings === []) {\n return false;\n }\n\n foreach ($substrings as &$substring) {\n if (self::str_starts_with($str, (string) $substring)) {\n return true;\n }\n }\n\n return false;\n }", "function url_contains($string) {\n\n $url = URL;\n //check for string in url\n $lookup = strpos($url, $string);\n\n\n //If string is found, set the value of found_context\n if($lookup > 1 || $lookup !== false) {\n return true;\n }\n\n //If not found, set UNSET the value of found_context\n else {return false; }\n}", "function strNthOccurPos($haystack, $needle, $nth=1, $insenstive=0)\n\t{\n\t //if its case insenstive, convert strings into lower case\n\t if ($insenstive) {\n\t\t $haystack=strtolower($haystack);\n\t\t $needle=strtolower($needle);\n\t }\n\t //count number of occurances\n\t $count=substr_count($haystack,$needle);\n\t\n\t //first check if the needle exists in the haystack, return false if it does not\n\t //also check if asked nth is within the count, return false if it doesnt\n\t if ($count<1 || $nth > $count) return false;\n\t\n\t\n\t //run a loop to nth number of accurance\n\t //start $pos from -1, cause we are adding 1 into it while searchig\n\t //so the very first iteration will be 0\n\t for($i=0,$pos=0,$len=0;$i<$nth;$i++)\n\t {\n\t\t //get the position of needle in haystack\n\t\t //provide starting point 0 for first time ($pos=0, $len=0)\n\t\t //provide starting point as position + length of needle for next time\n\t\t $pos=strpos($haystack,$needle,$pos+$len);\n\t\n\t\t //check the length of needle to specify in strpos\n\t\t //do this only first time\n\t\t if ($i==0) $len=strlen($needle);\n\t\t }\n\t\n\t //return the number\n\t return $pos;\n\t}", "function substr_in_array($needle, array $haystack){\n foreach($haystack as $item){\n if(false !== strpos($item, $needle)){\n return false;\n }\n }\n return true;\n}", "function isstr($array, $text)\n{\nif(strpos($text, $array) === false) {\nreturn false;\n} else {\nreturn true;\n}\n}", "public static function hasAny($types, $val)\n\t{\n\t\t//Parse the string passed in for types\n\t\t$types = RegExp::getArray($types);\n\t\t\n\t\t//Assume none are found\n\t\t$flag = false; \n\t\t\n\t\tforeach($types as $type)\n\t\t{\t\t\n\t\t\t//Make sure the type is formatted properly\n\t\t\t$type = RegExp::getType($type);\n\t\t\t\n\t\t\tif(RegExp::has($type,$val))\n\t\t\t{\n\t\t\t\t$flag = true;\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\treturn $flag;\n\t}", "private function _hasSpecificSequence($string)\n {\n $hasSpecificSequence = FALSE;\n $specialMeaningStrs = array('\\n', '\\r', '\\t', '\\v', '\\f');\n foreach ($specialMeaningStrs as $splStr) {\n if (FALSE !== strpos($string, $splStr)) {\n $hasSpecificSequence = TRUE;\n }\n }\n $specialMeaningPtrns = array('\\[0-7]{1,3}', '\\x[0-9A-Fa-f]{1,2}');\n foreach ($specialMeaningPtrns as $splPtrn) {\n if (1 === preg_match(\"/{$splPtrn}/\", $string)) {\n $hasSpecificSequence = TRUE;\n }\n }\n return $hasSpecificSequence;\n }", "function preg_match_array($regexArray, $str) {\r\n foreach ($regexArray as $p) {\r\n $trimP = trim($p);\r\n if ($trimP != '') {\r\n if (preg_match('/' . $trimP . '/', $str)) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n}", "function _section_match($section_limitations,$results_type)\n\t{\n\t\tif ($section_limitations==array()) return true;\n\n\t\tforeach ($section_limitations as $l)\n\t\t{\n\t\t\tif (@strpos(strtolower($results_type),strtolower($l))!==false) return true;\n\t\t}\n\n\t\treturn false;\n\t}", "private function contains($str, array $arr)\n {\n foreach ($arr as $a) {\n if (stripos($str, $a) !== false) {\n return true;\n }\n }\n return false;\n }", "public function keywords($value=''): bool\n\t{\n\t\t$keywords = require 'keywords.php';\t\t\n\t\t$hit = false;\n\n\t\tforeach ($keywords as $key) {\n\t\t\tif (stripos($value, $key) !== false)\n\t\t\t\t$hit = true;\n\t\t}\n\t\treturn $hit;\n\t}", "private static function getFirst ($val) {\n\t\treturn (substr ($val, 0, strlen (self::$sSearch)) === self::$sSearch);\n\t}", "public function match( $data );", "protected static function searchDefinition(string $arg)\n {\n\n $type = null;\n\n if (strpos($arg, '--') === 0)\n {\n $type = 'long_arg';\n $arg = substr($arg, 2);\n }\n else if (strpos($arg, '-') === 0)\n {\n $type = 'short_arg';\n $arg = substr($arg, 1);\n }\n\n // Split value\n $value = null;\n\n if (strpos($arg, '=') !== false)\n {\n list($arg, $value) = explode('=', $arg, 2);\n }\n\n // Search argument in definition list\n $found = array_filter(Params::$definitions, function ($passed_definition) use ($arg, $type) {\n return !empty($passed_definition[$type]) && $passed_definition[$type] === $arg;\n });\n\n if (empty($found))\n {\n return false;\n }\n\n $found[key($found)]['value'] = empty($value) ? true : $value;\n\n return $found;\n }", "public function indexOf(mixed $value): ?int;" ]
[ "0.6563205", "0.6126327", "0.60307026", "0.58493006", "0.5844992", "0.57749265", "0.5769015", "0.57614195", "0.5737539", "0.5735456", "0.572124", "0.57211405", "0.56689596", "0.5666697", "0.56098974", "0.5593548", "0.55871266", "0.55219424", "0.55202246", "0.5518569", "0.5518317", "0.5507653", "0.5489958", "0.5480335", "0.5474651", "0.5473904", "0.54627335", "0.5450508", "0.5449922", "0.5441484", "0.54412985", "0.54352534", "0.54253215", "0.5401289", "0.5388149", "0.53814274", "0.5372668", "0.5370654", "0.534736", "0.5321442", "0.52797425", "0.5279184", "0.5277927", "0.5273735", "0.52656645", "0.5261761", "0.5245035", "0.5244443", "0.52380776", "0.5214511", "0.5195429", "0.51899964", "0.51685286", "0.5154369", "0.5137694", "0.5129608", "0.51167214", "0.5110242", "0.51091117", "0.51072913", "0.5101986", "0.5099287", "0.5088942", "0.50880796", "0.50805014", "0.5077873", "0.50754565", "0.5067893", "0.5022657", "0.5013298", "0.5012463", "0.49953535", "0.49952", "0.49930787", "0.49908668", "0.49908376", "0.49871367", "0.49767995", "0.4976", "0.4969962", "0.49658036", "0.49611604", "0.49454215", "0.4943573", "0.49420252", "0.49392125", "0.49279493", "0.49229267", "0.49196526", "0.4918287", "0.49175206", "0.49134022", "0.48844704", "0.48721284", "0.4870951", "0.48701322", "0.4862074", "0.4858467", "0.4858215", "0.48578355", "0.48451275" ]
0.0
-1
This filter is run as the last thing before the output buffer is sent to the browser. It inserts the string registered with Head::add() does some output compression if possible.
function outputBufferFilter($buffer, $mode) { //FIXME: Uncomment? //$buffer = trim($buffer); /** * Mail replace */ $buffer = SafeEmails::replace($buffer); $headadd = Head::finalize(); if(is_array($headadd)) { $buffer = preg_replace('#</head>#i', $headadd[0]."\r\n</head>", $buffer, 1); $buffer = preg_replace('#</body>#i', $headadd[1]."\r\n</body>", $buffer, 1); } return $buffer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function basecss_insert_head($flux){\n\tif (!test_plugin_actif('Zcore')){\n\t\t$flux .= \"<\".\"?php header(\\\"X-Spip-Filtre: basecss_pied_de_biche\\\"); ?\".\">\";\n\t}\n\treturn $flux;\n}", "public static function outputBuffering() {\r\n switch (substr_count(HTTP_ENCODING, 'gzip')) :\r\n case true:\r\n return ob_start('ob_gzhandler');\r\n default:\r\n return ob_start();\r\n endswitch;\r\n }", "private function renderHead() {\n\t\t\n\t\t\t$this->outputLine('<head>');\n\t\t\t\n\t\t\tif ($this->_title != '') {\n\t\t\t\t$this->outputLine('\t<title>' . $this->_title . '</title>');\n\t\t\t}\n\t\t\t\n\t\t\t$this->outputLine('\t<base href=\"' . $this->_base . '\" />');\n\t\t\t\n\t\t\t$this->outputLine('\t<meta http-equiv=\"content-type\" content=\"' . $this->_contentType . '\" />');\n\t\t\t\n\t\t\t//Meta\n\t\t\tforeach ($this->_meta as $meta) {\n\t\t\t\t$this->outputLine('\t<meta name=\"' . $meta->name . '\" content=\"' . $meta->content . '\" />');\n\t\t\t}\n\t\t\t\n\t\t\t//CSS\n\t\t\tforeach ($this->_css as $css) {\n\t\t\t\t$this->outputLine(\"\t\" . $css);\n\t\t\t}\n\t\t\t\n\t\t\t//JS\n\t\t\tforeach ($this->_js as $js) {\n\t\t\t\t$this->outputLine(\"\t\" . $js);\n\t\t\t}\n\t\t\t\n\t\t\t$this->outputLine('</head>');\n\t\t\n\t\t}", "function buffer_the_output() {\r\n\tob_start();\r\n}", "public function renderAjaxHead(&$output) {\n\t\t/*\n\t\t$count=preg_match('/(<title\\b[^>]*>|<\\\\/head\\s*>)/is',$output);\n\t\tif ($count){\n\t\t\t$this->renderHead($output);\n\t\t} else {\n\t\t*/\n\t\t\t$replaceScripts='';\n\t\t\t$html='';\n\t\t\tforeach($this->metaTags as $meta)\n\t\t\t\t$replaceScripts.=checkInsertReplaceMeta($meta).\"\\n\";\n\t\t\tforeach($this->linkTags as $link)\n\t\t\t\t$replaceScripts.=$this->checkNotExistInsertLink($link).\"\\n\";\n\t\t\tforeach($this->cssFiles as $url=>$media)\n\t\t\t\t$replaceScripts.=$this->checkNotExistInsertCssFile($url,$media).\"\\n\";\n\t\t\t\t\n\t\t\tforeach($this->css as $css)\n\t\t\t\t$html.=CHtml::css($css[0],$css[1]).\"\\n\";\n\t\t\tif($this->enableJavaScript) {\n\t\t\t\tif(isset($this->scriptFiles[self::POS_HEAD])) {\n\t\t\t\t\tforeach($this->scriptFiles[self::POS_HEAD] as $scriptFile)\n\t\t\t\t\t\t$replaceScripts.=$this->checkNotExistInsertScriptFile($scriptFile, \"jQuery('head').append\").\"\\n\";\n\t\t\t\t}\n\n\t\t\t\tif(isset($this->scripts[self::POS_HEAD]))\n\t\t\t\t\t$html.=CHtml::script(implode(\"\\n\",$this->scripts[self::POS_HEAD])).\"\\n\";\n\t\t\t}\n\t\t\tif($replaceScripts!=='') {\n\t\t\t\t$html=CHtml::script($replaceScripts).\"\\n\".$html;\n\t\t\t}\n\t\t\tif($html!=='') {\n\t\t\t\t$output=$html.$output;\n\t\t\t}\n\t\t//}\n\t}", "public function head_add($html) {\n\t\tif (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))\n\t\t\tdebug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);\n\n\t\t$this->_head[] .= $html;\n\t}", "public function output_filter()\n\t{\n\t\tglobal $output;\n\t\t$this->output = &$output;\n\n\t\t$this->frontend = new Frontend();\n\t\t$this->module = $this->frontend->run();\n\n\t\tif (strstr($this->output, \"#fixemodule\")) {\n\t\t\t$this->output = $this->replace_placeholders($this->output);\n\t\t}\n\t}", "public function appendToHead($str) {\n\t\t$this->headAppend .= $str;\n\t}", "function asu_brand_head_inject() {\n $settings = asu_brand_get_block_settings();\n $cache_id = 'asu_brand:head';\n \n $head_output = asu_brand_get_cached_content($cache_id, $settings->head_path);\n\n // Inject header javascript into <head> and set the weight to a high negative value.\n $asu_sso_signedin = $settings->js_settings['asu_sso_signedin'];\n $asu_sso_signinurl = $settings->js_settings['asu_sso_signinurl'];\n $asu_sso_signouturl = $settings->js_settings['asu_sso_signouturl'];\n $inline_script = <<<EOL\n <script type=\"text/javascript\">\n <!--//--><![CDATA[//><!--\n var ASUHeader = ASUHeader || {};\n ASUHeader.user_signedin = $asu_sso_signedin;\n ASUHeader.signin_url = \"$asu_sso_signinurl\";\n ASUHeader.signout_url = \"$asu_sso_signouturl\";\n //--><!]]>\n </script>\nEOL;\n \n // TODO: If asu.edu/asuthemes/x/headers/default.shtml and asu.edu/asuthemes/x/js/asu_header.js\n // get updated we can remove the first drupal_add_html_head() and $inline_script above.\n drupal_add_js(array('asu_brand' => $settings->js_settings), 'setting');\n drupal_add_js(drupal_get_path('module', 'asu_brand') . '/asu_brand.js', array());\n drupal_add_html_head(array('#type' => 'markup', '#markup' => $inline_script, '#weight' => -100), 'asu_brand_head_js');\n drupal_add_html_head(array('#type' => 'markup', '#markup' => $head_output, '#weight' => -99), 'asu_brand_head');\n}", "function headOptimization()\r\n\t{\r\n\t\t\r\n\t\techo \"<meta name='description' content='\".$this->PageDescription().\"' />\";\r\n\t\techo \"<meta name='keywords' content='\".$this->PageKeywords().\"' />\";\r\n\t\techo \"<title>\".$this->PageTitle().\"</title>\";\r\n\t\r\n\t}", "public function add_head_marker() {\n\t\tglobal $wpUnited;\n\n\t\tif ($wpUnited->should_do_action('template-p-in-w') && (!PHPBB_CSS_FIRST)) {\n\t\t\techo '<!--[**HEAD_MARKER**]-->';\n\t\t}\n\t}", "public function renderHead(&$output)\n {\n\t$html='';\n\tforeach($this->metaTags as $meta)\n\t\t$html.=CHtml::metaTag($meta['content'],null,null,$meta).\"\\n\";\n\tforeach($this->linkTags as $link)\n\t\t$html.=CHtml::linkTag(null,null,null,null,$link).\"\\n\";\n\tforeach($this->cssFiles as $url=>$media)\n\t\t$html.=CHtml::cssFile($url,$media).\"\\n\";\n\tforeach($this->css as $css)\n\t\t$html.=CHtml::css($css[0],$css[1]).\"\\n\";\n\tif($this->enableJavaScript)\n\t{\n if(isset($this->scriptFiles[self::POS_HEAD]))\n {\n\t\tforeach($this->scriptFiles[self::POS_HEAD] as $scriptFile)\n $html.=CHtml::scriptFile($scriptFile).\"\\n\";\n }\n\n if(isset($this->scripts[self::POS_HEAD]))\n\t\t$html.=CHtml::script(implode(\"\\n\",$this->scripts[self::POS_HEAD])).\"\\n\";\n }\n\n if($html!=='')\n {\n\t\t$count=0;\n\t\t//$output=preg_replace('/(<title\\b[^>]*>|<\\\\/head\\s*>)/is','<###head###>$1',$output,1,$count);\n $output=preg_replace('/(<\\\\/title\\s*>)|(<\\\\/head\\s*>)/is','$1<###head###>$2',$output,1,$count);\n\t\tif($count)\n //$output=str_replace('<###head###>',$html,$output);\n $output=str_replace('<###head###>',\"\\n\".$html,$output); \n\t\telse\n $output=$html.$output;\n }\n }", "function PREFIX_output_buffering() {\n\tob_clean();\n\tob_start();\n}", "function dw2_insert_head($flux) {\r\n\t\t$flux.= \"\\n\".'<script type=\"text/javascript\" src=\"'._DIR_PLUGIN_DW2.'dw2_fermepop.js\"></script>'.\"\\n\";\r\n\t\t$flux.= \"\\n\".'<link rel=\"stylesheet\" type=\"text/css\" href=\"'._DIR_PLUGIN_DW2.'dw2_public_styles.css\" />'.\"\\n\";\r\n\t\treturn $flux;\r\n\t}", "public function renderHead(&$output)\n\t{\n\t\t$html = '';\n\t\tforeach ($this->metaTags as $meta)\n\t\t\t$html.=self::metaTag($meta['content'], null, null, $meta) . \"\\n\";\n\t\tforeach ($this->cssFiles as $url => $media)\n\t\t\t$html.=self::cssFile($url, $media) . \"\\n\";\n\n\t\tforeach($this->css as $css)\n\t\t\t$html.=self::css($css[0],$css[1]).\"\\n\";\n\t\t\t\t\n\t\tif(isset($this->gapiScripts[self::POS_HEAD]))\n\t\t{\n\t\t\tforeach ($this->gapiScripts[self::POS_HEAD] as $gapiScript)\n\t\t\t\t$html.=self::scriptFile($gapiScript) . \"\\n\";\n\t\t}\n\t\tif (isset($this->scriptFiles[self::POS_HEAD]))\n\t\t{\n\t\t\tforeach ($this->scriptFiles[self::POS_HEAD] as $scriptFile)\n\t\t\t\t$html.=self::scriptFile($scriptFile) . \"\\n\";\n\t\t}\n\n\t\tif (isset($this->scripts[self::POS_HEAD]))\n\t\t\t$html.=self::script(implode(\"\\n\", $this->scripts[self::POS_HEAD])) . \"\\n\";\n\n\n\t\tif ($html !== '')\n\t\t{\n\t\t\t$count = 0;\n\t\t\t$output = preg_replace('/(<title\\b[^>]*>|<\\\\/head\\s*>)/is', '<###head###>$1', $output, 1, $count);\n\t\t\tif ($count)\n\t\t\t\t$output = str_replace('<###head###>', $html, $output);\n\t\t\telse\n\t\t\t\t$output = $html . $output;\n\t\t}\n\t}", "public function doOutputCompress() {}", "function My_ob_start(){\r\n global $eqdkp;\r\n if ( $eqdkp->config['enable_gzip'] == '1' ){\r\n if ( (extension_loaded('zlib')) && (!headers_sent()) ){\r\n @ob_start('ob_gzhandler');\r\n }\r\n }else{\r\n @ob_start();\r\n }\r\n}", "function ob_deflatehandler($data, $mode) {}", "public function hookHeader()\n\t{\n\t\t/* If 1.4 and no backward, then leave */\n\t\tif (!$this->backward)\n\t\t\treturn;\n\n\t\t/* Continue only if we are in the checkout process */\n\t\tif (Tools::getValue('controller') != 'order-opc' && (!($_SERVER['PHP_SELF'] == __PS_BASE_URI__.'order.php' || $_SERVER['PHP_SELF'] == __PS_BASE_URI__.'order-opc.php' || Tools::getValue('controller') == 'order' || Tools::getValue('controller') == 'orderopc' || Tools::getValue('step') == 3)))\n\t\t\treturn;\n\n\t\t/* Load JS and CSS files through CCC */\n\t\t$this->context->controller->addCSS($this->_path.'views/css/stripe-prestashop.css');\n\t\t\n\t\treturn '<script src=\"https://checkout.stripe.com/checkout.js\"></script>';\n\t}", "function generateScriptHeader(& $Code) {\r\n ob_start();\r\n ?>\r\n/**@ * include 'remoteobject.js';\r\n <?php\r\n switch ( $this->RequestMethod ) {\r\n case 'rawpost':\r\n ?>\r\n* include 'request/rawpost.js';\r\n <?php\r\n break;\r\ncase 'post':\r\n ?>\r\n* include 'request/rawpost.js';\r\n <?php\r\n break;\r\n }\r\n\r\n if ( $this->RequestEncoding == 'xml' ) {\r\n ?>\r\n\r\n* include 'encode/xml.js';\r\n <?php\r\n } else {\r\n ?>\r\n* include 'encode/php.js';\r\n <?php\r\n }\r\n ?>\r\n*/\r\n <?php\r\n $Code->append(ob_get_contents());\r\n ob_end_clean();\r\n }", "public function add_to_head($data)\n\t{\n\t\t// Deprecated for scripts. Let's encourage good practices. This will\n\t\t// also let us move jquery in the future.\n\t\tif (strpos($data, '<script') !== FALSE)\n\t\t{\n\t\t\tee()->load->library('logger');\n\t\t\tee()->logger->deprecated('2.8', 'CP::add_to_foot() for scripts');\n\t\t}\n\n\t\t$this->its_all_in_your_head[] = $data;\n\t}", "function BeginCompression()\n\t{\n\t\tif(!$this->bWorking) return ;\n\t\t$phpver = phpversion();\n\t\t$useragent = (isset($_SERVER[\"HTTP_USER_AGENT\"]) ) ? $_SERVER[\"HTTP_USER_AGENT\"] : $HTTP_USER_AGENT;\n\t\tif ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) )\n\t\t{\n\t\t\tif ( extension_loaded('zlib') )\n\t\t\t{\n\t\t\t\t$this->Log();\n\t\t\t\t\n\t\t\t\tif(!ini_get('zlib.output_compression') && @ob_start('ob_gzhandler'))\n\t\t\t\t\t$this->b_ob_gzhandler = true;\n\t\t\t}\n\t\t}\n\t\telse if ( $phpver > '4.0' )\n\t\t{\n\t\t\tif ( isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') )\n\t\t\t{\n\t\t\t\tif ( extension_loaded('zlib') )\n\t\t\t\t{\n\t\t\t\t\t$this->bCompress = TRUE;\n\t\t\t\t\tob_start();\n\t\t\t\t\tob_implicit_flush(0);\n\t\t\t\t\theader('Content-Encoding: gzip');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function start_etag_ob() {\n\t\tob_start();\n\t}", "function __rocket_dns_prefetch_buffer( $buffer ) {\n\t$dns_link_tags = '';\n\t$domains = rocket_get_dns_prefetch_domains();\n\n\tif ( (bool) $domains ) {\n\t\tforeach ( $domains as $domain ) {\n\t\t\t$dns_link_tags .= '<link rel=\"dns-prefetch\" href=\"' . esc_url( $domain ) . '\" />';\n\t\t}\n\t}\n\n\t$old_ie_conditional_tag = '';\n\t\n\t/**\n\t * Allow to print an empty IE conditional tag to speed up old IE versions to load CSS & JS files\n\t *\n\t * @since 2.6.5\n\t *\n\t * @param bool true will print the IE conditional tag\n\t */\n\tif ( apply_filters( 'do_rocket_old_ie_prefetch_conditional_tag', true ) ) {\n\t\t$old_ie_conditional_tag = '<!--[if IE]><![endif]-->';\n\t}\n\n\t// Insert all DNS prefecth tags in head\n\t$buffer = preg_replace( '/<head(.*)>/', '<head$1>' . $old_ie_conditional_tag . $dns_link_tags, $buffer, 1 );\n\n\treturn $buffer;\n}", "public static function after_header() {\r\n\r\n\t}", "public function addScriptToHeader($context)\n\t\t{\n\t\t\tif(!empty(Symphony::Engine()->Author))\n\t\t\t{\n\t\t\t\tif(Symphony::Engine()->Author->isDeveloper())\n\t\t\t\t{\n\t\t\t\t\t$context['output'] = str_replace('</head>', '\n\t\t\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" media=\"screen,tv,projection\" href=\"'.URL.'/extensions/frontend_debug/assets/frontend_debug.css\" />\n\t\t\t\t\t\t<script type=\"text/javascript\" src=\"'.URL.'/extensions/frontend_debug/assets/frontend_debug.js\"></script>\n\t\t\t\t\t\t</head>', $context['output']);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function startOutputBuffering() {}", "function print_head_scripts() {\n\tglobal $asc_scripts, $concatenate_scripts;\n\n\tif ( ! did_action('asc_print_scripts') ) {\n\t\t/** This action is documented in functions.asc-scripts.php */\n\t\tdo_action( 'asc_print_scripts' );\n\t}\n\n\tif ( !is_a($asc_scripts, 'ASC_Scripts') )\n\t\t$asc_scripts = new ASC_Scripts();\n\n\tscript_concat_settings();\n\t$asc_scripts->do_concat = $concatenate_scripts;\n\t$asc_scripts->do_head_items();\n\n\t/**\n\t * Filter whether to print the head scripts.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param bool $print Whether to print the head scripts. Default true.\n\t */\n\tif ( apply_filters( 'print_head_scripts', true ) ) {\n\t\t_print_scripts();\n\t}\n\n\t$asc_scripts->reset();\n\treturn $asc_scripts->done;\n}", "protected function after_filter()\n {\n $this->render('footer.php');\n }", "public function output_head() {\n\t\t// Verify tracking status\n\t\tif ( $this->disable_tracking() ) return;\n\n\t\t// no indentation on purpose\n\t\t?>\n<!-- Start WooCommerce KISSmetrics -->\n<script type=\"text/javascript\">\n\tvar _kmq = _kmq || [];\n\tfunction _kms(u) {\n\t\tsetTimeout(function () {\n\t\t\tvar s = document.createElement('script');\n\t\t\tvar f = document.getElementsByTagName('script')[0];\n\t\t\ts.type = 'text/javascript';\n\t\t\ts.async = true;\n\t\t\ts.src = u;\n\t\t\tf.parentNode.insertBefore(s, f);\n\t\t}, 1);\n\t}\n\t_kms('//i.kissmetrics.com/i.js');\n\t_kms('//doug1izaerwt3.cloudfront.net/<?php echo $this->api_key; ?>.1.js');\n\t_kmq.push(['identify', '<?php echo $this->get_identity(); ?>']);\n\t<?php if ( is_front_page() && $this->event_name['viewed_homepage'] ) echo \"_kmq.push(['record', '\" . $this->event_name['viewed_homepage'] . \"' ]);\\n\"; ?>\n</script>\n<!-- end WooCommerce KISSmetrics -->\n\t\t<?php\n\t}", "public function hook() {\n add_filter('pre_get_document_title', [$this, 'getTitle'], 10);\n add_filter('wp_head', [$this, 'outputMetaDescription'], 1);\n add_filter('wp_head', [$this, 'ogTags'], 2 );\n }", "function actijour_header_prive($flux)\n{\n $exec = _request('exec');\n if (preg_match('@^(actijour_).*@i', $exec)) {\n $flux .= '<script type=\"text/javascript\" src=\"' . _DIR_PLUGIN_ACTIJOUR . 'func_js_acj.js\"></script>' . \"\\n\";\n }\n return $flux;\n}", "abstract protected function RenderHead();", "public function bufferStart() {\n\t\tob_start( array( $this, 'obCallback' ) );\n\t}", "function rest_output_link_wp_head()\n {\n }", "private function render(){\n\t\t$this->instance = new CSSCompression();\n\n\t\tif ( $this->mode ) {\n\t\t\t$this->instance->mode( $this->mode );\n\t\t}\n\n\t\tif ( $this->options ) {\n\t\t\t$this->instance->option( $this->options );\n\t\t}\n\n\t\techo $this->instance->compress( $this->content );\n\t}", "function dw2_header_prive($flux) {\r\n\t\t$flux .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"'._DIR_PLUGIN_DW2.'dw2_styles.css\" />'.\"\\n\";\r\n\t\t$flux .= '<script type=\"text/javascript\" src=\"'._DIR_PLUGIN_DW2.'dw2_back.js\"></script>'.\"\\n\";\r\n\t\treturn $flux;\r\n\t}", "public function renderHead(&$output)\n\t{\n\t\t$html='';\n\t\tforeach($this->metaTags as $meta)\n\t\t\t$html.=CHtml::metaTag($meta['content'],null,null,$meta).\"\\n\";\n\t\tforeach($this->linkTags as $link)\n\t\t\t$html.=CHtml::linkTag(null,null,null,null,$link).\"\\n\";\n\t\t\t\n\t\t//nlac:\n\t\t$html.= self::defCssLoader();\n\n\t\tforeach($this->cssFiles as $url=>$media)\n\t\t\t$html.=self::cssFile($url,$media).\"\\n\";\n\t\tforeach($this->css as $css)\n\t\t\t$html.=CHtml::css($css[0],$css[1]).\"\\n\";\n\t\tif($this->enableJavaScript)\n\t\t{\n\t\t\tif(isset($this->scriptFiles[self::POS_HEAD]))\n\t\t\t{\n\t\t\t\tforeach($this->scriptFiles[self::POS_HEAD] as $scriptFile)\n\t\t\t\t\t$html.=self::scriptFile($scriptFile).\"\\n\";\n\t\t\t}\n\n\t\t\tif(isset($this->scripts[self::POS_HEAD]))\n\t\t\t\t$html.=CHtml::script(implode(\"\\n\",$this->scripts[self::POS_HEAD])).\"\\n\";\n\t\t}\n\n\t\tif($html!=='')\n\t\t{\n\t\t\t$count=0;\n\t\t\t$output=preg_replace('/(<title\\b[^>]*>|<\\\\/head\\s*>)/is','<###head###>$2',$output,1,$count);\n\t\t\tif($count)\n\t\t\t\t$output=str_replace('<###head###>',$html,$output);\n\t\t\telse\n\t\t\t\t$output=$html.$output;\n\t\t}\n\t}", "public function start_buffer() {\n\t\tob_start();\n\t}", "public function appendFilterChain( & $viewBufferContent )\n {\n // remove html comments\n // Replace all repeated spaces, newlines, tabs with a single space\n $pattern = array(\"/\\<!--[^\\n\\r\\>]*--\\>/u\", \"/[ ]{2,}/u\", \"/\\>[ ]+\\</u\");\n $replace = array(\"\", \" \", \"><\");\n $viewBufferContent = preg_replace($pattern, $replace, $viewBufferContent);\n }", "function charity_head_profile() {\n $content = '<head profile=\"http://gmpg.org/xfn/11\">' . \"\\n\";\n echo apply_filters('charity_head_profile', $content);\n}", "function init()\n\t{\n\t\tob_start();\n\t}", "public function headers_text() {\r\n $this->output['headers'] = NULL;\r\n $this->output['headers'][] = 'Content-Type: text/text';\r\n $this->output['headers'][] = 'Cache-Control: no-cache, must-revalidate';\r\n $this->output['headers'][] = 'Expires: Sat, 26 Jul 1997 05:00:00 GMT';\r\n\r\n return;\r\n }", "function ihs_add_script_header() {\n\n\t\t$output = '';\n\n\t\t$id = ihs_get_current_page_id();\n\t\tif ( $id ) {\n\t\t\t$output = stripslashes( get_post_meta( $id, 'ihs_add_script_header_meta', true ) );\n\t\t}\n\t\techo $output;\n\t}", "private function renderHead() {\n\t\t$head = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . PHP_EOL;\n\t\tif (!empty($this->stylesheets))\n\t\t\t$head .= implode(PHP_EOL, $this->stylesheets);\n\n\t\tif ($this->type == 'RSS2') {\n\t\t\t$head .= $this->openTag('rss', array(\n\t\t\t\t\t\t\"version\" => \"2.0\",\n\t\t\t\t\t\t\"xmlns:content\" => \"http://purl.org/rss/1.0/modules/content/\",\n\t\t\t\t\t\t\"xmlns:atom\" => \"http://www.w3.org/2005/Atom\",\n\t\t\t\t\t\t\"xmlns:wfw\" => \"http://wellformedweb.org/CommentAPI/\")) . PHP_EOL;\n\t\t} elseif ($this->type == 'RSS1') {\n\t\t\t$head .= $this->openTag('rdf:RDF', array(\n\t\t\t\t\t\t\"xmlns:rdf\" => \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\",\n\t\t\t\t\t\t\"xmlns\" => \"http://purl.org/rss/1.0/\",\n\t\t\t\t\t\t\"xmlns:dc\" => \"http://purl.org/dc/elements/1.1/\"\n\t\t\t\t\t)) . PHP_EOL;\n\t\t} else if ($this->type == 'Atom') {\n\t\t\t$head .= $this->openTag('feed', array(\"xmlns\" => \"http://www.w3.org/2005/Atom\")) . PHP_EOL;\n\t\t}\n\t\treturn $head;\n\t}", "public static function startStream(){\n try{\n //try to change the server functions first\n // Turn off output buffering\n ini_set('output_buffering', 'off');\n // Turn off PHP output compression\n ini_set('zlib.output_compression', false);\n // Implicitly flush the buffer(s)\n ini_set('implicit_flush', true); \n }catch(Exception $e){\n \n } \n //Flush (send) the output buffer and turn off output buffering\n while (@ob_end_flush()); \n ob_implicit_flush(true);\n \n //now add browser tweaks\n echo str_pad(\"\",1024,\" \");\n echo \"<br />\";\n ob_flush();\n flush();\n sleep(1);\n }", "public function addHead()\n {\n if (file_exists(DIRREQ . \"app/view/{$this->getDir()}/head.php\")) {\n include(DIRREQ . \"app/view/{$this->getDir()}/head.php\");\n }\n }", "protected function _compress()\n {\n if ((bool)$this->_options['compress']) {\n header('Content-encoding: gzip');\n $this->DISPLAY = gzcompress($this->DISPLAY, $this->_options['compress']);\n }\n }", "function fragmention_insert_head($flux) {\n\t$flux = fragmention_insert_head_css($flux);\n\t$flux .= '<script type=\"text/javascript\" src=\"'.find_in_path('js/fragmention.js').'\"></script>'.\"\\n\";\n\treturn $flux;\n}", "public function onBeforeCompileHead() {\n\t\t$document = JFactory::getDocument();\n\t\t$headData = $document->getHeadData();\n\t\t$scripts = &$headData['scripts'];\n\n\t\t// удалить скрипт из массива в админке\n\t\tunset($scripts['/media/k2/assets/js/k2.frontend.js?v=2.8.0&amp;sitepath=/']);\n\t\t$headData['scripts'] = $scripts;\n\t\t$document->setHeadData($headData);\n\n // Проверить это это страницы админки\n $app = JFactory::getApplication();\n if ($app->isSite()) {\n return;\n }\n\n $document = JFactory::getDocument();\n\n // подключить скрипт для сортировки\n $document->addScript(JUri::root().'plugins/system/newwallet_sort/js/sort.js' );\n\t}", "public static function header_output() {\n\t\tob_start();\n\n\t\tif ( self::options( 'header_type' ) == 'navbar-fixed-top' ) {\n\t\t\techo 'body{padding-top: 50px;}';\n\t\t}\n\n\t\tif ( ! display_header_text() ) {\n\t\t\techo '#site-title,.site-description{position: absolute;clip: rect(1px, 1px, 1px, 1px);}';\n\t\t} else {\n\t\t\tself::generate_css( '#site-title', 'color', 'header_textcolor', '#' );\n\t\t}\n\t\t$extra_css = apply_filters( 'maketador_header_output', ob_get_clean() );\n\t\tif ( ! empty( $extra_css ) ) {\n\t\t\techo '<style type=\"text/css\">' . $extra_css . '</style>';\n\t\t}\n\t\t?>\n\t\t<?php\n\t}", "public function run()\n {\n // dispatch all routes [between events]\n $this->trigger('horus.dispatch.before');\n if(($o = $this->router->exec()) !== false) echo $o;\n else $this->e404();\n $this->trigger('horus.dispatch.after');\n\n // get the output\n // prepare then only send if the request is not head\n $this->output .= ob_get_clean();\n $this->trigger('horus.output.before', array($this));\n $this->output = $this->trigger('horus.output.filter', $this->output, $this->output);\n (strtoupper($_SERVER['REQUEST_METHOD']) == 'HEAD') or print $this->output;\n $this->trigger('horus.output.after', array($this));\n\n // end\n ob_get_level() < 1 or ob_end_flush(); exit;\n }", "function qa_initialize_buffering($request = '')\n{\n\tif (headers_sent()) {\n\t\treturn false;\n\t}\n\n\t$useGzip = QA_HTML_COMPRESSION && substr($request, 0, 6) !== 'admin/' && extension_loaded('zlib');\n\tob_start($useGzip ? 'ob_gzhandler' : null);\n\treturn true;\n}", "public function head_cleanup() {\n\t\tremove_action('wp_head', 'feed_links_extra', 3);\n\t\tadd_action('wp_head', 'ob_start', 1, 0);\n\t\tadd_action('wp_head', function () {\n\t\t\t$pattern = '/.*' . preg_quote(esc_url(get_feed_link('comments_' . get_default_feed())), '/') . '.*[\\r\\n]+/';\n\t\t\techo preg_replace($pattern, '', ob_get_clean());\n\t\t}, 3, 0);\n\n\t\tremove_action('wp_head', 'rsd_link');\n\t\tremove_action('wp_head', 'wlwmanifest_link');\n\t\tremove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);\n\t\tremove_action('wp_head', 'wp_generator');\n\t\tremove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);\n\t\tremove_action('wp_head', 'print_emoji_detection_script', 7);\n\t\tremove_action('admin_print_scripts', 'print_emoji_detection_script');\n\t\tremove_action('wp_print_styles', 'print_emoji_styles');\n\t\tremove_action('admin_print_styles', 'print_emoji_styles');\n\t\tremove_action('wp_head', 'wp_oembed_add_discovery_links');\n\t\tremove_action('wp_head', 'wp_oembed_add_host_js');\n\t\tremove_action('wp_head', 'rest_output_link_wp_head', 10, 0);\n\t\tremove_filter('the_content_feed', 'wp_staticize_emoji');\n\t\tremove_filter('comment_text_rss', 'wp_staticize_emoji');\n\t\tremove_filter('wp_mail', 'wp_staticize_emoji_for_email');\n\t\tadd_filter('use_default_gallery_style', '__return_false');\n\n\t\tglobal $wp_widget_factory;\n\n\t\tif (isset($wp_widget_factory->widgets['WP_Widget_Recent_Comments'])) {\n\t\t\tremove_action('wp_head', [$wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style']);\n\t\t}\n\n\t\tif (!class_exists('WPSEO_Frontend')) {\n\t\t\tremove_action('wp_head', 'rel_canonical');\n\t\t\tadd_action('wp_head', [$this, 'rel_canonical']);\n\t\t}\n\n\t\tif (class_exists('SitePress')) {\n\t\t\tdefine('ICL_DONT_LOAD_NAVIGATION_CSS', true);\n\t\t\tdefine('ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS', true);\n\t\t\tdefine('ICL_DONT_LOAD_LANGUAGES_JS', true);\n\t\t\tremove_action( 'wp_head', [ $GLOBALS['sitepress'], 'meta_generator_tag', 20 ] );\n\t\t}\n\n\t\tif ( class_exists( 'woocommerce' ) ) {\n\t\t\tadd_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );\n\t\t}\n\t}", "public function replace() {\n\n\t\t$styles = array();\n\t\t$scripts = array();\n\n\t\t/**\n\t\t * Extract the buffer's contents (from wp_head() or wp_footer())\n\t\t *\n\t\t */\n\t\t$html = ob_get_clean();\n\t\t\n\t\t/**\n\t\t * Match all <link>s that are stylesheets\n\t\t * @TODO: Only match if media=\"all\"\n\t\t *\n\t\t */\n\t\t$css = '/<link.*?stylesheet.*?href=[\\'|\"]([^\\'|\"]+)[\\'|\"][^>]+?>/';\n\t\tpreg_match_all( $css, $html, $styles );\n\t\t\n\t\tif ( !empty( $styles[ 1 ] ) ) {\n\t\t\t/**\n\t\t\t * Styles exist, strip them from the buffer\n\t\t\t *\n\t\t\t */\n\t\t\t$html = preg_replace( $css, '', $html );\n\t\t\t/**\n\t\t\t * Create MD5 hash of all file names in order\n\t\t\t *\n\t\t\t */\n\t\t\t$hash = $this->hash_files( $styles[1] );\n\t\t\t$styles = $this->combine( $hash, $styles[1], 'css' );\n\t\t} else {\n\t\t\t$styles = '';\n\t\t}\n\t\n\t\t/**\n\t\t * Match all <script>s\n\t\t *\n\t\t */\n\t\t$js = '/<script.*src=[\\'|\"]([^\"|\\']+)[\\'|\"].*><\\/script>/';\n\t\tpreg_match_all( $js, $html, $scripts );\n\n\t\tif ( !empty( $scripts[ 1 ] ) ) {\n\t\t\t/**\n\t\t\t * Scripts exist, strip them from the buffer\n\t\t\t *\n\t\t\t */\n\t\t\t$html = preg_replace( $js, '', $html );\n\t\t\t/**\n\t\t\t * Create MD5 hash of all file names in order\n\t\t\t *\n\t\t\t */\n\t\t\t$hash = $this->hash_files( $scripts[1] );\n\t\t\t$scripts = $this->combine( $hash, $scripts[1], 'js' );\n\t\t\t\n\t\t} else {\n\t\t\t$scripts = '';\n\t\t}\n\t\t\n\t\t/* Print the scripts first if in the header, last if in the footer */\n\t\tif( doing_action( 'wp_footer' ) ) {\n\t\t\t$html .= $styles . $scripts;\n\t\t} else {\n\t\t\t$html = $styles . $scripts . $html;\n\t\t}\n\t\t\n\t\techo $html;\n\n\t}", "public function buffer()\n {\n if ($this->_disabled) {\n return;\n }\n\n if ($this->isTurbo()) {\n return;\n }\n\n ob_start();\n $this->output();\n $this->_html = ob_get_contents();\n ob_end_clean();\n }", "function getHead() {\n\n $out = \"\";\n\n if ($this->meta_keywords) array_push($this->head, \"<meta name='keywords' content='{$this->meta_keywords}' />\");\n if ($this->meta_description) array_push($this->head, \"<meta name='description' content='{$this->meta_description}' />\");\n\n foreach ($this->head as $string) {\n $out .= \" $string\\n\";\n }\n return \"\\n$out\\n\";\n }", "private function compileHeader()\n\t\t{\n\t\t\t$query = @$this->getUrl(\"query\");\n\t\t\t$url = $this->getUrl(\"path\") . ($query == null ? null : \"?{$query}\");\n\t\t\t\n\t\t\t// Set data length\n\t\t\tif(($length = strlen($this->getBody())) > 0)\n\t\t\t\t$this->_headers->set(new HttpHeaderItem(\"Content-Length\", $length));\n\t\t\t\n\t\t\t// Sort and build header\n\t\t\t$headers = $this->convertHeadersToAssocArray($this->_headers);\n\t\t\tarsort($headers);\n\t\t\t\n\t\t\t$header = $this->getMethod() . \" {$url} \" . $this->getProtocolVersion() . self::HTTP_SEPERATOR;\n\t\t\t$header .= $this->mergeAssocArray(\": \", self::HTTP_SEPERATOR, $headers);\n\t\t\t\n\t\t\t// Return generated header\n\t\t\treturn $header . self::HTTP_DOUBLE_SEPERATOR;\n\t\t}", "function print_head_scripts()\n {\n }", "private function _print_html_head()\n\t{\n\t\t$output = \"<head>\\n\";\n\t\t$output .= \"<title>{$this->title}</title>\\n\";\n\t\t$output .= $this->_print_html_head_metatags();\n\t\t$output .= $this->_print_html_head_javascript();\n\t\t$output .= $this->_print_html_head_css();\n\t\t$output .= \"</head>\\n<body>\\n\";\n\t\t\n\t\treturn $output;\n\t}", "public function startContent() {\n ob_start();\n }", "function ob_start($params=array()){\n\t\t\n\t\t$app =& Dataface_Application::getInstance();\n\t\t$query =& $app->getQuery();\n\t\tif ( in_array($query['-action'], $this->exemptActions) ){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif ( floatval($this->threshold) * floatval(100) > rand(0,100) ){\n\t\t\tregister_shutdown_function(array(&$this, 'cleanCache'));\n\t\t}\n\t\n\t\tif ( isset($params['randomize']) and $params['randomize'] > 1 ){\n\t\t\t$this->randomize = $params['randomize'];\n\t\t\t$numVersions = $this->numCurrentVersions($params);\n\t\t\tif ( $numVersions < $params['randomize'] ){\n\t\t\t\t// We don't have enough versions yet to do a proper randomization.\n\t\t\t\tif ( floatval(100)*floatval($numVersions)/floatval($params['randomize']) > rand(0,100) ){\n\t\t\t\t\t// We will use the cached version\n\t\t\t\t\t$useCache = true;\n\t\t\t\t} else {\n\t\t\t\t\t$useCache = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$useCache = true;\n\t\t\t}\n\t\t} else {\n\t\t\t$useCache = true;\n\t\t}\n\t\t\n\t\tif ( $useCache ){\n\t\t\t//echo \"Trying to use cached version\";\n\t\t\t$output = $this->getPage($params);\n\t\t} else {\n\t\t\t//echo \"Not using cached version\";\n\t\t\t$output = null;\n\t\t}\n\t\t\n\t\tif ( isset($output) ){\n\t\t\t//echo \"Using cached version\";\n\t\t\t//$last_modified_time = filemtime($file);\n\t\t\t$etag = md5($output);\n\t\t\theader(\"Last-Modified: \".gmdate(\"D, d M Y H:i:s\", $this->lastModified).\" GMT\");\n\t\t\theader(\"Etag: $etag\");\n\t\t\t\n\t\t\tif (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $this->lastModified ||\n\t\t\t\ttrim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag) {\n\t\t\t\theader(\"HTTP/1.1 304 Not Modified\");\n\t\t\t\texit;\n\t\t\t}\n\t\t\t\n\t\t\t// Send the necessary headers\n\t\t\tif ( function_exists('headers_list')){\n\t\t\t\t$hlist = headers_list();\n\t\t\t\t$harr = array();\n\t\t\t\tforeach ($hlist as $h){\n\t\t\t\t\tlist($hname,$hval) = array_map('trim',explode(':',$h));\n\t\t\t\t\t$harr[$hname] = $hval;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tforeach ( $this->headers as $h){\n\t\t\t\t\tlist($hname,$hval) = array_map('trim',explode(':',$h));\n\t\t\t\t\tif ( !isset($harr[$hname]) ){\n\t\t\t\t\t\theader($hname.': '.$hval);\n\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\tif ( $this->gzipSupported() and $this->useGzipCompression ){\n\t\t\t\theader(\"Content-Encoding: gzip\");\n\t\t\t\techo $output;\n\t\t\t} else {\n\t\t\t\techo $output;\n\t\t\t}\n\t\t\texit;\n\t\t}\n\t\t\n\t\tob_start(array(&$this, 'ob_flush'));\n\t\tob_implicit_flush(0);\n\t\treturn true;\n\t}", "public function buildHeadMarkup(){\n\n echo file_get_contents(\"head/home.html\");\n\n $this->head_script_tags = \"\";\n\n foreach( $this->head_scripts as $value ){\n\n $this->head_script_tags .= \"<script src=\\\"\" . $value . \"\\\"></script>\";\n\n }\n\n $this->head = file_get_contents(\"head/home.html\").$this->head_script_tags.\"</head>\";\n\n }", "function fast_plugin_header_prive($flux){\r\n\t$page = get_fast_plugin();\r\n\t$exec = $_GET[\"exec\"];\r\n\t\r\n\tif (autoriser('acces','fast_plugin',$exec)) {\r\n\t\t$plugin = $page[$exec][\"plugin\"];\r\n\t\t\r\n\t\tif (file_exists(\"../plugins/$plugin/js/$exec.js\"))\t$flux .=\"<script type='text/javascript' src='../plugins/$plugin/js/$exec.js'></script>\";\r\n\t\tif (file_exists(\"../plugins/$plugin/css/$exec.css\"))$flux .=\"<link type='text/css' rel='stylesheet' href='../plugins/$plugin/css/$exec.css' />\";\r\n\t\t\r\n\t\t/* ajout des css / jss */\r\n\t\tif ($page[$exec][\"addCss\"]){\r\n\t\t\t$a = explode(\",\",$page[$exec][\"addCss\"]);\r\n\t\t\tfor ($i = 0; $i < count($a); $i++) {\r\n\t\t\t\t$file = $a[$i];\r\n\t\t\t\tif (file_exists($file))$flux .=\"<link type='text/css' rel='stylesheet' href='$file' />\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\tif ($page[$exec][\"addJS\"]){\r\n\t\t\t$a = explode(\",\",$page[$exec][\"addJS\"]);\r\n\t\t\tfor ($i = 0; $i < count($a); $i++) {\r\n\t\t\t\t$file = $a[$i];\r\n\t\t\t\tif (file_exists($file)) $flux .=\"<script type='text/javascript' src='$file'></script>\";;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\treturn $flux;\r\n}", "public function renderHead()\n {\n if ($this->enabled) {\n return $this->getRenderer()->renderHead();\n }\n }", "function pkwk_common_headers()\n{\n\tif (! PKWK_OPTIMISE) pkwk_headers_sent();\n\n\tif(defined('PKWK_ZLIB_LOADABLE_MODULE')) {\n\t\t$matches = array();\n\t\tif(ini_get('zlib.output_compression') &&\n\t\t preg_match('/\\b(gzip|deflate)\\b/i', $_SERVER['HTTP_ACCEPT_ENCODING'], $matches)) {\n\t\t \t// Bug #29350 output_compression compresses everything _without header_ as loadable module\n\t\t \t// http://bugs.php.net/bug.php?id=29350\n\t\t\theader('Content-Encoding: ' . $matches[1]);\n\t\t\theader('Vary: Accept-Encoding');\n\t\t}\n\t}\n}", "protected function outputHeaders() {\n $controlFlags = [];\n if (!$this->cacheable) {\n $controlFlags[] = 'no-store';\n $controlFlags[] = 'no-cache';\n } else {\n if ($this->revalidate) {\n $controlFlags[] = 'no-cache';\n $controlFlags[] = 'must-revalidate';\n }\n $controlFlags[] = $this->private ? 'private' : 'public';\n if ($this->age > 0) {\n $controlFlags[] = 'max-age=' . (int)round($this->age);\n }\n if (!empty($this->ETag)) {\n $this->setHeader('ETag', $this->ETag);\n }\n if (!is_null($this->modifiedDate)) {\n $this->setHeader('Last-Modified', $this->httpUtils->formatDateTime($this->modifiedDate));\n }\n }\n if (!empty($controlFlags)) {\n $this->setHeader('Cache-Control', implode(', ', $controlFlags));\n }\n parent::outputHeaders();\n }", "public function PreparerMiseEnCache()\n\t\t{\n\t\t\tob_start();\n\t\t}", "function add_late_scripts()\n\t{\n\t\t// only procceed if we have finished printing footer scripts\n\t\tif (did_action('bwp_minify_after_footer_scripts'))\n\t\t\t$this->todo_late_scripts = 'footer' . $this->late_script_order;\n\t}", "function rainette_insert_head($flux) {\n\t$flux .= rainette_insert_head_css($flux);\n\n\treturn $flux;\n}", "protected function transpileEndPrepend(): string\n {\n return '<?php $__env->stopPrepend(); ?>';\n }", "function head_cleanup() {\n\t// Originally from http://wpengineer.com/1438/wordpress-header/\n\tremove_action( 'wp_head', 'feed_links_extra', 3 );\n\tadd_action( 'wp_head', 'ob_start', 1, 0 );\n\tadd_action( 'wp_head', function () {\n\t\t$pattern = '/.*' . preg_quote( esc_url( get_feed_link( 'comments_' . get_default_feed() ) ), '/' )\n\t\t . '.*[\\r\\n]+/';\n\t\techo preg_replace( $pattern, '', ob_get_clean() );\n\t}, 3, 0 );\n\tremove_action( 'wp_head', 'rsd_link' );\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10 );\n\tremove_action( 'wp_head', 'wp_generator' );\n\tremove_action( 'wp_head', 'wp_shortlink_wp_head', 10 );\n\tremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\tremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\tremove_action( 'wp_print_styles', 'print_emoji_styles' );\n\tremove_action( 'admin_print_styles', 'print_emoji_styles' );\n\tremove_action( 'wp_head', 'wp_oembed_add_discovery_links' );\n\tremove_action( 'wp_head', 'wp_oembed_add_host_js' );\n\tremove_action( 'wp_head', 'rest_output_link_wp_head', 10 );\n\tremove_filter( 'the_content_feed', 'wp_staticize_emoji' );\n\tremove_filter( 'comment_text_rss', 'wp_staticize_emoji' );\n\tremove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );\n\tadd_filter( 'use_default_gallery_style', '__return_false' );\n\tadd_filter( 'emoji_svg_url', '__return_false' );\n\n\tglobal $wp_widget_factory;\n\n\tif ( isset( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'] ) ) {\n\t\tremove_action( 'wp_head',\n\t\t [ $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ] );\n\t}\n\n\tif ( ! class_exists( 'WPSEO_Frontend' ) ) {\n\t\tremove_action( 'wp_head', 'rel_canonical' );\n\t\tadd_action( 'wp_head', __NAMESPACE__ . '\\\\rel_canonical' );\n\t}\n}", "protected function setHeadTags()\n {\n $strTagClose = ($GLOBALS['objPage']->outputFormat == 'xhtml')\n ? ' />'\n : '>';\n\n // Add rel=\"prev\" and rel=\"next\" links (see #3515)\n if ($this->hasPrevious()) {\n $GLOBALS['TL_HEAD'][] = '<link rel=\"prev\" href=\"' .\n $this->linkToPage($this->intPage - 1) .\n '\"' . $strTagClose;\n }\n if ($this->hasNext()) {\n $GLOBALS['TL_HEAD'][] = '<link rel=\"next\" href=\"' .\n $this->linkToPage($this->intPage + 1) .\n '\"' . $strTagClose;\n }\n }", "private function printHead()\n\t{\n\t\t$out = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . \"\\n\";\n\t\t$out .= $this->head . PHP_EOL;;\t\t\t\n\t\techo $out;\n\t}", "public function render()\n\t{\n\t\t$this->addHTTPHeader('Content-Type', $this->getMimeType());\n\n\t\t$name = $this->getName();\n\n\t\tif (!empty($name))\n\t\t{\n\t\t\t$this->addHTTPHeader('Content-Disposition', 'attachment; filename=\"' . $name . '.json\"', true);\n\t\t}\n\n\t\t$this->outputHTTPHeaders();\n\n\t\tif ($this->useHashes)\n\t\t{\n\t\t\techo '###' . $this->getBuffer() . '###';\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo $this->getBuffer();\n\t\t}\n\t}", "private function do_header() {\n $m_header = '';\n $m_header .= '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />';\n $m_header .= '<meta http-equiv=\"Content-Language\" content=\"en-gb\" />';\n // $m_header .= '<link rel=stylesheet href=' . $this->c_path . '/../css/reset.css type=text/css />';\n // $m_header .= '<link rel=stylesheet href=' . $this->c_path . '/../css/style.css type=text/css />';\n $this->c_header = $m_header;\n }", "static function head($content='') {\n\t\t$content = self::meta('charset') . $content; //auto-prepend charset because it's always needed\n\t\treturn self::tag('head', false, $content);\n\t}", "public function beforeOutput() {\n if (!($this->response instanceof jResponseHtml))\n return;\n global $gJConfig;\n\n $compileFlag = STYLUS_ASSETIC_COMPILE_ONCHANGE;\n if( isset($gJConfig->jResponseHtml['stylusAssetic_compile']) ) {\n switch($gJConfig->jResponseHtml['stylusAssetic_compile']) {\n case 'always':\n $compileFlag = STYLUS_ASSETIC_COMPILE_ALWAYS;\n break;\n case 'onchange':\n $compileFlag = STYLUS_ASSETIC_COMPILE_ONCHANGE;\n break;\n case 'once':\n $compileFlag = STYLUS_ASSETIC_COMPILE_ONCE;\n break;\n }\n }\n\n $nodeBinPath = '/usr/bin/node';\n if(isset($gJConfig->jResponseHtml['stylusAssectic_node_bin_path']) && $gJConfig->jResponseHtml['stylusAssectic_node_bin_path'] != '') {\n $nodeBinPath = $gJConfig->jResponseHtml['stylusAssectic_node_bin_path'];\n }\n\n $nodePaths = array();\n if(isset($gJConfig->jResponseHtml['stylusAssectic_node_paths']) && $gJConfig->jResponseHtml['stylus_node_paths'] != '') {\n $nodePaths = explode(',', $gJConfig->jResponseHtml['stylus_node_paths']);\n }\n\n $inputCSSLinks = $this->response->getCSSLinks();\n $outputCSSLinks = array();\n\n foreach( $inputCSSLinks as $inputCSSLinkUrl=>$CSSLinkParams ) {\n $CSSLinkUrl = $inputCSSLinkUrl;\n if( isset($CSSLinkParams['stylus']) ) {\n if( $CSSLinkParams['stylus'] ) {\n //we suppose url starts with basepath. Other cases should not have a \"'stylus' => true\" param ...\n if( substr($CSSLinkUrl, 0, strlen($gJConfig->urlengine['basePath'])) != $gJConfig->urlengine['basePath'] ) {\n throw new Exception(\"File $CSSLinkUrl seems not to be located in your basePath : it can not be processed with Assetic's StylusFilter\");\n } else {\n $filePath = jApp::wwwPath() . substr($CSSLinkUrl, strlen($gJConfig->urlengine['basePath']));\n\n $outputSuffix = '';\n if( substr($filePath, -5) != '.styl' ) {\n //append .styl at the end of filename if it is not already the case ...\n $outputSuffix .= '.styl';\n }\n $outputSuffix .= '.css';\n $outputPath = $filePath.$outputSuffix;\n\n $compile = true;\n if( is_file($outputPath) ) {\n if( ($compileFlag == STYLUS_ASSETIC_COMPILE_ALWAYS) ) {\n unlink($outputPath);\n } elseif( ($compileFlag == STYLUS_ASSETIC_COMPILE_ONCE) ) {\n $compile = false;\n } elseif( ($compileFlag == STYLUS_ASSETIC_COMPILE_ONCHANGE) && filemtime($filePath) <= filemtime($outputPath) ) {\n $compile = false;\n }\n }\n if( $compile ) {\n $css = new AssetCollection(array(\n new FileAsset($filePath, array(new StylusFilter($nodeBinPath, $nodePaths)))\n ));\n\n file_put_contents( $outputPath, $css->dump() );\n }\n $CSSLinkUrl = $CSSLinkUrl . $outputSuffix;\n }\n }\n unset($CSSLinkParams['stylus']);\n }\n\n $outputCSSLinks[$CSSLinkUrl] = $CSSLinkParams;\n }\n\n $this->response->setCSSLinks( $outputCSSLinks );\n }", "function wsod_set_nocache() {\n @apache_setenv('no-gzip', 1);\n @ini_set('zlib.output_compression', 0);\n @ini_set('implicit_flush', 1);\n for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); } \n ob_implicit_flush(1);\n}", "public function Header(){\n\t\t$this->lineFeed(10);\n\t}", "public function extObjHeader()\n {\n if (is_callable([$this->extObj, 'head'])) {\n $this->extObj->head();\n }\n }", "function asc_print_head_scripts() {\n\n\tif ( ! did_action('asc_print_scripts') ) {\n\t\t/** This action is documented in functions.asc-scripts.php */\n\t\tdo_action( 'asc_print_scripts' );\n\t}\n\n\tglobal $asc_scripts;\n\n\tif ( !is_a($asc_scripts, 'ASC_Scripts') )\n\t\treturn array(); // no need to run if nothing is queued\n\n\treturn print_head_scripts();\n}", "function msdlab_pre_header(){\n print '<div class=\"pre-header\">\n <div class=\"wrap\">';\n do_action('msdlab_pre_header');\n print '\n </div>\n </div>';\n }", "public function add_nocache_headers() {\n if( ! headers_sent() && yith_wcwl_is_wishlist_page() ){\n wc_nocache_headers();\n }\n\t\t}", "private function _print_html_head_metatags()\n\t{\n\t\treturn \"<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset={$this->charset}\\\" />\\n\";\n\t}", "public function filter_init()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n ob_start(); // This prevents themes and plugins from screwing us over.\n $this->ajax_router();\n }", "protected function putCommandFirst()\r\n\t{\r\n\t\tif (count($this->processString)) {\r\n\t\t\tforeach ($this->processString as $processString) {\r\n\t\t\t\t$lineProcess = '<info>Executed :</info><options=bold>'.$processString.'</>';\r\n\t\t\t\tarray_unshift($this->outputChecker, $lineProcess);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function onPreRender($param)\n\t{\n\t\t$key = strtolower($this->getToggleKey());\n\t\t$code = isset(self::$_keyCodes[$key]) ? self::$_keyCodes[$key] : 74;\n\t\t$js = \"var logConsole; jQuery(function() { logConsole = new LogConsole($code)}); \";\n\t\t$cs = $this->getPage()->getClientScript();\n\t\t$cs->registerBeginScript($this->getClientID(),$js);\n\t\t$cs->registerPradoScript('logger');\n\t}", "function __construct() {\n\n\t\t//At the highest priority, before anything is printed out, start the output\n\t\t//buffer that we'll check for scripts\n\t\tadd_action( 'wp_head', array( $this, 'start_buffer' ), 0 );\n\t\tadd_action( 'wp_footer', array( $this, 'start_buffer' ), 0 );\n\t\tadd_action( 'mobile_header', array( $this, 'start_buffer' ), 0 );\n\t\tadd_action( 'mobile_footer', array( $this, 'start_buffer' ), 0 );\n\n\t\t//7 9s\n\t\t//As the (hopefully) last action, grab the output, find the scripts and styles\n\t\t//and replace them\n\t\tadd_action( 'wp_head', array( $this, 'replace' ), 99999999 );\n\t\tadd_action( 'wp_footer', array( $this, 'replace' ), 99999999 );\n\t\tadd_action( 'mobile_header', array( $this, 'replace' ), 99999999 );\n\t\tadd_action( 'mobile_footer', array( $this, 'replace' ), 99999999 );\n\n\t}", "public function hookHeader()\n\t{\n\t\t$this->context->controller->addJS($this->_path.'/views/js/front.js');\n\t\t$this->context->controller->addCSS($this->_path.'/views/css/front.css');\n\t}", "public function hookHeader()\n {\n // $this->context->controller->addJS('http://code.jquery.com/jquery-2.1.4.min.js');\n // $this->context->controller->addJS($this->_path.'views/js/bootstrap.min.js');\n $this->context->controller->addJS($this->_path.'views/js/front.js');\n $this->context->controller->addCSS($this->_path.'views/css/front.css');\n\n $this->context->controller->addJS($this->_path.'views/js/responsiveslides.js');\n $this->context->controller->addCSS($this->_path.'views/css/responsiveslides.css');\n $this->context->controller->addCSS($this->_path.'views/css/themes.css');\n }", "public function add_header() {\n }", "public function preDispatch()\n {\n $this->view->addFilter('TwitterLink');\n }", "protected function executePreRenderHook() {}", "final public function Add_Google_Tag_Manager_HEAD() {\n\t\tif (isset(self::$GOOGLE_TAG_MANAGER_ID) && !empty(self::$GOOGLE_TAG_MANAGER_ID)) {\n\t\t?>\n<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\nnew Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\nj=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n})(window,document,'script','dataLayer','<?= self::$GOOGLE_TAG_MANAGER_ID; ?>');</script>\n<?\n \t}\n\t}", "public function hookHeader()\n {\n $language_code = $this->context->language->language_code;\n $this->context->controller->addJS($this->_path . '/views/js/front.js');\n $this->context->controller->addCSS($this->_path . '/views/css/front.css');\n if (version_compare(_PS_VERSION_, '1.6.1.0', '>=')) {\n Media::addJsDef(\n array(\n 'wi_weather_provider' => Configuration::get('WI_WEATHER_PROVIDER'),\n 'wi_weather_url' => $this->getUrl(),\n 'wi_weather_city' => $this->getCity($language_code)\n )\n );\n } else {\n $this->context->smarty->assign(\n array(\n 'wi_weather_provider' => Configuration::get('WI_WEATHER_PROVIDER'),\n 'wi_weather_url' => $this->getUrl(),\n 'wi_weather_city' => $this->getCity($language_code)\n )\n );\n\n return $this->context->smarty->fetch(\n _PS_MODULE_DIR_ . $this->name\n . DIRECTORY_SEPARATOR . 'views'\n . DIRECTORY_SEPARATOR . 'templates'\n . DIRECTORY_SEPARATOR . 'front'\n . DIRECTORY_SEPARATOR . 'javascript.tpl'\n );\n }\n }", "public function hookHeader()\n {\n $this->context->controller->addJS($this->_path.'/views/js/front.js');\n $this->context->controller->addCSS($this->_path.'/views/css/front.css');\n }", "public function hookHeader()\n {\n $this->context->controller->addJS($this->_path.'/views/js/front.js');\n $this->context->controller->addCSS($this->_path.'/views/css/front.css');\n }", "public function hookHeader()\n {\n $this->context->controller->addJS($this->_path.'/views/js/front.js');\n $this->context->controller->addCSS($this->_path.'/views/css/front.css');\n }", "public function __destruct () {\r\n if ($this->objIdentificationString == __CLASS__) {\r\n // CLOSE_SESSION_ON_OBJECT_SCOPE == TRUE, we destroy the SESSION on __destruct;\r\n if (CLOSE_SESSION_ON_OBJECT_SCOPE == TRUE) {\r\n // Should be carefull. Closing _SESSION on object scope is horrible;\r\n self::closeSession ();\r\n self::disableOutputStream ();\r\n } else {\r\n self::disableOutputStream ();\r\n }\r\n\r\n // Clean CSS Environment if this file is a CSS File;\r\n self::cleanJSSEnvironmentIfJSSFile ();\r\n self::cleanCSSEnvironmentIfCSSFile ();\r\n\r\n // Make the OutputBuffer, an A;\r\n (!self::$objOutputBuffer instanceof A) ?\r\n (self::$objOutputBuffer = new A (self::$objOutputBuffer)) :\r\n (FALSE);\r\n\r\n // Add the header;\r\n if (self::getContainerHTMLStatus ()->toInt () == 1 && self::getErrorStatus ()->toInt () != 1) {\r\n // Output catched buffer, concatenating header;\r\n self::$objOutputBuffer->arrayUnShift (\r\n self::getDocumentType ()->toString () .\r\n self::getHTMLHeadContainer ()->toString () .\r\n self::getMetaEQVHeader ()->toString () .\r\n self::getPageTitle ()->toString () .\r\n self::getMetaTAGHeader ()->toString () .\r\n self::getJSSHeader ()->toString () .\r\n self::getCSSHeader ()->toString () .\r\n self::getMetaLNKHeader ()->toString () .\r\n self::getEndHTMLHeadContainer ()->toString ());\r\n }\r\n\r\n // Add the footer;\r\n if (self::getContainerHTMLStatus ()->toInt () == 1) {\r\n // End </body> output;\r\n self::$objOutputBuffer[count (self::$objOutputBuffer)] = self::getHTMLEnd ()->toString ();\r\n }\r\n\r\n // Make the Gzipped output;\r\n self::setGzippedOutputRequest (new S ('output_stored_content'));\r\n }\r\n }" ]
[ "0.57570046", "0.5669767", "0.56418204", "0.5625916", "0.56044686", "0.553121", "0.552853", "0.5479302", "0.5459078", "0.5446818", "0.5443063", "0.5413446", "0.54054296", "0.54051965", "0.53671", "0.5327081", "0.53120655", "0.52963555", "0.5290654", "0.5282507", "0.5272285", "0.52644885", "0.5253764", "0.52487713", "0.52434695", "0.5232018", "0.52279586", "0.52265716", "0.521186", "0.5199461", "0.51937175", "0.518814", "0.5176109", "0.51718384", "0.5162789", "0.5159893", "0.5159539", "0.5141196", "0.51379603", "0.513224", "0.5127119", "0.5121507", "0.5096088", "0.5094207", "0.50777394", "0.5076565", "0.50740385", "0.506867", "0.5067685", "0.50535613", "0.5045745", "0.50378174", "0.5035787", "0.50180537", "0.5016623", "0.5016278", "0.50156945", "0.50128853", "0.5010766", "0.50105745", "0.5006388", "0.4996301", "0.49903086", "0.49874276", "0.49550253", "0.49546757", "0.4953306", "0.49472383", "0.49466977", "0.4938127", "0.49318442", "0.49298197", "0.49290085", "0.49279833", "0.4922052", "0.4920177", "0.49120134", "0.49008337", "0.48996088", "0.48983467", "0.48970106", "0.48945177", "0.48913604", "0.48899746", "0.48886818", "0.48821393", "0.48805255", "0.4877128", "0.48741287", "0.4873759", "0.48707908", "0.48660734", "0.48655987", "0.48614222", "0.4859902", "0.4852728", "0.48514712", "0.48514712", "0.48514712", "0.48475575" ]
0.5309021
17
OBfunction to add a content size header
function contentSize($buffer, $mode){ global $PREVENT_CSIZE_HEADER; if(!$PREVENT_CSIZE_HEADER) header('Content-Length: ' . ob_get_length()); return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function headersize() {\n return $this->info['header_size'];\n }", "function getSize() ;", "function addContentWidth() {\n\t\t\tglobal $content_width;\n\t\t\tif ( isset( $content_width ) ) {\n\t\t\t\t$content_width = 628;\n\t\t\t}\n\n\t\t}", "private function setFileSize(){\r\n $headers = get_headers($this->fileName);\r\n $this->fileSize = round(str_replace('Content-Length: ','',$headers[2])/1024,2);\r\n }", "public function setMaxHeadersSize(int $value): void {}", "public function setContentLength($value)\n {\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_CONTENTLENGTH] \n = $value;\n }", "public function getHeaderSize()\n {\n return 30 + $this->properties[\"fileNameLength\"] + $this->properties[\"extraFieldLength\"];\n }", "public function add_header() {\n }", "abstract public function header();", "public function addHeader()\n {\n }", "public function extObjHeader() {}", "function myheader($additionalHeaderContent = NULL) {\n\t\tprint '<html>';\n\t\t\tprint '<head>';\n\t\t\t\tprint '<title>';\n\t\t\t\t\tif (defined('TITLE')) {\n\t\t\t\t\t\tprint TITLE;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tprint 'MiddleClik';\n\t\t\t\t\t}\n\t\t\t\tprint '</title>';\n\t\t\t\tprint \"<meta http-equiv=\\\"content-type\\\" content=\\\"text/html; charset=utf-8\\\" />\";\n\t\t\t\tprint $additionalHeaderContent;\n\t\t\t\tprint \"<style type=\\\"text/css\\\">\";\n\t\t\t\t\tprint '//this is where my css, js goes';\n\t\t\t\tprint \"</style>\";\n\t\t\tprint '</head>';\n\t}", "private function setContentLength($params)\n { \n $this->headerManager->set('Content-Length', strlen($params));\n }", "function custom_sizes() {\n\n}", "public function sizeToContent() {\n $this->callMethod( 'sizeToContent' );\n }", "public function docHeaderContent() {}", "public static function tag_page_size() {\n\t//--\n\treturn '<!-- MEDIA SIZE 215x279mm -->'; // A4\n\t//--\n}", "public function getSizeDetails();", "abstract protected function header();", "function X_header_image_tag( $html, $header, $attr ) {\n\tif ( isset( $attr['sizes'] ) ) {\n\t\t$html = str_replace( $attr['sizes'], '100vw', $html );\n\t}\n\treturn $html;\n}", "function calc_size()\n\t{\n\t}", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "function admin_header_style() {\n\n?>\n\t<style type=\"text/css\">\n\t#headimg {\n\t\twidth: <?php echo HEADER_IMAGE_WIDTH; ?>px;\n\t\theight: <?php echo HEADER_IMAGE_HEIGHT; ?>px;\n\t}\n\t</style>\n<?php\n}", "public function setSize($size);", "function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment)\n {\n }", "function display_header() {}", "public function tarFooter( $size ) {\n\t\tif ( $size % 512 > 0 ) {\n\t\t\treturn pack( \"a\" . ( 512 - $size % 512 ), \"\" );\n\t\t} else {\n\t\t\treturn \"\";\n\t\t}\n\t}", "public function setHeaderFontSize($size)\n {\n $this->setFontSizeConfig($size, self::HEADER);\n }", "function customisetheme_admin_header_style() {\n ?>\n <style type=\"text/css\">\n #wpbody-content #headimg {\n height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;\n width: <?php echo HEADER_IMAGE_WIDTH; ?>px;\n border: 1px solid #333;\n }\n </style>\n <?php\n }", "public function ezbs_add_image_size(){\n \n $obj_ezc_add_image_size = Class_WP_ezClasses_Theme_Add_Image_Size_1::ez_new();\n\t \n\t // $obj_ezc_add_image_size->set_remove_width_height(false);\n\t \n\t // $obj_ezc_add_image_size->set_jpeg_quality(80);\t\n\t \n\t $arr_args['arr_args'] = $this->ezbs_add_image_size_args();\n\t \n\t // ais = add image size\n\t $obj_ezc_add_image_size->ez_ais($arr_args);\n\t \n\t //$obj_ezc_add_image_size->set_image_size_names_choose_defaults(false);\n\t \n\t // isnc = image_size_names_choose (with is a stock WP filter) \n\t $obj_ezc_add_image_size->ez_isnc($arr_args);\t \n\t \n }", "function wfDoContentLength( $length ) {\n\tif ( !headers_sent() && isset( $_SERVER['SERVER_PROTOCOL'] ) && $_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0' ) {\n\t\theader( \"Content-Length: $length\" );\n\t}\n}", "public function addToHeader(string $header, string $content): ResponseInterface;", "function addHeader($name, $content) {\n\t\t$updated = false;\n\n\t\tif (($headers = $this->getData('headers')) == null) {\n\t\t\t$headers = array();\n\t\t}\n\n\t\tforeach ($headers as $key => $value) {\n\t\t\tif ($value['name'] == $name) {\n\t\t\t\t$headers[$key]['content'] = $content;\n\t\t\t\t$updated = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!$updated) {\n\t\t\tarray_push($headers, array('name' => $name,'content' => $content));\n\t\t}\n\n\t\t$this->setData('headers', $headers);\n\t}", "function media_upload_header()\n {\n }", "public function getSize()\n {\n return \"Small\";\n }", "public function getSize()\n {\n }", "function load_header(){\n\t\techo \"<div style='background:darkblue; height:100px; '> HEADER </div>\";\n\t}", "function getSize() { return $this->_size; }", "public function addSize() { return $this->_m_addSize; }", "protected function _writeFileHeader() {}", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "protected function makeHeader()\n {\n }", "private function do_header() {\n $m_header = '';\n $m_header .= '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />';\n $m_header .= '<meta http-equiv=\"Content-Language\" content=\"en-gb\" />';\n // $m_header .= '<link rel=stylesheet href=' . $this->c_path . '/../css/reset.css type=text/css />';\n // $m_header .= '<link rel=stylesheet href=' . $this->c_path . '/../css/style.css type=text/css />';\n $this->c_header = $m_header;\n }", "function acf_format_filesize($size = 1)\n{\n}", "function makeHeader(){\n\tglobal $pdf;\n\t\n\t// logo\n\t$pdf->Image('img/mepbro-pdf.png', 27, 27, 218);\n\t\n\t// title box\n\t$pdf->SetFillColor(51,102,255);\n\t$pdf->Rect(263, 27, 323, 72, 'F');\n\t// title lines\n\t$pdf->SetTextColor(255,255,255);\n\t$pdf->SetFont('Helvetica','B',34);\n\t$pdf->SetXY(263, 31);\n\t$pdf->Cell(323,36,'HOSE TEST', 0, 1, 'C');\n\t$pdf->SetXY(263, 64);\n\t$pdf->Cell(323,36,'CERTIFICATE', 0, 1, 'C');\n\t\n\treturn 126;\n\t\n}", "abstract public function header($name, $value);", "abstract protected function getSize(): int;", "public function formatSizeDataProvider() {}", "function custom_sizes( $sizes ) {\n return array_merge( $sizes, array(\n //the 'custom-size refers to the added size in the if code block above like 'bob-size'\n //'custom size name' is the string for the name of your size that is going to be displayed in the backend\n // like:\n // small 250x250\n // medium 640x480\n // orginal 800x600\n // custom size name 320x180\n 'custom-size' => __( 'custom size name' ),\n ) );\n}", "private function renderContentHeading() {\n\t\t$this->setMarker('content_id', $this->getContentUid());\n\t\t$this->setMarker(\n\t\t\t'content_heading',\n\t\t\thtmlspecialchars($this->cObj->data['subheader'])\n\t\t);\n\t}", "public function Header(){\n\t\t$this->lineFeed(10);\n\t}", "function childtheme_admin_header_style() {\r\n\t?>\r\n\t<style type=\"text/css\">\r\n\t#headimg {\r\n\t\tbackground-position: left bottom;\r\n\t\tbackground-repeat:no-repeat;\r\n\t\tborder:0 !important;\r\n\t\theight:auto !important;\r\n\t\tpadding:0 0 <?php echo HEADER_IMAGE_HEIGHT + 22; /* change the added integer (22) to match your desired top padding */?>px 0;\r\n\t\tmargin:0 0 28px 0;\r\n\t}\r\n\r\n\t#headimg h1 {\r\n\t\tfont-family:Arial,sans-serif;\r\n\t\tfont-size:34px;\r\n\t\tfont-weight:bold;\r\n\t\tline-height:40px;\r\n\t\tmargin:0;\r\n\t}\r\n\t#headimg a {\r\n\t\tcolor: #000;\r\n\t\ttext-decoration: none;\r\n\t}\r\n\t#desc{\r\n\t\tfont-family: Georgia;\r\n\t\tfont-size: 13px;\r\n\t\tfont-style: italic;\r\n\t}\r\n\t</style>\r\n\t<?php\r\n}", "function add_admin_header() {\n }", "function Header(){\n\t\t}", "public static function end_header()\n\t{\n\t\treturn sprintf('</h%d>',\n\t\t\tmin(6, self::$nivel_cabecalho)\n\t\t);\n\t}", "function add_header_stuff() {\n\n echo '<meta charset=\"utf-8\" />';\n\n echo '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />';\n\n// include( 'assets/images/sprite/sprite.svg' ); // Include generated SVG Sprite\n// \n// include( 'parts/header-meta' ); // Include additional meta information in the header\n}", "public function setMaxHeadersSize(string $max_size): void {}", "function elytra_header_image_tag( $html, $header, $attr ) {\n\tif ( isset( $attr['sizes'] ) ) {\n\t\t$html = str_replace( $attr['sizes'], '100vw', $html );\n\t}\n\treturn $html;\n}", "public function format_for_header()\n {\n }", "private function register_logo_image_size() {\n\t\t\\add_image_size( $this->image_size_name, 60, 60, false );\n\t}", "function pantomime_custom_image_header(){\n\tdefine( 'HEADER_TEXTCOLOR', 'FFFFFF' );\n\tdefine( 'HEADER_IMAGE', '' ); // Leaving empty for random image rotation.\n\tdefine( 'HEADER_IMAGE_WIDTH', apply_filters( 'pantomime_header_image_width', 960 ) );\n\tdefine( 'HEADER_IMAGE_HEIGHT', apply_filters( 'pantomime_header_image_height', 400 ) );\n\tadd_custom_image_header( 'pantomime_header_style', 'pantomime_admin_header_style', 'pantomime_admin_header_image' );\t\n}", "public function addHeader(){\n$this->page.= <<<EOD\n<html>\n<head>\n</head>\n<title>\n$this->title\n</title>\n<body>\n<h1 align=\"center\">\n$this->title\n</h1>\nEOD;\n}", "function getContent() {\t \r\n\t \t$content = isSet($this->headery) ? '\\headery'.round(TWIPS_IN_CM * $this->headery).' ' : '';\t \r\n\t\t$content .= '{\\\\'.$this->type.' ';\t\t\t\t\t\t\r\n\t\t$content .= parent::getContent();\r\n\t\t$content .= '\\par ';\r\n\t\t$content .= '}';\r\n\t\treturn $content.\"\\r\\n\";\r\n\t}", "function InlineFontSize($content) {\n if(!is_admin()):\n return str_replace(\"font-size\",\"--font-size\",$content);\n endif;\n }", "public function addHeaderContent($content)\n\t{\n\t\t$this->headerContent[] = $content;\n\t}", "public function getSize(): string;", "function _generateHeaderInfo()\n {\n return '0504';\n }", "function faculty_settings_header() {\n faculty_setting_line(faculty_add_size_setting('header_image_height', __('Header Height', FACULTY_DOMAIN), 2));\n faculty_setting_line(faculty_add_size_setting('header_title_area_width', __('Header Title Area Width', FACULTY_DOMAIN), 2));\n faculty_setting_line(faculty_add_size_setting('header_widget_area_width', __('Header Widget Area Width', FACULTY_DOMAIN), 2));\n faculty_setting_line(faculty_add_background_color_setting('header_background_color', __('Background', FACULTY_DOMAIN)));\n do_action('faculty_settings_header');\n faculty_setting_line(faculty_add_note(sprintf(__('Save your settings before customizing your <a href=\"%s\">header</a>.', FACULTY_DOMAIN), admin_url('themes.php?page=custom-header'))));\n}", "public function addHeader ($param, $content)\n {\n $this->header[$param] = $content;\n }", "public function extObjHeader()\n {\n if (is_callable([$this->extObj, 'head'])) {\n $this->extObj->head();\n }\n }", "public function __Header(){\n $this->Ln(5);\n $this->SetDrawColor(160,160,160);\n $this->SetFillColor(230,230,230);\n $this->SetTextColor(100);\n $this->SetFont('Arial','B',7);\n $this->SetX(($this->w - $this->_tWidth)/2);\n foreach($this->_fields as $field)\n $this->Cell($field[\"size\"],5,$field[\"header\"],1,0,\"C\",true);\n $this->Ln();\n }", "public function setContentType($val){ return $this->setHeader('Content-Type',$val); }", "public function size($value) {\n return $this->setProperty('size', $value);\n }", "public function size($value) {\n return $this->setProperty('size', $value);\n }", "public function size($value) {\n return $this->setProperty('size', $value);\n }", "public function webp_upsell_metabox_header() {\r\n\t\t$this->view( 'webp/upsell-meta-box-header' );\r\n\t}", "function wp_admin_headers()\n {\n }", "public function headerMargin() {\n\t}", "function setSize($size)\n\t{\n\t\t$this->size = 0+$size;\n\t}", "public function setHeaderHeightProps() {\n\t\t$this->heightOfTransparency = $this->calculateHeightOfTransparency();\n\t\t$this->heightOfCompleteTransparency = $this->calculateHeightOfCompleteTransparency();\n\t\t$this->headerHeight = $this->calculateHeaderHeight();\n\t}", "function rest_output_link_header()\n {\n }", "function get_custom_header()\n {\n }", "function H($num = 1, $title = '', $pref = 0, $extra = '')\n{\n /**\n * H tag - this is an HTML Document Header line.\n *\n * Args:\n * $num (int): the header number (1-6) default is 1\n * $title (str): the text in the header line\n * $pref (int): number of tabs for indentation, default is 0\n * $extra (str): extra data in the tag - used for adding class / ID etc.\n */\n Tab($pref) ;\n echo '<h' . $num ;\n if ($extra != '') {\n echo ' ' . $extra ;\n }\n echo '>' . $title ;\n close_tag('h' . $num, '', true) ;\n}", "private function writeHeader(): void\n {\n $record = 0x0014; // Record identifier\n\n /* removing for now\n // need to fix character count (multibyte!)\n if (strlen($this->phpSheet->getHeaderFooter()->getOddHeader()) <= 255) {\n $str = $this->phpSheet->getHeaderFooter()->getOddHeader(); // header string\n } else {\n $str = '';\n }\n */\n\n $recordData = StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader());\n $length = strlen($recordData);\n\n $header = pack('vv', $record, $length);\n\n $this->append($header . $recordData);\n }", "public function addHeader($header);", "function admin_header() {\n\t\t$page = ( isset( $_GET['page'] ) ) ? esc_attr( sanitize_text_field( wp_unslash( $_GET['page'] ) ) ) : false;\n\t\tif ( 'my_list_test' != $page ) {\n\t\t\treturn;\n\t\t}\n\t\techo '<style type=\"text/css\">';\n\t\techo '.wp-list-table .column-id { width: 5%; }';\n\t\techo '.wp-list-table .column-title { width: 15%; }';\n\t\techo '.wp-list-table .column-uploader { width: 10%; }';\n\t\techo '.wp-list-table .column-location { width: 15%; }';\n\t\techo '.wp-list-table .column-walkthroughs { width: 15%; }';\n\t\techo '.wp-list-table .column-description { width: 50%; }';\n\t\techo '</style>';\n\t}", "function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment)\n {\n $v_result=1;\n\n // ----- Packed data\n $v_binary_data = pack(\"VvvvvVVv\", 0x06054b50, 0, 0, $p_nb_entries,\n\t $p_nb_entries, $p_size,\n\t\t\t\t\t\t $p_offset, strlen($p_comment));\n\n // ----- Write the 22 bytes of the header in the zip file\n fputs($this->zip_fd, $v_binary_data, 22);\n\n // ----- Write the variable fields\n if (strlen($p_comment) != 0)\n {\n fputs($this->zip_fd, $p_comment, strlen($p_comment));\n }\n\n // ----- Return\n return $v_result;\n }" ]
[ "0.6198996", "0.6051771", "0.5973838", "0.5971433", "0.591266", "0.58370745", "0.58291686", "0.58273745", "0.58155274", "0.5807821", "0.5763734", "0.57024497", "0.56541526", "0.56343025", "0.56117815", "0.5598047", "0.5597354", "0.55912876", "0.55691904", "0.5564022", "0.5560301", "0.5556612", "0.5556612", "0.5556612", "0.5556612", "0.5556612", "0.5556612", "0.5556612", "0.5556612", "0.5556612", "0.55459875", "0.5537524", "0.5524024", "0.5519418", "0.5513703", "0.55119586", "0.55092776", "0.5504423", "0.5465767", "0.54588825", "0.54527706", "0.54474133", "0.5435328", "0.54140747", "0.5386148", "0.5385685", "0.5370506", "0.5361682", "0.53560454", "0.53556985", "0.53556985", "0.53556985", "0.53556985", "0.5355182", "0.5354639", "0.53442967", "0.53348374", "0.53334635", "0.53298926", "0.53296906", "0.5327891", "0.5327818", "0.5327727", "0.5314465", "0.5309215", "0.53087175", "0.53052163", "0.53045166", "0.53032714", "0.5303015", "0.5302458", "0.5294544", "0.5291434", "0.5286128", "0.528596", "0.52769107", "0.52725774", "0.52681667", "0.5264393", "0.5263653", "0.52513826", "0.5245496", "0.5233055", "0.5229416", "0.52283734", "0.52270895", "0.52270895", "0.52270895", "0.52255094", "0.52214295", "0.5204657", "0.52023613", "0.5195339", "0.5191615", "0.5187756", "0.5187183", "0.51850295", "0.51825684", "0.517676", "0.51583254" ]
0.58349574
6
Convert string to UTF8
function utf8($str) { if(mb_detect_encoding($str) == "UTF-8" && mb_check_encoding($str,"UTF-8")) return $str; else return utf8_encode($str); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convert_to_utf8(string $str): string\n {\n return preg_replace_callback(\n '/\\\\\\\\u([0-9a-fA-F]{4})/',\n static function (array $match): string {\n return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');\n },\n $str\n );\n }", "function str_to_utf8( $string ) {\n\n // Check if mbstring is installed, if not, run old way\n if ( !function_exists( 'mb_convert_encoding' ) )\n return ( ( preg_match( '!!u', $string ) ) ? $string : utf8_encode( $string ) );\n\n // Convert encoding from XXX to UTF-8\n $string = mb_convert_encoding( $string, \"UTF-8\" );\n\n // Escape special characters\n htmlspecialchars( $string, ENT_QUOTES, 'UTF-8' );\n $string = html_entity_decode( $string );\n\n // Return modified - UTF-8 string\n return $string;\n\n }", "static public function stringToUtf8($string) {\n if ($GLOBALS['LANG']->charSet == '' || $GLOBALS['LANG']->charSet == 'iso-8859-1') {\n return utf8_encode($string);\n } else {\n return $string;\n }\n\t}", "public static function toUTF8($str) {\n\t\t\t$lst = 'UTF-8, ISO-8859-1';\n\t\t\t$cur = mb_detect_encoding($str, $lst);\n\t\t\treturn mb_convert_encoding($str, 'UTF-8', $cur);\n\t\t}", "public static function convertToUtf8($string) {\n if (!self::isUtf8($string)) {\n $string = self::convertEncoding($string, 'gbk', 'utf-8');\n }\n return $string;\n }", "public static function convertToUtf8(string $string): string\n {\n return mb_convert_encoding($string, 'UTF-8');\n }", "private function _utf8convert( $string )\r\n\t{\r\n\t\t// Test the string to see if it isn't utf-8\r\n\t\tif ( $this->_utf8check( $string ) ) {\r\n\t\t\treturn $string;\r\n\t\t}\r\n\t\t\r\n\t\tif (! function_exists( 'mb_detect_encoding' ) ) {\r\n\t\t\t// @TODO: Log an error somehow\r\n\t\t\t$this->unicode = null;\r\n\t\t\treturn string;\r\n\t\t}\r\n\t\t\r\n\t\t$encoding\t=\tmb_detect_encoding( $string, 'auto', true );\r\n\t\tif (! $encoding ) {\r\n\t\t\t// @TODO: Log an error somehow\r\n\t\t\t$this->unicode = null;\r\n\t\t\treturn $string;\r\n\t\t}\r\n\t\t\r\n\t\tif (! function_exists( 'iconv' ) ) {\r\n\t\t\t// @TODO: Log an error somehow\r\n\t\t\t$this->unicode = null;\r\n\t\t\treturn $string;\r\n\t\t}\r\n\t\t\r\n\t\t$result\t=\ticonv( strtoupper( $encoding ), 'UTF-8//TRANSLIT', $string );\r\n\t\tif (! $result ) {\r\n\t\t\t// @TODO: Log an error somehow\r\n\t\t\t$this->unicode = null;\r\n\t\t\treturn $string;\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "function mk_utf8($string) {\n\t\treturn (is_utf8($string) ? $string : utf8_encode($string));\n\t}", "public function encode_convert($string) {\r\n\t\treturn mb_convert_encoding(trim($string), \"UTF-8\", \"EUC-JP, UTF-8, ASCII, JIS, eucjp-win, sjis-win\");\r\n\t}", "function utf8encode($string){\n\tif(function_exists('mb_convert_encoding')){\n\t\t return mb_convert_encoding($string, \"UTF-8\", mb_detect_encoding($string));\n\t}else{\n\t\treturn utf8_encode($string);\n\t}\n}", "function convert_to_utf8($str)\n{\n\t$old_charset = $_SESSION['old_charset'];\n\t\n\tif ($str === null || $str == '' || $old_charset == 'UTF-8')\n\t\treturn $str;\n\n\t$save = $str;\n\n\t// Replace literal entities (for non-UTF-8 compliant html_entity_encode)\n\tif (version_compare(PHP_VERSION, '5.0.0', '<') && $old_charset == 'ISO-8859-1' || $old_charset == 'ISO-8859-15')\n\t\t$str = html_entity_decode($str, ENT_QUOTES, $old_charset);\n\n\tif ($old_charset != 'UTF-8' && !seems_utf8($str))\n\t{\n\t\tif (function_exists('iconv'))\n\t\t\t$str = iconv($old_charset == 'ISO-8859-1' ? 'WINDOWS-1252' : $old_charset, 'UTF-8', $str);\n\t\telse if (function_exists('mb_convert_encoding'))\n\t\t\t$str = mb_convert_encoding($str, 'UTF-8', $old_charset == 'ISO-8859-1' ? 'WINDOWS-1252' : 'ISO-8859-1');\n\t\telse if ($old_charset == 'ISO-8859-1')\n\t\t\t$str = utf8_encode($str);\n\t}\n\n\t// Replace literal entities (for UTF-8 compliant html_entity_encode)\n\tif (version_compare(PHP_VERSION, '5.0.0', '>='))\n\t\t$str = html_entity_decode($str, ENT_QUOTES, 'UTF-8');\n\n\t// Replace numeric entities\n\t$str = preg_replace_callback('/&#([0-9]+);/', 'utf8_callback_1', $str);\n\t$str = preg_replace_callback('/&#x([a-f0-9]+);/i', 'utf8_callback_2', $str);\n\n\t// Remove \"bad\" characters\n\t$str = remove_bad_characters($str);\n\n\treturn $str;//($save != $str);\n}", "protected function chars_convert($string)\r\n {\r\n if (function_exists('mb_convert_encoding'))\r\n {\r\n $out = mb_convert_encoding($string, mb_detect_encoding($string), \"UTF-8\"); \r\n }\r\n else\r\n {\r\n $out = $string;\r\n }\r\n \r\n return $out; \r\n }", "public static function to_utf8_string(string $str, bool $decode_html_entity_to_utf8 = false): string\n {\n if ($str === '') {\n return $str;\n }\n\n $max = \\strlen($str);\n $buf = '';\n\n for ($i = 0; $i < $max; ++$i) {\n $c1 = $str[$i];\n\n if ($c1 >= \"\\xC0\") { // should be converted to UTF8, if it's not UTF8 already\n\n if ($c1 <= \"\\xDF\") { // looks like 2 bytes UTF8\n\n $c2 = $i + 1 >= $max ? \"\\x00\" : $str[$i + 1];\n\n if ($c2 >= \"\\x80\" && $c2 <= \"\\xBF\") { // yeah, almost sure it's UTF8 already\n $buf .= $c1 . $c2;\n ++$i;\n } else { // not valid UTF8 - convert it\n $buf .= self::to_utf8_convert_helper($c1);\n }\n } elseif ($c1 >= \"\\xE0\" && $c1 <= \"\\xEF\") { // looks like 3 bytes UTF8\n\n $c2 = $i + 1 >= $max ? \"\\x00\" : $str[$i + 1];\n $c3 = $i + 2 >= $max ? \"\\x00\" : $str[$i + 2];\n\n if ($c2 >= \"\\x80\" && $c2 <= \"\\xBF\" && $c3 >= \"\\x80\" && $c3 <= \"\\xBF\") { // yeah, almost sure it's UTF8 already\n $buf .= $c1 . $c2 . $c3;\n $i += 2;\n } else { // not valid UTF8 - convert it\n $buf .= self::to_utf8_convert_helper($c1);\n }\n } elseif ($c1 >= \"\\xF0\" && $c1 <= \"\\xF7\") { // looks like 4 bytes UTF8\n\n $c2 = $i + 1 >= $max ? \"\\x00\" : $str[$i + 1];\n $c3 = $i + 2 >= $max ? \"\\x00\" : $str[$i + 2];\n $c4 = $i + 3 >= $max ? \"\\x00\" : $str[$i + 3];\n\n if ($c2 >= \"\\x80\" && $c2 <= \"\\xBF\" && $c3 >= \"\\x80\" && $c3 <= \"\\xBF\" && $c4 >= \"\\x80\" && $c4 <= \"\\xBF\") { // yeah, almost sure it's UTF8 already\n $buf .= $c1 . $c2 . $c3 . $c4;\n $i += 3;\n } else { // not valid UTF8 - convert it\n $buf .= self::to_utf8_convert_helper($c1);\n }\n } else { // doesn't look like UTF8, but should be converted\n\n $buf .= self::to_utf8_convert_helper($c1);\n }\n } elseif (($c1 & \"\\xC0\") === \"\\x80\") { // needs conversion\n\n $buf .= self::to_utf8_convert_helper($c1);\n } else { // it doesn't need conversion\n\n $buf .= $c1;\n }\n }\n\n // decode unicode escape sequences + unicode surrogate pairs\n $buf = \\preg_replace_callback(\n '/\\\\\\\\u([dD][89abAB][0-9a-fA-F]{2})\\\\\\\\u([dD][cdefCDEF][\\da-fA-F]{2})|\\\\\\\\u([0-9a-fA-F]{4})/',\n /**\n * @param array $matches\n *\n * @psalm-pure\n *\n * @return string\n */\n static function (array $matches): string {\n if (isset($matches[3])) {\n $cp = (int) \\hexdec($matches[3]);\n } else {\n // http://unicode.org/faq/utf_bom.html#utf16-4\n $cp = ((int) \\hexdec($matches[1]) << 10)\n + (int) \\hexdec($matches[2])\n + 0x10000\n - (0xD800 << 10)\n - 0xDC00;\n }\n\n // https://github.com/php/php-src/blob/php-7.3.2/ext/standard/html.c#L471\n //\n // php_utf32_utf8(unsigned char *buf, unsigned k)\n\n if ($cp < 0x80) {\n return (string) self::chr($cp);\n }\n\n if ($cp < 0xA0) {\n /** @noinspection UnnecessaryCastingInspection */\n return (string) self::chr(0xC0 | $cp >> 6) . (string) self::chr(0x80 | $cp & 0x3F);\n }\n\n return self::decimal_to_chr($cp);\n },\n $buf\n );\n\n if ($buf === null) {\n return '';\n }\n\n // decode UTF-8 codepoints\n if ($decode_html_entity_to_utf8) {\n $buf = self::html_entity_decode($buf);\n }\n\n return $buf;\n }", "function makeUTF8($str,$encoding = \"\") {\n if (!empty($str)) {\n if (empty($encoding) && isUTF8($str))\n $encoding = \"UTF-8\";\n if (empty($encoding))\n $encoding = mb_detect_encoding($str,'UTF-8, ISO-8859-1');\n if (empty($encoding))\n $encoding = \"ISO-8859-1\"; // if charset can't be detected, default to ISO-8859-1\n return $encoding == \"UTF-8\" ? $str : @mb_convert_encoding($str,\"UTF-8\",$encoding);\n }\n }", "protected function _unicodeToUtf8($str)\n { \n $utf8 = '';\n \n foreach ($str as $unicode) {\n \n if ($unicode < 128) {\n \n $utf8 .= chr($unicode);\n \n } elseif ($unicode < 2048) {\n \n $utf8 .= chr(192 + ( ( $unicode - ( $unicode % 64 ) ) / 64 ));\n $utf8 .= chr(128 + ( $unicode % 64 ));\n \n } else {\n \n $utf8 .= chr( 224 + (( $unicode - ( $unicode % 4096 ) ) / 4096 ));\n $utf8 .= chr( 128 + (( ( $unicode % 4096 ) - ( $unicode % 64 ) ) / 64 ));\n $utf8 .= chr( 128 + ($unicode % 64 ));\n \n } // if\n \n } // foreach\n \n return $utf8;\n }", "function makeUTF8($str,$encoding = \"\") {\n if ($str !== \"\") {\n if (empty($encoding) && isUTF8($str))\n $encoding = \"UTF-8\";\n if (empty($encoding))\n $encoding = mb_detect_encoding($str,'UTF-8, ISO-8859-1');\n if (empty($encoding))\n $encoding = \"ISO-8859-1\"; // if charset can't be detected, default to ISO-8859-1\n return $encoding == \"UTF-8\" ? $str : @mb_convert_encoding($str,\"UTF-8\",$encoding);\n }\n }", "function seems_utf8($str)\n {\n }", "public static function convertToUtf8($inputText)\n {\n return iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $inputText);\n }", "function & _wp_iso8859_2_to_utf8(&$string) {\n $decode=array(\n \"\\xA1\" => \"\\xC4\\x84\",\n \"\\xB1\" => \"\\xC4\\x85\",\n \"\\xC6\" => \"\\xC4\\x86\",\n \"\\xE6\" => \"\\xC4\\x87\",\n \"\\xCA\" => \"\\xC4\\x98\",\n \"\\xEA\" => \"\\xC4\\x99\",\n \"\\xA3\" => \"\\xC5\\x81\",\n \"\\xB3\" => \"\\xC5\\x82\",\n \"\\xD1\" => \"\\xC5\\x83\",\n \"\\xF1\" => \"\\xC5\\x84\",\n \"\\xD3\" => \"\\xC3\\x93\",\n \"\\xF3\" => \"\\xC3\\xB3\",\n \"\\xA6\" => \"\\xC5\\x9A\",\n \"\\xB6\" => \"\\xC5\\x9B\",\n \"\\xAC\" => \"\\xC5\\xB9\",\n \"\\xBC\" => \"\\xC5\\xBA\",\n \"\\xAF\" => \"\\xC5\\xBB\",\n \"\\xBF\" => \"\\xC5\\xBC\",\n );\n $string = strtr(\"$string\",$decode);\n return $string;\n }", "function win_utf8($s) {\n $utf = \"\";\n for ($i = 0; $i < strlen($s); $i++) {\n $donotrecode = false;\n $c = ord(substr($s, $i, 1));\n if ($c == 0xA8) {\n $res = 0xD081;\n } elseif ($c == 0xB8) {\n $res = 0xD191;\n } elseif ($c < 0xC0) {\n $donotrecode = true;\n } elseif ($c < 0xF0) {\n $res = $c + 0xCFD0;\n } else {\n $res = $c + 0xD090;\n }\n $c = ($donotrecode) ? chr($c) : (chr($res >> 8) . chr($res & 0xff));\n $utf .= $c;\n }\n return $utf;\n }", "public static function sanitizeUTF8($string)\n\t{\n\t\t$output = preg_replace('/[^\\x{0009}\\x{000a}\\x{000d}\\x{0020}-\\x{D7FF}\\x{E000}-\\x{FFFD}]+/u', '', $string);\n\t\tif (is_null($output))\n\t\t{\n\t\t\t$output = \"\";\n\t\t\tif (empty($string))\n\t\t\t{\n\t\t\t\treturn $output;\n\t\t\t}\n\n\t\t\t$length = strlen($string);\n\t\t\tfor ($i = 0; $i < $length; $i++)\n\t\t\t{\n\t\t\t\t$current = ord($string{$i});\n\t\t\t\tif (($current == 0x9) ||\n\t\t\t\t\t($current == 0xA) ||\n\t\t\t\t\t($current == 0xD) ||\n\n\t\t\t\t\t(($current >= 0x28) && ($current <= 0xD7FF)) ||\n\t\t\t\t\t(($current >= 0xE000) && ($current <= 0xFFFD)) ||\n\t\t\t\t\t(($current >= 0x10000) && ($current <= 0x10FFFF))\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$output .= chr($current);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$output .= \" \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $output;\n\t}", "function deutf8($str)\n{\n if(mb_detect_encoding($str) == \"UTF-8\" && mb_check_encoding($str,\"UTF-8\")) return utf8_decode($str);\n else return $str;\n}", "public static function utf8Sanitize($string)\r\n {\r\n Preconditions::checkIsString($string, '$string must be string');\r\n $out = @iconv(\"UTF-8\", \"UTF-8//IGNORE\", $string);\r\n if ($string != $out) {\r\n $out = \"Warning: String not shown for security reasons: \" .\r\n \"String contains invalid utf-8 charactes.\";\r\n }\r\n return $out;\r\n }", "function utf8decode($string){\n\tif(function_exists('mb_convert_encoding')){\n\t\t return mb_convert_encoding($string, \"iso-8859-1\", \"UTF-8\");\n\t}else{\n\t\treturn utf8_decode($string);\n\t}\n}", "public static function convert2UTF8($string, $from_encode) {\n if (empty($string)) {\n return '';\n }\n if ($from_encode == self::ENCODE_UTF8) {\n return $string;\n }\n $from_encode = self::convertEncodingName($from_encode);\n return self::convertEncode($string, $from_encode, self::ENCODE_UTF8);\n }", "function my_utf8_decode($string)\n{\nreturn strtr($string,\n \"???????¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ\",\n \"SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy\");\n}", "function charset_decode_utf_8 ($string) {\r\n\t /* avoid using 0xA0 (\\240) in ereg ranges. RH73 does not like that */\r\n\t if (! ereg(\"[\\200-\\237]\", $string) and ! ereg(\"[\\241-\\377]\", $string))\r\n\t return $string;\r\n\r\n\t // decode three byte unicode characters\r\n\t $string = preg_replace(\"/([\\340-\\357])([\\200-\\277])([\\200-\\277])/e\",\r\n\t \"'&#'.((ord('\\\\1')-224)*4096 + (ord('\\\\2')-128)*64 + (ord('\\\\3')-128)).';'\",\r\n\t $string);\r\n\r\n\t // decode two byte unicode characters\r\n\t $string = preg_replace(\"/([\\300-\\337])([\\200-\\277])/e\",\r\n\t \"'&#'.((ord('\\\\1')-192)*64+(ord('\\\\2')-128)).';'\",\r\n\t $string);\r\n\r\n\t return $string;\r\n\t}", "function utf8($x){\n\t#return is_string($x)?utf8_encode($x):$x;\n\treturn $x;\n}", "protected function makeUTF8 ( $s )\n\t{\n\t\tif (function_exists('iconv'))\n\t\t{\n\t\t\tdo\n\t\t\t{\n\t\t\t\t$ok = true;\n\t\t\t\t$text = @iconv('UTF-8', 'UTF-8//TRANSLIT', $s);\n\t\t\t\tif (strlen($text) != strlen($s))\n\t\t\t\t{\n\t\t\t\t\t// Remove the offending character...\n\t\t\t\t\t$s = $text . '.' . substr($s, strlen($text) + 1);\n\t\t\t\t\t$ok = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (!$ok);\n\t\t}\n\t\treturn $s;\n\t}", "public function utf8_force($string){\r\n if (preg_match('%^(?:\r\n [\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII\r\n | [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\r\n | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\r\n | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\r\n | \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\r\n | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\r\n | [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\r\n | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\r\n )*$%xs', $string))\r\n return $string;\r\n else\r\n return iconv('CP1252', 'UTF-8', $string);\r\n }", "function encode($str)\n{\n\treturn mb_convert_encoding($str,'UTF-8');\n}", "function convert_to_utf8($data, $encoding) {\n if (function_exists('iconv')) {\n $out = @iconv($encoding, 'utf-8', $data);\n }\n else if (function_exists('mb_convert_encoding')) {\n $out = @mb_convert_encoding($data, 'utf-8', $encoding);\n }\n else if (function_exists('recode_string')) {\n $out = @recode_string($encoding .'..utf-8', $data);\n }\n else {\n /* watchdog('php', t(\"Unsupported encoding '%s'. Please install iconv, GNU\nrecode or mbstring for PHP.\", array('%s' => $encoding)), WATCHDOG_ERROR); */\n return FALSE;\n }\n return $out;\n}", "function fixEncoding($in_str) \r\n{ \r\n $cur_encoding = mb_detect_encoding($in_str) ; \r\n if($cur_encoding == \"UTF-8\" && mb_check_encoding($in_str,\"UTF-8\")) \r\n return $in_str; \r\n else \r\n return utf8_encode($in_str); \r\n}", "function fixEncoding($in_str)\r\n\r\n{\r\n\r\n $cur_encoding = mb_detect_encoding($in_str) ;\r\n\r\n if($cur_encoding == \"UTF-8\" && mb_check_encoding($in_str,\"UTF-8\"))\r\n\r\n return $in_str;\r\n\r\n else\r\n\r\n return utf8_encode($in_str);\r\n\r\n}", "public static function strToUtf($value)\r\n {\r\n if(empty($value) || is_null($value)){\r\n return null;\r\n }\r\n return iconv('WINDOWS-1251', 'UTF-8', $value);\r\n }", "public static function utf16_to_utf8($str)\n {\n $len = strlen($str);\n $dec = '';\n\n for ($i = 0; $i < $len; $i += 2) {\n $c = ord($str[$i]) << 8 | ord($str[$i + 1]);\n if ($c >= 0x0001 && $c <= 0x007F) {\n $dec .= chr($c);\n }\n else if ($c > 0x07FF) {\n $dec .= chr(0xE0 | (($c >> 12) & 0x0F));\n $dec .= chr(0x80 | (($c >> 6) & 0x3F));\n $dec .= chr(0x80 | (($c >> 0) & 0x3F));\n }\n else {\n $dec .= chr(0xC0 | (($c >> 6) & 0x1F));\n $dec .= chr(0x80 | (($c >> 0) & 0x3F));\n }\n }\n\n return $dec;\n }", "public static function unicodeToIso ($string)\r\n\t{\r\n\t\t# Return the string without alteration if the multibyte extension is not present\r\n\t\tif (!function_exists ('mb_convert_encoding')) {return $string;}\r\n\t\t\r\n\t\t# Return the result\r\n\t\treturn mb_convert_encoding ($string, 'ISO-8859-1', mb_detect_encoding ($string, 'UTF-8, ISO-8859-1, ISO-8859-15', true));\r\n\t}", "public function utf8_Validate($string)\n {\n $output=$string;\n if (!preg_match('!!u', $string)) {\n $output = utf8_encode($string);\n }\n return $output;\n }", "public static function ensureUTF8($input)\n {\n $encoding = mb_detect_encoding($input, ['UTF-8', 'ISO-8859-1'], true);\n\n if ('ISO-8859-1' === $encoding) {\n return utf8_encode($input);\n }\n\n return $input;\n }", "public static function fixEncoding($in_str) { \r\r\n\t\t$cur_encoding = mb_detect_encoding($in_str) ; \r\r\n\t\tif($cur_encoding == \"UTF-8\" && mb_check_encoding($in_str,\"UTF-8\")) \r\r\n\t\t\treturn $in_str; \r\r\n\t\telse \r\r\n\t\t\treturn utf8_encode($in_str); \r\r\n\t}", "public function testConvertToUTF8nonUTF8(): void\n {\n $string = StringUtil::convertToUTF8(chr(0xBF));\n\n self::assertEquals(mb_convert_encoding(chr(0xBF), 'UTF-8', 'ISO-8859-1'), $string);\n }", "function unicode_conv($originalString) {\n $replacedString = preg_replace(\"#\\\\\\\\u(\\w{4})#\", \"&#x$1;\", $originalString);\n $unicodeString = mb_convert_encoding($replacedString, 'ISO-8859-1', 'HTML-ENTITIES');\n return $unicodeString;\n}", "public static function hexToStr($string) {\n\n if (!self::hasHexPrefix($string)) {\n throw new \\Exception('String is missing Hex prefix \"0x\" : ' . $string);\n }\n $string = substr($string, strlen('0x'));\n $utf8 = '';\n\n\n $letters = str_split($string, 2);\n foreach ($letters as $letter) {\n $utf8 .= html_entity_decode(\"&#x$letter;\", ENT_QUOTES, 'UTF-8');\n }\n return $utf8;\n\n // Dosn't tackle Line 18\n // if ($string < 128) {\n // $utf = chr($string);\n // }\n // elseif ($string < 2048) {\n // $utf = chr(192 + (($string - ($string % 64)) / 64));\n // $utf .= chr(128 + ($string % 64));\n // }\n // else {\n // $utf = chr(224 + (($string - ($string % 4096)) / 4096));\n // $utf .= chr(128 + ((($string % 4096) - ($string % 64)) / 64));\n // $utf .= chr(128 + ($string % 64));\n //}\n\n // Can't handle Ö\n // $utf8 = hex2bin($string);\n\n // Can't handle Ö\n //$func_length = strlen($string);\n //for ($func_index = 0; $func_index < $func_length; ++$func_index) {\n // $utf8 .= chr(hexdec($string{$func_index} . $string{++$func_index}));\n //}\n\n // Destroys umlauts\n // for ($i=0; $i < strlen($string)-1; $i+=2){\n // $utf8 .= chr(hexdec($string[$i].$string[$i+1]));\n // }\n }", "function decodeUtf8($str) {\n $res = '';\n for ($i = 0; $i <= strlen($str) - 6; $i++) {\n $character = $str[$i];\n if ($character == '\\\\' && $str[$i + 1] == 'u') {\n $value = hexdec(substr($str, $i + 2, 4));\n\n if ($value < 0x0080) {\n // 1 byte: 0xxxxxxx\n $character = chr($value);\n } else if ($value < 0x0800) {\n // 2 bytes: 110xxxxx 10xxxxxx\n $character = chr((($value & 0x07c0) >> 6) | 0xc0);\n $character .= chr(($value & 0x3f) | 0x80);\n } else {\n // 3 bytes: 1110xxxx 10xxxxxx 10xxxxxx\n $character = chr((($value & 0xf000) >> 12) | 0xe0);\n $character .= chr((($value & 0x0fc0) >> 6) | 0x80);\n $character .= chr(($value & 0x3f) | 0x80);\n }\n $i += 5;\n }\n $res .= $character;\n }\n return $res . substr($str, $i);\n}", "function utf8_encode($data)\n{\n}", "public static function convert($string, $inEncoding, $outEncoding) {}", "function & _wp_utf8_to_8859_2(&$string) {\n $decode=array(\n \"\\xC4\\x84\"=>\"\\xA1\",\n \"\\xC4\\x85\"=>\"\\xB1\",\n \"\\xC4\\x86\"=>\"\\xC6\",\n \"\\xC4\\x87\"=>\"\\xE6\",\n \"\\xC4\\x98\"=>\"\\xCA\",\n \"\\xC4\\x99\"=>\"\\xEA\",\n \"\\xC5\\x81\"=>\"\\xA3\",\n \"\\xC5\\x82\"=>\"\\xB3\",\n \"\\xC5\\x83\"=>\"\\xD1\",\n \"\\xC5\\x84\"=>\"\\xF1\",\n \"\\xC3\\x93\"=>\"\\xD3\",\n \"\\xC3\\xB3\"=>\"\\xF3\",\n \"\\xC5\\x9A\"=>\"\\xA6\",\n \"\\xC5\\x9B\"=>\"\\xB6\",\n \"\\xC5\\xB9\"=>\"\\xAC\",\n \"\\xC5\\xBA\"=>\"\\xBC\",\n \"\\xC5\\xBB\"=>\"\\xAF\",\n \"\\xC5\\xBC\"=>\"\\xBF\"\n );\n\n $string = strtr(\"$string\",$decode);\n return $string;\n }", "function mb_to_unicode($string, $encoding = null)\n{\n if ($encoding) {\n $expanded = mb_convert_encoding($string, 'UTF-32BE', $encoding);\n } else {\n $expanded = mb_convert_encoding($string, 'UTF-32BE');\n }\n return unpack('N*', $expanded);\n}", "public function convertDatabaseToUTF8();", "protected function _getToUnicode() {}", "protected function strip_non_utf8( $string ) {\n\t\tini_set( 'mbstring.substitute_character', 'none' );\n\n\t\treturn mb_convert_encoding( $string, 'UTF-8', 'UTF-8' );\n\t}", "public static function encode(?string $string): string\n {\n if (!$string) return '';\n\n $fromEncoding = mb_detect_encoding($string);\n $toEncoding = 'UTF-8////IGNORE';\n\n return $convertedString = //@mb_convert_encoding($string, $toEncoding, $fromEncoding) ?:\n @iconv($fromEncoding, $toEncoding, $string);\n }", "private function handle_encoding($string)\n {\n switch ($this->get_option('encode')) {\n case 'utf8':\n return $string;\n case 'iso88591':\n return utf8_encode($string);\n default:\n return $string;\n }\n }", "function _utf8_decode($string){\n\t$tmp = $string;\n\t$count = 0;\n\twhile (mb_detect_encoding($tmp)==\"UTF-8\"){\n \t$tmp = utf8_decode($tmp);\n \t$count++;\n \t}\n\tfor ($i = 0; $i < $count-1 ; $i++){\n\t $string = utf8_decode($string);\n\t}\n\treturn $string;\n}", "static public function ValidateUTF8($string)\n {\n $pop_10s = 0;\n\n $unicode_char = 0;\n\n for ($i=0; isset($string[$i]); $i++) {\n $c = ord($string[$i]);\n if ($pop_10s) {\n # Check if following chars in multibytes are not 10xxxxxx\n if (($c & 0xC0) != 0x80) {\n throw new Exception\\BadUTF8('Following characters must be 10xxxxxx');\n } else {\n $unicode_char <<= 6;\n $unicode_char |= $c & 0x3F;\n --$pop_10s;\n }\n } else if (($c & 0x7F) == $c) {\n # single ASCII char\n $unicode_char = 0;\n\n /*\n I tried mosquitto, it accepts \\0 when publishing Message, no connection is closed.\n No exception will be thrown here.\n\n MQTT-1.5.3-2\n A UTF-8 encoded string MUST NOT include an encoding of the null character U+0000.\n If a receiver (Server or Client) receives a Control Packet containing U+0000 it MUST\n close the Network Connection.\n\n */\n continue;\n } else if (($c & 0xFE) == 0xFC) {\n # leading 1111110x\n $pop_10s = 5;\n\n $unicode_char = 0;\n $unicode_char |= $c & 0x01;\n } else if (($c & 0xFC) == 0xF8) {\n # leading 111110xx\n $pop_10s = 4;\n\n $unicode_char = 0;\n $unicode_char |= $c & 0x03;\n } else if (($c & 0xF8) == 0xF0) {\n # leading 11110xxx\n $pop_10s = 3;\n\n $unicode_char = 0;\n $unicode_char |= $c & 0x07;\n } else if (($c & 0xF0) == 0xE0) {\n # leading 1110xxxx\n $pop_10s = 2;\n\n $unicode_char = 0;\n $unicode_char |= $c & 0x0F;\n } else if (($c & 0xE0) == 0xC0) {\n # leading 110xxxxx\n $pop_10s = 1;\n\n $unicode_char = 0;\n $unicode_char |= $c & 0x1F;\n } else {\n throw new Exception\\BadUTF8('Bad leading characters');\n }\n\n if ($unicode_char >= 0xD800 && $unicode_char <= 0xDFFF) {\n /*\n MQTT-1.5.3.1\n The character data in a UTF-8 encoded string MUST be well-formed UTF-8 as defined\n by the Unicode specification [Unicode] and restated in RFC 3629 [RFC3629]. In\n particular this data MUST NOT include encodings of code points between U+D800 and\n U+DFFF. If a Server or Client receives a Control Packet containing ill-formed UTF-8\n it MUST close the Network Connection [MQTT-1.5.3-1].\n\n */\n throw new Exception\\BadUTF8('U+D800 ~ U+DFFF CAN NOT be used in UTF-8');\n }\n }\n\n if ($pop_10s) {\n throw new Exception\\BadUTF8('Missing UTF-8 following characters');\n }\n\n return true;\n }", "public static function utf7_to_utf8($str)\n {\n $Index_64 = array(\n 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,\n 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,\n 0,0,0,0, 0,0,0,0, 0,0,0,1, 0,0,0,0,\n 1,1,1,1, 1,1,1,1, 1,1,0,0, 0,0,0,0,\n 0,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1,\n 1,1,1,1, 1,1,1,1, 1,1,1,0, 0,0,0,0,\n 0,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1,\n 1,1,1,1, 1,1,1,1, 1,1,1,0, 0,0,0,0,\n );\n\n $u7len = strlen($str);\n $str = strval($str);\n $res = '';\n\n for ($i=0; $u7len > 0; $i++, $u7len--) {\n $u7 = $str[$i];\n if ($u7 == '+') {\n $i++;\n $u7len--;\n $ch = '';\n\n for (; $u7len > 0; $i++, $u7len--) {\n $u7 = $str[$i];\n\n if (!$Index_64[ord($u7)]) {\n break;\n }\n\n $ch .= $u7;\n }\n\n if ($ch == '') {\n if ($u7 == '-') {\n $res .= '+';\n }\n\n continue;\n }\n\n $res .= self::utf16_to_utf8(base64_decode($ch));\n }\n else {\n $res .= $u7;\n }\n }\n\n return $res;\n }", "public static function windows_1252_to_utf8($string)\n {\n }", "function utf8_to_ascii($str) {\n\t\tif (!isset ($str))\n\t\t\treturn \"\";\n\n\t\tglobal $GLOBAL_ARRAY_TRANSLATE_UNICODE;\n\n\t\t$str = strtr($str, $GLOBAL_ARRAY_TRANSLATE_UNICODE);\n\t\treturn $str;\n\t}", "private function corrigeInputEncoding($string)\n {\n if (!is_string($string)) {\n return $string;\n }\n $encodageSupporte = [];\n $encodageSupporte[] = \"UTF-8\";\n $encodageSupporte[] = \"CP1252\";\n $encodageSupporte[] = \"ISO-8859-15\";\n $encodageSupporte[] = \"ISO-8859-1\";\n $encodageSupporte[] = \"ASCII\";\n $encodageDetecte = mb_detect_encoding($string, $encodageSupporte, true);\n if ($encodageDetecte != $this->pdoCharset) {\n return mb_convert_encoding(\n $string,\n $this->pdoCharset,\n $encodageDetecte\n );\n }\n return $string;\n }", "function uni2utf8($uniescape)\n\t{\n\t\t$c = \"\";\n\t\t\n\t\t$n = intval(substr($uniescape, -4), 16);\n\t\tif ($n < 0x7F) {// 0000-007F\n\t\t\t$c .= chr($n);\n\t\t} elseif ($n < 0x800) {// 0080-0800\n\t\t\t$c .= chr(0xC0 | ($n / 64));\n\t\t\t$c .= chr(0x80 | ($n % 64));\n\t\t} else {\t\t\t\t// 0800-FFFF\n\t\t\t$c .= chr(0xE0 | (($n / 64) / 64));\n\t\t\t$c .= chr(0x80 | (($n / 64) % 64));\n\t\t\t$c .= chr(0x80 | ($n % 64));\n\t\t}\n\t\treturn $c;\n\t}", "function FixString($string)\n{\n return mb_convert_encoding($string, \"UTF-8\", \"Windows-1252\");\n}", "public function convertToCurrentEncoding($string)\n\t\t{\n\t\t\t$convertedString = $string;\n\t\t\tmb_convert_variables(_APP_ENCODING, mb_detect_encoding($string.'a', 'UTF-8, ISO-8859-1, EUC-JP, SJIS, GBK, ISO-8859-15, ASCII, JIS'), $convertedString);\n\t\t\treturn $convertedString;\n\t\t}", "function get_encoded_string ($str) {\n setlocale(LC_ALL, 'fr_FR.UTF-8');\n return iconv('UTF-8', 'ASCII//TRANSLIT', $str);\n}", "function rc_utf8_clean($input)\n{\n // handle input of type array\n if (is_array($input)) {\n foreach ($input as $idx => $val)\n $input[$idx] = rc_utf8_clean($val);\n return $input;\n }\n \n if (!is_string($input) || $input == '')\n return $input;\n\n // iconv/mbstring are much faster (especially with long strings)\n if (function_exists('mb_convert_encoding') && ($res = mb_convert_encoding($input, 'UTF-8', 'UTF-8')) !== false)\n return $res;\n\n if (function_exists('iconv') && ($res = @iconv('UTF-8', 'UTF-8//IGNORE', $input)) !== false)\n return $res;\n\n $regexp = '/^('.\n// '[\\x00-\\x7F]'. // UTF8-1\n '|[\\xC2-\\xDF][\\x80-\\xBF]'. // UTF8-2\n '|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]'. // UTF8-3\n '|[\\xE1-\\xEC][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-3\n '|\\xED[\\x80-\\x9F][\\x80-\\xBF]'. // UTF8-3\n '|[\\xEE-\\xEF][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-3\n '|\\xF0[\\x90-\\xBF][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-4\n '|[\\xF1-\\xF3][\\x80-\\xBF][\\x80-\\xBF][\\x80-\\xBF]'.// UTF8-4\n '|\\xF4[\\x80-\\x8F][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-4\n ')$/';\n \n $seq = '';\n $out = '';\n\n for ($i = 0, $len = strlen($input); $i < $len; $i++) {\n $chr = $input[$i];\n $ord = ord($chr);\n // 1-byte character\n if ($ord <= 0x7F) {\n if ($seq)\n $out .= preg_match($regexp, $seq) ? $seq : '';\n $seq = '';\n $out .= $chr;\n // first (or second) byte of multibyte sequence\n } else if ($ord >= 0xC0) {\n if (strlen($seq)>1) {\n\t$out .= preg_match($regexp, $seq) ? $seq : '';\n $seq = '';\n } else if ($seq && ord($seq) < 0xC0) {\n $seq = '';\n }\n $seq .= $chr;\n // next byte of multibyte sequence\n } else if ($seq) {\n $seq .= $chr;\n }\n }\n\n if ($seq)\n $out .= preg_match($regexp, $seq) ? $seq : '';\n\n return $out;\n}", "public function remove_bad_utf8($str)\n {\n $str = str_replace('“', '&quot;', $str);\n $str = str_replace('”', '&quot;', $str);\n $str = str_replace('‘', '&#39;', $str);\n $str = str_replace('’', '&#39;', $str);\n $str = str_replace('&#8220;', '&quot;', $str);\n $str = str_replace('&#8221;', '&quot;', $str);\n \n /// convertimos a utf8\n ini_set('mbstring.substitute_character', \"none\");\n return mb_convert_encoding($str, 'UTF-8', 'auto');\n }", "public function testUtf8(): void\n {\n $value = mb_convert_encoding(\"\\xa0a\\xa0\", 'UTF-8', 'ISO-8859-1');\n self::assertSame('a', $this->filter->filter($value));\n }", "function convert($string, $to = 'UTF-8', $from = 'auto'){\n $result = false;\n if ($string != null && $to != null && is_string($to)) {\n $string = (string) $string;\n if (strpos($to, '//') !== false) {\n $split = explode('//', $to);\n $to = array_shift($split);\n }\n if (is_array($from)\n || (is_string($from) && strcasecmp($from, 'auto') === 0)) {\n $detect = $this->detectEncoding($string, $from);\n if ($detect !== false) {\n $from = $detect;\n }\n }\n if ($this->hasMBString) {\n $to = $this->getEncodingName($to, 'mbstring', $to);\n $from = $this->getEncodingName($from, 'mbstring', $from);\n $result = mb_convert_encoding($string, $to, $from);\n } else if ($this->hasIConv) {\n $to = $this->getEncodingName($to, 'iconv', $to);\n $to .= '//TRANSLIT//IGNORE';\n $from = $this->getEncodingName($from, 'iconv', $from);\n $result = @iconv($from, $to, $string);\n }\n if (!$result) {\n $to = $this->getEncodingName($to, null, $to);\n $from = $this->getEncodingName($from, null, $from);\n if (strcasecmp($to, $from) === 0) {\n $result = $string;\n } else {\n $result = false;\n }\n }\n }\n return $result;\n }", "function convertString($str)\n{\n\tif (!is_utf8($str))\n\t{\n\t\t$str = utf8_encode($str);\n\t}\n\n\t// clean up the html\n\t$str = cleanHTML($str);\n\n\t// return the url encoded string\n\treturn urlencode($str);\n}", "function utf8init()\n{\n mb_internal_encoding('UTF-8');\n\n // Tell PHP that we'll be outputting UTF-8 to the browser\n mb_http_output('UTF-8');\n\n //$str = json_encode($arr, JSON_UNESCAPED_UNICODE); //这样我们存进去的是就是中文了,那么取出的也就是中文了\n\n}", "public static function convertEncoding($char) {\n return str::convert($char, 'UTF-16BE', 'UTF-8');\n }", "function convFromOutputCharset($str,$pagecodeto='UTF-8')\n\t{\n\t\tglobal $conf;\n\t\tif ($pagecodeto == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_decode($str);\n\t\tif ($pagecodeto == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') $str=utf8_encode($str);\n\t\treturn $str;\n\t}", "protected static function utf8Htmlize($str)\n {\n if (!preg_match('//u', $str) && function_exists('iconv')) {\n set_error_handler('var_dump', 0);\n $charset = ini_get('default_charset');\n if ('UTF-8' === $charset || $str !== @iconv($charset, $charset, $str)) {\n $charset = 'CP1252';\n }\n restore_error_handler();\n\n $str = iconv($charset, 'UTF-8', $str);\n }\n\n return htmlspecialchars($str, ENT_QUOTES | (PHP_VERSION_ID >= 50400 ? ENT_SUBSTITUTE : 0), 'UTF-8');\n }", "private static function normalize($string = '')\n {\n $string = mb_convert_encoding($string, 'UTF-8');\n $string = iconv('UTF-8-MAC', 'UTF-8', $string);\n\n return iconv('UTF-8-MAC', 'UTF-8', $string);\n }", "private function convToOutputCharset($str,$pagecodefrom='UTF-8')\n\t{\n\t\tglobal $conf;\n\t\tif ($pagecodefrom == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_encode($str);\n\t\tif ($pagecodefrom == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') $str=utf8_decode($str);\n\t\treturn $str;\n\t}", "function echo8($txt) {\n\techo $txt;\n\t//echo utf8_decode($txt);\n}", "function utf8_convert_aix($string)\n{\n global $aixlocale_codepage_map, $aix_utf8_converters, $unicode_encoding;\n\n // Retrieve current locale setting\n $aix_locale = setlocale(LC_TIME, '0');\n\n if ($aix_locale === FALSE)\n {\n // Locale setting could not be retrieved; return string unchanged\n return $string;\n }\n\n if (!array_key_exists($aix_locale, $aixlocale_codepage_map))\n {\n // Default code page of locale could not be found; return string unchanged\n return $string;\n }\n\n $aix_codepage = $aixlocale_codepage_map[$aix_locale];\n\n if (!in_array($aix_codepage, $aix_utf8_converters, TRUE))\n {\n // No suitable UTF-8 converter was found for this code page; return string unchanged\n return $string;\n }\n\n // Convert string to UTF-8\n $aix_string = iconv($aix_codepage, 'UTF-8', $string);\n\n // Default to original string if conversion failed\n $string = ($aix_string === FALSE) ? $string : $aix_string;\n\n return $string;\n}", "static public function utf8Encode($string, $len = 0) {\n $_unicode = '';\n $_values = array();\n $_nOctets = 1;\n $_unicodeLength = 0;\n $stringLength = strlen($string);\n\n for ($i = 0; $i < $stringLength; $i++) {\n $value = ord($string[$i]);\n\n if ($value < 128) {\n if ($len && ($_unicodeLength >= $len)) {\n break;\n }\n\n $_unicode .= chr($value);\n $_unicodeLength++;\n } else {\n if (count($_values) == 0) {\n $_nOctets = ($value < 224) ? 2 : 3;\n }\n\n $_values[] = $value;\n\n if ($len && ($_unicodeLength + ($_nOctets * 3)) > $len) {\n break;\n }\n\n if (count($_values) == $_nOctets) {\n if ($_nOctets == 3) {\n $_unicode .= '%' . dechex($_values[0]) . '%' . dechex($_values[1]) . '%' . dechex($_values[2]);\n $_unicodeLength += 9;\n } else {\n $_unicode .= '%' . dechex($_values[0]) . '%' . dechex($_values[1]);\n $_unicodeLength += 6;\n }\n\n $_values = array();\n $_nOctets = 1;\n }\n }\n }\n\n return $_unicode;\n }", "function utf8_sanitize($str, &$errors = null) {\n if ($errors !== null) {\n $errors = array();\n }\n $utf8 = '';\n $bytesNeeded = 0;\n $bytesSeen = 0;\n $lowerBoundary = 0x80;\n $upperBoundary = 0xBF;\n $char = '';\n for ($pos = 0, $length = strlen($str); $pos < $length; $pos++) {\n $byte = ord($str[$pos]);\n if ($bytesNeeded == 0) {\n if ($byte >= 0x00 and $byte <= 0x7F) {\n $utf8 .= $str[$pos];\n } elseif ($byte >= 0xC2 and $byte <= 0xDF) {\n $bytesNeeded = 1;\n } elseif ($byte >= 0xE0 and $byte <= 0xEF) {\n if ($byte == 0xE0) {\n $lowerBoundary = 0xA0;\n }\n if ($byte == 0xED) {\n $upperBoundary = 0x9F;\n }\n $bytesNeeded = 2;\n } elseif ($byte >= 0xF0 and $byte <= 0xF4) {\n if ($byte == 0xF0) {\n $lowerBoundary = 0x90;\n }\n if ($byte == 0xF4) {\n $upperBoundary = 0x8F;\n }\n $bytesNeeded = 3;\n } else {\n $utf8 .= UTF8_REPLACEMENT_CHARACTER;\n if ($errors !== null) $errors[] = $pos;\n }\n $char = $str[$pos];\n } elseif ($byte < $lowerBoundary or $byte > $upperBoundary) {\n $char = '';\n $bytesNeeded = 0;\n $bytesSeen = 0;\n $lowerBoundary = 0x80;\n $upperBoundary = 0xBF;\n $utf8 .= UTF8_REPLACEMENT_CHARACTER;\n if ($errors !== null) $errors[] = $pos;\n $pos--;\n } else {\n $lowerBoundary = 0x80;\n $upperBoundary = 0xBF;\n $bytesSeen++;\n $char .= $str[$pos];\n if ($bytesSeen == $bytesNeeded) {\n $utf8 .= $char;\n $char = '';\n $bytesNeeded = 0;\n $bytesSeen = 0;\n }\n }\n }\n if ($bytesNeeded > 0) {\n $utf8 .= UTF8_REPLACEMENT_CHARACTER;\n if ($errors !== null) $errors[] = $length;\n }\n return $utf8;\n}", "function _utf8_urldecode($str)\n{\n $str = preg_replace(\"/%u([0-9a-f]{3,4})/i\",\"&#x\\\\1;\", urldecode($str));\n return html_entity_decode($str,null,'UTF-8');\n}", "function p_enc($string) {\r\n $char_encoded = mb_convert_encoding($string, 'UTF-8', 'SJIS');\r\n return urlencode($char_encoded);\r\n}", "function isUtf8($string) {\n if (function_exists(\"mb_check_encoding\") && is_callable(\"mb_check_encoding\")) {\n return mb_check_encoding($string, 'UTF8');\n }\n\n return preg_match('%^(?:\n [\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII\n | [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\n | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\n | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\n | \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\n | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\n | [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\n | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\n )*$%xs', $string);\n\n }", "public function utf8toISO8859_1(Model $Model, $string)\n\t{\n\t\t$accented = array(\n\t\t\t'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ă', 'Ą',\n\t\t\t'Ç', 'Ć', 'Č', 'Œ',\n\t\t\t'Ď', 'Đ',\n\t\t\t'à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ă', 'ą',\n\t\t\t'ç', 'ć', 'č', 'œ',\n\t\t\t'ď', 'đ',\n\t\t\t'È', 'É', 'Ê', 'Ë', 'Ę', 'Ě',\n\t\t\t'Ğ',\n\t\t\t'Ì', 'Í', 'Î', 'Ï', 'İ',\n\t\t\t'Ĺ', 'Ľ', 'Ł',\n\t\t\t'è', 'é', 'ê', 'ë', 'ę', 'ě',\n\t\t\t'ğ',\n\t\t\t'ì', 'í', 'î', 'ï', 'ı',\n\t\t\t'ĺ', 'ľ', 'ł',\n\t\t\t'Ñ', 'Ń', 'Ň',\n\t\t\t'Ò', 'Ó', 'Ô', 'Õ', 'Ö', 'Ø', 'Ő',\n\t\t\t'Ŕ', 'Ř',\n\t\t\t'Ś', 'Ş', 'Š',\n\t\t\t'ñ', 'ń', 'ň',\n\t\t\t'ò', 'ó', 'ô', 'ö', 'ø', 'ő',\n\t\t\t'ŕ', 'ř',\n\t\t\t'ś', 'ş', 'š',\n\t\t\t'Ţ', 'Ť',\n\t\t\t'Ù', 'Ú', 'Û', 'Ų', 'Ü', 'Ů', 'Ű',\n\t\t\t'Ý', 'ß',\n\t\t\t'Ź', 'Ż', 'Ž',\n\t\t\t'ţ', 'ť',\n\t\t\t'ù', 'ú', 'û', 'ų', 'ü', 'ů', 'ű',\n\t\t\t'ý', 'ÿ',\n\t\t\t'ź', 'ż', 'ž',\n\t\t\t'А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р',\n\t\t\t'а', 'б', 'в', 'г', 'д', 'е', 'ё', 'ж', 'з', 'и', 'й', 'к', 'л', 'м', 'н', 'о', 'р',\n\t\t\t'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я',\n\t\t\t'с', 'т', 'у', 'ф', 'х', 'ц', 'ч', 'ш', 'щ', 'ъ', 'ы', 'ь', 'э', 'ю', 'я'\n\t\t\t);\n\n\t\t$replace = array(\n\t\t\t'A', 'A', 'A', 'A', 'A', 'A', 'AE', 'A', 'A',\n\t\t\t'C', 'C', 'C', 'CE',\n\t\t\t'D', 'D',\n\t\t\t'a', 'a', 'a', 'a', 'a', 'a', 'ae', 'a', 'a',\n\t\t\t'c', 'c', 'c', 'ce',\n\t\t\t'd', 'd',\n\t\t\t'E', 'E', 'E', 'E', 'E', 'E',\n\t\t\t'G',\n\t\t\t'I', 'I', 'I', 'I', 'I',\n\t\t\t'L', 'L', 'L',\n\t\t\t'e', 'e', 'e', 'e', 'e', 'e',\n\t\t\t'g',\n\t\t\t'i', 'i', 'i', 'i', 'i',\n\t\t\t'l', 'l', 'l',\n\t\t\t'N', 'N', 'N',\n\t\t\t'O', 'O', 'O', 'O', 'O', 'O', 'O',\n\t\t\t'R', 'R',\n\t\t\t'S', 'S', 'S',\n\t\t\t'n', 'n', 'n',\n\t\t\t'o', 'o', 'o', 'o', 'o', 'o',\n\t\t\t'r', 'r',\n\t\t\t's', 's', 's',\n\t\t\t'T', 'T',\n\t\t\t'U', 'U', 'U', 'U', 'U', 'U', 'U',\n\t\t\t'Y', 'Y',\n\t\t\t'Z', 'Z', 'Z',\n\t\t\t't', 't',\n\t\t\t'u', 'u', 'u', 'u', 'u', 'u', 'u',\n\t\t\t'y', 'y',\n\t\t\t'z', 'z', 'z',\n\t\t\t'A', 'B', 'B', 'r', 'A', 'E', 'E', 'X', '3', 'N', 'N', 'K', 'N', 'M', 'H', 'O', 'N', 'P',\n\t\t\t'a', 'b', 'b', 'r', 'a', 'e', 'e', 'x', '3', 'n', 'n', 'k', 'n', 'm', 'h', 'o', 'p',\n\t\t\t'C', 'T', 'Y', 'O', 'X', 'U', 'u', 'W', 'W', 'b', 'b', 'b', 'E', 'O', 'R',\n\t\t\t'c', 't', 'y', 'o', 'x', 'u', 'u', 'w', 'w', 'b', 'b', 'b', 'e', 'o', 'r'\n\t\t\t);\n\t\t$string = str_replace($accented, $replace, $string);\n\t\t$string = utf8_decode($string);\n\t\t\n\t\treturn $string;\n\t}", "protected function _encode($str = '') {\n\t\treturn iconv(\"UTF-8\",\"UTF-8//IGNORE\", html_entity_decode($str, ENT_COMPAT, 'utf-8'));\n\t}", "function utf8_clean($str)\n{\n return iconv('UTF-8', 'UTF-8//IGNORE', $str);\n}", "public static function to_utf8($str, bool $decode_html_entity_to_utf8 = false)\n {\n if (\\is_array($str)) {\n foreach ($str as &$v) {\n $v = self::to_utf8_string($v, $decode_html_entity_to_utf8);\n }\n\n /** @phpstan-var TToUtf8 $str */\n return $str;\n }\n\n \\assert(\\is_string($str));\n\n $str = self::to_utf8_string($str, $decode_html_entity_to_utf8);\n\n /** @phpstan-var TToUtf8 $str */\n return $str;\n }", "protected final function _convertString($string, $encoding)\n {\n $target = $this->getOption(\"encoding\", ID3_Encoding::UTF8);\n switch ($target) {\n case ID3_Encoding::UTF16:\n $target = \"utf-16\";\n break;\n case ID3_Encoding::UTF16LE:\n $target = \"utf-16le\";\n break;\n case ID3_Encoding::UTF16BE:\n $target = \"utf-16be\";\n break;\n case ID3_Encoding::UTF8:\n $target = \"utf-8\";\n break;\n default:\n $target = \"iso-8859-1\";\n }\n\n if (strtolower($target) == strtolower($encoding))\n return $string;\n\n if (is_array($string))\n foreach ($string as $key => $value)\n $string[$key] = iconv($encoding, $target, $value);\n else\n $string = iconv($encoding, $target, $string);\n return $string;\n }", "public static function utf8ToEntities($string)\n\t{\n\t\tif (!@preg_match(\"[\\200-\\237]\",$string) && !@preg_match(\"[\\241-\\377]\",$string))\n\t\t\treturn $string;\n\t\t$string = preg_replace(\"/[\\302-\\375]([\\001-\\177])/\",\"&#65533;\\\\1\",$string);\n\t\t$string = preg_replace(\"/[\\340-\\375].([\\001-\\177])/\",\"&#65533;\\\\1\",$string);\n\t\t$string = preg_replace(\"/[\\360-\\375]..([\\001-\\177])/\",\"&#65533;\\\\1\",$string);\n\t\t$string = preg_replace(\"/[\\370-\\375]...([\\001-\\177])/\",\"&#65533;\\\\1\",$string);\n\t\t$string = preg_replace(\"/[\\374-\\375]....([\\001-\\177])/\",\"&#65533;\\\\1\",$string);\n\t\t$string = preg_replace(\"/[\\300-\\301]./\", \"&#65533;\", $string);\n\t\t$string = preg_replace(\"/\\364[\\220-\\277]../\",\"&#65533;\",$string);\n\t\t$string = preg_replace(\"/[\\365-\\367].../\",\"&#65533;\",$string);\n\t\t$string = preg_replace(\"/[\\370-\\373]..../\",\"&#65533;\",$string);\n\t\t$string = preg_replace(\"/[\\374-\\375]...../\",\"&#65533;\",$string);\n\t\t$string = preg_replace(\"/[\\376-\\377]/\",\"&#65533;\",$string);\n\t\t$string = preg_replace(\"/[\\302-\\364]{2,}/\",\"&#65533;\",$string);\n\t\t$string = preg_replace(\n\t\t\t\"/([\\360-\\364])([\\200-\\277])([\\200-\\277])([\\200-\\277])/e\",\n\t\t\t\"'&#'.((ord('\\\\1')&7)<<18 | (ord('\\\\2')&63)<<12 |\".\n\t\t\t\" (ord('\\\\3')&63)<<6 | (ord('\\\\4')&63)).';'\",\n\t\t$string);\n\t\t$string = preg_replace(\"/([\\340-\\357])([\\200-\\277])([\\200-\\277])/e\",\n\t\t\"'&#'.((ord('\\\\1')&15)<<12 | (ord('\\\\2')&63)<<6 | (ord('\\\\3')&63)).';'\",\n\t\t$string);\n\t\t$string = preg_replace(\"/([\\300-\\337])([\\200-\\277])/e\",\n\t\t\"'&#'.((ord('\\\\1')&31)<<6 | (ord('\\\\2')&63)).';'\",\n\t\t$string);\n\t\t$string = preg_replace(\"/[\\200-\\277]/\",\"&#65533;\",$string);\n\t\treturn $string;\n\t}", "function lang_encode_from_utf($strValue)\r\n{\r\n\tif(function_exists(\"iconv\"))\r\n\t\treturn iconv('UTF-8','Windows-1252',$strValue);\r\n\treturn $strValue;\r\n}", "function utf8_win($s) {\n $out = \"\";\n $c1 = \"\";\n $byte2 = false;\n for ($c = 0; $c < strlen($s); $c++) {\n $i = ord($s[$c]);\n if ($i <= 127) {\n $out .= $s[$c];\n }\n if ($byte2) {\n $new_c2 = ($c1 & 3) * 64 + ($i & 63);\n $new_c1 = ($c1 >> 2) & 5;\n $new_i = $new_c1 * 256 + $new_c2;\n if ($new_i == 1025) {\n $out_i = 168;\n } else {\n if ($new_i == 1105) {\n $out_i = 184;\n } else {\n $out_i = $new_i - 848;\n }\n }\n $out .= chr($out_i);\n $byte2 = false;\n }\n if (($i >> 5) == 6) {\n $c1 = $i;\n $byte2 = true;\n }\n }\n return $out;\n }", "function convert_to_utf8($obj)\n{\n global $config;\n $ret = $obj;\n // wenn die Verbindung zur Datenbank nicht auf utf8 steht, dann muessen die Rückgaben in utf8 gewandelt werden,\n // da die Webseite utf8-kodiert ist\n if (!isset($config['mysql_can_change_encoding'])) {\n get_sql_encodings();\n }\n\n if ($config['mysql_can_change_encoding'] == false && $config['mysql_standard_character_set'] != 'utf8') {\n if (is_array($obj)) {\n foreach ($obj as $key => $val) {\n //echo \"<br> Wandle \" . $val . \" nach \";\n $obj[$key] = utf8_encode($val);\n //echo $obj[$key];\n }\n }\n if (is_string($obj)) {\n $obj = utf8_encode($obj);\n }\n $ret = $obj;\n }\n\n return $ret;\n}", "function win2utf($val,$always=false) { #trace();\r\n global $ezer_mysql_cp;\r\n if ( $always || !$ezer_mysql_cp || $ezer_mysql_cp=='cp1250' ) {\r\n $val= strtr($val, \"\\x9E\\x9A\\x9D\\x8E\\x8A\\x8D\", \"\\xBE\\xB9\\xBB\\xAE\\xA9\\xAB\");\r\n $val= mb_convert_encoding($val,'UTF-8','ISO-8859-2');\r\n }\r\n return $val;\r\n}", "function win1252_to_utf8($data){\r\n\treturn iconv(\"Windows-1252\", \"UTF-8\", $data);\r\n}", "function isUTF8($string){\r\n\tif (is_array($string)){\r\n\t\t$enc = implode('', $string);\r\n\t\treturn @!((ord($enc[0]) != 239) && (ord($enc[1]) != 187) && (ord($enc[2]) != 191));\r\n\t}else{\r\n\t\treturn (utf8_encode(utf8_decode($string)) == $string);\r\n\t}\r\n}", "function isUtf8($string) {\n\tif (function_exists(\"mb_check_encoding\") && is_callable(\"mb_check_encoding\")) {\n\t\treturn mb_check_encoding($string, 'UTF8');\n\t}\n\treturn preg_match('%^(?:\n\t\t [\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII\n\t\t| [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\n\t\t| \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\n\t\t| [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\n\t\t| \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\n\t\t| \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\n\t\t| [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\n\t\t| \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\n\t)*$%xs', $string);\n}", "function decode($string){\n $string = utf8_decode($string);\n // decod it again in case it is encoded twice\n $string = utf8_decode($string);\n // remove the charecters inserted while decoding\n $string = str_ireplace(\"?\", \"'\", $string);\n $string = addslashes(trim($string));\n return $string;\n}", "protected static function utf8ToUtf16le($string) {\n\t\treturn iconv('UTF-8', 'UTF-16LE', $string);\n\t}", "function mb_is_utf8($string) { \n\treturn mb_detect_encoding($string, 'UTF-8') === 'UTF-8';\n}", "function unicode2charset($texte, $charset='AUTO') {\n\tstatic $CHARSET_REVERSE;\n\tstatic $trans = array();\n\t\n\tif ($charset == 'AUTO')\n\t\t$charset = $GLOBALS['meta']['charset'];\n$charset='utf-8';\n\tswitch($charset) {\n\tcase 'utf-8':\n\t\treturn unicode_to_utf_8($texte);\n\t\tbreak;\n\n\tdefault:\n\t\t$charset = load_charset($charset);\n\n\t\tif (!is_array($CHARSET_REVERSE[$charset])) {\n\t\t\t$CHARSET_REVERSE[$charset] = array_flip($GLOBALS['CHARSET'][$charset]);\n\t\t}\n\n\t\tif (!isset($trans[$charset])){\n\t\t\t$trans[$charset]=array();\n\t\t\t$t = &$trans[$charset];\n\t\t\tfor($e=128;$e<255;$e++){\n\t\t\t\t$h = dechex($e);\n\t\t\t\tif ($s = isset($CHARSET_REVERSE[$charset][$e])){\n\t\t\t\t\t$s = $CHARSET_REVERSE[$charset][$e];\n\t\t\t\t\t$t['&#'.$e.';'] = $t['&#0'.$e.';'] = $t['&#00'.$e.';'] = chr($s);\n\t\t\t\t\t$t['&#x'.$h.';'] = $t['&#x0'.$h.';'] = $t['&#x00'.$h.';'] = chr($s);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$t['&#'.$e.';'] = $t['&#0'.$e.';'] = $t['&#00'.$e.';'] = chr($e);\n\t\t\t\t\t$t['&#x'.$h.';'] = $t['&#x0'.$h.';'] = $t['&#x00'.$h.';'] = chr($e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$texte = strtr($texte, $trans[$charset]);\n\t\treturn $texte;\n\t}\n}", "function utf8_uri_encode( $utf8_string, $length = 0 ) {\r\n\t $unicode = '';\r\n\t $values = array();\r\n\t $num_octets = 1;\r\n\t $unicode_length = 0;\r\n\r\n\t mbstring_binary_safe_encoding();\r\n\t $string_length = strlen( $utf8_string );\r\n\t reset_mbstring_encoding();\r\n\r\n\t for ($i = 0; $i < $string_length; $i++ ) {\r\n\r\n\t\t$value = ord( $utf8_string[ $i ] );\r\n\r\n\t\tif ( $value < 128 ) {\r\n\t\t if ( $length && ( $unicode_length >= $length ) )\r\n\t\t\tbreak;\r\n\t\t $unicode .= chr($value);\r\n\t\t $unicode_length++;\r\n\t\t} else {\r\n\t\t if ( count( $values ) == 0 ) $num_octets = ( $value < 224 ) ? 2 : 3;\r\n\r\n\t\t $values[] = $value;\r\n\r\n\t\t if ( $length && ( $unicode_length + ($num_octets * 3) ) > $length )\r\n\t\t\tbreak;\r\n\t\t if ( count( $values ) == $num_octets ) {\r\n\t\t\tif ($num_octets == 3) {\r\n\t\t\t $unicode .= '%' . dechex($values[0]) . '%' . dechex($values[1]) . '%' . dechex($values[2]);\r\n\t\t\t $unicode_length += 9;\r\n\t\t\t} else {\r\n\t\t\t $unicode .= '%' . dechex($values[0]) . '%' . dechex($values[1]);\r\n\t\t\t $unicode_length += 6;\r\n\t\t\t}\r\n\r\n\t\t\t$values = array();\r\n\t\t\t$num_octets = 1;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\r\n\t return $unicode;\r\n\t}", "function charset2unicode($texte, $charset='AUTO' /* $forcer: obsolete*/) {\n\tstatic $trans;\n\n\tif ($charset == 'AUTO')\n\t\t$charset = $GLOBALS['meta']['charset'];\n\n\tif ($charset == '') $charset = 'iso-8859-1';\n\t$charset = strtolower($charset);\n\n\tswitch ($charset) {\n\tcase 'utf-8':\n\t\treturn utf_8_to_unicode($texte);\n\n\tcase 'iso-8859-1':\n\t\t$texte = corriger_caracteres_windows($texte, 'iso-8859-1');\n\t\t// pas de break; ici, on suit sur default:\n\n\tdefault:\n\t\t// mbstring presente ?\n\t\tif (init_mb_string()) {\n\t\t\tif ($order = mb_detect_order() # mb_string connait-il $charset?\n\t\t\tAND mb_detect_order($charset)) {\n\t\t\t\t$s = mb_convert_encoding($texte, 'utf-8', $charset);\n\t\t\t\tif ($s && $s != $texte) return utf_8_to_unicode($s);\n\t\t\t}\n\t\t\tmb_detect_order($order); # remettre comme precedemment\n\t\t}\n\n\t\t// Sinon, peut-etre connaissons-nous ce charset ?\n\t\tif (!isset($trans[$charset])) {\n\t\t\tglobal $CHARSET;\n\t\t\tif ($cset = load_charset($charset)\n\t\t\tAND is_array($CHARSET[$cset]))\n\t\t\t\tforeach ($CHARSET[$cset] as $key => $val) {\n\t\t\t\t\t$trans[$charset][chr($key)] = '&#'.$val.';';\n\t\t\t}\n\t\t}\n\t\tif (count($trans[$charset]))\n\t\t\treturn strtr($texte, $trans[$charset]);\n\n\t\t// Sinon demander a iconv (malgre le fait qu'il coupe quand un\n\t\t// caractere n'appartient pas au charset, mais c'est un probleme\n\t\t// surtout en utf-8, gere ci-dessus)\n\t\tif (test_iconv()) {\n\t\t\t$s = iconv($charset, 'utf-32le', $texte);\n\t\t\tif ($s) return utf_32_to_unicode($s);\n\t\t}\n\n\t\t// Au pire ne rien faire\n\t\tspip_log(\"erreur charset '$charset' non supporte\");\n\t\treturn $texte;\n\t}\n}" ]
[ "0.8108258", "0.7865543", "0.7786369", "0.7757923", "0.7725076", "0.7700508", "0.7393194", "0.7335603", "0.7299328", "0.7259334", "0.7142656", "0.71225315", "0.7105485", "0.7081672", "0.7066251", "0.7064412", "0.70404214", "0.69924545", "0.6959634", "0.6844386", "0.68212575", "0.68028724", "0.6764958", "0.6760782", "0.6748899", "0.6732643", "0.67287874", "0.6713455", "0.6711461", "0.6688744", "0.668677", "0.6684891", "0.66800195", "0.6672876", "0.6633973", "0.65981454", "0.6581939", "0.65635157", "0.65384877", "0.6522652", "0.6491943", "0.64661956", "0.6421739", "0.6410663", "0.64052725", "0.64028645", "0.64018285", "0.6398806", "0.63925016", "0.6381156", "0.63784415", "0.63783926", "0.63568807", "0.6354865", "0.6349327", "0.6337785", "0.63065284", "0.62938744", "0.62914604", "0.6279933", "0.626078", "0.6260052", "0.6239576", "0.61969537", "0.6161605", "0.61595565", "0.6156167", "0.61472994", "0.6140304", "0.6135832", "0.6135741", "0.61095184", "0.6071416", "0.6066305", "0.60564756", "0.6055885", "0.6029311", "0.60270506", "0.6010217", "0.60066956", "0.6001481", "0.5997258", "0.59931666", "0.59821296", "0.5978099", "0.59613824", "0.5959947", "0.5956839", "0.59517944", "0.5947391", "0.5947331", "0.5929799", "0.59223783", "0.5913102", "0.5909683", "0.5904785", "0.5902809", "0.5899717", "0.58984673", "0.5892999" ]
0.7344126
7
Convert string from UTF8
function deutf8($str) { if(mb_detect_encoding($str) == "UTF-8" && mb_check_encoding($str,"UTF-8")) return utf8_decode($str); else return $str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convert_to_utf8(string $str): string\n {\n return preg_replace_callback(\n '/\\\\\\\\u([0-9a-fA-F]{4})/',\n static function (array $match): string {\n return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');\n },\n $str\n );\n }", "private function _utf8convert( $string )\r\n\t{\r\n\t\t// Test the string to see if it isn't utf-8\r\n\t\tif ( $this->_utf8check( $string ) ) {\r\n\t\t\treturn $string;\r\n\t\t}\r\n\t\t\r\n\t\tif (! function_exists( 'mb_detect_encoding' ) ) {\r\n\t\t\t// @TODO: Log an error somehow\r\n\t\t\t$this->unicode = null;\r\n\t\t\treturn string;\r\n\t\t}\r\n\t\t\r\n\t\t$encoding\t=\tmb_detect_encoding( $string, 'auto', true );\r\n\t\tif (! $encoding ) {\r\n\t\t\t// @TODO: Log an error somehow\r\n\t\t\t$this->unicode = null;\r\n\t\t\treturn $string;\r\n\t\t}\r\n\t\t\r\n\t\tif (! function_exists( 'iconv' ) ) {\r\n\t\t\t// @TODO: Log an error somehow\r\n\t\t\t$this->unicode = null;\r\n\t\t\treturn $string;\r\n\t\t}\r\n\t\t\r\n\t\t$result\t=\ticonv( strtoupper( $encoding ), 'UTF-8//TRANSLIT', $string );\r\n\t\tif (! $result ) {\r\n\t\t\t// @TODO: Log an error somehow\r\n\t\t\t$this->unicode = null;\r\n\t\t\treturn $string;\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "public static function toUTF8($str) {\n\t\t\t$lst = 'UTF-8, ISO-8859-1';\n\t\t\t$cur = mb_detect_encoding($str, $lst);\n\t\t\treturn mb_convert_encoding($str, 'UTF-8', $cur);\n\t\t}", "function str_to_utf8( $string ) {\n\n // Check if mbstring is installed, if not, run old way\n if ( !function_exists( 'mb_convert_encoding' ) )\n return ( ( preg_match( '!!u', $string ) ) ? $string : utf8_encode( $string ) );\n\n // Convert encoding from XXX to UTF-8\n $string = mb_convert_encoding( $string, \"UTF-8\" );\n\n // Escape special characters\n htmlspecialchars( $string, ENT_QUOTES, 'UTF-8' );\n $string = html_entity_decode( $string );\n\n // Return modified - UTF-8 string\n return $string;\n\n }", "protected function chars_convert($string)\r\n {\r\n if (function_exists('mb_convert_encoding'))\r\n {\r\n $out = mb_convert_encoding($string, mb_detect_encoding($string), \"UTF-8\"); \r\n }\r\n else\r\n {\r\n $out = $string;\r\n }\r\n \r\n return $out; \r\n }", "function my_utf8_decode($string)\n{\nreturn strtr($string,\n \"???????¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ\",\n \"SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy\");\n}", "function convert_to_utf8($str)\n{\n\t$old_charset = $_SESSION['old_charset'];\n\t\n\tif ($str === null || $str == '' || $old_charset == 'UTF-8')\n\t\treturn $str;\n\n\t$save = $str;\n\n\t// Replace literal entities (for non-UTF-8 compliant html_entity_encode)\n\tif (version_compare(PHP_VERSION, '5.0.0', '<') && $old_charset == 'ISO-8859-1' || $old_charset == 'ISO-8859-15')\n\t\t$str = html_entity_decode($str, ENT_QUOTES, $old_charset);\n\n\tif ($old_charset != 'UTF-8' && !seems_utf8($str))\n\t{\n\t\tif (function_exists('iconv'))\n\t\t\t$str = iconv($old_charset == 'ISO-8859-1' ? 'WINDOWS-1252' : $old_charset, 'UTF-8', $str);\n\t\telse if (function_exists('mb_convert_encoding'))\n\t\t\t$str = mb_convert_encoding($str, 'UTF-8', $old_charset == 'ISO-8859-1' ? 'WINDOWS-1252' : 'ISO-8859-1');\n\t\telse if ($old_charset == 'ISO-8859-1')\n\t\t\t$str = utf8_encode($str);\n\t}\n\n\t// Replace literal entities (for UTF-8 compliant html_entity_encode)\n\tif (version_compare(PHP_VERSION, '5.0.0', '>='))\n\t\t$str = html_entity_decode($str, ENT_QUOTES, 'UTF-8');\n\n\t// Replace numeric entities\n\t$str = preg_replace_callback('/&#([0-9]+);/', 'utf8_callback_1', $str);\n\t$str = preg_replace_callback('/&#x([a-f0-9]+);/i', 'utf8_callback_2', $str);\n\n\t// Remove \"bad\" characters\n\t$str = remove_bad_characters($str);\n\n\treturn $str;//($save != $str);\n}", "function & _wp_iso8859_2_to_utf8(&$string) {\n $decode=array(\n \"\\xA1\" => \"\\xC4\\x84\",\n \"\\xB1\" => \"\\xC4\\x85\",\n \"\\xC6\" => \"\\xC4\\x86\",\n \"\\xE6\" => \"\\xC4\\x87\",\n \"\\xCA\" => \"\\xC4\\x98\",\n \"\\xEA\" => \"\\xC4\\x99\",\n \"\\xA3\" => \"\\xC5\\x81\",\n \"\\xB3\" => \"\\xC5\\x82\",\n \"\\xD1\" => \"\\xC5\\x83\",\n \"\\xF1\" => \"\\xC5\\x84\",\n \"\\xD3\" => \"\\xC3\\x93\",\n \"\\xF3\" => \"\\xC3\\xB3\",\n \"\\xA6\" => \"\\xC5\\x9A\",\n \"\\xB6\" => \"\\xC5\\x9B\",\n \"\\xAC\" => \"\\xC5\\xB9\",\n \"\\xBC\" => \"\\xC5\\xBA\",\n \"\\xAF\" => \"\\xC5\\xBB\",\n \"\\xBF\" => \"\\xC5\\xBC\",\n );\n $string = strtr(\"$string\",$decode);\n return $string;\n }", "public static function convertToUtf8($string) {\n if (!self::isUtf8($string)) {\n $string = self::convertEncoding($string, 'gbk', 'utf-8');\n }\n return $string;\n }", "function utf8decode($string){\n\tif(function_exists('mb_convert_encoding')){\n\t\t return mb_convert_encoding($string, \"iso-8859-1\", \"UTF-8\");\n\t}else{\n\t\treturn utf8_decode($string);\n\t}\n}", "public function encode_convert($string) {\r\n\t\treturn mb_convert_encoding(trim($string), \"UTF-8\", \"EUC-JP, UTF-8, ASCII, JIS, eucjp-win, sjis-win\");\r\n\t}", "function utf8($str)\n{\n if(mb_detect_encoding($str) == \"UTF-8\" && mb_check_encoding($str,\"UTF-8\")) return $str;\n else return utf8_encode($str);\n}", "static public function stringToUtf8($string) {\n if ($GLOBALS['LANG']->charSet == '' || $GLOBALS['LANG']->charSet == 'iso-8859-1') {\n return utf8_encode($string);\n } else {\n return $string;\n }\n\t}", "public static function convertToUtf8(string $string): string\n {\n return mb_convert_encoding($string, 'UTF-8');\n }", "function unicode_conv($originalString) {\n $replacedString = preg_replace(\"#\\\\\\\\u(\\w{4})#\", \"&#x$1;\", $originalString);\n $unicodeString = mb_convert_encoding($replacedString, 'ISO-8859-1', 'HTML-ENTITIES');\n return $unicodeString;\n}", "function seems_utf8($str)\n {\n }", "function charset_decode_utf_8 ($string) {\r\n\t /* avoid using 0xA0 (\\240) in ereg ranges. RH73 does not like that */\r\n\t if (! ereg(\"[\\200-\\237]\", $string) and ! ereg(\"[\\241-\\377]\", $string))\r\n\t return $string;\r\n\r\n\t // decode three byte unicode characters\r\n\t $string = preg_replace(\"/([\\340-\\357])([\\200-\\277])([\\200-\\277])/e\",\r\n\t \"'&#'.((ord('\\\\1')-224)*4096 + (ord('\\\\2')-128)*64 + (ord('\\\\3')-128)).';'\",\r\n\t $string);\r\n\r\n\t // decode two byte unicode characters\r\n\t $string = preg_replace(\"/([\\300-\\337])([\\200-\\277])/e\",\r\n\t \"'&#'.((ord('\\\\1')-192)*64+(ord('\\\\2')-128)).';'\",\r\n\t $string);\r\n\r\n\t return $string;\r\n\t}", "public static function to_utf8_string(string $str, bool $decode_html_entity_to_utf8 = false): string\n {\n if ($str === '') {\n return $str;\n }\n\n $max = \\strlen($str);\n $buf = '';\n\n for ($i = 0; $i < $max; ++$i) {\n $c1 = $str[$i];\n\n if ($c1 >= \"\\xC0\") { // should be converted to UTF8, if it's not UTF8 already\n\n if ($c1 <= \"\\xDF\") { // looks like 2 bytes UTF8\n\n $c2 = $i + 1 >= $max ? \"\\x00\" : $str[$i + 1];\n\n if ($c2 >= \"\\x80\" && $c2 <= \"\\xBF\") { // yeah, almost sure it's UTF8 already\n $buf .= $c1 . $c2;\n ++$i;\n } else { // not valid UTF8 - convert it\n $buf .= self::to_utf8_convert_helper($c1);\n }\n } elseif ($c1 >= \"\\xE0\" && $c1 <= \"\\xEF\") { // looks like 3 bytes UTF8\n\n $c2 = $i + 1 >= $max ? \"\\x00\" : $str[$i + 1];\n $c3 = $i + 2 >= $max ? \"\\x00\" : $str[$i + 2];\n\n if ($c2 >= \"\\x80\" && $c2 <= \"\\xBF\" && $c3 >= \"\\x80\" && $c3 <= \"\\xBF\") { // yeah, almost sure it's UTF8 already\n $buf .= $c1 . $c2 . $c3;\n $i += 2;\n } else { // not valid UTF8 - convert it\n $buf .= self::to_utf8_convert_helper($c1);\n }\n } elseif ($c1 >= \"\\xF0\" && $c1 <= \"\\xF7\") { // looks like 4 bytes UTF8\n\n $c2 = $i + 1 >= $max ? \"\\x00\" : $str[$i + 1];\n $c3 = $i + 2 >= $max ? \"\\x00\" : $str[$i + 2];\n $c4 = $i + 3 >= $max ? \"\\x00\" : $str[$i + 3];\n\n if ($c2 >= \"\\x80\" && $c2 <= \"\\xBF\" && $c3 >= \"\\x80\" && $c3 <= \"\\xBF\" && $c4 >= \"\\x80\" && $c4 <= \"\\xBF\") { // yeah, almost sure it's UTF8 already\n $buf .= $c1 . $c2 . $c3 . $c4;\n $i += 3;\n } else { // not valid UTF8 - convert it\n $buf .= self::to_utf8_convert_helper($c1);\n }\n } else { // doesn't look like UTF8, but should be converted\n\n $buf .= self::to_utf8_convert_helper($c1);\n }\n } elseif (($c1 & \"\\xC0\") === \"\\x80\") { // needs conversion\n\n $buf .= self::to_utf8_convert_helper($c1);\n } else { // it doesn't need conversion\n\n $buf .= $c1;\n }\n }\n\n // decode unicode escape sequences + unicode surrogate pairs\n $buf = \\preg_replace_callback(\n '/\\\\\\\\u([dD][89abAB][0-9a-fA-F]{2})\\\\\\\\u([dD][cdefCDEF][\\da-fA-F]{2})|\\\\\\\\u([0-9a-fA-F]{4})/',\n /**\n * @param array $matches\n *\n * @psalm-pure\n *\n * @return string\n */\n static function (array $matches): string {\n if (isset($matches[3])) {\n $cp = (int) \\hexdec($matches[3]);\n } else {\n // http://unicode.org/faq/utf_bom.html#utf16-4\n $cp = ((int) \\hexdec($matches[1]) << 10)\n + (int) \\hexdec($matches[2])\n + 0x10000\n - (0xD800 << 10)\n - 0xDC00;\n }\n\n // https://github.com/php/php-src/blob/php-7.3.2/ext/standard/html.c#L471\n //\n // php_utf32_utf8(unsigned char *buf, unsigned k)\n\n if ($cp < 0x80) {\n return (string) self::chr($cp);\n }\n\n if ($cp < 0xA0) {\n /** @noinspection UnnecessaryCastingInspection */\n return (string) self::chr(0xC0 | $cp >> 6) . (string) self::chr(0x80 | $cp & 0x3F);\n }\n\n return self::decimal_to_chr($cp);\n },\n $buf\n );\n\n if ($buf === null) {\n return '';\n }\n\n // decode UTF-8 codepoints\n if ($decode_html_entity_to_utf8) {\n $buf = self::html_entity_decode($buf);\n }\n\n return $buf;\n }", "public static function convert($string, $inEncoding, $outEncoding) {}", "protected function _getToUnicode() {}", "function makeUTF8($str,$encoding = \"\") {\n if (!empty($str)) {\n if (empty($encoding) && isUTF8($str))\n $encoding = \"UTF-8\";\n if (empty($encoding))\n $encoding = mb_detect_encoding($str,'UTF-8, ISO-8859-1');\n if (empty($encoding))\n $encoding = \"ISO-8859-1\"; // if charset can't be detected, default to ISO-8859-1\n return $encoding == \"UTF-8\" ? $str : @mb_convert_encoding($str,\"UTF-8\",$encoding);\n }\n }", "function makeUTF8($str,$encoding = \"\") {\n if ($str !== \"\") {\n if (empty($encoding) && isUTF8($str))\n $encoding = \"UTF-8\";\n if (empty($encoding))\n $encoding = mb_detect_encoding($str,'UTF-8, ISO-8859-1');\n if (empty($encoding))\n $encoding = \"ISO-8859-1\"; // if charset can't be detected, default to ISO-8859-1\n return $encoding == \"UTF-8\" ? $str : @mb_convert_encoding($str,\"UTF-8\",$encoding);\n }\n }", "function fixEncoding($in_str) \r\n{ \r\n $cur_encoding = mb_detect_encoding($in_str) ; \r\n if($cur_encoding == \"UTF-8\" && mb_check_encoding($in_str,\"UTF-8\")) \r\n return $in_str; \r\n else \r\n return utf8_encode($in_str); \r\n}", "protected function _unicodeToUtf8($str)\n { \n $utf8 = '';\n \n foreach ($str as $unicode) {\n \n if ($unicode < 128) {\n \n $utf8 .= chr($unicode);\n \n } elseif ($unicode < 2048) {\n \n $utf8 .= chr(192 + ( ( $unicode - ( $unicode % 64 ) ) / 64 ));\n $utf8 .= chr(128 + ( $unicode % 64 ));\n \n } else {\n \n $utf8 .= chr( 224 + (( $unicode - ( $unicode % 4096 ) ) / 4096 ));\n $utf8 .= chr( 128 + (( ( $unicode % 4096 ) - ( $unicode % 64 ) ) / 64 ));\n $utf8 .= chr( 128 + ($unicode % 64 ));\n \n } // if\n \n } // foreach\n \n return $utf8;\n }", "function decodeUtf8($str) {\n $res = '';\n for ($i = 0; $i <= strlen($str) - 6; $i++) {\n $character = $str[$i];\n if ($character == '\\\\' && $str[$i + 1] == 'u') {\n $value = hexdec(substr($str, $i + 2, 4));\n\n if ($value < 0x0080) {\n // 1 byte: 0xxxxxxx\n $character = chr($value);\n } else if ($value < 0x0800) {\n // 2 bytes: 110xxxxx 10xxxxxx\n $character = chr((($value & 0x07c0) >> 6) | 0xc0);\n $character .= chr(($value & 0x3f) | 0x80);\n } else {\n // 3 bytes: 1110xxxx 10xxxxxx 10xxxxxx\n $character = chr((($value & 0xf000) >> 12) | 0xe0);\n $character .= chr((($value & 0x0fc0) >> 6) | 0x80);\n $character .= chr(($value & 0x3f) | 0x80);\n }\n $i += 5;\n }\n $res .= $character;\n }\n return $res . substr($str, $i);\n}", "function fixEncoding($in_str)\r\n\r\n{\r\n\r\n $cur_encoding = mb_detect_encoding($in_str) ;\r\n\r\n if($cur_encoding == \"UTF-8\" && mb_check_encoding($in_str,\"UTF-8\"))\r\n\r\n return $in_str;\r\n\r\n else\r\n\r\n return utf8_encode($in_str);\r\n\r\n}", "function mk_utf8($string) {\n\t\treturn (is_utf8($string) ? $string : utf8_encode($string));\n\t}", "public static function convertToUtf8($inputText)\n {\n return iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $inputText);\n }", "function mb_to_unicode($string, $encoding = null)\n{\n if ($encoding) {\n $expanded = mb_convert_encoding($string, 'UTF-32BE', $encoding);\n } else {\n $expanded = mb_convert_encoding($string, 'UTF-32BE');\n }\n return unpack('N*', $expanded);\n}", "public static function convert2UTF8($string, $from_encode) {\n if (empty($string)) {\n return '';\n }\n if ($from_encode == self::ENCODE_UTF8) {\n return $string;\n }\n $from_encode = self::convertEncodingName($from_encode);\n return self::convertEncode($string, $from_encode, self::ENCODE_UTF8);\n }", "function convert_to_utf8($data, $encoding) {\n if (function_exists('iconv')) {\n $out = @iconv($encoding, 'utf-8', $data);\n }\n else if (function_exists('mb_convert_encoding')) {\n $out = @mb_convert_encoding($data, 'utf-8', $encoding);\n }\n else if (function_exists('recode_string')) {\n $out = @recode_string($encoding .'..utf-8', $data);\n }\n else {\n /* watchdog('php', t(\"Unsupported encoding '%s'. Please install iconv, GNU\nrecode or mbstring for PHP.\", array('%s' => $encoding)), WATCHDOG_ERROR); */\n return FALSE;\n }\n return $out;\n}", "function decode($s) {\n if ($this->kod == 1) {\n $s = $this->win_utf8($s);\n }\n return $s;\n }", "function & _wp_utf8_to_8859_2(&$string) {\n $decode=array(\n \"\\xC4\\x84\"=>\"\\xA1\",\n \"\\xC4\\x85\"=>\"\\xB1\",\n \"\\xC4\\x86\"=>\"\\xC6\",\n \"\\xC4\\x87\"=>\"\\xE6\",\n \"\\xC4\\x98\"=>\"\\xCA\",\n \"\\xC4\\x99\"=>\"\\xEA\",\n \"\\xC5\\x81\"=>\"\\xA3\",\n \"\\xC5\\x82\"=>\"\\xB3\",\n \"\\xC5\\x83\"=>\"\\xD1\",\n \"\\xC5\\x84\"=>\"\\xF1\",\n \"\\xC3\\x93\"=>\"\\xD3\",\n \"\\xC3\\xB3\"=>\"\\xF3\",\n \"\\xC5\\x9A\"=>\"\\xA6\",\n \"\\xC5\\x9B\"=>\"\\xB6\",\n \"\\xC5\\xB9\"=>\"\\xAC\",\n \"\\xC5\\xBA\"=>\"\\xBC\",\n \"\\xC5\\xBB\"=>\"\\xAF\",\n \"\\xC5\\xBC\"=>\"\\xBF\"\n );\n\n $string = strtr(\"$string\",$decode);\n return $string;\n }", "function win_utf8($s) {\n $utf = \"\";\n for ($i = 0; $i < strlen($s); $i++) {\n $donotrecode = false;\n $c = ord(substr($s, $i, 1));\n if ($c == 0xA8) {\n $res = 0xD081;\n } elseif ($c == 0xB8) {\n $res = 0xD191;\n } elseif ($c < 0xC0) {\n $donotrecode = true;\n } elseif ($c < 0xF0) {\n $res = $c + 0xCFD0;\n } else {\n $res = $c + 0xD090;\n }\n $c = ($donotrecode) ? chr($c) : (chr($res >> 8) . chr($res & 0xff));\n $utf .= $c;\n }\n return $utf;\n }", "public static function strToUtf($value)\r\n {\r\n if(empty($value) || is_null($value)){\r\n return null;\r\n }\r\n return iconv('WINDOWS-1251', 'UTF-8', $value);\r\n }", "public static function unicodeToIso ($string)\r\n\t{\r\n\t\t# Return the string without alteration if the multibyte extension is not present\r\n\t\tif (!function_exists ('mb_convert_encoding')) {return $string;}\r\n\t\t\r\n\t\t# Return the result\r\n\t\treturn mb_convert_encoding ($string, 'ISO-8859-1', mb_detect_encoding ($string, 'UTF-8, ISO-8859-1, ISO-8859-15', true));\r\n\t}", "function utf8_to_ascii($str) {\n\t\tif (!isset ($str))\n\t\t\treturn \"\";\n\n\t\tglobal $GLOBAL_ARRAY_TRANSLATE_UNICODE;\n\n\t\t$str = strtr($str, $GLOBAL_ARRAY_TRANSLATE_UNICODE);\n\t\treturn $str;\n\t}", "public static function convertEncoding($char) {\n return str::convert($char, 'UTF-16BE', 'UTF-8');\n }", "function convert($string, $to = 'UTF-8', $from = 'auto'){\n $result = false;\n if ($string != null && $to != null && is_string($to)) {\n $string = (string) $string;\n if (strpos($to, '//') !== false) {\n $split = explode('//', $to);\n $to = array_shift($split);\n }\n if (is_array($from)\n || (is_string($from) && strcasecmp($from, 'auto') === 0)) {\n $detect = $this->detectEncoding($string, $from);\n if ($detect !== false) {\n $from = $detect;\n }\n }\n if ($this->hasMBString) {\n $to = $this->getEncodingName($to, 'mbstring', $to);\n $from = $this->getEncodingName($from, 'mbstring', $from);\n $result = mb_convert_encoding($string, $to, $from);\n } else if ($this->hasIConv) {\n $to = $this->getEncodingName($to, 'iconv', $to);\n $to .= '//TRANSLIT//IGNORE';\n $from = $this->getEncodingName($from, 'iconv', $from);\n $result = @iconv($from, $to, $string);\n }\n if (!$result) {\n $to = $this->getEncodingName($to, null, $to);\n $from = $this->getEncodingName($from, null, $from);\n if (strcasecmp($to, $from) === 0) {\n $result = $string;\n } else {\n $result = false;\n }\n }\n }\n return $result;\n }", "public function convert($str)\n\t{\n\t\tif ($this->from != $this->to)\n\t\t{\n\t\t\t$str = iconv($this->from, $this->to, $str);\n\t\t}\n\n\t\tif ($str === false)\n\t\t{\n\t\t\t// the convertion was a failure\n\t\t\tthrow new Exception('The convertion from \"'.$this->from.'\" to \"'.$this->to.'\" was a failure.');\n\t\t}\n\n\t\t// deal with BOM issue for utf-8 text\n\t\tif ($this->to == 'UTF-8')\n\t\t{\n\t\t\tif (substr($str, 0, 3) == \"\\xef\\xbb\\xbf\")\n\t\t\t{\n\t\t\t\t$str = substr($str, 3);\n\t\t\t}\n\t\t\tif (substr($str, -3, 3) == \"\\xef\\xbb\\xbf\")\n\t\t\t{\n\t\t\t\t$str = substr($str, 0, -3);\n\t\t\t}\n\t\t}\n\n\t\treturn $str;\n\t}", "public static function fixEncoding($in_str) { \r\r\n\t\t$cur_encoding = mb_detect_encoding($in_str) ; \r\r\n\t\tif($cur_encoding == \"UTF-8\" && mb_check_encoding($in_str,\"UTF-8\")) \r\r\n\t\t\treturn $in_str; \r\r\n\t\telse \r\r\n\t\t\treturn utf8_encode($in_str); \r\r\n\t}", "public function remove_bad_utf8($str)\n {\n $str = str_replace('“', '&quot;', $str);\n $str = str_replace('”', '&quot;', $str);\n $str = str_replace('‘', '&#39;', $str);\n $str = str_replace('’', '&#39;', $str);\n $str = str_replace('&#8220;', '&quot;', $str);\n $str = str_replace('&#8221;', '&quot;', $str);\n \n /// convertimos a utf8\n ini_set('mbstring.substitute_character', \"none\");\n return mb_convert_encoding($str, 'UTF-8', 'auto');\n }", "public static function utf16_to_utf8($str)\n {\n $len = strlen($str);\n $dec = '';\n\n for ($i = 0; $i < $len; $i += 2) {\n $c = ord($str[$i]) << 8 | ord($str[$i + 1]);\n if ($c >= 0x0001 && $c <= 0x007F) {\n $dec .= chr($c);\n }\n else if ($c > 0x07FF) {\n $dec .= chr(0xE0 | (($c >> 12) & 0x0F));\n $dec .= chr(0x80 | (($c >> 6) & 0x3F));\n $dec .= chr(0x80 | (($c >> 0) & 0x3F));\n }\n else {\n $dec .= chr(0xC0 | (($c >> 6) & 0x1F));\n $dec .= chr(0x80 | (($c >> 0) & 0x3F));\n }\n }\n\n return $dec;\n }", "public static function fromUtf16Be($string, $ignore = false, $translit = false) {}", "public static function fromUtf16Be($string, $ignore = false, $translit = false) {}", "public static function fromUtf16Be($string, $ignore = false, $translit = false) {}", "public static function fromUtf16Be($string, $ignore = false, $translit = false) {}", "public static function fromUtf16Be($string, $ignore = false, $translit = false) {}", "public static function fromUtf16Be($string, $ignore = false, $translit = false) {}", "public static function fromUtf16Be($string, $ignore = false, $translit = false) {}", "public static function sanitizeUTF8($string)\n\t{\n\t\t$output = preg_replace('/[^\\x{0009}\\x{000a}\\x{000d}\\x{0020}-\\x{D7FF}\\x{E000}-\\x{FFFD}]+/u', '', $string);\n\t\tif (is_null($output))\n\t\t{\n\t\t\t$output = \"\";\n\t\t\tif (empty($string))\n\t\t\t{\n\t\t\t\treturn $output;\n\t\t\t}\n\n\t\t\t$length = strlen($string);\n\t\t\tfor ($i = 0; $i < $length; $i++)\n\t\t\t{\n\t\t\t\t$current = ord($string{$i});\n\t\t\t\tif (($current == 0x9) ||\n\t\t\t\t\t($current == 0xA) ||\n\t\t\t\t\t($current == 0xD) ||\n\n\t\t\t\t\t(($current >= 0x28) && ($current <= 0xD7FF)) ||\n\t\t\t\t\t(($current >= 0xE000) && ($current <= 0xFFFD)) ||\n\t\t\t\t\t(($current >= 0x10000) && ($current <= 0x10FFFF))\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$output .= chr($current);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$output .= \" \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $output;\n\t}", "function convertString($str)\n{\n\tif (!is_utf8($str))\n\t{\n\t\t$str = utf8_encode($str);\n\t}\n\n\t// clean up the html\n\t$str = cleanHTML($str);\n\n\t// return the url encoded string\n\treturn urlencode($str);\n}", "private function unicodeConversion($message)\n {\n $message = mb_convert_encoding($message, 'UTF-16', 'UTF-8');\n $message = $this->strToHex($message); \n return $message;\n }", "public static function utf8Sanitize($string)\r\n {\r\n Preconditions::checkIsString($string, '$string must be string');\r\n $out = @iconv(\"UTF-8\", \"UTF-8//IGNORE\", $string);\r\n if ($string != $out) {\r\n $out = \"Warning: String not shown for security reasons: \" .\r\n \"String contains invalid utf-8 charactes.\";\r\n }\r\n return $out;\r\n }", "protected function makeUTF8 ( $s )\n\t{\n\t\tif (function_exists('iconv'))\n\t\t{\n\t\t\tdo\n\t\t\t{\n\t\t\t\t$ok = true;\n\t\t\t\t$text = @iconv('UTF-8', 'UTF-8//TRANSLIT', $s);\n\t\t\t\tif (strlen($text) != strlen($s))\n\t\t\t\t{\n\t\t\t\t\t// Remove the offending character...\n\t\t\t\t\t$s = $text . '.' . substr($s, strlen($text) + 1);\n\t\t\t\t\t$ok = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (!$ok);\n\t\t}\n\t\treturn $s;\n\t}", "function _utf8_urldecode($str)\n{\n $str = preg_replace(\"/%u([0-9a-f]{3,4})/i\",\"&#x\\\\1;\", urldecode($str));\n return html_entity_decode($str,null,'UTF-8');\n}", "function convFromOutputCharset($str,$pagecodeto='UTF-8')\n\t{\n\t\tglobal $conf;\n\t\tif ($pagecodeto == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_decode($str);\n\t\tif ($pagecodeto == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') $str=utf8_encode($str);\n\t\treturn $str;\n\t}", "public function convertDatabaseToUTF8();", "private function uniConvert ()\n\t\t{\n\t\t\t return preg_replace(\"/\\\\\\\\u([a-f0-9]{4})/e\",\n \"iconv('UCS-4LE','UTF-8',pack('V', hexdec('U$1')))\",\n json_encode($this->result));\n\t\t}", "function utf8_clean($str)\n{\n return iconv('UTF-8', 'UTF-8//IGNORE', $str);\n}", "function _utf8_decode($string){\n\t$tmp = $string;\n\t$count = 0;\n\twhile (mb_detect_encoding($tmp)==\"UTF-8\"){\n \t$tmp = utf8_decode($tmp);\n \t$count++;\n \t}\n\tfor ($i = 0; $i < $count-1 ; $i++){\n\t $string = utf8_decode($string);\n\t}\n\treturn $string;\n}", "function readUTF();", "function utf8($x){\n\t#return is_string($x)?utf8_encode($x):$x;\n\treturn $x;\n}", "function utf8encode($string){\n\tif(function_exists('mb_convert_encoding')){\n\t\t return mb_convert_encoding($string, \"UTF-8\", mb_detect_encoding($string));\n\t}else{\n\t\treturn utf8_encode($string);\n\t}\n}", "function encode($str)\n{\n\treturn mb_convert_encoding($str,'UTF-8');\n}", "protected static function utfDecode($str)\n\t{\n\t\tif(strtolower(SITE_CHARSET) != 'utf-8')\n\t\t\t$str = Encoding::convertEncodingArray($str, 'UTF-8', SITE_CHARSET);\n\n\t\treturn $str;\n\t}", "function FixString($string)\n{\n return mb_convert_encoding($string, \"UTF-8\", \"Windows-1252\");\n}", "public function utf8_force($string){\r\n if (preg_match('%^(?:\r\n [\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII\r\n | [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\r\n | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\r\n | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\r\n | \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\r\n | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\r\n | [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\r\n | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\r\n )*$%xs', $string))\r\n return $string;\r\n else\r\n return iconv('CP1252', 'UTF-8', $string);\r\n }", "function lang_encode_from_utf($strValue)\r\n{\r\n\tif(function_exists(\"iconv\"))\r\n\t\treturn iconv('UTF-8','Windows-1252',$strValue);\r\n\treturn $strValue;\r\n}", "function decode($string){\n $string = utf8_decode($string);\n // decod it again in case it is encoded twice\n $string = utf8_decode($string);\n // remove the charecters inserted while decoding\n $string = str_ireplace(\"?\", \"'\", $string);\n $string = addslashes(trim($string));\n return $string;\n}", "function utf8_convert_aix($string)\n{\n global $aixlocale_codepage_map, $aix_utf8_converters, $unicode_encoding;\n\n // Retrieve current locale setting\n $aix_locale = setlocale(LC_TIME, '0');\n\n if ($aix_locale === FALSE)\n {\n // Locale setting could not be retrieved; return string unchanged\n return $string;\n }\n\n if (!array_key_exists($aix_locale, $aixlocale_codepage_map))\n {\n // Default code page of locale could not be found; return string unchanged\n return $string;\n }\n\n $aix_codepage = $aixlocale_codepage_map[$aix_locale];\n\n if (!in_array($aix_codepage, $aix_utf8_converters, TRUE))\n {\n // No suitable UTF-8 converter was found for this code page; return string unchanged\n return $string;\n }\n\n // Convert string to UTF-8\n $aix_string = iconv($aix_codepage, 'UTF-8', $string);\n\n // Default to original string if conversion failed\n $string = ($aix_string === FALSE) ? $string : $aix_string;\n\n return $string;\n}", "public static function hexToStr($string) {\n\n if (!self::hasHexPrefix($string)) {\n throw new \\Exception('String is missing Hex prefix \"0x\" : ' . $string);\n }\n $string = substr($string, strlen('0x'));\n $utf8 = '';\n\n\n $letters = str_split($string, 2);\n foreach ($letters as $letter) {\n $utf8 .= html_entity_decode(\"&#x$letter;\", ENT_QUOTES, 'UTF-8');\n }\n return $utf8;\n\n // Dosn't tackle Line 18\n // if ($string < 128) {\n // $utf = chr($string);\n // }\n // elseif ($string < 2048) {\n // $utf = chr(192 + (($string - ($string % 64)) / 64));\n // $utf .= chr(128 + ($string % 64));\n // }\n // else {\n // $utf = chr(224 + (($string - ($string % 4096)) / 4096));\n // $utf .= chr(128 + ((($string % 4096) - ($string % 64)) / 64));\n // $utf .= chr(128 + ($string % 64));\n //}\n\n // Can't handle Ö\n // $utf8 = hex2bin($string);\n\n // Can't handle Ö\n //$func_length = strlen($string);\n //for ($func_index = 0; $func_index < $func_length; ++$func_index) {\n // $utf8 .= chr(hexdec($string{$func_index} . $string{++$func_index}));\n //}\n\n // Destroys umlauts\n // for ($i=0; $i < strlen($string)-1; $i+=2){\n // $utf8 .= chr(hexdec($string[$i].$string[$i+1]));\n // }\n }", "public function testUtf8(): void\n {\n $value = mb_convert_encoding(\"\\xa0a\\xa0\", 'UTF-8', 'ISO-8859-1');\n self::assertSame('a', $this->filter->filter($value));\n }", "function get_encoded_string ($str) {\n setlocale(LC_ALL, 'fr_FR.UTF-8');\n return iconv('UTF-8', 'ASCII//TRANSLIT', $str);\n}", "protected function strip_non_utf8( $string ) {\n\t\tini_set( 'mbstring.substitute_character', 'none' );\n\n\t\treturn mb_convert_encoding( $string, 'UTF-8', 'UTF-8' );\n\t}", "protected final function _convertString($string, $encoding)\n {\n $target = $this->getOption(\"encoding\", ID3_Encoding::UTF8);\n switch ($target) {\n case ID3_Encoding::UTF16:\n $target = \"utf-16\";\n break;\n case ID3_Encoding::UTF16LE:\n $target = \"utf-16le\";\n break;\n case ID3_Encoding::UTF16BE:\n $target = \"utf-16be\";\n break;\n case ID3_Encoding::UTF8:\n $target = \"utf-8\";\n break;\n default:\n $target = \"iso-8859-1\";\n }\n\n if (strtolower($target) == strtolower($encoding))\n return $string;\n\n if (is_array($string))\n foreach ($string as $key => $value)\n $string[$key] = iconv($encoding, $target, $value);\n else\n $string = iconv($encoding, $target, $string);\n return $string;\n }", "public function testConvertToUTF8nonUTF8(): void\n {\n $string = StringUtil::convertToUTF8(chr(0xBF));\n\n self::assertEquals(mb_convert_encoding(chr(0xBF), 'UTF-8', 'ISO-8859-1'), $string);\n }", "private static function normalize($string = '')\n {\n $string = mb_convert_encoding($string, 'UTF-8');\n $string = iconv('UTF-8-MAC', 'UTF-8', $string);\n\n return iconv('UTF-8-MAC', 'UTF-8', $string);\n }", "function uni2utf8($uniescape)\n\t{\n\t\t$c = \"\";\n\t\t\n\t\t$n = intval(substr($uniescape, -4), 16);\n\t\tif ($n < 0x7F) {// 0000-007F\n\t\t\t$c .= chr($n);\n\t\t} elseif ($n < 0x800) {// 0080-0800\n\t\t\t$c .= chr(0xC0 | ($n / 64));\n\t\t\t$c .= chr(0x80 | ($n % 64));\n\t\t} else {\t\t\t\t// 0800-FFFF\n\t\t\t$c .= chr(0xE0 | (($n / 64) / 64));\n\t\t\t$c .= chr(0x80 | (($n / 64) % 64));\n\t\t\t$c .= chr(0x80 | ($n % 64));\n\t\t}\n\t\treturn $c;\n\t}", "function charset2unicode($texte, $charset='AUTO' /* $forcer: obsolete*/) {\n\tstatic $trans;\n\n\tif ($charset == 'AUTO')\n\t\t$charset = $GLOBALS['meta']['charset'];\n\n\tif ($charset == '') $charset = 'iso-8859-1';\n\t$charset = strtolower($charset);\n\n\tswitch ($charset) {\n\tcase 'utf-8':\n\t\treturn utf_8_to_unicode($texte);\n\n\tcase 'iso-8859-1':\n\t\t$texte = corriger_caracteres_windows($texte, 'iso-8859-1');\n\t\t// pas de break; ici, on suit sur default:\n\n\tdefault:\n\t\t// mbstring presente ?\n\t\tif (init_mb_string()) {\n\t\t\tif ($order = mb_detect_order() # mb_string connait-il $charset?\n\t\t\tAND mb_detect_order($charset)) {\n\t\t\t\t$s = mb_convert_encoding($texte, 'utf-8', $charset);\n\t\t\t\tif ($s && $s != $texte) return utf_8_to_unicode($s);\n\t\t\t}\n\t\t\tmb_detect_order($order); # remettre comme precedemment\n\t\t}\n\n\t\t// Sinon, peut-etre connaissons-nous ce charset ?\n\t\tif (!isset($trans[$charset])) {\n\t\t\tglobal $CHARSET;\n\t\t\tif ($cset = load_charset($charset)\n\t\t\tAND is_array($CHARSET[$cset]))\n\t\t\t\tforeach ($CHARSET[$cset] as $key => $val) {\n\t\t\t\t\t$trans[$charset][chr($key)] = '&#'.$val.';';\n\t\t\t}\n\t\t}\n\t\tif (count($trans[$charset]))\n\t\t\treturn strtr($texte, $trans[$charset]);\n\n\t\t// Sinon demander a iconv (malgre le fait qu'il coupe quand un\n\t\t// caractere n'appartient pas au charset, mais c'est un probleme\n\t\t// surtout en utf-8, gere ci-dessus)\n\t\tif (test_iconv()) {\n\t\t\t$s = iconv($charset, 'utf-32le', $texte);\n\t\t\tif ($s) return utf_32_to_unicode($s);\n\t\t}\n\n\t\t// Au pire ne rien faire\n\t\tspip_log(\"erreur charset '$charset' non supporte\");\n\t\treturn $texte;\n\t}\n}", "static public function ValidateUTF8($string)\n {\n $pop_10s = 0;\n\n $unicode_char = 0;\n\n for ($i=0; isset($string[$i]); $i++) {\n $c = ord($string[$i]);\n if ($pop_10s) {\n # Check if following chars in multibytes are not 10xxxxxx\n if (($c & 0xC0) != 0x80) {\n throw new Exception\\BadUTF8('Following characters must be 10xxxxxx');\n } else {\n $unicode_char <<= 6;\n $unicode_char |= $c & 0x3F;\n --$pop_10s;\n }\n } else if (($c & 0x7F) == $c) {\n # single ASCII char\n $unicode_char = 0;\n\n /*\n I tried mosquitto, it accepts \\0 when publishing Message, no connection is closed.\n No exception will be thrown here.\n\n MQTT-1.5.3-2\n A UTF-8 encoded string MUST NOT include an encoding of the null character U+0000.\n If a receiver (Server or Client) receives a Control Packet containing U+0000 it MUST\n close the Network Connection.\n\n */\n continue;\n } else if (($c & 0xFE) == 0xFC) {\n # leading 1111110x\n $pop_10s = 5;\n\n $unicode_char = 0;\n $unicode_char |= $c & 0x01;\n } else if (($c & 0xFC) == 0xF8) {\n # leading 111110xx\n $pop_10s = 4;\n\n $unicode_char = 0;\n $unicode_char |= $c & 0x03;\n } else if (($c & 0xF8) == 0xF0) {\n # leading 11110xxx\n $pop_10s = 3;\n\n $unicode_char = 0;\n $unicode_char |= $c & 0x07;\n } else if (($c & 0xF0) == 0xE0) {\n # leading 1110xxxx\n $pop_10s = 2;\n\n $unicode_char = 0;\n $unicode_char |= $c & 0x0F;\n } else if (($c & 0xE0) == 0xC0) {\n # leading 110xxxxx\n $pop_10s = 1;\n\n $unicode_char = 0;\n $unicode_char |= $c & 0x1F;\n } else {\n throw new Exception\\BadUTF8('Bad leading characters');\n }\n\n if ($unicode_char >= 0xD800 && $unicode_char <= 0xDFFF) {\n /*\n MQTT-1.5.3.1\n The character data in a UTF-8 encoded string MUST be well-formed UTF-8 as defined\n by the Unicode specification [Unicode] and restated in RFC 3629 [RFC3629]. In\n particular this data MUST NOT include encodings of code points between U+D800 and\n U+DFFF. If a Server or Client receives a Control Packet containing ill-formed UTF-8\n it MUST close the Network Connection [MQTT-1.5.3-1].\n\n */\n throw new Exception\\BadUTF8('U+D800 ~ U+DFFF CAN NOT be used in UTF-8');\n }\n }\n\n if ($pop_10s) {\n throw new Exception\\BadUTF8('Missing UTF-8 following characters');\n }\n\n return true;\n }", "public static function utf7_to_utf8($str)\n {\n $Index_64 = array(\n 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,\n 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,\n 0,0,0,0, 0,0,0,0, 0,0,0,1, 0,0,0,0,\n 1,1,1,1, 1,1,1,1, 1,1,0,0, 0,0,0,0,\n 0,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1,\n 1,1,1,1, 1,1,1,1, 1,1,1,0, 0,0,0,0,\n 0,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1,\n 1,1,1,1, 1,1,1,1, 1,1,1,0, 0,0,0,0,\n );\n\n $u7len = strlen($str);\n $str = strval($str);\n $res = '';\n\n for ($i=0; $u7len > 0; $i++, $u7len--) {\n $u7 = $str[$i];\n if ($u7 == '+') {\n $i++;\n $u7len--;\n $ch = '';\n\n for (; $u7len > 0; $i++, $u7len--) {\n $u7 = $str[$i];\n\n if (!$Index_64[ord($u7)]) {\n break;\n }\n\n $ch .= $u7;\n }\n\n if ($ch == '') {\n if ($u7 == '-') {\n $res .= '+';\n }\n\n continue;\n }\n\n $res .= self::utf16_to_utf8(base64_decode($ch));\n }\n else {\n $res .= $u7;\n }\n }\n\n return $res;\n }", "function utf8init()\n{\n mb_internal_encoding('UTF-8');\n\n // Tell PHP that we'll be outputting UTF-8 to the browser\n mb_http_output('UTF-8');\n\n //$str = json_encode($arr, JSON_UNESCAPED_UNICODE); //这样我们存进去的是就是中文了,那么取出的也就是中文了\n\n}", "function grabUnicodeChar($input) {\n \n $trimmed = trim($input, \"U+\");\n $unicodeChar = \"\\u$trimmed\";\n return json_decode('\"'.$unicodeChar.'\"');\n }", "function win1252_to_utf8($data){\r\n\treturn iconv(\"Windows-1252\", \"UTF-8\", $data);\r\n}", "function rc_utf8_clean($input)\n{\n // handle input of type array\n if (is_array($input)) {\n foreach ($input as $idx => $val)\n $input[$idx] = rc_utf8_clean($val);\n return $input;\n }\n \n if (!is_string($input) || $input == '')\n return $input;\n\n // iconv/mbstring are much faster (especially with long strings)\n if (function_exists('mb_convert_encoding') && ($res = mb_convert_encoding($input, 'UTF-8', 'UTF-8')) !== false)\n return $res;\n\n if (function_exists('iconv') && ($res = @iconv('UTF-8', 'UTF-8//IGNORE', $input)) !== false)\n return $res;\n\n $regexp = '/^('.\n// '[\\x00-\\x7F]'. // UTF8-1\n '|[\\xC2-\\xDF][\\x80-\\xBF]'. // UTF8-2\n '|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]'. // UTF8-3\n '|[\\xE1-\\xEC][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-3\n '|\\xED[\\x80-\\x9F][\\x80-\\xBF]'. // UTF8-3\n '|[\\xEE-\\xEF][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-3\n '|\\xF0[\\x90-\\xBF][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-4\n '|[\\xF1-\\xF3][\\x80-\\xBF][\\x80-\\xBF][\\x80-\\xBF]'.// UTF8-4\n '|\\xF4[\\x80-\\x8F][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-4\n ')$/';\n \n $seq = '';\n $out = '';\n\n for ($i = 0, $len = strlen($input); $i < $len; $i++) {\n $chr = $input[$i];\n $ord = ord($chr);\n // 1-byte character\n if ($ord <= 0x7F) {\n if ($seq)\n $out .= preg_match($regexp, $seq) ? $seq : '';\n $seq = '';\n $out .= $chr;\n // first (or second) byte of multibyte sequence\n } else if ($ord >= 0xC0) {\n if (strlen($seq)>1) {\n\t$out .= preg_match($regexp, $seq) ? $seq : '';\n $seq = '';\n } else if ($seq && ord($seq) < 0xC0) {\n $seq = '';\n }\n $seq .= $chr;\n // next byte of multibyte sequence\n } else if ($seq) {\n $seq .= $chr;\n }\n }\n\n if ($seq)\n $out .= preg_match($regexp, $seq) ? $seq : '';\n\n return $out;\n}", "function utf_32_to_unicode($source) {\n\n\t// mb_string : methode rapide\n\tif (init_mb_string()) {\n\t\t$convmap = array(0x7F, 0xFFFFFF, 0x0, 0xFFFFFF);\n\t\t$source = mb_encode_numericentity($source, $convmap, 'UTF-32LE');\n\t\treturn str_replace(chr(0), '', $source);\n\t}\n\n\t// Sinon methode lente\n\t$texte = '';\n\twhile ($source) {\n\t\t$words = unpack(\"V*\", substr($source, 0, 1024));\n\t\t$source = substr($source, 1024);\n\t\tforeach ($words as $word) {\n\t\t\tif ($word < 128)\n\t\t\t\t$texte .= chr($word);\n\t\t\t// ignorer le BOM - http://www.unicode.org/faq/utf_bom.html\n\t\t\telse if ($word != 65279)\n\t\t\t\t$texte .= '&#'.$word.';';\n\t\t}\n\t}\n\treturn $texte;\n\n}", "function unicode2charset($texte, $charset='AUTO') {\n\tstatic $CHARSET_REVERSE;\n\tstatic $trans = array();\n\t\n\tif ($charset == 'AUTO')\n\t\t$charset = $GLOBALS['meta']['charset'];\n$charset='utf-8';\n\tswitch($charset) {\n\tcase 'utf-8':\n\t\treturn unicode_to_utf_8($texte);\n\t\tbreak;\n\n\tdefault:\n\t\t$charset = load_charset($charset);\n\n\t\tif (!is_array($CHARSET_REVERSE[$charset])) {\n\t\t\t$CHARSET_REVERSE[$charset] = array_flip($GLOBALS['CHARSET'][$charset]);\n\t\t}\n\n\t\tif (!isset($trans[$charset])){\n\t\t\t$trans[$charset]=array();\n\t\t\t$t = &$trans[$charset];\n\t\t\tfor($e=128;$e<255;$e++){\n\t\t\t\t$h = dechex($e);\n\t\t\t\tif ($s = isset($CHARSET_REVERSE[$charset][$e])){\n\t\t\t\t\t$s = $CHARSET_REVERSE[$charset][$e];\n\t\t\t\t\t$t['&#'.$e.';'] = $t['&#0'.$e.';'] = $t['&#00'.$e.';'] = chr($s);\n\t\t\t\t\t$t['&#x'.$h.';'] = $t['&#x0'.$h.';'] = $t['&#x00'.$h.';'] = chr($s);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$t['&#'.$e.';'] = $t['&#0'.$e.';'] = $t['&#00'.$e.';'] = chr($e);\n\t\t\t\t\t$t['&#x'.$h.';'] = $t['&#x0'.$h.';'] = $t['&#x00'.$h.';'] = chr($e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$texte = strtr($texte, $trans[$charset]);\n\t\treturn $texte;\n\t}\n}", "function echo8($txt) {\n\techo $txt;\n\t//echo utf8_decode($txt);\n}", "function win2utf($val,$always=false) { #trace();\r\n global $ezer_mysql_cp;\r\n if ( $always || !$ezer_mysql_cp || $ezer_mysql_cp=='cp1250' ) {\r\n $val= strtr($val, \"\\x9E\\x9A\\x9D\\x8E\\x8A\\x8D\", \"\\xBE\\xB9\\xBB\\xAE\\xA9\\xAB\");\r\n $val= mb_convert_encoding($val,'UTF-8','ISO-8859-2');\r\n }\r\n return $val;\r\n}", "function utf82utf16($utf8)\n {\n // oh please oh please oh please oh please oh please\n if(function_exists('mb_convert_encoding')) {\n return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');\n }\n\n switch(strlen($utf8)) {\n case 1:\n // this case should never be reached, because we are in ASCII range\n // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n return $utf8;\n\n case 2:\n // return a UTF-16 character from a 2-byte UTF-8 char\n // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n return chr(0x07 & (ord($utf8{0}) >> 2))\n . chr((0xC0 & (ord($utf8{0}) << 6))\n | (0x3F & ord($utf8{1})));\n\n case 3:\n // return a UTF-16 character from a 3-byte UTF-8 char\n // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n return chr((0xF0 & (ord($utf8{0}) << 4))\n | (0x0F & (ord($utf8{1}) >> 2)))\n . chr((0xC0 & (ord($utf8{1}) << 6))\n | (0x7F & ord($utf8{2})));\n }\n\n // ignoring UTF-32 for now, sorry\n return '';\n }", "function utf8_encode($data)\n{\n}", "private function iso2ascii($str)\n\t{\n\t\t$tmp = utf8_decode($str);\n\n\t\t$from = utf8_decode(\"ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ\");\n\t\t$to = \"SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy\";\n\n\t\t$tmp = strtr($tmp, $from, $to);\n\n\t\treturn $tmp;\n\t}", "function atk_iconv($in_charset, $out_charset, $str)\n{\n\treturn atkString::iconv($in_charset,$out_charset,$str);\n}", "function translate_raw_string ( $raw ) {\n\t\t$res = $this->bt->translate ( $raw );\n\t\t$res = $this->code_to_utf8( $res );\n\t\t$res = $this->import_utf8_string( $res );\n\t\treturn $res;\n\t}", "public function utf8_Validate($string)\n {\n $output=$string;\n if (!preg_match('!!u', $string)) {\n $output = utf8_encode($string);\n }\n return $output;\n }", "public static function getStringFromUnicodeValue($str, $encoding = null)\n {\n if (is_null($encoding)) {\n $encoding = ini_get('mbstring.internal_encoding');\n }\n\n return preg_replace_callback('/\\\\\\\\u([0-9a-fA-F]{4})/u', function ($match) use ($encoding) {\n return mb_convert_encoding(pack('H*', $match[1]), $encoding, 'UTF-16BE');\n }, $str);\n }", "protected static function utf8ToUtf16le($string) {\n\t\treturn iconv('UTF-8', 'UTF-16LE', $string);\n\t}", "function mb_from_unicode($unicode, $encoding = null)\n{\n $t = '';\n if (!$encoding) {\n $encoding = mb_internal_encoding();\n }\n foreach ((array)$unicode as $utf32be) {\n $character = pack('N*', $utf32be);\n $t .= mb_convert_encoding($character, $encoding, 'UTF-32BE');\n }\n return $t;\n }", "public static function utf8ToEntities($string)\n\t{\n\t\tif (!@preg_match(\"[\\200-\\237]\",$string) && !@preg_match(\"[\\241-\\377]\",$string))\n\t\t\treturn $string;\n\t\t$string = preg_replace(\"/[\\302-\\375]([\\001-\\177])/\",\"&#65533;\\\\1\",$string);\n\t\t$string = preg_replace(\"/[\\340-\\375].([\\001-\\177])/\",\"&#65533;\\\\1\",$string);\n\t\t$string = preg_replace(\"/[\\360-\\375]..([\\001-\\177])/\",\"&#65533;\\\\1\",$string);\n\t\t$string = preg_replace(\"/[\\370-\\375]...([\\001-\\177])/\",\"&#65533;\\\\1\",$string);\n\t\t$string = preg_replace(\"/[\\374-\\375]....([\\001-\\177])/\",\"&#65533;\\\\1\",$string);\n\t\t$string = preg_replace(\"/[\\300-\\301]./\", \"&#65533;\", $string);\n\t\t$string = preg_replace(\"/\\364[\\220-\\277]../\",\"&#65533;\",$string);\n\t\t$string = preg_replace(\"/[\\365-\\367].../\",\"&#65533;\",$string);\n\t\t$string = preg_replace(\"/[\\370-\\373]..../\",\"&#65533;\",$string);\n\t\t$string = preg_replace(\"/[\\374-\\375]...../\",\"&#65533;\",$string);\n\t\t$string = preg_replace(\"/[\\376-\\377]/\",\"&#65533;\",$string);\n\t\t$string = preg_replace(\"/[\\302-\\364]{2,}/\",\"&#65533;\",$string);\n\t\t$string = preg_replace(\n\t\t\t\"/([\\360-\\364])([\\200-\\277])([\\200-\\277])([\\200-\\277])/e\",\n\t\t\t\"'&#'.((ord('\\\\1')&7)<<18 | (ord('\\\\2')&63)<<12 |\".\n\t\t\t\" (ord('\\\\3')&63)<<6 | (ord('\\\\4')&63)).';'\",\n\t\t$string);\n\t\t$string = preg_replace(\"/([\\340-\\357])([\\200-\\277])([\\200-\\277])/e\",\n\t\t\"'&#'.((ord('\\\\1')&15)<<12 | (ord('\\\\2')&63)<<6 | (ord('\\\\3')&63)).';'\",\n\t\t$string);\n\t\t$string = preg_replace(\"/([\\300-\\337])([\\200-\\277])/e\",\n\t\t\"'&#'.((ord('\\\\1')&31)<<6 | (ord('\\\\2')&63)).';'\",\n\t\t$string);\n\t\t$string = preg_replace(\"/[\\200-\\277]/\",\"&#65533;\",$string);\n\t\treturn $string;\n\t}" ]
[ "0.7494896", "0.7246661", "0.72079855", "0.70398", "0.69872063", "0.6983387", "0.69428813", "0.6836229", "0.6804759", "0.6803888", "0.67719656", "0.6766043", "0.67646486", "0.67558694", "0.67498446", "0.6738298", "0.67244214", "0.67189837", "0.671496", "0.664555", "0.66224414", "0.66073716", "0.65809816", "0.6561134", "0.65458506", "0.6537769", "0.65276587", "0.6495973", "0.6488573", "0.64851767", "0.64700675", "0.6427337", "0.6408924", "0.6406913", "0.638407", "0.6378425", "0.634504", "0.6340516", "0.6319547", "0.6315906", "0.6315576", "0.6293821", "0.62916374", "0.62889344", "0.62889344", "0.62885624", "0.62885624", "0.62882817", "0.6286911", "0.6286911", "0.62847924", "0.6279348", "0.6270345", "0.62317455", "0.6222802", "0.6219638", "0.6218652", "0.62166977", "0.6214143", "0.62094736", "0.6198256", "0.61930346", "0.61862355", "0.61798656", "0.61658436", "0.615675", "0.6156584", "0.61497545", "0.61479104", "0.6132901", "0.6132366", "0.6112236", "0.61038464", "0.6091988", "0.6071272", "0.6055119", "0.6028329", "0.60153127", "0.6002684", "0.59855926", "0.59729844", "0.5971098", "0.5962928", "0.5958878", "0.5953071", "0.5949255", "0.592093", "0.59184766", "0.5908271", "0.5881847", "0.5880679", "0.5871766", "0.58321553", "0.58304363", "0.5825712", "0.5824054", "0.5821254", "0.58187246", "0.57873946", "0.57822514" ]
0.7214691
2
Get the real path to a file or folder. Returns false on failure, else the path to the file/folder
function getPath($file, $sub="", $must_be_file = true, $d=false) { if($file == false || empty($file)) return false; $path = realpath('.').DIRECTORY_SEPARATOR.$sub.DIRECTORY_SEPARATOR.$file; if($d) var_dump( $file, $sub, $path ); if($path != false && strpos($path, realpath('.').DIRECTORY_SEPARATOR.$sub) !== false) { if($must_be_file && !is_file($path)) return false; return $path; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFullPath()\r\n\t{\r\n\t\t$path = $this->getValue(\"name\");\r\n\r\n\t\t// We are at the real root\r\n\t\tif (!$this->getValue(\"parent_id\") && $path == '/')\r\n\t\t\treturn $path;\r\n\r\n\t\t// This condition should never happen, but just in case\r\n\t\tif (!$this->getValue(\"parent_id\"))\r\n\t\t\treturn false;\r\n\r\n\t\t$pfolder = CAntObject::factory($this->dbh, \"folder\", $this->getValue(\"parent_id\"), $this->user);\r\n\t\t$pre = $pfolder->getFullPath();\r\n\r\n\t\tif ($pre == \"/\")\r\n\t\t\treturn \"/\" . $path;\r\n\t\telse\r\n\t\t\treturn $pre . \"/\" . $path;\r\n\t}", "function get_real_path(string $path, string|bool $check = null): string|null\n{\n if (trim($path) == '') {\n return null;\n }\n\n // NULL-bytes issue.\n if (str_contains($path, \"\\0\")) {\n $path = str_replace(\"\\0\", \"\\\\0\", $path);\n }\n\n // Validate existence of file/directory or file only.\n static $check_path; $check_path ??= fn($c, $p) => (\n $c === true ? file_exists($p) : ($c === 'file' ? is_file($p) : is_dir($p))\n );\n\n if ($ret = realpath($path)) {\n if ($check && !$check_path($check, $ret)) {\n return null;\n }\n return $ret;\n }\n\n $ret = '';\n $sep = DIRECTORY_SEPARATOR;\n $win = DIRECTORY_SEPARATOR == '\\\\';\n\n // Make path \"foo\" => \"./foo\" so prevent invalid returns.\n if (!str_contains($path, $sep) || ($win && substr($path, 1, 2) != ':\\\\')) {\n $path = '.' . $sep . $path;\n }\n\n foreach (explode($sep, $path) as $i => $cur) {\n if ($i == 0) {\n if ($cur == '~') { // Home path (eg: ~/Desktop).\n $ret = getenv('HOME') ?: '';\n continue;\n } elseif ($cur == '.' || $cur == '..') {\n if ($ret == '') {\n // @cancel\n // $file = getcwd(); // Fallback.\n // foreach (debug_backtrace(0) as $trace) {\n // // Search until finding the right path argument (sadly seems no way else\n // // for that when call stack is chaining from a function to another function).\n // if (empty($trace['args'][0]) || $trace['args'][0] != $path) {\n // break;\n // }\n // $file = $trace['file'];\n // }\n\n $tmp = getcwd() . $sep . basename($path);\n $ret = ($cur == '.') ? dirname($tmp) : dirname(dirname($tmp));\n }\n continue;\n }\n }\n\n if ($cur == '' || $cur == '.') {\n continue;\n } elseif ($cur == '..') {\n $ret = dirname($ret); // Up.\n continue;\n }\n\n // Prepend separator current.\n $ret .= $sep . $cur;\n }\n\n if ($check && !$check_path($check, $ret)) {\n return null;\n }\n\n // Normalize.\n if ($ret) {\n // Drop repeating separators.\n $ret = preg_replace(\n '~(['. preg_quote(PATH_SEPARATOR . DIRECTORY_SEPARATOR) .'])\\1+~',\n '\\1', $ret\n );\n\n // Drop ending slashes.\n if ($ret != PATH_SEPARATOR && $ret != DIRECTORY_SEPARATOR) {\n $ret = chop($ret, PATH_SEPARATOR . DIRECTORY_SEPARATOR);\n }\n\n // Fix leading slash for win.\n if ($win && $ret[0] == $sep) {\n $ret = substr($ret, 1);\n }\n }\n\n return $ret;\n}", "public function getIsAbsolutePath() {}", "protected function get_path()\n {\n $path_found = false;\n $found_path = null;\n foreach ($this->get_paths() as $path) {\n if ($path_found) {\n continue;\n }\n $path = wp_normalize_path($path);\n if (file_exists($path)) {\n $path_found = true;\n $found_path = $path;\n }\n }\n\n return $found_path;\n\n }", "public function getFullPath();", "public function getFullPath(): string;", "function getRealpath( $_path )\n{\n $__path = $_path;\n if ( isRelative( $_path ) ) {\n $__curdir = unifyPath( realpath( \".\" ) . _PL_OS_SEP );\n $__path = $__curdir . $__path;\n }\n $__startPoint = \"\";\n if ( checkCurrentOS( \"Win\" ) ) {\n list( $__startPoint, $__path ) = explode( \":\", $__path, 2 );\n $__startPoint .= \":\";\n }\n # From now processing is the same for WIndows and Unix, and hopefully for others.\n $__realparts = array( );\n $__parts = explode( _PL_OS_SEP, $__path );\n for ( $i = 0; $i < count( $__parts ); $i++ ) {\n if ( strlen( $__parts[ $i ] ) == 0 || $__parts[ $i ] == \".\" ) {\n continue;\n }\n if ( $__parts[ $i ] == \"..\" ) {\n if ( count( $__realparts ) > 0 ) {\n array_pop( $__realparts );\n }\n }\n else {\n array_push( $__realparts, $__parts[ $i ] );\n }\n }\n return $__startPoint . _PL_OS_SEP . implode( _PL_OS_SEP, $__realparts );\n}", "protected function _getPath(): ?string\n {\n property_exists_or_fail($this, ['album_id', 'filename']);\n\n return PHOTOS . $this->get('album_id') . DS . $this->get('filename');\n }", "function cot_pfs_folderpath($folderid, $fullpath='')\n{\n\tglobal $db, $db_pfs_folders, $cfg;\n\n\tif($fullpath==='') $fullpath = $cfg['pfs']['pfsuserfolder'];\n\n\tif($fullpath && $folderid>0)\n\t{\n\t\t// TODO Clean up this mess and fix pff_path\n\t\t$sql = $db->query(\"SELECT pff_path FROM $db_pfs_folders WHERE pff_id=\".(int)$folderid);\n\t\tif($sql->rowCount()==0)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $sql->fetchColumn().'/';\n\t\t}\n\t}\n\telse\n\t{\n\t\treturn '';\n\t}\n}", "function phpbb_realpath($path)\n\t{\n\t\t$realpath = realpath($path);\n\n\t\t// Strangely there are provider not disabling realpath but returning strange values. :o\n\t\t// We at least try to cope with them.\n\t\tif ($realpath === $path || $realpath === false)\n\t\t{\n\t\t\treturn phpbb_own_realpath($path);\n\t\t}\n\n\t\t// Check for DIRECTORY_SEPARATOR at the end (and remove it!)\n\t\tif (substr($realpath, -1) == DIRECTORY_SEPARATOR)\n\t\t{\n\t\t\t$realpath = substr($realpath, 0, -1);\n\t\t}\n\n\t\treturn $realpath;\n\t}", "function phpbb_realpath($path)\n\t{\n\t\t$realpath = realpath($path);\n\n\t\t// Strangely there are provider not disabling realpath but returning strange values. :o\n\t\t// We at least try to cope with them.\n\t\tif ($realpath === $path || $realpath === false)\n\t\t{\n\t\t\treturn phpbb_own_realpath($path);\n\t\t}\n\n\t\t// Check for DIRECTORY_SEPARATOR at the end (and remove it!)\n\t\tif (substr($realpath, -1) == DIRECTORY_SEPARATOR)\n\t\t{\n\t\t\t$realpath = substr($realpath, 0, -1);\n\t\t}\n\n\t\treturn $realpath;\n\t}", "private function getRealPath(string $path): string\n {\n if (false === ($ret = realpath($path))) {\n $this->error(\"File does not exist: \\\"$path\\\".\");\n }\n return $ret;\n }", "public function check_path( $file ) {\n\t\t$relative = parse_url( $file, PHP_URL_PATH );\n\t\t\n\t\tif ( 0 !== strpos( $relative, '/wp-' ) )\n\t\t\t$relative = substr( $relative, strpos( $relative, '/wp-' ) );\n\t\t\n\t\t$full = $_SERVER[ 'DOCUMENT_ROOT' ] . $relative;\n\t\tif ( is_file( $full ) )\n\t\t\treturn $full;\n\n\t\t$wp = rtrim( ABSPATH, '/' ) . $relative;\n\t\tif ( is_file( $wp ) )\n\t\t\treturn $wp;\n\n\t\treturn false;\n\t}", "public function get_path()\n\t\t{\n\t\t\tif ($this->path) {\n\t\t\t\treturn $this->path.'/'.$this->get_full_name();\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t$hash = $this->hash();\n\t\t\t\t} catch(\\System\\Error\\File $e) {\n\t\t\t\t\t$hash = null;\n\t\t\t\t}\n\n\t\t\t\tif ($hash) {\n\t\t\t\t\treturn $this->get_path_hashed();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}", "protected function usingRealPath()\n {\n return $this->hasOption('realpath') && $this->option('realpath');\n }", "protected function getFullPath($name,$options){\n\t\t$name = ltrim($name, DIRECTORY_SEPARATOR);\n\n\t\tif ($folder = trim(ArrayHelper::getValue($options, 'folder'), DIRECTORY_SEPARATOR)) {\n\t\t\t$name = $folder . DIRECTORY_SEPARATOR . $name;\n\t\t}\n\n\t\tif (!ArrayHelper::getValue($options, 'override', true) && $this->fileExists($name)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$path = $this->getBasePath() . DIRECTORY_SEPARATOR . $name;\n\t\t$path = str_replace('/',DIRECTORY_SEPARATOR,$path);\n\n\t\treturn $path;\n\t}", "function fn_check_path($path)\n{\n $real_path = realpath($path);\n\n return str_replace('\\\\', '/', $real_path) == $path ? true : false;\n}", "function get_path($fname, $subdir, $type='image') {\n\t\t$ext = strrchr($fname, '.');\n\t\t$len = strlen($ext);\n\t\tif ($len > 1) {\n\t\t\t$path = $this->imagefolder . $subdir .'/';\n\t\t\tswitch ($type) {\n\t\t\t\tcase 'image':\treturn $path . $fname;\n\t\t\t\tcase 'medium':\treturn $path . substr($fname, 0, -$len) .'_medium'. $ext;\n\t\t\t\tcase 'thumb':\treturn $path . substr($fname, 0, -$len) .'_thumb'. $ext;\n\t\t\t\tcase 'comment':return $path . $fname .'.comment';\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "protected function usingRealPath()\n {\n return $this->input->hasOption('realpath') && $this->option('realpath');\n }", "public function getFullPath()\n {\n $protocol = $this->getProtocol();\n $host = $this->getHost();\n $uri = $this->getUri();\n\n if (!$protocol || !$host || !$uri) {\n return false;\n }\n\n return \"{$protocol}://{$host}{$uri}\";\n }", "abstract protected function getPath();", "abstract function isdir($rempath = '.');", "function __realpath($path) {\n\t$path = str_replace('\\\\','/',realpath($path));\n\tif ($path{1} == ':') {\n\t\t// We can't just check for C:/, because windows users may have the IIS webroot on X: or F:, etc.\n\t\t$path = substr($path,2);\n\t}\n\treturn $path;\n}", "function fn_get_url_path($path)\n{\n $dir = dirname($path);\n\n if ($dir == '.' || $dir == '/') {\n return '';\n }\n\n return (defined('WINDOWS')) ? str_replace('\\\\', '/', $dir) : $dir;\n}", "public function getFullPath(): string\n {\n $store = $this->getStore();\n return $store ? $store->getBaseMediaDir() . '/' . $this->getPath() : '';\n }", "private function _getPath():string {\n\n # Declare result\n $result = self::PATH;\n\n # check constant\n if(Env::has(\"phpunit_test\") && Env::get(\"phpunit_test\"))\n\n # Set result\n $result = self::PATH_TEST;\n\n # Strange reaction... Allow to debug next command... ¯\\_(ツ)_/¯\n Env::get(\"crazyphp_root\");\n\n # Process result\n $result = File::path($result);\n\n # Return result\n return $result;\n\n }", "protected function determinedFullPath()\n {\n // TODO: See why windows cannot use the the full path\n /*return dirname((new ReflectionClass($this))->getFileName()) .\n DIRECTORY_SEPARATOR .\n '..' .\n DIRECTORY_SEPARATOR .*/\n return $this->getWebRoot() .\n DIRECTORY_SEPARATOR .\n $this->path;\n }", "protected abstract function getPath();", "private function getPath()\n {\n $path = $this->getDirName().$this->getFilename();\n if (strlen($this->getMime()->getExt())>0) {\n $path .= '.'.$this->getMime()->getExt();\n }\n return $path;\n }", "public function realPath($relativeFilename) { \n // Check for absolute path \n if (realpath($relativeFilename) == $relativeFilename) return $relativeFilename; \n \n // Otherwise, treat as relative path \n $paths = explode(PATH_SEPARATOR, get_include_path()); \n foreach ($paths as $path) { \n $path = str_replace('\\\\', '/', $path); \n $path = rtrim($path, '/') . '/'; \n $fullpath = realpath($path . $relativeFilename); \n if ($fullpath) return $fullpath; \n } \n \n return false; \n }", "function realPath($path, $relative_to = NULL, $resolve_symlink = TRUE);", "public function hasRelativePath()\n {\n return false;\n }", "public function getPath()\n {\n return $this->_folder . DIRECTORY_SEPARATOR . $this->_name;\n }", "function cot_pfs_filepath($id)\n{\n\tglobal $db, $db_pfs_folders, $db_pfs, $cfg;\n\n\t$sql = $db->query(\"SELECT p.pfs_file AS file, f.pff_path AS path FROM $db_pfs AS p LEFT JOIN $db_pfs_folders AS f ON p.pfs_folderid=f.pff_id WHERE p.pfs_id=\".(int)$id.\" LIMIT 1\");\n\tif($row = $sql->fetch())\n\t{\n\t\treturn ($cfg['pfs']['pfsuserfolder'] && $row['path']!='') ? $row['path'].'/'.$row['file'] : $row['file'];\n\t}\n\telse\n\t{\n\t\treturn '';\n\t}\n}", "public function getFoundPath() {}", "public function path(): string\n {\n return realpath($this->file);\n }", "public function getPath(): string\n {\n return $this->directory->getPath();\n }", "function dirPath() { return (\"../\"); }", "function dirPath () { return (\"../../\"); }", "public function getRealPath()\n\t{\n\t\t// Unfortunately we'd need to store the fake directory hierarchy\n\t\t// in the database, too...\n\t\tthrow new DatabaseFileException('Obtaining the real path is not supported for database files.');\n\t}", "public function getPath()\n {\n return $this->directory->getRealPath();\n }", "public function getPath()\n {\n return str_replace(\n ['/', '\\\\'],\n Storage::GetSeparator(),\n Storage::GetPath() . '/' . $this->dirname . '/' . $this->basename\n );\n }", "public function getFullPath(): string\n {\n return $this->getRoot() . $this->getPathExt();\n }", "public function getAbsolutePathOfRelativeReferencedFileOrPathResolvesFileCorrectlyDataProvider() {}", "public function getPath()\r\n {\r\n return pathinfo($this->filename, PATHINFO_DIRNAME);\r\n }", "public function getPathToFile(): string;", "function folder_exist($folder)\n{\n // Get canonicalized absolute pathname\n $path = realpath($folder);\n\n // If it exist, check if it's a directory\n return ($path !== false AND is_dir($path)) ? $path : false;\n}", "function getPath() {\n $ruta = realpath(dirname(__FILE__));\n if ( strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' )\n $separator = '\\\\';\n else\n $separator = '/';\n $aRuta = explode($separator,$ruta);\n $ruta = '';\n foreach($aRuta as $index => $value)\n if ( $index < count($aRuta) - 1 ) $ruta .= $value.$separator;\n return $ruta;\n}", "function truepath($path){\n $unipath=strlen($path)==0 || $path[0]!='/';\n // attempts to detect if path is relative in which case, add cwd\n if(strpos($path,':')===false && $unipath)\n $path=getcwd().DIRECTORY_SEPARATOR.$path;\n // resolve path parts (single dot, double dot and double delimiters)\n $path = str_replace(array('/', '\\\\'), DIRECTORY_SEPARATOR, $path);\n $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');\n $absolutes = array();\n foreach ($parts as $part) {\n if ('.' == $part) continue;\n if ('..' == $part) {\n array_pop($absolutes);\n } else {\n $absolutes[] = $part;\n }\n }\n $path=implode(DIRECTORY_SEPARATOR, $absolutes);\n // resolve any symlinks\n if(file_exists($path) && linkinfo($path)>0)$path=readlink($path);\n // put initial separator that could have been lost\n $path=!$unipath ? '/'.$path : $path;\n return $path;\n}", "public function getFilepath()\n {\n $filepath = $this->_path['dirname'].DIRECTORY_SEPARATOR.$this->_path['filename'];\n\n if ($this->_path['extension'])\n $filepath .= '.'.$this->_path['extension'];\n\n return $filepath;\n }", "public function getRelativePath(bool $force = false): string\n {\n\t\treturn $this->filesystemFolder->getRelativePath($force);\n\t}", "function us_getdirname($file_phy_fullpath){\r\n\tif(strpos($file_phy_fullpath,'\\\\')!==false){\r\n\t\treturn substr($file_phy_fullpath,0,strrpos($file_phy_fullpath,'\\\\'));\r\n\t}elseif(strpos($file_phy_fullpath,'/')!==false){\r\n\t\treturn substr($file_phy_fullpath,0,strrpos($file_phy_fullpath,'/'));\r\n\t}else{\r\n\t\treturn '/';\r\n\t}\r\n}", "function getPath(): string;", "function folder_exist($folder)\n {\n $path = realpath($folder);\n\n // If it exist, check if it's a directory\n return ($path !== false AND is_dir($path)) ? $path : false;\n}", "static public function getFilePath($file, $base_path = null)\n {\n // If this is already a correct path, return it\n if (@is_file($file) && @is_readable($file)) {\n return realpath($file);\n }\n\n // Determine the application path\n $app = JRequest::getInt('app', JFactory::getApplication()->getClientId());\n if ($app == 1) {\n $app_path = JPATH_ADMINISTRATOR;\n } else {\n $app_path = JPATH_SITE;\n }\n\n // Make sure the basepath is not a file\n if (@is_file($base_path)) {\n $base_path = dirname($base_path);\n }\n\n // Determine the basepath\n if (empty($base_path)) {\n if (substr($file, 0, 1) == '/') {\n $base_path = JPATH_SITE;\n } else {\n $base_path = $app_path;\n }\n }\n\n // Append the base_path\n if (strstr($file, $base_path) == false && !empty($base_path)) {\n $file = $base_path.'/'.$file;\n }\n\n // Detect the right application-path\n if (JFactory::getApplication()->isAdmin()) {\n if (strstr($file, JPATH_ADMINISTRATOR) == false && @is_file(JPATH_ADMINISTRATOR.'/'.$file)) {\n $file = JPATH_ADMINISTRATOR.'/'.$file;\n } else if (strstr($file, JPATH_SITE) == false && @is_file(JPATH_SITE.'/'.$file)) {\n $file = JPATH_SITE.'/'.$file;\n }\n } else {\n if (strstr($file, JPATH_SITE) == false && @is_file(JPATH_SITE.'/'.$file)) {\n $file = JPATH_SITE.'/'.$file;\n }\n }\n\n // If this is not a file, return empty\n if (@is_file($file) == false || @is_readable($file) == false) {\n return null;\n }\n\n // Return the file\n return realpath($file);\n }", "private function realpath(string $path): string\n {\n $last_char = substr($path, -1);\n $path = realpath($path);\n if (DIRECTORY_SEPARATOR === $last_char) {\n $path .= DIRECTORY_SEPARATOR;\n }\n return $path;\n }", "protected function usingRealPath()\n {\n return CommandManager::getInstance()->getOpt('realpath', false);\n }", "public static function fullPath ($relPath) {\n\t\treturn (\\realpath($relPath) ?: null);\n\t}", "function getAbsolutePath() ;", "function isAbsPath($path) {\r\n if (preg_match('|^[\\\\\\/]|', $path)) { return true; } // leading slash or backslash (for windows)\r\n if (preg_match('|^[a-zA-Z]:[\\\\\\/]|', $path)) { return true; } // windows drive\r\n if (preg_match('|^\\\\\\\\[a-zA-Z]|', $path)) { return true; } // unc path\r\n return false;\r\n}", "public function getPath($file, $local = false)\n {\n return $this->getPathInfo($file, $local ? 'localpath' : 'pathname') ?: false;\n }", "public static function getPath($ip)\n {\n if (!self::checkIpAddress($ip)) {\n return false;\n }\n $ret = Config::get('share_dir').'/'.$ip;\n if (!is_dir($ret) || !is_writable($ret)) {\n return false;\n }\n\n return $ret;\n }", "public function getIsFile() {\n\t\t$fullName = $this->getPath();\n\t\treturn is_file($fullName);\n\t}", "public function getLocalPath()\r\n\t{\r\n\t\t$accountNumber = $this->getAccountNumber();\r\n\r\n\t\t$file_dir = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t$file_dir2 = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t\r\n\t\tif ($this->owner_id!=null)\r\n\t\t{\r\n\t\t\t$file_dir .= \"/\".$this->owner_id;\r\n\t\t\t$file_dir2 .= \"/\".$this->owner_id;\r\n\t\t}\r\n\r\n\t\tif (!file_exists($file_dir.\"/\".$this->name_lcl))\r\n\t\t{\r\n\t\t\tif (file_exists($file_dir2.\"/\".$this->name_lcl))\r\n\t\t\t\t$file_dir = $file_dir2;\r\n\t\t}\r\n\r\n\t\t$file_dir .= \"/\".$this->name_lcl;\r\n\r\n\t\treturn $file_dir;\r\n\t}", "public function getFullPath($name);", "private function getRealPath($destFileName) \r\n {\r\n return strpos($destFileName, Path::DirectorySeparatorChar) === false ? $this->directoryName() . Path::DirectorySeparatorChar . $destFileName : $destFileName;\r\n }", "function dirPath() {return (\"../../../../\"); }", "protected function getRealPath($path)\n {\n return realpath($path);\n }", "protected function getFilesystemPath()\n {\n return dirname($this->path);\n }", "public function getAssetPath()\n {\n $url_frags = parse_url($_SERVER['REQUEST_URI']);\n \n if (!array_key_exists('path', $url_frags)) {\n return false;\n }\n\n $file_name = basename($url_frags['path']);\n \n if (!preg_match('/^(.+)\\.([a-z]+)$/', $file_name)) {\n return false;\n }\n\n // this is the path after the common path prefix\n $path_everything_after = substr(\n $url_frags['path'],\n strpos($url_frags['path'], $this->common_path_prefix)\n );\n\n $file_name = $this->actual_path.'/'.$path_everything_after;\n if (file_exists($file_name)) {\n return $file_name;\n }\n return false;\n }", "function realpath($path)\n{\n return $path;\n}", "protected function getImgSavedRelativePath($name)\n {\n list($imgName, $imgType) = explode('.', $name);\n if (!$imgName || !$imgType) {\n throw new InvalidValueException('image file name and type is not correct');\n }\n if (strlen($imgName) < 2) {\n $imgName .= time(). mt_rand(100, 999);\n }\n $first_str = substr($imgName, 0, 1);\n $two_str = substr($imgName, 1, 2);\n\n $imgSaveFloder = CDir::createFloder($this->GetCurrentBaseImgDir(), [$first_str, $two_str]);\n if ($imgSaveFloder) {\n $imgName = $this->getUniqueImgNameInPath($imgSaveFloder, $imgName, $imgType);\n $relative_floder = '/'.$first_str.'/'.$two_str.'/';\n\n return $relative_floder.$imgName;\n }\n\n return false;\n }", "public static function detectPath(): string\n {\n $oReflect = new \\ReflectionClass(get_called_class());\n return dirname($oReflect->getFileName()) . '/';\n }", "public function getPath(string $name): string\n {\n $path = '';\n switch ($name) {\n case 'WebRoot':\n $path = $this->getWebRoot();\n break; // redundant, but for convenience\n case 'Db':\n $path = $this->dbPath;\n break;\n case 'Img':\n $path = $this->pathImg;\n break;\n case 'ImgOriginal':\n $path = $this->folderImageOriginal;\n }\n\n return $path; // pdo functions need full path to work with subfolders on windows\n }", "abstract public function directoryLocation();", "function fn_get_http_files_dir_path()\n{\n $path = fn_get_rel_dir(fn_get_files_dir_path());\n $path = Registry::get('config.http_location') . '/' . $path;\n\n return $path;\n}", "public function getFilepath();", "public static function getMediaPath()\n {\n $mediaDir = Config::get('media.media_dir');\n $mediaFullPath = ROOT . self::getFilesPath() . $mediaDir;\n\n if(!file_exists($mediaFullPath))\n {\n if(!is_writable(ROOT . self::getFilesPath()) || !mkdir($mediaFullPath, Config::get('media.dir_chmod'), true))\n return false;\n }\n\n return $mediaDir;\n }", "public static function getLocalPath($id)\n {\n $file = static::data($id);\n $path = Configure::read('FileApi.basePath') . $file->category . DS . $file->tag . DS . $file->filename;\n\n return file_exists($path) ? $path : false;\n }", "protected abstract function getAbsolutePath(): string;", "public function getDirectoryRelativePath(): string\n {\n return $this->config->getValue('general/file/import_images_base_dir');\n }", "function phpbb_realpath($path)\n\t{\n\t\treturn phpbb_own_realpath($path);\n\t}", "function phpbb_realpath($path)\n\t{\n\t\treturn phpbb_own_realpath($path);\n\t}", "protected function getCurrentAbsolutePath() \n\t{\n\t\t$filename = self::$test_class_manifest->getItemPath(get_parent_class($this));\n\t\tif(!$filename) throw new LogicException(\"getItemPath returned null for \" . get_parent_class($this));\n\t\treturn dirname($filename);\n\t}", "public static function getPathOfAlias($alias)\n {\n\n if(isset(self::$_aliases[$alias]))\n\n return self::$_aliases[$alias];\n else if(($pos=strpos($alias,'.'))!==false)\n {\n $rootAlias=substr($alias,0,$pos);\n if(isset(self::$_aliases[$rootAlias])) {\n return self::$_aliases[$alias]=rtrim(self::$_aliases[$rootAlias].DIRECTORY_SEPARATOR.str_replace('.',DIRECTORY_SEPARATOR,substr($alias,$pos+1)),'*'.DIRECTORY_SEPARATOR);\n }\n }\n return false;\n }", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function realpath($file);", "public static function getImageRelativePath() {\n // Get the paths to the client helper folder and php file folder as an array of tokens.\n $clientHelperFolder = explode(DIRECTORY_SEPARATOR, dirname(realpath(__FILE__)));\n $imageFolder = explode(DIRECTORY_SEPARATOR, realpath(self::getInterimImageFolder('fullpath')));\n // Find the first part of the paths that is not the same.\n for ($i = 0; $i < min(count($clientHelperFolder), count($imageFolder)); $i++) {\n if ($imageFolder[$i] !== $clientHelperFolder[$i]) {\n break;\n }\n }\n // Step back up the path to the point where the 2 paths differ.\n $path = str_repeat('../', count($clientHelperFolder) - $i);\n // Add back in the different part of the path to the client helper folder.\n for ($j = $i; $j < count($imageFolder); $j++) {\n $path .= $imageFolder[$j] . '/';\n }\n return $path;\n }", "protected function fullPath()\n {\n\n if ( $this->is_external )\n {\n if ( $this->path )\n {\n $ph = '/' . $this->path;\n } else {\n $ph = null;\n }\n\n return $this->external_url . $ph;\n } else {\n\n // switch the disk\n switch ( $this->disk )\n {\n case 'local':\n\n return Config::get('app.url') . '/' . $this->path;\n break;\n\n case 's3':\n return Config::get('photos.storage_path') . '/' . $this->path;\n break;\n }\n }\n }", "function folder_exist($folder){\n $path = realpath($folder);\n\n // If it exist, check if it's a directory\n return ($path !== false AND is_dir($path)) ? $path : false;\n }", "protected function getFileRealPath($filePath)\n {\n if ($this->isSupportedStreamWrapper($filePath)) {\n return $filePath;\n }\n\n // Need to use realpath to fix \"Can't open file\" on some Windows setup\n return \\realpath($filePath);\n }", "public function isFolder();", "public function getFullPath()\n\t{\n\t\treturn Generic::getCompletePath($this->getPath(), $this->getBasename());\n\t}" ]
[ "0.7077999", "0.690316", "0.6666453", "0.66299057", "0.6480304", "0.6462359", "0.6390644", "0.63531834", "0.63197935", "0.62910694", "0.62910694", "0.6218685", "0.6216907", "0.6214255", "0.61736244", "0.6173524", "0.61425614", "0.6136511", "0.6134452", "0.6127476", "0.6112267", "0.6087171", "0.60732484", "0.60417694", "0.6040637", "0.6022571", "0.60140544", "0.60089517", "0.6008088", "0.5997034", "0.5954174", "0.5936078", "0.5935997", "0.5922951", "0.5917923", "0.59122175", "0.5907981", "0.59073496", "0.59003174", "0.5886657", "0.5885785", "0.58854514", "0.5881835", "0.58794814", "0.58742976", "0.58707225", "0.58660465", "0.58608", "0.58570313", "0.5855853", "0.5851731", "0.5850434", "0.5849053", "0.5830099", "0.5827639", "0.582753", "0.58178663", "0.5816029", "0.5815104", "0.58033824", "0.58030087", "0.5796516", "0.578534", "0.5773368", "0.57710034", "0.57651263", "0.5752861", "0.57499194", "0.5748284", "0.5740628", "0.57306284", "0.5729367", "0.57289606", "0.57272285", "0.5725826", "0.5716978", "0.57165927", "0.5714415", "0.5710013", "0.5708164", "0.5701379", "0.57010525", "0.57010525", "0.5698597", "0.5694562", "0.5691291", "0.5691291", "0.5691291", "0.5691291", "0.5691291", "0.5691291", "0.5691291", "0.5691291", "0.568682", "0.56857806", "0.5680284", "0.5679495", "0.56794876", "0.5675811", "0.5670973" ]
0.68468136
2
This function takes an error code and redirects it to an errorpage
function errorPage($error){ switch($error){ case 401: header('HTTP/1.1 401 Unauthorized'); break; case 403: header('HTTP/1.1 403 Forbidden');; break; case 404: header('HTTP/1.1 404 Not Found'); break; } global $Controller; if($p = $Controller->alias('error_'.$error)) { internalRedirect($p); } else { //@ob_end_clean(); print($error); } die(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function redirect_error($code, $url = null) {\n\n global $CFG;\n\n // Set the redirect URL if it wasn't specified as a parameter\n if (!$url) {\n $url = $CFG->wwwroot;\n }\n\n // URL encode parameters to error page\n $code = urlencode($code);\n $url = urlencode($url);\n\n // Redirect user to error page with encoded parameters\n redirect($CFG->wwwroot . \"/blocks/courseprefs/error.php?error=$code\" .\n ($url ? \"&url=$url\" : ''));\n}", "protected function _redirectToError()\n {\n $this->_redirect(self::ZIPMONEY_ERROR_ROUTE);\n }", "public function actionError()\n\t{\n\t\tif($error = Yii::app()->errorHandler->error)\n\t\t{\n if($error['code']==404)\n\t\t\t$this->render('pages/404');\n else\n $this->redirect('/');\n\t\t}\n\t}", "function customError($errno, $errstr)\n {\n $_SESSION['err_msg'] = \"<b>Error:</b> [$errno] $errstr<br />\"; \n header(\"location: ../_php_fail.php\");\n die();\n }", "public static function renderErrorPage(): void\n {\n\t\tob_start();\n\t\theader('Location: /page/error');\n\t\tob_end_flush();\n }", "public static function error404(){\n \t\t// header(\"Status: 404 Not Found\");\n \t\theader('Location: /');\n }", "public function runError() {\n\t\t\t$this->setSession('sError', $this->getError());\n\n\t\t\t// Set the router\n\t\t\tredirect(\n\t\t\t\t$this->getUrl(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'sRouter' => 'error', \n\t\t\t\t\t\t'sController' => 'index'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}", "function error(string $code): string\n{\n header('HTTP/1.0 404 Not Found');\n $fileName = $code . '.view.php';\n $path = ERROR_VIEWS_PATH . $fileName;\n return getContent($path);\n}", "function errorPageHTTP ($i_code) {\n\t//send the error code to the browser\n\theader (' ', true, $i_code);\n\t//generate the error page\n\t$html = templatePage (\n\t\treMarkable (template_load (\"errors/$i_code.rem\")), $i_code,\n\t\ttemplateHeader (), templateFooter (\".system/design/templates/errors/$i_code\")\n\t);\n\t//cache it\n\tfile_put_contents (APP_CACHE.\"$i_code.html\", $html, LOCK_EX) or errorPage (\n\t\t'denied_cache.rem', 'Error: Permission Denied', array ('PATH' => APP_CACHE)\n\t);\n\t//display it\n\tdie ($html);\n}", "function error($params = array()) {\n header('location: /');\n }", "function myErrorHandler()\n{\n header(\"Location: ../\");\n}", "function error_page($msg, $redirect_to = \"\", $redirect_time = 0)\n{\n page_header($redirect_to, $redirect_time);\n echo ' <div class=\"error\">'.$msg.'</div>';\n page_footer();\n exit;\n}", "public function errorAction() {\n\t\tZend_Layout::getMvcInstance ()->setLayout ( \"light\" );\n\t\t$errors = $this->_getParam ( 'error_handler' );\n\t\tif ($errors->exception->getCode () == 404 || in_array ( $errors->type, array (\n\t\t\t\tZend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE,\n\t\t\t\tZend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER,\n\t\t\t\tZend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION \n\t\t) )) {\n\t\t\t$this->getResponse ()->setHttpResponseCode ( 404 );\n\t\t\t$this->_helper->viewRenderer ( '404' );\n\t\t}\n\t\t\n\t\t\n\t\t$this->view->content = $errors->exception->getMessage ();\n\t}", "public function errorAction()\n {\n $code = $this->_request->getParam('errorCode');\n $this->view->errorCode = $code;\n $this->getResponse()->setRawHeader('HTTP/1.1 500 Internal Server Error');\n }", "private function getErrorPage($url){\r\n header(\"HTTP/1.0 404 Not Found\");\r\n die(strtoupper(\"error 404 $url not found\"));\r\n }", "private function redirect_to_error_page($message = array())\n\t{\n\t\t// redirect to error page\n\t\t\\Session::set_flash('error', $message);\n\t\t\\Response::redirect('admin/error');\n\t}", "function errorPage($msg) {\n header(\"Status: 404 Not Found\");\n die('404: ' . $msg);\n}", "public function errorAction()\n {\n // get the view vars\n $site = $this->view->site;\n $errors = $this->view->errors;\n $loginUser = $this->view->loginUser;\n\n // set the input params\n $optionalParams = array(\n 'errorCode',\n );\n\n $input = $this->processInput( null, $optionalParams, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n if ( !$this->view->ajax ) {\n $homeUrl = $site->getUrl( 'home' );\n return $this->_redirect( $homeUrl );\n }\n\n return $this->renderPage( 'authError' );\n }", "function errorHandler($message, $code){\n echo '{\"errors\":\"'.$message.'\"}';\n http_response_code($code);\n return false;\n }", "function throw_user_error($error_code, $error_text) {\n http_response_code($error_code);\n echo $error_text;\n exit;\n}", "function error( $error, $code = '500' ) {\n\t \n\t if ( is_object( $error ) && method_exists( $error, 'get_message' ) ) {\n\t $error = $error->get_message();\n\t }\n\t\n\t\thttp_response_code( $code );\n\t\tdie( $error );\n\t\treturn false;\n\n\t}", "public static function errorCode($code)\n {\n http_response_code($code);\n $path = 'application/views/errors/' . $code . '.php';\n if (file_exists($path)) {\n require $path;\n }\n exit;\n }", "public function showErrorPage(int $code = self::ERROR_CODE_500_INTERNAL_ERROR)\n {\n http_response_code($code);\n $message = array_key_exists($code, self::ERROR_CODE_MESSAGES) ? self::ERROR_CODE_MESSAGES[$code] : '';\n\n $template = $this->getErrorTemplate($code);\n if ($template) {\n $latte = $this->createLatteEngine();\n $latte->render($template, [ 'code' => $code, 'message' => $message ]);\n } else {\n header('Content-Type: text/plain');\n echo \"HTTP Response: $code $message\";\n }\n exit;\n }", "public function errorPage($title, $code)\n {\n $layout = View::make('layouts.article');\n $layout->title = $title;\n $layout->content = View::make('errors.' . $code);\n return Response::make($layout, $code);\n }", "public function index() {\n header('Location: ' . URLROOT . '/errors/page_not_found');\n }", "public function client_error($status_code = 404)\n {\n $data = array('status_code' => $status_code);\n\n view('error/client_error', $data);\n }", "public function actionError() {\n\t if($error=app()->errorHandler->error) {\t\t\n\t \tif(app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse {\n\t\t\t\t$row = Pagecontent::model()->getPageContent('pagenotfound'); // get the page content for the page\n\t\t\t\tif ($row) { // row is found (page has contents) so we are rending the default view\n\t\t\t\t\t$row['html_title'] .= (!empty($row['html_title']) ? ' ' : '') . ' (' . $error['code'] . ')';\n\t\t\t\t\t$this->setPageAttributes($row);\t\t\n\t\t\t\t\t$this->render('default',array ('row'=>$row));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$this->render('error', $error); // execute the error view file \t \t\n\t\t\t}\n\t }\n\t}", "function errorPage(string $title, string $message, int $code, string $template = null)\n{\n $data = [];\n // page information\n $data['code'] = $code;\n $data['title'] = $title;\n $data['message'] = $message;\n // the default template\n $render = 'error.twig';\n // template from the env file\n if (Env::has('ERROR_PAGE')) {\n $render = Env::get('ERROR_PAGE');\n }\n // custom template\n if (isset($template)) {\n $render = $template;\n }\n // check if the file exists\n if (!file_exists(VIEWS_DIR . 'renders' . DS . $render)) {\n throw new Exception(\"ERROR PAGE '{$render}' NOT EXISTS \");\n }\n // display the page\n view($render, $data, $code);\n}", "protected static function error($code, $message) {\n\t\theader('Content-Type: text/html', true, $code);\n\t\theader('Content-Length: ' . strlen($message));\n\n\t\techo $message;\n\t}", "public function errorAction()\n {\n $errors = $this->_getParam('error_handler');\n\n switch ($errors->type) {\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\n\n // 404 error -- controller or action not found\n $this->getResponse()->setHttpResponseCode(404);\n $this->view->message = 'Page not found';\n break;\n default:\n // Generic application error\n $this->getResponse()->setHttpResponseCode(500);\n $this->view->message = 'Application error';\n break;\n }\n\n $this->view->exception = $errors->exception;\n $this->view->request = $errors->request;\n $this->_response->clearBody();\n }", "function HTTPFailWithCode($code,$message)\n{\n\theader(reasonForCode($code));\n\texit($message);\n}", "protected function error($action = __MISSING_ACTION__) {\n\t\theader(\"Location: /error.php?Action=\".$action);\t\n\t}", "public function error(array $options = []){\n\n\t\theader('Location: /home/show');\n\t\tdie();\n\n\t}", "public static function error_response() {\r\n header(\"HTTP/1.1 404 Recurso no encontrado\");\r\n exit();\r\n }", "function died($error) \n\t\t{\n\t\t\theader('Location:http://localhost:8888/Port2013/?content=contact');\n\t\t\texit();\n\t\t}", "public function errorAction(Application $app, $code)\n {\n \t\t$applicationrepository = new DatabaseTableRepository('User', ' users');\n\t\t \t$users = $applicationrepository->getAll();\n\n // default - assume a 404 error\n $argsArray = [\n\n \t\t'users' => $users,\n\n ];\n $templateName = 'error404';\n\n\n if (404 != $code){\n $argsArray = [\n 'message' => 'sorry - an unknow error occurred'\n ];\n $templateName = 'error';\n }\n\n return $app['twig']->render($templateName . '.html.twig', $argsArray);\n }", "function error_redirect($message)\n{\n global $_PAGE;\n\n header(\"Location: /post.php?error_message=\". urlencode($message));\n\n $_PAGE['content'] = \"<p>Post failed. You are being redirected.</p>\";\n\n require('template.php');\n die();\n}", "public function errorAction()\n {\n $this->_logger->debug(__('Calling errorAction'));\n try {\n $this->loadLayout()\n ->_initLayoutMessages('checkout/session')\n ->_initLayoutMessages('catalog/session')\n ->_initLayoutMessages('customer/session');\n $this->renderLayout();\n $this->_logger->info(__('Successful to redirect to error page.'));\n } catch (\\Exception $e) {\n $this->_logger->error(json_encode($this->getRequest()->getParams()));\n $this->_getCheckoutSession()->addError(__('An error occurred during redirecting to error page.'));\n }\n }", "public function errorAction() {\n $errors = $this->_getParam(\"error_handler\");\n \n // assegno i valori alla view\n $this->viewInit();\n switch ($errors->type) {\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\n // 404 error -- controller or action not found \n $this->getResponse()->setRawHeader(\"HTTP/1.1 404 Not Found\");\n $this->view->title = \"HTTP/1.1 404 Not Found\";\n break;\n default:\n // application error; display error page, but don't change \n // status code\n $this->view->title = \"Application Error\";\n break;\n }\n $this->view->message = $errors->exception;\n }", "public static function ErrorPage404()\n {\n header('HTTP/1.1 404 Not Found');\n header(\"Status: 404 Not Found\");\n header('Location: '.$_SERVER['HTTP_HOST'].'404');\n }", "public function redirect404(){\n\n\t\t$this->page = new PageGenerator($this->app);\n\t\t$this->page->setContentFile(__DIR__ . '/../Errors/404');\n\t\t\n\t\t$this->addHeader('HTTP/1.0 404 Not Found');\n\t\t\n\t\t$this->send();\n\t\t\n\t}", "function error404() {\n\t$protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0');\n\t$code='404';\n\t$text='Not Found';\n\theader($protocol . ' ' . $code . ' ' . $text);\n\t//header(\"Status: 404 Not Found\");\n\t//http_response_code(404);\n\techo \"<h1>404 Page Does Not Exist</h1>\";\n}", "function died($error) {\n header('location: index.html?status=error');\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n \n echo \"These errors appear below.<br /><br />\";\n \n echo $error.\"<br /><br />\";\n \n echo \"Please go back and fix these errors.<br /><br />\";\n \n \n \n die();\n \n }", "public function err_page()\n {\n $site = new SiteContainer($this->db);\n\n $site->printHeader();\n $site->printNav();\n echo \"An Error has occured and your request could not be completed. Return <a href=\\\"index.php\\\">Home</a>\";\n $site->printFooter();\n }", "public static function error404()\r\n\t{\r\n\t\theader(\"HTTP/1.1 404 Not Found\");\r\n\t\theader(\"Status: 404 Not Found\");\r\n\t\texit();\r\n\t}", "public function errorcode();", "public function actionError()\n {\n if(Core::getLoggedUserID() > 0)\n {\n\t \t $exception = Yii::$app->errorHandler->exception;\n\t \t $error = array('statusCode' => $exception->statusCode, 'message' => $exception->getMessage(), 'name' => $exception->getName());\n \t\t return $this->render('/error', ['error' => $error]);\n }\n else\n {\n\t \t\treturn Yii::$app->getResponse()->redirect(Yii::$app->getHomeUrl().'admin')->send();\n }\n }", "public static function sendError($status_code,$message=null) {\n\t\thttp_response_code($status_code);\n\t\techo $message;\n\t}", "static function error( $code, $desc ) {\n\t\t$codes = array();\n\t\t$codes[400] = 'Bad Request';\n\t\t$codes[401] = 'Unauthorized';\n\t\t$codes[403] = 'Forbidden';\n\t\t$codes[404] = 'Not Found';\n\t\t$codes[405] = 'Method Not Allowed';\n\t\t$codes[406] = 'Not Acceptable';\n\t\t$codes[501] = 'Not Implemented';\n\t\t$codes[503] = 'Service unavailable';\n\t\t\n\t\theader('Content-Type: text/html');\n\t\theader( 'HTTP/1.1 '. $code . ' '. @$codes[$code] );\n\t\tdie( $desc );\n\t}", "public function errorAction()\r\n {\r\n $errors = $this->_getParam('error_handler');\r\n $messages = array();\r\n\r\n switch ((string)$errors->type) {\r\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\r\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\r\n // 404 error -- controller or action not found\r\n $this->getResponse()->setRawHeader('HTTP/1.1 404 Not Found');\r\n\r\n $messages[] = Zoo::_(\"The page you requested was not found.\");\r\n if (ZfApplication::getEnvironment() == \"development\" || ZfApplication::getEnvironment() == \"staging\") {\r\n $messages[] = $errors->exception->getMessage();\r\n }\r\n break;\r\n\r\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_OTHER:\r\n case 0:\r\n // application error\r\n //$messages[] = Zoo::_(\"An unexpected error occurred with your request. Please try again later.\");\r\n $messages[] = $errors->exception->getMessage();\r\n if (ZfApplication::getEnvironment() == \"development\" || ZfApplication::getEnvironment() == \"staging\") {\r\n $trace = $errors->exception->getTrace();\r\n foreach (array_keys($trace) as $i) {\r\n if ($trace[$i]['args']) {\r\n foreach ($trace[$i]['args'] as $index => $arg) {\r\n if (is_object($arg)) {\r\n $trace[$i]['args'][$index] = get_class($arg);\r\n }\r\n elseif (is_array($arg)) {\r\n $trace[$i]['args'][$index] = \"array\";\r\n }\r\n }\r\n }\r\n $trace[$i]['file_short'] = \"..\".substr($trace[$i]['file'], strrpos(str_replace(\"\\\\\", DIRECTORY_SEPARATOR, $trace[$i]['file']), DIRECTORY_SEPARATOR));\r\n }\r\n $this->view->assign('trace', $trace);\r\n }\r\n break;\r\n\r\n default:\r\n // application error\r\n $this->getResponse()->setRawHeader('HTTP/1.1 '.$errors->type);\r\n $messages[] = $errors->exception->getMessage();\r\n break;\r\n }\r\n\r\n // Clear previous content\r\n $this->getResponse()->clearBody();\r\n\r\n $this->view->assign('errormessages', $messages);\r\n }", "public static function sendHttpError($errorCode, $htmlContent='') {\n if ($errorCode == 404) {\n header(\"HTTP/1.0 404 Not Found\");\n echo $htmlContent;\n exit;\n }\n }", "public static function sendHttpError($errorCode, $htmlContent='') {\n // Error 404\n if ($errorCode == 404) {\n // Sending specific error status 404 HTTP\n header(\"HTTP/1.0 404 Not Found\");\n echo $htmlContent;\n exit;\n }\n }", "public function renderPageError($code = null, $message = '') {\n if ($this->isAjax()) {\n $this->jsonResponse($code, $message);\n }\n # return homeurl if app is not inited\n if (Yii::$app->controller === null) {\n $this->redirect(HOST_PUBLIC);\n }\n// $this->layout = \"@app/modules/candidate/views/layouts/main\";\n if (preg_match('/backend/', Yii::getAlias('@app'))) {\n $this->layout = \"@app/views/layouts/main\";\n }\n # set pagetitle\n if ($this->getParam('swtohome')) {\n $this->redirect(Yii::$app->homeUrl);\n app()->end();\n }\n echo parent::render('@common/views/error_handel', array('code' => $code, 'message' => $message));\n app()->end();\n }", "function error($code, $desc) {\r\n header($_SERVER['SERVER_PROTOCOL'] . ' ' . $code);\r\n if(strtoupper($_SERVER['REQUEST_METHOD']) != 'HEAD') {\r\n echo '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'.\"\\n\";\r\n echo '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">'.\"\\n\";\r\n echo '<html xml:lang=\"en\" lang=\"en\">';\r\n echo '<head><title>' . $code . '</title></head><body><h1>' . $code . '</h1><p>' . $desc . '</p></body></html>';\r\n }\r\n exit;\r\n }", "public static function showError($msg)\n {\n// $template->init(\"errorpage\", array(\"errormsg\"=>$msg));\n header('HTTP/1.1 404 Not Found');\n header(\"status: 404 Not Found\");\n include '404.php';die();\n// $template->outPut();\n }", "public function error($status = '') {\n\n switch ($status) {\n case '404':\n return $this->render('views:errors/404.php', ['mp' => $this->mp]);\n break;\n }\n\n }", "function errorPage ($s_template, $s_title, $a_data=array ()) {\n\t//template the error, swapping custom replacement fields\n\tdie (templatePage (\n\t\treMarkable (template_tags (template_load (\"errors/$s_template\"), $a_data)), $s_title,\n\t\ttemplateHeader (),\n\t\ttemplateFooter (\".system/design/templates/errors/\".pathinfo ($s_template, PATHINFO_FILENAME))\n\t));\n}", "function reportError(string $errorMessage, string $path) {\n $_SESSION['errors'] = $errorMessage;\n redirect($path);\n exit;\n}", "protected function failure($error_msg) {\r\n $this->dest_page = 'login';\r\n \r\n /*\r\n * If the $_POST['dest'] was set, pass it back to the form as a $_GET\r\n * parameter\r\n */\r\n $dest_param = $this->request->request->get(\"dest\", null);\r\n if (!is_null($dest_param)) {\r\n $this->dest_params = \"?dest\" . \\urlencode($dest_param);\r\n }\r\n \r\n /*\r\n * Set the error message for the form\r\n */\r\n $this->session->set('login_err', $error_msg);\r\n\r\n /*\r\n * Redirect to $this->dest_code\r\n */\r\n $this->redirect();\r\n \r\n \r\n }", "private function _dispatchError ($errorCode)\r\n {\r\n echo str_replace('{$mesaj}', self::$_mesaje[$errorCode], file_get_contents(\"_accesBlocat.html\"));\r\n exit();\r\n }", "public function error404()\n {\n $this->whenError();\n $viewData['status'] = 404;\n $viewData['title'] = 'Not Found';\n $viewData['msg'] = 'Sorry but the page you are looking for does not exist, have been removed.';\n\n $this->pageError($viewData);\n }", "function error($code_or_codes, $callback = NULL)\n{\n\n}", "function error_404() {\n\t\theader($_SERVER[\"SERVER_PROTOCOL\"] . \" 404 Not Found\");\n\t\texit();\n\t}", "function ErrorRedir($errorString, $url) {\n global $ErrorCode, $HTTP_REFERER, $HTTP_HOST;\n\n $ErrorCode = $errorString;\n \n if (false == $_SESSION['ErrorCode'] = $ErrorCode) {\n echo \"Could not register ErrorCode: $ErrorCode\";\n exit;\n }\n if (FALSE == headers_sent()) {\n /* Redirect browser to PHP web site */\n header(\"Location: $url\"); \n exit; \n } else {\n $errorString = \"HTTP Error headers already sent from $HTTP_REFERER on $HTTP_HOST\".$errorString;\n @mail($adminEmailAddr, \"$PredictionLeagueTitle Error\",$errorString,\"From: $adminEmailAddr\");\n }\n}", "private function _error() {\n\t\trequire $this->_controllerPath . $this->_errorFile;\n\t\t$this->_controller = new Error();\n\t\t$this->_controller->index('Esta página no existe');\n\t\texit;\n\t}", "function setErrcode($errcode, $scriptname, $dienow=false) {\n\tglobal $siteaddr;\n\t$_SESSION['errcode']=$errcode;\n\theader(\"Location: \" . $siteaddr . \"/\" . $scriptname . \".php\");\n\tif ($dienow==true) {\n if (isset($link)) {\n mysql_close($link);\n }\n\t\tdie();\n\t}\n}", "public function error() {\n require_once($_SERVER['DOCUMENT_ROOT'] . '../PHPIncludes/pageLinkScriptsCSS.php');\n\n $pageRequirements = new pageLinkScriptsCSS();\n\n $pageRequirements->add(\"css\", ['error.css']);\n\n $pageRequirements->add(\"title\", 'The Sky Is Falling');\n\n callStructural('header','std',$pageRequirements);\n\n require_once('views/pages/error.php');\n\n //Render the page footer:\n callStructural(\"footer\", 'std', $pageRequirements); \n\n }", "function render_error($message = 'error by unknown reason', $map = null) {\n\trender_page(\"error\", $message, $map);\n}", "public function error(int $type)\n\t{\n\t\tswitch ($type) {\n\t\t\tcase 404:\n\t\t\t\theader(\"HTTP/2 404 Not Found\");\n\t\t\t\t$this->render($this->vars['404']);\n\t\t\tbreak;\n\n\t\t\tcase 401:\n\t\t\t\theader(\"HTTP/2 401 Unauthorized\");\n\t\t\t\t$this->render($this->vars['401']);\n\t\t\tbreak;\n\n\t\t\tcase 403:\n\t\t\t\theader(\"HTTP/2 401 Forbidden\");\n\t\t\t\t$this->render($this->vars['403']);\n\t\t\tbreak;\n\t\t}\t\t\n\t}", "public function errorAction() {\n\t\t\n\t\t$errors = $this->_getParam('error_handler');\n\t\t\n\t\tswitch ($errors->type) {\n\t\t\t \n\t\t\tcase Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\n\t\t\tcase Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\n\t\t\t\t\n\t\t\t\t// stranka nebyla nalezena - HTTP chybova hlaska 404\n\t\t\t\t$this->getResponse()->setHttpResponseCode(404);\n\t\t\t\t$this->view->message = 'Stránka nenalezena';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\t// chyba v aplikaci - HTTP chybova hlaska 500\n\t\t\t\t$this->getResponse()->setHttpResponseCode(500);\n\t\t\t\t$this->view->message = 'Chyba v aplikaci';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t}\n\t\t\n $this->view->env = APPLICATION_ENV;\n\t\t$this->view->exception = $errors->exception;\n\t\t$this->view->request = $errors->request;\n\t\t$this->view->title = 'Objevila se chyba';\r\n\t\t$this->view->showDetails = ini_get('display_errors');\r\n\t\t\n\t\t$this->_helper->layout->setLayout('error');\n\t\t\n\t}", "public function error() {\n require_once($_SERVER['DOCUMENT_ROOT'] . '../PHPIncludes/pageLinkScriptsCSS.php');\n\n $pageRequirements = new pageLinkScriptsCSS();\n\n $pageRequirements->add(\"css\", ['error.css']);\n\n $pageRequirements->add(\"title\", 'The Sky Is falling');\n\n callStructural('header','std',$pageRequirements);\n\n require_once('views/pages/error.php');\n\n //Render the page footer:\n callStructural(\"footer\", 'std', $pageRequirements); \n\n\n }", "public function error404() {\n\t\t$this->render('error400');\n\t}", "public function renderErrorNotAdmin(): void\n {\n header('HTTP/1.1 301 Not Found');\n header('Location: /error/notAdmin');\n die();\n }", "protected function RenderError() {\n echo view('errors/404');\n exit;\n }", "protected function setErrorHeader() {\n\t\tif ($this->response_code >= 400 && $this->response_code < 500) {\n\t\t\theader('HTTP/1.1 ' . $this->response_code . \" \" . SVException::g($this->response_code));\n\t\t\texit(0);\n\t\t}\n\t}", "public function uriError()\n {\n header(\"HTTP/1.0 404\");\n exit();\n }", "function error_404() {\n header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');\n exit(); //don't do any additional php, we are done\n }", "private function loadErrorPage()\n {\n // If there is no error page path or the file doesnt exist, output a message\n if ( ( ! $this->errorPagePath ) || ( ! file_exists($this->errorPagePath) ) )\n {\n // Output a general error message\n $error500Html = '';\n $error500Html .= $this->publicErrorMessage . '<br/><br/>';\n $error500Html .= '<span style=\"' . $this->errorDetailsHeaderStyle . '\">Error ID:</span> ' . $this->errid . '<br/><br/>';\n\n // If debug mode is enabled, output the error\n if ( $this->debugMode )\n {\n $error500Html .= $this->getErrorString(true, false, true, false, false);\n }\n\n $error500Html .= '<span style=\"' . $this->errorDetailsHeaderStyle . '\">Referrer:</span> <a href=\"' . $this->referer . '\">' . $this->referer . '</a>';\n\n // If email failed to send, append to error message\n if ( ( $this->debugMode ) and isset($this->failedToEmailMsg) ) $error500Html .= '<br/><br/><span style=\"' . $this->failedToEmailMsgStyle . '\">** Failed to send email to administrators: ' . $this->failedToEmailMsg . '</span>';\n\n // send error page in JSON response if coming from POST?\n if ( ( ! empty($_POST) ) and ( $this->errorPageInJSON ) )\n {\n exit(json_encode([ 'error500Html' => $error500Html ]));\n }\n else\n {\n echo $error500Html;\n }\n }\n /* If there is an error page path and it exists, include it\n * The file itself has access to the error string, it will\n * output it if debug mode is enabled.\n * Custom error files can be used by definining the config ERROR_PAGE_PATH */\n else\n {\n // send error page in JSON response if coming from POST?\n if ( ( ! empty($_POST) ) and ( $this->errorPageInJSON ) )\n {\n // start output buffering\n ob_start();\n include ( $this->errorPagePath );\n $error500Html = ob_get_clean(); // send generated error page into variable!\n\n exit(json_encode([ 'error500Html' => $error500Html ]));\n }\n else\n {\n include ( $this->errorPagePath );\n }\n }\n\n // exit the application after printing the error page\n exit();\n }", "public function redirectToHome(array $errors = []);", "public function actionError()\n {\n if(Core::getLoggedDeliveryBoyID() > 0)\n {\n\t \t $exception = Yii::$app->errorHandler->exception;\n\t \t $error = array('statusCode' => $exception->statusCode, 'message' => $exception->getMessage(), 'name' => $exception->getName());\n \t\t return $this->render('/error', ['error' => $error]);\n }\n else\n {\n\t \t\treturn Yii::$app->getResponse()->redirect(Yii::$app->getHomeUrl().'delivery')->send();\n }\n }", "public static function error404() {\n header('This is not the page you are looking for', true, 404);\n $html404 = sprintf(\"<title>Error 404: Not Found</title>\\n\" .\n \"<main><div class=\\\"container\\\"><div class=\\\"row\\\"><div class=\\\"col-lg-10 offset-lg-1\\\">\" .\n \"<div class=\\\"row wow fadeIn\\\" data-wow-delay=\\\"0.4s\\\"><div class=\\\"col-lg-12\\\"><div class=\\\"divider-new\\\">\" .\n \"<h2 class=\\\"h2-responsive\\\">Error 404</h2>\" .\n \"</div></div>\" .\n \"<div class=\\\"col-lg-12 text-center\\\">\" .\n \"<p>The page <i>%s</i> does not exist.</p>\" .\n \"</div></div></div></div></div></main>\", $_SERVER[\"REQUEST_URI\"]);\n echo $html404;\n }", "function display_error_page($message)\r\n {\r\n $this->display_header();\r\n $this->display_error_message($message);\r\n $this->display_footer();\r\n }", "public function error()\n {\n require_once('views/pages/error.php');\n }", "public function sh404sefErrorPage(& $error)\n\t{\n\t\t// only handle 404 errors, defer to previous handler otherwise\n\t\t$code = $error->getCode();\n\t\tif (404 != $code && !empty($this->joomlaErrorHandler) && ($this->joomlaErrorHandler['mode'] != 'callback' || !is_callable($this->joomlaErrorHandler['options'])))\n\t\t{\n\t\t\tJError::customErrorPage($error);\n\t\t\treturn;\n\t\t}\n\n\t\tif (404 != $code && !empty($this->joomlaErrorHandler) && $this->joomlaErrorHandler['mode'] == 'callback' && is_callable($this->joomlaErrorHandler['options']))\n\t\t{\n\t\t\tcall_user_func_array($this->joomlaErrorHandler['options'], array(&$error));\n\t\t\treturn;\n\t\t}\n\n\t\t$setting = Sh404sefFactory::getConfig()->notFoundErrorHandling;\n\t\tif (Sh404sefHelperGeneral::ERROR_404_HANDLE == $setting)\n\t\t{\n\t\t\t// if we should only handle URL parsing errors\n\t\t\t// adjust switch value according to current situation\n\t\t\tif (self::$requestParsed)\n\t\t\t{\n\t\t\t\t// Joomla error, use Joomla handling\n\t\t\t\t$setting = Sh404sefHelperGeneral::ERROR_404_USE_JOOMLA;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// URL parsing error, use sh404SEF handling\n\t\t\t\t$setting = Sh404sefHelperGeneral::ERROR_404_OVERRIDE_JOOMLA;\n\t\t\t}\n\t\t}\n\n\t\t// request is considered parsed now\n\t\tself::$requestParsed = true;\n\n\t\tswitch ($setting)\n\t\t{\n\t\t\tcase Sh404sefHelperGeneral::ERROR_404_USE_JOOMLA:\n\t\t\t\t$this->_store404Page();\n\n\t\t\t\t$configItemid = Sh404sefFactory::getConfig()->shPageNotFoundItemid;\n\t\t\t\tif (!empty($configItemid))\n\t\t\t\t{\n\t\t\t\t\tSh404sefHelperError::setItemid($configItemid);\n\t\t\t\t}\n\n\t\t\t\t// we forward the error to the original Joomla handler\n\t\t\t\tif (!empty($this->joomlaErrorHandler) && $this->joomlaErrorHandler['mode'] == 'callback' && is_callable($this->joomlaErrorHandler['options']))\n\t\t\t\t{\n\t\t\t\t\tcall_user_func_array($this->joomlaErrorHandler['options'], array(&$error));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// This is required to prevent a very unhelpful white-screen-of-death\n\t\t\t\t\tjexit('<strong>An error just happened: </strong>' . $error->getMessage() . '<br /><small>and there was another one displaying this message (invalid error handler).</small>');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase Sh404sefHelperGeneral::ERROR_404_OVERRIDE_JOOMLA:\n\t\t\t\t// we use our own handling\n\t\t\t\t$this->_store404Page();\n\t\t\t\tSh404sefHelperError::render404ErrorDocument($error);\n\t\t\t\texit();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function error404()\n\t{\n\t\t//envoie une entête 404 (pour notifier les clients que ça a foiré)\n\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\tView::show(\"errors/404.php\", \"Oups ! Perdu ?\");\n\t}", "function error_handler($exception) {\n\tglobal $config;\n\theader('HTTP/1.0 404 Not Found');\n\textract(array('error'=>$exception->getMessage()));\n\trequire($config['VIEW_PATH'].'404.php');\n\tdie();\n}", "public function error() \n\t{\n\t\trequire $this->view('error', 'error');\n\t\texit;\n\t}", "public function indexErrorLogin()\r\n {\r\n\t$vars['error'] = 1;\r\n\t\t\r\n $this->view->show(\"home.php\", $vars);\r\n }", "public function errorAction()\r\n {\r\n $this->_helper->layout->setLayout('bzerror');\r\n $this->_helper->redirector('index','bzerror');\r\n //$this->_helper->layout->setLayout('bzerror');\r\n }", "static public function errorCode($code)\n {\n http_response_code($code);\n\n $filename = APP . '/views/errors/' . $code . '.php';\n\n if (file_exists($filename)) require $filename;\n else if (IS_DEV) throw new \\Exception('file [$filename] is not found!');\n\n exit;\n }", "public function redirect(string $url, int $code = Response::HTTP_FOUND): void\n {\n throw new RedirectException('Redirect', new RedirectResponse($url, $code));\n }", "function sysError404(){\n\tsysError( \"Please check the address and try again.\", \"The page you requested was not found.\", \"Page Not Found\" );\t\n\texit();\n}", "public function error404(){\n\t\t$this->loadErrorView('Cette page n\\'existe pas', 'Error 404', 404); \n\t}", "public static function sendErrorResponse($error = null){\n http_response_code(500);\n echo $error;\n die();\n }", "function show_404($page = '', $log_error = TRUE)\n\t{\n\t\t// Load Router and Core classes.\n \t$RTR =& load_class('Router', 'core');\n\n \t// Redirect to not found\n \theader(\"Location: \" . $RTR->config->config['base_url'] . 'app_access/not_found');\n \texit;\n }", "public function forbiddenError() {\n sfContext::getInstance()->getController()->redirect('errores/forbidden');\n\t}", "public function redirect404()\n\t{\n\t\t$this->page = new Page($this->app);\n\t\t$this->page->setView('404.php');\n\t\t$this->addHeader('HTTP/1.0 404 Not Found');\n \t$this->send();\n\t}", "function fatalErrorHandler() {\n global $cfg;\n $error = error_get_last();\n if(($error['type'] === E_ERROR) || ($error['type'] === E_USER_ERROR)){\n header(\"HTTP/1.1 500 Server Error\");\n readfile($cfg['source_root'] . \"/500.html\");\n //error_log(print_r($error, true));\n //error_log(print_r(debug_backtrace(), true));\n exit();\n }\n/*\n if(($error['type'] === E_ERROR) || ($error['type'] === E_USER_ERROR)){\n $_SESSION['error'] = $error;\n header(\"Location:\".$cfg['root'].\"exception/\");\n exit;\n }\n*/\n}", "public function error($code = 500)\n {\n $view = view('errors/'.$code);\n\n return $this->respond($view, $code);\n }", "function error($msg)\n{\n header('HTTP/1.1 500 ' . $msg);\n die($msg);\n}" ]
[ "0.7973909", "0.7315906", "0.7278016", "0.72668135", "0.72423583", "0.7224111", "0.7188935", "0.7155267", "0.71461207", "0.7076318", "0.7050263", "0.7047342", "0.7018382", "0.7002094", "0.69734836", "0.69505495", "0.69312435", "0.6897051", "0.6889859", "0.6879199", "0.68744123", "0.68536395", "0.6828539", "0.6803735", "0.68035513", "0.67921466", "0.67874116", "0.67842835", "0.6779645", "0.67794275", "0.67430913", "0.67355865", "0.6727915", "0.67200625", "0.6713566", "0.6701676", "0.6699519", "0.66965604", "0.6695569", "0.6681611", "0.6677501", "0.6656709", "0.66316235", "0.6623281", "0.66187614", "0.65894544", "0.65852153", "0.6565522", "0.6557357", "0.6544151", "0.65395993", "0.653685", "0.65331453", "0.6528754", "0.6524797", "0.6520338", "0.6516677", "0.6510077", "0.6510073", "0.6505636", "0.6501046", "0.64952916", "0.64867455", "0.64800256", "0.64796966", "0.6472899", "0.64709634", "0.6469577", "0.64637685", "0.64559036", "0.6432146", "0.64183027", "0.6408569", "0.6408508", "0.6403601", "0.6397664", "0.6393813", "0.63923836", "0.63899136", "0.6385861", "0.637542", "0.6371222", "0.63711506", "0.6364107", "0.6360235", "0.63592046", "0.6357249", "0.63520896", "0.6338019", "0.6333977", "0.6329163", "0.6322011", "0.63211346", "0.6289726", "0.628255", "0.6281723", "0.627086", "0.6259406", "0.6257947", "0.6249424" ]
0.7574105
1
Returns wether one or more keys mathes any of a number of given elements in an array. This function is recursive, so the haystack menu may be multidimensional
function somewhereInArray($needles, $haystack, $CASE_INSENSITIVE = false){ if(!is_array($needles)) $needles = array($needles); if(is_array($haystack)) { foreach($haystack as $straw) { if(somewhereInArray($needles, $straw, $CASE_INSENSITIVE)) return true; } return false; } else { foreach($needles as $needle) { if($CASE_INSENSITIVE) { if(stripos($haystack, $needle) !== false) return true; } else { if(strpos($haystack, $needle) !== false) return true; } } return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function in_array_multi_key($needle, $haystack)\r\n{\r\n // only matches the key, values don't count.\r\n if ( array_key_exists($needle, $haystack) )\r\n {\r\n return TRUE;\r\n }\r\n\r\n foreach ( $haystack as $key => $value )\r\n {\r\n if ( is_array($value) )\r\n {\r\n $work = in_array_multi_key($needle, $value);\r\n if ( $work )\r\n {\r\n return TRUE;\r\n }\r\n }\r\n }\r\n return FALSE;\r\n}", "function multiKeyExists(array $arr, $key){ if (array_key_exists($key, $arr)) {\n return true;\n }\n // check arrays contained in this array\n foreach ($arr as $element) {\n if (is_array($element)) {\n if ($this->multiKeyExists($element, $key)) {\n return true;\n }\n }\n\n }\n return false;\n}", "function isMultiDimentionalArray(array $array):bool\n{\n if (count($array) == count($array, COUNT_RECURSIVE))\n {\n return false;\n }else{\n return true;\n }\n}", "function array_keys_exist( array $array, $keys ) {\n $count = 0;\n if ( ! is_array( $keys ) ) {\n $keys = func_get_args();\n array_shift( $keys );\n }\n foreach ( $keys as $key ) {\n if ( array_key_exists( $key, $array ) ) {\n $count ++;\n }\n }\n\n return count( $keys ) === $count;\n }", "public static function multiKeyExists(array $arr, $key) { if (array_key_exists($key, $arr)) {\n return true;\n }\n \n // check arrays contained in this array\n foreach ($arr as $element) {\n if (is_array($element)) {\n if (self::multiKeyExists($element, $key)) {\n return true;\n }\n }\n \n }\n \n return false;\n }", "public static function inArrayMulti(array $aHaystack, $xNeedle) {\n\t\tif (is_array($aHaystack)) {\n\t\t\tforeach ($aHaystack as $xItem) {\n\t\t\t\tif (is_array($xItem)) {\n\t\t\t\t\tif (static::inArrayMulti($xItem, $xNeedle)) {\n\t\t\t\t\t\treturn TRUE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif ($xItem == $xNeedle) {\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}", "function in_array_any($needles, $haystack) {\n \n return !empty(array_intersect($needles, $haystack));\n\n}", "function array_any_keys_exists(array $keys, array $array)\n {\n $result = false;\n\n foreach ($keys as $key) {\n $result = $result OR array_key_exists($key, $array);\n }\n\n return $result;\n }", "function atk_value_in_array($array)\n{\n\tif (is_array($array) && !empty($array))\n\t{\n\t\tforeach ($array as $key => $value)\n\t\t{\n\t\t\tif (is_array($value))\n\t\t\t{\n\t\t\t\tif (atk_value_in_array($value)) return true;\n\t\t\t}\n\t\t\telse if($value) return true;\n\t\t}\n\t}\n\treturn false;\n}", "function in_multi_array($needle, $haystack) {\n\t$in_multi_array = false;\n\tif(in_array($needle, $haystack)) {\n\t\t$in_multi_array = true;\n\t} else {\n\t\tforeach ($haystack as $key => $val) {\n\t\t\tif(is_array($val)) {\n\t\t\t\tif(in_multi_array($needle, $val)) {\n\t\t\t\t\t$in_multi_array = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $in_multi_array;\n}", "public function containsKeys(array $keys): bool;", "function arrayMultiSearch( $p_needle, $p_haystack ) {\r\n if( !is_array( $p_haystack ) )\r\n return false;\r\n\r\n if( in_array($p_needle, $p_haystack ))\r\n return true;\r\n\r\n foreach( $p_haystack as $row ) {\r\n if(arrayMultiSearch( $p_needle, $row ))\r\n return true;\r\n }\r\n return false;\r\n}", "function multi_in_array($needle, $haystack, $strict = false) \n\t{\n\t\tforeach ($haystack as $item) {\n\t\t\tif (($strict ? $item === $needle : $item == $needle) || (is_array($item) && multi_in_array($needle, $item, $strict))) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n \treturn false; \t\n\t}", "public static function in_multiarray($elem, $array)\n {\n if( is_array( $array ) || is_object( $array ) )\n {\n // if $elem is in $array object\n if( is_object( $array ) )\n {\n $temp_array = get_object_vars( $array );\n if( in_array( $elem, $temp_array ) )\n return TRUE;\n }\n \n // if $elem is in $array return true\n if( is_array( $array ) && in_array( $elem, $array ) )\n return TRUE;\n \n \n // if $elem isn't in $array, then check foreach element\n foreach( $array as $array_element )\n {\n // if $array_element is an array or is an object call the in_multiarray function to this element\n // if in_multiarray returns TRUE, than return is in array, else check next element\n if( ( is_array( $array_element ) || is_object( $array_element ) ) && self::in_multiarray( $elem, $array_element ) )\n {\n return TRUE;\n exit;\n }\n }\n }\n \n // if isn't in array return FALSE\n return FALSE;\n }", "function array_key_exists_multi($key, $arr) {\n// if ($result) return $result;\n// foreach($arr as $value) {\n// if(is_array($value)) {\n// $result = array_key_exists_multi($key, $value);\n// }\n// if ($result) return $result;\n// }\n// return $result;\n foreach($arr as $value){\n if ($value['PID'] == $key) {\n return true;\n } \n } \n return false;\n}", "function isMultipleKey(): bool;", "function in_array_r($needle, $haystack, $strict = false) {\n foreach ($haystack as $item) {\n if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && in_array_r($needle, $item, $strict))) {\n return true;\n }\n }\n\n return false;\n}", "function array_key_exists_in_array_of_arrays($needle, string $key, array $haystack = null)\n{\n if (!$needle || !$key || !$haystack || !count($haystack)) {\n return false;\n }\n foreach ($haystack as $item) {\n if (array_key_exists($key, $item) && $needle === $item[$key]) {\n return true;\n }\n }\n return false;\n}", "function atk_in_array_recursive($needle, $haystack)\n{\n\tforeach ($haystack as $key=>$value)\n\t{\n\t\tif ($value==$needle) return true;\n\t\telse if (is_array($value))\n\t\t{\n\t\t\tif (atk_in_array_recursive($needle, $value)) return true;\n\t\t}\n\t}\n\treturn false;\n}", "public function hasMultiple(array $keys): bool\n {\n foreach ($keys as $key) {\n if (!$this->has($key)) {\n return false;\n }\n }\n return true;\n }", "function array_in_array($needles, $haystack){\n foreach($needles as $needle){\n if(!in_array($needle, $haystack)) return false;\n }\n return true;\n}", "public static function assoc($array)\n {\n return (bool) count(array_filter(array_keys($array), 'is_string'));\n }", "function contains(...$args)\n{\n\t$array = array_shift($args);\n\tif( is_array($array) )\n\t{\n\t\tforeach( $args as $a )\n\t\t\tif( in_array($a,$array) )\n\t\t\t\treturn true;\n\t\treturn false;\n\t}\n\tif( is_string($array) )\n\t{\n\t\tforeach( $args as $a )\n\t\t\tif( stripos($array,$a) !== false )\n\t\t\t\treturn true;\n\t\treturn false;\n\t}\n\tWdfException::Raise('First argument needs to be of type array or string');\n return false;\n}", "function myInArray($array, $value, $key){\n foreach ($array as $val) {\n //if $val is an array cal myInArray again with $val as array input\n if(is_array($val)){\n if(myInArray($val,$value,$key))\n return true;\n }\n //else check if the given key has $value as value\n else{\n if($array[$key]==$value)\n return true;\n }\n }\n return false;\n }", "function in_array_all($needles, $haystack) {\n\t\n return empty(array_diff($needles, $haystack));\n\n}", "public function has_any(array $keys) {\n foreach ($keys as $key) {\n if ($this->has($key)) {\n return true;\n }\n }\n return false;\n }", "public static function existsNestedKey($array, $keys)\n {\n foreach ($keys as $key) {\n if (isset($array[$key]))\n $array = $array[$key];\n else\n return false;\n }\n return true;\n }", "public static function areKeysSet (array $needleArray, array $haystack)\n {\n $keysSet = true;\n foreach ($needleArray as $needle) {\n if (!array_key_exists($needle, $haystack)) {\n $keysSet = false;\n break;\n }\n };\n\n return $keysSet;\n }", "function array_is_multidimensional(array $array) {\n\treturn count($array) !== count($array, COUNT_RECURSIVE);\n}", "private function all($a) {\n return count(array_filter($a)) == count($a);\n }", "function wpsl_is_multi_array( $array ) {\n\n foreach ( $array as $value ) {\n if ( is_array( $value ) ) return true;\n }\n\n return false;\n}", "public static function areset($array, $keys) {\n\t\tforeach ($keys as $key)\n\t\t\tif (!isset($array[$key]))\n return false;\n\n\t\treturn true;\n\t}", "public static function isArrayMultidimensional( $arr ) {\n if (!is_array($arr)) {\n return false;\n }\n foreach ($arr as $elm) {\n if (!is_array($elm)){\n return false;\n }\n }\n return true;\n }", "public static function isArray(array $arrayInput, array $hashOptions = array())\n {\n if (!is_array($arrayInput)) {\n return false;\n }\n\n if (!isset($hashOptions['flag'])\n ||\n isset($hashOptions['flag']) && !in_array($hashOptions['flag'], array(1, 2, 3, 4, 6, 7), true)) {\n $hashOptions['flag'] = 0;\n }\n if (isset($hashOptions['other'])\n && is_array($hashOptions['other']) && ($hashOptions['flag'] & self::ARRAY_IDENTICAL_TO) !== 0) {\n return empty(array_diff_assoc($arrayInput, $hashOptions['other']));\n } else {\n foreach ($arrayInput as $mixedKey => $mixedValue) {\n if (($hashOptions['flag'] & self::ARRAY_CONTAINS_ALL_KEYS) !== 0) {\n if (!isset($hashOptions['keys']) || (is_array($hashOptions['keys'])\n && !in_array($mixedKey, $hashOptions['keys'], true))) {\n return false;\n }\n }\n if (($hashOptions['flag'] & self::ARRAY_CONTAINS_ALL_VALUES) !== 0) {\n if (!isset($hashOptions['values']) || (is_array($hashOptions['values'])\n && !in_array($mixedValue, $hashOptions['values'], true))) {\n return false;\n }\n }\n }\n }\n return true;\n }", "public static function has($array, $keys)\n {\n $keys = (array) $keys;\n\n if (!$array || $keys === []) {\n return false;\n }\n\n foreach ($keys as $key) {\n $items = $array;\n\n if (static::exists($items, $key)) {\n continue;\n }\n\n foreach (explode('.', $key) as $segment) {\n if (!is_array($items) || !static::exists($items, $segment)) {\n return false;\n }\n\n $items = $items[$segment];\n }\n }\n\n return true;\n }", "public function testMatches() {\n $this->assertTrue(Hash::matches($this->expanded, $this->expanded));\n $this->assertTrue(Hash::matches(array(\n 'foo' => 123,\n 'bar' => 'baz',\n 'array' => array()\n ), array(\n 'foo' => 123,\n 'bar' => 'baz',\n 'array' => array()\n )));\n\n $this->assertFalse(Hash::matches($this->expanded, $this->collapsed));\n $this->assertFalse(Hash::matches(array(\n 'foo' => '123',\n 'bar' => 'baz',\n 'array' => array()\n ), array(\n 'foo' => 123,\n 'bar' => 'baz',\n 'array' => array()\n )));\n }", "function any_in_array($needle, $haystack)\n{\n $needle = is_array($needle) ? $needle : array($needle);\n\n foreach ($needle as $item)\n {\n if (in_array($item, $haystack))\n {\n return TRUE;\n }\n }\n\n return FALSE;\n}", "function keys_exist_in($array,$params,$section,$tbl = true){\r\n\r\n\tforeach($params as $item){\r\n\t\tif (!array_key_exists(trim($item),$array)){\r\n\t\t\tif ($tbl)\r\n\t\t\t\techo \"<tr><td colspan=\\\"5\\\"><strong>Error</strong>: key '$item' not found in $section!</td></tr>\";\r\n\t\t\telse\r\n\t\t\t\techo \"<strong>Error</strong>: key '$item' not found in $section!</form>\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "function cp_check_param($array, $mandatory_keys, $optional_keys = array()){\r\n $array = array_keys($array);\r\n if (count(array_diff($mandatory_keys, $array)) > 0){\r\n return false;\r\n }\r\n if (count(array_diff($array, array_merge($mandatory_keys,$optional_keys))) > 0){\r\n return false;\r\n }\r\n \r\n return true;\r\n}", "public static function has(array $array, ...$keys): bool\n {\n $key = array_shift($keys);\n $exist = array_key_exists($key, $array);\n\n if (!$exist || empty($keys)) {\n return $exist;\n }\n\n if (!is_array($array[$key])) {\n return false;\n }\n\n return self::has($array[$key], ...$keys);\n }", "public static function array_searchMultiOnKeys($searchKeysArray, $multiArray) {\r\n foreach ($searchKeysArray as $keySearch) {\r\n $multiArray = $multiArray[$keySearch];\r\n $result = $multiArray;\r\n }\r\n \r\n // Check $result.\r\n if (is_array($multiArray)) {\r\n // An array was found at the end of the search. Return true.\r\n $result = true;\r\n }\r\n elseif ($result == '') {\r\n // There was nothing found at the end of the search. Return false.\r\n $result = false;\r\n }\r\n\r\n return $result;\r\n// End of function,\r\n}", "function array_count_keyes(array $arr, String $needle)\n\t{\n\n\t\treturn inMultDimArr($needle, $arr, true);\n\n\t}", "public function multiIsset(array $array, array $children) {\n foreach ($children as $child) {\n if (!isset($array[$child])) {\n return false;\n }\n $array = $array[$child];\n }\n return true;\n }", "public function isAssociative( array &$array )\n {\n return count(array_filter(array_keys($array), 'is_string')) > 0;\n }", "public function inArrayAll($needles, $haystack): bool\n {\n return empty(array_diff($needles, $haystack));\n }", "static function keySet($arr) {\n if (is_array($arr)) {\n return self::make(function ($k) use ($arr) {\n return array_key_exists($k, $arr);\n });\n } else {\n return self::make(function ($k) use ($arr) {\n return isset($arr[$k]);\n });\n }\n }", "protected final function multidimensional_isset($root, $keys)\n {\n }", "public function many(array $keys){\n return false;\n }", "function checkinarray($arry,$valu){\n\n$len=count($arry);\n\n$looper=0;\nwhile($looper<$len){\nif($arry[$looper]==$valu)return true;\n\n$looper++;\n}\n\nreturn false;\n}", "static function in_multi_array($look_for, $array, $at_key = false, $history = false) {\n\n\t\tif (is_array($array)) {\n\t\t\t// Loop over array and check for value\n\t\t\tforeach ($array AS $key => $item) {\n\t\t\t\t// Set first layer of history\n\t\t\t\t$history[] = $key;\n\t\t\t\t// Make sure it's actually an array\n\t\t\t\tif (is_array($item)) {\n\t\t\t\t\t// If only looking in specific keys\n\t\t\t\t\tif ( $at_key && isset($item [$at_key]) && $item [$at_key] === $look_for ) {\n\t\t\t\t\t\t$result = $history;\n\t\t\t\t\t} // Else check the whole array for the value\n\t\t\t\t\telseif ( in_array($look_for, $item, 1) && $at_key === false ) {\n\t\t\t\t\t\t$found_key = array_search( $look_for, $item, 1 );\n\t\t\t\t\t\t$history[] = $found_key;\n\t\t\t\t\t\t$result = $history;\n\t\t\t\t\t}// If still no result, look deeper\n\t\t\t\t\telseif (!isset($result)) {\n\t\t\t\t\t\t// Let the function call itself, will return the result if possible\n\t\t\t\t\t\t$result = self::in_multi_array($look_for, $item, $at_key, $history);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isset($result)) break;\n\t\t\t\tarray_pop( $history );\n\t\t\t}\n\t\t\tif (isset($result)) {\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\n\t}", "public function check($key) {\n if (!is_array($key)) {\n $key = array($key);\n }\n\n foreach ($key as $field) {\n\t\t\tif (!MOC_Array::check($this->data, $field)) {\n\t\t\t\treturn false;\n\t\t\t}\n }\n return true;\n }", "function has_string_keys(array $array) {\n return count(array_filter(array_keys($array), 'is_string')) > 0;\n}", "public function doesMatchArgs($args) {\n if (sizeof($this->args) != sizeof($args)) return FALSE;\n for ($i= 0; $i < sizeof($args); ++$i) {\n if (!$this->doesMatchArg($i, $args[$i])) return FALSE;\n }\n return TRUE;\n }", "public static function IsMap(array $array) {\n return (bool) sizeof(array_filter(array_keys($array), 'is_string'));\n }", "function hasArray($arr) {\r\n\tforeach ($arr as $value) {\r\n\t\tif(is_array($value))\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "private function isMultiDimensionalArray(array $array)\r\n {\r\n $rv = array_filter($array, 'is_array');\r\n if (count($rv) > 0) return true;\r\n return false;\r\n }", "public function getIsAllKeysValid(array $data)\n {\n $keys = array_keys($data);\n foreach($keys as $key)\n {\n if(!$this->getIsValidKey($key))\n {\n return false;\n }\n }\n return true;\n }", "public function hasAnyGroup(...$groups): bool;", "public function contains()\n {\n $args = func_get_args();\n return (bool) $this->intersect($args);\n }", "private function isTrueArray($array) {\n if (is_array($array) && isset($array) && count($array)) {\n return TRUE;\n } else {\n return FALSE;\n }\n }", "function array_is_multi(array $array)\n {\n return (count($array) !== count($array, true));\n }", "function array_has($array, $key)\n {\n if (empty($array) || is_null($key)) return false;\n\n if (array_key_exists($key, $array)) return true;\n\n foreach (explode('.', $key) as $segment)\n {\n if ( ! is_array($array) || ! array_key_exists($segment, $array))\n {\n return false;\n }\n\n $array = $array[$segment];\n }\n\n return true;\n }", "function in_array_r($needle, $haystack, $strict = false) {\n \t\t\t\t\t\t\tforeach ($haystack as $item) {\n \t\t\t\t\t\t\tif (($strict ? $item === $needle : $item == $needle) || (is_array($item) && in_array_r($needle, $item, $strict))) {\n \t\t\t\t\t\t\treturn true;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\treturn false;\n \t\t\t\t}", "public static function has($array, $key)\n {\n if (is_null($key)) {\n return false;\n }\n \n $keys = (array)$key;\n \n if ($keys === [])\n return false;\n \n foreach ($keys as $key) {\n \n $subKeyArray = $array;\n \n if (static::exists($array, $key)) {\n continue;\n }\n \n foreach (explode('.', $key) as $segment) {\n \n if (static::accessible($subKeyArray) && static::exists($subKeyArray, $segment)) {\n \n $subKeyArray = $subKeyArray[$segment];\n } else {\n \n return false;\n }\n }\n \n }\n \n return true;\n }", "function checkValues($form){\n $values = array(\"id_kapela\", \"nazev\", \"styl\", \"zeme\", \"mesto\", \"text\", \"kapela_id_kapela\", \"koncert_id_koncert\", \"id_koncert\", \"datum\", \"cas\", \"misto\", \"vstup\", \"uzivatel_id_uzivatel\", \"id_uzivatel\", \"jmeno\", \"heslo\", \"email\", \"admin\", \"pwd\", \"hesloCheck\");\n $keys = array_keys($form);\n \n for($i = 0; $i < sizeof($keys); $i++){\n if(!in_array(($keys[$i]), $values)){\n return false;\n }\n }\n \n return true;\n}", "public static function has( $array, $keys )\n {\n if ( is_null( $keys ) ) {\n return false;\n }\n\n $keys = (array)$keys;\n\n if ( ! $array ) {\n return false;\n }\n\n if ( $keys === [] ) {\n return false;\n }\n\n foreach ( $keys as $key ) {\n $subKeyArray = $array;\n\n if ( static::exists( $array, $key ) ) {\n continue;\n }\n\n foreach ( explode( '.', $key ) as $segment ) {\n if ( static::accessible( $subKeyArray ) && static::exists( $subKeyArray, $segment ) ) {\n $subKeyArray = $subKeyArray[ $segment ];\n } else {\n return false;\n }\n }\n }\n\n return true;\n }", "function searchArray($needle, $haystack, $strict = false) {\n foreach ($haystack as $item) {\n if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && searchArray($needle, $item, $strict))) {\n return true;\n }\n }\n\n return false;\n}", "function areSet($submit, $arr) {\n if(empty($submit)) return false;\n $json = json_encode($submit);\n foreach ($arr as $variable) {\n if (strpos($json, $variable)==-1) return false;\n }\n return true;\n}", "protected function isIndexed($array){\n $flag='';\n foreach ($array as $key => $v) {\n if(!(is_int($key))){\n $flag = 1;\n }\n \n }\n if($flag == 1){\n return FALSE;\n }else{\n return TRUE;\n }\n }", "function questionIdsExist($arr, $form) {\r\n\r\n\t$formId = getFormId($form);\r\n\tif($formId) {\r\n\t\tforeach ($arr as $value) {\r\n\t\t\tif(is_array($value)) {\r\n\t\t\t\tquestionIdsExist($value, $form);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(getQuestionId($value, $form) == null) return false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\telse return false;\r\n}", "function array_multi_search($array,$key,$value=''){\n\t$key = strtolower($key);\n\t$value = strtolower($value);\n\tif(!is_array($array)){\n\t\treturn false;\n\t}\n\tforeach($array as $sub_array){\n\t\tif(!is_array($sub_array)){\n\t\t\tif(strtolower($sub_array) == $key){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tforeach($sub_array as $k=>$v){\n\t\t\tif(strtolower($k) == $key){\n\t\t\t\tif(strtolower($v) == $value){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}", "public function contains(...$items) : bool;", "private static function isAssocArray($array) {\n return count(array_filter(array_keys($array), 'is_string')) > 0;\n }", "public static function isMultiDimensionalArray($array)\n {\n rsort($array);\n return isset($array[0]) && is_array($array[0]);\n }", "public function keyHasNext($section, $element){\n\t\t$body = $this->toArray();\n\t\t$i = 0;\n\t\tforeach ($body as $key => $value) {\n\t\t\tif($key == $section){\n\t\t\t\tforeach ($value as $k => $v) {\n\t\t\t\t\tif($k == $element){\n\t\t\t\t\t\tif((sizeof($value) - 1) > $i){\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t} return false;\n\t}", "public function has_all(array $keys) {\n foreach ($keys as $key) {\n if (!$this->has($key)) {\n return false;\n }\n }\n return true;\n }", "static public function verify_request_array($keys)\n {\n $result = true;\n \n foreach ($keys as $key) {\n if ( isset($_REQUEST[$key])\n and ($_REQUEST[$key] != '')\n ) {\n $result &= true;\n } else {\n $result &= false;\n }\n }\n\n return $result;\n }", "public function matchMultiple($fullKey, array $constraints)\n {\n foreach ($constraints as $constraint) {\n if ($this->match($fullKey, $constraint)) {\n return true;\n }\n }\n\n return false;\n }", "function array_has($array, $keys)\n {\n return Arr::has($array, $keys);\n }", "function array_has($array, $keys)\n {\n return Arr::has($array, $keys);\n }", "function has_string_keys( $arr ) {\n\tforeach ( $arr as $key => $value ) {\n\t\tif ( is_string( $key ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}", "public function hasAll(array $keys)\n {\n foreach ($keys as $key) {\n if (!$this->has($key)) {\n return false;\n }\n }\n\n return true;\n }", "static function keysEqual(array $array, array $need, $strict = true) {\n $have = array_keys($array);\n ksort($need);\n ksort($have);\n return $strict ? ($need === $have) : ($need == $have);\n }", "public static function isKeySet($key, &$arr, $default = NULL)\n\t{\n\t\tif (Helper_Check::isStringEmptyOrNull($key))\treturn FALSE;\n\t\t\t\n\t\tif (isset($arr[$key]) && $arr[$key] !== NULL)\treturn TRUE;\n\t}", "public static function isMultiArray( $arr ) {\n rsort( $arr );\n return isset( $arr[0] ) && is_array( $arr[0] );\n }", "function array_has(array $array, $key) {\n if (empty($array) || $key === null) {\n return false;\n }\n\n if (array_key_exists($key, $array)) {\n return true;\n }\n\n foreach (explode('.', $key) as $segment) {\n if ( ! is_array($array) || ! array_key_exists($segment, $array)) {\n return false;\n }\n\n $array = $array[$segment];\n }\n\n return true;\n }", "public function isIn(string $key, array $array): bool\n {\n $isIn = false;\n $keys = explode('.', $key);\n\n foreach ($keys as $ikey) {\n if (!isset($array[$ikey])) {\n $isIn = false;\n break;\n }\n $array = $array[$ikey];\n $isIn = true;\n }\n\n return $isIn;\n }", "public function isSequentialArray($array)\n {\n $counter = 0;\n foreach ($array as $key => $value) {\n if ($counter !== $key) {\n return false;\n }\n $counter++;\n }\n\n return true;\n }", "function has_no_sub_arrays($array) {\n if (!is_array($array)) {\n return true;\n }\n foreach ($array as $sub) {\n if (is_array($sub)) {\n return false;\n }\n }\n return true;\n}", "public static function isIndexed($array)\n {\n if (!\\is_array($array)) {\n return false;\n }\n\n if (empty($array)) {\n return true;\n }\n\n // keys are strings : associative array\n if ((bool) count(array_filter(array_keys($array), 'is_string'))) {\n return false;\n }\n\n // Create normal index and compare\n $indexes = \\array_keys(\\array_fill(0, count($array), null));\n if ((bool) count(\\array_diff($indexes, \\array_keys($array)))) {\n return false;\n }\n\n return true;\n }", "public function contains(...$values): bool;", "function contains_all_verticies($seen,$all){\n return empty(array_diff($all,$seen));\n}", "function is_in_array($associative_array = array(), $look_up_key = \"\", $look_up_value = \"\") {\n\t\tforeach ($associative_array as $associative) {\n\t\t\t$keys = array_keys($associative);\n\t\t\tfor($i = 0; $i < count($keys); $i++){\n\t\t\t\tif ($keys[$i] == $look_up_key) {\n\t\t\t\t\tif ($associative[$look_up_key] == $look_up_value) {\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\t\treturn false;\n\t}", "function is_in_array($needle,$haystack) {\r\n\t$needleFound = false;\r\n\t$returnValue = false;\r\n\treset($haystack);\r\n\twhile ((list($key,$value) = each($haystack)) && !$needleFound) {\r\n\t\tif ($needle == $value) {\r\n\t\t\t$needleFound = true;\r\n\t\t\t$returnValue = $key;\r\n\t\t}\r\n\t}\r\n\treturn $returnValue;\r\n}", "function array_some($f, $arr){\n\tforeach ($arr as $val) {\n\t\tif($f($val)){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function test($Array){\n\t$multi=false;\n\tglobal $Groups,$log;\n\tforeach($Groups as $Group){\n\t\t$Check = array();\n\t\tforeach ($Group as $Cell){\n\t\t\t$val=$Array[$Cell['row']][$Cell['column']];\n\t\t\tswitch(strlen($val)){\n\t\t\t\tcase 0:\n\t\t\t\t\t$log.= 'test:0';\n\t\t\t\t\treturn 0;\n\t\t\t\tcase 1:\n\t\t\t\t\t$Check[]=$val;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\t$multi=true;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tforeach ($Check as $value){\n\t\t\tif(count(array_keys($Check,$value))!==1){\n\t\t\t\t$log.= 'test:0';\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}\n\tif($multi){\n\t\t$log.= 'test:2';\n\t\treturn 2;\n\t}\n\t$log.= 'test:1';\n\treturn 1;\n}", "protected function isAssociativeArray(array $array)\n {\n return (bool) \\count(\\array_filter(\\array_keys($array), 'is_string'));\n }", "function comp($a,$b) {\n if ((count($a == count($b))) && ($a !== \"\")) { \n foreach ($a as $check) {\n // if !exists $a ~ $b\n if (!in_array($check*$check, $b)) {\n return false;\n }\n }\n return true;\n }\n return false;\n}", "public function hasAnySet(array ...$tokenSets): bool\n {\n foreach ($tokenSets as $set) {\n if ($this->has(...$set)) {\n return true;\n }\n }\n\n return false;\n }", "protected function hasParentMenuArr() {}", "function inList($keys, $data)\n\t\t\t{\n\t\t\t\tif (!$keys) return 0;\n\n\t\t\t\t$list = explode(\",\", strtolower(trim($data)));\n\n\t\t\t\tforeach ($keys as $key)\n\t\t\t\t\tforeach ($list as $listing)\n\t\t\t\t\t\tif ( strtolower(trim($key)) == trim($listing) ) return 1;\n\n\t\t\t\t\t\treturn 0;\n\t\t\t}" ]
[ "0.66424185", "0.651373", "0.61682063", "0.6096198", "0.60635495", "0.6056374", "0.5932806", "0.57352626", "0.57248545", "0.5639123", "0.5610643", "0.56032485", "0.5599272", "0.5584945", "0.55653316", "0.5555792", "0.55551237", "0.55530375", "0.55352956", "0.5533125", "0.54681605", "0.5434772", "0.5430933", "0.54293597", "0.54280365", "0.5422885", "0.54207194", "0.54200935", "0.54095", "0.539881", "0.5395088", "0.5390921", "0.53762877", "0.53280246", "0.5290391", "0.5280632", "0.5279394", "0.52737176", "0.52668566", "0.52627194", "0.5257641", "0.52441376", "0.5230255", "0.5223901", "0.5220126", "0.5219282", "0.5216099", "0.5210047", "0.52052885", "0.51864314", "0.5179498", "0.5177504", "0.5172578", "0.51644117", "0.51463187", "0.51460356", "0.5144483", "0.51403236", "0.51222605", "0.5115605", "0.5113372", "0.5107654", "0.50977075", "0.5089575", "0.50831956", "0.5078642", "0.50764954", "0.5068139", "0.5059004", "0.5049407", "0.5042095", "0.5035201", "0.50329673", "0.5028393", "0.50200546", "0.50188005", "0.5013478", "0.49909556", "0.49873063", "0.49873063", "0.49855193", "0.49814492", "0.49808568", "0.49770257", "0.49743876", "0.4969958", "0.4969871", "0.4966158", "0.49625808", "0.4961383", "0.4958364", "0.4952951", "0.49518487", "0.49497464", "0.49480668", "0.49454474", "0.49373025", "0.49341747", "0.4932997", "0.49311456", "0.49295864" ]
0.0
-1
Regenerate the session id for increased security
function regenerateSession($reload = false) { if(!isset($_SESSION['fingerprint']) || $reload) { $_SESSION['fingerprint'] = sha1(md5($_SERVER['REMOTE_ADDR'].'ahsh') .md5($_SERVER['HTTP_USER_AGENT'].'afke')); } /** * Create new session and destroy the old one */ session_regenerate_id(true); global $CONFIG; if($CONFIG->Subdomains->Top_domain) { setcookie(session_name(), session_id(), 0, "/", ".".$CONFIG->Subdomains->Top_domain, true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function regenerateSessionid();", "private function sessionRegenerateId()\n {\n // even if the session were hijacked, it will be expired very soon, so doing this way we reduce chance of users's (or admin's) account penetration\n // again, it's not 100% way to do secure accounts, but it makes hijacking harder\n // and yes, i almost copied code from php.net ;)\n\n // step 0. make sure that session is active\n if (session_status() !== PHP_SESSION_ACTIVE) {\n session_start();\n }\n\n // step 1: create new session id\n $newSessionID = session_create_id($this->sessionIDPrefix);\n\n // outdated session, we don't need it\n $this->unsetSESSION('session_created');\n\n // step 2: push time of regenerating into current session\n $this->setSESSION('session_annihilated', time());\n\n // step 3: save new session id into old session\n $this->setSESSION('new_session_id', $newSessionID);\n\n // step 4: generate new session id and keep old session\n session_regenerate_id(false);\n\n // see? we create new session with new identifier, but old session is still alive!\n // in this session we don't need new id and destroy time\n $this->unsetSESSION('session_annihilated');\n $this->unsetSESSION('new_session_id');\n\n // and create time of creating to check it later\n $this->setSESSION('session_created', time());\n }", "public function regenerateId()\n {\n $this->checkIfStarted();\n\n session_regenerate_id(true);\n }", "protected function regenerateSessionId() {}", "protected function regenerateSessionId() {}", "function regenerate_id () {\n\n # saves the old session's id\n $old_session_id = session_id();\n\n # regenerates the id\n session_regenerate_id();\n\n self::destroy($old_session_id);\n\n }", "function _RegenerateId()\n {\n if ($this->regenerate_id && function_exists('session_regenerate_id')) {\n if (version_compare('5.1.0', phpversion(), '>=')) {\n //session_regenerate_id(true);\n } else {\n \t//session_regenerate_id();\n }\n }\n }", "public function regenerate()\n {\n session_regenerate_id(false);\n }", "public function regenerateId()\n {\n $this->checkIfStarted();\n\n $this->sessionId = $this->calculateSessionId();\n }", "function _session_regenerate_id()\r\n {\r\n $old_session_id = session_id();\r\n $old_session_data = $_SESSION;\r\n\r\n // regenerate session id and store it\r\n session_regenerate_id();\r\n $new_session_id = session_id();\r\n\r\n // switch to the old session and destroy its storage\r\n session_id($old_session_id);\r\n session_destroy();\r\n\r\n // switch back to the new session id and send the cookie\r\n session_id($new_session_id);\r\n session_start();\r\n\r\n // restore the old session data into the new session\r\n $_SESSION = $old_session_data;\r\n\r\n // update the session creation time\r\n $_SESSION['regenerated'] = _get_time();\r\n\r\n // end the current session and store session data.\r\n session_write_close();\r\n }", "public function regenerateId()\n {\n $oldSessionId = $this->getSessionId();\n if (version_compare(PHP_VERSION, '7.1.0', '>=')) {\n $newSessionId = session_create_id();\n } else {\n session_regenerate_id(false);\n $newSessionId = $this->getSessionId();\n $this->commitSession();\n ini_set('session.use_strict_mode', 0);\n session_id($oldSessionId);\n session_start();\n ini_set('session.use_strict_mode', 1);\n }\n $this->metadata->isActive = false;\n $this->metadata->expireDataAt = time() + $this->config->ttlAfterIdRegen;\n $this->metadata->forwardToSessionId = $newSessionId;\n $this->writeMetadata();\n $this->commitSession();\n $sessionData = $_SESSION;\n ini_set('session.use_strict_mode', 0);\n session_id($newSessionId);\n session_start();\n $_SESSION = $sessionData;\n $this->executeSessionIdChangeCallback($oldSessionId, $newSessionId);\n $this->executeGcNotificationCallback(\n $oldSessionId,\n $this->metadata->expireDataAt\n );\n $_COOKIE[$this->getSessionName()] = $newSessionId;\n return $this->initializeSessionMetadata();\n }", "public static function regenerate_sid() {\n\t\t$key = self::generate_sid();\n\t\tdatabase()->start_query('sessions', 'UPDATE')\n\t\t\t->set(array('key' => $key))\n\t\t\t->where(array('key' => self::$sid))\n\t\t\t\t->run();\n\t\tself::setcookie($key);\n\t}", "public function regenerate() {\n $this->startSession();\n try {\n session_regenerate_id(true);\n } catch (\\ErrorException $e) {\n // OK as this will occur in testing\n }\n\n $this->sessionId = session_id();\n session_write_close();\n\n return $this->sessionId;\n }", "public function refresh()\n {\n session_regenerate_id(true);\n }", "public function regenerateId($deleteSession = false) {\n \n $this->start();\n session_regenerate_id($deleteSession);\n \n }", "public function iniciar() {\r\n session_regenerate_id();\r\n }", "public function regenerate($clearData = false) {\n\t\t\t$this->set(\"id\", session_regenerate_id($clearData));\n\t\t}", "protected function regenerate()\n {\n $hash_chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n $hash = \"\";\n\n $exists = true;\n $sessions_tbl = $this->db->query('SELECT hash FROM sessions');\n $sessions = array();\n while($row = $sessions_tbl->fetchArray()) {\n $sessions[] = $row['hash'];\n }\n\n while($exists) {\n for($i = 0; $i < 64; $i++) {\n $r = rand(0, strlen($hash_chars) - 1);\n $hash.= $hash_chars[$r];\n }\n\n $exists = in_array($hash, $sessions);\n }\n\n self::$sid = $this->db->escapeString($hash);\n $sql = 'INSERT INTO sessions(hash, timestamp) VALUES(\"'.self::$sid.'\", \"'.time().'\")';\n $this->db->exec($sql);\n setcookie('PHPFASTSESSID', self::$sid, time() + $this->max_age);\n }", "function regenerate_session ($session_id = '')\n {\n\n //Regenerate the Session, normally to set new expiry time for cookie\n //\n //You may specify \"NEW\" in the function to generate a new Session ID.\n //Leave it blank to regenerate the sesion with the SAME ID.\n\n //Copy their current session information and session ID\n $saved_session_info = $_SESSION;\n $saved_session_id = session_id();\n\n //Destory the current Session (and cookie) using our function\n $this->sess_destroy();\n\n //Ensure we have the default defaults for the session name and the current Session Length\n session_name($this->sess_name);\n ini_set('session.cookie_lifetime', $this->sess_length);\n\n //Check if we need to generate a new Session ID, define the Session ID or leave the current Session ID in tact.\n if ($session_id === '' OR $session_id === NULL) {\n //Session ID is blank, give them their old Session ID\n session_id($saved_session_id);\n } elseif (strtoupper($session_id == 'NEW')) {\n //Update the current session ID with a newly generate one\n session_regenerate_id();\n } else {\n //Session ID is defined by calling function, declare the Session ID\n session_id($session_id);\n }\n\n //Restart the Session\n session_start();\n\n //Load back our saved session data\n $_SESSION = $saved_session_info;\n\n //Unload our saved data\n unset ($saved_session_info);\n unset ($saved_session_id);\n }", "public function regenerateId()\n {\n $this->start();\n if (! headers_sent()) {\n $this->_manager->regenerateId();\n }\n }", "public function updateId() {\n $this->Id = session_id();\n }", "public function regenerateID($deleteOldSession = false)\n {\n if ($this->getIsActive()) {\n @session_regenerate_id($deleteOldSession);\n }\n }", "private function regenerateSessionId(){\n\t\tif( !$this->isAuth() ){\n\t\t\treturn false;\n\t\t}\n\n\t\t$sql = 'UPDATE `users`\n\t\t\t\tSET `session_id` = :session_id\n\t\t\t\tWHERE `id` = :user_id\n\t\t\t\tLIMIT 1';\n\n\t\tsession_regenerate_id( true );\n\t\t$sessionId = session_id();\n\t\t$userId = $this->getId();\n\n\t\t$stmt = $this->pdo->prepare( $sql );\n\t\t$stmt->bindParam(':user_id', $userId, PDO::PARAM_INT );\n\t\t$stmt->bindParam(':session_id', $sessionId, PDO::PARAM_STR);\n\n\t\treturn $stmt->execute();\n\t}", "private function generateSessionID() {\n $sid = \"\";\n do $sid = bin2hex(openssl_random_pseudo_bytes(SESSION_ID_SIZE));\n while ($this->memcache->get(PREFIX_SESSION.$this->sessionID) !== false);\n return $sid;\n }", "public function generateId()\n {\n $session_id = $this->request->param($this->sid_key, '');\n $_session_id = explode('-',$session_id ? xn_decrypt($session_id):'');\n $this->ip = isset($this->request->server['REMOTE_ADDR'])?$this->request->server['REMOTE_ADDR']:'127.0.0.1';\n $this->useragent = isset($this->request->server['USER-AGENT'])? md5($this->request->server['USER-AGENT']):'';\n $this->sid = ($_session_id[2]&&$this->useragent==$_session_id[1]) ? $_session_id[2] : get_uniqid(32);\n $this->sess_key = $_session_id[2]==$this->sid ? $session_id : xn_encrypt(getut().'-'.$this->useragent.'-'.$this->sid.'-'.$this->ip);\n }", "public static function regenerate($deleteOldSession = false)\n {\n session_regenerate_id($deleteOldSession);\n }", "function regeneratesession() {\n if(isset($_SESSION['OBSOLETE']) || $_SESSION['OBSOLETE'] == true)\n return;\n\n // Set current session to expire in 10 seconds\n $_SESSION['OBSOLETE'] = true;\n $_SESSION['EXPIRES'] = time() + 10;\n\n // Create new session without destroying the old one\n session_regenerate_id(false);\n\n // Grab current session ID and close both sessions to allow other scripts to use them\n $newSession = session_id();\n session_write_close();\n\n // Set session ID to the new one, and start it back up again\n session_id($newSession);\n if (session_status() == PHP_SESSION_NONE ) { session_start(); }; // recommended way for versions of PHP >= 5.4.0\n\n // Now we unset the obsolete and expiration values for the session we want to keep\n unset($_SESSION['OBSOLETE']);\n unset($_SESSION['EXPIRES']);\n}", "private function regenerate_ci_session_id() {\n // This is targeting a native CodeIgniter cookie, not an auth cookie.\n $ci_session = array(\n 'name' => $this->config->item('sess_cookie_name'),\n 'value' => '',\n 'expire' => ''\n );\n set_cookie($ci_session);\n }", "public function regenerateId();", "public function regenerateId();", "function generateNewId(){\n\t\t$id = null;\n\t\t//while ( $this->getSessionData($id) !== null ){\n\t\t\t$id = rand(0,100000);\n\t\t//}\n\t\treturn $id;\n\t}", "public function regenerateId($deleteOldSession = false)\n\t{\n\t\treturn session_regenerate_id($deleteOldSession);\n\t}", "protected function generateSessionId()\n\t{\n\t\t//\\Log::info('custom session id created');\n\t\t//return sha1(uniqid('', true).Str::random(25).microtime(true));\n\n\n\t\t// use our own ID generation mechanism\n\t\t$id_hash = str_random(64);\n\n\t\treturn $id_hash;\n\n\t}", "public function regenerate() {\n if (session_regenerate_id(true)) {\n $this->updateId();\n return true;\n }\n else throw new Mexception('Unable to regenerate Session');\n }", "public static function regenerateId($shouldDeleteOld = false) {\n $newSessionId = session_regenerate_id($shouldDeleteOld);\n if ($newSessionId) {\n Logger::getLogger()->LogDebug(\"Session ID regenerated, New Session ID: \". $newSessionId);\n }\n return $newSessionId;\n }", "private function renewSession() {}", "public function regenerateSession(){\n $authToken=$_COOKIE[self::COOKIENAME];\n if ($authToken){\n $authToken=base64_decode($authToken);\n $iv = substr($authToken,0,self::IVLEN);\n $crypted = substr($authToken,self::IVLEN);\n $token = openssl_decrypt($crypted, self::ALG, self::AESKEY,OPENSSL_RAW_DATA,$iv);\n if ($token===false){\n $this->__destruct();\n die('Decryption error');\n }\n\t $token = json_decode($token,true);\n\t $username=$token[\"loggedUser\"];\n\t // shoutout error if decryption failed\n\n // if user exists in backend storage\n if ($this->userExists($username)){\n $this->loggedUser=$username;\n $this->authToken=$_COOKIE[self::COOKIENAME];\n // reset cookie (to set new expiration date)\n $this->setAuthCookie();\n }\n else\n // logout if user does not exists in backend storage\n $this->logOut();\n }\n // no cookie - logout\n else $this->logOut();\n }", "public function regenerateId(): self;", "public function refresh()\n {\n $sess = $this->_di->get('Input')->getAll('session');\n $id = session_regenerate_id(true);\n session_destroy();\n session_start();\n $_SESSION = $sess;\n }", "protected function generateSessionToken() {}", "public function restart()\n {\n session_regenerate_id(true);\n $this->setup();\n }", "public static function reset(){\n\t\t\t$old = session_id();\n\t\t\tif($old){\n\t\t\t\tif(isset($_COOKIE[session_name()])){\n\t\t\t\t\tset_cookie(session_name(), '', time() - 86400, '/');\n\t\t\t\t}\n\n\t\t\t\tsession_regenerate_id(true);\n\t\t\t\tSession::$id = session_id();\n\t\t\t}\n\t\t}", "protected function calculateSessionId()\n {\n return substr(md5(uniqid()), 0, 26);\n }", "public function regenerate()\n {\n session_regenerate_id(true);\n session_write_close();\n\n if (isset($_SESSION)) {\n $backup = $_SESSION;\n session_start();\n $_SESSION = $backup;\n } else {\n session_start();\n }\n\n\n $this->storage = & $_SESSION;\n\n return $this;\n }", "function generateSessionKey(){\n\t\t // genereate session and form key\n\t\t$this->formSession['key'] = rand();\n\t\t$GLOBALS[\"TSFE\"]->fe_user->setKey('ses',$this->extKey, $this->formSession);\n\t\t$GLOBALS[\"TSFE\"]->storeSessionData();\n\t}", "public static function generate(){\r\n return Session::put(Config::get('session/token_name'), md5(uniqid()));\r\n }", "static function generateSessionID($userid, $start_time) {\n\t\t$new_session_id = md5 ( $userid . $_SERVER ['HTTP_USER_AGENT'] . self::$salt . $_SERVER ['REMOTE_ADDR'] . $start_time );\n\t\treturn $new_session_id;\n\t}", "public function regenerateId() {\n if (!$this->id_regenerated) {\n $this->getStorage()->destroy($this->getId());\n $this->getIdHandler()->generateId();\n\n $this->regeneration_trace = time();\n $this->id_regenerated = true;\n\n return true;\n }\n\n return false;\n }", "private function getSessionId()\r\n\t{\r\n\t\t$sessionId = mt_rand(5,20);\r\n\t\t$this->sessionId = $sessionId;\r\n\t\treturn $sessionId;\r\n\t}", "public static function generate(){\n\t\treturn Session::put(Config::get('session/token_name'), md5(uniqid()));\t\t// Now we build the session class to utilis this method.\n\t}", "public function regenerateToken()\n {\n // don't do anything for destroyed sessions\n if ($this->destroyed === true) {\n return;\n }\n\n $this->prepareForWriting();\n\n // generate new token\n $tokenExpiry = $this->expiryTime;\n $tokenId = $this->sessions->store()->createId($tokenExpiry);\n $tokenKey = bin2hex(random_bytes(32));\n\n // mark the old session as moved if there is one\n if ($this->tokenExpiry !== null) {\n $this->newSession = $tokenExpiry . '.' . $tokenId;\n $this->commit();\n\n // we are now in the context of the new session\n $this->newSession = null;\n }\n\n // set new data as instance vars\n $this->tokenExpiry = $tokenExpiry;\n $this->tokenId = $tokenId;\n $this->tokenKey = $tokenKey;\n\n // the new session needs to be written for the first time\n $this->writeMode = true;\n\n // (re)transmit session token\n if ($this->mode === 'cookie') {\n Cookie::set($this->sessions->cookieName(), $this->token(), [\n 'lifetime' => $this->tokenExpiry,\n 'path' => Url::index(['host' => null, 'trailingSlash' => true]),\n 'secure' => Url::scheme() === 'https',\n 'httpOnly' => true,\n 'sameSite' => 'Lax'\n ]);\n } else {\n $this->needsRetransmission = true;\n }\n\n // update cache of the Sessions instance with the new token\n $this->sessions->updateCache($this);\n }", "public function regenerateToken();", "function resetSession(){\t\t\n\t\t$roomid = (int)$_POST['roomid'];\n\t\tif($roomid < 0){ throw new Exception('Invalid player');}\n\t\t@mt_srand();\n\t\t$newSession = @mt_rand(0,99999999999);\n\t\tglobal $db;\n\t\t$q = $db -> prepare(\"UPDATE game SET sessionid = ? WHERE roomid = ?\");\n\t\t$q->execute(array($newSession,$roomid));\n\t\t// Return the new game session\n\t\treturn $newSession;\n\t}", "public function newSessionId ($uid) {\n $this->sessionId = hash('sha256', time() . $uid . 'OldSalts');\n return $this->sessionId;\n }", "private function regenerateSessionId(bool $ignoreUserTable = false): void\n {\n $oldSessionId = session_id();\n\n if ($this->eventManager->notifyUntil(\n 'Shopware_Modules_Admin_regenerateSessionId_Start',\n ['subject' => $this, 'sessionId' => $oldSessionId]\n )) {\n return;\n }\n\n session_regenerate_id(true);\n $newSessionId = session_id();\n\n // Close and restart session to make sure the db session handler writes updates.\n session_write_close();\n session_start();\n\n $this->sSYSTEM->sSESSION_ID = $newSessionId;\n $this->session->offsetSet('sessionId', $newSessionId);\n Shopware()->Container()->reset('SessionId');\n Shopware()->Container()->set('SessionId', $newSessionId);\n\n $this->eventManager->notify(\n 'Shopware_Modules_Admin_Regenerate_Session_Id',\n [\n 'subject' => $this,\n 'oldSessionId' => $oldSessionId,\n 'newSessionId' => $newSessionId,\n ]\n );\n\n $sessions = [\n 's_order_basket' => 'sessionID',\n 's_order_comparisons' => 'sessionID',\n ];\n\n if (!$ignoreUserTable) {\n $sessions['s_user'] = 'sessionID';\n }\n\n foreach ($sessions as $tableName => $column) {\n $this->db->update(\n $tableName,\n [$column => $newSessionId],\n $column . ' = ' . $this->db->quote($oldSessionId)\n );\n }\n }", "public function get_session_id()\n {\n }", "function sess_id()\n {\n return session_id();\n }", "public function regenerateId(bool $deleteOldSession = false) : bool\n {\n $regenerated = \\session_regenerate_id($deleteOldSession);\n if ($regenerated) {\n $_SESSION['$']['regenerated_at'] = \\time();\n }\n return $regenerated;\n }", "public function regenerate_session($args_session,$args_fingerprint){\n\t\t\t\n\t\t\t//$_SESSION['fingerprint'] = md5($_SERVER['HTTP_USER_AGENT'].$_SERVER['REMOTE_ADDR']);\n\t\t\tif(isset($args_session))\n\t\t\t{\n\t\t\t\tif($args_fingerprint != md5($_SERVER['HTTP_USER_AGENT'].$_SERVER['REMOTE_ADDR']))\n\t\t\t\t\treturn false;\n\t\t\t\telse\n\t\t\t\t\treturn session_regenerate_id();\n\t\t\t}\n\n\t\t}", "protected function set_session_id() {\n $this->sessionid = static::$sessionidmockup;\n }", "public function createSessionId() {}", "protected function _getId ()\n {\n return session_id();\n }", "function put_id() {\n \n if($this->name == \"\") {\n $this->name = $this->classname;\n }\n \n // if we stop using the session id- we should remove the session id from\n // the current QUERYSTRING/ or the HTTP_GET_VARS ????\n die(\"This has not been coded yet.\");\n }", "private function restart() {\n session_start();\n session_regenerate_id();\n session_destroy();\n session_commit();\n session_start();\n $this->setUserAgent();\n $this->setRemoteAddress();\n }", "function db_pwassist_create_id()\n{\n\t// Implementation note: we use the PHP Session id\n\t// generation mechanism to create the session id.\n\t$old_session_id = session_id();\n\tsession_regenerate_id();\n\t$pwassist_id = session_id();\n\tsession_id($old_session_id);\n\n\treturn $pwassist_id;\n}", "private function sessionId()\n\t{\n\t\treturn md5(sha1(sha1(microtime() . rand(1111111, 9999999))));\n\t}", "function newId() {\n $this->log .= \"newId() called<br />\";\n $this->id = sha1(uniqid(rand(), true));\n $this->filename = $this->dir.\"sid_\".$this->id;\n if (!setcookie('sid' ,$this->id, null, \"/\", $this->domain_cookie)) {\n $this->log .= \"sid cookie save failed. This may be due to browser output started prior or the user has disabled cookies.<br />\";\n return false;\n }\n return true;\n }", "private function session_id()\r\n {\r\n return md5(__FILE__ . \"_\" . $_SERVER[\"HTTP_HOST\"]);\r\n }", "public function regenerateSessionAuthToken(): bool;", "static public function regenerate(){\n \t$_SESSION['TFUser'] = self::$_instance = new TFUserM(array('id'=>self::$_id,'debug'=>self::isDebug()));\n }", "function recurringdowntime_generate_sid()\n{\n return md5(uniqid(microtime()));\n}", "public static function regenerateId(bool $deleteOldSession=false):bool {\n\t\treturn self::$sessionInstance->regenerateId($deleteOldSession);\n\t}", "function newId() {\r\n\t\t$this->log .= \"newId() called<br />\";\r\n\t\t$this->id = md5(uniqid(rand(), true));\r\n\t\t$this->filename = $this->dir.\"sid_\".$this->id;\r\n\t\tif (!setcookie('sid' ,$this->id, null, \"/\")) {\r\n\t\t\t$this->log .= \"sid cookie save failed. This may be due to browser\"\r\n\t\t\t.\" output started prior or the user has disabled cookies.<br />\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\treturn true;\r\n\t}", "function _generate()\n\t{\n\t\t$username = $this->CI->session->userdata('username');\n\t\t\n\t\t$token_source = fopen(\"http://random.org/strings/?num=1&len=20&digits=on&upperalpha=on&loweralpha=on&unique=on&format=plain&rnd=new\", \"r\");\n\t\t$token = fread($token_source, 20);\n\t\t\n\t\t$identifier = $username . $token;\n\t\t$identifier = $this->_salt($identifier);\n\t\t\n\t\t$this->CI->db->query(\"UPDATE `users` SET `identifier` = '$identifier', `token` = '$token' WHERE `username` = '$username'\");\n\t\t\n\t\tsetcookie(\"logged_in\", $identifier, time()+3600, '/');\n\t}", "private function createSession()\n {\n session_regenerate_id(TRUE);\n $this->session = array();\n $this->session['legit'] = $this->sessionHash();\n $this->session['id'] = $this->userId;\n if (!$this->userId) {\n $this->voidCookie();\n }\n }", "static public function generateSID() {\n\t\treturn md5( $_SERVER['HTTP_USER_AGENT'] + $_SERVER['REMOTE_ADDR'] + time() + rand() );\n\t}", "public static function generateNewCSRFToken () {\n\t\tself::$csrf_token = base64_encode( openssl_random_pseudo_bytes(32));\n\n\t\t$_SESSION['csrf_token'] = self::$csrf_token;\n\t}", "public function getSessionID();", "function getNewId();", "private static function generateSessionId(){\n\t\treturn sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\t\t// 32 bits for \"time_low\"\n\t\t\tmt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),\n\n\t\t\t// 16 bits for \"time_mid\"\n\t\t\tmt_rand( 0, 0xffff ),\n\n\t\t\t// 16 bits for \"time_hi_and_version\",\n\t\t\t// four most significant bits holds version number 4\n\t\t\tmt_rand( 0, 0x0fff ) | 0x4000,\n\n\t\t\t// 16 bits, 8 bits for \"clk_seq_hi_res\",\n\t\t\t// 8 bits for \"clk_seq_low\",\n\t\t\t// two most significant bits holds zero and one for variant DCE1.1\n\t\t\tmt_rand( 0, 0x3fff ) | 0x8000,\n\n\t\t\t// 48 bits for \"node\"\n\t\t\tmt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )\n\t\t);\n\t}", "final function setSession_id($value) {\n\t\treturn $this->setSessionId($value);\n\t}", "function MyApp_Session_SID_New()\n {\n $this->MyApp_Session_SID_User_Deletes($this->LoginData[ \"ID\" ]);\n $this->Authenticated=TRUE;\n\n $sid=rand().rand().rand();\n $time=time();\n $this->Session=array\n (\n \"SID\" => $sid,\n \"LoginID\" => $this->LoginData[ \"ID\" ],\n \"Login\" => $this->LoginData[ \"Login\" ],\n \"LoginName\" => $this->LoginData[ \"Name\" ],\n \"CTime\" => $time,\n \"ATime\" => $time,\n \"IP\" => $_SERVER[ \"REMOTE_ADDR\" ],\n \"Authenticated\" => 2,\n \"LastAuthenticationAttempt\" => $time,\n \"LastAuthenticationSuccess\" => $time,\n \"NAuthenticationAttempts\" => 0,\n );\n\n $this->MySqlInsertItem($this->GetSessionsTable(),$this->Session);\n $this->SetCookie(\"SID\",$sid,$time+$this->CookieTTL);\n\n return $sid;\n }", "public function Refresh ()\n\t{\n\t\t\n\t\t// Refresh session\n\t\t\n\t\tsession_unset ();\n\t\tsession_regenerate_id ();\n\t\t\n\t}", "function token_generator() {\n $token = $_SESSION['token'] = md5(uniqid(mt_rand(),true));\n\n return $token;\n}", "private static function generateToken()\n {\n Session::set('csrf', bin2hex(random_bytes(32)));\n }", "function generateRandID(){\n\t\t$userid = $this->getPasswordSalt();\n\t\treturn hash('sha256',$userid);\n\t}", "public static function generateToken()\r\n {\r\n $_SESSION['CSRF_TOKEN'] = bin2hex(openssl_random_pseudo_bytes(32));\r\n }", "private function generateId() {\n $this->setId(AgaviToolkit::uniqid(\"ldap_conn_\"));\n }", "public static function getSessionid();", "private function _set_new_session_id($id) {\n\t\t$this->_session_config['_started_session_id'] = $id;\n\t\tZamp::$core->_config['session_settings']['_started_session_id'] = $id;\n\t}", "public static function generate() \n{\n // set the `$tokenKey variable` by calling `get method` on `Config object`\n $tokenKey = Config::get('session.tokenKey');\n \n\n /* uniqid() - generates a unique ID based on the microtime (the current time in microseconds).\n Returns the unique identifier, as a string.\n Parametrs: 2 Optional parametrs.\n https://www.w3schools.com/php/func_misc_uniqid.asp */\n $random_string = uniqid();\n\n /* md5 — Calculate the md5 hash of a string\n Returns the calculated MD5 hash on success, or FALSE on failure\n Parametrs:\n 1) string\tRequired. The string to be calculated\n 2) raw\tOptional. Specifies hex or binary output format:\n TRUE - Raw 16 character binary format\n FALSE - Default. 32 character hex number\n https://www.w3schools.com/php/func_string_md5.asp */\n $token = md5($random_string);\n\n // add new element in the $_SESSION[] array\n return Session::put($tokenKey, $token);\n}", "protected function get_user_id() {\n session_start();\n \n return session_id();\n }", "public function refreshSession() {}", "public function generateToken(){\n //if(empty($_SESSION['token']) && (empty($_SESSION['tokenAge']) || (time() - (int)$_SESSION['tokenAge']) > (int)$this->maxAge)){\n if(function_exists('random_bytes')){\n $_SESSION['token'] = bin2hex(random_bytes(32));\n }elseif(function_exists('mcrypt_create_iv')){\n $_SESSION['token'] = bin2hex(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM));\n }else{\n $_SESSION['token'] = bin2hex(openssl_random_pseudo_bytes(32));\n }\n $_SESSION['tokenAge'] = time();\n //} \n }", "public function newId()\n {\n return md5(microtime());\n }", "static function resetSession($full=false,$regenSessionId=false){\r\n\t\tif( $full ){\r\n\t\t\t$_SESSION = array();\r\n\t\t}else{\r\n\t\t\tunset($_SESSION['moduser']);\r\n\t\t}\r\n\t\tif( $regenSessionId ){\r\n\t\t\tsession_regenerate_id(true);\r\n\t\t}\r\n\t}", "function startSessionLoged() {\n $this->session->set_ini(); //call ini_set. must be called in every script cause it doesnt remain!\n $this->session->regenerate(); //regenerate the session id\n $this->session->generateTokenId($this->connection,$this->user->getUsrID()); //return the tokenId \n $this->session->initiate($this->user->getKeepMeLogged()); //set values for ip, agent... confirmation\n $this->session->initiateToken($this->session->getToken(), $this->user->getUsrID());\n $this->session->setExpiration(); //set the expiration of idle session\n $this->session->setCookie(); //secure the session cookie\n $this->session->wClose();\n\n }", "public function getSessionId() {\n $this->_session_id = $this->pub_session_id;\n return $this->pub_session_id;\n }", "protected function getSessionId()\n {\n return \\Session::getId();\n }", "function generate_token()\n {\n $this->load->helper('security');\n $res = do_hash(time().mt_rand());\n $new_key = substr($res,0,config_item('rest_key_length'));\n return $new_key;\n }" ]
[ "0.9127247", "0.8984063", "0.88593847", "0.87534565", "0.87534565", "0.86497074", "0.8573799", "0.852764", "0.8477711", "0.8449003", "0.8280777", "0.8136426", "0.80479693", "0.80328923", "0.7853125", "0.78444946", "0.7800391", "0.76621187", "0.7533291", "0.74762005", "0.74727243", "0.7471388", "0.74117386", "0.7394043", "0.7390225", "0.72437024", "0.7214478", "0.7184036", "0.71807253", "0.71807253", "0.7172667", "0.71638167", "0.70966506", "0.70891184", "0.7088939", "0.7019236", "0.69639456", "0.69402057", "0.6913939", "0.6892164", "0.68683094", "0.6861726", "0.6858978", "0.6812676", "0.6803193", "0.6791785", "0.6710894", "0.66994613", "0.66718507", "0.6647271", "0.66338104", "0.66120017", "0.65937287", "0.65838414", "0.6571857", "0.6566978", "0.65571046", "0.6556383", "0.6551285", "0.6538429", "0.6537943", "0.6514572", "0.64792436", "0.64757353", "0.643978", "0.6394867", "0.6394029", "0.6391249", "0.63877976", "0.6345623", "0.6338576", "0.63380283", "0.63376284", "0.6327028", "0.6314111", "0.6303255", "0.6272611", "0.6231705", "0.6230081", "0.62245107", "0.62170744", "0.6202331", "0.6197544", "0.61907506", "0.61795413", "0.6177163", "0.61684465", "0.6167156", "0.6143037", "0.61327726", "0.612238", "0.60880095", "0.60869205", "0.60849524", "0.6069778", "0.60298", "0.60282093", "0.602278", "0.60191566", "0.60153186" ]
0.7170564
31
Make sure the session hasn't been hijacked
function checkSession() { if(sha1(md5($_SERVER['REMOTE_ADDR'].'ahsh').md5($_SERVER['HTTP_USER_AGENT'].'afke')) != @$_SESSION['fingerprint']) { Flash::create('Session check failed'); return false; } if(mt_rand(1, 20) == 1) { regenerateSession(); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function avoidSessionHijacking()\n\t{\n\t\t// TODO\n\t}", "protected function checkSessionLifetime() {}", "public function verifySessionIntegrity() {\n if (!$this->isValidSession()) {\n $this->end();\n $this->restart();\n }\n }", "private function preventSessionHijack() {\n if (isset($_SESSION[\"browser\"]) && isset($_SESSION[\\model\\UserModel::$sessionUser]) && $_SESSION[\\model\\UserModel::$sessionUser][\\model\\UserModel::$userLoggedIn]) {\n $this->user = new \\model\\UserModel($_SESSION[\\model\\UserModel::$sessionUser][\\model\\UserModel::$userName]);\n if ($_SESSION[\"browser\"] !== $_SERVER['HTTP_USER_AGENT']) {\n $this->user->logout();\n $this->loginView->deleteCookies();\n }\n }\n }", "protected function handleSessionLifeTimeExpired() {}", "protected function handleSessionLifeTimeExpired() {}", "private function check()\n\t{\n\t\tif (!session_id())\n\t\t{\n\t\t\tsession_start();\n\t\t}\n\t}", "protected function checkSessionToken() {}", "public static function unknownSessionCreation() {\n if(!isset($_SESSION[self::PHP_LABEL_NOT_LOGGED_TOKEN])) {\n $_SESSION[self::PHP_LABEL_NOT_LOGGED_TOKEN] = hash('sha256', uniqid(rand(), true));\n $_SESSION[self::PHP_LABEL_LAST_TIMESTAMP] = date('Y-m-d H:i:s');\n }\n }", "protected function fixLifetime()\n {\n Config::set('session.expire_on_close', true);\n }", "protected function sessionInitialized()\n {\n parent::sessionInitialized();\n if ($this->cacheLimitersEnabled) {\n $this->response->addHeader('Expires', 'Thu, 19 Nov 1981 08:52:00 GMT');\n $this->response->addHeader(\n 'Cache-Control',\n 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0'\n );\n $this->response->addHeader('Pragma', 'no-cache');\n }\n }", "protected function ensureSession()\r\n\t{\r\n\t\t// grab a new session if none exists or last one expired\r\n\t\t\r\n\t\tif ( $this->session == null || time() > $this->session_expires )\r\n\t\t{\r\n\t\t\t$this->session = $this->getSession();\r\n\t\t\t$this->session_expires = time() + 1200;\r\n\t\t}\t\t\r\n\t}", "private function renewSession() {}", "private function setExpiringSession()\n {\n $now = new Chronos();\n if ($this->session->get('createdAt') === '') {\n $this->session->saveForced('createdAt', $now->toDateTimeString());\n }\n\n $sessionCreatedAt = $this->session->get('createdAt');\n $expired = new Chronos($sessionCreatedAt);\n $expired = $expired->addSeconds($this->expiringTime);\n\n if ($expired->lte($now) && !headers_sent()) {\n $this->destroy();\n }\n }", "function handleSession() {\n\tif(!isset($GLOBALS[\"cacheLimiter\"]))\n\t\t$GLOBALS[\"cacheLimiter\"] = CACHE_LIMITER;\n\tsession_cache_expire($GLOBALS[\"cacheLimiter\"]);\n\tsession_cache_expire(CACHE_TIMEOUT);\n\tsession_start();\n\tif(hasSessionTimedOut())\n\t logout(true);\n else\n \trefreshSession();\n\tif(shouldRestoreRedirectVars()) {\n\t\trestoreRedirectVars();\n\t}\n}", "public function sessionDummy()\n {\n return true;\n }", "function checkLogin() {\n\t\t$fingerprint = fingerprint();\n\t\tsession_start();\n\t\tif (!isset($_SESSION['log_user']) || $_SESSION['log_fingerprint'] != $fingerprint) logout();\n\t\tsession_regenerate_id();\n\t}", "public function resetSession() {}", "function checkSession()\r\n {\r\n if (!$this->Session->check('User'))\r\n {\r\n \t// Force the user to login\r\n $this->redirect('/user/login');\r\n exit();\r\n }\r\n }", "private function csrfWatchdog()\n {\n if (empty($_SESSION['token'])) {\n $_SESSION['token'] = base64_encode(openssl_random_pseudo_bytes(32));\n }\n\n if (!empty($_POST)) {\n if (empty($_POST['csrf_check']) || !hash_equals($_POST['csrf_check'], $_SESSION['token'])) {\n Magneto::error('csrf_violation', 'CSRF Violation');\n }\n }\n }", "public function testInvalidSessionHandling() {\n\t\t$session = $this->getSession('nonexistent');\n\t\t$session->loadSession();\n\t\t$this->assertNotEquals('nonexistent', $session->getId(), 'The session ID was not changed');\n\t}", "function startSessionLoged() {\n $this->session->set_ini(); //call ini_set. must be called in every script cause it doesnt remain!\n $this->session->regenerate(); //regenerate the session id\n $this->session->generateTokenId($this->connection,$this->user->getUsrID()); //return the tokenId \n $this->session->initiate($this->user->getKeepMeLogged()); //set values for ip, agent... confirmation\n $this->session->initiateToken($this->session->getToken(), $this->user->getUsrID());\n $this->session->setExpiration(); //set the expiration of idle session\n $this->session->setCookie(); //secure the session cookie\n $this->session->wClose();\n\n }", "function _shutdown()\n {\n $curr_time = time();\n\n if (!isset($_SESSION['__sessionhandler']) ||\n ($curr_time >= $_SESSION['__sessionhandler'])) {\n\n $_SESSION['__sessionhandler'] = $curr_time + (ini_get('session.gc_maxlifetime') / 2);\n $this->_force = true;\n }\n }", "public function verifySession() {\n\t\t$this->reload();\n\t\tif ($this->getSession() == session_id())\n\t\t\treturn true;\n\t\telse {\n\t\t\tif($_SESSION[\"loginUser\"])\n\t\t\t\tunset($_SESSION[\"loginUser\"]);\n\t\t\treturn false;\n\t\t}\n\t}", "public function disableSessionStatusCheck()\n {\n $this->checkForSessionStatus = false;\n }", "public static function flash()\n {\n session_unset();\n $_SESSION = array();\n }", "public function disableSessionStatusCheck() {\n\t\t$this->checkForSessionStatus = false;\n\t}", "public function forgetSession()\n\t{\n\t\tif (isset($_SESSION[$this->getKey()]))\n\t\t{\n\t\t\tunset($_SESSION[$this->getKey()]);\n\t\t}\n\t}", "public static function drop_sessions()\n {\n }", "public static function drop_sessions()\n {\n }", "function checkSession()\n {\n if( !$this->session->userdata( 'logged_in' ) )\n redirect( 'login' );\n\n if ( $this->session->userdata( 'level' ) != 'guidance' )\n redirect( 'standard/unauthorized' );\n }", "private function expiredSession() {\r\n\r\n if (time()>$this->forcedExpire) return true;\r\n else return false;\r\n }", "function session_abort()\n{\n}", "function renren_user_logined() {\n global $RR_config;\n return isset($_COOKIE[$RR_config->APIKey.'_session_key']) || !empty($_COOKIE[$RR_config->APIKey.'_session_key']);\n}", "private function restart() {\n session_start();\n session_regenerate_id();\n session_destroy();\n session_commit();\n session_start();\n $this->setUserAgent();\n $this->setRemoteAddress();\n }", "function payswarm_clear_session_cookie() {\n if(!headers_sent()) {\n global $_SERVER;\n $past = time() - 3600;\n setcookie('payswarm-session', '', $past, '/');\n\n // clear authority host URL cookie as well\n payswarm_clear_authority_host_cookie();\n }\n}", "function HijackCheck() \n{\n if(isset($_POST['submit'])) \n {\n if($_SESSION['PW_CHECKS'] < PW_MAX_CHECKS)\n {\n if(isset($_POST['password'])) \n {\n if(!isset($_SESSION['PW_CHECKS'])) $_SESSION['PW_CHECKS'] = 1;\n if($_SESSION['PW_CHECKS'] <= PW_MAX_CHECKS) \n {\n $_SESSION['PW_CHECKS']++;\n \n // check the password provided, if invalid show the password form again here.\n }\n else \n {\n // reset our session variables.\n unset($_SESSION['UA_CHECKS']);\n unset($_SESSION['HTTP_USER_AGENT']);\n unset($_SESSION['PW_CHECKS']);\n }\n }\n }\n else\n {\n $this->destroy($this->_ses_id);\n }\n }\n \n // check to see if UA_CHECKS is instantiated, if not set it to 0\n if(!isset($_SESSION['UA_CHECKS'])) $_SESSION['UA_CHECKS'] = 0;\n // check to see if the users IP address has been set, if not set it.\n if(!isset($_SESSION['HTTP_USER_AGENT'])) $_SESSION['HTTP_USER_AGENT'] = md5($this->fingerprint.$_SERVER['HTTP_USER_AGENT']);\n \n // check to see if the UA has changed\n if($_SESSION['HTTP_USER_AGENT'] == md5($this->fingerprint.$_SERVER['HTTP_USER_AGENT']))\n {\n $_SESSION['UA_CHECKS']++;\n }\n else\n {\n // Check to see if the UA_CHECKS has been completed UA_THRESHOLD times\n // update the new UserAgent\n if($_SESSION['UA_CHECKS'] >= UA_THRESHOLD) \n {\n // It's not normal for the users UA to change frequently\n $this->validate($pwError);\n }\n else\n {\n unset($_SESSION['UA_CHECKS']);\n unset($_SESSION['HTTP_USER_AGENT']);\n }\n }\n}", "public function reset() : bool\n {\n return \\session_reset();\n }", "public static function sessionCleanHandler();", "function checkSession() \n {\n if (!$this->Session->check('User')) \n { \n // Force the user to login \n $this->redirect('/homes'); \n exit(); \n } \n }", "private function check_session()\n\t{\n\t\tif(isset($_SESSION['admin_id']))\n\t\t{\n\t\t\t/* \n\t\t\tTODO: check double device login\n\t\t\t*/\n\t\t}\n\t\telse if(isset($_SESSION['login_id']))\n\t\t{\n\t\t\tredirect(base_url() . 'contestant');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tredirect(base_url());\n\t\t}\n\t}", "public function hasSession() {}", "function refill($session){\r\n\t\tif (!empty($_SESSION[$session])) {\r\n\t\t\techo $_SESSION[$session];\r\n\t\t\tunset($_SESSION[$session]);\r\n\t\t}\r\n\t}", "public function expireSession()\n\t{\n\t\t// TODO\n\t}", "public function regenerateSessionAuthToken(): bool;", "public function removeNoTutorsFoundSession()\n {\n if (!empty(Yii::$app->session)) {\n Yii::$app->session->remove(static::SESSION_KEY_NO_TUTORS);\n }\n }", "function sys_session_test(){\n session_name(\"MELOLSESSION\");\n session_start();\n if (isset($_SESSION[\"userId\"]) && isset($_SESSION[\"sessionId\"]) && isset($_REQUEST[\"sessionId\"])) {\n if ($_SESSION[\"sessionId\"] == $_REQUEST[\"sessionId\"]) {\n return TRUE;\n }\n }\n return FALSE;\n}", "function delete_error_without_signing_out(){\n\t$_SESSION[\"error\"] = null;\n}", "function clean_session() {\n\t tep_session_unregister('enroll_lookup_attempted');\n\t tep_session_unregister('authentication_attempted');\n\t tep_session_unregister('transactionId');\n\t tep_session_unregister('enrolled');\n\t tep_session_unregister('acsURL');\n\t tep_session_unregister('payload');\n\t tep_session_unregister('auth_status');\n\t tep_session_unregister('sig_status');\n\t tep_session_unregister('auth_xid');\n\t tep_session_unregister('auth_cavv');\n\t tep_session_unregister('auth_eci');\n\t}", "function register_session(){\n if( !session_id() && session_status() != PHP_SESSION_ACTIVE && ! headers_sent() )\n session_start();\n}", "private function resyncSessionIfNecessary() {\n if ($this->isLoggedIn()) {\n // the following session field may not have been initialized for sessions that had already existed before the introduction of this feature\n if (!isset($_SESSION[self::SESSION_FIELD_LAST_RESYNC])) {\n $_SESSION[self::SESSION_FIELD_LAST_RESYNC] = 0;\n }\n\n // if it's time for resynchronization\n if (($_SESSION[self::SESSION_FIELD_LAST_RESYNC] + $this->sessionResyncInterval) <= \\time()) {\n // fetch the authoritative data from the database again\n $authoritativeData = $this->CI->db\n ->query('SELECT email, username, status, roles_mask, force_logout\n FROM ' . $this->makeTableName('users')\n . ' WHERE id = ?',\n [ $this->getUserId() ]\n )\n ->row_array();\n\n // if the user's data has been found\n if (!empty($authoritativeData)) {\n // the following session field may not have been initialized for sessions that had already existed before the introduction of this feature\n if (!isset($_SESSION[self::SESSION_FIELD_FORCE_LOGOUT])) {\n $_SESSION[self::SESSION_FIELD_FORCE_LOGOUT] = 0;\n }\n\n // if the counter that keeps track of forced logouts has been incremented\n if ($authoritativeData['force_logout'] > $_SESSION[self::SESSION_FIELD_FORCE_LOGOUT]) {\n // the user must be signed out\n $this->logOut();\n }\n // if the counter that keeps track of forced logouts has remained unchanged\n else {\n // the session data needs to be updated\n $_SESSION[self::SESSION_FIELD_EMAIL] = $authoritativeData['email'];\n $_SESSION[self::SESSION_FIELD_USERNAME] = $authoritativeData['username'];\n $_SESSION[self::SESSION_FIELD_STATUS] = (int) $authoritativeData['status'];\n $_SESSION[self::SESSION_FIELD_ROLES] = (int) $authoritativeData['roles_mask'];\n\n // remember that we've just performed the required resynchronization\n $_SESSION[self::SESSION_FIELD_LAST_RESYNC] = \\time();\n }\n }\n // if no data has been found for the user\n else {\n // their account may have been deleted so they should be signed out\n $this->logOut();\n }\n }\n }\n }", "abstract public function resetSession();", "protected function _expireAjax() {\n if (!Mage::getSingleton('checkout/session')->getQuote()->hasItems()) {\n $this->getResponse()->setHeader('HTTP/1.1', '403 Session Expired');\n exit;\n }\n }", "private function aim() {\n\t\t# The class pretends to use the session for storing the\n\t\t# permanent memory of one application\n\t\t# wheteher it does or doesn't a log in to execute it.\n\t\t# It has two ways of make the logout:\n\t\t#\ta) The logout is performed by calling to a website from\n\t\t#\t\twhich yhe user will need to login again to come back\n\t\t#\t\tinside the app.\n\t\t#\tb) The logout is performed changing to the anonymous user\n\t\t#\t\tand accessing to the places suitable for that user.\n\t}", "function _RegenerateId()\n {\n if ($this->regenerate_id && function_exists('session_regenerate_id')) {\n if (version_compare('5.1.0', phpversion(), '>=')) {\n //session_regenerate_id(true);\n } else {\n \t//session_regenerate_id();\n }\n }\n }", "function session_reset_custom() {\n\t$nonce = !empty($_SESSION['nonce']) ? $_SESSION['nonce'] : '';\n\t$loggedin = !empty($_SESSION['loggedin']) ? $_SESSION['loggedin'] : '';\n\t$user_id = $loggedin = !empty($_SESSION['user_id']) ? $_SESSION['user_id'] : '';\n\t$_SESSION = array(\n\t\t'loggedin' => $loggedin,\n\t\t'nonce' => $nonce,\n\t\t'user_id' => $user_id\n\t);\n}", "public function cookies_validate(){\n\t\t\t\n\t\t\tini_set('session.cookie_httponly', true); \n\t\t\theader( 'Expires: Thu, 26 Dec 2012 11:00:00 GMT' ); \n\t\t\theader( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );\n\t\t\theader( 'Cache-Control: private' ); \n\t\t\theader( 'Cache-Control: no-store, no-cache, must-revalidate' ); \n\t\t\theader( 'Cache-Control: post-check=0, pre-check=0', false ); \n\t\t\theader( 'Pragma: no-cache' ); \n\n\t\t}", "public function controlSession(){\n $session = $_SESSION['wifiGuardSharingEmail'];\n $sessionID = $_SESSION[\"wifiGuardSharingID\"];\n $uri = $_SERVER['REQUEST_URI'];\n \n if(!empty($session) && !empty($sessionID)){\n $result = dibi::query('SELECT sessionID\n FROM [user]\n WHERE [email] = %s', $session, 'LIMIT 1');\n $databaseSessionID = $result->fetchSingle();\n \n //if user is in index.php with valid session\n if (preg_match(\"/index.php/\",$uri) && $databaseSessionID===$sessionID){\n parent::redirection(\"app.php?page=showrecord\");\n }\n //if user try load app.php with invalid session\n elseif (preg_match(\"/app.php/\",$uri) && $databaseSessionID!==$sessionID){\n parent::redirection(\"index.php\");\n }\n } \n //if user try load app.php without session\n elseif(preg_match(\"/app.php/\",$uri)){\n parent::redirection(\"index.php\");\n }\n }", "function clearSession() {\n\t\tif(Configure::read('debug') >= 1) {\n\t\t\t$this->Session->del('Registration');\n\t\t\t$this->Session->del('Event');\n\t\t\t$this->Session->del('errors');\n\t\t\t$this->Session->del('adminLoggedIn');\n\t\t\t$this->Session->del('loggedIn');\n\t\t\t$this->Session->setFlash('Session rensad');\n\t\t} else {\n\t\t\t$this->Session->setFlash('You can\\'t use debug functions when not in debug mode.');\n\t\t\t$this->redirect(array('controller' => 'events', 'action' => 'index'));\n\t\t}\n\t}", "function session_clean()\n {\n session_unset();\n }", "function destory_2fa_sessions() {\n if(isset($_COOKIE['verified'])) {\n unset($_COOKIE['verified']);\n }\n}", "private function setCanarySession(): void\n {\n $canary = (int) $this->session->get('canary');\n if ($canary === 0 && PHP_SESSION_NONE !== session_status()) {\n session_regenerate_id(true);\n $this->session->saveForced('canary', (string)time());\n }\n\n if (PHP_SESSION_NONE !== session_status() && $canary < (time() - 300)) {\n session_regenerate_id(true);\n $this->session->saveForced('canary', (string)time());\n }\n }", "function createSession($u) {\r\n\t// THEN NEED TO ENSURE SESSION IS DELETED WHEN BROWSER CLOSED OR LOGOUT...??\r\n\t//if (!checkSession()) {\t\t\r\n\t\t$rndStr = randomString();\r\n\t\tsession_start();\r\n\t\r\n\t\t$_SESSION['username'] = $u;\r\n\t\t$_SESSION['s_id'] = $rndStr;\r\n\t\t\r\n\t\t$db_conn = connectToDB();\r\n\r\n\t\t$query = \"UPDATE user SET s_id='$rndStr' WHERE username='$u'\";\r\n\t\t$result = mysql_query($query) or die(mysql_error());\r\n\r\n\t\tdisconnectFromDB($db_conn);\r\n\t//}\r\n}", "private function clearEmailSession()\n\t{\n\t\tif (session()->has('verificationEmailSent')) {\n\t\t\tsession()->forget('verificationEmailSent');\n\t\t}\n\t}", "function checkSessionAjax(){\r\n if (!$this->Session->check('User'))\r\n {\r\n \t// Force the user to login\r\n $this->redirect('/user/ajaxnologin');\r\n exit();\r\n }\r\n\t}", "public function persistSessionToken() {}", "public function persistSessionToken() {}", "public function persistSessionToken() {}", "public function persistSessionToken() {}", "function session_check() {\n\tif (!isset($_POST['session'])) {\n\t\tsend_message('error', array('reason' => 'no_session_token','message' => 'No session token passed'));\n\t}\n}", "protected function forgetOldSessionData()\n {\n if (session()->has($this->sessionKey)) {\n session()->forget($this->sessionKey);\n }\n }", "function session_obliterate() {\n\tforeach ($_SESSION as $var) {\n\t\tunset($var);\n\t}\n\t$params = session_get_cookie_params();\n\tsetcookie(session_name(), '', time() - 42000,\n\t\t$params[\"path\"], $params[\"domain\"],\n\t\t$params[\"secure\"], $params[\"httponly\"]\n\t);\n\tsession_destroy();\n}", "function wsod_sess_close() {\n $_GET['debug'] ? unregister_tick_function('wsod_tick') : NULL; // DEBUG_OFF\n $_GET['debug'] ? print wsod_tick(TRUE) : NULL; // DEBUG_PRINT\n\n $is_emergency = (strpos($_SERVER['SCRIPT_FILENAME'], 'emergency.php') !== FALSE);\n wsod_check_wsod(TRUE, $is_emergency, $is_emergency, $is_emergency);\n return TRUE;\n}", "public function setUp()\n\t{\n\t\t// http://stackoverflow.com/questions/23270650/cannot-send-session-cookie-headers-already-sent-phpunit-laravel\n\t\t@session_start();\n\t\t$this->_killSession();\n\t}", "public function doBeforeSystem() {\n if (session_status() == PHP_SESSION_NONE) {\n session_start();\n }\n }", "protected final function is_still_valid($session)\n {\n }", "private function _closeSession()\n {\n $session = $this->requestStack->getCurrentRequest()->getSession();\n if ($session===null || !$session->isStarted()) {\n return;\n } \n \n $session->save();\n }", "public static function session()\n {\n //Sjekker om en bruker er logget in\n if (isset($_SESSION['user'])) {\n //Hvis verifyUser() returnerer falskt er sessionene kapret\n if(!$_SESSION['user']->verifyUser()){\n unset($_SESSION['user']);\n $alert = new Alert(Alert::ERROR, \"Sessionen er kapret og du har blitt logget ut. Husk å bruke beskyttelse\");\n $alert->displayOnIndex();\n }\n }\n }", "function verifSession(){\n if(!$_SESSION['rangId']){\n header('Location:'.base_url()); \n }\n }", "function unsetMockSession() {\n if ($this->realSession) {\n $this->CI->session = $this->realSession;\n $this->realSession = null;\n }\n }", "public static function sessionRestart() {\n // the version for php7 should work for php5 too, but we let the working code untouched - maybe cleanup later\n if (PHP_MAJOR_VERSION < 7) {\n ini_set('session.use_only_cookies', false);\n ini_set('session.use_cookies', false);\n \t\tini_set('session.use_trans_sid', false);\n \t\tini_set('session.cache_limiter', null);\n \t\tsession_start();\n }\n else { // php >= 7\n @session_start();\n \t\tif (session_status() != PHP_SESSION_ACTIVE) { // == PHP_SESSION_NONE ???\n \t\t\tsession_start();\n \t\t}\n } // eo php7\n\t}", "public function checkUsersSession(){\n\t}", "function clear_flash() {\n unset($_SESSION['__flash']);\n}", "public function checkSessionLab() {\n if (!isset($_SESSION['labuser_id'])) {\n header(\"Location:\" . DEFAULT_URL . \"/home?msg=Please login First\");\n } else {\n $obj_labuser = new labuserModel();\n //$_SESSION = $objUser->cleanArray($_SESSION);\n $getlabUser = $obj_labuser->selectByPk($_SESSION['labuser_id']);\n if (count($getlabUser) == 0) {\n @session_start();\n unset($_SESSION['LoggedIn']);\n unset($_SESSION['name']);\n unset($_SESSION['labuser_id']);\n unset($_SESSION['welcome']);\n unset($_SESSION['email_id']);\n unset($_SESSION['password']);\n header(\"Location:\" . DEFAULT_URL . \"/home?msg=Please login First\");\n }\n }\n }", "private function verifySession()\n {\n if ((isset($this->session['id']))\n && (is_numeric($this->session['id']))\n && (isset($this->session['legit']))\n && ($this->session['legit'] === $this->sessionHash())\n ) {\n return true;\n }\n return false;\n }", "public function unsetSession();", "function regeneratesession() {\n if(isset($_SESSION['OBSOLETE']) || $_SESSION['OBSOLETE'] == true)\n return;\n\n // Set current session to expire in 10 seconds\n $_SESSION['OBSOLETE'] = true;\n $_SESSION['EXPIRES'] = time() + 10;\n\n // Create new session without destroying the old one\n session_regenerate_id(false);\n\n // Grab current session ID and close both sessions to allow other scripts to use them\n $newSession = session_id();\n session_write_close();\n\n // Set session ID to the new one, and start it back up again\n session_id($newSession);\n if (session_status() == PHP_SESSION_NONE ) { session_start(); }; // recommended way for versions of PHP >= 5.4.0\n\n // Now we unset the obsolete and expiration values for the session we want to keep\n unset($_SESSION['OBSOLETE']);\n unset($_SESSION['EXPIRES']);\n}", "public function delete_old_sessions()\n\t{\n\t\t$expire = ee()->localize->now - $this->session_length;\n\n\t\tsrand(time());\n\n\t\tif ((rand() % 100) < $this->gc_probability)\n\t\t{\n\t\t\tee()->db->where('last_activity < ', $expire)\n\t\t\t\t\t\t ->delete('sessions');\n\t\t}\n\t}", "protected function regenerateSessionId() {}", "protected function regenerateSessionId() {}", "public function refreshSession() {}", "function checkApplicationState(){\n\t// if the session var isn't there OR if we're reloading from a URL var\n\tif ( !isset ( $_SESSION[ SESSION_NAME_SPACE ] )\n\t\tor \n\t\tisset( $_GET[ RELOAD_KEY ] ) && trim( $_GET[ RELOAD_KEY ] ) == RELOAD_KEY_VALUE ) {\n\n\t\tstartApplication();\t\n\t}\n}", "function session_touch($sessionId)\n {\n }", "public function cleanup(){\n\t\n\t\t$this->_p->user->setSessionVal($this->_session_var_name);\n\t\n\t}", "private function initSessionIfNecessary() {\n if (\\session_status() === \\PHP_SESSION_NONE) {\n // use cookies to store session IDs\n \\ini_set('session.use_cookies', 1);\n // use cookies only (do not send session IDs in URLs)\n \\ini_set('session.use_only_cookies', 1);\n // do not send session IDs in URLs\n \\ini_set('session.use_trans_sid', 0);\n\n // start the session (requests a cookie to be written on the client)\n//\t\t\t@Session::start();\n }\n }", "public static function CerrarSesion()\r\n {\r\n session_start();\r\n session_unset();\r\n session_destroy();\r\n }", "public static function useTheForce() {\n try {\n // Attempt to connect\n self::login();\n } catch (Exception $e) {\n // Did we fail because of an old session?\n if (isset($e->faultcode) && $e->faultcode == 'sf:INVALID_SESSION_ID') {\n // Clear the session and try again\n self::unsetSessionData();\n self::login();\n } else {\n throw $e;\n }\n }\n }", "function expiredSession(){\n\t$inactive =3600; // could be any value the admin wants.\n\tif(isset($_SESSION['created'])){\n\t\tif(time() - $_SESSION['created'] > $inactive){\n\t\t\tsession_destroy();\n\t\t\theader(\"Location: errormsg.php?message=session_expired\");\t\n\t\t}\n\t\t\n\t}\n\n}", "public function onKernelFinishRequest(Event $event) {\n $session_key_name = 'la_pills_analytics_force_anonymous_session';\n $request = $event->getRequest();\n\n // Start session for anonymous user if not present\n if ($this->currentUser->isAnonymous() && !$request->getSession()) {\n \\Drupal::service('session_manager')->start();\n }\n\n // A hacky way to enforce persistent session identifier for anonymous users\n // Identifier is constantly regenerated if session does not have some data\n // stored in it\n if ($this->currentUser->isAnonymous() && !$request->getSession()->has($session_key_name)) {\n $request->getSession()->set($session_key_name, 'anonymous');\n }\n }", "public function ensureThatCookieDoesNotExpire(MvcEvent $event)\n {\n if (php_sapi_name() != 'cli') {\n $cookie = $event->getRequest()->getCookie();\n if ($cookie && $cookie->offsetExists(self::SESSION_NAME)) {\n $value = $cookie->offsetGet(self::SESSION_NAME);\n $expires = time() + self::COOKIE_LIFETIME;\n $domain = $event->getRequest()->getUri()->getHost();\n setcookie(\n self::SESSION_NAME, // session name\n $value, $expires, '/', $domain, APPLICATION_ENV !== 'development', true\n );\n }\n }\n }" ]
[ "0.76990324", "0.694571", "0.6875226", "0.6831351", "0.64395833", "0.64395833", "0.64384556", "0.64028853", "0.63157743", "0.63140017", "0.62612724", "0.6227901", "0.62146455", "0.61941904", "0.617731", "0.61110145", "0.6099619", "0.6076875", "0.6075893", "0.6065462", "0.60543764", "0.60376996", "0.6018917", "0.598649", "0.59370446", "0.5909651", "0.5900283", "0.58938664", "0.5893032", "0.58925295", "0.58905834", "0.5875816", "0.58733714", "0.5848215", "0.584535", "0.5833762", "0.5819249", "0.5807192", "0.57814777", "0.5773951", "0.57684463", "0.57490003", "0.5747273", "0.5745802", "0.5742384", "0.57420295", "0.57382286", "0.57339525", "0.5732742", "0.5730678", "0.57279825", "0.57243997", "0.5722304", "0.57160985", "0.5712831", "0.5711874", "0.5687286", "0.5686354", "0.5681286", "0.5676978", "0.56747186", "0.56649476", "0.5653545", "0.5652647", "0.5641837", "0.5636204", "0.5636204", "0.5636204", "0.5636204", "0.56301653", "0.56281376", "0.5616694", "0.5612266", "0.5608709", "0.5603432", "0.5592995", "0.5586624", "0.558554", "0.55827796", "0.55802506", "0.55778587", "0.5574944", "0.5573307", "0.557282", "0.55719817", "0.55667293", "0.55663043", "0.5565457", "0.55635893", "0.55635893", "0.5558266", "0.55489385", "0.5546329", "0.5534446", "0.5530097", "0.5528546", "0.5525526", "0.55223894", "0.55158794", "0.55147326" ]
0.6597443
4
Checks if the given path is a file, and if it's extension is a known imageextension
function isImage($path) { global $CONFIG; return (is_file($path) && in_array(strtolower(pathinfo($path, PATHINFO_EXTENSION)), $CONFIG->extensions->images)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isImage(string $path): bool\n{\n $ext = getExtension($path);\n return ($ext === \"jpg\" || $ext === \"jpeg\" || $ext === \"png\");\n}", "function isPhoto($path) \n {\n $exploded = explode('.', $path);\n $ext = strtolower(end($exploded));\n // Define the photos extensions\n $photoExtensions = ['png', 'jpg', 'jpeg', 'gif', 'jfif', 'tif', 'webp'];\n // Check if this extension belongs to the extensions we defined\n if (in_array($ext, $photoExtensions)) {\n return true;\n }\n return false;\n }", "function is_image($path)\n{\n\t$controle_type_mime_autorises = ['image/gif', 'image/jpeg', 'image/pjpeg', 'image/png'];\n\t$fichier_mime_type = mime_content_type($path);\n\t//echo $fichier_mime_type;\n\n\tif(in_array($fichier_mime_type, $controle_type_mime_autorises)){\n\t return TRUE;\n\t}else{\n\t return FALSE;\n\t}\n}", "public function checkIsFile($path);", "function is_image($path)\n{\n\t$a = getimagesize($path);\n\t$image_type = $a[2];\n\n\tif(in_array($image_type , array(IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP)))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "function is_image( string $path ):bool\r\n {\r\n $a = getimagesize($path);\r\n $image_type = $a[2];\r\n\r\n if( in_array( $image_type , array( IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP) ) )\r\n {\r\n return true;\r\n }\r\n return false;\r\n }", "function file_is_image($filename) {\n return in_array(get_file_extension($filename), get_image_file_types());\n }", "function is_file_an_image($filepath)\n{\n\t$a = getimagesize($filepath);\n\t$image_type = $a[2];\n\t \n\tif(in_array($image_type , array(IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP)))\n\t{\n\t return true;\n\t}\n\treturn false;\n}", "private function hasJPGExtension(string $path): bool\n {\n $extensionIndex = strrpos($path, '.');\n if (false === $extensionIndex) {\n return false;\n }\n $extension = strtolower(substr($path, $extensionIndex));\n return '.jpg' === $extension || '.jpeg' === $extension;\n }", "function file_is_valid_image($path)\n {\n }", "function isFile($path);", "function validate_picture_file($path) {\n $acceptableTypes = array(IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_GIF);\n $detectedType = exif_imagetype($path); // WARNING: This will only work if the\n // EXIF extension is enabled.\n return in_array($detectedType, $acceptableTypes);\n}", "function CheckImageExtension($filename)\n{\n\tif(strlen($filename)<4)\n\t\treturn false;\n\t$ext=strtoupper(substr($filename,strlen($filename)-4));\n\tif($ext==\".GIF\" || $ext==\".JPG\" || $ext==\"JPEG\" || $ext==\".PNG\" || $ext==\".BMP\")\n\t\treturn $ext;\n\treturn false;\n}", "function isImage(string $filename) : bool {\n return (bool) preg_match(\"/(png|gif|jpg|jpeg)/\", pathinfo($filename, PATHINFO_EXTENSION));\n}", "public function isFile(string $path): bool;", "public function isFile(string $path): bool;", "function is_valid_image_extension ($ext) {\n switch ($ext = strtolower($ext)) {\n //Pictures\n case 'jpg':\n case 'gif':\n case 'png':\n case 'bmp':\n case 'xbm':\n return true;\n\n //Denied extension\n default:\n return false;\n }\n }", "function isImage( $filepath, $arr_types=array( \".gif\", \".jpeg\", \".png\", \".bmp\" ) )\n\t{\n\t\tif(file_exists($filepath)) {\n\t\t\t$info = getimagesize($filepath);\n\t\t\t$ext = image_type_to_extension($info['2']);\n\t\t\treturn in_array($ext,$arr_types);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function isImage($path)\n {\n return is_array(getimagesize($path));\n }", "function check_image_type($ftype)\n{\n$ext = strtolower(end(explode('.',$ftype)));\n$img_array = array('jpeg','jpg','gif','png');\n\n//\tif($ftype == \"image/jpeg\" || $ftype == \"image/jpg\" || $ftype == \"image/gif\" || $ftype == \"image/png\" )\n\tif(in_array($ext,$img_array))\n\t\treturn 1;\n\t\telse\n\t\t\treturn 0;\n}", "function checkType($type){\n\n $allowed = array('jpg', 'jpeg', 'png');\n $fileExt = explode('/', $type);\n $fileExt = strtolower(end($fileExt));\n return in_array($fileExt, $allowed) ? true : false ;\n\n }", "function isImage( $url ){\r\n $pos = strrpos( $url, \".\");\r\n if ($pos === false)\r\n return false;\r\n $ext = strtolower(trim(substr( $url, $pos)));\r\n $imgExts = array(\".gif\", \".jpg\", \".jpeg\", \".png\", \".tiff\", \".tif\"); // this is far from complete but that's always going to be the case...\r\n if ( in_array($ext, $imgExts) )\r\n return true;\r\nreturn false;\r\n}", "public function isFile(): bool {\n\t\t$isFile = (bool) pathinfo($this->getPath(), PATHINFO_EXTENSION);\n\t\t$originalUriHasSlash = substr($this->originalUri, - 1) === '/';\n\n\t\treturn $isFile && ! $originalUriHasSlash;\n\t}", "public function checkFile($filename){\n $ext = substr($filename, strrpos($filename, '.') + 1);\n if($ext==\"jpg\"||$ext==\"png\"||$ext==\"svg\"||$ext==\"jpeg\"){\n return true;\n }else{\n return false;\n }\n }", "public function isImage($ext=null){\n global $VALID_IMAGES;\n if (!$ext)\n $ext = $this->ext; \n return (in_Array( $ext, $VALID_IMAGES )); \n }", "public static function hasExtension($path)\r\n\t{\r\n\t\t$file=self::getFilename($path);\r\n\t\t$posDot=strrpos($file, \".\");\r\n\t\tif ($posDot===false) return false;\r\n\t\telse return true;\r\n\t}", "public function extens(){\n $this->typefl = pathinfo($this->filename, PATHINFO_EXTENSION);\n\n if(!in_array($this->typefl, $this->type)){\n echo \"Wrong extension!!!\";\n return false;\n }\n else{\n return true;\n }\n }", "function is_image($file)\n{\n $type = get_image_type($file);\n $mime = get_image_mime_type($type);\n\n return substr($mime, 0, 5) == 'image';\n}", "function isFileType($files) {\n $allowedExts = array(\"jpg\", \"jpeg\", \"gif\", \"png\", \"doc\", \"docx\", \"txt\", \"rtf\", \"pdf\", \"xls\", \"xlsx\", \"ppt\", \"pptx\");\n $temp = explode(\".\", $files);\n $extension = end($temp);\n if (in_array($extension, $allowedExts))\n return true;\n else\n return false;\n}", "public static function isHaveExtension($path)\n {\n if (!is_string($path)) {\n return false;\n }\n $parts = pathinfo($path);\n return array_key_exists('extension', $parts);\n }", "public function isFile();", "protected function is_valid_image_file($file_path) {\n \treturn false;\n }", "public function typeOfFile($path);", "public function testIsImageFile()\n {\n $this->assertTrue(Tinebase_ImageHelper::isImageFile($this->_testImagePath));\n $this->assertFalse(Tinebase_ImageHelper::isImageFile(__FILE__));\n }", "public function validateExtensionplan(){\n $allowed = array('jpeg', 'jpg', 'png');\n $filename = $this->getplanFloor('name');\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\n if(!in_array($ext,$allowed)) {\n return false;\n } else {\n return true;\n }\n }", "function extension($ext){\r\n\t\tif ($ext == \"jpg\" || $ext == \"jpeg\" || $ext == \"png\") {\r\n\t\t\t$ret = 1;\r\n\t\t} else{\r\n\t\t\t$ret = 0;\r\n\t\t}\r\n\r\n\t\treturn $ret;\r\n\t}", "public function getExistsImageExt($pic){\n\n $exts = array('png', 'gif', 'gif', 'jpg', 'jpeg', 'swf', 'psd', 'bmp', 'tif', 'jpc', 'jp2', 'jpx', 'jb2', 'swc', 'iff', 'jpg', 'wbmp', 'xbm');\n\n foreach ($exts as $ext){\n if (file_exists($pic.\".\".$ext))\n return \".\".$ext;\n }\n\n return false;\n\n }", "function checkimage($img)\r\n{\r\n $imageMimeTypes = array(\r\n 'image/png',\r\n 'image/gif',\r\n 'image/jpeg');\r\n\r\n $img = mime_content_type($img);\r\n $imgcheck = false;\r\n if (in_array ($img, $imageMimeTypes))\r\n {\r\n $imgcheck = true;\r\n }\r\n return $imgcheck;\r\n}", "function validateTypeOfFile($type){\n\t$arrFile = ['image/png', 'image/jpg', 'image/jpeg', 'image/gif'];\n\tif(in_array($type, $arrFile)){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "function file_is_an_image($temporary_path, $new_path)\n {\n $allowed_mime_types = ['image/gif', 'image/jpeg', 'image/png'];\n $allowed_file_extensions = ['gif', 'jpg', 'jpeg', 'png'];\n\n $actual_file_extension = pathinfo($new_path, PATHINFO_EXTENSION);\n $actual_mime_type = getimagesize($temporary_path)['mime'];\n\n $file_extension_is_valid = in_array($actual_file_extension, $allowed_file_extensions);\n $mime_type_is_valid = in_array($actual_mime_type, $allowed_mime_types);\n\n return $file_extension_is_valid && $mime_type_is_valid;\n }", "private function isImage($url)\n {\n $pos = strrpos($url, '.');\n if ($pos === false) {\n return false;\n }\n\n\n $ext = explode(\"?\",strtolower(trim(substr($url, $pos))))[0];\n\n $imgExts = [\n '.gif',\n '.jpg',\n '.jpeg',\n '.png',\n '.tiff',\n '.tif',\n ];\n\n // this is far from complete but that's always going to be the case...\n if (in_array($ext, $imgExts)) {\n return true;\n }\n\n return false;\n }", "private function isValidImage() {\r\n\t\t\treturn in_array($this->extension, $this->extAllowed) ? true : false;\r\n\t\t}", "public function checkCorrectFile( $sName, $is = 'jpg|jpeg|png|gif' ){\n\t\treturn preg_match( '/('.$is.')/i', $this->throwExtOfFile( $sName ) );\n\t}", "public function imageCheck($extension)\n {\n $allowedTypes = [\n 'image/gif',\n 'image/jpg',\n 'image/png',\n 'image/bmp',\n 'image/jpeg',\n 'image/x-icon'\n ];\n\n return in_array($extension, $allowedTypes);\n }", "function file_is_displayable_image($path)\n {\n }", "function GetImageExtension($imagetype){\n if(empty($imagetype)) return false;\n switch($imagetype){\n case 'image/bmp': return '.bmp';\n case 'image/gif': return '.gif';\n case 'image/jpeg': return '.jpg';\n case 'image/png': return '.png';\n default: return false;\n }\n}", "public function assertIsFile($path);", "function is_external_file($file) {\n\n $allowed = array('jpeg', 'png', 'bmp', 'gif', 'pdf', 'jpg', 'doc', 'docx');\n\n $ext = pathinfo($file, PATHINFO_EXTENSION);\n\n if (in_array(strtolower($ext), $allowed)) {\n return true;\n }\n\n return false;\n}", "function GetImageExtension($imagetype){\n \n if(empty($imagetype)) return false;\n \n switch($imagetype){\n case 'image/bmp': return '.bmp';\n case 'image/gif': return '.gif';\n case 'image/jpeg': return '.jpg';\n case 'image/png': return '.png';\n default: return false;\n }\n }", "public function isFilename( string $path ): bool {\n\t\t\treturn (bool) @preg_match(\n\t\t\t\t'/^[\\w,\\s-]+\\.[A-Za-z]{3,4}$/',\n\t\t\t\t$path\n\t\t\t);\n\t\t}", "function GetImageExtension($imagetype){\n if(empty($imagetype)) return false;\n switch($imagetype){\n case 'image/bmp':return '.bmp';\n case 'image/gif':return '.gif';\n case 'image/jpeg':return '.jpg';\n case 'image/png':return '.png';\n default: return false;\n }}", "function get_file_extension($file_path)\n {\n if (!@is_file($file_path))\n return NULL;\n return substr($file_path, -3);\n }", "function is_imagen($arch)\r\n{$i=strlen($arch)-1;\r\n $extensiones_aceptadas=array(\"gif\",\"jpg\",\"jpeg\",\"bmp\");\r\n $extension=\"\";\r\n while(($i>=0)&&($arch[$i]!='.'))\r\n {$extension=$arch[$i].$extension;\r\n $i--;\r\n }\r\n if ($i<0) return false;\r\n else {if(in_array($extension,$extensiones_aceptadas)){return true;}\r\n else {return false;};\r\n }\r\n}", "function getFileType ( $ext ) {\n\t\t\tforeach ( self::$TYPES_TO_EXTENSIONS as $type => $extensions ) {\n\t\t\t\tif ( in_array( $ext, $extensions ) ) {\n\t\t\t\t\treturn $type;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\treturn false;\n\t\t\t\n\t\t}", "function fileChecker($nome_file){\n \n // controllo che sia stato inviato un file altrimenti restituisco false\n if(empty($_FILES['file'])){\n return false;\n }\n \n // memorizzo l'estensione\n $ext = trim(strtolower(end($nome_file)));\n \n // verifico che sia stato inviato un file contente un foto i formati disponibili sono jpg png jpeg\n if(!preg_match(VALID_FILE_FORMAT, $ext)){\n return false;\n }\n \n return true;\n}", "private function isValidImageType(string $file)\r\n {\r\n return in_array(pathinfo($file, PATHINFO_EXTENSION), $this->supported);\r\n }", "public static function guess($filePath)\n {\n if (!@file_exists($filePath)) {\n return false;\n }\n /*\n Not using pathinfo, as it is locale aware, and I'm not sure if that could lead to problems\n\n if (!function_exists('pathinfo')) {\n // This is really a just in case! - We do not expect this to happen.\n // - in fact we have a test case asserting that this does not happen.\n return null;\n //\n $fileExtension = pathinfo($filePath, PATHINFO_EXTENSION);\n $fileExtension = strtolower($fileExtension);\n }*/\n\n $result = preg_match('#\\\\.([^.]*)$#', $filePath, $matches);\n if ($result !== 1) {\n return null;\n }\n $fileExtension = $matches[1];\n\n // Trivial image mime types\n if (in_array($fileExtension, ['bmp', 'gif', 'jpeg', 'png', 'tiff', 'webp'])) {\n return 'image/' . $fileExtension;\n }\n\n // Common extensions that are definitely not images\n if (in_array($fileExtension, ['txt', 'doc', 'zip', 'gz', 'exe'])) {\n return false;\n }\n\n // Non-trivial image mime types\n switch ($fileExtension) {\n case 'ico':\n return 'image/vnd.microsoft.icon'; // or perhaps 'x-icon' ?\n\n case 'jpg':\n return 'image/jpeg';\n\n case 'svg':\n return 'image/svg+xml';\n\n case 'tif':\n return 'image/tiff';\n }\n\n // We do not know this extension, return null\n return null;\n }", "public function imageCheck($extension)\n {\n $allowedTypes = $this->imageTypes;\n return in_array($extension, $allowedTypes);\n }", "function validateMimeType($file_name){\r\n // array of acceptable MIME types\r\n $mime_types = [\r\n 'image/png',\r\n 'image/jpeg'\r\n ];\r\n \r\n // determines MIME type\r\n $type = mime_content_type($file_name);\r\n \r\n // check if MIME type is in array of acceptable types\r\n return in_array($type, $mime_types, true);\r\n}", "function check_image_type($source_pic)\n{\n $image_info = check_mime_type($source_pic);\n\n switch ($image_info) {\n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}", "public function verify($path) {\n\t\t$full_path = realpath($path);\n\t\t$data = @getimagesize($full_path);\n\t\tif (!$data) {\n\t\t\tthrow new FileException(sprintf('File \"%s\" cannot be read.', $path), 1);\n\t\t}\n\t\tif ($data[2] != IMG_JPG) {\n\t\t\tthrow new FileException(sprintf('File \"%s\" is not a JPG.', $path), 240);\n\t\t}\n\t\tif ($data[0] < 600 || $data[1] < 600) {\n\t\t\tthrow new FileException(sprintf('File \"%s\" is too small.', $path), 241);\n\t\t}\n\t\treturn $full_path;\n\t}", "public static function guess_fileextension( $filename = null, $filecontent = null ) {\r\n\t\t\tif ( $filename ) {\r\n\t\t\t\t$filecontent = $this->getFileContents( $filename );\r\n\t\t\t\tif ( !$filecontent ) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t} else if ( !$filecontent ) {\r\n\t\t\t\tthrow new Exception( 'This function needs atleast one argument!' );\r\n\t\t\t}\r\n\t\t\t$signature = self::getFileSignature( $filecontent );\r\n\t\t\tswitch( $signature[0] ) {\r\n\t\t\t\tcase 'FF': { return ( self::is_jpg( null, $signature ) ) ? 'jpg' : (( self::is_mp3( null, $signature ) ) ? 'mp3' : false ); } break;\r\n\t\t\t\tcase '47': { return ( self::is_gif( null, $signature ) ) ? 'gif' : false; } break;\r\n\t\t\t\tcase '89': { return ( self::is_png( null, $signature ) ) ? 'png' : false; } break;\r\n\t\t\t\tcase '42': { return ( self::is_bmp( null, $signature ) ) ? 'bmp' : false; } break;\r\n\t\t\t\tcase '52': { return ( self::is_webp( null, $signature ) ) ? 'webp' : (( self::is_rar( null, $signature ) ) ? 'rar' : false ); } break;\r\n\t\t\t\tcase '1F': { return ( self::is_gzip( null, $signature ) ) ? 'gz' : false; } break;\r\n\t\t\t\tcase '37': { return ( self::is_7zip( null, $signature ) ) ? '7z' : false; } break;\r\n\t\t\t\tcase '4D': { return ( self::is_exe( null, $signature ) ) ? 'exe' : (( self::is_tiff( null, $signature ) ) ? 'tiff' : false ); } break;\r\n\t\t\t\tcase '49': { return ( self::is_tif( null, $signature ) ) ? 'tif' : (( self::is_mp3( null, $signature ) ) ? 'mp3' : false ); } break;\r\n\t\t\t\tcase '25': { return ( self::is_pdf( null, $signature ) ) ? 'pdf' : false; } break;\r\n\t\t\t\tcase '30': { return ( self::is_wmv( null, $signature ) ) ? 'wmv' : false; } break;\r\n\t\t\t\tcase '75': { return ( self::is_tar( null, $signature ) ) ? 'tar' : false; } break;\r\n\t\t\t\tcase '3C': { return ( self::is_xml( null, $signature ) ) ? 'xml' : false; } break;\r\n\t\t\t\tdefault: {\r\n\t\t\t\t\t$signature = self::getFileSignature( $filecontent, 4 );\r\n\t\t\t\t\tswitch( $signature[0] ) {\r\n\t\t\t\t\t\tcase '66': { return ( self::is_mp4( null, $signature ) ) ? 'mp4' : false; } break;\r\n\t\t\t\t\t\tcase '1A': { return ( self::is_webm( null, $signature ) ) ? 'webm' : false; } break;\r\n\t\t\t\t\t\tdefault: {\r\n\t\t\t\t\t\t\t$signature = self::getFileSignature( $filecontent, 8 );\r\n\t\t\t\t\t\t\tswitch( $signature[0] ) {\r\n\t\t\t\t\t\t\t\tcase '57': { return ( self::is_wav( null, $signature ) ) ? 'wav' : false; } break;\r\n\t\t\t\t\t\t\t\tcase '41': { return ( self::is_avi( null, $signature ) ) ? 'avi' : false; } break;\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\treturn false;\r\n\t\t}", "function fileExtension($nameFile) {\n\t$format = substr($nameFile, -4);\n\treturn ($format == \".pat\");\n}", "function image_exist($file, $path=\"\") {\n\tif ($file)\n\t{\n\t\t$checkfile=($path)?$path . \"/\" . $file:$file;\n\t\tif (file_exists($checkfile)) {\n\t\t\treturn 1;\n\t\t}\n\t}\n\t}", "protected function isFile() {}", "function getfiletype($path){\n\t$extension = getextension($path);\n\tif($extension!=null)\n\t{\n if (isset($_ENV['MIME_TYPES']['binary'][$extension])){\n return 'binary';\n } else if (isset($_ENV['MIME_TYPES']['ascii'][$extension])){\n return 'ascii';\n }\n }\n return null;\n}", "function get_mime_type($path)\n{\n\t$file = trim(basename($path));\n\t//get extension\n\tif($pos=strpos($file, '.')) {\n\t\t$ext = trim(substr($file,$pos),'.');\n\t} else {\n\t\t//either no '.'' or at pos 0, no extention\n\t\treturn false;\n\t}\n\t//check system mime file for ours\n\t$mime = false;\n\tif($sys_mime = fopen('/etc/mime.types','r')) {\n\t\twhile(!$mime && ($line=fgets($sys_mime)) !== false) {\n\t\t\t$line = trim($line);\n\t\t\tif($line && $line[0]!=='#') {\n\t\t\t\t$parts = preg_split('/\\s+/', $line);\n\t\t\t\tif(count($parts) !== 1) {\n\t\t\t\t\tforeach ($parts as $extension) {\n\t\t\t\t\t\tif($extension === $ext) {\n\t\t\t\t\t\t\t$mime = $parts[0];\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\t\tfclose($sys_mime);\n\t}\n\treturn $mime;\n}", "function cmfcFile_getFileExtension($path) {\n\t\t$path_parts = pathinfo($path);\n\t//\techo $path_parts['dirname'], \"\\n\";\n\t//\techo $path_parts['basename'], \"\\n\";\n\t\treturn strtolower($path_parts['extension']);\n\t}", "public static function isFile($path)\n {\n if (is_file($path)) {\n if (strstr(PHP_OS, 'WIN')) {\n if (basename(realpath($path)) != basename($path)) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n }", "function isImage($filename) {\n \tglobal $synAbsolutePath;\n if (file_exists($synAbsolutePath.$filename)) {\n if (getimagesize($synAbsolutePath.$filename)!==false) $ret=true;\n else $ret=false;\n } else $ret=false;\n return $ret;\n }", "public function isAllowedExtension()\n {\n if (!empty($this->allowed_upload_file_ext)) {\n if (!is_array($this->allowed_upload_file_ext)) {\n NUCLEUS_Exceptions::catcher(FILE_TYPE_LIST_ERROR);\n return false;\n }\n else {\n if (!in_array($this->_file_info['ext'], $this->allowed_upload_file_ext)) {\n NUCLEUS_Exceptions::catcher(UPLOAD_FILE_TYPE_DENIED);\n return false;\n }\n }\n }\n\n return true;\n }", "public function is_file($file);", "function validateFile($file){\n\n $check = getimagesize($file[\"tmp_name\"]);\n if($check !== false) {\n $err = \"File is an image - \" . $check[\"mime\"] . \".\";\n $uploadOk = 1;\n } else {\n $err = \"File is not an image.\";\n $uploadOk = 0;\n }\n// Allow certain file formats\nif($file[\"type\"] != \"jpg\" && $file[\"type\"] != \"png\" && $file[\"type\"] != \"jpeg\"\n&& $file[\"type\"] != \"gif\" ) {\n $err = \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.\";\n $uploadOk = 0;\n}\n return ($uploadOk==1)? true : false;\n}", "function _is_it_ico($file)\r\n{\r\n $ext = substr($file, -4);\r\n if ($ext === '.ico') {\r\n return true;\r\n }\r\n return false;\r\n}", "private function getImageExtension ($type)\n\t{\n\t\tswitch($type) {\n\t\t\tcase 'image/gif':\n\t\t\treturn '.gif';\n\n\t\t\tcase 'image/jpeg':\n\t\t\tcase 'image/pjpeg':\n\t\t\treturn '.jpg';\n\n\t\t\tcase 'image/png':\n\t\t\treturn '.png';\n\n\t\t\tdefault:\n\t\t\tthrow new Exception('File type is not recognized! Check the image to make sure it\\'s jpg, png, or gif.');\n\t\t}\n\t}", "private function is_image( $extension = null, $mime_type = null )\n\t{\n\t\tif ( ! is_null($extension) ) {\n\t\t\t$image_extensions = array(\n\t\t\t\t'jpg',\n\t\t\t\t'jpeg',\n\t\t\t\t'gif',\n\t\t\t\t'png',\n\t\t\t\t'bmp',\n\t\t\t);\n\n\t\t\treturn in_array(strtolower($extension), $image_extensions) ? 'true' : 'false';\n\t\t} else if ( ! is_null($mime_type) ) {\n\t\t\t$mime_type_parts = explode('/', $body['ContentType']);\n\t\t\treturn ( strtolower(reset($mime_type_parts)) === 'image' ) ? 'true' : 'false';\n\t\t}\n\n\t\treturn false;\n\t}", "function getextension($path)\n{\n\t$extension = null;\n if (preg_match('/\\.([a-z0-9]+)$/', $path, $found)){\n\t\t$extension = $found[1];\n\t}\n\treturn $extension;\n}", "public function mimeType(string $path): bool|string\n {\n return finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path);\n }", "public function isFile() : bool;", "public function check($path)\n {\n $extension = File::extension($path);\n\n if (! in_array($extension, $this->extensions)) {\n throw new InvalidFileTypeException(\n sprintf('%s is an invalid file type for the %s class', $extension, get_class($this)));\n }\n\n return true;\n }", "function getextension($path){\n return strtolower(pathinfo($path, PATHINFO_EXTENSION)); // extension only, no period\n}", "public function extension($filePath);", "public function isFile(): bool;", "function check_file_extension($ext, $allowed) {\nif (in_array($ext, $allowed)) {\nreturn true;\n}else {\necho \"Only .txt file allow to be uploaded\";\n}\n}", "function checkimagetype($imagetype){\n\n\t\t$filetype = array(\n\t\t 'image/bmp', \n\t\t 'image/gif', \n\t\t 'image/icon', \n\t\t 'image/jpeg',\n\t\t 'image/jpg', \n\t\t 'image/png', \n\t\t 'image/tiff', \n\t\t );\n if( in_array($imagetype,$filetype))\n\t\t\treturn true;\n\t\telse \n\t\t\treturn 0;\n\n}", "function getExtension($imagem)\n {\n // isso para obter o mime-type da imagem.\n $mime= getimagesize($imagem);\n\n if ($mime[2] == 1)\n {\n $ext= \"gif\";\n return $ext;\n }\n\t\telseif ($mime[2] == 2)\n {\n $ext= \"jpg\";\n return $ext;\n }\n elseif ($mime[2] == 3)\n {\n $ext= \"png\";\n return $ext;\n }\n\t\telseif ($mime[2] == 4)\n {\n $ext= \"bmp\";\n return $ext;\n }\n else\n return false;\n }", "function getExtension(string $path): string\n{\n return pathinfo($path, PATHINFO_EXTENSION);\n}", "function is_valid_extension ($ext) {\n $ext = strtolower($ext);\n return (is_valid_image_extension($ext) || is_valid_audio_extension($ext)\n || is_valid_video_extension($ext));\n }", "function check_file_existance($path)\n{\n //buld the url\n $image_url=$path;\n if (file_exists($image_url) !== false) {\n return true;\n }\n}", "public static function extension($path)\n\t{\n\t\treturn pathinfo($path, PATHINFO_EXTENSION);\n\t}", "public static function extension($path)\n\t{\n\t\treturn pathinfo($path, PATHINFO_EXTENSION);\n\t}", "public static function extension($path)\n\t{\n\t\treturn pathinfo($path, PATHINFO_EXTENSION);\n\t}", "public function checkExtensions()\r\n\t{\r\n\t\treturn (strcasecmp(pathinfo($this->targetFile, PATHINFO_EXTENSION), pathinfo($this->referenceFile, PATHINFO_EXTENSION)) === 0);\r\n\t}", "public function fileMimeType($path)\n {\n $type = $this->findType(strtolower(pathinfo($path, PATHINFO_EXTENSION)));\n if (!empty($type)) {\n return $type;\n }\n\n return 'unknown/type';\n }", "function isValidImage( $file ) {\n\n\t$form_errors = array();\n\n\t$part = explode( \".\", $file );\n\t$extension = end( $part );\n\n\tswitch( strtolower( $extension ) ) {\n\n\t\tcase 'jpg':\n\t\tcase 'gif':\n\t\tcase 'bmp':\n\t\tcase 'png':\n\n\t\treturn $form_errors;\n\n\t}\n\n\t$form_errors[] = $extension . \"is not valid image extension\";\n\n\treturn $form_errors;\n\n}", "public function checkFormatAllowed() {\n\t\t$imageFileType = pathinfo(basename($this->value[\"name\"]),PATHINFO_EXTENSION);\n\t\tif((($this->extension == \"\") && ($imageFileType == \"jpg\" || $imageFileType == \"png\" || $imageFileType == \"jpeg\"\n\t\t|| $imageFileType == \"gif\")) || ($this->extension == \"pdf\" && $imageFileType == \"pdf\" )) {\n\t\t return true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isFileImage ($image) \n {\n if (!in_array(mime_content_type($image), ALLOWED_IMAGE_TYPES) ) {\n return false;\n }\n return true;\n }", "static function chkFileExtension($str='') {\n $match= preg_match('/.swf/i', $str);\n if($match>0){\n return \"yes\";\n }else{\n return \"no\";\n }\n }", "public static function extension($_path)\r\n {\r\n return pathinfo($_path, PATHINFO_EXTENSION);\r\n }", "public static function extension($path)\n {\n return pathinfo($path, PATHINFO_EXTENSION);\n }" ]
[ "0.7891073", "0.76301455", "0.757281", "0.74448603", "0.7400308", "0.7331621", "0.72882354", "0.72719467", "0.72670346", "0.72578436", "0.7213137", "0.71207684", "0.7076717", "0.7015753", "0.7009175", "0.7009175", "0.6962504", "0.6929038", "0.69110715", "0.68848616", "0.6869283", "0.68196136", "0.67645097", "0.6692178", "0.6689741", "0.66801304", "0.6674376", "0.6668354", "0.6644376", "0.6643721", "0.6616831", "0.65644217", "0.6557764", "0.6556319", "0.6520797", "0.65200377", "0.6499185", "0.6494714", "0.6487795", "0.6455372", "0.64346063", "0.64289296", "0.6386734", "0.6379179", "0.63692933", "0.6354548", "0.6341097", "0.63321763", "0.6331355", "0.6328998", "0.63236433", "0.631716", "0.6312404", "0.63085896", "0.6293719", "0.6283675", "0.6279663", "0.6278949", "0.62597984", "0.6218626", "0.62074435", "0.6195024", "0.6193122", "0.61637414", "0.6159921", "0.6159043", "0.6153975", "0.61363435", "0.6121748", "0.61188954", "0.6117076", "0.61106807", "0.6110144", "0.61016333", "0.6089353", "0.6086727", "0.608497", "0.6079186", "0.60764647", "0.6072095", "0.6066156", "0.60592854", "0.60583675", "0.6029057", "0.6025261", "0.60241455", "0.60217685", "0.60189396", "0.60159093", "0.6015024", "0.6015024", "0.6015024", "0.60136", "0.6008509", "0.60076314", "0.60056084", "0.59993464", "0.59962267", "0.59935606", "0.5992817" ]
0.78463125
1
Checks the validity of an email by regex
function isEmail($email) { return (bool)preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i', $email); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function email_is_valid($email) {\r\n return preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i',$email);\r\n }", "function check_email ($email) {\n\t\n if (preg_match ('/^[-!#$%&\\'*+\\\\.\\/0-9=?A-Z^_{|}~]+' . '@' . '([-0-9A-Z]+\\.)+' . '([0-9A-Z]){2,4}$/i', trim ($email))) {\n \n return true;\n \n } else {\n \n return false;\n \n }\n}", "function check_email ($email)\n{\n return (preg_match ('/^[-!#$%&\\'*+\\\\.\\/0-9=?A-Z^_{|}~]+' . '@' . '([-0-9A-Z]+\\.)+' . '([0-9A-Z]){2,4}$/i', trim($email)));\n}", "public function validate_email($email){\n $pattern = '/^(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){255,})(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){65,}@)(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22))(?:\\.(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\\]))$/iD';\n if(preg_match($pattern, $email)){\n return true;\n }\n else{\n return false;\n }\n }", "function email_validation($str)\n{\n return preg_match(\"/.+@.+/\", $str);\n}", "function IsValidEmail($input) {\r\n $regex = '/^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.([a-zA-Z]{2,4})$/';\r\n\r\n if (preg_match($regex, $input)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function isValidEmail($email) {\r\n\treturn preg_match(\"/^[a-zA-Z]\\w+(\\.\\w+)*\\@\\w+(\\.[0-9a-zA-Z]+)*\\.[a-zA-Z]{2,4}$/\", $email);\r\n}", "function validateEmail($email) {\n\n\treturn preg_match(\"/^(((([^]<>()[\\.,;:@\\\" ]|(\\\\\\[\\\\x00-\\\\x7F]))\\\\.?)+)|(\\\"((\\\\\\[\\\\x00-\\\\x7F])|[^\\\\x0D\\\\x0A\\\"\\\\\\])+\\\"))@((([[:alnum:]]([[:alnum:]]|-)*[[:alnum:]]))(\\\\.([[:alnum:]]([[:alnum:]]|-)*[[:alnum:]]))*|(#[[:digit:]]+)|(\\\\[([[:digit:]]{1,3}(\\\\.[[:digit:]]{1,3}){3})]))$/\", $email);\n\n}", "public static function isValid($email)\n {\n return (boolean) preg_match(\n '/^(?!(?>(?1)\"?(?>\\\\\\[ -~]|[^\"])\"?(?1)){255,})(?!(?>(?1)\"?(?>\\\\\\[ -~]|[^\"])\"?(?1)){65,}@)' .\n '((?>(?>(?>((?>(?>(?>\\x0D\\x0A)?[\\t ])+|(?>[\\t ]*\\x0D\\x0A)?[\\t ]+)?)(\\((?>(?2)' .\n '(?>[\\x01-\\x08\\x0B\\x0C\\x0E-\\'*-\\[\\]-\\x7F]|\\\\\\[\\x00-\\x7F]|(?3)))*(?2)\\)))+(?2))|(?2))?)' .\n '([!#-\\'*+\\/-9=?^-~-]+|\"(?>(?2)(?>[\\x01-\\x08\\x0B\\x0C\\x0E-!#-\\[\\]-\\x7F]|\\\\\\[\\x00-\\x7F]))*' .\n '(?2)\")(?>(?1)\\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' .\n '(?>(?1)\\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' .\n '|(?!(?:.*[a-f0-9][:\\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' .\n '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' .\n '|[1-9]?[0-9])(?>\\.(?9)){3}))\\])(?1)$/isD',\n $email ?: ''\n );\n }", "function email_check($email)\n{\n $regExp = \"^[_a-zA-Z0-9-öäüÖÄÜ]+(.[_a-zA-Z0-9-öäüÖÄÜ]+)*@([a-zA-Z0-9-öäüÖÄÜ]+.)+([a-zA-Z]{2,4})$\";\n if (!(preg_match($regExp, $email)))\n return false;\n else\n return true;\n}", "function is_valid_email($email)\n{\n if (is_null($email) || strlen($email) < 6)\n {\n return false;\n }\n $pattern = \"/^[_a-z0-9\\-]+(\\.[_a-z0-9\\-]+)*@[a-z0-9\\-]+(\\.[a-z0-9\\-]+)*(\\.[a-z]{2,4})$/\";\n return (preg_match($pattern, $email) == 1);\n}", "function check_email($email) {\n if (strlen($email) == 0) return false;\n if (eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,4})$\", $email)) return true;\n return false;\n}", "function isValidEmail($name){ \n\t$regexp = \"/^[^0-9][A-z0-9_]+([.][A-z0-9_]+)*[@][A-z0-9_]+([.][A-z0-9_]+)*[.][A-z]{2,4}$/\";\n\n\tif(preg_match($regexp, $name)) {\n\t return TRUE;\n\t}else{\n\t\treturn FALSE;\n\t}\n}", "function valid_email_address($mail) {\n $user = '[a-zA-Z0-9_\\-\\.\\+\\^!#\\$%&*+\\/\\=\\?\\`\\|\\{\\}~\\']+';\n $domain = '(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.?)+';\n $ipv4 = '[0-9]{1,3}(\\.[0-9]{1,3}){3}';\n $ipv6 = '[0-9a-fA-F]{1,4}(\\:[0-9a-fA-F]{1,4}){7}';\n\n return preg_match(\"/^$user@($domain|(\\[($ipv4|$ipv6)\\]))$/\", $mail);\n}", "function mme_checkemail( $email ) {\n\t$match = preg_match( '/^[A-z0-9_\\-.]+[@][A-z0-9_\\-]+([.][A-z0-9_\\-]+)+[A-z.]{2,4}$/', $email );\n\tif(!$match){\n\t\t$error_msg = 'Invalid E-mail address';\n\t\tmme_error_notice( $error_msg );\n\t\treturn false;\n\t\t}\n\treturn true;\n}", "function validate_email ($address) {\n return preg_match('/^[a-z0-9!#$%&\\'*+\\/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&\\'*+\\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i', $address);\n }", "function check_email($email) \n{\n if (strlen($email)== 0) \n\t\treturn false;\n if (eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,4})$\", $email)) \n\t\treturn true;\n return false;\n}", "static function validEmail($text){\r\n\t\t$pattern = \"/^[a-z0-9_.-]*@[a-z]+.[a-z]{2,3}$/i\";\r\n\t\t//$pattern = \"^[a-zA-Z0-9._-]+@[a-zA-Z]+\\.[a-zA-Z]{2,3}$\";\r\n\t\tif (preg_match($pattern, $text)) \r\n\t return true;\r\n\t\treturn false; \r\n\t}", "function validaremail($email){ \n if (!ereg(\"^([a-zA-Z0-9._]+)@([a-zA-Z0-9.-]+).([a-zA-Z]{2,4})$\",$email)){ \n return FALSE; \n } else { \n return TRUE; \n } \n}", "function check_email_address($email) {\n # Check @ symbol and lengths\n if (!ereg(\"^[^@]{1,64}@[^@]{1,255}$\", $email)) {\n return false;\n }\n\n # Split Email Address into Sections\n $email_array = explode(\"@\", $email);\n $local_array = explode(\".\", $email_array[0]);\n\n # Validate Local Section of the Email Address\n for ($i = 0; $i < sizeof($local_array); $i++) {\n if (!ereg(\"^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\\.-]{0,63})|(\\\"[^(\\\\|\\\")]{0,62}\\\"))$\", $local_array[$i])) {\n return false;\n }\n }\n\n # Validate Domain Section of the Email Address\n if (!ereg(\"^\\[?[0-9\\.]+\\]?$\", $email_array[1])) {\n $domain_array = explode(\".\", $email_array[1]);\n\n # Check the number of domain elements\n if (sizeof($domain_array) < 2) {\n return false;\n }\n\n # Sanity Check All Email Components\n for ($i = 0; $i < sizeof($domain_array); $i++) {\n if (!ereg(\"^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$\", $domain_array[$i])) {\n return false;\n }\n }\n }\n\n # If All Validation Checks have Passed then Return True\n return true;\n }", "function check_email($emaildddress)\n{\n\t$goodchars = '^[A-Za-z0-9\\._-]+@([A-Za-z][A-Za-z0-9-]{1,62})(\\.[A-Za-z][A-Za-z0-9-]{1,62})+$';\n\n\t$isvalid = true;\n\tif(!ereg($goodchars,$emaildddress))\n\t{\n\t\t$isvalid = false;\n\t}\n\treturn $isvalid;\n}", "function validate_email($email)\n{\n\treturn preg_match(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,6})$^\", $email);\n}", "function valid_mail($str) {\n\t\treturn (!preg_match(\"/^([a-z0-9\\+_\\-]+)(\\.[a-z0-9\\+_\\-]+)*@([a-z0-9\\-]+\\.)+[a-z]{2,6}$/ix\", $str)) ? FALSE : TRUE;\n\t}", "static function validEmail($email)\r\n {\r\n return !!preg_match(\"/^([a-z0-9\\+_\\-]+)(\\.[a-z0-9\\+_\\-]+)*@\r\n ([a-z0-9\\-]+\\.)+[a-z]{2,6}$/ix\", $email);;\r\n }", "function validateEmail($input){\n\t\t//REGEX string courtsey of http://www.white-hat-web-design.co.uk/articles/js-validation.php, others were produced by Robert Chisholm\n\t\t$inputReg = \"#^([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})$#\";\n\t\treturn preg_match($inputReg, $input);\n\t}", "function s2_is_valid_email($email)\n{\n $return = ($hook = s2_hook('fn_is_valid_email_start')) ? eval($hook) : null;\n if ($return != null)\n return $return;\n\n if (strlen($email) > 80)\n return false;\n\n return preg_match('/^(([^<>()[\\]\\\\.,;:\\s@\"\\']+(\\.[^<>()[\\]\\\\.,;:\\s@\"\\']+)*)|(\"[^\"\\']+\"))@((\\[\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\])|(([a-zA-Z\\d\\-]+\\.)+[a-zA-Z]{2,}))$/', $email);\n}", "function is_valid_email ($mail)\n{\n return filter_var($mail, FILTER_VALIDATE_EMAIL) && (! preg_match('/@\\[[^\\]]++\\]\\z/', $mail));\n}", "function mycheck_email($str)\n{\n $str = strtolower($str);\n return preg_match('/^[^\\@]+@.*\\.[a-z]{2,6}$/i', $str);\n}", "public static function validate_email($email){\r\n if(!preg_match('/^[a-zA-Z0-9]*(|[-._][a-zA-Z0-9]*)\\@([a-z]*)[.]([a-z]{3,4})/', $email)) return FALSE;\r\n return TRUE;\r\n }", "function cjpopups_is_email_valid($email){\n\treturn preg_match(\"/^[_a-z0-9-]+(\\.[_a-z0-9+-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,})$/i\", $email);\n}", "public function is_valid_email()\r\n {\r\n // email address.\r\n\r\n return (!empty($this->address) && preg_match($this->re_email, $this->address));\r\n }", "function VerifierAdresseMail($adresse)\n{\n $Syntaxe='#^[\\w.-]+@[\\w.-]+\\.[a-zA-Z]{2,6}$#';\n if(preg_match($Syntaxe,$adresse))\n return true;\n else\n return false;\n}", "private function emailValidation($field) {\t\r\n\t \t\t$sent = $this->getSentData($field);\r\n\t \t\t\r\n\t \t\t$email_pattern = '/^[^@\\s<&>]+@([-a-z0-9]+\\.)+[a-z]{2,}$/i';\r\n\t\t\tif (preg_match($email_pattern, $sent)) \r\n \t\t\treturn true;\r\n\t\t\telse\r\n\t\t\t\treturn false;\r\n\t \t}", "function check_email_address($email) \n{\n // First, we check that there's one @ symbol, and that the lengths are right\n if (!ereg(\"^[^@]{1,64}@[^@]{1,255}$\", $email)) \n {\n // Email invalid because wrong number of characters in one section, or wrong number of @ symbols.\n return false;\n }\n // Split it into sections to make life easier\n $email_array = explode(\"@\", $email);\n $local_array = explode(\".\", $email_array[0]);\n for ($i = 0; $i < sizeof($local_array); $i++) \n {\n if (!ereg(\"^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\\.-]{0,63})|(\\\"[^(\\\\|\\\")]{0,62}\\\"))$\", $local_array[$i])) \n {\n return false;\n }\n }\n if (!ereg(\"^\\[?[0-9\\.]+\\]?$\", $email_array[1])) \n { // Check if domain is IP. If not, it should be valid domain name\n $domain_array = explode(\".\", $email_array[1]);\n if (sizeof($domain_array) < 2) \n {\n return false; // Not enough parts to domain\n }\n for ($i = 0; $i < sizeof($domain_array); $i++) \n {\n if (!ereg(\"^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$\", $domain_array[$i])) \n {\n return false;\n }\n }\n }\n return true;\n}", "static public function validateEMail($email) {\n if (preg_match(\"/^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$/i\", $email)) {\n return true;\n }\n else {\n return false;\n }\n }", "function checkEmail($email)\n{\n // checks proper syntax\n if( !preg_match( \"/^([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\\._-]+)+$/\", $email))\n return false;\n else\n \treturn true;\n}", "function is_email($value)\r\n{\r\n\treturn preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i', $value);\r\n}", "function check_email($email) \r\n{ \r\n\t$emailArray = preg_split('//', $email); \r\n $atSign = false; \r\n $dotSign = false; \r\n $badCharacter = false; \r\n $validEmail = true; \r\n\tif (in_array (\"@\", $emailArray)) \r\n\t{ \r\n \t$atSign = true; \r\n } \r\n if (in_array (\".\", $emailArray)) \r\n\t{ \r\n \t$dotSign = true; \r\n } \r\n\t$badCharactersArray = array('#', '$', '%', '(', ')', '&', '!'); // Add your own bad \r\n\tfor ($i = 0; $i < sizeof($badCharactersArray); $i++) \r\n\t{ \r\n\t\tif (in_array ($badCharactersArray[$i], $emailArray)) \r\n \t{ \r\n \t\t$badCharacter = true; \r\n \t} \r\n\t} \r\n\tif ((!$atSign) or (!$dotSign) or ($badCharacter)) \r\n \t$validEmail = false; \r\n}", "private function _legacy_email_is_valid($email) {\n\t\t$valid_address = true;\n\n\t\t$mail_pat = '^(.+)@(.+)$';\n\t\t$valid_chars = \"[^] \\(\\)<>@,;:\\.\\\\\\\"\\[]\";\n\t\t$atom = \"$valid_chars+\";\n\t\t$quoted_user='(\\\"[^\\\"]*\\\")';\n\t\t$word = \"($atom|$quoted_user)\";\n\t\t$user_pat = \"^$word(\\.$word)*$\";\n\t\t$ip_domain_pat='^\\[([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\]$';\n\t\t$domain_pat = \"^$atom(\\.$atom)*$\";\n\n\t\tif (preg_match(\"/$mail_pat/\", $email, $components)) {\n\t\t\t$user = $components[1];\n\t\t\t$domain = $components[2];\n\t\t\t// validate user\n\t\t\tif (preg_match(\"/$user_pat/\", $user)) {\n\t\t\t\t// validate domain\n\t\t\t\tif (preg_match(\"/$ip_domain_pat/\", $domain, $ip_components)) {\n\t\t\t\t\t// this is an IP address\n\t\t\t\t\tfor ($i=1;$i<=4;$i++) {\n\t\t\t\t\t\tif ($ip_components[$i] > 255) {\n\t\t\t\t\t\t\t$valid_address = false;\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\telse {\n\t\t\t\t\t// Domain is a name, not an IP\n\t\t\t\t\tif (preg_match(\"/$domain_pat/\", $domain)) {\n\t\t\t\t\t\t/* domain name seems valid, but now make sure that it ends in a valid TLD or ccTLD\n\t\t\t\t\t\tand that there's a hostname preceding the domain or country. */\n\t\t\t\t\t\t$domain_components = explode(\".\", $domain);\n\t\t\t\t\t\t// Make sure there's a host name preceding the domain.\n\t\t\t\t\t\tif (sizeof($domain_components) < 2) {\n\t\t\t\t\t\t\t$valid_address = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$top_level_domain = strtolower($domain_components[sizeof($domain_components)-1]);\n\t\t\t\t\t\t\t// Allow all 2-letter TLDs (ccTLDs)\n\t\t\t\t\t\t\tif (preg_match('/^[a-z][a-z]$/', $top_level_domain) != 1) {\n\t\t\t\t\t\t\t\t$tld_pattern = '';\n\t\t\t\t\t\t\t\t// Get authorized TLDs from text file\n\t\t\t\t\t\t\t\t$tlds = file(DIR_WS_INCLUDES.'tld.txt');\n\t\t\t\t\t\t\t\tforeach($tlds as $line) {\n\t\t\t\t\t\t\t\t\t// Get rid of comments\n\t\t\t\t\t\t\t\t\t$words = explode('#', $line);\n\t\t\t\t\t\t\t\t\t$tld = trim($words[0]);\n\t\t\t\t\t\t\t\t\t// TLDs should be 3 letters or more\n\t\t\t\t\t\t\t\t\tif (preg_match('/^[a-z]{3,}$/', $tld) == 1) {\n\t\t\t\t\t\t\t\t\t\t$tld_pattern .= '^'.$tld.'$|';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Remove last '|'\n\t\t\t\t\t\t\t\t$tld_pattern = substr($tld_pattern, 0, -1);\n\t\t\t\t\t\t\t\tif (preg_match(\"/$tld_pattern/\", $top_level_domain) == 0) {\n\t\t\t\t\t\t\t\t\t$valid_address = false;\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\telse {\n\t\t\t\t\t\t$valid_address = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$valid_address = false;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$valid_address = false;\n\t\t}\n\t\tif ($valid_address && ENTRY_EMAIL_ADDRESS_CHECK == 'true') {\n\t\t\tif (!checkdnsrr($domain, \"MX\") && !checkdnsrr($domain, \"A\")) {\n\t\t\t\t$valid_address = false;\n\t\t\t}\n\t\t}\n\t\treturn $valid_address;\n\t}", "function validate_email($email)\n\t{\n\t\t$regexp = \"^([_a-z0-9-]+)(\\.[_a-z0-9-]+)*@([a-z0-9-]+)(\\.[a-z0-9-]+)*(\\.[a-z]{2,4})$\";\n\t\t// Presume that the email is invalid\n\t\t$valid = false;\n\t\t// Validate the syntax\n\t\tif (eregi($regexp, $email)) {\n\t\t\tlist($username, $domaintld) = split(\"@\", $email);\n\t\t\t$OS = $this->os_type();\n\t\t\tif ($OS == 'Linux') {\n\t\t\t\tif (checkdnsrr($domaintld, \"MX\")) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn $valid;\n\t}", "function is_valid_email($mail) {\r\t// simple: \t\"/^[-_a-z0-9]+(\\.[-_a-z0-9]+)*@[-a-z0-9]+(\\.[-a-z0-9]+)*\\.[a-z]{2,6}$/i\"\r\t$r = 0;\r\tif($mail) {\r\t\t$p =\t\"/^[-_a-z0-9]+(\\.[-_a-z0-9]+)*@[-a-z0-9]+(\\.[-a-z0-9]+)*\\.(\";\r\t\t// TLD (01-30-2004)\r\t\t$p .=\t\"com|edu|gov|int|mil|net|org|aero|biz|coop|info|museum|name|pro|arpa\";\r\t\t// ccTLD (01-30-2004)\r\t\t$p .=\t\"ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|az|ba|bb|bd|\";\r\t\t$p .=\t\"be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|\";\r\t\t$p .=\t\"cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|\";\r\t\t$p .=\t\"ec|ee|eg|eh|er|es|et|fi|fj|fk|fm|fo|fr|ga|gd|ge|gf|gg|gh|gi|\";\r\t\t$p .=\t\"gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|\";\r\t\t$p .=\t\"im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|\";\r\t\t$p .=\t\"ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mk|ml|\";\r\t\t$p .=\t\"mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|\";\r\t\t$p .=\t\"nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|\";\r\t\t$p .=\t\"py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|\";\r\t\t$p .=\t\"sr|st|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|\";\r\t\t$p .=\t\"tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|\";\r\t\t$p .=\t\"za|zm|zw\";\r\t\t$p .=\t\")$/i\";\r\r\t\t$r = preg_match($p, $mail) ? 1 : 0;\r\t}\r\treturn $r;\r}", "function is_valid_email($address) {\n $fields = preg_split(\"/@/\", $address, 2);\n if ((!preg_match(\"/^[0-9a-z]([-_.]?[0-9a-z])*$/i\", $fields[0])) || (!isset($fields[1]) || $fields[1] == '' || !is_valid_hostname_fqdn($fields[1], 0))) {\n return false;\n }\n return true;\n}", "private function isEmailValid($email)\n {\n //We could handle email format validation here\n }", "function ValidateEmail($email)\n{\n // $pattern = \"/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/g\";\n return (bool) filter_var($email, FILTER_VALIDATE_EMAIL);\n}", "function validateEmail($value) {\n\tif(ereg(\"^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$\", $value, $regs)) {\n\t\techo \"true\";\n\t} else {\n\t\techo \"false\";\n\t}\n}", "function validateEMAIL($EMAIL) {\n $v = '/^(?!(?:(?:\\\\x22?\\\\x5C[\\\\x00-\\\\x7E]\\\\x22?)|(?:\\\\x22?[^\\\\x5C\\\\x22]\\\\x22?)){255,})(?!(?:(?:\\\\x22?\\\\x5C[\\\\x00-\\\\x7E]\\\\x22?)|(?:\\\\x22?[^\\\\x5C\\\\x22]\\\\x22?)){65,}@)(?:(?:[\\\\x21\\\\x23-\\\\x27\\\\x2A\\\\x2B\\\\x2D\\\\x2F-\\\\x39\\\\x3D\\\\x3F\\\\x5E-\\\\x7E]+)|(?:\\\\x22(?:[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7F]|(?:\\\\x5C[\\\\x00-\\\\x7F]))*\\\\x22))(?:\\\\.(?:(?:[\\\\x21\\\\x23-\\\\x27\\\\x2A\\\\x2B\\\\x2D\\\\x2F-\\\\x39\\\\x3D\\\\x3F\\\\x5E-\\\\x7E]+)|(?:\\\\x22(?:[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7F]|(?:\\\\x5C[\\\\x00-\\\\x7F]))*\\\\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-+[a-z0-9]+)*\\\\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-+[a-z0-9]+)*)|(?:\\\\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\\\\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\\\\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\\\\]))$/iD';\n\n return (bool)preg_match($v, $EMAIL);\n}", "public function testEmailIsValid($data)\n {\n $pattern='/^[A-Za-z0-9_\\-]+(\\.[A-Za-z0-9_\\-]+)*\\@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,16})$/';\n $this->assertMatchesRegularExpression($pattern,$data);\n\n }", "function VerifieAdresseMail($adresse)\n{\n $Syntaxe='#^[\\w.-]+@[\\w.-]+\\.[a-zA-Z]{2,6}$#';\n if(preg_match($Syntaxe,$adresse))\n return true;\n else\n return false;\n}", "function email_is_valid($email) {\n return filter_var($email, FILTER_VALIDATE_EMAIL);\n }", "public static function validateFormat(string $email): bool {\n\t\t$regExp = '/^([a-z0-9\\+_\\-]+)(\\.[a-z0-9\\+_\\-]+)*@([a-z0-9\\-]+\\.)+[a-z]{2,6}$/ix';\n\n\t\treturn (bool) preg_match($regExp, $email);\n\t}", "function is_email($emailadres)\r\n{\r\n // Eerst een snelle controle uitvoeren: \r\n // een e-mailadres moet uit minimaal 7 tekens bestaan:\r\n if (strlen($emailadres) < 7) \r\n {\r\n return false;\r\n }\r\n // Daarna een controle met een reguliere expressie uitvoeren:\r\n if( ! ereg(\"^[_a-zA-Z0-9-]+(\\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\\.)+([a-zA-Z]{2,4})$\", $emailadres) ) \r\n {\r\n return false;\r\n } \r\n\r\n return true; \r\n}", "function isEmail($email) {\r\n\r\n\treturn preg_match(\"/^(((([^]<>()[\\.,;:@\\\" ]|(\\\\\\[\\\\x00-\\\\x7F]))\\\\.?)+)|(\\\"((\\\\\\[\\\\x00-\\\\x7F])|[^\\\\x0D\\\\x0A\\\"\\\\\\])+\\\"))@((([[:alnum:]]([[:alnum:]]|-)*[[:alnum:]]))(\\\\.([[:alnum:]]([[:alnum:]]|-)*[[:alnum:]]))*|(#[[:digit:]]+)|(\\\\[([[:digit:]]{1,3}(\\\\.[[:digit:]]{1,3}){3})]))$/\", $email);\r\n\r\n}", "function isEmail($verify_email) {\n\t\n\t\treturn(preg_match(\"/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i\",$verify_email));\n\t\n\t}", "function isemail($email) {\r\n return preg_match('|^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]{2,})+$|i', $email);\r\n\r\n // /* Define the test for a valid email address */ \r\n // $email_test = \"/ \r\n // ^([a-zA-Z0-9_\\.\\-\\+]) \r\n // + \r\n // \\@ \r\n // (([a-zA-Z0-9\\-])+\\.) \r\n // + \r\n // ([a-zA-Z0-9]{2,4})+$ \r\n // /x\"; \r\n}", "function check($email)\n\t{\n\t if (preg_match(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $email, $matches))\n\t { \n\t //if (checkdate($matches[2], $matches[3], $matches[1]))\n\t //{ \n\t return true; \n\t //} \n\t } \n\t return false;\n\t}", "function isEmail($input) {\n // Matches Email addresses. (Found out how to break up a RedEx so that it can be nicly commited.)\n return (preg_match(\n \"~(^ ## Match starts at the beginning of the string.\n (?>[[:alnum:]._-])+ ## Matches any alpha numaric character plus the '.', '_', and '-'\n ## For the name part of an address. \n (?>@) ## Matches the at sign.\n (?>[[:alnum:]])+ ## Matches any alpha numaric character\n ## For the Place part of the address.\n \n (?> ## To match things like 'uk.com 'or just '.com'\n (?:\\.[[:alpha:]]{2,3}\\.[[:alpha:]]{2,3}) ## Matches a '.' then 2-3 alphabet characters\n ## then another '.' and 2-3 alphabet characters.\n | ## Or Matches\n (?:\\.[[:alpha:]]{2,3}) ## a single '.' then 2-3 alphabet characters.\n )\n $ ## Match to the end of the string.\n )~x\", $input));\n }", "function CheckEmail($email) {\n if (!eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $email)) {\n return false;\n } else {\n return true;\n }\n }", "function EmailValidation($email)\n{ \n $email = htmlspecialchars(stripslashes(strip_tags($email)));\n if(preg_match(\"/^([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\\._-]+)+$/\",$email))\n {\n /*$domain = explode('@', $email);\n $domain = $domain[1];\n if(!checkdnsrr($domain,'MX'))\n {\n //return false;\n return true;\n }*/\n return true;\n }\n else\n {\n return false;\n }\n}", "function ValidateEmail($email) {\r\n\t//$email = \"[email protected]\";\r\n\r\n\tif(eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $email)) {\r\n\t //echo \"Valid email address.\";\r\n\t return TRUE;\r\n\t}\r\n\telse {\r\n\t //echo \"Invalid email address.\";\r\n\t return FALSE;\r\n\t}\r\n}", "function isEmail($email)\n{\n if(preg_match(\"~([a-zA-Z0-9!#$%&'*+-/=?^_`{|}~])@([a-zA-Z0-9-]).([a-zA-Z0-9]{2,4})~\",$email)) \n {\n return true;\n }else{\n return false;\n } \n}", "public static function validate_email($email) {\n\t // First, we check that there's one @ symbol, \n\t // and that the lengths are right.\n\t if (!ereg(\"^[^@]{1,64}@[^@]{1,255}$\", $email)) {\n\t // Email invalid because wrong number of characters \n\t // in one section or wrong number of @ symbols.\n\t return false;\n\t }\n\t // Split it into sections to make life easier\n\t $email_array = explode(\"@\", $email);\n\t $local_array = explode(\".\", $email_array[0]);\n\t for ($i = 0; $i < sizeof($local_array); $i++) {\n\t if\n\t(!ereg(\"^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&\n\t↪'*+/=?^_`{|}~\\.-]{0,63})|(\\\"[^(\\\\|\\\")]{0,62}\\\"))$\",\n\t$local_array[$i])) {\n\t return false;\n\t }\n\t }\n\t // Check if domain is IP. If not, \n\t // it should be valid domain name\n\t if (!ereg(\"^\\[?[0-9\\.]+\\]?$\", $email_array[1])) {\n\t $domain_array = explode(\".\", $email_array[1]);\n\t if (sizeof($domain_array) < 2) {\n\t return false; // Not enough parts to domain\n\t }\n\t for ($i = 0; $i < sizeof($domain_array); $i++) {\n\t if\n\t(!ereg(\"^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|\n\t↪([A-Za-z0-9]+))$\",\n\t$domain_array[$i])) {\n\t return false;\n\t }\n\t }\n\t }\n\t return true;\n\t}", "public static function validate_email($email) {\n\t\t// First, we check that there's one @ symbol, \n\t\t// and that the lengths are right.\n\t\tif (!ereg(\"^[^@]{1,64}@[^@]{1,255}$\", $email)) {\n\t\t\t// Email invalid because wrong number of characters \n\t\t\t// in one section or wrong number of @ symbols.\n\t\t\treturn false;\n\t\t}\n\t\t// Split it into sections to make life easier\n\t\t$email_array = explode(\"@\", $email);\n\t\t$local_array = explode(\".\", $email_array[0]);\n\t\tfor ($i = 0; $i < sizeof($local_array); $i++) {\n\t\t\tif(!ereg(\"^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&\n\t\t\t?'*+/=?^_`{|}~\\.-]{0,63})|(\\\"[^(\\\\|\\\")]{0,62}\\\"))$\",\n\t\t\t$local_array[$i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// Check if domain is IP. If not, \n\t\t// it should be valid domain name\n\t\tif (!ereg(\"^\\[?[0-9\\.]+\\]?$\", $email_array[1])) {\n\t\t\t$domain_array = explode(\".\", $email_array[1]);\n\t\t\tif (sizeof($domain_array) < 2) {\n\t\t\t\treturn false; // Not enough parts to domain\n\t\t\t}\n\t\t\tfor ($i = 0; $i < sizeof($domain_array); $i++) {\n\t\t\t\tif(!ereg(\"^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|\n\t\t\t\t\t?([A-Za-z0-9]+))$\",\n\t\t\t\t$domain_array[$i])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function validEmail($email)\r\n {\r\n return !empty($email) && preg_match(\"/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}$/\", $email);\r\n }", "public function validateEmail($email)\n {\n return 1 == preg_match($this->emailRegex, $email);\n }", "public function validateEMail($email) {\n //if(eregi(\"^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$\", $email)) {\n // PHP 5.3 compatibility - eregi is deprecated\n if (preg_match(\"/^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$/i\", $email)) {\n return true;\n }\n else {\n return false;\n }\n }", "public function verifyContainsEmail(): bool\n {\n $words = explode(' ', $this->input);\n foreach ($words as $word) {\n if (static::isValidEmail($word)) {\n return true;\n }\n }\n \n return false;\n }", "private function email_Check_Validation($email){\r\n return (filter_var($email, FILTER_VALIDATE_EMAIL)) ? true : false;\r\n }", "function oos_validate_is_email($sEmail) {\n $bValidAddress = true;\n\n $mail_pat = '^(.+)@(.+)$';\n $valid_chars = \"[^] \\(\\)<>@,;:\\.\\\\\\\"\\[]\";\n $atom = \"$valid_chars+\";\n $quoted_user='(\\\"[^\\\"]*\\\")';\n $word = \"($atom|$quoted_user)\";\n $user_pat = \"^$word(\\.$word)*$\";\n $ip_domain_pat='^\\[([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\]$';\n $domain_pat = \"^$atom(\\.$atom)*$\";\n\n if (eregi($mail_pat, $sEmail, $components)) {\n $user = $components[1];\n $domain = $components[2];\n // validate user\n if (eregi($user_pat, $user)) {\n // validate domain\n if (eregi($ip_domain_pat, $domain, $ip_components)) {\n // this is an IP address\n \t for ($i=1;$i<=4;$i++) {\n \t if ($ip_components[$i] > 255) {\n \t $bValidAddress = false;\n \t break;\n \t }\n }\n } else {\n // Domain is a name, not an IP\n if (eregi($domain_pat, $domain)) {\n /* domain name seems valid, but now make sure that it ends in a valid TLD or ccTLD\n and that there's a hostname preceding the domain or country. */\n $domain_components = explode(\".\", $domain);\n // Make sure there's a host name preceding the domain.\n if (count($domain_components) < 2) {\n $bValidAddress = false;\n } else {\n $top_level_domain = strtolower($domain_components[count($domain_components)-1]);\n // Allow all 2-letter TLDs (ccTLDs)\n if (eregi('^[a-z][a-z]$', $top_level_domain) != 1) {\n $sTld = get_all_top_level_domains();\n if (eregi(\"$sTld\", $top_level_domain) == 0) {\n $bValidAddress = false;\n }\n }\n }\n } else {\n \t $bValidAddress = false;\n \t }\n \t}\n } else {\n $bValidAddress = false;\n }\n } else {\n $bValidAddress = false;\n }\n if ($bValidAddress && ENTRY_EMAIL_ADDRESS_CHECK == '1') {\n if (!checkdnsrr($domain, \"MX\") && !checkdnsrr($domain, \"A\")) {\n $bValidAddress = false;\n }\n }\n return $bValidAddress;\n }", "function isValidEMail ($string)\n{\n return (preg_match ('/^([a-z0-9])(([-a-z0-9._])*([a-z0-9]))*\\@([a-z0-9])(([a-z0-9-])*([a-z0-9]))+(\\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)+$/i', $string) ? 1 : 0);\n}", "public static function is_email($value) {\r\n\t\t$parts = explode('@', $value, 2);\r\n\t\t$local_part = array_shift($parts);\r\n\t\t$domain = array_shift($parts);\r\n\t\t\r\n\t\t$ret = self::is_domain($domain);\r\n\t\t// local part may be up to 64 characters \r\n\t\t$ret = $ret && (strlen($local_part) <= 64);\r\n\t\t// dot is not allowed at the end or beginning\r\n\t\t// There is also a rule that 2 or more dots are illegal like in '[email protected]'\r\n\t\t// Unfortunately: my neighbor's address IS [email protected]! And I can't lock my neighbor \r\n\t\t// out of the services I program, can I? \r\n\t\t$ret = $ret && (substr($local_part, 0, 1) !== '.');\r\n\t\t$ret = $ret && (substr($local_part, -1) !== '.');\r\n\t\t// Only a-z, A-Z, 0-9 and !#$%&'*+-/=?^_`{|}~ and . are allowed\r\n\t\t// (There is quoting and escaping, but we do not hear, we do not hear, we do not hear...)\r\n\t\t$pattern = \"@^[a-zA-Z0-9!#$%&'*+\\-/=?^_`{|}~.]+$@s\";\r\n\t\t$ret = $ret && preg_match($pattern, strtr($local_part, \"\\r\\n\", ' '));\r\n\t\t\r\n\t\treturn $ret;\r\n\t}", "private function check_email_syntax($email) {\n\t\tif (preg_match('/(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)/', $email) || !preg_match('/^\\S+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$/', $email)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public static function emailIsValid( $str ) {\r\n if ( is_string($str) && !empty($str) && preg_match(\"/[A-Za-z0-9_]{2,}+@[A-Za-z0-9_]{2,}+\\.[A-Za-z0-9_]{2,}/\",$str) != 0 ) {\r\n return true;\r\n } \r\n return false; \r\n }", "function validateEmail($string)\n\t\t{\n\t\t\t$pattern\t=\t\"/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\\.[a-zA-Z.]{2,5}$/\";\n\t\t\tif(preg_match($pattern,$string)){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function emailValidation($email)\n\t{\n\t\tif (!filter_var($email, FILTER_VALIDATE_EMAIL))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\treturn 1;\n \t}", "function validEmail($email) {\n\t $isValid = true;\n\t $atIndex = strrpos($email, \"@\");\n\t\tif (is_bool($atIndex) && !$atIndex) {\n\t\t $isValid = false; \n\t\t} else {\n\t\t $domain = substr($email, $atIndex+1);\n\t\t $local = substr($email, 0, $atIndex);\n\t\t $localLen = strlen($local);\n\t\t $domainLen = strlen($domain);\n\t\t if ($localLen < 1 || $localLen > 64)\n\t\t {\n\t\t\t // local part length exceeded\n\t\t\t $isValid = false;\n\t\t }\n\t\t else if ($domainLen < 1 || $domainLen > 255)\n\t\t {\n\t\t\t // domain part length exceeded\n\t\t\t $isValid = false;\n\t\t }\n\t\t else if ($local[0] == '.' || $local[$localLen-1] == '.')\n\t\t {\n\t\t\t // local part starts or ends with '.'\n\t\t\t $isValid = false;\n\t\t }\n\t\t else if (preg_match('/\\\\.\\\\./', $local))\n\t\t {\n\t\t\t // local part has two consecutive dots\n\t\t\t $isValid = false;\n\t\t }\n\t\t else if (!preg_match('/^[A-Za-z0-9\\\\-\\\\.]+$/', $domain))\n\t\t {\n\t\t\t // character not valid in domain part\n\t\t\t $isValid = false;\n\t\t }\n\t\t else if (preg_match('/\\\\.\\\\./', $domain))\n\t\t {\n\t\t\t // domain part has two consecutive dots\n\t\t\t $isValid = false;\n\t\t }\n\t\t else if (!preg_match('/^(\\\\\\\\.|[A-Za-z0-9!#%&`_=\\\\/$\\'*+?^{}|~.-])+$/',\n\t\t\t\t\t str_replace(\"\\\\\\\\\",\"\",$local)))\n\t\t {\n\t\t\t // character not valid in local part unless \n\t\t\t // local part is quoted\n\t\t\t if (!preg_match('/^\"(\\\\\\\\\"|[^\"])+\"$/',\n\t\t\t\t str_replace(\"\\\\\\\\\",\"\",$local)))\n\t\t\t {\n\t\t\t\t$isValid = false;\n\t\t\t }\n\t\t }\n\t\t if ($isValid && !(checkdnsrr($domain,\"MX\"))) {\n\t\t\t // domain not found in DNS\n\t\t\t $isValid = false;\n\t\t }\n\t\t}\n\t return $isValid;\n\t}", "function isEmail($input){\n return preg_match('/[a-z0-9]@[a-z]{3,}\\.[a-z]{3}$/',$input);\n }", "function checkEmail($email) {\n\t\t\tif(!eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $email)) {return false;}\n\t\t\treturn true;\n\t\t}", "function bwm_validate_email($email) {\r\n\t$isValid = true;\r\n\t$atIndex = strrpos($email, \"@\");\r\n\tif (is_bool($atIndex) && !$atIndex) {\r\n\t $isValid = false;\r\n\t} else {\r\n $domain = substr($email, $atIndex+1);\r\n $local = substr($email, 0, $atIndex);\r\n $localLen = strlen($local);\r\n $domainLen = strlen($domain);\r\n if ($localLen < 1 || $localLen > 64) {\r\n // local part length exceeded\r\n $isValid = false;\r\n } else if ($domainLen < 1 || $domainLen > 255) {\r\n // domain part length exceeded\r\n $isValid = false;\r\n } else if ($local[0] == '.' || $local[$localLen-1] == '.') {\r\n // local part starts or ends with '.'\r\n $isValid = false;\r\n } else if (preg_match('/\\\\.\\\\./', $local)) {\r\n // local part has two consecutive dots\r\n $isValid = false;\r\n } else if (!preg_match('/^[A-Za-z0-9\\\\-\\\\.]+$/', $domain)) {\r\n // character not valid in domain part\r\n $isValid = false;\r\n } else if (preg_match('/\\\\.\\\\./', $domain)) {\r\n // domain part has two consecutive dots\r\n $isValid = false;\r\n } else if (!preg_match('/^(\\\\\\\\.|[A-Za-z0-9!#%&`_=\\\\/$\\'*+?^{}|~.-])+$/', str_replace(\"\\\\\\\\\",\"\",$local))) {\r\n // character not valid in local part unless \r\n // local part is quoted\r\n if (!preg_match('/^\"(\\\\\\\\\"|[^\"])+\"$/', str_replace(\"\\\\\\\\\",\"\",$local))) {\r\n $isValid = false;\r\n }\r\n }\r\n if ($isValid && function_exists('checkdnsrr') && !(checkdnsrr($domain,\"MX\") || checkdnsrr($domain,\"A\"))) {\r\n // domain not found in DNS\r\n $isValid = false;\r\n }\r\n\t}\r\n\treturn $isValid;\r\n}", "function emailOk ($email) {\r\n return filter_var($email, FILTER_VALIDATE_EMAIL);\r\n }", "public static function validateEMAIL($email) {\n if (filter_var($email, FILTER_VALIDATE_EMAIL))\n return true;\n else\n return false; \n }", "public static function ValidaEmailValido($email) {\n // if (!preg_match('/^([a-zA-Z0-9.-])*([@])([a-z0-9]).([a-z]{2,3})/', $email)) {\n // return false;\n // } else {\n //Valida o dominio\n \n $dominio = explode('@', $email);\nerror_reporting(0);\nini_set('display_errors', FALSE);\n try {\n if (!checkdnsrr($dominio[1], 'A')) {\n return false;\n } else {\n return true;\n } // Retorno true para indicar que o e-mail é valido\n } catch (Exception $ex) {\n return false;\n }\n \n // }\n }", "function verifyEmail ($testString)\n\t{\n return (preg_match(\"/^([[:alnum:]]|_|\\.|-)+@([[:alnum:]]|\\.|-)+(\\.)([a-z]{2,4})$/\", $testString));\n }", "function checkNUVEmail($email) {\n\t\t$regEX = \"/([a-zA-Z0-9_]+)([\\.{1}_])?([a-zA-Z0-9_]+)\\@nuv([\\.])ac([\\.])in/\";\n\t\tif (preg_match($regEX, $email)) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t\texit();\t\n\t\t}\n\t}", "function ValidEmail( $address, $leMail )\r\n\t\t{\r\n\t\tif( ereg( \".*<(.+)>\", $address, $regs ) )\r\n\t\t\t$address = $regs[1];\r\n\r\n\t\tif( !ereg( \"^[^@ ]+@([a-zA-Z0-9\\-]+\\.)+([a-zA-Z0-9\\-]{2}|net|com|gov|mil|org|edu|int)\\$\",$address) )\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t\t}", "public function is_valid_email() {\n\n $this->ci->form_validation->set_message(\"is_valid_email\", \"Invalid email format.\");\n $result = ( ! preg_match(\"/^([a-z0-9\\+_\\-]+)(\\.[a-z0-9\\+_\\-]+)*@([a-z0-9\\-]+\\.)+[a-z]{2,6}$/ix\",\n $this->ci->input->post(\"email\"))) ? FALSE : TRUE;\n return $result;\n }", "private function checkEmail($email)\n {\n $pattern = '/\\b[\\w.-]+@[\\w.-]+\\.[A-Za-z]{2,6}\\b/';\n if(!preg_match($pattern, $email) ){\n echo \"ERROR nell' email : \".$email;\n throw new InvalidArgumentException();\n }\n else return true;\n }", "function isValidEmail($email) {\n\n\t\t// First, we check that there's one @ symbol, and that the lengths are right\n\n\t\tif (!preg_match(\"/^[^@]{1,64}@[a-zA-z0-9].{1,255}$/\", $email)) {\n\t\t\t// Email invalid because wrong number of characters in one section, or wrong number of @ symbols.\n\t\t\treturn false;\n\t\t}\n\n\t\t// Split it into sections to make life easier\n\n\t\t$email_array = explode(\"@\", $email);\n\t\t$local_array = explode(\".\", $email_array[0]);\n\t\tfor ($i = 0; $i < sizeof($local_array); $i++) {\n\t\t\tif (!preg_match(\"/^(([A-Za-z0-9!#$%&'*+\\/=?^_`{|}~-][A-Za-z0-9!#$%&'*+\\/=?^_`{|}~\\.-]{0,63})|(\\\"[^(\\\\|\\\")]{0,62}\\\"))$/\", $local_array[$i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (!preg_match(\"/^\\[?[0-9\\.]+\\]?$/\", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name\n\t\t\t$domain_array = explode(\".\", $email_array[1]);\n\t\t\tif (sizeof($domain_array) < 2) {\n\t\t\t\treturn false; // Not enough parts to domain\n\t\t\t}\n\n\t\t\tfor ($i = 0; $i < sizeof($domain_array); $i++) {\n\t\t\t\tif (!preg_match(\"/^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$/\", $domain_array[$i])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n }", "function check_email_address($email) {\n\t$isValid = true;\n\t$atIndex = strrpos($email, \"@\");\n\tif (is_bool($atIndex) && !$atIndex) {\n\t\t$isValid = false;\n\t}\n\telse {\n\t\t$domain = substr($email, $atIndex+1);\n\t\t$local = substr($email, 0, $atIndex);\n\t\t$localLen = strlen($local);\n\t\t$domainLen = strlen($domain);\n\t\tif ($localLen < 1 || $localLen > 64) {\n\t\t\t// local part length exceeded\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if ($domainLen < 1 || $domainLen > 255) {\n\t\t\t// domain part length exceeded\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if ($local[0] == '.' || $local[$localLen-1] == '.') {\n\t\t\t// local part starts or ends with '.'\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if (preg_match('/\\\\.\\\\./', $local)) {\n\t\t\t// local part has two consecutive dots\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if (!preg_match('/^[A-Za-z0-9\\\\-\\\\.]+$/', $domain)) {\n\t\t\t// character not valid in domain part\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if (preg_match('/\\\\.\\\\./', $domain)) {\n\t\t\t// domain part has two consecutive dots\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if (!preg_match('/^(\\\\\\\\.|[A-Za-z0-9!#%&`_=\\\\/$\\'*+?^{}|~.-])+$/',\n\t\tstr_replace(\"\\\\\\\\\",\"\",$local)))\n\t\t{\n\t\t // character not valid in local part unless \n\t\t // local part is quoted\n\t\t if (!preg_match('/^\"(\\\\\\\\\"|[^\"])+\"$/', str_replace(\"\\\\\\\\\",\"\",$local))) {\n\t\t\t$isValid = false;\n\t\t }\n\t\t}\n\t\tif ($isValid && !(checkdnsrr($domain,\"MX\") || checkdnsrr($domain,\"A\"))) {\n\t\t\t// domain not found in DNS\n\t\t\t$isValid = false;\n\t\t}\n\t}\n\treturn $isValid;\n}", "function is_email($addr)\n{\n $addr = strtolower(trim($addr));\n $addr = str_replace(\"&#064;\",\"@\",$addr);\n if ( (strstr($addr, \"..\")) || (strstr($addr, \".@\")) || (strstr($addr, \"@.\")) || (!preg_match(\"/^[[:alnum:]][a-z0-9_.-]*@[a-z0-9][a-z0-9.-]{0,61}[a-z0-9]\\.[a-z]{2,6}\\$/\", stripslashes(trim($addr)))) ) {\n $emailvalidity = 0;\n } else {\n $emailvalidity = 1;\n }\n return $emailvalidity;\n}", "public function validaEmail()\n {\n $regex = '/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/';\n\n if (!strlen(trim($this->email)) || !preg_match($regex, $this->email)) {\n return 'E-mail inválido! <br>';\n }\n\n return '';\n }", "function isEmail($email) {\nreturn(preg_match(\"/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i\",$email));\n}", "function smcf_validate_email($email) {\r\n\t$at = strrpos($email, \"@\");\r\n\r\n\t// Make sure the at (@) sybmol exists and \r\n\t// it is not the first or last character\r\n\tif ($at && ($at < 1 || ($at + 1) == strlen($email)))\r\n\t\treturn false;\r\n\r\n\t// Make sure there aren't multiple periods together\r\n\tif (preg_match(\"/(\\.{2,})/\", $email))\r\n\t\treturn false;\r\n\r\n\t// Break up the local and domain portions\r\n\t$local = substr($email, 0, $at);\r\n\t$domain = substr($email, $at + 1);\r\n\r\n\r\n\t// Check lengths\r\n\t$locLen = strlen($local);\r\n\t$domLen = strlen($domain);\r\n\tif ($locLen < 1 || $locLen > 64 || $domLen < 4 || $domLen > 255)\r\n\t\treturn false;\r\n\r\n\t// Make sure local and domain don't start with or end with a period\r\n\tif (preg_match(\"/(^\\.|\\.$)/\", $local) || preg_match(\"/(^\\.|\\.$)/\", $domain))\r\n\t\treturn false;\r\n\r\n\t// Check for quoted-string addresses\r\n\t// Since almost anything is allowed in a quoted-string address,\r\n\t// we're just going to let them go through\r\n\tif (!preg_match('/^\"(.+)\"$/', $local)) {\r\n\t\t// It's a dot-string address...check for valid characters\r\n\t\tif (!preg_match('/^[-a-zA-Z0-9!#$%*\\/?|^{}`~&\\'+=_\\.]*$/', $local))\r\n\t\t\treturn false;\r\n\t}\r\n\r\n\t// Make sure domain contains only valid characters and at least one period\r\n\tif (!preg_match(\"/^[-a-zA-Z0-9\\.]*$/\", $domain) || !strpos($domain, \".\"))\r\n\t\treturn false;\t\r\n\r\n\treturn true;\r\n}", "function emailIsValid($email,&$reason) {\r\n $isValid= true;\r\n $reasons= array();\r\n $atIndex= strrpos($email, \"@\");\r\n if (is_bool($atIndex) && !$atIndex) {\r\n $isValid= false;\r\n $reasons[]= \"chybí @\";\r\n }\r\n else {\r\n $domain= substr($email, $atIndex+1);\r\n $local= substr($email, 0, $atIndex);\r\n $localLen= strlen($local);\r\n $domainLen= strlen($domain);\r\n if ($localLen < 1 || $localLen > 64) {\r\n $isValid= false;\r\n $reasons[]= \"dlouhé jméno\";\r\n }\r\n else if ($domainLen < 1 || $domainLen > 255) {\r\n $isValid= false;\r\n $reasons[]= \"dlouhá doména\";\r\n }\r\n else if ($local[0] == '.' || $local[$localLen-1] == '.') {\r\n $reasons[]= \"tečka na kraji\";\r\n $isValid= false;\r\n }\r\n else if (preg_match('/\\\\.\\\\./', $local)) {\r\n $reasons[]= \"dvě tečky ve jménu\";\r\n $isValid= false;\r\n }\r\n else if (!preg_match('/^[A-Za-z0-9\\\\-\\\\.]+$/', $domain)) {\r\n $reasons[]= \"chybný znak v doméně\";\r\n $isValid= false;\r\n }\r\n else if (preg_match('/\\\\.\\\\./', $domain)) {\r\n $reasons[]= \"dvě tečky v doméně\";\r\n $isValid= false;\r\n }\r\n else if (!preg_match('/^(\\\\\\\\.|[A-Za-z0-9!#%&`_=\\\\/$\\'*+?^{}|~.-])+$/', str_replace(\"\\\\\\\\\",\"\",$local))) {\r\n $reasons[]= \"chybný znak ve jménu\";\r\n if (!preg_match('/^\"(\\\\\\\\\"|[^\"])+\"$/',\r\n str_replace(\"\\\\\\\\\",\"\",$local))) {\r\n $isValid= false;\r\n }\r\n }\r\n if ( $domain!='proglas.cz' && $domain!='setkani.org' ) {\r\n if ($isValid && !(checkdnsrr($domain,\"MX\") || checkdnsrr($domain,\"A\"))) {\r\n $reasons[]= \"$domain je neznámá doména\";\r\n $isValid= false;\r\n }\r\n }\r\n }\r\n $reason= count($reasons) ? implode(', ',$reasons) : '';\r\n return $isValid;\r\n}", "function email_check($email) {\n\tif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\treturn false; \n\t}\n\t$domain = explode(\"@\",$email);\n\tif (!checkdnsrr($domain[1], 'MX')) {\n\t\treturn false; \n\t}\n\treturn true;\n}", "function validate_email($email){\n\t\n\tif(empty($email)){\n\t\t\n\t\treturn false;\n\t\t\n\t}\n\tif(count(explode('@',$email)) != 2){\n\t\t\n\t\treturn false;\n\t\t\n\t}\n\telse {\n\t\t\n\t\t$words = explode('@',$email);\n\t\t\t$second = $words[1];\n\t\t\tif(count(explode('.',$email)) != 2){\n\t\t\t\n\t\t\treturn false;\n\t\t\n\t\t}\n\t\t\n\t}\n\t\treturn true;\n\t\n\t\n}", "function check_email($email) {\r\n\r\n if (filter_var($email, FILTER_VALIDATE_EMAIL)) {\r\n return true;\r\n }\r\n return false;\r\n}", "function validEmail($email)\n{\n $isValid = true;\n $atIndex = strrpos($email, \"@\");\n if (is_bool($atIndex) && !$atIndex) {\n $isValid = false;\n }\n else {\n $domain = substr($email, $atIndex+1);\n $local = substr($email, 0, $atIndex);\n $localLen = strlen($local);\n $domainLen = strlen($domain);\n if ($localLen < 1 || $localLen > 64) {\n // local part length exceeded\n $isValid = false;\n } else if ($domainLen < 1 || $domainLen > 255) {\n // domain part length exceeded\n $isValid = false;\n } else if ($local[0] == '.' || $local[$localLen-1] == '.') {\n // local part starts or ends with '.'\n $isValid = false;\n } else if (preg_match('/\\\\.\\\\./', $local)) {\n // local part has two consecutive dots\n $isValid = false;\n } else if (!preg_match('/^[A-Za-z0-9\\\\-\\\\.]+$/', $domain)) {\n // character not valid in domain part\n $isValid = false;\n } else if (preg_match('/\\\\.\\\\./', $domain)) {\n // domain part has two consecutive dots\n $isValid = false;\n } else if(!preg_match('/^(\\\\\\\\.|[A-Za-z0-9!#%&`_=\\\\/$\\'*+?^{}|~.-])+$/',\n str_replace(\"\\\\\\\\\",\"\",$local))) {\n // character not valid in local part unless \n // local part is quoted\n if (!preg_match('/^\"(\\\\\\\\\"|[^\"])+\"$/',\n str_replace(\"\\\\\\\\\",\"\",$local))) {\n $isValid = false;\n }\n } if ($isValid && !(checkdnsrr($domain,\"MX\") || checkdnsrr($domain,\"A\"))) {\n // domain not found in DNS\n $isValid = false;\n }\n }\n return $isValid;\n}", "public static function email($email){\n\t \n\t\tif (mb_strlen($email, 'UTF-8') > 254) \n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$expression = '/^[-_a-z0-9\\'+*$^&%=~!?{}]++(?:\\.[-_a-z0-9\\'+*$^&%=~!?{}]+)*+@(?:(?![-.])[-a-z0-9.]+(?<![-.])\\.[a-z]{2,6}|\\d{1,3}(?:\\.\\d{1,3}){3})$/iD';\n\t\treturn (bool) preg_match($expression, (string) $email);\n\t}", "function checkmail($youremail)\n{\n if (ereg('^[-!#$%&\\'*+\\\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&\\'*+\\\\/0-9=?A-Z^_`a-z{|}~]+\\.'.\n '[-!#$%&\\'*+\\\\./0-9=?A-Z^_`a-z{|}~]+$', $youremail)) \n {\n\t return true;\n } \n else \n {\n\t return false;\n }\n}", "function is_email_valid($email) {\n\treturn filter_var($email, FILTER_VALIDATE_EMAIL);\n}", "function virustotalscan_valid_email($email) \r\n{\r\n\tif (function_exists(\"filter_var\") && !filter_var($email, FILTER_VALIDATE_EMAIL)) {\r\n return false;\r\n }\r\n else {\r\n // daca functia exista atunci se returneaza true\r\n if (function_exists(\"filter_var\")) return true;\r\n else {\r\n // altfel inseamna ca functia nu exista si trebuie sa utilizam o alta metoda\r\n return eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $email);\r\n }\r\n }\r\n}" ]
[ "0.78545606", "0.7781056", "0.77509636", "0.7744848", "0.7735422", "0.7688499", "0.76484436", "0.76139176", "0.7604381", "0.7590295", "0.7571184", "0.7563633", "0.7554553", "0.75328153", "0.7516172", "0.748608", "0.7461819", "0.7446184", "0.744234", "0.74380785", "0.74354017", "0.74341047", "0.7429976", "0.7426961", "0.74236286", "0.7419284", "0.74118006", "0.7410671", "0.73736566", "0.7371648", "0.7352004", "0.7346997", "0.734563", "0.7341179", "0.73306006", "0.7323145", "0.7311927", "0.7311018", "0.730516", "0.7304307", "0.7303087", "0.7296172", "0.72826725", "0.7276269", "0.7272361", "0.7261898", "0.7250232", "0.72468066", "0.7245565", "0.7242395", "0.7239371", "0.7236183", "0.7227827", "0.7223972", "0.7221312", "0.7217669", "0.72065014", "0.7200105", "0.7187069", "0.71853477", "0.71836895", "0.71770966", "0.7176204", "0.71726143", "0.7171122", "0.7159613", "0.71507174", "0.7145491", "0.7144633", "0.7143317", "0.71407473", "0.71393937", "0.7137538", "0.712568", "0.7125386", "0.7125192", "0.71223754", "0.711255", "0.7106745", "0.7099234", "0.708942", "0.7087072", "0.70865595", "0.7079807", "0.70693624", "0.7066302", "0.7063862", "0.70591176", "0.70439774", "0.7043668", "0.7040388", "0.70384175", "0.7022236", "0.70162404", "0.7015707", "0.7013332", "0.70061857", "0.7000203", "0.69992155", "0.6992314", "0.6991291" ]
0.0
-1
Stristr's younger cousin. Replacement for functionality appearing in 5.3.0
function stristrr($haystack, $needle, $before_needle=false) { if(!$before_needle) return stristr($haystack, $needle); $pos = stripos($haystack, $needle); if($pos === false) return false; return substr($haystack, 0, $pos); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNoun();", "function truc(string $arg):string{\n return $arg . ' yo <br/>';\n }", "function GetProperUSN($usn){\r\n\t$formattedusn = preg_replace('/\\s+/', '', $usn);\r\n\t$formattedusn = strtolower($formattedusn);\r\n\treturn $formattedusn;\r\n}", "function bbloomer_translate_may_also_like() {\n\t $translated = esc_html__( 'Customers also purchased... ');\n\t return $translated;\n\t}", "static private function ___translate___()\n {\n _('RECORD\\Farthest %1$s from Sagittarius A*');\n }", "public function inYiddish() : string\n {\n return $this->getTranslationIn('yi');\n }", "function dcngettext($domain, $msgid1, $msgid2, $n, $category) {\n }", "function _vaxia_dice_roller_small_label($string) {\n $small_label = strtolower($string);\n $small_label = substr($small_label, 0, 3);\n if ($small_label == 'ref') {\n $small_label = 'fin';\n }\n return $small_label;\n}", "function yourls__( $text, $domain = 'default' ) {\n\treturn yourls_translate( $text, $domain );\n}", "function wp_iso_descrambler($subject)\n {\n }", "function XO_( $str ) {\n\tglobal $xoops;\n\treturn $xoops->services['lang'] ? $xoops->services['lang']->translate( $str ) : $str;\t\n}", "function smarty_modifier_koujpn($string)\n{\n\t// あかがねで校Noを日本語で出力する\n\t// 他のプロジェクトに持って行っても意味がない\n\tif (isset($string) == false) {\n\t\treturn '';\n\t}\n\tif ($string == '0') {\n\t\treturn '-';\n\t}\n\tif ($string == '-1') {\n\t\treturn '校了';\n\t}\n\tif ($string == '1') {\n\t\treturn '初校';\n\t}\n\tif ($string == '2') {\n\t\treturn '再校';\n\t}\n\tif ($string == '999') {\n\t\treturn '校了';\n\t}\n\n\treturn $string . '校';\n}", "protected function prepareChoonpuTransliteration($str)\n {\n // Consonant followed by two of the same vowel\n $consonant = 'bcdfghjklmnpqrstvwyz';\n\n return preg_replace_callback('/(^[' . $consonant . '])(aa|ii|uu|ee|oo)/u', function($matches){\n return $matches[1].substr($matches[2], 1) . 'ー';\n }, $str);\n }", "function singularize($noun){\n $lowercased_noun = strtolower($noun);\n\n foreach($_ENV['INFLECTION_EXCEPTIONS']['uncountable'] as $uncountable){\n if(substr($lowercased_noun,(-1*strlen($uncountable))) == $uncountable){\n return $noun;\n }\n }\n\n foreach($_ENV['INFLECTION_EXCEPTIONS']['irregular'] as $plural => $singular){\n if (preg_match('/('.$singular.')$/i', $noun, $arr)){\n return preg_replace('/('.$singular.')$/i', substr($arr[0],0,1).substr($plural,1), $noun);\n }\n }\n\n foreach($_ENV['INFLECTION_EXCEPTIONS']['singular'] as $rule => $replacement){\n if (preg_match($rule, $noun)){\n return preg_replace($rule, $replacement, $noun);\n }\n }\n\n return $noun;\n}", "function yourls_esc_attr__( $text, $domain = 'default' ) {\n\treturn yourls_esc_attr( yourls_translate( $text, $domain ) );\n}", "function strapos($haystack,$needles,$offset=0) {\n $results = array();\n foreach($needles as $n) {\n $results[] = strpos($haystack, $n);\n }\n $results = array_filter($results);\n sort($results);\n if(isset($results[$offset])) return $results[$offset];\n else return false;\n}", "function dngettext($domain, $msgid1, $msgid2, $n) {\n }", "static protected function translate($s){\nif(!self::$strings)return $s;\nif(!array_key_exists($s,self::$strings))return $s;\nreturn self::$strings[$s];\n}", "private function classyfy( $string ) {\n\t\t$spaced = str_replace( '-', ' ', $this->slugify( $string ) );\n\n\t\t$ucwords = ucwords( $spaced );\n\n\t\treturn str_replace( ' ', '_', $ucwords );\n\t}", "function unu_ ($s) {\n $s = preg_replace('/^u_/', '', $s);\n return v($s)->u_to_camel_case();\n}", "function wp_rel_ugc($text)\n {\n }", "function consonantCancel($sentence)\n{\n $words = explode(' ', $sentence);\n return implode(' ', array_map('removeStartingConsonant', $words));\n}", "function _tC($string){\n\t$r=CLangCore::translate($string);\n\treturn $r!==null ? $r : $string;\n}", "function no_naughty($string)\n{\n $string = preg_replace('/shit/i', 'shoot', $string);\n $string = preg_replace('/fuck/i', 'fool', $string);\n $string = preg_replace('/asshole/i', 'animal', $string);\n $string = preg_replace('/bitches/i', 'dogs', $string);\n $string = preg_replace('/bitch/i', 'dog', $string);\n $string = preg_replace('/bastard/i', 'plastered', $string);\n $string = preg_replace('/nigger/i', 'newbie', $string);\n $string = preg_replace('/cunt/i', 'corn', $string);\n $string = preg_replace('/cock/i', 'rooster', $string);\n $string = preg_replace('/faggot/i', 'piglet', $string);\n\n $string = preg_replace('/suck/i', 'rock', $string);\n $string = preg_replace('/dick/i', 'deck', $string);\n $string = preg_replace('/crap/i', 'rap', $string);\n $string = preg_replace('/blows/i', 'shows', $string);\n\n // ie does not understand \"&apos;\" &#39; &rsquo;\n $string = preg_replace(\"/'/i\", '&rsquo;', $string);\n $string = preg_replace('/%39/i', '&rsquo;', $string);\n $string = preg_replace('/&#039;/i', '&rsquo;', $string);\n $string = preg_replace('/&039;/i', '&rsquo;', $string);\n\n $string = preg_replace('/\"/i', '&quot;', $string);\n $string = preg_replace('/%34/i', '&quot;', $string);\n $string = preg_replace('/&034;/i', '&quot;', $string);\n $string = preg_replace('/&#034;/i', '&quot;', $string);\n\n // these 3 letter words occur commonly in non-rude words...\n //$string = preg_replace('/fag', 'pig', $string);\n //$string = preg_replace('/ass', 'donkey', $string);\n //$string = preg_replace('/gay', 'happy', $string);\n return $string;\n}", "function capital_P_dangit( $text ) {\n\t$current_filter = current_filter();\n\tif ( 'the_title' === $current_filter || 'wp_title' === $current_filter )\n\t\treturn str_replace( 'Wordpress', 'WordPress', $text );\n\t// Still here? Use the more judicious replacement\n\tstatic $dblq = false;\n\tif ( false === $dblq ) {\n\t\t$dblq = _x( '&#8220;', 'opening curly double quote' );\n\t}\n\treturn str_replace(\n\t\tarray( ' Wordpress', '&#8216;Wordpress', $dblq . 'Wordpress', '>Wordpress', '(Wordpress' ),\n\t\tarray( ' WordPress', '&#8216;WordPress', $dblq . 'WordPress', '>WordPress', '(WordPress' ),\n\t$text );\n}", "function singularize($x) {\n\n if (substr($x, -1) != 's') {\n return $x;\n }\n\n $x = preg_replace('/ies$/i', 'y', $x, 1, $count);\n if ($count) return $x;\n\n return substr($x, 0, strlen($x) - 1);\n }", "public function _strings_for_pot()\n {\n }", "function ngettext($string1, $string2, $n) {\n\t\treturn ($n == 1) ? $string1 : $string2;\n\t}", "function pluralize($noun){\n $lowercased_noun = strtolower($noun);\n\n foreach($_ENV['INFLECTION_EXCEPTIONS']['uncountable'] as $uncountable){\n if(substr($lowercased_noun,(-1*strlen($uncountable))) == $uncountable){\n return $noun;\n }\n }\n\n foreach($_ENV['INFLECTION_EXCEPTIONS']['irregular'] as $plural => $singular){\n if (preg_match('/('.$plural.')$/i', $noun, $arr)){\n return preg_replace('/('.$plural.')$/i', substr($arr[0],0,1).substr($singular,1), $noun);\n }\n }\n\n foreach($_ENV['INFLECTION_EXCEPTIONS']['plural'] as $rule => $replacement){\n if (preg_match($rule, $noun)){\n return preg_replace($rule, $replacement, $noun);\n }\n }\n\n return $noun;\n}", "function filter_ige_past2($ige,$h1) {\r\n if (substr($ige, -2) === 'ik') {\r\n $ige = str_replace('ik','',$ige);\r\n }\r\n $ige2 = $ige . $h1 . 'tt';\r\n if (preg_match('(l|r|n|j)',substr($ige,-1))) {\r\n $ige2 = $ige . 't';\r\n }\r\n if (preg_match('(ad|ed)',substr($ige,-2))) {\r\n $ige2 = $ige . 't';\r\n }\r\n if (preg_match('(vesz|visz|tesz|hisz)',$ige)) {\r\n $ige2 = str_replace('sz','tt',$ige);\r\n }\r\n if ($ige === 'esz') {\r\n $ige2 = 'evett';\r\n }\r\n return $ige2;\r\n }", "function doclean($samy)\n\t {\n\n\t $samyb = trim($samy);\n\t $samyb = @ereg_replace(\"%([A-Za-z]+)%\",\"\",$samyb);\n\t $samyb = str_replace(\"=\",\"\",$samyb);\n\t $samyb = str_replace(\"--\",\"\",$samyb);\n\t $samyb = str_replace(\";\",\"\",$samyb);\n\t $samyb = str_replace(\"..\",\"\",$samyb);\n\t $samyb = str_replace(\"?\",\"\",$samyb);\n\t $samyb = str_replace(\" OR \",\"\",$samyb);\n\t $samyb = str_replace(\" LIKE \",\"\",$samyb);\n\n\t return $samyb;\n\n\t }", "public function stopwords()\n {\n //return array(' a ',' about ',' above ',' above ',' across ',' after ',' afterwards ',' again ',' against ',' all ',' almost ',' alone ',' along ',' already ',' also ',' although ',' always ',' am ',' among ',' amongst ',' amoungst ',' amount ',' an ',' and ',' another ',' any ',' anyhow ',' anyone ',' anything ',' anyway ',' anywhere ',' are ',' around ',' as ',' at ',' back ',' be ',' became ',' because ',' become ',' becomes ',' becoming ',' been ',' before ',' beforehand ',' behind ',' being ',' below ',' beside ',' besides ',' between ',' beyond ',' bill ',' both ',' bottom ',' but ',' by ',' call ',' can ',' cannot ',' cant ',' co ',' con ',' could ',' couldnt ',' cry ',' de ',' describe ',' detail ',' do ',' done ',' down ',' due ',' during ',' each ',' eg ',' eight ',' either ',' eleven ',' else ',' elsewhere ',' empty ',' enough ',' etc ',' even ',' ever ',' every ',' everyone ',' everything ',' everywhere ',' except ',' few ',' fifteen ',' fify ',' fill ',' find ',' fire ',' first ',' five ',' for ',' former ',' formerly ',' forty ',' found ',' four ',' from ',' front ',' full ',' further ',' get ',' give ',' go ',' had ',' has ',' hasnt ',' have ',' he ',' hence ',' her ',' here ',' hereafter ',' hereby ',' herein ',' hereupon ',' hers ',' herself ',' him ',' himself ',' his ',' how ',' however ',' hundred ',' ie ',' if ',' in ',' inc ',' indeed ',' interest ',' into ',' is ',' it ',' its ',' itself ',' keep ',' last ',' latter ',' latterly ',' least ',' less ',' ltd ',' made ',' many ',' may ',' me ',' meanwhile ',' might ',' mill ',' mine ',' more ',' moreover ',' most ',' mostly ',' move ',' much ',' must ',' my ',' myself ',' name ',' namely ',' neither ',' never ',' nevertheless ',' next ',' nine ',' no ',' nobody ',' none ',' noone ',' nor ',' not ',' nothing ',' now ',' nowhere ',' of ',' off ',' often ',' on ',' once ',' one ',' only ',' onto ',' or ',' other ',' others ',' otherwise ',' our ',' ours ',' ourselves ',' out ',' over ',' own ',' part ',' per ',' perhaps ',' please ',' put ',' rather ',' re ',' same ',' see ',' seem ',' seemed ',' seeming ',' seems ',' serious ',' several ',' she ',' should ',' show ',' side ',' since ',' sincere ',' six ',' sixty ',' so ',' some ',' somehow ',' someone ',' something ',' sometime ',' sometimes ',' somewhere ',' still ',' such ',' system ',' take ',' ten ',' than ',' that ',' the ',' their ',' them ',' themselves ',' then ',' thence ',' there ',' thereafter ',' thereby ',' therefore ',' therein ',' thereupon ',' these ',' they ',' thickv ',' thin ',' third ',' this ',' those ',' though ',' three ',' through ',' throughout ',' thru ',' thus ',' to ',' together ',' too ',' top ',' toward ',' towards ',' twelve ',' twenty ',' two ',' un ',' under ',' until ',' up ',' upon ',' us ',' very ',' via ',' was ',' we ',' well ',' were ',' what ',' whatever ',' when ',' whence ',' whenever ',' where ',' whereafter ',' whereas ',' whereby ',' wherein ',' whereupon ',' wherever ',' whether ',' which ',' while ',' whither ',' who ',' whoever ',' whole ',' whom ',' whose ',' why ',' will ',' with ',' within ',' without ',' would ',' yet ',' you ',' your ',' yours ',' yourself ',' yourselves ',' the ');\n\t\tif($this->user->option('language') == 0)\n\t\t{\n\t\t\treturn array();\n\t\t}\n $stopword = ORM::factory('Stopword', $this->user->option('language'));\n\t\t$words = explode($stopword->delimiter,$stopword->words);\n\t\treturn $words;\n }", "function before ($inthat,$str )\n {\n return substr($inthat, 0, strpos($inthat, $str));\n }", "public function getShortcodeReplace();", "private function __unifyString($s)\n\t{\n\t\t$out = mb_strtolower($s, 'UTF-8');\n\t\t$out = Inflector::slug($out);\n\n\t\treturn $out;\n\t}", "function wp_kses_array_lc($inarray)\n {\n }", "function mecab_ipadic_is_noun($posid)\n{\n return $posid >= 37 && $posid <= 66;\n}", "function truc() {\n}", "private function lookupCoauthors($string) {\n // IN: [email protected], [email protected]\n // OUT: \n // Matt Bernhardt, [email protected]\n // Ellen Finnie Duranceau, [email protected]\n // NOTE: It also directly manipulates the message template by adding the comma separated names to the salutation\n\n // Open warehouse connection\n $this->warehouse = new Warehouse();\n\n // initialize rebuilt string\n $rebuiltString = \"\";\n $salutation = \"\";\n\n // replace semicolons with commas\n $string = str_replace( \";\" , \",\" , $string );\n\n // split emails on commas\n $emails = explode(\",\",$string);\n\n // This builds two variables:\n // $salutation is simply: name, name, name, \n // and is used in the salutation\n // $rebuiltString is: name: email, name: email,\n // and is used in the original submission\n foreach ( $emails as $email ) {\n $this->log->write(\"[Form] Coauthor lookup: _\" . $email . \"_\");\n $name = $this->warehouse->lookupDisplayName(trim($email));\n $this->log->write(\"[Form] Coauthor result: _\" . $name . \"_\");\n if( strlen($name) > 2 ) {\n $rebuiltString .= $name . \": \" . $email . \"\\n\";\n $salutation .= $name .\", \";\n } else {\n $rebuiltString .= $email . \"\\n\";\n }\n }\n $salutation .= \"\\n\";\n\n // add salutation to message text\n // if(trim($salutation) != \"\") {\n // $this->log->write('[Form] Coauthor: formatting salutation');\n // $salutation = \" and \" . $salutation;\n // } else {\n // $this->log->write('[Form] Coauthor: removing salutation');\n // $salutation = \"\\n\";\n // }\n $this->optOutCoauthors = $salutation;\n $this->messageText = preg_replace(\"/\\[>coauthor-names<\\]/U\", $salutation, $this->messageText);\n\n return $rebuiltString;\n }", "function str_istarts_with($needle, $haystack)\n {\n return str::startsWithIgnoreCase($needle, $haystack);\n }", "function _t($string,$alt=null){\n\t$r=CLang::translate($string,'a');\n\treturn $r!==false ? $r : ($alt===null?$string:$alt);\n}", "public function translate();", "public function s_callback($matches) {\n $x = $matches[0];\n if ($this->accent != \"yes\") {\n // remove accent characters from slp1 text: /,^,\\\n $y = $matches[1]; // $x = <s>$y</s>\n $y = $this->remove_slp1_accent($y);\n $x = \"<s>$y</s>\";\n }\n return $x;\n}", "private function _unifyString($s)\n\t{\n\t\t$out = mb_strtolower($s, 'UTF-8');\n\t\t$out = Inflector::slug($out);\n\t\t\n\t\treturn $out;\n\t}", "function yourls_esc_html__( $text, $domain = 'default' ) {\n\treturn yourls_esc_html( yourls_translate( $text, $domain ) );\n}", "function str_icontains($needle, $haystack)\n {\n return str::containsIgnoreCase($needle, $haystack);\n }", "public function lcfirstDataProvider() {}", "protected function transliterateSokuon($str, $sokuon)\n {\n $new_str = $str;\n $length = Analyzer::length($str);\n\n //No need to go further.\n if ($length < 2) {\n return $new_str;\n }\n\n $skip = array('a', 'i', 'u', 'e', 'o', 'n');\n\n for ($i = 1; $i < $length; $i++) {\n $prev_char = substr($str, $i - 1, 1);\n if (!in_array($prev_char, $skip)) {\n // Don't forget Hepburn special case: ch > tch\n if ($prev_char === substr($str, $i, 1) || ($prev_char === 't' && substr($str, $i, 2) === 'ch')) {\n $new_str = substr_replace($str, $sokuon, $i - 1, 1);\n }\n }\n }\n\n return $new_str;\n }", "function yourls_esc_attr_e( $text, $domain = 'default' ) {\n\techo yourls_esc_attr( yourls_translate( $text, $domain ) );\n}", "public function testUcwordsSanitizer()\n {\n $this->assertEquals('Fernando Zueet', Sanitize::ucwords()->clean('fernando zueet'));\n\n $this->assertEquals('', Sanitize::ucwords()->clean(10));\n }", "function __ngettext(...$args)\n {\n }", "function strtoproper($someString) {\n return ucwords(strtolower($someString));\n}", "public static function pearCase($str) {}", "function u_ ($s) {\n $out = preg_replace('/([^_])([A-Z])/', '$1_$2', $s);\n return 'u_' . strtolower($out);\n}", "public function labelMaker($str) {\n $str_out = ucwords(\\strtr($str,'_',' ')); \n return $str_out; \n }", "function replace_sentence($sentence, $suffix)\r\n\t{\r\n\t\treturn substr($sentence, 0, strlen($sentence) - 2) . $suffix;\r\n\t}", "function strtoproper($someString) {\n\t\treturn ucwords(strtolower($someString));\n\t}", "function get_the_author($deprecated = '')\n {\n }", "function titleCase($string) {\r\n // Remove no_parse content.\r\n $string_array = preg_split(\"/(<no_parse>|<\\/no_parse>)+/i\",$string);\r\n $newString = '';\r\n for ($k=0; $k<count($string_array); $k=$k+2) {\r\n $string = $string_array[$k];\r\n // If the entire string is upper case, don't perform any title case on it.\r\n if ($string != strtoupper($string)) {\r\n // TITLE CASE RULES:\r\n // 1.) Uppercase the first char in every word.\r\n $new = preg_replace(\"/(^|\\s|\\'|'|\\\"|-){1}([a-z]){1}/ie\",\"''.stripslashes('\\\\1').''.stripslashes(strtoupper('\\\\2')).''\", $string);\r\n // 2.) Lower case words exempt from title case.\r\n // Lowercase all articles, coordinate conjunctions (\"and\", \"or\", \"nor\"), and prepositions regardless of length, when they are other than the first or last word.\r\n // Lowercase the \"to\" in an infinitive.\" - this rule is of course approximated since it is context sensitive.\r\n $matches = array();\r\n // Perform recursive matching on the following words.\r\n preg_match_all(\"/(\\sof|\\sa|\\san|\\sthe|\\sbut|\\sor|\\snot|\\syet|\\sat|\\son|\\sin|\\sover|\\sabove|\\sunder|\\sbelow|\\sbehind|\\snext\\sto|\\sbeside|\\sby|\\samoung|\\sbetween|\\sby|\\still|\\ssince|\\sdurring|\\sfor|\\sthroughout|\\sto|\\sand){2}/i\",$new ,$matches);\r\n for ($i=0; $i<count($matches); $i++) {\r\n for ($j=0; $j<count($matches[$i]); $j++) {\r\n $new = preg_replace(\"/(\".$matches[$i][$j].\"\\s)/ise\",\"''.strtolower('\\\\1').''\",$new);\r\n }\r\n }\r\n // 3.) Do not allow upper case apostrophes.\r\n $new = preg_replace(\"/(\\w'S)/ie\",\"''.strtolower('\\\\1').''\",$new);\r\n $new = preg_replace(\"/(\\w'\\w)/ie\",\"''.strtolower('\\\\1').''\",$new);\r\n $new = preg_replace(\"/(\\W)(of|a|an|the|but|or|not|yet|at|on|in|over|above|under|below|behind|next to| beside|by|amoung|between|by|till|since|durring|for|throughout|to|and)(\\W)/ise\",\"'\\\\1'.strtolower('\\\\2').'\\\\3'\",$new);\r\n // 4.) Capitalize first letter in the string always.\r\n $new = preg_replace(\"/(^[a-z]){1}/ie\",\"''.strtoupper('\\\\1').''\", $new);\r\n // 5.) Replace special cases.\r\n // You will add to this as you find case specific problems.\r\n $new = preg_replace(\"/\\sin-/i\",\" In-\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(ph){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*|$){1}/ie\",\"'\\\\1pH\\\\3'\",$new);\r\n $new = preg_replace(\"/^ph(\\s|$)/i\",\"pH \",$new);\r\n $new = preg_replace(\"/(\\s)ph($)/i\",\" pH\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(&){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/ie\",\"'\\\\1and\\\\3'\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(groundwater){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/e\",\"'\\\\1Ground Water\\\\3'\",$new);\r\n $new = preg_replace(\"/(\\W|^){1}(cross){1}(\\s){1}(connection){1}(\\W|$){1}/ie\",\"'\\\\1\\\\2-\\\\4\\\\5'\",$new); // Always hyphenate cross-connections.\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(vs\\.){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/ie\",\"'\\\\1Vs.\\\\3'\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(on-off){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/ie\",\"'\\\\1On-Off\\\\3'\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(on-site){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/ie\",\"'\\\\1On-Site\\\\3'\",$new);\r\n // Special cases like Class A Fires.\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(class\\s){1}(\\w){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*|$){1}/ie\",\"'\\\\1\\\\2'.strtoupper('\\\\3').'\\\\4'\",$new);\r\n $new = stripslashes($new);\r\n $string_array[$k] = $new;\r\n }\r\n }\r\n for ($k=0; $k<count($string_array); $k++) {\r\n $newString .= $string_array[$k];\r\n }\r\n return($newString);\r\n }", "private function translate($string) {\n $vowels = \"a,e,i,o,u\";\n $arrVowels = explode(',', $vowels);\n\n //find consonants\n $consonants = \"b,c,d,f,g,h,j,k,l,m,n,p,q,r,s,t,v,w,x,y,z\";\n $arrCons = explode(',', $consonants);\n\n //find the first letter, second, third for clusters\n $first = substr($string, 0, 1);\n $second = substr($string, 1, 1);\n $third = substr($string, 2, 1);\n\n\n //check if first letter is a vowel\n foreach($arrVowels as $check){\n if($check == $first){\n //if first letter is a vowel, add \"ay\"\n $pigLatin = $string . \"ay\";\n return $pigLatin;\n }\n }\n\n //check if first letters are consonants\n $cluster = $first;\n foreach($arrCons as $value){\n if($second == $value ){\n $cluster .= $second;\n foreach($arrCons as $value){ \n if($third == $value){\n $cluster .= $third;\n }\n }\n } \n }\n $pigLatin = str_replace($cluster, '', $string) . $cluster . \"ay\";\n return $pigLatin;\n }", "function censor_words($output)\n {\n foreach ($_SESSION['pgo_word_censor'] as $find => $replace)\n {\n $output = preg_replace(\"/\\b$find\\b/i\", $replace, $output);\n }\n return $output;\n }", "function s_z($ige) {\r\n $s_z = '';\r\n $veg1 = substr($ige,-1);\r\n if ($veg1 === 's') {\r\n $s_z = 's';\r\n }\r\n if ($veg1 === 'z') {\r\n $s_z = 'z';\r\n }\r\n return $s_z;\r\n }", "function true_uppercase($string) {\n\treturn str_replace(' ', '_', ucwords(str_replace('_', ' ', strtolower($string))));\n}", "public function inNorwegian() : string\n {\n return $this->getTranslationIn('no');\n }", "protected static final function mung($thing) {\n\t\treturn preg_replace_callback('/([A-Z])/', function ($m) { return '_' . strtolower($m[1]); }, lcfirst($thing));\n\t}", "function photonfill_wordify_slug( $slug, $callback = 'ucwords' ) {\n\t$label = str_replace( array( '-', '_' ), ' ', $slug );\n\tif ( function_exists( $callback ) ) {\n\t\t$label = $callback( $label );\n\t}\n\treturn apply_filters( 'photonfill_slug_label', $label, $slug, $callback );\n}", "function yourls_n( $single, $plural, $number, $domain = 'default' ) {\n\t$translations = yourls_get_translations_for_domain( $domain );\n\t$translation = $translations->translate_plural( $single, $plural, $number );\n\treturn yourls_apply_filter( 'translate_n', $translation, $single, $plural, $number, $domain );\n}", "function yourls_translate_nooped_plural( $nooped_plural, $count, $domain = 'default' ) {\n\tif ( $nooped_plural['domain'] )\n\t\t$domain = $nooped_plural['domain'];\n\n\tif ( $nooped_plural['context'] )\n\t\treturn yourls_nx( $nooped_plural['singular'], $nooped_plural['plural'], $count, $nooped_plural['context'], $domain );\n\telse\n\t\treturn yourls_n( $nooped_plural['singular'], $nooped_plural['plural'], $count, $domain );\n}", "function htmlspecialchars_uncode($str, $quote_style = ENT_COMPAT)\n{\n\treturn strtr($str, array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style)));\n}", "public function possessiveNouns()\n {\n return [\n [\"Customer's Car\"],\n [\"8th Customer's Car\"],\n [\"Customer's 2nd Car\"],\n [\"7th Customer's 4th Car\"],\n ];\n }", "function yourls_nx($single, $plural, $number, $context, $domain = 'default') {\n\t$translations = yourls_get_translations_for_domain( $domain );\n\t$translation = $translations->translate_plural( $single, $plural, $number, $context );\n\treturn yourls_apply_filter( 'translate_nx', $translation, $single, $plural, $number, $context, $domain );\n}", "function sentance_case($string){\n\t\t\n\t\t//Make standard sentance case\n\t\t$string = ucwords(strtolower($string));\n\t\t$string = trim($string);\n\t\t\n\t\t//Dates\n\t\t//TODO: find and make uppercase PM, AM\n\n\t\t//Random Words\n\t\t$string = str_replace(\"Dj\", \"DJ\", $string);\n\t\t$string = str_replace(\"(dj)\", \"(DJ)\", $string);\t\t\n\t\t$string = str_replace(\"Http\", \"http\", $string);\n\t\t\t\t\n\t\treturn $string;\n\t}", "private static function ucwordss($str, $exceptions)\n\t{\n\t\t$out = \"\";\n\t\tforeach (explode(\" \", $str) as $word) {\n\t\t\t$out .= (!in_array($word, $exceptions)) ? strtoupper($word[0]) . substr($word, 1) . \" \" : $word . \" \";\n\t\t}\n\t\treturn rtrim($out);\n\t}", "function slugify_back2($str) {\n\t\tif($str !== mb_convert_encoding( mb_convert_encoding($str, 'UTF-32', 'UTF-8'), 'UTF-8', 'UTF-32') )\n\t\t$str = mb_convert_encoding($str, 'UTF-8', mb_detect_encoding($str));\n\t\t$str = htmlentities($str, ENT_NOQUOTES, 'UTF-8');\n\t\t$str = preg_replace('`&([a-z]{1,2})(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i', '\\1', $str);\n\t\t$str = html_entity_decode($str, ENT_NOQUOTES, 'UTF-8');\n\t\t$str = preg_replace(array('`[^a-z0-9]`i','`[-]+`'), ' ', $str);\n\t\t$str = strtolower( trim($str, ' ') );\n\n\t\tif (empty($str))\n\t\t{\n\t\t\treturn substr(str_shuffle(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"), 0, 5);\n\t\t}\n\n\t\treturn $str;\n\t}", "public function uzunMein($string){\r\n$string = strip_tags($string);\r\nif (strlen($string) > 500) {\r\n\r\n // truncate string\r\n $stringCut = substr($string, 0, 500);\r\n $endPoint = strrpos($stringCut, ' ');\r\n\r\n //if the string doesn't contain any space then it will cut without word basis.\r\n $string = $endPoint? substr($stringCut, 0, $endPoint) : substr($stringCut, 0);\r\n $string .= '... <a href=\"/this/story\">Read More</a>';\r\n}\r\nreturn $string;\r\n}", "private function translationWorkaround()\n {\n L10n::__('BudgetMailer Sign Up Form for WordPress');\n L10n::__('BudgetMailer Sign Up');\n }", "function estimate_syllables($word) {\n $cmu_dict = CMUDict::get();\n static $arpabet_vowels = array(\n 'AO', 'AA', 'IY', 'UW', 'EH', 'IH', 'UH', 'AH', 'AX', 'AE', // Monophthongs\n 'EY', 'AY', 'OW', 'AW', 'OY', // Diphthongs\n 'ER' // R-colored vowels\n );\n static $english_vowels = array('A', 'E', 'I', 'O', 'U');\n\n $vowel_count = 0;\n\n // Count the number of Arpabet vowels in the line. Failing that, count the English vowels.\n $phonemes = $cmu_dict->getPhonemes($word);\n if ($phonemes === null) {\n // If it ends with S or 'S, then we can still potentially use the CMU dict, since S and 'S aren't vowels.\n $uppercased_word = strtoupper($word);\n if (ends_with(\"'S\", $uppercased_word)) {\n $phonemes = $cmu_dict->getPhonemes(substr($word, 0, -2));\n } else if (ends_with(\"'S\", $uppercased_word)) {\n $phonemes = $cmu_dict->getPhonemes(substr($word, 0, -1));\n }\n }\n if ($phonemes !== null) {\n foreach ($phonemes as $phoneme) {\n if (in_array($phoneme, $arpabet_vowels)) {\n $vowel_count++;\n }\n }\n } else {\n //echo \"Using English vowel counting for $word.\\n\";\n $letters = str_split(strtoupper($word));\n foreach ($letters as $letter) {\n if (in_array($letter, $english_vowels)) {\n $vowel_count++;\n }\n }\n }\n\n return $vowel_count;\n}", "public function camelize($str='') \n {\n return str_replace(' ', '', ucwords(str_replace(array('_', '-'), ' ', $str)));\n }", "public function inSomali()\n {\n return $this->getTranslationIn('so');\n }", "public function snake($word);", "function _t($str/*[, mixed $args [, mixed $... ]]*/)\n{\n global $lc_lang;\n global $lc_translation;\n global $lc_translationEnabled;\n\n $args = func_get_args();\n $str = array_shift($args);\n $str = trim($str);\n\n if ($lc_translationEnabled == false) {\n return (count($args)) ? vsprintf($str, $args) : $str;\n }\n\n $po = session_get('po');\n if (!is_array($po)) {\n $po = array();\n }\n $po[$str] = '';\n\n if (isset($lc_translation[$lc_lang])) {\n # check with lowercase\n $lowerStr = strtolower($str);\n if (isset($lc_translation[$lc_lang][$lowerStr]) && !empty($lc_translation[$lc_lang][$lowerStr])) {\n $translated = $lc_translation[$lc_lang][$lowerStr];\n $str = (is_array($translated)) ? $translated[0] : $translated;\n }\n }\n\n if (isset($translated)) {\n $po[$str] = $translated;\n }\n return (count($args)) ? vsprintf($str, $args) : $str;\n}", "private function pluralise($singular) {\n\n $last_letter = strtolower($singular[strlen($singular)-1]);\n switch($last_letter) {\n case 'y':\n return substr($singular,0,-1).'ies';\n case 's':\n return $singular.'es';\n default:\n return $singular.'s';\n }\n\n}", "function the_author_msn()\n {\n }", "function yourls_esc_attr_x( $single, $context, $domain = 'default' ) {\n\treturn yourls_esc_attr( yourls_translate_with_context( $single, $context, $domain ) );\n}", "function the_author_yim()\n {\n }", "private function strContains($string, $niddle)\n {\n return mb_strpos(mb_strtolower($string), mb_strtolower($niddle)) !== false;\n }", "function yourls_e( $text, $domain = 'default' ) {\n\techo yourls_translate( $text, $domain );\n}", "function get_the_author_yim()\n {\n }", "function filter_ige($ige) {\r\n if (substr($ige, -2) === 'ik') {\r\n $ige = str_replace('ik','',$ige);\r\n }\r\n if (substr($ige,-2) === 'sz') {\r\n $ige = str_replace('z','',$a);\r\n }\r\n return $ige; \r\n }", "public function testUnderscoresTranslation()\n {\n $this->markTestIncomplete('MAGETWO-1012: i18n Improvements - Localization/Translations');\n }", "function chuiNiu()\n{\n\techo '谁喜欢吹牛,爱谁谁<br>';\n}", "function yumusamaCheck($kelime){\n\t\t// $sondanIkinci = mb_substr($kelime, -2, -1);\n\t\t// // eger sondan ikinci unlu degilse yumusama olamaz\n\t\t// if(!in_array($sondanIkinci, UNLULER)) return -1;\n\t\t$sonHarf = mb_substr($kelime, -1);\n\t\tif($sonHarf === \"b\") {\n\t\t\treturn mb_substr($kelime, 0 ,mb_strlen($kelime)-1).\"p\";\n\t\t}\n\t\tif($sonHarf === \"c\") {\n\t\t\treturn mb_substr($kelime, 0 ,mb_strlen($kelime)-1).\"ç\";\n\t\t}\n\t\tif($sonHarf === \"d\") {\n\t\t\treturn mb_substr($kelime, 0 ,mb_strlen($kelime)-1).\"t\";\n\t\t}\n\t\tif($sonHarf === \"g\") {\n\t\t\treturn mb_substr($kelime, 0 ,mb_strlen($kelime)-1).\"k\";\n\t\t}\n\t\tif($sonHarf === \"ğ\") {\n\t\t\treturn mb_substr($kelime, 0 ,mb_strlen($kelime)-1).\"k\";\n\t\t}\n\t\treturn -1;\n\t}", "function the_author($deprecated = '', $deprecated_echo = \\true)\n {\n }", "static public function underscored2camelcased($str) {\n $func = function ($c) {\n return strtoupper($c[1]);\n };\n return preg_replace_callback('/_([a-z])/', $func, $str);\n }", "function translate_smiley($matches)\n {\n }", "function inf($ige,$ae) {\r\n $sug = ('(b|c|d|f|g|h|k|m|p|t|v)');\r\n $sugl = ('(b|c|d|f|g|h|j|k|l|m|n|p|r|s|t|v|z)');\r\n if (substr($ige, -2) === 'ik') {\r\n $ige = str_replace('ik','',$ige);\r\n }\r\n $inf = $ige . 'ni';\r\n if (preg_match('(vesz|visz|tesz|hisz)',$ige)) {\r\n $ige = str_replace('sz','n',$ige);\r\n $inf = $ige . 'ni';\r\n }\r\n if (substr($ige,-3) == 'ít') {\r\n $inf = $ige . $ae . 'ni';\r\n }\r\n if ((preg_match($sugl, substr($ige,-2,1))) && (preg_match($sug, substr($ige,-2,2)))) {\r\n $inf = $ige . $ae . 'ni';\r\n }\r\n if ($ige === 'esz') {\r\n $inf = 'enni';\r\n }\r\n return $inf;\r\n }", "private function mangle( $input )\n\t{\n\t\t// Create an array with words that need to be stripped\n\t\t$elim = \"en:van:bij:tot:u:uw:de:een:door:voor:het:in:is:et:la:le:un:une:du:n:est:ce:ca:par:les:d:a:l:op:sur:des:mijn:mon\";\n\t\t$kill = explode( \":\", $elim );\n\n \t\t$ss = preg_replace(array(\"/&amp;/\", \"/&/\", \"/\\?/\", \"/'/\",'/\"/', \"/`/\", \"/'/\", \"/’/\", \"/’/\", \"/’/\"),\" \",$input);\n\t\t$ss = preg_replace(\"/@/\",\" at \",$ss);\n\n\t\t// iso2ascii must be done prior to strtolower to avoid problems due to encoding\n\t\t$ss = $this->iso2ascii($ss);\n\n\t\t$ss = strtolower($ss).\" \";\n\n\t\t// Replace unacceptable characters\n\t\t$ss = preg_replace( \"@&#(\\d+);@\", 'chr(\\1)', $ss);\n\t\t$ss = preg_replace( \"@(&\\w+;)@\", 'html_entity_decode(\"\\1\")', $ss);\n\n\t\t$ss = preg_replace(\"/\\W/\",\" \",$ss);\n\n\t\t// Strip earlier defined words\n\t\tforeach( $kill as $w)\n\t\t{\n\t\t\t$ss = preg_replace( \"/(^|\\s)$w\\s/\",\" \",$ss);\n\t\t}\n\n\t\t$ss = preg_replace(\"/(\\s)+/\",\"_\",trim($ss));\n\n\t\tif (substr($ss,strlen($ss)-1,1) == \"_\") $ss = substr($ss,0,strlen($ss)-1);\n\n\t\treturn $ss;\n\t}", "function sup_car ($t) {\n\treturn (substr($t, 0, strlen($t)-1));\n}", "function __($string) {\n global $LANG;\n return empty($LANG['def'][$string]) ? $string : $LANG['def'][$string];\n}", "function _dngettext($domain, $singular, $plural, $number)\r\n\t{\r\n\t\t$l10n = _get_reader($domain);\r\n\t\treturn _encode($l10n->ngettext($singular, $plural, $number));\r\n\t}", "abstract public function translate($sentence);" ]
[ "0.59633195", "0.5924705", "0.579403", "0.5791206", "0.5744561", "0.5733617", "0.56111676", "0.56046295", "0.5585521", "0.5564192", "0.55260676", "0.5522481", "0.5521707", "0.55105126", "0.5494261", "0.54846656", "0.54749453", "0.54657966", "0.54640394", "0.54277354", "0.5405543", "0.540413", "0.5399807", "0.5399687", "0.5391426", "0.5388879", "0.53636426", "0.5348379", "0.53416556", "0.531956", "0.5319458", "0.53043586", "0.5296832", "0.5296279", "0.52962214", "0.5295753", "0.52956206", "0.52808076", "0.5259487", "0.5250373", "0.52437127", "0.5236906", "0.523151", "0.5229802", "0.52216303", "0.52117074", "0.5177917", "0.5153574", "0.5150855", "0.5138786", "0.51335686", "0.51328623", "0.51312834", "0.5128769", "0.51279765", "0.51201564", "0.5117152", "0.5117104", "0.5116707", "0.5115159", "0.5113967", "0.51139", "0.5113841", "0.5112032", "0.510926", "0.5108933", "0.51066124", "0.510558", "0.51037496", "0.5103082", "0.5102719", "0.5097687", "0.50826776", "0.5079004", "0.50773895", "0.5076631", "0.50737345", "0.50733113", "0.50728655", "0.50725126", "0.50663036", "0.5065829", "0.5061844", "0.50588876", "0.50537914", "0.5047994", "0.50479096", "0.50463367", "0.50442255", "0.50440866", "0.5039551", "0.5033279", "0.5032517", "0.5031943", "0.50304866", "0.5030357", "0.50248355", "0.50208724", "0.50195783", "0.5013862", "0.5005826" ]
0.0
-1
Checks if any of the strings in an array contains the needle and returns the position Note: May return 0!
function strposa($haystack, $needles){ foreach($needles as $needle) { if(($r = strpos($haystack, $needle)) !== false) return $r; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function strpos_array(string $haystack, array $needles) {\r\n\tif(is_array($needles)) {\r\n\t\tif(count($needles) == 0)\r\n\t\t\treturn false;\r\n\t\tforeach ($needles as $str) {\r\n\t\t\tif ( is_array($str) ) {\r\n\t\t\t\t$pos = strpos_array($haystack, $str);\r\n\t\t\t} else {\r\n\t\t\t\t$pos = strpos($haystack, $str);\r\n\t\t\t}\r\n\t\t\tif ($pos !== FALSE) {\r\n\t\t\t\treturn $pos;\r\n\t\t\t}\r\n\t\t}\r\n\t} else {\r\n\t\treturn strpos($haystack, $needles);\r\n\t}\r\n}", "function strposa($haystack, $needle) {\n if(!is_array($needle)) \n $needle = array($needle);\n \n foreach($needle as $what) {\n if(($pos = strpos($haystack, $what)) !== false) \n return $pos;\n }\n \n return false;\n}", "function searchArray($string, $array) {\n $result = array_search($string, $array);\n if($result === false) {\n return false;\n } else {\n return true;\n }\n}", "function strinarray($searchtext, $dataarray)\r\n{\r\n$i=0;\r\nforeach($dataarray as $linedata) {\r\n if(strstr($linedata,$searchtext)) break;\r\n $i++;\r\n };\r\nreturn $i;\r\n}", "function substr_in_array($needle, array $haystack){\n foreach($haystack as $item){\n if(false !== strpos($item, $needle)){\n return false;\n }\n }\n return true;\n}", "protected static function multi_instring($haystack, $needle_array) {\n foreach ($needle_array as $needle) {\n if (strpos($haystack, $needle) !== false) {\n return $needle;\n }\n }\n\n return false;\n }", "function search_array($string, $array) {\r\n foreach($array as $entry) {\r\n // searches substring $string in $entry\r\n if (strpos($entry, $string) !== false) {\r\n return $entry;\r\n }\r\n }\r\n }", "function strposArray($haystack, $needle, $start=0) {\n\t\tif(!is_array($needle)) $needle = array($needle);\n\t\tforeach($needle as $nee) {\n\t\t\tif(strpos($haystack, $nee, $start) !== false) return $nee; // stop on first true result\n\t\t}\n\t\treturn false;\n\t}", "function strposa( $haystack, $needles = array( ), $offset = 0 ) {\n$chr = array( );\nforeach ( $needles as $needle )\n {\n $res = strpos( $haystack, $needle, $offset );\n if ( $res !== false )\n return $needle;\n }\nreturn 'no';\n}", "function wsod_strposall($haystack,$needle){ \n $s=0; $i=0; \n while (is_integer($i)){ \n $i = strpos($haystack,$needle,$s); \n if (is_integer($i)) { \n $aStrPos[] = $i; \n $s = $i+strlen($needle); \n } \n } \n if (isset($aStrPos)) { \n return $aStrPos; \n } else { \n return false; \n } \n}", "function isstr($array, $text)\n{\nif(strpos($text, $array) === false) {\nreturn false;\n} else {\nreturn true;\n}\n}", "function __array_strpos($arr, $needle, $reverse = false) {\n\t\tif (!is_array($arr) || empty($arr)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($reverse) {\n\t\t\t$arr = array_reverse($arr, true);\n\t\t}\n\n\t\tforeach ($arr as $key => $val) {\n\t\t\tif (strpos($val, $needle) !== false) {\n\t\t\t\treturn $key;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function str_in_array($needle, $haystack)\n\t{\n\n\t\tforeach($haystack as $k => $v)\n\t\t{\n\t\t\tif(strpos($v, $needle) !== false)\n\t\t\t{\n\n\t\t\t\treturn array(\n\t\t\t\t\t\"strpos\" => array(\n\t\t\t\t\t\t\"key\" => $k,\n\t\t\t\t\t\t\"pos\" => strpos($v, $needle)\n\t\t\t\t\t),\n\t\t\t\t\t\"target_full_str\" => $v\n\t\t\t\t);\n\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\n\t}", "private function strposa($string, $needle, $offset = 0)\n {\n if (!is_array($needle)) $needle = array($needle);\n if (!is_array($string)) $string = array($string);\n foreach ($string as $str) {\n if ($str) {\n foreach ($needle as $query) {\n if ($query) {\n if (strpos(strtolower($str), strtolower($query), $offset) !== false) return strtolower($query);\n }\n }\n }\n }\n return false;\n }", "public static function strpos_arr($haystack, $needle) {\n if (!is_array($needle))\n $needle = array($needle);\n foreach ($needle as $what) {\n if (($pos = strpos($haystack, $what)) !== false)\n return $pos;\n }\n return false;\n }", "function searchArrays($keyword, $array) {\n // Look for $keyword in $array and set the key of that array to $match\n $match = array_search($keyword, $array);\n // Only if $match is a boolean false, return false.\n if($match === false) {\n return false;\n }\n return true;\n}", "function arrayContains($str, array $arr)\t{\r\n\t\t//write_log(\"Function Fired.\");\r\n\t\t$result = array_intersect($arr,explode(\" \",$str));\r\n\t\tif (count($result)==1) $result = true;\r\n\t\tif (count($result)==0) $result = false;\r\n\t\treturn $result;\r\n\t}", "private static function strposa( $haystack, array $needle, $offset = 0 ) {\n\n\t\tforeach ( $needle as $query ) {\n\t\t\tif ( strpos( $haystack, $query, $offset ) !== false ) {\n\t\t\t\treturn true;\n\t\t\t} // Stop on first true result.\n\t\t}\n\n\t\treturn false;\n\t}", "function contains($str, array $arr) {\n foreach( $arr as $a ) {\n if ( stripos($str, $a) !== false ) {\n \treturn true;\n }\n }\n return false;\n}", "function _strDetect ($needles, $offset) {\r\n foreach ($needles as $needle) {\r\n $l = strlen ($needle);\r\n if (substr ($this->_text, $offset, $l) == $needle) {\r\n return $needle;\r\n }\r\n }\r\n return false;\r\n }", "function array_contains_part_of_string ($string, $array) {\n\tforeach ($array as $value) {\n\t\t//if (strstr($string, $url)) { // mine version\n\t\tif (strpos($string, $value) !== FALSE) { // Yoshi version\n\t\t\treturn true;\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t}\n return false;\n\t\n}", "public static function strPosByArray($sHaystack, $aNeedle, $iOffset = 0) {\n\t\tif ( ! is_array($aNeedle)) {\n\t\t\t$aNeedle = [$aNeedle];\n\t\t}\n\t\tforeach ($aNeedle as $sNeedle) {\n\t\t\t$xPos = strpos($sHaystack, $sNeedle, $iOffset);\n\t\t\tif ($xPos !== FALSE) {\n\t\t\t\treturn $xPos;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}", "function contains($needle){\n\t\tif(is_array($needle)){\n\t\t\tforeach($needle as $n){\n\t\t\t\tif(!$this->contains($n)){ return false; }\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn !is_bool(strpos($this->_String4,(string)$needle));\n\t}", "private function strposArray($haystack, $needles)\n {\n if ( is_array($needles) ) {\n foreach ($needles as $str) {\n if ( is_array($str) ) {\n $pos = $this->strposArray($haystack, $str);\n } else {\n $pos = strpos($haystack, $str);\n }\n if ($pos !== false) {\n return $pos;\n }\n }\n } else {\n return strpos($haystack, $needles);\n }\n }", "function str_contains($haystack, $needles) {\n foreach ((array) $needles as $needle) {\n if ($needle != '' && strpos($haystack, $needle) !== false) {\n return true;\n }\n }\n return false;\n}", "function search($array, $value)\n{\n $counter = 0;\n $found = false;\n\n foreach($array as $v) {\n if(strcmp($v[0], $value) == 0) {\n $found = true;\n break;\n } \n\n $counter++;\n }\n \n if($found)\n return $counter;\n \n return -1;\n}", "function strposa( $haystack, $needles = array(), $offset = 0 ) {\n\t\t$chr = array();\n\n\t\tforeach( $needles as $needle ) {\n\t\t\t$res = strpos( $haystack, $needle, $offset );\n\t\t\tif ( $res !== false ) $chr[$needle] = $res;\n\t\t}\n\n\t\tif ( empty($chr) ) return false;\n\t\t\n\t\treturn min( $chr );\n\t}", "function in_arrayi( $needle, $haystack ) {\n $found = false;\n foreach( $haystack as $value ) {\n if( strtolower( $value ) == strtolower( $needle ) ) {\n $found = true;\n }\n } \n return $found;\n}", "function str_binary_search($elem, $array) \n{\n $top = sizeof($array) -1;\n $bot = 0;\n while($top >= $bot) \n {\n $p = floor(($top + $bot) / 2);\n if (\"abc\" . $array[$p] < \"abc\" . $elem)\n {\n $bot = $p + 1;\n }\n elseif (\"abc\" . $array[$p] > \"abc\" . $elem)\n { $top = $p - 1; }\n else { return TRUE; }\n }\n return FALSE;\n}", "public function indexOf( $needle ) {\n if ( !is_string( $needle ) ) {\n $type = gettype( $needle );\n $error = \"You called ArrayList::indexOf() with $type, but only string is accepted\";\n Magic::alert( $error );\n }\n return array_search( $needle, $this->list );\n }", "function array_nsearch($needle, array $haystack) {\n $it = new IteratorIterator(new ArrayIterator($haystack));\n foreach($it as $key => $val) {\n if(strcasecmp($val,$needle) === 0) {\n return $key;\n }\n }\n return false;\n}", "public static function indexOf($needle, $haystack) { \n for ($i=0;$i<count($haystack);$i++) { \n if ($haystack[$i] == $needle) { \n return $i; \n }\n }\n return -1;\n\t}", "function strposa($string, $words=array(), $offset=0) {\n $chr = array();\n //check by simlarity\n foreach($words as $word) {\n $res = checkExistanceBySimilarity($string,$word);\n if ($res !== false) $chr[$word] = $res;\n }\n // check exist\n /*foreach($words as $word) {\n $res = strpos($string, $word, $offset);\n if ($res !== false) $chr[$word] = $res;\n }*/\n if(empty($chr)) return false;\n return min($chr);\n}", "function get_array_containing_part_of_string ($string, $array) {\n\tforeach ($array as $value) {\n\t\t//if (strstr($string, $url)) { // mine version\n\t\tif (strpos($string, $value) !== FALSE) { // Yoshi version\n\t\t\treturn $value;\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t}\n return false;\n\t\n}", "public static function strfind($haystack,$needle,$offset = 0)\r\n\t{\r\n\t\t$pos = $offset;\r\n\t\t$pos = self::getNextNotWhiteChar($haystack,$offset);\r\n\t\t$length = strlen($needle);\r\n\t\t$find = 0;\r\n\t\tfor($i=0;$i<$length;$i++)\r\n\t\t\tif($haystack[$pos+$i] == $needle[$i])\r\n\t\t\t\t$find++;\r\n\t\t\telse\r\n\t\t\t\tbreak;\r\n\t\treturn $find == $length?$pos:-1;\r\n\t}", "function in_arrayi( $needle, $haystack ) {\n\treturn in_array( strtolower( $needle ), array_map('strtolower', $haystack ) );\n}", "function contains($haystack, $needles)\n{\n foreach ((array) $needles as $needle) {\n if ($needle !== '' && mb_strpos($haystack, $needle) !== false) {\n return true;\n }\n }\n return false;\n}", "function multi_strpos($haystack, $needles, $sensitive = false, $offset = 0){\r\r\n\t$needles = (array)$needles;\r\r\n\r\r\n\tforeach($needles as $needle) {\r\r\n\t\t$result[$needle] = ($sensitive) ? strpos($haystack, (string)$needle, $offset) : stripos($haystack, (string)$needle, $offset);\r\r\n\t}\r\r\n\treturn $result;\r\r\n}", "function findItemInString($string, $array, $default = \"\")\n{\n // only runs on arrays\n if(!is_array($array))\n $array = array($array);\n \n // return the first item that matches\n foreach($array as $item)\n if(strpos($string, $item) !== false)\n return $item;\n \n // otherwise nothing\n return $default;\n}", "function somewhereInArray($needles, $haystack, $CASE_INSENSITIVE = false){\n if(!is_array($needles)) $needles = array($needles);\n if(is_array($haystack)) {\n foreach($haystack as $straw) {\n if(somewhereInArray($needles, $straw, $CASE_INSENSITIVE)) return true;\n }\n return false;\n }\n else {\n foreach($needles as $needle) {\n if($CASE_INSENSITIVE) {\n if(stripos($haystack, $needle) !== false) return true;\n }\n else {\n if(strpos($haystack, $needle) !== false) return true;\n }\n }\n return false;\n }\n}", "public static function arrayCompare($array, $string)\n {\n if (!Arrays::isArray($array, false)) {\n return false;\n }\n\n $matches = 0;\n foreach ($array AS $item) {\n if (stristr($string, $item) == true) {\n $matches++;\n }\n }\n\n return $matches;\n }", "function arrayMultiSearch( $p_needle, $p_haystack ) {\r\n if( !is_array( $p_haystack ) )\r\n return false;\r\n\r\n if( in_array($p_needle, $p_haystack ))\r\n return true;\r\n\r\n foreach( $p_haystack as $row ) {\r\n if(arrayMultiSearch( $p_needle, $row ))\r\n return true;\r\n }\r\n return false;\r\n}", "public static function strposArray($haystack, $needles = array(), $offset = 0){\n $chr = array();\n\n foreach($needles as $needle){\n\t\t\t$res = strpos($haystack, $needle, $offset);\n\t\t\tif ($res !== false) $chr[$needle] = $res;\n }\n\n if(empty($chr)) return false;\n return min($chr);\n\t}", "function indexOccurancesOfStringInArray($arr, $str)\n{\n\t$indexs = [];\n\tforeach ($arr as $i => $val) {\n\t\tif ($val === $str) {\n\t\t\t$indexs[] = $i;\n\t\t}\n\t}\n\treturn $indexs;\n}", "function searchForAny($source,$search)(\n if(strpos($source,$search) !== FALSE){\n return true;\n }", "function strallpos($haystack, $needle, $offset = 0) {\n $result = array();\n\n // Loop through the $haystack/string starting at offset \n for ($i = $offset; $i < strlen($haystack); $i++) {\n $pos = strpos($haystack, $needle, $i);\n if ($pos !== FALSE) {\n $offset = $pos;\n if ($offset >= $i) {\n $i = $offset;\n\n // Add found results to return array \n $result[] = $offset;\n }\n }\n }\n return $result;\n }", "function atk_strpos($haystack,$needle,$offset=0)\n{\n\treturn atkString::strpos($haystack,$needle,$offset);\n}", "function contains($needle, $haystack)\n{\n return strpos($haystack, $needle) !== false;\n}", "public function indexOf($value);", "public static function in_iarray($str, $a){\r\r\n\t\tforeach($a as $v){\r\r\n\t\t\t\r\r\n\t\t\tif(strcasecmp($str, $v)==0){return true;}\r\r\n\t\t\t\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\treturn false;\r\r\n\t}", "protected function strposa($haystack, $needle, $offset = 0) {\n if (!is_array($needle))\n $needle = array($needle);\n foreach ($needle as $query) {\n if (strpos($haystack, $query, $offset) !== false)\n return true; // stop on first true result\n }\n return false;\n }", "function strContains($haystack, $needle)\n{\n return strpos($haystack, $needle) > -1 ? true : false;\n}", "public function findArray($array,$item){\n for ($i=0;$i<count($array);$i++){\n if($array[$i]==$item)\n return $i;\n }\n return -1;\n }", "private function contains($str, array $arr)\n {\n foreach ($arr as $a) {\n if (stripos($str, $a) !== false) {\n return true;\n }\n }\n return false;\n }", "function array_search_string($array, $search_text, $json = false)\n{\n $result = array();\n \n array_filter($array, function($word) use ($search_text, &$result) \n {\n if(strpos($word, $search_text) !== false)\n {\n $result[] = $word;\n }\n });\n\n if($json)\n {\n return json_encode($result);\n }\n else\n {\n return $result;\n }\n}", "function any_in_array($needle, $haystack)\n{\n $needle = is_array($needle) ? $needle : array($needle);\n\n foreach ($needle as $item)\n {\n if (in_array($item, $haystack))\n {\n return TRUE;\n }\n }\n\n return FALSE;\n}", "function case_in_array($string,$array){\n\t\tforeach($array as $val){\n\t\t\tif(strcasecmp($string, $val) == 0) return true;\n\t\t}\n\t\treturn false;\n\t}", "function is_in_array($needle,$haystack) {\r\n\t$needleFound = false;\r\n\t$returnValue = false;\r\n\treset($haystack);\r\n\twhile ((list($key,$value) = each($haystack)) && !$needleFound) {\r\n\t\tif ($needle == $value) {\r\n\t\t\t$needleFound = true;\r\n\t\t\t$returnValue = $key;\r\n\t\t}\r\n\t}\r\n\treturn $returnValue;\r\n}", "function search($array, $value) {\n // check for empty array\n if (empty($array)) {\n return;\n }\n // iterate through array, looking for the value\n // if value found, return the index.\n for ($i=0; $i < sizeof($array); $i++) { \n if ($value == $array[$i]) {\n return $i;\n }\n }\n}", "public static function arraySearch($needle, array $haystack, $caseSensitive = true)\n \t {\n \t\tforeach ($haystack as $key => $value)\n \t\t{\n \t\t$searchFunc = ($caseSensitive) ? 'strpos' : 'stripos';\n \n \t\tif ($searchFunc($value, $needle) === 0)\n \t\t{\n \t\treturn $key;\n \t\t}\n \t\t}\n \n \t\treturn false;\n \t\t}", "function email_contains($needle, $barn) {\n\n\t// If not empty ...\n\tif ( ! empty ( $barn ) ) {\n\t\t// search string\n\t\tforeach ( $barn as $straw ) {\n\t\t\tif ( $straw == $needle ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n\n}", "function contains_word($haystack, array $needles)\n {\n foreach($needles as $a) {\n if (stripos($haystack,$a) !== false) return true;\n }\n return false;\n }", "public function testAnArrayValueIsInTheHaystackCaseInsensitive()\n {\n $needle = [\"foo\"];\n $haystack = \"Foo Bar Baz\";\n $this->assertTrue(Strings::contains($haystack, $needle, false));\n }", "public function testAnArrayValueIsInTheHaystackCaseSensitive()\n {\n $needle = [\"Foo\"];\n $haystack = \"Foo Bar Baz\";\n $this->assertTrue(Strings::contains($haystack, $needle));\n }", "public function indexOf($needle, $offset = 0)\n {\n return UTF8::strpos\n (\n $this->scalarString,\n (string)$needle,\n (int)$offset,\n $this->encoding\n );\n }", "protected function findOccurence($haystack, $needles)\n {\n $position = strlen($haystack);\n\n foreach ((array) $needles as $needle) {\n $position = stripos($haystack, $needle);\n if (false !== $position) {\n break;\n }\n }\n\n return $position;\n }", "function inArrayWildcard($needle, $haystack) {\n\t return true;\n\t #this function allows wildcards in the array to be searched\n\t foreach ($haystack as $value) {\n\t if (true === fnmatch($value, $needle)) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t}", "function get_index($arr, $selected)\n{\n $ret = false; // return false if not found\n foreach ($arr as $key => $val) {\n if (strtolower(substr($val, 0, strlen($selected))) == strtolower($selected)) {\n $ret = $key;\n break;\n }\n }\n\n return $ret;\n}", "public function find($needle)\n {\n $needles = array();\n $needle = (array) $needle;\n \n foreach ($needle as $n) {\n $needles[] = array(\n $n,\n strlen($n),\n 0\n );\n }\n\n $readPos = 0;\n $found = false;\n\n while (($char = fgetc($this->filePointer)) !== false) {\n\n $readPos++;\n\n foreach ($needles as &$n) {\n if ( ($n[2] < $n[1]) && ($char == $n[0][$n[2]]) )\n $n[2]++;\n else\n $n[2] = 0;\n \n if ( ($n[1] > 0) && ($n[2] == $n[1]) ) {\n $found = true;\n break 2;\n }\n }\n }\n \n // Back the cursor to the inicial position\n fseek($this->filePointer, -$readPos, SEEK_CUR);\n \n if ($found)\n return $readPos - $n[1];\n\n return false;\n }", "public function indexOf($needle, $offset = 0)\n {\n return UTF8::strpos($this->str, (string) $needle, (int) $offset, $this->encoding);\n }", "function nestedInArray($needle, $haystack) {\n $correctPost = array();\n foreach ($haystack as $item) {\n //print_r($item);\n //print $needle;\n $post = implode($item);\n //print $post;\n //$found = stripos($post, $needle);\n //if(in_array($needle, $item)){\n //return true;\n //}\n if(stripos($post, $needle) != false){\n //$position = stripos($post, $needle); //figure out how to pass this\n array_push($correctPost, $item);\n }\n\n }\n return $correctPost; //how to pass the results of an if and else sta\n}", "public function in_arrayi($needle, $haystack) {\n\t\treturn in_array(strtolower($needle), \n\t\t\tarray_map('strtolower', $haystack)\n\t\t);\n\t}", "public static function strpos($haystack, $needle, $offset = 0)\n {\n if (!is_array($needle)) {\n $needle = array($needle);\n }\n foreach ($needle as $query) {\n if (strpos($haystack, $query, $offset) !== false) {\n return true; // stop on first true result\n }\n }\n return false;\n }", "function findInArray($array, $value)\n{\n for ($i = 0; $i < count($array); $i++) {\n if ($value == $array[$i]) {\n return true;\n }\n }\n return false;\n}", "public static function search($needle, $haystack, $all = false)\n {\n $x = [];\n foreach (Tokenizer::parse($needle) as $token) if (Tokenizer::isSemanticToken($token)) $x[] = $token;\n $m = count($x);\n if ($m == 0) return false;\n $y = Tokenizer::parse($haystack);\n $res = [];\n for ($i = 0, $k = 0, $n = count($y); $i < $n; $i++)\n {\n $token = $y[$i];\n if (!Tokenizer::isSemanticToken($token)) continue;\n if (Tokenizer::isEqual($x[$k], $token)) \n {\n $k++;\n if ($k == 1) $start = $i;\n if ($k == $m) \n {\n if (!$all) return [$start, $i];\n else \n {\n $res[] = [$start, $i];\n $k = 0;\n }\n }\n }\n else $k = 0;\n }\n return $res ?: false;\n }", "public function indexOf($needle, $offset = 0, $flags = 0)\n {\n if ($flags & self::NEEDLE_REGEX) {\n if (preg_match($needle, $this->buffer, $matches, PREG_OFFSET_CAPTURE, $offset)) {\n return $matches[0][1];\n }\n\n return false;\n }\n\n return strpos($this->buffer, $needle, $offset);\n }", "function _string_contains( $needle, $haystack )\n{\n return strpos( $haystack, $needle ) !== false;\n}", "public static function stringContains ($needle, $haystack) {\n $vals = $haystack;\n if (!is_array($haystack)) {\n $vals = array($haystack);\n }\n for ($i=0; $i<count($vals); $i++) {\n $h = $vals[$i];\n //error_log(__FUNCTION__.\"(): Check '$h' contains '$needle'\");\n $rx = \"/\".$needle.\"/i\";\n if (preg_match($rx, $h)) {\n return true;\n }\n }\n return false;\n }", "public function strpos($haystack, $needle, $offset = 0) {\r\n return iconv_strpos($haystack, $needle, $offset, $this->charset);\r\n }", "public function strpos($haystack, $needle, $offset) {\n\t\treturn grapheme_strpos($haystack, $needle, $offset);\n\t}", "public static function arrayItemInString($array, $string)\n {\n if (!Arrays::isArray($array, false)) {\n return false;\n }\n foreach ($array AS $item) {\n if (!stristr($string, $item) === false) {\n return true;\n }\n }\n\n return false;\n }", "public function strpos($needle, $offset=0) {\r\n if (empty($needle)) return FALSE;\r\n return strpos($this->contents, $needle, $offset);\r\n }", "function array_contains(array $array, $search, $strict = true) {\n return in_array($search, $array, $strict);\n }", "function array_in_array($needles, $haystack){\n foreach($needles as $needle){\n if(!in_array($needle, $haystack)) return false;\n }\n return true;\n}", "private function contains($fileData, $array = array())\n {\n if (!is_array($array)) {\n return false;\n }\n foreach ($array as $item) {\n if (strpos($fileData, $item) !== false) {\n return true;\n }\n }\n return false;\n }", "function in_array_nocase($needle, $haystack)\n{\n $needle = mb_strtolower($needle);\n foreach ($haystack as $value)\n if ($needle===mb_strtolower($value))\n return true;\n \n return false;\n}", "public function search($array, $value)\n {\n $n = count($array);\n for ($i = 0; $i < $n; $i++) {\n if ($array[$i] == $value) {\n return $i;\n }\n }\n\n return -1;\n }", "private function match($chArray, $string)\n {\n foreach ($chArray as $ch) {\n if (strpos($string, $ch) !== false) {\n return true;\n }\n }\n return false;\n }", "public function indexOf(mixed $element): string|int|bool;", "function startswith($haystack, $needle) {\n if (is_array($haystack)) {\n foreach($haystack as $hay) {\n if(substr($hay, 0, strlen($needle)) == $needle) {\n return true;\n }\n }\n //return in_array($needle, $haystack);\n return false;\n } else {\n return (substr($haystack, 0, strlen($needle)) == $needle);\n }\n}", "static function contains(string $s, array|string $needles): bool {\n foreach ((array) $needles as $needle) {\n if ('' !== $needle && false !== mb_strpos($s, $needle)) {\n return true;\n }\n }\n\n return false;\n }", "public static function checkInArray($needle, $haystack) {\r\n \r\n // we lowercase the haystack because the needle is lowercased, without altering the original query\r\n $haystack = Arrays::arrayToLower($haystack);\r\n $needle = strtolower(trim($needle));\r\n\r\n if (in_array($needle, $haystack)) {\r\n return TRUE;\r\n }\r\n \r\n return FALSE;\r\n}", "protected function position_of_param( $needle ) {\n\t\t$i = 0;\n\t\tforeach ( $this->component as $component ) {\n\t\t\tif ( strtolower( $component['name'] ) == strtolower( $needle ) ) {\n\t\t\t\treturn $i;\n\t\t\t}\n\t\t\t++$i;\n\t\t}\n\t\treturn false;\n\t}", "function eregiArray ($Array, $string)\n{\n\t// loop through the array\n\tfor ($i=0; $i<count($Array); $i++)\n\t{\n\t\tif (eregi($Array[$i],$string)) return true;\n\t}\n\treturn false;\n}", "public function testAnArrayValueIsNotInTheHaystackCaseSensitive()\n {\n $needle = [\"foo\"];\n $haystack = \"Foo Bar Baz\";\n $this->assertFalse(Strings::contains($haystack, $needle));\n }", "function array_key_exists_in_array_of_arrays($needle, string $key, array $haystack = null)\n{\n if (!$needle || !$key || !$haystack || !count($haystack)) {\n return false;\n }\n foreach ($haystack as $item) {\n if (array_key_exists($key, $item) && $needle === $item[$key]) {\n return true;\n }\n }\n return false;\n}", "function strpos($haystack, $needle, $offset = 0, $encoding = 'UTF-8') {\n if (function_exists('mb_strpos'))\n return mb_strpos($haystack, $needle, $offset, $encoding);\n else\n return strpos($haystack, $needle, $offset);\n}", "public static function iin_array ($needle, $haystack, $unsupportedArgument = NULL /* ignored for future implementation as $strict */, &$matchedValue = NULL)\r\n\t{\r\n\t\t# Return true if the needle is in the haystack\r\n\t\tforeach ($haystack as $item) {\r\n\t\t\tif (strtolower ($item) == strtolower ($needle)) {\r\n\t\t\t\t$matchedValue = $item;\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t# Otherwise return false\r\n\t\treturn false;\r\n\t}", "public static function checkArrayInArray($needle, $haystack) {\r\n\r\n // we lowercase the haystack because the needle is lowercased, without altering the original query\r\n foreach ($needle AS $value) {\r\n if (!in_array($value, $haystack)) {\r\n return FALSE;\r\n }\r\n } \r\n \r\n return TRUE;\r\n}", "function contains(...$args)\n{\n\t$array = array_shift($args);\n\tif( is_array($array) )\n\t{\n\t\tforeach( $args as $a )\n\t\t\tif( in_array($a,$array) )\n\t\t\t\treturn true;\n\t\treturn false;\n\t}\n\tif( is_string($array) )\n\t{\n\t\tforeach( $args as $a )\n\t\t\tif( stripos($array,$a) !== false )\n\t\t\t\treturn true;\n\t\treturn false;\n\t}\n\tWdfException::Raise('First argument needs to be of type array or string');\n return false;\n}" ]
[ "0.7423898", "0.73755586", "0.7250515", "0.72290146", "0.7042857", "0.6991533", "0.6944882", "0.6781506", "0.67505515", "0.66723144", "0.66486204", "0.65338093", "0.649167", "0.6441136", "0.6435071", "0.6426001", "0.6421056", "0.64011306", "0.63889045", "0.6369563", "0.63612163", "0.6340404", "0.6290364", "0.6274888", "0.6245655", "0.6231655", "0.622831", "0.61948764", "0.6161432", "0.6157356", "0.61571777", "0.6140829", "0.6138224", "0.61242473", "0.6113214", "0.61092377", "0.60990256", "0.6080078", "0.6077466", "0.6058806", "0.60513675", "0.6048139", "0.6029036", "0.6006026", "0.5995414", "0.5983789", "0.5982137", "0.59782267", "0.5959825", "0.59522426", "0.5939949", "0.58927035", "0.58922386", "0.58787143", "0.5856425", "0.5855133", "0.58371574", "0.5832748", "0.5813053", "0.5807306", "0.5798241", "0.57673204", "0.5763316", "0.5760954", "0.575495", "0.5749711", "0.5747244", "0.57317513", "0.5728892", "0.57250655", "0.5721162", "0.5719934", "0.5717492", "0.5714312", "0.5711435", "0.571071", "0.5704167", "0.56760406", "0.56739026", "0.5655418", "0.56548506", "0.5652974", "0.56477237", "0.5634977", "0.5627144", "0.56254065", "0.56125796", "0.5612272", "0.5600463", "0.55977684", "0.55885977", "0.5576952", "0.5575065", "0.5574446", "0.5565926", "0.5562452", "0.5560714", "0.55584866", "0.5556166", "0.55463594" ]
0.68500245
7
Removes an element with a given value from an array
function arrayRemove($array, $values, $reorder=false) { $values = (array)$values; foreach($values as $value) { while(false !== ($loc = array_search($value, $array))) unset($array[$loc]); } return ($reorder ? array_values($array) : $array); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function array_remove($element, $array) {\n $index = array_search($element, $array);\n array_splice($array, $index, 1);\n return $array;\n }", "static public function arrRmByVal($arr,$value=''){\n $arr = is_array($arr)?$arr:array();\n foreach ($arr as $k=>$v)\n {\n if ($v == $value)\n unset($arr[$k]);\n }\n return $arr;\n }", "function skudo_remove_item_by_value($array, $val = '') {\n\tif (empty($array) || !is_array($array)) return false;\n\tif (!in_array($val, $array)) return $array;\n\n\tforeach($array as $key => $value) {\n\t\tif ($value == $val) unset($array[$key]);\n\t}\n\n\treturn array_values($array);\n}", "function unsetByValue(array $array, $value):array\n{\n if (($key = array_search($value, $array)) !== false) {\n unset($array[$key]);\n }\n\n return $array;\n}", "static function remove(&$array,$value = false,$strict = false){\n\t\tif(!is_array($array)){\n\t\t\tthrow new \\Exception('Parameter must be an array');\n\t\t}\n\t\t$existingKey = array_search($value,$array);\n\t\twhile($existingKey !== false){\n\t\t\tunset($array[$existingKey]);\n\t\t\t$existingKey = array_search($value,$array,$strict);\n\t\t}\n\t\treturn $array;\n\t}", "function array_remove(array &$array, callable $pred)\n{\n $i = array_index_of($array, $pred);\n if (null === $i) {\n return null;\n }\n\n $v = $array[$i];\n if (is_numeric_array($array)) {\n array_splice($array, $i, 1);\n } else {\n unset($array[$i]);\n }\n\n return $v;\n}", "function array_remove($array, $val){\n $vals = func_get_args(); $vals = array_shift($vals);\n return array_diff($array, array($val));\n}", "public function array_remove(&$array, $value)\n {\n return array_filter($array, function($a) use($value) {\n return $a !== $value;\n });\n }", "protected function array_remove($arr, $value) {\n\t\treturn array_values(array_diff($arr, array($value)));\n\t}", "function remove_item_by_value($array, $val = '', $preserve_keys = true) {\n\tif (empty($array) || !is_array($array)) return false;\n\tif (!in_array($val, $array)) return $array;\n\n\tforeach($array as $key => $value) {\n\t\tif ($value == $val) unset($array[$key]);\n\t}\n\n\treturn ($preserve_keys === true) ? $array : array_values($array);\n}", "static public function deleteFromArray($needle, &$array) {\n foreach ($array as $key => $value) {\n if ($value == $needle) {\n unset($array[$key]);\n return;\n }\n }\n }", "function destroyer($arr, $valsToRemove) {\n\n $ret = array();\n foreach($arr as $v) {\n if(array_search($v, $valsToRemove) === false)\n $ret[] = $v;\n }\n return $ret;\n}", "private static function removeFromArray($value, array $array): array {\n\t\t$tmpNew = [];\n\t\t$i = 0;\n\n\t\t// Process for each array item. Construct new array without the searched value\n\t\tforeach($array as $itemValue) {\n\t\t\tif($value != $itemValue) {\n\t\t\t\t$tmpNew[$i] = $itemValue;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\n\t\treturn $tmpNew;\n\t}", "function elimina($array,$valore){\n\t\t// verifico che il valore sia compreso nell'array\n\t\tif(in_array($valore,$array)){\n\t\t\t$chiave=array_search($valore,$array);\n\t\t\t// rimuovo il valore passando ad unset la chiave recuperata usando array_search\n\t\t\tunset($array[$chiave]); \n\t\t\t\n\t\t\t// restituisco l'array dopo averlo re-indicizzato\n\t\t\treturn array_values($array);\n\t\t}else{\n\t\t\t// se non trovo corrispondenze restituisco l'array così com'è\n\t\t\treturn $array;\n\t }\n\t}", "function removeItemsByValue(&$array,$itemsToRemove) {\r\n\t\tforeach($array as $key => $value) {\r\n\t\t\tif(in_array($value,$itemsToRemove)) unset($array[$key]);\r\n\t\t}\r\n\t}", "function array_delete($array, $element) {\n return array_diff($array, [$element]);\n}", "public static function removeValue(&$array, $value)\n {\n $result = [];\n if (is_array($array)) {\n foreach ($array as $key => $val) {\n if ($val === $value) {\n $result[$key] = $val;\n unset($array[$key]);\n }\n }\n }\n\n return $result;\n }", "public function remove($value);", "function array_remove(array &$arr, $key) {\n if (isset($arr[$key])) {\n $val = $arr[$key];\n unset($arr[$key]);\n return $val;\n }\n\n return NULL;\n}", "public static function removeValueFromArray($array, $arrayValue) {\n\t\treturn array_diff($array, [$arrayValue]);\n\t}", "function array_remove(array &$arr, $key) {\n if (array_key_exists($key, $arr)) {\n $val = $arr[$key];\n unset($arr[$key]);\n\n return $val;\n }\n\n return null;\n}", "public function remove($value)\n {\n $value = (string) $value;\n if (($key = array_search($value, $this->items)) !== false) {\n unset($this->items[$key]);\n }\n }", "public function removeElement($element) {\n\tif(is_int($element)) {\n\t\tunset($this->_elArray[$element]);\n\t}\n\t$key = array_search($element, $this->_elArray);\n\tunset($this->_elArray[$key]);\n}", "function remove_values(array $hand, string $val):array {\n return array_values(array_filter($hand, function ($el) use ($val) {return $el[0] !== $val;}));\n}", "function unsetArray($array){\n\n foreach($array as $subKey => $subArray ){\n if($subArray['item_id'] == $_GET['delete']){\n //echo $subKey['item_id'];\n //echo $_GET['delete'];\n unset($array[$subKey]);\n }\n }\n return $array;\n }", "function removeElement($arr, $num) {\n if (empty($arr)) {\n return $arr;\n }\n for ($i=0; $i < sizeof($arr); $i++) { \n if ($arr[$i] == $num) {\n $j = $i;\n while ($j > 0) {\n if ($arr[$j-1] == $num) {\n break;\n }\n swap($arr[$j], $arr[$j-1]);\n $j--;\n }\n }\n }\n return array_slice($arr, $j+1);\n}", "public function removeValue($element);", "function array_remove($value, array $array, bool $removeFirstOnly = false): array\n {\n return Arr::remove($value, $array, $removeFirstOnly);\n }", "public function remove_value(string $value)\n {\n if(gettype($this -> value) === \"string\"){\n if($this -> value === $value) $this -> value = null;\n }else{\n if (($key = array_search($value, $this -> value)) !== false) {\n #unset($this -> value[$key]);\n array_splice($this -> value, $key, 1);\n }\n }\n }", "private function removeFromArray(array &$array, array $path): void\n {\n $previous = null;\n $tmp = &$array;\n\n foreach ($path as $node) {\n $previous = &$tmp;\n $tmp = &$tmp[$node];\n }\n\n if (null !== $previous && true === isset($node)) {\n unset($previous[$node]);\n }\n }", "public static function removeValueFromArray(string $arrayKey, $value): ?bool {\n\t\treturn self::addOrRemoveValueFromArray ( $arrayKey, $value, false );\n\t}", "public static function arrayRemoveElements($arr, $attr, $val) {\n $new_array = array();\n foreach ($arr as $e) {\n if ($e->$attr != $val) {\n array_push($new_array, $e);\n }\n }\n return $new_array;\n }", "function without(array $items, ...$value)\n{\n $filtered = array_filter($items, function ($item) use ($value) {\n return !in_array($item, $value);\n });\n // Сбрасываем ключи\n return array_values($filtered);\n}", "function array_forget(&$array, $keys)\n {\n Arr::forget($array, $keys);\n }", "function array_forget(&$array, $keys)\n {\n Arr::forget($array, $keys);\n }", "function stray($arr)\n{\n if ($arr[0] == $arr[1]) {\n $delete = $arr[0];\n\n foreach ($arr as $key => $item){\n if ($item == $delete){\n unset($arr[$key]);\n }\n }\n } else if ($arr[0] == $arr[2]) {\n $delete = $arr[0];\n\n foreach ($arr as $key => $item){\n if ($item == $delete){\n unset($arr[$key]);\n }\n }\n }\n\n return current($arr);\n}", "public function removeItemFromArray(&$data, $needle, $what)\r\n {\r\n\r\n if ($what === 'value') {\r\n if (($key = array_search($needle, $data)) !== false) {\r\n unset($data[$key]);\r\n }\r\n } elseif ($what === 'key') {\r\n if (array_key_exists($needle, $data)) {\r\n unset($data[$needle]);\r\n }\r\n }\r\n\r\n //return $data;\r\n }", "public static function unsetArray($element,$arrayStack){\n if (($key = array_search($element, $arrayStack)) !== false) {\n unset($arrayStack[$key]);\n }\n return $arrayStack;\n }", "public function removePhoto($value)\n {\n $key = array_search($value, $this->photos);\n if($key !== false) {\n unset($this->photos[$key]);\n }\n }", "public static function removeArrayItemByKey($array, $item)\n {\n if (!Arrays::isArray($array, false)) {\n return false;\n }\n\n $cleaned_array = array();\n\n foreach ($array AS $key => $val) {\n if ($key !== $item) {\n $cleaned_array[$key] = $val;\n }\n }\n\n return $cleaned_array;\n }", "public static function removeFirstBy(array $array, $by, $value = null): array\n {\n if (empty($array)) {\n return $array;\n }\n\n $skipped = 0;\n\n foreach ($array as $item) {\n if (self::satisfies($item, $by, $value)) {\n break;\n }\n\n $skipped++;\n }\n\n if ($skipped == count($array)) {\n return $array;\n }\n\n return array_merge(\n self::take($array, $skipped),\n self::skip($array, $skipped + 1)\n );\n }", "function array_forget(&$array, $keys)\n {\n return Arr::forget($array, $keys);\n }", "public function removeMultiValue($strName, $value)\r\n {\r\n // TODO: remove the value from the multi-value array\r\n }", "public function remove($element)\n {\n $temp = array();\n foreach ($this->elements as $existingElement) {\n if ($element !== $existingElement) {\n $temp[] = $existingElement;\n }\n }\n $this->elements = $temp;\n }", "public function remove(mixed $value) {\n $this->items = array_filter($this->items, function ($var) use ($value) {\n return $var !== $value;\n });\n return $this;\n }", "public function offsetUnset( $key );", "function removeMemberbyName($arr, $name){\n\t\tforeach($arr as $key => $arrNew) {\n\t\t\t// Neu phan tu nay co ten trung yeu cau thi loai bo phan tu do\n\t\t\tif ($arrNew['name'] == $name) {\n\t\t\t\tunset($arr[$key]);\n\t\t\t}\n\t\t}\n\t\treturn $arr;\n\t}", "public static function remove(&$array, $key, $default = null)\n {\n if (is_array($array) && (isset($array[$key]) || array_key_exists($key, $array))) {\n $value = $array[$key];\n unset($array[$key]);\n\n return $value;\n }\n\n return $default;\n }", "public function remove( $key ) {\n\t\tif (isset($this->array[$key])) {\n\t\t\tunset($this->array[$key]);\n\t\t}\n\t}", "public function removeFirst();", "public function removeElement($value)\n {\n $key = array_search($element, $this->data, true);\n if (false !== $key) {\n unset($this->data[$key]);\n }\n\n return $this;\n }", "function array_pop(&$array)\n{\n}", "public function removeElement($element);", "public function remove($element);", "protected function clearArray($value)\n\t{\n\t\treturn array_values(array_unique(array_map('intval', $value)));\n\t}", "function removeWhere($value,$strict = false){\r\n\t\tif(is_callable($value) && $strict === false){\r\n\t\t\tforeach($this as $k=>$v){\r\n\t\t\t\tif($value($v,$k)){\r\n\t\t\t\t\tunset($this[$k]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tforeach($this as $k=>$v){\r\n\t\t\t\tif(($strict && $v === $value) || $v == $value){\r\n\t\t\t\t\tunset($this[$k]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function testRemoveElementWillReturnTrueIfTheElementIsInArray()\n {\n $element1 = new \\stdClass();\n $element1->Name = 'EL 1';\n\n $element2 = new \\stdClass();\n $element2->Name = 'EL 2';\n\n $Collection = new \\MySQLExtractor\\Common\\Collection();\n\n $Collection->set('index2', $element2);\n $Collection->set('index1', $element1);\n\n $this->assertTrue($Collection->removeElement($element2));\n }", "public /*void*/ function offsetUnset(/*scalar*/ $offset){}", "public function testWithout() {\n\t\t$array = array(1, 2, 3, 4, 5);\n\t\t$result = _::without($array, 6);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(5, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(2, $result[1]);\n\t\t$this->assertEquals(3, $result[2]);\n\t\t$this->assertEquals(4, $result[3]);\n\t\t$this->assertEquals(5, $result[4]);\n\n\t\t// test removing a single element\n\t\t$result = _::without($array, 3);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(4, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(2, $result[1]);\n\t\t$this->assertEquals(4, $result[3]);\n\t\t$this->assertEquals(5, $result[4]);\n\n\t\t// test removing multiple elements\n\t\t$result = _::without($array, 1, 2, 3);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(4, $result[3]);\n\t\t$this->assertEquals(5, $result[4]);\n\n\t\t// test removing all elements\n\t\t$result = _::without($array, 1, 2, 3, 4, 5);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(0, $result);\n\t}", "public function remove($key, $value = '');", "public function offsetUnset($offset);", "public function offsetUnset($offset);", "function remove_portfolio_record_by_symbol($symbol){\n $portfolio = load_portfolio_array();\n foreach ($portfolio as $key => $old_record){\n if($old_record[\"symbol\"] == $symbol) { \n unset($portfolio[$key]);\n break;\n }\n }\n return $portfolio;\n}", "public static function deleteValue(&$array, $key)\n {\n if (is_string($key)) {\n // Iterate path\n $keys = explode('.', $key);\n $last = array_pop($keys);\n foreach ($keys as $key) {\n if (!isset($array[$key])) {\n return;\n }\n $array = &$array[$key];\n }\n if (isset($array[$last])) {\n // Detele path\n unset($array[$last]);\n }\n } elseif (is_array($key)) {\n // Iterate array of paths\n foreach ($key as $k) {\n self::delete($k);\n }\n }\n }", "function remove ($key);", "private function removeElementsFromArray($array, $remove){\n $result = array();\n for($i=0; $i < count($array); $i++){\n for($j=0; $j < count($remove); $j++ ){ \n if($array[$i] == $remove[$j]){ \n $array[$i] = false;\n }\n }\n }\n \n for($i=0; $i < count($array); $i++){\n if($array[$i] != false){\n array_push($result, $array[$i]);\n }\n }\n \n return $result;\n }", "public function offsetUnset($index);", "public function removeAttendee($value)\n {\n $key = array_search($value, $this->attendees);\n if($key !== false) {\n unset($this->attendees[$key]);\n }\n }", "public abstract function retain_array(Array $array);", "function array_pull(&$array, $key, $default = null)\n {\n return Arr::pull($array, $key, $default);\n }", "function array_pull(&$array, $key, $default = null)\n {\n return Arr::pull($array, $key, $default);\n }", "public function unsetVar (&$array, $variable)\n {\n if ( isset ($array[$variable]) )\n {\n unset ($array[$variable]);\n }\n }", "public function offsetUnset($offset) {}", "public function offsetUnset($offset) {}", "public function offsetUnset($offset) {}", "public function offsetUnset($offset) {}", "public function offsetUnset($offset) {}", "static function remove(&$array, $key) {\n $keys = explode('.', $key);\n\n while (sizeof($keys) > 1) {\n $key = array_shift($keys);\n\n if (!isset($array[$key]) || !is_array($array[$key])) {\n return;\n }\n\n $array =& $array[$key];\n }\n\n unset($array[array_shift($keys)]);\n }", "function remove($key);", "function remove($key);", "public function removeTrue(array &$array)\n {\n $array = array_filter($array,\n function ($value) {\n return $value !== true;\n });\n }", "public static function removedFromArray($old_array, $new_array) {\r\n\r\n/*\tThis function returns those values that exist in the old \r\n\tarray, but are no longer found in the new one. Those \r\n\tvalues have essentially been \"removed\" to the old array. */\r\n\r\n $removed = array_diff($old_array, $new_array);\r\n return $removed;\r\n \r\n}", "public function removeAt($key);", "public function removed(mixed $element): Set;", "function array_pull(&$array, $key, $default = null)\n\t{\n\t\t$value = array_get($array, $key, $default);\n\n\t\tarray_forget($array, $key);\n\n\t\treturn $value;\n\t}", "function remove_array($array_name){\n $removed = 0;\n $ret = array();\n $set = $this->get_settings();\n\n //get line numbers of current settings\n if( strpos($array_name, '[') === false ){\n //only the array name was passed, without []\n $config_value = $array_name;\n }else{\n $config_value = substr($array_name, 0, strpos($array_name, '[') ); //this is the value of $key without [n]. this is used for the array name when writing it back\n }\n exec( $set['CMD_GREP'].' -n \"'.$config_value.'\" '.$this->_settings_file.' | '.$set['CMD_CUT'].' -d: -f1', $ret); // $ret[] will contain line number with current settings\n\n //loop over returned values and remove the lines\n for( $x = count($ret)-1 ; $x >= 0 ; --$x ){ //go backwards or line numbers need to be adjusted\n exec( $set['CMD_SED'].' \"'.$ret[$x].'d\" '.$this->_settings_file.' > '.$this->_settings_file.'.back');\n// exec('sed -e :a -e \\'/^\\n*$/{$d;N;};/\\n$/ba\\' '.$this->_settings_file.'.back');\n exec('mv '.$this->_settings_file.'.back '.$this->_settings_file.'');\n ++$removed;\n }\n\n return $removed;\n}", "public function testRemoveWillReturnNullIfTheElementIsNotInArray()\n {\n $element1 = new \\stdClass();\n $element1->Name = 'EL 1';\n\n $element2 = new \\stdClass();\n $element2->Name = 'EL 2';\n\n $element3 = new \\stdClass();\n $element3->Name = 'EL 3';\n\n $Collection = new \\MySQLExtractor\\Common\\Collection();\n\n $Collection->set('index2', $element2);\n $Collection->set('index1', $element1);\n\n $this->assertNull($Collection->removeElement($element3));\n }", "function remove($item) {\n\t\t\t$numItems = count($this->items);\n\n\t\t\tfor($i = 0; $i < count($this->items); $i++) {\n\t\t\t\t$_item = $this->items[$i];\n\n\t\t\t\t// grab the last item's value, overwrite it \n\t\t\t\t// to the found item, then pop it off the stack\n\t\t\t\tif($_item->equals($item)) {\n\t\t\t\t\t$this->items[$i] = $this->items[$numItems - 1];\n\t\t\t\t\tarray_pop($this->items);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function delete_array($array)\n{\n\t// get arguments\n\t$args = func_get_args();\n\t// unset first arg, b/c it is the array\n\tunset($args[0]);\n\t// if args = array in array, turn into just array\n\tif(isset($args[1]) && is_array($args[1]))\n\t{\n\t\t$args = $args[1];\n\t}\n\t// remove specified fields from array\n\t$array = _delete_array($array, $args);\n\t// remove empty elements from array\n\t$array = empty_array($array);\n\t// return array\n\treturn $array;\n}", "function array_forget(&$array, $key)\n\t{\n\t\t$keys = explode('.', $key);\n\n\t\twhile (count($keys) > 1)\n\t\t{\n\t\t\t$key = array_shift($keys);\n\n\t\t\tif ( ! isset($array[$key]) || ! is_array($array[$key]))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$array =& $array[$key];\n\t\t}\n\n\t\tunset($array[array_shift($keys)]);\n\t}", "static public function filterHasNotValue(&$arr, $value)\n {\n $results = array();\n\n //test what type the value is\n $type = gettype($value);\n foreach ($arr as $key => $val) {\n //we can only compare if the types match\n if (gettype($val) === $type) {\n if ($val !== $value) {\n $results[$key] = $val;\n }\n }\n }\n\n return $results;\n }", "public function Delete($value){\n $this->RetrieveData();\n foreach($this->movieList as $key =>$movie){\n if($movie->getNombre() == $value){\n unset($this->movieList[$key]);\n break;\n }\n }\n $this->SaveData();\n }", "public function removeSubEvent($value)\n {\n $key = array_search($value, $this->subEvents);\n if($key !== false) {\n unset($this->subEvents[$key]);\n }\n }", "public function removeFindThisAnywhere()\n\t{\n\t\tif(isset($this->masterArray[$this->ref_wildCard]))\n\t\t{\n\t\t\tunset($this->masterArray[$this->ref_wildCard]);\n\t\t}\n\t}", "function removeAt($index)\r\n\t\t{\r\n\t\t\tarray_splice($this->elements, $index, 1);\r\n\t\t}", "function array_take(array &$array, $key, $default = null) {\n $value = array_get($array, $key, $default);\n\n if (array_has($array, $key)) {\n array_remove($array, $key);\n }\n\n return $value;\n }", "function borrarPedidoArrayPosicion($posicionBorrar,$arrayPedidos){\r\n $pos = intval($posicionBorrar);\r\n for ($i=0; $i < count($arrayPedidos); $i++) {\r\n if($pos == $i){\r\n unset($arrayPedidos[$pos]);\r\n }\r\n }\r\n if($pos == 0){\r\n unset($arrayPedidos[0]);\r\n }\r\n return $arrayPedidos;\r\n}", "function remove_filter ($filter,$remove) \n{\n unset($filter[$remove]);\n return $filter;\n}", "public function removeElement( $name ) {\n\t\tunset( $this->data[ $name ] );\n\t}", "function filter_array($arr, $column, $value) {\n $output = array();\n foreach ($arr as $row) {\n if ($row[$column] == $value) {\n $output[] = $row;\n }\n }\n return $output;\n}" ]
[ "0.777078", "0.7639707", "0.7627001", "0.74275595", "0.736401", "0.73548603", "0.72905743", "0.72849894", "0.71455365", "0.71308476", "0.7125155", "0.70004857", "0.6966838", "0.69521517", "0.685813", "0.6844499", "0.6753223", "0.66649544", "0.6629375", "0.66047686", "0.6492415", "0.6492042", "0.6481807", "0.6408342", "0.6380449", "0.6369184", "0.6347575", "0.63172543", "0.62973714", "0.6254968", "0.6202863", "0.61855954", "0.6117293", "0.6095452", "0.6095452", "0.60832506", "0.6060779", "0.60603726", "0.6042717", "0.6008476", "0.6003193", "0.59603614", "0.59238034", "0.59065163", "0.58993876", "0.5847876", "0.584461", "0.5821177", "0.5820145", "0.58190024", "0.5815523", "0.5812828", "0.5811297", "0.5805185", "0.58010805", "0.5753987", "0.5739508", "0.572429", "0.5706533", "0.57017183", "0.5698137", "0.5698137", "0.56973004", "0.5688395", "0.5682695", "0.56792665", "0.5668253", "0.5660352", "0.56519777", "0.5640636", "0.5640636", "0.5637857", "0.56261635", "0.56261635", "0.56261635", "0.56258005", "0.56258005", "0.5624798", "0.5624702", "0.5624702", "0.5567797", "0.55634034", "0.55539626", "0.5551226", "0.55484325", "0.55483264", "0.5512074", "0.5510303", "0.55042166", "0.550296", "0.5497279", "0.5494465", "0.5490517", "0.5461596", "0.54423296", "0.5439954", "0.54298806", "0.54278725", "0.5421102", "0.54155767" ]
0.6488062
22
Reset the main variables and restart the page generation in order to make an internal redirect.
function internalRedirect($to){ global $ID, $PAGE, $CURRENT, $Controller, $OLD; if(!is_object($to)) $to = $Controller->{(string)$to}; if($PAGE) $OLD = $PAGE->ID; else $OLD = false; $PAGE = $CURRENT = $to; $_REQUEST['id'] = $to->ID; if(!@method_exists($CURRENT, 'run')) errorPage('Controller unknown'); /** * Execute the requested object */ $CURRENT->run(); /** * Send output to browser */ while (ob_get_level() > 0) { ob_end_flush(); } exit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reset()\n {\n $this->env = array();\n $this->object_handlers = array();\n $this->pagetitle = '';\n }", "static function RedirToDefault()\n\t{\n\t\theader(\"Location: \" . $GLOBALS['host'] . self::$subDir . \"/\" . self::$defPage);\n\t}", "public function reload() {\n $this->init();\n redirect('./');\n }", "public function reset()\n {\n\t Cache::forget('welcome-page');\n\t \n\t $defautl = \\File::get(public_path('template/backup.tpl'));\n\t \\File::put(public_path('template/default.tpl'), $defautl);\n\n\t Cache::forever('welcome-page', $defautl);\n\n\t return redirect()->route('admin.ladi.index')->with('status', 'Khôi phục template thành công!');\n }", "public function blankPage()\n {\n $this->_sidebar = false;\n $this->_layout = false;\n $this->_render = false;\n }", "function ReconstructPreviousPage() {\r\n\t\tglobal $character, $sr, $gameinstance;\r\n\t\t$previous_template_vars = unserialize($character['curr_template_vars']);\r\n\t\t// clear all prior assigned variables\r\n\t\t$sr->clear_all_assign();\r\n\t\t//echo(\"<br>Starting...<br>\");\r\n\t\t//print_array($character);\r\n\t\t//echo(\"<br>...Mid...<br>\");\r\n\t\t//print_r($previous_template_vars);\r\n\t\t//echo(\"<br>...Ending<br>\");\r\n\t\tforeach($previous_template_vars as $key=>$variable) \r\n\t\t{\r\n\t\t\t$sr->assign(\"$key\", $variable);\r\n\t\t}\r\n\t\t$sr->display($character['curr_template_page']);\r\n\t\texit();\r\n\t}", "public function init() {\n\t\t\theader('Location: ../install/index.php');\n\t\t}", "public function resetAction() {\n $_SESSION = array();\n session_destroy();\n return self::redirect('index');\n }", "public function reset(){\n $this->_request_uri = '';\n self::$_request_vars = array();\n }", "protected function reset() {}", "protected function reset() {}", "protected function reset() {}", "public function resetResponse()\n\t{\n\t\t$this->_response = NULL;\n\t\t$this->_redirect = NULL;\n\t}", "public function refresh() {\n\t\t$this->redirect( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '/' );\n\t}", "public function restart()\n {\n session_regenerate_id(true);\n $this->setup();\n }", "public static function reset()\n\t{\n\t\tstatic::$returnSize = 1048576;\n\t\tstatic::$reportedSize = 1048576;\n\t\tstatic::$url = 'http://www.example.com/donwload.dat';\n\t\tstatic::$errno = 0;\n\t\tstatic::$error = '';\n\t\tstatic::$httpstatus = 200;\n\t}", "public function reset()\n\t{\n\t\t$this->hasScripts = false;\n\t\t$this->cssFiles = array();\n\t\t$this->css = array();\n\t\t$this->scriptFiles = array();\n\t\t$this->scripts = array();\n\t\t$this->metaTags = array();\n\n\t\t$this->recordCachingAction('clientScript', 'reset', array());\n\t}", "private function restart() {\n session_start();\n session_regenerate_id();\n session_destroy();\n session_commit();\n session_start();\n $this->setUserAgent();\n $this->setRemoteAddress();\n }", "private function reset() {\n $this->_minimumPage = NULL;\n $this->_maximumPage = NULL;\n $this->_previousPage = NULL;\n $this->_nextPage = NULL;\n $this->_lastPage = NULL;\n }", "private function resetVars()\n {\n $this->response = $this->calls = array();\n $this->hasCalls = $this->isBatchCall = false;\n }", "public static function reset() {\n\t\t// Tell the router to generate a new top level group\n\t\tstatic::getRouter()->resetMainGroup();\n\t}", "public function reset()\n {\n\n $_SESSION['errors'] = '';\n\n }", "function reset_vars() {\n $this->page[\"Name\"] = \"\";\n $this->page[\"Bio\"] = \"\";\n\n // \"Name\" page:\n $this->main_photo = \"\";\n $this->fullname = \"\";\n $this->birthday = array();\n $this->actorsfilms = array();\n $this->producersfilms = array();\n $this->soundtrackfilms = array();\n $this->directorsfilms = array();\n $this->crewsfilms = array();\n $this->thanxfilms = array();\n $this->selffilms = array();\n $this->archivefilms = array();\n\n // \"Bio\" page:\n $this->birth_name = \"\";\n $this->nick_name = array();\n $this->bodyheight = array();\n $this->bio_bio = array();\n $this->bio_trivia = array();\n $this->bio_tm = array();\n $this->bio_salary = array();\n }", "public static function reset()\n\t{\n\t\tif(static::$use_cookies === true)\n\t\t{\n\t\t\t\\Cookie::delete('fuel_ts_sort_by');\n\t\t\t\\Cookie::delete('fuel_ts_direction');\n\t\t}\n\t\t\n\t\tstatic::$sort_by \t= static::$default_sort_by;\n\t\tstatic::$direction \t= static::$default_direction;\n\t}", "function resetLazyData()\n{\n global $singlepages;\n $singlepages = \"\";\n global $singlepage_names;\n $singlepage_names = \"\";\n global $multipages;\n $multipages = \"\";\n global $multipage_names;\n $multipage_names = \"\";\n global $entity;\n $entity = \"\";\n global $old_entities;\n $old_entities = \"\";\n global $old_page_infos;\n $old_page_infos = \"\";\n global $sys_infos;\n $sys_infos = \"\";\n}", "public function controller_global(){\n\t\tparent::controller_global();\n\t\tunset($this->sub_links[\"index\"]);\n\t\tunset($this->sub_links[\"create\"]);\n\n\t}", "public static function rememberRequestedPage(): void\n\t{\n\t\t$_SESSION['return_to'] = $_SERVER['REQUEST_URI'];\n\t}", "function complentary_session_reset_data() {\n // Diff Wizard session data\n $url_path = $_SERVER['REQUEST_URI'];\n if (strpos($url_path, 'diff-wizard') !== false || strpos($url_path, 'product') !== false ) {\n if ( ! session_id() ) {\n session_start();\n }\n } else {\n if ( ! session_id() ) {\n session_start();\n }\n unset(\n $_SESSION['diffID'],\n $_SESSION['diffyear'],\n $_SESSION['make'],\n $_SESSION['model'],\n $_SESSION['drivetype']\n );\n }\n}", "private function warmUp()\r\n\t{\r\n\t\t$this->loadPage( 1 );\r\n }", "protected function resetFrontendEnvironment() {}", "public function finish()\n {\n $this->view->dictionary = $this->dictionary;\n $this->view->previousAction = $this->parseActions();\n\n if ($this->view->previousAction == 'introduction') {\n $this->view->action = 'introduction';\n } else {\n $this->view->action = 'search';\n }\n\n $this->view->params = $this->front->params;\n $this->view->isIE = $this->isIE();\n $this->view->domainSubpath = $this->front->config['domain-subpath'];\n\n $this->setLastWordCookies();\n }", "public function reset(){}", "private function buildPage() {\n ob_clean();\n ob_start();\n\n //session_start();\n require_once $this->_template;\n\n $this->_page = ob_get_clean();\n }", "public function recreateMaps()\n {\n $maps = $this->getRedirectsMapsByType();\n\n $this->recreateMapFile($maps, static::STATUS_CODE_301_MOVED_PERMANENTLY);\n $this->recreateMapFile($maps, static::STATUS_CODE_302_FOUND);\n\n // apache doesn't need reload\n if ($this->serverType === 'nginx') {\n $this->reloadNginxConfigs();\n }\n }", "function refresh() {\n\t\t$this->session->unset_userdata ( $this->module . \"_search_field\" );\n\t\t$this->session->unset_userdata ( $this->module . \"_search_value\" );\n\t\t$this->session->unset_userdata ( $this->module . \"_search_status\" );\n\t\t$this->session->unset_userdata ( $this->module . \"_order_by_value\" );\n\t\t$this->session->unset_userdata ( $this->module . \"_order_by_field\" );\n\t\tredirect ( admin_url () . $this->module );\n\t}", "function _prepare() {\n\t\tif (!in_array($this->action, $this->unprotected_actions) && !isset($_SESSION['admin'])) {\n\t\t\t$this->session('return_to', $this->route);\n\t\t\t$this->redirect('admin/index');\n\t\t}\n\t}", "protected function reset(): void\n {\n }", "public static function reset() {\n\t self::$hasError = false;\n\t self::$logonUri = 'logon.do';\n\t self::$lazyBaseDir = null;\n\t self::$lazyBasePath = null;\n\t self::$baseUrl = null;\n\t self::$command = null;\n\t self::$commandMap = null;\n\t\tself::$host = null;\n\t self::$hostname = null;\n\t\tself::$id = null;\n\t self::$mapDir = null;\n\t self::$method = null;\n\t self::$pageDir = null;\n\t self::$path = null;\n\t self::$lazyPathParam = null;\n\t self::$port = null;\n\t self::$remoteAddr = null;\n\t self::$scheme = null;\n\t self::$scopeList = null;\n\t self::$scriptDir = null;\n\t self::$scriptName = null;\n\t\tself::$startTime = null;\n\t self::$state = null;\n\t\tself::$trust = false;\n\t\tself::$urlBase = null;\n\t}", "public static function resetTemplates()\n\t{\n\t\tself::$_template_names = array();\n\t}", "function preloadPage(){\n\t\tif($this->hasFlag(0,\"logout\")){\n\t\t\t$this->usr->log_out();\n\t\t\t\n\t\t\t\n\t\t\t$this->bodyContent .= \"<h1>Logged out</h1>\";\n\t\t\tif(!$this->lastFlag(\"iframe\")){\n\t\t\t\t$this->bodyContent .= \"<script type=\\\"text/javascript\\\"> function fwd(){ window.location = \\\"/home\\\"; } setTimeout('fwd()', 1000); </script>\";\n\t\t\t}\n\t\t\t//header(\"Location: /home/loggedout\");\n\t\t\t//return false; \n\t\t}\n\t\telse if($this->hasFlag(0,\"register\")){\n\t\t\tif($this->hasFlag(1,\"success\")){\n\t\t\t\tif($this->usr->is_logged_in()){\n\t\t\t\t\t$this->bodyContent .= \"<h1>Registration successful!</h1>\n\t\t\t\t\t<script type=\\\"text/javascript\\\"> function fwd(){ window.location = \\\"/home\\\"; } setTimeout('fwd()', 1000); </script>\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\theader(\"Location: /home\" . $this->add_iframe());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$regVars = $this->getValues($_POST,array(\"input_first_name\",\"input_last_name\",\"input_email\",\"input_password\",\"input_password_conf\"));\n\t\t\t\tif($regVars === false){\n\t\t\t\t\t$this->bodyContent .= $this->errorTemplate(\"You must fill out all of the registration form!\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//echo \"two\";\n\t\t\t\t\tif($regVars[\"input_password\"] !== $regVars[\"input_password_conf\"]){\n\t\t\t\t\t\t$this->bodyContent .= $this->errorTemplate(\"Your password and the confirmation do not match!\");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$regInfo = $this->usr->register_user($regVars[\"input_email\"],$regVars[\"input_password\"],$regVars[\"input_first_name\"],$regVars[\"input_last_name\"]);\n\t\t\t\t\t\tif($regInfo[\"success\"] === 1){\n\t\t\t\t\t\t\t//$this->bodyContent .= \"<h1>Registration successful!</h1>\";\n\t\t\t\t\t\t\theader(\"Location: /auth/register/success\" . $this->add_iframe());\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$temp = \"\";\n\t\t\t\t\t\t\tforeach($regInfo[\"errors\"] as $error){\n\t\t\t\t\t\t\t\t$temp .= $error . \"<br />\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this->bodyContent .= $this->errorTemplate($temp);\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\telse if($this->hasFlag(0,\"login\")){\n\t\t\tif($this->hasFlag(1,\"success\")){\n\t\t\t\tif($this->usr->is_logged_in()){\n\t\t\t\t\t$this->bodyContent .= \"<h1>Log in successful!</h1>\n\t\t\t\t\t<script type=\\\"text/javascript\\\"> function fwd(){ window.location = \\\"/home\\\"; } setTimeout('fwd()', 1000); </script>\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\theader(\"Location: /auth\" . $this->add_iframe());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$regVars = $this->getValues($_POST,array(\"input_email\",\"input_password\"));\n\t\t\t\tif($regVars === false){\n\t\t\t\t\t$this->bodyContent .= $this->errorTemplate(\"You must fill out all of the log in form!\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$regInfo = $this->usr->log_in($regVars[\"input_email\"],$regVars[\"input_password\"]);\n\t\t\t\t\tif($regInfo[\"success\"] === 1){\n\t\t\t\t\t\t//$this->bodyContent .= \"<h1>Log in successful!</h1>\";\n\t\t\t\t\t\theader(\"Location: /auth/login/success\" . $this->add_iframe());\n\t\t\t\t\t\treturn false; \n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$temp = \"\";\n\t\t\t\t\t\tforeach($regInfo[\"errors\"] as $error){\n\t\t\t\t\t\t\t$temp .= $error . \"<br />\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->bodyContent .= $this->errorTemplate($temp);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if($this->usr->is_logged_in()){\n\t\t\theader(\"Location: /home\");\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "protected function initProjectSpecific() {\n\t\tView::$projectLocation = str_replace(\"index.php\", \"\", $_SERVER['PHP_SELF']);\n\t}", "protected function resetFrontendEnvironment() {\n\t\t$GLOBALS['TSFE'] = $this->tsfeBackup;\n\t\tchdir($this->workingDirectoryBackup);\n\t}", "function DBreset()\n{\n\tlocation.replace(\"reset.php\");\n}", "public function routerRebuilding() {\n $this->rebuilding = TRUE;\n }", "protected static function resetFrontendEnvironment() {}", "protected static function resetFrontendEnvironment() {}", "public function setWebsiteRedirect(){\n\t\t\n\t\t// Set the state and tell plugins.\n\t\t$this->setState('REDIRECTING');\n\t\t$this->notifyObservers();\n\t\t\n\t\t//Show success message on redirected to page\n\t\t$_SESSION['ERROR_TYPE'] = \"success\";\n\t\t$_SESSION['ERROR_MESSAGE'] = \"Website Data Saved Successfully\";\n\t\t\n\t\t//Go Redirect\n\t\t$this->setRedirect(\"index.php?system=GeneralSettings&page=edit\");\t\n\t}", "function reset() {\n Ad::resetCounter();\n unset($_GET['reset']);\n }", "public function generatePage_postProcessing() {}", "public function reset() {\n $this->customurlscount = 0;\n }", "function afterroute() {\t\t\n\t\t$f3=Base::instance();\n\t\t// Render HTML layout\n\t\tif (!$f3->exists('title')) {\n\t\t\t$f3->set('title', $f3->get('site'));\n\t\t}\n\t\t$f3->set('foot','footer.htm');\n\t\t/**\n\t\tif ($f3->get('ajax')) echo Template::instance()->render('layoutajax.htm');\n\t\telse **/\n\t\techo Template::instance()->render('layout.htm');\n\t\t/**\n\t\t$f3->set('SESSION.message','');\n\t\t$f3->set('SESSION.messagetype','');\t\n\t\t**/\n\t}", "function re_login() {\n header(\"Location: start.php\");\n die();\n }", "public function mainscreen()\r\n\t{\r\n\t\t$this->setRedirect( 'index.php?option=com_jblesta&controller=default' );\r\n\t\t$this->redirect();\r\n\t}", "function reEnterInput()\n{\n\t//go back to recipe features input \n\theader(\"Location: http://localhost/RecipeFish/view/addRecipeFeatures.php\"); \n\t\n\tunsetArrays();\n\t\n\texit(); \n}", "public static function reset()\n\t{\n\t\t// nothing by default\n\t}", "public function clear() {\n header( \"Location:\" . $this->url() );\n }", "function _endpage()\n\t\t{\n\t\t\t$this->state=1;\n\t\t}", "public function reassignDefaultViews()\n\t{\n\t\t\\Tlr\\Auth\\LoginController::$loginView = 'l4-cms::login';\n\t\t\\Tlr\\Auth\\PasswordResetController::$requestView = 'l4-cms::password.request';\n \t\t\\Tlr\\Auth\\PasswordResetController::$resetView = 'l4-cms::password.reset';\n\t\t\\Tlr\\Auth\\UsersController::$indexView = 'l4-cms::user.index';\n\t\t\\Tlr\\Auth\\UsersController::$editView = 'l4-cms::user.edit';\n\t\t\\Tlr\\Auth\\UsersController::$showUserView = 'l4-cms::user.show';\n\t\t\\Tlr\\Auth\\UsersController::$editProfileView = 'l4-cms::user.profile';\n\t}", "public function init() {\n $this->uri = ''; //En un futuro esto tomara pararemetros q vengan de GET\n session_start();\n //$this->generateFakeData();\n $this->validatePost();\n $this->requireView(); \n }", "function stopsimulate() {\n $this->auth(SUPPORT_ADM_LEVEL);\n $this->_stopsimulate();\n redirect('/mypage');\n }", "function index(){\n\t\tredirect('');\n\t}", "protected function setupPage() {}", "public static function resetDrupalGoto() {\n // Inside a function, global variable can only be unset by unsetting it from\n // $GLOBALS array.\n unset($GLOBALS['drupal_goto']);\n }", "public function resetSessionAndGoToHomepage()\n {\n $this->getSession()->reset();\n $this->visitPath('/');\n }", "private function finalizeOutput()\n\t{\n\t\tif ($this->isRedirect === true) {\n\t\t\t// this shouldn't appear, as redirect header would take care of it.\n\t\t\t// in case it's seen, reload link would help user to manually reload/redirect the page.\n\t\t\techo \"<a onclick='location.reload()'>click here to reload the page.</a>\";\n\t\t}\n\t}", "public function reset() {\n\t\t$this->userAgent = 'cURL Class by Kelly Becker';\n\t\t$this->cookieJar = '/tmp/cookies.txt';\n\t\t$this->postData = array();\n\t\t$this->saveFile = false;\n\t\t$this->opts = array();\n\t}", "public function resetAction()\n {\n // STAGE 3: Choose, create, and optionally update models using business logic.\n $registry = Zend_Registry::getInstance();\n $db = $registry['db'];\n // if the DB is not configured to handle \"large\" queries, then we need to feed it bite-size queries\n $filename = $registry['configDir'] . 'zfdemo.' . $registry['config']->db->type . '.sql';\n $statements = preg_split('/;\\n/', file_get_contents($filename, false));\n foreach ($statements as $blocks) {\n $sql = '';\n foreach (explode(\"\\n\", $blocks) as $line) {\n if (empty($line) || !strncmp($line, '--', 2)) {\n continue;\n }\n $sql .= $line . \"\\n\";\n }\n $sql = trim($sql);\n if (!empty($sql)) {\n $db->query($sql);\n }\n }\n // STAGE 4: Apply business logic to create a presentation model for the view.\n $this->view->filename = $filename;\n // STAGE 5: Choose view and submit presentation model to view.\n $this->renderToSegment('body');\n }", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset()\n {\n parent::reset();\n $this->_relayer->reset();\n $this->_forcedFaxNegotiator->reset();\n if ( isset( $this->_faxToneDetector ) ) {\n $this->_faxToneDetector->reset();\n }\n if ( isset( $this->_timer ) ) {\n $this->_timer->reset();\n }\n $this->_waitUpdateConfirmation = false;\n $this->_faxToneDetected = false;\n $this->_audioReinviteTimedOut = false;\n $this->_faxPages = array();\n $this->_stateManager->setState( self::STATE_READY );\n }", "public function reset() {\r\n $this->header = [];\r\n $this->cookie = [];\r\n $this->content = NULL;\r\n }", "public static function reset()\n\t{\n\t\tself::engine()->reset();\n\t}", "public function preExecute()\n {\n // store current URI incase we need to be redirected back to this page\n $request = $this->getRequest();\n if($request->getPathInfo() != '/getEbayResults')\n {\n $this->getUser()->setAttribute('lastPageUri', $request->getPathInfo());\n }\n }", "public function reset()\n {\n }", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "protected function tearDown(): void\n\t{\n\t\tLiquid::set('PAGINATION_REQUEST_KEY', self::$requestKeyDefault);\n\t\tLiquid::set('PAGINATION_CONTEXT_KEY', self::$contextKeyDefault);\n\t}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function init()\n {\n \n if(!isset($_SESSION[\"user_id\"]))\n $this->_redirect('index/login');\n }", "protected function assignDefaults() {\n\t\t$this->view->assignMultiple(\n\t\t\tarray(\n\t\t\t\t'timestamp'\t\t\t=> time(),\n\t\t\t\t'submission_date'\t=> date('d.m.Y H:i:s', time()),\n\t\t\t\t'randomId'\t\t\t=> Tx_Formhandler_Globals::$randomID,\n\t\t\t\t'fieldNamePrefix'\t=> Tx_Formhandler_Globals::$formValuesPrefix,\n\t\t\t\t'ip'\t\t\t\t=> t3lib_div::getIndpEnv('REMOTE_ADDR'),\n\t\t\t\t'pid'\t\t\t\t=> $GLOBALS['TSFE']->id,\n\t\t\t\t'currentStep'\t\t=> Tx_FormhandlerFluid_Util_Div::getSessionValue('currentStep'),\n\t\t\t\t'totalSteps'\t\t=> Tx_FormhandlerFluid_Util_Div::getSessionValue('totalSteps'),\n\t\t\t\t'lastStep'\t\t\t=> Tx_FormhandlerFluid_Util_Div::getSessionValue('lastStep'),\n\t\t\t\t// f:url(absolute:1) does not work correct :(\n\t\t\t\t'baseUrl'\t\t\t=> t3lib_div::locationHeaderUrl('')\n\t\t\t)\n\t\t);\n\t\t\n\t\tif ($this->gp['generated_authCode']) {\n\t\t\t$this->view->assign('authCode', $this->gp['generated_authCode']);\n\t\t}\n\t\t\n\t\t/*\n\t\tStepbar currently removed - probably this should move in a partial\n\t\t$markers['###step_bar###'] = $this->createStepBar(\n\t\t\tTx_FormhandlerFluid_Session::get('currentStep'),\n\t\t\tTx_FormhandlerFluid_Session::get('totalSteps'),\n\t\t\t$prevName,\n\t\t\t$nextName\n\t\t);\n\t\t*/\n\t\t\n\t\t/*\n\t\tNot yet realized\n\t\t$this->fillCaptchaMarkers($markers);\n\t\t$this->fillFEUserMarkers($markers);\n\t\t$this->fillFileMarkers($markers);\n\t\t*/\n\t}", "public static function resetFrontendEnvironment() {}", "private function resetInputFields(){\n $this->title = '';\n $this->body = '';\n $this->page_id = '';\n }", "public function preload()\n {\n if (Tools::getValue('controller') != ''\n && (Tools::getValue('controller') == 'Onehopsmsservice'\n || Tools::getValue('controller') == 'onehopsmsservice')) {\n $token = Tools::getAdminTokenLite('AdminModules');\n $request_scheme = $_SERVER['REQUEST_SCHEME'] ? $_SERVER['REQUEST_SCHEME'] : 'http';\n $hostlink = $request_scheme . \"://\" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'];\n $ctrlconfi = \"?controller=AdminModules&configure=\" . Tools::getValue('controller');\n $urlLink = $hostlink . $ctrlconfi .\"&token=\" . $token;\n Tools::redirect($urlLink);\n }\n }", "public function reinit()\n {\n }" ]
[ "0.64845276", "0.6483424", "0.64246833", "0.6315738", "0.60927916", "0.60681033", "0.6041967", "0.6027496", "0.60190004", "0.5991417", "0.5990712", "0.5990466", "0.59772646", "0.59317714", "0.5872228", "0.58643085", "0.5861632", "0.58525276", "0.584724", "0.5845523", "0.5808781", "0.5804993", "0.579719", "0.5786496", "0.57634795", "0.5748119", "0.5737303", "0.5736205", "0.5733962", "0.57260805", "0.5707095", "0.56934595", "0.56782204", "0.56586367", "0.5655714", "0.5650557", "0.5650395", "0.5647498", "0.56396073", "0.56387335", "0.56354195", "0.56316507", "0.5624343", "0.5617292", "0.5617232", "0.5617232", "0.56099546", "0.5602867", "0.5597951", "0.5591412", "0.5585473", "0.5581887", "0.5581867", "0.55781174", "0.55692834", "0.5562168", "0.5560302", "0.555894", "0.55579996", "0.5545225", "0.55374855", "0.552035", "0.5513621", "0.55101323", "0.5501322", "0.55012405", "0.549764", "0.54928136", "0.54928136", "0.54928136", "0.54928136", "0.54928136", "0.54928136", "0.54928136", "0.54928136", "0.54928136", "0.54928136", "0.54928136", "0.54928136", "0.5491602", "0.5491413", "0.5486944", "0.54828906", "0.5478577", "0.54761624", "0.54761624", "0.54761624", "0.54761624", "0.54761624", "0.54761624", "0.54761624", "0.5475147", "0.5474309", "0.5474309", "0.5474309", "0.54711264", "0.5470924", "0.5458242", "0.5456518", "0.54539084", "0.54503804" ]
0.0
-1
A safer version of PHP's gettext short version _
function __($str){ if(!empty($str)) return _($str); else return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static private function ___translate___()\n {\n _('RECORD\\Farthest %1$s from Sagittarius A*');\n }", "function _gettext($msgid)\r\n\t{\r\n\t\t$l10n = _get_reader();\r\n\t\treturn _encode($l10n->translate($msgid));\r\n\t}", "function __ngettext(...$args)\n {\n }", "function yourls__( $text, $domain = 'default' ) {\n\treturn yourls_translate( $text, $domain );\n}", "function jsngettext($msgid, $msgid_plural) {\n return LocalizationEngine::translate($msgid, $msgid_plural, \"\", null, array());\n}", "function __($string, array $values = NULL, $lang = 'en-us')\n{\n\treturn JText::_($string);\n}", "public function _($string /* ... */) {\r\n $args = func_get_args();\r\n array_shift($args);\r\n if (!empty($args) && count($args) == 1 && is_array($args[0])) {\r\n $args = $args[0];\r\n }\r\n return vsprintf(gettext($string), $args);\r\n }", "function _t($str/*[, mixed $args [, mixed $... ]]*/)\n{\n global $lc_lang;\n global $lc_translation;\n global $lc_translationEnabled;\n\n $args = func_get_args();\n $str = array_shift($args);\n $str = trim($str);\n\n if ($lc_translationEnabled == false) {\n return (count($args)) ? vsprintf($str, $args) : $str;\n }\n\n $po = session_get('po');\n if (!is_array($po)) {\n $po = array();\n }\n $po[$str] = '';\n\n if (isset($lc_translation[$lc_lang])) {\n # check with lowercase\n $lowerStr = strtolower($str);\n if (isset($lc_translation[$lc_lang][$lowerStr]) && !empty($lc_translation[$lc_lang][$lowerStr])) {\n $translated = $lc_translation[$lc_lang][$lowerStr];\n $str = (is_array($translated)) ? $translated[0] : $translated;\n }\n }\n\n if (isset($translated)) {\n $po[$str] = $translated;\n }\n return (count($args)) ? vsprintf($str, $args) : $str;\n}", "function _e($word) {\n echo __($word);\n}", "function t($message, $style, $resource_name, $line, $plural='', $count=1)\n\t{\n\t\tglobal $opt;\n\n\t\tif ($message == '')\n\t\t\treturn '';\n\n\t\tif ($plural != '' && $count!=1)\n\t\t\t$message = $plural;\n\t\t$search = $this->prepare_text($message);\n\n\t\t$trans = gettext($search);\n\t\t\n\t\t// safe w/o mb because asc(%) < 128\n\t\tif (strpos($trans, \"%\")>=0)\n\t\t\t$trans = $this->v($trans);\n\t\t\n\t\treturn $trans;\n\t}", "function dngettext($domain, $msgid1, $msgid2, $n) {\n }", "public function testUnderscoresTranslation()\n {\n $this->markTestIncomplete('MAGETWO-1012: i18n Improvements - Localization/Translations');\n }", "function _ngettext($singular, $plural, $number)\r\n\t{\r\n\t\t$l10n = _get_reader();\r\n\t\treturn _encode($l10n->ngettext($singular, $plural, $number));\r\n\t}", "function dcngettext($domain, $msgid1, $msgid2, $n, $category) {\n }", "function XO_( $str ) {\n\tglobal $xoops;\n\treturn $xoops->services['lang'] ? $xoops->services['lang']->translate( $str ) : $str;\t\n}", "function gettext($message) {\n global $faketext;\n \n return (!empty($faketext[$message]) ? $faketext[$message] : $message);\n }", "function yourls_esc_attr__( $text, $domain = 'default' ) {\n\treturn yourls_esc_attr( yourls_translate( $text, $domain ) );\n}", "function _dngettext($domain, $singular, $plural, $number)\r\n\t{\r\n\t\t$l10n = _get_reader($domain);\r\n\t\treturn _encode($l10n->ngettext($singular, $plural, $number));\r\n\t}", "function _npgettext($context, $singular, $plural)\r\n\t{\r\n\t\t$l10n = _get_reader();\r\n\t\treturn _encode($l10n->npgettext($context, $singular, $plural));\r\n\t}", "function _pgettext($context, $msgid)\r\n\t{\r\n\t\t$l10n = _get_reader();\r\n\t\treturn _encode($l10n->pgettext($context, $msgid));\r\n\t}", "function ngettext($msgid, $msgid_plural, $n) {\n $sprintf_args = array_slice(func_get_args(), 2);\n return LocalizationEngine::translate($msgid, $msgid_plural, \"\", $n, $sprintf_args);\n}", "function dgettext($domain, $message) {\n }", "function _dnpgettext($domain, $context, $singular, $plural)\r\n\t{\r\n\t\t$l10n = _get_reader($domain);\r\n\t\treturn _encode($l10n->npgettext($context, $singular, $plural));\r\n\t}", "function __ngettext_noop(...$args)\n {\n }", "function yourls_esc_html__( $text, $domain = 'default' ) {\n\treturn yourls_esc_html( yourls_translate( $text, $domain ) );\n}", "function _dpgettext($domain, $context, $msgid)\r\n\t{\r\n\t\t$l10n = _get_reader($domain);\r\n\t\treturn _encode($l10n->pgettext($context, $msgid));\r\n\t}", "public function _strings_for_pot() {\n\t\t/* translators: Localized date format, see https://www.php.net/date */\n\t\t__( 'F j, Y' );\n\t\t/* translators: Localized time format, see https://www.php.net/date */\n\t\t__( 'g:i a' );\n\t\t/* translators: Localized date and time format, see https://www.php.net/date */\n\t\t__( 'F j, Y g:i a' );\n\t}", "function _($string, $jsSafe = false)\n\t{\n\t\t$lang =& JFactory::getLanguage();\n\t\treturn $lang->_($string, $jsSafe);\n\t}", "function ngettext($single, $plural, $number) {\n if ($this->error > 0) {\n $result=-1;\n } else {\n // find out the appropriate form\n $select = $this->select_string($number);\n\n // this should contains all strings separated by NULLs\n $result = $this->find_string($single.chr(0).$plural,0,$this->total);\n }\n if ($result == -1) {\n if ($number != 1) return $plural;\n else return $single;\n } else {\n $result = $this->get_translation_number($result);\n\n // lets try to parse all the NUL staff\n //$result = \"proba0\".chr(0).\"proba1\".chr(0).\"proba2\";\n $list = explode (chr(0), $result);\n return $list[$select];\n }\n }", "function nuText($str)\n{\n return str_replace(\"'\", \"\\\\'\", JText::_($str));\n}", "function dcgettext($domain, $message, $category) {\n }", "function _dgettext($domain, $msgid)\r\n\t{\r\n\t\t$l10n = _get_reader($domain);\r\n\t\treturn _encode($l10n->translate($msgid));\r\n\t}", "public function underscoreLocale()\n {\n return str_replace('-', '_', $this->locale);\n }", "function p__(string $context, string $original, ...$args): string\n {\n $text = Translator::getTranslator()->pgettext($context, $original);\n return Translator::getFormatter()->format($text, $args);\n }", "function _dcpgettext($domain, $context, $msgid, $category)\r\n\t{\r\n\t\t$l10n = _get_reader($domain, $category);\r\n\t\treturn _encode($l10n->pgettext($context, $msgid));\r\n\t}", "function _t($string,$alt=null){\n\t$r=CLang::translate($string,'a');\n\treturn $r!==false ? $r : ($alt===null?$string:$alt);\n}", "function __(string $original, ...$args): string\n {\n $text = Translator::getTranslator()->gettext($original);\n return Translator::getFormatter()->format($text, $args);\n }", "function np__(string $context, string $original, string $plural, int $value, ...$args): string\n {\n $text = Translator::getTranslator()->npgettext($context, $original, $plural, $value);\n return Translator::getFormatter()->format($text, $args);\n }", "static function wrap($original) {\n if (!function_exists('gettext')) return sprintf('<!--l10n-->%1$s', $original);\n return sprintf('<!--l10n-->%1$s', gettext($original));\n }", "function _dcngettext($domain, $singular, $plural, $number, $category)\r\n\t{\r\n\t\t$l10n = _get_reader($domain, $category);\r\n\t\treturn _encode($l10n->ngettext($singular, $plural, $number));\r\n\t}", "private function translationWorkaround()\n {\n L10n::__('BudgetMailer Sign Up Form for WordPress');\n L10n::__('BudgetMailer Sign Up');\n }", "function yourls_e( $text, $domain = 'default' ) {\n\techo yourls_translate( $text, $domain );\n}", "function __($key) {\n\t$translate = Zend_Registry::get('Zend_Translate');\n\treturn $translate->translate($key);\n}", "function ngettext($string1, $string2, $n) {\n\t\treturn ($n == 1) ? $string1 : $string2;\n\t}", "function _dcnpgettext($domain, $context, $singular, $plural, $category)\r\n\t{\r\n\t\t$l10n = _get_reader($domain, $category);\r\n\t\treturn _encode($l10n->npgettext($context, $singular, $plural));\r\n\t}", "function n__(string $original, string $plural, int $value, ...$args): string\n {\n $text = Translator::getTranslator()->ngettext($original, $plural, $value);\n return Translator::getFormatter()->format($text, $args);\n }", "function _dcgettext($domain, $msgid, $category)\r\n\t{\r\n\t\t$l10n = _get_reader($domain, $category);\r\n\t\treturn _encode($l10n->translate($msgid));\r\n\t}", "function __($text)\n{\n $sys = getSysInfo();\n $lang = $sys[\"lang\"];\n //set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'].getPathFromDocRoot().'locales'.FILE_SEPARATOR.$lang);\n if ($lang == \"\") {\n //do nothing\n return $text;\n } else {\n require_once('locales'.FILE_SEPARATOR.$lang.FILE_SEPARATOR.$lang.'.php');\n //$translation = getTranslation($text);\n $translation = call_user_func('getTranslation_'.$lang, $text);\n if ($translation == \"\") {\n return $text;\n //maybe send an error email to admin?\n } else {\n return $translation;\n }\n }\n}", "public function _(string $translateKey, array $placeholders = []): string\n {\n return $this->t($translateKey, $placeholders);\n }", "function __($string, $domain = null)\n {\n if (!empty($domain)) {\n return dgettext($domain, $string);\n } else {\n return _($string);\n }\n }", "public function localize($key) {\n\t\tif (!isset($this->_phrases[strtoupper($key)])) return $key;\n\n\t\t$match = $this->_phrases[strtoupper($key)];\n\n\t\tif (func_num_args() == 1) return $match;\n\n\t\t$args = func_get_args();\n\t\t$args[0] = $match;\n\n\t\treturn call_user_func_array('sprintf', $args);\n\t}", "function underscore($str) {\n return preg_replace('/[\\s]+/', '_', trim(extension_loaded('mbstring') ? mb_strtolower($str) : strtolower($str)));\n}", "function npgettext($context, $msgId, $msgIdPlural, $num) {\n\t$contextString = $context.\"\\004\".$msgId;\n\t$contextStringp = $context.\"\\004\".$msgIdPlural;\n\t$translation = ngettext($contextString, $contextStringp, $num);\n\n\treturn ($translation == $contextString || $translation == $contextStringp) ? $msgId : $translation;\n}", "static protected function translate($s){\nif(!self::$strings)return $s;\nif(!array_key_exists($s,self::$strings))return $s;\nreturn self::$strings[$s];\n}", "function dgettext($domain, $messageid)\n\t{\n\t\treturn $messageid;\n\t}", "protected function t($key)\n {\n return static::translate($this->lang, $key);\n }", "function installer_t($msg) {\n\t\treturn $msg;\n\t}", "function pgettext($context, $msgId) {\n\t$contextString = $context.\"\\004\".$msgId;\n\t$translation = _($contextString);\n\n\treturn ($translation == $contextString) ? $msgId : $translation;\n}", "function WFLocalizedString($sKey) {\n\treturn WFBundle::mainBundle()->localizedStringForKey($sKey);\n}", "public static function _($text) {\n\t\treturn $text;\n\t}", "function admin_l10n($l10n)\n {\n }", "private function zarinpalTranslate($key)\n {\n // key format: ex. payment_error for payment error\n $key = 'PLG_K2STORE_PAYMENTS_ZARINPALWG_' . strtoupper($key);\n return JText::_($key);\n }", "public function __get($key)\n\t{\n\t\treturn t($key);\n\t}", "function bbloomer_translate_may_also_like() {\n\t $translated = esc_html__( 'Customers also purchased... ');\n\t return $translated;\n\t}", "function __t(?string $key = null, ?string $default = null, array $replace = [], ?string $locale = null)\n {\n if (Lang::has($key, $locale)) {\n return __($key, $replace, $locale);\n }\n if ($default) {\n if (Str::contains($default, [' ', '.', ':'])) {\n return __($default, $replace, $locale);\n }\n // is probably single word\n return $default;\n }\n return $key;\n }", "public function vbTranslate(string $text): string\n {\n // TODO: use translator!\n return __($text, 'vb-wp-plugin-core');\n }", "function __($text) {\n\treturn $text;\n}", "public function _($text) {\n\t\treturn __($text, $this->wire('config')->paths->root . 'wire/templates-admin/default.php'); \n\t}", "function dngettext($domain, $messageid1, $messageid2, $n)\n\t{\n\t\tif ($n == 1)\n\t\t\treturn $messageid1;\n\n\t\treturn $messageid2;\n\t}", "function make_fieldname_text($fieldname) {\n\t$fieldname=str_replace(\"_\", \" \",$fieldname);\n\t$fieldname=ucfirst($fieldname);\n\treturn $fieldname;\t\t\n}", "function _T(/*$arg1, $arg2...$argN*/) {\n\tglobal $language,$langloaded;\n\tif (!$langloaded){ // language file is not loaded\n\t\tLoadLanguage(PIXMICAT_LANGUAGE); $langloaded = true;\n\t}\n\tif (!func_num_args()) // called with no arg\n\t\treturn '';\n\t$arg_list = func_get_args();\n\t$arg_list[0] = isset($language[$arg_list[0]]) ? $language[$arg_list[0]] : $arg_list[0];\n\treturn call_user_func_array('sprintf',$arg_list);\n}", "public function __($string, $plural_string, $number /* ... */) {\r\n $args = func_get_args();\r\n unset($args[0], $args[1]);\r\n if (isset($args[3]) && count($args) == 2 && is_array($args[3])) {\r\n $args = $args[3];\r\n }\r\n return vsprintf(ngettext($string, $plural_string, $number), $args);\r\n }", "public function getAlias()\n {\n return 'lsw_gettext_translation';\n }", "function dp__(string $domain, string $context, string $original, ...$args): string\n {\n $text = Translator::getTranslator()->dpgettext($domain, $context, $original);\n return Translator::getFormatter()->format($text, $args);\n }", "function tf($string){\n\t$args=func_get_args();\n\t$r=CLang::translate(array_shift($args),'a');\n\treturn vsprintf($r!==false ? $r : $string,$args);\n}", "function input_admin_l10n($l10n)\n {\n }", "function truc(string $arg):string{\n return $arg . ' yo <br/>';\n }", "function freeproduct_textdomain() {\n\tload_plugin_textdomain( 'woocommerce-freeproduct', false, basename( dirname( __FILE__ ) ) . '/lang' );\n}", "public function _strings_for_pot()\n {\n }", "function yourls_esc_attr_e( $text, $domain = 'default' ) {\n\techo yourls_esc_attr( yourls_translate( $text, $domain ) );\n}", "function __($msgId, $msgArgs= NULL) {\n\tif (null == $GLOBALS['__cachedLocaleComponent']) {\n\t\t$GLOBALS['__cachedLocaleComponent']= classRegistry :: getObject('LocaleComponent');\n\t}\n\treturn $GLOBALS['__cachedLocaleComponent']->getString($msgId, $msgArgs);\n}", "function _textdomain($domain)\r\n\t{\r\n\t\tglobal $default_domain;\r\n\t\t$default_domain = $domain;\r\n\t}", "function _tC($string){\n\t$r=CLangCore::translate($string);\n\treturn $r!==null ? $r : $string;\n}", "function l(){\n\tglobal $_LOCALE;\n\t\n\t$entry = $_LOCALE;\n\t$args = func_get_args();\n\t\n\tfor($i = 0; $i < count($args); $i++){\n\t\t$key = $args[$i];\n\t\tif ( array_key_exists($key, $entry) ) {\n\t\t\t$entry = $entry[$key];\n\t\t\tif ( ! is_array($entry) )\n\t\t\t\tbreak;\n\t\t} else {\n\t\t\t$entry = 'Missing entry in language file: ' . join(' → ', array_slice($args, 0, $i + 1));\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t$format_args = array_slice($args, $i + 1);\n\treturn (is_string($entry) and count($format_args) > 0) ? vsprintf($entry, $format_args) : $entry;\n}", "protected function translate($key) {\n\t\treturn $this->_viewHelper->translate($key);\n\t}", "function localize($phrase) {\n global $translations;\n /* Static keyword is used to ensure the file is loaded only once */\n if ($translations[$phrase])\n return $translations[$phrase];\n else\n return $phrase;\n}", "function dnp__(string $domain, string $context, string $original, string $plural, int $value, ...$args): string\n {\n $text = Translator::getTranslator()->dnpgettext($domain, $context, $original, $plural, $value);\n return Translator::getFormatter()->format($text, $args);\n }", "function str_underscore($str)\n{\n return strtolower(preg_replace('/(?<=\\\\w)([A-Z]+)/', '_\\\\1', $str));\n}", "function yourls_esc_html_e( $text, $domain = 'default' ) {\n\techo yourls_esc_html( yourls_translate( $text, $domain ) );\n}", "function hybrid_ngettext( $translated, $single, $plural, $number, $domain ) {\n\n\t/* Check if 'hybrid-core' is the current textdomain, there's no mofile for it, and the theme has a mofile. */\n\tif ( 'hybrid-core' == $domain && !hybrid_is_textdomain_loaded( 'hybrid-core' ) && hybrid_is_textdomain_loaded( hybrid_get_parent_textdomain() ) )\n\t\t$translated = hybrid_translate_plural( hybrid_get_parent_textdomain(), $single, $plural, $number );\n\n\treturn $translated;\n}", "function ngettext($msgid1, $msgid2, $n) {\n global $faketext;\n \n if ($n == 1) {\n return (!empty($faketext[$msgid1][0]) ? $faketext[$msgid1][0] : $msgid1);\n }\n else {\n return (!empty($faketext[$msgid1][1]) ? $faketext[$msgid1][1] : $msgid1);\n }\n }", "function customPageTitle($string) {\n return sprintf(__('Add language &raquo; %s'), $string);\n}", "function tb_string_swap_textdomain() {\n\tload_plugin_textdomain('theme-blvd-string-swap');\n}", "function mbifthen_load_textdomain() {\r\n\tload_plugin_textdomain( 'multibanco-ifthen-software-gateway-for-woocommerce', false, dirname( plugin_basename( __FILE__ ) ).'/lang/' );\r\n}", "protected function translate($key) {\n\t\treturn LocalizationUtility::translate(static::languageFile . static::languageKeyPrefix . $key);\n\t}", "public function ngetText($single, $plural, $number)\n\t{\n\t\t//Todo: Check if gettext module is installed, if not then emulate it.\n\t\tif (false)\n\t\t{\n\t\t\treturn $this->php_ngetText($single, $plural, $number);\n\t\t}\n\n\t\treturn sprintf( ngettext($single, $plural, $number), $number );\n\t}", "function customPageTitle($string) {\n return sprintf(__('Import &raquo; %s'), $string);\n}", "function __($text, $replace = array(), $lng = '') {\n\tglobal $_website_langs, $_lang, $_config;\n\t\n\tif($_config['server']['memcache'] || $_config['server']['file_cache']){\n\t\t$string = cache_get('lng_var_'.($lng != '' ? $lng : $_lang).'_'.md5($text));\n\t}else{\n\t\t$string = '';\n\t}\n\t\n\tif(!$string){\n\t\t$lng_keys = array_keys($_website_langs);\n\t\tif($lng != '' && !in_array($lng, $lng_keys)){\n\t\t\t$string = $text;\n\t\t}else{\n\t\t\tif(db_table_exists('admin_translation')){\n\t\t\t\t$translate = db_row('SELECT * FROM admin_translation WHERE title = ? OR title = ? LIMIT 1', generate_name($text), md5($text));\n\t\t\n\t\t\t\tif(!$translate){\n\t\t\t\t\t$id_translate = db_query(\"INSERT INTO admin_translation (`title`, `created`) VALUES (?, NOW())\", md5($text));\n\t\t\t\t\tforeach($lng_keys as $key){\n\t\t\t\t\t\tdb_query(\"UPDATE admin_translation SET `\".$key.\"` = ? WHERE id_admin_translation = ?\", $text, $id_translate);\n\t\t\t\t\t}\n\t\t\t\t\t$string = $text;\n\t\t\t\t}else{\n\t\t\t\t\tif($lng != '' && $translate[$lng] != ''){\n\t\t\t\t\t\t$string = $translate[$lng];\n\t\t\t\t\t}elseif($translate[$_lang] != ''){\n\t\t\t\t\t\t$string = $translate[$_lang];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$string = $text;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$string = $text;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif($_config['server']['memcache'] || $_config['server']['file_cache']){\n\t\tcache_set('lng_var_'.($lng != '' ? $lng : $_lang).'_'.md5($text), $string, $_config['server']['memcache_time']);\n\t}\n\t\n\tforeach($replace as $k => $v) {\n\t\t$string = str_replace('['.$k.']', $v, $string);\n\t}\n\n\treturn $string;\n}", "function lang_parse($key, $args)\n{\n\tglobal $lang;\n\t\n\t// Make sure the key is uppercase\n\t$key = strtoupper($key);\n\t\n\t// Does that key exist?\n\tif(!$lang[$key])\n\t{\n\t\t// So we know it needs to be translated.\n\t\treturn '{' . $key . '}';\n\t}\n\telse\n\t{\n\t\treturn mb_vsprintf($lang[$key], $args, $lang['ENCODING']);\n\t}\n}", "function sanitize_locale_name($locale_name)\n {\n }" ]
[ "0.72410583", "0.7181865", "0.6913392", "0.6895244", "0.68586034", "0.6835791", "0.68301386", "0.67661107", "0.67253363", "0.6609394", "0.65802777", "0.65289336", "0.65047526", "0.6451118", "0.64398694", "0.6407258", "0.63952994", "0.63765043", "0.6365491", "0.6327929", "0.6317764", "0.63128096", "0.62821126", "0.62731844", "0.6272486", "0.62691504", "0.62616056", "0.6231732", "0.62178254", "0.61955696", "0.61933213", "0.61709845", "0.615966", "0.6150675", "0.6128671", "0.6119289", "0.6110614", "0.6094604", "0.60898376", "0.6081833", "0.6074118", "0.6045098", "0.6041498", "0.6031084", "0.60065156", "0.60041064", "0.59844786", "0.5949491", "0.5936539", "0.59331065", "0.593229", "0.5915557", "0.59132934", "0.58661336", "0.5852117", "0.58449894", "0.58409417", "0.58294386", "0.58240134", "0.58186847", "0.58156645", "0.5752881", "0.5740261", "0.57263434", "0.57248884", "0.5721167", "0.5718112", "0.57072777", "0.5701256", "0.5700173", "0.5698001", "0.5680805", "0.5678584", "0.5676061", "0.5666283", "0.5658084", "0.56537104", "0.5647646", "0.5634189", "0.56044114", "0.56026155", "0.56009907", "0.5585", "0.5583615", "0.5574414", "0.55714697", "0.5543395", "0.55399656", "0.55353516", "0.55300957", "0.55251116", "0.5500761", "0.54997265", "0.5493446", "0.5489703", "0.54858524", "0.54818624", "0.5481494", "0.5473488", "0.5468304" ]
0.5851726
55
runkit_function_redefine('_', '$str', 'return (!empty($str) ? gettext($str) : "";'); Uses the pear Text_Diff library to generate a diff between two files. The only HTMLtags allowed are and , all other will be stripped.
function diff($text1, $text2) { __autoload('TextDiff'); include_once 'Text/Diff.php'; include_once 'Text/Diff/Renderer.php'; include_once 'Text/Diff/Renderer/unified.php'; $vtext1 = chunk_split(strip_tags($text1, '<p><div>'), 1, "\n"); $vtext2 = chunk_split(strip_tags($text2, '<p><div>'), 1, "\n"); $vlines1 = str_split($vtext1, 2); $vlines2 = str_split($vtext2, 2); $text1 = str_replace("\n"," \n",$text1); $text2 = str_replace("\n"," \n",$text2); $vlines1 = explode(" ", $text1); $vlines2 = explode(" ", $text2); $diff = new Text_Diff($vlines1, $vlines2); $renderer = new Text_Diff_Renderer_inline(); $html = html_entity_decode($renderer->render($diff)); return preg_replace(array('#(<ins>|<del>)(<[^\>]+>)#i', '#(</[^\>]+>)(</ins>|</del>)#i'), '$2$1', $html); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function text_diff( $left_string, $right_string, $args = null ) {\n\t\t$defaults = array(\n\t\t\t'title' => '',\n\t\t\t'title_left' => '',\n\t\t\t'title_right' => '',\n\t\t\t'leading_context_lines' => 1,\n\t\t\t'trailing_context_lines' => 1,\n\t\t);\n\n\t\t$args = wp_parse_args( $args, $defaults );\n\n\t\tif ( ! class_exists( 'WP_Text_Diff_Renderer_Table' ) ) {\n\t\t\trequire ABSPATH . WPINC . '/wp-diff.php';\n\t\t}\n\n\t\t$left_string = normalize_whitespace( $left_string );\n\t\t$right_string = normalize_whitespace( $right_string );\n\n\t\t$left_lines = explode( \"\\n\", $left_string );\n\t\t$right_lines = explode( \"\\n\", $right_string );\n\t\t$text_diff = new \\Text_Diff( $left_lines, $right_lines );\n\n\t\t$renderer = new \\WP_Text_Diff_Renderer_Table( $args );\n\t\t$renderer->_leading_context_lines = $args['leading_context_lines'];\n\t\t$renderer->_trailing_context_lines = $args['trailing_context_lines'];\n\n\t\t$diff = $renderer->render( $text_diff );\n\n\t\tif ( $diff === '' ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$r = '';\n\n\t\t$r .= \"<div class='SimpleHistory__diff__contents' tabindex='0'>\";\n\t\t$r .= \"<div class='SimpleHistory__diff__contentsInner'>\";\n\n\t\t$r .= \"<table class='diff SimpleHistory__diff'>\\n\";\n\n\t\tif ( ! empty( $args['show_split_view'] ) ) {\n\t\t\t$r .=\n\t\t\t\"<col class='content diffsplit left' /><col class='content diffsplit middle' /><col class='content diffsplit right' />\";\n\t\t} else {\n\t\t\t$r .= \"<col class='content' />\";\n\t\t}\n\n\t\tif ( $args['title'] || $args['title_left'] || $args['title_right'] ) {\n\t\t\t$r .= '<thead>';\n\t\t}\n\t\tif ( $args['title'] ) {\n\t\t\t$r .= \"<tr class='diff-title'><th colspan='4'>$args[title]</th></tr>\\n\";\n\t\t}\n\t\tif ( $args['title_left'] || $args['title_right'] ) {\n\t\t\t$r .= \"<tr class='diff-sub-title'>\\n\";\n\t\t\t$r .= \"\\t<td></td><th>$args[title_left]</th>\\n\";\n\t\t\t$r .= \"\\t<td></td><th>$args[title_right]</th>\\n\";\n\t\t\t$r .= \"</tr>\\n\";\n\t\t}\n\t\tif ( $args['title'] || $args['title_left'] || $args['title_right'] ) {\n\t\t\t$r .= \"</thead>\\n\";\n\t\t}\n\n\t\t$r .= \"<tbody>\\n$diff</div>\\n</tbody>\\n\";\n\t\t$r .= '</table>';\n\n\t\t$r .= '</div>';\n\t\t$r .= '</div>';\n\n\t\treturn $r;\n\t}", "function action_diff()\n{\n\tglobal $pagestore, $page, $ver1, $ver2, $ParseEngine;\n\n\t$p1 = $pagestore->page($page);\n\t$p1->version = $ver1;\n\t$p2 = $pagestore->page($page);\n\t$p2->version = $ver2;\n\n\t$diff = diff_compute($p1->read(), $p2->read());\n\n\ttemplate_diff(array('page' => $p2->as_array(),\n\t\t\t\t\t\t\t\t\t\t\t'diff_html' => diff_parse($diff),\n\t\t\t\t\t\t\t\t\t\t\t'html' => parseText($p2->text, $ParseEngine, $page),\n\t\t\t\t\t\t\t\t\t\t\t'editable' => $p2->acl_check(),\n\t\t\t\t\t\t\t\t\t\t\t'timestamp' => $p2->time));\n}", "function getRevisiondifference($from_text, $to_text)\n{\n // limit input\n if (!empty($from_text) && is_string($from_text)) {\n $from_text = substr($from_text, 0, 1024 * 100);\n } else {\n return false;\n }\n if (!empty($to_text) && is_string($to_text)) {\n $to_text = substr($to_text, 0, 1024 * 100);\n } else {\n return false;\n }\n $granularity = 2; // 0: Paragraph/lines, 1: Sentence, 2: Word, 3: Character\n $granularityStacks = array(\n FineDiff::$paragraphGranularity,\n FineDiff::$sentenceGranularity,\n FineDiff::$wordGranularity,\n FineDiff::$characterGranularity\n );\n $diff_opcodes = FineDiff::getDiffOpcodes($from_text, $to_text, $granularityStacks[$granularity]);\n $difference = FineDiff::renderDiffToHTMLFromOpcodes($from_text, $diff_opcodes);\n return $difference;\n}", "public static function show_diff() {\r\n\t\tcheck_admin_referer('plugin-name-action_wpidenonce'); \r\n\t\tif ( !is_super_admin() )\r\n\t\t\twp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');\r\n\t\t\r\n error_reporting(E_ALL);\r\n ini_set(\"display_errors\", 1);\r\n \r\n require_once('git/autoload.php.dist');\r\n //use TQ\\Git\\Cli\\Binary;\r\n //use TQ\\Git\\Repository\\Repository;\r\n \r\n $root = apply_filters( 'wpide_filesystem_root', WP_CONTENT_DIR ) . \"/\"; \r\n \r\n //check repo path entered or die\r\n if ( !strlen($_POST['gitpath']) ) \r\n die(\"Error: Path to your git repository is required!\");\r\n \r\n \r\n $repo_path = $root . sanitize_text_field( $_POST['gitpath'] );\r\n $gitbinary = sanitize_text_field( stripslashes($_POST['gitbinary']) );\r\n \r\n if ( $gitbinary===\"I'll guess..\" ){ //the binary path\r\n \r\n $thebinary = TQ\\Git\\Cli\\Binary::locateBinary();\r\n $git = TQ\\Git\\Repository\\Repository::open($repo_path, new TQ\\Git\\Cli\\Binary( $thebinary ) );\r\n \r\n }else{\r\n \r\n $git = TQ\\Git\\Repository\\Repository::open($repo_path, new TQ\\Git\\Cli\\Binary( $_POST['gitbinary'] ) );\r\n \r\n }\r\n \r\n $file = sanitize_text_field( base64_decode( $_POST['file']) );\r\n \r\n //generate a diff using the built in WordPress code\r\n $args = array(\r\n 'title' => 'Differences',\r\n 'title_left' => 'Old Version',\r\n \t'title_right' => 'New Version'\r\n );\r\n \r\n $contents = file_get_contents($repo_path . \"/\" . $file); //the git library isn't using the WP filesystem API so should we here? should we fullstop?\r\n $contents2 = $git->showFile( $file, 'HEAD@{1}');\r\n \r\n $diff_table = wp_text_diff($contents2, $contents, $args); \r\n echo \"<strong>Diff</strong>\" . $diff_table;\r\n\r\n \r\n\t\tdie(); // this is required to return a proper result\r\n\t}", "function diff2( $page1, $page2 ) {\n\t\t$page1 = split( \"\\n\", $page1 );\n\t\t$page2 = split( \"\\n\", $page2 );\n\t\t$z = new WikiDiff( $page1, $page2 );\n\t\tif( $z->isEmpty() ) {\n\t\t\t$html = '<hr /><br />['.tra(\"Versions are identical\").']<br /><br />';\n\t\t} else {\n\t\t\t//$fmt = new WikiDiffFormatter;\n\t\t\t$fmt = new WikiUnifiedDiffFormatter;\n\t\t\t$html = $fmt->format( $z, $page1 );\n\t\t}\n\t\treturn $html;\n\t}", "function vB_Text_Diff($data_old, $data_new)\n\t{\n\t\t$this->data_old = preg_split('#(\\r\\n|\\n|\\r)#', $data_old);\n\t\t$this->data_old_len = sizeof($this->data_old);\n\n\t\t$this->data_new = preg_split('#(\\r\\n|\\n|\\r)#', $data_new);\n\t\t$this->data_new_len = sizeof($this->data_new);\n\t}", "function process_nonmatches(&$output, &$text_old, &$text_new)\n\t{\n\t\t$s1 = sizeof($text_old);\n\t\t$s2 = sizeof($text_new);\n\n\t\tif ($s1 > 0 AND $s2 == 0)\n\t\t{\n\t\t\t// lines deleted\n\t\t\tarray_unshift($output, new vB_Text_Diff_Entry(implode(\"\\n\", $text_old), ''));\n\t\t}\n\t\telse if ($s2 > 0 AND $s1 == 0)\n\t\t{\n\t\t\t// lines added\n\t\t\tarray_unshift($output, new vB_Text_Diff_Entry('', implode(\"\\n\", $text_new)));\n\t\t}\n\t\telse if ($s1 > 0 AND $s2 > 0)\n\t\t{\n\t\t\t// substitution\n\t\t\tarray_unshift($output, new vB_Text_Diff_Entry(implode(\"\\n\", $text_old), implode(\"\\n\", $text_new)));\n\t\t}\n\n\t\t$text_old = array();\n\t\t$text_new = array();\n\t}", "public function getDiffHtml($a, $b)\n\t{\n\t\tpreg_match_all(\"/(<.*?>\\\\s*|\\\\s+)([^\\\\s<]*)/\", \" \".$a, $matchA);\n\t\tpreg_match_all(\"/(<.*?>\\\\s*|\\\\s+)([^\\\\s<]*)/\", \" \".$b, $matchB);\n\n\t\t$diffScript = $this->getDiffScript($matchA[2], $matchB[2]);\n\t\tif(count($diffScript) == 0)\n\t\t{\n\t\t\t// no difference found\n\t\t\treturn $a;\n\t\t}\n\n\t\t$positionA = 0;\n\n\t\t$result = '';\n\t\tforeach($diffScript as $diffItem)\n\t\t{\n\t\t\twhile($positionA < $diffItem['startA'])\n\t\t\t{\n\t\t\t\t$result .= $matchA[0][$positionA];\n\t\t\t\t$positionA++;\n\t\t\t}\n\n\t\t\t//deleted items\n\t\t\tif($diffItem['deletedA'] > 0)\n\t\t\t{\n\t\t\t\t$result .= $matchA[1][$positionA] . '<s style=\"color:red\">' . $matchA[2][$positionA];\n\t\t\t\tfor($i = 1; $i < $diffItem['deletedA']; $i++)\n\t\t\t\t\t$result .= $matchA[0][$positionA + $i];\n\n\t\t\t\t$result .= '</s>';\n\t\t\t\t$positionA = $positionA + $diffItem['deletedA'];\n\t\t\t}\n\n\t\t\tif($diffItem['insertedB'] > 0)\n\t\t\t{\n\t\t\t\t$result .= $matchB[1][$diffItem['startB']] . '<b style=\"color:green\">' . $matchB[2][$diffItem['startB']];\n\t\t\t\tfor($i = 1; $i < $diffItem['insertedB']; $i++)\n\t\t\t\t\t$result .= $matchB[0][$diffItem['startB'] + $i];\n\n\t\t\t\t$result .= '</b>';\n\t\t\t}\n\t\t}\n\n\t\twhile($positionA < count($matchA[0]))\n\t\t{\n\t\t\t$result .= $matchA[0][$positionA];\n\t\t\t$positionA++;\n\t\t}\n\n\t\treturn $result;\n\t}", "private function addUnchangedText( $text ) {\n\t\t$collapsedText = $this->getCollapsedText( $text );\n\n\t\tif ( !$collapsedText ) {\n\t\t\treturn $text;\n\t\t}\n\n\t\treturn\n\t\t\t'<div class=\"mw-twocolconflict-diffchange-same-full\">' . $text . '</div>' .\n\t\t\t'<div class=\"mw-twocolconflict-diffchange-same-collapsed\">' . $collapsedText . '</div>';\n\t}", "function skin_diff_export_overview( $content, $missing, $changed, $title, $date ) {\n\n$IPBHTML = \"\";\n//--starthtml--//\n\n$IPBHTML .= <<<EOF\n<html>\n <head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset={$this->ipsclass->vars['gb_char_set']}\" />\n <title>$title export</title>\n <style type=\"text/css\">\n BODY\n {\n \tfont-family: verdana;\n \tfont-size:11px;\n \tcolor: #000;\n \tbackground-color: #CCC;\n }\n\n del,\n .diffred\n {\n\t background-color: #D7BBC8;\n\t text-decoration:none;\n }\n\n ins,\n .diffgreen\n {\n\t background-color: #BBD0C8;\n\t text-decoration:none;\n }\n\n h1\n {\n \tfont-size: 18px;\n }\n\n h2\n {\n \tfont-size: 18px;\n }\n </style>\n </head>\n<body>\n <div style='padding:4px;border:1px solid #000;background-color:#FFF;margin:4px;'>\n <h1>$title (экспортировано: $date)</h1>\n <strong>$missing новых шаблонов и $changed измененных</strong>\n </div>\n <br />\n $content\n <br />\n <div style='padding:4px;border:1px solid #000;background-color:#FFF;margin:4px;'>\n <span class='diffred'>Удален HTML код</span> &middot; <span class='diffgreen'>Добавлен HTML код</span>\n </div>\n</body>\n<html>\nEOF;\n\n//--endhtml--//\nreturn $IPBHTML;\n}", "function replaceTargetedStrings($data){\r\n\tglobal $logfile;\r\n\r\n\t//$blort = \"\\nreplaceTargetedStrings( '\" . $data . \"') \\n\";\r\n\r\n\t$data = str_replace(\"\\t\", \"\", $data);\r\n\t$data = str_replace(\" \", \"\", $data);\r\n\t$data = str_replace(\" \", \"\", $data);\r\n\t$data = str_replace(\" \", \"\", $data);\r\n\r\n/*\r\n\t\t//MarcEdit will choke on the < and > so we'd just have to replace them again anyway\r\n\t$data = str_replace(\"&lt;\", \"<\", $data);\r\n\t$data = str_replace(\"&gt;\", \">\", $data);\r\n*/\r\n\r\n\t$data = str_replace('\" content=\"', ' = ', $data);\r\n\t/*\r\n\t\t$blort .= \"\\nnow data ='\" . $data . \"'\\t\";\r\n\t\t$junkRep = str_replace(\"&lt;\", \"<\", $data);\r\n\t\t$blort .= \"if we do a replace it looks like '\" . $junkRep . \"'\\n\";\r\n\t\tappendFile($logfile, $blort);\r\n\t*/\r\n\r\n\treturn $data;\r\n}", "private function getMarkedUpDiffText( array $unifiedDiff ) {\n\t\t$lastUser = $this->getArticle()->getPage()->getUserText();\n\n\t\t$output = '';\n\t\tforeach ( $unifiedDiff as $key => $currentLine ) {\n\t\t\tforeach ( $currentLine as $changeSet ) {\n\t\t\t\tswitch ( $changeSet['action'] ) {\n\t\t\t\t\tcase 'add':\n\t\t\t\t\t\t$class = 'mw-twocolconflict-diffchange-own';\n\t\t\t\t\t\tif ( $this->hasConflictInLine( $currentLine ) ) {\n\t\t\t\t\t\t\t$class .= ' mw-twocolconflict-diffchange-conflict';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$output .= '<div class=\"' . $class . '\">' .\n\t\t\t\t\t\t\t'<div class=\"mw-twocolconflict-diffchange-title\">' .\n\t\t\t\t\t\t\t'<span mw-twocolconflict-diffchange-title-pseudo=\"' .\n\t\t\t\t\t\t\t$this->context->msg( 'twoColConflict-diffchange-own-title' )->escaped() .\n\t\t\t\t\t\t\t'\" unselectable=\"on\">' . // used by IE9\n\t\t\t\t\t\t\t'</span>' .\n\t\t\t\t\t\t\t'</div>' .\n\t\t\t\t\t\t\t$changeSet['new'] .\n\t\t\t\t\t\t\t'</div>' . \"\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\t$class = 'mw-twocolconflict-diffchange-foreign';\n\t\t\t\t\t\tif ( $this->hasConflictInLine( $currentLine ) ) {\n\t\t\t\t\t\t\t$class .= ' mw-twocolconflict-diffchange-conflict';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$output .= '<div class=\"' . $class . '\">' .\n\t\t\t\t\t\t\t'<div class=\"mw-twocolconflict-diffchange-title\">' .\n\t\t\t\t\t\t\t'<span mw-twocolconflict-diffchange-title-pseudo=\"' .\n\t\t\t\t\t\t\t$this->context->msg(\n\t\t\t\t\t\t\t\t'twoColConflict-diffchange-foreign-title',\n\t\t\t\t\t\t\t\t$lastUser\n\t\t\t\t\t\t\t)->escaped() .\n\t\t\t\t\t\t\t'\" unselectable=\"on\">' . // used by IE9\n\t\t\t\t\t\t\t'</span>' .\n\t\t\t\t\t\t\t'</div>' .\n\t\t\t\t\t\t\t$changeSet['old'] .\n\t\t\t\t\t\t\t'</div>';\n\n\t\t\t\t\t\tif ( !$this->hasConflictInLine( $currentLine ) ) {\n\t\t\t\t\t\t\t$output .= \"\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'copy':\n\t\t\t\t\t\t$output .= '<div class=\"mw-twocolconflict-diffchange-same\">' .\n\t\t\t\t\t\t\t$this->addUnchangedText( $changeSet['copy'] ) .\n\t\t\t\t\t\t\t'</div>' . \"\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->normalizeMarkedUpText( $output );\n\t}", "function phorum_api_diff_unpatch($text, $diff)\n{\n $text = str_replace(array(\"\\r\\n\", \"\\r\"), \"\\n\", $text);\n\n if (!is_array($diff)) {\n $n = 0;\n for ($i=0; $i<strlen($diff); $i++) {\n $c = substr($diff, $i, 1);\n if ($c == \"-\") {\n $n = substr($diff, 0, $i);\n $pre = substr($text, 0, $n);\n $post = substr($text, $n);\n return $pre.substr($diff, $i+1).$post;\n } elseif ($c == \"+\") {\n $n = substr($diff, 0, $i);\n $pre = substr($text, 0, $n);\n $post = substr($text, $n);\n return $pre.substr($post, strlen($diff)-$i-1);\n }\n }\n return $text;\n }\n foreach (array_reverse($diff) as $d) {\n $text = phorum_api_diff_unpatch($text, $d);\n }\n return $text;\n}", "private function getUnifiedDiff() {\n\t\t$currentText = $this->toEditText( $this->getCurrentContent() );\n\t\t$yourText = $this->textbox1;\n\n\t\t$currentLines = explode( \"\\n\", $currentText );\n\t\t$yourLines = explode( \"\\n\", str_replace( \"\\r\\n\", \"\\n\", $yourText ) );\n\n\t\treturn $this->getLineBasedUnifiedDiff( $currentLines, $yourLines );\n\t}", "function phorum_api_diff_patch($text, $diff)\n{\n if (!is_array($diff))\n {\n $n = 0;\n for ($i=0; $i<strlen($diff); $i++) {\n $c = substr($diff, $i, 1);\n if ($c == \"+\") {\n $n = substr($diff, 0, $i);\n $pre = substr($text, 0, $n);\n $post = substr($text, $n);\n return $pre.substr($diff, $i+1).$post;\n } elseif ($c == \"-\") {\n $n = substr($diff, 0, $i);\n $pre = substr($text, 0, $n);\n $post = substr($text, $n);\n return $pre.substr($post, strlen($diff)-$i-1);\n }\n }\n return $text;\n }\n foreach ($diff as $d) {\n $text = phorum_api_diff_patch($text, $d);\n }\n return $text;\n}", "function cp_str_containsHTML($str){\r\n return ($str != str_replace(['>','<'],'',$str));\r\n}", "function prep_diff_text($string, $wrap = true)\n\t{\n\t\tif (trim($string) === '')\n\t\t{\n\t\t\treturn '&nbsp;';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($wrap)\n\t\t\t{\n\t\t\t\t$string = nl2br(htmlspecialchars_uni($string));\n\t\t\t\t$string = preg_replace('#( ){2}#', '&nbsp; ', $string);\n\t\t\t\t$string = str_replace(\"\\t\", '&nbsp; &nbsp; ', $string);\n\t\t\t\treturn \"<code>$string</code>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn '<pre style=\"display:inline\">' . \"\\n\" . htmlspecialchars_uni($string) . '</pre>';\n\t\t\t}\n\t\t}\n\t}", "public function diff()\n {\n $type = strtolower($this->getType());\n if (in_array($type, ['jpg', 'gif', 'png', 'exe'])) {\n return false;\n }\n\n if ($this->operation === self::OP_OVERWRITE) {\n return $this->renderDiff(file($this->path), $this->content);\n }\n\n return '';\n }", "function correctHTMLValidationErrors($txt) {\r\n\tif (Settings::get ( \"disable_html_validation\" )) {\r\n\t\treturn $txt;\r\n\t}\r\n\t\r\n\t// Ersetze & durch &amp;\r\n\t$txt = preg_replace ( '/[&](?![A-Za-z]+[;])/', \"&amp;\", $txt );\r\n\t\r\n\t// replaced deprecated HTML-Tags\r\n\t$txt = str_ireplace ( \"<center>\", \"<div style=\\\"text-align:center\\\">\", $txt );\r\n\t$txt = str_ireplace ( \"</center>\", \"</div>\", $txt );\r\n\t$txt = str_ireplace ( \"<strike>\", \"<del>\", $txt );\r\n\t$txt = str_ireplace ( \"</strike>\", \"</del>\", $txt );\r\n\t$txt = str_ireplace ( \"<s>\", \"<del>\", $txt );\r\n\t$txt = str_ireplace ( \"</s>\", \"</del>\", $txt );\r\n\t$txt = str_ireplace ( \"<tt>\", \"<code>\", $txt );\r\n\t$txt = str_ireplace ( \"</tt>\", \"</code>\", $txt );\r\n\t$txt = str_ireplace ( \"<dir>\", \"<ul>\", $txt );\r\n\t$txt = str_ireplace ( \"</dir>\", \"</ul>\", $txt );\r\n\t$txt = str_ireplace ( \"<acronym>\", \"<abbr>\", $txt );\r\n\t$txt = str_ireplace ( \"</acronym>\", \"</abbr>\", $txt );\r\n\t\r\n\treturn $txt;\r\n}", "function vB_Text_Diff_Entry($data_old, $data_new)\n\t{\n\t\t$this->data_old = $data_old;\n\t\t$this->data_new = $data_new;\n\t}", "function skin_css_view_bit( $diff ) {\n\n$IPBHTML = \"\";\n//--starthtml--//\n\n$IPBHTML .= <<<EOF\n<div style='padding:4px;border:1px solid #000;background-color:#FFF;margin:4px;'>\n$diff\n</div>\n<div style='padding:4px;border:1px solid #000;background-color:#FFF;margin:4px;'>\n <span class='diffred'>Удален HTML код</span> &middot; <span class='diffgreen'>Добавлен HTML код</span>\n</div>\nEOF;\n\n//--endhtml--//\nreturn $IPBHTML;\n}", "public function diff($new,$old)\n\t{\n \t\t/*global $sourceFolder;\n\t\tglobal $uploadFolder;\n\n\n\t\t$uploadDir = $sourceFolder.\"/\".$uploadFolder;\n\n \t\t if (!file_exists($uploadDir.\"/tmp\"))\n\t\t {\n\t\t \tmkdir($uploadDir .\"/tmp\", 0755);\n\n\t\t }\n\t\t// $new=htmlspecialchars($new, ENT_QUOTES);\n\t\t// $old=htmlspecialchars($old, ENT_QUOTES);\n\t\t $fileNew = \"newFile\";\n\t\t $fileOld=\"oldFile\";\n\t\t$fpn = fopen($uploadDir .\"/tmp/\".$fileNew, 'w') or die(\"can't open new file for writing ARTICLE L:105\");\n\t\tfwrite($fpn,$new);\n\t\tfclose($fpn);\n\n\t\t$fpo = fopen($uploadDir .\"/tmp/\".$fileOld, 'w') or die(\"can't open old file for writing ARTICLE L:109\");\n\t\tfwrite($fpo,$old);\n\t\tfclose($fpo);\n\n\t\t$cmd=\"diff \".$uploadDir .\"/tmp/\".$fileNew.' '.$uploadDir .\"/tmp/\".$fileOld.\"\";\n\n\t\t$diff = shell_exec(''.$cmd.'');\n\n\t\t$fpo = fopen($uploadDir .\"/tmp/diffGenerated\", 'w') or die(\"can't open old file for writing ARTICLE L:109\");\n\t\tfwrite($fpo,$diff);\n\t\tfclose($fpo);\n\t\t$diff=addslashes($diff);*/\n\t\treturn $old;\n\t}", "function MY_VERY_OWN_OM_Text($attr, $content = null) {\n\n\t$result = '<div style=\"display: flex; padding: 0px;\"><div class=\"oldEnglish\"><b><font color=\"gray\">ORIGINAL TEXT</font></b></div><div class=\"newEnglish\"><b><font color=\"gray\">MODERN TEXT</font></b></div></div>';\t\n\treturn $result;\n}", "function diff($diff, $mode = 'autodetect')\n {\n }", "function cleanEditorsTranslationJunk( $text ) {\r\r\n\t$matches\t\t\t\t\t=\tnull;\r\r\n\tif ( preg_match( '/^<p>([^<]+)<\\/p>$/i', $text, $matches ) ) {\r\r\n\t\tif ( trim( $matches[1] ) != getLangDefinition( trim( $matches[1] ) ) ) {\r\r\n\t\t\t$text\t\t\t\t=\ttrim( $matches[1] );\r\r\n\t\t}\r\r\n\t}\r\r\n\treturn $text;\r\r\n}", "function html_diff($proj, $commit, $parent, $repos) {\n $repo = get_repo_path($proj, $repos);\n $out = array();\n exec(\"GIT_DIR=$repo/.git git diff $parent $commit\", $out);\n\n echo '<div class=\"gitcode\">';\n echo '<b>diff</b><br>';\n echo highlight_code(implode(\"\\n\", $out));\n echo '</div><br>';\n}", "function parseUnifiedDiff($diff)\n {\n }", "function compareStrings($string1, $string2){\n $newString1 = formatString($string1);\n $newString2 = formatString($string2);\n\n $result = false;\n if(strcmp($newString1, $newString2) == 0){\n $result = true;\n }\n\n ?>\n <section class=\"flex-container row resultStrings\">\n <div class=\"col col-2\">\n <p class=\"finalString1\"><?=$newString1?></p>\n </div>\n <div class=\"col col-2\">\n <p class=\"finalString2\"><?=$newString2?></p>\n </div>\n </section>\n <section class=\"row results\">\n <div class=\"col col-4\">\n <p class=\"result\">\n <?php\n if($result == true){\n ?>\n The above strings are identical to each other\n <?php\n }\n else{\n ?>\n The above strings are not identical to each other\n <?php\n }\n ?>\n </p>\n </div>\n </section>\n\n <?php\n }", "function testBug_rolfhub_2007_02_07_2() \n {\n $sText = <<<SCRIPT\n<?php\necho (1.0 . \" \" . 2 . 3);\n?>\nSCRIPT;\n $this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\necho (1.0 . \" \" . 2 . 3);\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }", "function skin_diff_overview($content, $missing, $changed) {\n\n$IPBHTML = \"\";\n//--starthtml--//\n\n$IPBHTML .= <<<EOF\n<script type=\"text/javascript\" src='{$this->ipsclass->skin_acp_url}/acp_template.js'></script>\n<div class='tableborder'>\n <div class='tableheaderalt'>\n <table cellpadding='0' cellspacing='0' border='0' width='100%'>\n <tr>\n <td align='left' width='95%' style='font-size:12px; vertical-align:middle;font-weight:bold; color:#FFF;'>Сравнение стилей</td>\n <td align='right' width='5%' nowrap='nowrap'>\n &nbsp;\n </td>\n </tr>\n</table>\n </div>\n <table cellpadding='0' cellspacing='0' width='100%'>\n <tr>\n <td class='tablesubheader' width='90%'><strong>Название шаблона</strong></td>\n <td class='tablesubheader' width='5%'>Различия</a>\n <td class='tablesubheader' width='5%'>Размер</a>\n <td class='tablesubheader' width='5%'>&nbsp;</a>\n </tr>\n $content\n </table>\n <div align='right' class='tablefooter'>$missing новых шаблонов и $changed измененных</div>\n</div>\nEOF;\n\n//--endhtml--//\nreturn $IPBHTML;\n}", "function _convert()\n {\r\n \t$badStr = $this->html;\n\t //remove PHP if it exists\r\n\t while( substr_count( $badStr, '<'.'?' ) && substr_count( $badStr, '?'.'>' ) && strpos( $badStr, '?'.'>', strpos( $badStr, '<'.'?' ) ) > strpos( $badStr, '<'.'?' ) ) {\r\n\t $badStr = substr( $badStr, 0, strpos( $badStr, '<'.'?' ) ) . substr( $badStr, strpos( $badStr, '?'.'>', strpos( $badStr, '<'.'?' ) ) + 2 ); }\r\n\t //remove comments\r\n\t while( substr_count( $badStr, '<!--' ) && substr_count( $badStr, '-->' ) && strpos( $badStr, '-->', strpos( $badStr, '<!--' ) ) > strpos( $badStr, '<!--' ) ) {\r\n\t $badStr = substr( $badStr, 0, strpos( $badStr, '<!--' ) ) . substr( $badStr, strpos( $badStr, '-->', strpos( $badStr, '<!--' ) ) + 3 ); }\r\n\t //now make sure all HTML tags are correctly written (> not in between quotes)\r\n\r\n\t \r\n\t //TODO: here is any problem, because in some cases happens loop and mail is never parsed\r\n\t //\t for( $x = 0, $goodStr = '', $is_open_tb = false, $is_open_sq = false, $is_open_dq = false; strlen( $chr = $badStr{$x} ); $x++ ) {\r\n//\t //take each letter in turn and check if that character is permitted there\r\n//\t switch( $chr ) {\r\n//\t case '<':\r\n//\t if( !$is_open_tb && strtolower( substr( $badStr, $x + 1, 5 ) ) == 'style' ) {\r\n//\t $badStr = substr( $badStr, 0, $x ) . substr( $badStr, strpos( strtolower( $badStr ), '</style>', $x ) + 7 ); $chr = '';\r\n//\t } elseif( !$is_open_tb && strtolower( substr( $badStr, $x + 1, 6 ) ) == 'script' ) {\r\n//\t $badStr = substr( $badStr, 0, $x ) . substr( $badStr, strpos( strtolower( $badStr ), '</script>', $x ) + 8 ); $chr = '';\r\n//\t } elseif( !$is_open_tb ) { $is_open_tb = true; } else { $chr = '&lt;'; }\r\n//\t break;\r\n//\t case '>':\r\n//\t if( !$is_open_tb || $is_open_dq || $is_open_sq ) { $chr = '&gt;'; } else { $is_open_tb = false; }\r\n//\t break;\r\n//\t case '\"':\r\n//\t if( $is_open_tb && !$is_open_dq && !$is_open_sq ) { $is_open_dq = true; }\r\n//\t elseif( $is_open_tb && $is_open_dq && !$is_open_sq ) { $is_open_dq = false; }\r\n//\t else { $chr = '&quot;'; }\r\n//\t break;\r\n//\t case \"'\":\r\n//\t if( $is_open_tb && !$is_open_dq && !$is_open_sq ) { $is_open_sq = true; }\r\n//\t elseif( $is_open_tb && !$is_open_dq && $is_open_sq ) { $is_open_sq = false; }\r\n//\t } $goodStr .= $chr;\r\n//\t }\r\n$goodStr = $badStr;\r\n\t \r\n\t //now that the page is valid (I hope) for strip_tags, strip all unwanted tags\r\n\t $goodStr = strip_tags( $goodStr, '<title><hr><h1><h2><h3><h4><h5><h6><div><p><br><pre><sup><ul><ol><dl><dt><table><caption><tr><li><dd><th><td><a><area><img><form><input><textarea><button><select><option>' );\r\n\t //strip extra whitespace except between <pre> and <textarea> tags\r\n\t $badStr = preg_split( \"/<\\/?pre[^>]*>/i\", $goodStr );\r\n\t for( $x = 0; is_string( $badStr[$x] ); $x++ ) {\r\n\t if( $x % 2 ) { $badStr[$x] = '<pre>'.$badStr[$x].'</pre>'; } else {\r\n\t $goodStr = preg_split( \"/<\\/?textarea[^>]*>/i\", $badStr[$x] );\r\n\t for( $z = 0; is_string( $goodStr[$z] ); $z++ ) {\r\n\t if( $z % 2 ) { $goodStr[$z] = '<textarea>'.$goodStr[$z].'</textarea>'; } else {\r\n\t $goodStr[$z] = preg_replace( \"/\\s+/\", ' ', $goodStr[$z] );\r\n\t } }\r\n\t $badStr[$x] = implode('',$goodStr);\r\n\t } }\r\n\t $goodStr = implode('',$badStr);\r\n\r\n\t\t$search = array(\r\n\t\t \"/\\r/\", // Non-legal carriage return\r\n\t\t \"/[\\n\\t]+/\", // Newlines and tabs\r\n\t\t '/<br[^>]*>/i', // <br>\r\n\t\t '/&nbsp;/i',\r\n\t\t '/&quot;/i',\r\n\t\t '/&gt;/i',\r\n\t\t '/&lt;/i',\r\n\t\t '/&amp;/i',\r\n\t\t '/&copy;/i',\r\n\t\t '/&trade;/i',\r\n\t\t '/&#8220;/',\r\n\t\t '/&#8221;/',\r\n\t\t '/&#8211;/',\r\n\t\t '/&#8217;/',\r\n\t\t '/&#38;/',\r\n\t\t '/&#169;/',\r\n\t\t '/&#8482;/',\r\n\t\t '/&#151;/',\r\n\t\t '/&#147;/',\r\n\t\t '/&#148;/',\r\n\t\t '/&#149;/',\r\n\t\t '/&reg;/i',\r\n\t\t '/&bull;/i',\r\n\t\t '/&[&;]+;/i'\r\n\t\t );\r\n\r\n\t\t\t$replace = array(\r\n\t\t '', // Non-legal carriage return\r\n\t\t ' ', // Newlines and tabs\r\n\t\t \"\\n\", // <br>\r\n\t\t ' ',\r\n\t\t '\"',\r\n\t\t '>',\r\n\t\t '<',\r\n\t\t '&',\r\n\t\t '(c)',\r\n\t\t '(tm)',\r\n\t\t '\"',\r\n\t\t '\"',\r\n\t\t '-',\r\n\t\t \"'\",\r\n\t\t '&',\r\n\t\t '(c)',\r\n\t\t '(tm)',\r\n\t\t '--',\r\n\t\t '\"',\r\n\t\t '\"',\r\n\t\t '*',\r\n\t\t '(R)',\r\n\t\t '*',\r\n\t\t ''\r\n\t\t );\r\n\t \r\n\t \r\n\t $goodStr = preg_replace( $search, $replace, $goodStr );\r\n\t \r\n\t //remove all options from select inputs\r\n\t $goodStr = preg_replace( \"/<option[^>]*>[^<]*/i\", '', $goodStr );\r\n\t //replace all tags with their text equivalents\r\n\t $goodStr = preg_replace( \"/<(\\/title|hr)[^>]*>/i\", \"\\n --------------------\\n\", $goodStr );\r\n\t $goodStr = preg_replace( \"/<(h|div|p)[^>]*>/i\", \"\\n\", $goodStr );\r\n\t $goodStr = preg_replace( \"/<sup[^>]*>/i\", '^', $goodStr );\r\n\t $goodStr = preg_replace( \"/<(ul|ol|dl|dt|table|caption|\\/textarea|tr[^>]*>\\s*<(td|th))[^>]*>/i\", \"\\n\", $goodStr );\r\n\t $goodStr = preg_replace( \"/<li[^>]*>/i\", \"\\n· \", $goodStr );\r\n\t $goodStr = preg_replace( \"/<dd[^>]*>/i\", \"\\n\\t\", $goodStr );\r\n\t $goodStr = preg_replace( \"/<(th|td)[^>]*>/i\", \"\\t\", $goodStr );\r\n\t $goodStr = preg_replace('/<br[^>]*>/i', \"\\n\", $goodStr);\r\n\t $goodStr = preg_replace( \"/<a[^>]* href=(\\\"((?!\\\"|#|javascript:)[^\\\"#]*)(\\\"|#)|'((?!'|#|javascript:)[^'#]*)('|#)|((?!'|\\\"|>|#|javascript:)[^#\\\"'> ]*))[^>]*>/i\", \"[LINK: $2$4$6] \", $goodStr );\r\n\t $goodStr = preg_replace( \"/<img[^>]* alt=(\\\"([^\\\"]+)\\\"|'([^']+)'|([^\\\"'> ]+))[^>]*>/i\", \"[IMAGE: $2$3$4] \", $goodStr );\r\n\t $goodStr = preg_replace( \"/<form[^>]* action=(\\\"([^\\\"]+)\\\"|'([^']+)'|([^\\\"'> ]+))[^>]*>/i\", \"\\n[FORM: $2$3$4] \", $goodStr );\r\n\t $goodStr = preg_replace( \"/<(input|textarea|button|select)[^>]*>/i\", \"[INPUT] \", $goodStr );\r\n\t //strip all remaining tags (mostly closing tags)\r\n\t $goodStr = strip_tags( $goodStr );\r\n\t //convert HTML entities\r\n\t $goodStr = strtr( $goodStr, array_flip( get_html_translation_table( HTML_ENTITIES ) ) );\r\n\t preg_replace( \"/&#(\\d+);/me\", \"chr('$1')\", $goodStr );\r\n\t //wordwrap\r\n\t //$goodStr = wordwrap( $goodStr );\r\n\t //make sure there are no more than 3 linebreaks in a row and trim whitespace\r\n\t $this->text = preg_replace( \"/^\\n*|\\n*$/\", '', preg_replace( \"/[ \\t]+(\\n|$)/\", \"$1\", preg_replace( \"/\\n(\\s*\\n){2}/\", \"\\n\\n\\n\", preg_replace( \"/\\r\\n?|\\f/\", \"\\n\", str_replace( chr(160), ' ', $goodStr ) ) ) ) );\r\n }", "function strip_word_doc( $html, $allowed_tags = '' )\n\t{\n\t\tmb_regex_encoding( 'UTF-8' );\n\n\t\t//replace MS special characters first\n\t\t$search = [\n\t\t\t'/&lsquo;/u',\n\t\t\t'/&rsquo;/u',\n\t\t\t'/&ldquo;/u',\n\t\t\t'/&rdquo;/u',\n\t\t\t'/&mdash;/u',\n\t\t];\n\t\t$replace = [\n\t\t\t'\\'',\n\t\t\t'\\'',\n\t\t\t'\"',\n\t\t\t'\"',\n\t\t\t'-',\n\t\t];\n\t\t$html = preg_replace( $search, $replace, $html );\n\n\t\t//make sure _all_ html entities are converted to the plain ascii equivalents - it appears\n\t\t//in some MS headers, some html entities are encoded and some aren't\n\t\t$html = html_entity_decode( $html, ENT_QUOTES, 'UTF-8' );\n\n\t\t//try to strip out any C style comments first, since these, embedded in html comments, seem to\n\t\t//prevent strip_tags from removing html comments (MS Word introduced combination)\n\t\tif ( mb_stripos( $html, '/*' ) !== FALSE )\n\t\t{\n\t\t\t$html = mb_eregi_replace( '#/\\*.*?\\*/#s', '', $html, 'm' );\n\t\t}\n\n\t\t//introduce a space into any arithmetic expressions that could be caught by strip_tags so that they won't be\n\t\t//'<1' becomes '< 1'(note: somewhat application specific)\n\t\t$html = preg_replace(\n\t\t\t[\n\t\t\t\t'/<([0-9]+)/',\n\t\t\t], [\n\t\t\t\t'< $1',\n\t\t\t], $html );\n\t\t$html = strip_tags( $html, $allowed_tags );\n\n\t\t//eliminate extraneous whitespace from start and end of line, or anywhere there are two or more spaces, convert it to one\n\t\t$html = preg_replace(\n\t\t\t[\n\t\t\t\t'/^\\s\\s+/',\n\t\t\t\t'/\\s\\s+$/',\n\t\t\t\t'/\\s\\s+/u',\n\t\t\t], [\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t' ',\n\t\t\t], $html );\n\n\t\t//strip out inline css and simplify style tags\n\t\t$search = [\n\t\t\t'#<(strong|b)[^>]*>(.*?)</(strong|b)>#isu',\n\t\t\t'#<(em|i)[^>]*>(.*?)</(em|i)>#isu',\n\t\t\t'#<u[^>]*>(.*?)</u>#isu',\n\t\t];\n\t\t$replace = [\n\t\t\t'<b>$2</b>',\n\t\t\t'<i>$2</i>',\n\t\t\t'<u>$1</u>',\n\t\t];\n\t\t$html = preg_replace( $search, $replace, $html );\n\n\t\t//on some of the ?newer MS Word exports, where you get conditionals of the form 'if gte mso 9', etc., it appears\n\t\t//that whatever is in one of the html comments prevents strip_tags from eradicating the html comment that contains\n\t\t//some MS Style Definitions - this last bit gets rid of any leftover comments */\n\t\t$num_matches = preg_match_all( \"/\\<!--/u\", $html, $matches );\n\t\tif ( $num_matches )\n\t\t{\n\t\t\t$html = preg_replace( '/\\<!--(.)*--\\>/isu', '', $html );\n\t\t}\n\n\t\treturn $html;\n\t}", "function fake_levenshtein($a,$b)\n{\n\t// Some stripping, for performance, and because white space doesn't matter so much in HTML anyway\n\t$a=preg_replace('#\\s#','',$a);\n\t$b=preg_replace('#\\s#','',$b);\n\n\t$a_len=strlen($a);\n\t$b_len=strlen($b);\n\tif (($a_len<255) && ($b_len<255))\n\t{\n\t\treturn levenshtein($a,$b);\n\t}\n\t$percent=0.0;\n\treturn max($a_len,$b_len)-similar_text($a,$b,$percent);\n}", "public function testProcessHtml(): void {\n\t\t/** @var BaseUtility&MockObject $utility */\n\t\t$utility = $this->getMockBuilder(BaseUtility::class)\n\t\t\t->onlyMethods(['getHyphenationWords'])\n\t\t\t->getMock();\n\t\t$utility->method('getHyphenationWords')->will(self::returnCallback(function(): array {\n\t\t\treturn ['con•sec•tetur', 'adi#pi#sicing'];\n\t\t}));\n\t\t$cObj = GeneralUtility::makeInstance(ContentObjectRenderer::class);\n\t\t$cObj->start([], '_NO_TABLE');\n\t\t$utility->setContentObjectRenderer($cObj);\n\n\t\t$baseContent = (string)file_get_contents(getcwd() . '/Tests/Unit/Fixtures/Utility/MetaTagsBase.html');\n\t\t$TSFE = $this->setupTsfeMock();\n\t\t$TSFE->content = $baseContent;\n\t\t$utility->postProcessHTML([], $TSFE);\n\n\t\t$expectedContent = (string)file_get_contents(getcwd() . '/Tests/Unit/Fixtures/Utility/HyphenationExpected.html');\n\t\t$expectedContent = str_replace('%SHY%', html_entity_decode('&shy;', 0, 'UTF-8'), $expectedContent);\n\t\t$expectedContent = str_replace(\"\\n\", '', $expectedContent);\n\n\t\t$actualContent = str_replace(\"\\n\", '', $TSFE->content);\n\n\t\tself::assertEquals($expectedContent, $actualContent);\n\t}", "static function apply($diff, $text)\n {\n $tmpname = tempnam(sys_get_temp_dir(), \"diff\");\n $outname = tempnam(sys_get_temp_dir(), \"diff\");\n $tmp = fopen($tmpname, \"w\");\n $out = fopen($outname, \"r\");\n fwrite($tmp, $text.PHP_EOL);\n $proc = proc_open(\n 'patch '.$tmpname.' -o '.$outname, array(\n 0 => array(\"pipe\", \"r\"),\n 1 => array(\"pipe\", \"w\"),\n 2 => array(\"pipe\", \"w\")\n ), $pipes\n );\n if (is_resource($proc)) {\n fwrite($pipes[0], $diff);\n fclose($pipes[0]);\n stream_get_contents($pipes[1]);\n $newText = stream_get_contents($out);\n fclose($pipes[1]);\n return $newText;\n }\n }", "function FixHtml($html_text) {\n\t\t$text_filter = new TextFilter ( );\n\t\t$text_nojs = $text_filter->filterJavaScript ( $html_text );\n\t\t$text_noif = preg_replace ( '/<iframe.*?<\\/iframe>/ims', \"\", $text_nojs );\n\t\t$text_noif = preg_replace ( '/<IFRAME.*?<\\/IFRAME>/ims', \"\", $text_noif );\n\t\t//$text_bal = $text_filter->balanceTags($text_noif);\n\t\t\n\n\t\treturn $text_noif;\n\t}", "function templateCode_older() {\r\n\t\tif ($this->template !== \"none\") {\r\n\t\t\tprint('do not use this function 43096809683069836');exit(0);\r\n\t\t\t$bodycode = ReTidy::getBodyCode();\r\n\t\t\tif(strpos($bodycode, '<div class=\"center\">') !== false) {\r\n\t\t\t\tvar_dump(OM::getTagString('abvb<div class=\"center\">adsfds</div>sdsgdsgds', '<div class=\"center\">'));exit(0);\r\n\t\t\t\t$bodycode = substr(OM::getTagString($bodycode, '<div class=\"center\">'), strlen('<div class=\"center\">'), strlen($bodycode)-strlen('<div class=\"center\">')-4);\r\n\t\t\t}\r\n\t\t\t$this->code = str_replace(\"{content}\", $bodycode, file_get_contents($this->template));\r\n\t\t}\r\n\t}", "function skin_diff_main_overview($content) {\n\n$IPBHTML = \"\";\n//--starthtml--//\n\n$IPBHTML .= <<<EOF\n<script type=\"text/javascript\" src='{$this->ipsclass->skin_acp_url}/acp_template.js'></script>\n<div class='tableborder'>\n <div class='tableheaderalt'>\n <table cellpadding='0' cellspacing='0' border='0' width='100%'>\n <tr>\n <td align='left' width='95%' style='font-size:12px; vertical-align:middle;font-weight:bold; color:#FFF;'>Отчет сравнения стилей</td>\n </tr>\n</table>\n </div>\n <table cellpadding='0' cellspacing='0' width='100%'>\n <tr>\n <td class='tablesubheader' width='90%'><strong>Название</strong></td>\n <td class='tablesubheader' width='5%'>Создано</a>\n <td class='tablesubheader' width='5%'>&nbsp;</a>\n </tr>\n $content\n </table>\n <div align='right' class='tablefooter'>&nbsp;</div>\n</div>\n<br />\n<form action='{$this->ipsclass->base_url}&amp;{$this->ipsclass->form_code}&amp;code=skin_diff' enctype='multipart/form-data' method='POST'>\n<input type='hidden' name='_admin_auth_key' value='{$this->ipsclass->_admin_auth_key}' />\n<div class='tableborder'>\n <div class='tableheaderalt'>Создать новый отчет сравнения стилей</div>\n <table cellpadding='0' cellspacing='0' border='0' width='100%'>\n <tr>\n <td class='tablerow1'><strong>Введите название</strong><div class='desctext'>Это название будет использовано в списке выше, когда сравнение будет завершено</div></td>\n <td class='tablerow2'><input class='textinput' type='text' size='30' name='diff_session_title' /></td>\n </tr>\n <tr>\n <td class='tablerow1'><strong>Пропускать все новые/ошибочные шаблоны?</strong><div class='desctext'>Если вы сравниваете старый ipb_templates.xml из более старого IPB, вы можете отключить этот пункт. Если вы сравниваете с XML файлом из измененного стиля, вы должны включить этот пункт.</div></td>\n <td class='tablerow2'><input class='textinput' type='checkbox' value='1' name='diff_session_ignore_missing' /></td>\n </tr>\n <tr>\n <td class='tablerow1'><strong>Выберите корректный файл «ipb_templates.xml».</strong><div class='desctext'>Будет произведено сравнение с HTML шаблонами главного стиля</div></td>\n <td class='tablerow2'><input class='textinput' type='file' size='30' name='FILE_UPLOAD' /></td>\n </tr>\n </table>\n <div align='center' class='tablefooter'><input type='submit' class='realbutton' value='Импортировать' /></div>\n</div>\n</form>\nEOF;\n\n//--endhtml--//\nreturn $IPBHTML;\n}", "public function generateUnifiedDiff()\n {\n if ( ! $this->operations) {\n return \"\";\n }\n\n if ($this->lines === null) {\n $hunk = Hunk::forEmptyFile();\n return (string)$this->operations[0]->perform($hunk);\n }\n\n $hunks = array();\n\n foreach ($this->getLineGroups() as $lineGroup) {\n $start = min($lineGroup);\n $end = max($lineGroup);\n\n $hunk = Hunk::forLines($start, $end, $this->lines);\n\n foreach ($this->operations as $line => $operation) {\n if ( ! in_array($line, $lineGroup)) {\n continue;\n }\n\n $hunk = $operation->perform($hunk);\n }\n\n $hunks[] = $hunk;\n }\n\n $output = \"\";\n\n if ($this->path) {\n $output .= \"--- a/\" . $this->path . \"\\n\";\n $output .= \"+++ b/\" . $this->path . \"\\n\";\n }\n\n $output .= implode(\"\\n\", $hunks);\n\n return $output;\n }", "public static function show_diffs( $source_id, $suggestion_id ) {\n\t\t// get posts, call wp_text_diff\n\t\t$source = get_post( $source_id );\n\t\t$suggestion = get_post( $suggestion_id );\n\t\t$nonce_name = 'moderate-post-' . $source_id . '-' . $suggestion_id;\n\t\t$original_date = date_i18n( get_option( 'date_format' ), strtotime( $source->post_date ) );\n\t\t$suggestion_date = date_i18n( get_option( 'date_format' ), strtotime( $suggestion->post_date ) );\n\t\t$diff_html = wp_text_diff(\n\t\t\t$source->post_title . \"\\n\" . $source->post_content,\n\t\t\t$suggestion->post_title . \"\\n\" . $suggestion->post_content,\n\t\t\tarray(\n\t\t\t\t'title_left' => sprintf( __( 'Original, %s', 'blicki' ), $original_date ),\n\t\t\t\t'title_right' => sprintf( __( 'Suggested, %s', 'blicki' ), $suggestion_date )\n\t\t\t)\n\t\t);\n\t\t?>\n\t\t<div class=\"wrap\">\n\t\t\t<h1><?php printf( __( 'Merging suggested changes into &ldquo;%s&rdquo;', 'blicki' ), '<a href=\"' . get_edit_post_link( $source_id ) . '\">' . esc_html( $source->post_title ) . '</a>' ); ?></h1>\n\n\t\t\t<div style=\"margin: 1em 0; padding: 10px; overflow: hidden; background: #fbfbfb; line-height: 30px;\">\n\t\t\t\t<a href=\"<?php echo wp_nonce_url( add_query_arg( 'action', 'approve' ), $nonce_name ); ?>\" class=\"button button-large button-primary\"><?php _e( 'Approve Suggestion', 'blicki' ); ?></a>\n\t\t\t\t&nbsp;&nbsp;<a href=\"<?php echo wp_nonce_url( add_query_arg( 'action', 'reject' ), $nonce_name ); ?>\" class=\"button button-large delete\"><?php _e( 'Reject Suggestion', 'blicki' ); ?></a>\n\t\t\t\t&nbsp;&nbsp;<a href='<?php echo esc_url( add_query_arg( array( 'post' => $source_id, 'action' => 'edit', 'merge_from' => $suggestion_id ), 'post.php' ) ); ?>'><?php _e( 'Edit Manually', 'blicki' ); ?></a>\n\t\t\t</div>\n\n\t\t\t<?php echo $diff_html; ?>\n\t\t</div>\n\t\t<?php\n\t}", "function extract_text($ref,$extension,$path=\"\")\n\t{\n\t# Extract text from the resource and save to the configured field.\n\tglobal $extracted_text_field,$antiword_path,$pdftotext_path,$zip_contents_field;\n\t$text=\"\";\n\tif ($path==\"\"){$path=get_resource_path($ref,true,\"\",false,$extension);}\n\t\n\t# Microsoft Word extraction using AntiWord.\n\tif ($extension==\"doc\" && isset($antiword_path))\n\t\t{\n\t\t$command=$antiword_path . \"/antiword\";\n\t\tif (!file_exists($command)) {$command=$antiword_path . \"\\antiword.exe\";}\n\t\tif (!file_exists($command)) {debug(\"ERROR: Antiword executable not found at '$antiword_path'\"); return false;}\n\t\t$text=run_command($command . \" -m UTF-8 \\\"\" . $path . \"\\\"\");\n\t\t}\n\t\n # Microsoft OfficeOpen (docx,xlsx) extraction\n # This is not perfect and needs some work, but does at least extract indexable content.\n if ($extension==\"docx\"||$extension==\"xlsx\")\n\t\t{\t\n\t\t$path=escapeshellarg($path);\n\t\t\n\t\t # DOCX files are zip files and the content is in word/document.xml.\n # We extract this then remove tags.\n switch($extension){\n case \"xlsx\":\n $text=run_command(\"unzip -p $path \\\"xl/sharedStrings.xml\\\"\");\n break;\n\n case \"docx\":\n $text=run_command(\"unzip -p $path \\\"word/document.xml\\\"\");\n break;\n }\n \n\t\t# Remove tags, but add newlines as appropriate (without this, separate text blocks are joined together with no spaces).\n\t\t$text=str_replace(\"<\",\"\\n<\",$text);\n\t\t$text=trim(strip_tags($text));\n\t\twhile (strpos($text,\"\\n\\n\")!==false) {$text=str_replace(\"\\n\\n\",\"\\n\",$text);} # condense multiple line breaks\n\t\t}\n\n\t# OpenOffice Text (ODT)\n\tif ($extension==\"odt\"||$extension==\"ods\"||$extension==\"odp\")\n\t\t{\t\n\t\t$path=escapeshellarg($path);\n\t\t\n\t\t# ODT files are zip files and the content is in content.xml.\n\t\t# We extract this then remove tags.\n\t\t$text=run_command(\"unzip -p $path \\\"content.xml\\\"\");\n\n\t\t# Remove tags, but add newlines as appropriate (without this, separate text blocks are joined together with no spaces).\n\t\t$text=str_replace(\"<\",\"\\n<\",$text);\n\t\t$text=trim(strip_tags($text));\n\t\twhile (strpos($text,\"\\n\\n\")!==false) {$text=str_replace(\"\\n\\n\",\"\\n\",$text);} # condense multiple line breaks\n\t\t}\n\t\n\t# PDF extraction using pdftotext (part of the XPDF project)\n\tif (($extension==\"pdf\" || $extension==\"ai\") && isset($pdftotext_path))\n\t\t{\n\t\t$command=$pdftotext_path . \"/pdftotext\";\n\t\tif (!file_exists($command)) {$command=$pdftotext_path . \"\\pdftotext.exe\";}\n\t\tif (!file_exists($command)) {debug(\"ERROR: pdftotext executable not found at '$pdftotext_path'\"); return false;}\n\t\t$text=run_command($command . \" -enc UTF-8 \\\"\" . $path . \"\\\" -\");\n\t\t\n\t\t}\n\t\n\t# HTML extraction\n\tif ($extension==\"html\" || $extension==\"htm\")\n\t\t{\n\t\t$text=strip_tags(file_get_contents($path));\n\t\t}\n\n\t# TXT extraction\n\tif ($extension==\"txt\")\n\t\t{\n\t\t$text=file_get_contents($path);\n\t\t}\n\n\tif ($extension==\"zip\")\n\t\t{\n\t\t# Zip files - map the field\n\t\t$path=escapeshellarg($path);\n\t\t$text=run_command(\"unzip -l $path\");\n\t\t\n\t\tglobal $zip_contents_field_crop;\n\t\tif ($zip_contents_field_crop>0)\n\t\t\t{\n\t\t\t# Remove the first few lines according to $zip_contents_field_crop in config.\n\t\t\t$text=explode(\"\\n\",$text);\n\t\t\tfor ($n=0;$n<count($zip_contents_field_crop);$n++) {array_shift($text);}\n\t\t\t$text=join(\"\\n\",$text);\n\t\t\t}\n\t\t\n\t\tif (isset($zip_contents_field))\n\t\t\t{\n\t\t\t$extracted_text_field=$zip_contents_field;\n\t\t\t}\n\t\t}\n\t\n\thook(\"textextraction\", \"all\", array($extension,$path));\n\t\t\n\t# Save the extracted text.\n\tif ($text!=\"\")\n\t\t{\n\t\t$modified_text=hook(\"modifiedextractedtext\",'',array($text));\n\t\tif(!empty($modified_text)){$text=$modified_text;}\n\t\t\n\t\t# Save text\n\t\tupdate_field($ref,$extracted_text_field,$text);\n\t\t\n\t\t# Update XML metadata dump file.\n\t\tupdate_xml_metadump($ref);\n\t\t}\n\t\n\t}", "function phorum_api_diff_unpatch_color($text, $diff)\n{\n $text = str_replace(array(\"\\r\\n\", \"\\r\"), \"\\n\", $text);\n\n if (!is_array($diff))\n {\n $n = 0;\n for ($i=0; $i<strlen($diff); $i++) {\n $c = substr($diff, $i, 1);\n if ($c == \"-\") {\n $n = substr($diff, 0, $i);\n $pre = substr($text, 0, $n);\n $post = substr($text, $n);\n return $pre.\"[phorum removal]\".substr($diff, $i+1).\"[/phorum removal]\".$post;\n } elseif ($c == \"+\") {\n $n = substr($diff, 0, $i);\n $pre = substr($text, 0, $n);\n $post = substr($text, $n);\n $colored_text = substr($diff, $i+1);\n return $pre.\"[phorum addition]\".$colored_text.\"[/phorum addition]\".substr($post, strlen($diff)-$i-1);\n }\n }\n return $text;\n }\n foreach (array_reverse($diff) as $d) {\n $text = phorum_api_diff_unpatch_color($text, $d);\n }\n return $text;\n}", "function g()\r\n\t{\r\n\t\t$this->str_html = str_replace(array(\"\\r\\n\",\"\\n\",\"\\r\",\"\\t\"), ' ', $this->str_html);\r\n\t\t$this->str_html = preg_replace(\"/(\\s{2,})/\", ' ', $this->str_html);\r\n\t\treturn $this->replace_vars($this->str_html, $this->html_a, 1);\r\n#\t\treturn $this->str_html;\r\n\t}", "public function _changed($orig, $closing)\n\t{\n\t\t$diff = new WordLevelDiff($orig, $closing);\n\t\t$del = $diff->orig();\n\t\t$add = $diff->closing();\n\n\t\t// Notice that WordLevelDiff returns HTML-escaped output.\n\t\t// Hence, we will be calling addedLine/deletedLine without HTML-escaping.\n\n\t\twhile ($line = array_shift($del))\n\t\t{\n\t\t\t$this->i++;\n\t\t\t$aline = array_shift($add);\n\t\t\techo \"\\t\\t\".'<tr>'.\"\\n\";\n\t\t\techo \"\\t\\t\\t\".'<th>'.$this->i.'</th>'.\"\\n\";\n\t\t\techo $this->deletedLine($line) . $this->addedLine($aline);\n\t\t\techo \"\\t\\t\".'</tr>'.\"\\n\";\n\t\t}\n\t\t// If any leftovers\n\t\tforeach ($add as $line)\n\t\t{\n\t\t\t$this->i++;\n\t\t\techo \"\\t\\t\".'<tr>'.\"\\n\";\n\t\t\techo \"\\t\\t\\t\".'<th>'.$this->i.'</th>'.\"\\n\";\n\t\t\techo $this->emptyLine() . $this->addedLine($line);\n\t\t\techo \"\\t\\t\".'</tr>'.\"\\n\";\n\t\t}\n\t\t//$this->i--;\n\t}", "function testBug13600() \n {\n //$this->oBeaut->startLog();\n $this->oBeaut->addFilter('Pear');\n $sText = <<<SCRIPT\n<?php\nfunction example(){\n}\n?>\nSCRIPT;\n $this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\nfunction example()\n{\n}\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }", "private function getMarkedUpForeignText( array $unifiedDiff ) {\n\t\t$output = '';\n\t\tforeach ( $unifiedDiff as $key => $currentLine ) {\n\t\t\tforeach ( $currentLine as $changeSet ) {\n\t\t\t\tswitch ( $changeSet['action'] ) {\n\t\t\t\t\tcase 'add':\n\t\t\t\t\t\t$class = 'mw-twocolconflict-plain-own';\n\t\t\t\t\t\tif ( $this->hasConflictInLine( $currentLine ) ) {\n\t\t\t\t\t\t\t$class .= ' mw-twocolconflict-plain-own';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$output .= '<div class=\"' . $class . '\"></div>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\t$class = 'mw-twocolconflict-plain-foreign';\n\t\t\t\t\t\tif ( $this->hasConflictInLine( $currentLine ) ) {\n\t\t\t\t\t\t\t$class .= ' mw-twocolconflict-plain-conflict';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$output .= '<div class=\"' . $class . '\">' .\n\t\t\t\t\t\t\t$changeSet['old'] . \"\\n\" .\n\t\t\t\t\t\t\t'</div>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'copy':\n\t\t\t\t\t\t$output .= '<div class=\"mw-twocolconflict-plain-same\">' .\n\t\t\t\t\t\t\t$changeSet['copy'] . \"\\n\" .\n\t\t\t\t\t\t\t'</div>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->normalizeMarkedUpText( $output );\n\t}", "function test_misc_static_replacements( $input, $output ) {\n\t\treturn $this->assertEquals( $output, wptexturize( $input ) );\n\t}", "function when_match( $bool, $str = '', $otherwise_str = '', $echo = true ) {\n\t$str = trim( $bool ? $str : $otherwise_str );\n\n\tif ( $str ) {\n\t\t$str = ' ' . $str;\n\n\t\tif ( $echo ) {\n\t\t\techo esc_attr($str);\n\t\t\treturn '';\n\t\t}\n\t}\n\n\treturn $str;\n}", "function getDiff()\n {\n }", "public function getReplacementText();", "function wp_get_revision_ui_diff($post, $compare_from, $compare_to)\n {\n }", "function skin_diff_view_bit( $template_bit_name, $template_group, $content ) {\n\n$IPBHTML = \"\";\n//--starthtml--//\n\n$IPBHTML .= <<<EOF\n<div style='padding:4px;border:1px solid #000;background-color:#FFF;margin:4px;'>\n<strong>$template_group &gt; $template_bit_name</strong>\n</div>\n<div style='padding:4px;border:1px solid #000;background-color:#FFF;margin:4px;'>\n$content\n</div>\n<div style='padding:4px;border:1px solid #000;background-color:#FFF;margin:4px;'>\n <span class='diffred'>Удален HTML код</span> &middot; <span class='diffgreen'>Добавлен HTML код</span>\n</div>\nEOF;\n\n//--endhtml--//\nreturn $IPBHTML;\n}", "function pre_word() {\r\n\t\t//$this->code = preg_replace('/<ins\\s/is', '<ins stripme=\"y\" ', $this->code);\r\n\t\t//$this->code = str_replace('<span class=msoIns>', '<span stripme=\"y\">', $this->code);\r\n\t\tReTidy::non_DOM_deleteme('<style[^>]*? id=\"dynCom\"[^>]*?>');\r\n\t\tReTidy::non_DOM_deleteme('<script language=\"JavaScript\">');\r\n\t\tReTidy::non_DOM_stripme('<ins\\s[^>]*?>');\r\n\t\tReTidy::non_DOM_stripme('<span\\s+class=msoIns>');\r\n\t\tReTidy::non_DOM_stripme('<span\\s+class=msoDel>');\r\n\t\t$this->code = preg_replace('/<del\\s/is', '<del deleteme=\"y\" ', $this->code);\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) class=msocomtxt/is', '<div$1 deleteme=\"y\" ', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^<>]*?)class=MsoCommentReference>/is', '<span$1 deleteme=\"y\">', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^<>]*?)style=\\'[^\\']*?display\\s*:\\s*none[^\\']*?\\'/is', '<span$1 deleteme=\"y\" ', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^<>]*?)style=\"[^\"]*?display\\s*:\\s*none[^\"]*?\\\"/is', '<span$1 deleteme=\"y\" ', $this->code);\r\n\t\t\r\n\t\t$this->code = preg_replace('/<(w:\\w+)[^<>]*?>(.*?)<\\/\\1>/is', '$2', $this->code); // will cause problems if there are nested tags with w: namespace\r\n\t\t\r\n\t//\t// microsoft classes to delete\r\n\t//\t$arrayMicrosoftClassesToDelete = array(\r\n\t//\t'msoIns',\r\n\t//\t'msoDel',\r\n\t//\t);\r\n\t//\tforeach($arrayMicrosoftClassesToDelete as $microsoftClass) {\r\n\t//\t\twhile(true) {\r\n\t//\t\t\t$this->code = preg_replace('/class=\"([^\"]*)' . ReTidy::preg_escape($microsoftClass) . '([^\"]*)\"/is', 'class=\"$1$2\"', $this->code, -1, $countA);\r\n\t//\t\t\t$this->code = str_replace(' class=' . ReTidy::preg_escape($microsoftClass), '', $this->code, $countB);\r\n\t//\t\t\tif($countA === 0 && $countB === 0) {\r\n\t//\t\t\t\tbreak;\r\n\t//\t\t\t}\t\t\t\t\r\n\t//\t\t}\r\n\t//\t}\r\n\t\t\r\n\t\t//$this->code = preg_replace('/\\n/', 'XXX\\n', $this->code);\r\n\t\t\r\n\t\t//<tr style='page-break-inside:avoid;height:11.25pt'> \r\n\t\t// <span lang=FR-CA style='font-size:9.0pt;font-family:\"Times New Roman\"; \r\n\t\t// color:black;layout-grid-mode:line'> \r\n\t\t// <td style='height:11.25pt;border:none' width=0 height=15></td> \r\n\t\t// </span> \r\n\t\t// </tr> \r\n\r\n\t\t// does this do anything?!?\r\n\t\t\r\n\t\t$this->code = str_replace('\r\n', ' \r\n', $this->code);\t\t\r\n\t}", "function clean_word() {\r\n\t\tpreg_match_all('/<img[^<>]*? alt=\"Text Box:\\s*([^\"]*?)\"[^<>]*?>/is', $this->code, $text_box_matches, PREG_OFFSET_CAPTURE);\r\n\t\t$counter = sizeof($text_box_matches[0]) - 1;\r\n\t\twhile($counter > -1) {\r\n\t\t\t$offset = $text_box_matches[0][$counter][1];\r\n\t\t\t$text = $text_box_matches[1][$counter][0];\r\n\t\t\t$text = '<p>' . str_replace('&#13;&#10;', '</p>\r\n<p>', $text) . '</p>';\r\n\t\t\t$this->code = substr($this->code, 0, $offset) . $text . substr($this->code, $offset + strlen($text_box_matches[0][$counter][0]));\r\n\t\t\t$counter--;\r\n\t\t}\r\n\t\t\r\n\t\t// although at least firefox seems smart enough to not display them, \r\n\t\t// some versions of word may use soft hyphens for print layout or some such nonsense\r\n\t\t// is this a candidate for general (basic) usage?\r\n\t\t$this->code = str_replace('&shy;', '', $this->code);\r\n\t\t// this needs revision for array(\"­\", \"&#173;\", \"&#xad;\", \"&shy;\"); and the fact that soft hyphens are misused by document authors (specific case: they show in RTF files but not in firefox)\r\n\t\t\r\n\t\tReTidy::decode_for_DOM_all_character_entities(); // since much of the clean_word work is removing styles\r\n\t\t\r\n\t\t// should we simply eliminate all names and ids (since the structure function will generate those which are needed)?\r\n\t\t// seems we should except for footnotes: _ftnref _ftn _ednref _edn\r\n\t\t$this->code = preg_replace('/ id=\"([^_][^\"]*?|_[^fe][^\"]*?|_f[^t][^\"]*?|_e[^d][^\"]*?|_ft[^n][^\"]*?|_ed[^n][^\"]*?)\"/is', '', $this->code);\r\n\t\t$this->code = preg_replace('/(<a[^<>]*?) name=\"([^_][^\"]*?|_[^fe][^\"]*?|_f[^t][^\"]*?|_e[^d][^\"]*?|_ft[^n][^\"]*?|_ed[^n][^\"]*?)\"([^<>]*?>)/is', '$1$3', $this->code);\r\n\t\t\r\n\t\t\r\n\t\t// often in word documents the lang attributes are wrong... so:\r\n\t\t$this->code = preg_replace('/ lang=\"EN[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ xml:lang=\"EN[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ lang=\"FR[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ xml:lang=\"FR[^\"]*\"/', '', $this->code);\r\n\t\t\r\n\t\t// white background\r\n\t\t$this->code = preg_replace('/ class=\"([^\"]*)whiteBG([^\"]*)\"/is', ' class=\"$1$2\"', $this->code);\r\n\t\t// parks canada specific:\r\n\t\t$this->code = preg_replace('/ class=\"([^\"]*)backTop([^\"]*)\"/is', ' class=\"$1alignRight$2\"', $this->code);\t\t\r\n\t\t\r\n\t\t// topPage; these should not exist (since documents in their original format shall not have links to the top)\r\n\t\t// but they sometimes come from styles to classes. On tags other than spans they style the alignment.\r\n\t\t$this->code = preg_replace('/<span([^>]*)class=\"([^\"]*)topPage([^\"]*)\"/is', '<span$1class=\"$2$3\"', $this->code);\r\n\t\t\r\n\t\t// word document section <div>s\r\n\t\t//$this->code = preg_replace('/<div style=\"page\\s*:\\s*[^;]+;\">/is', '<div stripme=\"y\">', $this->code);\r\n\t\tReTidy::non_DOM_stripme('<div style=\"page\\s*:\\s*[^;]+;\">');\r\n\t\t\r\n\t\t// remove style information declarations(?) or qualifications(?) like !msnorm and !important? \r\n\t\t// Nah, there is no need until word is seen to use !important (it could also be in government stylesheets so there is the remote chance that we\r\n\t\t// would like to keep it). Definately get rid of !msnorm though.\r\n\t\t$arrayStyleInformationPiecesToDelete = array(\r\n\t\t'!msorm',\r\n\t\t);\r\n\t\tforeach($arrayStyleInformationPiecesToDelete as $styleInformationPieceToDelete) {\r\n\t\t\t$styleInformationPieceToDeleteCount = -1;\r\n\t\t\twhile($styleInformationPieceToDeleteCount != 0) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*?)' . $styleInformationPieceToDelete . '([^\"]*?)\"/is', 'style=\"$1$2\"', $this->code, -1, $styleInformationPieceToDeleteCount);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// blockquote\r\n\t\tpreg_match_all('/<p[^<>]*style=[^<>]*(margin-right\\s*:\\s*([^;\\'\"]*)[;\\'\"])[^<>]*(margin-left\\s*:\\s*([^;\\'\"]*)[;\\'\"])[^<>]*>(.*?)<\\/p>/is', $this->code, $p_matches2);\r\n\t\tforeach($p_matches2[0] as $index => $value) {\r\n\t\t\tpreg_match('/([0-9\\.]*)in/', $p_matches2[2][$index], $margin_right_matches);\r\n\t\t\tpreg_match('/([0-9\\.]*)in/', $p_matches2[4][$index], $margin_left_matches);\r\n\t\t\tif($margin_right_matches[1] > 0.4 && $margin_left_matches[1] > 0.4) {\r\n\t\t\t\t$original = $new = $p_matches2[0][$index];\r\n\t\t\t\t$new = str_replace($p_matches2[1][$index], '', $new);\r\n\t\t\t\t$new = str_replace($p_matches2[3][$index], '', $new);\r\n\t\t\t\t$new = str_replace('<p', '<div', $new);\r\n\t\t\t\t$new = str_replace('</p>', '</div>', $new);\r\n\t\t\t\t$new = \"<blockquote>\" . $new . \"</blockquote>\";\r\n\t\t\t\t$this->code = str_replace($original, $new, $this->code);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// onmouseover, onmouseout; attributes to delete\r\n\t\t$arrayAttributesToDelete = array(\r\n\t\t'onmouseover',\r\n\t\t'onmouseout',\r\n\t\t);\r\n\t\tforeach($arrayAttributesToDelete as $attributeToDelete) {\r\n\t\t\t$this->code = preg_replace('/' . $attributeToDelete . '=\"([^\"]*)\"/is', '', $this->code);\r\n\t\t}\r\n\t\t\r\n\t\t// microsoft styles to delete\r\n\t\t$arrayMicrosoftStylesToDelete = array(\r\n\t\t'page-break-before',\r\n\t\t'page-break-after',\r\n\t\t'page-break-inside',\r\n\t\t'text-autospace',\r\n\t\t'text-transform',\t\t\r\n\t\t//'border',\r\n\t\t'border-left', // (2011-11-07)\r\n\t\t'border-right', // (2011-11-07)\r\n\t\t'border-bottom', // (2011-11-07)\r\n\t\t'border-top', // (2011-11-07)\r\n\t\t'border-collapse',\r\n\t\t'margin', //// notice that we may in some cases want to keep margins (as an indication of indentation)\r\n\t\t'margin-left', ////\r\n\t\t'margin-right', ////\r\n\t\t'margin-top', ////\r\n\t\t'margin-bottom', ////\t\t\t\t\t\t\t\r\n\t\t'padding',\r\n\t\t'padding-left',\r\n\t\t'padding-right',\r\n\t\t'padding-top',\r\n\t\t'padding-bottom',\r\n\t\t'font',\r\n\t\t'font-size', //// notice that we may in some cases want to keep font-size\r\n\t\t'font-family',\r\n\t\t//'font-style', // font-style: italic;\r\n\t\t//'text-decoration', // text-decoration: underline;\r\n\t\t'line-height',\r\n\t\t'layout-grid-mode',\r\n\t\t'page',\r\n\t\t'text-indent', //// notice that we may in some cases want to keep text-indent\r\n\t\t'font-variant', //// this may have to be amended in the future (if some document uses small caps without capitalizing those first letters that need to be capitalized)\r\n\t\t'mso-style-name',\r\n\t\t'mso-style-link',\r\n\t\t'z-index',\r\n\t\t'position',\r\n\t\t// we cannot enable the following and keep other style information that these are substrings of\r\n\t\t'top',\r\n\t\t'right',\r\n\t\t'bottom',\r\n\t\t'left',\r\n\t\t'letter-spacing',\r\n\t\t);\r\n\t\t// for this we assume that there are no embedded stylesheets\r\n\t\tforeach($arrayMicrosoftStylesToDelete as $microsoftStyle) {\r\n\t\t\twhile(true) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($microsoftStyle) . '\\s*:\\s*[^;\"]*;\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countA);\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($microsoftStyle) . '\\s*:\\s*[^;\"]*\"/is', 'style=\"$1\"', $this->code, -1, $countB);\r\n\t\t\t\tif($countA === 0 && $countB === 0) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif($this->config['strict_accessibility_level'] > 0) { // then just make it grey\r\n\t\t\twhile(true) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape('color') . '\\s*:\\s*[^;\"]*;\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countA);\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape('color') . '\\s*:\\s*[^;\"]*\"/is', 'style=\"$1\"', $this->code, -1, $countB);\r\n\t\t\t\tif($countA === 0 && $countB === 0) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$arrayMicrosoftStylesWithValuesToDelete = array(\r\n\t\t//'color' => array('black', 'windowtext'), // these can sometimes override other colours that we keep so ideally we would like to keep these in but style attributes for colour...\r\n\t\t'text-align' => array('justify'),\r\n\t\t'font-weight' => array('normal', 'normal !msorm', 'normal !msnorm'), \r\n\t\t// we take this out although it can usefully cascade other styles\r\n\t\t// which brings up the point that these all probably can... ;(\r\n\t\t//'font-variant' => array('normal', 'normal!important', 'normal !important', 'small-caps'),\r\n\t\t'background' => array('white', '#FFFFFF'),\r\n\t\t'background-color' => array('white', '#FFFFFF'),\r\n\t\t);\r\n\t\tforeach($arrayMicrosoftStylesWithValuesToDelete as $style => $value) {\r\n\t\t\tforeach($value as $information) {\r\n\t\t\t\twhile(true) {\r\n\t\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($style) . '\\s*:\\s*' . ReTidy::preg_escape($information) . ';\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countC);\r\n\t\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($style) . '\\s*:\\s*' . ReTidy::preg_escape($information) . '\"/is', 'style=\"$1\"', $this->code, -1, $countD);\r\n\t\t\t\t\tif($countC === 0 && $countD === 0) {\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}\r\n\t\t}\r\n\t\t\r\n\t\t$arrayMicrosoftStylesWithValuesOnTagsToDelete = array(\r\n\t\t'text-align' => array('left' => array('p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'),),\r\n\t\t'font-weight' => array('bold' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'),),\r\n\t\t'vertical-align' => array( \r\n\t\t// we should be careful here not to remove any styles that might be used to identify footnotes; although\r\n\t\t// I do not know of any that are currently (2011-11-28) used\r\n\t\t'baseline' => array('span'),\r\n\t\t'sub' => array('span'),\r\n\t\t'super' => array('span'),\r\n\t\t'top' => array('span'),\r\n\t\t'text-top' => array('span'),\r\n\t\t'middle' => array('span'),\r\n\t\t'bottom' => array('span'),\r\n\t\t'text-bottom' => array('span'),\r\n\t\t'inherit' => array('span'),\r\n\t\t),\r\n\r\n\t\t);\r\n\t\tforeach($arrayMicrosoftStylesWithValuesOnTagsToDelete as $property => $stylings) {\r\n\t\t\tforeach($stylings as $styling => $tags) {\r\n\t\t\t\t$tagsString = implode(\"|\", $tags);\r\n\t\t\t\twhile(true) {\r\n\t\t\t\t\t$this->code = preg_replace('/<(' . $tagsString . ')([^<>]*) style=\"([^\"]*)' . ReTidy::preg_escape($property) . '\\s*:\\s*' . ReTidy::preg_escape($styling) . ';\\s*([^\"]*)\"/is', '<$1$2 style=\"$3$4\"', $this->code, -1, $countE);\r\n\t\t\t\t\t$this->code = preg_replace('/<(' . $tagsString . ')([^<>]*) style=\"([^\"]*)' . ReTidy::preg_escape($property) . '\\s*:\\s*' . ReTidy::preg_escape($styling) . '\"/is', '<$1$2 style=\"$3\"', $this->code, -1, $countF);\r\n\t\t\t\t\tif($countE === 0 && $countF === 0) {\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}\r\n\t\t}\r\n\t\t\r\n\t\t// pseudo-elements\r\n\t\t// <a style=\":visited { color: purple; }\">\r\n\t\t$countE = -1;\r\n\t\twhile($countE !== 0) {\r\n\t\t\t//print(\"doing pseudo-elements<br>\\r\\n\");\r\n\t\t\t$this->code = preg_replace('/style=\"([^\"]{0,}):\\w+\\s*\\{[^\\{\\}]{0,}\\}([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countE);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// <hr> with width\r\n\t\t$this->code = preg_replace('/<hr([^<>]*) width=\"[^\"]*\"([^<>]*)\\/>/is', '<hr$1$2/>', $this->code);\r\n\t\t\r\n\t\t// microsoft using operating system independant CSS...\r\n\t\t// I guess for this we assume that we are using windows.\r\n\t\t$this->code = preg_replace('/style=\"([^\"]*)border\\s*:\\s*solid\\s+windowtext\\s+1.0pt\\s*(;?)([^\"]*)\"/is', 'style=\"$1border: 1px solid black$2$3\"', $this->code);\r\n\t\t\r\n\t\t// superscript using CSS\r\n\t\t//$this->code = preg_replace('/(<(\\w*)[^<>]* style=\"[^\"]*)vertical-align: super\\s*(;?)([^\"]*\"[^<>]*>.*?<\\/\\2>)/is', '<sup>$1$4</sup>', $this->code, -1, $countC);\r\n\t\t$this->code = preg_replace('/<(\\w+[^<>]* style=\"[^\"]*)vertical-align: super\\s*(;?[^\"]*\"[^<>]*)>/is', '<$1$2 newtag=\"sup\">', $this->code);\r\n\t\t\r\n\t\t// clean up stupidity generated by tidy\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) start=\"[^\"]*?\"([^<>]*?)>/is', '<div$1$2>', $this->code);\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) type=\"[^\"]*?\"([^<>]*?)>/is', '<div$1$2>', $this->code);\r\n\t\t\r\n\t\tReTidy::post_dom();\r\n\t\t// remove empty <a> tags; aside from general cleanup, to avoid the regular expression recursion limit of 100 (for the ridiculous\r\n\t\t// case of something like that many anchors at the same spot...\r\n\t\t//$this->code = str_replace('<a></a>', '', $this->code);\r\n\t\t$this->code = preg_replace('/<a>([^<>]*?)<\\/a>/is', '$1', $this->code);\r\n\t//\tReTidy::extra_space();\r\n\t\t\r\n\t\t// lists where each list element has a <ul>\r\n\t\tif(ReTidy::is_XHTML()) {\r\n\t\t\t$this->code = preg_replace('/<\\/li>\\s*<\\/ul>\\s*<ul( [^<>]*)?>/is', '<br /><br /></li>', $this->code);\r\n\t\t} else {\r\n\t\t\t$this->code = preg_replace('/<\\/li>\\s*<\\/ul>\\s*<ul( [^<>]*)?>/is', '<br><br></li>', $this->code);\r\n\t\t}\r\n\t\t\r\n\t\t// empty text blocks; notice that we would not want to do this generally\r\n\t\t$this->code = preg_replace('/<(p|h1|h2|h3|h4|h5|h6|li)( [^<>]*){0,1}>&nbsp;<\\/\\1>/is', '', $this->code);\r\n\t\t// some sort of full-width break from word that we do not want\r\n\t\t$this->code = preg_replace('/<br [^<>]*clear\\s*=\\s*[\"\\']*all[\"\\']*[^<>]*\\/>/is', '', $this->code);\r\n\t\t// force a border onto tables because word html uses border on cells rather than on the table\r\n\t\t$this->code = preg_replace('/<table([^<>]*) border=\"0\"/is', '<table$1 border=\"1\"', $this->code);\r\n\t\t// despan anchors\r\n\t\tpreg_match_all('/(<a ([^<>]*)[^\\/<>]>)(.*?)(<\\/a>)/is', $this->code, $anchor_matches);\r\n\t\tforeach($anchor_matches[0] as $index => $value) {\r\n\t\t\tif(strpos($anchor_matches[2][$index], \"href=\") === false) {\r\n\t\t\t\tif(strpos($anchor_matches[2][$index], \"name=\") !== false || strpos($anchor_matches[2][$index], \"id=\") !== false) {\r\n\t\t\t\t\t$this->code = str_replace($anchor_matches[1][$index] . $anchor_matches[3][$index] . $anchor_matches[4][$index], $anchor_matches[1][$index] . $anchor_matches[4][$index] . $anchor_matches[3][$index], $this->code);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// simplify lists that unnecessarily have a list for each list item\r\n\t\tpreg_match_all('/<ol([^<>]*?)>(.*?)<\\/ol>/is', $this->code, $ol_matches, PREG_OFFSET_CAPTURE);\r\n\t\t$size = sizeof($ol_matches[0]) - 1;\r\n\t\twhile($size > -1) {\r\n\t\t\tpreg_match('/ start=\"([^\"]*?)\"/is', $ol_matches[0][$size][0], $start_matches);\r\n\t\t\tpreg_match('/ type=\"([^\"]*?)\"/is', $ol_matches[0][$size][0], $type_matches);\r\n\t\t\t$start = $start_matches[1];\r\n\t\t\t$type = $type_matches[1];\r\n\t\t\t$combine_string = \"\";\r\n\t\t\twhile(true) {\r\n\t\t\t\t$end_of_previous_offset = $ol_matches[0][$size - 1][1] + strlen($ol_matches[0][$size - 1][0]);\r\n\t\t\t\t$end_of_current_offset = $ol_matches[0][$size][1] + strlen($ol_matches[0][$size][0]);\r\n\t\t\t\t$combine_string = substr($this->code, $end_of_previous_offset, $end_of_current_offset - $end_of_previous_offset) . $combine_string;\r\n\t\t\t\tpreg_match('/ type=\"([^\"]*?)\"/is', $ol_matches[0][$size - 1][0], $type_matches2);\r\n\t\t\t\t$type2 = $type_matches2[1];\r\n\t\t\t\tif($type !== $type2) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tpreg_match('/ start=\"([^\"]*?)\"/is', $ol_matches[0][$size - 1][0], $start_matches2);\r\n\t\t\t\t$start2 = $start_matches2[1];\r\n\t\t\t\tif(!is_numeric($start2) || $start2 >= $start) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tReTidy::preg_match_last('/<[^<>]+>/is', substr($this->code, 0, $ol_matches[0][$size][1]), $last_tag_piece_matches);\r\n\t\t\t\tif($last_tag_piece_matches[0] !== \"</ol>\") {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t$start = $start2;\r\n\t\t\t\t$size--;\r\n\t\t\t}\r\n\t\t\t$cleaned_combine_string = $combine_string;\r\n\t\t\t$cleaned_combine_string = preg_replace('/<\\/ol>\\s*<ol[^<>]*?>/is', '', $cleaned_combine_string);\r\n\t\t\t$this->code = str_replace($combine_string, $cleaned_combine_string, $this->code);\r\n\t\t\t$size--;\r\n\t\t}\r\n\t\t\r\n\t\tReTidy::clean_redundant_sufficient_inline();\r\n\t\tReTidy::double_breaks_to_paragraphs();\r\n\t\tReTidy::encode_for_DOM_all_character_entities(); // re-encode character entities that were decoded at the start of this function\r\n\t\t//$this->code = preg_replace('/(&nbsp;|&#160;|&#xA0;){3,}/is', '&nbsp;&nbsp;', $this->code); // added 2015-06-04\r\n\t\tReTidy::mitigate_consecutive_non_breaking_spaces(); // plz\r\n\t}", "function phppage2readeable($t){\n\n return str_replace(\" \", \"&nbsp;\",preg_replace(\"/\\.php$/\", \"\", str_replace(\"_\", \"&nbsp;\", $t)));\n}", "public function maybe_merge_content( $content, $post_id ) {\n\t\tif ( isset( $_GET['merge_from'] ) && 0 !== absint( $_GET['merge_from'] ) ) {\n\t\t\t$post = get_post( $post_id );\n\t\t\t$suggestion = get_post( absint( $_GET['merge_from'] ) );\n\t\t\tif ( ! empty( $post) && 'blicki' === $post->post_type\n\t\t\t\t&& ! empty( $suggestion ) && 'blicki-suggestion' === $suggestion->post_type ) {\n\t\t\t\tif ( ! class_exists( 'WP_Text_Diff_Renderer_Table', false ) ) {\n\t\t\t\t\trequire( ABSPATH . WPINC . '/wp-diff.php' );\n\t\t\t\t}\n\n\t\t\t\t$text_diff = new Text_Diff( explode( \"\\n\", $post->post_content ), explode( \"\\n\", $suggestion->post_content ) );\n\t\t\t\t$merged_text = '';\n\t\t\t\tforeach ( $text_diff->_edits as $operation ) {\n\t\t\t\t\tif ( $operation instanceof Text_Diff_Op_copy ) {\n\t\t\t\t\t\t// copy just means use the final (or original, they're the same by definition )\n\t\t\t\t\t\tforeach ( $operation->final as $line ) {\n\t\t\t\t\t\t\t$merged_text .= $line . \"\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// all other operations have some difference between orig and final (might be false ie empty)\n\t\t\t\t\t\t$merged_text .= \"ORIGINAL:\\n\\n\";\n\t\t\t\t\t\tif ( ! empty( $operation->orig ) ) {\n\t\t\t\t\t\t\tforeach ( $operation->orig as $line ) {\n\t\t\t\t\t\t\t\t$merged_text .= $line . \"\\n\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$merged_text .= \"\\nSUGGESTED:\\n\\n\";\n\t\t\t\t\t\tif ( ! empty( $operation->final ) ) {\n\t\t\t\t\t\t\tforeach ( $operation->final as $line ) {\n\t\t\t\t\t\t\t\t$merged_text .= $line . \"\\n\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$merged_text .= \"\\nEND\\n\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $merged_text;\n\t\t\t}\n\t\t}\n\n\t\treturn $content;\n\t}", "function _text($str) {\n $md5 = md5($str);\n $option_name = get_text_translation_option_name( $md5 );\n $org = esc_html($str);\n\n if ( !isset($_COOKIE['site-edit']) || $_COOKIE['site-edit'] != 'Y' || ! user()->admin() ) {\n $str = _getText($str, true);\n echo $str;\n }\n else {\n $str = _getText($str);\n echo \"\n<div class='translate-text' md5='$md5' original-text='$org' code='$option_name'><span class='dashicons dashicons-welcome-write-blog'></span>\n<div class='html-content'>$str</div>\n</div>\n\";\n }\n\n}", "function tb_string_swap_get_strings() {\n\t$locals = array (\n\t\t'404'\t\t\t\t\t\t=> 'Apologies, but the page you\\'re looking for can\\'t be found.',\n\t\t'404_title'\t\t\t\t\t=> '404 Error',\n\t\t'archive_no_posts'\t\t\t=> 'Apologies, but there are no posts to display.',\n\t\t'archive'\t\t\t\t\t=> 'Archive',\n\t\t'cancel_reply_link'\t\t\t=> 'Cancel reply',\n\t\t'categories'\t\t\t\t=> 'Categories',\n\t\t'category'\t\t\t\t\t=> 'Category',\n\t\t'comment_navigation'\t\t=> 'Comment navigation',\n\t\t'comments'\t\t\t\t\t=> 'Comments',\n\t\t'comments_closed'\t\t\t=> 'Comments are closed.',\n\t\t'comments_newer'\t\t\t=> 'Newer Comments &rarr;',\n\t\t'comments_no_password'\t\t=> 'This post is password protected. Enter the password to view any comments.',\n\t\t'comments_older'\t\t\t=> '&larr; Older Comments',\n\t\t'comments_title_single'\t\t=> 'One comment on &ldquo;%2$s&rdquo;',\n\t\t'comments_title_multiple'\t=> '%1$s comments on &ldquo;%2$s&rdquo;',\n\t\t'contact_us'\t\t\t\t=> 'Contact Us',\n\t\t'crumb_404'\t\t\t\t\t=> 'Error 404',\n\t\t'crumb_author'\t\t\t\t=> 'Articles posted by',\n\t\t'crumb_search'\t\t\t\t=> 'Search results for',\n\t\t'crumb_tag'\t\t\t\t\t=> 'Posts tagged',\n\t\t'edit_page'\t\t\t\t\t=> 'Edit Page',\n\t\t'email'\t\t\t\t\t\t=> 'Email',\n\t\t'home'\t\t\t\t\t\t=> 'Home',\n\t\t'invalid_layout'\t\t\t=> 'Invalid Layout ID',\n\t\t'label_submit'\t\t\t\t=> 'Post Comment',\n\t\t'last_30'\t\t\t\t\t=> 'The Last 30 Posts',\n\t\t'monthly_archives'\t\t\t=> 'Monthly Archives',\n\t\t'name'\t\t\t\t\t\t=> 'Name',\n\t\t'page'\t\t\t\t\t\t=> 'Page',\n\t\t'pages'\t\t\t\t\t\t=> 'Pages',\n\t\t'page_num'\t\t\t\t\t=> 'Page %s',\n\t\t'posts_per_category'\t\t=> 'Posts per category',\n\t\t'navigation' \t\t\t\t=> 'Navigation',\n\t\t'no_slider' \t\t\t\t=> 'Slider does not exist.',\n\t\t'no_slider_selected' \t\t=> 'Oops! You have not selected a slider in your layout.',\n\t\t'no_video'\t\t\t\t\t=> 'The video url could not retrieve a video.',\n\t\t'read_more'\t\t\t\t\t=> 'Read More',\n\t\t'search'\t\t\t\t\t=> 'Search the site...',\n\t\t'search_no_results'\t\t\t=> 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.',\n\t\t'tag'\t\t\t\t\t\t=> 'Tag',\n\t\t'title_reply'\t\t\t\t=> 'Leave a Reply',\n\t\t'title_reply_to'\t\t\t=> 'Leave a Reply to %s',\n\t\t'website'\t\t\t\t\t=> 'Website'\n\t);\n\treturn $locals;\n}", "private function getLineBasedUnifiedDiff( $fromTextLines, $toTextLines ) {\n\t\t$formatter = new LineBasedUnifiedDiffFormatter();\n\t\t$formatter->insClass = ' class=\"mw-twocolconflict-diffchange\"';\n\t\t$formatter->delClass = ' class=\"mw-twocolconflict-diffchange\"';\n\n\t\treturn $formatter->format(\n\t\t\tnew Diff( $fromTextLines, $toTextLines )\n\t\t);\n\t}", "function file_field_diff_view($items, $context) {\n $field = $context['field'];\n $instance = $context['instance'];\n $settings = $context['settings'];\n\n $diff_items = array();\n foreach ($items as $delta => $item) {\n if (isset($item['file'])) {\n $output = array();\n\n // We populate as much as possible to allow the best flexability in any\n // string overrides.\n $t_args = array();\n foreach ($item as $key => $value) {\n if (is_scalar($value)) {\n $t_args['!' . $key] = $value;\n }\n }\n // Some states do not have the file properties in the item, so put these\n // out of the main file object.\n if (!empty($item['file'])) {\n $file_values = (array) $item['file'];\n foreach ($file_values as $key => $value) {\n if (is_scalar($value) && !isset($t_args['!' . $key])) {\n $t_args['!' . $key] = $value;\n }\n }\n }\n\n $output['file'] = t('File: !filename', $t_args);\n if ($settings['compare_description_field'] && !empty($instance['settings']['description_field'])) {\n if (!empty($item['description'])) {\n $output['description'] = t('Description: !description', $t_args);\n }\n }\n if ($settings['show_id']) {\n $output['fid'] = t('File ID: !fid', $t_args);\n }\n if ($settings['compare_display_field'] && !empty($field['settings']['display_field'])) {\n $output['display'] = $item['display'] ? t('Displayed') : t('Hidden');\n }\n $diff_items[$delta] = implode('; ', $output);\n }\n }\n\n return $diff_items;\n}", "function showDiff($otitle, $ntitle, $notice = '')\n\t{\n\t\t$diff = $this->getDiff($otitle, $ntitle, $notice);\n\t\tif ($diff === false) {\n\t\t\t$this->showMissingRevision();\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$this->showDiffStyle();\n\t\t\t$this->getOutput()->clearHTML($diff);\n\t\t\t$this->getOutput()->addHTML($diff);\n\t\t\treturn true;\n\t\t}\n\t}", "static function cleanupDescription($string){\n \n }", "public static function unpatch($text, $diff)\n {\n if(!is_array($diff))\n {\n $n = 0;\n for($i=0; $i<strlen($diff); $i++)\n {\n $c = substr($diff, $i, 1);\n if($c == \"-\")\n {\n $n = substr($diff, 0, $i);\n $pre = substr($text, 0, $n);\n $post = substr($text, $n);\n return $pre.substr($diff, $i+1).$post;\n }\n elseif($c == \"+\")\n {\n $n = substr($diff, 0, $i);\n $pre = substr($text, 0, $n);\n $post = substr($text, $n);\n return $pre.substr($post, strlen($diff)-$i-1);\n }\n }\n return $text;\n }\n foreach(array_reverse($diff) as $d)\n {\n $text = self::unpatch($text, $d);\n }\n return $text;\n }", "public function testEmptyStrings()\n {\n $percent1 = 0;\n $percent2 = 0;\n\n $this->assertEquals(\n similar_text('', '', $percent1),\n mb_similar_text('', '', $percent2)\n );\n\n $this->assertEquals($percent1, $percent2);\n }", "protected function generateDiffContent($fileName) {\n\t\t$localLangDiff = NULL;\n\t\t$metaDiff = NULL;\n\t\t// set backup file\n\t\t$metaArray = $this->backupService->getBackupObj()->getMetaInfos(3);\n\t\t$informations = array(\n\t\t\t'absPath' => Typo3Lib::fixFilePath(\n\t\t\t\tPATH_site . '/' .\n\t\t\t\t$metaArray[$fileName]['pathBackup']\n\t\t\t),\n\t\t\t'relFile' => $fileName,\n\t\t);\n\t\t$this->backupService->getBackupObj()->setVar($informations);\n\n\t\t// exec diff\n\t\t// read original file\n\t\t$this->configurationService->initFileObject(\n\t\t\t$this->backupService->getBackupObj()->getVar('langFile'),\n\t\t\tTypo3Lib::fixFilePath(PATH_site . '/' . $this->backupService->getBackupObj()->getVar('extPath'))\n\t\t);\n\n\t\t// read backup file\n\t\t$this->backupService->getBackupObj()->readFile();\n\n\t\t// get language data\n\t\t$originalLocalLang = $this->configurationService->getFileObj()->getLocalLangData();\n\t\t$backupLocalLang = $this->backupService->getBackupObj()->getLocalLangData();\n\n\t\t// get meta data\n\t\t$origMeta = $this->configurationService->getFileObj()->getMetaData();\n\t\t$backupMeta = $this->backupService->getBackupObj()->getMetaData();\n\n\t\tSgLib::fixMetaAttributes($origMeta);\n\t\tunset($originalLocalLang['trans-unit']);\n\t\t$localLangDiff = Functions::getBackupDiff(0, $originalLocalLang, $backupLocalLang);\n\t\t$metaDiff = Functions::getMetaDiff(0, $origMeta, $backupMeta);\n\n\t\t// generate diff\n\t\tif (count($localLangDiff)) {\n\t\t\t$this->outputManageBackupsDiff(\n\t\t\t\t$localLangDiff, $metaDiff, $originalLocalLang, $backupLocalLang,\n\t\t\t\t$this->configurationService->getFileObj()->getOriginLangData(),\n\t\t\t\t$this->backupService->getBackupObj()->getOriginLangData(),\n\t\t\t\t$origMeta, $backupMeta\n\t\t\t);\n\t\t}\n\t}", "function testRenderAsHtml_no_references() {\n $mdtv = Metadata_Term_Value::getOneFromDb(['metadata_term_value_id' => 6205],$this->DB);\n $canonical = '<span class=\"term_value\" title=\"up to the the length of the back of the hand when a fist is made\">6-12 cm</span><div class=\"metadata-references\"><div class=\"metadata-references\">\n <ul class=\"metadata-references metadata-references-images\">\n </ul>\n <ul class=\"metadata-references metadata-references-links\">\n </ul>\n <ul class=\"metadata-references metadata-references-texts\">\n </ul>\n</div>\n</div>';\n\n $rendered = $mdtv->renderAsHtml();\n\n// echo \"<pre>\\n\".htmlentities($canonical).\"\\n\".htmlentities($rendered).\"\\n</pre>\";\n\n $this->assertEqual($canonical,$rendered);\n $this->assertNoPattern('/IMPLEMENTED/',$rendered);\n }", "public function contentStrReplace() {}", "function htmlButTags($str) {\n\t$caracteres = get_html_translation_table(HTML_ENTITIES);\n\t// Find out the \"tags\" entities\n\t$remover = get_html_translation_table(HTML_SPECIALCHARS);\n\t// Spit out the tags entities from the original table\n\t$caracteres = array_diff($caracteres, $remover);\n\t// Translate the string....\n\t$str = strtr($str, $caracteres);\n\t\n\t// now amps\n\t$str = preg_replace(\"/&(?![A-Za-z]{0,4}\\w{2,3};|#[0-9]{2,3};)/\",\"&amp;\" , $str);\n\t\n\treturn $str;\n}", "function phorum_api_diff_match($a, $b, $level=\"line\")\n{\n // set_time_limit(0); No, we don't like it.\n $answer = \"\";\n if ($level == \"line\" || $level == \"word\")\n {\n if ($level == \"line\") {\n $as = explode(\"\\n\", $a);\n $bs = explode(\"\\n\", $b);\n } else {\n $as = explode(\" \", $a);\n $bs = explode(\" \", $b);\n }\n\n $last = array();\n $next = array();\n $start = -1;\n $len = 0;\n $answer = \"\";\n for ($i = 0; $i < sizeof($as); $i++) {\n $start+= strlen($as[$i])+1;\n for ($j = 0; $j < sizeof($bs); $j++) {\n if ($as[$i] != $bs[$j]) {\n if (isset($next[$j])) unset($next[$j]);\n } else {\n if (!isset($last[$j-1]))\n $next[$j] = strlen($bs[$j]) + 1;\n else\n $next[$j] = strlen($bs[$j]) + $last[$j-1] + 1;\n if ($next[$j] > $len) {\n $len = $next[$j];\n $answer = substr($a, $start-$len+1, $len);\n }\n }\n }\n // If PHP ever copies pointers here instead of copying data,\n // this will fail. They better add array_copy() if that happens.\n $last = $next;\n }\n }\n else\n {\n $m = strlen($a);\n $n = strlen($b);\n $last = array();\n $next = array();\n $len = 0;\n $answer = \"\";\n for ($i = 0; $i < $m; $i++) {\n for ($j = 0; $j < $n; $j++) {\n if ($a[$i] != $b[$j]) {\n if (isset($next[$j])) unset($next[$j]);\n } else {\n if (!isset($last[$j-1]))\n $next[$j] = 1;\n else\n $next[$j] = 1 + $last[$j-1];\n if ($next[$j] > $len) {\n $len = $next[$j];\n $answer = substr($a, $i-$len+1, $len);\n }\n }\n }\n // If PHP ever copies pointers here instead of copying data,\n // this will fail. They better add array_copy() if that happens.\n $last = $next;\n }\n }\n\n if ($level == \"line\" && $answer == \"\") {\n return phorum_api_diff_match($a, $b, \"word\");\n } elseif ($level == \"word\" && $answer == \"\") {\n return phorum_api_diff_match($a, $b, \"letter\");\n } else {\n return $answer;\n }\n}", "function return_diff()\n\t{\n\t\t$args = func_get_args();\n\t\t$three_way_diff = (func_num_args() > 2) ? true : false;\n\n\t\t$file1 = array_shift($args);\n\t\t$file2 = array_shift($args);\n\n\t\t$tmp['file1'] = (!empty($file1) && is_string($file1)) ? file_get_contents($file1) : $file1;\n\t\t$tmp['file2'] = (!empty($file2) && is_string($file2)) ? file_get_contents($file2) : $file2;\n\n\t\tif ($three_way_diff)\n\t\t{\n\t\t\t$file3 = array_shift($args);\n\t\t\t$tmp['file3'] = (!empty($file3) && is_string($file3)) ? file_get_contents($file3) : $file3;\n\n\t\t\t$diff = new diff3($tmp['file1'], $tmp['file2'], $tmp['file3']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$diff = new diff($tmp['file1'], $tmp['file2']);\n\t\t}\n\n\t\tunset($tmp);\n\n\t\treturn $diff;\n\t}", "public static function text_change_check()\n {\n }", "function _cut_html($str) {\n $str=preg_replace(\"'<[\\/\\!]*?[^<>]*?>'si\",\"\",$str);\n return $str;\n }", "public function _strings_for_pot()\n {\n }", "function apachesolr_clean_text($text) {\r\n // Add spaces before stripping tags to avoid running words together.\r\n $text = filter_xss(str_replace(array('<', '>'), array(' <', '> '), $text), array());\r\n // Decode entities and then make safe any < or > characters.\r\n return htmlspecialchars(html_entity_decode($text, ENT_NOQUOTES, 'UTF-8'), ENT_NOQUOTES, 'UTF-8');\r\n}", "function uwwtd_get_format_markup_compliance(&$variables) {\n //dsm($variables['items']['0']['#markup']);\n //dsm($variables['element']['#items']['0']['value']);\n if (isset($GLOBALS['uwwtd']['ui']['compliance_connection'][$variables['element']['#items']['0']['value']])) {\n $variables['element']['#items']['0']['value'] = $GLOBALS['uwwtd']['ui']['compliance_connection'][$variables['element']['#items']['0']['value']];\n $variables['element']['0']['#markup'] = $GLOBALS['uwwtd']['ui']['compliance'][$variables['element']['#items']['0']['value']];\n //We need to keep the tooltip.\n \n if ($pos = strpos($variables['items']['0']['#markup'], '</div>')) {\n $variables['items']['0']['#markup'] = substr($variables['items']['0']['#markup'], 0, $pos + 6) . $variables['element']['0']['#markup'];\n } \n elseif($variables['items']['0']['#markup'] == $variables['element']['#items']['0']['value']) {\n $variables['items']['0']['#markup'] = $variables['element']['0']['#markup'];\n }\n\n }\n\n switch($variables['element']['#items']['0']['value']){\n case 'C': \n case 'QC':\n case 'RNC':\n $spanclass = 'c';\n break;\n case 'NC':\n case 'AddQC':\n $spanclass = 'nc';\n break;\n case 'NR':\n $spanclass = 'nr';\n break;\n case 'NI':\n $spanclass = 'ni';\n break;\n case 'CE':\n $spanclass = 'ce';\n break;\n }\n\n $variables['items']['0']['#markup'] = '<span class=\"' . $spanclass . '\">' . $variables['items']['0']['#markup'] . '</span>';\n //dsm($variables['items']['0']['#markup']);\n}", "function clean_rtf_from_jade_tables() {\r\n\t\t//$this->code = preg_replace('/class=[^\\s<>]*/', '', $this->code, -1, $d);\r\n\t\t//$this->code = preg_replace('/colspan=[0-9]*/', '', $this->code, -1, $e);\r\n\t\t//$this->code = preg_replace('/width=[0-9]*/', '', $this->code, -1, $f);\r\n\t\t//$this->code = str_replace('<p >', '', $this->code, $g);\r\n\t\t//$this->code = str_replace('<span >', '', $this->code, $h);\r\n\t\t//$this->code = str_replace('</p>', '', $this->code, $i);\r\n\t\t//$this->code = str_replace('</span>', '', $this->code, $j);\r\n\t\t//$this->code = str_replace('<p >', '', $this->code, $k);\t\t\r\n\t\t// INAC1168\r\n\t\tif($this->language === \"english\") {\r\n\t\t$this->code = preg_replace('/<tr>\\s*<td([^<>]*)>\\s*<b>ACTIVITIES<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>RESPONSIBILITY<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>TIMING GUIDELINES<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*1\\./', '</table>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tr>\r\n<td$1 colspan=\"2\"><b>ACTIVITIES</b></td>\r\n<td$2><b>RESPONSIBILITY</b></td>\r\n<td$3><b>TIMING GUIDELINES</b></td>\r\n</tr>\r\n<tr>\r\n<td$10>1.', $this->code, -1, $l);\r\n\t\t$this->code = preg_replace('/<tr>\\s*<td([^<>]*)>\\s*<b>ACTIVITIES<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>RESPONSIBILITY<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>TIMING GUIDELINES<\\/b>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*1\\./', '</table>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tr>\r\n<td$1 colspan=\"2\"><b>ACTIVITIES</b></td>\r\n<td$2><b>RESPONSIBILITY</b></td>\r\n<td$3><b>TIMING GUIDELINES</b></td>\r\n</tr>\r\n<tr>\r\n<td$9>1.', $this->code, -1, $m);\r\n\t\t}\r\n\t\tif($this->language === \"french\") {\r\n\t\tprint(\"<h1>french</h1>\");\r\n\t\t$this->code = preg_replace('/<tr>\\s*<td([^<>]*)>\\s*<b>ACTIVITÉS<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>RESPONSABILITÉ<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>HORIZON<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>TEMPOREL<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*1\\./', '</table>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tr>\r\n<td$1 colspan=\"2\"><b>ACTIVITÉS</b></td>\r\n<td$2><b>RESPONSABILITÉ</b></td>\r\n<td$3><b>HORIZON TEMPOREL</b></td>\r\n</tr>\r\n<tr>\r\n<td$10>1.', $this->code, -1, $n);\r\n\t\t$this->code = preg_replace('/<tr>\\s*<td([^<>]*)>\\s*<b>ACTIVITÉS<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>RESPONSABILITÉ<\\/b>\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>HORIZON<\\/b>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*<b>TEMPOREL<\\/b>\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<td([^<>]*)>\\s*&nbsp;\\s*<\\/td>\\s*<\\/tr>\\s*<tr>\\s*<td([^<>]*)>\\s*1\\./', '</table>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tr>\r\n<td$1 colspan=\"2\"><b>ACTIVITÉS</b></td>\r\n<td$2><b>RESPONSABILITÉ</b></td>\r\n<td$3><b>HORIZON TEMPOREL</b></td>\r\n</tr>\r\n<tr>\r\n<td$9>1.', $this->code, -1, $o);\t\t\r\n\t\t}\r\n\t\t//$this->code = preg_replace('/<span\\s*>/', '', $this->code, -1, $p);\r\n\t\t$this->code = preg_replace('/<tr height=\"0\">.*?<\\/tr>/', '', $this->code, -1, $q);\r\n\t\t\r\n\t\t$this->logMsgIf(\"clean_rtf_from_jade_tables\", $c + $d + $e + $f + $g + $h + $i + $j + $k + $l + $m + $n + $o + $p + $q);\r\n\t}", "function sloodle_clean_for_output($str)\n {\n return sloodle_strip_new_lines(strip_tags(stripcslashes(@html_entity_decode($str, ENT_QUOTES, 'UTF-8'))));\n }", "function rewrapHTMLCallback($match) {\n $width = 80;\n $break = '<span class=\"allowWrap\"> </span>';\n $words = preg_split('~(\\r\\n|\\n\\r|[\\r\\n\\s])~', $match[2]);\n $systemIncludePath = dirname(dirname(__FILE__));\n if (is_array($words)) {\n $result = '';\n foreach ($words as $word) {\n if (0 === strpos($word, PAPAYA_INCLUDE_PATH)) {\n $partWord = substr($word, strlen(PAPAYA_INCLUDE_PATH));\n if (papaya_strings::strlen($partWord) > $width) {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>/'.\n wordwrap($partWord, $width, $break, TRUE);\n } else {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>/'.$partWord;\n }\n } elseif (isset($_SERVER['DOCUMENT_ROOT']) &&\n 0 === strpos($word, $_SERVER['DOCUMENT_ROOT'])) {\n $partWord = substr($word, strlen($_SERVER['DOCUMENT_ROOT']));\n if (substr($_SERVER['DOCUMENT_ROOT'], -1) == '/') {\n $addSlash = '/';\n } else {\n $addSlash = '';\n }\n if (papaya_strings::strlen($partWord) > $width) {\n $result .= ' <em>{DOCUMENT_ROOT}</em>'.$addSlash.\n wordwrap($partWord, $width, $break, TRUE);\n } else {\n $result .= ' <em>{DOCUMENT_ROOT}</em>'.$addSlash.$partWord;\n }\n } elseif (0 === strpos($word, $systemIncludePath)) {\n $partWord = substr($word, strlen($systemIncludePath));\n if (papaya_strings::strlen($partWord) > $width) {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>'.\n wordwrap($partWord, $width, $break, TRUE);\n } else {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>'.$partWord;\n }\n } elseif (papaya_strings::strlen($word) > $width) {\n $result .= ' '.wordwrap($word, $width, $break, TRUE);\n } else {\n $result .= ' '.$word;\n }\n }\n return $match[1].substr($result, 1);\n } else {\n return $match[0];\n }\n }", "function compare_title($a, $b) \n{ \n if (($a[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG) && ($b[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG))\n return strnatcmp($a[$GLOBALS['MYFIELDS'][1]], $b[$GLOBALS['MYFIELDS'][1]]);\n if ($a[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG)\n return 1;\n if ($b[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG)\n return -1;\n \n return strcmp_from_utf8($a[$GLOBALS['MYFIELDS'][1]], $b[$GLOBALS['MYFIELDS'][1]]); \n}", "function check_file($file, $file_cnt)\n {\n // The information is contained in these global arrays and vars\n global $miss_file, $miss_tag, $lang, $docdir, $r_alert, \n $s_alert, $t_alert, $maintainer, $cvs_opt;\n\n // Translated file name check\n $t_file = preg_replace( \"'^\".$docdir.\"en/'\", $docdir.$lang.\"/\", $file );\n if (!file_exists($t_file)) {\n $miss_file[] = array(substr($t_file, strlen($docdir)+strlen($lang)), \n round(filesize($file)/1024, 1));\n return FALSE;\n }\n\n // Get translated files tag, with maintainer if needed\n if (empty($maintainer))\n $t_tag = get_tag($t_file, \"\\\\S*\");\n else\n $t_tag = get_tag($t_file, $maintainer);\n\n // No tag found\n if (count($t_tag) == 0) {\n $miss_tag[] = substr($t_file, strlen($docdir));\n return FALSE;\n }\n\n // Storing values for further processing\n $maint = $t_tag[2];\n $en_rev = get_tag($file);\n\n // Make diff link if the revision is not n/a\n $t_td = substr($t_file, strlen($docdir)+strlen($lang)+1);\n if (is_numeric($t_tag[1])) {\n $r_diff = intval($en_rev) - intval($t_tag[1]);\n $t_rev = \"1.\".$t_tag[1];\n if ($r_diff != 0) {\n $t_td = \"<a href=\\\"http://cvs.php.net/diff.php/\".\n preg_replace( \"'^\".$docdir.\"'\", \"phpdoc/\", $file ).\n \"?r1=1.$t_tag[1]&r2=1.$en_rev$cvs_opt\\\">$t_td</a>\";\n }\n } else {\n $r_diff = $t_rev = $t_tag[1];\n }\n\n // Compute sizes, times and diffs\n $en_size = intval(filesize($file) / 1024);\n $t_size = intval(filesize($t_file) / 1024);\n $s_diff = intval($en_size) - intval($t_size);\n $en_date = intval((time() - filemtime($file)) / 86400);\n $t_date = intval((time() - filemtime($t_file)) / 86400);\n $t_diff = $en_date - $t_date;\n\n // Taging actuality of files with colors\n if ($r_diff === 0) {\n $col = \"#68D888\";\n } elseif ($r_diff == \"n/a\") {\n $col = \"#f4a460 class=hl\";\n } elseif ($r_diff >= $r_alert || $s_diff >= $s_alert || $t_diff <= $t_alert) {\n $col = \"#ff0000 class=hl\";\n } else {\n $col =\"#eee8aa\";\n }\n\n // Write out directory headline\n if ($file_cnt == 0) {\n $display_dir = preg_replace(\"'($docdir)(.+)/[^/]*$'\", \"\\\\2/\", $t_file);\n print(\"<tr><th colspan=12 height=3 bgcolor=#666699>$display_dir</th></tr>\");\n }\n \n // Write out the line for the file into the file\n print(\"<tr>\\n <td bgcolor=$col>$t_td</td>\\n\".\n \" <td bgcolor=$col> 1.$en_rev</td><td bgcolor=$col> $t_rev</td>\\n\".\n \" <td bgcolor=$col align=right><b>$r_diff</b> &nbsp;</td>\\n\".\n \" <td bgcolor=$col align=right>$en_size &nbsp;</td>\\n\".\n \" <td bgcolor=$col align=right>$t_size &nbsp;</td>\\n\".\n \" <td bgcolor=$col align=right><b>$s_diff</b> &nbsp;</td>\\n\".\n \" <td bgcolor=$col align=right>$en_date &nbsp;</td>\\n\".\n \" <td bgcolor=$col align=right>$t_date &nbsp;</td>\\n\".\n \" <td bgcolor=$col align=right><b>$t_diff</b> &nbsp;</td>\\n\".\n \" <td bgcolor=$col align=center>$maint</td>\\n\".\n \" <td bgcolor=$col align=center>$t_tag[3]</td>\\n</tr>\\n\");\n return TRUE;\n }", "public function helperText()\n {\n return \"\";\n }", "public function render()\n\t{\n\t\t$changes = parent::render();\n\t\t$html = '';\n\t\tif(empty($changes)) {\n\t\t\treturn $html;\n\t\t}\n\n\t\t$html .= '<table class=\"Differences DifferencesInline\">';\n\t\t$html .= '<thead>';\n\t\t$html .= '</thead>';\n\t\tforeach($changes as $i => $blocks) {\n\t\t\t// If this is a separate block, we're condensing code so output ...,\n\t\t\t// indicating a significant portion of the code has been collapsed as\n\t\t\t// it is the same\n\t\t\tif($i > 0) {\n\t\t\t\t$html .= '<tbody class=\"Skipped\">';\n\t\t\t\t$html .= '<th>&hellip;</th>';\n\t\t\t\t$html .= '<th>&hellip;</th>';\n\t\t\t\t$html .= '<td>&#xA0;</td>';\n\t\t\t\t$html .= '</tbody>';\n\t\t\t}\n\n\t\t\tforeach($blocks as $change) {\n\t\t\t\t$html .= '<tbody class=\"Change'.ucfirst($change['tag']).'\">';\n\t\t\t\t// Added lines only on the right side\n\t\t\t\tif($change['tag'] == 'insert') {\n\t\t\t\t\tforeach($change['changed']['lines'] as $no => $line) {\n\t\t\t\t\t\t$html .= '<tr>';\n\t\t\t\t\t\t$html .= '<td class=\"Right\"><ins>'.$line.'</ins>&#xA0;</td>';\n\t\t\t\t\t\t$html .= '</tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Show deleted lines only on the left side\n\t\t\t\telse if($change['tag'] == 'delete') {\n\t\t\t\t\tforeach($change['base']['lines'] as $no => $line) {\n\t\t\t\t\t\t$html .= '<tr>';\n\t\t\t\t\t\t$html .= '<td class=\"Left\"><del>'.$line.'</del>&#xA0;</td>';\n\t\t\t\t\t\t$html .= '</tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Show modified lines on both sides\n\t\t\t\telse if($change['tag'] == 'replace') {\n\t\t\t\t\tforeach($change['base']['lines'] as $no => $line) {\n\t\t\t\t\t\t$html .= '<tr>';\n\t\t\t\t\t\t$html .= '<td class=\"Left\"><span>'.$line.'</span></td>';\n\t\t\t\t\t\t$html .= '</tr>';\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach($change['changed']['lines'] as $no => $line) {\n\t\t\t\t\t\t$html .= '<tr>';\n\t\t\t\t\t\t$html .= '<td class=\"Right\"><span>'.$line.'</span></td>';\n\t\t\t\t\t\t$html .= '</tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$html .= '</tbody>';\n\t\t\t}\n\t\t}\n\t\t$html .= '</table>';\n\t\treturn $html;\n\t}", "protected function failureDescription($other) {\n $thisVal = $this->normalize($this->value);\n $otherVal = $this->normalize($other);\n\n $len = min(strlen($thisVal),strlen($otherVal));\n\n for($i=0; $i<$len; ++$i) {\n if($thisVal[$i] !== $otherVal[$i]) {\n break;\n }\n }\n\n $start = max($i-25,0);\n $offset = min($i,25);\n $t = substr($thisVal,$start,50);\n $o = substr($otherVal,$start,50);\n\n return \"two strings are equal, ignoring whitespace and case\\n\"\n . \"- $t\\n\"\n . ' '.str_repeat(' ',$offset). \"^\\n\"\n . \"+ $o\";\n }", "function diff($from_lines, $to_lines)\n {\n }", "public function diff()\n\t{\n\t\tif (is_uploaded_file(self::$_files['attachment']['tmp_name'])) \n\t\t{\n\t\t\t$filedump = $this->m->getDumpFromFile(self::$_files['attachment']['tmp_name']);\n\t\t\t$dbdump = $this->m->getDumpFromDb();\n\t\t\t\n\t\t\t$this->v->displaySQL($dbdump, $filedump);\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$this->v->script = 'File not uploaded';\n\t\t\t$this->v->display('dbdiff');\n\t\t}\n\t}", "public function testCompareContents(): void\n {\n ob_start();\n include dirname(TEST_ROOT_PATH) . '/script/make-readme.php';\n $producedContents = ob_get_contents();\n ob_end_clean();\n\n assert(is_string($producedContents));\n\n if ($this->contents !== $producedContents) {\n $differ = new Differ();\n\n throw new \\RuntimeException(sprintf(\n implode('', [\n 'README.md is not up–to-date. Please run: php script/make-readme.php.',\n ' The diff is:\\n\\n%s',\n ]),\n $differ->diff($this->contents, $producedContents),\n ));\n }\n\n $this->assertTrue(true);\n }", "function preFilterText($text)\r\n{\r\n\t// Make sure the submitted text isn't too long\r\n\t// This shouldn't affect valid URLs as AutoLinks\r\n\tif (strlen($text) > LACE_MAX_TEXT_LENGTH)\r\n\t\t$text = mb_substr($text, 0, LACE_MAX_TEXT_LENGTH);\r\n\r\n\t// Wrap long lines if there are more than 35 characters\r\n\t// and less than three spaces.\r\n\tif (strlen($text) > 35 && substr_count($text, ' ') < 3)\r\n\t\t$text = real_wordwrap($text, 35, ' ');\r\n\r\n \t// Filter the contents of <code> tags so that lib_filter\r\n \t// doesn't interfere with them.\r\n\t$text = codeTagFilter($text);\r\n\r\n\t// Add rel attribute to links\r\n\tif (strpos($text, '<a') !== false && strpos($text, '<a rel=') === false)\r\n\t\t$text = str_replace('<a ', '<a rel=\"external\" ', $text);\r\n\r\n\t// First pass at attempting to fix number comparisons before\r\n\t// lib_filter can munge them.\r\n\t//\r\n\t// Input Output\r\n\t// 800<=1000 800 &lt;= 1000\r\n\t// 400> 200 400 &gt; 200\r\n\t// 100 <>500 100 &lt;&gt; 500\r\n\t// etc...\r\n\t$pattern = '%(\\d)\\s*([<>=]{1,2})\\s*(\\d)%se';\r\n\t$replace = \"'\\\\1'.htmlentities(' \\\\2 ').'\\\\3'\";\r\n\t$text = preg_replace($pattern, $replace, $text);\r\n\r\n\t// Replace all orphaned < and > characters with entities to keep\r\n\t// lib_filter from hosing them...\r\n\t// And, sorry, Lace uses pipes as delimiters - broken vertical bar for you!\r\n\t$search = array(' < ', ' > ', '|');\r\n\t$replace = array(' &lt; ', ' &gt; ', '&brvbar;');\r\n\t$text = str_replace($search, $replace, $text);\r\n\r\n\t// Replace all mid-message newlines with <br> tags\r\n\t// Currently, this break large blocks of code within\r\n\t// <code> tags...\r\n\t$text = str_replace(\"\\n\", '<br>', $text);\r\n\r\n\t// Replace all <br /> tags with <br> tags\r\n\t$text = str_replace('<br />', '<br>', $text);\r\n\r\n\t// Reduce groups of 3 <br> tags to just 2\r\n\twhile(strpos($text, '<br><br><br>') !== false)\r\n\t{\r\n\t\t$text = str_replace('<br><br><br>', '<br><br>', $text);\r\n\t}\r\n\r\n\treturn $text;\r\n}", "function testBugInternal1() \n {\n $sText = <<<SCRIPT\n<?php\n\\$a = <<<HEREDOC\nsdsdsds\nHEREDOC;\n?>\nSCRIPT;\n $this->setText($sText);\n $sActual = $this->oBeaut->get();\n $this->assertTrue(preg_match(\"/HEREDOC;\\n\\s*?\\?>/ms\", $sActual));\n }", "function checkBlock($name, $display, $source, $newStr = '')\r\n\t{\r\n \tif ($display) {\r\n \t\t$after_replace = '\\\\1';\r\n \t} else {\r\n \t $after_replace = $newStr;\r\n \t}\r\n \t//return eregi_replace(\"\\{\".$name.\"\\}([^\\[]+)\\{/\".$name.\"\\}\", $after_replace, $source);\r\n \t//return preg_replace('/{'.$name.'}(.*?){\\/'.$name.'}/si', $after_replace, $source);\r\n\t $source = str_replace('$','&#36;',$source);\r\n\t return preg_replace(\"/{\".$name.\"}(.*?){\\/\".$name.\"}/si\", $after_replace, $source);\r\n\t}", "public function __construct($packageID = 0, $patchFileString = '', $reverse = false, $rePatch = false, $templateID = 0, $type = '', $fuzzFactor = 0) {\n\t\tif ($patchFileString) {\n\t\t\t$this->packageID = $packageID;\n\t\t\t$this->reverse = $reverse;\n\t\t\t$this->rePatch = $rePatch;\n\t\t\t$this->templateID = $templateID;\n\t\t\t$this->type = $type;\n\t\t\t$this->fuzzFactor = $fuzzFactor;\n\t\t\t\n\t\t\t// read the diff string into an array.\n\t\t\t$lines = preg_split('/\\r?\\n|\\r/', $patchFileString);\n\t\t\t\n\t\t\t// make sure to remove an eventual BOM at the very beginning of UTF-8 encoded files.\n\t\t\t// further care about the patchfile's encoding is not needed because we are only \n\t\t\t// patching templates here which consist of ascii characters only.\n\t\t\t$lines['0'] = FileUtil::stripBoms($lines['0']);\n\t\t\t\n\t\t\tif ($this->rePatch === false && $this->reverse === false) {\n\t\t\t\t// needed for checking if there are successive files to be patched within this diff.\n\t\t\t\t// there is no sufficient \"official\" specification about how the format of the header lines\n\t\t\t\t// in a unified diff has to be, so we take into account practice and this web resource:\n\t\t\t\t// http://www.artima.com/weblogs/viewpost.jsp?thread=164293\n\t\t\t\t// unfortunately some non-GNU versions of patch do not respect the format mentioned above,\n\t\t\t\t// therefore a relatively simple regex is being used (we cannot check something we don't know\n\t\t\t\t// how it actually looks).\n\t\t\t\t$this->regexCheckFile = \"%^([ ]*[\\-|\\+]{3}[ ])([\\w\\./\\\\\\\\]+)%\";\n\t\t\t\t\n\t\t\t\t// lines at the beginning that are neither context nor diff lines are being omitted.\n\t\t\t\tforeach ($lines as $key => $line) {\n\t\t\t\t\tif ($line == '' || !((preg_match($this->regexCheckFile, $line, $result) == 1) && (preg_match($this->regexCheckFile, $lines[$key + 1], $result) == 1))) {\n\t\t\t\t\t\tunset($lines[$key]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// remember positions where consecutive patches start.\n\t\t\t\t$lines = array_values($lines);\n\t\t\t\t$diffStarts = array();\n\t\t\t\t$i = 0;\n\t\t\t\tforeach ($lines as $key => $line) {\n\t\t\t\t\tif ((preg_match($this->regexCheckFile, $line, $result) == 1) && (preg_match($this->regexCheckFile, $lines[$key + 1], $result) == 1)) {\n\t\t\t\t\t\t$diffStarts[] = $key;\n\t\t\t\t\t\t$this->patch[$i]['patch'] = array();\n\t\t\t\t\t\tarray_push($this->patch[$i]['patch'], $line);\n\t\t\t\t\t\tarray_push($this->patch[$i]['patch'], $lines[$key + 1]);\n\t\t\t\t\t\tarray_push($this->garbage, $line);\n\t\t\t\t\t\tarray_push($this->garbage, $lines[$key + 1]);\n\t\t\t\t\t\t$i = $i + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// if our diff contains more than one patch which means that there is more than one\n\t\t\t// file to be patched), we will split $lines into separate arrays where every array\n\t\t\t// contains the respective patch which is to be applied to the respective target file.\n\t\t\tif (($this->rePatch === true) || ($this->reverse === true) || (count($diffStarts) == 1)) {\n\t\t\t\t// if it's only one patch, we go ahead and attempt to apply it.\n\t\t\t\t$this->lines = $lines;\n\t\t\t\t$this->checkDiffType(0);\n\t\t\t} else {\n\t\t\t\t// add the end of the last patch within this diff to the $diffStarts array.\n\t\t\t\t$diffStarts[] = count($lines) + 1;\n\t\t\t\t// split the original array into the respective patches.\n\t\t\t\t$i = 0;\n\t\t\t\tforeach ($diffStarts as $key => $diffStart) {\n\t\t\t\t\tif ($diffStart < count($lines)) {\n\t\t\t\t\t\t$this->lines = array_slice($lines, $diffStart, $diffStarts[$key + 1] - $diffStart);\n\t\t\t\t\t}\n\t\t\t\t\t// start processing each patch.\n\t\t\t\t\t$this->garbage = array();\n\t\t\t\t\t$this->originalFile = '';\n\t\t\t\t\t$this->targetPosition = 0;\n\t\t\t\t\tif (count($this->lines)) {\n\t\t\t\t\t\t$this->checkDiffType($i);\n\t\t\t\t\t\t$i = $i + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// delete reversed patches from database.\n\t\t\tif (($this->rePatch === false) && ($this->reverse === true)) {\n\t\t\t\t$this->deletePatch();\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\tthrow new TemplatePatchException(\"No diff string has been given.\", 20000);\n\t\t}\n\t}", "function string_restore_valid_html_tags( $p_string, $p_multiline = true ) \r\n{\r\n\t$t_html_valid_tags = config_get( $p_multiline ? 'html_valid_tags' : 'html_valid_tags_single_line' );\r\n\r\n\tif ( OFF === $t_html_valid_tags || is_blank( $t_html_valid_tags ) ) {\r\n\t\treturn $p_string;\r\n\t}\r\n\r\n\t$tags = explode( ',', $t_html_valid_tags );\r\n\tforeach ($tags as $key => $value) \r\n\t{ \r\n \tif ( !is_blank( $value ) ) {\r\n \t$tags[$key] = trim($value); \r\n }\r\n }\r\n $tags = implode( '|', $tags);\r\n\r\n\t$p_string = preg_replace( '/&lt;(' . $tags . ')\\s*&gt;/ui', '<\\\\1>', $p_string );\r\n\t$p_string = preg_replace( '/&lt;\\/(' . $tags . ')\\s*&gt;/ui', '</\\\\1>', $p_string );\r\n\t$p_string = preg_replace( '/&lt;(' . $tags . ')\\s*\\/&gt;/ui', '<\\\\1 />', $p_string );\r\n\r\n\r\n\treturn $p_string;\r\n}", "function horse_thatbooks_misc_cleanup( $output ) {\n\t// MANGLED LINK SHORTENERS\n\t$botched_url_snippets = array(\n\t\t'/tco/' => '/t.co/'\n\t);\n\n\tforeach( $botched_url_snippets as $bus => $r ) {\n\t\t$output = str_replace( $bus, $r, $output );\n\t}\n\n\t// HTML ENTITIES\n\t$output = htmlspecialchars_decode( $output );\n\n\t// BEGINNINGS OF STRINGS\n\t// The only non-alphanumeric character allowed at the beginning of strings is a dot, when\n\t// followed immediately by an @\n\tpreg_match( '/^[a-zA-Z@0-9]/', $output, $matches );\n\tif ( empty( $matches ) ) {\n\t\tswitch ( substr( trim( $output ), 0, 1 ) ) {\n\t\t\tcase '.' :\n\t\t\t\tif ( '@' == substr( trim( $output ), 1, 1 ) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// else fall through\n\n\t\t\tdefault :\n\t\t\t\t$output = trim( substr( trim( $output ), 1 ) );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn $output;\n}", "function cleanLeftoverJunk(&$string)\n\t{\n\t\t$string = preg_replace('#<\\!-- (START|END): SRC_[^>]* -->#', '', $string);\n\n\t\tif (strpos($string, $this->src_params->tag_character_start . '/' . $this->src_params->syntax_word) === false)\n\t\t{\n\t\t\t$this->unprotectTags($string);\n\n\t\t\treturn;\n\t\t}\n\n\t\t$regex = $this->src_params->regex;\n\t\tif (@preg_match($regex . 'u', $string))\n\t\t{\n\t\t\t$regex .= 'u';\n\t\t}\n\n\t\t$string = preg_replace(\n\t\t\t$regex,\n\t\t\t'<!-- ' . JText::_('SRC_COMMENT') . ': ' . JText::_('SRC_CODE_REMOVED_NOT_ENABLED') . ' -->',\n\t\t\t$string\n\t\t);\n\n\t\t$this->unprotectTags($string);\n\t}", "public function test_gc_replace_in_html_tags( $input, $output ) {\n\t\treturn $this->assertSame( $output, gc_replace_in_html_tags( $input, array( \"\\n\" => ' ' ) ) );\n\t}", "public function testEmptyString2()\n {\n $string1 = $this->randomString(rand(5, 10));\n\n $percent1 = 0;\n $percent2 = 0;\n\n $this->assertEquals(\n similar_text($string1, '', $percent1),\n mb_similar_text($string1, '', $percent2)\n );\n\n $this->assertEquals($percent1, $percent2);\n }", "private function renderDiff($lines1, $lines2): string\n {\n if (!is_array($lines1)) {\n $lines1 = explode(\"\\n\", $lines1);\n }\n if (!is_array($lines2)) {\n $lines2 = explode(\"\\n\", $lines2);\n }\n foreach ($lines1 as $i => $line) {\n $lines1[$i] = rtrim($line, \"\\r\\n\");\n }\n foreach ($lines2 as $i => $line) {\n $lines2[$i] = rtrim($line, \"\\r\\n\");\n }\n\n $renderer = new DiffRendererHtmlInline();\n $diff = new Diff($lines1, $lines2);\n\n return $diff->render($renderer);\n }", "public function diff()\n {\n return trim(implode(\"\\n\", $this->git('diff')));\n }", "function markdown_pre_typo($texte){\n\treturn $texte;\n}", "private static function minify($html) {\n\t\tif(!modules::get_config('tpl_minifier')) {\n\t\t\treturn $html;\n\t\t}\n\t\t// TODO: Match <code> and <pre> too - in separate arrays\n\t\tpreg_match_all('/(<script[^>]*?>.*?<\\/script>)/si', $html, $pre);\n\t\tpreg_match_all('/(<textarea[^>]*?>.*?<\\/textarea>)/si', $html, $textarea);\n\t\t$i=0;\n\t\twhile(preg_match('/(<script[^>]*?>.*?<\\/script>)/si', $html)) {\n\t\t\t$html = preg_replace('/(<script[^>]*?>.*?<\\/script>)/si', '#pre'.$i.'#', $html, 1);\n\t\t\t$i++;\n\t\t}\n\t\t$i=0;\n\t\twhile(preg_match('/(<textarea[^>]*?>.*?<\\/textarea>)/si', $html)) {\n\t\t\t$html = preg_replace('/(<textarea[^>]*?>.*?<\\/textarea>)/si', '#textarea'.$i.'#', $html, 1);\n\t\t\t$i++;\n\t\t}\n\t\t$html = preg_replace('#<!-[^\\[].+?->#', '', $html);//ToDo: WTF?!\n\t\t$html = preg_replace('/[\\r\\n\\t]+/', ' ', $html);\n\t\t$html = preg_replace('/>[\\s]*</', '><', $html); // Strip spacechars between tags\n\t\t$html = preg_replace('/[\\s]+/', ' ', $html); // Replace several spacechars with one space\n\t\tif(!empty($pre[0])) {\n\t\t\t$i=0;\n\t\t\tforeach($pre[0] as $tag) {\n\t\t\t\t$tag = preg_replace('/^\\ *\\/\\/[^\\<]*?$/m', ' ', $tag); // Strips comments - except those that contains HTML comment inside\n\t\t\t\t$tag = preg_replace('/[\\ \\t]{2,}/', ' ', $tag); // Replace several spaces by one\n\t\t\t\t$tag = preg_replace('/\\s{2,}/', \"\\r\\n\", $tag); // Replace several linefeeds by one\n\t\t\t\t$html = preg_replace('/#pre'.$i.'#/', $tag, $html, 1);\n\t\t\t\tunset($pre[0][$i]);\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\tif(!empty($textarea[0])) {\n\t\t\t$i=0;\n\t\t\tforeach($textarea[0] as $tags) {\n\t\t\t\t$tags = preg_replace('/^\\ *\\/\\/[^\\<]*?$/m', ' ', $tags);\n\t\t\t\t$tags = preg_replace('/[\\ \\t]{3,}/', ' ', $tags);\n\t\t\t\t$html = preg_replace('/#textarea'.$i.'#/', $tags, $html, 1);\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\treturn $html;\n\t}", "public function testHighlightNoMatch()\n {\n $str = 'The quick brown fox jumps over the dog.';\n $this->assertEquals($str, $this->helper->highlight($str, 'black'));\n }" ]
[ "0.6367125", "0.62404084", "0.6216445", "0.618392", "0.59367263", "0.588464", "0.58702266", "0.5829656", "0.580066", "0.5792969", "0.57221717", "0.5652708", "0.5611527", "0.5563281", "0.55473584", "0.55318266", "0.5486468", "0.5446819", "0.5445218", "0.5443194", "0.5425905", "0.5410811", "0.5378824", "0.53700936", "0.53020626", "0.5292655", "0.5277255", "0.52614915", "0.52522296", "0.52371734", "0.52308637", "0.52121603", "0.52100706", "0.51692295", "0.51663303", "0.51586306", "0.5139231", "0.51344395", "0.5082442", "0.5080886", "0.5080356", "0.50786114", "0.50608", "0.5045898", "0.502098", "0.5014661", "0.50129366", "0.5000046", "0.49997407", "0.4996793", "0.49855974", "0.49752238", "0.49318647", "0.49313024", "0.49290887", "0.49255556", "0.4920635", "0.49146748", "0.4911057", "0.48836792", "0.48808143", "0.48785225", "0.48765716", "0.48752508", "0.4869656", "0.4862845", "0.4861749", "0.48552066", "0.48507988", "0.48441085", "0.48413944", "0.48397398", "0.48359206", "0.48355776", "0.48342645", "0.48303524", "0.48293877", "0.4829148", "0.48274282", "0.48229432", "0.4816422", "0.48143232", "0.481392", "0.48045638", "0.480032", "0.47999108", "0.47994798", "0.47983676", "0.47952238", "0.479418", "0.47941345", "0.47891754", "0.47870016", "0.4784062", "0.47779295", "0.47755522", "0.47748083", "0.47747242", "0.47682005", "0.47628915" ]
0.7464799
0
Dumps the variable to the browser
function dump() { $args = func_get_args(); echo '<div style="background-color: pink; margin: 3px;">'; foreach($args as $arg) { echo "<p><pre>"; var_dump($arg); echo "</pre></p>"; } echo '</div>'; return @$args[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dump($variable) {}", "public static function dump($var) {\n self::$dumped .= print_r($var, TRUE) . \"<br><br>\";\n self::$dumped = htmlspecialchars(self::$dumped);\n }", "public function dump() {}", "public function dump();", "public function dump();", "function dumpvar($mixed)\n\t\t{\n\t\t\t$this->vardump($mixed);\n\t\t}", "function sdump($var)\n{\n ob_start();\n var_dump($var);\n $out = ob_get_contents();\n ob_end_clean();\n return $out;\n}", "function grab_dump($var)\n{\n ob_start();\n var_dump($var);\n return ob_get_clean();\n}", "function dump($var) {\n\t\t\techo '<pre>';\n\t\t\tvar_dump($var);\n\t\t\techo '</pre>';\n\t\t}", "public static function dump($variable) {\n echo '<pre>';\n var_dump($variable);\n echo '</pre>';\n }", "public static function dump()\n\t{\n\t\techo nl2br(print_r(self::$data));\n\t}", "function dumpvar($mixed)\n\t\t{\n\t\t\treturn $this->vardump($mixed);\n\t\t}", "function dump($var)\n {\n util::dump($var);\n }", "function dump($variable)\n {\n echo '<pre>';\n print_r($variable);\n }", "public function to_browser() {\n\t\techo $this->to_string();\n\t}", "function varDumpToString ($var) {\n echo __FUNCTION__ . \"\\n\";\n ob_start();\n var_dump($var);\n $result = ob_get_clean();\n return $result;\n}", "public static function var_dump_to_var($mixed): string\n {\n ob_start();\n var_dump($mixed);\n $r = ob_get_clean();\n\n return $r;\n }", "function dump() {\r\n\t\treturn $this->_send(array('cmd'=>'dump'));\r\n\t}", "function Dump()\n {\n echo \"<pre>\" . htmlspecialchars($this->ToString()) . \"</pre>\";\n }", "public function __toString() {\n // This is a neat way to get save the output of var_dump to a string \n // instead of printing it immediately\n ob_start();\n var_dump($this);\n $value = ob_get_contents();\n ob_end_clean();\n \n return $value;\n }", "private static function varDumpToString ($var)\n {\n ob_start();\n var_dump($var);\n $result = ob_get_clean();\n return $result;\n }", "public function dump() {\n @var_dump($this->get, $this->post, $this->server, $this->files);\n }", "public static function dump($var)\n {\n echo \"<pre>\" . htmlentities(print_r($var, true)) . \"</pre>\";\n }", "function dump ( $value )\n{\n if ( \\r8\\Env::request()->isCLI() ) {\n var_dump( $value );\n }\n else {\n echo \"<pre>\";\n var_dump( $value );\n echo \"</pre>\";\n }\n}", "protected static function debugDump($var)\n {\n ob_start();\n var_dump($var);\n $output = ob_get_contents();\n ob_end_clean();\n return $output;\n }", "function pr($var) {\n\t\t\t\n\t\t\tob_start();\n\t\t\tprint_r($var);\n\t\t\t$content = ob_get_contents();\n\t\t\tob_clean();\n\t\t\t\n\t\t\techo \"<pre>\";\n\t\t\techo htmlentities($content);\n\t\t\techo \"</pre>\";\n\t}", "function dump($var)\n{\n echo '<pre>';\n var_dump($var);\n echo '</pre>';\n}", "public function dump()\n {\n var_dump($this); exit;\n }", "public function out($var){\n\t\t\techo \"<br><br><pre>\";\n\t\t\tprint_r($var);\n\t\t\techo \"</pre><br><br>\";\n\t\t}", "public function out($var){\n\t\t\techo \"<br><br><pre>\";\n\t\t\tprint_r($var);\n\t\t\techo \"</pre><br><br>\";\n\t\t}", "public static function dump(mixed $value) {\n if (!request()->isCli() && class_exists(CliDumper::class)) {\n $dumper = in_array(PHP_SAPI, ['cli', 'phpdbg']) ? new CliDumper : new HtmlDumper;\n\n $dumper->dump((new VarCloner)->cloneVar($value));\n } else {\n var_dump($value);\n }\n }", "function elgg_dump($value, $to_screen = TRUE, $level = 'NOTICE') {\n\tglobal $CONFIG;\n\n\t// plugin can return false to stop the default logging method\n\t$params = array('level' => $level,\n\t\t\t\t\t'msg' => $value,\n\t\t\t\t\t'to_screen' => $to_screen);\n\tif (!trigger_plugin_hook('debug', 'log', $params, true)) {\n\t\treturn;\n\t}\n\n\t// Do not want to write to screen before page creation has started.\n\t// This is not fool-proof but probably fixes 95% of the cases when logging\n\t// results in data sent to the browser before the page is begun.\n\tif (!isset($CONFIG->pagesetupdone)) {\n\t\t$to_screen = FALSE;\n\t}\n\n\tif ($to_screen == TRUE) {\n\t\techo '<pre>';\n\t\tprint_r($value);\n\t\techo '</pre>';\n\t} else {\n\t\terror_log(print_r($value, TRUE));\n\t}\n}", "private function dump($data){\n var_dump($data);\n }", "public function dump()\n {\n $this->_domDocument->formatOutput = true;\n echo $this->_domDocument->saveXML();\n }", "public static function var_dump( $data )\n {\n // get the var_dump string by buffering the output\n ob_start();\n var_dump( $data );\n return ob_get_clean();\n }", "public static function vdump($variable) {\r\n\t\t$dump = '';\r\n\t\tif(Debug::enabled()) {\r\n\t\t\tif(func_num_args() >= 1) {\r\n\t\t\t\tob_start();\r\n\t\t\t\techo \"<pre>\";\r\n\t\t\t\t$args = func_get_args();\r\n\t\t\t\t\r\n\t\t\t\t$count = count($args);\r\n\t\t\t\tfor($x = 0; $x < $count; $x++) {\r\n\t\t\t\t\tvar_dump($variable);\r\n\t\t\t\t}\r\n\t\t\t\techo Debug::getBackTrace('', 1, 'fdumped in');\r\n\t\t\t\techo \"\\n\\n\";\r\n\t\t\t\techo \"</pre>\"; \r\n\t\t\t\t$dump = ob_get_clean();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $dump;\r\n\t}", "function varDump($object) {\n\t\techo \"<pre>\";\n\t\tprint_r($object);\n\t\techo \"</pre>\";\n\t}", "public function dump($value)\n {\n if (class_exists(CliDumper::class)) {\n $dumper = 'cli' === PHP_SAPI ? new CliDumper : new HtmlVarDumper;\n\n $dumper->dump((new VarCloner)->cloneVar($value));\n\n unset($dumper);\n } else {\n var_dump($value);\n }\n\n unset($value);\n }", "protected function debugVar($var){\n \tob_start(); \n \t$this->debug(nl2br(ob_get_clean()));\n }", "function dumpJavascript()\r\n {\r\n\r\n echo \"var \" . $this->_getJavascriptVar() . \";\\n\";\r\n\r\n parent::dumpJavascript();\r\n\r\n }", "function var_dump_ret($mixed = null) {\r\n\t ob_start();\r\n\t var_dump($mixed);\r\n\t $content = ob_get_contents();\r\n\t ob_end_clean();\r\n\t return $content;\r\n\t}", "function vds($var): string{\n\tob_start();\n\tvar_dump($var);\n\t$str = ob_get_contents();\n\tif($str === false){\n\t\t$str = '';\n\t}\n\tob_end_clean();\n\treturn $str;\n}", "function dumpVar($var)\n\t{\n\t\tif (is_array($var) || is_object($var))\n\t\t\t$var = trim(preg_replace(\"/\\n */\", \" \", print_r($var, true)));\n\t\treturn htmlspecialchars($var, ENT_NOQUOTES);\n\t}", "public function MyVarDump($var, $exit = true){\r\n\t\techo '<pre style=\"font-size:15px;\">';\r\n\t\t\tvar_dump($var);\r\n\t\techo '</pre>';\r\n\t\tif($exit){exit;}\r\n\t}", "function dump($var)\n{\n echo '<br /><pre>';\n var_dump($var);\n echo'</pre><hr />';\n}", "function vardump($mixed='')\n\t\t{\n\n\t\t\t// Start outup buffering\n\t\t\tob_start();\n\n\t\t\techo \"<p><table><tr><td bgcolor=ffffff><blockquote><font color=000090>\";\n\t\t\techo \"<pre><font face=arial>\";\n\n\t\t\tif ( ! $this->vardump_called )\n\t\t\t{\n\t\t\t\techo \"<font color=800080><b>ezSQL</b> (v\".EZSQL_VERSION.\") <b>Variable Dump..</b></font>\\n\\n\";\n\t\t\t}\n\n\t\t\t$var_type = gettype ($mixed);\n\t\t\tprint_r(($mixed?$mixed:\"<font color=red>No Value / False</font>\"));\n\t\t\techo \"\\n\\n<b>Type:</b> \" . ucfirst($var_type) . \"\\n\";\n\t\t\techo \"<b>Last Query</b> [$this->num_queries]<b>:</b> \".($this->last_query?$this->last_query:\"NULL\").\"\\n\";\n\t\t\techo \"<b>Last Function Call:</b> \" . ($this->func_call?$this->func_call:\"None\").\"\\n\";\n\t\t\techo \"<b>Last Rows Returned:</b> \".count($this->last_result).\"\\n\";\n\t\t\techo \"</font></pre></font></blockquote></td></tr></table>\".$this->donation();\n\t\t\techo \"\\n<hr size=1 noshade color=dddddd>\";\n\n\t\t\t// Stop output buffering and capture debug HTML\n\t\t\t$html = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\t// Only echo output if it is turned on\n\t\t\tif ( $this->debug_echo_is_on )\n\t\t\t{\n\t\t\t\techo $html;\n\t\t\t}\n\n\t\t\t$this->vardump_called = true;\n\n\t\t\treturn $html;\n\n\t\t}", "function dump() {\n\t\t$vars = get_object_vars( $this );\n\t\techo '<pre style=\"text-align:left\">';\n\t\tforeach( $vars as $name => $value ) {\n\t\t\techo $name.': '.$value.\"\\n\";\n\t\t}\n\t\techo '</pre>';\n\t}", "public static function dump()\n {\n self::$arrBacktrace = array_shift(debug_backtrace());\n self::$strFunc = 'var_dump';\n $strDisplay = self::write();\n\n if (self::$isPretty && self::$end) {\n exit(self::displayHtmlBody());\n } elseif (self::$isPretty) {\n exit(self::displayHtmlBody());\n } elseif (self::$end) {\n exit($strDisplay);\n } else {\n echo $strDisplay;\n }\n\n return $strDisplay;\n }", "function base_deployVardump($vartodump,$filename){\n ob_flush();\n ob_start();\n var_dump($vartodump);\n file_put_contents($filename, ob_get_flush());\n ob_end_flush();\n}", "public function dumpUrl()\n {\n print $this->getSession()->getCurrentUrl().\"\\r\\n\";\n\n }", "function dump($var)\n{\n var_dump($var);\n return $var;\n}", "public static function var_export_to_var($mixed): string\n {\n return var_export($mixed, true);\n }", "function dump($variable)\n {\n // dump variable using some quick and dirty (albeit invalid) XHTML\n if (!$variable && !is_numeric($variable))\n print(\"Variable is empty, null, or not even set.\");\n else\n print(\"<pre>\" . print_r($variable, true) . \"</pre>\");\n\n // exit immediately so that we can see what we printed\n exit;\n }", "public static function dump()\n {\n $html = \"\";\n\n foreach( func_get_args() as $value )\n {\n $html .= \"<div style=\\\"background: #ffc; margin: 20px; padding: 20px;\\\"> \\n\";\n $html .= \" <pre> \\n\";\n $html .= \" \" . print_r( $value, true ) .\" \\n\";\n $html .= \" </pre> \\n\";\n $html .= \"</div> \\n\";\n }\n echo trim( $html );\n exit;\n }", "abstract function doDump();", "function d($var)\n{\n echo \"<style>pre.sf-dump .sf-dump-compact { display: inline !important; }</style>\";\n dd($var);\n}", "function atk_var_dump($a, $d=\"\")\n{\n\tob_start();\n\tvar_dump($a);\n\t$data = ob_get_contents();\n\tatkdebug(\"vardump: \".($d!=\"\"?$d.\" = \":\"\").\"<pre>\".$data.\"</pre>\");\n\tob_end_clean();\n}", "function deployVardump($vartodump,$filename){\n ob_flush();\n ob_start();\n var_dump($vartodump);\n file_put_contents($filename, ob_get_flush());\n ob_end_flush();\n}", "function dumpVarsToJS(){\n\tglobal $nric,$firstName,$lastName,$dob,$address1,$address2,$poCode,\n$homeNum,$handphoneNum,$email,$description;\n\tglobal $faID;\n\t\n\t$jscommand = \"<script type=\\\"text/javascript\\\">\";\n\t$jscommand .= \"nric='\".$nric.\"';\";\n\t$jscommand .= \"firstName='\".$firstName.\"';\";\n\t$jscommand .= \"lastName='\".$lastName.\"';\";\n\t$jscommand .= \"dob='\".$dob.\"';\";\n\t$jscommand .= \"address1='\".$address1.\"';\";\n\t$jscommand .= \"address2='\".$address2.\"';\";\n\t$jscommand .= \"poCode='\".$poCode.\"';\";\n\t$jscommand .= \"homeNum='\".$homeNum.\"';\";\n\t$jscommand .= \"handphoneNum='\".$handphoneNum.\"';\";\n\t$jscommand .= \"email='\".$email.\"';\";\n\t$jscommand .= \"description='\".$description.\"';\";\n\t\n\t$jscommand .= \"faID='\".$faID.\"';\";\n\t\n\t$jscommand .= \"</script>\";\n\techo $jscommand;\n}", "function dump ($var, $label = 'Dump', $echo = TRUE)\n{\n // Store dump in variable\n ob_start();\n var_dump($var);\n $output = ob_get_clean();\n\n // Add formatting\n $output = preg_replace(\"/\\]\\=\\>\\n(\\s+)/m\", \"] => \", $output);\n $output = '<pre style=\"background: #FFFEEF; color: #000; border: 1px dotted #000; padding: 10px; margin: 10px 0; text-align: left;\">' . $label . ' => ' . $output . '</pre>';\n\n // Output\n if ($echo == TRUE) {\n echo $output;\n }\n else {\n return $output;\n }\n}", "function dump ($var, $label = 'Dump', $echo = TRUE)\n {\n ob_start();\n var_dump($var);\n $output = ob_get_clean();\n \n // Add formatting\n $output = preg_replace(\"/\\]\\=\\>\\n(\\s+)/m\", \"] => \", $output);\n $output = '<pre style=\"background: #FFFEEF; color: #000; border: 1px dotted #000; padding: 10px; margin: 10px 0; text-align: left;\">' . $label . ' => ' . $output . '</pre>';\n \n // Output\n if ($echo == TRUE) {\n echo $output;\n }\n else {\n return $output;\n }\n }", "public function var_dump_ret($mixed = null)\n {\n ob_start();\n var_dump($mixed);\n $content = ob_get_contents();\n ob_end_clean();\n return \"<pre>\" . $content . \"</pre>\";\n }", "public function printResult() {\n $this->result->path = $this->getType() . 's/' . $this->getName() . '#tmp';\n\n // text/plain is used to support IE\n header('Cache-Control: no-cache');\n header('Content-Type: text/plain; charset=utf-8');\n\n print $this->getResult();\n }", "function vardump($x)\r\n{\r\n\tob_start();\r\n\tvar_dump($x);\r\n\t$str = ob_get_clean();\r\n\treturn strip_tags($str);\r\n}", "public static function dump() {\n self::_init();\n echo nl2br(print_r($_SESSION));\n }", "public static function exportVar($value): string\n {\n return static::getEncoder()->encode($value);\n }", "function debug( $var ) {\n print \"<pre>\";\n var_dump( $var );\n print \"</pre>\";\n }", "protected function dumpVar($var)\n {\n $data = $this->getCloner()->cloneVar($var);\n\n $res = fopen('php://memory', 'r+b');\n $dumper = new CliDumper($res);\n $dumper->setColors($this->output->isDecorated());\n $dumper->dump($data);\n $str = stream_get_contents($res, -1, 0);\n fclose($res);\n\n return $str;\n }", "function debugMe($var, $die = true, $asString = false) {\n if($asString) {\n ob_start();\n var_dump($var);\n $deb_content = ob_get_contents();\n ob_end_clean();\n return $deb_content;\n }\n echo \"<pre>\";\n var_dump($var);\n echo \"</pre>\";\n if($die) {\n die();\n }\n}", "public static function var_export($mixed): void\n {\n var_export($mixed, false);\n }", "public function PrintData() {\r\n echo \"\".\"<br/>\";\r\n echo $this->string_var.\"<br/>\";\r\n echo $this->int_var.\"<br/>\";\r\n }", "protected function dumpPage() {\n\t\tif ($this->_debugCatcher !== null) {\n\t\t\t$this->_debugCatcher->flush();\n\t\t}\n\n\t\t$this->_dumped = true;\n\t\tparent::dumpPage();\n\t}", "public function dump($die = false);", "function myVar_dump($var)\n{\n echo sprintf('<pre>%s</pre>', print_r($var, true));\n}", "public function __toString() {\n ob_start();\n extract($this->_vars);\n\n include $this->_viewFile;\n\n return ob_get_clean();\n }", "function debug ($value) {\n\t?>\n\t<pre style=\"margin: 1rem 0; padding: 1rem; background: #e4e4e4; border: 1px solid #ccc;\"><code> <?php var_dump($value) ?></code></pre>\n\t<?php\n}", "function dump2(&$variable, $info = false) {\n $backup = $variable;\n $variable = $seed = md5(uniqid() . rand());\n $variable_name = 'unknown';\n foreach ($GLOBALS as $key => $value) {\n if ($value === $seed) { $variable_name = $key; }\n }\n $variable = $backup;\n\n echo '<pre style=\"\n font: 9pt sans-serif;\n text-align: left;\n margin: 25px;\n display: block;\n background: white;\n color: black;\n border:1px solid #ccc;\n padding:5px;\n margin: 25px;\n font-size: 11px;\n line-height: 14px;\n \">';\n\n $info = ($info) ? $info : '$' . $variable_name;\n echo '<b style=\"color:red;\">' . $info . ':</b><br>';\n do_dump($variable, '$' . $variable_name);\n echo '<b style=\"color:red;\">End ' . $info . '</b></pre>';\n}", "private function printContent()\n {\n $deserialized = $this->getContent();\n var_dump($deserialized);\n }", "function vardump($mixed='')\n\t\t{\n\t\t\t// Start output buffering\n\t\t\tob_start();\n\n\t\t\techo \"<p><table><tr><td bgcolor=ffffff><blockquote><font color=000090>\";\n\t\t\techo \"<pre><font face=arial>\";\n\n\t\t\tif ( ! $this->vardump_called )\n\t\t\t{\n\t\t\t\techo \"<font color=800080><b>ezSQL</b> (v\".EZSQL_VERSION.\") <b>Variable Dump..</b></font>\\n\\n\";\n\t\t\t}\n\n\t\t\t$var_type = gettype ($mixed);\n\t\t\tprint_r(($mixed?$mixed:\"<font color=red>No Value / False</font>\"));\n\t\t\techo \"\\n\\n<b>Type:</b> \" . ucfirst($var_type) . \"\\n\";\n\t\t\techo \"<b>Last Query</b> [$this->num_queries]<b>:</b> \".($this->last_query?$this->last_query:\"NULL\").\"\\n\";\n\t\t\techo \"<b>Last Function Call:</b> \" . ($this->func_call?$this->func_call:\"None\").\"\\n\";\n\t\t\t\n\t\t\tif (count($this->all_func_calls)>1)\n\t\t\t{\n\t\t\t\techo \"<b>List of All Function Calls:</b><br>\"; \n\t\t\t\tforeach($this->all_func_calls as $func_string)\n\t\t\t\t\techo \" \" . $func_string .\"<br>\\n\";\n\t\t\t}\n\t\t\t\n\t\t\techo \"<b>Last Rows Returned:</b> \".(count($this->last_result)>0 ? $this->last_result : '').\"\\n\";\n\t\t\techo \"</font></pre></font></blockquote></td></tr></table>\".$this->donation();\n\t\t\techo \"\\n<hr size=1 noshade color=dddddd>\";\n\n\t\t\t// Stop output buffering and capture debug HTML\n\t\t\t$html = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\t// Only echo output if it is turned on\n\t\t\tif ( $this->debug_echo_is_on )\n\t\t\t{\n\t\t\t\techo $html;\n\t\t\t}\n\n\t\t\t$this->vardump_called = true;\t\t\t\n\t\t\treturn $html;\n\t\t}", "function var_show($var)\n{\n echo '<pre>';\n var_dump($var);\n echo '</pre>';\n}", "function dump($var, $label = 'Dump', $echo = true) {\n ob_start();\n var_dump($var);\n $output = ob_get_clean();\n\n // Add formatting\n $output = preg_replace(\"/\\]\\=\\>\\n(\\s+)/m\", '] => ', $output);\n $output = '<pre style=\"background: #FFFEEF; color: #000; border: 1px dotted #000; padding: 10px; margin: 10px 0; text-align: left;\">'.$label.' => '.$output.'</pre>';\n\n // Output\n if ($echo == true) {\n echo $output;\n } else {\n return $output;\n }\n }", "function dumpX($var)\n{\n dump($var);\n exit;\n}", "function dump($var, $name='') {\r\n}", "function dump() {\n\t\t\n\t\techo '<pre>';\n\t\tprint_r($this->_app);\n\t\tprint_r($this->_raw);\n\t\techo '</pre>';\n \n\t\treturn $this->_raw;\n\t}", "public function writeDump(){\n \n $args = func_get_args();\n if( empty($args) ) return;\n ob_start();\n foreach( $args as $arg ){\n var_dump($arg);\n }\n $output = ob_get_contents();\n ob_end_clean();\n \n $this->write($output);\n \n }", "public function printValue($value)\n {\n print $value;\n }", "function dump($content)\n {\n die(var_dump($content));\n exit;\n }", "private function print() {\n\t\tvar_dump($this->getParams());\n\t}", "function vd($var) {\n\techo '<hr><pre>';\n\tvar_dump($var);\n\techo '</pre><hr>';\n}", "function dumpContents()\r\n {\r\n\r\n $attributes = $this->_getCommonAttributes();\r\n\r\n //TODO [Perez][JLeon] Do we leave this method?\r\n // call the OnShow event if assigned so the Text property can be changed\r\n if ($this->_onshow != null)\r\n {\r\n $this->callEvent('onshow', array());\r\n }\r\n\r\n $avalue = $this->_text;\r\n $avalue=str_replace('\"','&quot;',$avalue);\r\n $type = \"progress\";\r\n if ($this->_type == pbsMeterBar)\r\n $type = \"meter\";\r\n echo \"<$type id=\\\"$this->_name\\\" value=\\\"$avalue\\\" $attributes>$this->_text</$type>\";\r\n\r\n }", "public function debug(){\n $debug = [\n 'ID' => $this->ID,\n 'slug' => $this->slug,\n 'options' => $this->options,\n 'items' => $this->items,\n ];\n \"<pre>\".var_dump($debug).\"</pre>\";\n }", "function viewdump($data)\n {\n if (PLATFORM === 'development') {\n echo '<pre>';\n echo var_dump($data);\n echo '</pre>';\n exit();\n } else {\n return false;\n }\n }", "public function save(): string\n {\n return self::$content;\n }", "function paramDump() {\n $spec = Terminus::getRunner()->getConfigurator()->getSpec();\n $this->output()->outputDump($spec);\n }", "function dump($mixed = null)\n{\n echo '<pre>';\n var_dump($mixed);\n echo '</pre>';\n}", "public function __toString()\n {\n ob_start();\n $this->output();\n\n return ob_get_clean();\n }", "public function print(){\n echo $this->output;\n }", "private function vardump($var_name = NULL){\r\n\t\tif (isset($var_name)) {\r\n\t\t\t$scope = $GLOBALS[$var_name];\r\n\r\n\t\t\t$this->info($var_name . ' : ' . trim(var_export($scope,true)) . PHP_EOL\r\n\t\t\t$this->info(\"-----------------------------------\");\r\n\t\t}\r\n\t}", "function dumpContents()\r\n {\r\n $attributes = $this->_getCommonAttributes();\r\n\r\n $value = ($this->_text != \"\") ? \"value=\\\"\" . $this->_text . \"\\\"\" : \"\";\r\n\r\n echo \"<input type=\\\"$this->_type\\\" id=\\\"$this->_name\\\" name=\\\"$this->_name\\\" $value $attributes />\";\r\n }", "static function dump($val) {\n\t\techo '<pre style=\"background-color:#ccc;padding:5px;font-size:14px;line-height:18px;\">';\n\t\t$caller = Debug::caller();\n\t\techo \"<span style=\\\"font-size: 12px;color:#666;\\\">Line $caller[line] of \" . basename($caller['file']) . \":</span>\\n\";\n\t\tif (is_string($val)) print_r(wordwrap($val, 100));\n\t\telse print_r($val);\n\t\techo '</pre>';\n\t}", "function dumpJavascript()\r\n {\r\n //Do nothing yet\r\n }" ]
[ "0.7090261", "0.6716475", "0.668011", "0.666669", "0.666669", "0.6663723", "0.66503096", "0.6649351", "0.6583311", "0.65790534", "0.657556", "0.6574167", "0.65683305", "0.65674955", "0.6550476", "0.6538085", "0.6430693", "0.6428361", "0.6428315", "0.63983965", "0.6387397", "0.63612497", "0.63003254", "0.6268177", "0.626407", "0.62573737", "0.62449116", "0.6238322", "0.6234921", "0.6234921", "0.6222151", "0.6195969", "0.61742246", "0.61716855", "0.616933", "0.6151638", "0.61430275", "0.6122995", "0.611725", "0.6101928", "0.6101086", "0.6086219", "0.60749894", "0.60725075", "0.60681784", "0.6055656", "0.60363436", "0.6034691", "0.6017465", "0.6012107", "0.5997148", "0.5984159", "0.59818393", "0.5967451", "0.59650713", "0.59620327", "0.59572", "0.5950422", "0.594083", "0.59352064", "0.5922657", "0.5918037", "0.59029895", "0.5898772", "0.58861345", "0.5885665", "0.58850193", "0.5882304", "0.5875203", "0.5874041", "0.58717906", "0.58709055", "0.58666915", "0.58618635", "0.5837205", "0.5834579", "0.5834031", "0.5819482", "0.58170456", "0.5786273", "0.57764727", "0.5729931", "0.5717158", "0.5704465", "0.5703616", "0.5702267", "0.56962323", "0.5695131", "0.5690884", "0.56845105", "0.5672102", "0.56656694", "0.5663049", "0.56524384", "0.56510484", "0.56452364", "0.5643923", "0.5642684", "0.5642442", "0.5632357", "0.56280905" ]
0.0
-1
Shows the trace from the calling function and back
function trace(){ $r = array_map(create_function('$a', 'return (isset($a["class"])?$a["class"].$a["type"]:"").$a["function"]."(".@join(",",$a["args"]).");, Row: ".@$a["line"];'), debug_backtrace(false)); array_shift($r); return $r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function trace()\n\t{\n\t\tob_start();\n\t\tdebug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n\t\t$trace = ob_get_clean();\n\t\t$trace = str_replace('#','<br/><div><b><u>',$trace);\n\t\t$trace = str_replace('called at [','called at : </u></b><ul><li>File : ',$trace);\n\t\t$trace = preg_replace('/:([0-9]*)\\]/','</li><li>Ligne : $1</li></ul></div>',$trace);\n\t\techo $trace;\n\t\treturn $trace;\n\t}", "public function trace()\n {\n if (!$this->cfg['collect']) {\n return;\n }\n $args = \\func_get_args();\n $meta = $this->internal->getMetaVals(\n $args,\n array(\n 'caption' => 'trace',\n 'channel' => $this->cfg['channelName'],\n 'columns' => array('file','line','function'),\n )\n );\n $backtrace = $this->errorHandler->backtrace();\n // toss \"internal\" frames\n for ($i = 1, $count = \\count($backtrace)-1; $i < $count; $i++) {\n $frame = $backtrace[$i];\n $function = isset($frame['function']) ? $frame['function'] : '';\n if (!\\preg_match('/^'.\\preg_quote(__CLASS__).'(::|->)/', $function)) {\n break;\n }\n }\n $backtrace = \\array_slice($backtrace, $i-1);\n // keep the calling file & line, but toss ->trace or ::_trace\n unset($backtrace[0]['function']);\n $this->appendLog('trace', array($backtrace), $meta);\n }", "public static function printPlainTextDebugBacktrace($trace = null, $return=false) {\n\t \tif (is_array($trace))\n\t \t\t$traceArray = $trace;\n\t \telse \n\t\t\t$traceArray = debug_backtrace();\n\t\t\n\t\n\t\tif ($return) ob_start();\n\t\t\n\t\t$filenameSize = 5;\n\t\tif (is_array($traceArray)) {\n\t\t\tforeach($traceArray as $trace) {\n\t\t\t\tif (isset($trace['file']))\n\t\t\t\t\t$filenameSize = max($filenameSize, strlen(basename($trace['file'])));\n\t\t\t}\n\t\t}\n\t\t$filenameSize = $filenameSize + 2;\n\t\t\t\n\t\tprint \"\\n* # \";\n\t\tprint \"\\tFile\";\n\t\tfor ($j = 4; $j < $filenameSize; $j++)\n\t\t\tprint \" \";\n\t\tprint \"Line\";\n\t\tprint \"\\tCall \";\n\t\tprint \"\\n*-----------------------------------------------------------------------------\";\t\t\n\t\tif (is_array($traceArray)) {\t\t\t\n\t\t\tforeach($traceArray as $i => $trace) {\n\t\t\t\t/* each $traceArray element represents a step in the call hiearchy. Print them from bottom up. */\n\t\t\t\t$file = isset($trace['file'])?basename($trace['file']):'';\n\t\t\t\t$line = isset($trace['line'])?$trace['line']:'';\n\t\t\t\t$function = isset($trace['function'])?$trace['function']:'';\n\t\t\t\t$class = isset($trace['class'])?$trace['class']:'';\n\t\t\t\t$type = isset($trace['type'])?$trace['type']:'';\n\t\t\t\t$args = harmoni_ArgumentRenderer::renderManyArguments($trace['args'], false, false);\n\t\t\t\t\n\t\t\t\tprint \"\\n* $i\";\n\t\t\t\tprint \"\\t\".$file;\n\t\t\t\tfor ($j = strlen($file); $j < $filenameSize; $j++)\n\t\t\t\t\tprint \" \";\n\t\t\t\tprint \"\".$line;\n\t\t\t\tprint \"\\t\";\n\t\t\t\tif ($class || $type || $function || $args) {\n\t\t\t\t\tprint $class.$type.$function.\"(\".$args.\");\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($return) return ob_get_clean();\n\t}", "public static function printDebugBacktrace($trace = null, $return=false) {\n\t \tif (is_array($trace))\n\t \t\t$traceArray = $trace;\n\t \telse \n\t\t\t$traceArray = debug_backtrace();\n\t\t\n\t\n\t\tif ($return) ob_start();\n\t\t\t\n\t\tprint \"\\n\\n<table border='1'>\";\n\t\tprint \"\\n\\t<thead>\";\n\t\tprint \"\\n\\t\\t<tr>\";\n\t\tprint \"\\n\\t\\t\\t<th>#</th>\";\n\t\tprint \"\\n\\t\\t\\t<th>File</th>\";\n\t\tprint \"\\n\\t\\t\\t<th>Line</th>\";\n\t\tprint \"\\n\\t\\t\\t<th>Call</th>\";\n\t\tprint \"\\n\\t\\t</tr>\";\n\t\tprint \"\\n\\t</thead>\";\n\t\tprint \"\\n\\t<tbody>\";\n\t\tif (is_array($traceArray)) {\n\t\t\tforeach($traceArray as $i => $trace) {\n\t\t\t\t/* each $traceArray element represents a step in the call hiearchy. Print them from bottom up. */\n\t\t\t\tif (isset($trace['file'])) {\n\t\t\t\t\t$filePath = $trace['file'];\n\t\t\t\t\t$file = basename($trace['file']);\n\t\t\t\t} else {\n\t\t\t\t\t$filePath = '';\n\t\t\t\t\t$file = '';\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif (isset($trace['line']))\n\t\t\t\t\t$line = $trace['line'];\n\t\t\t\telse\n\t\t\t\t\t$line = '';\n\t\t\t\t\n\t\t\t\t$function = $trace['function'];\n\t\t\t\t$class = isset($trace['class'])?$trace['class']:'';\n\t\t\t\t$type = isset($trace['type'])?$trace['type']:'';\n\t\t\t\tif (isset($trace['args']))\n\t\t\t\t\t$args = harmoni_ArgumentRenderer::renderManyArguments($trace['args'], false, false);\n\t\t\t\telse\n\t\t\t\t\t$args = '';\n\t\t\t\t\n\t\t\t\tprint \"\\n\\t\\t<tr>\";\n\t\t\t\tprint \"\\n\\t\\t\\t<td>$i</td>\";\n\t\t\t\tprint \"\\n\\t\\t\\t<td title=\\\"\".htmlentities($filePath).\"\\\">\".htmlentities($file).\"</td>\";\n\t\t\t\tprint \"\\n\\t\\t\\t<td>$line</td>\";\n\t\t\t\tprint \"\\n\\t\\t\\t<td style='font-family: monospace; white-space: nowrap'>\";\n\t\t\t\tif ($class || $type || $function || $args) {\n\t\t\t\t\tprint htmlentities($class.$type.$function.\"(\".$args.\");\");\n\t\t\t\t}\n\t\t\t\tprint \"</td>\";\n\t\t\t\tprint \"\\n\\t\\t</tr>\";\n\t\t\t}\n\t\t}\n\t\tprint \"\\n\\t</tbody>\";\n\t\tprint \"\\n</table>\";\n\t\t\n\t\tif ($return) return ob_get_clean();\n\t}", "function debug_print_backtrace2() {\n\t\t\techo \"<pre>\";\n\t\t\t$ar = debug_backtrace();\n\t\t\t//array_pop($ar);\n\t\t\tvar_dump($ar);\n\t\t\techo \"</pre>\";\n\t\t}", "function debug_print_backtrace2() {\n\t\t\techo \"<pre>\";\n\t\t\t$ar = debug_backtrace();\n\t\t\t//array_pop($ar);\n\t\t\tvar_dump($ar);\n\t\t\techo \"</pre>\";\n\t\t}", "function getTrace(){\n\t$array = debug_backtrace();\n\tunset($array[0]);\n\t$html = '';\n\tforeach ($array as $row) {\n\t\tif (isset($row['file']) && isset($row['line']) && isset($row['function']))\n\t\t\t$html .= $row['file'] . ':' . $row['line'] . '行,调用方法:' . $row['function'] . \"\\n\";\n\t}\n\treturn $html;\n}", "final function getTrace();", "public function getTrace();", "public static function stack($msg = \"\")\n {\n if (!dmContext::hasInstance())\n {\n return self::simpleStack($msg);\n }\n\n dmContext::getInstance()->getConfiguration()->loadHelpers(array('Javascript', 'Tag'));\n\n $result = \"\";\n $trace = debug_backtrace();\n $traceId = \"pkSimpleBacktrace\" . dmString::random();\n $traceIdShow = $traceId . \"Show\";\n $traceIdHide = $traceId . \"Hide\";\n $result .= \"<div class='pkSimpleBacktrace'>stack $msg\" .\n link_to_function(\"&gt;&gt;&gt;\",\n \"document.getElementById('$traceId').style.display = 'block'; \" .\n \"document.getElementById('$traceId').style.display = 'block'; \" .\n \"document.getElementById('$traceIdShow').style.display = 'none'; \" .\n \"document.getElementById('$traceIdHide').style.display = 'inline'\",\n array(\"id\" => $traceIdShow)) .\n link_to_function(\"&lt;&lt;&lt;\",\n \"document.getElementById('$traceId').style.display = 'none'; \" .\n \"document.getElementById('$traceIdHide').style.display = 'none'; \" .\n \"document.getElementById('$traceIdShow').style.display = 'inline'\",\n array(\"id\" => $traceIdHide, \"style\" => 'display: none'));\n $result .= \"</div>\";\n $result .= \"<pre id='$traceId' style='display: none'>\\n\";\n $first = true;\n foreach ($trace as $element)\n {\n if ($first)\n {\n $first = false;\n }\n else\n {\n $result .= \"File: \" . $lastFile . \" function: \" . $element['function'] . \" line: \" .$lastLine . \"\\n\";\n }\n $lastFile = dmArray::get($element, 'file');\n $lastLine = dmArray::get($element, 'line');\n }\n $result .= \"</pre>\\n\";\n echo $result;\n }", "function p()\n {\n $bt = debug_backtrace();\n $caller = array_shift($bt);\n echo str_replace(base_path() . '/' , '', $caller['file']), ':', $caller['line'];\n array_map(function ($n, $x) {\n echo '<fieldset class=\"debug\"> <legend>' . ($n) . '</legend>';\n (new Dumper)->dump($x);\n echo '</fieldset>';\n }, range(1, func_num_args()), func_get_args());\n }", "function Trace($msg)\r\n{\r\n\tglobal $debug;\r\n\tif ($debug) echo $msg;\r\n}", "function mytrace($s)\r\n{\r\n\t// see constants.php for TRACE_ENABLED flag\r\n\t\r\n\t// turn off trace?\r\n\tif (isset($_REQUEST[QS_DEBUG]))\r\n\t{\r\n\t\tif ($_REQUEST[QS_DEBUG]==\"0\") \r\n\t\t{\r\n\t\t\t$_SESSION[QS_DEBUG]=\"\";\r\n\t\t} \r\n\t}\r\n\t\r\n\t// Turn ON trace?\r\n\tif (isset($_REQUEST[QS_DEBUG]))\r\n\t{\r\n\t\tif ($_REQUEST[QS_DEBUG]==\"1\") \r\n\t\t{\r\n\t\t\t$_SESSION[QS_DEBUG]=\"1\";\r\n\t\t\t\r\n\t\t\tOutBR($s);\r\n\t\t\treturn;\r\n\t\t} \r\n\t}\r\n\t\r\n\tif (TRACE_ENABLED) \r\n\t{\r\n\t\t$_SESSION[QS_DEBUG]=\"1\";\r\n\t\t\r\n\t\tOutBR($s);\r\n\t\treturn;\r\n\t} \r\n\t\r\n\tif (isset($_SESSION[QS_DEBUG]))\r\n\t{\r\n\t\tif ($_SESSION[QS_DEBUG]==\"1\") \r\n\t\t{\r\n\t\t\t$_SESSION[QS_DEBUG]=\"1\";\r\n\t\t\t\r\n\t\t\tOutBR($s);\r\n\t\t\treturn;\r\n\t\t} \r\n\t}\r\n\t\r\n}", "function wp_debug_backtrace_summary($ignore_class = \\null, $skip_frames = 0, $pretty = \\true)\n {\n }", "static function backtrace($returnVal = false, $ignoreAjax = false) {\n\t\t$bt = debug_backtrace();\n\t\t$result = self::get_rendered_backtrace($bt, Director::is_cli() || (Director::is_ajax() && !$ignoreAjax));\n\t\tif ($returnVal) {\n\t\t\treturn $result;\n\t\t} else {\n\t\t\techo $result;\n\t\t}\n\t}", "public static function traceShow()\n {\n return self::debugger(func_get_args(), 2, array(\"tag\" => \"div\"));\n }", "public function trace($message)\n {\n }", "function trace(){\n\t\techo($this->get_trace()/(1024*1024).\" MB\");\n\t}", "function traceHelloPHP(){\n echo 'Hello PHP<br>';\n echo 'Hello World<br>';\n}", "function td():string\n{\n $trace = debug_backtrace();\n echo '<pre style=\"background:#F2F2F2;border:solid 1px;padding:1em; font-size:12pt\">';\n echo '<h2><u>Trace</u></h3>';\n echo '<b>file</b> : <span style=\"color:red\">'.$trace[0]['file'].\"</span>\";\n echo '<br><b>line</b> : <span style=\"color:blue\">'.$trace[0]['line'].\"</span>\";\n if (isset($trace[1]['function'])) {\n echo '<br><b>function</b> : <span style=\"color:blue\">'.$trace[1]['function'].\"</span>\";\n }\n if (isset($trace[1]['class'])) {\n echo '<br><b>class</b> : <span style=\"color:red\">'.$trace[1]['class'].\"</span>\";\n }\n echo '</pre>';\n echo '<h2><u>Dump</u></h3>';\n $args = func_get_args();\n if (!empty($args)) { \n call_user_func('dd', ((count($args) > 1)? $args : $args[0]) );\n }else{\n dd();\n }\n}", "function trace($title,$contents = '',$open = false){\n echo \"<details\". ($open ? ' open':'') .\"><summary>$title</summary>$contents</details>\";\n}", "static function PrintTrace()\r\n {\r\n self::$yyTraceFILE = fopen('php://output', 'w');\r\n self::$yyTracePrompt = '<br>';\r\n }", "protected function getDebugBacktrace() {}", "public static function stack_trace($show_args=false, $for_web=true, $return=false){\r\n\t\tif ($for_web){\r\n\t\t\t$before = '<b>';\r\n\t\t\t$after = '</b>';\r\n\t\t\t$tab = '&nbsp;&nbsp;&nbsp;&nbsp;';\r\n\t\t\t$newline = '<br>';\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$before = '<';\r\n\t\t\t$after = '>';\r\n\t\t\t$tab = \"\\t\";\r\n\t\t\t$newline = \"\\n\";\r\n\t\t}\r\n\t\t$output = '';\r\n\t\t$ignore_functions = array('include','include_once','require','require_once');\r\n\t\t$backtrace = debug_backtrace();\r\n\t\t$length = count($backtrace);\r\n\t\t\r\n\t\tfor ($i=0; $i<$length; $i++){\r\n\t\t\t$function = $line = '';\r\n\t\t\t$skip_args = false;\r\n\t\t\t$caller = @$backtrace[$i+1]['function'];\r\n\t\t\t// Display function called (if not a require or include)\r\n\t\t\tif(isset($caller) && !in_array($caller, $ignore_functions)){\r\n\t\t\t\t$function = ' in function '.$before.$caller.$after;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$skip_args = true;\r\n\t\t\t}\r\n\t\t\t$line = $before.$backtrace[$i]['file'].$after.$function .' on line: '.$before.$backtrace[$i]['line'].$after.$newline;\r\n\t\t\tif ($i < $length-1){\r\n\t\t\t\tif ($show_args && $backtrace[($i+1)]['args'] && !$skip_args){\r\n\t\t\t\t\t$params = ($for_web) ? htmlentities(print_r($backtrace[($i+1)]['args'], true))\r\n\t\t\t\t\t\t\t: print_r($backtrace[($i+1)]['args'], true);\r\n\t\t\t\t\t$line .= $tab.'Called with params: '.preg_replace('/(\\n)/',$newline.$tab,trim($params)).$newline.$tab.'By:'.$newline;\r\n\t\t\t\t\tunset($params);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$line .= $tab.'Called By:'.$newline;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($return){\r\n\t\t\t\t$output .= $line;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\techo $line;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($return){\r\n\t\t\treturn $output;\r\n\t\t}\r\n\t}", "public static function traceForce()\n {\n return self::debugger(func_get_args(), 2, array(\"force\" => true));\n }", "public function logTrace()\n {\n $output = new Output(Output::MODE_FILE, $this->getLogPath());\n $output->open();\n \\DebugHelper::dump()->showtrace($output);\n $output->close();\n }", "function _trace($message) {\n if ($trace = TRUE) {\n _log($message);\n } \n}", "function get_trace(){\n\t\tglobal $database_queries,$database_query_count,$is_connected_to_db,$global_link;\n\t\treturn(\"<div style='width:100%'></div>\".$this->get_shadow(\"<h1>Mysql Trace information</h1>Note: this information s for debug purposes only, and will not be shown in the final product.<br/>Query Count:\".\n\t\t\t'db used:'.$this->dbdatabase.'<br/>Connected to Database:'.(int)$is_connected_to_db.'<br/>Link:'.$global_link.'<br/> Query Count: '.\n\t\t\t$database_query_count.'<br/>'.$database_queries,$this->default_style,'center','80%'));\n\t}", "private function getStackTrace() {\n\t\t$trace = '';\n\t\tforeach (debug_backtrace() as $k => $v) {\n\t\t\tif ( $k < $ignore ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tarray_walk( $v['args'], function ( &$item, $key ) {\n\t\t\t\t$item = var_export( $item, true );\n\t\t\t});\n\n\t\t\t$trace .= '#' .\n\t\t\t\t($k - $ignore) .\n\t\t\t\t' ' .\n\t\t\t\t$v['file'] .\n\t\t\t\t'(' . $v['line'] . '): ' .\n\t\t\t\t( isset($v['class']) ? $v['class'] . '->' : '' ) .\n\t\t\t\t$v['function'] .\n\t\t\t\t'(' . implode(', ', $v['args']) . ')' .\n\t\t\t\t\"\\n\";\n\t\t}\n\n\t\treturn $trace;\n\t}", "private function getReadableTrace() : string {\n $result = '';\n\n $traceIteration = 1;\n $argsDelimeter = ', ';\n\n $trace = $this->getTrace();\n foreach ($trace as $part) {\n $file = array_key_exists('file', $part) ? $part['file'] : '';\n $line = array_key_exists('line', $part) ? $part['line'] : '';\n $function = array_key_exists('function', $part) ? $part['function'] : '';\n $args = array_key_exists('args', $part) && is_array($part['args']) ? print_r($part['args'], true) : '';\n\n $result .= ' #' . $traceIteration++ . ' ' . $file . '(' . $line . '): ' . $function . '(' . $args . ')';\n }\n $result = ltrim($result, ' ');\n\n return $result;\n }", "static function debug_info(){\n $di = debug_backtrace();\n $valid_caller_functions = array(\"on\",\"off\", \"alert\", \"debug\", \"error\", \"function_entry\", \"function_exit\");\n $caller_class = $di[1]['class'];\n $caller_function = $di[1]['function'];\n if( !(\n ($caller_class == 'Trace') && (in_array($caller_function, $valid_caller_functions)) \n )\n ) throw new \\Exception(__METHOD__.\" called from wrong/invalid place caller is $caller_class::$caller_function\"); \n// var_dump($di[2]);exit();\n $obj = new stdClass();\n $obj->file = $di[1]['file'];\n $obj->line_number = $di[1]['line'];\n $obj->function = $di[2]['function'];\n $obj->class = (array_key_exists('class', $di[2]))? $di[2]['class'] : \"*\";\n $obj->type = (array_key_exists('type', $di[2]))? $di[2]['type'] : \"\";\n if( array_key_exists('args', $di[2]) ){\n $obj->args = \"\";\n foreach($di[2]['args'] as $args){\n if(is_array($args) ) \n $a = print_r($args, true);\n else if(is_object($args) ) \n $a = \"Object of class:[\".get_class($args).\"]\" ;//var_export($args, true);\n else \n $a = $args.\"\";\n $obj->args .= $a.\", \";\n } \n }\n// $obj->args = (array_key_exists('args', $di[2]))? implode(',', $di[2]['args']) : \"\";\n $obj->backtrace = $di; \n $obj->string = $obj->class.$obj->type.$obj->function;//.\"[\". $file.\"::\".$line_number.\"]\";\n return $obj;\n }", "function atkTrace($msg=\"\")\n{\n\tglobal $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_GET_VARS, $HTTP_COOKIE_VARS, $HTTP_POST_VARS;\n\n\t$log = \"\\n\".str_repeat(\"=\", 5).\"\\n\";\n\t$log.= \"Trace triggered: \".$msg.\"\\n\";\n\t$log.= date(\"r\").\"\\n\";\n\t$log.= $HTTP_SERVER_VARS[\"REMOTE_ADDR\"].\"\\n\";\n\t$log.= $HTTP_SERVER_VARS[\"SCRIPT_URL\"].\"\\n\";\n\t$log.= \"\\nSessioninfo: \".\"session_name(): \".session_name().\" session_id(): \".session_id().\" SID: \".SID.\" REQUEST: \".$_REQUEST[session_name()].\" COOKIE: \".$_COOKIE[session_name()].\"\\n\";\n\t$log.= \"\\n\\nHTTP_SERVER_VARS:\\n\";\n\t$log.= var_export($HTTP_SERVER_VARS, true);\n\t$log.= \"\\n\\nHTTP_SESSION_VARS:\\n\";\n\t$log.= var_export($HTTP_SESSION_VARS, true);\n\t$log.= \"\\n\\nHTTP_COOKIE_VARS:\\n\";\n\t$log.= var_export($HTTP_COOKIE_VARS, true);\n\t$log.= \"\\n\\nHTTP_POST_VARS:\\n\";\n\t$log.= var_export($HTTP_POST_VARS, true);\n\t$log.= \"\\n\\nHTTP_GET_VARS:\\n\";\n\t$log.= var_export($HTTP_GET_VARS, true);\n\n\t$log.= \"\\n\\nSession file info:\\n\";\n\t$log.= var_export(stat(session_save_path().\"/sess_\".session_id()), true);\n\n\t$tmpfile = tempnam(\"/tmp\",atkconfig(\"identifier\").\"_trace_\");\n\t$fp = fopen($tmpfile,\"a\");\n\tfwrite($fp, $log);\n\tfclose($fp);\n}", "public static function trace(array $options = [])\n {\n $self = Debugger::getInstance();\n $defaults = [\n 'depth' => 999,\n 'format' => $self->_outputFormat,\n 'args' => false,\n 'start' => 0,\n 'scope' => null,\n 'exclude' => ['call_user_func_array', 'trigger_error']\n ];\n $options = Hash::merge($defaults, $options);\n $backtrace = debug_backtrace();\n $count = count($backtrace);\n $back = [];\n $_trace = [\n 'line' => '??',\n 'file' => '[internal]',\n 'class' => null,\n 'function' => '[main]'\n ];\n for ($i = $options['start']; $i < $count && $i < $options['depth']; $i++) {\n $trace = $backtrace[$i] + ['file' => '[internal]', 'line' => '??'];\n $signature = $reference = '[main]';\n\n if (isset($backtrace[$i + 1])) {\n $next = $backtrace[$i + 1] + $_trace;\n $signature = $reference = $next['function'];\n\n if (!empty($next['class'])) {\n $signature = $next['class'] . '::' . $next['function'];\n $reference = $signature . '(';\n\n if ($options['args'] && isset($next['args'])) {\n $args = [];\n\n foreach ($next['args'] as $arg) {\n $args[] = Debugger::exportVar($arg);\n }\n\n $reference .= implode(', ', $args);\n }\n\n $reference .= ')';\n }\n }\n\n if (in_array($signature, $options['exclude'])) {\n continue;\n }\n\n if ($options['format'] === 'points' && $trace['file'] !== '[internal]') {\n $back[] = ['file' => $trace['file'], 'line' => $trace['line']];\n } elseif ($options['format'] === 'array') {\n $back[] = $trace;\n } else {\n if (isset($self->_templates[$options['format']]['traceLine'])) {\n $tpl = $self->_templates[$options['format']]['traceLine'];\n } else {\n $tpl = $self->_templates['base']['traceLine'];\n }\n\n $trace['path'] = static::trimPath($trace['file']);\n $trace['reference'] = $reference;\n\n unset($trace['object'], $trace['args']);\n\n $back[] = Text::insert($tpl, $trace, ['before' => '{:', 'after' => '}']);\n }\n }\n\n if ($options['format'] === 'array' || $options['format'] === 'points') {\n return $back;\n }\n\n return implode(\"\\n\", $back);\n }", "protected function generateCallTrace()\n {\n $e = new \\Exception();\n $trace = explode(\"\\n\", $this->getExceptionTraceAsString($e));\n // reverse array to make steps line up chronologically\n $trace = array_reverse($trace);\n array_shift($trace); // remove {main}\n array_pop($trace); // remove call to this method\n array_pop($trace); // remove call to log_debug_result method\n $length = count($trace);\n $result = [];\n for ($i = 0; $i < $length; $i++) {\n // replace '#someNum' with '$i)', set the right ordering\n $result[] = ($i + 1) . ')' . substr($trace[$i], strpos($trace[$i], ' '));\n }\n\n return \"\\t\" . implode(\"\\n\\t\", $result) . \"\\n\\n\";\n }", "function debug($var = null, $name = null)\n{\n $bt = array();\n $file = '';\n if ($name !== false) {\n $bt = debug_backtrace();\n $file = str_replace(bp(), '', $bt[0]['file']);\n print '<div style=\"font-family: arial; background: #FFFBD6; margin: 10px 0; padding: 5px; border:1px solid #666;\">';\n if ($name) $name = '<b>' . $name . '</b><br/>';\n print '<span style=\"font-size:14px;\">' . $name . '</span>';\n print '<div style=\"border:1px solid #ccc; border-width: 1px 0;\">';\n }\n print '<pre style=\"margin:0;padding:10px;\">';\n print_r($var);\n print '</pre>';\n if ($name !== false) {\n print '</div>';\n print '<span style=\"font-family: helvetica; font-size:10px;\">' . $file . ' on line ' . $bt[0]['line'] . '</span>';\n print '</div>';\n }\n}", "public function getTraceAsString();", "static function PrintTrace()\n {\n self::$yyTraceFILE = fopen('php://output', 'w');\n self::$yyTracePrompt = '';\n }", "private function printTrace($trace){\n\t\t$html = \"\";\n\t\tforeach ($trace as $key => $val) {\n\t\t\t$html .= \"[\".$key.\"]<br/>\";\n\t\t\t$html .= \"&nbsp;&nbsp;&nbsp;&nbsp;<b>[file]</b> = \".@$val[\"file\"].\" <b>[line]</b> = \".@$val[\"line\"].\"<br/>\";\n\t\t\t$html .= \"&nbsp;&nbsp;&nbsp;&nbsp;<b>[class]</b> = \".@$val[\"class\"].\" <b>[function]</b> = \".@$val[\"function\"].\"<br/>\";\n\t\t}\n\t\treturn $html;\n\t}", "private function printTrace($trace){\n\t\t$html = \"\";\n\t\tforeach ($trace as $key => $val) {\n\t\t\t$html .= \"[\".$key.\"]<br/>\";\n\t\t\t$html .= \"&nbsp;&nbsp;&nbsp;&nbsp;<b>[file]</b> = \".@$val[\"file\"].\" <b>[line]</b> = \".@$val[\"line\"].\"<br/>\";\n\t\t\t$html .= \"&nbsp;&nbsp;&nbsp;&nbsp;<b>[class]</b> = \".@$val[\"class\"].\" <b>[function]</b> = \".@$val[\"function\"].\"<br/>\";\n\t\t}\n\t\treturn $html;\n\t}", "final function getTraceAsString();", "public function debugBacktrace()\n {\n return debug_backtrace();\n }", "final public function getTraceAsString()\n {\n return 'trace';\n }", "function getBacktrace($errline = 0)\n{\n $message = '';\n if (!function_exists('debug_backtrace')) {\n $message.= 'function debug_backtrace does not exists'.\"\\n\";\n }\n\n $debug_backtrace = debug_backtrace();\n array_shift($debug_backtrace);\n $message.= 'Debug backtrace:'.\"\\n\";\n\n foreach ($debug_backtrace as $trace_item) {\n $message.= \"\\t\" . ' @ ';\n if (!empty($trace_item['file'])) {\n $message.= basename($trace_item['file']) . ':' . $trace_item['line'];\n } else {\n $message.= '- PHP inner-code - ';\n }\n $message.= ' -- ';\n if (!empty($trace_item['class'])) {\n $message.= $trace_item['class'] . $trace_item['type'];\n }\n $message.= $trace_item['function'];\n\n if (!empty($trace_item['args']) && is_array($trace_item['args'])) {\n $args = array();\n foreach ($trace_item['args'] as $arg) {\n $args[] = is_scalar($arg) ? $arg : (is_object($arg) ? get_class($arg) : gettype($arg));\n }\n $message.= '('.implode(', ', $args).')';\n } else {\n $message.= '()';\n }\n $message.= \"\\n\";\n }\n\n return $message;\n}", "function debug($tab){\n\techo '<div style=\"color: white; padding: 20px; font-weight: bold; background:#' . rand(111111, 999999) . '\">';\n\n\t$trace = debug_backtrace(); // Retourne les infos sur l'emplace ou est executee une fonction\n\techo 'Le debug a ete demande dans le fichier : ' . $trace[0]['file'] . ' à la ligne : ' . $trace[0]['line'] . '</hr>';\n\n\n\n\n\n echo '<pre>';\n print_r($tab);\n echo '</pre>';\n\n\n echo '</div>';\n\n}", "public function get_backtrace() { return $this->getTraceAsString(); }", "public static function trace(array $options = []) {\n\t\t$defaults = [\n\t\t\t'depth' => 999,\n\t\t\t'format' => null,\n\t\t\t'args' => false,\n\t\t\t'start' => 0,\n\t\t\t'scope' => [],\n\t\t\t'trace' => [],\n\t\t\t'includeScope' => true,\n\t\t\t'closures' => true\n\t\t];\n\t\t$options += $defaults;\n\n\t\t$backtrace = $options['trace'] ?: debug_backtrace();\n\t\t$scope = $options['scope'];\n\t\t$count = count($backtrace);\n\t\t$back = [];\n\t\t$traceDefault = [\n\t\t\t'line' => '??', 'file' => '[internal]', 'class' => null, 'function' => '[main]'\n\t\t];\n\n\t\tfor ($i = $options['start']; $i < $count && $i < $options['depth']; $i++) {\n\t\t\t$trace = array_merge(['file' => '[internal]', 'line' => '??'], $backtrace[$i]);\n\t\t\t$function = '[main]';\n\n\t\t\tif (isset($backtrace[$i + 1])) {\n\t\t\t\t$next = $backtrace[$i + 1] + $traceDefault;\n\t\t\t\t$function = $next['function'];\n\n\t\t\t\tif (!empty($next['class'])) {\n\t\t\t\t\t$function = $next['class'] . '::' . $function . '(';\n\t\t\t\t\tif ($options['args'] && isset($next['args'])) {\n\t\t\t\t\t\t$args = array_map(['static', 'export'], $next['args']);\n\t\t\t\t\t\t$function .= join(', ', $args);\n\t\t\t\t\t}\n\t\t\t\t\t$function .= ')';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($options['closures'] && strpos($function, '{closure}') !== false) {\n\t\t\t\t$function = static::_closureDef($backtrace[$i], $function);\n\t\t\t}\n\t\t\tif (in_array($function, ['call_user_func_array', 'trigger_error'])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$trace['functionRef'] = $function;\n\n\t\t\tif ($options['format'] === 'points' && $trace['file'] !== '[internal]') {\n\t\t\t\t$back[] = ['file' => $trace['file'], 'line' => $trace['line']];\n\t\t\t} elseif (is_string($options['format']) && $options['format'] !== 'array') {\n\t\t\t\t$back[] = Text::insert($options['format'], array_map(\n\t\t\t\t\tfunction($data) { return is_object($data) ? get_class($data) : $data; },\n\t\t\t\t\t$trace\n\t\t\t\t));\n\t\t\t} elseif (empty($options['format'])) {\n\t\t\t\t$back[] = $function . ' - ' . $trace['file'] . ', line ' . $trace['line'];\n\t\t\t} else {\n\t\t\t\t$back[] = $trace;\n\t\t\t}\n\n\t\t\tif (!empty($scope) && array_intersect_assoc($scope, $trace) == $scope) {\n\t\t\t\tif (!$options['includeScope']) {\n\t\t\t\t\t$back = array_slice($back, 0, count($back) - 1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ($options['format'] === 'array' || $options['format'] === 'points') {\n\t\t\treturn $back;\n\t\t}\n\t\treturn join(\"\\n\", $back);\n\t}", "function StackTrace($template_safe=true)\n {\n if( !CCDebug::IsEnabled() )\n return;\n\n if (function_exists(\"debug_backtrace\")) \n {\n $st = debug_backtrace();\n }\n else\n {\n $st = \"No stack trace in this vesion of php\";\n }\n\n CCDebug::PrintVar($st,$template_safe);\n }", "function trace()\n\t{$trace=debug_backtrace();\n\tforeach($trace as $t)\n\t{\n\t\tif (in_array($t['function'], \n\t\t\t\t\t array('include', 'include_once', 'require', 'require_once')))\n\t\t{\n\t\t\t$file_path=$t['file'];//gesamter Pfad inkl. Filename und Extention.\n\t\t\t\n\t\t\t//Filenamen\n\t\t\t$parts = pathinfo($file_path);//Vorbereitung\n\t\t\t$filename = $parts['basename'];//Filename incl. extention.\n\t\t\t$filetype = $parts['extension'];//Nur die extention.\n\t\t\t$path_only = $parts['dirname'];//Nur der Pfad.\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn ($filename);\n}", "function get_backtrace($html = false, $skip=0)\n{\n\t$str = '';\n\tif ($html) $str .= '<table border=0>';\n\t$trace = debug_backtrace();\n\n\tforeach($trace as $trn => $tr) {\n\t\tif ($trn <= $skip) continue;\n\t\tif ($html) $str .= '<tr><td>';\n\t\t$str .= $tr['file'].':'.$tr['line'].': ';\n\t\tif ($html) $str .= '</td><td>';\n\t\tif (isset($tr['type'])) {\n\t \t\tif($tr['type'] == '::') {\n\t\t\t\t$str .= $tr['class'].'::';\n\t\t\t} else if($tr['type'] == '->') {\n\t\t\t\t$str .= '('.$tr['class'].' Object)'.'->';\n\t\t\t}\n\t\t}\n\t\t$str .= $tr['function'].'(';\n\t\t\n\t\tif(is_array($tr['args'])) {\n\t\t\t$args = array();\n\t\t\tforeach($tr['args'] as $n=>$a) {\n\t\t\t\tif (is_object($tr['args'][$n]))\n\t\t\t\t\t$args[$n] = \"(\".get_class($tr['args'][$n]).\" Object)\";\n\t\t\t\telseif (is_array($tr['args'][$n]))\n\t\t\t\t\t$args[$n] = \"(Array[\".count($tr['args'][$n]).\"])\";\n\t\t\t\telse\n\t\t\t\t\t$args[$n] = \"'\".$tr['args'][$n].\"'\";\n\t\t\t}\n\t\t\t$str .= implode(',',$args);\n\t\t}\n\t\t$str .= ')</td>';\n\t}\n\n\tif ($html) $str .= '</tr></table>';\n\treturn $str;\n}", "function debug($variable, $exit = false){\r\n\r\n echo \"<pre>\";\r\n var_dump($variable);\r\n echo \"</pre>\";\r\n\r\n $backtrace = debug_backtrace();\r\n\r\n if(count($backtrace) > 1)\r\n array_shift($backtrace);\r\n\r\n foreach($backtrace as $trace){\r\n\r\n echo \"* \";\r\n\r\n if(isset($trace[\"class\"]))\r\n echo $trace[\"class\"].\"-&gt; \";\r\n\r\n if(isset($trace[\"function\"]))\r\n echo $trace[\"function\"].\" \";\r\n\r\n echo \"in \".$trace[\"file\"].\" \";\r\n echo \"on line \".$trace[\"line\"].\"<br />\";\r\n\r\n }//endforeach\r\n\r\n if($exit)\r\n exit();\r\n\r\n}", "function debug_backtrace($provide_object = true) {\r\n return Pancake\\workBacktrace(Pancake\\PHPFunctions\\debugBacktrace($provide_object));\r\n }", "public function GetTrace () \r\n\t{\r\n\t\treturn (self::$trace);\r\n\t}", "public function GetTrace () \r\n\t{\r\n\t\treturn (self::$trace);\r\n\t}", "private function formatStackTrace($trace)/*{{{*/\n {\n // remove the first 2 entries in the array as they \n // refer to this file and the base.class.php that\n // called it\n $junk=array_shift($trace);\n $junk=array_shift($trace);\n $caller=array_shift($trace);\n $op=\"\";\n if($this->tracelevel>-1){\n if(isset($caller[\"function\"])){\n $op=\"In: \" . $caller[\"function\"];\n if(isset($caller[\"class\"]) && strlen($caller[\"class\"])){\n $op.=\" in class: \" . $caller[\"class\"];\n }\n $op.=\" Line: \" . $caller[\"line\"];\n $op.=\" file: \" . $caller[\"file\"] . PHP_EOL;\n $cn=count($trace);\n if($cn && $this->tracelevel>1){\n foreach($trace as $k=>$v){\n if(isset($v[\"class\"])){\n $op.=\" func: \" . $v[\"function\"] . \" class: \" . $v[\"class\"] . \" line: \" . $v[\"line\"] . \" file: \" . $v[\"file\"] . PHP_EOL;\n }else{\n $op.=\" func: \" . $v[\"function\"] . \" line: \" . $v[\"line\"] . \" file: \" . $v[\"file\"] . PHP_EOL;\n }\n }\n }\n }\n }\n return $op;\n }", "public function getBacktrace()\n {\n $backtrace = $this->get_debug_backtrace();\n\n $output = \"\";\n\n $count = 0;\n foreach ($backtrace as $line) {\n if ($count <= 1) {\n $count++;\n continue;\n }\n\n $output .= \"#{$count}: \";\n\n if (isset($line['type']) && $line['type'] != \"\") {\n $output .= $line['class'] . $line['type'];\n }\n\n $output .= $line['function'] . \"(...)\";\n $output .= \" [{$line['file']}#{$line['line']}\\r\\n\";\n\n $count++;\n }\n\n return $output;\n }", "protected function _printTrace($trace){\n\t\t$output = '';\n\t\t\n\t\tforeach($trace as $key => $tracePoint){\n\t\t\t$class \t\t= $tracePoint['class'];\n\t\t\t$function \t= $tracePoint['function'];\n\t\t\t$type \t\t= $tracePoint['type'];\n\t\t\t$file \t\t= $tracePoint['file'];\n\t\t\t$line \t\t= $tracePoint['line'];\n\t\t\t\n\t\t\t$output .= \"\n\t\t\t<b>$class $type $function</b> in $file @ line $line.\";\n\t\t\tif(array_key_exists('data',$tracePoint)) $output .= \" Data = $data\";\n\t\t\t$output .= \"<br />\";\n\t\t}\n\t\techo $output;\n\t\treturn $output;\n\t}", "function get_backtrace()\n{\n\tglobal $phpbb_root_path;\n\n\t$output = '<div style=\"font-family: monospace;\">';\n\t$backtrace = debug_backtrace();\n\t$path = phpbb_realpath($phpbb_root_path);\n\n\tforeach ($backtrace as $number => $trace)\n\t{\n\t\t// We skip the first one, because it only shows this file/function\n\t\tif ($number == 0)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Strip the current directory from path\n\t\tif (empty($trace['file']))\n\t\t{\n\t\t\t$trace['file'] = '';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$trace['file'] = str_replace(array($path, '\\\\'), array('', '/'), $trace['file']);\n\t\t\t$trace['file'] = substr($trace['file'], 1);\n\t\t}\n\t\t$args = array();\n\n\t\t// If include/require/include_once is not called, do not show arguments - they may contain sensible information\n\t\tif (!in_array($trace['function'], array('include', 'require', 'include_once')))\n\t\t{\n\t\t\tunset($trace['args']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Path...\n\t\t\tif (!empty($trace['args'][0]))\n\t\t\t{\n\t\t\t\t$argument = htmlspecialchars($trace['args'][0]);\n\t\t\t\t$argument = str_replace(array($path, '\\\\'), array('', '/'), $argument);\n\t\t\t\t$argument = substr($argument, 1);\n\t\t\t\t$args[] = \"'{$argument}'\";\n\t\t\t}\n\t\t}\n\n\t\t$trace['class'] = (!isset($trace['class'])) ? '' : $trace['class'];\n\t\t$trace['type'] = (!isset($trace['type'])) ? '' : $trace['type'];\n\n\t\t$output .= '<br />';\n\t\t$output .= '<b>FILE:</b> ' . htmlspecialchars($trace['file']) . '<br />';\n\t\t$output .= '<b>LINE:</b> ' . ((!empty($trace['line'])) ? $trace['line'] : '') . '<br />';\n\n\t\t$output .= '<b>CALL:</b> ' . htmlspecialchars($trace['class'] . $trace['type'] . $trace['function']) . '(' . ((sizeof($args)) ? implode(', ', $args) : '') . ')<br />';\n\t}\n\t$output .= '</div>';\n\treturn $output;\n}", "public static function debugTrail() {}", "protected static function write()\n {\n $filePathContext = self::$arrBacktrace['file'];\n $lineContext = self::$arrBacktrace['line'];\n $argsContext = self::$arrBacktrace['args'];\n $function = self::$strFunc;\n\n $strDisplay = '<p>' . $filePathContext . ' on line ' . $lineContext . '</p>';\n\n if (is_array($argsContext) && !empty($argsContext)) {\n foreach ($argsContext as $intKey => $mixValue) {\n if ($mixValue === 'exit') {\n self::$end = true;\n continue;\n }\n\n ob_start();\n $function($mixValue);\n $strDisplay .= 'Argument ' . ($intKey + 1) . '<br />';\n $strDisplay .= '<pre>' . ob_get_contents() . '</pre>';\n\n if (self::$isPretty) {\n self::prettify($mixValue, $intKey, ob_get_contents());\n }\n\n ob_end_clean();\n }\n }\n\n return $strDisplay;\n }", "static function get_backtrace()\r\n {\r\n $html = array();\r\n $backtraces = debug_backtrace();\r\n foreach ($backtraces as $backtrace)\r\n {\r\n $html[] = implode(' ', $backtrace);\r\n }\r\n return implode('<br/>', $html);\r\n }", "function compactStackTrace($removeThisCall = true){\n\t$dbg = debug_backtrace();\n\t$r = '';\n\n\tif ($removeThisCall) array_shift($dbg);\n\n\t$fields = array('file', 'line', 'class', 'function');\n\n\tforeach ($dbg as $d){\n\t\tforeach ($fields as $f)\n\t\t\t$d[$f] = nu($d[$f]) ?: 'N/A';\n\t\t$r .= \"\\n:.:{$d['file']}:{$d['line']} {$d['class']} -> {$d['function']}\";\n\t}\n\n\t$r .= \"\\n:.:\\n\";\n\treturn $r;\n}", "public static function backtrace() \n\t{\n\t\tacPhpCas::setReporting();\n\t\treturn phpCAS::backtrace();\n\t}", "public function getColorfulText()\n {\n $output = \"\\033[1;31m--[ Agile Toolkit Exception ]---------------------------\\n\";\n $output .= get_class($this).\": \\033[47m\".$this->getMessage().\"\\033[0;31m\".\n ($this->getCode() ? ' [code: '.$this->getCode().']' : '');\n\n foreach ($this->params as $key => $val) {\n $key = str_pad($key, 19, ' ', STR_PAD_LEFT);\n $output .= \"\\n\".$key.': '.$this->toString($val);\n }\n\n $output .= \"\\n\\033[0mStack Trace: \";\n\n $in_atk = true;\n $escape_frame = false;\n\n foreach ($this->getMyTrace() as $call) {\n if (!isset($call['file'])) {\n $call['file'] = '';\n } elseif (\n $in_atk &&\n strpos($call['file'], '/data/src/') === false &&\n strpos($call['file'], '/core/src/') === false &&\n strpos($call['file'], '/dsql/src/') === false\n ) {\n $escape_frame = true;\n $in_atk = false;\n }\n\n $file = str_pad(substr($call['file'], -40), 40, ' ', STR_PAD_LEFT);\n\n $line = str_pad(@$call['line'], 4, ' ', STR_PAD_LEFT);\n\n $output .= \"\\n\\033[0;34m\".$file.\"\\033[0m\";\n $output .= \":\\033[0;31m\".$line.\"\\033[0m\";\n\n if (isset($call['object'])) {\n $name = (!isset($call['object']->name)) ? get_class($call['object']) : $call['object']->name;\n $output .= \" - \\033[0;32m\".$name.\"\\033[0m\";\n }\n\n $output .= \" \\033[0;32m\";\n\n if (isset($call['class'])) {\n $output .= $call['class'].'::';\n }\n\n if ($escape_frame) {\n $output .= \"\\033[0,31m\".$call['function'];\n $escape_frame = false;\n\n $args = [];\n foreach ($call['args'] as $arg) {\n $args[] = $this->toString($arg);\n }\n\n $output .= \"\\n\".str_repeat(' ', 20).\"\\033[0,31m(\".implode(', ', $args);\n } else {\n $output .= \"\\033[0,33m\".$call['function'].'(';\n }\n\n $output .= ')';\n }\n\n if ($p = $this->getPrevious()) {\n $output .= \"\\n\\033[0mCaused by Previous Exception:\\n\";\n $output .= \"\\033[1;31m\".get_class($p).': '.$p->getMessage().\"\\033[0;31m\".\n ($p->getCode() ? ' [code: '.$p->getCode().']' : '');\n }\n\n // next print params\n\n $output .= \"\\n\\033[1;31m--------------------------------------------------------\\n\";\n\n return $output.\"\\033[0m\";\n }", "public function get_trace() : array\n {\n }", "private function dbug() {\n if (!isset($doc_root)) {\n $doc_root = str_replace('\\\\', '/', $_SERVER['DOCUMENT_ROOT']);\n }\n $back = debug_backtrace();\n // you may want not to htmlspecialchars here\n $line = htmlspecialchars($back[0]['line']);\n $file = htmlspecialchars(str_replace(array('\\\\', $doc_root), array('/', ''), $back[0]['file']));\n\n $k = ($back[1]['class'] == 'SQL') ? 3 : 1;\n\n $class = !empty($back[$k]['class']) ? htmlspecialchars($back[$k]['class']) . '::' : '';\n $function = !empty($back[$k]['function']) ? htmlspecialchars($back[$k]['function']) . '() ' : '';\n $args = (count($back[0]['args'] > 0)) ? $back[0]['args'] : $back[0]['object'];\n $args = (count($args) == 1 && $args[0] != '') ? $args[0] : $args;\n\n print '<div style=\"background-color:#eee; width:100%; font-size:11px; font-family: Courier, monospace;\" class=\"myDebug\"><div style=\" font-size:12px; padding:3px; background-color:#ccc\">';\n print \"<b>$class$function =&gt;$file #$line</b></div>\";\n print '<div style=\"padding:5px;\">';\n if (is_array($args) || is_object($args)) {\n print '<pre>';\n print_r($args);\n print '</pre></div>';\n } else {\n print $args . '</div>';\n }\n print '</div>';\n }", "public function pre($_msg){\r\n $db = debug_backtrace(null,1);\r\n echo \"<pre>y<b>\".Data::get($db,'0.file').\":\".Data::get($db,'0.line').\"</b>\".PHP_EOL.var_export($_msg,true).\"</pre>\";\r\n }", "static function show()\n {\n $trace = self::log();\n ?>\n <style type=\"text/css\">\n #-pt-debug { position:relative; z-index:2147483584; background-color:rgba(255,255,255,0.9); margin:20px; padding:20px 20px 40px 20px; font:14px/20px Tahoma; border:#666 dashed 1px; opacity:0.2; text-align:left; }\n #-pt-debug:hover { opacity:1; }\n #-pt-debug legend { text-shadow:1px -2px 0px #FFF; font:bold 16px Tahoma; margin:0px; border:0px; width:auto; }\n #-pt-debug p { margin-top:5px; }\n #-pt-debug p code { display:block; background:#FAFAFA; border:#DDD solid 1px; font-size:12px; padding:10px; margin:5px 0px 0px 30px; }\n #-pt-debug .pt-error { color:#CB1818; }\n #-pt-debug .pt-warning { color:#E88500; }\n #-pt-debug ._cls { position:absolute; top:20px; right:15px; color:#E00; font-weight:bold; font-size:16px; }\n </style>\n <fieldset id=\"-pt-debug\">\n <legend>DEBUG MESSAGE</legend>\n <?php foreach ($trace as $value) { ?>\n <p class=\"pt-<?php echo $value['type']; ?>\"><?php echo is_string($value['message']) ? $value['message'] : var_export($value['message'], true); ?></p>\n <?php } ?>\n <a class=\"_cls\" href=\"javascript:;\" onclick=\"this.parentNode.style.display='none'\">CLOSE</a>\n </fieldset>\n <?php\n }", "public function display()\r\n\t{\r\n debug_print_backtrace();\r\n\t\tdie(\"\\n(\" . date('m/d/y @ h:i:sA', time()) . \") A TACException occured: \" . $this->exception . \"\\n\");\r\n\t}", "public function backtrace( $function_name ) {\n\n if ( true === WP_DEBUG ) {\n\n $backtrace = debug_backtrace();\n\n $backtrace_info = array(\n 'class' => $backtrace[1]['class'],\n 'file' => basename( $backtrace[1]['file'] ),\n 'line' => $backtrace[1]['line'],\n 'function' => $backtrace[2]['function'],\n //'object' => $backtrace[1]['object'],\n //'type' => $backtrace[1]['type'],\n //'args' => $backtrace[1]['args'],\n );\n\n $this->log( 'Backtrace: ' . $function_name );\n\n foreach ( $backtrace_info as $key => $value ) {\n $this->log( ' ' . $key . ': ' . $value, false);\n }\n }\n }", "protected function Debug($var){\n\t\t$bt = debug_backtrace();\n\t\t$dump = new CVarDumper();\n\t\t$debug = '<div style=\"display:block;background-color:gold;border-radius:10px;border:solid 1px brown;padding:10px;z-index:10000;\"><pre>';\n\t\t$debug .= '<h4>function: '.$bt[1]['function'].'() line('.$bt[0]['line'].')'.'</h4>';\n\t\t$debug .= $dump->dumpAsString($var);\n\t\t$debug .= \"</pre></div>\\n\";\n\t\tYii::app()->params['debugContent'] .=$debug;\n\t}", "function turk_debug($mt) {\n\t\techo \"<br /><br />\\n\\nRawData<br />\\n\".$mt->RawData.\"\\n\\n<br /><br />\";\n\t\techo \"<br /><br />\\n\\nSOAPData<br />\\n\".$mt->SOAPData.\"\\n\\n<br /><br />\";\n\n\t\techo $mt->Fault;\n\t\techo $mt->Error;\t\n\t}", "function trace( $message )\n{\n\t$registry = Registry::getInstance();\n\tif ( $registry->keyExists( 'trace_messages' ) )\n\t{\n\t\t$trace_messages = $registry->get( 'trace_messages' );\n\t}\n\t$trace_messages[] = $message;\n\t$registry->set( \"trace_messages\", $trace_messages );\n}", "public static function traceBegin() \n\t{\n\t\tacPhpCas::setReporting();\n\t\tphpCAS::traceBegin();\t\t\n\t}", "public static function trace(array $trace = NULL)\n\t{\n\t\tif ($trace === NULL)\n\t\t{\n\t\t\t// Start a new trace\n\t\t\t$trace = debug_backtrace();\n\t\t}\n\n\t\t// Non-standard function calls\n\t\t$statements = array('include', 'include_once', 'require', 'require_once');\n\n\t\t$output = array();\n\t\tforeach ($trace as $step)\n\t\t{\n\t\t\tif ( ! (isset($step['function']) AND isset($step['file'])))\n\t\t\t{\n\t\t\t\t// Ignore this line, it has unusable data\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Set the function name\n\t\t\t$function = $step['function'];\n\n\t\t\t// Set the file and line\n\t\t\t$file = self::debug_path($step['file']);\n\t\t\t$line = $step['line'];\n\n\t\t\tif (isset($step['class']))\n\t\t\t{\n\t\t\t\t// Change the function to a method\n\t\t\t\t$function = $step['class'].$step['type'].$function;\n\t\t\t}\n\n\t\t\tif (isset($step['args']))\n\t\t\t{\n\t\t\t\tif (in_array($function, $statements))\n\t\t\t\t{\n\t\t\t\t\t// Sanitize the path name\n\t\t\t\t\t$function .= ' '.self::debug_path($step['args'][0]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Sanitize the function arguments\n\t\t\t\t\t$function .= '('.implode(', ', $args = array_map('Kohana::debug_var', $step['args'])).')';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$output[] = array(\n\t\t\t\t'function' => $function,\n\t\t\t\t'file' => self::debug_path($step['file']),\n\t\t\t\t'line' => $step['line']);\n\t\t}\n\n\t\treturn $output;\n\t}", "function dumper($error)\n{\n $d = debug_backtrace();\n echo '<pre>';\n echo '<br />';\n echo $d[0]['file'] . ' on line ' . $d[0]['line'];\n echo '<br />';\n echo print_r($error, TRUE);\n //echo '<hr>';\n echo '</pre>';\n}", "protected function debugStringBacktrace()\n {\n $trace = '';\n $count = 0;\n // format backtrace\n foreach (debug_backtrace() as $item) {\n // ignore current file form backtrace\n if (isset($item['file']) && $item['file'] === __FILE__) {\n continue;\n }\n\n // prepare args\n $args = '';\n\n // check args\n if (!isset($item['args'])) {\n $item['args'] = array();\n }\n\n // format arguments, if there is any\n if (0 < count($item['args'])) {\n foreach ($item['args'] as $a) {\n switch (true) {\n case is_array($a):\n $args .= 'Array';\n break;\n case is_object($a):\n $args .= get_class($a);\n break;\n case is_bool($a):\n $args .= ( true === $a ? 'true' : 'false');\n break;\n case is_numeric($a):\n $args .= $a;\n break;\n case is_null($a):\n $args .= 'NULL';\n break;\n case is_string($a):\n $args .= \"'\" . $a . \"'\";\n break;\n\n default:\n $args .= gettype($a);\n break;\n }\n $args .= ',';\n }\n }\n\n $trace .= sprintf(\n '#%d %s(%s): %s%s(%s)%s',\n $count,\n (isset($item['file']) ? $item['file'] : ''),\n (isset($item['line']) ? $item['line'] : ''),\n (isset($item['class']) ? $item['class'] . $item['type'] : ''),\n (isset($item['function']) ? $item['function'] : '' ),\n trim($args, ','),\n PHP_EOL\n );\n\n $count++;\n }\n\n return $trace;\n }", "function get_trace(int $options = 0, int $limit = 0, int $index = null, string $field = null, int $slice = null): mixed\n{\n $stack = debug_backtrace($options, limit: $limit ? $limit + 1 : 0);\n\n // Drop self.\n array_shift($stack);\n\n // When slice wanted (@internal).\n $slice && $stack = array_slice($stack, $slice);\n\n foreach ($stack as $i => $trace) {\n $trace = [\n // Index.\n '#' => $i,\n // For \"[internal function]\", \"{closure}\" stuff.\n 'file' => $trace['file'] ?? null,\n 'line' => $trace['line'] ?? null,\n ] + $trace + [\n // Additions.\n 'callee' => $trace['function'] ?? null,\n 'caller' => null, 'callerClass' => null, 'callerMethod' => null,\n ];\n\n if (isset($trace['file'], $trace['line'])) {\n $trace['callPath'] = $trace['file'] . ':' . $trace['line'];\n } else {\n $trace['callPath'] = '[internal function]:';\n }\n\n if (isset($trace['class'])) {\n $trace['method'] = $trace['function'];\n $trace['methodType'] = ($trace['type'] == '::') ? 'static' : 'non-static';\n }\n if (isset($stack[$i + 1]['function'])) {\n $trace['caller'] = $stack[$i + 1]['function'];\n }\n if (isset($stack[$i + 1]['class'])) {\n $trace['callerClass'] = $stack[$i + 1]['class'];\n $trace['callerMethod'] = sprintf('%s::%s', $stack[$i + 1]['class'], $stack[$i + 1]['function']);\n }\n\n $stack[$i] = $trace;\n }\n\n return is_null($index) ? $stack : ($stack[$index][$field] ?? $stack[$index] ?? null);\n}", "public static function trace($ar, $color = \"F00\"){\n //display objects, array, strings properly.\n\n echo '<pre style=\"z-index:9999;color:#'.$color.'\">';\n print_r($ar);\n echo '</pre><br style=\"clear:both;\" /><br />';\n }", "function printCallstackAndDie() {\n echo \"Fatal Error. Please contact your system administrator.<br/>\";\n\n $callers = debug_backtrace();\n\n echo \"Dump Trace<br/>\";\n foreach ($callers as $caller) {\n echo \"Function: \" . $caller['function'] . \" Line: \" \n . $caller['line'] . \"<br/>\";\n }\n die();\n}", "public function getDebugTrace() {\n\t\t$trace = debug_backtrace();\n\t\t$i = 1;\n\t\twhile (isset($trace[$i]) and isset($trace[$i + 1]) and isset($trace[$i + 1]['class']) and ($trace[$i + 1]['class'] === 'Sy\\Db\\Gate')) ++$i;\n\t\t$res['class'] = isset($trace[$i + 1]['class']) ? $trace[$i + 1]['class'] : '';\n\t\t$res['function'] = isset($trace[$i + 1]['function']) ? $trace[$i + 1]['function'] : '';\n\t\t$res['file'] = $trace[$i]['file'];\n\t\t$res['line'] = $trace[$i]['line'];\n\t\treturn $res;\n\t}", "public function __toString() {\n\t\treturn implode(\"\\n\", $this->trace);\n\t}", "protected function getBackTrace(){\n\t\treturn array('Inicio', 'Facturaci&oacute;n');\n\t}", "function renderStackTrace($trace, $sanitize = true) {\n\n\t$traceString = '';\n\n\tforeach ($trace as $i => $stackFrame) {\n\t\t$file = isset($stackFrame['file']) ? $stackFrame['file'] : '[internal function]' ;\n\t\t$lineNum = isset($stackFrame['line']) ? '(' . $stackFrame['line'] . ')' : '';\n\t\t$classAndFunction = $stackFrame['class'] . $stackFrame['type'] . $stackFrame['function'];\n\t\t$args = array();\n\n\t\tif (!$sanitize) {\n\t\t\tforeach ($stackFrame['args'] as $arg) {\n\t\t\t\tif (is_string($arg)) {\n\t\t\t\t\t\t$args[] = \"'\" . $arg . \"'\";\n\t\t\t\t} elseif (is_array($arg)) {\n\t\t\t\t\t\t$args[] = 'Array';\n\t\t\t\t} elseif (is_null($arg)) {\n\t\t\t\t\t\t$args[] = 'NULL';\n\t\t\t\t} elseif (is_bool($arg)) {\n\t\t\t\t\t\t$args[] = ($arg) ? 'true' : 'false';\n\t\t\t\t} elseif (is_object($arg)) {\n\t\t\t\t\t\t$args[] = get_class($arg);\n\t\t\t\t} elseif (is_resource($arg)) {\n\t\t\t\t\t\t$args[] = get_resource_type($arg);\n\t\t\t\t} else {\n\t\t\t\t\t\t$args[] = $arg;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$args = join(', ', $args);\n\t\t$traceString .= \"#{$i} {$file}{$lineNum}: {$classAndFunction}({$args})\\n\";\n\n\t\tif ($i === count($trace) - 1) {\n\t\t\t$traceString .= '#' . count($trace) . ' {main}';\n\t\t}\n\t}\n\n\treturn $traceString;\n}", "public static function addBackTrace($type = 2){\r\n\t}", "function d() {\n $variables = func_get_args();\n $trace = debug_backtrace(null, 1);\n \\Yii::$app->logger->debugInternal($variables, $trace);\n }", "function phan_print_backtrace(bool $is_crash = false, int $frames_to_skip = 2): void\n{\n // Uncomment this if even trying to print the details would crash\n /*\n ob_start();\n debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n fwrite(STDERR, rtrim(ob_get_clean() ?: \"failed to dump backtrace\") . PHP_EOL);\n */\n\n $frames = debug_backtrace();\n if (isset($frames[1])) {\n fwrite(STDERR, 'More details:' . PHP_EOL);\n if (class_exists(Config::class, false)) {\n $max_frame_length = max(100, Config::getValue('debug_max_frame_length'));\n } else {\n $max_frame_length = 1000;\n }\n $truncated = false;\n foreach ($frames as $i => $frame) {\n if ($i < $frames_to_skip) {\n continue;\n }\n $frame_details = \\Phan\\Debug\\Frame::frameToString($frame);\n if (strlen($frame_details) > $max_frame_length) {\n $truncated = true;\n if (function_exists('mb_substr')) {\n $frame_details = mb_substr($frame_details, 0, $max_frame_length) . '...';\n } else {\n $frame_details = substr($frame_details, 0, $max_frame_length) . '...';\n }\n }\n fprintf(STDERR, '#%d: %s' . PHP_EOL, $i, $frame_details);\n }\n if ($truncated) {\n fwrite(STDERR, \"(Some long strings (usually JSON of AST Nodes) were truncated. To print more details for some stack frames of this \" . ($is_crash ? \"crash\" : \"log\") . \", \" .\n \"increase the Phan config setting debug_max_frame_length)\" . PHP_EOL);\n }\n }\n}", "public function iterateTrace() {\n\t\t#Get the trace and init the string we're gonna be using to collect results\n\t\t$trace = $this->makeTrace();\n\t\t$_ret = '';\n\t\t\n\t\t#Loop over the trace and collect the results into _ret\n\t\tforeach($trace as $entry) {\n\t\t\t$_ret.= $this->stringifyEntry($entry);\n\t\t}\n\t\t\n\t\t#Return _ret\n\t\treturn $_ret;\n\t}", "protected function debugBacktrace($depth = 5)\n {\n $trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT,\n $depth);\n $retval = '';\n $comma = '';\n $level = 1;\n\n foreach($trace as $call)\n {\n if (array_key_exists('class', $call))\n $classRef = $call['class'] . '::';\n else\n $classRef = '';\n $function = $call['function'];\n if ($function == 'constDebug' || $function == 'debugBacktrace')\n continue;\n $retval .= \"$comma level function=$classRef$function\" .\n \" called by line=\" . $call['line'] .\n \" in \" . $call['file'];\n $comma = \",\\n\";\n $level++;\n }\n return htmlspecialchars($retval);\n }", "public function trace($func)\r\n\t{\r\n\t\tYii::trace(get_class($this) . '.' . $func.'()', 'extensions.MongoYii.EMongoFile');\r\n\t}", "public function get_debug_backtrace()\n {\n return debug_backtrace();\n }", "function get_backtrace_list( $trace )\n\t{\n\t\tif ( !is_array( $trace ) && is_scalar( $trace ) )\n\t\t\treturn \"<div class='trace-error'>$trace</div>\";\n\n\t\t$ftrace = $this->prepare_backtrace( $trace );\n\n\t\t$d = array(\n\t\t\t'func' => '',\n\t\t\t'file' => '',\n\t\t\t'line' => '',\n\t\t\t'args' => array(),\n\t\t);\n\t\t$list = array();\n\n\t\tforeach ( $ftrace as $key => $t )\n\t\t{\n\t\t\t$t = array_merge( $d, $t );\n\n\t\t\t$lineclass = ( $key % 2 ) ? 'even' : 'odd';\n\t\t\t$args_html = !empty( $t['args'] )\n\t\t\t\t? sprintf(' <span class=\"args\">%s</span> ', implode(', ', $t['args']) )\n\t\t\t\t: '';\n\n\t\t\t$filemeta = $t['file'] ? \"<span class='file'>{$t['file']}</span> <span class='line'>{$t['line']}</span>\" : '';\n\n\t\t\t$line = <<<HTML\n\t\t\t<div class=\"trace $lineclass\">\n\t\t\t\t<div class=\"called\">{$t['func']}($args_html)</div>\n\t\t\t\t<div class='filemeta'>$filemeta</div>\n\t\t\t</div>\nHTML;\n\n\t\t\t$list[] = $line;\n\t\t}\n\n\t\treturn implode( $list );\n\t}", "static function out(){\n\t\tself::$out['i']++;\n\t\t$trace = debug_backtrace();\n\t\tforeach($trace as $part){\n\t\t\tif($part['file'] && __FILE__ != $part['file']){\n\t\t\t\t$trace = $part;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$args = func_get_args();\n\t\tforeach($args as $var){\n\t\t\t$file = self::abbreviateFilePath($trace['file']);\n\t\t\tself::sendout(\"[\".$file.':'.$trace['line'].\"] \".self::$out['i'].\": \".var_export($var,true).\"\\n\");\n\t\t}\n\t\tif(self::$usleepOut){\n\t\t\tusleep(self::$usleepOut);\n\t\t}\n\t}", "function showMe($output) {\r\n echo '<pre>';\r\n print_r($showMe);\r\n echo '</pre>';\r\n}", "static function endshow($val) {\n\t\tif(!Director::isLive()) {\n\t\t\t$caller = Debug::caller();\n\t\t\techo \"<hr>\\n<h3>Debug \\n<span style=\\\"font-size: 65%\\\">($caller[class]$caller[type]$caller[function]() \\n<span style=\\\"font-weight:normal\\\">in line</span> $caller[line] \\n<span style=\\\"font-weight:normal\\\">of</span> \" . basename($caller['file']) . \")</span>\\n</h3>\\n\";\n\t\t\techo Debug::text($val);\n\t\t\tdie();\n\t\t}\n\t}", "function atkGetTrace($format=\"html\")\n{\n\t// Return if the debug_backtrace function doesn't exist\n\tif(!function_exists(\"debug_backtrace\"))\n\treturn \"Incorrect php-version for atk_get_trace()\";\n\n\t// Get the debug backtrace\n\t$traceArr = debug_backtrace();\n\n\t// Remove the call of atk_get_trace\n\tarray_shift($traceArr);\n\n\t// Start with an empty result;\n\t$ret = \"\";\n\n\t$theSpacer = \"\";\n\n\t// Loop through all items found in the backtrace\n\tfor($i=0, $_i = count($traceArr); $i < $_i; $i++)\n\t//for($i=count($traceArr)-1; $i >= 0; $i--)\n\t{\n\t\t// Skip this item in the backtrace if empty\n\t\tif (empty($traceArr[$i]))\n\t\tcontinue;\n\n\t\t// Don't display an atkerror statement itself.\n\t\tif ($traceArr[$i][\"function\"]==\"atkerror\")\n\t\tcontinue;\n\n\t\t// Read the source location\n\t\tif (isset($traceArr[$i][\"file\"]))\n\t\t$location = $traceArr[$i][\"file\"] . (isset($traceArr[$i][\"line\"]) ? sprintf(\", line %d\", $traceArr[$i][\"line\"]) : \"[Unknown line]\");\n\t\telse\n\t\t$location = \"[PHP KERNEL]\";\n\n\t\t// Read the statement\n\t\tif (isset($traceArr[$i][\"class\"]))\n\t\t{\n\t\t\t$statement = $traceArr[$i][\"class\"];\n\t\t\tif (isset($traceArr[$i][\"type\"]))\n\t\t\t$statement .= $traceArr[$i][\"type\"];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$statement = \"\";\n\t\t}\n\t\t$statement .= $traceArr[$i][\"function\"];\n\n\t\t// Initialize the functionParamArr array\n\t\t$functionParamArr = array();\n\n\t\t// Parse any arguments into the array\n\t\tif(isset($traceArr[$i][\"args\"]))\n\t\t{\n\t\t\tforeach($traceArr[$i][\"args\"] as $val)\n\t\t\t{\n\t\t\t\tif(is_array($val))\n\t\t\t\t{\n\t\t\t\t\t$valArr = array();\n\t\t\t\t\tforeach($val as $name=>$value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(is_numeric($name))\n\t\t\t\t\t\t$valArr[] = $name;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (is_object($value))\n\t\t\t\t\t\t\t$valArr[] = sprintf(\"%s=Object(%s)\", $name, get_class($value));\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$valArr[] = $name.\"=\".$value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$stringval = \"array(\".implode(\", \", $valArr).\")\";\n\t\t\t\t}\n\t\t\t\telse if (is_null($val)) $stringval = 'null';\n\t\t\t\telse if (is_object($val)) $stringval = sprintf(\"Object(%s)\", get_class($val));\n\t\t\t\telse if (is_bool($val)) $stringval = $val ? 'true' : 'false';\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(strlen($val.$theSpacer) > 103)\n\t\t\t\t\t$stringval = '\"'.substr($val, 0, 100-strlen($theSpacer)).'\"...';\n\t\t\t\t\telse\n\t\t\t\t\t$stringval = '\"'.$val.'\"';\n\t\t\t\t}\n\t\t\t\t$functionParamArr[] = $theSpacer.\" \".$stringval;\n\t\t\t}\n\t\t}\n\t\t$functionParams = implode(\",\\n\", $functionParamArr);\n\n\t\t$ret .= $theSpacer.\"@\".$location.\"\\n\";\n\t\t$ret .= $theSpacer.$statement;\n\t\t$ret .= (strlen($functionParams)?\"\\n\".$theSpacer.\"(\\n\".$functionParams.\"\\n\".$theSpacer.\")\":\"()\").\"\\n\";\n\n\t\t// Add indentation\n\t\t$theSpacer .= \" \";\n\t}\n\n\t// If html format should be used, replace the html special chars with html entities and put the backtrace within preformat tags.\n\tif ($format==\"html\")\n\t$ret = \"<pre>\" . htmlspecialchars($ret) . \"</pre>\";\n\n\t// Return the generated trace\n\treturn $ret;\n}", "public function debugInfo() {\r\n saprfc_function_debug_info($this->fce);\r\n }", "function pdc($var) {\n $callingClass = getCallingClass();\n\n if (empty($callingClass)) {\n $trace = debug_backtrace();\n $callingClass = 'File: \"'.$trace[0]['file'].'\" | Line: \"'.$trace[0]['line'].'\"\"';\n }\n\n echo 'Print, Dump and Continue Called From: '.$callingClass.\" \\r\\n\\r\\n \";\n print_r($var);\n}", "public static function backtrace($trace)\n {\n if (! is_array($trace)) {\n return;\n }\n\n // Final output\n $output = array();\n\n foreach ($trace as $entry) {\n $temp = '<li>';\n\n if (isset($entry['file'])) {\n $temp .= self::lang('core.error_file_line', preg_replace('!^'.preg_quote(DOCROOT).'!', '', $entry['file']), $entry['line']);\n }\n\n $temp .= '<pre>';\n\n if (isset($entry['class'])) {\n // Add class and call type\n $temp .= $entry['class'].$entry['type'];\n }\n\n // Add function\n $temp .= $entry['function'].'( ';\n\n // Add function args\n if (isset($entry['args']) and is_array($entry['args'])) {\n // Separator starts as nothing\n $sep = '';\n\n while ($arg = array_shift($entry['args'])) {\n if (is_string($arg) and is_file($arg)) {\n // Remove docroot from filename\n $arg = preg_replace('!^'.preg_quote(DOCROOT).'!', '', $arg);\n }\n\n $temp .= $sep.html::specialchars(print_r($arg, true));\n\n // Change separator to a comma\n $sep = ', ';\n }\n }\n\n $temp .= ' )</pre></li>';\n\n $output[] = $temp;\n }\n\n return '<ul class=\"backtrace\">'.implode(\"\\n\", $output).'</ul>';\n }", "function get_caller(){\n\t\t$trace = array_reverse(debug_backtrace());\n\t\t$caller = array();\n\t\n\t\tforeach($trace as $call){\n\t\t\tif(isset($call['class']) && __CLASS__ == $call['class']){\n\t\t\t\tcontinue; // Filter out wpdb calls.\n\t\t\t}\n\t\t\t$caller[] = isset($call['class']) ? \"{$call['class']}->{$call['function']}\" : $call['function'];\n\t\t}\n\t\n\t\treturn join(', ', $caller);\n\t}", "public function end_trace()\n {\n }" ]
[ "0.79818815", "0.7443046", "0.72203946", "0.717282", "0.71159023", "0.71159023", "0.7082609", "0.701203", "0.6825635", "0.6698397", "0.66838485", "0.6657495", "0.6636394", "0.6627789", "0.6615685", "0.65642595", "0.65520394", "0.65518606", "0.6511707", "0.6486994", "0.64732033", "0.64662486", "0.6455184", "0.64452857", "0.6386674", "0.63532364", "0.6340286", "0.6334076", "0.6329675", "0.6293601", "0.6290065", "0.6283515", "0.6271297", "0.62691796", "0.6261544", "0.6256478", "0.6246294", "0.62445277", "0.62445277", "0.62121236", "0.6179698", "0.6169713", "0.616698", "0.6150946", "0.6131022", "0.60964257", "0.6087133", "0.60788596", "0.6069704", "0.60536134", "0.60518396", "0.6050182", "0.6050182", "0.6048322", "0.6044927", "0.6043146", "0.6015932", "0.6015841", "0.6007308", "0.60048205", "0.6003826", "0.5990071", "0.596149", "0.59500974", "0.5938527", "0.5936627", "0.5926212", "0.5925665", "0.5919449", "0.5897052", "0.58929217", "0.58878976", "0.5883675", "0.58795464", "0.5876156", "0.5850264", "0.58085036", "0.57869214", "0.5775143", "0.5758622", "0.57507384", "0.5745488", "0.5743775", "0.57146245", "0.5686883", "0.5684407", "0.5668166", "0.56640136", "0.56577986", "0.565741", "0.562476", "0.56109095", "0.5607982", "0.5604725", "0.5593652", "0.5580804", "0.55558014", "0.5552222", "0.5546417", "0.55326647" ]
0.693635
8
Turns the given name to a browseracceptable, reproducable, id
function idfy($name=false){ if(!$name) $name = uniqid(false, true); return 'id'.substr(md5($name),20); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertNameToID($name) {\n $name = str_replace(\" \",\"-\",$name);\n $name = strtolower($name);\n return $name;\n}", "static function html_id($name)\r\n\t{\r\n\t\tglobal $smcFunc;\r\n\t\t\r\n\t\t$name = str_replace(array('%3A', '+', '%'), array(':', '_', '.'), urlencode(un_htmlspecialchars($name)));\r\n\t\t\r\n\t\twhile($name[0] == '.')\r\n\t\t\t$name = substr($name, 1);\r\n\t\treturn $name;\r\n\t}", "public function nameToId($name)\n {\n // If the username already contains an ampersand, then we don't need to process. \n $pos = strpos($name, '@');\n if ($pos !== false)\n {\n return $name;\n }\n \n $url = 'http://idgettr.com';\n switch ($this->get('params')->get('source'))\n {\n case 'user_photos':\n case 'friend_photos':\n $data = array('photostream' => 'http://www.flickr.com/photos/'.$name);\n break;\n case 'group_photos':\n $data = array('photostream' => 'https://www.flickr.com/groups/'.$name);\n break;\n case 'set_photos':\n $data = array('photostream' => 'https://www.flickr.com/photos/'.$name.'/sets/'.$this->get('params')->get('flickrset'));\n break;\n }\n\n if ($url)\n {\n if (function_exists('curl_init'))\n {\n $useragent = \"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1)\";\n\n $curl_handle = curl_init();\n curl_setopt($curl_handle, CURLOPT_URL, $url);\n curl_setopt($curl_handle, CURLOPT_POST, 1);\n curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $data);\n curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 30);\n curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl_handle, CURLOPT_REFERER, 'idgettr.com');\n curl_setopt($curl_handle, CURLOPT_USERAGENT, $useragent);\n $buffer = curl_exec($curl_handle);\n curl_close($curl_handle);\n\n if (!empty($buffer))\n {\n $pos = strpos($buffer, '<p><strong>id:</strong> ');\n if ($pos !== false)\n {\n $pos_start = $pos + 24;\n $pos_end = strpos($buffer, '</p>', $pos_start);\n $length = $pos_end - $pos_start;\n $id = substr($buffer, $pos_start, $length);\n return $id;\n } \n }\n }\n }\n\n\t\treturn false;\n }", "public static function class2id($name) {\n $nameWithoutNumber = preg_replace('/\\d/', '', $name);\n if (!ctype_upper($nameWithoutNumber)) {\n $spacedWord = preg_replace('/(?<![A-Z])[A-Z]/', ' \\0', $name);\n $words = explode(' ', trim($spacedWord, ' '));\n $words[0] = strtolower($words[0]);\n $nameID = \"\";\n foreach ($words as $word) {\n $nameID .= $word;\n }\n } else {\n $nameID = $name;\n }\n return $nameID;\n }", "function getUniqueId(string $name): string;", "function section_id_convert($name) {\n\n\t// remove the hyphen\n\t$id = str_replace(\"-\", \"\", $name);\n\t\n\t// make lowercase\n\t$id = strtolower($id);\n\t\n\t// return clean value\n\treturn $id;\n\t\n}", "function field_name_to_id($name) {\n if (preg_match('/^([^\\[\\]]+)\\[(.*)\\]$/', $name, $matches)) {\n return $matches[1] . '.' . $matches[2];\n } else {\n return $name;\n }\n}", "function rectifyName($name){\r\n return getNameForId(getIdForName($name));\r\n}", "protected function _convertToID($name)\n\t{\n\t\t//Prepend form name\n\t\treturn \"{$this->_attributes['id']}.$name\";\n\t}", "static function getnerateIdByName($name)\n\t{\n\t\treturn md5(strtolower($name));\n\t}", "private function normalizeIdentifier(string $name): string\n {\n if (preg_match('{[^\\x80-\\xFF]+$}AD', $name)) {\n return strtolower($name);\n }\n\n return $name;\n }", "public function forName();", "function atwork_id_safe($string) {\n // Replace with dashes anything that isn't A-Z, numbers, dashes, or underscores.\n $string = strtolower(preg_replace('/[^a-zA-Z0-9_-]+/', '-', $string));\n // If the first character is not a-z, add 'n' in front.\n if (!ctype_lower($string{0})) { // Don't use ctype_alpha since its locale aware.\n $string = 'id'. $string;\n }\n return $string;\n}", "public function getReplacementId($name);", "function safeId($string) {\r\n //Lower case everything\r\n $string = strtolower($string);\r\n //Make alphanumeric (removes all other characters)\r\n $string = preg_replace(\"/[^a-z0-9_\\s-]/\", \"\", $string);\r\n //Clean up multiple dashes or whitespaces\r\n $string = preg_replace(\"/[\\s-]+/\", \" \", $string);\r\n //Convert whitespaces and underscore to dash\r\n $string = preg_replace(\"/[\\s_]/\", \"-\", $string);\r\n return $string;\r\n}", "public function id($name)\n {\n return self::$driver->id($name);\n }", "public function id($name)\n {\n $keepIdx = preg_replace('/\\[(\\d+)\\]/', \"_$1\", $name);\n $unbracketted = $this->removeBrackets($keepIdx, '_');\n $nothingWeird = preg_replace('/[^\\w\\d\\_]+?/', \"\", $unbracketted);\n $noTrail = preg_replace('/_$/', \"\", $nothingWeird);\n\n $clean = $noTrail;\n\n if (!is_null($this->associatedEntity) && $this->associatedEntity->isSupportedAttribute($name)) {\n $clean = $this->associatedEntity->getInputName() . \"_\" . $clean;\n }\n\n return $this->keys['POST_WRAP'] . \"_\" . $clean;\n }", "public static function nameToId($name) {\n return DB::queryFirstField(\"SELECT id FROM users WHERE username=%s \", $name);\n }", "function seoname($name) {\n\tglobal $language_char_conversions, $originals, $replacements;\n\tif ((isset($language_char_conversions)) && ($language_char_conversions == 1)) {\n\t\t$search = explode(\",\", $originals);\n\t\t$replace = explode(\",\", $replacements);\n\t\t$name = str_replace($search, $replace, $name);\n\t}\n\t$name = stripslashes($name);\n\t$name = strtolower($name);\n\t$name = str_replace(\"&\", \"and\", $name);\n\t$name = str_replace(\" \", \"-\", $name);\n\t$name = str_replace(\"---\", \"-\", $name);\n\t$name = str_replace(\"/\", \"-\", $name);\n\t$name = str_replace(\"?\", \"\", $name);\n\t$name = preg_replace( \"/[\\.,\\\";'\\:]/\", \"\", $name );\n\t//$name = urlencode($name);\n\treturn $name;\n}", "protected function defineNameId(){\n list($name,$id)=$this->resolveNameID();\n $this->_id=$this->htmlOptions['id']=$id;\n\t\t$this->_name=$this->htmlOptions['name']=$name;\n }", "protected function generateIdByName(): string\n {\n return \"auto_id_\" . $this->name;\n }", "public static function camel2id($name, $separator = '-', $strict = false) {\n $regex = $strict ? '/[A-Z]/' : '/(?<![A-Z])[A-Z]/';\n if ($separator === '_') {\n return trim(strtolower(preg_replace($regex, '_\\0', $name)), '_');\n } else {\n return trim(strtolower(str_replace('_', $separator, preg_replace($regex, $separator . '\\0', $name))), $separator);\n }\n }", "public function id()\n\t{\n\t\t// If the driver is an instance of the Cookie driver, we are able to\n\t\t// just return any string since the Cookie driver has no real idea\n\t\t// of a server side persisted session with an ID.\n\t\treturn \\Core\\Str::random('alnum', 40);\n\t}", "function slugify ($str) { // turn name into slug for ID\r\n\t$slug = str_replace(' ','-',strtolower($str));\r\n\treturn $slug;\t\r\n}", "private function generateURL($name)\n {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n return md5($name.substr(str_shuffle($characters), 0, 10));\n }", "public static function htmlId($input) {\n $input = str_replace(' ', '-', $input);\n $input = str_replace('/', '-', $input);\n $input = str_replace(',', '-', $input);\n $input = str_replace('|', '-', $input);\n $input = str_replace('.', '-', $input);\n $input = str_replace('ä', 'ae', $input);\n $input = str_replace('ü', 'ue', $input);\n $input = str_replace('ö', 'oe', $input);\n $input = preg_replace('/[^[:alnum:]]/', '', trim($input));\n while (strpos($input, '--') !== FALSE) {\n $input = str_replace('--', '-', $input);\n }\n return $input;\n }", "public static function tidyName($name) {\n if (!Utils::isEmpty($name)) {\n $maps = [\n 'Academies News' => 'Academies',\n 'Alternative provision focus' => 'Alternative provision',\n 'Behavior' => 'Behaviour',\n 'Book review' => 'Book reviews',\n 'Business and financial management' => 'Business, finance and economics',\n 'Ed tech' => 'EdTech',\n 'Revision Tips' => 'Revision tips',\n 'Local authority' => 'Local government',\n 'Local authorities' => 'Local government',\n 'Ofsted blog' => 'Ofsted',\n 'Ofsted watch' => 'Ofsted',\n 'PE' => 'Physical education',\n 'RE' => 'Religious education',\n 'PSHE' => 'Personal, social and health education',\n 'religion' => 'Religion',\n ];\n // CSV hacks: issues experienced in CSV version where tagname explode didnt work,\n // e.g. Business, finance and economics => gives 2 tagnames\n $maps['finance and economics'] = 'Business, finance and economics';\n //\n if (isset($maps[$name])) {\n $name = $maps[$name];\n }\n elseif (preg_match('/^TES /', $name)) {\n $name = 'Tes ' . substr($name, 4);\n }\n }\n return $name;\n }", "public function uniqueName($name)\n\t{\n\t\t$name_attempt = $name;\n\t\t$match = true;\n\t\t\n\t\t// build slug/number combos until an unused slug is found\n\t\tfor($i = 1; $match; $i++)\n\t\t{\n\t\t\t$match = false;\n\t\t\t\n\t\t\tif($i > 1) $name_attempt = $name.' ('.$i.')';\n\t\t\telse $name_attempt = $name;\n\t\t\t\n\t\t\tforeach($this->layouts as $layout)\n\t\t\t{\n\t\t\t\tif($this->$layout->name == $name_attempt)\n\t\t\t\t{\n\t\t\t\t\t$match = true;\n\t\t\t\t}//end if\n\t\t\t}//end if\n\t\t}//end while\n\t\t\n\t\t// when we get to here, a valid slug was built. Assign to slug.\n\t\t$name = $name_attempt;\n\t\t\n\t\t// unset temp variable\n\t\tunset($name_attempt);\n\t\t\n\t\treturn $name;\n\t}", "public static function get_id_for_name( $name ) {\n\t\t$names = array(\n\t\t\t'wordpress' => WordPress_Module::MODULE_ID,\n\t\t\t'apache' => Apache_Module::MODULE_ID,\n\t\t\t'nginx' => Nginx_Module::MODULE_ID,\n\t\t);\n\n\t\tif ( isset( $names[ $name ] ) ) {\n\t\t\treturn $names[ $name ];\n\t\t}\n\n\t\treturn false;\n\t}", "function nameFromIduri( $iduri )\n{\n\treturn $iduri;\n}", "function test_getIdByName() {\r\n\t\t$myName = \"moderator\";\r\n $myId = MemberClassesDB::getIdByName($myName);\r\n\t\t$this->assertEqual($myId, \"3\",\r\n\t\t\t\t\"Should return 3 for name moderator but returned \".$myId);\r\n\t}", "function auth_browseruid(){\n $uid = '';\n if (empty($_SERVER['HTTP_USER_AGENT'])) { $_SERVER['HTTP_USER_AGENT']='USER_AGENT'; }\n if (empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $_SERVER['HTTP_ACCEPT_LANGUAGE']='ACCEPT_LANGUAGE'; }\n if (empty($_SERVER['HTTP_ACCEPT_CHARSET'])) { $_SERVER['HTTP_ACCEPT_CHARSET']='ACCEPT_CHARSET'; }\n $uid .= $_SERVER['HTTP_USER_AGENT'];\n $uid .= $_SERVER['HTTP_ACCEPT_LANGUAGE'];\n $uid .= $_SERVER['HTTP_ACCEPT_CHARSET'];\n $uid .= substr($_SERVER['REMOTE_ADDR'],0,strpos($_SERVER['REMOTE_ADDR'],'.'));\n return md5($uid);\n}", "public function id(): string\n {\n if ($this->id) {\n return $this->id;\n }\n\n if ($this->name) {\n return $this->id = $this->generateIdByName();\n }\n\n return $this->id = Str::random(4);\n }", "function clean_id($text) {\n $text = strtolower($text);\n $text = str_replace('/', '-', $text);\n $text = preg_replace('/[^0-9a-zA-Z-_]/', '', $text);\n return $text;\n}", "function fetchId($name)\n {\n //return $this->_parent->_name.'-'.\"popup-$name[1]\";\n return $this->_parent->getName().'-'.\"popup-$name[1]\";\n }", "function dev_get_title_from_id( $id ) {\n\treturn ucwords( str_replace( array( '-', '_' ), ' ', $id ) );\n}", "private static function getSiteId($site_name)\n {\n // default to luxurylink, siteId=1\n $site_id = 1;\n\n switch ($site_name) {\n case 'luxurylink':\n $site_id = 1;\n break;\n case 'family':\n $site_id = 2;\n break;\n default:\n $site_id = 1;\n }\n\n return $site_id;\n }", "static public function getBrowserName() {\n\t\treturn (string)self::$browser_name;\n\t}", "public static function createSlug($name,$company_id) { // generate company wise unique slug //\n $slug = Str::slug($name);\n $original = $slug;\n $count = 1;\n while (Campaign::where('company_id',$company_id)->whereSlug($slug)->exists()) { // loop to find the unique slug //\n $slug = \"{$original}-\" . $count++;\n }\n return $slug;\n }", "function get_id() {\n \n $id_okay = true;\n \n if($this->name == \"\") {\n $this->name = $this->classname;\n }\n \n if(\"\" == ($id = isset($_GET[$this->name]) ? $_GET[$this->name] : \"\")) {\n $id = isset($_POST[$this->name]) ? $_POST[$this->name] : \"\";\n }\n \n ## check if the id consists of chars that make up a session\n if(ereg('[^a-z0-9]', $id)){\n\t\t$id_okay = false;\n\t}\n \n if( \"\" == $id || !$id_okay) {\n $newid=true;\n // I'll have to work on this class to figure out how this link works\n $id = md5(uniqid($this->magic));\n }\n \n if(isset($_SERVER['QUERY_STRING'])) {\n $_SERVER['QUERY_STRING'] = ereg_replace(\"(^|&)\".quotemeta(urlencode($this->name)).\"=(.)*(&|$)\",\"\\\\1\", $_SERVER['QUERY_STRING']);\n }\n \n $this->id = $id;\n }", "public static function makeSlug($name);", "public static function sanitizeTechString($name) {\r\n $name = preg_replace('@[^a-zA-Z0-9_-]@', '', $name);\r\n\treturn $name;\r\n }", "public function lookupVanityName( $name ){ return $this->APICall( array('lookupVanityName' => $name), \"Failed to get the vanity ID for \" . $name ); }", "function name_id( string $key ): void {\n\t\t\\wpinc\\meta\\name_id( $key );\n\t}", "function processName($name) {\n//\tUncomment the next two lines and change only ISO-8859-9 to your site encoding type\n\n//\t$name = iconv(\"UTF-8\", \"ISO-8859-1\", $name);\n//\t$name = iconv(\"ISO-8859-9\", \"UTF-8\", $name);\n\n\treturn $name;\n}", "function put_id() {\n \n if($this->name == \"\") {\n $this->name = $this->classname;\n }\n \n // if we stop using the session id- we should remove the session id from\n // the current QUERYSTRING/ or the HTTP_GET_VARS ????\n die(\"This has not been coded yet.\");\n }", "public static function gen_id($str)\n\t\t{\n\t\t\treturn str_replace('-', '_', self::gen_seoname($str));\n\t\t}", "static function id(): string { return 'website'; }", "protected function createSlug($name)\n {\n $name = CmsharenjoyString::slug($name);\n\n return $name;\n }", "private function getBrowserName()\n {\n if(isset($this->browser->Browser))\n {\n return $this->browser->Browser;\n }\n else\n {\n return $this->browser->browser;\n }\n }", "public static function URLPurify($name) {\n\t\t$name = preg_replace(\"/[^a-zA-Z0-9\\s\\-]/\", \"\", $name); //Remove all non-alphanumeric characters, except for spaces\n\t\t$name = preg_replace(\"/[\\s]/\", \"-\", $name); //Replace remaining spaces with a \"-\"\n\t\t$name = str_replace(\"--\", \"-\", $name); //Replace \"--\" with \"-\", will occur if a something like \" & \" is removed\n\t\treturn strtolower($name);\n\t}", "function clone_name($id){\r\n \r\nswitch($id){\r\ncase 0:$str = '';break;\r\ncase 1:$str = 'pBC-SK+';break;\r\ncase 2:$str = 'pBluescript II KS+';break; \r\ncase 3:$str = 'pCEP4';break;\r\ncase 4:$str = 'pCMV-Myc';break;\r\ncase 5:$str = 'pCR2.1';break; \r\ncase 6:$str = 'pDsRed2-1';break; \r\ncase 7:$str = 'pEcoli-Cterm 6xHN';break;\r\ncase 8:$str = 'pET-11a';break;\r\ncase 9:$str = 'pET-11b';break;\r\ncase 10:$str = 'pET-11d';break;\r\ncase 11:$str = 'pET-12a';break;\r\ncase 12:$str = 'pET-14b';break;\r\ncase 13:$str = 'pET-15b';break;\r\ncase 14:$str = 'pET-16b';break; \r\ncase 15:$str = 'pET-17b';break;\r\ncase 16:$str = 'pET-20b(+)';break;\r\ncase 17:$str = 'pET-21a(+)';break;\r\ncase 18:$str = 'pET-21b(+)';break;\r\ncase 19:$str = 'pET-21d(+)';break;\r\ncase 20:$str = 'pET-22b(+)';break;\r\ncase 21:$str = 'pET-23a(+)';break;\r\ncase 22:$str = 'pET-23d(+)';break;\r\ncase 23:$str = 'pET-24a(+)';break;\r\ncase 24:$str = 'pET-24b(+)';break;\r\ncase 25:$str = 'pET-24c';break;\r\ncase 26:$str = 'pET-25b(+)';break;\r\ncase 27:$str = 'pET-26b+';break;\r\ncase 28:$str = 'pET-27b(+)';break;\r\ncase 29:$str = 'pET-28a(+)';break;\r\ncase 30:$str = 'pET-28b(+)';break;\r\ncase 31:$str = 'pET-29b+';break;\r\ncase 32:$str = 'pET-29a(+)';break;\r\ncase 33:$str = 'pET-3a';break; \r\ncase 34:$str = 'PET-30a(+)';break;\r\ncase 35:$str = 'pET-30b(+)';break;\r\ncase 36:$str = 'pET-32a(+)';break;\r\ncase 37:$str = 'pET-32b+';break;\r\ncase 38:$str = 'pET-39b';break;\r\ncase 39:$str = 'pET-3c';break;\r\ncase 40:$str = 'pET-3d';break;\r\ncase 41:$str = 'pET-41a(+)';break;\r\ncase 42:$str = 'pET-41b(+)';break;\r\ncase 43:$str = 'pET-43.1a(+)';break;\r\ncase 44:$str = 'pET-44b(+)';break;\r\ncase 45:$str = 'pET-45b+';break;\r\ncase 46:$str = 'pET-49b+';break;\r\ncase 47:$str = 'pET-52b';break;\r\ncase 48:$str = 'pET-9a';break; \r\ncase 49:$str = 'pET-9d';break;\r\ncase 50:$str = 'pPIC3.5K';break; \r\ncase 51:$str = 'pUC18';break;\r\ncase 52:$str = 'pUC19';break;\r\ncase 53:$str = 'pUC57';break;\r\ncase 54:$str = 'pDream 2.1';break;\r\ncase 55:$str = 'Other';break; \r\ndefault:$str = '';\r\n}\r\nreturn $str;\r\n\r\n}", "function getIdentifier();", "function getIdentifier();", "public function cleanToName($name){\n // Remove empty space\n $name = str_replace(' ', '', $name);\n // Remove special character\n $name = preg_replace('/[^A-Za-z0-9\\-]/', '', $name);\n // Return without numbers\n return preg_replace('/[0-9]+/', '', $name);\n \n }", "public function name_to_slug( $name ) {\n\t\treturn sanitize_title( str_replace( '\\\\', '-', str_replace( '::', '-', $name ) ) );\n\t}", "function TestRun_lookup_environment_id_by_name($name) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestRun.lookup_environment_id_by_name', array(new xmlrpcval($name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "function gen_name($arg, $in){\n $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n $name = '';\n for ($i = 0; $i < CONFIG_RANDOM_LENGTH; $i++) {\n $name .= $chars[mt_rand(0, 60)];\n }\n switch($arg){\n case 'random':\n return $name.'.'.$in;\n break;\n case 'custom_original':\n return $name.'_'.$in;\n break;\n }\n}", "public function formatId($name, $string, $character = '_')\n {\n // get total number of characters inside string\n $stringLength = strlen($string);\n\n // create regex word search\n for($i = 0; $i < $stringLength; $i++)\n {\n if($i == 0)\n {\n $regex = '[' . $string[0] . strtoupper($string[0]) . ']';\n }\n else\n {\n $regex .= $string[$i];\n }\n }\n\n $regex = (string)'/\\b' . $regex . '\\b/';\n\n // strip the word sidebar if it exists\n $id = trim(preg_replace($regex, \"\", $name));\n\n // modify formatting of id name\n $id = 'sidebar-' . HelpersModel::formatStripSpaces($id, '-');\n\n return $id;\n }", "private function normalizeIdentifier($name): Identifier\n {\n $identifier = new Identifier($name);\n\n return $identifier->isQuoted() ? $identifier : new Identifier(strtoupper($name));\n }", "protected function _id(string $name, string $val): string\n {\n $name = $this->_domId($name);\n $suffix = $this->_idSuffix($val);\n\n return trim($name . '-' . $suffix, '-');\n }", "function string_to_id($str)\n{\n\t// remove tags\n\t$str = strip_tags($str);\n\t// replace any in-spaces by one underscore\n\t$str = preg_replace('`(?:\\s|_)+`', '-', trim($str));\n\t// remove accents and delete special chars (based on their html code)\n\t$str = htmlentities($str, ENT_NOQUOTES, 'utf-8');\n\t$str = preg_replace('`&([A-za-z])(?:acute|cedil|circ|grave|orn|ring|slash|th|tilde|uml);`', '\\1', $str);\n\t// delete anything else\n\t$str = preg_replace('`(?:&[^;]+;|[^a-zA-Z0-9-])`', '', $str);\n\treturn $str;\n}", "function tc_css_id($str) {\n\t\t$str = preg_replace('/[^a-zA-Z0-9\\s-_]/', '', $str);\n\t\t$str = strtolower(str_replace(array(' ','_'), '-', $str));\n\t\treturn $str;\n\t}", "public function getIDFromName($name) {\n\t\t\n\t\t\t//construct query to grab the user's OSU ID by using their name\n\t\t\t$query = \"SELECT * FROM users WHERE name='\" . $name . \"'\";\n\t\t\t//execute query\n\t\t\t$result = $this->db->query($query);\n\t\t\t\n\t\t\t//get next row of returned results (should only be one row)\n\t\t\t$row = $result->fetch();\n\t\t\t\n\t\t\t//if query failed\n\t\t\tif (!$row) {\n\t\t\t\techo 'Error getting student ID!';\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t//return name\n\t\t\telse {\n\t\t\t\treturn $row['osuId'];\n\t\t\t}\n\t\t}", "public function _convertToNameFormat($id)\n\t{\n\t\treturn preg_replace('/\\.([A-Za-z0-9_\\-]+)/', '[$1]', $id);\n\t}", "function correctIdentifier($identifier) {\n $search = array(' ', ':', '.', '/');\n $replace = array('_', '_', '_', '-');\n return str_replace($search, $replace, $identifier);\n}", "public function fixerCleaner($name)\n\t{\n\t\t//Extensions.\n\t\t$cleanerName = preg_replace('/([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev\"|\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}$|$)/i',\n\t\t\t\t\t\t\t\t\t' ',\n\t\t\t\t\t\t\t\t\t$name);\n\t\t//Remove stuff from the start.\n\t\t$cleanerName = preg_replace('/^(Release Name|sample-)/i', ' ', $cleanerName);\n\t\t//Replace multiple spaces with 1 space\n\t\t$cleanerName = preg_replace('/\\s\\s+/i', ' ', $cleanerName);\n\t\t//Remove invalid characters.\n\t\t$cleanerName = trim(utf8_encode(preg_replace('/[^(\\x20-\\x7F)]*/', '', $cleanerName)));\n\t\treturn $cleanerName;\n\t}", "function _createId( )\n\t{\n\t\t$agent = $_SERVER['HTTP_USER_AGENT'];\n\t\t$id = md5( $agent . uniqid(dechex(rand())) . $_SERVER['REMOTE_ADDR'] );\n\t\treturn $id;\n\t}", "function GenerateUniqId($sName)\n{\n\tstatic $arPostfix = array();\n\n\t$sPostfix = rand();\n\twhile(isset($arPostfix[$sPostfix]))\n\t\t$sPostfix = rand();\n\n\t$arPostfix[$sPostfix] = 1;\n\n\treturn preg_replace(\"/\\\\W/\", \"_\", $sName).$sPostfix;\n}", "function MCW_make_name_acceptable($name) {\n \n $name = strtr($name,\" \",\"_\");\n $name=preg_replace(\"/[^a-zA-Z0-9_äöüÄÖÜ]/\" , \"\" , $name);\n return $name;\n }", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "protected function normalizeName($name) {\n\t\tif ($name instanceof PHPParser_Node_Name) {\n\t\t\treturn $name;\n\t\t} else {\n\t\t\treturn new PHPParser_Node_Name ( $name );\n\t\t}\n\t}", "public function sanatize($name)\n {\n $specialChars = array (\"#\",\"$\",\"%\",\"^\",\"&\",\"*\",\"!\",\"~\",\"�\",\"\\\"\",\"�\",\"'\",\"=\",\"?\",\"/\",\"[\",\"]\",\"(\",\")\",\"|\",\"<\",\">\",\";\",\":\",\"\\\\\",\",\");\n return str_replace($specialChars, \"_\", $name);\n }", "protected function slugGenerate(string $name)\n {\n $slug = new Slug();\n return $slug->make($name, '-');\n }", "function generatePlaceHolderName($name)\r\n\t{\r\n\t\treturn ':'.$name;\r\n\t}", "function evaluate_name($name){\n\t$name = strtolower($name);\n\t$name = str_replace(\" \",\"\",$name);\n\n\treturn $name;\n}", "function to_html_id($x) {\n\n $x = underscore($x);\n // move initial numbers to the end\n $x = preg_replace('/^(\\d+_?)(.*)$/', '$2$1', $x);\n $x = camel_case($x);\n\n return $x;\n }", "private function getGenreId($name){\n $sql = \"SELECT * from Categories WHERE name = ?;\";\n $res = $this->db->executeSelectQueryAndFetchAll($sql, array($name));\n return $res[0]->id; \n }", "private function __validate_name() {\n if (isset($this->initial_data[\"name\"])) {\n if ($this->get_limiter_id_by_name($this->initial_data[\"name\"], true)) {\n $this->id = $this->get_limiter_id_by_name($this->initial_data[\"name\"]);\n } else {\n $this->errors[] = APIResponse\\get(4209);\n }\n } else {\n $this->errors[] = APIResponse\\get(4167);\n }\n }", "public static function IDForDBName( $name ){ return Database::APICallUp( array( 'IDForDBName' => $name ), \"Could not lookup database with name \" . $name ); }", "function clean_id($id)\n{\n\t$id = str_replace('-', '_', $id);\n\treturn $id;\n}", "public static function getDummyId(): string {\n return 'wcmf'.str_replace('-', '', StringUtil::guidv4());\n }", "public function getIdentifier()\n {\n $configID = $this->get_config() ? $this->get_config()->ID : 1;\n return ucfirst($this->get_mode()) . \"Site\" . $configID;\n }", "function id($name, $echo = true) {\n $id = sprintf('%s_settings_%s', __CLASS__, $name);\n if ($echo) {\n echo $id;\n } else {\n return $id;\n }\n }", "function buildValidIDFrom($text)\n{\n $text = preg_replace('/^[^a-zA-Z0-9\\.-]/','p',$text);\n $text = preg_replace('/[^a-zA-Z0-9\\.-]/','-',$text);\n return $text;\n}", "public function createID()\n {\n $myID = new \\MongoID();\n\n return (string) $myID;\n }", "function safe_name($name) {\n return preg_replace(\"/\\W/\", \"_\", $name);\n }", "public function getIdentifier(): string;", "public function getIdentifier(): string;", "function get_id_from_blogname($slug)\n {\n }", "static public function generateSID() {\n\t\treturn md5( $_SERVER['HTTP_USER_AGENT'] + $_SERVER['REMOTE_ADDR'] + time() + rand() );\n\t}", "abstract public function getIdentifier();" ]
[ "0.6725434", "0.6492614", "0.6453848", "0.6393702", "0.62235", "0.6136572", "0.6087936", "0.6077966", "0.6068069", "0.6023464", "0.5899262", "0.57705253", "0.5760526", "0.57525164", "0.57272863", "0.56939757", "0.56386423", "0.562566", "0.55987513", "0.55984575", "0.55876255", "0.5544538", "0.5527434", "0.5505649", "0.54971486", "0.5480896", "0.54774696", "0.5407406", "0.5404826", "0.53950834", "0.53611994", "0.53607666", "0.53357613", "0.5332062", "0.5324012", "0.53125435", "0.52806455", "0.52803475", "0.527261", "0.52716106", "0.5267962", "0.52667934", "0.5265528", "0.5254131", "0.5253646", "0.52229625", "0.5216328", "0.52103704", "0.5209092", "0.5205723", "0.5203802", "0.52025545", "0.5197043", "0.5197043", "0.51894873", "0.5171435", "0.5163282", "0.5159117", "0.51539606", "0.51518124", "0.5134352", "0.51218164", "0.5116684", "0.51139593", "0.5111061", "0.51057476", "0.5102862", "0.5100162", "0.50991774", "0.5096903", "0.509224", "0.509224", "0.509224", "0.509224", "0.509224", "0.509224", "0.509224", "0.509224", "0.509224", "0.5091199", "0.509103", "0.5085288", "0.5073445", "0.5069359", "0.5067399", "0.506169", "0.5060897", "0.50605094", "0.50588334", "0.5056267", "0.5050656", "0.5040412", "0.5027464", "0.5027181", "0.50267756", "0.5024925", "0.5024925", "0.5016288", "0.5015734", "0.50137985" ]
0.58625585
11
Returns the specified keys from an array, in specified order
function arrayKeySort(&$array, $keys) { $res = array(); foreach($keys as $key) { if(isset($array[$key])) { $res[$key] = $array[$key]; } } return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function only( array $array, array $keys ): array {\n\t\t\treturn array_intersect_key( $array, array_flip( $keys ) );\n\t\t}", "function array_only($array, $keys)\n\t{\n\t\treturn array_intersect_key($array, array_flip((array) $keys));\n\t}", "public static function only(array $array, array|string $keys): array\n {\n return array_intersect_key($array, array_flip((array)$keys));\n }", "function array_select_keys(array $array, iterable $keys): array\n{\n return array_reduce(\n $keys,\n function (array $acc, $k) use ($array): array {\n if (array_key_exists($k, $array)) {\n $acc[$k] = $array[$k];\n }\n\n return $acc;\n },\n []\n );\n}", "static function only(array $array, $keys) {\n return array_intersect_key($array, array_flip((array) $keys));\n }", "public static function only($array, $keys)\n {\n return array_intersect_key($array, array_flip((array) $keys));\n }", "public static function only($array, $keys)\n {\n return array_intersect_key($array, array_flip((array) $keys));\n }", "public static function only($array, $keys)\n {\n return array_intersect_key($array, array_flip((array) $keys));\n }", "public static function only($array, $keys)\n {\n \n return array_intersect_key($array, array_flip((array)$keys));\n \n }", "public static function keys(array $keys = []): array\n {\n if (count($keys) === 2) {\n return $keys;\n }\n \n return ['started_at', 'ended_at'];\n }", "public function getItems(array $keys = []);", "public static function only( $array, $keys )\n {\n return array_intersect_key( $array, array_flip( (array)$keys ) );\n }", "public static function filterKeys(array $array, array $keys) {\n $out = array();\n foreach ($keys as $key) {\n $out[$key] = $array[$key];\n }\n return $out;\n }", "private function prefixArrayOfKeys(array $keys)\n\t{\n\t\t$prefixedKeys = array();\n\t\tforeach ($keys as $key) {\n\t\t\t$prefixedKeys[] = $this->prefix . $key;\n\t\t}\n\t\treturn $prefixedKeys;\n\t}", "public function only($keys): array\n\t{\n\t\t$keys = is_array($keys) ? $keys : func_get_args();\n\t\t$results = [];\n\t\t$input = $this->all();\n\n\t\tforeach ($keys as $key) {\n\t\t\tArr::set($results, $key, Data::get($input, $key));\n\t\t}\n\n\t\treturn $results;\n\t}", "public function getValues(array $keys);", "function array_keys_whitelist( array $array, array $keys ) {\n return array_intersect_key( $array, array_flip( $keys ) );\n}", "function atk_array_merge_keys()\n{\n\t$args = func_get_args();\n\t$result = array();\n\tforeach($args as $array)\n\t{\n\t\tforeach($array as $key=>$value)\n\t\t{\n\t\t\t$result[$key] = $value;\n\t\t}\n\t}\n\treturn $result;\n}", "public function getItems(array $keys = []): array;", "#[Pure]\n public function getMulti(array $keys) : array\n {\n $items = [];\n foreach ($keys as $key) {\n $items[$key] = $this->get($key);\n }\n return $items;\n }", "public static function extract( array $array, $keys )\n\t{\n\t\tif ( !is_array( $keys ) ) {\n\t\t\t$keys = func_get_args();\n\t\t\tunset( $keys[0] );\n\t\t}\n\n\t\t$found = array();\n\t\tforeach ( $keys as $key ) {\n\t\t\t$found[$key] = isset( $array[$key] ) ? $array[$key] : NULL;\n\t\t}\n\n\t\treturn $found;\n\t}", "public static function filterKeys(array $array, array $keys): array\n {\n $result = [];\n\n foreach ($keys as $key) {\n if (isset($array[$key])) {\n $result[$key] = $array[$key];\n }\n }\n\n return $result;\n }", "function array_only($array, $keys)\n {\n return Arr::only($array, $keys);\n }", "function array_only($array, $keys)\n {\n return Arr::only($array, $keys);\n }", "function get_multi($keys) {\n\t\t$out = array();\n\t\tforeach($keys as $key)\n\t\t\t$out[$key] = $this->get($key);\n\t\treturn $out;\n\t}", "public static function keys(): array;", "public static function array_filter_keys ($array, $keys)\r\n\t{\r\n\t\t# Return unamended if not an array\r\n\t\tif (!is_array ($array)) {return $array;}\r\n\t\t\r\n\t\t# Ensure the keys list is an array\r\n\t\t$keys = self::ensureArray ($keys);\r\n\t\t\r\n\t\t# Add those values of the $array whose key is in $keys\r\n\t\t$result = array ();\r\n\t\tforeach ($array as $key => $value) {\r\n\t\t\tif (in_array ($key, $keys)) {\r\n\t\t\t\t$result[$key] = $value;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t# Return the resulting array\r\n\t\treturn $result;\r\n\t}", "private function multiSelectArray($array,$keys) {\n $result = array();\n foreach ($keys as $key) {\n if(array_key_exists($key, $array)) {\n $result[$key] = $array[$key];\n }\n else {\n $result[$key] = \"\";\n }\n\n }\n return $result;\n }", "function sort_array_by_array($array, $keyname_array)\n\t{\n\t$result = array();\n\tforeach($keyname_array as $key)\n\t\t{\n\t\t$result[$key] = $array[$key];\n\t\t}\n\treturn $result;\n\t}", "function wp_array_slice_assoc($input_array, $keys)\n {\n }", "public function getMultiple(array $keys): array\n {\n $results = [];\n foreach ($keys as $key) {\n $results[$key] = $this->get($key);\n }\n return $results;\n }", "static function keyValSplit($array){\n return [array_keys($array), array_values($array)];\n }", "public function array_only($array, $keys)\n {\n return Arr::only($array, $keys);\n }", "public function getArrayKeys()\n {\n $arrayKeys = [];\n foreach ($this->getOptionArray() as $key => $value) {\n $arrayKeys[] = $key;\n }\n return $arrayKeys;\n }", "function sub_array($array,$keys=[])\n{\n return array_filter($array,function($k)use($keys){ return in_array($k,$keys); },ARRAY_FILTER_USE_KEY);\n}", "public function getMulti(array $keys): array {\n foreach ($keys as $key) {\n $return[$key] = FALSE;\n }\n if ($this->driver) {\n $return = $this->driver->getMulti($keys);\n }\n return $return;\n }", "public function getItems(array $keys = array())\n {\n }", "final public static function getKeys(): array\n {\n return array_keys(static::getValues());\n }", "function acf_get_sub_array($array, $keys)\n{\n}", "final public function gets(...$keys)\n {\n return $this->onPrepareReturns(Base\\Arrs::gets($this->prepareKeys(...$keys),$this->arr(),$this->isSensitive()));\n }", "protected abstract function loadKeys(array $keys);", "function array_except($array, $keys)\n\t{\n\t\treturn array_diff_key($array, array_flip((array) $keys));\n\t}", "public function getKeys(): array;", "public function get_many($keys) {\n $result = array();\n foreach ($keys as $key) {\n $result[$key] = $this->get($key);\n }\n return $result;\n }", "public static function keySplit(array $arg)\n {\n $nums = array();\n $strings = array();\n\n foreach ($arg as $key => $value) {\n if (is_integer($key)) {\n $nums[$key] = $value;\n } else {\n $strings[$key] = $value;\n }\n }\n\n return array($nums, $strings);\n }", "public static function except(array $array, array|string $keys): array\n {\n return array_diff_key($array, array_flip((array)$keys));\n }", "protected function prefixKeys(array $keys)\n {\n return array_map(function ($key) {\n return $this->getPrefix().$key;\n }, $keys);\n }", "public static function diffKey(array $array1, array $array2): array{\n return call_user_func_array(\"array_diff_key\", func_get_args());\n }", "private function getArrayKeys(array $array)\n {\n $keys = [];\n\n foreach ($array as $key => $value) {\n $keys[] = $key;\n\n if (is_array($value)) {\n $keys = array_merge($keys, $this->getArrayKeys($value));\n }\n }\n\n return $keys;\n }", "public function keys(): array;", "public function keys(): array;", "public function keys(): array;", "function array_prefix_keys(string $prefix, array $array): array\n{\n if (is_numeric_array($array)) {\n return $array;\n }\n\n $result = [];\n foreach ($array as $key => $value) {\n $result[$prefix . $key] = $value;\n }\n return $result;\n}", "static public function getKeyContains(&$arr, $contains)\n {\n $results = array();\n foreach ($arr as $key => $value) {\n if (($pos = strpos($key, $contains)) !== false) {\n $results[] = $key;\n }\n }\n\n return $results;\n }", "static function getKeys();", "public function getKeys(): array\n {\n $keys = [];\n $arr = $this->items;\n foreach ($arr as $key=>$value) {\n $keys[] = $key;\n }\n return $keys;\n }", "function dmindex($array, $keys, $preserve_keys = false, $default = null)\n{\n $out = array();\n foreach ($keys as $key) {\n if ($preserve_keys) {\n $out[$key] = dindex($array, $key, $default);\n } else {\n $out[] = dindex($array, $key, $default);\n }\n }\n return $out;\n}", "function arrayFilterByKeys($array, $allowedKeys)\n{\n if (version_compare(PHP_VERSION, '5.6.0', '<')) {\n return array_intersect_key($array, array_flip($allowedKeys));\n } else {\n return array_filter(\n $array,\n function($k) use ($allowedKeys) {\n return in_array($k, $allowedKeys);\n },\n ARRAY_FILTER_USE_KEY\n );\n }\n}", "public static function renameKeys(array $array, array $keys): array\n {\n\n $new_array = [];\n\n foreach ($array as $k => $v) {\n\n if (array_key_exists($k, $keys)) {\n\n $new_array[$keys[$k]] = $v;\n\n } else {\n\n $new_array[$k] = $v;\n\n }\n\n }\n\n return $new_array;\n\n }", "function array_except($array, $keys)\n {\n return Arr::except($array, $keys);\n }", "function array_except($array, $keys)\n {\n return Arr::except($array, $keys);\n }", "function show_keys($ar) {\r\n $temp = array();\r\n foreach ($ar as $k => $v ) {\r\n $temp[] = $k;\r\n if (is_array($v)) {\r\n $temp = array_merge($temp, $this->show_keys($v));\r\n }\r\n }\r\n return $temp;\r\n }", "public function getItems(array $keys)\n {\n $result = array();\n\n foreach ($keys as $key) {\n $result[$key] = $this->getItem($key);\n }\n\n return $result;\n }", "function array_parallel(){\n\t$r = array();\n\t$args = func_get_args();\n\t$keys = array();\n\tforeach ($args as $a)\n\t\t$keys = array_merge($keys, array_keys($a));\n\t$keys = array_unique($keys);\n\n\tforeach ($keys as $k){\n\t\t$i = array();\n\t\tforeach ($args as $a)\n\t\t\t$i[] = nu($a[$k]);\n\t\t$r[$k] = $i;\n\t}\n\treturn $r;\n}", "public function getMulti(array $keys) {\n return [];\n }", "public function loadKeys(array $keys = [])\n {\n }", "function array_remove_keys($array, $keys = array()) {\n // doing anything else.\n if(empty($array) || (! is_array($array))) {\n return $array;\n }\n\n // If $keys is a comma-separated list, convert to an array.\n if(is_string($keys)) {\n $keys = explode(',', $keys);\n }\n\n // At this point if $keys is not an array, we can't do anything with it.\n if(! is_array($keys)) {\n return $array;\n }\n\n // array_diff_key() expected an associative array.\n $assocKeys = array();\n foreach($keys as $key) {\n $assocKeys[$key] = true;\n }\n\n return array_diff_key($array, $assocKeys);\n }", "static public function getKeysByFirstDivision(&$arr, $division)\n {\n\n $return = array();\n foreach ($arr as $key => $value) {\n if (($pos = strpos($key, $division)) !== false) {\n $return[] = substr($key, 0, $pos);\n }\n }\n\n return $return;\n\n }", "protected function arrayDotOnly(array $array, $keys): array\n {\n $newArray = [];\n foreach ((array)$keys as $key) {\n $value = Arr::get($array, $key);\n Arr::set($newArray, $key, $value);\n }\n return $newArray;\n }", "abstract public function getKeys();", "public function loadKeys(array $keys)\n {\n }", "public function loadKeys(array $keys)\n {\n }", "public function loadKeys(array $keys)\n {\n }", "public function loadKeys(array $keys)\n {\n }", "public function loadKeys(array $keys)\n {\n }", "public function loadKeys(array $keys)\n {\n }", "public static function missing(array $array, array|string $keys): array\n {\n return array_values(array_flip(array_diff_key(array_flip((array)$keys), $array)));\n }", "public static function except($array, $keys)\n {\n return array_diff_key($array, array_flip((array) $keys));\n }", "function array_limit_keys(array $keys = [], array $input = []): array\n {\n if(empty($keys)) {\n return [];\n }\n\n //return array_filter($input, function($item) use ($keys) {\n // return in_array($item, $keys);\n //}, ARRAY_FILTER_USE_KEY);\n\n $out = [];\n foreach ($keys as $key) {\n if (array_key_exists($key, $input)) {\n $out[$key] = $input[$key];\n }\n }\n\n return $out;\n }", "public function getItems($keys) {\n\t\t$result = array();\n\n\t\t// extremely simple solution, this can be improved by extending the adapter interfaces sometime\n\t\tforeach ($keys as $key) {\n\t\t\t$this->checkKey($key);\n\t\t\t$result[$key] = $this->get($key);\n\t\t}\n\n\t\treturn $result;\n\t}", "public static function filterKey(Array $array, $keys, $fillKey = true)\n {\n /*** Arguments prepare ***/\n // keys prepare\n if (is_string($keys)) {\n $keys = array_map('trim', explode(',', $keys));\n }\n \n $keysFlip = array_fill_keys($keys, '');\n \n // Fill the key\n if ($fillKey) {\n $array = $array + $keysFlip;\n }\n \n return array_intersect_key($array, $keysFlip);\n }", "public function getKeys() {\n\t\treturn array_keys( $this->array );\n\t}", "public static function getKeys(): array\n {\n return array_keys(self::getConstants());\n }", "function elit_array_filter_key( $arr, $callback ) {\n $matched_keys = array_filter( array_keys( $arr ), $callback );\n return array_intersect_key( $arr, array_flip( $matched_keys ) );\n}", "public static function extractArrayKeysStartingWith( $array, $pattern )\n {\n $out = array( );\n\n foreach ( $array as $key => $value )\n {\n if ( Tools::startWith( $key, $pattern ) )\n $out[ $key ] = $value;\n }\n\n return $out;\n }", "public static function keysToArray($in = array()) {\n\t\t$result = array();\n\n\t\tif (!empty($in) && is_array($in)) {\n\t\t\tforeach ($in as $key => $val) {\n\t\t\t\tif (strpos($key, '.') !== false) {\n\t\t\t\t\t$result = Set::insert($result, $key, $val);\n\t\t\t\t} else {\n\t\t\t\t\t$result[$key] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "protected function pickValidKeys(array $data, array $keys)\n {\n $validKeys = [];\n\n foreach ($data as $key => $val) {\n if (is_numeric($key) || in_array($key, $keys)) {\n $validKeys[$key] = $val;\n }\n }\n\n return $validKeys;\n }", "static function except(array $array, $keys) {\n return array_diff_key($array, array_flip((array) $keys));\n }", "public function validateKeys(array $keys)\n\t{\n\t\tif (! $keys) {\n\t\t\treturn $this->defaultStatKeys();\n\t\t}\n\n\t\t$reordered = [];\n\t\t$this->validate($keys);\n\n\t\t// add in the keys always shown by this sport\n\t\t$keys = array_merge($keys, $this->alwaysShown());\n\n\t\t// reorder the stats to the way they're stored in statKeys\n\t\tforeach ($this->statKeys() as $key) {\n\t\t\tif (in_array($key, $keys)) {\n\t\t\t\t$reordered[] = $key;\n\t\t\t}\n\t\t}\n\n\t\treturn $reordered;\n\t}", "public static function order(array $array, array $order): array\n {\n return self::only(array_replace(array_flip($order), $array), array_keys($array));\n }", "abstract public function keys(): Seq;", "private function prefixArrayKeys(array $items)\n\t{\n\t\t$prefixed = array();\n\t\tforeach ($items as $key => $value) {\n\t\t\t$prefixed[$this->prefix . $key] = $value;\n\t\t}\n\t\treturn $prefixed;\n\t}", "public function chiavi($array){\n\t\treturn array_keys($array);\n\t}", "public static function ability($keys)\n {\n if (is_string($keys))\n return static::prefixedKey($keys);\n\n return array_map(function (string $key) {\n return static::prefixedKey($key);\n }, (array) $keys);\n }", "public function mget(string ...$keys): array\r\n\t{\r\n\t\treturn $this->connection->mget($keys);\r\n\t}", "public function prependToKeys(array $arr, string $prepend) : array\n {\n return array_combine(\n array_map(function($key) use ($prepend) { return $prepend.$key; }, array_keys($arr)),\n $arr\n );\n }", "public static function prefixKeys(array $array, $prefix)\n {\n return array_combine(array_map(function ($key) use ($prefix) {\n return $prefix . $key;\n }, array_keys($array)), array_values($array));\n }", "public function array_except($array, $keys)\n {\n return Arr::except($array, $keys);\n }", "public function keys() : array;", "public function keys() : array;" ]
[ "0.7109185", "0.7075719", "0.70121205", "0.69714093", "0.69009256", "0.689315", "0.689315", "0.689315", "0.68882734", "0.68279815", "0.67956793", "0.67950904", "0.67312336", "0.67093384", "0.6631453", "0.66226065", "0.6617316", "0.6579641", "0.6481516", "0.64007425", "0.6397208", "0.63859147", "0.63702416", "0.63702416", "0.6361587", "0.63319033", "0.6331246", "0.63242126", "0.63217634", "0.628732", "0.6286356", "0.6275855", "0.6217847", "0.62157375", "0.61995006", "0.6178959", "0.6141562", "0.613077", "0.61252797", "0.6088318", "0.6063367", "0.6054437", "0.6028893", "0.5993581", "0.59930897", "0.5992842", "0.59911764", "0.59890693", "0.5983785", "0.59186596", "0.59186596", "0.59186596", "0.5900499", "0.58993334", "0.58835703", "0.58818847", "0.58772725", "0.58730704", "0.58704406", "0.58623546", "0.58623546", "0.58619004", "0.5859864", "0.58409506", "0.58403707", "0.58264196", "0.58259606", "0.58178586", "0.5815872", "0.5805332", "0.57945067", "0.57945067", "0.57945067", "0.57945067", "0.57945067", "0.57945067", "0.57851875", "0.5784149", "0.57774717", "0.57761914", "0.57702774", "0.57527924", "0.57401353", "0.57387275", "0.5738438", "0.5732708", "0.57298255", "0.5724492", "0.5724164", "0.5722101", "0.5720618", "0.5716522", "0.5714027", "0.57053024", "0.5695789", "0.5692262", "0.5684685", "0.5682498", "0.5677349", "0.5677349" ]
0.6937677
4
Prepend an array with a value and return the new array
function arrayPrepend($array, $value) { array_unshift($array, $value); return $array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function prepend($array, $value, $key = null)\n {\n if (is_null($key)) {\n array_unshift($array, $value);\n } else {\n $array = [$key => $value] + $array;\n }\n\n return $array;\n }", "function array_prepend($array, $value, $key = null)\n {\n return Arr::prepend($array, $value, $key);\n }", "public function array_prepend($array, $value, $key = null)\n {\n return Arr::prepend($array, $value, $key);\n }", "public static function array_unshift_ref(&$array, &$value)\n {\n $return = array_unshift($array, '');\n $array[0] =& $value;\n return $return;\n }", "public function prepend($value) {\n\t\tif (is_array($value)) {\n\t\t\tforeach ($value as $v) {\n\t\t\t\t$this->prepend($v);\n\t\t\t}\n\t\t} else {\n\t\t\tarray_unshift($this->_value, $value);\n\t\t}\n\n\t\treturn $this;\n\t}", "function util_array_values_prepend(&$item, $key, $prefix)\n{\n $item = $prefix.$item;\n}", "public function prepend( $key, $value )\n\t{\n\t\t$array = $this->get( $key );\n\t\tarray_unshift( $array, $value );\n\t\t$this->set( $key, $array );\n\t}", "public function prepend($key, $value)\n {\n $array = $this->get($key);\n\n array_unshift($array, $value);\n\n $this->set($key, $array);\n }", "public static function prepend($key, $value)\n {\n $array = self::get($key);\n\n array_unshift($array, $value);\n\n self::set($key, $array);\n }", "function prepend ()\n {\n call_user_func_array ('array_unshift', array_merge ($this->A, func_get_args ()));\n return $this;\n }", "public function prepend($key, $value)\n {\n $array = $this->get($key);\n\n array_unshift($array, $value);\n\n $this->set($key, $array);\n\n return $this;\n }", "public function arrayPrepend($path, $value, $createParents = false) {\n $this->commands[] = array(\n 'opcode' => COUCHBASE_SDCMD_ARRAY_ADD_FIRST,\n 'path' => $path,\n 'value' => $value,\n 'createParents' => $createParents,\n );\n return $this;\n }", "function unshift(array & $array, $key, $val) {\n $array = array_reverse($array, TRUE);\n $array[$key] = $val;\n $array = array_reverse($array, TRUE);\n\n return $array;\n}", "protected function prepend($value, $valueBefore = null, $valueBeforeIndex = null)\n {\n $value = (array) $value;\n $before = array();\n $after = $this->data;\n if (null !== $valueBefore && count($found = array_keys($after, $valueBefore))) {\n $index = $found[0];\n if (array_key_exists($valueBeforeIndex, $found)) {\n $index = $found[$valueBeforeIndex];\n }\n $before = array_slice($after, 0, $index);\n $after = array_slice($after, $index);\n }\n $this->data = array_merge($before, $value, $after);\n\n return $this;\n }", "public function prepend($var, array $array)\n {\n $this->display[$var] = array_merge($array, (array) $this->display[$var]);\n }", "public function prepend($value)\n\t{\n\t\tarray_unshift($this->stack, $value);\n\t}", "function array_insert(array $original, array $new, $offset)\n {\n return array_slice($original, 0, $offset, true) + $new + array_slice($original, $offset, null, true);\n }", "public function prepend($value, $key = null)\n {\n $key ? $this->unshiftKey($key, $value) : $this->unshift($value);\n }", "public function arrayPrependAll($path, $values, $createParents = false) {\n $this->commands[] = array(\n 'opcode' => COUCHBASE_SDCMD_ARRAY_ADD_FIRST,\n 'path' => $path,\n 'value' => $values,\n 'createParents' => $createParents,\n 'removeBrackets' => true,\n );\n return $this;\n }", "public static function unshift( array & $array, $key, $val )\n\t{\n\t\t$array = array_reverse( $array, TRUE );\n\t\t$array[$key] = $val;\n\t\t$array = array_reverse( $array, TRUE );\n\n\t\treturn $array;\n\t}", "public function & arrayUnShift () {\n $getFunctionArguments = func_get_args ();\n foreach ($getFunctionArguments as $k => $v) {\n array_unshift ($this->varContainer, $v);\n }\n # Return to chain ...\n return $this->returnToChain ();\n }", "public static function insertBefore(array $targetArray, $beforeKey, $value, $keyValue = null)\n {\n if (null === $keyValue) {\n $newArray[count($targetArray)] = $value;\n } else {\n $newArray[$keyValue] = $value;\n }\n $pos = self::getKeyPos($targetArray, $beforeKey);\n\n if (false === $pos) {\n return $newArray + $targetArray;\n }\n \n array_splice($targetArray, $pos, 0, $newArray);\n\n return $targetArray;\n }", "function array_insert(&$array, $value, $offset)\r\n{\r\n if (is_array($array)) {\r\n $array = array_values($array);\r\n $offset = intval($offset);\r\n if ($offset < 0 || $offset >= count($array)) {\r\n array_push($array, $value);\r\n } elseif ($offset == 0) {\r\n array_unshift($array, $value);\r\n } else {\r\n $temp = array_slice($array, 0, $offset);\r\n array_push($temp, $value);\r\n $array = array_slice($array, $offset);\r\n $array = array_merge($temp, $array);\r\n }\r\n } else {\r\n $array = array($value);\r\n }\r\n return count($array);\r\n}", "private function array_unshift_assoc(&$arr, $key, $val)\n {\n $arr = array_reverse($arr, true);\n $arr[$key] = $val;\n return array_reverse($arr, true);\n }", "public function prependTo($value) {\n \n return $this->append($value);\n }", "public function prepend($item)\n {\n if (is_resource($item)) {\n throw new Exception\\InvalidTypeException('You cannot add a resource to an array.');\n }\n\n if (is_array($item)) {\n throw new Exception\\InvalidTypeException('You cannot prepend an array to an array as of now.');\n }\n\n array_unshift($this->activeValue, $item);\n }", "public static function unshift(array & $array, string $key, $val): array\n {\n $array = array_reverse($array, TRUE);\n $array[$key] = $val;\n $array = array_reverse($array, TRUE);\n\n return $array;\n }", "static function array_to_top($array, $key, $value_instead = false) {\n\n\t\tif ($value_instead) {\n\t\t\tif (($array_key = array_search($key, $array)) !== false) {\n\t\t\t\tunset($array[$array_key]);\n\t\t\t}\n\t\t\tarray_unshift($array , $key);\n\t\t}\n\t\telse {\n\t\t\t$value = array($key => $array[$key]);\n\t\t\tunset($array[$key]);\n\t\t\t$array = $value + $array;\n\t\t}\n\n\t\treturn $array;\n\t}", "public function prependToKeys(array $arr, string $prepend) : array\n {\n return array_combine(\n array_map(function($key) use ($prepend) { return $prepend.$key; }, array_keys($arr)),\n $arr\n );\n }", "function kernel_array_concat($array, $prefix, $suffix) {\n $newArray = array();\n foreach( $array as $value ) {\n $newArray[] = $prefix . $value . $suffix;\n }\n return $newArray;\n}", "public static function prepend($index, $value)\n {\n self::exist($index);\n array_unshift(self::$registry[$index], $value);\n }", "function array_unshift_assoc(&$arr, $key, $val) {\n $arr = array_reverse($arr, true);\n $arr[$key] = $val;\n $arr = array_reverse($arr, true);\n return count($arr);\n}", "function array_insert(array $array, $before_key, array $array2) {\n if (!\\array_key_exists($before_key, $array))\n \\trigger_error(\"The key '$before_key' does not exist in \\$array.\", \\E_USER_ERROR);\n $new_array = array();\n foreach ($array as $key => $value) {\n if ($key === $before_key) {\n foreach ($array2 as $key2 => $value2) {\n if (!\\array_key_exists($key2, $new_array))\n $new_array[$key2] = $value2;\n }\n $before_key = null;\n }\n if (!\\array_key_exists($key, $new_array))\n $new_array[$key] = $value;\n }\n return $new_array;\n}", "function SetValuePrepend( $k, $v ) { $this->_values[$k] = $v . $this->_values[$k]; }", "public static function array_insert_before($key, array &$array, $new_key, $new_value) {\n if (array_key_exists($key, $array)) {\n $new = array();\n foreach ($array as $k => $value) {\n if ($k === $key) {\n $new[$new_key] = $new_value;\n }\n $new[$k] = $value;\n }\n return $new;\n }\n return FALSE;\n }", "public function unshift( $value )\n\t{\n\t\tarray_unshift( $this->data, $value );\n\n\t\treturn $value;\n\t}", "function acadp_array_insert_after( $key, $array, $new_array ) {\n\n\tif( array_key_exists( $key, $array ) ) {\n \t$new = array();\n \tforeach( $array as $k => $value ) {\n \t\t$new[ $k ] = $value;\n \t\tif( $k === $key ) {\n\t\t\t\tforeach( $new_array as $new_key => $new_value ) {\n \t\t\t$new[ $new_key ] = $new_value;\n\t\t\t\t}\n \t\t}\n \t}\n \treturn $new;\n \t}\n\n \treturn $array;\n\n}", "function array_push_ex(array &$arr1,$arr2) {\n foreach ($arr2 as $key => $value) {\n $arr2[$key] = ($value);\n }\n array_push($arr1,$arr2);\n}", "public function unshift() {\n return function (...$value) {\n array_unshift($this->items, ...$value);\n };\n }", "protected function unshift($value)\n {\n array_unshift($this->items, $this->set($value));\n }", "function array_dot(array $array, $prepend = '') {\n $results = array();\n\n foreach ($array as $key => $value) {\n if (is_array($value)) {\n $results = array_merge($results, array_dot($value, $prepend . $key . '.'));\n } else {\n $results[$prepend . $key] = $value;\n }\n }\n\n return $results;\n }", "public function prepend(...$items): self;", "function array_add(array &$array, $key, $value) {\n $target = array_get($array, $key, array());\n\n if ( ! is_array($target)) {\n $target = array($target);\n }\n\n $target[] = $value;\n array_set($array, $key, $target);\n\n return $array;\n }", "function array_dot($array, $prepend = '')\n\t{\n\t\t$results = array();\n\n\t\tforeach ($array as $key => $value)\n\t\t{\n\t\t\tif (is_array($value))\n\t\t\t{\n\t\t\t\t$results = array_merge($results, array_dot($value, $prepend.$key.'.'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$results[$prepend.$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}", "protected function array_insert($array, $values, $offset)\n {\n return array_slice($array, 0, $offset, true) + $values + array_slice($array, $offset, null, true);\n }", "function array_insert(&$array, $offset, $object, $replace=false){\r\n \r\n if(is_array($array)){\r\n if($replace ){\r\n if($offset<0) $offset = 0;\r\n else if($offset > count($array)-1) $offset = count($array)-1;\r\n $a1 = array_slice($array, 0, $offset);\r\n $a2 = array_slice($array, $offset+1);\r\n array_push($a1, $object);\r\n $array = array_merge($a1, $a2);\r\n }else{ \r\n if($offset == 0){\r\n array_unshift($array, $object);\r\n }else if($offset >= count($array)){\r\n array_push($array, $object);\r\n }else{ \r\n $a1 = array_slice($array, 0, $offset);\r\n $a2 = array_slice($array, $offset);\r\n array_push($a1, $object);\r\n $array = array_merge($a1, $a2);\r\n }\r\n }\r\n } \r\n }", "function arrayShift($array) {\n\n unset($array[0]);\n return $array;\n}", "public function unshift($value)\n {\n array_unshift($this->data, $value);\n\n return $this;\n }", "public function prepend($value, $key = null)\n {\n return parent::prepend($value, $key);\n $this->performHook('modified');\n return $this;\n }", "function concat(array $first, iterable ...$rest): array\n{\n $first = values($first);\n foreach ($rest as $arr) {\n foreach ($arr as $value) {\n $first[] = $value;\n }\n }\n\n return $first;\n}", "public function prepend($value) {\n $this->_value = $value . $this->_value;\n $this->countLength();\n \n return $this;\n }", "protected static function mergeBeforeKey(array $input, int $key, array $values = []): array\n {\n return array_merge(\n array_slice($input, 0, $key),\n $values,\n array_slice($input, $key)\n );\n }", "function array_insert(&$array,$element,$position=NULL) \n{\n\t if(count($array) == 0) \n\t\t{\n\t\t\t$array[] = $element;\n\t\t}\n\t \n\t elseif (is_numeric($position) && $position < 0)\n\t\t{\n\t\t\tif((count($array)+position) < 0) \n\t\t\t\t{\n\t\t\t\t\t$array = array_insert($array,$element,0);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$array[count($array)+$position] = $element;\n\t\t\t\t}\n\t \n\t\t}\n\t \n\t elseif (is_numeric($position) && isset($array[$position])) \n\t\t{\n\t\t\t$part1 = array_slice($array,0,$position,true);\n\t\t\t$part2 = array_slice($array,$position,null,true);\n\t\t\t$array = array_merge($part1,array($position=>$element),$part2);\n\t\t\t\n\t\t\tforeach($array as $key=>$item)\n\t\t\t{\n\t\t\t\tif (is_null($item))\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($array[$key]);\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t elseif (is_null($position))\n\t\t {\n\t\t $array[] = $element;\n\t\t }\n\t elseif (!isset($array[$position]))\n\t\t {\n\t\t\t$array[$position] = $element;\n\t\t }\n\t\t\n\t\t$array = array_merge($array);\n\t\treturn $array;\n}", "function array_append( $dest, $source ) {\r\n $n = count( $dest );\r\n $n1 = count( $source );\r\n for ( $index=$n; $index<$n+$n1; $index++ ) {\r\n $dest[$index] = $source[$index-$n];\r\n }\r\n return $dest;\r\n}", "public function testPrepend()\n {\n $this->assertTrue($this->SerializedArray->prepend('first'));\n $this->assertEquals([\n 'first',\n ], $this->SerializedArray->read());\n\n $this->assertTrue($this->SerializedArray->prepend('second'));\n $this->assertEquals([\n 'second',\n 'first',\n ], $this->SerializedArray->read());\n\n safe_unlink($this->file);\n\n $this->assertTrue($this->SerializedArray->prepend(['first', 'second']));\n $this->assertEquals([\n ['first', 'second'],\n ], $this->SerializedArray->read());\n\n $this->assertTrue($this->SerializedArray->prepend(['third', 'fourth']));\n $this->assertEquals([\n ['third', 'fourth'],\n ['first', 'second'],\n ], $this->SerializedArray->read());\n\n $this->assertTrue($this->SerializedArray->prepend('string'));\n $this->assertEquals([\n 'string',\n ['third', 'fourth'],\n ['first', 'second'],\n ], $this->SerializedArray->read());\n }", "public function unshift($path)\n\t{\n\t\t$parts = AgaviArrayPathDefinition::getPartsFromPath($path);\n\t\t$this->parts = array_merge($parts['parts'], $this->parts);\n\t}", "static function insertBefore(&$array, $position, $insert)\n {\n if (is_int($position)) {\n array_splice($array, $position, 0, $insert);\n } else {\n $pos = array_search($position, array_keys($array));\n $array = array_merge(\n array_slice($array, 0, $pos),\n $insert,\n array_slice($array, $pos)\n );\n }\n }", "function insertArray( &$arr, $offset = 0, $value = '', $replace = false ){\n\n consoleLog( 'insertArray() is deprecated. Switching to arr_insert().' );\n consoleLog( debug_backtrace() );\n\n $arr = arr_insert( $arr, $offset, $value, $replace );\n}", "function ins2ary(&$ary, $element, $pos)\n{\n $ar1 = array_slice($ary, 0, $pos);\n $ar1[] = $element;\n $ary = array_merge($ar1, array_slice($ary, $pos));\n}", "public function unshift(...$values);", "public function unshift(...$values);", "function array_add(array $array, string $key, $value):array\n\t{\n\t\tif (is_null(get($array, $key)))\n\t\t{\n\t\t\tset($array, $key, $value);\n\t\t}\n\n\t\treturn $array;\n\t}", "function ArrayInsert( $array, $insert, $position ) {\n return array_slice($array, 0, $position, TRUE) + $insert + array_slice($array, $position, NULL, TRUE);\n}", "function util_array_merge_overwrite($array1, $array2)\n{\n\tforeach ($array2 as $key => $value)\n\t{\n\t\t$array1[$key] = $value ;\n\t}\n\treturn $array1 ;\n}", "public function prepend ($content) {\r\n\t\t\r\n\t\tif ($this->length < 1) return null;\r\n\t\t\r\n\t\t$args = func_get_args();\r\n\t\tforeach ($args as $offset => $value) \r\n\t\t\tif ($value = $this->process($value)) \r\n\t\t\t\tforeach ($this as $node) \r\n\t\t\t\t\tif (get_class($value) === 'XDTNodeList') $node->insertBefore($value[0], $node->firstChild);\r\n\t\t\t\t\telse $node->insertBefore($value, $node->firstChild);\r\n\t\t\t\t\r\n\t\treturn $this;\r\n\t}", "public static function array_move_to_start ($array, $newFirstName)\r\n\t{\r\n\t\t# Check whether the array is associative\r\n\t\tif (self::isAssociativeArray ($array)) {\r\n\t\t\t\r\n\t\t\t# Extract the first item\r\n\t\t\t$firstItem[$newFirstName] = $array[$newFirstName];\r\n\t\t\t\r\n\t\t\t# Unset the item from the main array\r\n\t\t\tunset ($array[$newFirstName]);\r\n\t\t\t\r\n\t\t\t# Reinsert the item at the start of the main array\r\n\t\t\t$array = $firstItem + $array;\r\n\t\t\t\r\n\t\t# If not associative, loop through until the item is found, remove then reinsert it\r\n\t\t#!# This assumes there is only one instance in the array\r\n\t\t} else {\r\n\t\t\tforeach ($array as $key => $value) {\r\n\t\t\t\tif ($value == $newFirstName) {\r\n\t\t\t\t\tunset ($array[$key]);\r\n\t\t\t\t\tarray_unshift ($array, $newFirstName);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t# Return the reordered array\r\n\t\treturn $array;\r\n\t}", "public static function prefixArray(array $array, $prefix) {\r\n\t\t$newArray\t= array();\r\n\r\n\t\tforeach($array as $key => $value) {\r\n\t\t\t$newArray[$prefix.$key] = $value;\r\n\t\t}\r\n\r\n\t\treturn $newArray;\r\n\t}", "function array_add($array, $key, $value)\n\t{\n\t\tif ( ! isset($array[$key])) $array[$key] = $value;\n\n\t\treturn $array;\n\t}", "function extend_array()\n\t{\n\t\t$args = func_get_args();\n\t\t$extended = array();\n\n\t\tif ( is_array( $args ) && count( $args ) )\n\t\t{\n\t\t\tforeach ( $args as $array )\n\t\t\t{\n\t\t\t\tif ( ! is_array( $array ) )\tcontinue;\n\t\t\t\t$extended = array_merge( $extended, $array );\n\t\t\t}\n\t\t}\n\n\t\treturn $extended;\n\t}", "function array_shift_over($array, $index) {\n\n $size = sizeof($array);\n if($index >= $size || $index < 0) {\n return $array;\n } else {\n for($i=$index;$i<$size;$i++) {\n if($i === ($size-1)) {\n unset($array[$i]);\n } else {\n $array[$i] = $array[$i+1];\n }\n }\n }\n return $array;\n}", "function array_add($array, $key, $value)\n {\n return Arr::add($array, $key, $value);\n }", "function array_add($array, $key, $value)\n {\n return Arr::add($array, $key, $value);\n }", "public function arrayInsertBeforeKey(\n $origin = [],\n $wantedKey = '',\n $insert = []\n ) {\n $availableKeys = array_keys($origin);\n $position = array_search($wantedKey, $availableKeys);\n if ($position === false) {\n $position = count($origin);\n }\n\n $derivative = array_merge(\n array_slice($origin, 0, $position),\n $insert,\n array_slice($origin, $position)\n );\n\n return $derivative;\n }", "function ins2ary(&$ary, $element, $pos) {\n\t $ar1=array_slice($ary, 0, $pos); $ar1[]=$element;\n\t $ary=array_merge($ar1, array_slice($ary, $pos));\n\t}", "public function array_push_assoc($array, $key, $value)\n {\n $array[$key] = $value;\n return $array;\n }", "public function prepend() {\n $num_of_args = func_num_args();\n if ( $num_of_args == 1 && gettype( func_get_arg( 0 ) ) == \"array\" ) {\n $args = func_get_arg( 0 );\n $num_of_args = count( $args );\n } else {\n $args = func_get_args();\n }\n for ( $i = 0; $i < $num_of_args; $i++ ) {\n $arg = $args[$i];\n if ( $arg instanceof AbstractHTMLElement ) {\n $arg = $arg->asHTML();\n }\n $this->content = $arg . $this->content;\n }\n return $this;\n }", "function tmall_array_dot($array, $prepend = '')\n {\n $results = [];\n foreach ($array as $key => $value) {\n if (is_array($value) && !empty($value)) {\n $results = array_merge($results, tmall_array_dot($value, $prepend . $key . '.'));\n } else {\n $results[$prepend . $key] = $value;\n }\n }\n return $results;\n }", "public function prepend(string $key, $value)\n {\n // TODO: Implement prepend() method.\n }", "static function ensure(&$array, $value){\n\t\tif(array_search($value, $array) === false){\n\t\t\t$array[] = $value;\n\t\t}\n\t\treturn $array;\n\t}", "function array_dot($array, $prepend = '')\n {\n return Arr::dot($array, $prepend);\n }", "function array_dot($array, $prepend = '')\n {\n return Arr::dot($array, $prepend);\n }", "public function unshift($value) {\n\t\treturn $this->insert($value, 0);\n\t}", "public function prepend($region, $value)\n {\n return $this->appendOrPrepend($region, $value, 'prepend');\n }", "function array_push_assoc($array, $key, $value){\n $array[$key] = $value;\n return $array;\n }", "public static function array_insert_after($key, array &$array, $new_key, $new_value) {\n if (array_key_exists ($key, $array)) {\n $new = array();\n foreach ($array as $k => $value) {\n $new[$k] = $value;\n if ($k === $key) {\n $new[$new_key] = $new_value;\n }\n }\n return $new;\n }\n return $array;\n }", "function array_add($array, $key, $value)\n{\n if (!isset($array[$key])) {\n $array[$key] = $value;\n }\n\n return $array;\n}", "public static function prepend($middleware)\n {\n if (is_array($middleware)) {\n foreach ($middleware as $mw) {\n static::prepend($mw);\n }\n }\n\n if (array_search($middleware, static::$middleware) === false) {\n array_unshift(static::$middleware, $middleware);\n }\n }", "public function actions_prepend($this_player, $this_robot, $target_player, $target_robot, $this_action, $this_action_token){\n\n // Prepend the new action to the array\n array_unshift($this->actions, array(\n 'this_field' => $this->battle_field,\n 'this_player' => $this_player,\n 'this_robot' => $this_robot,\n 'target_player' => $target_player,\n 'target_robot' => $target_robot,\n 'this_action' => $this_action,\n 'this_action_token' => $this_action_token\n ));\n\n // Return the resulting array\n return $this->actions;\n\n }", "function array_dot($array, $prepend = '')\n {\n return ArrayHelper::dot($array, $prepend);\n }", "public function prepend($section){\n\t\t$body = $this->toArray();\n\t\t$_section = $this->get($section);\n\t\t$temp_body = [];\n\t\t$i = 0;\n\t\tforeach ($body as $key => $value) {\n\t\t\tif($key != $section){\n\t\t\t\tif($i == 0){\n\t\t\t\t\t$temp_body[$section] = $_section;\n\t\t\t\t\t$temp_body[$key] = $value;\n\t\t\t\t} else {\n\t\t\t\t\t$temp_body[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\t$this->updateFile($temp_body);\n\t}", "function array_extend($array1, $array2){\n $array1 = (is_array($array1)) ? $array1 : array();\n $array2 = (is_array($array2)) ? $array2 : array();\n foreach($array2 as $k=>$v){\n if (is_array($v) && is_associative_array($v)){\n if(!isset($array1[$k])) $array1[$k] = $v;\n else $array1[$k] = array_extend($array1[$k], $v);\n } else {\n if(is_array($v)){\n if (isset($array1[$k]) && is_array($array1[$k])) $array1[$k] = array_merge($array1[$k], $v);\n else $array1[$k] = $v;\n } else $array1[$k] = $v;\n }\n }\n return $array1;\n}", "private function _prepareRow($array){\n return array_merge($this->_blankRow, $array);\n }", "function array_prefix_keys(string $prefix, array $array): array\n{\n if (is_numeric_array($array)) {\n return $array;\n }\n\n $result = [];\n foreach ($array as $key => $value) {\n $result[$prefix . $key] = $value;\n }\n return $result;\n}", "public function createArrayFromAnotherArrayWhileOmittingEmptyValues($array = array()){\n\n $new_array = array();\n if(count($array) > 0){\n\n foreach($array as $key => $value){\n if(!empty($value)){\n $new_array[] = $value;\n }\n }\n\n }\n\n return $new_array;\n\n }", "function arrayReplace()\n {\n $a = func_get_args();\n // Do not make this reference,\n // it helpful if you just pass pure array without assign.\n $new = $a[0];\n if (!isArray($new)) {\n return triggerJson(\n '\\PMVC\\arrayReplace Param1 should be array type.',\n ['Array' => $new]\n );\n }\n for ($i = 1, $j = count($a); $i < $j; $i++) {\n // This is for handle empty array not empty value\n if (is_null($a[$i])) {\n continue;\n }\n if (!isArray($a[$i])) {\n $new[] = $a[$i];\n } else {\n foreach ($a[$i] as $k => $v) {\n $new[$k] = $v;\n }\n }\n }\n\n return $new;\n }", "public function prependItem($item, $key=null): CollectionInterface;", "public function array_add($array, $key, $value)\n {\n return Arr::add($array, $key, $value);\n }", "function prepend($item) {\r\n return Match::on($item)\r\n ->ListM(function($list) {\r\n return new self(array_merge($list->value(), $this->list));\r\n })\r\n ->any(function($item) {\r\n return new self(array_merge([$item], $this->list));\r\n })\r\n ->value(); \r\n }", "public function prepend($data, $namespace='default')\n {\n Type::force($data, ArrayAccess::class);\n\n if (!isset($this->addedData[$namespace])) {\n $this->addedData[$namespace] = [];\n }\n\n array_unshift($this->addedData[$namespace], $data);\n\n return $this;\n }", "public static function prependToIncludePath($path)\r\n {\r\n $paths=array();\r\n foreach (func_get_args() as $arg) {\r\n if (is_array($arg)) $paths=array_merge($paths, $arg);\r\n else $paths[]=$arg;\r\n }\r\n $paths[]=get_include_path();\r\n return self::setIncludePath($paths);\r\n }" ]
[ "0.824486", "0.8198338", "0.80102855", "0.75249577", "0.7500424", "0.7308498", "0.7224125", "0.7217231", "0.7143761", "0.7122985", "0.6857518", "0.682815", "0.67646223", "0.66396856", "0.6598507", "0.64426047", "0.64299524", "0.63584507", "0.6327717", "0.6308613", "0.62941426", "0.62461394", "0.622624", "0.621692", "0.6159515", "0.6148473", "0.6125088", "0.6080204", "0.6040827", "0.60091186", "0.6000548", "0.5965407", "0.5964446", "0.5954251", "0.59184414", "0.58951473", "0.58910143", "0.5888768", "0.5866559", "0.5845767", "0.58360267", "0.58216566", "0.58025897", "0.5791816", "0.57856476", "0.5772488", "0.57718086", "0.5724375", "0.5709109", "0.57062507", "0.5703486", "0.5695058", "0.5655209", "0.5642585", "0.56217325", "0.5617379", "0.56097895", "0.5605952", "0.5602951", "0.55925065", "0.55925065", "0.5584256", "0.55561525", "0.55299664", "0.55153084", "0.55077696", "0.54936713", "0.548721", "0.54676753", "0.54567116", "0.54401517", "0.54401517", "0.54401195", "0.5413239", "0.5409824", "0.539934", "0.53867555", "0.5381664", "0.5357319", "0.535264", "0.535264", "0.53513336", "0.5347469", "0.53373224", "0.5315326", "0.5306474", "0.5305858", "0.52940744", "0.5293693", "0.5275894", "0.5271385", "0.52614194", "0.52599204", "0.5253836", "0.5226708", "0.5222378", "0.5215868", "0.52156", "0.51923907", "0.51734126" ]
0.86719376
0
Extracts data from an array. The array can be a multidimensional array or an array of objects, and the property may thus be an array index, property name or even, with the function parameter set, a class method to call for result
function arrayExtract($array, $property, $keep_keys = false, $function=false) { $r = array(); foreach($array as $key => $a) { if(is_object($a)) { if($keep_keys) { if($function && method_exists($a, $property)) { $r[$key] = $a->$property(); } else { $r[$key] = @$a->$property; } } else { if($function && method_exists($a, $property)) { $r[] = $a->$property(); } else { $r[] = @$a->$property; } } } elseif(isset($a[$property])) { if($keep_keys) { $r[$key] = $a[$property]; } else { $r[] = $a[$property]; } } } return $r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function extractInArray(array $array);", "protected static function getPropertyFromArray(array $dataArray, string $property, array $subProperties = [])\n {\n\n if (isset($dataArray[$property])) {\n\n if (is_array($dataArray[$property])) {\n\n self::getPropertiesFromArray($dataArray[$property], $subProperties);\n\n } else {\n\n if (is_bool($dataArray[$property])) {\n return intval($dataArray[$property]);\n\n } else {\n return $dataArray[$property];\n }\n }\n }\n\n return null;\n }", "abstract function extract(): array;", "public function getProperties(array &$properties);", "private function extract_array($array)\n\t{\n\t\t// but extracts to member variables, and performs removal of DB escaped\n\t\t// characters \n\t\tforeach($array as $key => $value)\n\t\t{\n\t\t\t$this->$key = IOSystem::DBUnencode($value);\n\t\t}\n\t}", "function array_pluck(array $array, $field) {\n\t$final = array();\n\tforeach($array as $v) {\n\t\t$final[] = $v[$field];\n\t}\n\treturn $final;\n}", "function grabContents( $array, $field, $sub ){\n\t\n\t$value = $array[$field][$sub];\n\t\n\treturn $value;\t\n}", "public static function getValue($array, $key)\n\t{\n\t\t$keys = explode(\"->\", $key);\n\t\tforeach ($keys as $k) {\n\t\t\tif (is_array($array) && isset($array[$k])) {\n\t\t\t\t$array = $array[$k];\n\t\t\t} else if (is_object($array) && property_exists($array, $k)) {\n\t\t\t\t$array = $array->$k;\n\t\t\t} else {\n\t\t\t\t$array = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $array;\n\t}", "private function & refArrayItemByPath(& $array)\n\t{\n\t\t$p = & $array;\n\t\t$argc = func_num_args();\n\t\tfor ($i = 1; $i < $argc; $i++) {\n\t\t\t$k = func_get_arg($i);\n\t\t\tif ($k === null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (is_array($k)) {\n\t\t\t\tforeach ($k as $kk) {\n\t\t\t\t\tif (!isset($p[$kk])) {\n\t\t\t\t\t\t$p[$kk] = array();\n\t\t\t\t\t}\n\t\t\t\t\t$p = & $p[$kk];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!isset($p[$k])) {\n\t\t\t\t\t$p[$k] = array();\n\t\t\t\t}\n\t\t\t\t$p = & $p[$k];\n\t\t\t}\n\t\t}\n\n\t\treturn $p;\n\t}", "public function extract(array $params);", "private function get_object_array($array){\n \n }", "function GetField($arr, $field)\n{\n $result = array();\n for ($i = 0; $i < count($arr); $i ++)\n array_push($result, $arr[$i][$field]);\n return $result;\n}", "function array_pluck($array, $value, $key = null)\n\t{\n\t\t$results = array();\n\n\t\tforeach ($array as $item)\n\t\t{\n\t\t\t$itemValue = is_object($item) ? $item->{$value} : $item[$value];\n\n\t\t\t// If the key is \"null\", we will just append the value to the array and keep\n\t\t\t// looping. Otherwise we will key the array using the value of the key we\n\t\t\t// received from the developer. Then we'll return the final array form.\n\t\t\tif (is_null($key))\n\t\t\t{\n\t\t\t\t$results[] = $itemValue;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$itemKey = is_object($item) ? $item->{$key} : $item[$key];\n\n\t\t\t\t$results[$itemKey] = $itemValue;\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}", "function get_array_value($arr, $props = array()) {\n\tif ($arr == null) {\n\t\treturn null;\n\t}\n\n\tforeach($props as $prop) {\n\t\tif (array_key_exists($prop, $arr)) {\n\t\t\t$arr = $arr[$prop];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn $arr;\n}", "protected function getDataArray() {\n trace('[METHOD] '.__METHOD__);\n\n\t\t$dataArray = array();\n\n\t\tforeach (get_class_vars( __CLASS__ ) as $propertyname => $pvalue) {\n\t\t\t$getter = 'get_'.$propertyname;\n\t\t\t$dataArray[$propertyname] = $this->$getter();\n\t\t}\n\n\t\treturn $dataArray;\n\t}", "function pluck($field, array $array) {\n return array_column($array,$field);\n }", "private function extractFromAccessor($class, $property)\n {\n list($reflectionMethod, $prefix) = $this->getAccessorMethod($class, $property);\n if (null === $reflectionMethod) {\n return;\n }\n\n if ($this->supportsParameterType && $reflectionType = $reflectionMethod->getReturnType()) {\n return array($this->extractFromReflectionType($reflectionType));\n }\n\n if (in_array($prefix, array('is', 'can'))) {\n return array(new Type(Type::BUILTIN_TYPE_BOOL));\n }\n }", "public function parseGetData(array $data) {\n return $data;\n }", "abstract public function array2Data($arr);", "static function objExtractOneKey($arr, $key)\n\t{\n\t\t$new = [];\n\t\tforeach($arr as $itm)\n\t\t\t$new[] = $itm->$key;\n\t\t\n\t\treturn $new;\n\t}", "static function pluck(array $array, $value, $key = null) {\n $ret = [];\n\n foreach ($array as $item) {\n $itemValue = is_object($item) ? $item->{$value} : $item[$value];\n\n if (null === $key) {\n $ret[] = $itemValue;\n } else {\n $itemKey = is_object($item) ? $item->{$key} : $item[$key];\n $ret[$itemKey] = $itemValue;\n }\n }\n\n return $ret;\n }", "function get(array $data) {\n\t\t$values = [];\n\t\tforeach ($data as $key) {\n\t\t\t$values[$key] = $this->$key ?? null;\n\t\t}\n\n\t\treturn $values;\n\t}", "public function __invoke() : array;", "public function __invoke() : array;", "abstract public function getArray();", "public static function getBy($array) {\n return parent::getBy($array);\n }", "protected static function getPropertiesFromArray(array $dataArray, array $propertyArray): array\n {\n $result = [];\n foreach ($propertyArray as $property => $subProperties) {\n\n // if there are no sub-properties to fetch\n if (\n (is_numeric($property))\n && (! is_array($subProperties))\n ){\n $property = $subProperties;\n unset($subProperties);\n }\n\n $result[$property] = self::getPropertyFromArray($dataArray, $property, $subProperties);\n }\n\n return $result;\n }", "private function dataConvert($array)\n {\n $result = false;\n if(count($array) && isset($array[0]) && is_array($array[0]))\n {\n $class = get_class($this);\n foreach($array as $arr)\n {\n $result[] = new $class((int) $arr[$this->primaryName]);\n }\n }\n else if(count($array))\n {\n $class = get_class($this);\n $result = new $class((int) $array[$this->primaryName]);\n }\n return $result;\n }", "private function extractFromMutator($class, $property)\n {\n list($reflectionMethod, $prefix) = $this->getMutatorMethod($class, $property);\n if (null === $reflectionMethod) {\n return;\n }\n\n $reflectionParameters = $reflectionMethod->getParameters();\n $reflectionParameter = $reflectionParameters[0];\n\n if ($this->supportsParameterType) {\n if (!$reflectionType = $reflectionParameter->getType()) {\n return;\n }\n $type = $this->extractFromReflectionType($reflectionType);\n\n // HHVM reports variadics with \"array\" but not builtin type hints\n if (!$reflectionType->isBuiltin() && Type::BUILTIN_TYPE_ARRAY === $type->getBuiltinType()) {\n return;\n }\n } elseif (preg_match('/^(?:[^ ]++ ){4}([a-zA-Z_\\x7F-\\xFF][^ ]++)/', $reflectionParameter, $info)) {\n if (Type::BUILTIN_TYPE_ARRAY === $info[1]) {\n $type = new Type(Type::BUILTIN_TYPE_ARRAY, $reflectionParameter->allowsNull(), null, true);\n } elseif (Type::BUILTIN_TYPE_CALLABLE === $info[1]) {\n $type = new Type(Type::BUILTIN_TYPE_CALLABLE, $reflectionParameter->allowsNull());\n } else {\n $type = new Type(Type::BUILTIN_TYPE_OBJECT, $reflectionParameter->allowsNull(), $info[1]);\n }\n } else {\n return;\n }\n\n if (in_array($prefix, self::$arrayMutatorPrefixes)) {\n $type = new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), $type);\n }\n\n return array($type);\n }", "function offsetGet(/*. mixed .*/ $object_){}", "public function testGetReturnsValueFromArrayBySinglePath()\n {\n $array = ['a' => 1];\n $actual = $this->property->get($array, 'a');\n $this->assertEquals(1, $actual);\n }", "public function extract(array $data)\n\t{\t\t\n\t\t$result = array();\n\t\tforeach ($this->_fields as $f)\n\t\t{\n\t\t\t$result[$f] = null;\n\t\t\tif (array_key_exists($f, $data))\n\t\t\t{\n\t\t\t\t$result[$f] = $data[$f];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "private function getArrayItemByPath($array)\n\t{\n\t\t$p = $array;\n\t\t$argc = func_num_args();\n\t\tfor ($i = 1; $i < $argc; $i++) {\n\t\t\t$k = func_get_arg($i);\n\t\t\tif ($k === null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (is_array($k)) {\n\t\t\t\tforeach ($k as $kk) {\n\t\t\t\t\tif (isset($p[$kk])) {\n\t\t\t\t\t\t$p = $p[$kk];\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (isset($p[$k])) {\n\t\t\t\t\t$p = $p[$k];\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $p;\n\t}", "public static function pluck($array, $value, $key = null)\n {\n $results = [];\n\n list($value, $key) = self::explodePluckParameters($value, $key);\n\n $func = is_object($array) ? 'object_get' : 'get';\n\n foreach ($array as $item) {\n $itemValue = self::$func($item, $value);\n\n // If the key is \"null\", we will just append the value to the array and keep\n // looping. Otherwise we will key the array using the value of the key we\n // received from the developer. Then we'll return the final array form.\n if (is_null($key)) {\n $results[] = $itemValue;\n } else {\n $itemKey = self::$func($item, $key);\n\n $results[$itemKey] = $itemValue;\n }\n }\n\n return $results;\n }", "public static function extract(array $array, string $column): array\n {\n if (empty($array)) {\n return [];\n }\n\n $values = array_map(\n fn ($item) => self::getProperty($item, $column),\n $array\n );\n\n $values = array_filter(\n array_unique($values),\n fn ($item) => $item !== null\n );\n\n return array_values($values);\n }", "public static function pluck($array, $value, $key = null)\n {\n $results = array();\n\n foreach ($array as $item) {\n $itemValue = is_object($item) ? $item->{$value} : $item[$value];\n // If the key is \"null\", we will just append the value to the array and keep\n // looping. Otherwise we will key the array using the value of the key we\n // received from the developer. Then we'll return the final array form.\n if (is_null($key)) {\n $results[] = $itemValue;\n } else {\n $itemKey = is_object($item) ? $item->{$key} : $item[$key];\n $results[$itemKey] = $itemValue;\n }\n }\n\n return $results;\n }", "function getArrayProperty($object, $name) {\r\n\r\n\r\n\t}", "private function _getValue( $arr, $field = 1 ) {\n\t\t$data\t= explode( ':', $arr );\n\t\treturn $data[$field];\n\t}", "private function pluck($a, $prop) {\r\n $out = array();\r\n for ($i = 0, $len = count($a); $i < $len; $i++) {\r\n $out[] = $a[$i][$prop];\r\n }\r\n return $out;\r\n }", "function array_pluck($array, $column) {\n\treturn array_map(function($obj) use ($column) {\n\t\treturn $obj[$column];\n\t}, $array);\n}", "function getData()\n{\n return array(\n array(\"name\"=>\"Bob\",\"age\"=>50),\n array(\"name\"=>\"Jane\",\"age\"=>41),\n array(\"name\"=>\"Sarah\",\"age\"=>30)\n );\n}", "public function offsetGet($key): mixed\n {\n if (is_array($this->_data)) {\n return $this->out($this->_data[$key], $key, 'array');\n } elseif ($this->_data instanceof \\ArrayAccess) {\n return $this->out($this->_data[$key], $key, 'array');\n } else {\n throw new \\Exception('Cannot use object of type ' . get_class($this->_data) . ' as array');\n }\n }", "function pluck(array $objects, $property) {\r\n\t$properties = array();\r\n\t\r\n\tforeach ($objects as $object) {\r\n\t\t$properties[] = $object->{$property};\r\n\t}\r\n\t\r\n\treturn $properties;\r\n}", "public function getArray($prop) {\n\n\t\t\t// Get property\n\t\t\t$val = $this->get($prop);\n\n\t\t\t// Parse as a string\n\t\t\tif (is_array($val)) {\n\t\t\t\treturn $val;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t}", "public static function byArray(array $array) {}", "public static function pluck( $array, $value, $key = null )\n {\n $results = [];\n\n list( $value, $key ) = static::explodePluckParameters( $value, $key );\n\n foreach ( $array as $item ) {\n $itemValue = data_get( $item, $value );\n\n // If the key is \"null\", we will just append the value to the array and keep\n // looping. Otherwise we will key the array using the value of the key we\n // received from the developer. Then we'll return the final array form.\n if ( is_null( $key ) ) {\n $results[] = $itemValue;\n } else {\n $itemKey = data_get( $item, $key );\n\n if ( is_object( $itemKey ) && method_exists( $itemKey, '__toString' ) ) {\n $itemKey = (string)$itemKey;\n }\n\n $results[ $itemKey ] = $itemValue;\n }\n }\n\n return $results;\n }", "static function build(array $array, callable $callback) {\n $ret = [];\n\n foreach ($array as $key => $value) {\n list($innerKey, $innerValue) = $callback($key, $value);\n $ret[$innerKey] = $innerValue;\n }\n\n return $ret;\n }", "abstract protected function buildPropertyMapArray(array $array, PropertyMap $propertyMap);", "protected abstract function getData(): array;", "function __get($property) {\n if(isset($this->DATA[$property])) {\n if(@$this->TYPE[$property] == 'CSV' && @is_string($this->DATA[$property]))\n $val = explode(',', @$this->DATA[$property]);\n else $val = @$this->DATA[$property];\n\n return $val;\n }\n }", "public function arrayToObject($array): static;", "private function parseobject($array)\n {\n if (is_object($array)) {\n if (get_class($array) == 'DataObject') {\n return $array;\n }\n $do = DataObject::create();\n foreach (get_object_vars($array) as $key => $obj) {\n if ($key == '__Type') {\n $do->setField('Title', $obj);\n } elseif (is_array($obj) || is_object($obj)) {\n $do->setField($key, $this->parseobject($obj));\n } else {\n $do->setField($key, $obj);\n }\n }\n return $do;\n } elseif (is_array($array)) {\n $dataList = ArrayList::create();\n foreach ($array as $key => $obj) {\n $dataList->push($this->parseobject($obj));\n }\n return $dataList;\n }\n return null;\n }", "public function extracting($arg) {\n if ($arg instanceof \\Closure) {\n return self::of($arg($this->value));\n } else if (is_array($arg)) {\n $value= [];\n foreach ($arg as $key => $extract) {\n $value[$key]= $this->extracting($extract)->value;\n }\n return self::of($value);\n } else {\n return self::of((new InstanceExtractor($this->value))->extract($arg));\n }\n }", "private static function extractFileData($file, $property = NULL) {\n\t\tinclude_once ABSPATH . \"/wp-admin/includes/plugin.php\";\n\t\t\n\t\t$data = @get_plugin_data($file);\n\t\t\n\t\tif (!is_null($property))\n\t\t\treturn @$data[$property];\n\t\t\t\n\t\treturn $data;\n\t}", "function astar( $array, $prop, $default = null ) {\n\t\treturn astra_get_prop( $array, $prop, $default );\n\t}", "public static function item($array, $name)\n {\n if (($array != null) && (strlen($name) > 0))\n {\n if (is_array($array))\n return array_key_exists($name, $array) ? $array[$name] : null;\n if (is_object($array))\n return property_exists($array, $name) ? $array->$name : null;\n }\n return null;\n }", "protected function hydrate($array){\r\n\t\tforeach ($array as $key => $value) {\r\n\t\t\t$methodName = 'set'.ucfirst($key);\r\n\t\t\tif(method_exists($this, $methodName)){\r\n\t\t\t\t$this->$methodName($value);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function array_pluck($array, $value, $key = null)\n {\n return Arr::pluck($array, $value, $key);\n }", "function element($key, $array)\n{\n\treturn $array[$key];\n}", "function fnGet(&$array, $key, $default = null, $separator = '/')\n{\n if (($sub_key_pos = strpos($key, $separator)) === false) {\n if (is_object($array)) {\n return property_exists($array, $key) ? $array->$key : $default;\n }\n return isset($array[$key]) ? $array[$key] : $default;\n } else {\n $first_key = substr($key, 0, $sub_key_pos);\n if (is_object($array)) {\n $tmp = property_exists($array, $first_key) ? $array->$first_key : null;\n } else {\n $tmp = isset($array[$first_key]) ? $array[$first_key] : null;\n }\n return fnGet($tmp, substr($key, $sub_key_pos + 1), $default, $separator);\n }\n}", "public abstract function FetchArray();", "function getArray();", "function array_get($key, $array)\n {\n return arr::get($key, $array);\n }", "function arr($array) {\n if (is_array($array)) {\n return new Arr($array);\n }\n return $array;\n}", "public function offsetGet($offset): mixed;", "public function getData(): array;", "public function getData(): array;", "public function getData(): array;", "public function getData(): array;", "public function getFiltred(array &$data);", "public static function build($array, callable $callback)\n {\n $results = [];\n\n foreach ($array as $key => $value)\n {\n list($innerKey, $innerValue) = call_user_func($callback, $key, $value);\n\n $results[$innerKey] = $innerValue;\n }\n\n return $results;\n }", "function array_pluck($array, $value, $key = null)\n {\n return Arr::pluck($array, $value, $key);\n }", "function array_pluck($array, $value, $key = null)\n {\n return Arr::pluck($array, $value, $key);\n }", "public static function getColumn(array $arr,$attribute){\n $column=array();\n foreach($arr as $one){\n if(is_array($one)){\n $column[]=$one[$attribute];\n }else{\n $column[]=$one->{$attribute};\n }\n }\n return $column;\n }", "public function getData() : array;", "public function getData() : array;", "function &offsetGet($offset) {\n $property = defined('static::$DOMAIN_PROPERTY') ? static::$DOMAIN_PROPERTY : 'data';\n if(!isset($this->{$property})) {\n $this->{$property} = [];\n }\n\n if(is_array($this->{$property}) && isset($this->{$property}[$offset])) {\n return $this->{$property}[$offset];\n }\n\n $none = null;\n return $none;\n }", "public function get(string $key, array $array)\n {\n $keys = explode('.', $key);\n\n foreach ($keys as $ikey) {\n $array = $array[$ikey];\n }\n\n return $array;\n }", "public function offsetGet($offset)\n\t{\n\t\tif(isset(self::$arrayMap[$offset])) {\n\t\t\treturn $this->{self::$arrayMap[$offset]};\n\t\t}\n\t}", "function toArray($objects, $valueMethod, $keyMethod = null)\n{\n $results = [];\n\n foreach ($objects as $object) {\n $value = call_user_func([$object, $valueMethod]);\n if (null !== $keyMethod) {\n $key = call_user_func([$object, $keyMethod]);\n\n $results[$key] = $value;\n } else {\n $results[] = $value;\n }\n }\n\n return $results;\n}", "public function offsetGet($offset)\n {\n return $this->array[$offset];\n }", "public static function build($array, callable $callback)\n {\n $results = [];\n\n foreach ($array as $key => $value) {\n list($innerKey, $innerValue) = call_user_func($callback, $key, $value);\n\n $results[$innerKey] = $innerValue;\n }\n\n return $results;\n }", "public static function pluck($array, $value, $key = null)\n\t{\n\t\t$results = [];\n\n\t\tforeach ($array as $item)\n\t\t{\n\t\t\t$itemValue = static::dataGet($item, $value);\n\n\t\t\t// If the key is \"null\", we will just append the value to the array and keep\n\t\t\t// looping. Otherwise we will key the array using the value of the key we\n\t\t\t// received from the developer. Then we'll return the final array form.\n\t\t\tif (is_null($key))\n\t\t\t{\n\t\t\t\t$results[] = $itemValue;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$itemKey = static::dataGet($item, $key);\n\n\t\t\t\t$results[$itemKey] = $itemValue;\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}", "public function getVDefValues(array $array, $caller = NULL, $arrayKey = NULL) {\n\t\tif ($caller === NULL) {\n\t\t\t$caller = $this;\n\t\t}\n\t\tforeach($array as $key => $value) {\n\t\t\tif ($key === 'vDEF') {\n\t\t\t\t$caller->temporaryDceProperties[substr($arrayKey, 9)] = $value;\n\t\t\t}\n\t\t\telseif (is_array($value) && array_key_exists('el', $value)) {\n\t\t\t\t$propertyName = substr($key, 9);\n\t\t\t\t$values = array();\n\t\t\t\t$i = 1;\n\t\t\t\tif (is_array(current($value))) {\n\t\t\t\t\tforeach (current($value) as $entry) {\n\t\t\t\t\t\tif (is_array($entry)) {\n\t\t\t\t\t\t\t$entry = $entry['container_' . $propertyName]['el'];\n\t\t\t\t\t\t\tif (is_array($entry)) {\n\t\t\t\t\t\t\t\tforeach($entry as $k => $v) {\n\t\t\t\t\t\t\t\t\t$entry[$k] = $v['vDEF'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$values[$i++] = array('container_' . $propertyName => $entry);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$caller->temporaryDceProperties[$propertyName] = $values;\n\t\t\t} elseif (is_array($value)) {\n\t\t\t\t$this->getVDefValues($value, $caller, $key);\n\t\t\t}\n\t\t}\n\t}", "function array_pluck($array, $column) {\n return array_map(function($obj) use ($column) {\n return isset($obj[$column]) ? $obj[$column] : null;\n }, $array);\n}", "private function arrayWalk(array $array, $function)\n {\n array_walk($array, $function);\n\n return $array;\n }", "protected function extractValue(mixed $element, ?string $propertyOrMethod): mixed\n {\n if ($propertyOrMethod === null) {\n return $element;\n }\n\n if (!is_object($element) && !is_array($element)) {\n throw new UnsupportedOperationException(sprintf(\n 'The collection type \"%s\" does not support the $propertyOrMethod parameter',\n $this->getType(),\n ));\n }\n\n if (is_array($element)) {\n return $element[$propertyOrMethod] ?? throw new InvalidPropertyOrMethod(sprintf(\n 'Key or index \"%s\" not found in collection elements',\n $propertyOrMethod,\n ));\n }\n\n if (property_exists($element, $propertyOrMethod)) {\n return $element->$propertyOrMethod;\n }\n\n if (method_exists($element, $propertyOrMethod)) {\n return $element->{$propertyOrMethod}();\n }\n\n throw new InvalidPropertyOrMethod(sprintf(\n 'Method or property \"%s\" not defined in %s',\n $propertyOrMethod,\n $element::class,\n ));\n }", "public function offsetGet($offset)\n\t{\n\t\t$data = $this->getData();\n\t\treturn $data[$offset];\n\t}", "abstract public function getFieldData(): array;", "public function getDataByMultiKey() {\n $val = json_decode($this, true);\n for ($i = 0; $i < func_num_args(); $i++) {\n $valid = false; //assume response is not valid unless the ith argument is found\n if (isset($val[func_get_arg($i)])) {\n $val = $val[func_get_arg($i)];\n $valid = true;\n }\n }\n if ($valid) {\n return $val;\n }\n else {\n return null;\n }\n return null;\n }", "function populateFromArray(array $arr);", "function populateFromArray(array $arr);", "public function calculate(array $data);", "function getFirstElement($array){\n\n /*\n * convert object to array first\n */\n\n if(is_object($array)){\n $array = (array) $array;\n }\n\n\n /*\n * check if this array is\n * php array\n */\n\n if(is_array($array)){\n return getElement($array);\n }\n\n /*\n * if json array\n * check if json is valid\n * and decode the array\n */\n\n $array = jsonDecode($array);\n\n /*\n * return with the first element\n */\n\n return getElement($array);\n\n}", "private function readProperty($zval, $property)\n {\n if (!is_object($zval[self::VALUE])) {\n throw new NoSuchPropertyException(sprintf('Cannot read property \"%s\" from an array. Maybe you intended to write the property path as \"[%s]\" instead.', $property, $property));\n }\n\n $result = self::$resultProto;\n $object = $zval[self::VALUE];\n $access = $this->getReadAccessInfo(get_class($object), $property);\n\n if (self::ACCESS_TYPE_METHOD === $access[self::ACCESS_TYPE]) {\n $result[self::VALUE] = $object->{$access[self::ACCESS_NAME]}();\n } elseif (self::ACCESS_TYPE_PROPERTY === $access[self::ACCESS_TYPE]) {\n $result[self::VALUE] = $object->{$access[self::ACCESS_NAME]};\n\n if ($access[self::ACCESS_REF] && isset($zval[self::REF])) {\n $result[self::REF] = &$object->{$access[self::ACCESS_NAME]};\n }\n } elseif (!$access[self::ACCESS_HAS_PROPERTY] && property_exists($object, $property)) {\n // Needed to support \\stdClass instances. We need to explicitly\n // exclude $access[self::ACCESS_HAS_PROPERTY], otherwise if\n // a *protected* property was found on the class, property_exists()\n // returns true, consequently the following line will result in a\n // fatal error.\n\n $result[self::VALUE] = $object->$property;\n if (isset($zval[self::REF])) {\n $result[self::REF] = &$object->$property;\n }\n } elseif (self::ACCESS_TYPE_MAGIC === $access[self::ACCESS_TYPE]) {\n // we call the getter and hope the __call do the job\n $result[self::VALUE] = $object->{$access[self::ACCESS_NAME]}();\n } else {\n throw new NoSuchPropertyException($access[self::ACCESS_NAME]);\n }\n\n // Objects are always passed around by reference\n if (isset($zval[self::REF]) && is_object($result[self::VALUE])) {\n $result[self::REF] = $result[self::VALUE];\n }\n\n return $result;\n }", "function pluck($col, $array)\n{\n $res = array();\n foreach ($array as $k => $row) {\n $res[$k] = $row[$col];\n }\n return $res;\n}", "public static function getColumn(array $array, $index)\n {\n $result = array();\n \n foreach ($array as $item)\n {\n if (is_array($item) && isset($item[$index]))\n {\n $result[] = $item[$index];\n }\n elseif (is_object($item) && isset($item->$index))\n {\n $result[] = $item->$index;\n }\n }\n \n return $result;\n }", "public static function getProperties(array $element) {\n $properties = [];\n foreach ($element as $key => $value) {\n if (Element::property($key)) {\n $properties[$key] = $value;\n }\n }\n return $properties;\n }", "public static function getProp($array, $propName){\n\t\tif (empty($array[\"$propName\"]))\n\t\t\treturn \"\";\n\t\telse\n\t\t\treturn trim(stripslashes($array[\"$propName\"]));\n\t}", "private function ArrayToGet($array, $switch) {\r\n if ($switch == Constans::PART_HEAD) {\r\n $this->_title = $array[Constans::ELEMENT_TITLE];\r\n $this->_keywords = \"\";\r\n foreach ($array[Constans::ELEMENT_KEYWORDS] as $value) {\r\n if ($value != end($array[Constans::ELEMENT_KEYWORDS])) {\r\n $this->_keywords .= $value . \", \";\r\n } else {\r\n $this->_keywords .= $value;\r\n }\r\n }\r\n $this->_description = $array[Constans::ELEMENT_DESCRIPTION];\r\n }\r\n }" ]
[ "0.6166735", "0.6165866", "0.6084929", "0.6055655", "0.581391", "0.5744903", "0.56974685", "0.56848854", "0.56456816", "0.56347746", "0.5617737", "0.5583763", "0.55718195", "0.55344975", "0.5528535", "0.5523481", "0.5517173", "0.54748124", "0.54574895", "0.5422146", "0.5420832", "0.5381141", "0.53599155", "0.53599155", "0.5349525", "0.5348595", "0.5329629", "0.5326211", "0.53236175", "0.53232044", "0.53191304", "0.5297912", "0.52839386", "0.52772367", "0.52601856", "0.52496284", "0.5224369", "0.5220653", "0.5209838", "0.52090186", "0.5188919", "0.51861095", "0.5150166", "0.5149416", "0.5116556", "0.5084149", "0.5079652", "0.50751543", "0.50707465", "0.5069787", "0.5065978", "0.5060975", "0.50576895", "0.5054725", "0.5052893", "0.5044521", "0.5039217", "0.5029054", "0.50238717", "0.5016446", "0.500295", "0.49964663", "0.49949956", "0.49945801", "0.49895185", "0.49867532", "0.49867532", "0.49867532", "0.49867532", "0.49832433", "0.49810484", "0.4967768", "0.4967768", "0.4964034", "0.496392", "0.496392", "0.4959962", "0.49579328", "0.49563706", "0.49551597", "0.49549332", "0.49530947", "0.49422562", "0.49396807", "0.4933922", "0.4931781", "0.49300694", "0.49233544", "0.49221426", "0.49140406", "0.49135295", "0.49135295", "0.49128053", "0.49125934", "0.48991457", "0.48915714", "0.48914605", "0.48832634", "0.4875508", "0.48731866" ]
0.7064305
0
Sort an array of objects according to a given property
function propsort(&$array, $property) { uasort($array, create_function('$a,$b','return strcmp($a->'.$property.', $b->'.$property.');')); return $array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ObjectSorter(&$array, $props){\n if(!is_array($props)) $props = array($props => true); \n\t\t$function = '$props=unserialize(\\''.trim(serialize($props)).'\\');\n\t\t\t\tforeach($props as $prop => $ascending) { \n\t\t\t\t\tif($a->$prop != $b->$prop) { \n\t\t\t\t\t\tif($ascending==\"ASC\") return ($a->$prop > $b->$prop) ? 1 : -1; \n\t\t\t\t\t\telse return ($b->$prop > $a->$prop) ? 1 : -1; \n\t\t\t\t\t} \n\t\t\t\t} \n\t\t\t\treturn -1;';\n usort($array, create_function('$a,$b', $function) );\n\t}", "public static function sort(&$array, $orderBy) {\n $new_array = array();\n foreach ($array as $key => $obj) {\n $new_array[$key] = get_object_vars($obj->getEntity());\n $obj->hash = $new_array[$key]['hash'] = spl_object_hash($obj);\n }\n\n $new_array = self::sort_array_multidim($new_array, $orderBy);\n\n $output = array();\n foreach ($new_array as $key => $value) {\n\n }\n print_r($new_array);\n }", "private function osort(&$oarray, $props)\n {\n usort(\n $oarray\n , create_function(\n '$a,$b'\n ,'if($a->' . $props . '== $b->' . $props .'){\n return 0;\n }\n else {\n return ($a->' . $props . '< $b->' . $props .') ? -1 : 1;\n }'\n )\n );\n }", "protected function _sortByArray($array) {}", "public function sortByProp($array, $propertyName)\n\t{\n\t\t$sorted = [];\n\n\t\tforeach ($array as $item)\n\t\t\t$sorted[$item[$propertyName]][] = $item;\n\n\t\tksort($sorted);\n\t\t$result = [];\n\n\t\tforeach ($sorted as $subArray) \n\t\t\tforeach ($subArray as $item)\n\t\t\t\t$result[] = $item;\n\n\t\treturn $result;\n\t}", "public function asort() {}", "function array_sort_by(&$array_initial, $col, $order = SORT_ASC){\n\n $arrAux = array();\n\n foreach ($array_initial as $key=> $row){\n $arrAux[$key] = is_object($row) ? $arrAux[$key] = $row->$col : $row[$col];\n $arrAux[$key] = strtolower($arrAux[$key]);\n }\n\n array_multisort($arrAux, $order, $array_initial);\n }", "public function mySort(array $array);", "function ldap_sort_by (&$array, $attr) {\n\t$sort_func = create_function('$a,$b', 'return strcasecmp($a[\"'.$attr.'\"], $b[\"'.$attr.'\"]);' );\n\tuasort($array, $sort_func);\n}", "public function sort();", "public static function sort_objects(array &$objects_array, $sort_by, $sort_order = \"desc\") {\n $sort_order = strtolower($sort_order);\n uasort(\n $objects_array,\n function ($a, $b) use ($sort_by, $sort_order) {\n if($a->$sort_by == $b->$sort_by) {\n return 0;\n } else {\n $comparison = $a->$sort_by > $b->$sort_by;\n if($sort_order == \"desc\") {\n return $comparison ? -1 : 1;\n } else {\n return $comparison ? 1 : -1;\n }\n }\n });\n }", "function orderHotelsByRate($array)\n{\n return collect($array)->sortByDesc('hotelRate');\n}", "function sortBy($field, &$array, $direction = 'asc')\n{\n usort($array, create_function('$a, $b', '\n $a = $a[\"' . $field . '\"];\n $b = $b[\"' . $field . '\"];\n\n if ($a == $b) return 0;\n\n $direction = strtolower(trim($direction));\n\n return ($a ' . ($direction == 'desc' ? '>' : '<') . ' $b) ? -1 : 1;\n '));\n\n return true;\n}", "public static function sort(array &$objects, $sortingProperty) {\n\t\t$keyValues = array();\n\t\tforeach ($objects as $key => $object) {\n\t\t\t$propertyGetterName = 'get' . ucfirst($sortingProperty);\n\n\t\t\tif (method_exists($object, $propertyGetterName)) {\n\t\t\t\t$value = call_user_func(array($object, $propertyGetterName));\n\t\t\t} else {\n\t\t\t\t$value = '';\n\t\t\t}\n\n\t\t\t$keyValues[$key] = $value;\n\t\t}\n\n\t\tarray_multisort($keyValues, SORT_ASC, $objects);\n\t}", "protected function sortDataArray() {}", "function array_sort($array, $sortby) {\n\n $size = sizeof($array);\n\n for($i=0;$i<$size;$i++) {\n for($j=$i+1;$j<$size;$j++) {\n $temp = array();\n if($array[$i]['priority']<$array[$j]['priority']) {\n $temp = $array[$i];\n $array[$i] = $array[$j];\n $array[$j] = $temp;\n }\n }\n }\n return $array;\n}", "public static function arrSortObjsByKey($key, $order = 'DESC') {\n\treturn function($a, $b) use ($key, $order) {\n\t\t// Swap order if necessary\n\t\tif ($order == 'DESC') {\n \t \t\tlist($a, $b) = array($b, $a);\n \t\t} \n \t\t// Check data type\n \t\tif (is_numeric($a->$key)) {\n \t\t\treturn $a->$key - $b->$key; // compare numeric\n \t\t} else {\n \t\t\treturn strnatcasecmp($a->$key, $b->$key); // compare string\n \t\t}\n\t};\n}", "public static function SortArrayOfObjectsWithDateField($array,$fieldName,$order=\"ASC\"){\n usort($array, function($a, $b) use($order,$fieldName){\n\n $ad = date('Y-m-d H:i:s',strtotime($a->{$fieldName}));\n $bd = date('Y-m-d H:i:s',strtotime($b->{$fieldName}));\n if ($ad == $bd) {\n return 0;\n }\n if($order == Constants::$SortIndexDESC) {\n return $ad < $bd ? 1 : -1;\n }\n else{\n return $ad > $bd ? 1 : -1;\n }\n });\n return $array;\n }", "function sortArray( $data, $field ) {\r\n\t$field = (array) $field;\r\n\tuasort( $data, function($a, $b) use($field) {\r\n\t\t$retval = 0;\r\n\t\tforeach( $field as $fieldname ) {\r\n\t\t\tif( $retval == 0 ) $retval = strnatcmp( $a[$fieldname], $b[$fieldname] );\r\n\t\t}\r\n\t\treturn $retval;\r\n\t} );\r\n\treturn $data;\r\n}", "function aasort(&$array, $key){ // Seu array e o campo a ser ordenado\r\n\t$sorter = array();\r\n\t$ret = array();\r\n\treset($array);\r\n\tforeach($array as $ii => $va){\r\n\t\t$sorter[$ii] = $va[$key];\r\n\t}\r\n\tasort($sorter);\r\n\tforeach($sorter as $ii => $va){\r\n\t\t$ret[$ii] = $array[$ii];\r\n\t}\r\n\treturn ($ret);\r\n}", "public static function sortByProperty(array &$items, string $property, string $order = \"asc\") {\n if (!is_array($items)) {\n return false;\n }\n\n if (class_exists(\"Collator\")) {\n $collator = new Collator('en_US');\n } else {\n $collator = false;\n }\n\n return usort($items, function($a, $b) use ($property, $order, $collator) {\n if ($collator) {\n $cmp = $collator->compare($a[$property], $b[$property]);\n } else {\n $cmp = strcmp(static::seourelize($a[$property]), static::seourelize($b[$property]));\n }\n return $order === 'asc' ? $cmp : -$cmp;\n });\n }", "public function sortBy(string $key);", "function sort_results ($unsorted)\n{\n // Add a key to all objects in the array that allows for sensible\n // sorting of numeric substrings.\n foreach ($unsorted as $res) {\n $res->key = preg_replace_callback (\n '|\\d+|',\n function ($match) {\n return 'zz' . strval (strlen ($match[0])) . $match[0];\n },\n $res->meta_value\n );\n }\n\n // Sort the array according to key.\n usort (\n $unsorted,\n function ($res1, $res2) {\n return strcoll ($res1->key, $res2->key);\n }\n );\n\n return array_map (\n function ($s) {\n return $s->meta_value;\n },\n $unsorted\n );\n}", "public function by_method(&$objects, $direction='A', $sortkey_function)\n {\n // Build array of pairs ('sortkey', 'object')\n $meta_array = array();\n foreach ($objects as $obj) $meta_array[] = array('sortkey'=>$sortkey_function($obj), 'object'=>$obj);\n \n // Sort array of pairs\n if ($direction == 'D') \n {\n usort($meta_array, function($a, $b)\n { \n return ($a['sortkey']==$b['sortkey'] ? 0 : ($a['sortkey']<$b['sortkey'] ? 1 : -1)); \n } );\n }\n else \n {\n usort($meta_array, function($a, $b)\n { \n return ($a['sortkey']==$b['sortkey'] ? 0 : ($a['sortkey']<$b['sortkey'] ? -1 : 1)); \n } );\n }\n \n // Flatten array of pairs back into original array of object\n $objects = array();\n foreach ($meta_array as $meta_obj) $objects[] = $meta_obj['object'];\n }", "public function sortArray($input, $sortBy): static;", "private function sortArray($array, $sort_by) {\r\n\t\tforeach ($array as $pos => $val) {\r\n\t\t\t$tmp_array[$pos] = $val[$sort_by];\r\n\t\t}\r\n\t\tasort($tmp_array);\r\n\r\n\t\t$return_array = [];\r\n\t\tforeach ($tmp_array as $pos => $val) {\r\n\t\t\t$return_array[$pos]['title'] = $array[$pos]['title'];\r\n\t\t\t$return_array[$pos]['label'] = $array[$pos]['label'];\r\n\t\t\t$return_array[$pos]['sort'] = $array[$pos]['sort'];\r\n\t\t\t$return_array[$pos]['function'] = $array[$pos]['function'];\r\n\t\t}\r\n\t\treturn $return_array;\r\n\t}", "function cmp($a, $b){\n if ((int)$a->date[0] == (int)$b->date[0]) {\n return 0;\n }\n return ((int)$a->date[0] > (int)$b->date[0]) ? -1 : 1;\n}", "function cmp($a, $b){\n if ((int)$a->date[0] == (int)$b->date[0]) {\n return 0;\n }\n return ((int)$a->date[0] > (int)$b->date[0]) ? -1 : 1;\n}", "function array_sort($array, Closure $callback)\n\t{\n\t\treturn Illuminate\\Support\\Collection::make($array)->sortBy($callback)->all();\n\t}", "public function SortObjectsByName($obj){\r\n\t\tself::Debug('Sort objects by name');\r\n\t\t$temp=Array();\r\n\t\t$i=-1;\r\n\t\t$len=sizeof($obj);\r\n\t\twhile(++$i<$len)\r\n\t\t\t$temp[$obj[$i]->Name]=$obj[$i];\r\n\t\t$keys=array_keys($temp);\r\n\t\tsort($keys);\r\n\t\t$res=Array();\r\n\t\t$i=-1;\r\n\t\twhile(++$i<$len)\r\n\t\t\t$res[]=$temp[$keys[$i]];\r\n\t\treturn $res;\r\n\t}", "function rearrangePro_orderby(){\n\t\t$args = func_get_args();\n\t\t$data = array_shift($args);\n\t\tforeach ($args as $n => $field) {\n\t\t\tif (is_string($field)) {\n\t\t\t\t$tmp = array();\n\t\t\t\tforeach ($data as $key => $row)\n\t\t\t\t\t$tmp[$key] = $row[$field];\n\t\t\t\t$args[$n] = $tmp;\n\t\t\t}\n\t\t}\n\t\t$args[] = &$data;\n\t\tcall_user_func_array('array_multisort', $args);\n\t\treturn array_pop($args);\n\t}", "public function asort()\n {\n }", "public static function natsortField ($array, $fieldname)\r\n\t{\r\n\t\t# Create a function which creates an array of the two values, then compares the original array with a natsorted copy\r\n\t\t$functionCode = '\r\n\t\t\t$original = array ($a[\\'' . $fieldname . '\\'], $b[\\'' . $fieldname . '\\']);\r\n\t\t\t$copy = $original;\r\n\t\t\tnatsort ($copy);\r\n\t\t\treturn ($copy === $original ? -1 : 1);\r\n\t\t';\r\n\t\t\r\n\t\t# Do the comparison\r\n\t\t$natsortFieldFunction = create_function ('$a,$b', $functionCode);\r\n\t\tuasort ($array, $natsortFieldFunction);\r\n\t\t\r\n\t\t# Return the sorted list\r\n\t\treturn $array;\r\n\t}", "function asort(array &$array, $sort_flags = null)\n {\n }", "public function sortStrategy();", "public function sortByMultipleFields(MultiSortParameters ...$param): CollectionInterface;", "function md_multisort($arr, $col, $method = SORT_ASC)\n{\n\tif(!is_array($arr) || empty($arr)) return false;\n\tif($col === null) return $arr;\n\telseif($col == 'name') $tmp = array_keys($arr);\n\telse foreach($arr as $key => $row) $tmp[$key] = @$row[$col];\n\tarray_multisort($tmp, $method, $arr);\n\treturn $arr;\n}", "public function sort(array $paths);", "function Ascending(Array $array, $field) {\n if (is_numeric($array[0][$field])) {\n usort($array, array(new MultiArraySorting($field), 'numberSort'));\n } else {\n usort($array, array(new MultiArraySorting($field), 'textSort'));\n }\n return $array;\n }", "static function sort(array $array, $method = SORT_REGULAR) {\n if (is_int($method)) {\n asort($array, $method);\n } else {\n uasort($array, $method);\n }\n\n return $array;\n }", "public function andThenAscendingBy(string $field): ExtensibleSorting;", "public function sortMeByMultipleFields(MultiSortParameters ...$param): CollectionInterface;", "function awesomeSort($a, $b)\n{\n return $a['amount'] <=> $b['amount'];\n}", "function customcert_perform_asort(&$fields) {\n if (class_exists('core_collator')) {\n core_collator::asort($fields);\n } else {\n collatorlib::asort($fields);\n }\n}", "function sort($array,$by,$type='asc') {\n\t\t$sortField=&$by;\n\t\t$multArray=&$array;\n\t\t\n\t\t$tmpKey='';\n\t\t$ResArray=array();\n\t\t$maIndex=array_keys($multArray);\n\t\t$maSize=count($multArray)-1;\n\t\tfor($i=0; $i < $maSize ; $i++) {\n\t\t\t$minElement=$i;\n\t\t\t$tempMin=$multArray[$maIndex[$i]][$sortField];\n\t\t\t$tmpKey=$maIndex[$i];\n\t\t\tfor ($j=$i+1; $j <= $maSize; $j++) {\n\t\t\t\tif ($multArray[$maIndex[$j]][$sortField] < $tempMin ) {\n\t\t\t\t\t$minElement=$j;\n\t\t\t\t\t$tmpKey=$maIndex[$j];\n\t\t\t\t\t$tempMin=$multArray[$maIndex[$j]][$sortField];\n\t\t \t}\n\t\t\t}\n\t\t\t$maIndex[$minElement]=$maIndex[$i];\n\t\t\t$maIndex[$i]=$tmpKey;\n\t\t}\n\t\tif ($type=='asc') {\n\t\t\tfor ($j=0;$j<=$maSize;$j++) {\n\t\t\t\t$ResArray[$maIndex[$j]]=$multArray[$maIndex[$j]];\n\t\t\t}\n\t\t} else {\n\t\t\tfor ($j=$maSize;$j>=0;$j--) {\n\t\t\t\t$ResArray[$maIndex[$j]]=$multArray[$maIndex[$j]];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $ResArray;\n\t}", "public static function sort($array, $callback = null)\n {\n return Collection::make($array)->sort($callback)->all();\n }", "public static function sortByObjectProperty($property, $sort = 'ASC')\n {\n $supportData = ['property' => $property, 'sort' => $sort];\n return function ($a, $b) use ($supportData) {\n $property = $supportData['property'];\n return ($supportData['sort'] == 'DESC') ?\n strcmp($b->$property, $a->$property) :\n strcmp($a->$property, $b->$property);\n };\n }", "public static function sort($array, callable $callback)\n {\n return Collection::make($array)->sortBy($callback)->all();\n }", "protected function getPropertyOrderings(array $resourceProperties)\n\t{\n\t\t$orderings = [];\n\t\tif ($this->request->hasArgument(static::$SORTING_ARGUMENT_NAME)) {\n\t\t\t$sortColumns = explode(',', $this->request->getArgument(static::$SORTING_ARGUMENT_NAME));\n\t\t\tforeach ($sortColumns as $columnName) {\n\t\t\t\t$order = QueryInterface::ORDER_ASCENDING;\n\t\t\t\tif ($columnName[0] === '-') {\n\t\t\t\t\t$order = QueryInterface::ORDER_DESCENDING;\n\t\t\t\t\t$columnName = substr($columnName, 1);\n\t\t\t\t}\n\t\t\t\tif ($this->isInPersistenceSchema($columnName, $resourceProperties)) {\n\t\t\t\t\t$orderings[$columnName] = $order;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $orderings;\n\t}", "public function sortResults(array $results, $order = 'ASC');", "protected function applySorting()\n\t{\n\t\t$i = 1;\n\t\tparse_str($this->order, $list);\n\t\tforeach ($list as $field => $dir) {\n\t\t\t$this->dataSource->sort($field, $dir === 'a' ? IDataSource::ASCENDING : IDataSource::DESCENDING);\n\t\t\t$list[$field] = array($dir, $i++);\n\t\t}\n\t\treturn $list;\n\t}", "public final function manualSort(){\r\n\t\t$itemid=$this->itemid;\r\n\t\t$position=$this->sortarray;\r\n\t\t$newarray=array();\r\n\t\t$max=-1;\r\n\t\tforeach($this->sorteddata as $pmid){\r\n\t\t\t$i=$itemid[$pmid];\r\n\t\t\tif (!isset($position[$i])) continue;\r\n\t\t\t$newarray[$position[$i]]=$pmid;\r\n\t\t\tif ($max<$position[$i]) $max=$position[$i];\r\n\t\t}\r\n\t\tforeach($this->sorteddata as $pmid){\r\n\t\t\t$i=$itemid[$pmid];\r\n\t\t\tif (!isset($position[$i])) $newarray[++$max]=$pmid;\r\n\t\t}\r\n\t\t$this->sorteddata=$newarray;\r\n\t}", "public function setSorting($arrSorting);", "public function SortMeetingObjects(\n $in_sort_fields_array = null,\n // An array of strings. The array will deliniate the sort order, by field name.\n // Array element [0] will be the highest priority, and it will descend from there.\n $in_desc = null ///< If this is set to true, the sort will be highest to lowest. Default is false.\n ) {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n // Only the root can do this.\n if (null == $this->_my_root) {\n if (null != $this->_search_results) {\n if (null != $in_sort_fields_array) {\n $this->sort_array = $in_sort_fields_array;\n } else {\n $in_sort_fields_array = $this->sort_array;\n }\n \n if (null != $in_desc) {\n $this->sort_desc = $in_desc;\n } else {\n $in_desc = $this->sort_desc;\n }\n \n if (is_array($in_sort_fields_array) && count($in_sort_fields_array)) {\n // This is simply a \"pass-through\" to the object we have on hand.\n $this->_search_results->SortMeetingObjects($in_sort_fields_array, $in_desc, $this->_sort_search_by_distance);\n }\n }\n }\n }", "public function andThenDescendingBy(string $field): ExtensibleSorting;", "function sort_array($array, $key)\n {\n foreach ($array as $temp_list) {\n $sort_aux[] = ($temp_list[$key]);\n }\n array_multisort($sort_aux, SORT_ASC, $array);\n\n return $array;\n }", "function krsort(array &$array, $sort_flags = null)\n {\n }", "public function sortArraysByKeyCheckIfSortingIsCorrectDataProvider() {}", "function sortByItem($channel) \n{\n foreach ($channel['item'] as $item) {\n\n // Make an array of an object\n $arrayOfItems = (array) $item;\n\n // Push title properties into new array.\n $arr[] = $arrayOfItems['title'];\n\n // Make comparison, sort if true\n usort($arr, 'compare');\n }\n\n $json = json_encode($arr, JSON_PRETTY_PRINT);\n return $json;\n}", "public static function sortInnerValues(&$arr, $sortFn = 'sort') {\n foreach ($arr as $key => $item) {\n $sortFn($arr[$key]);\n }\n }", "public function sort($by)\n {\n $by = ucfirst($by);\n $array = $this->queryResult->getRecords();\n usort($array, function($a, $b) use ($by) {\n // These two ifs take care of moving empty values to the end of the\n // array instead of the beginning\n if (!isset($a->$by) || !$a->$by) {\n return 1;\n }\n\n if (!isset($b->$by) || !$b->$by) {\n return -1;\n }\n\n return strcmp($a->$by, $b->$by);\n });\n\n return new \\ArrayIterator($array);\n }", "private function sortFiles(&$array){\n if(isset($array['files'])) sort($array['files']);\n if(isset($array['images'])) sort($array['images']);\n }", "public function testSortBy() {\n\t\t$array = array(2, 5, 3, 1, 4);\n\t\t$result = _::sortBy($array);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(2, $result[1]);\n\t\t$this->assertEquals(3, $result[2]);\n\t\t$this->assertEquals(4, $result[3]);\n\t\t$this->assertEquals(5, $result[4]);\n\n\t\t// test sorting an array with an iterator\n\t\t$result = _::sortBy($array, function($left, $right) {\n\t\t\treturn (($left == $right) ? 0 : (($left > $right) ? -1 : 1));\n\t\t});\n\t\t$this->assertEquals(5, $result[0]);\n\t\t$this->assertEquals(4, $result[1]);\n\t\t$this->assertEquals(3, $result[2]);\n\t\t$this->assertEquals(2, $result[3]);\n\t\t$this->assertEquals(1, $result[4]);\n\n\t\t// test sorting an object without a value function\n\t\t$arrayObj = new ArrayObject($array);\n\t\ttry {\n\t\t\t$result = _::sortBy($arrayObj);\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertInstanceOf('InvalidArgumentException', $e);\n\t\t}\n\n\t\t// test sorting an object with a value function\n\t\t$result = _::sortBy($arrayObj, function($value) {\n\t\t\treturn (5 - $value);\n\t\t});\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(5, $result);\n\t\t$this->assertEquals(5, $result[0]);\n\t\t$this->assertEquals(4, $result[1]);\n\t\t$this->assertEquals(3, $result[2]);\n\t\t$this->assertEquals(2, $result[3]);\n\t\t$this->assertEquals(1, $result[4]);\n\t}", "public static function sortByField($array, $sort)\n {\n $old_index = null;\n $total = sizeof($array);\n\n $noIndex = true;\n\n foreach($array as $value) {\n if(isset($value[$sort['field']])) {\n $noIndex = false;\n break;\n }\n }\n\n if($noIndex) {\n throw new \\Exception('sort-field can only be set to a field that exists in the locations return of the JSON');\n }\n\n // TODO: implement this as a foreach instead of a for loop.\n for($index = 0; $index < $total; $index++) {\n $value = $array[$index];\n\n if(!isset($array[$index - 1])) {\n continue;\n }\n\n switch($sort['direction']) {\n case 'asc':\n if($array[$index - 1][$sort['field']] > $array[$index][$sort['field']]) {\n $temp = $array[$index - 1];\n $array[$index - 1] = $array[$index];\n $array[$index] = $temp;\n\n $index = -1;\n }\n break;\n case 'desc':\n if($array[$index - 1][$sort['field']] < $array[$index][$sort['field']]) {\n $temp = $array[$index - 1];\n $array[$index - 1] = $array[$index];\n $array[$index] = $temp;\n\n $index = -1;\n }\n break;\n }\n }\n\n return $array;\n }", "public function getSorting();", "function facebook_instant_articles_sort_fields(array $a, $subkey) {\n foreach ($a as $k => $v) {\n if (isset($v[$subkey])) {\n $b[$k] = $v[$subkey];\n }\n }\n asort($b);\n foreach ($b as $key => $val) {\n $c[$key] = $a[$key];\n }\n return $c;\n}", "protected function sort()\n {\n // if no comparator is passed sort the internal array\n // by its keys, else use the comparator\n if ($this->comparator == null) {\n return ksort($this->items);\n } else {\n return CollectionUtils::sort($this, $this->comparator);\n }\n }", "function arsort(array &$array, $sort_flags = null)\n {\n }", "function sorted(array $array, callable|int $func = null, int $flags = 0, bool $assoc = null, bool $key = false): array\n{\n if ($key) {\n return Arrays::sortKey($array, $func, $flags);\n }\n return Arrays::sort($array, $func, $flags, $assoc);\n}", "function fn_sort_md_array_by_value(&$array, $key)\n{\n\t//ref. http://stackoverflow.com/questions/2699086/sort-multi-dimensional-array-by-value\n $sorter=array();\n $ret=array();\n reset($array);\n foreach ($array as $ii => $va) {\n $sorter[$ii]=$va[$key];\n }\n asort($sorter);\n foreach ($sorter as $ii => $va) {\n $ret[$ii]=$array[$ii];\n }\n $array=$ret;\n}", "function sort_by_sub_element($array,$element){\n\tforeach($array as $id => $sub_array){\n\t\tif(is_object($sub_array)) $sub_array = get_object_vars($sub_array);\n\t\t$sorting_array[$id]=$sub_array[$element];\n\t}\n\tasort($sorting_array);\n\t$sorting_array = array_reverse($sorting_array, true);\n\t\n\tforeach ($sorting_array as $id=>$next_post){\n\t\t$sorted_posts[] = $array[$id];\n\t}\n\t\n\t$sorted_posts = array_reverse($sorted_posts);\n\treturn $sorted_posts;\n\t\n}", "public function sort(array $array)\n {\n sort($array);\n $count = 0;\n foreach ($array as $key => $valor)\n {\n $arrayOrderecha[$key] = $valor;\n $count ++;\n }\n //retorno del resultado a la vista\n return $arrayOrderecha;\n }", "public function getSortBy();", "public function sort(array $nodes);", "public static function sort(array &$arr)\n {\n uasort($arr, '\\undpaul\\MarioKartBundle\\Entity\\RankingRow::sortCallback');\n }", "public function sortByArray(array $sorting) {\n\t\ttx_pttools_assert::isValidUidArray($sorting, false, array('message' => 'Given sorting array is invalid'));\n\t\t$uids = $this->extractProperty('uid');\n\t\ttx_pttools_assert::isValidUidArray($uids, false, array('message' => 'Retrieved uids are invalid'));\n\t\t\n\t\t$sortingUids = $sorting;\n\t\t\n\t\tsort($sortingUids);\n\t\tsort($uids);\n\t\t\n\t\ttx_pttools_assert::isEqual($sortingUids, $uids, array('message' => 'Sorting array did not contain the same elements as the collection.'));\n\t\t\n\t\tforeach ($sorting as $key => $uid) {\n\t\t\t$this->getItemByProperty('uid', $uid)->set_sorting(pow(2, $key));\n\t\t}\n\t}", "static function sortasc_old($data, $fieldname)\n {\n $len1 = count($data);\n $len2 = $len1;\n for ($i = 0; $i < $len1; $i++)\n {\n for ($j = $i+1; $j < $len2-1; $j++)\n {\n if ($data[$i][$fieldname] > $data[$j][$fieldname])\n {\n $tmp = $data[$i];\n $data[$i] = $data[$j];\n $data[$j] = $tmp;\n }\n }\n }\n \n return $data;\n }", "static protected function _prepareSort(array $ticket)\n {\n $by = self::sortBy();\n $ticket['sort_by'] = array();\n if (is_array($by)) {\n foreach ($by as $field) {\n if (!isset($ticket[$field])) {\n $ticket['sort_by'][$field] = '';\n } else {\n $ticket['sort_by'][$field] = Horde_String::lower($ticket[$field], true, 'UTF-8');\n }\n }\n } else {\n if (!isset($ticket[$by])) {\n $ticket['sort_by'][$by] = '';\n } elseif (is_array($ticket[$by])) {\n natcasesort($ticket[$by]);\n $ticket['sort_by'][$by] = implode('', $ticket[$by]);\n } else {\n $ticket['sort_by'][$by] = Horde_String::lower($ticket[$by], true, 'UTF-8');\n }\n }\n return $ticket;\n }", "public function it_sorts_by_field_in_ascending_order(): void\n {\n $results = Client::filter([\n 'sorts' => [\n [\n 'column' => 'name',\n 'direction' => 'asc',\n ],\n ],\n ])->get();\n\n self::assertEquals($results->sortBy('name')->pluck('id'), $results->pluck('id'));\n }", "function sort ($block,$field,$dir = \"\") {\n\t\t$sort = [];\n\n\t\tforeach ($this->data as $event) {\n\t\t\t$sortval = $event->get($block,$field);\n\n\t\t\tif (is_array ($sortval))\n\t\t\t\t$sortval = $sortval[0];\n\n\t\t\t$sort[$sortval] = $event;\n\t\t}\n\n\t\t# choose sort direction\n\t\tif (strtoupper($dir) == \"DESC\")\n\t\t\tkrsort ($sort);\n\t\telse\n\t\t\tksort($sort);\n\n\t\t$this->data = $sort;\n\t}", "abstract public function prepareSort();", "function sort_array_by_array($array, $keyname_array)\n\t{\n\t$result = array();\n\tforeach($keyname_array as $key)\n\t\t{\n\t\t$result[$key] = $array[$key];\n\t\t}\n\treturn $result;\n\t}", "public function sort()\n {\n $this->repository->sort(Input::all());\n }", "private static function sort()\n\t{\n\t\t//Setup order of importantance\n\t\t$changefreqs = array(\n\t\t\t'hourly' => 5,\n\t\t\t'daily' => 4,\n\t\t\t'weekly' => 3,\n\t\t\t'monthly' => 2,\n\t\t\t'yearly' => 1,\n\t\t\t'never' => 0\n\t\t);\n\n\t\t//Setup invidual arrays to sort by\n\t\tforeach(static::$links as $index => $link)\n\t\t{\n\t\t\t$priority[$index] = $link->priority ? $link->priority : 0;\n\t\t\t$changefreq[$index] = $link->changefreq ? $changefreqs[$link->changefreq] : 0;\n\t\t\t$loc[$index] = $link->loc;\n\t\t}\n\n\t\tarray_multisort($priority, SORT_DESC, $changefreq, SORT_DESC, $loc, SORT_ASC, static::$links);\n\t}", "protected function sort(array $data)\n {\n usort($data, function (array $a, array $b) {\n return $this->getSortOrder($a) <=> $this->getSortOrder($b);\n });\n\n return $data;\n }", "public function &getOrderBy();", "public function testSort()\n {\n $obj_query = new \\Search\\Query();\n $this->assertEmpty($obj_query->getSorts());\n $obj_query->sort('a', 'b');\n $this->assertEquals([['a', 'b']], $obj_query->getSorts());\n $obj_query2 = $obj_query->sort('c', 'd');\n $this->assertEquals([['a', 'b'],['c', 'd']], $obj_query->getSorts());\n $this->assertSame($obj_query, $obj_query2);\n }", "function sortLowToHigh($a, $b)\n{\n return $a->price < $b->price ? -1 : 1; //Compare the prices, evalutes to true\n // return $a->price > $b->price ? 1 : -1; // Gives the same result\n}", "function _wp_object_name_sort_cb($a, $b)\n {\n }", "public function sortByProperty($property, $sort)\n {\n // Comparison variables\n $name = $property->getName();\n $type = $property->getNativeType();\n $sort = ($sort === 'asc');\n\n // Custom comparison\n usort($this->list, function(Record $a, Record $b) use ($name, $type, $sort)\n {\n $v1 = $sort ? $a->getData($name) : $b->getData($name);\n $v2 = $sort ? $b->getData($name) : $a->getData($name);\n\n // Compare as numbers\n if ($type === 'int')\n return $v1 - $v2;\n\n // Compare as strings\n return strcasecmp($v1, $v2);\n });\n }", "public function sortItems($items, $sort_by)\n {\n \n switch($sort_by)\n {\n case 'popular':\n $items = $items->sortBy(function($item){\n return $item->orders->count();\n }, null, true);\n break;\n\n case 'price-high-low':\n $items = $items->sortBy(function($item){\n return $item->itemable->discount_price;\n }, null, true);\n break;\n\n case 'recommended' :\n $items = $items->sortBy(function($item){\n return $item->is_recommended;\n }, null, true);\n break;\n\n case 'price-low-high':\n $items = $items->sortBy(function($item){\n return $item->itemable->discount_price;\n }, null, false);\n break;\n\n default:\n $items = $items->sortBy(function($item){\n return $item->itemable->weight;\n }, null, true);\n break;\n }\n\n return $items;\n }", "function sort_array_by_other_array($arr, $keys_arr, $num_field) {\n\t$new_arr = array();\n\t$left_arr = $arr;\n\t\n\tforeach($keys_arr as $key=>$value) {\n\t\tforeach($arr as $key2=>$value2) {\n\t\t\tif($value2[$num_field] == $value) {\n\t\t\t\t$new_arr[] = $value2;\n\t\t\t\tunset($left_arr[$key2]);\n\t\t\t}\t\n\t\t}\n\t}\t\n\t$new_arr = array_merge($new_arr, $left_arr);\n\treturn $new_arr;\n}", "function record_sort($records, $field, $reverse=false){\n\n $hash = array();\n \n foreach($records as $key => $record){\n $hash[$record[$field].$key] = $record;\n }\n \n ($reverse)? krsort($hash) : ksort($hash);\n \n $records = array();\n \n foreach($hash as $record){\n $records []= $record;\n }\n \n return $records;\n}", "public static function knatsort ($array)\r\n\t{\r\n\t\t$keys = array_keys ($array);\r\n\t\tnatsort ($keys);\r\n\t\t$items = array ();\r\n\t\tforeach ($keys as $key) {\r\n\t\t\t$items[$key] = $array[$key];\r\n\t\t}\r\n\t\t\r\n\t\t# Return the sorted list\r\n\t\treturn $items;\r\n\t}", "protected function _order($unsortedArray, $sortField, $sortWay = 'SORT_ASC')\n {\n $sortedArray = array();\n foreach ($unsortedArray as $uniqid => $row) {\n foreach ($this->getAttributes() as $attr) {\n if (isset($row[$attr])) {\n $sortedArray[$attr][$uniqid] = $unsortedArray[$uniqid][$attr];\n } else {\n $sortedArray[$attr][$uniqid] = null;\n }\n }\n }\n if ($sortWay) {\n array_multisort($sortedArray[$sortField], constant($sortWay), $unsortedArray);\n }\n return $unsortedArray;\n }", "function sort_array_of_arrays( $array, $sort_by_key ) {\n\n usort( $array, function ( $item1, $item2 ) use ( $sort_by_key ) {\n\n if ($item1[ $sort_by_key ] == $item2[ $sort_by_key ]) return 0;\n return $item1[ $sort_by_key ] < $item2[ $sort_by_key ] ? -1 : 1;\n\n });\n\n return $array;\n\n}", "public function doCustomSort($objects, $searchRecord)\n {\n if ($objects->count() < 2) {\n //do nothing\n } else {\n $objects = $this->makeClassGroups($objects);\n }\n\n return $objects;\n }", "function cmp_by_name($val1, $val2){\n return strcmp($val1->name, $val2->name);\n}", "function usort(/*. array[int] .*/ $a, /*. mixed .*/ $cmp_func)\n{}", "function sort(/*. array[int] .*/ $a, $sort_flags = SORT_REGULAR){}" ]
[ "0.74469507", "0.70988613", "0.69171304", "0.6845156", "0.6765783", "0.64983946", "0.64234835", "0.6415525", "0.6328104", "0.63248456", "0.6224221", "0.61687917", "0.61304015", "0.6087654", "0.602138", "0.5955248", "0.594134", "0.59401274", "0.5938257", "0.5914599", "0.5899347", "0.5898771", "0.5865456", "0.58401376", "0.5797734", "0.5795832", "0.5778795", "0.5778795", "0.5767168", "0.57532185", "0.5744263", "0.5742996", "0.57404125", "0.5719369", "0.56818813", "0.5674672", "0.5655173", "0.562446", "0.5623728", "0.56192243", "0.56021994", "0.5593194", "0.5592086", "0.5584005", "0.55575985", "0.5548725", "0.5510334", "0.548179", "0.54805166", "0.54739994", "0.54653853", "0.5450258", "0.543812", "0.5435265", "0.543094", "0.54294914", "0.5426258", "0.5415786", "0.5411414", "0.5404957", "0.54016185", "0.5398833", "0.5397146", "0.53963786", "0.5392188", "0.53908294", "0.53856814", "0.5377865", "0.53750485", "0.5374474", "0.5374041", "0.5370164", "0.53696364", "0.53544295", "0.53398895", "0.5327473", "0.5317287", "0.5316715", "0.5313906", "0.5308625", "0.5299691", "0.52819633", "0.5272149", "0.52679604", "0.52675605", "0.5254122", "0.5254061", "0.52310455", "0.52276117", "0.5222979", "0.52209157", "0.52204823", "0.5210935", "0.5210811", "0.5209782", "0.52096933", "0.5208715", "0.52076155", "0.5207301", "0.52036685" ]
0.7859561
0
Trim a sentence after a given number of chars and at the end of a word
function lineTrim($line, $length, $trim_suffix = "...", &$clipping_occured = false) { $tmpstr = wordwrap ( trim($line), $length , '%%%%!#!%%%%'); $lines = explode("%%%%!#!%%%%", $tmpstr, 2); $ret = $lines[0]; if ($clipping_occured = (count($lines) > 1)) { $ret .= $trim_suffix; } return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function flawless_word_trim( $string, $count, $ellipsis = false ) {\r\n\r\n if ( strlen( $string ) < $count ) {\r\n return $string;\r\n }\r\n\r\n $truncated = preg_replace( '/\\s+?( \\S+ )?$/', '', substr( $string, 0, $ellipsis ? $count + 3 : $count ) );\r\n\r\n if ( strlen( $string ) > strlen( $truncated ) && $ellipsis ) {\r\n $truncated .= '...';\r\n }\r\n\r\n return $truncated;\r\n\r\n }", "function trim_string_by( $count, $string ) {\n\treturn ( absint( $count ) <= str_word_count( $string ) ) ?\n\t\twp_trim_words( $string, absint( $count ), '&hellip;' ) :\n\t\t\t$string;\n}", "function trimText($input, $length) {\n // If the text is already shorter than the max length, then just return unedited text.\n if (strlen($input) <= $length) {\n return $input;\n }\n // Find the last space (between words we're assuming) after the max length.\n $last_space = strrpos(substr($input, 0, $length), ' ');\n // Trim\n $trimmedText = substr($input, 0, $last_space);\n // Add ellipsis.\n $trimmedText .= '...';\n return $trimmedText;\n}", "function limit_words($string,$word_count)\n{\n if (strlen($string) > $word_count) {\n\n // truncate string\n $stringCut = substr($string, 0, $word_count);\n\n // make sure it ends in a word so assassinate doesn't become ass...\n $string = substr($stringCut, 0, strrpos($stringCut, ' ')).'';\n }\n return $string;\n}", "function truncateWords($input, $numwords, $padding=\"\")\r\n{\r\n $output = strtok($input, \" \\n\");\r\n while(--$numwords > 0) $output .= \" \" . strtok(\" \\n\");\r\n if($output != $input) $output .= $padding;\r\n return $output;\r\n}", "function shapeSpace_truncate_string($phrase, $max_words) {\n\t\n\t$phrase_array = explode(' ', $phrase);\n\t\n\tif (count($phrase_array) > $max_words && $max_words > 0) \n\t\t$phrase = implode(' ', array_slice($phrase_array, 0, $max_words)) . __('...', 'shapespace');\n\t\n\treturn $phrase;\n\t\n}", "function my_string_limit_words($string, $word_limit)\r\n{\r\n $words = explode(' ', $string, ($word_limit + 1));\r\n if(count($words) > $word_limit)\r\n array_pop($words);\r\n return implode(' ', $words).'... ';\r\n}", "function trim_excerpt($text) { return rtrim($text,'[...]'); }", "function wp_trim_words($text, $num_words = 55, $more = \\null)\n {\n }", "function trimWordLen($str, $max) {\n $str = cleanSpaces($str);\n $lines = explode(\"\\n\", $str);\n $ss = \"\";\n foreach ($lines as $i => $line) {\n $words = explode(\" \", $line);\n foreach ($words as $j => $w)\n $ss.=trimWord($w, $max) . \" \";\n $ss.=\"\\n\";\n }\n return cleanSpaces($ss);\n}", "function trim_excerpt_to_word($string, $limit, $break = \".\", $pad = \"...\") { \n\tif (strlen($string) <= $limit) return $string;\n\tif (false !== ($max = strpos($string, $break, $limit))) {\n\t\tif ($max < strlen($string) - 1) {\n\t\t\t$string = substr($string, 0, $max) . $pad;\n\t\t}\n\t}\n\treturn $string;\n}", "function limit_words($string, $word_limit)\n{\n $words = explode(\" \", $string);\n return implode(\" \", array_splice($words, 0, $word_limit));\n}", "function neat_trim($string, $max_length, $append = '')\n{\n if (strlen($string) > $max_length) {\n $string = substr($string, 0, $max_length);\n $pos = strrpos($string, ' ');\n if ($pos === false) {\n return substr($string, 0, $max_length) . $append;\n }\n return substr($string, 0, $pos) . $append;\n }\n else {\n return $string;\n }\n}", "function limit_words( $str, $num, $append_str='' )\n{\n $words = preg_split( '/[\\s]+/', $str, -1, PREG_SPLIT_OFFSET_CAPTURE );\n if( isset($words[$num][1]) )\n {\n $str = substr( $str, 0, $words[$num][1] ) . $append_str;\n }\n unset( $words, $num );\n return trim( $str );\n}", "function shortText($text, $chars =150){\n $text = $text.\" \";\n $text = substr($text,0,$chars);\n $text = substr($text,0,strrpos($text,' '));\n return $text;\n}", "function cjpopups_trim_text($str, $cut = 200, $after_trim = ''){\n $str_length = strlen($str);\n if($str_length > $cut){\n \treturn substr($str, 0, $cut). $after_trim;\n }else{\n \treturn $str;\n }\n}", "protected function trimRep($word)\n {\n $lastChar = null;\n $cleanWord = null;\n $max = mb_strlen($word, 'UTF-8');\n\n for ($i = 0; $i < $max; $i++) {\n $char = mb_substr($word, $i, 1, 'UTF-8');\n if ($char != $lastChar) {\n $cleanWord .= $char;\n }\n $lastChar = $char;\n }\n\n return $cleanWord;\n }", "function cah_news_excerpt($text) {\r\n return wp_trim_words($text, 50, '...');\r\n}", "function atSubstrwords($text, $maxchar, $end = '...')\n{\n if (strlen($text) > $maxchar || $text == '') {\n $words = preg_split('/\\s/', $text);\n $output = '';\n $i = 0;\n while (1) {\n $length = strlen($output) + strlen($words[$i]);\n if ($length > $maxchar) {\n break;\n } else {\n $output .= \" \" . $words[$i];\n ++$i;\n }\n }\n $output .= $end;\n } else {\n $output = $text;\n }\n return $output;\n}", "function string_limit_words($string, $word_limit)\r\n{ \r\n $words = explode(' ', $string, ($word_limit + 1));\r\n if(count($words) > $word_limit)\r\n array_pop($words);\r\n $wd =implode(' ', $words);\r\n return $wd;\r\n}", "function paragraph_trim($content, $limit = 500, $schr=\"\\n\", $scnt=2)\n{\n $post = 0;\n $trimmed = false;\n for($i = 1; $i <= $scnt; $i++) {\n\n if($tmp = strpos($content, $schr, $post+1)) {\n $post = $tmp;\n $trimmed = true;\n } else {\n $post = strlen($content) - 1;\n $trimmed = false;\n break;\n }\n\n }\n\n $content = substr($content, 0, $post);\n\n if(strlen($content) > $limit) {\n $content = substr($content, 0, $limit);\n $content = substr($content, 0, strrpos($content,' '));\n $trimmed = true;\n }\n\n if($trimmed) $content .= '...';\n\n return $content;\n\n}", "private function trimStringToFullWord( $string, $maxLength, $trimAtEnd = true ) {\n\t\tif ( mb_strlen( $string ) <= $maxLength ) {\n\t\t\treturn $string;\n\t\t}\n\n\t\tif ( $trimAtEnd ) {\n\t\t\t$result = preg_replace(\n\t\t\t\t'/[' . self::WHITESPACES . ']+?[^' . self::WHITESPACES . ']+?$/u',\n\t\t\t\t'',\n\t\t\t\tmb_substr( $string, 0, $maxLength )\n\t\t\t);\n\n\t\t} else {\n\t\t\t$result = preg_replace(\n\t\t\t\t'/^[^' . self::WHITESPACES . ']+?[' . self::WHITESPACES . ']+?/u',\n\t\t\t\t'',\n\t\t\t\tmb_substr( $string, -$maxLength ),\n\t\t\t\t1\n\t\t\t);\n\t\t}\n\n\t\treturn $this->trimWhiteSpaces( $result, $trimAtEnd );\n\t}", "function trim_characters ($text, $start, $length) {\n\t// Pass it a string, a numeric start position and a numeric length.\n\t// If the start position is > 0, the string will be trimmed to start at the\n\t// nearest word boundary after (or at) that position.\n\t// If the string is then longer than $length, it will be trimmed to the nearest\n\t// word boundary below (or at) that length.\n\t// If either end is trimmed, ellipses will be added.\n\t// The modified string is then returned - its *maximum* length is $length.\n\t// HTML is always stripped (must be for trimming to prevent broken tags).\n\n\t$text = strip_tags($text);\n\n\t// Trim start.\n\tif ($start > 0) {\n\t\t$text = substr($text, $start);\n\t\t\n\t\t// Word boundary. \n\t\tif (preg_match (\"/.+?\\b(.*)/\", $text, $matches)) {\n\t\t\t$text = $matches[1];\n\t\t\t// Strip spare space at the start.\n\t\t\t$text = preg_replace (\"/^\\s/\", '', $text);\n\t\t}\n\t\t$text = '...' . $text;\n\t}\n\t\n\t// Trim end.\n\tif (strlen($text) > $length) {\n\n\t\t// Allow space for ellipsis.\n\t\t$text = substr($text, 0, $length - 3); \n\n\t\t// Word boundary. \n\t\tif (preg_match (\"/(.*)\\b.+/\", $text, $matches)) {\n\t\t\t$text = $matches[1];\n\t\t\t// Strip spare space at the end.\n\t\t\t$text = preg_replace (\"/\\s$/\", '', $text);\n\t\t}\n\t\t// We don't want to use the HTML entity for an ellipsis (&#8230;), because then \n\t\t// it screws up when we subsequently use htmlentities() to print the returned\n\t\t// string!\n\t\t$text .= '...'; \n\t}\n\t\n\treturn $text;\n}", "function string_limit_words($string, $word_limit)\n{\n $words = explode(' ', $string, ($word_limit + 1));\n if(count($words) > $word_limit)\n array_pop($words);\n return implode(' ', $words);\n}", "function octavo_trim_excerpt($return = '') {\n\t\n\t# Use `1` to finish sentence, otherwise use `0`.\n\t$finish_sentence = 1;\n\t# Tags to allow in the excerpt:\n\t$allowed_tags = '<a><strong><b><em><i>';\n\t\n\tif ($return == '') {\n\t\t\n\t\t# Setup text:\n\t\t$text = $return;\n\t\t# Get the full content:\n\t\t$text = get_the_content('');\n\t\t# Delete all shortcode tags from the content:\n\t\t$text = strip_shortcodes($text);\n\t\t# Filter it:\n\t\t$text = apply_filters('the_content', $text);\n\t\t# From the default wp_trim_excerpt():\n\t\t$text = str_replace(']]>', ']]&gt;', $text); // Some kind of precaution against malformed CDATA in RSS feeds I suppose.\n\t\t# Remove script tags:\n\t\t$text = preg_replace('@<script[^>]*?>.*?</script>@si', '', $text);\n\t\t# Allowed tags?\n\t\t$text = strip_tags($text, $allowed_tags);\n\t\t\n\t\t# Word length (depends on setting above).\n\t\t$excerpt_length = apply_filters('excerpt_length', 55); // Defaults to `55` words.\n\t\t\n\t\t# Divide the string into tokens; HTML tags, or words, followed by any whitespace:\n\t\t$tokens = array();\n\t\tpreg_match_all('/(<[^>]+>|[^<>\\s]+)\\s*/u', $text, $tokens);\n\t\t\n\t\t# Itterate over word tokens:\n\t\t$word = 0;\n\t\tforeach ($tokens[0] as $token) {\n\t\t\t\n\t\t\t# Parse each token:\n\t\t\tif (($word >= $excerpt_length) && ( ! $finish_sentence)) {\n\t\t\t\t\n\t\t\t\t# Limit reached:\n\t\t\t\tbreak; // Quit the loop.\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t# Is token a tag?\n\t\t\tif ($token[0] != '<') {\n\t\t\t\t\n\t\t\t\t# Check for the end of the sentence: '.', '?' or '!':\n\t\t\t\tif (($word >= $excerpt_length) && $finish_sentence && (preg_match('/[\\?\\.\\!]\\s*$/uS', $token) == 1)) {\n\t\t\t\t\t\n\t\t\t\t\t# Limit reached!\n\t\t\t\t\t$return .= trim($token); // Continue until '?' '.' or '!' occur to reach the end of the sentence.\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t# Add `1` to $word:\n\t\t\t\t$word++;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t# Append what's left of the token:\n\t\t\t$return .= $token;\n\t\t\t\n\t\t}\n\t\t\n\t\t# Add the excerpt suffix:\n\t\t$return .= apply_filters('excerpt_more', ' &hellip;');\n\t\t\n\t\t# Balances tags:\n\t\t$return = force_balance_tags($return);\n\t\t\n\t\t# Trim:\n\t\t$return = trim($return);\n\t\t\n\t}\n\t\n\t# Return the excerpt:\n\treturn $return;\n\t\n}", "function truncate($input,$maxChars,$maxWords=0,$more='...'){\r\n\t//Make sure the input is not just spaces\r\n\tif ((trim($input) != \"\")){\r\n\t\t//split all the words in the input text by using space\r\n\t\t$words = preg_split('/\\s+/', $input);\r\n\r\n\t\t//Check if the maximum words is greater than 0\r\n\t\tif ($maxWords > 0)\r\n\t\t$words = array_slice($words, 0, $maxWords);\r\n\r\n\r\n\t\t$words = array_reverse($words);\r\n\r\n\t\t$chars = 0;\r\n\t\t$truncated = array();\r\n\r\n\t\twhile(count($words) > 0)\r\n\t\t{\r\n\t\t $fragment = trim(array_pop($words));\r\n\t\t $chars += strlen($fragment);\r\n\r\n\t\t if($chars > $maxChars) break;\r\n\r\n\t\t $truncated[] = $fragment;\r\n\t\t}\r\n\r\n\t\t$result = implode($truncated, ' ');\r\n\r\n\t\tif (($result == \"\") || ($maxWords == 0)){\r\n\t\t\treturn substr($input, 0,$maxChars).$more;\r\n\t\t}\r\n\r\n\t\treturn $result . ($input == $result ? '' : $more);\r\n\t}\r\n\r\n}", "function limitWords($input_text, $limit = 50, $end_str = '...')\n{\n $input_text = strip_tags($input_text);\n $words = explode(' ', $input_text);\n if ($limit < 1 || sizeof($words) <= $limit) {\n return $input_text;\n }\n $words = array_slice($words, 0, $limit);\n $out = implode(' ', $words);\n return $out . $end_str;\n}", "function ts_get_shortened_string($text,$word_limit)\r\n{\r\n\t$words = explode(' ', $text, ($word_limit + 1));\r\n\tif(count($words) > $word_limit)\r\n\t{\r\n\t\tarray_pop($words);\r\n\t\treturn implode(' ', $words).\"...\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn implode(' ', $words);\r\n\t}\r\n}", "public function trim($string, $length = null, $suffix = '...') {\n if($length === null) {\n $length = $this->defaultTrimLenth;\n }\n $plain = strip_tags($string);\n $converted = html_entity_decode($plain, ENT_COMPAT | ENT_HTML401, 'UTF-8');\n $trimmed = preg_replace(\"/(^\\s+)|(\\s+$)/u\", \"\", $converted);\n // \\xA0 is the result of converting nbsp. Requires the /u flag.\n $normalized = preg_replace(\"/[[:space:]\\x{A0}]/su\", \" \", $trimmed);\n $words = preg_split('/\\s+/u', $normalized, $length+1, PREG_SPLIT_NO_EMPTY);\n\n if(count($words) <= $length) {\n return implode(' ', $words);\n }\n return implode(' ', array_slice($words, 0, $length)) . $suffix;\n }", "function trim_text($input, $length, $ellipses = true, $strip_html = true) {\n\t\tif ($strip_html) {\n\t\t $input = strip_tags($input);\n\t\t}\n\t \n\t\t//no need to trim, already shorter than trim length\n\t\tif (strlen($input) <= $length) {\n\t\t return $input;\n\t\t}\n\t \n\t\t//find last space within length\n\t\t$last_space = strrpos(substr($input, 0, $length), ' ');\n\t\t$trimmed_text = substr($input, 0, $last_space);\n\t \n\t\t//add ellipses (...)\n\t\tif ($ellipses) {\n\t\t $trimmed_text .= '...';\n\t\t}\n\t \n\t\treturn $trimmed_text;\n\t}", "protected function trimFirstLast($strWord)\n\t{\n\t\t$trimmedString = $strWord;\n\t\t$wordSize = strlen($trimmedString);\n\n\t\t/* only process if word is more than 4 characters long */\n\t\tif ($wordSize >= 4)\n\t\t{\n\t\t\t/* check first character */\n\t\t\t$firstType = $this->getCharType(substr($trimmedString, 0, 1));\n\t\t\t$secondType = $this->getCharType(substr($trimmedString, 1, 1));\n\t\t\t/* trim, if first and second chars are of different type */\n\t\t\tif ($firstType != $secondType)\n\t\t\t\t$trimmedString = substr($trimmedString, 1, $wordSize--);\n\n\t\t\t/* check last character */\n\t\t\t$lastTwoChars = substr($trimmedString, -2);\n\t\t\t$lastType = $this->getCharType(substr($lastTwoChars, -1));\n\t\t\t$secondToLastType = $this->getCharType(substr($lastTwoChars, 0, 1));\n\t\t\t/* trim, if last and second to last chars are of different type */\n\t\t\tif ($lastType != $secondToLastType)\n\t\t\t\t$trimmedString = substr($trimmedString, 0, -1);\n\n\t\t}\n\t\t\n\t\treturn $trimmedString;\n\t}", "function trim_text($input, $length = 100, $ellipses = true, $strip_html = true)\n{\n //strip tags, if desired\n if ($strip_html) {\n $input = strip_tags($input);\n }\n\n //no need to trim, already shorter than trim length\n if (strlen($input) <= $length) {\n return $input;\n }\n\n //find last space within length\n $last_space = strrpos(substr($input, 0, $length), ' ');\n $trimmed_text = substr($input, 0, $last_space);\n\n //add ellipses (...)\n if ($ellipses) {\n $trimmed_text .= '...';\n }\n\n return $trimmed_text;\n}", "public static function trim_excerpt($text) {\n\t\tif ( '' == $text ) {\n\t\t\t$text = str_replace(']]>', ']]&gt;', $text);\n\t\t\t$text = strip_tags($text);\n\t\t\t$excerpt_length = 55;\n\t\t\t$words = explode(' ', $text, $excerpt_length + 1);\n\t\t\tif (count($words) > $excerpt_length) {\n\t\t\t\tarray_pop($words);\n\t\t\t\tarray_push($words, '[...]');\n\t\t\t\t$text = implode(' ', $words);\n\t\t\t}\n\t\t}\n\t\treturn $text;\n\t}", "function truncate($text)\n{\n $max_char=500;\n // Text length is over the limit\n if (strlen($text)>$max_char){\n // Define maximum char number\n $text = substr($text, 0, $max_char);\n // Get position of the last space\n $position_space = strrpos($text, \" \");\n $text = substr($text, 0, $max_char);\n // Add \"...\"\n $text = $text.\" ...\";\n }\n // Return the text\n return $text;\n}", "function trim_text($input, $length, $ellipses = true, $strip_html = true) {\r\n if ($strip_html) {\r\n $input = strip_tags($input);\r\n }\r\n\r\n //no need to trim, already shorter than trim length\r\n if (strlen($input) <= $length) {\r\n return $input;\r\n }\r\n\r\n //find last space within length\r\n $last_space = strrpos(substr($input, 0, $length), ' ');\r\n $trimmed_text = substr($input, 0, $last_space);\r\n\r\n //add ellipses (...)\r\n if ($ellipses) {\r\n $trimmed_text .= '...';\r\n }\r\n\r\n return $trimmed_text;\r\n}", "function truncate($text, $length) {\r\n $length = abs((int)$length);\r\n \r\n if(strlen($text) > $length) {\r\n $text = preg_replace(\"/^(.{1,$length})(\\s.*|$)/s\", '\\\\1...', $text);\r\n }\r\n \r\n return($text); \r\n}", "function cut_carac($texte, $max){\n\t$texte = strip_shortcodes(strip_tags($texte));\n\tif(strlen($texte)>=$max){\n\t$texte = substr($texte,0,$max);\n\t$espace = strrpos($texte,\" \");\n\tif($espace)\n\t$texte = substr($texte,0,$espace);\n\t$texte = $texte.\"...\";\n\t}\n\t$texte = trim(str_replace(\"&nbsp;\", ' ', $texte));\n\treturn $texte;\n}", "public static function truncateWords($string, $count, $suffix = '...')\r\n {\r\n $words = \\preg_split('/(\\s+)/u', \\trim($string), null, \\PREG_SPLIT_DELIM_CAPTURE);\r\n if (\\count($words) / 2 > $count) {\r\n return \\implode('', \\array_slice($words, 0, ($count * 2) - 1)) . $suffix;\r\n }\r\n\r\n return $string;\r\n }", "function limitText($string, $limit){\n\t$string = strip_tags($string);\n\tif (strlen($string) > $limit) {\n\t\t// truncate string\n\t\t$stringCut = substr($string, 0, $limit);\n\t\t// make sure it ends in a word so assassinate doesn't become ass...\n\t\t$string = substr($stringCut, 0, strrpos($stringCut, ' ')); \n\t}\n\treturn $string;\t\t\t\t\n}", "function truncate($string, $length, $stopanywhere=false)\n{\n if (strlen($string) > $length)\n {\n //limit hit!\n $string = substr($string, 0, ($length - 3));\n if ($stopanywhere)\n {\n //stop anywhere\n $string .= '...';\n } else\n {\n //stop on a word.\n $string = substr($string, 0, strrpos($string, ' ')) . '...';\n }\n }\n return $string;\n}", "function theme_debonairson_course_trim_char($str, $n = 500, $endchar = '&#8230;') {\n if (strlen($str) < $n) {\n return $str;\n }\n\n $str = preg_replace(\"/\\s+/\", ' ', str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), ' ', $str));\n if (strlen($str) <= $n) {\n return $str;\n }\n\n $out = \"\";\n $small = substr($str, 0, $n);\n $out = $small.$endchar;\n return $out;\n}", "function trim_text($input, $length, $ellipses = true, $strip_html = true)\n {\n if ($strip_html) {\n $input = strip_tags($input);\n }\n\n //no need to trim, already shorter than trim length\n if (strlen($input) <= $length) {\n return $input;\n }\n\n //find last space within length\n $last_space = strrpos(substr($input, 0, $length), ' ');\n $trimmed_text = substr($input, 0, $last_space);\n\n //add ellipses (...)\n if ($ellipses) {\n $trimmed_text .= '...';\n }\n\n return $trimmed_text;\n }", "function finishOnWord($string, $limit, $stop=\" \")\r\n{\r\n if(strlen($string) <= $limit) return $string;\r\n\r\n // is $stop present between $limit and the end of the string?\r\n if(false !== ($stoppoint = strpos($string, $stop, $limit))) {\r\n if($stoppoint < strlen($string) - 1) {\r\n $string = substr($string, 0, $stoppoint);\r\n }\r\n }\r\n\r\n return $string;\r\n}", "function string_limit_words($string, $word_limit)\n {\n $words = explode(' ', $string, ($word_limit + 1));\n if(count($words) > $word_limit)\n array_pop($words);\n $LimitedWords =implode(' ', $words);\n if (strlen($string) > strlen($LimitedWords)) {\n $LimitedWords = $LimitedWords.\"...\";\n }\n return $LimitedWords;\n }", "function truncate($string)\n {\n $string = strip_tags($string);\n if (strlen($string) > 50) {\n\n // truncate string\n $stringCut = substr($string, 0, 500);\n $endPoint = strrpos($stringCut, ' ');\n\n //if the string doesn't contain any space then it will cut without word basis.\n $string = $endPoint? substr($stringCut, 0, $endPoint) : substr($stringCut, 0);\n }\n return $string;\n }", "function truncate($text, $limit = 40)\n{\n if (str_word_count($text, 0) > $limit) {\n $words = str_word_count($text, 2);\n $pos = array_keys($words);\n $text = mb_substr($text, 0, $pos[$limit], 'UTF-8') . '...';\n }\n\n return $text;\n}", "function word_limiter($str, $limit = 100, $end_char = '&#8230;')\r\n\t{\r\n\t\tif (trim($str) === '')\r\n\t\t{\r\n\t\t\treturn $str;\r\n\t\t}\r\n\r\n\t\tpreg_match('/^\\s*+(?:\\S++\\s*+){1,'.(int) $limit.'}/', $str, $matches);\r\n\r\n\t\tif (strlen($str) === strlen($matches[0]))\r\n\t\t{\r\n\t\t\t$end_char = '';\r\n\t\t}\r\n\r\n\t\treturn rtrim($matches[0]).$end_char;\r\n\t}", "function theme_fsgs_course_trim_char($str, $n = 500, $endchar = '&#8230;') {\n if (strlen($str) < $n) {\n return $str;\n }\n\n $str = preg_replace(\"/\\s+/\", ' ', str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), ' ', $str));\n if (strlen($str) <= $n) {\n return $str;\n }\n\n $out = \"\";\n $small = substr($str, 0, $n);\n $out = $small.$endchar;\n return $out;\n}", "function trim_text($input, $length, $newsID,$ellipses = true, $strip_html = true) {\n if ($strip_html) {$input = strip_tags($input);}\n\t//no need to trim, already shorter than trim length\n if (strlen($input) <= $length) { return $input; }\n\t //find last space within length\n $last_space = strrpos(substr($input, 0, $length), ' ');\n $trimmed_text = substr($input, 0, $last_space);\n\t //add ellipses (...)\n if ($ellipses) {$trimmed_text .= '.... <br/><a href=\"page-news.php?newsID='.$newsID.'\" class=\"btn\">...LANJUT</a>';}\n return $trimmed_text;}", "function truncate_text_at_word($string, $limit, $break = \".\", $pad = \"...\")\n {\n if (strlen($string) <= $limit) {\n return $string;\n }\n if (false !== ($max = strpos($string, $break, $limit))) {\n if ($max < strlen($string) - 1) {\n $string = substr($string, 0, $max) . $pad;\n }\n }\n return $string;\n }", "function trim_excerpt( $text, $excerpt_length = null ) {\n\t\t$text = strip_shortcodes( $text );\n\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t$text = apply_filters( 'the_content', $text );\n\t\t$text = str_replace( ']]>', ']]&gt;', $text );\n\n\t\tif ( ! $excerpt_length ) {\n\t\t\t/**\n\t\t\t * Filters the number of words in an excerpt.\n\t\t\t *\n\t\t\t * @since 2.7.0\n\t\t\t *\n\t\t\t * @param int $number The number of words. Default 55.\n\t\t\t */\n\t\t\t$excerpt_length = apply_filters( 'excerpt_length', 55 );\n\t\t}\n\t\t$more_text = ' &hellip;';\n\t\t$excerpt_more = apply_filters( 'excerpt_more', $more_text );\n\n\t\t$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );\n\n\t\treturn $text;\n\t}", "function woo_excerpt($text, $chars = 120) {\n\t$text = $text.\" \";\n\t$text = substr($text,0,$chars);\n\t$text = substr($text,0,strrpos($text,' '));\n\t$text = $text.\"...\";\n\treturn $text;\n}", "function truncateText($content, $max_length, $truncate_type, $finish_sentence, $add_final_dot)\n {\n $text_truncated=\"\";\n\n if (FILTER_VAR($max_length, FILTER_VALIDATE_INT)) //in case no limit is specified, don't truncate text\n {\n if ($truncate_type==\"symbols\") //truncate text by symbols\n {\n $current_length=strlen($content);\n if ($current_length>$max_length) //content length exceeded, truncate\n {\n $content=preg_replace(\"/\\s+?(\\S+)?$/\", \"\", substr($content, 0, $max_length));\n $text_truncated=1; //will be used when ... needs to be added at the end (so ... is not added to text which was not truncated)\n }\n }\n\n if ($truncate_type==\"words\") //truncate text by words\n {\n $content=preg_replace(\"/\\s\\s+/\", \" \", $content); //replace new lines and excess whitespace with single whitespace\n $words_array=explode(\" \", $content); //make an array of individual words\n\n if (count($words_array)>$max_length) //content length exceeded, truncate\n {\n $words_array=array_slice($words_array, 0, $max_length);\n\n $content=implode(\" \", $words_array);\n $text_truncated=1; //will be used when ... needs to be added at the end (so ... is not added to text which was not truncated)\n }\n }\n\n $content=trim($content);\n }\n\n $end_symbols_array=array(\".\", \"?\", \"!\"); //an array with symbols that can be used at the end of text\n $last_symbol=substr($content, -1); //get the last symbol of current content\n\n if ($finish_sentence==1) //truncate content at the end of sentence, so it doesn't look like \"this is some...\"\n {\n while (!in_array($last_symbol, $end_symbols_array)) //truncate text just when one of end symbols is detected\n {\n $content=substr($content, 0, -1);\n $last_symbol=substr($content, -1);\n }\n }\n\n if ($add_final_dot==1 && !in_array($last_symbol, $end_symbols_array)) //add . to the end if needed\n {\n $content.=\".\";\n }\n\n if ($add_final_dot==2 && $text_truncated==1 && !in_array($last_symbol, $end_symbols_array)) //add ... to the end if needed\n {\n $content.=\"...\";\n }\n\n return $content;\n }", "function devlyTruncateTitle($limit) {\n\n\tglobal $post;\n\n\t$title = get_the_title($post->ID);\n\t\n\tif (mb_strlen($title, 'utf8') > $limit) {\n\t\n\t\t$truncHere \t= strrpos(substr($title, 0, $limit), ' ');\t \n\t\t$title \t\t= substr($title, 0, $truncHere) . '';\t\n\t\t\n\t}\n\t\n\techo $title;\n\n}", "function remove(string $s): string\n{\n $str = explode(\" \", $s);\n\n foreach ($str as &$e) {\n $e = rtrim($e, \"!\");\n }\n\n return implode(\" \",$str);\n}", "function substrwords($text,$maxchar){\n\tif (strlen($text) > $maxchar) { \n\t\t$words = explode(\" \", $text); \n\t\t$output = ''; \n\t\t$i = 0; \n\t\twhile (true) { \n\t\t\t$length = (strlen($output) + strlen($words[$i]));\n\t\t\tif ($length > $maxchar) { \n\t\t\t\tbreak; \n\t\t\t} else { \n\t\t\t\t$output = $output . \" \" . $words[$i]; \n\t\t\t\t++$i; \n\t\t\t} \n\t\t}\n\t} else { \n\t\t$output = $text;\n\t}\n\t return $output;\n}", "function ss_trim_char( $string, $len = 30, $append = '...' ) {\r\n\treturn ( strlen( $string ) > $len ) ?\r\n\t\tsubstr( $string, 0, $len - strlen( $append ) ) . $append :\r\n\t\t$string;\r\n}", "function shortUpdate($text) {\n $chars = 90; \n\n $text = $text.\" \"; \n $text = substr($text,0,$chars); \n $text = substr($text,0,strrpos($text,' '));\n\n if ($chars > 90) {\n \t$text = $text.\"...\";\n }\n else {\n \t$text = $text.\"\";\n }\n\n\n return $text; \n\n}", "function shortUpdate($text) {\n $chars = 90; \n\n $text = $text.\" \"; \n $text = substr($text,0,$chars); \n $text = substr($text,0,strrpos($text,' '));\n\n if ($chars > 90) {\n \t$text = $text.\"...\";\n }\n else {\n \t$text = $text.\"\";\n }\n\n\n return $text; \n\n}", "function subwords( $str, $max = 24, $char = ' ', $end = '...' ) {\n $str = trim( $str ) ;\n $str = $str . $char ;\n $len = strlen( $str ) ;\n $words = '' ;\n $w = '' ;\n $c = 0 ;\n for ( $i = 0; $i < $len; $i++ ) {\n if ( $str[$i] != $char ) {\n $w = $w . $str[$i] ;\n } else {\n if ( ( $w != $char ) and ( $w != '' ) ) {\n $words .= $w . $char ;\n $c++ ;\n if ( $c >= $max ) {\n break ;\n }\n $w = '' ;\n }\n }\n }\n if ( $i+1 >= $len) {\n $end = '' ;\n }\n return trim( $words ) . $end ;\n}", "function shortUpdate($text) {\r\n $chars = 90; \r\n\r\n $text = $text.\" \"; \r\n $text = substr($text,0,$chars); \r\n $text = substr($text,0,strrpos($text,' '));\r\n\r\n if ($chars > 90) {\r\n \t$text = $text.\"...\";\r\n }\r\n else {\r\n \t$text = $text.\"\";\r\n }\r\n\r\n \r\n\r\n return $text; \r\n\r\n}", "function summarizeText($text, $maxLength = 500) {\n\n\tif(!strlen($text)) return '';\n\t$summary = trim(strip_tags($text));\n\tif(strlen($summary) <= $maxLength) return $summary;\n\n\t$summary = substr($summary, 0, $maxLength);\n\t$lastPos = 0;\n\n\tforeach(array('. ', '!', '?') as $punct) {\n\t\t// truncate to last sentence\n\t\t$pos = strrpos($summary, $punct);\n\t\tif($pos > $lastPos) $lastPos = $pos;\n\t}\n\n\tif(!$lastPos) {\n\t\t// if no last sentence was found, truncate to last space\n\t\t$lastPos = strrpos($summary, ' ');\n\t}\n\n\tif($lastPos) {\n\t\t$summary = substr($summary, 0, $lastPos + 1); // and truncate to last sentence\n\t}\n\n\treturn trim($summary);\n}", "function trim_excerpt_length ($length) {\n return 20;\n}", "public function trim_kalimat($text, $count){ \n\n\t\t$text = str_replace(\" \", \" \", $text); \n\t\t$string = explode(\" \", $text); \n\t\tfor ( $wordCounter = 0; $wordCounter <= $count; $wordCounter++ ){ \n\t\t$this->trimed .= $string[$wordCounter]; \n\t\tif ( $wordCounter < $count ){ $this->trimed .= \" \"; } \n\t\telse { $this->trimed .= \"...\"; } \n\t\t} \n\t\t$trimed = trim($this->trimed); \n\t\treturn $trimed; \n\t}", "function trim_to($str, $len) {\n return substr(trim($str), 0, $len);\n}", "public function trim_text( $text, $length = 15, $trim_style = 'words' ) {\n\t\t$length = (int) $length;\n\t\t$trim_style = in_array( $trim_style, array( 'chars', 'words' ), true ) ? $trim_style : 'words';\n\n\t\t// Remove blockquoted text since the text isn't original.\n\t\t$text = preg_replace( '/<blockquote>.+?<\\/blockquote>/s', '', $text );\n\t\t$text = trim( strip_tags( $text ) );\n\n\t\tif ( function_exists( 'strip_shortcodes' ) ) {\n\t\t\t$text = strip_shortcodes( $text );\n\t\t}\n\n\t\t// If trimming by chars, behave like a more multibyte-aware\n\t\t// /* bbp_get_reply_excerpt */().\n\t\tif ( 'chars' === $trim_style ) {\n\t\t\tif ( function_exists( 'mb_strlen' ) ) {\n\t\t\t\t$text_length = mb_strlen( $text );\n\t\t\t} else {\n\t\t\t\t$text_length = strlen( $text );\n\t\t\t}\n\n\t\t\tif ( $length && ( $text_length > $length ) ) {\n\t\t\t\tif ( function_exists( 'mb_strlen' ) ) {\n\t\t\t\t\t$text = mb_substr( $text, 0, $length - 1 );\n\t\t\t\t} else {\n\t\t\t\t\t$text = substr( $text, 0, $length - 1 );\n\t\t\t\t}\n\t\t\t\t$text .= '&hellip;';\n\t\t\t}\n\t\t} else { // Else trim by words.\n\t\t\t$text = wp_trim_words( $text, $length );\n\t\t}\n\n\t\treturn $text;\n\t}", "function wordlimit($string, $length = 50, $ellipsis = \"...\") {\n $words = explode(' ', strip_tags($string));\n if (count($words) > $length)\n return implode(' ', array_slice($words, 0, $length)) . $ellipsis;\n else\n return $string;\n}", "function ShortenText($text, $chars) {\n\tif (strlen($text)>$chars) {\n\t\t$text = $text.\" \"; \n\t\t$text = substr($text,0,$chars); \n\t\t$text = substr($text,0,strrpos($text,' ')); \t\t\t\n\t\t$text = $text.\"...\"; \n\t}\t\t\n\treturn $text; \n}", "function snip(\n\tstring $text = '',\n\tint $length = 50,\n\tstring $length_type = 'words',\n\tstring $finish = 'word'\n): string {\n\t$ellipsis = '&hellip;';\n\t$tokens = [];\n\t$allowed_tags = [\n\t'abbr', 'acronym', 'address', 'cite', 'code', 'del', 'ins',\n\t'q', 's', 'strike', 'sub', 'sup', 'time'\n\t];\n\t$tag_string = [];\n\t$out = '';\n\t$w = 0;\n\t$shortened = false;\n\n // From the default wp_trim_excerpt():\n // No shortcodes!\n\t$text = strip_shortcodes($text);\n\n // From the default wp_trim_excerpt():\n // Some kind of precaution against malformed CDATA in RSS feeds I suppose\n\t$text = str_replace(']]>', ']]&gt;', $text);\n\n // Make array of allowed tags\n\t$tag_string = '<' . implode('><', $allowed_tags) . '>';\n\n // Remove all but the allowed tags\n\t$text = wp_strip_all_tags($text, $tag_string);\n\n // Divide the string into tokens; HTML tags, or words, followed by any whitespace\n // (<[^>]+>|[^<>\\s]+\\s*)\n\tpreg_match_all('/(<[^>]+>|[^<>\\s]+)\\s*/u', $text, $tokens);\n\tforeach ($tokens[0] as $t) { // Parse each token\n\t\tif ($w >= $length && 'sentence' != $finish) { // Limit reached\n\t\t\tbreak;\n\t\t}\n\t\tif ($t[0] != '<') { // Token is not a tag\n\t\t\tif (\n\t\t\t\t$w >= $length && 'sentence' == $finish\n\t\t\t\t&& preg_match('/[\\?\\.\\!]\\s*$/uS', $t) == 1\n\t\t\t) { // Limit reached, continue until ? . or ! occur at the end\n\t\t\t\t$out .= trim($t);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ('words' == $length_type) { // Count words\n\t\t\t\t$w++;\n\t\t\t} else { // Count/trim characters\n\t\t\t\t$chars = trim($t); // Remove surrounding space\n\t\t\t\t$c = strlen($chars);\n\t\t\t\tif ($c + $w > $length && 'sentence' != $finish) { // Token is too long\n\t\t\t\t\t$c = ( 'word' == $finish ) ? $c : $length - $w; // Keep token to finish word\n\t\t\t\t\t$t = substr($t, 0, $c);\n\t\t\t\t}\n\t\t\t\t$w += $c;\n\t\t\t}\n\t\t}\n\t // Append what's left of the token\n\t\t$out .= $t;\n\t}\n\n // Check to see if any trimming took place\n\tif (strlen($out) < strlen($text)) {\n\t\t$shortened = true;\n\t}\n\n // Trim whitespace\n\t$out = trim(force_balance_tags($out));\n\n // Add the ellipsis if text has been shortened\n\tif ($shortened) {\n\t\t$out .= $ellipsis;\n\t}\n\n\treturn $out;\n}", "function limitWords ($aText, $wordCountLimit)\n {\n if (strlen($aText) > 0)\n {\n $tagStrippedText = strip_tags($aText);\n if (str_word_count($tagStrippedText) <= $wordCountLimit)\n {\n return $tagStrippedText;\n }\n return implode(' ', array_slice(explode(' ', $tagStrippedText, $wordCountLimit), 0, ($wordCountLimit - 1))) . '...';\n }\n return '';\n }", "function str_stop($string, $max_length){\n\t if (strlen($string) > $max_length){\n\t\t $string = substr($string, 0, $max_length);\n\t\t $pos = strrpos($string, \" \");\n\t\t if($pos === false) {\n\t\t\t\t return substr($string, 0, $max_length).\"...\";\n\t\t\t }\n\t\t return substr($string, 0, $pos).\"...\";\n\t }else{\n\t\t return $string;\n\t }\n\t}", "function rw_trim_excerpt( $text='' )\n{\n $text = strip_shortcodes( $text );\n $text = apply_filters('the_content', $text);\n $text = str_replace(']]>', ']]&gt;', $text);\n $excerpt_length = apply_filters('excerpt_length', 55);\n $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');\n return wp_trim_words( $text, $excerpt_length, $excerpt_more );\n}", "function testTruncate5 ()\n\t{\n\t\t\t$input = \"Barry is a programmer\";\n\t\t\t$expectedOutput = \"Barry is a programmer\";\n\t\t\t$this->assertEqual (\n\t\t\t\t\t$this->stringUtils->truncate ($input, 30, ''),\n\t\t\t\t\t$expectedOutput\n\t\t\t);\n\t}", "function testTruncate4 ()\n\t{\n\t\t\t$input = \"Barry is a programmer\";\n\t\t\t$expectedOutput = \"Barry is a programmer\";\n\t\t\t$this->assertEqual (\n\t\t\t\t\t$this->stringUtils->truncate ($input, 21, ''),\n\t\t\t\t\t$expectedOutput\n\t\t\t);\n\t}", "function standard_truncate_text( $string, $character_limit = 50, $truncation_indicator = '...' ) {\n\n\t$truncated = null == $string ? '' : $string;\n if ( strlen( $string ) >= ( $character_limit + 1 ) ) {\n \n $truncated = substr( $string, 0, $character_limit );\n\n if ( substr_count( $truncated, ' ') > 1 ) {\n $last_space = strrpos( $truncated, ' ' );\n $truncated = substr( $truncated, 0, $last_space );\n } // end if\n\n $truncated = $truncated . $truncation_indicator;\n \n } // end if/else\n \n return $truncated;\n \n}", "function funcs_cutLength($string, $length, $word_length = null,$act_length = null){\n\t$string = (!is_null($string))?trim($string):'';\n\t//do not check the size of the string if we already know it\n\tif (is_null($act_length))$act_length=strlen($string);\n\tif (!is_null($word_length) && !empty($string)){\n\t\t//in the future use this instead of calling this whole function\n\t\t$string = wordwrap($string,$word_length,\"\\n\",1);\n\t}\n\tif (!is_null($length) && $act_length>$length && $length>4){\n\t\t$string = substr($string,0,$length-3).'...';\n\t}\n\treturn $string;\n}", "function strrtrim($message, $strip) {\n // break message apart by strip string \n $lines = explode($strip, $message); \n $last = ''; \n // pop off empty strings at the end \n do { \n $last = array_pop($lines); \n } while (empty($last) && (count($lines))); \n // re-assemble what remains \n return implode($strip, array_merge($lines, array($last))); \n}", "function limit_text($text, $limit) {\n\tif (str_word_count($text, 0) > $limit) {\n\t\t$words = str_word_count($text, 2);\n\t\t$pos = array_keys($words);\n\t\t$text = substr($text, 0, $pos[$limit]) . '...';\n\t}\n\treturn $text;\n}", "function tronquer_texte($texte, $longeur_max)\n{\n if (strlen($texte) > $longeur_max)\n {\n $texte = substr($texte, 0, $longeur_max);\n $dernier_espace = strrpos($texte, \"\");\n $texte = substr($texte, 0, $dernier_espace).\"...\";\n }\n return $texte;\n}", "function trim_string($text, $limit) {\n\tmb_internal_encoding(\"UTF-8\");\n if (mb_strlen($text) > $limit) {\n $text = mb_substr($text, 0, $limit) . '...';\n }\n\n return $text;\n }", "function limit_words($string, $word_limit) {\n\t// creates an array of words from $string (this will be our excerpt)\n\t// explode divides the excerpt up by using a space character\n\t$words = explode(' ', $string);\n\n\t// this next bit chops the $words array and sticks it back together\n\t// starting at the first word '0' and ending at the $word_limit\n\t// the $word_limit which is passed in the function will be the number\n\t// of words we want to use\n\t// implode glues the chopped up array back together using a space character\n\treturn implode(' ', array_slice($words, 0, $word_limit));\n}", "public static function filter($string, $size = null)\n {\n $string = strip_tags($string);\n $string = stripslashes($string);\n\n if (!is_null($size)) {\n if (strlen($string) > $size) {\n $substring = substr($string, 0, $size);\n\n #get position of the last \"SPACE\" character after substring\n $pos = strrpos($substring, ' ');\n if ($pos !== false) {\n $substring = substr($string, 0, $pos);\n }\n return $substring;\n }\n }\n return $string;\n }", "function string_cut_string($str, $length)\r\n\t{\r\n\t\t$str = strip_tags($str);\r\n\t\t/*\r\n\t\tif(strpos($str, \" \") === false) {\r\n\t\t\t$str = wordwrap($str, 25, \"<br />\\n\", true);\r\n\t\t}\r\n\t\t*/\r\n\t\tif (strlen($str) > $length)\r\n\t\t{\r\n\t\t\t$str = substr($str, 0, $length);\r\n\t\t\t$last_space = strrpos($str, \" \");\r\n\t\t\t$str = substr($str, 0, $last_space).\"...\";\r\n\t\t} \r\n\r\n\t\treturn $str;\r\n\t}", "function shorten( $text, $length ) {\n $text = strip_tags( $text );\n\n $length = abs( (int)$length );\n if ( strlen( $text ) > $length ) $text = preg_replace( \"/^(.{1,$length})(\\s.*|$)/s\", '\\\\1...', $text );\n return ( $text );\n }", "function myTruncate2($string, $limit, $break=\" \", $pad=\"...\") {\n\nif(strlen($string) <= $limit) \n\nreturn $string; \n\n$string = substr($string, 0, $limit); \n\nif(false !== ($breakpoint = strrpos($string, $break))) \n\n{ \n\n$string = substr($string, 0, $breakpoint); \n\n} \n\nreturn $string . $pad; \n\n}", "function custom_trim_excerpt($text) { // Fakes an excerpt if needed\rglobal $post;\rif ( '' == $text ) {\r$text = get_the_content('');\r$text = apply_filters('the_content', $text);\r$text = str_replace(']]>', ']]>', $text);\r$text = strip_tags($text);\r$excerpt_length = 90;\r$words = explode(' ', $text, $excerpt_length + 1);\rif (count($words) > $excerpt_length) {\rarray_pop($words);\rarray_push($words, '...');\r$text = implode(' ', $words);\r}\r}\rreturn $text;\r}", "function tfuse_substr($str, $length, $more = '...', $minword = 3) {\r\n $sub = '';\r\n $len = 0;\r\n \r\n foreach (explode(' ', $str) as $word) {\r\n $part = (($sub != '') ? ' ' : '') . $word;\r\n $sub .= $part;\r\n $len += strlen($part);\r\n \r\n if (strlen($word) > $minword && strlen($sub) >= $length)\r\n break;\r\n }\r\n \r\n return (($len < strlen($str)) ? $sub . ' ' . $more : $sub);\r\n }", "function prevent_widows( $str, $last_words_max_length = 11 )\n\t{\n\t\t$pos = strrpos( $str, ' ' );\n\n\t\tif ( $pos === FALSE || strlen( $str ) - $pos > $last_words_max_length )\n\t\t{ // Nothing to do.\n\t\t\treturn $str;\n\t\t}\n\t\t// U+00A0 NO-BREAK SPACE == C2 A0 in UTF-8\n\t\t// @see http://www.fileformat.info/info/unicode/char/00a0/index.htm\n\t\treturn substr_replace( $str, \"\\xC2\\xA0\", $pos, 1 );\n\t}", "function _char_limit($str, $length, $minword = 3)\n {\n $sub = '';\n $len = 0;\n \n foreach (explode(' ', $str) as $word)\n {\n $part = (($sub != '') ? ' ' : '') . $word;\n $sub .= $part;\n $len += strlen($part);\n \n if (strlen($word) > $minword && strlen($sub) >= $length)\n {\n break;\n }\n }\n \n return $sub . (($len < strlen($str)) ? '...' : '');\n\n }", "function\n\ttrimOption($option, $maxlength)\n\t{\n\t\t$option = substr($option, 0, $maxlength - 3);\n\t\t$option = preg_replace('/\\w*$/', '...', $option, 1);\n\t\treturn($option);\n\t}", "function limit_content($title,$len) {\n if (str_word_count($title) > $len) {\n $keys = array_keys(str_word_count($title, 2));\n $title = substr($title, 0, $keys[$len]);\n }\n return $title;\n}", "function myTruncate2($string, $limit, $break=\" \", $pad=\"...\")\n{\n if(strlen($string) <= $limit) return $string;\n\n $string = substr($string, 0, $limit);\n if(false !== ($breakpoint = strrpos($string, $break))) {\n $string = substr($string, 0, $breakpoint);\n }\n\n return $string . $pad;\n}", "function trim($s,$s2) { \n if (substr($s , strlen($s) - strlen($s2)) == $s2) $s = substr($s , 0 , strlen($s) - strlen($s2)); \n return $s; \n }", "public function subPhrase($string,$length = 0){\r\n if(strlen($string)<=$length) return $string;\r\n $pos = $length;\r\n for($i=$length-1;$i>=0;$i--){\r\n if($string[$i]==\" \"){\r\n $pos = $i+1;\r\n break;\r\n }\r\n }\r\n return substr($string,0,$pos).\"...\";\r\n }", "public static function cutText($string, $limit) {\r\r\n\t\tif (strlen($string) < $limit)\r\r\n\t\t\treturn $string;\r\r\n\t\t\r\r\n\t\t$reg =\"/^(.{1,\" . $limit . \"}[^\\s]*).*$/s\";\r\r\n\t\treturn preg_replace($reg, '\\\\1', $string);\r\r\n\t}", "function testTruncate2 ()\n\t{\n\t\t\t$input = \"Barry is a programmer\";\n\t\t\t$expectedOutput = \"Barry\";\n\t\t\t$this->assertEqual (\n\t\t\t\t\t$this->stringUtils->truncate ($input, 5, ''),\n\t\t\t\t\t$expectedOutput\n\t\t\t);\n\t}", "function shortenText($string, $wordsreturned)\n {\n $string = strip_tags($string);\n $retval = $string;\n $string = preg_replace('/(?<=\\S,)(?=\\S)/', ' ', $string);\n $string = str_replace(\"\\n\", \" \", $string);\n $array = explode(\" \", $string);\n if (count($array) <= $wordsreturned)\n {\n $retval = $string;\n }\n else\n {\n array_splice($array, $wordsreturned);\n $retval = implode(\" \", $array) . \" ...\";\n }\n return $retval;\n }", "function truncate_text($text, $max_chars = 70) {\n if (strlen($text) > $max_chars) {\n return explode( \"\\n\", wordwrap( $text, $max_chars))[0] . '…';\n }\n return $text;\n}", "function TruncateStr($string, $length = 80, $etc = '...', $breakWords = false) {\n if ($length == 0)\n return '';\n\n if (strlen($string) > $length) {\n $length -= strlen($etc);\n $fragment = substr($string, 0, $length + 1);\n if ($break_words)\n $fragment = substr($fragment, 0, -1);\n else\n $fragment = preg_replace('/\\s+(\\S+)?$/', '', $fragment);\n return $fragment . \" \" . $etc;\n } else\n return $string;\n }", "function ltrimWith( $trim ) {\n\treturn partialRight( 'ltrim', $trim );\n}" ]
[ "0.76281977", "0.6988167", "0.69878924", "0.6839568", "0.68173647", "0.6811791", "0.6723626", "0.6712341", "0.6709216", "0.6694157", "0.6660344", "0.66569823", "0.66453695", "0.6638536", "0.65900403", "0.65855104", "0.6535671", "0.6533304", "0.65297174", "0.6521033", "0.6482138", "0.6472268", "0.643835", "0.6434837", "0.640506", "0.6355358", "0.63537186", "0.6343189", "0.6341654", "0.6337255", "0.6329386", "0.63280934", "0.63165927", "0.6303888", "0.62662786", "0.6255497", "0.62494546", "0.62419933", "0.6212121", "0.6210904", "0.6196675", "0.6182614", "0.61619556", "0.61596286", "0.6148375", "0.6127404", "0.6125137", "0.6121242", "0.61171424", "0.6103134", "0.6085507", "0.6074196", "0.6074095", "0.6073378", "0.6059821", "0.6041934", "0.6035032", "0.6010846", "0.6010846", "0.6007953", "0.6007067", "0.60069174", "0.5996716", "0.59956485", "0.5993967", "0.5992601", "0.5986056", "0.5984753", "0.5956045", "0.5953436", "0.59382296", "0.5929178", "0.59272707", "0.5917071", "0.59137285", "0.59128964", "0.59100765", "0.5909993", "0.5905981", "0.5900923", "0.59005743", "0.58956945", "0.58897704", "0.58818823", "0.5881485", "0.58769166", "0.5874681", "0.5861319", "0.58372146", "0.58302814", "0.5821104", "0.58209646", "0.5814226", "0.5811495", "0.5810535", "0.5807839", "0.58056885", "0.57775426", "0.57766724", "0.5776494" ]
0.62456036
37
Returns a textual representation of a file's permissions
function perms($file) { $perms = fileperms($file); if (($perms & 0xC000) == 0xC000) { // Socket $info = 's'; } elseif (($perms & 0xA000) == 0xA000) { // Symbolic Link $info = 'l'; } elseif (($perms & 0x8000) == 0x8000) { // Regular $info = '-'; } elseif (($perms & 0x6000) == 0x6000) { // Block special $info = 'b'; } elseif (($perms & 0x4000) == 0x4000) { // Directory $info = 'd'; } elseif (($perms & 0x2000) == 0x2000) { // Character special $info = 'c'; } elseif (($perms & 0x1000) == 0x1000) { // FIFO pipe $info = 'p'; } else { // Unknown $info = 'u'; } // Owner $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); // Group $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); // World $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); return $info; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPermissionsString()\n {\n $out = \"\";\n\n $perm = octdec( $this->getPermissions() );\n\n for ( $i = 6; $i >= 0; $i -= 3 )\n {\n $part = ( $perm >> $i );\n\n if ( $part & 4 )\n {\n $out .= \"r\";\n }\n else\n {\n $out .= \"-\";\n }\n\n if ( $part & 2 )\n {\n $out .= \"w\";\n }\n else\n {\n $out .= \"-\";\n }\n\n if ( $part & 1 )\n {\n $out .= \"x\";\n }\n else\n {\n $out .= \"-\";\n }\n }\n return $out;\n }", "public function getPermissions()\n {\n return $this->fileStructure->mode;\n }", "function permissions_string($perms) {\n\n switch ($perms) {\n case '040000':\n return 'drwxr-xr-x';\n case '100644':\n return '-rw-r--r--';\n case '100755':\n return '-rwxr-xr-x';\n case '120000':\n return 'lrwxrwxrwx';\n\n default:\n return '----------';\n }\n}", "function fn_get_readable_file_perms($perms)\n{\n if (($perms & 0xC000) == 0xC000) {\n // Socket\n $info = 's';\n } elseif (($perms & 0xA000) == 0xA000) {\n // Symbolic link\n $info = 'l';\n } elseif (($perms & 0x8000) == 0x8000) {\n // Usual\n $info = '-';\n } elseif (($perms & 0x6000) == 0x6000) {\n // Special block\n $info = 'b';\n } elseif (($perms & 0x4000) == 0x4000) {\n // Dir\n $info = 'd';\n } elseif (($perms & 0x2000) == 0x2000) {\n // Special symbol\n $info = 'c';\n } elseif (($perms & 0x1000) == 0x1000) {\n // FIFO stream\n $info = 'p';\n } else {\n // Unknown\n $info = 'u';\n }\n\n // Owner\n $info .= (($perms & 0x0100) ? 'r' : '-');\n $info .= (($perms & 0x0080) ? 'w' : '-');\n $info .= (($perms & 0x0040)\n ? (($perms & 0x0800) ? 's' : 'x')\n : (($perms & 0x0800) ? 'S' : '-'));\n\n // Group\n $info .= (($perms & 0x0020) ? 'r' : '-');\n $info .= (($perms & 0x0010) ? 'w' : '-');\n $info .= (($perms & 0x0008)\n ? (($perms & 0x0400) ? 's' : 'x')\n : (($perms & 0x0400) ? 'S' : '-'));\n\n // World\n $info .= (($perms & 0x0004) ? 'r' : '-');\n $info .= (($perms & 0x0002) ? 'w' : '-');\n $info .= (($perms & 0x0001)\n ? (($perms & 0x0200) ? 't' : 'x')\n : (($perms & 0x0200) ? 'T' : '-'));\n\n return $info;\n}", "public function getExpectedFilePermissionStr($file = '')\n {\n switch ($file) {\n default:\n $mode = (int)$this->getExpectedFilePermission($file);\n break;\n }\n\n return (string) '0' . base_convert($mode, 10, 8);\n }", "function fn_te_get_permissions($path)\n{\n if (defined('IS_WINDOWS')) {\n return '';\n }\n\n $mode = fileperms($path);\n\n $owner = array();\n $group = array();\n $world = array();\n $owner['read'] = ($mode & 00400) ? 'r' : '-';\n $owner['write'] = ($mode & 00200) ? 'w' : '-';\n $owner['execute'] = ($mode & 00100) ? 'x' : '-';\n $group['read'] = ($mode & 00040) ? 'r' : '-';\n $group['write'] = ($mode & 00020) ? 'w' : '-';\n $group['execute'] = ($mode & 00010) ? 'x' : '-';\n $world['read'] = ($mode & 00004) ? 'r' : '-';\n $world['write'] = ($mode & 00002) ? 'w' : '-';\n $world['execute'] = ($mode & 00001) ? 'x' : '-';\n\n if ($mode & 0x800) {\n $owner['execute'] = ($owner['execute']=='x') ? 's' : 'S';\n }\n\n if ($mode & 0x400) {\n $group['execute'] = ($group['execute']=='x') ? 's' : 'S';\n }\n\n if ($mode & 0x200) {\n $world['execute'] = ($world['execute']=='x') ? 't' : 'T';\n }\n\n $s = sprintf('%1s%1s%1s', $owner['read'], $owner['write'], $owner['execute']);\n $s .= sprintf('%1s%1s%1s', $group['read'], $group['write'], $group['execute']);\n $s .= sprintf('%1s%1s%1s', $world['read'], $world['write'], $world['execute']);\n\n return trim($s);\n}", "public function getPermissionsDescription()\n {\n if (class_exists(Subsite::class)) {\n Subsite::disable_subsite_filter(true);\n }\n\n $permissionsUsr = Permission::permissions_for_member($this->owner->ID);\n $permissionsSrc = Permission::get_codes(true);\n sort($permissionsUsr);\n\n $permissionNames = array();\n foreach ($permissionsUsr as $code) {\n $code = strtoupper($code ?? '');\n foreach ($permissionsSrc as $k => $v) {\n if (isset($v[$code])) {\n $name = empty($v[$code]['name'])\n ? _t(__CLASS__ . '.UNKNOWN', 'Unknown')\n : $v[$code]['name'];\n $permissionNames[] = $name;\n }\n }\n }\n\n $result = $permissionNames\n ? implode(', ', $permissionNames)\n : _t(__CLASS__ . '.NOPERMISSIONS', 'No Permissions');\n\n if (class_exists(Subsite::class)) {\n Subsite::disable_subsite_filter(false);\n }\n return $result;\n }", "function read_chmod()\n\t{\n\t\tglobal $chmod_777, $chmod_666;\n\t\tglobal $lang, $language;\n\n\t\t$img_ok = str_replace('alt=\"\" title=\"\"', 'alt=\"' . $lang['CHMOD_OK'] . '\" title=\"' . $lang['CHMOD_File_Exists'] . '\"', $this->img_ok);\n\t\t$img_error = str_replace('alt=\"\" title=\"\"', 'alt=\"' . $lang['CHMOD_Error'] . '\" title=\"' . $lang['CHMOD_Error'] . '\"', $this->img_error);\n\n\t\t$report_string_append = '';\n\n\t\t$chmod_items_array = array($chmod_777, $chmod_666);\n\t\t$chmod_values_array = array(0777, 0666);\n\t\t$chmod_langs_array = array($lang['CHMOD_777'], $lang['CHMOD_666']);\n\n\t\t$table_output = '';\n\n\t\tfor ($i = 0; $i < sizeof($chmod_items_array); $i++)\n\t\t{\n\t\t\tif (!empty($chmod_items_array[$i]))\n\t\t\t{\n\t\t\t\t$table_output .= '<b>' . $chmod_langs_array[$i] . '</b><br />' . '<ul>';\n\t\t\t\tfor ($j = 0; $j < sizeof($chmod_items_array[$i]); $j++ )\n\t\t\t\t{\n\t\t\t\t\t$report_string = '';\n\t\t\t\t\t$errored = false;\n\t\t\t\t\tif (!file_exists($chmod_items_array[$i][$j]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$errored = true;\n\t\t\t\t\t\t$report_string = $lang['CHMOD_File_NotExists'];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!is_writable($chmod_items_array[$i][$j]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$errored = true;\n\t\t\t\t\t\t\t$report_string = $lang['CHMOD_File_Exists_Read_Only'];\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$report_string = $lang['CHMOD_File_Exists'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($errored)\n\t\t\t\t\t{\n\t\t\t\t\t\t$report_string_append = '&nbsp;<span class=\"genmed\" style=\"color: ' . $this->color_error . ';\"><b>' . $report_string . '</b></span>';\n\t\t\t\t\t\t$table_output .= '<li><span class=\"gensmall\" style=\"color: ' . $this->color_error . ';\"><b>' . $chmod_items_array[$i][$j] . '</b></span>&nbsp;' . $img_error . '</li>' . \"\\n\";\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$report_string_append = '&nbsp;<span class=\"genmed\" style=\"color: ' . $this->color_ok . ';\">' . $report_string . '</span>';\n\t\t\t\t\t\t$table_output .= '<li><span class=\"gensmall\" style=\"color: ' . $this->color_ok . ';\"><b>' . $chmod_items_array[$i][$j] . '</b></span>&nbsp;' . $img_ok . '</li>' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$table_output .= '</ul>' . '<br />';\n\t\t\t}\n\t\t}\n\n\t\treturn $table_output;\n\t}", "public function perms()\n {\n if ($this->exists()) {\n return substr(sprintf('%o', fileperms($this->path)), -4);\n }\n\n return false;\n }", "public function getFileOperationPermissions() {}", "function octalPermissions($perms) {\n\t\treturn substr(sprintf('%o', $perms), -3);\n\t}", "public function getFilePermissions ($file)\n {\n return fileperms($file);\n }", "function get_perms($file,$type) {\n\tswitch($type) {\n\t\tcase 1;\n\t\t\t$mode = fileperms($file);\n\t\t\t$perms = NULL;\n\t\t\t$perms .= ($mode & 00400) ? 'r' : '-';\n\t\t\t$perms .= ($mode & 00200) ? 'w' : '-';\n\t\t\t$perms .= ($mode & 00100) ? 'x' : '-';\n\t\t\t$perms .= ($mode & 00040) ? 'r' : '-';\n\t\t\t$perms .= ($mode & 00020) ? 'w' : '-';\n\t\t\t$perms .= ($mode & 00010) ? 'x' : '-';\n\t\t\t$perms .= ($mode & 00004) ? 'r' : '-';\n\t\t\t$perms .= ($mode & 00002) ? 'w' : '-';\n\t\t\t$perms .= ($mode & 00001) ? 'x' : '-';\n\t\tbreak;\n\t\t\n\t\tcase 2;\n\t\t\t$perms = substr(sprintf('%o', fileperms($file)), -4);\n\t\tbreak;\n\t}\n\t\nreturn $perms;\n}", "public function get_permissions()\n\t{\n\t\treturn $this->area->get_permissions($this->path);\n\t}", "public function display_perms($mode) {\n\t\t// Determine Type\n\t\tif ($mode & 0x1000) $type='p'; // FIFO pipe\n\t\telseif ($mode & 0x2000) $type='c'; // Character special\n\t\telseif ($mode & 0x4000) $type='d'; // Directory\n\t\telseif ($mode & 0x6000) $type='b'; // Block special\n\t\telseif ($mode & 0x8000) $type='-'; // Regular\n\t\telseif ($mode & 0xA000) $type='l'; // Symbolic Link\n\t\telseif ($mode & 0xC000) $type='s'; // Socket\n\t\telse $type='u'; // UNKNOWN\n\n\t\t// Determine permissions\n\t\t$owner['read'] = (($mode & 00400) ? 'r' : '-');\n\t\t$owner['write'] = (($mode & 00200) ? 'w' : '-');\n\t\t$owner['execute'] = (($mode & 00100) ? 'x' : '-');\n\t\t$group['read'] = (($mode & 00040) ? 'r' : '-');\n\t\t$group['write'] = (($mode & 00020) ? 'w' : '-');\n\t\t$group['execute'] = (($mode & 00010) ? 'x' : '-');\n\t\t$world['read'] = (($mode & 00004) ? 'r' : '-');\n\t\t$world['write'] = (($mode & 00002) ? 'w' : '-');\n\t\t$world['execute'] = (($mode & 00001) ? 'x' : '-');\n\n\t\t// Adjust for SUID, SGID and sticky bit\n\t\tif ($mode & 0x800) $owner['execute'] = ($owner['execute'] == 'x') ? 's' : 'S';\n\t\tif ($mode & 0x400) $group['execute'] = ($group['execute'] == 'x') ? 's' : 'S';\n\t\tif ($mode & 0x200) $world['execute'] = ($world['execute'] == 'x') ? 't' : 'T';\n\n\t\t$s = sprintf('%1s', $type);\n\t\t$s .= sprintf('%1s%1s%1s', $owner['read'], $owner['write'], $owner['execute']);\n\t\t$s .= sprintf('%1s%1s%1s', $group['read'], $group['write'], $group['execute']);\n\t\t$s .= sprintf('%1s%1s%1s'.\"\\n\", $world['read'], $world['write'], $world['execute']);\n\t\treturn $s;\n\t}", "public function getPerms($file){\n $permisos = fileperms($file);\n\n if (($permisos & 0xC000) == 0xC000) {\n // Socket\n $type = 's';\n } elseif (($permisos & 0xA000) == 0xA000) {\n // Symbolic link\n $type = 'l';\n } elseif (($permisos & 0x8000) == 0x8000) {\n // Regular\n $type = '-';\n } elseif (($permisos & 0x6000) == 0x6000) {\n // Special block\n $type = 'b';\n } elseif (($permisos & 0x4000) == 0x4000) {\n // Directory\n $type = 'd';\n } elseif (($permisos & 0x2000) == 0x2000) {\n // Especial Carácter\n $type = 'c';\n } elseif (($permisos & 0x1000) == 0x1000) {\n // FIFO Pipe\n $type = 'p';\n } else {\n // Unknown\n $type = 'u';\n }\n\n $owner = (($permisos & 0x0100) ? 'r' : '-');\n $owner .= (($permisos & 0x0080) ? 'w' : '-');\n $owner .= (($permisos & 0x0040) ?\n (($permisos & 0x0800) ? 's' : 'x' ) :\n (($permisos & 0x0800) ? 'S' : '-'));\n\n $group = (($permisos & 0x0020) ? 'r' : '-');\n $group .= (($permisos & 0x0010) ? 'w' : '-');\n $group .= (($permisos & 0x0008) ?\n (($permisos & 0x0400) ? 's' : 'x' ) :\n (($permisos & 0x0400) ? 'S' : '-'));\n\n $other = (($permisos & 0x0004) ? 'r' : '-');\n $other .= (($permisos & 0x0002) ? 'w' : '-');\n $other .= (($permisos & 0x0001) ? \n (($permisos & 0x0200) ? 't' : 'x' ) : \n (($permisos & 0x0200) ? 'T' : '-'));\n \n return array(\n 'name' => $file, \n 'type' => $type,\n 'owner' => $owner,\n 'group' => $group,\n 'other' => $other,\n );\n }", "public function getchmod( $file ) {\n\t\t$dir = $this->dirlist( $file );\n\n\t\treturn $dir[ $file ]['permsn'];\n\t}", "public function __toString()\n {\n $out = $this->getTypeString();\n $out .= $this->getPermissionsString();\n\n $out .= \" \";\n $out .= $this->getUserId() . \" \";\n $out .= $this->getGroupId() . \" \";\n $out .= str_pad( $this->getSize(), 7, \" \", STR_PAD_LEFT ) . \" \";\n $out .= date( \"Y-m-d H:i:s \", $this->getModificationTime() );\n $out .= $this->getPath();\n\n $out .= ( $this->isLink() ? \" -> \" . $this->getLink() : \"\" );\n\n return $out;\n }", "public static function permissions($mixed)\n {\n // Detect input type\n if (is_string($mixed)) {\n\n // Get the file permissions\n $octal = self::octal($mixed);\n } else {\n // Already in octal format (hopefully)\n $octal = $mixed;\n }\n\n // Begin symbolic processing\n if (($octal & 0xC000) === 0xC000) {\n\n // Socket\n $permissions = 's';\n } elseif (($octal & 0xA000) === 0xA000) {\n\n // Symbolic Link\n $permissions = 'l';\n } elseif (($octal & 0x8000) === 0x8000) {\n\n // Regular\n $permissions = '-';\n } elseif (($octal & 0x6000) === 0x6000) {\n\n // Block special\n $permissions = 'b';\n } elseif (($octal & 0x4000) === 0x4000) {\n\n // Directory\n $permissions = 'd';\n } elseif (($octal & 0x2000) === 0x2000) {\n\n // Character special\n $permissions = 'c';\n } elseif (($octal & 0x1000) === 0x1000) {\n\n // FIFO pipe\n $permissions = 'p';\n } else {\n // Unknown\n $permissions = 'u';\n }\n\n // Get the Owner Permissions\n $permissions .=\n\n // Readable\n (($octal & 0x0100) ? 'r' : '-')\n\n // Writeable\n .(($octal & 0x0080) ? 'w' : '-')\n\n // Other\n .(($octal & 0x0040) ?\n\n // Executable\n (($octal & 0x0800) ? 's' : 'x') :\n\n // Special\n (($octal & 0x0800) ? 'S' : '-'));\n\n // Get the Group Permissions\n $permissions .=\n\n // Readable\n (($octal & 0x0020) ? 'r' : '-')\n\n // Writeable\n .(($octal & 0x0010) ? 'w' : '-')\n\n // Other\n .(($octal & 0x0008) ?\n\n // Executable\n (($octal & 0x0400) ? 's' : 'x') :\n\n // Special\n (($octal & 0x0400) ? 'S' : '-'));\n\n // Get the World Permissions\n $permissions .=\n\n // Readable\n (($octal & 0x0004) ? 'r' : '-')\n\n // Writeable\n .(($octal & 0x0002) ? 'w' : '-')\n\n // Other\n .(($octal & 0x0001) ?\n\n // Executable\n (($octal & 0x0200) ? 't' : 'x') :\n\n // Sticky\n (($octal & 0x0200) ? 'T' : '-'));\n\n // Return full (linux style) permissions\n return $permissions;\n }", "public function permission(): string;", "public function __toString()\n {\n $results = [];\n if ($this->read()) {\n $results[] = $this->getName(self::READ);\n }\n if ($this->create()) {\n $results[] = $this->getName(self::CREATE);\n }\n if ($this->update()) {\n $results[] = $this->getName(self::UPDATE);\n }\n if ($this->delete()) {\n $results[] = $this->getName(self::DELETE);\n }\n\n if (!empty($results)) {\n return implode(', ', $results);\n }\n return 'No permissions set!';\n }", "public function getPermissionOptions()\n {\n return [\n 'read' => 'View changes of all content',\n ];\n }", "public static function symbolicPermissions($perms) {\n\t\tif (($perms & 0xC000) == 0xC000) {\n\t\t\t$symbolic = 's'; // Socket\n\t\t} elseif (($perms & 0xA000) == 0xA000) {\n\t\t\t$symbolic = 'l'; // Symbolic Link\n\t\t} elseif (($perms & 0x8000) == 0x8000) {\n\t\t\t$symbolic = '-'; // Regular\n\t\t} elseif (($perms & 0x6000) == 0x6000) {\n\t\t\t$symbolic = 'b'; // Block special\n\t\t} elseif (($perms & 0x4000) == 0x4000) {\n\t\t\t$symbolic = 'd'; // Directory\n\t\t} elseif (($perms & 0x2000) == 0x2000) {\n\t\t\t$symbolic = 'c'; // Character special\n\t\t} elseif (($perms & 0x1000) == 0x1000) {\n\t\t\t$symbolic = 'p'; // FIFO pipe\n\t\t} else {\n\t\t\t$symbolic = 'u'; // Unknown\n\t\t}\n\t\t\n\t\t// Owner\n\t\t$symbolic .= (($perms & 0x0100) ? 'r' : '-');\n\t\t$symbolic .= (($perms & 0x0080) ? 'w' : '-');\n\t\t$symbolic .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x') : (($perms & 0x0800) ? 'S' : '-'));\n\t\t\n\t\t// Group\n\t\t$symbolic .= (($perms & 0x0020) ? 'r' : '-');\n\t\t$symbolic .= (($perms & 0x0010) ? 'w' : '-');\n\t\t$symbolic .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x') : (($perms & 0x0400) ? 'S' : '-'));\n\t\t\n\t\t// World\n\t\t$symbolic .= (($perms & 0x0004) ? 'r' : '-');\n\t\t$symbolic .= (($perms & 0x0002) ? 'w' : '-');\n\t\t$symbolic .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x') : (($perms & 0x0200) ? 'T' : '-'));\n\t\t\n\t\treturn $symbolic;\n\t}", "public function getExpectedFilePermission($file = '')\n {\n global $options;\n\n switch ($file) {\n default:\n if ($this->getComplex('xlite.suMode') == 0) {\n $mode = isset($options['filesystem_permissions']['nonprivileged_permission_file'])\n ? base_convert($options['filesystem_permissions']['nonprivileged_permission_file'], 8, 10)\n : 0644;\n\n } else {\n $mode = isset($options['filesystem_permissions']['privileged_permission_file'])\n ? base_convert($options['filesystem_permissions']['privileged_permission_file'], 8, 10)\n : 0600;\n }\n break;\n }\n\n return $mode;\n }", "public function getchmod($file)\n {\n }", "public function getchmod($file)\n {\n }", "public function getchmod($file)\n {\n }", "public function getchmod($file)\n {\n }", "public function getchmod($file)\n {\n }", "public function getPermissionNames()\n\t{\n\t\treturn $this->getPermissions(true, 'name');\n\t}", "public function fullPathInfo($path)\n\t{\n\t\t$abs_path = $this->resolve($path);\n\n\t\t\\clearstatcache();\n\n\t\t$ss = \\stat($abs_path);\n\n\t\tif (!$ss) {\n\t\t\treturn false;\n\t\t} // Couldn't stat file\n\n\t\t$ts = [\n\t\t\t0140000 => 'ssocket',\n\t\t\t0120000 => 'llink',\n\t\t\t0100000 => '-file',\n\t\t\t0060000 => 'bblock',\n\t\t\t0040000 => 'ddir',\n\t\t\t0020000 => 'cchar',\n\t\t\t0010000 => 'pfifo',\n\t\t];\n\n\t\t$p = $ss['mode'];\n\t\t$t = \\decoct($p & 0170000); // File Encoding Bit\n\n\t\t$str = (\\array_key_exists(\\octdec($t), $ts)) ? $ts[\\octdec($t)][0] : 'u';\n\t\t$str .= (($p & 0x0100) ? 'r' : '-') . (($p & 0x0080) ? 'w' : '-');\n\t\t$str .= (($p & 0x0040) ? (($p & 0x0800) ? 's' : 'x') : (($p & 0x0800) ? 'S' : '-'));\n\t\t$str .= (($p & 0x0020) ? 'r' : '-') . (($p & 0x0010) ? 'w' : '-');\n\t\t$str .= (($p & 0x0008) ? (($p & 0x0400) ? 's' : 'x') : (($p & 0x0400) ? 'S' : '-'));\n\t\t$str .= (($p & 0x0004) ? 'r' : '-') . (($p & 0x0002) ? 'w' : '-');\n\t\t$str .= (($p & 0x0001) ? (($p & 0x0200) ? 't' : 'x') : (($p & 0x0200) ? 'T' : '-'));\n\n\t\t$s = [\n\t\t\t'perms' => [\n\t\t\t\t'umask' => \\sprintf('%04o', \\umask()),\n\t\t\t\t'human' => $str,\n\t\t\t\t'octal1' => \\sprintf('%o', ($p & 000777)),\n\t\t\t\t'octal2' => \\sprintf('0%o', 0777 & $p),\n\t\t\t\t'decimal' => \\sprintf('%04o', $p),\n\t\t\t\t'fileperms' => \\fileperms($abs_path),\n\t\t\t\t'mode' => $p,\n\t\t\t],\n\n\t\t\t'owner' => [\n\t\t\t\t'fileowner' => $ss['uid'],\n\t\t\t\t'filegroup' => $ss['gid'],\n\t\t\t\t'owner' => (\\function_exists('posix_getpwuid')) ?\n\t\t\t\t\t\\posix_getpwuid($ss['uid']) : '',\n\t\t\t\t'group' => (\\function_exists('posix_getgrgid')) ?\n\t\t\t\t\t\\posix_getgrgid($ss['gid']) : '',\n\t\t\t],\n\n\t\t\t'file' => [\n\t\t\t\t'filename' => $abs_path,\n\t\t\t\t'realpath' => (\\realpath($abs_path) != $abs_path) ? \\realpath($abs_path) : '',\n\t\t\t\t'dirname' => \\dirname($abs_path),\n\t\t\t\t'basename' => \\basename($abs_path),\n\t\t\t],\n\n\t\t\t'filetype' => [\n\t\t\t\t'type' => \\substr($ts[\\octdec($t)], 1),\n\t\t\t\t'type_octal' => \\sprintf('%07o', \\octdec($t)),\n\t\t\t\t'is_file' => \\is_file($abs_path),\n\t\t\t\t'is_dir' => \\is_dir($abs_path),\n\t\t\t\t'is_link' => \\is_link($abs_path),\n\t\t\t\t'is_readable' => \\is_readable($abs_path),\n\t\t\t\t'is_writable' => \\is_writable($abs_path),\n\t\t\t\t'is_executable' => \\is_executable($abs_path),\n\t\t\t],\n\n\t\t\t'size' => [\n\t\t\t\t'size' => $ss['size'], //Size of file, in bytes.\n\t\t\t\t'blocks' => $ss['blocks'], //Number 512-byte blocks allocated\n\t\t\t\t'block_size' => $ss['blksize'], //Optimal block size for I/O.\n\t\t\t],\n\n\t\t\t'time' => [\n\t\t\t\t'mtime' => $ss['mtime'], //Time of last modification\n\t\t\t\t'atime' => $ss['atime'], //Time of last access\n\t\t\t\t'ctime' => $ss['ctime'], //Time of last status change\n\t\t\t],\n\t\t];\n\n\t\t$s['device'] = [\n\t\t\t'device' => $ss['dev'], // Device\n\t\t\t'device_number' => $ss['rdev'], // Device number, if device.\n\t\t\t'inode' => $ss['ino'], // File serial number\n\t\t\t'link_count' => $ss['nlink'], // link count\n\t\t\t'link_to' => ($ss['filetype']['type'] === 'link') ? \\readlink($abs_path) : '',\n\t\t];\n\n\t\t\\clearstatcache();\n\n\t\treturn $s;\n\t}", "public function getPermissions()\n {\n return $this->get(self::PERMISSIONS);\n }", "public function getDirectoryPermissionStatus()\n {\n $ok = true;\n try {\n $mageFile = new Varien_Io_File();\n $mageFile->checkAndCreateFolder(Mage::getBaseDir(Emv_Core_Helper_Data::BASE_CONTAINER));\n $mageFile->checkAndCreateFolder(\n Mage::getBaseDir(Emv_Core_Helper_Data::BASE_CONTAINER)\n . DS . Emv_Core_Helper_Data::BASE_WORKING_DIR\n );\n } catch (Exception $e) {\n $ok = false;\n }\n\n $message = '';\n if ($ok) {\n $image = $this->_getTickImageLink();\n $message = Mage::helper('emvcore')->__(\n '<span class=\"icon-status\">%s</span> Write permission is correctly set to <strong>%s</strong>.',\n $image,\n Mage::getBaseDir(Emv_Core_Helper_Data::BASE_CONTAINER)\n );\n } else {\n $image = $this->_getUnTickImageLink();\n $message = Mage::helper('emvcore')->__(\n '<span class=\"icon-status\">%s</span> Write permission is not correctly set to <strong>%s</strong>.',\n $image,\n Mage::getBaseDir(Emv_Core_Helper_Data::BASE_CONTAINER)\n );\n }\n return $message;\n }", "public function getPermissions() {}", "public function getPermissions() {}", "function sd_get_permissions($path) {\n\tglobal $sd_error_msg;\n\n\t$sd_min_level = 100;\n\n\t// get dirname of files\n\tif (!is_dir($path)) {\n\t\t$path = trailingslashit(dirname($path));\n\t\tif (!is_dir($path)) {\n\t\t\t$sd_error_msg = 'E:non-exist';\n\t\t\treturn $sd_min_level;\n\t\t}\n\t}\n\n\t$perm_file = $path . '.permissions.php';\n\tif (!file_exists($perm_file)) {\n\t\t$sd_error_msg = 'E:non-exist';\n\t\treturn $sd_min_level; // TODO: SD_DEFAULT_PERMISSIONS;\n\t}\n\n\t// read permissions file\n\tinclude($perm_file);\n\t\n\treturn $sd_min_level;\n}", "public static function unix_file_permissions($file)\n\t{\n\t\tif(!file_exists($file)) {\n\t\t\treturn false;\n\t\t}\n\t\t$perms = sprintf('%o', fileperms($file));\n\t\tif ( substr($perms, 0, 2) == '40' ) {\n\t\t\t$perms = substr($perms, 1, 4);\n\t\t} elseif ( substr($perms, 0, 2) == '10' ) {\n\t\t\t$perms = substr($perms, 2, 4);\n\t\t}\n\t\treturn $perms;\n\t}", "function get_required_permission()\n {\n return str_replace(array(' ', \"\\n\", \"\\t\"), '_', $this->object->name);\n }", "private function getPermissions(File $file): int\n {\n if ($file->isDir()) {\n return Permissions::DIRECTORY->get();\n }\n\n // Check if file is inside .git/objects directory\n if ($this->isGitObject($file->getPathname())) {\n return Permissions::FILE_PROTECTED->get();\n }\n\n // Check if file is inside .git/hooks directory\n if ($this->isGitHook($file->getPathname())) {\n return Permissions::EXECUTABLE->get();\n }\n\n // If file is special in the gitweb directory.\n if ($this->isGitWebConfigFile($file->getPathname())) {\n return Permissions::FILE->get();\n }\n\n // Check if file is executable shell script.\n if ($this->isExecutableScript($file)) {\n return Permissions::EXECUTABLE->get();\n }\n\n return Permissions::FILE->get();\n }", "static function getPermissionNames() {\n return static::getPermissions()->keys();\n }", "public function getPermissions() {\n\t\treturn $this->addressBookInfo['permissions'];\n\t}", "private function getSettingsPermissions() {\n $settings_permissions_read_only = TRUE;\n // http://en.wikipedia.org/wiki/File_system_permissions.\n $writes = array('2', '3', '6', '7');\n $settings_file = './' . DrupalKernel::findSitePath(\\Drupal::request(), TRUE) . '/settings.php';\n $permissions = Unicode::substr(sprintf('%o', fileperms($settings_file)), -4);\n\n foreach ($writes as $bit) {\n if (strpos($permissions, $bit)) {\n $settings_permissions_read_only = FALSE;\n break;\n }\n }\n\n return $settings_permissions_read_only;\n }", "public function & GetPermissions ();", "private function getPermission($folder)\n {\n return substr(sprintf('%o', fileperms(base_path($folder))), -4);\n }", "public function getPermissions();", "public function getFilePermissionsReturnsCorrectPermissionsForFilesNotOwnedByCurrentUser_dataProvider() {}", "public function getPermissionsAttribute()\n\t{\n\t\treturn unserialize($this->attributes['permissions']);\n\t}", "public function getFileMode()\n {\n if (isset($this->raw->chmod)) {\n return intval($this->raw->chmod, 8);\n }\n\n return null;\n }", "public function getPossiblePermissions();", "abstract public function getPermissions();", "public function permissions()\n {\n return $this->permissions;\n }", "abstract public function permission(): string;", "function chmod($file,$permission) \n {\n \t $cmd = \"CHMOD \" . decoct($permission) . \" \" . $file;\n return $this->sendCommand($cmd); \n }", "function permissions_get ()\n{\n\tstatic $perms = array (\n\t\t\t\"read\"\t\t=> 0x0001,\n\t\t\t\"create\"\t=> 0x0002,\n\t\t\t\"change\"\t=> 0x0004,\n\t\t\t\"delete\"\t=> 0x0008,\n\t\t\t\"password\"\t=> 0x0040,\n\t\t\t\"admin\"\t\t=> 0x8000,\t// admin\n\t\t\t);\n\treturn $perms;\n}", "public function getPerms()\r\n\t{\r\n\t\treturn $this->_perms;\r\n\t}", "public function getPermissionsFromFiles() : array\n {\n $path = base_path();\n $keys = [];\n $functions = [\n 'userCan',\n ];\n $pattern = // See http://regexr.com/392hu\n \"[^\\w|>]\" . // Must not have an alphanum or _ or > before real method\n \"(\" . implode('|', $functions) . \")\" . // Must start with one of the functions\n \"\\(\" . // Match opening parenthese\n \"[\\'\\\"]\" . // Match \" or '\n \"(\" . // Start a new group to match:\n // \"[a-zA-Z0-9_-]+\". // Must start with group\n \"([^\\1)]+)+\" . // Be followed by one or more items/keys\n \")\" . // Close group\n \"[\\'\\\"]\" . // Closing quote\n \"[\\),]\"; // Close parentheses or new parameter\n\n // Find all PHP + Twig files in the app folder, except for storage\n $finder = new Finder();\n $finder->in($path)->exclude('storage')->name('*.php')->name('*.twig')->files();\n\n /** @var \\Symfony\\Component\\Finder\\SplFileInfo $file */\n foreach ($finder as $file) {\n // Search the current file for the pattern\n if (preg_match_all(\"/$pattern/siU\", $file->getContents(), $matches)) {\n // Get all matches\n foreach ($matches[2] as $key) {\n $keys[] = $key;\n }\n }\n }\n\n // Remove duplicates\n $keys = array_unique($keys);\n\n $base_permissions = array_filter(explode(',', \\File::get(base_path('permissions.txt'))));\n\n return array_map('trim', array_merge($keys, $base_permissions));\n }", "public function getPermissions()\n {\n return $this->permissions;\n }", "public function getPermissions()\n {\n return $this->permissions;\n }", "public function getPermissions()\n {\n return $this->permissions;\n }", "protected function getPermission($folder)\n {\n return substr(sprintf('%o', fileperms(base_path($folder))), -4);\n }", "public function permissioned() {\r\n $url = Url::fromUri('internal:/examples/menu-example/permissioned/controlled');\r\n $link = Link::fromTextAndUrl($this->t('examples/menu-example/permissioned/controlled'), $url)->toString();\r\n return [\r\n '#markup' => $this->t('A menu item that requires the \"access protected menu example\" permission is at @link', ['@link' => $link]),\r\n ];\r\n }", "public static function octal($path)\n {\n // Return the file permissions in octal format\n return (int) substr(sprintf('%o', fileperms($path)), -3);\n }", "private function _makeDirPermissions($permissions) {\r\n\t\t$permissions = (string) $permissions;\r\n\t\t\r\n\t\t// going through (user, group, world)\r\n\t\tfor ( $i = 0; $i < strlen($permissions); $i++ ) {\r\n\t\t\t// Read permission is set but execute not yet\r\n\t\t\tif ( (int) $permissions{$i} & 4 and !((int) $permissions{$i} & 1) ) {\r\n\t\t\t\t// Adding execute flag\r\n\t\t\t\t(int) $permissions{$i} = (int) $permissions{$i} + 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn (string) $permissions;\r\n\t}\r\n\r\n\t/**\r\n\t * This will return the last modification-time of a file. You can either give\r\n\t * this function a relative or an absolute path to the file to check.\r\n\t * NOTE: Some servers will not support this feature and the function works\r\n\t * only on files, not directories! When successful,\r\n\t * it will return the last modification-time as a unix-timestamp or, when\r\n\t * $format is specified, a preformated timestring.\r\n\t *\r\n\t * @param string $file The file to check\r\n\t * @param string $format (optional) The format to give the date back \r\n\t * if not set, it will return a Unix timestamp\r\n\t *\r\n\t * @access public\r\n\t * @return mixed Unix timestamp, a preformated date-string\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction mdtm($file, $format = null) {\r\n\t\t$file = $this->_constructPath($file);\r\n\t\tif ( $this->_checkRemoteDir($file) !== false ) {\r\n\t\t\tthrow new ftpMdtmException(\"Filename '$file' seems to be a directory.\");\r\n\t\t}\r\n\t\t$res = @ftp_mdtm($this->_handle, $file);\r\n\t\tif ( $res == -1 ) {\r\n\t\t\tthrow new ftpMdtmException(\"Could not get last-modification-date of '\" . $file . \"'.\");\r\n\t\t}\r\n\t\tif ( $format !== null ) {\r\n\t\t\t$res = date($format, $res);\r\n\t\t\tif ( !$res ) {\r\n\t\t\t\tthrow new ftpMdtmException(\"Date-format failed on timestamp '\" . $res . \"'.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $res;\r\n\t}\r\n\r\n\t/**\r\n\t * This will return the size of a given file in bytes. You can either give this\r\n\t * function a relative or an absolute file-path. NOTE: Some servers do not\r\n\t * support this feature!\r\n\t *\r\n\t * @param string $file The file to check\r\n\t *\r\n\t * @access public\r\n\t * @return mixed Size in bytes\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction size($file) {\r\n\t\t$file = $this->_constructPath($file);\r\n\t\t$res = @ftp_size($this->_handle, $file);\r\n\t\tif ( $res == -1 ) {\r\n\t\t\tthrow new ftpSizeException($file);\r\n\t\t} else {\r\n\t\t\treturn $res;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This method returns a directory-list of the current directory or given one.\r\n\t * To display the current selected directory, simply set the first parameter to\r\n\t * null\r\n\t * or leave it blank, if you do not want to use any other parameters.\r\n\t * <br><br>\r\n\t * There are 4 different modes of listing directories. Either to list only\r\n\t * the files (using ftpClient::LS_MODE_FILES_ONLY), to list only directories\r\n\t * (using ftpClient::LS_MODE_DIRS_ONLY) or to show both (using\r\n\t * ftpClient::LS_MODE_DIRS_FILES, which is default).\r\n\t * <br><br>\r\n\t * The 4th one is the ftpClient::LS_MODE_RAW_LIST, which returns just the array\r\n\t * created by the ftp_rawlist() - function built into PHP.\r\n\t * <br><br>\r\n\t * The other function-modes will return an array containing the requested data.\r\n\t * The files and dirs are listed in human-sorted order, but if you select\r\n\t * ftpClient::LS_MODE_DIRS_FILES the directories will be added above the files,\r\n\t * although both sorted.\r\n\t * <br><br>\r\n\t * All elements in the arrays are associative arrays themselves. They have the\r\n\t * following structure:\r\n\t * <br><br>\r\n\t * Dirs:<br>\r\n\t * [\"name\"] => string The name of the directory<br>\r\n\t * [\"rights\"] => string The rights of the directory (in style\r\n\t * \"rwxr-xr-x\")<br>\r\n\t * [\"user\"] => string The owner of the directory<br>\r\n\t * [\"group\"] => string The group-owner of the directory<br>\r\n\t * [\"files_inside\"]=> string The number of files/dirs inside the\r\n\t * directory excluding \".\" and \"..\"<br>\r\n\t * [\"date\"] => int The creation-date as Unix timestamp<br>\r\n\t * [\"is_dir\"] => bool true, cause this is a dir<br>\r\n\t * <br><br>\r\n\t * Files:<br>\r\n\t * [\"name\"] => string The name of the file<br>\r\n\t * [\"size\"] => int Size in bytes<br>\r\n\t * [\"rights\"] => string The rights of the file (in style \r\n\t * \"rwxr-xr-x\")<br>\r\n\t * [\"user\"] => string The owner of the file<br>\r\n\t * [\"group\"] => string The group-owner of the file<br>\r\n\t * [\"date\"] => int The creation-date as Unix timestamp<br>\r\n\t * [\"is_dir\"] => bool false, cause this is a file<br>\r\n\t *\r\n\t * @param string $dir (optional) The directory to list or null for current\r\n\t * @param int $mode (optional) List files, dirs or both.\r\n\t *\r\n\t * @access public\r\n\t * @return mixed The directory list as described above\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction ls($dir = null, $mode = self::LS_MODE_DIRS_FILES) {\r\n\t\tif ( $dir === null ) {\r\n\t\t\t$dir = $this->pwd();\r\n\t\t}\r\n\t\tif ( ($mode != self::LS_MODE_FILES_ONLY) && ($mode != self::LS_MODE_DIR_ONLY) && ($mode != self::LS_MODE_RAWLIST) ) {\r\n\t\t\t$mode = self::LS_MODE_DIRS_FILES;\r\n\t\t}\r\n\t\t\r\n\t\tswitch ( $mode ) {\r\n\t\t\tcase self::LS_MODE_DIRS_FILES :\r\n\t\t\t\t$res = $this->_lsBoth($dir);\r\n\t\t\t\tbreak;\r\n\t\t\tcase self::LS_MODE_DIR_ONLY :\r\n\t\t\t\t$res = $this->_lsDirs($dir);\r\n\t\t\t\tbreak;\r\n\t\t\tcase self::LS_MODE_FILES_ONLY :\r\n\t\t\t\t$res = $this->_lsFiles($dir);\r\n\t\t\t\tbreak;\r\n\t\t\tcase self::LS_MODE_RAWLIST :\r\n\t\t\t\t$res = @ftp_rawlist($this->_handle, $dir);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn $res;\r\n\t}\r\n\r\n\t/**\r\n\t * This method will delete the given file or directory ($path) from the server\r\n\t * (maybe recursive).\r\n\t *\r\n\t * Whether the given string is a file or directory is only determined by the\r\n\t * last sign inside the string (\"/\" or not).\r\n\t *\r\n\t * If you specify a directory, you can optionally specify $recursive as true,\r\n\t * to let the directory be deleted recursive (with all sub-directories and files\r\n\t * inherited).\r\n\t *\r\n\t * You can either give a absolute or relative path for the file / dir. If you\r\n\t * choose to use the relative path, it will be automatically completed with the\r\n\t * actual selected directory.\r\n\t *\r\n\t * @param string $path The absolute or relative path to the file/directory.\r\n\t * @param bool $recursive Recursively delete everything in $path\r\n\t * @param bool $filesonly Only delete the files, leaving directories\r\n\t *\r\n\t * @access public\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction rm($path, $recursive = false, $filesonly = false) {\r\n\t\t$path = $this->_constructPath($path);\r\n\t\tif ( $this->_checkRemoteDir($path) === true ) {\r\n\t\t\tif ( $recursive ) {\r\n\t\t\t\treturn $this->_rmDirRecursive($path, $filesonly);\r\n\t\t\t} else {\r\n\t\t\t\treturn $this->_rmDir($path);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn $this->_rmFile($path);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This function will download a file from the ftp-server.\r\n\t * \r\n\t * You can either specify an absolute path to the file (beginning with \"/\") or\r\n\t * a relative one, which will be completed with the actual directory you\r\n\t * selected on the server. You can specify the path to which the file will be\r\n\t * downloaded on the local machine, if the file should be overwritten if it\r\n\t * exists (optionally, default is no overwriting) and in which mode (FTP_ASCII\r\n\t * or FTP_BINARY) the file should be downloaded (if you do not specify this,\r\n\t * the method tries to determine it automatically from the mode-directory or\r\n\t * uses the default-mode, set by you).\r\n\t * \r\n\t * If you give a relative path to the local-file, the script-path is used as\r\n\t * basepath.\r\n\t *\r\n\t * @param string $remote_file The absolute or relative path to the file\r\n\t * @param string $local_file The local file to put the downloaded in\r\n\t * @param bool $overwrite (optional) Whether to overwrite existing file\r\n\t * @param int $mode (optional) Either FTP_ASCII or FTP_BINARY\r\n\t *\r\n\t * @access public\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction get($remote_file, $local_file, $overwrite = false, $mode = null) {\r\n\t\tif ( $mode === null ) {\r\n\t\t\t$mode = $this->checkFileExtension($remote_file);\r\n\t\t}\r\n\t\t\r\n\t\t$remote_file = $this->_constructPath($remote_file);\r\n\t\t\r\n\t\tif ( @file_exists($local_file) && !$overwrite ) {\r\n\t\t\tthrow new ftpGetLocalFileExistsException($local_file);\r\n\t\t}\r\n\t\tif ( @file_exists($local_file) && !@is_writeable($local_file) && $overwrite ) {\r\n\t\t\tthrow new ftpGetLocalFileNotWritableException($local_file);\r\n\t\t}\r\n\t\t\r\n\t\tif ( @function_exists('ftp_nb_get') ) {\r\n\t\t\t$res = @ftp_nb_get($this->_handle, $local_file, $remote_file, $mode);\r\n\t\t\twhile ( $res == FTP_MOREDATA ) {\r\n\t\t\t\t$this->notify('nb_get');\r\n\t\t\t\t$res = @ftp_nb_continue($this->_handle);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$res = @ftp_get($this->_handle, $local_file, $remote_file, $mode);\r\n\t\t}\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpGetException(\"File '\" . $remote_file . \"' could not be downloaded to '$local_file'.\");\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This function will upload a file to the ftp-server.\r\n\t * \r\n\t * You can either specify a absolute path to the remote-file (beginning with \"/\")\r\n\t * or a relative one, which will be completed with the actual directory you\r\n\t * selected on the server. You can specify the path from which the file will be\r\n\t * uploaded on the local maschine, if the file should be overwritten if it exists\r\n\t * (optionally, default is no overwriting) and in which mode (FTP_ASCII or\r\n\t * FTP_BINARY) the file should be downloaded (if you do not specify this, the\r\n\t * method tries to determine it automatically from the mode-directory or uses the\r\n\t * default-mode, set by you).\r\n\t * \r\n\t * If you give a relative path to the local-file, the script-path is used as\r\n\t * basepath.\r\n\t *\r\n\t * @param string $local_file The local file to upload\r\n\t * @param string $remote_file The absolute or relative path to the file to upload to\r\n\t * @param bool $overwrite (optional) Whether to overwrite existing file\r\n\t * @param int $mode (optional) Either FTP_ASCII or FTP_BINARY\r\n\t * @param int $options (optional) ftpClient::(PUT_BLOCKING | PUT_NONBLOCKING)\r\n\t *\r\n\t * @access public\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction put($local_file, $remote_file, $overwrite = false, $mode = null, $options = 0) {\r\n\t\tif ( $options & (self::PUT_BLOCKING | self::PUT_NONBLOCKING) === (self::PUT_BLOCKING | self::PUT_NONBLOCKING) ) {\r\n\t\t\tthrow new ftpPutOptionsException();\r\n\t\t}\r\n\t\t\r\n\t\t$usenb = !($options & (self::PUT_BLOCKING == self::PUT_BLOCKING));\r\n\t\t\r\n\t\tif ( !isset($mode) ) {\r\n\t\t\t$mode = $this->checkFileExtension($local_file);\r\n\t\t}\r\n\t\t$remote_file = $this->_constructPath($remote_file);\r\n\t\t\r\n\t\tif ( !@file_exists($local_file) ) {\r\n\t\t\tthrow new ftpPutLocalFileDoesNotExistException($local_file);\r\n\t\t}\r\n\t\tif ( (@ftp_size($this->_handle, $remote_file) != -1) && !$overwrite ) {\r\n\t\t\tthrow new ftpPutRemoteFileExistsNoOverwriteException($remote_file);\r\n\t\t}\r\n\t\t\r\n\t\tif ( function_exists('ftp_alloc') ) {\r\n\t\t\tftp_alloc($this->_handle, filesize($local_file));\r\n\t\t}\r\n\t\tif ( $usenb && function_exists('ftp_nb_put') ) {\r\n\t\t\t$res = @ftp_nb_put($this->_handle, $remote_file, $local_file, $mode);\r\n\t\t\twhile ( $res == FTP_MOREDATA ) {\r\n\t\t\t\t$this->notify('nb_put');\r\n\t\t\t\t$res = @ftp_nb_continue($this->_handle);\r\n\t\t\t}\r\n\t\t\r\n\t\t} else {\r\n\t\t\t$res = @ftp_put($this->_handle, $remote_file, $local_file, $mode);\r\n\t\t}\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpPutException(\"File '$local_file' could not be uploaded to '\" . $remote_file . \"'.\");\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This functionality allows you to transfer a whole directory-structure from\r\n\t * the remote-ftp to your local host. You have to give a remote-directory\r\n\t * (ending with '/') and the local directory (ending with '/') where to put the\r\n\t * files you download.\r\n\t * The remote path is automatically completed with the current-remote-dir, if\r\n\t * you give a relative path to this function. You can give a relative path for\r\n\t * the $local_path, too. Then the script-basedir will be used for comletion of\r\n\t * the path.\r\n\t * The parameter $overwrite will determine, whether to overwrite existing files\r\n\t * or not. Standard for this is false. Fourth you can explicitly set a mode for\r\n\t * all transfer actions done. If you do not set this, the method tries to\r\n\t * determine the transfer mode by checking your mode-directory for the file\r\n\t * extension. If the extension is not inside the mode-directory, it will get\r\n\t * your default mode.\r\n\t * \r\n\t * Since 1.4 no error will be returned when a file exists while $overwrite is \r\n\t * set to false. \r\n\t *\r\n\t * @param string $remote_path The path to download\r\n\t * @param string $local_path The path to download to\r\n\t * @param bool $overwrite (optional) Whether to overwrite existing files\r\n\t * (true) or not (false, standard).\r\n\t * @param int $mode (optional) The transfermode (either FTP_ASCII or\r\n\t * FTP_BINARY).\r\n\t *\r\n\t * @access public\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction getRecursive($remote_path, $local_path, $overwrite = false, $mode = null) {\r\n\t\t$remote_path = $this->_constructPath($remote_path);\r\n\t\tif ( $this->_checkRemoteDir($remote_path) !== true ) {\r\n\t\t\tthrow new ftpGetRecursiveException(\"Given remote-path '$remote_path' seems not to be a directory.\");\r\n\t\t}\r\n\t\t\r\n\t\tif ( !@file_exists($local_path) ) {\r\n\t\t\t$res = @mkdir($local_path);\r\n\t\t\tif ( !$res ) {\r\n\t\t\t\tthrow new ftpGetRecursiveException(\"Could not create dir '$local_path'\");\r\n\t\t\t}\r\n\t\t} elseif ( !@is_dir($local_path) ) {\r\n\t\t\tthrow new ftpGetRecursiveException(\"Given local-path '$local_path' seems not to be a directory.\");\r\n\t\t}\r\n\t\t\r\n\t\t$dir_list = array();\r\n\t\t$dir_list = $this->ls($remote_path, self::LS_MODE_DIR_ONLY);\r\n\t\t\r\n\t\tforeach ( $dir_list as $dir_entry ) {\r\n\t\t\tif ( $dir_entry['name'] != '.' && $dir_entry['name'] != '..' ) {\r\n\t\t\t\t$remote_path_new = $remote_path . $dir_entry[\"name\"] . \"/\";\r\n\t\t\t\t$local_path_new = $local_path . $dir_entry[\"name\"] . \"/\";\r\n\t\t\t\t$result = $this->getRecursive($remote_path_new, $local_path_new, $overwrite, $mode);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$file_list = array();\r\n\t\t$file_list = $this->ls($remote_path, self::LS_MODE_FILES_ONLY);\r\n\t\t\r\n\t\tforeach ( $file_list as $file_entry ) {\r\n\t\t\t$remote_file = $remote_path . $file_entry[\"name\"];\r\n\t\t\t$local_file = $local_path . $file_entry[\"name\"];\r\n\t\t\t$result = $this->get($remote_file, $local_file, $overwrite, $mode);\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * This functionality allows you to transfer a whole directory-structure from\r\n\t * your local host to the remote-ftp. You have to give a remote-directory\r\n\t * (ending with '/') and the local directory (ending with '/') where to put the\r\n\t * files you download. The remote path is automatically completed with the\r\n\t * current-remote-dir, if you give a relative path to this function. You can\r\n\t * give a relative path for the $local_path, too. Then the script-basedir will\r\n\t * be used for comletion of the path.\r\n\t * The parameter $overwrite will determine, whether to overwrite existing files\r\n\t * or not.\r\n\t * Standard for this is false. Fourth you can explicitly set a mode for all\r\n\t * transfer actions done. If you do not set this, the method tries to determine\r\n\t * the transfer mode by checking your mode-directory for the file-extension. If\r\n\t * the extension is not inside the mode-directory, it will get your default\r\n\t * mode.\r\n\t *\r\n\t * @param string $local_path The path to download to\r\n\t * @param string $remote_path The path to download\r\n\t * @param bool $overwrite (optional) Whether to overwrite existing files\r\n\t * (true) or not (false, standard).\r\n\t * @param int $mode (optional) The transfermode (either FTP_ASCII or\r\n\t * FTP_BINARY).\r\n\t *\r\n\t * @access public\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction putRecursive($local_path, $remote_path, $overwrite = false, $mode = null) {\r\n\t\t$remote_path = $this->_constructPath($remote_path);\r\n\t\tif ( !file_exists($local_path) || !is_dir($local_path) ) {\r\n\t\t\tthrow new ftpPutRecursiveException(\"Given local-path '$local_path' seems not to be a directory.\");\r\n\t\t}\r\n\t\t// try to create directory if it doesn't exist\r\n\t\t$old_path = $this->pwd();\r\n\t\ttry {\r\n\t\t\t$this->cd($remote_path);\r\n\t\t} catch ( ftpException $e ) {\r\n\t\t\t$res = $this->mkdir($remote_path);\r\n\t\t}\r\n\t\t\r\n\t\t$this->cd($old_path);\r\n\t\tif ( $this->_checkRemoteDir($remote_path) !== true ) {\r\n\t\t\tthrow new ftpPutRecursiveException(\"Given remote-path '$remote_path' seems not to be a directory.\");\r\n\t\t}\r\n\t\t$dir_list = $this->_lsLocal($local_path);\r\n\t\tforeach ( $dir_list[\"dirs\"] as $dir_entry ) {\r\n\t\t\t// local directories do not have arrays as entry\r\n\t\t\t$remote_path_new = $remote_path . $dir_entry . \"/\";\r\n\t\t\t$local_path_new = $local_path . $dir_entry . \"/\";\r\n\t\t\t$result = $this->putRecursive($local_path_new, $remote_path_new, $overwrite, $mode);\r\n\t\t}\r\n\t\t\r\n\t\tforeach ( $dir_list[\"files\"] as $file_entry ) {\r\n\t\t\t$remote_file = $remote_path . $file_entry;\r\n\t\t\t$local_file = $local_path . $file_entry;\r\n\t\t\t$result = $this->put($local_file, $remote_file, $overwrite, $mode);\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * This checks, whether a file should be transfered in ascii- or binary-mode\r\n\t * by it's file-extension. If the file-extension is not set or\r\n\t * the extension is not inside one of the extension-dirs, the actual set\r\n\t * transfer-mode is returned.\r\n\t *\r\n\t * @param string $filename The filename to be checked\r\n\t *\r\n\t * @access public\r\n\t * @return int Either FTP_ASCII or FTP_BINARY\r\n\t */\r\n\tfunction checkFileExtension($filename) {\r\n\t\tif ( ($pos = strrpos($filename, '.')) === false ) {\r\n\t\t\treturn $this->getMode();\r\n\t\t} else {\r\n\t\t\t$ext = substr($filename, $pos + 1);\r\n\t\t}\r\n\t\t\r\n\t\tif ( isset($this->_file_extensions[$ext]) ) {\r\n\t\t\treturn $this->_file_extensions[$ext];\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->getMode();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the baseOptionsSet object\r\n\t *\r\n\t * @return baseOptionsSet\r\n\t */\r\n\tfunction getOptionsSet() {\r\n\t\tif ( !$this->_OptionsSet instanceof baseOptionsSet ) {\r\n\t\t\t$this->_OptionsSet = new baseOptionsSet();\r\n\t\t}\r\n\t\treturn $this->_OptionsSet;\r\n\t}\r\n\r\n\t/**\r\n\t * Set a new options set object over the current one\r\n\t *\r\n\t * @param baseOptionsSet $inOptionsSet\r\n\t * @return ftpClient\r\n\t */\r\n\tfunction setOptionsSet($inOptionsSet) {\r\n\t\tif ( $inOptionsSet !== $this->_OptionsSet ) {\r\n\t\t\t$this->_OptionsSet = $inOptionsSet;\r\n\t\t}\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the hostname\r\n\t *\r\n\t * @param string $host The hostname to set\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setHostname($host) {\r\n\t\tif ( !is_string($host) ) {\r\n\t\t\tthrow new ftpException(\"Hostname must be a string\");\r\n\t\t}\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_HOSTNAME => $host));\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the Port\r\n\t *\r\n\t * @param int $port The port to set\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setPort($port) {\r\n\t\tif ( !is_int($port) || ($port < 0) || ($port > 65535) ) {\r\n\t\t\tthrow new ftpException(\"Invalid port. Has to be integer > 0\");\r\n\t\t}\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_PORT => $port));\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the Username\r\n\t *\r\n\t * @param string $user The username to set\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setUsername($user) {\r\n\t\tif ( empty($user) || !is_string($user) ) {\r\n\t\t\tthrow new ftpException(\"Username $user invalid\");\r\n\t\t}\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_USERNAME => $user));\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the password\r\n\t *\r\n\t * @param string $password The password to set\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setPassword($password) {\r\n\t\tif ( empty($password) || !is_string($password) ) {\r\n\t\t\tthrow new ftpException(\"Password cannot be empty\");\r\n\t\t}\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_PASSWORD => $password));\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the transfer-mode. You can use the predefined constants\r\n\t * FTP_ASCII or FTP_BINARY. The mode will be stored for any further transfers.\r\n\t *\r\n\t * @param int $mode The mode to set\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setMode($mode) {\r\n\t\tif ( ($mode == FTP_ASCII) || ($mode == FTP_BINARY) ) {\r\n\t\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_TRANSFER_MODE => $mode));\r\n\t\t\treturn $this;\r\n\t\t} else {\r\n\t\t\tthrow new ftpException('FTP-Mode has either to be FTP_ASCII or FTP_BINARY');\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Set the transfer-method to passive mode\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t */\r\n\tfunction setPassive() {\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_TRANSFER_METHOD => self::TRANSFER_METHOD_PASSIVE));\r\n\t\t@ftp_pasv($this->_handle, true);\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the transfer-method to active mode\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t */\r\n\tfunction setActive() {\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_TRANSFER_METHOD => self::TRANSFER_METHOD_ACTIVE));\r\n\t\t@ftp_pasv($this->_handle, false);\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the timeout for FTP operations\r\n\t *\r\n\t * Use this method to set a timeout for FTP operation. Timeout has to be an\r\n\t * integer.\r\n\t *\r\n\t * @param int $timeout the timeout to use\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setTimeout($timeout = 0) {\r\n\t\tif ( !is_int($timeout) || ($timeout < 0) ) {\r\n\t\t\tthrow new ftpException('Timeout '.$timeout.' is invalid, has to be an integer >= 0');\r\n\t\t}\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_TIMEOUT => $timeout));\r\n\t\tif ( isset($this->_handle) && is_resource($this->_handle) ) {\r\n\t\t\t$res = @ftp_set_option($this->_handle, FTP_TIMEOUT_SEC, $timeout);\r\n\t\t} else {\r\n\t\t\t$res = true;\r\n\t\t}\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpException(\"Set timeout failed.\");\r\n\t\t}\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Adds an extension to a mode-directory\r\n\t *\r\n\t * The mode-directory saves file-extensions coresponding to filetypes\r\n\t * (ascii e.g.: 'php', 'txt', 'htm',...; binary e.g.: 'jpg', 'gif', 'exe',...).\r\n\t * The extensions have to be saved without the '.'. And\r\n\t * can be predefined in an external file (see: getExtensionsFile()).\r\n\t *\r\n\t * The array is build like this: 'php' => FTP_ASCII, 'png' => FTP_BINARY\r\n\t *\r\n\t * To change the mode of an extension, just add it again with the new mode!\r\n\t *\r\n\t * @param int $mode Either FTP_ASCII or FTP_BINARY\r\n\t * @param string $ext Extension\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t */\r\n\tfunction addExtension($mode, $ext) {\r\n\t\t$this->_file_extensions[$ext] = $mode;\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * This function removes an extension from the mode-directories \r\n\t * (described above).\r\n\t *\r\n\t * @param string $ext The extension to remove\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t */\r\n\tfunction removeExtension($ext) {\r\n\t\tif ( isset($this->_file_extensions[$ext]) ) {\r\n\t\t\tunset($this->_file_extensions[$ext]);\r\n\t\t}\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * This get's both (ascii- and binary-mode-directories) from the given file.\r\n\t * Beware, if you read a file into the mode-directory, all former set values \r\n\t * will be unset!\r\n\t * \r\n\t * Example file contents:\r\n\t * [ASCII]\r\n\t * asc = 0\r\n\t * txt = 0\r\n\t * [BINARY]\r\n\t * bin = 1\r\n\t * jpg = 1\r\n\t *\r\n\t * @param string $filename The file to get from\r\n\t *\r\n\t * @access public\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction getExtensionsFile($filename) {\r\n\t\tif ( !file_exists($filename) ) {\r\n\t\t\tthrow new ftpException(\"Extensions-file '$filename' does not exist\");\r\n\t\t}\r\n\t\tif ( !is_readable($filename) ) {\r\n\t\t\tthrow new ftpException(\"Extensions-file '$filename' is not readable\");\r\n\t\t}\r\n\t\t\r\n\t\t$exts = @parse_ini_file($filename, true);\r\n\t\tif ( !is_array($exts) ) {\r\n\t\t\tthrow new ftpException(\"Extensions-file '$filename' could not be loaded\");\r\n\t\t}\r\n\t\t\r\n\t\t$this->_file_extensions = array();\r\n\t\t\r\n\t\tif ( isset($exts['ASCII']) ) {\r\n\t\t\tforeach ( $exts['ASCII'] as $ext => $bogus ) {\r\n\t\t\t\t$this->_file_extensions[$ext] = FTP_ASCII;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ( isset($exts['BINARY']) ) {\r\n\t\t\tforeach ( $exts['BINARY'] as $ext => $bogus ) {\r\n\t\t\t\t$this->_file_extensions[$ext] = FTP_BINARY;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the hostname\r\n\t *\r\n\t * @access public\r\n\t * @return string The hostname\r\n\t */\r\n\tfunction getHostname() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_HOSTNAME);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the port\r\n\t *\r\n\t * @access public\r\n\t * @return int The port\r\n\t */\r\n\tfunction getPort() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_PORT, 21);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the username\r\n\t *\r\n\t * @access public\r\n\t * @return string The username\r\n\t */\r\n\tfunction getUsername() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_USERNAME);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the password\r\n\t *\r\n\t * @access public\r\n\t * @return string The password\r\n\t */\r\n\tfunction getPassword() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_PASSWORD);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the transfermode, default FTP_ASCII\r\n\t *\r\n\t * @access public\r\n\t * @return int The transfermode, either FTP_ASCII or FTP_BINARY.\r\n\t */\r\n\tfunction getMode() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_TRANSFER_MODE, FTP_ASCII);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns, whether the connection is set to passive mode or not\r\n\t *\r\n\t * @access public\r\n\t * @return bool True if passive, false if active mode\r\n\t */\r\n\tfunction isPassive() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_TRANSFER_METHOD, self::TRANSFER_METHOD_PASSIVE);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the mode set for a file-extension\r\n\t *\r\n\t * @param string $ext The extension you wanna ask for\r\n\t *\r\n\t * @return int Either FTP_ASCII, FTP_BINARY or NULL (if not set a mode for it)\r\n\t * @access public\r\n\t */\r\n\tfunction getExtensionMode($ext) {\r\n\t\tif ( array_key_exists($ext, $this->_file_extensions) ) {\r\n\t\t\treturn $this->_file_extensions[$ext];\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the current timeout value, defaulting to 20 seconds\r\n\t *\r\n\t * @return integer\r\n\t */\r\n\tfunction getTimeoutOption() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_TIMEOUT, 20);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the actual timeout set on the current connection.\r\n\t *\r\n\t * @access public\r\n\t * @return int The actual timeout\r\n\t */\r\n\tfunction getTimeout() {\r\n\t\treturn ftp_get_option($this->_handle, FTP_TIMEOUT_SEC);\r\n\t}\r\n\r\n\t/**\r\n\t * Adds a ftpClientObserver instance to the list of observers \r\n\t * that are listening for messages emitted by this Net_FTP instance.\r\n\t *\r\n\t * @param ftpClientObserver $observer\r\n\t * @return boolean True if the observer is successfully attached.\r\n\t * @access public\r\n\t */\r\n\tfunction attach(ftpClientObserver $observer) {\r\n\t\t$this->_listeners[$observer->getId()] = $observer;\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Removes a ftpClientObserver instance from the list of observers.\r\n\t *\r\n\t * @param ftpClientObserver $observer\r\n\t * @return boolean True if the observer is successfully detached.\r\n\t * @access public\r\n\t */\r\n\tfunction detach(ftpClientObserver $observer) {\r\n\t\tif ( !isset($this->_listeners[$observer->getId()]) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tunset($this->_listeners[$observer->getId()]);\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t/**\r\n\t * Returns true if $observer is a currently attached listener \r\n\t *\r\n\t * @param ftpClientObserver $observer\r\n\t * @return boolean\r\n\t */\r\n\tfunction isAttached(ftpClientObserver $observer) {\r\n\t\tif ( isset($this->_listeners[$observer->getId()]) ) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/**\r\n\t * Informs each registered observer instance that a new message has been\r\n\t * sent. \r\n\t * \r\n\t * @param mixed $event A hash describing the net event.\r\n\t * @return void\r\n\t */\r\n\tfunction notify($event) {\r\n\t\tif ( count($this->_listeners) > 0 ) {\r\n\t\t\tif ( false ) $listener = new ftpClientObserver();\r\n\t\t\tforeach ( $this->_listeners as $id => $listener ) {\r\n\t\t\t\t$listener->notify($event);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t/**\r\n\t * Sets the directory listing matcher\r\n\t *\r\n\t * Use this method to set the directory listing matcher to a specific pattern.\r\n\t * Indicate the pattern as a perl regular expression and give an array\r\n\t * containing as keys the fields selected in the regular expression and as\r\n\t * values the offset of the subpattern in the pattern.\r\n\t *\r\n\t * Example:\r\n\t * $pattern = '/(?:(d)|.)([rwxt-]+)\\s+(\\w+)\\s+([\\w\\d-]+)\\s+([\\w\\d-]+)\\s+(\\w+)\r\n\t * \\s+(\\S+\\s+\\S+\\s+\\S+)\\s+(.+)/',\r\n\t * $matchmap = array(\r\n\t * 'is_dir' => 1,\r\n\t * 'rights' => 2,\r\n\t * 'files_inside' => 3,\r\n\t * 'user' => 4,\r\n\t * 'group' => 5,\r\n\t * 'size' => 6,\r\n\t * 'date' => 7,\r\n\t * 'name' => 8,\r\n\t * )\r\n\t *\r\n\t * Make sure at least the is_dir and name keys are set. The is_dir key should\r\n\t * point to a subpattern that is empty for non-directories and non-empty\r\n\t * for directories.\r\n\t *\r\n\t * @param string $pattern The new matcher pattern to use\r\n\t * @param array $matchmap An mapping from key to subpattern offset\r\n\t *\r\n\t * @access public\r\n\t * @return ftpClient\r\n\t * @throws ftpException\r\n\t */\r\n\tfunction setDirMatcher($pattern, $matchmap) {\r\n\t\tif ( !is_string($pattern) ) {\r\n\t\t\tthrow new ftpException('The supplied pattern is not a string');\r\n\t\t}\r\n\t\tif ( !is_array($matchmap) ) {\r\n\t\t\tthrow new ftpException('The supplied matchmap pattern is not an array');\r\n\t\t} else {\r\n\t\t\tforeach ( $matchmap as $val ) {\r\n\t\t\t\tif ( !is_numeric($val) ) {\r\n\t\t\t\t\tthrow new ftpException('The supplied pattern contains invalid value ' . $val);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$this->_matcher = array('pattern' => $pattern, 'map' => $matchmap);\r\n\t\treturn $this;\r\n\t}\r\n\r\n\t/**\r\n\t * Rebuild the path, if given relative\r\n\t *\r\n\t * This method will make a relative path absolute by prepending the current\r\n\t * remote directory in front of it.\r\n\t *\r\n\t * @param string $path The path to check and construct\r\n\t *\r\n\t * @access private\r\n\t * @return string The build path\r\n\t */\r\n\tprivate function _constructPath($path) {\r\n\t\tif ( (substr($path, 0, 1) != '/') && (substr($path, 0, 2) != './') ) {\r\n\t\t\t$actual_dir = @ftp_pwd($this->_handle);\r\n\t\t\tif ( substr($actual_dir, -1) != '/' ) {\r\n\t\t\t\t$actual_dir .= '/';\r\n\t\t\t}\r\n\t\t\t$path = $actual_dir . $path;\r\n\t\t}\r\n\t\treturn $path;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks whether the given path is a remote directory by trying to\r\n\t * chdir() into it (and back out)\r\n\t *\r\n\t * @param string $path Path to check\r\n\t *\r\n\t * @access private\r\n\t * @return mixed True if $path is a directory\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _checkRemoteDir($path) {\r\n\t\t$pwd = $this->pwd();\r\n\t\t$res = $this->cd($path);\r\n\t\t$this->cd($pwd);\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * This will remove a file\r\n\t *\r\n\t * @param string $file The file to delete\r\n\t *\r\n\t * @access private\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _rmFile($file) {\r\n\t\tif ( substr($file, 0, 1) != \"/\" ) {\r\n\t\t\t$actual_dir = @ftp_pwd($this->_handle);\r\n\t\t\tif ( substr($actual_dir, (strlen($actual_dir) - 2), 1) != \"/\" ) {\r\n\t\t\t\t$actual_dir .= \"/\";\r\n\t\t\t}\r\n\t\t\t$file = $actual_dir . $file;\r\n\t\t}\r\n\t\t$res = @ftp_delete($this->_handle, $file);\r\n\t\t\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpException(\"Could not delete file '$file'.\");\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This will remove a dir\r\n\t *\r\n\t * @param string $dir The dir to delete\r\n\t *\r\n\t * @access private\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _rmDir($dir) {\r\n\t\tif ( substr($dir, (strlen($dir) - 1), 1) != \"/\" ) {\r\n\t\t\tthrow new ftpException(\"Directory name '\" . $dir . \"' is invalid, has to end with '/'\");\r\n\t\t}\r\n\t\t$res = @ftp_rmdir($this->_handle, $dir);\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpException(\"Could not delete directory '$dir'.\");\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This will remove a dir and all subdirs and -files\r\n\t *\r\n\t * @param string $dir The dir to delete recursively\r\n\t * @param bool $filesonly Only delete files so the directory structure is\r\n\t * preserved \r\n\t *\r\n\t * @access private\r\n\t * @return boolean\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _rmDirRecursive($dir, $filesonly = false) {\r\n\t\tif ( substr($dir, (strlen($dir) - 1), 1) != \"/\" ) {\r\n\t\t\tthrow new ftpException(\"Directory name '\" . $dir . \"' is invalid, has to end with '/'\");\r\n\t\t}\r\n\t\t$file_list = $this->_lsFiles($dir);\r\n\t\tforeach ( $file_list as $file ) {\r\n\t\t\t$file = $dir . $file[\"name\"];\r\n\t\t\t$res = $this->rm($file);\r\n\t\t}\r\n\t\t\r\n\t\t$dir_list = $this->_lsDirs($dir);\r\n\t\tforeach ( $dir_list as $new_dir ) {\r\n\t\t\tif ( $new_dir[\"name\"] == '.' || $new_dir[\"name\"] == '..' ) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$new_dir = $dir . $new_dir[\"name\"] . \"/\";\r\n\t\t\t$res = $this->_rmDirRecursive($new_dir, $filesonly);\r\n\t\t}\r\n\t\t\r\n\t\tif ( !$filesonly ) {\r\n\t\t\t$res = $this->_rmDir($dir);\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Lists up files and directories\r\n\t *\r\n\t * @param string $dir The directory to list up\r\n\t *\r\n\t * @access private\r\n\t * @return array An array of dirs and files\r\n\t */\r\n\tprivate function _lsBoth($dir) {\r\n\t\t$list_splitted = $this->_listAndParse($dir);\r\n\t\t\r\n\t\tif ( !is_array($list_splitted[\"files\"]) ) {\r\n\t\t\t$list_splitted[\"files\"] = array();\r\n\t\t}\r\n\t\tif ( !is_array($list_splitted[\"dirs\"]) ) {\r\n\t\t\t$list_splitted[\"dirs\"] = array();\r\n\t\t}\r\n\t\t$res = array();\r\n\t\t@array_splice($res, 0, 0, $list_splitted[\"files\"]);\r\n\t\t@array_splice($res, 0, 0, $list_splitted[\"dirs\"]);\r\n\t\treturn $res;\r\n\t}\r\n\r\n\t/**\r\n\t * Lists up directories\r\n\t *\r\n\t * @param string $dir The directory to list up\r\n\t *\r\n\t * @access private\r\n\t * @return array An array of dirs\r\n\t */\r\n\tprivate function _lsDirs($dir) {\r\n\t\t$list = $this->_listAndParse($dir);\r\n\t\treturn $list[\"dirs\"];\r\n\t}\r\n\r\n\t/**\r\n\t * Lists up files\r\n\t *\r\n\t * @param string $dir The directory to list up\r\n\t *\r\n\t * @access private\r\n\t * @return array An array of files\r\n\t */\r\n\tprivate function _lsFiles($dir) {\r\n\t\t$list = $this->_listAndParse($dir);\r\n\t\treturn $list[\"files\"];\r\n\t}\r\n\r\n\t/**\r\n\t * This lists up the directory-content and parses the items into well-formated\r\n\t * arrays.\r\n\t * The results of this array are sorted (dirs on top, sorted by name;\r\n\t * files below, sorted by name).\r\n\t *\r\n\t * @param string $dir The directory to parse\r\n\t *\r\n\t * @access private\r\n\t * @return array Lists of dirs and files\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _listAndParse($dir) {\r\n\t\t$dirs_list = array();\r\n\t\t$files_list = array();\r\n\t\t$dir_list = @ftp_rawlist($this->_handle, $dir);\r\n\t\tif ( !is_array($dir_list) ) {\r\n\t\t\tthrow new ftpLsException('Could not get raw directory listing of '.$dir);\r\n\t\t}\r\n\t\t\r\n\t\tforeach ( $dir_list as $k => $v ) {\r\n\t\t\tif ( strncmp($v, 'total: ', 7) == 0 && preg_match('/total: \\d+/', $v) ) {\r\n\t\t\t\tunset($dir_list[$k]);\r\n\t\t\t\tbreak; // usually there is just one line like this\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Handle empty directories\r\n\t\tif ( count($dir_list) == 0 ) {\r\n\t\t\treturn array('dirs' => $dirs_list, 'files' => $files_list);\r\n\t\t}\r\n\t\t\r\n\t\t// Exception for some FTP servers seem to return this weird result instead\r\n\t\t// of an empty list\r\n\t\tif ( count($dirs_list) == 1 && $dirs_list[0] == 'total 0' ) {\r\n\t\t\treturn array('dirs' => array(), 'files' => $files_list);\r\n\t\t}\r\n\t\t\r\n\t\tif ( !isset($this->_matcher) ) {\r\n\t\t\t$this->_matcher = $this->_determineOSMatch($dir_list);\r\n\t\t}\r\n\t\t\r\n\t\tforeach ( $dir_list as $entry ) {\r\n\t\t\tif ( !preg_match($this->_matcher['pattern'], $entry, $m) ) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$entry = array();\r\n\t\t\tforeach ( $this->_matcher['map'] as $key => $val ) {\r\n\t\t\t\t$entry[$key] = $m[$val];\r\n\t\t\t}\r\n\t\t\t$entry['stamp'] = $this->_parseDate($entry['date']);\r\n\t\t\t\r\n\t\t\tif ( $entry['is_dir'] ) {\r\n\t\t\t\t$dirs_list[] = $entry;\r\n\t\t\t} else {\r\n\t\t\t\t$files_list[] = $entry;\r\n\t\t\t}\r\n\t\t}\r\n\t\t@usort($dirs_list, array(\"Net_FTP\", \"_natSort\"));\r\n\t\t@usort($files_list, array(\"Net_FTP\", \"_natSort\"));\r\n\t\t$res[\"dirs\"] = (is_array($dirs_list)) ? $dirs_list : array();\r\n\t\t$res[\"files\"] = (is_array($files_list)) ? $files_list : array();\r\n\t\treturn $res;\r\n\t}\r\n\r\n\t/**\r\n\t * Determine server OS\r\n\t * This determines the server OS and returns a valid regex to parse\r\n\t * ls() output.\r\n\t *\r\n\t * @param array &$dir_list The raw dir list to parse\r\n\t *\r\n\t * @access private\r\n\t * @return mixed An array of 'pattern' and 'map' on success\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _determineOSMatch(&$dir_list) {\r\n\t\tforeach ( $dir_list as $entry ) {\r\n\t\t\tforeach ( $this->_ls_match as $os => $match ) {\r\n\t\t\t\tif ( preg_match($match['pattern'], $entry) ) {\r\n\t\t\t\t\treturn $match;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$error =\r\n\t\t\t'The list style of your server seems not to be supported. Please'.\r\n\t\t\t'email a \"$ftp->ls(ftpClient::LS_MODE_RAWLIST);\" output plus info on the'.\r\n\t\t\t'server to the maintainer of this package to get it supported!'.\r\n\t\t\t'Thanks for your help!';\r\n\t\t\r\n\t\tthrow new ftpException($error);\r\n\t}\r\n\r\n\t/**\r\n\t * Lists a local directory\r\n\t *\r\n\t * @param string $dir_path The dir to list\r\n\t *\r\n\t * @access private\r\n\t * @return array The list of dirs and files\r\n\t */\r\n\tprivate function _lsLocal($dir_path) {\r\n\t\t$dir = dir($dir_path);\r\n\t\t$dir_list = array();\r\n\t\t$file_list = array();\r\n\t\twhile ( false !== ($entry = $dir->read()) ) {\r\n\t\t\tif ( ($entry != '.') && ($entry != '..') ) {\r\n\t\t\t\tif ( is_dir($dir_path . $entry) ) {\r\n\t\t\t\t\t$dir_list[] = $entry;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$file_list[] = $entry;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$dir->close();\r\n\t\t$res['dirs'] = $dir_list;\r\n\t\t$res['files'] = $file_list;\r\n\t\treturn $res;\r\n\t}\r\n\r\n\t/**\r\n\t * Function for use with usort().\r\n\t * Compares the list-array-elements by name.\r\n\t *\r\n\t * @param string $item_1 first item to be compared\r\n\t * @param string $item_2 second item to be compared\r\n\t *\r\n\t * @access private\r\n\t * @return int < 0 if $item_1 is less than $item_2, 0 if equal and > 0 otherwise\r\n\t */\r\n\tprivate function _natSort($item_1, $item_2) {\r\n\t\treturn strnatcmp($item_1['name'], $item_2['name']);\r\n\t}\r\n\r\n\t/**\r\n\t * Parse dates to timestamps\r\n\t *\r\n\t * @param string $date Date\r\n\t *\r\n\t * @access private\r\n\t * @return int Timestamp\r\n\t * @throws ftpException\r\n\t */\r\n\tprivate function _parseDate($date) {\r\n\t\t// Sep 10 22:06 => Sep 10, <year> 22:06\r\n\t\tif ( preg_match('/([A-Za-z]+)[ ]+([0-9]+)[ ]+([0-9]+):([0-9]+)/', $date, $res) ) {\r\n\t\t\t$year = date('Y');\r\n\t\t\t$month = $res[1];\r\n\t\t\t$day = $res[2];\r\n\t\t\t$hour = $res[3];\r\n\t\t\t$minute = $res[4];\r\n\t\t\t$date = \"$month $day, $year $hour:$minute\";\r\n\t\t\t$tmpDate = strtotime($date);\r\n\t\t\tif ( $tmpDate > time() ) {\r\n\t\t\t\t$year--;\r\n\t\t\t\t$date = \"$month $day, $year $hour:$minute\";\r\n\t\t\t}\r\n\t\t} elseif ( preg_match('/^\\d\\d-\\d\\d-\\d\\d/', $date) ) {\r\n\t\t\t// 09-10-04 => 09/10/04\r\n\t\t\t$date = str_replace('-', '/', $date);\r\n\t\t}\r\n\t\t$res = strtotime($date);\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpException('Date conversion failed for '.$date);\r\n\t\t}\r\n\t\treturn $res;\r\n\t}\r\n}", "function w($dir,$perm) {\r\n\tif(!is_writable($dir)) {\r\n\t\treturn \"<font color=red>\".$perm.\"</font>\";\r\n\t} else {\r\n\t\treturn \"<font color=lime>\".$perm.\"</font>\";\r\n\t}\r\n}", "public function silo_permissions($path)\r\n\t{\r\n\t}", "function chmod_shell($file, $perms) {\n\t\n\t$check = chmod($file, $perms);\n\t\n\tif($check == TRUE)\n\t\t$control = \"<center><font size='4' color='green' face='Verdana'>CHMOD [OK]</font></center>\";\n\telse\n\t\t$control = \"<center><font size='4' color='red' face='Verdana'>CHMOD [ERROR]</font></center>\";\n\t\n\treturn $control;\n}", "public function getPermissionNames()\r\n {\r\n return $this->getGuardUser() ? $this->getGuardUser()->getPermissionNames() : array();\r\n }", "public function getPermission()\n {\n return $this->permission ?: 'everyone';\n }", "public function silo_permissions($path)\n\t{\n\t}", "public function GetModeString()\n\t{\n\t\tif (empty($this->mode))\n\t\t\treturn '';\n\n\t\t$mode = octdec($this->mode);\n\n\t\t/*\n\t\t * Git doesn't store full ugo modes,\n\t\t * it only knows if something is a directory,\n\t\t * symlink, or an executable or non-executable file\n\t\t */\n\t\tif (($mode & 0x4000) == 0x4000)\n\t\t\treturn 'drwxr-xr-x';\n\t\telse if (($mode & 0xA000) == 0xA000)\n\t\t\treturn 'lrwxrwxrwx';\n\t\telse if (($mode & 0x8000) == 0x8000) {\n\t\t\tif (($mode & 0x0040) == 0x0040)\n\t\t\t\treturn '-rwxr-xr-x';\n\t\t\telse\n\t\t\t\treturn '-rw-r--r--';\n\t\t}\n\t\treturn '----------';\n\t}", "public function getPermissionNames() {\n return $this->getGuardUser() ? $this->getGuardUser()->getPermissionNames() : array();\n }", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function pathInfo($path)\n\t{\n\t\t$abs_path = $this->resolve($path);\n\n\t\t\\clearstatcache();\n\n\t\t$ss = \\stat($abs_path);\n\n\t\tif (!$ss) {\n\t\t\treturn false;\n\t\t} // Couldn't stat file\n\n\t\t$ts = [\n\t\t\t0140000 => 'ssocket',\n\t\t\t0120000 => 'llink',\n\t\t\t0100000 => '-file',\n\t\t\t0060000 => 'bblock',\n\t\t\t0040000 => 'ddir',\n\t\t\t0020000 => 'cchar',\n\t\t\t0010000 => 'pfifo',\n\t\t];\n\n\t\t$p = $ss['mode'];\n\t\t$t = \\decoct($p & 0170000); // File Encoding Bit\n\n\t\t$str = (\\array_key_exists(\\octdec($t), $ts)) ? $ts[\\octdec($t)][0] : 'u';\n\t\t$str .= (($p & 0x0100) ? 'r' : '-') . (($p & 0x0080) ? 'w' : '-');\n\t\t$str .= (($p & 0x0040) ? (($p & 0x0800) ? 's' : 'x') : (($p & 0x0800) ? 'S' : '-'));\n\t\t$str .= (($p & 0x0020) ? 'r' : '-') . (($p & 0x0010) ? 'w' : '-');\n\t\t$str .= (($p & 0x0008) ? (($p & 0x0400) ? 's' : 'x') : (($p & 0x0400) ? 'S' : '-'));\n\t\t$str .= (($p & 0x0004) ? 'r' : '-') . (($p & 0x0002) ? 'w' : '-');\n\t\t$str .= (($p & 0x0001) ? (($p & 0x0200) ? 't' : 'x') : (($p & 0x0200) ? 'T' : '-'));\n\n\t\t$s = [\n\t\t\t'umask' => \\sprintf('%04o', \\umask()),\n\t\t\t'human' => $str,\n\t\t\t'octal1' => \\sprintf('%o', ($p & 000777)),\n\t\t\t'octal2' => \\sprintf('0%o', 0777 & $p),\n\t\t\t'decimal' => \\sprintf('%04o', $p),\n\t\t\t'fileperms' => \\fileperms($abs_path),\n\t\t\t'mode' => $p,\n\t\t\t'filename' => $abs_path,\n\t\t\t'realpath' => (\\realpath($abs_path) != $abs_path) ? \\realpath($abs_path) : '',\n\t\t\t'dirname' => \\dirname($abs_path),\n\t\t\t'basename' => \\basename($abs_path),\n\t\t\t'type' => \\substr($ts[\\octdec($t)], 1),\n\t\t\t'type_octal' => \\sprintf('%07o', \\octdec($t)),\n\t\t\t'is_file' => \\is_file($abs_path),\n\t\t\t'is_dir' => \\is_dir($abs_path),\n\t\t\t'is_link' => \\is_link($abs_path),\n\t\t\t'is_readable' => \\is_readable($abs_path),\n\t\t\t'is_writable' => \\is_writable($abs_path),\n\t\t\t'is_executable' => \\is_executable($abs_path),\n\t\t\t'size' => $ss['size'], //Size of file, in bytes.\n\t\t\t'blocks' => $ss['blocks'], //Number 512-byte blocks allocated\n\t\t\t'block_size' => $ss['blksize'] //Optimal block size for I/O.\n\t\t\t,\n\t\t\t'mtime' => $ss['mtime'], //Time of last modification\n\t\t\t'atime' => $ss['atime'], //Time of last access\n\t\t\t'ctime' => $ss['ctime'], //Time of last status change\n\n\t\t];\n\n\t\t$s['device'] = [\n\t\t\t'device' => $ss['dev'], // Device\n\t\t\t'device_number' => $ss['rdev'], // Device number, if device.\n\t\t\t'inode' => $ss['ino'], // File serial number\n\t\t\t'link_count' => $ss['nlink'], // link count\n\t\t\t'link_to' => ($ss['filetype']['type'] === 'link') ? \\readlink($abs_path) : '',\n\t\t];\n\n\t\t\\clearstatcache();\n\n\t\treturn $s;\n\t}", "public function permissions()\n\t{\n\t\treturn $this->get('permissions');\n\t}", "public function getPermissionsListAttribute()\n {\n return Permission::orderBy('resource')->get();\n }", "function getPermissionListXML() {\n $result = '';\n\n if (isset($this->currentFolder) && $this->currentFolder) {\n $folder = $this->currentFolder;\n $surferPerms = $this->getSurferPermissions();\n $groups = $this->getGroups();\n $folderPerms = $this->calculateFolderPermissions($this->params['folder_id'], TRUE);\n $result .= sprintf(\n '<listview title=\"%s\">'.LF,\n papaya_strings::escapeHTMLChars($this->_gt('User permissions'))\n );\n $result .= sprintf(\n '<cols><col>%s</col><col align=\"center\">%s</col><col align=\"center\">%s</col></cols>'.LF,\n papaya_strings::escapeHTMLChars($this->_gt('Group')),\n papaya_strings::escapeHTMLChars($this->_gt('Add/Edit')),\n papaya_strings::escapeHTMLChars($this->_gt('View/Use'))\n );\n $result .= '<items>'.LF;\n\n foreach ($groups as $groupId => $groupTitle) {\n if (isset($folderPerms['user_edit'][$groupId])) {\n if ($folderPerms['user_edit'][$groupId] == 'own') {\n $addFileIcon = $this->images['status-node-checked'];\n $addFileLink = $this->getLink(\n array(\n 'cmd' => 'edit_folder',\n 'perm_action' => 'del_perm',\n 'folder_id' => $folder['folder_id'],\n 'perm_type' => 'user_edit',\n 'perm_id' => $groupId\n )\n );\n } else {\n $addFileIcon = $this->images['status-node-checked-disabled'];\n $addFileLink = '';\n }\n } else {\n if ($folder['permission_mode'] != 'inherited') {\n $addFileIcon = $this->images['status-node-empty'];\n $addFileLink = $this->getLink(\n array(\n 'cmd' => 'edit_folder',\n 'perm_action' => 'add_perm',\n 'folder_id' => $folder['folder_id'],\n 'perm_type' => 'user_edit',\n 'perm_id' => $groupId,\n )\n );\n } else {\n $addFileIcon = $this->images['status-node-empty-disabled'];\n $addFileLink = '';\n }\n }\n if (isset($folderPerms['user_view'][$groupId])) {\n if ($folderPerms['user_view'][$groupId] == 'own') {\n $viewFileIcon = $this->images['status-node-checked'];\n $viewFileLink = $this->getLink(\n array(\n 'cmd' => 'edit_folder',\n 'perm_action' => 'del_perm',\n 'folder_id' => $folder['folder_id'],\n 'perm_type' => 'user_view',\n 'perm_id' => $groupId,\n )\n );\n } else {\n $viewFileIcon = $this->images['status-node-checked-disabled'];\n $viewFileLink = '';\n }\n } else {\n if ($folder['permission_mode'] != 'inherited') {\n $viewFileIcon = $this->images['status-node-empty'];\n $viewFileLink = $this->getLink(\n array(\n 'cmd' => 'edit_folder',\n 'perm_action' => 'add_perm',\n 'folder_id' => $folder['folder_id'],\n 'perm_type' => 'user_view',\n 'perm_id' => $groupId,\n )\n );\n } else {\n $viewFileIcon = $this->images['status-node-empty-disabled'];\n $viewFileLink = '';\n }\n }\n $result .= sprintf(\n '<listitem image=\"%s\" title=\"%s\">'.LF,\n papaya_strings::escapeHTMLChars($this->images['items-permission']),\n papaya_strings::escapeHTMLChars($groupTitle)\n );\n if (isset($addFileLink) && $addFileLink != '') {\n $result .= sprintf(\n '<subitem align=\"center\"><a href=\"%s\"><glyph src=\"%s\" /></a></subitem>'.LF,\n papaya_strings::escapeHTMLChars($addFileLink),\n papaya_strings::escapeHTMLChars($addFileIcon)\n );\n } else {\n $result .= sprintf(\n '<subitem align=\"center\"><glyph src=\"%s\" /></subitem>'.LF,\n papaya_strings::escapeHTMLChars($addFileIcon)\n );\n }\n if (isset($viewFileLink) && $viewFileLink != '') {\n $result .= sprintf(\n '<subitem align=\"center\"><a href=\"%s\"><glyph src=\"%s\" /></a></subitem>'.LF,\n papaya_strings::escapeHTMLChars($viewFileLink),\n papaya_strings::escapeHTMLChars($viewFileIcon)\n );\n } else {\n $result .= sprintf(\n '<subitem align=\"center\"><glyph src=\"%s\" /></subitem>'.LF,\n papaya_strings::escapeHTMLChars($viewFileIcon)\n );\n }\n $result .= '</listitem>'.LF;\n }\n $result .= '</items>'.LF;\n $result .= '</listview>'.LF;\n\n /*********************\n * Surfer permissions *\n *********************/\n if (is_array($surferPerms) && count($surferPerms) > 0) {\n $result .= sprintf(\n '<listview title=\"%s\">'.LF,\n papaya_strings::escapeHTMLChars($this->_gt('Surfer permissions'))\n );\n $result .= '<cols>'.LF;\n $result .= sprintf(\n '<col>%s</col>'.LF,\n papaya_strings::escapeHTMLChars($this->_gt('Permission'))\n );\n $result .= sprintf(\n '<col align=\"center\">%s</col>'.LF,\n papaya_strings::escapeHTMLChars($this->_gt('Active'))\n );\n $result .= sprintf(\n '<col align=\"center\">%s</col>'.LF,\n papaya_strings::escapeHTMLChars($this->_gt('Add/Edit'))\n );\n $result .= sprintf(\n '<col align=\"center\">%s</col>'.LF,\n papaya_strings::escapeHTMLChars($this->_gt('View/Use'))\n );\n $result .= '</cols>'.LF;\n $result .= '<items>'.LF;\n foreach ($surferPerms as $permId => $permission) {\n $result .= sprintf(\n '<listitem image=\"%s\" title=\"%s\">'.LF,\n papaya_strings::escapeHTMLChars($this->images['items-permission']),\n papaya_strings::escapeHTMLChars($permission['surferperm_title'])\n );\n if (isset($folderPerms['surfer_add'][$permId])) {\n if ($folderPerms['surfer_add'][$permId] == 'own' &&\n $permission['surferperm_active'] == 1) {\n $addFileIcon = $this->images['status-node-checked'];\n $addFileLink = $this->getLink(\n array(\n 'cmd' => 'edit_folder',\n 'perm_action' => 'del_perm',\n 'folder_id' => $folder['folder_id'],\n 'perm_type' => 'surfer_add',\n 'perm_id' => $permId,\n )\n );\n } else {\n $addFileIcon = $this->images['status-node-checked-disabled'];\n $addFileLink = '';\n }\n } elseif ($folder['permission_mode'] != 'inherited' &&\n $permission['surferperm_active'] == 1) {\n $addFileIcon = $this->images['status-node-empty'];\n $addFileLink = $this->getLink(\n array(\n 'cmd' => 'edit_folder',\n 'perm_action' => 'add_perm',\n 'folder_id' => $folder['folder_id'],\n 'perm_type' => 'surfer_add',\n 'perm_id' => $permId,\n )\n );\n } else {\n $addFileIcon = $this->images['status-node-empty-disabled'];\n $addFileLink = '';\n }\n if (isset($folderPerms['surfer_view'][$permId])) {\n if ($folderPerms['surfer_view'][$permId] == 'own' &&\n $permission['surferperm_active'] == 1) {\n $viewFileIcon = $this->images['status-node-checked'];\n $viewFileLink = $this->getLink(\n array(\n 'cmd' => 'edit_folder',\n 'perm_action' => 'del_perm',\n 'folder_id' => $folder['folder_id'],\n 'perm_type' => 'surfer_view',\n 'perm_id' => $permId,\n )\n );\n } else {\n $viewFileIcon = $this->images['status-node-checked-disabled'];\n $viewFileLink = '';\n }\n } elseif ($folder['permission_mode'] != 'inherited' &&\n $permission['surferperm_active'] == 1) {\n $viewFileIcon = $this->images['status-node-empty'];\n $viewFileLink = $this->getLink(\n array(\n 'cmd' => 'edit_folder',\n 'perm_action' => 'add_perm',\n 'folder_id' => $folder['folder_id'],\n 'perm_type' => 'surfer_view',\n 'perm_id' => $permId,\n )\n );\n } else {\n $viewFileIcon = $this->images['status-node-empty-disabled'];\n $viewFileLink = '';\n }\n if ($permission['surferperm_active'] == 1) {\n $activeIcon = $this->images['status-node-checked-disabled'];\n } else {\n $activeIcon = $this->images['status-node-empty-disabled'];\n }\n $result .= sprintf(\n '<subitem align=\"center\"><glyph src=\"%s\" /></subitem>'.LF,\n papaya_strings::escapeHTMLChars($activeIcon)\n );\n if (isset($addFileLink) && $addFileLink != '') {\n $result .= sprintf(\n '<subitem align=\"center\"><a href=\"%s\"><glyph src=\"%s\" /></a></subitem>'.LF,\n papaya_strings::escapeHTMLChars($addFileLink),\n papaya_strings::escapeHTMLChars($addFileIcon)\n );\n } else {\n $result .= sprintf(\n '<subitem align=\"center\"><glyph src=\"%s\" /></subitem>'.LF,\n papaya_strings::escapeHTMLChars($addFileIcon)\n );\n }\n if (isset($viewFileLink) && $viewFileLink != '') {\n $result .= sprintf(\n '<subitem align=\"center\"><a href=\"%s\"><glyph src=\"%s\" /></a></subitem>'.LF,\n papaya_strings::escapeHTMLChars($viewFileLink),\n papaya_strings::escapeHTMLChars($viewFileIcon)\n );\n } else {\n $result .= sprintf(\n '<subitem align=\"center\"><glyph src=\"%s\" /></subitem>'.LF,\n papaya_strings::escapeHTMLChars($viewFileIcon)\n );\n }\n\n $result .= '</listitem>'.LF;\n }\n $result .= '</items>'.LF;\n $result .= '</listview>'.LF;\n }\n }\n return $result;\n }", "public function getUnixPermissions() {\n \n // Find the permissions.\n $permissions = self::setSpecialBits() . self::setUser() . self::setGroup() . self::setOther();\n \n // Return the permissions in a JSON object.\n return Response::json(array(\"permissions\" => $permissions));\n }", "public function getPermissionNames()\n {\n $result = $this->getPermissions()->all();\n if( is_null( $result ) ) return [];\n return array_map( function($o) {return $o->namedId;}, $result );\n }", "public function getAllPermissions()\n {\n $p = App::$Properties->getAll('permissions');\n if (!$p || !Any::isArray($p)) {\n throw new SyntaxException('User permissions settings is not founded: /Private/Config/Permissions.php');\n }\n\n return $p;\n }", "public function getPermissions()\r\n {\r\n return $this->getGuardUser()->getPermissions();\r\n }", "public function getPermissions(): int\n {\n /** @psalm-suppress InvalidArgument */\n $stat = \\msg_stat_queue($this->queue);\n return $stat['msg_perm.mode'];\n }", "public function get_allPermission() {\n\t\t$allPermission = '';\n\t\t$_t = $this->select();\n\t\tif(!empty($_t)) {\n\t\t\tforeach($_t as $mp) {\n\t\t\t\t$allPermission .= $mp['mp_content'] . ',';\n\t\t\t}\n\t\t}\n\t\t$allPermission = rtrim($allPermission, ',');\n\t\treturn $allPermission;\n\t}", "public function getPermission()\n {\n return $this->permission;\n }", "public static function permissionLabels()\n {\n return [];\n }", "public function getchmod($file) {\n\t\tif( $this->authorized() ) {\n\t\t\treturn parent::getchmod( $file );\n\t\t} else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getEvaluatePermissions() {}", "public static function getChmod($file)\n {\n clearstatcache();\n return @substr(decoct(fileperms($file)), -3);\n }", "public function getAccess(): string\n {\n return $this->access;\n }", "public function __toString()\n {\n return 'El contenido de este archivo se encuentra temporalmente bloqueado. <br />Co: 403<br />Status:Forbbiden';\n }", "public function getAllPermissionNames()\r\n {\r\n return $this->getGuardUser() ? $this->getGuardUser()->getAllPermissionNames() : array();\r\n }", "private function getPermissionsPermissions()\n {\n return [\n [\n 'name' => 'Permissions - List all permissions',\n 'description' => 'Allow to list all permissions.',\n 'slug' => PermissionsPolicy::PERMISSION_LIST,\n ],\n [\n 'name' => 'Permissions - View a permission',\n 'description' => 'Allow to view the permission\\'s details.',\n 'slug' => PermissionsPolicy::PERMISSION_SHOW,\n ],\n [\n 'name' => 'Permissions - Update a permission',\n 'description' => 'Allow to update a permission.',\n 'slug' => PermissionsPolicy::PERMISSION_UPDATE,\n ],\n ];\n }", "public function getPermissions() {\n return $this->getGuardUser()->getPermissions();\n }", "public function getAllPermissions();", "public function getAllPermissions();", "public function getAllPermissionNames() {\n return $this->getGuardUser() ? $this->getGuardUser()->getAllPermissionNames() : array();\n }", "public function perms();" ]
[ "0.78617036", "0.73725283", "0.7061262", "0.69968665", "0.6829209", "0.6757898", "0.67504823", "0.6725017", "0.6688132", "0.6658698", "0.66433716", "0.6613313", "0.6451855", "0.63654983", "0.63201606", "0.63073707", "0.62060446", "0.6136084", "0.61195016", "0.60521096", "0.60382974", "0.59957224", "0.59451014", "0.5930468", "0.5915587", "0.59155107", "0.59155107", "0.59155107", "0.59154505", "0.59105086", "0.59077066", "0.5876566", "0.5869863", "0.5869748", "0.5869748", "0.58559495", "0.5852213", "0.5844854", "0.58204615", "0.57645476", "0.5764038", "0.57630473", "0.5758393", "0.5749266", "0.57422817", "0.5735789", "0.5712957", "0.5703979", "0.5700071", "0.5689838", "0.56839246", "0.5683068", "0.5672458", "0.56531906", "0.56491476", "0.5646762", "0.563758", "0.563758", "0.563758", "0.56149673", "0.5610998", "0.5603015", "0.5594051", "0.5583173", "0.5571686", "0.55713224", "0.5555968", "0.5546739", "0.55454564", "0.5536693", "0.5535649", "0.55307275", "0.55307275", "0.55307275", "0.55307275", "0.55307275", "0.5518155", "0.55171514", "0.549295", "0.5484484", "0.5482762", "0.54734045", "0.5471787", "0.5451838", "0.5438277", "0.54371345", "0.5434977", "0.5426911", "0.5415504", "0.5406479", "0.540497", "0.54013795", "0.5394791", "0.5378231", "0.5372998", "0.53666365", "0.5354131", "0.5354131", "0.53495544", "0.5335616" ]
0.6939743
4
Convert a number to text Works for numbers up to 20
function numberToText($num) { if(!is_numeric($num)){ $num = intval($num); if(!is_numeric($num)) return 'NaN'; } $numbers = array('zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen', 'twenty'); return $numbers[$num]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getNumberToText(int $number): string {\n\t\tswitch($number) {\n\t\t\tcase 0:\n\t\t\t\treturn Language::out()->get0Name();\n\t\t\tcase 1:\n\t\t\t\treturn Language::out()->get1Name();\n\t\t\tcase 2:\n\t\t\t\treturn Language::out()->get2Name();\n\t\t\tcase 3:\n\t\t\t\treturn Language::out()->get3Name();\n\t\t\tcase 4:\n\t\t\t\treturn Language::out()->get4Name();\n\t\t\tcase 5:\n\t\t\t\treturn Language::out()->get5Name();\n\t\t\tcase 6:\n\t\t\t\treturn Language::out()->get6Name();\n\t\t\tcase 7:\n\t\t\t\treturn Language::out()->get7Name();\n\t\t\tcase 8:\n\t\t\t\treturn Language::out()->get8Name();\n\t\t\tcase 9:\n\t\t\t\treturn Language::out()->get9Name();\n\t\t\tdefault:\n\t\t\t\treturn (string) $number;\n\t\t}\n\t}", "function stpb_number_to_text($n){\r switch($n){\r case 1:\r $class ='one';\r break;\r case 2:\r $class ='two';\r break;\r case 3:\r $class ='three';\r break;\r case 4:\r $class ='four';\r break;\r case 5:\r $class ='five';\r break;\r case 6:\r $class ='six';\r break;\r case 7:\r $class ='seven';\r break;\r case 8:\r $class ='eight';\r break;\r case 9:\r $class ='nine';\r break;\r case 10:\r $class ='ten';\r break;\r case 10:\r $class ='eleven';\r break;\r\r default :\r $class ='twelve';\r\r }\r return $class;\r}", "function translateToWords($number) \n{\n // zero is a special case, it cause problems even with typecasting if we don't deal with it here\n $max_size = pow(10,18);\n if (!$number) return \"zero\";\n if (is_int($number) && $number < abs($max_size)) \n { \n switch ($number) \n {\n // set up some rules for converting digits to words\n case $number < 0:\n $prefix = \"negative\";\n $suffix = translateToWords(-1*$number);\n $string = $prefix . \" \" . $suffix;\n break;\n case 1:\n $string = \"one\";\n break;\n case 2:\n $string = \"two\";\n break;\n case 3:\n $string = \"three\";\n break;\n case 4: \n $string = \"four\";\n break;\n case 5:\n $string = \"five\";\n break;\n case 6:\n $string = \"six\";\n break;\n case 7:\n $string = \"seven\";\n break;\n case 8:\n $string = \"eight\";\n break;\n case 9:\n $string = \"nine\";\n break; \n case 10:\n $string = \"ten\";\n break; \n case 11:\n $string = \"eleven\";\n break; \n case 12:\n $string = \"twelve\";\n break; \n case 13:\n $string = \"thirteen\";\n break; \n // fourteen handled later\n case 15:\n $string = \"fifteen\";\n break; \n case $number < 20:\n $string = translateToWords($number%10);\n // eighteen only has one \"t\"\n if ($number == 18)\n {\n $suffix = \"een\";\n } else \n {\n $suffix = \"teen\";\n }\n $string .= $suffix;\n break; \n case 20:\n $string = \"twenty\";\n break; \n case 30:\n $string = \"thirty\";\n break; \n case 40:\n $string = \"forty\";\n break; \n case 50:\n $string = \"fifty\";\n break; \n case 60:\n $string = \"sixty\";\n break; \n case 70:\n $string = \"seventy\";\n break; \n case 80:\n $string = \"eighty\";\n break; \n case 90:\n $string = \"ninety\";\n break; \n case $number < 100:\n $prefix = translateToWords($number-$number%10);\n $suffix = translateToWords($number%10);\n $string = $prefix . \"-\" . $suffix;\n break;\n // handles all number 100 to 999\n case $number < pow(10,3): \n // floor return a float not an integer\n $prefix = translateToWords(intval(floor($number/pow(10,2)))) . \" hundred\";\n if ($number%pow(10,2)) $suffix = \" and \" . translateToWords($number%pow(10,2));\n $string = $prefix . $suffix;\n break;\n case $number < pow(10,6):\n // floor return a float not an integer\n $prefix = translateToWords(intval(floor($number/pow(10,3)))) . \" thousand\";\n if ($number%pow(10,3)) $suffix = translateToWords($number%pow(10,3));\n $string = $prefix . \" \" . $suffix;\n break;\n case $number < pow(10,9):\n // floor return a float not an integer\n $prefix = translateToWords(intval(floor($number/pow(10,6)))) . \" million\";\n if ($number%pow(10,6)) $suffix = translateToWords($number%pow(10,6));\n $string = $prefix . \" \" . $suffix;\n break; \n case $number < pow(10,12):\n // floor return a float not an integer\n $prefix = translateToWords(intval(floor($number/pow(10,9)))) . \" billion\";\n if ($number%pow(10,9)) $suffix = translateToWords($number%pow(10,9));\n $string = $prefix . \" \" . $suffix; \n break;\n case $number < pow(10,15):\n // floor return a float not an integer\n $prefix = translateToWords(intval(floor($number/pow(10,12)))) . \" trillion\";\n if ($number%pow(10,12)) $suffix = translateToWords($number%pow(10,12));\n $string = $prefix . \" \" . $suffix; \n break; \n // Be careful not to pass default formatted numbers in the quadrillions+ into this function\n // Default formatting is float and causes errors\n case $number < pow(10,18):\n // floor return a float not an integer\n $prefix = translateToWords(intval(floor($number/pow(10,15)))) . \" quadrillion\";\n if ($number%pow(10,15)) $suffix = translateToWords($number%pow(10,15));\n $string = $prefix . \" \" . $suffix; \n break; \n }\n } else\n {\n echo \"ERROR with - $number<br/> Number must be an integer between -\" . number_format($max_size, 0, \".\", \",\") . \" and \" . number_format($max_size, 0, \".\", \",\") . \" exclussive.\";\n }\n return $string; \n}", "function numtowords($num)\n{\n\t$ones = array(\n\t1 => \"one\",\n\t2 => \"two\",\n\t3 => \"three\",\n\t4 => \"four\",\n\t5 => \"five\",\n\t6 => \"six\",\n\t7 => \"seven\",\n\t8 => \"eight\",\n\t9 => \"nine\",\n\t10 => \"ten\",\n\t11 => \"eleven\",\n\t12 => \"twelve\",\n\t13 => \"thirteen\",\n\t14 => \"fourteen\",\n\t15 => \"fifteen\",\n\t16 => \"sixteen\",\n\t17 => \"seventeen\",\n\t18 => \"eighteen\",\n\t19 => \"nineteen\"\n\t);\n\t$tens = array(\n\t2 => \"twenty\",\n\t3 => \"thirty\",\n\t4 => \"forty\",\n\t5 => \"fifty\",\n\t6 => \"sixty\",\n\t7 => \"seventy\",\n\t8 => \"eighty\",\n\t9 => \"ninety\"\n\t);\n\t$hundreds = array(\n\t\"hundred\",\n\t\"thousand\",\n\t\"million\",\n\t\"billion\",\n\t\"trillion\",\n\t\"quadrillion\"\n\t); //limit t quadrillion\n\t$num = number_format($num,2,\".\",\",\");\n\t$num_arr = explode(\".\",$num);\n\t$wholenum = $num_arr[0];\n\t$decnum = $num_arr[1];\n\t$whole_arr = array_reverse(explode(\",\",$wholenum));\n\tkrsort($whole_arr);\n\t$rettxt = \"\";\n\tforeach($whole_arr as $key => $i)\n\t{\n\t\tif($i < 20)\n\t\t{\n\t\t\t$rettxt .= $ones[$i];\n\t\t}\n\t\telseif($i < 100)\n\t\t{\n\t\t\t$rettxt .= $tens[substr($i,0,1)];\n\t\t\t$rettxt .= \" \".$ones[substr($i,1,1)];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$rettxt .= $ones[substr($i,0,1)].\" \".$hundreds[0];\n\t\t\t$rettxt .= \" \".$tens[substr($i,1,1)];\n\t\t\t$rettxt .= \" \".$ones[substr($i,2,1)];\n\t\t}\n\t\t\n\t\tif($key > 0)\n\t\t{\n\t\t\t$rettxt .= \" \".$hundreds[$key].\" \";\n\t\t}\n\t}\n\tif($decnum > 0)\n\t{\n\t\t$rettxt .= \" and \";\n\t\tif($decnum < 20)\n\t\t{\n\t\t\t$rettxt .= $ones[$decnum];\n\t\t}\n\t\telseif($decnum < 100)\n\t\t{\n\t\t\t$rettxt .= $tens[substr($decnum,0,1)];\n\t\t\t$rettxt .= \" \".$ones[substr($decnum,1,1)];\n\t\t}\n\t}\n\treturn $rettxt;\n}", "function convertNumberToWord($num = false)\n{\n $num = str_replace(array(',', ' '), '' , trim($num));\n if(! $num) {\n return false;\n }\n $num = (int) $num;\n $words = array();\n $list1 = array('', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven',\n 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'\n );\n $list2 = array('', 'ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety', 'hundred');\n $list3 = array('', 'thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion', 'sextillion', 'septillion',\n 'octillion', 'nonillion', 'decillion', 'undecillion', 'duodecillion', 'tredecillion', 'quattuordecillion',\n 'quindecillion', 'sexdecillion', 'septendecillion', 'octodecillion', 'novemdecillion', 'vigintillion'\n );\n $num_length = strlen($num);\n $levels = (int) (($num_length + 2) / 3);\n $max_length = $levels * 3;\n $num = substr('00' . $num, -$max_length);\n $num_levels = str_split($num, 3);\n for ($i = 0; $i < count($num_levels); $i++) {\n $levels--;\n $hundreds = (int) ($num_levels[$i] / 100);\n $hundreds = ($hundreds ? ' ' . $list1[$hundreds] . ' hundred' . ( $hundreds == 1 ? '' : 's' ) . ' ' : '');\n $tens = (int) ($num_levels[$i] % 100);\n $singles = '';\n if ( $tens < 20 ) {\n $tens = ($tens ? ' ' . $list1[$tens] . ' ' : '' );\n } else {\n $tens = (int)($tens / 10);\n $tens = ' ' . $list2[$tens] . ' ';\n $singles = (int) ($num_levels[$i] % 10);\n $singles = ' ' . $list1[$singles] . ' ';\n }\n $words[] = $hundreds . $tens . $singles . ( ( $levels && ( int ) ( $num_levels[$i] ) ) ? ' ' . $list3[$levels] . ' ' : '' );\n } //end for loop\n $commas = count($words);\n if ($commas > 1) {\n $commas = $commas - 1;\n }\n return implode(' ', $words);\n}", "function convertNumberToWord($num = false)\n{\n $num = str_replace(array(',', ' '), '' , trim($num));\n if(! $num) {\n return false;\n }\n $num = (int) $num;\n $words = array();\n $list1 = array('', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven',\n 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'\n );\n $list2 = array('', 'ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety', 'hundred');\n $list3 = array('', 'thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion', 'sextillion', 'septillion',\n 'octillion', 'nonillion', 'decillion', 'undecillion', 'duodecillion', 'tredecillion', 'quattuordecillion',\n 'quindecillion', 'sexdecillion', 'septendecillion', 'octodecillion', 'novemdecillion', 'vigintillion'\n );\n $num_length = strlen($num);\n $levels = (int) (($num_length + 2) / 3);\n $max_length = $levels * 3;\n $num = substr('00' . $num, -$max_length);\n $num_levels = str_split($num, 3);\n for ($i = 0; $i < count($num_levels); $i++) {\n $levels--;\n $hundreds = (int) ($num_levels[$i] / 100);\n $hundreds = ($hundreds ? ' ' . $list1[$hundreds] . ' hundred' . ( $hundreds == 1 ? '' : 's' ) . ' ' : '');\n $tens = (int) ($num_levels[$i] % 100);\n $singles = '';\n if ( $tens < 20 ) {\n $tens = ($tens ? ' ' . $list1[$tens] . ' ' : '' );\n } else {\n $tens = (int)($tens / 10);\n $tens = ' ' . $list2[$tens] . ' ';\n $singles = (int) ($num_levels[$i] % 10);\n $singles = ' ' . $list1[$singles] . ' ';\n }\n $words[] = $hundreds . $tens . $singles . ( ( $levels && ( int ) ( $num_levels[$i] ) ) ? ' ' . $list3[$levels] . ' ' : '' );\n } //end for loop\n $commas = count($words);\n if ($commas > 1) {\n $commas = $commas - 1;\n }\n return implode(' ', $words);\n}", "static function Number_to_Word($num)\n\t{\n\t\t$fn = array();\n\n\t\tif ($num == 0)\n\t\t\treturn self::$nums[0];\n\n\t\twhile ($num != 0) {\n\t\t\tif ($num < 0) {\n\t\t\t\t$fn[] = self::$nums['-'];\n\t\t\t\t$num = -$num;\n\t\t\t}\n\t\t\telseif ($num < 20) {\n\t\t\t\t$fn[] = self::$nums[$num];\n\t\t\t\t$num = 0;\n\t\t\t}\n\t\t\telse if ($num < 100) {\n\t\t\t\t$val = floor($num / 10) * 10;\n\t\t\t\t$fn[] = self::$nums[$val];\n\t\t\t\tif (($num -= $val) > 0)\n\t\t\t\t\t$fn[] = '-';\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($num < 1000) {\n\t\t\t\t\t$num -= ($val = floor($num / 100)) * 100;\n\t\t\t\t\t$fn[] = self::$nums[$val] . ' hundred';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif ($num < 1000000) {\n\t\t\t\t\t\t$fn = array_merge($fn, (array)self::Number_to_Word(floor($num / 1000)));\n\t\t\t\t\t\t$fn[] = 'thousand';\n\t\t\t\t\t\t$num = $num % 1000;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ($num < 1000000000) {\n\t\t\t\t\t\t\t$fn = array_merge($fn, (array)self::Number_to_Word(floor($num / 1000000)));\n\t\t\t\t\t\t\t$fn[] = 'million';\n\t\t\t\t\t\t\t$num = $num % 1000000;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\ttrigger_error(\"WriteNum::write :: number is bigger than maximum allowed.\", E_USER_WARNING);\n\t\t\t\t\t\t\treturn false;\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\treturn preg_replace('/ \\- /', '-', implode(' ', $fn));\n\t}", "function c_num_to_text($key) \r\n {\r\n\r\n\t\t// Example \r\n \t$data = array(\r\n \t\t0 => \"off\",\r\n \t\t1 => \"on\"\r\n \t);\r\n \t\r\n \t$result = $data[$key];\r\n \r\n \tif(is_null($result))\r\n \t{\r\n \t\treturn false;\r\n \t}\r\n \telse \r\n \t{\r\n \t\treturn $result;\t\r\n \t}\r\n\r\n\r\n }", "private function twodigits($num)\n {\n //displays from 1 to 99\n if($num<20)\n return $this->discrete[$num];\n else\n return $this->ten_digit_prefix[substr($num,0,1)].' '.$this->discrete[substr($num,1,1)];\n }", "function convert_number($number) \n{ \n if (($number < 0) || ($number > 999999999)) \n { \n echo \"Number is out of range\";\n } \n\n \t//$Gn = floor($number / 1000000); /* Millions (giga) */ \n //$number -= $Gn * 1000000; \n\n $Gn = floor($number / 100000); /* Lakhs (giga) */ \n $number -= $Gn * 100000; \n $kn = floor($number / 1000); /* Thousands (kilo) */ \n $number -= $kn * 1000; \n $Hn = floor($number / 100); /* Hundreds (hecto) */ \n $number -= $Hn * 100; \n $Dn = floor($number / 10); /* Tens (deca) */ \n $n = $number % 10; /* Ones */ \n\n $res = \"\"; \n\n /*if ($Gn) \n { \n $res .= convert_number($Gn) . \" Millions\"; \n } */\n\n\tif ($Gn) \n { \n $res .= convert_number($Gn) . \" Lakhs\"; \n } \n\n if ($kn) \n { \n $res .= (empty($res) ? \"\" : \" \") . \n convert_number($kn) . \" Thousand\"; \n } \n\n if ($Hn) \n { \n $res .= (empty($res) ? \"\" : \" \") . \n convert_number($Hn) . \" Hundred\"; \n } \n\n $ones = array(\"\", \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \n \"Seven\", \"Eight\", \"Nine\", \"Ten\", \"Eleven\", \"Twelve\", \"Thirteen\", \n \"Fourteen\", \"Fifteen\", \"Sixteen\", \"Seventeen\", \"Eightteen\", \n \"Nineteen\"); \n $tens = array(\"\", \"\", \"Twenty\", \"Thirty\", \"Fourty\", \"Fifty\", \"Sixty\", \n \"Seventy\", \"Eigthy\", \"Ninety\"); \n\n if ($Dn || $n) \n { \n if (!empty($res)) \n { \n $res .= \" and \"; \n } \n\n if ($Dn < 2) \n { \n $res .= $ones[$Dn * 10 + $n]; \n } \n else \n { \n $res .= $tens[$Dn]; \n\n if ($n) \n { \n $res .= \"-\" . $ones[$n]; \n } \n } \n } \n\n if (empty($res)) \n { \n $res = \"zero\"; \n } \n\n return $res; \n}", "public function convert($number)\n {\n $number = str_replace('.', '', $number);\n if ( ! is_numeric($number)) throw new Exception(\"Please input number.\");\n $base = array('nol', 'satu', 'dua', 'tiga', 'empat', 'lima', 'enam', 'tujuh', 'delapan', 'sembilan');\n $numeric = array('1000000000000000', '1000000000000', '1000000000000', 1000000000, 1000000, 1000, 100, 10, 1);\n $unit = array('kuadriliun', 'triliun', 'biliun', 'milyar', 'juta', 'ribu', 'ratus', 'puluh', '');\n $str = null;\n $i = 0;\n if ($number == 0) {\n $str = 'nol';\n } else {\n while ($number != 0) {\n $count = (int)($number / $numeric[$i]);\n if ($count >= 10) {\n $str .= static::convert($count) . ' ' . $unit[$i] . ' ';\n } elseif ($count > 0 && $count < 10) {\n $str .= $base[$count] . ' ' . $unit[$i] . ' ';\n }\n $number -= $numeric[$i] * $count;\n $i++;\n }\n $str = preg_replace('/satu puluh (\\w+)/i', '\\1 belas', $str);\n $str = preg_replace('/satu (ribu|ratus|puluh|belas)/', 'se\\1', $str);\n $str = preg_replace('/\\s{2,}/', ' ', trim($str));\n }\n return $str;\n }", "function convertNum($num) {\n $num = (int) $num; // make sure it's an integer\n\n if ($num < 0)\n return 'negative' . convertTri(-$num, 0);\n\n if ($num == 0)\n return 'Zero';\n return convertTri($num, 0);\n}", "function th($number) {\n\treturn number_format(intval($number));\n}", "function convertToRupee($number){\r\n\t\t$no = round($number);\r\n\t\t$whole = floor($number); \r\n\t\t$point = $number - $whole; \r\n\r\n\t\t$hundred = null;\r\n\t\t$digits_1 = strlen($no);\r\n\t\t$i = 0;\r\n\t\t$str = array();\r\n\t\t$words = array('0' => '', '1' => 'One', '2' => 'Two',\r\n\t\t\t\t'3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six',\r\n\t\t\t\t'7' => 'Seven', '8' => 'Eight', '9' => 'Nine',\r\n\t\t\t\t'10' => 'Ten', '11' => 'Eleven', '12' => 'Twelve',\r\n\t\t\t\t'13' => 'Thirteen', '14' => 'fourteen',\r\n\t\t\t\t'15' => 'Fifteen', '16' => 'Sixteen', '17' => 'Seventeen',\r\n\t\t\t\t'18' => 'Eighteen', '19' =>'Nineteen', '20' => 'Twenty',\r\n\t\t\t\t'30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty',\r\n\t\t\t\t'60' => 'Sixty', '70' => 'Seventy',\r\n\t\t\t\t'80' => 'Eighty', '90' => 'Ninety');\r\n\t\t\t\t$digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');\r\n\t\twhile ($i < $digits_1) {\r\n\t\t\t$divider = ($i == 2) ? 10 : 100;\r\n\t\t\t$number = floor($no % $divider);\r\n\t\t\t$no = floor($no / $divider);\r\n\t\t\t$i += ($divider == 10) ? 1 : 2;\r\n\t\t\tif ($number) {\r\n\t\t\t\t$plural = (($counter = count($str)) && $number > 9) ? 's' : null;\r\n\t\t\t\t$hundred = ($counter == 1 && $str[0]) ? ' and ' : null;\r\n\t\t\t\t$str [] = ($number < 21) ? $words[$number] .\r\n\t\t\t\t\t\" \" . $digits[$counter] . $plural . \" \" . $hundred\r\n\t\t\t\t\t:\r\n\t\t\t\t\t$words[floor($number / 10) * 10]\r\n\t\t\t\t\t. \" \" . $words[$number % 10] . \" \"\r\n\t\t\t\t\t. $digits[$counter] . $plural . \" \" . $hundred;\r\n\t\t\t} else $str[] = null;\r\n\t\t}\r\n\t\t$str = array_reverse($str);\r\n\t\t$result = implode('', $str);\r\n\t\t$points = $this->paiseValue($point);\r\n\r\n\t\t$finalStr = '';\r\n\r\n\t\tif(!empty($result)){\r\n\t\t\t$finalStr .= $result. \" Rupees \";\r\n\t\t}\r\n\t\tif(!empty($points)){\r\n\t\t\t$finalStr .= \"and \".$points. \" Paise\";\r\n\t\t}\r\n\t\tif(!empty($finalStr)){\r\n\t\t\t$finalStr .= \" Only.\";\r\n\t\t}\r\n\r\n\t\treturn $finalStr;\r\n\t}", "public function __invoke($num) {\n if ( ($num / 10) % 10 != 1 ) {\n switch( $num % 10 ) {\n case 1: return $num . 'st';\n case 2: return $num . 'nd';\n case 3: return $num . 'rd';\n }\n }\n return $num . 'th';\n }", "function num2words($num, $c=0) {\n $ZERO = 'zero';\n $MINUS = 'minus';\n $lowName = array(\n /* zero is shown as \"\" since it is never used in combined forms */\n /* 0 .. 19 */\n \"\", \"One\", \"Two\", \"Three\", \"Four\", \"Five\",\n \"Six\", \"Seven\", \"Eight\", \"Nine\", \"Ten\",\n \"Eleven\", \"Twelve\", \"Thirteen\", \"Fourteen\", \"Fifteen\",\n \"Sixteen\", \"Seventeen\", \"Eighteen\", \"Nineteen\");\n \n $tys = array(\n /* 0, 10, 20, 30 ... 90 */\n \"\", \"\", \"Twenty\", \"Thirty\", \"Forty\", \"Fifty\",\n \"Sixty\", \"Seventy\", \"Eighty\", \"Ninety\");\n \n $groupName = array(\n /* We only need up to a quintillion, since a long is about 9 * 10 ^ 18 */\n /* American: unit, hundred, thousand, million, billion, trillion, quadrillion, quintillion */\n \"\", \"Hundred\", \"Thousand\", \"Million\", \"Billion\",\n \"Trillion\", \"Quadrillion\", \"Quintillion\");\n \n $divisor = array(\n /* How many of this group is needed to form one of the succeeding group. */\n /* American: unit, hundred, thousand, million, billion, trillion, quadrillion, quintillion */\n 100, 10, 1000, 1000, 1000, 1000, 1000, 1000) ;\n \n $num = str_replace(\",\",\"\",$num);\n $num = number_format($num,2,'.','');\n $cents = substr($num,strlen($num)-2,strlen($num)-1);\n $num = (int)$num;\n \n $s = \"\";\n \n if ( $num == 0 ) $s = $ZERO;\n $negative = ($num < 0 );\n if ( $negative ) $num = -$num;\n // Work least significant digit to most, right to left.\n // until high order part is all 0s.\n for ( $i=0; $num>0; $i++ ) {\n $remdr = (int)($num % $divisor[$i]);\n $num = $num / $divisor[$i];\n // check for 1100 .. 1999, 2100..2999, ... 5200..5999\n // but not 1000..1099, 2000..2099, ...\n // Special case written as fifty-nine hundred.\n // e.g. thousands digit is 1..5 and hundreds digit is 1..9\n // Only when no further higher order.\n if ( $i == 1 /* doing hundreds */ && 1 <= $num && $num <= 5 ){\n if ( $remdr > 0 ){\n $remdr = ($num * 10);\n $num = 0;\n } // end if\n } // end if\n if ( $remdr == 0 ){\n continue;\n }\n $t = \"\";\n if ( $remdr < 20 ){\n $t = $lowName[$remdr];\n }\n else if ( $remdr < 100 ){\n $units = (int)$remdr % 10;\n $tens = (int)$remdr / 10;\n $t = $tys [$tens];\n if ( $units != 0 ){\n $t .= \"-\" . $lowName[$units];\n }\n }else {\n $t = num2words($remdr, 0);\n }\n $s = $t.\" \".$groupName[$i].\" \".$s;\n $num = (int)$num;\n } // end for\n $s = trim($s);\n if ( $negative ){\n $s = $MINUS . \" \" . $s;\n }\n \n if ($c == 1) $s .= \" and $cents/100\";\n \n return $s;\n}", "function int_to_str($i) {\n\treturn implode('.', int_to_digits($i));\n}", "public function convert($num)\n {\n if(strlen($num)>48) \n {\n $this->error=\"Number out of bounds\";\n return $this->error;\n }\n \n //check if first \n if(substr($num,0,1)==\"-\")\n {\n $this->sentence.='minus ';\n $num=substr($num,1,strlen($num)-1);\n }\n \n if(strlen($num)<=3)\n {\n $this->sentence.=$this->decider($num);\n }\n else\n {\n $k=strrev($num);\n for($i=0;$i<strlen($k);$i=$i+3){$arro[]=strrev(substr($k,$i,3));}\n //reverse again\n $arro=array_reverse($arro);\n //print_r($arro);\n $mool=ceil(strlen($num)/3);\n if((strlen($num)%3)==0){$mool--;}\n //return $this->decider($arro[0]);\n $this->sentence.=$this->decider($arro[0]).' '.$this->mool_array[$mool];\n $mool--;\n //leave the first one and prepare string of others\n $arrlen=count($arro);\n for($i=1;$i<$arrlen;$i++)\n {\n $this->sentence.=' '.$this->decider($arro[$i]);\n if($mool!=0)\n {\n $this->sentence=' '.$this->sentence.' '.$this->mool_array[$mool];\n }\n $mool--;\n }\n }\n return ucfirst(trim($this->sentence));\n }", "public function getTextForNumber($number)\n {\n if ($this->isDivisibleByFive($number) && $this->isDivisibleByThree($number)) {\n return 'FizzBuzz';\n }\n\n if ($this->isDivisibleByThree($number)) {\n return 'Fizz';\n }\n\n if ($this->isDivisibleByFive($number)) {\n return 'Buzz';\n }\n \n return (string) $number;\n }", "public function formatNumber($number);", "function displayNumberWords($number,$preOne=\"\",$preOther=\"\",$postOne=\"\",$postOther=\"\",$decimalPlaces=0) {\r\n\r\n\tglobal $dss_numberWords;\r\n\t\r\n\tif ($number == 1) return $preOne.\" \".$dss_numberWords[$number].\" \".$postOne;\r\n\telseif ($number < 13) return $preOther.\" \".$dss_numberWords[$number].\" \".$postOther;\r\n\telse return $preOther.\" \".number_format($number,$decimalPlaces).\" \".$postOther;\r\n\t\r\n}", "function convertNum($num) {\n$num = (int) $num; // make sure it's an integer\n\nif ($num < 0)\nreturn \"negative\".convertTri(-$num, 0);\n\nif ($num == 0)\nreturn \"zero\";\n\nreturn convertTri($num, 0);\n}", "private function threedigits($num)\n { if($this->discrete[substr($num,0,1)]!=\"\" && $this->twodigits(substr($num,1,2))!=\"\")\n return $this->discrete[substr($num,0,1)].' hundred and '.$this->twodigits(substr($num,1,2));\n else if($this->discrete[substr($num,0,1)]!=\"\")\n return $this->discrete[substr($num,0,1)].' hundred';\n else\n return \"\";\n }", "public function changeCurrencytowords($number)\n {\n /*$number = 190908100.25;*/\n $no = round($number);\n /* if($number < $no){\n $point = round($no - $number , 2) * 100;\n }else{\n $point = round($number - $no, 2) * 100;\n }*/\n\n $hundred = null;\n $digits_1 = strlen($no);\n $i = 0;\n $str = array();\n $words = array('0' => '', '1' => 'One', '2' => 'Two',\n '3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six',\n '7' => 'Seven', '8' => 'Eight', '9' => 'Nine',\n '10' => 'Ten', '11' => 'Eleven', '12' => 'Twelve',\n '13' => 'Thirteen', '14' => 'Fourteen',\n '15' => 'Fifteen', '16' => 'Sixteen', '17' => 'Seventeen',\n '18' => 'Eighteen', '19' => 'Nineteen', '20' => 'Twenty',\n '30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty',\n '60' => 'Sixty', '70' => 'Seventy',\n '80' => 'Eighty', '90' => 'Ninety');\n $digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');\n\n while ($i < $digits_1) {\n\n $divider = ($i == 2) ? 10 : 100;\n $number = floor($no % $divider);\n $no = floor($no / $divider);\n $i += ($divider == 10) ? 1 : 2;\n if ($number) {\n $plural = (($counter = count($str)) && $number > 9) ? 's' : null;\n $hundred = ($counter == 1 && $str[0]) ? ' and ' : null;\n $str[] = ($number < 21) ? $words[$number] .\n \" \" . $digits[$counter] . $plural . \" \" . $hundred\n :\n $words[floor($number / 10) * 10]\n . \" \" . $words[$number % 10] . \" \"\n . $digits[$counter] . $plural . \" \" . $hundred;\n } else {\n $str[] = null;\n }\n\n }\n\n $str = array_reverse($str);\n $result = implode('', $str);\n\n /*$points = ($point) ?\n \".\" . $words[$point / 10] . \" \" .\n $words[$point = $point % 10]. \" Paise\" : '';*/\n\n return $result . \"Rupees \"; //. $points\n }", "function forDecimal($num){\n global $ones,$tens;\n $str=\"\";\n $len = strlen($num);\n if($len==1){\n $num=$num*10;\n }\n $x= $num%100;\n if($x>0){\n if($x<20){\n $str = $ones[$x].' Paise';\n }else{\n $str = $ones[$x/10].$ones[$x%10].' Paise';\n }\n }\n return $str;\n }", "function wolf_share_format_number( $n = 0 ) {\n\n\t$s = array( 'K', 'M', 'G', 'T' );\n\t$out = '';\n\twhile ( $n >= 1000 && count( $s ) > 0) {\n\t\t$n = $n / 1000.0;\n\t\t$out = array_shift( $s );\n\t}\n\treturn round( $n, max( 0, 3 - strlen( (int)$n ) ) ) .\" $out\";\n}", "function convert_number($n) {\r\r\n if($n != ''){\r\r\n $n = (0+str_replace(\",\", \"\", $n));\r\r\n }\r\r\n\r\r\n //if (!is_numeric($n)) return false;\r\r\n\r\r\n if ($n > 1000000000000) return round(($n/1000000000000), 2).'T';\r\r\n elseif ($n > 1000000000) return round(($n/1000000000), 2).'B';\r\r\n elseif ($n > 1000000) return round(($n/1000000), 2).'M';\r\r\n elseif ($n > 1000) return round(($n/1000), 2).'Th';\r\r\n \r\r\n return number_format($n);\r\r\n }", "function convertNumToWord($n) {\n $arr = array(\n 0 => 'twelve',\n 1 => 'one',\n 2 => 'two', \n 3 => 'three',\n 4 => 'four',\n 5 => 'five', \n 6 => 'six',\n 7 => 'seven',\n 8 => 'eight', \n 9 => 'nine',\n 10 => 'ten',\n 11 => 'eleven',\n 12 => 'twelve',\n 13 => 'thirteen',\n 14 => 'fourteen',\n 15 => 'fifteen',\n 16 => 'sixteen',\n 17 => 'seventeen',\n 18 => 'eighteen',\n 19 => 'nineteen',\n 20 => 'twenty',\n 21 => 'twenty one',\n 22 => 'twenty two',\n 23 => 'twenty three',\n 24 => 'twenty four',\n 25 => 'twenty five',\n 26 => 'twenty six',\n 27 => 'twenty seven',\n 28 => 'twenty eight',\n 29 => 'twenty nine',\n 30 => 'thirty'\n );\n return $arr[$n];\n}", "function convert_number_to_words($number)\n\t{\n\t\t$hyphen = '-';\n\t\t$conjunction = ' and ';\n\t\t$separator = ', ';\n\t\t$negative = 'negative ';\n\t\t$decimal = ' point ';\n\t\t$dictionary = array(\n\t\t\t0 => 'zero',\n\t\t\t1 => 'one',\n\t\t\t2 => 'two',\n\t\t\t3 => 'three',\n\t\t\t4 => 'four',\n\t\t\t5 => 'five',\n\t\t\t6 => 'six',\n\t\t\t7 => 'seven',\n\t\t\t8 => 'eight',\n\t\t\t9 => 'nine',\n\t\t\t10 => 'ten',\n\t\t\t11 => 'eleven',\n\t\t\t12 => 'twelve',\n\t\t\t13 => 'thirteen',\n\t\t\t14 => 'fourteen',\n\t\t\t15 => 'fifteen',\n\t\t\t16 => 'sixteen',\n\t\t\t17 => 'seventeen',\n\t\t\t18 => 'eighteen',\n\t\t\t19 => 'nineteen',\n\t\t\t20 => 'twenty',\n\t\t\t30 => 'thirty',\n\t\t\t40 => 'fourty',\n\t\t\t50 => 'fifty',\n\t\t\t60 => 'sixty',\n\t\t\t70 => 'seventy',\n\t\t\t80 => 'eighty',\n\t\t\t90 => 'ninety',\n\t\t\t100 => 'hundred',\n\t\t\t1000 => 'thousand',\n\t\t\t1000000 => 'million',\n\t\t\t1000000000 => 'billion',\n\t\t\t1000000000000 => 'trillion',\n\t\t\t1000000000000000 => 'quadrillion',\n\t\t\t1000000000000000000 => 'quintillion'\n\t\t);\n\n\t\tif (!is_numeric($number)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (($number >= 0 && (int) $number < 0) || (int) $number < 0 - PHP_INT_MAX) {\n\t\t\t// overflow\n\t\t\ttrigger_error(\n\t\t\t\t'convert_number_to_words only accepts numbers between -' . PHP_INT_MAX . ' and ' . PHP_INT_MAX,\n\t\t\t\tE_USER_WARNING\n\t\t\t);\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($number < 0) {\n\t\t\treturn $negative . convert_number_to_words(abs($number));\n\t\t}\n\n\t\t$string = $fraction = null;\n\n\t\tif (strpos($number, '.') !== false) {\n\t\t\tlist($number, $fraction) = explode('.', $number);\n\t\t}\n\n\t\tswitch (true) {\n\t\t\tcase $number < 21:\n\t\t\t\t$string = $dictionary[$number];\n\t\t\t\tbreak;\n\t\t\tcase $number < 100:\n\t\t\t\t$tens = ((int) ($number / 10)) * 10;\n\t\t\t\t$units = $number % 10;\n\t\t\t\t$string = $dictionary[$tens];\n\t\t\t\tif ($units) {\n\t\t\t\t\t$string .= $hyphen . $dictionary[$units];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase $number < 1000:\n\t\t\t\t$hundreds = $number / 100;\n\t\t\t\t$remainder = $number % 100;\n\t\t\t\t$string = $dictionary[$hundreds] . ' ' . $dictionary[100];\n\t\t\t\tif ($remainder) {\n\t\t\t\t\t$string .= $conjunction . convert_number_to_words($remainder);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$baseUnit = pow(1000, floor(log($number, 1000)));\n\t\t\t\t$numBaseUnits = (int) ($number / $baseUnit);\n\t\t\t\t$remainder = $number % $baseUnit;\n\t\t\t\t$string = convert_number_to_words($numBaseUnits) . ' ' . $dictionary[$baseUnit];\n\t\t\t\tif ($remainder) {\n\t\t\t\t\t$string .= $remainder < 100 ? $conjunction : $separator;\n\t\t\t\t\t$string .= convert_number_to_words($remainder);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (null !== $fraction && is_numeric($fraction)) {\n\t\t\t$string .= $decimal;\n\t\t\t$words = array();\n\t\t\tforeach (str_split((string) $fraction) as $number) {\n\t\t\t\t$words[] = $dictionary[$number];\n\t\t\t}\n\t\t\t$string .= implode(' ', $words);\n\t\t}\n\n\t\treturn $string;\n\t}", "public function convert($number)\n {\n if ($number % 15 == 0) {\n return \"FizzBuzz\";\n } elseif ($number % 3 == 0) {\n return \"Fizz\";\n } elseif ($number % 5 == 0) {\n return \"Buzz\";\n }\n \n return $number;\n }", "function nb2chiffres($nb){\n\treturn sprintf(\"%02d\", $nb);\n}", "public function nice_number($n) {\r\n $n = (0+str_replace(\",\", \"\", $n));\r\n\r\n // is this a number?\r\n if (!is_numeric($n)) return false;\r\n\r\n // now filter it;\r\n if ($n > 1000000000000) return round(($n/1000000000000), 2).' T'; //trillion\r\n elseif ($n > 1000000000) return round(($n/1000000000), 2).' B'; //billion\r\n elseif ($n > 1000000) return round(($n/1000000), 2).' M';//million\r\n elseif ($n > 1000) return round(($n/1000), 2).' TH'; //thousand\r\n\r\n return number_format($n);\r\n}", "function numeral($number) {\r\n $test = abs($number) % 10;\r\n $ext = ((abs($number) % 100 < 21 and abs($number) % 100 > 4) ? 'th' : (($test < 4) ? ($test < 3) ? ($test < 2) ? ($test < 1) ? 'th' : 'st' : 'nd' : 'rd' : 'th'));\r\n return $number . $ext;\r\n}", "function changeNumToStr($num = 0){\n\n $str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n $arr_tmp = [];\n\n while($num > 26) {\n\n $step = $num % 26;\n $arr_tmp[] = $step;\n $num = $num/26;\n\n }\n\n $arr_tmp[] = (int)floor($num);\n $arr_tmp = array_reverse($arr_tmp);\n $res_str = '';\n foreach ($arr_tmp as $str_key) {\n $res_str .= $str[$str_key-1];\n }\n return $res_str;\n}", "function dokan_number_format( $number ) {\n $threshold = 10000;\n\n if ( $number > $threshold ) {\n return number_format( $number/1000, 0, '.', '' ) . ' K';\n }\n\n return $number;\n}", "function number_to_words($val, $lang = \"en\") {\n $f = new NumberFormatter($lang, NumberFormatter::SPELLOUT);\n return $f->format($val);\n}", "function nice_number( $n ) {\n\t$n = (0 + str_replace( ',', '', $n ) );\n\t// is this a number? (o yes, almost certain - but...)\n\tif ( ! is_numeric( $n ) ) return false;\n\t// now filter it;\n\tif ( $n > 1000000000000 ) return round( ($n / 1000000000000), 1 ) . 't';\n\telse if ( $n > 1000000000 ) return round( ($n / 1000000000), 1 ) . 'b';\n\telse if ( $n > 1000000 ) return round( ($n / 1000000), 1 ) . 'm';\n\telse if ( $n > 1000 ) return round( ($n / 1000), 1 ) . 'k';\n\treturn number_format( $n );\n}", "public static function int2str(int $i): string\n {\n return base_convert(dechex($i), 16, 36);\n }", "private function convertToWord($number)\n {\n $error_code = $this->checkParamaters($number, 'w');\n\n if ($error_code > 0) {\n return self::$error_codes[$error_code];\n }\n\n $hyphen = '-';\n $conjunction = ' and ';\n $separator = ', ';\n $negative = 'negative ';\n $decimal = ' point ';\n\n if ($number < 0) {\n return $negative.$this->convertToWord(abs($number));\n }\n\n $string = $fraction = null;\n\n if (strpos($number, '.') !== false) {\n list($number, $fraction) = explode('.', $number);\n }\n\n switch (true) {\n case $number < 21:\n $string = $this->word_dictionary[$number];\n break;\n case $number < 100:\n $tens = ((int) ($number / 10)) * 10;\n $units = $number % 10;\n $string = $this->word_dictionary[$tens];\n if ($units) {\n $string .= $hyphen.$this->word_dictionary[$units];\n }\n break;\n case $number < 1000:\n $hundreds = $number / 100;\n $remainder = $number % 100;\n $string = $this->word_dictionary[$hundreds].' '.$this->word_dictionary[100];\n if ($remainder) {\n $string .= $conjunction.$this->convertToWord($remainder);\n }\n break;\n default:\n $baseUnit = pow(1000, floor(log($number, 1000)));\n $numBaseUnits = (int) ($number / $baseUnit);\n $remainder = $number % $baseUnit;\n $string = $this->convertToWord($numBaseUnits).' '.$this->word_dictionary[$baseUnit];\n if ($remainder) {\n $string .= $remainder < 100 ? $conjunction : $separator;\n $string .= $this->convertToWord($remainder);\n }\n break;\n }\n\n if (null !== $fraction && is_numeric($fraction)) {\n $string .= $decimal;\n $words = [];\n foreach (str_split((string) $fraction) as $number) {\n $words[] = $this->word_dictionary[$number];\n }\n $string .= implode(' ', $words);\n }\n\n return $string;\n }", "public function numberToLetters(int $number) : string\n {\n $number -= 1;\n for($r = \"\"; $number >= 0; $number = intval($number / 26) - 1) {\n $r = chr($number%26 + 0x41) . $r;\n }\n return $r;\n }", "function num_to_short($num)\n{\n\tif (is_float($num))\n\t\t$num = round($num);\n\t\n\tif ($num >= 1000) {\n\t\t$i = 1000;\n\t\twhile ($num >= $i) {\n\t\t\t$return = ($i/1000). \"K\";\n\t\t\t\n\t\t\tif ($num > $i)\n\t\t\t\t$return .= \"+\";\n\t\t\t\n\t\t\t$i += 1000;\n\t\t}\n\t} else\n\t\t$return = $num;\n\t\n\treturn $return;\n}", "function show_ordinal($num) \n\t{\n\t\t$the_num = (string) $num;\n\t\t$last_digit = substr($the_num, -1, 1);\n\t\tswitch($last_digit) \n\t\t{\n\t\t\tcase \"1\":\n\t\t\t\t$the_num.=\"st\";\n\t\t\t\tbreak;\n\t\t\tcase \"2\":\n\t\t\t\t$the_num.=\"nd\";\n\t\t\t\tbreak;\n\t\t\tcase \"3\":\n\t\t\t\t$the_num.=\"rd\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$the_num.=\"th\";\n\t\t}\n\t\treturn $the_num;\n\t}", "function convertNumberToWordsForIndia($number){\n $words = array(\n '0'=> '' ,'1'=> 'one' ,'2'=> 'two' ,'3' => 'three','4' => 'four','5' => 'five',\n '6' => 'six','7' => 'seven','8' => 'eight','9' => 'nine','10' => 'ten',\n '11' => 'eleven','12' => 'twelve','13' => 'thirteen','14' => 'fouteen','15' => 'fifteen',\n '16' => 'sixteen','17' => 'seventeen','18' => 'eighteen','19' => 'nineteen','20' => 'twenty',\n '30' => 'thirty','40' => 'fourty','50' => 'fifty','60' => 'sixty','70' => 'seventy',\n '80' => 'eighty','90' => 'ninty');\n \n //First find the length of the number\n $number_length = strlen($number);\n //Initialize an empty array\n $number_array = array(0,0,0,0,0,0,0,0,0);\n $received_number_array = array();\n \n //Store all received numbers into an array\n for($i=0;$i<$number_length;$i++){\n $received_number_array[$i] = substr($number,$i,1);\n }\n //Populate the empty array with the numbers received - most critical operation\n for($i=9-$number_length,$j=0;$i<9;$i++,$j++){\n $number_array[$i] = $received_number_array[$j];\n }\n $number_to_words_string = \"\";\n //Finding out whether it is teen ? and then multiply by 10, example 17 is seventeen, so if 1 is preceeded with 7 multiply 1 by 10 and add 7 to it.\n for($i=0,$j=1;$i<9;$i++,$j++){\n //\"01,23,45,6,78\"\n //\"00,10,06,7,42\"\n //\"00,01,90,0,00\"\n if($i==0 || $i==2 || $i==4 || $i==7){\n if($number_array[$j]==0 || $number_array[$i] == \"1\"){\n $number_array[$j] = intval($number_array[$i])*10+$number_array[$j];\n $number_array[$i] = 0;\n }\n \n }\n }\n $value = \"\";\n for($i=0;$i<9;$i++){\n if($i==0 || $i==2 || $i==4 || $i==7){\n $value = $number_array[$i]*10;\n }\n else{\n $value = $number_array[$i];\n }\n if($value!=0) { $number_to_words_string.= $words[\"$value\"].\" \"; }\n if($i==1 && $value!=0){ $number_to_words_string.= \"Crores \"; }\n if($i==3 && $value!=0){ $number_to_words_string.= \"Lakhs \"; }\n if($i==5 && $value!=0){ $number_to_words_string.= \"Thousand \"; }\n if($i==6 && $value!=0){ $number_to_words_string.= \"Hundred &amp; \"; }\n }\n if($number_length>9){ $number_to_words_string = \"Sorry This does not support more than 99 Crores\"; }\n return ucfirst(strtolower($number_to_words_string).\" only.\");\n}", "function bd_nice_number($n) {\n // Strip any formatting;\n $n = (0+str_replace(\",\",\"\",$n));\n \n // Check if it's a num\n if(!is_numeric($n)) return false;\n \n // Filter through trillions, billions, and millions\n if($n>1000000000000) return round(($n/1000000000000),2).'T';\n else if($n>1000000000) return round(($n/1000000000),2).'B';\n else if($n>1000000) return round(($n/1000000),2).'M';\n \n return number_format($n);\n}", "function formatNumber($number)\n {\n $stringLength = strlen($number);\n\n if ($stringLength > 5) {\n return round($number / 1000, 2).'K';\n }\n return $number;\n }", "function modify_number($number){\n //get the part of the string after the first zero\n $num = substr($number,1,strlen($number));\n //chunk the number into groups of threes\n $num_chunked = chunk_split($num,3,' ');\n return ' (0) '.$num_chunked;\n}", "function toChinese($number) {\n $wording = str_split((string)$number);\n\n $numberArray = ['十', '一', '二', '三', '四', '五', '六', '七', '八', '九'];\n $tenNumberArray = ['十', '廿', '卅', '四', '五', '六', '七', '八', '九'];\n\n if ($number > 10) {\n return $tenNumberArray[(int)$wording[0] - 1] . $numberArray[(int)$wording[1]];\n }\n if ($number == 10) {\n return '十' . '岁';\n }\n return $numberArray[(int)$wording[0]] . '岁';\n }", "public static function formatted(int $number): string {\n if($number > 100 && $number % 100 !== 0){ \n $prepend = 'and'; \n } else {\n $prepend = ''; \n }\n return str_replace(['-',' '],'',self::format($number)).$prepend;\n }", "function convertNumber($num) {\n $count = 0;\n global $ones, $tens, $triplets;\n $ones = array(\n '',\n ' One',\n ' Two',\n ' Three',\n ' Four',\n ' Five',\n ' Six',\n ' Seven',\n ' Eight',\n ' Nine',\n ' Ten',\n ' Eleven',\n ' Twelve',\n ' Thirteen',\n ' Fourteen',\n ' Fifteen',\n ' Sixteen',\n ' Seventeen',\n ' Eighteen',\n ' Nineteen'\n );\n $tens = array(\n '',\n '',\n ' Twenty',\n ' Thirty',\n ' Forty',\n ' Fifty',\n ' Sixty',\n ' Seventy',\n ' Eighty',\n ' Ninety'\n );\n\n $triplets = array(\n '',\n ' Thousand',\n ' Million',\n ' Billion',\n ' Trillion',\n ' Quadrillion',\n ' Quintillion',\n ' Sextillion',\n ' Septillion',\n ' Octillion',\n ' Nonillion'\n );\n return convertNum($num);\n}", "public function getInWords($number)\n {\n return NumberToString::numberToString($number);\n }", "function transNumber($input) \n{\n $faRes=\"\";\n $input=\"$input\";\n $len=strlen($input);\n for ($i=0; $i<$len; $i++)\n switch($input[$i]) {\n case \"0\": $faRes.=\"۰\"; break;\n case \"1\": $faRes.=\"۱\"; break;\n case \"2\": $faRes.=\"۲\"; break;\n case \"3\": $faRes.=\"۳\"; break;\n case \"4\": $faRes.=\"۴\"; break;\n case \"5\": $faRes.=\"۵\"; break;\n case \"6\": $faRes.=\"۶\"; break;\n case \"7\": $faRes.=\"۷\"; break;\n case \"8\": $faRes.=\"۸\"; break;\n case \"9\": $faRes.=\"۹\"; break;\n default: $faRes.= $input[$i]; break;\n }\n return $faRes;\n}", "public static function format(int $number): string {\n $f = new \\NumberFormatter(\"en-GB\", \\NumberFormatter::SPELLOUT);\n return $f->format($number);\n }", "function timify($input) {return \"about \".round($input*100)/100;}", "function format_number_in_french($number)\n {\n return number_format($number, 2, ',', ' ');\n }", "public static function numberToWord($number, $isnepali = false)\n {\n if($isnepali)\n $number = self::nepaliToEnglish($number);\n $nepali = '';\n //convert the word to nepali language text\n $number = strval($number);\n //first of all, seperate it into integer and float\n $intval = intval($number);\n $floatval = 0;\n $numberofzeros = 0;\n //get value after decimal place\n if( ($position = strpos($number,'.')) !== FALSE)\n {\n //find leading zeros in floating point value\n for($j = $position+1; $j < strlen($number) ; $j++)\n if(intval($number[$j]) != 0)\n break;\n else\n $numberofzeros++;\n $floatval = intval(substr($number,$position+1,strlen($number)-$position));\n }\n if($intval >= 100)\n {\n foreach( self::$abovehundred as $denom => $word)\n {\n if($intval >= $denom)\n {\n $nepali .= self::numberToWord(intval($intval/$denom)).\" \".$word.\" \";\n $intval = $intval % $denom;\n }\n }\n }\n //if it is less than 100, then problem solved\n if($intval < 100)\n {\n if(strlen($nepali) > 0)\n {\n if($intval != 0)\n $nepali .= self::$belowhundred[$intval].' ';\n }\n else\n $nepali .= self::$belowhundred[$intval].' ';\n }\n\n\n if($floatval > 0)\n {\n $nepali .='दस्मलब ';\n for($j = 0;$j < $numberofzeros; $j++)\n $nepali .= self::$belowhundred[0].' ';\n $floatval = strval($floatval);\n for($j=0; $j < strlen($floatval); $j++)\n $nepali .= self::$belowhundred[intval($floatval[$j])].' ';\n }\n return $nepali;\n }", "public function formaRatingtNumber($number)\n {\n return number_format($number, 2, '.', '');\n }", "function coord2Text ( $coord ) {\n\t\t$signe = ($coord == abs($coord)) ? \"\" : \"-\" ;\n\t\t$coord = abs($coord);\n \n\t\t$text = $signe;\n\t\t$graus = $coord;\n\t\t$minuts = ($graus - floor($graus)) * 60;\n\t\t$segons = ($minuts - floor($minuts)) * 60;\n\t\t\n\t\t$text .= floor($graus) . \"º\" . floor($minuts) . \"'\" . floor($segons*10000)/10000 . \"''\";\n \n\t\treturn $text;\n}", "function convertTri($num, $tri) {\n global $ones, $tens, $triplets, $count;\n $test = $num;\n $count++;\n // chunk the number, ...rxyy\n // init the output string\n $str = '';\n // to display hundred & digits\n if ($count == 1) {\n $r = (int) ($num / 1000);\n $x = ($num / 100) % 10;\n $y = $num % 100;\n // do hundreds\n if ($x > 0) {\n $str = $ones[$x] . ' Hundred';\n // do ones and tens\n $str .= commonloop($y, ' and ', '');\n }\n else if ($r > 0) {\n // do ones and tens\n $str .= commonloop($y, ' and ', '');\n }\n else {\n // do ones and tens\n $str .= commonloop($y);\n }\n }\n // To display lakh and thousands\n else if($count == 2) {\n $r = (int) ($num / 10000);\n $x = ($num / 100) % 100;\n $y = $num % 100;\n $str .= commonloop($x, '', ' Lakh ');\n $str .= commonloop($y);\n if ($str != '')\n $str .= $triplets[$tri];\n }\n // to display till hundred crore\n else if($count == 3) {\n $r = (int) ($num / 1000);\n $x = ($num / 100) % 10;\n $y = $num % 100;\n // do hundreds\n if ($x > 0) {\n $str = $ones[$x] . ' Hundred';\n // do ones and tens\n $str .= commonloop($y,' and ',' Crore ');\n }\n else if ($r > 0) {\n // do ones and tens\n $str .= commonloop($y,' and ',' Crore ');\n }\n else {\n // do ones and tens\n $str .= commonloop($y);\n }\n }\n else {\n $r = (int) ($num / 1000);\n }\n // add triplet modifier only if there\n // is some output to be modified...\n // continue recursing?\n if ($r > 0)\n return convertTri($r, $tri+1) . $str;\n else\n return $str;\n}", "public static function nice_number($number){\n\t\treturn number_format($number,0,'',',');\n\t}", "public static function toWord($digits){\n $digits = str_replace(',','.',$digits);\n if(is_numeric($digits)){\n $digitsArrray = explode('.', $digits);\n\n $digits = $digitsArrray[0];\n $ret_string = \"\";\n $sub_ret_string = \"\";\n\n for($i = 10; $i>=0; $i--){\n $pw = pow(1000,$i);\n \n if((int)($digits / $pw) != 0){\n \n $str = (int)($digits / $pw);\n \n if((strlen($str) - 3) == -1){\n $sub_dig = substr($str, (strlen($str) - 2), 3);\n }else{\n $sub_dig = substr($str, (strlen($str) - 3), 3);\n }\n \n $sub_len = strlen($sub_dig);\n \n $flag = false;\n $sub_ret_string = \"\";\n for($j=0; $j<$sub_len; $j++){\n $post = ($sub_len-1) - $j;\n\n if($sub_len == 3){\n if($j == 1 && $sub_dig[$j] == 1){\n $ret_string .= self::getDigitName( $sub_dig[$j].$sub_dig[$j+1], $post, $i).' ';\n $sub_ret_string .= $sub_dig[$j].$sub_dig[$j+1];\n $flag = true;\n }\n if(!$flag){\n $ret_string .= self::getDigitName( $sub_dig[$j], $post, $i).' ';\n $sub_ret_string .= $sub_dig[$j];\n }\n }elseif($sub_len == 2){\n if($j == 0 && $sub_dig[$j] == 1){\n $ret_string .= self::getDigitName( $sub_dig[$j].$sub_dig[$j+1], $post, $i).' ';\n $sub_ret_string .= $sub_dig[$j].$sub_dig[$j+1];\n $flag = true;\n }\n if(!$flag){\n $ret_string .= self::getDigitName( $sub_dig[$j], $post, $i).' ';\n $sub_ret_string .= $sub_dig[$j];\n }\n }else{\n $ret_string .= self::getDigitName( $sub_dig[$j], $post, $i).' ';\n $sub_ret_string .= $sub_dig[$j];\n }\n }\n $ret_string .= self::getTriolName($pw, $sub_ret_string).' ';\n }\n }\n $ret_string = self::mb_ucfirst($ret_string);\n return [$ret_string, empty($digitsArrray[1])? \"00\":$digitsArrray[1]];\n }\n return [\"0\",\"00\"];\n }", "public static function human_number( $number ) {\n\n\t\tif ( ! is_numeric( $number ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t$negative = '';\n\t\tif ( abs( $number ) != $number ) {\n\t\t\t$negative = '-';\n\t\t\t$number = abs( $number );\n\t\t}\n\n\t\tif ( $number < 1000 ) {\n\t\t\treturn $negative ? -1 * $number : $number;\n\t\t}\n\n\t\t$unit = intval( log( $number, 1000 ) );\n\t\t$units = array( '', 'K', 'M', 'B', 'T', 'Q' );\n\n\t\tif ( array_key_exists( $unit, $units ) ) {\n\t\t\treturn sprintf( '%s%s%s', $negative, rtrim( number_format( $number / pow( 1000, $unit ), 1 ), '.0' ), $units[ $unit ] );\n\t\t}\n\n\t\treturn $number;\n\t}", "function num2alpha($n)\n{\n $r = '';\n\n while($n > 0)\n {\n $r = chr(($n % 26) + 0x41) . $r;\n $n = intval($n / 26);\n }\n\n return $r;\n}", "function covertirNumLetras()\r\n{\r\n\r\n\t$number = $this->monto;\r\n\r\n\t//number = number_format (number, 2);\r\n $number1=$number;\r\n\r\n\r\n //settype (number, \"integer\");\r\n $cent = strpos($number1,\".\");\r\n\r\n if($cent > 0){\r\n\t\r\n\t$centavos = substr($number1,$cent+1,2);\r\n\t\r\n }else{\r\n\r\n \t$centavos = \"00\";\r\n\t\r\n\t}\r\n\t/* \r\n\t $cent = split(\".\",$number1,7); \r\n\r\n\t\techo $cent[4];\r\n\t\texit();\r\n\r\n\t $centavos = $cent[1];\r\n\r\n\t if ($centavos == 0 || empty($centavos)){\r\n\t \t$centavos = \"00\";\r\n\t }\r\n\t*/\r\n\t/*\r\n\t \r\n\t if (number == 0 || number == \"\") \r\n\t { // if amount = 0, then forget all about conversions, \r\n\t centenas_final_string=\" cero \"; // amount is zero (cero). handle it externally, to \r\n\t // function breakdown \r\n\t } \r\n\t else \r\n\t { \r\n \r\n \r\n\r\n\t \r\n millions = ObtenerParteEntDiv(number, 1000000); // first, send the millions to the string \r\n number = mod(number, 1000000); // conversion function \r\n \r\n\t alert(millions);\r\n\t \r\n if (millions != 0)\r\n { \r\n // This condition handles the plural case \r\n if (millions == 1) \r\n { // if only 1, use 'millon' (million). if \r\n descriptor= \" millon \"; // > than 1, use 'millones' (millions) as \r\n } \r\n else \r\n { // a descriptor for this triad. \r\n descriptor = \" millones \"; \r\n } \r\n } \r\n else \r\n { \r\n descriptor = \" \"; // if 0 million then use no descriptor. \r\n } \r\n millions_final_string = string_literal_conversion(millions)+descriptor; \r\n */ \r\n\r\n\r\n $thousands = $this->ObtenerParteEntDiv($number, 1000); // now, send the thousands to the string \r\n $number = fmod($number, 1000); // conversion function. \r\n //print \"Th:\".thousands;\r\n if ($thousands != 1) \r\n { // This condition eliminates the descriptor \r\n $thousands_final_string = $this->string_literal_conversion($thousands) . \" mil \"; \r\n // descriptor = \" mil \"; // if there are no thousands on the amount \r\n } \r\n if ($thousands == 1)\r\n {\r\n $thousands_final_string = \" mil \"; \r\n }\r\n if ($thousands < 1) \r\n { \r\n $thousands_final_string = \" \"; \r\n } \r\n \r\n // this will handle numbers between 1 and 999 which \r\n // need no descriptor whatsoever. \r\n\r\n\r\n $centenas = $number; \r\n $centenas_final_string = $this->string_literal_conversion($centenas) ; \r\n \r\n\t// } //end if (number ==0) \r\n\r\n /*if (ereg(\"un\",centenas_final_string))\r\n {\r\n centenas_final_string = ereg_replace(\"\",\"o\",centenas_final_string); \r\n }*/\r\n //finally, print the output. \r\n\r\n /* Concatena los millones, miles y cientos*/\r\n\r\n\r\n $cad = $thousands_final_string.$centenas_final_string; \r\n \r\n /* Convierte la cadena a Mayúsculas*/\r\n $cad = strtoupper($cad); \r\n\r\n\r\n\r\n\t/*\r\n\t if (strlen($centavos) > 2)\r\n\t { \r\n\t if(substr($centavos.substring,2,3) >= 5){\r\n\t $centavos = substr($centavos,0,1).(parseInt(centavos.substring(1,2)).1).toString();\r\n\t }else{\r\n\t centavos = centavos.substring(0,2);\r\n\t }\r\n\t }\r\n\r\n\t*/\r\n\r\n\r\n if (strlen($centavos) == 1)\r\n {\r\n $centavos = $centavos.\"0\";\r\n }\r\n $centavos = $centavos. \"/100\"; \r\n\r\n\r\n if ($number == 1)\r\n {\r\n $moneda = \" PESO \"; \r\n }\r\n else\r\n {\r\n $moneda = \" PESOS \"; \r\n }\r\n \r\n /* Regresa el número en cadena entre paréntesis y con tipo de moneda y la fase M.N.*/\r\n\r\n return $cad.$moneda.\" \".$centavos.\" M.N.\";\r\n \r\n}", "function base_convert($number, $source, $target): string\n{\n return Base::convert($number, $source, $target);\n}", "public static function shortEncode(int $num): string {\n $codes = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $array = [];\n while ($num > 0){\n $array[] = $num % 62;\n $num = floor($num / 62);\n }\n if (count($array) < 1) $array = [0];\n foreach ($array as &$value) {\n $value = $codes[$value];\n }\n return strrev(implode('',$array));\n }", "function get_string_number($num) {\n // TODO: Add simple hashing [check array, add if not already there]\n $this->load_tables();\n $meta = $this->ORIGINALS[$num];\n $length = $meta[0];\n $offset = $meta[1];\n $this->STREAM->seekto($offset);\n $data = $this->STREAM->read($length);\n return (string)$data;\n }", "function NumToLetter($NumValue)\n\t{\n\t\treturn ( chr($NumValue + 97) );\n\t}", "function Terbilang($x)\n{\n $abil = array(\"\", \"satu\", \"dua\", \"tiga\", \"empat\", \"lima\", \"enam\", \"tujuh\", \"delapan\", \"sembilan\", \"sepuluh\", \"sebelas\");\n if ($x < 12)\n\treturn \" \" . $abil[$x];\n elseif ($x < 20)\n\treturn Terbilang($x - 10) . \"belas\";\n elseif ($x < 100)\n\treturn Terbilang($x / 10) . \" puluh\" . Terbilang($x % 10);\n elseif ($x < 200)\n\treturn \" seratus\" . Terbilang($x - 100);\n elseif ($x < 1000)\n\treturn Terbilang($x / 100) . \" ratus\" . Terbilang($x % 100);\n elseif ($x < 2000)\n\treturn \" seribu\" . Terbilang($x - 1000);\n elseif ($x < 1000000)\n\treturn Terbilang($x / 1000) . \" ribu\" . Terbilang($x % 1000);\n elseif ($x < 1000000000)\n\treturn Terbilang($x / 1000000) . \" juta\" . Terbilang($x % 1000000);\n}", "function int_to_word($n)\r\n\t{\r\n\t\treturn chr($n & 255).chr(($n >> 8) & 255);\r\n\t}", "private function calculateNumber($number)\n {\n switch ($number % 15) {\n case 3:\n case 6:\n case 9:\n return ' Fizz';\n break;\n\n case 5:\n case 10:\n return ' Buzz';\n break;\n\n case 0:\n return ' FizzBuzz';\n break;\n\n default:\n return '';\n break;\n }\n }", "function convertNumbersToFarsi($srting,$mode='html')\n\t{\n\t\tif ($mode=='html') {\n\t\t\t$num0=\"&#1776;\";\n\t\t\t$num1=\"&#1777;\";\n\t\t\t$num2=\"&#1778;\";\n\t\t\t$num3=\"&#1779;\";\n\t\t\t$num4=\"&#1780;\";\n\t\t\t$num5=\"&#1781;\";\n\t\t\t$num6=\"&#1782;\";\n\t\t\t$num7=\"&#1783;\";\n\t\t\t$num8=\"&#1784;\";\n\t\t\t$num9=\"&#1785;\";\n\t\t} elseif($mode=='plainText') {\n\t\t\t$num0=chr(hexdec('DB')).chr(hexdec('B0'));\n\t\t\t$num1=chr(hexdec('DB')).chr(hexdec('B1'));\n\t\t\t$num2=chr(hexdec('DB')).chr(hexdec('B2'));\n\t\t\t$num3=chr(hexdec('DB')).chr(hexdec('B3'));\n\t\t\t$num4=chr(hexdec('DB')).chr(hexdec('B4'));\n\t\t\t$num5=chr(hexdec('DB')).chr(hexdec('B5'));\n\t\t\t$num6=chr(hexdec('DB')).chr(hexdec('B6'));\n\t\t\t$num7=chr(hexdec('DB')).chr(hexdec('B7'));\n\t\t\t$num8=chr(hexdec('DB')).chr(hexdec('B8'));\n\t\t\t$num9=chr(hexdec('DB')).chr(hexdec('B9'));\n\t\t}\n\n\t\t$stringtemp=\"\";\n\t\t$len=strlen($srting);\n\t\tfor($sub=0;$sub<$len;$sub++) {\n\t\t\tif(substr($srting,$sub,1)==\"0\")$stringtemp.=$num0;\n\t\t\telseif(substr($srting,$sub,1)==\"1\")$stringtemp.=$num1;\n\t\t\telseif(substr($srting,$sub,1)==\"2\")$stringtemp.=$num2;\n\t\t\telseif(substr($srting,$sub,1)==\"3\")$stringtemp.=$num3;\n\t\t\telseif(substr($srting,$sub,1)==\"4\")$stringtemp.=$num4;\n\t\t\telseif(substr($srting,$sub,1)==\"5\")$stringtemp.=$num5;\n\t\t\telseif(substr($srting,$sub,1)==\"6\")$stringtemp.=$num6;\n\t\t\telseif(substr($srting,$sub,1)==\"7\")$stringtemp.=$num7;\n\t\t\telseif(substr($srting,$sub,1)==\"8\")$stringtemp.=$num8;\n\t\t\telseif(substr($srting,$sub,1)==\"9\")$stringtemp.=$num9;\n\t\t\telse $stringtemp.=substr($srting,$sub,1);\n\t\t}\n\t\treturn $stringtemp;\n\t}", "public function NumberToWord($number,$Currency)\r\n\t{\r\n\t\t$hyphen = '-';\r\n\t\t$conjunction = ' and ';\r\n\t\t$separator = ', ';\r\n\t\t$negative = 'negative ';\r\n\t\t$decimal = ' taka ';\r\n\t\t$paisa = ' paisa ';\r\n\t\tif($Currency==\"USD\" || $Currency==\"AUD\" || $Currency==\"EUR\")\r\n\t\t{\r\n\t\t\t$decimal = ' '.$Currency.' ';\r\n\t\t\t$paisa = ' cent ';\r\n\t\t}\r\n\t\t$dictionary = array(\r\n 0 => 'zero',\r\n 1 => 'one',\r\n 2 => 'two',\r\n 3 => 'three',\r\n 4 => 'four',\r\n 5 => 'five',\r\n 6 => 'six',\r\n 7 => 'seven',\r\n 8 => 'eight',\r\n 9 => 'nine',\r\n 10 => 'ten',\r\n 11 => 'eleven',\r\n 12 => 'twelve',\r\n 13 => 'thirteen',\r\n 14 => 'fourteen',\r\n 15 => 'fifteen',\r\n 16 => 'sixteen',\r\n 17 => 'seventeen',\r\n 18 => 'eighteen',\r\n 19 => 'nineteen',\r\n 20 => 'twenty',\r\n 30 => 'thirty',\r\n 40 => 'forty',\r\n 50 => 'fifty',\r\n 60 => 'sixty',\r\n 70 => 'seventy',\r\n 80 => 'eighty',\r\n 90 => 'ninety',\r\n 100 => 'hundred',\r\n 1000 => 'thousand',\r\n\t\t100000 => 'lac',\r\n 10000000 => 'crore'\r\n \t\t );\r\n\t\t if (!is_numeric($number))\r\n\t\t {\r\n \t\treturn false;\r\n \t\t }\r\n \r\n \t\tif (($number >= 0 && (int) $number < 0) || (int) $number < 0 - PHP_INT_MAX)\r\n\t\t {// overflow\r\n \ttrigger_error('convert_number_to_words only accepts numbers between -' . PHP_INT_MAX . ' and ' . PHP_INT_MAX, cE_USER_WARNING);\r\n \t\treturn false;\r\n \t\t }\r\n\r\n \tif ($number < 0)\r\n\t\t{\r\n \t\treturn $negative . $this->NumberToWord($number*-1,$Currency);\r\n \t}\r\n \r\n \t \t$string = $fraction = null;\r\n \r\n \tif (strpos($number, '.') !== false)\r\n\t\t{\r\n \tlist($number, $fraction) = explode('.', $number);\r\n \t\t}\r\n \r\n \tswitch (true) \r\n\t\t{\r\n \tcase $number < 21:\r\n \t$string = $dictionary[$number];\r\n \tbreak;\r\n \tcase $number < 100:\r\n \t\t$tens = ((int) ($number / 10)) * 10;\r\n \t$units = $number % 10;\r\n \t$string = $dictionary[$tens];\r\n \tif ($units)\r\n\t\t\t\t{\r\n \t$string .= $hyphen . $dictionary[$units];\r\n \t}\r\n \tbreak;\r\n \tcase $number < 1000:\r\n \t$hundreds = $number / 100;\r\n \t$remainder = $number % 100;\r\n \t$string = $dictionary[$hundreds] . ' ' . $dictionary[100];\r\n \tif ($remainder)\r\n\t\t\t\t{\r\n \t$string .= ' ' .$this->NumberToWord($remainder,$Currency);\r\n \t}\r\n \t\tbreak;\r\n\t\t\tcase $number < 100000:\r\n\t\t\t\t$thousand = $number / 1000;\r\n \t$remainder = $number % 1000;\r\n \t$string =$this->NumberToWord((int)$thousand,$Currency). ' ' . $dictionary[1000];\r\n \tif ($remainder)\r\n\t\t\t\t{\r\n \t$string .= ' '.$this->NumberToWord($remainder,$Currency);\r\n \t}\r\n \t\tbreak;\r\n\t\t\tcase $number < 10000000:\r\n\t\t\t\t$lac = $number / 100000;\r\n \t$remainder = $number % 100000;\r\n \t$string = $this->NumberToWord((int)$lac,$Currency). ' ' . $dictionary[100000];\r\n \tif ($remainder)\r\n\t\t\t\t{\r\n \t$string .= ' ' .$this->NumberToWord($remainder,$Currency);\r\n \t}\r\n \t\tbreak;\r\n\t\t\tcase $number > 10000000:\r\n\t\t\t\t$crore = $number / 10000000;\r\n \t$remainder = $number % 10000000;\r\n \t$string = $this->NumberToWord((int)$crore,$Currency). ' ' . $dictionary[10000000];\r\n \tif ($remainder)\r\n\t\t\t\t{\r\n \t$string .= ' ' .$this->NumberToWord($remainder,$Currency);\r\n \t}\r\n \t\tbreak;\r\n \tdefault:\r\n \t$baseUnit = pow(10000000, floor(log($number, 10000000)));\r\n \t$numBaseUnits = (int) ($number / $baseUnit);\r\n \t\t$remainder = $number % $baseUnit;\r\n \t$string = $this->NumberToWord($numBaseUnits,$Currency) . ' ' . $dictionary[$baseUnit];\r\n \tif ($remainder) \r\n\t\t\t\t{\r\n \t$string .= $remainder < 100 ? $conjunction : $separator;\r\n \t$string .= $this->NumberToWord($remainder,$Currency);\r\n \t\t}\r\n \t \tbreak;\r\n \t}\r\n \t\t\t\r\n\t\tif (is_numeric($fraction)) \r\n\t\t{\r\n\t\t\t$string .= $decimal;\r\n\r\n\t\t\t$words =$this->NumberToWord((int)$fraction,$Currency);\r\n\r\n\t\t\t$string .= $conjunction . $words . $paisa;\r\n\t\t}\r\n \t\treturn $string;\r\n\t}", "function numberformat( $num ) {\n\tglobal $lang;\n\tif ( $lang == 'www' || $lang == 'meta' || $lang == 'commons' || $lang == 'en' || $lang == 'incubator' ) {\n\t\treturn number_format($num);\n\t}\n\telseif ( $lang == 'fr' ) {\n\t\treturn number_format($num, 0, ',', ' ');\n\t}\n\telse {\n\t\treturn number_format($num);\n\t}\n}", "public static function formatNumber($num){\r\n\t\treturn number_format($num, 0, '', '.');\r\n\t}", "function displayMontant($val) {\n if( $val < 1000 ) return $val;\n $val = $val/1000;\n if( $val < 1000 ) return \"${val} K\";\n $val = $val/1000;\n return \"${val} M\";\n}", "function getNameFromNumber( int $num ): string {\n\t\t$numeric = $num % 26;\n\t\t$letter = chr( 65 + $numeric );\n\t\t$num2 = intval( $num / 26 );\n\t\tif ( $num2 > 0 ) {\n\t\t\treturn getNameFromNumber( $num2 - 1 ) . $letter;\n\t\t} else {\n\t\t\treturn $letter;\n\t\t}\n\t}", "function real($num, $ponto = null) {\n\t\t\t\tif ($ponto) {\n\t\t\t\t\t$ponto = \".\";\n\t\t\t\t\t$ponto2 = \",\";\n\t\t\t\t} else {\n\t\t\t\t\t$ponto = \",\";\n\t\t\t\t\t$ponto2 = \".\";\n\t\t\t\t}\n\t\t\t\t$stringAtnes = explode($ponto2, $num);\n\t\t\t\t$stringAntes = strlen($stringAtnes[0]);\n\t\t\t\t$num = substr($num, 0, $stringAntes + 3);\n\t\t\t\t//$num= round($num,2);\n\t\t\t\tif ($num) {\n\t\t\t\t\t$num = str_replace(\".\", $ponto, $num);\n\t\t\t\t\tif (strstr($num, $ponto) == false) {\n\t\t\t\t\t\t$num .= $ponto . \"00\";\n\t\t\t\t\t}\n\t\t\t\t\t$check = explode($ponto, $num);\n\t\t\t\t\tif (strstr($num, $ponto) == true and strlen($check[1]) < 2) {\n\t\t\t\t\t\t$num .= \"0\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$num = \"00\" . $ponto . \"00\";\n\t\t\t\t}\n\n\t\t\t\treturn $num;\n\t\t\t}", "public function numToAlpha(int $num): string\n {\n // fixed set of 26 uppercase letters to be used for the conversion\n $letters = [\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'\n ];\n\n /**\n * decrement the number by one to account for zero based arrays,\n * get the integer value of the number divided by 26.\n * if the number is still greater than zero call the function again.\n * else return the character in the corresponding position\n */\n\n // ensuere that $num is never less than zero\n $num = $num > 0 ? $num -= 1 : 0;\n\n $i = (int) floor($num / 26);\n\n return $i > 0 ? $this->numToAlpha($i) . $letters[$num % 26] : $letters[$num % 26];\n }", "function format($number) {\r\n\t$number = bcdiv($number, 100000000, 8);\r\n\t$point = strpos($number,\".\");\r\n\tif($point != -1) {\r\n\t\t$after = substr($number,$point+1);\r\n\t\t$after = strlen($after);\r\n\t\t$after = 8-$after;\r\n\t\tfor($i=0;$i<$after;$i++) {\r\n\t\t\t$number .= \"0\";\r\n\t\t}\r\n\t} else {\r\n\t\t$number .= \".00000000\";\r\n\t}\r\n\treturn($number);\r\n}", "public function number(): string\n {\n return $this->getData('Number');\n }", "function add_commas($number)\n{\n $parts = explode('.', $number);\n $parts[0] = number_format($number);\n $number = implode('.', $parts);\n return $number;\n}", "function number_suffix($i) {\n\t\tif ($i%10 == 1 && $i%100 != 11) {\n\t\t\treturn \"st\";\n\t\t} else if ($i%10 == 2 && $i%100 != 12) {\n\t\t\treturn \"nd\";\n\t\t} else if ($i%10 == 3 && $i%100 != 13) {\n\t\t\treturn \"rd\";\n\t\t} else {\n\t\t\treturn \"th\";\n\t\t}\n\t}", "public function NumberToWord($number,$Currency)\n\t{\n\t\t$hyphen = '-';\n\t\t$conjunction = ' and ';\n\t\t$separator = ', ';\n\t\t$negative = 'negative ';\n\t\t$decimal = ' taka ';\n\t\t$paisa = ' paisa ';\n\t\tif($Currency==\"USD\" || $Currency==\"AUD\" || $Currency==\"EUR\")\n\t\t{\n\t\t\t$decimal = ' '.$Currency.' ';\n\t\t\t$paisa = ' cent ';\n\t\t}\n\t\t$dictionary = array(\n 0 => 'zero',\n 1 => 'one',\n 2 => 'two',\n 3 => 'three',\n 4 => 'four',\n 5 => 'five',\n 6 => 'six',\n 7 => 'seven',\n 8 => 'eight',\n 9 => 'nine',\n 10 => 'ten',\n 11 => 'eleven',\n 12 => 'twelve',\n 13 => 'thirteen',\n 14 => 'fourteen',\n 15 => 'fifteen',\n 16 => 'sixteen',\n 17 => 'seventeen',\n 18 => 'eighteen',\n 19 => 'nineteen',\n 20 => 'twenty',\n 30 => 'thirty',\n 40 => 'forty',\n 50 => 'fifty',\n 60 => 'sixty',\n 70 => 'seventy',\n 80 => 'eighty',\n 90 => 'ninety',\n 100 => 'hundred',\n 1000 => 'thousand',\n\t\t100000 => 'lac',\n 10000000 => 'crore'\n \t\t );\n\t\t if (!is_numeric($number))\n\t\t {\n \t\treturn false;\n \t\t }\n \n \t\tif (($number >= 0 && (int) $number < 0) || (int) $number < 0 - PHP_INT_MAX)\n\t\t {// overflow\n \ttrigger_error('convert_number_to_words only accepts numbers between -' . PHP_INT_MAX . ' and ' . PHP_INT_MAX, cE_USER_WARNING);\n \t\treturn false;\n \t\t }\n\n \tif ($number < 0)\n\t\t{\n \t\treturn $negative . $this->NumberToWord($number*-1,$Currency);\n \t}\n \n \t \t$string = $fraction = null;\n \n \tif (strpos($number, '.') !== false)\n\t\t{\n \tlist($number, $fraction) = explode('.', $number);\n \t\t}\n \n \tswitch (true) \n\t\t{\n \tcase $number < 21:\n \t$string = $dictionary[$number];\n \tbreak;\n \tcase $number < 100:\n \t\t$tens = ((int) ($number / 10)) * 10;\n \t$units = $number % 10;\n \t$string = $dictionary[$tens];\n \tif ($units)\n\t\t\t\t{\n \t$string .= ' ' . $dictionary[$units];\n \t}\n \tbreak;\n \tcase $number < 1000:\n \t$hundreds = $number / 100;\n \t$remainder = $number % 100;\n \t$string = $dictionary[$hundreds] . ' ' . $dictionary[100];\n \tif ($remainder)\n\t\t\t\t{\n \t$string .= ' ' .$this->NumberToWord($remainder,$Currency);\n \t}\n \t\tbreak;\n\t\t\tcase $number < 100000:\n\t\t\t\t$thousand = $number / 1000;\n \t$remainder = $number % 1000;\n \t$string =$this->NumberToWord((int)$thousand,$Currency). ' ' . $dictionary[1000];\n \tif ($remainder)\n\t\t\t\t{\n \t$string .= ' '.$this->NumberToWord($remainder,$Currency);\n \t}\n \t\tbreak;\n\t\t\tcase $number < 10000000:\n\t\t\t\t$lac = $number / 100000;\n \t$remainder = $number % 100000;\n \t$string = $this->NumberToWord((int)$lac,$Currency). ' ' . $dictionary[100000];\n \tif ($remainder)\n\t\t\t\t{\n \t$string .= ' ' .$this->NumberToWord($remainder,$Currency);\n \t}\n \t\tbreak;\n\t\t\tcase $number > 10000000:\n\t\t\t\t$crore = $number / 10000000;\n \t$remainder = $number % 10000000;\n \t$string = $this->NumberToWord((int)$crore,$Currency). ' ' . $dictionary[10000000];\n \tif ($remainder)\n\t\t\t\t{\n \t$string .= ' ' .$this->NumberToWord($remainder,$Currency);\n \t}\n \t\tbreak;\n \tdefault:\n \t$baseUnit = pow(10000000, floor(log($number, 10000000)));\n \t$numBaseUnits = (int) ($number / $baseUnit);\n \t\t$remainder = $number % $baseUnit;\n \t$string = $this->NumberToWord($numBaseUnits,$Currency) . ' ' . $dictionary[$baseUnit];\n \tif ($remainder) \n\t\t\t\t{\n \t$string .= $remainder < 100 ? $conjunction : $separator;\n \t$string .= $this->NumberToWord($remainder,$Currency);\n \t\t}\n \t \tbreak;\n \t}\n \t\t\t\n\t\tif (is_numeric($fraction)) \n\t\t{\n\t\t\t$string .= $decimal;\n\n\t\t\t$words =$this->NumberToWord((int)$fraction,$Currency);\n\n\t\t\t$string .= $conjunction . $words . $paisa;\n\t\t}\n \t\treturn $string;\n\t}", "function my_convert($int, $wishedlen = 9) {\n $map = array(\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 7\n 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 15\n 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 23\n 'Y', 'Z');\n $map2 = array_merge(array(\n '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'), $map);\n //base_convert uses int chars as well, So the mapping set is 0-9 + a-q, so 15 maps to f and not to p. We correct for\n //that so that we do not have integers in the resulting code\n $start = str_split(strtoupper(base_convert($int, 10, 26)));\n $string = '';\n foreach ($start as $c) {\n $pos = array_search($c, $map2);\n $string .= $map2[$pos + 10];\n }\n\n $len = count($start);\n if ($len < $wishedlen) {\n $pad = $wishedlen - $len - 1; //Leave one position as pad number indicator\n if ($pad > 0) {\n for ($i = 1; $i <= $pad; $i++) {\n $string = $map[rand(0, 25)] . $string;\n }\n }\n $string = $map[max($pad, 0)] . \"$string\";\n } elseif ($len == $wishedlen) {\n $string = \"A$string\";\n }\n\n return $string;\n}", "function getnote($num)\n{\n\tswitch ($num) {\n\t\tcase 1 : return 'Insuffisant';\n\t\tcase 3 : return 'Suffisant';\n\t\tcase 4 : return 'Bon';\n\t\tcase 5 : return 'Tres bon';\n\t}\n}", "function prepend_one($num) {\n\n\t\tif ($num < 10) {\n\t\t\t$num = \"0\" . $num;\n\t\t}\n\t\t\n\t\treturn $num;\n }", "private function int(int $value): string\n {\n return (string) $value;\n }", "function code2utf($num){\n\tif($num<128)return chr($num);\n\tif($num<2048)return chr(($num>>6)+192).chr(($num&63)+128);\n\tif($num<65536)return chr(($num>>12)+224).chr((($num>>6)&63)+128).chr(($num&63)+128);\n\tif($num<2097152)return chr(($num>>18)+240).chr((($num>>12)&63)+128).chr((($num>>6)&63)+128) .chr(($num&63)+128);\n\treturn '';\n}", "function code2utf($num)\n{\n if ($num < 128) return chr($num);\n if ($num < 2048) return chr(($num >> 6) + 192) . chr(($num & 63) + 128);\n if ($num < 65536) return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);\n if ($num < 2097152) return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);\n return '';\n}", "private function convertToOrdinal($number)\n {\n $error_code = $this->checkParamaters($number, 'o');\n\n if ($error_code > 0) {\n return self::$error_codes[$error_code];\n }\n\n $small_number = (int) substr($number, strlen($number) - 1);\n $big_number = (int) ($number - $small_number);\n\n $string = '';\n\n // Numbers between 20 and 99.\n if ($big_number > 0 && $number > 19 && $number < 100) {\n return $this->convertToWord($big_number).' '.$this->convertToOrdinal($small_number);\n }\n\n // Numbers over 100.\n if ($number >= 100) {\n $string = $this->convertToWord(str_pad(substr($number, 0, 1), strlen($number), '0')).'th';\n\n if ($small_number > 0) {\n $string .= ' and '.$this->convertToWord($small_number);\n }\n\n return $string;\n }\n\n return $this->small_number_string[$number];\n }", "function format($val) {\r\n //setlocale(LC_MONETARY, 'en_US');\r\n return number_format(money_format('%i', $val), 2);\r\n }", "function money_format($n)\n {\n $n = (0 + str_replace(\",\", \"\", $n));\n\n // is this a number?\n if (!is_numeric($n)) return false;\n\n // now filter it;\n if ($n > 1000000000000) return round(($n / 1000000000000), 1) . ' nghìn tỷ';\n else if ($n > 1000000000) return round(($n / 1000000000), 1) . ' tỷ';\n else if ($n > 1000000) return round(($n / 1000000), 1) . ' triệu';\n else if ($n > 1000) return round(($n / 1000), 1) . ' nghìn';\n\n return number_format($n);\n }", "public function converterRomanNumber($number) : void\n {\n\n if ($number > 0 && $number < 5000)\n {\n $alphabet = [\n [\"\", \"I\", \"II\", \"III\", \"IV\", \"V\", \"VI\", \"VII\", \"VIII\", \"IX\"],\n [\"\", \"X\", \"XX\", \"XXX\", \"XL\", \"L\", \"LX\", \"LXX\", \"LXXX\", \"XC\"],\n [\"\", \"C\", \"CC\", \"CCC\", \"CD\", \"D\", \"DC\", \"DCC\", \"DCCC\", \"CM\"],\n [\"\", \"M\", \"MM\", \"MMM\", \"MMMM\"]\n ];\n\n $chars = str_split($number);\n $result = \"\";\n for ($i = 0; $i < sizeof($chars); $i++)\n {\n $result = $result . $alphabet[sizeof($chars) - 1 - $i][intval($chars[$i])];\n }\n echo \"L'équivalent de \" . $number . \" en nombre romain est : \" . $result . ' ';\n }\n else\n {\n echo \"Votre nombre n'est pas compris dans la plage ]0;5000[\";\n }\n }", "function numberToLetter($num){\n switch ($num){\n case 1:\n return 'A';\n case 2:\n return 'B';\n case 3:\n return 'C';\n case 4:\n return 'D';\n case 5:\n return 'E';\n case 6:\n return 'F';\n case 7:\n return 'G';\n case 8:\n return 'H';\n case 9:\n return 'I';\n case 10:\n return 'J';\n case 11:\n return 'K';\n case 12:\n return 'L';\n case 13:\n return 'M';\n case 14:\n return 'N';\n case 15:\n return 'O';\n case 16:\n return 'P';\n case 17:\n return 'R';\n case 18:\n return 'S';\n case 19:\n return 'T';\n case 20:\n return 'U';\n case 21:\n return 'W';\n case 22:\n return 'X';\n case 23:\n return 'Q';\n case 24:\n return 'V';\n case 25:\n return 'Y';\n case 26:\n return 'Z';\n default:\n return '';\n }\n \n}", "function fullNumber($newNum){\n switch ($newNum){ \n case ($newNum < 100000): \n echo \"000\" . $newNum;\n break; \n case ($newNum < 1000000): \n echo \"00\" . $newNum;\n break; \n case ($newNum < 10000000): \n echo \"0\" . $newNum; \n break; \n default: \n echo $newNum;\n break; \n } \n}", "function mswTicketNumber($num) {\n global $SETTINGS;\n $zeros = '';\n if ($SETTINGS->minTickDigits>0 && $SETTINGS->minTickDigits>strlen($num)) {\n for ($i=0; $i<$SETTINGS->minTickDigits-strlen($num); $i++) {\n $zeros .= 0;\n }\n }\n return $zeros.$num;\n}", "function rupiah($n) {\n\t\treturn number_format($n,2,',','.');\n\t}", "function EncodeNumber($value)\n{\n\t$encodedValue = \"\";\n\t$modulus = $value % NUM_LETTERS;\n\t$multiplier = $value / NUM_LETTERS;\n\t$multiplierDigits = 0;\n\t$done = false;\n\n\twhile (!$done){\n\t\t$digit = $multiplier % 10;\n\t\t$temp = chr($digit + ASCII_BIG_A);\n\t\t$temp .= $encodedValue;\n\t\t$encodedValue = $temp;\n\t\t$multiplierDigits++;\n\t\tif ($multiplier < 10)\n\t\t{\n\t\t\t$done = true;\n\t\t}\n\t\t$multiplier = $multiplier / 10;\n\t}\n\n\t$encodedValue = chr($multiplierDigits + ASCII_BIG_A) . $encodedValue;\n\t$encodedValue .= chr($modulus + ASCII_BIG_A);\n\n\treturn $encodedValue;\n}", "function number_format($number, $type = _NUM_TYPE)\n\t{\n\t\tswitch ($type) {\n\t\t\tcase \"figure\":\n\t\t\t\treturn XoopsLocaleJalali::Convertnumber2farsi($number);\n\t\t\t\tbreak;\n\t\t\tcase \"word\":\n\t\t\t\treturn ($number > 0) ? self::num2Words($number) : _NUMWORDS_ZERO;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn $number;\n\t\t\t\tbreak;\n\t\t}\t\n\t}", "function number_suffix($number){\n\t\tif ( is_numeric($number)){\n\t\t\t// Get the last two digits (only once)\n\t\t\t$n = $number % 100;\n\t\t} else {\n\t\t\t// If the last two characters are numbers\n\t\t\tif ( preg_match( '/[0-9]?[0-9]$/', $number, $matches )){\n\t\t\t\t// Return the last one or two digits\n\t\t\t\t$n = array_pop($matches);\n\t\t\t} else {\n\t\t\t\t// Return the string, we can add a suffix to it\n\t\t\t\treturn $number;\n\t\t\t}\n\t\t}\n\t\t// Skip the switch for as many numbers as possible.\n\t\tif ( $n > 3 && $n < 21 )\n\t\t\treturn $number . 'th';\n\t\t// Determine the suffix for numbers ending in 1, 2 or 3, otherwise add a 'th'\n\t\tswitch ( $n % 10 ){\n\t\tcase '1': return $number . 'st';\n\t\tcase '2': return $number . 'nd';\n\t\tcase '3': return $number . 'rd';\n\t\tdefault: return $number . 'th';\n\t\t}\n\t}" ]
[ "0.71019256", "0.6986452", "0.69324136", "0.6810607", "0.67665786", "0.67665786", "0.67591923", "0.66238016", "0.6580977", "0.6480469", "0.64412045", "0.6434796", "0.64276403", "0.6380777", "0.6353703", "0.63449705", "0.6322046", "0.6321694", "0.63196915", "0.63056606", "0.627798", "0.6273399", "0.62617797", "0.62027663", "0.6193776", "0.6187428", "0.6177939", "0.6172892", "0.6159637", "0.61553967", "0.6153537", "0.61382425", "0.61186916", "0.6112156", "0.6094833", "0.60863805", "0.6076147", "0.60316646", "0.603004", "0.6027639", "0.6010983", "0.5983845", "0.59674025", "0.59558225", "0.595241", "0.5951952", "0.59424555", "0.59139663", "0.5888535", "0.5876763", "0.58250046", "0.58025146", "0.5802058", "0.5797649", "0.57949585", "0.57922626", "0.5789099", "0.57829", "0.5773175", "0.57723397", "0.5771742", "0.57674116", "0.576083", "0.57560337", "0.5754256", "0.5744055", "0.57431066", "0.5739793", "0.5730579", "0.57272196", "0.57239115", "0.57164216", "0.57107955", "0.5706846", "0.5706589", "0.569426", "0.5690722", "0.5680144", "0.56785536", "0.5678103", "0.5660868", "0.5652238", "0.5650677", "0.5635452", "0.5630296", "0.5628426", "0.5623867", "0.5622119", "0.5618369", "0.5617989", "0.560469", "0.5599645", "0.5591678", "0.5587707", "0.55871236", "0.55858374", "0.5580526", "0.557331", "0.5570754", "0.5569124" ]
0.7535265
0
Calculates the relative path between $path and $rel
function relativePath($path, $rel=false) { $relpath = ''; if(!$rel) $rel = getcwd(); $apath = explode(DIRECTORY_SEPARATOR, realpath($path)); $arel = explode(DIRECTORY_SEPARATOR, realpath($rel)); while(isset($apath[0]) && isset($arel[0]) && $apath[0] == $arel[0]) { array_shift($apath); array_shift($arel); } return str_repeat('..'.DIRECTORY_SEPARATOR, count($arel)).join(DIRECTORY_SEPARATOR, $apath); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function rel2abs_url( $path )\n {\n if( substr( $path, 0, 1 ) == \"/\" ) return $path;\n $dir = @getcwd();\n\n if( !isset( $_SERVER[ 'DOCUMENT_ROOT' ] ) || ( $dir === false ) )\n return false;\n\n $dir = self::normalize( $dir );\n $doc_root = self::normalize( $_SERVER[ 'DOCUMENT_ROOT' ] );\n\n if( substr( $dir, 0, strlen( $doc_root ) ) != $doc_root )\n return false;\n\n $return = self::normalize( substr( $dir, strlen( $doc_root ) ) . \"/$path\" );\n if( substr( $return, 0, 1 ) !== \"/\" )\n $return = \"/$return\";\n\n return $return;\n }", "public static function relpath($abs_path, $root = NULL) {\n $abs_path = self::abspath($abs_path);\n// self::logmsg('Source path: \"' . $abs_path . '\"');\n if (!isset($root)) {\n $root = $_SERVER['DOCUMENT_ROOT'];\n }\n// self::logmsg('root: \"' . $root . '\"');\n $source_rel = self::get_rel_dir($root, $abs_path);\n // self::logmsg('Relative path of source (calculated): \"' . $source_rel . '\"');\n if (preg_match('/\\.\\.\\//', $source_rel)) {\n // self::logmsg('<b>Note</b>: path is outside document root. You are allowed to, but its unusual setup. When used to calculate destination folder, the \"../\"s will be removed');\n }\n return $source_rel;\n }", "function fa_get_path( $rel_path ){\n\t$path = path_join( FA_PATH, $rel_path );\n\treturn wp_normalize_path( $path );\n}", "function rel2abs_img( $rel, $base ) {\n\t\textract( parse_url( $base ) );\n\n\t\tif ( strpos( $rel,\"//\" ) === 0 ) {\n\t\t\treturn $scheme . ':' . $rel;\n\t\t}\n\n\t\t// return if already absolute URL\n\t\tif ( parse_url( $rel, PHP_URL_SCHEME ) != '' ) {\n\t\t\treturn $rel;\n\t\t}\n\n\t\t// queries and anchors\n\t\tif ( $rel[0] == '#' || $rel[0] == '?' ) {\n\t\t\treturn $base . $rel;\n\t\t}\n\n\t\t// remove non-directory element from path\n\t\t$path = preg_replace( '#/[^/]*$#', '', $path );\n\n\t\t// destroy path if relative url points to root\n\t\tif ( $rel[0] == '/' ) {\n\t\t\t$path = '';\n\t\t}\n\n\t\t// dirty absolute URL\n\t\t$abs = $path . \"/\" . $rel;\n\n\t\t// replace '//' or '/./' or '/foo/../' with '/'\n\t\t$abs = preg_replace( \"/(\\/\\.?\\/)/\", \"/\", $abs );\n\t\t$abs = preg_replace( \"/\\/(?!\\.\\.)[^\\/]+\\/\\.\\.\\//\", \"/\", $abs );\n\n\t\t// absolute URL is ready!\n\t\treturn $abs;\n\t}", "function relative_path() {\n $rel = str_replace($_SERVER['DOCUMENT_ROOT'], null, str_replace(basename(dirname(__FILE__)), null, dirname(__FILE__)));\n return (preg_match('/^\\//', $rel)) ? substr($rel, 1, strlen($rel)) : $rel;\n}", "function adjust_relative_path($path = false, $relative_path = false) {\r\n\t\tif($path === false) {\r\n\t\t\tprint('Path: ' . $path . ' or relative path: ' . $relative_path . ' for function resolve_relative_path was imporperly specifed.');\r\n\t\t}\r\n\t\t//$exploded_file_path = explode('/', $this->file);\r\n\t\t$exploded_path = explode('/', $path);\r\n\t\t$exploded_relative_path = explode('/', $relative_path);\r\n\t\t$path_counter = 0;\r\n\t\twhile($exploded_path[$path_counter] === '..') {\r\n\t\t\t$path_counter++;\r\n\t\t}\r\n\t\t$part_to_keep = '';\r\n\t\t$path_counter2 = $path_counter;\r\n\t\twhile($path_counter2 < sizeof($exploded_path)) {\r\n\t\t\t$part_to_keep .= '/' . $exploded_path[$path_counter2];\r\n\t\t\t$path_counter2++;\r\n\t\t}\r\n\t\t$relative_path_counter = sizeof($exploded_relative_path);\r\n\t\twhile($path_counter > -1) {\r\n\t\t\t$relative_path_counter--;\r\n\t\t\t$path_counter--;\r\n\t\t}\r\n\t\t$part_to_keep2 = '';\r\n\t\t$relative_path_counter2 = 0;\r\n\t\twhile($relative_path_counter > 0) {\r\n\t\t\t$part_to_keep2 .= '../';\r\n\t\t\t$relative_path_counter2++;\r\n\t\t\t$relative_path_counter--;\r\n\t\t}\r\n\t\t$resolved_path = substr($part_to_keep2, 0, strlen($part_to_keep2) - 1) . $part_to_keep;\r\n\t\t//print('$path, $relative_path, $resolved_path: ');var_dump($path, $relative_path, $resolved_path);\r\n\t\treturn $resolved_path;\r\n\t}", "function resolve_relative_path($path = false, $relative_path = false) {\r\n\t\tif($path === false) {\r\n\t\t\tprint('Path: ' . $path . ' or relative path: ' . $relative_path . ' for function resolve_relative_path was imporperly specifed.');\r\n\t\t}\r\n\t\t//$exploded_file_path = explode('/', $this->file);\r\n\t\t$exploded_path = explode('/', $path);\r\n\t\t$exploded_relative_path = explode('/', $relative_path);\r\n\t\t$path_counter = 0;\r\n\t\twhile($exploded_path[$path_counter] === '..') {\r\n\t\t\t$path_counter++;\r\n\t\t}\r\n\t\t$part_to_keep = '';\r\n\t\t$path_counter2 = $path_counter;\r\n\t\twhile($path_counter2 < sizeof($exploded_path)) {\r\n\t\t\t$part_to_keep .= '/' . $exploded_path[$path_counter2];\r\n\t\t\t$path_counter2++;\r\n\t\t}\r\n\t\t$relative_path_counter = sizeof($exploded_relative_path);\r\n\t\twhile($path_counter > -1) {\r\n\t\t\t$relative_path_counter--;\r\n\t\t\t$path_counter--;\r\n\t\t}\r\n\t\t$part_to_keep2 = '';\r\n\t\t$relative_path_counter2 = 0;\r\n\t\twhile($relative_path_counter > 0) {\r\n\t\t\t$part_to_keep2 .= $exploded_relative_path[$relative_path_counter2] . '/';\r\n\t\t\t$relative_path_counter2++;\r\n\t\t\t$relative_path_counter--;\r\n\t\t}\r\n\t\t$resolved_path = substr($part_to_keep2, 0, strlen($part_to_keep2) - 1) . $part_to_keep;\r\n\t\t//print('$path, $relative_path, $resolved_path: ');var_dump($path, $relative_path, $resolved_path);\r\n\t\treturn $resolved_path;\r\n\t}", "private static function base_relative($path = null)\n\t{\n\t\t$test\t= self::getProtocol().$_SERVER['HTTP_HOST'].\"/\".apps::getGlobal(\"router\")->getBasePath();\n\t\treturn concat_path($test,$path);\n\t}", "function rel2abs($rel, $base) {\n if (parse_url($rel, PHP_URL_SCHEME) != '')\n return $rel;\n if ($rel[0] == '#' || $rel[0] == '?')\n return $base . $rel;\n extract(parse_url($base));\n\t\t\n\t\tif(!isset($path))\n\t\t\treturn;\n\t\t\n $path = preg_replace('#/[^/]*$#', '', $path);\n if ($rel[0] == '/')\n $path = '';\n $abs = \"$host$path/$rel\";\n $re = array('#(/\\.?/)#', '#/(?!\\.\\.)[^/]+/\\.\\./#');\n for ($n = 1; $n > 0; $abs = preg_replace($re, '/', $abs, -1, $n)) {\n \n }\n $abs = str_replace(\"../\", \"\", $abs);\n return $scheme . '://' . $abs;\n }", "function getPath($relativePath);", "function get_path_relative_to($path, $relative_to) {\n return substr($path, strlen($relative_to));\n }", "protected function _relpath($path) {\r\n\t\r\n\t\t\r\n\t\t$newpath = $path;\r\n\t\t\r\n\t\t\r\n\t\tif (substr($path, 0, 1) != '/') {\r\n\t\t\t$newpath = \"/$newpath\";\r\n\t\t}\r\n\t\t\r\n\t\t$newpath = preg_replace(\"/\\/$/\", \"\", $newpath);\r\n\t\r\n\t\t$ret = ($newpath == $this->root) ? '' : substr($newpath, strlen($this->root)+1);\r\n\t\t\r\n\t\treturn $ret;\r\n\t}", "public function makeRelativePath($path, $base)\n\t{\n\t\treturn str_replace($base . '/', '', $path);\n\t}", "private function getRelativePath($base, $path) {\n\t\t$base = str_replace('\\\\', '/', $base);\n\t\t$path = str_replace('\\\\', '/', $path);\n\t\t$pos = strpos($path, $base);\n\t\tif ($pos !== false && $pos == 0) {\n\t\t\t$path = substr($path , strlen($base) + 1);\n\t\t}\n\t\treturn $path;\n\t}", "public static function relativePath( $path )\n {\n if( !empty( $path ) && is_string( $path ) )\n {\n $path = Sanitize::toPath( $path );\n $root = Server::getScriptPath();\n $levels = array(\n $root,\n dirname( $root ),\n dirname( dirname( $root ) ),\n dirname( dirname( dirname( $root ) ) )\n );\n foreach( $levels as $level )\n {\n if( empty( $level ) || $levels === \"/\" ) continue;\n $path = str_replace( $level, \"\", $path );\n }\n }\n return $path;\n }", "public function rel2abs($rel, $base){\n if (parse_url($rel, PHP_URL_SCHEME) != '')\n {return $rel;}\n if (!empty($rel[0])=='#' || !empty($rel[0])=='?')\n {return $base.$rel;}\n extract(parse_url($base));\n if (isset($path)){$path = preg_replace('#/[^/]*$#', '', $path);}\n else $path = '';\n if (!empty($rel[0]) == '/'){\n $path = '';\n }\n $abs = \"$host$path/$rel\";\n $re = array('#(/.?/)#', '#/(?!..)[^/]+/../#');\n for($n=1; $n>0;$abs=preg_replace($re,'/', $abs,-1,$n)){}\n $abs=str_replace(\"../\",\"\",$abs);\n return $scheme.'://'.$abs;\n }", "function absolute_to_relative_path($path)\n{\n $pathParts = explode(DIRECTORY_SEPARATOR, $path);\n $pathParts = array_reverse($pathParts);\n array_splice($pathParts, 5);\n $pathParts = array_reverse($pathParts);\n $returnPath = CCTVALIASPATH . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $pathParts);\n $returnPath = str_replace('\\\\', '/', $returnPath);\n return $returnPath;\n}", "public function img_path($rel_path='')\n\t{\n\t\treturn $this->add_path($rel_path);\n\t}", "function rel2abs($rel, $base)\n {\n if (parse_url($rel, PHP_URL_SCHEME) != '') return $rel;\n\n /* queries and anchors */\n if ($rel[0]=='#' || $rel[0]=='?') return $base.$rel;\n\n /* parse base URL and convert to local variables:\n $scheme, $host, $path */\n extract(parse_url($base));\n\n /* remove non-directory element from path */\n $path = preg_replace('#/[^/]*$#', '', $path);\n\n /* destroy path if relative url points to root */\n if ($rel[0] == '/') $path = '';\n\n /* dirty absolute URL */\n $abs = \"$host$path/$rel\";\n\n /* replace '//' or '/./' or '/foo/../' with '/' */\n $re = array('#(/\\.?/)#', '#/(?!\\.\\.)[^/]+/\\.\\./#');\n for($n=1; $n>0; $abs=preg_replace($re, '/', $abs, -1, $n)) {}\n\n /* absolute URL is ready! */\n return $scheme.'://'.$abs;\n}", "function cap_make_path_relative_to ($path, $base)\n{\n $base = rtrim ($base, '/') . '/';\n if (strncmp ($path, $base, strlen ($base)) == 0) {\n return substr ($path, strlen ($base));\n }\n return $path;\n}", "public function rel2abs($rel, $base) {\n if (parse_url($rel, PHP_URL_SCHEME) != '') {\n return $rel;\n }\n if ($rel[0] == '#' || $rel[0] == '?') {\n return $base . $rel;\n }\n extract(parse_url($base));\n $path = preg_replace('#/[^/]*$#', '', $path);\n if ($rel[0] == '/') {\n $path = '';\n }\n $abs = \"$host$path/$rel\";\n $re = array('#(/.?/)#', '#/(?!..)[^/]+/../#');\n for ($n = 1; $n > 0; $abs = preg_replace($re, '/', $abs, -1, $n)) {}\n $abs = str_replace('../', '', $abs);\n return $scheme . '://' . $abs;\n }", "public function calculateFullPath($start_path)\n {\n \treturn $start_path . $this->getPath() . \"/\" ;\n }", "function realPath($path, $relative_to = NULL, $resolve_symlink = TRUE);", "function rel2abs($rel, $base)\r\n{\r\n /* return if already absolute URL */\r\n if (parse_url($rel, PHP_URL_SCHEME) != '') return $rel;\r\n\r\n /* queries and anchors */\r\n if ($rel[0]=='#' || $rel[0]=='?') return $base.$rel;\r\n\r\n /* parse base URL and convert to local variables:\r\n $scheme, $host, $path */\r\n extract(parse_url($base));\r\n\r\n /* remove non-directory element from path */\r\n $path = preg_replace('#/[^/]*$#', '', $path);\r\n\r\n /* destroy path if relative url points to root */\r\n if ($rel[0] == '/') $path = '';\r\n\r\n /* dirty absolute URL */\r\n $abs = \"$host$path/$rel\";\r\n\r\n /* replace '//' or '/./' or '/foo/../' with '/' */\r\n $re = array('#(/\\.?/)#', '#/(?!\\.\\.)[^/]+/\\.\\./#');\r\n for($n=1; $n>0; $abs=preg_replace($re, '/', $abs, -1, $n)) {}\r\n\r\n /* absolute URL is ready! */\r\n return $scheme.'://'.$abs;\r\n}", "public function get_full_relative_path(){\n\t\treturn $this->dir . '/' . $this->get_full_name();\n\t}", "public function setRelativePath($txt)\n {\n $this->_relPath = $txt;\n }", "function rel2abs($rel, $base)\n{\n if (parse_url($rel, PHP_URL_SCHEME) != '') return $rel;\n\n /* Url begins with // */\n if($rel[0] == '/' && $rel[1] == '/'){\n return 'https:' . $rel;\n }\n\n /* queries and anchors */\n if ($rel[0]=='#' || $rel[0]=='?') return $base.$rel;\n\n /* parse base URL and convert to local variables:\n $scheme, $host, $path */\n extract(parse_url($base));\n\n /* remove non-directory element from path */\n $path = preg_replace('#/[^/]*$#', '', $path);\n\n /* destroy path if relative url points to root */\n if ($rel[0] == '/') $path = '';\n\n /* dirty absolute URL */\n $abs = \"$host$path/$rel\";\n\n /* replace '//' or '/./' or '/foo/../' with '/' */\n $re = array('#(/\\.?/)#', '#/(?!\\.\\.)[^/]+/\\.\\./#');\n for($n=1; $n>0; $abs=preg_replace($re, '/', $abs, -1, $n)) {}\n\n /* absolute URL is ready! */\n return $scheme.'://'.$abs;\n}", "public function relativePath($fullPath, $fileName, $basePath = null);", "public static function fullPath ($relPath) {\n\t\treturn (\\realpath($relPath) ?: null);\n\t}", "function fa_get_uri( $rel_path ){\n\t$uri = is_ssl() ? str_replace('http://', 'https://', FA_URL) : FA_URL;\t\n\t$path = path_join( $uri, $rel_path );\n\treturn $path;\n}", "private static function get_relative_path($from, $to)\n {\n // some compatibility fixes for Windows paths\n $from = is_dir($from) ? rtrim($from, '\\/') . '/' : $from;\n $to = is_dir($to) ? rtrim($to, '\\/') . '/' : $to;\n $from = str_replace('\\\\', '/', $from);\n $to = str_replace('\\\\', '/', $to);\n\n $from = explode('/', $from);\n $to = explode('/', $to);\n $rel_path = $to;\n\n foreach ($from as $depth => $dir) {\n // find first non-matching dir\n if ($dir === $to[$depth]) {\n // ignore this directory\n array_shift($rel_path);\n } else {\n // get number of remaining dirs to $from\n $remaining = count($from) - $depth;\n if ($remaining > 1) {\n // add traversals up to first matching dir\n $pad_length = (count($rel_path) + $remaining - 1) * -1;\n $rel_path = array_pad($rel_path, $pad_length, '..');\n break;\n } else {\n $rel_path[0] = './' . $rel_path[0];\n }\n }\n }\n return implode('/', $rel_path);\n }", "protected function relativePath($path)\n {\n return preg_replace('/'.preg_quote(str_replace(DIRECTORY_SEPARATOR, '/', $this['system']->path), '/').'/i', '', str_replace(DIRECTORY_SEPARATOR, '/', $path), 1).'/';\n }", "public static function absolutePath ($relPath) {\n\t\tif (Path::isAbsolute($relPath)) {\n\t\t\treturn $relPath;\n\t\t}\n\t\treturn Path::join(\\Array_hx::wrap([\n\t\t\t\\Sys::getCwd(),\n\t\t\t$relPath,\n\t\t]));\n\t}", "public static function getImageRelativePath() {\n // Get the paths to the client helper folder and php file folder as an array of tokens.\n $clientHelperFolder = explode(DIRECTORY_SEPARATOR, dirname(realpath(__FILE__)));\n $imageFolder = explode(DIRECTORY_SEPARATOR, realpath(self::getInterimImageFolder('fullpath')));\n // Find the first part of the paths that is not the same.\n for ($i = 0; $i < min(count($clientHelperFolder), count($imageFolder)); $i++) {\n if ($imageFolder[$i] !== $clientHelperFolder[$i]) {\n break;\n }\n }\n // Step back up the path to the point where the 2 paths differ.\n $path = str_repeat('../', count($clientHelperFolder) - $i);\n // Add back in the different part of the path to the client helper folder.\n for ($j = $i; $j < count($imageFolder); $j++) {\n $path .= $imageFolder[$j] . '/';\n }\n return $path;\n }", "public function resolvePath($path, $relative_to = null);", "public function getRelativePath($path)\n {\n return str_replace($this->baseDir . '/', '', $path);\n }", "public function relativePath() : string {\n $path = empty($this->path) ? '' : Path::toRelative($this->path, true);\n return $path; \n }", "public function resolvePath(string $relativePath): string;", "public function getPathRelative($modifierId = false) {\n return $this->getFolder() . $this->getFilename();\n }", "function rel2abs($rel, $base) {\n if (empty($rel)) $rel = \".\";\n if (parse_url($rel, PHP_URL_SCHEME) != \"\" || strpos($rel, \"//\") === 0) return $rel; //Return if already an absolute URL\n if ($rel[0] == \"#\" || $rel[0] == \"?\") return $base.$rel; //Queries and anchors\n extract(parse_url($base)); //Parse base URL and convert to local variables: $scheme, $host, $path\n $path = isset($path) ? preg_replace('#/[^/]*$#', \"\", $path) : \"/\"; //Remove non-directory element from path\n if ($rel[0] == '/') $path = \"\"; //Destroy path if relative url points to root\n $port = isset($port) && $port != 80 ? \":\" . $port : \"\";\n $auth = \"\";\n if (isset($user)) {\n $auth = $user;\n if (isset($pass)) {\n $auth .= \":\" . $pass;\n }\n $auth .= \"@\";\n }\n $abs = \"$auth$host$path$port/$rel\"; //Dirty absolute URL\n for ($n = 1; $n > 0; $abs = preg_replace(array(\"#(/\\.?/)#\", \"#/(?!\\.\\.)[^/]+/\\.\\./#\"), \"/\", $abs, -1, $n)) {} //Replace '//' or '/./' or '/foo/../' with '/'\n return $scheme . \"://\" . $abs; //Absolute URL is ready.\n}", "public static function get_rel_dir($from_dir, $to_dir) {\n $from_dir_parts = explode('/', str_replace( '\\\\', '/', $from_dir ));\n $to_dir_parts = explode('/', str_replace( '\\\\', '/', $to_dir ));\n $i = 0;\n while (($i < count($from_dir_parts)) && ($i < count($to_dir_parts)) && ($from_dir_parts[$i] == $to_dir_parts[$i])) {\n $i++;\n }\n $rel = \"\";\n for ($j = $i; $j < count($from_dir_parts); $j++) {\n $rel .= \"../\";\n } \n\n for ($j = $i; $j < count($to_dir_parts); $j++) {\n $rel .= $to_dir_parts[$j];\n if ($j < count($to_dir_parts)-1) {\n $rel .= '/';\n }\n }\n return $rel;\n }", "private function relativePathFix($path){\n\t\t// check if page is a generated javadoc\n\t\t$page_str = $this->doc->saveHTML();\n\t\tif(preg_match('%.*Generated by javadoc.*%', $page_str)){\n\t\t\t// if it is, fix the frame-based links so that the path isn't appended to itself infinitely\n\t\t\t$path = preg_replace('%(.*\\/).*\\.html\\?(.*\\/.*)%', \"$1$2\", $path);\n\t\t}\n\t\t$dirs = explode('/', $path);\n\t\t// check if link goes up a directory\n\t\tif($dirs[0] == '..'){\n\t\t\t$new_path = explode('/', $this->current_path);\n\t\t\tif(count($dirs) == 2){\n\t\t\t\tarray_pop($new_path);\n\t\t\t\tarray_pop($new_path);\n\t\t\t\t$new_path = implode('/', $new_path).'/';\n\t\t\t} else {\n\t\t\t\t// remove slash from end of current path to ensure single slashes\n\t\t\t\tif(empty($new_path[count($new_path)-1]) || is_null($new_path[count($new_path)-1])){\n\t\t\t\t\tarray_pop($new_path);\n\t\t\t\t}\n\t\t\t\t// go up directories\n\t\t\t\twhile($dirs[0] == '..'){\n\t\t\t\t\tarray_shift($dirs);\n\t\t\t\t\tarray_pop($new_path);\n\t\t\t\t}\n\t\t\t\t// stick the two paths together to get new path\n\t\t\t\t$new_path = implode('/', $new_path).'/';\n\t\t\t\t$new_path .= implode('/', $dirs);\n\t\t\t}\n\t\t// if link it to same dir, remove the ./\n\t\t} elseif($dirs[0] == '.'){\n\t\t\t$new_path = $this->current_path.substr($path, 2);\n\t\t// if the link starts at root, use it without modification\n\t\t} elseif(empty($dirs[0]) || is_null($dirs[0])){\n\t\t\t$new_path = $path;\n\t\t} elseif(strlen($dirs[0]) == 2){\n\t\t\t$new_path = '/'.$path;\n\t\t// default to adding the link's value to the end of the current directory\n\t\t} else {\n\t\t\t$new_path = $this->current_path.$path;\n\t\t}\n\t\t\n\t\t// if the link doesn't point to a file or query string, but has no end slash, add one\n\t\tif(count(explode('.', $new_path)) < 2 && count(explode('?', $new_path)) < 2 && substr($new_path, -1) != '/'){\n\t\t\t$new_path .= '/';\n\t\t}\n\t\treturn $new_path;\n\t}", "public static function relPathBetweenURLs($path_1,$path_2)\n\t{\n\t\tif(strpos($path_1,'innovaeditor')!==false)\n\t\t{\n\t\t\t$common=Formatter::longestCommonSubsequence($path_1,$path_2);\n\t\t\t$path_1_part=str_replace($common,'',$path_1);\n\t\t\t$path_2_part=str_replace($common,'',$path_2);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$path_1_part=str_replace('../','',$path_1); //assuming innovaeditor is always in root\n\t\t\t$path_2_part=$path_2;\n\t\t}\n\t\t$path_2_part_dirs=substr_count($path_2_part,'/');\n\t\t$pref_path='';\n\t\tfor($i=$path_2_part_dirs; $i>0; $i--)\n\t\t\t$pref_path .= '../';\n\t\treturn $pref_path.$path_1_part;\n\t}", "public function realpath($path, $relative = FileSystem::NONE);", "public static function generateRelativePath($path = __DIR__, $from = 'modules')\n {\n $path = realpath($path);\n $parts = explode(DIRECTORY_SEPARATOR, $path);\n foreach ($parts as $part) {\n if ($part === $from) {\n return $path;\n }\n $path = mb_substr($path, mb_strlen($part . DIRECTORY_SEPARATOR));\n }\n\n return $path;\n }", "private function getRelativePath($from, $to)\n\t{\n\t\t\t$from = explode('/', $from);\n\t\t\t$to = explode('/', $to);\n\t\t\t$relPath = $to;\n\n\t\t\tforeach($from as $depth => $dir) {\n\t\t\t\t\t// find first non-matching dir\n\t\t\t\t\tif($dir === $to[$depth]) {\n\t\t\t\t\t\t\t// ignore this directory\n\t\t\t\t\t\t\tarray_shift($relPath);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// get number of remaining dirs to $from\n\t\t\t\t\t\t\t$remaining = count($from) - $depth;\n\t\t\t\t\t\t\tif($remaining > 1) {\n\t\t\t\t\t\t\t\t\t// add traversals up to first matching dir\n\t\t\t\t\t\t\t\t\t$padLength = (count($relPath) + $remaining - 1) * -1;\n\t\t\t\t\t\t\t\t\t$relPath = array_pad($relPath, $padLength, '..');\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$relPath[0] = './' . $relPath[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tunset($relPath[count($relPath)-1]);\n\t\t\treturn implode('/', $relPath);\n\t}", "public function absPath(string $path): string;", "abstract protected function getPath();", "function getPath($path) {\n if (substr($path,0,4)=='EXT:') {\n $keyEndPos = strpos($path, '/', 6);\n $key = substr($path,4,$keyEndPos-4);\n $keyPath = t3lib_extMgm::siteRelpath($key);\n $newPath = $keyPath.substr($path,$keyEndPos+1);\n return $newPath;\n }\telse {\n return $path;\n }\n }", "function absolute_to_relative($filepath) {\n\treturn str_replace(__CHV_ROOT_DIR__, __CHV_RELATIVE_ROOT__, str_replace('\\\\', '/', $filepath));\n}", "public function get_thumb_relative_path(){\n\t\treturn $this->dir . '/' . $this->get_thumb_name();\n\t}", "function path_res ($path) {\r\n\tif (file_exists(DIR_RES.$path)) {\r\n\t\t$path = DIR_RES.$path;\r\n\t} else {\r\n\t\t$path = \"no file $path\";\r\n\t}\r\n\treturn $path;\r\n}", "function getRealpath( $_path )\n{\n $__path = $_path;\n if ( isRelative( $_path ) ) {\n $__curdir = unifyPath( realpath( \".\" ) . _PL_OS_SEP );\n $__path = $__curdir . $__path;\n }\n $__startPoint = \"\";\n if ( checkCurrentOS( \"Win\" ) ) {\n list( $__startPoint, $__path ) = explode( \":\", $__path, 2 );\n $__startPoint .= \":\";\n }\n # From now processing is the same for WIndows and Unix, and hopefully for others.\n $__realparts = array( );\n $__parts = explode( _PL_OS_SEP, $__path );\n for ( $i = 0; $i < count( $__parts ); $i++ ) {\n if ( strlen( $__parts[ $i ] ) == 0 || $__parts[ $i ] == \".\" ) {\n continue;\n }\n if ( $__parts[ $i ] == \"..\" ) {\n if ( count( $__realparts ) > 0 ) {\n array_pop( $__realparts );\n }\n }\n else {\n array_push( $__realparts, $__parts[ $i ] );\n }\n }\n return $__startPoint . _PL_OS_SEP . implode( _PL_OS_SEP, $__realparts );\n}", "function getPath($path) {\n\t\tif (substr($path,0,4)=='EXT:') {\n\t\t\t$keyEndPos = strpos($path, '/', 6);\n\t\t\t$key = substr($path,4,$keyEndPos-4);\n\t\t\t$keyPath = t3lib_extMgm::siteRelpath($key);\n\t\t\t$newPath = $keyPath.substr($path,$keyEndPos+1);\n\t\treturn $newPath;\n\t\t}\telse {\n\t\t\treturn $path;\n\t\t}\n\t}", "public function testCalculatesRelativePaths()\n {\n $common = DS . 'tmp' . DS . 'sfproject' . DS;\n $source = $common . 'web' . DS . 'myplugin';\n $target = $common . 'plugins' . DS . 'myplugin' . DS . 'web';\n $this->assertEquals($this->filesystem->calculateRelativeDir($source, $target), '..' . DS . 'plugins' . DS . 'myplugin' . DS . 'web', '->calculateRelativeDir() correctly calculates the relative path');\n\n $source = $common . 'web' . DS . 'myplugin';\n $target = $common . 'webplugins' . DS . 'myplugin' . DS . 'web';\n $this->assertEquals($this->filesystem->calculateRelativeDir($source, $target), '..' . DS . 'webplugins' . DS . 'myplugin' . DS . 'web', '->calculateRelativeDir() correctly calculates the relative path for dirs that share chars');\n\n $source = $common . 'web' . DS . 'myplugin';\n $target = $common . 'web' . DS . 'otherplugin' . DS . 'sub';\n $this->assertEquals($this->filesystem->calculateRelativeDir($source, $target), 'otherplugin' . DS . 'sub', '->calculateRelativeDir() works without going up one dir');\n\n $source = 'c:\\sfproject\\web\\myplugin';\n $target = 'd:\\symfony\\plugins\\myplugin\\web';\n $this->assertEquals($this->filesystem->calculateRelativeDir($source, $target), 'd:\\symfony\\plugins\\myplugin\\web', '->calculateRelativeDir() returns absolute path when no relative path possible');\n\n $source = $common . 'web' . DS . 'myplugin';\n $target = $common . 'web' . DS . 'myotherplugin' . DS . 'sub';\n $this->assertEquals($this->filesystem->calculateRelativeDir($source, $target), 'myotherplugin' . DS . 'sub', '->calculateRelativeDir() correctly calculates the relative path for dirs that share chars');\n\n $source = $common . 'web' . DS . 'myplugin';\n $target = $common . 'web' . DS . 'motherplugin' . DS . 'sub';\n $this->assertEquals($this->filesystem->calculateRelativeDir($source, $target), 'motherplugin' . DS . 'sub', '->calculateRelativeDir() correctly calculates the relative path for dirs that share chars');\n\n // http://trac.symfony-project.org/ticket/5488\n $source = $common . '..' . DS . 'web' . DS . 'myplugin';\n $target = $common . 'lib' . DS . 'vendor' . DS . 'symfony' . DS . 'plugins' . DS . 'myplugin' . DS . 'web';\n $this->assertEquals($this->filesystem->calculateRelativeDir($source, $target), '..' . DS . 'sfproject' . DS . 'lib' . DS . 'vendor' . DS . 'symfony' . DS . 'plugins' . DS . 'myplugin' . DS . 'web', '->calculateRelativeDir() correctly calculates the relative path for dirs that share chars');\n }", "protected abstract function getPath();", "public function add_path($rel_path)\n\t{\n\t\treturn ninja::add_path($rel_path);\n\t}", "public static function getRelPath($dir, $from = NULL) {\n\t\tif (!is_string($from))\n\t\t\t$from = ABSPATH;\n\n\t\t$from = explode(DIRECTORY_SEPARATOR, rtrim(realpath($from), DIRECTORY_SEPARATOR));\n\t\t$to = explode(DIRECTORY_SEPARATOR, rtrim(realpath($dir), DIRECTORY_SEPARATOR));\n\t\t\n\t\twhile(count($from) && count($to) && ($from[0] == $to[0])) {\n\t\t\tarray_shift($from);\n\t\t\tarray_shift($to);\n\t\t}\n\t\t\n\t\treturn str_pad(\"\", count($from) * 3, '..'. DIRECTORY_SEPARATOR) . implode(DIRECTORY_SEPARATOR, $to);\n\t}", "protected function getRelativeUrl($path) {\n return $this->app->getRelativeUrl($path);\n }", "private function getRelativeUrl($source, $target)\n\t{\n\t\t$relative = '';\n\t\twhile (true)\n\t\t{\n\t\t\tif ($source === $target)\n\t\t\t\treturn $relative;\n\t\t\telse if ($source === dirname($source))\n\t\t\t\treturn $relative.substr($target, 1);\n\t\t\tif (!strncmp($source.'/', $target, strlen($source) + 1))\n\t\t\t\treturn $relative.substr($target, strlen($source) + 1);\n\n\t\t\t$source = dirname($source);\n\t\t\t$relative .= '../';\n\t\t}\n\t}", "function calcRelativeDirPath ($current_url) {\n \n // gleiche bei den Beiden Pfade die Trennzeichen an \n $curr_dir_leveled = levelingDirSeperators($current_url);\n $root_dir_leveled = levelingDirSeperators(ROOT);\n \n $curr_dir = dirname($curr_dir_leveled);\n $root_dir_end = extractLastPart($root_dir_leveled);\n \n // Teile den Aktuellen Pfad an dem Ende des Root Pfades\n $path_parts = explode($root_dir_end, $curr_dir);\n \n // Der relative Pfad ist der letzte Teil\n $rel_path = array_pop($path_parts);\n \n return $rel_path;\n}", "public function getRelativePath(){\n\t\treturn 'Less';\n\t}", "function _makeAbsolutePath($path, $sourcePath, $parentPath)\n\t{\n\t\tif (!preg_match('|^[a-z]+://|i', $path)) {\n\t\t\tif (substr($path, 0, 1) == \"/\") {\n\t\t\t\t// if href is an absolute URL convert it into a relative URL\n\t\t\t\t$path = makeRelativePath($sourcePath, $path);\n\t\t\t} else \n\t\t\t\tif (substr($path, 0, 2) == \"./\") {\n\t\t\t\t\t// if href is a relative URL starting with \"./\" remove the \"./\"\n\t\t\t\t\t$path = substr($path, 2);\n\t\t\t\t}\n\t\t\t// Make absolute Path out of it\n\t\t\twhile (substr($path, 0, 3) == \"../\" && strlen($parentPath) > 0 && $parentPath != \"/\") {\n\t\t\t\t$parentPath = dirname($parentPath);\n\t\t\t\t$path = substr($path, 3);\n\t\t\t}\n\t\t\tif (substr($parentPath, -1) != \"/\") {\n\t\t\t\t$parentPath = $parentPath . \"/\";\n\t\t\t}\n\t\t\treturn $parentPath . $path;\n\t\t}\n\t\treturn $path;\n\t}", "function getRelativePath($from, $to)\r\n\t{\r\n\t\t// some compatibility fixes for Windows paths\r\n\t\t$from = is_dir($from) ? rtrim($from, '\\/') . '/' : $from;\r\n\t\t$to = is_dir($to) ? rtrim($to, '\\/') . '/' : $to;\r\n\t\t$from = str_replace('\\\\', '/', $from);\r\n\t\t$to = str_replace('\\\\', '/', $to);\r\n\r\n\t\t$from = explode('/', $from);\r\n\t\t$to = explode('/', $to);\r\n\t\t$relPath = $to;\r\n\r\n\t\tforeach($from as $depth => $dir) {\r\n\t\t\t// find first non-matching dir\r\n\t\t\tif($dir === $to[$depth]) {\r\n\t\t\t\t// ignore this directory\r\n\t\t\t\tarray_shift($relPath);\r\n\t\t\t} else {\r\n\t\t\t\t// get number of remaining dirs to $from\r\n\t\t\t\t$remaining = count($from) - $depth;\r\n\t\t\t\tif($remaining > 1) {\r\n\t\t\t\t\t// add traversals up to first matching dir\r\n\t\t\t\t\t$padLength = (count($relPath) + $remaining - 1) * -1;\r\n\t\t\t\t\t$relPath = array_pad($relPath, $padLength, '..');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$relPath[0] = './' . $relPath[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn implode('/', $relPath);\r\n\t}", "protected function getRelativePath(string $tag, string $src) : string\n {\n return str_repeat('../', $this->getPathLevel()) . \"assets/{$this->getAssetType($tag)}/{$this->getFileName($src)}\";\n }", "public static function relativizePath($path, $context, $throw = true)\n {\n if ($context !== substr($path, 0, strlen($context))) {\n return self::error(\"$path is not within $context\", $throw);\n }\n\n return ltrim(substr($path, strlen($context)), '/');\n }", "function _wp_relative_upload_path($path)\n {\n }", "function fn_get_url_path($path)\n{\n $dir = dirname($path);\n\n if ($dir == '.' || $dir == '/') {\n return '';\n }\n\n return (defined('WINDOWS')) ? str_replace('\\\\', '/', $dir) : $dir;\n}", "function url_to_relative($url) {\n\treturn str_replace(__CHV_BASE_URL__, __CHV_RELATIVE_ROOT__, $url);\n}", "protected function getFileRelativePath(string $contextId, string $id, string $path, array $meta): string\n {\n return trim($path, '/');\n }", "function dirPath () { return (\"../../\"); }", "protected function normalizeRelativePath(string $path): string\n {\n $path = str_replace('\\\\', '/', $path);\n return ltrim($path, '/');\n }", "private function getRelativePath($from, $to)\n {\n $from = is_dir($from) ? rtrim($from, '\\/') . '/' : $from;\n $to = is_dir($to) ? rtrim($to, '\\/') . '/' : $to;\n $from = str_replace('\\\\', '/', $from);\n $to = str_replace('\\\\', '/', $to);\n\n $from = explode('/', $from);\n $to = explode('/', $to);\n $relPath = $to;\n\n foreach ($from as $depth => $dir)\n {\n // find first non-matching dir\n if ($dir === $to[$depth])\n {\n // ignore this directory\n array_shift($relPath);\n }\n else\n {\n // get number of remaining dirs to $from\n $remaining = count($from) - $depth;\n if ($remaining > 1)\n {\n // add traversals up to first matching dir\n $padLength = (count($relPath) + $remaining - 1) * -1;\n $relPath = array_pad($relPath, $padLength, '..');\n break;\n }\n else\n {\n $relPath[0] = './' . $relPath[0];\n }\n }\n }\n return implode('/', $relPath);\n }", "function build_href( $p_path ) {\n\tglobal $t_depth;\n\n\t$t_split = explode( DIRECTORY_SEPARATOR, $p_path );\n\t$t_slice = array_slice( $t_split, $t_depth );\n\n\treturn '/' . implode( '/', array_map( 'urlencode', $t_slice ) );\n}", "public function path( $relative_path = '/' ) {\n\t\treturn plugin_dir_path( $this->main_file ) . ltrim( $relative_path, '/' );\n\t}", "function relative_to_url($filepath) {\n\treturn str_replace(__CHV_RELATIVE_ROOT__, __CHV_BASE_URL__, str_replace('\\\\', '/', $filepath));\n}", "private function pathify(&$path) {\n\t\t$path = realpath($path).'/';\n\t}", "public static function makeRelative(string $path, string $basePath): string\n {\n $path = self::canonicalize($path);\n $basePath = self::canonicalize($basePath);\n\n [$root, $relativePath] = self::split($path);\n [$baseRoot, $relativeBasePath] = self::split($basePath);\n\n // If the base path is given as absolute path and the path is already\n // relative, consider it to be relative to the given absolute path\n // already\n if ('' === $root && '' !== $baseRoot) {\n // If base path is already in its root\n if ('' === $relativeBasePath) {\n $relativePath = ltrim($relativePath, './\\\\');\n }\n\n return $relativePath;\n }\n\n // If the passed path is absolute, but the base path is not, we\n // cannot generate a relative path\n if ('' !== $root && '' === $baseRoot) {\n throw new InvalidArgumentException(sprintf('The absolute path \"%s\" cannot be made relative to the relative path \"%s\". You should provide an absolute base path instead.', $path, $basePath));\n }\n\n // Fail if the roots of the two paths are different\n if ($baseRoot && $root !== $baseRoot) {\n throw new InvalidArgumentException(sprintf('The path \"%s\" cannot be made relative to \"%s\", because they have different roots (\"%s\" and \"%s\").', $path, $basePath, $root, $baseRoot));\n }\n\n if ('' === $relativeBasePath) {\n return $relativePath;\n }\n\n // Build a \"../../\" prefix with as many \"../\" parts as necessary\n $parts = explode('/', $relativePath);\n $baseParts = explode('/', $relativeBasePath);\n $dotDotPrefix = '';\n\n // Once we found a non-matching part in the prefix, we need to add\n // \"../\" parts for all remaining parts\n $match = true;\n\n foreach ($baseParts as $index => $basePart) {\n if ($match && isset($parts[$index]) && $basePart === $parts[$index]) {\n unset($parts[$index]);\n\n continue;\n }\n\n $match = false;\n $dotDotPrefix .= '../';\n }\n\n return rtrim($dotDotPrefix.implode('/', $parts), '/');\n }", "public function getRelativePath($relative_to_this_path = '')\n {\n $hold = getcwd();\n $target = $this->normalise($relative_to_this_path);\n chdir($target);\n $this->data = realpath($this->path);\n chdir($hold);\n\n return;\n }", "public function getLocalPath($path);", "protected static function standardizePath($path) {\n\t\treturn self::pathIsRelative($path) ? self::getDocumentRoot().DIRECTORY_SEPARATOR.$path : $path;\n\t}", "private static function absolutize( $path, $base ) {\n\t\tif ( ! empty( $path ) && ! \\WP_CLI\\Utils\\is_path_absolute( $path ) ) {\n\t\t\t$path = $base . DIRECTORY_SEPARATOR . $path;\n\t\t}\n\t\treturn $path;\n\t}", "public static function resolvePath($path, $relative_to = null) {\n $is_absolute = self::isAbsolutePath($path);\n\n if (!$is_absolute) {\n if (!$relative_to) {\n $relative_to = getcwd();\n }\n $path = $relative_to.DIRECTORY_SEPARATOR.$path;\n }\n\n if (is_link($path)) {\n $parent_realpath = realpath(dirname($path));\n if ($parent_realpath !== false) {\n return $parent_realpath.DIRECTORY_SEPARATOR.basename($path);\n }\n }\n\n $realpath = realpath($path);\n if ($realpath !== false) {\n return $realpath;\n }\n\n\n // This won't work if the file doesn't exist or is on an unreadable mount\n // or something crazy like that. Try to resolve a parent so we at least\n // cover the nonexistent file case.\n $parts = explode(DIRECTORY_SEPARATOR, trim($path, DIRECTORY_SEPARATOR));\n while (end($parts) !== false) {\n array_pop($parts);\n if (phutil_is_windows()) {\n $attempt = implode(DIRECTORY_SEPARATOR, $parts);\n } else {\n $attempt = DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, $parts);\n }\n $realpath = realpath($attempt);\n if ($realpath !== false) {\n $path = $realpath.substr($path, strlen($attempt));\n break;\n }\n }\n\n return $path;\n }", "public function realPath($relativeFilename) { \n // Check for absolute path \n if (realpath($relativeFilename) == $relativeFilename) return $relativeFilename; \n \n // Otherwise, treat as relative path \n $paths = explode(PATH_SEPARATOR, get_include_path()); \n foreach ($paths as $path) { \n $path = str_replace('\\\\', '/', $path); \n $path = rtrim($path, '/') . '/'; \n $fullpath = realpath($path . $relativeFilename); \n if ($fullpath) return $fullpath; \n } \n \n return false; \n }", "protected function _path($path) {\r\n\t\treturn $this->rootName.($path == $this->root ? '' : $this->separator.$this->_relpath($path));\r\n\t}", "public static function resolvePath($path, $relative_to = null) {\n $is_absolute = self::isAbsolutePath($path);\n\n if (!$is_absolute) {\n if (!$relative_to) {\n $relative_to = getcwd();\n }\n $path = $relative_to.DIRECTORY_SEPARATOR.$path;\n }\n\n if (is_link($path)) {\n $parent_realpath = realpath(dirname($path));\n if ($parent_realpath !== false) {\n return $parent_realpath.DIRECTORY_SEPARATOR.basename($path);\n }\n }\n\n $realpath = realpath($path);\n if ($realpath !== false) {\n return $realpath;\n }\n\n\n // This won't work if the file doesn't exist or is on an unreadable mount\n // or something crazy like that. Try to resolve a parent so we at least\n // cover the nonexistent file case.\n\n // We're also normalizing path separators to whatever is normal for the\n // environment.\n\n if (phutil_is_windows()) {\n $parts = trim($path, '/\\\\');\n $parts = preg_split('([/\\\\\\\\])', $parts);\n\n // Normalize the directory separators in the path. If we find a parent\n // below, we'll overwrite this with a better resolved path.\n $path = str_replace('/', '\\\\', $path);\n } else {\n $parts = trim($path, '/');\n $parts = explode('/', $parts);\n }\n\n while ($parts) {\n array_pop($parts);\n if (phutil_is_windows()) {\n $attempt = implode(DIRECTORY_SEPARATOR, $parts);\n } else {\n $attempt = DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, $parts);\n }\n $realpath = realpath($attempt);\n if ($realpath !== false) {\n $path = $realpath.substr($path, strlen($attempt));\n break;\n }\n }\n\n return $path;\n }", "function relative_to_absolute($filepath) {\n\treturn str_replace(__CHV_RELATIVE_ROOT__, __CHV_ROOT_DIR__, str_replace('\\\\', '/', $filepath));\n}", "function fixRelativePath($path, $cwd_path)\n\t{\n\t\treturn addslashes(preg_replace(array('~^\\.([/\\\\\\]|$)~', '~[/]+~', '~[\\\\\\]+~', '~[/\\\\\\]$~'), array($cwd_path . '$1', '/', '\\\\', ''), $path));\n\t}", "function normalize_path($path, $slash_it = true) {\n\n\t$parser_mem_crc = 'normalize_path' . crc32($path.$slash_it);\n\n\t$ch = mw_var($parser_mem_crc);\n\tif ($ch != false) {\n\n\t\t$path = $ch;\n\t} else {\n\n\n\n\n\n\t\t$path_original = $path;\n\t\t$s = DIRECTORY_SEPARATOR;\n\t\t$path = preg_replace('/[\\/\\\\\\]/', $s, $path);\n\t// $path = preg_replace ( '/' . $s . '$/', '', $path ) . $s;\n\t\t$path = str_replace($s . $s, $s, $path);\n\t\tif (strval($path) == '') {\n\t\t\t$path = $path_original;\n\t\t}\n\t\tif ($slash_it == false) {\n\t\t\t$path = rtrim($path, DIRECTORY_SEPARATOR);\n\t\t} else {\n\t\t\t$path .= DIRECTORY_SEPARATOR;\n\t\t\t$path = rtrim($path, DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR);\n\t\t}\n\t\tif (strval(trim($path)) == '' or strval(trim($path)) == '/') {\n\t\t\t$path = $path_original;\n\t\t}\n\t\tif ($slash_it == false) {\n\t\t} else {\n\t\t\t$path = $path . DIRECTORY_SEPARATOR;\n\t\t\t$path = reduce_double_slashes($path);\n\t\t// $path = rtrim ( $path, DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR );\n\t\t}\n\n\t\tmw_var($parser_mem_crc, $path);\n\n\t}\n\n\treturn $path;\n}", "public function getRelativePath($from, $to)\n {\n $from = $this->getPathParts($from);\n $to = $this->getPathParts($to);\n\n $relPath = $to;\n foreach ($from as $depth => $dir) {\n if ($dir === $to[$depth]) {\n array_shift($relPath);\n } else {\n $remaining = count($from) - $depth;\n if ($remaining > 1) {\n $padLength = (count($relPath) + $remaining - 1) * -1;\n $relPath = array_pad($relPath, $padLength, '..');\n break;\n } else {\n $relPath[0] = './' . $relPath[0];\n }\n }\n }\n return implode('/', $relPath);\n }", "private function _getRelativeLogPath(array $path_data, $path_key, $repository_path)\n\t{\n\t\t$ret = $path_data[$path_key];\n\n\t\tif ( $path_data['kind'] == 'dir' ) {\n\t\t\t$ret .= '/';\n\t\t}\n\n\t\t$ret = str_replace($repository_path, '', $ret);\n\n\t\tif ( $ret === '' ) {\n\t\t\t$ret = '.';\n\t\t}\n\n\t\treturn $ret;\n\t}", "function path($path='') {\n return $this->base_dir . $path;\n }", "function truepath($path){\n $unipath=strlen($path)==0 || $path[0]!='/';\n // attempts to detect if path is relative in which case, add cwd\n if(strpos($path,':')===false && $unipath)\n $path=getcwd().DIRECTORY_SEPARATOR.$path;\n // resolve path parts (single dot, double dot and double delimiters)\n $path = str_replace(array('/', '\\\\'), DIRECTORY_SEPARATOR, $path);\n $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');\n $absolutes = array();\n foreach ($parts as $part) {\n if ('.' == $part) continue;\n if ('..' == $part) {\n array_pop($absolutes);\n } else {\n $absolutes[] = $part;\n }\n }\n $path=implode(DIRECTORY_SEPARATOR, $absolutes);\n // resolve any symlinks\n if(file_exists($path) && linkinfo($path)>0)$path=readlink($path);\n // put initial separator that could have been lost\n $path=!$unipath ? '/'.$path : $path;\n return $path;\n}", "public function resolvePath (string $source, string $target) : string\n {\n $sourceDirs = $this->toDirectoryFragments(\\dirname($source));\n $targetFileName = \\basename($target);\n\n // if relative path is absolute, just return the absolute path\n if (\"/\" === \\substr($target, 0, 1))\n {\n return $target;\n }\n\n // strip leading \"./\"\n if (\"./\" === \\substr($target, 0, 2))\n {\n $target = \\substr($target, 2);\n }\n\n $targetDirs = $this->toDirectoryFragments(\\dirname($target));\n\n // if the relative dirs are empty (it is just a file name), use the same directory\n if (empty($targetDirs))\n {\n return $this->buildFilePath($sourceDirs, $targetFileName);\n }\n\n // strip leading \"../../\" from the beginning of the relative dir and simultaneously from the end of the source dir\n while (!empty($targetDirs) && \"..\" === $targetDirs[0])\n {\n \\array_pop($sourceDirs);\n \\array_shift($targetDirs);\n }\n\n return $this->buildFilePath(\n \\array_merge($sourceDirs, $targetDirs),\n $targetFileName\n );\n }", "function rewritePath($path)\n {\n global $rewritePathList;\n $path = ltrim($path, './');\n $urlArray = explode('/', $path);\n if (isset($rewritePathList[$urlArray[0]])) {\n $urlArray[0] = $rewritePathList[$urlArray[0]];\n }\n return implode('/', $urlArray) != '' ? implode('/', $urlArray) : './';\n }", "public function getRelativePath(): string\n {\n return $this->relativePath;\n }", "public function ressourceToPath($path)\n {\n return __DIR__.'/../'.$path;\n }", "static function url2fullPath( $url )\n {\n $url = self::normalize( $url );\n\n $uri = isset( $_SERVER[ 'SCRIPT_NAME' ] )\n ? $_SERVER[ 'SCRIPT_NAME' ] : ( isset( $_SERVER[ 'PHP_SELF' ] )\n ? $_SERVER[ 'PHP_SELF' ]\n : false );\n\n $uri = self::normalize( $uri );\n\n if( substr( $url, 0, 1 ) !== \"/\" ){\n if( $uri === false ) return false;\n $url = dirname( $uri ) . \"/$url\";\n }\n\n if( isset( $_SERVER[ 'DOCUMENT_ROOT' ] ) ){\n return self::normalize( $_SERVER[ 'DOCUMENT_ROOT' ] . \"/$url\" );\n\n } else{\n if( $uri === false ) return false;\n\n if( isset( $_SERVER[ 'SCRIPT_FILENAME' ] ) ){\n $scr_filename = self::normalize( $_SERVER[ 'SCRIPT_FILENAME' ] );\n return self::normalize( substr( $scr_filename, 0, -strlen( $uri ) ) . \"/$url\" );\n }\n\n $count = count( explode( '/', $uri ) ) - 1;\n for( $i = 0, $chdir = \"\"; $i < $count; $i++ )\n $chdir .= \"../\";\n $chdir = self::normalize( $chdir );\n\n $dir = getcwd();\n if( ( $dir === false ) || !@chdir( $chdir ) )\n return false;\n $rdir = getcwd();\n chdir( $dir );\n return ( $rdir !== false ) ? self::normalize( $rdir . \"/$url\" ) : false;\n }\n }", "function getAbsolutePath() ;", "function adjustPath($path) {\r\n $isWin = (substr(PHP_OS, 0, 3) == 'WIN') ? 1 : 0;\r\n $siteDir = eZSys::siteDir();\r\n \r\n $path = str_replace('\\\\', '/', $siteDir . $path );\r\n $path = str_replace('//', '/', $path);\r\n if ($isWin) {\r\n $path = str_replace('/', '\\\\\\\\', $path);\r\n }\r\n return $path;\r\n}" ]
[ "0.6867227", "0.67079884", "0.6542726", "0.63866204", "0.63704085", "0.63596874", "0.6331498", "0.6303299", "0.6271455", "0.6261987", "0.62147766", "0.6199806", "0.6171473", "0.61463815", "0.61432534", "0.6100414", "0.6095798", "0.6082337", "0.60546166", "0.6047338", "0.6005078", "0.59764546", "0.5972317", "0.5967336", "0.5935252", "0.5893403", "0.58784956", "0.5867368", "0.58647656", "0.5826133", "0.58068615", "0.57913494", "0.57889533", "0.57723653", "0.5764473", "0.5762309", "0.5759697", "0.5739245", "0.5729354", "0.5717931", "0.571788", "0.5708618", "0.5707364", "0.57029396", "0.56632817", "0.5659809", "0.56320304", "0.5621237", "0.561395", "0.5610153", "0.560719", "0.56056386", "0.5594619", "0.55878466", "0.55491155", "0.5541384", "0.55265117", "0.5517616", "0.55002505", "0.54958045", "0.54853165", "0.5484091", "0.54744947", "0.54714286", "0.5470624", "0.54671925", "0.5446638", "0.5435019", "0.5432911", "0.54294515", "0.54196393", "0.5419519", "0.54058444", "0.5404961", "0.5387413", "0.537771", "0.5371583", "0.53528863", "0.5350632", "0.53269696", "0.5325614", "0.5322652", "0.5316374", "0.5310459", "0.53084046", "0.529622", "0.52932143", "0.5292891", "0.5289022", "0.5286242", "0.52769995", "0.527698", "0.5261593", "0.5246086", "0.52388996", "0.52378935", "0.5232968", "0.52325296", "0.5230373", "0.522635" ]
0.7656842
0
Find all directories with files that match a given pattern
function findDirectoriesWithFiles($path, $pattern = '*') { $res = array(); if(substr($path, -1) != '/') $path = $path.'/'; foreach(glob($path.$pattern, GLOB_BRACE) as $file) { $res[] = dirname($file); } foreach(glob($path.'*', GLOB_ONLYDIR|GLOB_BRACE) as $file) { $res = array_merge($res, findDirectoriesWithFiles($file, $pattern)); } return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function find($dir, $pattern){\n // escape any character in a string that might be used to trick\n // a shell command into executing arbitrary commands\n $dir = escapeshellcmd($dir);\n // get a list of all matching files in the current directory\n $files = glob(\"$dir/$pattern\");\n // find a list of all directories in the current directory\n // directories beginning with a dot are also included\n foreach (glob(\"$dir/{.[^.]*,*}\", GLOB_BRACE|GLOB_ONLYDIR) as $sub_dir){\n $arr = find($sub_dir, $pattern); // resursive call\n $files = array_merge($files, $arr); // merge array with files from subdirectory\n }\n // return all found files\n return $files;\n}", "protected function _list_files_recursively($pattern)\n\t{\n\t\t$files = glob($pattern);\n\n\t\tforeach (glob(dirname($pattern).DIRECTORY_SEPARATOR.'*', GLOB_ONLYDIR|GLOB_NOSORT) AS $dir)\n\t\t{\n\t\t\t$files = array_merge($files, $this->_list_files_recursively($dir.DIRECTORY_SEPARATOR.basename($pattern)));\n\t\t}\n\n\t\treturn $files;\n\t}", "function grep($path, $pattern, &$results)\n{\n // find all files in the path (incl folders)\n $items = glob($path . '/*'); // */\n\n for ($i = 0; $i < count($items); $i++)\n {\n if (is_dir($items[$i]))\n {\n $add = glob($items[$i] . '/*'); // */\n $items = array_merge($items, $add);\n }\n }\n\n // search through the files.\n $results = array();\n foreach($items as $f)\n {\n if (filetype($f) == 'file')\n {\n if (preg_match($pattern, file_get_contents($f), $matches))\n $results = array_merge($results, $matches);\n }\n }\n\n return (count($results) > 0);\n}", "function recurseFind($dir, $pattern, $depthRemaining )\n{\n\tglobal $filesep;\n\t$subFiles = array();\n\t$subDirs = array();\n\n\t$dh = opendir($dir);\n\twhile ( false != ($file = readdir($dh)) ) { \n\t\tif ( $file != '.' && $file != '..' ) {\n\n\t\t\t$fullFile = $dir . DIRECTORY_SEPARATOR . $file;\n\n\t\t\tif ( is_dir($fullFile) ) { \n\t\t\t\tarray_push($subDirs, $fullFile);\n\t\t\t} else {\n\t\t\t\tif ( preg_match($pattern, $fullFile) ) { \n\t\t\t\t\tarray_push($subFiles, $fullFile);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tclosedir($dh);\n\n\t// 2016-Aug-28 -- Limiting the recursion\n\tif ( $depthRemaining > 0 ) { \n\n\tforeach ( $subDirs as $subDir ) { \n\t\tforeach ( recurseFind($subDir, $pattern, $depthRemaining-- ) as $subsubFile ) {\n\t\t\tarray_push($subFiles, $subsubFile );\n\t\t}\n\t}\n\n\t}\n\n\treturn $subFiles;\n}", "function grep($directory, $pattern = null, $recurse = true) {\n static $in_recurse = false;\n static $skip_charachers;\n $reset_in_recurse = false;\n if (!$in_recurse) {\n if (!\\is_dir($directory))\n return array();\n $directory = \\realpath($directory) . \"/\";\n $skip_charachers = \\strlen($directory);\n $in_recurse = $reset_in_recurse = true;\n }\n $ret = array();\n $dirhandle = \\opendir($directory);\n while (false !== ($nodename = \\readdir($dirhandle))) {\n if ($nodename[0] == \".\")\n continue;\n $subpath = $directory . $nodename;\n if (\\is_dir($subpath)) {\n if ($recurse)\n $ret = \\array_merge($ret, grep($subpath . \"/\", $pattern));\n } else if ($pattern == null || \\preg_match($pattern, $subpath))\n $ret[] = \\substr($subpath, $skip_charachers);\n }\n \\closedir($dirhandle);\n if ($reset_in_recurse)\n $in_recurse = false;\n return $ret;\n}", "function rglob($pattern='*', $path='', $flags = 0) {\n $paths = glob($path.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT);\n $files = glob($path.$pattern, $flags);\n\tif (!$files)\n\t\t$files = array();\n\tif (!$paths)\n\t\t$paths = array();\n\n\tforeach ($paths as $path) {\n\t\tif ( strstr($path, 'folder-not-included') )\n\t\t\tcontinue;\n\n\t\t$files = array_merge($files,rglob($pattern, $path, $flags));\n\t}\n\t\n \treturn $files;\n}", "function glob_recursive($pattern, $flags = 0)\n {\n $files = glob($pattern, $flags);\n\n foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {\n $files = array_merge($files, glob_recursive($dir . '/' . basename($pattern), $flags));\n }\n return $files;\n }", "public function findFiles();", "function _ft_search_find_files($dir, $q){\r\n\t$output = array();\r\n\tif (ft_check_dir($dir) && $dirlink = @opendir($dir)) {\r\n\t\twhile(($file = readdir($dirlink)) !== false){\r\n\t\t\tif($file != \".\" && $file != \"..\" && ((ft_check_file($file) && ft_check_filetype($file)) || (is_dir($dir.\"/\".$file) && ft_check_dir($file)))){\r\n\t\t\t\t$path = $dir.'/'.$file;\r\n\t\t\t\t// Check if filename/directory name is a match.\r\n\t\t\t\tif(stristr($file, $q)) {\r\n\t\t\t\t\t$new['name'] = $file;\r\n\t\t\t\t\t$new['shortname'] = ft_get_nice_filename($file, 20);\r\n\t\t\t\t\t$new['dir'] = substr($dir, strlen(ft_get_root()));\r\n\t\t\t\t\tif (is_dir($path)) {\r\n if (ft_check_dir($path)) {\r\n \t\t\t\t\t\t$new['type'] = \"dir\";\t\t\t\t\t \r\n \t\t\t\t\t$output[] = $new;\r\n }\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t $new['type'] = \"file\";\r\n \t\t\t\t\t$output[] = $new;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Check subdirs for matches.\r\n\t\t\t\tif(is_dir($path)) {\r\n\t\t\t\t\t$dirres = _ft_search_find_files($path, $q);\r\n\t\t\t\t\tif (is_array($dirres) && count($dirres) > 0) {\r\n\t\t\t\t\t\t$output = array_merge($dirres, $output);\r\n\t\t\t\t\t\tunset($dirres);\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\tsort($output);\r\n\t\tclosedir($dirlink);\r\n\t\treturn $output;\r\n\t} else {\r\n\t\treturn FALSE;\r\n\t}\r\n}", "function get_files($directory, $pattern = false) {\n\n\t\tif(!isset($directory) OR is_dir($directory) == false ) return false;\n\t\t$returnval = array();\n\n\t\tif(false != ($handle = opendir($directory))) {\n\t\twhile (false !== ($file = readdir($handle))) {\n\n\t if ($file != \".\" && $file != \"..\") {\n\n\t\tif($pattern != false) {\n\n\t\tif(preg_match(\"$pattern\", $file) > 0 ) {\n\t\t$returnval[] = $file;\n }\n\t\t\t}else{\n\t\t\t\t$returnval[] = $file;\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\t}\n\t\tclosedir($handle);\n\t\treturn $returnval;\n\t}", "function _glob($pattern, $flags = 0) {\n\t\t$path = dirname($pattern);\n\t\t$filePattern = basename($pattern);\n\t\tif(is_dir($path) && ($handle = opendir($path)) !== false) {\n\t\t\t$matches = array();\n\t\t\twhile(($file = readdir($handle)) !== false) {\n\t\t\t\tif(($file[0] != '.')\n\t\t\t\t\t\t&& _fnmatch($filePattern, $file)\n\t\t\t\t\t\t&& (!($flags & GLOB_ONLYDIR) || is_dir(\"$path/$file\"))) {\n\t\t\t\t\t$matches[] = \"$path/$file\" . ($flags & GLOB_MARK ? '/' : '');\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t\tif(!($flags & GLOB_NOSORT)) {\n\t\t\t\tsort($matches);\n\t\t\t}\n\t\t\treturn $matches;\n\t\t}\n\t\treturn false;\n\t}", "function rglob($pattern='*', $flags = 0, $path='')\r\r\n\r\r\n{\r\r\n\r\r\n $paths=glob($path.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT);\r\r\n\r\r\n $files=glob($path.$pattern, $flags);\r\r\n\r\r\n foreach ($paths as $path) { $files=array_merge($files,rglob($pattern, $flags, $path)); }\r\r\n\r\r\n return $files;\r\r\n\r\r\n}", "function glob_recursive($path, $pattern, $flags = 0)\n {\n $files = glob($path . '/' . $pattern, $flags);\n \n foreach (glob(dirname($path).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir)\n { \t\n $files = array_merge($files, glob_recursive($dir.'/'.basename($pattern), $flags));\n }\n \n return $files;\n }", "function system_glob_rec($directory='',$pattern='*.*')\n{\n\tsystem_ensure_path_ending($directory);\n\t$paths = system_glob($directory.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT);\n\tif( $pattern )\n\t{\n\t\t$files = system_glob($directory.$pattern);\n\t\tforeach($paths as $path) { $files = array_merge($files,system_glob_rec($path,$pattern)); }\n\t}\n\telse\n\t{\n\t\t$files = $paths;\n\t\tforeach($paths as $path) { $files = array_merge($files,system_glob_rec($path,$pattern)); }\n\t}\n\treturn $files;\n}", "private function recSearchFiles($dir)\n {\n $ffs = scandir($dir);\n\n foreach ($ffs as $ff) {\n\n if ($ff != '.' && $ff != '..') {\n\n if (is_dir($dir . '/' . $ff)) {\n $this->recSearchFiles($dir . $ff . '/');\n } else if (strlen($ff) >= 5) {\n $this->searchedFiles[] = $dir . $ff;\n }\n }\n }\n }", "protected function recursiveGlob($pattern, $flags = 0)\n {\n $files = glob($pattern, $flags);\n\n foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {\n\n // Avoid scanning vendor folder.\n if ($dir === $this->root . '/vendor') {\n continue;\n }\n\n $files = array_merge($files, $this->recursiveGlob($dir . '/' . basename($pattern), $flags));\n }\n\n return $files;\n }", "function searchFiles($search, $path, $video){\n $searchFiles = scandir($path);\n foreach($searchFiles as $sFile){\n if(($sFile!=\".\")&&($sFile!=\"..\")){\n if(is_dir($path.$sFile)){\n $search = glob($path.$sFile.'/'.$video);\n if(!empty($search)){\n return $search;\n }\n }\n }\n }\n return array('did', 'not', 'work');\n}", "function searchFolder( $current_folder, $folder_to_find, &$matches )\n{\n if ( !( $handle = opendir( $current_folder ) ) ) die( \"Cannot open $current_folder.\" );\n\n while ( $entry = readdir( $handle ) ) {\n if ( is_dir( \"$current_folder/$entry\" ) ) {\n if ( $entry != \".\" && $entry != \"..\" ) {\n\n // This entry is a valid folder\n // If it matches our folder name, add it to the list of matches\n if ( $entry == $folder_to_find ) $matches[] = \"$current_folder/$entry\";\n\n // Search this folder\n searchFolder( \"$current_folder/$entry\", $folder_to_find, $matches );\n }\n }\n }\n closedir( $handle );\n}", "protected function findFilesInCacheDir($pattern)\n {\n $finder = new Finder();\n \n return $finder\n ->name($pattern)\n ->in($this->getCacheDir())\n ;\n }", "function find_all_files($dir) \n{ \n $files = array();\n foreach (glob($dir) as $file) {\n $files[] = $file;\n }\n return $files;\n}", "public static function find($args)\n {\n if (!is_array($args)) {\n $args = preg_split('/\\s+/', $args, -1, PREG_SPLIT_NO_EMPTY);\n }\n $dir = realpath(array_shift($args));\n if (!$dir) {\n return array();\n }\n $patterns = array();\n $depth = 0;\n $do_files = $do_dirs = true;\n $args_count = count($args);\n for ($i = 0; $i < $args_count; $i++) {\n switch ($args[$i]) {\n case '-type':\n if (in_array($args[$i+1], array('d', 'f'))) {\n if ($args[$i+1] == 'd') {\n $do_files = false;\n } else {\n $do_dirs = false;\n }\n }\n $i++;\n break;\n case '-name':\n $name = preg_quote($args[$i+1], '#');\n // our magic characters ? and * have just been escaped,\n // so now we change the escaped versions to PCRE operators\n $name = strtr($name, array('\\?' => '.', '\\*' => '.*'));\n $patterns[] = '('.$name.')';\n $i++;\n break;\n case '-maxdepth':\n $depth = $args[$i+1];\n break;\n }\n }\n $path = System::_dirToStruct($dir, $depth, 0, true);\n if ($do_files && $do_dirs) {\n $files = array_merge($path['files'], $path['dirs']);\n } elseif ($do_dirs) {\n $files = $path['dirs'];\n } else {\n $files = $path['files'];\n }\n if (count($patterns)) {\n $dsq = preg_quote(DIRECTORY_SEPARATOR, '#');\n $pattern = '#(^|'.$dsq.')'.implode('|', $patterns).'($|'.$dsq.')#';\n $ret = array();\n $files_count = count($files);\n for ($i = 0; $i < $files_count; $i++) {\n // only search in the part of the file below the current directory\n $filepart = basename($files[$i]);\n if (preg_match($pattern, $filepart)) {\n $ret[] = $files[$i];\n }\n }\n return $ret;\n }\n return $files;\n }", "function scan_directory($dir, $ext = '*', $recurse = true) {\n $files = array ();\n if ($handle = opendir($dir)) {\n while (false !== ($file = readdir($handle))) {\n if ($file == '.' || $file == '..' ||\n $file == 'CVS' || preg_match('|^\\.|', $file)) {\n continue;\n }\n if (is_link($dir . '/' . $file)) {\n continue;\n }\n if (is_dir ($dir . '/' . $file)) {\n if ($recurse == true)\n $files = array_merge($files, scan_directory ($dir . '/' . $file, $ext));\n } else {\n if($ext == get_file_extension($file) || $ext == '*') {\n $files[] = $dir . '/' . $file;\n }\n }\n }\n closedir($handle);\n }\n return $files;\n}", "public static function findFiles(string $pathDir, ?string $pattern = null, bool $bReturnRelativePaths = false)\n {\n return self::_findFilesRecursive($pathDir, $pattern, $bReturnRelativePaths, '');\n }", "private function fileSearchAux($dir, $pattern, &$files) {\n $handle = opendir($dir);\n if ($handle) {\n while (($file = readdir($handle)) !== false) {\n\n if ($file == '.' || $file == '..') {\n continue;\n }\n\n $filePath = $dir == '.' ? $file : $dir . '/' . $file;\n\n if (is_link($filePath)) {\n continue;\n }\n\n if (is_file($filePath)) {\n if (preg_match($pattern, $filePath)) {\n $files[] = $filePath;\n }\n }\n\n if (is_dir($filePath) && !$this->isBlacklisted($file)) {\n $this->fileSearchAux($filePath, $pattern, $files);\n }\n }\n closedir($handle);\n }\n }", "public static function listDir($dirname, $pattern = null)\n\t{\n\t\t$files = glob($dirname . \"/*$pattern*\");\n\t\t$filenames = [];\n\n\t\tforeach ($files as $file) {\n\t\t\t$file = pathinfo($file);\n\t\t\t$filename = $file['filename'];\n\n\t\t\tif (isset($file['extension'])) {\n\t\t\t\t$extension = $file['extension'];\n\t\t\t\tarray_push($filenames, \"$filename.$extension\");\n\t\t\t} else {\n\t\t\t\tarray_push($filenames, \"$filename/\");\n\t\t\t}\n\t\t}\n\n\t\treturn $filenames;\n\t}", "public static function preg_ls ($path=\".\", $recursive=false, $pattern=\"/.*/\") {\n $rec = $recursive;\n $pat = $pattern;\n // it's going to be used repeatedly, ensure we compile it for speed.\n $pat=preg_replace(\"|(/.*/[^S]*)|s\", \"\\\\1S\", $pat);\n //Remove trailing slashes from path\n while (substr($path,-1,1)==\"/\") $path=substr($path,0,-1);\n //also, make sure that $path is a directory and repair any screwups\n if (!is_dir($path)) $path=dirname($path);\n //assert either truth or falsehoold of $rec, allow no scalars to mean truth\n if ($rec!==true) $rec=false;\n //get a directory handle\n $d=dir($path);\n //initialise the output array\n $ret=Array();\n //loop, reading until there's no more to read\n while (false!==($e=$d->read())) {\n //Ignore parent- and self-links\n if (($e==\".\")||($e==\"..\")) continue;\n //If we're working recursively and it's a directory, grab and merge\n if ($rec && is_dir($path.\"/\".$e)) {\n $ret=array_merge($ret,preg_ls($path.\"/\".$e,$rec,$pat));\n continue;\n }\n //If it don't match, exclude it\n if (!preg_match($pat,$e)) continue;\n //In all other cases, add it to the output array\n $ret[]=$path.\"/\".$e;\n }\n //finally, return the array\n return $ret;\n }", "public static function getFilesByPathAndPattern($path, $pattern) {\n\t\t$pathHandle = opendir($path);\n\t\tif ($pathHandle != false ) {\n\t\t\t$imageFiles = array();\n\t\t\twhile (false !== ($filename = readdir($pathHandle))) {\n\t\t\t\t// TODO make this configurable via TS!\n\t\t\t\tif (preg_match($pattern, $filename)) {\n\t\t\t\t\t$imageFiles[] = $filename;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $imageFiles;\n\t\t} else {\n\t\t\tthrow new Exception('Error when trying to open dir: ' . $path);\n\t\t}\n\t}", "public function handle($directory, $pattern, $recursive = false)\n {\n $existingFiles = $this->filesystem->listContents($directory, $recursive);\n $matchedPaths = [];\n foreach ($existingFiles as $file) {\n $normalizedPath = str_replace('\\\\', '/', $file['path']);\n if (preg_match($pattern, $normalizedPath) === 1) {\n $matchedPaths[] = $normalizedPath;\n }\n }\n\n return $matchedPaths;\n }", "protected function scan_files_in_directory($directory, $pattern, $depth = -1)\n {\n $directory = new \\RecursiveDirectoryIterator($directory);\n $iterator = new \\RecursiveIteratorIterator($directory);\n $iterator->setMaxDepth($depth);\n\n $regex = new \\RegexIterator($iterator, $pattern, \\RegexIterator::GET_MATCH);\n\n $files = array();\n\n foreach ($regex as $matches)\n {\n $files[] = array($matches[0]);\n }\n\n if (! count($files))\n {\n $files = array(array(''));\n }\n\n return $files;\n }", "public function test_scan_directories()\n {\n $content = array('.','..','application','.git','nbproject','system');\n $object = Directory::factory(ROOT);\n $res = $object->scan(Directory::SORT_ASC, Directory::SCAN_DIRS);\n \n $this->assertEquals(count($content), count($res));\n foreach($res as $path=>$dir){\n $this->assertTrue(in_array($dir->get_base_name(), $content));\n $this->assertInstanceOf('\\Kaili\\Directory', $dir);\n }\n }", "static function find_files( $dir ) {\n\t\t$found_files = array();\n\t\t$files = scandir( $dir );\n\n\t\tforeach ( $files as $value ) {\n\t\t\t// skip special dot files\n\t\t\t// and any file that starts with a . - think hidden directories like .svn or .git\n\t\t\tif ( strpos( $value, '.' ) === 0 ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// is it a file?\n\t\t\tif ( is_file( \"$dir/$value\" ) ) {\n\t\t\t\t$found_files[] = \"$dir/$value\";\n\t\t\t\tcontinue;\n\t\t\t} else { // it's a directory\n\t\t\t\tforeach ( self::find_files( \"$dir/$value\" ) as $value ) {\n\t\t\t\t\t$found_files[] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $found_files;\n\t}", "public function recursiveGlobFiles($pattern, $flags = 0)\n {\n $files = $this->recursiveGlob($pattern, $flags);\n\n return array_filter($files, 'is_file');\n }", "public function recursiveGlob($pattern, $flags = 0)\n {\n // Perform the glob search.\n $files = glob($pattern, $flags);\n\n // Check if this is to be recursive.\n if (strpos($pattern, '**') !== FALSE) {\n $dirs = glob(dirname($pattern).DIRECTORY_SEPARATOR.'*', GLOB_ONLYDIR|GLOB_NOSORT);\n if ($dirs) {\n foreach ($dirs as $dir) {\n $files = array_merge($files, $this->recursiveGlob($dir.DIRECTORY_SEPARATOR.basename($pattern), $flags));\n }\n }\n }\n\n return $files;\n }", "static private function find_contents($dir)\n {\n $result = array();\n $root = scandir($dir);\n foreach ($root as $value) {\n if ($value === '.' || $value === '..') {\n continue;\n }\n if (is_file($dir . DIRECTORY_SEPARATOR . $value)) {\n if (! self::$ext_filter || in_array(strtolower(pathinfo($dir . DIRECTORY_SEPARATOR . $value, PATHINFO_EXTENSION)), self::$ext_filter)) {\n self::$files[] = $result[] = $dir . DIRECTORY_SEPARATOR . $value;\n }\n continue;\n }\n if (self::$recursive) {\n foreach (self::find_contents($dir . DIRECTORY_SEPARATOR . $value) as $value) {\n self::$files[] = $result[] = $value;\n }\n }\n }\n // Return required for recursive search\n return $result;\n }", "protected function streamSafeGlob(string $directory, string $filePattern): array\n {\n $filePattern = basename($filePattern);\n $files = scandir($directory);\n $found = [];\n\n foreach ($files as $filename) {\n if (in_array($filename, ['.', '..'])) {\n continue;\n }\n\n if (fnmatch($filePattern, $filename) || fnmatch($filePattern . '.ttl', $filename)) {\n $found[] = \"{$directory}/{$filename}\";\n }\n }\n\n return $found;\n }", "function RecursiveScanDir($dir, $prefix = '') {\n\t$dir = rtrim($dir, '\\\\/');\n\t$result = array();\n\tforeach (scandir($dir) as $f) {\n if (\n preg_match('`/tmp/`', \"$dir/$f\")\n || preg_match('`/fpdf.php$`', \"$dir/$f\")\n || preg_match('`/libs/pi_barcode.php$`', \"$dir/$f\")\n || preg_match('`/libs/phpmailer/`', \"$dir/$f\")\n || preg_match('`/libs/securimage/`', \"$dir/$f\")\n || preg_match('`/libs/Smarty/`', \"$dir/$f\")\n )\n continue;\n\t\tif ($f !== '.' and $f !== '..') {\n\t\t\tif (is_dir(\"$dir/$f\")) {\n\t\t\t\t$result = array_merge($result, RecursiveScanDir(\"$dir/$f\", \"$prefix$f/\"));\n\t\t\t} else {\n\t\t\t\tif ( strtolower(substr(pathinfo($f,PATHINFO_EXTENSION),0,3)) == \"php\" && pathinfo(__FILE__,PATHINFO_BASENAME ) != pathinfo($f,PATHINFO_BASENAME ) )\n\t\t\t\t\t$result[] = $prefix.$f;\n\t\t\t}\n\t\t}\n\t}\n\treturn $result;\n}", "function scandir_recursive($directory, $format = null, $excludes = array()){\n $format = ($format == null) ? 'absolute' : $format;\n $paths = array();\n $stack[] = $directory;\n while($stack){\n $this_resource = array_pop($stack);\n if ($resource = scandir($this_resource)){\n $i = 0;\n while (isset($resource[$i])){\n if ($resource[$i] != '.' && $resource[$i] != '..'){\n $current = array(\n 'absolute' => \"{$this_resource}/{$resource[$i]}\",\n 'relative' => preg_replace('/' . preg_quote($directory, '/') . '/', '', \"{$this_resource}/{$resource[$i]}\")\n );\n if (is_file($current['absolute'])){\n $paths[] = $current[$format];\n } elseif (is_dir($current['absolute'])){\n $paths[] = $current[$format];\n $stack[] = $current['absolute'];\n }\n }\n $i++;\n }\n }\n }\n if (count($excludes) > 0){\n $clean = array();\n foreach($paths as $path){\n $remove = false;\n foreach($excludes as $exclude){\n $exclude = preg_quote($exclude, '/');\n $exclude = str_replace('\\*', '.*', $exclude);\n if (preg_match('/' . $exclude . '/', $path)){\n $remove = true;\n }\n }\n if (!$remove) $clean[] = $path;\n }\n $paths = $clean;\n }\n return $paths;\n}", "private function globRecursive(string $pattern, null|int $flag=0):array{\n $files = glob($pattern, $flag);\n foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir)\n {\n $files = array_merge($files, $this->globRecursive($dir.'/'.basename($pattern), $flag));\n }\n return $files;\n }", "public function loadFilePattern(string $pattern, ?string $root = null): array\n {\n $root = $root ?? Path::getDirectory($pattern);\n\n if (Str::contains($root, '*')) {\n throw new \\RuntimeException('Wildcards in folder names are not supported.');\n }\n\n $files = $this->filesystem->files($root, true);\n\n $matchingFiles = [];\n $pattern = Path::join($root, $pattern);\n foreach ($files as $file) {\n if (fnmatch($pattern, $file)) {\n $matchingFiles[] = $file;\n }\n }\n\n return collect($matchingFiles)->map(function (string $file): string {\n return $this->loadFile(\n Path::getFilename($file),\n Path::getDirectory($file)\n );\n })->toArray();\n }", "function scan_dir($dir, $type=array(),$only=FALSE, $allFiles=FALSE, $recursive=TRUE, $onlyDir=\"\", &$files){\n\t$handle = @opendir($dir);\n\tif(!$handle)\n\t\treturn false;\n\twhile ($file = @readdir ($handle))\n\t{\n\t\tif (eregi(\"^\\.{1,2}$\",$file) || $file == 'index.html')\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\tif(!$recursive && $dir != $dir.$file.\"/\")\n\t\t{\n\t\t\tif(is_dir($dir.$file))\n\t\t\t\tcontinue;\n\t\t}\n\t\tif(is_dir($dir.$file))\n\t\t{\n\t\t\tscan_dir($dir.$file.\"/\", $type, $only, $allFiles, $recursive, $file, $files);\n\t\t}\n\t\telse\n\t\t{\n if($only)\n\t\t\t\t$onlyDir = $dir;\n\n\t\t\t$files = buildArray($dir,$file,$onlyDir,$type,$allFiles,$files);\n\t\t}\n\t}\n\t@closedir($handle);\n\treturn $files;\n}", "private function searchFiles($dir)\n {\n $this->searchedFiles = array();\n\n $this->recSearchFiles($this->basePath . $dir);\n\n return $this->searchedFiles;\n }", "function get_php_files(string $path)\n{\n $matches = [];\n $folders = [rtrim($path, DIRECTORY_SEPARATOR)];\n\n while( $folder = array_shift($folders) )\n {\n $matches = array_merge($matches, glob($folder . DIRECTORY_SEPARATOR . '*.php', GLOB_MARK));\n $childFolders = glob($folder . DIRECTORY_SEPARATOR . '*', GLOB_ONLYDIR);\n $folders = array_merge($folders, $childFolders);\n }\n return $matches;\n}", "private function findFiles($directory, $extensions = array())\r\n {\r\n $directory = ROOT_DIR_NAME;\r\n\r\n if($this->check_search_directory($directory))\r\n {\r\n $search = $this->filter_search_str($this->search);\r\n $directories = array();//\"\";\r\n function glob_recursive($directory, &$directories = array(), $search)\r\n {\r\n foreach(glob($directory, GLOB_ONLYDIR | GLOB_NOSORT) as $folder)\r\n {\r\n $directories[] = $folder;\r\n glob_recursive(\"{$folder}/*\", $directories, $search);\r\n }\r\n }\r\n @glob_recursive($directory, $directories, $search);\r\n $files = array ();\r\n foreach($directories as $directory)\r\n {\r\n $slashes = \"../\";\r\n if(strpos($directory, \"..//\") !== FALSE)\r\n {\r\n $slashes = \"..//\";\r\n }\r\n if (in_array(str_replace($slashes, \"\", $directory), $this->ignored)) continue;\r\n $this->find_all_files($directory, $extensions, $search);\r\n /*foreach($extensions as $extension)\r\n {\r\n foreach(glob(\"{$directory}/{$search}.{$extension}\") as $file)\r\n {\r\n $files[$extension][] = $file;\r\n $filename = str_replace(\"..//\", \"\", $file);\r\n $this->root_files_folders[$filename] = filemtime($file);\r\n }\r\n }*/\r\n }\r\n @arsort($this->root_files_folders);\r\n if($this->sort != 'date')\r\n {\r\n @$this->root_files_folders = $this->sort_with_name($this->root_files_folders);\r\n }\r\n }\r\n @$this->root_files_folders = array_keys($this->root_files_folders);\r\n }", "public static function findFiles($dir,$options=array())\n\t{\n\t\t$fileTypes=array();\n\t\t$exclude=array();\n\t\t$level=-1;\n\t\t$absolutePaths=true;\n\t\textract($options);\n\t\t$list=self::findFilesRecursive($dir,'',$fileTypes,$exclude,$level,$absolutePaths);\n\t\tsort($list);\n\t\treturn $list;\n\t}", "function DNUI_scan_dir($dirBase) {\r\n return array_diff(scandir($dirBase), array('..', '.'));\r\n}", "public static function globRecursive(string $pattern, null|int $flags = 0):array{\n $files = glob($pattern, $flags);\n foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir)\n { \n $files = array_merge($files, self::globRecursive($dir.'/'.basename($pattern), $flags));\n }\n return $files;\n }", "public static function doGlob($pattern, $options = 0) {\n $results = [];\n if ($options & GLOB_BRACE) {\n $patterns = static::expandFilenameBraces($pattern);\n } else {\n $patterns = [$pattern];\n }\n foreach ($patterns as $pat) {\n $out = static::doGlobForPath($pat, $options);\n if ($out === false) {\n if ($options & GLOB_ERR) {\n break;\n }\n } else {\n $results = array_merge($results, $out);\n }\n }\n if (($options & GLOB_NOSORT) === 0) {\n asort($results);\n }\n if (($options & GLOB_NOCHECK) && empty($results)) {\n $results[] = $pattern;\n }\n return $results;\n }", "function searchdir ( $path , $maxdepth = -1 , $mode = \"DIRS\" , $d = 0 ) {\n if ( substr ( $path , strlen ( $path ) - 1 ) != '/' ) { $path .= '/' ; }\n $dirlist = array () ;\n if ( $mode != \"FILES\" ) {\n $dirlist[] = $path ;\n }\n if ( $handle = opendir ( $path ) ) {\n while ( false !== ( $file = readdir ( $handle ) ) ) {\n if ( $file != '.' && $file != '..' && substr($file, 0, 1) !== '.' ) {\n $file = $path . $file ;\n if ( ! is_dir ( $file ) ) {\n if ( $mode != \"DIRS\" ) {\n $dirlist[] = $file ;\n }\n }\n elseif ( $d >=0 && ($d < $maxdepth || $maxdepth < 0) ) {\n $result = searchdir ( $file . '/' , $maxdepth , $mode , $d + 1 ) ;\n $dirlist = array_merge ( $dirlist , $result ) ;\n }\n \t\t}\n }\n closedir ( $handle ) ;\n }\n if ( $d == 0 ) { \n natcasesort ( $dirlist ) ;\n }\n return ( $dirlist ) ;\n}", "function searchDir($base_dir=\"./\",$p=\"\",$f=\"\",$allowed_depth=-1){\n\t$contents=array();\n\n\t# trim all input arguments for whitespace\n\t$base_dir=trim($base_dir);\n\t$p=trim($p);\n\t$f=trim($f);\n\n # if base dir is not given, use the this\n\tif($base_dir==\"\")$base_dir=\"./\";\n\n\t# if last character of basedir lacks a \"/\" then add one\n\tif(substr($base_dir,-1)!=\"/\")$base_dir.=\"/\";\n\n\t# remove the \"../\" and \"./\" directories, and trim all \"./\"\n\t$p=str_replace(array(\"../\",\"./\"),\"\",trim($p,\"./\"));\n\n\t# add the requested path to the base directory string\n\t$p=$base_dir.$p;\n\n\t#if p is not a directory, meaning it is a file, get the path to it\n\tif(!is_dir($p))$p=dirname($p);\n\n\t#if the last character of p is not a \"/\" then add one\n\tif(substr($p,-1)!=\"/\")$p.=\"/\";\n\n\t# if caps are set on allowed depth (allowed depth>-1) count the dirs\n\tif($allowed_depth>-1){\n\t\t$allowed_depth=count(explode(\"/\",$base_dir))+ $allowed_depth-1;\n\t\t$p=implode(\"/\",array_slice(explode(\"/\",$p),0,$allowed_depth));\n\t\tif(substr($p,-1)!=\"/\")$p.=\"/\";\n\t}\n\n\t# if f is empty, create an empty array, if not explode and store elements\n\t$filter=($f==\"\")?array():explode(\",\",strtolower($f));\n\n\t# store the files in the files array, and shut up while scanning\n\t$files=@scandir($p);\n\n\t# if there are no files after scan, return an empty array and the path\n\tif(!$files)return array(\"contents\"=>array(),\"currentPath\"=>$p);\n\n\t# iterate through all files found\n\tfor ($i=0;$i<count($files);$i++){\n\n\t\t# gather name and path of each file\n\t\t$fName=$files[$i];\n\t\t$fPath=$p.$fName;\n\n\t\t# check if the file is a directory and tag it as directory\n\t\t# each file is tagged as a folder by default\n\t\t$isDir=is_dir($fPath);\n\t\t$add=false;\n\t\t$fType=\"folder\";\n\n\t\t# if the file is a file\n\t\tif(!$isDir){\n\n\t\t\t# extract extension from filename\n\t\t\t$ft=strtolower(substr($files[$i],strrpos($files[$i],\".\")+1));\n\t\t\t$fType=$ft;\n\n\t\t\t# if there is anything in the filter that matches, add it\n\t\t\tif($f!=\"\"){\n\t\t\t\tif(in_array($ft,$filter))$add=true;\n\t\t\t}else{\n\t\t\t\t$add=true;\n\t\t\t}\n\t\t# if the file is a folder\n\t\t}else{\n\t\t\tif($fName==\".\")continue;\n\t\t\t$add=true;\n\n\t\t\t# filter it, and discard if bad\n\t\t\tif($f!=\"\"){\n\t\t\t\tif(!in_array($fType,$filter))$add=false;\n\t\t\t}\n\n\t\t\t# if the file is the \"..\" folder\n\t\t\tif($fName==\"..\"){\n\t\t\t\t# if we are in the base dir, no not add upper directory option\n\t\t\t\tif($p==$base_dir){\n\t\t\t\t\t$add=false;\n\t\t\t\t}else $add=true;\n\n\t\t\t\t# explode the path by path steps\n\t\t\t\t$tempar=explode(\"/\",$fPath);\n\t\t\t\t# remove last two elements, so the file references parent dir\n\t\t\t\tarray_splice($tempar,-2);\n\t\t\t\t# implode the array, to recreate the path string\n\t\t\t\t$fPath=implode(\"/\",$tempar);\n\t\t\t\t# if for some reason, this reference is shorter than basedir, deny it!\n\t\t\t\tif(strlen($fPath)<= strlen($base_dir))$fPath=\"\";\n\t\t\t}\n\t\t}\n\n\t\t# if the created fPath is non-zero, append to basedir\n\t\tif($fPath!=\"\")$fPath=substr($fPath,strlen($base_dir));\n\t\t# if approved to add, add path, name and type to contents[] array\n\t\tif($add)$contents[]=array(\"fPath\"=>$fPath,\"fName\"=>$fName,\"fType\"=>$fType);\n\t}\n\n\t# if p is shorter than base_dir, deny it! Else, cut away base_dir and use it\n\t$p=(strlen($p)<= strlen($base_dir))?$p=\"\":substr($p,strlen($base_dir));\n\t# return the final contents and its respective path\n\treturn array(\"contents\"=>$contents,\"currentPath\"=>$p);\n}", "public function test_scan_files()\n {\n $content = array('.gitignore','.htaccess','index.php','README');\n $object = Directory::factory(ROOT);\n $res = $object->scan(Directory::SORT_ASC, Directory::SCAN_FILES);\n \n $this->assertEquals(count($content), count($res));\n foreach($res as $path=>$dir){\n $this->assertTrue(in_array($dir->get_base_name(), $content));\n $this->assertInstanceOf('\\Kaili\\File', $dir);\n }\n }", "private function recurseThroughDirectory($baseDir, $lookingFor = \"/(.*)\\.php$/i\")\n {\n $results = array();\n $di = new RecursiveDirectoryIterator($baseDir);\n\n $this->output->writeLn(\"Scanning $baseDir...\");\n\n foreach (new RecursiveIteratorIterator($di) as $filename => $file) {\n if (preg_match($lookingFor, $filename)) {\n $results[] = $this->extractFrom($filename);\n }\n }\n\n return $results;\n }", "public function find_all() {\n $this->ensure_path_exists();\n $files = glob($this->glob_keys_pattern(), GLOB_MARK | GLOB_NOSORT);\n $return = array();\n if ($files === false) {\n return $return;\n }\n foreach ($files as $file) {\n $return[] = substr(basename($file), 0, -6);\n }\n return $return;\n }", "private function scanFolder()\n {\n return scandir($this->currentPath);\n }", "public function searchDir($type, $directory = '')\n {\n $dirs = $this->search($type, $directory, 'path');\n $files = array();\n foreach ($dirs as $dir) {\n $this->_searchDirFiles($dir, $files);\n }\n\n return $files;\n }", "function directory_mapper($path)\n{\n $maxDepth = 3;\n $minDepth = 3;\n $iterator = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS),\n RecursiveIteratorIterator::SELF_FIRST,\n RecursiveIteratorIterator::CATCH_GET_CHILD// Ignore \"Permission denied\"\n );\n $iterator->setMaxDepth($maxDepth);\n\n $paths = array($path);\n foreach ($iterator as $path => $dir) {\n if ($iterator->getDepth() >= $minDepth) {\n if ($dir->isDir()) {\n if (file_exists($dir . DIRECTORY_SEPARATOR . \"meta\")) {\n $paths[] = $path;\n }\n }\n }\n }\n array_shift($paths);\n return $paths;\n}", "function scan_dir($dir){\n\tif( !is_dir( $dir ) )\n\t\treturn false;\n\n\t$files=scandir($dir);\n\n\t$dirs=array();\n\tforeach($files as $file){\n\t\tif($file=='.'||$file=='..'||substr($file,0,1)=='.')\n\t\t\tcontinue;\n\t\tif(is_dir($dir.'/'.$file))\n\t\t\tarray_push($dirs,$file);\n\t}\n\n\treturn $dirs;\n}", "public static function matchPath($pattern, $str, $isCaseSensitive = true) {\n \n // When str starts with a DIRECTORY_SEPARATOR, pattern has to start with a\n // DIRECTORY_SEPARATOR.\n // When pattern starts with a DIRECTORY_SEPARATOR, str has to start with a\n // DIRECTORY_SEPARATOR.\n if (StringHelper::startsWith(DIRECTORY_SEPARATOR, $str) !==\n StringHelper::startsWith(DIRECTORY_SEPARATOR, $pattern)) {\n return false;\n }\n\n $patDirs = explode(DIRECTORY_SEPARATOR, $pattern);\n $strDirs = explode(DIRECTORY_SEPARATOR, $str);\n\n $patIdxStart = 0;\n $patIdxEnd = count($patDirs)-1;\n $strIdxStart = 0;\n $strIdxEnd = count($strDirs)-1;\n \n // up to first '**'\n while ($patIdxStart <= $patIdxEnd && $strIdxStart <= $strIdxEnd) {\n $patDir = $patDirs[$patIdxStart];\n if ($patDir == \"**\") {\n break;\n }\n if (!self::match($patDir, $strDirs[$strIdxStart], $isCaseSensitive)) {\n return false;\n }\n $patIdxStart++;\n $strIdxStart++;\n }\n if ($strIdxStart > $strIdxEnd) {\n // String is exhausted\n for ($i=$patIdxStart; $i <= $patIdxEnd; $i++) {\n if ($patDirs[$i] != \"**\") {\n return false;\n }\n }\n return true;\n } elseif ($patIdxStart > $patIdxEnd) {\n // String not exhausted, but pattern is. Failure.\n return false;\n }\n\n // up to last '**'\n while ($patIdxStart <= $patIdxEnd && $strIdxStart <= $strIdxEnd) {\n $patDir = $patDirs[$patIdxEnd];\n if ($patDir == \"**\") {\n break;\n }\n if (!self::match($patDir, $strDirs[$strIdxEnd], $isCaseSensitive)) {\n return false;\n }\n $patIdxEnd--;\n $strIdxEnd--;\n }\n \n if ($strIdxStart > $strIdxEnd) {\n // String is exhausted\n for ($i = $patIdxStart; $i <= $patIdxEnd; $i++) {\n if ($patDirs[$i] != \"**\") {\n return false;\n }\n }\n return true;\n }\n\n while ($patIdxStart != $patIdxEnd && $strIdxStart <= $strIdxEnd) {\n $patIdxTmp = -1;\n for ($i = $patIdxStart+1; $i <= $patIdxEnd; $i++) {\n if ($patDirs[$i] == \"**\") {\n $patIdxTmp = $i;\n break;\n }\n }\n if ($patIdxTmp == $patIdxStart+1) {\n // '**/**' situation, so skip one\n $patIdxStart++;\n continue;\n }\n // Find the pattern between padIdxStart & padIdxTmp in str between\n // strIdxStart & strIdxEnd\n $patLength = ($patIdxTmp-$patIdxStart-1);\n $strLength = ($strIdxEnd-$strIdxStart+1);\n $foundIdx = -1;\n\n //strLoop: (start of outer loop)\n for ($i=0; $i <= $strLength - $patLength; $i++) { \n for ($j = 0; $j < $patLength; $j++) {\n $subPat = $patDirs[$patIdxStart+$j+1];\n $subStr = $strDirs[$strIdxStart+$i+$j];\n if (!self::match($subPat, $subStr, $isCaseSensitive)) {\n continue 2; // continue up two levels (to strLoop:)\n }\n } \n $foundIdx = $strIdxStart+$i; // only reached if all sub patterns matched\n break;\n }\n\n if ($foundIdx == -1) {\n return false;\n }\n\n $patIdxStart = $patIdxTmp;\n $strIdxStart = $foundIdx + $patLength;\n }\n\n for ($i = $patIdxStart; $i <= $patIdxEnd; $i++) {\n if ($patDirs[$i] != \"**\") {\n return false;\n }\n }\n\n return true;\n }", "public function getFiles( $strRegex = '', $bRecursive = true ) {\n $rz = array(); \n $h = opendir( $this->getName() );\n $arrInner = array();\n while( $h && $pn = readdir( $h ) ) {\n if ( $pn != '.' && $pn != '..' ) {\n \n $strFull = $this->getName() . '/' . $pn;\n if ( is_dir( $strFull ) ) {\n $arrInner[] = $strFull;\n } else if ( $strRegex == '' || preg_match( $strRegex, $pn ) ) { \n $rz [] = $strFull;\n }\n }\n }\n \n if ( $h ) { closedir( $h ); }\n if ( $bRecursive ) {\n foreach ( $arrInner as $strInnerDir ) {\n $dir = new Sys_Dir( $strInnerDir );\n $arrList = $dir->getFiles( $strRegex );\n foreach ( $arrList as $strFile ) { $rz [] = $strFile; } \n }\n } \n return $rz; \n }", "protected function scanDirectory($dir, $include_tests) {\n $files = array();\n\n // In order to scan top-level directories, absolute directory paths have to\n // be used (which also improves performance, since any configured PHP\n // include_paths will not be consulted). Retain the relative originating\n // directory being scanned, so relative paths can be reconstructed below\n // (all paths are expected to be relative to $this->root).\n $dir_prefix = ($dir == '' ? '' : \"$dir/\");\n $absolute_dir = ($dir == '' ? $this->root : $this->root . \"/$dir\");\n\n if (!is_dir($absolute_dir)) {\n return $files;\n }\n // Use Unix paths regardless of platform, skip dot directories, follow\n // symlinks (to allow extensions to be linked from elsewhere), and return\n // the RecursiveDirectoryIterator instance to have access to getSubPath(),\n // since SplFileInfo does not support relative paths.\n $flags = \\FilesystemIterator::UNIX_PATHS;\n $flags |= \\FilesystemIterator::SKIP_DOTS;\n $flags |= \\FilesystemIterator::FOLLOW_SYMLINKS;\n $flags |= \\FilesystemIterator::CURRENT_AS_SELF;\n $directory_iterator = new \\RecursiveDirectoryIterator($absolute_dir, $flags);\n\n // Filter the recursive scan to discover extensions only.\n // Important: Without a RecursiveFilterIterator, RecursiveDirectoryIterator\n // would recurse into the entire filesystem directory tree without any kind\n // of limitations.\n $filter = new RecursiveExtensionFilterIterator($directory_iterator);\n $filter->acceptTests($include_tests);\n\n // The actual recursive filesystem scan is only invoked by instantiating the\n // RecursiveIteratorIterator.\n $iterator = new \\RecursiveIteratorIterator($filter,\n \\RecursiveIteratorIterator::LEAVES_ONLY,\n // Suppress filesystem errors in case a directory cannot be accessed.\n \\RecursiveIteratorIterator::CATCH_GET_CHILD\n );\n\n foreach ($iterator as $key => $fileinfo) {\n $name = $fileinfo->getBasename('.info.yml');\n\n if ($this->fileCache && $cached_extension = $this->fileCache->get($fileinfo->getPathName())) {\n $files[$cached_extension->getType()][$key] = $cached_extension;\n continue;\n }\n\n // Determine extension type from info file.\n $type = FALSE;\n $file = $fileinfo->openFile('r');\n while (!$type && !$file->eof()) {\n preg_match('@^type:\\s*(\\'|\")?(\\w+)\\1?\\s*$@', $file->fgets(), $matches);\n if (isset($matches[2])) {\n $type = $matches[2];\n }\n }\n if (empty($type)) {\n continue;\n }\n $name = $fileinfo->getBasename('.info.yml');\n $pathname = $dir_prefix . $fileinfo->getSubPathname();\n\n $filename = $name . '.' . $type;\n\n if (!file_exists(dirname($pathname) . '/' . $filename)) {\n $filename = NULL;\n }\n\n $extension = new Extension($this->root, $type, $pathname, $filename);\n\n // Track the originating directory for sorting purposes.\n $extension->subpath = $fileinfo->getSubPath();\n $extension->origin = $dir;\n\n $files[$type][$key] = $extension;\n\n if ($this->fileCache) {\n $this->fileCache->set($fileinfo->getPathName(), $extension);\n }\n }\n return $files;\n }", "public function directoryFiles($path)\n {\n $contents = [];\n\n // Scan directory\n $directoryFiles = scandir($path);\n\n foreach ($directoryFiles as $index => $filePath) {\n\n // Ommit . and ..\n if ( ! in_array($filePath, ['.', '..'])) {\n\n // Check if this is a directory\n if (is_dir($path . DIRECTORY_SEPARATOR . $filePath)) {\n\n // Rescan and get files in this directory\n $contents = array_merge($contents, self::directoryFiles($path . DIRECTORY_SEPARATOR . $filePath));\n\n } else {\n\n // Add file to contens array\n $contents[] = $path . DIRECTORY_SEPARATOR . $filePath;\n }\n }\n }\n\n return $contents;\n }", "protected function _findFiles($extensions = '') {\n\t\t$this->_files = [];\n\t\tforeach ($this->_paths as $path) {\n\t\t\tif (!is_dir($path)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$Iterator = new RegexIterator(\n\t\t\t\tnew RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)),\n\t\t\t\t'/^.+\\.(' . $extensions . ')$/i',\n\t\t\t\tRegexIterator::MATCH\n\t\t\t);\n\t\t\tforeach ($Iterator as $file) {\n\t\t\t\t$excludes = ['Config'];\n\t\t\t\t//Iterator processes plugins even if not asked to\n\t\t\t\tif (empty($this->params['plugin'])) {\n\t\t\t\t\t$excludes = array_merge($excludes, ['Plugin', 'plugins']);\n\t\t\t\t}\n\t\t\t\tif (empty($this->params['vendor'])) {\n\t\t\t\t\t$excludes = array_merge($excludes, ['Vendor', 'vendors']);\n\t\t\t\t}\n\t\t\t\tif (!empty($excludes)) {\n\t\t\t\t\t$isIllegalPluginPath = false;\n\t\t\t\t\tforeach ($excludes as $exclude) {\n\t\t\t\t\t\tif (strpos($file, $path . $exclude . DS) === 0) {\n\t\t\t\t\t\t\t$isIllegalPluginPath = true;\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\tif ($isIllegalPluginPath) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($file->isFile()) {\n\t\t\t\t\t$this->_files[] = $file->getPathname();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function scanFiles($dir){\n $path = __DIR__ . DIRECTORY_SEPARATOR . $dir; /** Nurodomas kelias iki jsons folderio */\n $files = scandir($path); /** Nuskenuoja folderi pagal kelia($path) ir grazina esanciu failu masyva */\n\n return $files;\n}", "function searchdir ($path, $maxdepth=-1, $mode=\"FULL\", $d=0) {\n if (substr($path, strlen($path)-1) != '/') { $path .= '/' ; }\n $dirlist = array ();\n if ($mode != \"FILES\") { $dirlist[] = $path ; }\n if (($handle = opendir($path))) {\n while (false !== ($file = readdir($handle))) {\n if ($file != '.' && $file != '..' ) {\n $file = $path . $file ;\n if (!is_dir($file)) {\n if ($mode != \"DIRS\") {\n $dirlist[] = $file ; } }\n elseif ($d >=0 && ($d < $maxdepth || $maxdepth < 0)) {\n $result = $this->searchdir($file . '/', $maxdepth, $mode, $d+1);\n $dirlist = array_merge($dirlist, $result); }\n }\n } // while\n closedir($handle);\n }\n if ( $d == 0 ) {\n natcasesort($dirlist); }\n return ($dirlist) ;\n }", "public function find($path,$filters = null,$recursive = false){\n if(!$this->isDir($path)) return false;\n if(!$filters) $filters = [];\n if(!array_key_exists(File::FIND_FILTER_TYPE,$filters)) $filters[File::FIND_FILTER_TYPE] = File::FIND_TYPE_FILE;\n $files = [];\n if($dir = $this->nlist($path)) foreach($dir as $entry) if(trim(basename($entry),'.')) try{\n $info = ['dir' => $is_dir = $this->isDir($entry)];\n if($is_dir && $recursive) $files += $this->find($entry,$filters,$recursive);\n foreach($filters as $key => $value){\n if($operator = preg_match('/^(\\\\w+)(\\\\W+)$/',$key,$match) ? $match[2] : null) $key = $match[1];\n else $operator = '==';\n switch($key){\n case File::FIND_FILTER_TYPE:\n if($value == File::FIND_TYPE_ALL) break;\n if(($value & File::FIND_TYPE_DIR) && !$is_dir) continue 3;\n if(($value & File::FIND_TYPE_FILE) && $is_dir) continue 3;\n break;\n case File::FIND_FILTER_NAME:\n if(!Str::operator($info[$key] = $entry,$operator,$value)) continue 3;\n break;\n case File::FIND_FILTER_TIME:\n if($is_dir || !Str::operator($info[$key] = $this->mdtm($entry),$operator,$value)) continue 3;\n break;\n case File::FIND_FILTER_SIZE:\n if($is_dir || !Str::operator($info[$key] = $this->size($entry),$operator,\\Rsi\\Number::shorthandBytes($value))) continue 3;\n break;\n case File::FIND_FILTER_FUNC:\n if(!($info[$key] = call_user_func($value,$full,$info))) continue 3;\n break;\n }\n }\n $files[$entry] = $info;\n }\n catch(\\Exception $e){}\n return $files;\n }", "function directory_list($directory_base_path, $filter_dir = false, $filter_files = false, $exclude = \".|..|.DS_Store|.svn\", $recursive = true)\r\n\t{\r\n\t\t$directory_base_path = rtrim($directory_base_path, \"/\") . \"/\";\r\n\r\n\t\tif ( !is_dir($directory_base_path) )\r\n\t\t{\r\n\t\t\terror_log(__FUNCTION__ . \"File at: $directory_base_path is not a directory.\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$result_list = array();\r\n\t\t$exclude_array = explode(\"|\", $exclude);\r\n\r\n\t\tif ( !$folder_handle = opendir($directory_base_path) )\r\n\t\t{\r\n\t\t\terror_log(__FUNCTION__ . \"Could not open directory at: $directory_base_path\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\twhile ( false !== ($filename = readdir($folder_handle)) )\r\n\t\t\t{\r\n\t\t\t\tif ( !in_array($filename, $exclude_array) )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( is_dir($directory_base_path . $filename . \"/\") )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ( $recursive && strcmp($filename, \".\") != 0 && strcmp($filename, \"..\") != 0 )\r\n\t\t\t\t\t\t{ // prevent infinite recursion\r\n\t\t\t\t\t\t\terror_log($directory_base_path . $filename . \"/\");\r\n\t\t\t\t\t\t\t$result_list[$filename] = $this->directory_list(\"$directory_base_path$filename/\", $filter_dir, $filter_files, $exclude, $recursive);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telseif ( !$filter_dir )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$result_list[] = $filename;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telseif ( !$filter_files )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$result_list[] = $filename;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tclosedir($folder_handle);\r\n\t\t\treturn $result_list;\r\n\t\t}\r\n\t}", "protected function getStagedFiles($pattern)\n {\n $filter = empty($pattern) ? '' : ' | grep ' . $pattern;\n \n ob_start();\n $result = shell_exec('git diff-index --name-only --diff-filter=ACMR ' . $this->getAgainst() . $filter);\n ob_clean();\n\n $files = explode(\"\\n\", $result);\n\n $files = array_filter($files, function ($file) {\n return ! empty($file);\n });\n\n array_walk($files, function (&$file) {\n $file = $this->root . DIRECTORY_SEPARATOR . $file;\n });\n\n return $files;\n }", "function scanfiles( $path = '' ) {\n\t\t\t\n\t\t\tglobal $bwpsoptions;\n\t\t\t\n\t\t\t$tz = get_option( 'gmt_offset' ) * 60 * 60;\n\n $data = array();\n\n\t\t\tif ( $dirHandle = @opendir( ABSPATH . $path ) ) { //get the directory\n\t\t\t\n\t\t\t\twhile ( ( $item = readdir( $dirHandle ) ) !== false ) { // loop through dirs\n\t\t\t\t\t\n\t\t\t\t\tif ( $item != '.' && $item != '..' ) { //don't scan parent/etc\n\n\t\t\t\t\t\t$relname = $path . $item;\n \n\t\t\t\t\t\t$absname = ABSPATH . $relname;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( $this->checkFile( $relname ) == true ) { //make sure the user wants this file scanned\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( filetype( $absname ) == 'dir' ) { //if directory scan it\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$data = array_merge( $data, $this->scanfiles( $relname . '/' ) );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else { //is file so add to array\n\n\t\t\t\t\t\t\t\t$data[$relname] = array();\n\t\t\t\t\t\t\t\t$data[$relname]['mod_date'] = @filemtime( $absname ) + $tz;\n\t\t\t\t\t\t\t\t$data[$relname]['hash'] = @md5_file( $absname );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\t@closedir( $dirHandle ); //close the directory we're working with\n \n\t\t\t} \n\t\t\t\n\t\t\treturn $data; // return the files we found in this dir\n\t\t\t\n\t\t}", "private function directoryScan($dir) {\n\t\t\n\t\t// check for the validity of input / working directory\n\t\t\n\t\tif (!is_dir($dir)) {\n\t\t\tdie(\"'$dir' is not a directory.\".LE);\n\t\t}\n\t\t\n\t\t// listing directory contents\n\t\t\n\t\t$result = [];\n\t\t\n\t\t$root = scandir($dir);\n\t\tforeach($root as $value)\n\t\t{\n\t\t\t// removing dots & output directory\n\t\t\t\n\t\t\tif($value === '.' || $value === '..') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// listing only files\n\t\t\t\n\t\t\tif(is_file(\"$dir\".DS.\"$value\")) {\n\t\t\t\t$result[$value]=\"$dir\".DS.\"$value\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// recursive call to self(this method) so we can get files listing recursively\n\t\t\t\n\t\t\tforeach($this->directoryScan(\"$dir\".DS.\"$value\") as $value1)\n\t\t\t{\n\t\t\t\t$result[basename($value1)]=$value1;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "function searchDir($root,$path,&$data)\n\t{\n\t\t$full_path = $root.$path;\n\t\tif(is_dir($full_path))\n\t\t{\n\t\t\t$dp=dir($full_path);\n\t\t\twhile($file=$dp->read())\n\t\t\t{\n\t\t\t\tif($file!='.'&& $file!='..')\n\t\t\t\t{\n\t\t\t\t\tsearchDir($root,$path.'/'.$file,$data);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$dp->close();\n\t\t}\n\t\tif(is_file($full_path))\n\t\t{\n\t\t\t$data[]=$path;\n\t\t}\n\t}", "public function findAllFiles($filename)\n {\n $pinfo = pathinfo($filename);\n $extension = $pinfo['extension'];\n $dir = $pinfo['dirname'] == '.' ? '' : $pinfo['dirname'] . '/';\n $file_relative_path_root = $dir . $pinfo['filename'];\n \n $foundFiles = [];\n \n $pattern = $file_relative_path_root . '.' . $extension . '*';\n \n foreach ($this->paths as $assetsRoot) {\n $foundFiles = array_merge($foundFiles, Rails\\Toolbox\\FileTools::searchFile($assetsRoot, $pattern));\n }\n \n return $foundFiles;\n }", "public function findSchemaFiles() {\n $return = [];\n $directory = new RecursiveDirectoryIterator('modules');\n $flattened = new RecursiveIteratorIterator($directory);\n $files = new RegexIterator($flattened, '/schema.xml$/');\n\n foreach ($files as $file) {\n $relative_path = str_replace(DRUPAL_ROOT . '/', '', $file->getRealPath());\n $return[$relative_path] = $relative_path;\n }\n return $return;\n }", "public function getDirs( $strRegex = '' ) {\n $h = opendir( $this->getName() );\n $rz = array(); // collecting result\n while( $h && $pn = readdir( $h ) ) {\n if ( substr( $pn, 0, 1 ) != '.' ) {\n \n $strFull = $this->getName() . '/' . $pn;\n // Sys_Io::out( $strFull );\n \n if ( is_dir( $strFull ) && ( $strRegex == '' || preg_match( $strRegex, $pn ) ) ) { \n $rz [] = $strFull;\n }\n }\n }\n if ( $h ) { closedir( $h ); }\n return $rz; \n }", "function get_all_directory_files($directory_path)\n{\n\n $scanned_directory = array_diff(scandir($directory_path), array('..', '.'));\n\n\n\n return custom_shuffle($scanned_directory);\n}", "public function getFilesInDirectory(string $path): Collection\n {\n return $this->getProcessedAndNewFiles()->filter(function (File $file) use ($path) {\n if ($path === '') {\n return true;\n }\n $path = \"$path/\";\n $dirName = dirname($file->getFilePathName());\n $pathPosition = strpos($file->getFilePathName(), $path);\n if ($dirName === $path || $pathPosition === 0) {\n return true;\n }\n return false;\n });\n }", "function file_list($d,$x) {\n foreach(array_diff(scandir($d),array('.','..')) as $f)if(is_file($d.'/'.$f)&&(($x)?ereg($x.'$',$f):1))$l[]=$f;\n return $l;\n}", "public function getDirFiles($path, $constSelector = null){\n $directoryContent = scandir($path);\n $contentCollection = [];\n foreach($directoryContent as $dirElement){\n if($this->checkFileSelector($path.$dirElement, $constSelector)){\n $contentCollection[] = $dirElement;\n }\n }\n return $contentCollection;\n }", "public function scan($regex_filter=NULL)\n\t{\n\t\t$this->tossIfException();\n\t\t\n\t\t$files = array_diff(scandir($this->directory), array('.', '..'));\n\t\t$objects = array();\n\t\t\n\t\tforeach ($files as $file) {\n\t\t\t$file = $this->directory . $file;\n\t\t\t\n\t\t\tif ($regex_filter) {\n\t\t\t\t$test_path = (is_dir($file)) ? $file . '/' : $file;\n\t\t\t\tif (!preg_match($regex_filter, $test_path)) {\n\t\t\t\t\tcontinue;\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$objects[] = fFilesystem::createObject($file);\n\t\t}\n\t\t\n\t\treturn $objects;\n\t}", "function list_directories($path) {\n\tglobal $root_directory, $gmz_directories, $ignore_folders;\n if ($handle = @opendir($path)) { \n while (false !== ($filename = readdir($handle))) { \n if ($filename != '.' && $filename != '..') {\n\t\t\t\t$file_path = substr($path.'/'.$filename, strlen($root_directory)+1, strlen($path.'/'.$filename));\n\t\t\t\t$file_folder = substr($file_path, 0, -(strlen($filename)+1));\n\t\t\t\tif(is_dir($path.'/'.$filename)) {\n\t\t\t\t\tif(!in_array($file_path, $ignore_folders)) {\n\t\t\t\t\t\t$gmz_directories[] = $file_path;\n\t\t\t\t\t}\n\t\t\t\t\tlist_directories($path.'/'.$filename);\n\t\t\t\t}\n } \n } \n closedir($handle); \n } else {\n\t\tdisplay_error('Invalid Directory');\n\t}\n}", "public static function allFiles(string $pattern = '*', bool $allFiles = false) : array\n {\n return Filesystem::getRecursiveFiles($pattern, $allFiles);\n }", "public function getTemplatesByPattern($pattern)\n {\n File::resolveFilepath($pattern);\n\n $templates = array();\n foreach ($this->_scriptdir as $dir) {\n if (true === is_array(glob($dir . DIRECTORY_SEPARATOR . $pattern))) {\n $templates = array_merge($templates, glob($dir . DIRECTORY_SEPARATOR . $pattern));\n }\n }\n\n return $templates;\n }", "public function findFiles($directory = [], $filetype = [], $ignore_files = [])\r\n {\r\n $found_files = false;\r\n $filetype = is_array($filetype) ? implode('|', $filetype) : $filetype;\r\n $ignore_files = is_array($ignore_files) ? $ignore_files : [];\r\n\r\n $fs = new Filesystem();\r\n if(!$fs->exists($directory))\r\n return $found_files;\r\n $finder = new Finder();\r\n $finder = $finder->files()->ignoreUnreadableDirs()->in($directory);\r\n\r\n foreach ($finder as $file) {\r\n if( preg_match('/^.*\\.('.$filetype.')$/i', $file)) {\r\n if(!in_array(basename($file), $ignore_files))\r\n $found_files[] = $file->getRealpath();\r\n }\r\n }\r\n\r\n return $found_files;\r\n }", "function file_list($d,$x){\r\n foreach(array_diff(scandir($d),array('.','..')) as $f)if(is_file($d.'/'.$f)&&(($x)?ereg($x.'$',$f):1))$l[]=$f;\r\n return $l;\r\n}", "function get_files ($folder, $include_subs = FALSE) {\n\tif(substr($folder, -1) == '/') {\n\t\t$folder = substr($folder, 0, -1);\n\t}\n\n\t// Make sure a valid folder was passed\n\tif(!file_exists($folder) || !is_dir($folder) || !is_readable($folder)) {\n\t\treturn FALSE;\n\t\texit();\n\t}\n\n\t// Grab a file handle\n\t$all_files = FALSE;\n\tif($handle = opendir($folder))\t{\n\t\t$all_files = array();\n\t\t// Start looping through a folder contents\n\t\twhile ($file = @readdir ($handle)) {\n\t\t\t// Set the full path\n\t\t\t$path = $folder.'/'.$file;\n\n\t\t\t// Filter out this and parent folder\n\t\t\tif($file != '.' && $file != '..') {\n\t\t\t\t// Test for a file or a folder\n\t\t\t\tif(is_file($path)) {\n\t\t\t\t\t$all_files[] = $path;\n\t\t\t\t} elseif (is_dir($path) && $include_subs) {\n\t\t\t\t\t// Get the subfolder files\n\t\t\t\t\t$subfolder_files = get_files ($path, TRUE);\n\n\t\t\t\t\t// Anything returned\n\t\t\t\t\tif ($subfolder_files) {\n\t\t\t\t\t\t$all_files = array_merge($all_files, $subfolder_files);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Cleanup\n\n\t\tclosedir($handle);\n\t}\n\t// Return the file array\n\t@sort($all_files);\n\treturn $all_files;\n}", "function my_scandirNoRecursive($dir_path){\n $array = array();\n $handle = opendir($dir_path);\n while ($entry = readdir($handle)) {\n if (($entry !== \".\") && ($entry !== \"..\")){\n if(!is_dir($entry)){\n array_push($array, $dir_path.\"/\".$entry);\n $array = preg_grep(\"/^.*\\.(png)$/i\", $array);\n sort($array);\n }\n }\n }\n return $array;\n}", "function get_files($route) {\n\tif (is_dir($route)) {\n\t\t$array_files = array();\n\t\t$files = opendir($route);\n\t\twhile ($file = readdir($files)) {\n\t\t\tif ($file != '.' && $file != '..' && !is_dir($route . '/' . $file)) {\n\t\t\t\t$extention = substr($file, -4);\n\t\t\t\t$file = substr($file, 0, -4);\n\t\t\t\tif ($file != 'index' && $extention == '.php') {\n\t\t\t\t\t$array_files[] = $file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($files);\n\t\treturn $array_files;\n\t} else {\n\t\treturn false;\n\t}\n}", "public static function regexFileSearch(string $folder, string $pattern, bool $recursive = true): array\n {\n if ($recursive) {\n $directoryIterator = new \\RecursiveDirectoryIterator($folder);\n $iterator = new \\RecursiveIteratorIterator($directoryIterator);\n } else {\n $directoryIterator = new \\DirectoryIterator($folder);\n $iterator = new \\IteratorIterator($directoryIterator);\n }\n\n $regexIterator = new \\RegexIterator($iterator, $pattern, \\RegexIterator::MATCH);\n $fileList = [];\n\n foreach ($regexIterator as $file) {\n if ($file instanceof \\SplFileInfo) {\n $fileList[] = $file->getPathname();\n }\n }\n\n return $fileList;\n }", "public function scans_packs($pathname)\n\t\t{\t\t\t\n\t\t\t$last_char = substr($pathname,strlen($pathname)-1,1);\n\t\t\tif (0!=strcmp(\"\\\\\",$last_char))\n\t\t\t{\n\t\t\t\t$pathname .= \"\\\\\";\t\t\t\n\t\t\t}\n\t\t\t$pathname .= \"*\";\n\t\t\t$packs = array();\n\t\t\tforeach( glob($pathname) as $filename )\n\t\t\t{\n\t\t\t\tif(!is_dir($filename))\n\t\t\t\t{\n\t\t\t\t\tarray_push($packs,$filename);\t\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $packs;\n\t\t}", "public function loadFiles()\n\t{\n\t\t$files = array();\n\t\t\n\t\t$searchPath = $this->getLocalFolder().\"/*.*\";\n\t\t$filesArray = glob($searchPath);\n\t\t\n\t\tforeach($filesArray as $file)\n\t\t{\n\t\t\t$files[] = new File($file);\n\t\t}\n\t\t\n\t\treturn $files;\n\t}", "protected function getFilesInDirCreateTestDirectory() {}", "function get_directories($route) {\n\tif (is_dir($route)) {\n\t\t$array_directories = array();\n\t\t$directories = opendir($route);\n\t\twhile ($directory = readdir($directories)) {\n\t\t\tif ($directory != '.' && $directory != '..' && is_dir($route . '/' . $directory)) {\n\t\t\t\t//$array_directories[] = $directory;\n\t\t\t\tarray_push($array_directories, $directory);\n\t\t\t}\n\t\t}\n\t\tclosedir($directories);\n\t\treturn $array_directories;\n\t} else {\n\t\treturn false;\n\t}\n}", "function get_all_files($some_folder,$type){\n $rs = [];\n if ($handle = opendir($some_folder)) {\n while (false !== ($entry = readdir($handle))) {\n if ($entry != \".\" && $entry != \"..\") {\n $pathinfo = pathinfo($entry);\n if(!empty($pathinfo['extension'])){\n if($pathinfo['extension']==$type){\n $rs[]=$some_folder.\"/\".$entry;\n }\n }\n }\n }\n \n closedir($handle);\n }\n \n return $rs;\n }", "private function _browseDirectory($path, $startsWith = '') {\n $result = array();\n $directories = glob($path.DIRECTORY_SEPARATOR.'*', GLOB_ONLYDIR);\n if (is_array($directories)) {\n foreach ($directories as $directory) {\n $result = array_merge(\n $result,\n $this->_browseDirectory($directory, $startsWith)\n );\n }\n }\n $files = glob($path.DIRECTORY_SEPARATOR.$startsWith.'*');\n if (is_array($files)) {\n foreach ($files as $file) {\n if (is_file($file)) {\n $result[] = substr($file, strlen($path) + 1);\n }\n }\n }\n return $result;\n }", "public function scanRecursive($regex_filter=NULL)\n\t{\n\t\t$this->tossIfException();\n\t\t\n\t\t$files = $this->scan();\n\t\t$objects = $files;\n\t\t\n\t\t$total_files = sizeof($files);\n\t\tfor ($i=0; $i < $total_files; $i++) {\n\t\t\tif ($files[$i] instanceof fDirectory) {\n\t\t\t\tarray_splice($objects, $i+1, 0, $files[$i]->scanRecursive());\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($regex_filter) {\n\t\t\t$new_objects = array();\n\t\t\tforeach ($objects as $object) {\n\t\t\t\t$test_path = ($object instanceof fDirectory) ? substr($object->getPath(), 0, -1) . '/' : $object->getPath();\n\t\t\t\tif (!preg_match($regex_filter, $test_path)) {\n\t\t\t\t\tcontinue;\t\n\t\t\t\t}\t\n\t\t\t\t$new_objects[] = $object;\n\t\t\t}\n\t\t\t$objects = $new_objects;\n\t\t}\n\t\t\n\t\treturn $objects;\n\t}", "function scanDir($cfg) //$view, $tdir , $subdir='', $match)\n {\n $ff = HTML_FlexyFramework::get();\n \n $subdir = $cfg['subdir'];\n $scandir = $cfg['tdir']. (empty($subdir) ? '' : '/') . $subdir;\n \n if (in_array($subdir, $cfg['skipdir'])) {\n return array();\n }\n // skip dom_templates\n \n if (!file_exists($scandir)) {\n return array();\n }\n $dh = opendir($scandir);\n if(!$dh){\n return array(); // something went wrong!?\n }\n $ret = array();\n \n while (($fn = readdir($dh)) !== false) {\n // do we care that it will try and parse the template directory??? - not really..\n // as we are only looking for php files..\n if(empty($fn) || $fn[0] == '.'){\n continue;\n }\n \n $fullpath = $scandir.(empty($scandir) ? '' : \"/\").$fn;\n // echo \"filename: $fullpath \\n\";\n \n if (is_link($fullpath)) {\n continue;\n }\n \n if(is_dir($fullpath)){\n // then recursively call self...\n $cfg['subdir'] = $subdir . (empty($subdir) ? '' : '/') . $fn;\n $children = $this->scanDir($cfg);\n if (count($children)) {\n $ret = array_merge($ret, $children);\n \n }\n continue;\n \n }\n \n if (!preg_match($cfg['match'], $fn) || !is_file($fullpath)) {\n continue;\n }\n \n \n \n $ret[] = $subdir . (empty($subdir) ? '' : '/'). $fn; /// this used to be strtolower?? why???\n\n \n \n }\n// print_r($ret);\n \n return $ret;\n \n \n \n \n }", "function bob_scandir($root_path, $bad_path, $recursive) {\n $output = array();\n if (file_exists($root_path)){\n $paths = scandir($root_path);\n if ($paths === False)\n return False;\n foreach ($paths as $path) {\n $potential_path = \"${root_path}/${path}\";\n\n // Ignore any files in the bad (admin) path or files that begin with a period.\n if ($potential_path == $bad_path or $path[0] == '.')\n continue;\n\n $output[] = $potential_path;\n $bad_folder = ''; // not sure what this is for\n if ($recursive and is_dir($potential_path)) // Recursively descend and print out files.\n $output = array_merge($output, bob_scandir($potential_path, $bad_folder, $recursive));\n }\n }\n return $output;\n}", "public function get_file_list() {\n\t\tset_time_limit( 0 );\n\n\t\t$this->image_dir = self::_add_trailing_slash( $this->image_dir );\n\n\t\tif ( is_dir( $this->image_dir ) ) {\n $result = array();\n\t\t\t$iterator = new \\RecursiveDirectoryIterator( $this->image_dir, \\FileSystemIterator::SKIP_DOTS );\n\t\t\t$iterator = new \\RecursiveIteratorIterator( $iterator );\n\t\t\t$iterator = new \\RegexIterator( $iterator, '/^.+\\.(jpe?g|png|gif|svg)$/i', \\RecursiveRegexIterator::MATCH );\n\n\t\t\tforeach ( $iterator as $info ) {\n\t\t\t if ( $info->isFile() ) {\n $result[] = $info->getPathname();\n }\n\t\t\t}\n\n\t\t\tunset( $iterator );\n\t\t} else {\n $result = false;\n }\n\n\t\treturn $result;\n\t}", "function collect_files($folder, &$files) {\n $dir_content = glob(\"$folder/*\");\n foreach ($dir_content as $file) {\n if (is_dir($file) && $file != \".\" && $file != \"..\") {\n collect_files($file, $files);\n } elseif (is_file($file)) {\n $files[] .= $file;\n }\n }\n }", "function getFilesByMime($folder, $mime_types, $depth = 0, $extensions = NULL) {\n\t$found = array();\n\t\n\tif(!is_array($mime_types))\n\t\t$mime_types = array($mime_types);\n\t\n\tif($extensions) {\n\t\tif(is_array($extensions)) \n\t\t\t$extensions = implode(',', $extensions);\n\t\t\n\t\t$extensions = '.{' . $extensions . '}';\n\t}\n\t\n\tif($depth) foreach(range(1, $depth) as $i) {\n\t\t$parts[] = str_repeat('*/', $i);\n\t}\n\t\n\t$recursion = '{' . implode(',', $parts) . '}';\n\t\n\t$files = glob(\"{$folder}/{$recursion}*{$extensions}\", GLOB_BRACE);\n\t\n\t$finfo = finfo_open(FILEINFO_MIME_TYPE);\n\t\n\tforeach($files as $path) {\n\t\tif(!is_readable($path))\n\t\t\tcontinue;\n\t\t\n\t\t$mime = finfo_file($finfo, $path);\n\t\t\n\t\tforeach($mime_types as $allowed) {\n\t\t\tif(strpos($mime, $allowed) !== FALSE) {\n\t\t\t\t$found[] = $path;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $found;\n}", "static private function scan_dir( $dir ) {\n\t\t$ignored = array( '.', '..', '.svn', '.htaccess', 'test-log.log' );\n\n\t\t$files = array();\n\t\tforeach ( scandir( $dir ) as $file ) {\n\t\t\tif ( in_array( $file, $ignored ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$files[ $file ] = filemtime( $dir . '/' . $file );\n\t\t}\n\t\tarsort( $files );\n\t\t$files = array_keys( $files );\n\n\t\treturn ( $files ) ? $files : false;\n\t}", "function getFiles(string $path): array\n{\n\tclearstatcache();\n\t$scanned_directory = array_diff(scandir($path), array('..', '.', '.DS_Store'));\n\treturn $scanned_directory;\n}" ]
[ "0.7741564", "0.6880518", "0.68499774", "0.6830415", "0.67901915", "0.675162", "0.67503697", "0.67409074", "0.6733775", "0.6703066", "0.6621217", "0.6567973", "0.65216756", "0.6448307", "0.6437987", "0.64120555", "0.6358692", "0.62945175", "0.62757033", "0.6273639", "0.6258265", "0.6215338", "0.617806", "0.6165316", "0.61635876", "0.61517215", "0.6110555", "0.6093242", "0.6082412", "0.60706925", "0.6051447", "0.6021887", "0.60005057", "0.59865856", "0.59792936", "0.59656554", "0.5963004", "0.59466374", "0.5941419", "0.5930434", "0.5918598", "0.59078157", "0.5876761", "0.5856093", "0.58541954", "0.58503884", "0.58435595", "0.5834236", "0.5830217", "0.5822961", "0.5800146", "0.579924", "0.5799173", "0.57905626", "0.57873833", "0.5777149", "0.5776956", "0.5766513", "0.57627517", "0.5758453", "0.5735165", "0.57245284", "0.57167226", "0.57090443", "0.5697639", "0.5681167", "0.56433517", "0.56391245", "0.5621113", "0.5609058", "0.5607302", "0.5607064", "0.5605089", "0.55999917", "0.5599166", "0.55948293", "0.559139", "0.55839235", "0.5582899", "0.55707204", "0.55700105", "0.55552614", "0.5554253", "0.5549194", "0.5539622", "0.5538371", "0.5527302", "0.5524073", "0.55123115", "0.5509612", "0.5509071", "0.55085015", "0.5504949", "0.5503292", "0.54942024", "0.5494128", "0.5489591", "0.54720163", "0.54653704", "0.5463032" ]
0.72798556
1
Load the view file of create event form
public function event(){ return view('event.event'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create() {\r\n require $this->views_folder . 'create.php';\r\n }", "function create () {\n\tinclude 'request-create-view.php';\n}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n\t{\n\t\treturn View::make('administrator.events.create')->with('page_title','Create New Event');\n\t\t\n\t}", "public function create()\n {\n return view(\"admin.event_create\")->with([\n\n ]);\n }", "public function create()\n\t{\n return $this->view('events.create');\n\t}", "public function create()\n {\n return view(\"Event::create\");\n }", "public function create()\n\t{\n\t\treturn \\View::make('Evento/new_evento');\n\t}", "public function create()\n {\n return view('system-mgmt/evento/create');\n }", "public function create()\n {\n return view ('event.create');\n }", "public function create()\n {\n return View::make('eventos.create');\n }", "public function create()\n {\n // return view('events.create');\n }", "public function createView(){\n\t\t$vue = new View(\"Create\");\n\t\t$vue->generer();\n\t}", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n return view('events::create_event');\n }", "public function create()\n\t{\n\t\treturn View::make('events.create');\n\t}", "public function create()\n {\n $this->view->load('tacgias/create');\n }", "public function create()\n {\n return view('admin.event.create');\n }", "public function create()\n {\n return view('admin.event.create');\n }", "public function create()\n {\n return view('event::create');\n }", "public function create()\n {\n return view('admin.adminevent.create_event');\n }", "function create()\n {\n \t$this->load->view('Admin/VFormUser');\n }", "public function create()\n\t{\n\t\treturn view('events.create');\n\t}", "public function create()\n {\n return view('pages.events.events');\n }", "public function create()\n {\n return view('evento.create');\n }", "public function create()\n {\n return view('event.create');\n }", "public function create()\n {\n return view('event.create');\n }", "public function create()\n {\n return view('event.create');\n }", "public function create()\n {\n return view('event.create');\n }", "public function create()\n {\n //\n return view('events.create');\n }", "public function create()\n {\n return view('events.createevent');\n }", "public function create()\n {\n return view('adm.events.create');\n }", "public function create()\n {\n return view('events::create');\n }", "public function create()\n {\n return view('admin.events.create');\n }", "public function create()\n {\n return view('admin.events.create');\n }", "public function create()\n {\n return view('admin.events.create');\n }", "public function create()\n {\n return view('admin.events.create');\n }", "function create(){\n\n \t$this->load->view('Kesma/VFormbenang');\n\n }", "public function create()\n {\n return view('event');\n }", "public function create()\n {\n Session::put('admin_page', 'event');\n $galleries = Gallery::all();\n $categories = Category::all();\n return view('backend.events.create', compact('galleries', 'categories'));\n }", "public function create()\n {\n $data['types'] = EventsTypes::where('active', '=', true)->with('langs')->get();\n $data['restaurants'] = Restaurant::with('langs')->get();\n\n return view('admin.events.form', $data);\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function londontec_event(){\n\t \n\t\t$id = $this->uri->segment(3);\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/add_londontec_event';\n\t\t$mainData = array(\n\t\t\t'pagetitle' => 'Create londotec event',\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n \n\t}", "public function create()\n {\n return view('calendar::calendar_events.create');\n }", "public function create()\n {\n $action = route('events.store');\n\n return view('department.events._form')->with('action', $action);\n }", "public function create()\n {\n $this->set_datas([]);\n $this->blade->view($this->get_view_page(), $this->get_datas());\n }", "public function create()\n {\n $view = new View('verein_create');\n $view->title = 'Verein erfassen';\n $view->heading = 'Verein erfassen';\n $view->display();\n }", "public function create()\r\n {\r\n return view($this->edit_view);\r\n }", "public function createView();", "public function create(){\n require_once 'views/employee/layouts/header.php';\n require_once 'views/employee/factura/factura.php';\n require_once 'views/employee/layouts/footer.php';\n }", "public function create()\n {\n return view('doodleevents.create');\n }", "public function create()\n {\n return view('upload_file.home', get_defined_vars());\n }", "public function createView(FormView $parent = null);", "public function create()\n\t{\t\n\t\t\n\t\t// load the create form (app/views/fbf_time/create.blade.php)\n\t\t$this->layout->content = View::make('fbf_time.create')\n;\n\t}", "public function create()\n {\n $this->layout->content = View::make('newStoryForm');\n }", "protected function loadView()\n {\n }", "protected function loadView()\n {\n }", "public function create()\n {\n $data['genders'] = Genders::all();\n $data['age_range'] = Age_Ranges::all();\n $data['categories'] = EventCategory::all();\n $data['currencies'] = Currency::all();\n\n return view('events::create', $data);\n }", "function create()\n\t{\n\t\t$db = JFactory::getDbo();\n\t\t\n\t\tif ($_SERVER['REQUEST_METHOD'] == \"GET\") {\n\t\t\t//render the create form\n\t\t\t$view = $this->getView('manage','html');\n\t\t\t\n\t\t\t//load data\n\t\t\t$db->setQuery('select * from #__pbbooking_customfields');\n\t\t\t$view->customfields = $db->loadObjectList();\n\t\t\t$db->setQuery('select* from #__pbbooking_treatments');\n\t\t\t$view->services = $db->loadObjectList();\n\t\t\t$db->setQuery('select * from #__shbesuche_config');\n\t\t\t$view->config = $db->loadObject();\n\t\t\t$view->date = date_create(JRequest::getVar('date'),new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$db->setQuery('select * from #__pbbooking_cals');\n\t\t\t$view->cals = $db->loadObjectList();\n\n\t\t\t//sort out openign and closing times\n\t\t\t$opening_hours = json_decode($view->config->trading_hours,true);\n\t\t\t$opening_time_arr = str_split($opening_hours[$view->date->format('w')]['open_time'],2);\n\t\t\t$closing_time_arr = str_split($opening_hours[$view->date->format('w')]['close_time'],2);\n\t\t\t$view->dt_start = date_create($view->date->format(DATE_ATOM),new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$view->dt_end = date_create($view->date->format(DATE_ATOM),new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$view->dt_start->setTime($opening_time_arr[0],$opening_time_arr[1]);\n\t\t\t$view->dt_end->setTime($closing_time_arr[0],$closing_time_arr[1]);\n\t\n\t\t\t//display the view\n\t\t\t$view->setLayout('create_event');\n\t\t\tJToolbarHelper::save('create');\n\t\t\t$view->display();\n\t\t}\n\t\tif ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n\t\t\t$_POST['treatment_time'] = $_POST['treatment-time'];\n\t\t\t$event_id = Pbbookinghelper::save_pending_event($_POST);\n\t\t\tif ($event_id) {\n\t\t\t\t$db->setQuery('select * from #__pbbooking_pending where id='.$event_id);\n\t\t\t\t$event = $db->loadObject();\n\t\t\t\t$validated_id = Pbbookinghelper::validate_pending($event_id,$event->email);\n\t\t\t\tif ($validated_id) {\n\t\t\t\t\tif ((int)$_POST['reccur'] == 1) {\n\t\t\t\t\t\tPbbookinghelper::make_recurring($validated_id,$_POST);\n\t\t\t\t\t}\n\t\t\t\t\t$this->setRedirect('index.php?option=com_pbbooking&controller=manage&date='.JRequest::getVar('date'),\"Event \".$validated_id.\" has been added.\");\n\t\t\t\t} else {\n\t\t\t\t\t$this->setRedirect('index.php?option=com_pbbooking&controller=manage&date='.JRequest::getVar('date'),JText::_('COM_SHBESUCHE_VALIDATION_ERROR').' '.$db->getErrorMsg());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->setRedirect('index.php?option=com_pbbooking&controller=manage&date='.JRequest::getVar('date'),JText::_('COM_SHBESUCHE_CREATE_ERROR').' '.$db->getErrorMsg());\n\t\t\t}\n\t\t}\t\n\t}", "public function create(){\n \n $razas = Raza::get();\n include 'views/mascota/form_new.php';\n }", "public function create()\n {\n return view(parent::commonData($this->view_path.'.create'));\n }", "public function create()\n {\n $data['module'] = $this->module();\n return view(\"backend.{$this->module()['module']}.create-edit\", $data);\n }", "public function create()\n {\n $obj = new Obj();\n $this->authorize('create', $obj);\n\n return view('appl.'.$this->app.'.'.$this->module.'.createedit')\n ->with('stub','Create')\n ->with('obj',$obj)\n ->with('editor',true)\n ->with('datetimepicker',true)\n ->with('app',$this);\n }", "public function xadmin_createform() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\t/* get the form field title */\n\t\t$form_title = $args [1];\n\t\t$form_type = @$args [2] ? $args [2] : 'blank';\n\t\t\n\t\t/* Load Model */\n\t\t$form = $this->getModel ( 'form' );\n\t\t$this->session->returnto ( 'forms' );\n\t\t\n\t\t/* create the form */\n\t\t$form->createNewForm ( $form_title, $form_type );\n\t\t\n\t\t$this->loadPluginModel ( 'forms' );\n\t\t$plug = Plugins_Forms::getInstance ();\n\t\t\n\t\t$plug->_pluginList [$form_type]->onAfterCreateForm ( $form );\n\t\t\n\t\t/* set the view file (optional) */\n\t\t$this->_redirect ( 'xforms' );\n\t\n\t}", "public function create()\n {\n //加载文件上传模板\n return view(\"Admin.Req.files\");\n }", "public function create()\n {\n return view('backend.'.Auth::user()->role.'.event_calendar.create');\n }", "function loadCreateEvent() { \n $places = Place::all(['placeID', 'title_en'])->sortBy('title_en');\n $categories = Category::all(['ctgID', 'name_en'])->sortBy('name_en');\n return view('cms.events.create.event', ['places' => $places, 'categories' => $categories]);\n }", "public function create()\n {\n\n $event = new Event;\n return view('events.create',compact('event'));\n }", "public function create()\n {\n \n return view('events');\n }", "public function newAction(): void\n {\n $this->view->form = new AnaForm(null, ['edit' => true]);\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "function view()\n\t{\n\t\t$document =& JFactory::getDocument();\n\t\t$model = JModel::getInstance('Form', 'FabrikFEModel');\n\t\tJRequest::setVar('view', 'details');\n\t\t$viewType\t= $document->getType();\n\t\t$this->setPath('view', COM_FABRIK_FRONTEND.DS.'views');\n\t\t$viewLayout\t= JRequest::getCmd('layout', 'default');\n\t\t$view = & $this->getView('form', $viewType, '');\n\t\t$view->setModel($model, true);\n\n\t\t// Set the layout\n\t\t$view->setLayout($viewLayout);\n\n\t\t//todo check for cached version\n\t\tJToolBarHelper::title(JText::_('COM_FABRIK_MANAGER_FORMS'), 'forms.png');\n\t\t$view->display();\n\t\tFabrikHelper::addSubmenu(JRequest::getWord('view', 'lists'));\n\t}", "public function create(){\n include 'views/usuario/nuevo.php';\n }", "public function create()\n\t{\t\n\t\t\n\t\t// load the create form (app/views/fbf_presenca/create.blade.php)\n\t\t$this->layout->content = View::make('fbf_presenca.create')\n;\n\t}", "public function create()\n {\n $this->authorize('create', new Evento());\n $estados = Evento::ESTADO;\n $actividades = Actividad::where('estado', '1')->orderBy('nombre', 'asc')->get();\n return view('evento.create')\n ->with('estados', $estados)\n ->with('actividades', $actividades);\n }", "public function create()\n\t{\n\t\treturn View::make('file.create');\n\t}", "public function create()\n {\n // $categories = EventInterested::get();\n $cities = JobCities::get();\n\n return view('admin.events.create', compact('categories', 'cities'));\n }", "public function create()\n {\n $common = $this->common;\n return view($common.'.addEdit',compact('common'));\n }", "public function create()\n {\n $item = new PilotEvent;\n\n // set default start and end date\n $item->start = \\Carbon\\Carbon::parse(date('n/j/Y g:i a'));\n $item->end = \\Carbon\\Carbon::parse(date('n/j/Y g:i a'));\n\n // set default publish on date\n $item->published_at = \\Carbon\\Carbon::parse(date('n/j/Y g:i a'));\n\n $tags = Tag::orderBy('name', 'asc')->pluck('name', 'id');\n\n $formOptions = ['route' => 'admin.event.store'];\n\n return view('pilot::admin.events.form', compact('item', 'tags', 'formOptions'));\n }", "public function newAction()\n {\n $reflection = new FormReflectionManager($this->flash);\n\n $url = new Url;\n $url->id = $reflection->get('id');\n $url->address = $reflection->get('address');\n \n $this->view->url = $url;\n \n #$this->view->disable(); \n }", "public function create()\n\t{\n\t\t // load the create form (app/views/documents/create.blade.php)\n return View::make('logicViews.documents.create');\n\t}", "public function create()\n {\n if (! Gate::allows('event_create')) {\n return abort(401);\n }\n $category = Category::pluck('name', 'id');\n $subcategory = Subcategory::pluck('title', 'id');\n return view('admin.events.create', compact('category', 'subcategory'));\n }", "function createApprentice() {\n\t\t\t\t\t$addForm = new h2o('views/addApprentice.html');\n\t\t\t\t\techo $addForm->render();\n\t\t\t\t}", "public function create()\n {\n //get data of the participants who can only be organizer\n $organizer= Participant::getOrganizers();\n\n //get only participants which are active\n $invitees = Participant::getActiveParticipants();\n\n //assign to particpants i.e invitees and organizers to the view\n return view('events.create')\n ->with('organizer', $organizer)\n ->with('invitees', $invitees);\n }", "public function create(){\n\t\t$this->load->view('user/Admin_lte_theme/Admin_lte_header');\n \t$this->load->view('user/Admin_lte_theme/Admin_lte_leftsidebar');\n\t\t$this->load->view('user/store/Admin_lte_add_store_form');\n\t\t$this->load->view('user/Admin_lte_theme/Admin_lte_scripts_footer');\n\t}", "public function createForm()\n {\n }", "public function create()\n\t{\n\t\treturn View::make(''.$this->common_name.'.create')->with('common_name',$this->common_name);\n\t}", "public function create()\n {\n $programEvent = new ProgramEvent();\n return view('program-event.create', compact('programEvent'));\n }", "public function newAction()\n {\n $this->view->setTemplateAfter('concours');\n $this->assets\n ->addJs('js/vendor/modernizr.custom.js', true)\n ->addJs('js/date.js', true);\n }", "public function create()\n {\n return view('administration.pointvente.create');\n }", "public function create()\n\t{\n\t\t$this->load->view('admin/header');\n\t\t$this->load->view('admin/create');\n\t\t\n\t}", "public function createForm();", "public function createForm();", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAssocForm()\n {\n $assocs = $this->assocManager->getAssocs();\n require_once 'vue/new.assoc.view.php';\n }", "public function getEventForm(){\n $sports = Sports::all();\n return view('admin.add_event')->with('sports', $sports);\n }" ]
[ "0.7039229", "0.68578696", "0.6806025", "0.6794354", "0.67866427", "0.67857367", "0.67330474", "0.6691202", "0.6680667", "0.6658292", "0.6592093", "0.658587", "0.658415", "0.6580745", "0.6571578", "0.65678555", "0.6562596", "0.65598625", "0.65598625", "0.65546125", "0.6542898", "0.653451", "0.651847", "0.65028226", "0.65011996", "0.6496405", "0.6496405", "0.6496405", "0.6496405", "0.6496127", "0.6480021", "0.6471595", "0.6471419", "0.646846", "0.646846", "0.646846", "0.646846", "0.6441067", "0.64171743", "0.6410221", "0.63931984", "0.63873196", "0.63873196", "0.63873196", "0.63873196", "0.63873196", "0.63873196", "0.63463753", "0.6319604", "0.6317238", "0.63044316", "0.62951064", "0.62835884", "0.6268479", "0.6256772", "0.6255702", "0.6253782", "0.6249556", "0.62456137", "0.6241881", "0.62330264", "0.62330264", "0.62281346", "0.62254924", "0.6221195", "0.62113434", "0.62072515", "0.62015235", "0.6201084", "0.61804086", "0.6178554", "0.61775696", "0.6169945", "0.6150321", "0.6144737", "0.6144557", "0.6139203", "0.61309433", "0.6125534", "0.6124349", "0.61204374", "0.6107656", "0.61048967", "0.61002815", "0.6098933", "0.60893244", "0.608052", "0.6066608", "0.60632443", "0.6063217", "0.6062889", "0.60596025", "0.6053105", "0.6049076", "0.6038233", "0.6037202", "0.60330284", "0.60330284", "0.602668", "0.6019789", "0.60183907" ]
0.0
-1
Load the view file event request data table to admin
public function eventrequest(){ $data=Event::all(); // print_r($data);die(); return view('event.event_request')->with('event',$data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mainEvent(&$req, &$t) {\n\t\t$d = dir(BASE_DIR.'var/search_cache/');\n\t\t$data = array();\n\n\n\t\t$list = new Cgn_Mvc_TableModel();\n\t\t$list->data = array(\n\t\t\t0=> array('link 1','foobar.php'),\n\t\t\t1=> array('link 2','foobar.php'),\n\t\t\t2=> array('link 3','foobar.php')\n\t\t);\n\n\t\twhile ($entry = $d->read()) {\n\t\t\t//skip private files, . and ..\n\t\t\tif ( strpos($entry , '.') === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!is_dir(BASE_DIR.'var/search_cache/'.$entry)) continue;\n\n\t\t\ttry {\n\t\t\t\t$index = new Cgn_Search_Index($entry);\n\t\t\t\t$count = $index->getDocumentCount();\n\t\t\t\t$status = 'OK';\n\t\t\t\t$index->close();\n\t\t\t} catch (Zend_Search_Lucene_Exception $e) {\n\t\t\t\t//set status as 'error'\n\t\t\t\t$status = 'error';\n\t\t\t\t$count = 'N/A';\n\t\t\t\t//swallow PHP error in ZF for chmod\n\t\t\t\tCgn_ErrorStack::pullError('php');\n\t\t\t\tthrow $e;\n\t\t\t}\n\n\t\t\t$data[] = array(\n\t\t\t\t$entry,\n\t\t\t\t$count,\n\t\t\t\t$status\n\t\t\t);\n\t\t}\n\n\t\t$list->data = $data;\n\t\t$list->headers = array('Name', 'Num. Documents', 'Status');\n\t\t$t['listPanel'] = new Cgn_Mvc_AdminTableView($list);\n\t\t$t['listPanel']->attribs['width'] = '600';\n\t\t$t['listPanel']->setColWidth(0, '300');\n\t\t$t['listPanel']->setColWidth(1, '100');\n\t\t$t['listPanel']->setColWidth(2, '100');\n\n\t\t$t['message'] = \"This is the main event.\";\n\t}", "function edit_event_load() {\n\n\t\tadd_filter( 'request', array( $this, 'sort_events' ) );\n\t}", "public function load_data(Request $request)\n\t{\t\n\t\t$build_status_btn = '';\n\t\t$arr_data = [];\n\t\t$arr_search_column \t= $request->input('column_filter');\n\n\t\t$obj_request_data = $this->BaseModel->orderBy('created_at','DESC');\n\n\t\t// if(isset($arr_search_column['full_name']) && $arr_search_column['full_name']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('full_name', 'LIKE',\"%\".$arr_search_column['full_name'].\"%\");\n\t\t// }\n\n\t\t// if(isset($arr_search_column['email']) && $arr_search_column['email']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('email', 'LIKE',\"%\".$arr_search_column['email'].\"%\");\n\t\t// }\n\n\t\t// if(isset($arr_search_column['status']) && $arr_search_column['status']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('status',$arr_search_column['status']);\n\t\t// }\n\n\t\t// if(isset($arr_search_column['role']) && $arr_search_column['role']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('role',$arr_search_column['role']);\n\t\t// }\n\n\t\t$obj_request_data = $obj_request_data->get();\n\n\t\t$json_result \t= DataTables::of($obj_request_data)->make(true);\n\t\t$build_result \t= $json_result->getData();\n\n\t\tif(isset($build_result->data) && sizeof($build_result->data)>0)\n\t\t{\n\t\t\tforeach ($build_result->data as $key => $data) \n\t\t\t{\n\t\t\t\t$edit_link_url = $this->module_url_path.'/edit_email_template/'.base64_encode($data->id);\n\t\t\t\t$delete_link_url = $this->module_url_path.'/delete_email_template/'.base64_encode($data->id);\n\t\t\t\t// $view_link_url = \"javascript:void(0)\";\n\t\t\t\t\n\t\t\t\t$arr_roles = $arr_product_options = [];\n\n\t\t\t\t$id \t\t\t\t\t= isset($data->id)? $data->id :'';\n\t\t\t\t$template_name \t\t\t= isset($data->template_name)? $data->template_name :'';\n\t\t\t\t$template_subject \t\t= isset($data->template_subject)? $data->template_subject :'';\n\t\t\t\t$created_at \t\t\t= isset($data->created_at)? get_formated_date($data->created_at) :'';\n\t\t\t\n\t\t\t\t$action_button_html = '<a title=\"\" href=\"'.$edit_link_url.'\" data-original-title=\"Edit\" ><i class=\"fa fa-cog\" title=\"Edit\"></i></a> <a title=\"\" href=\"'.$delete_link_url.'\" data-original-title=\"Delete\" data-id=\"'.$data->id.'\" onclick=\"return confirm_action(this,event,\\'Do you really want to delete this Template ?\\')\" ><i class=\"fa fa-trash\" title=\"Delete\"></i></a>';\n\n\t\t\t\n\t\t\t\t$i = $key+1;\n\t\t\t\t$build_result->data[$key]->id \t\t = $id;\n\t\t\t\t$build_result->data[$key]->sr_no \t\t= $i;\n\t\t\t\t$build_result->data[$key]->template_name \t= $template_name;\n\t\t\t\t$build_result->data[$key]->template_subject \t= $template_subject;\n\t\t\t\t$build_result->data[$key]->created_at \t= $created_at;\n\t\t\t\t$build_result->data[$key]->built_action_btns = $action_button_html;\n\t\t\t\t\n\t\t\t}\n\t\t\treturn response()->json($build_result);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn response()->json($build_result);\n\t\t}\n\t}", "public function load_data(Request $request)\n\t{\t\n\t\t$build_status_btn = '';\n\t\t$arr_data = [];\n\t\t$arr_search_column \t= $request->input('column_filter');\n\n\t\t$obj_request_data = $this->BaseModel->orderBy('created_at','DESC');\n\n\t\t// if(isset($arr_search_column['full_name']) && $arr_search_column['full_name']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('full_name', 'LIKE',\"%\".$arr_search_column['full_name'].\"%\");\n\t\t// }\n\n\t\t// if(isset($arr_search_column['email']) && $arr_search_column['email']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('email', 'LIKE',\"%\".$arr_search_column['email'].\"%\");\n\t\t// }\n\n\t\t// if(isset($arr_search_column['status']) && $arr_search_column['status']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('status',$arr_search_column['status']);\n\t\t// }\n\n\t\t// if(isset($arr_search_column['role']) && $arr_search_column['role']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('role',$arr_search_column['role']);\n\t\t// }\n\n\t\t$obj_request_data = $obj_request_data->get();\n\n\t\t$json_result \t= DataTables::of($obj_request_data)->make(true);\n\t\t$build_result \t= $json_result->getData();\n\n\t\tif(isset($build_result->data) && sizeof($build_result->data)>0)\n\t\t{\n\t\t\tforeach ($build_result->data as $key => $data) \n\t\t\t{\n\t\t\t\t// $view_link_url = $this->module_url_path.'/view/'.base64_encode($data->id);\n\t\t\t\t$view_link_url = \"javascript:void(0)\";\n\t\t\t\t$built_delete_href = $this->module_url_path.'/delete_country/'.base64_encode($data->id);\n\t\t\t\t$arr_roles = [];\n\n\t\t\t\t// $action_button_html = '<a title=\"\" href=\"'.$view_link_url.'\" data-original-title=\"View\" data-id=\"'.$data->id.'\" id=\"open_edit_modal\"><i class=\"fa fa-cog\" title=\"View\"></i></a> <a href='.$built_delete_href.' title=\"delete\" onclick=\"return confirm_action(this,event,\\'Do you really want to delete this Country ?\\')\"><i class=\"fa fa-trash\"></i></a>';\n\t\t\t\t$action_button_html = '<a title=\"\" href=\"'.$view_link_url.'\" data-original-title=\"View\" data-id=\"'.$data->id.'\" id=\"open_edit_modal\"><i class=\"fa fa-cog\" title=\"View\"></i></a> ';\n\n\t\t\t\tif($data->status != null && $data->status == \"0\")\n\t\t\t\t{\n\t\t\t\t\t$action_button_html .= '<a href=\"'.$this->module_url_path.'/unblock/'.base64_encode($data->id).'\" onclick=\"return confirm_action(this,event,\\'Do you really want to activate this Country ?\\')\"><i class=\"fa fa-eye-slash\" title=\"Blocked\"></i></a>&nbsp&nbsp&nbsp ';\n\t\t\t\t}\n\t\t\t\telseif($data->status != null && $data->status == \"1\")\n\t\t\t\t{\n\t\t\t\t\t$action_button_html .= '<a href=\"'.$this->module_url_path.'/block/'.base64_encode($data->id).'\" onclick=\"return confirm_action(this,event,\\'Do you really want to inactivate this Country ?\\')\"><i class=\"fa fa-eye\" title=\"Active\"></i></a> &nbsp&nbsp&nbsp';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$id \t \t\t\t= isset($data->id)? base64_encode($data->id):'';\n\t\t\t\t$country_id \t\t\t= isset($data->country_id)? $data->country_id :'';\n\t\t\t\t$country_english_name \t= isset($data->country_english_name)? $data->country_english_name :'';\n\t\t\t\t$country_arabic_name \t= isset($data->country_arabic_name)? $data->country_arabic_name :'';\n\t\t\t\t$created_at \t\t\t= isset($data->created_at)? get_formated_date($data->created_at) :'-';\n\t\t\t\t\n\t\t\t\t$i = $key+1;\n\n\t\t\t\t$build_result->data[$key]->id \t\t = $id;\n\t\t\t\t$build_result->data[$key]->sr_no \t\t= $i;\n\t\t\t\t$build_result->data[$key]->country_id \t= $country_id;\n\t\t\t\t$build_result->data[$key]->country_english_name = $country_english_name;\n\t\t\t\t$build_result->data[$key]->country_arabic_name = $country_arabic_name;\n\t\t\t\t$build_result->data[$key]->built_action_btns = $action_button_html;\n\t\t\t\t\n\t\t\t}\n\t\t\treturn response()->json($build_result);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn response()->json($build_result);\n\t\t}\n\t}", "public function index(Request $request)\n {\n $items = MasterDocuments::pluck('eName','id');\n $user = User::pluck('name');\n $post = DB::select(\"select doc.id,doc.eCode,md.eName AS mdName,doc.eName,eFile,name,doc.created_at,doc.updated_at,doc.eMember,m.mb_name\n from documents doc\n join users on users.id = doc.userId\n join master_documents as md on md.id = doc.eCode\n join members as m on m.mb_no = doc.eMember\n where doc.eStatus = 1 and userId = \".auth()->id().\"\n order by doc.created_at desc\");\n if($request->ajax()){\n return Datatables::of($post)\n ->addIndexColumn()\n ->addColumn('eFile', function($row){\n $eFile = '<a href=\"home/preview/'.$row->id.'\" target=\"_blank\"><i class=\"material-icons\" style=\"color: gray;\">'.'download'.'</i></a>';\n return $eFile;\n })\n ->addColumn('action', function($row){\n $action = '\n <i class=\"material-icons\"><a id=\"edit-file\" data-toggle=\"modal\" data-id='.$row->id.'>edit</a></i>\n <meta name=\"csrf-token\" content=\"{{ csrf_token() }}\">\n <i class=\"material-icons\"><a id=\"delete-file\" data-id='.$row->id.'>delete</a></i>';\n return $action;\n })\n ->addColumn('download', function($row){\n $showName = $row->eName;\n return $showName;\n })\n ->rawColumns(['eFile','action'])\n ->make(true);\n }\n return view('main',compact('items','user','post'));\n }", "public function getAjaxData($request)\n {\n if ($this->selectedViewType == 'simple') {\n // Remove action column for query\n if (in_array('action', $this->listViewSimple))\n $this->listViewSimple = array_diff($this->listViewSimple, array('action'));\n $columns = $this->listViewSimple;\n\t\t\t$users = Admin::select($columns);\n } else\n // All and Custom Case\n $columns = ['*'];\n\t\t$users = Admin::select($columns);\n //$users = Admin::select($columns);\n $table = DataTables::of($users);\n $table->editColumn('avatar', function ($user) {\n return getAvatar($user->avatar, $user->name);\n });\n $table->addColumn('action', function ($user) {\n return '<a href=\"' . route('admin-member-edit', $user->user_id) . '\" class=\"btn btn-xs btn-primary\"><i class=\"glyphicon glyphicon-edit\"></i></a>\n <a href=\"' . route('admin-member-detail', $user->user_id) . '\" class=\"btn btn-xs bg-color-pink txt-color-white\"><i class=\"glyphicon glyphicon-th-list\"></i></a>\n <a href=\"javascript:void(0)\" class=\"btn btn-xs btn-danger txt-color-white\" onclick=\"confirmBox(\\'' . route('admin-member-delete', $user->user_id) . '\\')\"><i class=\"glyphicon glyphicon-remove\" ></i></a>';\n });\n $table->editColumn('created_timestamp', function ($user) {\n return my_date($user->created_timestamp, '', '');\n });\n $table->filterColumn('created_timestamp', function ($query, $keyword) {\n $query->whereRaw(\"DATE_FORMAT(FROM_UNIXTIME(created_timestamp),'%d-%m-%Y %h:%i:%s') like ?\", [\"%$keyword%\"]);\n });\n $table->editColumn('updated_timestamp', function ($user) {\n return my_date($user->updated_timestamp, '', '');\n });\n $table->filterColumn('updated_timestamp', function ($query, $keyword) {\n $query->whereRaw(\"DATE_FORMAT(FROM_UNIXTIME(updated_timestamp),'%d-%m-%Y %h:%i:%s') like ?\", [\"%$keyword%\"]);\n });\n\n $table->rawColumns(['avatar', 'action']);\n\n //If custom Filter Added.\n if ($this->advanceFilters)\n setAdvanceFilter($request, $table);\n\n return $table->make(true);\n }", "public function load_data_sertifikat($kd_event){\n\t\tif($this->session->userdata('sebagai') ==\"Admin\"){\n\t\t\tif($kd_event != \"\"){\n\t\t\t\treturn $this->db->query('SELECT sp.kd_sertifikat AS kd_sertifikat, sp.nomor AS nomor, sp.link_sertifikat AS link, sp.status AS status,p.nama_lengkap AS nama_lengkap, p.email AS email, e.nama_event AS nama_event\n\t\t\t\tFROM '.$this->table_name1.' AS sp \n\t\t\t\tINNER JOIN '.$this->table_name2.' AS p\n\t\t\t\tON sp.kd_peserta = p.kd_peserta \n\t\t\t\tINNER JOIN '.$this->table_name3.' AS e \n\t\t\t\tON p.kd_event = e.kd_event \n\t\t\t\tWHERE p.kd_event = \"'.$kd_event.'\"\n\t\t\t\tORDER BY sp.timestamp DESC\n\t\t\t\t');\n\t\t\t}else{ // semua event dokumentasi\n\t\t\t\treturn $this->db->query('SELECT sp.kd_sertifikat AS kd_sertifikat, sp.nomor AS nomor, sp.link_sertifikat AS link, sp.status AS status,p.nama_lengkap AS nama_lengkap, p.email AS email, e.nama_event AS nama_event\n\t\t\t\tFROM '.$this->table_name1.' AS sp \n\t\t\t\tINNER JOIN '.$this->table_name2.' AS p\n\t\t\t\tON sp.kd_peserta = p.kd_peserta \n\t\t\t\tINNER JOIN '.$this->table_name3.' AS e \n\t\t\t\tON p.kd_event = e.kd_event \n\t\t\t\tORDER BY p.timestamp DESC\n\t\t\t\t');\n\t\t\t}\n\t\t} \n\t\telse{ // level bukan admin \n\t\t\t$kd_admin = $this->session->userdata('kd_admin');\n\t\t\tif($kd_event != \"\"){\n\t\t\t\treturn $this->db->query('SELECT sp.kd_sertifikat AS kd_sertifikat,\n\t\t\t\tsp.nomor AS nomor, sp.link_sertifikat AS link, sp.status AS status, p.nama_lengkap AS nama_lengkap, p.email AS email, e.nama_event AS nama_event\n\t\t\t\tFROM '.$this->table_name1.' AS sp \n\t\t\t\tINNER JOIN '.$this->table_name2.' AS p\n\t\t\t\tON sp.kd_peserta = p.kd_peserta \n\t\t\t\tINNER JOIN '.$this->table_name3.' AS e \n\t\t\t\tON p.kd_event = e.kd_event \n\t\t\t\tINNER JOIN '.$this->table_name4.' AS al \n\t\t\t\tON al.kd_event = e.kd_event \n\t\t\t\tWHERE al.kd_admin = \"'.$kd_admin.'\" AND p.kd_event = \"'.$kd_event.'\"\n\t\t\t\tORDER BY sp.timestamp DESC\n\t\t\t\t');\n\t\t\t}else{\n\t\t\t\treturn $this->db->query('SELECT sp.kd_sertifikat AS kd_sertifikat, sp.nomor AS nomor, sp.link_sertifikat AS link, sp.status AS status,p.nama_lengkap AS nama_lengkap, p.email AS email, e.nama_event AS nama_event\n\t\t\t\tFROM '.$this->table_name1.' AS sp \n\t\t\t\tINNER JOIN '.$this->table_name2.' AS p\n\t\t\t\tON sp.kd_peserta = p.kd_peserta \n\t\t\t\tINNER JOIN '.$this->table_name3.' AS e \n\t\t\t\tON p.kd_event = e.kd_event \n\t\t\t\tINNER JOIN '.$this->table_name4.' AS al \n\t\t\t\tON al.kd_event = e.kd_event\n\t\t\t\tWHERE al.kd_admin = \"'.$kd_admin.'\" \n\t\t\t\tORDER BY sp.timestamp DESC\n\t\t\t\t');\n\t\t\t}\n\t\t}\n\t}", "public function fileinput(){\n $this->load->view('admin/fileinput');\n }", "public function listtabelSDMAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('SDM');\n }", "public function indexAction() {\n $this->view->events = $this->_events->getEventsAdmin($this->_getParam('page'));\n }", "public function officer_index(Request $request) {\n\n $log = new LogSystem;\n $log->module_id = 20;\n $log->activity_type_id = 1;\n $log->description = \"Papar senarai Pegawai Borang L - Butiran Pegawai Yang Memegang Jawatan\";\n $log->data_old = json_encode($request->input());\n $log->url = $request->fullUrl();\n $log->method = strtoupper($request->method());\n $log->ip_address = $request->ip();\n $log->created_by_user_id = auth()->id();\n $log->save();\n\n $officers = FormLOfficer::where('forml_id', $request->id);\n\n return datatables()->of($officers)\n ->editColumn('designation.name', function($officer) {\n return $officer->designation->name;\n })\n ->editColumn('held_at', function ($officer) {\n return $officer->held_at ? date('d/m/Y', strtotime($officer->held_at)) : '';\n })\n ->editColumn('action', function ($officer) {\n $button = \"\";\n\n $button .= '<a onclick=\"editOfficer('.$officer->id.')\" href=\"javascript:;\" class=\"btn btn-primary btn-xs\"><i class=\"fa fa-edit\"></i></a> ';\n $button .= '<a onclick=\"removeOfficer('.$officer->id.')\" href=\"javascript:;\" class=\"btn btn-danger btn-xs \"><i class=\"fa fa-trash\"></i></a> ';\n\n return $button;\n })\n ->make(true);\n }", "public function admin_load()\n {\n }", "public function load()\n\t{\n\t\tparent::__construct(\n array(\n 'singular' => 'orghub-upload',\n 'plural' => 'orghub-upload',\n 'ajax' => false\n )\n );\n\n\t\t$columns = $this->get_columns();\n\t\t$hidden = $this->get_hidden_columns();\n\t\t$sortable = $this->get_sortable_columns();\n\t\t$this->_column_headers = array( $columns, $hidden, $sortable );\n\t}", "public function uploadedData(Request $request)\n {\n if ($request->ajax()) {\n $files = RemoteFile::with('user')->get();\n\n return Datatables::of($files)\n ->editColumn('name', function ($r) {\n $s3 = $this->createS3Service->make($r->bucket);\n $url = $s3->url($r->filename);\n\n return view('admin::document.upload.partials._names', ['row' => $r, 'url' => $url]);\n })\n ->editColumn('created_by', function ($r) {\n return $r->user->email;\n })\n ->editColumn('is_public', function ($r) {\n return $r->is_public ? 'Yes' : 'No';\n })\n ->addColumn('action', function ($r) {\n return view('admin::document.upload.partials._options', ['row' => $r]);\n })\n ->make(true);\n }\n }", "function events(){\n if(!$this->session->userdata('logged_in') || $this->session->userdata('role') != 'student'):\n redirect('/');\n endif;\n\n $data = array(\n 'events' => $this->admin_model->browse(array('module' => 'events'))\n );\n //load content\n $this->template->content->view('/students/content/events', $data);\n\n //add js file\n $this->template->publish('layouts/app');\n }", "public function listdataSDMAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('SDM');\n }", "function tripal_views_views_data() {\n $data = array();\n\n // Manually integrate the drupal.tripal_views* tables\n $data = tripal_views_views_data_tripal_views_tables($data);\n\n // Determine the name of the chado schema\n $chado_schema = tripal_get_schema_name('chado');\n\n // MAKE SURE ALL CHADO TABLES ARE INTEGRATED\n tripal_views_integrate_all_chado_tables();\n\n // DEFINE GLOBAL FIELDS\n // Filter handler that lets the admin say:\n // \"Show no results until they enter search parameters\"\n $data['views']['search_results'] = array(\n 'title' => t('Delay Results'),\n 'help' => t('Delay results until Apply/Search is clicked by the user.'),\n 'filter' => array(\n 'handler' => 'tripal_views_handler_filter_no_results',\n ),\n );\n\n $data['views']['action_links_area'] = array(\n 'title' => t('Action Links'),\n 'help' => t('Add action links to the view.'),\n 'area' => array(\n 'handler' => 'tripal_views_handler_area_action_links',\n ),\n );\n\n $tvi_query = db_query('SELECT * FROM {tripal_views}');\n\n // INTEGRATE THE LIGHTEST SETUP FOR EACH TABLE\n foreach ($tvi_query as $tvi_row) {\n\n // check to see if this is the lightest (drupal-style) priority setup for this table\n // if not then don't use this definition\n $lightest_priority_setup = tripal_is_lightest_priority_setup($tvi_row->setup_id, $tvi_row->table_name);\n if (!$lightest_priority_setup) {\n continue;\n }\n\n // ids we'll use for queries\n $setup_id = $tvi_row->setup_id;\n $mview_id = $tvi_row->mview_id;\n\n // holds the base table name and fields\n $base_table = '';\n $base_fields = array();\n\n // indicated whether the current table is a base table or not\n $is_base_table = $tvi_row->base_table;\n\n // POPULATE THE BASE TABLE NAME AND FIELDS\n // If an $mview_id is given then get the materialized view info,\n // otherwise get the Chado table info\n $legacy_mview = FALSE;\n if ($mview_id) {\n\n // get the base table name from the materialized view\n // D7 TODO: Check DBTNG changes work\n $sql = \"SELECT name, mv_specs FROM {tripal_mviews} WHERE mview_id = :id\";\n $mview_table = db_query($sql, array(':id' => $mview_id));\n $mview_table = $mview_table->fetchObject();\n $base_table = $mview_table->name;\n\n if (!empty($mview_table->mv_specs)) {\n $legacy_mview = TRUE;\n }\n }\n\n if ($legacy_mview) {\n // get the columns in this materialized view. They are separated by commas\n // where the first word is the column name and the rest is the type\n $columns = explode(\",\", $mview_table->mv_specs);\n foreach ($columns as $column) {\n $column = trim($column); // trim trailing and leading spaces\n preg_match(\"/^(.*?)\\ (.*?)$/\", $column, $matches);\n $column_name = $matches[1];\n $column_type = $matches[2];\n $base_fields[$column_name] = array(\n 'column_name' => $column_name,\n 'type' => $column_type,\n );\n }\n\n // get the field name and descriptions\n // D7 TODO: Check DBTNG changes work\n $sql = \"SELECT * FROM {tripal_views_field} WHERE setup_id=:setup\";\n $query = db_query($sql, array(':setup' => $setup_id));\n foreach($query as $field) {\n $base_fields[$field->column_name]['name'] = $field->name;\n $base_fields[$field->column_name]['help'] = $field->description;\n }\n }\n // if this is not a legacy materialized view\n else {\n $base_table = $tvi_row->table_name;\n\n // get the table description\n $table_desc = chado_get_schema($base_table);\n\n $fields = $table_desc['fields'];\n if (!is_array($fields)) {\n $fields = array();\n }\n foreach ($fields as $column => $attrs) {\n $base_fields[$column] = array(\n 'column_name' => $column,\n 'type' => $attrs['type'],\n );\n }\n\n // get the field name and descriptions\n $sql = \"SELECT * FROM {tripal_views_field} WHERE setup_id=:setup\";\n $query = db_query($sql, array(':setup' => $setup_id));\n foreach ($query as $field) {\n $base_fields[$field->column_name]['name'] = $field->name;\n $base_fields[$field->column_name]['help'] = $field->description;\n }\n }\n\n // SETUP THE BASE TABLE INFO IN THE DATA ARRAY\n $data[$base_table]['table']['group'] = t(\"$tvi_row->name\");\n\n if ($is_base_table) {\n $data[$base_table]['table']['base'] = array(\n 'group' => \"$tvi_row->name\",\n 'title' => \"$tvi_row->name\",\n 'help' => $tvi_row->comment,\n 'search_path' => $chado_schema\n );\n }\n else {\n $data[$base_table]['table'] = array(\n 'group' => \"$tvi_row->name\",\n 'title' => \"$tvi_row->name\",\n 'help' => $tvi_row->comment,\n 'search_path' => $chado_schema\n );\n }\n\n // ADD THE FIELDS TO THE DATA ARRAY\n foreach ($base_fields as $column_name => $base_field) {\n if (!isset($base_field['name'])) {\n $data[$base_table][$column_name] = array(\n 'title' => t($column_name),\n 'help' => t($column_name),\n 'field' => array(\n 'click sortable' => TRUE,\n ),\n );\n\n tripal_report_error(\n 'tripal_views',\n TRIPAL_WARNING,\n \"The name and help were not set for %table.%column. As a consequence the column\n name has been used... You should ensure that the 'name' and 'help' keys for\n this field are set in the integration array (priority = %priority)\",\n array(\n '%table'=> $base_table,\n '%column' => $column_name,\n '%priority' => $tvi_row->priority\n )\n );\n }\n else {\n $data[$base_table][$column_name] = array(\n 'title' => t($base_field['name']),\n 'help' => t($base_field['help']),\n 'field' => array(\n 'click sortable' => TRUE,\n ),\n );\n }\n\n // now add the handlers\n $sql = \"SELECT * FROM {tripal_views_handlers} WHERE setup_id = :setup AND column_name = :column\";\n $handlers = db_query($sql, array(':setup' => $setup_id, ':column' => $column_name));\n $num_handlers = 0;\n foreach ($handlers as $handler) {\n $num_handlers++;\n\n $data[$base_table][$column_name][$handler->handler_type]['handler'] = $handler->handler_name;\n\n // Add in any additional arguments\n // This should be a serialized array including (at a minimum) name => <handler name>\n if ($handler->arguments) {\n $data[$base_table][$column_name][$handler->handler_type] = array_merge($data[$base_table][$column_name][$handler->handler_type], unserialize($handler->arguments));\n }\n };\n\n // If there were no handlers applied to the current field then warn the administrator!\n if ($num_handlers == 0) {\n tripal_report_error(\n 'tripal_views',\n TRIPAL_WARNING,\n \"No handlers were registered for %table.%column. This means there is no views\n functionality for this column. To register handlers, make sure the 'handlers'\n key for this field is set in the integration array (priority = %priority).\n The supported keys include 'field', 'filter', 'sort', 'relationship'. Look\n at the tripal_add_views_integration() for additional details.\",\n array(\n '%table'=> $base_table,\n '%column' => $column_name,\n '%priority' => $tvi_row->priority\n )\n );\n }\n }\n\n // ADD JOINS & RELATIONSHIPS TO DATA ARRAY\n // only add joins if this is a base table\n // this keeps the list of available fields manageable\n // all other tables should be added via relationships\n $sql = \"SELECT * FROM {tripal_views_join} WHERE setup_id = :setup\";\n $joins = db_query($sql, array(':setup' => $setup_id));\n if (!isset($joins)) {\n $joins = array();\n }\n foreach ($joins as $join) {\n $left_table = $join->left_table;\n $left_field = $join->left_field;\n $base_table = $join->base_table;\n $base_field = $join->base_field;\n $handler = $join->handler;\n $base_title = ucwords(str_replace('_', ' ', $base_table));\n $left_title = ucwords(str_replace('_', ' ', $left_table));\n\n // if the 'node' table is in our integrated list then\n // we want to skip it. It shouldn't be there.\n if ($left_table == 'node') {\n continue;\n }\n\n // add join entry\n if (!$join->relationship_only) {\n $data[$left_table]['table']['join'][$base_table] = array(\n 'left_field' => $base_field,\n 'field' => $left_field,\n );\n if ($handler) {\n $data[$left_table]['table']['join'][$base_table]['handler'] = $handler;\n }\n if (!empty($join->arguments)) {\n array_merge($data[$left_table]['table']['join'][$base_table], unserialize($join->arguments));\n }\n }\n\n // warn if deprecated method of relationship addition was used (ie: through handlers)\n if (isset($data[$base_table][$base_field]['relationship'])) {\n tripal_report_error('tripal_views', TRIPAL_NOTICE,\n 'DEPRECATED: Currently using tripal_views_handlers to store relationship for %base => %left when you should be using tripal_views_joins.',\n array('%base' => $base_table, '%left' => $left_table));\n }\n\n // Add relationship entry.\n // NOTE: we use a fake field name to allow us to have multiple\n // relationships for the same field (ie: feature.feature_id has many\n // Many relationships but views only supports a single one).\n $fake_field = $base_field . '_to_' . $left_table;\n\n // Bug Fix: The old $fake_field used above doesn't take into account\n // multiple relationships to the same left table. To keep backwards\n // compatibility, this old fake_field needs to continue to be used for\n // the LAST recorded relationship. However, for all previously set\n // relationships we can use an improved fake name which takes into\n // account the left field and ensures all relationships for a single\n // left table are not condensed into a single relationship.\n if (array_key_exists($fake_field, $data[$base_table])) {\n\n // Again, note that we can't just change the fake_name after finding\n // there is more than one relationship because then the FIRST\n // relationship would keep the old fake_name rather than the LAST\n // which keeps backwards compatiblity since the old naming caused all\n // previous relationships be be overridden by the next one.\n // Thus we first need to determine the left field of the previous\n // join for this table combination and then use that to form our\n // improved fake field.\n $previous_left_field = $data[$base_table][$fake_field]['relationship']['base field'];\n $improved_fake_field = $base_field . '_to_' . $left_table . \".\" . $previous_left_field;\n $data[$base_table][$improved_fake_field] = $data[$base_table][$fake_field];\n }\n $data[$base_table][$fake_field] = array(\n 'title' => \"$base_title.$base_field => $left_title.$left_field\",\n 'help' => t(\"Joins @base to @left\", array('@base' => \"$base_title.$base_field\", '@left' => \"$left_title.$left_field\")),\n 'relationship' => array(\n 'handler' => $join->relationship_handler,\n 'title' => t(\"$base_field => $left_title ($left_field)\"),\n 'label' => t(\"$base_field => $left_title ($left_field)\"),\n 'real field' => $base_field,\n 'base' => $left_table,\n 'base field' => $left_field\n )\n );\n if (!empty($join->arguments)) {\n array_merge($data[$base_table][$fake_field]['relationship'], unserialize($join->arguments));\n }\n }\n }\n return $data;\n}", "public function listView(): void\n {\n $this->_data = $this->_entity->fetch();\n if (!$this->special) {\n $newData = $this->_builder->submitCreate();\n if ($newData) {\n array_push($this->_data, $newData);\n }\n }\n require VF . \"{$this->route}/list.php\";\n require VF . \"{$this->route}/create.php\";\n }", "public function importPage()\n {\n \treturn view('intern.operasional.admin.setting.database.import');\n }", "public function adminViewFileEdits()\r\n\t{\r\n\t\treturn false;\r\n\t}", "public function loadftvchrequestsAction()\n {\n // $broadcast_array=$this->_arrayDb->loadArrayv2(\"EP_BROADCASTS\", $this->_lang);\n $ftvcontacts_obj = new Ep_Ftv_FtvContacts();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $ftvcomments_obj = new Ep_Ftv_FtvComments();\n $ftvdocuments_obj = new Ep_Ftv_FtvDocuments();\n $ftvpausetime_obj = new Ep_Ftv_FtvPauseTime();\n $loginuser = $this->adminLogin->userId;\n $contacts = $ftvcontacts_obj->getRequestCreatedContacts(); // print_r($contacts); exit;\n $this->_view->contacts_array = $contacts;\n if($loginuser != '110823103540627')\n $aColumns = array( 'first_name', 'created_at', 'request_object','download','duration','modify_contains','modify_broadcast','demand','status','comments','time_spent','identifier');\n else\n $aColumns = array( 'first_name', 'created_at', 'request_object','download','duration','modify_contains','modify_broadcast','demand','assingnation','status','comments','time_spent','identifier');\n /* * Paging\t */\n $sLimit = \"\";\n $broadcast_sort_flag = true;\n $broadcast_sort = \"\";\n $to_sort = \"\";\n if ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )\n {\n $sLimit = \"LIMIT \".intval( $_GET['iDisplayStart'] ).\", \".\n intval( $_GET['iDisplayLength'] );\n }\n /* \t * Ordering \t */\n $col_array = array('request_object','download','duration','modify_contains', 'modify_broadcast','demand','assingnation','status','comments','time_spent');\n $sOrder = \"\";\n // echo $_GET['iSortCol_0']. \"----\".intval( $_GET['iSortingCols'] );\n if ( isset( $_GET['iSortCol_0'] ) )\n {\n $sOrder = \"ORDER BY \";\n for ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )\n {\n if ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == \"true\" )\n {\n $sOrder .= $aColumns[ intval( $_GET['iSortCol_'.$i] ) ].\" \".($_GET['sSortDir_'.$i]==='asc' ? 'asc' : 'desc') .\", \";\n if($aColumns[ intval( $_GET['iSortCol_'.$i] ) ] === 'modify_broadcast'){\n $to_sort = 'modify_broadcast';\n $broadcast_sort_flag = true;\n $broadcast_sort = ($_GET['sSortDir_'.$i]==='asc' ? 'asc' : 'desc');\n }\n else if($aColumns[ intval( $_GET['iSortCol_'.$i] ) ] === 'duration'){\n $to_sort = 'duration';\n $broadcast_sort_flag = true;\n $broadcast_sort = ($_GET['sSortDir_'.$i]==='asc' ? 'asc' : 'desc');\n }\n else if($aColumns[ intval( $_GET['iSortCol_'.$i] ) ] === 'modify_contains'){\n $to_sort = 'modify_contains';\n $broadcast_sort_flag = true;\n $broadcast_sort = ($_GET['sSortDir_'.$i]==='asc' ? 'asc' : 'desc');\n }\n }\n }\n $sOrder = substr_replace( $sOrder, \"\", -2 );\n if ( $sOrder == \"ORDER BY\" )\n {\n $sOrder = \"\";\n }\n }\n $sWhere = \"\";\n if ( isset($_GET['sSearch']) && $_GET['sSearch'] != \"\" )\n {\n $sWhere = \" HAVING (\";\n for ( $i=0 ; $i<3 ; $i++ )//only first 3 fields will return proper values rest will return xml saved values\n {\n $keyword=addslashes($_GET['sSearch']);\n $keyword = preg_replace('/\\s*$/','',$keyword);\n $keyword=preg_replace('/\\(|\\)/','',$keyword);\n $words=explode(\" \",$keyword);\n $sWhere.=$aColumns[$i].\" like '%\".utf8_decode($keyword).\"%' OR \";\n }\n $sWhere = substr_replace( $sWhere, \"\", -3 );\n $sWhere .= ')';\n }\n /* Individual column filtering */\n for ( $i=0 ; $i<count($aColumns) ; $i++ )\n {\n if ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == \"true\" && $_GET['sSearch_'.$i] != '' )\n {\n if ( $sWhere == \"\" )\n {\n $sWhere = \" WHERE \";\n }\n else\n {\n $sWhere .= \" AND \";\n }\n $sWhere .= \"`\".$aColumns[$i].\"` LIKE '%\".$_GET['sSearch_'.$i].\"%' \";\n }\n }\n if($loginuser != \"\")\n {\n $ftv_params=$this->_request->getParams();\n if($ftv_params['search'] == 'search')\n { //echo \"mash\"; exit;\n $condition['search'] = $ftv_params['search'];\n $condition['contactId'] = $ftv_params['contactId'];\n $condition['containsId'] = $ftv_params['containsId'];\n $condition['broadcastId'] = $ftv_params['broadcastId'];\n $condition['quandId'] = $ftv_params['quandId'];\n $condition['startdate'] = $ftv_params['startdate'];\n $condition['enddate'] = $ftv_params['enddate'];\n $condition['dayrange'] = $ftv_params['dayrange'];\n }\n\n $requestsdetail=$ftvrequest_obj->getAllChaineRequestsDetails($sWhere, $sOrder, $sLimit, $condition);\n //contains to modify\n\n $contains_array = array(1=>\"Unes tournantes\", 2=>\"Voir et Revoir\", 3=>\"Les &eacute;missions\", 4=>\"A d&eacute;couvrir\",5=>\"Les jeux\",\n 6=>\"Une\", 7=>\"Top 3\", 8=>\"Forums\", 9=>\"PAGE VIDEOS\", 10=>\"PAGES DOCUMENTAIRES\", 11=>\"PAGES FRANCE 5 & VOUS\", 12=>\"PAGES INFOS\");\n $duraiton_array = array(\"h\"=>\"Dans l'heure\", \"d\"=>\"Dans la journ&eacute;e\",\"nd\"=>\"Le lendemain\", \"w\"=>\"Dans la semaine\",\"nw\"=>\"La semaine prochaine\");\n $this->_view->contains_array = $contains_array;\n $this->_view->quands_array = $duraiton_array;\n $broadcast_array = array(\"1\"=>'France 2', \"2\"=>'France 3', \"3\"=>'France 4',\"4\"=>'France 5',\"5\"=>'France &Ocirc;' ,\"6\"=>'France TV');\n $demand_array = array(\"1\"=>'Int&eacute;gration', \"2\"=>'Modification demand&eacute;e par FTV', \"3\"=>'Correction erreur EP', \"4\"=>'Retours');\n $this->_view->broadcast_array = $broadcast_array;\n $this->_view->demand_array = $demand_array;\n // print_r($requestsdetail); exit;\n if($requestsdetail != 'NO')\n {\n $gtdays = '';$gthours = ''; $gtminutes = '';$gtdiff='';\n foreach ($requestsdetail as $key => $value)\n {\n\n $inpause = $ftvpausetime_obj->inPause($requestsdetail[$key]['identifier']);\n $requestsdetail[$key]['inpause'] = $inpause;\n\n $durationvalue = $duraiton_array[$requestsdetail[$key]['duration']];\n $requestsdetail[$key]['duration'] = $durationvalue;\n $requestsdetail[$key]['demand'] = $demand_array[$requestsdetail[$key]['demand']];\n /////getting modify contains display format///\n $contains = explode(\",\",$requestsdetail[$key]['modify_contains']);\n $finalcontains = array();\n foreach($contains as $code1 => $abb1)\n {\n $finalcontains[$code1] = $contains_array[$abb1];\n }\n $containvalue = implode(\" / \",$finalcontains);\n $requestsdetail[$key]['modify_contains'] = $containvalue;\n ////getting modify broadcast display format//\n $braodcast = explode(\",\",$requestsdetail[$key]['modify_broadcast']);\n $finalbroadcast = array();\n foreach($braodcast as $broadkey => $broadval)\n {\n $finalbroadcast[$broadkey] = $broadcast_array[$broadval];\n }\n $broadvalue = implode(\" / \",$finalbroadcast);\n $requestsdetail[$key]['modify_broadcast'] = $broadvalue;\n\n ////gettting recent comments ny BO user ////\n $commentDetails=$ftvcomments_obj->getRecentCommentsByBoUser($requestsdetail[$key]['identifier']);\n if($commentDetails != 'NO')\n $requestsdetail[$key]['comments'] = $commentDetails[0]['comments'];\n else\n $requestsdetail[$key]['comments'] = \"NILL\";\n ////gettting recent document BO user ////\n $documentDetails=$ftvdocuments_obj->getRecentDocument($requestsdetail[$key]['identifier']);\n if($documentDetails != 'NO')\n $requestsdetail[$key]['recent_document'] = $documentDetails[0]['document'];\n else\n $requestsdetail[$key]['recent_document'] = \"NILL\";\n //////color differentiation//////\n $requestsdetail[$key]['created_at'];\n $t=date('d-m-Y H:i', strtotime($requestsdetail[$key]['created_at']));\n $dayandtime = explode(\"-\", date(\"N-G-i\",strtotime($t)));//echo $requestsdetail[$key]['request_object'];print_r($dayandtime);\n $day = $dayandtime[0];\n $hour = $dayandtime[1];\n $minute = $dayandtime[2];\n $reddays = array(1,2,3,4); ///monday to thursday\n $bluedays = array(5,6,7); //friday to sunday\n\n if($hour >= 19 || $hour < 9)\n {\n if(in_array($day, $reddays))\n $requestsdetail[$key]['dayrange']=\"red\";\n else\n $requestsdetail[$key]['dayrange']=\"green\";\n }\n $ptimes = $ftvpausetime_obj->getPauseDuration($requestsdetail[$key]['identifier']);\n $assigntime = $requestsdetail[$key]['assigned_at'];\n\n if(($requestsdetail[$key]['status'] == 'done' || $inpause == 'yes') && ($requestsdetail[$key]['assigned_at'] != null && $requestsdetail[$key]['assigned_to'] != null))\n {\n if($requestsdetail[$key]['assigned_at'] != NULL)\n {\n if($requestsdetail[$key]['status'] == \"closed\")\n $time1 = ($requestsdetail[$key]['cancelled_at']); /// created time\n elseif ($requestsdetail[$key]['status'] == \"done\")\n $time1 = ($requestsdetail[$key]['closed_at']); /// created time\n else{\n if($inpause == 'yes') {\n $time1 = ($requestsdetail[$key]['pause_at']);\n }else {\n $time1 = (date('Y-m-d H:i:s'));///curent time\n }\n }\n\n // $totaltime2 = strtotime($requestsdetail[$key]['assigned_at']);\n $pausedrequests = $ftvpausetime_obj->pausedRequest($requestsdetail[$key]['identifier']);\n if($pausedrequests == 'yes')\n {\n $time2 = $this->subDiffFromDate($requestsdetail[$key]['identifier'], $requestsdetail[$key]['assigned_at']);\n }else{\n $time2 = $requestsdetail[$key]['assigned_at'];\n }\n $totaldiff = strtotime($time1) - strtotime($time2);\n\n $timestamp = new DateTime($time1);\n $diff = $timestamp->diff(new DateTime($time2));\n $days = $diff->format('%d');\n $hours = $diff->format('%h');\n $minutes = $diff->format('%i');\n $seconds = $diff->format('%s');\n $gtdiff+=$totaldiff;\n $difference = '';\n\n if($days != '')\n $difference.= \"<span class='label label-info' >\".$days.\"J </span> \";\n if($hours != '')\n $difference.= \"<span class='label label-info' >\".$hours.\"H </span> \";\n if($minutes != '')\n $difference.= \"<span class='label label-info' >\".$minutes.\"M </span> \";\n if($seconds != '')\n $difference.= \"<span class='label label-info' >\".$seconds.\"S </span> \";\n\n $requestsdetail[$key]['time_spent'] = $difference;\n }\n else\n $requestsdetail[$key]['time_spent'] = \"-NA-\";\n }\n else\n $requestsdetail[$key]['time_spent'] = \"-NA-\";\n $pausedrequests = $ftvpausetime_obj->pausedRequest($requestsdetail[$key]['identifier']);\n if($pausedrequests == 'yes')\n {\n $requestsdetail[$key]['assigned_at'] = $this->subDiffFromDate($requestsdetail[$key]['identifier'], $requestsdetail[$key]['assigned_at']);\n\n }else{\n $requestsdetail[$key]['assigned_at'] = $requestsdetail[$key]['assigned_at'];\n }\n ////subtracting 30 sec because adding 30 secs added by javascipt ///\n $minus30sec=new DateTime($requestsdetail[$key]['assigned_at']);\n $minus30sec->add(new DateInterval(\"PT35S\"));\n $requestsdetail[$key]['assigned_at'] = $minus30sec->format('Y-m-d H:i:s');\n }\n // print_r($ptimes);\n $d = floor($gtdiff/86400);\n $gtdays = ($d < 10 ? '0' : '').$d;\n\n $h = floor(($gtdiff-$d*86400)/3600);\n $gthours = ($h < 10 ? '0' : '').$h;\n\n $m = floor(($gtdiff-($d*86400+$h*3600))/60);\n $gtminutes = ($m < 10 ? '0' : '').$m;\n\n $gtdifference = '';\n if($gtdays != '')\n $gtdifference.= \"\".$gtdays.\"J \";\n if($gthours != '')\n $gtdifference.= \"\".$gthours.\"H \";\n if($gtminutes != '')\n $gtdifference.= \"\".$gtminutes.\"M \";\n $this->_view->globaltime = $gtdifference;\n }\n $rResultcount = count($requestsdetail);\n /////total count\n $sLimit = \"\";\n $countaos = $ftvrequest_obj->getAllChaineRequestsDetails($sWhere, $sOrder, $sLimit, $condition);\n // print_r($countaos);exit;\n $iTotal = count($countaos);\n\n $output = array(\n \"sEcho\" => intval($_GET['sEcho']),\n \"iTotalRecords\" => $iTotal,\n \"iTotalDisplayRecords\" => $iTotal,\n \"aaData\" => array()\n );\n $assguser_arr = array(141027195819796=>'Fanny',141027200051263=>'Djawed',130122131303109=>'Jgimenez',111017113015710=>'editor1',140655136475464=>'prashanth',110823103540627=>'Farid');\n $statrow_arr = array('pending'=>'En attente','done'=>'Trait&eacute;e','closed'=>'Annul&eacute;e');\n $count = 1;\n if($broadcast_sort_flag && $broadcast_sort === 'asc')//only if falg is set to true call this sorting function (only for broadcast array)\n usort($requestsdetail, $this->build_sorter_asc($to_sort));\n else if($broadcast_sort_flag && $broadcast_sort === 'desc')\n usort($requestsdetail, $this->build_sorter_desc($to_sort));\n //for($i = 0; $i<count($requestsdetail) ; $i++)\n // echo $requestsdetail[$i]['modify_broadcast'].\"<br />\";\n //exit;\n if($requestsdetail != 'NO')\n {\n for( $i=0 ; $i<$rResultcount; $i++)\n {\n $row = array();\n for ( $j=0 ; $j<count($aColumns) ; $j++ )\n {\n //if($j == 0)\n // $row[] = $count;\n //else\n {\n if($aColumns[$j] == 'first_name')\n $row[] = $requestsdetail[$i]['first_name'];\n elseif($aColumns[$j] == 'created_at')\n $row[] = date(\"Y-m-d\", strtotime($requestsdetail[$i]['created_at']));\n elseif($aColumns[$j] == 'request_object')\n $row[] = '<a data-target=\"#chaineeditrequest\" data-refresh=\"true\" data-toggle=\"modal\" href=\"/ftvchaine/duplicaterequest?request_id='.$requestsdetail[$i][\"identifier\"].'&edit=yes\" class=\"hint--bottom hint--info\" data-placement=\"right\" data-original-title=\"Object\" data-html=\"true\"\n data-hint=\"'.utf8_encode($requestsdetail[$i]['request_object']).'\">'.utf8_encode($requestsdetail[$i]['request_object']).'</a>';\n elseif($aColumns[$j] == 'download'){\n $download = '<a class=\"hint--bottom hint--info\" data-target=\"#fileupload\" data-refresh=\"true\" data-toggle=\"modal\" data-hint=\"upload file\" role=\"button\" href=\"/ftvchaine/uploadfiles?request_id='.$requestsdetail[$i][\"identifier\"].'&view=yes\">\n <i class=\"splashy-document_small_upload\"></i></a>';\n $checkRecentDocument = $ftvdocuments_obj->checkRecentDocument($requestsdetail[$i][\"identifier\"]);\n $serverpath = '/home/sites/site5/web/FO/ftv_documents/';\n if($requestsdetail[$i][\"recent_document\"] != '' && file_exists($serverpath.$checkRecentDocument[0]['document']))\n $download .= '<a class=\"hint--bottom hint--info\" data-hint=\"download latest file\" role=\"button\" href=\"/ftvchaine/downloadftv?request_id='.$requestsdetail[$i][\"identifier\"].'&filename='.$requestsdetail[$i][\"recent_document\"].'\">\n <i class=\"splashy-document_small_download\"></i></a>';\n $row[] = $download;\n }\n elseif($aColumns[$j] == 'duration')\n $row[] = $requestsdetail[$i]['duration'];\n elseif($aColumns[$j] == 'modify_contains')\n $row[] = $requestsdetail[$i]['modify_contains'];\n elseif($aColumns[$j] == 'modify_broadcast')\n $row[] = $requestsdetail[$i]['modify_broadcast'];\n elseif($aColumns[$j] == 'demand')\n $row[] = $requestsdetail[$i]['demand'];\n\n elseif($aColumns[$j] == 'assingnation') {\n $assrow = '<select class=\"bouserasgn span12\" data-placeholder=\"Assignation\" name=\"bouserasgn_' . $requestsdetail[$i]['identifier'] . '\" id=\"bouserasgn_' . $requestsdetail[$i]['identifier'] . '\" onchange=\"assignUser(' . $requestsdetail[$i]['identifier'] . ');\">\n <option value=\"\" >Assign </option>';\n foreach ($assguser_arr as $ky => $vl) {\n if ($requestsdetail[$i][\"assigned_to\"] == $ky)\n $assrow .= '<option value=\"'.$ky.'\" selected>'.$vl.'</option>';\n else\n $assrow .= '<option value=\"'.$ky.'\" >'.$vl.'</option>';\n }\n $assrow .= '</select>';\n $row[] = $assrow;\n }\n elseif($aColumns[$j] == 'status') {\n $statrow = '<select class=\"status\" style=\"width: 130px;\" data-placeholder=\"status\" name=\"status_{$requestsitem.identifier}\" id=\"status_' . $requestsdetail[$i]['identifier'] . '\" onchange=\"changeStatus(' . $requestsdetail[$i]['identifier'] . ');\">\n <option value=\"0\" >select</option>';\n foreach ($statrow_arr as $sky => $svl) {\n if ($requestsdetail[$i][\"status\"] == $sky)\n $statrow .= '<option value=\"'.$sky.'\" selected >'.$svl.'</option>';\n else\n $statrow .= '<option value=\"'.$sky.'\" >'.$svl.'</option>';\n }\n $statrow .= '</select>';\n $row[] = $statrow;\n }\n elseif($aColumns[$j] == 'comments') {\n $row[] = '<a class=\"hint--bottom hint--info\" data-hint=\"Add Comment\" data-target=\"#addcomment\" data-refresh=\"true\" data-toggle=\"modal\" role=\"button\" href=\"/ftvchaine/showcomments?request_id=' . $requestsdetail[$i]['identifier'] . '\">\n <i class=\"splashy-comments_reply\"></i></a>';\n if ($this->loginuserId == '110823103540627')\n $row[] .= '<a type=\"button\" class=\"hint--bottom hint--info\" data-hint=\"Delete request\" id=\"deleterequest\" name=\"deleterequest\" onClick=\"deleteRequest('.$requestsdetail[$i]['identifier'].');\"><i class=\"splashy-calendar_week_remove\"></i></a>';\n }elseif($aColumns[$j] == 'time_spent')\n {\n $rowdetail = '<input type=\"hidden\" id=\"time' . $requestsdetail[$i]['identifier'] . '\" value=\"' . $requestsdetail[$i]['assigned_to'] . '\"/>';\n if ($requestsdetail[$i]['assigned_to'] != '' && $requestsdetail[$i]['status'] != 'closed') {\n if ($requestsdetail[$i]['status'] == 'pending' && $requestsdetail[$i]['inpause'] == 'no') {\n $rowdetail.= '<div class=\"timer\" id=\"time_'.$requestsdetail[$i][\"identifier\"].'_'.$requestsdetail[$i][\"assigned_at\"].'\" onClick=\"extendTime('.$requestsdetail[$i][\"identifier\"].')\">\n <span class=\"label label-info\" id=\"days_'.$requestsdetail[$i]['identifier'].'\"></span>\n <span class=\"label label-info\" id=\"hours_'.$requestsdetail[$i]['identifier'].'\"></span>\n <span class=\"label label-info\" id=\"minutes_'.$requestsdetail[$i]['identifier'].'\"></span>\n <span class=\"label label-info\" id=\"seconds_'.$requestsdetail[$i]['identifier'].'\"></span>\n </div>\n <button class=\"btn btn-warning\" type=\"button\" id=\"pausetime' . $requestsdetail[$i]['identifier'] . '\" name=\"pausetime\" onClick=\"pauseTime(\\'pause\\',' . $requestsdetail[$i]['identifier'] . ');\" >Pause</button>';\n } elseif ($requestsdetail[$i]['status'] == 'pending' && $requestsdetail[$i]['inpause'] == 'yes') {\n $rowdetail.= '\"' . $requestsdetail[$i]['time_spent'] . '\n <button class=\"btn btn-warning\" type=\"button\" id=\"resumetime' . $requestsdetail[$i]['identifier'] . '\" name=\"resumetime\" onClick=\"pauseTime(\\'resume\\',' . $requestsdetail[$i]['identifier'] . ');\" >Resume</button>';\n } else\n $rowdetail.= '\"' . $requestsdetail[$i]['time_spent'] . '\"';\n if ($requestsdetail[$i]['status'] != 'closed') {\n $rowdetail.= '<a class=\"hint--bottom hint--waring\" data-hint=\"edit time\" data-toggle=\"modal\" data-target=\"#editassigntime\" href=\"/ftvchaine/editassigntime?requestId=' . $requestsdetail[$i]['identifier'] . '\"><i class=\"icon-time\"></i> </a>';\n }\n\n } else\n $rowdetail .= '-NA-';\n\n $row[] = $rowdetail;\n }\n else\n $row[] = $requestsdetail[$i][ $aColumns[$j] ];\n\n }\n }\n $output['aaData'][] = $row;\n $count++;\n }\n }\n // print_r($output);\n echo json_encode( $output );\n }\n }", "public function load_field(){\r\n $this->layout=\"ajax\";\r\n $module=$_POST['module'];\r\n $this->loadModel($module);\r\n $field_names= Set::extract('/COLUMNS/Field',$this->$module->query(\"DESCRIBE {$this->$module->useTable}\"));\r\n $field= array_combine($field_names, $field_names);\r\n $this->set(compact('field'));\r\n }", "function editEvent($req, &$t) {\n\n\t\t$t['picForm'] = $this->_loadPictureForm();\n\t}", "public function londontec_event(){\n\t \n\t\t$id = $this->uri->segment(3);\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/add_londontec_event';\n\t\t$mainData = array(\n\t\t\t'pagetitle' => 'Create londotec event',\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n \n\t}", "public function listdataAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('%');\n }", "public function LoadAction()\n {\n $em = $this->getDoctrine()->getManager();\n $events = $em->getRepository('ClassBundle:Events')->findAll();\n return $this->render('events/updatesAjax.html.twig', array(\n 'events' => $events,\n ));\n }", "public function reloadTableData(){\r\n\t\t$this->load->model('gs_admission/ajax_base_model', 'AB');\r\n\t \t$data[\"formlist\"] = $this->AB->list_of_admission_form();\r\n\t\t$user_id = $this->session->userdata(\"user_id\");\r\n\t\t$data[\"myttl\"] = $this->AB->getUserUploadedForm($user_id);\r\n\t\t$data[\"ttl\"] = $this->AB->getUserUploadedForm($user_id=NULL);\r\n\t\t$this->load->view('gs_admission/issuance/form_list',$data);\r\n\t\t}", "public function eventLoader(Request $request)\n {\n $invoiceId = $request->tempInv;\n $standard = $request->standard;\n $today = Carbon::now()->toDateString();\n\n \n\n $events = DB::table('events')\n ->whereNotExists(function ($query) use($invoiceId) {\n $query->select(DB::raw('*'))\n ->from('temp_invoices_custom_items')\n ->whereRaw('temp_invoices_custom_items.event_id = events.event_id AND temp_invoices_custom_items.invoice_id=?')->setBindings([$invoiceId]) ;\n })\n ->where('end_date','>=',$today) \n ->where('standard',$standard)\n ->where('branch',Auth::user()->branch)\n ->orderBy('start_date')\n ->get();\n ?>\n <select class=\"col-md-3 col-sm-3\" name=\"event_id\" id=\"event_id\" > <option value=\"0\">Select Event</option> \n <?php \n foreach($events AS $event) { ?>\n <option value=\"<?php echo $event->event_id; ?>\" ><?php echo $event->title; ?></option>\n <?php } ?> \n </select> \n <?php\n }", "public function index()\n {\n // $this->perfex_base->get_table_data('master', array('master' => true));die();\n if ($this->input->is_ajax_request()) {\n $this->perfex_base->get_table_data('master', array('master' => true));\n }\n $data['title']=\"Chủ sở hữu\";\n $this->load->view('admin/master/manage', $data);\n }", "public function load_insert_img_view(){\r\n $data;\r\n if(!empty($_POST['id'])){\r\n\r\n $result=$this->Events_Model->get_all($this->table,$_POST['id']);\r\n $this->event_info=$result->fetch_assoc();\r\n $data=$this->load->view('admin/event/admin_add_event',$this->event_info,TRUE);\r\n }\r\n\r\n else{\r\n $data=$this->load->view('admin/event/admin_add_event',\"\",TRUE);\r\n }\r\n\r\n echo json_encode(array(\"view\"=>$data));\r\n\r\n }", "public function index(){ \n \t$data['query1'] = $this->MBahagia->tampil_data();\n \t$data['query2'] = $this->MCamplong->tampil_data();\n \t$data['query3'] = $this->MPanglima->tampil_data();\n \t$data['query4'] = $this->MPKPRI->tampil_data();\n \t$data['query5'] = $this->MRahmat->tampil_data();\n\n \t\n \t$this->global['pageTitle'] = 'RichiSoft | Local Database';\n\t\t$this->loadViews(\"ViewTables/TableSlave\", $this->global, $data, NULL);\n\t}", "public function view_loader(){\n\n\t\tparent::view_loader();\n\t}", "public function viewNewEvents()\n {\n $this->load->model('M_Event_table');\n $this->load->model('M_Customer_table');\n $events = $this->M_Event_table->getNewEvents();\n $customers = $this->M_Customer_table->getAllCustomers();\n\n $returnData['newEventsMore']= $events;\n $returnData['customers'] = $customers;\n\n $this->load->view('admin/viewNewEvents',$returnData);\n }", "public function index()\n {\n $data = $this->data();\n return Response::view('admin.file', compact('data', $data));\n\n //dd($data);\n }", "public function danceAdmin(){\n $result = $this->adminModel->getAllDance();\n foreach ($result as $row){\n $data[] = array('event_id'=>$row->event_id,'event_name'=>$row->event_name,'event_date'=>$row->event_date,\n 'start_time'=>$row->start_time);\n }\n $this->view('admins/danceAdmin',$data);\n }", "public function index(){\n //echo form_open_multipart(\"request_controller/request_section_controller/insert_sec\", array(\"id\"=>\"form_input\" ,\"class\"=>\"form-horizontal form-label-left\")); die;\n\n $query[\"gen_sec\"] = $this->sec->gen_query();\n\n $query[\"data_table\"] = $this->sec->query_datatable();\n\n $this->display(\"request_view/request_section_view\",$query);\n }", "public function index(Request $request)\n {\n if ($request->wantsJson() || $request->ajax()) {\n \n $query = Event::query(); \n \n return DataTables::of($query)\n ->addColumn(\"gallery\", function ($record) {\n $link = route(\"events.gallery\", $record->id);\n return \"<a href='$link'>Gellery</a>\";\n })\n ->addColumn(\"actions\", function($record) {\n $edit_link = route(\"events.edit\", $record->id);\n $delete_link = route(\"events.destroy\", $record->id);\n $actions = \"\n <a href='$edit_link' class='badge bg-warning'>Edit</a>\n <a href='$delete_link' class='badge bg-danger'>Delete</a>\n \";\n return $actions;\n })\n ->rawColumns(['actions','gallery'])->make(true);\n } else {\n return view(\"admin.events.index\");\n } \n }", "public function initEvent() {\n \t\t$dateend = date_format(date_create(),'Y-m-d H:i:s');\n\t\t$datebegin = date_create();\n\t\tdate_sub($datebegin, date_interval_create_from_date_string('10 days'));\n\t\t$datebegin = date_format($datebegin, 'Y-m-d H:i:s');\n\t\t// get event logs from event_log table\n \t\t$EventLogs = DB::table('event_log')->join('client','client.client_id','=','event_log.client_id')->join('mandant','client.mandant_id','=','mandant.mandant_id')->select('log_nr', 'message_id','mandant.mandant_firmname','useragent','client.client_id','client_ip','action',DB::raw('date_format(insert_date, \\'%d.%m.%Y %H:%i:%s\\') as insert_date'))->where('mandant.user_id','1')->where('insert_date','>',$datebegin)->where('insert_date','<',$dateend)->orderby('log_nr','ASC')->get();\n \t\treturn View::make('eventlog/eventlog_gui')->with('page',2)->with('title','Event Logs')->with('events',$EventLogs);\n \t}", "public function index() {\n\t\n\t\tif(!($this->input->server('REQUEST_METHOD') === 'POST')){\n\t\n\t\t\t/************************/\n\t\t\t/* Load File View */\n\t\t\t/************************/\n\t\t\t$data['view'] = 'admin/tables';\n\t\t\t$data['tables'] = $this->db->list_tables();\n\t\t\t$data['header_info'] = \"<h2>Modify Database Tables</h2>\";\n\t\t\t$this->load->view('admin/init', $data);\n\t\t}else{\n\t\t\n\t\t\tredirect('admin/tables/'.$this->input->post(\"table\"));\n\t\t\t/*\n\t\t\t$crud = new grocery_CRUD();\n\t\t\t\n\t\t\t$crud->set_theme('flexigrid');\n\t\t\t$crud->set_table($this->input->post(\"table\"));\n\t\t\t$crud->set_subject($this->input->post(\"table\"));\n\t\t\t\n\t\t\t$output = $crud->render();\n\t\t\t\n\t\t\t$this->load->view('admin/table', $output);*/\n\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "function admin_index() {\n\t\t$this->Event->recursive = 0;\n\t\t$this->set('events',$this->paginate());\n\t}", "function viewEvent($req, &$t) {\n\n\t}", "function beneficiariesView_views_data()\n{\n $data = array();\n\n $data['aj_registration']['table']['group'] = t('Registration');\n\n $data['aj_registration']['table']['base'] = array(\n 'title' => t('Registration'),\n 'help' => t('This is data from the aj_registration table.'),\n );\n\n $data['aj_registration']['table']['join'] = array(\n 'eck_provider' => array(\n 'left_field' => 'id',\n 'field' => 'provider_id',\n ),\n );\n\n\n// The ID field\n$data['aj_registration']['uuid'] = array(\n\t'group' => t('Registration'),\n 'title' => t('UUID'),\n 'help' => t('The beneficiary UUID.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n// The nombre field\n$data['aj_registration']['nombre'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Nombre'),\n 'help' => t('The beneficiary name.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t 'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n// The apellido field\n$data['aj_registration']['apellido'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Apellido'),\n 'help' => t('The beneficiary surname.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n\n// The apodo field\n$data['aj_registration']['apodo'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Apodo'),\n 'help' => t('The beneficiary nickname.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n// The Estecolateralparticipante field\n$data['aj_registration']['Estecolateralparticipante'] = array(\n\t'group' => t('Registration'),\n 'title' => t('¿Indirecto?'),\n 'help' => t('The beneficiary type.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n\n// The DOB field\n$data['aj_registration']['DOB'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Fecha de Nacimiento'),\n 'help' => t('The beneficiary date of birth.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_date',\n ),\n);\n\n\n// The Fecha field\n$data['aj_registration']['Fecha'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Fecha de Registro'),\n 'help' => t('The Beneficiary date of registration.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_date',\n ),\n);\n\n\n\n// The provider_name field\n$data['aj_registration']['provider_name'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Organización name'),\n 'help' => t('The organización name.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n\n// The provider_id field\n$data['aj_registration']['provider_id'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Esto es provider_id'),\n 'help' => t('The organización ID.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_numeric',\n ),\n 'relationship' => array(\n 'base' => 'eck_provider',\n 'base field' => 'id',\n \t 'field' => 'provider_id',\n 'handler' => 'views_handler_relationship',\n 'label' => t('aj_registration retlation'),\n \t 'help' => t('This is the relationship with aj_registration and eck_provider'),\n \t 'title' => t('aj_registration relationship'),\n ),\n 'argument' => array(\n 'handler' => 'views_handler_argument',\n 'numeric' => TRUE,\n ),\n);\n return $data;\n}", "function viewEvent(&$req, &$t) {\n\t\t$id = $req->cleanInt('id');\n\t\t$area = new Cgn_DataItem('cgn_site_area');\n\t\tif ($id > 0 ) {\n\t\t\t$area->load($id);\n\t\t}\n\t\t$t['area'] = $area;\n\t\t$_SESSION['_debug_frontend'] = true;\n\t\t$_SESSION['_debug_template'] = $area->site_template;\n\n\t\t$values = array();\n\t\t$values['id'] = $id;\n\t\t$values['template'] = $area->site_template;\n\t\t$t['form'] = $this->_loadAreaStyleForm($values);\n\t}", "public function load_extranotes_data(Request $request,$enc_id)\n\t{\t\n\t\t$order_id = base64_decode($enc_id);\n\n\t\t$build_status_btn = '';\n\t\t$arr_data = [];\n\t\t$arr_search_column \t= $request->input('column_filter');\n\n\t\t$obj_request_data = $this->PrintingOrderExtraNotesModel->with('get_order_details')\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('order_id',$order_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->orderBy('created_at','DESC');\n\n\t\t// if(isset($arr_search_column['full_name']) && $arr_search_column['full_name']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('full_name', 'LIKE',\"%\".$arr_search_column['full_name'].\"%\");\n\t\t// }\n\n\t\n\t\t$obj_request_data = $obj_request_data->get();\n\n\t\t$json_result \t= DataTables::of($obj_request_data)->make(true);\n\t\t$build_result \t= $json_result->getData();\n\n\t\tif(isset($build_result->data) && sizeof($build_result->data)>0)\n\t\t{\n\t\t\tforeach ($build_result->data as $key => $data) \n\t\t\t{\n\n\t\t\t\t// $view_link_url = $this->module_url_path.'/view/'.base64_encode($data->id);\n\t\t\t\t$view_link_url = \"javascript:void(0)\";\n\t\t\t\t\n\t\t\t\t$arr_roles = $arr_product_options = [];\n\n\t\t\t\t$id \t \t\t\t= isset($data->id)? base64_encode($data->id):'';\n\t\t\t\t$notes \t\t\t\t\t= isset($data->notes)? $data->notes :'-';\n\t\t\t\t$added_by \t\t\t\t= isset($data->added_by)? $data->added_by :'';\n\t\t\t\t$created_at \t\t\t\t= isset($data->created_at)? get_formated_date($data->created_at) :'';\n\n\t\t\t\t$i = $key+1;\n\t\t\t\t$build_result->data[$key]->id \t\t = $id;\n\t\t\t\t$build_result->data[$key]->sr_no \t\t= $i;\n\t\t\t\t$build_result->data[$key]->notes \t\t= $notes;\n\t\t\t\t$build_result->data[$key]->added_by \t\t= $added_by;\n\t\t\t\t$build_result->data[$key]->created_at = $created_at;\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\treturn response()->json($build_result);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn response()->json($build_result);\n\t\t}\n\t}", "public function loaddataAction(){\n\t\t$this->_helper->viewRenderer->setNoRender();\n\t\t$conf = new GroupDocsComparison_GroupDocs();\n\t\t$this->_helper->json(array('configs' =>\n\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '5',\n\t\t\t\t\t\t'cid' => json_decode($conf->getConfig('data'), true)['cid'],\n\t\t\t\t\t\t'pkey' => json_decode($conf->getConfig('data'), true)['pkey'],\n\t\t\t\t\t\t'baseurl' => json_decode($conf->getConfig('data'), true)['baseurl'],\n\t\t\t\t\t\t'firstfileid' => json_decode($conf->getConfig('data'), true)['firstfileid'],\n\t\t\t\t\t\t'secondfileid' => json_decode($conf->getConfig('data'), true)['secondfileid'],\n\t\t\t\t\t\t'resfileid' => json_decode($conf->getConfig('data'), true)['resfileid'],\n\t\t\t\t\t\t'embedKey' => json_decode($conf->getConfig('data'), true)['embedKey'],\n\t\t\t\t\t\t'frameborder' => $conf->getConfig('frameborder'),\n\t\t\t\t\t\t'width' => $conf->getConfig('width'),\n\t\t\t\t\t\t'height' => $conf->getConfig('height')\n\t\t\t\t)\n\t\t));\n\t}", "public function retrieveEventData(Request $request){\n $locale = $request->getLocale();\n $eveId = $request->get('id');\n $em = $this->em;\n $currentUser = $this->user;\n /** @var Event */\n $event = $em->getRepository(Event::class)->find($eveId);\n $data['sid'] = $event->getStage()->getId();\n $data['if'] = $event->getStage()->getUserMasters()->exists(fn(int $i, UserMaster $m) => $m->getProperty() == 'followableStatus' && $m->getType() == UserMaster::ADDED && $m->getUser() == $this->user);\n $isExt = $event->getOrganization() != $this->org;\n if($isExt){\n $data['ext'] = 1;\n }\n $data['sname'] = $event->getStage()->getName();\n if($isExt){\n $data['type'] = $em->getRepository(EventType::class)->getDTrans($event->getEventType(),$locale,$event->getOrganization());\n $data['group'] = $em->getRepository(EventGroup::class)->getDTrans($event->getEventType()->getEventGroup(),$locale,$event->getOrganization());\n } else {\n $data['type'] = $event->getEventType()->getEName()->getId();\n $data['group'] = $event->getEventType()->getEventGroup()->getEventGroupName()->getId();\n }\n $data['odate'] = $event->getOnsetDate();\n $data['expResDate'] = $event->getExpResDate();\n $tz = new DateTimeZone('Europe/Paris');\n foreach($event->getDocuments() as $document){\n $docData = [];\n $docData['id'] = $document->getId();\n $docData['title'] = $document->getTitle();\n $docData['path'] = $document->getPath();\n $docData['type'] = $document->getType();\n $docData['mime'] = $document->getMime();\n $docData['size'] = $document->getSize();\n $docData['authors'] = $document->getDocumentAuthors()->count() > 0 ? $document->getDocumentAuthors()->map(fn(DocumentAuthor $da) => ['mainAuthor' => $da->isLeader(), 'fullname' => $da->getAuthor()->getFullName(), 'id' => $da->getAuthor()->getId()])->getValues()[0] : '';\n $docData['inserted'] = $document->getInserted()->setTimezone($tz);\n $docData['oid'] = $document->getOrganization()->getId();\n $docData['modified'] = $document->getModified() ? $document->getModified()->setTimezone($tz) : \"\";\n $data['documents'][] = $docData;\n }\n\n foreach($event->getParentComments() as $comment){\n $comData = [];\n $comData['id'] = $comment->getId();\n $comData['self'] = $comment->getAuthor() == $currentUser;\n $comData['author'] = $comment->getAuthor()->getFullName();\n $comData['content'] = $comment->getContent();\n $comData['inserted'] = $this->nicetime($comment->getInserted()->setTimezone($tz), $locale);\n $comData['modified'] = $comment->getModified() != null;\n $comData['oid'] = $comment->getOrganization()->getId();\n\n foreach($comment->getReplies() as $reply){\n $replyData = [];\n $replyData['id'] = $reply->getId();\n $replyData['self'] = $reply->getAuthor() == $currentUser;\n $replyData['author'] = $reply->getAuthor()->getFullName();\n $replyData['content'] = $reply->getContent();\n $replyData['inserted'] = $this->nicetime($reply->getInserted()->setTimezone($tz), $locale);\n $replyData['modified'] = $reply->getModified() != null;\n $replyData['oid'] = $reply->getOrganization()->getId();\n $comData['replies'][] = $replyData;\n }\n $data['comments'][] = $comData;\n }\n \n return new JsonResponse($data, 200);\n }", "protected function init_view_actions() {\n\t\t$this->view_actions = array(\n\t\t\t'list' => array(\n\t\t\t\t'show_entry' => true,\n\t\t\t\t'page_title' => __( 'All Tables', 'iggogrid' ),\n\t\t\t\t'admin_menu_title' => __( 'All Tables', 'iggogrid' ),\n\t\t\t\t'nav_tab_title' => __( 'All Tables', 'iggogrid' ),\n\t\t\t\t'required_cap' => 'iggogrid_list_tables',\n\t\t\t),\n\t\t\t'add' => array(\n\t\t\t\t'show_entry' => true,\n\t\t\t\t'page_title' => __( 'Add New Table', 'iggogrid' ),\n\t\t\t\t'admin_menu_title' => __( 'Add New Table', 'iggogrid' ),\n\t\t\t\t'nav_tab_title' => __( 'Add New', 'iggogrid' ),\n\t\t\t\t'required_cap' => 'iggogrid_add_tables',\n\t\t\t),\n\t\t\t'edit' => array(\n\t\t\t\t'show_entry' => false,\n\t\t\t\t'page_title' => __( 'Edit Table', 'iggogrid' ),\n\t\t\t\t'admin_menu_title' => '',\n\t\t\t\t'nav_tab_title' => '',\n\t\t\t\t'required_cap' => 'iggogrid_edit_tables',\n\t\t\t),\n// \t\t\t'options' => array(\n// \t\t\t\t'show_entry' => true,\n// \t\t\t\t'page_title' => __( 'Plugin Options', 'iggogrid' ),\n// \t\t\t\t'admin_menu_title' => __( 'Plugin Options', 'iggogrid' ),\n// \t\t\t\t'nav_tab_title' => __( 'Plugin Options', 'iggogrid' ),\n// \t\t\t\t'required_cap' => 'iggogrid_access_options_screen',\n// \t\t\t),\n// \t\t\t'about' => array(\n// \t\t\t\t'show_entry' => true,\n// \t\t\t\t'page_title' => __( 'About', 'iggogrid' ),\n// \t\t\t\t'admin_menu_title' => __( 'About IggoGrid', 'iggogrid' ),\n// \t\t\t\t'nav_tab_title' => __( 'About', 'iggogrid' ),\n// \t\t\t\t'required_cap' => 'iggogrid_access_about_screen',\n// \t\t\t),\n\t\t);\n\n\t\t/**\n\t\t * Filter the available TablePres Views/Actions and their parameters.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param array $view_actions The available Views/Actions and their parameters.\n\t\t */\n\t\t$this->view_actions = apply_filters( 'iggogrid_admin_view_actions', $this->view_actions );\n\t}", "function fileEdit(){\n\t\t$result = mysql_query(getFile($_GET['file']));\n\t\t$GLOBALS['adminObjectId'] = $_GET['file'];\n\t\tif($row = mysql_fetch_assoc($result)) {\n\t\t\tgetFileGlobals($row);\n\t\t\tfileForm(\"edit\");\n\t\t}\n\t}", "public function indexAction() {\r\n\t\t// set default filter (we use this to optimize the first call/rendering of the available 'sub-actions')\r\n\t\t$GLOBALS['BE_USER']->pushModuleData('tx_extracache_manager_startDateFilterForDbRecords', date('d.m.Y',strtotime(\"-10 day\")));\r\n\t\t$GLOBALS['BE_USER']->pushModuleData('tx_extracache_manager_stopDateFilterForDbRecords', NULL);\r\n\t\t$GLOBALS['BE_USER']->pushModuleData('tx_extracache_manager_searchPhraseForFiles', '---- SET FILTER! ----');\r\n\t\t$GLOBALS['BE_USER']->pushModuleData('tx_extracache_manager_searchPhraseForFolders', '---- SET FILTER! ----');\r\n\t\t$GLOBALS['BE_USER']->pushModuleData('tx_extracache_manager_searchPhraseForTablePages', '---- SET FILTER! ----');\r\n\t\t$GLOBALS['BE_USER']->pushModuleData('tx_extracache_manager_searchPhraseForTableStaticCache', '---- SET FILTER! ----');\r\n\r\n\t\ttry {\r\n\t\t\t$showDatabaseDetails = $this->getModuleData('tx_extracache_manager_showDatabaseDetails') === TRUE ? TRUE : FALSE;\r\n\t\t\t$showFilesDetails = $this->getModuleData('tx_extracache_manager_showFilesDetails') === TRUE ? TRUE : FALSE;\r\n\t\r\n\t\t\t$this->getView()->assign ( 'showDatabaseDetails', $showDatabaseDetails);\r\n\t\t\t$this->getView()->assign ( 'showFilesDetails', $showFilesDetails);\r\n\t\t\t$this->getView()->assign ( 'tableEventLog', $this->getCacheDatabaseEntryRepositoryForTableEventlog()->getFileTable () );\r\n\t\t\t$this->getView()->assign ( 'tableEventQueue', $this->getCacheDatabaseEntryRepositoryForTableEventqueue()->getFileTable () );\r\n\t\t\t$this->getView()->assign ( 'tablePages', $this->getCacheDatabaseEntryRepositoryForTablePages()->getFileTable () );\r\n\t\t\t$this->getView()->assign ( 'tableStaticCache', $this->getCacheDatabaseEntryRepositoryForTableStaticCache()->getFileTable () );\r\n\r\n\t\t\tif($showDatabaseDetails) {\r\n\t\t\t\t$this->getView()->assign ( 'countDatbaseEntrysForTableEventlog', $this->getCacheDatabaseEntryRepositoryForTableEventlog()->countAll () );\r\n\t\t\t\t$this->getView()->assign ( 'countDatbaseEntrysForTableEventqueue', $this->getCacheDatabaseEntryRepositoryForTableEventqueue()->countAll () );\r\n\t\t\t\t$this->getView()->assign ( 'countDatbaseEntrysForTablePages', $this->getCacheDatabaseEntryRepositoryForTablePages()->count ( 'tx_extracache_cleanerstrategies!=\\'\\' OR tx_extracache_events!=\\'\\'' ) );\r\n\t\t\t\t$this->getView()->assign ( 'countDatbaseEntrysForTableStaticCache', $this->getCacheDatabaseEntryRepositoryForTableStaticCache()->countAll () );\r\n\t\t\t}\r\n\t\t\tif($showFilesDetails) {\r\n\t\t\t\t$this->getView()->assign ( 'countFiles', $this->getCacheFileRepository()->countAll () );\r\n\t\t\t}\r\n\r\n\t\t\treturn $this->getView()->render ( 'index' );\r\n\t\t} catch (Exception $e) {\r\n\t\t\treturn $this->showErrorMessage($e);\r\n\t\t}\t\r\n\t}", "public function loadData()\n {\n $this->sendApiCall(self::ACTION_RETRIEVE, $this->getCreateUrl());\n }", "public function actionData()\n {\n// \n// $connector->configure(new Grid(), \"event_id\", \"start_date, end_date, event_name\");\n// $connector->render();\n\n return new Grid();\n }", "public function loadDataAction()\n {\n $contentService = Dm_Session::GetServiceFactory()->getContentService();\n\n $filter = new Service_Api_Filter_Content();\n\n $filter->id = $this->_getParam('id');\n $filter->mimeType = $this->_getParam('mimeType');\n $filter->limit = $this->_getParam('limit');\n $filter->offset = $this->_getParam('offset');\n $filter->search = $this->_getParam('search');\n $filter->sources = $this->_getParam('sources');\n $filter->format = $this->_getParam('dim');\n $filter->properties = $this->_getParam('properties');\n $contents = $contentService->contentsRead($filter);\n $this->view->data = $contents;\n }", "public function browse_files_page(){\r\n\t\tglobal $wpdb;\r\n\r\n\r\n\t\t$files_table = $this->files_table;\r\n\r\n\t\tif(isset($_GET['action']) && $_GET['action'] == 'edit'){\r\n\t\t\t$nonce = esc_attr( $_REQUEST['_editnonce'] );\r\n\t\t \tif ( ! wp_verify_nonce( $nonce, 'edit_file' )) {\r\n\t\t \tdie( 'Error' );\r\n\t\t \t// echo $_GET['action'];\r\n\t\t }else{\r\n\t \t\t$data = $this->MD_Model->get_file($_GET['id']);\r\n\t \t\t$slug = get_post_field( 'post_name', $_GET['post'] );\r\n\r\n\t \t\tif(isset($_POST['submit'])){\r\n\t \t\t\t$data = $this->edit_file();\r\n\t \t\t}\r\n\r\n\t \t\t$dl_path = wp_upload_dir()['basedir'].'/downloads/reports/'.$slug.'/'.$data['filename']; \r\n\t\t $dl_path = base64_encode($dl_path);\r\n\r\n\t\t \tinclude($this->admin_url . 'view/market-reports-edit-file.php');\r\n\t\t }\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tinclude($this->admin_url . 'view/market-reports-browse-files.php');\t\r\n\t\t}\r\n\r\n\t\t\r\n\t}", "public function views_data() {\n $data = parent::views_data();\n //dsm($data);\n $data['tincan_statement']['stored'] = array(\n 'title' => t('Stored'),\n 'help' => t('Stored date value, the date the statement was stored'),\n 'field' => array(\n 'handler' => 'tincan_lrs_handler_field_datetime',\n 'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'tincan_lrs_handler_sort_date',\n ),\n 'filter' => array(\n 'handler' => 'tincan_lrs_handler_filter_datetime',\n ),\n 'argument' => array(\n 'handler' => 'views_handler_argument_tincanlrs_fulldate',\n ),\n );\n $data['tincan_statement']['timestamp'] = array(\n 'title' => t('Timestamp'),\n 'help' => t('Timestamp of the statement'),\n 'field' => array(\n 'handler' => 'tincan_lrs_handler_field_datetime',\n 'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'tincan_lrs_handler_sort_date',\n ),\n 'filter' => array(\n 'handler' => 'tincan_lrs_handler_filter_datetime',\n ),\n 'argument' => array(\n 'handler' => 'views_handler_argument_tincanlrs_fulldate',\n ),\n );\n return $data;\n }", "public function admin_view(){\n echo Modules::run('template/load_admin', 'View Users', $this->load->view('users/users_view', '', TRUE),'','',array('themes/admin/vendor/datatable/jquery.dataTables.min.js', 'themes/admin/vendor/datatable/dataTables.bootstrap.js'));\n }", "public function loadForView();", "public function load()\n\t{\n\t\t$this->list_table->load();\n\t}", "function fileview($status)\n{\n\t/*\n\tbring in global variables ($q is the appiontment id, $sid is the id of the student\n\t$hint is the output variable that has already been created by the calling page, the file upload will be appended\n\tto that variable\n\t*/\n\tglobal $q,$hint,$sid;\n\t//set part1 to be blank\n\t$part1=\"\";\n\t//set part 2 to be blank\n\t$part2=\"\";\n\t\n\t//if the appointment is still open, create the form for uploading files and attach it to $hint\n\tif ($status==\"open\")\n\t{\n\t\t$hint=$hint.'\n\t\t\t<p >File Upload:</p>\n\t\t\t<form action=\"add_file.php\" method=\"post\" enctype=\"multipart/form-data\">\n\t\t\t<input type=\"file\" name=\"uploaded_file\"><br>\n\t\t\t<input type=\"submit\" value=\"Upload file\">\n\t\t\t<input type=\"hidden\" name=\"apptid\" id=\"apptid\" value=\"'.$q.'\"/>\n\t\t\t<input type=\"hidden\" name=\"studentid\" id=\"studentid\" value=\"'.$sid.'\"/>\n\t\t\t</form>\n\t\t\t<br/><br/>';\n\t}\n\t//create title for uploaded files and attach to $hint\n\t$hint=$hint.'<p><u>Uploaded Files:</u><br/>';\n\t// Query for a list of all existing files and format the date\n\t$sql = \"select *,Date_FORMAT(created,'%Y-%d-%m %h:%m %p') as created from file where apptid = \".$q;\n\t//run the query\n\t$result = @mysql_query($sql);\n\t// Check if it was successfull\n\tif (@mysql_num_rows($result) !=0) \n\t{//open php rows if\n \t\t// Print the top of a table\n $part1= '<table>\n <tr>\n\t\t\t\t\t<td></td>\n <td><b>Name</b></td>\n <td><b>Size (bytes)</b></td>\n <td><b>Created</b></td>\n <td><b>&nbsp;</b></td>\n </tr>';\n \n\t\twhile ($row = @mysql_fetch_assoc($result))\n\t\t{//open php while\n\t\t\n\t\t\t//pick icon\n\t\t\t//set $mime to be the mimetype of the file in the db\n\t\t\t$mime=$row['mime'];\n\t\t\t//check to see if the uploaded files matches the description of the known file types\n\t\t\t$position1 = substr_count($mime, 'word');\n\t\t\t$position2= substr_count($mime, 'text');\n\t\t\t$position3 = substr_count($mime, 'pdf');\n\t\t\t$position4 = substr_count($mime, 'presentation');\n\t\t\t$position5 = substr_count($mime, 'spre');\n\t\t\tif ($position1 != 0)\n\t\t\t{\n\t\t\t\t$iconLocation = \"./icons/doc.bmp\";\n\t\t\t\t$doctype = \"Word Document\";\n\t\t\t}\n\t\t\telse\n\t\t\tif ($position2 != 0)\n\t\t\t{\n\t\t\t\t$iconLocation = \"./icons/text.bmp\";\n\t\t\t\t$doctype = \"Text Document\";\n\t\t\t}\n\t\t\telse\n\t\t\tif ($position3 != 0)\n\t\t\t{\n\t\t\t\t$iconLocation = \"./icons/pdf.bmp\";\n\t\t\t\t$doctype = \"PDF\";\n\t\t\t}\n\t\t\telse\n\t\t\tif ($position4 != 0)\n\t\t\t{\n\t\t\t\t$iconLocation = \"./icons/ppt.bmp\";\n\t\t\t\t$doctype = \"PowerPoint Document\";\n\t\t\t}\n\t\t\telse\n\t\t\tif ($position5 != 0)\n\t\t\t{\n\t\t\t\t$iconLocation = \"./icons/xls.bmp\";\n\t\t\t\t$doctype = \"Excel Document\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$iconLocation = \"./icons/file.bmp\";\n\t\t\t\t$doctype = \"Document\";\n\t\t\t}\n\t\t\t//once icon is determined, create the link and output file info in the table, do for each file found during loop\n\t\t\t$part2=$part2. \"\n <tr>\n\t\t\t\t\t<td align='right'><a href='get_file.php?id={$row['id']}'><img src='\".$iconLocation.\"' title='\".$doctype.\"' width='25' height='25' /></a></td>\n <td align='left'>{$row['name']}</td>\n <td>{$row['size']}</td>\n <td>{$row['created']}</td>\n <td><a href='get_file.php?id={$row['id']}'>Download</a></td>\n\t\t\t\t\t\";\n\t\t\tif($status == \"open\")\n\t\t\t{\n\t\t\t\t//if the appointment is still open, give link for deleting file, no file deleting after appointment is closed\n\t\t\t\t$part2=$part2.\"<td><a href='delete_file.php?id={$row['id']}&student=\".$sid.\"'>Delete</a></td>\";\n\t\t\t}\n $part2=$part2.\"</tr>\";\n\t\t}//close php while\n\t\t// Close table\n $part3='</table>';\n\t\t//add all parts to $hint\n\t\t$hint=$hint.$part1.$part2.$part3;\n\t}//close php rows if\n\t//if no files have been uploaded\n\telse\n\t{\t\n\t\t$hint=$hint.\"No uploaded files found for appointment number \".$q;\n\t}\n\t\n}", "public function dataAction() {\n parent::dataAction();\n }", "function onView () {\n\n switch (parent::getAction()) {\n \n case \"edit\":\n $this->printEditView();\n break;\n default:\n $userId = $this->getModeUserId();\n $user = UsersModel::getUser($userId);\n if (RolesModel::hasModuleRole($userId,\"user.files.owner\")) {\n if (empty($user->directoryid)) {\n $user->directoryid = UsersModel::setupUserDirectory($userId);\n }\n parent::onView($user->directoryid);\n }\n }\n }", "function import_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->import_data( $sync_tables );\n\t\t$this->db_tools->echo_import_data();\n\t}", "public function read_event_record()\n\t{\n\t\t$data['title'] = $this->Xin_model->site_title();\n\t\t$event_id = $this->input->get('event_id');\n\t\t$result = $this->Events_model->read_event_information($event_id);\n\t\t\n\t\t$data = array(\n\t\t\t\t'event_id' => $result[0]->event_id,\n\t\t\t\t'employee_id' => $result[0]->employee_id,\n\t\t\t\t'company_id' => $result[0]->company_id,\n\t\t\t\t'event_title' => $result[0]->event_title,\n\t\t\t\t'event_date' => $result[0]->event_date,\n\t\t\t\t'event_time' => $result[0]->event_time,\n\t\t\t\t'event_note' => $result[0]->event_note,\n\t\t\t\t'event_color' => $result[0]->event_color,\n\t\t\t\t'all_employees' => $this->Xin_model->all_employees(),\n\t\t\t\t'get_all_companies' => $this->Xin_model->get_companies()\n\t\t\t\t);\n\t\t$session = $this->session->userdata('username');\n\t\tif(!empty($session)){ \n\t\t\t$this->load->view('admin/events/dialog_events', $data);\n\t\t} else {\n\t\t\tredirect('admin/');\n\t\t}\n\t}", "public function admin_table_views($views)\n {\n }", "public function table()\n\t{\n\t\t$sql = '\n\t\t\tselect \n\t\t\t\tid, \n\t\t\t\tname, \n\t\t\t\tenable \n\t\t\tfrom \n\t\t\t\tfile \n\t\t\twhere \n\t\t\t\tuser = ?';\n\n\t\t$results = DB::select($sql, [Auth::id()]);\n\n\t\treturn Datatable::collection(new Collection($results))\n\t\t\t->showColumns('name')\n\t\t\t->addColumn('enable', function($model) \n\t\t\t{\n\t\t\t\treturn '<a href=\"'.url(\"/file/edit&ID=\".$model->id.\"&EN=\".$model->enable).'\">'.$model->enable.'</a>';\n\t\t\t})\n\t\t\t->addColumn('remove', function($model) \n\t\t\t{\n\t\t\t\treturn '<a href=\"'.url(\"/file/delete&ID=\".$model->id).'\"><i class=\"fa fa-times\"></i></a>';\n\t\t\t})\n ->searchColumns('name')\n ->orderColumns('enable', 'name')\n ->make();\n\t}", "public function admin_index() {\r\n\t\t$this->data = $this->{$this->modelClass}->find('all');\r\n }", "public function taximportpopup(Request $request) {\r\r\r\n\t\t$getOldDbDetails = Staff::fnOldDbDetails();\r\r\r\n\t\treturn view('Tax.taximportpopup',['getOldDbDetails'=> $getOldDbDetails,\r\r\r\n\t\t\t\t\t\t\t\t\t\t'request' => $request]);\r\r\r\n\t}", "public function xuploadedfiles() {\n\t\t\n\t\t/* Load Model */\n\t\t$files = $this->getModel ( 'file' );\n\t\t\n\t\t/* Get all rows */\n\t\t$files->getAll ( $this->_getFormId () );\n\t\t\n\t\t/* set the view file (optional) */\n\t\t$this->setView ( 'uploadedfiles' );\n\t\t\n\t\t/* set last view into session */\n\t\t$this->session->returnto ( $this->getView () );\n\t}", "public function browseAction()\n {\n $table = $this->_helper->db->getTable();\n $select = $table->getSelect();\n $select->where('job_id IS NULL');\n $this->view->batch_upload_mapping_sets = $table->fetchObjects($select);\n }", "abstract public function getDataForViewFile(FileData $fileData);", "public function load_orderstatushistory_data(Request $request,$enc_id)\n\t{\t\n\t\t$order_id = base64_decode($enc_id);\n\n\t\t$build_status_btn = '';\n\t\t$arr_data = [];\n\t\t$arr_search_column \t= $request->input('column_filter');\n\n\t\t$obj_request_data = $this->PrintingOrderStatusHistoryModel->with('get_order_details')\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('order_id',$order_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->orderBy('created_at','DESC');\n\n\t\t// if(isset($arr_search_column['full_name']) && $arr_search_column['full_name']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('full_name', 'LIKE',\"%\".$arr_search_column['full_name'].\"%\");\n\t\t// }\n\n\t\n\t\t$obj_request_data = $obj_request_data->get();\n\n\t\t$json_result \t= DataTables::of($obj_request_data)->make(true);\n\t\t$build_result \t= $json_result->getData();\n\n\t\tif(isset($build_result->data) && sizeof($build_result->data)>0)\n\t\t{\n\t\t\tforeach ($build_result->data as $key => $data) \n\t\t\t{\n\n\t\t\t\t// $view_link_url = $this->module_url_path.'/view/'.base64_encode($data->id);\n\t\t\t\t$view_link_url = \"javascript:void(0)\";\n\t\t\t\t\n\t\t\t\t$arr_roles = $arr_product_options = [];\n\n\t\t\t\t$id \t \t\t\t= isset($data->id)? base64_encode($data->id):'';\n\t\t\t\t$old_status \t\t\t= isset($data->old_status)? ucfirst(str_replace(\"_\",\" \",($data->old_status))) :'-';\n\t\t\t\t$new_status \t\t\t= isset($data->new_status)? ucfirst(str_replace(\"_\",\" \",($data->new_status))):'-';\n\t\t\t\t$done_by \t\t\t\t= isset($data->change_by)? $data->change_by :'';\n\t\t\t\t$name \t\t\t\t\t= isset($data->name)? $data->name :'';\n\t\t\t\t$created_at \t\t\t= isset($data->created_at)? get_formated_date($data->created_at) :'';\n\n\t\t\t\t$i = $key+1;\n\t\t\t\t$build_result->data[$key]->id \t\t = $id;\n\t\t\t\t$build_result->data[$key]->sr_no \t\t= $i;\n\t\t\t\t$build_result->data[$key]->old_status \t= $old_status;\n\t\t\t\t$build_result->data[$key]->new_status \t= $new_status;\n\t\t\t\t$build_result->data[$key]->done_by \t= $done_by;\n\t\t\t\t$build_result->data[$key]->name \t\t= $name;\n\t\t\t\t$build_result->data[$key]->created_at = $created_at;\n\t\t\t\t\n\t\t\t}\n\n\t\t\treturn response()->json($build_result);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn response()->json($build_result);\n\t\t}\n\t}", "private function _loadDataToTemporaryTable(){\n\n }", "function get_time_table_data()\n\t\t{\n\t\t$this->load->view('backend/parents/get_time_table_data', $_POST['student_name'],$_POST['month'],$_POST['week']);\t\t\t\t\t\t\t }", "public function listInscriptionFiles(){\n $req = $this->db->query('SELECT file_url, title_file FROM admin_files');\n $req->setFetchMode(\\PDO::FETCH_CLASS | \\PDO::FETCH_PROPS_LATE, \n 'taekwondo\\model\\FileAdmin');\n return $req;\n }", "function events_view($connect, $date, $my_username, $flag) {\n\t$read_query = \"SELECT `user_id` FROM `users` WHERE `user_nickname`='\".$my_username.\"'\";\n\t$result = mysqli_query($connect, $read_query);\n\tmysqli_num_rows($result);\n\t$row_id = mysqli_fetch_assoc($result);\n\t$select_query_views = \"SELECT * FROM `events` WHERE `date_deleted` IS NULL AND `user_id`='\".$row_id['user_id'].\"'\";\n\t$result_views = mysqli_query($connect, $select_query_views);\n\tif (mysqli_num_rows($result_views) > 0) {\n\t\techo \"<table class='table input'>\n\t\t\t<th>Име на събитието</th>\n\t\t\t<th>Описание</th>\n\t\t\t<th>Флаг на събитието</th>\n\t\t\t<th>Дата на добавяне</th>\n\t\t\t<th colspan='2'>Функции</th>\";\n\t\twhile ($row = mysqli_fetch_assoc($result_views)) {\n\t\t\techo \"<tr>\n\t\t\t\t\t<td>\".$row['event_name'].\"</td>\n\t\t\t\t\t<td>\".$row['event_description'].\"</td>\n\t\t\t\t\t<td>\".$flag.\"</td>\n\t\t\t\t\t<td>\".$row['date_add'].\"</td>\n\t\t\t\t\t<td><a href='update.php?event_id=\".$row['event_id'].\"'>Промени</a></td><td><a href='delete.php?event_id=\".$row['event_id'].\"'>Изтрий</a></td>\n\t\t\t\t\t</tr>\";\n\t\t}\n\t\techo \"</table>\";\n\t}\n\telse {\n\t\techo \"<br><div class='input'>Нямате добавени събития в календара.</div>\";\n\t}\n}", "function MyEvents_Handle_Open()\n {\n $this->InscriptionsObj()->InitActions();\n\n echo\n $this->OpenEventsHtmlTable().\n \"\";\n }", "protected function getViewData() {\n\n }", "public function userfileAction() {\r\n\t\tif ((int)$this->_getParam('_parent') < 0) {\r\n \t\t$this->_detailedView('user_file');\r\n\t\t} else {\r\n\t\t\t$this->_component = $this->_components['user_file'];\r\n\t\t\t$this->detailedAction();\r\n\t\t}\r\n\t}", "public function loadroledataentryAction(){\n $roles=Doctrine_Query::create()\n\t ->select(\"r.ID, r.role\")\n\t ->from(\"Roles r\")\n\t ->where(\"r.ID=?\",Constants::DATAENTRY_INTERNO)\n \t ->execute(null,Doctrine::HYDRATE_ARRAY);\n $this->emitTableResult($roles);\n }", "public function listdataAsetAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('ASET');\n }", "public function data()\n\t{\n\t\t//$this->orderRepository->pushCriteria(new RequestCriteria($request));\n\t\t$orders = array();\n\t\tif(Sentinel::inRole('admin'))\n\t\t\t$orders = $this->orderRepository->all();\n\t\telseif (Sentinel::inRole('company')){\n\t\t\t$orders = Sentinel::getUser()->company->orders;\n\t\t}\n\n\t\treturn DataTables::of($orders)\n\t\t\t->editColumn('updated_at',function(Order $order) {\n\t\t\t\treturn $order->updated_at->diffForHumans();\n\t\t\t})\n\t\t\t->editColumn('company',function(Order $order) {\n\t\t\t\treturn $order->company->name;\n\t\t\t})\n\t\t\t->editColumn('candidate',function(Order $order) {\n\t\t\t\treturn $order->candidate->user->first_name.' '.$order->candidate->user->last_name;\n\t\t\t})\n\t\t\t->editColumn('email',function(Order $order) {\n\t\t\t\treturn $order->candidate->user->email;\n\t\t\t})\n\t\t\t->addColumn('actions',function($order) {\n\n\t\t\t\t$actions = '<a href='. route('admin.orders.show', $order->id) .'><i class=\"livicon\" data-name=\"edit\" data-size=\"22\" data-loop=\"true\" data-c=\"#428BCA\" data-hc=\"#428BCA\" title=\"edit order\"></i></a>\n\t <a href='. route('admin.orders.print', $order->id) .' target=\"_blank\"><i class=\"livicon\" data-name=\"download\" data-size=\"22\" data-loop=\"true\" data-c=\"#F89A14\" data-hc=\"#F89A14\" title=\"download order\"></i></a>\n\t <a href='. route('admin.orders.invoice', $order->id) .' target=\"_blank\"><i class=\"livicon\" data-name=\"money\" data-size=\"22\" data-loop=\"true\" data-c=\"#F89A14\" data-hc=\"#F89A14\" title=\"invoice\"></i></a>';\n\n\t\t\t\treturn $actions;\n\t\t\t})\n\t\t\t->rawColumns(['actions'])\n\t\t\t->make(true);\n\t}", "public function loadReportView()\n {\n //retrieve this month revenue data to generate the description\n $thisMonthRevenue = $this->main_model->retrieveRevenueThisMonth();\n\n //get the average revenue per month to generate the description\n $avgRevenue = $this->main_model->retrieveRevenueAverage();\n\n //to send those data to the view\n $data['thisMonthTotal'] = $thisMonthRevenue['thisMonthTotal'];\n $data['avgRevenue'] = $avgRevenue['avgRevenue'];\n\n\n //retrieve data needed for the bottom part\n $bottomData = $this->main_model-> totalAverageVisitors();\n\n //to send those data to the view\n $data['totalVisitors'] = $bottomData['totalVisitors'];\n $data['avgVisitors'] = $bottomData['avgVisitors'];\n\n \n $this->view(\"adminReportMod\", $data);\n }", "public function inputData(){\n $this->load->view('admin/header_view');\n $this->load->view('admin/user_inputData_view'); \n }", "protected function loadView()\n {\n }", "protected function loadView()\n {\n }", "public function index()\n {\n //sidebar\n $tree = session()->get('tree');\n //sidebar\n $events = DB::table('file_package')\n ->paginate(30);\n return view('system-mgmt/file-package/index', ['events' => $events]);\n }", "public function action_index()\n\t{\n\t\t$this->template = View::forge('template-admin');\n\n\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t//return Response::forge(View::forge('event/index',$data));\n\t\t$this->template->title = \"イベント一覧\";\n\t\t$this->template->content = View::forge('event/index', $data);\n\t}", "public function get_events()\n {\n $table_name = $this->input->get_post(\"table_name\");\n\n log_message(\"debug\", \"Posted table name {$table_name}\");\n\n $config = [\n 'base_url' => $this->config->base_url(\"welcome/get_events/\"),\n 'total_rows' => $this->Xform_model->count_all_records($table_name),\n 'uri_segment' => 4,\n 'per_page' => 100,\n ];\n\n $this->pagination->initialize($config);\n $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;\n\n $events = $this->Xform_model->get_geospatial_data($table_name, $this->pagination->per_page, $page);\n $links = $this->pagination->create_links();\n\n if ($this->input->is_ajax_request()) {\n $result = [\n 'status' => \"success\",\n \"events_count\" => $config['total_rows'],\n \"events\" => $events,\n \"links\" => $links\n ];\n $result = array_utf8_encode($result);\n echo json_encode($result);\n } else {\n show_error(\"Not Implement\", 501, \"Page not implemented\"); //page not implemented\n }\n }", "public function importAction()\n {\n $controller = $this->getRequest()->getControllerName();\n $importLoader = $this->loader->getImportLoader();\n $model = $this->getModel();\n\n $params = array();\n $params['defaultImportTranslator'] = $importLoader->getDefaultTranslator($controller);\n $params['formatBoxClass'] = 'browser table';\n $params['importer'] = $importLoader->getImporter($controller, $model);\n $params['model'] = $model;\n $params['tempDirectory'] = $importLoader->getTempDirectory();\n $params['importTranslators'] = $importLoader->getTranslators($controller);\n\n $this->addSnippets($this->importSnippets, $params);\n }", "protected function loadFormData()\n\t{\n\t}", "public function loadFilesAdmin()\r\n {\r\n $id = Input::get('ID');\r\n $project = Project::find($id);\r\n $files=[];\r\n if($project!=null){\r\n $files = $project->files;\r\n }\r\n return json_encode($files);\r\n }", "public function importAction()\n {\n $logger = OntoWiki::getInstance()->logger;\n $logger->debug('importAction');\n\n //initialisation of view parameter\n $this->view->placeholder('main.window.title')->set('Select mapping parameter'); \n $this->view->formEncoding = 'multipart/form-data';\n $this->view->formClass = 'simple-input input-justify-left';\n $this->view->formMethod = 'post';\n $this->view->formName = 'selection';\n $this->view->filename\t\t = htmlspecialchars($_SESSION['fname']);\n $this->view->restype \t\t = '';\n $this->view->baseuri\t\t = '';\n $this->view->header\t\t \t = '';\n $this->view->flinecount\t\t = htmlspecialchars($_SESSION['flinecount']);\n $this->view->fline\t\t\t = htmlspecialchars($_SESSION['fline']);\n $this->view->line\t\t \t = explode(';',$this->view->fline);\n\n //toolbar for import of data\n $toolbar = $this->_owApp->toolbar;\n $toolbar->appendButton(OntoWiki_Toolbar::SUBMIT, array('name' => 'Submit', 'id' => 'selection'))\n ->appendButton(OntoWiki_Toolbar::RESET, array('name' => 'Cancel', 'id' => 'selection'));\n $this->view->placeholder('main.window.toolbar')->set($toolbar);\n \n //handling of request\n if ($this->_request->isPost()) {\n $postData = $this->_request->getPost();\n \n if (!empty($postData)) { \n \n $baseuri = $postData['b_uri'];\n $this->view->baseuri = $baseuri;\n $restype = $postData['r_type'];\n $this->view->restype = $restype;\n $header = $postData['rad'];\n $this->view->header = $header;\n \n if (trim($restype) == '') {\n $message = 'Ressource type must not be empty!';\n $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n }\n if ((trim($baseuri) == '')||(trim($baseuri) == 'http://')) {\n $message = 'Base Uri must not be empty!';\n $this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n }\n if (trim($header) == '') {\n \t$message = 'You must select whether you have a header!';\n \t$this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));\n }\n \n //create mapping\n if (\t (trim($restype) != '') \n \t\t&& ((trim($baseuri) != '') || (trim($baseuri) != 'http://'))\n \t\t&& (trim($header) != ''))\n {\n \t$paramArray = array('firstline' => $this->view->line,\n \t\t\t\t\t\t'header' \t=> $header,\n \t\t\t\t\t\t'baseuri'\t=> $baseuri,\n \t\t\t\t\t\t'restype' \t=> $restype,\n \t\t\t\t\t\t'filename' \t=> $this->view->filename\n \t);\n \t\n \t$maippng = $this->_createMapping($paramArray);\n \t$maprpl = str_replace('\"', \"'\", $maippng);\n \t//save mapping into file\n \t$mapfile = tempnam(sys_get_temp_dir(), 'ow');\n \t\n \t$fp = fopen($mapfile,\"wb\");\n \tfwrite($fp,$maprpl);\n \tfclose($fp);\n \t\n \t$ttl = array();\n \t\n \t//call convert for ttl\n \t$ttl = $this->_convert($mapfile, $this->view->filename);\n \t\n \t//save ttl data into file\n \t$ttlfile = tempnam(sys_get_temp_dir(), 'ow');\n \t$temp = fopen($ttlfile, 'wb');\n \tforeach ($ttl as $line) {\n \t\tfwrite($temp, $line . PHP_EOL);\n \t\t}\n \tfclose($temp);\n \t$filetype = 'ttl';\n \t\n \t$locator = Erfurt_Syntax_RdfParser::LOCATOR_FILE;\n \t\n \t// import call\n \t\n \ttry {\n \t\t$this->_import($ttlfile, $filetype, $locator);\n \t\t} catch (Exception $e) {\n \t\t\t$message = $e->getMessage();\n \t\t\t$this->_owApp->appendErrorMessage($message);\n \t\t\treturn;\n \t\t\t}\n \t\t}\n \t\t\n //after success redirect to index site \n $this->_redirect('');\n }\n }\n }", "function table()\n {\n \n $this->load->view('admin/table');\n }", "public function showbulkupload(Request $req){\n\treturn view('bulkupload');\n }", "public function index() {\n $files = Tbl_leads_csv_files::all();\n $total = count($files);\n if ($total > 0) {\n $formstable = '<table id=\"example1\" class=\"table\">';\n $formstable .= '<thead>';\n $formstable .= '<tr>';\n $formstable .= '<th>Name</th>';\n $formstable .= '<th>Size</th>';\n $formstable .= '<th>Status</th>';\n $formstable .= '<th>Import Time</th>';\n $formstable .= '<th>Date</th>';\n $formstable .= '<th>Action</th>';\n $formstable .= '</tr>';\n $formstable .= '</thead>';\n $formstable .= '<tbody>';\n foreach ($files as $formdetails) {\n\n $faicon = '';\n\n if (($formdetails['type'] == 'csv') || ($formdetails['type'] == 'xls') || ($formdetails['type'] == 'xlsx')) {\n $faicon = '<i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i>';\n }\n\n $formstable .= '<tr>';\n $formstable .= '<td class=\"table-title\"><a href=\"' . url('admin/leadcsv/' . $formdetails['lc_id']) . '\">' . $faicon . '&nbsp; ' . $formdetails['original_name'] . '</a></td>';\n $formstable .= '<td>' . $formdetails['size'] . '</td>';\n $formstable .= '<td>' . (($formdetails['status'] == 0) ? 'Not Imported' : 'Imported') . '</td>';\n $formstable .= '<td>' . (($formdetails['status'] == 0) ? '' : date('d-m-Y', strtotime($formdetails['import_time']))) . '</td>';\n $formstable .= '<td>' . date('d-m-Y', strtotime($formdetails['created_at'])) . '</td>';\n $formstable .= '<td>';\n if (($formdetails['status'] == 0)) {\n $formstable .= '<a class=\"btn btn-default\" href=\"#\" onclick=\"return submitLeadData(' . $formdetails['file_id'] . ');\">Import</a>&nbsp;';\n } else {\n $formstable .= '<a class=\"btn btn-default\" href=\"' . url('admin/fbleads/' . $formdetails['file_id']) . '\">View Leads</a>&nbsp;';\n }\n\n //<a class=\"btn btn-default\" href=\"' . url('admin/leadcsv/import/' . $formdetails['file_id']) . '\">Import</a>\n $formstable .= '<a class=\"btn btn-default\" href=\"' . url('admin/leadcsv/delete/' . $formdetails['file_id']) . '\">Delete</a>&nbsp;';\n $formstable .='</td>';\n $formstable .= '</tr>';\n }\n $formstable .= '</tbody>';\n $formstable .= '</table>';\n } else {\n $formstable = 'No records available';\n }\n\n $data['total'] = $total;\n $data['table'] = $formstable;\n\n return view('admin.leadcsv.index')->with('data', $data);\n }", "public function viewEvents();", "function load_from_external_source($col_mapping, $source_data) {\n $a = array();\n $label_formatter = new \\App\\Libraries\\Label_formatter();\n $source_data2 = array_change_key_case($source_data, CASE_LOWER);\n\n // load entry fields from external source\n foreach ($col_mapping as $fld => $spec) {\n\n // $spec['type'] will typically be ColName, PostName, or Literal\n // However, it might have a suffix in the form '.action.ActionName'\n\n // Method get_entry_form_definitions() E_model.php looks for text \n // in the form 'ColName.action.ActionName'\n // and will add an 'action' item to the field spec\n \n switch ($spec['type']) {\n case 'ColName':\n // Copy the text in the specified column of the detail report for the source page family\n // . \" (field = \" . $spec['value'] . \", action = $action)\"\n $col = $spec['value'];\n $col_fmt = $label_formatter->format($col);\n $col_defmt = $label_formatter->deformat($col);\n $val = \"\";\n if (array_key_exists($col, $source_data)) {\n $val = $source_data[$col];\n } elseif (array_key_exists($col_fmt, $source_data)) {\n // Target column for column name not found; try using the display-formatted target field\n $val = $source_data[$col_fmt];\n } elseif (array_key_exists($col_defmt, $source_data)) {\n // Target column for column name not found; try using the display-deformatted target field\n $val = $source_data[$col_defmt];\n } else {\n // TODO: Trigger a warning message of some kind?\n // Return an invalid link id to not break the page entirely; it's harder to see that there's a problem, but much easier to see the exact cause\n $val = \"COLUMN_NAME_MISMATCH\";\n }\n $a[$fld] = $val;\n break;\n\n case 'PostName':\n // Retrieve the named POST value\n //$request = \\Config\\Services::request();\n //$pv = $request->getPost($spec['value']);\n $col = $spec['value'];\n $pv = \"\";\n if (array_key_exists($col, $source_data2)) {\n $pv = $source_data2[$col];\n }\n $a[$fld] = $pv;\n break;\n\n case 'Literal':\n // Store a literal string\n $a[$fld] = $spec['value'];\n break;\n }\n\n // any further actions?\n if (isset($spec['action'])) {\n switch ($spec['action']) {\n case 'ExtractUsername':\n // Look for username in text of the form \"Person Name (Username)\"\n // This Regex matches any text between two parentheses\n\n $patUsername = '/\\(([^)]+)\\)/i';\n $matches = array();\n\n preg_match_all($patUsername, $a[$fld], $matches);\n\n // The $matches array returned by preg_match_all is a 2D array\n // Any matches to the first capture are in the array at $matches[0]\n\n if (count($matches[1]) > 0) {\n // Update $a[$fld] to be the last match found (excluding the parentheses)\n\n $a[$fld] = $matches[1][count($matches[1]) - 1];\n }\n\n break;\n\n case 'ExtractEUSId':\n // Look for EUS ID in text of the form \"LastName, FirstName (12345)\"\n // This Regex matches any series of numbers between two parentheses\n\n $patEUSId = '/\\(( *\\d+ *)\\)/i';\n $matches = array();\n\n preg_match($patEUSId, $a[$fld], $matches);\n\n // $matches is now a 1D array\n // $matches[0] is the full match\n // $matches[1] is the captured group\n\n if (count($matches) > 1) {\n // Update $a[$fld] to be the first match found (excluding the parentheses)\n\n $a[$fld] = $matches[1];\n }\n\n break;\n\n case 'Scrub':\n // Only copy certain text from the comment field of the source analysis job\n\n // Look for text in the form '[Req:Username]'\n // If found, put the last one found in $s\n // For example, given '[Job:D3M580] [Req:D3M578] [Req:D3L243]', set $s to '[Req:D3L243]'\n // This is a legacy comment text that was last used in 2010\n\n $s = \"\";\n $field = $a[$fld];\n\n $patReq = '/(\\[Req:[^\\]]*\\])/';\n $matches = array();\n preg_match_all($patReq, $field, $matches);\n\n // The $matches array returned by preg_match_all is a 2D array\n // Any matches to the first capture are in the array at $matches[0]\n\n if (count($matches[0]) != 0) {\n $s .= $matches[0][count($matches[0]) - 1];\n }\n\n // Also look for 'DTA:' followed by letters, numbers, and certain symbols\n // For example, given '[Job:D3L243] [Req:D3L243] DTA:DTA_Manual_02', look for 'DTA:DTA_Manual_02'\n // If found, append the text to $s\n // This is a legacy comment text that was last used in 2010\n\n $patDTA = '/(DTA:[a-zA-Z0-9_#\\-]*)/';\n preg_match($patDTA, $field, $matches);\n\n // $matches is now a 1D array\n // $matches[0] is the full match\n // $matches[1] is the captured group\n\n if (count($matches) > 1) {\n $s .= \" \" . $matches[1];\n }\n\n $a[$fld] = $s;\n break;\n }\n }\n }\n return $a;\n}", "public function admin_index()\n {\n $sources = Source::orderBy('name')->get();\n\n return view('admin.events')->with('sources', $sources);\n }", "function field_views_data_alter(&$data) {\n foreach (field_info_fields() as $field) {\n if ($field['storage']['type'] != 'field_sql_storage') {\n continue;\n }\n\n $function = $field['module'] . '_field_views_data_views_data_alter';\n if (function_exists($function)) {\n $function($data, $field);\n }\n }\n}", "public function process_query_item_list(Request $request) {\n if($request->ajax()) {\n $log = new LogSystem;\n $log->module_id = 20;\n $log->activity_type_id = 1;\n $log->description = \"Papar senarai (Proses) Borang L - Kuiri\";\n $log->data_old = json_encode($request->input());\n $log->url = $request->fullUrl();\n $log->method = strtoupper($request->method());\n $log->ip_address = $request->ip();\n $log->created_by_user_id = auth()->id();\n $log->save();\n\n $forml = FormL::findOrFail($request->id);\n\n $queries = $forml->queries()->where('created_by_user_id', auth()->id())->whereNull('log_filing_id');\n\n return datatables()->of($queries)\n ->editColumn('action', function ($query) {\n $button = \"\";\n $button .= '<a href=\"javascript:;\" onclick=\"edit(this,'.$query->id.')\" class=\"btn btn-success btn-xs\" data-toggle=\"tooltip\" title=\"Kemaskini\"><i class=\"fa fa-edit\"></i></a> ';\n $button .= '<a href=\"javascript:;\" onclick=\"remove('.$query->id.')\" class=\"btn btn-danger btn-xs\" data-toggle=\"tooltip\" title=\"Padam\"><i class=\"fa fa-trash\"></i></a>';\n return $button;\n })\n ->make(true);\n }\n }", "public function ajax()\n {\n return $this->datatables->eloquent($this->query())// ->addColumn('action', 'path.to.action.view')\n ->editColumn('asset_id', function ($data) {\n\n return '<a href=' . route('samples.show', $data->asset_id) . '>' . $data->asset_id . '</a>';\n })\n ->editColumn('dealer.name', function ($data) {\n\n return '<a href=' . route('samples.out.dsr', $data->dealer_id) . '>' . $data->dealer->name . '</a>';\n })\n ->editColumn('user.name', function ($data) {\n\n return '<a href=' . route('samples.out.rep', $data->user_id) . '>' . $data->user->name . '</a>';\n })\n ->editColumn('created_at', function ($data) {\n\n return $data->created_at ? with(new Carbon($data->created_at))->format('m/d/Y') : '';\n })\n ->editColumn('expected_return_date', function ($data) {\n\n return $data->expected_return_date ? with(new Carbon($data->expected_return_date))->format('m/d/Y') : '';\n })->make(true);\n }" ]
[ "0.6082621", "0.5878252", "0.58594924", "0.574541", "0.5736615", "0.57126313", "0.564642", "0.561661", "0.56162804", "0.55458677", "0.5539601", "0.5529937", "0.55135375", "0.5512782", "0.55125177", "0.5510399", "0.5476503", "0.5472491", "0.5462427", "0.5448134", "0.5446046", "0.5412493", "0.5399455", "0.5397109", "0.53907", "0.5385177", "0.53767866", "0.53531295", "0.53529024", "0.5344983", "0.53381604", "0.53285265", "0.53249913", "0.53211224", "0.5300171", "0.5297697", "0.5294944", "0.52900904", "0.52818733", "0.5280364", "0.5278656", "0.5272387", "0.5272114", "0.52606773", "0.52525955", "0.52515376", "0.52357197", "0.5227849", "0.5226178", "0.52246803", "0.5223922", "0.5223234", "0.52224827", "0.521734", "0.5213205", "0.52058494", "0.52034545", "0.51963127", "0.5194259", "0.5192315", "0.5192234", "0.51847893", "0.5169166", "0.5168164", "0.51674443", "0.51596004", "0.515686", "0.51515836", "0.5146697", "0.51438713", "0.51423055", "0.5141672", "0.51328236", "0.51302177", "0.5120153", "0.51173997", "0.5117371", "0.5113276", "0.51113325", "0.5110529", "0.51103306", "0.51031166", "0.5101385", "0.5101385", "0.5100835", "0.5100535", "0.50983995", "0.5089494", "0.50879025", "0.50869596", "0.5081988", "0.5081534", "0.50798553", "0.5075611", "0.5071417", "0.5067045", "0.5063304", "0.50609034", "0.5056496", "0.5053165" ]
0.53010297
34
Load the view file event details data table to employee
public function eventdetails(){ $user=Auth::user(); $data=Event::where('event_request',$user['name'])->paginate(10); // print_r($data);die(); return view('event.event_details')->with('data',$data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function read_event_record()\n\t{\n\t\t$data['title'] = $this->Xin_model->site_title();\n\t\t$event_id = $this->input->get('event_id');\n\t\t$result = $this->Events_model->read_event_information($event_id);\n\t\t\n\t\t$data = array(\n\t\t\t\t'event_id' => $result[0]->event_id,\n\t\t\t\t'employee_id' => $result[0]->employee_id,\n\t\t\t\t'company_id' => $result[0]->company_id,\n\t\t\t\t'event_title' => $result[0]->event_title,\n\t\t\t\t'event_date' => $result[0]->event_date,\n\t\t\t\t'event_time' => $result[0]->event_time,\n\t\t\t\t'event_note' => $result[0]->event_note,\n\t\t\t\t'event_color' => $result[0]->event_color,\n\t\t\t\t'all_employees' => $this->Xin_model->all_employees(),\n\t\t\t\t'get_all_companies' => $this->Xin_model->get_companies()\n\t\t\t\t);\n\t\t$session = $this->session->userdata('username');\n\t\tif(!empty($session)){ \n\t\t\t$this->load->view('admin/events/dialog_events', $data);\n\t\t} else {\n\t\t\tredirect('admin/');\n\t\t}\n\t}", "protected function importData()\n\t{\n\t\t// get events\n\t\tinclude_once \"Services/ADN/EP/classes/class.adnExaminationEvent.php\";\n\t\t$events = adnExaminationEvent::getAllEvents($this->filter, $this->archived);\n\t\t\n\t\t// value mapping (to have correct sorting)\n\t\tif(sizeof($events))\n\t\t{\n\t\t\tinclude_once \"Services/ADN/EP/classes/class.adnAssignment.php\";\n\t\t\tinclude_once \"Services/ADN/ED/classes/class.adnSubjectArea.php\";\n\t\t\tforeach($events as $idx => $item)\n\t\t\t{\n\t\t\t\t$date = new ilDate($item[\"date_from\"]->get(IL_CAL_DATE), IL_CAL_DATE);\n\t\t\t\t$events[$idx][\"date_display\"] = ilDatePresentation::formatDate($date);\n\t\t\t\t$events[$idx][\"date\"] = $item[\"date_from\"]->get(IL_CAL_FKT_DATE, 'Y-m-d');\n\t\t\t\t$events[$idx][\"time_from\"] = $item[\"date_from\"]->get(IL_CAL_FKT_DATE, 'H:i');\n\t\t\t\t$events[$idx][\"time_to\"] = $item[\"date_to\"]->get(IL_CAL_FKT_DATE, 'H:i');\n\t\t\t\t$events[$idx][\"type\"] = $this->filter_options[\"type\"][$item[\"subject_area\"]];\n\t\t\t\t$events[$idx][\"type_color\"] = adnSubjectArea::getColorForArea($item[\"subject_area\"]);\n\n\t\t\t\t// we cannot use filter options because of archived values\n\t\t\t\t$events[$idx][\"facility\"] = adnExamFacility::lookupCity($item[\"md_exam_facility_id\"]);\n\n\t\t\t\tswitch($this->mode)\n\t\t\t\t{\n\t\t\t\t\tcase self::MODE_ASSIGNMENT:\n\t\t\t\t\t\t$users = adnAssignment::getAllAssignments(array(\"event_id\"=>$item[\"id\"]));\n\t\t\t\t\t\t$events[$idx][\"assigned\"] = sizeof($users);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\tcase self::MODE_INVITATION:\n\t\t\t\t\t\t$users = adnAssignment::getAllInvitations($item[\"id\"]);\n\t\t\t\t\t\t$events[$idx][\"invitations\"] = sizeof($users);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase self::MODE_ATTENDANCE:\n\t\t\t\t\t\tinclude_once './Services/ADN/Report/classes/class.adnReportAttendanceList.php';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$events[$idx]['attendance'] = '';\n\t\t\t\t\t\tif(adnReportAttendanceList::lookupLastFile($item['id']) instanceof ilDateTime)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$events[$idx][\"attendance\"] = \n\t\t\t\t\t\t\t\tilDatePresentation::formatDate(\n\t\t\t\t\t\t\t\t\tadnReportAttendanceList::lookupLastFile($item['id']));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->setData($events);\n\t\t$this->setMaxCount(sizeof($events));\n\t}", "function loadEditEvent($evID) {\n $event = Event::find($evID);\n if ($event == null) {\n return view('cms.error', ['message' => 'Event not found!']);\n }\n $places = Place::all(['placeID', 'title_en']);\n $categories = Category::all(['ctgID', 'name_en']);\n return view('cms.events.create.event', ['event' => $event, 'places' => $places, 'categories' => $categories]);\n }", "function view()\n {\n $data['title'] = 'Cadet Events';\n $this->load->model('cadetevent_model');\n $data['events'] = $this->cadetevent_model->get_all_cadetevents();\n \n // Loads the home page \n $this->load->view('templates/header', $data);\n $this->load->view('pages/attendance.php');\n $this->load->view('templates/footer'); \n }", "private function show_all(){\n\t\t$staff =$this->model->get_all();\n\t\t$section = file_get_contents('Views/Employee/show_all.html');;\n\t\t$info = \"\";\n\t\tforeach ($staff as $employee) {\n\t\t\t$info .= \"<tr>\n\t\t \t\t<td> $employee[emp_name] $employee[emp_last_name] </td>\n\t\t \t\t<td> $employee[RFC] </td>\n\t\t \t\t<td> $employee[emp_email] </td>\n\t\t \t\t<td>\n\t\t \t\t\t<a href='index.php?ctrl=employee&act=details&id=$employee[id_employee]'><i class='icon-view'></i></a>\n\t\t\t\t\t\t\t<a href='index.php?ctrl=employee&act=edit&id=$employee[id_employee]'><i class='icon-edit'></i></a>\n\t\t\t\t\t\t <a href='index.php?ctrl=employee&act=delete&id=$employee[id_employee]'><i class='icon-remove'></i></a>\n\t\t\t\t\t\t </td>\n\t \t\t\t\t</tr>\";\n\t\t\t}\n\t \t/*$info .= \"<tr>\n\t\t \t\t<td> $employee[name] $employee[last_name] </td>\n\t\t \t\t<td> $employee[RFC] </td>\n\t\t \t\t<td> $employee[email] </td>\n\t\t \t\t<td>\n\t\t \t\t\t<a href='index.php?ctrl=employee&act=details&id=$employee[id]'><i class='icon-view'></i></a>\n\t\t\t\t\t\t\t<a href='index.php?ctrl=employee&act=edit&id=$employee[id]'><i class='icon-edit'></i></a>\n\t\t\t\t\t\t\t<a href='index.php?ctrl=employee&act=delete&id=$employee[id]'><i class='icon-remove'></i></a>\n\t\t\t\t\t\t</td>\n\t \t\t\t</tr>\";*/\n\t $dicc = array('{info}' => $info);\n\t $section = strtr($section, $dicc);\n\n\t\t$this->template($section);\n\t}", "public function employee_excel()\n {\n $this->load->view('backend/admin/employee/employee_excel');\n }", "public function load_data_sertifikat($kd_event){\n\t\tif($this->session->userdata('sebagai') ==\"Admin\"){\n\t\t\tif($kd_event != \"\"){\n\t\t\t\treturn $this->db->query('SELECT sp.kd_sertifikat AS kd_sertifikat, sp.nomor AS nomor, sp.link_sertifikat AS link, sp.status AS status,p.nama_lengkap AS nama_lengkap, p.email AS email, e.nama_event AS nama_event\n\t\t\t\tFROM '.$this->table_name1.' AS sp \n\t\t\t\tINNER JOIN '.$this->table_name2.' AS p\n\t\t\t\tON sp.kd_peserta = p.kd_peserta \n\t\t\t\tINNER JOIN '.$this->table_name3.' AS e \n\t\t\t\tON p.kd_event = e.kd_event \n\t\t\t\tWHERE p.kd_event = \"'.$kd_event.'\"\n\t\t\t\tORDER BY sp.timestamp DESC\n\t\t\t\t');\n\t\t\t}else{ // semua event dokumentasi\n\t\t\t\treturn $this->db->query('SELECT sp.kd_sertifikat AS kd_sertifikat, sp.nomor AS nomor, sp.link_sertifikat AS link, sp.status AS status,p.nama_lengkap AS nama_lengkap, p.email AS email, e.nama_event AS nama_event\n\t\t\t\tFROM '.$this->table_name1.' AS sp \n\t\t\t\tINNER JOIN '.$this->table_name2.' AS p\n\t\t\t\tON sp.kd_peserta = p.kd_peserta \n\t\t\t\tINNER JOIN '.$this->table_name3.' AS e \n\t\t\t\tON p.kd_event = e.kd_event \n\t\t\t\tORDER BY p.timestamp DESC\n\t\t\t\t');\n\t\t\t}\n\t\t} \n\t\telse{ // level bukan admin \n\t\t\t$kd_admin = $this->session->userdata('kd_admin');\n\t\t\tif($kd_event != \"\"){\n\t\t\t\treturn $this->db->query('SELECT sp.kd_sertifikat AS kd_sertifikat,\n\t\t\t\tsp.nomor AS nomor, sp.link_sertifikat AS link, sp.status AS status, p.nama_lengkap AS nama_lengkap, p.email AS email, e.nama_event AS nama_event\n\t\t\t\tFROM '.$this->table_name1.' AS sp \n\t\t\t\tINNER JOIN '.$this->table_name2.' AS p\n\t\t\t\tON sp.kd_peserta = p.kd_peserta \n\t\t\t\tINNER JOIN '.$this->table_name3.' AS e \n\t\t\t\tON p.kd_event = e.kd_event \n\t\t\t\tINNER JOIN '.$this->table_name4.' AS al \n\t\t\t\tON al.kd_event = e.kd_event \n\t\t\t\tWHERE al.kd_admin = \"'.$kd_admin.'\" AND p.kd_event = \"'.$kd_event.'\"\n\t\t\t\tORDER BY sp.timestamp DESC\n\t\t\t\t');\n\t\t\t}else{\n\t\t\t\treturn $this->db->query('SELECT sp.kd_sertifikat AS kd_sertifikat, sp.nomor AS nomor, sp.link_sertifikat AS link, sp.status AS status,p.nama_lengkap AS nama_lengkap, p.email AS email, e.nama_event AS nama_event\n\t\t\t\tFROM '.$this->table_name1.' AS sp \n\t\t\t\tINNER JOIN '.$this->table_name2.' AS p\n\t\t\t\tON sp.kd_peserta = p.kd_peserta \n\t\t\t\tINNER JOIN '.$this->table_name3.' AS e \n\t\t\t\tON p.kd_event = e.kd_event \n\t\t\t\tINNER JOIN '.$this->table_name4.' AS al \n\t\t\t\tON al.kd_event = e.kd_event\n\t\t\t\tWHERE al.kd_admin = \"'.$kd_admin.'\" \n\t\t\t\tORDER BY sp.timestamp DESC\n\t\t\t\t');\n\t\t\t}\n\t\t}\n\t}", "public function event_details($event_id=\"\")\n {\n $lang = $this->data['lang'];\n $user_id = $this->user_id;\n\n $this->data['page'] = 'event_details' ;\n\n if($event_id)\n {\n $this->data['event_details'] = $this->db->where('id',$event_id)->get('events')->row_array();\n }\n\n $events = $this->db->where('id!=',$event_id)->get('events')->result_array() ;\n\n $this->data['events'] = array_chunk($events, 3);\n\n\n $body = 'event_details' ;\n\n $this->load_pages($body,$this->data);\n }", "public function get_employees() {\n\n\t\t$data['title'] = $this->Xin_model->site_title();\n\t\t$id = $this->uri->segment(4);\n\t\t\n\t\t$data = array(\n\t\t\t'company_id' => $id\n\t\t\t);\n\t\t$session = $this->session->userdata('username');\n\t\tif(!empty($session)){ \n\t\t\t$this->load->view(\"admin/events/get_employees\", $data);\n\t\t} else {\n\t\t\tredirect('admin/');\n\t\t}\n\t\t// Datatables Variables\n\t\t$draw = intval($this->input->get(\"draw\"));\n\t\t$start = intval($this->input->get(\"start\"));\n\t\t$length = intval($this->input->get(\"length\"));\n\t }", "public function importpunch(Request $request){\n\n\n\t$employee = Employee::where('status', 1)->get()->all();\n\t\n\treturn view('hr.employeelog.importpunch')->with(compact('employee'));\n\n}", "function viewEventDetail()\n{\n\t\t/*\n\t\t{\n\t \"name\": \"Master The Art Of Selling\",\n\t \"address\": \"10-f, Fort Legend Tower, 3rd Ave, Taguig, Metro Manila\",\n\t \"gmapLong\": 121.04692,\n\t \"gmapLat\": 14.55408,\n\t \"date\": \"4-25-2016\",\n\t \"startTime\": \"10:00\",\n\t \"endTime\": \"19:00\",\n\t \"eventPhoto\": \"event.jpg\",\n\t \"about\": \"We will teach you on how to master selling and generate more sales for your brand or company\",\n\t \"attendees\": [\n\t {\n\t \"id\": \"1\",\n\t \"firstName\": \"Ken\",\n\t \"lastName\": \"Sia\",\n\t \"profilePhoto\": \"emp1.jpg\"\n\t },\n\t {\n\t \"id\": \"2\",\n\t \"firstName\": \"Jaye\",\n\t \"lastName\": \"Atienza\",\n\t \"profilePhoto\": \"emp2.jpg\"\n\t }\n\t ]\n\t }\n\t */\n\t \n\t//the defaults starts\n\tglobal $myStaticVars;\n\textract($myStaticVars); // make static vars local\n\t$member_default_avatar \t\t= $member_default_avatar;\n\t$member_default_cover\t\t= $member_default_cover;\n\t$member_default\t\t\t\t= $member_default;\n\t$company_default_cover\t\t= $company_default_cover;\n\t$company_default_avatar\t\t= $company_default_avatar;\n\t$events_default\t\t\t\t= $events_default;\n\t$event_default_poster\t\t= $event_default_poster;\n\t//the defaults ends\n\t\n\t\n\t$data= array();\t\t\n\t\n\t$eventTagid=validate_input($_GET['id']);\n\t$eventid=getEventIdfromEventTag($eventTagid);\n\tif($eventid!='')\n\t{\n\t\t$qry=\"SELECT entrp_events.*,entrp_event_categories.category_name \n\t\t\t\tFROM entrp_events \n\t\t\t\tLEFT JOIN entrp_event_categories ON entrp_events.category=entrp_event_categories.id\n\t\t\t WHERE entrp_events.id=\".$eventid.\" AND entrp_events.status!=0\n\t\t\t\t\";\n\t\t$res=getData($qry);\n\t\t$count_res=mysqli_num_rows($res);\n\t\tif($count_res>0)\n\t\t{\n\t\t\twhile($row=mysqli_fetch_array($res))\n\t \t{\n\t \t\t$data['id']\t\t\t\t=\t$row['id'];\n\t \t\t$data['eventTagId']\t=\t$row['eventTagId'];\n\t \t\t$data['city']\t\t\t=\t$row['city'];\n\t \t\t$data['share_url']\t=\t$row['share_url'];\n\t \t\t$data['name']\t\t\t=\t$row['eventName'];\n\t \t\t$data['address']\t\t=\t$row['address'];\n\t\n\t \t\t$data['date_time_formatted']\t\t\t=\tdate('Y/m/d H:i:s', strtotime($row['event_date_time']));\n\t \t\t$data['date']\t\t\t=\t$row['event_date'];\n\t \t\t$data['startTime']\t=\t$row['start_time'];\n\t \t\t$data['endTime']\t\t=\t$row['end_time'];\n\t \t\t$data['eventPhoto']\t=\t$row['clientid'];\n\t \t\tif($row['poster']!='')\n\t \t\t{\n\t \t\t\t$data['poster']\t=\t$row['poster'];\n\t \t\t}\n\t \t\telse\n\t \t\t{\n\t \t\t\t$data['poster']\t=\t$events_default;\n\t \t\t}\n\t \t\t\n\t \t\t$data['about']\t\t\t=\thtmlspecialchars_decode($row['description'],ENT_QUOTES);\n\t \t\t$data['category']\t\t=\t$row['category_name'];\n\t \t\t$data['map']['center']['latitude']\t\t=\t$row['location_lat'];\n\t\t\t\t$data['map']['center']['longitude']\t\t=\t$row['location_long'];\n\t\t\t\t$data['map']['zoom']\t=\t8;\n\t \t}\n\t \t\n\t\t\t$data['joining']\t\t\t=\tgoingForThisEventorNot($eventid);\n\t\t\t$data['attendees']\t\t=\tgetEventAttendeesFromEventID($eventid);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data['id']\t\t\t\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['name']\t\t\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['address']\t\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['map']['center']['latitude']\t\t=\t'';\n\t\t\t$data['map']['center']['longitude']\t\t=\t'';\n\t\t\t$data['map']['zoom']\t\t\t\t\t\t\t=\t8;\n\t\t\t$data['date']\t\t\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['startTime']\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['endTime']\t\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['eventPhoto']\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['poster']\t\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['about']\t\t\t\t\t\t\t\t\t=\t'';\n\t \t$data['category']\t\t\t\t\t\t\t\t=\t'';\t\t\n\t\t}\t\n\t}\n\treturn $data;\n}", "public function viewNewEvents()\n {\n $this->load->model('M_Event_table');\n $this->load->model('M_Customer_table');\n $events = $this->M_Event_table->getNewEvents();\n $customers = $this->M_Customer_table->getAllCustomers();\n\n $returnData['newEventsMore']= $events;\n $returnData['customers'] = $customers;\n\n $this->load->view('admin/viewNewEvents',$returnData);\n }", "function ReadEvents()\n {\n $this->ApplicationObj()->Events=\n $this->Sql_Select_Hashes\n (\n $this->ApplicationObj()->HtmlEventsWhere(),\n array(),\n array(\"StartDate\",\"ID\")\n );\n \n $this->ApplicationObj()->Events=array_reverse($this->ApplicationObj()->Events);\n }", "function employee(){\n $data['employee'] = $this->m_rental->get_data('employee')->result();\n $this->load->view('header');\n $this->load->view('admin/employee',$data);\n $this->load->view('footer');\n }", "function loadAllData()\r\n {\r\n $servername = 'localhost';\r\n $username = 'root';\r\n $password = '';\r\n $dbname = 'eventscaledar';\r\n\r\n// Create connection\r\n $conn = mysqli_connect($servername, $username, $password, $dbname);\r\n // Check connection\r\n if (!$conn) {\r\n die(\"Connection failed: \" . mysqli_connect_error());\r\n}\r\n\r\n$sql = 'select * from events order by EventDate ASC';\r\n$result = mysqli_query($conn, $sql);\r\n\r\nif (mysqli_num_rows($result) > 0) {\r\n // output data of each row\r\n\t$c=1;\r\n \r\n $res = mysqli_query($conn,\"select * from events order by EventDate ASC\");\r\n $records = array();\r\n while($obj = mysqli_fetch_object($res)) {\r\n $records []= $obj;\r\n }\r\n file_put_contents(\"data.json\", json_encode($records));\r\n \r\n \r\n \r\n while($row = mysqli_fetch_assoc($result)) {\r\n \r\n\t \t\techo \"<tr><td>\".$row[\"EID\"].\"</td><td>\".$row[\"EventDate\"].\"</td><td>\".$row[\"Event\"].\"</td><td>\".$row[\"Details\"].\"</td><td>&nbsp;&nbsp;&nbsp;<img class='hp' id='p$c' src='\".$row[\"Photos\"].\"'/>&nbsp;&nbsp;&nbsp;\t\t<input type='button' value='edit' class='edit btn-group' onclick='edit($c);' id='r$c'/>&nbsp;&nbsp;&nbsp;<input type='button' value='Delete' class='edit btn-group' onclick='delete1($c);' id='d$c'/></td></tr>\";\r\n\t\t\t\r\n\t\r\n\t\t$c++;\r\n \r\n }\r\n} else {\r\n file_put_contents(\"data.json\", json_encode($records));\r\n echo \"0 results\";\r\n}\r\n\r\nmysqli_close($conn);\r\n }", "public function loadEvent($id){\n\t\t//get data from DB\n\t\t$this->load->database();\n\t\t$tmp_event = $this->db->query(\"SELECT * FROM event WHERE id='$id'\");\n\t\t$tmp_event = $tmp_event->row_array();\n\t\t//assign data to object attr\n\t\t$this->title = $tmp_event['title'];\n\t\t$this->des = $tmp_event['des'];\n\t\t$this->image = $tmp_event['image'];\n\t\t$this->author = $tmp_event['author'];\n\t\t$this->postdate = $tmp_event['postdate'];\n\t\t$this->duedate = $tmp_event['duedate'];\n\t}", "public function indexAction() {\n $db = $this->getDB();\n \n #load the first few employees\n $sql = 'select * from employees limit 100';\n $stmt = $db->prepare($sql);\n $stmt->execute();\n \n \n #create a new View\n $view = new \\view\\federal_employees($this->_action, $stmt->fetchAll(\\PDO::FETCH_ASSOC));\n \n }", "public function londontec_event(){\n\t \n\t\t$id = $this->uri->segment(3);\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/add_londontec_event';\n\t\t$mainData = array(\n\t\t\t'pagetitle' => 'Create londotec event',\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n \n\t}", "public function getEventDetail()\n {\n // get event detail\n $this\n ->get('/event/detail/'.$this->event->id)\n ->assertStatus(200);\n }", "public function index(){\n\n //get the event detail passed from index\n if(!isset($_GET['event']) || empty($_GET['event'])){\n $event_id=$_SESSION['detailEventID'];\n }else{\n $event_id = $_GET['event'];\n $_SESSION['detailEventID']=$event_id;\n }\n\n $this->load->model('UpdateEventDetailModel');\n $data['event'] = $this->UpdateEventDetailModel->selectEventByID(intval($event_id));\n\n //$data['isbn'] = $isbn;\n\n $this->load->view('navbar');\n $this->load->view('detailView',$data);\n $this->load->view('footer');\n\n }", "function bindEventObject()\r\n\t{\r\n JTable::addIncludePath( JPATH_ADMINISTRATOR . '/components/com_calendar/tables' );\r\n\t\t$table = JTable::getInstance( 'Events', 'CalendarTable' );\r\n\t\t\r\n\t if (!empty($this->event_id))\r\n\t {\r\n\t $table->load( $this->event_id );\r\n\t }\r\n\t \r\n\t\t$table->trimProperties();\r\n\t\t\r\n\t\t$properties = $this->getProperties();\r\n\t\t$table_properties = $table->getProperties();\r\n\r\n\t\tforeach ($table_properties as $prop=>$value)\r\n\t\t{\r\n\t\t if (!array_key_exists($prop, $properties))\r\n\t\t {\r\n\t\t $this->$prop = $table->$prop;\r\n\t\t }\r\n\t\t}\r\n\t}", "public function load_data_laba_rugi() {\n\n $id = $this->input->post('event_id');\n\n $events_master = \"SELECT id, hpp_category, hpp_subcategory\n\t\t\t\t\t\t\t\t FROM events_master\n ORDER BY sort_category, sort_subcategory ASC\";\n \n $hpp = $this->db->query(\"SELECT SUM(item_qty*item_price) AS 'total_hpp'\n FROM events_hpp\n WHERE event_id = \" . $id . \"\n GROUP BY event_id\");\n\n $income = $this->db->query(\"SELECT SUM(nominal) AS 'total_income'\n FROM events_income\n WHERE event_id = \" . $id . \"\n GROUP BY event_id\");\n\n if ($hpp->num_rows() > 0) {\n $hpp = $hpp->row_array();\n $hpp = $hpp['total_hpp'];\n } else {\n $hpp = 0;\n }\n\n if ($income->num_rows() > 0) {\n $income = $income->row_array();\n $income = $income['total_income'];\n } else {\n $income = 0;\n }\n\n\t\t$attr = array(\n\t\t\t\t\t\t'event'\t\t\t=> $this->db->query(\"SELECT id, title, event_category\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM events\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE id = \" . $id)->row_array(),\n 'eventsMaster'\t=> $this->db->query($events_master)->result(),\n 'hpp' => $hpp,\n 'income' => $income\n );\n \n $this->load->view('analisa/report-laba-rugi', $attr);\n\n }", "function single_event_view($event_id)\n\t\t{\n\t\t\t// call the calendar model\n\t\t\t$event_data = $this->calendar->get_single_event($event_id);\n\t\t\t\n\t\t\t$veiw_data['event'] = $event_data[0];\n\t\t\t\n\t\t\t//load the view for the single event with data\n\t\t\t$this->load->view('single_event', $veiw_data);\n\t\t}", "public function action_detail()\n\t{\n\t\t$this->template = View::forge('template-admin');\n\n $get = Input::get();\n\t\t$id = $get[\"id\"];\n\t\t$data[\"details\"] = Model_Event::find_by('id',$id);\n\t\t//return Response::forge(View::forge('event/detail',$data));\n\t\t$this->template->title = \"イベント詳細\";\n\t\t$this->template->content = View::forge('event/detail', $data);\n\t}", "public function assign_assets_details_view() {\n if (get_user_permission('assign_assets') === false) {\n redirect(base_url('user_login'));\n }\n $id = trim($this->input->post('id')); //$id=$employee_id\n $this->data['employee_information'] = $this->Employee_Model->get_employee($id);\n $this->data['assign_assets_by_employee_id'] = $this->Assign_assets_Model->get_assign_assets_by_employee_id($id);\n $this->load->view('assign_assets/assign_assets_details_modal', $this->data);\n }", "function view_employee($emp_id='',$pg=0)\r\n\t{\r\n\t\t$this->task_status = $this->config->item('task_status');\r\n\t\t$user=$this->auth();\r\n\t\t\t\r\n\t\t\t$emp_details=$this->erpm->get_empinfo($emp_id);\r\n\t\t\t$isactive_territories=$this->erpm->isactive_territorylist();\r\n\t\t\t$unactive_territories=$this->erpm->unactive_territorylist();\r\n\t\t\t$isactive_towns=$this->erpm->isactive_townlist();\r\n\t\t\t$unactive_towns=$this->erpm->unactive_townlist();\r\n\t\t\t$assignment_details=$this->erpm->to_get_assignmnt_details($emp_id);\r\n\t\t\t$send_invoices_det='';\r\n\t\t\t$show_send_log=0;\r\n\t\t\t$emp_id=$emp_details['employee_id'];\r\n\t\t\tif(($emp_details['job_title2']==6 && $emp_details['job_title']==5) || ($emp_details['job_title2']==7 && $emp_details['job_title']==5 ))\r\n\t\t\t{\r\n\t\t\t\t$from_date=$this->input->post('from');\r\n\t\t\t\t$to_date=$this->input->post('to');\r\n\t\t\t\t\r\n\t\t\t\t$show_send_log=1;\r\n\t\t\t\t$sent_invoices_by_driver=$this->erpm->get_manifesto_sen_invoices_det_by_emp($emp_id,$pg,$from_date,$to_date);\r\n\t\t\t\t$send_invoices_det=$sent_invoices_by_driver['sent_invoices'];\r\n\t\t\t\t\r\n\t\t\t\t//pagination block\r\n\t\t\t\t$this->load->library('pagination');\r\n\t\t\t\t$config['base_url'] = site_url('admin/view_employee/'.$emp_id);\r\n\t\t\t\t$config['total_rows'] = $sent_invoices_by_driver['total_sent_invoices'];\r\n\t\t\t\t$config['uri_segment'] = 4;\r\n\t\t\t\t$config['per_page'] = 5;\r\n\t\t\t\t\r\n\t\t\t\t$this->config->set_item('enable_query_strings',false);\r\n\t\t\t\t$this->pagination->initialize($config);\r\n\t\t\t\t$data['manifesto_sent_log_pagi'] = $this->pagination->create_links();\r\n\t\t\t\t$this->config->set_item('enable_query_strings',true);\r\n\t\t\t\t//pagination block end\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t$data['show_send_log']=$show_send_log;\r\n\t\t\t$data['send_invoice_det']=$send_invoices_det;\r\n\t\t\t$data['unactive_territories']=$unactive_territories;\r\n\t\t\t$data['isactive_territories']=$isactive_territories;\r\n\t\t\t$data['isactive_towns']=$isactive_towns;\r\n\t\t\t$data['unactive_towns']=$unactive_towns;\r\n\t\t\t$data['emp_details']=$emp_details;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$data['page']='view_emp';\r\n\t\t\t$this->load->view('admin',$data);\r\n\t\t\r\n\t}", "public function loadReportView()\n {\n //retrieve this month revenue data to generate the description\n $thisMonthRevenue = $this->main_model->retrieveRevenueThisMonth();\n\n //get the average revenue per month to generate the description\n $avgRevenue = $this->main_model->retrieveRevenueAverage();\n\n //to send those data to the view\n $data['thisMonthTotal'] = $thisMonthRevenue['thisMonthTotal'];\n $data['avgRevenue'] = $avgRevenue['avgRevenue'];\n\n\n //retrieve data needed for the bottom part\n $bottomData = $this->main_model-> totalAverageVisitors();\n\n //to send those data to the view\n $data['totalVisitors'] = $bottomData['totalVisitors'];\n $data['avgVisitors'] = $bottomData['avgVisitors'];\n\n \n $this->view(\"adminReportMod\", $data);\n }", "public function viewPDS(){\n//\n// return view('Employee/PdsOfEmp')->with(\"employeedata\", $employeedata);\n }", "public function employee_details($email_id)\n\t{\n\t\n\t\n\t\t\t$result1=$this->employee_model->select_specific($email_id);\n\t\t\t\n\t\t\t$this->load->view('view',array(\"data\"=>$result1));\n\t}", "function index()\n\t\t{\n\t\t\t// get every event record\n\t\t\t$all_events = $this->calendar->get_calendar_data();\n\t\t\t\n\t\t\t$veiw_data['all_events'] = $all_events;\n\t\t\t\n\t\t\t// load the view and send the data\n\t\t\t$this->load->view('index', $veiw_data);\n\t\t}", "public static function showData() {\n\n\t\tforeach(self::$employee_array as $id => $employee) { // Pour chaque ligne on affiche chaque attribut correspondant au colonne du tableau\n\n\t\t\tif($employee->_entityShortName == null) // Gestion du cas où une entité a été supprimée mais pas l'employé de l'entité\n\t\t\t\techo \"<tr><td>null</td><td>\" . $employee->_lastName . \"</td><td>\" . $employee->_firstName . \"</td><td>\" . $employee->_login . \"</td><td><a href=\\\"user.php?action=modifier&id=\" . $employee->_id . \"\\\">modifier</a></td><td><a href=\\\"user.php?action=supprimer&id=\" . $id . \"\\\">supprimer</a></td></tr>\";\n\t\t\telse\n\t\t\t\techo \"<tr><td>\" . $employee->_entityShortName . \"</td><td>\" . $employee->_lastName . \"</td><td>\" . $employee->_firstName . \"</td><td>\" . $employee->_login . \"</td><td><a href=\\\"user.php?action=modifier&id=\" . $employee->_id . \"\\\">modifier</a></td><td><a href=\\\"user.php?action=supprimer&id=\" . $id . \"\\\">supprimer</a></td></tr>\";\n\t\t}\n\t}", "public function salarydetailsviewAction()\r\n\t{\r\n if(defined('EMPTABCONFIGS'))\r\n\t\t{\r\n\t\t $empOrganizationTabs = explode(\",\",EMPTABCONFIGS);\r\n\t\t\tif(in_array('emp_salary',$empOrganizationTabs))\r\n\t\t\t{\r\n\t\t\t\t$auth = Zend_Auth::getInstance();\r\n\t\t\t\tif($auth->hasIdentity()){\r\n\t\t\t\t\t\t\t$loginUserId = $auth->getStorage()->read()->id;\r\n\t\t\t\t} \t\r\n\t\t\t\t$id = $loginUserId;\r\n\t\t\t\t$callval = $this->getRequest()->getParam('call');\r\n\t\t\t\tif($callval == 'ajaxcall')\r\n\t\t\t\t\t$this->_helper->layout->disableLayout();\r\n\t\t\t\t\r\n\t\t\t\t$objName = 'mydetails';\r\n\t\t\t\t$empsalarydetailsform = new Default_Form_empsalarydetails();\r\n\t\t\t\t$empsalarydetailsform->removeElement(\"submit\");\r\n\t\t\t\t$elements = $empsalarydetailsform->getElements();\r\n\t\t\t\tif(count($elements)>0)\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach($elements as $key=>$element)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(($key!=\"Cancel\")&&($key!=\"Edit\")&&($key!=\"Delete\")&&($key!=\"Attachments\")){\r\n\t\t\t\t\t\t$element->setAttrib(\"disabled\", \"disabled\");\r\n\t\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 \r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tif($id)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$employeeModal = new Default_Model_Employee();\r\n\t\t\t\t\t\t$empdata = $employeeModal->getsingleEmployeeData($id);\r\n\t\t\t\t\t\tif($empdata == 'norows')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t $this->view->rowexist = \"norows\";\r\n\t\t\t\t\t\t $this->view->empdata = \"\";\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->view->rowexist = \"rows\";\r\n\t\t\t\t\t\t\tif(!empty($empdata))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$empsalarydetailsModal = new Default_Model_Empsalarydetails();\r\n\t\t\t\t\t\t\t\t$usersModel = new Default_Model_Users();\r\n\t\t\t\t\t\t\t\t$currencymodel = new Default_Model_Currency();\r\n\t\t\t\t\t\t\t\t$accountclasstypemodel = new Default_Model_Accountclasstype();\r\n\t\t\t\t\t\t\t\t$bankaccounttypemodel = new Default_Model_Bankaccounttype();\r\n\t\t\t\t\t\t\t\t$payfrequencyModal = new Default_Model_Payfrequency();\r\n\t\t\t\t\t\t\t\t$data = $empsalarydetailsModal->getsingleEmpSalaryDetailsData($id);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t if(!empty($data))\r\n\t\t\t\t\t\t\t\t{\t\r\n\r\n\t\t\t\t\t\t\t\t\tif(isset($data[0]['currencyid']) && $data[0]['currencyid'] !='')\r\n\t\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$currencyArr = $currencymodel->getCurrencyDataByID($data[0]['currencyid']);\r\n\t\t\t\t\t\t\t\t\t\tif(sizeof($currencyArr)>0)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$empsalarydetailsform->currencyid->addMultiOption($currencyArr[0]['id'],$currencyArr[0]['currencyname'].' '.$currencyArr[0]['currencycode']);\r\n\t\t\t\t\t\t\t\t\t\t\t$data[0]['currencyid']= $currencyArr[0]['currencyname'];\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t $data[0]['currencyid'] =\"\";\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(isset($data[0]['accountclasstypeid']) && $data[0]['accountclasstypeid'] !='')\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$accountclasstypeArr = $accountclasstypemodel->getsingleAccountClassTypeData($data[0]['accountclasstypeid']);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tif(sizeof($accountclasstypeArr)>0 && $accountclasstypeArr!='norows')\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$empsalarydetailsform->accountclasstypeid->addMultiOption($accountclasstypeArr[0]['id'],$accountclasstypeArr[0]['accountclasstype']);\r\n\t\t\t\t\t\t\t\t\t\t\t $data[0]['accountclasstypeid']=$accountclasstypeArr[0]['accountclasstype'];\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t $data[0]['accountclasstypeid'] =\"\";\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(isset($data[0]['bankaccountid']) && $data[0]['bankaccountid'] !='')\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$bankaccounttypeArr = $bankaccounttypemodel->getsingleBankAccountData($data[0]['bankaccountid']);\r\n\t\t\t\t\t\t\t\t\t\tif($bankaccounttypeArr !='norows')\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$empsalarydetailsform->bankaccountid->addMultiOption($bankaccounttypeArr[0]['id'],$bankaccounttypeArr[0]['bankaccounttype']);\r\n\t\t\t\t\t\t\t\t\t\t\t $data[0]['bankaccountid']=$bankaccounttypeArr[0]['bankaccounttype'];\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t $data[0]['bankaccountid'] =\"\";\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(isset($data[0]['salarytype']) && $data[0]['salarytype'] !='')\r\n\t\t\t \t\t\t\t\t\t{\r\n\t\t\t\t\t \t\t\t\t\t$payfreqData = $payfrequencyModal->getActivePayFreqData($data[0]['salarytype']);\r\n\t\t\t\t\t\t\t\t\t\tif(sizeof($payfreqData) > 0)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tforeach ($payfreqData as $payfreqres){\r\n\t\t\t\t\t\t\t\t\t\t\t\t$empsalarydetailsform->salarytype->addMultiOption($payfreqres['id'],$payfreqres['freqtype']);\r\n\t\t\t\t\t\t\t\t\t\t\t\t $data[0]['salarytype']=$payfreqres['freqtype'];\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t $data[0]['salarytype']=\"\";\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t \t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$empsalarydetailsform->populate($data[0]);\r\n\r\n\t\t\t\t\t\t\t\t\tif($data[0]['accountholding'] !='')\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$accountholding = sapp_Global::change_date($data[0][\"accountholding\"], 'view');\r\n\t\t\t\t\t\t\t\t\t\t$empsalarydetailsform->accountholding->setValue($accountholding);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t if(!empty($data[0]['salary'])){\r\n\t\t\t\t\t\t\t\t\t if($data[0]['salary'] !='')\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t $data[0]['salary']=sapp_Global:: _decrypt( $data[0]['salary']);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$data[0]['salary']=\"\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t$this->view->controllername = $objName;\r\n\t\t\t\t\t\t\t\t$this->view->actionname = 'salarydetails';\t//Edit action name....\r\n\t\t\t\t\t\t\t\t$this->view->data = $data;\r\n\t\t\t\t\t\t\t\t$this->view->id = $id;\r\n\t\t\t\t\t\t\t\t$this->view->form = $empsalarydetailsform;\r\n\t\t\t\t\t\t\t\t$this->view->employeedata = $empdata[0];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$this->view->empdata = $empdata; \t\r\n\t\t\t\t\t\t\t$this->view->editPrivilege = $this->mydetailsobjPrivileges; \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\tcatch(Exception $e)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->view->rowexist = \"norows\";\r\n\t\t\t\t}\r\n }\r\n else\r\n\t\t\t{\r\n\t\t \t $this->_redirect('error');\r\n\t\t }\r\n }\r\n\t\telse\r\n\t\t{\r\n\t\t \t$this->_redirect('error');\r\n\t\t} \t\t\t\r\n\t}", "function events(){\n if(!$this->session->userdata('logged_in') || $this->session->userdata('role') != 'student'):\n redirect('/');\n endif;\n\n $data = array(\n 'events' => $this->admin_model->browse(array('module' => 'events'))\n );\n //load content\n $this->template->content->view('/students/content/events', $data);\n\n //add js file\n $this->template->publish('layouts/app');\n }", "public function eventLoader(Request $request)\n {\n $invoiceId = $request->tempInv;\n $standard = $request->standard;\n $today = Carbon::now()->toDateString();\n\n \n\n $events = DB::table('events')\n ->whereNotExists(function ($query) use($invoiceId) {\n $query->select(DB::raw('*'))\n ->from('temp_invoices_custom_items')\n ->whereRaw('temp_invoices_custom_items.event_id = events.event_id AND temp_invoices_custom_items.invoice_id=?')->setBindings([$invoiceId]) ;\n })\n ->where('end_date','>=',$today) \n ->where('standard',$standard)\n ->where('branch',Auth::user()->branch)\n ->orderBy('start_date')\n ->get();\n ?>\n <select class=\"col-md-3 col-sm-3\" name=\"event_id\" id=\"event_id\" > <option value=\"0\">Select Event</option> \n <?php \n foreach($events AS $event) { ?>\n <option value=\"<?php echo $event->event_id; ?>\" ><?php echo $event->title; ?></option>\n <?php } ?> \n </select> \n <?php\n }", "public function view_employee_info($id=Null)\n\t{\n\t\t$data['employee'] = $this->Employee_model->employee_by_id($id);\n\t\t$this->load->view('admin/employee/view_employee', $data);\n\t}", "public function show(Emprendedore $emprendedore)\n {\n //\n }", "function ShowEvents()\n {\n $this->ReadEvents();\n echo\n $this->H(1,$this->MyLanguage_GetMessage(\"Events_Table_Title\")).\n $this->EventsHtmlTable(),\n \"\";\n }", "public function employee_leave_report_show_in_table() {\n if (get_user_permission('reports/hr_report/employee_leave_report/employee_leave_report') === false) {\n redirect(base_url('user_login'));\n }\n\n $year = trim($this->input->post('year'));\n if (empty($year)) {\n echo \"<div class='error-message text-align-center'>Please Select Year.</div>\";\n } else {\n $this->session->set_userdata('year_session', $year);\n $year_session = $this->session->userdata('year_session');\n $employee_id = trim($this->input->post('employee_id'));\n $employee = $this->Employee_Model->get_employee($employee_id);\n if (!empty($employee)) {\n $employee_name = $employee->employee_name;\n } else {\n $employee_name = 'All';\n }\n $employee_total_leave_by_year = $this->get_employee_total_leave_by_year($employee_id, $year);\n $this->data['employee_total_leave_by_year'] = $employee_total_leave_by_year;\n $this->data['year'] = $year;\n $this->data['employee'] = $employee;\n $this->data['employee_name'] = $employee_name;\n $this->data['company_information'] = $this->Company_Model->get_company();\n $this->load->view('reports/hr_report/employee_leave_report/employee_leave_report_table', $this->data);\n }\n }", "function loadTable(string $filename, array $keys, array $rows = [])\n{\n $filename = RESOURCES_PATH.\"/partials/tables/{$filename}.view.php\";\n\n Validate::var($filename)->fileExists();\n\n return include $filename;\n}", "function calender()\r\n\t{\r\n\t\t$this->erpm->auth();\r\n\t\t$user = $this->auth_pnh_employee();\r\n\t\t\r\n\t\t$role_id=$this->get_jobrolebyuid($user['userid']);\r\n\t\tif($role_id<=3)\r\n\t\t{\r\n\t\t$role_id = $this->get_emproleidbyuid($user['userid']);\r\n\t\t$emp_id = $this->get_empidbyuid($user['userid']);\r\n\t\t$sub_emp_ids=$this->get_subordinates($this,$role_id,$emp_id);\r\n\t\t$territory_list=$this->load_territoriesbyemp_id($emp_id,$role_id);\r\n\t\t$t_sub_emp_ids = $sub_emp_ids;\r\n\t\t$get_locationbyempid = $this->assigned_location($emp_id);\r\n\t\t\r\n\t\tarray_push($t_sub_emp_ids,$emp_id);\r\n\t \t$terry_id = $this->input->post('view_byterry');\r\n\t\t$emp_sub_list = array();\r\n\t\t$sql=\"SELECT a.employee_id,a.employee_id AS id,IFNULL(b.parent_emp_id ,0) AS parent,a.name as employee_name, a.name\r\n\t\t\t\tFROM m_employee_info a\r\n\t\t\t\tLEFT JOIN m_employee_rolelink b ON b.employee_id=a.employee_id and b.is_active = 1 \r\n\t\t\t\tWHERE a.is_suspended=0 and a.employee_id IN (\".implode(',',$t_sub_emp_ids).\")\r\n\t\t\t\";\r\n\t\t\t\t\r\n $res=$this->db->query($sql);\r\n\t\tif($res->num_rows())\r\n\t\t{\r\n\t\t\t$emp_sub_list=$res->result_array();\r\n\t\t}\r\n\t\t\r\n\t\t$task_list=$this->db->query('SELECT task,asgnd_town_id,assigned_to,b.town_name,c.name,a.on_date \r\n\t\t\t\t\t\t\t\t\t\t\tFROM pnh_m_task_info a\r\n\t\t\t\t\t\t\t\t\t\t\tJOIN pnh_towns b ON b.id=a.asgnd_town_id\r\n\t\t\t\t\t\t\t\t\t\t\tJOIN m_employee_info c ON c.employee_id=a.assigned_to\r\n\t\t\t\t\t\t\t\t\t\t\twhere a.assigned_to = ? and c.is_suspended=0',$emp_id)->result_array();\r\n\t\t$this->load->plugin('yentree_pi');//plugin to create employeeTree \r\n\t\t$emp_sub_list[0]['parent']=0;\r\n\t\t$data['emp_tree_config']=build_yentree($emp_sub_list);\r\n\t\t\r\n\t\tunset($emp_sub_list[0]);\r\n\t\t$emp_sub_list = array_values($emp_sub_list);\r\n\t\t\r\n\t\t$data['emp_sub_list']=$emp_sub_list;\r\n\t\t$data['get_locationbyempid']=$get_locationbyempid;\r\n\t\t$data['territory_list']=$territory_list;\r\n\t\t$data['task_list']=$task_list;\r\n\t\t$data['page']=\"calender\";\r\n\t\t$this->load->view(\"admin\",$data);\r\n\t\t\r\n\t\t}\r\n\t\telse \r\n\t\t\tshow_error(\"Access Denied\");\r\n\t}", "public function showEventsTable() {\r\n\t\t$stmt = $this->connect()->query(\"SELECT * FROM event\");\r\n\t\techo \"<h3>Event Table</h3>\";\r\n\t\techo \"<table><tr><td>\" . \"id\" . \"</td><td>\" . \"competition_id\" . \"</td><td>\" . \"name\" . \"</td><td>\" . \"score\" . \"</td><td>\" . \"time\" . \"</td><td>\" . \"tie_break\" . \"</td></tr>\";\r\n\t\twhile ($row = $stmt->fetch()) {\r\n\t\t\techo \"<tr><td>\" . $row['id'] . \"</td><td>\" . $row['competition_id'] . \"</td><td>\" . $row['name'] . \"</td><td>\" . $row['score'] . \"</td><td>\" . $row['time'] . \"</td><td>\" . $row['tie_break'] . \"</td></tr>\"; \r\n\t\t}\r\n\t\techo \"</table>\";\r\n\t}", "function view_new(){\n echo \"<tr onclick='record.select(this)' id='{$this->entity->name}'>\";\n //\n //loop through the column and out puts its td element.\n foreach ($this->entity->columns as $col){\n //\n //Get the tds for every column\n echo $col->view();\n }\n //\n echo \"</tr>\";\n }", "public function getEmployeeInfo() {\n\n $employeeModel = $GLOBALS[\"employeeModel\"];\n\n $GLOBALS[\"employee\"] = $employeeModel->getOneByEmployeeID($_SESSION[\"workerID\"]);\n }", "public function editevent($id)\n {\n $row=DB::table('pmodels')->where('id',$id)->first();\n $data=['info'=>$row];\n return view('editevent',$data);\n }", "public function loadroledataentryAction(){\n $roles=Doctrine_Query::create()\n\t ->select(\"r.ID, r.role\")\n\t ->from(\"Roles r\")\n\t ->where(\"r.ID=?\",Constants::DATAENTRY_INTERNO)\n \t ->execute(null,Doctrine::HYDRATE_ARRAY);\n $this->emitTableResult($roles);\n }", "function viewEmployeeDetails( Request $request )\n\t\t\t{\n\t\t\t\tif ( $this->employeeExists( $request->emp_id ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$id = $request->emp_id;\n\n\t\t\t\t\t\treturn [ Employee::find( $id )->makeHidden( ['password', 'created_at', 'updated_at'] ), [ 'meta_details' => EmployeeMeta::select( 'address','contact' )->where( 'employee_id' , $id )->get() ] ];\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t}", "public function edit()\r\n {\r\n $employeedataf = DB::table('employee')\r\n ->join('familybackground','employee.emp_id', '=', 'familybackground.emp_id')\r\n ->where('familybackground.emp_id', Auth::user()->username)\r\n ->first();\r\n\r\n $employeedatachild = DB::table('employee')\r\n ->join('children', 'employee.emp_id', '=', 'children.emp_id')\r\n ->where('children.emp_id', Auth::user()->username)\r\n ->get();\r\n\r\n $employeedatawork = DB::table('employee')\r\n ->join('workexperience', 'employee.emp_id', '=', 'workexperience.emp_id')\r\n ->where('workexperience.emp_id', Auth::user()->username)\r\n ->get();\r\n\r\n $employeedataeduc = DB::table('employee')\r\n ->join('educationalbackground', 'employee.emp_id', '=', 'educationalbackground.emp_id')\r\n ->where('educationalbackground.emp_id', Auth::user()->username)\r\n ->get();\r\n\r\n $employeedatacivil = DB::table('employee')\r\n ->join('civilserviceeligibility', 'employee.emp_id', '=', 'civilserviceeligibility.emp_id')\r\n ->where('civilserviceeligibility.emp_id', Auth::user()->username)\r\n ->get();\r\n $employeedatavol = DB::table('employee')\r\n ->join('voluntary_works', 'employee.emp_id', '=', 'voluntary_works.emp_id')\r\n ->where('voluntary_works.emp_id', Auth::user()->username)\r\n ->get();\r\n\r\n $employeedatatrain = DB::table('employee')\r\n ->join('trainings', 'employee.emp_id', '=', 'trainings.emp_id')\r\n ->where('trainings.emp_id', Auth::user()->username)\r\n ->get();\r\n\r\n $employeedataotherinfo = DB::table('employee')\r\n ->join('other_info', 'employee.emp_id', '=', 'other_info.emp_id')\r\n ->where('other_info.emp_id', Auth::user()->username)\r\n ->get();\r\n\r\n $employeedataposition = DB::table ('employee')\r\n ->join('position', 'employee.position_id', '=', 'position.position_id')\r\n ->where('employee.emp_id', Auth::user()->username)\r\n ->first();\r\n\r\n $employeedatareferences = DB::table('employee')\r\n ->join('references', 'employee.emp_id', '=', 'references.emp_id')\r\n ->where('references.emp_id', Auth::user()->username)\r\n ->get();\r\n\r\n\r\n return view ('Employee.editPdsOfEmp') ->with (\"employeedatachild\", $employeedatachild)->with (\"employeedataf\", $employeedataf)->with(\"employeedatawork\", $employeedatawork)->with(\"employeedataeduc\", $employeedataeduc)->with(\"employeedatacivil\", $employeedatacivil)->with('employeedatavol', $employeedatavol)->with('employeedatatrain', $employeedatatrain)->with('employeedataotherinfo', $employeedataotherinfo)->with('employeedatareferences', $employeedatareferences);\r\n }", "function resumeHistory()\r\n\t{\t\r\n\t\tif( !$this->session->userdata('emp_id') )\r\n\t\t\tredirect('ado/Employer/logout','refresh'); \r\n\t\t$data['history'] = $this->Employer_model->getResumeViewHistory();\r\n\t\t//echo \"<pre />\"; print_r($data); die();\r\n\t\t$this->load->view('admin/include/emp_header'); \r\n\t\t$this->load->view('admin/employer/resume_history',$data); \r\n\t $this->load->view('admin/include/footer');\t\t \t\r\n\t}", "private function _loadDataToTemporaryTable(){\n\n }", "private function listEmployee()\n\t{\n\t\t$employees = $this->employee->getEmployee();\n\t\t$cnt = 1;\n\t\tforeach($employees as $key => $val)\n\t\t{\n\t\t\t$arr = array('CNT' => $cnt,\n\t\t\t\t\t\t 'EMPLOYEE_NAME' => $val['name_employee'],\n\t\t\t\t\t\t 'EMPLOYEE_ID' => $val['id_employee'],\n\t\t\t\t\t\t 'EMPLOYEE_MAIL' => $val['mail_employee']);\n\t\t\t$cnt ++;\n\t\t\t$this->view->addToReplace($arr);\n\t\t\t$this->arrRender['LISTEMPLOYEES'] .= $this->view->\n\t\t\tsetTemplateFile('employeeslist')->renderFile();\n\t\t}\n\t}", "public function get_employees() {\n\n\t\t$data['title'] = $this->Xin_model->site_title();\n\t\t$id = $this->uri->segment(4);\n\t\t\n\t\t$data = array(\n\t\t\t'company_id' => $id\n\t\t\t);\n\t\t$session = $this->session->userdata('username');\n\t\tif(!empty($session)){ \n\t\t\t$this->load->view(\"admin/assets/get_employees\", $data);\n\t\t} else {\n\t\t\tredirect('admin/');\n\t\t}\n\t\t// Datatables Variables\n\t\t$draw = intval($this->input->get(\"draw\"));\n\t\t$start = intval($this->input->get(\"start\"));\n\t\t$length = intval($this->input->get(\"length\"));\n\t }", "public function user_event() {\n $this->loadModel('Image');\n $id = $this->Auth->user('id');\n $this->layout = 'front_end';\n $allImage = $this->Image->getAllimage($id);\n $this->set('image', $allImage);\n $data = $this->User->userData($id);\n $this->set('user', $data);\n $this->loadModel('Event');\n $event = $this->Event->eventList();\n $this->set('events', $event);\n $this->render('/Users/user_event');\n }", "public function officerHistoryView(){\n $this->view('auditor/officerHistoryView');\n \n $this->view->render(); // This is how load the view\n }", "public function index($event_id = NULL)\r\n\t{\r\n\t\tif ($this->model('User_model')->isLoggedIn() == false) {\r\n\t\t\theader('Location:'.ROOTURL.'/signin');\r\n\t\t}\r\n\t\t//===================================================\r\n\r\n\t\tif (!isset($event_id)) {\r\n\t\t\theader('Location:'.ROOTURL);\r\n\t\t}\r\n\r\n\r\n\t\t// Get event detail from db\r\n\t\t$data['event'] = $this->model('Events_model')->getEventDetailById($event_id);\r\n\t\t// var_dump($data['event']);\r\n\r\n\t\t//====================================================\r\n\t\t$data['eventid'] = $event_id;\r\n\r\n\t\tif ($data['event']==NULL) {\r\n\t\t\t$data['title'] = 'Karcisku - Unknown Event Id';\r\n\t\t\t$this->view('template/header',$data);\r\n\t\t\t$this->view('template/navigation');\r\n\t\t\t$this->view('event/notfound',$data);\r\n\t\t\t$this->view('template/footer');\r\n\t\t}else{\r\n\t\t\t$data['title'] = 'Karcisku - Event Detail';\r\n\t\t\t$this->view('template/header',$data);\r\n\t\t\t$this->view('template/navigation');\r\n\t\t\t$this->view('event/index',$data);\r\n\t\t\t$this->view('template/footer');\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}", "public function load_insert_img_view(){\r\n $data;\r\n if(!empty($_POST['id'])){\r\n\r\n $result=$this->Events_Model->get_all($this->table,$_POST['id']);\r\n $this->event_info=$result->fetch_assoc();\r\n $data=$this->load->view('admin/event/admin_add_event',$this->event_info,TRUE);\r\n }\r\n\r\n else{\r\n $data=$this->load->view('admin/event/admin_add_event',\"\",TRUE);\r\n }\r\n\r\n echo json_encode(array(\"view\"=>$data));\r\n\r\n }", "public function actionView() {\n\n $data = $this->data;\n\n if ($data['employee'] == \"All\") {\n\n $services = Employee::find()->all();\n $service_data = [];\n\n foreach ($services as $value) {\n $service_data[] = [\n \"id\" => $value['id'],\n \"employee_code\" => $value->employee_code,\n \"employee_name\" => $value->employee_name,\n \"employee_email\" => $value->employee_email,\n \"department_id\" => $value->department_id,\n \"department_name\" => $value->department->department_name,\n \"created\" => $value->created,\n \"updated\" => $value->updated,\n \"address\" => $this->GetEmpAddress($value->employeeAddresses)\n ];\n }\n if (!empty($service_data)) {\n echo $this->messageReturn(\"success\", 200, $service_data);\n } else {\n echo $this->messageReturn(\"error\", 400, \"\", \"No Data Found\");\n }\n } else {\n echo $this->messageReturn(\"failed\", 201, \"\", \"Please send all parameter\");\n }\n exit;\n }", "function getdata()\n{\n $conn=get_connection();\n //for all Event\n $sql=\"SELECT * FROM `events`\";\n $eventresult=$conn->query($sql);\n while($eventrow=$eventresult->fetch_assoc())\n {\n $name=$eventrow[\"eventname\"];\n $id=$eventrow[\"eventid\"];\n ?>\n <div class=\"panel panel-default\">\n <div class=\"panel-heading\">\n <?php\n echo \"<h4>$name</h4>\";\n ?>\n </div>\n <div class=\"panel-body table-responsive\">\n <table class=\"table\">\n <tr><th>Name</th><th>College</th><th>Phone Number</th></tr>\n <?php\n $reg=\"SELECT * FROM `registration` WHERE `eventid`='$id'\";\n $q=$conn->query($reg);\n while($r=$q->fetch_assoc())\n {\n $name=$r[\"name\"];\n $cname=$r[\"cname\"];\n $pn=$r[\"phone\"];\n echo \"<tr><td>$name</td><td>$cname</td><td>$pn</td></tr>\";\n }\n ?>\n </table>\n </div>\n </div>\n <?php\n }\n $conn->close();\n}", "public function retrieveEventData(Request $request){\n $locale = $request->getLocale();\n $eveId = $request->get('id');\n $em = $this->em;\n $currentUser = $this->user;\n /** @var Event */\n $event = $em->getRepository(Event::class)->find($eveId);\n $data['sid'] = $event->getStage()->getId();\n $data['if'] = $event->getStage()->getUserMasters()->exists(fn(int $i, UserMaster $m) => $m->getProperty() == 'followableStatus' && $m->getType() == UserMaster::ADDED && $m->getUser() == $this->user);\n $isExt = $event->getOrganization() != $this->org;\n if($isExt){\n $data['ext'] = 1;\n }\n $data['sname'] = $event->getStage()->getName();\n if($isExt){\n $data['type'] = $em->getRepository(EventType::class)->getDTrans($event->getEventType(),$locale,$event->getOrganization());\n $data['group'] = $em->getRepository(EventGroup::class)->getDTrans($event->getEventType()->getEventGroup(),$locale,$event->getOrganization());\n } else {\n $data['type'] = $event->getEventType()->getEName()->getId();\n $data['group'] = $event->getEventType()->getEventGroup()->getEventGroupName()->getId();\n }\n $data['odate'] = $event->getOnsetDate();\n $data['expResDate'] = $event->getExpResDate();\n $tz = new DateTimeZone('Europe/Paris');\n foreach($event->getDocuments() as $document){\n $docData = [];\n $docData['id'] = $document->getId();\n $docData['title'] = $document->getTitle();\n $docData['path'] = $document->getPath();\n $docData['type'] = $document->getType();\n $docData['mime'] = $document->getMime();\n $docData['size'] = $document->getSize();\n $docData['authors'] = $document->getDocumentAuthors()->count() > 0 ? $document->getDocumentAuthors()->map(fn(DocumentAuthor $da) => ['mainAuthor' => $da->isLeader(), 'fullname' => $da->getAuthor()->getFullName(), 'id' => $da->getAuthor()->getId()])->getValues()[0] : '';\n $docData['inserted'] = $document->getInserted()->setTimezone($tz);\n $docData['oid'] = $document->getOrganization()->getId();\n $docData['modified'] = $document->getModified() ? $document->getModified()->setTimezone($tz) : \"\";\n $data['documents'][] = $docData;\n }\n\n foreach($event->getParentComments() as $comment){\n $comData = [];\n $comData['id'] = $comment->getId();\n $comData['self'] = $comment->getAuthor() == $currentUser;\n $comData['author'] = $comment->getAuthor()->getFullName();\n $comData['content'] = $comment->getContent();\n $comData['inserted'] = $this->nicetime($comment->getInserted()->setTimezone($tz), $locale);\n $comData['modified'] = $comment->getModified() != null;\n $comData['oid'] = $comment->getOrganization()->getId();\n\n foreach($comment->getReplies() as $reply){\n $replyData = [];\n $replyData['id'] = $reply->getId();\n $replyData['self'] = $reply->getAuthor() == $currentUser;\n $replyData['author'] = $reply->getAuthor()->getFullName();\n $replyData['content'] = $reply->getContent();\n $replyData['inserted'] = $this->nicetime($reply->getInserted()->setTimezone($tz), $locale);\n $replyData['modified'] = $reply->getModified() != null;\n $replyData['oid'] = $reply->getOrganization()->getId();\n $comData['replies'][] = $replyData;\n }\n $data['comments'][] = $comData;\n }\n \n return new JsonResponse($data, 200);\n }", "function export(){\r\n Configure::write('debug',0); \r\n // Find fields needed without recursing through associated models \r\n\t\t$data = $this->Registration->find('all', array('conditions' => array('Event.id' => 2), 'contain' => false));\r\n\t\t// Make the data available to the view (and the resulting CSV file) \r\n $this->set(compact('data')); \t\r\n\r\n\t}", "public function loadprossimi()\n {\n $sql=\"SELECT * FROM \".static::getTables().\" ORDER BY data_e ;\";\n $result = parent::loadMultiple($sql);\n $eventi = array();\n if(($result!=null) && (count($eventi)<=5)){\n foreach($result as $i) {\n $datluogo = FLuogo::getInstance();\n $luogo = $datluogo->loadById($i['id_luogo']);\n $datcategoria = FCategoria::getInstance();\n $categoria = $datcategoria->loadById($i['id_categoria']);\n $evento = new EEvento_p($i['nome'], new DateTime( $i['data_e'] ) ,\n $luogo, $categoria, $i['descrizione'],$i['prezzo'],$i['posti_disponibili'],$i['posti_totali']);\n $evento->setId($i['id']);\n echo $evento->getF();\n array_push($eventi, $evento);\n }\n return $eventi;\n }\n else return null;\n }", "private function display_custom_events_table()\n\t{\n\t\t// Show the custom PHP events\n\t\t// Firstly, convert our custom event list to a proper map\n\t\t$map = [];\n\n\t\t// Sort alphabetically\n\t\tksort($this->custom_php_events);\n\n\t\tforeach ($this->custom_php_events as $extension => $events)\n\t\t{\n\t\t\tksort($events);\n\n\t\t\t// Grab each event\n\t\t\tforeach ($events as $event)\n\t\t\t{\n\t\t\t\t$map[] = [$extension, $event];\n\t\t\t}\n\t\t}\n\n\t\t// Show the table\n\t\t$table_header = [$this->language->lang('CLI_EXTENSION_EVENTS_EXTENSION_NAME'), $this->language->lang('CLI_EXTENSION_EVENTS_NAME')];\n\t\t$this->render_table($table_header, $map);\n\t}", "private function add_events()\r\n {\r\n $events = $this->events;\r\n foreach ($events as $time => $items)\r\n {\r\n $column = date('H', $time) / $this->hour_step + 1;\r\n foreach ($items as $item)\r\n {\r\n $content = $item['content'];\r\n $row = $item['index'] + 1;\r\n \r\n $cell_content = $this->getCellContents($row, $column);\r\n $cell_content .= $content;\r\n $this->setCellContents($row, $column, $cell_content);\r\n }\r\n }\r\n \r\n }", "function fileview($status)\n{\n\t/*\n\tbring in global variables ($q is the appiontment id, $sid is the id of the student\n\t$hint is the output variable that has already been created by the calling page, the file upload will be appended\n\tto that variable\n\t*/\n\tglobal $q,$hint,$sid;\n\t//set part1 to be blank\n\t$part1=\"\";\n\t//set part 2 to be blank\n\t$part2=\"\";\n\t\n\t//if the appointment is still open, create the form for uploading files and attach it to $hint\n\tif ($status==\"open\")\n\t{\n\t\t$hint=$hint.'\n\t\t\t<p >File Upload:</p>\n\t\t\t<form action=\"add_file.php\" method=\"post\" enctype=\"multipart/form-data\">\n\t\t\t<input type=\"file\" name=\"uploaded_file\"><br>\n\t\t\t<input type=\"submit\" value=\"Upload file\">\n\t\t\t<input type=\"hidden\" name=\"apptid\" id=\"apptid\" value=\"'.$q.'\"/>\n\t\t\t<input type=\"hidden\" name=\"studentid\" id=\"studentid\" value=\"'.$sid.'\"/>\n\t\t\t</form>\n\t\t\t<br/><br/>';\n\t}\n\t//create title for uploaded files and attach to $hint\n\t$hint=$hint.'<p><u>Uploaded Files:</u><br/>';\n\t// Query for a list of all existing files and format the date\n\t$sql = \"select *,Date_FORMAT(created,'%Y-%d-%m %h:%m %p') as created from file where apptid = \".$q;\n\t//run the query\n\t$result = @mysql_query($sql);\n\t// Check if it was successfull\n\tif (@mysql_num_rows($result) !=0) \n\t{//open php rows if\n \t\t// Print the top of a table\n $part1= '<table>\n <tr>\n\t\t\t\t\t<td></td>\n <td><b>Name</b></td>\n <td><b>Size (bytes)</b></td>\n <td><b>Created</b></td>\n <td><b>&nbsp;</b></td>\n </tr>';\n \n\t\twhile ($row = @mysql_fetch_assoc($result))\n\t\t{//open php while\n\t\t\n\t\t\t//pick icon\n\t\t\t//set $mime to be the mimetype of the file in the db\n\t\t\t$mime=$row['mime'];\n\t\t\t//check to see if the uploaded files matches the description of the known file types\n\t\t\t$position1 = substr_count($mime, 'word');\n\t\t\t$position2= substr_count($mime, 'text');\n\t\t\t$position3 = substr_count($mime, 'pdf');\n\t\t\t$position4 = substr_count($mime, 'presentation');\n\t\t\t$position5 = substr_count($mime, 'spre');\n\t\t\tif ($position1 != 0)\n\t\t\t{\n\t\t\t\t$iconLocation = \"./icons/doc.bmp\";\n\t\t\t\t$doctype = \"Word Document\";\n\t\t\t}\n\t\t\telse\n\t\t\tif ($position2 != 0)\n\t\t\t{\n\t\t\t\t$iconLocation = \"./icons/text.bmp\";\n\t\t\t\t$doctype = \"Text Document\";\n\t\t\t}\n\t\t\telse\n\t\t\tif ($position3 != 0)\n\t\t\t{\n\t\t\t\t$iconLocation = \"./icons/pdf.bmp\";\n\t\t\t\t$doctype = \"PDF\";\n\t\t\t}\n\t\t\telse\n\t\t\tif ($position4 != 0)\n\t\t\t{\n\t\t\t\t$iconLocation = \"./icons/ppt.bmp\";\n\t\t\t\t$doctype = \"PowerPoint Document\";\n\t\t\t}\n\t\t\telse\n\t\t\tif ($position5 != 0)\n\t\t\t{\n\t\t\t\t$iconLocation = \"./icons/xls.bmp\";\n\t\t\t\t$doctype = \"Excel Document\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$iconLocation = \"./icons/file.bmp\";\n\t\t\t\t$doctype = \"Document\";\n\t\t\t}\n\t\t\t//once icon is determined, create the link and output file info in the table, do for each file found during loop\n\t\t\t$part2=$part2. \"\n <tr>\n\t\t\t\t\t<td align='right'><a href='get_file.php?id={$row['id']}'><img src='\".$iconLocation.\"' title='\".$doctype.\"' width='25' height='25' /></a></td>\n <td align='left'>{$row['name']}</td>\n <td>{$row['size']}</td>\n <td>{$row['created']}</td>\n <td><a href='get_file.php?id={$row['id']}'>Download</a></td>\n\t\t\t\t\t\";\n\t\t\tif($status == \"open\")\n\t\t\t{\n\t\t\t\t//if the appointment is still open, give link for deleting file, no file deleting after appointment is closed\n\t\t\t\t$part2=$part2.\"<td><a href='delete_file.php?id={$row['id']}&student=\".$sid.\"'>Delete</a></td>\";\n\t\t\t}\n $part2=$part2.\"</tr>\";\n\t\t}//close php while\n\t\t// Close table\n $part3='</table>';\n\t\t//add all parts to $hint\n\t\t$hint=$hint.$part1.$part2.$part3;\n\t}//close php rows if\n\t//if no files have been uploaded\n\telse\n\t{\t\n\t\t$hint=$hint.\"No uploaded files found for appointment number \".$q;\n\t}\n\t\n}", "protected function readDataRecords()\n {\n \tparent::readDataRecords();\n\n \tforeach ($this->file_contents->Activities->Activity->Lap->Track->Trackpoint as $theSeg) {\n \t\n \t\t$data['Time']=$theSeg->Time;\n \t\t$data['Ele']=$theSeg->AltitudeMeters;\n \t\t$data['Dist']=$theSeg->DistanceMeters/1000;\n \t\t$data['Cadence']=$theSeg->Cadence;\n \t\t$data['Heart']=$theSeg->HeartRateBpm->Value;\n \t\t$data['Lat']=$theSeg->Position->LatitudeDegrees;\n \t\t$data['Long']=$theSeg->Position->LongitudeDegrees;\n \t\n \t\n \t\t$this->addData($data);\n \t\t\t\n \t}\n \t$this->makeSession();\n \n }", "public function populateEmployees(){\n $list = $this->employee->get_employees();\n $data = array();\n foreach ($list as $employee) {\n $row = array();\n $row[] = '<td class=\"min-width nowrap\"><input type=\"checkbox\" value=\"'.$employee->employeeID.'\"></td>';\n $row[] = \"#\".$employee->employeeID;\n $row[] = $employee->name;\n $row[] = '<a href=\"mailto:'.$employee->email.'\">'.$employee->email.'</a>';\n $row[] = $employee->mobile;\n $row[] = $employee->employeeCode;\n $row[] = $employee->managerName;\n $row[] = $employee->departmentName;\n $row[] = $employee->companyName;\n $row[] = $employee->designation;\n $row[] = $employee->address;\n $row[] = $employee->panCard;\n $row[] = $employee->aadharCard;\n\t\t\t$row[] ='<td class=\"nowrap\"><p>\n\t\t\t\t\t<span class=\"btn-xs btn fa fa-edit\" onclick=\"updateClick('.$employee->employeeID.');\"></span> \n\t\t\t\t\t<a class=\"btn-secondary btn-xs fa fa-eye\" href=\"/admin/employee/'.$this->encrypt->encode($employee->employeeID).'\"></a>\n\t\t\t\t\t</p></td>';\n\t\t\t\n array_push($data, $row);\n }\n \n $output = array(\n\t\t\t\"draw\" => $_POST['draw'],\n\t\t\t\"recordsTotal\" => $this->employee->count_all(),\n\t\t\t\"recordsFiltered\" => $this->employee->count_filtered(),\n\t\t\t\"data\" => $data,\n\t\t);\n echo json_encode($output);\n }", "private function includeFile($viewfilename) {\r\n\t\t$this->load($viewfilename);\r\n\t}", "public function fillDetailsFromDB()\n {\n // Create a db instance\n $db = new Database();\n // Create an admin DB connection to get data from Events_Details table\n $adminDB = $db->getAdminDBConnection();\n // Query database for eid and get all details\n $query = \"SELECT * FROM Event_Details WHERE EID='\" . $this->eid . \"';\";\n // Prepare query statement\n $stmt = $adminDB->prepare($query);\n // Execute query\n $stmt->execute();\n // Fetch a row\n $result = $stmt->fetch();\n // If no row has been returned\n if ($result == false) {\n return false;\n }\n // Fill details\n $this->name = $result['Name'];\n $this->venue = $result['Venue'];\n $this->date = $result['DOE'];\n $this->time = $result['TOE'];\n $this->type = $result['Type'];\n $this->status = $result['Status'];\n return true;\n }", "function detail_table($db, $eventID)\r\n{\r\n $query = \"SELECT * FROM event WHERE startDate >= CURDATE() AND eventID=\".$eventID.\";\"; \t\r\n $result = $db->query($query); \t\t\t\r\n\r\n\r\n\t//use it first for the title\t\r\n $row1 = $result->fetch_array(MYSQLI_BOTH);\t\t\r\n\t\r\n\t//then close it ready for the next execution\r\n $result->close();\t\t\t\t\t\t\t\t\r\n $result = $db->query($query); \t\r\n\r\n\r\n\techo '<br />';\r\n\r\n\r\necho '<table class=\"pizzaOrder\">';\r\n $on = 'this.src=\"../images/buttons/edit_dwn.png\"';\r\n $off = 'this.src=\"../images/buttons/edit_up.png\"';\r\n\r\n echo '<tr>';\r\n\t\techo '<td colspan=\"2\" id=\"headCell_left\"> Event Details for: <font class=\"subtitle\">'.$row1['event_name'].'</font></td>';\r\n\t\techo '<td id=\"headCell_right\">';\r\n\t\techo '<img class=\"button\" src=\"../images/buttons/edit_dwn.png\"';\r\n\t\t\techo 'alt=\"Edit The Selected Event\" onclick=\"editEvent('.$row1['eventID'].')\"';\r\n\t\t\techo 'onmouseover='.$off.' onmouseout='.$on.' /></td>';\r\n\techo '</tr>';\r\n\r\n\t\t\t\t\t\r\n\t//While Loop starts here - \r\n\t// Retrieve the data for the table. There should only be one row.\r\n\twhile($row = $result->fetch_assoc())\r\n\t{\r\n\t\techo '<tr>';\r\n\t\t\techo '<td width=\"150px\"><b>Event Location: </b></td>';\r\n\t\t\techo '<td>'.$row['event_location'].'</td>';\r\n\t\t\techo '<td>&nbsp;</td>';\r\n\t\techo '</tr>';\r\n\r\n\t\techo '<tr>';\r\n\t\t\techo '<td><b>Start Date: </b></td>';\r\n\t\t\techo '<td>'.dateToScreen($row['startDate']).'</td>';\r\n\t\t\techo '<td></td>';\r\n\t\techo '</tr>';\r\n\r\n\t\techo '<tr>';\r\n\t\t\techo '<td><b>Start Time: </b></td>';\r\n\t\t\techo '<td>'.$row['startTime'].'</td>';\r\n\t\t\techo '<td></td>';\r\n\t\techo '</tr>';\r\n\r\n\t\techo '<tr>';\r\n\t\t\techo '<td><b>Server IP Address: </b></td>';\r\n\t\t\techo '<td>'.$row['server_IP_address'].'</td>';\r\n\t\t\techo '<td></td>';\r\n\t\techo '</tr>';\r\n\r\n\t\techo '<tr>';\r\n\t\t\techo '<td><b>Number of Seats: </b></td>';\r\n\t\t\techo '<td>'.$row['seatQuantity'].'</td>';\r\n\t\t\techo '<td></td>';\r\n\t\techo '</tr>';\r\n\r\n\t\t$on = 'this.src=\"../images/buttons/stop_dwn.png\"';\r\n\t\t$off = 'this.src=\"../images/buttons/stop.png\"';\r\n\t\t\r\n\t\t$on1 = 'this.src=\"../images/buttons/start_dwn.png\"';\r\n\t\t$off1 = 'this.src=\"../images/buttons/start.png\"';\r\n\r\n\t\t// If the event has started place the stop event button in the table.\r\n\t\tif($row['event_started'] == 1) \r\n\t\t{\r\n\t\t\techo '<tr>';\r\n\t\t\techo '<td><b>Event Started: </b></td>';\r\n\t\t\techo '<td>Yes</td>';\r\n\t\t\techo '<td><img src=\"../images/buttons/stop_dwn.png\" class=\"button\"'; \r\n\t\t\t\techo 'alt=\"Stop the current event.\" onclick=\"stopEvent(' . $row['eventID'] . ')\" ';\r\n\t\t\t\techo 'onmouseover='.$off.' onmouseout='.$on.' /></td>';\r\n\t\t\techo '</tr>';\r\n\t\t}\r\n\t\t// If the event has not started place the start event button in the table. \r\n\t\t\r\n\r\n\t\t\r\n\t\telseif ($row['event_started'] == 0)\r\n\t\t{\r\n\t\t\techo '<tr>';\r\n\t\t\t\techo '<td><b>Event Started: </b></td>';\r\n\t\t\t\techo '<td>No</td>';\r\n\t\t\t\techo '<td><img src=\"../images/buttons/start_dwn.png\" class=\"button\"';\r\n\t\t\t\t\techo 'alt=\"Start the selected event. Stops all others.\" onclick=\"startEvent(' . $row['eventID'] . ')\"'; \r\n\t\t\t\t\techo 'onmouseover='.$off1.' onmouseout='.$on1.' /></td>';\r\n\t\t\techo '</tr>';\r\n\t\t}\r\n\t\t// If the event has completed or been stopped. \r\n\t\telseif ($row['event_started'] == 2)\r\n\t\t{\r\n\t\t\techo '<tr>';\r\n\t\t\t\techo '<td><b>Event Started: </b></td>';\r\n\t\t\t\techo '<td>Finished</td>';\r\n\t\t\t\techo '<td>&nbsp;</td>';\r\n\t\t\techo '</tr>';\r\n\t\t}\r\n\t}\r\necho '</table>';\r\n}", "public function leave_application_report_show_in_table() { // show in table \n if (get_user_permission('reports/hr_report/employee_leave_report/employee_leave_report') === false) {\n redirect(base_url('user_login'));\n }\n\n $is_show_leave_application_false_list = $this->Leave_application_Model->get_leave_application_by_is_show(FALSE);\n $this->data['is_show_leave_application_false_list'] = $is_show_leave_application_false_list;\n $this->get_leave_application_is_show_true($is_show_leave_application_false_list);\n $this->data['title'] = 'Leave Application Report';\n $this->load->view('header');\n $this->load->view('navigation');\n $this->load->view('reports/hr_report/leave_application_report/leave_application_report_table', $this->data);\n \n }", "public function createEventTable()\n {\n $table = $this->getEventTable();\n $recurr = $this->getRecurrenceTable();\n if (empty($table) || empty($recurr)) {\n return PHPWS_Error::get(CAL_CANNOT_MAKE_EVENT_TABLE, 'calendar',\n 'Calendar_Schedule::createEventTable');\n }\n\n $template['TABLE'] = $table;\n $template['RECURR_TABLE'] = $recurr;\n $template['INDEX_NAME'] = str_replace('_', '', $table) . '_idx';\n $template['RECURR_INDEX_NAME'] = str_replace('_', '', $recurr) . '_idx';\n\n $file = PHPWS_SOURCE_DIR . 'mod/calendar/inc/event_table.sql';\n\n if (!is_file($file)) {\n return PHPWS_Error::get(PHPWS_FILE_NOT_FOUND, 'calendar',\n 'Calendar_Schedule::createEventTable', $file);\n }\n\n $query = PHPWS_Template::process($template, 'calendar', $file, true);\n return PHPWS_DB::import($query);\n }", "function CreateTableEvent(){\r\n\t\t$qry = \"CREATE TABLE IF NOT EXISTS $this->tablename2 (\". \r\n\t\t\t\t\"Eid INT AUTO_INCREMENT,\".\r\n\t\t\t\t\"UuserName CHAR(255) NOT NULL,\".\r\n\t\t\t\t\"Evename VARCHAR(255) NOT NULL,\".\r\n\t\t\t\t\"EstartDate VARCHAR(20) NOT NULL,\".\r\n\t\t\t\t\"EendDate VARCHAR(20) NOT NULL,\".\r\n\t\t\t\t\"Eaddress VARCHAR(255) NOT NULL,\".\r\n\t\t\t\t\"Ecity VARCHAR(50) NOT NULL,\".\r\n\t\t\t\t\"Estate CHAR(10) NOT NULL,\".\r\n\t\t\t\t\"Ezip INT(5) NOT NULL,\".\r\n\t\t\t\t\"EphoneNumber VARCHAR(50),\".\r\n\t\t\t\t\"Edescription VARCHAR(500) NOT NULL,\".\r\n\t\t\t\t\"Etype VARCHAR(26) NOT NULL,\".\r\n\t\t\t\t\"Ewebsite VARCHAR(500) NOT NULL,\".\r\n\t\t\t\t\"Ehashtag CHAR(255),\".\r\n\t\t\t\t\"Efacebook CHAR(255),\".\r\n\t\t\t\t\"Etwitter CHAR(255),\".\r\n\t\t\t\t\"Egoogle CHAR(255),\".\r\n\t\t\t\t\"Eflyer CHAR(255),\".\r\n\t\t\t\t\"Ebanner CHAR(255),\".\r\n\t\t\t\t\"Eother CHAR(255),\".\r\n\t\t\t\t\"EtimeStart CHAR(255),\".\r\n\t\t\t\t\"EtimeEnd CHAR(255),\".\r\n\t\t\t\t\"Elat DECIMAL(10,6),\".\r\n\t\t\t\t\"Elong DECIMAL(10,6),\".\r\n\t\t\t\t\"Erank CHAR(255),\".\r\n\t\t\t\t\"Edisplay INT(1),\".\r\n\t\t\t\t\"PRIMARY KEY(Eid, UuserName)\".\r\n\t\t\t\");\";\r\n\r\n\t\tif(!mysql_query($qry, $this->connection)){\r\n\t\t\t$this->HandleDBError(\"Error creating the table \\nquery was\\n $qry\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function __construct(vevent $event, $from_date, $to_date)\r\n {\r\n //$this_day = date('d', $from_date);\r\n //$this_month = date('m', $from_date);\r\n //$this_year = date('Y', $from_date);\r\n\r\n //For the list view\r\n $date = getdate();\r\n $date_unixtime = mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']);\r\n // TODO: List view needs to start today, not on the last selected date.\r\n// \t$from_date = ($date_unixtime + $to_date) / 2;\r\n \t$this_day = date('d', $from_date);\r\n $this_month = date('m', $from_date);\r\n $this_year = date('Y', $from_date);\r\n// \t$this_day = $date['mday'];\r\n// \t$this_month = $date['mon'];\r\n// \t$this_year = $date['year'];\r\n\r\n $start_month = $date['mon'] - 1;\r\n $start_year = $date['year'];\r\n $end_month = $this_month + 1;\r\n $end_year = $this_year;\r\n\r\n\r\n if ($this_month == 1)\r\n {\r\n $start_month = 12;\r\n $start_year --;\r\n }\r\n if ($this_month == 12)\r\n {\r\n $end_month = 1;\r\n $end_year ++;\r\n }\r\n\r\n $this->event = $event;\r\n $this->view_start = mktime(0, 0, 0, $start_month, 1, $start_year);\r\n $this->view_end = mktime(0, 0, 0, $end_month, 31, $end_year);\r\n\r\n if ($this->debug)\r\n {\r\n echo '<hr />';\r\n echo '<b>ICAL RECURRENCE</b>';\r\n echo '<hr />';\r\n echo '<table class=\"data_table\">';\r\n echo '<thead>';\r\n echo '<tr><th>Variable</td><th>Value</td>';\r\n echo '</thead>';\r\n echo '<tbody>';\r\n echo '<tr><td>Title</td><td>' . $this->event->summary['value'] . '</td>';\r\n echo '<tr><td>View begin</td><td>' . $this->view_start . ' (' . date('r', $this->view_start) . ')</td>';\r\n echo '<tr><td>View end</td><td>' . $this->view_end . ' (' . date('r', $this->view_end) . ')</td>';\r\n // echo '<tr><td>Event</td><td>';\r\n // echo '<pre>';\r\n // echo print_r($this->event, true);\r\n // echo '</pre>';\r\n // echo '</td>';\r\n // echo '</tr>';\r\n echo '</tbody>';\r\n echo '</table>';\r\n }\r\n }", "public function employee_general_data(){\n $table = 'employee_general where is_delete=0';\n\t\t$primaryKey = \"id\";\n // indexes\n $columns = array(\n\t\t\tarray('db' => 'id', \t\t \t\t'dt' => \"id\", \t\t\t\t\t\t'field' => 'id'),\n\t\t\tarray('db' => 'employee_number', \t'dt' => \"employee_number\", \t\t\t'field' => 'employee_number'),\n\t\t\tarray('db' => 'latin_name', \t\t'dt' => \"latin_name\", \t\t\t\t'field' => 'latin_name'),\n\t\t\tarray('db' => 'khmer_name', \t\t'dt' => \"khmer_name\", \t\t\t\t'field' => 'khmer_name'),\n\t\t\tarray('db' => 'national_card', \t\t'dt' => \"national_card\", \t\t\t'field' => 'national_card'),\n\t\t\tarray('db' => 'date_of_birth', \t\t'dt' => \"date_of_birth\", \t\t\t'field' => 'date_of_birth'),\n\t\t\tarray('db' => 'palce_of_birth', \t'dt' => \"palce_of_birth\", \t\t\t'field' => 'palce_of_birth'),\n\t\t\tarray('db' => 'gender', \t\t\t'dt' => \"gender\", \t\t\t\t\t'field' => 'gender'),\n\t\t\tarray('db' => 'mirrital_status', \t'dt' => \"mirrital_status\", \t\t\t'field' => 'mirrital_status'),\n\t\t\tarray('db' => 'nationality', \t\t'dt' => \"nationality\", \t\t\t\t'field' => 'nationality'),\n\t\t\tarray('db' => 'country', \t\t\t'dt' => \"country\", \t\t\t\t\t'field' => 'country'),\n\t\t\tarray('db' => 'hired_date', \t\t'dt' => \"hired_date\", \t\t\t\t'field' => 'hired_date'),\n\t\t\tarray('db' => 'home_phone', \t\t'dt' => \"home_phone\", \t\t\t\t'field' => 'home_phone'),\n\t\t\tarray('db' => 'cell_phone', \t\t'dt' => \"cell_phone\", \t\t\t\t'field' => 'cell_phone'),\n\t\t\tarray('db' => 'extention_num',\t\t'dt' => \"extention_num\", \t\t\t'field' => 'extention_num'),\n\t\t\tarray('db' => 'email_address',\t\t'dt' => \"email_address\", \t\t\t'field' => 'email_address'),\n\t\t\tarray('db' => 'address', \t\t\t'dt' => \"address\", \t\t\t\t\t'field' => 'address'),\n\t\t\tarray('db' => 'remark', \t\t\t'dt' => \"remark\", \t\t\t\t\t'field' => 'remark'),\n\t\t\tarray('db' => 'pos_class', \t\t\t'dt' => \"pos_class\", \t\t\t\t'field' => 'pos_class'),\n\t\t\tarray('db' => 'job_level', \t\t\t'dt' => \"job_level\", \t\t\t\t'field' => 'job_level'),\n\t\t\tarray('db' => 'employee_status', \t'dt' => \"employee_status\", \t\t\t'field' => 'employee_status'),\n\t\t\tarray('db' => 'position_level', \t'dt' => \"position_level\", \t\t\t'field' => 'position_level'),\n\t\t\tarray('db' => 'confirm_date', \t\t'dt' => \"confirm_date\", \t\t\t'field' => 'confirm_date'),\n\t\t\tarray('db' => 'confirm_status', \t'dt' => \"confirm_status\", \t\t\t'field' => 'confirm_status'),\n\t\t\tarray('db' => 'leaving_reason', \t'dt' => \"leaving_reason\", \t\t\t'field' => 'leaving_reason'),\n\t\t\tarray('db' => 'leaving_date', \t\t'dt' => \"leaving_date\", \t\t\t'field' => 'leaving_date'),\n\t\t\tarray('db' => 'department', \t\t'dt' => \"department\", \t\t\t\t'field' => 'department'),\n\t\t\tarray('db' => 'section', \t \t\t'dt' => \"section\", \t\t\t\t\t'field' => 'section'),\n\t\t\tarray('db' => 'main_section', \t \t'dt' => \"main_section\", \t\t\t'field' => 'main_section'),\n\t\t\tarray('db' => 'location', \t \t\t'dt' => \"location\", \t\t\t\t'field' => 'location'),\n\t\t\tarray('db' => 'sub_location', \t \t'dt' => \"sub_location\", \t\t\t'field' => 'sub_location'),\n\t\t\tarray('db' => 'line', \t\t\t'dt' => \"line\", \t\t\t\t\t'field'\t=> 'line'),\n\t\t\tarray('db' => 'work_shift', \t\t'dt' => \"work_shift\", \t\t\t\t'field'\t=> 'work_shift'),\n\t\t\tarray('db' => 'comments', \t\t'dt' => \"comments\", \t\t\t\t\t'field'\t=> 'comments')\n );\n\t\t\n\t\t\n echo json_encode($this->datatable_model->result_json($_POST, $table, $columns));\n\n\n\n\n }", "public function employeelog(){\n\n\t\t$employee = Employee::where('status', 1)->get()->all();\n\n\t\treturn view('hr.employeelog.viewemployeelog')->with(compact('employee'));\n\n\t}", "private function recordEpisodeView()\r\n {\r\n // Check if the epid is set.. if it is not throw the book at em!\r\n if(!isset($_GET['epid']) && !is_numeric($_GET['epid']))\r\n {\r\n echo 'Error: The episode ID was invalid or wrong. Please try again.';\r\n }\r\n else\r\n { \r\n $query = \"SELECT `sid`, `epnumber` FROM `episode` WHERE `id` = '\" . $this->mysqli->real_escape_string($_GET['epid']) . \"'\";\r\n $result = $this->mysqli->query($query);\r\n $row = $result->fetch_assoc();\r\n \r\n //Get the Date for today, all 24 hours\r\n $currentDay = date('d-m-Y',time());\r\n $midnight = strtotime($currentDay);\r\n $elevenfiftynine = $midnight+86399;\r\n \r\n //check for any rows that were done today...\r\n // we will want to switch out the seriesid and the epnumber for epid later.. just makes it easier..\r\n $query = $this->mysqli->query(\"SELECT `id` FROM `episodestats` WHERE `ip` = '\" . $_SERVER['REMOTE_ADDR'] . \"' AND `epSeriesId` = '\" . $row['sid'] . \"' AND `epNumber` = '\" . $row['epnumber'] . \"' AND `date` >= '\" . $midnight . \"'\");\r\n $count = mysqli_num_rows($query);\r\n \r\n if($count == 0)\r\n {\r\n $query = \"INSERT INTO `episodestats` (`eid`, `epSeriesId`, `ip`, `date`, `epnumber`) VALUES ('\" . $this->mysqli->real_escape_string($_GET['epid']) . \"', '\" . $row['sid'] . \"', '\" . $_SERVER['REMOTE_ADDR'] . \"', '\".time().\"', '\" . $row['epnumber'] . \"')\";\r\n $result = $this->mysqli->query($query);\r\n }\r\n }\r\n }", "public function employee_leave_details_report_show_in_modal() {\n if (get_user_permission('reports/hr_report/employee_leave_report/employee_leave_report') === false) {\n redirect(base_url('user_login'));\n }\n\n $company_information = $this->Company_Model->get_company();\n $this->data['company_information'] = $company_information;\n $id = trim($this->input->post('id')); // employee_id\n $employee = $this->Employee_Model->get_employee($id);\n $year_session = $this->session->userdata('year_session');\n $employee_leave_details_by_year = $this->get_employee_leave_details_by_year($id, $year_session);\n $this->data['employee_leave_details_by_year'] = $employee_leave_details_by_year;\n $this->data['employee'] = $employee;\n $this->data['year_session'] = $year_session;\n $this->load->view('reports/hr_report/employee_leave_report/employee_leave_report_modal', $this->data);\n }", "public function personalAction()\r\n\t{ \r\n\t if(defined('EMPTABCONFIGS'))\r\n\t\t{\r\n\t\t $empOrganizationTabs = explode(\",\",EMPTABCONFIGS);\r\n\t\t\tif(in_array('emppersonaldetails',$empOrganizationTabs)){\r\n\t\r\n\t\t\t\t$employeeData =array();$emptyFlag=0;\r\n\t\t\t\t$identityDocumentArr = array();\r\n\t\t\t\t$documentsArr = array();\r\n\t\t\t\t$auth = Zend_Auth::getInstance();\r\n\t\t\t\tif($auth->hasIdentity()){\r\n\t\t\t\t\t\t\t$loginUserId = $auth->getStorage()->read()->id;\r\n\t\t\t\t\t\t\t$loginUserGroup = $auth->getStorage()->read()->group_id;\r\n\t\t\t\t\t\t\t$loginUserRole = $auth->getStorage()->read()->emprole;\r\n\t\t\t\t}\r\n\t\t\t\t$id = $loginUserId;\t$tabName=\"personal\";\r\n\t\t\t\t$employeeModal = new Default_Model_Employee();\r\n\t\t\t\t$empdata = $employeeModal->getsingleEmployeeData($id);\r\n\t\t\t\t\r\n\t\t\t\tif($empdata == 'norows')\r\n\t\t\t\t{\r\n\t\t\t\t $this->view->rowexist = \"norows\";\r\n\t\t\t\t $this->view->empdata = \"\";\r\n\t\t\t\t}\r\n\t\t\t\telse if(!empty($empdata))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->view->rowexist = \"rows\";\r\n\t\t\t\t\t$usersModel = new Default_Model_Users();\r\n\t\t\t\t\t$emppersonaldetailsform = new Default_Form_emppersonaldetails();\r\n\t\t\t\t\tif($id)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$empperdetailsModal = new Default_Model_Emppersonaldetails();\r\n\t\t\t\t\t\t$usersModel = new Default_Model_Users();\r\n\t\t\t\t\t\t$emppersonaldetailsform = new Default_Form_emppersonaldetails();\r\n\t\t\t\t\t\t$identitydocumentsModel = new Default_Model_Identitydocuments();\t\r\n\t\t\t\t\t\t$identityDocumentArr = $identitydocumentsModel->getIdentitydocumnetsrecord();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$genderModel = new Default_Model_Gender();\r\n\t\t\t\t\t\t$maritalstatusmodel = new Default_Model_Maritalstatus();\r\n\t\t\t\t\t\t$nationalitymodel = new Default_Model_Nationality();\r\n\t\t\t\t\t\t$ethniccodemodel = new Default_Model_Ethniccode();\r\n\t\t\t\t\t\t$racecodemodel = new Default_Model_Racecode();\t\r\n\t\t\t\t\t\t$languagemodel = new Default_Model_Language();\r\n\t\t\t\t\t\t$msgarray = array();\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t$genderlistArr = $genderModel->getGenderList();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!empty($genderlistArr))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach ($genderlistArr as $genderlistres){\r\n\t\t\t\t\t\t\t\t$emppersonaldetailsform->genderid->addMultiOption($genderlistres['id'],$genderlistres['gendername']);\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\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$msgarray['genderid'] = 'Gender is not configured yet.';\r\n\t\t\t\t\t\t\t$emptyFlag++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t$maritalstatuslistArr = $maritalstatusmodel->getMaritalStatusList();\r\n\t\t\t\t\t\tif(!empty($maritalstatuslistArr))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach ($maritalstatuslistArr as $maritalstatuslistres){\r\n\t\t\t\t\t\t\t\t$emppersonaldetailsform->maritalstatusid->addMultiOption($maritalstatuslistres['id'],$maritalstatuslistres['maritalstatusname']);\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\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$msgarray['maritalstatusid'] = 'Marital status is not configured yet.';\r\n\t\t\t\t\t\t\t$emptyFlag++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t$nationalitylistArr = $nationalitymodel->getNationalityList();\r\n\t\t\t\t\t\tif(!empty($nationalitylistArr))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach ($nationalitylistArr as $nationalitylistres){\r\n\t\t\t\t\t\t\t\t$emppersonaldetailsform->nationalityid->addMultiOption($nationalitylistres['id'],$nationalitylistres['nationalitycode']);\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\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$msgarray['nationalityid'] = 'Nationality is not configured yet.';\r\n\t\t\t\t\t\t\t$emptyFlag++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t$ethniccodeArr = $ethniccodemodel->gettotalEthnicCodeData();\r\n\t\t\t\t\t\tif(!empty($ethniccodeArr))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach ($ethniccodeArr as $ethniccoderes){\r\n\t\t\t\t\t\t\t\t$emppersonaldetailsform->ethniccodeid->addMultiOption($ethniccoderes['id'],$ethniccoderes['ethnicname']);\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\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$msgarray['ethniccodeid'] = 'Ethnic codes are not configured yet.';\r\n\t\t\t\t\t\t\t$emptyFlag++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t$racecodeArr = $racecodemodel->gettotalRaceCodeData();\r\n\t\t\t\t\t\tif(!empty($racecodeArr))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach ($racecodeArr as $racecoderes){\r\n\t\t\t\t\t\t\t\t$emppersonaldetailsform->racecodeid->addMultiOption($racecoderes['id'],$racecoderes['racename']);\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}else\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$msgarray['racecodeid'] = 'Race codes are not configured yet.';\r\n\t\t\t\t\t\t\t$emptyFlag++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t$languageArr = $languagemodel->gettotalLanguageData();\r\n\t\t\t\t\t\tif(!empty($languageArr))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach ($languageArr as $languageres){\r\n\t\t\t\t\t\t\t\t$emppersonaldetailsform->languageid->addMultiOption($languageres['id'],$languageres['languagename']);\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}else\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$msgarray['languageid'] = 'Languages are not configured yet.';\r\n\t\t\t\t\t\t\t$emptyFlag++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!empty($identityDocumentArr))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->view->identitydocument = $identityDocumentArr;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->view->identitydocument = \"\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$data = $empperdetailsModal->getsingleEmpPerDetailsData($id);\r\n\t\t\t\t\t\tif(!empty($data))\r\n\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t$emppersonaldetailsform->populate($data[0]);\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$dob = sapp_Global::change_date($data[0][\"dob\"], 'view');\r\n\t\t\t\t\t\t\t$emppersonaldetailsform->dob->setValue($dob);\r\n\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\tif($data[0]['celebrated_dob'] !='')\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\t\t$celebrated_dob = sapp_Global::change_date($data[0][\"celebrated_dob\"], 'view');\r\n\t\t\t\t\t\t\t\t$emppersonaldetailsform->celebrated_dob->setValue($celebrated_dob);\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 if($data[0]['identity_documents'] !='')\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$documentsArr = get_object_vars(json_decode($data[0]['identity_documents']));\r\n\t\t\t\t\t\t\t\t$documentsArr = sapp_Global::object_to_array($documentsArr);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$emppersonaldetailsform->setDefault('genderid',$data[0]['genderid']);\r\n\t\t\t\t\t\t\t$emppersonaldetailsform->setDefault('maritalstatusid',$data[0]['maritalstatusid']);\r\n\t\t\t\t\t\t\t$emppersonaldetailsform->setDefault('nationalityid',$data[0]['nationalityid']);\r\n\t\t\t\t\t\t\t$emppersonaldetailsform->setDefault('ethniccodeid',$data[0]['ethniccodeid']);\r\n\t\t\t\t\t\t\t$emppersonaldetailsform->setDefault('racecodeid',$data[0]['racecodeid']);\r\n\t\t\t\t\t\t\t$emppersonaldetailsform->setDefault('languageid',$data[0]['languageid']);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$this->view->form = $emppersonaldetailsform;\r\n\t\t\t\t\t\t$this->view->data = $data;\r\n\t\t\t\t\t\t$this->view->documentsArr = $documentsArr;\r\n\t\t\t\t\t\t$this->view->id = $id;\r\n\t\t\t\t\t\t$this->view->msgarray = $msgarray;\r\n\t\t\t\t\t\t$this->view->employeedata = $empdata[0];\r\n\t\t\t\t\t\t$this->view->emptyFlag=$emptyFlag;\r\n\t\t\t\t\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t$emppersonaldetailsform->user_id->setValue($id);\r\n\t\t\t\t\t\t$emppersonaldetailsform->setAttrib('action',BASE_URL.'mydetails/personal');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif($this->getRequest()->getPost())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$result = $this->savepersonaldetails($emppersonaldetailsform,$loginUserId,$identityDocumentArr);\t\r\n\t\t\t\t\t\t$this->view->msgarray = $result; \r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->view->empdata = $empdata; \r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\telse{\r\n\t\t \t $this->_redirect('error');\r\n\t\t }\r\n }\r\n\t\telse{\r\n\t\t \t$this->_redirect('error');\r\n\t\t }\t\t\t\r\n\t}", "public function employee_faq(){\n\t\t$this->load->view('app/administrator/file_maintenance/employee_faq',$this->data);\n\t}", "function show_list_nominee()\n {\n // $id = $_SESSION['UsEmp_ID'];\n $this->load->model('M_pef_file_present', 'list');\n $data['emp_nominee'] = $this->list->get_nominee()->result();\n\n $this->load->model('M_pef_file_present', 'file');\n $data['emp_file'] = $this->file->get_all()->result();\n\n $this->output('consent/v_add_file_present', $data);\n }", "public function disabilitydetailsviewAction()\r\n\t{\r\n\t if(defined('EMPTABCONFIGS'))\r\n\t\t{\r\n\t\t $empOrganizationTabs = explode(\",\",EMPTABCONFIGS);\r\n\t\t\tif(in_array('disabilitydetails',$empOrganizationTabs))\r\n\t\t\t{\r\n\t\t\t\t$tabName = \"disability\";\r\n\t\t\t\t$employeeData =array();\r\n\t\t\t\t$objName=\"mydetails\";\r\n\t\t\t\t$editPrivilege=\"\";\r\n\t\t\t\t$auth = Zend_Auth::getInstance();\r\n\t\t\t if($auth->hasIdentity())\r\n\t\t\t {\r\n\t\t\t\t\t$loginUserId = $auth->getStorage()->read()->id;\r\n\t\t\t\t}\r\n\t\t\t\t$id = $loginUserId;\r\n\t\t\t\t$empDisabilitydetailsform = new Default_Form_Disabilitydetails();\r\n\t\t\t\t$empDisabilitydetailsModel = new Default_Model_Disabilitydetails();\r\n\t\t\t\t$employeeModal = new Default_Model_Employee();\r\n\t\t\t\t\r\n\t\t\t\t$empDisabilitydetailsform->removeElement(\"submit\");\r\n\t\t\t\t$elements = $empDisabilitydetailsform->getElements();\r\n\t\t\t\tif(count($elements)>0)\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach($elements as $key=>$element)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(($key!=\"Cancel\")&&($key!=\"Edit\")&&($key!=\"Delete\")&&($key!=\"Attachments\")){\r\n\t\t\t\t\t\t$element->setAttrib(\"disabled\", \"disabled\");\r\n\t\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$empdata = $employeeModal->getsingleEmployeeData($id);\r\n\t\t\t\tif($empdata == 'norows')\r\n\t\t\t\t{\r\n\t\t\t\t $this->view->rowexist = \"norows\";\r\n\t\t\t\t $this->view->empdata = \"\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{ \r\n\t\t\t\t\t$this->view->rowexist = \"rows\";\r\n\t\t\t\t\tif(!empty($empdata))\r\n\t\t\t\t\t{ \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($id)\r\n\t\t\t\t\t\t{\t\r\n\t\t\t\t\t\t\t$data = $empDisabilitydetailsModel->getempDisabilitydetails($id);\r\n\t\t\t\t\t\t\tif(!empty($data))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$empDisabilitydetailsform->setDefault(\"id\",$data[0][\"id\"]);\r\n\t\t\t\t\t\t\t\t$empDisabilitydetailsform->setDefault(\"disability_name\",$data[0][\"disability_name\"]);\r\n\t\t\t\t\t\t\t\t$empDisabilitydetailsform->setDefault(\"disability_type\",$data[0][\"disability_type\"]);\r\n\t\t\t\t\t\t\t\t$empDisabilitydetailsform->setDefault(\"disability_description\",$data[0][\"disability_description\"]);\r\n\t\t\t\t\t\t\t\t$empDisabilitydetailsform->setDefault(\"other_disability_type\",$data[0][\"other_disability_type\"]);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$empDisabilitydetailsform->setAttrib('action',BASE_URL.'mydetails/disability');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$this->view->form = $empDisabilitydetailsform;\r\n\t\t\t\t\t\t\t$this->view->id = $id;\r\n\t\t\t\t\t\t\t$this->view->data=$data;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->view->empdata = $empdata;\r\n\t\t\t\t\t$this->view->controllername=$objName;\r\n\t\t\t\t\t$this->view->actionname='disability';\r\n\t\t\t\t\t$this->view->editPrivilege = $this->mydetailsobjPrivileges;\r\n\t\t\t\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t \t $this->_redirect('error');\r\n\t\t }\r\n }\r\n else\r\n\t\t{\r\n\t\t \t$this->_redirect('error');\r\n\t\t}\t\t\r\n\t}", "private function getEvents () \n\n\t\t{\n\t\t\t $dbs = new DB ( $this->config['database'] );\n $c = $dbs->query (\"SELECT * FROM tbl_events_record WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t if ( count ( $c ) ) {\n\t\t\t\t$this->result['data']['id'] = trim ( $this->c );\n\t\t\t\t$this->result['data']['events'] = $c[0]['events'];\n\t\t\t\t$this->result['data']['date'] = $c[0]['date_rec'];\n\t\t\t } else \n\t\t\t\t$this->result['data']['result'] = \"Not found [error code:100:101]\";\n\n\t\t\t $dbs->CloseConnection ();\n\t\t\t\n\t\t \treturn;\n\t\t}", "function event_grid_view() {\n\tsp_calendar_grid();\n}", "function pnh_employee_sales_summary()\r\n\t{\r\n\t\t$this->erpm->auth(true);\r\n\t\t$data['page']='pnh_employee_sales_summary';\r\n\t\t$this->load->view(\"admin\",$data);\r\n\t}", "public function addEditHandler($pathToViewFile, $record_id = null) {\n\t\t$model = Model::factory($this->modelName)->getRecord($record_id);\n\t\t$content = View::factory($pathToViewFile);\n\t\t$content->data = $model;\n\t\t$this->template->content = $content;\n\t}", "public function load()\n\t{\n\t\t$this->list_table->load();\n\t}", "function edit_event_load() {\n\n\t\tadd_filter( 'request', array( $this, 'sort_events' ) );\n\t}", "abstract public function getDataForViewFile(FileData $fileData);", "public function initEvent() {\n \t\t$dateend = date_format(date_create(),'Y-m-d H:i:s');\n\t\t$datebegin = date_create();\n\t\tdate_sub($datebegin, date_interval_create_from_date_string('10 days'));\n\t\t$datebegin = date_format($datebegin, 'Y-m-d H:i:s');\n\t\t// get event logs from event_log table\n \t\t$EventLogs = DB::table('event_log')->join('client','client.client_id','=','event_log.client_id')->join('mandant','client.mandant_id','=','mandant.mandant_id')->select('log_nr', 'message_id','mandant.mandant_firmname','useragent','client.client_id','client_ip','action',DB::raw('date_format(insert_date, \\'%d.%m.%Y %H:%i:%s\\') as insert_date'))->where('mandant.user_id','1')->where('insert_date','>',$datebegin)->where('insert_date','<',$dateend)->orderby('log_nr','ASC')->get();\n \t\treturn View::make('eventlog/eventlog_gui')->with('page',2)->with('title','Event Logs')->with('events',$EventLogs);\n \t}", "public function events()\n {\n $eventdata = $this->Event->find('all', \n array(\n 'order' => array('Event.time' => 'DESC'),\n 'condition' => array('type' => 'Event')\n ));\n \n $this->set('events', $eventdata);\n \n $this->assignUserToView($this->Auth->user('id'));\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Info');\n }", "function ExportData() {\r\n\t\t$utf8 = (strtolower(EW_CHARSET) == \"utf-8\");\r\n\t\t$bSelectLimit = FALSE;\r\n\r\n\t\t// Load recordset\r\n\t\tif ($bSelectLimit) {\r\n\t\t\t$this->TotalRecs = $this->SelectRecordCount();\r\n\t\t} else {\r\n\t\t\tif (!$this->Recordset)\r\n\t\t\t\t$this->Recordset = $this->LoadRecordset();\r\n\t\t\t$rs = &$this->Recordset;\r\n\t\t\tif ($rs)\r\n\t\t\t\t$this->TotalRecs = $rs->RecordCount();\r\n\t\t}\r\n\t\t$this->StartRec = 1;\r\n\t\t$this->SetUpStartRec(); // Set up start record position\r\n\r\n\t\t// Set the last record to display\r\n\t\tif ($this->DisplayRecs <= 0) {\r\n\t\t\t$this->StopRec = $this->TotalRecs;\r\n\t\t} else {\r\n\t\t\t$this->StopRec = $this->StartRec + $this->DisplayRecs - 1;\r\n\t\t}\r\n\t\tif (!$rs) {\r\n\t\t\theader(\"Content-Type:\"); // Remove header\r\n\t\t\theader(\"Content-Disposition:\");\r\n\t\t\t$this->ShowMessage();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$this->ExportDoc = ew_ExportDocument($this, \"v\");\r\n\t\t$Doc = &$this->ExportDoc;\r\n\t\tif ($bSelectLimit) {\r\n\t\t\t$this->StartRec = 1;\r\n\t\t\t$this->StopRec = $this->DisplayRecs <= 0 ? $this->TotalRecs : $this->DisplayRecs;\r\n\t\t} else {\r\n\r\n\t\t\t//$this->StartRec = $this->StartRec;\r\n\t\t\t//$this->StopRec = $this->StopRec;\r\n\r\n\t\t}\r\n\r\n\t\t// Call Page Exporting server event\r\n\t\t$this->ExportDoc->ExportCustom = !$this->Page_Exporting();\r\n\t\t$ParentTable = \"\";\r\n\t\t$sHeader = $this->PageHeader;\r\n\t\t$this->Page_DataRendering($sHeader);\r\n\t\t$Doc->Text .= $sHeader;\r\n\t\t$this->ExportDocument($Doc, $rs, $this->StartRec, $this->StopRec, \"view\");\r\n\r\n\t\t// Export detail records (observacion_tutor)\r\n\t\tif (EW_EXPORT_DETAIL_RECORDS && in_array(\"observacion_tutor\", explode(\",\", $this->getCurrentDetailTable()))) {\r\n\t\t\tglobal $observacion_tutor;\r\n\t\t\tif (!isset($observacion_tutor)) $observacion_tutor = new cobservacion_tutor;\r\n\t\t\t$rsdetail = $observacion_tutor->LoadRs($observacion_tutor->GetDetailFilter()); // Load detail records\r\n\t\t\tif ($rsdetail && !$rsdetail->EOF) {\r\n\t\t\t\t$ExportStyle = $Doc->Style;\r\n\t\t\t\t$Doc->SetStyle(\"h\"); // Change to horizontal\r\n\t\t\t\tif ($this->Export <> \"csv\" || EW_EXPORT_DETAIL_RECORDS_FOR_CSV) {\r\n\t\t\t\t\t$Doc->ExportEmptyRow();\r\n\t\t\t\t\t$detailcnt = $rsdetail->RecordCount();\r\n\t\t\t\t\t$observacion_tutor->ExportDocument($Doc, $rsdetail, 1, $detailcnt);\r\n\t\t\t\t}\r\n\t\t\t\t$Doc->SetStyle($ExportStyle); // Restore\r\n\t\t\t\t$rsdetail->Close();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$sFooter = $this->PageFooter;\r\n\t\t$this->Page_DataRendered($sFooter);\r\n\t\t$Doc->Text .= $sFooter;\r\n\r\n\t\t// Close recordset\r\n\t\t$rs->Close();\r\n\r\n\t\t// Call Page Exported server event\r\n\t\t$this->Page_Exported();\r\n\r\n\t\t// Export header and footer\r\n\t\t$Doc->ExportHeaderAndFooter();\r\n\r\n\t\t// Clean output buffer\r\n\t\tif (!EW_DEBUG_ENABLED && ob_get_length())\r\n\t\t\tob_end_clean();\r\n\r\n\t\t// Write debug message if enabled\r\n\t\tif (EW_DEBUG_ENABLED && $this->Export <> \"pdf\")\r\n\t\t\techo ew_DebugMsg();\r\n\r\n\t\t// Output data\r\n\t\t$Doc->Export();\r\n\t}", "public function show_event($id)\r\n\t{\r\n\t\t//check for admin\r\n\t\tif($this->session->userdata('logged_in'))\r\n\t\t{\r\n\t\t\t$session_data = $this->session->userdata('logged_in');\r\n\t\t\t$data['username'] = $session_data['username'];\r\n\t\t\t$data['admin'] = $session_data['admin'];\r\n\t\t\t// get info if user is logged in\r\n\t\t\t$data['user_info'] = $this->caifmodel->get_user_info($session_data['username']);\r\n\t\t\t// see if they have already rsvp'ed to the event\r\n\t\t\t$data['already_rsvp'] = $this->caifmodel->get_rsvp($session_data['username'],$id);\r\n\t\t}\r\n\t\telse\r\n\t\t\t$data['username'] = '';\r\n\t\t\t\r\n\t\t// set active tab\r\n\t\t$data['welcome_active'] = \"\";\r\n\t\t$data['host_active'] = \"\";\r\n\t\t$data['event_active'] = \"active\";\r\n\t\t\r\n\t\t// get the data for the event\r\n\t\t$data['event_info'] = $this->caifmodel->get_event_info($id);\r\n\t\t\r\n\t\t// load views\r\n\t\t$this->load->view('include/header',$data);\r\n\t\t$this->load->view('include/tabs',$data);\r\n\t\t$this->load->view('show_events',$data);\r\n\t\t$this->load->view('include/footer');\t\r\n\t}", "function loadCreateEvent() { \n $places = Place::all(['placeID', 'title_en'])->sortBy('title_en');\n $categories = Category::all(['ctgID', 'name_en'])->sortBy('name_en');\n return view('cms.events.create.event', ['places' => $places, 'categories' => $categories]);\n }", "function EpicsDetails() \n {\n \n // $EpicsDetails=\"SELECT * FROM epics\n // LEFT JOIN team\n // ON team.id = epics.team_id\";\n\n\n $EpicsDetails=\"SELECT e.*,stf.*,ed.*,team.name as teamname,epics_statuses.name as statusename\n FROM epics AS e\n LEFT JOIN team as team ON team.id=e.team_id\n LEFT JOIN epics_statuses as epics_statuses ON epics_statuses.id=e.e_status_id\n LEFT JOIN staff AS stf ON stf.staff_id = e.e_owner \n LEFT JOIN epic_details AS ed ON ed.e_id = e.e_id where ed.e_id = e.e_id\";\n $EpicsDetailsresult = $this->ds->select($EpicsDetails);\n //print '<pre>';print_r($EpicsDetailsresult);\n return $EpicsDetailsresult;\n }", "public function show(Abz_Employees $sample_data)\n {\n //\n }", "public function get_events()\n {\n $table_name = $this->input->get_post(\"table_name\");\n\n log_message(\"debug\", \"Posted table name {$table_name}\");\n\n $config = [\n 'base_url' => $this->config->base_url(\"welcome/get_events/\"),\n 'total_rows' => $this->Xform_model->count_all_records($table_name),\n 'uri_segment' => 4,\n 'per_page' => 100,\n ];\n\n $this->pagination->initialize($config);\n $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;\n\n $events = $this->Xform_model->get_geospatial_data($table_name, $this->pagination->per_page, $page);\n $links = $this->pagination->create_links();\n\n if ($this->input->is_ajax_request()) {\n $result = [\n 'status' => \"success\",\n \"events_count\" => $config['total_rows'],\n \"events\" => $events,\n \"links\" => $links\n ];\n $result = array_utf8_encode($result);\n echo json_encode($result);\n } else {\n show_error(\"Not Implement\", 501, \"Page not implemented\"); //page not implemented\n }\n }", "function mainEvent(&$req, &$t) {\n\t\t$d = dir(BASE_DIR.'var/search_cache/');\n\t\t$data = array();\n\n\n\t\t$list = new Cgn_Mvc_TableModel();\n\t\t$list->data = array(\n\t\t\t0=> array('link 1','foobar.php'),\n\t\t\t1=> array('link 2','foobar.php'),\n\t\t\t2=> array('link 3','foobar.php')\n\t\t);\n\n\t\twhile ($entry = $d->read()) {\n\t\t\t//skip private files, . and ..\n\t\t\tif ( strpos($entry , '.') === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!is_dir(BASE_DIR.'var/search_cache/'.$entry)) continue;\n\n\t\t\ttry {\n\t\t\t\t$index = new Cgn_Search_Index($entry);\n\t\t\t\t$count = $index->getDocumentCount();\n\t\t\t\t$status = 'OK';\n\t\t\t\t$index->close();\n\t\t\t} catch (Zend_Search_Lucene_Exception $e) {\n\t\t\t\t//set status as 'error'\n\t\t\t\t$status = 'error';\n\t\t\t\t$count = 'N/A';\n\t\t\t\t//swallow PHP error in ZF for chmod\n\t\t\t\tCgn_ErrorStack::pullError('php');\n\t\t\t\tthrow $e;\n\t\t\t}\n\n\t\t\t$data[] = array(\n\t\t\t\t$entry,\n\t\t\t\t$count,\n\t\t\t\t$status\n\t\t\t);\n\t\t}\n\n\t\t$list->data = $data;\n\t\t$list->headers = array('Name', 'Num. Documents', 'Status');\n\t\t$t['listPanel'] = new Cgn_Mvc_AdminTableView($list);\n\t\t$t['listPanel']->attribs['width'] = '600';\n\t\t$t['listPanel']->setColWidth(0, '300');\n\t\t$t['listPanel']->setColWidth(1, '100');\n\t\t$t['listPanel']->setColWidth(2, '100');\n\n\t\t$t['message'] = \"This is the main event.\";\n\t}", "function get_exam_data_table()\n\t\t{\n\t\t\t$data['list']=$_POST['list'];\n\t\t\t$data['student_name']=$_POST['student_name'];\n\t\t\t$data['exam_name']=$_POST['exam_name'];\n\t\t\t$this->load->view('backend/parents/get_data_table',$data);\t\t \n\t\t}", "public function show($id)\n {\n //\n $employee_id=$id;\n $employee_documents = EmployeeDocument::all();\n $data_document = DB::table('employee_documents')\n ->select('settings_constants.value as document_type','employee_documents.id as id','document_type_id','employee.employee_no','employee_documents.employee_id','date_of_expiry','title','notification_email','is_alert','description','document_file')\n ->rightJoin('settings_constants', 'employee_documents.document_type_id', '=', 'settings_constants.id')\n ->rightJoin('employee', 'employee_documents.employee_id', '=', 'employee.id')\n ->whereNull('employee_documents.deleted_at')\n ->where('employee.id', $employee_id)\n ->get();\n\n $data_announcement = DB::table('announcements as a')\n ->select('a.id as id','ee.employee_id','a.department','published_by','location','summary','title','start_date','end_date','description')\n ->rightJoin('company_department as cd', 'a.department', '=', 'cd.id')\n ->rightJoin('employee_employment as ee', 'ee.department', '=', 'cd.id')\n ->whereNull('a.deleted_at')\n // ->groupBy('a.id')\n // ->where('employee_employment.id', '$employee_id')\n ->get();\n\n $data_employment= DB::table('employee_employment as employment')\n ->select('employment.id as employment_id', 'employment.employee_id as emp_id', 'employment.date_hired', 'employment.date_resign',\n 'employment.contract_start', 'employment.contract_end', 'employment.branch', 'employment.department', 'employment.designation',\n 'employment.employment_status', 'employment.schedule_type', 'employment.employment_status', 'employment.employee_type', 'employment.position', 'company_branch.id as branch_id', 'company_branch.location_name',\n 'company_department.branch_id', 'company_department.id as department_id', 'company_department.department_name', 'company_designation.id as designation_id', 'company_designation.department_id',\n 'company_designation.designation_name','rate_template.id as rate_id')\n ->rightJoin('company_branch', 'company_branch.id', '=', 'employment.branch')\n ->rightJoin('company_department', 'company_department.id', '=', 'employment.department')\n ->rightJoin('company_designation', 'company_designation.id', '=', 'employment.designation')\n ->rightJoin('office_shifts', 'office_shifts.id', '=', 'employment.schedule_type')\n ->join('rate_template', 'rate_template.id', '=', 'employment.rate_id')\n ->where('employment.employee_id' ,'=', $employee_id)\n ->get();\n\n $data_leave = DB::table('employee_leave_applications')\n ->select('leave_type.id', 'leave_type.type_name as leave_type', 'leave_type.days_per_year','employee_leave_applications.id as id','leave_type_id',\n 'firstname','lastname','employee_leave_applications.employee_id','employee.employee_no','from_date',\n 'to_date','reason','remarks','employee_leave_applications.created_at as created_at','employee_leave_applications.status as status')\n ->join('employee', 'employee_leave_applications.employee_id', '=', 'employee.id')\n ->join('leave_type', 'employee_leave_applications.leave_type_id', '=', 'leave_type.id')\n ->whereNull('employee_leave_applications.deleted_at')\n ->get();\n\n $leave_type = LeaveType::all()->sortByDesc('id');\n $document_type = SettingsConstants::all()->where('type', 'Document Type')->sortByDesc('value');\n $data_employee= Employee::all()->where('id', $id);\n $data_education = EmployeeEducation::all()->where('employee_id', $employee_id);\n $data_work_experience = EmployeeWorkExperience::all()->where('employee_id', $employee_id);\n $education_level = SettingsConstants::all()->where('type', 'Education Level')->sortByDesc('value');\n $constant = SettingsConstants::all();\n $branch = Branch::all();\n $department = department::all();\n $rate= RateTemplate::all();\n $designation = designation::all();\n\n $data = array(\n 'employee_id'=>$employee_id,\n 'employee_documents'=>$employee_documents,\n 'data_employee'=>$data_employee,\n 'data_employment'=>$data_employment,\n 'leave_type'=>$leave_type,\n 'document_type'=>$document_type,\n 'data_education'=>$data_education,\n 'data_work_experience'=>$data_work_experience,\n 'education_level'=>$education_level,\n 'constant'=>$constant,\n 'branch'=>$branch,\n 'department'=>$department,\n 'rate'=>$rate,\n 'designation'=>$designation,\n 'data_leave'=>$data_leave,\n 'data_document'=>$data_document\n\n );\n\n return view('Employee.profile', $data);\n\n }", "function load_from_external_source($col_mapping, $source_data) {\n $a = array();\n $label_formatter = new \\App\\Libraries\\Label_formatter();\n $source_data2 = array_change_key_case($source_data, CASE_LOWER);\n\n // load entry fields from external source\n foreach ($col_mapping as $fld => $spec) {\n\n // $spec['type'] will typically be ColName, PostName, or Literal\n // However, it might have a suffix in the form '.action.ActionName'\n\n // Method get_entry_form_definitions() E_model.php looks for text \n // in the form 'ColName.action.ActionName'\n // and will add an 'action' item to the field spec\n \n switch ($spec['type']) {\n case 'ColName':\n // Copy the text in the specified column of the detail report for the source page family\n // . \" (field = \" . $spec['value'] . \", action = $action)\"\n $col = $spec['value'];\n $col_fmt = $label_formatter->format($col);\n $col_defmt = $label_formatter->deformat($col);\n $val = \"\";\n if (array_key_exists($col, $source_data)) {\n $val = $source_data[$col];\n } elseif (array_key_exists($col_fmt, $source_data)) {\n // Target column for column name not found; try using the display-formatted target field\n $val = $source_data[$col_fmt];\n } elseif (array_key_exists($col_defmt, $source_data)) {\n // Target column for column name not found; try using the display-deformatted target field\n $val = $source_data[$col_defmt];\n } else {\n // TODO: Trigger a warning message of some kind?\n // Return an invalid link id to not break the page entirely; it's harder to see that there's a problem, but much easier to see the exact cause\n $val = \"COLUMN_NAME_MISMATCH\";\n }\n $a[$fld] = $val;\n break;\n\n case 'PostName':\n // Retrieve the named POST value\n //$request = \\Config\\Services::request();\n //$pv = $request->getPost($spec['value']);\n $col = $spec['value'];\n $pv = \"\";\n if (array_key_exists($col, $source_data2)) {\n $pv = $source_data2[$col];\n }\n $a[$fld] = $pv;\n break;\n\n case 'Literal':\n // Store a literal string\n $a[$fld] = $spec['value'];\n break;\n }\n\n // any further actions?\n if (isset($spec['action'])) {\n switch ($spec['action']) {\n case 'ExtractUsername':\n // Look for username in text of the form \"Person Name (Username)\"\n // This Regex matches any text between two parentheses\n\n $patUsername = '/\\(([^)]+)\\)/i';\n $matches = array();\n\n preg_match_all($patUsername, $a[$fld], $matches);\n\n // The $matches array returned by preg_match_all is a 2D array\n // Any matches to the first capture are in the array at $matches[0]\n\n if (count($matches[1]) > 0) {\n // Update $a[$fld] to be the last match found (excluding the parentheses)\n\n $a[$fld] = $matches[1][count($matches[1]) - 1];\n }\n\n break;\n\n case 'ExtractEUSId':\n // Look for EUS ID in text of the form \"LastName, FirstName (12345)\"\n // This Regex matches any series of numbers between two parentheses\n\n $patEUSId = '/\\(( *\\d+ *)\\)/i';\n $matches = array();\n\n preg_match($patEUSId, $a[$fld], $matches);\n\n // $matches is now a 1D array\n // $matches[0] is the full match\n // $matches[1] is the captured group\n\n if (count($matches) > 1) {\n // Update $a[$fld] to be the first match found (excluding the parentheses)\n\n $a[$fld] = $matches[1];\n }\n\n break;\n\n case 'Scrub':\n // Only copy certain text from the comment field of the source analysis job\n\n // Look for text in the form '[Req:Username]'\n // If found, put the last one found in $s\n // For example, given '[Job:D3M580] [Req:D3M578] [Req:D3L243]', set $s to '[Req:D3L243]'\n // This is a legacy comment text that was last used in 2010\n\n $s = \"\";\n $field = $a[$fld];\n\n $patReq = '/(\\[Req:[^\\]]*\\])/';\n $matches = array();\n preg_match_all($patReq, $field, $matches);\n\n // The $matches array returned by preg_match_all is a 2D array\n // Any matches to the first capture are in the array at $matches[0]\n\n if (count($matches[0]) != 0) {\n $s .= $matches[0][count($matches[0]) - 1];\n }\n\n // Also look for 'DTA:' followed by letters, numbers, and certain symbols\n // For example, given '[Job:D3L243] [Req:D3L243] DTA:DTA_Manual_02', look for 'DTA:DTA_Manual_02'\n // If found, append the text to $s\n // This is a legacy comment text that was last used in 2010\n\n $patDTA = '/(DTA:[a-zA-Z0-9_#\\-]*)/';\n preg_match($patDTA, $field, $matches);\n\n // $matches is now a 1D array\n // $matches[0] is the full match\n // $matches[1] is the captured group\n\n if (count($matches) > 1) {\n $s .= \" \" . $matches[1];\n }\n\n $a[$fld] = $s;\n break;\n }\n }\n }\n return $a;\n}", "public function details (){\n $connection = new database();\n $table = new simple_table_ops();\n\n $id = $_GET['id']; // timetable_id\n $content = \"<div class='link_button'>\n <a href='?controller=teachers&action=export'>Export to EXCEL</a>\n <a href='?controller=curricula&action=index'>Curricula</a>\n </div>\";\n\n $content .= \"<div class='third_left'>\";\n $content .='<p>You can configure the timetable for the following course:<p>';\n\n $sql = \"SELECT curricula.curriculum_id, CONCAT (teachers.nom, ' ', teachers.prenom, ' | ', teachers.nom_khmer, ' ', teachers.prenom_khmer, ' | ', sexes.sex) as teacher, subjects.subject, levels.level\n FROM curricula\n JOIN courses ON curricula.course_id = courses.course_id\n JOIN subjects ON curricula.subject_id = subjects.subject_id\n JOIN teachers ON teachers.teacher_id = curricula.teacher_id\n JOIN sexes ON teachers.sex_id = sexes.sex_id\n JOIN levels ON courses.level_id = levels.level_id\n JOIN timetables ON timetables.curriculum_id = curricula.curriculum_id\n WHERE timetables.timetable_id = {$_GET['id']}\";\n\n $curricula_data = $connection->query($sql);\n\n if ($connection->get_row_num() == 0) {\n header(\"Location: http://\".WEBSITE_URL.\"/index.php?controller=curricula&action=index\");\n }\n\n $curricula_data = $curricula_data[0];\n\n $content .='Teacher: '.$curricula_data['teacher'].'<br>';\n $content .='Subject: '.$curricula_data['subject'].'<br>';\n $content .='Level: '.$curricula_data['level'].'<br>';\n\n\n $columns = array ('start_time_id, end_time_id, weekday_id, classroom_id, timetable_period_id');\n\n $neat_columns = array ('Start Time', 'End Time', 'Week Day', 'Classroom', 'Time Period' , 'Update', 'Delete');\n\n // create curriculum_id array\n $sql = \"SELECT curriculum_id FROM timetables WHERE timetable_id = {$id}\";\n\n $curriculum_id_result = $connection->query($sql);\n $curriculum_id_array = $curriculum_id_result[0];\n\n // time_id, weekday_id, curriculum_id, classroom_id,\n $sql = 'SELECT time_id as start_time_id, time_class as time1 FROM time ORDER BY time_id ASC';\n $time1_result = $connection->query($sql);\n\n $sql = 'SELECT time_id as end_time_id, time_class as time2 FROM time ORDER BY time_id ASC';\n $time2_result = $connection->query($sql);\n\n $sql = 'SELECT weekday_id, weekday FROM weekdays ORDER BY weekday_id';\n $weekdays_result = $connection->query($sql);\n\n $sql = \"SELECT timetable_period_id, CONCAT(nom, ', from ', date_from, ' to ', date_to) as timetable_period FROM timetable_periods ORDER BY date_from\";\n $timetable_periods_result = $connection->query($sql);\n\n $sql = 'SELECT classroom_id, classroom FROM classrooms ORDER BY classroom ASC';\n $classrooms_result = $connection->query($sql);\n\n $drop_down = array(\n 'start_time_id' => array('start_time' => $time1_result),\n 'end_time_id' => array('end_time' => $time2_result),\n 'weekday_id' => array('weekday' => $weekdays_result),\n 'timetable_period_id'=>array('timetable_period'=> $timetable_periods_result),\n 'classroom_id' => array('classroom' => $classrooms_result)\n );\n\n /********************************************************************/\n /* CONFIGURES Form structure */\n\n $form = array(\n 'action' => '?controller=timetable&action=update&id='.$id,\n 'div' => \"class='solitary_input'\",\n 'div_button' => \"class='submit_button1'\",\n 'method' => 'post',\n 'action_links' => array(1 => array('delete', '?controller=timetable&action=delete&id=')),\n 'id' => 'top_form',\n 'elements' => array(\n 1 => array ('hidden' => $curriculum_id_array),\n 3 => array ('drop_down' => 'start_time_id'),\n 4 => array ('drop_down' => 'end_time_id'),\n 5 => array ('drop_down' => 'weekday_id'),\n 6 => array ('drop_down' => 'classroom_id'),\n 7 => array ('drop_down' => 'timetable_period_id'),\n 10 => array ('submit' => 'update')\n )\n );\n\n $table->set_top_form($form);\n\n $table->set_table_name('timetables');\n $table->set_id_column('timetable_id');\n\n $table->set_table_column_names($columns);\n $table->set_html_table_column_names($neat_columns);\n\n $table->set_values_form(); // set values found in database into form elements when building top_form\n $table->set_drop_down($drop_down);\n $table->set_form_array($form);\n\n\n $content .= \"</div>\";\n\n $content .= \" <div class='two_thirds_right'><table>\".$table->details().'</table></div>';\n $output['content'] = $content;\n return $output;\n\n }" ]
[ "0.6414132", "0.5859225", "0.55921197", "0.55882", "0.5575673", "0.5529933", "0.55041534", "0.54908735", "0.5459578", "0.54352945", "0.5390715", "0.53727823", "0.5371271", "0.5362239", "0.53467613", "0.53274226", "0.52940595", "0.5273841", "0.52738124", "0.5262604", "0.52564543", "0.5245355", "0.52301836", "0.5230085", "0.5227017", "0.5205996", "0.51904064", "0.51903826", "0.5188919", "0.51854587", "0.5184832", "0.51738304", "0.51701915", "0.5162183", "0.5160982", "0.51602966", "0.5156239", "0.5154232", "0.5152359", "0.5149206", "0.51376486", "0.5130664", "0.5128613", "0.5126862", "0.5124883", "0.51235455", "0.51125604", "0.5109299", "0.51028985", "0.5101238", "0.50999045", "0.5091735", "0.5081569", "0.5072579", "0.5070852", "0.5068881", "0.50610447", "0.50577426", "0.50547045", "0.5037048", "0.5035758", "0.5033767", "0.5026886", "0.50246763", "0.50241506", "0.50210446", "0.5015475", "0.50110865", "0.5008684", "0.5004032", "0.5002797", "0.50005054", "0.5000476", "0.49897888", "0.49774903", "0.4977152", "0.49743608", "0.49687555", "0.4967029", "0.49466366", "0.49456877", "0.49407804", "0.4939098", "0.4937642", "0.49364656", "0.49332654", "0.492441", "0.492048", "0.4918386", "0.4917488", "0.49146298", "0.49116194", "0.4906704", "0.48940334", "0.48932177", "0.48928183", "0.4891847", "0.48892716", "0.4884992", "0.4882731" ]
0.5036023
60
Store the event details in event collection
public function createEvent(){ $data=$this->request->all(); // print_r($data['event_discription']);die(); $tag=$data['event_discription']; $events=strip_tags($tag); // print_r($events);die(); $validator=Validator::make($data,[ 'event_Name' => 'required', 'event_date' => 'required', 'event_discription' => 'required|min:10', ]); if(!$validator->fails()){ $event=Event::create($data); if ($event) { return "Success"; } else{ return "fail"; } } else{ return redirect('event')->withErrors($validator); } // print_r($data);die(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function storeEvent(){\n \t$eventStore = new Event_Store();\n\n\t\t$eventStore->command = $this->command; \t\n\t\t$eventStore->event = $this->event;\n\t\t$eventStore->status = \"published\";\n\t\t$eventStore->created_at = now();\n\t\t$eventStore->updated_at = now();\n\n\n\t\t$eventStore->save();\n }", "protected function manageEvent()\n {\n // Manage the incoming session\n $this->manageSession();\n\n // Get the event data from the incoming request\n $eventData = $this->eventRequest->getEvent();\n\n // Get the entity data from the event\n $entityData = $eventData->get('entity');\n\n if (!is_array($entityData)) $entityData = [];\n\n // Hydrate the event entity\n $this->eventEntity = $this->hydrateEntity($entityData);\n\n // Create the event object\n $this->event = new WebsiteEvent();\n\n // Format the action\n $action = $eventData->get('action');\n $this->setDefaultAction($action);\n\n $this->event->setAction($action);\n $this->event->setEntity($this->eventEntity);\n $this->event->setCreatedAt(time());\n\n if (!is_null($eventData->get('data'))) {\n $this->event->setData($eventData->get('data'));\n }\n\n // Set any related entities to the event\n $relatedEntityData = $eventData->get('relatedEntities');\n if (is_array($relatedEntityData) && !empty($relatedEntityData)) {\n foreach ($relatedEntityData as $relatedEntity) {\n $relEntityObj = $this->hydrateEntity($relatedEntity);\n $this->event->addRelatedEntity($relEntityObj);\n\n }\n }\n // Set the session to the event\n $this->event->setSession($this->session);\n }", "public function addEvent($event){\n $this->events[]=$event;\n }", "public function save()\n {\n $data = [\n 'eventKey' => $this->eventKey,\n 'eventType' => $this->getEventType(),\n 'eventAction' => $this->getEventAction(),\n 'eventSubjectID' => $this->getSubjectID(),\n 'eventSubjectData' => trim($this->getSubjectData()),\n 'eventUserID' => ($this->user) ? $this->user->id() : 0,\n 'eventTriggered' => date('Y-m-d H:i:s')\n ];\n\n $PerchAPI = new PerchAPI(1.0, 'redfinch_logger');\n $Events = new RedFinchLogger_Events($PerchAPI);\n\n return $Events->create($data);\n }", "public function storeEvent($event)\n {\n $this->entityManager->persist($event);\n $this->entityManager->flush();\n }", "public function EventHelper()\n {\n $eventdata = $this->Event->find('all', \n array(\n 'order' => array('Event.time' => 'DESC')\n ));\n \n $this->set('events', $eventdata); \n }", "function storeEventDetail() // OK\n {\n $dt = $this->_eventDetail->getEventDetail(); \t \n $sql = \"INSERT INTO events\n ( event_id, \n event_type, \n event_date, \n user_id, \n company)\n VALUES ( '{$this->_eventId}',\n '{$this->_eventType}',\n to_date('{$dt['CURRENT_DATE']}', 'MM/DD/YYYY HH24:MI:SS'),\n '{$dt['USER_ID']}',\n '{$dt['COMPANY']}'\n )\";\n if (! db_execute($sql))\n {\n $this->_errors->addError('Error inserting master event record.');\n return false;\n }\n return true;\n }", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'event_type_id' => $this->event_type_id,\n 'user_1_id' => $this->user_1_id,\n 'user_2_id' => $this->user_2_id,\n 'user_1_name' => $this->user_1_name,\n 'user_2_name' => $this->user_2_name,\n 'product_1_name' => $this->product_1_name,\n 'product_2_name' => $this->product_2_name,\n 'data_1' => $this->data_1,\n 'data_2' => $this->data_2\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function store()\n\t{\n\t\t// Create New Event\n\n\t\t$evnt = new Events;\n\t\t$evnt->user_id = Auth::id();\n\t\t$evnt->name = Input::get('name');\n\t\t$evnt->size = Input::get('size');\n\t\t$evnt->time_start = Input::get('start');\n\t\t$evnt->time_end = Input::get('end');\n\t\t$evnt->detail = Input::get('detail');\n\t\t$evnt->location = Input::get('loca');\n\t\t$evnt->category = Input::get('cate');\n\t\t$evnt->save();\n\n\t\t$eid = DB::select('select event_id from event where event_id = (select max(event_id) from event)');\n\t\t$join = new JoinEvent;\n\t\t$join->event_id = $eid[0]->event_id;\n\t\t$join->user_id = Auth::id();\n\t\t$join->active = 1;\n\t\t$join->status = 'owner';\n\t\t$join->save();\t\t\n\n\n\t\treturn Redirect::to('/myevent/create');\n\t\t// return $join;\n\t}", "public function persistEvents()\n {\n $eventsGoogle = $this->getGoogleEvents();\n\n foreach ($eventsGoogle as $eventGoogle){\n $event = new Event();\n $event->setName($eventGoogle->getSummary());\n\n //If it's not existing\n if (!$eventGoogle->getStart()->getDateTime()){\n $start = new \\DateTime($eventGoogle->getStart()->getDate());\n $end = new \\DateTime($eventGoogle->getEnd()->getDate());\n\n $end->sub(new \\DateInterval('PT1S'));\n $event->setStartAt($start);\n $event->setEndAt($end);\n } else {\n $event->setStartAt(new \\DateTime($eventGoogle->getStart()->getDateTime()));\n $event->setEndAt(new \\DateTime($eventGoogle->getEnd()->getDateTime()));\n }\n $event->setIdGoogle($eventGoogle->getId());\n\n //Event with same ID\n\n if (!$this->em->getRepository(Event::class)->findOneBy(['idGoogle' => $event->getIdGoogle()])){\n\n $this->em->persist($event);\n $this->em->flush();\n }\n\n }\n\n }", "function _entryapi_ui_event_form_save_event($form, &$form_state, $location, $organiser) {\n\n $values = $form_state['values'];\n\n $update = FALSE;\n if (isset($form['#event'])) {\n $update = TRUE;\n $event = $form['#event'];\n }\n else {\n $event = new CultureFeed_Cdb_Item_Event();\n }\n\n // Publication date\n if ($values['publication_date']) {\n $event->setPublicationDate($values['publication_date']);\n }\n\n // Age\n $event->setAgeFrom(($values['age'] ? $values['age'] : 0));\n\n // Timestamps as calendar.\n if ($values['when'] == 'one_day' || $values['when'] == 'multiple_days') {\n _entry_api_ui_event_save_timestamps($event, $values);\n }\n\n // Period or permanent as calendar.\n elseif ($values['when'] == 'period' || $values['when'] == 'permanent') {\n _entry_api_ui_event_save_weekscheme($event, $values);\n }\n\n // Categories.\n $category_values = $values['kijken_en_luisteren'];\n $category_values += $values['doen'];\n $category_values += $values['bezoeken'];\n $category_options = $form['what']['kijken_en_luisteren']['#options'];\n $category_options += $form['what']['doen']['#options'];\n $category_options += $form['what']['bezoeken']['#options'];\n\n $categories = new CultureFeed_Cdb_Data_CategoryList();\n foreach ($category_values as $key => $value) {\n if ($value) {\n $categories->add(new CultureFeed_Cdb_Data_Category(CultureFeed_Cdb_Data_Category::CATEGORY_TYPE_EVENT_TYPE, $value, $category_options[$value]));\n }\n }\n $event->setCategories($categories);\n\n // Event details.\n $detail = new CultureFeed_Cdb_Data_EventDetail();\n $detail->setTitle($values['title']);\n if (!empty($values['short_description'])) {\n $detail->setShortDescription($values['short_description']);\n }\n $detail->setLanguage(culturefeed_search_get_preferred_language());\n\n $details = new CultureFeed_Cdb_Data_EventDetailList();\n $details->add($detail);\n $event->setDetails($details);\n\n // Location / Address.\n $addresses = $location->getEntity()->getContactInfo()->getAddresses();\n $address = $addresses[0];\n\n // Event location\n $cdbLocation = new CultureFeed_Cdb_Data_Location($address);\n $cdbLocation->setLabel($values['location']);\n $cdbLocation->setCdbid($location->getId());\n $event->setLocation($cdbLocation);\n\n // Event organiser.\n $organiser_object = new CultureFeed_Cdb_Data_Organiser();\n $organiser_object->setLabel($values['organiser']);\n $organiser_object->setCdbid($organiser->getId());\n $event->setOrganiser($organiser_object);\n\n // Contact info.\n $physical_address = $address->getPhysicalAddress();\n $contact_object = new CultureFeed_Cdb_Data_ContactInfo();\n $contact_object->addAddress(new CultureFeed_Cdb_Data_Address($physical_address));\n\n foreach ($values['contacts'] as $contact) {\n\n if (!empty($contact['text'])) {\n switch ($contact['type']) {\n\n case 'website':\n $contact_object->addUrl(new CultureFeed_Cdb_Data_Url($contact['text'], FALSE, $contact['reservation']));\n break;\n\n case 'email':\n $contact_object->addMail(new CultureFeed_Cdb_Data_Mail($contact['text'], FALSE, $contact['reservation']));\n break;\n\n case 'phone':\n $contact_object->addPhone(new CultureFeed_Cdb_Data_Phone($contact['text'], CultureFeed_Cdb_Data_Phone::PHONE_TYPE_PHONE, FALSE, $contact['reservation']));\n break;\n\n }\n }\n\n\n }\n\n $event->setContactInfo($contact_object);\n\n try {\n\n if ($update) {\n DrupalCultureFeed_EntryApi::updateEvent($event);\n $form_state['#event_id'] = $event->getCdbId();\n }\n else {\n $form_state['#event_id'] = DrupalCultureFeed_EntryApi::createEvent($event);\n }\n\n $form_state['#update_event'] = $update;\n\n }\n catch (Exception $e) {\n watchdog_exception('entry_api_ui', $e);\n form_set_error('', 'Er ging iets fout tijdens het bewaren.');\n }\n\n}", "public function saveEvent(){\n\t\t$this->load->database();\n\t\t//if this object is new event : insert it to db\n\t\tif($this->id === -1){\n\t\t\t$this->db->query(\"INSERT INTO event (title,des,image,author,postdate,duedate) \n\t\t\t\n\t\t\tVALUES ('$this->title',\n\t\t\t\t\t'$this->des',\n\t\t\t\t\t'$this->image',\n\t\t\t\t\t'$this->author',\n\t\t\t\t\t'$this->postdate',\n\t\t\t\t\t'$this->duedate'\n\t\t\t\t\t)\");\n\t\t}\n\t\t//if this object is exist event : edit it\n\t\telse{\n\t\t\t$this->db->query(\"UPDATE event SET \n\t\t\t\t\n\t\t\t\ttitle='$this->title',\n\t\t\t\tdes='$this->des',\n\t\t\t\timage='$this->image',\n\t\t\t\tpostdate='$this->postdate',\n\t\t\t\tduedate='$this->duedate' \n\t\t\t\t\n\t\t\t\tWHERE id='$this->id'\");\n\t\t}\n\t}", "function eventclass_staff_info()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n//\tonscreen events\n\n\n\t}", "public function saveAction()\r\n\t{\r\n\t\t$eventId = $this->getRequest()->getParam('event_id');\r\n\t\t$eventModel = Mage::getModel('master_example/event')->load($eventId);\r\n\r\n\t\tif($data = $this->getRequest()->getPost()){\r\n\t\t\ttry{\r\n\t\t\t\t$eventModel->addData($data)\r\n\t\t\t\t\t->save();\r\n\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess($this->__(\"your event has been saved\"));\r\n\t\t\t} catch (Exception $e){\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->setEventFormData($data); // persist the values\r\n\t\t\t\t$this->_redirect('*/*/edit', array('_current' => true));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->_redirect('*/*/index');\t\r\n\t}", "public function it_stores_events_raised_by_our_jas_app() : void\n {\n $id = '8741e80e-153f-4254-b13e-21ac8ac34948';\n $this->json('POST', '/store-jas-events', [\n 'id' => $id,\n 'name' => 'GameStarted',\n 'date' => 1_503_301_742_819,\n 'payload' => [\n 'game_id' => 'hoi'\n ]\n ])->seeJson([\n 'created' => true\n ]);\n\n $this->seeInDatabase('jas_events', [\n 'uuid' => $id,\n 'name' => 'GameStarted',\n 'date' => 1_503_301_742_819,\n ]);\n }", "public function store(Request $request)\n {\n $request->validate([\n 'event-title' => 'required',\n 'event-message' => 'required',\n 'eventStart-date' => 'required',\n 'event-time' => 'required'\n\n ]);\n\n $event = new Event();\n\n $title = request('event-title');\n $startDate = request('eventStart-date');\n $endDate = request('eventEnd-date');\n $time = request('event-time');\n $event_description = request('event-message');\n\n $event_description = preg_replace(\"/^<p.*?>/\", \"\", $event_description);\n $event_description = preg_replace(\"|</p>$|\", \"\", $event_description);\n $time = preg_replace('/\\s+/', '', $time) ;\n $registra = Auth::user()->name;\n\n $event->title = $title;\n $event->start_date = $startDate;\n $event->end_date = $endDate;\n $event->start_time = $time;\n $event->description = $event_description;\n $event->event_registra = $registra;\n $registraEmail = Auth::user()->email;\n $registraPhone = Auth::user()->contact;\n $subject = \"New Event\";\n\n $event_save_status = $event->save();\n\n if($event_save_status){\n\n $users = User::all();\n\n ($endDate == \"\")?\n $endDate_of_event = \"the same day\" : $endDate_of_event = $endDate;\n \n\n $data = array(\n 'title' => $title,\n 'description' => $event_description,\n 'start_date' => $startDate,\n 'end_date' => $endDate_of_event,\n 'time' => $time,\n 'registra' => $registra,\n 'registra_email' => $registraEmail,\n 'registraMobileNo' => $registraPhone,\n 'subject' => $subject,\n );\n\n $action = \"Recorded an event with the title '\".$title.\"'\";\n LogsController::logger($action, $this->date_of_action);\n\n $notified = Notification::send($users, new EventNotifier($data));\n \n $central = new CentralController();\n if($central->is_connectedToInternet() == 1)\n {\n $user_emails = $this->getUserEmails();\n Mail::send('pages.mail.mail_event', $data, function($message) use ($title,$event_description, $startDate,$endDate_of_event,\n $time, $registra,$registraEmail,$user_emails,$registraPhone,$subject)\n { \n $message->from($registraEmail, 'Dallington');\n $message->to($user_emails)->subject($subject);\n }); \n\n if(Mail::failures()){\n return redirect('events/event-form')->with('event-success','Event has been recorded successfully and all users of the system have been notified with in the app notification but not via email because of internet connection issues');\n\n } \n\n else{\n\n return redirect('events/event-form')->with('event-success','Event has been recorded successfully & all users of the system have been notified within the app notification & email'); \n }\n\n }\n\n else if($central->is_connectedToInternet() == 0)\n {\n return redirect('events/event-form')->with('event-success','Event has been recorded successfully and all users of the system have been notified only in app notification');\n\n }\n\n\n\n }\n else\n {\n return redirect('events/event-form')->with('event-fail','Event has not been recorded!');\n }\n\n}", "public function postEventadd();", "public function store(Request $request)\n {\n $this->validate($request,array(\n 'title'=>'required|max:255'\n ));\n //insert into db\n $user = Auth::user();\n $event=new Event;\n $event->title = $request->title;\n $event->location = $request->location;\n $event->description = $request->description;\n $event->emailid = $user->email;\n\n // if(empty($request->session()->get('event'))){\n // $event=new Event;\n // $event->title = $request->title;\n // $event->location = $request->location;\n // $event->description = $request->description;\n // $event->emailid = $user->email;\n // $request->session()->put('event', $event);\n // }else{\n // $event = $request->session()->get('event');\n // $event->title = $request->title;\n // $event->location = $request->location;\n // $event->description = $request->description;\n // $event->emailid = $user->email;\n // // $product->fill($validatedData);\n // $request->session()->put('event', $event);\n // }\n $event->save();\n $dates=$request->date;\n $starttimes=$request->starttime;\n $endtimes=$request->endtime;\n\n $participant=Participant::where('emailid',$user->email)->get();\n if(!isset($participant))\n {\n $participant=new Participant;\n $participant->name=$user->name;\n $participant->emailid=$event->emailid;\n $participant->save();\n }\n\n $eventParticipation=EventParticipation::where('emailid',$user->email)->get();\n // if(!isset($eventParticipation))\n // {\n $eventParticipation= new EventParticipation;\n $eventParticipation->eventid=$event->id;\n $eventParticipation->emailid=$event->emailid;\n $eventParticipation->save();\n // }\n\n foreach($dates as $key=>$value){\n $eventSlot=new EventSlot;\n $eventParticipationSlot=new EventParticipationSlot;\n $eventSlot->slotid=$key+1;\n $eventSlot->eventid=$event->id;\n $eventSlot->date=$value;\n $eventSlot->starttime=$starttimes[$key];\n $eventSlot->endtime=$endtimes[$key];\n $eventSlot->save();\n $eventParticipationSlot->eventid=$event->id;\n $eventParticipationSlot->slotid=$eventSlot->slotid;\n $eventParticipationSlot->emailid=$event->emailid;\n $eventParticipationSlot->response=true;\n $eventParticipationSlot->save();\n // $eventSlot.save();\n }\n\n\n\n $emailerListString=$request->emaillist;\n if(isset($emailerListString))\n {\n $emailerList=explode(\";\",$emailerListString );\n foreach($emailerList as $emailTo)\n {\n Mail::to($emailTo)->send(new DemoEmail(route('events.show',$event->id)));\n }\n }\n //redirect\n return redirect()->route('events.show',$event->id);\n }", "public static function saved($event) {\n\n\t\t$account = $event->getSubject();\n\t\t$new = $event['new'];\n\n\t}", "public function store()\n\t{\n $data \t\t= $this->inputAll();\n $rules = $this->events->getRules();\n\n\n $properties = array();\n unset($data['storage_events_id']);\n if(isset($data['properties_id']) && count($data['properties_id']))\n {\n $properties = (is_array($data['properties_id'])) ? $data['properties_id'] : [];\n unset($data['properties_id']);\n }\n\n $data['is_arifmetic'] = (isset($data['is_arifmetic'])) ? $data['is_arifmetic'] : 0;\n\n $validator \t= $this->validator->make($data, $rules);\n if ($validator->fails())\n {\n return $this->redirect->back()->withErrors($validator)->withInput();\n }\n\n $eventCreated = $this->events->create($data);\n if($eventCreated)\n {\n if(count($properties))\n foreach($properties as $num => $id)\n StorageEventsHasEventsProperties::create(array(\"storage_events_id\" => $eventCreated->id, \"event_prop_id\" => $id));\n }\n\n return $this->redirect('events.index');\n\t}", "public function store(EventRequest $request) {\n if (Auth::user()->profile != 'admin') {\n abort(403);\n } else {\n \\App\\Event::create([\n 'name' => $request->name,\n 'event' => $request->event,\n 'point' => $request->point,\n 'start' => $request->start,\n 'end' => $request->end,\n ]);\n $request->session()->flash('alert', 'success');\n $request->session()->flash('status', 'เพิ่มข้อมูลกิจกรรมเรียบร้อยแล้ว');\n return redirect()->back();\n }\n }", "public function persist()\n {\n\n $this->persistor->persist(\n $this->event,\n $this->relatedEntities,\n $this->eventRequest->getApplication(),\n $this->eventRequest->getAccount(),\n $this->eventRequest->getProduct(),\n $this->eventRequest->appendCustomer\n );\n\n }", "public function store(Request $request)\n {\n\n $this->validate($request, array(\n 'name' => 'required|max:255',\n 'description' => 'required',\n 'category_id' => 'required|integer',\n 'location_id' => 'required',\n 'amount_tickets' => 'required',\n 'event_colour' => 'required'\n ));\n\n $event = new Event;\n\n $event->name = $request->name;\n \n $slug = preg_replace(\"/ {2,}/\", \" \", $request->name);\n $slug = str_replace(\" \", \"-\", $slug);\n $slug = strtolower($slug); \n\n $event->slug = $slug;\n $event->description = $request->description;\n\n $event->hash = hash('ripemd160', preg_replace('/[^A-Za-z0-9\\-]/', '', $slug));\n\n $event->event_date = $request->event_date . \" \" . $request->event_time;\n\n\n if($request->location_id == 'CREATE') \n {\n $location = (new LocationController)->createLocation($request->add_location_name, 1000, $request->add_location_street, $request->add_location_streetnumber, $request->add_location_additional, $request->add_location_city, $request->add_location_zipcode, $request->add_location_country);\n $event->location_id = $location;\n }\n else \n {\n $event->location_id = $request->location_id;\n }\n\n $event->amount_tickets = $request->amount_tickets;\n $event->event_colour = $request->event_colour;\n $event->dark_event_colour = (new ColourController)->darken_colour($event->event_colour);\n $event->creator = \\Request::ip();\n $event->category_id = $request->category_id;\n\n $event->save();\n\n if($request->add_tag_name !== NULL) {\n $tag = (new TagController)->createTag($request->add_tag_name);\n $event->tags()->sync($tag, false);\n } else {\n $event->tags()->sync($request->tags, false);\n }\n\n $tickets = (new TicketController)->generate($event->amount_tickets, $event->id);\n\n Session::flash('success', 'The event was succesfully created.');\n\n return redirect()->route('events.show', $event->id);\n }", "function admin_add() {\n\t\tif (!empty($this->data)) {\n\t\t\t$this->Event->create();\n\t\t\tif ($this->Event->save($this->data)) {\n\t\t\t\t$this->Session->setFlash('This Event has been saved.');\n\t\t\t\t$this->redirect(array('action'=>'admin_index'),null,true);\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash('This Event could not be saved. Please try again.');\n\t\t\t}\n\t\t}\n\t\t$tags = $this->Event->Tag->find('list');\n\t\t$this->set(compact('tags'));\n\t}", "private function pushEvents ($e)\n\t\t{\n\t\t\t if ( self::chkOrgId () ) { /* Check main Id */\n\t\t\t\t $dbs = new DB ( $this->config['database'] );\n\t\t\t\t $c = $dbs->query (\"SELECT COUNT(*) AS C FROM tbl_events_record WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t\t if ( ! $c[0]['C'] ) { /* Event not found in events table , Insert */ \n\t\t\t\t\t$db_ins = new DB ( $this->config['database'] ) ;\n \t \t$e_ins = $db_ins->query (\"INSERT INTO tbl_events_record \n\t\t\t\t\t\tVALUES('\" . $this->c . \"','\" . $e . \"','\". date('Y-m-d H:i:s').\"');\");\n\t\t\t\t\t$db_ins->CloseConnection ();\n\t\t\t\t\treturn true;\n\t\t\t\t } else { /* Event found in events table , Update events by Id */\n\t\t\t\t\t$db_upd = new DB ( $this->config['database'] ) ;\n\t\t\t\t\t$e_upd = $db_upd->query (\"UPDATE tbl_events_record \n\t\t\t\t\t\tSET events = '\".$e.\"', date_rec = '\". date('Y-m-d H:i:s') . \n\t\t\t\t\t\t\"' WHERE org_id = '\" . $this->c .\"'\");\n\t\t\t\t\t$db_upd->CloseConnection ();\n\t\t\t\t}\n\t\t\t\t$dbs->CloseConnection ();\n\t\t\t\t$this->result['data']['id'] = $this->c;\n\t\t\t\t$this->result['data']['result'] = \"Push event: \" . $e; /* Events status */\n\t\t\t } else /* Id not found */\n\t\t\t\t$this->result['data']['result'] = \"Id not found [error code:100:101]\";\n\n\t\t\treturn false;\n\t\t}", "function addEvent($date,$title,$user_id,$fname,$address,$contact,$email,$location,$vlocation,$hour,$minutes,$choice,$tier,$flavor,$info,$confirmation){\r\n\t//Include db configuration file\r\n\tinclude 'dbConfig.php';\r\n\t$currentDate = date(\"Y-m-d H:i:s\");\r\n\t//Insert the event data into database\r\n\t$insert = $db->query(\"INSERT INTO cakemaker (title,date,created,modified,user_id,fname,address,contact,email,location,vlocation,hour,minutes,choice,tier,flavor,info,confirmation) VALUES ('\".$title.\"','\".$date.\"','\".$currentDate.\"','\".$currentDate.\"','\".$user_id.\"','\".$fname.\"','\".$address.\"','\".$contact.\"','\".$email.\"','\".$location.\"','\".$vlocation.\"','\".$hour.\"','\".$minutes.\"','\".$choice.\"','\".$tier.\"','\".$flavor.\"','\".$info.\"','\".$confirmation.\"')\");\r\n\tif($insert){\r\n\t\techo 'ok';\r\n\t}else{\r\n\t\techo 'err';\r\n\t}\r\n}", "function storeForReading($title, $partOf, $location, $calendarEventId, $startTime, $masterEventId) {\n\t$simpleEvent['title'] = $title;\n\t$simpleEvent['partOf'] = $partOf;\n\t$simpleEvent['location'] = $location;\n\t$simpleEvent['calendarEventId'] = $calendarEventId;\n\t$simpleEvent['startTime'] = $startTime;\n\t$simpleEvent['masterEventId'] = $masterEventId;\n\treturn $simpleEvent;\n}", "public function initEvents()\n\t{\n\t\t$this->collEvents = new PropelObjectCollection();\n\t\t$this->collEvents->setModel('Event');\n\t}", "public function __construct()\n {\n $this->events = new ArrayCollection();\n }", "public function store()\n\t{\n\t\t$data = Input::all();\n\t\t$rules = array('title'=>'required|unique:events',\n\t\t\t\t\t 'event_start'=>'required',\n\t\t\t\t\t 'event_end'=>'required',\n\t\t\t\t\t 'event_details'=>'required',\n\t\t\t\t\t 'location'=>'required');\n\n\n\t\t$message = array(\"required\"=>Helpers::errorLabel(\" is required!\"),\n\t\t\t \"unique\"=>Helpers::errorLabel(\" has been taken!\"));\n\t\t$v = Validator::make($data,$rules,$message);\n\t\tif($v->fails()){\n\t\t\treturn Redirect::to('events/create')->withErrors($v)->withInput();\n\t\t}\n\t\telse{\n\t\t\t\t$e = new Event_Manager;\n\t\t\t\t$e->title = $data['title'];\n\t\t\t\t$e->location = $data['location'];\n\t\t\t\t$e->event_start = $data['event_start'];\n\t\t\t\t$e->event_end = $data['event_end'];\n\t\t\t\t$e->event_details = $data['event_details'];\n\t\t\t\t$e->save();\t\n\n\t\t\t\tSession::flash('message',Helpers::message(\"Event Successfully Added!\"));\n\t\t\t\treturn Redirect::to('events/create');\n\t\t\t}\n\t}", "private function createinstallevent()\n {\n $cat = CategoryUtil::getCategoryByPath('/__SYSTEM__/Modules/PostCalendar/Events');\n\n $eventArray = array(\n 'title' => $this->__('PostCalendar Installed'),\n 'hometext' => ':text:' . $this->__('On this date, the PostCalendar module was installed. Thank you for trying PostCalendar! This event can be safely deleted if you wish.'),\n 'alldayevent' => true,\n 'eventstatus' => PostCalendar_Entity_CalendarEvent::APPROVED,\n 'sharing' => PostCalendar_Entity_CalendarEvent::SHARING_GLOBAL,\n 'website' => 'https://github.com/craigh/PostCalendar/wiki',\n 'categories' => array(\n 'Main' => $cat['id']));\n\n try {\n $event = new PostCalendar_Entity_CalendarEvent();\n $event->setFromArray($eventArray);\n $this->entityManager->persist($event);\n $this->entityManager->flush();\n } catch (Exception $e) {\n return LogUtil::registerError($e->getMessage());\n }\n\n return true;\n }", "public function store(Request $request)\n {\n $data=$request->all();\n $event = new Events;\n $user=auth()->id();\n\n // dd($user);\n $event->user_id=Auth::id();\n $event->event_name=$data['name'];\n $event->date=$data['date'];\n $event->event_description=$data['text'];\n $event->slot=$data['choice'];\n $event->save();\n // dd();\n }", "public function store(EventRequest $request)\n {\n $event = new Event;\n $event->event = $request->event;\n $event->organizer = $request->organizer;\n $event->description = $request->description;\n\n $event->start_date = Carbon::parse($request->start_date);\n $event->end_date = Carbon::parse($request->end_date);\n $week= Carbon::parse($request->start_date)->dayOfWeekIso;\n $color_array = ['#f39c12', '#e84393', '#27ae60', '#d35400', '#2980b9', '#8e44ad', '#c0392b'];\n $event->color = $color_array[$week-1];\n $event->user_id = $request->author;\n $event->view = \"0\";\n $event->slug = slug_th($request->event);\n $event->save();\n return back()->with([\n 'alert' => 'alert-success',\n 'message' => 'บันทึกข้อมูลเรียบร้อย!',\n ]);\n }", "function add_event($input = array()) {\r\n \r\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\r\n \r\n // check if user is logged in\r\n if (!isset($_SESSION['active']) || $_SESSION['active'] === false) {\r\n header(\"location: \" . $_SERVER['PHP_SELF'] . \"?action=login&error=err_login_to_add_event\");\r\n return;\r\n }\r\n \r\n require(HOME_DIR . 'libs/event.class.php');\r\n $event = new event;\r\n \r\n\r\n $event->creator_id = $_SESSION['user_id'];\r\n // check if title is empty\r\n if (empty($input['title'])) {\r\n $this->tpl->assign('ERROR_TITLE', 'err_title_empty');\r\n return;\r\n }\r\n $event->title = $input['title'];\r\n \r\n // check description\r\n if (empty($input['description'])) {\r\n $this->tpl->assign('ERROR_DESCRIPTION', 'err_description_empty');\r\n return;\r\n }\r\n $event->description = $input['description'];\r\n\r\n // check label\r\n $label = $input['label'];\r\n $label = json_decode($label);\r\n $event->label = $label;\r\n \r\n // check date\r\n $event->fixed_date = isset($input['fixed_date']) ? 1 : 0;\r\n $event->start_date = date('Y-m-d', mktime($input['start_date']));\r\n $event->start_time = date('h:i', mktime($input['start_time']));\r\n\r\n // check location\r\n $event->fixed_location = isset($input['fixed_location']) ? 1 : 0;;\r\n \r\n // handle number of participants\r\n $event->limited_number_of_participants = isset($input['limited_number_of_participants']) ? 1 : 0;\r\n $event->max_number_of_participants = $input['max_number_of_participants'];\r\n \r\n // handle reservations\r\n $event->advance_reservation_required = isset($input['advance_reservation_required']) ? 1 : 0; \r\n $event->confirm_reservations = isset($input['advance_reservation_required']) && isset($input['confirm_reservations']) ? 1 : 0;\r\n\r\n $event->insert_into_db();\r\n header(\"location: \" . $_SERVER['PHP_SELF'] . \"?action=dashboard&message=event_successfully_created\"); \r\n } \r\n }", "protected function initEvent()\n {\n $locales = $this->container->getParameter('event.locales');\n $event = $this->getRepository('EventEventBundle:Event')->getEvent();\n $now = new \\DateTime();\n\n if (!$event) {\n $event = new Event();\n $event\n ->setTitle('My Event')\n ->setDescription('My another awesome event!')\n ->setStartDate($now)\n ->setEndDate($now->modify('+1 day'))\n ->setVenue('Burj Khalifa Tower')\n ->setEmail('[email protected]')\n ;\n\n $speaker = new Speaker();\n $speaker\n ->setFirstName('Phill')\n ->setLastName('Pilow')\n ->setCompany('Reseach Supplier')\n ;\n\n if ($locales) {\n foreach ($locales as $locale => $title) {\n $eventTranslation = new EventTranslation();\n $eventTranslation->setEvent($event);\n $eventTranslation->setlocale($locale);\n\n $this->getManager()->persist($eventTranslation);\n\n $speakerTranslation = new SpeakerTranslation();\n $speakerTranslation->setSpeaker($speaker);\n $speakerTranslation->setlocale($locale);\n\n $this->getManager()->persist($speakerTranslation);\n }\n }\n\n $this->getManager()->persist($event);\n $this->getManager()->persist($speaker);\n $this->getManager()->flush();\n }\n }", "public function store(Request $request)\n {\n // $events = new Events();\n // $events->Act_id = $request->Act_id;\n // $events->Temp_id = $request->Temp_id;\n // $events->Event_start = $request->Event_start;\n // $events->Event_end = $request->Event_end;\n // $events->Color = $request->Color;\n\n // // dd($events);\n // $events->save();\n\n\n \n // return redirect('admincalen');\n }", "public function events()\n {\n $templateCalendarEvent = factory(TemplateCalendarEvent::class)->create();\n $calendarEvent = factory(CalendarEvent::class)->make();\n $calendarEvent->template()->associate($templateCalendarEvent);\n $calendarEvent->save();\n\n $this->assertInstanceOf(CalendarEvent::class, $templateCalendarEvent->events()->first());\n }", "public function store()\n\t{\n\t\t\t\n\t\t\t$event = new EventData();\n\t\t\t$event->message_severity = Input::get('message_severity');\n\t\t\t$publisherCode = Input::get('publisher_code');\n\t\t\t$typeCode = Input::get('type_code');\n\t\t\t$eventData = Input::get('event_data');\n\t\t\t\n\t\t\t$publishers = DB::table('event_publishers')->where('publisher_code', '=', $publisherCode)->get();\n\t\t\t$publisherId = null;\n\t\t\tforeach ($publishers as $publisher)\n\t\t\t{\n\t\t\t\t$publisherId = $publisher->id;\n\t\t\t}\n\t\t\tif (is_null($publisherId)) {\n\t\t\t\treturn Response::json(array('error' => true, 'message' => 'Publisher Code does not exist.'), 400);\n\t\t\t}\n\t\t\tif (is_null($typeCode)) {\n\t\t\t\treturn Response::json(array('error' => true, 'message' => 'Event Type Code is required.'), 400);\n\t\t\t}\n\t\t\tif (is_null($eventData)) {\n\t\t\t\treturn Response::json(array('error' => true, 'message' => 'Event Data is required.'), 400);\n\t\t\t}\n\t\t\t\t\n\t\t\t$event->event_publisher_id = $publisherId;\n\t\t\t$event->event_type_code = $typeCode;\n\t\t\t\n\t\t\t$event->event_data = json_encode($eventData);\n\t\t\t\n\t\t\t$event->save();\n\t\t\t\n\t\t\tNotificationRulesProcessor::processRule($event,'api');\n\t\t\treturn Response::json(array('error' => false,'event' => $event->toArray()),200);\n\t}", "public function events()\n {\n $eventdata = $this->Event->find('all', \n array(\n 'order' => array('Event.time' => 'DESC'),\n 'condition' => array('type' => 'Event')\n ));\n \n $this->set('events', $eventdata);\n \n $this->assignUserToView($this->Auth->user('id'));\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Info');\n }", "public function store()\n {\n $request = request();\n\n //make sure the end date is in the future or equal to the start date,\n //but don't allow for an end date to be less than the start date.\n $validator = Validator::make($request->all(), [\n 'end' => 'required|date|after_or_equal:start'\n ]);\n\n if ($validator->fails()) {\n // set error message\n session()->flash('alert-danger', 'You can not make an event that has an end date before the start date!');\n\n return redirect()->back()->withInput();\n }\n\n $item = EventFacade::create($request->except('tags', 'image', 'gallery'));\n\n // deal with event tags\n if ($request->has('tags')) {\n $tags = $request->input('tags');\n $item->addTags($tags);\n }\n\n $data = $request->only('image', 'gallery');\n\n // call media manager file handler\n call_user_func_array($this->fileHandler, [&$item, &$data, 'image']);\n call_user_func_array($this->fileHandler, [&$item, &$data, 'gallery', false]);\n\n // set success message\n session()->flash('alert-success', 'Event saved successfully!');\n\n return redirect()->route('admin.event.index');\n }", "function addEventToDB() {\r\n\r\n\tglobal $MySelf;\r\n\tglobal $DB;\r\n\r\n\t// is the events module active?\r\n\tif (!getConfig(\"events\")) {\r\n\t\tmakeNotice(\"The admin has deactivated the events module.\", \"warning\", \"Module not active\");\r\n\t}\r\n\t\r\n\t// Are we allowed to add Events?\r\n\tif (!$MySelf->canEditEvents()) {\r\n\t\tmakeNotice(\"You are not allowed to add events!\", \"error\", \"Forbidden!\");\r\n\t}\r\n\r\n\t// Do we have a short description?\r\n\tif (empty ($_POST[sdescr])) {\r\n\t\tmakeNotice(\"You need to supply a short description!\", \"error\", \"Important field missing!\");\r\n\t}\r\n\r\n\t// Do we have an officer?\r\n\tif (empty ($_POST[officer])) {\r\n\t\tmakeNotice(\"You need to supply who is in command!\", \"error\", \"Important field missing!\");\r\n\t}\r\n\t\r\n\t// Choose which supplied officer we use.\r\n\tif (!empty($_POST[officer2])) {\r\n\t\tsanitize($officer = sanitize($_POST[officer2]));\r\n\t} else {\r\n\t\tsanitize($officer = sanitize($_POST[officer]));\r\n\t}\r\n\t\r\n\t// Choose which system we use.\r\n\tif (!empty($_POST[system2])) {\r\n\t\t$system = strtolower($_POST[system2]);\r\n\t} else {\r\n\t\t$system = strtolower($_POST[system]);\r\n\t}\r\n\t\r\n\t// Check that we still have a valid systemname.\r\n\tif (empty($system)) {\r\n\t\tmakeNotice(\"No valid Systemname found! Please go back, and try again.\", \"warning\", \"No system name\",\r\n\t\t \"index.php?action=addevent\", \"[cancel]\");\r\n\t}\r\n\r\n\t// Do we have an ETD?\r\n\tif (empty ($_POST[dur])) {\r\n\t\tmakeNotice(\"You need to tell me the guessed runtime!\", \"error\", \"Important field missing!\");\r\n\t}\r\n\r\n\t// Collateral?\r\n\tif (!is_numeric($_POST[collateral]) && $_POST[collateral] < 0) {\r\n\t\tmakeNotice(\"You need to supply a valid collateral!\", \"error\", \"Important field missing!\");\r\n\t}\r\n\r\n\t// Do we have an ETD?\r\n\tif ($_POST[payment] < 0) {\r\n\t\tmakeNotice(\"You need to give the folks some money!\", \"error\", \"Important field missing!\");\r\n\t}\r\n\r\n\t// Startting time goodness.\r\n\t$myTime = array (\r\n\t\t\"day\" => \"$_POST[ST_day]\",\r\n\t\t\"month\" => \"$_POST[ST_month]\",\r\n\t\t\"year\" => \"$_POST[ST_year]\",\r\n\t\t\"hour\" => \"$_POST[ST_hour]\",\r\n\t\t\"minute\" => \"$_POST[ST_minute]\",\r\n\t\t\r\n\t);\r\n\t$starttime = humanTime(\"toUnix\", $myTime);\r\n\r\n\t// is the time valid?\r\n\tif (!$starttime) {\r\n\t\tmakeNotice(\"Invalid time supplied!\", \"error\", \"Invalid Time!\");\r\n\t}\r\n\r\n\t// Lets see what ships are required.\r\n\t$SHIPTYPES = array (\r\n\t\t\"shuttles\",\r\n\t\t\"frigates\",\r\n\t\t\"destroyers\",\r\n\t\t\"cruisers\",\r\n\t\t\"bcruiser\",\r\n\t\t\"scruiser\",\r\n\t\t\"bship\",\r\n\t\t\"dread\",\r\n\t\t\"carrier\",\r\n\t\t\"titan\",\r\n\t\t\"barges\",\r\n\t\t\"indies\",\r\n\t\t\"freighter\",\r\n\t\t\"jfreighter\",\r\n\t\t\"exhumer\"\r\n\t);\r\n\tforeach ($SHIPTYPES as $ship) {\r\n\t\tif ($_POST[$ship] == \"on\") {\r\n\t\t\t$wantedships[] = $ship;\r\n\t\t}\r\n\t}\r\n\t$ships = serialize($wantedships);\r\n\r\n\t$p = $DB->query(\"INSERT INTO events (sdesc, officer, system, security, type, starttime, \" .\r\n\t\"duration, difficulty, payment, collateral, notes, ships)\r\n\t values (?,?,?,?,?,?,?,?,?,?,?,?)\", array (\r\n\t\tsanitize($_POST[sdescr]),\r\n\t\t$officer,\r\n\t\t$system,\r\n\t\tsanitize($_POST[security]),\r\n\t\tsanitize($_POST[type]),\r\n\t\tsanitize($starttime),\r\n\t\tsanitize($_POST[dur]),\r\n\t\tsanitize($_POST[difficulty]),\r\n\t\tsanitize($_POST[payment]),\r\n\t\tsanitize($_POST[collateral]),\r\n\t\tsanitize($_POST[notes]),\r\n\t\t\"$ships\"\r\n\t));\r\n\r\n\tif ($DB->affectedRows() == 1) {\r\n\r\n\t\t// Prepare the announcement email.\r\n\t\tglobal $SITENAME;\r\n\t\tglobal $VERSION;\r\n\t\tglobal $URL;\r\n\r\n\t\t// Bloody hack to get latest ID. No one will ever know. ;)\r\n\t\t$lastID = $DB->getCol(\"SELECT max(ID) from events;\");\r\n\t\t$risks = array (\r\n\t\t\t\"No risk involved.\",\r\n\t\t\t\"Only inferior forces suspected.\",\r\n\t\t\t\"Somewhat risky.\",\r\n\t\t\t\"Moderate risk.\",\r\n\t\t\t\"Extreme risks are involved.\",\r\n\t\t\t\"No survivors expected.\"\r\n\t\t);\r\n\t\t$risk_index = $_POST[difficulty];\r\n\r\n\t\t// Fix the template up.\r\n\t\t$email = str_replace(\"{{ID}}\", str_pad(\"$lastID[0]\", \"5\", \"0\", STR_PAD_LEFT), getTemplate(\"newevent\", \"email\"));\r\n\t\t$email = str_replace(\"{{SDESCR}}\", $_POST[sdescr], $email);\r\n\t\t$email = str_replace(\"{{TYPE}}\", $_POST[type], $email);\r\n\t\t// In case of a numeric value we have to translate that into plain english.\r\n\t\tif (is_numeric($_POST[officer])) {\r\n\t\t\t$officer = idToUsername($_POST[officer]);\r\n\t\t} else {\r\n\t\t\t$officer = sanitze($_POST[officer]);\r\n\t\t}\r\n\t\t$email = str_replace(\"{{FLAGOFFICER}}\", ucfirst($officer), $email);\r\n\t\t$email = str_replace(\"{{SYSTEM}}\", $_POST[system], $email);\r\n\t\t$email = str_replace(\"{{SECURITY}}\", $_POST[security], $email);\r\n\t\t$email = str_replace(\"{{STARTTIME}}\", date(\"d.m.y H:i:s\", $starttime), $email);\r\n\t\t$email = str_replace(\"{{DURATION}}\", $_POST[dur], $email);\r\n\t\t$email = str_replace(\"{{RISK}}\", $risks[$risk_index], $email);\r\n\t\t$email = str_replace(\"{{PAYMENT}}\", $_POST[payment], $email);\r\n\t\t$email = str_replace(\"{{COLLATERAL}}\", number_format($_POST[collateral], 2), $email);\r\n\t\t$email = str_replace(\"{{NOTES}}\", $_POST[notes], $email);\r\n\t\t$email = str_replace(\"{{SITENAME}}\", $SITENAME, $email);\r\n\t\t$email = str_replace(\"{{URL}}\", $URL, $email);\r\n\t\t$email = str_replace(\"{{VERSION}}\", $VERSION, $email);\r\n\r\n\t\t// mail the user.\r\n\t\tmailUser($email, \"New event added!\");\r\n\r\n\t\t// Tell the admin what we did.\r\n\t\tmakeNotice(\"Event added to the database and users who are opt-in got an email.\", \"notice\", \"New Event added.\", \"index.php?action=showevents\", \"[OK]\");\r\n\t} else {\r\n\t\tmakeNotice(\"Something went horribly wrong! AIEE!!\", \"error\", \"Mummy!\");\r\n\t}\r\n\r\n}", "public function store(Request $request)\n {\n $events = new Events();\n $events->photo = $request->input('photo');\n $events->title = $request->input('title');\n $events->descriptions = $request->input('descriptions');\n $events->venue = $request->input('venue');\n $events->date = date('04/02/2018');\n $events->time = time('h:i:s');\n $events->save();\n }", "function saveEventToDb($event){\n // TODO: get city and country\n \n if ($event['start']) $event['start'] = date('Y-m-d H:i:s',strtotime($event['start']));\n if ($event['end']) $event['end'] = date('Y-m-d H:i:s',strtotime($event['end']));\n \n $e = Event::model()->findByAttributes(array(\"title\"=>$event['title'],\"start\"=>$event['start'])); \n \n // check if exist in DB\n if ($e){\n $old_val = (!empty($e->content)) + (!empty($e->location)) + (!empty($e->link));\n $new_val = (!empty($event['content'])) + (!empty($event['location'])) + (!empty($event['link'])); \n // our events have priority or if new event has more variables :) or if the same source (might be updated)\n if ((($e->source != 'http://www.cofinder.eu') && (($event['source'] == 'http://www.cofinder.eu') || ($old_val < $new_val)) )\n || ($e->source == $event['source'])){\n $e->title = $event['title'];\n $e->start = $event['start'];\n $e->end = $event['end'];\n if ($event['allday']) $e->all_day = 1;\n else $e->all_day = 0;\n if (isset($event['content'])) $e->content = $event['content'];\n if (isset($event['link'])) $e->link = $event['link'];\n if (isset($event['location'])){\n $e->location = $event['location'];\n $cityCountry = $this->getCityAndCountry($event['location']);\n $e->city = $cityCountry['city'];\n $e->country = $cityCountry['country'];\n }\n if (isset($event['source'])) $e->source = $event['source'];\n if (isset($event['color'])) $e->color = $event['color'];\n if (!$e->save());// die(print_r($e->errors));\n }\n }else{\n $e = new Event();\n $e->title = $event['title'];\n $e->start = $event['start'];\n $e->end = $event['end'];\n if ($event['allday']) $e->all_day = 1;\n else $e->all_day = 0;\n if (isset($event['content'])) $e->content = $event['content'];\n if (isset($event['link'])) $e->link = $event['link'];\n if (isset($event['location'])){\n $e->location = $event['location'];\n $cityCountry = $this->getCityAndCountry($event['location']);\n $e->city = $cityCountry['city'];\n $e->country = $cityCountry['country'];\n }\n if (isset($event['source'])) $e->source = $event['source'];\n if (isset($event['color'])) $e->color = $event['color'];\n //$e->city = $event['title'];\n //$e->country = $event['title'];\n if (!$e->save());// die(print_r($e->errors));\n }\n }", "function eventclass_student_attendance()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\n//\tonscreen events\n\n\n\t}", "public function manage_events()\n {\n if($this->Auth->user('level') != \"Officer\" && $this->Auth->user('level') != \"Admin\")\n $this->redirect(\n array('controller' => 'Users', 'action' => 'profilehub/' . $this->Auth->user('id')));\n \n $allRsvps = $this->Event->EventsUser->find('all');\n $this->set('rsvps', $allRsvps);\n \n $this->EventHelper(); \n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Hub');\n }", "public function store(Requests\\CreateEventRequest $request, Event $event)\n {\n\n\n\n $banner = $this->upload($request->file('banner_upload'));\n $thumbnail = $this->upload($request->file('thumbnail_upload'));\n\n $request->merge(compact('thumbnail', 'banner'));\n\n $UpdateArray = $request->all();\n\n\n foreach(['start', 'end', 'early_bird_start', 'early_bird_end'] as $field)\n {\n $UpdateArray[$field] = Carbon::createFromTimeStamp(strtotime($request->get($field)));\n }\n\n\n $event = $event->create($UpdateArray);\n $event->campsites()->sync($request->get('campsites', []));\n\n\n\n\n foreach($request->get('pitch') as $pitchId => $value){\n\n //each tent under that pitch\n foreach($value as $tentId => $tent){\n\n $tentsInsertDB[] = ['pitch_id' => $pitchId, 'event_id' => $event->id, 'tent_id' => $tentId, 'qty' => $tent['qty'], 'cost' => $tent['cost']];\n\n }\n\n }\n\n foreach($request->get('product') as $pitchId => $value){\n\n //each tent under that pitch\n foreach($value as $productId => $product){\n\n\n\n $productsInsertDB[] = ['pitch_id' => $pitchId, 'event_id' => $event->id, 'product_id' => $productId, 'cost' => $product['cost'], 'active' => isset($product['status']) ? true : false ];\n\n }\n\n }\n\n DB::table('event_tent_qty_cost')->where('event_id', '=', $event->id)->delete();\n DB::table('event_tent_qty_cost')->where('event_id', '=', $event->id)->delete();\n\n DB::table('event_tent_qty_cost')->insert($tentsInsertDB);\n DB::table('event_product_qty_cost')->insert($productsInsertDB);\n\n\n return redirect()->route('admin.event.index');\n }", "public function store(Request $request)\n {\n $input = $request->all();\n $eventCat=$request->eventCategory;\n $eventName=$request->eventName;\n\n for($count=0; $count<count($eventCat);$count++)\n {\n $data=array(\n 'event_category'=>$eventCat[$count],\n 'event_name'=>$eventName[$count]\n );\n $insert_data[]=$data;\n }\n Event::insert($insert_data);\n }", "public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }", "public function record(EventData $eventData)\n {\n $this->insertUpdateLiveEvent($eventData);\n $this->insertSocialType($eventData);\n $this->insertSocialAccount($eventData);\n $this->createAccountAndLiveEventRelation($eventData);\n $this->em->clear();\n }", "public function store(Request $request)\n {\n\n $this->validate($request,$this->rules);\n if(isset($request->titleimage)){\n $titleImageName = $request->titleimage;\n }\n if(isset($request->logo)){\n $logoName = $request->logo;\n }\n\n if ($request->hasFile('titleimage') && $request->file('titleimage')->isValid()) {\n $titleImageName = $request->user()->id.'_event'.time().'.'.request()->titleimage->getClientOriginalExtension();\n $path = $request->file('titleimage')->storeAs(\n 'titleimage', $titleImageName\n );\n }\n if ($request->hasFile('logo') && $request->file('logo')->isValid()) {\n $logoName = $request->user()->id.'_event'.time().'.'.request()->logo->getClientOriginalExtension();\n $path = $request->file('logo')->storeAs(\n 'logo', $logoName\n );\n }\n\n $event = Event::create([\n 'eventname' => $request->eventname,\n 'shortname' => $request->shortname,\n 'subtitle' => $request->subtitle,\n 'url' => $request->url,\n 'email' => $request->email,\n 'titleimage' => $titleImageName?$titleImageName:'',\n 'logo' => $logoName?$logoName:'',\n 'language' => $request->language,\n 'description'=>$request->description,\n 'customcss' =>$request ->customcss,\n\n ]);\n\n // $event = Event::find(1);\n $company = \\App\\Company::find($request->company);\n\n $event->company()->associate($company)->save();\n\n $quote = new \\App\\Quote;\n $quote->product_id = $request->package;\n $quote->save();\n $addones= $request->addone;\n foreach($addones as $addonId => $count){\n $quote->addons()->attach($addonId,['count'=>$count]);\n }\n $quote->save();\n\n $event->quote()->save($quote);\n\n return redirect('eventlist')->with('success','Event Created');\n }", "public function store(Request $request)\n {\n //\n foreach($request->events as $event)\n {\n $newItem = new Events();\n $newItem->title = $event[\"title\"];\n $newItem->color = $event[\"color\"];\n $newItem->from = $event[\"from\"];\n $newItem->to = $event[\"to\"];\n $newItem->save();\n \n }\n\n return response()->json('Successfully added');\n\n \n \n //return $newItem;\n }", "public function store(Request $request) {\n // validate the data\n $this->validate($request, array(\n 'date' => 'required|date|date_format:\"Y-m-d H:i:s',\n 'title' => 'required|max:255',\n 'category' => 'required',\n ));\n // store in the database\n $event = new Event;\n $event->date = $request->date;\n $event->title = $request->title;\n if ($request->description != '') {\n $event->description = $request->description;\n }\n if (Auth::check()) { // check if logged in\n $event->user_id = Auth::id(); // assing user id\n }\n $event->slug = ($request->title != '' ? str_slug($request->title) : time()); // slug from title or timestamp\n if ($request->category > 0) {\n $event->category_id = $request->category;\n }\n $event->timezone = $request->timezone;\n if ($request->private == 'on') {\n $event->is_private = true;\n }\n $event->status = 1; // status == 1 == accepted\n // redirect to the specified resource if event is saved\n if ($event->save()) {\n Session::flash('success', 'Your timer is created!');\n return redirect()->route('events.show', [$event->id, $event->slug]);\n }\n }", "public function store(Request $request)\n {\n $events = new Event();\n $events->type = $request->type;\n $events->title = $request->title;\n $events->description = $request->description;\n $save = $events->save();\n if ($save) {\n Auth::guard('admin')->user()->notify(new EventNotification($events));\n return redirect()->back()->with('success', 'Event has been add successfully');\n } else {\n return redirect()->back()->with('error', 'Something went wrong!');\n }\n }", "public function store(Request $request)\n { \n $event = new Event;\n $event->id = $request->id;\n $event->name = $request->name;\n $event->startDate= $request->startDate;\n $event->startTime= $request->startTime;\n $event->endDate= $request->endDate;\n $event->endTime= $request->endTime;\n $event->location = $request->location;\n $event->detail = $request->detail;\n $event->image_src = $request->image_src;\n $event->save();\n return ['message' => $event];\n }", "public function store()\n {\n if (Sentry::check()) {\n // Find active user and set default variables to null\n $schools = null;\n $user = Sentry::getUser();\n\n // Permission checks\n if ($user->hasAnyAccess(['school', 'event'])) {\n\n $endDate = new DateTime();\n // Check if endDate isn't blank\n if (Input::get('end-date') == '') {\n $endDate = null;\n }\n\n $validator = Validator::make(\n [\n 'group' => Input::get('group'),\n 'description' => Input::get('description'),\n 'start-date' => Input::get('start-date'),\n 'end-date' => $endDate,\n 'start-time' => Input::get('start-time'),\n 'end-time' => Input::get('end-time'),\n 'title' => Input::get('title'),\n 'day' => Input::get('day')\n ],\n [\n 'group' => 'required',\n 'description' => 'required',\n 'start-date' => 'date',\n 'end-date' => 'date',\n 'start-time' => 'required|date_format:H:i',\n 'end-time' => 'required|date_format:H:i',\n 'title' => 'required'\n ]\n );\n\n // If validation fails, return to the create form with errors.\n if ($validator->fails()) {\n return Redirect::route('event.create')->withInput()->withErrors($validator);\n } else {\n $title = e(Input::get('title'));\n $description = e(Input::get('description'));\n $location = e(Input::get('location'));\n $group_id = Input::get('group');\n $start_date = e(Input::get('start-date'));\n $end_date = e(Input::get('end-date'));\n $start_time = e(Input::get('start-time'));\n $end_time = e(Input::get('end-time'));\n\n // TODO: Handle All day events, or decide to remove it alltogether\n // If the event isn't the whole day, determine the end date/time\n //$event->allday = false;\n\n // Recurring events handling\n if (Input::get('repeat')) {\n\n $dateArray = explode(',', e(Input::get('repeat-dates')));\n // Check if there are any dates selected, return error if not\n if(count($dateArray) == 0) {\n\n $validator->getMessageBag()->add(\n 'end',\n Lang::get('validation.countmin', ['attribute ' => 'Jaarkalender ', 'min' => '1'])\n );\n\n // Redirect back with inputs and validator instance\n return Redirect::back()->withErrors($validator)->withInput();\n\n } else {\n // Loop through dates to validate them\n foreach($dateArray as $da) {\n // If date is invalid, return error\n if (!self::validateDate($da)) {\n\n $validator->getMessageBag()->add(\n 'end',\n Lang::get('validation.date_format', ['attribute ' => 'Jaarkalender '])\n );\n // Redirect back with inputs and validator instance\n return Redirect::back()->withErrors($validator)->withInput();\n }\n }\n // If all dates are validated and correct, create parent appointment and children\n $parent = new AppParent();\n $parent->title = $title;\n $parent->description = $description;\n $parent->location = $location;\n $parent->group_id = $group_id;\n $parent->save();\n\n foreach($dateArray as $da) {\n $event = new Appointment();\n $event->title = $title;\n $event->description = $description;\n $event->location = $location;\n $event->group_id = $group_id;\n $event->start_date = new DateTime($da . ' ' . $start_time);\n $event->end_date = new DateTime($da . ' ' . $end_time);\n $event->parent_id = $parent->id;\n $event->save();\n }\n }\n return Redirect::route('calendar.index');\n } else {\n\n if(!$start_date) {\n $validator->getMessageBag()->add(\n 'end',\n Lang::get('validation.required', ['attribute ' => 'start-date '])\n );\n\n return Redirect::back()->withErrors($validator)->withInput();\n } else {\n $sd = new DateTime($start_date . ' ' . $start_time);\n\n if($end_date == '') {\n $end_date = $start_date;\n }\n $ed = new DateTime($end_date . ' ' . $end_time);\n\n // Check if end date is before start date, if so, return with error\n if($sd >= $ed) {\n\n $validator->getMessageBag()->add(\n 'end',\n Lang::get('validation.after', ['attribute ' => 'end-date ', 'date' => Input::get('start-date')])\n );\n\n // Redirect back with inputs and validator instance\n return Redirect::back()->withErrors($validator)->withInput();\n\n } else {\n $event = new Appointment();\n $event->title = $title;\n $event->description = $description;\n $event->location = $location;\n $event->group_id = $group_id;\n $event->start_date = $sd;\n $event->end_date = $ed;\n $event->save();\n return Redirect::route('calendar.index');\n }\n }\n }\n }\n } else {\n // If no permissions, redirect the user to the calendar index page\n return Redirect::route('calendar.index');\n }\n } else {\n return Redirect::route('landing');\n }\n }", "public function store(Request $request)\n {\n \n $event = Event::Create(\n ['title' => $request->title,\n 'description' => $request->description,\n 'date_event' => $request->date_event,\n 'id_author' => $request->id_author,\n 'recurence' => $request->recurence]\n );\n $event->save();\n $events = Event::paginate(2);\n \n return redirect()->route('events.index',compact('events'));\n }", "function ReadEvents()\n {\n $this->ApplicationObj()->Events=\n $this->Sql_Select_Hashes\n (\n $this->ApplicationObj()->HtmlEventsWhere(),\n array(),\n array(\"StartDate\",\"ID\")\n );\n \n $this->ApplicationObj()->Events=array_reverse($this->ApplicationObj()->Events);\n }", "public function test_comicsEntityIsCreated_events_setEvents()\n {\n $sut = $this->getSUT();\n $events = $sut->getEvents();\n $expected = EventList::create(\n 0,\n 0,\n 'http://gateway.marvel.com/v1/public/comics/41530/events',\n [\n [\n \"resourceURI\" => \"http://gateway.marvel.com/v1/public/events/93947\",\n \"name\" => \"Interior #93947\",\n ],\n ]\n );\n\n $this->assertEquals($expected, $events);\n }", "public function testUpdateEvents()\n {\n $event= Event::factory(1)->create();\n // dd($event);\n $event->title = 'Maria';\n $this->put(\"/events\". $event[0]->id, $event->toArray());\n\n $this->assertDatabaseHas('events', [\n 'id' => 1,\n 'title' => 'Maria'\n ]);\n }", "public function run()\n {\n $events = array(\n ['id' => 1, 'name' => 'Event 1', 'created_at' => new DateTime, 'updated_at' => new DateTime],\n ['id' => 2, 'name' => 'Event 2', 'created_at' => new DateTime, 'updated_at' => new DateTime],\n );\n DB::table('events')->insert($events);\n }", "public function store(Request $request)\n {\n\n $this->validate($request, [\n 'slug' => 'required|alpha_dash|min:5|max:255|unique:events,slug',\n 'title' => 'required|min:5|max:255',\n 'date_range' => 'required'\n ]);\n\n $event = new Event;\n\n if ($image = Input::file('image')) {\n $filename = $image->hashName();\n $path_thumb = public_path('media/thumb/' . $filename);\n Image::make($image->getRealPath())->resize(350, null, function ($constraint) {\n $constraint->aspectRatio();\n })->crop(350, 177)->save($path_thumb);\n\n $path = public_path('media/images/' . $filename);\n Image::make($image->getRealPath())->save($path);\n $event->image = $filename;\n }\n\n $splitDate = explode(' - ', $request->date_range, 2);\n $start_date = date('Y-m-d', strtotime($splitDate[0]));\n $end_date = date('Y-m-d', strtotime($splitDate[1]));\n\n $event->slug = $request->slug;\n $event->title = $request->title;\n $event->user_id = Auth::user()->id;\n $event->content = $request->description;\n $event->start_at = $start_date;\n $event->end_at = $end_date;\n $event->status = $request->status; // published or drafts, boolean\n $event->plugin = $request->dataPlugin;\n\n if (empty($request->seo)) {\n $event->seo = strip_tags(str_limit($request->description, 150));\n } else {\n $event->seo = $request->seo;\n }\n if (empty($request->keyword)) {\n $event->keyword = $request->title;\n } else {\n $event->keyword = $request->keyword;\n }\n $event->save();\n\n if ($request->publish == 1) {\n $status = 'Publish';\n } elseif ($request->publish == 0) {\n $status = 'Draft';\n }\n\n $redirectTo = 'events/drafts';\n if ($request->status == true) {\n $redirectTo = 'events/published';\n }\n\n return redirect($redirectTo)->with('message', 'Success Update');\n\n }", "public function store(Request $request)\n\n {\n $data=$request->all();\n Event::create($data);\n return view('Backend.Calendar.home');\n //return redirect()->route('/Calender')->with('message','Data has been inserted successfully');\n // dd($data);\n// try{\n// $event=$request->all();\n// Event::create($event);\n// return response()->json(['success' => 'added']);\n// }catch (QueryException $e){\n//\n// }\n //dd($request->all());\n// Event::create([\n//\n// \"title\" => $request-> title,\n// \"start_date\" => $request-> start,\n// \"end_date\" => $request-> end\n//\n// ]);\n//\n//\n // return response()->json(['success' => 'added']);\n\n }", "public function store()\n {\n $params = Input::all();\n $user = $this->user->find_id_by_hash($params['user_hash']);\n $rules = [\n 'app' => 'required',\n 'catid' => 'required|integer',\n 'title' => 'required',\n 'location' => 'required',\n 'startdate' => 'required',\n 'enddate' => 'required',\n 'repeat' => 'required'\n ];\n $validator = Validator::make($params, $rules);\n\n if($validator->passes())\n {\n switch($params['app']) {\n case 'event-status':\n // Create event transaction\n /*try {\n DB::transaction(function() use ($user, $params) {\n $event_save = $this->event->create([\n 'parent' => '',\n 'catid' => $params['catid'],\n 'contentid' => 0,\n 'type' => 'profile',\n 'title' => $params['title'],\n 'location' => $params['location'],\n 'summary' => '',\n 'description' => $params['description'],\n 'creator' => $user->id,\n 'startdate' => $params['startdate'],\n 'enddate' => $params['enddate'],\n 'permission' => 0,\n 'created' => date(\"Y-m-d H:s:i\"),\n 'allday' => $params['allday'],\n 'repeat' => $params['repeat'],\n 'repeatend' => $params['repeatend']\n ]);\n\n $this->event_member->create([\n 'eventid' => $event_save->id,\n 'memberid' => $user->id,\n 'status' => 1,\n 'permission' => 1,\n 'invited_by' => 0,\n 'approval' => 0,\n 'created' => date(\"Y-m-d H:s:i\")\n ]);\n\n $activity = $this->activity->create([\n 'actor' => $user->id,\n 'target' => 0,\n 'title' => '',\n 'content' => '',\n 'app' => 'events',\n 'cid' => $event_save->id,\n 'eventid' => $event_save->id,\n 'created' => date(\"Y-m-d H:s:i\"),\n 'access' => 0,\n 'params' => [\n 'action' => \"events.create\",\n 'event_url' => \"index.php?option=com_community&view=events&task=viewevent&eventid={$event_save->id}\",\n 'event_category_url' => \"index.php?option=com_community&view=events&task=display&categoryid={$params['catid']}\"\n ],\n 'archived' => 0,\n 'location' => $params['location'],\n 'comment_id' => $event_save->id,\n 'comment_type' => 'groups.event',\n 'like_id' => $event_save->id,\n 'like_type' => 'group.event',\n 'actors' => ''\n ]);\n });\n }\n catch($e) {\n\n }*/\n break;\n };\n }\n }", "protected function _registerEvent(Mage_Index_Model_Event $event)\n\t{\n\t\tif ($event->getEntity() == Asm_Solr_Model_Cms_Page::ENTITY\n\t\t\t&& $event->getType() == Mage_Index_Model_Event::TYPE_SAVE\n\t\t) {\n\t\t\t$event->setData('solr_update_page_id', $event->getDataObject()->getId());\n\t\t}\n\t}", "function addEvent($event) {\n Event::addEvent($event);\n }", "public function testContainsEventUsesCachedAddEvent()\n\t{\n\t\t$application_id = 1;\n\t\t$event_name = \"containsEventEvent\";\n\t\t$new_event = \"NEW EVENT\";\n\t\t$stat_name_id = 1000;\n\t\t$new_stat_name_id = 1001;\n\t\t$now = \"String for date\";\n\t\t$data_rows = new ArrayIterator();\n\t\t$row = new stdClass();\n\t\t$row->stat_name_id = $stat_name_id;\n\t\t$data_rows->append($row);\n\t\t\n\t\t$history_model = $this->getMock(\n\t\t\t\t\"DB_Models_WritableModel_1\", array(), array(), \"\", FALSE);\n\t\t$history_model\n\t\t\t->expects($this->once())\n\t\t\t->method(\"loadAllBy\")\n\t\t\t->with($this->equalTo(array(\"application_id\" => $application_id)))\n\t\t\t->will($this->returnValue($data_rows));\n\t\t\n\t\t$name_model = $this->getMock(\n\t\t\t\t\"DB_Models_WritableModel_1\", array(), array(), \"\", FALSE);\n\t\t$name_model\n\t\t\t->expects($this->once())\n\t\t\t->method(\"loadByKey\")\n\t\t\t->with(array($stat_name_id))\n\t\t\t->will($this->returnValue(TRUE));\n\t\t$name_model\n\t\t\t->expects($this->exactly(2))\n\t\t\t->method(\"__get\")\n\t\t\t->will(\n\t\t\t\t$this->returnValue(strtolower($event_name)),\n\t\t\t\t$this->returnValue($stat_name_id),\n\t\t\t\t$this->returnValue($new_stat_name_id));\n\t\t$name_model\n\t\t\t->expects($this->once())\n\t\t\t->method(\"loadBy\")\n\t\t\t->will($this->returnValue(TRUE));\n\t\t\t\n\t\t$event_history = $this->getMock(\n\t\t\t\"VendorAPI_StatPro_Unique_ApplicationEventHistory\",\n\t\t\tarray(\"getNowString\", \"getEventHistoryModel\", \"getEventNameModel\"),\n\t\t\tarray(),\n\t\t\t\"\",\n\t\t\tFALSE);\n\t\t$event_history\n\t\t\t->expects($this->once())\n\t\t\t->method(\"getNowString\")\n\t\t\t->will($this->returnValue($now));\n\t\t$event_history\n\t\t\t->expects($this->exactly(2))\n\t\t\t->method(\"getEventHistoryModel\")\n\t\t\t->will($this->returnValue($history_model));\n\t\t$event_history\n\t\t\t->expects($this->exactly(2))\n\t\t\t->method(\"getEventNameModel\")\n\t\t\t->will($this->returnValue($name_model));\n\n\t\t$this->assertTrue(\n\t\t\t$event_history->containsEvent($event_name, $application_id));\n\t\t$this->assertFalse(\n\t\t\t$event_history->containsEvent($new_event, $application_id));\n\t\t$event_history->addEvent($new_event, $application_id);\n\t\t$this->assertTrue(\n\t\t\t$event_history->containsEvent($new_event, $application_id));\n\t}", "public function insertEvent($data)\r\r\n {\r\r\n $this->insert($data);\r\r\n }", "public function saveEvent($post){\n\n\t\tif (! $ctime = strtotime($post['datetime']) ){\n\t\t\techo \"<script>\n\t\t\t\talert('Date ${post['datetime']} not recognized');\n\t\t\t\thistory.back();\n\t\t\t\t</script>\n\t\t\t\";\n\t\t}\n\t\tif ($ctime < time()){\n\t\t\techo \"<script>\n\t\t\t\talert('You cannot enter an event for a past date');\n\t\t\t\thistory.back();\n\t\t\t\t</script>\n\t\t\t\";\n\t\t}\n\t\t$post['datetime'] = date('Y-m-d g:i a', $ctime);\n\n\t\t$id = $post['id'];\n\t\tforeach ($post as $var => $val) {\n\t\t\t$despec[$var] = $val;\n\t\t}\n\n\t\t$prep = u\\prepPDO($despec,array_keys(self::$empty_item),'id');\n\t\t if ($despec['id'] == 0){ #new entry\n\n\t\t\t$sql = \"INSERT into `events` ( ${prep['ifields']} ) VALUES ( ${prep['ivalues']} );\";\n\t\t\t//u\\echor($prep,$sql);\n\t\t\t $stmt = $this->pdo->prepare($sql);\n\n\t\t\t $stmt->execute($prep['idata']);\n\t\t\t $new_id = $this->pdo->lastInsertId();\n\n\t\t} else { #update\n\t\t\t$prep = u\\prepPDO($despec,array_keys(self::$empty_item),'id');\n\t\t\t$sql = \"UPDATE `events` SET ${prep['uset']} WHERE id = ${prep['ukey']};\";\n\t\t\t//\tu\\echor($prep,$sql);\n\t\t\t $stmt = $this->pdo->prepare($sql);\n\n\t\t\t $stmt->execute($prep['udata']);\n\t\t\t$new_id = $id;\n\t\t}\n\t\treturn $new_id;\n}", "public function insertEvent($data) {\n\t\t$this->db->insert('events',$data);\n\t}", "public function pushEvent($name)\n {\n $this->data['event'] = $name;\n }", "public function store(Request $request,$event_id)\n {\n //\n\n\n\n\n\n }", "public function saved($event)\n {\n if (!request()->hasAny(['pid', 'amount'])) {\n return;\n }\n\n $event->products()->sync([]);\n\n $products = request('pid');\n $quantity = request('amount');\n $locations = request('locationID');\n\n for ($i = 0; $i < count($quantity) - 1; $i++) {\n $event->products()->attach([\n $products[$i] => [\n 'quantity' => $quantity[$i],\n 'rack_id' => $locations[$i],\n ]\n ]);\n }\n }", "public function save() {\n $filename = self::getFilename($this->eventKey);\n \n \t$fh = fopen(\"$filename.tmp\", \"w\");\n \tfwrite($fh, \"<\" . \"?\\n\");\n \tfwrite($fh, \"\\$attendees['\" . $this->eventKey . \"'] = array(\\n\");\n \t\n \tforeach ($this->members as $memberKey => $attendee) {\n \t\tif (empty($memberKey)) {\n \t\t\tcontinue;\n \t\t}\n \t\t$comma = true;\n \t\tfwrite($fh, \" '$memberKey' => array(\\n\");\n \t\t\n \t\tforeach ($attendee as $k => $v) {\n \t\t if (!in_array($k, array('eventKey', 'memberKey'))) {\n fwrite($fh, \" '$k' => '$v',\\n\");\n }\n }\n fwrite($fh, \" ),\\n\");\n \t}\n \tfwrite($fh, \")\\n?\" . \">\\n\");\n \tfclose($fh);\n \trename(\"$filename.tmp\", $filename);\n }", "function save_event( $post_id , $post = '' ) {\n\t\n\t\t// Don't do anything if it's not an event\n\t\tif ( 'event' != $post->post_type ) return;\n\n\t\t// Verify the nonce before proceeding.\n\t\tif ( !isset( $_POST['event-details-box'] ) || !wp_verify_nonce( $_POST['event-details-box'], basename( __FILE__ ) ) )\n\t\t\treturn $post_id;\t\t\t\n\n\t\t/* -----------------------------------\n\t\t\tSAVE EVENT TIME \n\t\t------------------------------------*/\n\n\t\t// Retrieve the event time\n\t\t$event_time = date( 'Y-m-d H:i:s' , strtotime($_POST['event-time']) );\n\t\t$prior_time\t= $post->post_date;\n\n\t\t// Update the post object\n\t\t$post->post_date \t\t= $event_time;\n\t\tremove_action( 'save_post' , array( $this , 'save_event' )\t);\n\t\twp_update_post( $post );\n\t\tadd_action( 'save_post'\t, array( $this , 'save_event' )\t, 10, 2 );\n\t\n\t\t/* -----------------------------------\n\t\t\tSAVE META INFORMATION \n\t\t------------------------------------ */\n\n\t\t// Define the meta to look for\n\t\t$meta = array(\n\t\t\t'event_duration'\t=> $_POST['event-duration'],\n\t\t\t'event_capacity'\t=> $_POST['event-capacity'],\n\t\t\t'event_rsvp'\t\t=> $_POST['event-rsvp'],\n\t\t\t'event_role'\t\t=> $_POST['event-role'],\n\n\t\t);\n\t\t\n\t\t// Loop through each meta, saving it to the database\n\t\tforeach ( $meta as $meta_key => $new_meta_value ) {\n\t\t\n\t\t\t// Get the meta value of the custom field key.\n\t\t\t$meta_value = get_post_meta( $post_id, $meta_key, true );\n\n\t\t\t// If there is no new meta value but an old value exists, delete it.\n\t\t\tif ( current_user_can( 'delete_post_meta', $post_id, $meta_key ) && '' == $new_meta_value && $meta_value )\n\t\t\t\tdelete_post_meta( $post_id, $meta_key, $meta_value );\n\n\t\t\t// If a new meta value was added and there was no previous value, add it.\n\t\t\telseif ( current_user_can( 'add_post_meta', $post_id, $meta_key ) && $new_meta_value && '' == $meta_value )\n\t\t\t\tadd_post_meta( $post_id, $meta_key, $new_meta_value, true );\n\n\t\t\t// If the new meta value does not match the old value, update it.\n\t\t\telseif ( current_user_can( 'edit_post_meta', $post_id, $meta_key ) && $new_meta_value && $new_meta_value != $meta_value )\n\t\t\t\tupdate_post_meta( $post_id, $meta_key, $new_meta_value );\n\t\t}\n\n\t\t// Delete the RSVP meta if the date has changed\n\t\tif ( $event_time != $prior_time )\n\t\t\tdelete_post_meta( $post_id , 'event_rsvps' );\n\n\t\t/* -----------------------------------\n\t\t\tBUDDYPRESS NOTIFICATION\n\t\t------------------------------------ */\n\t\t\t\n\t\t// Get event data\n\t\tglobal $bp, $wpdb;\n\t\tif ( !$user_id )\n\t\t\t$user_id = $post->post_author;\n\n\t\t// Figure out which calendars this event belongs to\n\t\t$calendars = wp_get_post_terms( $post_id , 'calendar' );\n\t\t$group_slugs = array();\n\t\t\t\n\t\t// For each calendar, check if it's a group calendar\n\t\tforeach ( $calendars as $calendar ) {\n\t\t\tif ( is_group_calendar( $calendar->term_id ) )\n\t\t\t\t$groups[] = $calendar;\n\t\t}\t\n\t\t\n\t\t// If this event does not belong to a group, we can stop here\n\t\tif ( empty( $groups ) ) return $post_id;\t\n\t\t\n\t\t// Only register notifications for future or published events\n\t\tif ( !in_array( $post->post_status , array('publish','future') ) ) return $post_id;\t\n\t\t\n\t\t// Loop through each group, adding an activity entry for each one\n\t\tforeach ( $groups as $group ) {\n\t\t\n\t\t\t// Get the group data\n\t\t\t$group_id \t= groups_get_id( $group->slug );\n\t\t\t$group_name\t= $group->name;\n\n\t\t\t// Configure the activity entry\n\t\t\t$post_permalink \t= get_permalink( $post_id );\n\t\t\t$activity_action \t= sprintf( '%1$s added the event %2$s to the %3$s.' , bp_core_get_userlink( $post->post_author ), '<a href=\"' . $post_permalink . '\">' . $post->post_title . '</a>' , $group_name . ' <a href=\"' . SITEURL . '/calendar/' . $group->slug .'\">group calendar</a>' );\n\t\t\t$activity_content \t= $post->post_content;\n\n\t\t\t// Check for existing entry\n\t\t\t$activity_id = bp_activity_get_activity_id( array(\n\t\t\t\t'user_id' => $user_id,\n\t\t\t\t'component' => $bp->groups->id,\n\t\t\t\t'type' => 'new_calendar_event',\n\t\t\t\t'item_id' => $group_id,\n\t\t\t\t'secondary_item_id' => $post_id,\n\t\t\t) );\n\t\t\t\n\t\t\t// Record the entry\n\t\t\tgroups_record_activity( array(\n\t\t\t\t'id'\t\t\t\t=> $activity_id,\n\t\t\t\t'user_id' \t\t\t=> $user_id,\n\t\t\t\t'action' \t\t\t=> $activity_action,\n\t\t\t\t'content' \t\t\t=> $activity_content,\n\t\t\t\t'primary_link' \t\t=> $post_permalink,\n\t\t\t\t'type' \t\t\t\t=> 'new_calendar_event',\n\t\t\t\t'item_id' \t\t\t=> $group_id,\n\t\t\t\t'secondary_item_id' => $post_id,\n\t\t\t));\n\t\t\t\n\t\t\t// Update the group's last activity meta\n\t\t\tgroups_update_groupmeta( $group_id, 'last_activity' , bp_core_current_time() );\n\t\t\t\n\t\t\t// Maybe notify every group member\n\t\t\tif ( $_POST['event-rsvp'] ) :\n\t\t\t\tif ( bp_group_has_members( $args = array( 'group_id' => $group_id, 'exclude_admins_mods' => false , 'per_page' => 99999 ) ) ) :\twhile ( bp_members() ) : bp_the_member();\n\t\t\t\t\t\t\n\t\t\t\t\t// Remove any existing notifications ( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false )\n\t\t\t\t\tbp_notifications_delete_notifications_by_item_id( bp_get_group_member_id() , $group_id , $bp->groups->id , 'new_calendar_event' , $post_id );\n\t\t\t\n\t\t\t\t\t// Send a notification ( itemid , groupid , component, action , secondary )\n\t\t\t\t\tbp_notifications_add_notification( array(\n\t\t\t\t\t\t'user_id'\t\t\t=> bp_get_group_member_id(),\n\t\t\t\t\t\t'item_id'\t\t\t=> $group_id,\n\t\t\t\t\t\t'secondary_item_id'\t=> $post_id,\n\t\t\t\t\t\t'component_name'\t=> $bp->groups->id,\n\t\t\t\t\t\t'component_action'\t=> 'new_calendar_event'\t\t\t\t\t\n\t\t\t\t\t));\t\t\t\t\t\t\n\t\t\t\tendwhile; endif;\n\t\t\tendif;\n\t\t}\n\t}", "public function store(Request $request)\n {\n if(auth()->user()->isAdmin())\n {\n $this->validate(request(), [\n 'name' => 'required',\n 'event_type_id' => 'required',\n 'salle_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'short_desc' => 'required',\n 'price' => 'required',\n ]);\n \n $event = Event::create([\n 'user_id' => Auth::id(),\n 'uuid' => Str::uuid(),\n 'number' => mt_rand(),\n 'name' => $request->name,\n 'event_type_id' => $request->event_type_id,\n 'salle_id' => $request->salle_id,\n 'start_at' => $request->start_at,\n 'end_at' => $request->end_at,\n 'short_desc' => $request->short_desc,\n 'long_desc' => $request->long_desc,\n 'price' => $request->price,\n ]);\n \n return redirect()->route('events.show', $event);\n }else{\n return redirect()->back();\n }\n\n \n }", "public function add_event($_data){\r\n\t\t$args=$this->create_args($_data);\r\n\t\treturn($this->execute('add_event',$args));\r\n\t}", "public function store(CreateEventRequest $request)\n {\n $event = $this->event_repo->save(\n $request->all(),\n (new EventFactory())->create(auth()->user(), auth()->user()->account_user()->account)\n );\n Notification::send(auth()->user(), new EventCreated($event));\n return $event->toJson();\n }", "function addEvent($date, $title,$user_id, $fname, $address, $contact, $email, $location, $vlocation, $hour, $minutes, $deal,$guests, $chairs, $tables, $style, $types, $instruction, $confirmation) {\r\n //Include db configuration file\r\n include 'dbConfig.php';\r\n $currentDate = date(\"Y-m-d H:i:s\");\r\n //Insert the event data into database\r\n $insert = $db->query(\"INSERT INTO floralbookings (title,date,created,modified,user_id,fname,address,contact,email,location,vlocation,hour,minutes,deal,guests,chairs,tables,style,types,instruction,confirmation) VALUES ('\" . $title . \"','\" . $date . \"','\" . $currentDate . \"','\" . $currentDate . \"','\" . $user_id . \"','\" . $fname . \"','\" . $address . \"','\" . $contact . \"','\" . $email . \"','\" . $location . \"','\" . $vlocation . \"','\" . $hour . \"','\" . $minutes . \"','\" . $deal . \"','\" . $guests . \"','\" . $chairs . \"','\" . $tables . \"','\" . $style . \"','\" . $types . \"','\" . $instruction . \"','\" . $confirmation . \"')\");\r\n if ($insert) {\r\n echo 'ok';\r\n } else {\r\n echo 'err';\r\n }\r\n}", "public function getEventDetail()\n {\n // get event detail\n $this\n ->get('/event/detail/'.$this->event->id)\n ->assertStatus(200);\n }", "function update() {\n\t\t$vars = $this->params['url'];\n\t\t$this->Event->id = $vars['id'];\n\t\t$this->Event->saveField('start', $vars['start']);\n\t\t$this->Event->saveField('end', $vars['end']);\n\t\t$this->Event->saveField('all_day', $vars['allday']);\n\t}", "public function store()\n {\n \n $directory = 'img/uploads/';\n $image = Input::file('img');\n $event = new CalendarEvent;\n $event->title = Input::get('title');\n $event->description = Input::get('description');\n $event->date = Input::get('date');\n $event->price = Input::get('price');\n $event->start_time = Input::get('start_time');\n $event->end_time = Input::get('end_time');\n $event->location = Input::get('location');\n $event->address = Input::get('address');\n $event->city = Input::get('city');\n $event->state = Input::get('state');\n $event->zip = Input::get('zip');\n $event->user_id = 1;\n \n if (Input::hasFile('img')) {\n $event->img = $image->move($directory);\n }\n $event->save();\n Log::info(\"Event successfully saved.\", Input::all());\n Session::flash('successMessage', 'You created ' . $event->title . ' event successfully');\n return Redirect::action('EventsController@index');\n \n }", "public function store(UploadRequest $request)\n {\n $events= events::create($request->all());\n \n $filename = $request -> photo ->store('photos');\n EventPhoto::create([\n 'EventId'=> $events -> id,\n 'NameOfEvent' => $request ->NameOfEvent,\n 'VenueOfEvent' =>$request ->VenueOfEvent,\n 'Town' => $request ->Town,\n 'DateOfTheEvent' => $request -> DateOfTheEvent,\n 'OrganizingCompany' =>$request-> OrganizingCompany,\n 'ContactEmail' => $request -> ContactEmail,\n 'Description' => $request ->Description,\n //'Categories' => $Categories,\n 'filename' => $filename\n\n ]);\n return view('event');\n }", "public function onEvent($event)\n\t{\n\t\tif ($event->type == DB_Models_ObservableWritableModel_1::EVENT_BEFORE_INSERT)\n\t\t{\n\t\t\t/**\n\t\t\t * If document_id is set in the model the service will first try to pull \n\t\t\t * the document to update it. If it is unable to get the record \n\t\t\t * (it will be since this is an insert) it will do nothing and \n\t\t\t * the document will not be inserted.\n\t\t\t */\n\t\t\t$event->model->document_id = NULL;\n\t\t\t$result = $this->saveDocument($event->model);\n\t\t\t$event->model->document_id = $result->item->document_id;\n\t\t}\n\t\telseif ($event->type == DB_Models_ObservableWritableModel_1::EVENT_UPDATE)\n\t\t{\n\t\t\t$this->saveDocument($event->model);\n\t\t}\n\t}", "public function addEvent()\n\t{\n\t \n\t\t$data = array(\n\t\t\t 'title' => $this->input->post('event_title'),\n\t\t\t 'date' => $this->input->post('event_date'),\n\t\t\t 'time' => $this->input->post('event_time'),\n\t\t\t 'desc' => $this->input->post('event_desc')\n\t\t);\t\n\n\t \tif($this->event_model->addEv($data))\n\t\t{\t\t\t \n\t\t\techo true;\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo false;\n\t\t}\n\t}", "public function store(StoreEventsRequest $request)\n {\n // $this->validate($request, [\n // 'photo.*' => 'image|mimes:png,jpg,jpeg|max:10000'\n // ]);\n\n if (! Gate::allows('event_create')) {\n return abort(401);\n }\n\n $event = Event::create($request->all());\n\n // edited\n if($request->hasfile('photo'))\n { \n $image = $request->file('photo');\n $name=time(). '.' .$image->getClientOriginalName();\n $image->move(public_path().'/images/events/', $name);\n $event->photo = $name;\n $event->save();\n }\n return redirect()->route('admin.events.index')->with('success', 'Your message has been sent successfully!');\n }", "public function postEventedit();", "public function run()\n {\n factory(Event::class,50)->make()->each(static function($event) {\n $user = factory(User::class)->create();\n $event->organizer_id = $user->id;\n $event->save();\n\n $attendees = factory(User::class, 5)->create();\n $event->attendees()->attach($attendees);\n });\n }", "public function store(Request $request)\n {\n \n $event = new Event;\n\n $event->name = $request->input('name');\n $event->description = $request->input('description');\n $event->date = $request->input('date');\n $event->hour = $request->input('hour');\n\n $event->minimum_quorum = $request->input('minimum_quorum');\n $event->max_capacity = $request->input('max_capacity'); \n\n //$event->user_id = $request->input('user_id');\n //tipo_evento_id\n //user_id\n //publico_id \n $event->save();\n return redirect()->action('EventController@index'); \n }", "public function store(CreateEventFormRequest $request)\n {\n\n \n $title= $request->title;\n $description = $request->description;\n Event::create([\n 'title' => $title,\n 'description' => $description,\n ]);\n\n Flashy::message('Evenement cree avec succes');\n \n return redirect(route('home'));\n }", "public function events(): HasMany\n {\n return $this->hasMany(\n config('event-sourcing.stored_event_model'),\n 'event_properties->accountUuid',\n 'uuid'\n );\n }", "public function store(Request $request)\n {\n $insertData = $request->all();\n\n $eventId = $request->eventId;\n\n //validation rules\n\n $insertData = $request->except(['eventId','_token','eventChildCare','eventBuildingBlock','eventBookedFor','eventSuggestedResources','eventNotification']);\n\n if($eventId > 0) { //update\n $insertData['updatedBy']= Auth::id();\n\n\n Events::where(\"eventId\",$eventId)->update($insertData);\n }\n else { //insert\n $insertData['createdBy']= Auth::id();\n $insertData['orgId']= Auth::user()->orgId;\n\n Events::create($insertData);\n }\n\n return response()->json(\n [\n 'success' => '1',\n \"message\" => '<div class=\"alert alert-success\">\n <strong>Saved!</strong>\n </div>'\n ]\n\t\t\t\t\t\t);\n\n }", "public function store(EventRequest $request)\n {\n Event::create($request->all());\n\n return redirect('events');\n }", "public function store(Request $request)\n {\n $events = new Event();\n $events->title= $request['title'];\n $events->source_id= $request['source_id'];\n $events->content = $request['content'];\n $events->image_url= $request['image_url'];\n $events->source_url= $request['source_url'];\n $events->save(); \n\n return back();\n }", "public static function event() {\n return self::service()->get('events');\n }", "public function store(Request $request)\n {\n $event = new EventCalendar;\n $event->title = $request->title;\n $starting_date = strtotime($request->starting_date);\n $event->starting_date = date('Y-m-d',$starting_date).' 00:00:01';\n $ending_date = strtotime($request->ending_date);\n $event->ending_date = date('Y-m-d', $ending_date).' 23:59:59';\n $event->school_id = school_id();\n $event->session = get_schools();\n if($event->save()) {\n flash(translate('event_has_been_created_successfully'))->success();\n \n }\n return redirect()->back();\n }", "public function store(CreateEventRequest $request)\n {\n \n $event = Event::create(\n $request->validated()\n );\n\n\n return response()->json([\n 'event' => $event\n ], 201);\n }", "public function store(Request $request)\n {\n $validate = Validator::make($request->all(),[\n 'event'=>'required',\n 'venue'=>'required',\n 'date_of_event'=>'required',\n 'department'=>'required',\n 'start_of_event'=>'required',\n 'end_of_event'=>'required',\n 'attendees_capacity'=>'required',\n 'time_in_allowance'=>'required',\n 'time_out_allowance'=>'required',\n ]);\n\n if($validate->fails()){\n return response()->json(array('success'=>false, 'messages'=>'Please input valid data!'));\n }else{\n try {\n DB::beginTransaction();\n\n $department = $this->getDepartment(\\Auth::user())->department_position['department_id'];\n $status = ($department == '1')? true : false;\n\n $event = new Event;\n $event->event_code = md5('E'. convertData($request['event']) . Carbon::now());\n $event->title = convertData($request['event']);\n $event->description = convertData($request['description']);\n $event->department_id = ($status)? $request['department']: $department;\n $event->status = '1';\n $event->event_status = 'CLOSE';\n $changes = $event->getDirty();\n $event->save();\n\n $summary = new EventSummary;\n $summary->event_id = $event->id;\n $summary->exclusive = !empty($request['event_type'])? $request['event_type']: '0';\n $summary->required_attendance = !empty($request['required_attendance'])? $request['required_attendance']: '0';\n $summary->venue = convertData($request['venue']);\n $summary->date_of_event = $request['date_of_event'];\n $summary->time_of_event_from = $request['start_of_event'];\n $summary->time_of_event_to = $request['end_of_event'];\n $summary->attendees_capacity = $request['attendees_capacity'];\n $summary->time_in_allowance = $request['time_in_allowance'];\n $summary->time_out_allowance = $request['time_out_allowance'];\n $summary->reasons = '';\n $summary->status = '1';\n $changes = array_merge($changes, $summary->getDirty());\n $summary->save();\n\n if(!empty($request['required_attendance']) && $request['required_attendance'] ==='1'){\n $attendance = new Attendance;\n $attendance->title = $event->title;\n $attendance->attendance_code = $event->event_code;\n $attendance->event_id = $event->id;\n $attendance->status = '1';\n $attendance->save();\n }\n\n DB::commit();\n\n /* logs */\n action_log('Event Mngt', 'CREATE', array_merge(['id' => $event->id], $changes));\n\n return response()->json(array('success'=>true, 'messages'=>'Record successfully saved!'));\n } catch (\\PDOException $e) {\n DB::rollBack();\n return response()->json(array('success'=> false, 'error'=>'SQL error!', 'messages'=>'Transaction failed!'));\n }\n }\n }", "public function createEvents()\n {\n $event = new Events();\n\n $event->eventTitle =Input::get('eventTitle');\n\n $event->eventDesc = Input::get('eventDesc');\n\n $event->startDate =Input::get('startDate');\n\n $event->endDate =Input::get('endDate');\n\n $event->startTime =Input::get('startTime');\n\n $event->endTime =Input::get('endTime');\n\n $event->userId =Input::get('userId');\n\n if ( Input::hasFile('eventImageUrl')) {\n\n $file = Input::file('eventImageUrl');\n $name = time().'-'.$file->getClientOriginalName();\n $file = $file->move('uploads/eventimages', $name);\n $event->eventImageUrl = $name;\n //dd( $model->avatarUrl);\n }\n\n /*$user->fill(Input::all());*/\n try {\n\n $event->save();\n\n }catch (Exception $e){\n\n return response()->json($this->codes->respondInternalError());\n\n }\n\n }", "private function __construct() {\n\t\t$action = isset($_GET['action']) ? sanitize_key($_GET['action']) : '';\n\t\t$copy = isset($_GET['copy']) ? intval($_GET['copy']) : 0;\n\t\tif(!empty($copy)) {\n\t\t\t$this->copy_event = new EL_Event($copy);\n\t\t\tadd_filter('get_object_terms', array(&$this, 'set_copied_categories'));\n\t\t}\n\n\t\t$this->options = &EL_Options::get_instance();\n\t\t$this->is_new = 'edit' !== $action;\n\n\t\tadd_action('add_meta_boxes', array(&$this, 'add_eventdata_metabox'));\n\t\tadd_action('edit_form_top', array(&$this, 'form_top_content'));\n\t\tadd_action('edit_form_after_title', array(&$this, 'form_after_title_content'));\n\t\tadd_action('admin_print_scripts', array(&$this, 'embed_scripts'));\n\t\tadd_action('save_post_el_events', array(&$this, 'save_eventdata'), 10, 3);\n\t\tadd_filter('enter_title_here', array(&$this, 'change_default_title'));\n\t\tadd_filter('post_updated_messages', array(&$this, 'updated_messages'));\n\t}", "public function store(Request $request,$event_id)\n {\n $event = Event::find($event_id);\n if($event->organiser->id != auth()->user()->id){\n return redirect()->route(\"events.index\");\n }\n if($event->presenters()->where(\"user_id\",$request->presenter)->count() == 0){\n $event->presenters()->attach($request->presenter);\n }\n return redirect()->route(\"presenters.create\",['event_id'=>$event_id]);\n }", "public function getEvents() { return $this->_events; }" ]
[ "0.7255112", "0.65032166", "0.64895916", "0.645839", "0.64115316", "0.63357854", "0.6317351", "0.62929034", "0.62361926", "0.62203574", "0.618393", "0.6140477", "0.6125478", "0.61224216", "0.606334", "0.601659", "0.60131776", "0.60064095", "0.6004535", "0.5999824", "0.59479934", "0.5920238", "0.5900379", "0.5890275", "0.5881876", "0.5859696", "0.585235", "0.5845576", "0.58390325", "0.580995", "0.5802205", "0.5789726", "0.57887745", "0.57808334", "0.5776337", "0.57662135", "0.5761452", "0.5746001", "0.574157", "0.57228535", "0.5716761", "0.57086724", "0.57031035", "0.57018304", "0.5695788", "0.5689625", "0.5653976", "0.564848", "0.56364554", "0.5636278", "0.5629844", "0.56015176", "0.55827606", "0.5582427", "0.55710876", "0.55699116", "0.5555805", "0.5552228", "0.5543742", "0.5540947", "0.5540301", "0.55391026", "0.55335915", "0.55332786", "0.55275446", "0.5523043", "0.5517327", "0.5516819", "0.55108094", "0.55075395", "0.55039823", "0.5500184", "0.5494407", "0.5478774", "0.5476526", "0.54747164", "0.54722273", "0.54703987", "0.5465939", "0.5459616", "0.54498196", "0.54390854", "0.5423844", "0.5423626", "0.5419634", "0.5415724", "0.5412461", "0.5411459", "0.54073316", "0.5403925", "0.5399662", "0.5399177", "0.53919077", "0.538856", "0.53865", "0.5379286", "0.5379074", "0.5377275", "0.53738177", "0.53689367", "0.53682077" ]
0.0
-1
Updating the status of event
public function approveEvent(){ $data=$this->request->all(); // print_r($data['value']);die(); $status=$data['value']; $state['status']=$status; $event=Event::where('_id',$data['id'])->update($state); if($event){ return "Success"; } // print_r($event);die(); // return view(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update_status();", "function update_event_status($event_id,$event_status)\n {\n if($event_status==0)\n {\n $new_stat=\"1\";\n }\n elseif($event_status==1)\n {\n $new_stat=\"0\";\n }\n $query = $this->db->query(\"UPDATE tbl_events SET event_status = '$new_stat' WHERE event_id='$event_id'\");\n //echo $this->db->last_query();\n }", "public function respon(){\n //update 'status'\n }", "public function update($event_info = null)\n {\n echo \"观察者1 收到消息,执行完毕!\";\n }", "public function event()\n {\n switch ($this->status_changed) {\n case \"in_progress\":\n return \"set to In Progress\";\n case \"completed\":\n return \"closed\";\n case \"submitted\":\n return \"reopened\";\n }\n }", "public function changeStatus()\n {\n }", "public static function onChangeStatusConnector(\\Bitrix\\Main\\Event $event)\n\t{\n\t\t$parameters = $event->getParameters();\n\t\tself::addSingleLineUpdateAgent($parameters['line']);\n\t}", "function update() {\n\t\t$vars = $this->params['url'];\n\t\t$this->Event->id = $vars['id'];\n\t\t$this->Event->saveField('start', $vars['start']);\n\t\t$this->Event->saveField('end', $vars['end']);\n\t\t$this->Event->saveField('all_day', $vars['allday']);\n\t}", "private function manageStatus()\n {\n $this->updateStatus();\n $this->checkStatus();\n }", "private function updateStatus()\n {\n $this->setStatus(\n socket_get_status(pfsockopen($this->uri, $this->port))\n );\n }", "function setStatus($new_status)\n {\n $this->status = $new_status;\n }", "public function updateStatus(): void\n {\n $data = json_encode($this->getStatus(), JSON_PRETTY_PRINT);\n File::put(public_path(self::STATUS_FILE_NAME), $data);\n }", "function updatestatus() {\n global $_lib;\n\n $dataH = array();\n $dataH['ID'] = $this->transaction->ID;\n $dataH['RemittanceSequence'] = $this->transaction->RemittanceSequence;\n $dataH['RemittanceDaySequence'] = $this->transaction->RemittanceDaySequence;\n $dataH['RemittanceSendtDateTime'] = $_lib['sess']->get_session('Datetime');\n $dataH['RemittanceSendtPersonID'] = $_lib['sess']->get_person('PersonID');\n $dataH['RemittanceStatus'] = 'sent';\n \n #Disse mŒ fjernes nŒr vi har en godkjenningsprosess\n $dataH['RemittanceApprovedDateTime'] = $_lib['sess']->get_session('Datetime');\n $dataH['RemittanceApprovedPersonID'] = $_lib['sess']->get_person('PersonID');\n\n $_lib['storage']->store_record(array('data' => $dataH, 'table' => 'invoicein', 'debug' => false));\n }", "function UpdateEvents() {\n\t\tforeach ($this->data as $i => $row) {\n\t\t\tif (!is_null($row['EventId'])) {\n\t\t\t\t//check wheter event is assigned to calculated event. If it is take the calculated rating, otherwise set the rating to -0.5\n\t\t\t\tif (array_key_exists($i, $this -> rating)) {\n\t\t\t\t\t$rating = $this -> rating[$i];\n\t\t\t\t} else {\n\t\t\t\t\t$rating = -0.5;\n\t\t\t\t}\n\t\t\t\t//update all events\n\t\t\t\t$sql = \"UPDATE Event SET rating=\" . $rating . \" WHERE EventId=\" . $row['EventId'];\n\t\t\t\t$stmt = $this -> DB -> prepare($sql);\n\t\t\t\tif ($stmt -> execute()) {\n\t\t\t\t} else {\n\t\t\t\t\tinclude_once \"Email.php\";\n\t\t\t\t\tnew Email('failed', 'to update event rating with EventId=' . $row['EventId'], $this -> id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this -> updateTask();\n\n\t}", "function update_status()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t\n\t\tif(!empty($data['t']) && !empty($data['list'])) $response = $this->_tender->update_status($data['t'], explode('--',$data['list']));\n\t\t\n\t\t# all good\n\t\tif(!empty($response) && $response['boolean']){\n\t\t\t$data['msg'] = 'The Invitation for Bids/Quotations status has been updated.';\n\t\t\t$data['area'] = 'refresh_list_msg';\n\t\t} \n\t\t# there was an error\n\t\telse {\n\t\t\t$data['msg'] = (!empty($data['t']) && !empty($data['list']))? 'ERROR: There was an error updating the Invitation for Bids/Quotations status.': 'ERROR: This action can not be resolved';\n\t\t\t$data['area'] = 'basic_msg';\n\t\t}\n\t\t\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}", "public static function onUpdateStatusConnector(\\Bitrix\\Main\\Event $event)\n\t{\n\t\t$parameters = $event->getParameters();\n\n\t\tif (($parameters['fields']['ACTIVE'] == 'Y' &&\n\t\t\t$parameters['fields']['CONNECTION'] == 'Y' &&\n\t\t\t$parameters['fields']['REGISTER'] == 'Y' &&\n\t\t\t$parameters['fields']['ERROR'] == 'N') ||\n\t\t\t($parameters['fields']['ERROR'] == 'Y' &&\n\t\t\t$parameters['fields']['ACTIVE'] == 'Y'))\n\t\t{\n\t\t\tself::addSingleLineUpdateAgent($parameters['line']);\n\t\t}\n\t}", "public function update() {\n $hasduedate = isset($this->mumie->duedate) && $this->mumie->duedate > 0;\n if (!$this->event && $hasduedate) {\n $this->create_calendar_event(\n self::EVENT_TYPE,\n $this->mumie->duedate\n );\n } else if ($this->event && $hasduedate) {\n $update = new \\stdClass();\n $update->name = $this->title;\n $update->timestart = $this->mumie->duedate;\n $this->event->update($update, false);\n } else if ($this->event && !$hasduedate) {\n $this->event->delete();\n }\n }", "public function updateStatusOnNewDay() {\n // Update advs\n UIAdv::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n\n // Update advgroups\n UIAdvGroup::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n\n // Update campaign\n UICampaign::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n\n // Update project\n UIProject::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n }", "protected static function set_status()\n {\n }", "function _updateStatus($a_obj_id, $a_usr_id, $a_obj = null, $a_percentage = false, $a_no_raise = false, $a_force_raise = false)\n\t{\n//global $ilLog;\n//$ilLog->write(\"ilLPStatus-_updateStatus-\");\n\n\t\t$status = $this->determineStatus($a_obj_id, $a_usr_id, $a_obj);\n\t\t$percentage = $this->determinePercentage($a_obj_id, $a_usr_id, $a_obj);\n\t\t$changed = self::writeStatus($a_obj_id, $a_usr_id, $status, $percentage);\n\t\t\n\t\tif(!$a_no_raise && \n\t\t\t($changed || $a_force_raise)) // #15529\n\t\t{\n\t\t\tself::raiseEvent($a_obj_id, $a_usr_id, $status, $percentage);\t\t\t\n\t\t}\t\t\t\n\t}", "public function setActive()\n {\n $this->status = AutoEvent::STATUS_ACTIVE;\n $this->save();\n }", "public static function munim_schedule_status_update() {\n\t\tif ( ! wp_next_scheduled( 'munim_update_estimate_status' ) ) {\n\t\t\twp_schedule_event( time(), 'daily', 'munim_update_estimate_status' );\n\t\t}\n\t}", "public function updateStatusStart()\n {\n $this->resetStatuses();\n $this->pubDirectory->touch($this->getRelativeFilePath(self::IMPORT_STATUS_BUSY));\n }", "protected function updateCounter($event)\n\t{\n\t\tif (!array_key_exists($event, $this->counter))\n\t\t\t$this->counter[$event] = 0;\n\n\t\t$this->counter[$event]++;\n\t}", "public function setStatusTrue($event_id,$user_id,$subgroup_id) {\n\t\tDB::table('event_user')\n\t\t\t->where('myevent_id', $event_id)\n\t\t\t->where('user_id', $user_id)\n\t\t\t->where('subgroup_id', $subgroup_id)\n\t\t\t->update(array('status' => 1));\n\n\t\treturn Redirect::to(URL::previous());\n\t}", "public function status()\t{\n\t\t\t$this->veiculo->update($this->input->post('id'), array('veiculo_status' => $this->input->post('status')));\n\t\t}", "function update_status()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif(!empty($data['t']) && !empty($data['list'])) $result = $this->_bid->update_status($data['t'], explode('--',$data['list']));\n\t\t\n\t\t$data['msg'] = !empty($result['boolean']) && $result['boolean']? 'The bid status has been changed.': 'ERROR: The bid status could not be changed.';\n\t\t\n\t\t$data['area'] = 'refresh_list_msg';\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}", "public function refreshTaskStatus(){\n\n $webCronResult = $this->webCronResults()->orderBy('code', 'desc')->first();\n\n if ($webCronResult) {\n\n if ($webCronResult->code >= 300) {\n // bad status\n $this->status = 0 ;\n }else{\n // good status\n $this->status = 2 ;\n };\n\n $this->save();\n\n };\n\n }", "public function update_event($event_id,$_data){\r\n\t\t$ev=json_decode($this->get_event($event_id));\r\n\t\t$_data['sequence']=$ev->sequence+1;\r\n\t\t$args=$this->create_args($_data);\r\n\t\treturn($this->execute('update_event',$args,array('event_id'=>$event_id)));\r\n\t}", "function updateEvent(){\r\n\t\tif(!isset($_POST['submitted'])){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$formvars = array();\r\n\r\n\t\tif(!$this->ValidateUpdatedSubmission()){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$itemPicture = $this->upLoadPic();\r\n\t\tif($itemPicture != false){\r\n\t\t\t$formvars['Eflyer'] = $this->upLoadPic();\r\n\t\t}\r\n\t\t\t\t\r\n\t\t$picBanner = $this->upLoadBanner();\r\n\t\tif($picBanner != false){\r\n\t\t\t$formvars['Ebanner'] = $this->upLoadBanner();\r\n\t\t}\r\n\t\t\r\n\t\t$this->CollectUpdatedSubmission($formvars);\r\n\t\t\r\n\t\tif(!$this->updateEventInDatabase($formvars)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function updating()\n {\n # code...\n }", "function setEventType()\n {\n $this->_eventType = 12;\n }", "public function onEvent();", "function update() {\n\n\t\t\t}", "public static function updateStatus($status) {\n $status = strtoupper($status);\n if($status == 'UP' || $status == 'DOWN') {\n $newRecord = strtoupper($status) .','. time() . PHP_EOL;\n $insertNewRecord = file_put_contents(self::LOG_FILE, $newRecord, FILE_APPEND|LOCK_EX);\n $insertNewRecord == true ? $statusMessage = 'success'.PHP_EOL : $statusMessage = 'error'.PHP_EOL;\n return $statusMessage;\n }\n else { return 'error'.PHP_EOL; }\n }", "function updateEvent() {\n $url = './updateEvent.php';\n $data = array( 'session_id' => $_SESSION[ 'code' ], 'title' => $_POST[ 'title' ], 'id' => $_POST[ 'id' ], 'due' => $_POST[ 'due' ], 'class' => $_POST[ 'class' ] );\n\n $options = array(\n 'http' => array(\n 'method' => 'POST',\n 'content' => http_build_query($data)\n )\n );\n\n $context = stream_context_create($options);\n $result = json_decode(file_get_contents($url, false, $context), true);\n\n if ( $result[ \"error\" ] )\n return(\"ERROR: \" . $result[ \"message\" ]);\n else {\n return(true);\n }\n}", "protected function _updateStatus()\n {\n $this->_writeStatusFile(\n array(\n 'time' => time(),\n 'done' => ($this->_currentItemCount == $this->_totalFeedItems),\n 'count' => $this->_currentItemCount,\n 'total' => $this->_totalFeedItems,\n 'message' => \"Importing content. Item \" . $this->_currentItemCount\n . \" of \" . $this->_totalFeedItems . \".\"\n )\n );\n }", "public function onUpdate();", "public function onUpdate();", "public function onUpdate();", "public static function stateChanged($event)\r\n {\r\n }", "public function testEventStatus()\n {\n $feed = $this->eventFeed;\n\n // Assert that all entry's have an eventStatus object\n foreach ($feed as $entry) {\n $this->assertTrue($entry->getEventStatus() instanceof Zend_Gdata_Extension_EventStatus);\n }\n\n // Assert one of the entries values\n $entry = $feed[2];\n $this->verifyProperty2($entry, \"eventStatus\", \"value\", \"http://schemas.google.com/g/2005#event.confirmed\");\n }", "public function update(Request $request, $id)\n {\n\n\n $request->validate([\n 'event-title' => 'required',\n 'event-message' => 'required',\n 'eventStart-date' => 'required',\n 'event-time' => 'required'\n\n ]);\n\n $event = Event::find($id);\n if(Auth::check()){\n $logged_in_user = Auth::user()->name;\n }\n $registra = $event->event_registra;\n \n if(Gate::allows('update-event',$registra)){\n\n $title = request('event-title');\n $startDate = request('eventStart-date');\n $endDate = request('eventEnd-date');\n $time = request('event-time');\n $event_description = request('event-message');\n\n $event_description = preg_replace(\"/^<p.*?>/\", \"\", $event_description);\n $event_description = preg_replace(\"|</p>$|\", \"\", $event_description);\n $time = preg_replace('/\\s+/', '', $time) ;\n\n\n\n $event_details = $this->getEventdetails($id);\n foreach($event_details as $data)\n {\n $this->old_title = $data->title;\n $this->old_content = $data->description;\n $this->old_sdate = $data->start_date;\n $this->old_edate = $data->end_date;\n $this->old_stime = $data->start_time;\n }\n \n switch(true){\n case($title != $this->old_title):\n $changes[] = \"changed \".$this->old_title.\"\";\n break;\n case($startDate != $this->old_sdate):\n $changes[] = \"changed \".$this->old_sdate.\"\";\n break;\n case($endDate != $this->old_edate):\n $changes[] = \"changed \".$this->old_edate.\"\";\n break;\n case($time != $this->old_stime):\n $changes[] = \"changed \".$this->old_stime.\"\";\n break;\n }\n\n \n\n $event->title = $title;\n $event->start_date = $startDate;\n $event->end_date = $endDate;\n $event->start_time = $time;\n $event->description = $event_description;\n $event->event_registra = $logged_in_user;\n $registraEmail = Auth::user()->email;\n $registraPhone = Auth::user()->contact;\n $subject = \"Updated Event \".$this->old_title.\"\";\n\n $event_update_status = $event->save();\n\n if($event_update_status){\n\n $users = User::all();\n\n ($endDate == \"\")?\n $endDate_of_event = \"the same day\" : $endDate_of_event = $endDate;\n\n\n $data = array(\n 'title' => $title,\n 'description' => $event_description,\n 'start_date' => $startDate,\n 'end_date' => $endDate_of_event,\n 'time' => $time,\n 'registra' => $logged_in_user,\n 'registra_email' => $registraEmail,\n 'registraMobileNo' => $registraPhone,\n 'subject' => $subject,\n );\n\n $action = \"Updated an event with the title '\".$title.\"'\";\n LogsController::logger($action, $this->date_of_action);\n\n $notified = Notification::send($users, new EventNotifier($data));\n \n $central = new CentralController();\n\n if($central->is_connectedToInternet() == 1)\n {\n Mail::send('pages.mail.mail_event', $data, function($message) use ($title,$event_description, $startDate,$endDate_of_event,\n $time, $logged_in_user,$registraEmail,$registraPhone,$subject)\n { \n $message->from($registraEmail, 'Dallington');\n $message->to($registraEmail, 'Henry')->subject($subject);\n }); \n\n if(Mail::failures()){\n return redirect('events')->with('event-success','Event has been updated successfully and all users of the system have been notified with in the app notification but not via email because of internet connection issues');\n\n } \n\n else{\n\n return redirect('events')->with('event-success','Event has been updated successfully & all users of the system have been notified within the app notification & email'); \n }\n\n }\n\n else if($central->is_connectedToInternet() == 0)\n {\n return redirect('events')->with('event-success','Event has been updated successfully and all users of the system have been notified only in app notification');\n\n }\n\n\n\n }\n else\n {\n return redirect('events')->with('event-fail','Event has not been updated!');\n}\n\n}\n else\n {\n return redirect('/events')->with('event-fail','You cannot edit this event since you are not the one who created it!');\n}\n\n}", "public function setWatchStatus()\n\t\t{\n\t\t\t$model = $this->getModel();\n\t\t\t$model->is_watched = 'yes';\n\t\t\t$model->modifying_agent_id = ECash::getAgent()->getAgentId();\n\t\t\t$model->save();\n\t\t}", "public function updateStatusFinish()\n {\n $this->resetStatuses();\n }", "static public function status()\n {\n $GLOBALS['notification']->notify(array('listeners' => array('status', 'audio')));\n }", "public function update(Event $event){\r\n $stmt = $this->db->prepare(\"UPDATE event set type=?, name=?, moment=?, date=?, guests=?, children=?, \r\n sweet_table=?, observations=?, restaurant=?, phone=?, price=? WHERE id_event=?\");\r\n $stmt->execute(array($event->getType(), $event->getName(), $event->getMoment(), $event->getDate(), $event->getGuests(), $event->getChildren(),\r\n $event->getSweetTable(), $event->getObservations(), $event->getRestaurant(), $event->getPhone(),$event->getPrice(),$event->getIdEvent()));\r\n\r\n }", "function attendance_update_status($status, $acronym, $description, $grade, $visible,\n $context = null, $cm = null, $studentavailability = null,\n $availablebeforesession = false, $setunmarked = false) {\n global $DB;\n\n if (empty($context)) {\n $context = context_system::instance();\n }\n\n if (isset($visible)) {\n $status->visible = $visible;\n $updated[] = $visible ? get_string('show') : get_string('hide');\n } else if (empty($acronym) || empty($description)) {\n return array('acronym' => $acronym, 'description' => $description);\n }\n\n $updated = array();\n\n if ($acronym) {\n $status->acronym = $acronym;\n $updated[] = $acronym;\n }\n if ($description) {\n $status->description = $description;\n $updated[] = $description;\n }\n if (isset($grade)) {\n $status->grade = $grade;\n $updated[] = $grade;\n }\n if (isset($studentavailability)) {\n if (empty($studentavailability)) {\n if ($studentavailability !== '0') {\n $studentavailability = null;\n }\n }\n\n $status->studentavailability = $studentavailability;\n $updated[] = $studentavailability;\n }\n if (strpos(strval($availablebeforesession), 'on') === false) {\n $status->availablebeforesession = 0;\n } else {\n $status->availablebeforesession = 1;\n }\n if ($setunmarked) {\n $status->setunmarked = 1;\n } else {\n $status->setunmarked = 0;\n }\n $DB->update_record('attendance_statuses', $status);\n\n $event = \\mod_attendance\\event\\status_updated::create(array(\n 'objectid' => $status->attendanceid,\n 'context' => $context,\n 'other' => array('acronym' => $acronym, 'description' => $description, 'grade' => $grade,\n 'updated' => implode(' ', $updated))));\n if (!empty($cm)) {\n $event->add_record_snapshot('course_modules', $cm);\n }\n $event->add_record_snapshot('attendance_statuses', $status);\n $event->trigger();\n}", "function manualUpdate($state, $status){\n\t\t\t$credentials = getUserCredentials();\n\t\t\t\n\t\t\t$this->tHandle = new Twitter( getAppCredentials(), getUSerCredentials() );\n\t\t\t$this->tHandle->postStatus( $state, urldecode($status) );\n\t\t}", "public function commitEvents();", "public function update()\r\n {\r\n \r\n }", "public function updateStatus() {\n $ref = ORM::forTable('referrals')\n ->findOne($this->data['id']);\n if ($this->data['status'] == 'Assigned' && $this->data['route_id']) {\n $route = ORM::forTable('estimate_routes')\n ->findOne($this->data['route_id']);\n $assignedReferralsCount = ORM::forTable('referrals')\n ->select('id')\n ->where('route_id', $route->id)\n ->count();\n $ref->route_id = $this->data['route_id'];\n $ref->status = 'Assigned';\n $ref->route_order = $assignedReferralsCount;\n\n } elseif ($this->data['status'] == 'Pending') {\n $ref->status = 'Pending';\n $ref->route_order = 0;\n $ref->route_id = NULL;\n } else {\n $ref->status = $this->data['status'];\n }\n if ($ref->save()) {\n $this->renderJson([\n 'success' => true,\n 'message' => 'Job request status updated successfully'\n ]);\n } else {\n $this->renderJson([\n 'success' => false,\n 'message' => 'An error has occurred while saving job request'\n ]);\n }\n }", "public function changestatusAction()\n {\n $user_params=$this->_request->getParams();\n $automail=new Ep_Message_AutoEmails();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $ftvcontacts_obj = new Ep_Ftv_FtvContacts();\n $ftvpausetime_obj = new Ep_Ftv_FtvPauseTime();\n\n if($user_params['status'] == 'closed')\n $data = array(\"status\"=>$user_params['status'], \"cancelled_at\"=>date('Y-m-d H:i:s'));////////updating\n elseif($user_params['status'] == 'done')\n $data = array(\"status\"=>$user_params['status'], \"closed_at\"=>date('Y-m-d H:i:s'));////////updating\n else\n $data = array(\"status\"=>$user_params['status'], \"closed_at\"=>NULL, \"cancelled_at\"=>NULL);////////updating\n $query = \"identifier= '\".$user_params['requestId'].\"'\";\n $requestdetails = $ftvrequest_obj->requestDetailsById($user_params['requestId']);\n $contactId = $requestdetails[0]['request_by'];\n $contactdetails = $ftvcontacts_obj->getFtvContactDetails($contactId);\n $contactName = $contactdetails[0]['first_name'].\" \".$contactdetails[0]['last_name'];\n $parameters['ftvobject'] = $requestdetails[0]['request_object'];\n $parameters['ftvcontactName'] = $contactName;\n $ftvrequest_obj->updateFtvRequests($data,$query);\n ////making the time resume if its in pause////\n $inpause = $ftvpausetime_obj->inPause($user_params['requestId']);\n if($inpause == 'yes')\n {\n $data = array(\"resume_at\"=>date('Y-m-d H:i:s'));////////updating\n $query = \"ftvrequest_id = '\".$user_params['requestId'].\"' AND resume_at IS NULL \";\n $ftvpausetime_obj->updateFtvPauseTime($data,$query);\n }\n if($user_params['status'] == 'done')\n {\n if($this->adminLogin->userId != '110823103540627' ) ///when not johny head of BO user for FTV changed\n {\n $parameters['ftvrequestlink'] = \"/ftvchaine/ftvch-requests?submenuId=ML11-SL6\";\n $parameters['ftvType'] = \"chaine\";\n $automail->messageToEPMail('110823103540627',114,$parameters);// to johny\n $parameters['ftvrequestlink'] = \"http://ep-test.edit-place.com/ftvchaine/index\";\n $automail->sendFtvChaineContactsPersonalEmail($contactId,114,$parameters); // to client contact\n }\n else // in case jhony change the status\n {\n $parameters['ftvrequestlink'] = \"http://ep-test.edit-place.com/ftvchaine/index\";\n $automail->sendFtvChaineContactsPersonalEmail($contactId,114,$parameters); // to client contact\n }\n }\n\n }", "public function handleChangeStatus()\n\t{\n // TODO: nechat overenie na parmission listener\n\t\tif (!$this->user->isAllowed('position', 'changeStatus')) {\n\t\t\t$this->flashMessage(_('For this action you do not have enough privileges.'), 'danger');\n\t\t\t$this->redirect(':Admin:Dashboard:');\n\t\t}\n\n $this->positionStatusFilter->setEnabled(false);\n \n\t\t$this->repository->changeStatus(['id' => $this->id]);\n\n if ($this->isAjax()) {\n $this->redrawControl('positionStatus');\n } else {\n $this->redirect('this');\n }\n\t}", "private function dispatchStatusEvents(StatusChanged $event): void\n {\n $status = $event->getStatus();\n $eventNamesForStatus = $this->configProvider->getEventsForStatus((string)$status->getIdentifier());\n\n foreach ($eventNamesForStatus as $nextEventClassName) {\n try {\n $nextEvent = $this->eventCreator->createForTrackable($nextEventClassName, $event->getTrackable());\n\n $this->eventDispatcher->dispatch($nextEvent);\n } catch (TrackableEventCreationFailed $exception) {\n $this->logger->error(\n sprintf('Failed to dispatch event: `%s`. %s', $nextEventClassName, $exception->getMessage()),\n $exception->getTrace()\n );\n }\n }\n }", "function updateAttendee($eventID, $userID, $status)\r\r\n\t{\r\r\n\t\t// update the following fields in the database:\r\r\n\t\t$result = mysql_query(\"UPDATE eventAttendees SET status = '\".$status.\"' WHERE userID = '\".$userID.\"' AND eventID = '\".$eventID.\"'\");\r\r\n\t\t\r\r\n\t\tif (!$result) \r\r\n\t\t{\r\r\n\t\t\tthrow new Exception('Could not update event with eventID = $eventID.');\r\r\n\t\t}\t\t\r\r\n\t\treturn true;\r\r\n\t}", "public function execute()\n {\n if (!$this->getName() || $this->getName() == $this->getPreviousName()) {\n Log::debug('Status skipped');\n return;\n }\n $this->save();\n\n $modelStrat = $this->getModelStrategy();\n if (!$modelStrat instanceof StatusStrategyInterface) {\n Log::warning(get_class($modelStrat) . ' does not implement StatusStrategyInterface');\n return;\n }\n\n // Trigger mail event depending on the model\n if ($modelStrat->triggerStatusChange($this)) {\n if (!$this->getEvent()) {\n $this->setEvent($this->makeEventName());\n $this->save();\n }\n // Trigger Event\n $e = new StatusEvent($this);\n if ($this->getConfig()->getEventDispatcher()) {\n // Fire event to setup status mail messages\n $this->getConfig()->getEventDispatcher()->dispatch(StatusEvents::STATUS_CHANGE, $e);\n // Trigger status events for system wide processing. EG: 'status.placement.not approved', status.placementrequest.pending'\n $this->getConfig()->getEventDispatcher()->dispatch($this->getEvent(), $e);\n // Fire the event to send those messages\n $this->getConfig()->getEventDispatcher()->dispatch(StatusEvents::STATUS_SEND_MESSAGES, $e);\n }\n }\n }", "public function UserListChangeStatus(): void{\n \n if(!ArtworkVerifier::setStatusList($_POST) || !Session::isLogin()){\n exit;\n }\n \n if(isset(UserList::where('user_list.user_id', Session::getUser()['id'])->where('user_list.artwork_id', $_POST['artwork_id'])->getOne()->id)){\n UserList::values([ 'user_list.status' => $_POST['status'] ])\n ->where('user_id' ,Session::getUser()['id'])\n ->where('artwork_id', $_POST['artwork_id'])\n ->update();\n exit;\n }\n }", "public function updateEvent()\n {\n $result = $this->_signedResponse($this->vars->cal);\n\n if (!($kronolith_driver = $this->_getDriver($this->vars->cal)) ||\n !isset($this->vars->id)) {\n return $result;\n }\n\n try {\n $oevent = $kronolith_driver->getEvent($this->vars->id);\n } catch (Exception $e) {\n $GLOBALS['notification']->push($e, 'horde.error');\n return $result;\n }\n if (!$oevent) {\n $GLOBALS['notification']->push(_(\"The requested event was not found.\"), 'horde.error');\n return $result;\n } elseif (!$oevent->hasPermission(Horde_Perms::EDIT)) {\n $GLOBALS['notification']->push(_(\"You do not have permission to edit this event.\"), 'horde.warning');\n return $result;\n }\n\n $attributes = Horde_Serialize::unserialize($this->vars->att, Horde_Serialize::JSON);\n\n // If this is a recurring event, need to create an exception.\n if ($oevent->recurs()) {\n $this->_addException($oevent, $attributes);\n $event = $this->_copyEvent($oevent, null, $attributes);\n } else {\n $event = clone($oevent);\n }\n\n foreach ($attributes as $attribute => $value) {\n switch ($attribute) {\n case 'start':\n $newDate = new Horde_Date($value);\n $newDate->setTimezone($event->start->timezone);\n $event->start = clone($newDate);\n break;\n\n case 'end':\n $newDate = new Horde_Date($value);\n $newDate->setTimezone($event->end->timezone);\n $event->end = clone($newDate);\n if ($event->end->hour == 23 &&\n $event->end->min == 59 &&\n $event->end->sec == 59) {\n $event->end->mday++;\n $event->end->hour = $event->end->min = $event->end->sec = 0;\n }\n break;\n\n case 'offDays':\n $event->start->mday += $value;\n $event->end->mday += $value;\n break;\n\n case 'offMins':\n $event->start->min += $value;\n $event->end->min += $value;\n break;\n }\n }\n\n $result = $this->_saveEvent($event, ($oevent->recurs() ? $oevent : null), $attributes);\n if ($this->vars->u) {\n Kronolith::sendITipNotifications($event, $GLOBALS['notification'], Kronolith::ITIP_REQUEST);\n }\n\n return $result;\n }", "function updateStatus(){\n\t\t$this->setPost();\n\n\t\t$postData = $_POST;\n\n\t\tif($postData->status_id == 1){\n\t\t\t$updateData = array('status_id' => 2);\n\t\t}else{\n\t\t\t$updateData = array('status_id' => 1);\n\t\t}\n\n\t\t$where = array('id' => $postData->id);\n\n\t\t$result = $this->base_model->updateCommon($this->primaryTable, $updateData, $where);\n\n\t\t$response = array('status' => TRUE, 'message' => 'Document status updated successfully.');\n\n\t\techo json_encode($response);\n\t}", "public function updateBookingStatus(){\n $command = Yii::$app->db->createCommand();\n $id= Yii::$app->request->bodyParams[\"booking2\"];\n\n try {\n $command->update('car', ['pendingTime' => 'on', 'inUse' => 'pending'], 'id = '.$id)->execute();\n } catch (Exception $e) {\n printf(\"Cannot update data\");\n }\n }", "public static function ipnStatusEdit($event) { \n\t\t$keyAttrs = $event->key->attributes();\n\t\t$value = (string) $event->new_value;\n\t\t$agent = (string) $event->agent;\n\t\t$shoppingCartId = $keyAttrs['order_number'];\n\t\t$transactionId = (string) $event->key;\n\t\t\n\t\t$transaction = new transactionModel();\n\t\t$transaction->shoppingCartId = $shoppingCartId;\n\t\t\n\t\tif (!$transaction->load()){ \n\t\t\tthrow new exception (\"transaction id is invalid for shoppingCartId:$shoppingCartId\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tlog::info(\"Processing Kount notification: \" . print_r($event, true));\n\t\t\n\t\t//if the shopping cart isn't a complete int\n\t\t//i.e. 1178D in the case of a decline, let's just return\n\t\tif(preg_match('/[^0-9]/',$shoppingCartId)) {\n\t\t\treturn;\n\t\t} else {\n\t\t\t//otherwise we need to int up the shopping cart\n\t\t\t$shoppingCartId = (int) $shoppingCartId;\n\t\t}\n\t\t\n\t\t$cart = new shoppingCartModel($shoppingCartId);\n\t\tnew eventLogModel(\"screen\", \"kountReview\", $value, $cart->partner);\n\t\t\n\t\tif($value == kountHelper::APPROVE) { \n\t\t\tscreeningHelper::approveCart($shoppingCartId, $agent);\n\t\t}\n\t\t\n\t\telse if($value == kountHelper::DECLINE) { \n\t\t\tscreeningHelper::rejectCart($shoppingCartId, $agent);\n\t\t}\n\t\t\n\t\t$fraud = new fraud($transaction, $cart, null);\n\t\t$kount = new Kount($fraud);\n\t\t$kount->doUpdate($transactionId);\n\t}", "public function projectTaskStatusUpdate(){\r\n\t\t//fetch activity feed list\r\n\t\t$post = $this->input->post(null, true);\r\n\t\t$parent_id = $post['pid'];\r\n\t\t$task_id = $post['tid'];\r\n\t\t$status_id = $post['stat'];\r\n\t\t$completed_time = gmdate('Y-m-d H:i:s');\r\n\r\n\t\t//$task = new Task();\r\n\t\t$data = array('status_id' => $status_id, 'completed_date'=>$completed_time);\r\n\t\t$this->db->where(\"parent_id\", $parent_id);\r\n\t\t$this->db->where(\"task_id\", $task_id);\r\n\t\t$this->db->update(\"sc_tasks\", $data);\r\n\r\n\t}", "public static function postUpdate(Event $event){\n $io = $event->getIO();\n $io->write(\"postUpdate event triggered.\");\n }", "public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "public function updateStatus()\n {\n $this->status = Cart::CART_STATUS_ORDERED;\n $this->save();\n }", "public function update() {\r\n }", "public function update()\r\n {\r\n //\r\n }", "public function iterateCurrentEvent()\n {\n $this->currentEvent = $this->currentEvent + 1;\n }", "public function onSelectChangeStatus(GridRowEventData $event)\n {\n $id = $event->getId();\n $value = $event->getData();\n $control = $event->getControl();\n try {\n $this->adminFacade->changeStatus($id,(bool) $value);\n $control->flashMessage(\n self::MESSAGE_SUCCESS_CHANGE_STATUS,\n AdminPresenter::STATUS_SUCCESS,\n null,\n AdminPresenter::ICON_SUCCESS,\n 100\n );\n $control->reload();\n return;\n } catch (AdminException $exc) {\n $control->getPresenter()->flashMessage(\n $exc->getMessage(),\n AdminPresenter::STATUS_DANGER,\n null,\n AdminPresenter::ICON_DANGER,\n 100\n );\n $control->getPresenter()->redirect(AdminPresenter::ACTION_DEFAULT);\n }\n }", "public function postEventedit();", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "public function update(Request $request, Event $event)\n {\n //\n }", "public function update(Request $request, Event $event)\n {\n //\n }", "public function update(Request $request, Event $event)\n {\n //\n }", "public function update(Request $request, Event $event)\n {\n //\n }", "public function update(Request $request, Event $event)\n {\n //\n }", "public function update(Request $request, Event $event)\n {\n //\n }", "public function update(Request $request, Event $event)\n {\n //\n }", "protected function update() {}", "public function estatus( Request $request ){\n \n $error = null;\n DB::beginTransaction();\n try {\n $response = $this->_tabla_model::where(['id' => $request->id])->update(['id_estatus' => $request->id_estatus]);\n DB::commit();\n $success = true;\n } catch (\\Exception $e) {\n $success = false;\n $error = $e->getMessage().\" \".$e->getLine().\" \".$e->getFile();\n DB::rollback();\n }\n\n if ($success) {\n return $this->_message_success( 201, $response , self::$message_success );\n }\n return $this->show_error(6, $error, self::$message_error );\n \n }", "public function updateStatus()\n\t\t{\n\t\t\t$thingdom = $this->getThingdom();\n\n\t\t\tif(!$thingdom) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$page_count = wp_count_posts('page')->publish;\n\t\t\t$post_count = wp_count_posts()->publish;\n\t\t\t$comment_count = wp_count_comments()->approved;\n\n\t\t\t$thing = $thingdom->getThing($this->thingName, $this->thingType);\n\n\t\t\t$thing->status('page_count', $page_count);\n\t\t\t$thing->status('post_count', $post_count);\n\t\t\t$thing->status('comment_count', $comment_count);\n\t\t}", "private function setStatus($status)\n {\n $this->status = $status;\n\n $hash = spl_object_hash($this);\n $name = TaskStatus::getName($status);\n // echo \"task [$hash] -> $name\\n\"; // TODO\n }", "public function update() {\r\n\r\n\t}", "public function update()\n {\n }", "function entry_api_ui_event_form_submit($form, &$form_state) {\n\n if ($form_state['#update_event']) {\n $form_state['redirect'] = culturefeed_search_detail_url('event', $form_state['#event_id'], $form_state['values']['title']);\n drupal_set_message('De activiteit werd aangepast. Het duurt echter een half uur eer het\n op alle kanalen (inclusief UitinVlaanderen) beschikbaar zal zijn. ');\n }\n else {\n $link_change_event = '<a href=\"/entryapi/event/' . $form_state['#event_id'] . '/edit\">Klik hier om het event aan te passen</a>';\n drupal_set_message('De activiteit werd toegevoegd. Het duurt echter een half uur eer het\n op alle kanalen (inclusief UitinVlaanderen) beschikbaar zal zijn. ' . $link_change_event);\n }\n\n}", "private function updateOperation() {\n sleep(1);\n }", "public function onUpdateRecord()\n {\n $this->updated = new \\DateTime();\n $this->rev++;\n }", "public static function setStatusOnQuestions($event, $type, $object) {\n\t\t\n\t\t// ignore access\n\t\t$ia = elgg_set_ignore_access(true);\n\t\t\n\t\t$path = 'admin/upgrades/set_question_status';\n\t\t$upgrade = new \\ElggUpgrade();\n\t\tif (!$upgrade->getUpgradeFromPath($path)) {\n\t\t\t$upgrade->setPath($path);\n\t\t\t$upgrade->title = elgg_echo('admin:upgrades:set_question_status');\n\t\t\t$upgrade->description = elgg_echo('admin:upgrades:set_question_status:description');\n\t\t\t\t\n\t\t\t$upgrade->save();\n\t\t}\n\t\t\n\t\t// restore access\n\t\telgg_set_ignore_access($ia);\n\t}", "public function event_joined()\r\n\t{\r\n\t\r\n\t}", "private function updateSpoolStatus ()\n {\n\n $oAppMessage = (new AppMessage())->retrieveByPK ($this->spool_id);\n if ( is_array ($this->fileData['attachments']) )\n {\n $attachment = implode (\",\", $this->fileData['attachments']);\n $oAppMessage->setappMsgAttach ($attachment);\n }\n $oAppMessage->setappMsgstatus ($this->status);\n $oAppMessage->setappMsgsenddate (date ('Y-m-d H:i:s'));\n $oAppMessage->save ();\n }", "public function setStatus($status)\r\n {\r\n $this->status = $status;\r\n }", "abstract public function setStatus($status);", "public function update()\n {\n \n }", "public function update()\n {\n \n }", "public function update() {\n \n }", "public function actionUpdateStatus() {\n $model = UserJobEditorFlag::model()->findByPk(Yii::app()->request->getPost('instanceId'));\n if (!$model instanceof UserJobEditorFlag) return false;\n $saved = $model->updateStatus(Yii::app()->request->getPost('status'));\n $this->sendResponse(200, $this->getObjectEncoded(array('message' => $saved ? 'ok' : 'error')));\n }", "public function inProgress()\n {\n $this->setStatus(self::STATUS_IN_PROGRESS);\n }", "public function setstatus()\n {\n $this->checkAjaxToken();\n $this->throwForbiddenUnless(SecurityUtil::checkPermission('Ephemerides::', '::', ACCESS_ADMIN));\n\n $eid = $this->request->request->get('eid', 0);\n $status = $this->request->request->get('status', 0);\n $alert = '';\n \n if ($eid == 0) {\n $alert .= $this->__('No ID passed.');\n } else {\n $item = array('eid' => $eid, 'status' => $status);\n $res = DBUtil::updateObject($item, 'ephem', '', 'eid');\n if (!$res) {\n $alert .= $item['eid'].', '. $this->__f('Could not change item, ID %s.', DataUtil::formatForDisplay($eid));\n if ($item['status']) {\n $item['status'] = 0;\n } else {\n $item['status'] = 1;\n }\n }\n }\n // get current status to return\n $item = ModUtil::apiFunc($this->name, 'user', 'get', array('eid' => $eid));\n if (!$item) {\n $alert .= $this->__f('Could not get data, ID %s.', DataUtil::formatForDisplay($eid));\n }\n\n return new Zikula_Response_Ajax(array('eid' => $eid, 'status' => $item['status'], 'alert' => $alert));\n }" ]
[ "0.7146201", "0.67448777", "0.6676829", "0.6531916", "0.64404905", "0.6437973", "0.6331336", "0.62437505", "0.62183684", "0.6192995", "0.61667514", "0.6163606", "0.6142747", "0.61407894", "0.61401004", "0.61283123", "0.610224", "0.60982877", "0.60603774", "0.6055809", "0.6010688", "0.59805506", "0.5948931", "0.5943805", "0.59435195", "0.5935749", "0.5921367", "0.5907951", "0.5887728", "0.5862968", "0.58551174", "0.5847889", "0.58385736", "0.5829761", "0.582285", "0.5819507", "0.581412", "0.5814082", "0.5814082", "0.5814082", "0.58133763", "0.5806124", "0.5799794", "0.5792654", "0.57672304", "0.57618344", "0.57374865", "0.57313925", "0.5730833", "0.5728276", "0.5699574", "0.5695969", "0.5693234", "0.5686406", "0.5680054", "0.56796885", "0.5672639", "0.5664971", "0.56643575", "0.56642294", "0.5661984", "0.5661972", "0.5658212", "0.56573105", "0.5648697", "0.564618", "0.5640455", "0.56285816", "0.5625747", "0.5623747", "0.5623247", "0.56194323", "0.56194323", "0.5608899", "0.5608899", "0.5608899", "0.5608899", "0.5608899", "0.5608899", "0.5608899", "0.5605133", "0.560452", "0.56017613", "0.55916584", "0.55897117", "0.5588113", "0.5587659", "0.5569938", "0.55621696", "0.55572987", "0.5557036", "0.55549526", "0.55476564", "0.5538087", "0.55377007", "0.55377007", "0.55373675", "0.5529457", "0.55291593", "0.55271304" ]
0.63087773
7
time() + 3600 = one hour from now. =============================== END OF CRON SETUP FOR MOOSE ========================================= Below is a fictional example of adding a successful order to a third party order fulfillment system.
function membership_payment_processing($entry, $feed, $transaction_id, $amount) { $message = ''; $message .= '<h1> THE $entry DETAILS </h1>'; $message .= '<table>'; foreach ( $entry as $key => $value ) { $message .= '<tr>'; $message .= '<th>Key: </th>' . '<td>' . $key . '</td> <th>Value: </th>' . '<td>' . $value . '</td>'; $message .= '</tr>'; } $message .= '</table>'; $message .= '<h1> THE $feed DETAILS </h1>'; $message .= '<table>'; foreach ( $feed as $key => $value ) { $message .= '<tr>'; $message .= '<th>Key: </th>' . '<td>' . $key . '</td> <th>Value: </th>' . '<td>' . $value . '</td>'; $message .= '</tr>'; } $message .= '</table>'; //add filter to enable HTML messages add_filter('wp_mail_content_type','set_email_to_html'); //send yourself an email (replace the email address below with yours) wp_mail('[email protected]','Gravity PayPal Information', $message); //remove filter (to set back to plain text email) remove_filter( 'wp_mail_content_type', 'set_email_to_html' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fulfillOrder($order_id)\n {\n $order = $this->db->prepare(<<<SQL\nUPDATE orders SET arrival_date = NOW() WHERE orders.order_id = :order_id;\nSQL\n );\n $order->execute(array(':order_id' => $order_id));\n}", "function createOrder($order,$requester,$numberId){\n $sql='';\n //status==0 mean have to cook and else will finish now status will be send\n $finish_time=$order->status==0 ? '\\'0000-00-00 00:00:00\\'' :'now()';\n $sql = 'INSERT INTO `order` (waiter_id,chef_id, number_id, table_id, product_id,bill_detail_id, count, comments, order_time, finish_time, status, price) VALUES ';\n $sql.= '(\\''.$requester.'\\',\\'\\','.$numberId.', '.$order->table_id.', '.$order->product_id.',-1,'.$order->count.',\\''.$order->comments.'\\', now(), '.$finish_time.', \\''.$order->status.'\\', '.$order->price.');';\n //echo $sql;\n if(isset($this->connection)){\n return $this->queryNotAutoClose($sql);\n }else{\n return $this->query($sql);\n }\n }", "function CallOrder()\n {\n global $USER, $CONF, $UNI;\n\n $this->amount = str_replace(\".\",\"\",HTTP::_GP('amount',0));\n $this->amountbis = HTTP::_GP('amount',0);\n\t\t\t\t\n\t\t\t\tif($this->amount < 10000){\n\t\t\t\t$this->printMessage('You have to buy minimum 10.000 AM!', true, array('game.php?page=donate', 3)); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($this->amount >= 10000 && $this->amount < 20000)\t\t$this->amount *= 1.05;\n\t\t\t\telseif($this->amount >= 20000 && $this->amount < 50000) $this->amount *= 1.10;\n\t\t\t\telseif($this->amount >= 50000 && $this->amount < 100000) $this->amount *= 1.20;\n\t\t\t\telseif($this->amount >= 100000 && $this->amount < 150000) $this->amount *= 1.30;\n\t\t\t\telseif($this->amount >= 150000 && $this->amount < 200000) $this->amount *= 1.40;\n\t\t\t\telseif($this->amount >= 200000) $this->amount *= 1.50;\n\t\t\t\t\n\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->amount = round($this->amount + ($this->amount / 100 * 0));\n\t\t\t\t$this->amount = $this->amount + ($this->amount / 100 * 0);\n\t\t\t\t$this->cost = round($this->amountbis * 0.00011071);\n \n\n \n\t\t\t\t\n\t\t\t\t$this_p = new paypal_class;\n\t\t\t\t\n \n $this_p->add_field('business', $this::MAIL);\n \n\t\t\t\t\n\t\t\t $this_p->add_field('return', 'http://'.$_SERVER['HTTP_HOST'].'/game.php?page=overview');\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this_p->add_field('cancel_return', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n $this_p->add_field('notify_url', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n\t\t\t\t\n $this_p->add_field('item_name', $this->amount.' AM-User('.$USER['username'].').');\n $this_p->add_field('item_number', $this->amount.'_AM');\n $this_p->add_field('amount', $this->cost);\n //$this_p->add_field('action', $action); ?\n $this_p->add_field('currency_code', 'EUR');\n $this_p->add_field('custom', $USER['id']);\n $this_p->add_field('rm', '2');\n //$this_p->dump_fields(); \n\t\t\t\t foreach ($this_p->fields as $name => $value) {\n\t\t\t\t\t$field[] = array('text'=>'<input type=\"hidden\" name=\"'.$name.'\" value=\"'.$value.'\">');\n\t\t\t\t}\n\t\t\t $this->tplObj->assign_vars(array(\n\t\t\t\t'fields' => $field,\n\t\t\t ));\n\t\t\t$this->display('paypal_class.tpl');\n }", "function submitOrder() {\n\techo \"Submitting Order </br>\";\n\t$data = createOrder();\n\t$response = postRequest('/api/order', $data);\n\tprintInfo($response);\n}", "private function sellTrasactionPendingAddsMoney(){\n\n }", "function add_extra_person($billing_person,$data,$product_id,$action_set_id = 0)\n {\n $data['Address2Street1'] = $data['StreetAddress1'];\n $data['Address2Street2'] = $data['StreetAddress2'];\n $data['City2'] = $data['City'];\n $data['State2'] = $data['State'];\n $data['PostalCode2'] = $data['PostalCode'];\n $data['Country2'] = $data['Country'];\n $data['_OrderName'] = $billing_person->FirstName . \" \" . $billing_person->LastName . \" \" . $billing_person->Email;\n $data['_PurchasedBy'] = $billing_person->FirstName . \" \" . $billing_person->LastName;\n $data['_OrderEmail'] = $billing_person->Email;\n\n $contact_id = $this->create_contact($data);\n //Opt Person In\n $this->optIn($data['Email'],'Friend purchased');\n\n //Create Zero Dollar Order\n $affiliate_id = $this->get_current_affiliate($contact_id);\n $invoice_id = $this->blankOrder($contact_id,'Extra: The Matrix Assessment Profile',$this->infuDate(date('d-m-Y')),$affiliate_id,$affiliate_id);\n $this->addOrderItem($invoice_id,$product_id,4,0.00,1,'Friend: ' . $data['_OrderName'] . ' ordered','');\n\n sleep(1); //IS throttling\n\n //Add Notes to the Job/Order Record\n $invoice = $this->dsLoad('Invoice',$invoice_id,array('JobId'));\n $r = $this->dsUpdate('Job',$invoice['JobId'],array('JobNotes' => 'Ordered By: ' . $data['_OrderName']));\n\n sleep(1); //IS throttling\n\n $r = $this->runAS($contact_id,$action_set_id);\n\n $this->achieveGoal('optimalwellness','mapfriendemail',$contact_id);\n\n return $data['FirstName'] . ' ' . $data['LastName'] . ' ID: ' . $contact_id;\n\n }", "private function insertOrder($custID) {\n $time = time();\n $order = new Order();\n $order->custID = $custID;\n $order->orderdate = $time;\n $order->save();\n return $time;\n }", "function campaignEcommAddOrder($order) {\n $params = array();\n $params[\"order\"] = $order;\n return $this->callServer(\"campaignEcommAddOrder\", $params);\n }", "public static function simulate_new_request() {\n self::$now += 0.1;\n self::$purgetoken = null;\n }", "function addOrder () {\n\t//\terror_log ( 'addOrder\\n', 3, '/var/tmp/php.log' );\n\t$request = Slim::getInstance ()->request ();\n\t$order = json_decode ( $request->getBody () );\n\t//\t$sql = \"INSERT INTO wine (name, grapes, country, region, year, description) VALUES (:name, :grapes, :country, :region, :year, :description)\";\n\ttry {\n\t\t$db = new DbOperation();\n\t\t$orderId = $db->addOrder ( $order );\n\t\t//\t\t$stmt = $db->prepare ( $sql );\n\t\t//\t\t$stmt->bindParam ( \"name\", $order->name );\n\t\t//\t\t$stmt->bindParam ( \"grapes\", $order->grapes );\n\t\t//\t\t$stmt->bindParam ( \"country\", $order->country );\n\t\t//\t\t$stmt->bindParam ( \"region\", $order->region );\n\t\t//\t\t$stmt->bindParam ( \"year\", $order->year );\n\t\t//\t\t$stmt->bindParam ( \"description\", $order->description );\n\t\t//\t\t$stmt->execute ();\n\t\t//\t\t$order->id = $db->lastInsertId ();\n\t\t//\t\t$db = null;\n\t\t// print_f($order);\n\t\t// $order.push(\"orderId\", $orderId);\n\t\t// print_f($order);\n\t\t$order->orderId = $orderId;\n\t\techo '{\"addedOrder\":' . json_encode ( $order ) . '}';\n\t\t// echo $orderId;\n\t} catch ( Exception $e ) {\n\t\t//\t\terror_log ( $e->getMessage (), 3, '/var/tmp/php.log' );\n\t\t//\t\techo '{\"error\":{\"text\":' . $e->getMessage () . $e.'}}';\n\t\techo '{\"errorText\":\"Add order fail with text as\", \"text\":}' . $e->getMessage () . $e . '}';\n\t}\n}", "private function ThanksForYourOrder()\n\t\t{\n\t\t\t// Reload all fo the information about the order as there's a good chance\n\t\t\t// a fair bit of it has changed now\n\t\t\t$this->SetOrderData();\n\n\t\t\t$GLOBALS['ISC_CLASS_CART'] = GetClass('ISC_CART');\n\t\t\t$GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER');\n\n\t\t\t$GLOBALS['HideError'] = \"none\";\n\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = '';\n\t\t\t$GLOBALS['HideAwaitingPayment'] = \"none\";\n\n\t\t\t$GLOBALS['HideStoreCreditUse'] = 'none';\n\n\t\t\tif($this->pendingData['storecreditamount'] > 0) {\n\t\t\t\t$GLOBALS['HideStoreCreditUse'] = '';\n\t\t\t\t$GLOBALS['StoreCreditUsed'] = CurrencyConvertFormatPrice($this->pendingData['storecreditamount']);\n\n\t\t\t\t$GLOBALS['StoreCreditBalance'] = CurrencyConvertFormatPrice($GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerStoreCredit($this->pendingData['customerid']));\n\t\t\t\t$GLOBALS['ISC_LANG']['OrderCreditDeducted'] = sprintf(GetLang('OrderCreditDeducted'), GetConfig('CurrencyToken') . $GLOBALS['StoreCreditUsed']);\n\t\t\t}\n\n\t\t\t// If it was an offline payment method, show the post-purchase message and hide other messages\n\t\t\tif(is_object($this->paymentProvider) && $this->paymentProvider->GetPaymentType() == PAYMENT_PROVIDER_OFFLINE && method_exists($this->paymentProvider, 'GetOfflinePaymentMessage')) {\n\t\t\t\t$defaultCurrency = GetDefaultCurrency();\n\t\t\t\t$GLOBALS['OrderTotal'] = FormatPrice($this->pendingData['gatewayamount'], false, true, false, $defaultCurrency, true);\n\n\t\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = \"none\";\n\t\t\t\t$GLOBALS['PaymentMessage'] = $this->paymentProvider->GetOfflinePaymentMessage();\n\t\t\t\t$GLOBALS['SNIPPETS']['OfflinePaymentMessage'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"OfflinePaymentMessage\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Was the order declined?\n\t\t\t\tif($this->pendingData['status'] == 6) {\n\t\t\t\t\t$GLOBALS['HideError'] = '';\n\t\t\t\t\t$GLOBALS['ErrorMessage'] = sprintf(GetLang('ErroOrderDeclined'), GetConfig('OrderEmail'), GetConfig('OrderEmail'));\n\t\t\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = 'none';\n\t\t\t\t\t$GLOBALS['ISC_LANG']['ThanksForYourOrder'] = GetLang('YourPaymentWasDeclined');\n\t\t\t\t}\n\t\t\t\t// Order is still awaiting payment\n\t\t\t\telse if($this->pendingData['status'] == 7) {\n\t\t\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = \"none\";\n\t\t\t\t\t$GLOBALS['HideAwaitingPayment'] = \"\";\n\t\t\t\t}\n\t\t\t\t// Otherwise, order was successful\n\t\t\t\telse {\n\t\t\t\t\t// Is it a physical or digital order?\n\t\t\t\t\tif($this->pendingData['isdigital'] == 100) {\n\n\t\t\t\t\t\t// If this order has no customer ID associated with it (guest checkout with no account creation) then display an alternative text with no download link\n\t\t\t\t\t\tif (!isId($this->pendingData['customerid'])) {\n\t\t\t\t\t\t\t$GLOBALS['DigitalOrderConfirmation'] = GetLang('DigitalOrderConfirmationGuestCheckout');\n\t\t\t\t\t\t\t$GLOBALS['HideDigitalOrderDownloadLink'] = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Otherwise display nthe normal text with the download link in it\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$GLOBALS['DigitalOrderConfirmation'] = GetLang('DigitalOrderConfirmation');\n\t\t\t\t\t\t\t$GLOBALS['HideDigitalOrderDownloadLink'] = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$GLOBALS['HidePhysicalOrderConfirmation'] = \"none\";\n\t\t\t\t\t\t$GLOBALS['HidePhysicalViewOrderLink'] = \"none\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\n\t\t\t\t\t\t// If this order has no customer ID associated with it (guest checkout with no account creation) then display an alternative text with no view order link\n\t\t\t\t\t\tif (!isId($this->pendingData['customerid'])) {\n\t\t\t\t\t\t\t$GLOBALS['PhysicalOrderConfirmation'] = GetLang('PhysicalOrderConfirmationGuestCheckout');\n\t\t\t\t\t\t\t$GLOBALS['HidePhysicalViewOrderLink'] = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Otherwise display nthe normal text with the download link in it\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$GLOBALS['PhysicalOrderConfirmation'] = GetLang('PhysicalOrderConfirmation');\n\t\t\t\t\t\t\t$GLOBALS['HidePhysicalViewOrderLink'] = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$GLOBALS['HideDigitalOrderConfirmation'] = \"none\";\n\t\t\t\t\t\t$GLOBALS['HideDigitalOrderDownloadLink'] = \"none\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->CreateCupons();\n\t\t\t\n\t\t\t// Include the conversion code for each analytics module\n\t\t\t$GLOBALS['ConversionCode'] = '';\n\t\t\t$analyticsModules = GetAvailableModules('analytics', true, true);\n\t\t\tforeach($analyticsModules as $module) {\n\t\t\t\t$module['object']->SetOrderData($this->pendingData);\n\t\t\t\t$trackingCode = $module['object']->GetConversionCode();\n\t\t\t\tif($trackingCode != '') {\n\t\t\t\t\t$GLOBALS['ConversionCode'] .= \"\n\t\t\t\t\t\t<!-- Start conversion code for \".$module['id'].\" -->\n\t\t\t\t\t\t\".$trackingCode.\"\n\t\t\t\t\t\t<!-- End conversion code for \".$module['id'].\" -->\n\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Include the conversion tracking code for affiliates\n\t\t\tforeach($this->pendingData['orders'] as $order) {\n\t\t\t\tif(strlen(GetConfig('AffiliateConversionTrackingCode')) > 0) {\n\t\t\t\t\t$converted_code = GetConfig('AffiliateConversionTrackingCode');\n\t\t\t\t\t$subTotalColumn = 'subtotal_ex_tax';\n\t\t\t\t\t$totalColumn = 'total_inc_tax';\n\t\t\t\t\tif(getConfig('taxDefaultTaxDisplayOrders') == TAX_PRICES_DISPLAY_INCLUSIVE) {\n\t\t\t\t\t\t$subTotalColumn = 'subtotal_inc_tax';\n\t\t\t\t\t}\n\n\t\t\t\t\t$discountedSubTotal = $_SESSION['LAST_ORDER_DISCOUNTED_SUBTOTAL'];\n\t\t\t\t\tunset($_SESSION['LAST_ORDER_DISCOUNTED_SUBTOTAL']);\n\n\t\t\t\t\t$replacements = array(\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL%%' => $order[$subTotalColumn] / 1,\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL_IN_CENTS%%' => ($order[$subTotalColumn] / 1) * 100,\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL_DISCOUNTED%%' => $discountedSubTotal / 1,\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL_DISCOUNTED_IN_CENTS%%' => ($discountedSubTotal / 1) * 100,\n\t\t\t\t\t\t'%%ORDER_AMOUNT%%' => $order['total_inc_tax'] / 1,\n\t\t\t\t\t\t'%%ORDER_AMOUNT_IN_CENTS%%' => ($order['total_inc_tax'] / 1) * 100,\n\t\t\t\t\t\t'%%ORDER_ID%%' => $order['orderid'],\n\t\t\t\t\t);\n\t\t\t\t\t$converted_code = str_ireplace(array_keys($replacements), $replacements, $converted_code);\n\t\t\t\t\t$GLOBALS['ConversionCode'] .= $converted_code;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// leave this in for outdated templates: hide the product updates div\n\t\t\t$GLOBALS['HideProductUpdates'] = \"none\";\n\n\t\t\tif(method_exists($this->paymentProvider, 'ShowOrderConfirmation')) {\n\t\t\t\t$GLOBALS['OrderConfirmationDetails'] = $this->paymentProvider->ShowOrderConfirmation($this->pendingData);\n\t\t\t}\n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// Show the order confirmation screen\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetLang('ThanksForYourOrder'));\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate(\"order\");\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t\t}", "public function place_order(){\n $customer_id = $_REQUEST['customer_id'];\n $razorpay_payment_id = $_REQUEST['razorpay_payment_id'];\n $online_payment_amt = $_REQUEST['online_payment_amt'];\n\n $current_date = date('d-m-Y');\n $current_time = date('h:i:s A');\n\n /********************* Save Order Data **************/\n $save_order_data['customer_id'] = $customer_id;\n $save_order_data['order_cust_fname'] = $_REQUEST['customer_fname'];\n $save_order_data['order_cust_lname'] = $_REQUEST['customer_lname'];\n\n // $save_order_data['order_cust_addr'] = $_REQUEST['customer_address'];\n // $save_order_data['city_id'] = $_REQUEST['city_id'];\n // $save_order_data['order_cust_pin'] = $_REQUEST['customer_pin'];\n\n $save_order_data['order_cust_mob'] = $_REQUEST['customer_mobile'];\n $save_order_data['order_cust_email'] = $_REQUEST['customer_email'];\n\n // $save_order_data['order_amount'] = $_REQUEST['order_amount']; //$cart_total-$gst_amt; // GST is Inclusive...\n // $save_order_data['order_gst'] = $_REQUEST['total_gst_amount']; // Calculate Inclusive GST...\n\n $save_order_data['order_shipping_amt'] = $_REQUEST['order_shipping_amt']; // Shipping Amount is 100Rs if cart_total < 799Rs.\n $save_order_data['order_total_amount'] = $_REQUEST['order_total_amount']; // $cart_total + $shipping_amt;\n\n $save_order_data['order_date'] = date('d-m-Y');\n $save_order_data['payment_status'] = $_REQUEST['payment_status'];\n $save_order_data['order_added_date'] = date('d-m-Y h:i:s A');\n $save_order_data['order_addedby'] = 0;\n $save_order_data['order_no'] = $this->User_Model->get_count_no('order_no', 'order_tbl');\n\n $save_order_data['order_timeslot_date'] = $_REQUEST['order_timeslot_date'];\n $save_order_data['order_timeslot_time'] = $_REQUEST['order_timeslot_time'];\n $address_id = $_REQUEST['address_id'];\n $address_data = $country_info = $this->User_Model->get_info_arr_fields('*','address_id', $address_id, 'delivery_address');\n $save_order_data['order_cust_addr'] = $address_data[0]['address'];\n $save_order_data['country_id'] = $address_data[0]['country_id'];\n $save_order_data['state_id'] = $address_data[0]['state_id'];\n $save_order_data['city_id'] = $address_data[0]['city_id'];\n $save_order_data['order_cust_pin'] = $address_data[0]['pincode'];\n\n $order_id = $this->User_Model->save_data('order_tbl', $save_order_data);\n\n if($order_id){\n // Add/Save Reward Points if Shop >= 999...\n $response[\"status\"] = TRUE;\n $response[\"msg\"] = 'Order Saved Successfully';\n\n $cart_total = $_REQUEST['order_total_amount'] - $_REQUEST['order_shipping_amt'];\n if($cart_total >= 999){\n $save_point_add['customer_id'] = $customer_id;\n $save_point_add['point_add_type'] = 3;\n $save_point_add['point_add_ref_id'] = $order_id;\n $save_point_add['point_add_cnt'] = 5;\n $save_point_add['point_add_date'] = $current_date;\n $save_point_add['point_add_time'] = $current_time;\n $this->User_Model->save_data('point_add', $save_point_add);\n $response[\"reward_point_msg\"] = '5 Reward Points Saved';\n }\n\n /****************** Save Order Product ****************/\n\n\n if($_POST['order_product']){\n $total_gst_amount = \"0\";\n $i = 0;\n foreach($_POST['order_product'] as $order_product_data){\n $product_id = $order_product_data['product_id'];\n $pro_attri_id = $order_product_data['pro_attri_id'];\n $order_pro_qty = $order_product_data['order_pro_qty'];\n $order_pro_weight = $order_product_data['order_pro_weight'];\n $order_pro_qty = $order_product_data['order_pro_qty'];\n $order_pro_price = $order_product_data['order_pro_price'];\n\n $product_details = $this->User_Model->get_info_arr_fields('product_id, product_name, tax_rate, min_ord_limit, max_ord_limit, product_unit, product_details, product_img','product_id', $product_id, 'product');\n $product_attribute_details = $this->User_Model->get_info_arr_fields('pro_attri_id, product_id, pro_attri_weight, pro_attri_mrp, pro_attri_price, pro_attri_dis_per, pro_attri_dis_amt', 'pro_attri_id', $pro_attri_id, 'product_attribute');\n\n $pro_attri_dis_amt = $product_attribute_details[0]['pro_attri_dis_amt'];\n $order_pro_gst_per = $product_details[0]['tax_rate'];\n\n $order_pro_dis_amt = $order_pro_gst_per * $order_pro_qty;\n $order_pro_amt = $order_pro_price * $order_pro_qty;\n $order_pro_gst_amt = $order_pro_amt - ($order_pro_amt * (100/(100 + $order_pro_gst_per)));\n $order_pro_basic_amt = $order_pro_amt - $order_pro_gst_amt;\n\n $order_product_data['order_pro_dis_amt'] = $order_pro_dis_amt;\n $order_product_data['order_pro_gst_per'] = $order_pro_gst_per;\n $order_product_data['order_pro_gst_amt'] = $order_pro_gst_amt;\n $order_product_data['order_pro_basic_amt'] = $order_pro_basic_amt;\n $order_product_data['order_pro_amt'] = $order_pro_amt;\n $order_product_data['order_id'] = $order_id;\n $order_product_data['order_pro_date'] = date('d-m-Y h:i:s A');\n $order_product_data['order_pro_tot_weight'] = $order_pro_weight * $order_pro_qty;\n $order_pro_id = $this->User_Model->save_data('order_pro', $order_product_data);\n\n $total_gst_amount = $total_gst_amount + $order_pro_gst_amt;\n $i++;\n if($order_pro_id){\n $response[\"order_product_msg_\".$i] = 'Order Product '.$i.' Saved Successfully';\n } else{\n $response[\"order_product_msg_\".$i] = 'Order Product '.$i.' Not Saved';\n }\n }\n $cart_total = $_REQUEST['order_total_amount'] - $_REQUEST['order_shipping_amt'];\n $order_amount = $cart_total - $total_gst_amount;\n // Update total_gst_amount & order_amount in order_tbl...\n $update_order_data['order_gst'] = $total_gst_amount;\n $update_order_data['order_amount'] = $order_amount;\n $this->User_Model->update_info('order_id', $order_id, 'order_tbl', $update_order_data);\n } else{\n $response[\"order_product_msg\"] = 'Order Product Not Saved';\n }\n\n /******** Save Online Payment Data *********/\n\n if($_REQUEST['coupon_used_dis_amt'] > 0 ){ $coupon_used_dis_amt = $_REQUEST['coupon_used_dis_amt']; }\n else{ $coupon_used_dis_amt = 0; }\n\n if($_REQUEST['wallet_used_points'] > 0 ){ $wallet_used_points = $_REQUEST['wallet_used_points']; }\n else{ $wallet_used_points = 0; }\n\n\n if($razorpay_payment_id && $_REQUEST['payment_status'] == 1){\n $save_online_pay['customer_id'] = $customer_id;\n $save_online_pay['order_id'] = $order_id;\n $save_online_pay['razorpay_payment_id'] = $razorpay_payment_id;\n // $save_online_pay['razorpay_order_id'] = $razorpay_order_id;\n $save_online_pay['online_payment_amt'] = $online_payment_amt;\n $save_online_pay['cart_amount'] = $_REQUEST['order_total_amount'] - $_REQUEST['order_shipping_amt'];\n $save_online_pay['shipping_amt'] = $_REQUEST['order_shipping_amt'];\n $save_online_pay['total_pay_amt'] = $_REQUEST['order_total_amount'];\n $save_online_pay['coupon_use_amt'] = $coupon_used_dis_amt;\n $save_online_pay['point_use_amt'] = $wallet_used_points;\n $save_online_pay['online_payment_date'] = $current_date;\n $save_online_pay['online_payment_time'] = $current_time;\n $online_payment_id = $this->User_Model->save_data('order_online_payment', $save_online_pay);\n if($online_payment_id){\n $response[\"online_payment_msg\"] = 'Payment Data Saved Successfully';\n } else{\n $response[\"online_payment_msg\"] = 'Payment Data Not Saved';\n }\n $update_payment_type['payment_type'] = \"1\"; // Online Payment.\n $update_payment_type['payment_status'] = \"1\"; // Paid.\n } else{\n $update_payment_type['payment_type'] = \"2\"; // Cash On Delivery.\n $update_payment_type['payment_status'] = \"0\"; // Cash On Delivery.\n $response[\"online_payment_msg\"] = 'Payment on Delivery';\n }\n $this->User_Model->update_info('order_id', $order_id, 'order_tbl', $update_payment_type); // Update Status.\n\n\n\n /***************** Save Used Coupon ************/\n $save_coupon_data['order_id'] = $order_id;\n $save_coupon_data['customer_id'] = $customer_id;\n $save_coupon_data['coupon_id'] = $_REQUEST['coupon_id'];\n $save_coupon_data['coupon_code'] = $_REQUEST['coupon_code'];\n $save_coupon_data['coupon_used_dis_amt'] = $_REQUEST['coupon_used_dis_amt'];\n $save_coupon_data['coupon_used_date'] = $current_date;\n $save_coupon_data['coupon_used_time'] = $current_time;\n if($_REQUEST['coupon_id'] && $_REQUEST['coupon_code'] && $_REQUEST['coupon_used_dis_amt']){\n $coupon_used_id = $this->User_Model->save_data('coupon_used', $save_coupon_data);\n if($coupon_used_id){\n $response[\"coupon_code_msg\"] = 'Coupon Applied Successfully';\n } else{\n $response[\"coupon_code_msg\"] = 'Coupon Not Saved';\n }\n } else{\n $response[\"coupon_code_msg\"] = 'Coupon Not Used';\n }\n\n /******************** Save Redeem Point **************/\n $save_redeem_point_data['customer_id'] = $customer_id;\n $save_redeem_point_data['order_id'] = $order_id;\n $save_redeem_point_data['point_use_cnt'] = $_REQUEST['wallet_used_points'];\n $save_redeem_point_data['point_use_date'] = $current_date;\n $save_redeem_point_data['point_use_time'] = $current_time;\n if($_REQUEST['wallet_used_points']){\n $point_use_id = $this->User_Model->save_data('point_use', $save_redeem_point_data);\n if($point_use_id){\n $response[\"redeem_point_msg\"] = 'Points Used Successfully';\n } else{\n $response[\"redeem_point_msg\"] = 'Points Not Saved';\n }\n } else{\n $response[\"redeem_point_msg\"] = 'Redeem Point Not Used';\n }\n } else{\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = 'Order Not Saved';\n }\n\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "function ihc_set_level_trial_time_for_no_pay($l_id=-1, $u_id=0, $no_action_fired=FALSE){\n\n\tglobal $wpdb;\n\t$level_data = ihc_get_level_by_id($l_id);//getting details about current level\n\t$table = $wpdb->prefix . 'ihc_user_levels';\n\t$current_time = time();\n\t$q = $wpdb->prepare(\"SELECT expire_time FROM $table WHERE user_id=%d AND level_id=%d ;\", $u_id, $l_id);\n\t$data = $wpdb->get_row($q);\n\tif ($data && !empty($data->expire_time)){\n\t\t$expire_time = strtotime($data->expire_time);\n\t\tif ($expire_time>0){\n\t\t\t$current_time = $expire_time;\n\t\t\t$first_time = FALSE;\n\t\t} else {\n\t\t\t$first_time = TRUE;\n\t\t}\n\t}\n\tif (!empty($level_data['access_trial_type'])){\n\t\tif ($level_data['access_trial_type']==1){\n\t\t\t$multiply = ihc_get_multiply_time_value($level_data['access_trial_time_type']);\n\t\t\t$time_to_add = $level_data['access_trial_time_value'];\n\t\t} else {\n\t\t\t///couple of circles\n\t\t\t$multiply = ihc_get_multiply_time_value($level_data['access_regular_time_type']);\n\t\t\t$time_to_add = $level_data['access_regular_time_value'];\n\t\t}\n\n\t\t//if no Trial is set but 100% discount applied\n\t\tif(isset($multiply) && $multiply > 0 && isset($time_to_add) && $time_to_add > 0){\n\t\t\t$end_time = $current_time + $multiply * $time_to_add;\n\t\t}else{\n\t\t\t$multiply = ihc_get_multiply_time_value($level_data['access_regular_time_type']);\n\t\t\t$time_to_add = $level_data['access_regular_time_value'];\n\t\t}\n\n\t\t$end_time = $current_time + $multiply * $time_to_add;\n\n\t\t$update_time = date('Y-m-d H:i:s', time());\n\t\t$end_time = date('Y-m-d H:i:s', $end_time);\n\t\t$q = $wpdb->prepare(\"UPDATE $table SET update_time='$update_time', expire_time='$end_time', notification=0, status=1 WHERE user_id=%d AND level_id=%d \", $u_id, $l_id);\n\t\t$wpdb->query($q);\n\t\tif ($no_action_fired) return;\n\t\tdo_action('ihc_action_after_subscription_activated', $u_id, $l_id, $first_time);\n\t}\n}", "public function createExpressCheckoutOrder($tid){}", "public function pay_action ()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$order_id = $_GET['osc_order_id'];\n\n\t\t\t$payment = self::get_api()->payments->create(array(\n\t\t\t\t\"amount\" => $this->get_order_total($order_id),\n\t\t\t\t\"method\" => isset($_GET['method']) ? $_GET['method'] : NULL,\n\t\t\t\t\"description\" => MODULE_PAYMENT_MOLLIE_PAYMENT_DESCRIPTION . \" \" . $order_id,\n\t\t\t\t\"redirectUrl\" => $this->get_return_url($order_id),\n\t\t\t\t\"metadata\" => array(\"order_id\" => $order_id),\n\t\t\t\t\"webhookUrl\" => $this->get_webhook_url($order_id),\n\t\t\t\t\"issuer\" => !empty($_GET['issuer']) ? $_GET['issuer'] : NULL\n\t\t\t));\n\n\t\t\t$this->log($payment->id, $payment->status, $order_id);\n\n\t\t\theader(\"Location: \" . $payment->getPaymentUrl());\n\t\t}\n\t\tcatch (Mollie_API_Exception $e)\n\t\t{\n\t\t\techo \"API call failed: \" . htmlspecialchars($e->getMessage());\n\t\t}\n\t}", "public function add($order)\n {\n $order['time'] = time();\n $order['created_time'] = time();\n return $this->db->insert('orders', $order) == TRUE;\n }", "function pay_renew_order($original_order_id) {\n\n\t$wait_order_id = allocate_renew_order($original_order_id);\n\tif ($wait_order_id !== false) {\n\t\t$sql = \"UPDATE orders set status='renew_paid' WHERE order_id='$wait_order_id' and status='renew_wait' \";\n\t\tmysql_query($sql) or die(mysql_error());\n\t\t\n\t}\n\n\tif (mysql_affected_rows()>0) { \n\t\treturn true;\n\t\t# this order will now wait until the old one expires so it can be completed\n\t} else { \n\t\treturn false;\n\t}\n\n\n}", "function confirm_order($order_id, $money, $bank, $time)\n{\n\n // Edit here if order_id is not order_id in ATOMS server\n\n if (!isset($_COOKIE['attempt']))\n {\n setcookie(\"attempt\", 0, time()+1000 );\n $_COOKIE['attempt'] = 0;\n }\n if(isset($_COOKIE['attempt']) and $_COOKIE['attempt'] > 5)\n {\n echo \"maximun attempt reach.\";\n return false;\n }\n\n global $web_token;\n $response = file_get_contents(\"http://www.diyby.me/android-connect/confirm_order.php?token=\".$web_token.\"&order_id=\".$order_id.\"&money=\".$money.\"&bank=\".$bank.\"&time=\".$time);\n $response = json_decode($response, true);\n if($response['success'] == 0) // failed confirm\n {\n $_COOKIE['attempt'] = $_COOKIE['attempt'] + 1;\n return false;\n }\n else //confirm success\n {\n /*\n Edit here\n Update order status in your server to paid\n */\n return true;\n }\n}", "function process_orders($orders)\n{\n $display = '';\n\n $order_instance = new Order();\n $item_instance = new Item();\n $fulfillment_instance = new Fulfillment();\n\n\n $order_count = 0;\n\n foreach ($orders as $o) {\n $order_count++;\n /** ------------\n * PARSE ORDERS\n * ------------ */\n $order_shopify_id = $o['id'];\n log_error('order_shopify_id: ' . $order_shopify_id);\n\n $customer_email = trim($o['email']);\n $customer_phone = (!empty($o['shipping_address']['phone'])) ? trim(strval($o['shipping_address']['phone'])) : trim(strval($o['billing_address']['phone']));\n $order_tcreate = date(\"Y-m-d H:i:s\", strtotime($o['created_at']));\n $order_tmodified = !empty($o['updated_at'])?date(\"Y-m-d H:i:s\", strtotime($o['updated_at'])):null;\n $order_tclose = !empty($o['closed_at'])?date(\"Y-m-d H:i:s\", strtotime($o['closed_at'])):null;\n $order_is_closed = empty($o['closed_at']) ? true : false;\n $order_total_cost = $o['total_price'];\n $order_receipt_id = $o['name'];\n $order_currency = $o['currency'];\n $order_vendor = '';\n $order_alert_status = NOTIFICATION_STATUS_NONE;\n\n\n\n\n\n\n if (!empty($o['gateway'])) {\n if (stripos($o['gateway'], 'stripe') > -1) $order_gateway = GATEWAY_PROVIDER_STRIPE;\n elseif (stripos($o['gateway'], 'paypal') > -1 ) $order_gateway = GATEWAY_PROVIDER_PAYPAL;\n elseif (stripos($o['gateway'], 'shopify_payments') > -1 ) $order_gateway = GATEWAY_PROVIDER_PAYPAL;\n else $order_gateway = GATEWAY_PROVIDER_UNKNOWN;\n }\n\n $order_fulfillment_status = $o['fulfillment_status'];\n $order_is_dropified = (!empty($o['note']) && stripos($o['note'], 'dropified') > -1 );\n \n /**\n * Check if note has 'Aliexpress' or 'Dropified'.\n * \n * If has then: \n * - get events related to order\n * - check if Dropified created fulfillments\n * - return array of ids of fulfillments created by Dropified\n * \n * If not then:\n * - return empty array\n * \n * Added by Rafal - 2018-03-13\n */\n \n $dropified_fulfillmets_ids = (stripos($o['note'], 'dropified') > -1 || stripos($o['note'], 'aliexpress') > -1)?getDropifiedEvents(getOrderEvents($order_shopify_id)):array();\n \n /** --------------\n * PARSE CUSTOMER\n * -------------- */\n $order_customer_fn = $o['shipping_address']['first_name'];\n $order_customer_ln = $o['shipping_address']['last_name'];\n $order_customer_address1 = $o['shipping_address']['address1'];\n $order_customer_address2 = $o['shipping_address']['address2'];\n $order_customer_city = $o['shipping_address']['city'];\n $order_customer_zip = $o['shipping_address']['zip'];\n $order_customer_province = $o['shipping_address']['province'];\n $order_customer_country_code = $o['shipping_address']['country_code'];\n $order_customer_province_code = $o['shipping_address']['province_code'];\n $order_customer_phone = $o['shipping_address']['phone'];\n $order_tags = strtolower($o['tags']);\n\n /** -----------------------------------\n * CUSTOMER BILLING - ADDED 02-06-2018\n * ----------------------------------- */\n $order_customer_billing_fn = $o['billing_address']['first_name'];\n $order_customer_billing_ln = $o['billing_address']['last_name'];\n $order_customer_billing_address1 = $o['billing_address']['address1'];\n $order_customer_billing_address2 = $o['billing_address']['address2'];\n $order_customer_billing_city = $o['billing_address']['city'];\n $order_customer_billing_zip = $o['billing_address']['zip'];\n $order_customer_billing_province = $o['billing_address']['province'];\n $order_customer_billing_country_code = $o['billing_address']['country_code'];\n $order_customer_billing_province_code = $o['billing_address']['province_code'];\n $order_customer_billing_phone = $o['billing_address']['phone'];\n\n \n /** -------------------------------------\n * CANCELLED - ADDED BY RAFAL 2018-03-20\n * ------------------------------------- */\n $order_tcancel = !empty($o['cancelled_at'])?date(\"Y-m-d H:i:s\", strtotime($o['cancelled_at'])):'0000-00-00 00:00:00';\n\n\n $order_is_ocu = (stripos($order_tags,'ocu') > -1)?1:0;\n\n $_refund_status = trim($o['financial_status']);\n\n //print 'REFUND STATUS: ' . $_refund_status . PHP_EOL;\n\n switch(strtolower($_refund_status))\n {\n case 'partially_refunded':\n $order_refund_status = 2;\n //print 'REFUND!!: ' . $order_refund_status;\n break;\n case 'refunded':\n $order_refund_status = 1;\n //print 'REFUND!!: ' . $order_refund_status;\n break;\n default: case 'paid':\n $order_refund_status = 0;\n //print 'REFUND!!: ' . $order_refund_status;\n break;\n }\n \n /** --------------------------------------------\n * FINANCIAL STATUS - ADDED BY RAFAL 2018-03-20\n * -------------------------------------------- */\n \n $_financial_status = trim($o['financial_status']);\n \n switch(strtolower($_financial_status))\n {\n case 'pending':\n $order_financial_status = 1;\n break;\n case 'authorized':\n $order_financial_status = 2;\n break;\n case 'partially_paid':\n $order_financial_status = 3;\n break;\n case 'paid':\n $order_financial_status = 4;\n break;\n case 'partially_refunded':\n $order_financial_status = 5;\n break;\n case 'refunded':\n $order_financial_status = 6;\n break;\n case 'voided':\n $order_financial_status = 7;\n break;\n default: case '':\n $order_financial_status = 0;\n break;\n }\n \n $order_is_fulfilled = false; //has the fulfillment process started or not\n $order_is_delivered = false; //has the order been completed and delivered\n $order_is_tracking = false; //whether we should track the order\n\n $order_array = Array(\n 'order_customer_email' => $customer_email,\n 'order_customer_fn' => $order_customer_fn,\n 'order_customer_ln' => $order_customer_ln,\n 'order_customer_address1' => $order_customer_address1,\n 'order_customer_address2' => $order_customer_address2,\n 'order_customer_city' => $order_customer_city,\n 'order_customer_country' => $order_customer_country_code,\n 'order_customer_province' => $order_customer_province,\n\n /** -----------------------------------\n * CUSTOMER BILLING - ADDED 02-06-2018\n * ----------------------------------- */\n 'order_customer_billing_fn'=> $order_customer_billing_fn,\n 'order_customer_billing_ln'=> $order_customer_billing_ln,\n 'order_customer_billing_address1'=> $order_customer_billing_address1,\n 'order_customer_billing_address2'=> $order_customer_billing_address2,\n 'order_customer_billing_city'=> $order_customer_billing_city,\n 'order_customer_billing_zip'=> $order_customer_billing_zip,\n 'order_customer_billing_province'=> $order_customer_billing_province,\n 'order_customer_billing_country'=> $order_customer_billing_country_code,\n 'order_customer_billing_phone'=> $order_customer_billing_phone,\n\n 'order_currency' => $order_currency,\n 'order_tags' => $order_tags,\n 'order_is_ocu'=>$order_is_ocu,\n 'order_customer_zip' => $order_customer_zip,\n 'order_customer_phone' => $customer_phone,//$order_customer_phone,\n 'order_fulfillment_status' => $order_fulfillment_status,\n 'order_is_refunded' => $order_refund_status,\n 'order_shopify_id' => $order_shopify_id,\n 'order_gateway' => $order_gateway,\n 'order_receipt_id'=>$order_receipt_id,\n 'order_total_cost' => $order_total_cost,\n 'order_topen' => $order_tcreate,\n 'order_tclose' => $order_tclose,\n\n \n /** --------------------------------------------\n * FINANCIAL STATUS - ADDED BY RAFAL 2018-03-20\n * -------------------------------------------- */\n 'order_financial_status' => $order_financial_status,\n \n /** -------------------------------------\n * CANCELLED - ADDED BY RAFAL 2018-03-20\n * ------------------------------------- */\n 'order_tcancel' => $order_tcancel,\n\n );\n \n /** ----------------------------------------\n * _ORDER_ARRAY - ADDED BY RAFAL 2018-03-20\n * \n * This is added to update only order if \n * is cancel order status\n * --------------------------------------- */\n \n\n /** -----------------------------------\n * LOOKUP ORDERS BY SHOPIFY'S ORDER ID\n * ----------------------------------- */\n if (isset($order_object)) unset($order_object);\n $order_object = $order_instance->fetch_order_by_order_shopify_id($order_shopify_id);\n \n /** ------------------------------\n * IF IT DOESN'T EXIST, CREATE IT\n * ------------------------------ */\n if (!$order_object) {\n $order_object = new Order($order_array);\n $order_id = $order_object->save();\n } else {\n $order_id = $order_object->id;\n }\n\n\n /** --------------------------\n * PARSE REFUNDED LINE ITEMS\n * ------------------------- */\n\n\n\n if(!empty($o['refunds']))\n {\n $refund_list = Array();\n $refund_check = Array();\n foreach($o['refunds'] as $refund)\n {\n $refund_date =date(\"Y-m-d H:i:s\", strtotime($refund['created_at']));\n foreach($refund['refund_line_items'] as $item)\n {\n $refund_list[$item['line_item_id']]=$refund_date;\n $refund_check[] = $item['line_item_id'];\n }\n }\n //print 'refund! ' . print_r($refund_list,true);\n //print 'refund! ' . print_r($refund_check,true);\n }\n\n\n\n\n /** ----------------\n * PARSE LINE ITEMS\n * ---------------- */\n\n foreach ($o['line_items'] as $p) {\n $_fulfillment_status = $p['fulfillment_status'];\n switch(strtolower($_fulfillment_status))\n {\n case 'fulfilled': $item_fulfillment_status = 1;break;\n case 'partial': $item_fulfillment_status = 2; break;\n default: case null: $item_fulfillment_status = 0;break;\n }\n $item_shopify_id = $p['id'];\n $item_shopify_product_id = $p['product_id'];\n $item_shopify_variant_id = $p['variant_id'];\n $item_name = $p['name'];\n $item_quantity = $p['quantity'];\n $item_sku = $p['sku'];\n $item_price = $p['price'];\n $item_is_refunded = 0;\n //$item_refund_tcreate = null;\n if(!empty($o['refunds'])) {\n if (in_array(trim($item_shopify_id), $refund_check)) {\n $item_is_refunded = 1;\n $item_refund_tcreate = $refund_list[$item_shopify_id];\n //print 'FOUND REFUND!';\n }\n }\n\n $item_array = Array(\n 'order_id' => $order_id,\n 'order_shopify_id' => $order_shopify_id,\n 'item_shopify_id' => $item_shopify_id,\n 'item_quantity' => $item_quantity,\n 'item_sku' => $item_sku,\n 'item_price'=>floatval($item_price),\n 'item_shopify_product_id' => $item_shopify_product_id,\n 'item_shopify_variant_id' => $item_shopify_variant_id,\n 'item_name' => $item_name,\n 'item_is_refunded' => $item_is_refunded,\n 'item_is_fulfilled'=>$item_fulfillment_status\n );\n\n if(isset($item_refund_tcreate)) $item_array['item_refund_tcreate']=$item_refund_tcreate;\n\n /** -------------------------\n * STORE / UPDATE LINE ITEMS\n * ------------------------- */\n if (isset($item_object)) unset($item_object);\n\n $item_object = $item_instance->fetch_item_by_shopify_item_id($item_shopify_id);\n if (!$item_object) {\n $item_object = new Item($item_array);\n $item_id = $item_object->save();\n } else {\n $item_id = $item_object->id;\n $item_object->save($item_array);\n }\n $order_object->order_items[] = $item_object;\n\n }\n\n\n /** ------------\n * FULFILLMENTS\n * ------------ */\n if (!empty($o['fulfillments'])) {\n foreach ($o['fulfillments'] as $fulfillment) {\n \n \n /**\n * Added by Rafal 2018-04-12\n * \n * Prevent added cancelled, error or failure\n * fulfillments\n */\n if($fulfillment['status'] == 'cancelled' || $fulfillment['status'] == 'error' || $fulfillment['status'] == 'failure'){\n continue;\n }\n \n \n $fulfillment_shopify_id = $fulfillment['id'];\n $fulfillment_shipment_status = strtolower(trim($fulfillment['shipment_status']));\n $fulfillment_topen = date(\"Y-m-d H:i:s\", strtotime($fulfillment['created_at']));\n //$fulfillment_tmodified = date(\"Y-m-d H:i:s\", strtotime($fulfillment['updated_at']));\n \n $fulfillment_tracking_company = strtolower($fulfillment['tracking_company']);\n \n $fulfillment_tracking_number = $fulfillment['tracking_number'];\n $fulfillment_tracking_url = $fulfillment['tracking_url'];\n\n $order_is_fulfilled = true;\n\n\n $fulfillment_array = Array(\n 'order_id' => $order_id,\n 'order_shopify_id' => $order_shopify_id,\n 'fulfillment_shipment_status' => trim(strtolower($fulfillment_shipment_status)),\n 'fulfillment_topen'=>$fulfillment_topen,\n 'fulfillment_shopify_id' => $fulfillment_shopify_id,\n 'fulfillment_tracking_number' => $fulfillment_tracking_number,\n 'fulfillment_tracking_company' => $fulfillment_tracking_company,\n 'fulfillment_tracking_url' => $fulfillment_tracking_url,\n 'order_is_fulfilled' => $order_is_fulfilled,\n );\n \n if ($fulfillment_tracking_company !== 'usps') $is_tracking = true;\n else $is_tracking = false;\n\n $order_delivery_status = false;\n\n //Normally USPS is the only courier that updates this appropriately. If its delivered set status\n switch ($fulfillment_shipment_status) {\n case 'delivered':\n $order_delivery_status = DELIVERY_STATUS_DELIVERED;\n $order_is_delivered = true;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_delivered_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 0;\n break;\n\n case 'confirmed':\n $order_delivery_status = DELIVERY_STATUS_CONFIRMED;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_confirmed_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n break;\n\n case 'in_transit':\n $order_delivery_status = DELIVERY_STATUS_IN_TRANSIT;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_in_transit_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n break;\n\n case 'out_for_delivery':\n $order_delivery_status = DELIVERY_STATUS_OUT_FOR_DELIVERY;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_out_for_delivery_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n break;\n\n case 'failure':\n $order_delivery_status = DELIVERY_STATUS_FAILURE;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_failure_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 0;\n $order_array['order_alert_status'] = DELIVERY_STATUS_FAILURE;\n $fulfillment_array['fulfillment_alert_status'] = DELIVERY_STATUS_FAILURE;\n break;\n\n default:\n $order_delivery_status = DELIVERY_STATUS_UNKNOWN;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n\n break;\n }\n/*\n if ($order_delivery_status)\n $order_array['delivery_status'] = $order_delivery_status;*/\n \n \n /**\n * 'status_delivered_tcreate'=>'',\n * 'status_confirmed_tcreate'=>'',\n * 'status_in_transit_tcreate'=>'',\n * 'status_out_for_delivery_tcreate'=>'',\n * 'status_failure_tcreate'=>'',\n * 'status_not_found_tcreate'=>'',\n * 'status_customer_pickup_tcreate'=>'',\n * 'status_alert_tcreate'=>'',\n * 'status_expired_tcreate'=>'',\n */\n /** -----------------------------------\n * CREATE AND STORE FULFILLMENT OBJECT\n * ----------------------------------- */\n \n //Lets see if the order exists\n if (isset($fulfillment_object)) unset($fulfillment_object);\n\n $fulfillment_object = $fulfillment_instance->fetch_fulfillment_by_shopify_fulfillment_id($fulfillment_shopify_id);\n\n\n if (!$fulfillment_object) {\n $fulfillment_array['fulfillment_tracking_number_tcreate'] = current_timestamp();\n $fulfillment_object = new Fulfillment($fulfillment_array);\n $fulfillment_object->save();\n\n } else {\n\n if($fulfillment_object->tracking_number == \"\" || $fulfillment_object->tracking_number == null)\n $fulfillment_array['fulfillment_tracking_number_tcreate'] = current_timestamp();\n\n $fulfillment_object->save($fulfillment_array);\n }\n \n $order_object->order_fulfillments[] = $fulfillment_object;\n \n \n /** Added by Rafal - 2018-03-13 */\n if(sizeof($dropified_fulfillmets_ids) > 0 && in_array($fulfillment_shopify_id,$dropified_fulfillmets_ids) === true){\n $dropified_array = Array(\n 'tracking_number' => $fulfillment_tracking_number,\n 'fulfillment_shopify_id' => $fulfillment_shopify_id,\n 'order_id' => $order_id,\n 'vendor_id' => VENDOR_DROPIFIED,\n 'order_receipt_id'=>$order_receipt_id,\n 'tracking_tcreate' => current_timestamp(),\n 'tracking_tmodified'=>current_timestamp()\n );\n set_dropified_tracking($dropified_array);\n }\n }\n\n /** -----------------------\n * UPDATE THE ORDER OBJECT\n * ----------------------- */\n $order_object->save($order_array);\n } else {\n /** -------------------------------------\n * ADDED BY RAFAL 2018-03-20\n * \n * This allow to update cancell date and\n * financial status if it is different\n * than in table\n * ------------------------------------- */\n $cancel_array = Array();\n \n if(isset($order_object -> financial_status) && $order_object -> financial_status != $order_financial_status){\n $cancel_array['order_financial_status'] = $order_financial_status;\n }\n \n if(isset($order_object -> tcancel) && $order_object -> tcancel != $order_financial_status){\n $cancel_array['order_tcancel'] = $order_tcancel;\n }\n \n if (sizeof($cancel_array) > 0) {\n \n $db_conditions = Array('order_id' => $order_id);\n \n if (isset($db_instance)) unset($db_instance); \n $db_instance = new Database;\n $db_instance -> db_update('orders',$cancel_array,$db_conditions,$isOr=false);\n }\n }\n\n if ($order_count >= ORDER_COUNT_LIMIT_MANUAL && ORDER_COUNT_LIMIT_MANUAL != 0) exit('ORIGINAL DATA: ' . PHP_EOL . print_r($order_count, true));\n\n }\n log_error('total orders: ' . $order_count);\n\n\n}", "public static function clientNewOrderNotice(Order $order)\n {\n //For the purpose of our new clients, We also send them an email on order delivery\n //We wil design a new email template for clients\n\n $client = User::findorfail($order->client_ID);\n if ($client->domain == 1) {\n $domain = \"writemyclassessay.com\";\n }elseif ($client->domain == 2) {\n $domain = \"writemyacademicessay.com\";\n }elseif ($client->domain == 3) {\n $domain = \"writemyschoolessay.com\";\n }\n Mail::send('emails.newOrderClient',['client'=>$client, 'order'=>$order,'domain'=>$domain], function($m)use ($client, $order, $domain)\n {\n $m->from('support@'.$domain, 'Academic Paper writing Platform');\n\n $m->to($client->email, $client->first_name)->subject('Congratulations! Your project is now visible to our writers.');\n\n });\n }", "function allocate_renew_order($original_order_id) {\n\t# if no waiting renew order, insert a new one\n\t$now = (gmdate(\"Y-m-d H:i:s\"));\n\t\n\tif (is_renew_order_paid($original_order_id)) { // cannot allocate a renew_wait, this order was already paid and waiting to be completed.\n\t\treturn false;\n\t}\n\t// are there any \n\t// renew_wait orders?\n\t$sql = \"SELECT * FROM orders WHERE original_order_id='$original_order_id' and status='renew_wait' \";\n\t$result = mysql_query ($sql) or die(mysql_error());\n\tif (($row = mysql_fetch_array($result))==false) {\n\t\t// copy the original order to create a new renew_wait order\n\t\t$sql = \"SELECT * FROM orders WHERE order_id='$original_order_id' \";\n\t\t$result = mysql_query ($sql) or die(mysql_error()); \n\t\t$row = mysql_fetch_array($result);\n\n\t\t$sql = \"INSERT INTO orders (user_id, order_id, blocks, status, order_date, price, quantity, banner_id, currency, days_expire, date_stamp, approved, original_order_id) VALUES ('\".$row['user_id'].\"', '', '\".$row['blocks'].\"', 'renew_wait', NOW(), '\".$row['price'].\"', '\".$row['quantity'].\"', '\".$row['banner_id'].\"', '\".$row['currency'].\"', \".$row['days_expire'].\", '$now', '\".$row['approved'].\"', '\".$original_order_id.\"') \";\n\n\t\t$result = mysql_query ($sql) or die(mysql_error());\n\t\t$order_id = mysql_insert_id();\n\t\treturn $order_id;\n\n\t} else {\n\t\treturn $row['order_id'];\n\n\t}\n\n\n\n}", "public function saveTemporaryOrder()\r\n {\r\n $order = Shopware()->Modules()->Order();\r\n\r\n $order->sUserData = $this->View()->sUserData;\r\n $order->sComment = isset($this->session['sComment']) ? $this->session['sComment'] : '';\r\n $order->sBasketData = $this->View()->sBasket;\r\n $order->sAmount = $this->View()->sBasket['sAmount'];\r\n $order->sAmountWithTax = !empty($this->View()->sBasket['AmountWithTaxNumeric']) ? $this->View()->sBasket['AmountWithTaxNumeric'] : $this->View()->sBasket['AmountNumeric'];\r\n $order->sAmountNet = $this->View()->sBasket['AmountNetNumeric'];\r\n $order->sShippingcosts = $this->View()->sBasket['sShippingcosts'];\r\n $order->sShippingcostsNumeric = $this->View()->sBasket['sShippingcostsWithTax'];\r\n $order->sShippingcostsNumericNet = $this->View()->sBasket['sShippingcostsNet'];\r\n $order->bookingId = Shopware()->System()->_POST['sBooking'];\r\n $order->dispatchId = $this->session['sDispatch'];\r\n $order->sNet = $this->View()->sUserData['additional']['show_net'];\r\n\r\n $order->sDeleteTemporaryOrder();\t// Delete previous temporary orders\r\n $order->sCreateTemporaryOrder();\t// Create new temporary order\r\n }", "public function order_create()\n {\n $this->_checkPartner();\n \n $mod_c = $this->_getConfig();\n if(isset($mod_c['orders_limit']) && $mod_c['orders_limit']) {\n $sql = \"SELECT COUNT(id) FROM client_order WHERE client_id = :cid AND DATE_FORMAT(created_at, '%Y-%m-%d') = :date GROUP BY client_id\";\n $count = R::getCell($sql, array('cid'=>$this->client->id, ':date'=>date('Y-m-d')));\n if($count >= $mod_c['orders_limit']) {\n throw new Box_Exception('Daily orders limit reached. Order today :today out of :limit', array(':today'=>$count, ':limit'=>$mod_c['orders_limit']), 8804);\n }\n }\n \n $partner = $this->service->getPartner($this->client);\n $price = $this->service->getPartnerPrice($this->client);\n \n if(isset($mod_c['check_balance']) && $mod_c['check_balance']) {\n $client = $this->getApiAdmin()->client_get(array('id'=>$this->client->id));\n if($client['balance'] < $price) {\n throw new Box_Exception('Not enough money in balance to create order. You must have at least $:price in your balance', array(':price'=>$price), 8808);\n }\n }\n \n if(!isset($mod_c['lid'])) {\n throw new Box_Exception('Partners program is temporary disabled.',null, 8806);\n }\n \n if($partner->product_id) {\n $product_id = $partner->product_id;\n } else {\n $product_id = $mod_c['lid'];\n }\n \n $odata = array(\n 'client_id' => $this->client->id,\n 'product_id' => $product_id,\n 'price' => $price,\n 'quantity' => 1,\n 'period' => '1M',\n 'activate' => true,\n 'invoice_option' => 'no-invoice',\n 'config' => array(\n 'partner_id' => $this->client->id,\n ),\n );\n \n $order_id = $this->getApiAdmin()->order_create($odata);\n \n $odata = array(\n 'id' => $order_id,\n 'invoice_option'=> 'issue-invoice',\n 'expires_at' => date('Y-m-d', strtotime('+14 days')),\n );\n $this->getApiAdmin()->order_update($odata);\n \n $this->service->addOrderForPartner($this->client, $order_id);\n \n $this->getApiAdmin()->hook_call(array('event'=>'onAfterPartnerOrderCreate', 'params'=>array('client_id'=>$this->client->id, 'order_id'=>$order_id)));\n \n $this->_log('Partner created new order #%s', $order_id);\n return $order_id;\n }", "function add_order($money, $status, $invoice_url = '')\n{\n\n global $web_token;\n $response = file_get_contents(\"https://www.diyby.me/android-connect/receive-update.php?token=\".$web_token.\"&order_id=0&status=\".$status.\"&invoice_url=\".$invoice_url.\"&money=\".$money);\n echo $response;\n if(is_numeric($response))\n {\n $order_id = $response;\n /* Store return order_id from ATOMs server to your database\n *\n * Edit here\n */\n }\n}", "public function newAction() {\n $this->setSession();\n $this->setOrder();\n $this->forceNewOrderStatus();\n $this->setPayment(true);\n $this->setTryNumber();\n if (!$this->_order->getEmailSent() == 1) {\n $this->_order->sendNewOrderEmail();\n }\n $this->_renderRedirectPage();\n }", "private function PayForOrder()\n\t{\n\t\t// If guest checkout is not enabled and the customer isn't signed in then send the customer\n\t\t// back to the beginning of the checkout process.\n\t\tif(!GetConfig('GuestCheckoutEnabled') && !CustomerIsSignedIn() && !isset($_SESSION['CHECKOUT']['CREATE_ACCOUNT'])) {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".GetConfig('ShopPath').'/checkout.php');\n\t\t\texit;\n\t\t}\n\n\t\tif (GetConfig('EnableOrderTermsAndConditions')==1 && !isset($_POST['AgreeTermsAndConditions'])) {\n\t\t\t@ob_end_clean();\n\t\t\t$_SESSION['REDIRECT_TO_CONFIRMATION_MSG'] = GetLang('TickArgeeTermsAndConditions');\n\t\t\theader(\"Location: \".$GLOBALS['ShopPath'].\"/checkout.php?action=confirm_order\");\n\t\t\texit;\n\t\t}\n\n\t\t// ensure products are in stock\n\t\t$this->CheckStockLevels();\n\n\t\t// Customer actually chose to apply a gift certificate or coupon code to this order so\n\t\t// we actually show the confirm order page again which does all of the magic.\n\t\tif (isset($_REQUEST['apply_code'])) {\n\t\t\t$this->ConfirmOrder();\n\t\t\treturn;\n\t\t}\n\n\t\t// Attempt to create the pending order with the selected details\n\t\t$pendingResult = $this->SavePendingOrder();\n\n\t\t// There was a problem creating the pending order\n\t\tif(!is_array($pendingResult)) {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".$GLOBALS['ShopPath'].\"/checkout.php?action=confirm_order\");\n\t\t\texit;\n\t\t}\n\n\t\t// There was a problem creating the pending order but we have an actual error message\n\t\tif(isset($pendingResult['error'])) {\n\t\t\tif(isset($pendingResult['errorDetails'])) {\n\t\t\t\t$this->BadOrder('', $pendingResult['error'], $pendingResult['errorDetails']);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->BadOrder('', $pendingResult['error']);\n\t\t\t}\n\t\t}\n\n\t\t// We've been told all we need to do is redirect to the finish order page, so do that\n\t\tif(isset($pendingResult['redirectToFinishOrder']) && $pendingResult['redirectToFinishOrder']) {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".$GLOBALS['ShopPath'].\"/finishorder.php\");\n\t\t\tdie();\n\t\t}\n\n\t\t// Otherwise, the gateway want's to do something\n\t\tif(!empty($pendingResult['provider']) && ($pendingResult['provider']->GetPaymentType() == PAYMENT_PROVIDER_ONLINE || method_exists($pendingResult['provider'], \"ShowPaymentForm\"))) {\n\t\t\t// ProviderListHTML is stored in the session when the provider requires that it can only be the only payment provider during checkout, disable the other checkout method.\n\t\t\tif(isset($_SESSION['CHECKOUT']['ProviderListHTML']) && method_exists($pendingResult['provider'], 'DoExpressCheckoutPayment')) {\n\t\t\t\t$pendingResult['provider']->DoExpressCheckoutPayment();\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t\t// If we have a payment form to show then show that\n\t\t\tif(isset($pendingResult['showPaymentForm']) && $pendingResult['showPaymentForm']) {\n\t\t\t\t$this->ShowPaymentForm($pendingResult['provider']);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$pendingResult['provider']->TransferToProvider();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// It's an offline payment method, no need to accept payment now\n\t\t\tif(!empty($pendingResult['provider']))\n\t\t\t\t$providerId = $pendingResult['provider']->GetId();\n\t\t\telse\n\t\t\t\t$providerId = '';\n\n\t\t\t@ob_end_clean();\n\t\t\theader(sprintf(\"Location:%s/finishorder.php?provider=%s\", $GLOBALS['ShopPath'], $providerId));\n\t\t\tdie();\n\t\t}\n\t}", "public function addNewClient() {\n\t\t$this->Db->query(\"INSERT INTO `yp_sessions` (`hash`, `last_time`) \n\t\t\tVALUES ('{$this->_thisClientHash()}', '{$this->Request->time}');\");\n\n\t\t\n\t}", "function push_orders($login, $item_id, $quantity)\n{\n $servername = \"localhost\";\n $username = \"root\";\n $password = \"BloodyPastor\";\n $db = \"shop_db\";\n\n $conn = mysqli_connect($servername, $username, $password, $db);\n // Check connection\n if (!$conn) {\n die(\"Connection failed: \" . mysqli_connect_error());\n }\n $sql = \"INSERT INTO shop_db.orders (login, item_id, quantity, reg_date)\n VALUES ('$login', '$item_id','$quantity', '\".time().\"')\";\n mysqli_query($conn, $sql);\n mysqli_close($conn);\n}", "function before_process() {\r\n global $response, $db, $order, $messageStack;\r\n\r\n $order->info['cc_owner'] = zen_db_prepare_input($_POST['bank_acct_name']);\r\n $order->info['cc_type'] = 'eCheck';\r\n $order->info['cc_number'] = zen_db_prepare_input($_POST['bank_aba_code'] . '-' . str_pad(substr($_POST['bank_acct_num'], -4), strlen($_POST['bank_acct_num']), \"X\", STR_PAD_LEFT));\r\n $sessID = zen_session_id();\r\n\r\n // DATA PREPARATION SECTION\r\n unset($submit_data); // Cleans out any previous data stored in the variable\r\n\r\n // Create a string that contains a listing of products ordered for the description field\r\n $description = '';\r\n for ($i=0; $i<sizeof($order->products); $i++) {\r\n $description .= $order->products[$i]['name'] . ' (qty: ' . $order->products[$i]['qty'] . ') + ';\r\n }\r\n // Remove the last \"\\n\" from the string\r\n $description = substr($description, 0, -2);\r\n\r\n // Create a variable that holds the order time\r\n $order_time = date(\"F j, Y, g:i a\");\r\n\r\n // Calculate the next expected order id\r\n $last_order_id = $db->Execute(\"select * from \" . TABLE_ORDERS . \" order by orders_id desc limit 1\");\r\n $new_order_id = $last_order_id->fields['orders_id'];\r\n $new_order_id = ($new_order_id + 1);\r\n $new_order_id = (string)$new_order_id . '-' . zen_create_random_value(6);\r\n\r\n // Populate an array that contains all of the data to be sent to Authorize.net\r\n $submit_data = array(\r\n 'x_login' => trim(MODULE_PAYMENT_AUTHORIZENET_ECHECK_LOGIN),\r\n 'x_tran_key' => trim(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TXNKEY), \r\n 'x_relay_response' => 'FALSE', // AIM uses direct response, not relay response\r\n 'x_delim_data' => 'TRUE',\r\n 'x_delim_char' => $this->delimiter, // The default delimiter is a comma\r\n 'x_encap_char' => $this->encapChar, // The divider to encapsulate response fields\r\n 'x_version' => '3.1', // 3.1 is required to use CVV codes\r\n 'x_type' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_AUTHORIZATION_TYPE == 'Authorize' ? 'AUTH_ONLY': 'AUTH_CAPTURE',\r\n 'x_amount' => number_format($order->info['total'], 2),\r\n 'x_currency_code' => $order->info['currency'],\r\n 'x_method' => 'ECHECK',\r\n 'x_bank_aba_code' => $_POST['bank_aba_code'],\r\n 'x_bank_acct_num' => $_POST['bank_acct_num'],\r\n 'x_bank_acct_type' => $_POST['bank_acct_type'],\r\n 'x_bank_name' => $_POST['bank_name'],\r\n 'x_bank_acct_name' => $_POST['bank_acct_name'],\r\n 'x_echeck_type' => 'WEB',\r\n 'x_recurring_billing' => 'NO',\r\n 'x_email_customer' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_CUSTOMER == 'True' ? 'TRUE': 'FALSE',\r\n 'x_email_merchant' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_MERCHANT == 'True' ? 'TRUE': 'FALSE',\r\n 'x_cust_id' => $_SESSION['customer_id'],\r\n 'x_invoice_num' => (MODULE_PAYMENT_AUTHORIZENET_ECHECK_TESTMODE == 'Test' ? 'TEST-' : '') . $new_order_id,\r\n 'x_first_name' => $order->billing['firstname'],\r\n 'x_last_name' => $order->billing['lastname'],\r\n 'x_company' => $order->billing['company'],\r\n 'x_address' => $order->billing['street_address'],\r\n 'x_city' => $order->billing['city'],\r\n 'x_state' => $order->billing['state'],\r\n 'x_zip' => $order->billing['postcode'],\r\n 'x_country' => $order->billing['country']['title'],\r\n 'x_phone' => $order->customer['telephone'],\r\n 'x_email' => $order->customer['email_address'],\r\n 'x_ship_to_first_name' => $order->delivery['firstname'],\r\n 'x_ship_to_last_name' => $order->delivery['lastname'],\r\n 'x_ship_to_address' => $order->delivery['street_address'],\r\n 'x_ship_to_city' => $order->delivery['city'],\r\n 'x_ship_to_state' => $order->delivery['state'],\r\n 'x_ship_to_zip' => $order->delivery['postcode'],\r\n 'x_ship_to_country' => $order->delivery['country']['title'],\r\n 'x_description' => $description,\r\n 'x_customer_ip' => zen_get_ip_address(),\r\n 'x_po_num' => date('M-d-Y h:i:s'), //$order->info['po_number'],\r\n 'x_freight' => number_format((float)$order->info['shipping_cost'],2),\r\n 'x_tax_exempt' => 'FALSE', /* 'TRUE' or 'FALSE' */\r\n 'x_tax' => number_format((float)$order->info['tax'],2),\r\n 'x_duty' => '0',\r\n\r\n // Additional Merchant-defined variables go here\r\n 'Date' => $order_time,\r\n 'IP' => zen_get_ip_address(),\r\n 'Session' => $sessID );\r\n // process Wells-Fargo-SecureSource-specific parameters\r\n if (MODULE_PAYMENT_AUTHORIZENET_ECHECK_WFSS_ENABLED == 'True') {\r\n $submit_data['x_customer_organization_type'] = zen_db_prepare_input($_POST['echeck_customer_type']);\r\n if (zen_db_prepare_input($_POST['echeck_customer_tax_id']) != '') {\r\n $submit_data['x_customer_tax_id'] = zen_db_prepare_input($_POST['echeck_customer_tax_id']);\r\n } else {\r\n $submit_data = array_merge($submit_data, \r\n array('x_drivers_license_num' => zen_db_prepare_input($_POST['echeck_dl_num']),\r\n 'x_drivers_license_state' => zen_db_prepare_input($_POST['echeck_dl_state']),\r\n 'x_drivers_license_dob' => zen_db_prepare_input($_POST['echeck_dl_dob']) ));\r\n }\r\n }\r\n unset($response);\r\n $response = $this->_sendRequest($submit_data);\r\n $response_code = $response[0];\r\n $response_text = $response[3];\r\n $this->auth_code = $response[4];\r\n $this->transaction_id = $response[6];\r\n $response_msg_to_customer = $response_text . ($this->commError == '' ? '' : ' Communications Error - Please notify webmaster.');\r\n\r\n $response['Expected-MD5-Hash'] = $this->calc_md5_response($response[6], $response[9]);\r\n $response['HashMatchStatus'] = ($response[37] == $response['Expected-MD5-Hash']) ? 'PASS' : 'FAIL';\r\n\r\n $this->_debugActions($response, $order_time, $sessID);\r\n\r\n // If the MD5 hash doesn't match, then this transaction's authenticity cannot be verified.\r\n // Thus, order will be placed in Pending status\r\n if ($response['HashMatchStatus'] != 'PASS') {\r\n $this->order_status = 1;\r\n $messageStack->add_session('header', MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_AUTHENTICITY_WARNING, 'caution');\r\n }\r\n\r\n // If the response code is not 1 (approved) then redirect back to the payment page with the appropriate error message\r\n if ($response_code != '1') {\r\n $messageStack->add_session('checkout_payment', $response_msg_to_customer . ' - ' . MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_DECLINED_MESSAGE, 'error');\r\n zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));\r\n }\r\n }", "public function addOrder(Order $order);", "public function setupPayment($order){\r\n $response = array(\r\n 'success'=> false,\r\n 'msg'=> __('Payment failed!', ET_DOMAIN)\r\n );\r\n // write session\r\n et_write_session('order_id', $order->ID);\r\n et_write_session('processType', 'buy');\r\n $arg = apply_filters('ae_payment_links', array(\r\n 'return' => et_get_page_link('process-payment') ,\r\n 'cancel' => et_get_page_link('process-payment')\r\n ));\r\n /**\r\n * process payment\r\n */\r\n $paymentType_raw = $order->payment_type;\r\n $paymentType = strtoupper($order->payment_type);\r\n /**\r\n * factory create payment visitor\r\n */\r\n $order_data = array(\r\n 'payer' => $order->post_author,\r\n 'total' => '',\r\n 'status' => 'draft',\r\n 'payment' => $paymentType,\r\n 'paid_date' => '',\r\n 'post_parent' => $order->post_parent,\r\n 'ID'=> $order->ID,\r\n 'amount'=> $order->amount\r\n );\r\n $order_temp = new mJobOrder($order_data);\r\n $order_temp->add_product($order);\r\n $order = $order_temp;\r\n $visitor = AE_Payment_Factory::createPaymentVisitor($paymentType, $order, $paymentType_raw);\r\n // setup visitor setting\r\n $visitor->set_settings($arg);\r\n // accept visitor process payment\r\n $nvp = $order->accept($visitor);\r\n if ($nvp['ACK']) {\r\n $response = array(\r\n 'success' => $nvp['ACK'],\r\n 'data' => $nvp,\r\n 'paymentType' => $paymentType\r\n );\r\n } else {\r\n $response = array(\r\n 'success' => false,\r\n 'paymentType' => $paymentType,\r\n 'msg' => __(\"Invalid payment gateway!\", ET_DOMAIN)\r\n );\r\n }\r\n /**\r\n * filter $response send to client after process payment\r\n *\r\n * @param Array $response\r\n * @param String $paymentType The payment gateway user select\r\n * @param Array $order The order data\r\n *\r\n * @package AE Payment\r\n * @category payment\r\n *\r\n * @since 1.0\r\n * @author Dakachi\r\n */\r\n $response = apply_filters('mjob_setup_payment', $response, $paymentType, $order);\r\n return $response;\r\n }", "function CreateNewOrder($dom_response_obj)\n{\n global $insert_id, $customer_id, $cart, $sendto, $billto, $payment, $shipping, $order, $cc_id, $shipping_to_class, $languages_id, $currencies;\n $payment = 'googlecheckout';\n // Init all data\n $dom_data_root = $dom_response_obj->document_element();\n $gift_adjustment = $dom_data_root->get_elements_by_tagname(\"gift-certificate-adjustment\");\n $coupon_adjustment = $dom_data_root->get_elements_by_tagname(\"coupon-adjustment\");\n if ( count($coupon_adjustment)==0 ) $coupon_adjustment = $gift_adjustment;\n // coupons type \"free shipping\" pass as gift-certificate - GC feature - coupons apply before shipping & tax, gift - after\n // 2007.03.26 - coupons have type gift-certificate in any case. Module not allow enter gv used only coupons\n if ( count($coupon_adjustment)>0 ) {\n $code_node = $coupon_adjustment[0]->get_elements_by_tagname(\"code\");\n $coupon_code = $code_node[0]->get_content();\n $coupon_query=tep_db_query(\"select coupon_id from \" . TABLE_COUPONS . \" where coupon_type<>'G' AND coupon_code='\".tep_db_input($coupon_code).\"' and coupon_active='Y'\");\n if ( tep_db_num_rows($coupon_query) ) {\n $coupon_result=tep_db_fetch_array($coupon_query);\n if (!tep_session_is_registered('cc_id')) tep_session_register('cc_id');\n $cc_id = $coupon_result['coupon_id'];\n }\n }\n //\n $shipping_data = $dom_data_root->get_elements_by_tagname(\"shipping-name\");\n $xml_shipping = $shipping['title'] = $shipping_data[0]->get_content();\n $shipping_data = $dom_data_root->get_elements_by_tagname(\"shipping-cost\");\n $shipping['cost'] = $shipping_data[0]->get_content();\n $totaltax_data = $dom_data_root->get_elements_by_tagname(\"total-tax\");\n $xml_tax = $totaltax_data[0]->get_content();\n/*\n$shipping['title'] $shipping['cost'] for correct new order creation\n*/\n\n // get customers data and check them\n $ship = array();\n $customer_data = $dom_data_root->get_elements_by_tagname(\"buyer-shipping-address\");\n $shipping_root = $customer_data[0];\n\n $data = $customer_data[0]->get_elements_by_tagname(\"email\");\n $ship['email'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"address1\");\n $ship['address1'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"address2\");\n $ship['address2'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"company-name\");\n $ship['company-name'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"contact-name\");\n $ship['contact-name'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"phone\");\n $ship['phone'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"fax\");\n $ship['fax'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"country-code\");\n $ship['country-code'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"city\");\n $ship['city'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"region\");\n $ship['region'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"postal-code\");\n $ship['postal-code'] = $data[0]->get_content();\n $billing = array();\n unset($customer_data);\n $customer_data = $dom_data_root->get_elements_by_tagname(\"buyer-billing-address\");\n $billing_root = $customer_data[0];\n\n $data = $customer_data[0]->get_elements_by_tagname(\"email\");\n $billing['email'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"address1\");\n $billing['address1'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"address2\");\n $billing['address2'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"company-name\");\n $billing['company-name'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"contact-name\");\n $billing['contact-name'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"phone\");\n $billing['phone'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"fax\");\n $billing['fax'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"country-code\");\n $billing['country-code'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"city\");\n $billing['city'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"region\");\n $billing['region'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"postal-code\");\n $billing['postal-code'] = $data[0]->get_content();\n // check customer\nif (defined('GOOGLE_FORCE_TO_USA')) {\n $ship['country-code'] = 'GB';\n $billing['country-code'] = 'GB';\n}\n $check = tep_db_query(\"select customers_id from \" . TABLE_CUSTOMERS . \" where customers_email_address='\" . $ship['email'] . \"' or customers_email_address='\" . $billing['email'] . \"'\");\n list($firstname_ship, $lastname_ship) = split(' ', $ship['contact-name'], 2);\n // get country id and state id for shipping\n $country = tep_db_fetch_array(tep_db_query(\"select countries_id from \" . TABLE_COUNTRIES . \" where countries_iso_code_2='\" . $ship['country-code'] . \"'\"));\n $state = tep_db_fetch_array(tep_db_query(\"select zone_id from \" . TABLE_ZONES . \" where zone_country_id='\" . $country['countries_id'] . \"' and zone_code='\" . $ship['region'] . \"'\"));\n $ship['countries_id'] = $country['countries_id'];\n $ship['zone_id'] = (int)$state['zone_id'];\n // get country id and state id for billing\n $country = tep_db_fetch_array(tep_db_query(\"select countries_id from \" . TABLE_COUNTRIES . \" where countries_iso_code_2='\" . $billing['country-code'] . \"'\"));\n $state = tep_db_fetch_array(tep_db_query(\"select zone_id from \" . TABLE_ZONES . \" where zone_country_id='\" . $country['countries_id'] . \"' and zone_code='\" . $billing['region'] . \"'\"));\n $billing['countries_id'] = $country['countries_id'];\n $billing['zone_id'] = (int)$state['zone_id'];\n\n list($firstname_bill, $lastname_bill) = split(' ', $billing['contact-name'], 2);\n if(tep_db_num_rows($check) > 0) {\n $customer_id = tep_db_fetch_array($check);\n $customer_id = $customer_id['customers_id'];\n // check addresses and init $billto and $sendto\n $check_sendto = tep_db_query(\"select address_book_id from \" . TABLE_ADDRESS_BOOK . \" where customers_id='\" . (int)$customer_id . \"' and entry_company='\" . tep_db_input($ship['company-name']) . \"' and entry_firstname='\" . tep_db_input($firstname_ship) . \"' and entry_lastname='\" . tep_db_input($lastname_ship) . \"' and entry_street_address='\" . tep_db_input($ship['address1']) . ' ' . tep_db_input($ship['address2']) . \"' and entry_postcode='\" . tep_db_input($ship['postal-code']) . \"' and entry_city='\" . tep_db_input($ship['city']) . \"' and entry_state='\" . tep_db_input($ship['region']) . \"' and entry_zone_id='\" . intval($ship['zone_id']) . \"' and entry_country_id='\" . intval($ship['countries_id']) . \"'\");\n if(tep_db_num_rows($check_sendto) > 0) {\n $sendto = tep_db_fetch_array($check_sendto);\n $sendto = $sendto['address_book_id'];\n } else {\n // insert new shipping address\n $sql_data_array = array('customers_id' => (int)$customer_id,\n 'entry_firstname' => $firstname_ship,\n 'entry_lastname' => $lastname_ship,\n 'entry_street_address' => $ship['address1'] . ' ' . $ship['address2'],\n 'entry_city' => $ship['city'],\n 'entry_postcode' => $ship['postal-code'],\n 'entry_company' => $ship['company-name'],\n 'entry_state' => $ship['region'],\n 'entry_zone_id' => (int)$ship['zone_id'],\n 'entry_country_id' => (int)$ship['countries_id']);\n tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);\n $sendto = tep_db_insert_id();\n }\n $check_billto = tep_db_query(\"select address_book_id from \" . TABLE_ADDRESS_BOOK . \" where customers_id='\" . (int)$customer_id . \"' and entry_company='\" . tep_db_input($billing['company-name']) . \"' and entry_firstname='\" . tep_db_input($firstname_bill) . \"' and entry_lastname='\" . tep_db_input($lastname_bill) . \"' and entry_street_address='\" . tep_db_input($billing['address1']) . ' ' . tep_db_input($billing['address2']) . \"' and entry_postcode='\" . tep_db_input($billing['postal-code']) . \"' and entry_city='\" . tep_db_input($billing['city']) . \"' and entry_state='\" . tep_db_input($billing['region']) . \"' and entry_zone_id='\" . (int)$billing['zone_id'] . \"' and entry_country_id='\" . (int)$billing['countries_id'] . \"'\");\n if(tep_db_num_rows($check_billto) > 0) {\n $billto = tep_db_fetch_array($check_billto);\n $billto = $billto['address_book_id'];\n } else {\n $sql_data_array = array('customers_id' => (int)$customer_id,\n 'entry_firstname' => $firstname_bill,\n 'entry_lastname' => $lastname_bill,\n 'entry_street_address' => $billing['address1'] . ' ' . $billing['address2'],\n 'entry_city' => $billing['city'],\n 'entry_postcode' => $billing['postal-code'],\n 'entry_company' => $billing['company-name'],\n 'entry_state' => $billing['region'],\n 'entry_zone_id' => (int)$billing['zone_id'],\n 'entry_country_id' => (int)$billing['countries_id']);\n tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);\n $billto = tep_db_insert_id();\n }\n } else { // create new customer\n $sql_data_array = array('customers_firstname' => $firstname_ship,\n 'customers_lastname' => $lastname_ship,\n 'customers_email_address' => $ship['email'],\n 'customers_telephone' => $ship['phone'],\n 'customers_fax' => $ship['fax']);\n tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);\n $customer_id = tep_db_insert_id();\n // insert new shipping address\n $sql_data_array = array('customers_id' => $customer_id,\n 'entry_firstname' => $firstname_ship,\n 'entry_lastname' => $lastname_ship,\n 'entry_street_address' => $ship['address1'] . ' ' . $ship['address2'],\n 'entry_city' => $ship['city'],\n 'entry_postcode' => $ship['postal-code'],\n 'entry_company' => $ship['company-name'],\n 'entry_state' => $ship['region'],\n 'entry_zone_id' => $ship['zone_id'],\n 'entry_country_id' => $ship['countries_id']);\n tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);\n $address_id = tep_db_insert_id();\n $sendto = $address_id;\n tep_db_query(\"update \" . TABLE_CUSTOMERS . \" set customers_default_address_id = '\" . $address_id . \"' where customers_id = '\" . $customer_id . \"'\");\n tep_db_query(\"insert into \" . TABLE_CUSTOMERS_INFO . \" (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('\" . (int)$customer_id . \"', '0', now())\");\n // insert new billing address\n $sql_data_array = array('customers_id' => $customer_id,\n 'entry_firstname' => $firstname_bill,\n 'entry_lastname' => $lastname_bill,\n 'entry_street_address' => $billing['address1'] . ' ' . $billing['address2'],\n 'entry_city' => $billing['city'],\n 'entry_postcode' => $billing['postal-code'],\n 'entry_company' => $billing['company-name'],\n 'entry_state' => $billing['region'],\n 'entry_zone_id' => $billing['zone_id'],\n 'entry_country_id' => $billing['countries_id']);\n tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);\n $address_id = tep_db_insert_id();\n $billto = $address_id;\n }\n/* start search engines statistics */\n $search_engines_id = 0;\n $search_words_id = 0;\n $affiliate_ref = 0;\n $search_engines_id_dom = $dom_data_root->get_elements_by_tagname(\"search_engines_id\");\n if ( is_array($search_engines_id_dom) && isset($search_engines_id_dom[0]) && is_object($search_engines_id_dom[0]) ) $search_engines_id = intval($search_engines_id_dom[0]->get_content());\n \n $search_words_id_dom = $dom_data_root->get_elements_by_tagname(\"search_words_id\");\n if ( is_array($search_words_id_dom) && isset($search_words_id_dom[0]) && is_object($search_words_id_dom[0]) ) $search_words_id = intval($search_words_id_dom[0]->get_content());\n\n $affiliate_ref_dom = $dom_data_root->get_elements_by_tagname(\"affiliate_ref\");\n if ( is_array($affiliate_ref_dom) && isset($affiliate_ref_dom[0]) && is_object($affiliate_ref_dom[0]) ) $affiliate_ref = intval($affiliate_ref_dom[0]->get_content());\n\n/* end search engines statistics*/\n\n // create order\n $google_order_number = $dom_data_root->get_elements_by_tagname(\"google-order-number\");\n $number = $google_order_number[0]->get_content();\n // recreate shopping cart\n $sess_cart = $dom_data_root->get_elements_by_tagname(\"sess_cart\");\n $sess_cart = $sess_cart[0]->get_content();\n $saved_cart = unserialize( base64_decode($sess_cart) );\n if ( $saved_cart!==false ) {\n $cart = new shoppingCart;\n $cart = $saved_cart;\n }else{\n $items_list = $dom_data_root->get_elements_by_tagname(\"osc-item\");\n $currencies = new currencies();\n $cart = new shoppingCart;\n $post_process = array();\n foreach($items_list as $item)\n {\n $uprid = $item->get_attribute('item_id');\n $qty = $item->get_content();\n if ( preg_match('/^ga/',$uprid) ) {\n $post_process[] = $uprid;\n }elseif(preg_match('/^(\\d+)\\{used_(\\d+)\\}/',$uprid,$usedm)) {\n $u_pid = $usedm[1];\n $u_uid = $usedm[2];\n $cart->add_used($u_uid, $qty);\n }else{\n $attr = get_attributes($uprid);\n $cart->add_cart($uprid, $qty, $attr);\n }\n }\n foreach($post_process as $give_away) {\n $give = explode('|',$give_away);\n if ( count($give)==3 ) {\n $attr = get_attributes($give[1]);\n $cart->add_giveaway( $give[2], (int)$give[1], $attr );\n }\n }\n }\n $cart->calculate();\n\n//\nglobal $country_code, $state_code;\n\n$country_code = $ship['country-code'];\n$state_code = $ship['region'];\n$shipping_ = $shipping;\nunset($shipping);\nInitOscShippings();\nif (isset($shipping_to_class[$xml_shipping])){\n $shipping = $shipping_to_class[$xml_shipping];\n $GLOBALS['shipping']['id'] = $shipping['id'];\n}else{\n $shipping = $shipping_;\n}\n//\n\n require_once(DIR_WS_CLASSES . 'order.php');\n $order = new order;\n require_once(DIR_WS_CLASSES . 'order_total.php');\n\n $order_total_modules = new order_total;\n $order_totals = $order_total_modules->process();\n// fake tax or warmup shipping from shipping name & recalc all corect\n//mydump(var_export($order,true));\n//mydump(var_export($order_totals,true));\n/*\nforeach( $order_totals as $idx=>$ot_module ) {\n if ( $ot_module['code']=='ot_tax' ) {\n $order_totals[$idx]['value'] = $xml_tax;\n $order_totals[$idx]['text'] = $currencies->format($xml_tax, true, $order->info['currency'], $order->info['currency_value']);\n break;\n }\n}*/\n//\\fake tax\n //print_r($order);\n //print_r($order_totals);\n if (defined('MODULE_PAYMENT_GOOGLECHECKOUT_STATUS')) $order->info['order_status'] = MODULE_PAYMENT_GOOGLECHECKOUT_STATUS;\n\n $sql_data_array = array('customers_id' => $customer_id,\n 'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],\n //{{ BEGIN FISTNAME\n 'customers_firstname' => $order->customer['firstname'],\n 'customers_lastname' => $order->customer['lastname'],\n //}} END FIRSTNAME\n 'customers_company' => $order->customer['company'],\n 'customers_street_address' => $order->customer['street_address'],\n 'customers_suburb' => $order->customer['suburb'],\n 'customers_city' => $order->customer['city'],\n 'customers_postcode' => $order->customer['postcode'],\n 'customers_state' => $order->customer['state'],\n 'customers_country' => $order->customer['country']['title'],\n 'customers_telephone' => $order->customer['telephone'],\n 'customers_email_address' => $order->customer['email_address'],\n 'customers_address_format_id' => $order->customer['format_id'],\n 'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],\n //{{ BEGIN FISTNAME\n 'delivery_firstname' => $order->delivery['firstname'],\n 'delivery_lastname' => $order->delivery['lastname'],\n //}} END FIRSTNAME\n 'delivery_company' => $order->delivery['company'],\n 'delivery_street_address' => $order->delivery['street_address'],\n 'delivery_suburb' => $order->delivery['suburb'],\n 'delivery_city' => $order->delivery['city'],\n 'delivery_postcode' => $order->delivery['postcode'],\n 'delivery_state' => $order->delivery['state'],\n 'delivery_country' => $order->delivery['country']['title'],\n 'delivery_address_format_id' => $order->delivery['format_id'],\n 'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'],\n //{{ BEGIN FISTNAME\n 'billing_firstname' => $order->billing['firstname'],\n 'billing_lastname' => $order->billing['lastname'],\n //}} END FIRSTNAME\n 'billing_company' => $order->billing['company'],\n 'billing_street_address' => $order->billing['street_address'],\n 'billing_suburb' => $order->billing['suburb'],\n 'billing_city' => $order->billing['city'],\n 'billing_postcode' => $order->billing['postcode'],\n 'billing_state' => $order->billing['state'],\n 'billing_country' => $order->billing['country']['title'],\n 'billing_address_format_id' => $order->billing['format_id'],\n 'payment_method' => $order->info['payment_method'],\n 'payment_class' => 'googlecheckout',\n 'payment_info' => $GLOBALS['payment_info'], //???\n 'google_orders_id' => $number,\n 'shipping_method' => $order->info['shipping_method'],\n 'cc_type' => $order->info['cc_type'],\n 'cc_owner' => $order->info['cc_owner'],\n 'cc_number' => $order->info['cc_number'],\n 'cc_expires' => $order->info['cc_expires'],\n 'keep_date' => 'now()',\n 'language_id' => (int)$languages_id,\n 'payment_class' => $order->info['payment_class'],\n 'shipping_class' => $order->info['shipping_class'],\n 'date_purchased' => 'now()',\n 'last_modified' => 'now()',\n/* start search engines statistics */\n 'search_engines_id' => $search_engines_id,\n 'search_words_id' => $search_words_id,\n/* end search engines statistics*/\n\n /// 'affiliate_id' => (int)$affiliate_ref,\n // 'comments' => 'AFF_DOM' . var_export($affiliate_ref_dom[0]->get_content(), true),\n\n // 'how_did_you_find' => $order->info['how_did_you_find'],\n //'how_did_you_find_text' => $order->info['how_did_you_find_text'],\n \n 'orders_status' => $order->info['order_status'],\n 'currency' => $order->info['currency'],\n 'currency_value' => $order->info['currency_value']);\n tep_db_perform(TABLE_ORDERS, $sql_data_array);\n $insert_id = tep_db_insert_id();\n for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {\n $sql_data_array = array('orders_id' => $insert_id,\n 'title' => $order_totals[$i]['title'],\n 'text' => $order_totals[$i]['text'],\n 'value' => $order_totals[$i]['value'],\n 'class' => $order_totals[$i]['code'],\n 'sort_order' => $order_totals[$i]['sort_order']);\n tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);\n }\n $sql_data_array = array('orders_id' => $insert_id,\n 'orders_status_id' => $order->info['order_status'],\n 'date_added' => 'now()',\n 'customer_notified' => '0',\n 'comments' => 'Order created by Google Checkout');\n tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);\n for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {\n /*\n if (STOCK_LIMITED == 'true') {\n if (DOWNLOAD_ENABLED == 'true') {\n $stock_query_raw = \"SELECT products_quantity, products_attributes_filename\n FROM \" . TABLE_PRODUCTS . \" p\n LEFT JOIN \" . TABLE_PRODUCTS_ATTRIBUTES . \" pa\n ON p.products_id=pa.products_id\n WHERE p.products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\";\n// Will work with only one option for downloadable products\n// otherwise, we have to build the query dynamically with a loop\n $products_attributes = $order->products[$i]['attributes'];\n if (is_array($products_attributes)) {\n $stock_query_raw .= \" AND pa.options_id = '\" . $products_attributes[0]['option_id'] . \"' AND pa.options_values_id = '\" . $products_attributes[0]['value_id'] . \"'\";\n }\n $stock_query = tep_db_query($stock_query_raw);\n } else {\n $stock_query = tep_db_query(\"select products_quantity from \" . TABLE_PRODUCTS . \" where products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\");\n }\n if (tep_db_num_rows($stock_query) > 0) {\n $stock_values = tep_db_fetch_array($stock_query);\n // do not decrement quantities if products_attributes_filename exists\n if ((DOWNLOAD_ENABLED != 'true') || ((!$stock_values['products_attributes_filename']) && $order->products[$i]['products_file'])) {\n $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];\n } else {\n $stock_left = $stock_values['products_quantity'];\n }\n tep_db_query(\"update \" . TABLE_PRODUCTS . \" set products_quantity = '\" . $stock_left . \"' where products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\");\n if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {\n tep_db_query(\"update \" . TABLE_PRODUCTS . \" set products_status = '0' where products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\");\n }\n }\n */\n // Update products_ordered (for bestsellers list)\n tep_db_query(\"update \" . TABLE_PRODUCTS . \" set products_ordered = products_ordered + \" . sprintf('%d', $order->products[$i]['qty']) . \" where products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\");\n $sql_data_array = array('orders_id' => $insert_id,\n 'products_id' => tep_get_prid($order->products[$i]['id']),\n 'products_model' => $order->products[$i]['model'],\n 'products_name' => $order->products[$i]['name'],\n 'products_price' => $order->products[$i]['price'],\n 'final_price' => $order->products[$i]['final_price'],\n 'products_purchase_price' => tep_get_products_purchase_price(normalize_id($order->products[$i]['id']), $order->products[$i]['final_price']),\n 'products_tax' => $order->products[$i]['tax'],\n 'used' => $order->products[$i]['used'],\n\n\n 'is_give_away'=>((isset($order->products[$i]['is_give_away']) && $order->products[$i]['is_give_away']==1)?'1':'0'),\n // addon - gives as products 'gives' => (is_array($order->products[$i]['gives'])?serialize($order->products[$i]['gives']):''),\n 'products_quantity' => $order->products[$i]['qty'],\n 'products_status' => ((tep_get_products_stock($order->products[$i]['id']) - $order->products[$i]['qty'])>-1?1:0),\n 'uprid' => normalize_id($order->products[$i]['id']));\n tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);\n $order_products_id = tep_db_insert_id();\n $order_total_modules->update_credit_account($i);//ICW ADDED FOR CREDIT CLASS SYSTEM\n //------insert customer choosen option to order--------\n $attributes_exist = '0';\n $products_ordered_attributes = '';\n\n if ((DOWNLOAD_ENABLED == 'true') && tep_not_null($order->products[$i]['products_file'])) {\n $sql_data_array = array('orders_id' => $insert_id,\n 'orders_products_id' => $order_products_id,\n 'orders_products_name' => $order->products[$i]['name'],\n 'orders_products_filename' => $order->products[$i]['products_file'],\n 'download_maxdays' => DOWNLOAD_MAX_DAYS,\n 'download_count' => DOWNLOAD_MAX_COUNT);\n tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);\n }\n\n\n //// GiveAway multiplay by senia 2007-02-23 <[email protected]> ////\n /*\n $ordered_gives = '';\n\n if (is_array($order->products[$i]['gives']) && sizeof($order->products[$i]['gives'])>0) {\n $ordered_gives .= \"\\n\\t\" . TEXT_GIVEAWAY . ':';\n foreach($order->products[$i]['gives'] as $gdata) {\n $ordered_gives .= \"\\n\\t\" . ' - ' . $gdata['fullname'];\n update_stock($gdata['uprid'], 0, $order->products[$i]['qty']);\n }\n }\n */\n\n $ordered_gives = '';\n\n if (is_array($order->products[$i]['gives']) && sizeof($order->products[$i]['gives'])>0) {\n $ordered_gives .= \"\\n\\t\" . TEXT_GIVEAWAY . ':';\n $dec_price = 0;\n foreach($order->products[$i]['gives'] as $gdata) {\n $ordered_gives .= \"\\n\\t\" . ' - ' . $gdata['fullname'] . ' (+' . $currencies->display_price($gdata['price'], $gdata['tax']) . ')';\n $dec_price += $gdata['price'];\n $sql_data_array = array('orders_id' => $insert_id,\n 'products_id' => tep_get_prid($gdata['id']),\n 'parent_giv_id' => normalize_id($order->products[$i]['id']),\n 'products_model' => $gdata['model'],\n 'products_name' => $gdata['name'] . ' (Giveaway '.$order->products[$i]['model'].')',\n 'products_price' => $gdata['price'],\n 'final_price' => $gdata['price'],\n 'products_tax' => $gdata['tax'],\n\n \n\n 'products_quantity' => $order->products[$i]['qty'],\n 'products_status' => ((tep_get_products_stock($gdata['uprid']) - $order->products[$i]['qty'])>-1?1:0),\n 'uprid' => normalize_id($gdata['uprid']));\n tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);\n $order_gives_id = tep_db_insert_id();\n\n if (is_array($gdata['attributes']) && sizeof($gdata['attributes'])>0) {\n foreach ($gdata['attributes'] as $gdata_attr) {\n\n $sql_data_array = array('orders_id' => $insert_id,\n 'orders_products_id' => $order_gives_id,\n 'products_options_id' => $gdata_attr['opt_id'],\n 'products_options' => $gdata_attr['opt_name'],\n 'products_options_values_id' => $gdata_attr['opt_val_id'],\n 'products_options_values' => $gdata_attr['tep_values_name'],\n 'options_values_price' => '0',\n 'price_prefix' => '+');\n tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);\n\n }\n }\n\n update_stock($gdata['uprid'], 0, $order->products[$i]['qty']);\n }\n\n tep_db_query(\"update \".TABLE_ORDERS_PRODUCTS.\" set products_price=(products_price-'\".floatval($dec_price).\"'), final_price=(final_price-'\".floatval($dec_price).\"') where orders_products_id='\".intval($order_products_id).\"'\");\n }\n //// GiveAway multiplay by senia 2007-02-23 <[email protected]> off ////\n\n\n\n\n if (isset($order->products[$i]['attributes'])) {\n $attributes_exist = '1';\n for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {\n if (DOWNLOAD_ENABLED == 'true') {\n $attributes_query = \"select pa.products_attributes_id, popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.products_attributes_maxdays, pa.products_attributes_maxcount , pa.products_attributes_filename\n from \" . TABLE_PRODUCTS_OPTIONS . \" popt, \" . TABLE_PRODUCTS_OPTIONS_VALUES . \" poval, \" . TABLE_PRODUCTS_ATTRIBUTES . \" pa\n where pa.products_id = '\" . $order->products[$i]['id'] . \"'\n and pa.options_id = '\" . $order->products[$i]['attributes'][$j]['option_id'] . \"'\n and pa.options_id = popt.products_options_id\n and pa.options_values_id = '\" . $order->products[$i]['attributes'][$j]['value_id'] . \"'\n and pa.options_values_id = poval.products_options_values_id\n and popt.language_id = '\" . $languages_id . \"'\n and poval.language_id = '\" . $languages_id . \"'\";\n $attributes = tep_db_query($attributes_query);\n } else {\n $attributes = tep_db_query(\"select pa.products_attributes_id, popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from \" . TABLE_PRODUCTS_OPTIONS . \" popt, \" . TABLE_PRODUCTS_OPTIONS_VALUES . \" poval, \" . TABLE_PRODUCTS_ATTRIBUTES . \" pa where pa.products_id = '\" . $order->products[$i]['id'] . \"' and pa.options_id = '\" . $order->products[$i]['attributes'][$j]['option_id'] . \"' and pa.options_id = popt.products_options_id and pa.options_values_id = '\" . $order->products[$i]['attributes'][$j]['value_id'] . \"' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '\" . $languages_id . \"' and poval.language_id = '\" . $languages_id . \"'\");\n }\n\n $attributes_values = tep_db_fetch_array($attributes);\n $attributes_values['options_values_price'] = tep_get_options_values_price($attributes_values['products_attributes_id']);\n\n $sql_data_array = array('orders_id' => $insert_id,\n 'orders_products_id' => $order_products_id,\n 'products_options' => $attributes_values['products_options_name'],\n 'products_options_values' => $attributes_values['products_options_values_name'],\n 'options_values_price' => $attributes_values['options_values_price'],\n 'price_prefix' => $attributes_values['price_prefix']);\n tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);\n\n if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) {\n $sql_data_array = array('orders_id' => $insert_id,\n 'orders_products_id' => $order_products_id,\n 'orders_products_name' => $order->products[$i]['name'],\n 'orders_products_filename' => $attributes_values['products_attributes_filename'],\n 'download_maxdays' => $attributes_values['products_attributes_maxdays'],\n 'download_count' => $attributes_values['products_attributes_maxcount']);\n tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);\n }\n $products_ordered_attributes .= \"\\n\\t\" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];\n }\n\n\n\n }\n\n // update inventory\nif (PRODUCTS_INVENTORY == 'True'){\n update_stock($order->products[$i]['id'], 0, $order->products[$i]['qty']);\n}\n//\n\n }\n\n //$insert_id, $customer_id, $REMOTE_ADDR, $cc_id;\n $order_total_modules->apply_credit();//ICW ADDED FOR CREDIT CLASS SYSTEM\n\n \n tep_calculate_order_revenue($insert_id); \n \n}", "public function payWayPurchase()\n\t{\n\t}", "public function addOrder(){\r\n $order = $_REQUEST['order']; \r\n $form = M(\"logininfo\"); \r\n $condition['ssid'] = $_COOKIE['iPlanetDirectoryPro'];\r\n $data_user = $form->where($condition)->find();\r\n $username = $data_user['name'];\r\n $dep = $data_user['dep'];\r\n $stuid = $data_user['username'];\r\n $form_user = M('userinfo');\r\n $condition_user['stuid'] = $stuid;\r\n $data_final = $form_user->where($condition_user)->find();\r\n if ($data_final) $dep = $data_final['dep'];\r\n $trade = \"\";\r\n for ($ii = 0;$ii < count($order);$ii++)\r\n {\r\n date_default_timezone_set(\"Asia/Shanghai\"); \r\n\t \t$ordertime = date('Y-m-d H:i:s');\r\n $checktime = date('Hi');\r\n // if (!(($checktime >= '0830' && $checktime<= '1030')||($checktime>='1400' && $checktime<='1630')))\r\n // {\r\n // //echo $checktime;\r\n // $data_error['error'] = \"对不起,现在不是订餐时间\";\r\n // $data_error = json_encode($data_error);\r\n // echo $data_error;\r\n // return;\r\n // } \r\n $new['trade_date'] = date('YmdHis');\r\n $search = date('Ymd'); \r\n //var_dump($search);\r\n $form_order = M(\"orderinfo\"); \r\n $condition = array(); \r\n $condition['number'] = array('like','%'.$search.'%'); \r\n\r\n $data_order = $form_order->where($condition)->select(); \r\n $jnl = (String)count($data_order)+1;\r\n $zero = '';\r\n for ($i = 0; $i < 6-strlen($jnl); $i++) $zero = $zero.'0';\r\n $jnl = $zero.$jnl;\r\n //var_dump($jnl); 计算订单号jnl\r\n $number[$ii] = $search.$jnl; \r\n\t \t$address = $order[$ii]['address'];\r\n\t \t$phone = $order[$ii]['phone'];\r\n\t \t$remark = $order[$ii]['remark'];\r\n\t \t$amount = $order[$ii]['amount'];\r\n $pay = $order[$ii]['pay'];\r\n $area = $order[$ii]['area'];\r\n\t \t$status = \"下单成功\";\r\n $id = $order[$ii]['id'];//食品的ID\r\n // var_dump($id);\r\n $condition = array(); \r\n $condition['id'] = $id;\r\n $form = M(\"foodinfo\");\r\n $data = array();\r\n $data = $form->where($condition)->find();\r\n // var_dump($data);\r\n if ($data['amount'] - $amount >=0)\r\n\t\t\t{\r\n\t\t\t\tif ($pay == '签单') $data['amount'] = $data['amount'] - $amount;\r\n\t\t\t}\r\n else \r\n {\r\n $data_error['error'] = \"对不起,套餐已经卖光啦,下次早点来吧!\";\r\n $data_error = json_encode($data_error);\r\n echo $data_error;\r\n return;\r\n }\r\n $form -> save($data); \r\n $addnew = array();\r\n $form = array();\r\n $addnew['food'] = $data['name'];\r\n //var_dump($data['name']);\r\n $addnew['price'] = $data['price']*$amount; \r\n\t\t\t$form = M('orderinfo'); \r\n $addnew['number'] = $number[$ii];\r\n\t\t\t$addnew['username'] = $username;\r\n $addnew['dep'] = $dep;\r\n $addnew['stuid'] = $stuid;\r\n\t\t\t$addnew['ordertime'] = $ordertime;\r\n\t\t\t$addnew['address'] = $address;\r\n\t\t\t$addnew['phone'] = $phone;\r\n\t\t\t$addnew['remark'] = \"\";//所有数据都不能留空!!!\r\n $addnew['pay'] = $pay;\r\n if ($addnew['pay'] == '签单') $addnew['pay_status'] = 1;\r\n else $addnew['pay_status'] = 0;\r\n\t\t\t$addnew['area'] = $area;\r\n\t\t\t$addnew['amount'] = $amount;\r\n\t\t\t$addnew['status'] = $status;\r\n // $trade = $trade.\"<trade><user_id>\".$stuid.\"</user_id><user_name>\".$username.\"</user_name><jnl>\".$number.\"</jnl><rec_acc>\".\"zjgkc\".\"</rec_acc><amt>\".$addnew['price'].\"</amt><trade_code></trade_code><comment>浙江大学订餐系统</comment><resv_col1></resv_col1><resv_col2></resv_col2><resv_col3></resv_col3><Msg></Msg></trade>\";\r\n //var_dump($addnew);\r\n\t\t\t$form->add($addnew); \r\n }\r\n if ($addnew['pay_status'] == 0)\r\n {\r\n $jnl = $number[0];\r\n $new['app_id'] = 'ZDYS';\r\n $new['user_name'] = $username;\r\n $new['user_id'] = $stuid;\r\n $new['trade_jnl'] = 'ys'.$jnl;\r\n $new['trade_mode'] = \"\";\r\n $total_amt = 0;$total_num = 0;\r\n $total_jnl = $number[0];\r\n for ($i = 0;$i<count($order);$i++)\r\n {\r\n $total_num = $total_num + 1;\r\n $id = $order[$i]['id'];//食品的ID\r\n $condition = array(); \r\n $condition['id'] = $id;\r\n $form_food = M(\"foodinfo\");\r\n $data_food = array();\r\n $data_food = $form_food->where($condition)->find();\r\n $total_amt = $total_amt + $order[$i]['amount']*$data_food['price'];\r\n if ($i != 0) $total_jnl = $total_jnl.','.(string)$number[$i]; \r\n }\r\n $form_jnl = M('jnlinfo');//添加订单对应关系\r\n $new_jnl['first'] = $number[0];\r\n $new_jnl['total'] = $total_jnl;\r\n $form_jnl -> add($new_jnl);\r\n $trade = \"<trade><user_id>\".$stuid.\"</user_id><user_name>\".$username.\"</user_name><jnl>\".$number[0].\"</jnl><rec_acc>\".\"zjgkc\".\"</rec_acc><amt>\".$total_amt.\"</amt><trade_code></trade_code><comment>浙江大学订餐系统</comment><resv_col1></resv_col1><resv_col2></resv_col2><resv_col3></resv_col3><Msg></Msg></trade>\";\r\n $new['trade_req'] = \"<trade_req><pay_acc></pay_acc><pay_acc_name></pay_acc_name><total_num>\".'1'.\"</total_num><total_amt>\".$total_amt.\"</total_amt><resv_col1></resv_col1><resv_col2></resv_col2><resv_col3></resv_col3><trades>\".$trade.\"</trades></trade_req>\";\r\n $new['res_mode'] = 'res_notify';\r\n $new['trade_chars'] = 'utf-8';\r\n $new['trade_type'] = 'pay';\r\n $new['sign_type']=\"md5\";\r\n $new['iPlanetDirectoryPro'] = urlencode($_COOKIE['iPlanetDirectoryPro']);\r\n $new['notify_url'] = \"http://10.203.2.68/fastfood/index.php/Pay/request\";\r\n $salt = \"synZDYS\";\r\n $sign = \"app_id=\".$new['app_id'].\"&user_id=\".$new['user_id'].\"&trade_jnl=\".$new['trade_jnl'].\"&trade_req=\".$new['trade_req'].\"&salt=\".$salt;\r\n $new['sign'] = strtoupper(md5($sign));\r\n $new = json_encode($new);\r\n echo $new;\r\n\r\n }\r\n }", "public function call() {\n\t\t$cart_order_id=$_GET['order_id'];\n\t\tif ($this->_module['sk_live']==$_GET['secret']) {\n\t\t\tif ($_GET['state']=='2') {\n\t\t\t\t$order = Order::getInstance();\n\t\t\t\t$order->orderStatus(Order::PAYMENT_DECLINE, $cart_order_id);\n\t\t\t\t$order->paymentStatus(Order::ORDER_CANCELLED, $cart_order_id);\n\t\t\t\t$TestNote = $this->CreateNote($cart_order_id ,\"Gateway Pingback expired.\");\n\t\t\t} else if ($_GET['state']=='5'){\n\t\t\t\t$order = Order::getInstance();\n\t\t\t\t$order->orderStatus(Order::ORDER_PROCESS, $cart_order_id);\n\t\t\t\t$order->paymentStatus(Order::PAYMENT_SUCCESS, $cart_order_id);\n\t\t\t\t$transData['notes']\t\t\t= implode(' ', $notes);\n\t\t\t\t$transData['order_id']\t\t= $cart_order_id;\n\t\t\t\t$transData['status']\t\t= \"Completed\";\n\t\t\t\t$transData['gateway']\t\t= 'Bitcoinz';\n\t\t\t\t$order->logTransaction($transData);\n\t\t\t\t$TestNote = $this->CreateNote($cart_order_id ,\"Gateway Pingback success.\");\n\t\t\t}\n\t\t}\n\t}", "public function creating(Order $order): void\n\t{\n\t\tif (auth()->check()) {\n\t\t\t$order->client_id = auth()->id();\n\t\t}\n\t\t// If a booster has been selected for the order, set its status to progress, otherwise pending\n\t\t(bool) $order->booster_id ? $order->status = 'progress' : 'pending';\n\t}", "public function payment()\n {\n $total_price = number_format($_GET['price'],2);\n //get cart from session\n $cart = $_SESSION['shopping_cart'];\n\n\n //check if user is logged with userID else user send to log in\n if(isset($_SESSION['userID'])){\n\n //get userID from session\n $userId = $_SESSION['userID'];\n //API mollie payment setup\n $mollie = new MollieApiClient();\n $mollie->setApiKey('test_ajQEAHf8StBWg3dnW9VxWvcz26j5jh');\n $description = 'Payment for Haarlem Festival order' ;\n\n $payment = $mollie->payments->create([\n \"amount\" => [\n \"currency\" => \"EUR\",\n \"value\" => \"$total_price\",\n ],\n \"description\" => \"$description\",\n \"redirectUrl\" => \"http://localhost/PHP/HaarlemFestivalG4/carts/confirmationPage\",\n \"webhookUrl\" => \"\",\n \"metadata\" => \"\",\n ]);\n\n\n\n\n //set status $payment->status only returns open and api wont continue unless paid is selected\n $statusPay = \"paid\";\n //sends information to payment model\n $this->paymentModel->createOrder($statusPay,$userId,$total_price);\n\n //get the orderID from model\n $id= $this->paymentModel->getOrderId();\n //makes ID readable\n $data = $id->orderID;\n //make a session for orderID so it can be fetched from another page\n $_SESSION['orderID']= $data;\n\n //continue with payment\n header('location: '.$payment->getCheckoutUrl(), true, 303);\n\n\n //sends every item in order to orderItems in the db\n foreach ($cart as $item){\n $quantity = $item[\"quantity\"];\n $eventID = $item[\"event_id\"];\n $price = $item[\"price\"];\n\n //because the database was not created according to the schema we had made 2 different tables had to be created thus the different methods\n //each ticket has a type and the statement underneath checks whether the type is either Dance or otherwise (History)\n if($item[\"type\"]==\"Dance\"){\n //get the ticket based on dance\n $result = $this->paymentModel->searchDanceTicket($eventID,$price);\n\n }\n else{\n //get ticket based on history\n $result = $this->paymentModel->searchHistoryTicket($eventID,$price);\n }\n //sets tickID\n $tickID = $result->ticketID;\n //sends the ticket to orderItem\n $this->paymentModel->addOrderItem($data,$tickID,$quantity);\n }\n //clears shopping cart session after payment\n $data='';\n unset($_SESSION['shopping_cart']);\n\n $this->view('payments/index',$data);\n\n\n }\n else{\n //when the user is directed to the login page when not logged in\n $data = [\n 'email'=> '',\n 'password' => '',\n 'emailError' => '',\n 'passwordError' => ''\n ];\n $this->view('/users/login',$data);\n }\n\n\n\n }", "public function creating(Order $Order)\n {\n //code...\n }", "public function testTrackOrderRequestWithUserCreateMethod(): void\n {\n $tracker = new Tracker($this->DATASET_ID(), $this->API_KEY());\n\n $money = new Money();\n $money->amount = 100;\n $money->currency = new Currency();\n $money->currency->value = \"DKK\";\n\n $order = new Order();\n $order->user = User::create(null, \"t-Id\", null, null, null, null, null);\n $order->subtotal = $money;\n $order->orderNumber = \"1\";\n\n $trackOrderRequest = new TrackOrderRequest();\n $trackOrderRequest->order = $order;\n\n $response = $tracker->request('TrackOrderRequest', $trackOrderRequest);\n\n self::assertEquals(200, $response->code);\n self::assertEquals(null, $response->body);\n }", "public function createOrder($accessToken){\n $url = \"https://api.sandbox.paypal.com/v2/checkout/orders\";\n \n /* Call Headers */\n $paymentHeaders = array(\"Content-Type: application/json\", \"Authorization: Bearer \".$accessToken);\n \n\t/* Generates Random Invoice Number */\n\t$randNo= (string)rand(10000,20000);\n \n /* Fill payload with transaction info */\n\n\t\t\t$postfields = '{}';\n $postfieldsArr = json_decode($postfields, true);\n $postfieldsArr['intent'] = \"CAPTURE\";\n \t$postfieldsArr['application_context']['shipping_preference'] = \"SET_PROVIDED_ADDRESS\";\n \t$postfieldsArr['application_context']['user_action'] = \"PAY_NOW\";\n \t\n \t$postfieldsArr['purchase_units'][0]['description'] = \"PayPalPizza\";\n \t$postfieldsArr['purchase_units'][0]['invoice_id'] = \"INV-PayPalPizza-\" . $randNo;\n \t$postfieldsArr['purchase_units'][0]['amount']['currency_code'] = $_POST['currency'];\n \t$postfieldsArr['purchase_units'][0]['amount']['value'] = $_POST['total_amt'];\n \t$postfieldsArr['purchase_units'][0]['amount']['breakdown']['item_total']['currency_code'] = $_POST['currency'];\n \t$postfieldsArr['purchase_units'][0]['amount']['breakdown']['item_total']['value'] = $_POST['total_amt'];\n\t\t\t$postfieldsArr['purchase_units'][0]['shipping']['address']['recipient_name']= $_POST['shipping_recipient_name'];\n\t\t\t$postfieldsArr['purchase_units'][0]['shipping']['address']['phone']= $_POST['shipping_phone'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['address_line_1']= $_POST['shipping_line1'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['address_line_2']= $_POST['shipping_line2'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['admin_area_2']= $_POST['shipping_city'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['admin_area_1']= $_POST['shipping_state'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['postal_code']= $_POST['shipping_postal_code'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['country_code']= $_POST['shipping_country_code'];\n \n for($a = 0; $a < $_POST['itemnum']; $a++){\n $postfieldsArr['purchase_units'][0]['items'][$a]['name'] = $_POST[('itemname'. $a )];\n $postfieldsArr['purchase_units'][0]['items'][$a]['description'] = $_POST[('itemname'. $a)]; \n $postfieldsArr['purchase_units'][0]['items'][$a]['sku'] = $_POST[('itemsku'. $a)]; \n $postfieldsArr['purchase_units'][0]['items'][$a]['unit_amount']['currency_code'] = $_POST['currency']; \n $postfieldsArr['purchase_units'][0]['items'][$a]['unit_amount']['value'] = $_POST[('itemprice'. $a)];\n $postfieldsArr['purchase_units'][0]['items'][$a]['quantity'] = $_POST[('itemamount'. $a)];\n $postfieldsArr['purchase_units'][0]['items'][$a]['category'] = \"PHYSICAL_GOODS\";\n }\n \n $postfields = json_encode($postfieldsArr);\n \n/* Call Orders API */\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $paymentHeaders);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_POST, true);\n $run = curl_exec($ch);\n curl_close($ch);\n/* Call Orders API */\n\n echo $run;\n }", "protected function _init_hooks() {\r\n $this->_initiated = true;\r\n\r\n //assign the client id test based on freedom settings\r\n $setting = get_option('freedom-settings');\r\n\r\n //if freedom is in test mode then set ocenture client id as test id\r\n if ($setting['mode'] == 'sandbox') {\r\n //set sandbox settings url or id here\r\n } \r\n\r\n //on order success from freedom, call ocenture update to insert data into wp and create account on oncenture\r\n add_filter( 'freedom_order_success', array(\r\n $this, 'ocenture_update' \r\n ));\r\n\r\n //perform testing here\r\n if (isset($_GET['test_ocenture'])) {\r\n Logger::start(\"Manual Insert\");\r\n $this->ocenture_insert();\r\n Logger::close();\r\n }\r\n }", "public function testSuccessOrder()\n {\n $user = User::factory()->create([\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => 'asdqwe123'\n ]);\n $orderData = [\n 'product_id' => 1,\n 'quantity' => 1\n ];\n $this->actingAs($user,'api_user');\n\n $this->json('POST', 'api/order',$orderData, ['Accept' => 'application/json'])\n ->assertStatus(201)\n ->assertJson([\n 'message' => 'You have successfully ordered this product'\n ]);\n }", "public function test_payOrder_called_returnUserWithItsNewBalanceAdded()\n {\n $this->markTestSkipped('payOrder skipped');\n $user = UserMother::aUserWith50Eur()->build();\n $expected_wallet = Wallet::create(4750);\n $sut = new WalletService($this->getEntityManagerRevealed(), $this->currencyConversionService_double->reveal(),$this->transactionService_double->reveal());\n }", "public static function createOrder ()\n\t{\n $user=Auth::user();// here to get the user info and store it in the $user variable\n $order=$user->orders()->create([\n 'total'=>Cart::total(),\n 'delivered' =>0\n\n ]);\n // the delivered column will get by default the value zero which means that this order\n // is not delivered yet \n\n $cartItems=cart::content();\n //seek for intels about attach function \n\n foreach($cartItems as $cartItem)\n $order->orderItems()->attach($cartItem->id,[\n 'qty'=>$cartItem->qty ,\n 'total' => $cartItem->qty*$cartItem->price \n ]);\n\n\t}", "public function saveOrder()\n {\n $this->validate();\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this->_prepareNewCustomerQuote();\n $isNewCustomer = true;\n break;\n default:\n $this->_prepareCustomerQuote();\n break;\n }\n\n /**\n * @var TM_FireCheckout_Model_Service_Quote\n */\n $service = Mage::getModel('firecheckout/service_quote', $this->getQuote());\n $service->submitAll();\n\n if ($isNewCustomer) {\n try {\n $this->_involveNewCustomer();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n $this->_checkoutSession->setLastQuoteId($this->getQuote()->getId())\n ->setLastSuccessQuoteId($this->getQuote()->getId())\n ->clearHelperData();\n\n $order = $service->getOrder();\n if ($order) {\n Mage::dispatchEvent('checkout_type_onepage_save_order_after',\n array('order'=>$order, 'quote'=>$this->getQuote()));\n\n /**\n * a flag to set that there will be redirect to third party after confirmation\n * eg: paypal standard ipn\n */\n $redirectUrl = $this->getQuote()->getPayment()->getOrderPlaceRedirectUrl();\n /**\n * we only want to send to customer about new order when there is no redirect to third party\n */\n $canSendNewEmailFlag = true;\n if (version_compare(Mage::helper('firecheckout')->getMagentoVersion(), '1.5.0.0', '>=')) {\n $canSendNewEmailFlag = $order->getCanSendNewEmailFlag();\n }\n if (!$redirectUrl && $canSendNewEmailFlag) {\n try {\n $order->sendNewOrderEmail();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n // add order information to the session\n $this->_checkoutSession->setLastOrderId($order->getId())\n ->setRedirectUrl($redirectUrl)\n ->setLastRealOrderId($order->getIncrementId());\n\n // as well a billing agreement can be created\n $agreement = $order->getPayment()->getBillingAgreement();\n if ($agreement) {\n $this->_checkoutSession->setLastBillingAgreementId($agreement->getId());\n }\n }\n\n // add recurring profiles information to the session\n $profiles = $service->getRecurringPaymentProfiles();\n if ($profiles) {\n $ids = array();\n foreach ($profiles as $profile) {\n $ids[] = $profile->getId();\n }\n $this->_checkoutSession->setLastRecurringProfileIds($ids);\n // TODO: send recurring profile emails\n }\n\n Mage::dispatchEvent(\n 'checkout_submit_all_after',\n array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => $profiles)\n );\n\n return $this;\n }", "public function testTrackOrderRequest(): void\n {\n $tracker = new Tracker($this->DATASET_ID(), $this->API_KEY());\n\n $money = new Money();\n $money->amount = 100;\n $money->currency = new Currency();\n $money->currency->value = \"DKK\";\n\n $order = new Order();\n $order->user = UserFactory::byTemporaryId(\"t-Id\");\n $order->subtotal = $money;\n $order->orderNumber = \"1\";\n\n $trackOrderRequest = new TrackOrderRequest();\n $trackOrderRequest->order = $order;\n\n $response = $tracker->request('TrackOrderRequest', $trackOrderRequest);\n\n self::assertEquals(200, $response->code);\n self::assertEquals(null, $response->body);\n }", "public function fire()\n\t{\n $this->log('Starting Day Trading');\n \n // Setup master vars.\n $last_20 = [];\n $std_pad = 2.35;\n $comission = 1.00;\n $limit_order = 0.40;\n $stop_order = 0.40;\n $balance = 10000;\n $shares_to_trade = 50;\n \n // Loop through every min and see if there are things to do.\n while(1)\n {\n // See if today is a weekend\n if($this->isWeekend())\n {\n $this->log('Sleeping.... Today is a weekend. Nothing to do.');\n $last_20 = []; \n sleep(60);\n continue; \n }\n \n // We only want to trade after 9am PST \n if(date('H') < 9) \n {\n $this->log('Sleeping.... We start trading at 9am PST.');\n $last_20 = []; \n sleep(60);\n continue; \n }\n\n // We only want to trade before 11am PST \n if(date('H') > 10) \n {\n $this->log('Sleeping.... We end trading at 11am PST.');\n $last_20 = []; \n sleep(60);\n continue; \n }\n \n // Get quote\n $quote = $this->tradier->get_quotes([ 'spy' ]);\n \n $last_20[] = $quote['last'];\n \n // If we have not gone 20 times just keep going\n if(count($last_20) < 20)\n {\n $this->log('Warming up: ' . count($last_20) . ' of 20 SMAs');\n \n sleep(60);\n continue;\n } \n \n // Get a STD\n $std = $this->standard_deviation($last_20); \n \n // Setup Bounds\n $sma = array_sum($last_20) / count($last_20);\n $upper = $sma + ($std * $std_pad);\n $lower = $sma - ($std * $std_pad); \n \n // First we see if we have any orders to close.\n $this->close_orders($quote, $limit_order, $stop_order);\n\n // Second we see if we have any orders to open.\n $this->open_orders($quote, $upper, $lower, $comission, $shares_to_trade, $limit_order, $stop_order);\n \n // take first off list.\n array_shift($last_20); \n \n // Sleep wait for next cycle\n sleep(60);\n }\n \n $this->log('Ending Day Trading'); \n\t}", "public function created(Order $order)\n\t{\n\t\t//\n\t}", "public function created(Order $order)\n\t{\n\t\t//\n\t}", "function lotto_buyTickets() {\n\n\t// Set some needed variables.\n\tglobal $DB;\n\tglobal $MySelf;\n\n\t$ID = $MySelf->getID();\n\t$myMoney = getCredits($ID);\n\t$affordable = floor($myMoney / 1000000);\n\t\n\tif (!getConfig(\"lotto\")) {\n\t\tmakeNotice(\"Your CEO disabled the Lotto module, request denied.\", \"warning\", \"Lotto Module Offline\");\n\t}\n\n\t// Get my credits\n\t$MyStuff = $DB->getRow(\"SELECT lottoCredit, lottoCreditsSpent FROM users WHERE id='\" . $MySelf->getID() . \"'\");\n\t$Credits = $MyStuff[lottoCredit];\n\t$CreditsSpent = $MyStuff[lottoCreditsSpent];\n\n\t// User submited this form already!\n\tif ($_POST[check]) {\n\t\tnumericCheck($_POST[amount], 0, $affordable);\n\n\t\tif ($_POST[amount] == 0) {\n\t\t\tmakeNotice(\"You cannot buy zero tickets.\", \"warning\", \"Too few tickets.\", \"index.php?action=lotto\", \"[whoops]\");\n\t\t}\n\n\t\tconfirm(\"Please authorize the transaction of \" . number_format(($_POST[amount] * 1000000), 2) . \" ISK in order to buy $_POST[amount] lotto credits.\");\n\n\t\t// Get the old ticket count, and add the new tickets on top of those.\t\t\t\n\t\t$oldCount = $DB->getCol(\"SELECT lottoCredit FROM users WHERE id='$ID' LIMIT 1\");\n\t\t$newcount = $oldCount[0] + $_POST[amount];\n\n\t\t// Update the database to reflect the new ticket count.\n\t\t$check = $DB->query(\"UPDATE users SET lottoCredit='$newcount' WHERE id='$ID' LIMIT 1\");\n\n\t\t// Check that we were successful.\n\t\tif ($DB->affectedRows() != 1) {\n\t\t\tmakeNotice(\"I was unable to add $newcount tickets to $user stack of $count tickets! Danger will robonson, danger!\", \"error\", \"Unable to comply.\");\n\t\t}\n\n\t\t// Make him pay!\n\t\tglobal $TIMEMARK;\n\t\t$transaction = new transaction($ID, 1, ($_POST[amount] * 1000000));\n\t\t$transaction->setReason(\"lotto credits bought\");\n\t\tif ($transaction->commit()){\n\t\t\t// all worked out!\n\t\t\tmakeNotice(\"Your account has been charged the amount of \" . number_format(($_POST[amount] * 1000000), 2) . \" ISK.\", \"notice\", \"Credits bought\", \"index.php?action=lotto\", \"[OK]\");\n\t\t} else {\n\t\t\t// We were not successfull\n\t\t\tmakeNotice(\"I was unable to add $newcount tickets to $user stack of $count tickets! Danger will robonson, danger!\", \"error\", \"Unable to comply.\");\n\t\t}\n\t}\n\n\t// Prepare the drop-down menu.\n\tif ($affordable >= 1) {\n\t\t$ddm = \"<select name=\\\"amount\\\">\";\n\t\tfor ($i = 1; $i <= $affordable; $i++) {\n\t\t\tif ($i == 1) {\n\t\t\t\t$ddm .= \"<option value=\\\"$i\\\">Buy $i tickets</option>\";\n\t\t\t} else {\n\t\t\t\t$ddm .= \"<option value=\\\"$i\\\">Buy $i tickets</option>\";\n\t\t\t}\n\t\t}\n\t\t$ddm .= \"</select>\";\n\t} else {\n\t\t// Poor user.\n\t\t$ddm = \"You can not afford any credits.\";\n\t}\n\n\t// Create the table.\n\t$table = new table(2, true);\n\t$table->addHeader(\">> Buy lotto credits\");\n\t$table->addRow();\n\t$table->addCol(\"Here you can buy lotto tickets for 1.000.000,00 ISK each. \" .\n\t\"Your account currently holds \" . number_format($myMoney, 2) . \" ISK, so \" .\n\t\"you can afford $affordable tickets. Please choose the amount of credits you wish \" .\n\t\"to buy.\", array (\n\t\t\"colspan\" => 2\n\t));\n\n\t$table->addRow();\n\t$table->addCol(\"Your credits:\");\n\t$table->addCol($Credits);\n\t$table->addRow();\n\t$table->addCol(\"Total spent credits:\");\n\t$table->addCol($CreditsSpent);\n\t$table->addRow();\n\t$table->addCol(\"Purchase this many credits:\");\n\t$table->addCol($ddm);\n\t$table->addHeaderCentered(\"<input type=\\\"submit\\\" name=\\\"submit\\\" value=\\\"Buy credits\\\">\");\n\t$table->addRow(\"#060622\");\n\t$table->addCol(\"[<a href=\\\"index.php?action=lotto\\\">Cancel request</a>]\", array (\n\t\t\"colspan\" => 2\n\t));\n\n\t// Add some more html form stuff.\n\t$html = \"<h2>Buy Lotto credits</h2>\";\n\t$html .= \"<form action=\\\"index.php\\\" method=\\\"POST\\\">\";\n\t$html .= $table->flush();\n\t$html .= \"<input type=\\\"hidden\\\" name=\\\"check\\\" value=\\\"true\\\">\";\n\t$html .= \"<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"lottoBuyCredits\\\">\";\n\t$html .= \"</form>\";\n\n\t// Return the mess we made.\n\treturn ($html);\n}", "public function sCreateTemporaryOrder()\n {\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ? $this->sShippingData['AmountNumeric'] : '0';\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n $net = '0';\n if ($this->isTaxFree(\n $this->sSYSTEM->sUSERGROUPDATA['tax'],\n $this->sSYSTEM->sUSERGROUPDATA['id']\n )) {\n $net = '1';\n }\n\n $dispatchId = '0';\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n if (empty($this->sBasketData['AmountWithTaxNumeric'])) {\n $this->sBasketData['AmountWithTaxNumeric'] = '0';\n }\n if (empty($this->sBasketData['AmountNetNumeric'])) {\n $this->sBasketData['AmountNetNumeric'] = '0';\n }\n\n $data = [\n 'ordernumber' => '0',\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => $this->sShippingcostsNumericNet,\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'status' => -1,\n 'paymentID' => $this->getPaymentId(),\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $this->getSession()->offsetGet('sPartner'),\n 'temporaryID' => $this->getSession()->offsetGet('sessionId'),\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'deviceType' => $this->deviceType,\n ];\n\n try {\n $affectedRows = $this->db->insert('s_order', $data);\n $orderID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf('##sOrder-sTemporaryOrder-#01:%s', $e->getMessage()), 0, $e);\n }\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception('##sOrder-sTemporaryOrder-#01: No rows affected or no order id saved', 0);\n }\n\n // Create order attributes\n $this->attributePersister->persist($this->orderAttributes, 's_order_attributes', $orderID);\n\n foreach ($this->sBasketData['content'] as $basketRow) {\n if (!$basketRow['price']) {\n $basketRow['price'] = '0,00';\n }\n\n $basketRow['articlename'] = html_entity_decode($basketRow['articlename']);\n $basketRow['articlename'] = strip_tags($basketRow['articlename']);\n\n $basketRow['articlename'] = $this->sSYSTEM->sMODULES['sArticles']->sOptimizeText($basketRow['articlename']);\n\n if (!$basketRow['esdarticle']) {\n $basketRow['esdarticle'] = '0';\n }\n if (!$basketRow['modus']) {\n $basketRow['modus'] = '0';\n }\n if (!$basketRow['taxID']) {\n $basketRow['taxID'] = '0';\n }\n if (!$basketRow['releasedate']) {\n $basketRow['releasedate'] = '0000-00-00';\n }\n\n $data = [\n 'orderID' => $orderID,\n 'ordernumber' => 0,\n 'articleID' => $basketRow['articleID'],\n 'articleDetailID' => $basketRow['additional_details']['articleDetailsID'],\n 'articleordernumber' => $basketRow['ordernumber'],\n 'price' => $basketRow['priceNumeric'],\n 'quantity' => $basketRow['quantity'],\n 'name' => $basketRow['articlename'],\n 'status' => 0,\n 'releasedate' => $basketRow['releasedate'],\n 'modus' => $basketRow['modus'],\n 'esdarticle' => $basketRow['esdarticle'],\n 'taxID' => $basketRow['taxID'],\n 'tax_rate' => $basketRow['tax_rate'],\n ];\n\n try {\n $this->db->insert('s_order_details', $data);\n $orderDetailId = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(\n sprintf('##sOrder-sTemporaryOrder-Position-#02:%s', $e->getMessage()),\n 0,\n $e\n );\n }\n\n // Create order detail attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderDetailId);\n } // For every product in basket\n }", "public function created(Order $order)\n {\n // get the service points cost\n// $serviceCost = $order->service->on_sale ? $order->service->sale_points : $order->service->points;\n // check if the current balance > service points cost\n// $userBalance = $order->client->balance->points;\n// if ($userBalance > $serviceCost && ($userBalance - $serviceCost > 0)) {\n $client = $order->client()->first();\n// $finalBalance = $userBalance - $serviceCost;\n// $client->balance()->first()->update(['points' => $finalBalance]);\n $order->update(['is_paid' => true]);\n // automatically create a job once order is paid\n $order->job()->create();\n $settings = Setting::first();\n return Mail::to($client->email)->cc($settings->info_email)->cc($settings->sales_email)->send(new OrderComplete($order, $client));\n\n// } else {\n// $order->update(['is_paid' => false, 'active' => false]);\n// }\n }", "private function saveOrder() {\n $currentDate = new Zend_Date();\n $customer = Customer::findByEmail($this->getRequest()->getParam('email'));\n $customer->name = $this->getRequest()->getParam('name');\n $customer->phone = $this->getRequest()->getParam('phone');\n\n $ord = new Order();\n $ord->Customer = $customer;\n $ord->date = $currentDate->get();\n //TODO Take product id from param and check if it is available (not in future, still on sales, etc)\n $product = Product::getCurrentProduct();\n $ord->Product = $product;\n $customer->save();\n $ord->save();\n $product->takeFromStock();\n $customer->sendOrderNotification($ord);\n }", "public function test_order_with_successful_response()\n {\n $token = $this->authenticate();\n\n $product = Product::factory()->create(['available_stock' => 50]);\n\n $response = $this->post(\n '/api/order',\n [\n 'product_id' => $product->id,\n 'quantity' => 1,\n ],\n [\n 'Authorization' => sprintf('Bearer %s', $token),\n 'Accept' => 'application/json',\n ]\n );\n\n $response->assertStatus(201)\n ->assertExactJson(['message' => 'You have sucessfully ordered this product.']);\n }", "private function sellTrasactionAddsMoney(){\n\n }", "public function make_order_directly(Request $request)\n {\n $product_id = $request->input('product_id');\n $order_type = $request->input('order_type');\n $total_count = $request->input('total_count');\n\n $delivery_type = $request->input('delivery_type');\n\n $count_per = $custom_date = null;\n if ($delivery_type == DeliveryType::DELIVERY_TYPE_EVERY_DAY || $delivery_type == DeliveryType::DELIVERY_TYPE_EACH_TWICE_DAY) {\n $count_per = $request->input('count_per');\n } else {\n $custom_date = $request->input('custom_date');\n $custom_date = rtrim($custom_date, ',');\n }\n\n $factory_id = session('factory_id');\n $factory = Factory::find($factory_id);\n\n $wxuser_id = session('wechat_user_id');\n\n $wxuser = WechatUser::find($wxuser_id);\n\n $customer_id = $wxuser->customer_id;\n\n $address = session('address');\n\n $product_price_template = ProductPrice::priceTemplateFromAddress($product_id, $address);\n\n if (!$product_price_template) {\n //give temp product price\n $product_price_template = ProductPrice::where('product_id', $product_id)->get()->first();\n }\n\n\n if ($order_type == OrderType::ORDER_TYPE_MONTH) {\n $product_price = $product_price_template->month_price;\n } else if ($order_type == OrderType::ORDER_TYPE_SEASON) {\n $product_price = $product_price_template->season_price;\n } else {\n //half year price\n $product_price = $product_price_template->half_year_price;\n }\n\n $total_amount = $total_count * $product_price;\n\n// $today_date = new DateTime(\"now\", new DateTimeZone('Asia/Shanghai'));\n// $gap_day = intval($factory->gap_day);\n// $start_at = $today_date->modify(\"+\" . $gap_day . \" days\");\n// $start_at = $start_at->format('Y-m-d');\n\n $start_at = $request->input('start_at');\n $start_at = new DateTime($start_at);\n $start_at = $start_at->format('Y-m-d');\n\n $group_id = $this->get_new_group_id();\n\n //add wechat order products\n $wcop = new WechatOrderProduct;\n $wcop->wxuser_id = $wxuser_id;\n $wcop->factory_id = $factory_id;\n $wcop->product_id = $product_id;\n $wcop->order_type = $order_type;\n $wcop->delivery_type = $delivery_type;\n $wcop->total_count = $total_count;\n $wcop->product_price = $product_price;\n\n if ($count_per)\n $wcop->count_per_day = $count_per;\n else\n $wcop->custom_date = $custom_date;\n\n $wcop->total_amount = $total_amount;\n $wcop->start_at = $start_at;\n $wcop->group_id = $group_id;\n $wcop->save();\n\n //save group id for this direct order\n session(['group_id' => $group_id]);\n\n $verified = session('verified');\n\n if ($verified == \"no\") {\n //this user needs to be phone number verified\n return response()->json(['status' => 'fail', 'redirect_path' => 'phone_verify']);\n }\n\n return response()->json(['status' => 'success']);\n }", "public function wc_new_order( $order_id ) {\n\n\t\tadd_post_meta( $order_id, 'decred_amount', WC()->session->get( 'decred_amount' ) );\n\n\t\tadd_post_meta( $order_id, 'decred_refund_address', WC()->session->get( 'decred_refund_address' ) );\n\n\t\tadd_post_meta( $order_id, 'decred_payment_address', $this->get_payment_address( $order_id ) );\n\n\t\tif ( ! wp_next_scheduled( 'decred_order_status_updater' ) ) {\n\t\t\twp_schedule_event( time(), 'decred_schedule', 'decred_order_status_updater' );\n\t\t}\n\n\t}", "public function webhookorderTest(){\n $this->load->helper('ExactOnline/vendor/autoload');\n $this->load->model('Exactonline_model');\n $this->load->model('Projects_model');\n $this->load->model('Shopify_exact_model');\n $this->load->library('Shopify_restapi');\n\n /* $config = array(\n 'ShopUrl' => 'apicenter-test-2.myshopify.com',\n 'ApiKey' => '9ba09555deb3a02fba7208d2cd42ca84',\n 'Password' => '037c38bad76b335497d754c409f43daf',\n );*/\n\n //Client ShopiFy Setting\n $config = array(\n 'ShopUrl' => 'https://exactconn.myshopify.com/',\n 'ApiKey' => '7beb4f06ebfb668b5399f8775b88dcd6',\n 'Password' => '3ef3d1b719cdbb10627133d3af34b40c',\n );\n \n\n //Our Testing ShopiFy Setting\n /*$config = array(\n 'ShopUrl' => 'https://apicenter-test-3.myshopify.com',\n 'ApiKey' => '8686082b5262e11898e22cbb25444fae',\n 'Password' => 'd22bb562a0ba2226952db2f2fb4b45de',\n );*/\n\n\n /* $config = array(\n 'ShopUrl' => 'https://apicenter-test-4.myshopify.com',\n 'ApiKey' => '9a78f517e2891ecbb279a12e1ba5df38',\n 'Password' => '7e87f630f772ca4032571c1098cce187',\n );*/\n\n // $config = array(\n // 'ShopUrl' => 'https://lakecycledemo.myshopify.com/',\n // 'ApiKey' => '92aba655ba402354cce41ca9d8362436',\n // 'Password' => '91f7057b4733c5e2164f9b585ad79e55',\n // );\n \n //$ordersData = $this->shopify_restapi->getOrderById($config,'613396512866');\n $ordersData = $this->shopify_restapi->getOrderById($config,'613396512866');\n // $orders = $this->shopify_restapi->testGetOrders($config);\n // $customers = $this->shopify_restapi->testGetCustomers($config);\n // echo \"<pre>\";\n // print_r($ordersData);\n //print_r($customers);\n if ($ordersData['status']==1) {\n $orderData = $ordersData['data'];\n } else{\n die();\n }\n // echo \"<pre>\";\n // print_r($ordersData);\n // die();\n $projectId = 37;\n $this->Exactonline_model->setData(\n array(\n 'projectId' => $projectId,\n 'redirectUrl' => $this->Projects_model->getValue('exactonline_redirect_url', $projectId),\n 'clientId' => $this->Projects_model->getValue('exactonline_client_id', $projectId),\n 'clientSecret' => $this->Projects_model->getValue('exactonline_secret_key', $projectId),\n )\n );\n\n $connection = $this->Exactonline_model->makeConnection($projectId);\n if ($connection) {\n if($orderData['financial_status'] == 'paid'){\n $sendOrder = $this->Shopify_exact_model->sendOrder($connection, $projectId, $orderData);\n print_r($sendOrder);\n $totalOrderImportSuccess = $this->Projects_model->getValue('total_orders_import_success', $projectId)?$this->Projects_model->getValue('total_orders_import_success', $projectId):0;\n $totalOrderImportError = $this->Projects_model->getValue('total_orders_import_error', $projectId)?$this->Projects_model->getValue('total_orders_import_error', $projectId):0;\n if($sendOrder['status']==0){\n $totalOrderImportError++;\n } else{\n $totalOrderImportSuccess++;\n }\n $this->Projects_model->saveValue('total_orders_import_success', $totalOrderImportSuccess, $projectId);\n $this->Projects_model->saveValue('total_orders_import_error', $totalOrderImportError, $projectId);\n project_error_log($projectId, 'exportorders',$sendOrder['message']);\n echo \"<pre>\";\n print_r($sendOrder);\n echo \"string\";\n die();\n }\n }\n }", "function xtestLive(){\n $this->clearAll();\n \n $seller = $this->createUser('seller');\n $evt = $this->createEvent('Quebec CES' , $seller->id, $this->createLocation()->id, date('Y-m-d', strtotime(\"+1 day\")) );\n $this->setEventId($evt, 'aaa');\n $cat = $this->createCategory('Verde', $evt->id, 10.00);\n \n \n \n //Transaction setup\n $foo = $this->createUser('foo');\n \n //let's buy\n $buyer = new \\WebUser($this->db);\n $buyer->login($foo->username);\n\n //let's pay\n Utils::clearLog();\n \n $buyer->addToCart($cat->id, 3); //cart in session\n \n $data = $this->getCCPurchaseData();\n //$data['street'] = 'N ' . $data['street']; //fail avs\n $data['cc_cvd'] = '666'; //fail cvd \n \n $payer = $this->createInstance('foo');\n $payer->setData($data);\n $payer->setCart($buyer->getCart());\n //$payer->amount_override = '0.25'; //hardcoded fail\n $payer->process();\n \n $this->assertFalse($payer->success()); \n }", "function ciniki_poma_queueDepositAdd(&$ciniki, $tnid, $args) {\n\n //\n // Load tenant settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'intlSettings');\n $rc = ciniki_tenants_intlSettings($ciniki, $tnid);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $intl_timezone = $rc['settings']['intl-default-timezone'];\n\n //\n // Look for an open order today or next 7 days\n //\n $sdt = new DateTime('now', new DateTimezone($intl_timezone));\n $edt = clone $sdt;\n $edt->add(new DateInterval('P8D'));\n $strsql = \"SELECT dates.id, \"\n . \"DATE_FORMAT(dates.order_date, '%Y-%m-%d') AS order_date, \"\n . \"IFNULL(orders.id, 0) AS order_id, \"\n . \"IFNULL(orders.flags, 0) AS order_flags, \"\n . \"IFNULL(orders.status, 0) AS order_status, \"\n . \"IFNULL(orders.payment_status, 0) AS payment_status \"\n . \"FROM ciniki_poma_order_dates AS dates \"\n . \"LEFT JOIN ciniki_poma_orders AS orders ON (\"\n . \"dates.id = orders.date_id \"\n . \"AND orders.customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND orders.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \") \"\n . \"WHERE dates.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND dates.order_date >= '\" . ciniki_core_dbQuote($ciniki, $sdt->format('Y-m-d')) . \"' \"\n . \"AND dates.order_date < '\" . ciniki_core_dbQuote($ciniki, $edt->format('Y-m-d')) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.poma', 'date');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $order_id = 0;\n $date_id = 0;\n $order_flags = 0;\n if( isset($rc['rows']) ) {\n foreach($rc['rows'] as $date) {\n if( $date_id == 0 && $date['order_date'] != $sdt->format('Y-m-d') ) {\n $date_id = $date['id'];\n }\n if( isset($date['order_id']) && $date['order_id'] > 0 && $date['order_status'] <= 10 && $date['payment_status'] < 50 ) {\n $order_id = $date['order_id'];\n $order_flags = $date['order_flags'];\n break;\n }\n }\n }\n\n //\n // No order or date then cannot add deposit\n //\n if( $order_id == 0 && $date_id == 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.poma.160', 'msg'=>'No order date available for deposit'));\n }\n\n //\n // Add new order, or get the last line number of the existing order\n //\n $max_line_number = 0;\n if( $order_id == 0 ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'newOrderForDate');\n $rc = ciniki_poma_newOrderForDate($ciniki, $tnid, array(\n 'checkdate'=>'no',\n 'customer_id'=>$args['customer_id'],\n 'date_id'=>$date_id,\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $order_id = $rc['order']['id'];\n $order_flags = 0;\n } else {\n //\n // Get the max line number for order\n //\n $strsql = \"SELECT MAX(line_number) AS line_number \"\n . \"FROM ciniki_poma_order_items \"\n . \"WHERE order_id = '\" . ciniki_core_dbQuote($ciniki, $order_id) . \"' \"\n . \"AND parent_id = 0 \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.poma', 'date');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['order']['line_number']) ) {\n $max_line_number = $rc['order']['line_number'];\n }\n }\n \n //\n // Add the deposit\n //\n if( $order_id > 0 ) {\n $args['order_id'] = $order_id;\n $args['line_number'] = $max_line_number + 1;\n $args['flags'] = 0x40;\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.poma.orderitem', $args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n } \n\n //\n // Update the order totals\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'orderUpdateStatusBalance');\n $rc = ciniki_poma_orderUpdateStatusBalance($ciniki, $tnid, $order_id);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.poma');\n return $rc;\n }\n\n //\n // Update the flag to mail the order to the customer\n //\n if( ($order_flags&0x10) == 0 ) {\n $rc = ciniki_core_objectUpdate($ciniki, $tnid, 'ciniki.poma.order', $order_id, array('flags'=>$order_flags |= 0x10), 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.poma');\n return $rc;\n }\n }\n\n return array('stat'=>'ok');\n}", "public function buyOrder($r_id, $datum){\r\n \r\n require 'database.php';\r\n \r\n $sql = \"INSERT into orders (recipe_id, user_name, user_address, user_phone, `day_Order`) VALUES($r_id, '$_SESSION[user_name]', '$_SESSION[user_address]', '$_SESSION[user_phone]','$datum')\";\r\n $DB_con->exec($sql);\r\n\r\n header(\"Location: ./confirmationmsg.php\");\r\n }", "public function okAction() { \n $this->setSession();\n $this->setOrder($this->getOrderIdFromResponse());\n $this->setPayment();\n $this->checkHash($this->getPaymentHashFromResponse());\n $this->_session->getQuote()->setIsActive(false)->save();\n if ($this->isNewOrder()) {\n $this->_redirect('checkout/onepage/success', array('_secure'=>true)); \n } else {\n $this->loadLayout();\n $this->renderLayout(); \n } \n }", "function inquireTransaction() {\n\n $messageLog = \"\\n### Initiate ###\\n\";\n\n $fp = fopen('easypay_inquire.log', 'a');\n fwrite($fp, $messageLog);\n fclose($fp);\n\n\n $messageLog = \"\\n####### Inquire Api Start #######\\n\";\n echo \"\\nTime : \" . date(\"Y-m-d h:i:sa\") . \"\\n\";\n $messageLog .= \"\\nTime : \" . date(\"Y-m-d h:i:sa\") . \"\\n\";\n $data12['ep_live'] = $this->config->item('ep_live');\n\n // Create the context as you did in your test\n $context = stream_context_create(\n array(\n 'ssl' => array(\n 'verify_peer' => false,\n 'verify_peer_name' => false,\n 'allow_self_signed' => true\n )\n ));\n\n if ($data12['ep_live'] == 'no') {\n\n $client = new SoapClient(\"https://easypaystg.easypaisa.com.pk/easypay-service/PartnerBusinessService/META-INF/wsdl/partner/transaction/PartnerBusinessService.wsdl\", array(\"classmap\" => $this->classmap,\n \"location\" => \"https://easypaystg.easypaisa.com.pk/easypay-service/PartnerBusinessService\",\n \"trace\" => true,\n \"exceptions\" => true,\n \"stream_context\" => $context\n ));\n\n $client->__setLocation(\"https://easypaystg.easypaisa.com.pk/easypay-service/PartnerBusinessService\");\n } else {\n $client = new SoapClient(\"https://easypay.easypaisa.com.pk/easypay-service/PartnerBusinessService/META-INF/wsdl/partner/transaction/PartnerBusinessService.wsdl\", array(\"classmap\" => $this->classmap,\n \"location\" => \"https://easypay.easypaisa.com.pk/easypay-service/PartnerBusinessService\",\n \"trace\" => true,\n \"exceptions\" => true,\n \"stream_context\" => $context\n ));\n $client->__setLocation(\"https://easypay.easypaisa.com.pk/easypay-service/PartnerBusinessService\");\n }\n\n\n echo '<br> Fetching transaction log data ...';\n $messageLog .=\"\\nFetching transaction log data of pending status ...\";\n $transactionLog = $this->db->query(\"SELECT * FROM `transaction_log` WHERE status = 'pending' AND row_status = 'active' \");\n\n if ($transactionLog->num_rows() > 0) {\n echo \"<br> data found\";\n $messageLog .= \"\\n data found\";\n $transactionLogData = $transactionLog->result_array();\n\n foreach ($transactionLogData as $key => $value) {\n// echo '<pre>';\n// echo '<br> Key : ' . $key . '';\n// echo '<br> Unique Id : ' . $value['order_unique_id'] . '<br>';\n// print_r($value);\n\n if ($data12['ep_live'] == 'no') {\n $inquireResponse = $client->__soapCall(\"inquireTransaction\", array(\"inquireTransactionRequestType\" => array(\n \"username\" => \"skillorbit\",\n \"password\" => \"472ef47c0d9a99d14ec5ed4a7f0a0053\",\n \"orderId\" => $value['order_unique_id'],\n \"accountNum\" => \"20074\"\n )));\n } else {\n $inquireResponse = $client->__soapCall(\"inquireTransaction\", array(\"inquireTransactionRequestType\" => array(\n \"username\" => \"kueball\",\n \"password\" => \"dab72e2062b7d094123288f6de4f844f\",\n \"orderId\" => $value['order_unique_id'],\n \"accountNum\" => \"54818908\"\n )));\n }\n\n\n echo '<br>checking response ';\n $messageLog .= \"\\n checking soap api response of order id : \" . $value['order_unique_id'];\n echo '<br>inquireResponse->responseCode : ', $inquireResponse->responseCode;\n\n// echo '<pre>';\n// print_r($inquireResponse);\n\n if ($inquireResponse->responseCode == 0000) {\n echo '<br>success ';\n $messageLog .= \"\\n success \";\n\n $messageLog .= \"\\n checking transaction status is \" . $inquireResponse->transactionStatus;\n if ($inquireResponse->transactionStatus == 'PAID') {\n\n\n $messageLog .= \"\\nfetching from transaction log...\\n\";\n\n $forOrderDetails = $this->db->query(\"SELECT * FROM `transaction_log` WHERE order_unique_id = '\" . $inquireResponse->orderId . \"' \");\n\n if ($forOrderDetails->num_rows() > 0) {\n $messageLog .= \"\\nqueryOneData : Found\\n\";\n\n $orderDetails = $forOrderDetails->result_array()[0];\n $tlId = $orderDetails['id'];\n $type = $orderDetails['event'];\n $tStatus = $orderDetails['status'];\n// $orderDetails = $forPackageID->result_array()[0];\n\n $messageLog .= \"\\n\\n\" . print_r($orderDetails, TRUE);\n $messageLog .= \"\\nType : \" . $type . \"\\n\";\n// $message .= \"\\nBrandId : \" . $brandID . \"\\n\";\n $transactionId = $inquireResponse->transactionId;\n\n// $paykey = strtolower($data->order_id);\n $paykey = $inquireResponse->orderId;\n\n// \n if ($type == 'campaign') {\n\n $messageLog .= \"\\n Category : Campaign\";\n\n $senderId = $orderDetails['sender_entity_id'];\n $infUserId = $orderDetails['inf_user_id'];\n $recieverId = $orderDetails['receiver_entity_id'];\n $behalfOfRecieverId = $orderDetails['behalf_of_receiver_entity_id'];\n $campId = $orderDetails['campaign_id'];\n $statusForUpdate = $orderDetails['status_for_update'];\n\n $messageLog .= \"\\n Transaction Status in db : \" . $tStatus . \"\\n\";\n if ($tStatus != 'success') {\n\n// making data \n $messageLog .= \"\\n making data for entries...\\n\";\n\n $data1['sender_entity_id'] = $senderId;\n $data1['campaign_id'] = $campId;\n// $recieverId\n $data1['receiver_entity_id'] = ($behalfOfRecieverId == NULL || $behalfOfRecieverId == \"\" ? $recieverId : $behalfOfRecieverId);\n// $behalfOfRecieverId\n $data1['behalf_of_receiver_entity_id'] = ($behalfOfRecieverId == null || $behalfOfRecieverId == \"\" ? null : $recieverId);\n $data1['paykey'] = $paykey;\n// $data1['receiver_invoice'] = 0;\n $date = date_create();\n $data1['transaction_date'] = date_timestamp_get($date);\n $data1['transaction_status'] = \"success\";\n $data1['transaction_type'] = \"auto_paid\";\n// $data1['transaction_type'] = date(\"Y-m-d H:i:s\");\n $data1['amount_paid'] = $inquireResponse->transactionAmount;\n// $data1['setup_currency_id'] = NULL;\n $data1['transaction_id'] = $transactionId;\n $data1['row_status'] = 'active';\n// \n// \n $data2['campaign_payment_status'] = $statusForUpdate;\n// $data2['campaign_payment_status'] = \"escrow_paid_scxn\";\n\n $data3['status'] = \"success\";\n\n $messageLog .= \"\\n transactions begins...\\n\";\n $this->db->trans_begin();\n\n $this->db->insert('campaigns_transactions', $data1);\n\n\n $array2 = array('campaign_id' => $campId, 'user_id' => $infUserId, 'row_status' => 'active');\n $this->db->where($array2);\n $this->db->update('campaigns_offered_influencers', $data2);\n\n $array3 = array('id' => $tlId);\n $this->db->where($array3);\n $this->db->update('transaction_log', $data3);\n\n if ($this->db->trans_status() === FALSE) {\n $this->db->trans_rollback();\n $messageLog .= \"\\n status : transaction rollback...\\n\";\n// echo 'false';\n } else {\n $this->db->trans_commit();\n $messageLog .= \"\\n status : transaction commit...\\n\";\n }\n }\n }\n// \n else {\n $messageLog .= \"\\n Category : Not Found\\n\";\n }\n } else {\n $messageLog .= \"\\n queryOneData : Not Found\\n\";\n }\n } elseif ($inquireResponse->transactionStatus == 'PENDING' || $inquireResponse->transactionStatus == 'INITIATED') {\n\n $messageLog .= \"\\n nothing to do \\n\";\n } elseif ($inquireResponse->transactionStatus == 'EXPIRED' || $inquireResponse->transactionStatus == 'CANCELLED' || $inquireResponse->transactionStatus == 'REVERSED' || $inquireResponse->transactionStatus == 'FAILED' || $inquireResponse->transactionStatus == 'DROPPED' || $inquireResponse->transactionStatus == 'BLOCKED') {\n\n echo \"<br> http request\";\n// $messageLog .= \"\\n http request for token\";\n// $url = 'http://localhost:3000/api/v1.1.0/transactionToken';\n $url = $this->config->item('api_url') . 'api/v1.1.0/transactionToken';\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_URL, $url);\n $output = curl_exec($curl);\n curl_close($curl);\n\n $data = json_decode($output);\n\n// $messageLog .= \"\\n\\n\" . print_r($data, TRUE);\n// echo \"<pre>\";\n// print_r($data);\n// print_r($value);\n $token = $data->genericResponse->genericBody->data->token;\n// echo '<br> token : ' . $token;\n\n $data1['prefix'] = $value['prefix'];\n $data1['sender_entity_id'] = $value['sender_entity_id'];\n $data1['behalf_of_sender_entity_id'] = $value['behalf_of_sender_entity_id'];\n $data1['campaign_id'] = $value['campaign_id'];\n $data1['inf_user_id'] = $value['inf_user_id'];\n $data1['receiver_entity_id'] = $value['receiver_entity_id'];\n $data1['behalf_of_receiver_entity_id'] = $value['behalf_of_receiver_entity_id'];\n $data1['status_for_update'] = $value['status_for_update'];\n $data1['event'] = $value['event'];\n $data1['order_unique_id'] = $token;\n $data1['status'] = 'pending';\n $data1['created_by'] = $value['created_by'];\n $data1['row_status'] = 'active';\n// \n $data2['status'] = strtolower($inquireResponse->transactionStatus);\n $data2['row_status'] = \"inactive\";\n\n $messageLog .= \"\\n transactions begins...\\n\";\n $this->db->trans_begin();\n\n $this->db->insert('transaction_log', $data1);\n\n\n $array2 = array('id' => $value['id']);\n $this->db->where($array2);\n $this->db->update('transaction_log', $data2);\n\n if ($this->db->trans_status() === FALSE) {\n $this->db->trans_rollback();\n $messageLog .= \"\\n status : transaction rollback...\\n\";\n// echo 'false';\n } else {\n $this->db->trans_commit();\n $messageLog .= \"\\n status : transaction commit...\\n\";\n }\n } else {\n \n }\n } elseif ($inquireResponse->responseCode == 0001) {\n\n echo '<br> system error ';\n $messageLog .= \"\\n system error \";\n } elseif ($inquireResponse->responseCode == 0002) {\n\n echo '<br>required field is missing ';\n $messageLog .= \"\\n required field is missing \";\n } else {\n// $inquireResponse->responseCode == 0003\n echo '<br>invalid order ID or may not initiated ';\n $messageLog .= \"\\n invalid order ID or may not initiated \";\n }\n }\n } else {\n echo 'no data found';\n $messageLog .= \"\\n no data found\";\n }\n\n $messageLog .= \"\\n####### Inquire Api End #######\\n\";\n\n $fp = fopen('easypay_inquire.log', 'a');\n fwrite($fp, $messageLog);\n fclose($fp);\n }", "function successful_request($atos_response) {\n\t\t\tglobal $woocommerce;\n\n\t\t\tif (isset($atos_response)) {\n\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tswitch ($atos_response['code_reponse']) {\n\t\t\t\t\t\t// transaction authorised\n\t\t\t\t\t\tcase 'ok':\n\t\t\t\t\t\t\t$transauthorised = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$transauthorised = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tif ($transauthorised == true) {\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t// put code here to update/store the order with the a successful transaction result\n\t\t\t\t\t\t$order_id \t \t= $atos_response['order_id'];\n\t\t\t\t\t\t$order = &new WC_Order( $order_id );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif ($order->status !== 'completed') {\n\t\t\t\t\t\t\tif ($order->status == 'processing') {\n\t\t\t\t\t\t\t\t// This is the second call - do nothing\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$order->payment_complete();\n\t\t\t\t\t\t\t\t//Add admin order note\n\t\t\t\t\t\t\t\t$order->add_order_note('Paiement Atos: REUSSI<br><br>Référence Transaction: ' . $order_id);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$order->add_order_note('info<br><br>Response Code: ' . $atos_response['real_response_code'] . '<br> Bank Code:' . $atos_response['real_code']);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//Add customer order note\n\t\t\t\t\t\t\t\t$order->add_order_note('Paiement réussi','customer');\n\t\t\t\t\t\t\t\t// Empty the Cart\n\t\t\t\t\t\t\t\t$woocommerce->cart->empty_cart();\n\t\t\t\t\t\t\t\t//update order status\n\t\t\t\t\t\t\t\t$order->update_status('processing');\n\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\t// put code here to update/store the order with the a failed transaction result\n\t\t\t\t\t\t$order_id \t \t= $atos_response['order_id'];\n\t\t\t\t\t\t$order \t\t\t= new woocommerce_order( (int) $order_id );\t\t\t\t\t\n\t\t\t\t\t\t$order->update_status('failed');\n\t\t\t\t\t\t//Add admin order note\n\t\t\t\t\t\t$order->add_order_note('Paiement Atos: ECHEC<br><br>Référence Transaction: ' . $order_id);\n\t\t\t\t\t\t//Add customer order note\n\t\t\t\t\t\t$order->add_order_note('Paiement échoué','customer');\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t//$nOutputProcessedOK = 30;\n\t\t\t\t\t//$szOutputMessage = \"Error updating website system, please ask the developer to check code\";\n\t\t\t\t}\n\t\t\t\t//echo string back for gateway to read - this confirms the script ran correctly.\n\t\t\t\t//echo(\"StatusCode=\".$nOutputProcessedOK.\"&Message=\".$szOutputMessage);\n\t\t\t}\n\t\t}", "public function run()\n {\n $now = Carbon::now();\n GoogleCapcha::create(array(\n 'cap_key' \t=> \"6LdY6xcUAAAAAJ4Lc85npwZcx-3hmhAG3cFCRtLp\",\n 'cap_secret' => \"6LdY6xcUAAAAADSp1dBr02OGYXe0aCfDSr_koqXz\",\n 'email' \t=> \"[email protected]\",\n 'status' => \"inactive\",\n 'updated_at' => $now,\n 'created_at' => $now,\n 'created_by' => 1,\n 'modified_by' => 1\n ));\n }", "function saveOrder()\n\t\t{\n\t\t\tglobal $current_user, $wpdb, $pmpro_checkout_id;\n\n\t\t\t//get a random code to use for the public ID\n\t\t\tif(empty($this->code))\n\t\t\t\t$this->code = $this->getRandomCode();\n\n\t\t\t//figure out how much we charged\n\t\t\tif(!empty($this->InitialPayment))\n\t\t\t\t$amount = $this->InitialPayment;\n\t\t\telseif(!empty($this->subtotal))\n\t\t\t\t$amount = $this->subtotal;\n\t\t\telse\n\t\t\t\t$amount = 0;\n\n\t\t\t//Todo: Tax?!, Coupons, Certificates, affiliates\n\t\t\tif(empty($this->subtotal))\n\t\t\t\t$this->subtotal = $amount;\n\t\t\tif(isset($this->tax))\n\t\t\t\t$tax = $this->tax;\n\t\t\telse\n\t\t\t\t$tax = $this->getTax(true);\n\t\t\t$this->certificate_id = \"\";\n\t\t\t$this->certificateamount = \"\";\n\n\t\t\t//calculate total\n\t\t\tif(!empty($this->total))\n\t\t\t\t$total = $this->total;\n\t\t\telse {\n\t\t\t\t$total = (float)$amount + (float)$tax;\n\t\t\t\t$this->total = $total;\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t//these fix some warnings/notices\n\t\t\tif(empty($this->billing))\n\t\t\t{\n\t\t\t\t$this->billing = new stdClass();\n\t\t\t\t$this->billing->name = $this->billing->street = $this->billing->city = $this->billing->state = $this->billing->zip = $this->billing->country = $this->billing->phone = \"\";\n\t\t\t}\n\t\t\tif(empty($this->user_id))\n\t\t\t\t$this->user_id = 0;\n\t\t\tif(empty($this->paypal_token))\n\t\t\t\t$this->paypal_token = \"\";\n\t\t\tif(empty($this->couponamount))\n\t\t\t\t$this->couponamount = \"\";\n\t\t\tif(empty($this->payment_type))\n\t\t\t\t$this->payment_type = \"\";\n\t\t\tif(empty($this->payment_transaction_id))\n\t\t\t\t$this->payment_transaction_id = \"\";\n\t\t\tif(empty($this->subscription_transaction_id))\n\t\t\t\t$this->subscription_transaction_id = \"\";\n\t\t\tif(empty($this->affiliate_id))\n\t\t\t\t$this->affiliate_id = \"\";\n\t\t\tif(empty($this->affiliate_subid))\n\t\t\t\t$this->affiliate_subid = \"\";\n\t\t\tif(empty($this->session_id))\n\t\t\t\t$this->session_id = \"\";\n\t\t\tif(empty($this->accountnumber))\n\t\t\t\t$this->accountnumber = \"\";\n\t\t\tif(empty($this->cardtype))\n\t\t\t\t$this->cardtype = \"\";\n\t\t\tif(empty($this->expirationmonth))\n\t\t\t\t$this->expirationmonth = \"\";\n\t\t\tif(empty($this->expirationyear))\n\t\t\t\t$this->expirationyear = \"\";\n\t\t\tif(empty($this->ExpirationDate))\n\t\t\t\t$this->ExpirationDate = \"\";\n\t\t\tif (empty($this->status))\n\t\t\t\t$this->status = \"\";\n\n\t\t\tif(empty($this->gateway))\n\t\t\t\t$this->gateway = pmpro_getOption(\"gateway\");\n\t\t\tif(empty($this->gateway_environment))\n\t\t\t\t$this->gateway_environment = pmpro_getOption(\"gateway_environment\");\n\n\t\t\tif(empty($this->datetime) && empty($this->timestamp))\n\t\t\t\t$this->datetime = date(\"Y-m-d H:i:s\", time());\n\t\t\telseif(empty($this->datetime) && !empty($this->timestamp) && is_numeric($this->timestamp))\n\t\t\t\t$this->datetime = date(\"Y-m-d H:i:s\", $this->timestamp);\t//get datetime from timestamp\n\t\t\telseif(empty($this->datetime) && !empty($this->timestamp))\n\t\t\t\t$this->datetime = $this->timestamp;\t\t//must have a datetime in it\n\n\t\t\tif(empty($this->notes))\n\t\t\t\t$this->notes = \"\";\n\n\t\t\tif(empty($this->checkout_id) || intval($this->checkout_id)<1) {\n\t\t\t\t$highestval = $wpdb->get_var(\"SELECT MAX(checkout_id) FROM $wpdb->pmpro_membership_orders\");\n\t\t\t\t$this->checkout_id = intval($highestval)+1;\n\t\t\t\t$pmpro_checkout_id = $this->checkout_id;\n\t\t\t}\n\n\t\t\t//build query\n\t\t\tif(!empty($this->id))\n\t\t\t{\n\t\t\t\t//set up actions\n\t\t\t\t$before_action = \"pmpro_update_order\";\n\t\t\t\t$after_action = \"pmpro_updated_order\";\n\t\t\t\t//update\n\t\t\t\t$this->sqlQuery = \"UPDATE $wpdb->pmpro_membership_orders\n\t\t\t\t\t\t\t\t\tSET `code` = '\" . $this->code . \"',\n\t\t\t\t\t\t\t\t\t`session_id` = '\" . $this->session_id . \"',\n\t\t\t\t\t\t\t\t\t`user_id` = \" . intval($this->user_id) . \",\n\t\t\t\t\t\t\t\t\t`membership_id` = \" . intval($this->membership_id) . \",\n\t\t\t\t\t\t\t\t\t`paypal_token` = '\" . $this->paypal_token . \"',\n\t\t\t\t\t\t\t\t\t`billing_name` = '\" . esc_sql($this->billing->name) . \"',\n\t\t\t\t\t\t\t\t\t`billing_street` = '\" . esc_sql($this->billing->street) . \"',\n\t\t\t\t\t\t\t\t\t`billing_city` = '\" . esc_sql($this->billing->city) . \"',\n\t\t\t\t\t\t\t\t\t`billing_state` = '\" . esc_sql($this->billing->state) . \"',\n\t\t\t\t\t\t\t\t\t`billing_zip` = '\" . esc_sql($this->billing->zip) . \"',\n\t\t\t\t\t\t\t\t\t`billing_country` = '\" . esc_sql($this->billing->country) . \"',\n\t\t\t\t\t\t\t\t\t`billing_phone` = '\" . esc_sql($this->billing->phone) . \"',\n\t\t\t\t\t\t\t\t\t`subtotal` = '\" . $this->subtotal . \"',\n\t\t\t\t\t\t\t\t\t`tax` = '\" . $this->tax . \"',\n\t\t\t\t\t\t\t\t\t`couponamount` = '\" . $this->couponamount . \"',\n\t\t\t\t\t\t\t\t\t`certificate_id` = \" . intval($this->certificate_id) . \",\n\t\t\t\t\t\t\t\t\t`certificateamount` = '\" . $this->certificateamount . \"',\n\t\t\t\t\t\t\t\t\t`total` = '\" . $this->total . \"',\n\t\t\t\t\t\t\t\t\t`payment_type` = '\" . $this->payment_type . \"',\n\t\t\t\t\t\t\t\t\t`cardtype` = '\" . $this->cardtype . \"',\n\t\t\t\t\t\t\t\t\t`accountnumber` = '\" . $this->accountnumber . \"',\n\t\t\t\t\t\t\t\t\t`expirationmonth` = '\" . $this->expirationmonth . \"',\n\t\t\t\t\t\t\t\t\t`expirationyear` = '\" . $this->expirationyear . \"',\n\t\t\t\t\t\t\t\t\t`status` = '\" . esc_sql($this->status) . \"',\n\t\t\t\t\t\t\t\t\t`gateway` = '\" . $this->gateway . \"',\n\t\t\t\t\t\t\t\t\t`gateway_environment` = '\" . $this->gateway_environment . \"',\n\t\t\t\t\t\t\t\t\t`payment_transaction_id` = '\" . esc_sql($this->payment_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t`subscription_transaction_id` = '\" . esc_sql($this->subscription_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t`timestamp` = '\" . esc_sql($this->datetime) . \"',\n\t\t\t\t\t\t\t\t\t`affiliate_id` = '\" . esc_sql($this->affiliate_id) . \"',\n\t\t\t\t\t\t\t\t\t`affiliate_subid` = '\" . esc_sql($this->affiliate_subid) . \"',\n\t\t\t\t\t\t\t\t\t`notes` = '\" . esc_sql($this->notes) . \"',\n\t\t\t\t\t\t\t\t\t`checkout_id` = \" . intval($this->checkout_id) . \"\n\t\t\t\t\t\t\t\t\tWHERE id = '\" . $this->id . \"'\n\t\t\t\t\t\t\t\t\tLIMIT 1\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set up actions\n\t\t\t\t$before_action = \"pmpro_add_order\";\n\t\t\t\t$after_action = \"pmpro_added_order\";\n\t\t\t\t\n\t\t\t\t//only on inserts, we might want to set the expirationmonth and expirationyear from ExpirationDate\n\t\t\t\tif( (empty($this->expirationmonth) || empty($this->expirationyear)) && !empty($this->ExpirationDate)) {\n\t\t\t\t\t$this->expirationmonth = substr($this->ExpirationDate, 0, 2);\n\t\t\t\t\t$this->expirationyear = substr($this->ExpirationDate, 2, 4);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//insert\n\t\t\t\t$this->sqlQuery = \"INSERT INTO $wpdb->pmpro_membership_orders\n\t\t\t\t\t\t\t\t(`code`, `session_id`, `user_id`, `membership_id`, `paypal_token`, `billing_name`, `billing_street`, `billing_city`, `billing_state`, `billing_zip`, `billing_country`, `billing_phone`, `subtotal`, `tax`, `couponamount`, `certificate_id`, `certificateamount`, `total`, `payment_type`, `cardtype`, `accountnumber`, `expirationmonth`, `expirationyear`, `status`, `gateway`, `gateway_environment`, `payment_transaction_id`, `subscription_transaction_id`, `timestamp`, `affiliate_id`, `affiliate_subid`, `notes`, `checkout_id`)\n\t\t\t\t\t\t\t\tVALUES('\" . $this->code . \"',\n\t\t\t\t\t\t\t\t\t '\" . session_id() . \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->user_id) . \",\n\t\t\t\t\t\t\t\t\t \" . intval($this->membership_id) . \",\n\t\t\t\t\t\t\t\t\t '\" . $this->paypal_token . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql(trim($this->billing->name)) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql(trim($this->billing->street)) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->city) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->state) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->zip) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->country) . \"',\n\t\t\t\t\t\t\t\t\t '\" . cleanPhone($this->billing->phone) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->subtotal . \"',\n\t\t\t\t\t\t\t\t\t '\" . $tax . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->couponamount. \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->certificate_id) . \",\n\t\t\t\t\t\t\t\t\t '\" . $this->certificateamount . \"',\n\t\t\t\t\t\t\t\t\t '\" . $total . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->payment_type . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->cardtype . \"',\n\t\t\t\t\t\t\t\t\t '\" . hideCardNumber($this->accountnumber, false) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->expirationmonth . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->expirationyear . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->status) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->gateway . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->gateway_environment . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->payment_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->subscription_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->datetime) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->affiliate_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->affiliate_subid) . \"',\n\t\t\t\t\t\t\t\t\t\t'\" . esc_sql($this->notes) . \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->checkout_id) . \"\n\t\t\t\t\t\t\t\t\t )\";\n\t\t\t}\n\n\t\t\tdo_action($before_action, $this);\n\t\t\tif($wpdb->query($this->sqlQuery) !== false)\n\t\t\t{\n\t\t\t\tif(empty($this->id))\n\t\t\t\t\t$this->id = $wpdb->insert_id;\n\t\t\t\tdo_action($after_action, $this);\n\t\t\t\treturn $this->getMemberOrderByID($this->id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function complete()\n\t{\t\n\t\t// Get transaction ID returning from PayPal\n\t\t$hash = e(Input::get('hash'));\n\t\t// Find Transaction details from Database\n\t\t$order = BillingLog::findOrFail($hash);\n\t\t// Confirm Transation has been compleated\n\t\t$order->completed = 'true';\n\n\t\t$order->save();\n\n\t\t// Get Customer Email from database\n\t\t$confirmed_bill=$order['attributes'];\n\t\t$email = $confirmed_bill['email'];\n\t\t\n\t\t// Manufacturers Email and Phone\n\t\t$shopEmail = '[email protected]';\n\t\t$shopPhone = '12501112222'; // sample phone number\n\n\t\t// Send Customer an Invoice\n\t\tMail::send('emails.invoice', ['invoice'=>$confirmed_bill], function($message) use ($email)\n\t\t\t{\n\t\t\t $message->to($email, 'Cloud')->subject('Thank You!');\n\t\t\t});\n\n\t\t// Send Order to Manufacturer\n\t\tMail::send('emails.order', ['invoice'=>$confirmed_bill], function($message) use ($shopEmail)\n\t\t\t{\n\t\t\t $message->to($shopEmail, 'Cloud')->subject('New Order!');\n\t\t\t});\n\n\t\t// Send Text Message to Maufacturer\n\t\t$account_sid = $_ENV['TWILIO_ID']; \n\t\t$auth_token = $_ENV['TWILIO_AUTH']; \n\t\t$client = new Services_Twilio($account_sid, $auth_token); \n\t\t \n\t\t$client->account->messages->create(array( \n\t\t\t'To' => $shopPhone, \n\t\t\t'From' => \"+13345641913\", \n\t\t\t'Body' => \"You have a New Order from LittleHelper.Chainsaw, check your email.\", \n\t\t));\n\n\t\t// Takes Client to Thank You page\n\t\treturn View::make('buy/complete');\n\t}", "public function fulfill()\n {\n $this->status = true;\n\n $this->save();\n\n $this->user->notify(new OrderFulfilled($this));\n }", "public function CreateOrderInDatabaseCompleteHook()\n {\n // ------------------------------------------------------------------------\n if ($this->fieldNewsletterSignup && false == $this->fieldCanceled) {\n $sMail = $this->fieldUserEmail;\n $sUserId = $this->fieldDataExtranetUserId;\n // now signup user\n\n $oNewsletter = null;\n if (!empty($sUserId)) {\n // try to load by id\n $oNewsletter = TdbPkgNewsletterUser::GetNewInstance();\n if (false == $oNewsletter->LoadFromField('data_extranet_user_id', $sUserId)) {\n $oNewsletter = null;\n }\n }\n\n if (is_null($oNewsletter)) {\n $aData = array();\n $sNow = date('Y-m-d H:i:s');\n $aData['email'] = $sMail;\n $aData['data_extranet_salutation_id'] = $this->fieldAdrBillingSalutationId;\n $aData['lastname'] = $this->fieldAdrBillingLastname;\n $aData['firstname'] = $this->fieldAdrBillingFirstname;\n $aData['signup_date'] = $sNow;\n $aData['optin'] = '1';\n $aData['optin_date'] = $sNow;\n /**\n * There are different ways of opting in into the newsletter table:\n * - Subscribe on Website\n * - Subscribe on MyAccount page\n * - Subscribe while ordering\n * This information is now put into the optincode field.\n */\n $aData['optincode'] = 'signup-via-order-confirm-page';\n $aData['data_extranet_user_id'] = $sUserId;\n\n $oNewsletter = TdbPkgNewsletterUser::GetNewInstance($aData);\n\n $oNewsletter->AllowEditByAll(true);\n $oNewsletter->Save();\n TdbPkgNewsletterUser::GetInstanceForActiveUser(true);\n } elseif (false == $oNewsletter->fieldOptin) {\n $oNewsletter->AllowEditByAll(true);\n $oNewsletter->SaveFieldsFast(array('optincode' => 'signup-via-order-confirm-page', 'optin' => '1', 'optin_date' => date('Y-m-d H:i:s')));\n TdbPkgNewsletterUser::GetInstanceForActiveUser(true);\n }\n }\n parent::CreateOrderInDatabaseCompleteHook();\n }", "public function add_order()\n {\n if (isset($_SESSION['cart'])) {\n $total_cost = 0;\n $quantity = 0;\n $quaty = \"\";\n foreach ($_SESSION['cart'] as $id => $quaty) {\n $product = Data::find_by_id($id);\n $cost = $product->price * $quaty; // $quaty is quantity.\n $quantity += $quaty;\n $total_cost = $total_cost + $cost;\n }\n if ($quaty > 0) {\n echo \"<p class='text-light pl-2 pr-2 pb-0 m-0'> $quantity </p>\";\n }\n } else {\n echo \"<p class='text-light pl-2 pr-2 pb-0 m-0'> Empty</p>\";\n }\n }", "public function testApplyOrderWarehouseFulfillmentPlan()\n {\n }", "function deliverOrder($orderNum)\n\t\t{\n\t\t\t$db = dbConnect::getInstance();\n \t\t $mysqli = $db->getConnection();\n\t\t\t $query = \" update check_tb set status = '2' where id='\".$orderNum.\"' \"; \n $res=$mysqli->query($query) or die (mysqli_error($mysqli));\n $mysqli->query(\"CREATE EVENT updateStatus\".$orderNum.\" ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 MINUTE DO \n \tupdate check_tb set status = '1' where id='\".$orderNum.\"' ;\n \t\") or die (mysqli_error($mysqli));\n\t\t\tif($res)\n\t\t\t{\n\n\t\t\t\treturn true;\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\t\n\t\t\t}\n\t\t}", "public function create($debug = false) {\n\t\t\t$this->set('date', date('Ymd'));\n\t\t\t$this->set('time', date('His'));\n\t\t\treturn insert_orderhead($this->sessionid, $this->orderno, $this, $debug);\n\t\t}", "public function addNewOrder($newOrderVendorId, $newOrderUserId, $newOrderProductId, $newOrderProductQuantity, $newOrderTotal, $newOrderDeliveryAddress, $newOrderEmail, $newOrderPhoneNumber) {\n\n $newOrderTime = time(); // We generate the date and time the order has been created\n\n $query = $this->db->prepare(\"INSERT INTO `orders` (`order_partner_id`, `order_customer_id`, `order_product_id`, `order_product_quantity`, `order_total`, `order_delivery_address`, `order_email`, `order_phone_number`, `order_timestamp`, `order_processed`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\");\n\n $query->bindValue(1, $newOrderVendorId);\n $query->bindValue(2, $newOrderUserId);\n $query->bindValue(3, $newOrderProductId);\n $query->bindValue(4, $newOrderProductQuantity);\n $query->bindValue(5, $newOrderTotal);\n $query->bindValue(6, $newOrderDeliveryAddress);\n $query->bindValue(7, $newOrderEmail);\n $query->bindValue(8, $newOrderPhoneNumber);\n $query->bindValue(9, $newOrderTime);\n $query->bindValue(10, 0);\n\n try {\n\n $query->execute();\n\n } catch(PDOException $e) {\n die($e->getMessage());\n }\n }", "function order_success()\n{\n\n}", "public function testRepeatOrderNotAvailable() {\n $order = new Yourdelivery_Model_Order($this->placeOrder());\n $service = $order->getService();\n $service->setIsOnline(false);\n $service->save();\n $this->dispatch('/request_order/repeat?hash=' . $order->getHashtag());\n $this->assertResponseCode(406);\n $service->setIsOnline(true);\n $service->save();\n }", "function spawn_cron($gmt_time = 0)\n {\n }", "public function saveFailedOrder()\n {\n\t\t\n $this->validate();\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this->_prepareNewCustomerQuote();\n $isNewCustomer = true;\n break;\n default:\n $this->_prepareCustomerQuote();\n break;\n }\n//die('order is available');\n $service = Mage::getModel('sales/service_quote', $this->getQuote());\n $service->submitAll();\n\n if ($isNewCustomer) {\n try {\n $this->_involveNewCustomer();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n $this->_checkoutSession->setLastQuoteId($this->getQuote()->getId())\n ->setLastSuccessQuoteId($this->getQuote()->getId())\n ->clearHelperData();\n\n $order = $service->getOrder();\n if ($order) {\n Mage::dispatchEvent('checkout_type_onepage_save_order_after',\n array('order'=>$order, 'quote'=>$this->getQuote()));\n\n /**\n * a flag to set that there will be redirect to third party after confirmation\n * eg: paypal standard ipn\n */\n $redirectUrl = $this->getQuote()->getPayment()->getOrderPlaceRedirectUrl();\n /**\n * we only want to send to customer about new order when there is no redirect to third party\n */\n if (!$redirectUrl && $order->getCanSendNewEmailFlag()) {\n try {\n //$order->sendNewOrderEmail();\n\t\t\t\t\t//return $this;\n\t\t\t\t\t\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n // add order information to the session\n $this->_checkoutSession->setLastOrderId($order->getId())\n ->setRedirectUrl($redirectUrl)\n ->setLastRealOrderId($order->getIncrementId());\n\n // as well a billing agreement can be created\n $agreement = $order->getPayment()->getBillingAgreement();\n if ($agreement) {\n $this->_checkoutSession->setLastBillingAgreementId($agreement->getId());\n }\n }\n\n // add recurring profiles information to the session\n $profiles = $service->getRecurringPaymentProfiles();\n if ($profiles) {\n $ids = array();\n foreach ($profiles as $profile) {\n $ids[] = $profile->getId();\n }\n $this->_checkoutSession->setLastRecurringProfileIds($ids);\n // TODO: send recurring profile emails\n }\n\n Mage::dispatchEvent(\n 'checkout_submit_all_after',\n array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => $profiles)\n );\n\n return $this;\n }", "public static function insert_new_commission( $orders = array() )\n\t{\n\t\tglobal $wpdb;\n\n\t\tif ( empty( $orders ) ) return false;\n\n\t\t$table = $wpdb->prefix . \"pv_commission\";\n\n\t\t// Insert the time and default status 'due'\n\t\tforeach ( $orders as $key => $order ) {\n\t\t\t$orders[ $key ][ 'time' ] = $order['time'];\n\t\t\t$orders[ $key ][ 'status' ] = ( $order['total_due'] == 0 ) ? 'paid' : 'due';\n\t\t}\n\n\t\tforeach ( $orders as $key => $order ) {\n\t\t\t$where = array(\n\t\t\t\t'order_id' => $order[ 'order_id' ],\n\t\t\t\t'product_id' => $order[ 'product_id' ],\n\t\t\t\t'vendor_id' => $order[ 'vendor_id' ],\n\t\t\t\t'qty' => $order[ 'qty' ],\n\t\t\t);\n\t\t\t// Is the commission already paid? \n\t\t\t$count = TGS_Commission::check_commission_status( $order, 'paid' ); \n\n\t\t\tif ( $count == 0 ) { \n\t\t\t\t$update = $wpdb->update( $table, $order, $where );\n\t\t\t\tif ( !$update ) $insert = $wpdb->insert( $table, $order );\n\t\t\t}\n\n\t\t}\n\n\t\tdo_action( 'tgs_commissions_inserted', $orders );\n\t}", "private function firstTimer($user){\n // create new user and set search count;\n $this->redis->hSet(md5($user), \"cart_count\",1);\n $this->redis->hSet(md5($user).\":saved_carts\",0,\"Temp.\");\n }", "public function makeOrder(){\n\t\tsession_start();\n\n\t\t// prepares the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/purchase/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Authorization: ' . TOKEN));\n\n\t\t// send the request\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['id_user' => $_SESSION['id_user'], 'date' => date('Y-m-d')]));\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$insertId = json_decode($output,true)['insertId'];\n\n\t\t// decode the cookie into a php object\n\t\t$cart = json_decode($_COOKIE['cart'], true);\n\n\t\t// fill the contain table from the API with the products of the order\n\t\tforeach ($cart as $key => $product) {\n\t\t\t$this->addToOrder($product['quantity'], $insertId, $product['quantity']);\n\t\t}\n\n/*\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/user/status/bde_member\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t$bdeMembers = json_decode($output, true);\n\n\t\tvar_dump($bdeMembers);\n\n\t\t$emailMessage = \"L'utilisateur \" . $_SESSION['first_name'] . \" \" . $_SESSION['last_name'] . \" a passer une commande :\\n\";\n\t\t$total = 0;\n\t\tforeach ($cart as $key => $product) {\n\t\t\t$emailMessage = $emailMessage . \"\\t\" . $cart['name'] . \" : \" . $cart['quantity'] . \"\\n\";\n\t\t\t$total += $cart['price'] * $cart['quantity'];\n\t\t}\n\n\t\t$emailMessage = $emailMessage . \"Montant : \" . $total . \"€\";\n\n\t\techo $emailMessage;\n\n\t\tforeach ($bdeMembers as $key => $bdeMember) {\n\t\t\tmail('[email protected]', \"Commande n°\" . '1', 'test');\n\t\t}*/\n\n\t\t// deletes the cart cookie\n\n\t\t// erase the cookie\n\t\tunset($_COOKIE['cart']);\n \t\tsetcookie('cart', '', time() - 3600);\n\n \t\treturn redirect()->route('cart', 'success');\n\t}", "function add_work_order_quick($wo_ref, $loc_code, $units_reqd, $stock_id, $type, \n\t$date_, $memo_, $costs, $cr_acc, $labour, $cr_lab_acc)\n{\n\tglobal $Refs;\n\n\tbegin_transaction();\n\t$args = func_get_args();\n\t$args = (object)array_combine(array('wo_ref', 'loc_code', 'units_reqd', 'stock_id',\n\t\t'type', 'date_', 'memo_', 'costs', 'cr_acc', 'labour', 'cr_lab_acc'), $args);\n\t$args->woid = 0;\n\thook_db_prewrite($args, ST_WORKORDER);\n\n\t// if unassembling, reverse the stock movements\n\tif ($type == WO_UNASSEMBLY)\n\t\t$units_reqd = -$units_reqd;\n\n\tadd_material_cost($stock_id, $units_reqd, $date_);\n\n\t$date = date2sql($date_);\n\tif (!isset($costs) || ($costs == \"\"))\n\t\t$costs = 0;\n\tadd_overhead_cost($stock_id, $units_reqd, $date_, $costs);\n\tif (!isset($labour) || ($labour == \"\"))\n\t\t$labour = 0;\n\tadd_labour_cost($stock_id, $units_reqd, $date_, $labour);\n\t\t\n\t$sql = \"INSERT INTO \".TB_PREF.\"workorders (wo_ref, loc_code, units_reqd, units_issued, stock_id,\n\t\ttype, additional_costs, date_, released_date, required_by, released, closed)\n \tVALUES (\".db_escape($wo_ref).\", \".db_escape($loc_code).\", \".db_escape($units_reqd)\n \t.\", \".db_escape($units_reqd).\", \".db_escape($stock_id).\",\n\t\t\".db_escape($type).\", \".db_escape($costs).\", '$date', '$date', '$date', 1, 1)\";\n\tdb_query($sql, \"could not add work order\");\n\n\t$woid = db_insert_id();\n\n\t//--------------------------------------------------------------------------\n\n\t// create Work Order Requirements based on the bom\n\t$result = get_bom($stock_id);\n\n\twhile ($bom_item = db_fetch($result))\n\t{\n\n\t\t$unit_quantity = $bom_item[\"quantity\"];\n\t\t$item_quantity = $bom_item[\"quantity\"] * $units_reqd;\n\n\n\t\t$sql = \"INSERT INTO \".TB_PREF.\"wo_requirements (workorder_id, stock_id, workcentre, units_req, units_issued, loc_code)\n\t\t\tVALUES ($woid, \" . \"'\" . $bom_item[\"component\"] . \"'\" . \",\n\t\t\t'\". $bom_item[\"workcentre_added\"] . \"',\n\t\t\t$unit_quantity,\t$item_quantity, '\" . $bom_item[\"loc_code\"] . \"')\";\n\n db_query($sql, \"The work order requirements could not be added\");\n\n\t\t// insert a -ve stock move for each item\n\t\t// Chaitanya: Updated to record price and cost as std_cost for work order issued item\n\t\t$UnitCost = get_standard_cost($bom_item[\"component\"]);\n\t\tadd_stock_move(ST_WORKORDER, $bom_item[\"component\"], $woid,\n\t\t\t$bom_item[\"loc_code\"], $date_, $wo_ref, -$item_quantity, $UnitCost, 0, 1, $UnitCost);\n\t}\n\t\n\t// -------------------------------------------------------------------------\n\t//Negative Stock Handling\n\t$qoh = get_qoh_on_date($stock_id);\n\t$cost_adjust = false;\n\tif ($qoh < 0)\n\t{\n\t\tif ($qoh + $units_reqd >= 0)\n\t\t\t$cost_adjust = true;\n\t}\n\n\t// -------------------------------------------------------------------------\n\t\n\t//Negative Stock Handling First; Prior to add_stock_move\n\tif ($cost_adjust)\n\t\tadjust_deliveries($stock_id, get_standard_cost($stock_id), $date_);\n\t\t\n\t// -------------------------------------------------------------------------\t\n\n\t// insert a +ve stock move for the item being manufactured\n\tadd_stock_move(ST_WORKORDER, $stock_id, $woid,\t$loc_code, $date_,\n\t\t$wo_ref, $units_reqd, 0);\n\n\t// -------------------------------------------------------------------------\n\n\twork_order_quick_costs($woid, $stock_id, $units_reqd, $date_, 0, $costs, $cr_acc, $labour, $cr_lab_acc);\n\t\t\n\t//--------------------------------------------------------------------------\n\n\tadd_comments(ST_WORKORDER, $woid, $date_, $memo_);\n\n\t$Refs->save(ST_WORKORDER, $woid, $wo_ref);\n\tadd_audit_trail(ST_WORKORDER, $woid, $date_,_(\"Quick production.\"));\n\n\t$args->woid = $woid;\n\thook_db_postwrite($args, ST_WORKORDER);\n\tcommit_transaction();\n\treturn $woid;\n}", "public function createOrder($order)\n {\n $this->notificationRepository->create(['type' => 'order', 'order_id' => $order->id]);\n \n event(new CreateOrderNotification);\n }", "public function testRecurringOrderRenewQueue() {\n list($subscription, $order) = $this->createBasicSubscriptionAndOrder();\n\n // Fast forward in time and run cron.\n \\Drupal::time()->setTime($subscription->get('starts')->value + 100);\n // We don't trigger the cron directly as this processes the queue items\n // already.\n $this->container->get('commerce_recurring.cron')->run();\n\n /** @var \\Drupal\\advancedqueue\\Entity\\QueueInterface $queue */\n $queue = Queue::load('commerce_recurring');\n $this->assertEquals(['queued' => 2, 'processing' => 0,'success' => 0, 'failure' => 0], $queue->getBackend()->countJobs());\n\n $job1 = $queue->getBackend()->claimJob();\n $job2 = $queue->getBackend()->claimJob();\n\n $this->assertArraySubset(['order_id' => $order->id()], $job1->getPayload());\n $this->assertEquals('commerce_recurring_order_close', $job1->getType());\n $this->assertArraySubset(['order_id' => $order->id()], $job2->getPayload());\n $this->assertEquals('commerce_recurring_order_renew', $job2->getType());\n }", "public function created(Order $order): void\n\t{\n\t\t$order->chat()->create();\n\t}", "public function create(Order $order)\n {\n //\n }", "public function create()\n\t{\n\t\t$this->auth->restrict('Purchase_Order.Orders.Create');\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\tif ($insert_id = $this->save_purchase_order())\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\tlog_activity($this->current_user->id, lang('purchase_order_act_create_record') .': '. $insert_id .' : '. $this->input->ip_address(), 'purchase_order');\n\n\t\t\t\tTemplate::set_message(lang('purchase_order_create_success'), 'success');\n\t\t\t\tredirect(SITE_AREA .'/orders/purchase_order');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('purchase_order_create_failure') . $this->purchase_order_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tAssets::add_module_js('purchase_order', 'purchase_order.js');\n\n\t\tTemplate::set('toolbar_title', lang('purchase_order_create') . ' Purchase Order');\n\t\tTemplate::render();\n\t}", "public function create_overtime_request()\n\t{\n\t\t$this->load->library('overtime_library');\n\t\t$this->load->model('timecard_model', '', TRUE);\n\t\t$this->load->model('overtime_model', '', TRUE);\n\n\t\t$user_request_time = $this->user_local_request_time();\n\n\t\t//assemble time\n\t\t$timecard_date = date('Y', $_SERVER['REQUEST_TIME'])\n\t\t\t\t.'-'. date('m', $_SERVER['REQUEST_TIME'])\n\t\t\t\t.'-'. date('d', $_SERVER['REQUEST_TIME']);\n\n\t\t//this just helps ensure the date is accurate, even though should never be touched by user\n\t\t//and can probably be removed\n\t\t$this->load->helper('date');\n\t\tif ( ! validateDate($timecard_date, 'Y-m-d') )\n\t\t{\n\t\t\t$this->json_error_response('Date is invalid. Please contact support');\n\t\t}\n\n\t\t//Check if we aleady haven't submitted a request for this user and workorder today\n\t\t$submitted = $this->overtime_model->requested_already(\n\t\t\t$this->session->tc_user_id,\n\t\t\t$this->input->post('workorder_id'),\n\t\t\t$timecard_date\n\t\t);\n\n\t\tif ($submitted) {\n\t\t\t$this->json_error_response('You have already submitted an overtime request for this work order');\n\t\t}\n\n\t\t//want to include Username (so manager knows who's requesting without having to click the WO link)\n\t\t$requestSent = $this->overtime_library->createRequest(\n\t\t\t$this->session->tc_user_id,\n\t\t\t$this->input->post('workorder_id'),\n\t\t\t$user_request_time->format('h'),\n\t\t\t$user_request_time->format('i'),\n\t\t\t$user_request_time->format('A'),\n\t\t\t$timecard_date,\n\t\t\t$this->session->tc_cfpfullname,\n\t\t\t$this->input->post('overtime_reason')\n\t\t);\n\n\t\tif (!$requestSent) {\n\t\t\t$this->json_error_response('There was an error submitting your request. Please try again');\n\t\t}\n\t}", "function _pre()\n\t{\n\t\t$this->takeawayId = $this->takeawaymodel->addTakeaway('testtakeaway', 'testtake', 'test', 'te573t', '555', 'test', 1, 30, 1, 54, -40, 1);\n\t}", "function save_booking_time($booking_date, $booking_time, $order_id, $invoice_number, $customer_id) {\r\n $configs = include('config/config.php');\r\n $query = \"UPDATE \" . $vogomo_orders_table . \" SET booking_datetime = '\" . $booking_date . \" \" . $booking_time . \":00:00' WHERE order_id = '\" . $order_id . \"' AND customer_id = '\" . $customer_id . \"'\";\r\n $result = $configs->query($query);\r\n if($result){\r\n save_system_log($order_id, \"Booking TimeSlot Save Successful\", \"Booking TimeSlot\");\r\n return array(true, \"Booking TimeSlot Save Successful for Order - \" . $invoice_number, $order_id);\r\n }else{\r\n return array(false, \"Booking TimeSlot Can't Save for Order - \" . $invoice_number, $order_id);\r\n }\r\n}", "public function insert_order()\n\t{\n\t\t$CI =& get_instance();\n\t\t$CI->auth->check_admin_auth();\n\t\t$CI->load->model('Orders');\n\t\t$order_id = $CI->Orders->order_entry();\n\t\t$this->session->set_userdata(array('message'=>display('successfully_added')));\n\t\t$this->order_inserted_data($order_id);\n\n\t\tif(isset($_POST['add-order'])){\n\t\t\tredirect(base_url('Corder/manage_order'));\n\t\t}elseif(isset($_POST['add-order-another'])){\n\t\t\tredirect(base_url('Corder'));\n\t\t}\n\t}", "public function createFinishExpressCheckoutOrder($tid, $shippingCosts, $amount, $cancel){}", "public function makeOrderRequest()\n {\n //check if the user is logged and user permission\n if (UserManager::isUserLogged()) {\n if (UserManager::getPermission($_SESSION['email']) == BASE) {\n\n //check post variables\n if (isset($_POST['delivery_date']) && isset($_POST['article_id']) && isset($_POST['article_quantity']) && !empty($_POST['article_id']) && !empty($_POST['article_quantity']) && !empty($_POST['delivery_date'])) {\n\n //test input\n $article_id = Validator::testInput($_POST['article_id']);\n $article_quantity = Validator::testInput($_POST['article_quantity']);\n $delivery_date = Validator::testInput($_POST['delivery_date']);\n $article = ArticleManager::getArticleById($article_id);\n $expire_date = $article['data_scadenza'];\n $available_date = $article['disponibile_il'];\n\n if (Validator::isDeliveryDateValid($delivery_date, $expire_date, $available_date)) {\n\n //create order\n $order = new OrderModel($article_quantity, $article_id, UserManager::getUserByEmail($_SESSION['email'])['id'], $delivery_date);\n\n //try to make the order request\n if (OrderManager::addOrder($order)) {\n MessageManager::setSuccessMsg('Richiesta inviata. Il tuo ordine verrà visionato');\n MessageManager::unsetErrorMsg();\n } else {\n MessageManager::setErrorMsg('Impossibile richiedere questo articolo');\n }\n } else {\n MessageManager::setErrorMsg('La data di consegna non è valida');\n }\n }\n }\n header('Location: ' . URL . 'catalog');\n exit;\n }\n header('Location: ' . URL . 'home');\n }", "public function create_shippify_task($order_id){\n session_start();\n $task_endpoint = \"https://api.shippify.co/task/new\";\n\n $order = new WC_Order($order_id);\n\n $products = '[{\"id\":\"10234\",\"name\":\"TV\",\"qty\":\"2\",\"size\":\"3\",\"price\":\"0\"}]'; //coger de package\n\n $sender_mail = \"[email protected]\"; //poner y coger de settings\n\n $recipient_name = get_post_meta( $order_id, '_billing_first_name', true ) . get_post_meta( $order_id, '_billing_last_name', true ) ;\n $recipient_email = get_post_meta( $order_id, '_billing_email', true );\n $recipient_phone = get_post_meta( $order_id, '_billing_phone', true );\n\n $pickup_warehouse = get_post_meta( $order_id, 'pickup_id', true );\n $pickup_latitude = get_post_meta( $order_id, 'pickup_latitude', true );\n $pickup_longitude = get_post_meta( $order_id, 'pickup_longitude', true );\n $pickup_address = get_post_meta( $order_id, 'pickup_address', true );\n\n $deliver_lat = get_post_meta( $order_id, 'Latitude', true );\n $deliver_lon = get_post_meta( $order_id, 'Longitude', true );\n $deliver_address = get_post_meta( $order_id, '_billing_address_1', true ) . get_post_meta( $order_id, '_billing_address_2', true );\n\n $note = get_post_meta( $order_id, 'Instructions', true );\n\n $ref_id = $order_id;\n\n $api_id = get_option('shippify_id');\n $api_secret = get_option('shippify_secret');\n\n $items = \"[\";\n foreach ($order->get_items() as $item_id => $_preproduct ) { \n $_product = $_preproduct->get_product();\n $items = $items . '{\"id\":\"' . $_product->get_id() . '\", \n \"name\":\"' . $_product->get_name() . '\", \n \"qty\": \"' . $_preproduct['quantity'] . '\", \n \"size\": \"' . $this->calculate_product_shippify_size($_product) . '\"\n },';\n }\n $items = substr($items, 0, -1) . ']';\n\n $wh_args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret )\n ),\n 'method' => 'GET'\n ); \n\n $pickup_id = '';\n if ($pickup_warehouse != \"\" || isset($pickup_warehouse)){\n $warehouse_response = wp_remote_get('https://api.shippify.co/warehouse/list', $wh_args);\n if (!is_wp_error($warehouse_response)){\n $warehouse_response = json_decode($warehouse_response['body'], true);\n $warehouse_info = $warehouse_response[\"warehouses\"];\n foreach ($warehouse_info as $warehouse){\n if ($warehouse[\"id\"] == $pickup_warehouse){\n $pickup_id = $pickup_warehouse;\n break; \n }\n }\n }\n } \n\n if ($pickup_id == ''){\n $warehouse_to_request = '';\n }else{\n $warehouse_to_request = ',\n \"warehouse\": \"'. $pickup_id .'\"';\n }\n\n $total_amount = '';\n $payment_method = get_post_meta( $order_id, '_payment_method', true );\n if ($payment_method == 'cod'){\n $order_total = $order->get_total(); \n $total_amount = '\"total_amount\": \"' . $order_total . '\",'; \n }\n\n $request_body = '\n {\n \"task\" : {\n \"products\": '. $items . ',\n \"sender\" : {\n \"email\": \"'. $sender_mail . '\"\n },\n \"recipient\": {\n \"name\": \"'. $recipient_name . '\",\n \"email\": \"'. $recipient_email . '\",\n \"phone\": \"'. $recipient_phone . '\"\n },\n \"pickup\": {\n \"lat\": '. $pickup_latitude . ',\n \"lng\": '. $pickup_longitude . ',\n \"address\": \"'. $pickup_address . '\"'. $warehouse_to_request . '\n }, \n '. $total_amount . '\n \"deliver\": {\n \"lat\": '. $deliver_lat . ',\n \"lng\": '. $deliver_lon . ',\n \"address\": \"'. $deliver_address . '\"\n },\n \"ref_id\": \"'. $ref_id .'\",\n \"extra\": {\n \"note\": \"'. $note . '\" \n }\n }\n }';\n\n //Basic Authorization\n\n $args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret ),\n 'Content-Type' => 'application/json'\n ),\n 'method' => 'POST',\n 'body' => $request_body\n );\n\n $response = wp_remote_post( $task_endpoint, $args );\n\n if (is_wp_error($response)){\n return false;\n }\n\n\n return $response;\n\n }", "public function add()\n {\n echo '客户需求添加一个新需求' . PHP_EOL;\n }", "public function autoQuoteSession($quote_id,$action)\n\t{\n\t\tunset($this->quote_creation->create_mission);\n unset($this->quote_creation->select_missions);\n unset($this->quote_creation->custom);\n\t\tunset($this->quote_creation->send_quote);\n\n\t\t$quoteObj=new Ep_Quote_Quotes();\n\t\t$quoteDetails=$quoteObj->getQuoteDetails($quote_id);\n\n\t\tif($quoteDetails)\n\t\t{\n\t\t\tforeach($quoteDetails as $quote)\n\t\t\t{\t\t\t\t\n\t\t\t\t$this->quote_creation->custom['action']=$action;\n\t\t\t\tif($action=='edit')\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$this->quote_creation->custom['quote_id']=$quote['identifier'];\n\t\t\t\t\tif($quote['sales_review']=='validated' || $quote['sales_review']=='closed')\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->quote_creation->custom['create_new_version']='yes';\n\t\t\t\t\t\t$this->quote_creation->custom['version']=($quote['version']+1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->quote_creation->custom['version']=($quote['version']);\n\t\t\t\t\t\tunset($this->quote_creation->custom['create_new_version']);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse if($action=='duplicate')\n\t\t\t\t{\n\t\t\t\t\tunset($this->quote_creation->custom['quote_id']);\n\t\t\t\t\tunset($this->quote_creation->custom['create_new_version']);\n\t\t\t\t\tunset($this->quote_creation->custom['version']);\n\t\t\t\t}\n\t\t\t\t//step1 session\n\t\t\t\t$this->quote_creation->create_step1['client_id']=$quote['client_id'];\n\t\t\t\t$this->quote_creation->create_step1['category']=$quote['category'];\n\t\t\t\tif($quote['category_other'])\n\t\t\t\t\t$this->quote_creation->create_step1['category_other']=$quote['category_other'];\n\n\t\t\t\tif($quote['websites'])\n\t\t\t\t\t$this->quote_creation->create_step1['client_websites']=explode(\"|\",$quote['websites']);\n\t\t\t\t$this->quote_creation->create_step1['quote_by']=$quote['quote_by'];\n\n\t\t\t\t$this->quote_creation->create_step1['currency']=$quote['sales_suggested_currency'];\n\t\t\t\t$this->quote_creation->create_step1['conversion']=$quote['conversion'];\n\t\t\t\t$this->quote_creation->create_step1['quote_type']=$quote['quote_type'];\n\n\t\t\t\t//step2 session\t\n\t\t\t\t$this->quote_creation->create_mission['quote_title']=$quote['title'];\t\t\t\n\t\t\t\t//getting mission details\n\t\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t\t$searchParameters['misson_user_type']='sales';\n\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t$missonDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\n\t\t\t\tif($missonDetails)\n\t\t\t\t{\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach($missonDetails as $quoteMmission)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->quote_creation->create_mission['product'][$i]=$quoteMmission['product'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['language'][$i]=$quoteMmission['language_source'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['languagedest'][$i]=$quoteMmission['language_dest'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['producttype'][$i]=$quoteMmission['product_type'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['producttypeother'][$i]=$quoteMmission['product_type_other'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['nb_words'][$i]=$quoteMmission['nb_words'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['volume'][$i]=$quoteMmission['volume'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['mission_length'][$i]=$quoteMmission['mission_length'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['mission_length_option'][$i]=$quoteMmission['mission_length_option'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['volume_max'][$i]=$quoteMmission['volume_max'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['delivery_volume_option'][$i]=$quoteMmission['delivery_volume_option'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['tempo'][$i]=$quoteMmission['tempo'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['tempo_length'][$i]=$quoteMmission['tempo_length'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['tempo_length_option'][$i]=$quoteMmission['tempo_length_option'];\n\t\t\t\t\t\tif(!$quoteMmission['oneshot'])\n\t\t\t\t\t\t\t$quoteMmission['oneshot']='yes';\n\t\t\t\t\t\t$this->quote_creation->create_mission['oneshot'][$i]=$quoteMmission['oneshot'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['demande_client'][$i]=$quoteMmission['demande_client'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['duration_dont_know'][$i]=$quoteMmission['duration_dont_know'];\n\t\t\t\t\t\t$this->quote_creation->create_mission['comments'][$i]=$quoteMmission['comments'];\n\t\t\t\t\t\t$this->quote_creation->select_missions['missions_selected'][$i]=$quoteMmission['sales_suggested_missions'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t//step3 details\n\t\t\t\t\t\tif($action=='edit')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->quote_creation->create_mission['mission_identifier'][$i]=$quoteMmission['identifier'];\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if($action=='duplicate')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($this->quote_creation->create_mission['mission_identifier']);\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t//final step details\n\t\t\t\t$this->quote_creation->send_quote['sales_comment']=$quote['sales_comment'];\n\t\t\t\t$this->quote_creation->send_quote['client_email_text']=$quote['client_email_text'];\t\n\t\t\t\t//$this->quote_creation->send_quote['sales_delivery_time']=$quote['sales_delivery_time'];\n\t\t\t\t//$this->quote_creation->send_quote['sales_delivery_time_option']=$quote['sales_delivery_time_option'];\n\t\t\t\t$this->quote_creation->send_quote['client_know']=$quote['client_know'];\n\t\t\t\t$this->quote_creation->send_quote['urgent']=$quote['urgent'];\n\t\t\t\t$this->quote_creation->send_quote['urgent_comments']=$quote['urgent_comments'];\n\t\t\t\t$this->quote_creation->send_quote['prod_review']=$quote['prod_review'];\n\t\t\t\t$this->quote_creation->send_quote['skip_prod_comments']=$quote['skip_prod_comments'];\n\t\t\t\t//$this->quote_creation->send_quote['market_team_sent']=$quote['market_team_sent'];\n\t\t\t\t//$this->quote_creation->send_quote['from_platform']=$quote['from_platform'];\n\t\t\t\t$this->quote_creation->send_quote['quote_send_team']=$quote['quote_send_team'];\n\t\t\t\t$this->quote_creation->send_quote['sales_review']=$quote['sales_review'];\n\n\t\t\t\t//NEW FIELDS\n\t\t\t\t$client_aims=explode(\",\",$quote['client_aims']);\n\t\t\t\t$this->quote_creation->send_quote['client_aims']=$client_aims;\n\n\t\t\t\t$client_prio=explode(\",\",$quote['client_prio']);\n\n\t\t\t\tif(count($client_aims)>0)\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tforeach($client_aims as $i=>$aim)\n\t\t\t\t\t{\n\t\t\t\t\t\t//echo 'priority_'.$aim;//.\"--\".$quote['client_prio'][$i];\n\t\t\t\t\t\t$this->quote_creation->send_quote['priority_'.$aim]=$client_prio[$i];\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t$this->quote_creation->send_quote['client_aims_comments']=$quote['client_aims_comments'];\n\t\t\t\t$this->quote_creation->send_quote['content_ordered_agency']=$quote['content_ordered_agency'];\n\t\t\t\t$this->quote_creation->send_quote['agency']=$quote['agency'];\n\t\t\t\t$this->quote_creation->send_quote['agency_name']=$quote['agency_name'];\n\t\t\t\t$this->quote_creation->send_quote['client_internal_team']=$quote['client_internal_team'];\n\t\t\t\t$this->quote_creation->send_quote['client_know_writers']=$quote['client_know_writers'];\t\t\t\t\n\t\t\t\t$this->quote_creation->send_quote['volume_option']=$quote['volume_option'];\n\t\t\t\t$this->quote_creation->send_quote['volume_option_multi']=$quote['volume_option_multi'];\n\t\t\t\t$this->quote_creation->send_quote['volume_every']=$quote['volume_every'];\n\t\t\t\t$this->quote_creation->send_quote['budget_marketing']=$quote['budget_marketing'];\n\t\t\t\t$this->quote_creation->send_quote['budget']=$quote['budget'];\n\t\t\t\t$this->quote_creation->send_quote['budget_currency']=$quote['budget_currency'];\n\n\t\t\t\t$this->quote_creation->send_quote['estimate_sign_percentage']=$quote['estimate_sign_percentage'];\n\t\t\t\t$this->quote_creation->send_quote['estimate_sign_date']=$quote['estimate_sign_date'];\n\t\t\t\t$this->quote_creation->send_quote['estimate_sign_comments']=$quote['estimate_sign_comments'];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Quote documents added to sesssion\n\t\t\t\t$files = \"\";\n\t\t\t\t$documents_path = explode(\"|\",$quote['documents_path']);\n\t\t\t\t$documents_name = explode(\"|\",$quote['documents_name']);\n\t\t\t\t$k =0;\n\t\t\t\tforeach($documents_path as $row)\n\t\t\t\t{\n\t\t\t\t\tif(file_exists($this->quote_documents_path.$documents_path[$k]) && !is_dir($this->quote_documents_path.$documents_path[$k]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$files .= '<div class=\"topset2\"><a href=\"/quote/download-document?type=quote&quote_id='.$quote_id.'&index='.$k.'\">'.$documents_name[$k].'</a><span class=\"delete\" rel=\"'.$k.'_'.$quote_id.'\"> <i class=\"splashy-error_x\"></i></span> \t\t\t\t\t\t</div>';\n\t\t\t\t\t}\n\t\t\t\t\t$k++;\n\t\t\t\t}\n\t\t\t\t$this->quote_creation->send_quote['documents'] = $files;\n\n\t\n\n\t\t\t\t//echo \"<pre>\";print_r($this->quote_creation->send_quote);exit;\n\t\t\t}\n\t\t}\n\n\t\t//echo \"<pre>\";print_r($this->quote_creation->create_step1);exit;\n\t}", "public function testCreateOrder() {\n $order_item = $this->createEntity('commerce_order_item', [\n 'type' => 'default',\n 'unit_price' => [\n 'number' => '999',\n 'currency_code' => 'USD',\n ],\n ]);\n $order = $this->createEntity('commerce_order', [\n 'type' => 'default',\n 'mail' => $this->loggedInUser->getEmail(),\n 'order_items' => [$order_item],\n 'uid' => $this->loggedInUser,\n 'store_id' => $this->store,\n ]);\n\n $order_exists = (bool) Order::load($order->id());\n $this->assertNotEmpty($order_exists, 'The new order has been created in the database.');\n }", "function bill_transition_placed_pending($billorid) {\n global $CFG, $SITE, $USER, $DB, $OUTPUT;\n\n $config = get_config('local_shop');\n\n /*\n * Scenario :\n * - the order is being payed offline.\n * - the operator needs to sold out manually the bill and realize all billitems production.\n */\n\n if (is_object($billorid)) {\n $bill = $billorid;\n } else {\n $bill = new Bill($billid);\n }\n\n if ($bill) {\n\n include_once($CFG->dirroot.'/local/shop/datahandling/production.php');\n\n $productiondata = produce_prepay($bill);\n shop_aggregate_production($bill, $productiondata, true);\n\n echo $OUTPUT->box_start();\n echo $productiondata->salesadmin;\n echo $OUTPUT->box_end();\n\n // Now notify user the order and all products have been activated.\n if (!empty($productiondata->private)) {\n\n // Notify end user.\n $billurl = new moodle_url('/local/shop/front/order.popup.php', array('billid' => $bill->id, 'transid' => $bill->transactionid));\n $customeruser = $DB->get_record('user', array('id' => $bill->customer->hasaccount));\n $ticket = ticket_generate($customeruser, 'delegated access', $billurl);\n\n // Feedback customer with mail confirmation.\n $vars = array('SERVER' => $SITE->shortname,\n 'SERVER_URL' => $CFG->wwwroot,\n 'SELLER' => $config->sellername,\n 'FIRSTNAME' => $bill->customer->firstname,\n 'LASTNAME' => $bill->customer->lastname,\n 'MAIL' => $bill->customer->email,\n 'CITY' => $bill->customer->city,\n 'COUNTRY' => $bill->customer->country,\n 'ITEMS' => count($bill->billItems),\n 'PAYMODE' => get_string($bill->paymode, 'local_shop'),\n 'AMOUNT' => $bill->amount,\n 'TICKET' => $ticket);\n $notification = shop_compile_mail_template('sales_feedback', $vars, '');\n $params = array('shopid' => $bill->shopid, 'view' => 'bill', 'billid' => $bill->id, 'transid' => $bill->transactionid);\n $customerbillviewurl = new moodle_url('/local/shop/front/view.php', $params);\n $seller = new StdClass;\n $seller->firstname = $config->sellername;\n $seller->lastname = '';\n $seller->email = $config->sellermail;\n $seller->maildisplay = 1;\n $title = $SITE->shortname.' : '.get_string('yourorder', 'local_shop');\n $sentnotification = str_replace('<%%PRODUCTION_DATA%%>', $productiondata->private, $notification);\n ticket_notify($customeruser, $seller, $title, $sentnotification, $sentnotification, $customerbillviewurl);\n }\n\n $message = \"[{$bill->transactionid}] Bill Controller :\";\n $message .= \" Delayed Transaction Activating Operations on seller behalf by $USER->username\";\n shop_trace($message);\n $bill->status = 'PENDING';\n $bill->save(true);\n } else {\n shop_trace(\"[ERROR] Transition error : Bad bill ID $billid\");\n }\n}", "function wpsc_submit_checkout_handler($args) {\n wp_affiliate_log_debug(\"WPSC Integration - wpsc_submit_checkout_handler(). Saving purchase log ID.\", true);\n global $wpdb;\n $aff_relations_tbl = WP_AFF_RELATIONS_TBL_NAME;\n $purchase_log_id = $args['purchase_log_id'];\n $referrer = wp_affiliate_get_referrer();\n $clientdate = (date(\"Y-m-d\"));\n $clienttime = (date(\"H:i:s\"));\n $clientip = wp_aff_get_user_ip();\n $updatedb = \"INSERT INTO $aff_relations_tbl (unique_ref,refid,reference,date,time,ipaddress,additional_info) VALUES ('$purchase_log_id','$referrer','wp_ecommerce','$clientdate','$clienttime','$clientip','')\";\n $results = $wpdb->query($updatedb);\n}", "protected function createOrder(){\n $order = Auth::user()->orders()->create(['status' => 'aguardando']);\n\n return $order;\n }", "function getStartTime($startTime = null, $today = null, $orderType = null, $preOrder = null, $endTime = null, $storeId = null) {\n App::import('Model', 'Store');\n $this->Store = new Store();\n $store_data = $this->Store->find('first', array('conditions' => array(\"Store.id\" => $storeId), 'fields' => array('Store.delivery_interval', 'Store.delivery_delay', 'Store.pick_up_delay')));\n $poststartTime = $startTime;\n //Check Order Type (i.e. Delivery/Pick Up)\n $deliveryInterval = 0;\n if ($orderType == 3) {\n $deliveryInterval = !empty($store_data['Store']['delivery_delay']) ? $store_data['Store']['delivery_delay'] : 0;\n } else if ($orderType == 2) {\n $deliveryInterval = !empty($store_data['Store']['pick_up_delay']) ? $store_data['Store']['pick_up_delay'] : 0;\n } else if ($orderType == 1) {\n //$deliveryInterval = 60;\n $deliveryInterval = 0;\n }\n //Check Day (i.e. Today/ another)\n if ($today) {\n //$nowDate = date(\"Y-m-d H:i:s\");\n $nowDate=$this->getcurrentTime($storeId,1);\n $minute = date(\"i\");\n if ($minute % 5 != 0) {\n $mod = $minute % 5;\n $rem = 5 - $mod;\n $nowDate = date(\"Y-m-d H:i:s\", strtotime((date(\"Y-m-d H:\") . $minute . \":00\")) + ($rem * 60));\n } \n $currentStoreactual = date(\"H:i:s\", strtotime($this->storeTimeZoneUser('', $nowDate)));\n $currentStoreTime = date(\"H:i:s\", strtotime($currentStoreactual) + ($deliveryInterval * 60));\n $var1 = explode(\":\", $currentStoreactual);\n $hours = $var1[0];\n $minutes = $var1[1];\n $TotalCurrentminutes = $hours * 60 + $minutes;\n $actualminutes = $TotalCurrentminutes + ($deliveryInterval);\n $var2 = explode(\":\", $endTime);\n $Ehours = $var2[0];\n $Eminutes = $var2[1];\n $TotalEndminutes = $Ehours * 60 + $Eminutes;\n if (!empty($endTime)) {\n if (strtotime($currentStoreactual) > strtotime($endTime)) {\n return 0;\n }\n if ($actualminutes >= 1440 || $actualminutes >= $TotalEndminutes) {\n return 0;\n }\n }\n $currentStoreTime = strtotime($currentStoreTime);\n $startTime = strtotime($startTime);\n //Check Day (i.e. Now/ Predor)\n $currentTime = 0;\n $currentTime = date(\"H:i:s\", ($currentStoreTime));\n $currentTimestr = strtotime($currentTime);\n $hour24 = array('24:00:00', '24:00', '00:00:00', '00:00');\n //store start time is greater than or not to current time\n if ($startTime > $currentTimestr && (!in_array($poststartTime, $hour24))) {\n $currentTime = date(\"H:i:s\", $startTime + ($deliveryInterval * 60));\n }\n //echo \"CurrentTime3\".$currentTime.\"<br>\";\n } else {\n $currentTime = date(\"H:i:s\", (strtotime($startTime) + ($deliveryInterval * 60)));\n }\n return $currentTime;\n }" ]
[ "0.58771074", "0.5737268", "0.57242256", "0.565008", "0.56435347", "0.56278294", "0.5579717", "0.55200565", "0.55064744", "0.54953647", "0.54893667", "0.546783", "0.54670984", "0.5466625", "0.54522735", "0.5446396", "0.54303014", "0.54077095", "0.53769165", "0.53680074", "0.5335033", "0.5332587", "0.5329824", "0.53257775", "0.5318874", "0.53151345", "0.52837396", "0.52788055", "0.5278249", "0.5277692", "0.5264385", "0.52604896", "0.52602935", "0.52563715", "0.5243466", "0.5239605", "0.52239627", "0.5223185", "0.5219386", "0.52180076", "0.5211198", "0.52074903", "0.52015793", "0.5199537", "0.5192998", "0.5186687", "0.5171923", "0.5167694", "0.5167694", "0.5149837", "0.5144194", "0.51440126", "0.5136513", "0.5134356", "0.51297605", "0.5127176", "0.51135445", "0.5109379", "0.5108801", "0.5108204", "0.5106501", "0.51064515", "0.51053566", "0.50972295", "0.50904757", "0.50903195", "0.50858516", "0.5077872", "0.50698274", "0.5069007", "0.5064783", "0.50415015", "0.5036167", "0.5032248", "0.50286436", "0.50239295", "0.5022506", "0.5007363", "0.50021476", "0.49952638", "0.4993679", "0.49935925", "0.4993254", "0.49872172", "0.49838892", "0.49772087", "0.497458", "0.49625656", "0.49591473", "0.49584067", "0.49548066", "0.49539885", "0.4950428", "0.49484837", "0.49448186", "0.4944816", "0.49448004", "0.4942055", "0.49349824", "0.49331316", "0.4932182" ]
0.0
-1
sets the email content type to HTML
function set_email_to_html(){ return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set_html_content_type() {\n\t\treturn 'text/html';\n\t}", "public function set_html_content_type() {\n\n\t\treturn 'text/html';\n\n\t}", "function my_email_content_type() \n{\n\treturn \"text/html\";\n}", "static public function sc_wpfmp_wp_mail_content_type()\n {\n return \"text/html\";\n }", "public static function send_html_mail( $content_type ) {\n return 'text/html';\n }", "function set_html_content_type(){\n\treturn 'text/html';\n}", "function pmpro_wp_mail_content_type( $content_type ) {\t\n\tadd_action('phpmailer_init', 'pmpro_send_html');\n\n\t// Change to html if not already.\n\tif( $content_type == 'text/plain') {\t\t\t\n\t\t$content_type = 'text/html';\n\t}\n\t\n\treturn $content_type;\n}", "function mc_html_type() {\n\n\treturn 'text/html';\n}", "function gather_ua_jobs_set_html_content_type() {\n return 'text/html';\n}", "public function pi_set_content_type(){\n \treturn \"text/html\";\n\t}", "public function IsHTML($ishtml = true) {\n\t if ($ishtml) {\n\t $this->ContentType = 'text/html';\n\t } else {\n\t $this->ContentType = 'text/plain';\n\t }\n\t}", "function realtor_set_content_type()\n{\n return \"text/html\";\n}", "public function isHTML($isHtml = true)\n {\n if ($isHtml) {\n $this->ContentType = 'text/html';\n } else {\n $this->ContentType = 'text/plain';\n }\n }", "private static function typeHTML()\n {\n $h = 'Content-type: text/html; charset=\"' . self::$CHARSET . '\"' . PHP_EOL;\n $bit = (strtolower( self::$CHARSET ) === 'utf-8') ? '8bit' : '7bit';\n $h .= 'Content-Transfer-Encoding: ' . $bit . PHP_EOL;\n return $h;\n }", "function get_content_type($html_test){\n\t\tif($html_test){\n\t\t\t$this->content_type = 'text/html';\n\t\t}else{\n\t\t\t$this->content_type = 'text/plain';\n\t\t}\n\t}", "public function setHtmlType(string $type): self;", "public function setMailTextType($mailType='text') {\n\t\t$this->_mailTextType = ($mailType == 'text') ? 'text' : 'html';\n\t}", "function setHTML($value = true)\n {\n $this->multimailer->isHTML($value);\n }", "private function setContentType($type = \"html\") \n\t{\n\t\theader('Content-type: application/'.$type);\n\t}", "protected function makeTextHtmlContentTypeWithCharsetHeaderString() {\n\t\treturn 'Content-type: text/html; charset=\"' . $this->_mailCharset . '\" ' . $this->_endString;\n\t}", "static public function setHTML() {\n\t\tself::$page_type = 0;\n\t}", "public function put_PLAIN_into_HTML()\n\t{\n\t\t// see loreal email for example\n\t\t// this should be handled in a\n\t\t// better way, perhaps known defects in email\n\t\t// could be tracked in a table and fixes\n\t\t// applied before the data is stored.\n\t\t// also force quoted printable decoding\n\t\t// NOTE: shouldn't have to do this decoding...\n\t\t// is it vestigal behavior?\n\t\t// in case the message is encoded\n\t\t$this->HTML = quoted_printable_decode($this->PLAIN);\n\t}", "function getHTMLContentType() {\n\t\tif (t3lib_div::int_from_ver(TYPO3_version) < 4002002) {\n\t\t\treturn (count($this->theParts['html']['media']) && $this->includeMedia) ? 'multipart/related;' : 'multipart/alternative;';\n\t\t} else {\n\t\t\treturn (count($this->theParts['html']['media']) && $this->includeMedia) ? 'multipart/related' : 'multipart/alternative';\t\n\t\t}\n\t}", "function sendHTMLMail($HTMLContent, $PLAINContent, $recipient, $subject, $fromEmail, $fromName, $replyTo = '', $fileAttachment = '') {\n\t\t\t// HTML\n\t\t\tif (trim($recipient)) {\n\t\t\t\t$parts = spliti('<title>|</title>', $HTMLContent, 3);\n\t\t\t\t\t \n\t\t\t\t$Typo3_htmlmail = t3lib_div::makeInstance('t3lib_htmlmail');\n\t\t\t\t$Typo3_htmlmail->start();\n\t\t\t\t$Typo3_htmlmail->mailer = 'Typo3 HTMLMail';\n\t\t\t\t$Typo3_htmlmail->subject = $subject;\n\t\t\t\t$Typo3_htmlmail->from_email = $fromEmail;\n\t\t\t\t$Typo3_htmlmail->returnPath = $fromEmail;\n\t\t\t\t$Typo3_htmlmail->from_name = $fromName;\n\t\t\t\t$Typo3_htmlmail->from_name = implode(' ' , t3lib_div::trimExplode(',', $Typo3_htmlmail->from_name));\n\t\t\t\t$Typo3_htmlmail->replyto_email = $replyTo ? $replyTo :$fromEmail;\n\t\t\t\t$Typo3_htmlmail->replyto_name = $replyTo ? '' : $fromName;\n\t\t\t\t$Typo3_htmlmail->replyto_name = implode(' ' , t3lib_div::trimExplode(',', $Typo3_htmlmail->replyto_name));\n\t\t\t\t$Typo3_htmlmail->organisation = '';\n\t\t\t\t$Typo3_htmlmail->priority = 3;\n\t\t\t\t \n\t\t\t\t// ATTACHMENT\n\t\t\t\tif ($fileAttachment && file_exists($fileAttachment)) {\n\t\t\t\t\t$Typo3_htmlmail->addAttachment($fileAttachment);\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t// HTML\n\t\t\t\tif (trim($HTMLContent)) {\n\t\t\t\t\t$Typo3_htmlmail->theParts['html']['content'] = $HTMLContent;\n\t\t\t\t\t$Typo3_htmlmail->theParts['html']['path'] = '';\n\t\t\t\t\t$Typo3_htmlmail->extractMediaLinks();\n\t\t\t\t\t$Typo3_htmlmail->extractHyperLinks();\n\t\t\t\t\t$Typo3_htmlmail->fetchHTMLMedia();\n\t\t\t\t\t$Typo3_htmlmail->substMediaNamesInHTML(0); // 0 = relative\n\t\t\t\t\t$Typo3_htmlmail->substHREFsInHTML();\n\t\t\t\t\t \n\t\t\t\t\t$Typo3_htmlmail->setHTML($Typo3_htmlmail->encodeMsg($Typo3_htmlmail->theParts['html']['content']));\n\t\t\t\t}\n\t\t\t\t// PLAIN\n\t\t\t\t$Typo3_htmlmail->addPlain($PLAINContent);\n\t\t\t\t// SET Headers and Content\n\t\t\t\t$Typo3_htmlmail->setHeaders();\n\t\t\t\t$Typo3_htmlmail->setContent();\n\t\t\t\t$Typo3_htmlmail->setRecipient($recipient);\n\t\t\t\t$Typo3_htmlmail->sendtheMail();\n\t\t\t}\n\t\t}", "public function getMailTextMimeType() {\n\t\tif($this->_mailTextType == 'html') {\n\t\t\treturn 'text/html';\n\t\t}\n\t\telse {\n\t\t\treturn $this->_mailMimeTextTypeDefault;\n\t\t}\n\t}", "function _before_filter(){\n\t\t$this->content_type = \"text/plain\";\n\t\t$this->content_charset = DEFAULT_CHARSET; // \"UTF-8\"\n\t\t$this->from = DEFAULT_EMAIL;\n\t}", "public function setType($type) {\n\t\tif($type == self::TYPE_TEXT){\n\t\t\t$this->type = self::TYPE_TEXT;\n\t\t} else {\n\t\t\t$this->type = self::TYPE_HTML;\n\t\t}\n\t}", "public function getContentType()\n {\n return 'text/plain';\n }", "public function setContentTypeHeader($type)\n {\n switch($type) {\n case 'json':\n $this->app->response->headers->set('Content-Type', 'application/json');\n break;\n case 'javascript':\n $this->app->response->headers->set('Content-Type', 'application/javascript');\n break;\n default:\n // default is html..\n break;\n }\n }", "public function create_html_email(){\n\n $html = '';\n $html .= '<html>';\n $html .= '<head>';\n $html .= '<title></title>';\n $html .= '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">';\n $html .= '</head>';\n $html .= '<body bgcolor=\"#f0ecec\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">';\n $html .= '<div style=\"background-color:#f0ecec;\">';\n $html .= '<table>';\n $html .= '<tr>';\n $html .= '<td height=\"30\">';\n $html .= '</td>';\n $html .= '</tr>';\n $html .= '</table>';\n $html .= '<table align=\"center\" width=\"650\" border=\"0\" cellpadding=\"30\" cellspacing=\"0\" bgcolor=\"#ffffff\">';\n $html .= '<tr>';\n $html .= '<td colspan=\"8\" bgcolor=\"#ffffff\">';\n $html .= $this->mensagem;\n $html .= \"<br><br>\";\n $html .= 'Obrigado.';\n $html .= \"<br><br>\";\n $html .= '</tr>';\n $html .= '</table>';\n $html .= '<table>';\n $html .= '<tr>';\n $html .= '<td height=\"30\">';\n $html .= '</td>';\n $html .= '</tr>';\n $html .= '</table>';\n $html .= '</div>';\n $html .= '</body>';\n $html .= '</html>';\n\n return $html;\n }", "public function setBody($content) {\n\n\t\t// auto-detect html\n\t\tif (stripos($content, '<html') !== false) {\n\t\t\t$this->_mail->IsHTML(true);\n\t\t}\n\n\t\t// set body\n\t\t$this->_mail->setBody($content);\n\t}", "public function contentType()\n {\n return 'text/plain';\n }", "function headerType() {\r\n \r\n If($this->from === TRUE){\r\n $this->from=\"no-reply@\".constant(\"HOST\");\r\n }elseif(empty($this->from)){\r\n $this->from=\"no-reply@\".constant(\"HOST\");\r\n }\r\n $this->headers = \"From: {$this->from}\\r\\n\";\r\n $this->headers.= \"MIME-Version: 1.0\\r\\n\";\r\n switch ($this->type) {\r\n default :\r\n\r\n $this->headers.= \"Content-Type: multipart/alternative; boundary={$this->boundary}\\r\\n\";\r\n\r\n //html version\r\n $this->headers .= \"\\n--{$this->boundary}\\n\";\r\n $this->headers .= \"Content-type: text/html; charset={$this->charset}\\r\\n\";\r\n $this->headers .= $this->body;\r\n\r\n //text version\r\n $this->headers .= \"\\n--{$this->boundary}\"; // beginning \\n added to separate previous content\r\n $this->headers .= \"Content-type: text/plain; charset={$this->charset}\\r\\n\";\r\n $this->headers .= $this->body;\r\n\r\n break;\r\n case \"html\":\r\n $this->headers .= \"Content-type: text/html; charset={$this->charset}\\r\\n\";\r\n break;\r\n case \"text\":\r\n $this->headers .= \"Content-type: text/plain; charset={$this->charset}\\r\\n\";\r\n break;\r\n }\r\n }", "public function setHtml($html)\n {\n $this->html = $this->message['html'] = $html;\n }", "public function html($html)\n {\n return $this->type($html, \"text/html\");\n }", "public function setBodyHtml($html);", "public function setEmailHeadHtml($value) { $this->_emailHeadHtml = $value; }", "public function setContentType ($type) {\r\n\t\t$this->content_type = Headers::getMimeType($type) ?: $type;\r\n\t}", "public function isHtml()\n\t{\n\t\treturn stripos($this->getContentType(), 'html') !== false;\n\t}", "function bodyContent($type_suffix)\n\t{\n\t\t$temp_layout = $this->controller->layout; // store the current controller layout\n\t\n\t\tif ($type_suffix == 'html')\n\t\t\t $this->controller->layout = '..'.DS.'email';\n\t\telse\n\t\t\t $this->controller->layout = '';\n\t\n\t\t$mail = $this->controller->render($this->templateLocation('_'.strtolower($type_suffix)));\n\t\t// render() automatically adds to the controller->output, we'll remove it\n\t\t$this->controller->output = str_replace($mail, '', $this->controller->output);\n\t\n\t\t$this->controller->layout = $temp_layout; // restore the controller layout\n\t\treturn $mail;\n\t}", "function sendHTMLMail($content,$recipient,$dummy,$fromEmail,$fromName,$replyTo='',$recepientsCopy='',$recepientsBcc='')\t{\n\t\tif (trim($recipient) && trim($content))\t{\n\t\t\t$cls=t3lib_div::makeInstanceClassName('t3lib_htmlmail');\n\t\t\tif (class_exists($cls))\t{\t// If htmlmail lib is included, then generate a nice HTML-email\n\t\t\t\t$parts = spliti('<title>|</title>',$content,3);\n\t\t\t\t$subject = trim($parts[1]) ? trim($parts[1]) : 'TYPO3 FE Admin message';\n\n\t\t\t\t$Typo3_htmlmail = t3lib_div::makeInstance('t3lib_htmlmail');\n\t\t\t\t$Typo3_htmlmail->start();\n\t\t\t\t$Typo3_htmlmail->useBase64();\n\n\t\t\t\t$Typo3_htmlmail->subject = $subject;\n\t\t\t\t$Typo3_htmlmail->from_email = $fromEmail;\n\t\t\t\t$Typo3_htmlmail->from_name = $fromName;\n\t\t\t\t$Typo3_htmlmail->replyto_email = $replyTo ? $replyTo : $fromEmail;\n\t\t\t\t$Typo3_htmlmail->replyto_name = $replyTo ? '' : $fromName;\n\t\t\t\t//modif by CMD - add return path information\n\t\t\t\t$Typo3_htmlmail->returnPath = $replyTo ? $replyTo : $fromEmail;\n\t\t\t\t$Typo3_htmlmail->organisation = '';\n\t\t\t\t$Typo3_htmlmail->priority = 3;\n\n\t\t\t\t\t// HTML\n\t\t\t\t$Typo3_htmlmail->theParts['html']['content'] = $content;\t// Fetches the content of the page\n\t\t\t\t$Typo3_htmlmail->theParts['html']['path'] = '';\n\t\t\t\t$Typo3_htmlmail->extractMediaLinks();\n\t\t\t\t$Typo3_htmlmail->extractHyperLinks();\n\t\t\t\t$Typo3_htmlmail->fetchHTMLMedia();\n\t\t\t\t$Typo3_htmlmail->substMediaNamesInHTML(0);\t// 0 = relative\n\t\t\t\t$Typo3_htmlmail->substHREFsInHTML();\n\t\t\t\t$Typo3_htmlmail->setHTML($Typo3_htmlmail->encodeMsg($Typo3_htmlmail->theParts['html']['content']));\n\n\t\t\t\t\t// PLAIN\n\t\t\t\t$Typo3_htmlmail->addPlain('');\n\n\t\t\t\t\t// SET Headers and Content\n\t\t\t\t$Typo3_htmlmail->setHeaders();\n\t\t\t\t$Typo3_htmlmail->setContent();\n\t\t\t\t$Typo3_htmlmail->setRecipient($recipient);\n\t\t\t\t$Typo3_htmlmail->recipient_copy=$recepientsCopy;\n\t\t\t\t$Typo3_htmlmail->recipient_blindcopy=$recepientsBcc;\n\t\t//\t\tdebug($Typo3_htmlmail->theParts);\n\t\t\t\t$Typo3_htmlmail->sendtheMail();\n\t\t\t} else {\n\t\t\t\tdebug('SYSTEM ERROR: No HTML-mail library loaded. Set \"page.config.incT3Lib_htmlmail = 1\" is your TypoScript template.');\n\t\t\t}\n\t\t}\n\t}", "function set_content_type($type) {\n $this->response->add_header('Content-Type', $type);\n }", "public function setContentType($content_type) {}", "public function setContentType($content_type);", "public static function setContentType($content_type) {}", "protected function makeTextPlainContentTypeWithCharsetHeaderString() {\n\t\treturn 'Content-type: text/plain; charset=\"' . $this->_mailCharset . '\" ' . $this->_endString;\n\t}", "public function __construct($type)\n\t{\n\t\tif(!$type){\n\t\t\t return response(array('error'=>true , 'success'=>false , 'message'=>'Please Define Type of Email'),400);\n\t\t}\n\t\t$this->type = $type;\n\n\t\t$mailSubject = '';\n\t\t/*$mailContent = '<div style=\\'font-size: 14px; padding: 10px 15px; background-image: initial; background-attachment: initial;background-color: #1CAF9A; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;\\'>\n\t\t<div style=\\'width:63%;display:inline-block;font-size: 19px;color: #FFF;\\'>Dear {user_name}</div>\n\t\t</div>\n\n\t\t<div style=\\'font-size: 14px; padding: 15px 10px; line-height: 20px; color: rgb(66, 65, 67); background-image: initial; background-attachment: initial; background-color: rgb(255, 255, 255); background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;\\'>\n\t\t<p>{message}</p>\n\t\t<p>&nbsp;</p>\n\t\t</div>';*/\n\n\t\t$mailContent = '<table>\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t<tr style=\"\tfloat: left; width: 100%; background: #ffffff; margin-bottom:15px;\">\n\t\t\t\t\t\t\t\t\t<td style=\"float: left; width: 96%; padding-left:20px; text-align: left; font-size: 26px; color: #343538; margin: 40px 0px 20px 0px;\">Hi, <span style=\"font-weight: bold;\">{user_name}</span></td>\n\t\t\t\t\t\t\t\t\t<td style=\"float: left; width: 96%; padding-left:20px; text-align: left; font-size: 16px; color: #474747; line-height: 22px; margin-bottom: 20px;\">{subject}</td>\n\t\t\t\t\t\t\t\t\t<td style=\"float: left; width: 96%; padding-left:20px; text-align: left; font-size: 16px; color: #474747; line-height: 22px; margin-bottom: 40px;\">{message}</td>\n\t\t\t\t\t\t\t\t</tr>\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>';\n\t\t\n\t\tif($type != 'customtemplate'){\n\t\t\t$this->template = EmailTemplate::find($type);\n\n\t\t\t$mailSubject = $this->template->subject;\n\t\t\t$mailContent = $this->template->content;\n\t\t}\n\t\t\n\n\t\t$settings = DB::collection('settings')->whereIn('_id',['general','social','email'])->get();\n\t\t$config = array();\n\n\t\tforeach($settings as $setting){\n\t\t\t$config[$setting['_id']] = $setting['settings'];\n\t\t}\n\n\t\t$siteUrl = url();\n\n\t\t$this->recipient_info = array(\n\n\t\t\t'sender' => array(\n\t\t\t\t'name' =>$config['general']['site_title']['value'],\n\t\t\t\t'email' =>$config['email']['default']['email']\n\t\t\t),\n\t\t\t'receiver' => array(\n\t\t\t\t'name' =>'',\n\t\t\t\t'email' =>''\n\t\t\t),\n\t\t\t'subject' => $mailSubject,\n\t\t\t'replace' => array(\n\t\t\t\t'{website_link}' => $siteUrl,\t\t\t\t\n\t\t\t\t'{site_title}' => $config['general']['site_title']['value'],\n\t\t\t\t'{link_login}' => $siteUrl.'/login',\n\t\t\t\t'{link_privacy}' => $siteUrl.'/privacy-policy',\t\t\t\t\n\t\t\t\t'{link_contact}' => $siteUrl.'/contact-us',\n\t\t\t\t'{social_facebook}' => $config['social']['facebook']['value'],\n\t\t\t\t'{social_twitter}' => $config['social']['twitter']['value'],\n\t\t\t\t'{copyright_year}' => date('Y')\n\t\t\t),\n\t\t\t'message' => $mailContent\n\t\t);\n\n\t}", "public static function contentHtml($code = 200): void\n {\n self::set(\"Content-Type\", \"text/html\", true, $code ?? self::$httpCode);\n }", "public function getEmailFormat() {\n\t\tglobal $wgAllowHTMLEmail;\n\n\t\tif ( $wgAllowHTMLEmail ) {\n\t\t\treturn $this->mUser->getOption( 'echo-email-format' );\n\t\t} else {\n\t\t\treturn EchoEmailFormat::PLAIN_TEXT;\n\t\t}\n\t}", "public function setContentType($val){ return $this->setHeader('Content-Type',$val); }", "function setBodyHtml($content)\n {\n $htmlPart = new MimePart();\n\n $htmlPart->setContent($content)\n ->setType(Mime::TYPE_HTML)\n ->setCharset($this->zendMessage->getEncoding())\n ->setDisposition(Mime::DISPOSITION_INLINE)\n ->setEncoding(Mime::ENCODING_QUOTEDPRINTABLE);\n\n $this->parts[] = $htmlPart;\n\n return $this;\n }", "public function setContentType($type)\r\n {\r\n $this->repo['header']['Content-Type'] = $type;\r\n }", "public function isHtml() {}", "public function sendContentTypeHeader($type)\n {\n switch ($type) {\n case 'xml': header('Content-Type: text/xml; charset=utf-8');\n break;\n case 'rss': header('Content-Type: application/rss+xml; charset=utf-8');\n break;\n case 'json': header('Content-Type: application/json; charset=utf-8');\n break;\n case 'css': header('Content-Type: text/css; charset=utf-8');\n break;\n case 'js': header('Content-Type: application/javascript; charset=utf-8');\n break;\n case 'ico': header('Content-Type: image/x-icon');\n break;\n case 'nzb': header('Content-Type: application/x-nzb');\n break;\n\n default: header('Content-Type: text/html; charset=utf-8');\n break;\n } // switch\n }", "private function SetMessageType() {\n\t if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) {\n\t $this->message_type = 'plain';\n\t } else {\n\t if(count($this->attachment) > 0) {\n\t $this->message_type = 'attachments';\n\t }\n\t if(strlen($this->AltBody) > 0 && count($this->attachment) < 1) {\n\t $this->message_type = 'alt';\n\t }\n\t if(strlen($this->AltBody) > 0 && count($this->attachment) > 0) {\n\t $this->message_type = 'alt_attachments';\n\t }\n\t }\n \t}", "public function set_content_type($mime);", "public function set_content_type($mime);", "function http_set_content_type($content_type)\n\t{\n\t\t$this->http_content_type = $content_type;\n\t}", "function setContentType($content_type){\n\t\tsettype($content_type,\"string\");\n\t\tif(preg_match('/^([^;]+); charset=[\"\\']?([^\\s;]+)[\"\\']?$/',$content_type,$matches)){\n\t\t\t$content_type = $matches[1];\n\t\t\t$this->setContentCharset($matches[2]);\n\t\t}\n\t\t$this->_ContentType_Redefined = true;\n\t\t$this->_ContentType = $content_type;\n\t}", "public function setEmailFootHtml($value) { $this->_emailFootHtml = $value; }", "public function setHTMLMessage($message);", "protected function setPlainContent() {}", "public function setContentType($type) {\n\n if (isset($this->headers['content-type'])) {\n\n // Preserve the charset in the content type\n $h = $this->headers['content-type'];\n $pos = strpos($h['value'], ';');\n\n if ($pos !== false) {\n $type = $type . substr($h['value'], $pos);\n }\n }\n\n $this->headers['content-type'] = array(\n 'name' => 'Content-type',\n 'value' => $type\n );\n\n return $this;\n }", "protected function setHtmlContent() {}", "public function __construct($contentType = 'text/html')\r\n {\r\n $this->setContentType($contentType);\r\n }", "protected function setMessageType()\n {\n $type = array();\n if ($this->alternativeExists()) {\n $type[] = 'alt';\n }\n if ($this->inlineImageExists()) {\n $type[] = 'inline';\n }\n if ($this->attachmentExists()) {\n $type[] = 'attach';\n }\n $this->message_type = implode('_', $type);\n if ($this->message_type == '') {\n //The 'plain' message_type refers to the message having a single body element, not that it is plain-text\n $this->message_type = 'plain';\n }\n }", "public function isHTML(): bool\n\t{\n\t\treturn $this->isOfType( static::TYPE_HTML );\n\t}", "public abstract function asHTML();", "public function setContentType($type)\n\t{\n\t\t$this->contenttype = $type;\n\t}", "protected function getContentType(): string\n {\n if ($this->attachments) {\n return 'multipart/mixed; boundary=\"' . $this->getBoundary() . '\"';\n }\n $emailFormat = $this->format();\n\n if ($emailFormat === 'both') {\n return 'multipart/alternative; boundary=\"' . $this->getBoundary() . '\"';\n }\n if ($emailFormat === 'html') {\n return 'text/html; charset=\"' . $this->charset . '\"';\n }\n\n return 'text/plain; charset=\"' . $this->charset . '\"';\n }", "public function wrap_HTML_with_HTML_tags()\n\t{\n\t\t$this->HTML = '<html><body>'.$this->HTML.'</body></html>';\n\t}", "public function setBodyHtml(string $content)\n {\n $this->setBody([static::MESSAGE_HTML => $content]);\n\n return $this;\n }", "public function isHTML($isHtml = true)\n {\n }", "protected function _setContentType() {\n\t\tif (in_array($this->_status, array(304, 204))) {\n\t\t\treturn;\n\t\t}\n\t\t$whitelist = array(\n\t\t\t'application/javascript', 'application/json', 'application/xml', 'application/rss+xml'\n\t\t);\n\n\t\t$charset = false;\n\t\tif ($this->_charset &&\n\t\t\t(strpos($this->_contentType, 'text/') === 0 || in_array($this->_contentType, $whitelist))\n\t\t) {\n\t\t\t$charset = true;\n\t\t}\n\n\t\tif ($charset) {\n\t\t\t$this->header('Content-Type', \"{$this->_contentType}; charset={$this->_charset}\");\n\t\t} else {\n\t\t\t$this->header('Content-Type', \"{$this->_contentType}\");\n\t\t}\n\t}", "function set_html($html=true)\n\t{\n\t\t$this->html = true;\n\t}", "function send_mime_mail(\r\n\t$name_from, // имя отправителя\r\n\t$email_from, // email отправителя\r\n\t$name_to, // имя получателя\r\n\t$email_to, // email получателя\r\n\t$data_charset, // кодировка переданных данных\r\n\t$send_charset, // кодировка письма\r\n\t$subject, // тема письма\r\n\t$body // текст письма\r\n\t) {\r\n\t\r\n\t$email_to = explode(',', trim(trim($email_to),','));\r\n\r\n\tforeach($email_to as $email)\r\n\t{\r\n\t\t$emails[] = mime_header_encode($name_to, $data_charset, $send_charset) . ' <' . trim($email) . '>';\r\n\t}\r\n\t$to = implode(',', $emails);\r\n\t\r\n\t$subject = mime_header_encode($subject, $data_charset, $send_charset);\r\n\t$from = mime_header_encode($name_from, $data_charset, $send_charset) .' <' . $email_from . '>';\r\n\t\r\n\tif($data_charset != $send_charset) {\r\n\t\t$body = iconv($data_charset, $send_charset, $body);\r\n\t}\r\n\t\r\n\t$headers = \"From: $from\\r\\n\";\r\n\t$headers .= \"Content-type: text/html; charset=$send_charset\\r\\n\";\r\n\t$headers .= \"Mime-Version: 1.0\\r\\n\";\r\n\t\r\n\treturn mail($to, $subject, $body, $headers);\r\n}", "function send($mail_type='html', $from, $name_from='', $to, $subject, $content)\n\t{\n\t\t$this->email->clear();\n\t\t$config['charset'] = $this->config->item('charset');\n\t\t$config['mailtype'] =$mail_type;\n\t\t$config['validate'] =TRUE;\n\t\t$this->email->initialize($config);\n\t\tif( $name_from=='' ) $this->email->from($from);\n\t\telse $this->email->from($from, $name_from);\n\t\t$this->email->to($to);\n\t\t$this->email->subject($subject);\n\t\t$this->email->message($content);\n\t\tif ( ! $this->email->send()) return false;\n\t\treturn true;\n\t}", "public function getMailMIME()\n {\n }", "public function set_content_type( $type ) {\n $this->content_type = $type;\n return $this;\n }", "public function setContentType( string $type ) : void\n {\n $this->headers->set( 'Content-Type', $type );\n }", "public static function enableHtmlExtension()\r\n {\r\n self::$html = true;\r\n }", "function getFormat() {\n return 'xhtml';\n }", "static public function isHTML() {\n\t\treturn (self::$page_type === 0);\n\t}", "private function emailTemplate($data) {\n $body = array_reduce($data, function($prevInput, $curInput) {\n return $prevInput . '<p style=\"font-family:sans-serif;font-size:14px;font-weight:normal;margin:0;Margin-bottom:2px;\">' . $curInput['name'] . ': ' . $curInput['value'] . '</p>' . PHP_EOL;\n });\n\n $email = '<!DOCTYPE html>\n <html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <title>New Online Donation</title>\n <style type=\"text/css\">\n @media only screen and (max-width: 620px) {\n table[class=body] h1 {\n font-size: 28px !important;\n margin-bottom: 10px !important; }\n table[class=body] p,\n table[class=body] ul,\n table[class=body] ol,\n table[class=body] td,\n table[class=body] span,\n table[class=body] a {\n font-size: 16px !important; }\n table[class=body] .wrapper,\n table[class=body] .article {\n padding: 10px !important; }\n table[class=body] .content {\n padding: 0 !important; }\n table[class=body] .container {\n padding: 0 !important;\n width: 100% !important; }\n table[class=body] .main {\n border-left-width: 0 !important;\n border-radius: 0 !important;\n border-right-width: 0 !important; }\n table[class=body] .btn table {\n width: 100% !important; }\n table[class=body] .btn a {\n width: 100% !important; }\n table[class=body] .img-responsive {\n height: auto !important;\n max-width: 100% !important;\n width: auto !important; }}\n @media all {\n .ExternalClass {\n width: 100%; }\n .ExternalClass,\n .ExternalClass p,\n .ExternalClass span,\n .ExternalClass font,\n .ExternalClass td,\n .ExternalClass div {\n line-height: 100%; }\n .apple-link a {\n color: inherit !important;\n font-family: inherit !important;\n font-size: inherit !important;\n font-weight: inherit !important;\n line-height: inherit !important;\n text-decoration: none !important; }\n .btn-primary table td:hover {\n background-color: #34495e !important; }\n .btn-primary a:hover {\n background-color: #34495e !important;\n border-color: #34495e !important; } }\n </style>\n </head>\n <body class=\"\" style=\"background-color:#f6f6f6;font-family:sans-serif;-webkit-font-smoothing:antialiased;font-size:14px;line-height:1.4;margin:0;padding:0;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"body\" style=\"border-collapse:separate;mso-table-lspace:0pt;mso-table-rspace:0pt;background-color:#f6f6f6;width:100%;\">\n <tr>\n <td style=\"font-family:sans-serif;font-size:14px;vertical-align:top;\">&nbsp;</td>\n <td class=\"container\" style=\"font-family:sans-serif;font-size:14px;vertical-align:top;display:block;max-width:960px;padding:10px;width:100%;Margin:0 auto !important;\">\n <div class=\"content\" style=\"box-sizing:border-box;display:block;Margin:0 auto;max-width:100%;padding:10px;\">\n <span class=\"preheader\" style=\"color:transparent;display:none;height:0;max-height:0;max-width:0;opacity:0;overflow:hidden;mso-hide:all;visibility:hidden;width:0;\">New Form Submission</span>\n <table class=\"main\" style=\"border-collapse:separate;mso-table-lspace:0pt;mso-table-rspace:0pt;background:#fff;border-radius:3px;width:100%;\">\n <tr>\n <td class=\"wrapper\" style=\"font-family:sans-serif;font-size:14px;vertical-align:top;box-sizing:border-box;padding:20px;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse:separate;mso-table-lspace:0pt;mso-table-rspace:0pt;width:100%;\">\n <tr>\n <td style=\"font-family:sans-serif;font-size:14px;vertical-align:top;\">\n <p style=\"font-family:sans-serif;font-size:24px;font-weight:normal;margin:0;Margin-bottom:24px;\">Here are the details:</p>\n ' . $body . '\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </div>\n </td>\n <td style=\"font-family:sans-serif;font-size:14px;vertical-align:top;\">&nbsp;</td>\n </tr>\n </table>\n </body>\n </html>';\n \n return $email;\n }", "function EMAIL_test($e_to,$e_to_name,$e_subject,$e_in_subject,$e_body){\n\t\t\t// Create the mail transport configuration\n\t\t\t$transport = Swift_MailTransport::newInstance();\n\t\t\t\n\t\t\t// Create the message\n\t\t\t$message = Swift_Message::newInstance();\n\t\t\t$message->setTo(array(\n\t\t\t $e_to => $e_to_name\n\t\t\t));\n\t\t\t$message->setSubject($e_subject . \" - UnitedGaming\");\n\t\t\t$message->setBody(\n\t\t\t'<html>\n\t\t\t<link href=\"http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700\" rel=\"stylesheet\" type=\"text/css\"/>\n\t\t\t<table border=\"0\" align=\"center\">\n\t\t\t<tr>\n\t\t\t<td><a href=\"http://unitedgaming.org\" target=\"_blank\" title=\"UnitedGaming\" alt=\"UnitedGaming\"><img src=\"http://unitedgaming.org/mainlogo.png\" alt=\"UnitedGaming\" border=\"0\"/></td>\n\t\t\t<td><font face=\"Source Sans Pro\" size=\"6px\" color=\"#BD3538\">'.$e_in_subject.'</font></td>\n\t\t\t</tr>' \n\t\t\t.\n\t\t\t'<br/><br /><br/><tr>\n\t\t\t<td colspan=\"2\"><font face=\"Arial\" size=\"3px\" color=\"#303030\">'.$e_body.'\n\t\t\t </td></tr><tr><td><br/><font face=\"Source Sans Pro\" size=\"2px\">Kind Regards,<br/>Chuevo</font></td><td></td></tr></table></html>\n\t\t\t ');\n\t\t\t$message->setFrom(\"[email protected]\", \"UnitedGaming\");\n\t\t\t$type = $message->getHeaders()->get('Content-Type');\n\n\t\t\t$type->setValue('text/html');\n\t\t\t$type->setParameter('charset', 'utf-8');\n\t\t\t\n\t\t\t//echo $type->toString();\n\t\t\t\n\t\t\t/*\n\t\t\t\n\t\t\tContent-Type: text/html; charset=utf-8\n\t\t\t\n\t\t\t*/\n\t\t\t// Send the email\n\t\t\t$mailer = Swift_Mailer::newInstance($transport);\n\t\t\t$mailer->send($message);\n}", "function setTypeAsCustom($HTML) {\n\t\t$this->type = \"custom\";\n\t\t$this->customHTML = $HTML;\n\t}", "function contentType()\n {\n return '';\n }", "function constructHTML($boundary) {\n\t\tif (count($this->theParts['html']['media']) && $this->includeMedia) {\t// If media, then we know, the multipart/related content-type has been set before this function call...\n\t\t\t$this->add_message('--'.$boundary);\n\t\t\t\t// HTML has media\n\t\t\t$newBoundary = $this->getBoundary();\n\t\t\t$this->add_message('Content-Type: multipart/alternative;');\n\t\t\t$this->add_message(' boundary=\"'.$newBoundary.'\"');\n\t\t\t$this->add_message('Content-Transfer-Encoding: 7bit');\n\t\t\t$this->add_message('');\n\n\t\t\t$this->constructAlternative($newBoundary);\t// Adding the plaintext/html mix\n\n\t\t\t$this->constructHTML_media($boundary);\n\t\t} else {\n\t\t\t$this->constructAlternative($boundary);\t// Adding the plaintext/html mix, and if no media, then use $boundary instead of $newBoundary\n\t\t}\n\t}", "private function _set_body () {\n // do we need to encode??\n $encode = (empty($this->htmlbody) && empty($this->attachments)) ? false : true;\n\n if ($encode) {\n $this->full_body = \"This is a multi-part message in MIME format.\\n\\n\";\n $this->full_body .= '--'.$this->boundary.\"\\nContent-Type: multipart/alternative;\\n\\tboundary=\\\"\".$this->boundary_alt.\"\\\"\\n\\n\\n\";\n $body_boundary = $this->boundary_alt;\n $this->xheaders['Content-Type'] = \"multipart/mixed;\\n\\tboundary=\\\"\".$this->boundary.'\"';\n\n if (!empty($this->body)) {\n $this->full_body .= '--'.$body_boundary.\"\\nContent-Type: text/plain; charset=\".$this->charset.\"\\nContent-Transfer-Encoding: \".$this->ctencoding.\"\\n\\n\".$this->body.\"\\n\\n\";\n }\n if (!empty($this->htmlbody)) {\n $this->full_body .= '--'.$body_boundary.\"\\nContent-Type: text/html; charset=\".$this->charset.\"\\nContent-Transfer-Encoding: \".$this->ctencoding.\"\\n\\n\".$this->htmlbody.\"\\n\\n\";\n }\n\n $this->full_body .= '--'.$body_boundary.\"--\\n\\n\";\n\n if (!empty($this->attachments)) {\n $this->_build_attachments();\n }\n $this->full_body .= '--'.$this->boundary.'--'; // ends the last boundary\n }\n // else we just send plain text.\n else {\n if (!empty($this->body)) {\n $this->full_body = $this->body;\n }\n else {\n throw new Exception(\"Cannot send, no body\");\n }\n }\n }", "protected function setHtmlType(Field &$field, $type)\n {\n $map = $this->getMap();\n\n if (array_key_exists($type, $map)) {\n $field->htmlType = $map[$type];\n }\n\n return $this;\n }", "private function addContentTypeMetaTag($html)\n {\n $hasContentTypeMetaTag = stripos($html, 'Content-Type') !== false;\n if ($hasContentTypeMetaTag) {\n return $html;\n }\n\n // We are trying to insert the meta tag to the right spot in the DOM.\n // If we just prepended it to the HTML, we would lose attributes set to the HTML tag.\n $hasHeadTag = stripos($html, '<head') !== false;\n $hasHtmlTag = stripos($html, '<html') !== false;\n\n if ($hasHeadTag) {\n $reworkedHtml = preg_replace('/<head(.*?)>/i', '<head$1>' . static::CONTENT_TYPE_META_TAG, $html);\n } elseif ($hasHtmlTag) {\n $reworkedHtml = preg_replace(\n '/<html(.*?)>/i',\n '<html$1><head>' . static::CONTENT_TYPE_META_TAG . '</head>',\n $html\n );\n } else {\n $reworkedHtml = static::CONTENT_TYPE_META_TAG . $html;\n }\n\n return $reworkedHtml;\n }", "private function autoResponderEmailStr(){\n\t\t$NL=\"\\r\\n\";\n\t\t$s_style = 'font-size:'.$this->_emailFontSize.'; font-family:'.$this->_emailFontFamily.';';\n\t\t\n\t\t$s_emailContentRaw = $this->_autoResponderEmailContent;\n\t\t$s_emailContent = str_replace('{{tableContent}}', $this->getFormTableContent(), $s_emailContentRaw);\n\t\t\n\t\t$s_ret='<div style=\"'.$s_style.'\">'.$NL.$s_emailContent.$NL.'</div>';\n\t\treturn $s_ret;\n\t}", "public function setTextHtmlEncoding($encoding='quoted-printable') {\n\t\tif(!empty($encoding)) {\n\t\t\t$this->_mailTextHtmlContentTransferEncoding = $encoding;\n\t\t}\n\t}", "function html_email($recipient,$subject,$message,$from,$replyto)\n{ \n\t$array = array(\"\\'\" => \"'\"); \n\t$message = strtr($message, $array); \n\t$message = '<html><body>'.$message.'</body></html>'.\"\\r\\n\\r\\n\";\n\t$extra = 'From: '.$from.' <'.$replyto.'>'.\"\\r\\n\";\n\t$extra .= 'Content-Type: text/html; charset=\"ISO-8859-1\"'.\"\\r\\n\";\n\t$extra .= 'Content-Transfer-Encoding: quoted-printable'.\"\\n\\r\\n\";\n\tmail($recipient, $subject, $message, $extra);\n}", "public function change_email_sent()\n {\n $this->_render();\n }", "public function setHtmlContent($html)\n {\n $this->htmlContent = $html;\n }", "public function setHtml();", "public function setMessage($message, $type = 'text/html')\n {\n $this->type = $type;\n\n $this->message = $message;\n }", "function _send_email($type, $email,$data, $subject,$from){ \n\n $this->load->library('email'); \n $this->email->from(FROM_EMAIL, EMAIL_TITLE);\n $this->email->to($email);\n $this->email->subject($subject);\n $this->email->message($this->load->view('email/'.$type.'-html', $data, TRUE));\n if($this->email->send()){\n return true;\n }else{\n return false;\n }\n }", "protected function _getMimeType()\n\t{\n\t\treturn 'text/text';\n\t}" ]
[ "0.8192363", "0.8154191", "0.79322875", "0.79306173", "0.7742468", "0.76622224", "0.7546051", "0.7319537", "0.72763056", "0.7211348", "0.7134699", "0.6922389", "0.6914255", "0.6902276", "0.68219656", "0.670772", "0.66436446", "0.6631612", "0.66147417", "0.64529926", "0.6361662", "0.62393135", "0.6212256", "0.6205025", "0.61964375", "0.6188724", "0.61020005", "0.6095255", "0.608275", "0.60712886", "0.6014606", "0.60118717", "0.5991724", "0.5988607", "0.59239024", "0.5922354", "0.5882001", "0.58702576", "0.58689934", "0.5850745", "0.58342326", "0.5805809", "0.5805159", "0.5773969", "0.5773766", "0.5770776", "0.5766057", "0.57418853", "0.5737907", "0.56935203", "0.5674483", "0.5667372", "0.56660706", "0.5660175", "0.5645135", "0.5644227", "0.5644227", "0.5637993", "0.56366694", "0.5624518", "0.5610448", "0.56090647", "0.5594268", "0.55889153", "0.5571246", "0.55702335", "0.5556733", "0.55465245", "0.5524388", "0.5513518", "0.55097955", "0.55013317", "0.54904604", "0.5471358", "0.54698646", "0.5462057", "0.5458229", "0.5450727", "0.5448564", "0.54452825", "0.5439138", "0.5438206", "0.542452", "0.5418003", "0.5417975", "0.5416855", "0.54064715", "0.5394732", "0.538805", "0.53874123", "0.53838456", "0.5379914", "0.5378198", "0.53757256", "0.53753984", "0.5361164", "0.5353425", "0.5351316", "0.53494793", "0.5338347" ]
0.70466334
11
Create a new controller instance.
public function __construct() { $this->middleware('auth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.6877748", "0.68702674", "0.68622285", "0.6839049", "0.6779292", "0.6703522", "0.66688496", "0.66600126", "0.6650373", "0.66436416", "0.6615505", "0.66144013", "0.6588728", "0.64483404", "0.64439476", "0.6429303", "0.6426485", "0.6303757", "0.6298291", "0.6293319", "0.62811387", "0.6258778", "0.62542456", "0.616827", "0.6162314", "0.61610043", "0.6139887", "0.613725", "0.61334985", "0.6132223", "0.6128982", "0.61092585", "0.6094611", "0.60889256", "0.6074893", "0.60660255", "0.6059098", "0.60565156", "0.6044235", "0.60288006", "0.6024102", "0.60225666", "0.6018304", "0.60134345", "0.60124683", "0.6010913", "0.6009284", "0.6001683", "0.5997471", "0.5997012", "0.59942573", "0.5985074", "0.5985074", "0.5985074", "0.5967613", "0.5952533", "0.5949068", "0.5942203", "0.5925731", "0.5914304", "0.5914013", "0.59119135", "0.5910308", "0.5910285", "0.59013796", "0.59003943", "0.5897524", "0.58964556", "0.58952993", "0.58918965", "0.5888943", "0.5875413", "0.5869938", "0.58627135", "0.58594996", "0.5853714", "0.5839484", "0.5832913", "0.582425", "0.58161044", "0.5815566" ]
0.0
-1
Get file for data with series.
public function getDataFile(Request $request) { return $this->getFile($request, 'data_file'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDataFile() \n\t{\n\t\treturn $this->_dataFile;\n\t}", "public function dataFile()\n {\n return new DataFile(data_path().'/'.$this->getHashedId());\n }", "public function loadFiles(){\n\n $files = array();\n\n if($this->id == -1 || empty($this->databasePath))\n return $series;\n\n\n $sqlQuery = 'SELECT D.* FROM data D , books B WHERE B.id = D.book AND B.id='.$this->id;\n\n $pdo = new SPDO($this->databasePath);\n foreach ($pdo->query($sqlQuery) as $row)\n $files[] = BookFile::_createFromRow($this->databasePath, $row); \n \n return $files;\n }", "public static function getDataFile()\n {\n return static::$dataFile;\n }", "public function getFile();", "public function getFile();", "function getFile() {\n\t\treturn ArtifactStorage::instance()->get($this->getID());\n\t}", "public function getFile ();", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function getFile() {}", "public function getFile() {}", "public function getFile() {\n\t\treturn $this->data['file'];\n\t}", "public static function getFile() {}", "public function getFile(): string;", "public function getFile(): string;", "public function getFile(): string;", "public function getFile(): string\n {\n return $this->file;\n }", "public function file($key=null,$value=null){\n return $this->methodsData(\"file\",$key,$value);\n }", "public function getFile(): string\n {\n return $this->filePath;\n }", "public function get_cached_path() {\n // Set either the source or cache file as our datasource\n if ($this->serve_default)\n {\n $file_data = $this->source_file;\n }\n else\n {\n $file_data = $this->cached_file;\n }\n\n // Output the file\n return $file_data;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "protected function getOneFile($fileId) {\n $sql = \"SELECT * FROM satdatameta WHERE idSatDataMeta = ? \";\n $stmt = $this->connect()->prepare($sql);\n $stmt->execute([$fileId]);\n $results = $stmt->fetchAll();\n return $results;\n }", "public function getFilePath(): string;", "public function getFilePath(): string;", "public function getFile() {\n return $this->file;\n }", "public function getFile() {\n return $this->file;\n }", "final function getFile();", "public function get_file()\n {\n return $this->file;\n }", "public function getSeriesPath() : array {\n return $this->seriesPath;\n }", "public function getFilename() {\n return $this->getData('file');\n }", "public function getSeries(): string\n {\n return $this->series;\n }", "public function getFilename() {}", "public function getFile() {\n\n return $this->file;\n }", "public function getFile()\n {\n return $this->readOneof(1);\n }", "public function get_file() {\n\t\treturn $this->file;\n\t}", "public function getFilename();", "public function getFilename();", "public function getFile()\n\t{\n\t\treturn $this->file;\n\t}", "public function getFile()\n\t{\n\t\treturn $this->file;\n\t}", "public function getFile():string {\n\t\t\treturn $this->file;\n\t\t}", "function get_file()\n\t{\n\t\treturn $this->file;\n\t}", "public function GetFile()\n\t{\n\t\treturn $this->objOutputFile;\n\t}", "public function getFile()\n {\n return $this->_File;\n }", "public function file()\n {\n return $this->file;\n }", "public function getf() {\n return $this->file;\n }", "protected function filename()\n {\n return 'inventarisdatatable_' . time();\n }", "public function file() {\n return $this->file;\n }", "public function getFile()\n\t{\n\t\treturn $this->file; \n\n\t}", "public function getFile()\n {\n $file = Input::file('report');\n $filename = $this->doSomethingLikeUpload($file);\n\n // Return it's location\n return $filename;\n }", "public function getSeriesData($uuid)\n {\n $url = $this->url.\"/series/\".$uuid;\n return $this->getContent2($url);\n }", "function getFile(): object {\n return $this->file;\n }", "protected function get_file() {\r\n\t\t$file = '';\r\n\r\n\t\tif ( @file_exists( $this->file ) ) {\r\n\t\t\tif ( ! is_writeable( $this->file ) ) {\r\n\t\t\t\t$this->is_writable = false;\r\n\t\t\t}\r\n\r\n\t\t\t$file = @file_get_contents( $this->file );\r\n\t\t} else {\r\n\t\t\t@file_put_contents( $this->file, '' );\r\n\t\t\t@chmod( $this->file, 0664 );\r\n\t\t}\r\n\r\n\t\treturn $file;\r\n\t}", "function getData() {\n\t\treturn file_get_contents($this->getFile());\n\t}", "public function getData() {\n\t\t$this->validate();\n\n\t\t// add file header record\n\t\t$data = $this->header->getData();\n\n\t\t// add file batch records\n\t\tforeach ($this->batches as $batch) {\n\t\t\t$data .= $batch->getData();\n\t\t}\n\t\t// add file control record.\n\t\t$data .= $this->control->getData();\n\n\t\treturn $data;\n\t}", "protected function get_file() {\n\n\t\t$file = '';\n\n\t\tif ( @file_exists( $this->file ) ) {\n\n\t\t\tif ( ! is_writeable( $this->file ) ) {\n\t\t\t\t$this->is_writable = false;\n\t\t\t}\n\n\t\t\t$file = @file_get_contents( $this->file );\n\n\t\t} else {\n\n\t\t\t@file_put_contents( $this->file, '' );\n\t\t\t@chmod( $this->file, 0664 );\n\n\t\t}\n\n\t\treturn $file;\n\t}", "public function getRegisteredServicePersistentFile(): string;", "abstract protected function getFile(): File;", "public function getData() {\n\t\t/** @var GoogleApi_Helper */\n\t\t$helper = DI::getDefault()->get('googleApiHelper');\n\t\treturn $helper->getFileDataById($this->googleId);\n\t}", "public function getFile() {\n return $this->getFiles()->getFirst();\n }", "public function getFile()\r\n\t{\r\n\t\t// This if statement allows for you to continue using this class AFTER insert\r\n\t\t// basically it will only get the file if you plan on using it further which means that\r\n\t\t// otherwise it omits at least one database call each time\r\n\t\tif($this->_id instanceof ObjectID && !$this->_file instanceof GridFSDownload){\r\n\t\t\treturn $this->_file = $this->getCollection()->get($this->_id);\r\n\t\t}\r\n\t\treturn $this->_file;\r\n\t}", "function getFile() {\n return IMMOTOOL_BASE_PATH . 'cache/order.' . $this->getName();\n }", "public function getFileName();", "public function getFileName();", "public function getFileName();", "function getSeries($series_id) {\n\n $service_url = \"/series/\".$series_id.\".json\";\n if($series = self::getJSON($service_url)){\n return $series;\n } else return false;\n }", "private function _file()\n {\n return Html::getAttributeValue($this->model, $this->attribute);\n }", "public static function getSlicerFile()\r\n {\r\n return trim( getenv( 'SLICER' ) ) ?: './slicer.json';\r\n }", "protected function filename()\n {\n return 'newsItemDataTable_' . time();\n }", "public function getFileName(): string;", "public function getSeries()\n {\n return $this->series;\n }", "public function getFileInfo()\n {\n $info = $this->getProduct()->getPreconfiguredValues()->getData('options/' . $this->getOption()->getId());\n if (empty($info)) {\n $info = new Varien_Object();\n } else if (is_array($info)) {\n $info = new Varien_Object($info);\n }\n return $info;\n }", "public function getSeries(){\n\t\treturn $this->Series;\n\t}", "private function tempFilePath()\n {\n $path = 'exports/'.Str::random();\n\n // Make sure the file exists\n Storage::put($path, null);\n\n return Storage::path($path);\n }", "public function getFilePath() {\n\t\t$spec = self::$specs[$this->id];\n\t\treturn array_value($spec, \"filepath\", NULL);\n\t}", "function fiftyone_degrees_get_data_file($offset = 0) {\n global $_fiftyone_degrees_data_file;\n if ($_fiftyone_degrees_data_file == NULL) {\n die('A 51Degrees data file has not been set.');\n }\n if ($offset >= 0) {\n fseek($_fiftyone_degrees_data_file, $offset);\n }\n return $_fiftyone_degrees_data_file;\n}", "public function getTempFile()\n {\n return $this->tempFile;\n }", "public function toFile($fileName) {\r\n\r\n $f=fopen($fileName,'w');\r\n if($f==false)\r\n {\r\n die(\"Unable to create file\");\r\n }\r\n else\r\n {\r\n if (file_exists($fileName)) { \r\n $str = SerializeManager::instance()->serializeObject($this->chart);\r\n fwrite($f, $str);\r\n fclose($f); \r\n }\r\n else\r\n {\r\n $str = SerializeManager::instance()->serializeObject($this->chart);\r\n fwrite($f, $str);\r\n fclose($f); \r\n }\r\n } \r\n }", "private function getFile(){\n if($this->checkStatus()){\n chdir('..');\n $filePos = $this->sanitizeInt($this->json->filePos);\n $fileName = $this->sanitizeString($this->json->fileName);\n $fileContents = file_get_contents('aud/'.$fileName);\n $fileMime = mime_content_type('aud/'.$fileName);\n $fileEncode = base64_encode($fileContents);\n $fileArray = array(\n 'fileName' => $fileName,\n 'fileMime' => $fileMime,\n 'fileEncode' => $fileEncode,\n 'filePos' => $filePos\n );\n header('content-type: application/json');\n echo json_encode($fileArray);\n } else {\n $this->notFound404();\n } \n }", "public function getFileInfo()\n\t{\n\t\treturn $this->data;\n\t}", "private function getDatFilePath()\n\t{\n\t\treturn Zend_Registry::get('config')->get('minecraft')->get('worldPath') . '/world/players/' . $this->_username . '.dat';\n\t}", "public function getFile() {\n // Import a user provided file\n\n $file = Input::file('spreadsheet');\n\n $filename = time() . '_' . $file->getClientOriginalName();\n\n $file = $file->move('uploads/csv/', $filename);\n\n // Return it's location\n return $file->getPathname();\n }", "public function getImageFile()\n {\n $link = $this->link;\n return empty( $this->owner->$link ) ? null : \\Yii::getAlias(\n '@storage/' . $this->directory . '/' . $this->owner->$link\n );\n }", "public function getFilePath(): string\n {\n return oas_path(\n $this->version . '/components/schemas/' . $this->getFileName() . '.json'\n );\n }", "public function getSeries() {\n return $this->series;\n }", "protected function getFileDataKey($key)\n {\n list($fileUidOrCurrentKeyword, $requestedFileInformationKey) = explode(':', $key, 3);\n try {\n if ($fileUidOrCurrentKeyword === 'current') {\n $fileObject = $this->getCurrentFile();\n } elseif (MathUtility::canBeInterpretedAsInteger($fileUidOrCurrentKeyword)) {\n /** @var ResourceFactory $fileFactory */\n $fileFactory = GeneralUtility::makeInstance(ResourceFactory::class);\n $fileObject = $fileFactory->getFileObject($fileUidOrCurrentKeyword);\n } else {\n $fileObject = null;\n }\n } catch (Exception $exception) {\n /** @var \\TYPO3\\CMS\\Core\\Log\\Logger $logger */\n $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__);\n $logger->warning('The file \"' . $fileUidOrCurrentKeyword . '\" could not be found and won\\'t be included in frontend output', ['exception' => $exception]);\n $fileObject = null;\n }\n\n if ($fileObject instanceof FileInterface) {\n // All properties of the \\TYPO3\\CMS\\Core\\Resource\\FileInterface are available here:\n switch ($requestedFileInformationKey) {\n case 'name':\n return $fileObject->getName();\n case 'uid':\n if (method_exists($fileObject, 'getUid')) {\n return $fileObject->getUid();\n }\n return 0;\n case 'originalUid':\n if ($fileObject instanceof FileReference) {\n return $fileObject->getOriginalFile()->getUid();\n }\n return null;\n case 'size':\n return $fileObject->getSize();\n case 'sha1':\n return $fileObject->getSha1();\n case 'extension':\n return $fileObject->getExtension();\n case 'mimetype':\n return $fileObject->getMimeType();\n case 'contents':\n return $fileObject->getContents();\n case 'publicUrl':\n return $fileObject->getPublicUrl();\n default:\n // Generic alternative here\n return $fileObject->getProperty($requestedFileInformationKey);\n }\n } else {\n // @todo fail silently as is common in tslib_content\n return 'Error: no file object';\n }\n }", "public function getFile($datas = [])\r\n {\r\n return $this->telegram(\"getFile\", $datas);\r\n }", "public function getFactuurFile() {\n\t\treturn $this->factuurFile;\n\t}" ]
[ "0.61168736", "0.5966397", "0.59651023", "0.5855465", "0.5700173", "0.5700173", "0.5676011", "0.5633102", "0.5625633", "0.5625633", "0.5625633", "0.5625633", "0.56067044", "0.5606426", "0.55759615", "0.55074984", "0.5488539", "0.5488539", "0.5488539", "0.5486523", "0.5464225", "0.5434169", "0.53862876", "0.5351132", "0.5351132", "0.5351132", "0.5351132", "0.5351132", "0.5351132", "0.5351132", "0.5351132", "0.5351132", "0.5351132", "0.5351132", "0.5346634", "0.53301543", "0.53301543", "0.53124577", "0.53124577", "0.5309491", "0.53065735", "0.5302944", "0.5302835", "0.53006035", "0.5292952", "0.52873105", "0.52840894", "0.52789265", "0.52696866", "0.52696866", "0.52359086", "0.52359086", "0.52321935", "0.5225307", "0.52242124", "0.5206589", "0.5206532", "0.520232", "0.51806575", "0.5174862", "0.5162086", "0.5151447", "0.5127718", "0.511237", "0.5094425", "0.5089783", "0.5088359", "0.50841784", "0.5081273", "0.50800014", "0.50773656", "0.5076817", "0.50548935", "0.50438726", "0.50399834", "0.50399834", "0.50399834", "0.50363266", "0.50214756", "0.5015727", "0.5008878", "0.5007719", "0.500656", "0.5005898", "0.5001351", "0.49972677", "0.49968642", "0.4996207", "0.4993634", "0.4988504", "0.49844742", "0.49808922", "0.49785164", "0.495996", "0.49581352", "0.49580368", "0.495732", "0.4954875", "0.49534667", "0.49502015" ]
0.5826198
4
Get interpretation file for series.
public function getInterpretationFile(Request $request) { return $this->getFile($request, 'interpretation_file'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSeries(): string\n {\n return $this->series;\n }", "public function getSeries()\n {\n if (array_key_exists(\"series\", $this->_propDict)) {\n return $this->_propDict[\"series\"];\n } else {\n return null;\n }\n }", "public static function getSlicerFile()\r\n {\r\n return trim( getenv( 'SLICER' ) ) ?: './slicer.json';\r\n }", "public function getRawValue ()\n {\n return $this->files->getFile( $this->getName() );\n }", "public function getSeries(){\n\t\treturn $this->Series;\n\t}", "public function getSeries()\n {\n return $this->series;\n }", "public function getSeriesPath() : array {\n return $this->seriesPath;\n }", "public function getSeries() {\n return $this->series;\n }", "public function getIndexFile() {\n return $this->index_file;\n }", "public function getPredictableDeviceFile()\n {\n return $this->getDeviceFile();\n }", "function getFile() {\n\t\treturn ArtifactStorage::instance()->get($this->getID());\n\t}", "public function getFormatAction()\n {\n $content = null;\n try {\n $content = $this->dms()->getService()->getInfo($this->params('file'), 'format');\n } catch (NoFileException $e) {\n $content = $e->getMessage();\n }\n\n return $this->getResponse()->setContent($content);\n }", "public function getExcelFile()\n {\n if( $this->use_excel_personer ) {\n return $this->getExcelFilePersoner();\n }\n \n $excel = new Excel(\n $this->getNavn() . ' oppdatert ' . date('d-m-Y') . ' kl '. date('Hi') . ' - ' . $this->getArrangement()->getNavn(),\n $this->getRenderDataInnslag(),\n $this->getConfig()\n );\n return $excel->writeToFile();\n }", "private function _file()\n {\n return Html::getAttributeValue($this->model, $this->attribute);\n }", "public function GetFile()\n\t{\n\t\treturn $this->objOutputFile;\n\t}", "public function getFilename() {\n return $this->getData('file');\n }", "public function getFile(): string\n {\n return $this->file;\n }", "public function getModelFile()\n {\n return 'Detail/122_aexperiences';\n }", "public function getDefinitionFile()\n {\n return $this->definitionFile;\n }", "public function getFile(): string\n {\n return $this->filePath;\n }", "public function get_file() {\n\t\treturn $this->file;\n\t}", "public function file() {\n return $this->file;\n }", "public function getDataFile() \n\t{\n\t\treturn $this->_dataFile;\n\t}", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public static function getIndexFile() {\n return self::$config->index_file;\n }", "public static function fileReadingLocation()\n {\n return '/app/public/excels/';\n }", "public function file()\n {\n return $this->file;\n }", "public function file() { return $this->input_file; }", "public function getFilePath() {\n\t\t$spec = self::$specs[$this->id];\n\t\treturn array_value($spec, \"filepath\", NULL);\n\t}", "public function getFile():string {\n\t\t\treturn $this->file;\n\t\t}", "public function get_file()\n {\n return $this->file;\n }", "public function getFile() {\n\t\treturn $this->data['file'];\n\t}", "public function getFile()\n {\n return $this->readOneof(1);\n }", "public function getEntryPoint(): SolutionFile\n {\n return $this->file;\n }", "public function getFilename() {}", "public function getInputFile()\n {\n return $this->inputFile;\n }", "public function getf() {\n return $this->file;\n }", "protected function get_file() {\n\n\t\treturn __FILE__;\n\t}", "public function getFile()\n {\n $file = Input::file('report');\n $filename = $this->doSomethingLikeUpload($file);\n\n // Return it's location\n return $filename;\n }", "public function getFile() {\n\n return $this->file;\n }", "public function getFilename();", "public function getFilename();", "public function getFile() {\n return $this->file;\n }", "public function getFile() {\n return $this->file;\n }", "function get_file()\n\t{\n\t\treturn $this->file;\n\t}", "public function getFilterFormatFile(){\n\t\treturn fopen(\"output/ApiFilterFormat.txt\", \"w\");\n\t}", "public function getSeries()\n {\n $matches = [];\n\n // First check the 440, 800 and 830 fields for series information:\n $primaryFields = [\n '440' => ['a', 'p'],\n '800' => ['a', 'b', 'c', 'd', 'f', 'p', 'q', 't'],\n '830' => ['a', 'p']];\n $matches = $this->getSeriesFromMARC($primaryFields);\n if (!empty($matches)) {\n return $matches;\n }\n\n // Now check 490 and display it only if 440/800/830 were empty:\n $secondaryFields = ['490' => ['a']];\n $matches = $this->getSeriesFromMARC($secondaryFields);\n if (!empty($matches)) {\n return $matches;\n }\n\n // Still no results found? Resort to the Solr-based method just in case!\n return parent::getSeries();\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getAction()\n {\n $this->_helper->viewRenderer->setNoRender();\n $this->_helper->layout->disableLayout();\n\n // TODO: check acl\n if (isset($this->_request->setResource)) {\n $fileUri = $this->_request->setResource;\n } else {\n $fileUri = $this->_config->urlBase . ltrim($this->_request->getPathInfo(), '/');\n }\n $mimeProperty = $this->_privateConfig->mime->property;\n $store = $this->_owApp->erfurt->getStore();\n\n $query = new Erfurt_Sparql_SimpleQuery();\n $query->setProloguePart('SELECT DISTINCT ?mime_type')\n ->addFrom((string)$this->_getConfigModelUri())\n ->setWherePart('WHERE {<' . $fileUri . '> <' . $mimeProperty . '> ?mime_type. }');\n\n if ($result = $store->sparqlQuery($query, array('use_ac' => false))) {\n $mimeType = $result[0]['mime_type'];\n } else {\n // we set the default download file type to\n // application/octet-stream\n $mimeType = 'application/octet-stream';\n }\n\n // TODO: generate a proper file name here\n $response = $this->getResponse();\n $response->setRawHeader('Content-Type:' . $mimeType);\n $pathHashed = $this->getFullPath($fileUri);\n if (is_readable($pathHashed)) {\n $response->setBody(file_get_contents($pathHashed));\n }\n }", "public function loadFiles(){\n\n $files = array();\n\n if($this->id == -1 || empty($this->databasePath))\n return $series;\n\n\n $sqlQuery = 'SELECT D.* FROM data D , books B WHERE B.id = D.book AND B.id='.$this->id;\n\n $pdo = new SPDO($this->databasePath);\n foreach ($pdo->query($sqlQuery) as $row)\n $files[] = BookFile::_createFromRow($this->databasePath, $row); \n \n return $files;\n }", "protected function getFilesToProcess()\n {\n return array(\n 'custom/modules/Quotes/metadata/detailviewdefs.php',\n );\n }", "public function get($format)\n {\n if (!isset($this->files[$format])) {\n return $this->files[$format] = new OutputFile();\n }\n\n return $this->files[$format];\n }", "public function show(int $id)\n {\n return response()->json(SeriesEff::find($id));\n }", "public function get_interpret_script()\n {\n return $this->interpret_script;\n }", "public function getFile() {\n return $this->getFiles()->getFirst();\n }", "public function get_file() {\n\t\treturn __FILE__;\n\t}", "public function getFileName() {\n\t\t$spec = self::$specs[$this->id];\n\t\treturn array_value($spec, \"filename\", FALSE);\n\t}", "function getActualFile(){\n\t\treturn $this->xmldir;\n\t}", "public function getFilePath(): string;", "public function getFilePath(): string;", "function getAtomEntryFilePath() {\n\t\treturn $this->_outPath .'/'. $this->_fileDir .'/'. $this->_atomEntryFileName;\n\t}", "public function loadSeries(){\n $series = new Series();\n\n if($this->id == -1 || empty($this->databasePath))\n return $series;\n\n \n $sqlQuery = 'SELECT S.* FROM books_series_link BSL, series S WHERE BSL.series= S.id and BSL.book='.$this->id;\n\n $pdo = new SPDO($this->databasePath);\n foreach ($pdo->query($sqlQuery) as $row)\n $series->add(Serie::_createFromRow($this->databasePath, $row));\n \n return $series;\n }", "public function getPartOfSeries() {\n\t\treturn $this->partOfSeries;\n\t}", "public function baseFile()\n\t{\n\t\treturn $this->baseFile;\n\t}", "public function getArticlePath()\r\n {\r\n $file = $this->getArticleFile();\r\n\r\n if(!file_exists($file)) {\r\n $file = $this->getArticleFile();\r\n if (!file_exists($file)) {\r\n throw new Exception('Article file: ' . $file . ' not found');\r\n }\r\n }\r\n\r\n return $file;\r\n }", "protected function readFileName() { return $this->_filename; }", "public function getSource()\n {\n return Yii::$app->storage->fileAbsoluteHttpPath($this->filter_id . '_' . $this->file->name_new_compound);\n }", "public function sourceFile() {\n return $this->loader\n ? $this->loader->getResourceAsStream(strtr($this->name, '.', '/').'/package-info.xp')\n : NULL\n ;\n }", "public function findSeries($seriesName);", "public function getFile()\n\t{\n\t\treturn $this->file;\n\t}", "public function getFile()\n\t{\n\t\treturn $this->file;\n\t}", "public static function getDataFile()\n {\n return static::$dataFile;\n }", "public function getPath(): string {\n $meta_data = stream_get_meta_data($this->file);\n return $meta_data[\"uri\"];\n }", "public function getFullSeriesInformation($seriesId);", "public function get_log() {\r\n\t\treturn $this->get_file();\r\n\t}", "public function getFilename()\n {\n return static::filename($this->path);\n }", "public function get_filename()\n {\n }", "public function getFilename() {\n return $this->path;\n }", "public function getStateFile()\n {\n return $this->config->getTmpPath() . DIRECTORY_SEPARATOR . $this->getFeed()->getId() . '.state';\n }", "public function fileExtension(): string\n {\n return match_data($this,\n [\n Format::Xlsx => 'xlsx',\n Format::Pdf => 'pdf',\n Format::Html => 'html',\n Format::Ods => 'ods',\n ]);\n }", "function get_taxon_file($meta_xml)\n{\n $xml = file_get_contents($meta_xml);\n /* e.g. meta.xml contents:\n <table encoding=\"UTF-8\" fieldsTerminatedBy=\"\\t\" linesTerminatedBy=\"\\n\" ignoreHeaderLines=\"1\" rowType=\"http://rs.tdwg.org/dwc/terms/Taxon\">\n <files>\n <location>taxon.tab</location>\n </files> \n */\n // $left = 'rowType=\"http://eol.org/schema/media/Document\"'; //just testing, should get e.g. \"media_resource.tab\"\n $left = 'rowType=\"http://rs.tdwg.org/dwc/terms/Taxon\"';\n if(preg_match(\"/\".preg_quote($left, '/').\"(.*?)<\\/files>/ims\", $xml, $arr)) {\n if(preg_match(\"/<location>(.*?)<\\/location>/ims\", $arr[1], $arr2)) return $arr2[1]; //e.g. \"taxon.tab\"\n }\n}", "public function getFile(): string;", "public function getFile(): string;", "public function getFile(): string;", "private static function _getGeneralArticleFilePath()\n {\n Channels::includeSystem('SquizSuite');\n $currentProductInfo = SquizSuite::getCurrentProduct();\n if (isset($currentProductInfo['type']) === FALSE) {\n throw new ChannelException(_('Failed to retrieve product type'));\n }\n\n $productSystem = str_replace(' ', '', ucwords($currentProductInfo['type']));\n if (Channels::systemExists($productSystem) === FALSE) {\n throw new ChannelException(sprintf(_('Product type system (%s) not found!'), $productSystem));\n }\n\n // General articles path.\n $path = Channels::getSystemsPath().'/'.$productSystem.'/Docs/general.html';\n return $path;\n\n }", "public function getOutputFilePath()\n {\n return $this->output_file_path;\n }", "public function getFilePath(): string\n {\n return oas_path(\n $this->version . '/components/schemas/' . $this->getFileName() . '.json'\n );\n }" ]
[ "0.55894786", "0.5207566", "0.5125928", "0.51002795", "0.5036593", "0.49800143", "0.49663585", "0.49584654", "0.4946748", "0.4939712", "0.49375862", "0.4934424", "0.49146008", "0.490761", "0.49002475", "0.48767743", "0.4868337", "0.48490208", "0.4836496", "0.48261166", "0.48075974", "0.48005447", "0.47983167", "0.4788777", "0.4788777", "0.4788777", "0.4788777", "0.47844124", "0.47805953", "0.47745964", "0.47694415", "0.4759054", "0.4757116", "0.475062", "0.47335523", "0.473125", "0.4720228", "0.47096527", "0.47015703", "0.47000638", "0.46982816", "0.4696773", "0.4693749", "0.4690574", "0.4690574", "0.46866873", "0.46866873", "0.46811107", "0.4675427", "0.46665552", "0.4664391", "0.4664391", "0.4664391", "0.4664391", "0.4664391", "0.4664391", "0.4664391", "0.4664391", "0.4664391", "0.4664391", "0.4664391", "0.4657521", "0.46385568", "0.463662", "0.46363023", "0.46237236", "0.462197", "0.4621199", "0.46143788", "0.46045408", "0.45976096", "0.4590805", "0.4590805", "0.45871884", "0.4578119", "0.4577851", "0.45769534", "0.45761105", "0.45743558", "0.45687047", "0.45675245", "0.45670843", "0.4559861", "0.4559861", "0.45590538", "0.4556285", "0.45485774", "0.4547843", "0.45449167", "0.45283318", "0.4525473", "0.4524705", "0.45245832", "0.45240968", "0.45169568", "0.45169568", "0.45169568", "0.45054984", "0.44996625", "0.4495427" ]
0.61089665
0
Get marker file file for series.
public function getMarkerFile(Request $request) { $fType = 'marker_file'; $oUser = Auth::user(); $oUserMarker = UserMarker::where('id', $request->user_marker_id) ->first(); if ($oUserMarker->user_id == $oUser->id || $oUser->admin == 1) { if ($oUserMarker->data_file) { $file = File::get($fType.'s/'.$oUserMarker->data_file); $response = Response::make($file, 200); if ($oUserMarker->data_file_mime) { $response->header('Content-Type', $oUserMarker->data_file_mime); } return $response; } } return view('errors/notaccess', ['oUser' => $oUser, 'active' => 'profile_link']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extract_from_markers($filename, $marker)\n {\n }", "public function getFilename() {}", "public function getFilename() {\n return $this->getData('file');\n }", "function getMarker() {\n\t\treturn $this->marker;\n\t}", "public function getMarker()\n {\n\t\treturn $this->_marker;\n\t}", "abstract protected function _getIndicatorFileName();", "public function getFilename();", "public function getFilename();", "function getAtomEntryFilePath() {\n\t\treturn $this->_outPath .'/'. $this->_fileDir .'/'. $this->_atomEntryFileName;\n\t}", "public function getSeries(): string\n {\n return $this->series;\n }", "public function getFilename()\n {\n return static::filename($this->path);\n }", "public function getFilename() {\n return $this->path;\n }", "public function getFile(): string\n {\n return $this->file;\n }", "private function getFilename()\n {\n if ($this->uniqueFile) {\n return $this->filename;\n }\n\n return $this->filename . self::SEPARATOR . $this->getCurrentSitemap();\n }", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function fcpoGetMandateFilename() \n {\n $sOxid = $this->getId();\n $sQuery = \"SELECT fcpo_filename FROM fcpopdfmandates WHERE oxorderid = '{$sOxid}'\";\n $sFile = $this->_oFcpoDb->GetOne($sQuery);\n\n return $sFile;\n }", "function getFile() {\n\t\treturn ArtifactStorage::instance()->get($this->getID());\n\t}", "public function getFile(): string\n {\n return $this->filePath;\n }", "public function getFilename() : string\n {\n return $this->fileName;\n }", "public function getFilename()\n {\n return null;\n }", "public function getImageFile()\n {\n $link = $this->link;\n return empty( $this->owner->$link ) ? null : \\Yii::getAlias(\n '@storage/' . $this->directory . '/' . $this->owner->$link\n );\n }", "public function getSeriesPath() : array {\n return $this->seriesPath;\n }", "public function appendToFile($marker) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('appendToFile', func_get_args()));\n }", "private function getLoggerFile()\n {\n return $this->getLoggerFolder() . DIRECTORY_SEPARATOR . self::FILE_NAME;\n }", "public function getPath(): string {\n $meta_data = stream_get_meta_data($this->file);\n return $meta_data[\"uri\"];\n }", "public function getf() {\n return $this->file;\n }", "public static function getSlicerFile()\r\n {\r\n return trim( getenv( 'SLICER' ) ) ?: './slicer.json';\r\n }", "public function getImageFile()\n {\n return isset($this->filetask) ? $this->filetask : null;\n }", "public function getMarkerFactory();", "public function getFilename(): string\n {\n return $this->filename;\n }", "public function getFilename(): string\n {\n return $this->filename;\n }", "public function getFilePath() {\n\t\t$spec = self::$specs[$this->id];\n\t\treturn array_value($spec, \"filepath\", NULL);\n\t}", "function trpdownload_marker_csv_get_filename($vars) {\n $filename = $vars['download_args']['safe_site_name'] \n . '.sequence_features.' \n . date('YMj-his');\n\n return $filename;\n}", "public function getFile() {\n\t\treturn $this->data['file'];\n\t}", "public function getFileName() {\n\t\t$spec = self::$specs[$this->id];\n\t\treturn array_value($spec, \"filename\", FALSE);\n\t}", "public function getClientFilename()\n {\n return $this->fileInfo['name'];\n }", "protected function fileName() {}", "public function getFileInfo();", "public function getFile()\n {\n return $this->readOneof(1);\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFile():string {\n\t\t\treturn $this->file;\n\t\t}", "public function getFilePath(): string;", "public function getFilePath(): string;", "public function get_file()\n {\n return $this->file;\n }", "public function get_filename()\n {\n }", "abstract protected function _getFileName();", "public function getFilename() {\n return $this->filename;\n }", "function getFilename();", "public function get_file() {\n\t\treturn $this->file;\n\t}", "public function getFileName();", "public function getFileName();", "public function getFileName();", "public function GetFile()\n\t{\n\t\treturn $this->objOutputFile;\n\t}", "public function getRegisteredServicePersistentFile(): string;", "public function getFileName()\n {\n return $this->prefix.$this->scope.'_'.$this->comName;\n }", "public function getMarker($name);", "public function getFileName(): string;", "protected function filename()\n {\n return null;\n }", "protected function filename()\n {\n return null;\n }", "public function getFileName()\n {\n $fileName = $this->getInfo('fileName');\n if (!$fileName) {\n $fileName = $this->getInfo('title');\n }\n if (!$fileName) {\n $fileName = Zend_Controller_Front::getInstance()->getRequest()->getParam('controller') . '-' . date(\"Ymd\");\n }\n return $fileName . '.csv';\n }", "private function pathFilename() {\n return $this->directory . \"/\" . $this->formatFilename();\n }", "public function getImageFile()\n {\n return $this->imageFile;\n }", "public function getImageFile()\n {\n return $this->imageFile;\n }", "public function getImageFile()\n {\n return $this->imageFile;\n }", "public function getImageFile()\n {\n return $this->imageFile;\n }", "public static function getFilePath(): string\n {\n return static::getInstance()->getFilePath();\n }", "public function getFile() {\n return $this->getFiles()->getFirst();\n }", "function getFilename()\n {\n return $this->filename;\n }", "public function get_file_name() {\n\t\treturn $this->file;\n\t}", "function fiftyone_degrees_get_data_file($offset = 0) {\n global $_fiftyone_degrees_data_file;\n if ($_fiftyone_degrees_data_file == NULL) {\n die('A 51Degrees data file has not been set.');\n }\n if ($offset >= 0) {\n fseek($_fiftyone_degrees_data_file, $offset);\n }\n return $_fiftyone_degrees_data_file;\n}", "public function getFileLocation()\n {\n return $this->fileLocation;\n }", "public function getFile(): string;", "public function getFile(): string;", "public function getFile(): string;", "public function getMarkerIndex()\n {\n return $this->currentMarker;\n }", "private static function getFileName()\n {\n return sprintf('Export %s.csv', Carbon::now()->toDateTimeString());\n }", "public function getFilename(){\n \n return $this->filename;\n \n }", "public function getFilename()\n\t\t{\n\t\t\treturn $this->_fileName;\n\t\t}", "public function getFilename()\n\t{\n\t\treturn $this->token->filename;\n\t}", "public function getSeriesAnnounceIcon($series)\n {\n $icon = 'mdi-action-done pumukit-transparent';\n\n if ($series->getAnnounce()) {\n return 'mdi-action-spellcheck pumukit-series-announce';\n }\n\n return $icon;\n }", "public function getFile();", "public function getFile();", "public function file()\n {\n return $this->file;\n }", "public function file() {\n return $this->file;\n }", "public function filename()\n\t{\n\t\treturn $this->_filename();\n\t}", "public function getFilename()\n {\n return $this->_filename;\n }", "public function getFile ();", "public function filename(): string;", "function getFileName()\n {\n return $this->fileName;\n }", "public static function getFile() {}", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFileName()\n {\n return $this->fileName;\n }" ]
[ "0.5679174", "0.5571645", "0.5531117", "0.5529805", "0.5504475", "0.5473008", "0.5402511", "0.5402511", "0.5354025", "0.5350626", "0.5301255", "0.5292419", "0.52840686", "0.5271036", "0.5264536", "0.5264536", "0.5264536", "0.5264536", "0.5256773", "0.5224175", "0.52063566", "0.519227", "0.51899636", "0.5187501", "0.51816636", "0.5171116", "0.51702577", "0.5168062", "0.51607966", "0.5144952", "0.5143186", "0.511905", "0.51154923", "0.51154923", "0.5106861", "0.5093221", "0.5067417", "0.5067138", "0.5059893", "0.5059346", "0.50560933", "0.50474256", "0.50449157", "0.50449157", "0.50449157", "0.50449157", "0.50449157", "0.50449157", "0.5044204", "0.50424075", "0.50424075", "0.50387204", "0.503615", "0.50320226", "0.50230193", "0.50225955", "0.5018946", "0.5015516", "0.5015516", "0.5015516", "0.50062424", "0.50034505", "0.49959522", "0.49939364", "0.49930158", "0.49928102", "0.49928102", "0.4992216", "0.49895182", "0.49868357", "0.49868357", "0.49868357", "0.49868357", "0.49867195", "0.49839154", "0.4976813", "0.4975683", "0.49618444", "0.49529284", "0.49492913", "0.49492913", "0.49492913", "0.49472666", "0.49472472", "0.49459025", "0.49432698", "0.49428028", "0.49420217", "0.49410376", "0.49410376", "0.49400347", "0.4936656", "0.4933934", "0.49335763", "0.49268034", "0.49212325", "0.49205118", "0.4919455", "0.49146223", "0.49146223" ]
0.58900684
0
Run the database seeds.
public function run() { foreach ($this->array_data() as $arr) { $data = [ 'shop_id' => NULL, 'name' => $arr['name'], 'type' => $arr['type'], 'default_platform' => 1 ]; if (ShopGrid::where('name', '=', $arr['name'])->where('type', '=', $arr['type'])->count()) { $grid = ShopGrid::where('name', '=', $arr['name'])->where('type', '=', $arr['type'])->first(); $grid->update($data); } else { ShopGrid::create($data); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\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 }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Geeft terug de aanwezigheid met id=$id uit de tabel aanwezigheid
function get($id) { $this->db->where('id', $id); $query = $this->db->get('aanwezigheid'); return $query->row(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function traerPorVehiculo($id)\n {\n }", "function ler_id($id) {\n $x = (int)$id;\n if($x >= $this->bd[0][0] || $x <= 0) {return false;}\n //comecando a setar tudo\n $this->id = $this->bd[$x][0];\n $this->maximo = $this->bd[$x][1];\n $this->nome = $this->bd[$x][2];\n $this->categoria = $this->bd[$x][3];\n $this->tipo = $this->bd[$x][4];\n $this->atributo = $this->bd[$x][5];\n $this->specie = $this->bd[$x][6];\n $this->lv = $this->bd[$x][7];\n $this->atk = $this->bd[$x][8];\n $this->def = $this->bd[$x][9];\n $this->preco = $this->bd[$x][10];\n $this->descricao = $this->bd[$x][11];\n $this->img = '../imgs/cards/'.$this->id.'.png';\n return true;\n }", "public function traerPorId($id)\n {\n }", "public function traerPorId($id)\n {\n }", "public function traerPorId($id)\n {\n }", "public function rechercherId($id)\n {\n }", "function tampilkan_per_id($id){\r\n\t\t\t$query \t= \"SELECT * FROM data WHERE id='$id'\";\r\n\t\t\treturn result($query);\r\n\t\t}", "function buscarPerId($id) {\n\n $con = new db();\n $query = $con->prepare(\"SELECT * FROM missatge INNER JOIN usuari ON missatge.id_usuari = usuari.id_usuari WHERE id_missatge='$id';\");\n $result = $con->consultar($query);\n\n $usuari = $result[0][\"usuari\"];\n $llegit = $result[0][\"llegit\"];\n if ($llegit == '0') {\n $llegit = 'no';\n } else {\n $llegit = 'si';\n }\n $titol = $result[0][\"titol\"];\n $data = $result[0][\"data\"];\n $text = $result[0][\"missatge\"];\n $id_missatge = $result[0][\"id_missatge\"];\n $missatge = new Missatge($usuari, $llegit, $titol, $data, $text);\n $missatge->setId_missatge($id_missatge);\n\n if ($llegit == 'no') {\n $query = $con->prepare(\"UPDATE missatge set llegit=1 WHERE id_missatge='$id';\");\n }\n\n $con->consulta($query);\n $con = null;\n\n\n return $missatge;\n }", "public function suprimerId($id)\n {\n }", "function buscarPorId($id) {\r\n \r\n }", "public function tampilRiwayat($id)\n\t{\n\t\treturn $this->db->query(\"SELECT * FROM `pembayaran` p INNER JOIN sewa s ON p.id_sewa=s.id_sewa INNER JOIN wajib_pajak wp ON s.id_wp=wp.id_wp INNER JOIN daftar_sewa_reklame dsr ON s.id_daftar_sewa=dsr.id_daftar_sewa WHERE s.id_wp = '$id'\");\n\t}", "public function pertanyaanId($id){\r\n $sql = \"SELECT * FROM tbl_pertanyaan where id=$id\";\r\n $query = mysql_query($sql);\r\n \t\t $row = mysql_fetch_array($query);\r\n return $row;\r\n }", "public function history($id)\n {\n $jurnalterpilih = JurnalDetail::find($id);\n $jurnalsemua = JurnalDetail::where('id_header', $jurnalterpilih->id_header)->get();\n\n foreach ($jurnalsemua as $row) {\n echo '<tr>';\n echo '<td>'.$row->perkiraan['kode_akun'].'</td>';\n echo '<td>'.$row->perkiraan['nama_akun'].'</td>';\n echo '<td>'.$row->keterangan.'</td>';\n echo '<td class=\"text-right\">Rp. '.number_format($row->debet, \"2\").'</td>';\n echo '<td class=\"text-right\">Rp. '.number_format($row->kredit, \"2\").'</td>';\n echo '</tr>';\n }\n }", "public function datumAddFromId($id){\n $sql = \"select persnr,datum from dzeitsoll where id='$id'\";\n $res = $this->db->query($sql);\n $rows = $res->fetchAll();\n $row = $rows[0];\n $datum = $row['datum'];\n $persnr = $row['persnr'];\n $sqlinsert = \"insert into dzeitsoll (persnr,datum,oe) values('$persnr','$datum','-')\";\n $this->db->query($sqlinsert);\n return $this->db->insertId();\n }", "public function id_tarjeta();", "public function edit($id)\n {\n $datapengasuh = mysqli_query(\n $this->koneksi,\n \"select * from pengasuh where id='$id'\"\n );\n return $datapengasuh;\n }", "public function tampilData($id=null){\n if($id!=null)\n \t{return self::find($id);}\n else\n {return self::all();}}", "function shfaqKurset( $id )\n\t{\t\n\n\t\tglobal $db;\n\n\t\t$output = '<select class=\"form-control\">';\n\n\t\t$sql = \"SELECT kurs_id FROM menaxhon WHERE instruktor_id = '$id'\";\n\n\t\t$results = $db->query( $sql );\n\n\t\tif( mysqli_num_rows( $results ) > 0 )\n\t\t{\n\t\t\twhile( $kurs = $results->fetch_assoc() )\n\t\t\t{\t\n\t\t\t\t$k_id = $kurs[ 'kurs_id' ];\n\n\t\t\t\t$sql2 = \"SELECT lloji_kursit FROM kurse WHERE kurs_id = '$k_id'\";\n\n\t\t\t\t$pergjigja = $db->query( $sql2 );\n\n\t\t\t\t$kurs = mysqli_fetch_assoc( $pergjigja );\n\n\n\t\t\t\t$output .= '<option style=\"padding: 0 0 0 20px;\" value=\"'. $kurs[ 'lloji_kursit' ] .'\">' . $kurs[ 'lloji_kursit' ]. '</option>';\n\t\t\t}\n\t\t}///FUND if\n\t\telse\n\t\t{\n\t\t\t$output = '<option>Ky instruktor nuk ka kurse per momentin!</option>';\n\t\t}\n\n\t\treturn $output;\n\t}", "function print($id) {\n\n\t\t/* DEFINE VARIABLE WE WILL USED */\n\t\t$surat_tugas\t= $this->db->get_where('surat_dinas',\n\t\t\tarray('id' => $id))->row_array();\n\t\t$pegawai \t\t= $this->db->get_where('pegawai',\n\t\t\tarray('jabatan_pegawai' => 'Kepala Pusat Data Informasi dan Humas'))->result();\n\t\t$nomor \t\t\t= $surat_tugas['nomor'];\n\t\t$id_pos \t\t= $surat_tugas['pos'];\n\t\t$var_kegiatan \t= $surat_tugas['kegiatan'];\n\n\t\t//get pos kegiatan\n\t\t$pos_result = $this->db->get_where('pos_kegiatan',\n\t\t\tarray('id' => $id_pos))->row_array();\n\n\t\t$pos = $pos_result['kegiatan'];\n\n\t\t//Get data only one from data_rinci table\n\t\t$data_rinci\t= $this->db->limit(1)->get_where('data_rinci',\n\t\t\tarray('id_surat' => $id))->result();\n\t\t//Get all data from data_rinci table\n\t\t$data_rinci_all\t= $this->db->get_where('data_rinci',\n\t\t\tarray('id_surat' => $id))->result();\n\t\t//Get pegawai from join table with yang_dinas\n\t\t$nama_result = $this->home_model->get_data_rinci_pegawai($id);\n\t\t$num_pegawai = count($nama_result);\n\n\n\t\t//get type of pegawai\n\t\t$opsi = $data_rinci['0']->opsi;\n\n\t\t$var_tempat \t= $data_rinci['0']->tempat;\n\t\t$var_tgl_mulai \t= $data_rinci['0']->tgl_mulai;\n\t\t$var_tgl_akhir \t= $data_rinci['0']->tgl_akhir;\n\n\t\t$var_tahun_kegiatan \t= substr($data_rinci['0']->tgl_surat, -4);\n\t\t$var_tgl_surat \t\t\t= $data_rinci['0']->tgl_surat;\n\n\t\t$kapusdatin \t\t\t= $pegawai['0']->nama_pegawai;\n\t\t$tgl_sekarang \t\t\t= date('d').\"-\".date('m').\"-\".date('Y');\n\t\t$arr_nomor = explode('/', $nomor);\n\t\t$nomor_surat = trim($arr_nomor[0], \" \");\n\n\t\t$pdf = new PDF_MC_Table('p','mm','A4');\n\n\t\t// membuat halaman baru\n\t\t$pdf->AddPage();\n\t\t$pdf->SetLeftMargin(20);\n\t\t$pdf->SetRightMargin(20);\n\t\t// setting jenis font yang akan digunakan\n\t\t$pdf->SetFont('Arial','B',14);\n\t\t// mencetak string\n\t\t$pdf->Cell(0,6,\"\",0,1,'C');\n\t\t$pdf->Ln();\n\t\t$pdf->Cell(0,6,\"\",0,1,'C');\n\t\t$pdf->Ln();\n\t\t$pdf->Ln();\n\t\t$pdf->Cell(0,6,\"\",0,1,'C');\n\t\t$pdf->Ln();\n\t\t$pdf->Cell(0,3,'SURAT TUGAS',0,1,'C');\n\t\t$pdf->SetFont('Arial','',12);\n\t\t$pdf->Cell(0,10,\"NOMOR: \".$nomor,0,1,'C');\n\t\t// Memberikan space kebawah agar tidak terlalu rapat\n\t\t$pdf->Cell(10,7,'',0,1);\n\t\t$pdf->SetFont('Arial','',10);\n\t\t$pdf->Cell(25,6,'Menimbang',0,0);\n\t\t$pdf->Cell(5,6,':',0,0);\n\t\t$pdf->MultiCell(0,6,\"Dalam rangka melakukan kegiatan $var_kegiatan di $var_tempat\",0,'J');\n\t\t//$pdf->Cell(27,6,'Dalam rangka melakukan kegiatan $kegiatan di $tempat pada $waktu\t',0,0);\n\t\t$pdf->Cell(25,6,'Dasar',0,0);\n\t\t$pdf->Cell(5,6,'',0,0);\n\t\t$pdf->Cell(5,6,'1.',0,0);\n\t\t$pdf->MultiCell(0,6,\"Keputusan Presiden Nomor 72 Tahun 2004 tentang Pelaksanaan Anggaran Pendapatan dan Belanja Negara;\",0,'J');\n\t\t$pdf->Cell(25,6,'',0,0);\n\t\t$pdf->Cell(5,6,'',0,0);\n\t\t$pdf->Cell(5,6,'2.',0,0);\n\t\t$pdf->MultiCell(0,6,\"Peraturan Menteri Keuangan Nomor 134/PMK.06/2005 tentang Pedoman Pembayaran dalam Pelaksanan Anggaran Pendapatan dan Belanja Negara;\",0,'J');\n\t\t$pdf->Cell(25,6,'',0,0);\n\t\t$pdf->Cell(5,6,'',0,0);\n\t\t$pdf->Cell(5,6,'3.',0,0);\n\t\t$pdf->MultiCell(0,6,\"Peraturan Kepala Badan Nasional Penanggulangan Bencana Nomor 1 tahun 2008 tentang Organisasi dan Tata Kerja Badan Nasional Penanggulangan Bencana.\",0,'J');\n\t\t$pdf->SetFont('Arial','B',12);\n\t\t$pdf->Cell(0,10,\"Memberi tugas\",0,1,'C');\n\t\t$pdf->SetFont('Arial','',10);\n\t\t$pdf->Cell(25,6,'Kepada',0,0);\n\t\t$pdf->Cell(5,6,':',0,0);\n\n\t\t//kalo jumlah pegawai yg ditugaskan kurang dari 4\n\t\tif($num_pegawai < 4 && $opsi == \"0\") {\n\t\t\t$counterr = 1;\n\t\t\tforeach ($nama_result as $row) {\n\t\t\t\t$pdf->Cell(6,6,$counterr. \". \",0,0);\n\t\t\t\t$pdf->MultiCell(0,6,\"$row->nama_pegawai\",0,'J');\n\t\t\t\t$pdf->Cell(30,6,\"\",0,0);\n\t\t\t\t$counterr++;\n\t\t\t}\n\t\t} else {\n\t\t\t$pdf->MultiCell(0,6,\"Daftar Terlampir\",0,'L');\n\t\t}\n\n\t\t$pdf->MultiCell(0,6,\"\",0,'L');\n\t\t$pdf->Cell(25,6,'Untuk',0,0);\n\t\t$pdf->Cell(5,6,':',0,0);\n\t\t$pdf->Cell(5,6,'1.',0,0);\n\t\tif ($opsi == \"1\") {\n\t\t\t$pdf->MultiCell(0,6,\"Dinas ke BPBD dalam rangka mendukung kegiatan \".$var_kegiatan.\";\",0,'J');\n\t\t} else {\n\t\t\t$pdf->MultiCell(0,6,\"Dinas ke \".$var_tempat.\" dalam rangka mendukung kegiatan \".$var_kegiatan.\" tahun \".$var_tahun_kegiatan.\", pada tanggal \"\n\t\t\t\t.$this->tanggal_indo($var_tgl_mulai,'-').\" s.d \"\n\t\t\t\t.$this->tanggal_indo($var_tgl_akhir,'-').\";\",0,'J');\n\t\t}\n\n\t\t$pdf->Cell(25,6,'',0,0);\n\t\t$pdf->Cell(5,6,'',0,0);\n\t\t$pdf->Cell(5,6,'2.',0,0);\n\t\t$pdf->MultiCell(0,6,\"Melaksanakan tugas ini dengan penuh tanggungjawab;\",0,'L');\n\t\t$pdf->Cell(25,6,'',0,0);\n\t\t$pdf->Cell(5,6,'',0,0);\n\t\t$pdf->Cell(5,6,'3.',0,0);\n\t\t$pdf->MultiCell(0,6,\"Segala biaya yang dikeluarkan untuk tugas tersebut di atas dibebankan kepada DIPA BNPB TA \". date('Y') .\", Pos Kegiatan \".$pos.\";\",0,'J');\n\t\t$pdf->Cell(25,6,'',0,0);\n\t\t$pdf->Cell(5,6,'',0,0);\n\t\t$pdf->Cell(5,6,'4\t.',0,0);\n\t\t$pdf->MultiCell(0,6,\"Apabila terdapat kekeliruan dalam Surat Tugas ini akan dilakukan perbaikan sebagaimana mestinya.\",0,'J');\n\t\t$pdf->Ln();\n\t\t$pdf->Ln();\n\n\t\t//remove tanggal di surat dinas\n\t\t$tanggal_sekarang = $this->tanggal_indo($var_tgl_surat,'/');\n\t\t$arr_tgl = explode(' ', $tanggal_sekarang);\n\n\t\t$pdf->Cell(85, 6, \"\", 0,0);\n\n\t\t//kalo nomor belum diisi maka tanggal juga ga diisi\n\t\tif(empty($nomor_surat)) {\n\t\t\t$pdf->MultiCell(0,6,\"Jakarta, \".$arr_tgl[1].\" \".$arr_tgl[2],0,'C');\n\t\t} else {\n\t\t\t//get tanggal spd rampung\n\t\t\t$rampung_result = $this->db->get_where('spd_rampung', array('id_surat' => $id))->result();\n\t\t\t$tgl = $rampung_result['0']->tgl;\n\t\t\t$tgl_surat = $this->tanggal_indo($tgl, '/');\n\t\t\t$pdf->MultiCell(0,6,\"Jakarta, \".$tgl_surat,0,'C');\n\t\t}\n\t\t$pdf->Cell(85, 6, \"\", 0,0);\n\t\t$pdf->MultiCell(0,6,\"Kepala Pusat Data Informasi dan Humas\",0,'C');\n\t\t$pdf->Ln();\n\t\t$pdf->Ln();\n\t\t$pdf->Ln();\n\t\t$pdf->SetFont('Arial','B',12);\n\t\t$pdf->Cell(85, 6, \"\", 0,0);\n\t\t$pdf->MultiCell(0,6,$kapusdatin,0,'C');\n\n\t\t//Page ke-2\n\t\tif ($opsi == '0') {\n\t\t\tif($num_pegawai>3) {\n\t\t\t\t$pdf->AddPage();\n\t\t\t\t$pdf->SetFont('Arial','B',12);\n\t\t\t\t$pdf->Cell(0,6,\"Lampiran Surat Tugas\",0,1,'R');\n\t\t\t\t$pdf->Cell(0,6,\"Nomor: $nomor\",0,1,'R');\n\t\t\t\t$pdf->Cell(0,6,\"Tanggal: \". $this->tanggal_indo($var_tgl_surat,'/'),0,1,'R');\n\t\t\t\t$pdf->Cell(0,10,\"Daftar Nama\",0,1,'C');\n\t\t\t\t$pdf->SetFont('Arial','',12);\n\t\t\t\t$counter = 1;\n\t\t\t\tforeach ($nama_result as $row) {\n\t\t\t\t\t$pdf->Cell(9,6,$counter.\". \",0,0);\n\t\t\t\t\t$pdf->MultiCell(0,6,$row->nama_pegawai,0,'J');\n\t\t\t\t\t$counter++;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ($opsi == \"1\") {\n\t\t\t//Print Multiple Tempat\n\t\t\t$pdf->AddPage();\n\t\t\t$pdf->SetFont('Arial','B',11);\n\t\t\t$pdf->Cell(115,5,'',0,0,'L');\n\t\t\t$pdf->Cell(25,5,'Lampiran Surat Tugas ',0,'L');\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->Cell(115,5,'',0,0,'L');\n\t\t\t$pdf->Cell(25,5,'Nomor : '. $nomor,0,'L');\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->Cell(115,5,'',0,0,'L');\n\t\t\t$pdf->Cell(25,5,'Tanggal : '.$var_tgl_surat,0,0,'L');\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->SetFont('Arial','B',12);\n\t\t\t$pdf->Cell(0,10,\"Jadwal\",0,1,'C');\n\n\t\t\t//here is the table\n\t\t\t$pdf->SetFont('Arial','B',12);\n\t\t\t$pdf->Cell(5,7,'',0,0);\n\t\t\t$pdf->Cell(10,6,'No.',1,0,'C',0);\n\t\t\t$pdf->Cell(50,6,'Nama',1,0,'C',0);\n\t\t\t$pdf->Cell(65,6,'Tempat',1,0,'C',0);\n\t\t\t$pdf->Cell(50,6,'Tanggal',1,0,'C',0);\n\t\t\t$pdf->SetFont('Arial','',12);\n\t\t\t$counterrr = 1;\n\t\t\t$pdf->Ln();\n\t\t\tforeach ($nama_result as $row) {\n\t\t\t\t$pdf->Cell(5,7,'',0,0);\n\t\t\t\t$pdf->SetWidths(array(10, 50, 65, 50));\n\t\t\t\tfor($i=0;$i<1;$i++) {\n\t\t\t\t\t$pdf->Row(array($counterrr,$row->nama_pegawai,$row->tempat, $this->tanggal_indo($row->tgl_mulai,'-')\n\t\t\t\t\t\t.' s.d '.$this->tanggal_indo($row->tgl_akhir,'-')));\n\t\t\t\t}\n//\t\t\t\t$pdf->Cell(5,7,'',0,0);\n//\t\t\t\t$pdf->Cell(10,6,$counterrr. '. ',0,0,'C',0);\n//\t\t\t\t$pdf->Cell(50,6,$row->nama_pegawai,0,0,'L',0);\n//\t\t\t\t$pdf->Cell(65,6,$row->tempat,0,0,'C',0);\n//\t\t\t\t$pdf->MultiCell(50,6,$this->tanggal_indo($row->tgl_mulai,'-').' s.d '\n//\t\t\t\t\t.$this->tanggal_indo($row->tgl_akhir,'-'),0,'L');\n\t\t\t\t$counterrr++;\n\t\t\t}\n\n\t\t\t//end of the table\n\t\t}\n\n\t\t//Cetak gans\n\n\t\t$filename = \"Surat Dinas - Nomor \".$nomor.$this->extension;\n\t\t$pdf->setTitle($filename);\n\t\t$pdf->Output(\"I\", $filename);\n\n\t}", "public function show($id)\n {\n /* PASOS:\n * 1. Verificar sesión o el rol\n * 2. Abrir una instancia con la base de datos y consultar documento\n * 3. Meter el documento en un array y devolverlo junto a la vista para montar alli la tabla\n *\n */\n }", "public function getById4($id)\n {\n //$this->db->select('tabel_lapak.*, tabel_peminjaman.kd_pengguna as kd');\n $this->db->from('tabel_lapak');\n //$this->db->join('tabel_lapak', 'tabel_lapak.kd_lapak = tabel_peminjaman.kd_lapak');\n $this->db->join('tabel_pengguna', 'tabel_pengguna.kd_pengguna = tabel_lapak.kd_pengguna');\n $this->db->where('tabel_lapak.kd_lapak', $id);\n $query = $this->db->get();\n return $query->result();\n }", "function tampil_data_id($tabel,$where,$id)\n {\n $row = $this->db->prepare(\"SELECT * FROM $tabel WHERE $where = :id,:teks,:label,:predict\");\n $row->execute(array($id));\n return $hasil = $row->fetch();\n }", "public function cambiarId($id) {\n $this->id = $id;\n }", "public function chondethi($id){\n if($id == 0){\n echo \"<option>Đề Thi</option>\";\n foreach(dethi::all() as $dt){\n echo \"<option value='\".$dt->id.\"'>\".$dt->tendethi.\"</option>\";\n }\n }else{\n $nguoirade = nguoirade::find($id);\n $dethi = dethi::where('id_nguoirade', $nguoirade->id)->orderBy('id', 'desc')->get();\n echo \"<option>Đề Thi</option>\";\n foreach($dethi as $dt){\n echo \"<option value='\".$dt->id.\"'>\".$dt->tendethi.\"</option>\";\n }\n }\n\n }", "public function personal($id) {\n $empresas = $this->Empresa_model->get_all(0, 100);\n $departamentos = $this->Departamento_model->get_all(0, 100);\n $secciones = $this->Seccion_model->get_all(0, 100);\n $empleados = $this->Empleado_model->get_info($id);\n $data['empleado'] = $empleados[0];\n $data['empleados'] = array_to_htmlcombo($empleados, array('blank_text' => '', 'id' => 'id', 'name' => array('nombre', 'apellido')));\n $data['controller_name'] = strtolower($this->uri->segment(1));\n\n $this->twiggy->set($data);\n $this->twiggy->display('reportes/horas_trabajadas');\n }", "public function edit($id)\n {\n echo \"Day la trang edit co id = \".$id;\n }", "public function byId($id);", "public function byId($id);", "public function byId($id);", "public function byId($id);", "public function loadId($id){\n\t\t$model=new Model();\n\t\t$resultado=$model->select(\"SELECT * FROM tb_usuarios WHERE idusuario = :ID\",array(\":ID\"=>$id));\n\t\tif (count($resultado)>0) {\n\t\t\t$this->setData($resultado[0]);\n\t\t}\n\t}", "public function info($id)\n {\n $sql = 'SELECT c.rowid, date_creation as datec, tms as datem, date_valid as date_validation, date_approve as datea, date_approve2 as datea2,';\n $sql.= ' fk_user_author, fk_user_modif, fk_user_valid, fk_user_approve, fk_user_approve2';\n $sql.= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseur as c';\n $sql.= ' WHERE c.rowid = '.$id;\n\n $result=$this->db->query($sql);\n if ($result)\n {\n if ($this->db->num_rows($result))\n {\n $obj = $this->db->fetch_object($result);\n $this->id = $obj->rowid;\n if ($obj->fk_user_author) $this->user_creation_id = $obj->fk_user_author;\n if ($obj->fk_user_valid) $this->user_validation_id = $obj->fk_user_valid;\n if ($obj->fk_user_modif) $this->user_modification_id =$obj->fk_user_modif;\n if ($obj->fk_user_approve) $this->user_approve_id = $obj->fk_user_approve;\n if ($obj->fk_user_approve2) $this->user_approve_id2 = $obj->fk_user_approve2;\n\n $this->date_creation = $this->db->idate($obj->datec);\n $this->date_modification = $this->db->idate($obj->datem);\n $this->date_approve = $this->db->idate($obj->datea);\n $this->date_approve2 = $this->db->idate($obj->datea2);\n $this->date_validation = $this->db->idate($obj->date_validation);\n }\n $this->db->free($result);\n }\n else\n {\n dol_print_error($this->db);\n }\n }", "public function tampil($id=null){\n\t\t$sql = \"SELECT * FROM berita\";\n\t\tif ($id !=null) {\n\t\t\t$sql .= \" WHERE id='$id' ORDER BY id DESC\";\n\t\t}else{\n\t\t\t$sql .= \" ORDER BY id DESC\";\n\t\t}\n\t\t$query = $this->db->query($sql) or die ($this->db->error);\n\t\treturn $query;\n\t}", "public function select($id)\t{\n\t\t\t$this->data = (array) \n\t\t\t\tself::$db->queryFetch(\n\t\t\t\t\t\"SELECT * FROM `{$this->table}` WHERE `id`=:id\",\n\t\t\t\t\tarray(':id'=>$id)\n\t\t\t\t);\n\t\t}", "function vedi($id) {\n if (null == $id || !is_numeric($id)) {\n $this->set_view('errore');\n $this->view->set_message('id non valido');\n $this->view->set_user($this->user);\n $this->view->render();\n die();\n }\n\n $stato = new stato($this->db, $id);\n $this->set_view('stati', 'vedi');\n $this->view->set_db($this->db);\n $this->view->set_user($this->user);\n $this->view->set_model($stato);\n $this->view->render();\n die();\n }", "function ambil_syarat_usulan_by_id_proyek($id)\n\t{\n\t\t$sql = \"SELECT * FROM irena_view_sbsn_usulan_syarat WHERE id_proyek = '$id'\t\";\n\t\treturn $this->db->query($sql);\n\t}", "public function show($id)\n\t{\n\t\t//comparte show con recursos\n\t}", "function show( $id )\n {\n $tema = $this->model_valasztott->getDiakTema($this->logged_in['uid']);\n if ($tema['valasztott_id'] != $id) {\n redirect(base_url().'valasztott');\n }\n\t\t$data = $this->model_valasztott->get( $id );\n\n if (empty($data)) {\n redirect(base_url());\n }\n\n $fields = $this->model_valasztott->fields( TRUE );\n \n $this->template->assign( 'id', $id );\n\t\t$this->template->assign( 'valasztott_fields', $fields );\n\t\t$this->template->assign( 'valasztott_data', $data );\n\t\t$this->template->assign( 'table_name', 'Valasztott' );\n\t\t$this->template->assign( 'template', 'show_valasztott' );\n\t\t$this->template->display( 'frame_admin.tpl' );\n }", "public function getbateauCordonner($id)\r\n {\r\n $idbateau = $this->_bdd->query(\"SELECT gps.`id`, gps.id_bateau, gps.latitude, gps.longitude, bateau.nom FROM gps, bateau WHERE gps.id_bateau = bateau.id AND gps.id = '$id'\");\r\n $data = $idbateau->fetch();\r\n $this->_idBateau = $data[\"id\"];\r\n $this->_nomBateau = $data[\"nom\"];\r\n $this->_latitude = $data[\"latitude\"];\r\n $this->_longitude = $data[\"longitude\"];\r\n $this->_id = $data['id'];\r\n }", "function piutang_faktur($id) {\n\t\t// $pager = $this -> pagination_lib -> pagination($this -> piutang_model -> __get_piutang_detail($id),3,10,site_url('piutang_detail'));\n\t\t// $view['piutang_detail'] = $this -> pagination_lib -> paginate();\n\t\t$view['detail'] =$this -> piutang_model -> __get_piutang_detail($id);\n\t\t//$view['pages'] = $this -> pagination_lib -> pages();\n\t\t$view['id'] = $id;\n\t\t\n\t\t//echo \"sss\";die;\n\t\t\n\t\t//$view['buku'] = $this -> books_lib -> __get_books_all();\n\t\t// $view['hostname']=$this->db->hostname;\n\t\t// $view['username']=$this->db->username;\n\t\t// $view['password']=$this->db->password;\n\t\t// $view['database']=$this->db->database;\t\t\n\t\t$this->load->view('prinanpb', $view, false);\n\t}", "public function edit($id) //Hämta redan bokad boking\n\t{\n\t\t//\n\t}", "public function datumDeleteFromId($id){\n $sql = \"select persnr,datum from dzeitsoll where id='$id'\";\n $res = $this->db->query($sql);\n $rows = $res->fetchAll();\n $row = $rows[0];\n $datum = $row['datum'];\n $persnr = $row['persnr'];\n // zjistim kolik takovych datumu pro daneho cloveka jeste mam\n $sql = \"select count(datum) as pocetdatumu from dzeitsoll where persnr='$persnr' and datum='$datum'\";\n $res = $this->db->query($sql);\n $pocetDatumu = $res->fetchSingle();\n if($pocetDatumu>1){\n // muzu dane id smazat\n $this->db->query(\"delete from dzeitsoll where id='$id' limit 1\");\n }\n else{\n // nebudu mazat ale nastavim stunden = 0, oe = -\n $sql = \"update dzeitsoll set stunden=0,oe='-' where id='$id'\";\n $this->db->query($sql);\n }\n }", "public function edit($id)\n {\n $datadonasi = mysqli_query(\n $this->koneksi,\n \"select * from donasi where id='$id'\"\n );\n return $datadonasi;\n }", "function getdatait( $id = 0 ){\n\t\tif($id === 0){\n\t\t\t$id = intval($this->datasis->dameval(\"SELECT MAX(id) FROM rcobro\"));\n\t\t}\n\t\tif(empty($id)) return '';\n\t\t$grid = $this->jqdatagrid;\n\t\t$mSQL = \"SELECT * FROM smov WHERE rcobro=${id}\";\n\t\t$response = $grid->getDataSimple($mSQL);\n\t\t$rs = $grid->jsonresult( $response);\n\t\techo $rs;\n\t}", "public function edit($id)\n {\n $dataanak = mysqli_query(\n $this->koneksi,\n \"select * from data_anak where id='$id'\"\n );\n return $dataanak;\n }", "public function edit($id)\n {\n $datasiswa = mysqli_query($this->koneksi,\"select * from ulangan where id='$id'\");\n return $datasiswa;\n }", "function get_id($id){\n\t\t$this->id = $id;\n\t}", "public function setId($id){ $this->id=$id;}", "function get_by_id($id) {\n $this->db->join('tbl_ijin','tbl_out.id_ijin=tbl_ijin.id_ijin');\n $this->db->join('tbl_perusahaan','tbl_out.id_perusahaan=tbl_perusahaan.id_perusahaan');\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "public function edit($id)\n {\n $datadiri = mysqli_query($this->koneksi,\"select * from formulir where id='$id'\");\n return $datadiri;\n }", "public function dohvatiJeloId($id) {\n $this->db->select(\"idR,naziv,sadrzaj,obrok,kategorija,spec_prilika,slika\");\n $this->db->from(\"recepti\");\n $this->db->where(\"idR\", $id);\n $query = $this->db->get();\n return $query->result();\n }", "public function buscar_por_id ($id){\n $consulta = \"SELECT t1.id AS id_producto, t2.id AS id_tienda, t1.nombre AS nombre_producto, t2.nombre AS nombre_tienda, t1.imagen, t1.marca, t1.descripcion, t1.precio, t1.stock, t1.categoria FROM productos_en_venta AS t1 JOIN tiendas AS t2 WHERE t1.id = \".$id.\" AND t1.id_tienda=t2.id\";\n if($resultado = $this->conexion->query($consulta)){\n $fila = $resultado->fetch_assoc();\n return array(\"error\"=>null, \"producto\"=>$fila);\n }else{\n echo \"Error: (\" . $this->conexion->errno . \") \" . $this->conexion->error;\n }\n }", "function detailTienThuong($idTienThuong){\n\t\t\t$sql=\"SELECT GiaTri FROM tienthuong WHERE idTienThuong=$idTienThuong\";\n\t\t\t$kq=mysql_query($sql) or die(mysql_error());\n\t\t\treturn $kq;\n\t\t}", "function get_tb_jarak_desa($id)\n {\n return $this->db->get_where('tb_jarak_desa',array('id'=>$id))->row_array();\n }", "public function dohvSmestaj($id){\n return ($this->where('id',$id)->find());\n }", "function getWithDagindeling($id){\n $this->db->where('id', $id);\n $query = $this->db->get('taak');\n $taak = $query->row();\n \n $this->load->model('dagindeling_model');\n $this->load->model('locatie_model');\n $taak->dagindeling = $this->dagindeling_model->getByTaak($taak->dagindelingId);\n $taak->locatie = $this->locatie_model->getByTaak($taak->dagindelingId);\n \n return $taak;\n }", "public function detail($id) {\n\t\t$output \t\t= $this->Tabel_dokumen->detail(array('idDokumen'=> $id));\n\t\t$output['user'] = $this->Tabel_dokumen->user_get(array('idDokumen'=> $id));\n\n\t\t//* formatting the data to be view properly at the output *//\n\t\tforeach ($output['user'] as &$key) {\n\t\t\t\n\t\t\tswitch ($key['tipe']) {\n\t\t\t\tcase \"p\"\t: $key['detail']['nama'] = $this->detail_pegawai($key['userId'])['nama'];\n\t\t\t\t\t\t\t $key['detail']['id'] = $key['userId'];\n\t\t\t\t\t\t\t $key['detail']['tipe'] = $key['tipe'];break;\t \t\n\t\t\t\tdefault \t: $key['detail']['nama'] = $this->apicall->get(URL_API.'daftar/user/'.$key['userId'])[0]->nama;\n\t\t\t\t\t\t\t $key['detail']['id'] = $key['userId'];\n\t\t\t\t\t\t\t $key['detail']['tipe'] = $key['tipe'];\n\t\t\t}\n\t\t}\n\t\techo json_encode($output);\n\t}", "public function detail($id)\n\t{\n\t\t$this->load->model('AnnonceModel');\n\t\t// on appelle la methode liste() du modele, qui retourne le tableau de resultat ici affecté dans la variable $adetail (un tableau)\n\t\t$detailannonce = $this->AnnonceModel->Detail($id);\n\t\t// var_dump($Annonceannonce);\n\t\t$variables_details['dtls'] = $detailannonce;\n\t\t$this->load->view('header');\n\t\t$this->load->view('details', $variables_details);\n\t\t$this->load->view('footer');\n\t}", "function getdatait( $id = 0 ){\n\t\tif($id == 0){\n\t\t\t$id = $this->datasis->dameval('SELECT MAX(id) AS id FROM spre');\n\t\t}\n\t\t$dbid = intval($id);\n\t\tif(empty($id)) return '';\n\t\t$numero = $this->datasis->dameval(\"SELECT numero FROM spre WHERE id=${dbid}\");\n\t\t$dbnumero = $this->db->escape($numero);\n\n\t\t$orderby= '';\n\t\t$sidx=$this->input->post('sidx');\n\t\tif($sidx){\n\t\t\t$campos = $this->db->list_fields('itspre');\n\t\t\tif(in_array($sidx,$campos)){\n\t\t\t\t$sidx = trim($sidx);\n\t\t\t\t$sord = $this->input->post('sord');\n\t\t\t\t$orderby=\"ORDER BY `${sidx}` \".(($sord=='asc')? 'ASC':'DESC');\n\t\t\t}\n\t\t}\n\n\t\t$grid = $this->jqdatagrid;\n\t\t$mSQL = \"SELECT a.*, b.existen, b.activo, if(MID(b.tipo,1,1)='S',1,b.existen-a.cana) saldo \";\n\t\t$mSQL .= \"FROM itspre a JOIN sinv b ON a.codigo=b.codigo WHERE numero=${dbnumero} ${orderby}\";\n\t\t$response = $grid->getDataSimple($mSQL);\n\t\t$rs = $grid->jsonresult( $response);\n\t\techo $rs;\n\t}", "public function ambilkampus2($id){\r\n $sql = \"SELECT * FROM tbl_kampus where id='$id'\";\r\n $query = mysql_query($sql);\r\n return $query;\r\n\t }", "public function editberita($id){\n\t\t$flag = array('id_berita'=>$id);\n\t\t$q = $this->Allcrud->getData('berita',$flag)->row();\n\t\techo json_encode($q);\n\t}", "function get_by_id($id)\n {\n\t\t$this->db->join('ppi_tb_infeksi', 'ppi_tb_infeksi.id_infeksi = ppi_tb_nilai.id_infeksi');\n $this->db->where($this->id, $id);\n return $this->db->get($this->table)->row();\n }", "public static function ObtenerPorID($id) {\n }", "function getdatait( $id = 0 )\n\t{\n\t\tif ($id === 0 ){\n\t\t\t$id = $this->datasis->dameval(\"SELECT MAX(id) FROM prdo\");\n\t\t}\n\t\tif(empty($id)) return \"\";\n\t\t$numero = $this->datasis->dameval(\"SELECT numero FROM prdo WHERE id=$id\");\n\t\t$grid = $this->jqdatagrid;\n\t\t$mSQL = \"SELECT * FROM itprdo WHERE numero='${numero}' \";\n\t\t$response = $grid->getDataSimple($mSQL);\n\t\t$rs = $grid->jsonresult( $response);\n\t\techo $rs;\n\t}", "function newskomentar_viewdetail($tbl_newskomentar){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_newskomentar WHERE id='$id'\");\n\t\treturn $sql;\n}", "public function obrisiSmestajeKorisnika($id){\n $smestajiKorisnika = $this->where('idVlasnik',$id)->findAll();\n foreach($smestajiKorisnika as $smestaj){\n $this->obrisiSmestaj($smestaj->id);\n }\n }", "public function obtenerVideojuegosID($id)\n {\n $rows = DAOVideojuegos::getInstance()->obtenerVideojuego($id);\n foreach ($rows as $document) {\n $videojuego = json_decode(json_encode($document), true);\n $this->id = $id;\n $this->nombre = $videojuego[\"nombre\"];\n $this->plataforma = $videojuego[\"plataforma\"];\n $this->genero = $videojuego[\"genero\"];\n $this->fecha = $videojuego[\"fecha\"];\n if ($videojuego[\"imagen\"] != \"\")\n $this->imagen = $this->carpeta . $videojuego[\"imagen\"];\n else\n $this->imagen = $this->carpeta .\"default.jpg\";\n $this->valoracion = $videojuego[\"valoracion\"];\n $this->comentario = $videojuego[\"comentario\"];\n }\n }", "function abm($id)\n { \n $db['registro'] = $this->model->getRegistros($id);\n $db['id'] = $id;\n $db['cantidad'] = $this->model->getCantidad();\n \n \n $this->armarVista('abm', $db);\n }", "public function dapatkanDataLenkap(string $id): void\n {\n try {\n\n $id = Crypt::decrypt($id);\n $jenazah_data = Jenazah::find($id);\n\n $this->namaJenazah = $jenazah_data->nama;\n $this->jenazah_id = $jenazah_data->id;\n $this->alamat_jenazah = $jenazah_data->alamat;\n $this->suggestion_name = [];\n\n // ...\n } catch (\\Exception $exception) {\n\n $this->dispatchBrowserEvent('onActionInfo', [\n 'type' => 'error',\n 'title' => \"Error\",\n 'message' => 'Data tidak ditemukan.',\n ]);\n\n // ...\n }\n\n // ...\n }", "public function setId($id) ;", "public function AfficheArticle($id){\n include 'libs/db.php';\n $query=$connexion->query(\"SELECT nom_article,date_article,contenu FROM articles WHERE id_article=\".$id);\n $data=$query->fetch(PDO::FETCH_OBJ);\n\n\n print \"<h1>\".$data->nom_article.\"</h1>\";\n print \"<p>\".$data->date_article.\"</p>\";\n print \"<p>\".$data->contenu.\"</p>\";\n }", "public function daftar_tugas($id)\n {\n //Query untuk mendapatkan semua ticket dengan status 4 (On Process) atau 6 (Solve) dengan diurutkan berdasarkan tanggal tiket dibuat\n $query = $this->db->query(\"SELECT A.progress, A.status, A.id_ticket, A.reported, A.tanggal, A.tanggal_solved, A.id_kondisi, A.deadline,\n A.problem_detail, A.problem_summary, A.filefoto, B.nama_sub_kategori, \n C.nama_kategori, D.nama, G.nama_kondisi, G.warna, H.lokasi, J.nama_dept, K.nama_jabatan FROM ticket A \n LEFT JOIN sub_kategori B ON B.id_sub_kategori = A.id_sub_kategori\n LEFT JOIN kategori C ON C.id_kategori = B.id_kategori\n LEFT JOIN karyawan D ON D.nik = A.reported\n LEFT JOIN user E ON E.username = A.teknisi\n LEFT JOIN karyawan F ON F.nik = E.username\n LEFT JOIN kondisi G ON G.id_kondisi = A.id_kondisi\n LEFT JOIN lokasi H ON H.id_lokasi = A.id_lokasi\n LEFT JOIN bagian_departemen I ON I.id_bagian_dept = D.id_bagian_dept\n LEFT JOIN departemen J ON J.id_dept = I.id_dept\n LEFT JOIN jabatan K ON K.id_jabatan = D.nik\n WHERE F.nik = '$id' AND A.status IN (4,6,7) ORDER BY G.waktu_respon ASC\");\n return $query;\n }", "function sawlihat($id)\n\t{\n\t\t//$a = 'A1';\n\t\t//foreach ($q2 as $key) {\n\t\t\t//echo \"<br/>\";\n\t\t\t//echo $key->nidn.\" = \".$a;\n\t\t\t//echo \"<br/>\";\n\t\t\t\n\t\t\t//echo \"Hasil Akhir = \".number_format($kumulatip,2);\n\t\t\t//echo \"<br/>\";\n\t\t\t//$a++;\n\t\t//}\n\t\t$data['tahun'] = $id;\n\t\t$data['q2'] = $this->db->query(\"SELECT DISTINCT nidn,nama_karyawan FROM tbl_jadwal_matakuliah a JOIN tbl_karyawan b on a.nidn = b.nik where tahunajaran = '\".$id.\"'\")->result();\n\t\t$data['page'] = 'penilaian/saw_lihat';\n\t\t$this->load->view('template', $data);\t\n\t}", "public function idAction($id){\n\t\t/*$posts = $this->tags->query('*','postDetails')\n\t\t\t\t\t->where('anax_postDetails.tag_id = '.$id)\n\t\t\t\t\t->execute();*/\n\t\t$tag = $this->tags->query('anax_tags.name','tags')\n\t\t\t\t\t->where('anax_tags.id = '.$id)\n \t\t\t\t->execute(true);\n\t\t\n\t \t$posts = $this->tags->query('*, anax_postDetails.id as detail_id, anax_user.id as user_id','postDetails')\n\t \t\t\t\t->where('anax_postDetails.tag_id = '.$id)\n \t\t\t->leftJoin('post','anax_postDetails.post_id = anax_post.id')\n \t\t\t->leftJoin('user','anax_post.created_by_user = anax_user.id')\n \t\t\t\t->execute();\n\n \t$this->theme->setTitle('View Tag');\n \t$this->views->add(\n \t\t'tags/view',\n \t\t[\n \t\t\t'title' => 'All questions for <span class=\"text-primary\">'.$tag->name.'</span>',\n \t\t\t'posts' => $posts\n \t\t],\n \t\t'default_page'\n \t);\n\t}", "function select($id){\n\t\t\t$query=\"SELECT * FROM immobile WHERE id='$id';\";\n\t\t\t$this->database->Query($query);\n\t\t\t$result=$this->database->result;\n\t\t\t$row=mysql_fetch_array($result);\n\t\t\tif($row){\n\t\t\t\t$this->id=$row[0];\n\t\t\t\t$this->approvato=$row[1];\n\t\t\t\t$this->agente=$row[2];\n\t\t\t\t$this->contratto=$row[3];\n\t\t\t\t$this->descrizione=$row[4];\n\t\t\t\t$this->proprietario=$row[5];\n\t\t\t\t$this->immagine=$row[6];\n\t\t\t\t$this->metratura=$row[7];\n\t\t\t\t$this->prezzo=$row[8];\n\t\t\t\t$this->tipo=$row[9];\n\t\t\t\t$this->comune=$row[10];\n\t\t\t}\n\t\t}", "public function selectById($id);", "public function selectById($id);", "function get_by_id($id)\n {\n $this->db->select('a.*,b.nama_dak_rincian,b.nama_dak_komponen_sub,b.nama_dak_komponen,b.nama_jenis_output,IFNULL((SELECT realisasi_persen FROM t_realisasi WHERE id_rincian=a.id_rincian ORDER BY periode DESC LIMIT 1),0) AS persen');\n $this->db->from('v_rincian a');\n $this->db->join('v_dak_rincian b', 'a.id_dak_rincian=b.id_dak_rincian', 'left');\n $this->db->where('a.id_rincian', $id);\n return $this->db->get()->result();\n }", "public function mostrar($id)\n {\n //\n }", "public function mostrar($id)\n {\n //\n }", "public function mostrar($id)\n {\n //\n }", "public function mostrar($id)\n {\n //\n }", "public function findById($id){\n //recupere le nom de la classe et le formate\n $table = strtolower(get_class($this));\n\n //Prepare la requete\n $query = \"SELECT * FROM $table WHERE id=$id\";\n $results = $this->conn->prepare($query);\n\n //Execution requete et stockage resultats dans une variable\n $results->execute();\n $resultats = $results->fetchAll(PDO::FETCH_ASSOC);\n return $resultats;\n }", "private static function _id($id)\n {\n return ($id == Null)?Null:' id=\"'.$id.'\"';\n }", "public function show($id)\n {\n // Desde la vista no hago uso de esta funcion nunca. \n // Seria para mostrar un solo registro, desde la API esta disponible en api_show\n }", "private function createHTML(string $id): void {\n $table = $this->table[$id];\n $columns = $this->columns[$id];\n $where = $this->where[$id];\n $order = $this->order[$id];\n $buttons = $this->buttons[$id];\n $settings = $this->settings[$id];\n\n // Tilføj HTML klasse til tabellen hvis sortering er aktiveret\n $hasSorting = '';\n if(!empty($settings['ajaxsort']) && $settings['ajaxsort']) {\n $hasSorting = ' has-sorting';\n }\n\n // Start udskrivning af tabel og udskriv søgefelt hvis det er aktiveret\n echo \"<table id='$id' class='RCMSTable $hasSorting' style='width: 100%'>\";\n if(!empty($settings['searchbar']) && $settings['searchbar']) {\n echo '<tr>';\n echo '<td class=\"searchtd\" colspan=\"' . (count($columns) + count($buttons)) . '\"><input type=\"text\" class=\"searchbar\" placeholder=\"Søgefelt...\" /></td>';\n echo '</tr>';\n }\n\n // Udskriv tabel hovedet\n echo '<tr>';\n foreach ($columns as $column) {\n $sortKey = $column['column'] ?? '';\n $initialSortDir = $column['initial_sort_dir'] ?? '';\n $initialSortDir = $initialSortDir ? \"data-initial-sort-dir='$initialSortDir'\" : '';\n\n // Tjek om sortering er aktiveret og udskriv derefter\n if(!empty($settings['ajaxsort']) && $settings['ajaxsort']) {\n if (!empty($column['enable_ajax_sort']) && $column['enable_ajax_sort']) {\n echo \"<th class='th-can-sort' $initialSortDir data-sort-key=\\\"$sortKey\\\">\" . $column['label'] . \"</th>\";\n } else {\n echo '<th>' . $column['label'] . '</th>';\n }\n } else {\n echo '<th>' . $column['label'] . '</th>';\n }\n }\n foreach ($buttons as $button) {\n echo \"<th></th>\";\n }\n\n echo '</tr>';\n\n $rows = $this->retrieveData($table, $columns, $where, $order, $settings);\n\n // Udskriv alle rækkerne\n $this->buildRows($id, $rows);\n\n echo '</table>';\n }", "function ambil_data_log_usulan_by_id_proyek($id)\n\t{\n\t\t$sql = \"\tSELECT * FROM irena_view_sbsn_log_proyek\n\t\t\t\t\tWHERE \n\t\t\t\t\t\tid_proyek = '$id' \n\t\t\t\t\t\";\n\t\t\t\t\t\t\n\t\treturn $this->db->query($sql);\n\t}", "public function getById3($id = null)\n {\n $this->db->from('tabel_lapak');\n $this->db->join('tabel_peminjaman', 'tabel_peminjaman.kd_lapak = tabel_lapak.kd_lapak');\n //$this->db->join('tabel_pengguna', 'tabel_pengguna.kd_pengguna2=tabel_peminjaman.kd_pengguna');\n $this->db->where('tabel_lapak.kd_lapak', $id);\n $query = $this->db->get();\n return $query->result();\n }", "public function show($id)\n {\n return 'ID ogłoszenia to:' . $id . 'Działa, ale nie ma widoku';\n }", "public function edit($id)\n\t{\n\t\t$genero = Genero::lists('nombre', 'codigo');\n\t\t$datos['genero'] = $genero;\n\n\t\t$eps = Eps::lists('nombre', 'id');\n\t\t$datos['eps'] = $eps;\n\n\t\t$regimenss = Regimenss::lists('nombre', 'codigo');\n\t\t$datos['regimenss'] = $regimenss;\n\n\t\t$tiposmuestras = Tiposmuestras::lists('nombre', 'codigo');\n\t\t$datos['tiposmuestras'] = $tiposmuestras;\n\n $lugaresdiagnostico = Lugaresdiagnostico::lists('nombre', 'codigo');\n $datos['lugaresdiagnostico'] = $lugaresdiagnostico;\n\n $tratamientos = Tratamientos::lists('nombre', 'codigo');\n $datos['tratamientos'] = $tratamientos;\n\n $meses = Meses::lists('nombre', 'id');\n $datos['meses'] = $meses;\n\n $barrios = Barrios::lists('nombre', 'id');\n $datos['barrios'] = $barrios;\n\n //Obtener el modelo principal en base al codigo(id)\n $registropoblacional = Registropoblacional::findOrFail($id);\n $registropoblacional->fechanacimiento = $registropoblacional->getFechaNacimientoLargaAttribute();\n $registropoblacional->fechadiagnostico = $registropoblacional->getFechaDiagnosticoLargaAttribute();\n $registropoblacional->fechaultcontrolmed = $registropoblacional->getFechaUltControlMedLargaAttribute();\n\n $datos['registropoblacional'] = $registropoblacional;\n\n\n // Obtener la localidad y estrato seleccionados\n $barrio = Barrios::find($registropoblacional->residenciahabitual);\n if(isset($barrio)){\n $localidad = $barrio->localidad;\n $estrato = $barrio->estrato;\n }else{\n $localidad = \"\";\n $estrato = \"\";\n }\n $datos['ubicacion'] = ['localidad' => $localidad, 'estrato' => $estrato];\n\n\n return view('admin.registropoblacional.edit', $datos);\n // $date = Carbon::now('America/Bogota');\n // dd($date->format('d-m-Y'));\n\t}", "function detail_pasien($id)\n\t{\n\t\t$record['pasien'] = $this->Kesehatan_M->read('pasien',array('id'=>$id))->result();\n\t\t$this->load->view('static/header');\n\t\t$this->load->view('static/navbar');\n\t\t$this->load->view('admin/detail_pasien',$record);\n\t\t$this->load->view('static/footer');\n\t}", "public function load($id){\n\t\t$sql = 'SELECT * FROM cbt_jadwal_ujian WHERE id_jadwal = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "public function view_by($id){\n $this->db->where('id', $id);\n return $this->db->get('pegawai')->row();\n }", "public function detalhes($id){\n\t\t\n\t\t$dados = array();\n\t\t$r = new Relatorios();\n\t\t$dados['ordem'] = $r->getOrdem($id);\n\t\t$dados['funcionario'] = $r->getFuncionario($dados['ordem']['id_f']);\n\t\t$dados['cliente'] = $r->getCliente($dados['ordem']['id_c']);\n\t\t\n\t\t// var_dump($dados['cliente']);\n\t\t$this->loadTemplate('detalhes', $dados);\n\t}", "function select($id)\r\n{\r\n\r\n$sql = \"SELECT * FROM aattribut WHERE aatribut_pk_id = $id;\";\r\n$result = $this->database->query($sql);\r\n$result = $this->database->result;\r\n$row = mysql_fetch_object($result);\r\n\r\n\r\n$this->id_attribut = $row->id_attribut;\r\n\r\n$this->id_produit = $row->id_produit;\r\n\r\n$this->valeur = $row->valeur;\r\n\r\n}", "public function addDataMasalah($id = null) {\n $d_mslh = new DataMasalah($this->registry);\n //$d_bobot = new DataBobot($this->registry);\n //$this->view->bobot = $d_bobot->get_bobot_pkn_lvl2();\n if (isset($_POST['add_d_mslh'])) {\n $kd_d_user = Session::get('id_user');\n $tgl_mslh = $_POST['tgl_mslh'];\n $masalah = $_POST['masalah'];\n\n $d_mslh->set_kd_d_user($kd_d_user);\n $d_mslh->set_tgl_mslh($tgl_mslh);\n $d_mslh->set_masalah($masalah);\n\n if (!$d_mslh->add_d_mslh()) {\n $this->view->d_rekam = $d_mslh;\n $this->view->error = $d_mslh->get_error();\n }\n }\n //var_dump($d_tetap->get_d_tetap());\n if (!is_null($id)) {\n $d_mslh->set_kd_d_mslh($id);\n $this->view->d_ubah = $d_mslh->get_d_mslh_by_id($d_mslh);\n }\n\n\n //$this->view->dasbor = $d_mslh->get_d_pkn_per_tgl();\n $this->view->data = $d_mslh->get_d_mslh();\n $this->view->render('admin/dataMasalah');\n }", "public function edit($id)\n {\n $data = DB::table('hd_pemesanan')\n ->select('hd_pemesanan.*', 'users.name')\n ->join('users', 'users.id', '=', 'hd_pemesanan.dibuat_oleh')\n ->where(DB::raw('md5(hd_pemesanan.id_pemesanan)'), $id)\n ->orderBy('hd_pemesanan.no_pemesanan', 'DESC')\n ->limit(1)\n ->first();\n \n $rev = substr($data->no_pemesanan, 19, 9);\n $revx = substr($data->no_pemesanan, 16, 5);\n $no = (Int)$rev + 1;\n\n \n if ($no < 10) {\n $no_pemesanan = ($revx == '') ? $data->no_pemesanan .\"REV00\".$no : substr($data->no_pemesanan, 0, 19).\"00\".$no;;\n } else if ($no < 100) {\n $no_pemesanan = ($revx == '') ? $data->no_pemesanan .\"REV0\".$no : substr($data->no_pemesanan, 0, 19).\"0\".$no;;\n } else {\n $no_pemesanan = ($revx == '') ? $data->no_pemesanan .$no : substr($data->no_pemesanan, 0, 19).$no;;\n }\n // dd($no_pemesanan);\n\n $item = DB::table('hd_pemesanan_detail')\n ->select('hd_pemesanan_detail.*', 'hd_barang.nama_barang', 'hd_barang_satuan.id_satuan', 'hd_barang_satuan.nama_satuan')\n ->join('hd_barang', 'hd_pemesanan_detail.id_barang', '=', 'hd_barang.id_barang')\n ->join('hd_barang_vendor', 'hd_barang_vendor.id_barang', '=', 'hd_barang.id_barang')\n ->join('hd_barang_satuan', 'hd_barang_satuan.id_satuan', '=', 'hd_barang_vendor.id_satuan')\n ->where(DB::raw('md5(id_pemesanan)'), $id)\n ->get();\n\n $listItem = DB::table('v_barang_vendor')->where('id_vendor', $data->id_vendor)->get();\n $result = substr($data->no_pemesanan, 0, 3);\n $vendor = Vendor::where('status', '1')->get();\n\n return view('backend.pemesanan.edit', compact('vendor', 'no_pemesanan', 'data', 'item', 'listItem'));\n\n }", "public function selektujeObjekat($idObjekta)\n {\n $upit = \"select Tpleme.naziv AS plemeNaziv, Toznaka.*, Toznaka.tekstNatpisa AS natpis, TprovincijaNalaska.naziv AS provincijaNalaska , TgradNalaska.naziv AS gradNalaska, Mesto.naziv AS mestoNalaska , TmodernoImeDrzave.naziv AS modernoImeDrzave , vrstaNatpisa.naziv AS vrstaNatpisa , jezik.naziv AS jezik , Ustanova.naziv AS ustanova, TmodernoMesto.naziv AS modernoMesto FROM (select * from Objekat) Toznaka JOIN (select * from Provincija) TprovincijaNalaska ON Toznaka.provincija = TprovincijaNalaska.id JOIN (select * from Grad) TgradNalaska ON Toznaka.grad = TgradNalaska.id JOIN (select * from ModernaDrzava) TmodernoImeDrzave ON Toznaka.modernaDrzava = TmodernoImeDrzave.id JOIN (select * from ModernoMesto) TmodernoMesto ON Toznaka.modernoMesto = TmodernoMesto.id JOIN (select * from Pleme) Tpleme ON Toznaka.pleme = Tpleme.id LEFT JOIN Mesto ON Toznaka.mesto = Mesto.id LEFT JOIN vrstaNatpisa ON Toznaka.vrstaNatpisa = vrstaNatpisa.id LEFT JOIN jezik ON Toznaka.jezik = jezik.id LEFT JOIN ustanova on Toznaka.ustanova = Ustanova.id where Toznaka.id = :idObjekta \";\n\n $stmt=konekcija::getConnectionInstance()->prepare($upit);\n $stmt->bindParam(':idObjekta', $idObjekta , PDO::PARAM_INT);\n $stmt->execute();\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n $d = $stmt->fetch();\n return $this->obradiVrstaId($d);\n }", "public function detail_dosen($id){\n $this->db->where('dosen.id',$id);\n // $this->db->join('dosen_pt', 'dosen_pt.id_dosen_siakad = dosen.id');\n // $this->db->join('sms', 'sms.id_sms = dosen_pt.id_sms');\n // $this->db->join('tahun_ajaran', 'tahun_ajaran.id_thn_ajaran = dosen_pt.id_thn_ajaran');\n $query = $this->db->get('dosen');\n return $query->row();\n }", "function getTipNoidungById($id){\n $sql=\"SELECT * FROM tip_note WHERE id_tip='$id'\";\n return queryOne($sql);\n }", "public function show($id)\n {\n $datadiri = mysqli_query($this->koneksi,\"select * from formulir where id='$id'\");\n return $datadiri;\n }" ]
[ "0.72076106", "0.71496433", "0.70932883", "0.70932883", "0.70932883", "0.70517683", "0.70459807", "0.7007732", "0.6888495", "0.6708368", "0.6704097", "0.669576", "0.66858524", "0.6617069", "0.65676785", "0.656367", "0.6533534", "0.65216494", "0.6521068", "0.6505614", "0.6498642", "0.64978313", "0.6490103", "0.64733034", "0.6466092", "0.64597374", "0.6458149", "0.6458149", "0.6458149", "0.6458149", "0.6447302", "0.64436823", "0.64366335", "0.64320815", "0.64277774", "0.64277375", "0.6426264", "0.64225954", "0.6411447", "0.6399096", "0.63975406", "0.6394229", "0.6391905", "0.6387965", "0.63849324", "0.63805866", "0.6369693", "0.63624555", "0.63577163", "0.6351175", "0.6343257", "0.63289064", "0.6322424", "0.631784", "0.6314636", "0.63078755", "0.6306437", "0.62980574", "0.62946826", "0.629254", "0.628159", "0.62809294", "0.6276682", "0.6271836", "0.6269942", "0.62680846", "0.62675184", "0.62553734", "0.62552136", "0.6254333", "0.62508297", "0.6248259", "0.6247309", "0.6241724", "0.6233362", "0.6231516", "0.6231516", "0.6222431", "0.6221158", "0.6221158", "0.6221158", "0.6221158", "0.62198126", "0.6217986", "0.6209134", "0.6206018", "0.62018234", "0.61968637", "0.61921585", "0.61914635", "0.61912274", "0.61910874", "0.61899143", "0.6188364", "0.6186215", "0.6179669", "0.6174319", "0.6173679", "0.61729616", "0.6170843", "0.6170456" ]
0.0
-1
Geeft een true terug als iemand zich ingeschreven heeft voor een sessie, een false voor niet ingeschreven personen
function isEnrolled($columnId, $userId) { $this->db->where('planningKolomId', $columnId); $this->db->where('gebruikerId', $userId); $result = $this->db->get('aanwezigheid')->row(); return (isset($result) ? true : false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verificalogin(){\n if(!isset($this->session->datosusu)){\n return true;\n }\n }", "private function sesion_iniciada()\n\t{\n\t\t$this->load->library(\"session\");\n\t\tif($this->session->userdata(\"isess\")){\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "function EstoyLogueado()\n\t{\n\t\tif (!isset($_SESSION['clientecod']) || $_SESSION['clientecod']==0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function isGerechtigd()\n {\n if(isset($_SESSION['gebruiker'])&&!empty($_SESSION['gebruiker']))\n {\n $gebruiker=$_SESSION['gebruiker'];\n if ($gebruiker->getRecht() == \"medewerker\")\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n \n return false;\n \n \n }", "private\n function checkAuth()\n {\n if (!isset($_SESSION['artiste_id'])) {\n return false;\n }\n return true;\n }", "function autenticado(){\n\tif(isset($_SESSION['DNI'])){//Si existe, existe\n\t\treturn true;\n\t}else{//Si no existe, no existe\n\t\treturn false;\n\t}\n}", "function invitado() {\n\tif(!isset($_SESSION['usuario'])) {\n\t\treturn false;\n\t} else {\n\t\treturn $_SESSION['usuario']==\"Invitado\";\n\t}\n\t\n}", "public function isInscrit(){\r\n $retour = false ;\r\n $pseudo = $this -> getPseudo();\r\n\tif(!empty($pseudo)){\r\n\t$q = \"select User_inscrit as i from UserTab where User_pseudo = '\".$pseudo.\"'\";\r\n\t$res = execute($q) ;\r\n\t\twhile($l = mysql_fetch_assoc($res)){\r\n\t\t if($l['i'] == 1) $retour = true ;\r\n\t\t}\r\n\t}\r\n \r\n return $retour ;\r\n\r\n }", "function getSessionExiste()\n{\n $sessionEstValide=false;\n \n setSessionOn();\n\n if (isset($_SESSION['AuthInformation']) && !empty($_SESSION['AuthInformation']))\n {\n $ValidSession = true;\n } \n return $ValidSession;\n}", "function is() {\n global $_SESSION;\n if (! empty($_SESSION['payback']['user'])) return true;\n else return false;\n }", "function isNew()\n {\n\t $counter = $this->get( 'session.counter' );\n\t\tif( $counter === 1 ) {\n\t\t\treturn true;\n\t\t}\n return false;\n }", "function loggedin() {return $this->login_state!=0;}", "function auth()\n\t{\n\t\t$_aok_ = $_COOKIE['_aok_'];\n\t\tif (isset($_aok_))\n\t\t{\n\t\t\t$query = mysql_query(\"SELECT sessionId FROM auth WHERE sessionId = '$_aok_'\");\n\t\t\tif (mysql_num_rows($query) > 0)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function authEstaAutenticado() {\n return isset($_SESSION['usuario_admin']);\n}", "public function is_inspector()\n {\n $session = $this->session->userdata('user');\n if($session)\n {\n if($session['role'] == 'INSPECTOR')\n {\n if(date('H') > 7 AND date('H') < 14)\n {\n $access = FALSE;\n }\n else\n {\n $access = TRUE;\n }\n\n $session['timeAccess'] = $access;\n $this->session->set_userdata($session);\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }\n else\n {\n return FALSE;\n $this->log_out();\n }\n }", "protected function valid()\r\n {\r\n return isset($_SESSION['user']['user_id']) ? true : false;\r\n }", "function estaLogueado() {\n return isset($_SESSION[\"email\"]);\n }", "public function isLogin() : bool\n {\n\n\n return (bool) Session::key()->currentUser;\n\n //return $this->validate();\n\n }", "public function loggedin_face (){\n\t\treturn (bool) $this->session->userdata('user_profile[\"id\"]');\n\t\t}", "function teacher_logged_in()\r\n{\r\n\r\n if (isset($_SESSION['SSN']) && !empty($_SESSION['SSN'])) {\r\n\r\n\r\n return true;\r\n } else {\r\n\r\n return false;\r\n }\r\n\r\n\r\n}", "public function state()\n {\n return isset($_SESSION['id']);\n }", "function renren_user_logined() {\n global $RR_config;\n return isset($_COOKIE[$RR_config->APIKey.'_session_key']) || !empty($_COOKIE[$RR_config->APIKey.'_session_key']);\n}", "public function isGerechtigd() {\n if (isset($_SESSION['gebruiker']) && !empty($_SESSION['gebruiker'])) {\n $gebruiker = $_SESSION['gebruiker'];\n if ($gebruiker->geefRecht() == \"klant\") {\n return true;\n } else {\n return false;\n }\n }\n return false;\n }", "function inicie_sesion(){\n return (isset($_SESSION['usuario'])&&$_SESSION['usuario']!=''&&isset($_SESSION['session_key']));\n}", "function is_logged2(){\n\t\t//var_dump($_SESSION['nik']);\n\tif (isset($_SESSION['nik']) AND isset($_SESSION['name']))\n\t\treturn true;\n\t\n\treturn false;\n}", "public function hasPersistentLogin();", "public function userActive(){\n\t\treturn (isset($this->session) && $this->session != null && isset($this->session['id']) && $this->session['id'] > 0) ? true : false;\n\t}", "public function checkLogin(){\n $dbQuery = new DBQuery(\"\", \"\", \"\");\n $this->email = $dbQuery->clearSQLInjection($this->email);\n $this->senha = $dbQuery->clearSQLInjection($this->senha);\n \n // Verificar quantas linhas um Select por Email e Senha realiza \n $resultSet = $this->usuarioDAO->select(\" email='\".$this->email.\"' and senha='\".$this->senha.\"' \");\n $qtdLines = mysqli_num_rows($resultSet);\n \n // Pegar o idUsuario da 1ª linha retornada do banco\n $lines = mysqli_fetch_assoc($resultSet);\n $idUsuario = $lines[\"idUsuario\"];\n \n\n \n // retorna aonde a função foi chamada TRUE ou FALSE para se tem mais de 0 linhas\n if ( $qtdLines > 0 ){\n // Gravar o IdUsuario e o Email em uma Sessão\n session_start();\n $_SESSION[\"idUsuario\"] = $idUsuario;\n $_SESSION[\"email\"] = $this->email;\n return(true);\n }else{\n // Gravar o IdUsuario e o Email em uma Sessão\n session_start();\n unset($_SESSION[\"idUsuario\"]);\n unset($_SESSION[\"email\"]);\n return(false);\n }\n }", "public function isLogined()\n {\n return isset($_SESSION['userLogin']);\n }", "function is_authed()\n{\n \n //echo \"<br/>is_authed\";\n\n if (isset($_COOKIE['cookie_username']) && isset($_COOKIE['cookie_encrypted_username']))\n\t {\n $_SESSION['username'] = $_COOKIE['cookie_username'];\n $_SESSION['encrypted_name'] = $_COOKIE['cookie_encrypted_username'];\n $_SESSION['user_id'] = $_COOKIE['cookie_user_id'];\n \n //get first and last names from db\n $user_id = $_SESSION['user_id'];\n if($user_id){\n $user_obj = new user();\n $result = $user_obj -> get(\"user_id=$user_id\");\n $_SESSION['firstname'] = $result[0]['firstname'];\n $_SESSION['lastname'] = $result[0]['lastname'];\n }\n\t }\n \n // Check if the encrypted username is the same as the unencrypted one, if it is, it hasn't been changed\n if (isset($_SESSION['username']) && (md5($_SESSION['username']) == $_SESSION['encrypted_name'])){\n return true;\n } else {\n return false;\n }\n\n}", "public function verifysession(){\n if(isset($_SESSION['email'],$_SESSION['datekey'],$_SESSION['privkey'])){\n if($_SESSION['datekey'] == md5(date(\"Y-M-D\"))){\n $email = $this->clean($_SESSION['email']);\n $sql = mysqli_query($this->db, \"SELECT privkey FROM members WHERE email='$email' LIMIT 1\");\n $count = mysqli_num_rows($sql);\n if($count == 1){\n $row = mysqli_fetch_assoc($sql);\n $privkey = $row[\"privkey\"];\n if($privkey == $_SESSION['privkey']){\n return true;\n }else{\n return false;\n }\n }else{\n return false;\n }\n }else{\n return false;\n }\n }else{\n return false;\n }\n }", "function CheckUserAsBoolean(){\n if(isset($_SESSION['user'])){\n return true;\n }\n else\n {\n return false;\n }\n}", "public function IsLog()\r\n {\r\n if (isset($_SESSION['uid'])){\r\n //Retourne vrai\r\n return true;\r\n }\r\n else{\r\n //Retourne faux\r\n return false;\r\n }\r\n }", "public static function isLogged()\n {\n $session = Session::Instance();\n\n if ( empty($session->get('uid')) ) {\n return false;\n }\n\n $redis = self::redisInstance();\n\n /** get data from cookie */\n $uid = Cookie::get('uid');\n $sid = Cookie::get('sid');\n $secret = Cookie::get('secret');\n $hash = self::makeHash('sha256', self::SALT . $sid . self::AUTHSALT . $uid);\n\n if ($redis->get($_SERVER['REDIS_PACKAGE'] . ':sessions:secrets:' . $hash) && $hash == $secret) {\n\n // Создаем новую сессию\n $auth = new Model_Auth();\n $auth->recoverById($uid);\n\n $sid = $session->id();\n $uid = $session->get('uid');\n\n $redis->delete($_SERVER['REDIS_PACKAGE'] . ':sessions:secrets:' . $hash);\n\n // генерируем новый хэш c новый session id\n $newHash = self::makeHash('sha256', self::SALT . $sid . self::AUTHSALT . $uid);\n\n // меняем хэш в куки\n Cookie::set('secret', $newHash, Date::MONTH);\n\n // сохраняем в редис\n $redis->set($_SERVER['REDIS_PACKAGE'] . ':sessions:secrets:' . $hash, $sid . ':' . $uid . ':' . Request::$client_ip, array('nx', 'ex' => 2629744));\n\n } else {\n return false;\n }\n\n return true;\n }", "public function session_check(){\n if(isset($_SESSION['login_user_id'])){\n return true;\n } else {\n return false;\n }\n }", "static public function isUser(){\n if ( isset($_SESSION['id']) && $_SESSION['id'] != 0 ) {\n return true;\n } else {\n return false;\n }\n }", "function is_logged_in()\n{\n if (isset($_SESSION['ingelogd']) && $_SESSION['ingelogd'] == true) {\n return true;\n }\n return false;\n}", "public function loggedIn(){\r\n if (isset($_SESSION['user_session']))\r\n return true;\r\n else\r\n return false;\r\n }", "function isUserLoggedin() \n {\n $stmt = self::$_db->prepare(\"SELECT count(id_user) AS c FROM user WHERE session=:sid\");\n $sid = session_id();\n $stmt->bindParam(\":sid\", $sid);\n $stmt->execute();\n $count = $stmt->fetch()[\"c\"];\n if($count == 1)\n {\n return \"true\";\n }\n else if($count < 1)\n {\n return \"false\";\n }\n else\n {\n return \"Error: More then one identical User could be logged in!\";\n }\n }", "function isLoggedIn($token){\n\t\tglobal $db;\n\t\tglobal $Student;\n\t\t$session = $this->GetUserIdByToken($token);\n\t\tif($session!=null)\n\t\t{\n\t\t\t$Student->UpdateActiveDate($session);\n\t\t\treturn true;\n\t\t}\n\t\telse return (object)array(\"error\" => \"token not found\");\n\t}", "public function IsAuthenticated()\n {\n $acronym = isset($_SESSION['user']) ? $_SESSION['user']->acronym : null;\n\n if($acronym) \n {\n $this->IsAuthenticated = true;\n }\n else \n {\n $this->IsAuthenticated = false;\n }\n \n return $this->IsAuthenticated;\n }", "function isLogged(){\n\n\tglobal $db;\n\tif(!isset($_COOKIE['caledonian']) || empty($_COOKIE['caledonian'])){\n\t\treturn false;\n\t}else{\n\t\t$db->where('session_token=?',array($_COOKIE['caledonian']))->getOne('users');\n\t\tif($db->count==0){return false;}else{return true;}\n\t}\n\n}", "public function v_nuevo(){\n\t\tif($this -> e_user === '' && $this -> e_pass === '' && $this -> e_email === ''){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function checkLogin() {\n /* Check if user has been remembered */\n if (isset($_COOKIE['cook_VenusetP_UserEmail']) && isset($_COOKIE['cook_Venueset_UserPassword'])) {\n $varUserEmail = $_COOKIE['cook_VenusetP_UserEmail'];\n $varUserPassword = $_COOKIE['cook_Venueset_UserPassword'];\n /* Confirm that username and password are valid */\n $arrUserFlds = array('pkUserID', 'UserEmail', 'UserPassword', 'UserFirstName');\n $varUserWhere = ' 1 AND UserEmail = \\'' . $varUserEmail . '\\' AND UserPassword = \\'' . md5(trim($varUserPassword)) . '\\'';\n //echo '<pre>';print_r($varUserWhere);exit;\n $arrUserList = $this->select(TABLE_USERS, $arrUserFlds, $varUserWhere);\n if (count($arrUserList) > 0) {\n /* $_SESSION['VenusetP_UserEmail'] = $arrUserList[0]['UserEmail'];\n $_SESSION['VenusetP_UserID'] = $arrUserList[0]['pkUserID'];\n $_SESSION['VenusetP_UserName'] = $arrUserList[0]['UserFirstName']; */\n }\n return true;\n } else {\n return false;\n }\n }", "public function loggedIn() {\r\n //if userID is not proper then return False.\r\n if (intval($this->id) <= 0) {\r\n return False;\r\n }\r\n // if we last checked for login under a second ago then return true.\r\n if (($this->id == $_SESSION['id']) && $_SESSION['lastLoginCheckTime'] > microtime(true) - 1) {\r\n return True;\r\n } elseif (isset($_SESSION['switched_user'])) {\r\n $checkID = $_SESSION['switched_user'];\r\n } else {\r\n $checkID = $this->id;\r\n }\r\n $thisUserInfo = $this->dbConn->queryFirstRow(\"SELECT `ip` FROM `usermap` WHERE `user_id` = \".intval($checkID).\" ORDER BY `last_date` DESC LIMIT 1\");\r\n if (!$thisUserInfo || $thisUserInfo['ip'] != $_SERVER['REMOTE_ADDR']) {\r\n return False;\r\n }\r\n $_SESSION['lastLoginCheckTime'] = microtime(true);\r\n return True;\r\n }", "function estConnecte() {\n\n return isset($_SESSION['name']);\n}", "public function is_surveillant() {\n return $this->session->get(\"niveau_acces\") >= 1;\n }", "function userConnecte(){\n\tif(isset($_SESSION['membre'])){\n\t\treturn TRUE;\n\t}\n\telse{\n\t\treturn FALSE;\n\t}\n}", "public function check_user(){\n\t\tsession_regenerate_id(true);\n\t\tif((isset($_SESSION['angemeldet']) AND $_SESSION['angemeldet'] !== TRUE) OR !isset($_SESSION['angemeldet'])){\n\t\t\treturn FALSE;\n\t\t}else{\n\t\t\t$user = $this->sql->real_escape_string($_SESSION['benutzername']);\n\t\t\t$query = \"SELECT\n\t\t\t\t`\".IP.\"`, \n\t\t\t\t`\".USERAGENT.\"`,\n\t\t\t\t`\".REQUEST_TIME.\"`,\n\t\t\t\tUNIX_TIMESTAMP(`\".LIVESIGN.\"`) as \".LIVESIGN.\"\n\t\t\t\t\tFROM\n\t\t\t\t\t`\".USERS.\"`\n\t\t\t\t\tWHERE\n\t\t\t\t\t`\".USER.\"` = '\".$user.\"'\";\n\t\t\t$result = $this->sql->query($query);\n\t\t\tif ($result->num_rows == 1){\n\t\t\t\t$data = $result->fetch_object();\n\t\t\t\t$result->close();\n\t\t\t\t$ip \t\t\t\t\t= IP;\n\t\t\t\t$useragent \t\t= USERAGENT;\n\t\t\t\t$request_time = REQUEST_TIME;\n\t\t\t\t$livesign\t\t\t= LIVESIGN;\n\t\t\t\tif ($data->$ip !== $_SERVER['REMOTE_ADDR']) return FALSE;\n\t\t\t\tif ($data->$useragent !== $_SERVER['HTTP_USER_AGENT']) return FALSE;\n\t\t\t\tif ($data->$request_time !== $_SESSION['anmeldung']) return FALSE;\n\t\t\t\tif (($data->$livesign + 6000) <= $_SERVER['REQUEST_TIME']) return FALSE;\n\t\t\t}else{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t$query = \"UPDATE\n\t\t\t\t`\".USERS.\"`\n\t\t\t\tSET\n\t\t\t\t`\".LIVESIGN.\"` = NOW()\n\t\t\t\tWHERE\n\t\t\t\t`\".USER.\"` = '\".$user.\"'\n\t\t\t\tLIMIT 1\";\n\t\t\tif($this->sql->query($query)){\n\t\t\t\treturn TRUE;\n\t\t\t}else{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}", "public function is_student() {\n return $this->session->get(\"niveau_acces\") >= 0;\n }", "public function checkUsersSession(){\n\t}", "function revisar_usuario() {\n return isset($_SESSION['nombre']); //valida que exista un nombre en session\n}", "function is_authed() {\n\tif (isset($_SESSION['username'])) {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}", "public function isLogged(){\n return isset($_SESSION[\"user\"]);\n }", "public function verify_user_data()\n {\n\n if(isset($_SESSION['id']) AND $_SESSION['id'] == $_GET['id'])\n {\n\n $this->user_data_check = true;\n\n }else{\n\n $this->user_data_check = false;\n\n }\n\n return $this->user_data_check;\n\n }", "private function isLoggedin()\n\t{\n\t\t$this->idletime = 18000;\n\n\t\tif ((time()-$_SESSION['timestamp'])>$this->idletime)\n\t\t{\n\t\t\t$message = \"You are signed out from the previous session ! Please try sign in again!\";\n\t\t\t$this->logout($message);\n\t\t}\n\t\telseif($this->logged_in() == false)\n\t\t{\n\t\t\t$message = \"Invalid session !! Please try sign in again.\";\n\t\t\t$this->logout($message);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$_SESSION['timestamp'] = time();\n\t\t}\n\t}", "public function autenticar($senha){\n //if($senha == $this->senha){\n // return true;\n //} \n return $this->senha == $senha;\n }", "function loginController()\n {\n // SI la superglobal con el indice $_SESSION['email'] esta seteada\n if (isset($_SESSION[\"email\"])) {\n // Dame TRUE\n return true;\n } else {\n // O...\n if (isset($_COOKIE[\"email\"])) {\n // si la superglobal con el indice $_COOKIE['email']\n // esta seteada\n $_SESSION[\"email\"] = $_COOKIE[\"email\"];\n // Dame TRUE\n return true;\n } else {\n // Cualquier otra cosa, dame FALSE\n return false;\n }\n }\n }", "function check_login($dbProvider, $_login, $_motdepasse) {\n $sql = mysqli_query($dbProvider, \"SELECT * FROM utilisateursformulaires WHERE login='$_login'\");\n $infos = mysqli_fetch_array($sql);\n mysqli_close($dbProvider);\n $motdepasse_utilisateur = $infos['motdepasse'];\n $email = $infos['email'];\n $nom = $infos['nom'];\n $prenom = $infos['prenom'];\n $usertype = $infos['usertype'];\n $md5motdepasse = md5($_motdepasse);\n\n if ($md5motdepasse == $motdepasse_utilisateur) {\n session_start(); // on démarre une session\n $_SESSION[\"login_utilisateurformulaires\"] = $_login;\n $_SESSION[\"email_utilisateurformulaires\"] = $email;\n $_SESSION[\"nom_utilisateurformulaires\"] = $nom;\n $_SESSION[\"prenom_utilisateurformulaires\"] = $prenom;\n $_SESSION[\"usertype_utilisateurformulaires\"] = $usertype;\n\n return(true);\n } else {\n return(false);\n }\n}", "private function checkValidUser() {\n return;\n if(!($this->getData('key') == $this->sessionId && isset($_SESSION['user']) && isset($_SESSION['valid']) && $_SESSION['valid'] === true)) {\n $this->output = array(\n 'success' => false,\n 'key' => 'kMIvl'\n );\n\n // Terminate the call now, user isn't allowed to perform this action\n $this->renderOutput(true);\n }\n }", "function userAdmin(){\n\tif(userConnecte() && $_SESSION['membre']['statut'] == '1'){\n\t\treturn true;\n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "function registrarSesion () {\n\n if (!empty($this->id_usuario)) {\n $this->salvar(['ultima_session' => 'current_timestamp',\n 'activo' => 1\n ]);\n Helpers\\Sesion::sessionLogin();\n }\n else return false;\n\n }", "public function auth(){\n\t\tif( !isset($_SESSION) || !isset($_SESSION['userId']) ) {\n\t\t\treturn false;\n\t\t} elseif( !parent::fetchFromDB($_SESSION['userId']) ){\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn ( $this->checkIp() && $this->checkSessionId() );\n\t\t}\n\t}", "function auth(){\n\tif(@!$_SESSION['auth']){\n\t\treturn false;\n\t}else{\n\t\treturn true;\n\t}\n}", "private function verifySession()\n {\n if ((isset($this->session['id']))\n && (is_numeric($this->session['id']))\n && (isset($this->session['legit']))\n && ($this->session['legit'] === $this->sessionHash())\n ) {\n return true;\n }\n return false;\n }", "function is_auth()\r\n{\r\n if(!isset($_SESSION['user']))\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n}", "function userAdmin(){\n\tif(userConnecte() && $_SESSION['membre']['statut'] == 1){\n\t\treturn TRUE;\n\t}\n\telse{\n\t\treturn FALSE;\n\t}\n}", "function user_login_status() {\n $g = get_session('user_data');\n if (!empty($g)) {\n return true;\n }\n return false;\n}", "function fsl_gauth_check(){\n if ($_SESSION['glogin'] == 1)\n {\n return true;\n }\n else\n {\n return false;\n }\n}", "public function is_opu()\n {\n $session = $this->session->userdata('user');\n if($session)\n {\n if($session['role'] == 'OPU')\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }\n else\n {\n return FALSE;\n $this->log_out();\n }\n }", "private function isLoggedIn()\n {\n return isset($_SESSION['user']); \n }", "function is_logged_in(): bool\n{\n return App::$db->getRowWhere('users', [\n 'name' => $_SESSION['name'] ?? null,\n 'password' => $_SESSION['password'] ?? null\n ]) ? true : false;\n}", "function CheckSession(){\n if(isset($_SESSION[\"userSession\"]->id)){\n // VALIDA SI TIENE CREDENCIALES PARA LA URL CONSULTADA\n $_SESSION['userSession']->status= userSessionStatus::nocredencial;\n $_SESSION['userSession']->url = $_POST[\"url\"];\n $urlarr = explode('/', $_SESSION['userSession']->url);\n $myUrl = end($urlarr)==''?'index.html':end($urlarr);\n foreach ($_SESSION['userSession']->eventos as $evento) {\n if(strtolower($myUrl) == strtolower($evento->url)){\n $_SESSION['userSession']->status= userSessionStatus::login;\n break;\n }\n }\n }\n else {\n $this->status= userSessionStatus::invalido;\n $this->url = $_POST[\"url\"];\n $_SESSION[\"userSession\"]= $this;\n }\n }", "static function tokenGatekeeper() {\n $token = getInput(\"token\");\n $session_token = Cache::get(\"token\", \"session\");\n if ($token == $session_token) {\n return true;\n }\n return false;\n }", "function isLogin(){\n if (session('?user_id'))\n return true;\n else\n return false;\n}", "function logged_in(){\n\n // if the user loging session is active return true \n // otherwise the user needed to reenter the critentials\n if(isset( $_SESSION['email']) || isset($_COOKIE['email'])){\n\n return true ;\n\n }\n else\n {\n\n return false; \n }\n }", "function student_logged_in()\r\n{\r\n if (isset($_SESSION['student_id']) && !empty($_SESSION['student_id'])) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function check_auth_user(){\n global $_SESSION;\n if (isset($_SESSION['usu'])) {\n return true;\n } else {\n return false;\n }\n}", "function login_check() {\n\t$exp_time = $_SESSION[\"expires_by\"];\n\t\n\t//jika waktu sistem lebih kecil dari nilai waktu session\n\tif (time() < $exp_time) {\n\t\t//panggil fungsi dan tambah waktu session\n\t\tlogin_validate();\n\t\treturn true; \n\t}else{\n\t\t//jika waktu session lebih kecil dari waktu session atau lewat batas\n\t\t//maka akan dilakukan unset session\n\t\tunset($_SESSION[\"expires_by\"]);\n\t\treturn false; \n\t}\n}", "function guard() {\n\n\t$isValid = true;\n\t$inactive = 60*10; // 10 mins\n\t$fingerprint = md5( $_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT'] );\n\n\tif( ( isset( $_SESSION['fingerprint'] ) && $_SESSION['fingerprint'] != $fingerprint ) ) {\n\n\t\t$isValid = false;\n\t\tsignout();\n\n\t}else if ( ( isset( $_SESSION['last_active'] ) && ( time() - $_SESSION['last_active'] ) > $inactive ) && $_SESSION['username'] ) {\n\n\t\t$isValid = false;\n\t\tsignout();\n\n\t}else {\n\n\t\t$_SESSION['last_active'] = time();\n\n\t}\n\n\treturn $isValid;\n\n}", "public function hasSession() {}", "public function authorize()\n {\n $usuario = Auth::User();\n //se ele e master\n if($usuario->tipo_usuario_id!=8){\n return false; \n }\n return true;\n }", "function iniciar_sesion($id_user, $pass){\n\t\t\t//if ( no lo encontro )\n\t\t\t\t//return false;\n\t\t\t$_SESSION['id_usuario'] = $id_usuario;\n\t\t\t$_SESSION['tipo'] = $type;\n\t\t\t$_SESSION['usuario'] = $usuario;\n\t\t\treturn true;\n\t\t}", "function is_partner_login()\n{\n session_start();\n if (isset($_SESSION['partnerId']))\n return ($_SESSION['partnerId'] > 0);\n return false;\n}", "function isAuthed ()\r\n\t{\r\n\t\tif ((strlen($this->acUserAuth) > 0 ? $this->acUserAuth : 0) >= $this->acPageAuth)\r\n\t\t{\r\n\t\t\t$status = true;\r\n\t\t} else\r\n\t\t{\r\n\t\t\t$status = false;\r\n\t\t}\r\n\t\treturn $status;\r\n\t}", "function sessionExists() {\n\t\tif ((isset($_SESSION['valid_user'])) && (($_SESSION['valid_user']) != null)) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function login()\n{\n\n if (isset($_SESSION['webuser']) && $_SESSION['webuser'] != null) {\n \n return true;\n \n }\n \n return false;\n}", "public function is_login(){\n if (empty($this->user['userid'])){\n return false;\n }\n return true;\n }", "public function isLogged(){\r\n return isset($_SESSION['dbauth']);\r\n }", "function isLogged()\n\t{\n\t\t//проверяем наличие в куки данных\n\t\tif (array_key_exists('login_id', $_COOKIE) and is_string($_COOKIE['login_id']) //проверка на массив\n\t\t\tand\n\t\t\tarray_key_exists('token', $_COOKIE) and is_string($_COOKIE['token'])\n\t\t) {\n\t\t\t$loginID = (int)$_COOKIE['login_id'];\n\t\t\t$token = (string)$_COOKIE['token'];\n\t\t\t$loginMapper = new LoginMapper($this->pdo);\n\t\t\t//проверяем наличие id (серии) токена в бд\n\t\t\t$hash = $loginMapper->getHash($loginID);\n\t\t\t//делаем что-то только если хэш найден в базе\n\t\t\tif ($hash != false) {\n\t\t\t\t//если хэши из бд и куки совпали\n\t\t\t\tif (hash_equals($hash, hash('sha256', $token))) {\n\t\t\t\t\t//пользователь обладает нужными данными - он залогинен\n\t\t\t\t\t$this->islogged = true;\n\t\t\t\t} else {\n\t\t\t\t\t//пользователь дал нужный айди, но провалил проверку пароля => воровство\n\t\t\t\t\t$this->islogged = false;\n\t\t\t\t}\n\n\t\t\t} else $this->islogged = false;\n\n\t\t} else $this->islogged = false;\n\n\t\treturn $this->islogged;\n\t}", "function isUserRegistered()\r\n{\r\n $statusFlag = FALSE;\r\n \r\n // if user has previously registered, return true;\r\n if( isset($_COOKIE[\"user_email\"] ))\r\n $statusFlag = TRUE;\r\n\t \r\nreturn $statusFlag;\r\n\r\n}", "private function _loginPermitted ()\r\n {\r\n if(empty($_COOKIE[self::$_cookieCount])) {\r\n return true;\r\n }\r\n\r\n return $_COOKIE[self::$_cookieCount] < self::$_incercari;\r\n }", "function autenticado() {\t\n\tif(!isset( $_SESSION['autenticado'])) {\n\t\treturn false;\n\t} else {\n\t\treturn $_SESSION['autenticado'];\n\t}\n\t\n}", "function details(): bool {\n\t\t\t$cache_key = \"session[\".$this->id.\"]\";\n\n\t\t\t# Cached Customer Object, Yay!\n\t\t\t$cache = new \\Cache\\Item($GLOBALS['_CACHE_'],$cache_key);\n\t\t\tif ($cache->error()) app_log(\"Cache error in Site::Session::get(): \".$cache->error(),'error',__FILE__,__LINE__);\n\t\t\t\n\t\t\telseif (($this->id) and ($session = $cache->get())) {\n\t\t\t\tif ($session->code) {\n\t\t\t\t\t$this->code = $session->code;\n\t\t\t\t\t$this->company = new \\Company\\Company($session->company_id);\n\t\t\t\t\t$this->customer = new \\Register\\Customer($session->customer_id);\n\t\t\t\t\t$this->timezone = $session->timezone;\n\t\t\t\t\t$this->browser = $session->browser;\n\t\t\t\t\t$this->first_hit_date = $session->first_hit_date;\n\t\t\t\t\t$this->last_hit_date = $session->last_hit_date;\n\t\t\t\t\t$this->super_elevation_expires = $session->super_elevation_expires;\n\t\t\t\t\t$this->oauth2_state = $session->oauth2_state;\n if (isset($session->isMobile)) $this->isMobile = $session->isMobile;\n if (empty($session->csrfToken)) {\n $session->csrfToken = $this->generateCSRFToken();\n $cache->set($session,600);\n }\n\t\t\t\t\t$this->csrfToken = $session->csrfToken;\n\t\t\t\t\t$this->cached(true);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$get_session_query = \"\n\t\t\t\tSELECT\tid,\n\t\t\t\t\t\tcode,\n\t\t\t\t\t\tcompany_id,\n\t\t\t\t\t\tuser_id customer_id,\n\t\t\t\t\t\ttimezone,\n\t\t\t\t\t\tbrowser,\n\t\t\t\t\t\tfirst_hit_date,\n\t\t\t\t\t\tlast_hit_date,\n\t\t\t\t\t\tsuper_elevation_expires,\n\t\t\t\t\t\toauth2_state\n\t\t\t\tFROM\tsession_sessions\n\t\t\t\tWHERE\tid = ?\n\t\t\t\";\n\t\t\t$rs = $GLOBALS['_database']->Execute(\n\t\t\t\t$get_session_query,\n\t\t\t\tarray($this->id)\n\t\t\t);\n\t\t\tif (! $rs) {\n\t\t\t\t$this->SQLError($GLOBALS['_database']->ErrorMsg());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ($rs->RecordCount()) {\n\t\t\t\t$session = $rs->FetchNextObject(false);\n\t\t\t\tif (empty($session->customer_id)) $session->customer_id = 0;\n\n\t\t\t\t$this->code = $session->code;\n\t\t\t\t$this->company = new \\Company\\Company($session->company_id);\n\t\t\t\t$this->customer = new \\Register\\Customer($session->customer_id);\n\t\t\t\t$this->timezone = $session->timezone;\n\t\t\t\t$this->browser = $session->browser;\n\t\t\t\t$this->first_hit_date = $session->first_hit_date;\n\t\t\t\t$this->last_hit_date = $session->last_hit_date;\n\t\t\t\t$this->super_elevation_expires = $session->super_elevation_expires;\n\t\t\t\t$this->oauth2_state = $session->oauth2_state;\n\n require_once THIRD_PARTY.'/mobiledetect/mobiledetectlib/Mobile_Detect.php';\n $detect = new \\Mobile_Detect;\n\n if ($detect->isMobile())\n $this->isMobile = true;\n else\n $this->isMobile = false;\n\n\t\t\t\t$session->csrfToken = $this->generateCSRFToken();\n\t\t\t\t$this->csrfToken = $session->csrfToken;\n\n\t\t\t\tif ($session->id) $cache->set($session,600);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "public function sess_create()\n\t{\n\t\treturn ($this->session_valid()) ? parent::sess_create() : FALSE;\n\t}", "public function guest() {\n\t\t\t// If user has session, return false\n\t\t\tif ($this->session->has('user')) return false;\n\t\t\t// If user is Authed return fales\n\t\t\tif ($this->auth()) return false;\n\t\t\t// Else, return true\n\t\t\treturn true;\n\t\t}", "function isClient() {\n if (isset($_SESSION['role'])) {\n if ($_SESSION['role'] == \"client\") {\n return true;\n }\n }\n return false;\n}", "function login_check() {\n global $logvar;\n session_start();\n $obj = new Cryptography();\n\n if (isset($_SESSION[\"login_user\"])) {\n $de_log_var = $obj->decoding($_SESSION[\"login_user\"]);\n if ($de_log_var == $logvar) {\n\n return true;\n\n } else {\n\n return false;\n }\n\n } else {\n return false;\n\n }\n /*check for real user end*/\n}", "public function Save() {\n// \t$this->db->ExecuteQuery(self::SQL('update profile'), array($this['name'], $this['email'], $this['id']));\n \t\t$this->db->ExecuteQuery(self::SQL('update profile'), array($this['name'], $this['email'], $this['id']));\n\t $this->session->SetAuthenticatedUser($this->profile);\n \treturn $this->db->RowCount() === 1;\n \t}", "public function check() {\n return (isset($_SESSION['usuario']));\n }", "public function check_login(){\n\n\t\tsession_id() == '' ? session_start(): NULL;\n\n\t\tif($this->LOGGED_IN){//IF THE LOGIN OBJECT VAR IS SET\n\t\t\treturn true;\n\t\t\t}\n\t\telse{\n\n\t\t\tif(isset($_SESSION['userLgInfo']['USER_ID'])){//IF SESSION IS SET\n\t\t\t\t$this->LOGGED_IN = true;\n\t\t\t\t$this->USER_ID = $_SESSION['userLgInfo']['USER_ID'];\n\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\telse if(isset($_COOKIE['user'])){\n\t\t\t\t$key = Janitor::decrypt_data($_COOKIE['user'], Config::$ENCRYPT_KEY);\n\t\t\t\t$sql = \"SELECT u.`USER_EMAIL`, u.`USER_ID`, u.`USER_FIRST_NAME`, u.`USER_LAST_NAME`, u.`USER_KEY`, u.`USER_PERM` FROM `user_tbl` AS u WHERE u.`USER_KEY`= ?\"; $bind = array($key); $db = new SqlCore;\n\t\t\t\t$userArr = $db->query_array($sql, $bind);\n\n\t\t\t\tif($userArr==NULL){ return false; }\n\n\t\t\t\t//SET LOGIN VARS\n\t\t\t\t$_SESSION['userLgInfo'] = array('USER_EMAIL' => $userArr[0]['USER_EMAIL'], 'USER_ID' => Janitor::encrypt_data($userArr[0]['USER_ID'], Config::$ENCRYPT_KEY), 'USER_FULL_NAME' => $userArr[0]['USER_FIRST_NAME'].' '.$userArr[0]['USER_LAST_NAME'], 'USER_FIRST_NAME' => $userArr[0]['USER_FIRST_NAME'], 'USER_LAST_NAME' => $userArr[0]['USER_LAST_NAME'], 'USER_PERM' => Janitor::encrypt_data($userArr[0]['USER_PERM'], Config::$ENCRYPT_KEY));\n\t\t\t\t$this->LOGGED_IN = true;\n\t\t\t\t$this->USER_ID = $userArr[0]['USER_ID'];\n\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}" ]
[ "0.73094", "0.6850497", "0.68228626", "0.67080283", "0.6695858", "0.6688963", "0.66674346", "0.6645469", "0.66219664", "0.66040516", "0.65987355", "0.6590944", "0.6552787", "0.65414006", "0.6538014", "0.65355134", "0.6524765", "0.6507516", "0.65048313", "0.6487875", "0.64856946", "0.6466495", "0.6460249", "0.6459944", "0.6457184", "0.64559937", "0.6441", "0.64334214", "0.6427318", "0.64239025", "0.641987", "0.6410265", "0.6408791", "0.63971174", "0.63961124", "0.63840663", "0.6382337", "0.63799345", "0.6373143", "0.6369238", "0.6356257", "0.6351075", "0.6348757", "0.63470346", "0.63468355", "0.6338813", "0.6330729", "0.63294125", "0.63289356", "0.63259673", "0.63246304", "0.6323668", "0.63166934", "0.63127637", "0.63093925", "0.62982875", "0.62926006", "0.6292391", "0.6291803", "0.6286328", "0.6285837", "0.6274033", "0.62641066", "0.6254728", "0.6250225", "0.6249196", "0.62435764", "0.62425905", "0.624136", "0.62388104", "0.623723", "0.62345296", "0.6234136", "0.6225986", "0.6219257", "0.62184733", "0.62178767", "0.62146103", "0.6208678", "0.6207833", "0.62076604", "0.6207285", "0.6206358", "0.61989975", "0.61768335", "0.61740357", "0.6171783", "0.61701536", "0.61698675", "0.6167253", "0.6166594", "0.6165987", "0.6165966", "0.6165754", "0.61650074", "0.61603487", "0.6160279", "0.61601233", "0.61598736", "0.6153965", "0.6153917" ]
0.0
-1
Schrijft een student in bij een bepaalde sessie en gaat na of de gebruiker een surveillant is of niet.
function enroll($columnId, $userId, $isSurveillant=false) { $data = array( 'id'=>null, 'gebruikerId'=>$userId, 'planningKolomId'=>$columnId, 'surveillant'=>$isSurveillant, 'geselecteerd'=>0 ); $this->db->insert('aanwezigheid', $data); //$this->db }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_student() {\n return $this->session->get(\"niveau_acces\") >= 0;\n }", "function pobierz_studentow() {\n\t\t$baza = polacz_z_baza();\n\n\t\t$zapytanie = 'select * from studenci';\n\t\t$wynik = mysqli_query($baza, $zapytanie);\n\n\t\tzakoncz_polaczenie($baza);\n\n\t\treturn $wynik;\n\t}", "public function get_session_wise_student() {\n\t\t$checker = array(\n\t\t\t'session' => $this->active_session,\n\t\t\t'school_id' => $this->school_id\n\t\t);\n\t\treturn $this->db->get_where('enrols', $checker);\n\t}", "function updateStudentValidate(){\n\t\t\n\t\tif(@$this->institution == \"\" | @$this->identification == \"\" | @$this->passkey == \"\"){\n\t\t\t$respArray = $this->makeResponse(\"ERROR\", \"FAILED TO IDENTIFY USER BASED ON GIVEN CRITERIA!\", \"\");\n\t\t\techo $this->jsoncallback.\"(\".json_encode($respArray).\")\";\n\t\t\texit;\n\t\t}else{\n\t\t\t$this->basics->updateStudent($this->sanitize($this->nom), $this->sanitize($this->institution), $this->sanitize($this->major), $this->sanitize($this->minor), $this->sanitize($this->identification), $this->obsfucate->makePass($this->sanitize($this->passkey)), $this->sanitize($this->google), $this->sanitize($this->yahoo), $this->sanitize($this->live), $this->sanitize($this->facebook), $this->sanitize($this->linkedin), $this->sanitize($this->twitter), @$this->sanitize($this->department), @$this->sanitize($this->school), @$this->sanitize($this->country));\n\t\t}\n\t\n\t}", "public function isStudent(){\n\t\t// get user type\n\t\t$session_data = $this->session->userdata('logged_in'); // get userid from session\n\t\t\t\n\t\t// redirect to home if user is not a student\n\t\tif($session_data['usertype']!=0) redirect('/home');\n\t}", "public function post_student() {\n $params = array(\n 'ruid' => Input::get('ruid'), \n 'net_id'=> Input::get('net_id'),\n 'passwd'=> Hash::make(Input::get('passwd')), \n 'email_addr' => Input::get('email_addr'), \n 'grad_year' => Input::get('grad_year'), \n 'major' => Input::get('major'), \n 'credits' => Input::get('credits'), \n 'gpa' => Input::get('gpa')\n );\n \n $user = User::create(array('net_id' => $params['net_id'], 'passwd' => $params['passwd']));\n $user->save();\n\n $student = new Student;\n $student->fill($params);\n $student->save();\n\n Auth::login($user);\n\n return Redirect::to('account/studentedit');\n }", "public static function onlineStudent(){\n $students = Roll::join('admissions','admissions.id', '=' , 'rolls.student_id' )\n ->where(['username' => Session::get('studentSession')])->first();\n \n return $students;// we will join the student with admission okay to have all his/her data's\n }", "public function stuUserLogin() {\n\t\tif(isset($_POST['txtUName']) && isset($_POST['subDomain'])){\n\t\t\t$schl_query=\"select id from schools where code='\".trim($_POST['subDomain']).\"'\";\n\t\t\t$schl_query_res = mysqli_query($this->connfed, $schl_query);\n\t\t if(mysqli_num_rows($schl_query_res)>0){\n\t\t\t$school_data=mysqli_fetch_assoc($schl_query_res);\n\t\t\t$hash_salt_query=\"select u.id,hashed_password,salt,u.email,batch_id,b.course_id,b.start_date,b.end_date,u.username from users u left join students s on s.user_id = u.id left join batches b on b.id = s.batch_id where u.username='\".trim($_POST['txtUName']).\"' and u.school_id='\".$school_data['id'].\"' and u.admin!=1 and u.employee!=1 and u.student!=0\";\n\t\t\t$hash_salt_res = mysqli_query($this->connfed, $hash_salt_query);\n\t\t\tif(mysqli_num_rows($hash_salt_res)>0){\t\n\t\t\t \t$row=mysqli_fetch_assoc($hash_salt_res);\n\t\t\t\t$hash_pwd = $row['hashed_password'];\n\t\t\t\t$salt = $row['salt'];\n\t\t\t\t$pwd=$salt.$_POST['txtPwd'];\n\t\t\t\t$hash_new_pwd=hash('sha1',$pwd);\n\t\t\t\tif ($hash_pwd==$hash_new_pwd) {\n\t\t\t\t\t $_SESSION['std_id']=$row['id'];\n\t\t\t\t\t $_SESSION['username']=$row['username'];\n\t\t\t\t\t $_SESSION['user_email']=$row['email'];\n\t\t\t\t\t $_SESSION['batch_id']=$row['batch_id'];\n\t\t\t\t\t $_SESSION['start_date']= date(\"Y-m-d\",strtotime($row['start_date']));\n\t\t\t\t\t $_SESSION['end_date'] = date(\"Y-m-d\",strtotime($row['end_date']));\n\t\t\t\t\t $_SESSION['school_id']=$school_data['id'];\n\t\t\t\t\t $_SESSION['course_id']=$row['course_id'];\n\t\t\t\t\t return 1;\n\t\t\t\t}else{\n\t\t\t\t\t $message=\"Paasword does not matched.\";\n\t\t\t\t\t $_SESSION['error_msg'] = $message;\t\n\t\t\t\t\t return 0;\n\t\t\t\t}\n\t\t\t }else{\n\t\t\t \t\t$message=\"Incorrect Username or Password\";\n\t\t\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\t\t\treturn 0;\n\t\t\t }\n\t\t\t}else{\n\t\t\t\t$message=\"Incorrect Username or Password\";\n\t\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}", "public function Save()\r\n\t\t{\r\n\t\t\t$db = new Db();\r\n\t\t\t$sql = \"INSERT INTO tbl_users (naam, voornaam, email, wachtwoord)\r\n\t\t\tVALUES ('\".$db->conn->real_escape_string($this->m_sName).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sFirstname).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sEmail).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sPassword).\"'\r\n\t\t\t)\";\r\n\t\t\t$db->conn->query($sql);\r\n\r\n\t\t\t//user_id van de geregistreerde gebruiker in de session variabele opslaan\r\n\t\t\t$user_id = $db->conn->insert_id;\r\n\t\t\t$_SESSION['user_id'] = $user_id;\r\n\t\t}", "public function activation($cnestudent)\r\n {\r\n $req=$this->student->changeetat($cnestudent); // change the etat\r\n $this->students(); // show the update list of student\r\n }", "function userCanCreateOrReplaceStudent( $sessionID ) {\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "function verifystudent($studid,$classid){\n include('../../config.php'); \n $q = \"select * from studentsubject where studid=$studid and classid=$classid\";\n $r = mysql_query($q);\n if(mysql_num_rows($r) < 1){\n return true;\n }else{\n return false; \n }\n }", "function viewStudent( $sessionID, $studentID ) {\r\n\t\tif( $this->userCanViewStudent( $sessionID )){\r\n if(!empty($studentID)){\r\n\t\t\t $this->verifyStudent($studentID);\r\n\t\t\t $query=\"SELECT * FROM X_PNSY_STUDENT ss, students s WHERE ss.ID = '$studentID' AND ss.ID = s.StudentID\";\r\n\t\t\t $result = mysql_query($query);\r\n\t\t\t return mysql_fetch_assoc($result);\r\n }\r\n\t\t}\r\n\t}", "public function student()\n {\n if (session()->get('role')[0] != 'Student') {\n return redirect('/');\n }\n\n return view('home.student');\n }", "function check_if_student_logged(){\n\t\tglobal $url_home;\n\t\tglobal $current;\n\t\tif(!isset($_SESSION['id_korisnika']) && $current != \"login.php\" && $current != \"register.php\" && $current != \"reset.php\") header('Location: '.$url_home.'user/login.php');\n\t\telse if(isset($_SESSION['id_korisnika']) && ($current == \"login.php\" || $current == \"reset.php\" || $current == \"register.php\")) header('Location: '.$url_home.'user');\n\t}", "public function loginmedewerker($uname, $psw){\n\n $sql = \"SELECT medewerkerscode, gebruikersnaam, wachtwoord FROM medewerkers WHERE gebruikersnaam = :gebruikersnaam\";\n \n //prepare\n $stmt = $this->conn->prepare($sql);\n \n $stmt->execute([\n 'gebruikersnaam' => $uname\n ]);\n \n \n $result = $stmt->fetch(PDO::FETCH_ASSOC);\n print_r($result);\n \n if(is_array($result)){\n \n if(count($result) > 0){\n \n if ($uname == $result['gebruikersnaam'] && password_verify($psw, $result['wachtwoord'])) {\n \n session_start();\n $_SESSION['medewerkerscode'] = $result['id'];\n $_SESSION['uname'] = $result['gebruikersnaam'];\n \n header('location: medewerkers.php');\n \n }\n }else{\n echo 'Failed to login.';\n }\n \n }else{\n echo 'Failed to login. please check youre input and try again.';\n }\n \n }", "public function __construct($userName_or_arborId, $nameOnly = true) { \r\n if (isset($_SESSION['studentDetail'])) {\r\n Config::debug(\"Student::__construct: session detail found\");\r\n if ($_SESSION['studentDetail']['arborId'] == $userName_or_arborId ||\r\n (isset($_SESSION['studentDetail']['userName']) && $_SESSION['studentDetail']['userName'] == $userName_or_arborId)) {\r\n $this->detail = $_SESSION['studentDetail'];\r\n return;\r\n }\r\n Config::debug(\"Student::__construct: session detail found, but not matched\");\r\n }\r\n \r\n Config::debug(\"Student::__construct: no session detail found\");\r\n \r\n $this->client = new GraphQLClient();\r\n\r\n if (is_numeric($userName_or_arborId)) {\r\n $this->detail['arborId'] = $userName_or_arborId;\r\n } else {\r\n $this->detail['userName'] = $userName_or_arborId;\r\n /* Ugh, got to look up using email address */\r\n Config::debug(\"Student::__construct: looking for email\");\r\n $emailAddress = $userName_or_arborId . \"@\" . Config::$site_emaildomain;\r\n $emailQuery = \"{ EmailAddress (emailAddress: \\\"$emailAddress\\\") { emailAddressOwner { id }}}\";\r\n $emailAddress = $this->client->rawQuery($emailQuery)->getData()['EmailAddress'];\r\n Config::debug(\"Student::__construct: query complete\");\r\n if (!isset($emailAddress[0])) {\r\n die(\"Your email address \" . $userName_or_arborId . '@' . Config::$site_emaildomain .\" appears unrecognised.\");\r\n }\r\n if (isset($emailAddress[1])) {\r\n die(\"Your email address appears to have more than one owner. This cannot possibly be right\");\r\n }\r\n if ($emailAddress[0]['emailAddressOwner']['entityType'] != 'Student') {\r\n die(\"Your email address \" . $userName_or_arborId . '@' . Config::$site_emaildomain .\" appears not to belong to a student.\");\r\n }\r\n Config::debug(\"Student::__construct: email found\");\r\n $this->detail['arborId'] = $emailAddress[0]['emailAddressOwner']['id'];\r\n }\r\n $id = $this->detail['arborId'];\r\n $this->query = <<<EOF\r\nStudent (id: $id) {\r\n id\r\n preferredFirstName\r\n preferredLastName\r\n academicLevel {\r\n id\r\n shortName\r\n }\r\n}\r\nEOF;\r\n $queryForBehaviourPoints = false;\r\n if (!$nameOnly) {\r\n /* Before we query Arbor, let's see if we have them cached */\r\n if ($this->getBehaviourNetPointsFromCache() == false) {\r\n $queryForBehaviourPoints = true;\r\n if (empty(Config::$queryMyDshs)) {\r\n $ayEve = $this->getAY('eve');\r\n $ayPost = $this->getAY('post');\r\n $this->query .= <<<EOF\r\n BehaviouralIncidentStudentInvolvement (student__id: $id behaviouralIncident__incidentDatetime_before: \"$ayPost\" behaviouralIncident__incidentDatetime_after: \"$ayEve\") {\r\n severity\r\n student {\r\n academicLevel {\r\n shortName\r\n }\r\n }\r\n }\r\n PointAward (student__id: $id awardedDatetime_before: \"$ayPost\" awardedDatetime_after: \"$ayEve\") {\r\n points\r\n }\r\n EOF;\r\n }\r\n }\r\n }\r\n \r\n $this->query = \"query { $this->query }\";\r\n $result = $this->client->rawQuery($this->query)->getData();\r\n \r\n foreach (['preferredFirstName', 'preferredLastName'] as $n) {\r\n $this->detail[$n] = $result['Student'][0][$n];\r\n }\r\n $matches = [];\r\n if (preg_match('/[1-9][0-9]*|[0RKN]$/', $result['Student'][0]['academicLevel']['shortName'], $matches) == 0) {\r\n die(\"Student {$this->getFirstName()} {$this->getLastName()}'s year group {$result['Student'][0]['academicLevel']['shortName']} is invalid.\");\r\n }\r\n $this->detail['yearGroup'] = $matches[0];\r\n if ($queryForBehaviourPoints) {\r\n if (empty(Config::$queryMyDshs)) {\r\n $p = 0;\r\n foreach ($result['BehaviouralIncidentStudentInvolvement'] as $i) {\r\n $p += $i['severity'];\r\n }\r\n foreach ($result['PointAward'] as $i) {\r\n $p += $i['points'];\r\n }\r\n } else {\r\n $client = new \\GuzzleHttp\\Client(['base_uri' => Config::$queryMyDshs, 'timeout' => 1.0,]);\r\n $key = Config::$queryMyDshsApiKey;\r\n try {\r\n $response = $client->get(\"{$this->getId()}/praise-points/total\",\r\n ['headers' => [ 'Authorization' => \"Bearer $key\",],]\r\n );\r\n \r\n } catch (\\Exception $e) {\r\n die(\"There has been a problem communicating with MyDSHS.\");\r\n }\r\n $p = (string)$response->getBody();\r\n if (!is_numeric($p)) {\r\n echo \"<pre>\" . $response->getBody() . \"</pre>\";\r\n die(\"There has been a problem communicating with MyDSHS.\");\r\n }\r\n }\r\n $this->detail['behaviourNetPoints'] = $p;\r\n $this->db->dosql(\"INSERT INTO pointsCache (arbor_id, arborPoints) VALUES ('\"\r\n . $this->getId() . \"', '\"\r\n . $this->getBehaviourNetPoints() . \"');\");\r\n }\r\n if (isset ($_SESSION)) {\r\n $_SESSION['studentDetail'] = $this->detail;\r\n }\r\n }", "function student_logged_in()\r\n{\r\n if (isset($_SESSION['student_id']) && !empty($_SESSION['student_id'])) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "public function get_logged_in_student_details() {\n\t\t$user_id = $this->session->userdata('user_id');\n\t\t$student_data = $this->db->get_where('students', array('user_id' => $user_id))->row_array();\n\t\t$student_details = $this->get_student_details_by_id('student', $student_data['id']);\n\t\treturn $student_details;\n\t}", "public function accoutingByStudent($student_id){\n }", "public function get_student_id() {\n\t\t\treturn $this->student_id;\n\t\t}", "function addstudent(){\n include('../../config.php'); \n $classid = $_GET['classid'];\n $studid = $_GET['studid'];\n $verify = $this->verifystudent($studid,$classid);\n if($verify){\n echo $q = \"INSERT INTO studentsubject (studid,classid) VALUES ('$studid', '$classid');\";\n mysql_query($q);\n header('location:../classstudent.php?r=success&classid='.$classid.'');\n }else{\n header('location:../classstudent.php?r=duplicate&classid='.$classid.'');\n }\n \n $tmp = mysql_query(\"select * from class where id=$classid\");\n $tmp_row = mysql_fetch_array($tmp);\n $tmp_subject = $tmp_row['subject'];\n $tmp_class = $tmp_row['course'].' '.$tmp_row['year'].'-'.$tmp_row['section'];\n \n $tmp = mysql_query(\"select * from student where id=$studid\");\n $tmp_row = mysql_fetch_array($tmp);\n $tmp_student = $tmp_row['fname'].' '.$tmp_row['lname'];\n \n $act = \"add student $tmp_student to class $tmp_class with the subject of $tmp_subject\";\n $this->logs($act);\n }", "public function getStudentId()\n {\n return $this->studentId;\n }", "function watchStudent( $sessionID, $studentID ) {\r\n\t\tif( $this->userCanWatchStudent( $sessionID, $studentID ) && !( $this->userIsWatchingStudent( $sessionID, $studentID )) ) {\r\n\t\t\tif(empty($this->link)){\r\n\t\t\t\techo \"Not connected to database. Unexpected error. Contact your system administrator.\";\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t\t//$query = \"SELECT UsersWatching FROM students WHERE StudentID='$studentID'\";\r\n\t\t\t$user = $_SESSION['userid'];\r\n\t\t\t$query=\"insert into studentwatch (userid, studentid) values ('$user','$studentID')\";\r\n\t\t\tmysql_query($query);\r\n\t\t}\r\n\t}", "public function getIdStudent(){\n\t\treturn $this->idStudent;\n\t}", "function userCanGetStudentInterims( $studentID ) {\r\n\t\treturn $this->userCanViewStudent('');\r\n\t}", "public function login(Request $request){\n $vouter= Vouter::where('email', $request->email)\n ->where('password',$request->password)\n ->first();\n if($vouter){\n session()->forget('vouter');\n session()->forget('partie');\n\n session(['vouter' => $vouter]);\n $partie = $vouter->partie()->first();\n session(['partie' => $partie]);\n // recuperer la liste des surveys encours\n $surveyController = new SurveyController();\n $surveys = $surveyController->index();\n VouterController::surveys();\n if($surveys){\n session()->forget('surveys');\n session(['surveys' => $surveys]);\n }\n\n\n\n return redirect('profile');\n }\n else{\n return redirect('login');\n }\n\n }", "public function get_studentedit() {\n if(Auth::check()) {\n $student = Student::where('net_id', '=', Auth::user()->net_id)->first(); \n return View::make('account.student_edit')->with_student($student);\n \n }\n else\n return Redirect::to('/');\n }", "function languagelesson_get_students($courseid)\n{\n\tglobal $DB;\n\t\n\t// Pull the context value for input courseid.\n\t$context = context_course::instance($courseid);\n $allusers = get_enrolled_users($context, 'mod/languagelesson:submit', 0, 'u.id, u.firstname, u.lastname, u.email, u.picture');\n \n $getteachers = get_enrolled_users($context, 'mod/languagelesson:manage', 0, 'u.id');\n $getgraders = get_enrolled_users($context, 'mod/languagelesson:grade', 0, 'u.id');\n \n \n $teachers = array();\n \n foreach ($getteachers as $thisteacher) {\n $teachers[] = $thisteacher->id;\n }\n foreach ($getgraders as $thisgrader) {\n $teachers[] = $thisgrader->id;\n }\n sort($teachers);\n \n // Remove all of the teachers those with manage or grade capabilities from the list.\n foreach ($allusers as $oneuser) {\n foreach ($teachers as $teacherid) {\n if ($oneuser->id == $teacherid) {\n unset($allusers[$oneuser->id]);\n }\n }\n } \n\treturn $allusers;\n}", "function add_survey_group_susi_student() {\r\n // get global user object\r\n global $user;\r\n\r\n // protect from unauthorized access\r\n if (!isset($user) or ! isset($_POST['formSurveyAddGroupSusiStudentSubmit']) or ! isset($_POST['formSurveyAddGroupSusiStudent'])) {\r\n if ($_POST['formSurveyAddGroupSusiStudent'] != 'formSurveyAddGroupSusiStudentGroup') {\r\n logout();\r\n die();\r\n }\r\n }\r\n\r\n $session_groups = unserialize($_SESSION['session_groups']);\r\n if ($_POST['formSurveyAddGroupSusiStudentGroup'][0] == '0') {\r\n $session_groups['student'] = get_susi_student_groups();\r\n } else {\r\n $session_groups['student'] = $_POST['formSurveyAddGroupSusiStudentGroup'];\r\n }\r\n\r\n $session_groups['type'] = '';\r\n\r\n $_SESSION['session_groups'] = serialize($session_groups);\r\n\r\n $cookie_key = 'msg';\r\n $cookie_value = 'Вие добавихте анкетната група студенти!';\r\n setcookie($cookie_key, $cookie_value, time() + 1);\r\n header('Location: ' . ROOT_DIR . '?page=survey_edit');\r\n}", "public function register_student(Student $student): string {\n $cookie = SecurityUtil::generate_token();\n\n $stmt = $this->db->prepare('INSERT INTO students(forename, surname, email, group_id, exam_results, birth_year, is_foreign, gender, cookie) VALUES (?,?,?,?,?,?,?,?,?)');\n $stmt->execute(array(strval($student->forename),\n strval($student->surname),\n strval($student->email),\n strval($student->group_id),\n intval($student->exam_results),\n intval($student->birth_year),\n intval($student->is_foreign),\n intval($student->gender),\n $cookie));\n $stmt->closeCursor();\n return $cookie;\n }", "function show_student( $bim, $userid, $cm, $course) {\n bim_print_header( $cm, $bim, $course, \"student\");\n\n $bimid = $bim->id;\n // if there isn't a feed registered, show the register form\n if ( ! bim_feed_exists( $bimid, $userid ) ) {\n // need to check for passing in of parameters\n show_register_feed( $bim, $userid, $cm );\n return;\n } else {\n $screen = optional_param( 'screen', '', PARAM_ALPHA );\n if ( $screen == \"showQuestions\" ) { \n bim_show_questions( $cm, $bim );\n } else {\n add_to_log( $course->id, \"bim\", \"view details\", \"view.php?id=$cm->id\",\n \"\", $cm->id );\n show_student_details( $bim, $userid, $cm );\n }\n }\n\n print_footer( $course );\n}", "function teacher_logged_in()\r\n{\r\n\r\n if (isset($_SESSION['SSN']) && !empty($_SESSION['SSN'])) {\r\n\r\n\r\n return true;\r\n } else {\r\n\r\n return false;\r\n }\r\n\r\n\r\n}", "function superRecuiterLogin()\n\t{\n\t\t$username = $_POST['user_email'];\n\t\t$password = md5($_POST['password']);\n\t\t$login=$this->db->query(\"select * from `supper_recruiter` where `email`='$username' and `password`='$password' AND `status`='1' \");\n\t\t$rowcount=$login->rowCount($login); \n\t\t$singlRc=$login->fetchAll();\t\t \n\t\tif($rowcount>0)\n\t\t{\n\t\t$fetch_singel=$singlRc[0]; \n\t\t$encripted = base64_encode($fetch_singel['id']);\n echo \"\n <script type=\\\"text/javascript\\\"> \n\t\t window.location='super-recruiter?srid=$encripted';\n </script>\n \";\t\t\n\t\t}\n\t\telse\n\t\treturn \"<span style='color:red;font-size: 16px;font-weight:600'>User ID or Password is Incorrect</span>\";\t\t\n\t}", "public function getIdStudent()\n {\n return $this->id_student;\n }", "public function get_student_list_of_logged_in_parent() {\n\t\t$parent_id = $this->session->userdata('user_id');\n\t\t$parent_data = $this->db->get_where('parents', array('user_id' => $parent_id))->row_array();\n\t\t$checker = array(\n\t\t\t'parent_id' => $parent_data['id'],\n\t\t\t'session' => $this->active_session,\n\t\t\t'school_id' => $this->school_id\n\t\t);\n\t\t$students = $this->db->get_where('students', $checker)->result_array();\n\t\tforeach ($students as $key => $student) {\n\t\t\t$checker = array(\n\t\t\t\t'student_id' => $student['id'],\n\t\t\t\t'session' => $this->active_session,\n\t\t\t\t'school_id' => $this->school_id\n\t\t\t);\n\t\t\t$enrol_data = $this->db->get_where('enrols', $checker)->row_array();\n\n\t\t\t$user_details = $this->db->get_where('users', array('id' => $student['user_id']))->row_array();\n\t\t\t$students[$key]['student_id'] = $student['id'];\n\t\t\t$students[$key]['name'] = $user_details['name'];\n\t\t\t$students[$key]['email'] = $user_details['email'];\n\t\t\t$students[$key]['role'] = $user_details['role'];\n\t\t\t$students[$key]['address'] = $user_details['address'];\n\t\t\t$students[$key]['phone'] = $user_details['phone'];\n\t\t\t$students[$key]['birthday'] = $user_details['birthday'];\n\t\t\t$students[$key]['gender'] = $user_details['gender'];\n\t\t\t$students[$key]['blood_group'] = $user_details['blood_group'];\n\t\t\t$students[$key]['class_id'] = $enrol_data['class_id'];\n\t\t\t$students[$key]['section_id'] = $enrol_data['section_id'];\n\n\t\t\t$class_details = $this->crud_model->get_class_details_by_id($enrol_data['class_id'])->row_array();\n\t\t\t$section_details = $this->crud_model->get_section_details_by_id('section', $enrol_data['section_id'])->row_array();\n\n\t\t\t$students[$key]['class_name'] = $class_details['name'];\n\t\t\t$students[$key]['section_name'] = $section_details['name'];\n\t\t}\n\t\treturn $students;\n\t}", "public function autenticar($senha){\n //if($senha == $this->senha){\n // return true;\n //} \n return $this->senha == $senha;\n }", "public function profielInzienStudent(\\WebGuy $I) {\n\t\t$I->amOnPage('/login');\n\t\t$I->see('Uren');\n\t\t$I->fillField('Username', 'student');\n\t\t$I->fillField('Password', 'student');\n\t\t$I->click('Login');\n\t\t$I->amOnPage('/student/1');\n\t\t$I->see('Student Page');\n\t\t$I->wantTo('Profiel Inzien');\n\t\t$I->click('Profiel');\n\t\t$I->amOnPage('/student/1/profiel');\n\t\t$I->see('student');\n\t\t$I->see('I12R');\n\t}", "function attendance_can_student_mark($sess, $log = true) {\n global $DB, $USER, $OUTPUT;\n $canmark = false;\n $reason = 'closed';\n $attconfig = get_config('attendance');\n\n if (!empty($attconfig->studentscanmark) && !empty($sess->studentscanmark)) {\n if (empty($attconfig->studentscanmarksessiontime) ||\n (attendance_is_status_availablebeforesession($sess->id)) && time() < $sess->sessdate) {\n $canmark = true;\n $reason = '';\n } else {\n $duration = $sess->duration;\n if (empty($duration)) {\n $duration = $attconfig->studentscanmarksessiontimeend * 60;\n }\n if (!isset($sess->studentsearlyopentime)) {\n // Sanity check just in case not set in this session.\n $sess->studentsearlyopentime = 0;\n }\n if (($sess->sessdate - $sess->studentsearlyopentime) < time() && time() < ($sess->sessdate + $duration)) {\n $canmark = true;\n $reason = '';\n }\n }\n }\n // Check if another student has marked attendance from this IP address recently.\n if ($canmark && !empty($sess->preventsharedip)) {\n if ($sess->preventsharedip == ATTENDANCE_SHAREDIP_MINUTES) {\n $time = time() - ($sess->preventsharediptime * 60);\n $sql = 'sessionid = ? AND studentid <> ? AND timetaken > ? AND ipaddress = ?';\n $params = array($sess->id, $USER->id, $time, getremoteaddr());\n $record = $DB->get_record_select('attendance_log', $sql, $params);\n } else {\n // Assume ATTENDANCE_SHAREDIP_FORCED.\n $sql = 'sessionid = ? AND studentid <> ? AND ipaddress = ?';\n $params = array($sess->id, $USER->id, getremoteaddr());\n $record = $DB->get_record_select('attendance_log', $sql, $params);\n }\n\n if (!empty($record)) {\n $canmark = false;\n $reason = 'preventsharederror';\n if ($log) {\n // Trigger an ip_shared event.\n $attendanceid = $DB->get_field('attendance_sessions', 'attendanceid', array('id' => $record->sessionid));\n $cm = get_coursemodule_from_instance('attendance', $attendanceid);\n $event = \\mod_attendance\\event\\session_ip_shared::create(array(\n 'objectid' => 0,\n 'context' => \\context_module::instance($cm->id),\n 'other' => array(\n 'sessionid' => $record->sessionid,\n 'otheruser' => $record->studentid\n )\n ));\n\n $event->trigger();\n }\n }\n }\n return array($canmark, $reason);\n}", "public function klantLogin($email, $wachtwoord) {\n $conn = $this->connect();\n // SQL Query voorbereiden en variabelen binden aan de query\n $stmt = $conn->prepare(\"SELECT * FROM klant WHERE email = :email AND wachtwoord = :wachtwoord\");\n $stmt->bindParam(':email', $email);\n $stmt->bindParam(':wachtwoord', $wachtwoord);\n // als query is gelukt, gegevens ophalen en terugsturen, anders false terugsturen\n if ($stmt->execute()) {\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\n $_SESSION['klant_id'] = $result['id_klant'];\n $_SESSION['klant_voornaam'] = $result['voornaam'];\n $_SESSION['klant_achternaam'] = $result['achternaam'];\n $_SESSION['klant_email'] = $result['email'];\n $_SESSION['klant_adres'] = $result['adres'];\n $_SESSION['klant_postcode'] = $result['postcode'];\n $_SESSION['klant_woonplaats'] = $result['woonplaats'];\n return true;\n } else {\n return false;\n }\n }", "function userCanViewStudent( $sessionID ){\r\n\t\treturn $this->getAccessLevel() > 3;\r\n\t}", "function userIsWatchingStudent( $sessionID, $studentID ) {\r\n\t\tif(empty($this->link)){\r\n\t\t\techo \"Not connected to database. Unexpected error. Contact your system administrator.\";\r\n\t\t\texit;\t\r\n\t\t}\r\n\t\t$user = $_SESSION['userid'];\r\n\t\t$query = \"SELECT studentid FROM studentwatch where userid='$user' and studentid='$studentID'\";\r\n\t\t$result = mysql_query($query);\r\n\t\treturn mysql_num_rows($result) > 0;\r\n\t}", "function schoolInfo(Request $request){\n $data = $request->all();\n $request->session()->put('uniChat_id', $data['id']);\n return 'La sesion se ha guardado correctamente';\n }", "public function sessionStudent(Request $request)\n {\n $students = Course_student::where([\n 'course_id'=>$request->courseId,'session_id'=>$request->sessionId\n ])->with(['student.user','student.enrollments.course'])->latest()->get();\n return response()->json([\n 'status'=>'success',\n 'message'=>'data retrieved successfully',\n 'data'=>$students\n ], Response::HTTP_OK);\n }", "function _genLogin()\n {\n $this->mismatch = false;\n if (isset($_POST['login']) && $this->_verify() == \"\") {\n $this->name_post = $_POST['gebruikersnaam'];\n $this->pass_post = $_POST['wachtwoord'];\n\n $this->_getFromGebruikersDb($this->name_post);\n if ($this->_isMatch()) {\n $_SESSION['ingelogd'] = true;\n //toegevoegd door rens om een gebruikersnaam en rol te krijgen\n $_SESSION['gebruikersnaam'] = $this->name_post;\n $_SESSION['Rol'] = $this->role_db;\n header('location: Login_Redir.php');\n }\n }\n }", "public function autenticar($usr,$pwd) {\n $pwd=\"'\".$pwd.\"'\";\n $sql= 'SELECT * FROM empleados WHERE (\"idEmpleado\" = '.$usr.') AND (dni = '.$pwd.');';\n $empleado=\"\";\n $result = pg_query($sql);\n\n if ($result){\n $registro = pg_fetch_object($result);\n $empleado = $registro->nombres . \" \" . $registro->apellido;\n session_start(); //una vez que se que la persona que se quiere loguear es alguien autorizado inicio la sesion\n //cargo en la variable de sesion los datos de la persona que se loguea\n $_SESSION[\"idEmpleado\"]=$registro->idEmpleado;\n $_SESSION[\"dni\"]=$registro->dni;\n $_SESSION[\"fechaInicio\"]=$registro->fechaInicio;\n $_SESSION[\"nombres\"]=$registro->nombres;\n $_SESSION[\"apellido\"]=$registro->apellido;\n $_SESSION[\"i_lav\"]=$registro->i_lav;\n $_SESSION[\"f_lav\"]=$registro->f_lav;\n $_SESSION[\"i_s\"]=$registro->i_s;\n $_SESSION[\"f_s\"]=$registro->f_s;\n $_SESSION[\"i_d\"]=$registro->i_d;\n $_SESSION[\"f_d\"]=$registro->f_d;\n //$_SESSION[\"iex_lav\"]=$registro->iex_lav;\n //$_SESSION[\"fex_lav\"]=$registro->fex_lav;\n }\n return $empleado;\n }", "public function acceptStudent(User $user)\n {\n if ($user->file_paid_voucher) {\n \n $forums = Forum::where('course_id', '=', $user->course_id)->get();\n $user->forums()->attach($forums);\n $course=$user->course;\n $modules=$course->modules;\n\n foreach ($modules as $module) {\n $subModules=$module->subModules;\n foreach ($subModules as $subModule) {\n $topics=$subModule->topics;\n foreach ($topics as $topic) {\n $user->activities()->attach($topic->activities);\n }\n }\n }\n\n if ($user->syncRoles(['student'])) {\n Mail::to($user->email)->queue(new InscriptionSuccess($user));\n }\n\n return redirect(route('authenticated.index'))\n ->with('success', 'Se acepto al usuario correctamente');\n }\n\n return redirect(route('profile.show', $user->id))\n ->with('warning', '¡¡¡ALERTA!!!......no se encontro el PAGO en la base de datos. Favor de revizar los datos del usuario para poder registrarlo como alumno en el diplomado');\n }", "public function isStudent()\n\t{\n\t\treturn $this->isUser() && $this->user->getIsStudent();\n\t}", "function students_class($data){\n global $current_user;\n \n $active = (if_logged_in(''))?1:'new';\n\n\n $age = date('Y') - $data['birthDate']; \n\n\n\n if($age > 75 ){\n die('Fadlan sanadka dhalashada iska hubi. ');\n }else if($age < 15 ) {\n die('Fadlan sanadka dhalashada iska hubi. ');\n }else{\n $data['birthDate'] = $data['birthDate'].'-09-10';\n }\n\n if(ctype_digit($data['full_name'])){\n die(\"fadlan iskafiiri magaca \");\n}\n\n\n /*if(strlen($data['mobile']) != 10 ){\n die('Fadlan talefoonka iska hubi number ka oo dhamaystiran qor. hana kudarin +252 ');\n }else if(empty($data['mobile'])){\n die('Fadlan talefoonka iska hubi number ka oo dhamaystiran qor. hana kudarin +252 ');\n }\n*/\n\n if(check_token($data['crf_code'],'check')){\n $data = clean_security($data);\n \n if (!empty($data['id'])) {\n // update \n mysqli_query_(\"UPDATE `students` set birthDate='{$data['birthDate']}', full_name='{$data['full_name']}', address='{$data['address']}', mobile='{$data['mobile']}',course='{$data['course']}' where id={$data['id']}\"); \n return 'ok'; \n\n }else{\n\n mysqli_query_(\"INSERT INTO `students`(`r_date`,`active`, `birthDate`, `full_name`,`mobile`, `address`, `course`) VALUES('\".date('Y-m-d').\"','$active','{$data['birthDate']}','{$data['full_name']}','{$data['mobile']}','{$data['address']}','{$data['course']}')\");\n } \n \n // remove_crf\n check_token($data['crf_code'],''); \n\n return 'ok'; \n \n }else{\n return 'login';\n }\n}", "public function single_student_create(){\n\t\t$user_data['name'] = html_escape($this->input->post('name'));\n\t\t$user_data['email'] = html_escape($this->input->post('email'));\n\t\t$user_data['password'] = sha1(html_escape($this->input->post('password')));\n\t\t$user_data['birthday'] = strtotime(html_escape($this->input->post('birthday')));\n\t\t$user_data['gender'] = html_escape($this->input->post('gender'));\n\t\t$user_data['blood_group'] = html_escape($this->input->post('blood_group'));\n\t\t$user_data['address'] = html_escape($this->input->post('address'));\n\t\t$user_data['phone'] = html_escape($this->input->post('phone'));\n\t\t$user_data['role'] = 'student';\n\t\t$user_data['school_id'] = $this->school_id;\n\t\t$user_data['watch_history'] = '[]';\n\n\t\t// check email duplication\n\t\t$duplication_status = $this->check_duplication('on_create', $user_data['email']);\n\t\tif($duplication_status){\n\t\t\t$this->db->insert('users', $user_data);\n\t\t\t$user_id = $this->db->insert_id();\n\n\t\t\t$student_data['code'] = student_code();\n\t\t\t$student_data['user_id'] = $user_id;\n\t\t\t$student_data['parent_id'] = html_escape($this->input->post('parent_id'));\n\t\t\t$student_data['session'] = $this->active_session;\n\t\t\t$student_data['school_id'] = $this->school_id;\n\t\t\t$this->db->insert('students', $student_data);\n\t\t\t$student_id = $this->db->insert_id();\n\n\t\t\t$enroll_data['student_id'] = $student_id;\n\t\t\t$enroll_data['class_id'] = html_escape($this->input->post('class_id'));\n\t\t\t$enroll_data['section_id'] = html_escape($this->input->post('section_id'));\n\t\t\t$enroll_data['session'] = $this->active_session;\n\t\t\t$enroll_data['school_id'] = $this->school_id;\n\t\t\t$this->db->insert('enrols', $enroll_data);\n\n\t\t\tmove_uploaded_file($_FILES['student_image']['tmp_name'], 'uploads/users/'.$user_id.'.jpg');\n\n\t\t\t$response = array(\n\t\t\t\t'status' => true,\n\t\t\t\t'notification' => get_phrase('student_added_successfully')\n\t\t\t);\n\t\t}else{\n\t\t\t$response = array(\n\t\t\t\t'status' => false,\n\t\t\t\t'notification' => get_phrase('sorry_this_email_has_been_taken')\n\t\t\t);\n\t\t}\n\n\t\treturn json_encode($response);\n\t}", "public function studentList()\n {\n return output($this->UserDetails->where([\"roleId\"=>$this->getUserRoleId()])->read(),'success','SM001');\n }", "function attendance_session_open_for_students($sess) {\n $sessionopens = empty($sess->studentsearlyopentime) ? $sess->sessdate : $sess->sessdate - $sess->studentsearlyopentime;\n if (time() > $sessionopens) {\n return true;\n } else {\n return false;\n }\n}", "function subRecuiterLogin()\n\t{\n\t\t$username = $_POST['user_email'];\n\t\t$password = md5($_POST['password']);\n\t\t$login=$this->db->query(\"select * from `sub_recruiter` where `email`='$username' and `password`='$password' AND `status`='1' \");\n\t\t$rowcount=$login->rowCount($login); \n\t\t$singlRc=$login->fetchAll();\t\t \n\t\tif($rowcount>0)\n\t\t{\n\t\t$fetch_singel=$singlRc[0]; \n\t\t$encripted = base64_encode($fetch_singel['id']);\n echo \"\n <script type=\\\"text/javascript\\\"> \n\t\t window.location='sub-recruiter-dashboard?subrid=$encripted';\n </script>\n \";\t\t\n\t\t}\n\t\telse\n\t\treturn \"<span style='color:red;font-size: 16px;font-weight:600'>User ID or Password is Incorrect</span>\";\t\t\n\t}", "public function getStNo(){\n return $this->student_no;\n }", "public function sessie_opslaan()\n\n\t{\n $this->load->model('sessie_model');\n\n $date= $this->input->post('datumid');\n $jaargang= $this->input->post('jaargang');\n $voorstellen= $this->input->post('voorstel');\n $lokalen= $this->input->post('lokaal');\n $tabelids= $this->input->post('tabelid');\n $sessieids = $this->input->post('sessieid');\n for($tr=0;$tr<=15;$tr++){\n if ($date==0) {\n redirect('planning/toonMeldingVulDatumIn');\n }elseif($lokalen[$tr]==0 &&$voorstellen[$tr]!=0){\n redirect('planning/toonMeldingGeenLokaal');\n }elseif($lokalen[$tr]!=0 &&$voorstellen[$tr]==0){\n redirect('planning/toonMeldingGeenVoorstel');\n }elseif($lokalen[$tr]!=0 && $voorstellen[$tr]!=0){\n if ($sessieids[$tr]==0) {\n $sessie = new stdClass();\n $sessie->datum = $date;\n $sessie->lokaalid = $lokalen[$tr];\n $sessie->voorstelid = $voorstellen[$tr];\n $sessie->jaargangid = $jaargang;\n $sessie->tabelid = $tabelids[$tr];\n $this->sessie_model->wijzig($sessie); \n }else{\n $sessie = new stdClass();\n $sessie->datum = $date;\n $sessie->lokaalid = $lokalen[$tr];\n $sessie->voorstelid = $voorstellen[$tr];\n $sessie->jaargangid = $jaargang;\n $sessie->tabelid = $tabelids[$tr];\n $sessie->id = $sessieids[$tr];\n $this->sessie_model->update($sessie);}\n }elseif($lokalen[$tr]==0 && $voorstellen[$tr]==0 && $sessieids[$tr]!=0){\n $sessie = new stdClass();\n $sessie->id = $sessieids[$tr];\n $this->sessie_model->delete($sessie);\n }\n \n \n \n }\n \n redirect('planning/planningOpgeslagen');\n \n \n\t}", "function doLogin() {\n $conn = getDBConnection();\n $FLAG = false;\n\n //sql query\n $sql = \"SELECT * FROM users WHERE username = '\" . $_POST['username'] . \"' AND password = PASSWORD('\" . $_POST['password'] . \"')\";\n\n //echo $sql;\n $result = mysqli_query($conn, $sql);\n if (mysqli_num_rows($result) > 0) {\n // output data of each row\n\n while ($row = mysqli_fetch_assoc($result)) {\n //create assos array and add the result data\n //$userArray = array('fname' => $row['firstname'],'lname'=>$row['lastname']); \n $_SESSION['ssn_user'] = $row;\n\n //if student get student details\n if ($row['role_code'] == 'STUDENT') {\n $sql = \"SELECT * FROM student WHERE username = '\" . $row['username'] . \"'\";\n $result_student = getData($sql);\n while ($row = mysqli_fetch_assoc($result_student)){\n $_SESSION['ssn_student'] = $row;\n }\n }\n //if student get lecturer details\n if ($row['role_code'] == 'LECTURE') {\n $sql = \"SELECT * FROM lecture WHERE username = '\" . $row['username'] . \"'\";\n $result_lecturer = getData($sql);\n while ($row = mysqli_fetch_assoc($result_lecturer)){\n $_SESSION['ssn_lecturer'] = $row;\n }\n }\n }\n\n $FLAG = TRUE;\n } else {\n \n }\n\n\n mysqli_close($conn);\n return $FLAG;\n}", "function nb_get_student_meta(){\n\tglobal $current_user;\n\n\tif( $current_user->ID != null){\n\t\t$sid = $current_user->ID;\n\t\t$student = get_userdata($sid); \n\n\t}\n\t\n\treturn $student;\n\n}", "public function dodajNastavnika($enc_password,$skola){\n\t\t\t$data = array(\n\t\t\t\t'name' => $this->input->post('name'),\n\t\t\t\t'surname' => $this->input->post('surname'),\n\t\t\t\t'email' => $this->input->post('email'),\n\t\t\t\t'username' => $this->input->post('username'),\n\t\t\t\t'password' => $enc_password\n\t\t\t);\n\t\t\t$this->db->insert('users', $data);\n\t\t\t\n\t\t\t$this->db->where('username', $this->input->post('username'));\n\t\t\t$this->db->where('password', $enc_password);\n\t\t\t$result = $this->db->get('users');\n\t\t\t$id = $result->row(0)->id;\n\t\t\t$this->dodajNastavnikaId($id,$skola);\n\t\t\t\n\t\t\treturn $id;\n\t\t}", "public function semesterregi(){\n\t\t$suid=$this->session->userdata('id_user');\n\t\t//print_r($suid);\n\t\t$Stuid=$this->commodel->get_listspfic1(\"student_master\",\"sm_id\",\"sm_userid\",$suid)->sm_id;\n\t\t//print_r($Stuid);\n \t//get current academic year\n \t//$acadyear = $this->user_model->getcurrentAcadYear();\n\t\t$this->appno = $this->commodel->get_listspfic1('student_entry_exit','senex_entexamapplicationno','senex_smid',$Stuid)->senex_entexamapplicationno;\n\t\t$stud_prg_rec = $this->commodel->get_listrow('student_program','sp_smid',$Stuid);\n \t$degree_id = $stud_prg_rec->row()->sp_programid;\n \t$noofsemester = sizeof($stud_prg_rec->result());\n\t\t\n\t\t$cacadyer = $this->user_model->getcurrentAcadYear();\n\t\t//print_r($cacadyer);\n \t$semestertype = $this->user_model->getcurrentSemester();\n \t//print_r($semestertype);\n \t$semesterrec = $this->stumodel->get_semester_no($Stuid,$cacadyer);\n \t$semsize = sizeof($semesterrec);\n\t\t$this->curresem = $semsize;\n\t\t//print_r($semsize);\n\t\t\n \t\n\t\t\n\t\t//student personnel detail\n\t\t$this->name=$this->commodel->get_listspfic1(\"student_master\",\"sm_fname\",\"sm_userid\",$suid)->sm_fname;\n\t\t$this->sturollno = $this->commodel->get_listspfic1('student_entry_exit','senex_rollno','senex_smid',$Stuid)->senex_rollno;\n\t\t$this->mobile=$this->commodel->get_listspfic1('student_master','sm_mobile','sm_id',$Stuid)->sm_mobile;\n\t\t$this->email=$this->commodel->get_listspfic1('student_master','sm_email','sm_id',$Stuid)->sm_email;\n\t\t$this->dob=$this->commodel->get_listspfic1('student_master','sm_dob','sm_id',$Stuid)->sm_dob;\n\t\t$this->uid=$this->commodel->get_listspfic1('student_master','sm_uid','sm_id',$Stuid)->sm_uid;\n\t\t$this->bgroup=$this->commodel->get_listspfic1('student_master','sm_bloodgroup','sm_id',$Stuid)->sm_bloodgroup;\n\t\t$this->gender=$this->commodel->get_listspfic1('student_master','sm_gender','sm_id',$Stuid)->sm_gender;\n\t\t$this->religname=$this->commodel->get_listspfic1('student_master','sm_religion','sm_id',$Stuid)->sm_religion;\n\n\t\t//student parent and course detail\n\t\t$this->mname = $this->commodel->get_listspfic1('student_parent','spar_mothername','spar_smid',$Stuid)->spar_mothername;\t\t\n\t\t$this->fathname=$this->commodel->get_listspfic1('student_parent','spar_fathername','spar_smid',$Stuid)->spar_fathername;\n\t\t\n\t\t$this->sem = $this->commodel->get_listspfic1('student_program','sp_semester','sp_smid',$Stuid)->sp_semester;\n\t\t\n\t\t$this->ncid = $this->commodel->get_listspfic1('student_program','sp_programid','sp_smid',$Stuid)->sp_programid;\n\t\t//get programe name\n\t\t$this->pname = $this->commodel->get_listspfic1('program','prg_name','prg_id',$this->ncid)->prg_name;\n\t\t$this->progid = $this->commodel->get_listspfic1('program','prg_id','prg_name',$this->pname)->prg_id;\n\t\t\n\t\t//get program category name\n\t\t$this->pcatid = $this->commodel->get_listspfic1('student_program','sp_pcategory','sp_smid',$Stuid)->sp_pcategory;\n\t\t$this->pcatname = $this->commodel->get_listspfic1('programcategory','prgcat_name','prgcat_id',$this->pcatid)->prgcat_name;\n\n\t\t//postal address detail\n\t\t$this->padd=$this->commodel->get_listspfic1('student_parent','spar_caddress','spar_smid',$Stuid)->spar_caddress;\n\t\t$this->pcity=$this->commodel->get_listspfic1('student_parent','spar_ccity','spar_smid',$Stuid)->spar_ccity;\n\t\t$this->ppost=$this->commodel->get_listspfic1('student_parent','spar_cpostoffice','spar_smid',$Stuid)->spar_cpostoffice;\n\t\t$this->pdist=$this->commodel->get_listspfic1('student_parent','spar_cdistrict','spar_smid',$Stuid)->spar_cdistrict;\n\t\t$this->pstat=$this->commodel->get_listspfic1('student_parent','spar_cstate','spar_smid',$Stuid)->spar_cstate;\n\t\t$this->ppin=$this->commodel->get_listspfic1('student_parent','spar_cpincode','spar_smid',$Stuid)->spar_cpincode;\n\t\t$this->pcounname=$this->commodel->get_listspfic1('student_parent','spar_ccountry','spar_smid',$Stuid)->spar_ccountry;\n\t\t\n\t\t//get student category\n\t\t$this->cateid=$this->commodel->get_listspfic1('student_master','sm_category','sm_id',$Stuid)->sm_category;\n\t\t$this->catename=$this->commodel->get_listspfic1('category','cat_name','cat_id',$this->cateid)->cat_name;\n\n\t\t//get study center\n\t\t$this->sccode=$this->commodel->get_listspfic1('student_master','sm_sccode','sm_id',$Stuid)->sm_sccode;\n\t\t$this->scname=$this->commodel->get_listspfic1('study_center','sc_name','sc_code',$this->sccode)->sc_name;\n\t\t//get branch name\n\t\t$this->brid=$this->commodel->get_listspfic1('student_program','sp_branch','sp_smid',$Stuid)->sp_branch;\n\t\t$this->brname=$this->commodel->get_listspfic1('program','prg_branch','prg_id',$this->brid)->prg_branch;\n\t\t//get department name\n\t\t$this->depid=$this->commodel->get_listspfic1('student_program','sp_deptid','sp_smid',$Stuid)->sp_deptid;\n\t\t$this->depname=$this->commodel->get_listspfic1('Department','dept_name','dept_id',$this->depid)->dept_name;\n\n\t\t//$sprogid = $this->commodel->get_listspfic1('student_program','sp_id','sp_smid',$Stuid)->sp_id;\n\t\t//print_r($sprogid);\n\n\t\t//$this->db->select('sp_id')->from('student_program')->where('sp_smid',$Stuid)->where('sp_semester',$semsize);\n\t\t//$spstid = $this->db->get()->row();\n\t\t$getspid = array('sp_smid' => $Stuid, 'sp_semester' => $semsize);\n\t \t$spstid = $this->commodel->get_listspficemore('student_program','sp_id',$getspid);\n\t\t\n\t\t//print_r($spstid);\n\t\tforeach($spstid as $stspid){\n\t\t\t$this->cusem = $this->commodel->get_listspfic1('student_program','sp_semester','sp_id',$stspid->sp_id)->sp_semester;\n\t\t\t//print_r($this->cusem);\n\t\t}\n\t\t\t$datawh = array('sp_smid' => $Stuid, 'sp_semester' => $semsize);\n\t \t\t$diffdate = $this->commodel->get_listspficemore('student_program','sp_programid,sp_semregdate',$datawh);\n\t\t\t//print_r($diffdate);\n\t\t\tforeach($diffdate as $spdate):\n\t\t\t\t$semdiffdate = $this->datmodel->diffdays($spdate->sp_semregdate);\n\t\t\t\t$spprgid = $spdate->sp_programid;\n\t\t\tendforeach;\t\n\t\t\t//print_r($semdiffdate);\n\t\t\t$prgpattern=$this->commodel->get_listspfic1('program','prg_pattern','prg_id',$spprgid)->prg_pattern;\n\t\t\t$tmonth = $semdiffdate/30;\n\t\t\t//print_r($this->tdate);\n\t\t\t\n\t\t\t\n\t\t\tif((($tmonth > 5) && ($prgpattern == 'Semester')) || (($tmonth > 11) && ($prgpattern == 'Yearly')))\n\t\t\t{\n\t\n\t\t\t\tif(isset($_POST['register']))\n\t\t\t\t{\t\n\t\t\t\t\t$this->form_validation->set_rules('Ssem','Semseter','trim|xss_clean|required');\n\t\t\t\t\t//Re-populate field\n\t\t\t\t\tif($_POST)\n\t\t\t\t\t{\n\t\t\t\t\t\t//$this->data['Stmobile']=$this->input->get_post('Stmobile');\n\t\t\t\t\t\t$this->data['Ssem']=$this->input->get_post('Ssem');\n\t\t\t\t\t}//re populate if close\t\n\t\t\t\t\t\tif ($this->form_validation->run() == FALSE) {\t\n\t\t\t\t\t\t\t//$message = '<h3>Your some detail is incorrect .</h3>';\n\t \t\t\t\t\t\t//$this->session->set_flashdata('msg',$message);\n\t\t\t\t\t\t\t//redirect('request/registartionsemester');\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\t//update in student_master\n \t \t\t\t\t$this->db->trans_begin();\n\n\t\t\t\t\t\t$cdate = date(\"Y-m-d h:i:sa\");\t\t\t\t\t \t\n\t\t\t \t\t\tif($_POST['Ssem'] != $semsize){\t\t\t\t\n\t\t\t\t\t\t\t//insert program data in student_program\n\t\t\t\t\t\t\t$progdata = array (\n\t\t\t\t\t\t\t\t'sp_smid'\t=>\t$Stuid,\n\t\t\t\t\t\t\t\t'sp_programid'\t=>\t$this->ncid,\n\t\t\t\t\t\t\t\t'sp_deptid'\t=>\t$this->depid,\t\t\n\t\t\t\t\t\t\t\t'sp_sccode'\t=>\t$this->sccode,\n\t\t\t\t\t\t\t\t'sp_pcategory'\t=>\t$this->pcatid,\n\t\t\t\t\t\t\t\t'sp_branch'\t=>\t$this->brid,\n\t\t\t\t\t\t\t\t'sp_acadyear'\t=>\t$cacadyer,\n\t\t\t\t\t\t\t\t'sp_semregdate' =>\t$cdate,\n\t\t\t\t\t\t\t\t'sp_semester'\t=> $_POST['Ssem']\n\t\t\t\t\t\t\t\t); \n\t\t\t \t\t\t\t$this->db->insert('student_program',$progdata);\n\t\t\t \t\t\t\t$sprogramid = $this->db->insert_id();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$message1 = $semsize;\n\t\t\t\t\t\t\t$message = '<h3>You are already register in'.\" \". $semsize .\" \". $prgpattern.'</h3>';\n\t \t\t\t\t\t\t$this->session->set_flashdata('msg',$message);\n\t\t\t\t\t\t\tredirect('request/semesterregi');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//insert smid and spid in student fees\n\t\t\t\t\t\t$feesdata = array (\n\t\t\t\t\t\t\t'sfee_smid'\t=>\t$Stuid,\n\t\t\t\t\t\t\t'sfee_spid'\t=>\t$sprogramid\n\t\t\t\t \t\t\t); \n\t\t\t\t\t\t\t$this->db->insert('student_fees',$feesdata);\n\n\t\t\t\t//make transaction complete\n \t\t\t$this->db->trans_complete();\n\t\t\t\n\t \t\t\t\t//check if transaction status TRUE or FALSE\n \t\t\t\tif ($this->db->trans_status() === FALSE) {\n\t\t\t\n \t\t\t\t//if something went wrong, rollback everything\n \t\t\t\t\t$this->db->trans_rollback();\n\t\t\t\t\t\t$this->logger->write_logmessage(\"update\", \"Student registration not update record in student_master table.\");\n \t\t\t\t$this->logger->write_dblogmessage(\"update\", \"Student registration not update record in student_master table.\");\n\t\t\t\t\t\t$this->load->view('request/registartionsemester');\n\t\t\t\t\t\t//redirect('request/stufeesdetail');\n \t\t\t\t\t//return FALSE;\n \t\t\t\t\t } else {\t\n \t\t\t\t\t//if everything went right, commit the data to the database\n \t\t\t\t\t$this->db->trans_commit();\n\t\t\t \t\t\t$message = '<h3>Your registration successfully done.</h3>';\n\t \t\t\t\t\t$this->session->set_flashdata('msg',$message);\t\t\t\n\t\t\t\t\t\t$this->logger->write_logmessage(\"update\", \"Student registration successfull update record in student_master table\");\n \t\t\t\t$this->logger->write_dblogmessage(\"update\", \"Student registration successfull update record in student_master table\" );\n\t\t\t\t\t\tredirect('request/stufeesdetail');\n \t\t \t\t\t//return TRUE;\n \t\t\t \t\t}\n\t\t\t}//close first else\t\n\t\t\t}//if post close\n\t\t}//close semster difference if\n\t\telse{\n\t\t\t$message = '<h3>You can not register for next semester registration because you can not complete minimum duration.</h3>';\n \t\t\t$this->session->set_flashdata('err_message',$message);\n\t\t\tredirect('studenthome');\n\t\t }\t\n\t\t\n\t$this->load->view('request/registartionsemester');\n\t}", "public function renderPrivlastnit()\n {\n $spis_id = $this->getParameter('id', null);\n\n $orgjednotka_id = Orgjednotka::dejOrgUzivatele();\n\n $Spis = new Spis;\n $sp = $Spis->getInfo($spis_id);\n if (!empty($sp->orgjednotka_id) || !empty($sp->orgjednotka_id_predano))\n $this->flashMessage('Operace zamítnuta.', 'error');\n else if (!isset($orgjednotka_id))\n $this->flashMessage('Nemůžete převzít spis, protože nejste zařazen do organizační jednotky.',\n 'warning');\n else if ($Spis->zmenitOrg($spis_id, $orgjednotka_id)) {\n $this->flashMessage('Úspěšně jste si převzal tento spis. Pokud spis obsahoval dokumenty, jejich vlastnictví změněno nebylo.');\n } else {\n $this->flashMessage('Převzetí spisu do vlastnictví se nepodařilo. Zkuste to znovu.',\n 'warning');\n }\n\n $this->redirect(':Spisovka:Spisy:detail', array('id' => $spis_id));\n }", "function usun() {\n\t\t$baza = polacz_z_baza();\n\n\t\tif(!isset($_POST['student_id'])) {\n\t\t\techo \"Błędnie wywołany formularz<br>\";\n\t\t\treturn;\n\t\t}\n\t\t$zapytanie = \"DELETE FROM `studenci` WHERE `id` = \".$_POST['student_id'];\n\t\t$wynik = mysqli_query($baza, $zapytanie);\n\n\t\tif($wynik)\n\t\t\techo \"Student został usunięty z bazy<br>\";\n else \n\t\t\techo \"Błąd podczas próby usunięcia studenta z bazy (\".mysql_error().\")<br>\";\n\n\t\tzakoncz_polaczenie($baza);\n\t}", "public function gebruikersProfielInzien(\\WebGuy $I) {\n\t\t$I->wantTo('Gebruikers profiel inzien');\n\t\t$I->amOnPage('/login');\n\t\t$I->see('Uren');\n\t\t$I->fillField('Username', 'docent');\n\t\t$I->fillField('Password', 'docent');\n\t\t$I->click('Login');\n\t\t$I->amOnPage('/docent/2');\n\t\t$I->see('Docent Page');\n\t\t$I->click('Gebruikersbeheer');\n\t\t$I->amOnPage('/docent/2/gebruikers');\n\t\t$I->amOnPage('/docent/2/gebruikers/1');\n\t\t$I->see('Student');\n\t\t$I->see('10');\n\t\t$I->see('[email protected]');\n\t\t$I->see('I12R');\n\t}", "function login_user($admission) {\n\n$sql = \"SELECT * FROM `students` WHERE `AdminID` = '\".escape($admission).\"'\";\n$result = query($sql);\nif(row_count($result) == 1) {\n\t$row = mysqli_fetch_array($result);\n\n\t$user_password = $row['AdminID'];\n\n\tif($admission == $user_password) {\n\n\t\t$_SESSION['AdminID'] = $admission;\n\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\n\treturn true;\n} else {\n\n\treturn false;\n}\n\n}", "public function __construct()\n {\n //$this->student = $student;\n }", "public function authentification(){\n $mail = $_POST['email'];\n $password = $_POST['password'];\n\n $checkPass = $this->checkPassword($mail, $password);\n\n //check if email and password are corrects\n if ($checkPass){\n require_once 'ressources/modele/ModelLogin.php';\n $modelLogin = new ModelLogin();\n $user_check = $modelLogin->getUserByEmail($mail);\n\n\n while($row = $user_check->fetch()) {\n // redirect to layout with her Identifiant and Level and check if an user's birthday\n //Create SESSION\n\n $_SESSION['User_ID'] = $row['Id'];\n\n $_SESSION['Level'] = $row['Level'];\n\n $_SESSION['Last_name'] = $row['Last_name'];\n\n $_SESSION['First_name'] = $row['First_name'];\n\n }\n\n header('Location: /');\n exit();\n\n } else {\n header('Location: /login');\n exit();\n }\n }", "function verifyStudent($studentID){\r\n if(!empty($studentID)){\r\n\t\t // check X_PNSY_STUDENT table\r\n\t\t $query = \"select ID from `X_PNSY_STUDENT` where ID = '$studentID'\";\r\n\t\t $result = mysql_query($query);\t\t\r\n\t\t if (mysql_num_rows($result) == 0) return false;\r\n\r\n\t\t\r\n\t\t // check students table\r\n\t\t $query = \"select StudentID from `students` where StudentID = '$studentID'\";\r\n\t\t $result = mysql_query($query);\t\t\r\n\t\t if (mysql_num_rows($result) != 0) return true;\r\n\r\n\t\t\r\n\t\t // add student as a default entry\r\n\t\t $query = \"insert into students (StudentID) value ('$studentID')\";\r\n\t\t $result = mysql_query($query);\t\r\n\t\t return $result;\r\n }\r\n\r\n return false;\r\n\t}", "public function getSenhaProfessor()\r\n {\r\n return $this->senhaProfessor;\r\n }", "public function getAllStudents() {\n try {\n if(BaseController::isLoggedIn() && BaseController::isTeacher()) { \n $user = new UserModel();\n $user->id = BaseController::getUserId();\n $user_data = $user->getUserDataById();\n \n $student = new StudentModel();\n $students = $student->getAllStudents();\n \n $model = array(\n 'user_data' => $user_data,\n 'students' => $students\n );\n BaseController::display(self::$controller . '/students.php', $model);\n } else {\n BaseController::load('user/login.php', array('error_description' => 'Изисква се регистрация.'));\n }\n } catch (Exception $e) {\n BaseController::load('error.php');\n }\n }", "function visFinnStudenter() { \n $visning = $_GET['visning']; //sjekker hva som er satt til visning \n if ($visning == \"visAlle\") { //vis alle registrerte\n $svar = 'Dette er en liste over alle registrerte brukere på Hibu Alumni:\n <!--Luft-->\n <br /><br />\n <!--Viser alle registrerte-->\n '; //linjeskift for bedre oversikt i kildekoden \n $tilkobling = kobleTil(); //opprett tilkobling til db \n //henter ut alle registrerte sortert på etternavn\n $sql = \"SELECT * FROM tblstudent, tblBrukertype,tblCampus, tblFagomrade \";\n $sql .= \"WHERE sbId = bId AND scId = cId \";\n $sql .= \"AND sfId = fId ORDER BY sEtternavn ASC;\"; \n $resultat = mysql_query($sql, $tilkobling); \n $antall = mysql_num_rows($resultat);\n $svar .= finnBrukere($antall, $resultat); \n mysql_close($tilkobling); //lukker tilkobling til db \n } else if ($visning == \"sokNavn\") { //søk på navn\n $svar = visSkjemaNavn(); \n if (isset($_POST['FINNNAVN']) && $_POST['FINNNAVN'] == \"Søk på navn\") { //søker på navn\n $svar = \"<br />\" . finnVedNavn();\n } //if (isset($_POST['FINNNAVN'])) \n } else { //søk på e-post\n $svar = visSkjemaEpost(); \n if (isset($_POST['FINNMAIL']) && $_POST['FINNMAIL'] == \"Søk på e-post\") { //søker på e-post\n $svar = \"<br />\" . finnVedMail();\n } //if (isset($_POST['FINNMAIL']))\n } //if($visning == \"visAlle\") \n return $svar; \n }", "public function CheckUser()\n\t{\n\t\tinclude(\"Connection.php\");\n\t\tif(!$link->connect_error)\n\t\t{\n\t\t\t$checkUserSql = \"SELECT * FROM Gebruiker WHERE Email = '\".$this->Email.\"' AND Paswoord = '\".$this->Pass.\"';\";\n\t\t\t$checkUserResult = $link->query($checkUserSql);\t\t\t\t\t\t\t\n\t\t\t$count = $checkUserResult->num_rows;\n\t\t\tif($count==1)\n\t\t\t{\n\t\t\t\t$userdata = mysqli_fetch_assoc($checkUserResult);\n\t\t\t\t$_SESSION[\"UserID\"] = $userdata['GebruikerID'];\n\t\t\t\t$_SESSION[\"UserName\"] = $userdata['Naam'];\n\t\t\t\theader('Location: http://localhost:8888/newAppShareTheCosts/overzichtlijsten.php');\n\t\t\t\texit();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Sorry, we vonden geen account met deze gegevens, probeer opnieuw of maak een account aan\");\t\n\t\t\t}\n\t\tmysqli_close($link);\n\t\t}\n\t}", "function addStudent($name, $institution, $major, $minor, $identification, $passkey, $google, $yahoo, $live, $facebook, $linkedin, $twitter){\n\n\t\t$this->connection->query(\"INSERT INTO students (stud_name, stud_inst, stud_major, stud_minor, stud_identification, stud_passkey, stud_google, stud_yahoo, stud_live, stud_facebook, stud_linkedin, stud_twitter) VALUES ('$name', '$institution', '$major', '$minor', '$identification', '$passkey', '$google', '$yahoo', '$live', '$facebook', '$linkedin', '$twitter' )\",true);\n\t\tif($_SESSION['query']){\n\t\t\treturn \"Student Successfully Added\";\n\t\t}else{\n\t\t\treturn \"Failed to add Student!\";\t\t\n\t\t}\t\n\n\t}", "function pay_session_student()\n\t{\n\t\t\n/*\t\t$PaymentMethod = $this->Session->read('payment.method');\n\t\tif (isset($PaymentMethod)) {\n\t\t\t$this->set('method', $PaymentMethod);\n\t\t} else {\n\t\t\t$this->redirect(array(\n\t\t\t\t'action' => 'student_dashboard'\n\t\t\t));\n\t\t}\n*/\t\t\n\t\t\n\t\t\n\t\tif (!empty($this->data)) {\n\t\t\t\n\t\t\t$amount = $this->data['PaymentHistory']['amount'];\n\t\t\t$paymentid = $this->data['PaymentHistory']['id'];\n\t\t\t\n\t\t\t$balanceRow = $this->Member->find('first', array(\n\t\t\t\t'fields' => array(\n\t\t\t\t\t'Member.creditable_balance'\n\t\t\t\t),\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'Member.id' => $this->Session->read('Member.memberid')\n\t\t\t\t),\n\t\t\t\t'recursive' => -1\n\t\t\t));\n\t\t\t$balance = $balanceRow['Member']['creditable_balance'];\n\t\t\tif ($balance >= $amount) {\n\t\t\t\tif ($this->PaymentHistory->updateAll(array(\n\t\t\t\t\t'PaymentHistory.amount' => \"'\" . $amount . \"'\",\n\t\t\t\t\t'PaymentHistory.paypal_status' => \"'complete'\",\n\t\t\t\t\t//'PaymentHistory.paypal_email' => \"'\".$email.\"'\",\n\t\t\t\t\t//'PaymentHistory.paypal_confirm_id' => \"'\" .$taxid. \"'\",\n\t\t\t\t\t'PaymentHistory.session_status' => \"'Paided'\"\n\t\t\t\t), array(\n\t\t\t\t\t'PaymentHistory.id' => $paymentid\n\t\t\t\t))) {\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t/*\t$eventid = $this->PaymentHistory->find('first',array('conditions'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'PaymentHistory.id'=>$paymentid\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$this->TutEvent->updateAll(array(\n\t\t\t\t\t'TutEvent.title' => \"'Booked'\",\n\t\t\t\t\t), array(\n\t\t\t\t\t'TutEvent.id' => $eventid['PaymentHistory']['tut_event_id']\n\t\t\t\t\t));*/\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$this->booked_event($paymentid);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$this->Member->updateAll(array(\n\t\t\t\t\t\t'Member.creditable_balance' => \"Member.creditable_balance-\" . $amount\n\t\t\t\t\t), array(\n\t\t\t\t\t\t'Member.id' => $this->Session->read('Member.memberid')\n\t\t\t\t\t));\n\t\t\t\t\t\n\t\t\t\t\t/*$this->Session->delete('payment');\n\t\t\t\t\t$this->Session->setFlash('Payment successfully!');*/\n\t\t\t\t\t\n\t\t\t\t\t$getAmount = $this->PaymentHistory->find('first', array(\n\t\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t\t'SUM(PaymentHistory.tutor_rate_per_hour*PaymentHistory.tutoring_hours) AS amount',\n\t\t\t\t\t\t\t'PaymentHistory.tutor_id'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t\t'PaymentHistory.id' => $paymentid\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$this->Member->updateAll(array(\n\t\t\t\t\t\t'Member.balance' => ('Member.balance+' . $getAmount[0]['amount'])\n\t\t\t\t\t), array(\n\t\t\t\t\t\t'Member.id' => $getAmount['PaymentHistory']['tutor_id']\n\t\t\t\t\t));\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$this->tutcnf_email_template($paymentid);\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$this->stdcnfm_email_template($paymentid);\n\t\t\t\t\t\n\t\t\t\t\t$this->redirect(array(\n\t\t\t\t\t\t'controller' => 'homes',\n\t\t\t\t\t\t'action' => 'global_gateway_sucess'\n\t\t\t\t\t));\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->Session->setFlash('Insufficient Funds');\n\t\t\t\t\n\t\t\t\t\t$this->redirect(array(\n\t\t\t\t\t\t'controller' => 'members',\n\t\t\t\t\t\t'action' => 'parent_fund'\n\t\t\t\t\t));\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t/*\t$this->set('paymentid', $paymentid);\n\t\t$paydata = $this->PaymentHistory->find('first', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'PaymentHistory.id' => $paymentid\n\t\t\t)\n\t\t));\n\t\t\n\t\t$this->set('paydata', $paydata);*/\n\t\t\n\t\n\t\t\n\t}", "public function verify($id){\n $student = User::findOrFail($id);\n $student->IsVerify=1;\n $udate = $student->save();\n if(isset($udate)) {\n return redirect()->route('student.index')->with('message',\n 'Student successfully Verify.');\n }else{\n return redirect()->route('student.index')->with('message','Action Failed Please try again.');\n }\n }", "public function student()\n {\n return $this->belongsTo('App\\Models\\User');\n }", "public static function noteStudent()\n {\n $post = json_decode( file_get_contents(\"php://input\"), true);\n $id = ($post[\"member\"][0]['club_id']);\n\n $noteClub = \\Models\\Club::markClub($id)-> note_club;\n\n //var_dump($noteClub); // 20\n $tempPR = true;\n //var_dump($post[\"member\"]);\n $total_member = 0;\n $count_member = 0;\n $nbValidate = 0;\n $nbNoValidate = 0;\n\n foreach ($post[\"member\"] as $value)\n {\n if( $value['project'] != 'PR+' )\n {\n $total_member += $value['member_mark'];\n $count_member++;\n if ($value[\"project\"] == \"PR\")\n {\n if ($value[\"project_validation\"]) { // Si projet validé\n //var_dump($value);\n $nbValidate++;\n if ($value[\"member_mark\"] < 10) {\n $tempPR = false;\n }\n }\n else {\n $nbNoValidate++;\n if ($value[\"member_mark\"] >= 10) $tempPR = false;\n }\n }\n }\n }\n $total = $noteClub * $count_member;\n $max = 20 * ( $count_member - $nbNoValidate ) + $nbNoValidate * 9;\n\n $lockmark = \\Models\\Club::isLock($id);\n $lockmark = $lockmark['lock_member_mark'];\n //if( $_SESSION['user']->is_Evaluator == '1')\n\n //var_dump($total_member == $total);\n //var_dump($lockmark);\n //var_dump($tempPR);\n\n //if($total_member <= $total && $lockmark && $tempPR){\n if( ($count_member * $noteClub > $max) && $lockmark && $tempPR){\n $i = 0;\n foreach ($post[\"member\"] as $value){\n $i += intval(\\Models\\Member::noteStudent($value),10);\n }\n if(count($post[\"member\"]) == $i)\n echo 1;\n else echo 0;\n } else echo 0;\n }", "public function login (){\n\n $dao = DAOFactory::getUsuarioDAO(); \n $GoogleID = $_POST['GoogleID']; \n $GoogleName = $_POST['GoogleName']; \n $GoogleImageURL = $_POST['GoogleImageURL']; \n $GoogleEmail = $_POST['GoogleEmail'];\n $usuario = $dao->queryByGoogle($GoogleID); \n if ($usuario == null){\n $usuario = new Usuario();\n $usuario->google = $GoogleID;\n $usuario->nombre = $GoogleName;\n $usuario->avatar = $GoogleImageURL;\n $usuario->correo = $GoogleEmail;\n print $dao->insert($usuario);\n $_SESSION[USUARIO] = serialize($usuario);\n //$usuario = unserialize($_SESSION[USUARIO]);\n } else {\n $_SESSION[USUARIO] = serialize($usuario);\n }\n }", "public function index()\n {\n $count_estudiante = Estudiante::select('id')->count();\n $count_coord = User::where('rol_id','2')->select('id')->count();\n $count_dir = User::where('rol_id','2')->select('id')->count();\n $count_asis = User::where('rol_id','3')->select('id')->count();\n //dd((Auth::user()->id));\n if(Auth::user()->roles->first()->id == 4){\n $student = Estudiante::where('user_id',Auth::user()->id)->first();\n if($student){\n return redirect()->route('estudiantes.show',$student->id);\n }else{\n return redirect()->route('estudiantes.create');\n }\n\n }else{\n return view('home', compact('count_estudiante','count_coord','count_asis','count_dir'));\n }\n\n }", "function getInstitutionsession() {\n $model = \\common\\models\\Staff::findOne([\"user_id\" => Yii::$app->user->identity->user_id]);\n\n //end \n /*\n * Set global\n */\n $session = Yii::$app->session;\n if (isset($session['learn_institution_id'])) {\n $session->remove('learn_institution_id');\n unset($session['learn_institution_id']);\n if (count($model) > 0) {\n $session['learn_institution_id'] = $model->learning_institution_id;\n }\n } else {\n if (count($model) > 0) {\n $session['learn_institution_id'] = $model->learning_institution_id;\n }\n }\n }", "public function addReviewByStudent()\n {\n /* code goes here */\n }", "public function studentDroopOutInfo(Request $request)\n {\n $this->validate($request, [ \n 'right_semister' \t\t=> 'required',\n 'confirm_right_semister' => 'required',\n 'student_id' \t\t\t=> 'required',\n 'wrong_semister_id' \t=> 'required'\n ]);\n $right_semister \t\t = trim($request->right_semister);\n $confirm_right_semister = trim($request->confirm_right_semister);\n $student_id \t\t\t = trim($request->student_id);\n $wrong_semister_id \t\t = trim($request->wrong_semister_id);\n // check two semister\n if($right_semister != $confirm_right_semister){\n \tSession::put('failed','Sorry ! Right Semester And Confirm Right Semester Did Not Match');\n return Redirect::to('studentDroopOut/'.$student_id);\n \texit();\n }\n // detail student information \n $studentInfo = DB::table('student')->where('studentID',$student_id)->where('semister_status',1)->first();\n\n $session = $studentInfo->session ;\n \t$year = $studentInfo->year ;\n \t$shift = $studentInfo->shift_id ;\n \t$department = $studentInfo->dept_id ;\n \t$semister = $studentInfo->semister_id ;\n $section = $studentInfo->section_id ;\n \t$roll = $studentInfo->roll ;\n \t$studentID = $studentInfo->studentID ;\n \t$registration = $studentInfo->registration ;\n $semister_status = 1 ;\n \t$activity_status = 2 ;\n \t$student_type \t = 1 ;\n \t// check duplicate entry\n \t$count = DB::table('student')->where('studentID',$student_id)->where('semister_id',$right_semister)->count();\n \tif($count > 0)\n \t{\n \t\t Session::put('failed','Sorry ! Already Exits Of This Student');\n return Redirect::to('studentDroopOut/'.$student_id);\n \texit();\n \t}\n \t// insert query\n \t$data = array();\n \t$data['studentID'] \t\t= $studentID ;\n \t$data['session'] \t\t = $session ;\n \t$data['year'] \t\t\t = $year ;\n \t$data['shift_id'] \t\t= $shift ;\n \t$data['dept_id'] \t\t = $department ;\n \t$data['semister_id'] \t= $right_semister ;\n \t$data['section_id'] \t= $section ;\n \t$data['roll'] \t\t\t = $roll ;\n \t$data['registration'] \t = $registration ;\n \t$data['semister_status'] \t = $semister_status ;\n \t$data['activity_status'] \t = $activity_status ;\n \t$data['student_type'] \t\t = $student_type ;\n \t$data['created_at'] \t\t = $this->rcdate ;\n \tDB::table('student')->insert($data);\n // insert droop out table\n $data_droopout = array();\n $data_droopout['year'] = $year ;\n $data_droopout['student_id'] = $student_id ;\n $data_droopout['session_id'] = $session ;\n $data_droopout['wrong_semister_id'] = $wrong_semister_id ;\n $data_droopout['right_semister_id'] = $right_semister ;\n $data_droopout['create_time'] = $this->current_time ;\n $data_droopout['created_at'] = $this->rcdate ;\n DB::table('tbl_droopout')->insert($data_droopout);\n //delete wrong semester\n DB::table('student')->where('studentID',$student_id)->where('semister_id','>',$right_semister)->delete();\n Session::put('succes','Drop Out Complete Succssfully');\n return Redirect::to('studentVerify/');\n }", "private function getStudent(){\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire.sql\";\n\n\t\t$this->result[\"liste_stagiaire\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_techno_carousel.sql\";\n\n\t\t$this->result[\"liste_techno\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_rs.sql\";\n\n\t\t$this->result[\"liste_rs\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_doc.sql\";\n\n\t\t$this->result[\"liste_doc\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t}", "public function index()\n {\n if ($this->session->userdata('pre_student_login') != 1)\n redirect(site_url('login'), 'refresh');\n if ($this->session->userdata('pre_student_login') == 1)\n redirect(site_url('pre_student/dashboard'), 'refresh');\n }", "function viewStudentAdvisor( $sessionID, $studentID ) {\r\n\t\tif( $this->userCanViewStudent( $sessionID )) {\r\n\t\t\t$query = \"SELECT ADVISOR FROM X_PNSY_STUDENT WHERE ID = '$studentID'\";\r\n\t\t\t$result = mysql_fetch_assoc(mysql_query($query));\r\n\t\t\textract($result);\r\n\t\t\r\n\t\t\t$query = \"SELECT FIRST_NAME, LAST_NAME, WOOSTER_EMAIL FROM X_PNSY_FACULTY WHERE ID = '$ADVISOR'\";\r\n\t\t\t$result = mysql_fetch_assoc(mysql_query($query));\r\n\t\t\t\r\n\t\t\treturn $result;\r\n\t\t}\r\n\t}", "public function student_login($email,$password){\r\n echo $email;\r\n $select_all = \"SELECT * FROM student_registration WHERE email = '$email'\";\r\n $select_query = $this->conn->query($select_all);\r\n $check_user = $select_query->num_rows;\r\n if($check_user !=0){\r\n $_SESSION['student_email'] = $email;\r\n header('Location:my_profile.php');\r\n }else{\r\n echo \"<script>\r\n alert('Incorrect username or password');\r\n window.location = 'login.php';\r\n </script>\";\r\n }\r\n }", "private function _authentica($vis_email, $vis_senha){\n\t\t$sql = $this->conexao->prepare('\n\t\t\tSELECT\n\t\t\t\t*\n\t\t\tFROM visitante AS vis\n\t\t\tWHERE vis_email = :vis_email AND vis_senha = :vis_senha\n\t\t');\n\t\t$sql->bindParam(':vis_email', $vis_email);\n\t\t$sql->bindParam(':vis_senha', $vis_senha);\n\t\t$sql->execute();\n\t\t$temp = $sql->fetch(PDO::FETCH_ASSOC);\n\n\t\t// Visitante não encontrado (então é um novo visitante)\n\t\tif($temp === false){\n\t\t\tsleep(2);\n\t\t\treturn ['r' => 'no', 'data' => 'Ops, você errou sua senha ou seu e-mail.'];\n\t\t}\n\n\t\t$_SESSION[SESSION_VISITANTE]['vis_codigo'] = $temp['vis_codigo'];\n\t\t$_SESSION[SESSION_VISITANTE]['vis_email'] = $temp['vis_email'];\n\t\t$_SESSION[SESSION_VISITANTE]['vis_nome'] = $temp['vis_nome'];\n\t\t$_SESSION[SESSION_VISITANTE]['vis_tel'] = $temp['vis_tel'];\n\t\t$_SESSION[SESSION_VISITANTE]['vis_cel'] = $temp['vis_cel'];\n\t\t$_SESSION[SESSION_VISITANTE]['vis_senha'] = $temp['vis_senha'];\n\t\t$_SESSION[SESSION_VISITANTE]['vis_avatar'] = $temp['vis_avatar'];\n\n\t\treturn ['r' => 'ok', 'data' => 'Cliente identificado, logando..'];\n\t}", "public function students(){\n\t\t$this->verify();\n\t\t$data['title']=\"Students\";\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('students/students', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}", "function add_student(){\n\t\t\t\n\t\t\t$st_id = self::$db->quote($_POST['id']);\n\t\t\t$fname = self::$db->quote($_POST['firstname']);\n\t\t\t$lname = self::$db->quote($_POST['lastname']);\n\t\t\t$area = self::$db->quote($_POST['area']);\n\t\t\t$result = self::$admin->addStudent($st_id,$fname,$lname,$area);\n\n\t\t\tif($result == 1){\n\t\t\t\techo \"User Added Successfully....\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\techo \"something wrong\";\n\t\t\t}\n\t\t}", "protected function redirectTo(){\n //if all it's ok, then verify the saved user into the tables, if doesn't in t_worker then search to t_student\n //where to found redirect to the view\n if(Auth::user()->role === 'E')\n return 'vDocente/welcome';\n elseif(Auth::user()->role === 'S')\n return 'vAlumno/welcome';\n }", "private function telaRecuperaSenha() {\n //self::getObjSmarty()->assign(\"POST_LOGIN\",\"?c=\".self::getObjCrypt()->cryptData(\"Login\"));\n //$this->getObjJs()->addJs(FWK_JS.\"validaLogin.js\");\n try {\n //self::getObjHttp()->escreEm(\"RODAPE_LOGIN_ADMIN\",self::getRodapeRecuperaSenha());\n self::getObjHttp()->escreEm(\"CORPO\", self::getTplRecuperaSenha());\n } catch (HtmlException $e) {\n die(\"ViewAdminPage()->telaLogin(): \" . self::getTplRecuperaSenha() . $e->__toString());\n }\n }", "public function indexForTeacher()\n {\n if(\\Auth::user()->can('see-grades-for-teacher')){\n $teacherId = \\Auth::user()->id;\n $subjects = Subject::where('teacher_id', \"=\", $teacherId)->get();\n $subjectsIds = array_pluck($subjects, 'id');\n $grades = Grade::whereIn('subject_id', $subjectsIds)->get();\n $users = User::all();\n $students = [];\n foreach($users as $user){\n if($user->hasRole('Student')){\n $students[$user->id] = $user;\n }\n }\n\n\n return view('subject.listTeacher')->withGrades($grades)->withStudents($students);\n\n\n\n }\n }", "function verificalogin(){\n if(!isset($this->session->datosusu)){\n return true;\n }\n }", "function enroll($cwid,$courseid,$session){\n $query=\"insert into _enrolled_student values($cwid,$courseid,$session)\";\n $result=$this->connection->query($query);\n if ($result){\n echo $cwid,\" \",\"Enrolled successfully..\";\n }\n else{\n echo \"An error acured, please try again!\";\n } \n }", "public function index()\n {\n $grades = Grade::all();\n $users = User::all();\n $students = [];\n foreach($users as $user){\n if($user->hasRole('Student')){\n $students[$user->id] = $user;\n }\n }\n\n\n\n return view('grade.list')->withGrades($grades)->withStudents($students);\n }", "public function index()\n {\n $dt=new Carbon('','Asia/Tehran');\n $time=$dt->toDateTimeString();\n $user = Auth::user();\n $title=DB::table('roles')->latest('created_at')->first();\n $q = Question::all()->where('title',$title->title)->random(10);\n $ans=array();\n foreach ($q as $question){\n array_push($ans, $question->ans);\n }\n session_start();\n $_SESSION['ans']=$ans;\n if($user->attemps>0){\n $user->attemps-=1;\n $user->save();\n return view('student.exam',compact('q','user','time'));\n }\n else\n return view('student.examNotFound',compact('time'));\n\n }", "function show_sessions( $type, $info, $db)\n{\n\t$found;\n\t$studentPsid = $info->getPsid();\n\t\n\t$result = $db->query( \"select * from Sessions where Sessions.psid = '$studentPsid' order by Sessions.year desc,Sessions.month desc,Sessions.day desc,Sessions.hour desc,Sessions.min desc,Sessions.second desc\");\n\t\n\t$rows = $result->num_rows;\n\t\n\tif ( $rows < 1 ) \n\t{\n\t\techo \"No sessions have been logged for this student: <br/>\";\n\t\n\t}\n\telse\n\t{\n\t\tif ( $type > 0 )\n\t\t{\n\t\t\tfor ( $i = 0; $i < $rows; $i++ )\n\t\t\t{\n\t\t\t\t$row = $result->fetch_array();\n\t\t\t\t$dateString = $row['year'].\"-\".$row['month'].\"-\".$row['day'].\"-\".$row['hour'].\"-\".$row['min'].\"-\".$row['second'];\n\t\t\t\t$psid = $row['psid'];\n\t\t\t\t$rdo = $psid.\":\".$dateString;\n\t\t\t\techo \"Select Session $i: PeopleSoft: $psid Date: $dateString : <input type='radio' value='$rdo' name='rdochoice' /><br/>\";\n\t\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ( $i = 0; $i < $rows; $i++ )\n\t\t\t{\n\t\t\t\t$row = $result->fetch_array();\n\t\t\t\techo \"Select Session $i: PeopleSoft: \". $row['psid']. \" Date: \".$row['year'].\"-\".$row['month'].\"-\".$row['day'].\"-\".$row['hour'].\"-\".$row['min'].\"-\".$row['second'].\"</br>\";\n\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t}\n\t\n\t$infoString = serialize( $info );\n\t$_SESSION['student'] = $infoString;\n\t\n\treturn;\n}", "public function show(student $student)\n {\n //\n }", "public function view_students()\n{\n $school =$this->getSchool(self::Admin,self::Active);\n$students =Student::where('user_id',$this->user_id())->orderBy('id','DES')->paginate(100);\n return view('home.student.index')->withS($school);\n}", "public function run()\n {\n {\n $students = [\n [\n \"surname\" => \"Dare\",\n \"firstname\" => \"Koby\",\n \"nationality\" => \"UK\",\n \"email\" => \"[email protected]\",\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Dicki\",\n \"firstname\" => \"Kelli\",\n \"nationality\" => \"UK\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Carter\",\n \"firstname\" => \"Golden\",\n \"nationality\" => \"UK\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Koch\",\n \"firstname\" => \"Emory\",\n \"nationality\" => \"UK\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Kilback\",\n \"firstname\" => \"Marjorie\",\n \"nationality\" => \"Dominican Republic\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Hoeger\",\n \"firstname\" => \"Ernest\",\n \"nationality\" => \"Panama\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Hudson\",\n \"firstname\" => \"Rebecca\",\n \"nationality\" => \"Chile\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Hirthe\",\n \"firstname\" => \"Josefina\",\n \"nationality\" => \"Kyrgyzstan\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Ebert\",\n \"firstname\" => \"Wanda\",\n \"nationality\" => \"Palau\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Denesik\",\n \"firstname\" => \"Burnice\",\n \"nationality\" => \"Kuwait\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Moen\",\n \"firstname\" => \"Harold\",\n \"nationality\" => \"Vatican City\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Spencer\",\n \"firstname\" => \"Brennon\",\n \"nationality\" => \"Cambodia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Ziemann\",\n \"firstname\" => \"Stanley\",\n \"nationality\" => \"Azerbaijan\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Rempel\",\n \"firstname\" => \"Forest\",\n \"nationality\" => \"Seychelles\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Zboncak\",\n \"firstname\" => \"Gregory\",\n \"nationality\" => \"Kazakhstan\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Weimann\",\n \"firstname\" => \"Valentine\",\n \"nationality\" => \"Turks and Caicos Islands\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Waelchi\",\n \"firstname\" => \"Alexandria\",\n \"nationality\" => \"People's Democratic Republic of Yemen\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Altenwerth\",\n \"firstname\" => \"Florian\",\n \"nationality\" => \"Wake Island\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Zieme\",\n \"firstname\" => \"Faye\",\n \"nationality\" => \"Guatemala\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Beatty\",\n \"firstname\" => \"Raleigh\",\n \"nationality\" => \"British Antarctic Territory\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Kuhic\",\n \"firstname\" => \"Dolly\",\n \"nationality\" => \"Paraguay\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Koepp\",\n \"firstname\" => \"Mikel\",\n \"nationality\" => \"Liberia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Pfannerstill\",\n \"firstname\" => \"May\",\n \"nationality\" => \"Puerto Rico\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Douglas\",\n \"firstname\" => \"Otho\",\n \"nationality\" => \"Denmark\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Conroy\",\n \"firstname\" => \"Napoleon\",\n \"nationality\" => \"Afghanistan\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Doyle\",\n \"firstname\" => \"Elza\",\n \"nationality\" => \"Liechtenstein\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Schulist\",\n \"firstname\" => \"Maci\",\n \"nationality\" => \"United States\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Hansen\",\n \"firstname\" => \"Kyler\",\n \"nationality\" => \"Canada\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Conn\",\n \"firstname\" => \"Jean\",\n \"nationality\" => \"Kiribati\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Yost\",\n \"firstname\" => \"Reilly\",\n \"nationality\" => \"South Africa\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Quigley\",\n \"firstname\" => \"Shad\",\n \"nationality\" => \"Bhutan\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Quitzon\",\n \"firstname\" => \"Beatrice\",\n \"nationality\" => \"Timor-Leste\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Langworth\",\n \"firstname\" => \"Lonny\",\n \"nationality\" => \"New Zealand\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Kiehn\",\n \"firstname\" => \"Rosalinda\",\n \"nationality\" => \"Dominican Republic\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Parker\",\n \"firstname\" => \"Rebekah\",\n \"nationality\" => \"Kyrgyzstan\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Kuhlman\",\n \"firstname\" => \"Rhoda\",\n \"nationality\" => \"Gibraltar\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Cruickshank\",\n \"firstname\" => \"Judd\",\n \"nationality\" => \"Macau SAR China\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Yundt\",\n \"firstname\" => \"Sarah\",\n \"nationality\" => \"Papua New Guinea\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Pacocha\",\n \"firstname\" => \"Russ\",\n \"nationality\" => \"Greenland\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Purdy\",\n \"firstname\" => \"Kali\",\n \"nationality\" => \"Mauritania\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Block\",\n \"firstname\" => \"Janick\",\n \"nationality\" => \"Belarus\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Waelchi\",\n \"firstname\" => \"Ford\",\n \"nationality\" => \"Paraguay\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Batz\",\n \"firstname\" => \"Francesca\",\n \"nationality\" => \"Netherlands Antilles\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Rogahn\",\n \"firstname\" => \"Lukas\",\n \"nationality\" => \"Cape Verde\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Funk\",\n \"firstname\" => \"Wilhelmine\",\n \"nationality\" => \"Zimbabwe\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Nader\",\n \"firstname\" => \"Jude\",\n \"nationality\" => \"Panama Canal Zone\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Stroman\",\n \"firstname\" => \"Frankie\",\n \"nationality\" => \"Saint Martin\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Jaskolski\",\n \"firstname\" => \"Mina\",\n \"nationality\" => \"Bermuda\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Zieme\",\n \"firstname\" => \"Mack\",\n \"nationality\" => \"Uzbekistan\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Tromp\",\n \"firstname\" => \"Celestine\",\n \"nationality\" => \"Peru\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Nitzsche\",\n \"firstname\" => \"Zella\",\n \"nationality\" => \"New Zealand\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Kuphal\",\n \"firstname\" => \"Ila\",\n \"nationality\" => \"Maldives\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Cruickshank\",\n \"firstname\" => \"Eda\",\n \"nationality\" => \"Jamaica\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Koepp\",\n \"firstname\" => \"Jaylen\",\n \"nationality\" => \"Monaco\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Kohler\",\n \"firstname\" => \"Kristina\",\n \"nationality\" => \"Russia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Ondricka\",\n \"firstname\" => \"Sean\",\n \"nationality\" => \"Turks and Caicos Islands\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Leuschke\",\n \"firstname\" => \"Estelle\",\n \"nationality\" => \"Niue\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Funk\",\n \"firstname\" => \"Roselyn\",\n \"nationality\" => \"Djibouti\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Romaguera\",\n \"firstname\" => \"Kariane\",\n \"nationality\" => \"Djibouti\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Nitzsche\",\n \"firstname\" => \"Adrian\",\n \"nationality\" => \"Guernsey\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Windler\",\n \"firstname\" => \"Maggie\",\n \"nationality\" => \"Guernsey\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Blanda\",\n \"firstname\" => \"Ken\",\n \"nationality\" => \"French Southern Territories\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Reilly\",\n \"firstname\" => \"Antone\",\n \"nationality\" => \"Yemen\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Cassin\",\n \"firstname\" => \"Yadira\",\n \"nationality\" => \"Mayotte\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Macejkovic\",\n \"firstname\" => \"Marge\",\n \"nationality\" => \"Slovakia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Feest\",\n \"firstname\" => \"Rogers\",\n \"nationality\" => \"Monaco\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Fadel\",\n \"firstname\" => \"Candelario\",\n \"nationality\" => \"Belarus\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Shields\",\n \"firstname\" => \"Eldridge\",\n \"nationality\" => \"Neutral Zone\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Romaguera\",\n \"firstname\" => \"Lavina\",\n \"nationality\" => \"Canton and Enderbury Islands\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Hessel\",\n \"firstname\" => \"Matt\",\n \"nationality\" => \"Czech Republic\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Donnelly\",\n \"firstname\" => \"Barrett\",\n \"nationality\" => \"South Korea\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Hagenes\",\n \"firstname\" => \"Betty\",\n \"nationality\" => \"Samoa\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Schmeler\",\n \"firstname\" => \"Alphonso\",\n \"nationality\" => \"Palau\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Shields\",\n \"firstname\" => \"Selmer\",\n \"nationality\" => \"Samoa\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Kemmer\",\n \"firstname\" => \"Earl\",\n \"nationality\" => \"Niger\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Kunde\",\n \"firstname\" => \"Sharon\",\n \"nationality\" => \"French Guiana\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Jacobs\",\n \"firstname\" => \"Jeffry\",\n \"nationality\" => \"Albania\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Ritchie\",\n \"firstname\" => \"Eliane\",\n \"nationality\" => \"Chad\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Erdman\",\n \"firstname\" => \"Howard\",\n \"nationality\" => \"Puerto Rico\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Schimmel\",\n \"firstname\" => \"Lance\",\n \"nationality\" => \"Serbia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Tillman\",\n \"firstname\" => \"Elliott\",\n \"nationality\" => \"Botswana\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Boyle\",\n \"firstname\" => \"Emanuel\",\n \"nationality\" => \"Tokelau\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Feest\",\n \"firstname\" => \"Norma\",\n \"nationality\" => \"Georgia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"O'Conner\",\n \"firstname\" => \"Jenifer\",\n \"nationality\" => \"Nepal\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Towne\",\n \"firstname\" => \"Lilliana\",\n \"nationality\" => \"New Caledonia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Padberg\",\n \"firstname\" => \"Verner\",\n \"nationality\" => \"Seychelles\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Stiedemann\",\n \"firstname\" => \"Adelia\",\n \"nationality\" => \"Greece\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Turcotte\",\n \"firstname\" => \"Tristin\",\n \"nationality\" => \"Nauru\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Pouros\",\n \"firstname\" => \"Cooper\",\n \"nationality\" => \"Micronesia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Romaguera\",\n \"firstname\" => \"Judy\",\n \"nationality\" => \"Australia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Tremblay\",\n \"firstname\" => \"Maxie\",\n \"nationality\" => \"French Guiana\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Barrows\",\n \"firstname\" => \"Akeem\",\n \"nationality\" => \"Mozambique\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Funk\",\n \"firstname\" => \"Florencio\",\n \"nationality\" => \"Malawi\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Welch\",\n \"firstname\" => \"Margarita\",\n \"nationality\" => \"Ethiopia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Legros\",\n \"firstname\" => \"Helmer\",\n \"nationality\" => \"Antigua and Barbuda\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Labadie\",\n \"firstname\" => \"Carole\",\n \"nationality\" => \"Martinique\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Klein\",\n \"firstname\" => \"Desiree\",\n \"nationality\" => \"Nepal\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Kuvalis\",\n \"firstname\" => \"Eloy\",\n \"nationality\" => \"Panama Canal Zone\",\n \"email\" => \"[email protected]\",\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199),\n ],\n [\n \"surname\" => \"Macejkovic\",\n \"firstname\" => \"Lucinda\",\n \"nationality\" => \"Austria\",\n \"email\" => \"[email protected]\",\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Bosco\",\n \"firstname\" => \"Emilia\",\n \"nationality\" => \"São Tomé and Príncipe\",\n \"email\" => \"[email protected]\",\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ]\n ];\n\n foreach ($students as $student) {\n Student::create($student);\n }\n }\n }", "public function display(){\r\n echo \"Unique Row Id: \" . $this->getUnique_studentKey() . \"<br/>\";\r\n echo \"User Id: \" . $this->getStudentUserID() . \"<br/>\";\r\n echo \"Password: \" . $this->getStudentPassword() . \"<br/>\";\r\n echo \"First Name: \" . $this->getFirstName() . \"<br/>\";\r\n echo \"Middle Name: \" . $this->getMiddleName() . \"<br/>\";\r\n echo \"Last Name: \" . $this->getLastName() . \"<br/>\";\r\n echo \"Email: \" . $this->getEmail() . \"<br/>\"; \r\n echo \"School Name: \" . $this->getSchoolName() . \"<br/>\"; \r\n echo \"Grade: \" . $this->getGrade() . \"<br/>\";\r\n echo \"Role: \" . $this->getRole() . \"<br/>\";\r\n }", "public function studentProfile($student_name,$user_id) {\n\t\t//assign public class values to function variable\n\t\t$data = $this->data;\n\t\t$data['common_data'] = $this->common_data;\n\t\t$data['page'] = 'my_profile';\n\t\t$data['pageName'] = 'My Profile';\n\t\tif(isset($data['common_data']['user_data']['role']) && $data['common_data']['user_data']['role'] == INACTIVE_STATUS_ID){\n\t\t\theader(\"Location: \".ROUTE_PROFILE);\n\t\t\tdie();\n\t\t}\n\t\t$data['user_details'] = $this->user_model->getUserById($user_id);\n\t\tif(preg_replace(\"/&([a-z])[a-z]+;/i\", \"$1\", htmlentities(strtolower(str_replace(' ', '', $data['user_details']['first_name'])))) != preg_replace(\"/&([a-z])[a-z]+;/i\", \"$1\", htmlentities(strtolower(str_replace(' ', '', $tutor_name))))){\n\t\t\theader(\"Location: \".ROUTE_ERROR_PAGE);\n\t\t\tdie();\n\t\t}\n\t\t$data['student_subjects'] = $this->user_model->getSubjectsByStudentId($user_id);\n\t\t$student_subjects_id = $this->profile_model->getSubjectsByStudentId($user_id);\n\t\t$subject_id = \"\";\n\t\tif(!empty($student_subjects_id)){\n\t\t\tforeach ($student_subjects_id as $sub_id){\n\t\t\t\t$subject_id .= $sub_id.\",\";\n\t\t\t}\n\t\t}\n\t\t$data['related_students'] = \"\";\n\t\tif(!empty($subject_id)){\n\t\t\t$subject_id = rtrim($subject_id,',');\n\t\t\t$data['related_students'] = $this->profile_model->relatedStudents($subject_id,$user_id);\n\t\t}\n\t\t$data['student_reviews'] = $this->reviews_model->getStudentReviews($user_id);\n\t\tif(empty($data['user_details']) || $data['user_details']['role'] != STUDENT){\n\t\t\theader(\"Location: \".ROUTE_ERROR_PAGE);\n\t\t\tdie();\n\t\t}\n\t\t$template['body_content'] = $this->load->view('frontend/profile/student-profile', $data, true);\t\n\t\t$this->load->view('frontend/layouts/template', $template, false);\n\t}", "public function loginTraitement(){\n\n $identifiant = $this->verifierSaisie(\"identifiant\");\n $password = $this->verifierSaisie(\"password\");\n\n //securite\n if (($identifiant != \"\") && ($password != \"\")){\n\n //on crée un objet de la classe \\W\\Security\\AuthentificationModel\n //ce qui nous permet d'utiliser la methode isValidLoginInfo\n $objetAuthentificationModel = new \\W\\Security\\AuthentificationModel;\n\n $idUser = $objetAuthentificationModel->isValidLoginInfo($identifiant, $password);\n\n if($idUser > 0){\n\n // recuperer les infos de l'utilisateur\n //requete base de donnée pour les recuperer\n //je crée un objet de la classe \\W\\Model\\UsersModel\n $objetUsersModel = new \\W\\Model\\UsersModel;\n // je retrouve les infos de la ligne grace à la colonne ID\n // La classe UsersModel herite de la classe Model je peu donc faire un find pour recupeerr les infos\n $tabUser = $objetUsersModel->find($idUser);\n\n // Je vais ajouter des infos dans la session\n $objetAuthentificationModel->logUserIn($tabUser);\n\n // recuperer l'username\n $username = $tabUser[\"username\"];\n\n\n $GLOBALS[\"loginRetour\"] = \"Bienvenue $username\";\n\n $this->redirectToRoute(\"admin_accueil\");\n }\n else{\n $GLOBALS[\"loginRetour\"] = \"Identifiant incorrects \";\n }\n }else{\n\n $GLOBALS[\"loginRetour\"] = \"Identifiant incorrects \";\n }\n }" ]
[ "0.644337", "0.6333015", "0.63011754", "0.6133227", "0.59824663", "0.5963286", "0.59162855", "0.588919", "0.5813782", "0.57919705", "0.5790793", "0.57885396", "0.57884574", "0.57684255", "0.5744531", "0.5668037", "0.56544995", "0.563653", "0.56260055", "0.56183183", "0.5607443", "0.5605073", "0.56046176", "0.5592149", "0.55860806", "0.5564836", "0.5546426", "0.5544819", "0.55339503", "0.5527904", "0.5516044", "0.55127954", "0.5499494", "0.54977703", "0.5497664", "0.5495972", "0.54931676", "0.5492677", "0.54919887", "0.548451", "0.5481732", "0.547568", "0.5471289", "0.5468906", "0.54678726", "0.5467068", "0.5466592", "0.54497874", "0.5437466", "0.54367065", "0.54296404", "0.5429354", "0.5427513", "0.5421995", "0.5421994", "0.54203975", "0.54162854", "0.54154", "0.54126585", "0.5408718", "0.5408285", "0.5407908", "0.54037917", "0.54003656", "0.5391685", "0.53895074", "0.53893405", "0.53810334", "0.53734297", "0.53664505", "0.53663146", "0.53575647", "0.5352764", "0.5349424", "0.5348003", "0.5344844", "0.5339319", "0.5332026", "0.5329105", "0.53288436", "0.532142", "0.5319471", "0.5314306", "0.5312561", "0.53120834", "0.53081965", "0.5307429", "0.5302471", "0.528907", "0.52864146", "0.5285744", "0.5284127", "0.528352", "0.52772963", "0.52623904", "0.5259227", "0.52577615", "0.52513444", "0.52448624", "0.5244077", "0.52362275" ]
0.0
-1
Schrijft een gebruiker uit voor een sessie.
function withdraw($columnId, $userId) { $this->db->where('gebruikerId', $userId); $this->db->where('planningKolomId', $columnId); $this->db->delete('aanwezigheid'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function Save()\r\n\t\t{\r\n\t\t\t$db = new Db();\r\n\t\t\t$sql = \"INSERT INTO tbl_users (naam, voornaam, email, wachtwoord)\r\n\t\t\tVALUES ('\".$db->conn->real_escape_string($this->m_sName).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sFirstname).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sEmail).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sPassword).\"'\r\n\t\t\t)\";\r\n\t\t\t$db->conn->query($sql);\r\n\r\n\t\t\t//user_id van de geregistreerde gebruiker in de session variabele opslaan\r\n\t\t\t$user_id = $db->conn->insert_id;\r\n\t\t\t$_SESSION['user_id'] = $user_id;\r\n\t\t}", "public static function session()\n {\n //Sjekker om en bruker er logget in\n if (isset($_SESSION['user'])) {\n //Hvis verifyUser() returnerer falskt er sessionene kapret\n if(!$_SESSION['user']->verifyUser()){\n unset($_SESSION['user']);\n $alert = new Alert(Alert::ERROR, \"Sessionen er kapret og du har blitt logget ut. Husk å bruke beskyttelse\");\n $alert->displayOnIndex();\n }\n }\n }", "public function CheckUser()\n\t{\n\t\tinclude(\"Connection.php\");\n\t\tif(!$link->connect_error)\n\t\t{\n\t\t\t$checkUserSql = \"SELECT * FROM Gebruiker WHERE Email = '\".$this->Email.\"' AND Paswoord = '\".$this->Pass.\"';\";\n\t\t\t$checkUserResult = $link->query($checkUserSql);\t\t\t\t\t\t\t\n\t\t\t$count = $checkUserResult->num_rows;\n\t\t\tif($count==1)\n\t\t\t{\n\t\t\t\t$userdata = mysqli_fetch_assoc($checkUserResult);\n\t\t\t\t$_SESSION[\"UserID\"] = $userdata['GebruikerID'];\n\t\t\t\t$_SESSION[\"UserName\"] = $userdata['Naam'];\n\t\t\t\theader('Location: http://localhost:8888/newAppShareTheCosts/overzichtlijsten.php');\n\t\t\t\texit();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Sorry, we vonden geen account met deze gegevens, probeer opnieuw of maak een account aan\");\t\n\t\t\t}\n\t\tmysqli_close($link);\n\t\t}\n\t}", "private function verificar_cookie_sesion()\n\t{\n\t\t$session = \\Config\\Services::session();\n\t\t//verificar cookies\n\t\tif (isset($_COOKIE['ivafacil_admin_nick']) && isset($_COOKIE['ivafacil_admin_pa']) ) {\n\n\t\t\t$nick= $_COOKIE['ivafacil_admin_nick'];\n\t\t\t$pass=$_COOKIE['ivafacil_admin_pa'];\n\t\t\t//comparar passw hasheadas\n\t\t\t$usuarioCookie = new Admin_model();\n\t\t\t$result_pass_comparison =\n\t\t\t$usuarioCookie->where(\"nick\", $nick) \n\t\t\t->where(\"session_id\", $pass)->first();\n\n\t\t\tif (is_null($result_pass_comparison)) {\n\t\t\t\t//MOSTRAR FORM\n\n\t\t\t\treturn view(\"admin/login\");\n\t\t\t} else {\n\n\t\t\t\t//Se pidio recordar password?\n\t\t\t\tif ($result_pass_comparison->remember == \"S\") {\n\t\t\t\t\t//recuperar sesion si es valida\n\t\t\t\t\t$hoy = strtotime(date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t$expir = strtotime($result_pass_comparison->session_expire);\n\t\t\t\t\tif ($hoy > $expir) return view(\"admin/login\");\n\n\t\t\t\t\t//crear sesion \n\t\t\t\t\t$newdata = [\n\t\t\t\t\t\t'nick' => $nick, \n\t\t\t\t\t\t'pass_alt' => $pass,\n\t\t\t\t\t\t'remember'=> \"S\"\n\t\t\t\t\t];\n\t\t\t\t\treturn view(\"admin/login\", $newdata);\n\t\t\t\t} else {\n\t\t\t\t\treturn view(\"admin/login\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//MOSTRAR FORM\n\t\treturn view(\"admin/login\");\n\t}", "function verificar_login()\n {\n if (!isset($_SESSION['usuario'])) {\n $this->sign_out();\n }\n }", "public function doregister() {\n if (isset($_SESSION['userid'])) {\n $this->redirect('?v=project&a=show');\n } else {\n $useremail=$_POST['useremail'];\n $username=$_POST['username'];\n $password=$_POST['password'];\n $rpassword=$_POST['rpassword'];\n if ($password==$rpassword && !empty($useremail) && !empty($username) && $this->model->putuser($useremail,$password,$username)) {\n $this->view->set('infomessage', \"Użytkownik zarejestrowany!<br>Możesz się teraz zalogować.\");\n $this->view->set('redirectto', \"?v=user&a=login\");\n $this->view->render('info_view');\n } else {\n $this->view->set('errormessage', \"Błędne dane do rejestracji!\");\n $this->view->set('redirectto', \"?v=user&a=register\");\n $this->view->render('error_view');\n }\n }\n }", "private function sessionLogin() {\r\n $this->uid = $this->sess->getUid();\r\n $this->email = $this->sess->getEmail();\r\n $this->fname = $this->sess->getFname();\r\n $this->lname = $this->sess->getLname();\r\n $this->isadmin = $this->sess->isAdmin();\r\n }", "public function loginmedewerker($uname, $psw){\n\n $sql = \"SELECT medewerkerscode, gebruikersnaam, wachtwoord FROM medewerkers WHERE gebruikersnaam = :gebruikersnaam\";\n \n //prepare\n $stmt = $this->conn->prepare($sql);\n \n $stmt->execute([\n 'gebruikersnaam' => $uname\n ]);\n \n \n $result = $stmt->fetch(PDO::FETCH_ASSOC);\n print_r($result);\n \n if(is_array($result)){\n \n if(count($result) > 0){\n \n if ($uname == $result['gebruikersnaam'] && password_verify($psw, $result['wachtwoord'])) {\n \n session_start();\n $_SESSION['medewerkerscode'] = $result['id'];\n $_SESSION['uname'] = $result['gebruikersnaam'];\n \n header('location: medewerkers.php');\n \n }\n }else{\n echo 'Failed to login.';\n }\n \n }else{\n echo 'Failed to login. please check youre input and try again.';\n }\n \n }", "function registrarSesion () {\n\n if (!empty($this->id_usuario)) {\n $this->salvar(['ultima_session' => 'current_timestamp',\n 'activo' => 1\n ]);\n Helpers\\Sesion::sessionLogin();\n }\n else return false;\n\n }", "function VerifyUser(){\n $user = $_POST[\"input_user\"];\n $pass = $_POST[\"input_pass\"];\n\n if(isset($user)){\n $userFromDB = $this->model->GetUser($user);\n if(isset($userFromDB) && $userFromDB){ //PREGUNTAR SOBRE ESTE &&\n\n if (password_verify($pass, $userFromDB->pass)){ \n\n session_start(); //SE INICIA UNA SESION\n $_SESSION[\"user\"] = $userFromDB->nombre; //SE TRAE EL user DEL USUARIO DESDE LA DB\n $_SESSION[\"admin\"] = $userFromDB->admin; //SE TRAE EL ROL DEL USUARIO DESDE LA DB\n $_SESSION[\"email\"] = $userFromDB->email; //SE TRAE EL ROL DEL USUARIO DESDE LA DB\n $_SESSION[\"id_user\"] = $userFromDB->id;\n setcookie(\"id_user\", $userFromDB->id); //SE CREA UNA COOKIE \"id_user\"\n\n session_start();\n header(\"Location: \".BASE_URL.\"stock\");\n }\n else{ //SI LA CONTRASEÑA ES INCORRECTA\n $this->view->ShowLog(\"Contraseña incorrecta\");\n }\n\n }\n else{ //SI EL USUARIO NO EXISTE EN LA DB\n $this->view->ShowLog(\"El usuario no existe\"); \n }\n }\n }", "public function setLogin(){\n \n\t\t\t$obUser = Model::getUserByEmail($this->table, $this->camp,$this->email);\n\t\t\tif (!$obUser instanceof Model) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\tif (!password_verify($this->password, $obUser->senha)) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\t\n\t\t\t$this->session($obUser);\n\n\t\t\theader('location: '.$this->location);\n\t\t\texit;\n\n\t\t}", "function verificalogin(){\n if(!isset($this->session->datosusu)){\n return true;\n }\n }", "function _genLogin()\n {\n $this->mismatch = false;\n if (isset($_POST['login']) && $this->_verify() == \"\") {\n $this->name_post = $_POST['gebruikersnaam'];\n $this->pass_post = $_POST['wachtwoord'];\n\n $this->_getFromGebruikersDb($this->name_post);\n if ($this->_isMatch()) {\n $_SESSION['ingelogd'] = true;\n //toegevoegd door rens om een gebruikersnaam en rol te krijgen\n $_SESSION['gebruikersnaam'] = $this->name_post;\n $_SESSION['Rol'] = $this->role_db;\n header('location: Login_Redir.php');\n }\n }\n }", "public function signin(){\r\n if(isset($_SESSION['user'])){\r\n if(isset($_POST['mail']) && isset($_POST['password'])){\r\n $mail = $_POST['mail']; \r\n $password = $_POST['password'];\r\n \r\n if($this->user->setMail($mail) && $this->user->setPassword($password)){\r\n $this->user->db_set_Users($this->user);\r\n die(\"REGISTRO EXITOSO\");\r\n }else{\r\n die(\"ERROR AL REALIZAR EL REGISTRO\");\r\n }\r\n }\r\n }else{\r\n die(\"ERROR AL REQUEST ERRONEO\");\r\n }\r\n }", "public function login(){\n\n if(isset($_POST)){\n \n /* identificar al usuario */\n /* consulta a la base de datos */\n $usuario = new Usuario();\n \n $usuario->setEmail($_POST[\"email\"]);\n $usuario->setPassword($_POST[\"password\"]);\n \n $identity = $usuario->login();\n \n\n if($identity && is_object($identity)){\n \n $_SESSION[\"identity\"]= $identity;\n\n if($identity->rol == \"admin\"){\n var_dump($identity->rol);\n\n $_SESSION[\"admin\"] = true;\n }\n }else{\n $_SESSION[\"error_login\"] = \"identificacion fallida\";\n }\n\n\n /* crear una sesion */\n \n }\n /* redireccion */\n header(\"Location:\".base_url);\n\n }", "public function ConnectUsers(){\r\n $this->emailPost();\r\n $this->passwordPost();\r\n \r\n $_SESSION['email'] = $this->_emailPostSecure;\r\n $_SESSION['password'] = $this->_passwordPostSecure;\r\n header('location: Accueil');\r\n }", "public function check_auth()\n {\n if (isset($_SESSION['atk_email'])) {\n redirect(base_url().\"permintaan/\");\n }\n }", "public function checkUsersSession(){\n\t}", "function confirmAuth()\n{\n $login = $this->session->get(USER_LOGIN_VAR);\n$password = $this->session->get(USER_PASSW_VAR);\n$hashKey = $this->session->get('login_hash');\nif (md5($this->hashKey . $login . $password) != $hashKey)\n{\n$this->logout(true);\n}\n}", "public function Save()\n\t{\n\t\tinclude(\"Connection.php\");\n\t\tif(!$link->connect_error)\n\t\t{\n\t\t\t\t$saveUserSql = \"INSERT INTO Gebruiker (Naam, Paswoord, Email) \n\t\t\t\tVALUES ('\".$link->real_escape_string($this->Name).\"',\n\t\t\t\t'\".$link->real_escape_string(md5($this->Pass)).\"',\n\t\t\t\t'\".$link->real_escape_string($this->Email).\"'\n\t\t\t\t);\";\n\t\t\t\t\n\t\t\t\tif($link->query($saveUserSql))\n\t\t\t\t{\n\t\t\t\t\t//get the user ID from the user that was just saved\n\t\t\t\t\t$id = $link->insert_id;\n\t\t\t\t\t$_SESSION[\"UserID\"] = $id;\n\t\t\t\t\t$_SESSION[\"UserName\"] = $link->real_escape_string($this->Name);\n\t\t\t\t\tthrow new Exception(\"Alright! Je hebt een account!\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('Whoops, probleem bij het opslaan');\n\t\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//no connection with db\n\t\t\tthrow new Exception('Whoops, er is iets fout gelopen met de databank');\n\t\t}\n\t\t//return the user ID to use in a session\n\t\treturn $rResult;\n\t\tmysqli_close($link);\n\t}", "private function accesoUsuario()\n {\n if ($this->adminSession) {\n $usuario = $this->session->userdata('admin');\n if ($usuario['id'] > 0) {\n redirect('admin/dashboard');\n } else {\n $this->adminSession = false;\n $this->session->sess_destroy();\n redirect('admin/index'); \n }\n }\n }", "public function authUser(){\n if(!isset($this->sessionBool) || empty($this->sessionBool)){\n die($this->alerts->ACCESS_DENIED);\n }else{\n if(!$this->sessionBool){\n die($this->alerts->ACCESS_DENIED);\n }\n } \n }", "function checkLogin() {\n /* Check if user has been remembered */\n if (isset($_COOKIE['cook_VenusetP_UserEmail']) && isset($_COOKIE['cook_Venueset_UserPassword'])) {\n $varUserEmail = $_COOKIE['cook_VenusetP_UserEmail'];\n $varUserPassword = $_COOKIE['cook_Venueset_UserPassword'];\n /* Confirm that username and password are valid */\n $arrUserFlds = array('pkUserID', 'UserEmail', 'UserPassword', 'UserFirstName');\n $varUserWhere = ' 1 AND UserEmail = \\'' . $varUserEmail . '\\' AND UserPassword = \\'' . md5(trim($varUserPassword)) . '\\'';\n //echo '<pre>';print_r($varUserWhere);exit;\n $arrUserList = $this->select(TABLE_USERS, $arrUserFlds, $varUserWhere);\n if (count($arrUserList) > 0) {\n /* $_SESSION['VenusetP_UserEmail'] = $arrUserList[0]['UserEmail'];\n $_SESSION['VenusetP_UserID'] = $arrUserList[0]['pkUserID'];\n $_SESSION['VenusetP_UserName'] = $arrUserList[0]['UserFirstName']; */\n }\n return true;\n } else {\n return false;\n }\n }", "function superRecuiterLogin()\n\t{\n\t\t$username = $_POST['user_email'];\n\t\t$password = md5($_POST['password']);\n\t\t$login=$this->db->query(\"select * from `supper_recruiter` where `email`='$username' and `password`='$password' AND `status`='1' \");\n\t\t$rowcount=$login->rowCount($login); \n\t\t$singlRc=$login->fetchAll();\t\t \n\t\tif($rowcount>0)\n\t\t{\n\t\t$fetch_singel=$singlRc[0]; \n\t\t$encripted = base64_encode($fetch_singel['id']);\n echo \"\n <script type=\\\"text/javascript\\\"> \n\t\t window.location='super-recruiter?srid=$encripted';\n </script>\n \";\t\t\n\t\t}\n\t\telse\n\t\treturn \"<span style='color:red;font-size: 16px;font-weight:600'>User ID or Password is Incorrect</span>\";\t\t\n\t}", "function signup($name, $email, $pwd, $pwdr, $users){\n $check = $users->getUser(0, $name);\n if($check != NULL){\n echo \"<script>alert(\\\" Uživatel s tímto jménem už existuje \\\");</script>\";\n echo \"<script> window.history.back(); </script>\";\n }\n \n if($pwd != $pwdr){\n echo \"<script>alert(\\\" Hesla se neshodují \\\");</script>\";\n echo \"<script> window.history.back(); </script>\";\n }\n else{\n $pwd = md5($pwd);\n $users->insertUser($name, $email, $pwd);\n echo \"<script> window.history.back(); </script>\";\n }\n}", "public function login() {\n\t\t$this -> load -> model('models_events254/m_clients');\n\t\t$this -> m_clients -> getUser();\n\t\tif ($this -> m_clients -> isUser == 'true') {\n\n\t\t\n\t\t\t/*create session data*/\n\t\t\t$newdata = array('email' => $this -> m_clients -> email, 'logged_in' => TRUE,'id' => $this ->m_clients->id);\n\t\t\t$this -> session -> set_userdata($newdata);\n\n\t\t\tredirect(base_url() . 'C_front/index', 'refresh');\n\t\n\n\t\t} else {\n\t\t\t#use an ajax request and not a whole refresh\n\t\t\t\n\t\t\t$data['message']=\"User Not Found\";\n\t\t\t$data['messageType']=\"error\";\n\t\t\t\n\t\t\t$this->load->view('login',$data);\n\t\t}\n\t}", "function loginUser() {\n $email = htmlspecialchars(trim($_POST['email']), ENT_QUOTES);\n $password = htmlspecialchars(trim($_POST['password']), ENT_QUOTES);\n \n connectDatabase();\n \n $result = queryDatabase(\"SELECT pk\n FROM user\n WHERE email = '$email' AND\n password = '$password' AND\n active = 1\");\n\n if (mysql_num_rows($result) == 1) {\n $row = mysql_fetch_object($result);\n $date = date('Y-m-d');\n \n queryDatabase(\"UPDATE user SET last_login = '$date' WHERE pk = $row->pk\");\n $_SESSION['pk'] = crypt($row->pk, SALT);\n\n header('Location: ' . HOME . 'member.php?feedback=9');\n } else {\n $result = queryDatabase(\"SELECT pk\n FROM user\n WHERE email = '$email' AND\n password = '$password' AND\n active = 0\");\n\n if (mysql_num_rows($result) >= 1)\n header('Location: ' . HOME . 'login.php?feedback=2');\n else\n header('Location: ' . HOME . 'login.php?feedback=1');\n }\n}", "static public function ctrIngresoUsuario(){\n\t\t\n\t\tif (isset($_POST['user']) && isset($_POST['pass'])) {\n\t\t\tif (preg_match('/^[a-zA-Z-0-9 ]+$/', $_POST['user'])) {\n\t\t\t\tswitch ($_POST['rol']) {\n\t\t\t\t\tcase 'Encargado':\n\t\t\t\t\t\t$answer = adminph\\Attendant::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Propietario':\n\t\t\t\t\t\t$answer = adminph\\Propietary::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Arrendatario':\n\t\t\t\t\t\t$answer = adminph\\Lessee::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$answer = adminph\\User::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$password = $_POST[\"pass\"];\n\t\t\t\tif (is_object($answer)) {\n\t\t\t\t\tif (password_verify($password,$answer->password) ) {\n\t\t\t\t\t\tif ($answer->state == 1) {\n\t\t\t\t\t\t\tif ($_POST['rol'] == 'Otro') {\n\t\t\t\t\t\t\t\tsession(['rank' => $answer->type]);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tsession(['rank' => $_POST['rol']]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsession(['user' => $answer->username]);\n\t\t\t\t\t\t\tsession(['name' => $answer->name]);\n\t\t\t\t\t\t\tsession(['id' => $answer->id]);\n\t\t\t\t\t\t\tsession(['photo' => $answer->photo]);\n\t\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\t= REGISTRAR LOGIN =\n\t\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t\tdate_default_timezone_set('America/Bogota');\n\t\t\t\t\t\t\tsession(['log' => date(\"Y-m-d h:i:s\")]);\n\t\t\t\t\t\t\t$answer->last_log = session('log');\n\t\t\t\t\t\t\tif ($answer->save()) {\n\t\t\t\t\t\t\t\techo ' <script>\n\t\t\t\t\t\t\twindow.location = \"inicio\"; </script> ';\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\techo '<br><div class=\"alert alert-warning\" style=\"text-align: center;\" >Este usuario se encuentra desactivado, por favor contacte al administrador.</div>';\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\techo '<head><style type=\"text/css\" media=\"screen\">body{background:#4a6886;color:#fff;}</style></head><body><div class=\"alert alert-warning\" style=\"text-align: center; font-size: 30px;margin-top:15%\" >Las credenciales ingresadas no son correctas.</div><br><br><div style=\"text-align: center; margin-left: 35%;margin-top:5%; width:30%;background:#E75300; padding: 10px;\"><a href=\"/\"> <span style=\" font-size: 18px; color: #fff\"><b>Volver al inicio</b></span> </a></div></body>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function auth()\n {\n $email = $this->loginEntry->input('email');\n $password = $this->commonFunction->generateHash($this->loginEntry->input('pass'));\n \n $info = $this->userDetail->getDetail($email, $password);\n if (count($info) == 1) \n {\n $this->commonFunction->setSession($info->id, $info->user_name);\n return redirect('/dashboard'); \n } \n echo '<script language=\"javascript\">';\n echo 'alert(\"Username/Password does not match.\")';\n echo '</script>';\n return redirect('/login');\n }", "function fechar_janela_conversa_chat(){\n\n// seta usuario de chat de sessao\n$_SESSION[CONFIG_MD5_IDUSUARIO_CHAT] = null;\n\n}", "function loginUser($conn, $gebruikersnaam, $password){\n $gebruikerExists = gebruikersnaamExists($conn, $gebruikersnaam, $gebruikersnaam);\n\n if ($gebruikerExists === false) {\n header(\"location: ../loginpage.php?error=wronglogin\");\n exit();\n }\n\n $pwdHashed = $gebruikerExists[\"password\"];\n $checkPassword = password_verify($password, $pwdHashed);\n\n if ($checkPassword === false){\n header(\"location: ../loginpage.php?error=wronglogin\");\n exit();\n }\n else if ($checkPassword === true){\n session_start();\n $_SESSION[\"userID\"] = $gebruikerExists[\"userID\"];\n $_SESSION[\"username\"] = $gebruikerExists[\"username\"];\n $_SESSION[\"email\"] = $gebruikerExists[\"email\"];\n $_SESSION[\"creationDate\"] = $gebruikerExists[\"creationDate\"];\n header(\"location: ../home.php\");\n exit();\n }\n}", "public function login() {\n $this->db->sql = 'SELECT * FROM '.$this->db->dbTbl['users'].' WHERE username = :username LIMIT 1';\n\n $user = $this->db->fetch(array(\n ':username' => $this->getData('un')\n ));\n\n if($user['hash'] === $this->hashPw($user['salt'], $this->getData('pw'))) {\n $this->sessionId = md5($user['id']);\n $_SESSION['user'] = $user['username'];\n $_SESSION['valid'] = true;\n $this->output = array(\n 'success' => true,\n 'sKey' => $this->sessionId\n );\n } else {\n $this->logout();\n $this->output = array(\n 'success' => false,\n 'key' => 'WfzBq'\n );\n }\n\n $this->renderOutput();\n }", "function ConfirmSession ()\n {\n // Get session info\n $this->username = isset( $_SESSION [ \"username\" ] ) ? $_SESSION [ \"username\" ] : null;\n $this->sessionid = isset( $_SESSION [ \"sessionid\" ] ) ? $_SESSION [ \"sessionid\" ] : null;\n $this->remember = isset( $_SESSION [ \"remember\" ] ) ? $_SESSION [ \"remember\" ] : 0;\n\n // Check cookie if no session is available\n if ( !$this->username || !$this->sessionid ) {\n $this->username = isset( $_COOKIE [ \"username\" ] ) ? $_COOKIE [ \"username\" ] : null;\n $this->sessionid = isset( $_COOKIE [ \"sessionid\" ] ) ? $_COOKIE [ \"sessionid\" ] : null;\n $this->remember = isset( $_COOKIE [ \"remember\" ] ) ? $_COOKIE [ \"remember\" ] : 0;\n }\n\n // Get user info\n $this->mongo->setCollection( COLLECTION_ADMINS );\n $currentsessionid = $this->mongo->dataFindOne( array( \"username\" => $this->username, \"active\" => 1 ), array( \"sessionid\" => 1 ) );\n if ( !isset( $currentsessionid[ \"sessionid\" ] ) || $currentsessionid[ \"sessionid\" ] == \"...\" ) {\n return false;\n } else {\n $currentsessionid = $currentsessionid[ \"sessionid\" ];\n }\n\n // If user's session is the same\n if ( $this->sessionid && $currentsessionid && $this->sessionid == $currentsessionid ) {\n $_SESSION [ \"username\" ] = $this->username;\n $_SESSION [ \"sessionid\" ] = $this->sessionid;\n $_SESSION [ \"remember\" ] = $this->remember;\n\n // Update user time\n $this->mongo->setCollection( COLLECTION_ADMINS );\n $this->mongo->dataUpdate( array( \"username\" => $this->username ), array( '$set' => array( \"lastaccess\" => date( 'Y-m-d H:i:s' ) ) ) );\n\n return true;\n } else {\n return false;\n }\n }", "function validateUser() {\n if (!isset($_SESSION['pk']))\n header('Location: ' . HOME . 'login.php?feedback=7');\n}", "private function gebruikerToevoegenAction()\n {\n //controlleert of er een formulier is ingevuld\n if (isset($_POST) && !empty($_POST))\n {\n //kijkt of de gebruikersnaam al bestaat en geeft dan een boolean terug\n $bestaatGN = $this->model->bestaatGN();\n //false als de gebruikersnaam niet bestaat\n if ($bestaatGN === FALSE)\n {\n //controleert of de wachtwoorden overeenkomen\n if ($_POST['wachtwoord'] === $_POST['wachtwoord2'])\n {\n $id = $this->model->maakGebruiker();\n if (isset($_FILES['foto']))\n {\n $this->model->updateFoto($id);\n }\n //stuurt je naar de gebruikersbeheer pagina\n $this->model->foutGoedMelding('success', '<strong>Gelukt!</strong> gebruiker is aangemaakt. <span class=\"glyphicon glyphicon-saved\"></span>');\n $this->model->setLog('Gebruiker toevoegen', 'Gelukt');\n $this->forward('gebruikersBeheer', 'admin');\n } else\n {\n $this->view->set('opmerking', 'Wachtwoorden komen niet overeen');\n }\n } else\n {\n $this->view->set('opmerking', 'Gebruikersnaam is al in gebruik');\n }\n }\n }", "static public function ctrIngresoUsuario()\n {\n\n if (isset($_POST['ingEmail'])) {\n if (\n preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/', $_POST[\"ingEmail\"]) &&\n preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"])\n ) {\n\n\n $encriptar = crypt($_POST[\"ingPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n $tabla = \"usuarios\";\n $item = \"email\";\n $valor = $_POST[\"ingEmail\"];\n\n $respuesta = ModeloUsuarios::mdlMostrarUsuario($tabla, $item, $valor);\n\n /*Validacion junto con la BD*/\n if ($respuesta[\"email\"] == $_POST[\"ingEmail\"] && $respuesta[\"password\"] == $encriptar) {\n //validacion con la BD si ya esta verficado el email\n if ($respuesta['verificacion'] == 1) {\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡NO HA VERIFICADO SU CORREO ELECTRONICO!\",\n\t\t\t\t\t\t\t\t text: \"¡Por favor revise la bandeja de entrada o la carpeta de SPAM, para verifcar la direccion de correo electronico ' . $_POST[\"ingEmail\"] . '\" ,\n\t\t\t\t\t\t\t\t type:\"error\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t }\n\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</script>';\n } else {\n\n /*Variables de sesion*/\n\n @session_start();\n $_SESSION['validarSesion'] = 'ok';\n $_SESSION['id'] = $respuesta['id'];\n $_SESSION['nombre'] = $respuesta['nombre'];\n $_SESSION['foto'] = $respuesta['foto'];\n $_SESSION['email'] = $respuesta['email'];\n $_SESSION['password'] = $respuesta['password'];\n $_SESSION['modo'] = $respuesta['modo'];\n\n //Utilizando del local storgae, alcenamos la ruta, para cuando inicie sesion, sea redireccionado hacia la ruta\n echo '\n <script> \n window.location = localStorage.getItem(\"rutaActual\");\n </script>\n ';\n\n\n }\n } else {\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡ERROR AL INGRESAR!\",\n\t\t\t\t\t\t\t\t text: \"¡Por favor revise el correo electronico, o la contraseña\" ,\n\t\t\t\t\t\t\t\t type:\"error\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t window.location = localStorage.getItem(\"rutaActual\");\n\t\t\t\t\t\t\t }\n\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</script>';\n }\n\n\n } else {\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡ERROR!\",\n\t\t\t\t\t\t\t\t text: \"¡Error al ingresar al sistema, no se permiten caracteres especiales\",\n\t\t\t\t\t\t\t\t type:\"error\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t }\n\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</script>';\n }\n }\n\n\n }", "public function saveToSession()\n {\n $_SESSION[PMF_SESSION_CURRENT_USER] = $this->getUserId();\n }", "function checkPermissionAdmin() \n\t{\n\t \n\t if(!isset($_SESSION['admin']['id']))\n\t {\n $this->Session->setFlash('Please sign in to view this page.');\n \t//$this->flash(__('Session Expired!!', true), array('controller'=>'admins','action'=>'adminLogin'));\n\t\t $this->redirect(array('controller'=>'admins','action'=>'login'), null, true);\n\t }\n\t}", "protected function checkUser() {\n if(!$this->session->userdata(\"usuario_id\")) {\n redirect(\"/login\");\n }\n }", "public function verificar_sessao() {\n if ($this->session->userdata('logado') == false)\n redirect('dashboard/login');\n }", "function verif_utilisateur(){\r\n\tglobal $db;\r\n\tif(isset ($_POST['id_user']) AND ($_POST['pass'])){\r\n\t\t\r\n\techo 'test1';\r\n\t$id_user = htmlspecialchars($_POST['id_user']);\r\n\t$pass = htmlspecialchars($_POST['pass']);\r\n\r\n\t// Hachage du mot de passe\r\n\t$pass_hache=sha1($_POST['pass']);\r\n\r\n\t//verif des identifiant\r\n\t$req=$db->prepare('SELECT id_user, passcri FROM login WHERE id_user=:id_user AND passcri=:passcri');\r\n\t$req->execute(array(\r\n\t'id_user'=>$id_user,\r\n\t'passcri'=>$pass_hache));\r\n\r\n\t$resultat=$req->fetch();\r\n\r\n\tif(!$resultat){\r\n\t\techo 'Mauvais identifiant ou mot de passe !';\r\n\t}\r\n\telse{\r\n\t\t$_SESSION['id_user'] = $resultat['id_user'];\r\n\t\t$_SESSION['pass'] = $resultat['passcri'];\r\n\t\techo 'Vous étes connecté!';\r\n\t}\r\n\theader('Location: login.php');\r\n\treturn $req;\r\n\t}\r\n}", "private function synchronize()\n {\n $_SESSION['user'] = $this->user;\n }", "private function logInSUUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(1646);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $this->user->setOpRoles('cclavoisier01.in2p3.fr');\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }", "public function login(){\n\t\t$this->user = $this->user->checkCredentials();\n\t\t$this->user = array_pop($this->user);\n\t\tif($this->user) {\n\t\t\t$_SESSION['id'] = $this->user['id'];\n\t\t\t$_SESSION['name'] = $this->user['name'];\n\t\t\t$_SESSION['admin'] = $this->user['admin'];\n\t\t\t$this->isAdmin();\n\t \t\theader('location: ../view/home.php');\n\t \t\texit;\n\t \t}\n\t\t$dados = array('msg' => 'Usuário ou senha incorreto!', 'type' => parent::$error);\n\t\t$_SESSION['data'] = $dados;\n\t\theader('location: ../view/login.php');\n \t\texit;\n\t}", "function iniciar_sesion($id_user, $pass){\n\t\t\t//if ( no lo encontro )\n\t\t\t\t//return false;\n\t\t\t$_SESSION['id_usuario'] = $id_usuario;\n\t\t\t$_SESSION['tipo'] = $type;\n\t\t\t$_SESSION['usuario'] = $usuario;\n\t\t\treturn true;\n\t\t}", "public function checkSession()\r\n {\r\n if(!$this->admin->sCheckUser())\r\n {\r\n return $this->redirect(array(\r\n 'module' => 'frontend',\r\n 'controller' => 'account',\r\n 'action' => 'login',\r\n 'sTarget' => 'sKUZOOffer'\r\n ));\r\n }\r\n }", "function subRecuiterLogin()\n\t{\n\t\t$username = $_POST['user_email'];\n\t\t$password = md5($_POST['password']);\n\t\t$login=$this->db->query(\"select * from `sub_recruiter` where `email`='$username' and `password`='$password' AND `status`='1' \");\n\t\t$rowcount=$login->rowCount($login); \n\t\t$singlRc=$login->fetchAll();\t\t \n\t\tif($rowcount>0)\n\t\t{\n\t\t$fetch_singel=$singlRc[0]; \n\t\t$encripted = base64_encode($fetch_singel['id']);\n echo \"\n <script type=\\\"text/javascript\\\"> \n\t\t window.location='sub-recruiter-dashboard?subrid=$encripted';\n </script>\n \";\t\t\n\t\t}\n\t\telse\n\t\treturn \"<span style='color:red;font-size: 16px;font-weight:600'>User ID or Password is Incorrect</span>\";\t\t\n\t}", "public function regenerateSession(){\n $authToken=$_COOKIE[self::COOKIENAME];\n if ($authToken){\n $authToken=base64_decode($authToken);\n $iv = substr($authToken,0,self::IVLEN);\n $crypted = substr($authToken,self::IVLEN);\n $token = openssl_decrypt($crypted, self::ALG, self::AESKEY,OPENSSL_RAW_DATA,$iv);\n if ($token===false){\n $this->__destruct();\n die('Decryption error');\n }\n\t $token = json_decode($token,true);\n\t $username=$token[\"loggedUser\"];\n\t // shoutout error if decryption failed\n\n // if user exists in backend storage\n if ($this->userExists($username)){\n $this->loggedUser=$username;\n $this->authToken=$_COOKIE[self::COOKIENAME];\n // reset cookie (to set new expiration date)\n $this->setAuthCookie();\n }\n else\n // logout if user does not exists in backend storage\n $this->logOut();\n }\n // no cookie - logout\n else $this->logOut();\n }", "public function iniciar() {\r\n session_regenerate_id();\r\n }", "function authEstaAutenticado() {\n return isset($_SESSION['usuario_admin']);\n}", "function estaLogueado() {\n return isset($_SESSION[\"email\"]);\n }", "function connexionAdmin($mail, $pass){ \n $usersManager = new \\Project\\Models\\UsersManager();\n $connexionAd = $usersManager->recupInfosConnexion($mail, $pass);\n $result = $connexionAd->fetch();\n\n // Compare les mots de passe entre la BDD et le champ\n $isPasswordCorrect = password_verify($pass, $result['pass']);\n\n \n $_SESSION['pseudo'] = $result['pseudo'];\n $_SESSION['lastname'] = $result['lastname'];\n $_SESSION['firstname'] = $result['firstname'];\n $_SESSION['email'] = $result['email'];\n $_SESSION['pass'] = $result['pass'];\n $_SESSION['id'] = $result['id'];\n $_SESSION['roleusers'] = $result['roleusers'];\n\n if($isPasswordCorrect){\n require 'app/views/back/dashboard.php';\n }else{\n echo 'Vos informations sont incorrectes';\n }\n\n }", "private static function login() {\n if ( !self::validatePost() ) {\n return;\n }\n $_POST['email'] = strtolower($_POST['email']);\n \n $password = Helper::hash($_POST['password'].$_POST['email']);\n \n $result = Database::getUser($_POST['email'],$password);\n \n if ( $result === false || !is_array($result) ) {\n self::setError('Unbekannter Benutzername oder Passwort!<br>');\n return;\n }\n \n if ( count($result) != 1 ) {\n self::setError('Unbekannter Benutzername oder Passwort!<br>');\n return;\n }\n \n $_SESSION['user']['id'] = $result[0]['id'];\n $_SESSION['user']['email'] = $result[0]['email'];\n $_SESSION['user']['nickname'] = $result[0]['nickname'];\n $_SESSION['user']['verified'] = $result[0]['verified'];\n $_SESSION['user']['moderator'] = $result[0]['moderator'];\n $_SESSION['user']['supermoderator'] = $result[0]['supermoderator'];\n $_SESSION['loggedin'] = true;\n self::$loggedin = true;\n }", "function user_regenerate_password() {\n\t\t$this->left_menu_list = array();\n\t\t\n\t\tif (isset($this->data)) {\n\t\t\t$user = $this->User->find('first', array(\n\t\t\t\t'conditions' => array('User.email' => $this->data['User']['email']),\n\t\t\t\t'contain' => array()\n\t\t\t));\n\t\t\tif (empty($user)) {\n\t\t\t\t$this->Session->setFlash('Uživatel se zadanou emailovou adresou neexistuje.');\n\t\t\t} else {\n\t\t\t\t// udelam hash, pomoci ktereho budu moci identifikovat uzivatele a zaslu ho na jeho emailovou adresu (v dane url)\n\t\t\t\t$hash = $this->User->createHash($user);\n\t\t\t\tif ($this->User->sendHash($user, $hash)) {\n\t\t\t\t\t$this->Session->setFlash('Výzva k potvrzení změny hesla byla odeslána.');\n\t\t\t\t} else {\n\t\t\t\t\t$this->Session->setFlash('Výzvu k potvrzení změny hesla se nepodařilo odeslat.');\n\t\t\t\t}\n\t\t\t\t$this->redirect(array('controller' => 'users', 'action' => 'login'));\n\t\t\t}\n\t\t}\n\t}", "static public function ctrIngresoUsuario()\n{ \n if(isset($_POST[\"ingUsuario\"]))\n {\n\n if(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingUsuario\"]) && preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"])) {\n\n\n //$encriptar = crypt($_POST[\"ingPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n\t\t\t//print_r($_POST);\n $tabla = \"usuarios\";\n $item= \"codusuario\";\n $valor= $_POST[\"ingUsuario\"];\t\t\t\t\n\n $respuesta = ModeloUsuarios::mdlMostrarUsuarios($tabla, $item, $valor );\n\n if($respuesta[\"codusuario\"] == $_POST[\"ingUsuario\"] && $respuesta[\"clave\"] == $_POST[\"ingPassword\"] ){\n\n if($respuesta[\"bloqueado\"] == 0 ) {\n $_SESSION[\"iniciarSesion\"] = \"ok\";\n $_SESSION[\"id\"] = $respuesta[\"codusuario\"];\n $_SESSION[\"nombre\"] = $respuesta[\"nomusuario\"];\n $_SESSION[\"usuario\"] = $respuesta[\"codusuario\"];\n $_SESSION[\"perfil\"] = $respuesta[\"codperfil\"];\n $_SESSION[\"foto\"] = \"\";\n $_SESSION[\"id_local\"] = 1;\n\n date_default_timezone_set('America/Bogota');\n $fecha = date('Y-m-d');\n $hora = date('H:i:s');\n $fechaActual = $fecha.' '.$hora;\n\n $tabla = 'usuarios';\n $item1 = 'fecingreso';\n $valor1 = $fechaActual ;\n $item2 = 'codusuario';\n $valor2= $respuesta[\"codusuario\"] ;\n $respuestaUltimoLogin = ModeloUsuarios::mdlActualizarUsuario($tabla,$item1, $valor1, $item2, $valor2 );\n\n if($respuestaUltimoLogin == \"ok\")\n {\n echo '<script> window.location = \"inicio\"</script>';\n\n }\n\n } \n else \n echo '<br><div class=\"alert alert-danger\">El usuario no se encuentra activado.</div>';\n\n }else {\n\n echo '<br><div class=\"alert alert-danger\">Error al ingresar vuelve a intentarlo.</div>';\n }\t\t\t\t\n\n }//\n\n }\n\n}", "function EstoyLogueado()\n\t{\n\t\tif (!isset($_SESSION['clientecod']) || $_SESSION['clientecod']==0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function isGerechtigd()\n {\n if(isset($_SESSION['gebruiker'])&&!empty($_SESSION['gebruiker']))\n {\n $gebruiker=$_SESSION['gebruiker'];\n if ($gebruiker->getRecht() == \"medewerker\")\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n \n return false;\n \n \n }", "function loguear($usuario) {\n $_SESSION[\"idUser\"] = $usuario[\"id\"];\n }", "function loginUser($db, $emailadres, $wachtwoord) {\n\t$emailzonderhoofdletters = strtolower($emailadres);\n\t$takenEmail = takenEmail($db, $emailzonderhoofdletters);\n\t\n\tif ($takenEmail === false) {\n\t\theader(\"location: ../login.php?error=verkeerdeLogin\");\n\t\texit;\n\t}\n\n\t$encryptwachtwoord = $takenEmail[\"wachtwoord\"];\n\n\t$checkwachtwoord = password_verify($wachtwoord, $encryptwachtwoord);\n\t\n\tif ($checkwachtwoord === false) {\n\t\theader(\"location: ../login.php?error=verkeerdeLogin\");\n\t\texit;\n\t}elseif ($checkwachtwoord === true) {\n\t\tsession_start();\n\n\t\t$_SESSION[\"klantnummer\"] = $takenEmail[\"klantnummer\"];\n\t\t$_SESSION[\"voornaam\"] = $takenEmail[\"voornaam\"];\n\t\t$_SESSION[\"achternaam\"] = $takenEmail[\"achternaam\"];\n\t\t$_SESSION[\"email\"] = $takenEmail[\"email\"];\n\t\t$_SESSION[\"telefoonnummer\"] = $takenEmail[\"telefoonnummer\"];\n\t\t$_SESSION[\"woonplaats\"] = $takenEmail[\"woonplaats\"];\n\t\t$_SESSION[\"postcode\"] = $takenEmail[\"postcode\"];\n\t\t$_SESSION[\"straatnaam\"] = $takenEmail[\"straatnaam\"];\n\t\t$_SESSION[\"huisnummer\"] = $takenEmail[\"huisnummer\"];\n\n\t\theader(\"location: ../index.php\");\n\t\texit;\n\t}\n}", "public function store() {\n\t\t$_SESSION['puserauth'] = serialize($this);\n\t}", "function log_in_user($admin,$option) {\r\n // Renerating the ID protects the admin from session fixation.\r\n session_regenerate_id();\r\n if($option==0)\r\n $_SESSION['admin_id'] = $admin['admin_id'];\r\n else\r\n $_SESSION['user_id'] = $admin['user_id'];\r\n $_SESSION['last_login'] = time();\r\n $_SESSION['username'] = $admin['username'];\r\n return true;\r\n}", "public function login() {\n parent::conectarBD();\n\n $queri = parent::query(sprintf(\"select usu_id as codigo, usu_password as senha, \"\n . \"usu_token_sessao as token_sessao, usu_login as login from \"\n . table_prefix . \"usuario where usu_login = '%s' and \"\n . \"usu_password = '%s'\", $this->usu_login, $this->usu_password));\n\n if ($queri) {\n $dados = $queri->fetch_assoc();\n if ($dados) {\n $new_session_id = hash('sha256', $dados['senha'] . time());\n $queri2 = parent::query(\"update \" . table_prefix . \"usuario set usu_token_sessao = '$new_session_id' where usu_id = \" . $dados['codigo']);\n\n if ($queri2) {\n $dados['token_sessao'] = $new_session_id;\n parent::commit();\n parent::desconectarBD();\n return $dados;\n } else {\n parent::rollback();\n parent::desconectarBD();\n return false;\n }\n } else {\n parent::desconectarBD();\n return false;\n }\n } else {\n parent::desconectarBD();\n return false;\n }\n }", "public function loginTraitement(){\n\n $identifiant = $this->verifierSaisie(\"identifiant\");\n $password = $this->verifierSaisie(\"password\");\n\n //securite\n if (($identifiant != \"\") && ($password != \"\")){\n\n //on crée un objet de la classe \\W\\Security\\AuthentificationModel\n //ce qui nous permet d'utiliser la methode isValidLoginInfo\n $objetAuthentificationModel = new \\W\\Security\\AuthentificationModel;\n\n $idUser = $objetAuthentificationModel->isValidLoginInfo($identifiant, $password);\n\n if($idUser > 0){\n\n // recuperer les infos de l'utilisateur\n //requete base de donnée pour les recuperer\n //je crée un objet de la classe \\W\\Model\\UsersModel\n $objetUsersModel = new \\W\\Model\\UsersModel;\n // je retrouve les infos de la ligne grace à la colonne ID\n // La classe UsersModel herite de la classe Model je peu donc faire un find pour recupeerr les infos\n $tabUser = $objetUsersModel->find($idUser);\n\n // Je vais ajouter des infos dans la session\n $objetAuthentificationModel->logUserIn($tabUser);\n\n // recuperer l'username\n $username = $tabUser[\"username\"];\n\n\n $GLOBALS[\"loginRetour\"] = \"Bienvenue $username\";\n\n $this->redirectToRoute(\"admin_accueil\");\n }\n else{\n $GLOBALS[\"loginRetour\"] = \"Identifiant incorrects \";\n }\n }else{\n\n $GLOBALS[\"loginRetour\"] = \"Identifiant incorrects \";\n }\n }", "function validar_sessao()\n{\n if (isset($_COOKIE[\"usuario\"])) {\n $_SESSION[\"usuario\"] = $_COOKIE[\"usuario\"];\n $_SESSION[\"nome\"] = $_COOKIE[\"nome\"];\n }\n if (!isset($_SESSION[\"usuario\"])) {\n $_SESSION[\"erros\"] = \"Favor efetuar o login\";\n echo \"<script>\n document.location=\\\"db_login.php\\\";\n </script>\";\n exit;\n }\n}", "public function signUpSubmit() {\n try {\n if (!$this->validate([\n 'email' => 'valid_email',\n 'password' => 'min_length[8]',\n ])) {\n return view(\"pages/SignUp\", ['errors' => $this->validator->getErrors()]);\n }\n $users = $this->doctrine->em->getRepository(\\App\\Models\\Entities\\Korisnik::class)\n ->findByUserName($this->request->getVar('username'));\n if ($users != null) {\n return view(\"pages/SignUp\", ['poruka' => 'Korisnicko ime je zauzeto']);\n }\n $users = $this->doctrine->em->getRepository(\\App\\Models\\Entities\\Korisnik::class)\n ->findByEmail($this->request->getVar('email'));\n if ($users != null) {\n $data['errorEmail'] = 'Email je zauzet';\n return view(\"pages/SignUp\", $data);\n }\n $user = new \\App\\Models\\Entities\\Korisnik();\n $user->setIme($this->request->getVar('name'));\n $user->setPrezime($this->request->getVar('surname'));\n $user->setMail($this->request->getVar('email'));\n $user->setKorisnickoime($this->request->getVar('username'));\n $user->setSifra($this->request->getVar('password'));\n $user->setTip(1);\n\n $this->doctrine->em->persist($user);\n\n $this->doctrine->em->flush();\n\n $this->session->set('theme', 'light');\n $this->session->set('korisnik', $user->getIdkorisnik());\n echo $this->session->get('korisnik');\n return redirect()->to(site_url('User'));\n } catch (\\Exception $e) {\n\n echo $e;\n }\n }", "private function telaRecuperaSenha() {\n //self::getObjSmarty()->assign(\"POST_LOGIN\",\"?c=\".self::getObjCrypt()->cryptData(\"Login\"));\n //$this->getObjJs()->addJs(FWK_JS.\"validaLogin.js\");\n try {\n //self::getObjHttp()->escreEm(\"RODAPE_LOGIN_ADMIN\",self::getRodapeRecuperaSenha());\n self::getObjHttp()->escreEm(\"CORPO\", self::getTplRecuperaSenha());\n } catch (HtmlException $e) {\n die(\"ViewAdminPage()->telaLogin(): \" . self::getTplRecuperaSenha() . $e->__toString());\n }\n }", "function loginController()\n {\n // SI la superglobal con el indice $_SESSION['email'] esta seteada\n if (isset($_SESSION[\"email\"])) {\n // Dame TRUE\n return true;\n } else {\n // O...\n if (isset($_COOKIE[\"email\"])) {\n // si la superglobal con el indice $_COOKIE['email']\n // esta seteada\n $_SESSION[\"email\"] = $_COOKIE[\"email\"];\n // Dame TRUE\n return true;\n } else {\n // Cualquier otra cosa, dame FALSE\n return false;\n }\n }\n }", "function Admin_authetic(){\n\t\t\t\n\t\tif(!$_SESSION['adminid']) {\n\t\t\t$this->redirectUrl(\"login.php\");\n\t\t}\n\t}", "function verifyAdmin(){\n\n $email = $_POST[\"input_email\"];\n $pass = $_POST[\"input_pass\"];\n\n if (isset($email)) {\n $userFromDB = $this->model->getAdministrador($email);\n if (isset($userFromDB) && $userFromDB) {\n if (password_verify($pass, $userFromDB->password)) {\n session_start();\n $_SESSION[\"EMAIL\"] = $userFromDB->email; \n header(\"Location:\" . BASE_URL . \"home\");\n }else {\n $this->view->showLogin(\"contraseña incorrecta\");\n }\n }else {\n $this->view->showLogin(\"el usuario no existe\");\n }\n }\n }", "function log_in($user) {\n session_regenerate_id();\n $_SESSION['user_id'] = $user['id'];\n $_SESSION['username'] = $user['username'];\n $_SESSION['email'] = $user['email'];\n return true;\n }", "public function login (){\n\n $dao = DAOFactory::getUsuarioDAO(); \n $GoogleID = $_POST['GoogleID']; \n $GoogleName = $_POST['GoogleName']; \n $GoogleImageURL = $_POST['GoogleImageURL']; \n $GoogleEmail = $_POST['GoogleEmail'];\n $usuario = $dao->queryByGoogle($GoogleID); \n if ($usuario == null){\n $usuario = new Usuario();\n $usuario->google = $GoogleID;\n $usuario->nombre = $GoogleName;\n $usuario->avatar = $GoogleImageURL;\n $usuario->correo = $GoogleEmail;\n print $dao->insert($usuario);\n $_SESSION[USUARIO] = serialize($usuario);\n //$usuario = unserialize($_SESSION[USUARIO]);\n } else {\n $_SESSION[USUARIO] = serialize($usuario);\n }\n }", "public function autenticar($usr,$pwd) {\n $pwd=\"'\".$pwd.\"'\";\n $sql= 'SELECT * FROM empleados WHERE (\"idEmpleado\" = '.$usr.') AND (dni = '.$pwd.');';\n $empleado=\"\";\n $result = pg_query($sql);\n\n if ($result){\n $registro = pg_fetch_object($result);\n $empleado = $registro->nombres . \" \" . $registro->apellido;\n session_start(); //una vez que se que la persona que se quiere loguear es alguien autorizado inicio la sesion\n //cargo en la variable de sesion los datos de la persona que se loguea\n $_SESSION[\"idEmpleado\"]=$registro->idEmpleado;\n $_SESSION[\"dni\"]=$registro->dni;\n $_SESSION[\"fechaInicio\"]=$registro->fechaInicio;\n $_SESSION[\"nombres\"]=$registro->nombres;\n $_SESSION[\"apellido\"]=$registro->apellido;\n $_SESSION[\"i_lav\"]=$registro->i_lav;\n $_SESSION[\"f_lav\"]=$registro->f_lav;\n $_SESSION[\"i_s\"]=$registro->i_s;\n $_SESSION[\"f_s\"]=$registro->f_s;\n $_SESSION[\"i_d\"]=$registro->i_d;\n $_SESSION[\"f_d\"]=$registro->f_d;\n //$_SESSION[\"iex_lav\"]=$registro->iex_lav;\n //$_SESSION[\"fex_lav\"]=$registro->fex_lav;\n }\n return $empleado;\n }", "public function authUser()\n {\n //я не знаю почему, что эти функции возвращают пустые строки...\n //$login = mysql_real_escape_string($_POST['login']);\n //$password = mysql_real_escape_string($_POST['password']);\n $login = $_POST['login'];\n $password = $_POST['password'];\n if(DBunit::checkLoginPassword($login, $password)){\n DBunit::createUserSession(DBunit::getUser($login, $password));\n return true;\n }\n else {\n return false;\n }\n }", "function registradoadmin(){\n\t\tif (isset($_SESSION[\"adminvalido\"])==false){\n\t\t\theader(\"Refresh: 0; URL=index.php\");\n\t\t\tob_end_flush();\n\t\t\texit();\n\t\t}\n\t}", "public function login2(){\n $row = $this->_usuarios->getUsuario1(\n $this->getAlphaNum('usuario2'),\n $this->getSql('pass2')\n );\n \n // si no existe la fila.\n if(!$row){\n echo \"Nombre y/o contraseña incorrectos\";\n exit;\n }\n \n //Inicia session y define las variables de session \n Session::set('autenticado', true);\n Session::set('usuario', $row['usuario']);\n Session::set('id_role', $row['role']);\n Session::set('nombre', $row['nombre']);\n Session::set('ape_pat', $row['ape_pat']);\n Session::set('ape_mat', $row['ape_mat']);\n Session::set('clave_cetpro', $row['cetpro']);\n Session::set('id_usuario', $row['id']);\n Session::set('admin', $this->_usuarios->checkAdmin());\n Session::set('tiempo', time());\n \n echo \"ok\";\n }", "private function klantGebruikerToevoegenAction()\n {\n //controlleert of er een formulier is ingevuld\n if (isset($_POST) && !empty($_POST))\n {\n //kijkt of de gebruikersnaam al bestaat en geeft dan een boolean terug\n $bestaatGN = $this->model->bestaatGN();\n //false als de gebruikersnaam niet bestaat\n if ($bestaatGN === FALSE)\n {\n //controleert of de wachtwoorden overeenkomen\n if ($_POST['wachtwoord'] === $_POST['wachtwoord2'])\n {\n $this->model->maakKlantGebruiker();\n //stuurt je naar de gebruikersbeheer pagina\n $this->model->foutGoedMelding('success', '<strong>Gelukt!</strong> klant gebruiker is aangemaakt. <span class=\"glyphicon glyphicon-saved\"></span>');\n $this->model->setLog('Klang gebruiker aanmaken', 1);\n $this->forward('gebruikersBeheer', 'admin');\n } else\n {\n $this->view->set('opmerking', 'Wachtwoorden komen niet overeen');\n }\n } else\n {\n $this->view->set('opmerking', 'Gebruikersnaam is al in gebruik');\n }\n }\n $klanten = $this->model->geefKlanten();\n $this->view->set('klanten', $klanten);\n }", "public function login($username,$password)\n {\n try\n {\n $stmt = $this->db->prepare(\"SELECT id,prenom,nom,email,password,pseudo,classe FROM users WHERE email=:email LIMIT 1\");\n $stmt->execute(array(\n 'email'=> mb_strtolower($username, 'UTF-8')\n ));\n $userRow = $stmt->fetch(PDO::FETCH_ASSOC);\n if($stmt->rowCount() > 0)\n {\n if(password_verify($password, $userRow['password']))\n {\n $session = md5(rand());\n $lastco = strftime('%d %B %Y à %H:%M');\n $updateMembre = $this->db->prepare('UPDATE users SET session=:session, lastco=:lastco WHERE email=:email');\n $updateMembre->execute(array(\n 'email' => $username,\n 'session' => $session,\n 'lastco' => $lastco\n ));\n $_SESSION['session'] = $session;\n $_SESSION['userid'] = $userRow['id'];\n $_SESSION['userpseudo'] = $userRow['prenom'].\" \".$userRow['nom'];\n $_SESSION['username'] = $userRow['pseudo'];\n $_SESSION['userclasse'] = $userRow['classe'];\n\n if(isset($_POST['rememberme'])) {\n $contentcook = $userRow['id'].\"===\".sha1($username.$_SERVER['REMOTE_ADDR']);\n setcookie('auth', $contentcook, time() + 3600 * 24 * 7, '/', 'www.interminale.fr.nf', false, true);\n }\n return true;\n }\n else\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n }\n catch(PDOException $e)\n {\n die('<h1>ERREUR LORS DE LA CONNEXION A LA BASE DE DONNEE. <br />REESAYEZ ULTERIEUREMENT</h1>');\n }\n }", "public function login(Request $request){\n $vouter= Vouter::where('email', $request->email)\n ->where('password',$request->password)\n ->first();\n if($vouter){\n session()->forget('vouter');\n session()->forget('partie');\n\n session(['vouter' => $vouter]);\n $partie = $vouter->partie()->first();\n session(['partie' => $partie]);\n // recuperer la liste des surveys encours\n $surveyController = new SurveyController();\n $surveys = $surveyController->index();\n VouterController::surveys();\n if($surveys){\n session()->forget('surveys');\n session(['surveys' => $surveys]);\n }\n\n\n\n return redirect('profile');\n }\n else{\n return redirect('login');\n }\n\n }", "private function sesja() {\r\n session_start();\r\n if (!isset($_SESSION['id'])) {\r\n $_SESSION['id'] = 0;\r\n }\r\n }", "public function authCliente(Request $data){\n //dd(\"jano\");\n try{\n \n $verificar = User::where('email', $data->correo)->first();\n\n\n if(count($verificar)>0 && $verificar->id_rol == 4){ /**\"eres vendedor institucional\"**/\n \n if (\\Auth::attempt(['email' => $data->correo, 'password' => $data->pass])) {\n \n return redirect('/inicio_cliente'); \n }\n return redirect()->back()->withErrors(['datos incorrectos, intente nuevamente']);\n }\n return redirect()->back();\n }catch (\\Illuminate\\Database\\QueryException $e) {\n return redirect()->back()->withErrors(['Algo no anda bien, posiblemente datos mal ingresados o no hay conexión']);\n } \n\n }", "public function doLogin(){\n $redirect =\"\";\n if(isset($_POST['staticEmail']) && isset($_POST['inputPassword']) && $_POST['staticEmail'] != \"\" && $_POST['inputPassword'] !=\"\")//check if the form is well fill\n {\n $userTabFilter=array(\n '$and' =>array(\n ['email' =>$_POST['staticEmail']],\n ['password' => sha1($_POST['inputPassword'])])\n );//For the filter used on UserManager\n\n $result = $this->_userManager->getUserByPassAndEmail($userTabFilter);\n if($result != null)//return null if the user doesn't exist in DB\n {\n \n $user= array(\n 'id' => $result->_id,\n 'email' => $result->email,\n 'password' => $result->password,\n 'firstname' => $result->firstname,\n 'lastname' => $result->lastname,\n 'pseudo' => $result->pseudo\n );//Filter used on UserManager\n \n $this->_user = $this->_userManager->createUser($user);//Create user, not in DB but, for the session var, as an object\n if($this->_user == 'null'){//In case the creation didn't work\n\n $_SESSION['userStateLogIn'] = ['res'=>'Une erreur a lieu lors de la connexion, veuillez reessayer plus tard.','couleur' => 'red'];//Session var to explain where the error came from\n $redirect = \"form\";//redirect to the form connection\n\n }else{//In case the connexion worked\n \n $_SESSION['userStateLogIn'] = ['res'=>'Connexion réussie','couleur' => 'green'];\n $redirect = \"calendrier\";//redirect to the calendar\n $_SESSION['user'] =$this->_user;//Init the session var user with the user created before\n }\n \n }else{\n $_SESSION['userStateLogIn'] = ['res'=>'Aucun compte avec votre identifiant et mot de passe existe.','couleur' => 'red'];//Session var to explain where the error came from\n $redirect = \"form\";//redirect to the form connection\n }\n\n }else{\n $_SESSION['userStateLogIn'] = ['res'=>'Veuillez remplir le formulaire correctement.','couleur' => 'red'];//Session var to explain where the error came from\n $redirect = \"form\";//redirect to the form connection\n }\n header(\"Location : ../{$this->_redirectTab[$redirect]}\");//proceed to redirection\n \n\n \n }", "public function checsession() {\n // using the default layout 'protected/views/layouts/main.php'\n $session = Yii::app()->session['isLoggedIn'];\n if(empty($session)){\n $this->redirect(Yii::app()->baseUrl.'/index.php');\n }\n }", "function trovasesiste($mycooker,$email){\n\n // QUI ERA NATO PERIL COOKIE INVECE PASSO LA SESSION\n $my=conntrue();\n\n $sql='SELECT * from utenti where ';\n\n // se passo il cookie\n // se il cooki o sessione che passo è presente nel DB\n if ($mycooker !=\"\"){\n $sql.= \"mycooker ='$mycooker' \" ;\n $result= $my -> query ($sql);\n\n }\n\n // $email Sarebbe il nome che l utente posta per fare login\n // QUI MI POPOLA SE CLICKKA UN NUOVO ENTRATO O SE IL NOME esiste nel DB\n\n if ($email !=\"\"){\n $sql.= \"email='$email' \" ;\n $result= $my -> query ($sql);\n // Se il nome non esiste\n if($row= mysqli_num_rows($result) == 0){\n?>\n<script type=\"text/javascript\" src='login.php?utentenein=<?php echo $email; ?>'></script>\n\n<?php exit ;\n\n }\n }\n\n // QUI PASSA SE L UTENTE ESISTE DA NOME O DA COOKIE ;; O SESSIONE AL MOMENT\n if($row= mysqli_num_rows($result) > 0 ){\n\n $risult=mysqli_fetch_array($result);\n\n // QUI MI PRENDO L ID DELL UTNTE CHE FA LOGIN\n $_SESSION['id_utente']=$risult['id_utente'];\n\n $cook=session_id();\n\n $sqlupdatecook =\"UPDATE utenti set mycooker='$cook' where id_utente='$_SESSION[id_utente]' \";\n\n $resultupdate = $my -> query ($sqlupdatecook);\n\n // SE OTTENGO UN NOME\n?>\n<script type=\"text/javascript\" src='login.php?utenteyaa=<?php echo $risult['email']; ?>'></script>\n<?php\n\n}else{\n// FINO A QUANDO NON OTTENGO un nome per accesso\n?>\n<script type=\"text/javascript\" src='login.php'></script>\n<?php\n\n}\n\n}", "public function login()\n\t{\n\t\t$mtg_login_failed = I18n::__('mtg_login_failed');\n\t\tR::selectDatabase('oxid');\n\t\t$sql = 'SELECT oxid, oxfname, oxlname FROM oxuser WHERE oxusername = ? AND oxactive = 1 AND oxpassword = MD5(CONCAT(?, UNHEX(oxpasssalt)))';\n\t\t$users = R::getAll($sql, array(\n\t\t\tFlight::request()->data->uname,\n\t\t\tFlight::request()->data->pw\n\t\t));\n\t\tR::selectDatabase('default');//before doing session stuff we have to return to db\n\t\tif ( ! empty($users) && count($users) == 1) {\n\t\t\t$_SESSION['oxuser'] = array(\n\t\t\t\t'id' => $users[0]['oxid'],\n\t\t\t\t'name' => $users[0]['oxfname'].' '.$users[0]['oxlname']\n\t\t\t);\n\t\t} else {\n\t\t\t$_SESSION['msg'] = $mtg_login_failed;\n\t\t}\n\t\t$this->redirect(Flight::request()->data->goto, true);\n\t}", "public function signInAction()\n {\n $userData = $this->manager->findOneBy(['username' => $this->httpParameters['login']]);\n\n //If no user were found, redirects\n if(empty($userData))\n {\n $this->response->redirect('/auth',HttpResponse::WRONG_LOGIN);\n }\n\n //Instantiates the user\n $user = new User($userData);\n\n //Checks if typed password matches user's password\n if($this->passwordMatch($this->httpParameters['loginPassword'],$user,'/auth'))\n {\n //Sets the user instance as a the new $_SESSION['user']\n $_SESSION['user'] = $user;\n\n $this->response->redirect('/admin');\n }\n }", "public function loginAction()\n {\n\t\t$_SESSION['authen'] = 1;\n\t\t\n\t\t\n\t\t// Si le visiteur est déjà identifié, on le redirige vers l'accueil\n\t\t\n\t\tif ($this->get('security.context')->isGranted('IS_AUTHENTICATED_REMEMBERED')) {\n\t\t\t\t\n\t\t\t// mise à jour de la session important pour les pages qui ne requiet pas d'authentification car impossible d'accéder aux informations d'authenltification\n\t\t\t/*if($this->getUser()->getUsername() != $this->getParameter('super_admin'))\n\t\t\treturn $this->redirect($this->generateUrl('cud_default_indexpage'));\n\t\t\telse*\n\t\t\treturn $this->redirect($this->generateUrl('cud_default_adminpage'));\n\t\t\t*/\n\t\t\treturn $this->redirect($this->generateUrl('alexandrie_frontend_homepage'));\n\t\t}\n\t\t\n\t\t$request = $this->getRequest();\n\t\t$session = $request->getSession();\n\t\t// On vérifie s'il y a des erreurs d'une précédente soumission du formulaire\n\t\tif ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {\n\t\t $error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR);\n\t\t} else {\n\t\t $error = $session->get(SecurityContext::AUTHENTICATION_ERROR);\n\t\t $session->remove(SecurityContext::AUTHENTICATION_ERROR);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$user = new User;\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t\n\t $form = $this->createForm(new RegisterType, $user);\n\t\t$setting = $this->config();\n\t\t\n\t\treturn $this->render('AlexandrieFrontendBundle:Default:login.html.twig',array(\n\t\t // Valeur du précédent nom d'utilisateur entré parl'internaute\n\t\t 'last_username' => $session->get(SecurityContext::LAST_USERNAME),\n\t\t 'error' => $error,\n\t\t 'form_user' => $form->createView(),\n\t\t 'setting'=>$setting));\n\t\t\n\t\t\n\t\t//return $this->render('LegiafricaFrontendBundle:Default:login.html.twig',array());\n }", "function formConnexion() {\n\t\tif (isset($_SESSION['id'])) {\n\t\t\theader(\"Location: ?module=accueil\");\n\t\t\texit();\n\t\t}\n\t\telse\n\t\t\t$this -> vue -> afficheConnexion('');\n\t}", "public function getGebruiker()\n {\n return KVDutil_Auth_Gebruiker::newNull();\n }", "function ajax_changePass(){\n $pass = md5($this->input->post('password'));\n if(strtoupper($this->session->password) != strtoupper($pass))\n {\n $this->session->sess_destroy();\n echo $this->Conexion->modificar('usuarios', array('password' => $pass), array('vencimiento_password' => 'CURRENT_TIMESTAMP() + INTERVAL 30 day'), array('id' => $this->session->id));\n }\n }", "function verificaLogin($errores,$db) {\r\n $email=$_POST['email'];\r\n $password=$_POST['password'];\r\n $encontreUsuario=false;\r\n $encontrePassword=false;\r\n $stmt=$db->prepare(\"SELECT * FROM jugadores where email=:email\");\r\n $stmt->bindValue(':email',$email);\r\n $stmt->execute();\r\n $consulta=$stmt->fetch(PDO::FETCH_ASSOC);\r\n if($consulta>0){\r\n $encontreUsuario=true;\r\n $contraseniaValida=password_verify($password,$consulta['password']);\r\n if($contraseniaValida){\r\n $_SESSION['usuario']=$consulta['usuario'];\r\n $_SESSION['nombre']=$consulta['name'];\r\n $_SESSION['previoLogueo']=false;\r\n $encontrePassword=true;\r\n header('Location: bienvenida.php');\r\n if(empty($errores)){\r\n if (!empty($_POST[\"guardar_clave\"])){\r\n setcookie(\"email\", $_POST['email'], time() + 365 * 24 * 60 * 60);\r\n echo $_COOKIE['email'];\r\n setcookie(\"password\", $_POST['password'], time() + 365 * 24 * 60 * 60);\r\n }\r\n else {\r\n if(isset($_COOKIE['email'])){\r\n setcookie('email',\"\");\r\n }\r\n if(isset($_COOKIE['password'])){\r\n setcookie('password',\"\");\r\n }\r\n }\r\n }\r\n }\r\n else{\r\n $errores[]=\"Verifique los datos\";\r\n return $errores;\r\n }\r\n }\r\n else {\r\n $errores[]=\"No existe el usuario\";\r\n return $errores;\r\n }\r\n /*foreach ($usuarioJSON as $usuario)\r\n {\r\n if ($usuario[\"email\"] == $_POST['email']){\r\n $encontreUsuario=true;\r\n //\r\n if(password_verify($_POST[\"password\"], $usuario[\"password\"])){\r\n $_SESSION['usuario']=$usuario['usuario'];\r\n $_SESSION['nombre']=$usuario['name'];\r\n $_SESSION['previoLogueo']=false;\r\n $encontrePassword=true;\r\n header('Location: bienvenida.php');\r\n if(empty($errores)){\r\n if (!empty($_POST[\"guardar_clave\"])){\r\n setcookie(\"email\", $_POST['email'], time() + 365 * 24 * 60 * 60);\r\n echo $_COOKIE['email'];\r\n setcookie(\"password\", $_POST['password'], time() + 365 * 24 * 60 * 60);\r\n }\r\n else {\r\n if(isset($_COOKIE['email'])){\r\n setcookie('email',\"\");\r\n }\r\n if(isset($_COOKIE['password'])){\r\n setcookie('password',\"\");\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if($encontreUsuario!=true){\r\n array_push($errores,'Por Favor verifique el nombre de usuario');\r\n }\r\n if ($encontrePassword!=true) {\r\n array_push($errores,'Contraseña incorrecta');\r\n }\r\n return $errores;*/\r\n}", "static public function ctrLoginUser(){ \n\t\t\tif(isset($_POST[\"ingUser\"])){\n\t\t\t\t//Intento de Logeo\n\t\t\t\tif((preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingUser\"]))\n\t\t\t\t && (preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"]))){\n\t\t\t\t\t\t$tabla = \"usuarios\";\t//Nombre de la Tabla\n\n\t\t\t\t\t\t$item = \"usuario\";\t\t//Columna a Verficar\n\t\t\t\t\t\t$valor = $_POST[\"ingUser\"];\n\n\t\t\t\t\t\t//Encriptar contraseña\n\t\t\t\t\t\t$crPassword = crypt($_POST[\"ingPassword\"], '$2a$08$abb55asfrga85df8g42g8fDDAS58olf973adfacmY28n05$');\n\n\t\t\t\t\t\t$respuesta = ModelUsers::mdlMostrarUsuarios($tabla, $item, $valor);\n\n\t\t\t\t\t\tif($respuesta[\"usuario\"] == $_POST[\"ingUser\"]\n\t\t\t\t\t\t\t&& $respuesta[\"password\"] == $crPassword){\n\t\t\t\t\t\t\t\tif($respuesta[\"estado\"] == '1'){\n\t\t\t\t\t\t\t\t\t//Coincide \n\t\t\t\t\t\t\t\t\t$_SESSION[\"login\"] = true;\n\t\t\t\t\t\t\t\t\t//Creamos variables de Sesion\n\t\t\t\t\t\t\t\t\t$_SESSION[\"user\"] = $respuesta;\n\t\t\t\t\t\t\t\t\t//Capturar Fecha y Hora de Login\n\t\t\t\t\t\t\t\t\tdate_default_timezone_set('America/Mexico_City');\n\t\t\t\t\t\t\t\t\t$fechaActual = date('Y-m-d H:i:s');\n\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t$item1 = \"ultimo_login\";\n\t\t\t\t\t\t\t\t\t$valor1 = $fechaActual;\n\t\t\t\t\t\t\t\t\t$item2 = \"id_usuario\";\n\t\t\t\t\t\t\t\t\t$valor2 = $respuesta[\"id_usuario\"];\n\n\t\t\t\t\t\t\t\t\t$ultimoLogin = ModelUsers::mdlActualizarUsuario($tabla, $item1, $valor1, $item2, $valor2);\n\n\t\t\t\t\t\t\t\t\tif($ultimoLogin)\t//Redireccionando\n\t\t\t\t\t\t\t\t\t\techo '<script>location.reload(true);</script>';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\techo '<br><div class=\"alert alert-danger\">El usuario no esta activado</div>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo '<br><div class=\"alert alert-danger\">Error al ingresar, vuelve a intentarlo</div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}", "function setBackendUserCookie($params, $parent = '')\t{\n\t\trequire_once (PATH_t3lib.'class.t3lib_befunc.php');\n\n\t\t$beGroup = $this->getBEgroup();\n\t\t\n\t\t\t// login user when tx_timtaw_login set\n\t\tif(t3lib_div::_GP('tx_timtaw_login') && $beGroup) {\n\t\t\tif($_COOKIE['be_typo_user']) {\n\t\t\t\t$sesId = $_COOKIE['be_typo_user'];\n\t\t\t} else {\n\t\t\t\t$sesId = substr(md5(uniqid('')),0,32);\t\t// New random sesseion id $sesId is made\n\t\t\t\tsetcookie('be_typo_user', $sesId, time()+3600, '/');\n\t\t\t\t$_COOKIE['be_typo_user'] = $sesId; // change cookie superglobal, else we need a refresh\n\t\t\t}\n\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('ses_id','be_sessions',\"ses_id='\".$sesId.\"'\");\n\n\t\t\tif(!$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t\t$ses_userid = $this->user['uid'] * (-1);\n\t\t\t\t$insertFields = array(\n\t\t\t\t\t'ses_id' => $sesId,\n\t\t\t\t\t'ses_name' => 'be_typo_user',\n\t\t\t\t\t'ses_iplock' => '[DISABLED]',\n\t\t\t\t\t'ses_hashlock' => t3lib_div::md5int(':'.t3lib_div::getIndpEnv('HTTP_USER_AGENT')),\n\t\t\t\t\t'ses_userid' => $ses_userid,\n\t\t\t\t\t'ses_tstamp' => time()\n\t\t\t\t);\n\n\t\t\t\t$GLOBALS['TYPO3_DB']->exec_INSERTquery('be_sessions', $insertFields);\n\n\t\t\t}\n\t\t}\n\n\t\tif(t3lib_div::_GP('tx_timtaw_logout')) {\n\t\t\tif($_COOKIE['be_typo_user']) {\n\t\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('ses_id, ses_userid','be_sessions','ses_id='.\"'\".$_COOKIE['be_typo_user'].\"'\");\n\t\t\t\tif($record = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t\t\t$GLOBALS['TYPO3_DB']->exec_DELETEquery('be_sessions', \"ses_id='\".$_COOKIE['be_typo_user'].\"'\");\n\t\t\t\t}\n\t\t\t\tsetcookie('be_typo_user', $_COOKIE['be_typo_user'], time() - 3600, '/');\n\t\t\t\tunset($_COOKIE['be_typo_user']);\n\t\t\t}\n\t\t}\n\t}", "function czyZalogowany(){\r\n\tglobal $PHPSESSID;\r\n\tglobal $_SESSION;\r\n\tglobal $CFG;\r\n\t$login = NULL;\r\n\tif(empty($_COOKIE[AUTH])){\r\n\t\theader(\"Location: {$CFG->adresSerwera}login/niezalogowany.php?reason=cookie\");\r\n\t\texit(0);\r\n\t}\r\n\r\n\tif($_SESSION['login']!=''){\r\n\t\tustaw_date_logu2($_SESSION['login']);\r\n\t\t$login = $_SESSION['login'];\r\n\t} else {\r\n\t\t//$zapytanie = \"SELECT login FROM \".TBL_LOGIN.\" WHERE sesionId ='\".$PHPSESSID.\"' and ip='{$_SERVER['REMOTE_ADDR']}';\";\r\n\t\t$zapytanie = \"SELECT login FROM \".TBL_LOGIN.\" WHERE sesionId ='\".$PHPSESSID.\"'\";\r\n\t\t$wynik = mysql_query($zapytanie);\r\n\t\tif($wynik && mysql_num_rows($wynik)>0){\r\n\t\t\t$wiersz = mysql_fetch_array($wynik);\r\n\t\t\tustaw_date_logu2($wiersz['login']);\r\n\t\t\t$_SESSION['login'] = $wiersz['login'];\r\n\t\t\treturn $wiersz['login'];\r\n\t\t}else{\r\n\t\t\tinclude($CFG->katalogStrony.\"login/niezalogowany.php\");\r\n\t\t\texit(1);\r\n\t\t}\r\n\t}\r\n\tZastepstwa::logoutIfZastepstwoWithCheckFirstUseFlag($login,$_SERVER['REMOTE_ADDR']);\r\n\treturn $login;\r\n}", "function loginSuperadmin($user, $pass)\n{\n global $db;\n $query = 'SELECT * FROM admin';\n $data = $db->query($query);\n $sukses = 0;\n $row = $data->fetch_assoc();\n foreach ($data as $row) {\n if ($user == $row['user'] && $pass == $row['pass']) {\n $sukses = 1;\n session_start();\n $_SESSION['user'] = $row['nim'];\n $_SESSION['nama'] = $row['nama'];\n $_SESSION['level'] = $row['level'];\n }\n }\n if ($sukses == 1) {\n echo \"<script>\nalert('Berhasil Login');\nwindow.location.href='dashboard/';\n</script>\";\n } else\n echo \"<script>\nalert('Username tidak ada atau password salah');\nwindow.location.href='/historipegawai-bs/';\n</script>\";\n}", "protected function _secure()\n {\n // user already logged in?\n if($this->current_user && $this->current_user->user_id) \n {\n return;\n }\n \n $this->_current_user();\n \n if(!$this->current_user || !$this->current_user->user_id)\n {\n redirect('user');\n }\n // user is logged in \n //$this->current_user_role = $this->current_user->role ;\n \n \n }", "public function login()\n {\n if (!isset($_SESSION)) {\n session_start();\n }\n $_SESSION['email'] = $this->email;\n header('Location: index.php');\n }", "public function klantLogin($email, $wachtwoord) {\n $conn = $this->connect();\n // SQL Query voorbereiden en variabelen binden aan de query\n $stmt = $conn->prepare(\"SELECT * FROM klant WHERE email = :email AND wachtwoord = :wachtwoord\");\n $stmt->bindParam(':email', $email);\n $stmt->bindParam(':wachtwoord', $wachtwoord);\n // als query is gelukt, gegevens ophalen en terugsturen, anders false terugsturen\n if ($stmt->execute()) {\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\n $_SESSION['klant_id'] = $result['id_klant'];\n $_SESSION['klant_voornaam'] = $result['voornaam'];\n $_SESSION['klant_achternaam'] = $result['achternaam'];\n $_SESSION['klant_email'] = $result['email'];\n $_SESSION['klant_adres'] = $result['adres'];\n $_SESSION['klant_postcode'] = $result['postcode'];\n $_SESSION['klant_woonplaats'] = $result['woonplaats'];\n return true;\n } else {\n return false;\n }\n }", "private function gebruikersBeheerAction()\n {\n $gebruikers = $this->model->geefGebruikers();\n $this->view->set('gebruikers', $gebruikers);\n }", "public static function adminLoggedIn(){\n //Hvis en bruker ikke er logget inn eller han ikke er admin, vil han bli sent til login.php\n if (!isset($_SESSION['user']) || !$_SESSION['user']->isAdmin()) {\n //Lagrer siden brukeren er på nå slik at han kan bli redirigert hit etter han har logget inn\n $alert = new Alert(Alert::ERROR, \"Du er nødt til å være administrator for å se den siden. Du er ikke administrator.\");\n $alert->displayOnIndex();\n\n }\n }", "public static function saveUserSession(){\n\t\t$_SESSION['user']=self::$_leuser;\n\t}", "function login()\n{\n\t$username = $this->Session->read('user');\n\tif ($username){\n\t$this->redirect('/inhabitants/');}\n\t\n\t$this->pageTitle = 'Login';\n\t\n\t$this->set('error', false);\n\t// jika form yg disubmit tidak kosong\n\tif ($this->data)\n\t{\n\t// jika username dan password cocok\n\t$results = $this->User->findByUsername($this->data['User']['username']);\n\t\tif ($results && $results['User']['password'] ==\n\t\tmd5($this->data['User']['password']))\n\t\t{\n\t\t\t$this->Session->write('user', $this->data['User']['username']);\n\t\t\t$this->Session->write('last_login', $results['User']['last_login']);\n\t\t\t$results['User']['last_login'] = date(\"Y-m-d H:i:s\");\n\t\t\t$this->User->save($results);\n\t\t\t// redirect\n\t\t\t$this->redirect('/users/');\n\t\t} else {\n\t\t\t$this->set('error', true);\n\t\t}\n\t}\n}" ]
[ "0.6507433", "0.628743", "0.62239695", "0.61260754", "0.6108343", "0.61006963", "0.6087638", "0.60121", "0.6002228", "0.59949", "0.5981162", "0.59788394", "0.5972895", "0.5970328", "0.59609646", "0.5934197", "0.58947444", "0.5884006", "0.58814174", "0.5847478", "0.582641", "0.58177537", "0.58135986", "0.5797694", "0.5791285", "0.57911867", "0.5782844", "0.57819587", "0.5770866", "0.5765891", "0.57637894", "0.57619894", "0.5761457", "0.57559097", "0.5749217", "0.5739183", "0.57381296", "0.57365143", "0.5733174", "0.57288915", "0.5723977", "0.5720309", "0.571748", "0.5714584", "0.5708997", "0.5702107", "0.57003635", "0.5695785", "0.56897956", "0.568959", "0.5689243", "0.5688571", "0.5685514", "0.5685339", "0.5678073", "0.5677012", "0.56747466", "0.5671281", "0.5666145", "0.56606865", "0.5658883", "0.5656984", "0.5652764", "0.56508553", "0.56425554", "0.56417257", "0.5631155", "0.56283927", "0.56265974", "0.5625825", "0.56235087", "0.56224793", "0.5621477", "0.56113815", "0.56097966", "0.56071335", "0.5605892", "0.560357", "0.5602237", "0.55990696", "0.5599017", "0.558936", "0.5581642", "0.55806357", "0.5577663", "0.5574378", "0.5565217", "0.5560821", "0.555852", "0.5558263", "0.55556124", "0.5549584", "0.5548564", "0.5548148", "0.5546886", "0.55467486", "0.5544633", "0.55440813", "0.5533521", "0.553328", "0.5532479" ]
0.0
-1
Haalt enkel het aantal studenten op
function getColumnCount($columnId) { $this->db->where('planningKolomId', $columnId); $this->db->where('surveillant', 0); return $this->db->count_all_results('aanwezigheid'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pobierz_studentow() {\n\t\t$baza = polacz_z_baza();\n\n\t\t$zapytanie = 'select * from studenci';\n\t\t$wynik = mysqli_query($baza, $zapytanie);\n\n\t\tzakoncz_polaczenie($baza);\n\n\t\treturn $wynik;\n\t}", "public function accoutingByStudent($student_id){\n }", "private function getStudent(){\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire.sql\";\n\n\t\t$this->result[\"liste_stagiaire\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_techno_carousel.sql\";\n\n\t\t$this->result[\"liste_techno\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_rs.sql\";\n\n\t\t$this->result[\"liste_rs\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_doc.sql\";\n\n\t\t$this->result[\"liste_doc\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t}", "public function formatStudent($studentId, $voornaam, $tussenvoegsel, $achternaam) {\r\n echo \"StudentID: \" . $studentId;\r\n echo '<br>';\r\n echo \"Voornaam: \" . $voornaam;\r\n echo '<br>';\r\n echo \"Tussenvoegsel: \" . $tussenvoegsel;\r\n echo '<br>';\r\n echo \"Achternaam: \" . $achternaam;\r\n echo '<br>';\r\n }", "public function show(student $student)\n {\n //\n }", "function getStudents() {\n $students = array();\n\n // Add first student into the students array.\n $first = new Student();\n $first->surname = \"Doe\";\n $first->first_name = \"John\";\n $first->add_email('home','[email protected]');\n $first->add_email('work','[email protected]');\n $first->add_grade(65);\n $first->add_grade(75);\n $first->add_grade(55);\n $students['j123'] = $first; \n\n // Add seconde student into the students array.\n $second = new Student();\n $second->surname = \"Einstein\";\n $second->first_name = \"Albert\";\n $second->add_email('home','[email protected]');\n $second->add_email('work1','[email protected]');\n $second->add_email('work2','[email protected]');\n $second->add_grade(95);\n $second->add_grade(80);\n $second->add_grade(50);\n $students['a456'] = $second;\n\n\n // Add my info into the students array.\n $me = new Student();\n $me->surname = \"Tan\";\n $me->first_name = \"Hai Hua\";\n $me->add_email('school', '[email protected]');\n $me->add_grade(90);\n $students['b721'] = $me;\n\n\n // Add random generated students to the array\n $num = mt_rand(1, 10);\n for ($i = 0; $i < $num; ++$i) {\n $student = new Student();\n $student->surname = Helper::rand_name(10);\n $student->first_name = Helper::rand_name(10);\n $student->add_email('school', $student->first_name . '@.my.bcit.ca');\n $student->add_grade(mt_rand(0,100));\n $student->add_grade(mt_rand(0,100));\n $student->add_grade(mt_rand(0,100));\n $students['k' . mt_rand(100,999)] = $student;\n }\n\n return $students;\n }", "public function getStNo(){\n return $this->student_no;\n }", "public function getIdStudent(){\n\t\treturn $this->idStudent;\n\t}", "public function is_student() {\n return $this->session->get(\"niveau_acces\") >= 0;\n }", "public function getAllStudent(){\n\n\t\treturn array(\n\t\t\t\"1\"=> new Entity_Student(1,\"pham van thao\",23,\"tlu\"),\n\t\t\t\"2\"=> new Entity_Student(2,\"pham van phen\",24,\"tlu\"),\n\t\t\t\"3\"=> new Entity_Student(3,\"pham van to\",25\"tlu\"),\n\t\t\t\"4\"=> new Entity_Student(4,\"pham van\",26,\"tlu\"),\n\n\t\t);\n\t}", "public function studentList()\n {\n return output($this->UserDetails->where([\"roleId\"=>$this->getUserRoleId()])->read(),'success','SM001');\n }", "abstract function numStudents();", "public function getAllStudents() {\n try {\n if(BaseController::isLoggedIn() && BaseController::isTeacher()) { \n $user = new UserModel();\n $user->id = BaseController::getUserId();\n $user_data = $user->getUserDataById();\n \n $student = new StudentModel();\n $students = $student->getAllStudents();\n \n $model = array(\n 'user_data' => $user_data,\n 'students' => $students\n );\n BaseController::display(self::$controller . '/students.php', $model);\n } else {\n BaseController::load('user/login.php', array('error_description' => 'Изисква се регистрация.'));\n }\n } catch (Exception $e) {\n BaseController::load('error.php');\n }\n }", "public function loadStudents(){\n $data=$this->studentsInRiskForThis();\n $cantidad=count($data);\n $contador=0;\n foreach($data as $fila){\n IF(Talleresdet::firstOrCreateStatic([\n 'talleres_id'=>$this->id,\n 'codalu'=>$fila['codalu'],\n ], Talleresdet::SCENARIO_BATCH ))\n $contador++; \n }\n return ['total'=>$cantidad,'contador'=>$contador];\n }", "public function getStudent(){\n\t\t$this->load->model('School_model');\n\t\t$this->School_model->getSchoolAll();\n\t}", "public function getIdStudent()\n {\n return $this->id_student;\n }", "public function addReviewByStudent()\n {\n /* code goes here */\n }", "public function students()\r\n {\r\n $students = $this->student->GetAllStudents();\r\n $view = new view(\"Students\");\r\n $view->generate(array('students' => $students));\r\n\r\n }", "public function getStudentId()\n {\n return $this->studentId;\n }", "public function getTotalStudents(){\n $total_stds = $this->getTotalStds();\n $total_stds_men = $this->getTotalStdsMen();\n $total_stds_women = $this->getTotalStdsWomen();\n\n $htmlResumenTotal = $this->str_students(1,\"\").' <tr class=\"numbers\">\n <td class=\"color-indico\">'.number_format($total_stds).'</td>\n <td class=\"color-blue\">'.number_format($total_stds_men).'('.number_format($total_stds_men * 100 / $total_stds).'%)</td>\n <td class=\"color-orange\">'.number_format($total_stds_women).' ('.number_format($total_stds_women * 100 / $total_stds).'%)</td>\n </tr>\n '.$this->str_students(2,\"\");\n return $htmlResumenTotal;\n }", "public function __construct()\n {\n //$this->student = $student;\n }", "public function students(){\n\t\t$this->verify();\n\t\t$data['title']=\"Students\";\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('students/students', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}", "public static function onlineStudent(){\n $students = Roll::join('admissions','admissions.id', '=' , 'rolls.student_id' )\n ->where(['username' => Session::get('studentSession')])->first();\n \n return $students;// we will join the student with admission okay to have all his/her data's\n }", "public function run()\n {\n {\n $students = [\n [\n \"surname\" => \"Dare\",\n \"firstname\" => \"Koby\",\n \"nationality\" => \"UK\",\n \"email\" => \"[email protected]\",\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Dicki\",\n \"firstname\" => \"Kelli\",\n \"nationality\" => \"UK\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Carter\",\n \"firstname\" => \"Golden\",\n \"nationality\" => \"UK\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Koch\",\n \"firstname\" => \"Emory\",\n \"nationality\" => \"UK\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Kilback\",\n \"firstname\" => \"Marjorie\",\n \"nationality\" => \"Dominican Republic\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Hoeger\",\n \"firstname\" => \"Ernest\",\n \"nationality\" => \"Panama\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Hudson\",\n \"firstname\" => \"Rebecca\",\n \"nationality\" => \"Chile\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Hirthe\",\n \"firstname\" => \"Josefina\",\n \"nationality\" => \"Kyrgyzstan\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Ebert\",\n \"firstname\" => \"Wanda\",\n \"nationality\" => \"Palau\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Denesik\",\n \"firstname\" => \"Burnice\",\n \"nationality\" => \"Kuwait\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Moen\",\n \"firstname\" => \"Harold\",\n \"nationality\" => \"Vatican City\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Spencer\",\n \"firstname\" => \"Brennon\",\n \"nationality\" => \"Cambodia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Ziemann\",\n \"firstname\" => \"Stanley\",\n \"nationality\" => \"Azerbaijan\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Rempel\",\n \"firstname\" => \"Forest\",\n \"nationality\" => \"Seychelles\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Zboncak\",\n \"firstname\" => \"Gregory\",\n \"nationality\" => \"Kazakhstan\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Weimann\",\n \"firstname\" => \"Valentine\",\n \"nationality\" => \"Turks and Caicos Islands\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Waelchi\",\n \"firstname\" => \"Alexandria\",\n \"nationality\" => \"People's Democratic Republic of Yemen\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Altenwerth\",\n \"firstname\" => \"Florian\",\n \"nationality\" => \"Wake Island\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Zieme\",\n \"firstname\" => \"Faye\",\n \"nationality\" => \"Guatemala\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Beatty\",\n \"firstname\" => \"Raleigh\",\n \"nationality\" => \"British Antarctic Territory\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Kuhic\",\n \"firstname\" => \"Dolly\",\n \"nationality\" => \"Paraguay\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Koepp\",\n \"firstname\" => \"Mikel\",\n \"nationality\" => \"Liberia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Pfannerstill\",\n \"firstname\" => \"May\",\n \"nationality\" => \"Puerto Rico\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Douglas\",\n \"firstname\" => \"Otho\",\n \"nationality\" => \"Denmark\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Conroy\",\n \"firstname\" => \"Napoleon\",\n \"nationality\" => \"Afghanistan\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Doyle\",\n \"firstname\" => \"Elza\",\n \"nationality\" => \"Liechtenstein\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Schulist\",\n \"firstname\" => \"Maci\",\n \"nationality\" => \"United States\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Hansen\",\n \"firstname\" => \"Kyler\",\n \"nationality\" => \"Canada\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Conn\",\n \"firstname\" => \"Jean\",\n \"nationality\" => \"Kiribati\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Yost\",\n \"firstname\" => \"Reilly\",\n \"nationality\" => \"South Africa\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Quigley\",\n \"firstname\" => \"Shad\",\n \"nationality\" => \"Bhutan\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Quitzon\",\n \"firstname\" => \"Beatrice\",\n \"nationality\" => \"Timor-Leste\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Langworth\",\n \"firstname\" => \"Lonny\",\n \"nationality\" => \"New Zealand\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Kiehn\",\n \"firstname\" => \"Rosalinda\",\n \"nationality\" => \"Dominican Republic\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Parker\",\n \"firstname\" => \"Rebekah\",\n \"nationality\" => \"Kyrgyzstan\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Kuhlman\",\n \"firstname\" => \"Rhoda\",\n \"nationality\" => \"Gibraltar\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Cruickshank\",\n \"firstname\" => \"Judd\",\n \"nationality\" => \"Macau SAR China\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Yundt\",\n \"firstname\" => \"Sarah\",\n \"nationality\" => \"Papua New Guinea\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Pacocha\",\n \"firstname\" => \"Russ\",\n \"nationality\" => \"Greenland\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Purdy\",\n \"firstname\" => \"Kali\",\n \"nationality\" => \"Mauritania\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Block\",\n \"firstname\" => \"Janick\",\n \"nationality\" => \"Belarus\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Waelchi\",\n \"firstname\" => \"Ford\",\n \"nationality\" => \"Paraguay\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Batz\",\n \"firstname\" => \"Francesca\",\n \"nationality\" => \"Netherlands Antilles\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Rogahn\",\n \"firstname\" => \"Lukas\",\n \"nationality\" => \"Cape Verde\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Funk\",\n \"firstname\" => \"Wilhelmine\",\n \"nationality\" => \"Zimbabwe\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Nader\",\n \"firstname\" => \"Jude\",\n \"nationality\" => \"Panama Canal Zone\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Stroman\",\n \"firstname\" => \"Frankie\",\n \"nationality\" => \"Saint Martin\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Jaskolski\",\n \"firstname\" => \"Mina\",\n \"nationality\" => \"Bermuda\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Zieme\",\n \"firstname\" => \"Mack\",\n \"nationality\" => \"Uzbekistan\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Tromp\",\n \"firstname\" => \"Celestine\",\n \"nationality\" => \"Peru\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Nitzsche\",\n \"firstname\" => \"Zella\",\n \"nationality\" => \"New Zealand\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Kuphal\",\n \"firstname\" => \"Ila\",\n \"nationality\" => \"Maldives\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Cruickshank\",\n \"firstname\" => \"Eda\",\n \"nationality\" => \"Jamaica\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Koepp\",\n \"firstname\" => \"Jaylen\",\n \"nationality\" => \"Monaco\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Kohler\",\n \"firstname\" => \"Kristina\",\n \"nationality\" => \"Russia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Ondricka\",\n \"firstname\" => \"Sean\",\n \"nationality\" => \"Turks and Caicos Islands\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Leuschke\",\n \"firstname\" => \"Estelle\",\n \"nationality\" => \"Niue\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Funk\",\n \"firstname\" => \"Roselyn\",\n \"nationality\" => \"Djibouti\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Romaguera\",\n \"firstname\" => \"Kariane\",\n \"nationality\" => \"Djibouti\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Nitzsche\",\n \"firstname\" => \"Adrian\",\n \"nationality\" => \"Guernsey\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Windler\",\n \"firstname\" => \"Maggie\",\n \"nationality\" => \"Guernsey\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Blanda\",\n \"firstname\" => \"Ken\",\n \"nationality\" => \"French Southern Territories\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Reilly\",\n \"firstname\" => \"Antone\",\n \"nationality\" => \"Yemen\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Cassin\",\n \"firstname\" => \"Yadira\",\n \"nationality\" => \"Mayotte\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Macejkovic\",\n \"firstname\" => \"Marge\",\n \"nationality\" => \"Slovakia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Feest\",\n \"firstname\" => \"Rogers\",\n \"nationality\" => \"Monaco\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Fadel\",\n \"firstname\" => \"Candelario\",\n \"nationality\" => \"Belarus\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Shields\",\n \"firstname\" => \"Eldridge\",\n \"nationality\" => \"Neutral Zone\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Romaguera\",\n \"firstname\" => \"Lavina\",\n \"nationality\" => \"Canton and Enderbury Islands\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Hessel\",\n \"firstname\" => \"Matt\",\n \"nationality\" => \"Czech Republic\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Donnelly\",\n \"firstname\" => \"Barrett\",\n \"nationality\" => \"South Korea\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Hagenes\",\n \"firstname\" => \"Betty\",\n \"nationality\" => \"Samoa\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Schmeler\",\n \"firstname\" => \"Alphonso\",\n \"nationality\" => \"Palau\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Shields\",\n \"firstname\" => \"Selmer\",\n \"nationality\" => \"Samoa\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Kemmer\",\n \"firstname\" => \"Earl\",\n \"nationality\" => \"Niger\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Kunde\",\n \"firstname\" => \"Sharon\",\n \"nationality\" => \"French Guiana\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Jacobs\",\n \"firstname\" => \"Jeffry\",\n \"nationality\" => \"Albania\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Ritchie\",\n \"firstname\" => \"Eliane\",\n \"nationality\" => \"Chad\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Erdman\",\n \"firstname\" => \"Howard\",\n \"nationality\" => \"Puerto Rico\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Schimmel\",\n \"firstname\" => \"Lance\",\n \"nationality\" => \"Serbia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Tillman\",\n \"firstname\" => \"Elliott\",\n \"nationality\" => \"Botswana\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Boyle\",\n \"firstname\" => \"Emanuel\",\n \"nationality\" => \"Tokelau\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Feest\",\n \"firstname\" => \"Norma\",\n \"nationality\" => \"Georgia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"O'Conner\",\n \"firstname\" => \"Jenifer\",\n \"nationality\" => \"Nepal\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Towne\",\n \"firstname\" => \"Lilliana\",\n \"nationality\" => \"New Caledonia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Padberg\",\n \"firstname\" => \"Verner\",\n \"nationality\" => \"Seychelles\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Stiedemann\",\n \"firstname\" => \"Adelia\",\n \"nationality\" => \"Greece\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Turcotte\",\n \"firstname\" => \"Tristin\",\n \"nationality\" => \"Nauru\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Pouros\",\n \"firstname\" => \"Cooper\",\n \"nationality\" => \"Micronesia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Romaguera\",\n \"firstname\" => \"Judy\",\n \"nationality\" => \"Australia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Tremblay\",\n \"firstname\" => \"Maxie\",\n \"nationality\" => \"French Guiana\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Barrows\",\n \"firstname\" => \"Akeem\",\n \"nationality\" => \"Mozambique\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Funk\",\n \"firstname\" => \"Florencio\",\n \"nationality\" => \"Malawi\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Welch\",\n \"firstname\" => \"Margarita\",\n \"nationality\" => \"Ethiopia\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Legros\",\n \"firstname\" => \"Helmer\",\n \"nationality\" => \"Antigua and Barbuda\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Labadie\",\n \"firstname\" => \"Carole\",\n \"nationality\" => \"Martinique\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Klein\",\n \"firstname\" => \"Desiree\",\n \"nationality\" => \"Nepal\",\n \"email\" => \"[email protected]\"\n ,\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Kuvalis\",\n \"firstname\" => \"Eloy\",\n \"nationality\" => \"Panama Canal Zone\",\n \"email\" => \"[email protected]\",\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199),\n ],\n [\n \"surname\" => \"Macejkovic\",\n \"firstname\" => \"Lucinda\",\n \"nationality\" => \"Austria\",\n \"email\" => \"[email protected]\",\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ],\n [\n \"surname\" => \"Bosco\",\n \"firstname\" => \"Emilia\",\n \"nationality\" => \"São Tomé and Príncipe\",\n \"email\" => \"[email protected]\",\n \"address_id\" => rand(0, 88),\n \"course_id\" => rand(0, 199)\n ]\n ];\n\n foreach ($students as $student) {\n Student::create($student);\n }\n }\n }", "function student_get(){\n\t\t$id = $this->uri->segment(3); //ini keyword di postman nya unutk mengakses halamannya\n\t\t$user = array(\n\t\t\t1=>array('nama_depan'=>'Budi','nama_belakang'=>'Effendi'),\n\t\t\t2=>array('nama_depan'=>'Iwan','nama_belakang'=>'Mulya')\n\t\t);\n\n\t\tif (isset($user[$id])) {\n\t\t\t$this->response(array('status'=>'sukses','data'=>$user[$id]));\n\t\t}\n\t\telse{\n\t\t\t$this->response(array('status'=>'gagal','data'=>'User Tidak Ditemukan'),REST_Controller:: HTTP_NOT_FOUND);\n\t\t}\n\t}", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function display(){\r\n echo \"Unique Row Id: \" . $this->getUnique_studentKey() . \"<br/>\";\r\n echo \"User Id: \" . $this->getStudentUserID() . \"<br/>\";\r\n echo \"Password: \" . $this->getStudentPassword() . \"<br/>\";\r\n echo \"First Name: \" . $this->getFirstName() . \"<br/>\";\r\n echo \"Middle Name: \" . $this->getMiddleName() . \"<br/>\";\r\n echo \"Last Name: \" . $this->getLastName() . \"<br/>\";\r\n echo \"Email: \" . $this->getEmail() . \"<br/>\"; \r\n echo \"School Name: \" . $this->getSchoolName() . \"<br/>\"; \r\n echo \"Grade: \" . $this->getGrade() . \"<br/>\";\r\n echo \"Role: \" . $this->getRole() . \"<br/>\";\r\n }", "function add_student(){\n\t\t\t\n\t\t\t$st_id = self::$db->quote($_POST['id']);\n\t\t\t$fname = self::$db->quote($_POST['firstname']);\n\t\t\t$lname = self::$db->quote($_POST['lastname']);\n\t\t\t$area = self::$db->quote($_POST['area']);\n\t\t\t$result = self::$admin->addStudent($st_id,$fname,$lname,$area);\n\n\t\t\tif($result == 1){\n\t\t\t\techo \"User Added Successfully....\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\techo \"something wrong\";\n\t\t\t}\n\t\t}", "function usun() {\n\t\t$baza = polacz_z_baza();\n\n\t\tif(!isset($_POST['student_id'])) {\n\t\t\techo \"Błędnie wywołany formularz<br>\";\n\t\t\treturn;\n\t\t}\n\t\t$zapytanie = \"DELETE FROM `studenci` WHERE `id` = \".$_POST['student_id'];\n\t\t$wynik = mysqli_query($baza, $zapytanie);\n\n\t\tif($wynik)\n\t\t\techo \"Student został usunięty z bazy<br>\";\n else \n\t\t\techo \"Błąd podczas próby usunięcia studenta z bazy (\".mysql_error().\")<br>\";\n\n\t\tzakoncz_polaczenie($baza);\n\t}", "protected function examAttributeStudents($id)\n {\n $exam = $this->getDoctrine()->getRepository(\"UnsapaIPWBundle:Exam\")->find($id);\n $promo_users = $this->getDoctrine()->getRepository(\"UnsapaIPWBundle:User\")->findByPromo($exam->getPromo());\n\n $students_id = $this->getRequest()->request->all();\n $selected_users = array();\n foreach($students_id as $student_id)\n {\n $user = $this->getDoctrine()->getRepository(\"UnsapaIPWBundle:User\")->find($student_id);\n if($user->getPromo() != $exam->getPromo())\n throw new AccessDeniedHttpException(\"Vous n'avez pas manipuler cet utilisateur pour cet examen.\");\n\n array_push($selected_users, $user);\n }\n $unselected_users = array_diff($promo_users, $selected_users);\n\n // We delete the corresponding records (students who don't attend anymore to the exam)\n $em = $this->getDoctrine()->getEntityManager();\n foreach($unselected_users as $user)\n {\n $record = $em\n ->createQuery(\"SELECT r FROM UnsapaIPWBundle:Record r WHERE r.exam = :exam AND r.student = :user\")\n ->setParameters(array('exam' => $exam, 'user' =>$user))\n ->setMaxResults(1)\n ->getResult();\n if(count($record) == 1)\n {\n $em->remove($record[0]);\n $em->flush();\n }\n }\n // We add a new record to the users who didn't have one\n foreach($selected_users as $user)\n {\n $record = $em\n ->createQuery(\"SELECT r FROM UnsapaIPWBundle:Record r WHERE r.exam = :exam AND r.student = :user\")\n ->setParameters(array('exam' => $exam, 'user' =>$user))\n ->setMaxResults(1)\n ->getResult();\n if(count($record) == 0)\n {\n $record = new Record();\n $record->setExam($exam);\n $record->setStudent($user);\n $em->persist($record);\n $em->flush();\n }\n }\n }", "function show_student($assignment,$t,$student)\n{\n print \"<tr>\";\n print \"<td> \"\n . $assignment->term . \"&nbsp;</td><td>\"\n . \"<a href=\\\"/showTaskSummary?number=\" . $t->getCourse(). \"\\\">\"\n . $t->getCourse()\n . \"</a>\"\n . \"&nbsp;</td><td>\"\n . $t->getType() . \"&nbsp;</td><td>\"\n . $t->getEffort() . \"&nbsp;</td><td>\"\n . $t->getTaType() . \"&nbsp;</td><td>\";\n\n print \"<a href=\\\"/showTaSummary?email=\" . $assignment->person . \"\\\">\"\n . $assignment->person\n . \"</a>\"\n . \"&nbsp;</td><td>\"\n . $student->division . \"&nbsp;&nbsp;</td><td>\"\n . $t->generateId() . \"&nbsp;</td>\\n\"\n . \"<td>&nbsp; \" . number_format($assignment->evalO,1,'.',',') . \" &nbsp;</td>\";\n print \"</tr>\\n\";\n}", "function usun_potwierdz() {\n\t\tif(!isset($_POST['student_id'])) {\n\t\t\techo \"Błędnie wywołany formularz<br>\";\n\t\t\treturn;\n\t\t}\n\t\t$baza = polacz_z_baza();\n\n\t\t$zapytanie = 'SELECT * FROM studenci WHERE `id`='.$_POST['student_id'];\n\t\t$wynik = mysqli_query($baza, $zapytanie);\n\t\t$line = mysqli_fetch_array($wynik);//powinien istniec tylko tylko jeden znaleziony rekord\n\n\t\techo \"<div>Czy na pewno chcesz usunąć studenta: <i>\".\n\t\t\t$line['imie'].\" \".$line['nazwisko'].\" (nr indeksu: \".$line['nr_indeks'].\")</i> ?</div>\";\n\n\t\t//potwierdzenie\n\t\techo \"<form action='index.php?id=52' method='POST' style='display: inline-block;'>\n\t\t\t\t<input type='hidden' value='\".$_POST['student_id'].\"' name='student_id' />\n\t\t\t\t<input type='submit' value='Potwierdź usuwanie' />\n\t\t\t</form>\";\n\n\t\t//anulowanie\n\t\techo \"<form action='index.php?id=5' method='POST' style='display: inline-block;'>\n\t\t\t\t<input type='submit' value='Anuluj' />\n\t\t\t</form>\";\n\n\t\tzakoncz_polaczenie($baza);\n\t}", "public function get_student_id() {\n\t\t\treturn $this->student_id;\n\t\t}", "public function index()\n {\n $grades = Grade::all();\n $users = User::all();\n $students = [];\n foreach($users as $user){\n if($user->hasRole('Student')){\n $students[$user->id] = $user;\n }\n }\n\n\n\n return view('grade.list')->withGrades($grades)->withStudents($students);\n }", "function updateStudentValidate(){\n\t\t\n\t\tif(@$this->institution == \"\" | @$this->identification == \"\" | @$this->passkey == \"\"){\n\t\t\t$respArray = $this->makeResponse(\"ERROR\", \"FAILED TO IDENTIFY USER BASED ON GIVEN CRITERIA!\", \"\");\n\t\t\techo $this->jsoncallback.\"(\".json_encode($respArray).\")\";\n\t\t\texit;\n\t\t}else{\n\t\t\t$this->basics->updateStudent($this->sanitize($this->nom), $this->sanitize($this->institution), $this->sanitize($this->major), $this->sanitize($this->minor), $this->sanitize($this->identification), $this->obsfucate->makePass($this->sanitize($this->passkey)), $this->sanitize($this->google), $this->sanitize($this->yahoo), $this->sanitize($this->live), $this->sanitize($this->facebook), $this->sanitize($this->linkedin), $this->sanitize($this->twitter), @$this->sanitize($this->department), @$this->sanitize($this->school), @$this->sanitize($this->country));\n\t\t}\n\t\n\t}", "public function getAllStudentsResults() {\n try {\n if(BaseController::isLoggedIn() && BaseController::isTeacher()) {\n $user = new UserModel();\n $user->id = BaseController::getUserId();\n $user_data = $user->getUserDataById();\n \n $student = new StudentModel();\n $results = $student->getAllStudentsResults();\n \n $model = array(\n 'user_data' => $user_data,\n 'results' => $results\n );\n BaseController::display(self::$controller . '/student-results.php', $model);\n } else {\n BaseController::load('user/login.php', array('error_description' => 'Изисква се регистрация.'));\n }\n } catch (Exception $e) {\n BaseController::load('error.php');\n }\n }", "function get_student($id = ''){\n\t\t\tprint_r($this->input->post());\n\t\t}", "public function semesterregi(){\n\t\t$suid=$this->session->userdata('id_user');\n\t\t//print_r($suid);\n\t\t$Stuid=$this->commodel->get_listspfic1(\"student_master\",\"sm_id\",\"sm_userid\",$suid)->sm_id;\n\t\t//print_r($Stuid);\n \t//get current academic year\n \t//$acadyear = $this->user_model->getcurrentAcadYear();\n\t\t$this->appno = $this->commodel->get_listspfic1('student_entry_exit','senex_entexamapplicationno','senex_smid',$Stuid)->senex_entexamapplicationno;\n\t\t$stud_prg_rec = $this->commodel->get_listrow('student_program','sp_smid',$Stuid);\n \t$degree_id = $stud_prg_rec->row()->sp_programid;\n \t$noofsemester = sizeof($stud_prg_rec->result());\n\t\t\n\t\t$cacadyer = $this->user_model->getcurrentAcadYear();\n\t\t//print_r($cacadyer);\n \t$semestertype = $this->user_model->getcurrentSemester();\n \t//print_r($semestertype);\n \t$semesterrec = $this->stumodel->get_semester_no($Stuid,$cacadyer);\n \t$semsize = sizeof($semesterrec);\n\t\t$this->curresem = $semsize;\n\t\t//print_r($semsize);\n\t\t\n \t\n\t\t\n\t\t//student personnel detail\n\t\t$this->name=$this->commodel->get_listspfic1(\"student_master\",\"sm_fname\",\"sm_userid\",$suid)->sm_fname;\n\t\t$this->sturollno = $this->commodel->get_listspfic1('student_entry_exit','senex_rollno','senex_smid',$Stuid)->senex_rollno;\n\t\t$this->mobile=$this->commodel->get_listspfic1('student_master','sm_mobile','sm_id',$Stuid)->sm_mobile;\n\t\t$this->email=$this->commodel->get_listspfic1('student_master','sm_email','sm_id',$Stuid)->sm_email;\n\t\t$this->dob=$this->commodel->get_listspfic1('student_master','sm_dob','sm_id',$Stuid)->sm_dob;\n\t\t$this->uid=$this->commodel->get_listspfic1('student_master','sm_uid','sm_id',$Stuid)->sm_uid;\n\t\t$this->bgroup=$this->commodel->get_listspfic1('student_master','sm_bloodgroup','sm_id',$Stuid)->sm_bloodgroup;\n\t\t$this->gender=$this->commodel->get_listspfic1('student_master','sm_gender','sm_id',$Stuid)->sm_gender;\n\t\t$this->religname=$this->commodel->get_listspfic1('student_master','sm_religion','sm_id',$Stuid)->sm_religion;\n\n\t\t//student parent and course detail\n\t\t$this->mname = $this->commodel->get_listspfic1('student_parent','spar_mothername','spar_smid',$Stuid)->spar_mothername;\t\t\n\t\t$this->fathname=$this->commodel->get_listspfic1('student_parent','spar_fathername','spar_smid',$Stuid)->spar_fathername;\n\t\t\n\t\t$this->sem = $this->commodel->get_listspfic1('student_program','sp_semester','sp_smid',$Stuid)->sp_semester;\n\t\t\n\t\t$this->ncid = $this->commodel->get_listspfic1('student_program','sp_programid','sp_smid',$Stuid)->sp_programid;\n\t\t//get programe name\n\t\t$this->pname = $this->commodel->get_listspfic1('program','prg_name','prg_id',$this->ncid)->prg_name;\n\t\t$this->progid = $this->commodel->get_listspfic1('program','prg_id','prg_name',$this->pname)->prg_id;\n\t\t\n\t\t//get program category name\n\t\t$this->pcatid = $this->commodel->get_listspfic1('student_program','sp_pcategory','sp_smid',$Stuid)->sp_pcategory;\n\t\t$this->pcatname = $this->commodel->get_listspfic1('programcategory','prgcat_name','prgcat_id',$this->pcatid)->prgcat_name;\n\n\t\t//postal address detail\n\t\t$this->padd=$this->commodel->get_listspfic1('student_parent','spar_caddress','spar_smid',$Stuid)->spar_caddress;\n\t\t$this->pcity=$this->commodel->get_listspfic1('student_parent','spar_ccity','spar_smid',$Stuid)->spar_ccity;\n\t\t$this->ppost=$this->commodel->get_listspfic1('student_parent','spar_cpostoffice','spar_smid',$Stuid)->spar_cpostoffice;\n\t\t$this->pdist=$this->commodel->get_listspfic1('student_parent','spar_cdistrict','spar_smid',$Stuid)->spar_cdistrict;\n\t\t$this->pstat=$this->commodel->get_listspfic1('student_parent','spar_cstate','spar_smid',$Stuid)->spar_cstate;\n\t\t$this->ppin=$this->commodel->get_listspfic1('student_parent','spar_cpincode','spar_smid',$Stuid)->spar_cpincode;\n\t\t$this->pcounname=$this->commodel->get_listspfic1('student_parent','spar_ccountry','spar_smid',$Stuid)->spar_ccountry;\n\t\t\n\t\t//get student category\n\t\t$this->cateid=$this->commodel->get_listspfic1('student_master','sm_category','sm_id',$Stuid)->sm_category;\n\t\t$this->catename=$this->commodel->get_listspfic1('category','cat_name','cat_id',$this->cateid)->cat_name;\n\n\t\t//get study center\n\t\t$this->sccode=$this->commodel->get_listspfic1('student_master','sm_sccode','sm_id',$Stuid)->sm_sccode;\n\t\t$this->scname=$this->commodel->get_listspfic1('study_center','sc_name','sc_code',$this->sccode)->sc_name;\n\t\t//get branch name\n\t\t$this->brid=$this->commodel->get_listspfic1('student_program','sp_branch','sp_smid',$Stuid)->sp_branch;\n\t\t$this->brname=$this->commodel->get_listspfic1('program','prg_branch','prg_id',$this->brid)->prg_branch;\n\t\t//get department name\n\t\t$this->depid=$this->commodel->get_listspfic1('student_program','sp_deptid','sp_smid',$Stuid)->sp_deptid;\n\t\t$this->depname=$this->commodel->get_listspfic1('Department','dept_name','dept_id',$this->depid)->dept_name;\n\n\t\t//$sprogid = $this->commodel->get_listspfic1('student_program','sp_id','sp_smid',$Stuid)->sp_id;\n\t\t//print_r($sprogid);\n\n\t\t//$this->db->select('sp_id')->from('student_program')->where('sp_smid',$Stuid)->where('sp_semester',$semsize);\n\t\t//$spstid = $this->db->get()->row();\n\t\t$getspid = array('sp_smid' => $Stuid, 'sp_semester' => $semsize);\n\t \t$spstid = $this->commodel->get_listspficemore('student_program','sp_id',$getspid);\n\t\t\n\t\t//print_r($spstid);\n\t\tforeach($spstid as $stspid){\n\t\t\t$this->cusem = $this->commodel->get_listspfic1('student_program','sp_semester','sp_id',$stspid->sp_id)->sp_semester;\n\t\t\t//print_r($this->cusem);\n\t\t}\n\t\t\t$datawh = array('sp_smid' => $Stuid, 'sp_semester' => $semsize);\n\t \t\t$diffdate = $this->commodel->get_listspficemore('student_program','sp_programid,sp_semregdate',$datawh);\n\t\t\t//print_r($diffdate);\n\t\t\tforeach($diffdate as $spdate):\n\t\t\t\t$semdiffdate = $this->datmodel->diffdays($spdate->sp_semregdate);\n\t\t\t\t$spprgid = $spdate->sp_programid;\n\t\t\tendforeach;\t\n\t\t\t//print_r($semdiffdate);\n\t\t\t$prgpattern=$this->commodel->get_listspfic1('program','prg_pattern','prg_id',$spprgid)->prg_pattern;\n\t\t\t$tmonth = $semdiffdate/30;\n\t\t\t//print_r($this->tdate);\n\t\t\t\n\t\t\t\n\t\t\tif((($tmonth > 5) && ($prgpattern == 'Semester')) || (($tmonth > 11) && ($prgpattern == 'Yearly')))\n\t\t\t{\n\t\n\t\t\t\tif(isset($_POST['register']))\n\t\t\t\t{\t\n\t\t\t\t\t$this->form_validation->set_rules('Ssem','Semseter','trim|xss_clean|required');\n\t\t\t\t\t//Re-populate field\n\t\t\t\t\tif($_POST)\n\t\t\t\t\t{\n\t\t\t\t\t\t//$this->data['Stmobile']=$this->input->get_post('Stmobile');\n\t\t\t\t\t\t$this->data['Ssem']=$this->input->get_post('Ssem');\n\t\t\t\t\t}//re populate if close\t\n\t\t\t\t\t\tif ($this->form_validation->run() == FALSE) {\t\n\t\t\t\t\t\t\t//$message = '<h3>Your some detail is incorrect .</h3>';\n\t \t\t\t\t\t\t//$this->session->set_flashdata('msg',$message);\n\t\t\t\t\t\t\t//redirect('request/registartionsemester');\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\t//update in student_master\n \t \t\t\t\t$this->db->trans_begin();\n\n\t\t\t\t\t\t$cdate = date(\"Y-m-d h:i:sa\");\t\t\t\t\t \t\n\t\t\t \t\t\tif($_POST['Ssem'] != $semsize){\t\t\t\t\n\t\t\t\t\t\t\t//insert program data in student_program\n\t\t\t\t\t\t\t$progdata = array (\n\t\t\t\t\t\t\t\t'sp_smid'\t=>\t$Stuid,\n\t\t\t\t\t\t\t\t'sp_programid'\t=>\t$this->ncid,\n\t\t\t\t\t\t\t\t'sp_deptid'\t=>\t$this->depid,\t\t\n\t\t\t\t\t\t\t\t'sp_sccode'\t=>\t$this->sccode,\n\t\t\t\t\t\t\t\t'sp_pcategory'\t=>\t$this->pcatid,\n\t\t\t\t\t\t\t\t'sp_branch'\t=>\t$this->brid,\n\t\t\t\t\t\t\t\t'sp_acadyear'\t=>\t$cacadyer,\n\t\t\t\t\t\t\t\t'sp_semregdate' =>\t$cdate,\n\t\t\t\t\t\t\t\t'sp_semester'\t=> $_POST['Ssem']\n\t\t\t\t\t\t\t\t); \n\t\t\t \t\t\t\t$this->db->insert('student_program',$progdata);\n\t\t\t \t\t\t\t$sprogramid = $this->db->insert_id();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$message1 = $semsize;\n\t\t\t\t\t\t\t$message = '<h3>You are already register in'.\" \". $semsize .\" \". $prgpattern.'</h3>';\n\t \t\t\t\t\t\t$this->session->set_flashdata('msg',$message);\n\t\t\t\t\t\t\tredirect('request/semesterregi');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//insert smid and spid in student fees\n\t\t\t\t\t\t$feesdata = array (\n\t\t\t\t\t\t\t'sfee_smid'\t=>\t$Stuid,\n\t\t\t\t\t\t\t'sfee_spid'\t=>\t$sprogramid\n\t\t\t\t \t\t\t); \n\t\t\t\t\t\t\t$this->db->insert('student_fees',$feesdata);\n\n\t\t\t\t//make transaction complete\n \t\t\t$this->db->trans_complete();\n\t\t\t\n\t \t\t\t\t//check if transaction status TRUE or FALSE\n \t\t\t\tif ($this->db->trans_status() === FALSE) {\n\t\t\t\n \t\t\t\t//if something went wrong, rollback everything\n \t\t\t\t\t$this->db->trans_rollback();\n\t\t\t\t\t\t$this->logger->write_logmessage(\"update\", \"Student registration not update record in student_master table.\");\n \t\t\t\t$this->logger->write_dblogmessage(\"update\", \"Student registration not update record in student_master table.\");\n\t\t\t\t\t\t$this->load->view('request/registartionsemester');\n\t\t\t\t\t\t//redirect('request/stufeesdetail');\n \t\t\t\t\t//return FALSE;\n \t\t\t\t\t } else {\t\n \t\t\t\t\t//if everything went right, commit the data to the database\n \t\t\t\t\t$this->db->trans_commit();\n\t\t\t \t\t\t$message = '<h3>Your registration successfully done.</h3>';\n\t \t\t\t\t\t$this->session->set_flashdata('msg',$message);\t\t\t\n\t\t\t\t\t\t$this->logger->write_logmessage(\"update\", \"Student registration successfull update record in student_master table\");\n \t\t\t\t$this->logger->write_dblogmessage(\"update\", \"Student registration successfull update record in student_master table\" );\n\t\t\t\t\t\tredirect('request/stufeesdetail');\n \t\t \t\t\t//return TRUE;\n \t\t\t \t\t}\n\t\t\t}//close first else\t\n\t\t\t}//if post close\n\t\t}//close semster difference if\n\t\telse{\n\t\t\t$message = '<h3>You can not register for next semester registration because you can not complete minimum duration.</h3>';\n \t\t\t$this->session->set_flashdata('err_message',$message);\n\t\t\tredirect('studenthome');\n\t\t }\t\n\t\t\n\t$this->load->view('request/registartionsemester');\n\t}", "public function index()\n {\n $count_estudiante = Estudiante::select('id')->count();\n $count_coord = User::where('rol_id','2')->select('id')->count();\n $count_dir = User::where('rol_id','2')->select('id')->count();\n $count_asis = User::where('rol_id','3')->select('id')->count();\n //dd((Auth::user()->id));\n if(Auth::user()->roles->first()->id == 4){\n $student = Estudiante::where('user_id',Auth::user()->id)->first();\n if($student){\n return redirect()->route('estudiantes.show',$student->id);\n }else{\n return redirect()->route('estudiantes.create');\n }\n\n }else{\n return view('home', compact('count_estudiante','count_coord','count_asis','count_dir'));\n }\n\n }", "public function listOfStudents($skola) {\n\t\t\t$this->db->where('skolaId',$skola);\n\t\t\t $query = $this->db->get(\"predmet\");\n\t\t return $query;\n\t\t}", "function viewStudentAdvisor( $sessionID, $studentID ) {\r\n\t\tif( $this->userCanViewStudent( $sessionID )) {\r\n\t\t\t$query = \"SELECT ADVISOR FROM X_PNSY_STUDENT WHERE ID = '$studentID'\";\r\n\t\t\t$result = mysql_fetch_assoc(mysql_query($query));\r\n\t\t\textract($result);\r\n\t\t\r\n\t\t\t$query = \"SELECT FIRST_NAME, LAST_NAME, WOOSTER_EMAIL FROM X_PNSY_FACULTY WHERE ID = '$ADVISOR'\";\r\n\t\t\t$result = mysql_fetch_assoc(mysql_query($query));\r\n\t\t\t\r\n\t\t\treturn $result;\r\n\t\t}\r\n\t}", "function student_element() {\n\t\t\n//\t\t$this->set('picture', $this->getProfilePic());\n\t\t\n\t\t\n\t\t$countMsg = $this->TutMessage->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'to_id' => $this->Session->read('Member.memberid'),\n\t\t\t\t'status' => '0'\n\t\t\t)\n\t\t));\n\t\t\n\t\t$this->Member->unbindModel(array('hasMany' => array('TutEvent','TutCourse','UserImage'))); \n\t\t\n\t\t$getBalance = $this->Member->find('first', array(\n\t\t\t 'fields' => array('showImage','image_name','facebookId','fname','lname','creditable_balance','stripeid'), \n\t\t\t'conditions' => array(\n\t\t\t\t'Member.id' => $this->Session->read('Member.memberid')\n\t\t\t)\n\t\t));\n\t\t\n\t\t\n\t\t$mytutor = $this->PaymentHistory->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t'PaymentHistory.session_status' => 'Completed',\n\t\t\t'PaymentHistory.student_id' => $this->Session->read('Member.memberid')\n\t\t\t),\n\t\t\t'fields' => array('DISTINCT PaymentHistory.tutor_id'),\n\t\t\t'recursive' => -1\n\t\t));\n\t\t\n\t\t\n\t/*\techo '<pre>';\n\t\tprint_r($getBalance);\n\t\tprint_r($mytutor);\n\t\tdie;*/\n\t\t\n\t\tforeach($mytutor as $mt)\n\t\t{\n\t\t\t$tutorid[] = $mt['PaymentHistory']['tutor_id'];\n\t\t}\n\t\t\n\t//\t$this->Member->unbindModel(array('hasMany' => array('TutEvent','TutCourse'))); \n\t\t\n\t\tif(!empty($tutorid))\n\t\t{\n\t\t\t$mytutordata = $this->Member->find('all',array('conditions'=>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('Member.id'=>$tutorid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Member.active' => 1),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'fields'=>array('Member.id','Member.facebookId','Member.fname','Member.lname','Member.showImage','Member.image_name'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'recursive' => -1\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\n\t\t\t$this->set('mytutordata', $mytutordata);\n\t\t}\n\t\t\n\t/*\techo '<pre>';\n\t\tprint_r($tutorid);\n\t\tprint_r($mytutordata);\n\t\tdie;*/\n\t\t\n\t\t$this->set('parentrequest',$this->countparent_request());\n\t\t\n\t\t$this->set('awaitingRequest', $this->get_session_request('Booked', 'student_id'));\n\t\t$this->set('paymentRequest', $this->get_session_request('Accepted', 'student_id'));\n\t\t$this->set('upcomingRequest', $this->get_session_request('Paided', 'student_id'));\n\t\t$this->set('reviewRequest', $this->get_session_request('Review', 'student_id'));\n\t\t$this->set('completedRequest', $this->get_session_request('Completed', 'student_id'));\n\t\t\n\t\t$this->set('getBalance', $getBalance);\n\t\t$this->set('countMsg', $countMsg);\n\t\t\n\t\n\t\t\n\t\t// end student dashboard leftside bar \n\t\t\n\t\t\n\t}", "public function indexForTeacher()\n {\n if(\\Auth::user()->can('see-grades-for-teacher')){\n $teacherId = \\Auth::user()->id;\n $subjects = Subject::where('teacher_id', \"=\", $teacherId)->get();\n $subjectsIds = array_pluck($subjects, 'id');\n $grades = Grade::whereIn('subject_id', $subjectsIds)->get();\n $users = User::all();\n $students = [];\n foreach($users as $user){\n if($user->hasRole('Student')){\n $students[$user->id] = $user;\n }\n }\n\n\n return view('subject.listTeacher')->withGrades($grades)->withStudents($students);\n\n\n\n }\n }", "public function addStudent()\n {\n $student = new Student();\n $student->name = 'Shakib';\n $student->email = '[email protected]';\n $student->save();\n\n return 'Student Added Successfully!';\n }", "public function getStudentName()\n {\n return $this->workStudent->first_name . \" \" . $this->workStudent->last_name;\n }", "public function show(students $students)\n {\n //\n }", "public function show(Students $student)\n\t{\n\t\t$title = array(\n\t\t\t'active' => self::active,\n\t\t\t'title' => self::title,\n\t\t\t'slug' => self::slug\n\t\t);\n\t\t\n\t\t$parentRel = Parent_relations::whereStudentId($student->id)->get();\n\t\t\n\t\t$company = Company::whereId($student->companies_id)->select('expected_attendance')->first();\n\t\t\n\t\t$highTemp = $this->heighTemp($student->id); \n\t\t$present = $this->present($student->id); \n\t\t$absent = $this->absent($student->id); \n\t\t\n\n\t\tif($company->expected_attendance>0){\n\t\t\t\tif($present == 0) {\n\t\t\t\t\t$percentage=0;\n\t\t\t\t}else{\n\t\t\t\tif($absent == 0){\n\t\t\t\t\t\t$percentage = 100;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$answer = ($absent / $present ) * 100;\n\t\t\t\t\t\t$percentage = 100-$answer;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$percentage = 0;\n\t\t\t}\n\t\t\n\t\t\n\t\t$student->age = date_diff(date_create($student->dob), date_create('today'))->y;\n\t\treturn view('admin.students.show', compact('title', 'student','parentRel','company','highTemp','present','absent','percentage'));\n\t}", "function languagelesson_get_students($courseid)\n{\n\tglobal $DB;\n\t\n\t// Pull the context value for input courseid.\n\t$context = context_course::instance($courseid);\n $allusers = get_enrolled_users($context, 'mod/languagelesson:submit', 0, 'u.id, u.firstname, u.lastname, u.email, u.picture');\n \n $getteachers = get_enrolled_users($context, 'mod/languagelesson:manage', 0, 'u.id');\n $getgraders = get_enrolled_users($context, 'mod/languagelesson:grade', 0, 'u.id');\n \n \n $teachers = array();\n \n foreach ($getteachers as $thisteacher) {\n $teachers[] = $thisteacher->id;\n }\n foreach ($getgraders as $thisgrader) {\n $teachers[] = $thisgrader->id;\n }\n sort($teachers);\n \n // Remove all of the teachers those with manage or grade capabilities from the list.\n foreach ($allusers as $oneuser) {\n foreach ($teachers as $teacherid) {\n if ($oneuser->id == $teacherid) {\n unset($allusers[$oneuser->id]);\n }\n }\n } \n\treturn $allusers;\n}", "public function getStudentId(): int\n {\n return $this->studentId;\n }", "public function index()\n {\n\n $m = 0;\n $r = 0;\n $s = null;\n $c = 0;\n $epassed = 0;\n $eschu = 0;\n $teacher = auth()->user();\n// $g=[];\n $ecout = count($teacher->exams);\n foreach ($teacher->exams as $e) {\n\n if (count($e->students) != 0) {\n// $c=count($e->students);\n $epassed++;\n foreach ($e->students as $st) {\n if ($st->pivot->mark >= 10) {\n $m++;\n }\n if ($st->id_student != null and $st->id_student != $r) {\n $c++;\n\n $r = $st->id_student;\n }\n }\n }\n if (count($e->groupes) != 0) {\n $eschu++;\n// $g[]=$e;\n }\n\n }\n// dd($g);\n//dd($eschu-$epassed);\n\n return view('teacher.exams.index')->with('exams', $teacher->exams)\n ->with('ecount', $ecout)->with('epassed', $epassed)\n ->with('eschu', $eschu - $epassed)->with('pass10', $m);\n }", "public function students() {\n return $this->_students;\n }", "public function equivalenciaStudents($slug){\n\n }", "function getStudentByMajorValidate(){\n\t\t\n\t\tif(@$this->major == \"\" | @$this->institution == \"\"){\n\t\t\t$respArray = $this->makeResponse(\"ERROR\", \"Both the major and institution are required!\", \"\");\n\t\t\techo $this->jsoncallback.\"(\".json_encode($respArray).\")\";\n\t\t\texit;\n\t\t}else{\n\t\t\t\n\t\t\t$this->basics->getStudentByMajor( $this->sanitize($this->major), $this->sanitize($this->institution) );\n\t\t\t\n\t\t}\n\t\t\n\t}", "function addstudent(){\n include('../../config.php'); \n $classid = $_GET['classid'];\n $studid = $_GET['studid'];\n $verify = $this->verifystudent($studid,$classid);\n if($verify){\n echo $q = \"INSERT INTO studentsubject (studid,classid) VALUES ('$studid', '$classid');\";\n mysql_query($q);\n header('location:../classstudent.php?r=success&classid='.$classid.'');\n }else{\n header('location:../classstudent.php?r=duplicate&classid='.$classid.'');\n }\n \n $tmp = mysql_query(\"select * from class where id=$classid\");\n $tmp_row = mysql_fetch_array($tmp);\n $tmp_subject = $tmp_row['subject'];\n $tmp_class = $tmp_row['course'].' '.$tmp_row['year'].'-'.$tmp_row['section'];\n \n $tmp = mysql_query(\"select * from student where id=$studid\");\n $tmp_row = mysql_fetch_array($tmp);\n $tmp_student = $tmp_row['fname'].' '.$tmp_row['lname'];\n \n $act = \"add student $tmp_student to class $tmp_class with the subject of $tmp_subject\";\n $this->logs($act);\n }", "public static function parler()\n {\n echo 'Je suis un personnage <br/>';\n }", "public function getStudents(): array\n {\n \n return $this->students;\n }", "public function view_students()\n{\n $school =$this->getSchool(self::Admin,self::Active);\n$students =Student::where('user_id',$this->user_id())->orderBy('id','DES')->paginate(100);\n return view('home.student.index')->withS($school);\n}", "function student_id()\n\t\t{\n\t\t$custom = $this->custom_parsed();\n\t\tif(isset($custom['student_id']))\n\t\t\t{\n\t\t\treturn $custom['student_id'];\n\t\t\t}\n\t\telseif(isset($custom['person_id']))\n\t\t\t{\n\t\t\t$p = new Person($custom['person_id']);\n\t\t\treturn Student::addperson($p);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t$info = $this->infoarray();\n\t\t\tif(isset($info['payer_email']))\n\t\t\t\t{\n\t\t\t\t$p = Person::get_by_email($info['payer_email']);\n\t\t\t\tif($p === false)\n\t\t\t\t\t{\n\t\t\t\t\t$name = $info['first_name'] . ' ' . $info['last_name'];\n\t\t\t\t\t$person_id = Person::add2($info['payer_email'], $name);\n\t\t\t\t\treturn Student::addperson(new Person($person_id));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\treturn false;\n\t\t}", "public function londontec_students(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/add_students';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Add Students',\n\t\t\t'courselist'=> $this->setting_model->Get_All('course'),\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function actionStudents()\n\t{\n\t\t//$this->model = User::loadModel();\n\t\t$this->renderView(array(\n\t\t\t'contentView' => '//drcUser/_list',\n\t\t\t'dataProvider' => $this->model->students(),\n\t\t\t'contentTitle' => 'DRC Students',\n\t\t\t'titleNavRight' => '<a href=\"' . $this->createUrl('base/user/create') . '\"><i class=\"icon-plus\"></i> Add User </a>',\n\t\t\t'menuView' => 'base.views.layouts._termMenu',\n\t\t));\n\t}", "public function __construct(Student $student)\n {\n $this->student = $student;\n }", "public function __construct(Student $student)\n {\n $this->student = $student;\n }", "public function getStudent($idStudent){\n $student=student::where('numberAccount',$idStudent)->first();\n return $idStudent;\n }", "function get_num_students($classid){\r\n\t\r\n}", "public function editStudent() {\n\n\t\tif ( POST ) {\n\t\t\t$validation = new Validation();\n\t\t\t$validation->name( 'name' )->value( $_POST['name'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'guardian_id' )->value( $_POST['guardian_id'] )->pattern( 'int' )->required();\n\t\t\t$validation->name( 'date_of_birth' )->value( $_POST['date_of_birth'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'gender' )->value( $_POST['gender'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'blood_group' )->value( $_POST['blood_group'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'religion' )->value( $_POST['religion'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'current_address' )->value( $_POST['current_address'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'permanent_address' )->value( $_POST['permanent_address'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'extra_curricular_activities' )->value( $_POST['extra_curricular_activities'] )->pattern( 'text' )->required();\n\t\t\t$validation->name( 'remarks' )->value( $_POST['remarks'] )->pattern( 'text' )->required();\n\n\t\t\tif ( $validation->isSuccess() ) {\n\t\t\t\t$student = new Student();\n\t\t\t\t$student->id = trim( $_POST['id'] );\n\t\t\t\t$student->name = trim( $_POST['name'] );\n\t\t\t\t$student->guardian_id = trim( $_POST['guardian_id'] );\n\t\t\t\t$student->date_of_birth = trim( $_POST['date_of_birth'] );\n\t\t\t\t$student->gender = trim( $_POST['gender'] );\n\t\t\t\t$student->blood_group = trim( $_POST['blood_group'] );\n\t\t\t\t$student->religion = trim( $_POST['religion'] );\n\t\t\t\t$student->current_address = trim( $_POST['current_address'] );\n\t\t\t\t$student->permanent_address = trim( $_POST['permanent_address'] );\n\t\t\t\t$student->registration_no = trim( $_POST['registration_no'] );\n\t\t\t\t$student->extra_curricular_activities = trim( $_POST['extra_curricular_activities'] );\n\t\t\t\t$student->remarks = trim( $_POST['remarks'] );\n\t\t\t\t$student->status = trim( $_POST['status'] );\n\t\t\t\t$student->assignment = trim( $_POST['assignment'] );\n\t\t\t\t$new_file = new File();\n\t\t\t\t//attaching file , this method will work as a validation method for future\n\t\t\t\t//returns false if there are no files given\n\t\t\t\tif ( $new_file->attach_file( $_FILES['photo'] ) ) {\n\t\t\t\t\t//New File directory\n\t\t\t\t\t$new_file->upload_dir = 'images/students';\n\t\t\t\t\t// old file information\n\t\t\t\t\t$this->file->upload_dir = 'images/students';\n\t\t\t\t\t$this->file->file_name = $_POST['oldPhoto'];\n\t\t\t\t\t$student->photo = $new_file->file_name;\n\t\t\t\t\tif ( $student->update() ) {\n\t\t\t\t\t\t//Destroy the old file\n\t\t\t\t\t\tif ( $this->file->destroy() ) {\n\t\t\t\t\t\t\t//Save the new File\n\t\t\t\t\t\t\tif ( $new_file->save() ) {\n\t\t\t\t\t\t\t\tredirect( 'students/index' );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->file->destroy();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdie( 'Could not delete the file' );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdie( 'Something went Wrong' );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$student->photo = $_POST['oldPhoto'];\n\t\t\t\t\tif ( $student->update() ) {\n\t\t\t\t\t\tredirect( 'students/index' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdie( 'Something went Wrong' );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\techo $validation->displayErrors();\n\t\t\t}\n\n\t\t}\n\t}", "function user_students ($target_user = \"\") {\n if (!$target_user) {\n global $user;\n $target_user = $user;\n } else {\n $target_user = eto_user_load(array('name' => $target_user));\n }\n\n if (!$target_user) {\n drupal_not_found();\n exit;\n }\n\n if ($target_user->uid != $user->uid) {\n if (! user_acccess('administer the site')) {\n drupal_access_denied();\n exit;\n }\n }\n\n $title = \"My Students\";\n drupal_set_title($title);\n $output = \"<h2>$title</h2>\\n\";\n\n $students = sb_assignment_load ($target_user->uid, \"student_uid\");\n\n $schedule_url = sb_user_base($target_user) . \"/schedule\";\n \n $output .= l(\"+Add an appointment with a student\", $schedule_url);\n\n if ($students) {\n $output .= \"<ul>\\n\";\n foreach ($students as $uid => $name) {\n $u = eto_user_load($uid);\n $output .= \"<li>\" \n\t. theme('eto_user', $u, TRUE)\n\t. \"</li>\\n\";\n }\n $output .= \"</ul>\\n\";\n } else {\n $output .= \"<p>You have no students assigned yet.</p>\\n\";\n }\n\n return $output;\n}", "public function findStudent()\n {\n //$search = '%'.$search.'%';\n $dql = \"SELECT ae FROM ABCIsystemBundle:AbcMembers ae WHERE ae.idCard like'__02%' and ae.status='active'\";\t\n $repositorio = $this->getEntityManager()->createQuery($dql);\n return $repositorio->getResult();\t\n }", "function wplms_course_student_stats($curriculum,$course_id,$user_id=null){\n $assignments = $this->get_course_assignments($course_id);\n if(is_array($assignments) && count($assignments)){\n $curriculum .= '<li><h5>'._x('Assignments','assignments connected to the course, Course - admin - user - stats','wplms-assignments').'</h5></li>';\n foreach($assignments as $assignment){\n \n $marks = get_post_meta($assignment->post_id,$user_id,true);\n if(is_numeric($marks)){\n $curriculum .= '<li><span data-id=\"'.$assignment->post_id.'\" class=\"done\"></span> '.get_the_title($assignment->post_id).' <strong>'.(($marks)?_x('Marks Obtained : ',' marks obtained in assignment result','wplms-assignments').$marks:__('Under Evaluation','wplms-assignments')).'</strong></li>';\n }else{\n $curriculum .= '<li><span data-id=\"'.$assignment->post_id.'\"></span> '.get_the_title($assignment->post_id).'</li>';\n }\n \n }\n }\n return $curriculum;\n }", "public function student_step5dw(){\n\t\t\t$id = $this->session->userdata['sm_id'];\n\t\t\t//print_r($id);\n\t\t$email = $this->commodel->get_listspfic1(\"student_master\",\"sm_email\",\"sm_id\",$id)->sm_email;\n\t\t$data['email'] = $email;\n\t\t\n\t\t//get the education detail from student_education\n\t\t// availabe final form for printing\n\t\t$this->sname=$this->commodel->get_listspfic1('student_master','sm_fname','sm_id',$id)->sm_fname;\n\t\t$this->mobile=$this->commodel->get_listspfic1('student_master','sm_mobile','sm_id',$id)->sm_mobile;\n\t\t$this->email=$this->commodel->get_listspfic1('student_master','sm_email','sm_id',$id)->sm_email;\n\t\t$this->dob=$this->commodel->get_listspfic1('student_master','sm_dob','sm_id',$id)->sm_dob;\n\t\t$this->uid=$this->commodel->get_listspfic1('student_master','sm_uid','sm_id',$id)->sm_uid;\n\t\t$this->bgroup=$this->commodel->get_listspfic1('student_master','sm_bloodgroup','sm_id',$id)->sm_bloodgroup;\n\n\t\t$this->mname = $this->commodel->get_listspfic1('student_parent','spar_mothername','spar_smid',$id)->spar_mothername;\t\t\n\t\t$this->fname=$this->commodel->get_listspfic1('student_parent','spar_fathername','spar_smid',$id)->spar_fathername;\n\t\t$this->ncid = $this->commodel->get_listspfic1('student_program','sp_programid','sp_smid',$id)->sp_programid;\n\t\t$this->pname = $this->commodel->get_listspfic1('program','prg_name','prg_id',$this->ncid)->prg_name;\n\t\t$this->gender=$this->commodel->get_listspfic1('student_master','sm_gender','sm_id',$id)->sm_gender;\n\t\n\t\t//postal address detail\n\t\t$this->padd=$this->commodel->get_listspfic1('student_parent','spar_paddress','spar_smid',$id)->spar_paddress;\n\t\t$this->cadd=$this->commodel->get_listspfic1('student_parent','spar_caddress','spar_smid',$id)->spar_caddress;\n\t\t$this->pcity=$this->commodel->get_listspfic1('student_parent','spar_pcity','spar_smid',$id)->spar_pcity;\n\t\t$this->ccity=$this->commodel->get_listspfic1('student_parent','spar_ccity','spar_smid',$id)->spar_ccity;\n\t\t$this->ppost=$this->commodel->get_listspfic1('student_parent','spar_ppostoffice','spar_smid',$id)->spar_ppostoffice;\n\t\t$this->cpost=$this->commodel->get_listspfic1('student_parent','spar_cpostoffice','spar_smid',$id)->spar_cpostoffice;\n\t\t$this->pdist=$this->commodel->get_listspfic1('student_parent','spar_pdistrict','spar_smid',$id)->spar_pdistrict;\n\t\t$this->cdist=$this->commodel->get_listspfic1('student_parent','spar_cdistrict','spar_smid',$id)->spar_cdistrict;\n\t\t$this->pstat=$this->commodel->get_listspfic1('student_parent','spar_pstate','spar_smid',$id)->spar_pstate;\n\t\t$this->cstat=$this->commodel->get_listspfic1('student_parent','spar_cstate','spar_smid',$id)->spar_cstate;\n\t\t$this->ppin=$this->commodel->get_listspfic1('student_parent','spar_ppincode','spar_smid',$id)->spar_ppincode;\n\t\t$this->cpin= $this->commodel->get_listspfic1('student_parent','spar_cpincode','spar_smid',$id)->spar_cpincode;\n\t\t\n\t\t$this->cateid=$this->commodel->get_listspfic1('student_master','sm_category','sm_id',$id)->sm_category;\n\t\t$this->catename=$this->commodel->get_listspfic1('category','cat_name','cat_id',$this->cateid)->cat_name;\n\n\t\t//fees detail\n\t\t$this->prog=$this->commodel->get_listspfic1('program','prg_name','prg_id',$this->ncid)->prg_name;\n\t\t$this->amnt=$this->commodel->get_listspfic1('student_fees','sfee_feeamount','sfee_smid',$id)->sfee_feeamount;\n\t\t$this->pmethod=$this->commodel->get_listspfic1('student_fees','sfee_paymentmethod','sfee_smid',$id)->sfee_paymentmethod;\n\t\t$this->rno=$this->commodel->get_listspfic1('student_fees','sfee_referenceno','sfee_smid',$id)->sfee_referenceno; \n\t\t$this->fid=$this->commodel->get_listspfic1('student_fees','sfee_id','sfee_smid',$id)->sfee_id; \n\t\t$this->bname=$this->commodel->get_listspfic1('student_fees','sfee_bankname','sfee_smid',$id)->sfee_bankname;\n\n\t\t$this->rollno = $this->commodel->get_listspfic1('student_entry_exit','senex_rollno','senex_smid',$id)->senex_rollno;\n\t\t\n\t\t//education detail\n\t\t$this->seresult = $this->commodel->get_listrow('student_education','sedu_smid',$id)->result();\n\t\t//get photo or sign\n\t\t$this->phresult = $this->commodel->get_listspfic1('student_master','sm_photo','sm_id',$id)->sm_photo;\n\t\t$this->signresult = $this->commodel->get_listspfic1('student_master','sm_signature','sm_id',$id)->sm_signature;\n\t\t\n\t\t$this->load->library('pdf');\n \t\t$this->pdf->load_view('student/student_step5dw');\n \t$this->pdf->render();\n \t$this->pdf->stream(\"Student_Admission.pdf\");\n\t\t\n\t\t//$this->load->view('student/student_step5');\n\t}", "public function get_studentedit() {\n if(Auth::check()) {\n $student = Student::where('net_id', '=', Auth::user()->net_id)->first(); \n return View::make('account.student_edit')->with_student($student);\n \n }\n else\n return Redirect::to('/');\n }", "public function nomsaAction()\r\n {\r\n $tuser = new TUser();\r\n $select = $tuser->select()->where('nomSA is NULL');\r\n $records = $tuser->fetchAll($select);\r\n foreach ($records as $record) {\r\n $record->majSA();\r\n }\r\n }", "public function show(Studentadd $studentadd)\n {\n //\n }", "public static function noteStudent()\n {\n $post = json_decode( file_get_contents(\"php://input\"), true);\n $id = ($post[\"member\"][0]['club_id']);\n\n $noteClub = \\Models\\Club::markClub($id)-> note_club;\n\n //var_dump($noteClub); // 20\n $tempPR = true;\n //var_dump($post[\"member\"]);\n $total_member = 0;\n $count_member = 0;\n $nbValidate = 0;\n $nbNoValidate = 0;\n\n foreach ($post[\"member\"] as $value)\n {\n if( $value['project'] != 'PR+' )\n {\n $total_member += $value['member_mark'];\n $count_member++;\n if ($value[\"project\"] == \"PR\")\n {\n if ($value[\"project_validation\"]) { // Si projet validé\n //var_dump($value);\n $nbValidate++;\n if ($value[\"member_mark\"] < 10) {\n $tempPR = false;\n }\n }\n else {\n $nbNoValidate++;\n if ($value[\"member_mark\"] >= 10) $tempPR = false;\n }\n }\n }\n }\n $total = $noteClub * $count_member;\n $max = 20 * ( $count_member - $nbNoValidate ) + $nbNoValidate * 9;\n\n $lockmark = \\Models\\Club::isLock($id);\n $lockmark = $lockmark['lock_member_mark'];\n //if( $_SESSION['user']->is_Evaluator == '1')\n\n //var_dump($total_member == $total);\n //var_dump($lockmark);\n //var_dump($tempPR);\n\n //if($total_member <= $total && $lockmark && $tempPR){\n if( ($count_member * $noteClub > $max) && $lockmark && $tempPR){\n $i = 0;\n foreach ($post[\"member\"] as $value){\n $i += intval(\\Models\\Member::noteStudent($value),10);\n }\n if(count($post[\"member\"]) == $i)\n echo 1;\n else echo 0;\n } else echo 0;\n }", "public function studentProfile($student_name,$user_id) {\n\t\t//assign public class values to function variable\n\t\t$data = $this->data;\n\t\t$data['common_data'] = $this->common_data;\n\t\t$data['page'] = 'my_profile';\n\t\t$data['pageName'] = 'My Profile';\n\t\tif(isset($data['common_data']['user_data']['role']) && $data['common_data']['user_data']['role'] == INACTIVE_STATUS_ID){\n\t\t\theader(\"Location: \".ROUTE_PROFILE);\n\t\t\tdie();\n\t\t}\n\t\t$data['user_details'] = $this->user_model->getUserById($user_id);\n\t\tif(preg_replace(\"/&([a-z])[a-z]+;/i\", \"$1\", htmlentities(strtolower(str_replace(' ', '', $data['user_details']['first_name'])))) != preg_replace(\"/&([a-z])[a-z]+;/i\", \"$1\", htmlentities(strtolower(str_replace(' ', '', $tutor_name))))){\n\t\t\theader(\"Location: \".ROUTE_ERROR_PAGE);\n\t\t\tdie();\n\t\t}\n\t\t$data['student_subjects'] = $this->user_model->getSubjectsByStudentId($user_id);\n\t\t$student_subjects_id = $this->profile_model->getSubjectsByStudentId($user_id);\n\t\t$subject_id = \"\";\n\t\tif(!empty($student_subjects_id)){\n\t\t\tforeach ($student_subjects_id as $sub_id){\n\t\t\t\t$subject_id .= $sub_id.\",\";\n\t\t\t}\n\t\t}\n\t\t$data['related_students'] = \"\";\n\t\tif(!empty($subject_id)){\n\t\t\t$subject_id = rtrim($subject_id,',');\n\t\t\t$data['related_students'] = $this->profile_model->relatedStudents($subject_id,$user_id);\n\t\t}\n\t\t$data['student_reviews'] = $this->reviews_model->getStudentReviews($user_id);\n\t\tif(empty($data['user_details']) || $data['user_details']['role'] != STUDENT){\n\t\t\theader(\"Location: \".ROUTE_ERROR_PAGE);\n\t\t\tdie();\n\t\t}\n\t\t$template['body_content'] = $this->load->view('frontend/profile/student-profile', $data, true);\t\n\t\t$this->load->view('frontend/layouts/template', $template, false);\n\t}", "public function isStudent(){\n\t\t// get user type\n\t\t$session_data = $this->session->userdata('logged_in'); // get userid from session\n\t\t\t\n\t\t// redirect to home if user is not a student\n\t\tif($session_data['usertype']!=0) redirect('/home');\n\t}", "public function show(Exam $exam)\n {\n// dd($exam->students);\n $qcount = count($exam->questions);\n $tfq = 0;\n $mcq = 0;\n $mrq = 0;\n $saq = 0;\n $r = null;\n $c = 0;\n $m = 0;\n $r = 0;\n $d = null;\n foreach ($exam->questions as $q) {\n if ($q->questiontable_type == \"TFQuestion\") {\n $tfq++;\n }\n if ($q->questiontable_type == \"MCQuestion\") {\n $mcq++;\n }\n if ($q->questiontable_type == \"MRQuestion\") {\n $mrq++;\n }\n if ($q->questiontable_type == \"SAQuestion\") {\n $saq++;\n }\n }\n foreach ($exam->students as $st) {\n if ($st->id_student != $r) {\n $c++;\n $r = $st->id_student;\n }\n if ($st->pivot->mark >= 10) {\n $m++;\n }\n }\n foreach ($exam->groupes as $gr) {\n\n $r += count($gr->students);\n $d = $gr->pivot->date_scheduling;\n }\n\n\n return view('teacher.exams.show')->with('exams', $exam)\n ->with('tfq', $tfq)->with('mrq', $mrq)->with('mcq', $mcq)->with('qcount', $qcount)\n ->with('tst', $c)->with('pst', $m)->with('saq', $saq)\n ->with('stn', $r - 1)->with('dsch', $d);\n }", "public function Student_leaders()\r\n\t{\r\n $data['department']=$this->Site_model->get_departments();\r\n $data['students']=$this->Site_model->get_students();\r\n\t\t$this->load->view('inc/header',$data);\r\n $this->load->view('site/student_leaders',$data);\r\n $this->load->view('inc/footer');\r\n\t}", "public function postStudent(Request $request)\n {\n $l1t1=Exam::with('subject')\n ->where('department_id', $request->input('department_id'))\n ->where('students_id', $request->input('students_id'))\n ->where('quiz', $request->input('quiz'))\n ->where('levelTerm', 'l1t1')\n ->get();\n //check if first year first semester request quiz data present\n if(!count($l1t1)) {\n $notification= array('title' => 'Not Found!', 'body' => 'Any subject of first year first semester for '.$request->input('quiz').' not present!');\n return redirect()->back()->with(\"error\", $notification);\n }\n\n $L1T1data=(object)$this->dataManupulator($l1t1);\n $l1t2=Exam::with('subject')\n ->where('department_id', $request->input('department_id'))\n ->where('students_id', $request->input('students_id'))\n ->where('quiz', $request->input('quiz'))\n ->get();\n //check if first year second semester request quiz data present\n if(!count($l1t2)) {\n $notification= array('title' => 'Not Found!', 'body' => 'Any subject of first year second semester for '.$request->input('quiz').' not present!');\n return redirect()->back()->with(\"error\", $notification);\n }\n\n $L1T2data=(object)$this->dataManupulator($l1t2);\n $fyp=($L1T1data->totalPoint+$L1T2data->totalPoint);\n $fyc=$L1T1data->totalCredit+$L1T2data->totalCredit;\n $fyGPA=$fyp/$fyc;\n $fyData =[\n 'grade' => $this->yearGrade($fyGPA),\n 'point' => $fyGPA,\n 'credit' => $fyc,\n ];\n //First Year data colection code end\n $l2t1=Exam::with('subject')\n ->where('department_id', $request->input('department_id'))\n ->where('students_id', $request->input('students_id'))\n ->where('quiz', $request->input('quiz'))\n ->get();\n //check if second year first semester request quiz data present\n if(!count($l2t1)) {\n $notification= array('title' => 'Not Found!', 'body' => 'Any subject of second year first semester for '.$request->input('quiz').' not present!');\n return redirect()->back()->with(\"error\", $notification);\n }\n $L2T1data=(object)$this->dataManupulator($l2t1);\n $l2t2=Exam::with('subject')\n ->where('department_id', $request->input('department_id'))\n ->where('students_id', $request->input('students_id'))\n ->where('quiz', $request->input('quiz'))\n ->get();\n //check if second year second semester request quiz data present\n if(!count($l2t2)) {\n $notification= array('title' => 'Not Found!', 'body' => 'Any subject of second year second semester for '.$request->input('quiz').' not present!');\n return redirect()->back()->with(\"error\", $notification);\n }\n $L2T2data=(object)$this->dataManupulator($l2t2);\n $syp=($L2T1data->totalPoint+$L2T2data->totalPoint);\n $syc=$L2T1data->totalCredit+$L2T2data->totalCredit;\n $syGPA=$syp/$syc;\n $syData =[\n 'grade' => $this->yearGrade($syGPA),\n 'point' => $syGPA,\n 'credit' => $syc,\n ];\n //Second Year data colection code end\n $l3t1=Exam::with('subject')\n ->where('department_id', $request->input('department_id'))\n ->where('students_id', $request->input('students_id'))\n ->where('quiz', $request->input('quiz'))\n ->get();\n //check if third year first semester request quiz data present\n if(!count($l3t1)) {\n $notification= array('title' => 'Not Found!', 'body' => 'Any subject of Third year first semester for '.$request->input('quiz').' not present!');\n return redirect()->back()->with(\"error\", $notification);\n }\n $L3T1data=(object)$this->dataManupulator($l3t1);\n $l3t2=Exam::with('subject')\n ->where('department_id', $request->input('department_id'))\n ->where('session', $request->input('session'))\n ->where('students_id', $request->input('students_id'))\n ->where('quiz', $request->input('quiz'))\n ->where('levelTerm', 'l3t2')\n ->get();\n //check if third year second semester request quiz data present\n if(!count($l3t2)) {\n $notification= array('title' => 'Not Found!', 'body' => 'Any subject of third year second semester for '.$request->input('quiz').' not present!');\n return redirect()->back()->with(\"error\", $notification);\n }\n $L3T2data=(object)$this->dataManupulator($l3t2);\n $typ=($L3T1data->totalPoint+$L3T2data->totalPoint);\n $tyc=$L3T1data->totalCredit+$L3T2data->totalCredit;\n $tyGPA=$typ/$tyc;\n $tyData =[\n 'grade' => $this->yearGrade($tyGPA),\n 'point' => $tyGPA,\n 'credit' => $tyc,\n ];\n //third Year data colection code end\n\n\n $l4t1=Exam::with('subject')\n ->where('department_id', $request->input('department_id'))\n ->where('session', $request->input('session'))\n ->where('students_id', $request->input('students_id'))\n ->where('quiz', $request->input('quiz'))\n ->where('levelTerm', 'l4t1')\n ->get();\n\n //check if 4th year first semester request quiz data present\n if(!count($l4t1)) {\n $notification= array('title' => 'Not Found!', 'body' => 'Any subject of 4th year first semester for '.$request->input('quiz').' not present!');\n return redirect()->back()->with(\"error\", $notification);\n }\n $L4T1data=(object)$this->dataManupulator($l4t1);\n $l4t2=Exam::with('subject')\n ->where('department_id', $request->input('department_id'))\n ->where('session', $request->input('session'))\n ->where('students_id', $request->input('students_id'))\n ->where('quiz', $request->input('quiz'))\n ->where('levelTerm', 'l4t2')\n ->get();\n //check if 4th year second semester request quiz data present\n if(!count($l4t2)) {\n $notification= array('title' => 'Not Found!', 'body' => 'Any subject of 4th year second semester for '.$request->input('quiz').' not present!');\n return redirect()->back()->with(\"error\", $notification);\n }\n $L4T2data=(object)$this->dataManupulator($l4t2);\n\n $t4yp=($L4T1data->totalPoint+$L4T2data->totalPoint);\n $t4yc=$L4T1data->totalCredit+$L4T2data->totalCredit;\n $t4yGPA=$typ/$tyc;\n $t4yData =[\n 'grade' => $this->yearGrade($t4yGPA),\n 'point' => $t4yGPA,\n 'credit' => $t4yc,\n ];\n //4th Year data colection code end\n\n\n //result Data\n $fPoint = (($fyp+$syp+$typ+$t4yp)/($fyc+$syc+$tyc+$t4yc));\n $fGrade= $this->yearGrade($fPoint);\n $fResult=\"FAIL\";\n if($fPoint>0.00) {\n $fResult=\"PASS\";\n }\n $result=[\n 'point' => $fPoint,\n 'grade' =>$fGrade,\n 'result' => $fResult,\n ];\n $student= Student::findOrFail($request->input('students_id'));\n $metaDatas= [\n 'name' => $student->firstName.' '.$student->middleName.' '.$student->lastName,\n 'dob' => $student->dob->format('F j,Y'),\n ];\n $metaData= (object)$metaDatas;\n return view(\n 'reports.result.transcript', compact(\n 'metaData',\n 'L1T1data', 'L1T2data', 'fyData',\n 'L2T1data', 'L2T2data', 'syData',\n 'L3T1data', 'L3T2data', 'tyData',\n 'L4T1data', 'L4T2data', 't4yData',\n 'result'\n )\n );\n }", "public function viewAllStudents() {\n return view('admin.students.student', [\n 'students' => User::query()->with('program')->paginate(config('mv-notification.paginate')),\n ]);\n }", "public function studiengang_details() {\r\n\r\n //Sprachen rausfinden:\r\n $this->sprachen = StgProfil::getPossibleLanguages();\r\n //Abschlüsse suchen:\r\n $this->abschlusssuche = new SQLSearch(\"SELECT abschluss_id, name FROM abschluss WHERE name LIKE :input\", _(\"Abschluss eingeben\"));\r\n //zulassungsvoraussetzung:\r\n $this->moeglicheZulassungsvoraussetzungen_wise = DBHelper::getEnumOptions(\"stg_profil\", \"zulassungsvoraussetzung_wise\");\r\n $this->moeglicheZulassungsvoraussetzungen_sose = DBHelper::getEnumOptions(\"stg_profil\", \"zulassungsvoraussetzung_sose\");\r\n //Typen von Studiengängen:\r\n $this->moeglicheStgTypen = StgProfil::getMoeglicheTypen();\r\n\r\n $this->studiengaenge = PersonalRechte::meineStudiengaenge(null, true);\r\n $this->abschluesse = Abschluss::findAllUsed();\r\n $this->profile = StgProfil::getMeineProfile(null, Request::get(\"studiengang_id\"), Request::get(\"abschluss_id\"));\r\n\r\n //Neuen Eintrag in stg_profil erstellen\r\n if (Request::get(\"item_id\") === \"neu\" && !Request::get(\"studiengang_id\")) {\r\n //$this->profil = new StgProfil();\r\n $this->fachsuche = new SQLSearch(\"SELECT studiengang_id, name FROM studiengaenge WHERE name LIKE :input OR beschreibung LIKE :input \", _(\"Studiengang eingeben\"));\r\n $this->render_template('zsb_studiengang/details_studiengang', $this->layout);\r\n return;\r\n }\r\n\r\n $this->profil = new StgProfil(Request::get(\"studienprofil_id\") !== \"neu\" ? Request::get(\"studienprofil_id\") : null);\r\n if (!$this->profil->hasPermission()) {\r\n throw new AccessDeniedException(_(\"Sie dürfen diesen Studiengang nicht bearbeiten\"));\r\n }\r\n if (Request::get(\"delete_x\") && Request::get(\"item_id\") && Request::get(\"type\") === \"dokument\") {\r\n $this->profil->deleteDoku(Request::get(\"item_id\"));\r\n $this->flash_now(\"success\", _(\"Dokumentenzuordnung gelöscht\"));\r\n }\r\n if (Request::get(\"addDocument\")) {\r\n $this->profil->addDoku(Request::get(\"addDocument\"));\r\n $this->flash_now(\"success\", _(\"Dokumentenzuordnung hinzugefügt\"));\r\n }\r\n //Profil ändern, falls Informationen gesendet worden sind:\r\n if (Request::submitted(\"absenden\")) {\r\n if (Request::get(\"studiengang_id\")) {\r\n //Neuen Eintrag in stg_profil machen:\r\n $this->profil['fach_id'] = Request::get(\"studiengang_id\");\r\n $this->profil->store(); //Nachher wird noch einmal gestored, aber jetzt wollen wir IDs bekommen.\r\n }\r\n if (Request::submitted('informationen')) {\r\n $this->profil->setInformation(Request::getArray(\"informationen\"));\r\n }\r\n if (Request::submitted(\"abschluss_id\")) {\r\n $this->profil['abschluss_id'] = Request::get(\"abschluss_id\");\r\n }\r\n if (Request::submitted('settings')) {\r\n $settings = Request::getArray(\"settings\");\r\n foreach ($settings as $key => $value) {\r\n $this->profil[$key] = $value;\r\n }\r\n if (!$settings['sichtbar']) {\r\n $this->profil['sichtbar'] = 0;\r\n }\r\n }\r\n if (Request::submitted(\"zielvereinbarung\")) {\r\n $this->profil['zielvereinbarung'] = Request::get(\"zielvereinbarung\");\r\n }\r\n if (Request::submitted(\"einleitungstext\")) {\r\n $this->profil['einleitungstext'] = Request::get(\"einleitungstext\");\r\n }\r\n if (Request::submitted('typen')) {\r\n $this->profil->setTypen(Request::getArray(\"typen\"));\r\n }\r\n $this->profil->store();\r\n\r\n if (Request::submitted('textcombination')) {\r\n $textcombinations = (array) @$_REQUEST['textcombination'];\r\n Textbaustein::removeCombination($this->profil->getId());\r\n foreach ($textcombinations as $code => $ids) {\r\n Textbaustein::addCombination($this->profil->getId(), $code, $ids);\r\n }\r\n }\r\n\r\n $this->flash_now(\"success\", _(\"Änderungen wurden übernommen\"));\r\n if (Request::get(\"neues_dokument\")) {\r\n $dokument = new StgFile();\r\n if ($_GET['qqfile'] || isset($_FILES['qqfile'])) {\r\n ob_start();\r\n $dokument->upload();\r\n ob_clean();\r\n }\r\n $dokument['name'] = Request::get(\"neues_dokument_name\");\r\n $dokument['sichtbar'] = Request::get(\"neues_dokument_sichtbar\") ? '1' : '0';\r\n $dokument['jahr'] = Request::get(\"neues_dokument_jahr\");\r\n $dokument['doku_typ_id'] = Request::get(\"neues_dokument_doku_typ_id\");\r\n $dokument['quick_link'] = Request::get(\"neues_dokument_quick_link\");\r\n $dokument['user_id'] = $GLOBALS['user']->id;\r\n $dokument->store();\r\n $dokument->setTags(Request::get(\"neues_dokument_tags\"));\r\n $this->profil->addDoku($dokument->getId());\r\n if ($dokument->isPublic()) {\r\n $this->flash_now(\"success\", _(\"Neues Dokument angelegt und hinzugefügt\"));\r\n } else {\r\n $this->flash_now(\"success\", _(\"Neues internes Dokument angelegt und hinzugefügt. Es kann unter Akkreditierung gefunden werden.\"));\r\n }\r\n }\r\n if (Request::get(\"neuer_ansprechpartner\")) {\r\n $kontakt = new StgAnsprechpartner();\r\n $kontakt['range_typ'] = Request::get(\"range_typ\");\r\n $kontakt['range_id'] = Request::get(\"range_typ\") && Request::get(\"range_id\") ? Request::get(\"range_id\") : \"\";\r\n\r\n if (Request::get(\"ansprechpartner_typ_id\")) {\r\n $typen = StgAnsprechpartner::getAnsprechpartnerTypen();\r\n foreach ($typen as $typ) {\r\n if ($typ['ansprechpartner_typ_id'] === Request::get(\"ansprechpartner_typ_id\")) {\r\n $kontakt['ansprechpartner_typ_id'] = Request::get(\"ansprechpartner_typ_id\");\r\n }\r\n }\r\n }\r\n $kontakt['freitext_name'] = Request::get(\"freitext_name\");\r\n $kontakt['freitext_mail'] = Request::get(\"freitext_mail\");\r\n $kontakt['freitext_telefon'] = Request::get(\"freitext_telefon\");\r\n $kontakt['freitext_homepage'] = Request::get(\"freitext_homepage\");\r\n if ($kontakt->store()) {\r\n $this->profil->addAnsprechpartner($kontakt->getId());\r\n $this->flash_now(\"success\", _(\"Neuer Ansprechpartner angelegt und hinzugefügt\"));\r\n }\r\n }\r\n }\r\n\r\n //Informationen:\r\n $this->informationen = $this->profil->getInformation();\r\n\r\n //Verlaufspläne\r\n $this->verlaufsplaene = $this->profil->getVerlaufsplaene();\r\n\r\n //Dateien:\r\n $this->dateien = StgFile::getByStgProfil($this->profil->getId());\r\n $this->dokumentensuche = $this->getDokumentensuche();\r\n\r\n //Kontakte:\r\n $this->kontakte = StgAnsprechpartner::getByStgProfil($this->profil->getId());\r\n usort($this->kontakte, function ($a, $b) {\r\n return strcmp($a->getName('no_title_rev'), $b->getName('no_title_rev'));\r\n });\r\n $this->kontakt_neu = new StgAnsprechpartner();\r\n $this->ansprechpartnertypen = StgAnsprechpartner::getAnsprechpartnerTypen();\r\n\r\n\r\n //Aufbaustudiengänge:\r\n $this->mutterstudiengaenge = $this->profil->getAufbauendeStudiengaenge();\r\n $this->profilsuche = $this->getProfilSuche();\r\n\r\n\r\n // Textbausteine\r\n $this->textbausteine = array(\r\n 'de' => Textbaustein::loadAll('de'),\r\n 'en' => Textbaustein::loadAll('en'),\r\n );\r\n $this->textcombinations = Textbaustein::loadCombination($this->profil->getId());\r\n\r\n $this->ansprechpartnersuche = $this->getAnsprechpartnersuche();\r\n $this->datei_url = $this->link_for(\"zsb_dateien/download_file\");\r\n $this->render_template('zsb_studiengang/details_studiengang', $this->layout);\r\n //hiernach wird nichts weiter ausgegeben\r\n }", "public function fullName(){\n $fullName=parent::fullName();\n return $fullName.\", Policier \".$this->grade.\" <br/>\"; \n }", "public function showstudentsAction() { \r\n $students = $this->getDoctrine()\r\n ->getRepository(Student::class)\r\n ->findAll();\r\n\r\n foreach ($students as $student) {\r\n $student->getClassroom();\r\n }\r\n\r\n return $this->render('admin/admin-student/adminStudentDashboard.html.twig', [\r\n 'students' => $students,\r\n ]);\r\n }", "function drewnewStudent()\n{\n\tglobal $students;\n\tif($students != NULL)\n\t{\n\t\techo \"<div class='col-md-12' style='color:#0f0039;text-align:center'>\";\n\t\techo \"<table class='table table-hover'>\";\n\t\techo \"<thead>\";\n\t\techo \"<tr style='text-align:center'>\";\n\t\techo\"<th> Name</th>\";\n\t\techo\"<th> Mail</th>\";\n\t\techo\"<th> Gender</th>\";\n\t\techo\"<th> Profile Pic</th>\";\n\t\techo\"<th> Birth-Date</th>\";\n\t\techo\"<th> Collage</th>\";\n\t\techo\"<th> Grades</th>\";\n\t\techo\"<th> Graduation-year</th>\";\n\t\techo\"<th> Branch</th>\";\n\t\techo\"<th> Track</th>\";\n\t\techo\"<th> Action</th>\";\n\t\techo \"</tr></thead>\";\n\t\techo\"<tbody><tr>\";\n\t\t\n\t\tforeach ($students as $key => $student) \n\t\t{\n\t\t\techo\"<td>\".$student['name'].\"</td>\";\n\t\t\techo\"<td>\".$student['mail'].\"</td>\";\n\t\t\techo\"<td>\".$student['gender'].\"</td>\";\n\t\t\techo\"<td><img src='../\".$student['pic'].\"' style='width:45px;height:40px;margin-left:10px;' class='img-responsive img-rounded'/></td>\";\n\t\t\techo\"<td>\".$student['bod'].\"</td>\";\n\t\t\techo\"<td>\".$student['collage'].\"</td>\";\n\t\t\techo\"<td>\".$student['grades'].\"</td>\";\n\t\t\techo\"<td>\".$student['grad_year'].\"</td>\";\n\t\t\techo\"<td>\".$student['Branch'].\"</td>\";\n\t\t\techo\"<td>\".$student['Track'].\"</td>\";\n\t\t\techo\"<td><button class='btn btn-success'>activate</button></td>\";\n\n\t\t}\n\t\techo \"</tr></tbody></table></div>\";\n\t}\n\telse\n\t{\n\t\techo\"<div class='col-md-12' style='text-align:center;'>\";\n\t\techo \"<span style='color:#ccc;font-size:18px'> No new students registered ... <span>\";\n\t\techo \"</div>\";\n\t}\n\t\n}", "function assignstudent(){\n\t\t\n\t\t$insert = array();\n\t\t$insert['rolename'] = $this->input->post(\"rolename\");\n\t\t$insert['user_id'] = $this->input->post(\"studentid\");\t\t\n\t\t$azureRoleDetails = $this->Azure->getAzureRoleDetails($insert['rolename']);\n\t\t$insert['azure_vm_id'] = $azureRoleDetails['id'];\n\t\t\n\t\t$user = $this->User->getUser($insert['user_id']);\n\t\t// $vminfo = $this->Azure->;\n if($user){ \n \t$return = $this->Azure->assignStudent($insert);\n\t\t}else\n $return = array(\"type\" => \"danger\",\"msg\" => \"The students was not found.\");\t\t\t\n\t\t\n\t\techo json_encode($return);\n\t}", "function preInterimInformation( $StudentID ) {\r\n\t\t$query = \"SELECT FIRST_NAME, MIDDLE_NAME, LAST_NAME, WOOSTER_EMAIL, CLASS_YEAR FROM X_PNSY_STUDENT WHERE ID='\".$StudentID.\"'\";\r\n\t\t$result = mysql_fetch_assoc(mysql_query($query));\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "public function run()\n {\n $users = User::where('role_id',3)->get();\n $index = 1;\n foreach ($users as $user) {\n $student = new Student();\n $student->codigo = \"ALUM-{$index}\";\n $user->student()->save($student);\n $index++;\n }\n }", "public function Sectionwise()\n {\n $class=classes::where('bid', Auth::guard('web')->user()->bId)->get();\n $section=Section::where('bid', Auth::guard('web')->user()->bId)->get();\n $sessionYear= SessionYear::where('bId', Auth::guard('web')->user()->bId)->get();\n\n return view('backend.pages.mystudent.sectionwiseStudent')->with('class', $class)->with('section', $section)->with('sessionYear',$sessionYear);\n\n }", "function transStudents($students) {\r\n return ($students < MINIMUMSTUDENTS) ? TRUE : FALSE;\r\n }" ]
[ "0.6708018", "0.6383867", "0.63766533", "0.6299165", "0.6172249", "0.615714", "0.61459464", "0.6139071", "0.6112886", "0.60840887", "0.6074119", "0.6066228", "0.6044893", "0.6042174", "0.60297847", "0.60128653", "0.60054636", "0.60029644", "0.5996473", "0.5993884", "0.5971006", "0.59502864", "0.5942465", "0.5941876", "0.5938891", "0.5934599", "0.5934599", "0.5934599", "0.5934599", "0.5934599", "0.5934599", "0.5934599", "0.5934599", "0.5934599", "0.5934599", "0.5934599", "0.5934599", "0.5934599", "0.5934599", "0.59334904", "0.58758205", "0.5864442", "0.5860519", "0.5860481", "0.5836799", "0.5824536", "0.57852703", "0.5784289", "0.57486016", "0.57447535", "0.5740544", "0.5731507", "0.57303685", "0.5729913", "0.5719348", "0.57148254", "0.5707051", "0.5691805", "0.56902575", "0.5689386", "0.56815577", "0.5680066", "0.5661501", "0.56594133", "0.56467384", "0.56467", "0.5644312", "0.5643303", "0.56343067", "0.56296307", "0.5628134", "0.5618182", "0.5616385", "0.56080145", "0.56080145", "0.5583682", "0.5580835", "0.5579665", "0.55790657", "0.5570209", "0.55674946", "0.5549928", "0.55373335", "0.553289", "0.55322695", "0.55193585", "0.55189", "0.5516002", "0.55135846", "0.55125386", "0.55106735", "0.54974765", "0.54938465", "0.5492027", "0.54920197", "0.5480664", "0.5478464", "0.54756963", "0.54750836", "0.54682153", "0.5465548" ]
0.0
-1
Haalt de status op van een gebruiker en kijkt na of de gebruiker is ingeschreven
function getEnrolledStatus($columnId, $userId) { $this->db->where('planningKolomId', $columnId); $this->db->where('gebruikerId', $userId); return $this->db->get('aanwezigheid')->row(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStatus() \n {\n if ($this->status) \n {\n \techo 'user status : присутствует<br><br><br>';\n }\n else\n {\n \techo 'user status : отсутствует<br><br><br>';\t\n }\n }", "function status()\n{\n\t$username = $this->Session->read('user');\n\tif (!$username){\n\t$this->redirect('/users/login');}\n\t\n\t// set knownusers\n\t$this->set('knownusers', $this->User->findAll(null, array('id', 'username',\n\t'first_name', 'last_name', 'last_login'), 'id DESC'));\n}", "private function status()\n {\n $this->botman->hears('status', function(BotMan $bot) {\n\n $status = 'subscribed';\n $user = Subscriber::where('telegram_user_id', $bot->getUser()->getId())->first();\n\n if(is_null($user))\n {\n $status = 'unsubscribed';\n }\n\n $bot->reply('status: '. $status);\n });\n }", "function check_biller_status() {\n\t\t$user_id = $_REQUEST['user_id'];\n\t\tif (!empty($user_id)) {\n\t\t\t$biller_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\tif (!empty($biller_records)) {\n\t\t\t\t$biller_status = $biller_records[0]['biller_status'];\n\t\t\t\t$user_id = $biller_records[0]['user_id'];\n\t\t\t\t$biller_id = $biller_records[0]['biller_id'];\n\t\t\t\t$post = array('status' => \"true\", \"biller_status\" => $biller_status, 'user_id' => $user_id, 'biller_id' => $biller_id);\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Invalid user id\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing parameter\", 'user_id' => $user_id);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function validateStatus()\n {\n if (!$this->hasErrors()) {\n $user = $this->getUser();\n\n if ($user->status==User::STATUS_BLOCKED || $user->status==User::STATUS_DELETED) {\n $this->addError('password', Yii::t('app','Your account is blocked, please contact support.'));\n }\n\n if ($user->status==User::STATUS_EMAIL_VALIDATION) {\n $this->addError('password', Yii::t('app','Du hast Deine Registrierung noch nicht abgeschlossen. Prüfe Deine E-Mails, dort findest Du eine E-Mail mit dem Bestätigungslink. Bitte klicke auf diesen Link um Deine Registrierung abzuschliessen.'));\n }\n\n }\n }", "function status($uuid){\n perfil_superior();\n if ($uuid==$this->session->userdata('usuario')[\"uuid\"]) {\n #MENSAJE ERROR\n $this->session->set_flashdata('mensaje_error',\"No puedes cambiar tu propio estado\");\n redirect('usuarios/index','refresh');\n }\n $resultado=$this->Usuario_Model->get_user($uuid);\n if ($resultado[\"status\"]==1) {\n $usuario = [\n \"status\"=> 0,\n \"fecha_modificacion\" => date('Y-m-d H:i:s') \n ];\n $mensaje = \"Desactivado\";\n }else{\n $usuario = [\n \"status\"=> 1,\n \"fecha_modificacion\" => date('Y-m-d H:i:s') \n ];\n $mensaje = \"Activado\";\n }\n $this->Usuario_Model->update($uuid,$usuario);\n\n #MENSAJE EXITO\n $this->session->set_flashdata('mensaje_exito',\"Usuario \".$mensaje);\n redirect('usuarios/index','refresh');\n \n \n }", "public function verificaAppartenenza(){\n \n $sess_user=$this->session->get_userdata('LOGGEDIN');\n $this->utente=$sess_user[\"LOGGEDIN\"][\"userid\"];\n if(isset($sess_user[\"LOGGEDIN\"][\"business\"])){\n \n $this->azienda=$sess_user[\"LOGGEDIN\"][\"business\"];\n \n \n }\n \n \n }", "public function status() {\n $akun=Auth::user();\n $registrasi=Registrasi::with(['vaksin','rs','status'])->where('id_user',$akun->id_user)->orderBy('id_status', 'asc')->orderBy('tgl_pendaftaran', 'desc')->get();\n return view(\"User.akun.status\",['akun'=>$akun,'registrasi'=>$registrasi]);\n }", "function alterarStatus() {\n\n\t\t$codigoParaAlterar = $_GET['codigo'];\n\t\t$statusAutal = $_GET['status'];\n\n\t\tif (true){\n\n\t\t\techo '<div class=\"alert alert-success\"><strong> Status do codigo \"'.$codigoParaAlterar.'\" alterado com sucesso!</strong> </div>';\n\n\t\t}else{\n\n\t\t\techo \"<div class='alert alert-danger espacoForm'><strong>Edição não realizada!</strong> Ocorreu um erro.</div>\";\n\n\t\t}\n\n\n\t}", "public function status()\n {\n if (auth::check()) {\n if (auth::user()->auth == 1) {\n $status = status::all();\n return view('backend.pengaturan.status', compact('status'));\n }\n }\n }", "function active($uid,$st)\n {\n if($st==1)\n {\n $st=0;\n }\n else if($st==0)\n {\n $st=1;\n }\n $query=$this->db2->query(\"UPDATE registered_operators SET status='$st' WHERE id='$uid' \");\n if($query)\n {\n \n $query=$this->db2->query(\"select * from registered_operators where id='$uid'\");\n \n if($query->num_rows()>0)\n {\n \t foreach($query->result() as $rows)\n {\n \t //add all data to session\n $name = $rows->name;\n $username = $rows->user_name;\n\t\t $password = $rows->password;\n $emailid = $rows->email_id;\n $status = $rows->status;\n \n }\n $x=$this->mail_send($name,$username,$password,$emailid,$status);\n if($x){\n return 1;\n}\n }\n \n }\n else\n return 0;\n \n }", "function update_organiser_status(){\r\n\t\t$this->organiser_model->update_organiser_status($_POST['status'],$_POST['organiser_id']);\r\n\t\t$this->send_status_email($_POST['status'],$_POST['organiser_id']);\r\n\t\techo \"1\";exit;\r\n\t}", "public function status() : void\n {\n $jwt = Auth::isValidToken($_COOKIE['SSID']);\n \n if (!$jwt) {\n View::jsonResponse(['status' => 401, 'message' => 'Access denied for you!']);\n }\n\n $data = [ 'status' => $_POST['status'], 'id' => $_POST['statusid']];\n $data = Validator::cleanData($data);\n (new Task())->update($data)->execute();\n header('location: user-profile');\n\n }", "function phb_is_get_user_status($event_id,$user_id)\r\n\t{\r\n global $SITE_URL;\r\n\t\t hb_set_then_go(\"change_invitation_status_then_go\",$SITE_URL.\"future_event.php\");\r\n\t\t if($event_id!=\"\" && $user_id!=\"\")\r\n\t\t {\r\n\t\t $select_status=\"select * from tbl_invitation_responce where user_id='$user_id' and event_id='$event_id'\";\r\n\t\t $status_result=hb_mysql_query($select_status);\r\n\t\t $row_status=hb_mysql_num_rows($status_result);\r\n\t\t\t if($row_status > 0)\r\n\t\t\t {\r\n\t\t\t\t $status_data=hb_mysql_fetch_array($status_result);\r\n\t\t\t\t$rid=$status_data['id'];\r\n\t\t\t\t$uid=$status_data['user_id'];\r\n\t\t\t\t if($status_data['status']==\"1\")\r\n\t\t\t\t {\r\n\t\t\t\t\t return \"<span class='green'>Joining</span> <br> <span class='white'>Change :</span> <a href='join_event.php?event_id=$event_id&status=maybe&type=direct&rid=$rid&u=$uid'>May Be</a> | <a href='join_event.php?event_id=$event_id&status=declined&type=direct&rid=$rid&u=$uid'>Not Joining</a>\" ;\r\n\t\t\t\t }else if($status_data['status']==\"2\")\r\n\t\t\t\t {\r\n\t\t\t\t\t return \"<span class='green'>Maybe</span><br> <span class='white'>Change :</span><a href='join_event.php?event_id=$event_id&status=active&type=direct&rid=$rid&u=$uid'>Join</a>\" ;\r\n\t\t\t\t }else{\r\n\t\t\t\t\t return \"<span class='green'>Not Joining</span> <Br><span class='white'> Change :</span> <a href='join_event.php?event_id=$event_id&status=maybe&type=direct&rid=$rid&u=$uid'>Join</a> | <a href='join_event.php?event_id=$event_id&status=maybe&type=direct&rid=$rid&u=$uid'>May Be</a> \";\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t \r\n\t\t }\r\n\t\r\n\t}", "public function ajax_change_status($id) {\n $result = $this->manager->get_status('user', $id);\n if ($result->status == \"1\") {\n $project_id = $this->manager->update('user', array('user_id' => $id), array('status' => 0));\n \n $subject = \"Account Deactivation Notification\";\n $content = \"<p>Dear \" . ucwords($result->name) . \",</p>\";\n\n $content .= \"<p>We regret to to inform to you that your account \";\n $content .= \"has been automatically disabled from our system due to some problems.</p>\";\n\n $content .= \"<p>Kindly contact our customer care operators at +91 8369516308 \";\n $content .= \"or write to us at [email protected]</p>\";\n\n $content .= \"<p>With your assistance,our team will surely help you to enable your systems again.</p>\";\n\n $content .= \"<p>Thanking you in anticipation.</p>\";\n $content .= \"<p>Regards,</p>\";\n $content .= \"<p>Team Aasaan</p>\";\n $content .= \"<p>http://www.aasaan.co/hajiri</p>\";\n $content .= \"<img src='\" . base_url('assets/admin/images/AASAAN-LOGO.png') . \"' height='80' width='250'/>\";\n \n } else {\n $project_id = $this->manager->update('user', array('user_id' => $id), array('status' => 1));\n \n $subject = \"Account Activation Notification\";\n\n $content = \"<p>Dear \" . ucwords($result->name) . \",</p>\";\n $content .= \"<p>We feel glad to inform you that your account \";\n $content .= \"has been enabled!</p>\";\n\n $content .= \"<p>For any inconvenience do call our customer care services at +91 8369516308 \";\n $content .= \"or write to us at [email protected]</p>\";\n\n $content .= \"<p>Thanking you in anticipation.</p>\";\n $content .= \"<p>Regards,</p>\";\n $content .= \"<p>Team Aasaan</p>\";\n $content .= \"<p>http://www.aasaan.co/hajiri</p>\";\n $content .= \"<img src='\" . base_url('assets/admin/images/AASAAN-LOGO.png') . \"' height='80' width='250'/>\";\n }\n //$result = htmlmail($result->email, $subject, $content);\n $this->session->set_flashdata('success', 'Status Changed Successfully');\n echo json_encode(array(\"status\" => TRUE));\n }", "public function GetStatus()\n\t{\n\t\t// Demnach ist der Status in IPS der einzige der vorliegt.\t\t\n\t}", "public function changestatus_post()\r\n {\r\n $userid=$this->uri->segment(3);\r\n\r\n $user=$this->user_m->get($userid);\r\n if($user->status==\"1\"){\r\n $data=array(\r\n \"status\"=> \"0\"\r\n );\r\n }\r\n else{\r\n $data=array(\r\n \"status\"=> \"1\"\r\n ); \r\n }\r\n if ($succes_status = $this->user_m->update_data($userid,$data)){\r\n if($user->status==\"1\"){\r\n $this->response(\r\n array(\r\n 'Status_code' => \"201\",\r\n 'Message' => \"User Deactivated\"\r\n )\r\n );\r\n }\r\n else{\r\n $this->response(\r\n array(\r\n 'Status_code' => \"201\",\r\n 'Message' => \"User Activated\"\r\n )\r\n ); \r\n }\r\n }\r\n else\r\n {\r\n $this->response(\r\n array(\r\n 'Status_code' => \"401\",\r\n 'Message' => \"ops something went wrong\"\r\n )\r\n ); \r\n }\r\n }", "function update_status()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t\n\t\tif(!empty($data['t']) && !empty($data['list'])) $response = $this->_tender->update_status($data['t'], explode('--',$data['list']));\n\t\t\n\t\t# all good\n\t\tif(!empty($response) && $response['boolean']){\n\t\t\t$data['msg'] = 'The Invitation for Bids/Quotations status has been updated.';\n\t\t\t$data['area'] = 'refresh_list_msg';\n\t\t} \n\t\t# there was an error\n\t\telse {\n\t\t\t$data['msg'] = (!empty($data['t']) && !empty($data['list']))? 'ERROR: There was an error updating the Invitation for Bids/Quotations status.': 'ERROR: This action can not be resolved';\n\t\t\t$data['area'] = 'basic_msg';\n\t\t}\n\t\t\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}", "public function confirmUpdateSettings() {\n\t\techo '<div class=\"alert successful\"><span class=\"btnclose\">&times;</span><strong>Vos identifiants ont bien été mis à jour !</strong></div>';\n\t}", "public function statusBulu(){\r\n\t\t\treturn parent::lihatBulu();\r\n\t\t}", "public function get_status()\n {\n }", "public function get_status()\n {\n }", "public function CheckUser()\n\t{\n\t\tinclude(\"Connection.php\");\n\t\tif(!$link->connect_error)\n\t\t{\n\t\t\t$checkUserSql = \"SELECT * FROM Gebruiker WHERE Email = '\".$this->Email.\"' AND Paswoord = '\".$this->Pass.\"';\";\n\t\t\t$checkUserResult = $link->query($checkUserSql);\t\t\t\t\t\t\t\n\t\t\t$count = $checkUserResult->num_rows;\n\t\t\tif($count==1)\n\t\t\t{\n\t\t\t\t$userdata = mysqli_fetch_assoc($checkUserResult);\n\t\t\t\t$_SESSION[\"UserID\"] = $userdata['GebruikerID'];\n\t\t\t\t$_SESSION[\"UserName\"] = $userdata['Naam'];\n\t\t\t\theader('Location: http://localhost:8888/newAppShareTheCosts/overzichtlijsten.php');\n\t\t\t\texit();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Sorry, we vonden geen account met deze gegevens, probeer opnieuw of maak een account aan\");\t\n\t\t\t}\n\t\tmysqli_close($link);\n\t\t}\n\t}", "public function testGetSuperUserStatus()\n {\n $superStatus = $this->la->getUserSuperUserStatus('poa32kc');\n $this->assertTrue($superStatus);\n }", "function status(){\n return ($this -> is_approved())?\"Approved\":\"Unapproved\";\n }", "public function verified($id)\n {\n $update = User::where('id', $id)->update([\n 'status' => \"Active\"\n ]);\n\n $notif = Notifikasi::where('jenis', 'akun')->first();\n $jumlahnotif = $notif->jumlah - 1;\n $update = Notifikasi::where('jenis', 'akun')->update([\n 'jumlah' => $jumlahnotif,\n ]);\n\n return redirect()->route('daftar_masyarakat')->with('success','user telah di verifikasi');\n }", "public function update_status();", "public static function checkUserStatus(){\n\n if (auth()->user()->is_status == '3') {\n $rul = 'profile/create';\n }elseif (auth()->user()->is_status=='2'){\n $service = self::checkService();\n if ($service==false){\n $rul = \"choose-service\";\n }else{\n $rul = self::dashboard($service);\n }\n }elseif (auth()->user()->is_status=='1'){\n $rul = 'profile done!';\n }elseif (auth()->user()->is_status==0){\n $rul = 'profile inactive!';\n }else{\n $rul = '/home';\n }\n return $rul;\n }", "public function validateUserStatus()\n {\n if (!$this->hasErrors() && ($user = $this->getUser()) && $user->isDisabled() && !$user->isOwner()) {\n $this->addError('status', Yii::t('skeleton', 'Your account is currently disabled. Please contact an administrator!'));\n }\n }", "protected function status()\n {\n }", "public function updateSubmissionStatus() {\n\n $updateStatus = Usersubmissionstatus::where('user_id', Auth::user()->id)\n ->where('quarter_id', Quarter::getRunningQuarter()->id)\n ->update(['status_id' => config('constant.status.L1_APPROVAL_PENDING')]);\n // Let's notify user and L1 about user submission status.\n return $this->sendMail(config('constant.email_status.INFORM_APPRAISEE'));\n }", "function updatestatus() {\n global $_lib;\n\n $dataH = array();\n $dataH['ID'] = $this->transaction->ID;\n $dataH['RemittanceSequence'] = $this->transaction->RemittanceSequence;\n $dataH['RemittanceDaySequence'] = $this->transaction->RemittanceDaySequence;\n $dataH['RemittanceSendtDateTime'] = $_lib['sess']->get_session('Datetime');\n $dataH['RemittanceSendtPersonID'] = $_lib['sess']->get_person('PersonID');\n $dataH['RemittanceStatus'] = 'sent';\n \n #Disse mŒ fjernes nŒr vi har en godkjenningsprosess\n $dataH['RemittanceApprovedDateTime'] = $_lib['sess']->get_session('Datetime');\n $dataH['RemittanceApprovedPersonID'] = $_lib['sess']->get_person('PersonID');\n\n $_lib['storage']->store_record(array('data' => $dataH, 'table' => 'invoicein', 'debug' => false));\n }", "public function ChangeUserOnlineStatus()\n {\n $output['token'] = $this->security->get_csrf_hash();\n header('Content-Type: application/json');\n $output['response'] = $this->database->ChangeUserOnlineStatus('online');\n exit(json_encode($output));\n }", "function getStatus(){\n $this->status = 'Unknown';\n if($this->finAid == 1 && $this->totalOwed != 0){\n if($this->finaidQuestion[1] == ''){\n $this->status = 'Waiting for finaid application';\n return;\n }else{\n $this->status = 'Waiting for finaid decision';\n return;\n }\n }\n if($this->schoolFeeOwed != 0){\n $this->status = 'Waiting for school fee payment';\n return;\n }\n if($this->countryId[1] == 0){\n $this->status = 'Waiting for country preferences';\n return;\n }\n if($this->countryId[1] != 0 && $this->countryConfirm != 1){\n $this->status = 'Waiting for country assignments';\n return;\n }\n if($this->delegateFeeOwed != 0){\n $this->status = 'Waiting for delegate fee payment';\n return;\n }\n if(sizeof($this->attendees) == 0){\n $this->status = 'Waiting for attendee info';\n return;\n }\n if($this->totalOwed < 0){\n $this->status = 'Need Refund';\n return;\n }\n if(sizeof($this->attendees) == $this->totalAttendees && $this->totalOwed == 0){\n $this->status = 'Ready';\n return;\n }\n }", "function _active($info)\n\t{\n\t // Gan trang thai xac thuc\n\t $data = array();\n\t $data['status'] = mod('order')->status('completed');\n\t\n\t // Cap nhat du lieu vao data\n\t model('user_bank')->update($info->id, $data);\n\t // Gui thong bao\n\t set_message(lang('notice_update_success'));\n\t return TRUE;\n\t}", "public function adminConfirmUserReg($id)\n\t\t{\n\t\t\t$query = \"SELECT id,active,act_key FROM users WHERE id = '\".$id.\"' AND act_key !='' \";\n\n\t\t\tif($this->resultNum($query)==1)\n\t\t\t{\n\t\t\t\t$row = $this->fetchOne($query);\n\t\t\t\t$id = $row['id'];\n\t\t\t\tif($row['active']==0)\n\t\t\t\t{\n\t\t\t\t\t$update = $this->processSql(\"UPDATE users SET active=1,act_key='',online='OFF' WHERE id = '\".$id.\"'\");\n\t\t\t\t\tif($update){\n\t\t\t\t\t\treturn 99;\n\t\t\t\t\t} else return 1;\n\t\t\t\t}\n\t\t\t\tif($row['active']==1)\n\t\t\t\t{\n\t\t\t\t\treturn 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t}", "public function UserListChangeStatus(): void{\n \n if(!ArtworkVerifier::setStatusList($_POST) || !Session::isLogin()){\n exit;\n }\n \n if(isset(UserList::where('user_list.user_id', Session::getUser()['id'])->where('user_list.artwork_id', $_POST['artwork_id'])->getOne()->id)){\n UserList::values([ 'user_list.status' => $_POST['status'] ])\n ->where('user_id' ,Session::getUser()['id'])\n ->where('artwork_id', $_POST['artwork_id'])\n ->update();\n exit;\n }\n }", "function verifikasi()\n\t{\n\t\t$data['belum_terverifikasi'] = $this->Kesehatan_M->read('user',array('verified'=>'belum'))->result();\n\t\t$data['sudah_terverifikasi'] = $this->Kesehatan_M->read('user',array('verified'=>'sudah','hak_akses !='=>'1'))->result();\n\t\t$this->load->view('static/header');\n\t\t$this->load->view('static/navbar');\n\t\t$this->load->view('admin/verifikasi',$data);\n\t\t$this->load->view('static/footer');\n\t}", "function printCheckuserNeeded() {\r\n $criteria = array('status' => Appeal::$STATUS_AWAITING_CHECKUSER);\r\n return printAppealList($criteria);\r\n}", "function akses($status){\n switch($status){\n case 1:\n echo \"Admin (Asisten Manager)\";\n break;\n case 2:\n echo \"Pengurus\";\n break;\n case 4: \n echo \"Manager\";\n break;\n default:\n echo \"Tidak ada akses\";\n break;\n }\n }", "public function current_status(){\n\t\t$username = $this->CI->session->userdata('username');\n\t\t$password = $this->CI->session->userdata('password');//THIS WILL BE MD5 already because that is how we stored it there\n\t\t\n\t\tif($username && $password)\n\t\t\treturn $this->validate($username, $password);\n\t\telse\n\t\t\treturn false;\n\t}", "public function respon(){\n //update 'status'\n }", "public function onChangeStatus(){\n \n if (($groupId = post('groupId')) != ''){\n \n $group = UserGroup::findOrFail($groupId);\n \n if (($status = post('status')) != ''){\n $user = $this->getuser();\n \n switch ($status){\n case UserGroup::MEMBERSHIP_ACCEPTED:\n $group->acceptMembership($user);\n break;\n \n case UserGroup::MEMBERSHIP_REJECTED:\n \t$group->rejectMembership($user);\n \tbreak;\n \t\n \tcase UserGroup::MEMBERSHIP_CANCELLED:\n \t\t$group->cancelMembership($user);\n \t\tbreak; \t \n \n } \n }\n }\n \n \n // Updated list of request and other vars\n $this->prepareVars();\n }", "public function update_user_status(){\n\tif($this->session->userdata('logged_in')){\n\t\t//cleanup old logins\n\t\t$this->um_users_model->cleanup_expired_logins();\n\t\t//report the current status\n\t\t$session_data= $this->session->userdata('logged_in');\n\t\t$dbdata=array(\n\t\t\t'loggedusername'=>$session_data['username'],\n\t\t\t'ip'=>$this->session->userdata('ip_address'),\n\t\t\t'lastactivity'=>time(),\n\t\t\t'useragent'=>$this->session->userdata('user_agent'),\n\t\t\t'online'=>$this->um_users_model->get_user_online_setting($session_data['username'])\n\t\t);\n\t\t\n\t\tif($this->um_users_model->is_user_logged_in($session_data['username'])){\n\t\t\t$this->um_users_model->update_user_logged_in($session_data['username'],$dbdata);\n\t\t}else{\n\t\t\t$this->um_users_model->register_user_as_logged_in($dbdata);\n\t\t}\n\t\n\t}\n\t}", "public function isGerechtigd()\n {\n if(isset($_SESSION['gebruiker'])&&!empty($_SESSION['gebruiker']))\n {\n $gebruiker=$_SESSION['gebruiker'];\n if ($gebruiker->getRecht() == \"medewerker\")\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n \n return false;\n \n \n }", "public function status()\t{\n\t\t\t$this->veiculo->update($this->input->post('id'), array('veiculo_status' => $this->input->post('status')));\n\t\t}", "public function verAdmin()\n {\n $id = $_GET['id'];\n\n // buscamos los datos del usuario con el id ingresado\n $user = User::find($id);\n\n $status = \"Activo\";\n //verificamos el estado del usuario\n if ($user->estado_p) {\n $status = \"Activo\";\n } else {\n $status = \"Inactivo\";\n }\n\n //retornamos los datos del usuario encontrado\n return response()->json([\n 'id' => $user->id,\n 'cedula_p' => $user->cedula_p,\n 'nombres' => $user->nombre_p . ' ' . $user->apellido_p,\n 'telefono_p' => $user->telefono_p,\n 'direccion_p' => $user->direccion_p,\n 'tipo_p' => $this->buscarTipoUsuario($user->tipo_p),\n 'estado_p' => $status,\n 'name' => $user->name,\n 'email' => $user->email\n ]);\n }", "public function actionPing(){\n $user = $this->get_current_user($_GET);\n if(!$user){\n $data = array('success'=>false,'error_id'=>1,'error_msg'=>'user doesnt exist');\n $this->renderJSON($data);\n return;\n }\n\n $user->last_activity = date(\"Y-m-d H:i:s\");\n\n if($user->save(false)){\n $data = array('success'=>true);\n $this->renderJSON($data);\n return;\n }else{\n $data = array('success'=>false,'error_id'=>2,'error_msg'=>'user saving user');\n $this->renderJSON($data);\n return;\n }\n }", "public function status () {\n\n //GETS CURRENT NOTEPADID FROM REQUEST AND STORES IN VARIABLE\n $NotepadID = request('NotepadID');\n \n //FINDS TASK RECORD WITH ID REQUEST AND STORES IN OBJECT\n $data=Tasks::find(request('id'));\n \n //IF TASK STATUS EQUALS TRUE, THEN SET FALSE AND IF TASK STATUS\n //EQUALS FALSE THEN SET TRUE\n if ($data->status) {\n $data->status=0;\n } \n else {\n $data->status=1;\n }\n\n //SAVE DB\n $data->save();\n\n //REDIRECTS TO TASK VIEW WITH NOTEPADID AS PARAMETER\n return redirect (\"/task/$NotepadID\");\n }", "public function registeredByMe($status)\n {\n if ( $status )\n return $this->where('user_id', auth()->id() );\n\n else\n return $this->where('user_id', '!=', auth()->id() );\n }", "public function status();", "public function status();", "public function changeUserStatusAction()\n {\n $id = $this->_getParam('id');\n $guid = $this->_getParam('guid');\n $usersNs = new Zend_Session_Namespace(\"members\");\n if($usersNs->userId==$id)\n {\n $this->_flashMessenger->addMessage(array('error'=>'You cannot change your status!' ));\n $this->_helper->_redirector->gotoUrl($this->view->seoUrl('/security/user')); \n exit;\n } \n $this->view->user_id = $id;\n $model1 = new Security_Model_User();\n $model = $model1->fetchRow(\"id='{$id}' and row_guid='{$guid}'\");\n if(false===$model )\n {\n $this->_flashMessenger->addMessage(array('error'=>'Invalid request! Please try again.'));\n $this->_helper->_redirector->gotoUrl($this->view->seoUrl('/security/user')); \n }\n \n \n if($model->getStatus()==1)\n $model->setStatus (0);\n else\n $model->setStatus (1);\n \n if($model->save())\n {\n $this->_flashMessenger->addMessage(array('success'=>'Status changed for '.$model->getFirstName().' '.$model->getLastName().' [ ID : '.$model->getId().', Status : '.$model->getStatus().']'));\n $this->_helper->_redirector->gotoUrl($this->view->seoUrl('/security/user/index')); \n }\n else\n {\n $this->_flashMessenger->addMessage(array('error'=>'Failed to change the status for '.$model->getFirstName().' '.$model->getLastName().' [ ID : '.$model->getId().', Status : '.$model->getStatus().']'));\n $this->_helper->_redirector->gotoUrl($this->view->seoUrl('/security/user/index')); \n }\n \n }", "function active_mail($id){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->prepare(\"UPDATE `utilisateur` SET `status_mail` = '1' WHERE id_utilisateur = :id\");\n\t\t$req->execute(array('id'=>$id));\n\t\t$req->closeCursor();\n\t}", "public function status_peminjam()\n\t{\n\n\t\tif($this->input->post('status') AND $this->input->post('idPeminjaman'))\n\t\t{\n\n\t\t\t$this->admin->status_peminjam();\n\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\theader(\"Location: \" . __FILE__);\n\n\t\t\texit;\n\n\t\t}\n\n\t}", "private function _sendNewStatusUpdateEmailToAdministrators()\n {\n // Get a reference to the Joomla! mailer object\n $mailer = \\JFactory::getMailer();\n\t\t\t\n\t\t\t$config = \\JFactory::getConfig();\n\t\t\t$sender = array( \n\t\t\t $config->get( 'mailfrom' ),\n\t\t\t $config->get( 'fromname' ) \n\t\t\t);\n \n\t\t\t$mailer->setSender($sender);\n\n // Load the category and set the recipient to this category's email address\n\t\t\t// $category = $this->category;\n\t\t\t// $emails = explode(',', $category->email);\n\t\t\t$user = \\JFactory::getUser('admin');\n\t\t\t$mailer->addRecipient($user->email);\n \n // Set the subject\n $subject = \\JFactory::getConfig()->get('sitename') . \": New Status Update ...\";\n\t\t\t$mailer->setSubject($subject);\n\t\t\t$projectId = $this->recordData['hshrndreview_fk_project_id'];\n\t\t\t\n\t\t\t$db = \\JFactory::getDbo();\n\t\t\t//this is just to know whether we are in the user is in the reviewer group or not\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select($db->quoteName(array('name', 'owner')));\n\t\t\t$query->from($db->quoteName('#__hshrndreview_projects'));\n\t\t\t$query->where($db->quoteName('hshrndreview_project_id').\" = \". $projectId);\n\t\t\t$db->setQuery($query);\n\t\t\t$project = $db->loadRow();\n\t\t\t\n\t\t\t$owner = $project['1'];\n\t\t\t//this is just to know whether we are in the user is in the reviewer group or not\n\t\t\t$query2 = $db->getQuery(true);\n\t\t\t$query2->select('title');\n\t\t\t$query2->from($db->quoteName('#__usergroups'));\n\t\t\t$query2->where($db->quoteName('id').\" = \". $owner);\n\t\t\t$db->setQuery($query2)->loadObject();\n\t\t\t$ownerName = $db->loadResult();\n\t\t\t$ownerName = ltrim($ownerName, \"hsgrp_\");\t\t\n\t\t\t\n\t\t\t$submitter = \\JFactory::getUser();\n\t\t\t$submitterName = $submitter->name;\n\t\t\t\n\t\t\t//$ownerName = ltrim($ownerName, \"hsgrp_\");\n\t\t\t\n\t\t\t$body = \"A new status update for project named: \\\"\" . $project['0'] . \"\\\" has been submitted by \" . $submitterName . \"@\" . $ownerName . \" to the HSH project database!\\n\\n Have a nice day - your friendly HSH RnD Review automailer...\";\n\t\t\t$mailer->setBody($body);\n // Send the email\n\t\t\t$send = $mailer->Send();\n\t\t\tif ( $send !== true ) {\n\t\t\t echo 'Error sending email: ' . $send->__toString();\n\t\t\t} else {\n\t\t\t echo 'Mail sent';\n\t\t\t}\n }", "public function setUserStatus() {\n\n $addMember = 1;\n $removeMember = 2;\n $addMemberClosedCommunity = 3;\n\n $this->autoRender = false;\n $user_id = $this->request->data['userId'];\n $community_id = $this->request->data['communityId'];\n $sentStatus = $this->request->data['status'];\n $status = $this->CommunityMember->getCommunityMemberStatus($user_id, $community_id);\n $community = $this->Community->find('first', array(\n 'conditions' => array(\n 'Community.id' => $community_id\n )\n ));\n\n if (!empty($community)) {\n\n /*\n * Check status has changed before send the request\n */\n if ($sentStatus == $status ) {\n if (in_array($community['Community']['type'], array(Community::COMMUNITY_TYPE_OPEN, Community::COMMUNITY_TYPE_SITE))) {\n\n if (!empty($status)) {\n\n switch ($status) {\n case 0:\n $this->CommunityMember->changeCommunityMemberStatus($user_id, $community_id, $addMember);\n $this->Session->setFlash(__('You are now a member of this community'), 'success');\n break;\n case 1:\n\t\t\t\t\t\t\t\t$this->CommunityMember->changeCommunityMemberStatus($user_id, $community_id, $removeMember);\n\t\t\t\t\t\t\t\t$this->removeMemberFromCommunityEvents($community_id, $user_id);\n\t\t\t\t\t\t\t\t//Community unfollow data\n\t\t\t\t\t\t\t\t$followCommunityData = array(\n\t\t\t\t\t\t\t\t\t'type' => FollowingPage::COMMUNITY_TYPE,\n\t\t\t\t\t\t\t\t\t'page_id' => $community_id,\n\t\t\t\t\t\t\t\t\t'user_id' => $user_id\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$this->FollowingPage->unFollowPage($followCommunityData);\n\t\t\t\t\t\t\t\t$this->Session->setFlash(__('You are no longer a member of this community.'), 'success');\n\t\t\t\t\t\t\t\techo $member_count;\n\t\t\t\t\t\t\t\tbreak;\n }\n } else {\n $this->CommunityMember->changeCommunityMemberStatus($user_id, $community_id, $addMember);\n $this->Session->setFlash(__('You are now a member of this community'), 'success');\n }\n } else {\n\n if (!empty($status)) {\n\n switch ($status) {\n case 0:\n $this->CommunityMember->changeCommunityMemberStatus($user_id, $community_id, $addMemberClosedCommunity);\n $this->Session->setFlash(__('The Community admin has been notified about your interest in joining the Community'));\n break;\n case 1:\n $this->CommunityMember->changeCommunityMemberStatus($user_id, $community_id, $removeMember);\n $this->removeMemberFromCommunityEvents($community_id, $user_id);\n $this->Session->setFlash(__('You are no longer a member of this Community.'), 'success');\n break;\n }\n } else {\n $this->CommunityMember->changeCommunityMemberStatus($user_id, $community_id, $addMemberClosedCommunity);\n $this->Session->setFlash(__('The Community admin has been notified about your interest in joining the Community'), 'success');\n\n // add community join request notification task to job queue\n $this->loadModel('Queue.QueuedTask');\n $this->QueuedTask->createJob('CommunityJoinRequestNotification', array(\n 'community_id' => $community_id,\n 'sender_id' => $user_id,\n 'recipient_id' => $community['Community']['created_by'],\n 'community_name' => $community['Community']['name']\n ));\n }\n }\n exit;\n } else {\n $this->Session->setFlash('Sorry !, You have done this action already.', 'error');\n }\n } else {\n $this->Session->setFlash(__($this->invalidMessage), 'error');\n }\n }", "public function banUser(){\n if($this->adminVerify()){\n\n }else{\n echo \"Vous devez avoir les droits administrateur pour accéder à cette page\";\n }\n }", "public function confirm_member(){\n\t\tif(isset($_SESSION['status'], $_SESSION['user_id'], $_SESSION['login_string'])){\n\t\t\t$user_id = $_SESSION['user_id'];\n\t\t\t$status = $_SESSION['status'];\n\t\t\t$login_string = $_SESSION['login_string'];\n\t\t\t$ip_address = $_SERVER['REMOTE_ADDR'];\n\t\t\t$user_browser = $_SERVER['HTTP_USER_AGENT'];\n\t\t\t$mysql = New Mysql();\n\t\t\t$password = $mysql->get_password_by_id($user_id);\n\t\t\tif( $password != \"\" ){\n\t\t\t\t$login_check = hash('sha512', $password . $ip_address . $user_browser);\n\t\t\t\tif($login_check == $login_string && $status == 'authorized'){\n\t\t\t\t\treturn $user_id;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\techo(\"Variables are not set\");\n\t\t\treturn false;\n\t\t}\n\t}", "private function gebruikersBeheerAction()\n {\n $gebruikers = $this->model->geefGebruikers();\n $this->view->set('gebruikers', $gebruikers);\n }", "public function ajaxMemberStatus() {\n\t\t$this->autoRender = false;\n\t\t$this->viewBuilder()->setLayout(false);\n\t\tif ($this->request->is('ajax')) {\n\t\t\t$id = $this->request->getData()['id'];\n\t\t\t$status = $this->request->getData()['status'];\n\t\t\t$data = $this->Users->get($id);\n\n\t\t\t$user = $this->Users->patchEntity($data, ['status' => $status]);\n\n\t\t\tif ($this->Users->save($user)) {\n\t\t\t\t$message = ($status == 1) ? 'Member is Active now.' : 'Member is InActive now.';\n\t\t\t\techo json_encode(array('status' => 'success', 'message' => $message));\n\t\t\t\texit;\n\t\t\t}\n\t\t\t$message = ($status == 1) ? 'Error while updating member status to Active.' : 'Error while updating member status to InActive.';\n\t\t\techo json_encode(array('status' => 'error', 'message' => $message));\n\t\t\texit;\n\t\t}\n\t}", "function getuserin_section() {\r\n if( isset($_POST['users_uname']) ) {\r\n if( isset($_POST['users_pwd']) ) {\r\n\r\n // Check Login\r\n $result_uname = $this->DatabaseModel->access_database('ts_user','select','',array('user_uname'=>$_POST['users_uname'],'user_pwd'=>md5($_POST['users_pwd'])));\r\n\r\n $result_uemail = $this->DatabaseModel->access_database('ts_user','select','',array('user_email'=>$_POST['users_uname'],'user_pwd'=>md5($_POST['users_pwd'])));\r\n\r\n if (!empty($result_uname) || !empty($result_uemail)) {\r\n\r\n $result = !empty($result_uname) ? $result_uname : $result_uemail ;\r\n\r\n if($result[0]['user_status'] == '2') {\r\n echo \"2#error\"; // InActive\r\n }\r\n elseif($result[0]['user_status'] == '3') {\r\n echo \"3#error\"; // Blocked\r\n }\r\n else\r\n {\r\n $userPlan = $result[0]['user_plans'];\r\n $uid = $result[0]['user_id'];\r\n if( $userPlan != '0' ) {\r\n $planDetails = $this->DatabaseModel->access_database('ts_plans','select','',array('plan_id'=>$userPlan));\r\n $planDuration = explode(' ',$planDetails[0]['plan_duration']);\r\n if( $planDuration[1] == 'Time' ) {\r\n $planstatus = 1; // Life time\r\n }\r\n else {\r\n if( $planDuration[1] == 'Days' ) {\r\n $p_date = date('Y-m-d H:i:s',strtotime(\"-\".$planDuration[0].\" days\"));\r\n }\r\n elseif( $planDuration[1] == 'Weeks' ) {\r\n $n = $planDuration[0] * 7 ;\r\n $p_date = date('Y-m-d H:i:s',strtotime(\"-\".$n.\" days\"));\r\n }\r\n elseif( $planDuration[1] == 'Months' ) {\r\n $p_date = date('Y-m-d H:i:s',strtotime(\"-\".$planDuration[0].\" month\"));\r\n }\r\n elseif( $planDuration[1] == 'Years' ) {\r\n $p_date = date('Y-m-d H:i:s',strtotime(\"-\".$planDuration[0].\" year\"));\r\n }\r\n $p = $this->DatabaseModel->access_database('ts_user','select','',array('user_id'=>$uid,'user_plansdate <'=>$p_date));\r\n\r\n $planstatus = empty($p) ? '1' : '0' ;\r\n }\r\n }\r\n else {\r\n $planstatus = '404';\r\n }\r\n\r\n // Vendor Plans\r\n\r\n $vendorPlan = $result[0]['user_vplans'];\r\n if( $vendorPlan != '0' ) {\r\n $planDetails = $this->DatabaseModel->access_database('ts_vendorplans','select','',array('vplan_id'=>$vendorPlan));\r\n $planDuration = explode(' ',$planDetails[0]['vplan_duration']);\r\n if( $planDuration[1] == 'Time' ) {\r\n $planstatus = 1; // Life time\r\n }\r\n else {\r\n if( $planDuration[1] == 'Days' ) {\r\n $p_date = date('Y-m-d H:i:s',strtotime(\"-\".$planDuration[0].\" days\"));\r\n }\r\n elseif( $planDuration[1] == 'Weeks' ) {\r\n $n = $planDuration[0] * 7 ;\r\n $p_date = date('Y-m-d H:i:s',strtotime(\"-\".$n.\" days\"));\r\n }\r\n elseif( $planDuration[1] == 'Months' ) {\r\n $p_date = date('Y-m-d H:i:s',strtotime(\"-\".$planDuration[0].\" month\"));\r\n }\r\n elseif( $planDuration[1] == 'Years' ) {\r\n $p_date = date('Y-m-d H:i:s',strtotime(\"-\".$planDuration[0].\" year\"));\r\n }\r\n//echo $p_date;\r\n $p = $this->DatabaseModel->access_database('ts_user','select','',array('user_id'=>$uid,'user_vplansdate <'=>$p_date));\r\n\r\n $vplanstatus = empty($p) ? '1' : '0' ;\r\n }\r\n }\r\n else {\r\n $vplanstatus = '404';\r\n }\r\n\r\n $user_details\t= array(\r\n 'ts_uid'\t\t=> $uid,\r\n 'ts_uname'\t\t=> $result[0]['user_uname'],\r\n 'ts_login'\t\t=> true,\r\n 'ts_level'\t\t=> $result[0]['user_accesslevel'],\r\n 'ts_planstatus'\t\t=> $planstatus,\r\n 'ts_vendorplanstatus'\t\t=> $vplanstatus\r\n );\r\n\r\n $this->session->set_userdata($user_details);\r\n\r\n if($_POST['rem_me'] == '1'){\r\n setcookie(\"ts_emanu\", $_POST['users_uname'] , time()+3600 * 24 * 14,'/');\r\n setcookie(\"ts_dwp\", $_POST['users_pwd'] , time()+3600 * 24 * 14,'/');\r\n }\r\n elseif($_POST['rem_me'] == '0')\r\n {\r\n setcookie(\"ts_emanu\", $_POST['users_uname'] , time()-3600 * 24 * 365,'/');\r\n setcookie(\"ts_dwp\", $_POST['users_pwd'] , time()-3600 * 24 * 365,'/');\r\n }\r\n\r\n echo ( $result[0]['user_accesslevel'] == '1' ) ? '7#adminredirect' : '7#redirect';\r\n // Login success\r\n }\r\n }\r\n else {\r\n if(isset($_POST['users_email'])) {\r\n $email = $_POST['users_email'];\r\n $un = $_POST['users_uname'];\r\n $pwd = $_POST['users_pwd'];\r\n\r\n if (filter_var($email, FILTER_VALIDATE_EMAIL) && strlen($pwd) > 7 && preg_match(\"/^[a-zA-Z0-9\\d]+$/\",$un) ) {\r\n $checkUsername = $this->DatabaseModel->access_database('ts_user','select','',array('user_uname'=>$_POST['users_uname']));\r\n\r\n if(empty($checkUsername)) {\r\n $checkEmail = $this->DatabaseModel->access_database('ts_user','select','',array('user_email'=>$_POST['users_email']));\r\n\r\n if(empty($checkEmail)) {\r\n\r\n $key = md5(date('his').$_POST['users_email']);\r\n $data_arr\t= array('user_uname'=>$_POST['users_uname'],'user_email'=>$_POST['users_email'],'user_pwd'=>md5($_POST['users_pwd']),'user_accesslevel'=>2,'user_status'=>2);\r\n $data_arr['user_key'] = $key;\r\n\r\n $uid = $this->DatabaseModel->access_database('ts_user','insert',$data_arr,'');\r\n\r\n /* Subscribe to list */\r\n $s = $this->ts_functions->subscribeemails( $_POST['users_email'] , 'registeredemails');\r\n /* Subscribe to list */\r\n\r\n echo $this->ts_functions->sendnotificationemails('registrationemail', $_POST['users_email'], 'Verification Link' , $_POST['users_uname'] , base_url().'authenticate/login/'.$key );\r\n\r\n // Register success\r\n\r\n }\r\n else {\r\n echo '7#exists';\r\n // Email exists\r\n }\r\n }\r\n else {\r\n echo '6#exists';\r\n // Username exists\r\n }\r\n }\r\n else {\r\n echo '404#js_mistake';\r\n // Server Error exists\r\n }\r\n }\r\n else {\r\n echo '0#error';\r\n // Login credentials don't match\r\n }\r\n }\r\n }\r\n else {\r\n // Forgot Password Section\r\n $where = \"user_email='\".$_POST['users_uname'].\"' OR user_uname='\".$_POST['users_uname'].\"'\";\r\n $result = $this->DatabaseModel->access_database('ts_user','select','',$where);\r\n\r\n if (!empty($result)) {\r\n if($result[0]['user_status'] == '2') {\r\n echo \"2#error\"; // InActive\r\n }\r\n elseif($result[0]['user_status'] == '3') {\r\n echo \"3#error\"; // Blocked\r\n }\r\n else\r\n {\r\n $uid = $result[0]['user_id'];\r\n $key = md5(date('Ymdhis').$uid);\r\n $this->DatabaseModel->access_database('ts_user','update',array('user_key'=>$key),array('user_id'=>$uid));\r\n /*\r\n\r\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\r\n $headers .= \"Content-type:text/html;charset=UTF-8\" . \"\\r\\n\";\r\n $headers .= 'From: <[email protected]>' . \"\\r\\n\";\r\n\r\n $msg = '<p>Hi , '.$result[0]['user_uname'].'</p> <p>click on the link below to reset your password <a href=\"'.base_url().'authenticate/reset_password/'.$key.'\">'.base_url().'authenticate/reset_password/'.$key.'</p><br/><br/><p>Thanks, <br/> Team, Themeportal</p>';\r\n\r\n mail($result[0]['user_email'],'Forgot Password',$msg,$headers);\r\n */\r\n\r\n echo $this->ts_functions->sendnotificationemails('forgotpwdemail', $result[0]['user_email'], 'Forgot Password' , $result[0]['user_uname'] , base_url().'authenticate/reset_password/'.$key );\r\n\r\n // Forgot email sent\r\n }\r\n }\r\n else {\r\n echo '5#error';\r\n // Forgot Email does not match\r\n }\r\n }\r\n }\r\n else {\r\n echo '404#error';\r\n // False access\r\n }\r\n\t\t\tdie();\r\n\t}", "function check_borrower_status($obj, $borrower){\n\t$result = $obj->db->query($obj->Query_reader->get_query_by_code('check_borrower', array('borrower' => $borrower)));\n\tif($result->num_rows() > 0)\n\t\treturn $result->num_rows();\n\telse\n\t\treturn 0;\n}", "public function updateStatus(){\t\t\tif( is_null( $this->id ) ) trigger_error( \"User::update(): Attempt to update a user object that does not have its ID property set.\", E_USER_ERROR );\r\n\t\t\t\r\n\t\t\r\n\r\n\t\t\t//Update the object\r\n\t\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\t\t\r\n\t\t\t$sql = \"UPDATE \".TABLENAME_GROUPS.\" SET status=:status WHERE id = :id\";\r\n\t\t\t$st = $conn->prepare( $sql );\r\n\t\t\t$st->bindValue( \":status\", $this->status, PDO::PARAM_STR );\r\n\t\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t\techo \"<br>\";\r\n\t\t\t$st->execute();\r\n\t\t//\tprint_r($st->errorInfo());\r\n\t\t\t$conn = null;\t\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}", "function nonactivateTU(){\r\n\t\tif($this->session->userdata('logged_in')){\r\n\t\t\tif($this->session->userdata('id_role') == 1){\r\n\t\t\t\t$this->load->library('form_validation');\r\n\t\t\t\t$this->form_validation->set_rules('id_tu', 'ID Admin', 'required');\r\n\t\t\t\tif($this->form_validation->run() == FALSE){\r\n\t\t\t\t\t$this->session->set_flashdata('error', 'Missing required Field!');\r\n\t\t redirect('/tata_usaha');\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$id_tu = $this->input->post('id_tu');\r\n\t\t\t\t\t$this->load->model('Users');\r\n\t\t\t\t\t$res_update = $this->Users->changeStatus($id_tu, 0);\r\n\t\t\t\t\tif($res_update){\r\n\t\t\t\t\t\t$this->session->set_flashdata('success', 'Berhasil menonaktifkan petugas tata usaha.');\r\n\t\t\t\t\t\tredirect('/tata_usaha');\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t$this->session->set_flashdata('error', 'Gagal menonaktifkan petugas tata usaha.');\r\n\t\t\t\t\t\tredirect('/tata_usaha');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tredirect('/');\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tredirect('/');\r\n\t\t}\r\n\t}", "public function check_insta_user() {\n \n }", "function checkedituser()\n\t{\n\t\t$query1 = $this->db->query('select * from admin where username = \"'.$this->input->post('username').'\" AND id != \"'.$this->input->post('id').'\" ') or die(mysql_error());\n\t\t\n\t\t//echo 'Coint:'.$query1->num_rows();\texit;\n\t\tif($query1->num_rows() == 0)\n\t\t {\t\t\t\n\t\t\t\techo '0';\t\n\t\t }\n\t\t else\t\t \n\t\t {\n\t\t\t\techo '1';\n\t\t\t}\n\t\t \n\t\t\n\t}", "public function set_new_user () { //вынести в отдельный класс Admin\n \n if ($this->user_status == 0) {\n file_put_contents ('user.csv', $this->userID.\",\". time() .\"\\n\", FILE_APPEND);\n $this->set_new_password();\n $result = 'Новый пользователь: '.$this->userID.\"\\n\";\n }\n else {\n $result = 'Пользователь: '.$this->userID.\" уже зарегистрирован\\n\";\n }\n return $result; \n }", "public function confirmationAction()\n {\n Zend_Registry::set('SubCategory', SubCategory::USERUPDATE);\n \t$userId = $this->getRequest()->getParam('userId');\n $activationKey = $this->getRequest()->getParam(self::ACTIVATION_KEY_PARAMNAME);\n\n $user = $this->_getUserFromIdAndKey($userId, $activationKey);\n\n if(!$user){\n // No such user\n Globals::getLogger()->registrationError(\"Account activation: user retrieval failed - userId=$userId, key=$activationKey\", Zend_Log::INFO );\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::ACTIVATION_FAILED));\n }\n\n $user->clearCache();\n $user = $this->_getUserFromIdAndKey($userId, $activationKey);\n\n if($user->{User::COLUMN_STATUS} == User::STATUS_PENDING){\n $user->{User::COLUMN_STATUS} = User::STATUS_MEMBER;\n $user->date = date('Y-m-d H:i:s');\n $id = $user->save();\n if($id !== $userId){\n Globals::getLogger()->registrationError(\"Account activation: user save failed - userId=$userId, key=$activationKey\", Zend_Log::INFO );\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::ACTIVATION_FAILED));\n }\n\n $this->view->success = true;\n $this->view->alreadyDone = false;\n \t$this->_savePendingUserIdentity($userId);\n } else {\n $this->view->success = false;\n $this->view->alreadyDone = true;\n }\n }", "public function testUpdateStatusByUserId()\n {\n $session = $this->objectManager->create(\\Magento\\Security\\Model\\AdminSessionInfo::class);\n /** @var $session \\Magento\\Security\\Model\\AdminSessionInfo */\n $session->getResource()->updateStatusByUserId(\n \\Magento\\Security\\Model\\AdminSessionInfo::LOGGED_OUT_BY_LOGIN,\n 1,\n [1],\n [1],\n '2016-01-19 12:00:00'\n );\n $collection = $session->getResourceCollection()\n ->addFieldToFilter('main_table.user_id', 1)\n ->addFieldToFilter('main_table.status', \\Magento\\Security\\Model\\AdminSessionInfo::LOGGED_OUT_BY_LOGIN)\n ->load();\n $count = $collection->count();\n $this->assertGreaterThanOrEqual(1, $count);\n }", "protected static function set_status()\n {\n }", "public function activeAccount(Request $request, $infoActive = \"\" ){\n //chay sang trng hom neu da login\n if(Auth::user()){\n return redirect(\"home\");\n }\n\n if ( strlen( $infoActive ) > 0 ){\n $data = json_decode( base64_decode( $infoActive ) );\n\n //check neu da active roi va chua login hien thong bao da active kem link login\n try {\n $activeUser = User::where('email', '=', $data[1])->firstOrFail();\n if( $activeUser->active == 1 ) {\n //chay sang trang thong bao\n return redirect(\"notification/useractived\");\n }\n } catch (Exception $e) {\n echo \"Error : ket noi\";\n die(); \n }\n $count = User::where('email','=', $data[1])\n ->where('updated_at','>', Carbon::now()->subDay(3))\n ->count();\n if($count==0){\n $request->session()->flash('error', 'Link Active Account expired!');\n }else{\n //kiem tra va update kich hoat tk\n if ( $data[0] == hash( \"sha256\", md5( md5( $data[1] ) ) ) ) {\n try {\n $user = User::where( 'email', '=', $data[1] )->first();\n $user->active = 1;\n $user->save();\n UserData::find($user->id )->update( ['active' => 1] );\n //Active vaf redirect ve trang thong bao kem theo link login\n if($user){\n return redirect(\"notification/useractive\");\n }else{\n $request->session()->flash('error', 'Cannot activate !');\n }\n } catch ( Exception $e ) {\n \n }\n } else {\n $request->session()->flash('error', 'Something wrongs. We cannot activated!');\n }\n }\n\n } else {\n $request->session()->flash('error', 'Something wrongs. We cannot activated!');\n }\n return view('adminlte::auth.reactive');\n }", "public function json_push_status()\n\t{\n\t\t$secret = $this->request->fromRoute('code', null);\n\t\tif (!$secret || $secret != $this->secret_status) {\n\t\t\t$this->render(array(\n\t\t\t\t'response' => 'Mauvais mot de passe',\n\t\t\t));\n\t\t\texit();\n\t\t}\n\n\t\t/*\n\t\tid_accuse\tIdentifiant unique du message pour ce numéro.\n\t\tid_message\tIdentifiant commun en cas d'envoi d'un message groupé.\n\t\tnumero\tOptionnel, numéro de téléphone du destinataire (uniquement si message de type SMS, Vocal, FAX).\n\t\temail\tOptionnel, e-mail du destinataire (uniquement si message de type e-mail).\n\t\tstatut\tStatut du message SMS :\n\t\t0 = En attente\n\t\t1 = Livré\n\t\t2 = Envoyé\n\t\t3 = En cours\n\t\t4 = Echec\n\t\t5 = Expiré\n\t\t(Les statuts 1 et 4 sont définitifs.)\n\n\t\tStatut du message E-mail :\n\t\t0 = En attente\n\t\t2 = Envoyé\n\t\t3 = Cliqué\n\t\t4 = Erreur\n\t\t5 = Bloqué\n\t\t6 = Spam\n\t\t7 = Desabonné\n\t\t8 = Ouvert\n\t\tdate_envoi\tDate d'envoi du message (timestamp).\n\t\tdate_update\tDate de dernière mise à jour du statut (timestamp).\n\t\tstatut_code\tStatut détaillé de 0 à 9999 (détails à demander à votre gestionnaire de compte).\n\t\tnom\tLe nom ou l'identifiant personnel de votre message\n\n\t\t*/\n\t\t$data = array();\n\t\t$data['id_common_provider'] = $this->request->fromRoute('id_message', 0);\n\t\t$data['id_unique_provider'] = $this->request->fromRoute('id_accuse', 0);\n\t\t\n\t\t$numero = $this->request->fromRoute('numero', '');\n\t\t$email = $this->request->fromRoute('email', '');\n\t\tif ($numero != '') {\n\t\t\t$data['type'] = 'SMS';\n\t\t} else if ($email != '') {\n\t\t\t$data['type'] = 'MAIL';\n\t\t}\n\n\t\t$data['status'] = $this->request->fromRoute('statut', 0);\n\t\t$data['timestamp'] = $this->request->fromRoute('date_envoi', 0);\n\n\t\t// inutilisé pour l'instant\n\t\t$date_update = $this->request->fromRoute('date_update', 0);\n\t\t$statut_code = $this->request->fromRoute('statut_code', 0);\n\t\t$nom = $this->request->fromRoute('nom', 0);\n\n\t\tif (!empty($data)) {\n\n\t\t\tif (is_numeric($data['id_unique_provider']) && $data['id_unique_provider'] != 0) {\n\t\t\t\t$check_exist = $this->db->query('SELECT * FROM _spothit_status WHERE id_unique_provider=\"'.$data['id_unique_provider'].'\"');\n\t\t\t} else {\n\t\t\t\t$check_exist = false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($check_exist) {\n\n\t\t\t\t$success = $this->db->update('_spothit_status')->values($data)->where(array('id_unique_provider'=>$data['id_unique_provider']))->execute();\n\t\t\t} else {\n\t\t\t\t$success = $this->db->insert('_spothit_status')->values($data)->execute();\t\n\t\t\t}\n\t\t\tswitch ($data['type']) {\n\t\t\t\tcase 'MAIL':\n\t\t\t\t\tif (is_numeric($data['timestamp']) && is_numeric($data['id_common_provider']) && $data['id_common_provider'] != 0) {\n\t\t\t\t\t\t$this->db->query('UPDATE _emails SET timestamp=\"'.$data['timestamp'].'\" WHERE id_common_provider=\"'.$data['id_common_provider'].'\" AND timestamp=\"1\"');\n\t\t\t\t\t}\n\t\t\t\t\t// Mauvais Email\n\t\t\t\t\tif ($data['status'] == 4) {\n\t\t\t\t\t\t$client = $this->db->select_one('clients')->where('email=:email', array('email'=>$email))->execute();\n\t\t\t\t\t\tif ($client) {\n\t\t\t\t\t\t\t$client->bad_email = 1;\n\t\t\t\t\t\t\t$client->save();\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'SMS':\n\t\t\t\t\tif (is_numeric($data['timestamp']) && is_numeric($data['id_common_provider']) && $data['id_common_provider'] != 0) {\n\t\t\t\t\t\t$this->db->query('UPDATE _sms SET timestamp=\"'.$data['timestamp'].'\" WHERE id_common_provider=\"'.$data['id_common_provider'].'\" AND timestamp=\"1\"');\n\t\t\t\t\t}\n\t\t\t\t\t// Mauvais NUméro\n\t\t\t\t\tif ($data['status'] == 4) {\n\t\t\t\t\t\t$client = $this->db->select_one('clients')->where('phone=:phone', array('phone'=>$numero))->execute();\n\t\t\t\t\t\tif ($client) {\n\t\t\t\t\t\t\t$client->bad_phone = 1;\n\t\t\t\t\t\t\t$client->save();\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'MMS':\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'VOCAL':\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$this->render(array(\n\t\t\t'response' => ( $success > 0 ? true : false ),\n\t\t));\n\t}", "function userConfirmation($data){\n\t\t$requiredData['action'] = $this->getPassword(@trim($data->action));\n\t\t$user_name_id = explode(\"#/#\",$requiredData['action']);\n\t\t$rec = $this->query(\"UPDATE `users` SET `status`=1 where `user_name` = '\".@$user_name_id[0].\"' AND `id`= \".@$user_name_id[1]);\n\t\tif($rec){\n\t\t\t$url = HTTP_HOST.\"confirm.php?action=1\";\n\t\t\techo \"<meta http-equiv=Refresh content=0;url=\".$url.\">\";\t\t\t\n\t\t\texit;\n\t\t}else{\n\t\t\t$url = HTTP_HOST.\"confirm.php?action=0\";\n\t\t\techo \"<meta http-equiv=Refresh content=0;url=\".$url.\">\";\t\t\t\n\t\t\texit;\t\t\n\t\t}\n\t}", "public function status()\n {\n return $this->UserAPI->request_status_check();\n }", "public function get_status(){\n return $this->status;\n }", "private static function getStatus($request){\r\n\t\t//QUERY PARAMS\r\n\t\t$queryParams= $request->getQueryParams();\r\n\r\n\t\t//Status\r\n\t\tif(!isset($queryParams['status'])) return '';\r\n\r\n\t\t//Mesangem de status\r\n\t\tswitch ($queryParams['status']){\r\n\t\t\tcase 'created':\r\n\t\t\t\treturn Alert::getSuccess('Usuario criado com sucesso!');\r\n\t\t\tbreak;\r\n\t\t\tcase 'updated':\r\n\t\t\t\treturn Alert::getSuccess('Usuario atualizado com sucesso!');\r\n\t\t\tbreak;\r\n\t\t\tcase 'deleted':\r\n\t\t\t\treturn Alert::getSuccess('Usuario excluido com sucesso!');\r\n\t\t\tbreak;\r\n\t\t\tcase 'duplicated':\r\n\t\t\t\treturn Alert::getError('O email digitado já esta sendo usado');\r\n\t\t\tbreak;\r\n\r\n\r\n\t\t}\r\n\t}", "public function updateOwnerStatus()\n {\n $owner['status'] = $this->input->get('status');\n $owner['id'] = $this->input->get('owner_id');\n\n if(isset($owner['status']) && isset($owner['id']))\n {\n if($this->Owner_model->updateTeamOwner($owner))\n {\n $this->session->set_flashdata('msg', '<div class=\"alert alert-success\"><a href=\"#\" class=\"close\" data-dismiss=\"alert\">&times;</a><strong>Success!</strong> Owner updated Successfully.</div>');\n redirect($_SERVER['HTTP_REFERER']);\n }\n else\n {\n $this->session->set_flashdata('msg', '<div class=\"alert alert-danger\"><a href=\"#\" class=\"close\" data-dismiss=\"alert\">&times;</a><strong>Error!</strong> Try again.</div>');\n redirect($_SERVER['HTTP_REFERER']);\n }\n }\n redirect('admin/owner?msg=failure');\n }", "public function inscrire(){\r\n $nb = 0 ;\r\n $pseudo = $this -> getPseudo();\r\n $q = \"update UserTab set User_inscrit = 1 where User_pseudo = '\".$pseudo.\"'\";\r\n $nb = execute($q) ;\r\n \r\n return $nb ;\r\n\r\n }", "private function gebruikerToevoegenAction()\n {\n //controlleert of er een formulier is ingevuld\n if (isset($_POST) && !empty($_POST))\n {\n //kijkt of de gebruikersnaam al bestaat en geeft dan een boolean terug\n $bestaatGN = $this->model->bestaatGN();\n //false als de gebruikersnaam niet bestaat\n if ($bestaatGN === FALSE)\n {\n //controleert of de wachtwoorden overeenkomen\n if ($_POST['wachtwoord'] === $_POST['wachtwoord2'])\n {\n $id = $this->model->maakGebruiker();\n if (isset($_FILES['foto']))\n {\n $this->model->updateFoto($id);\n }\n //stuurt je naar de gebruikersbeheer pagina\n $this->model->foutGoedMelding('success', '<strong>Gelukt!</strong> gebruiker is aangemaakt. <span class=\"glyphicon glyphicon-saved\"></span>');\n $this->model->setLog('Gebruiker toevoegen', 'Gelukt');\n $this->forward('gebruikersBeheer', 'admin');\n } else\n {\n $this->view->set('opmerking', 'Wachtwoorden komen niet overeen');\n }\n } else\n {\n $this->view->set('opmerking', 'Gebruikersnaam is al in gebruik');\n }\n }\n }", "public function checkStatus()\n {\n echo 'All Branch of Bank is Opened at 9:30 AM<br>';\n }", "function change_status_to() {\n $stat_param = array(\n 'status' => $this->uri->segment(3)\n );\n $id = $this->uri->segment(4);\n $updt_status = $this->guest_post_model->change_status_to('newsletter', $stat_param, $id);\n if ($updt_status) {\n $this->session->set_userdata('success_msg', 'Status Updated susseccfully.');\n } else {\n $this->session->set_userdata('error_msg', 'Cannot update status.');\n }\n redirect('news_letter_cont');\n }", "public function getUser_status_id()\n {\n return $this->user_status_id;\n }", "public function testLoggedStatus(){\n Session::flush();\n $user = $this->postuser();\n $status_message = $this->getStatus();\n $this->assertResponseOk();\n $this->assertTrue($status_message['message'] == 'user logged in');\n }", "public function checkaccount()\n {\n $this->data['lang'] = $this->language;\n $apiKey = preg_replace('/[^[:alnum:]]/i', '', $this->request->get['apikey']);\n $this->data['onego_jssdk_url'] = OneGoConfig::get('jsSdkURI').'?apikey='.$apiKey;\n $this->template = 'total/onego_status_jssdk.tpl';\n $this->response->setOutput($this->render());\n }", "protected function getRecordRegistrationStatus() {}", "function submitVerifikasi($id_user){\n\t\t$this->Kesehatan_M->update('user',array('id_user'=>$id_user),array('verified'=>'sudah'));\n\t\tredirect(\"Admin/verifikasi\");\n\t}", "public function userActive(){\n if(isset($_GET['id'])&& isset($_GET['token'])){\n $md5_id=$_GET['id'];\n $user=$this->f_usersmodel->getFirstRowWhere('users',array('md5_id'=>$md5_id));\n if($user->token==$_GET['token']){\n $this->f_usersmodel->Update_where('users',array('id'=>$user->id),array('active'=>1));\n }\n $seo = array(\n 'title' => \"Kích hoạt tài khoản\"\n );\n $data = array();\n $this->LoadHeader(null,$seo,false);\n $this->load->view('users/success_active_user',$data);\n $this->LoadFooter();\n\n }else\n {redirect(base_url());}\n }", "function status() {\n\t\t//If the user id does not exist, then the admin level is 0\n\t\tif(!isset($_SESSION['language_server_rand_ID']) || !isset($_SESSION['language_server_' . $_SESSION['language_server_rand_ID']])) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t//Because the id was hidden using a rand function, we should get the value into a more readable var\n\t\t$id = $_SESSION['language_server_' . $_SESSION['language_server_rand_ID']];\n\t\t$user = $_SESSION['language_server_user'];\n\t\t\n\t\t//If the mysql command fails at any point, then the admin level is 0\n\t\t$connection = new mysqli(IP, USER, PASSWORD, DATABASE);\n\t\tif ($connection->connect_errno)\n\t\t{\n\t\t\techo \"Cannot establish connection: (\" . $connection->errno . \") \" . $connection->error;\n\t\t\treturn 0;\n\t\t}\n\t\t$command = 'SELECT admin FROM accounts WHERE username = ? && account_id = ? LIMIT 0, 1;';\n\t\tif(!($stmt = $connection->prepare($command)))\n\t\t{\n\t\t\techo \"Prepare failed: (\" . $connection->errno . \") \" . $connection->error;\n\t\t\treturn 0;\n\t\t}\n\t\tif(!$stmt->bind_param('ss', $user, $id))\n\t\t{\n\t\t\techo \"Binding parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\n\t\t\treturn 0;\n\t\t}\n\t\telseif (!$stmt->execute())\n\t\t{\n\t\t\techo \"Execute failed: (\" . $stmt->errno . \") \" . $stmt->error;\n\t\t\treturn 0;\n\t\t}\n\t\t$results = $stmt->get_result();\n\t\t$connection->close();\n \tif($results->num_rows != 0) {\n\t \t$results->data_seek(0);\n\t\t\t$result = $results->fetch_assoc();\n\t\t\treturn $result['admin'];\n\t\t}\n\t\telse {\n\t\t\treturn 0;\n\t\t}\n\t}", "public function ingelogd() {\n\t\t\treturn $this->bLoggedIn;\n\t\t}", "function activateTU(){\r\n\t\tif($this->session->userdata('logged_in')){\r\n\t\t\tif($this->session->userdata('id_role') == 1){\r\n\t\t\t\t$this->load->library('form_validation');\r\n\t\t\t\t$this->form_validation->set_rules('id_tu', 'ID Admin', 'required');\r\n\t\t\t\tif($this->form_validation->run() == FALSE){\r\n\t\t\t\t\t$this->session->set_flashdata('error', 'Missing required Field!');\r\n\t\t redirect('/tata_usaha');\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$id_tu = $this->input->post('id_tu');\r\n\t\t\t\t\t$this->load->model('Users');\r\n\t\t\t\t\t$res_update = $this->Users->changeStatus($id_tu, 1);\r\n\t\t\t\t\tif($res_update){\r\n\t\t\t\t\t\t$this->session->set_flashdata('success', 'Berhasil mengakifkan kembali petugas tata usaha.');\r\n\t\t\t\t\t\tredirect('/tata_usaha');\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t$this->session->set_flashdata('error', 'Gagal mengakifkan kembali petugas tata usaha.');\r\n\t\t\t\t\t\tredirect('/tata_usaha');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tredirect('/');\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tredirect('/');\r\n\t\t}\r\n\t}", "public function checkUserSettings(){\n $data = $this->db->start()->get('*','user', array(array('id', '=', $_SESSION['_user']['id'])))->first();\n $_SESSION['_user'] = array('id' => $data->id, 'firstname' => $data->firstname, 'lastname' => $data->lastname, 'email' => $data->email, 'userLevel' => $this->getuserLevel($data->id)); \n }", "public function changeStatus($id, $statid, AppAssigned $mailer)\n {\n $user = Auth::user();\n $ticket = Ticket::where('id', $id)->first();\n $assignee = User::where('id', $ticket->assignee)->first();\n $created_by = User::where('id', $ticket->created_by)->first();\n //$mailer->sendStatusChanged($created_by);\n $supervisor = User::where('role', 1)->where('agency_id', $assignee->agency_id)->first();\n\n /*\n * In Process\n */\n if($statid == 2){\n if($ticket->status == 5 && ($user->role == 0 || $user->id == $supervisor->id)){\n $ticket->status = $statid;\n $ticket->save();\n //email\n $status = 'Reopened ticket';\n //$mailer->sendStatusChanged($created_by);\n\n $log = Comment::create([\n 'is_comment' => 0,\n 'comment' => ' reopened ticket.',\n 'user_id' => $user->id,\n 'commenter_role' => $user->role,\n 'ticket_id' => $id,\n 'class' => 'fa-ticket'\n ]);\n\n return redirect('in-process-tickets')->with('message', 'Successfully reopened ticket!');\n }\n else if($ticket->status != 5 && ($user->role == 0 || $user->id == $supervisor->id)){\n return redirect()->back()->with('error', 'The ticket you are reopening is not closed in the first place!');\n }\n else if($ticket->status == 3 && $user->role == 4){\n $ticket->status = $statid;\n\n $dept = Department::where('id', $ticket->dept_id)->first();\n $deptrep = User::where('id', $dept->dept_rep)->first();\n $ticket->assignee = $deptrep->id;\n\n $ticket->save();\n //email\n //$mailer->sendStatusChanged($created_by);\n\n //email\n //$mailer->sendStatusChanged($created_by);\n\n $log = Comment::create([\n 'is_comment' => 0,\n 'comment' => ' of '.$dept->dept_name.' is now processing the ticket.',\n 'user_id' => $user->id,\n 'commenter_role' => $user->role,\n 'ticket_id' => $id,\n 'class' => 'fa-ticket'\n ]);\n\n\n //email\n $mailer->sendStatusChanged($created_by);\n return redirect()->back()->with('message', 'Ticket now in process.'); \n }\n if($ticket->status == 7 && $user->role < 4){\n if($ticket->assignee==$user->id){\n $ticket->status = $statid;\n $ticket->save();\n //email\n $status = 'Re-process ticket';\n //$mailer->sendStatusChanged($created_by);\n\n $log = Comment::create([\n 'is_comment' => 0,\n 'comment' => ' re-process ticket.',\n 'user_id' => $user->id,\n 'commenter_role' => $user->role,\n 'ticket_id' => $id,\n 'class' => 'fa-ticket'\n ]);\n\n return redirect('in-process-tickets')->with('message', 'Now re-processing ticket!');\n }\n else redirect()->back()->with('error', \"You don't have the permission to process this ticket!\");\n }\n else return redirect()->back()->with('error', \"You don't have the permission to reopen a ticket!\");\n }\n\n /*\n * Pending (Escalated)\n */\n else if($statid == 3){\n if($user->id == $ticket->assignee || $user->id == $supervisor->id){\n if($ticket->status == 2){\n $ticket->status = $statid;\n $ticket->save();\n //email\n //$mailer->sendStatusChanged($created_by);\n\n //$dept = Department::where('id', $ticket->dept_id)->first();\n\n $log = Comment::create([\n 'is_comment' => 0,\n 'comment' => ' changed ticket status to pending.',\n 'user_id' => $user->id,\n 'commenter_role' => $user->role,\n 'ticket_id' => $id,\n 'class' => 'fa-ticket'\n ]);\n\n return redirect('pending-tickets')->with('message', 'Successfully changed ticket status to pending!');\n }\n return redirect()->back()->with('error', \"This ticket's cannot be changed to pending. Only tickets in process can be changed.\");\n }\n else return redirect()->back()->with('error', \"You don't have the permission to change the status of this ticket!\");\n }\n\n /*\n * Cancel\n */\n else if($statid==4){\n if($user->role == 0){\n $ticket->status = $statid;\n $ticket->save();\n //email\n //$mailer->sendStatusChanged($created_by);\n\n $log = Comment::create([\n 'is_comment' => 0,\n 'comment' => ' cancelled the ticket.',\n 'user_id' => $user->id,\n 'commenter_role' => $user->role,\n 'ticket_id' => $id,\n 'class' => 'fa-ticket'\n ]);\n\n return redirect('/')->with('message', 'Successfully cancelled ticket!');\n }\n else return redirect()->back()->with('error', \"You have no permission to cancel this ticket!\");\n }\n\n /*\n * Close\n */\n /*else if($statid==5){\n if($user->id == $ticket->assignee || $user->role < 2){\n\n if($ticket->category==NULL)\n return redirect()->back()->with('error', 'Please set category first before closing the ticket!');\n\n $ticket->status = $statid;\n $ticket->save();\n //$mailer->sendStatusChanged($created_by);\n\n $log = Comment::create([\n 'is_comment' => 0,\n 'comment' => ' closed the ticket.',\n 'user_id' => $user->id,\n 'commenter_role' => $user->role,\n 'ticket_id' => $id,\n 'class' => 'fa-ticket'\n ]);\n\n return redirect('closed-tickets')->with('message', 'Successfully closed ticket!');\n }\n else return redirect()->back()->with('error', 'You have no permission to close this ticket!');\n }*/\n\n /*\n * Escalate\n */\n else if($statid==6){\n if($user->id == $ticket->assignee || $user->id == $supervisor->id){\n if($ticket->status == 1)\n return redirect()->back()->with('error', \"Ticket has to be assigned first before it can be escalated!\");\n else if($ticket->status == 2){\n $rep = User::where('agency_id', $ticket->dept_id)->where('role', 4)->get();\n\n if(count($rep)==0)\n return redirect()->back()->with('error', 'Ticket cannot be escalated since agency has no representative yet.');\n\n $ticket->assignee = NULL;\n $ticket->save();\n\n $dept = Department::where('id', $ticket->dept_id)->first();\n\n $log = Comment::create([\n 'is_comment' => 0,\n 'comment' => ' escalated the ticket to '.$dept->dept_name.'.',\n 'user_id' => $user->id,\n 'commenter_role' => $user->role,\n 'ticket_id' => $id,\n 'class' => 'fa-ticket'\n ]);\n\n return redirect('in-process-tickets')->with('message', 'Successfully escalated ticket!');\n }\n else if($ticket->status > 2)\n return redirect()->back()->with('error', 'This ticket cannot be escalated. Only tickets in process can be escalated.');\n\n }\n else return redirect()->back()->with('error', \"You don't have the permission to escalate this ticket!\");\n }\n\n else if($statid==7){\n if($user->id == $ticket->assignee || $user->id == $supervisor->id){\n if($ticket->status == 1)\n return redirect()->back()->with('error', \"Ticket has to be assigned first before it can change status to pending!\");\n else if($ticket->status == 2){\n\n $ticket->status = 7;\n $ticket->save();\n\n $dept = Department::where('id', $ticket->dept_id)->first();\n\n $log = Comment::create([\n 'is_comment' => 0,\n 'comment' => \" is now awaiting for \".$dept->dept_name.\"'s response.\",\n 'user_id' => $user->id,\n 'commenter_role' => $user->role,\n 'ticket_id' => $id,\n 'class' => 'fa-ticket'\n ]);\n\n return redirect('pending-tickets')->with('message', 'Now awaiting the agency for responses.');\n }\n else if($ticket->status > 2)\n return redirect()->back()->with('error', 'This ticket cannot change status to pending. Only tickets in process can do so.');\n\n }\n else return redirect()->back()->with('error', \"You don't have the permission to change this ticket's status!\");\n }\n\n }", "function change_status()\n\t{\n\t\t//validate user\n\t\t$response=$this->validateUserLogin();\n\n\t\t$db=JFactory::getDBO();\n\t\t$user=JFactory::getUser();\n\t\t$uid=$user->id;\n\t\t//get inputs from posted data\n\t\t$input=JFactory::getApplication()->input;\n\t\t$sts=$input->post->get('sts','','INT');\n\t\t$stsm=$input->post->get('stsm','','STRING');\n\n\t\t//validate inputs\n\t\t//validate status\n\t\tif( $sts>=5 || $sts<0 ){\n\t\t\t$response['validate']->error=1;\n\t\t\t$response['validate']->error_msg=JText::_('COM_JBOLO_INVALID_STATUS');\n\t\t\treturn $response;\n\t\t}\n\n\t\t//validate status - check if it contains allowed values\n\t\t//@TODO\n\n\t\t//add slashes & strip tags from status message\n\t\t$stsm=addslashes(strip_tags($stsm));\n\n\t\t$query=\"UPDATE #__jbolo_users SET status_msg='\".$stsm.\"'\";\n\t\tif($sts){//update chat sts only if it is there in posted data\n\t\t\t$query.=\" , chat_status=\".$sts;\n\t\t}\n\t\t$query.=\" WHERE user_id=\".$uid;\n\t\t$db->setQuery($query);\n\t\tif(!$db->execute())//error updating\n\t\t{\n\t\t\t//echo $db->stderr();\n\t\t\t$response['validate']->error=1;\n\t\t\t$response['validate']->error_msg=JText::_('COM_JBOLO_DB_ERROR');\n\t\t}else{//updated successfully\n\t\t\t$change_sts_response['change_sts_response']=1;\n\t\t}\n\n\n\t\treturn $response;\n\n\t}", "function activateNewsletter() {\n\t\t$hash = t3lib_div::_GP('nlAuth');\n\t\t$userID = t3lib_div::_GP('u');\n\n\t\t// get the whole row\n\t\t$row = current($GLOBALS['TYPO3_DB']->exec_SELECTgetRows( '*', 'fe_users', 'uid=' . $userID ));\n\t\t$realHash = substr(sha1(serialize($row)), 1, 6); // first 6 letters from hash\n\t\tif ( $row['disable'] && ($realHash == $hash) ) { // hash matches\n\t\t\t// enable the user\n\t\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery( 'fe_users', 'uid=' . $userID, array(\n\t\t\t\t'uid' => $userID,\n\t\t\t\t'disable' => '0' ) );\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "protected function Authorized(){\n // usuario\n $url = $this->getUrl();\n if ($url instanceof Url && $this->isWebsiteFree($url->host)){\n return true;\n }\n \n // Autorizar la solicitud atendiendo a la activacion del usuario\n\t\t$uType = $this->getUserType();\n\t\t\n\t\tif ($uType >= USER_CLIENT){ // Ok user is active\n\t\t\t$res = DBHelper::Select('users', '*', \"email='{$this->user}'\");\n\t\t\t//if ((!$res[0]['name'] || !$res[0]['phone']) && $res[0]['expiration'] - time() >= 7 * 24 * 3600){\n\t\t\t//\t$this->url = Url::Parse(\n // \t\t\"http://\".HTTP_HOST.\"/__www/set-user-info.php?user={$this->user}&success_url=\" . urlencode((string)$this->data->url)\n \t//\t);\n\t\t\t//}\n\t\t}elseif(DBHelper::is_user_registered($this->user) > 0){ \n // La activacion del usuario ha expirado. Redirigir a\n // la pagina de recarga\n\t\t\t\n /** @var Url url */\n $url = $this->getUrlFromData();\n if (stripos($url->host, HTTP_HOST) === FALSE){\n\t\t\t $this->url = Url::Parse(ACCOUNT_EXPIRED_URL . \"&user={$this->user}&mobile={$this->data->mobile}&success_url=\". urlencode((string)$this->data->url));\n }\n\t\t}else {\n // Se permite acceso solamente al servidor de Aurora\n return FALSE;\n }\n \n return true;\n\t}", "function activateMember2($username)\r\n\t{\r\n\t\t$username = funcs::check_input($username);\r\n\r\n\t\t$sql = \"SELECT isactive FROM \".TABLE_MEMBER.\"\r\n\t\t\t\t WHERE \".TABLE_MEMBER_USERNAME.\"='\".$username.\"'\";\r\n\t\t$row = DBconnect::get_nbr($sql);\r\n\t\tif($row == 0)\r\n\t\t{\r\n\t\t\t$sql = \"UPDATE \".TABLE_MEMBER.\" SET \".TABLE_MEMBER_ISACTIVE.\"=1\r\n\t\t\t\t\t\tWHERE \".TABLE_MEMBER_USERNAME.\"='\".$username.\"' LIMIT 1\";\r\n\t\t\tDBconnect::execute($sql);\r\n\r\n\t\t\t$userid = funcs::getUserid($username);\r\n\r\n\t\t\t//Hauke\r\n\t\t\t$membership = 3;\r\n\t\t\t$rate = 1;\r\n\t\t\t$paid_via = 3;\r\n\t\t\t$payment_complete = 1;\r\n\t\t\t$today = date(\"Y-m-d\");\r\n\r\n\t\t\tfuncs::insertpayment($userid,$membership,$rate,$paid_via, $payment_complete);\r\n\r\n\t\t\t$sql = \"UPDATE \".TABLE_PAY_LOG.\" SET \".\"real_name\".\"='$real_name',\r\n\t\t\t\t\t\t\t\t\t\t\t \t \".\"real_street\".\"='$street',\r\n\t\t\t\t\t\t\t\t\t\t\t\t \".\"real_city\".\"='$city',\r\n\t\t\t\t\t\t\t\t\t\t\t\t \".\"sum_paid\".\"='0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t \".\"cancelled\".\"='1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t \".\"cancelled_date\".\"='$today'\r\n\t\t\t\t\t\t\t\t\t \t WHERE \".\"username\".\"='$username'\";\r\n\t\t\tDBconnect::execute($sql);\r\n\r\n\t\t\t$sql = \"UPDATE \".TABLE_MEMBER.\" SET \".\"type\".\"='$membership',\r\n\t\t\t\t\t\t\t\t\t\t\".\"signup_datetime=now(),\r\n\t\t\t\t\t\t\t\t\t\t\".\"advertise_regist='2'\r\n\t\t\t\t\t\t\t\t\t \t WHERE username ='$username'\";\r\n\t\t\tDBconnect::execute($sql);\r\n\r\n\t\t\t//Hauke end\r\n\r\n\t\t\t$subject = funcs::getText($_SESSION['lang'], '$first_time_inbox_subject');\r\n\t\t\t$message = funcs::getText($_SESSION['lang'], '$first_time_inbox_message');\r\n\t\t\t$sql = \"INSERT INTO \".TABLE_MESSAGE_INBOX.\"\r\n\t\t\t\t\tSET \".TABLE_MESSAGE_INBOX_TO.\"=\".$userid.\",\r\n\t\t\t\t\t\".TABLE_MESSAGE_INBOX_FROM.\"=1,\r\n\t\t\t\t\t\".TABLE_MESSAGE_INBOX_SUBJECT.\"='\".$subject.\"',\r\n\t\t\t\t\t\".TABLE_MESSAGE_INBOX_MESSAGE.\"='\".$message.\"',\r\n\t\t\t\t\t\".TABLE_MESSAGE_INBOX_DATETIME.\"='\".funcs::getDateTime().\"'\";\r\n\t\t\tDBconnect::execute($sql);\r\n\t\t\tself::NewSorting($username);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "public function user_change_sts(){\n //echo \"csdbh\";die;\n\t\t\t$id=$this->input->post('comment_id');\n\t\t\t$status=$this->input->post('comment_status');\n\t\t\t\n\t\t\t$result = $this->Comment_Modal->comment_status($id,$status);\n\t\t\tif($result){\n\t\t\t\t//echo $this->db->last_query();\n\t\t\t\techo 1;\n\t\t\t\t//redirect('Home/comment');\n\t\t\t}else{\n\t\t\t\techo 0;\n\t\t\t\t//redirect('Home/comment');\n\t\t\t}\n\t\t\n\t\t}", "public function statusAction(){\n $this->_models->changeStatusIcons($this->_arrParam,array('task' => 'change-submit-status'));\n redirect::locationHeader('admin','user','index');\n }", "public function getStatus()\n {\n $userid = $this->user_id;\n $user = User::findIdentity($userid);\n if($user):\n $status = User::STATUS_ACTIVE;\n else:\n $status = User::STATUS_DELETED;\n endif;\n return $status;\n }", "function verificalogin(){\n if(!isset($this->session->datosusu)){\n return true;\n }\n }" ]
[ "0.6851235", "0.636786", "0.6335701", "0.62981445", "0.62500733", "0.6213114", "0.61601245", "0.6138695", "0.61195654", "0.6113712", "0.6083331", "0.6041383", "0.602066", "0.59886897", "0.5970986", "0.5951805", "0.5941764", "0.5938046", "0.59319365", "0.5927163", "0.59167403", "0.59167403", "0.59042335", "0.5902143", "0.5883279", "0.58392894", "0.5837042", "0.58366", "0.5814157", "0.5804557", "0.5803799", "0.5795844", "0.57929415", "0.5786789", "0.57830715", "0.5777907", "0.57771313", "0.5742219", "0.574152", "0.57281137", "0.57254744", "0.5723111", "0.5723051", "0.57205296", "0.57112306", "0.5707139", "0.5697213", "0.5687164", "0.5685144", "0.56798863", "0.5678824", "0.5678824", "0.56768525", "0.5676579", "0.56631565", "0.5663053", "0.56585276", "0.56518424", "0.56362957", "0.5633546", "0.5632967", "0.5629465", "0.56284153", "0.5626931", "0.562291", "0.5619514", "0.56150377", "0.56104785", "0.5606098", "0.56047964", "0.56038386", "0.56037986", "0.5601499", "0.5598259", "0.55960757", "0.55959797", "0.5591562", "0.5591341", "0.5589875", "0.5584484", "0.557811", "0.5572244", "0.55675536", "0.5563634", "0.5562617", "0.5561818", "0.55573404", "0.5557115", "0.55521446", "0.55510753", "0.55357397", "0.5533782", "0.5531972", "0.55312085", "0.5530076", "0.55259705", "0.5522356", "0.5517724", "0.551078", "0.5508057", "0.5506674" ]
0.0
-1
Haalt het aantal studenten op die ingeschreven zijn voor een sessie
function getEnrolledStudents($columnId) { $this->db->where('planningKolomId', $columnId); $list = array(); foreach($this->db->get('aanwezigheid')->result() as $aanwezigheid) { $list[] = (int)$aanwezigheid->gebruikerId; } return $list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_student() {\n return $this->session->get(\"niveau_acces\") >= 0;\n }", "public function get_session_wise_student() {\n\t\t$checker = array(\n\t\t\t'session' => $this->active_session,\n\t\t\t'school_id' => $this->school_id\n\t\t);\n\t\treturn $this->db->get_where('enrols', $checker);\n\t}", "function pobierz_studentow() {\n\t\t$baza = polacz_z_baza();\n\n\t\t$zapytanie = 'select * from studenci';\n\t\t$wynik = mysqli_query($baza, $zapytanie);\n\n\t\tzakoncz_polaczenie($baza);\n\n\t\treturn $wynik;\n\t}", "public function sessie_opslaan()\n\n\t{\n $this->load->model('sessie_model');\n\n $date= $this->input->post('datumid');\n $jaargang= $this->input->post('jaargang');\n $voorstellen= $this->input->post('voorstel');\n $lokalen= $this->input->post('lokaal');\n $tabelids= $this->input->post('tabelid');\n $sessieids = $this->input->post('sessieid');\n for($tr=0;$tr<=15;$tr++){\n if ($date==0) {\n redirect('planning/toonMeldingVulDatumIn');\n }elseif($lokalen[$tr]==0 &&$voorstellen[$tr]!=0){\n redirect('planning/toonMeldingGeenLokaal');\n }elseif($lokalen[$tr]!=0 &&$voorstellen[$tr]==0){\n redirect('planning/toonMeldingGeenVoorstel');\n }elseif($lokalen[$tr]!=0 && $voorstellen[$tr]!=0){\n if ($sessieids[$tr]==0) {\n $sessie = new stdClass();\n $sessie->datum = $date;\n $sessie->lokaalid = $lokalen[$tr];\n $sessie->voorstelid = $voorstellen[$tr];\n $sessie->jaargangid = $jaargang;\n $sessie->tabelid = $tabelids[$tr];\n $this->sessie_model->wijzig($sessie); \n }else{\n $sessie = new stdClass();\n $sessie->datum = $date;\n $sessie->lokaalid = $lokalen[$tr];\n $sessie->voorstelid = $voorstellen[$tr];\n $sessie->jaargangid = $jaargang;\n $sessie->tabelid = $tabelids[$tr];\n $sessie->id = $sessieids[$tr];\n $this->sessie_model->update($sessie);}\n }elseif($lokalen[$tr]==0 && $voorstellen[$tr]==0 && $sessieids[$tr]!=0){\n $sessie = new stdClass();\n $sessie->id = $sessieids[$tr];\n $this->sessie_model->delete($sessie);\n }\n \n \n \n }\n \n redirect('planning/planningOpgeslagen');\n \n \n\t}", "private function sesja() {\r\n session_start();\r\n if (!isset($_SESSION['id'])) {\r\n $_SESSION['id'] = 0;\r\n }\r\n }", "public function index()\n {\n $dt=new Carbon('','Asia/Tehran');\n $time=$dt->toDateTimeString();\n $user = Auth::user();\n $title=DB::table('roles')->latest('created_at')->first();\n $q = Question::all()->where('title',$title->title)->random(10);\n $ans=array();\n foreach ($q as $question){\n array_push($ans, $question->ans);\n }\n session_start();\n $_SESSION['ans']=$ans;\n if($user->attemps>0){\n $user->attemps-=1;\n $user->save();\n return view('student.exam',compact('q','user','time'));\n }\n else\n return view('student.examNotFound',compact('time'));\n\n }", "public static function onlineStudent(){\n $students = Roll::join('admissions','admissions.id', '=' , 'rolls.student_id' )\n ->where(['username' => Session::get('studentSession')])->first();\n \n return $students;// we will join the student with admission okay to have all his/her data's\n }", "function check_if_student_logged(){\n\t\tglobal $url_home;\n\t\tglobal $current;\n\t\tif(!isset($_SESSION['id_korisnika']) && $current != \"login.php\" && $current != \"register.php\" && $current != \"reset.php\") header('Location: '.$url_home.'user/login.php');\n\t\telse if(isset($_SESSION['id_korisnika']) && ($current == \"login.php\" || $current == \"reset.php\" || $current == \"register.php\")) header('Location: '.$url_home.'user');\n\t}", "public function lijst() {\r\n $this->load->model('sessies_model');\r\n $data['sessies'] = $this->sessies_model->getAllOngekeurdeMetSpreker();\r\n $this->load->view('admin/sessies/lijst_voorstellen', $data);\r\n }", "public function index()\n {\n $count_estudiante = Estudiante::select('id')->count();\n $count_coord = User::where('rol_id','2')->select('id')->count();\n $count_dir = User::where('rol_id','2')->select('id')->count();\n $count_asis = User::where('rol_id','3')->select('id')->count();\n //dd((Auth::user()->id));\n if(Auth::user()->roles->first()->id == 4){\n $student = Estudiante::where('user_id',Auth::user()->id)->first();\n if($student){\n return redirect()->route('estudiantes.show',$student->id);\n }else{\n return redirect()->route('estudiantes.create');\n }\n\n }else{\n return view('home', compact('count_estudiante','count_coord','count_asis','count_dir'));\n }\n\n }", "public function autenticar($usr,$pwd) {\n $pwd=\"'\".$pwd.\"'\";\n $sql= 'SELECT * FROM empleados WHERE (\"idEmpleado\" = '.$usr.') AND (dni = '.$pwd.');';\n $empleado=\"\";\n $result = pg_query($sql);\n\n if ($result){\n $registro = pg_fetch_object($result);\n $empleado = $registro->nombres . \" \" . $registro->apellido;\n session_start(); //una vez que se que la persona que se quiere loguear es alguien autorizado inicio la sesion\n //cargo en la variable de sesion los datos de la persona que se loguea\n $_SESSION[\"idEmpleado\"]=$registro->idEmpleado;\n $_SESSION[\"dni\"]=$registro->dni;\n $_SESSION[\"fechaInicio\"]=$registro->fechaInicio;\n $_SESSION[\"nombres\"]=$registro->nombres;\n $_SESSION[\"apellido\"]=$registro->apellido;\n $_SESSION[\"i_lav\"]=$registro->i_lav;\n $_SESSION[\"f_lav\"]=$registro->f_lav;\n $_SESSION[\"i_s\"]=$registro->i_s;\n $_SESSION[\"f_s\"]=$registro->f_s;\n $_SESSION[\"i_d\"]=$registro->i_d;\n $_SESSION[\"f_d\"]=$registro->f_d;\n //$_SESSION[\"iex_lav\"]=$registro->iex_lav;\n //$_SESSION[\"fex_lav\"]=$registro->fex_lav;\n }\n return $empleado;\n }", "public function login(Request $request){\n $vouter= Vouter::where('email', $request->email)\n ->where('password',$request->password)\n ->first();\n if($vouter){\n session()->forget('vouter');\n session()->forget('partie');\n\n session(['vouter' => $vouter]);\n $partie = $vouter->partie()->first();\n session(['partie' => $partie]);\n // recuperer la liste des surveys encours\n $surveyController = new SurveyController();\n $surveys = $surveyController->index();\n VouterController::surveys();\n if($surveys){\n session()->forget('surveys');\n session(['surveys' => $surveys]);\n }\n\n\n\n return redirect('profile');\n }\n else{\n return redirect('login');\n }\n\n }", "function verificalogin(){\n if(!isset($this->session->datosusu)){\n return true;\n }\n }", "function verifystudent($studid,$classid){\n include('../../config.php'); \n $q = \"select * from studentsubject where studid=$studid and classid=$classid\";\n $r = mysql_query($q);\n if(mysql_num_rows($r) < 1){\n return true;\n }else{\n return false; \n }\n }", "function userCanViewStudent( $sessionID ){\r\n\t\treturn $this->getAccessLevel() > 3;\r\n\t}", "public function isStudent(){\n\t\t// get user type\n\t\t$session_data = $this->session->userdata('logged_in'); // get userid from session\n\t\t\t\n\t\t// redirect to home if user is not a student\n\t\tif($session_data['usertype']!=0) redirect('/home');\n\t}", "function _ObtenerSecciones()\n\t{\n\t\tinclude_once('../Entidades/Secciones.php');\n\t\t$OBJUsuarios = new Secciones;\n\t\t$secciones=$OBJUsuarios -> ObtenerSeccionesparaCategorias();\n\n\n\t\tif ($secciones>=0) {\n\t\t\t\n\t\t\t$privilegios = $_SESSION['privilegios'];\n\t\t\t\n\t\t\tinclude_once('../ModuloAdministrador/vistas/FormularioCategorias.php');\n\t\t\t$OBJUsuarios = new FormularioCategorias;\n\t\t\t$OBJUsuarios -> MostrarFormularioCategorias($secciones,$privilegios);\n\n\t\t}\n\n\t\telse{\n\n\t\t\t\t $mensaje=\"llame al administrador o contacte a [email protected]\";\n\t\t\t\t include('../includes/FormularioMensaje.php');\n\t\t\t\t $objmen = new FormularioMensaje;\n \t $objmen->MostrarMensajeLogin($mensaje);\n\n\t\t}\n\t}", "function attendance_session_open_for_students($sess) {\n $sessionopens = empty($sess->studentsearlyopentime) ? $sess->sessdate : $sess->sessdate - $sess->studentsearlyopentime;\n if (time() > $sessionopens) {\n return true;\n } else {\n return false;\n }\n}", "function userCanCreateOrReplaceStudent( $sessionID ) {\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "function doLogin() {\n $conn = getDBConnection();\n $FLAG = false;\n\n //sql query\n $sql = \"SELECT * FROM users WHERE username = '\" . $_POST['username'] . \"' AND password = PASSWORD('\" . $_POST['password'] . \"')\";\n\n //echo $sql;\n $result = mysqli_query($conn, $sql);\n if (mysqli_num_rows($result) > 0) {\n // output data of each row\n\n while ($row = mysqli_fetch_assoc($result)) {\n //create assos array and add the result data\n //$userArray = array('fname' => $row['firstname'],'lname'=>$row['lastname']); \n $_SESSION['ssn_user'] = $row;\n\n //if student get student details\n if ($row['role_code'] == 'STUDENT') {\n $sql = \"SELECT * FROM student WHERE username = '\" . $row['username'] . \"'\";\n $result_student = getData($sql);\n while ($row = mysqli_fetch_assoc($result_student)){\n $_SESSION['ssn_student'] = $row;\n }\n }\n //if student get lecturer details\n if ($row['role_code'] == 'LECTURE') {\n $sql = \"SELECT * FROM lecture WHERE username = '\" . $row['username'] . \"'\";\n $result_lecturer = getData($sql);\n while ($row = mysqli_fetch_assoc($result_lecturer)){\n $_SESSION['ssn_lecturer'] = $row;\n }\n }\n }\n\n $FLAG = TRUE;\n } else {\n \n }\n\n\n mysqli_close($conn);\n return $FLAG;\n}", "public function controle()\n\t{ \n\t\tif (isset($_COOKIE[GBA_COOKIE_NAME]))\n\t\t{\n\t\t\tsession_name(GBA_COOKIE_NAME);\n\t\t\tsession_start();\t\n\t\t}\n\t\tif (isset($_SESSION) && isset($_SESSION['sessao']) && isset($_SESSION['sessao']['codsessao']))\n\t\t{\n\t\t\t$boAutenticado = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$boAutenticado = false;\n\t\t}\n\t\tif ($boAutenticado === false)\n\t\t{\n\t\t\theader(\"Location: \" . GBA_URL_SISTEMA . \"login.php\");\n\t\t}\n // Adiciona registro no Historico de navegacao\n // Verificando se a ultima pagina ja nao esta gravada\n\t\t$stUltimaPagina = str_replace(GBA_PATH_SISTEMA, '', $_SERVER['SCRIPT_FILENAME']);\n\n\t\tif (count($_SESSION['historico']) == 0)\n\t\t{\n\t\t\t\t$_SESSION['historico'][] = $stUltimaPagina;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( isset($_SESSION['historico'][count($_SESSION['historico'])-1]) && ($_SESSION['historico'][count($_SESSION['historico'])-1] != $stUltimaPagina) )\n\t\t\t{\n\t\t\t\t$_SESSION['historico'][] = $stUltimaPagina;\n\t\t\t}\n\t\t}\n\t}", "public function ivtd()\n {\n session_start();\n if (!isset($_SESSION[\"Instructor\"])) {\n\n header('Location: ../inicio');\n\n } else {\n\n $this->vista('invitado/menu');\n\n }\n }", "public function verificar_sessao() {\n if ($this->session->userdata('logado') == false)\n redirect('dashboard/login');\n }", "function show_sessions( $type, $info, $db)\n{\n\t$found;\n\t$studentPsid = $info->getPsid();\n\t\n\t$result = $db->query( \"select * from Sessions where Sessions.psid = '$studentPsid' order by Sessions.year desc,Sessions.month desc,Sessions.day desc,Sessions.hour desc,Sessions.min desc,Sessions.second desc\");\n\t\n\t$rows = $result->num_rows;\n\t\n\tif ( $rows < 1 ) \n\t{\n\t\techo \"No sessions have been logged for this student: <br/>\";\n\t\n\t}\n\telse\n\t{\n\t\tif ( $type > 0 )\n\t\t{\n\t\t\tfor ( $i = 0; $i < $rows; $i++ )\n\t\t\t{\n\t\t\t\t$row = $result->fetch_array();\n\t\t\t\t$dateString = $row['year'].\"-\".$row['month'].\"-\".$row['day'].\"-\".$row['hour'].\"-\".$row['min'].\"-\".$row['second'];\n\t\t\t\t$psid = $row['psid'];\n\t\t\t\t$rdo = $psid.\":\".$dateString;\n\t\t\t\techo \"Select Session $i: PeopleSoft: $psid Date: $dateString : <input type='radio' value='$rdo' name='rdochoice' /><br/>\";\n\t\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ( $i = 0; $i < $rows; $i++ )\n\t\t\t{\n\t\t\t\t$row = $result->fetch_array();\n\t\t\t\techo \"Select Session $i: PeopleSoft: \". $row['psid']. \" Date: \".$row['year'].\"-\".$row['month'].\"-\".$row['day'].\"-\".$row['hour'].\"-\".$row['min'].\"-\".$row['second'].\"</br>\";\n\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t}\n\t\n\t$infoString = serialize( $info );\n\t$_SESSION['student'] = $infoString;\n\t\n\treturn;\n}", "public function index()\n {\n if ($this->session->userdata('pre_student_login') != 1)\n redirect(site_url('login'), 'refresh');\n if ($this->session->userdata('pre_student_login') == 1)\n redirect(site_url('pre_student/dashboard'), 'refresh');\n }", "public function Save()\r\n\t\t{\r\n\t\t\t$db = new Db();\r\n\t\t\t$sql = \"INSERT INTO tbl_users (naam, voornaam, email, wachtwoord)\r\n\t\t\tVALUES ('\".$db->conn->real_escape_string($this->m_sName).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sFirstname).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sEmail).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sPassword).\"'\r\n\t\t\t)\";\r\n\t\t\t$db->conn->query($sql);\r\n\r\n\t\t\t//user_id van de geregistreerde gebruiker in de session variabele opslaan\r\n\t\t\t$user_id = $db->conn->insert_id;\r\n\t\t\t$_SESSION['user_id'] = $user_id;\r\n\t\t}", "function TienePermisos($seccion, $accion){\r\n$permitir=false;\r\n$permisos=$_SESSION[\"R0l3sp3rM1s0s\"];\r\n@$consulta=$permisos[$seccion][$accion];\r\nif ($consulta==\"SI\"){\r\n$permitir=true;\r\n}\r\nelse{\r\n$permitir=false;\r\n}\r\nreturn $permitir;\r\n\r\n}", "private function getStudent(){\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire.sql\";\n\n\t\t$this->result[\"liste_stagiaire\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_techno_carousel.sql\";\n\n\t\t$this->result[\"liste_techno\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_rs.sql\";\n\n\t\t$this->result[\"liste_rs\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_doc.sql\";\n\n\t\t$this->result[\"liste_doc\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t}", "function student_logged_in()\r\n{\r\n if (isset($_SESSION['student_id']) && !empty($_SESSION['student_id'])) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "public function IniciarSesion(Usuario $usu){\n $conn = new conexion();\n $rol = 0;\n try {\n if($conn->conectar()){\n $str_sql = \"Select usuarios.id_usu, usuarios.nom_usu,usuarios.usuario,usuarios.foto,tp_usuarios.nom_tp as rol,usuarios.idcliente from usuarios \"\n . \"INNER JOIN tp_usuarios WHERE usuarios.id_tp_usu = tp_usuarios.id_tp \"\n . \"and usuarios.usuario = '\".$usu->getUsuario().\"' and usuarios.pass = '\".$usu->getPass().\"' \"\n . \"and estado = 'Activo'\";\n $sql = $conn->getConn()->prepare($str_sql);\n $sql->execute();\n $resultado = $sql->fetchAll();\n foreach ($resultado as $row){\n $rol = 1;\n session_start();\n $_SESSION['id'] = $row['id_usu'];\n //$_SESSION['idcli'] = $row['idcliente'];\n $_SESSION['perfil'] = $row['usuario'];\n $_SESSION['rol'] = $row['rol'];\n $_SESSION['user'] = $row['nom_usu'];\n $_SESSION['img'] = $row['foto'];\n }\n }\n } catch (Exception $exc) {\n $rol = -1;\n echo $exc->getMessage();\n }\n $conn->desconectar();\n return $rol;\n }", "function iniciar_sesion($id_user, $pass){\n\t\t\t//if ( no lo encontro )\n\t\t\t\t//return false;\n\t\t\t$_SESSION['id_usuario'] = $id_usuario;\n\t\t\t$_SESSION['tipo'] = $type;\n\t\t\t$_SESSION['usuario'] = $usuario;\n\t\t\treturn true;\n\t\t}", "public function loginTraitement(){\n\n $identifiant = $this->verifierSaisie(\"identifiant\");\n $password = $this->verifierSaisie(\"password\");\n\n //securite\n if (($identifiant != \"\") && ($password != \"\")){\n\n //on crée un objet de la classe \\W\\Security\\AuthentificationModel\n //ce qui nous permet d'utiliser la methode isValidLoginInfo\n $objetAuthentificationModel = new \\W\\Security\\AuthentificationModel;\n\n $idUser = $objetAuthentificationModel->isValidLoginInfo($identifiant, $password);\n\n if($idUser > 0){\n\n // recuperer les infos de l'utilisateur\n //requete base de donnée pour les recuperer\n //je crée un objet de la classe \\W\\Model\\UsersModel\n $objetUsersModel = new \\W\\Model\\UsersModel;\n // je retrouve les infos de la ligne grace à la colonne ID\n // La classe UsersModel herite de la classe Model je peu donc faire un find pour recupeerr les infos\n $tabUser = $objetUsersModel->find($idUser);\n\n // Je vais ajouter des infos dans la session\n $objetAuthentificationModel->logUserIn($tabUser);\n\n // recuperer l'username\n $username = $tabUser[\"username\"];\n\n\n $GLOBALS[\"loginRetour\"] = \"Bienvenue $username\";\n\n $this->redirectToRoute(\"admin_accueil\");\n }\n else{\n $GLOBALS[\"loginRetour\"] = \"Identifiant incorrects \";\n }\n }else{\n\n $GLOBALS[\"loginRetour\"] = \"Identifiant incorrects \";\n }\n }", "function viewStudent( $sessionID, $studentID ) {\r\n\t\tif( $this->userCanViewStudent( $sessionID )){\r\n if(!empty($studentID)){\r\n\t\t\t $this->verifyStudent($studentID);\r\n\t\t\t $query=\"SELECT * FROM X_PNSY_STUDENT ss, students s WHERE ss.ID = '$studentID' AND ss.ID = s.StudentID\";\r\n\t\t\t $result = mysql_query($query);\r\n\t\t\t return mysql_fetch_assoc($result);\r\n }\r\n\t\t}\r\n\t}", "public function renderPrivlastnit()\n {\n $spis_id = $this->getParameter('id', null);\n\n $orgjednotka_id = Orgjednotka::dejOrgUzivatele();\n\n $Spis = new Spis;\n $sp = $Spis->getInfo($spis_id);\n if (!empty($sp->orgjednotka_id) || !empty($sp->orgjednotka_id_predano))\n $this->flashMessage('Operace zamítnuta.', 'error');\n else if (!isset($orgjednotka_id))\n $this->flashMessage('Nemůžete převzít spis, protože nejste zařazen do organizační jednotky.',\n 'warning');\n else if ($Spis->zmenitOrg($spis_id, $orgjednotka_id)) {\n $this->flashMessage('Úspěšně jste si převzal tento spis. Pokud spis obsahoval dokumenty, jejich vlastnictví změněno nebylo.');\n } else {\n $this->flashMessage('Převzetí spisu do vlastnictví se nepodařilo. Zkuste to znovu.',\n 'warning');\n }\n\n $this->redirect(':Spisovka:Spisy:detail', array('id' => $spis_id));\n }", "function getInstitutionsession() {\n $model = \\common\\models\\Staff::findOne([\"user_id\" => Yii::$app->user->identity->user_id]);\n\n //end \n /*\n * Set global\n */\n $session = Yii::$app->session;\n if (isset($session['learn_institution_id'])) {\n $session->remove('learn_institution_id');\n unset($session['learn_institution_id']);\n if (count($model) > 0) {\n $session['learn_institution_id'] = $model->learning_institution_id;\n }\n } else {\n if (count($model) > 0) {\n $session['learn_institution_id'] = $model->learning_institution_id;\n }\n }\n }", "public function login (){\n\n $dao = DAOFactory::getUsuarioDAO(); \n $GoogleID = $_POST['GoogleID']; \n $GoogleName = $_POST['GoogleName']; \n $GoogleImageURL = $_POST['GoogleImageURL']; \n $GoogleEmail = $_POST['GoogleEmail'];\n $usuario = $dao->queryByGoogle($GoogleID); \n if ($usuario == null){\n $usuario = new Usuario();\n $usuario->google = $GoogleID;\n $usuario->nombre = $GoogleName;\n $usuario->avatar = $GoogleImageURL;\n $usuario->correo = $GoogleEmail;\n print $dao->insert($usuario);\n $_SESSION[USUARIO] = serialize($usuario);\n //$usuario = unserialize($_SESSION[USUARIO]);\n } else {\n $_SESSION[USUARIO] = serialize($usuario);\n }\n }", "private function verificar_cookie_sesion()\n\t{\n\t\t$session = \\Config\\Services::session();\n\t\t//verificar cookies\n\t\tif (isset($_COOKIE['ivafacil_admin_nick']) && isset($_COOKIE['ivafacil_admin_pa']) ) {\n\n\t\t\t$nick= $_COOKIE['ivafacil_admin_nick'];\n\t\t\t$pass=$_COOKIE['ivafacil_admin_pa'];\n\t\t\t//comparar passw hasheadas\n\t\t\t$usuarioCookie = new Admin_model();\n\t\t\t$result_pass_comparison =\n\t\t\t$usuarioCookie->where(\"nick\", $nick) \n\t\t\t->where(\"session_id\", $pass)->first();\n\n\t\t\tif (is_null($result_pass_comparison)) {\n\t\t\t\t//MOSTRAR FORM\n\n\t\t\t\treturn view(\"admin/login\");\n\t\t\t} else {\n\n\t\t\t\t//Se pidio recordar password?\n\t\t\t\tif ($result_pass_comparison->remember == \"S\") {\n\t\t\t\t\t//recuperar sesion si es valida\n\t\t\t\t\t$hoy = strtotime(date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t$expir = strtotime($result_pass_comparison->session_expire);\n\t\t\t\t\tif ($hoy > $expir) return view(\"admin/login\");\n\n\t\t\t\t\t//crear sesion \n\t\t\t\t\t$newdata = [\n\t\t\t\t\t\t'nick' => $nick, \n\t\t\t\t\t\t'pass_alt' => $pass,\n\t\t\t\t\t\t'remember'=> \"S\"\n\t\t\t\t\t];\n\t\t\t\t\treturn view(\"admin/login\", $newdata);\n\t\t\t\t} else {\n\t\t\t\t\treturn view(\"admin/login\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//MOSTRAR FORM\n\t\treturn view(\"admin/login\");\n\t}", "public function student()\n {\n if (session()->get('role')[0] != 'Student') {\n return redirect('/');\n }\n\n return view('home.student');\n }", "function schoolInfo(Request $request){\n $data = $request->all();\n $request->session()->put('uniChat_id', $data['id']);\n return 'La sesion se ha guardado correctamente';\n }", "function teacher_logged_in()\r\n{\r\n\r\n if (isset($_SESSION['SSN']) && !empty($_SESSION['SSN'])) {\r\n\r\n\r\n return true;\r\n } else {\r\n\r\n return false;\r\n }\r\n\r\n\r\n}", "public function accoutingByStudent($student_id){\n }", "private function sessionLogin() {\r\n $this->uid = $this->sess->getUid();\r\n $this->email = $this->sess->getEmail();\r\n $this->fname = $this->sess->getFname();\r\n $this->lname = $this->sess->getLname();\r\n $this->isadmin = $this->sess->isAdmin();\r\n }", "function updateStudentValidate(){\n\t\t\n\t\tif(@$this->institution == \"\" | @$this->identification == \"\" | @$this->passkey == \"\"){\n\t\t\t$respArray = $this->makeResponse(\"ERROR\", \"FAILED TO IDENTIFY USER BASED ON GIVEN CRITERIA!\", \"\");\n\t\t\techo $this->jsoncallback.\"(\".json_encode($respArray).\")\";\n\t\t\texit;\n\t\t}else{\n\t\t\t$this->basics->updateStudent($this->sanitize($this->nom), $this->sanitize($this->institution), $this->sanitize($this->major), $this->sanitize($this->minor), $this->sanitize($this->identification), $this->obsfucate->makePass($this->sanitize($this->passkey)), $this->sanitize($this->google), $this->sanitize($this->yahoo), $this->sanitize($this->live), $this->sanitize($this->facebook), $this->sanitize($this->linkedin), $this->sanitize($this->twitter), @$this->sanitize($this->department), @$this->sanitize($this->school), @$this->sanitize($this->country));\n\t\t}\n\t\n\t}", "public function authentification(){\n $mail = $_POST['email'];\n $password = $_POST['password'];\n\n $checkPass = $this->checkPassword($mail, $password);\n\n //check if email and password are corrects\n if ($checkPass){\n require_once 'ressources/modele/ModelLogin.php';\n $modelLogin = new ModelLogin();\n $user_check = $modelLogin->getUserByEmail($mail);\n\n\n while($row = $user_check->fetch()) {\n // redirect to layout with her Identifiant and Level and check if an user's birthday\n //Create SESSION\n\n $_SESSION['User_ID'] = $row['Id'];\n\n $_SESSION['Level'] = $row['Level'];\n\n $_SESSION['Last_name'] = $row['Last_name'];\n\n $_SESSION['First_name'] = $row['First_name'];\n\n }\n\n header('Location: /');\n exit();\n\n } else {\n header('Location: /login');\n exit();\n }\n }", "function sobreMeSalvar() {\n \n $usuario = new Estado_pessoal();\n $api = new ApiUsuario();\n $usuario->codgusuario = $_SESSION['unia']->codgusario;\n $this->dados = $api->Listar_detalhe_usuario($usuario);\n if (empty($this->dados->codgusuario) && $this->dados->codgusuario == NULL) {\n \n $this->dados = array('dados'=>$api->Insert_sobreMe(new Estado_pessoal ('POST')) );\n header(\"Location:\" .APP_ADMIN.'usuario/detalhe_usuario');\n } else {\n $this->dados = array('dados'=>$api->Actualizar_sobreMe(new Estado_pessoal ('POST')) );\n header(\"Location:\" .APP_ADMIN.'usuario/detalhe_usuario');\n }\n \n }", "private function _authentica($vis_email, $vis_senha){\n\t\t$sql = $this->conexao->prepare('\n\t\t\tSELECT\n\t\t\t\t*\n\t\t\tFROM visitante AS vis\n\t\t\tWHERE vis_email = :vis_email AND vis_senha = :vis_senha\n\t\t');\n\t\t$sql->bindParam(':vis_email', $vis_email);\n\t\t$sql->bindParam(':vis_senha', $vis_senha);\n\t\t$sql->execute();\n\t\t$temp = $sql->fetch(PDO::FETCH_ASSOC);\n\n\t\t// Visitante não encontrado (então é um novo visitante)\n\t\tif($temp === false){\n\t\t\tsleep(2);\n\t\t\treturn ['r' => 'no', 'data' => 'Ops, você errou sua senha ou seu e-mail.'];\n\t\t}\n\n\t\t$_SESSION[SESSION_VISITANTE]['vis_codigo'] = $temp['vis_codigo'];\n\t\t$_SESSION[SESSION_VISITANTE]['vis_email'] = $temp['vis_email'];\n\t\t$_SESSION[SESSION_VISITANTE]['vis_nome'] = $temp['vis_nome'];\n\t\t$_SESSION[SESSION_VISITANTE]['vis_tel'] = $temp['vis_tel'];\n\t\t$_SESSION[SESSION_VISITANTE]['vis_cel'] = $temp['vis_cel'];\n\t\t$_SESSION[SESSION_VISITANTE]['vis_senha'] = $temp['vis_senha'];\n\t\t$_SESSION[SESSION_VISITANTE]['vis_avatar'] = $temp['vis_avatar'];\n\n\t\treturn ['r' => 'ok', 'data' => 'Cliente identificado, logando..'];\n\t}", "public static function session()\n {\n //Sjekker om en bruker er logget in\n if (isset($_SESSION['user'])) {\n //Hvis verifyUser() returnerer falskt er sessionene kapret\n if(!$_SESSION['user']->verifyUser()){\n unset($_SESSION['user']);\n $alert = new Alert(Alert::ERROR, \"Sessionen er kapret og du har blitt logget ut. Husk å bruke beskyttelse\");\n $alert->displayOnIndex();\n }\n }\n }", "public function studentList()\n {\n return output($this->UserDetails->where([\"roleId\"=>$this->getUserRoleId()])->read(),'success','SM001');\n }", "public function get_logged_in_student_details() {\n\t\t$user_id = $this->session->userdata('user_id');\n\t\t$student_data = $this->db->get_where('students', array('user_id' => $user_id))->row_array();\n\t\t$student_details = $this->get_student_details_by_id('student', $student_data['id']);\n\t\treturn $student_details;\n\t}", "public function login(){\n\n if(isset($_POST)){\n \n /* identificar al usuario */\n /* consulta a la base de datos */\n $usuario = new Usuario();\n \n $usuario->setEmail($_POST[\"email\"]);\n $usuario->setPassword($_POST[\"password\"]);\n \n $identity = $usuario->login();\n \n\n if($identity && is_object($identity)){\n \n $_SESSION[\"identity\"]= $identity;\n\n if($identity->rol == \"admin\"){\n var_dump($identity->rol);\n\n $_SESSION[\"admin\"] = true;\n }\n }else{\n $_SESSION[\"error_login\"] = \"identificacion fallida\";\n }\n\n\n /* crear una sesion */\n \n }\n /* redireccion */\n header(\"Location:\".base_url);\n\n }", "public function get_student_list_of_logged_in_parent() {\n\t\t$parent_id = $this->session->userdata('user_id');\n\t\t$parent_data = $this->db->get_where('parents', array('user_id' => $parent_id))->row_array();\n\t\t$checker = array(\n\t\t\t'parent_id' => $parent_data['id'],\n\t\t\t'session' => $this->active_session,\n\t\t\t'school_id' => $this->school_id\n\t\t);\n\t\t$students = $this->db->get_where('students', $checker)->result_array();\n\t\tforeach ($students as $key => $student) {\n\t\t\t$checker = array(\n\t\t\t\t'student_id' => $student['id'],\n\t\t\t\t'session' => $this->active_session,\n\t\t\t\t'school_id' => $this->school_id\n\t\t\t);\n\t\t\t$enrol_data = $this->db->get_where('enrols', $checker)->row_array();\n\n\t\t\t$user_details = $this->db->get_where('users', array('id' => $student['user_id']))->row_array();\n\t\t\t$students[$key]['student_id'] = $student['id'];\n\t\t\t$students[$key]['name'] = $user_details['name'];\n\t\t\t$students[$key]['email'] = $user_details['email'];\n\t\t\t$students[$key]['role'] = $user_details['role'];\n\t\t\t$students[$key]['address'] = $user_details['address'];\n\t\t\t$students[$key]['phone'] = $user_details['phone'];\n\t\t\t$students[$key]['birthday'] = $user_details['birthday'];\n\t\t\t$students[$key]['gender'] = $user_details['gender'];\n\t\t\t$students[$key]['blood_group'] = $user_details['blood_group'];\n\t\t\t$students[$key]['class_id'] = $enrol_data['class_id'];\n\t\t\t$students[$key]['section_id'] = $enrol_data['section_id'];\n\n\t\t\t$class_details = $this->crud_model->get_class_details_by_id($enrol_data['class_id'])->row_array();\n\t\t\t$section_details = $this->crud_model->get_section_details_by_id('section', $enrol_data['section_id'])->row_array();\n\n\t\t\t$students[$key]['class_name'] = $class_details['name'];\n\t\t\t$students[$key]['section_name'] = $section_details['name'];\n\t\t}\n\t\treturn $students;\n\t}", "public static function put_privilages_in_session($user_id){\n $conn= DBConnect::getConnection();\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n $sql=\"SELECT * FROM privilages where user_id=$user_id\";\n $result=$conn->query($sql);\n if ($result->num_rows ==0 ){ \n echo \"Error while fetching user privilages\";\n }\n else{\n while($row = $result->fetch_assoc()) {\n $_SESSION[\"customers_page\"]=$row[\"customers_page\"];\n $_SESSION[\"sessions_page\"]=$row[\"sessions_page\"];\n $_SESSION[\"financial_page\"]=$row[\"financial_page\"];\n $_SESSION[\"users_page\"]=$row[\"users_page\"];\n $_SESSION[\"ended_procecutions\"]=$row[\"ended_procecutions\"];\n \n } \n echo $_SESSION[\"customers_page\"];\n echo $_SESSION[\"sessions_page\"];\n echo $_SESSION[\"financial_page\"];\n echo $_SESSION[\"users_page\"];\n echo $_SESSION[\"ended_procecutions\"];\n }\n}", "public function index()\n {\n $grades = Grade::all();\n $users = User::all();\n $students = [];\n foreach($users as $user){\n if($user->hasRole('Student')){\n $students[$user->id] = $user;\n }\n }\n\n\n\n return view('grade.list')->withGrades($grades)->withStudents($students);\n }", "public function loginUsuario($login = '', $clave = '') {\n $password = md5($clave);\n $this->consulta = \"SELECT * \n FROM usuario \n WHERE login = '$login' \n AND password = '$password' \n AND estado = 'Activo' \n LIMIT 1\";\n\n if ($this->consultarBD() > 0) {\n $_SESSION['LOGIN_USUARIO'] = $this->registros[0]['login'];\n $_SESSION['ID_USUARIO'] = $this->registros[0]['idUsuario'];\n $_SESSION['PRIVILEGIO_USUARIO'] = $this->registros[0]['privilegio'];\n $_SESSION['ACTIVACION_D'] = 0;\n// $_SESSION['ACCESOMODULOS'] = $this->registros[0]['accesoModulos'];\n\n $tipoUsuario = $this->registros[0]['tipoUsuario'];\n\n switch ($tipoUsuario) {\n case 'Empleado':\n $idEmpleado = $this->registros[0]['idEmpleado'];\n $this->consulta = \"SELECT primerNombre, segundoNombre, primerApellido, segundoApellido, cargo, cedula, tipoContrato \n FROM empleado \n WHERE idEmpleado = $idEmpleado \n LIMIT 1\";\n $this->consultarBD();\n// $apellidos = explode(' ', $this->registros[0]['apellidos']);\n $_SESSION['ID_EMPLEADO'] = $idEmpleado;\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = $this->registros[0]['primerNombre'] . ' ' . $this->registros[0]['primerApellido'];\n $_SESSION['CARGO_USUARIO'] = $this->registros[0]['cargo'];\n $_SESSION['TIPO_CONTRATO'] = $this->registros[0]['tipoContrato'];\n\n $_SESSION['NOMBRES_USUARIO'] = $this->registros[0]['primerNombre'] . ' ' . $this->registros[0]['segundoNombre'];\n $_SESSION['APELLIDOS_USUARIO'] = $this->registros[0]['primerApellido'] . ' ' . $this->registros[0]['segundoApellido'];\n $_SESSION['CEDULA_USUARIO'] = $this->registros[0]['cedula'];\n break;\n case 'Cliente Residencial':\n $idResidencial = $this->registros[0]['idResidencial'];\n $this->consulta = \"SELECT nombres, apellidos, cedula \n FROM residencial \n WHERE idResidencial = $idResidencial \n LIMIT 1\";\n $this->consultarBD();\n $apellidos = explode(' ', $this->registros[0]['apellidos']);\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = $this->registros[0]['nombres'] . ' ' . $apellidos[0];\n $_SESSION['CARGO_USUARIO'] = 'Cliente Residencial';\n\n $_SESSION['NOMBRES_USUARIO'] = $this->registros[0]['nombres'];\n $_SESSION['APELLIDOS_USUARIO'] = $this->registros[0]['apellidos'];\n $_SESSION['CEDULA_USUARIO'] = $this->registros[0]['cedula'];\n break;\n case 'Cliente Corporativo':\n $idCorporativo = $this->registros[0]['idCorporativo'];\n $this->consulta = \"SELECT razonSocial, nit \n FROM corporativo \n WHERE idCorporativo = $idCorporativo \n LIMIT 1\";\n\n $this->consultarBD();\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = $this->registros[0]['razonSocial'];\n $_SESSION['CARGO_USUARIO'] = 'Cliente Corporativo';\n\n $_SESSION['NOMBRES_USUARIO'] = $this->registros[0]['razonSocial'];\n $_SESSION['APELLIDOS_USUARIO'] = $this->registros[0]['razonSocial'];\n $_SESSION['CEDULA_USUARIO'] = $this->registros[0]['nit'];\n break;\n case 'Administrador':\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = 'Administrador';\n $_SESSION['CARGO_USUARIO'] = 'Administrador';\n $_SESSION['TIPO_CONTRATO'] = 'Laboral Administrativo';\n\n $_SESSION['NOMBRES_USUARIO'] = 'Administrador';\n $_SESSION['APELLIDOS_USUARIO'] = 'Administrador';\n $_SESSION['CEDULA_USUARIO'] = '10297849';\n $_SESSION['ID_EMPLEADO'] = '12';\n $_SESSION['ID_CAJA_MAYOR_FNZAS'] = 2;\n $idEmpleado = 12;\n break;\n default:\n break;\n }\n\n //******************************************************************\n // VARIABLES DE SESSION PARA EL ACCESO AL MODULO RECAUDOS Y FACTURACION DE swDobleclick\n\n $_SESSION['user_name'] = $_SESSION['NOMBRES_APELLIDO_USUARIO'];\n $_SESSION['user_charge'] = $_SESSION['CARGO_USUARIO'];\n\n $_SESSION['user_id'] = 0; //$this->getIdUsuarioOLD($idEmpleado);\n $_SESSION['user_privilege'] = 0; //$this->getPrivilegioUsuarioOLD($idEmpleado);\n\n //******************************************************************\n\n $fechaHora = date('Y-m-d H:i:s');\n $idUsuario = $_SESSION['ID_USUARIO'];\n $consultas = array();\n $consultas[] = \"UPDATE usuario \n SET fechaHoraUltIN = '$fechaHora' \n WHERE idUsuario = $idUsuario\";\n $this->ejecutarTransaccion($consultas);\n return true;\n } else {\n return false;\n }\n }", "private function sesion_iniciada()\n\t{\n\t\t$this->load->library(\"session\");\n\t\tif($this->session->userdata(\"isess\")){\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "public function autenticar($senha){\n //if($senha == $this->senha){\n // return true;\n //} \n return $this->senha == $senha;\n }", "function addstudent(){\n include('../../config.php'); \n $classid = $_GET['classid'];\n $studid = $_GET['studid'];\n $verify = $this->verifystudent($studid,$classid);\n if($verify){\n echo $q = \"INSERT INTO studentsubject (studid,classid) VALUES ('$studid', '$classid');\";\n mysql_query($q);\n header('location:../classstudent.php?r=success&classid='.$classid.'');\n }else{\n header('location:../classstudent.php?r=duplicate&classid='.$classid.'');\n }\n \n $tmp = mysql_query(\"select * from class where id=$classid\");\n $tmp_row = mysql_fetch_array($tmp);\n $tmp_subject = $tmp_row['subject'];\n $tmp_class = $tmp_row['course'].' '.$tmp_row['year'].'-'.$tmp_row['section'];\n \n $tmp = mysql_query(\"select * from student where id=$studid\");\n $tmp_row = mysql_fetch_array($tmp);\n $tmp_student = $tmp_row['fname'].' '.$tmp_row['lname'];\n \n $act = \"add student $tmp_student to class $tmp_class with the subject of $tmp_subject\";\n $this->logs($act);\n }", "public function semesterregi(){\n\t\t$suid=$this->session->userdata('id_user');\n\t\t//print_r($suid);\n\t\t$Stuid=$this->commodel->get_listspfic1(\"student_master\",\"sm_id\",\"sm_userid\",$suid)->sm_id;\n\t\t//print_r($Stuid);\n \t//get current academic year\n \t//$acadyear = $this->user_model->getcurrentAcadYear();\n\t\t$this->appno = $this->commodel->get_listspfic1('student_entry_exit','senex_entexamapplicationno','senex_smid',$Stuid)->senex_entexamapplicationno;\n\t\t$stud_prg_rec = $this->commodel->get_listrow('student_program','sp_smid',$Stuid);\n \t$degree_id = $stud_prg_rec->row()->sp_programid;\n \t$noofsemester = sizeof($stud_prg_rec->result());\n\t\t\n\t\t$cacadyer = $this->user_model->getcurrentAcadYear();\n\t\t//print_r($cacadyer);\n \t$semestertype = $this->user_model->getcurrentSemester();\n \t//print_r($semestertype);\n \t$semesterrec = $this->stumodel->get_semester_no($Stuid,$cacadyer);\n \t$semsize = sizeof($semesterrec);\n\t\t$this->curresem = $semsize;\n\t\t//print_r($semsize);\n\t\t\n \t\n\t\t\n\t\t//student personnel detail\n\t\t$this->name=$this->commodel->get_listspfic1(\"student_master\",\"sm_fname\",\"sm_userid\",$suid)->sm_fname;\n\t\t$this->sturollno = $this->commodel->get_listspfic1('student_entry_exit','senex_rollno','senex_smid',$Stuid)->senex_rollno;\n\t\t$this->mobile=$this->commodel->get_listspfic1('student_master','sm_mobile','sm_id',$Stuid)->sm_mobile;\n\t\t$this->email=$this->commodel->get_listspfic1('student_master','sm_email','sm_id',$Stuid)->sm_email;\n\t\t$this->dob=$this->commodel->get_listspfic1('student_master','sm_dob','sm_id',$Stuid)->sm_dob;\n\t\t$this->uid=$this->commodel->get_listspfic1('student_master','sm_uid','sm_id',$Stuid)->sm_uid;\n\t\t$this->bgroup=$this->commodel->get_listspfic1('student_master','sm_bloodgroup','sm_id',$Stuid)->sm_bloodgroup;\n\t\t$this->gender=$this->commodel->get_listspfic1('student_master','sm_gender','sm_id',$Stuid)->sm_gender;\n\t\t$this->religname=$this->commodel->get_listspfic1('student_master','sm_religion','sm_id',$Stuid)->sm_religion;\n\n\t\t//student parent and course detail\n\t\t$this->mname = $this->commodel->get_listspfic1('student_parent','spar_mothername','spar_smid',$Stuid)->spar_mothername;\t\t\n\t\t$this->fathname=$this->commodel->get_listspfic1('student_parent','spar_fathername','spar_smid',$Stuid)->spar_fathername;\n\t\t\n\t\t$this->sem = $this->commodel->get_listspfic1('student_program','sp_semester','sp_smid',$Stuid)->sp_semester;\n\t\t\n\t\t$this->ncid = $this->commodel->get_listspfic1('student_program','sp_programid','sp_smid',$Stuid)->sp_programid;\n\t\t//get programe name\n\t\t$this->pname = $this->commodel->get_listspfic1('program','prg_name','prg_id',$this->ncid)->prg_name;\n\t\t$this->progid = $this->commodel->get_listspfic1('program','prg_id','prg_name',$this->pname)->prg_id;\n\t\t\n\t\t//get program category name\n\t\t$this->pcatid = $this->commodel->get_listspfic1('student_program','sp_pcategory','sp_smid',$Stuid)->sp_pcategory;\n\t\t$this->pcatname = $this->commodel->get_listspfic1('programcategory','prgcat_name','prgcat_id',$this->pcatid)->prgcat_name;\n\n\t\t//postal address detail\n\t\t$this->padd=$this->commodel->get_listspfic1('student_parent','spar_caddress','spar_smid',$Stuid)->spar_caddress;\n\t\t$this->pcity=$this->commodel->get_listspfic1('student_parent','spar_ccity','spar_smid',$Stuid)->spar_ccity;\n\t\t$this->ppost=$this->commodel->get_listspfic1('student_parent','spar_cpostoffice','spar_smid',$Stuid)->spar_cpostoffice;\n\t\t$this->pdist=$this->commodel->get_listspfic1('student_parent','spar_cdistrict','spar_smid',$Stuid)->spar_cdistrict;\n\t\t$this->pstat=$this->commodel->get_listspfic1('student_parent','spar_cstate','spar_smid',$Stuid)->spar_cstate;\n\t\t$this->ppin=$this->commodel->get_listspfic1('student_parent','spar_cpincode','spar_smid',$Stuid)->spar_cpincode;\n\t\t$this->pcounname=$this->commodel->get_listspfic1('student_parent','spar_ccountry','spar_smid',$Stuid)->spar_ccountry;\n\t\t\n\t\t//get student category\n\t\t$this->cateid=$this->commodel->get_listspfic1('student_master','sm_category','sm_id',$Stuid)->sm_category;\n\t\t$this->catename=$this->commodel->get_listspfic1('category','cat_name','cat_id',$this->cateid)->cat_name;\n\n\t\t//get study center\n\t\t$this->sccode=$this->commodel->get_listspfic1('student_master','sm_sccode','sm_id',$Stuid)->sm_sccode;\n\t\t$this->scname=$this->commodel->get_listspfic1('study_center','sc_name','sc_code',$this->sccode)->sc_name;\n\t\t//get branch name\n\t\t$this->brid=$this->commodel->get_listspfic1('student_program','sp_branch','sp_smid',$Stuid)->sp_branch;\n\t\t$this->brname=$this->commodel->get_listspfic1('program','prg_branch','prg_id',$this->brid)->prg_branch;\n\t\t//get department name\n\t\t$this->depid=$this->commodel->get_listspfic1('student_program','sp_deptid','sp_smid',$Stuid)->sp_deptid;\n\t\t$this->depname=$this->commodel->get_listspfic1('Department','dept_name','dept_id',$this->depid)->dept_name;\n\n\t\t//$sprogid = $this->commodel->get_listspfic1('student_program','sp_id','sp_smid',$Stuid)->sp_id;\n\t\t//print_r($sprogid);\n\n\t\t//$this->db->select('sp_id')->from('student_program')->where('sp_smid',$Stuid)->where('sp_semester',$semsize);\n\t\t//$spstid = $this->db->get()->row();\n\t\t$getspid = array('sp_smid' => $Stuid, 'sp_semester' => $semsize);\n\t \t$spstid = $this->commodel->get_listspficemore('student_program','sp_id',$getspid);\n\t\t\n\t\t//print_r($spstid);\n\t\tforeach($spstid as $stspid){\n\t\t\t$this->cusem = $this->commodel->get_listspfic1('student_program','sp_semester','sp_id',$stspid->sp_id)->sp_semester;\n\t\t\t//print_r($this->cusem);\n\t\t}\n\t\t\t$datawh = array('sp_smid' => $Stuid, 'sp_semester' => $semsize);\n\t \t\t$diffdate = $this->commodel->get_listspficemore('student_program','sp_programid,sp_semregdate',$datawh);\n\t\t\t//print_r($diffdate);\n\t\t\tforeach($diffdate as $spdate):\n\t\t\t\t$semdiffdate = $this->datmodel->diffdays($spdate->sp_semregdate);\n\t\t\t\t$spprgid = $spdate->sp_programid;\n\t\t\tendforeach;\t\n\t\t\t//print_r($semdiffdate);\n\t\t\t$prgpattern=$this->commodel->get_listspfic1('program','prg_pattern','prg_id',$spprgid)->prg_pattern;\n\t\t\t$tmonth = $semdiffdate/30;\n\t\t\t//print_r($this->tdate);\n\t\t\t\n\t\t\t\n\t\t\tif((($tmonth > 5) && ($prgpattern == 'Semester')) || (($tmonth > 11) && ($prgpattern == 'Yearly')))\n\t\t\t{\n\t\n\t\t\t\tif(isset($_POST['register']))\n\t\t\t\t{\t\n\t\t\t\t\t$this->form_validation->set_rules('Ssem','Semseter','trim|xss_clean|required');\n\t\t\t\t\t//Re-populate field\n\t\t\t\t\tif($_POST)\n\t\t\t\t\t{\n\t\t\t\t\t\t//$this->data['Stmobile']=$this->input->get_post('Stmobile');\n\t\t\t\t\t\t$this->data['Ssem']=$this->input->get_post('Ssem');\n\t\t\t\t\t}//re populate if close\t\n\t\t\t\t\t\tif ($this->form_validation->run() == FALSE) {\t\n\t\t\t\t\t\t\t//$message = '<h3>Your some detail is incorrect .</h3>';\n\t \t\t\t\t\t\t//$this->session->set_flashdata('msg',$message);\n\t\t\t\t\t\t\t//redirect('request/registartionsemester');\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\t//update in student_master\n \t \t\t\t\t$this->db->trans_begin();\n\n\t\t\t\t\t\t$cdate = date(\"Y-m-d h:i:sa\");\t\t\t\t\t \t\n\t\t\t \t\t\tif($_POST['Ssem'] != $semsize){\t\t\t\t\n\t\t\t\t\t\t\t//insert program data in student_program\n\t\t\t\t\t\t\t$progdata = array (\n\t\t\t\t\t\t\t\t'sp_smid'\t=>\t$Stuid,\n\t\t\t\t\t\t\t\t'sp_programid'\t=>\t$this->ncid,\n\t\t\t\t\t\t\t\t'sp_deptid'\t=>\t$this->depid,\t\t\n\t\t\t\t\t\t\t\t'sp_sccode'\t=>\t$this->sccode,\n\t\t\t\t\t\t\t\t'sp_pcategory'\t=>\t$this->pcatid,\n\t\t\t\t\t\t\t\t'sp_branch'\t=>\t$this->brid,\n\t\t\t\t\t\t\t\t'sp_acadyear'\t=>\t$cacadyer,\n\t\t\t\t\t\t\t\t'sp_semregdate' =>\t$cdate,\n\t\t\t\t\t\t\t\t'sp_semester'\t=> $_POST['Ssem']\n\t\t\t\t\t\t\t\t); \n\t\t\t \t\t\t\t$this->db->insert('student_program',$progdata);\n\t\t\t \t\t\t\t$sprogramid = $this->db->insert_id();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$message1 = $semsize;\n\t\t\t\t\t\t\t$message = '<h3>You are already register in'.\" \". $semsize .\" \". $prgpattern.'</h3>';\n\t \t\t\t\t\t\t$this->session->set_flashdata('msg',$message);\n\t\t\t\t\t\t\tredirect('request/semesterregi');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//insert smid and spid in student fees\n\t\t\t\t\t\t$feesdata = array (\n\t\t\t\t\t\t\t'sfee_smid'\t=>\t$Stuid,\n\t\t\t\t\t\t\t'sfee_spid'\t=>\t$sprogramid\n\t\t\t\t \t\t\t); \n\t\t\t\t\t\t\t$this->db->insert('student_fees',$feesdata);\n\n\t\t\t\t//make transaction complete\n \t\t\t$this->db->trans_complete();\n\t\t\t\n\t \t\t\t\t//check if transaction status TRUE or FALSE\n \t\t\t\tif ($this->db->trans_status() === FALSE) {\n\t\t\t\n \t\t\t\t//if something went wrong, rollback everything\n \t\t\t\t\t$this->db->trans_rollback();\n\t\t\t\t\t\t$this->logger->write_logmessage(\"update\", \"Student registration not update record in student_master table.\");\n \t\t\t\t$this->logger->write_dblogmessage(\"update\", \"Student registration not update record in student_master table.\");\n\t\t\t\t\t\t$this->load->view('request/registartionsemester');\n\t\t\t\t\t\t//redirect('request/stufeesdetail');\n \t\t\t\t\t//return FALSE;\n \t\t\t\t\t } else {\t\n \t\t\t\t\t//if everything went right, commit the data to the database\n \t\t\t\t\t$this->db->trans_commit();\n\t\t\t \t\t\t$message = '<h3>Your registration successfully done.</h3>';\n\t \t\t\t\t\t$this->session->set_flashdata('msg',$message);\t\t\t\n\t\t\t\t\t\t$this->logger->write_logmessage(\"update\", \"Student registration successfull update record in student_master table\");\n \t\t\t\t$this->logger->write_dblogmessage(\"update\", \"Student registration successfull update record in student_master table\" );\n\t\t\t\t\t\tredirect('request/stufeesdetail');\n \t\t \t\t\t//return TRUE;\n \t\t\t \t\t}\n\t\t\t}//close first else\t\n\t\t\t}//if post close\n\t\t}//close semster difference if\n\t\telse{\n\t\t\t$message = '<h3>You can not register for next semester registration because you can not complete minimum duration.</h3>';\n \t\t\t$this->session->set_flashdata('err_message',$message);\n\t\t\tredirect('studenthome');\n\t\t }\t\n\t\t\n\t$this->load->view('request/registartionsemester');\n\t}", "function login_user($admission) {\n\n$sql = \"SELECT * FROM `students` WHERE `AdminID` = '\".escape($admission).\"'\";\n$result = query($sql);\nif(row_count($result) == 1) {\n\t$row = mysqli_fetch_array($result);\n\n\t$user_password = $row['AdminID'];\n\n\tif($admission == $user_password) {\n\n\t\t$_SESSION['AdminID'] = $admission;\n\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\n\treturn true;\n} else {\n\n\treturn false;\n}\n\n}", "public function stuUserLogin() {\n\t\tif(isset($_POST['txtUName']) && isset($_POST['subDomain'])){\n\t\t\t$schl_query=\"select id from schools where code='\".trim($_POST['subDomain']).\"'\";\n\t\t\t$schl_query_res = mysqli_query($this->connfed, $schl_query);\n\t\t if(mysqli_num_rows($schl_query_res)>0){\n\t\t\t$school_data=mysqli_fetch_assoc($schl_query_res);\n\t\t\t$hash_salt_query=\"select u.id,hashed_password,salt,u.email,batch_id,b.course_id,b.start_date,b.end_date,u.username from users u left join students s on s.user_id = u.id left join batches b on b.id = s.batch_id where u.username='\".trim($_POST['txtUName']).\"' and u.school_id='\".$school_data['id'].\"' and u.admin!=1 and u.employee!=1 and u.student!=0\";\n\t\t\t$hash_salt_res = mysqli_query($this->connfed, $hash_salt_query);\n\t\t\tif(mysqli_num_rows($hash_salt_res)>0){\t\n\t\t\t \t$row=mysqli_fetch_assoc($hash_salt_res);\n\t\t\t\t$hash_pwd = $row['hashed_password'];\n\t\t\t\t$salt = $row['salt'];\n\t\t\t\t$pwd=$salt.$_POST['txtPwd'];\n\t\t\t\t$hash_new_pwd=hash('sha1',$pwd);\n\t\t\t\tif ($hash_pwd==$hash_new_pwd) {\n\t\t\t\t\t $_SESSION['std_id']=$row['id'];\n\t\t\t\t\t $_SESSION['username']=$row['username'];\n\t\t\t\t\t $_SESSION['user_email']=$row['email'];\n\t\t\t\t\t $_SESSION['batch_id']=$row['batch_id'];\n\t\t\t\t\t $_SESSION['start_date']= date(\"Y-m-d\",strtotime($row['start_date']));\n\t\t\t\t\t $_SESSION['end_date'] = date(\"Y-m-d\",strtotime($row['end_date']));\n\t\t\t\t\t $_SESSION['school_id']=$school_data['id'];\n\t\t\t\t\t $_SESSION['course_id']=$row['course_id'];\n\t\t\t\t\t return 1;\n\t\t\t\t}else{\n\t\t\t\t\t $message=\"Paasword does not matched.\";\n\t\t\t\t\t $_SESSION['error_msg'] = $message;\t\n\t\t\t\t\t return 0;\n\t\t\t\t}\n\t\t\t }else{\n\t\t\t \t\t$message=\"Incorrect Username or Password\";\n\t\t\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\t\t\treturn 0;\n\t\t\t }\n\t\t\t}else{\n\t\t\t\t$message=\"Incorrect Username or Password\";\n\t\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}", "function EstoyLogueado()\n\t{\n\t\tif (!isset($_SESSION['clientecod']) || $_SESSION['clientecod']==0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function loginSuperadmin($user, $pass)\n{\n global $db;\n $query = 'SELECT * FROM admin';\n $data = $db->query($query);\n $sukses = 0;\n $row = $data->fetch_assoc();\n foreach ($data as $row) {\n if ($user == $row['user'] && $pass == $row['pass']) {\n $sukses = 1;\n session_start();\n $_SESSION['user'] = $row['nim'];\n $_SESSION['nama'] = $row['nama'];\n $_SESSION['level'] = $row['level'];\n }\n }\n if ($sukses == 1) {\n echo \"<script>\nalert('Berhasil Login');\nwindow.location.href='dashboard/';\n</script>\";\n } else\n echo \"<script>\nalert('Username tidak ada atau password salah');\nwindow.location.href='/historipegawai-bs/';\n</script>\";\n}", "public function getSessId()\n {\n return $this->sess_id;\n }", "function CheckSession(){\n if(isset($_SESSION[\"userSession\"]->id)){\n // VALIDA SI TIENE CREDENCIALES PARA LA URL CONSULTADA\n $_SESSION['userSession']->status= userSessionStatus::nocredencial;\n $_SESSION['userSession']->url = $_POST[\"url\"];\n $urlarr = explode('/', $_SESSION['userSession']->url);\n $myUrl = end($urlarr)==''?'index.html':end($urlarr);\n foreach ($_SESSION['userSession']->eventos as $evento) {\n if(strtolower($myUrl) == strtolower($evento->url)){\n $_SESSION['userSession']->status= userSessionStatus::login;\n break;\n }\n }\n }\n else {\n $this->status= userSessionStatus::invalido;\n $this->url = $_POST[\"url\"];\n $_SESSION[\"userSession\"]= $this;\n }\n }", "public function loginmedewerker($uname, $psw){\n\n $sql = \"SELECT medewerkerscode, gebruikersnaam, wachtwoord FROM medewerkers WHERE gebruikersnaam = :gebruikersnaam\";\n \n //prepare\n $stmt = $this->conn->prepare($sql);\n \n $stmt->execute([\n 'gebruikersnaam' => $uname\n ]);\n \n \n $result = $stmt->fetch(PDO::FETCH_ASSOC);\n print_r($result);\n \n if(is_array($result)){\n \n if(count($result) > 0){\n \n if ($uname == $result['gebruikersnaam'] && password_verify($psw, $result['wachtwoord'])) {\n \n session_start();\n $_SESSION['medewerkerscode'] = $result['id'];\n $_SESSION['uname'] = $result['gebruikersnaam'];\n \n header('location: medewerkers.php');\n \n }\n }else{\n echo 'Failed to login.';\n }\n \n }else{\n echo 'Failed to login. please check youre input and try again.';\n }\n \n }", "public static function verifUserLogueado() {\n if(isset($_SESSION['loggedUser'])) {\n \n if($_SESSION['loggedUser']->getAdmin()==1) {\n $cineDAO = new CineDAO();\n $arrCines = $cineDAO->GetAll($_SESSION['loggedUser']->getId_usuario());\n require_once(VIEWS_PATH.\"navAdmin.php\");\n \n }\n else {\n require_once(VIEWS_PATH.\"nav.php\");\n \n }\n }else {\n require_once(VIEWS_PATH.\"login.php\");\n }\n }", "public function siswa() {\n\n\t\t$uri1 = $this->uri->segment(1);\n\n\t\t$uri2 = $this->uri->segment(2);\n\n\t\t$uri3 = $this->uri->segment(3);\n\n\t\t$uri4 = $this->uri->segment(4);\n\n\n\n\n\n\t\t//var def session\n\n\t\t$a['sess_level'] = $this->session->userdata('admin_level');\n\n\t\t$a['sess_user'] = $this->session->userdata('admin_user');\n\n\t\t$a['sess_konid'] = $this->session->userdata('admin_konid');\n\n\t\t$a['menu'] = $this->menu;\n\n\t\t// $a['link'] = $this->db->query(\"SELECT link FROM rule_users JOIN menu ON rule_users.id_menu = menu.id JOIN level ON rule_users.id_level = level.id WHERE link = '\".$uri1.\"/\".$uri2.\"' AND level = '\".$a['sess_level'].\"' \")->result_array();\n\n\t\t\n\n\n\n\t\t$this->load->view('dashboard/template/header', $a);\n\n\t\t$this->load->view('dashboard/template/navbar', $a);\n\n\t\t$this->load->view('aktivitas/list', $a);\n\n\t\t$this->load->view('dashboard/template/footer', $a);\n\n }", "public function activation($cnestudent)\r\n {\r\n $req=$this->student->changeetat($cnestudent); // change the etat\r\n $this->students(); // show the update list of student\r\n }", "function connexionAdmin($mail, $pass){ \n $usersManager = new \\Project\\Models\\UsersManager();\n $connexionAd = $usersManager->recupInfosConnexion($mail, $pass);\n $result = $connexionAd->fetch();\n\n // Compare les mots de passe entre la BDD et le champ\n $isPasswordCorrect = password_verify($pass, $result['pass']);\n\n \n $_SESSION['pseudo'] = $result['pseudo'];\n $_SESSION['lastname'] = $result['lastname'];\n $_SESSION['firstname'] = $result['firstname'];\n $_SESSION['email'] = $result['email'];\n $_SESSION['pass'] = $result['pass'];\n $_SESSION['id'] = $result['id'];\n $_SESSION['roleusers'] = $result['roleusers'];\n\n if($isPasswordCorrect){\n require 'app/views/back/dashboard.php';\n }else{\n echo 'Vos informations sont incorrectes';\n }\n\n }", "public function login2(){\n $row = $this->_usuarios->getUsuario1(\n $this->getAlphaNum('usuario2'),\n $this->getSql('pass2')\n );\n \n // si no existe la fila.\n if(!$row){\n echo \"Nombre y/o contraseña incorrectos\";\n exit;\n }\n \n //Inicia session y define las variables de session \n Session::set('autenticado', true);\n Session::set('usuario', $row['usuario']);\n Session::set('id_role', $row['role']);\n Session::set('nombre', $row['nombre']);\n Session::set('ape_pat', $row['ape_pat']);\n Session::set('ape_mat', $row['ape_mat']);\n Session::set('clave_cetpro', $row['cetpro']);\n Session::set('id_usuario', $row['id']);\n Session::set('admin', $this->_usuarios->checkAdmin());\n Session::set('tiempo', time());\n \n echo \"ok\";\n }", "protected function examAttributeStudents($id)\n {\n $exam = $this->getDoctrine()->getRepository(\"UnsapaIPWBundle:Exam\")->find($id);\n $promo_users = $this->getDoctrine()->getRepository(\"UnsapaIPWBundle:User\")->findByPromo($exam->getPromo());\n\n $students_id = $this->getRequest()->request->all();\n $selected_users = array();\n foreach($students_id as $student_id)\n {\n $user = $this->getDoctrine()->getRepository(\"UnsapaIPWBundle:User\")->find($student_id);\n if($user->getPromo() != $exam->getPromo())\n throw new AccessDeniedHttpException(\"Vous n'avez pas manipuler cet utilisateur pour cet examen.\");\n\n array_push($selected_users, $user);\n }\n $unselected_users = array_diff($promo_users, $selected_users);\n\n // We delete the corresponding records (students who don't attend anymore to the exam)\n $em = $this->getDoctrine()->getEntityManager();\n foreach($unselected_users as $user)\n {\n $record = $em\n ->createQuery(\"SELECT r FROM UnsapaIPWBundle:Record r WHERE r.exam = :exam AND r.student = :user\")\n ->setParameters(array('exam' => $exam, 'user' =>$user))\n ->setMaxResults(1)\n ->getResult();\n if(count($record) == 1)\n {\n $em->remove($record[0]);\n $em->flush();\n }\n }\n // We add a new record to the users who didn't have one\n foreach($selected_users as $user)\n {\n $record = $em\n ->createQuery(\"SELECT r FROM UnsapaIPWBundle:Record r WHERE r.exam = :exam AND r.student = :user\")\n ->setParameters(array('exam' => $exam, 'user' =>$user))\n ->setMaxResults(1)\n ->getResult();\n if(count($record) == 0)\n {\n $record = new Record();\n $record->setExam($exam);\n $record->setStudent($user);\n $em->persist($record);\n $em->flush();\n }\n }\n }", "function verif_login($login, $passe)\n{\n\n global $connection;\n $sql = \"SELECT * FROM users WHERE mail='$login' AND passe='$passe'\";\n $sth = $connection->prepare($sql);\n $sth->execute();\n\n $resultat = $sth->fetch(PDO::FETCH_OBJ);\n // si le resultat est faux (mot de pass incorrect) on redirige vers la page login.php\n if (!$resultat) {\n header('Location: login.php?message=true');\n exit();\n }\n // redirection sur les pages \n if ($resultat->niv == 1) {\n\n $_SESSION[\"id_user\"] = $resultat->id_user;\n $_SESSION[\"niv\"] = $resultat->niv;\n $_SESSION[\"nom\"] = $resultat->nom;\n $_SESSION[\"prenom\"] = $resultat->prenom;\n\n header('Location: admin.php');\n exit();\n } else {\n\n $_SESSION[\"id_user\"] = $resultat->id_user;\n $_SESSION[\"niv\"] = $resultat->niv;\n $_SESSION[\"nom\"] = $resultat->nom;\n $_SESSION[\"prenom\"] = $resultat->prenom;\n\n header('Location: index.php');\n exit();\n }\n}", "static function definisiSesiju(){\n\t\tif(session_id()==''){\n\t\t\tsession_start();\n\t\t}\n\t\tisset($_SESSION['id']) ? $sesija['id']=$_SESSION['id'] : $sesija['id']=null;\n\t\tisset($_SESSION['kor_ime']) ? $sesija['kor_ime']=$_SESSION['kor_ime'] : $sesija['kor_ime']=null;\n\t\tisset($_SESSION['pravo']) ? $sesija['pravo']=$_SESSION['pravo'] : $sesija['pravo']=null;\n\t\t\n\t\treturn $sesija;\n\t}", "function verificar_login()\n {\n if (!isset($_SESSION['usuario'])) {\n $this->sign_out();\n }\n }", "static public function ctrIngresoUsuario(){\n\t\t\n\t\tif (isset($_POST['user']) && isset($_POST['pass'])) {\n\t\t\tif (preg_match('/^[a-zA-Z-0-9 ]+$/', $_POST['user'])) {\n\t\t\t\tswitch ($_POST['rol']) {\n\t\t\t\t\tcase 'Encargado':\n\t\t\t\t\t\t$answer = adminph\\Attendant::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Propietario':\n\t\t\t\t\t\t$answer = adminph\\Propietary::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Arrendatario':\n\t\t\t\t\t\t$answer = adminph\\Lessee::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$answer = adminph\\User::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$password = $_POST[\"pass\"];\n\t\t\t\tif (is_object($answer)) {\n\t\t\t\t\tif (password_verify($password,$answer->password) ) {\n\t\t\t\t\t\tif ($answer->state == 1) {\n\t\t\t\t\t\t\tif ($_POST['rol'] == 'Otro') {\n\t\t\t\t\t\t\t\tsession(['rank' => $answer->type]);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tsession(['rank' => $_POST['rol']]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsession(['user' => $answer->username]);\n\t\t\t\t\t\t\tsession(['name' => $answer->name]);\n\t\t\t\t\t\t\tsession(['id' => $answer->id]);\n\t\t\t\t\t\t\tsession(['photo' => $answer->photo]);\n\t\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\t= REGISTRAR LOGIN =\n\t\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t\tdate_default_timezone_set('America/Bogota');\n\t\t\t\t\t\t\tsession(['log' => date(\"Y-m-d h:i:s\")]);\n\t\t\t\t\t\t\t$answer->last_log = session('log');\n\t\t\t\t\t\t\tif ($answer->save()) {\n\t\t\t\t\t\t\t\techo ' <script>\n\t\t\t\t\t\t\twindow.location = \"inicio\"; </script> ';\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\techo '<br><div class=\"alert alert-warning\" style=\"text-align: center;\" >Este usuario se encuentra desactivado, por favor contacte al administrador.</div>';\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\techo '<head><style type=\"text/css\" media=\"screen\">body{background:#4a6886;color:#fff;}</style></head><body><div class=\"alert alert-warning\" style=\"text-align: center; font-size: 30px;margin-top:15%\" >Las credenciales ingresadas no son correctas.</div><br><br><div style=\"text-align: center; margin-left: 35%;margin-top:5%; width:30%;background:#E75300; padding: 10px;\"><a href=\"/\"> <span style=\" font-size: 18px; color: #fff\"><b>Volver al inicio</b></span> </a></div></body>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function checker($email,$passe){\n$link=connecter_db();\n$requete=sprintf(\"select * from users where email='%s' and passe = '%s'\",$email,$passe);\n$resultat=mysqli_query($link,$requete) or die(\"Erreur selection de l'utilisateur\");\n $ligne=mysqli_fetch_assoc($resultat);\n \n if(empty($ligne)){\n header(\"location:login.php?cn=no\");\n exit();\n }else{\n\n $_SESSION['email']=$ligne['email'];\n $_SESSION['passe']=$ligne['passe'];\n $_SESSION['nom']=$ligne['nom'];\n\n }\n\n}", "function attendance_can_student_mark($sess, $log = true) {\n global $DB, $USER, $OUTPUT;\n $canmark = false;\n $reason = 'closed';\n $attconfig = get_config('attendance');\n\n if (!empty($attconfig->studentscanmark) && !empty($sess->studentscanmark)) {\n if (empty($attconfig->studentscanmarksessiontime) ||\n (attendance_is_status_availablebeforesession($sess->id)) && time() < $sess->sessdate) {\n $canmark = true;\n $reason = '';\n } else {\n $duration = $sess->duration;\n if (empty($duration)) {\n $duration = $attconfig->studentscanmarksessiontimeend * 60;\n }\n if (!isset($sess->studentsearlyopentime)) {\n // Sanity check just in case not set in this session.\n $sess->studentsearlyopentime = 0;\n }\n if (($sess->sessdate - $sess->studentsearlyopentime) < time() && time() < ($sess->sessdate + $duration)) {\n $canmark = true;\n $reason = '';\n }\n }\n }\n // Check if another student has marked attendance from this IP address recently.\n if ($canmark && !empty($sess->preventsharedip)) {\n if ($sess->preventsharedip == ATTENDANCE_SHAREDIP_MINUTES) {\n $time = time() - ($sess->preventsharediptime * 60);\n $sql = 'sessionid = ? AND studentid <> ? AND timetaken > ? AND ipaddress = ?';\n $params = array($sess->id, $USER->id, $time, getremoteaddr());\n $record = $DB->get_record_select('attendance_log', $sql, $params);\n } else {\n // Assume ATTENDANCE_SHAREDIP_FORCED.\n $sql = 'sessionid = ? AND studentid <> ? AND ipaddress = ?';\n $params = array($sess->id, $USER->id, getremoteaddr());\n $record = $DB->get_record_select('attendance_log', $sql, $params);\n }\n\n if (!empty($record)) {\n $canmark = false;\n $reason = 'preventsharederror';\n if ($log) {\n // Trigger an ip_shared event.\n $attendanceid = $DB->get_field('attendance_sessions', 'attendanceid', array('id' => $record->sessionid));\n $cm = get_coursemodule_from_instance('attendance', $attendanceid);\n $event = \\mod_attendance\\event\\session_ip_shared::create(array(\n 'objectid' => 0,\n 'context' => \\context_module::instance($cm->id),\n 'other' => array(\n 'sessionid' => $record->sessionid,\n 'otheruser' => $record->studentid\n )\n ));\n\n $event->trigger();\n }\n }\n }\n return array($canmark, $reason);\n}", "public function checkUsersSession(){\n\t}", "function visFinnStudenter() { \n $visning = $_GET['visning']; //sjekker hva som er satt til visning \n if ($visning == \"visAlle\") { //vis alle registrerte\n $svar = 'Dette er en liste over alle registrerte brukere på Hibu Alumni:\n <!--Luft-->\n <br /><br />\n <!--Viser alle registrerte-->\n '; //linjeskift for bedre oversikt i kildekoden \n $tilkobling = kobleTil(); //opprett tilkobling til db \n //henter ut alle registrerte sortert på etternavn\n $sql = \"SELECT * FROM tblstudent, tblBrukertype,tblCampus, tblFagomrade \";\n $sql .= \"WHERE sbId = bId AND scId = cId \";\n $sql .= \"AND sfId = fId ORDER BY sEtternavn ASC;\"; \n $resultat = mysql_query($sql, $tilkobling); \n $antall = mysql_num_rows($resultat);\n $svar .= finnBrukere($antall, $resultat); \n mysql_close($tilkobling); //lukker tilkobling til db \n } else if ($visning == \"sokNavn\") { //søk på navn\n $svar = visSkjemaNavn(); \n if (isset($_POST['FINNNAVN']) && $_POST['FINNNAVN'] == \"Søk på navn\") { //søker på navn\n $svar = \"<br />\" . finnVedNavn();\n } //if (isset($_POST['FINNNAVN'])) \n } else { //søk på e-post\n $svar = visSkjemaEpost(); \n if (isset($_POST['FINNMAIL']) && $_POST['FINNMAIL'] == \"Søk på e-post\") { //søker på e-post\n $svar = \"<br />\" . finnVedMail();\n } //if (isset($_POST['FINNMAIL']))\n } //if($visning == \"visAlle\") \n return $svar; \n }", "public function actionView()\n {\n if ( isset( $_SESSION['idContribuyente'] ) ) {\n\n $idInmueble = yii::$app->request->post('id');\n \n $datos = InmueblesConsulta::find()->where(\"id_impuesto=:impuesto\", [\":impuesto\" => $idInmueble])\n ->andwhere(\"inactivo=:inactivo\", [\":inactivo\" => 0])\n ->one();\n $_SESSION['datos'] = $datos;\n\n\n $datosInmueble = InmueblesConsulta::find()->where(\"id_impuesto=:impuesto\", [\":impuesto\" => $idInmueble])\n ->andwhere(\"inactivo=:inactivo\", [\":inactivo\" => 0])\n ->one();\n\n $_SESSION['datosInmueble'] = $datosInmueble; \n\n $datosIRegistros = InmueblesRegistros::find()->where(\"id_impuesto=:impuesto\", [\":impuesto\" => $idInmueble])\n //->andwhere(\"inactivo=:inactivo\", [\":inactivo\" => 0])\n ->all();\n\n $_SESSION['datosIRegistros'] = $datosIRegistros; \n \n $datosHAvaluos = HistoricoAvaluoSearch::find()->where(\"id_impuesto=:impuesto\", [\":impuesto\" => $idInmueble])->asArray()\n ->andwhere(\"inactivo=:inactivo\", [\":inactivo\" => 0])\n ->all(); \n\n $_SESSION['datosHAvaluos'] = $datosHAvaluos; \n\n \n \n if ($datosHAvaluos != null) {\n \n foreach ($datosHAvaluos as $key => $value) {\n \n } \n $añoUltimoAvaluo = explode('-', $value['fecha']);\n $_SESSION['anioAvaluo'] = $añoUltimoAvaluo;\n $_SESSION['datosUAvaluos'] = $value; \n\n if ($datosIRegistros != null) {\n\n foreach ($datosIRegistros as $key => $valueIn) {\n \n } \n \n $añoUltimoRegistro = explode('-', $valueIn['fecha']);\n $_SESSION['anioRegistro'] = $añoUltimoRegistro;\n $_SESSION['datosURegistros'] = $valueIn;\n } else {\n \n $valueIn = new InmueblesRegistrosForm(); \n $_SESSION['datosURegistros'] = $valueIn; \n $_SESSION['anioRegistro'] = null; \n \n //no posee registros de inmueble\n \n } \n \n } else {\n $value = new AvaluoCatastralForm();\n $_SESSION['datosUAvaluos'] = $value; \n // no presenta historico de avaluos\n // buscaremos fecha en inmuebles registros\n if ($datosIRegistros != null) {\n\n foreach ($datosIRegistros as $key => $valueIn) {\n \n } \n $añoUltimoRegistro = explode('-', $registros['fecha']);\n $_SESSION['anioRegistro'] = $añoUltimoRegistro;\n $_SESSION['datosURegistros'] = $valueIn;\n } else {\n $valueIn = new InmueblesRegistrosForm(); \n $_SESSION['datosURegistros'] = $valueIn; \n $_SESSION['anioRegistro'] = null; \n //no posee registros de inmueble\n \n } \n } \n\n \n\n\n $verificarSolicitud = self::verificarSolicitud($datosInmueble['id_impuesto'] , $_SESSION['id']);\n \n\n if($verificarSolicitud == true){\n \n return MensajeController::actionMensaje(923); \n \n }\n\n\n\n return $this->render('view', [\n 'modelInmueble' => $datosInmueble, 'modelHAvaluos' => $value,\n ]);\n } else {\n echo \"No hay Contribuyente!!!...<meta http-equiv='refresh' content='3; \".Url::toRoute(['menu/vertical']).\"'>\";\n }\n }", "function subRecuiterLogin()\n\t{\n\t\t$username = $_POST['user_email'];\n\t\t$password = md5($_POST['password']);\n\t\t$login=$this->db->query(\"select * from `sub_recruiter` where `email`='$username' and `password`='$password' AND `status`='1' \");\n\t\t$rowcount=$login->rowCount($login); \n\t\t$singlRc=$login->fetchAll();\t\t \n\t\tif($rowcount>0)\n\t\t{\n\t\t$fetch_singel=$singlRc[0]; \n\t\t$encripted = base64_encode($fetch_singel['id']);\n echo \"\n <script type=\\\"text/javascript\\\"> \n\t\t window.location='sub-recruiter-dashboard?subrid=$encripted';\n </script>\n \";\t\t\n\t\t}\n\t\telse\n\t\treturn \"<span style='color:red;font-size: 16px;font-weight:600'>User ID or Password is Incorrect</span>\";\t\t\n\t}", "public function asis_sec_gen_candidate(){\n\n\t\tif($this->session->userdata('logged_in')){\n\t\t\t\t\n\t\t\t//collect voting status of the voter\n\t\t$student_id = $this->session->userdata('student_id');\n\n\t\t $vote_status = $this->Evoting_model->vote_status_asis_sec($student_id);\n\t\t \n\t\t if($vote_status){\n\n\t\t \t$data['main_content'] = 'e-voting/cannot_vote';\n\n\t\t\t$this->load->view('e-voting/layout/main', $data);\n\t\t \t\t\n\t\t }else{\n\n\n\t\t$data['title'] = \"Welcome to Neusa E-voting Platform\";\n\n\t\t$data['asis_sec_gen_candidate'] = $this->Evoting_model->asis_sec_gen_candidate();\n\n\n\n\t\t$data['main_content'] = 'e-voting/asis_sec_gen_voting';\n\n\n\t\t$this->load->view('e-voting/layout/main', $data);\n\n\t\t }\t\n\n\n\t\t}else{\n\n\t\t\tredirect('Autharization');\n\n\t\t\t}\n\n\n\n\t}", "public function indexForTeacher()\n {\n if(\\Auth::user()->can('see-grades-for-teacher')){\n $teacherId = \\Auth::user()->id;\n $subjects = Subject::where('teacher_id', \"=\", $teacherId)->get();\n $subjectsIds = array_pluck($subjects, 'id');\n $grades = Grade::whereIn('subject_id', $subjectsIds)->get();\n $users = User::all();\n $students = [];\n foreach($users as $user){\n if($user->hasRole('Student')){\n $students[$user->id] = $user;\n }\n }\n\n\n return view('subject.listTeacher')->withGrades($grades)->withStudents($students);\n\n\n\n }\n }", "function inicie_sesion(){\n return (isset($_SESSION['usuario'])&&$_SESSION['usuario']!=''&&isset($_SESSION['session_key']));\n}", "function usun() {\n\t\t$baza = polacz_z_baza();\n\n\t\tif(!isset($_POST['student_id'])) {\n\t\t\techo \"Błędnie wywołany formularz<br>\";\n\t\t\treturn;\n\t\t}\n\t\t$zapytanie = \"DELETE FROM `studenci` WHERE `id` = \".$_POST['student_id'];\n\t\t$wynik = mysqli_query($baza, $zapytanie);\n\n\t\tif($wynik)\n\t\t\techo \"Student został usunięty z bazy<br>\";\n else \n\t\t\techo \"Błąd podczas próby usunięcia studenta z bazy (\".mysql_error().\")<br>\";\n\n\t\tzakoncz_polaczenie($baza);\n\t}", "function __construct(){\n\t\t parent::__construct();\n\t\t $this->load->helper('url');\n\t\t $this->load->library('session');\n\t\t $this->load->model(\"Seccion_m\", '', TRUE);\n\t\t $this->load->model(\"Articulo_m\", '', TRUE);\n\t\t $this->load->model(\"Lista_desear_m\", '', TRUE);\n\t\t $this->load->model(\"usuario_m\", '', TRUE);\n\t\t $this->load->model(\"deseo_Articulos_m\", '', TRUE);\n\t\t $sesion = $this->session->userdata('usuarioLogueado');\n\t\t if($sesion==\"\"){\n\t\t\t echo \"<script> alert('Necesitas inciar sesión!');\n\t\t\t\t\t\t\t window.location.href = '/iw/index.php/sesion/';\n\t\t\t\t\t\t</script>\"\n\t\t\t ;\n\t\t }\n\t }", "function connecter($id, $nom, $prenom, $adresse, $cp, $ville, $dateEmbauche, $region, $secteur, $statut)\n{\n\t$_SESSION['idVisiteur'] = $id;\n\t$_SESSION['nom'] = $nom;\n\t$_SESSION['prenom'] = $prenom;\n\t$_SESSION['adresse'] = $adresse;\n\t$_SESSION['cp'] = $cp;\n\t$_SESSION['ville'] = $ville;\n\t$_SESSION['embauche'] = $dateEmbauche;\n\t$_SESSION['region'] = $region;\n\t$_SESSION['secteur'] = $secteur;\n\t$_SESSION['statut'] = $statut;\n}", "private function esAdminSoporte() {\n $esAdmin = $this->session->userdata('esAdmin');\n $esSoporte = $this->session->userdata('esSoporte');\n if(empty($esAdmin) && empty($esSoporte)) {\n $this->session->set_flashdata('msgError', 'No puede ingresar a este módulo.');\n redirect(base_url('admin'), '', 'refresh');\n }\n }", "static function salva(){\n if(!CUtente::verificalogin())header('Location: /Progetto/Utente/homepagedef');\n else{\n session_start();\n if($_SERVER['REQUEST_METHOD'] == \"POST\"){\n $nome=$_POST['nome'];\n $descrizione=$_POST['descrizione'];\n if($_POST['accessibilità']=='Privato')$pubblico=false;\n else $pubblico=true;\n $w=new EWatchlist($nome,$descrizione,$pubblico,$_SESSION['utente']->getUsername());\n if(isset($_POST['serie'])){\n if(!empty($_POST['serie'])){\n foreach ($_POST['serie'] as $serie){\n $s=FPersistentManager::load('id',$serie,'FSerieTv');\n $w->AggiungiSerie(clone ($s[0]));\n }\n }\n }\n\n\n\n FPersistentManager::store($w);\n $u=FPersistentManager::load('username',$_SESSION['utente']->getUsername(),'FUtente');\n $_SESSION['utente']=clone($u[0]);\n $_SESSION['watchlist']= $_SESSION['utente']->getWatchlist();\n\n\n header('Location: /Progetto/Utente/user?id='.$_SESSION['utente']->getUsername());\n\n }\n else header('Location: /Progetto/Utente/homepagedef');\n }\n }", "public function display(){\r\n echo \"Unique Row Id: \" . $this->getUnique_studentKey() . \"<br/>\";\r\n echo \"User Id: \" . $this->getStudentUserID() . \"<br/>\";\r\n echo \"Password: \" . $this->getStudentPassword() . \"<br/>\";\r\n echo \"First Name: \" . $this->getFirstName() . \"<br/>\";\r\n echo \"Middle Name: \" . $this->getMiddleName() . \"<br/>\";\r\n echo \"Last Name: \" . $this->getLastName() . \"<br/>\";\r\n echo \"Email: \" . $this->getEmail() . \"<br/>\"; \r\n echo \"School Name: \" . $this->getSchoolName() . \"<br/>\"; \r\n echo \"Grade: \" . $this->getGrade() . \"<br/>\";\r\n echo \"Role: \" . $this->getRole() . \"<br/>\";\r\n }", "public function obtener($antigua,$nueva){\n \n \n session_start();\n //busca en la tabla usuarios los campos donde el nombre sea igual a admin si no encuentra nada devuelve null\n \n $usuario = R::findOne('usuarios', 'alias=?', [\n $_SESSION['nombre']\n ]);\n \n \n //comprueba si la variable password es distinta al campo contraseña almacenado en la base de datos si es asi b octiene el valor=\"no\"\n if ( password_verify($antigua, $usuario->contrasena)) {\n \n \n $actualizar=R::load('usuarios',$usuario->id);\n $actualizar->contrasena = password_hash($nueva, PASSWORD_DEFAULT);\n $actualizar->confirmar_contrasena=password_hash($nueva, PASSWORD_DEFAULT);\n \n \n R::store($actualizar);\n redirect(base_url().\"usuario/Usuarios/accesoget\");\n \n }\n }", "function viewStudentAdvisor( $sessionID, $studentID ) {\r\n\t\tif( $this->userCanViewStudent( $sessionID )) {\r\n\t\t\t$query = \"SELECT ADVISOR FROM X_PNSY_STUDENT WHERE ID = '$studentID'\";\r\n\t\t\t$result = mysql_fetch_assoc(mysql_query($query));\r\n\t\t\textract($result);\r\n\t\t\r\n\t\t\t$query = \"SELECT FIRST_NAME, LAST_NAME, WOOSTER_EMAIL FROM X_PNSY_FACULTY WHERE ID = '$ADVISOR'\";\r\n\t\t\t$result = mysql_fetch_assoc(mysql_query($query));\r\n\t\t\t\r\n\t\t\treturn $result;\r\n\t\t}\r\n\t}", "public function verificaAppartenenza(){\n \n $sess_user=$this->session->get_userdata('LOGGEDIN');\n $this->utente=$sess_user[\"LOGGEDIN\"][\"userid\"];\n if(isset($sess_user[\"LOGGEDIN\"][\"business\"])){\n \n $this->azienda=$sess_user[\"LOGGEDIN\"][\"business\"];\n \n \n }\n \n \n }", "function inscribirEstudiante($estudiante_id,$semestre_id,$dicta_id) {\n //Creamos la evaluacion\n leerClase('Evaluacion');\n $evaluacion = new Evaluacion();\n $evaluacion->estado = Objectbase::STATUS_AC;\n $evaluacion->save();\n \n $this->semestre_id = $semestre_id;\n $this->dicta_id = $dicta_id;\n $this->estudiante_id = $estudiante_id;\n $this->evaluacion_id = $evaluacion->id;\n $this->estado = Objectbase::STATUS_AC;\n $this->save();\n }", "function loguear($usuario) {\n $_SESSION[\"idUser\"] = $usuario[\"id\"];\n }", "public function getIdStudent(){\n\t\treturn $this->idStudent;\n\t}", "public function getAllStudents() {\n try {\n if(BaseController::isLoggedIn() && BaseController::isTeacher()) { \n $user = new UserModel();\n $user->id = BaseController::getUserId();\n $user_data = $user->getUserDataById();\n \n $student = new StudentModel();\n $students = $student->getAllStudents();\n \n $model = array(\n 'user_data' => $user_data,\n 'students' => $students\n );\n BaseController::display(self::$controller . '/students.php', $model);\n } else {\n BaseController::load('user/login.php', array('error_description' => 'Изисква се регистрация.'));\n }\n } catch (Exception $e) {\n BaseController::load('error.php');\n }\n }", "public function students(){\n\t\t$this->verify();\n\t\t$data['title']=\"Students\";\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('students/students', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}", "function verif_utilisateur(){\r\n\tglobal $db;\r\n\tif(isset ($_POST['id_user']) AND ($_POST['pass'])){\r\n\t\t\r\n\techo 'test1';\r\n\t$id_user = htmlspecialchars($_POST['id_user']);\r\n\t$pass = htmlspecialchars($_POST['pass']);\r\n\r\n\t// Hachage du mot de passe\r\n\t$pass_hache=sha1($_POST['pass']);\r\n\r\n\t//verif des identifiant\r\n\t$req=$db->prepare('SELECT id_user, passcri FROM login WHERE id_user=:id_user AND passcri=:passcri');\r\n\t$req->execute(array(\r\n\t'id_user'=>$id_user,\r\n\t'passcri'=>$pass_hache));\r\n\r\n\t$resultat=$req->fetch();\r\n\r\n\tif(!$resultat){\r\n\t\techo 'Mauvais identifiant ou mot de passe !';\r\n\t}\r\n\telse{\r\n\t\t$_SESSION['id_user'] = $resultat['id_user'];\r\n\t\t$_SESSION['pass'] = $resultat['passcri'];\r\n\t\techo 'Vous étes connecté!';\r\n\t}\r\n\theader('Location: login.php');\r\n\treturn $req;\r\n\t}\r\n}", "function add_survey_group_susi_student() {\r\n // get global user object\r\n global $user;\r\n\r\n // protect from unauthorized access\r\n if (!isset($user) or ! isset($_POST['formSurveyAddGroupSusiStudentSubmit']) or ! isset($_POST['formSurveyAddGroupSusiStudent'])) {\r\n if ($_POST['formSurveyAddGroupSusiStudent'] != 'formSurveyAddGroupSusiStudentGroup') {\r\n logout();\r\n die();\r\n }\r\n }\r\n\r\n $session_groups = unserialize($_SESSION['session_groups']);\r\n if ($_POST['formSurveyAddGroupSusiStudentGroup'][0] == '0') {\r\n $session_groups['student'] = get_susi_student_groups();\r\n } else {\r\n $session_groups['student'] = $_POST['formSurveyAddGroupSusiStudentGroup'];\r\n }\r\n\r\n $session_groups['type'] = '';\r\n\r\n $_SESSION['session_groups'] = serialize($session_groups);\r\n\r\n $cookie_key = 'msg';\r\n $cookie_value = 'Вие добавихте анкетната група студенти!';\r\n setcookie($cookie_key, $cookie_value, time() + 1);\r\n header('Location: ' . ROOT_DIR . '?page=survey_edit');\r\n}", "function _genLogin()\n {\n $this->mismatch = false;\n if (isset($_POST['login']) && $this->_verify() == \"\") {\n $this->name_post = $_POST['gebruikersnaam'];\n $this->pass_post = $_POST['wachtwoord'];\n\n $this->_getFromGebruikersDb($this->name_post);\n if ($this->_isMatch()) {\n $_SESSION['ingelogd'] = true;\n //toegevoegd door rens om een gebruikersnaam en rol te krijgen\n $_SESSION['gebruikersnaam'] = $this->name_post;\n $_SESSION['Rol'] = $this->role_db;\n header('location: Login_Redir.php');\n }\n }\n }" ]
[ "0.6609084", "0.64148754", "0.6241234", "0.6176332", "0.6052633", "0.6036743", "0.60316", "0.60267615", "0.6004428", "0.5968749", "0.5895585", "0.58819693", "0.5857283", "0.5826675", "0.58158356", "0.58107597", "0.57889634", "0.5769572", "0.575625", "0.5739057", "0.5724292", "0.57200116", "0.5718549", "0.57026505", "0.56989104", "0.5695093", "0.56928164", "0.56872123", "0.5663123", "0.566291", "0.5659639", "0.5658012", "0.56492364", "0.5636495", "0.5624042", "0.5621952", "0.5617042", "0.56140614", "0.5613795", "0.5598001", "0.55964714", "0.5594837", "0.5591164", "0.557818", "0.55738765", "0.5568836", "0.5568591", "0.5567876", "0.5565663", "0.55611664", "0.55379343", "0.5536521", "0.5535382", "0.5535017", "0.55341566", "0.5531591", "0.55304", "0.552966", "0.5521742", "0.552116", "0.5518308", "0.5514422", "0.5509412", "0.5500067", "0.5499195", "0.5499011", "0.5492522", "0.54871136", "0.54856116", "0.54855853", "0.54818153", "0.5480789", "0.5479468", "0.54735076", "0.54715574", "0.54533607", "0.54513705", "0.54433936", "0.5439797", "0.5427501", "0.54269797", "0.5426443", "0.54252607", "0.5425057", "0.54206157", "0.541476", "0.54132617", "0.5412049", "0.5405095", "0.54041684", "0.5403254", "0.54030895", "0.54001445", "0.5398871", "0.53969836", "0.53964424", "0.5392165", "0.5390216", "0.5389697", "0.53895557", "0.5389425" ]
0.0
-1
Beheerder kan hier de desbetreffende kolom verwijderen waarbij $columnId = id van de kolom
function deleteByColumnId($columnId) { $this->db->where('planningKolomId', $columnId); $this->db->delete('aanwezigheid'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function withdraw($columnId, $userId)\n {\n $this->db->where('gebruikerId', $userId);\n $this->db->where('planningKolomId', $columnId);\n $this->db->delete('aanwezigheid');\n }", "private function DeleteColumn(string $Column){\n return $this->Connection->exec('ALTER TABLE '.$this->TableName.' DROP COLUMN '.$Column.';');\n }", "function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}", "public function deleteMerge($row, $column) {\n\t}", "function settings_modify_matrix_column($data)\n\t{\n\t\tif ($data['matrix_action'] == 'delete')\n\t\t{\n\t\t\t// delete any relationships created by this column\n\t\t\t$this->EE->db->where('parent_col_id', $data['col_id'])\n\t\t\t ->delete('playa_relationships');\n\t\t}\n\t}", "function delete () {\n\t\t$stm = DB::$pdo->prepare(\"delete from `generated_object` where `id`=:id\");\n\t\t$stm->bindParam(':id', $this->id);\n\t\t$stm->execute();\n\t}", "function delete_all($table,$column=\"id\") {\n global $_REQUEST;\n global $lang;\n\n // usun wszsytkei zaznaczone rekordy\n if (! empty($_REQUEST[$this->del])) {\n $del=$_REQUEST[$this->del];\n\n if (is_object(@$this->delete_obj)) {\n $data=$this->deleteCheck($table,$column,$del,$this->delete_obj);\n $del=$data['deleted'];\n }\n\n // lista rekordow do usuniecia\n while (list($id,) = each($del)) {\n if (! empty($id)) {\n $this->delete_one_record($id,$table,$column);\n }\n }\n } else {\n if ($this->show_empty_info==true) {\n print \"<center>\".$lang->delete_empty.\"</center>\";\n }\n }\n return;\n }", "public function deleteColumn( $iColumn )\r\n {\r\n $nColumns = $this->getNumberOfColumns();\r\n if ($iColumn > -1 && $iColumn < $nColumns) {\r\n foreach ($this->data as $iRow => $rowData) {\r\n for ($iCol = $iColumn; $iCol < $nColumns - 1; $iCol++) {\r\n $this->data[$iRow][$iCol] =\r\n $this->data[$iRow][$iCol + 1];\r\n }\r\n unset( $this->data[$iRow][$nColumns - 1] );\r\n }\r\n }\r\n }", "function deleteListM($columnname){\n $sql= \"ALTER TABLE `all_list` DROP $columnname\";\n $result= $this->db->query($sql);\n if(!$result){\n echo \"Unable to Delete Column !\";\n }else{\n echo \"Successfully Deleted !\";\n }\n }", "public function klantVerwijderen($id) {\n $conn = $this->connect();\n // SQL Query voorbereiden en variabelen binden aan de query\n $stmt = $conn->prepare(\"DELETE FROM klant WHERE id_klant = :id\");\n $stmt->bindParam(':id',$id);\n // als query is gelukt, true terugsturen, anders false terugsturen\n if($stmt->execute()){\n return true; \n }else{\n return false;\n }\n \n }", "function deleteData()\n{\n global $myDataGrid;\n $arrKeys = [];\n foreach ($myDataGrid->checkboxes as $strValue) {\n $arrKeys['id'][] = $strValue;\n $arrKeys2['id_absence'][] = $strValue;\n }\n $tblAbsence = new cHrdAbsence();\n $tblAbsenceDetail = new cHrdAbsenceDetail();\n $tblAbsence->deleteMultiple($arrKeys);\n $tblAbsenceDetail->deleteMultiple($arrKeys2);\n writeLog(ACTIVITY_DELETE, MODULE_PAYROLL, implode(\",\", $arrKeys2['id_absence']));\n $myDataGrid->message = $tblAbsence->strMessage;\n}", "public function deleteFromMatrix() {\n DB::statement('DELETE FROM lemma_matrix WHERE lemma1='.$this->id.' OR lemma2='.$this->id);\n }", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "function getColumnCount($columnId)\n {\n $this->db->where('planningKolomId', $columnId);\n $this->db->where('surveillant', 0);\n return $this->db->count_all_results('aanwezigheid'); \n }", "public function delete(){\n \t\ttry{\n \t\t\t$db = DB::get();\n \t\t\t$sql = \"UPDATE t_\" . self::$Table . \" \n \t\t\t\t\tSET \" . self::$Table . \"_supprime='1' \n \t\t\t\t\tWHERE \" . self::$Table . \"_id = '\".$this->Id.\"' \";\n \t\t\n \t\t\t$result = $db->query($sql);\n \t\t}\n \t\tcatch(Exception $e){\n \t\t\tvar_dump($e->getMessage());\n \t\t}\n }", "function removeColumn($columnName) {\n foreach ($this->columns as $key => $column) {\n if ($column->columnName === $columnName) {\n //delete the column\n unset($this->columns[$key]);\n }\n }\n }", "public function removeColumn($column_id)\n {\n return $this->db->table(self::TABLE)->eq('id', $column_id)->remove();\n }", "public function dropColumn()\n\t{\n\n\t}", "public function desenfocarCamaraAlumnos1() {\n\n self::$alumnos1->desenfocar();\n\n }", "protected function _prepareColumns()\n {\n \tparent::_prepareColumns();\n \tunset($this->_columns['actionColumn']);\n }", "public function delete(){\r\n\t\t// goi den phuong thuc delete cua tableMask voi id cua man ghi hien hanh\r\n\t\t$mask = $this->mask();\r\n\t\treturn $mask->delete(array($mask->idField=>$this->id));\r\n\t\t// $query = \"DELETE FROM $this->tableName WHERE id='$this->id'\";\r\n\t\t// $conn = self::getConnect()->prepare($query);\r\n\t}", "public static function removeColumn($col){\n\t\t//\t\t\tarray_slice($db_fields, $col + 1, count($db_fields) -1, true);\n\t\t\t\t\n\t}", "function del($fp_rowId)\n {\n foreach ((array)$fp_rowId as $k => $id) {\n $this->db->or_where('id', $id);\n }\n $this->db->from($this->table);\n $this->db->delete($this->table);\n //dump($this->db->last_query());\n return true;\n }", "function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}", "function newskomentar_deletedata($tbl_newskomentar, $id){\n\t$sql = mysql_query(\"DELETE * FROM $tbl_newskomentar WHERE id = '$id'\");\n\treturn $sql;\n}", "function delete_record($table, $arg, $column_id)\n{\n $ci = & get_instance();\n $db_debug = $ci->db->db_debug;\n $ci->db->db_debug = FALSE;\n $ci->db->where([$column_id => $arg]);\n $ci->db->delete($table);\n if ($ci->db->affected_rows() > 0) {\n return TRUE;\n } else {\n return FALSE;\n }\n $ci->db->db_debug = $db_debug;\n}", "public function actionDeleteColumn($id)\n {\n $model = $this->findModel($id);\n $model->deleted = 1;\n if ( $model->save() ) {\n Yii::$app->getSession()->setFlash('success', 'Quotation deleted');\n } else {\n Yii::$app->getSession()->setFlash('danger', 'Unable to delete Quotation');\n }\n\n return $this->redirect(['index']);\n }", "function cs_pb_column($die = 0){\n\tglobal $cs_node, $count_node, $post;\n\tif ( isset($_POST['action']) ) {\n\t\t$name = $_POST['action'];\n\t\t$counter = $_POST['counter'];\n\t\t$column_element_size = '25';\n\t\t$column_text = '';\n\t}\n\telse {\n\t\t$name = $cs_node->getName();\n\t\t\t$count_node++;\n\t\t\t$column_element_size = $cs_node->column_element_size;\n\t\t\t$column_text = $cs_node->column_text;\n\t\t\t\t$counter = $post->ID.$count_node;\n}\n?> \n\t<div id=\"<?php echo $name.$counter?>_del\" class=\"column parentdelete column_<?php echo $column_element_size?>\" item=\"column\" data=\"<?php echo element_size_data_array_index($column_element_size)?>\" >\n \t<div class=\"column-in\">\n <h5><?php echo ucfirst(str_replace(\"cs_pb_\",\"\",$name))?></h5>\n <input type=\"hidden\" name=\"column_element_size[]\" class=\"item\" value=\"<?php echo $column_element_size?>\" >\n <a href=\"javascript:hide_all('<?php echo $name.$counter?>')\" class=\"options\">Options</a> &nbsp; \n <a href=\"#\" class=\"delete-it btndeleteit\">Del</a> &nbsp; \n <a class=\"decrement\" onclick=\"javascript:decrement(this)\">Dec</a> &nbsp; \n <a class=\"increment\" onclick=\"javascript:increment(this)\">Inc</a>\n\t\t</div>\n \t<div class=\"poped-up\" id=\"<?php echo $name.$counter?>\" style=\"border:none; background:#f8f8f8;\" >\n <div class=\"opt-head\">\n <h5>Edit Column Options</h5>\n <a href=\"javascript:show_all('<?php echo $name.$counter?>')\" class=\"closeit\">&nbsp;</a>\n </div>\n <div class=\"opt-conts\">\n \t<ul class=\"form-elements\">\n <li class=\"to-label\"><label>Column Text</label></li>\n <li class=\"to-field\">\n \t<textarea name=\"column_text[]\"><?php echo $column_text?></textarea>\n <p>Shortcodes and HTML tags allowed.</p>\n </li> \n </ul>\n <ul class=\"form-elements noborder\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n \t<input type=\"hidden\" name=\"cs_orderby[]\" value=\"column\" />\n <input type=\"button\" value=\"Save\" style=\"margin-right:10px;\" onclick=\"javascript:show_all('<?php echo $name.$counter?>')\" />\n </li>\n </ul>\n </div>\n </div>\n </div>\n<?php\n\tif ( $die <> 1 ) die();\n}", "public function deleteRecord()\n { \n $sql = \"DELETE FROM Cubans WHERE Id = :Id\";\n $statement = $this->connect->prepare($sql);\n $statement->bindValue(':Id', $this->id);\n $statement->execute();\n }", "public function excluir(){\r\n return (new Database('atividades'))->delete('id = '.$this->id);\r\n }", "public function NombresColumnas($tabla)\r\n {\r\n\t$this->tabla=$tabla;\r\n\t$Columnas1=mysql_query(\"select * from $this->tabla\", $this->con) or die('no se pudo conectar: ' . mysql_error());\r\n$reg=mysql_fetch_array($Columnas1);\t\r\n$numCols=count($reg);\r\n\r\nfor ($i=0; $i<=$numCols; $i++){\r\n\t\r\n\t\t$this->NombreCol[$i]=mysql_field_name($Columnas1,$i);\t\r\n\t\tif ($this->NombreCol[$i]==\"\"){\r\n\t\t\tunset($this->NombreCol[$i]); \r\n\t\t\t$this->NombreCol = array_values($this->NombreCol);//quito el espacio que ha quedado despues de eliminarse \r\n\t\t}else{\r\n\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n}\r\n\r\n$this->ID=$this->NombreCol[0];\r\n\r\n$numCols=count($this->NombreCol);\r\n$this->NumCols=$numCols;\r\n//print($this->NumCols);\r\n//print_r($this->NombreCol);\r\n\r\n\t\t\r\n\t}", "public function excluir(){\r\n return (new Database('cartao'))->delete('id = '.$this->id);\r\n }", "function delete(){\n\t\t$sql = \"DELETE FROM `layer_points` WHERE `id`='\".addslashes($this->id).\"'\";\n\n\t\t$this->connection->send_query($sql);\n\t}", "public function excluir()\n {\n return (new Database('vagas'))->delete('id = '.$this->id);\n }", "public function borrar_dispositivos($id_pds)\n {\n $sql = \"SELECT * FROM devices_pds WHERE status ='Alta'\n\t\t\t\tAND id_pds ='\".$id_pds.\"'\";\n $resultado = $this->db->query($sql)->result();\n\n foreach ($resultado as $device) {\n /*Insertar en el historico de tienda el estado del dispositivo*/\n $elemento = array(\n 'id_devices_pds' => $device->id_devices_pds,\n 'fecha' => date('Y-m-d H:i:s'),\n 'status' => 'Baja',\n 'motivo' => CIERRE_TIENDA\n );\n // print_r($elemento); echo \"<br>\";\n $this->insert_historico_devicesPDS($elemento);\n }\n\n $sql = \"UPDATE devices_pds SET status ='Baja' WHERE id_pds ='\".$id_pds.\"'\";\n $this->db->query($sql);\n }", "public function column_revoke($item)\n {\n }", "public function NombresColumnasEsp($tabla)\r\n {\r\n\t//echo \"Entrando a nombres \";\r\n\t$Columnas1=mysql_query(\"select * from $tabla\", $this->con) or die('no se pudo conectar: ' . mysql_error());\r\n$reg=mysql_fetch_array($Columnas1);\t\r\n$numCols=count($reg);\r\n\r\nfor ($i=0; $i<=$numCols; $i++){\r\n\t\r\n\t\t$this->NombreCol[$i]=mysql_field_name($Columnas1,$i);\t\r\n\t\tif ($this->NombreCol[$i]==\"\"){\r\n\t\t\tunset($this->NombreCol[$i]); \r\n\t\t\t$this->NombreCol = array_values($this->NombreCol);//quito el espacio que ha quedado despues de eliminarse \r\n\t\t}else{\r\n\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n}\r\n\r\n$this->ID=$this->NombreCol[0];\r\n\r\n$numCols=count($this->NombreCol);\r\n$this->NumCols=$numCols;\r\n//return()\r\n//echo \"Saliendo de nombres \";\r\n//print($this->NumCols);\r\n//print_r($this->NombreCol);\r\n\r\n\t\t\r\n\t}", "abstract public function remove_column($table_name, $column_name);", "function delete_one_record($id=\"\",$table,$column=\"id\") {\n global $lang,$db;\n\n if (empty($id)) return;\n\n $query=\"SELECT $column FROM $table WHERE id=?\";\n $prepared_query=$db->PrepareQuery($query);\n if ($prepared_query) {\n $db->QuerySetText($prepared_query,1,$id);\n $result=$db->ExecuteQuery($prepared_query);\n if ($result!=0) {\n $num_rows=$db->NumberOfRows($result);\n if ($num_rows>0) {\n $column=$db->FetchResult($result,0,\"$column\");\n\n // usun produkt\n $query=\"DELETE FROM $table WHERE id=?\";\n $prepared_query=$db->PrepareQuery($query);\n if ($prepared_query) {\n $db->QuerySetText($prepared_query,1,$id);\n $result=$db->ExecuteQuery($prepared_query);\n if ($result!=0) {\n print \"&nbsp; &nbsp; $column -\".$lang->deleted.\"<br>\";\n } else die ($db->Error());\n } else die ($db->Error());\n } else {\n print $lang->delete_not_found.\" id=$id<BR>\";\n }\n } else die ($db->Error());\n } else die ($db->Error());\n\n return;\n }", "public static function eliminar($idAlumno){\r\n\t\t\t$conexion =new Conexion();\r\n\t\t\t\tif($idAlumno){\r\n\t\t\t\t\t$consulta = $conexion->prepare('DELETE FROM ' . self::TABLA .' WHERE idAlumno = :idAlumno' );\r\n\t\t\t\t\t$consulta->bindParam(':idAlumno', $idAlumno);\r\n\t\t\t\t\t$consulta->execute(); \r\n\t\t\t\t}\r\n\t\t\t$conexion = null; \r\n\t\t}", "public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }", "function rd_user_id_column( $columns ) {\n\t$columns[ 'user_id' ] = 'ID';\n\treturn $columns;\n}", "function delColonyById($id) {\r\n\t\tpwQuery::delete('pw_colonys', 'id=:id', array($id));\r\n\t}", "public function removeColumn($columnName)\r\n {\r\n }", "public function hard_delete(){\n\t\tif($this->data[$this->primary_key]){\n\t\t\treturn $this->db\n\t\t\t\t->where($this->primary_key, $this->data[$this->primary_key])\n\t\t\t\t->delete($this->table);\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function deleteColumn($colNo = 0)\n {\n if ($colNo < 0) {\n return;\n }\n if ($colNo > $this->nCols) {\n return;\n }\n $delEntries = range($colNo, count($this->inputData), $this->nCols);\n foreach ($delEntries as $key) {\n unset($this->inputData[$key]);\n }\n // Reindex array!\n $this->inputData = array_values($this->inputData);\n // Build reduced table\n --$this->nCols;\n $this->childNodes = [];\n $this->append($this->makeTableRows());\n }", "function deleteData()\n{\n global $myDataGrid;\n $arrKeys = [];\n foreach ($myDataGrid->checkboxes as $strValue) {\n $arrKeys['id'][] = $strValue;\n $arrKeys2['id_evaluation'][] = $strValue;\n }\n $tblHrdEvaluationMaster = new cHrdEvaluationMaster();\n $tblHrdEvaluationDetail = new cHrdEvaluationDetail();\n $tblHrdEvaluationMaster->deleteMultiple($arrKeys);\n $tblHrdEvaluationDetail->deleteMultiple($arrKeys2);\n $myDataGrid->message = $tblHrdEvaluationDetail->strMessage;\n}", "function hapusriwayat($id) {\n\tglobal $conn;\n\tmysqli_query($conn, \"DELETE FROM pengguna_memasukkan WHERE id_pengguna='$id'\");\n\t\n\treturn mysqli_affected_rows($conn); \n}", "function borrar_opciones(){\n $tuplas = $this->references(\"opcion\");\n foreach($tuplas as $valor){\n $eliminar=$this->Connection->DB->get_object_by_id(\"opcion\", $valor->id_opcion);\n $eliminar->delete();\n }\n }", "function deleteData()\n{\n global $myDataGrid;\n $arrKeys = [];\n foreach ($myDataGrid->checkboxes as $strValue) {\n $arrKeys['id'][] = $strValue;\n }\n print_r($arrKeys);\n die();\n $dataGaVendor = new cGaVendor();\n $dataGaVendor->deleteMultiple($arrKeys);\n $myDataGrid->message = $dataGaVendor->strMessage;\n}", "public function borrar() {\n $id = $this->input->post(\"id\");\n $this->AdministradorModel->delete($this->tabla, $id);\n }", "public function desenfocarCamaraAlumnos2() {\n\n self::$alumnos2->desenfocar();\n\n }", "public function getAddEditRemoveColumnData($id)\n {\n // if ($request->ajax()) {\n // $model = Warehouse_order::with('customers_warehouse','sub_service.remarks');\n // // ->select('customers_warehouse.*','sub_service.*','sub_service.remarks.*');\n\n // return DataTables::eloquent($model)\n // ->addColumn('customers_warehouse', function (Warehouse_order $Warehouse_order) {\n // return $Warehouse_order->customers_warehouse->name;\n // })\n // ->toJson();\n // }\n\n $results = null;\n $Authorized = Auth::User()->roles;\n $userId = Auth::User()->id;\n\n foreach ($Authorized as $checkaccess) {\n # code...\n $results[] = $checkaccess->name;\n }\n \n // return redirect()->route('warehouse.static', $this->jagal_squad->session()->get('id'));\n $id_auto = 1;\n $alert_customers = Customer::with('cstatusid')->where('flag',0)->get();\n $alert_items = Item::where('flag',0)->get();\n $data_customer_transport_sys_alerts = Vendor_item_transports::with('vendors',\n 'city_show_it_origin','city_show_it_destination')->where('flag', 0)->get();\n // $warehouseTolist = Warehouse_order::with('warehouse_o_status','customers_warehouse','sub_service.remarks','sub_service.item','users')\n // ->whereIn('company_branch_id', [$company_branch_with_role_branch])\n // ->orderBy('updated_at', 'DESC')->get();\n $warehouseTolist = $this->Apiopentransaction->getOpenWarehouseWithBranchId($userId);\n \n $trashlist = Warehouse_order::with('customers_warehouse','sub_service.remarks')\n ->onlyTrashed()\n ->get();\n $prefix = Company_branchs::branchwarehouse($this->jagal_squad->session()->get('id'))->first();\n $data_item_alert_sys_allows0 = Customer_item_transports::with('customers',\n 'city_show_it_origin','city_show_it_destination')->where('flag', 0)->get();\n\n $fetch_izzy = dbcheck::where('check_is','=','api_izzy')->get();\n\n foreach ($fetch_izzy as $value) {\n # code...\n $fetchArrays[] = $value->check_is;\n } \n \n if(isset($fetchArrays) != null){\n\n $operations_api_izzy_is_true_v1 = dbcheck::where('check_is','=','api_izzy')->get();\n \n foreach ($operations_api_izzy_is_true_v1 as $operationz) {\n # code...\n $fetchArray1 = $operationz->operation;\n } \n \n $operations_api_izzy_is_true_v2 = dbcheck::where('check_is','=','api_accurate')->get();\n \n foreach ($operations_api_izzy_is_true_v2 as $operations) {\n # code...\n $fetchArray2 = $operations->operation;\n } \n \n } \n\n return $this->datatabl->render('admin.warehouse.warehouse_orderlist')\n ->with(\n [\n 'menu'=> \"Warehouse Order List\",\n 'trashlist' => $trashlist,\n 'some' => $id,\n 'apis' => $results,\n 'alert_customers'=> $alert_customers,\n 'choosen_user_with_branch' => $id,\n 'system_alert_item_customer' => $data_item_alert_sys_allows0,\n 'system_alert_item_vendor' => $data_customer_transport_sys_alerts,\n 'alert_items'=> $alert_items\n ]\n )\n ;\n \n // return DataTables::of($wareouses)\n // ->addColumn('action', function ($wareouses) {\n // return '<a href=\"#edit-'.$wareouses->id.'\" class=\"btn btn-xs btn-primary\"><i class=\"glyphicon glyphicon-edit\"></i> Edit</a>';\n // })\n // ->editColumn('id', 'ID: {{$id}}')\n // ->removeColumn('password')\n // ->make(true);\n }", "public function isVerwijderd( )\r\n {\r\n return false;\r\n }", "public function eliminar($valor=null, $columna=null){\n\n\t\t//error_reporting (0);\n\t\t$active = 0;\n\n\t\t//eleimna de la tabla los elementos, si es null nos pone id\n\t\t//$query = \"DELETE FROM \". static ::$table .\" WHERE \".(is_null($columna)?\"id\":$columna).\" = ':p'\";\n\t\t$query = \"DELETE FROM \". static ::$table .\" WHERE \".(is_null($columna)?\"id\":$columna).\" = '\".$this->id.\"'\";\n\t\t//echo $query.\"<br/>\";\n\n\t\tself::getConexion();\n\t\t//Prepara la conexión\n\t\t$res = self::$cnx->prepare($query);\n\t\t//Agregamos los parametros\n\t\t//Si el valor es diferente de nulo, loa agrega como parametro, en caso contraro de que no existiera el valor\n\t\t//simplemente le ponemos el valor del id del modelo o del registro que se haya puesto \n\t\t\n\t\t//echo \"id: \".$this->id;\n\t\t\n\t\tif(!is_null($valor)){\n $res->bindParam(\":p\",$active, $valor);\n \n }else{\n $res->bindParam(\":p\",$active,(is_null($this->id)?null:$this->id));\n \t//error_reporting (0);\n }//if\n\n\t\t//ejecutar al final \n\t\tif($res->execute()){\n\t\t\t//si ejecuta el query al final desconecta y retorna true\n\t\t\tself::getDesconectar();\n\t\t\treturn true;\n\t\t}else{\n\t\t\t//si no ejecuta el query nos retorna false\n\t\t\treturn false;\n\t\t}\n\n\t}", "public function delete($tableId, $columnId, $optParams = array())\n {\n $params = array('tableId' => $tableId, 'columnId' => $columnId);\n $params = array_merge($params, $optParams);\n return $this->call('delete', array($params));\n }", "public function afterDelete(){\r\n\t\t//$sql = 'DELETE FROM {{apartment_comments}} WHERE email=\"'.$this->email.'\"';\r\n\t\t//Yii::app()->db->createCommand($sql)->execute();\r\n\r\n\t\t$sql = 'SELECT id FROM {{booking}} WHERE user_id=\"'.$this->id.'\"';\r\n\t\t$bookings = Yii::app()->db->createCommand($sql)->queryColumn();\r\n\t\t\r\n\t\tif($bookings){\r\n\t\t\t$sql = 'DELETE FROM {{payments}} WHERE order_id IN ('.implode(',', $bookings).')';\r\n\t\t\tYii::app()->db->createCommand($sql)->execute();\r\n\t\t}\r\n\r\n\t\t$sql = 'DELETE FROM {{booking}} WHERE user_id=\"'.$this->id.'\"';\r\n\t\tYii::app()->db->createCommand($sql)->execute();\r\n\r\n\t\t$sql = 'UPDATE {{apartment}} SET owner_id=1, owner_active=:active, active=:inactive WHERE owner_id=:userId';\r\n\t\tYii::app()->db->createCommand($sql)->execute(array(\r\n\t\t\t':active' => Apartment::STATUS_ACTIVE,\r\n\t\t\t':inactive' => Apartment::STATUS_INACTIVE,\r\n\t\t\t':userId' => $this->id,\r\n\t\t));\r\n\r\n\t\treturn parent::afterDelete();\r\n\t}", "public function getDeletedByColumn()\n {\n return Track::DELETED_BY;\n }", "public function deleteGalleryColumn()\n {\n $item = new \\stdClass();\n $item->id = $this->id;\n $item->gallery = '';\n return $this->db->updateObject('#__k2_items', $item, 'id');\n }", "public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }", "public function afterDelete()\n {\n \\PProject::model()->updateAll([\n 'artist_id' => new \\CDbExpression('NULL')\n ], 'artist_id = :artist_id', [\n ':artist_id' => $this->id\n ]);\n }", "public function eliminarItemsVentas($id_unico){\n //echo($id_unico.\"---\");\n \n date_default_timezone_set('America/La_Paz');\n $fecha_actual = date(\"y-m-d H:i:s\");\n $datos['vent_prof_det_usr_baja'] = $_SESSION['login'];\n $datos['vent_prof_det_fech_hr_baja'] = $fecha_actual;\n $condicion = \"vent_prof_det_cod_unico='\".$id_unico.\"'\";\n return $this->mysql->update('vent_prof_det', $datos, $condicion);\n //$this->mysql->update('vent_prof_cab',$datos,'vent_prof_cab_cod_unico='.$id_unico.'');\n }", "final public function delete() {\n $db = Database::getInstance();\n $mysqli = $db->getConnection();\n\t\n $sql_query = 'DELETE FROM fresco_costing_component_array WHERE component_id ='.$this->_component_id;\n \n $result = $mysqli->query($sql_query);\n if (!$result) {\n trigger_error('Unable to delete from database : SQL query : ' . $sql_query);\n }\n\treturn;\n }", "public function afterDeleteCommit(): void\n {\n }", "public function delete(int $id): void{\r\n \r\n $maRequete = $this->pdo->prepare(\"DELETE FROM {$this->table} WHERE id =:id\");\r\n\r\n $maRequete->execute(['id' => $id]);\r\n\r\n\r\n}", "function hapus($id){\n \tglobal $conn;\n \tmysqli_query($conn, \"DELETE FROM pengunjung WHERE id_pengunjung = $id\");\n \treturn mysqli_affected_rows($conn);\n }", "public function confirmDelete( )\r\n {\r\n throw new KVDdom_RedactieException( 'Kan het verwijderen niet bevestigen van een object dat niet verwijderd is.' );\r\n }", "public function eliminarPlanmatest($pla_id, $per_id, $bloque, $hora, $pes_usuario_modifica, $pes_estado, $pes_fecha_modificacion) {\n\n $con = \\Yii::$app->db_academico;\n\n if ($trans !== null) {\n $trans = null; // si existe la transacción entonces no se crea una\n } else {\n $trans = $con->beginTransaction(); // si no existe la transacción entonces se crea una\n }\n if (!empty($bloque) && !empty($hora)) {\n $modificar = \"pes_mat_b\" . $bloque . \"_h\" . $hora . \"_cod = null,\n pes_mod_b\" . $bloque . \"_h\" . $hora . \" = null,\n pes_mat_b\" . $bloque . \"_h\" . $hora . \"_nombre = null,\";\n }\n $este = \"UPDATE db_academico.planificacion_estudiante\t\t \n SET\n $modificar\n pes_usuario_modifica = $pes_usuario_modifica,\n pes_fecha_modificacion = $pes_fecha_modificacion \n WHERE \n pes_estado= 1 AND pla_id = $pla_id AND per_id = $per_id\";\n try {\n $comando = $con->createCommand\n (\"UPDATE \" . $con->dbname . \".planificacion_estudiante\t\t \n SET\n $modificar\n pes_usuario_modifica = :pes_usuario_modifica,\n pes_fecha_modificacion = :pes_fecha_modificacion \n WHERE \n pes_estado= :pes_estado AND pla_id = :pla_id AND per_id = :per_id\");\n $comando->bindParam(\":pla_id\", $pla_id, \\PDO::PARAM_INT);\n $comando->bindParam(\":per_id\", $per_id, \\PDO::PARAM_INT);\n $comando->bindParam(\":pes_usuario_modifica\", $pes_usuario_modifica, \\PDO::PARAM_INT);\n $comando->bindParam(\":pes_fecha_modificacion\", $pes_fecha_modificacion, \\PDO::PARAM_STR);\n $comando->bindParam(\":pes_estado\", $pes_estado, \\PDO::PARAM_STR);\n $response = $comando->execute();\n if ($trans !== null)\n $trans->commit();\n return $response;\n } catch (Exception $ex) {\n if ($trans !== null)\n $trans->rollback();\n return FALSE;\n }\n }", "public function eliminarVentas($id_unico){\n //echo($id_unico);\n date_default_timezone_set('America/La_Paz');\n $fecha_actual = date(\"y-m-d H:i:s\");\n $datos['vent_prof_cab_usr_baja'] = $_SESSION['login'];\n $datos['vent_prof_cab_fech_hr_baja'] = $fecha_actual;\n $condicion = \"vent_prof_cab_cod_unico='\".$id_unico.\"'\";\n return $this->mysql->update('vent_prof_cab', $datos, $condicion);\n //$this->mysql->update('vent_prof_cab',$datos,'vent_prof_cab_cod_unico='.$id_unico.'');\n }", "public function forceDelete(User $user, KitchenExportColumn $kitchenExportColumn) {\n\t\t//\n\t}", "function deleteData()\n{\n global $myDataGrid;\n $arrKeys = [];\n foreach ($myDataGrid->checkboxes as $strValue) {\n $arrKeys['id_adm_userlog'][] = $strValue;\n }\n $dataUserLog = new cAdmUserLog();\n $dataUserLog->deleteMultiple($arrKeys);\n $myDataGrid->message = $dataUserLog->strMessage;\n}", "public function deleteData(){\n //buatlah query\n $sqlQuery = \"DELETE FROM \" . $this->t_name . \" WHERE id = ?\";\n\n //persiapkan stmt\n $stmt = $this->conn->prepare($sqlQuery);\n\n //cukup converte id\n $this->id=htmlspecialchars(strip_tags($this->id));\n\n //bind\n $stmt->bindParam(1,$this->id);\n\n //eksekusi\n if($stmt->execute()){\n return true;\n }\n return false;\n }", "function supprimerTypeChambre ($connexion, $id) {\r\n\r\n $req = \"DELETE FROM TypeChambre WHERE id=?\";\r\n $stmt = $connexion -> prepare ($req);\r\n $ok = $stmt -> execute (array ($id));\r\n return $ok;\r\n\r\n }", "public function onDelete() : void\n {\n parent::onDelete();\n $this->setRef('from__company_id__to__table__companies__columns__id', null, 'products');\n }", "function yy_r37(){ $this->_retvalue = new SQL\\AlterTable\\DropColumn($this->yystack[$this->yyidx + 0]->minor); }", "public function vymaz(){\r\n $db = napoj_db();\r\n $sql =<<<EOF\r\n DELETE FROM Diskusie WHERE id = \"$this->ID\";\r\nEOF;\r\n $ret = $db->exec($sql);\r\n if(!$ret){\r\n echo $db->lastErrorMsg();\r\n }\r\n $db->close();\r\n }", "private function allColumns($newElement, $oldElement)\n {\n\n foreach (get_object_vars($newElement) as $key => $newValue){\n\n if(!property_exists($oldElement,$key)){\n $this->report->diff()->$key[$oldElement->{$this->primaryKey}] = ['null' => $newValue];\n\n continue;\n }\n\n if($newValue != $oldElement->$key)\n $this->report->diff()->$key[$oldElement->{$this->primaryKey}] = [$oldElement->$key => $newValue];\n }\n }", "public function deleteBo($id) {\n\n $this->getDb()->delete('commande', array('id' => $id));\n }", "public function hapusdata($id)\n\t{\n\t\t$this->db->where('id_015', $id);\n\t\treturn $this->db->delete('tabel_b');\n\n\t}", "function delete($table, $pk, $column = 'id')\n\t{\n\t\tif($statement = $this->query(\"DELETE FROM `$table` WHERE `$column` = ?\", $pk))\n\t\t{\n\t\t\treturn $statement->rowCount();\n\t\t}\n\t}", "public function drop_siswa_toTO($idKey)\n\t{\n\t\t$this->db->where('id',$idKey);\n\t\t$this->db->delete('tb_hakakses-to');\n\t}", "public function findDeleted($id, $columns = ['*'], $skipPresenter = false);", "public function delete() {\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query = $this->connection->query(\"DELETE FROM {$this->table} WHERE \".self::$primaryKey[$this->table].\"='{$this->originalData[self::$primaryKey[$this->table]]}'\");\n\t\t\t$query = $this->connection->query(\"ALTER TABLE $this->table AUTO_INCREMENT = 1\");\n\t\t\t$this->originalData = array();\n\t\t}\t\n\t\telse \n\t\t\tthrow new Exception('You are trying to delete an inexistent row');\n\t}", "public function crudRemoveCol($columns) {\r\n $this->colsRemove = $columns;\r\n return $this;\r\n }", "public function removeColumn($aField) {\r\n foreach ($this -> mCols as $key => $col) {\r\n if ($key == $aField) {\r\n unset($this -> mCols[$key]);\r\n }\r\n }\r\n }", "public function destroy($id)\n {\n $dataColumn = $this->dataColumnRepository->findWithoutFail($id);\n\n if (empty($dataColumn)) {\n Flash::error('Data Column not found');\n\n return redirect(route('admin.dataColumns.index'));\n }\n\n $this->dataColumnRepository->delete($id);\n\n Flash::success('Data Column deleted successfully.');\n\n return redirect(route('admin.dataColumns.index'));\n }", "public function deleteFromDB($table_name,$id_column,$id_value)\n\t{\n\t\t$delete_sql = \"DELETE FROM \".$table_name.\" WHERE \".$id_column.\"=:id_value\";\n\n\t\treturn $this->performDBUpdate($delete_sql,['id_value'=>$id_value]);\n\t}", "public function delete(int $id): void\r\n{\r\n \r\n\r\n $maRequete = $this->pdo->prepare(\"DELETE FROM {$this->table} WHERE id =:id\");\r\n\r\n $maRequete->execute(['id' => $id]);\r\n}", "function BorrarMaterial($id){\n $sql=\"DELETE FROM material_entregado WHERE empleado=\".$id;\n $borrar=$this->realizarConsulta($sql);\n if ($borrar=!NULL) {\n return true;\n }else {\n return false;\n }\n }", "function kt_invoices_columns_add($columns) {\n\tunset($columns['date']);\n\t// unset($columns['package']);\n\tunset($columns['price']);\n\tunset($columns['payment_option']);\n\tunset($columns['title']);\n\t$columns['user'] \t\t= pll__('User','docdirect_core');\n\t$columns['package'] \t\t\t= pll__('Package','docdirect_core');\n\t$columns['payment_option'] \t\t= pll__('Payment Method','docdirect_core');\n\t$columns['price'] \t\t= pll__('Price','docdirect_core');\n \n\t\treturn $columns;\n}", "function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\n\t\t\n\t}", "private function byColumns($newElement, $oldElement)\n {\n\n foreach ($this->columns as $baseColumn => $mergeColumn){\n\n if(!property_exists($oldElement,$baseColumn)){\n\n $this->report->diff()->$baseColumn[$oldElement->{$this->primaryKey}] = ['null' => $newElement->$mergeColumn];\n\n continue;\n }\n\n if($newElement->$mergeColumn != $oldElement->$baseColumn){\n\n $this->report->diff()->$baseColumn[$oldElement->{$this->primaryKey}] = [$oldElement->$baseColumn => $newElement->$mergeColumn];\n }\n\n }\n }", "public static function ver($idAlumno){\r\n\t \t$conexion = new Conexion();\r\n\t\t\t\tif($idAlumno){\r\n\t\t\t\t\t$consulta = $conexion->prepare('SELECT * FROM ' . self::TABLA.' WHERE idAlumno = :idAlumno');\r\n\t\t\t\t\t$consulta->bindParam(':idAlumno', $idAlumno); \r\n\t\t\t\t\t$consulta->execute();\r\n\t\t\t\t\t$registro = $consulta->fetch();\r\n\t\t\t\t\tif($registro){\r\n\t\t\t\t\t\treturn $registro;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t$conexion = null; \r\n\t\t}", "public static function clear($uuid, $column = null) {\n\t\tif(is_null($column) || $column == 'id') {\n\t\t\tif(static::has($uuid))\n\t\t\t\tunset(static::$cache[$uuid]);\n\t\t} else if(isset(static::$mapping[$column][$uuid]))\n\t\t\tstatic::clear(static::$mapping[$column][$uuid]);\n\t}", "public function borrarAlumnaController()\n\t\t{\n\t\t\tif(isset($_GET['idBorrar']))\n\t\t\t{\n\t\t\t\t$datosController = $_GET['idBorrar'];\n\t\t\t\t$respuesta = Datos::borrarAlumnaModel($datosController,'alumna');\n\n\t\t\t\tif($respuesta == \"success\")\n\t\t\t\t{\n\t\t\t\t\techo\"<script>\n\t\t\t\t\t\t\twindow.location = 'index.php?action=alumnas';\n\t\t\t\t\t\t</script>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function hapusjabatan($id) {\n\t\t$this->db->where('ID_JBT', $id);\n\t\t$this->db->delete('IKD.IKD_D_JABATAN_STRUKTURAL'); \t\t\n }", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "function delete($bd,$where){\nforeach ($where as $key => $value) {\n\t$campo = $key;\n\t$value_campo = $value;\n}\n$sql = \"DELETE FROM \".$bd.\"\nWHERE \".$campo.\" = \".$value_campo.\"\";\n$conexion = new ConexionOther();\n$stmt= $conexion->prepare($sql);\n$dato = $stmt->execute();\n$stmt = null;\nreturn $dato;\n}", "function delete() {\n \tglobal $mysql;\n \tif(empty($this->id)) return;\n \t$tablename = $this->class_name();\n \t$id = $this->id;\n \t$query = \"DELETE FROM $tablename WHERE id=$id\";\n \t$mysql->update($query);\n }", "function delete(){\n // Delete subclauses\n foreach($this->subClause as $clause){\n $clause->delete();\n }\n \n mysql_query(\"DELETE FROM resolution WHERE id='$this->clauseId'\") or die(mysql_error());\n }" ]
[ "0.6653683", "0.59138584", "0.57321835", "0.57287085", "0.56800467", "0.5679142", "0.5659805", "0.5614969", "0.554716", "0.55308163", "0.5526045", "0.550642", "0.54734826", "0.5453377", "0.5448131", "0.5414671", "0.5398385", "0.539816", "0.5395479", "0.53720653", "0.53634214", "0.5325787", "0.5319517", "0.52918047", "0.5275701", "0.52704555", "0.5263389", "0.5251954", "0.52487147", "0.5236688", "0.5235484", "0.52315086", "0.52236974", "0.52217036", "0.520575", "0.5194463", "0.5193298", "0.5187103", "0.51817155", "0.5178927", "0.5176992", "0.517683", "0.5170678", "0.5168204", "0.5162454", "0.5153897", "0.51415116", "0.5139313", "0.5137587", "0.51312417", "0.5129143", "0.51201636", "0.51189053", "0.5110874", "0.51039934", "0.5099962", "0.50989395", "0.5084165", "0.50788325", "0.50748676", "0.50686574", "0.5066187", "0.5043715", "0.5042527", "0.5042427", "0.504135", "0.50378466", "0.5033911", "0.50338745", "0.5031029", "0.50286543", "0.5023404", "0.5022079", "0.5020379", "0.50168777", "0.50052136", "0.49936128", "0.49917018", "0.49888647", "0.49882212", "0.4983469", "0.49682805", "0.49680474", "0.4966796", "0.4965031", "0.49641824", "0.49632522", "0.4951493", "0.49506903", "0.4948534", "0.49452758", "0.49441895", "0.49424937", "0.4940947", "0.4937899", "0.49346823", "0.49327245", "0.49272344", "0.49250636", "0.49239692" ]
0.71187615
0
Beheerder kan een aanwezigheid toevoegen
function insert($presence) { $this->db->insert('aanwezigheid', $presence); return $this->db->insert_id(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cargar_registro_venta_id($id) {\n return true;\n }", "public function afmelden()\n {\n return true;\n }", "public function actionAdd($id)//wyświetlanie\n {\n $query = Dish::find()->where(['id_dania' => $id])->one();\n //nie ma takiego\n if(!$query)\n { \n \\Yii::$app->getSession()->setFlash('warning', 'Nie ma takiego dania');\n return $this->goBack('index');\n }\n \n $koszyk = Yii::$app->session->get('zamowione');\n $jest=false; \n\n if (is_array($koszyk)) {\n foreach ($koszyk as $key => $pozycja) {\n if ($pozycja['id'] == $id) {\n $jest=1;\n $koszyk[$key]['ilosc']++;\n }\n \n }}\n if(!$jest)\n {\n $koszyk[]=['id' => $id, 'nazwa' => $query->nazwa_dania,'porcja'=>'mała' , 'cena'=>$query->koszt_dania,'ilosc' => 1];\n }\n Yii::$app->session->set('zamowione',$koszyk);\n \n return $this->render('index', ['settings' => $koszyk]);\n }", "private function klantGebruikerToevoegenAction()\n {\n //controlleert of er een formulier is ingevuld\n if (isset($_POST) && !empty($_POST))\n {\n //kijkt of de gebruikersnaam al bestaat en geeft dan een boolean terug\n $bestaatGN = $this->model->bestaatGN();\n //false als de gebruikersnaam niet bestaat\n if ($bestaatGN === FALSE)\n {\n //controleert of de wachtwoorden overeenkomen\n if ($_POST['wachtwoord'] === $_POST['wachtwoord2'])\n {\n $this->model->maakKlantGebruiker();\n //stuurt je naar de gebruikersbeheer pagina\n $this->model->foutGoedMelding('success', '<strong>Gelukt!</strong> klant gebruiker is aangemaakt. <span class=\"glyphicon glyphicon-saved\"></span>');\n $this->model->setLog('Klang gebruiker aanmaken', 1);\n $this->forward('gebruikersBeheer', 'admin');\n } else\n {\n $this->view->set('opmerking', 'Wachtwoorden komen niet overeen');\n }\n } else\n {\n $this->view->set('opmerking', 'Gebruikersnaam is al in gebruik');\n }\n }\n $klanten = $this->model->geefKlanten();\n $this->view->set('klanten', $klanten);\n }", "public function testid() {\n $tiempo = new TiempoFalso();\n $tarjeta = new Tarjeta( $tiempo );\n $colectivo = new Colectivo(NULL, NULL, NULL);\n\t$id=$tarjeta->obtenerID();\n $boleto = new Boleto(NULL, NULL, $tarjeta, $tarjeta->obtenerID(),NULL, NULL, NULL, NULL, $tiempo);\n\n $this->assertEquals($boleto->obteneriID(), $id);\n }", "public function id_tarjeta();", "private function gebruikerToevoegenAction()\n {\n //controlleert of er een formulier is ingevuld\n if (isset($_POST) && !empty($_POST))\n {\n //kijkt of de gebruikersnaam al bestaat en geeft dan een boolean terug\n $bestaatGN = $this->model->bestaatGN();\n //false als de gebruikersnaam niet bestaat\n if ($bestaatGN === FALSE)\n {\n //controleert of de wachtwoorden overeenkomen\n if ($_POST['wachtwoord'] === $_POST['wachtwoord2'])\n {\n $id = $this->model->maakGebruiker();\n if (isset($_FILES['foto']))\n {\n $this->model->updateFoto($id);\n }\n //stuurt je naar de gebruikersbeheer pagina\n $this->model->foutGoedMelding('success', '<strong>Gelukt!</strong> gebruiker is aangemaakt. <span class=\"glyphicon glyphicon-saved\"></span>');\n $this->model->setLog('Gebruiker toevoegen', 'Gelukt');\n $this->forward('gebruikersBeheer', 'admin');\n } else\n {\n $this->view->set('opmerking', 'Wachtwoorden komen niet overeen');\n }\n } else\n {\n $this->view->set('opmerking', 'Gebruikersnaam is al in gebruik');\n }\n }\n }", "public function lidToevoegen() {\n if (!$this->authex->loggedIn()) {\n redirect('home/login');\n }\n\n $data['title'] = 'Lid toevoegen';\n $data['auteur'] = 'Stefanie Seker';\n $data['lid'] = $this->getEmptyPersoon();\n $data['user'] = $this->authex->getUserInfo();\n\n $partials = array('header' => 'main_header', 'content' => 'lid_toevoegen', 'menu' => 'main_menu');\n $this->template->load('main_master', $partials, $data);\n }", "public function beheerderToevoegen() {\n if (!$this->authex->loggedIn()) {\n redirect('home/login');\n }\n\n $data['title'] = 'Hondenschool Bollie';\n $data['nobox'] = true; // geen extra rand rond hoofdmenu\n $data['user'] = $this->authex->getUserInfo();\n $data['auteur'] = 'Jarne Peeters, Bart Buyens';\n\n $partials = array('header' => 'main_header', 'content' => 'beheerderToevoegen', 'menu' => 'main_menu');\n $this->template->load('main_master', $partials, $data);\n }", "function action_add() {\n\t\t\t$data = UTIL::get_post('data');\n\t\t\t$id = (int)$data['add_id'];\n\t\t\t$table = $data['add_table'];\n\t\t\t\n\t\t\t$choosen = $this->SESS->get('objbrowser', 'choosen');\n\t\t\t$choosen[$table][$id] = $id;\n\t\t\t$this->SESS->set('objbrowser', 'choosen', $choosen);\n\t\t}", "public function contrato()\r\n\t{\r\n\t}", "private function klantToevoegenAction()\n {\n //controleert of er een formulier is ingevuld\n if (isset($_POST) && !empty($_POST))\n {\n //post gevuld\n //controleer of alle genodigde gegevens zijn ingevuld\n if (isset($_POST['voornaam']) && isset($_POST['achternaam']) && !empty($_POST['voornaam']) && !empty($_POST['achternaam']))\n {\n //maak een klant aan\n $this->model->maakKlant();\n //stuurt je door naar de default pagina\n $this->model->foutGoedMelding('success', '<strong>Gelukt!</strong> klant is aangemaakt. <span class=\"glyphicon glyphicon-saved\"></span>');\n $this->model->setLog('Klant toevoegen', 'Gelukt');\n $this->forward('klanten', 'admin');\n }\n }\n }", "public function boleta()\n\t{\n\t\t//\n\t}", "public function willGenerateAdd(): bool;", "public function generatenewidBarang()\n {\n // mengambil seluruh isi tabel\n $temp = $this->findAll();\n // mengambil row terakhir \n \t$last = end($temp); \n\n // jika $last kosong (jika tabel masih kosong)\n if ($last == Null){\n // mengenerate id baru dengan nilai 1\n $new_id = 1;\n }else{\n // mengenerate id baru dengan nilai id terakhir + 1\n $new_id = $last['id_barang']+1;\n }\n\n // mengembalikan nilai \n return $new_id;\n }", "public function getIdfa();", "public function obtenerViajesplus();", "public function addNewKlant(){\n\n\t\tif(empty($this->tussenvoegsels)){\n\t\t\t$this->tussenvoegsel = NULL;}\n\n\t\t$values = \"'\".$this->achternaam.\"', '\".$this->voorletters.\"', '\".$this->tussenvoegsels.\"', '\".$this->roepnaam.\"', '\".$this->geboortedatum.\"', '\".$this->adres.\"', '\".$this->postcode.\"', '\".$this->woonplaats.\"', '\".$this->gebruikersnaam.\"', '\".md5($this->wachtwoord).\"'\";\n\t\t$db = new database();\n\t\t$db->insert(\"klant\",\"achternaam, voorletters, tussenvoegsels, roepnaam, geboortedatum, adres, postcode, woonplaats, gebruikersnaam, wachtwoord\", $values\n\t\t\t);\n\t\techo \"geregistreerd\";\n\t}", "function ler_id($id) {\n $x = (int)$id;\n if($x >= $this->bd[0][0] || $x <= 0) {return false;}\n //comecando a setar tudo\n $this->id = $this->bd[$x][0];\n $this->maximo = $this->bd[$x][1];\n $this->nome = $this->bd[$x][2];\n $this->categoria = $this->bd[$x][3];\n $this->tipo = $this->bd[$x][4];\n $this->atributo = $this->bd[$x][5];\n $this->specie = $this->bd[$x][6];\n $this->lv = $this->bd[$x][7];\n $this->atk = $this->bd[$x][8];\n $this->def = $this->bd[$x][9];\n $this->preco = $this->bd[$x][10];\n $this->descricao = $this->bd[$x][11];\n $this->img = '../imgs/cards/'.$this->id.'.png';\n return true;\n }", "function evt__agregar()\n\t{\n\t\t$this->set_pantalla('pant_edicion');\n\t}", "function evt__Agregar()\n\t{\n\t\t$this->tabla()->resetear();\n\t\t$this->set_pantalla('pant_edicion');\n\t}", "public function inschrijven()\n {\n $vrijwilliger = new stdClass();\n\n $deelnemer = $this->authex->getDeelnemerInfo();\n $vrijwilliger->deelnemerId = $deelnemer->id;\n $vrijwilliger->taakShiftId = $this->input->get('id');\n $vrijwilliger->commentaar = \"\";\n\n\n $this->HelperTaak_model->insertVrijwilliger($vrijwilliger);\n\n $personeelsfeestId = $this->input->get('personeelsfeestId');\n redirect(\"Vrijwilliger/HulpAanbieden/index/\" . $personeelsfeestId);\n }", "public function id_fiche(){ return $this->id_fiche; }", "public function generujKod(){\n\t\t//\n\t}", "private function escalatieAntwoordToevoegenAction()\n {\n if (isset($_POST) && !empty($_POST))\n {\n $this->model->maakEscalatieAntwoord();\n $this->model->setLog('Escalatie antwoord toevoegen', 'Gelukt');\n $this->forward('ticket', 'admin');\n } else\n {\n $ticket = $this->model->geefTicket();\n $this->view->set('ticket', $ticket);\n }\n }", "function absender_bestimmen($absender,$db){\n$query1=\"select * from user\";\n\t$antwort1=$db->query($query1);\n\t$antwort1=array_bildung($antwort1);\n\t\n\t$i=0;\n\tforeach($absender[Absender] as $name => $inhalt){\n\tif($inhalt==0){\n\t\t$absender[Absender][$i]=\"Information an Alle !\";\n\t}\n\t\n\t\t$k=0;\n\t\tforeach($antwort1[id] as $name1 => $inhalt1){\n\t\t\tif($inhalt==$inhalt1){\n\t\t\t\t$absender[Absender][$i]=$antwort1[Name][$k].\"&nbsp;&nbsp;\".$antwort1[Vorname][$k].\"&nbsp;&nbsp;- \".$antwort1[Bemerkung][$k].\" -\";\n\t\t\t}\n\t\t$k++;\n\t\t}\n\t$i++;\n\t}\n\treturn $absender;\n}", "function shfaqKurset( $id )\n\t{\t\n\n\t\tglobal $db;\n\n\t\t$output = '<select class=\"form-control\">';\n\n\t\t$sql = \"SELECT kurs_id FROM menaxhon WHERE instruktor_id = '$id'\";\n\n\t\t$results = $db->query( $sql );\n\n\t\tif( mysqli_num_rows( $results ) > 0 )\n\t\t{\n\t\t\twhile( $kurs = $results->fetch_assoc() )\n\t\t\t{\t\n\t\t\t\t$k_id = $kurs[ 'kurs_id' ];\n\n\t\t\t\t$sql2 = \"SELECT lloji_kursit FROM kurse WHERE kurs_id = '$k_id'\";\n\n\t\t\t\t$pergjigja = $db->query( $sql2 );\n\n\t\t\t\t$kurs = mysqli_fetch_assoc( $pergjigja );\n\n\n\t\t\t\t$output .= '<option style=\"padding: 0 0 0 20px;\" value=\"'. $kurs[ 'lloji_kursit' ] .'\">' . $kurs[ 'lloji_kursit' ]. '</option>';\n\t\t\t}\n\t\t}///FUND if\n\t\telse\n\t\t{\n\t\t\t$output = '<option>Ky instruktor nuk ka kurse per momentin!</option>';\n\t\t}\n\n\t\treturn $output;\n\t}", "public function dohvati_najaktuelnije_ideje()\n {\n $ideje= $this->findAll();\n usort($ideje,function ($i1,$i2)\n {\n //proveriti je l' ovo tranzitivno, idejno jeste, samo da li sam napravio gresku\n $dat1= strtotime($i1->DatumEvaluacije); \n $dat2= strtotime($i2->DatumEvaluacije); \n $danas= strtotime(date(\"Y-m-d H:i:s\"));\n if ($dat1==$dat2)\n {\n return 0;\n }\n if ($dat1>$danas)\n {\n if ($dat2<$danas)//dat2 nije aktuelno, jer je vec proslo, a d1 jeste te ide ispred\n {\n return -1;\n }\n else//oba tek treba da se dogode aktuelnije je ono sto ce pre da se dogodi\n {\n if ($dat1<$dat2)\n {\n return -1;\n }\n else\n {\n return 1;\n }\n }\n }\n else//dat1 nije aktuelno\n {\n if ($dat2>$danas)//dat2 ide ispred\n {\n return 1;\n }\n else//nijedan nije aktuelan zato zelimo da bude ispred onaj sa vecim datumom jer je on blizi sadasnjosti\n {\n if ($dat1<$dat2)\n {\n return 1;\n }\n else \n {\n return -1;\n \n }\n }\n \n }\n });\n return $ideje;\n \n }", "public function AggiornaPrezzi(){\n\t}", "public function uputstvo()\n {\n $this->prikaz(\"uputstvo\", []);\n }", "public function shiftenTonen()\n {\n $id = $this->input->get('id');\n $personeelsfeestId = $this->input->get('personeelsfeestId');\n\n $geselecteerddagonderdeel = $this->DagOnderdeel_model->getDagonderdeelByStartTijdWithOptiesWithTakenWithShiften($personeelsfeestId, $id);\n echo json_encode($geselecteerddagonderdeel);\n }", "function otdelenie()\r\n\t{\r\n\t\t$obr = \"SELECT ID, FORMAOBUCH FROM FORMAOBUCH ORDER BY ID\";\t\r\n\t\t$res_obr = mysql_query($obr);\r\n\t\t$number = 1;\r\n /* show result */\r\n\t \twhile ($row = mysql_fetch_array($res_obr, MYSQL_ASSOC)) \r\n\t\t{\r\n\t\t\tprintf(\"<option value='\".$row[\"ID\"].\"'>\");\r\n \tprintf ($row[\"FORMAOBUCH\"]);\r\n\t\t\tprintf(\"</option>\");\r\n\t\t\t$number ++;\r\n\t\t}\r\n\t\tmysql_free_result($res_obr);\r\n\t}", "public function bernafas()\n \t{\n \t\techo 'Bernafas menggunakan hidung, '.PHP_EOL;\n \t}", "function\t__construct( $_id='') {\n\t\tparent::__construct( \"AktivitaetenMitarbeiter\", \"LfdNr\") ;\n\t\t$this->setIdKey( \"UniqueID\") ;\n\t\tif ( strlen( $_id) > 0) {\n\t\t\t$this->setId( $_id) ;\n\t\t} else {\n\t\t}\n\t}", "function buscarPorId($id) {\r\n \r\n }", "public function afficherAll()\n {\n }", "private function rapportToevoegenAction()\n {\n if (isset($_POST) && !empty($_POST))\n {\n //maakt een rapport(vult de gegevens in de ticket)\n //en zet de status op gesloten\n $this->model->maakRapport();\n //stuurt je naar de ticket pagina\n $this->model->foutGoedMelding('success', '<strong>Gelukt!</strong> rapport is toegevoegd. <span class=\"glyphicon glyphicon-saved\"></span>');\n $this->model->setLog('Rapport toevoegen', 1);\n $this->forward('ticket', 'admin');\n } else\n {\n //geeft de ticket mee om later de ticket en klant id te gebruiken.\n $ticket = $this->model->geefTicket();\n $this->view->set('ticket', $ticket);\n }\n }", "function archobjet_autoriser() {\n}", "public function beheerderWijzigen($id) {\n if (!$this->authex->loggedIn()) {\n redirect('home/login');\n }\n\n $data['title'] = 'Hondenschool Bollie';\n $data['nobox'] = true; // geen extra rand rond hoofdmenu\n $data['user'] = $this->authex->getUserInfo();\n $data['auteur'] = 'Jarne Peeters, Bart Buyens';\n\n $this->load->model('persoon_model');\n $data['beheerder'] = $this->persoon_model->get($id);\n\n $partials = array('header' => 'main_header', 'content' => 'beheerderAanpassen', 'menu' => 'main_menu');\n $this->template->load('main_master', $partials, $data);\n }", "public function sortIdejaAktuelno() {\n $data['kor_ime']=$this->session->get('kor_tip');\n $idejaModel=new IdejaModel();\n $ideje=$idejaModel->dohvati_najaktuelnije_ideje(); \n $data['ideje']=$ideje;\n $this->prikaz('pregled_ideja', $data); \n }", "public function wijzigBeheerder() {\n $beheerder = new stdClass();\n $beheerder->id = strip_tags($this->input->post('hidden_id'));\n $beheerder->voornaam = strip_tags($this->input->post('voornaam'));\n $beheerder->naam = strip_tags($this->input->post('naam'));\n $beheerder->email = strip_tags($this->input->post('email'));\n $beheerder->paswoord = sha1(strip_tags($this->input->post('paswoord')));\n\n $this->load->model('persoon_model');\n $this->persoon_model->update($beheerder);\n\n redirect('persoon/index');\n }", "public function nuevaOSubsecuente() {\n if ($this->id === 0 || is_null($this->id)) {\n return 'Nueva';\n }\n\n return 'Existente';\n }", "public function nadar()\n {\n }", "function setAgregarUnPais(){\n\t\t$this->comienza_con++;\n\t}", "private function gebruikersBeheerAction()\n {\n $gebruikers = $this->model->geefGebruikers();\n $this->view->set('gebruikers', $gebruikers);\n }", "function scheckAusdruck()\r\n {\r\n foreach ($this->belegschaft as $schluessel=>$wert)\r\n $this->belegschaft[$schluessel]->scheckAusdruck();\r\n }", "private function _exists() {\n // taky typ uz existuje ?\n $id = $this->equipment->getID();\n if ($id > 0) {\n $this->flash(\"Také vybavenie už existuje.<br/>Presmerované na jeho editáciu.\", \"error\");\n $this->redirect(\"ape/equipment/edit/$id\");\n }\n }", "private function ticketToevoegenAction()\n {\n //controlleert of er een formulier is ingevuld\n if (isset($_POST) && !empty($_POST))\n {\n $ticket_id = $this->model->maakTicket();\n $this->model->voegAgendaEventToe($ticket_id);\n $_SESSION['ticket_id'] = $ticket_id;\n\n $this->forward('getBeschikbareExpert', 'admin');\n } else\n {\n $this->view->set('gebruikers', $this->model->geefExperts());\n $this->view->set('klant_id', $_REQUEST['klant_id']);\n }\n }", "public static function dodajArtikelVKosarico() {\n $id = $_SESSION[\"uporabnik_id\"];\n $uporabnik = UporabnikiDB::get($id);\n\n $id_artikla = filter_input(INPUT_POST, \"id\", FILTER_SANITIZE_SPECIAL_CHARS);\n $status = \"kosarica\";\n\n // ce narocilo ze obstaja mu samo povecamo kolicino \n // drugace narocilo ustvarimo\n $narocilo = NarocilaDB::getByUporabnikId($id, $status);\n\n if (!$narocilo) {\n\n $id_narocila = NarocilaDB::insert($id, $status);\n PodrobnostiNarocilaDB::insert($id_artikla, 1, $id_narocila);\n\n } else {\n\n $podrobnost_narocila = PodrobnostiNarocilaDB::getByNarociloAndArtikel($narocilo[\"id\"], $id_artikla);\n\n if (!$podrobnost_narocila) {\n PodrobnostiNarocilaDB::insert($id_artikla, 1, $narocilo[\"id\"]);\n } else {\n PodrobnostiNarocilaDB::edit($id_artikla, $podrobnost_narocila[\"kolicina\"] + 1, $narocilo[\"id\"]); \n } \n }\n\n echo ViewHelper::redirect(BASE_URL);\n\n }", "public function setId()\n\t{\n\t}", "public function ausgeben() {\r\n\t\techo \"Die aktuelle Geschwindigkeit beträgt \" . $this->geschwindigkeit . \": \";\r\n\t}", "function homepageshow() {\r\n\t\t$this->query ( \"Update #__tin_tuc Set trang_chu=if(trang_chu='1','0','1'),date_create=\" . time () . \" Where id=\" . $_GET ['id'] );\r\n\t\t$this->redirect ( 'index.php?p=' . $_GET ['p'] );\r\n\t}", "function kontrakt()\r\n\t{\r\n\t\t$obr = \"SELECT ID, KONTRAKT FROM KONTRAKT ORDER BY ID\";\t\r\n\t\t$res_obr = mysql_query($obr);\r\n\t\t$number = 1;\r\n /* show result */\r\n\t \twhile ($row = mysql_fetch_array($res_obr, MYSQL_ASSOC)) \r\n\t\t{\r\n\t\t\tprintf(\"<option value='\".$row[\"ID\"].\"'>\");\r\n \tprintf ($row[\"KONTRAKT\"]);\r\n\t\t\tprintf(\"</option>\");\r\n\t\t\t$number ++;\r\n\t\t}\r\n\t\tmysql_free_result($res_obr);\r\n\t}", "public function registreerBeheerder() {\n $beheerder = new stdClass();\n $beheerder->voornaam = strip_tags($this->input->post('voornaam'));\n $beheerder->naam = strip_tags($this->input->post('naam'));\n $beheerder->email = strip_tags($this->input->post('email'));\n $beheerder->paswoord = sha1(strip_tags($this->input->post('paswoord')));\n $beheerder->soort = \"Beheerder\";\n $this->load->model('persoon_model');\n $data['beheerder'] = $this->persoon_model->insert($beheerder);\n\n redirect('persoon/index');\n }", "function test_id(){\n\t\tif(isset($_GET['id'])){\n\t\t\trecuperation_info_id();\n\t\t\tglobal $id_defini;\n\t\t\t$id_defini = true;\n\t\t}\n\t}", "public function editar()\n {\n }", "public function isVerwijderd( )\r\n {\r\n return false;\r\n }", "protected function editar()\n {\n }", "public function suprimerId($id)\n {\n }", "static function setPubblico($id){\n if(!CUtente::verificalogin())header('Location: /Progetto/Utente/homepagedef');\n else{\n session_start();\n if(!isset($_SESSION['location'])) header('Location: /Progetto/Utente/homepagedef');\n else{\n if(stripos($_SESSION['location'],'Watchlist')!==false && FPersistentManager::exist('id',$id,'FWatchlist')){\n $w=FPersistentManager::load('id',$id,'FWatchlist');\n if($w[0]->getProprietario()==$_SESSION['utente']->getUsername())\n FPersistentManager::update('pubblico',1,'id',$id,'FWatchlist');\n\n }\n\n header('Location: /Progetto'.$_SESSION['location']);\n\n }\n //header('Location: /Progetto/Utente/homepagedef');\n\n }\n}", "function add_tt_1_alkes() {\n//\t\tif (! $this->get_permission('fill_this')) return $this->intruder();\n\t\tglobal $_POST, $adodb, $ses;\n\t\t$record = $_POST;\n\t\tforeach ($record as $k => $v) $record[$k] = trim($v);\n\n\t\t$rsx = $adodb->Execute(\"SELECT * FROM tt_1_alkes ORDER by no_tt DESC LIMIT 1\");\n\t\t$tahun_data = date('Y',$rsx->fields['date_insert']);\n\t\t$tahun_now = date('Y');\n\n\n\t\tif($rsx->fields['urut_no_tt'] == ''){\n\t\t\t$urut_no_tt = 1;\n\t\t}else{\n\t\t\tif($tahun_data == $tahun_now){\n\t\t\t\t$urut_no_tt = $rsx->fields['urut_no_tt'] + 1;\n\t\t\t}else{\n\t\t\t\t$urut_no_tt = 1;\n\t\t\t}\n\t\t}\n\n\t\t$sqly = \"SELECT\n\t\t\tsubdit\n\t\tFROM\n\t\t\tsubdit\n\t\tWHERE\n\t\t\tid_subdit = '\".$_POST['kode_subdit'].\"'\n\t\t\";\n\t\t//print $sqly;\n\t\t$lastno = $rsx->fields['urut_no_tt'];\n\t\t$lastno = $lastno[2].$lastno[3].$lastno[4].$lastno[5].$lastno[6];\n\t\t$lastno = intval($lastno);\n\t\t$lastno = $lastno + $urut_no_tt;\n\n\t\t$rsy = $adodb->Execute($sqly);\n\t\t$subdit = $rsy->fields['subdit'];\n\t\t$a = date('d-m/Y');\n\t\t$no = str_pad($lastno, 5, \"0\", STR_PAD_LEFT);\n\t\t$urut_no_tt = $subdit.\"/\".$no.\"/\".$a;\n\n \t\t$record['urut_no_tt'] = $urut_no_tt;\n\n\n\t\t$rs = $adodb->Execute(\"SELECT * FROM tt_1_alkes WHERE no_tt = '{$record['oldpkvalue']}'\");\n\t\tif ($rs && ! $rs->EOF) {\n\t\t\t$adodb->Execute($adodb->GetUpdateSQL($rs, $record, 1));\n\t\t\t$st = \"Updated\";\n\t\t} else {\n\t\t\t$record['insert_by'] = $ses->loginid;\n\t\t\t$record['date_insert'] = time();\n\t\t\t$rs = $adodb->Execute(\"SELECT * FROM tt_1_alkes WHERE no_tt = NULL\");\n\t\t\t$adodb->Execute($adodb->GetInsertSQL($rs, $record));\n\t\t\t$st = \"Added\";\n\t\t}\n\t\t//print_r($st);exit();\n\t\t$status = \"Successfull $st '<b>{$record['urut_no_tt']}</b>'\";\n\t\t$this->log($status);\n\n\t\t$_block = new block();\n\t\t$_block->set_config('title', 'Status');\n\t\t$_block->set_config('width', \"90%\");\n\t\t$_block->parse(array(\"*\".$status));\n\t\treturn $_block->get_str();\n\t}", "public function setup_selected() {\n\t}", "function ToonFormulierAfspraak()\n{\n\n}", "function saveNewArticulo(){\n\t\t$r = $this->ar->insertArticulo($this->alcance,$this->documento,$this->nombre,$this->descripcion);\n\t\tif($r=='true'){\n\t\t\t$msg = ARTICULO_AGREGADO;\n\t\t}else{\n\t\t\t$msg = ERROR_ADD_ARTICULO;\n\t\t}\t\n\t\treturn $msg;\n\t}", "public function uitschrijven()\n {\n $deelnemer = $this->authex->getDeelnemerInfo();\n\n $vrijwilliger = new stdClass;\n\n $vrijwilliger->deelnemerId = $deelnemer->id;\n $vrijwilliger->taakShiftId = $this->input->get('id');\n\n $this->HelperTaak_model->deleteVrijwilliger($vrijwilliger);\n\n $personeelsfeestId = $this->input->get('personeelsfeestId');\n redirect(\"Vrijwilliger/HulpAanbieden/index/\" . $personeelsfeestId);\n }", "public static function Najdi_kolize_pro_formular_dosud_nezavolane ($iducast, $formular, $pole_id_volanych ) {\r\n $query= \"SELECT * FROM s_typ_kolize WHERE formular='\" . $formular . \"' and valid\" ;\r\n $kolize_pole = self::Najdi_kolize ($query,$iducast) ; //to jsou vsechny pro formular\r\n \r\n //ty, co uz volal, z pole vypustit\r\n $kolize_pole_redukovane = array();\r\n \r\n foreach ($kolize_pole as $kprvek) {\r\n if ( in_array( $kprvek->id_s_typ_kolize_FK, $pole_id_volanych) ) {\r\n }\r\n else {\r\n array_push ($kolize_pole_redukovane, $kprvek ); //$kprvek->id_s_typ_kolize_FK);\r\n } \r\n }\r\n \r\n return $kolize_pole_redukovane; \r\n}", "function addalben() {\r\n if (isset($_POST['albenerstellen'])) {\r\n \r\n $albenname = $_POST['album'];\r\n if(!CheckEmpty($albenname))\r\n {\r\n echo '<script language=\"javascript\">';\r\n echo 'alert(\"Bitte Galeriename eingeben!\")';\r\n echo '</script>';\r\n header('Refresh:0');\r\n return false;\r\n }\r\n else\r\n {\r\n db_insert_alben($_REQUEST);\r\n }\r\n }\r\n // Template abfüllen und Resultat zurückgeben\r\n setValue('phpmodule', $_SERVER['PHP_SELF'].\"?id=\".__FUNCTION__);\r\n return runTemplate( \"../templates/addalben.htm.php\" );\r\n}", "function _JsemNaRade($posta_id, $prac = 0) {\r\n if (is_array($posta_id)) $posta_id = $posta_id[0];\r\n $pid = split(',',$posta_id);\r\n $posta_id = $pid[0];\r\n $sql = 'select * from posta_schvalovani where posta_id=' . $posta_id . ' and schvaleno=0 and stornovano is null order by id asc';\r\n $q = new DB_POSTA;\r\n $q->query($sql); \r\n $q->Next_Record();\r\n if ($q->Record['POSTUP'] == 2 || ($q->Record['POSTUP'] == 1 && $q->Record['SCHVALUJICI_ID'] == $prac)) return true;\r\n else return false; \r\n}", "function add_kunjungan_pasien($no_rm){\n $kunjungan = $this->db->query(\"select kunjungan from pasien where no_rm = '\".$no_rm.\"' \")->row()->kunjungan;\n \n $data = array(\n 'kunjungan' => ($kunjungan + 1)\n );\n\n $this->db->where('no_rm', $no_rm);\n $this->db->update('pasien',$data);\n }", "public function mostrar_insertar() {\r\n\t\t\t$this -> pantalla_edicion('insertar'); \r\n\t\t }", "function toevoegen(){\n \tinclude '../db_connect.php';\n\n\t\t$id = $_POST[\"id\"];\n\t\t$url = $_POST[\"url\"];\n\t\t$beschrijving = $_POST[\"beschrijving\"];\n\t\t$naam = $_POST[\"naam\"];\n\n\t\t$stmt = $conn->prepare(\"INSERT INTO api_url (id, url, beschrijving, naam) \n\t\t\t\t\t\t\t\tVALUES (:id, :url, :beschrijving, :naam)\");\n\t\t$stmt->bindParam(':id', $id);\n\t $stmt->bindParam(':url', $url);\n\t $stmt->bindParam(':beschrijving', $beschrijving);\n\t $stmt->bindParam(':naam', $naam);\n\t\t \n\t\tif ($stmt->execute())\n {\n\t\t\t\techo \"<p>\".\"<strong>Regisseur toegevoegd</strong>\".\"</p>\";\n\t\t}\t\t\t\n\t\t$conn = null;\n\t\theader(\"Location: ../database.php\");\n }", "public function autoLabelNeeded();", "protected function reise()\n\t{\n\t\tredirect::store(\"bydeler#b\");\n\t\t\n\t\t$this->up->fengsel_require_no();\n\t\t$this->up->bomberom_require_no();\n\t\t\n\t\t// finn bydelen\n\t\t$bydel = false;\n\t\tforeach ($this->bydeler as $row)\n\t\t{\n\t\t\tif ($row['id'] == 0 || $row['active'] == 0) continue;\n\t\t\tif ($row['name'] == $_POST['reise'])\n\t\t\t{\n\t\t\t\t$bydel = $row;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!$bydel)\n\t\t{\n\t\t\tess::$b->page->add_message(\"Fant ikke bydelen.\", \"error\");\n\t\t\tredirect::handle();\n\t\t}\n\t\t\n\t\t// allerede i bydelen?\n\t\tif ($bydel['id'] == $this->up->data['up_b_id'])\n\t\t{\n\t\t\t$this->reise_error_in($bydel);\n\t\t}\n\t\t\n\t\t// teleportere?\n\t\tif (isset($_POST['teleporter']) && access::is_nostat())\n\t\t{\n\t\t\t// teleporter\n\t\t\t$a = \\Kofradia\\DB::get()->exec(\"UPDATE users_players SET up_b_id = {$bydel['id']}, up_b_time = \".time().\" WHERE up_id = \".$this->up->id.\" AND up_access_level != 0 AND up_b_id != {$bydel['id']}\");\n\t\t\tif ($a == 0) $this->reise_error_in($bydel);\n\t\t\t\n\t\t\tess::$b->page->add_message('Du teleporterte til <b>'.htmlspecialchars($bydel['name']).'</b>.');\n\t\t\tredirect::handle();\n\t\t}\n\t\t\n\t\t// med bil?\n\t\tif (isset($_POST['gta']))\n\t\t{\n\t\t\tif ($this->gta_count == 0)\n\t\t\t{\n\t\t\t\tess::$b->page->add_message(\"Du har ingen biler i bydelen du oppholder deg i.\", \"error\");\n\t\t\t\tredirect::handle();\n\t\t\t}\n\t\t\t\n\t\t\tif (!$this->gta_garage[$bydel['id']]['garage'])\n\t\t\t{\n\t\t\t\tess::$b->page->add_message('Du har ingen garasje på <b>'.htmlspecialchars($bydel['name']).'</b> og kan ikke reise dit med bil.', \"error\");\n\t\t\t\tredirect::handle();\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->gta_garage[$bydel['id']]['garage_free'] == 0)\n\t\t\t{\n\t\t\t\tess::$b->page->add_message('Det er ingen ledige plasser i garasjen på <b>'.htmlspecialchars($bydel['name']).'</b>.', \"error\");\n\t\t\t\tredirect::handle();\n\t\t\t}\n\t\t\t\n\t\t\t// regn ut avstand (km)\n\t\t\t$distance = self::calc_travel_distance($this->up->bydel, $bydel);\n\t\t\t\n\t\t\t// har vi valgt en bil?\n\t\t\tif (isset($_POST['sel']))\n\t\t\t{\n\t\t\t\tif (!isset($_POST['bil']))\n\t\t\t\t{\n\t\t\t\t\tess::$b->page->add_message(\"Du må velge en bil du ønsker å reise med.\", \"error\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->reise_gta_check($bydel, $distance);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t// TODO\n\t\t\t}\n\t\t\t\n\t\t\t// vis skjema for å velge en bil å reise med\n\t\t\tess::$b->page->add_title($bydel['name'], \"Reis med bil\");\n\t\t\t\n\t\t\t// hent bilene i garasjen\n\t\t\t$pagei = new pagei(pagei::ACTIVE_POST, \"side\", pagei::PER_PAGE, 10);\n\t\t\t$result = $pagei->query(\"\n\t\t\t\tSELECT s.id, s.time, g.brand, g.model, g.img_mini, g.value, s.damage, g.points\n\t\t\t\tFROM users_gta AS s\n\t\t\t\t\tJOIN gta AS g ON s.gtaid = g.id\n\t\t\t\tWHERE ug_up_id = {$this->up->id} AND s.b_id = {$this->up->data['up_b_id']}\n\t\t\t\tORDER BY g.points*(100-s.damage) DESC\");\n\t\t\t\n\t\t\techo '\n<div class=\"bg1_c xmedium\">\n\t<h1 class=\"bg1\">Reis med bil til '.htmlspecialchars($bydel['name']).'<span class=\"left\"></span><span class=\"right\"></span></h1>\n\t<div class=\"bg1\">\n\t\t<p class=\"c\"><a href=\"bydeler#b\">Tilbake</a></p>\n\t\t<form action=\"bydeler#b\" method=\"post\">\n\t\t\t<input type=\"hidden\" name=\"reise\" value=\"'.htmlspecialchars($bydel['name']).'\" />\n\t\t\t<input type=\"hidden\" name=\"gta\" />\n\t\t\t<table class=\"table center\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th colspan=\"2\">Merke/Modell</th>\n\t\t\t\t\t\t<th>Dato anskaffet</th>\n\t\t\t\t\t\t<th>Skade</th>\n\t\t\t\t\t\t<th>Energi</th>\n\t\t\t\t\t\t<th>Utgifter</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>';\n\t\t\t\t\n\t\t\t$i = 0;\n\t\t\twhile ($row = $result->fetch())\n\t\t\t{\n\t\t\t\t$price = $distance * self::GTA_PRICE_KM * self::get_gta_factor_points($row['points']) * self::get_gta_factor_damage($row['damage']);\n\t\t\t\t$energy = self::get_gta_energy($row['damage']);\n\t\t\t\t\n\t\t\t\techo '\n\t\t\t\t\t<tr class=\"box_handle'.(++$i % 2 == 0 ? ' color' : '').'\">\n\t\t\t\t\t\t<td><input type=\"radio\" id=\"bil_'.$row['id'].'\" name=\"bil\" value=\"'.$row['id'].'\"'.(postval(\"bil\") == $row['id'] ? ' checked=\"checked\"' : '').' />'.(empty($row['img_mini']) ? '&nbsp;' : '<img src=\"'.$row['img_mini'].'\" alt=\"Bilde\" />').'</td>\n\t\t\t\t\t\t<td>'.htmlspecialchars($row['brand']).'<br /><b>'.htmlspecialchars($row['model']).'</b></td>\n\t\t\t\t\t\t<td>'.ess::$b->date->get($row['time'])->format().'</td>\n\t\t\t\t\t\t<td align=\"right\">'.$row['damage'].' %</td>\n\t\t\t\t\t\t<td align=\"right\">'.game::format_num($energy / $this->up->data['up_energy_max'] * 100, 1).' %</td>\n\t\t\t\t\t\t<td align=\"right\">'.game::format_cash($price).'</td>\n\t\t\t\t\t</tr>';\n\t\t\t}\n\t\t\t\n\t\t\techo '\n\t\t\t\t</tbody>\n\t\t\t</table>'.($pagei->pages > 1 ? '\n\t\t\t<p class=\"c\">'.$pagei->pagenumbers(\"input\").'</p>' : '').'\n\t\t\t<p class=\"c\">'.show_sbutton(\"Reis til \".htmlspecialchars($bydel['name']), 'name=\"sel\"').'</p>\n\t\t</form>\n\t</div>\n</div>';\n\t\t\t\n\t\t\tess::$b->page->load();\n\t\t}\n\t\t\n\t\t// ta taxi?\n\t\tif (isset($_POST['taxi']))\n\t\t{\n\t\t\t// har vi ikke nok energi?\n\t\t\tif (!$this->up->energy_check(self::TAXI_ENERGY*1.3)) // pluss på 30 % så man ikke kan ende opp på 0 % energi\n\t\t\t{\n\t\t\t\tess::$b->page->add_message(\"Du har ikke nok energi for å reise med taxi.\", \"error\");\n\t\t\t\tredirect::handle();\n\t\t\t}\n\t\t\t\n\t\t\t// regn ut avstand (km)\n\t\t\t$distance = self::calc_travel_distance($this->up->bydel, $bydel);\n\t\t\t\n\t\t\t// regn ut pris og rankpoeng\n\t\t\t$price = round($distance * self::TAXI_PRICE_KM);\n\t\t\t$points = round($distance * self::TAXI_POINTS_KM * $this->up->rank['number']);\n\t\t\t\n\t\t\t// har ikke nok rank?\n\t\t\tif ($this->up->data['up_points'] < $points * 2) // må ha dobbelte\n\t\t\t{\n\t\t\t\tess::$b->page->add_message(\"Du har ikke nok rank til å reise til \".htmlspecialchars($bydel['name']).\".\", \"error\");\n\t\t\t\tredirect::handle();\n\t\t\t}\n\t\t\t\n\t\t\t// forsøk å reis\n\t\t\t$a = \\Kofradia\\DB::get()->exec(\"UPDATE users_players SET up_cash = up_cash - $price, up_b_id = {$bydel['id']}, up_b_time = \".time().\" WHERE up_id = \".$this->up->id.\" AND up_cash >= $price AND up_b_id != {$bydel['id']}\");\n\t\t\t\n\t\t\t// feilet?\n\t\t\tif ($a == 0)\n\t\t\t{\n\t\t\t\t// allerede i bydelen?\n\t\t\t\t$result = \\Kofradia\\DB::get()->query(\"SELECT up_b_id FROM users_players WHERE up_id = \".$this->up->id);\n\t\t\t\tif ($result->fetchColumn(0) == $bydel['id'])\n\t\t\t\t{\n\t\t\t\t\t$this->reise_error_in($bydel);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// hadde ikke råd\n\t\t\t\t$this->reise_error_cash($bydel);\n\t\t\t}\n\t\t\t\n\t\t\t// energi\n\t\t\t$this->up->energy_use(self::TAXI_ENERGY);\n\t\t\t\n\t\t\t// rank\n\t\t\t$this->up->increase_rank(-$points);\n\t\t\t\n\t\t\t// vellykket\n\t\t\tess::$b->page->add_message(\"Du tok taxi til <b>\".htmlspecialchars($bydel['name']).\"</b>. Det kostet deg <b>\".game::format_cash($price).\"</b> og \".game::format_number($points).\" poeng.\");\n\t\t\tredirect::handle();\n\t\t}\n\t\t\n\t\tess::$b->page->add_message(\"Ukjent reisemetode.\", \"error\");\n\t\tredirect::handle();\n\t}", "private function klantenAction()\n {\n\n //controlleert of de post naam is gevuld voor de zoek functie\n if (isset($_POST['waarde']) && !empty($_POST['waarde']))\n {\n //haalt alle klanten op die voldoen aan de zoek woord\n $klanten = $this->model->zoekKlanten();\n } else\n {\n //haalt alle klanten op\n $klanten = $this->model->geefKlanten();\n }\n //plaats de klanten in de view\n if ($klanten !== 'LEEG')\n {\n $this->view->set('klanten', $klanten);\n } else\n {\n $this->model->foutGoedMelding('danger', 'Klant bestaat niet');\n }\n }", "public function add() \n { // metodo add, complementar\n $str = \"insert into \".self::$tablename.\"(nitHotel, idCiudad, nomHotel, dirHotel, telHotel1, telHotel2, correoHotel, tipoHotel, Administrador, idRedes, aforo, tipoHabitaciones, status)\";\n $str.= \" values ('$this->nitHotel', $this->idCiudad, '$this->nomHotel', '$this->dirHotel', '$this->telHotel1', '$this->telHotel2', '$this->correoHotel', $this->tipoHotel, '$this->Administrador', $this->idRedes, $this->aforo, $this->tipoHabitaciones, $this->status);\";\n }", "public function dodajObavestenjaGrupe() {\n\n $idGru = $this->input->post('idGru');\n $naslov = $this->input->post('naslov');\n $obavest = $this->input->post('tekst');\n $vidljivost = $this->input->post('vidljivost');\n $vidljivostKurs = $this->input->post(\"odabraniKurs\");\n $vidljivostGrupa = $this->input->post('odabranaGrupa');\n $this->ObavModel->dodajObavestenje($this->session->userdata('user')['idKor'], $naslov, $obavest, $vidljivost, $vidljivostKurs, $vidljivostGrupa);\n $last_id = $this->db->insert_id();\n $idOba = $last_id;\n $this->ObavModel->dodajObavestenjaGrupe($idOba, $idGru);\n redirect(\"Grupe/grupa/$idGru\");\n }", "public function createNoUser(){\r\n $this -> setInscrit(0);\r\n $this -> insertDb();//Insertion en Bd d'un tuple user\r\n \r\n }", "public function existeLugar(){\n $modelSearch = new LugarSearch();\n $resultado = $modelSearch->busquedadGeneral($this->attributes);\n if($resultado->getTotalCount()){ \n foreach ($resultado->models as $modeloEncontrado){\n $modeloEncontrado = $modeloEncontrado->toArray();\n $lugar[\"id\"]=$modeloEncontrado['id']; \n #borramos el id, ya que el modelo a registrar aun no tiene id\n $modeloEncontrado['id']=\"\";\n \n //si $this viene con id cargado, nunca va a encontrar el parecido\n if($this->attributes==$modeloEncontrado){\n $this->addError(\"notificacion\", \"El lugar a registrar ya existe!\");\n $this->addError(\"lugarEncontrado\", $lugar);\n }\n }\n }\n }", "public function masodik()\n {\n }", "public function genereer($avond, $random = false) {\n\t\tassert(isset($this->novieten));\n\t\tassert(isset($this->huizen));\n\n\t\t$eetplan = array();\n\n\t\t$aantal_sjaars = count($this->novieten);\n\t\t$aantal_huizen = count($this->huizen) - 1;\n\n\t\t// $huis_index is het nummer van he thuis in $this->huizen\n\t\tif ($random == false) {\n\t\t\t$huis_index = 0;\n\t\t} else {\n\t\t\t$huis_index = rand(0, $aantal_huizen);\n\t\t}\n\n\t\t// Interne id, niet oplopend van huis\n\t\t$huis_id = $this->huizen[$huis_index]->id;\n\n\t\t$this->bezocht_ah[$avond] = array();\n\n\t\tforeach ($this->novieten as $noviet) {\n\t\t\t$uid = $noviet->uid;\n\t\t\t# wat foutmeldingen voorkomen\n\t\t\tif (!isset($this->ahs[$avond][$huis_id]))\n\t\t\t\t$this->ahs[$avond][$huis_id] = array();\n\t\t\tif (!isset($this->bekenden[$uid]))\n\t\t\t\t$this->bekenden[$uid] = array();\n\t\t\tif (!isset($this->bezocht_ah[$avond][$huis_id]))\n\t\t\t\t$this->bezocht_ah[$avond][$huis_id] = array();\n\t\t\t# we hebben nu een avond en een sjaars, nu nog een huis voor m vinden...\n\t\t\t# zolang\n\t\t\t# - deze sjaars dit huis al bezocht heeft, of\n\t\t\t# - in het huidige huis (huis_index) een sjaars zit die deze sjaars (noviet) al ontmoet heeft\n\t\t\t# - het huis nog niet aan zn max sjaars is voor deze avond\n\t\t\t# nemen we het volgende huis\n\t\t\t$startih = $huis_index;\n\t\t\t# nieuw: begin met het max aantal sjaars per huis net iets te laag in te stellen, zodat\n\t\t\t# de huizen eerst goed vol komen, en daarna pas extra sjaars bij huizen\n\t\t\t$max = (int)floor($aantal_sjaars / $aantal_huizen);\n\t\t\t$nofm = 0; # aantal huizen dat aan de max zit.\n\t\t\twhile (isset($this->bezocht_sh[$uid][$huis_id])\n\t\t\t\tor count(array_intersect($this->ahs[$avond][$huis_id], $this->bekenden[$uid])) > 0\n\t\t\t\tor count($this->bezocht_ah[$avond][$huis_id]) >= $max) {\n\t\t\t\t$huis_index = $huis_index % $aantal_huizen + 1;\n\t\t\t\t$huis_id = $this->huizen[$huis_index]->id;\n\t\t\t\tif ($huis_index == $startih) {\n\t\t\t\t\t$max++; #die ('whraagh!!!');\n\t\t\t\t}\n\t\t\t\tif (!isset($this->ahs[$avond][$huis_id])) {\n\t\t\t\t\t$this->ahs[$avond][$huis_id] = array();\n\t\t\t\t}\n\t\t\t\tif (!isset($this->bezocht_ah[$avond][$huis_id]))\n\t\t\t\t\t$this->bezocht_ah[$avond][$huis_id] = array();\n\n\t\t\t\t# nieuw: als alle huizen zijn langsgelopen en ze allemaal max sjaars hebben\n\t\t\t\t# dan de max ophogen\n\t\t\t\tif (count($this->bezocht_ah[$avond][$huis_id]) == $max) {\n\t\t\t\t\t$nofm++;\n\t\t\t\t}\n\t\t\t\tif ($nofm == $aantal_huizen) {\n\t\t\t\t\t$max++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t# deze sjaars heeft op deze avond een huis gevonden\n\t\t\t$this->sah[$uid][$avond] = $huis_id;\n\t\t\t# en gaat alle sjaars die op deze avond in dit huis zitten dat melden\n\t\t\tforeach ($this->ahs[$avond][$huis_id] as $sjaars) {\n\t\t\t\t$this->bekenden[$uid][] = $sjaars; # alle sjaars in mijn seen\n\t\t\t\t$this->bekenden[$sjaars][] = $uid; # ik in alle sjaars' seen\n\t\t\t}\n\t\t\t$this->ahs[$avond][$huis_id][] = $uid;\n\t\t\t# de sjaars heeft het huis bezocht\n\t\t\t$this->bezocht[$huis_id][] = $uid;\n\t\t\t$this->bezocht_sh[$uid][$huis_id] = true;\n\t\t\t$this->bezocht_ah[$avond][$huis_id][] = $uid;\n\n\t\t\t# Maak een entity voor deze sessie\n\t\t\t$nieuweetplan = new Eetplan();\n\t\t\t$nieuweetplan->avond = date_create_immutable($avond);\n\t\t\t$nieuweetplan->uid = $uid;\n\t\t\t$nieuweetplan->woonoord = $this->huizen[$huis_index];\n\n\t\t\t$eetplan[] = $nieuweetplan;\n\n\t\t\t# huis ophogen\n\t\t\tif ($random == 0)\n\t\t\t\t$huis_index = $huis_index % $aantal_huizen + 1;\n\t\t\telse\n\t\t\t\t$huis_index = rand(0, $aantal_huizen);\n\n\t\t\t$huis_id = $this->huizen[$huis_index]->id;\n\t\t}\n\n\t\treturn $eetplan;\n\t}", "function add_is_cetak_kartu($no_rm) {\n // update \n $data = $this->get_by_no_rm($no_rm);\n $update = array(\n 'is_cetak_kartu' => '1'\n );\n\n\n $this->db->where('no_rm', $no_rm);\n $this->db->update('pasien', $update);\n }", "function evt__3__salida()\n\t{\n\t\t$this->dependencia('eventos')->limpiar_seleccion();\n\t}", "function _set_id( $idGrupo ){\n \t\t$this->idGrupo = $idGrupo;\n }", "public function add(){\n $last_id = Ahkam::orderBy('id', 'desc')->first();\n \n if($last_id == null){\n $last_id = 1;\n } else {\n $last_id = Helper::extract_number($last_id->crida_number) + 1 ;\n }\n\n return view('Ahkam.add_ahkam',compact('last_id'));\n\n }", "function ocupa_reserva($id_desig){\n $sql=\"select * from reserva_ocupada_por where id_designacion=\".$id_desig;\n $res= toba::db('designa')->consultar($sql);\n if(count($res)>0){\n return true;\n }else{\n return false;\n }\n }", "function AddUSTIDPruefungKunde($kunde)\n {\n\n\n }", "public function inativarregistroAction()\n\t{\n\n\t}", "function getId(){ return $this->toString(); }", "public function controleIngeschreven()\n {\n $deelnemer = $this->authex->getDeelnemerInfo();\n $taakShiftId = $this->input->get('taakShiftId');\n $overeenkomsten = $this->HelperTaak_model->getAllWithTaakWhereDeelnemer($deelnemer->id, $taakShiftId);\n $aantal = count($overeenkomsten);\n if ($aantal > 0) {\n echo json_encode(true);\n }\n else {\n echo json_encode(false);\n }\n }", "public function obtenerViajesplusAbonados();", "public function picked(){\n }", "function afficher() {\r\n \r\n if($this->getEtat()){\r\n echo \"0\";\r\n }else{\r\n \r\n echo \"&nbsp\";\r\n }\r\n \r\n }", "function kembalikanInventory($id){\n return false;\n}", "public function modelDoAdd(){\n\t\t\t$tenphongban = $_POST[\"tenphongban\"];\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//chuan bi truy van\n\t\t\t$query = $conn->prepare(\"insert into phongban set tenphongban=:ten\");\n\t\t\t$query->execute(array(\"ten\"=>$tenphongban));\n\t\t}", "function initialiserId()\n {\n if(empty($this->m_idOption))\n {\n $requete = 'SELECT idOption FROM optionHotel WHERE libelleOption=? AND prixOption=?';\n $tabParametres = array($this->m_libelleOption, $this->m_prixOption);\n $tabResultat = $this->m_bdd->selection($requete, $tabParametres);\n $this->m_idOption = $tabResultat[0]['idOption']; \n }\n }", "function admin_bewerken($categorie_id = null)\n {\n if(!empty($this->data))\n\t\t\t{\n $this->Categorie->create();\n $this->Categorie->id = $categorie_id;\n\t\t\t\tif($this->Categorie->save($this->data))\n {\n $this->Session->setFlash('De categorie is succesvol toegevoegd', 'flash_success');\n $this->redirect('/admin/categorien/');\n }\n else\n {\n $this->Session->setFlash('Er is een fout opgetreden bij het opslaan', 'flash_error');\n }\n\t\t\t}\n else\n {\n $this->data = $this->Categorie->read(null, $categorie_id);\n }\n\n\t\t\t$this->set('lijst_categorien', $this->Categorie->getSelectList());\n }", "function cf_familias_seleccionadas(&$Sesion,&$aData) {\n\treturn !store_id_check($Sesion,$aData['Familia_articulos.id_familia']);\n}", "function CreateArbeitspaket($adressse, $aufgabe,$beschreibung,$projekt,$zeit_geplant,$kostenstelle,$initiator,$abgabedatum=\"\")\n {\n if(($abgabe != \"\") && ($beschreibung != \"\") && ($projekt != \"\") && ($zeit_geplant != \"\") && ($kostenstelle != \"\") && ($initiator != \"\")){\n $this->app->DB->Insert('INSERT INTO arbeitspakete (adresse, aufgabe, beschreibung, projekt, zeit_geplant, kostenstelle, initiator, abgabedatum) VALUES ( '.$adresse.',\"'.$aufgabe.'\", \"'.$beschreibung.'\", '.$projekt.', '.$zeit_geplant.','.$kostenstelle.', '.$initiator.',\"'.$abgabedatum.'\")');\n return 1;\n }else\n return 0;\n }", "public function chondethi($id){\n if($id == 0){\n echo \"<option>Đề Thi</option>\";\n foreach(dethi::all() as $dt){\n echo \"<option value='\".$dt->id.\"'>\".$dt->tendethi.\"</option>\";\n }\n }else{\n $nguoirade = nguoirade::find($id);\n $dethi = dethi::where('id_nguoirade', $nguoirade->id)->orderBy('id', 'desc')->get();\n echo \"<option>Đề Thi</option>\";\n foreach($dethi as $dt){\n echo \"<option value='\".$dt->id.\"'>\".$dt->tendethi.\"</option>\";\n }\n }\n\n }", "public function baseSlajderi()\n {\n \n $this->linija = Slajderi::model()->findAllByAttributes(array('jezik'=>Yii::app()->session[\"lang\"]),array('order'=>'id'));\n $this->nalovSlajderi = $this->linija[0] -> naslov;\n \n \n }", "public function attaquerAdversaire() {\n\n }" ]
[ "0.57115054", "0.5678979", "0.565852", "0.5616732", "0.56057906", "0.5602937", "0.5575824", "0.556212", "0.55381584", "0.5536021", "0.55273545", "0.5526215", "0.549859", "0.5472078", "0.5458182", "0.5400868", "0.53980863", "0.5370055", "0.53479534", "0.5340875", "0.53268486", "0.53216165", "0.531996", "0.5316066", "0.53122956", "0.5301278", "0.5286728", "0.52644616", "0.5260725", "0.52348953", "0.52203727", "0.52104217", "0.5196828", "0.5195987", "0.519572", "0.5189351", "0.5188059", "0.51877385", "0.5183622", "0.5178691", "0.5164525", "0.51560163", "0.5155588", "0.51532376", "0.5142948", "0.5140797", "0.5130119", "0.5127849", "0.5121346", "0.511723", "0.5115154", "0.51054", "0.5104007", "0.5103165", "0.51026505", "0.5094339", "0.5090443", "0.50870717", "0.5081813", "0.5080407", "0.5080023", "0.5079512", "0.5077777", "0.50722057", "0.5071689", "0.5070417", "0.5070211", "0.50692326", "0.5068507", "0.5067732", "0.50626886", "0.5059288", "0.50494194", "0.5039857", "0.5033952", "0.5028551", "0.5022308", "0.5018749", "0.5015743", "0.50153583", "0.5008617", "0.5005328", "0.5000512", "0.49974653", "0.49957073", "0.49926907", "0.49920428", "0.49910745", "0.4986516", "0.49832845", "0.49771652", "0.4973338", "0.49689078", "0.49653205", "0.49646503", "0.49627057", "0.49626413", "0.49621317", "0.49619606", "0.49565563", "0.4952088" ]
0.0
-1
TODO: ADD Exception if config is not configured TODO: Add check for auth with json file GenerateClientTask constructor.
public function __construct(Google_Client $client) { $this->client = $client; $this->apiKey = [ 'application' => Config::get("youtube-api.project_id"), 'redirectUri' => Config::get("youtube-api.redirect_uri"), 'client-id' => Config::get("youtube-api.client_id"), 'client-secret' => Config::get("youtube-api.client_secret") ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __construct()\n {\n parent::__construct();\n\n// if(!authCheck($this->post('auth'))){\n// returnFailedResponse();\n// exit();\n// }\n\n $this->check_auth_client = $this->tasks->check_auth_client();\n\n }", "public function __construct(){\n\t\t$this->client = new Client(['headers' => ['Authorization' => 'Bearer '.env('SENDGRID_API_KEY', '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'), 'Content-Type' => 'application/json']]);\n\t}", "private function getClient()\n {\n log_message('info', 'creating client START');\n $client = new Google_Client();\n $client->setAuthConfig($_SERVER['DOCUMENT_ROOT'].'/assets/client_secret.json');\n $client->addScope(Google_Service_Drive::DRIVE);\n $client->setAccessType('offline');\n $client->setPrompt('select_account consent');\n\n // Load previously authorized token from a file, if it exists.\n // The file token.json stores the user's access and refresh tokens, and is\n // created automatically when the authorization flow completes for the first\n // time.\n $tokenPath = 'token.json';\n if (file_exists($tokenPath)) {\n $accessToken = json_decode(file_get_contents($tokenPath), true);\n $client->setAccessToken($accessToken);\n }\n\n // If there is no previous token or it's expired.\n if ($client->isAccessTokenExpired()) {\n log_message('info', 'Access Token Expired');\n // Refresh the token if possible, else fetch a new one.\n if ($client->getRefreshToken()) {\n log_message('info', 'Refresh the token');\n $client->fetchAccessTokenWithRefreshToken($client->getRefreshToken());\n } else {\n log_message('info', 'ERROR: Need to Request authorization from the user');\n // // Request authorization from the user.\n // $authUrl = $client->createAuthUrl();\n // printf(\"Open the following link in your browser:\\n%s\\n\", $authUrl);\n // print 'Enter verification code: ';\n // $authCode = trim(fgets(STDIN));\n\n // // Exchange authorization code for an access token.\n // $accessToken = $client->fetchAccessTokenWithAuthCode($authCode);\n // $client->setAccessToken($accessToken);\n\n // // Check to see if there was an error.\n // if (array_key_exists('error', $accessToken)) {\n // throw new Exception(join(', ', $accessToken));\n // }\n return null;\n }\n // Save the token to a file.\n if (!file_exists(dirname($tokenPath))) {\n mkdir(dirname($tokenPath), 0700, true);\n }\n file_put_contents($tokenPath, json_encode($client->getAccessToken()));\n }\n log_message('info', 'creating client DONE');\n return $client;\n }", "private function setupClient() {\n\t\t$this->client = MeetupKeyAuthClient::factory( [\n\t\t\t'key' => $this->key\n\t\t] );\n\t}", "public function run()\n {\n factory(OauthClient::class,1)->create();\n }", "public function generate() {\n\n // Loop through all defined API configurations and make Client APIs where applicable\n $configurations = APIConfiguration::getAPIConfigs();\n\n\n foreach ($configurations as $configuration) {\n\n if ($configuration->getGeneratedClients()) {\n $this->generateAPI($configuration);\n }\n\n }\n\n }", "private function __construct() {\n\t\t$this->client_ids = array(\n\t\t\t'stolaf' => get_field( $this->service . '_stolaf_client_id', 'option' ),\n\t\t\t'carleton' => get_field( $this->service . '_carleton_client_id', 'option' ),\n\t\t);\n\t\t$this->client_secrets = array(\n\t\t\t'stolaf' => get_field( $this->service . '_stolaf_client_secret', 'option' ),\n\t\t\t'carleton' => get_field( $this->service . '_carleton_client_secret', 'option' ),\n\t\t);\n\n\t\tif ( empty( $this->client_ids ) || empty( $this->client_secrets ) ) {\n\t\t\tadd_action( 'admin_notices', array( $this, 'missing_api_keys' ) );\n\t\t}\n\n\t\trequire_once BL_PLUGIN_DIR . '/inc/class-libguides-11-async-process.php';\n\t\t$this->async = new LibGuides_11_Async_Process();\n\t}", "public function run()\n {\n $client = [\n 'id' => 'LavAngId',\n 'secret' => 'SeCrEt_WoRd',\n 'name' => 'LavAngAPP'\n ];\n\n OauthClient::create($client);\n }", "public function __construct() {\n $dotenv = new Dotenv();\n $dotenv->load(dirname(__DIR__).'/.env');\n\n $this->api = new Api($_ENV['CLODUI_API']);\n\n $client_id = $_ENV['CLODUI_CLIENT_ID'];\n $user_pool_id = $_ENV['CLODUI_USER_POOL_ID'];\n $identity_pool_id = $_ENV['CLODUI_IDENTITY_POOL_ID'];\n\n Logger::debug('Config Client ID '. $client_id. ', User pool id '. $user_pool_id. ', Identity pool id '. $identity_pool_id);\n $this->auth = new Auth($client_id, $user_pool_id, $identity_pool_id);\n }", "function __construct(){\n $nameFile = \"config.json\";\n \n // Check Excepctions.\n $this->exceptions = new myExceptions(\"Upps!\");\n $this->exceptions->findFile($nameFile);\n \n $data = file_get_contents($nameFile); \n $conecction = json_decode($data, true);\n \n // Check Data\n $this->exceptions->checkUserPass($conecction[\"conection\"]); \n \n $this->setConfiguration($conecction[\"conection\"][\"user\"]);\n $this->setConfiguration($conecction[\"conection\"][\"password\"]);\n \n }", "public function __construct($config = null, $client = null)\n {\n $this->client = $client ?: new Client();\n $this->configuration = $config ?: new Configuration();\n $execTime = (int)ini_get('max_execution_time');\n if ($execTime > 0 && $execTime < 500)\n {\n set_time_limit(500);\n }\n\n if (!$config->getOnPremise())\n {\n $this->requestToken();\n }\n }", "private function setupGuzzleClient() {\n $config = $this->getClientConfig();\n $this->client = $this->createGuzzleClient($config);\n }", "public function __construct()\n {\n $this->_baseDir = __DIR__;\n\n // Command line parser\n $this->_cmdParser = $parser = Console_CommandLine::fromXmlString($this->_cmdOptionsStructure);\n try {\n $cmdOptions = $parser->parse();\n if ($cmdOptions->command_name) {\n $this->_cmdOptions = $cmdOptions;\n $this->_cmdOptions->command_name = \"_{$this->_cmdOptions->command_name}\";\n } else {\n $parser->displayUsage();\n exit();\n }\n } catch (Exception $e) {\n $parser->displayError($e->getMessage());\n }\n\n // Load Config\n if (!$this->_cfg = $cfg = @json_decode(file_get_contents('config.json'), true)) {\n die($this->_fgColor('bold_red', \"\\nError: Could not read 'config.json'. Aborting.\\n\"));\n }\n\n // Logger\n $this->_log = new Logger('Tasks');\n $handler = new RotatingFileHandler(\"{$this->_baseDir}/log/report.log\", 10, Logger::INFO);\n $handler->setFormatter(new LineFormatter(\"[%datetime%] %level_name%: %message%\\n\"));\n $this->_log->pushHandler($handler);\n\n // Database\n $capsule = new Capsule;\n foreach ($cfg['databases'] as $k => $v) {\n $capsule->addConnection(\n [\n 'driver' => 'mysql',\n 'host' => $v['host'],\n 'database' => $v['database'],\n 'username' => $v['user'],\n 'password' => $v['password'],\n 'charset' => 'utf8',\n 'collation' => 'utf8_general_ci',\n 'prefix' => ''\n ],\n $k\n );\n }\n $capsule->setAsGlobal();\n\n // BitBucket Credentials\n $this->_bbApi = new Bitbucket\\API\\Api();\n $this->_bbApi->getClient()->addListener(\n new \\Bitbucket\\API\\Http\\Listener\\BasicAuthListener(\n $cfg['api']['bitbucket']['users']['admin']['user'],\n $cfg['api']['bitbucket']['users']['admin']['password']\n )\n );\n\n // Phonegap Build\n $this->_pgbApi = new PhonegapBuildApi($cfg['api']['pgb']['token']);\n\n // Stats\n $this->_report = array(\n 'Date & Time' => date('Y-m-d H:i:s'),\n 'Script Time' => 0,\n 'Method' => ''\n );\n }", "public function build()\n {\n // Resolve configuration\n $config = Collection::fromConfig(\n $this->config,\n array_merge(self::$commonConfigDefaults, $this->configDefaults),\n (self::$commonConfigRequirements + $this->configRequirements)\n );\n\n if ($config[Options::VERSION] === 'latest') {\n $config[Options::VERSION] = constant(\"{$this->clientClass}::LATEST_API_VERSION\");\n }\n\n if (!isset($config['endpoint_provider'])) {\n $config['endpoint_provider'] = RulesEndpointProvider::fromDefaults();\n }\n\n // Resolve the endpoint, signature, and credentials\n $description = $this->updateConfigFromDescription($config);\n $signature = $this->getSignature($description, $config);\n $credentials = $this->getCredentials($config);\n $this->extractHttpConfig($config);\n\n // Resolve exception parser\n if (!$this->exceptionParser) {\n $this->exceptionParser = new DefaultXmlExceptionParser();\n }\n\n // Resolve backoff strategy\n $backoff = $config->get(Options::BACKOFF);\n if ($backoff === null) {\n $backoff = $this->createDefaultBackoff();\n $config->set(Options::BACKOFF, $backoff);\n }\n\n if ($backoff) {\n $this->addBackoffLogger($backoff, $config);\n }\n\n /** @var AwsClientInterface $client */\n $client = new $this->clientClass($credentials, $signature, $config);\n $client->setDescription($description);\n\n // Add exception marshaling so that more descriptive exception are thrown\n if ($this->clientNamespace) {\n $exceptionFactory = new NamespaceExceptionFactory(\n $this->exceptionParser,\n \"{$this->clientNamespace}\\\\Exception\",\n \"{$this->clientNamespace}\\\\Exception\\\\{$this->serviceName}Exception\"\n );\n $client->addSubscriber(new ExceptionListener($exceptionFactory));\n }\n\n // Add the UserAgentPlugin to append to the User-Agent header of requests\n $client->addSubscriber(new UserAgentListener());\n\n // Filters used for the cache plugin\n $client->getConfig()->set(\n 'params.cache.key_filter',\n 'header=date,x-amz-date,x-amz-security-token,x-amzn-authorization'\n );\n\n // Set the iterator resource factory based on the provided iterators config\n $client->setResourceIteratorFactory(new AwsResourceIteratorFactory(\n $this->iteratorsConfig,\n new ResourceIteratorClassFactory($this->clientNamespace . '\\\\Iterator')\n ));\n\n // Disable parameter validation if needed\n if ($config->get(Options::VALIDATION) === false) {\n $params = $config->get('command.params') ?: array();\n $params['command.disable_validation'] = true;\n $config->set('command.params', $params);\n }\n\n return $client;\n }", "abstract public function initClient();", "public function run()\n {\n factory(OauthClients::class,10)->create();\n }", "public function __construct()\n {\n parent::__construct();\n $this->client_id = Tool::config('client_id');\n $this->client_secret = Tool::config('client_secret');\n $this->redirect_uri = Tool::config('redirect_uri');\n $this->authorize_url = Tool::config('app_type', 'com') === 'com'\n ? Constants::AUTHORITY_URL.Constants::AUTHORIZE_ENDPOINT\n : Constants::AUTHORITY_URL_21V.Constants::AUTHORIZE_ENDPOINT_21V;\n $this->access_token_url = Tool::config('app_type', 'com') === 'com'\n ? Constants::AUTHORITY_URL.Constants::TOKEN_ENDPOINT\n : Constants::AUTHORITY_URL_21V.Constants::TOKEN_ENDPOINT_21V;\n $this->scopes = Constants::SCOPES;\n }", "public function __construct()\n {\n $config = array(\n \"type\"=> \"service_account\",\n \"project_id\"=> \"driverapp-master-bb0a8\",\n \"private_key_id\"=> \"5133dcc7296c8d6c3c5344f2442ac8108958e788\",\n \"private_key\"=> \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDJxY02bLvVQMRN\\nSQRwQNjjzzYKx3CTvb418mmg60TYiFCjx8U9EO4JrqtEl6rbttKC55gYD7TTUH3c\\nPQMfhKybk4wEBRYFDtNAVNVlQW+W3EzqoN2sXxCaDbr644CAGW40GIq+MSo+HGxU\\n13TifJ4FB3lCj2xSLY7XtaUAiyCZ9AiW/wlFd5GuF+gjIagkb2kPGuocg9WM1qvs\\nWTDxtIcubnmQXz2xOATnIS1c9s4oNcI7DxfdTxSzB9AZ0bZUvTF+OzEGIz3gARqq\\nlqDyE+LejdBtm18q0uHFSRKrtmfRnr8GWpe1QpoKIZ/kTEKpdlUYGUC97mZFjo7S\\nify8LrV/AgMBAAECggEAGn5/v+VANszV2eYcGJdTQ3qaeIjere+s0c2edBxggmRH\\n3nGlYxLdhtTyNUQLEeWsN7csYABz+IlptWknh1R3C8iwiniWfxyGvbxF9xFEE1Wj\\nHe34naEv/2KNKlOENI3iTCHq2fV/u/8kdHGELhc58qQcFpLZoOLNjmKSI4OhSMWo\\nSS0s6pHF56H3cixgueCTwTAzURcIdvzfFo2PE0QrPbTEoC+0AA+hvfBTtS/Zf94A\\nulg5Eh6TBC1Qzjt6EyuVJ/HldmCRG97XUUY09q99szWmVLO1ANulYlCuRLGeTtlf\\nLWW1YRYJIWJfVVa8vnosl/HAWtt8FKPqJxV2SatobQKBgQDkVeEDiOpZm7ox3zqj\\nbFVv7rTLSjq9hZHk6Gh77oaxnOlmH4gih8mGh/z5Qyi4R9y5zXeOJHuJg72mnqsK\\nGEMZ5nVPpKwRE4N1mSPw0Y/uVeNmyVDhWFmdu9XIpj49XAGMXr54kLjQSZ1IoueE\\nB0WZ7cAxKYu5TzgTnIgQev4BZQKBgQDiN8M2bWpLj0xhlQvlA74e+Ti5YrQkVCiH\\nbi6vIJ9p2mc2qg0ysymxAFiWDAtvnvIhXJ83MI81IUSwWBWLHzMluPh8No10/DVw\\nlqkiqV/YEtJg4qCucar7qQEJsbODjpFQBfXZemE8DD3Q1LhwemOwI94K0Q/nCtWp\\ndHX9eZ3/EwKBgH7B5h5uPZrtRpo1EHp0w6FV5OwOEznvEqT/GDHkosWrFC7rRknV\\nE90pVRiTXeGfkztagwpX2nTmu7vpzY3XFjkkpO9HvXXlXU9Fapxf2gU3jPwcule/\\nElDsW6v+DgNGNl3UouyPeum2VChktx2mY88mG1GvfK+s+LZ6aVas0KG5AoGBAJtn\\nr2XOmL07vj8zQy6a+ZsRntRMaHCkmAshuFR61sjDTzCQdeykhDmigTjjIWAXE0Oz\\n+3TQmTDon+V9PZ+LWXnKrnm2iEsbkCK+fYbgUIWBuKDyT2xHjizAl4PvXeE8qbsN\\nvS0gE3hK+JRj7ijnC2DP4xQPNxuDp/B3ny74w3+dAoGBALjSMp+8nOxWE2sco4wS\\nIzOprQ10K54naiy6xx6VsNamaqe9r4KiXXT9qpSjfCg3yMD5swtWVIcwwk0VM8J3\\nj/8sgwfGCepyzcmXxZKqmJmfHlxr6Hd+/AA4Nm/MEbeWG+o3eMmZ4LzSS0sSH/fC\\nO+f511UqvJxT2UvDVRtJcO70\\n-----END PRIVATE KEY-----\\n\",\n \"client_email\"=> \"[email protected]\",\n \"client_id\"=> \"117555270648372527156\",\n \"auth_uri\"=> \"https://accounts.google.com/o/oauth2/auth\",\n \"token_uri\"=> \"https://oauth2.googleapis.com/token\",\n \"auth_provider_x509_cert_url\"=> \"https://www.googleapis.com/oauth2/v1/certs\",\n \"client_x509_cert_url\"=> \"https://www.googleapis.com/robot/v1/metadata/x509/driverapp-master-bb0a8%40appspot.gserviceaccount.com\"\n );\n\n\n $serviceAccount = ServiceAccount::fromArray($config);\n\n $firebase = (new Factory())\n ->withServiceAccount($serviceAccount)\n ->create();\n\n\n $this->database = $firebase->getDatabase();\n $this->middleware('guest');\n }", "public function run()\n {\n $data = [\n [\n 'name' => 'Mariel',\n 'address' => 'Manila',\n 'phone' => '0912345678',\n 'capitalization' => 20000,\n 'loan' => 10000\n ],\n [\n 'name' => 'Mary',\n 'address' => 'Cebu',\n 'phone' => '0945621157',\n 'capitalization' => 40000,\n 'loan' => 300000\n ],\n [\n 'name' => 'Maria',\n 'address' => 'Tagbilara',\n 'phone' => '0915454511',\n 'capitalization' => 50000,\n 'loan' => 500000\n ],\n ];\n\n foreach($data as $client) {\n \\App\\Client::create($client);\n }\n }", "public function __construct()\n {\n $this->client = new Client([\n 'base_uri' => config('tpay.end_point_url') . '/api/t-pay/v1/oauth2/',\n 'timeout' => config('tpay.timeout'),\n 'connect_timeout' => config('tpay.connect_timeout'),\n 'protocols' => ['http', 'https'],\n ]);\n $this->accessToken;\n }", "abstract public function generateConfiguration();", "public function run() {\n factory(App\\Client::class, 10)->create();\n }", "public function __construct()\n {\n\n // For Authenticating with Login Credentials\n\n //$this->username = config('whmcs.username');\n //$this->password = config('whmcs.password');\n\n // For Authenticating with API Credentials\n\n $this->api_identifier = config('whmcs.api_identifier');\n $this->api_secret = config('whmcs.api_secret');\n\n $this->api_access_key = config('whmcs.api_access_key');\n\n $this->response_type = strtolower(config('whmcs.response_type'));\n\n $this->client = new Client([\n 'base_uri' => config('whmcs.url'),\n 'timeout' => config('whmcs.timeout'),\n 'headers' => ['Accept' => 'application/json']\n ]);\n }", "public function run()\n {\n $datetime = \\Carbon\\Carbon::now();\n\n // Client\n $clientId = 'ANGULAR_APP';\n $client = DB::table('oauth_clients')->where('id', $clientId)->first();\n if ($client) {\n $secret = $client->secret;\n\n } else {\n DB::table('oauth_clients')->insert([\n 'id' => $clientId,\n 'name' => 'Autentication for Angular',\n 'secret' => $secret = str_random(20),\n 'created_at' => $datetime,\n 'updated_at' => $datetime,\n ]);\n }\n\n $constants = [\n 'BASE_PATH' => 'http://localhost:8000',\n 'API_URL' => 'http://localhost:8000',\n 'AUTH_SECURE' => false,\n 'BROADCAST_DRIVER' => config('broadcasting.default'),\n 'PUSHER_API_KEY' => config('broadcasting.connections.pusher.key'),\n 'FANOUT_REALM_ID' => config('broadcasting.connections.fanout.realm_id'),\n ];\n\n $path = base_path('env-config.json');\n if (File::exists($path)) {\n $atual = (array) @json_decode(File::get($path));\n $constants = array_merge($constants, $atual);\n }\n\n File::put(base_path('env-config.json'), str_replace('\\\\', '', json_encode($constants)));\n\n // Grant\n $grantId = 'password';\n $grant = DB::table('oauth_grants')->where('id', $grantId)->first();\n if (!$grant) {\n DB::table('oauth_grants')->insert([\n 'id' => $grantId,\n 'created_at' => $datetime,\n 'updated_at' => $datetime,\n ]);\n }\n\n // Client to Grant\n $clientGrant = DB::table('oauth_client_grants')\n ->where('client_id', $clientId)\n ->where('grant_id', $grantId)\n ->first();\n\n if (!$clientGrant) {\n DB::table('oauth_client_grants')->insert([\n 'client_id' => $clientId,\n 'grant_id' => $grantId,\n 'created_at' => $datetime,\n 'updated_at' => $datetime,\n ]);\n }\n }", "public function createClient(): Client;", "public function __construct()\n {\n $this->client = new Client();\n }", "public function __construct () {\n $options = getopt('', ['config_path:']);\n if (!array_key_exists('config_path', $options)) {\n $options['config_path'] = join(DIRECTORY_SEPARATOR,\n [$this->getHome(), 'shopping-samples']);\n }\n $this->configDir = join(DIRECTORY_SEPARATOR,\n [$options['config_path'], 'content']);\n $this->configFile = join(DIRECTORY_SEPARATOR,\n [$this->configDir, self::CONFIGFILE_NAME]);\n if (file_exists($this->configFile)) {\n $this->config = json_decode(file_get_contents($this->configFile));\n } else {\n throw new InvalidArgumentException(sprintf('Could not find or read the '\n . 'config file at %s. You can use the merchant-info.json file in the '\n . 'samples root as a template.', $this->configFile));\n }\n\n if (!$this->config) {\n throw new InvalidArgumentException(sprintf('The config file at %s is not '\n . 'valid JSON format. You can use the merchant-info.json file in the '\n . 'samples root as a template.', $this->configFile));\n }\n\n $client = new Google_Client();\n $client->setApplicationName($this->config->applicationName);\n $client->setScopes(Google_Service_ShoppingContent::CONTENT);\n $this->authenticate($client);\n\n $this->merchantId = $this->config->merchantId;\n $this->websiteUrl = $this->config->websiteUrl;\n $this->prepareServices($client);\n $this->mcaStatus = $this->retrieveMCAStatus();\n }", "public function __construct()\n {\n $param = func_get_args();\n switch (count($param)) {\n case 0:\n $this->setupApiConfigFromEnv();\n $this->setupApiConfigFromFile();\n break;\n case 1:\n $this->setupApiConfigFromFile($param[0]);\n break;\n case 2:\n $this->api_key = $param[0];\n $this->api_secret = $param[1];\n break;\n default:\n throw new ApiConstructorException('Invalid constructor parameters.');\n }\n $this->client = new Client(['base_uri' => self::BASE_URI, 'timeout' => self::TIMEOUT]);\n }", "public function run()\n {\n // Default Users (with their roles) ---------------------------------------------\n Apiato::call('User@CreateUserByCredentialsTask', [\n 'Super Admin',\n 'admin',\n '[email protected]',\n $isClient = false,\n ])->assignRole(Apiato::call('Authorization@FindRoleTask', ['admin']));\n\n Apiato::call('User@CreateUserByCredentialsTask', [\n 'Test Customer',\n 'testCustomer',\n '[email protected]',\n $isClient = false,\n ])->assignRole(Apiato::call('Authorization@FindRoleTask', ['customer']));\n\n Apiato::call('User@CreateUserByCredentialsTask', [\n 'Test Freelancer',\n 'testFreelancer',\n '[email protected]',\n $isClient = false,\n ])->assignRole(Apiato::call('Authorization@FindRoleTask', ['freelancer']));\n\n Apiato::call('User@CreateUserByCredentialsTask', [\n 'Test Project Manager',\n 'testProjectManager',\n '[email protected]',\n $isClient = false,\n ])->assignRole(Apiato::call('Authorization@FindRoleTask', ['project-manager']));\n\n Apiato::call('User@CreateUserByCredentialsTask', [\n 'Test CEO',\n 'testCeo',\n '[email protected]',\n $isClient = false,\n ])->assignRole(Apiato::call('Authorization@FindRoleTask', ['ceo']));\n // ...\n\n }", "public function __construct()\n {\n $this->client = new Client([\n 'base_uri' => config('app.url'),\n ]);\n }", "public function __construct($config, \\GuzzleHttp\\Client $client = null)\n {\n $this->config($config);\n\n $this->client = $client ?? new \\GuzzleHttp\\Client();\n }", "public function generate()\n {\n $soapClientOptions = $this->getSoapClientOptions();\n $config = $this->getGeneratorConfig($soapClientOptions);\n $generator = $this->getGenerator();\n $generator->generate($config);\n }", "function __construct()\n {\n //include_once(__DIR__ . '/Assets/nusoap.php');\n\n\n $this->merchant_id = config('saderat.merchant_id');\n $this->terminal_id = config('saderat.terminal_id');\n // set default invoice number\n $this->setInvoiceNumber(static::uniqueID());\n\n /**\n * get key resource to start based on public key\n */\n if (!$public_key = @file_get_contents(__DIR__ . '/Assets/merchant_public_key.txt'))\n throw new \\Exception('خطای دریافت کلید عمومی');\n\n if (!config()->has('saderat.private_key'))\n throw new \\Exception('تنظیمات مربوط به کلید خصوصی یافت نشد.');\n\n $this->private_key =\n '-----BEGIN PRIVATE KEY-----' . PHP_EOL .\n trim(config('saderat.private_key')) . PHP_EOL .\n '-----END PRIVATE KEY-----';\n\n $this->key_resource = openssl_get_publickey($public_key);\n }", "function __construct() {\n if (!file_exists($this->configuration_file_path)) {\n \n die(\"FATAL: Missing \" . $this->configuration_file_path . `pwd` );\n \n }\n \n $raw_contents = file_get_contents($this->configuration_file_path);\n\n\n //parse json object\n try {\n\n $this->Config = json_decode( $raw_contents );\n\n } catch (Exception $e) {\n\n die(\"FATAL: Bad configuration file? \");\n\n }\n \n\n }", "public function testThatClientIdIsRequired()\n {\n $env = self::getEnv();\n $api = new Authentication($env['DOMAIN'], $env['APP_CLIENT_ID'], $env['APP_CLIENT_SECRET']);\n\n try {\n $api->refresh_token( uniqid(), [ 'client_id' => '' ] );\n $caught_exception = false;\n } catch (ApiException $e) {\n $caught_exception = $this->errorHasString( $e, 'client_id is mandatory' );\n }\n\n $this->assertTrue( $caught_exception );\n }", "public function init()\n {\n $this->client = new Client(['base_uri' => Covalent::$host.\"/\".Covalent::$version.\"/\", 'auth' => [Covalent::$config['API_KEY'], ''], 'verify' => false ]);\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->httpClient = new Client([\n 'base_uri' => config('app.url'),\n 'headers' => [\n 'Authorization' => $this->apiKey,\n ],\n ]);\n }", "public function __construct() {\n global $apiConfig;\n if (! empty($apiConfig['developer_key'])) {\n $this->developerKey = $apiConfig['developer_key'];\n }\n if (! empty($apiConfig['oauth2_client_id'])) {\n $this->clientId = $apiConfig['oauth2_client_id'];\n }\n if (! empty($apiConfig['oauth2_client_secret'])) {\n $this->clientSecret = $apiConfig['oauth2_client_secret'];\n }\n if (! empty($apiConfig['oauth2_redirect_uri'])) {\n $this->redirectUri = $apiConfig['oauth2_redirect_uri'];\n }\n if (! empty($apiConfig['oauth2_access_type'])) {\n $this->accessType = $apiConfig['oauth2_access_type'];\n }\n if (! empty($apiConfig['oauth2_approval_prompt'])) {\n $this->approvalPrompt = $apiConfig['oauth2_approval_prompt'];\n }\n }", "public function __construct()\n {\n parent::setup();\n\n $this->client = new Client([\n \"base_uri\" => self::URL\n ]);\n }", "public function __construct()\n {\n \n // API accepts only POST request for now\n if ($_SERVER['REQUEST_METHOD'] != 'POST') {\n // echo \"Method is not post\";\n $this->throwException(REQUEST_METHOD_NOT_VALID, 'Request Method is not valid');\n }\n // open input stream from HTTP POST\n $input_stream = fopen('php://input', 'r');\n $this->request = stream_get_contents($input_stream);\n \n $this->validateRequest($this->request);\n \n // generate user object\n $this->user = new user();\n \n \n // Switch-case to handle different type request\n // Probalby best practice is list all cases here, so not a single service(function) is available without intend\n switch ($this->serviceName) \n {\n\n case \"validateAccessToken\":\n $this->validateAccessToken();\n break;\n case \"validateRefreshToken\":\n $this->validateRefreshToken();\n break;\n case \"generateToken\":\n //\n break;\n case \"getUserPermById\":\n $this->validateAccessToken();\n $this->getUserPermById();\n break;\n // list all authorization needed services here\n case \"startProcessingImages\":\n case \"getEventCodes\":\n case \"editEvent\":\n case \"getEventList\":\n case \"eventFromHashId\":\n case \"printUnusedCodes\":\n case \"clearUnusedCodes\":\n case \"generateCodes\":\n case \"getUnusedCodes\":\n case \"getUsedCodes\":\n case \"deleteUser\":\n case \"addUser\":\n case \"editUser\":\n case \"getUsers\":\n case \"getPermissions\":\n case \"getRoles\":\n case \"testAuthorization\":\n $this->validateAccessToken();\n break;\n // These request do not require authorization\n // Carefully add functions here\n case \"getGallery\":\n case \"isGalleryAvailable\":\n break;\n default:\n //If service is allready implemented but not list above we get this error\n $this->throwException(API_DOES_NOT_EXIST, \"API does not exist.\");\n }\n \n }", "public function __construct($config = null)\n {\n $clientId = is_null($config)? ApiInfos::$CLIENT_ID: $config->getCLIENTID();\n $secret = is_null($config)? ApiInfos::$SECRET_ID: $config->getSECRETID();\n $this->setClientId($clientId);\n $this->setClientSecret($secret);\n $this->getTokenFromConsumerKey();\n }", "protected function setUp(): void\n {\n parent::setUp();\n config([\"services.{$this->provider}.client_id\" => $this->faker->uuid]);\n config([\"services.{$this->provider}.client_secret\" => $this->faker->uuid]);\n }", "function getClient()\n \t\t {\n \t\t $client = new Google_Client();\n \t\t $client->setApplicationName('Google Calendar API PHP Quickstart');\n \t\t $client->setScopes(Google_Service_Calendar::CALENDAR_READONLY);\n \t\t $client->setAuthConfig(__DIR__ .'/credentials.json');\n \t\t $client->setAccessType('offline');\n \t\t $client->setPrompt('select_account consent');\n\n \t\t // Load previously authorized token from a file, if it exists.\n \t\t // The file token.json stores the user's access and refresh tokens, and is\n \t\t // created automatically when the authorization flow completes for the first\n \t\t // time.\n \t\t $tokenPath = 'token.json';\n \t\t if (file_exists($tokenPath)) {\n \t\t $accessToken = json_decode(file_get_contents($tokenPath), true);\n \t\t $client->setAccessToken($accessToken);\n \t\t }\n\n \t\t // If there is no previous token or it's expired.\n \t\t if ($client->isAccessTokenExpired()) {\n \t\t // Refresh the token if possible, else fetch a new one.\n \t\t if ($client->getRefreshToken()) {\n \t\t $client->fetchAccessTokenWithRefreshToken($client->getRefreshToken());\n \t\t } else {\n \t\t // Request authorization from the user.\n \t\t $authUrl = $client->createAuthUrl();\n \t\t printf(\"Open the following link in your browser:\\n%s\\n\", $authUrl);\n \t\t print 'Enter verification code: ';\n \t\t $authCode = trim(fgets(STDIN));\n\n \t\t // Exchange authorization code for an access token.\n \t\t $accessToken = $client->fetchAccessTokenWithAuthCode($authCode);\n \t\t $client->setAccessToken($accessToken);\n\n \t\t // Check to see if there was an error.\n \t\t if (array_key_exists('error', $accessToken)) {\n \t\t throw new Exception(join(', ', $accessToken));\n \t\t }\n \t\t }\n \t\t // Save the token to a file.\n \t\t if (!file_exists(dirname($tokenPath))) {\n \t\t mkdir(dirname($tokenPath), 0700, true);\n \t\t }\n \t\t file_put_contents($tokenPath, json_encode($client->getAccessToken()));\n \t\t }\n \t\t return $client;\n \t\t }", "public function testCreateTask()\n {\n }", "public function __construct()\n {\n parent::__construct();\n \trequire_once APPPATH . 'third_party/GuzzleHttp/functions_include.php';\n\t\trequire_once APPPATH . 'third_party/GuzzleHttp/Psr7/functions_include.php';\n\t\trequire_once APPPATH . 'third_party/GuzzleHttp/Promise/functions_include.php';\n\t\trequire_once APPPATH . 'third_party/Psr/bootstrap.php';\n\t\trequire_once APPPATH . 'third_party/GuzzleHttp/bootstrap.php';\n\t\trequire_once APPPATH . 'third_party/Mailjet/bootstrap.php';\n\t\t$APIPublicKey = 'ec4f81b2894ce3aeb5f987effcf10fd5';\n\t\t$APISecretKey = '80fc6f04059c6c5231924f124c351041';\n\t\t$this->mailjet = new Mailjet\\Client($APIPublicKey, $APISecretKey);\n\t\t//$this->FromEmail = '[email protected]';\n\t\t//$this->FromName = 'Economicar';\n }", "public function generateClientToken(){\n\n $gateway = $this->getGateway();\n $clientToken = $gateway->clientToken()->generate();\n\n return $clientToken;\n\n }", "public function getClient() {}", "public function createConfig()\n\t{\n\t}", "protected function configure()\n {\n $this->addArgument(\n 'environment', InputArgument::REQUIRED | InputArgument::OPTIONAL, 'What environment to run the script in',\n 'production'\n );\n $this->_httpClient = new Client();\n }", "public function __construct(array $config)\n {\n \t$this->_client=new RestClient([\n 'base_uri' => $config['base_uri'],\n 'app_id' => $config['app_id'], 'app_secret' => $config['app_secret'],\n ]);\n }", "public function __construct()\n {\n $this->httpClient = new Client(['handler' => $this->setHandler(self::$connection->getAuthorizationToken())]);\n }", "public function __construct()\n {\n $this->client = new Client([\n 'base_uri' => config('sportmonks.api_url'),\n 'verify' => app('env') !== 'production' ? false : true,\n ]);\n\n $this->apiToken = config('sportmonks.api_token');\n\n if (empty($this->apiToken)) {\n throw new \\InvalidArgumentException('No API token set');\n }\n\n $this->timezone = !empty(config('sportmonks.timezone'))\n ? config('sportmonks.timezone')\n : config('app.timezone');\n\n $this->withoutData = !empty(config('sportmonks.skip_data'))\n ? config('sportmonks.skip_data')\n : false;\n }", "public function run()\n {\n Client::factory()\n ->state([\n 'name' => 'Client 1',\n 'permission' => Fund::TYPES\n ])\n ->create();\n Client::factory()\n ->state([\n 'name' => 'Client 2',\n 'permission' => ['VC', 'RE']\n ])\n ->create();\n Client::factory()\n ->state([\n 'name' => 'Client 3',\n 'permission' => ['PL', 'PC']\n ])\n ->create();\n }", "public function init()\n {\n parent::init();\n $config = \\Yii::$app->params['idBrokerConfig'];\n $this->client = new IdBrokerClient(\n $config['baseUrl'],\n $config['accessToken'],\n [\n IdBrokerClient::TRUSTED_IPS_CONFIG => $config['validIpRanges'] ?? [],\n IdBrokerClient::ASSERT_VALID_BROKER_IP_CONFIG => $config['assertValidBrokerIp'] ?? true,\n 'http_client_options' => [\n 'timeout' => 10, // An (optional) custom HTTP timeout, in seconds.\n ],\n ]\n );\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\tif (isset($this->config->api['tinychat'], $this->config->api['tinychat']['public_key'], $this->config->api['tinychat']['secret_key']))\n\t\t{\n\t\t\t$this->public_key = $this->config->api['tinychat']['public_key'];\n\t\t\t$this->secret_key = $this->config->api['tinychat']['secret_key'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception('Unable to load TinyChat configuration.');\n\t\t}\n\t}", "public static function factory($config = array())\n {\n $client = ClientBuilder::factory(__NAMESPACE__)\n ->setConfig($config)\n ->setConfigDefaults(array(\n Options::VERSION => self::LATEST_API_VERSION,\n Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/cognitoidentity-%s.php',\n ))\n ->setExceptionParser(new JsonQueryExceptionParser)\n ->build();\n\n // Attach a listener to prevent some requests from being signed\n $client->getEventDispatcher()->addListener('command.before_send', function (Event $event) {\n /** @var AbstractCommand $command */\n $command = $event['command'];\n if (in_array($command->getName(), array('GetId', 'GetOpenIdToken', 'UnlinkIdentity'))) {\n /** @var EventDispatcher $dispatcher */\n $dispatcher = $command->getRequest()->getEventDispatcher();\n foreach ($dispatcher->getListeners('request.before_send') as $listener) {\n if (is_array($listener) && $listener[0] instanceof SignatureListener) {\n $dispatcher->removeListener('request.before_send', $listener);\n break;\n }\n }\n }\n });\n\n return $client;\n }", "public function __construct() {\n\t\t$client = new \\GuzzleHttp\\Client;\n\t\t$this->client = $client;\n\n\t\t$response = $this->client->request('POST', 'http://api.thingsee.com/v2/accounts/login', \n\t\t\t['json' => \n\t\t\t\t[\n\t\t\t\t\t'email' => Config::get('thingsee.email'), \n\t\t\t\t\t'password' => Config::get('thingsee.password')\n\t\t\t\t]\n\t\t\t]);\n\n\t\t// Obsolete, 401 and 500 will be caught in the calling function\n\t\t$statusCode = $response->getStatusCode();\n\n\t\t$data = json_decode($response->getBody(), true);\n\t\t$this->accountAuthToken = $data['accountAuthToken'];\n\t}", "public function __construct(\n ClientConfigInterface $clientConfig,\n \\GuzzleHttp\\ClientInterface $guzzleClient,\n AccessTokenGeneratorInterface $accessTokenGenerator\n ) {\n $this->clientConfig = $clientConfig;\n $this->guzzleClient = $guzzleClient;\n $this->tokenGenerator = $accessTokenGenerator;\n }", "public function __construct(){\n $this->transcoderClient = ElasticTranscoderClient::factory(array(\n 'key' => AppConfig::getAwsKey(),\n 'secret' => AppConfig::getAwsSecret(),\n 'region' => 'us-east-1'\n ));\n }", "public function init( $config )\n {\n $this->_config = $config;\n\n // Application Slug - required\n if( !$config['slug'] || empty( $config['slug'] ))\n {\n throw new Exception(\"You must provid your Application's slug\");\n }\n\n $this->_slug = $config['slug'];\n\n //\n if( empty( $config['url'] ) )\n {\n throw new Exception( 'The URL must be set to connect to Tapioca Rest API' );\n }\n\n $url = $config['url'];\n\n if( substr( $url, -1 ) != '/')\n {\n $url .= '/';\n }\n\n\n if( substr( $url, -4 ) != 'api/')\n {\n $url .= 'api/';\n }\n\n $url .= $this->_slug.'/';\n\n if( empty( $config['clientId'] ) )\n {\n throw new Exception( 'You must provide your Client Id' );\n }\n\n if( empty( $config['clientSecret'] ) )\n {\n throw new Exception( 'You must provide your Secret' );\n }\n\n static::$rest = new GuzzleClient( $url, array(\n 'key' => $config['clientId']\n ));\n\n // set cache config\n if( is_array( $config['cache'] ) && $config['cache']['path'] )\n {\n try\n {\n //Make sure it exists and is writeable \n $this->_cache = new Cache( $config['cache']['path'] );\n }\n catch( TapiocaCacheException $e )\n {\n throw new Exception( $e->getMessage() );\n }\n }\n\n if( !is_array( $config['collections'] ) )\n {\n throw new Exception('Collections name must be an array');\n }\n\n // Set `apps` collection name\n if( isset( $config['collections']['apps'] ) && !empty( $config['collections']['apps'] ))\n {\n static::$appCollection = $config['collections']['apps'];\n }\n else\n {\n throw new Exception('Apps collections name must be provided');\n }\n\n // Set `library` collection name\n if( isset( $config['collections']['library'] ) && !empty( $config['collections']['library'] ))\n {\n static::$libraryCollection = $config['collections']['library'];\n }\n else\n {\n throw new Exception('Library collections name must be provided');\n }\n\n // Set `previews` collection name\n if( isset( $config['collections']['previews'] ) && !empty( $config['collections']['previews'] ))\n {\n static::$previewCollection = $config['collections']['previews'];\n }\n else\n {\n throw new Exception('Previews collections name must be provided');\n }\n\n if( $config['fileStorage'] )\n {\n $this->_fileStorage = $config['fileStorage'];\n\n if( substr( $this->_fileStorage, -1 ) != '/')\n {\n $this->_fileStorage .= '/';\n }\n\n $this->_fileStorage .= $this->_slug.'/';\n }\n\n // allow to pass app's data via config\n // usefull in shared environment/reduce remote query\n if( isset( $config['app'] ) && is_array( $config['app'] ))\n {\n $this->_app = $config['app'];\n }\n\n $this->reset();\n }", "public function __construct()\n {\n $this->client = GuzzleFactory::make([\n 'base_uri' => 'https://min-api.cryptocompare.com/',\n ]);\n }", "protected function initServiceClient()\n {\n if ($this->httpClient === null) {\n $this->initHttpClients();\n }\n\n $serviceDescription = new Description($this->config->getServiceDescriptionConfig());\n $serviceClient = new GuzzleClient($this->getHttpClient(), $serviceDescription);\n\n foreach ($this->config->getClientDefaultsConfig() as $option => $value) {\n $serviceClient->setConfig($option, $value);\n }\n\n $this->description = $serviceDescription;\n $this->serviceClient = $serviceClient;\n }", "public function run()\n {\n // Default user\n\n $user = User::first();\n\n Client::insert([\n // Authorization Code grant client\n\n [\n 'id' => '229f9dfd-8a91-4dfa-90db-00ba966ed1ef',\n 'user_id' => $user->id,\n 'name' => 'dev-auth-code-grant-client',\n 'secret' => 'BZQVA2FBPNPhAc0BtqCjndQVSA1TQUJMzJADJrdt',\n 'redirect' => '',\n 'personal_access_client' => false,\n 'password_client' => false,\n 'revoked' => false,\n 'created_at' => now(),\n 'updated_at' => now(),\n ],\n\n // Password grant client\n\n [\n 'id' => '1bf0b03e-1c62-45e3-bf18-c5989cb43dde',\n 'user_id' => $user->id,\n 'name' => 'dev-password-grant-client',\n 'secret' => 'S8xqNQxus0L4cCJA8lQ4nKLayIQjfc4YOXz9MSWp',\n 'redirect' => '',\n 'personal_access_client' => false,\n 'password_client' => true,\n 'revoked' => false,\n 'created_at' => now(),\n 'updated_at' => now(),\n ],\n ]);\n\n // Personal access token client\n\n $client = new Client();\n // $client->id = '84031037-7d29-491a-99ac-340ff14e1001';\n $client->user_id = $user->id;\n $client->name = 'dev-personal-client';\n $client->secret = 'ViSqJ6if7ZgUK6ysaBZF61MKb8bYPRIdjOTzK7oT';\n $client->redirect = '';\n $client->personal_access_client = true;\n $client->password_client = false;\n $client->revoked = false;\n $client->save();\n\n $personal_client = new PersonalAccessClient();\n $personal_client->client()->associate($client);\n $client->save();\n }", "function getClientInfo() {\n $client = new Google_Client();\n $client->setApplicationName(APPLICATION_NAME);\n $client->setScopes(SCOPES);\n// $client->setAuthConfig(CLIENT_SECRET);\n $client->setAuthConfigFile(CLIENT_SECRET_PATH);\n $client->setAccessType('offline');\n // Load previously authorized credentials from a file.\n $credentialsPath = $this->expandHomeDirectory(CREDENTIALS_PATH);\n if (file_exists($credentialsPath)) {\n $accessToken = file_get_contents($credentialsPath);\n } else {\n // Request authorization from the user.\n $authUrl = $client->createAuthUrl();\n printf(\"Open the following link in your browser:\\n%s\\n\", $authUrl);\n print 'Enter verification code: ';\n $authCode = trim(fgets(STDIN));\n\n // Exchange authorization code for an access token.\n $accessToken = $client->authenticate($authCode);\n\n // Store the credentials to disk.\n if(!file_exists(dirname($credentialsPath))) {\n mkdir(dirname($credentialsPath), 0700, true);\n }\n file_put_contents($credentialsPath, $accessToken);\n printf(\"Credentials saved to %s\\n\", $credentialsPath);\n }\n $client->setAccessToken($accessToken);\n // Refresh the token if it's expired.\n if ($client->isAccessTokenExpired()) {\n $client->refreshToken($client->getRefreshToken());\n file_put_contents($credentialsPath, $client->getAccessToken());\n }\n return $client;\n }", "protected function getGmailClient()\n\t{\n\t\t$client = new \\Google_Client();\n\t\t$client->addScope(\"https://mail.google.com/\");\n\t\t$client->addScope(\"https://www.googleapis.com/auth/gmail.compose\");\n\t\t$client->addScope(\"https://www.googleapis.com/auth/gmail.modify\");\n\t\t$client->addScope(\"https://www.googleapis.com/auth/gmail.readonly\");\n\t\t// Load previously authorized credentials from a file.\n\t\tif (file_exists($this->csFileName))\n\t\t{\n\t\t\t$client->setAuthConfig($this->csFileName);\n\t\t} else\n\t\t{\n// @todo THROW ERROR HERE - Client Id and Client Secret file with other needed settings for the Google_Client.\n\t\t}\n\t\t$client->setAccessType('offline');\n\t\t$client->setApprovalPrompt('force');\n\n\t\t// Load previously authorized credentials from a file.\n\t\tif (file_exists($this->creditialsFileName))\n\t\t{\n\t\t\t$accessToken = json_decode(file_get_contents($this->creditialsFileName), TRUE);\n\t\t} else\n\t\t{\n//\n// @todo THROW ERROR HERE - ACCOUNT NEEDS TO BE REAUTHORIZED\n//\n//\t\t $authUrl = $client->createAuthUrl(); // THIS NEEDS TO BE OUTPUT SOME HOW\n//\t SEE IF A AWS ALERT CAN BE CREATED TO ALERT USERS OF THE ISSUE.\n//\n// Exchange authorization code for an access token.\n//\t\t $accessToken = $client->authenticate('4/AABblIyBIy9VBVq60Ulfb2WHS8PodHtj6cN88i5Dzt3SCX7lRirmjrc');\n//\n//\t THE CODE FROM THE createAuthUrl needs to be put in a file and read by the line above.\n//\n//\t THE CODE BELOW MAY OR MAYNOT BE NEEDED\n// Store the credentials to disk.\n//\t\t if(!file_exists(dirname($credentialsPath)))\n// {\n//\t\t\t mkdir(dirname($credentialsPath), 0700, true);\n//\t\t }\n//\t\t file_put_contents($credentialsPath, json_encode($accessToken));\n\t\t}\n\t\t$client->setAccessToken($accessToken);\n\n\t\t// Refresh the token if it's expired.\n\t\tif ($client->isAccessTokenExpired())\n\t\t{\n\t\t\tfile_put_contents($this->creditialsFileName, json_encode($client->getAccessToken($client->getRefreshToken())));\n\t\t}\n\t\treturn $client;\n\t}", "public function testCreate(): void\n {\n $factory = new ClientFactory(\n $cache = $this->createMock(CacheItemPoolInterface::class),\n $logger = new BufferingLogger()\n );\n\n $client = $factory->create(\n [\n 'client_id' => uniqid(),\n 'client_secret' => uniqid(),\n 'project' => uniqid(),\n 'scope' => ['manage_project']\n ],\n [\n 'locale' => 'de',\n 'languages' => ['de']\n ]\n );\n\n static::assertInstanceOf(Client::class, $client);\n }", "protected function setUp(): void\n\t{\n\t\t$this->httpClient = new \\GuzzleHttp\\Client(\\App\\Utils::merge(\\App\\RequestHttp::getOptions(), [\n\t\t\t'base_uri' => \\App\\Config::main('site_URL') . 'webservice/ManageConsents/',\n\t\t\t'Content-Type' => 'application/json',\n\t\t\t'Accept' => 'application/json',\n\t\t\t'timeout' => 60,\n\t\t\t'connect_timeout' => 60,\n\t\t\t'http_errors' => false,\n\t\t\t'headers' => [\n\t\t\t\t'x-raw-data' => 1,\n\t\t\t],\n\t\t]));\n\t}", "public function __construct()\n {\n\n $client = new Google_Client();\n $client->setAuthConfig('client_secret.json');\n $client->setAccessType(\"offline\"); // offline access\n $client->setIncludeGrantedScopes(true); // incremental auth\n $client->addScope(Google_Service_Calendar::CALENDAR);\n $client->setRedirectUri(url('oauth2callback'));\n\n $guzzleClient = new \\GuzzleHttp\\Client(array('curl' => array(CURLOPT_SSL_VERIFYPEER => false)));\n $client->setHttpClient($guzzleClient);\n\n $this->client = $client;\n }", "public function run()\n {\n $client=new ClientSetting;\n $client->client_name='app1';\n $client->client_token='123456';\n $client->client_service='helpdesk';\n $client->client_db_connection='mysql';\n $client->client_db_driver='mysql';\n $client->client_db_host='127.0.0.1';\n $client->client_db_port='3306';\n $client->client_db_database='helpdesk';\n $client->client_db_username='forethought';\n $client->client_db_password='123456';\n $client->client_db_prefix='';\n $client->save();\n // $client->client_='';\n \n\n // $client->secondary_logo_url='www.Mastechsecondrylogo.com';\n // $client->mnemonic_url='www.mnemonic_url.com';\n // $client->logo_usage='The Mastech Digital Logo is primary symbol which represents the Mastech Digital Brand and its subdiaries. The logotype is stylized to represent our modern take on the rapidly-evolving digital landscape.';\n // $logos->save();\n\n \n \n }", "public function __construct()\n {\n $this->http = new Client(['timeout' => 2]);\n $this->user = env('ZODOMUS_USER');\n $this->password = env('ZODOMUS_PASSWORD');\n $this->credentials = base64_encode($this->user . ':' . $this->password);\n $this->api_url = env('ZODUMUS_API_URL');\n }", "public function __construct()\n {\n // Get arguments passed\n if ($_SERVER['argv']) {\n \n // Get arguments passed to the script\n $_commands = $_SERVER['argv'];\n \n // Load the JSON config data\n $this->add_to_log('Load main JSON config file', self::CONF_FILE);\n $this->_config = $this->load_json_file(self::CONF_FILE);\n \n // Set default function using JSON config data\n $this->set_default_behaviour();\n \n // : Set default values to be used for fetching an MMS order from the DB\n $this->set_mms_customer_codes();\n $this->set_mms_status();\n // : End\n \n // Parse the arguments given and perform requested action\n $this->parseArguments($_commands);\n \n // Print log\n if ($this->_log && is_array($this->_log)) {\n foreach ($this->_log as $_key => $_value) {\n foreach ($_value as $_key_1 => $_value_1) {\n print(\"$_key_1: $_value_1\" . PHP_EOL);\n }\n print(PHP_EOL);\n }\n }\n } else {\n die(\"FATAL ERROR: This script must be run from a command line. \\$_SERVER['argv'] is empty.\" . PHP_EOL);\n }\n }", "private function initiateHttpClient()\n {\n $options = [\n 'headers' => [\n 'Content-Type' => 'application/json',\n 'Accept' => 'application/json',\n 'Authorization' => $this->apiKey,\n ]\n ];\n\n $this->httpClient = new GuzzleClient(array_replace_recursive($this->clientOptions, $options));\n }", "private function generateConfig() {\n $config_json = array(\n 'version' => '1.0.0',\n 'name' => $this->gateway_name,\n 'description' => '',\n 'authors' => [],\n 'currencies' => ['USD'],\n 'signup_url' => 'https://google.com'\n );\n\n foreach($config_json as $key => $value) {\n if($key == 'authors' && isset($this->config['authors'])) {\n foreach($this->config[\"authors\"] as $config_author) {\n $config_entry = array(\n \"name\" => \"\",\n \"url\" => \"\"\n );\n \n if(isset($config_author['name'])) {\n $config_entry[\"name\"] = $config_author['name'];\n \n if(isset($config_author[\"url\"])) {\n $config_entry[\"url\"] = $config_author['url'];\n }\n $config_json[\"authors\"][] = $config_entry;\n }\n }\n }\n else {\n if(isset($this->config[$key])) {\n $config_json[$key] = $this->config[$key];\n }\n }\n }\n\n return json_encode($config_json);\n }", "protected function createToken()\n {\n if ($this->client->getRefreshToken()) {\n $this->client->fetchAccessTokenWithRefreshToken($this->client->getRefreshToken());\n } else {\n // Request authorization from the user.\n $authUrl = $this->client->createAuthUrl();\n printf(\"Open the following link in your browser:\\n%s\\n\", $authUrl);\n print 'Enter verification code: ';\n $authCode = trim(fgets(STDIN));\n\n // Exchange authorization code for an access token.\n $accessToken = $this->client->fetchAccessTokenWithAuthCode($authCode);\n $this->client->setAccessToken($accessToken);\n\n // Check to see if there was an error.\n if (array_key_exists('error', $accessToken)) {\n throw new Exception(join(', ', $accessToken));\n }\n }\n // Save the token to a file.\n if (!file_exists(dirname($this->token))) {\n mkdir(dirname($this->token), 0700, true);\n }\n file_put_contents($this->token, json_encode($this->client->getAccessToken()));\n }", "public function run()\n {\n // Seed app client 1\n factory(App\\Models\\OAuthClient::class)->create([\n 'id' => '6fC2745co07D4yW7X9saRHpJcE0sm0MT',\n 'secret' => 'KLqMw5D7g1c6KX23I72hx5ri9d16GJDW',\n 'name' => 'App 1'\n ]);\n\n // Seed app client 2\n factory(App\\Models\\OAuthClient::class)->create([\n 'id' => '4dJn65Dwvau4cj97a9BFEGrpJPl5E4t3',\n 'secret' => '8d5LY0WDd4S26Wlbgb6JFcvh0OJ52ENu',\n 'name' => 'App 2'\n ]);\n }", "private function generateCredentials()\n {\n $key = $this->engine->config->get('roamtechapi.client_id');\n $secret = $this->engine->config->get('roamtechapi.client_secret');\n\n return [\n 'client_id' => $key,\n 'client_secret' => $secret,\n 'grant_type' => 'client_credentials'\n ];\n }", "public function __construct()\n {\n parent::__construct();\n $this->client =new Client(); \n }", "public function run()\n {\n $client = new Client();\n $client->category = 'Client';\n $client->referral_type = 'Google';\n $client->first_name = 'John';\n $client->middle_initial = 'B';\n $client->last_name = 'Smith';\n $client->occupation = 'Sales';\n $client->dob = '02/08/1965';\n $client->email = '[email protected]';\n $client->cell_phone = '528-965-7456';\n $client->work_phone = '528-965-7456';\n $client->has_spouse = 1;\n $client->spouse_first_name = 'Jane';\n $client->spouse_middle_initial = 'R';\n $client->spouse_last_name = 'Smith';\n $client->spouse_occupation = 'Dentist';\n $client->spouse_dob = '02/08/1965';\n $client->spouse_email = '[email protected]';\n $client->spouse_cell_phone = '528-965-7456';\n $client->spouse_work_phone = '528-965-7456';\n $client->street_address = 'Hwy 963';\n $client->city = 'City';\n $client->state = 'ST';\n $client->postal_code = '45698';\n $client->save();\n\n\n }", "public function getconfig()\r\n\t{\r\n\t\t// define('SCOPES', implode(' ', array(\r\n\t\t// Google_Service_Calendar::CALENDAR,'https://www.googleapis.com/auth/userinfo.email')\r\n\t\t// ));\r\n\t\t$hostName = $_SERVER['HTTP_HOST'];\r\n $protocol = isset($_SERVER['HTTPS']) ? 'https://' : 'http://';\r\n \t$server = $protocol.$hostName;\r\n\t\t\r\n\t\t$google_client = new Google_Client();\r\n\t\t$google_client->setApplicationName('Medicloud');\r\n\t\t$google_client->setRedirectUri($server.'/app/gcal/getClientToken');\r\n\t\t// $google_client->setRedirectUri('http://localhost/medicloud_v003/public/app/gcal/getClientToken');\r\n\t\t// $google_client->setRedirectUri('http://ec2-54-255-185-218.ap-southeast-1.compute.amazonaws.com/nuclei_mc_r1/public/app/gcal/getClientToken');\r\n\t\t// $google_client->setClientId('435398632542-oe70nsqe1mtpd5j1gteeb4anp4v5p315.apps.googleusercontent.com');\r\n\t\t// $google_client->setClientSecret('KZFY_DK7i21cBJuVyiGf8Of9');\r\n\t\t$google_client->setClientId('186173794919-hm0ejste4uocpnsg9p8hjd5ea3201ss8.apps.googleusercontent.com');\r\n\t\t$google_client->setClientSecret('FBBhPQ9SeHdEwUPTLKAuyn-5');\r\n\t\t// $google_client->setScopes(SCOPES);\r\n\t\t\r\n\r\n\t\treturn $google_client;\r\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t$this->client = new Client([\n\t\t\t'base_url' => Config::get('laundromatic.base_url')\n\t\t]);\n\t}", "function __construct() {\n if (getenv('VANTIV_DEVHUB_LICENSE')) {\n $config_array = [\n 'api_version' => 1,\n 'base_url' => 'https://apis.cert.vantiv.com',\n 'license' => getenv('VANTIV_DEVHUB_LICENSE')\n ];\n $this->config = new TestConfiguration($config_array);\n }\n else {\n $config = realpath(dirname(dirname(__FILE__))) . '/config.ini';\n if (file_exists($config)) {\n $config_array = parse_ini_file($config);\n $this->config = new TestConfiguration($config_array);\n }\n else {\n throw new \\Exception(\"Error: missing test config.ini. Please copy tests/example.config.ini to tests/config.ini and customize with your app's license.\");\n }\n }\n }", "public function run()\n {\n $json_string = file_get_contents('./storage/clients.json'); // replace path with a real path\n\t\t$data = json_decode($json_string); // decode the string into data\n\n\t\n\t\t\n }", "public function __construct()\n {\n $keys = json_decode(file_get_contents('keys.json'));\n if ($keys === false)\n trigger_error('keys.json konnte nicht eingelesen werden!',E_USER_ERROR);\n $this->access_key = $keys->access;\n $this->secret_key = $keys->secret;\n }", "public function handle()\n {\n if (!Tool::hasConfig()) {\n $this->call('install');\n }\n if (Tool::hasBind()) {\n $this->error('Already bind account');\n exit;\n }\n $values = [\n 'client_id' => $this->client_id,\n 'redirect_uri' => $this->redirect_uri,\n 'scope' => $this->scopes,\n 'response_type' => 'code',\n ];\n $query = http_build_query($values, '', '&', PHP_QUERY_RFC3986);\n $authorizationUrl = $this->authorize_url.\"?{$query}\";\n $this->info(\"Please copy this link to your browser to open.\\n{$authorizationUrl}\");\n $code = $this->ask('Please enter the code obtained by the browser.');\n try {\n $client = new Client();\n $form_params = [\n 'client_id' => $this->client_id,\n 'client_secret' => $this->client_secret,\n 'redirect_uri' => $this->redirect_uri,\n 'code' => $code,\n 'grant_type' => 'authorization_code',\n ];\n if (Tool::config('app_type', 'com') === 'cn') {\n $form_params = array_add($form_params, 'resource',\n Constants::REST_ENDPOINT_21V);\n }\n $response = $client->post($this->access_token_url, [\n 'form_params' => $form_params,\n ]);\n $token = json_decode($response->getBody()->getContents(), true);\n $access_token = $token['access_token'];\n $refresh_token = $token['refresh_token'];\n $expires = $token['expires_in'] != 0 ? time() + $token['expires_in']\n : 0;\n $data = [\n 'access_token' => $access_token,\n 'refresh_token' => $refresh_token,\n 'access_token_expires' => $expires,\n ];\n Tool::updateConfig($data);\n $this->call('cache:clear');\n $this->info('Login Success!');\n } catch (ClientException $e) {\n $this->warn($e->getMessage());\n exit;\n }\n }", "public function run()\n {\n $clients = config('data.clients');\n foreach($clients as $client) {\n Client::create($client);\n }\n }", "public function test_create_task_all_fields_correct()\n {\n\n $credential = [\n 'body' => 'testing task'\n ];\n\n $token = User::factory()->create()->createToken('my-app-token')->plainTextToken;\n\n $response = $this->json('POST', '/api/tasks', $credential, ['Accept' => 'application/json', 'Authorization' => 'Bearer '.$token]);\n\n $response\n ->assertStatus(201)\n ->assertJsonStructure(['message'])\n ->assertJsonPath('message', \"Task created successfully.\");\n }", "public function __construct()\n {\n $this->setTokenName(config('infusionsoft.token_name'));\n $this->setClientId(config('infusionsoft.client_id'));\n $this->setClientSecret(config('infusionsoft.client_secret'));\n $this->setRedirectUri(url(config('infusionsoft.redirect_uri')));\n if (config('infusionsoft.debug')) {\n $this->setDebug(true);\n }\n $new_token = false;\n if (Storage::exists($this->token_name)) {\n $token = unserialize(Storage::get($this->token_name));\n $this->setToken(new Token($token));\n } elseif (Request::has('code')) {\n $this->requestAccessToken(Request::get('code'));\n $new_token = true;\n } else {\n throw new InfusionsoftException(sprintf(\n 'You must authorize your application here: %s',\n $this->getAuthorizationUrl()\n ), 1);\n }\n $token = $this->getToken();\n $expired = ($token->getEndOfLife() - (time() * 2)) <= 0 ? true : false;\n if ($expired || $new_token) {\n $extra = $token->getExtraInfo();\n if (!$new_token) {\n $token = $this->refreshAccessToken();\n }\n Storage::disk(config('infusionsoft.filesystem'))->put($this->token_name, serialize([\n \"access_token\" => $token->getAccessToken(),\n \"refresh_token\" => $token->getRefreshToken(),\n \"expires_in\" => $token->getEndOfLife(),\n \"token_type\" => $extra['token_type'],\n \"scope\" => $extra['scope'],\n ]));\n }\n }", "private function initializeClient()\n {\n $this->client = new Client($this->guzzleConfig);\n\n if ($this->isInDebugMode()) {\n $this->setDebugger();\n }\n if ($this->needsAuthentication()) {\n $this->authenticate();\n }\n\n return $this->client;\n }", "private function initClient()\n {\n if ($this->client) {\n return;\n }\n\n try {\n $this->client = S3Client::factory($this->options);\n } catch (AwsExceptionInterface $e) {\n throw new RuntimeException('An AmazonWebService exception has been raised', $e->getCode(), $e);\n } catch (GuzzleException $e) {\n throw new RuntimeException('A Guzzle exception has been raised', $e->getCode(), $e);\n } catch (\\Exception $e) {\n throw new RuntimeException('An unexpected error occured', $e->getCode(), $e);\n }\n }", "public function __construct()\n {\n $this->client = new Client(['base_uri' => 'http://192.168.43.75:8888/apex/obe/']);\n }", "public function __construct()\n {\n // Check PHP version\n $this->_checkPHPVersion(5.3);\n\n $this->file = __DIR__.'/../datas/config.json';\n\n if (!file_exists($this->file))\n throw new \\Exception('Config file '.basename($this->file).' not found');\n\n $this->_readFile();\n }", "function merchantConfigObject()\n{\n $config = new \\CyberSource\\Authentication\\Core\\MerchantConfiguration();\n $runEnv = \"api-matest.cybersource.com\";\n #OAuth related config\n $enableClientCert = true;\n $clientCertDirectory = \"Resources/\";\n $clientCertFile = \"\"; // p12 certificate\n $clientCertPassword = \"\"; // password used to encrypt p12\n $clientId = \"\";\n $clientSecret = \"\";\n\n $confiData = $config->setEnableClientCert($enableClientCert);\n $confiData = $config->setClientCertDirectory($clientCertDirectory);\n $confiData = $config->setClientCertFile($clientCertFile);\n $confiData = $config->setClientCertPassword($clientCertPassword);\n $confiData = $config->setClientId($clientId);\n $confiData = $config->setClientSecret($clientSecret);\n $confiData = $config->setRunEnvironment($runEnv);\n $config->validateMerchantData($confiData);\n return $config;\n}", "public function __construct(Config $config)\n {\n $this->config = $config;\n $this->client = new Client();\n }", "public function testCreateClient() {\n\n $this->withoutMiddleware();\n\n // Generate one user and one client\n $user = factory(App\\User::class)->create();\n $client = factory(App\\Client::class)->make(['phone_number' => '0725433317']);\n\n $this->actingAs($user)\n ->post('/clients/create', ['name' => $client->name, 'phone' => $client->phone_number])\n ->seeJson(['success' => true]);\n\n }", "protected function createClient()\n\t{\n\t\treturn new Client($this->app);\n\t}", "public function run()\n {\n DLocalConfig::create([\n 'name' => 'api.andeanwide.com',\n 'url' => 'https://dpayout.andeanwide.com/',\n 'grant_type' => 'client_credentials'\n ]);\n }", "function setConfig() {\n $credentialsPath = './credentials.json';\n $credentialsAvailable = false;\n \n $shortopts = \"\";\n $longopts = array(\n \"cid:\",\n \"pid:\",\n \"csec:\",\n \"ruri:\"\n );\n \n $options = getopt($shortopts, $longopts);\n \n if(!file_exists($credentialsPath) && count($options) < 3 ) {\n print(\"You must specify the app credentials!\");\n die;\n }\n \n if(!!$options['cid'] && !!$options['csec'] && !!$options['ruri']) {\n $credentials = [\n \"web\" => [\n \"client_id\" => $options['cid'],\n \"project_id\" => \"\",\n \"auth_uri\" => \"https://accounts.google.com/o/oauth2/auth\",\n \"token_uri\" => \"https://oauth2.googleapis.com/token\",\n \"auth_provider_x509_cert_url\" => \"https://www.googleapis.com/oauth2/v1/certs\",\n \"client_secret\" => $options['csec'],\n \"redirect_uris\" => [\n $options['ruri']\n ]\n ]\n ];\n \n file_put_contents($credentialsPath, json_encode($credentials));\n $credentialsAvailable = true;\n }\n else {\n if(file_exists($credentialsPath)) {\n $credentialsAvailable = true;\n }\n }\n \n if(!$credentialsAvailable) {\n print(\"You must specify the app credentials!\");\n die;\n }\n\n return $credentialsPath;\n}", "public static function factory($config = array())\n {\n $config = self::getConfigCollection($config);\n\n $client = new EncodingClient($config->get('base_url'), $config->get('userid'), $config->get('userkey'));\n\n $client->setConfig($config);\n\n // Add the XML service description to the client\n $description = ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'guzzle_encoding_com.json');\n $client->setDescription($description);\n\n return $client;\n }", "public function __construct()\n {\n //$this->cliente = new Client(['base_uri'=>'http://localhost:8002/api/']);\n $apiDireccion = config('api.ubicacion');\n $this->cliente = new Client(['base_uri'=>$apiDireccion]);\n\n }", "public function setUp(){\n $this->client = static::createClient();\n }", "protected function generateBreezeConfig()\n {\n\n $genConfPath = $this->getGeneratorConfigPath();\n $this->infoMessage(\"Creating generator conf file in $genConfPath.\");\n\n $galaxy = $this->getContextVar(\"galaxy\");\n $planet = $this->getContextVar(\"planet\");\n $createFile = $this->getContextVar(\"createFile\");\n\n $prefixes = $this->getTablePrefixes();\n $mainPrefix = array_shift($prefixes);\n\n\n DeveloperWizardBreezeGeneratorHelper::spawnConfFile($genConfPath, [\n \"galaxyName\" => $galaxy,\n \"planetName\" => $planet,\n \"createFilePath\" => $createFile,\n \"prefix\" => $mainPrefix,\n \"otherPrefixes\" => $prefixes,\n ]);\n return null;\n }" ]
[ "0.60770005", "0.5795458", "0.57781726", "0.57111067", "0.57108206", "0.56542313", "0.5643452", "0.56252635", "0.55494595", "0.5546128", "0.5526174", "0.55086046", "0.54727286", "0.5461324", "0.5457526", "0.54519063", "0.54351854", "0.5407149", "0.5366783", "0.53442013", "0.5341059", "0.5338298", "0.5338117", "0.5338108", "0.53113693", "0.53087425", "0.53026336", "0.5299011", "0.5274434", "0.5270044", "0.5259847", "0.52483314", "0.5246642", "0.5239073", "0.5225814", "0.521832", "0.51954013", "0.51919806", "0.51867414", "0.51866883", "0.5184804", "0.5182706", "0.51803607", "0.51759624", "0.51753426", "0.5159646", "0.51589847", "0.51546067", "0.5141921", "0.51389", "0.513814", "0.5128143", "0.512313", "0.51110375", "0.5106297", "0.51026416", "0.5097877", "0.5088473", "0.5085775", "0.5082858", "0.50822765", "0.50709623", "0.5068124", "0.50612426", "0.505689", "0.5056412", "0.5050126", "0.50501204", "0.50344944", "0.50271994", "0.50266737", "0.5023053", "0.50176954", "0.5012694", "0.5009771", "0.5009023", "0.50087863", "0.5004911", "0.49883184", "0.49873427", "0.49839148", "0.49818674", "0.4978328", "0.49646538", "0.49632975", "0.49534994", "0.4948248", "0.4944106", "0.4940588", "0.4934821", "0.49294174", "0.4922745", "0.49226642", "0.492158", "0.49199775", "0.4919526", "0.49193138", "0.49182445", "0.4917794", "0.4917583", "0.49162242" ]
0.0
-1
Genera il link per l'autenticazione Oauth2
public function run() : Google_Client { $this->client->setApplicationName($this->apiKey['application']); $this->client->setScopes([ 'https://www.googleapis.com/auth/youtube.upload', ]); $this->client->setRedirectUri(url('/youtube/callback')); try { $this->client->setClientId($this->apiKey['client-id']); $this->client->setClientSecret($this->apiKey['client-secret']); } catch (Google_Exception $e) { echo "Authentication failed <br>"; echo $e->getMessage(); } $this->client->setAccessType('offline'); return $this->client; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create_auth_url() {\n\t\t$params = array(\n\t\t\t'response_type' => 'code',\n\t\t\t'redirect_uri' => $this->get_redirect_uri(),\n\t\t\t'client_id' => urlencode( $this->config['client_id'] ),\n\t\t\t'scope' => implode( \" \", $this->config['scopes'] ),\n\t\t\t'access_type' => urlencode( $this->config['access_type'] ),\n\t\t\t'approval_prompt' => urlencode( $this->config['approval_prompt'] )\n\t\t);\n\n\t\treturn self::OAUTH2_AUTH_ENDPOINT . \"?\" . http_build_query( $params );\n\t}", "public function getAuthorisationLink()\n {\n\n $authorisationLink = $this->urlAuthorize();\n $authorisationLink .= '?client_id=' . $this->clientId;\n $authorisationLink .= '&response_type=code';\n $authorisationLink .= '&redirect_uri=' . $this->redirectUri;\n $authorisationLink .= '&approval_prompt=' .$this->aprovalPrompt;\n $scopes = str_replace(' ', '',implode(', ', $this->scopes));\n $authorisationLink .= '&scope=' . $scopes;\n\n return $authorisationLink;\n }", "public function authenticationURL()\n {\n $clientId = config('twitch-api.client_id');\n $scopes = implode('+', config('twitch-api.scopes'));\n $redirectURL = config('twitch-api.redirect_url');\n return config('twitch-api.api_url') . '/kraken/oauth2/authorize?api_version=5&response_type=code&client_id=' . $clientId . '&redirect_uri=' . $redirectURL . '&scope=' . $scopes;\n }", "private function getAuthURL() : string {\n $payload = [\n \"client_id\" => $this->client_data->getClientId(),\n \"scope\" => $this->scope->toString(),\n ];\n\n if ($this->with_redirect) {\n $redirect = $this->client_data->getRedirectUri(1);\n $payload['response_type'] = self::RESPONSE_TYPE_TOKEN;\n } else {\n $redirect = $this->client_data->getRedirectUri(0);\n $payload['response_type'] = self::RESPONSE_TYPE_CODE;\n }\n\n $payload[\"redirect_uri\"] = (empty($this->redirect_params)) ?\n $redirect : $redirect.'?'.http_build_query($this->redirect_params);\n return $this->client_data->getAuthURI(). '?'. http_build_query($payload);\n }", "public function actionAuthLink() {\n $localAt = gp('localAt');\n if ($localAt) {\n $s = Yii::$app->getSession();\n $s->set('localAt', $localAt);\n $s->set('linkRequestTs', time());\n $direction = ['site/auth'] + ['authclient' => gp('authclient')];\n $this->redirect($direction);\n } else {\n throw new \\yii\\web\\NotFoundHttpException();\n }\n\n }", "public static function getAuthUrl() {\n $queryString = http_build_query(\n array( 'client_id' => self::CLIENT_ID,\n 'response_type' => 'code',\n 'redirect_uri' => self::getAbsoluteUrl(array(\n 'controller' => 'oauth',\n 'action' => 'callback',\n 'service' => self::TYPE\n ))\n ));\n $url = self::OAUTH_URL . '?' . $queryString;\n return $url;\n }", "public function authLink() {\n return $this->direct();\n }", "public function get_auth_url()\n\t{\n\t\treturn $this->auth_url.'?oauth_token='.$this->get_request_token();\n\t}", "protected function getTokenUrl()\n {\n return 'https://auth.kodular.io/oska/access_token';\n }", "public function getOauthUri(): string\r\n {\r\n return 'https://www.facebook.com/dialog/oauth?';\r\n }", "public function getAuthUrl()\n\t{\n\t\t$tokenData = $this->getRequestToken();\n\t\treturn rtrim($this->_authoriseUrl,'/').'?'.$tokenData;\n\t}", "public function getAuthUrl();", "public function getBaseAuthorizationUrl()\n {\n return 'https://redbooth.com/oauth2/authorize';\n }", "public static function build_oauth_url() {\n\n\t\t$response = \"https://login.live.com/oauth20_authorize.srf?client_id=\".client_id.\"&scope=wl.signin%20wl.offline_access%20wl.skydrive_update%20wl.basic&response_type=code&redirect_uri=\".urlencode(callback_uri);\n\n\t\treturn $response;\n\n\t}", "public function getAuthorizationUri()\n {\n $url = \"https://twinoid.com/oauth/auth?response_type=code&client_id=\".$this->_clientId.\"&redirect_uri=\".$this->_redirectUri.\"&state=connexion\";\n if ($this->_scope)\n {\n $url .= \"&scope=\" . $this->_scope;\n }\n return $url;\n }", "public function getAccessTokenUrl() {\n return Mage::helper('adminhtml')->getUrl('adminhtml/aw_vidtest_authsub/auth', array('api_model_code' => $this->getApiModelCode()));\n }", "function genAuthURL($perms)\n\t{\n\t\t$args['perms'] = $perms;\n\t\t$api_sig = md5($this->api_sig(false,$args));\n\t\treturn 'http://www.rememberthemilk.com/services/auth/?api_key='.$this->apikey.'&perms='.$perms.'&api_sig='.$api_sig;\n\t}", "public function getAuthUrl()\n {\n return $this->client->createAuthUrl();\n }", "protected function getTokenUrl()\n {\n return 'https://bitbucket.org/site/oauth2/access_token';\n }", "public function _getAuthorizationUrl()\n {\n // Generate new authorization url\n $helper = $this->_getProvider()->getRedirectLoginHelper();\n $permissions = ['email', 'public_profile'];\n return $helper->getLoginUrl(APP_URL.'/app/modules/coinstackapp-facebookoauth/src/actions/callback.php', $permissions);\n }", "protected function _generateOpauthCompleteUrl()\n {\n $url = Configure::read('Opauth.complete_url');\n if (!is_array($url)) {\n $url = Router::parse($url);\n }\n $url['?'] = ['social' => $this->request->query('code')];\n return Router::url($url, true);\n }", "protected function getTokenUrl()\n {\n return $this->baseUrl.'/oauth2.0/token';\n }", "function fsl_gauth_getauthurl()\n\t{\n\t\n\t$gClient = new Google_Client();\n $gClient->setApplicationName('Login');\n $gClient->setClientId(option('clientId'));\n $gClient->setClientSecret(option('clientSecret'));\n $gClient->setRedirectUri(option('redirectURL')); \n\t//\t$gClient->setHd(option('hd')); \n $google_oauthV2 = new Google_Oauth2Service($gClient);\n $authUrl = $gClient->createAuthUrl();\n return $authUrl;\n}", "public function getAuthURL() {\n\t\treturn $this->authorization_url.\"?response_type=code&client_id=\".$this->clientID.\"&state=\".$this->state.\"&scope=\".$this->scope;\n\t}", "public function getBaseAuthorizationUrl()\n {\n return 'https://app.intercom.io/oauth';\n }", "public function joinTokenUrl()\n {\n return sprintf('%s?applicationId=%s', $this->site, $this->token);\n }", "function accessTokenURL() { return 'https://api.twitter.com/oauth/access_token'; }", "public function urlAuthorize() {\n return $this->host . '/oauth/authorize';\n }", "abstract public function getUrlForAuthorizeInTokenService($mode = 'modal');", "public function urlAccessToken()\n {\n return 'https://accounts.google.com/o/oauth2/token';\n }", "public function generateAuthUrl(Request $request)\n {\n return $this->setCurrentBankInSession($request, 'monzo')->authorizer->generateAuthUrl('https://auth.monzo.com/');\n }", "public function getTokenUrl();", "protected function getTokenUrl()\n {\n return 'https://login.eveonline.com/oauth/token';\n }", "public function getBaseAuthorizationUrl()\n {\n return \"https://api.weibo.com/oauth2/authorize\";\n }", "public function urlOfAuthorizePage()\n {\n return sprintf(\n '%s/oauth/authorize?client_id=%s&redirect_uri=%s&response_type=code',\n $this->root,\n $this->client_id,\n $this->redirect_uri\n );\n }", "public function urlOfAuthorizePage()\n {\n return sprintf(\n '%s/oauth/authorize?client_id=%s&redirect_uri=%s&response_type=code',\n $this->root,\n $this->client_id,\n $this->redirect_uri\n );\n }", "public function getAuthUrl ()\n {\n\n $url = 'https://oauth.vk.com/authorize?client_id='.$this->client_id.'&scope=photos,friends&redirect_uri='.$this->redirect_uri.'&response_type=code&v=5.0';\n return $url;\n }", "abstract protected function getTokenUrl();", "public function authenticateUri()\n {\n $args = array(\n 'client_id' => $this->_clientId,\n 'client_secret' => $this->_clientSecret,\n 'response_type' => 'code',\n 'redirect_url' => $this->_redirectUri,\n );\n\n return 'https://untappd.com/oauth/authenticate/?' . http_build_query($args);\n }", "abstract protected function auth_url();", "protected function _getAuthUrl()\n {\n\t\t$url = CS_REST_General::authorize_url(\n\t\t\t$this->_getClientId(),\n\t\t\t$this->_getAuthRedirectUri(),\n\t\t\t'ImportSubscribers,ManageLists'\n\t\t);\n\t\t\n return $url;\n }", "public function getAuthUrl()\n\t{\n\t\treturn $this->createAuthUrl();\n\t}", "private function buildUrl() : string\n {\n $redirectUri = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n $params = http_build_query([\n 'openid.ns' => self::OPENID_NS,\n 'openid.mode' => 'checkid_setup',\n 'openid.return_to' => (string) $redirectUri,\n 'openid.realm' => (string) $redirectUri,\n 'openid.identity' => 'http://specs.openid.net/auth/2.0/identifier_select',\n 'openid.claimed_id' => 'http://specs.openid.net/auth/2.0/identifier_select',\n ]);\n\n return (string) (new Uri($this->getOpenIdUrl().'/login'))->withQuery($params);\n }", "public function getBaseAuthorizationUrl()\n {\n return 'https://acesso.dgp.eb.mil.br/authorize';\n }", "abstract public function getAuthorizeUrl(): string;", "public function getAuthUrl()\n {\n $return = $this->baseUrl .\n '/' . $this->authNamespace .\n '/' . $this->authVersion .\n '/token?url=' . $this->baseUrl . '/' . $this->apiNamespace;\n\n return $return;\n }", "public function urlAuthorize() {\n return $this->api_location.\"/authorize\";\n }", "public function urlAuthorization()\n {\n return 'https://api.twitter.com/oauth/authenticate';\n }", "public function urlAccessToken() {\n return $this->host . '/oauth/token';\n }", "public static function getURL()\r\n {\r\n $url = 'https://accounts.google.com/o/oauth2/auth?client_id=' . self::$details['client_id'] . '&redirect_uri=' . self::$details['redirect'] . '&scope=https://www.google.com/m8/feeds/&response_type=code';\r\n return $url;\r\n }", "protected function getTokenUrl()\n {\n return 'https://api.weixin.qq.com/sns/oauth2/access_token';\n }", "public function getAuthorizeUrl() {\n return 'https://api.instagram.com/oauth/authorize?client_id='.$this->getClientID().'&redirect_uri='.$this->getRedirectUri().'&response_type='.$this->getResponseType();\n }", "public function createOpenIdUrl(){\n $format = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=%s&state=%s#wechat_redirect';\n $orderId = \"order123\";\n $paymentId = \"payment999\";\n\n $appId = \\WxPayConfig::APPID;\n $scope = \"snsapi_base\";\n $state = $orderId.\"\".$orderId;\n $redirectUrl = \"http://zyoutrip.com/wechat/payment/redirect\";\n\n $url = sprintf($format, $appId, urlencode($redirectUrl), $scope, $state);\n\n return $url;\n }", "abstract protected function getTokenUrl(): string;", "public function getOAuth()\n {\n }", "public function oauthUrl(string $oauthToken): string\n {\n return sprintf('%s/%s?%s', self::API_URL, 'oauth/authorize', http_build_query([\n 'oauth_token' => $oauthToken,\n ]));\n }", "function generateInviteLink(){\n\t\treturn \"https://app.healthlynked.com/#!/group_join_invite/\".$this->secret.\"?return_url=access_control\";\n\t}", "public function getBaseAccessTokenUrl(array $params)\n {\n return 'https://redbooth.com/oauth2/oauth.access';\n }", "public function generateUserTokenUrl(AccountInterface $account);", "function getAuthorizeURL($token,$callback='') {\n\t\tif (is_array($token)) {\n\t\t\t$token = $token['oauth_token'];\n\t\t}\n\t\treturn $this->authorizeURL() . \"?oauth_token={$token}&oauth_callback=\".urlencode($callback);\n\t}", "public function oauth()\n {\n // TODO: Check user's preference if to ask user every time when new application trying to identify visitor\n\n $redirect_uri = YY::Config('tokens')->createOAuth([\n 'user' => YY::$ME,\n 'state' => $this['state'],\n 'redirect_uri' => $this['redirect_uri'],\n 'where' => $this['where'],\n 'title' => $this['title'],\n ]);\n\n if ($redirect_uri) {\n\n YY::Log('system', 'JS client redirection to: ' . $this['redirect_uri']);\n $redirect_uri = json_encode($redirect_uri);\n YY::clientExecute(\"location.replace($redirect_uri)\");\n// YY::redirectUrl($redirect_uri);\n\n } else {\n\n YY::Log('system', 'Redirect impossible (redirect_uri is empty)');\n $errorMessage = YY::Translate('Something went wrong sorry');\n $errorMessage = json_encode($errorMessage);\n YY::clientExecute(\"alert($errorMessage)\");\n }\n }", "abstract public function getAuthUri(): string;", "abstract protected function token_url();", "public function getBaseAuthorizationUrl()\n {\n return \"https://$this->dataCenter.adobesign.com/public/oauth\";\n }", "public function index()\n {\n $vk = new VKOAuth2();\n var_dump($vk);\n\n echo '<a href=\"https://oauth.vk.com/authorize?client_id=4764214&redirect_uri=' . 'uiweb.ru/upload' . '&display=popup&v=5.28&response_type=token\">auth</a> ';\n\n }", "public function getBaseAuthorizationUrl()\n {\n return 'https://www.sageone.com/oauth2/auth/central';\n }", "public function authorize()\n\t{\n\t\t $args = phpSmug::processArgs( func_get_args() );\n\t\t $perms = ( array_key_exists( 'Permissions', $args ) ) ? $args['Permissions'] : 'Public';\n\t\t $access = ( array_key_exists( 'Access', $args ) ) ? $args['Access'] : 'Read';\n \t\t return \"https://secure.smugmug.com/services/oauth/authorize.mg?Access=$access&Permissions=$perms&oauth_token={$this->oauth_token}\";\n\t }", "function url($clientid, $redirect, $scope)\n{\n\treturn 'https://discordapp.com/oauth2/authorize?response_type=code&client_id=' . $clientid . '&redirect_uri=' . $redirect . '&scope=' . $scope;\n}", "public function get_revoke_url() {\n\n $url = new moodle_url('/repository/repository_callback.php');\n $url->param('callback', 'yes');\n $url->param('repo_id', $this->id);\n $url->param('revoke', 'yes');\n $url->param('reloadparentpage', true);\n $url->param('sesskey', sesskey());\n return '<a target=\"_blank\" href=\"'.$url->out(false).'\">'.get_string('revokeyourgoogleaccount', 'repository_googledrive').'</a>';\n }", "public function connect()\n {\n // Make Call to Aweber and return OAuth Url\n if (empty($_GET['oauth_token'])) {\n $callbackUrl = $this->redirect_url;\n list($requestToken, $requestTokenSecret) = $this->aweber->getRequestToken($callbackUrl);\n $_SESSION['requestTokenSecret'] = $requestTokenSecret; \n return ['url' => $this->aweber->getAuthorizeUrl()] ;\n }\n\n }", "public function getTokenUrl()\n {\n return $this->withStoreName('oauth/v2/token');\n }", "function requestUserLogin($linkText)\n{\n $authSubUrl = getAuthSubUrl();\n echo \"<a href=\\\"{$authSubUrl}\\\">{$linkText}</a>\";\n}", "public function get_login_url() {\n\n $returnurl = new moodle_url('/repository/repository_callback.php');\n $returnurl->param('callback', 'yes');\n $returnurl->param('repo_id', $this->id);\n $returnurl->param('sesskey', sesskey());\n $returnurl->param('reloadparentpage', true);\n\n $url = new moodle_url($this->client->createAuthUrl());\n $url->param('state', $returnurl->out_as_local_url(false));\n return '<a target=\"repo_auth\" href=\"'.$url->out(false).'\">'.get_string('connectyourgoogleaccount', 'repository_googledrive').'</a>';\n }", "public function get_auth_url($callback) {\r\n\t\t$callback = '/slogin/callback.asp?type=baidu&callback=1';//测试用\r\n\t\t$params = array ('response_type' => 'token', 'client_id' => $this->apiKey, 'redirect_uri' => $callback, 'scope' => '', 'state' => $this->state, 'display' => 'page' );\r\n\t\treturn self::$BD_OAUTH2_ENDPOINTS ['authorize'] . '?' . http_build_query ( $params, '', '&' );\r\n\t}", "public function getBaseAuthorizationUrl()\n {\n return $this->getHost().'/oauth2/authorize';\n }", "public function get_user_authorization_url()\n\t{\n\t\tif ($this->auth_oauth_response != SPOAuthClient::OAUTH_USER_AUTH || !$this->oauth_token)\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\n\t\treturn $this->auth_url_userauth . (strpos($this->auth_url_userauth, \"?\") === false ? \"?oauth_token=\" : \"&oauth_token=\") . rawurlencode($this->oauth_token);\n\t}", "function authenticateURL() { return 'http://www.tumblr.com/oauth/authorize'; }", "function generate_api_url(){\n\t\t$parameters = array(\n\t\t\t'uid' \t\t => $this->uid,\n\t\t\t'pswd' \t\t => $this->pswd,\n\t\t\t'api' \t\t => $this->api,\n\t\t\t'apiversion' => $this->apiversion\t\t\t\n\t\t);\n\t\t\n\t\tif(!empty($this->sid) && !empty($this->encrypted_pswd)){\n\t\t\t$parameters['sid'] = $this->sid;\n\t\t\t$parameters['pswd'] = $this->encrypted_pswd;\n\t\t}\n\t\t\n\t\t//var_dump($parameters);\n\t\t\n\t\treturn self::api_end_point . '?' . http_build_query($parameters);\n\t}", "private function getJoinLink(): string\n {\n return Config::get('SERVER_URI') . 'join/' . $this->folder->ownerId . '/' . $this->folder->id . '/' . $this->token;\n }", "public function token()\n {\n if( !isset( $this->config['oauth_id'] ) || !isset( $this->config['oauth_secret'] ) )\n $this->redirect( 'oauth' );\n\n // Skip if we're already set up\n if( isset( $this->config['oauth_id'] ) && isset( $this->config['oauth_secret'] ) && isset( $this->config['oauth_token'] ) )\n $this->redirect( '' );\n \n \n $this->url = $_SERVER['HTTP_HOST'].$this->baseURL;\n }", "function getAuthorizeURL($token,$callback = '') {\n\t\tif (is_array ( $token ))\n\t\t\t$token = $token ['oauth_token'];\n\t\tif(!empty($callback)) {\n\t\t\t$callback = \"&oauth_callback=\".urlencode($callback);\n\t\t}\n\t\treturn $this->authorizeURL () . '?oauth_token=' . $token . $callback;\n\t}", "function login() { \r\n $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);\r\n $request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => OAUTH_CALLBACK));\r\n $_SESSION['oauth_token'] = $request_token['oauth_token'];\r\n $_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];\r\n $url = $connection->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));\r\n echo $url;\r\n }", "public function getBaseAuthorizationUrl()\n {\n return $this->webUrl . '/oauth/authorize';\n }", "public function urlTokenCredentials()\n {\n return 'https://api.twitter.com/oauth/access_token';\n }", "public function generateAutoLoginLink($params){\n $dataRequest = array();$dataRequestAppend = array();\n // Destination ID\n if (isset($params['r'])){\n $dataRequest['r'] = $params['r']; $dataRequestAppend[] = '/(r)/'.rawurlencode(base64_encode($params['r']));\n }\n // User ID\n if (isset($params['u']) && is_numeric($params['u'])){\n $dataRequest['u'] = $params['u']; $dataRequestAppend[] = '/(u)/'.rawurlencode($params['u']);\n }\n // Username\n if (isset($params['l'])){\n $dataRequest['l'] = $params['l']; $dataRequestAppend[] = '/(l)/'.rawurlencode($params['l']);\n }\n if (!isset($params['l']) && !isset($params['u'])) {\n throw new Exception('Username or User ID has to be provided');\n }\n // Expire time for link\n if (isset($params['t'])){\n $dataRequest['t'] = $params['t'];\n $dataRequestAppend[] = '/(t)/'.rawurlencode($params['t']);\n }\n $hashValidation = sha1($params['secret_hash'].sha1($params['secret_hash'].implode(',', $dataRequest)));\n return \"index.php/user/autologin/{$hashValidation}\".implode('', $dataRequestAppend);\n }", "public function get_authorize_url()\n\t{\n\t\t$params = array(\n\t\t\t'client_id' => $this->client_id,\n\t\t\t'scope' => $this->scope,\n\t\t\t'response_type' => 'code',\n\t\t\t'redirect_uri' => $this->redirect_uri,\n\t\t);\n\n\t\t// Authentication request\n\t\t$authorize_url = 'https://api.instagram.com/oauth/authorize';\n\t\treturn \"{$authorize_url}?\" . http_build_query($params);\n\t}", "public function getAuthorizationUrl(): string\n {\n // urlAuthorize option and generates and applies any necessary parameters\n // (e.g. state).\n $authorizationUrl = $this->provider->getAuthorizationUrl([\n // Optional, only use this if you want to ask for scopes the user previously denied.\n 'approval_prompt' => 'force',\n // Optional, a list of scopes. Defaults to only 'organizations.read'.\n 'scope' => [\n Mollie::SCOPE_PAYMENTS_READ,\n Mollie::SCOPE_PAYMENTS_WRITE,\n Mollie::SCOPE_REFUNDS_READ,\n Mollie::SCOPE_REFUNDS_WRITE,\n Mollie::SCOPE_CUSTOMERS_READ,\n Mollie::SCOPE_CUSTOMERS_WRITE,\n Mollie::SCOPE_MANDATES_READ,\n Mollie::SCOPE_MANDATES_WRITE,\n Mollie::SCOPE_SUBSCRIPTIONS_READ,\n Mollie::SCOPE_SUBSCRIPTIONS_WRITE,\n Mollie::SCOPE_PROFILES_READ,\n Mollie::SCOPE_PROFILES_WRITE,\n Mollie::SCOPE_INVOICES_READ,\n Mollie::SCOPE_SETTLEMENTS_READ,\n Mollie::SCOPE_ORDERS_READ,\n Mollie::SCOPE_ORDERS_WRITE,\n Mollie::SCOPE_SHIPMENTS_READ,\n Mollie::SCOPE_SHIPMENTS_WRITE,\n Mollie::SCOPE_ORGANIZATIONS_READ,\n Mollie::SCOPE_ORGANIZATIONS_WRITE,\n Mollie::SCOPE_ONBOARDING_READ,\n Mollie::SCOPE_ONBOARDING_WRITE,\n ],\n ]);\n\n return $authorizationUrl;\n }", "public function createAuthUrl($clientId = '')\n {\n $query = [\n 'client_id' => $clientId == '' ? $this->getClientId() : $this->clientId,\n 'redirect_uri' => $this->getRedirectUri(),\n 'scope' => implode(' ', $this->getScope()),\n 'response_type' => \"code\"\n ];\n $url = $this->oauth2_auth_uri . '?' . http_build_query($query);\n\n return $url;\n }", "public function getLoginUrl() {\n return $this->client->createAuthUrl();\n }", "public function get_access_token_url() {\n\t\t$access_token_url = self::$_access_token_url;\n\n\t\t/**\n\t\t * Filter access_token_url\n\t\t *\n\t\t * @since 1.3\n\t\t *\n\t\t * @param string $access_token_url\n\t\t */\n\t\t$access_token_url = apply_filters( 'forminator_addon_aweber_oauth_access_token_url', $access_token_url );\n\n\t\treturn $access_token_url;\n\t}", "public function get_auth_url()\r\n\t{\r\n\t\treturn PicasaAPI::$QUERY_URLS['auth'];\r\n\t}", "public function getResourceOwnerDetailsUrl(AccessToken $token)\n {\n $authorizedUser = $this->getAuthorizedUser($token);\n\n $params = [\n 'token' => $token->getToken(),\n 'user' => $authorizedUser->getId()\n ];\n\n return 'https://redbooth.com/oauth2/users.info?' . http_build_query($params);\n }", "public function getLoginUrl() {\n $url = CURL::urljoin($this->authorization_uri, array(\n 'client_id' => $this->client_id,\n 'scope' => $this->scope,\n 'response_type' => 'code',\n 'redirect_uri' => $this->getConnectUrl(),\n 'state' => $this->state,\n 'display' => 'popup',\n ));\n return $url;\n }", "public function getBaseAuthorizationUrl()\n {\n return $this->domain() . '/oauth/authorize';\n }", "public function uri()\n {\n return static::BASE_URI.'/oauth/v3/token';\n }", "public function createAuthUrl(array $scope) {\n $params= array(\n 'response_type=code',\n 'redirect_uri='.urlencode($this->redirectUri),\n 'client_id='.urlencode($this->clientId),\n 'scope='.urlencode(implode(' ', $scope)),\n 'access_type='.urlencode($this->accessType),\n 'approval_prompt='.urlencode($this->approvalPrompt)\n );\n\n if (isset($this->state)) {\n $params[]= 'state='.urlencode($this->state);\n }\n\n return $this->provider->getOauthUrl().'?'.implode('&', $params);\n }", "public static function callback_url() {\n global $CFG;\n\n return new moodle_url('/admin/oauth2callback.php');\n }", "public function getURL()\n {\n $client = new Google_Client();\n $client->setAuthConfigFile($this->path);\n $client->setAccessType('offline');\n $client->setApprovalPrompt('force');\n $client->addScope(array(\n Google_Service_Compute::DEVSTORAGE_FULL_CONTROL,\n Google_Service_Oauth2::PLUS_ME\n )\n );\n $client->setRedirectUri($this->getRedirectURL());\n return $client->createAuthUrl();\n }", "protected function getApiTokenUrl()\n {\n return \"api/Token\";\n }", "public function getAuthorizationUrl()\n {\n // Check for required items\n if (!$this->clientId) {\n throw new Exception('Client ID is required');\n }\n if (!$this->scope) {\n throw new Exception('Scope is required');\n }\n if (!$this->redirectUri) {\n throw new Exception('Redirect URI is required');\n }\n\n // Start building url (enpoint is the same for public and member APIs)\n $url = 'https://';\n $url .= (!empty($this->environment)) ? $this->environment . '.' : '';\n $url .= self::HOSTNAME . '/' . self::AUTHORIZE;\n $url .= '?client_id=' . $this->clientId;\n $url .= '&scope=' . $this->scope;\n $url .= '&redirect_uri=' . urlencode($this->redirectUri);\n $url .= '&response_type=code';\n\n // Process non-required fields\n $url .= ($this->showLogin) ? '&show_login=true' : '';\n $url .= (isset($this->state)) ? '&state=' . $this->state : '';\n $url .= (isset($this->familyNames)) ? '&family_names=' . $this->familyNames : '';\n $url .= (isset($this->givenNames)) ? '&given_names=' . $this->givenNames : '';\n $url .= (isset($this->email)) ? '&email=' . urlencode($this->email) : '';\n\n return $url;\n }", "protected function buildAuthorizeUrl($prompt, $returnTo=null) {\n global $base_root;\n\n $auth0Api = new Authentication($this->domain, $this->client_id);\n\n $response_type = 'code';\n $redirect_uri = \"$base_root/auth0/callback\";\n $connection = null;\n $state = $this->getNonce($returnTo);\n $additional_params = [];\n $additional_params['scope'] = AUTH0_DEFAULT_SCOPES;\n if ($this->offlineAccess) $additional_params['scope'] .= ' offline_access';\n if ($prompt) $additional_params['prompt'] = $prompt;\n\n return $auth0Api->get_authorize_link($response_type, $redirect_uri, $connection, $state, $additional_params);\n }" ]
[ "0.76015323", "0.69996893", "0.69429135", "0.68821865", "0.6844132", "0.6834876", "0.68315786", "0.68288404", "0.6823005", "0.6812642", "0.6802078", "0.66871303", "0.66503346", "0.66302204", "0.6553575", "0.65297335", "0.65232617", "0.6508004", "0.64975715", "0.6474936", "0.6453396", "0.64494103", "0.64469296", "0.6443831", "0.64387864", "0.64256626", "0.6414136", "0.6413735", "0.64124256", "0.64046746", "0.63939536", "0.63620424", "0.6358665", "0.6337005", "0.63368094", "0.63368094", "0.6332537", "0.6326227", "0.63136894", "0.63127995", "0.6300789", "0.6293371", "0.6284565", "0.62759656", "0.6272076", "0.62365466", "0.62359095", "0.6235783", "0.62353057", "0.61923456", "0.6180094", "0.6166472", "0.61567354", "0.61543614", "0.6147898", "0.61357343", "0.6110442", "0.6106061", "0.61025226", "0.609798", "0.60926664", "0.6091409", "0.6070892", "0.6070122", "0.6068134", "0.6066821", "0.60588056", "0.60286546", "0.60253567", "0.60240906", "0.6014295", "0.6006844", "0.6006666", "0.59984773", "0.59909946", "0.5987742", "0.59616774", "0.59544027", "0.59460795", "0.5944507", "0.59375006", "0.5925228", "0.59224933", "0.5921057", "0.5908059", "0.59076166", "0.590739", "0.5903748", "0.58939785", "0.58848375", "0.58812094", "0.5875119", "0.5874285", "0.58650935", "0.58604205", "0.58413905", "0.58404547", "0.5825191", "0.5819262", "0.58188766", "0.5812207" ]
0.0
-1
Register the service provider.
public function register() { Connection::resolverFor('sqlsrv', function ($connection, $database, $prefix, $config) { $db = new SqlServerConnection($connection, $database, $prefix, $config); if (! empty($config['skip_session_vars'])) { return $db; } return $db; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register()\n {\n $this->registerServices();\n }", "public function register()\n {\n // service 由各个应用在 AppServiceProvider 单独绑定对应实现\n }", "public function register()\n {\n //\n if (env('APP_DEBUG', false) && $this->app->isLocal()) {\n $this->app->register(\\Laravel\\Telescope\\TelescopeServiceProvider::class);\n $this->app->register(TelescopeServiceProvider::class);\n }\n }", "public function register()\n {\n\n $this->registerBinding();\n }", "public function register()\n\t{\n\t\t$this->registerCommands();\n\t\t$this->registerHybridAuth();\n\t}", "public function register()\n {\n $this->registerAuthenticator();\n }", "public function register()\n {\n $this->loadHelpers();\n \n $this->passportSetting();\n }", "public function register()\n {\n //Bind service in IoC container\n $this->app->singleton('tenancy', function(){\n return new TenantManager();\n });\n }", "public function register()\n {\n\n $this->app->register(HookProvider::class);\n $this->app->register(RouteProvider::class);\n// $this->app->register(InstallModuleProvider::class);\n }", "public function register()\n\t{\n\t\t\n\t\t$this->registerViewManager();\n\t\t$this->registerResponseHandler();\n\t\t$this->registerHttpMethods();\n\t}", "public function register()\n {\n $this->registerAccountService();\n\n $this->registerCurrentAccount();\n\n //$this->registerMenuService();\n\n //$this->registerReplyService();\n }", "public function register()\n {\n // ...\n }", "public function register()\n {\n // ...\n }", "public function register() {\n $this->registerProviders();\n $this->registerFacades();\n }", "public function register()\n {\n $this->registerServiceProvider();\n\n $this->addAssetNamespaceHint();\n $this->addStreamsNamespaceHint();\n }", "public function register()\n {\n $this->registerRequestHandler();\n $this->registerAuthorizationService();\n $this->registerServices();\n }", "public function register()\n {\n // register its dependencies\n $this->app->register(\\Cviebrock\\EloquentSluggable\\ServiceProvider::class);\n }", "public function register(){\n $this->registerDependencies();\n $this->registerAlias();\n $this->registerServiceCommands();\n }", "public function register()\n {\n $this->registerContracts();\n }", "public function register()\n\t{\n $this->registerApi();\n\t}", "public function register()\n {\n \n $this->registerLoader();\n $this->registerTranslator();\n }", "public function register()\r\n {\r\n Passport::ignoreMigrations();\r\n\r\n $this->app->singleton(\r\n CityRepositoryInterface::class,\r\n CityRepository::class\r\n );\r\n\r\n $this->app->singleton(\r\n BarangayRepositoryInterface::class,\r\n BarangayRepository::class\r\n );\r\n }", "public function register() {\n //\n }", "public function register() {\n //\n }", "public function register() {\n //\n }", "public function register() {\n //\n }", "public function register() {\n //\n }", "public function register() {\n //\n }", "public function register() {\n //\n }", "public function register() {\n //\n }", "public function register()\n {\n $this->registerServiceProviders();\n $this->registerSettingsService();\n $this->registerHelpers();\n }", "public function register()\n {\n /**\n * Register additional service\n * providers if they exist.\n */\n foreach ($this->providers as $provider) {\n if (class_exists($provider)) {\n $this->app->register($provider);\n }\n }\n }", "public function register()\n {\n $this->registerAssets();\n $this->registerServices();\n }", "public function register()\n\t{\n\n $this->registerUserService();\n $this->registerCountryService();\n $this->registerMetaService();\n $this->registerLabelService();\n $this->registerTypeService();\n $this->registerGroupeService();\n $this->registerActiviteService();\n $this->registerRiiinglinkService();\n $this->registerInviteService();\n $this->registerTagService();\n $this->registerAuthService();\n $this->registerChangeService();\n $this->registerRevisionService();\n $this->registerUploadService();\n //$this->registerTransformerService();\n }", "public function register()\n {\n $this->registerFinite();\n }", "public function register()\n {\n $this->setupConfig();\n\n $this->bindServices();\n }", "public function register()\n {\n $this->registerServices();\n $this->setupStubPath();\n $this->registerProviders();\n }", "public function register()\n {\n $this->app['cache'] = $this->app->share(function($app)\n {\n return new CacheManagerMaster($app);\n });\n\n $this->app['memcached.connector'] = $this->app->share(function()\n {\n return new MemcachedConnector;\n });\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->registerFactory();\n $this->registerManager();\n $this->registerBindings();\n }", "public function register()\n {\n $this->registerFactory();\n $this->registerManager();\n $this->registerBindings();\n }", "public function register()\n {\n $this->registerFactory();\n $this->registerManager();\n $this->registerBindings();\n }", "public function register()\n {\n $this->registerBrowser();\n\n $this->registerViewFinder();\n }", "public function register()\n {\n $this->registerCacheManager();\n $this->registerCourier();\n }", "public function register()\n {\n $this->app->singleton(Adapter::class, function () {\n\n return new Adapter(config('services.sso.id'), config('services.sso.secret'));\n\n });\n }", "public function register()\n {\n $this->registerRollbar();\n }", "public function register()\n {\n $this->configure();\n }", "public function register()\n {\n $this->registerFactory();\n $this->registerManager();\n }", "public function register(): void\n {\n parent::register();\n\n $this->singleton(RouteViewerContract::class, RouteViewer::class);\n }", "public function register() {\n\n }", "public function register()\n {\n $this->registerFlareFacade();\n $this->registerServiceProviders();\n $this->registerBindings();\n }", "public function register()\n {\n $this->registerBindings();\n $this->registerEventListeners();\n }", "public function register()\n {\n //\n if ($this->app->environment() !== 'production') {\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n }\n\n\n\n\n $this->app->register(ResponseMacroServiceProvider::class);\n $this->app->register(TwitterServiceProvider::class);\n }", "public function register()\n {\n $this->app->singleton(Service\\TagsSynchronizer::class, function ($app) {\n return new Service\\TagsSynchronizer();\n });\n }", "public function register() {\n }", "public function register() {\n }", "public function register() {\n }", "public function register() {\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }" ]
[ "0.71774215", "0.7054453", "0.6968271", "0.69677705", "0.6952019", "0.6931252", "0.6926226", "0.6918423", "0.6899592", "0.6895726", "0.6894278", "0.68906504", "0.68906504", "0.6883112", "0.6872877", "0.6865099", "0.68640506", "0.68627584", "0.68624485", "0.68491566", "0.6823619", "0.68196595", "0.681956", "0.681956", "0.681956", "0.681956", "0.681956", "0.681956", "0.681956", "0.681956", "0.68090034", "0.68089324", "0.6807419", "0.6803942", "0.6802752", "0.679191", "0.67904466", "0.67874974", "0.6785141", "0.6785141", "0.6785141", "0.6780175", "0.67768264", "0.6776666", "0.6770326", "0.6762759", "0.67627436", "0.67611307", "0.6757141", "0.67570823", "0.67548144", "0.6753397", "0.6753232", "0.67504245", "0.67504245", "0.67504245", "0.67504245", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705", "0.6749705" ]
0.0
-1
Get the services provided by the provider.
public function provides() { return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final public function getServices()\n {\n if (is_null($this->serviceProviders)) {\n $this->serviceProviders = $this->getServiceProviders();\n }\n\n return $this->serviceProviders;\n }", "protected function getServices()\n {\n return $this->services;\n }", "protected static function getServiceProviders()\n {\n return [];\n }", "public static function get_service_providers(): array {\n\t\treturn self::$service_providers;\n\t}", "public function getServices();", "public function getServices()\n {\n return $this->services;\n }", "public function getServices()\n {\n return $this->services;\n }", "public function getServices()\n {\n return $this->services;\n }", "public function services()\n {\n return $this->belongstomany(Service::class);\n }", "public function getServices() {\n return $this->services;\n }", "public function getServices() {\n return $this->services;\n }", "public function getServiceProviders();", "public function getServices() {\n\n return $this->services;\n\n }", "public function getServices()\n {\n return $this->pantonoServices;\n }", "public static function getServices(): array\n {\n return static::$services;\n }", "public static function get_services() {\n return [ \n Pages\\Admin::class,\n Base\\Enqueue::class,\n Base\\SettingsLinks::class,\n Base\\JsObjectsManager::class,\n Base\\ShortCodesManager::class\n ];\n }", "private function get_services() {\n\t\treturn [\n\t\t\tServices\\Language_Loader::class,\n\t\t\tServices\\Setup_Database::class,\n\t\t\tServices\\Scripts_And_Templates::class,\n\t\t\tServices\\Admin_Pages::class,\n\t\t\tServices\\Setup_Settings_Page::class,\n\t\t\tServices\\Loggers_Loader::class,\n\t\t\tServices\\Dropins_Loader::class,\n\t\t\tServices\\Setup_Log_Filters::class,\n\t\t\tServices\\Setup_Pause_Resume_Actions::class,\n\t\t\tServices\\Setup_Purge_DB_Cron::class,\n\t\t\tServices\\API::class,\n\t\t\tServices\\Dashboard_Widget::class,\n\t\t\tServices\\Network_Menu_Items::class,\n\t\t\tServices\\Plugin_List_Link::class,\n\t\t];\n\t}", "public static function get_services()\n {\n return [\n Pages\\Dashboard::class,\n Base\\Enqueue::class,\n Base\\SettingsLink::class,\n Base\\CustomPostTypeController::class,\n ];\n }", "public static function get_services()\n {\n return [\n Pages\\Admin::class,\n Base\\Enqueue::class,\n Base\\CustomPostType::class,\n Base\\CustomMetaBox::class,\n Base\\Shortcode::class,\n Base\\Cron::class,\n ];\n }", "public function &getServices(): array {\n return $this->services;\n }", "public function getServiceLocator()\n {\n return $this->services;\n }", "public function getServiceProviderList()\n {\n return $this->providers;\n }", "public function services()\n {\n return $this->getAngularLocation($this->service_path);\n }", "public function provides()\n {\n return [Client::class, Services\\OAuth::class];\n }", "public function getServices(): array;", "public function getServiceProvider();", "public static function get_services()\n {\n\n //підключаємо всі необхідні класи для активації через масив\n return [\n Pages\\Admin::class,\n Base\\Enqueue::class,\n Base\\SettingsLinks::class\n ];\n }", "public function provides()\n {\n return [\n SerasaService::class\n ];\n }", "public function serviceProviders(): ?Collection;", "public function getServices()\r\n {\r\n if (is_null($this->_services)) {\r\n if ($this->getConfig('auto')) {\r\n $this->_services = array();\r\n $config = Mage::app()->getConfig();\r\n foreach (array('cache', 'full_page_cache', 'fpc') as $cacheType) {\r\n $node = $config->getXpath('global/' . $cacheType . '[1]');\r\n if (isset($node[0]->backend) && in_array((string)$node[0]->backend, array(\r\n 'Cm_Cache_Backend_Redis',\r\n 'Mage_Cache_Backend_Redis'\r\n ))) {\r\n $this->_services[] = $this->_buildServiceArray(\r\n $this->__(str_replace('_', ' ', uc_words($cacheType))),\r\n $node[0]->backend_options->server,\r\n $node[0]->backend_options->port,\r\n $node[0]->backend_options->password,\r\n $node[0]->backend_options->database\r\n );\r\n }\r\n }\r\n // get session\r\n $node = $config->getXpath('global/redis_session');\r\n if ($node) {\r\n $this->_services[] = $this->_buildServiceArray(\r\n $this->__('Session'),\r\n $node[0]->host,\r\n $node[0]->port,\r\n $node[0]->password,\r\n $node[0]->db\r\n );\r\n }\r\n } else {\r\n $this->_services = unserialize($this->getConfig('manual'));\r\n }\r\n }\r\n return $this->_services;\r\n }", "public function loadServices($providers);", "public static function get_services(): array\n {\n return [\n Base\\SettingsLinks::class,\n Pages\\Admin::class,\n Base\\Enqueue::class,\n CPT\\EmailCpt::class,\n ];\n }", "public function services(): array\n {\n return \\array_merge(\n \\array_keys($this->_services),\n \\array_keys($this->aliases)\n );\n }", "public function get_services() {\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/services.json\");\n }", "public function getRequestedServices();", "public function getProviders();", "public function getProviders();", "protected function getUserServices()\n\t{\n\t\treturn $this->userServices = new UsersService();\n\t}", "protected function getServices() {\n\t\treturn [\n\t\t\tMessagesService::class,\n\t\t];\n\t}", "public static function get_providers() {\n\t\treturn self::$providers;\n\t}", "public function getRequiredServices();", "public function getModulesServiceProviders()\n {\n $modulesNamespace = ModulesConfig::getModulesNamespace();\n\n foreach (ModulesConfig::getModulesNames() as $moduleName) {\n // get the Module extra service providers (extra service providers are defined in the modules config file)\n foreach (ModulesConfig::getModulesExtraServiceProviders($moduleName) as $provider) {\n $allServiceProviders[] = $provider;\n }\n // append the Module main service provider\n $allServiceProviders[] = ModulesConfig::buildMainServiceProvider($modulesNamespace, $moduleName);\n }\n\n return array_unique($allServiceProviders) ? : [];\n }", "public function provides()\n {\n return [\n RouteServiceProvider::class,\n MenuServiceProvider::class,\n ];\n }", "public function getUsersServices()\r\n {\r\n return $this->usersServices = new UsersService();\r\n }", "public function getServices()\n\t{\n\t\treturn ['card', 'topup_mobile', 'topup_mobile_post', 'topup_game'];\n\t}", "public function providerGet()\n {\n $getList = $this->getMethodsName('get');\n $provider = [];\n\n foreach ($getList as $name) {\n $provider[$name] = [\n 'name' => $name,\n 'arguments' => $this->getArgumentsForMethod($name),\n ];\n }\n\n return $provider;\n }", "public function findServices(): array;", "public static function get_services()\n {\n $ServicesObj = new Services();\n $Services = array();\n try {\n $stmt = $ServicesObj->read();\n $count = $stmt->rowCount();\n if ($count > 0) {\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n extract($row);\n $p = (object) array(\n \"ServiceID\" => (int) $ServiceID,\n \"ServiceName\" => $ServiceName,\n );\n\n array_push($Services, $p);\n }\n }\n return $Services;\n } catch (Exception $e) {\n throw $e;\n }\n }", "protected function otherServiceProviders()\n {\n $providers = [\n \\Collective\\Html\\HtmlServiceProvider::class,\n \\Intervention\\Image\\ImageServiceProvider::class,\n \\Acacha\\AdminLTETemplateLaravel\\Providers\\AdminLTETemplateServiceProvider::class,\n \\Serff\\Cms\\Core\\Providers\\InstallationServiceProvider::class,\n \\Serff\\Cms\\Core\\Providers\\AdminServiceProvider::class,\n ];\n\n $manifestPath = app()->getCachedServicesPath();\n\n (new ProviderRepository(app(), new Filesystem, $manifestPath))\n ->load($providers);\n }", "protected function getProviders() {\n\n\t\treturn $this->providers;\n\t}", "public function provides()\n {\n return [\n 'sm.callback.factory',\n 'sm.event.dispatcher',\n 'sm.factory',\n Debug::class,\n ];\n }", "public function get_providers()\n {\n }", "public function provides()\n {\n return [\n 'freshdesk.factory',\n 'freshdesk',\n 'freshdesk.connection',\n ];\n }", "public function provides()\n {\n return [\\App\\Services\\ApiPlatformProductFactoryService::class];\n }", "public function getServiceProvider($provider);", "public static function getListServices () {\n return self::findByStatus(self::STATUS_ACTIVE);\n }", "protected function registerServiceProviders()\n {\n if ($this->active()->has('providers')) {\n $providers = $this->active()->get('providers');\n\n foreach ($providers as $provider) {\n App::register($provider);\n }\n }\n }", "public function provides()\n\t{\n\t\treturn array(\n\t\t\t'mosms',\n\t\t\t'moclient',\n\t\t\t);\n\t}", "public function provides() {\n $providers = array();\n foreach ($this->providers as $key => $value) {\n $providers[] = $key;\n }\n return $providers;\n }", "public function getLoadedProviders(): array\n {\n return $this->loadServiceProviders;\n }", "public function provides()\n {\n AchieveLogger::info(\"Deferred true and I am here in provides()\");\n return['App\\Services\\Utility\\AchieveLoggerService'];\n }", "public function getModuleServiceProvider()\n {\n return isset($this->config['module']['providers']) ? $this->config['module']['providers'] : [];\n }", "public function provides()\n {\n return [\n CreateService::class,\n CreateInterface::class,\n CreateProvider::class,\n ];\n }", "public function setProviders()\n {\n $services = $this->container['services']??null;\n\n if (is_array($services)) {\n foreach ($services as $service) {\n $service::register($this->container);\n $service::boot($this->container);\n }\n }\n }", "public function provides()\n {\n return [\n ZhyuInfoServiceProvider::class,\n ];\n }", "public function getProviders()\n {\n return $this->providers;\n }", "public function getProviders()\n {\n return $this->providers;\n }", "public function services($ignore_cache = false) {\n if ($this->services === null || $ignore_cache) {\n $this->services = StatusBoard_Service::allForSite($this);\n }\n \n return $this->services;\n }", "public function getProviders(): array\n {\n return $this->providers;\n }", "public function getProviders(): array\n {\n return $this->providers;\n }", "public function get_service() {\n\n\t\treturn $this->provider_instance;\n\t}", "public function provides()\n {\n return [\n 'digitalocean.adapterfactory',\n 'digitalocean.factory',\n 'digitalocean',\n 'digitalocean.connection',\n ];\n }", "public function provides()\n {\n return [\n 'dubbo_cli',\n 'dubbo_cli.factory',\n ];\n }", "public static function getSubscribedServices()\r\n {\r\n return [\r\n MDHelper::class,\r\n LoggerInterface::class\r\n ];\r\n }", "public function getDependencies()\n {\n return array(\n MongoServiceProvider::SERVICE_NAME\n );\n }", "protected function getAuth_Provider_Oauth_ServiceCollectionService()\n {\n $this->services['auth.provider.oauth.service_collection'] = $instance = new \\phpbb\\di\\service_collection($this);\n\n $instance->add('auth.provider.oauth.service.bitly');\n $instance->add('auth.provider.oauth.service.facebook');\n $instance->add('auth.provider.oauth.service.google');\n $instance->add('auth.provider.oauth.service.twitter');\n\n return $instance;\n }", "public function provides()\n {\n return [CardService::class];\n }", "public function getServices()\n {\n $services = InvoiceService::where('office_id', request('office_id'))->where('name', 'like', '%' . request('q') . '%')->get();\n\n return $services;\n }", "public function provides()\n {\n return [\n 'auth',\n 'Permit\\CurrentUser\\ContainerInterface',\n 'Permit\\Access\\CheckerInterface',\n 'Permit\\CurrentUser\\LoginValidatorInterface'\n ];\n }", "public function getProviders($provider)\n {\n $name = is_string($provider) ? $provider : getClass($provider, true);\n \n return Arr::where($this->serviceProviders, function ($value) use ($name) {\n return $value instanceof $name;\n });\n }", "public function getServiceCheckProviders(): array\n {\n return $this->serviceCheckProviders;\n }", "public static function getDeferredServices(){\n return \\Illuminate\\Foundation\\Application::getDeferredServices();\n }", "abstract public function getProviders();", "private function providers()\n {\n $this->register(new CorsServiceProvider());\n $this->register(new HmacServiceProvider());\n }", "public function getDeferredServices(): array\n {\n return $this->deferredServices;\n }", "public function services(){\n\n $facades = Array(\n 'Cache' => 'Disco\\classes\\Cache',\n 'Crypt' => 'Disco\\classes\\Crypt',\n 'Data' => 'Disco\\classes\\Data',\n 'DB' => 'Disco\\classes\\DB',\n 'Email' => 'Disco\\classes\\Email',\n 'Event' => 'Disco\\classes\\Event',\n 'Html' => 'Disco\\classes\\Html',\n 'Form' => 'Disco\\classes\\Form',\n 'Model' => 'Disco\\classes\\ModelFactory',\n 'Queue' => 'Disco\\classes\\Queue',\n 'Session' => 'Disco\\classes\\Session',\n 'Template' => 'Disco\\classes\\Template',\n 'View' => 'Disco\\classes\\View'\n );\n\n foreach($facades as $facade=>$v){\n $this->make($facade,$v);\n }//foreach\n\n $this->as_factory('Router',function(){\n return new \\Disco\\classes\\Router::$base;\n });\n\n }", "public function provides()\n {\n return [\n EventDispatcher::class,\n Repository::class,\n ];\n }", "public function getServiceProvider(): Provider\n {\n return $this->serviceProvider;\n }", "protected function getPuntoAtencionServices()\n {\n return $this->container->get('snc.services.puntoatencion');\n }", "public function get_services($settings = FALSE)\n\t{\t\n\t\treturn parent::get_objects(array(\n\t\t\t'settings' => $settings\n\t\t));\n\t}", "public function provides()\n {\n return [\n Factory::class,\n 'flipbox.sdk',\n ];\n }", "public function provides()\n {\n return array(\n 'icsconfig',\n 'icsview',\n 'icsmessage',\n 'icspdf'\n );\n }", "public function getAvailableServices();", "public function provides()\n {\n return [\n ZhyuAuthServiceProvider::class,\n ];\n }", "public function getServices() {\n $serviceNames = $this->getServiceNames($this->serviceFolderPaths);\n $ret = $ret1 = array();\n// require_once AMFPHP_ROOTPATH.'Plugins/AmfphpDiscovery/CReflection.php';\n foreach ($serviceNames as $serviceName) {\n/* $methods = array();\n $objC = new CReflection(APP_PATH.'/app/controllers/'.$serviceName.'.php');\n $objComment = $objC->getDocComment();\n $arrMethod = $objC->getMethods();\n foreach ($arrMethod as $objMethods)\n {\n $methodComment = $objMethods->getDocComment();\n $parsedMethodComment = $this->parseMethodComment($methodComment);\n $arrParamenter = $objMethods->getParameters();\n foreach ($arrParamenter as $Paramenter)\n {\n $parameterInfo = new AmfphpDiscovery_ParameterDescriptor($Paramenter, '');\n $parameters[] = $parameterInfo;\n }\n $methods[$objMethods->_name] = new AmfphpDiscovery_MethodDescriptor($objMethods->_name, $parameters, $methodComment, $parsedMethodComment['return']);\n }\n\n $ret[$serviceName] = new AmfphpDiscovery_ServiceDescriptor($serviceName, $methods, $objComment); */\n $ret1[] = array('label'=>$serviceName,'date'=>'');\n }\n// var_dump($ret);exit();\n //note : filtering must be done at the end, as for example excluding a Vo class needed by another creates issues\n foreach ($ret as $serviceName => $serviceObj) {\n foreach (self::$excludePaths as $excludePath) {\n if (strpos($serviceName, $excludePath) !== false) {\n unset($ret[$serviceName]);\n break;\n }\n }\n }\n return $ret1;\n }", "public function providers()\n {\n return $this->request('get', '/api/teams/'.Helpers::config('team').'/providers');\n }", "public function get_registered_services() {\n\t\t$data = [];\n\t\t$res = self::$dbo->query( 'SELECT storage_service FROM snapshot_storage_credentials' );\n\t\twhile ( $row = $res->fetchArray() ) {\n\t\t\t$data[] = $row['storage_service'];\n\t\t}\n\n\t\treturn $data;\n\t}", "protected function getPayrollServices()\n\t{\n\t\treturn $this->payrollServices = new PayrollServices();\n\t}", "public function provides()\n {\n return ['shppcart_service'];\n }", "public function provides()\n {\n return ['vk_service'];\n }", "public function provides() {\n\t\treturn array();\n\t}" ]
[ "0.79039633", "0.7667588", "0.76229626", "0.75573224", "0.7470691", "0.7423859", "0.7423859", "0.7423859", "0.7409516", "0.736475", "0.736475", "0.7363987", "0.7322196", "0.71889", "0.7162814", "0.71509963", "0.7137116", "0.70622355", "0.7047945", "0.70362085", "0.70213807", "0.69303095", "0.6916005", "0.689161", "0.6809766", "0.6804473", "0.6777694", "0.67695314", "0.67489713", "0.6727971", "0.6722673", "0.6699434", "0.66944385", "0.6651968", "0.6645622", "0.66324407", "0.66324407", "0.6616089", "0.6613961", "0.6610317", "0.66008735", "0.6567814", "0.6562319", "0.6529889", "0.6500722", "0.6480351", "0.64535", "0.645232", "0.6418372", "0.6416018", "0.6413331", "0.6397339", "0.63955915", "0.63899195", "0.6379133", "0.63766354", "0.63379693", "0.63369566", "0.63356155", "0.6335485", "0.6318311", "0.6316751", "0.63084865", "0.62963986", "0.6278965", "0.6264424", "0.6264424", "0.62581587", "0.6252555", "0.6252555", "0.62434787", "0.62404764", "0.623751", "0.62194616", "0.6210146", "0.6203944", "0.62002736", "0.6197869", "0.61938506", "0.6188146", "0.61726904", "0.6170289", "0.6163297", "0.61600006", "0.61570746", "0.6152867", "0.6147815", "0.6147383", "0.61295825", "0.6126574", "0.6124758", "0.61204225", "0.6100293", "0.60957974", "0.6073751", "0.6072919", "0.60692966", "0.6069216", "0.60561067", "0.604959", "0.60481" ]
0.0
-1
Convert fragment to single message of Mirai message chain.
public function toMessage(): array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pasar_fragmento(){\n\t\treturn $this -> fragmento;\n\t}", "public function getFragment(): string\n {\n return (string) $this->fragment;\n }", "function DecodeMessage($mid) {\n\n\t\t//Select Message to Decode\n $msgq = \"SELECT Message FROM Messages WHERE mid = $mid\";\n $msgqu = $this->query($msgq);\n //while ($row = sqlsrv_fetch_array($msgqu, SQLSRV_FETCH_ASSOC)) {\n\t\tforeach ($msgqu as $row){\n $Message = $row['Message'];\n }\n\n\t\t//Decode the HTML\n $dmsg = html_entity_decode($Message);\n\n\t\t//Echo the Message\n echo \"<br>Decoded Message:<br> \" . $dmsg . \"\";\n }", "public function parse(StreamInterface $stream)\n {\n $partBuilder = $this->read($stream);\n return $partBuilder->createMessagePart($stream);\n }", "public function getFragmentComposeReply()\n {\n return $this->get(self::_FRAGMENT_COMPOSE_REPLY);\n }", "public function toMessages();", "public function getFragment() {}", "public function extractMessage($object);", "function string_to_finalmessage($message) {\n $finalmessage = \"\";\n $sss = \"\";\n for ($i = 0; $i < mb_strlen($message, \"UTF-8\"); $i++) {\n $sss = mb_substr($message, $i, 1, \"utf-8\");\n $a = 0;\n $abc = \"&#\" . ordutf8($sss, $a) . \";\";\n $finalmessage .= $abc;\n }\n return $finalmessage;\n}", "public function getFragment(): string\r\n {\r\n return $this->fragment;\r\n }", "function message($to, $post)\n\t{\n\t\tglobal $user;\n\t\t$member = $this->db->getRow('SELECT * FROM bin WHERE `user_id`='.$user->id);\n\t\tif(is_numeric($to))\n\t\t{\n\t\t\t$recipient = array($this->data($to));\n\t\t}else{\n\t\t\t$q = \"SELECT * FROM bin WHERE username='{$to}'\";\n\t\t\t$recipient = $this->db->getAll($q);\n\t\t}\n\n\t\t$output = false;\n\t\tif(!empty($member['id']) && !empty($post['title']) && !empty($post['detail']))\n\t\t{\n\t\t\t$par_id = @intval($post['par_id']);\n\t\t\t$main_id = @intval($post['main_id']);\n\t\t\tforeach((array)$recipient AS $to)\n\t\t\t{\n\t\t\t\t$q = \"INSERT INTO bin_message\n\t\t\t\tSET par_id =\".$par_id.\"\n\t\t\t\t, main_id = \".$main_id.\"\n\t\t\t\t, from_id =\".$member['id'].\"\n\t\t\t\t, from_name ='\".addslashes($member['name']).\"'\n\t\t\t\t, to_id =\".$to['id'].\"\n\t\t\t\t, to_name ='\".addslashes($to['name']).\"'\n\t\t\t\t, title ='\".addslashes($post['title']).\"'\n\t\t\t\t, detail ='\".addslashes($post['detail']).\"'\n\t\t\t\t, child = 1\n\t\t\t\t, created = NOW()\n\t\t\t\t, updated = NOW()\n\t\t\t\t, readed = 0\";\n\t\t\t\t$output = $this->db->Execute($q);\n\t\t\t\tif(!$output)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}else{\n\t\t\t\t\tif (empty($main_id) && empty($par_id))\n\t\t\t\t\t{\n\t\t\t\t\t\t$i = $this->db->Insert_ID();\n\t\t\t\t\t\t$this->db->Execute(\"UPDATE bin_message SET main_id={$i} WHERE id={$i}\");\n\t\t\t\t\t}\n\t\t\t\t\tif($par_id)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->message_update($par_id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $output;\n\t}", "public function toMessageTypeObject() {}", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"Message\",$param) and $param[\"Message\"] !== null) {\n $this->Message = new Message();\n $this->Message->deserialize($param[\"Message\"]);\n }\n\n if (array_key_exists(\"FinishReason\",$param) and $param[\"FinishReason\"] !== null) {\n $this->FinishReason = $param[\"FinishReason\"];\n }\n\n if (array_key_exists(\"Index\",$param) and $param[\"Index\"] !== null) {\n $this->Index = $param[\"Index\"];\n }\n }", "public function message()\n {\n if (null === $this->standardMessage) {\n $this->standardMessage = $this->toStandardMessage(\n $this->message\n );\n }\n\n return $this->standardMessage;\n }", "private function get_message()\n {\n switch (self::$requestType) {\n case 'payRequest':\n self::$msg = sha1(self::$mid . self::$amount . self::$cac . self::$MsTxnId . self::$firstName . self::$familyName . self::$timeStamp, true);\n break;\n case 'payNote':\n self::$msg = sha1(self::$mid . self::$amount . self::$cac . self::$PspTxnId . self::$MsTxnId . self::$timeStamp . self::$Result, true);\n break;\n }\n }", "public function getMessage()\n {\n $lastMsg = $this->getUpdates();\n if(count($lastMsg))\n {\n $lastMsg = $lastMsg[count($lastMsg) - 1];\n $this->currentChat = $lastMsg['message']['chat']['id'];\n $this->currentMsg = $lastMsg['message'];\n $this->currentMsgId = $lastMsg['message']['message_id'];\n $this->currentUser = $lastMsg['message']['from']['id'];\n $this->messageType = (isset($lastMsg['message']['contact'])) ? 'register' : 'text';\n $this->setLastUpdate($lastMsg['update_id'] + 1);\n }\n else\n {\n $this->currentMsg = array();\n }\n }", "public function extract_outlook_message($body) \n\t{\n\t\t$strpos = strpos($body, 'divRplyFwdMsg');\n\t\tif($strpos === false) {\n\t\t\treturn $body;\n\t\t} else {\n\t\t\t// Cut off \n\t\t\t$body = strstr($body, 'divRplyFwdMsg', true);\n\t\t\treturn $body;\n\t\t}\n\t\treturn $body;\n\t}", "function getEncodedMessage(): string {\n return \\chr(static::COMMAND_ID).$this->rewrittenQuery;\n }", "public function decode($buffer, $connection)\n { \n return new Message($buffer);\n }", "public function setFragment($fragment, $fragmentIsAlreadyDecoded);", "function chunkTransferDecode($body) {\n\t\t$body = str_replace(array(\"\\r\\n\", \"\\r\"), \"\\n\", $body);\n\t\t// The body is not chunked encoding or is malformed.\n\t\tif ( ! preg_match( '/^[0-9a-f]+(\\s|\\n)+/mi', trim($body) ) )\n\t\t\treturn $body;\n\n\t\t$parsedBody = '';\n\t\t//$parsedHeaders = array(); Unsupported\n\n\t\twhile ( true ) {\n\t\t\t$hasChunk = (bool) preg_match( '/^([0-9a-f]+)(\\s|\\n)+/mi', $body, $match );\n\n\t\t\tif ( $hasChunk ) {\n\t\t\t\tif ( empty( $match[1] ) )\n\t\t\t\t\treturn $body;\n\n\t\t\t\t$length = hexdec( $match[1] );\n\t\t\t\t$chunkLength = strlen( $match[0] );\n\n\t\t\t\t$strBody = substr($body, $chunkLength, $length);\n\t\t\t\t$parsedBody .= $strBody;\n\n\t\t\t\t$body = ltrim(str_replace(array($match[0], $strBody), '', $body), \"\\n\");\n\n\t\t\t\tif( \"0\" == trim($body) )\n\t\t\t\t\treturn $parsedBody; // Ignore footer headers.\n\t\t\t} else {\n\t\t\t\treturn $body;\n\t\t\t}\n\t\t}\n\t}", "abstract public function get_message();", "public function startMessageOnly(): MessageCorrelationBuilderInterface;", "protected function unwrap($msg,$bytes){ return substr($msg,1,$bytes-2); }", "public function getFragment()\n {\n return $this->fragment;\n }", "public function getFragment()\n {\n return $this->fragment;\n }", "public function getFragment()\n {\n return $this->fragment;\n }", "protected abstract function _message();", "public function getInboundMessage();", "private function dbToConvMessage(array $entry) : ConversationMessage {\n\n\t\t$message = new ConversationMessage();\n\n\t\t$message->set_id($entry[\"id\"]);\n\t\t$message->set_userID($entry[\"user_id\"]);\n\t\t$message->set_time_sent($entry[\"time_insert\"]);\n\t\tif($entry[\"image_path\"] != null)\n\t\t\t$message->set_image_path($entry[\"image_path\"]);\n\t\tif($entry[\"message\"] != null)\n\t\t\t$message->set_message($entry[\"message\"]);\n\n\t\treturn $message;\n\n\t}", "public function messageByuser($messageId){\n $message = Message::where('last_message_for', $messageId)->get();\n if($message[0]->user_id != Auth::user()->id){\n\n if($message[0]->seen){\n $arrayId = array();\n $ids = collect(json_decode($message[0]->seen, true))->pluck('id');\n foreach($ids as $id){\n $arrayId[] = array('id' => $id);\n }\n $newId = [];\n foreach($ids as $new){\n array_push($newId, $new);\n }\n\n if (!in_array(Auth::user()->id, $newId)){\n $arrayId[] = array('id' => Auth::user()->id);\n }\n $update = Message::where('last_message_for', $messageId)\n ->orWhere('user_id', $messageId)\n ->orWhere('reply_to', $messageId)\n ->update(['seen' => json_encode($arrayId)]);\n }else{\n $arrayId = array();\n $arrayId[] = array('id' => Auth::user()->id);\n $update = Message::where('last_message_for', $messageId)->update(['seen' => json_encode($arrayId)]);\n }\n }\n\n return Message::with('user','recipient')\n ->where('user_id', $messageId)\n ->orWhere('reply_to', $messageId)\n ->orderBy('id', 'asc')\n ->get();\n }", "public function fragment($str = '') {\n $tokenized = array();\n\tfor($digit = 0; $digit < $this->utf8_strlen($str); $digit++ ) {\n $code = $this->utf8_ord($this->utf8_charAt($str, $digit)) - 44032;\n \t if ($code > -1 && $code < 11172) { \n\t \t $i_idx = $code / 588; \n \t \t $m_idx = $code % 588 / 28; \n \t $e_idx = $code % 28;\n \t //$tokenized .= $this->ini[$i_idx].$this->mid[$m_idx].$this->end[$e_idx];\n\t\t $tokenized = array(\n\t\t 'b' => $this->ini[$i_idx],\n\t\t 'm' => $this->mid[$m_idx],\n\t\t 'e' => $this->end[$e_idx],\n\t\t );\n \t } else {\n \t //$tokenized .= $this->utf8_charAt($str, $digit);\n\t\t $tokenized = array('n' => $this->utf8_charAt($str, $digit));\n }\n\t}\n return $tokenized;\n }", "public function createSms()\n {\n $messages = array();\n $totalSplits = count($this->getBody());\n foreach ($this->getBody() as $key => $body) {\n $Message = new Message();\n $Message->originator = $this->getOriginator();\n $Message->recipients = $this->getRecipients();\n $Message->body = $body;\n if ($totalSplits > 1) {\n $total = sprintf(\"%02d\", $totalSplits);\n $current = sprintf(\"%02d\", $key+1);\n $udh = self::BASEUDH.$total.$current;\n $Message->type = 'binary';\n $Message->typeDetails = array(\"udh\" => $udh);\n }\n $messages[] = $Message;\n }\n\n return $messages;\n }", "public function decodeMessage(AbiType $abi, string $message): DecodedMessageBody\n {\n return new DecodedMessageBody(\n $this->tonClient->request(\n 'abi.decode_message',\n [\n 'abi' => $abi,\n 'message' => $message,\n ]\n )->wait()\n );\n }", "function board_msg_split($body){\n\t\t$return[0] = preg_replace(\"/^(.+?)::/i\",\"\",$body);\n\n\t\t// 1 is the subject\n\t\tif(preg_match(\"/^(.+?)::/i\",$body,$match))\n\t\t\t$return[1] = $match[1];\n\t\telse\n\t\t\t$return[1] = '';\n\n\t\treturn $return;\n\t}", "function filtrarMensage($msg) {\n $INI = strpos($msg, '<?xml');\n $FIN = strpos($msg, ':Envelope>');\n return substr($msg, $INI, ($FIN + strlen(':Envelope>')) - $INI);\n }", "private function resolveBody(Message $part)\n {\n $body = $part->getBody();\n foreach ($part->getParameters() as $search => $replace) {\n $body = str_replace($search, $replace, $body);\n }\n\n return $body;\n }", "public function getMessages() {\r\n if ($this->destination === 1) {\r\n return $this->buffer;\r\n } else if (is_string($this->destination) && is_file($this->destination)) {\r\n $buffer = file($this->destination, FILE_IGNORE_NEW_LINES);\r\n for ($i=0; $i<count($buffer); $i++) {\r\n if ($buffer[$i][0] === chr(0xff)) {\r\n $buffer[$i] = unserialize(substr($buffer[$i], 1));\r\n }\r\n }\r\n return $buffer;\r\n }\r\n }", "protected function normalizeFragment(string $fragment) : string\n {\n return $this->percentEncode($fragment);\n }", "public function getMessage()\n {\n if (array_key_exists(\"message\", $this->_propDict)) {\n if (is_a($this->_propDict[\"message\"], \"\\Beta\\Microsoft\\Graph\\Model\\ItemBody\") || is_null($this->_propDict[\"message\"])) {\n return $this->_propDict[\"message\"];\n } else {\n $this->_propDict[\"message\"] = new ItemBody($this->_propDict[\"message\"]);\n return $this->_propDict[\"message\"];\n }\n }\n return null;\n }", "public function getFragment();", "public function getGeneratedMessage()\n {\n # Force the template to render\n (string) $this->prepareTemplate();\n\n $m = $this->template->__message;\n\n if (!$m->getFrom()) {\n trigger_error(\"You should add 'from' information.\", E_USER_WARNING);\n }\n\n if (!$m->getSubject()) {\n trigger_error(\"You should add 'subject'.\", E_USER_WARNING);\n }\n\n if (!$m->getHeader('To')) {\n trigger_error(\"You should add recipients.\", E_USER_WARNING);\n }\n\n foreach ($this->attachments as $attachment) {\n list($filename, $content, $type) = $attachment;\n $m->addAttachment($filename, $content, $type);\n }\n\n return $m;\n }", "public function getFragment()\n {\n if (empty($this->_fragment))\n return '';\n\n return $this->_fragment;\n }", "abstract public function getFullMessage($msgNo);", "public function sendMessage(Request $request) {\n\n\n $result = new Result;\n\n $validator = Validator::make($request->all(), [\n 'user_id' => 'required|string', //which is essentially the verified E164 mobile phone number -must be included in every signup step\n 'message' => 'required|string'//\n ]);\n\n try {\n\n if ($validator->fails()) {\n return $result->error(Util::allValidationErrors($validator))->json();\n }\n\n $messageObj = json_decode($request->message);\n\n if (!$messageObj) {\n return $result->error(\"Message must be a valid json\")->json();\n }\n\n if (!isset($messageObj->from_user_id) || Util::isEmptyOrNull($messageObj->from_user_id)) {\n return $result->error(\"Message must contain the 'from_user_id'\")->json();\n }\n\n if (!isset($messageObj->to_user_id) || Util::isEmptyOrNull($messageObj->to_user_id)) {\n return $result->error(\"Message must contain the 'to_user_id'\")->json();\n }\n\n if (!isset($messageObj->content) || Util::isEmptyOrNull($messageObj->content)) {\n return $result->error(\"Message must contain the 'content'\")->json();\n }\n\n if (!isset($messageObj->content_type) || Util::isEmptyOrNull($messageObj->content_type)) {\n return $result->error(\"Message must contain the 'content_type'\")->json();\n }\n\n if ($request->user_id != $messageObj->from_user_id) {\n return $result->error(\"Message must be from the current user - Message origin user id mismatch current user id\")->json();\n }\n\n if (Util::isEmptyOrNull($messageObj->to_user_id)) {\n return $result->error(\"Message must contain a valid chatmate id\")->json();\n }\n\n $user = User::find($request->user_id);\n\n if (!$user) {\n return $result->error(Constants::USER_NOT_FOUND)->json();\n }\n\n $messageObj->time = now(); //set the message time on the message object\n \n $message = new Message;\n $message->user_id = $request->user_id;\n $message->chatmate_id = $messageObj->to_user_id; \n $message->message = json_encode($messageObj);\n $message->save();\n \n\n broadcast(new SupportMessageSent($user, $messageObj))->toOthers();\n\n return $result->dataJson(Constants::MESSAGE_SENT);\n } catch (QueryException $e) {\n return $result->debugJson($e);\n } catch (Exception $e) {\n return $result->debugJson($e);\n }\n }", "public function message($m){}", "public function convert() {\n $this->issue = Utilities::convertText($this->issue);\n $this->message = Utilities::convertText($this->message);\n }", "public function getmessage()\n {\n return array_shift($this->storage);\n }", "function build_message($part)\n {\n \n $message = $part[ \"message\"];\n $message = chunk_split(base64_encode($message));\n $encoding = \"base64\";\n \n return \"Content-Type: \".$part[ \"ctype\"].\n ($part[ \"name\"]? \"; name = \\\"\".$part[ \"name\"]. \"\\\"\" : \"\").\n \"\\nContent-Transfer-Encoding: $encoding\\n\\n$message\\n\";\n \n }", "public function getFirstMessage(): ?MessageInterface;", "public function copy(): MessagePart\n {\n\n return new MessagePart(\n $this->getContents(),\n $this->getCharset(),\n $this->getMimeType()\n );\n }", "private function retrieveMessage() : ?string {\n $message = [];\n\n // The regex to find the head of the message wrapper (message lies between head and foot wrapper)\n $messageHeadWrapperRegex = $this->buildRegex([\n self::REGEX_CONTENT_HEAD ,\n self::REGEX_MESSAGE_WRAPPER_BODY,\n \"(\\s{2})\"\n ], \"\", \"\");\n\n // The regex to find the foot of the message wrapper (message lies between head and foot wrapper)\n $messageFootWrapperRegex = $this->buildRegex([\n self::REGEX_CONTENT_HEAD,\n self::REGEX_MESSAGE_WRAPPER_BODY\n ], \"\", \"\");\n\n // The regex for querying the message, including its queried wrapper\n $messageRegex = $this->buildRegex([\n $messageHeadWrapperRegex,\n self::REGEX_ALL,\n $messageFootWrapperRegex\n ]);\n\n // Querying the message\n preg_match($messageRegex, $this->currentEmail, $message);\n\n // If the message not found, there is most likely no message, so return null\n // Use index \"4\", because the regex group which represents the message only is at index \"4\"\n if (!isset($message[4]))\n return null;\n\n // Return the quoted-printable decoded and trimmed message\n // Use index \"4\", because the regex group which represents the message only is at index \"4\"\n $message = quoted_printable_decode($message[4]);\n return trim($message);\n }", "public function compose() {\n return $this->createMessage();\n }", "public static function partage($idMessage)\n\t{\n\t\t$em = dbconnection::getInstance()->getEntityManager() ;\n\n\t\t$messageRepository = $em->getRepository('message');\n\t\t$utilisateurRepository = $em->getRepository('utilisateur');\n\n\t\t$message = $messageRepository->findOneById($idMessage);\n\t\t$emetteur = $utilisateurRepository->findOneById(context::getSessionAttribute('id'));\n\n\t\t$newMessage = new message;\n\t\t$newMessage->post = $message->post;\n\t\t$newMessage->parent = $message->parent;\n\t\t$newMessage->destinataire = $message->destinataire;\n\t\t$newMessage->aime = 0;\n\t\t$newMessage->emetteur = $emetteur;\n\n\t\t$em->persist($newMessage);\n\t\t$em->flush();\n\n\t\treturn $newMessage;\n\t}", "public function getMerkleRoot(): BufferInterface;", "public function reverseTransform(array $message): SmsInterface\n {\n $sms = new SmsIncoming();\n $sms->setFrom($message['src']);\n $sms->setTo($message['dst']);\n $sms->setText($message['text']);\n\n return $sms;\n }", "protected function getOnepageNormalizeMessage()\n {\n return $this->config->getOnepageNormalizeMessage($this->store);\n }", "public function getRawMessage()\n {\n return $this->phrase->getText();\n }", "public function parse_body()\n\t{\n\t\tforeach ($this->vars AS $key => $value)\n\t\t{\n\t\t\t$this->body = str_replace('{' . $key . '}', $value, $this->body);\n\t\t}\n\n\t\t// Pas de HTML pour MSN / Jabber\n\t\tif ($this->method == NOTIFY_MSN || $this->method == NOTIFY_JABBER)\n\t\t{\n\t\t\t$this->body = preg_replace('#</?[^>]+?>#si', '', $this->body);\n\t\t\t$this->body = str_replace(array(\"\\r\\n\", \"\\r\"), array(\"\\n\", \"\\n\"), $this->body);\n\t\t\t$this->body = str_replace(\"\\n\", \"\\r\\n\", $this->body);\n\n\t\t\tif ($this->method == NOTIFY_JABBER)\n\t\t\t{\n\t\t\t\t$this->body = htmlspecialchars($this->body);\n\t\t\t}\n\t\t}\n\t}", "function SendMessage($message, $object, $id, $from_public = false);", "public function getMessage() {\n if ($this->message instanceof MessageInterface) {\n return $this->message;\n }\n return $this->mesage = new SmsMessageModel();\n }", "public function getMessage(int $number, string $mailbox): Message;", "public function destinationMessages()\n\t{\n\t\treturn $this->hasMany('App\\Message', 'to_currency_id');\n\t}", "public function makeBusMessage(Envelope $envelope): BusMessageInterface;", "function generateInviteFamMessageBody($user, $receiver_name, $ref_code, $relation) {\n $join_url = BASE_URL.\"/register.php?ref=\".$ref_code;\n $sender_name = $user['first_name'].\" \".$user['last_name'];\n $message = \"\";\n\n// $message .=\"<html><head><title></title></head>\n// <body>\n// <img src='\".BASE_URL.LOGO_URL.\"'>\n// <p>Hello!</p>\n// <p>You have been added as a family by \".$user['first_name'].\" \".$user['last_name'].\" on MyNotes4U.</p>\n// <p>Click the button below to join</p>\n// <p><a href=\".$join_url.\">Join MyNotes4U</a></p>\n// </body>\n// </html>\";\n\n $message .=\"<html><head><title></title></head>\n <body>\n <img src='\".BASE_URL.LOGO_URL.\"'>\n <p>Hello \".$receiver_name.\",</p>\n <p>\n \".$sender_name.\" has invited you to join MyNotes4U.\n An exciting new way for family end friends to 'do life' together.\n Share comments, pictures and videos free from all of today's social media worries.\n No more selling of your information or tracking of your online habits.\n </p>\n <p>\n Try it out for free at <a href=\".BASE_URL.\">MyNotes4U.com</a>.\n Your first 30 days are on us.\n </p>\n <br>\n <p>\n MyNotes4U is a secure, non-intrusive, exclusive meeting place for you and your circle of family\n and friends. But that's not all. It's also a place where you can build and\n store your life's personal treasures. Are you an artist, a musician, a writer, a builder,\n a sport enthusiast, an athlete, etc? If so, MyNotes4U is an easy and exciting way to \n keep your lifetime of treasures in one secure and organized location. \n </p>\n <p>\n Becoming a member of MyNotes4U gives you:\n <ul>\n <li>\n Three private exclusive albums.\n <ul>\n <li>\n My Album - Your own private space. A place where you can write and store \n your memoirs to be discovered by future generations - your very own time \n capsule.\n </li>\n <li>\n My Family Album - A place to 'do life' exclusively with your family. You \n choose who can be a part of your album.\n </li>\n <li>\n My Friends Album - A private place to hang-out with your close friends, share\n special occasions, challenges, adventures, feelings and thoughts.\n </li>\n </ul>\n </li>\n <li>\n Meet other members of MyNotes4U by becoming a part of group \n where you can share recipes, church gatherings, home remodeling or \n repair ideas, sporting events and more.\n </li>\n </ul>\n </p>\n <p>\n Perhaps the most intriguing part of MyNotes4U is that it \n doesn't have to end. When you store your memories with us, \n we will preserve them for your future generations. Now you \n can have a voice into the lives of love ones you haven't met. \n your great, great, great grandchildren can know you intimately. \n Discover who you are. That's a game changer.\n </p>\n <br>\n <p>\n Try it out for free at <a href=\".BASE_URL.\">MyNotes4U.com</a>.\n Your first 30 days are on us.\n </p>\n </body>\n </html>\";\n return $message;\n}", "private function _part_decode(&$part)\n {\n //Check for subparts and process them if they exist\n if ( !empty($part->parts)\n && is_array($part->parts))\n {\n foreach ($part->parts as $subPart)\n {\n //We might recurse quite deep so pop here.\n $this->_part_decode($subPart);\n }\n return;\n }\n\n // PONDER: How to handle multiple text bodies better (like in bounce messages)\n\n //Check attachment vs body\n if ( !isset($part->disposition)\n || ( $part->disposition == 'inline'\n && ( isset($part->ctype_primary)\n && strtolower($part->ctype_primary) == 'text')))\n {\n //part is (likely) body\n if ( isset($part->ctype_parameters['charset'])\n && !$this->__orig_encoding)\n {\n $this->__orig_encoding = $part->ctype_parameters['charset'];\n }\n switch (strtolower($part->ctype_secondary))\n {\n default:\n case \"plain\": //Always use plaintext body if found\n // Append *only* if we already have a text body found, otherwise override\n if (!$this->__textBodyFound)\n {\n $this->body = (string)$part->body;\n }\n else\n {\n $this->body .= (string)$part->body;\n }\n $this->__textBodyFound = true;\n break;\n case \"html\":\n if (!$this->__textBodyFound)\n {\n //Try to translate HTML body only if plaintext alternative is not available\n $this->body = $this->html2text($part->body);\n }\n // Append *only* if we already have a HTML body found, otherwise override\n if (!$this->__htmlBodyFound)\n {\n $this->html_body = (string)$part->body;\n }\n else\n {\n $this->html_body .= (string)$part->body;\n }\n $this->__htmlBodyFound = true;\n break;\n }\n }\n else\n {\n //part is (likely) attachment\n /* PONDER: Should we distinguish between attachments and embeds (NOTE: adds complexity to applications\n * using this library since they need the check both arrays and those that actually need to distinguish between\n * the two can also check the attachment['part'] object for details).\n */\n $dataArr = array();\n $dataArr['part'] =& $part;\n $dataArr['mimetype'] = $part->ctype_primary . \"/\" . $part->ctype_secondary;\n $dataArr['content'] =& $dataArr['part']->body;\n if (!empty($part->d_parameters['filename']))\n {\n $dataArr['name'] = $part->d_parameters['filename'];\n }\n else if (!empty($part->ctype_parameters['name']))\n {\n $dataArr['name'] = $part->ctype_parameters['name'];\n }\n else\n {\n $dataArr['name'] = \"unnamed\";\n }\n $this->attachments[] = $dataArr;\n }\n }", "public function messagesAction()\n\t{\n\t\t$user = $this->user;\n $user_id = $user['ID'];\n\n $application_id = $user['Application_ID'];\n\n $messages = MessagesRelation::find([\n \"application_id = {$application_id} AND module_id = {$this->MODULE_ID} AND deleted != {$user_id} AND (to_user_id = {$user_id} OR from_user_id = {$user_id}) AND data_cms_id IS NULL\",\n \"group\" => ['parent_id']\n ]);\n\n $data = [];\n foreach ($messages as $key => $msg) {\n \t$data[\"messages\"][$key][\"from_user\"] = $msg->sender->Title;\n \t$data[\"messages\"][$key][\"from_user_id\"] = $msg->sender->ID;\n \t$data[\"messages\"][$key][\"to_user\"] = $msg->receiver->Title;\n \t$data[\"messages\"][$key][\"to_user_id\"] = $msg->receiver->ID;\n \t$data[\"messages\"][$key][\"chat_id\"] = $msg->parent_id;\n \t$data[\"messages\"][$key][\"last_message\"] = $msg->message->content;\n \t$data[\"messages\"][$key][\"last_message_time\"] = $msg->message->created_at;\n }\n\n $final_array = $this->structureMessages($data[\"messages\"]);\n $trans = new ConversationTransformer;\n\n $response = [\n \t\"status\" => $this->apiFactory->getStatus(200, \"Success\", [\"validation\" => [], \"other\" => []]),\n \t\"content\" => [\n \t \"header\" => [\n \t [\n \t \"lable\" => \"#\",\n \t \"name\" => \"id\",\n \t \"id\" => 1\n \t ],\n \t [\n \t \"lable\" => \"عنوان الرسالة\",\n \t \"name\" => \"message_text\",\n \t \"id\" => 2\n \t ],\n \t [\n \t \"lable\" => \"مرسل من\",\n \t \"name\" => \"client\",\n \t \"id\" => 3\n \t ],\n \t [\n \t \"lable\" => \"تاريخ\",\n \t \"name\" => \"date\",\n \t \"id\" => 4\n \t ],\n \t [\n \t \"lable\" => \"اجراءات\",\n \t \"name\" => \"actions\",\n \t \"id\" => null\n \t ]\n \t ],\n \t \"content\" => $trans->transformResultSet($messages),\n \t \"bulk_actions\" => [\n\t\t\t [\n\t\t\t \"title\" => \"Inbox\",\n\t\t\t \"target_action_id\" => \"1\",\n\t\t\t \"target_type\" => \"popup\",\n\t\t\t \"target_content\" => \"block\",\n\t\t\t \"content_id\" => 12,\n\t\t\t \"target_layout_id\" => \"2\",\n\t\t\t \"target_url\" => \"http://www.urltoinbox.com\",\n\t\t\t \"icon\" => \"\"\n\t\t\t ],\n\t\t\t [\n\t\t\t \"title\" => \"Important\",\n\t\t\t \"target_action_id\" => \"1\",\n\t\t\t \"target_type\" => \"ajax\",\n\t\t\t \"target_content\" => \"page\",\n\t\t\t \"content_id\" => 1,\n\t\t\t \"target_layout_id\" => \"2\",\n\t\t\t \"target_url\" => \"http://\",\n\t\t\t \"icon\" => \"\"\n\t\t\t ],\n\t\t\t [\n\t\t\t \"title\" => \"Sent\",\n\t\t\t \"target_action_id\" => \"1\",\n\t\t\t \"target_type\" => \"ajax\",\n\t\t\t \"target_content\" => \"page\",\n\t\t\t \"content_id\" => 1,\n\t\t\t \"target_layout_id\" => \"2\",\n\t\t\t \"target_url\" => \"http://\",\n\t\t\t \"icon\" => \"\"\n\t\t\t ],\n\t\t\t [\n\t\t\t \"title\" => \"Draft\",\n\t\t\t \"target_action_id\" => \"1\",\n\t\t\t \"target_type\" => \"ajax\",\n\t\t\t \"target_content\" => \"page\",\n\t\t\t \"content_id\" => 1,\n\t\t\t \"target_layout_id\" => \"2\",\n\t\t\t \"target_url\" => \"http://\",\n\t\t\t \"icon\" => \"\"\n\t\t\t ],\n\t\t\t [\n\t\t\t \"title\" => \"Trash\",\n\t\t\t \"target_action_id\" => \"1\",\n\t\t\t \"target_type\" => \"ajax\",\n\t\t\t \"target_content\" => \"page\",\n\t\t\t \"content_id\" => 1,\n\t\t\t \"target_layout_id\" => \"2\",\n\t\t\t \"target_url\" => \"http://\",\n\t\t\t \"icon\" => \"\"\n\t\t\t ]\n\t\t\t ]\n \t],\n \t\"summary\" => [\n \t \"filtered_by\" => [],\n \t \"count\" => [\n \t \"displayed_rows\" => count($messages),\n \t \"total_rows\" => count($messages),\n \t ],\n \t \"limit\" => \"\",\n \t \"pagination\" => \"\"\n \t]\n ];\n\n return $this->sendJson($response);\n\t}", "public function withFragment($fragment): self\n {\n $fragment = $this->formatQueryAndFragment($this->filterString($fragment));\n if ('' === $fragment) {\n $fragment = null;\n }\n\n if ($fragment === $this->fragment) {\n return $this;\n }\n\n $clone = clone $this;\n $clone->fragment = $fragment;\n $clone->assertValidState();\n\n return $clone;\n }", "public function toProseMirrorFragment($bbCode)\n\t{\n\t\treturn $this->nodeToProseMirror($this->csrBB->parseString($bbCode));\n\t}", "public function getRecipientActionMessage(): ?string {\n $val = $this->getBackingStore()->get('recipientActionMessage');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'recipientActionMessage'\");\n }", "public function read($params)\n\t{\n\t\t$n = 0;\n\t\t$query = new Query();\n\t\t$query->setQuery(\n\t\t\t\"select\\n\" .\n\t\t\t\"\tm.id, m.subject, m.sender_name, m.sent_on,\\n\" .\n\t\t\t\"\tsubstring(m.\\\"body\\\" from 1 for 160) || case when length(m.\\\"body\\\") > 160 then '...' else '' end as \\\"body\\\",\\n\" .\n\t\t\t\"\tmp_id, first_name, middle_names, last_name, disambiguation, first_reply_on, last_reply_on, rs.\\\"body\\\" as reply_body\\n\" .\n\t\t\t\"from\\n\" .\n\t\t\t\"\t(\\n\" .\n\t\t\t\"\t\tselect\\n\" .\n\t\t\t\"\t\t\tmessage_id, mp_id, min(r.received_on) as first_reply_on,\\n\" . \n\t\t\t\"\t\t\tmin(substring(r.\\\"body\\\" from 1 for 160) || case when length(r.\\\"body\\\") > 160 then '...' else '' end) as \\\"body\\\"\\n\" .\n\t\t\t\"\t\tfrom\\n\" .\n\t\t\t\"\t\t\tmessage_to_mp as mtm\\n\" .\n\t\t\t\"\t\t\tleft join reply as r on r.reply_code = mtm.reply_code\\n\" .\n\t\t\t\"\t\twhere\\n\" .\n\t\t\t\"\t\t\tmessage_id in\\n\" .\n\t\t\t\"\t\t\t(\\n\" .\n\t\t\t\"\t\t\t\tselect\\n\" .\n\t\t\t\"\t\t\t\t\tmin(m.id) as id\\n\" .\n\t\t\t\"\t\t\t\tfrom\\n\" .\n\t\t\t\"\t\t\t\t\tmessage as m\\n\" .\n\t\t\t\"\t\t\t\t\tjoin message_to_mp as mtm on mtm.message_id = m.id\\n\"\n\t\t);\n\n\t\t// filter messages to a given country\n\t\tif (isset($params['country']) && !empty($params['country']))\n\t\t{\n\t\t\t$query->appendQuery(\"\t\t\t\t\tjoin parliament as p on p.code = mtm.parliament_code and p.country_code = $\" . ++$n . \"\\n\");\n\t\t\t$query->appendParam($params['country']);\n\t\t}\n\t\t$query->appendQuery(\n\t\t\t\"\t\t\t\t\tjoin mp on mp.id = mtm.mp_id\\n\" .\n\t\t\t\"\t\t\t\twhere\\n\" .\n\t\t\t\"\t\t\t\t\t\\\"state\\\" = 'sent'\\n\" .\n\t\t\t\"\t\t\t\t\tand is_public = 'yes'\\n\"\n\t\t);\n\n\t\t// filter messages for only the ones sent since or until a particular date and time\n\t\tif (isset($params['since']) && !empty($params['since']))\n\t\t{\n\t\t\t$query->appendQuery('\t\t\t\t\tand sent_on >= $' . ++$n . \"\\n\");\n\t\t\t$query->appendParam($params['since']);\n\t\t}\n\t\tif (isset($params['until']) && !empty($params['until']))\n\t\t{\n\t\t\t$query->appendQuery('\t\t\t\t\tand sent_on < $' . ++$n . \"\\n\");\n\t\t\t$query->appendParam($params['until']);\n\t\t}\n\n\t\t// filter messages by fulltext search\n\t\tif (isset($params['text']) && !empty($params['text']))\n\t\t{\n\t\t\t$query->appendQuery(\"\t\t\t\t\tand text_data @@ to_tsquery('simple', $\" . ++$n . \")\\n\");\n\t\t\t$query->appendParam(Utils::makeTsQuery($params['text']));\n\t\t}\n\t\tif (isset($params['sender']) && !empty($params['sender']))\n\t\t{\n\t\t\t$query->appendQuery(\"\t\t\t\t\tand sender_data @@ to_tsquery('simple', $\" . ++$n . \")\\n\");\n\t\t\t$query->appendParam(Utils::makeTsQuery($params['sender']));\n\t\t}\n\n\t\t// filter messages for only the ones addressed to a particular parliaments or MP(s)\n\t\tif (isset($params['parliament']) && !empty($params['parliament']))\n\t\t{\n\t\t\t$query->appendQuery('\t\t\t\t\tand mtm.parliament_code = any($' . ++$n . \")\\n\");\n\t\t\t$query->appendParam(Db::arrayOfStringsArgument(explode('|', $params['parliament'])));\n\t\t}\n\t\tif (isset($params['mp_id']) && !empty($params['mp_id']))\n\t\t{\n\t\t\t$query->appendQuery('\t\t\t\t\tand mp.id = $' . ++$n . \"\\n\");\n\t\t\t$query->appendParam($params['mp_id']);\n\t\t}\n\t\tif (isset($params['recipient']) && !empty($params['recipient']))\n\t\t{\n\t\t\t$query->appendQuery(\"\t\t\t\t\tand mp.name_data @@ to_tsquery('simple', $\" . ++$n . \")\\n\");\n\t\t\t$query->appendParam(Utils::makeTsQuery($params['recipient']));\n\t\t}\n\n\t\t// sort the result\n\t\t$order_by = (isset($params['order']) && $params['order'] == 'replied') ? 'last_reply_on' : 'sent_on';\n\t\t$query->appendQuery(\n\t\t\t\"\t\t\t\tgroup by\\n\" .\n\t\t\t\"\t\t\t\t\t$order_by, sent_on\\n\" .\n\t\t\t\"\t\t\t\torder by\\n\" .\n\t\t\t\"\t\t\t\t\t$order_by desc nulls last, sent_on desc nulls last\\n\"\n\t\t);\n\n\t\t// restrict the output by _limit and _offset\n\t\tif (isset($params['_limit']) && !empty($params['_limit']))\n\t\t{\n\t\t\t$query->appendQuery('\t\t\t\tlimit $' . ++$n . \"\\n\");\n\t\t\t$query->appendParam($params['_limit']);\n\t\t}\n\t\tif (isset($params['_offset']) && !empty($params['_offset']))\n\t\t{\n\t\t\t$query->appendQuery('\t\t\t\toffset $' . ++$n . \"\\n\");\n\t\t\t$query->appendParam($params['_offset']);\n\t\t}\n\n\t\t$query->appendQuery(\n\t\t\t\"\t\t\t)\\n\" .\n\t\t\t\"\t\tgroup by\\n\" .\n\t\t\t\"\t\t\tmessage_id, mp_id\\n\" .\n\t\t\t\"\t) as rs\\n\" .\n\t\t\t\"\tjoin message as m on m.id = rs.message_id\\n\" .\n\t\t\t\"\tjoin mp on mp.id = rs.mp_id\\n\" .\n\t\t\t\"order by\\n\" .\n\t\t\t\"\t$order_by desc nulls last, sent_on desc, first_reply_on, mp.id\\n\"\n\t\t);\n\n\t\t$message_mp = $query->execute();\n\n\t\t// aggregate replies into messages\n\t\t$messages = array();\n\t\tforeach ($message_mp as $mm)\n\t\t{\n\t\t\t$message_id = $mm['id'];\n\t\t\tif (!isset($messages[$message_id]))\n\t\t\t\t$messages[$message_id] = array(\n\t\t\t\t\t'id' => $message_id,\n\t\t\t\t\t'subject' => $mm['subject'],\n\t\t\t\t\t'body' => $mm['body'],\n\t\t\t\t\t'sender_name' => $mm['sender_name'],\n\t\t\t\t\t'sent_on' => $mm['sent_on'],\n\t\t\t\t\t'last_reply_on' => $mm['last_reply_on']\n\t\t\t\t);\n\t\t\tunset($mm['id'], $mm['subject'], $mm['body'], $mm['sender_name'], $mm['sent_on'], $mm['last_reply_on']);\n\t\t\t$messages[$message_id]['recipients'][] = $mm;\n\t\t}\n\n\t\treturn array_values($messages);\n\t}", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n $this->logMessage($postStr);\n\n $messageHandler=new MessageHandler();\n $messageBase=$messageHandler.serialize($postStr);\n $messageToReturn=new MessageBase();\n $messageToReturn->ToUserName=$messageBase->FromUserName;\n $messageToReturn->FromUserName=$messageBase->ToUserName;\n $messageToReturn->CreateTime=time();\n\n if($messageBase->MsgType == \"text\"){\n $messageToReturn->MsgType=\"image\";\n $messageBase->Message=new imageMessage();\n $stor = new SaeStorage();\n $url = $stor->getUrl($domain,$fileDataName);\n $messageBase->Message->PicUrl=$url;\n\n }else{\n $messageToReturn->MsgType=\"text\";\n $messageBase->Message=new textMessage();\n $messageBase->Message->Content=\"try send text message.\";\n\n }\n\n echo $messageHandler->deserialize($messageToReturn);\n/*\n\n\n //extract post data\n if (!empty($postStr)){\n\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml><ToUserName><![CDATA[%s]]></ToUserName><FromUserName><![CDATA[%s]]></FromUserName><CreateTime>%s</CreateTime><MsgType><![CDATA[%s]]></MsgType><Content><![CDATA[%s]]></Content></xml>\"; \n if(!empty( $keyword ))\n {\n $msgType = \"text\";\n $contentStr = \"Welcome to wechat world!\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }else{\n echo \"Input something...\";\n }\n\n }else {\n echo \"\";\n exit;\n }*/\n}", "public function getMessagePart(): ?MessagePart\n {\n return $this->messagePart;\n }", "function prepare_message($m)\n{\n\t\t/*CLEAN MESSAGE INPUT - Only want to sign the plain text*/\n\t\t//Strip html tags to prepare signing of message content\n\t\t$m = preg_replace(\"/(^[\\r\\n]*|[\\r\\n]+)[\\s\\t]*[\\r\\n]+/\", \" \", $m); //Remove empty white lines in message and replace with space.\n\t\t\n\t\t$m = preg_replace(\"/&#?[a-z0-9]{2,8};/i\",\"\",$m); //Removes special characters such as &nbsp; - http://stackoverflow.com/questions/657643/how-to-remove-html-special-chars\n\t\t\n\t\t$m = p_trim_line($m); //trim each line using <br> as delimiter\n\t\t\t\n\t\t$m = strip_all_tags($m); //remove html tags\n\t\t\n\t\t$m = trim($m);\n\t\t\n\t\t$m = preg_replace('!\\s+!', ' ', $m); //reduce multiple white space into one white space - Outlook does this when receiving mail - http://stackoverflow.com/questions/2368539/php-replacing-multiple-spaces-with-a-single-space\n\n\t\treturn $m;\n}", "private function parse()\r\n\t{\r\n\t\t// Suppress annoying notices/warnings\r\n\t\tset_error_handler(function() { /* Nothing */ }, E_NOTICE|E_WARNING);\r\n\r\n\t\t$structure = mailparse_msg_get_structure($this->resource);\r\n\t\t$this->parts = array();\r\n\t\tforeach ($structure as $part_id) {\r\n\t\t\t$part = mailparse_msg_get_part($this->resource, $part_id);\r\n\t\t\t$this->parts[$part_id] = mailparse_msg_get_part_data($part);\r\n\t\t}\r\n\r\n\t\trestore_error_handler();\r\n\t}", "public function get_raw_message() { return $this->raw_message; }", "protected static function normalizeFragment($fragment)\n {\n $fragment = self::encodeQueryFragment(\n self::decodeUrlEncodedChars(\n $fragment,\n '/[' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\\/\\?]/'\n )\n );\n\n return $fragment;\n }", "function sen_sms($to,$text)///ส่ง sms\n{ //create client with api key and secret\n $rest = substr($to, 1);\n $client = new Nexmo\\Client(new Nexmo\\Client\\Credentials\\Basic('c21feb7d', 'yrxEwwXERXj8yv7L'));\n $message = $client->message()->send([\n 'to' => '66'.$rest,\n 'from' => 'RFLpang',\n 'text' => $text,\n 'type' => 'unicode'\n ]);\n //array access provides response data\n //echo \"Sent message to \" . $message['to'] . \". Balance is now \" . $message['remaining-balance'] . PHP_EOL;\n\n return \"Sent message to \" . $message['to'] . \". Balance is now \" . $message['remaining-balance'] . PHP_EOL;\n}", "public function toRelayId() {\n\t\treturn \\GraphQLRelay\\Relay::toGlobalId( ...func_get_args() );\n\t}", "function mFROM(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$FROM;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:146:3: ( 'from' ) \n // Tokenizer11.g:147:3: 'from' \n {\n $this->matchString(\"from\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function parseRequest($message);", "function cutMessageFromBuffer()\n {\n\n $this->logDebug(\"Cutting complete message from front of buffer.\");\n \n $removedSize = $this->ptr;\n \n $rawMessage = substr($this->buffer, 0, $this->ptr);\n $this->buffer = substr($this->buffer, $this->ptr);\n $this->bufferSize -= $removedSize;\n $this->ptr = 0;\n \n return $rawMessage;\n }", "public function fragment($fragment = null)\n {\n if (func_num_args() === 0) {\n return $this->_fragment;\n }\n $this->_fragment = $fragment;\n return $this;\n }", "private function sendMessage($database, $record){\n\n\t\t\t// Preparing message requests\n\t\t\t$messages = json_decode($record['message'], true);\n\n\t\t\t// Add headers for multiple parts\n\t\t\t$chunksId = '';\n\t\t\tif (count($messages)>1) $chunksId = md5(strtotime(\"now\"));\n\n\t\t\t// Sending long messages in chunks and short in a single go\n\t\t\tforeach ($messages as $messagePart){\n\n\t\t\t\t$request = array(\n\t\t\t\t\t'message' => $messagePart,\n\t\t\t\t\t'cellphone' => $record['cellphone'],\n\t\t\t\t);\t\n\n\t\t\t\t// Sending Message\n\t\t\t\t$accessKey = Config::params('sms_service')->access_key;\n\t\t\t\t$originator = Config::params('sms_service')->originator;\n\t\t\t\t$smsType = Config::params('sms_service')->type;\n\t\t\t\t$datacoding = Config::params('sms_service')->datacoding;\n\n\t\t\t\t$MessageBird = new \\MessageBird\\Client($accessKey);\n\t\t\t\t$Message = new \\MessageBird\\Objects\\Message();\n\t\t\t\t$Message->originator = $originator;\n\t\t\t\t$Message->recipients = (int)$request['cellphone'];\n\t\t\t\t$Message->body = $request['message'];\n\t\t\t\t$Message->type = $smsType;\n\t\t\t\t$Message->datacoding = $datacoding;\n\n\t\t\t\tif ($chunksId) $Message->typeDetails['udh'] = $chunksId;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t$MessageResult = $MessageBird->messages->create($Message);\n\t\t\t\t\t//print_r($MessageResult);\n\t\t\t\t} catch (\\MessageBird\\Exceptions\\AuthenticateException $e) {\n\t\t\t\t\t// That means that your accessKey is unknown\n\t\t\t\t\treturn array ('status' => self::FAILED, 'message' => 'SMS API Authentication Failed. Please contact to your Admininstrator.');\n\t\t\t\t} catch (\\MessageBird\\Exceptions\\BalanceException $e) {\n\t\t\t\t\t// That means that you are out of credits, so do something about it.\n\t\t\t\t\treturn array ('status' => self::FAILED, 'message' => 'SMS API Out of Credit. Please contact to your Admininstrator.');\n\t\t\t\t} catch (\\MessageBird\\Exceptions\\RequestException $e) {\n\t\t\t\t\t// That means that either submitted request is invalid or sms provider not supporting that country\n\t\t\t\t\t// updating request status as failed\n\t\t\t\t\t$this->updateRecord($database, $record, 2);\n\t\t\t\t\treturn array ('status' => self::FAILED, 'message' => $e->getMessage());\n\t\t\t\t} catch (\\Exception $e) {\n\t\t\t\t\treturn array ('status' => self::FAILED, 'message' => $e->getMessage());\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn $this->updateRecord($database, $record);\n\t}", "private function __sm ($to_id, $code) {\r\n $message = '';\r\n $time = time();\r\n $line = '';\r\n $line .= \"{$to_id}\\t\";\r\n $line .= \"{$time}\\t\";\r\n $line .= \"{$code}\\t\";\r\n\r\n for ($x=2;$x<func_num_args();$x++) {\r\n if ($x != 2) $message .= ';';\r\n $parm = func_get_arg($x);\r\n $part = str_replace('%', '%25', $parm);\r\n $part = str_replace(';', '%3b', $part);\r\n $message .= $part;\r\n }\r\n $line .= $message;\r\n $line .= \"\\n\";\r\n\r\n if ($this->orig_id == $to_id) {\r\n $this->msg_write(message::DIRECT, $line);\r\n } else {\r\n $this->msg_write(message::INDIRECT_APPEND, $line);\r\n }\r\n return TRUE;\r\n }", "function muxWebMFrame($videoTrack, $frame) {\n $lenSeekHead = 73;\n $lenCues = 24;\n\n // Determine version for EBML header\n $version = 2;\n $videoAttr = $videoTrack->get('Video');\n if (isset($videoAttr)) {\n if ($videoAttr->get('StereoMode') !== NULL) $version = 3;\n if ($videoAttr->get('AlphaMode') !== NULL) $version = 3;\n }\n if ($videoTrack->get('CodecDelay') !== NULL) $version = 4;\n if ($videoTrack->get('SeekPreRoll') !== NULL) $version = 4;\n if ($frame->name() == 'BlockGroup' && $frame->get('DiscardPadding') !== NULL) $version = 4;\n\n // EBML header\n $ebml = ebmlEncodeElement('EBML',\n ebmlEncodeElement('DocType', \"webm\")\n . ebmlEncodeElement('DocTypeVersion', chr($version))\n . ebmlEncodeElement('DocTypeReadVersion', \"\\x02\")\n );\n\n // Segment\n $info = ebmlEncodeElement('Info',\n ebmlEncodeElement('Duration', \"\\x41\\x20\\x00\\x00\")\n . ebmlEncodeElement('MuxingApp', 'ccframe')\n . ebmlEncodeElement('WritingApp', 'ccframe')\n );\n $tracks = ebmlEncodeElement('Tracks',\n ebmlEncodeElement('TrackEntry', $videoTrack->content()->readAll())\n );\n $cues = ebmlEncodeElement('Cues',\n ebmlEncodeElement('CuePoint',\n ebmlEncodeElement('CueTime', \"\\x00\")\n . ebmlEncodeElement('CueTrackPositions',\n ebmlEncodeElement('CueTrack', pack('N', $videoTrack->get('TrackNumber')))\n . ebmlEncodeElement('CueClusterPosition', pack('N', $lenSeekHead + strlen($info) + strlen($tracks) + $lenCues))\n )\n )\n );\n if (strlen($cues) != $lenCues) throw new Exception('length of Cues element wrong');\n $cluster = ebmlEncodeElement('Cluster',\n ebmlEncodeElement('Timecode', \"\\x00\")\n . ebmlEncodeElement($frame->name(), $frame->content()->readAll())\n . ebmlEncodeElement('Void', '')\n );\n $seekHead = ebmlEncodeElement('SeekHead',\n matroskaSeekElement('Info', $lenSeekHead)\n . matroskaSeekElement('Tracks', $lenSeekHead + strlen($info))\n . matroskaSeekElement('Cues', $lenSeekHead + strlen($info) + strlen($tracks))\n . matroskaSeekElement('Cluster', $lenSeekHead + strlen($info) + strlen($tracks) + $lenCues)\n );\n if (strlen($seekHead) != $lenSeekHead) throw new Exception('length of SeekHead element wrong');\n $segment = ebmlEncodeElement('Segment', $seekHead . $info . $tracks . $cues . $cluster);\n\n return $ebml . $segment;\n}", "public function setFragment($fragment)\n {\n $this->fragment = $fragment;\n return $this;\n }", "public function createMessage(): MessageInterface;", "public function getPrevBlock(): BufferInterface;", "public function test_transform_minimal() {\n\t\t\t$text = $this->instance->transform(array(\n\t\t\t\t'revision' => \"r126299\",\n\t\t\t\t'author' => 'ph',\n\t\t\t\t'log' => 'commit message',\n\t\t\t));\n\n\t\t\t$this->assertEquals($text, 'r126299: ph - commit message');\n\t\t}", "public function getMessage(Gri_Reward_Model_Reward_History $item)\n {\n return $item->getMessage();\n }", "private function affichageItemParticipant() : string {\n $i = $this->tab[0][0];\n $i = $this->tab[0][0];\n $l = $this->tab[1][0];\n $message = Message::where('id_parent', '=', $i['id'])->where('type_parent', '=', 'item')->first();\n $testType = explode(\"/\",$i['img']);\n if (count($testType) > 1){\n $image = $i['img'];\n }else{\n $image = \"../../img/\" . $i['img'];\n }\n $reservation = \"\";\n $isReserved = \"<h5><span id='titre_item'>{$i['nom']}</span> <span class=\\\"badge badge-danger\\\">RÉSERVÉ par {$i['reserve']}</span></h5>\";\n $html_message = \"\";\n $cagnotte = \"\";\n $url_cagnotte = $this->container->router->pathFor(\"formCagnotte\", ['token' => $l['token'], 'id_item' => $i['id']]);\n $montantCagnotte = \"\";\n if ($i['reserve'] != \"false\") {\n $html_message = \"<h3><i class=\\\"fa fa-comment-o\\\" aria-hidden=\\\"true\\\"></i>Message de la réservation :</h3><p>{$message['message']}</p>\";\n }\n if ($i['reserve'] == \"false\"){\n $url_reservationItem = $this->container->router->pathFor(\"reserve_item\", ['token' => $l['token'], 'id_item' => $i['id']]);\n $reservation = \"<a class=\\\"btn btn-primary btn-lg\\\" href=\\\"$url_reservationItem\\\" role=\\\"button\\\">Réserver l'item</a>\";\n $isReserved = \"<h5><span id='titre_item'>{$i['nom']}</span> <span class=\\\"badge badge-success\\\">PAS ENCORE RÉSERVÉ</span></h5>\";\n $html_message = \"\";\n }\n if ($i['cagnotteActive'] == \"true\") {\n $reservation = \"\";\n $cagnotte = \"<a class=\\\"btn btn-success btn-lg\\\" href=\\\"$url_cagnotte\\\" role=\\\"button\\\">Participer à la cagnotte</a>\";\n if ($i['cagnotte'] != $i['tarif']) {\n $isReserved = \"<h5><span id='titre_item'>{$i['nom']}</span> <span class=\\\"badge badge-warning\\\">CAGNOTTE EN COURS</span></h5>\";\n $montantCagnotte = \"Montant de la cagnotte : <span class=\\\"badge badge-warning\\\">{$i['cagnotte']}€</span>\";\n }\n else {\n $isReserved = \"<h5><span id='titre_item'>{$i['nom']}</span> <span class=\\\"badge badge-danger\\\">CAGNOTTE COMPLÈTE</span></h5>\";\n $cagnotte = \"<a class=\\\"btn btn-success btn-lg disabled\\\" href=\\\"$url_cagnotte\\\" role=\\\"button\\\">Participer à la cagnotte</a>\";\n }\n\n }\n if ($l['expiration']<$this->today) {\n $reservation = \"<a class=\\\"btn btn-primary btn-lg disabled\\\" href=\\\"$url_reservationItem\\\" role=\\\"button\\\">Réserver l'item</a>\";\n }\n\n if ($i['url'] != \"\") {\n $url =$i['url'];\n } else {\n $url = \"Aucun URL disponible\";\n }\n\n $tarif = \"<span class=\\\"badge badge-info\\\">{$i['tarif']}€</span>\";\n $html = <<<FIN\n <div class=\"box_item\">\n <div class=\"card flex-row\">\n <div class=\"card-header bg-transparent border-0\">\n <img src=\"$image\" onError=\"this.onerror=null;this.src='../../img/default.png';\">\n </div>\n <div class=\"card-body info_item px-5\">\n <h4 class=\"card-title\">$isReserved</h4>\n <p class=\"card-text\">{$i['descr']}</p>\n <p class=\"card-subtitle mb-2 text-muted\">Liste de référence : {$l['titre']}</p>\n <h2 class=\"card-text\">$tarif</h2>\n <h3 class=\"card-text\">$montantCagnotte</h3>\n <br>\n <label for=\"url\" >Ou trouver cet article ?</label>\n <div class=\"input-group mb-3\">\n <div class=\"input-group-prepend\"> \n <span class=\"input-group-text\">URL</span>\n </div>\n <input readonly type=\"text\" class=\"form-control\" aria-label=\"url\" value=\"{$url}\" id=\"myInput\">\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" onclick=\"copyClipboard()\">Copier</button>\n </div>\n </div>\n $reservation\n $cagnotte\n $html_message\n </div>\n \n </div>\n </div>\n FIN;\n return $html;\n }", "private function parseMessage() {\n\n\t\t# Regexp to parse a formatted message\n\t\t# The message should come in format of\n\t\t# :(.*)\\!(.*)\\@(.*) PRIVMSG #channelname \\:(.*) for regular chatter\n\t\t# thus returning nickname, realname, hostmask, (command, arguments) || (botname: command (arguments)) || (chatter)\n\t\t$matched = false;\n\n # Try to match against the bots name!\n # This could mean it is a direct message in chan followed by a command request\n if(!$matched) {\n $pattern = '/:(.*)\\!(.*)\\@(.*) PRIVMSG '.$this->config['destinationChannel'].' \\:('.$this->config['username'].')\\:(?: +)?([^\\s]*) (.*)/';\n preg_match($pattern, $this->inbound, $matches);\n if(count($matches) > 1) {\n $matched = true;\n $this->lastMessage = array(\n 'nickname' => $matches[1],\n 'realname' => $matches[2],\n 'hostname' => $matches[3],\n 'command' => $matches[5],\n 'args' => rtrim($matches[6],\"\\n\\r\"),\n 'chatter' => ''\n );\n # Have to match a case whereby a command of 'botname: command' with no args is provided (for help)\n # If this case occurs we have to do some arg movement otherwise the command parser won't get a hit\n if($this->lastMessage['args'] != \"\" && $this->lastMessage['command'] == '') {\n $this->lastMessage['command'] = $this->lastMessage['args'];\n $this->lastMessage['args'] = \"\";\n }\n }\n }\n\n\t\tif(!$matched) {\n\t\t\t$pattern = '/:(.*)\\!(.*)\\@(.*) PRIVMSG '.$this->config['destinationChannel'].' \\:(.*)/';\n\t\t\tpreg_match($pattern, $this->inbound, $matches);\n\t\t\tif(count($matches) > 1) {\n\t\t\t\t$this->lastMessage = array(\n\t\t\t\t\t'nickname' => $matches[1],\n\t\t\t\t\t'realname' => $matches[2],\n\t\t\t\t\t'hostname' => $matches[3],\n\t\t\t\t\t'command' => '',\n\t\t\t\t\t'args' => '',\n\t\t\t\t\t'chatter' => rtrim($matches[4],\"\\n\\r\")\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "protected function bodyToString()\n {\n $string = '';\n\n if (isset($this->body) && empty($this->immediateChildren)) {\n if ($this->cache->hasKey($this->cacheKey, 'body')) {\n $body = $this->cache->getString($this->cacheKey, 'body');\n } else {\n $body = \"\\r\\n\".$this->encoder->encodeString($this->getBody(), 0, $this->getMaxLineLength());\n $this->cache->setString($this->cacheKey, 'body', $body, Swift_KeyCache::MODE_WRITE);\n }\n $string .= $body;\n }\n\n if (!empty($this->immediateChildren)) {\n foreach ($this->immediateChildren as $child) {\n $string .= \"\\r\\n\\r\\n--\".$this->getBoundary().\"\\r\\n\";\n $string .= $child->toString();\n }\n $string .= \"\\r\\n\\r\\n--\".$this->getBoundary().\"--\\r\\n\";\n }\n\n return $string;\n }", "function filter_mellat_pay_channel_pay_request($transaction){\n $terminalId\t\t= \"xxxxx\";\t\t\t\t\t\t\t//-- شناسه ترمینال\n $userName\t\t= \"xxxxx\"; \t\t\t\t\t\t\t//-- نام کاربری\n $userPassword\t= \"xxxxx\"; \t\t\t\t\t\t\t//-- کلمه عبور\n $transactionData = [];\n\n $parameters = array(\n 'terminalId' \t\t=> $terminalId,\n 'userName' \t\t\t=> $userName,\n 'userPassword' \t\t=> $userPassword,\n 'orderId' \t\t\t=> $transaction->getId(),\n 'amount' \t\t\t=> $transaction->getAmount(),\n 'localDate' \t\t=> $transaction->getInvoiceDate()->format('Ymd'),\n 'localTime' \t\t=> $transaction->getInvoiceDate()->format('Gis'),\n 'additionalData' \t=> \"\",\n 'callBackUrl' \t\t=> $transaction->getCallbackUrl(),\n 'payerId' \t\t\t=> 0\n );\n\n $client \t= new nusoap_client('https://bpm.shaparak.ir/pgwchannel/services/pgw?wsdl');\n $namespace \t='http://interfaces.core.sw.bps.com/';\n $result \t= $client->call('bpPayRequest', $parameters, $namespace);\n\n if (!$client->fault)\n {\n if (!$client->getError())\n {\n $res \t\t= explode (',',$result);\n $ResCode \t= $res[0];\n\n if ($ResCode == \"0\")\n {\n $transactionData['RefId'] = $res[1];\n }\n }\n }\n #TODO: handling mellat pay request error\n #(Store params in transaction for PayForm);\n $transaction->setData($transactionData);\n\n return $transaction;\n}", "public static function getAcceptanceMessagePart1() { self::checkInit(); return self::$acceptanceMessagePart1; }", "function recive_sms(){\n // 'originalsenderid' => '+19179354988',\n // 'body' => 'Chat with you started 5157248',\n // 'message' => 'Chat with you started 5157248',\n // 'sms' => '+16102231415',\n // 'custom_string' => '',\n // 'to' =>'+16102231415',\n // 'original_message_id' => '',\n // 'originalmessageid' => '',\n // 'customstring' => '',\n // 'from' => '+918591041420',\n // 'originalmessage' => '',\n // 'user_id' => '73872',\n // 'subaccount_id' => '86325',\n // 'original_body' => '',\n // 'timestamp' => '1556179523',\n // 'message_id' => 'FBF799B1-2BDC-4D29-86EE-4F9EC69931D7',\n // );\n App::save_data('log_data',array('log_type'=>'sms_receive','log_data'=> json_encode($_POST) ) );\n if(isset($_POST['to'] ) ){\n $to_sms = $_POST['to'];\n $from_sms = $_POST['message'];\n $raw = json_encode($_POST);\n $timestamp = $_POST['timestamp'];\n $datetime = date('Y:m:d H:i:s');\n \n // $from_sms_api = (array) App::get_by_where('leads_sms', array('sms_to'=>$to_sms) );\n \n $newstring = substr($to_sms, -10);\n $this->db->select('*');\n $this->db->from('leads');\n $this->db->like(\"phone\",\"$newstring\");\n $query=$this->db->get();\n $from_sms_api = $query->row();\n \n $leadData = array(\n 'lead_id' =>$from_sms_api->id,\n 'sms_text' => $from_sms,\n 'sms_to' => $to_sms,\n 'sms_type' => 'in',\n 'sms_time' => $datetime,\n );\n App::save_data( 'leads_sms',$leadData);\n App::create_activity('lead_activity',$from_sms_api->id,'SMS Received',json_encode($_POST));\n }\n }", "public function rawMessage(){\n $return = array(\n 'message' => '',\n 'options' => array(),\n );\n if ($this->getWillLend() && $this->isItHome()) {\n $return['message'] = 'bibdk_holding_material_is_home';\n }\n else if (!$this->isItHome() && $this->getExpectedDelivery()) {\n $return['message'] = 'bibdk_holding_material_will_be_home @date';\n $return['options'] = array('@date' => format_date($this->getExpectedDelivery(), 'custom', 'd.m.Y'));\n }\n else if ($note = $this->hasNote()){\n $return['message'] = $note;\n }\n else if ($error = $this->getErrorMessage()) {\n $return['message'] = $error;\n }\n else {\n $return['message'] = 'bibdk_holding_someting_went_wrong';\n }\n\n return $return;\n }", "public function getCustomMeassage($requestId){\n\t\t$db = Zend_Db_Table::getDefaultAdapter();\n\t\t$select = $db->select()\n\t\t->from(array('bpcm' => $this->_name),\n\t\t\t\tarray('message'=>'bpcm.message'))\n\t\t\t\t->joinLeft(array('blqr' => 'bal_child_question_requests'),\n\t\t\t\t\t\t'bpcm.child_id = blqr.child_id',\n\t\t\t\t\t\tarray())\n\t\t\t\t\t\t->where(\"blqr.request_id = $requestId\");\n\t\t\t\t$custommesage = $db->fetchRow($select);\n\t\t\t\tif(empty($custommesage)){\n\t\t\t\t\t$select = $db->select()\n\t\t\t\t\t->from(array('bcqr' => 'bal_child_question_requests'),\n\t\t\t\t\t\t\tarray())\n\t\t\t\t\t\t\t->joinLeft(array('blc' => 'bal_children'),\n\t\t\t\t\t\t\t\t'bcqr.child_id = blc.child_id',\n\t\t\t\t\t\t\t\tarray('name'=>'blc.name','firstname'=>'blc.firstname','lastname'=>'blc.lastname'))\n\t\t\t\t\t\t\t\t->joinLeft(array('blp' => 'bal_parents'),\n\t\t\t\t\t\t\t\t\t\t'blc.parent_id = blp.parent_id',\n\t\t\t\t\t\t\t\t\t\tarray('parent_type'=>'blp.parent_type'))\n\t\t\t\t\t\t\t->where(\"bcqr.request_id = $requestId\");\n\t\t\t\t\t\t\t$custommesage = $db->fetchRow($select);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($custommesage['parent_type'] == 'D'){\n\t\t\t\t\t\t\t\t$type = 'Dad';\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$type = 'Mom';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$name = ucwords($custommesage['firstname']);\n\t\t\t\t\t$custommesage['message'] = \"Question from finny!\";\n\t\t\t\t\treturn $custommesage;\n\t\t\t\t}else {\n\t\t\t\t\treturn $custommesage;\n\t\t\t\t}\n\t\t\t\t\n\t}", "public function convert( $line );" ]
[ "0.4930297", "0.47959396", "0.47086436", "0.46212184", "0.46087193", "0.46082482", "0.45660743", "0.4527378", "0.45169502", "0.44993305", "0.44682652", "0.44578356", "0.44525564", "0.4433574", "0.44219303", "0.4421766", "0.44168875", "0.4413747", "0.44094023", "0.4407176", "0.44029787", "0.43940938", "0.43448517", "0.43101716", "0.43091726", "0.43091726", "0.43091726", "0.42968974", "0.42920813", "0.42789006", "0.4277068", "0.42719588", "0.42487866", "0.4238529", "0.42374602", "0.42346713", "0.42091173", "0.4202693", "0.41859573", "0.41781652", "0.417146", "0.41631898", "0.4162281", "0.41618946", "0.41606358", "0.41558793", "0.4151355", "0.41450357", "0.4140504", "0.41388318", "0.41315538", "0.41290185", "0.41256094", "0.41167614", "0.41153482", "0.41149154", "0.41105443", "0.41091073", "0.4107322", "0.4105999", "0.41038793", "0.41008437", "0.40990454", "0.40987793", "0.40922824", "0.408868", "0.40822616", "0.40818116", "0.40791276", "0.40659058", "0.4032893", "0.4026334", "0.40137488", "0.40109208", "0.39988667", "0.39974436", "0.39962834", "0.39940342", "0.39934045", "0.3989916", "0.39884222", "0.39859387", "0.3985405", "0.3984164", "0.3983808", "0.39831224", "0.39774293", "0.39679545", "0.39570272", "0.39550328", "0.39488736", "0.394704", "0.39416325", "0.39389402", "0.39301732", "0.39263067", "0.39260995", "0.3925714", "0.3925478", "0.39166397" ]
0.46167615
4
Retorna as propriedades dessa classe em array
public function toArray(): array { return [ 'success' => $this->success, 'status' => $this->status, 'data' => $this->data ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get(){\n $array = array();\n foreach($this as $atributo => $valor){\n $array[$atributo] = $valor;\n }\n return $array;\n }", "public function getProperties(): array;", "public function getProperties(): array;", "public function getProperties() : array;", "protected function getDataArray() {\n trace('[METHOD] '.__METHOD__);\n\n\t\t$dataArray = array();\n\n\t\tforeach (get_class_vars( __CLASS__ ) as $propertyname => $pvalue) {\n\t\t\t$getter = 'get_'.$propertyname;\n\t\t\t$dataArray[$propertyname] = $this->$getter();\n\t\t}\n\n\t\treturn $dataArray;\n\t}", "public function getDatas(){\n $r=array();\n $className=get_class($this);\n foreach($this->fields() as $f){\n $r[$f->name]=$f;\n }\n return $r;\n }", "public function toArray() {\n $attrs = $this->_private_attributes;\n $result = array();\n foreach ($attrs as $key => $attr) {\n if (method_exists($this, \"get\" . underscore_to_camel_case($key, true))) {\n eval('$result[\"' . $key . '\"] = $this->get' . underscore_to_camel_case($key, true) . '();');\n } else {\n $result[$key] = $attr;\n }\n }\n return $result;\n }", "public function toArray()\n\t{\n\t\t$string = array();\n\t foreach (get_class_vars(get_class($this)) as $name => $value) \n\t {\n\t \t$string[$name] = $value;\n\t }\n\t return $string;\n\t}", "public function toArray() : array{\n return get_object_vars( $this );\n }", "public final function __toArray()\n {\n $data = array();\n \n $all_fields = $this->__get_fields();\n \n foreach ($all_fields as $key => $value)\n {\n $data[$key] = $value;\n }\n \n $data[self::CLASS_FIELD_KEY] = $this->__getRawClassName();\n \n return $data;\n }", "function getArrayCampos() {\n\t\t$arr = array(\n\t\t\t\"id\"=>$this->id,\n\t\t\t\"idov\"=>$this->idov,\n\t\t\t\"ordinal\"=>$this->ordinal,\n\t\t\t\"visible\"=>$this->visible,\n\t\t\t\"iconoov\"=>$this->iconoov,\n\t\t\t\"name\"=>$this->name,\n\t\t\t\"idov_refered\"=>$this->idov_refered,\n\t\t\t\"idresource_refered\"=>$this->idresource_refered,\n\t\t\t\"type\"=>$this->type\n\t\t);\n\t\treturn $arr;\n\t}", "public function generateArray()\n {\n return $this->getProperties();\n }", "function asArray() {\n\t\t\n\t\t\t$myArray = array();\n\t\t\t\n\t\t\tforeach (get_object_vars($this) as $column => $value) {\n\t\t\t\tif (substr($column, 0, 1) != '_') {\n\t\t\t\t\t$myArray[$column] = $value;\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $myArray;\n\t\t\t\n\t\t}", "public function getAsArray(): array {\n\t\t$result = [];\n\t\tforeach ( self::FIELD_MAPPING as $field => $_ ) {\n\t\t\t$result[$field] = $this->$field;\n\t\t}\n\t\treturn $result;\n\t}", "public function convertObjIntoAssArr(){\n\n $assArrOfObjPro = array();\n//taking value from array and checking if property is in class and than assign key and value to make array\n foreach(self::$db_table_fields as $db_table_field){\n if(property_exists($this,$db_table_field)){\n $assArrOfObjPro[$db_table_field] = $this->$db_table_field;\n }\n } return $assArrOfObjPro;\n }", "public static function toArray() {\n return [\n 'name' => static::getName(),\n 'identifier' => static::getIdentifier()\n ];\n }", "public function getProperties(): array\n {\n return array_keys(get_object_vars($this));\n }", "public function populatableProperties() : array;", "public function toArray()\n\t {\n\t $claseArray = get_object_vars($this);\n\t foreach ($this->fields as $key => $value) {\n\t $this->fields[$key] = $claseArray[lcfirst($value)];\n\t}\n\treturn $this->fields;\n\t }", "public function toArray()\n\t {\n\t $claseArray = get_object_vars($this);\n\t foreach ($this->fields as $key => $value) {\n\t $this->fields[$key] = $claseArray[lcfirst($value)];\n\t}\n\treturn $this->fields;\n\t }", "public function toArray() :array {\n return get_object_vars($this);\n }", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function get_all(){\n return get_object_vars($this);\n }", "protected function getObjectData($class) {\n $struct = $this->getClassProperties($class);\n $data = array();\n foreach($struct as $field) {\n $key = $field->name;\n $data[$key] = $this->$key;\n }\n return $data;\n }", "public function getData(){\n $values = array();\n $attributes = $this->defineAttributes();\n if(property_exists($this, 'handle') && property_exists($this, 'type')){\n $matrixAttributes = anu()->matrix->getMatrixByName($this->handle)->defineAttributes()[$this->type];\n $attributes = array_merge($attributes, $matrixAttributes);\n }\n\n foreach ($attributes as $k => $v){\n if(property_exists($this, $k)){\n $values[$k] = $this->$k;\n }\n }\n return $values;\n }", "public function toArray()\n\t{\n\t\t$defaults = $this->reflectionClass->getDefaultProperties();\n\t\t$return = array();\n\t\t\n\t\tforeach($defaults as $var => $val)\n\t\t{\n\t\t\tif($this->$var instanceof Model)\n\t\t\t{\n\t\t\t\t$return[$var] = $this->$var->toArray();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$return[$var] = $this->$var;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $return;\n\t}", "public function getAttributes(): array\n {\n // Get all attributes using all the getters.\n $attributes = [];\n foreach(\\array_keys(\\get_object_vars($this)) as $attribute) {\n\n // Construct the getter name.\n $getter = \\lcfirst(\\str_replace('_', '', \\ucwords($attribute, '_')));\n\n // Get the attribute's value from the getter.\n $attributes[$attribute] = $this->{$getter}();\n }\n\n return $attributes;\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function getPropertiesList() : array;", "protected function toArray()\n {\n $properties = array();\n\n foreach ( $this as $property => $value ) {\n $properties[$property] = $value;\n }\n\n return $properties;\n }", "public function toArray()\n {\n return get_object_vars($this);\n }", "final protected function getKeysProperty(): ArrObject\n {\n return arr(array_keys($this->items));\n }", "public function toArray()\n {\n $return = array();\n foreach ( $this as $property => $value ) {\n if ( '__' == substr( $property, 0, 2 ) || '' === $value || is_null( $value ) || ( is_array( $value ) && empty( $value ) ) ) {\n continue;\n }\n $return[ $property ] = $value;\n }\n\n return $return;\n }", "public function toArray() {\n\t\t$array = [ ];\n\t\t$vars = get_object_vars($this);\n\t\tforeach ( $vars as $property => $value ) {\n\t\t\t$array[$property] = $value;\n\t\t}\n\n\t\treturn $array;\n\t}", "public function toArray($cls) {\n return get_object_vars($cls);\n }", "public function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "public function attributes() : array;", "public function toArray()\n {\n $fields = array(); \n foreach ($GLOBALS['InfusionsoftApp']->fields[$this->_table] as $field)\n {\n $fields[$field] = $this->$field;\n } \n return $fields;\n }", "public function getFields() : array\n {\n return get_object_vars($this);\n }", "public function toArray(): array\n\t{\n\t\treturn\n\t\t\t[\n\t\t\t\t\"id\" => $this->getId(),\n\t\t\t\t\"name\" => $this->name,\n\t\t\t\t\"completable\" => $this->completable,\n\t\t\t\t\"classes\" => $this->classes\n\t\t\t];\n\t}", "protected function properties(){\n\t\t$properties = array();\n\t\tforeach(static::$db_table_fields as $db_field){\n\t\t\tif(property_exists($this,$db_field)){\n\t\t\t$properties[$db_field]= $this->$db_field;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $properties;\t\n\t}", "public function toArray()\n\t{\n\t\t$columns = array();\n\t\t\n\t\t$rf = new ReflectionClass($this);\n\t\t$props = $rf->getProperties();\n\t\tforeach ($props as $prop)\n\t\t{\n\t\t\t$column = AttributeReader::PropertyAttributes($this,$prop->getName())->Column;\n\t\t\tif ($column != \"\")\n\t\t\t\t$columns[$column] = $prop->getValue($this);\n\t\t}\n\n\t\treturn $columns;\n\t}", "function prepare_array() {\n\n\t\t$obj['name'] = $this->name->value;\n\t\t$obj['url'] = $this->url->value;\n\t\t$obj['image'] = $this->image->value;\n\t\t$obj['description'] = $this->description->value;\n\t\t/*\n\t\tforeach($this as $key => $value) {\n\n\t\t\t$obj[$key] = $value;\n\n\t\t}\n\t*/\n\t\treturn $obj;\n\t}", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function toArray(): array\n\t{\n\t\t$values = [];\n\n\t\tforeach ((array) $this as $key => $value) {\n\t\t\t// Private and protected properties have ugly array key prefixes which we remove\n\t\t\t$key = preg_replace('~^.+\\0~', '', $key);\n\t\t\t$values[$key] = $value;\n\t\t}\n\n\t\treturn $values;\n\t}", "public function toArray() {\n return get_object_vars($this);\n }", "protected function property_map() { return array(); }", "function toArray()\n {\n $retorno = array();\n foreach ($this as $key => $value) {\n array_push($retorno, $value);\n }\n return $retorno;\n }", "public function getFields(): array;", "public function getFields(): array;", "public function getFields(): array;", "protected function properties(){\n\n // Here we are making an array, we are looping through the table to see if the fields in the table exist, if so. It is being stored into array \n $properties = array();\n foreach (static::$table_users_field as $users_field) {\n if(property_exists($this,$users_field)){\n $properties[$users_field] = $this->$users_field;\n }\n }\n\n return $properties;\n }", "public function getArrayCopy()\n {\n $ref = new \\ReflectionClass($this);\n $props = $ref->getProperties();\n $props = array_filter(\n $props,\n function($x) { return $x->class == get_class($this); });\n\n $ret = [];\n foreach($props as $prop)\n {\n $key = $prop->name;\n $value = $this->$key;\n if ( ! is_null($value) )\n {\n $ret[$key] = $value;\n }\n }\n\n return $ret;\n }", "protected function attributes() {\n\t $attributes = array();\n\t foreach(static::$table_fields as $field) {\n\t if(property_exists( $this, $field)) {\n\t $attributes[$field] = $this->$field;\n\t }\n\t }\n\t return $attributes;\n }", "public function getData() {\r\n $dados = [];\r\n foreach ($this as $key => $value) {\r\n if (\\property_exists(I18n::class, $key)) {\r\n $dados[$key] = $value;\r\n }\r\n }\r\n return $dados;\r\n }", "public function toArray()\n {\n return get_object_vars($this);\n }", "public function toArray()\n {\n return get_object_vars($this);\n }", "function getTipoParqueo()\n{\n return array(\n array('codigo' => 'MTO', 'valor' => 'Moto'),\n array('codigo' => 'CAR', 'valor' => 'Carro'),\n array('codigo' => 'TRK', 'valor' => 'Camion'),\n );\n}", "abstract public function getFields(): array;", "private function get_object_array($array){\n \n }", "public function getProperties()\n {\n return array_keys($this->toArray());\n }", "public function getCustomAttributes(): array;", "public static function getProperties()\n {\n return [\n 'Type' => [false, self::PROPERTY_TYPE_ENUM, null, false, false],\n 'Name' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'ABN' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'BSB' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'AccountNumber' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'AccountName' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'ElectronicServiceAddress' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'SuperFundID' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'EmployerNumber' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'SPIN' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n ];\n }", "public function Properties($visible=true){\r\n $reflection=new ReflectionClass($this);\r\n $properties=$reflection->getProperties();\r\n $result=array();\r\n if($visible){\r\n foreach ($properties as $property) {\r\n $result[$property->getName()]=$property->getValue($this);\r\n }\r\n }\r\n else{\r\n foreach ($properties as $property) {\r\n $result[]=$property->getName();\r\n }\r\n }\r\n return $result;\r\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function getArray() {\n return array(\n \"id\" => $this->id, \n \"nombreGrupo\" => $this->nombre, \n //\"idag\" => $this->idap, \n );\n }", "protected function getAttributes(): array\n {\n return array_keys(get_class_vars(static::class));\n }", "public function __get($name) {\n\t\t\t$out = [];\n\t\t\tforeach ($this as $rec) {\n\t\t\t\t$out[] = $rec->$name;\n\t\t\t}\n\t\t\treturn $out;\n\t\t}", "public function toArray(): array\r\n {\r\n return get_object_vars($this);\r\n }", "public function put_basics()\n\t\t{\n\t\t\t$retArr = array(); \n\t\t\t// Scaffolding Code For Single:\n\t\t\t$retArr = $this->obj->getBasics();\n\n\t\t\treturn $retArr;\n\t\t}", "protected function properties(){\n //return get_object_vars($this);\n $properties = array();\n //foreach(self::$db_table_fields as $db_field){\n foreach(static::$db_table_fields as $db_field){\n if(property_exists($this, $db_field)){\n \n $properties[$db_field] = $this->$db_field;\n }\n }\n return $properties;\n\n }", "public function getArray() {\n return array(\n \"id\" => $this->id, \n \"nombreDepartamento\" => $this->nombre, \n //\"idap\" => $this->idap, \n );\n }", "public function toArray() {\n\t\t\t$result = array();\n\t\t\tforeach (array_keys(static::$_fields) as $key) {\n\t\t\t\t$result[$key] = $this->getData($key);\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "public function toArray() {\n $vars = get_object_vars ( $this );\n $array = array ();\n foreach ( $vars as $key => $value ) {\n $array [ltrim ( $key, '_' )] = $value;\n }\n return $array;\n }", "public function getAsArray() {\n return array(\"id\" => $this->id, \"name\" => $this->name, \"park\" => get_object_vars($this->park), \"code\" => $this->code);\n }", "public function toArray() {\n\t\treturn array(\n\t\t\tself::FIELD_ID=>$this->getId(),\n\t\t\tself::FIELD_GENRE=>$this->getGenre(),\n\t\t\tself::FIELD_JAAR=>$this->getJaar(),\n\t\t\tself::FIELD_MAAND=>$this->getMaand(),\n\t\t\tself::FIELD_NUMMER=>$this->getNummer(),\n\t\t\tself::FIELD_MUTUALITEIT=>$this->getMutualiteit(),\n\t\t\tself::FIELD_FACTUURDATUM=>$this->getFactuurdatum(),\n\t\t\tself::FIELD_FACTUURFILE=>$this->getFactuurFile(),\n\t\t\tself::FIELD_CREDITACTIEF=>$this->getCreditActief(),\n\t\t\tself::FIELD_VERVANGT=>$this->getVervangt());\n\t}", "public function attributes()\n {\n $attributes = array();\n foreach(self::$db_fields as $field)\n {\n if(property_exists($this,$field))\n {\n $attributes[$field] = $this->$field;\n }\n }\n return $attributes;\n }", "public function attributes(){\r\n /*\r\n $attributes = array();\r\n foreach(self::$db_fields as $field){\r\n if(property_exists($this, $field)){\r\n\t $attributes[$field] = $this->$field;\r\n\t }\r\n }\r\n return $attributes;\r\n */\r\n \r\n //return get_object_vars($this);\r\n return $this->variables;\r\n }", "public function getAllProperties(): array\n {\n return get_object_vars($this);\n }", "public function properties() : array\n {\n return array_keys($this->_properties);\n }", "public function toArray($prefix='') {\n $r = array();\n foreach($this as $field => $data) {\n if(! is_object($data) && ! is_array($data)) {\n $r[$field] = $data;\n }\n }\n return $r;\n }", "public static function get_attributes($classname){\n\t\t$modelname = Model_Kiwi::get_modelname( $classname );\n\t\t$r = new ReflectionClass($modelname);\n\t\t$ar_model = $r->newInstanceArgs( array() );\n\t\t$model_attr1 = $ar_model->attributes();\n\t\t//print_r( Model_Resource::);\n\t\t//print_r($model_attr1);\n\t\treturn array_keys($model_attr1);\n\t}", "public function get_basics()\n\t\t{\n\t\t\t$retArr = array();\n \t\t\t// Scaffolding Code For Single:\n\t\t\t$retArr = $this->obj->getBasics();\n\n\t\t\treturn $retArr;\n\t\t}", "public function fields() : array\n {\n $fields = [];\n foreach ($this->queries as $class) {\n $fields[$class::$name] = (new $class)->toArray();\n }\n return $fields;\n }", "public function toArray()\n\t{\n\t\t$result = new \\stdClass();\n\t\t\n\t\t// Objetos adicionadas a esta classe\n\t\tforeach ($this as $key => $entity) {\n\t\t\t$result->$key = clone $entity;\n\t\t}\n\t\treturn $result;\n\t}", "public function getPropertyAnnotations(string $class, string $propriety): array;", "public function get_basics()\n\t\t{\n\t\t\t$retArr = array();\n\t\t\t// Scaffolding Code For Single:\n\t\t\t$retArr = $this->obj->getBasics();\n\n\t\t\treturn $retArr;\n\t\t}", "function get(array $data) {\n\t\t$values = [];\n\t\tforeach ($data as $key) {\n\t\t\t$values[$key] = $this->$key ?? null;\n\t\t}\n\n\t\treturn $values;\n\t}" ]
[ "0.719854", "0.7169997", "0.7169997", "0.7083177", "0.69528675", "0.69208497", "0.6843223", "0.67288196", "0.6718211", "0.6682005", "0.6656729", "0.6626244", "0.6569207", "0.65538913", "0.65359896", "0.6521179", "0.6508747", "0.64953655", "0.64943534", "0.64943534", "0.64790106", "0.64722663", "0.64722663", "0.64722663", "0.64722663", "0.64722663", "0.64722663", "0.64722663", "0.64722663", "0.64722663", "0.6463935", "0.6463935", "0.64426917", "0.6436828", "0.6417916", "0.6406547", "0.6404781", "0.6394139", "0.6393599", "0.63836324", "0.6377982", "0.63773686", "0.63763696", "0.6374325", "0.63382965", "0.6332817", "0.6331399", "0.63299507", "0.63262826", "0.63222796", "0.63220084", "0.6313254", "0.6311182", "0.6302922", "0.6302922", "0.6302922", "0.6302922", "0.6302659", "0.6298742", "0.6293407", "0.628039", "0.6278006", "0.6278006", "0.6278006", "0.6276744", "0.62707454", "0.62676495", "0.6266728", "0.6264856", "0.6264856", "0.6260807", "0.6260288", "0.62600315", "0.6256676", "0.6255854", "0.625114", "0.62501305", "0.6245126", "0.62425566", "0.62321573", "0.6229254", "0.62226516", "0.622198", "0.6208048", "0.6191089", "0.6179003", "0.61780304", "0.61728936", "0.6167532", "0.6165437", "0.6163113", "0.6158497", "0.6153826", "0.61520225", "0.6149627", "0.61416465", "0.61411005", "0.6137916", "0.6129534", "0.6128356", "0.6128071" ]
0.0
-1
Guarda un objeto Proveedor en la base de datos.
public function insert($proveedor);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store()\n\t{\n\t\t$authuser = Auth::user();\n\t\t$rules = array(\n\t\t\t'proveedor_tipo' => 'not_in:NA',\n\t\t\t'nombre_usuario' => 'required',\n\t\t\t'nombre' => 'required',\n\t\t\t//'direccion' => 'required',\n\t\t\t//'telefono' => 'required',\n\t\t\t//'facebook' => 'required',\n\t\t\t//'twitter' => 'required',\n\t\t\t//'otro_sns' => 'required',\n\t\t\t'longitud' => 'required|numeric',\n\t\t\t'latitud' => 'required|numeric',\n\t\t\t'introduccion' => 'required',\n\t\t\t'descripcion' => 'required',\n\t\t\t'vision' => 'required',\n\t\t\t'productos' => 'required',\n\t\t\t'imagen_intro' => 'mimes:png,gif,jpeg|max:20000',\n\t\t\t'imagen_descripcion' => 'mimes:png,gif,jpeg|max:20000',\n\t\t\t'imagen_vision' => 'mimes:png,gif,jpeg|max:20000',\t\n\t\t);\n\t\t$validator = Validator::make(Input::all(), $rules);\t\t\n\t\t\n\t\tif ($validator->fails()) {\n\t\t\treturn Redirect::to('vistausuario/proveedor/create')\n\t\t\t\t->withErrors($validator)->withInput();\n\t\t} else {\n\t\t\n\t\t$proveedores = new Proveedor;\n\t\t$proveedores_detalle = new ProveedorDetalle;\n\n\t\t$nombreDeUsuario = Input::get('nombre_usuario');\n\n\t\t$proveedores->id=0;\n\t\t$proveedores->proveedor_tipo_idproveedor_tipo=Input::get('proveedor_tipo');\n\t\t$proveedores->nombre_usuario=Input::get('nombre_usuario');\n\t\t$proveedores->nombre=Input::get('nombre');\n\t\t$proveedores->direccion=Input::get('direccion');\n\t\t$proveedores->telefono=Input::get('telefono');\n\t\t$proveedores->facebook=Input::get('facebook');\n\t\t$proveedores->twitter=Input::get('twitter');\n\t\t$proveedores->otro_sns=Input::get('otro_sns');\n\t\t$proveedores->longitud=Input::get('longitud');\n\t\t$proveedores->latitud=Input::get('latitud');\n\t\t$proveedores->habilitar = 0;\n\t\t$proveedores->solicitar_premium= 0;\n\t\t$proveedores->usuario_id = $authuser->id;\n\t\t$proveedores->save();\n\n\t\t$idproveedor = $proveedores->id;\n\n\t\t$proveedores_detalle->id=0;\n\t\t$proveedores_detalle->proveedores_idproveedor=$idproveedor;\n\t\t$proveedores_detalle->proveedores_proveedor_tipo_idproveedor_tipo=Input::get('proveedor_tipo_idproveedor_tipo');\n\t\t$proveedores_detalle->introduccion=Input::get('introduccion');\n\t\t$proveedores_detalle->descripcion=Input::get('descripcion');\n\t\t$proveedores_detalle->vision=Input::get('vision');\n\t\t$proveedores_detalle->productos=Input::get('productos');\n\t\t$proveedores_detalle->proveedores_proveedor_tipo_idproveedor_tipo = Input::get('proveedor_tipo');\n\n\t\tif(!File::exists('images/proveedores/'.$nombreDeUsuario)) {\n\t\t $result = File::makeDirectory('images/proveedores/'.$nombreDeUsuario, 0777);\n\t\t}\n\n\t\t$imagen_intro = Input::file('imagen_intro');\n\t\t$file = $imagen_intro;\n\t\t$rules = array(\n\t\t 'file' => 'required|mimes:png,gif,jpeg|max:20000'\n\t\t);\n\t\t$validator = \\Validator::make(array('file'=> $file), $rules);\n\t\tif($validator->passes()){\n\n\t\t\t$id = Str::random(4);\n\t\t\t$date_now = new DateTime();\n\n\t\t $destinationPath = 'images/proveedores/'.$nombreDeUsuario;\n\t\t $filename = $date_now->format('YmdHis').$id;\n\t\t $mime_type = $file->getMimeType();\n\t\t $extension = $file->getClientOriginalExtension();\n\t\t $upload_success = $file->move($destinationPath, $filename.'.'.$extension);\n\t\t\t$proveedores_detalle->imagen_intro=$filename.'.'.$extension;\n\t\t} else {\n\t\t $proveedores_detalle->imagen_intro = '';\n\t\t}\n\t\t\n\n\t\t$imagen_descripcion = Input::file('imagen_descripcion');\n\t\t$file = $imagen_descripcion;\n\t\t$rules = array(\n\t\t 'file' => 'required|mimes:png,gif,jpeg|max:20000'\n\t\t);\n\t\t$validator = \\Validator::make(array('file'=> $file), $rules);\n\t\tif($validator->passes()){\n\n\t\t $id = Str::random(4);\n\t\t\t$date_now = new DateTime();\n\n\t\t $destinationPath = 'images/proveedores/'.$nombreDeUsuario;\n\t\t $filename = $date_now->format('YmdHis').$id;\n\t\t $mime_type = $file->getMimeType();\n\t\t $extension = $file->getClientOriginalExtension();\n\t\t $upload_success = $file->move($destinationPath, $filename.'.'.$extension);\n\t\t\t$proveedores_detalle->imagen_descripcion=$filename.'.'.$extension;\n\t\t} else {\n\t\t\t$proveedores_detalle->imagen_descripcion='';\n\t\t}\t\n\t\t\n\n\n\t\t$imagen_vision = Input::file('imagen_vision');\n\t\t$file = $imagen_vision;\n\t\t$rules = array(\n\t\t 'file' => 'required|mimes:png,gif,jpeg|max:20000'\n\t\t);\n\t\t$validator = \\Validator::make(array('file'=> $file), $rules);\n\t\tif($validator->passes()){\n\n\t\t $id = Str::random(4);\n\t\t\t$date_now = new DateTime();\n\n\t\t $destinationPath = 'images/proveedores/'.$nombreDeUsuario;\n\t\t $filename = $date_now->format('YmdHis').$id;\n\t\t $mime_type = $file->getMimeType();\n\t\t $extension = $file->getClientOriginalExtension();\n\t\t $upload_success = $file->move($destinationPath, $filename.'.'.$extension);\n\t\t\t$proveedores_detalle->imagen_vision=$filename.'.'.$extension;\n\t\t} else {\n\t\t\t$proveedores_detalle->imagen_vision='';\n\t\t}\t\t\t\t\n\t\t\n\t\t$proveedores_detalle->save();\n\n\t\treturn Redirect::to(\"vistausuario/\")->with(array('usuarioimg'=>$authuser->imagen, 'usuarionombre'=>$authuser->nombre, 'usuarioid'=>$authuser->id));\t\t\n\t\t}\n\t}", "function Proveeedor($cedulaProveedor, $nombre, $telefono, $productos) {\n $this->cedulaProveedor = $cedulaProveedor;\n $this->nombre = $nombre;\n $this->telefono = $telefono;\n $this->productos = $productos;\n }", "public function __construct(){\r\n $this->proveedores=array();\r\n }", "public function edit(Proveedor $proveedor)\n {\n //\n }", "public function select($proveedor);", "function guardar_producto_proceso($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Valida el tipo de producto: 5-> Receta, 4-> Insumo preparado\n\t\t//$tipo = ($datos['tipo']==1) ? 5 : 4 ;\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tprd_productos_procesos\n\t\t\t\t\t\t(id_producto, id_proceso)\n\t\t\t\tVALUES\n\t\t\t\t\t(\".$datos['id_producto'].\",\".$datos['id_proceso'].\")\";\n\t \t//return $sql;\n\t\t$result =$this->insert_id($sql);\n\n\t\treturn $result;\n\t}", "public function ActualizarProveedores()\n\t\t{\n\t\t\tself::SetNames();\n\t\t\tif(empty($_POST[\"ritproveedor\"]) or empty($_POST[\"nomproveedor\"]) or empty($_POST[\"direcproveedor\"]) or empty($_POST[\"tlfproveedor\"]))\n\t\t\t{\n\t\t\t\techo \"1\";\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t$sql = \" select * from proveedores where codproveedor != ? and ritproveedor = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->execute( array($_POST[\"codproveedor\"], $_POST[\"ritproveedor\"]) );\n\t\t\t$num = $stmt->rowCount();\n\t\t\tif($num == 0)\n\t\t\t{\n\n\t\t\t\t$sql = \" update proveedores set \"\n\t\t\t\t.\" ritproveedor = ?, \"\n\t\t\t\t.\" nomproveedor = ?, \"\n\t\t\t\t.\" direcproveedor = ?, \"\n\t\t\t\t.\" tlfproveedor = ?, \"\n\t\t\t\t.\" emailproveedor = ?, \"\n\t\t\t\t.\" contactoproveedor = ? \"\n\t\t\t\t.\" where \"\n\t\t\t\t.\" codproveedor = ?;\n\t\t\t\t\";\n\t\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t\t$stmt->bindParam(1, $ritproveedor);\n\t\t\t\t$stmt->bindParam(2, $nomproveedor);\n\t\t\t\t$stmt->bindParam(3, $direcproveedor);\n\t\t\t\t$stmt->bindParam(4, $tlfproveedor);\n\t\t\t\t$stmt->bindParam(5, $emailproveedor);\n\t\t\t\t$stmt->bindParam(6, $contactoproveedor);\n\t\t\t\t$stmt->bindParam(7, $codproveedor);\n\n\t\t\t\t$ritproveedor = strip_tags($_POST[\"ritproveedor\"]);\n\t\t\t\t$nomproveedor = strip_tags($_POST[\"nomproveedor\"]);\n\t\t\t\t$direcproveedor = strip_tags($_POST[\"direcproveedor\"]);\n\t\t\t\t$tlfproveedor = strip_tags($_POST[\"tlfproveedor\"]);\n\t\t\t\t$emailproveedor = strip_tags($_POST[\"emailproveedor\"]);\n\t\t\t\t$contactoproveedor = strip_tags($_POST[\"contactoproveedor\"]);\n\t\t\t\t$codproveedor = strip_tags($_POST[\"codproveedor\"]);\n\t\t\t\t$stmt->execute();\n\n\t\t\t\techo \"<div class='alert alert-info'>\";\n\t\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\t\techo \"<span class='fa fa-check-square-o'></span> EL PROVEEDOR FUE ACTUALIZADO EXITOSAMENTE\";\n\t\t\t\techo \"</div>\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"3\";\n\t\t\t\texit;\n\t\t\t}\n\t\t}", "public function store(Request $request)\n {\n \n $proveedores = new Proveedores($request->all());\n \n\n\n if($proveedores->save()){\n session()->flash('crearproveedores', \"Un Proveedor fue creado\");\n return redirect(\"proveedores\");\n }else{\n return view('proveedores.create',[\"proveedores\"=>$proveedores]);\n }\n }", "public function RegistrarProveedores()\n{\n\tself::SetNames();\n\tif(empty($_POST[\"ritproveedor\"]) or empty($_POST[\"nomproveedor\"]) or empty($_POST[\"direcproveedor\"]) or empty($_POST[\"tlfproveedor\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\t$sql = \" select ritproveedor from proveedores where ritproveedor = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_POST[\"ritproveedor\"]) );\n\t$num = $stmt->rowCount();\n\tif($num == 0)\n\t{\n\t\t$query = \" insert into proveedores values (null, ?, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $ritproveedor);\n\t\t$stmt->bindParam(2, $nomproveedor);\n\t\t$stmt->bindParam(3, $direcproveedor);\n\t\t$stmt->bindParam(4, $tlfproveedor);\n\t\t$stmt->bindParam(5, $emailproveedor);\n\t\t$stmt->bindParam(6, $contactoproveedor);\n\n\t\t$ritproveedor = strip_tags($_POST[\"ritproveedor\"]);\n\t\t$nomproveedor = strip_tags($_POST[\"nomproveedor\"]);\n\t\t$direcproveedor = strip_tags($_POST[\"direcproveedor\"]);\n\t\t$tlfproveedor = strip_tags($_POST[\"tlfproveedor\"]);\n\t\t$emailproveedor = strip_tags($_POST[\"emailproveedor\"]);\n\t\t$contactoproveedor = strip_tags($_POST[\"contactoproveedor\"]);\n\t\t$stmt->execute();\n\n\t\techo \"<div class='alert alert-success'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<span class='fa fa-check-square-o'></span> EL PROVEEDOR FUE REGISTRADO EXITOSAMENTE\";\n\t\techo \"</div>\";\t\t\n\t\texit;\n\t}\n\telse\n\t{\n\t\techo \"3\";\n\t\texit;\n\t}\n}", "public function store(Request $request)\n {\n $validate = DB::table('tipo_proveedores')->where('tipo_proveedor_desc', $request->tipo_proveedor_desc)->exists();\n\n if($validate == true)\n {\n flash('El Tipo de Servicio '.$request->tipo_proveedor_desc.' ya existe en la base de datos')->warning();\n return redirect('/proveedor');\n }else\n\n try {\n\n $proveedor = new Tipo_Proveedor();\n $proveedor->tipo_proveedor_desc = $request->tipo_proveedor_desc;\n $proveedor->save();\n\n\n flash('El Proveedor se creo correctamente.')->success();\n return redirect('proveedor');\n\n }catch (\\Exception $e) {\n\n\n\n flash('Error al crear el Proveedor.')->error();\n flash($e->getMessage())->error();\n return redirect('proveedor');\n }\n }", "PUBLIC function Proveedor(){\n return $this->belongsto('App\\Models\\proveedor','id');\n }", "public function get_proveedor($idProveedor,$idEmpresa){\n if($idProveedor != '' || $idEmpresa != ''){\n\n $this->_query =\n \"\n select \n idproveedor,\n idempresa,\n nombre_proveedor,\n descripcion_proveedor,\n telefono01,\n telefono02,\n correo,\n celular,\n direccion,\n idestado,\n fecha_alta,\n fecha_um,\n idusuario_alta,\n idusuario_um\n from \n proveedores \n WHERE \n idproveedor = $idProveedor AND\n idempresa = '$idEmpresa' \n ORDER BY nombre_proveedor DESC \n \";\n\n $this->get_result_query();\n\n }\n\n if(count($this->_rows) == 1){\n\n foreach ($this->_rows[0] as $campo => $valor){\n $this->$campo = $valor ;\n }\n\n $this->_confirm = true ;\n $this->_message = \"Se encontro el proveedor\";\n\n }else{\n $this->_confirm = false ;\n $this->_message = \"No se encontro el proveedor\" ;\n }\n\n }", "public function delete($proveedor);", "public function store(ProveedorRequest $request){\n Proveedor::create($request->all());\n\n $filtro = (isset($request->filtro) && !empty($request->filtro))?$request->filtro:'';\n $page = $request->page;\n $proveedores = Proveedor::buscar($filtro)->paginate(5);\n\n return response()->json(view('admin.compras.proveedores.index.include.tProveedores', \n ['proveedores' => $proveedores])->render());\n }", "public function datos_proveedores() \n {\n return Proveedor::all();\n }", "function guardar_producto($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Valida el tipo de producto: 5-> Receta, 4-> Insumo preparado\n\t$tipo = ($datos['tipo']==1) ? 1 : 4 ;\n\n\n\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tapp_productos\n\t\t\t\t\t\t(codigo, nombre, precio, linea, costo_servicio, id_unidad_venta, id_unidad_compra,\n\t\t\t\t\t\t\ttipo_producto\n\t\t\t\t\t\t)\n\t\t\t\tVALUES\n\t\t\t\t\t('\".$datos['codigo'].\"','\".$datos['nombre'].\"',\".$datos['precio_venta'].\",\n\t\t\t\t\t\t1, \".$datos['costo'].\", \".$datos['unidad_venta'].\", \".$datos['unidad_compra'].\", \".$tipo.\"\n\t\t\t\t\t)\";\n\t\t// return $sql;\n\t\t$result =$this->insert_id($sql);\n\n\t// Guarda los campos de foodware\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tapp_campos_foodware\n\t\t\t\t\t\t(id_producto, ganancia)\n\t\t\t\tVALUES\n\t\t\t\t\t('\".$result.\"', '\".$datos['margen_ganancia'].\"')\";\n\t\t// return $sql;\n\t\t$result_foodware =$this->query($sql);\n\n\t\treturn $result;\n\t}", "public function store(StoreProveedorRequest $request)\n {//['nombre','estado','celular','direccion']\n $prove = new Proveedor();\n $prove->nombre = $request->input('Nombre');\n $prove->estado = 'activo';\n $prove->celular = $request->input('Telefono');\n $prove->direccion = $request->input('Direccion');\n $prove->save();\n $proveedores = Proveedor::paginate(10);\n return view('proveedor/proveedor',compact('proveedores'))->with('status','Guardado exitoso...!')->with('pagina','proveedor');\n }", "static public function mdlIngresarProveedor($tabla, $datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(nombre, rfc, direccion, codpostal, ciudad, email, telefono, contacto, tel_contacto, email_contacto, ultusuario, estatus) VALUES (:nombre, :rfc, :direccion, :codpostal, :ciudad, :email, :telefono, :contacto, :tel_contacto, :email_contacto, :ultusuario, :estatus)\");\n\n\t\t$stmt->bindParam(\":nombre\", $datos[\"nombre\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":rfc\", $datos[\"rfc\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":direccion\", $datos[\"direccion\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":codpostal\", $datos[\"codpostal\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":ciudad\", $datos[\"ciudad\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":email\", $datos[\"email\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":telefono\", $datos[\"telefono\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":contacto\", $datos[\"contacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":tel_contacto\", $datos[\"tel_contacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":email_contacto\", $datos[\"email_contacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":ultusuario\", $datos[\"ultusuario\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":estatus\", $datos[\"estatus\"], PDO::PARAM_INT);\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}", "public function agregar_proveedor(Request $request)\n {\n if(!session('Usuario')) {\n return 'session';\n }\n if(\n empty( $request->input('proveedor_nombre') ) ||\n empty( $request->input('proveedor_rfc') ) ||\n empty( $request->input('proveedor_correo') ) ||\n empty( $request->input('proveedor_telefono') )\n ) {\n return 'empty';\n }\n\n $proveedor = new Proveedor();\n\n $proveedor->RFC = $request->input('proveedor_rfc');\n $proveedor->Nombre = $request->input('proveedor_nombre');\n $proveedor->Telefono = $request->input('proveedor_telefono');\n $proveedor->Email = $request->input('proveedor_correo');\n $proveedor->Adeudo = 0;\n $proveedor->estatus = 1;\n $proveedor->idUsuario = session('idUsuario');\n\n if(!$proveedor->save()) {\n return 'error';\n }\n return 'true';\n }", "public function store(SaveProveedorRequest $request)\n { \n Proveedor::create($request->validated());\n\n return redirect()->route('proveedores.index')->with('status', 'El proveedor ha sido guardado');\n \n\n }", "public function store(Request $request, $proveedor)\n {\n $proveedor = Proveedor::find($proveedor);\n $datos = new DatosGeneralesProveedor($request->all());\n $proveedor->generales()->save($datos);\n return redirect()->route('proveedores.datosGenerales.index', ['proveedor' => $proveedor]);\n }", "public function store(Request $request){\n $validator= Validator::make($request->all(),[\n 'cedula'=>\"required|alpha_num|min:8|max:10\",\n 'nombre'=>\"required|alpha_dash\",\n 'apellido'=>\"required|alpha_dash\",\n 'telefono'=>\"required|alpha_num|min:6|max:10\",\n 'empresa'=>\"required|alpha_dash\",\n 'nit'=>\"required|alpha_num\"\n ]);\n //si existen errores en la validacion me devuelvo a la misma pagina pero con los errores encontrados\n if($validator->fails()){\n return redirect()->back()->withErrors($validator->errors());\n }else{\n //instancio un nuevo empleado\n $proveedor = new Proveedor();\n $proveedor->cedula = $request->input(\"cedula\");\n $proveedor->nombre = $request->input(\"nombre\");\n $proveedor->apellido = $request->input(\"apellido\");\n $proveedor->telefono = $request->input(\"telefono\");\n $proveedor->empresa = $request->input(\"empresa\");\n $proveedor->estado=\"1\";\n $proveedor->nit = $request->input(\"nit\");\n $proveedor->save();\n //redirecciono a la lista de empleados para verificar que el empelado si quedo guardado correctamente\n return redirect('proveedor/list')->with('exito',\"proveedor guardado con exito\");\n }\n }", "private function cambiarProveedor() {\n\n $ok = false;\n\n $em = new EntityManager($this->form->getConection());\n if ($em->getDbLink()) {\n\n // Cambiar factura\n $filtro = \"NumeroFactura='{$this->request['numeroFactura']}' AND IDProveedor='{$this->request['idProveedorAnterior']}'\";\n $query = \"update frecibidas_cab set IDProveedor='{$this->request['idProveedorNuevo']}' where {$filtro}\";\n $em->query($query);\n $this->values['errores'] = $em->getError();\n $okFactura = $em->getAffectedRows();\n\n if ($okFactura) {\n \n $this->values['mensaje'][] = \"Se ha cambiado \" . $okFactura . \" factura.\";\n // Cambiar pedido/s\n $filtro = \"IDFactura='{$this->request['idFactura']}' AND IDProveedor='{$this->request['idProveedorAnterior']}'\";\n $query = \"update pedidos_cab set IDProveedor='{$this->request['idProveedorNuevo']}' where {$filtro}\";\n $em->query($query);\n $this->values['errores'] = $em->getError();\n $nPedidos = $em->getAffectedRows();\n $this->values['mensaje'][] = \"Se han cambiado \" . $nPedidos . \" pedidos.\";\n \n // Cambiar recibos\n $filtro = \"IDFactura='{$this->request['idFactura']}' AND IDProveedor='{$this->request['idProveedorAnterior']}'\";\n $query = \"update recibos_proveedores set IDProveedor='{$this->request['idProveedorNuevo']}' where {$filtro}\";\n $em->query($query);\n $this->values['errores'] = $em->getError();\n $nRecibos = $em->getAffectedRows();\n $this->values['mensaje'][] = \"Se han cambiado \" . $nRecibos . \" recibos.\";\n \n }\n }\n\n $em->desConecta();\n unset($em);\n }", "public function store(Request $request)\n {\n $prov = new Proveedor();\n $prov->razon_social = $request->razon_social;\n $prov->nombre_contacto = $request->nombre_contacto;\n $prov->puesto_contacto = $request->puesto_contacto;\n $prov->rfc = $request->rfc;\n $prov->fecha_alta = $request->fecha_alta;\n $prov->fecha_nacimiento = $request->fecha_nacimiento;\n $prov->telefono = $request->telefono;\n $prov->celular = $request->celular;\n $prov->celular_alterno = $request->celular_alterno;\n $prov->email = $request->email;\n $prov->email_alternativo = $request->email_alternativo;\n session_start();\n \n $prov->id_domicilio = $_SESSION['domicilioId']; //ÚLTIMO ID DE TABLA DOMICILIO\n $prov->save();\n\n return redirect()->route('proveedores.index');\n }", "public function edit(ProveedoresModel $proveedor)\n {\n //\n }", "public function destroy(Proveedor $proveedor)\n {\n //\n }", "public function create(Request $request)\n {\n $proveedor = new Proveedor();\n $proveedor->Nom_Empresa = $request->input('nombre');\n $proveedor->RUC = $request->input('ruc');\n $proveedor->Direccion = $request->input('direccion');\n $proveedor->Telefono = $request->input('telef');\n $proveedor->Url = $request->input('url');\n $proveedor->Estado = 1;\n Log::info('jaaaaa'+$proveedor+'proveedor');\n $this->ProveedorRep->Guardar($proveedor);\n return redirect('/pagProveedor');\n }", "public function createNumeroDocumentoProveedor(Request $request){\n\n if($request->user()->can('add_proveedor')) {\n\n $documentoProveedor = DocumentoProveedor::create([\n 'numero' => $request->numero,\n 'tipodocumento_id' => $request->tipodocumento_id,\n 'user_id' => $request->user()->id, //no request\n 'proveedor_id' => $request->provedor_id //no request\n ]);\n if (!$request) {\n ResponseController::set_errors(true);\n ResponseController::set_messages('No has enviado inforamcion para agregar numero de documento');\n return ResponseController::response('BAD REQUEST');\n }\n\n ResponseController::set_messages('Proveedor creado');\n ResponseController::set_data(['proveedor'=>$documentoProveedor->id]);\n return ResponseController::response('OK');\n }\n ResponseController::set_errors(true);\n ResponseController::set_messages('Usuario sin permiso');\n return ResponseController::response('UNAUTHORIZED');\n\n }", "function grabar($datos)\n\t{\n\t\tif (($datos[IDPROVEEDOR]=='') && ($this->exist(\"$this->catalogo.catalogo_proveedor\",'IDPROVEEDOR',\" WHERE NOMBREFISCAL = '$datos[NOMBREFISCAL]'\" )))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$reg_proveedor[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t$reg_proveedor[NOMBREFISCAL] = trim(strtoupper($datos[NOMBREFISCAL]));\n\t\t\t$reg_proveedor[NOMBRECOMERCIAL] = trim(strtoupper($datos[NOMBRECOMERCIAL]));\n\t\t\t$reg_proveedor[IDTIPODOCUMENTO] = $datos[IDTIPODOCUMENTO];\n\t\t\t$reg_proveedor[IDDOCUMENTO] = trim($datos[IDDOCUMENTO]);\n\t\t\t$reg_proveedor[EMAIL1] = trim(strtolower($datos[EMAIL1]));\n\t\t\t$reg_proveedor[EMAIL2] = trim(strtolower($datos[EMAIL2]));\n\t\t\t$reg_proveedor[EMAIL3] = trim(strtolower($datos[EMAIL3]));\n\t\t\t$reg_proveedor[ACTIVO] = $datos[ACTIVO];\n\t\t\t$reg_proveedor[INTERNO] = $datos[INTERNO];\n\n\t\t\tif ($datos[ARREVALRANKING]=='SKILL'){\n\t\t\t\t$reg_proveedor[ARREVALRANKING]=$datos[ARREVALRANKING];\n\t\t\t\t$reg_proveedor[SKILL]= $datos[SKILL];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$reg_proveedor[ARREVALRANKING]='CDE';\n\t\t\t}\n\t\t\t$reg_proveedor[EVALFIDELIDAD]=$datos[EVALFIDELIDAD];\n\t\t\t$reg_proveedor[EVALINFRAESTRUCTURA]=$datos[EVALINFRAESTRUCTURA];\n\t\t\t$reg_proveedor[IDMONEDA]=$datos[IDMONEDA];\n\t\t\t$reg_proveedor[OBSERVACIONES]=$datos[OBSERVACIONES];\n\n\t\t\t$reg_proveedor[BRSCH] = $datos[BRSCH];\n\t\t\t$reg_proveedor[FDGRV] = $datos[FDGRV];\n\t\t\t$reg_proveedor[ZTERM] = $datos[ZTERM];\n\t\t\t$reg_proveedor[MWSKZ] = $datos[MWSKZ];\n\t\t\t$reg_proveedor[PARVO] = $datos[PARVO];\n\t\t\t$reg_proveedor[PAVIP] = $datos[PAVIP];\n\t\t\t$reg_proveedor[FECHAINICIOACTIVIDADES]= trim($datos[ANIO].'-'.$datos[MES].'-'.$datos[DIA]);\n\n\t\t\t$prov_ubigeo[CVEPAIS]= $datos[CVEPAIS];\n\t\t\t$prov_ubigeo[CVEENTIDAD1]= $datos[CVEENTIDAD1];\n\t\t\t$prov_ubigeo[CVEENTIDAD2]= $datos[CVEENTIDAD2];\n\t\t\t$prov_ubigeo[CVEENTIDAD3]= $datos[CVEENTIDAD3];\n\t\t\t$prov_ubigeo[CVEENTIDAD4]= $datos[CVEENTIDAD4];\n\t\t\t$prov_ubigeo[CVEENTIDAD5]= $datos[CVEENTIDAD5];\n\t\t\t$prov_ubigeo[CVEENTIDAD6]= $datos[CVEENTIDAD6];\n\t\t\t$prov_ubigeo[CVEENTIDAD7]= $datos[CVEENTIDAD7];\n\t\t\t$prov_ubigeo[CVETIPOVIA]= $datos[CVETIPOVIA];\n\t\t\t$prov_ubigeo[DIRECCION]= $datos[DIRECCION];\n\t\t\t$prov_ubigeo[NUMERO]= $datos[NUMERO];\n\t\t\t$prov_ubigeo[CODPOSTAL] = $datos[CODPOSTAL];\n\t\t\t$prov_ubigeo[LATITUD] = $datos[LATITUD];\n\t\t\t$prov_ubigeo[LONGITUD] = $datos[LONGITUD];\n\t\t\t$prov_ubigeo[IDUSUARIOMOD]= $datos[IDUSUARIOMOD];\n\t\t\t$prov_ubigeo[REFERENCIA1]= $datos[REFERENCIA1];\n\t\t\t$prov_ubigeo[REFERENCIA2]= $datos[REFERENCIA2];\n\n\t\t\t$datos_telf[CODIGOAREA] = $datos[CODIGOAREA];\n\t\t\t$datos_telf[IDTIPOTELEFONO] = $datos[IDTIPOTELEFONO];\n\t\t\t$datos_telf[NUMEROTELEFONO] = $datos[NUMEROTELEFONO];\n\t\t\t$datos_telf[EXTENSION] = $datos[EXTENSION];\n\t\t\t$datos_telf[IDTSP] = $datos[IDTSP];\n\t\t\t$datos_telf[COMENTARIO]=$datos[TELF_COMENTARIO];\n\t\t\t$datos_telf[IDUSUARIOMOD] = $datos[IDUSUARIOMOD];\n\n\t\t\t$this->borrar_telefono($datos[IDPROVEEDOR]); // BORRA LOS PROVEEDORES\n\n\t\t\tif ( $datos[IDPROVEEDOR]=='')\n\t\t\t{\n\n\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor\",$reg_proveedor);\n\t\t\t\t$datos[IDPROVEEDOR] = $this->reg_id(); //OBTIENE EL ID DEL NUEVO PROVEEDOR\n\t\t\t\t$prov_ubigeo[IDPROVEEDOR]=$datos[IDPROVEEDOR];\n\t\t\t\t$prov_horario[IDPROVEEDOR]=$datos[IDPROVEEDOR];\n\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor_ubigeo\",$prov_ubigeo);\n\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor_horario\",$prov_horario);\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\t$this->update(\"$this->catalogo.catalogo_proveedor\",$reg_proveedor,\" where IDPROVEEDOR = '$datos[IDPROVEEDOR]'\");\n\t\t\t\t$this->update(\"$this->catalogo.catalogo_proveedor_ubigeo\",$prov_ubigeo,\" where IDPROVEEDOR = '$datos[IDPROVEEDOR]'\");\n\t\t\t}\n\n\t\t\tif ($datos[IDPROVEEDOR]!='')\n\t\t\t{\n\t\t\t\tfor($i=0;$i<count($datos_telf[NUMEROTELEFONO]);$i++)\n\t\t\t\t{\n\t\t\t\t\t$telf[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t\t\t$telf[CODIGOAREA]=$datos_telf[CODIGOAREA][$i];\n\t\t\t\t\t$telf[IDTIPOTELEFONO]=$datos_telf[IDTIPOTELEFONO][$i];\n\t\t\t\t\t$telf[NUMEROTELEFONO]=$datos_telf[NUMEROTELEFONO][$i];\n\t\t\t\t\t$telf[EXTENSION]=$datos_telf[EXTENSION][$i];\n\t\t\t\t\t$telf[IDTSP]=$datos_telf[IDTSP][$i];\n\t\t\t\t\t$telf[COMENTARIO]=$datos_telf[COMENTARIO][$i];\n\t\t\t\t\t$telf[IDUSUARIOMOD] = $datos_telf[IDUSUARIOMOD];\n\t\t\t\t\t$telf[PRIORIDAD]=$i+1;\n\n\t\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor_telefono\",$telf);\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$datos_sociedad = $datos[IDSOCIEDAD];\n\n\n\t\t\t// GRABA LOS SERVICIOS DEL PROVEEDOR //\n\t\t\t$sql=\"delete from catalogo_proveedor_servicio where IDPROVEEDOR='$datos[IDPROVEEDOR]'\";\n\t\t\t$this->query($sql);\n\n\t\t\t$nueva_prioridad=1;\n\n\t\t\tforeach ($datos[CHECKSERVICIO] as $servi)\n\t\t\t{\n\t\t\t\t$servicio[IDSERVICIO] = $servi;\n\t\t\t\t$servicio[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t\t$servicio[PRIORIDAD] = $nueva_prioridad;\n\t\t\t\t$servicio[IDUSUARIOMOD] = $datos[IDUSUARIOMOD];\n\n\t\t\t\tif ($servi!='')\n\t\t\t\t{\n\t\t\t\t\t$this->insert_reg('catalogo_proveedor_servicio',$servicio);\n\t\t\t\t\t$nueva_prioridad++;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// GRABA LAS SOCIEDADES DEL PROVEEDOR\n\t\t\t$sql=\"delete from catalogo_proveedor_sociedad where IDPROVEEDOR='$datos[IDPROVEEDOR]'\";\n\t\t\t$this->query($sql);\n\t\t\tforeach ($datos[IDSOCIEDAD] as $soc)\n\t\t\t{\n\t\t\t\t$sociedad[IDSOCIEDAD] = $soc;\n\t\t\t\t$sociedad[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t\t$sociedad[IDUSUARIOMOD] = $datos[IDUSUARIOMOD];\n\t\t\t\t$this->insert_reg('catalogo_proveedor_sociedad',$sociedad);\n\t\t\t}\n\t\t\treturn $datos[IDPROVEEDOR];\n\t\t}\n\t\treturn $datos[IDPROVEEDOR];\n\t}", "public function entrar()\r\n\t{\r\n\t\tView::template('default');\r\n\t\t//Login del proveedor\r\n\t\tif(Input::hasPost(\"correo\", \"clave\")){\r\n\t $auth = New Proveedor;\r\n\t if($auth->login()){\r\n\t Redirect::to(\"proveedor/\");\r\n\t }\r\n\t }\r\n\t}", "public function show(Proveedor $proveedor)\n {\n //\n }", "public function show(Proveedor $proveedor)\n {\n //\n }", "public function store(CreateProveedorAPIRequest $request)\r\n {\r\n $input = $request->all();\r\n\r\n $proveedors = $this->proveedorRepository->create($input);\r\n\r\n return $this->sendResponse($proveedors->toArray(), 'Proveedor guardado exitosamente');\r\n }", "public function proveedor()\n {\n return $this->hasOne('App\\Proveedor', 'id');\n }", "public function test_registrar_un_proveedor_a_database()\n {\n\n $supplieUseCase = new SupplieUseCase(new SupplieRepository());\n\n\n $supplieEntity = new SupplieEntity(\n 'Jasinto',\n 'Lago Winnipef 401, Ciudad de México'\n );\n\n $success = $supplieUseCase->registerSupplie($supplieEntity);\n\n $this->assertEquals($success, true);\n }", "public function show(Proveedor $proveedor)\n {\n //\n }", "public function store(Request $request)\n {\n if (!ProveedoresModel::find($request->codigo)) {\n $proveedor = new ProveedoresModel;\n $proveedor->codigo = $request->codigo;\n $proveedor->nombre = $request->nombre;\n\n if ($proveedor->save()) {\n return redirect(route('proveedor.show', [$request->codigo])\n )->with('message', 'Proveedor creado exitosamente');;\n } else {\n dd(\"No se pudo guardar el proveedor\");\n }\n\n } else {\n return back()->withInput($request->all())->with('message', 'Ya existe este proveedor');\n }\n }", "public function createProveedores(Request $request){\n $accion = 'M01';\n $IdProvee = null; \n $CodEmp = $request->get('CodEmp'); \n $TipoDoc = $request->get('TipoDoc'); \n $NomTipDoc = $request->get('NomTipDoc'); \n $NumDoc = $request->get('NumDoc'); \n $Nombre = $request->get('Nombre'); \n $NombComercial = $request->get('NombComercial'); \n $idPais = $request->get('IdPais'); \n $idDepa = $request->get('IdDepartamento');\n $idProv = $request->get('IdProvincia');\n $idDist = $request->get('IdDistrito'); \n $DirPer = $request->get('Direccion'); \n $Telefono = $request->get('Telefono'); \n $Email = $request->get('Email'); \n $Activo = null; \n\n $proveedores = DB::select('call Man_zg_proveedores(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'\n ,array(\n $accion,\n $IdProvee,\n $CodEmp, \n $TipoDoc, \n $NomTipDoc, \n $NumDoc, \n $Nombre, \n $NombComercial, \n $idPais, \n $idDepa,\n $idProv,\n $idDist, \n $DirPer, \n $Telefono, \n $Email, \n $Activo\n \n ));\n return response()->json($request, 201);\n // return response()->json(['proveedor creado'=>$request], 201);\n }", "public function proveedor(){\n return $this->belongsTo(Proveedor::class,'idproveedor','id');\n }", "public function store(Request $request)\n {\n //\n $proveedor=Proveedores::create($request->all());\n return redirect('/proveedores');\n }", "public function datos_proveedor_especifico($id) \n {\n return Proveedor::find($id);\n }", "public function store(SaveProductRequest $request)\n { \n $product = Product::create($request->validated());\n\n if($request['usa_empaque']):\n $request->validate([\n 'fraccion' => 'required',\n 'medida_paq' => 'required',\n 'min_paq' => 'required'\n ]);\n \n $product->usa_empaque = $request['usa_empaque'];\n $product->medida_paq = $request['medida_paq'];\n $product->fraccion = $request['fraccion'];\n $product->min_paq = $request['min_paq'];\n $product->save();\n endif;\n if($request['usa_impuesto']):\n $request->validate([\n 'impuesto' => 'required'\n ]);\n \n $product->impuesto = $request['impuesto'];\n $product->save(); \n endif;\n\n //insertar los proveedores de productos\n $contador = count($request['proveedor']);\n for($i=0;$i<$contador;$i++){\n product_provider::create([\n 'product_id' => $product->id,\n 'provider_id' => $request['proveedor'][$i]\n ]);\n }\n\n return true;\n // Product::create($request->validated());\n // return true;\n }", "public function proveedores()\n {\n return $this->belongsTo(Proveedor::class);\n }", "public function destroy(ProveedoresModel $proveedor)\n {\n //\n }", "public function update(StoreProveedorRequest $request, Proveedor $proveedor)\n {//['nombre','estado','celular','direccion']\n $proveedor->nombre = $request->input('Nombre');\n $proveedor->celular = $request->input('Telefono');\n $proveedor->direccion = $request->input('Direccion');\n $proveedor->save();\n $proveedores = Proveedor::paginate(10);//Llamar a todos los datos contenidos dentro de la tabla proveedor\n return view('proveedor/proveedor',compact('proveedores'))->with('status','Actualización hecha, Satisfactoriamente...!')->with('pagina','proveedor');//llamar a la vista del provee\n }", "function insert(Profesor $profesor){\n //Se pasa un objeto usuario y se inserta, se devuelve el email del elemento con el que se ha insertado\n $parametrosSet=array();\n $parametrosSet['tel']=$profesor->getTelefono();\n $parametrosSet['nombre']=$profesor->getNombre();\n $parametrosSet['apellido']=$profesor->getApellido();\n $parametrosSet['clave']=$profesor->getClave();\n $parametrosSet['activo']=$profesor->getActivo();\n $parametrosSet['administrador']=$profesor->getAdministrador();\n $parametrosSet['email']=$profesor->getEmail();\n return $this->bd->insert($this->tabla, $parametrosSet);\n }", "public function store(Request $request)\n {\n $proveedor = new proveedor;\n $proveedor->nombreproveedor = $request->nombreproveedor;\n $proveedor->nombrecontacto = $request->nombrecontacto;\n $proveedor->direccion = $request->direccion;\n $proveedor->pais = $request->pais;\n $proveedor->ciudad = $request->ciudad;\n $proveedor->email = $request->email;\n $proveedor->telefono = $request->telefono;\n $proveedor->cargo = $request->cargo;\n $proveedor->save();\n return redirect()->route('proveedors.index');\n }", "public function update(Request $request, ProveedoresModel $proveedor)\n {\n //\n }", "public function provider()\n {\n return $this->belongsTo('App\\Provider', 'proveedor_id');\n }", "public function run()\n {\n $proveedor = new Proveedor;\n $proveedor->nombre = 'centro de acopio';\n //privilegios\n $proveedor->save();\n\n $proveedor = new Proveedor;\n $proveedor->nombre = 'centro de distribucion';\n //privilegios\n $proveedor->save();\n\n $proveedor = new Proveedor;\n $proveedor->nombre = 'clap';\n //privilegios\n $proveedor->save();\n }", "public function getProveedorEstado()\n {\n return $this->hasOne(ProveedorEstado::className(), ['id' => 'proveedor_estado']);\n }", "public function store(Request $request)\n {\n $proveedor = new Proveedor();\n\n $proveedor->cif = $request->cif;\n $proveedor->razon_social = $request->razon_social;\n\n $proveedor->save();\n\n return redirect()->route('proveedores.show', $proveedor->id);\n }", "public function store(Request $request)\n {\n $ArtProv = new ArticuloPorProveedor();\n $ArtProv->ArtiUnidad = $request->input(\"ArtiUnidad\");\n $ArtProv->ArtiCant = $request->input(\"ArtiCant\");\n $ArtProv->ArtiPrecio = $request->input(\"ArtiPrecio\");\n $ArtProv->ArtiCostoUnid = $request->input(\"ArtiCostoUnid\");\n $ArtProv->ArtiMinimo = $request->input(\"ArtiMinimo\");\n\n $ArtProv->FK_ArtCotiz = $request->input(\"FK_ArtCotiz\");\n $ArtProv->FK_ArtiActiv = $request->input(\"FK_ArtiActiv\");\n // $ArtProv->FK_AutorizedBy = $request->input(\"FK_AutorizedBy\");\n $ArtProv->FK_AutorizedBy = 1;\n $ArtProv->save();\n\n return redirect()->route('articulos-proveedor.index');\n }", "public function show(Proveedores $proveedores)\n {\n //\n }", "public function proveedor(){\n return $this->belongsTo('App\\Proveedor', 'proveedor_legajo', 'tecnico_legajo');\n }", "public static function guardar($datos){\n $producto = new Producto($datos['producto']);\n $producto->categoria = $producto->srtCategoria($datos['categorias']);\n $producto->save();\n $producto->categorias()->attach($datos['categorias']);\n $idsDimensiones = $producto->arrDimensiones($datos);\n $articulos = $producto->arrArticulos($datos['colores'], $idsDimensiones, $producto->id);\n DB::table('articulos')->insert($articulos);\n }", "function addMco_proveedores($PVE_ID,$PVE_NOMBRE,$PVE_DIRECCION,$PVE_TELEFONO,$PVE_CELULAR,$PVE_EMAIL)\n {\n \tif($this->gateway->existMco_proveedores($PVE_ID) == 0){\n $PVE_ID = $this->gateway->maxId();\n $result = $this->gateway->addMco_proveedores($PVE_ID,$PVE_NOMBRE,$PVE_DIRECCION,$PVE_TELEFONO,$PVE_CELULAR,$PVE_EMAIL);\n if($result){\n $this->UnsetRequest();\n return EXITO_OPERACION_REALIZADA;\n }\n else\n {\n return ERROR_OPERACION_NO_REALIZADA;\n }\n }\n else\n { return $this->updateMco_proveedores($PVE_ID,$PVE_NOMBRE,$PVE_DIRECCION,$PVE_TELEFONO,$PVE_CELULAR,$PVE_EMAIL);\n \t//return ERROR_DATO_EXISTE;\n }\n }", "function entrada_por_traspaso(){\n\t\t$e= new Entrada();\n\t\t$e->usuario_id=$GLOBALS['usuarioid'];\n\t\t$e->empresas_id=$GLOBALS['empresaid'];\n\t\t$related = $e->from_array($_POST);\n\t\t//if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n\t\t$e->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$e->costo_total=($e->cantidad * $e->costo_unitario);\n\t\t$e->cproveedores_id=1;\n\t\t$e->fecha=date(\"Y-m-d H:i:s\");\n\t\tif($e->id==0)\n\t\t\tunset($e->id);\n\t\tif($e->save($related)) {\n\t\t\techo $e->id;\n\t\t} else\n\t\t\techo 0;\n\t}", "public function guardar_entrega_de_producto($entrega_id, $productos_entregados){\n\n // NOTA: Lo demás son datos de actualizacion sobreescribibles.\n\n $productos_entregados = $productos_entregados;\n $query_productos = ProductoEntrega::where(\"entrega_id\" , $entrega_id);\n $productos_registrados = $query_productos->get();\n\n if(count($productos_registrados) > 0){\n $query_productos->delete();\n }\n\n foreach($productos_entregados as $producto){\n $producto = (object) $producto;\n $producto_id = $producto->id;\n $cantidad = $producto->cantidad;\n $precio = $producto->precio;\n $nombre = $producto->nombre;\n ProductoEntrega::create([\n \"cantidad\" => $cantidad,\n \"entrega_id\" => $entrega_id,\n \"producto_id\" => $producto_id,\n \"precio\" => $precio,\n \"nombre\" => $nombre,\n \"fecha_de_entrega\" => date(\"Y/m/d\")\n ]);\n }\n\n return;\n\n }", "public function getProveedorTipo()\n {\n return $this->hasOne(ProveedorTipo::className(), ['id' => 'proveedor_tipo']);\n }", "function guardar_insumo($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Valida el tipo de producto: 5-> Receta, 4-> Insumo preparado\n\t\t$tipo = ($datos['tipo']==1) ? 5 : 4 ;\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tapp_producto_material\n\t\t\t\t\t\t(id_producto, cantidad, id_unidad, id_material, opcionales)\n\t\t\t\tVALUES\n\t\t\t\t\t('\".$datos['id_receta'].\"',\".$datos['cantidad'].\",\".$datos['id_unidad'].\",\n\t\t\t\t\t\t'\".$datos['id'].\"','\".$datos['opcionales'].\"'\n\t\t\t\t\t)\";\n\t\t// return $sql;\n\t\t$result =$this->insert_id($sql);\n\n\t\treturn $result;\n\t}", "public function ajoutProduit()\n {\n $produit = new Produit();\n\n $produit->uuid = Str::uuid();\n $produit->designation = 'Tomate';\n $produit->description = 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Eaque deleniti quisquam beatae deserunt dicta ipsam tenetur at necessitatibus in, eligendi voluptatibus doloribus earum sed error maiores nam possimus sunt assumenda?';\n $produit->prix = '1000';\n $produit->like = '21';\n $produit->pays_source = 'Burkina Faso';\n $produit->poids = '45.10';\n\n $produit->save();\n }", "public function store(Request $request)\n\t{\n\t\t\n\t\t$this->validate($request,[\n\n\t\t\t'proveedore_id' => 'required',\n\t\t\t'sede_id' => 'required'\n\n\t\t\t]);\n\n\t\ttry {\n\n\t\t\t$proveedor = Proveedore::findOrFail($request['proveedore_id']);\n\n\t\t\t$sede = Sede::findOrFail($request['sede_id']);\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\treturn Response::view('errors/404', array(), 404);\n\n\t\t}\n\n\t\ttry {\n\t\t\t\n\t\t\t$sede->proveedores()->attach($request['proveedore_id']);\n\n\t\t} catch (\\PDOException $exception) {\n\t\t\t\n\t\t\treturn Redirect::back() -> withErrors(['mesagge' => 'Ha ocurrido un error en la consulta '.$exception->getCode()]);\n\n\t\t}\n\n\t\t\\Event::fire(new Audit($sede, 'se ha vinculado con '.$proveedor->nombre));\n\t\treturn Redirect::back() ->with('mensagge', 'proveedor asociado a la sede');\n\n\t}", "public function usuarioProveedor()\n {\n \treturn $this->belongsTo('App\\Usuario', 'usuario_id', 'id');\n }", "public function store(Request $request)\n {\n $guardado = $this->proveedorModel->guardar($request->all());\n \n if ($guardado->id) {\n $this->response['code'] = 200;\n $this->response['status'] = 'ok';\n $this->response['modelData'] = [\n 'id' => $guardado->id,\n 'nombre' => $guardado->nombre\n ];\n $this->response['route']= [\n 'edit' => route('admin.catalogo.proveedor.update', ['proveedor' => $guardado->id]),\n 'destroy' => route('admin.catalogo.proveedor.destroy', ['proveedor' => $guardado->id])\n ];\n }\n return response()->json($this->response);\n }", "function existeProveedor($codigo)\n {\n \tif($this->gateway->existMco_proveedores($codigo) == 1){ \n return ERROR_DATO_EXISTE;\n }\n else\n {\n return EXITO_OPERACION_REALIZADA;\n }\n }", "public function createProducto(){\n $sql='INSERT INTO producto(nombre, precio, descripcion,foto,estado, idCategoria, cantidad, idProveedor,estadoEliminacion) VALUES (?,?,?,?,?,?,?,?,1)';\n $params=array($this->nombre, $this->precio, $this->descripcion, $this->foto, $this->estado, $this->categoria, $this->cantidad, $this->proveedor);\n return Database::executeRow($sql, $params);\n }", "public function add(){\n if (isset($_SESSION['identity'])) {// Comprobamos que hay un usuario logueado\n $usuario_id = $_SESSION['identity']->id;// Obtenemos el ID del Usuario logueado\n $sProvincia = isset($_POST['province']) ? $_POST['province'] : false;\n $sLocalidad = isset($_POST['location']) ? $_POST['location'] : false;\n $sDireccion = isset($_POST['address']) ? $_POST['address'] : false;\n\n $stats = Utils::statsCarrito();\n $coste = $stats['total'];// Obtenemos el coste total del pedido\n\n\n if ($sProvincia && $sLocalidad && $sDireccion){\n // Guardar datos en bd\n $oPedido = new Pedido();\n $oPedido->setUsuarioId($usuario_id);\n $oPedido->setProvincia($sProvincia);\n $oPedido->setLocalidad($sLocalidad);\n $oPedido->setDireccion($sDireccion);\n $oPedido->setCoste($coste);\n\n $save = $oPedido->savePedido();// Insertamos el Pedido en BD\n\n // Guardar Linea Pedido\n $save_linea = $oPedido->save_linea();\n\n if ($save && $save_linea){// Comprobamos que La inserccion a sido correcta\n $_SESSION['pedido'] = \"complete\";\n }else{\n $_SESSION['pedido'] = \"failed\";\n }\n }else{\n $_SESSION['pedido'] = \"failed\";\n\n }\n header(\"Location:\" . base_url .'pedido/confirmado');\n }else{\n // Redirigir al Index\n header(\"Location:\" . base_url);\n }\n }", "public function __construct() {\n $this->adminProveedorModelo = new adminProveedorModelo();\n }", "function guardar_insumos_producto($objeto, $producto_sel) {\n\n\t\t// com_recetas\n\t\t$sql = \"INSERT INTO\n\t\t\t\t\t\tprd_lab_conceptos_productos (id_producto, id_lab_concepto, lim_inf, lim_sup, referencia)\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t\t(\" . $producto_sel . \", \" . $objeto['id'] . \", \" . $lim_inf . \", \" .\n\t\t\t\t\t\t\t$lim_sup . \", '\" . $referencia . \"')\";\n\n\t\t$result = $this->queryArray($sql);\n\t\treturn $result;\n\t}", "public function ProveedorPorId()\n\t{\n\t\tself::SetNames();\n\t\t$sql = \" select * from proveedores where codproveedor = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET[\"codproveedor\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\t\t\techo \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "public function store(Request $request)\n {\n $p = new Produto();\n\n $p->codigo = $request->codigo;\n $p->nome = strtoupper($request->nome);\n $p->valor = str_replace(',','.',$request->valor); //caso use vírgula será substituido por ponto.\n $p->descricao = strtoupper($request->descricao);\n $p->quantidade = $request->quantidade;\n $p->user_id = auth()->user()->id;\n \n if (DB::table('produtos')->select('codigo')->where('codigo', $p->codigo)->exists()) {\n //dd($request);\n return redirect()->back()->with('alertDanger','Erro! Já existe produto cadastrado com mesmo código!');\n }else{\n $p->save();\n return redirect()->back();\n }\n }", "public function savePoblacion(){\n \n $data_insert = [\n 'poblacion' =>$this->_poblacion,\n'provincia' =>$this->_provincia,\n'ccaa' =>$this->_ccaa,\n'cod_provincia' =>$this->_cod_provincia,\n'cod_ccaa' =>$this->_cod_ccaa,\n \n ];\n return parent::save($data_insert);\n \n }", "function registrarPedido(){\n\t\t$x = $this->pdo->prepare('INSERT INTO pedido (cedulaCliente,fechaPedido) VALUES (?,?)');\n\t\t$x->execute(array($this->cedulaCliente,$this->fechaPedido));\n\t\treturn $x;\n\t}", "function set(Profesor $profesor){\n $parametrosSet=array();\n $parametrosSet['tel']=$profesor->getTelefono();\n $parametrosSet['nombre']=$profesor->getNombre();\n $parametrosSet['apellido']=$profesor->getApellido();\n $parametrosSet['clave']=$profesor->getClave();\n $parametrosSet['activo']=$profesor->getActivo();\n $parametrosSet['administrador']=$profesor->getAdministrador();\n $parametrosSet['email']=$profesor->getEmail();\n $parametrosWhere = array();\n $parametrosWhere['tel'] = $profesor->getTelefono();\n return $this->bd->update($this->tabla, $parametrosSet, $parametrosWhere);\n \n }", "public function create($proveedor)\n {\n $proveedor = Proveedor::find($proveedor);\n $giros = Giro::get();\n $formaContactos = FormaContacto::get();\n return view('proveedores.datosGenerales.create', ['proveedor' => $proveedor, 'giros' => $giros, 'formaContactos' => $formaContactos]);\n }", "public function setProducto($pro){ $this->producto = $pro;}", "public function create_provider(Request $request)\n {\n //informacion recibida\n $dat = $request->get('dat');\n //proveedor\n $exist_provider = Provider::where('nit','=',$dat['nit'])->get();\n $exist_phone = Provider_phone::where('number','=',$dat['phone'])->get();\n //coorreo en miniculas\n $mail =mb_strtolower($dat['mail']);\n $exist_mail = Provider::where('mail','=',$mail)->get();\n\n //Verifica que el proveedor ya este registrado\n if(isset($exist_provider) && $exist_provider->count() == 0){\n\n //Verifica si el telefono ingresado ya esta registrado\n if(isset($exist_phone) && $exist_phone->count() == 0){\n\n //Verifica si el correo ya esta registrado\n if(isset($exist_mail) && $exist_mail->count() == 0){\n //almacena al proveedor\n $provider = new Provider();\n $provider->nit = $dat['nit'];\n $provider->name = $dat['name'];\n $provider->mail = $mail;\n $provider->address = $dat['address'];\n $provider->city_id = $this->buscarUbicacion($dat['city'],$dat['departament'],$dat['country']);\n $provider->save();\n //almacena el telefono\n $phone = new Provider_phone();\n $phone->number = $dat['phone'];\n $phone->provider_id = $provider->id;\n $phone->save();\n $request->session()->flash('check_msg','El proveedor se registro con éxito');\n }\n else {\n $request->session()->flash('fail_msg', 'Este correo ya se encuentra asociado a un proveedor');\n }\n }\n else {\n $request->session()->flash('fail_msg', 'Este número de télefono ya se encuentra registrado');\n }\n }else {\n $request->session()->flash('fail_msg', 'Este proveedor ya se encuentra registrado');\n }\n\n return redirect()->route('view_provider');\n }", "public function save(){\n //para insertar datos que entrarar debemos unterpolar\n\n //los numero no van entrecomillas\n \n $sql=\"INSERT INTO pedidos VALUES (NULL,{$this->getUsuario_id()},'{$this->getProvincia()}','{$this->getLocalidad()}','{$this->getDireccion()}',{$this->getCoste()},'confirm',curdate(),curtime());\";\n //ahora insertamos una consulta \n $save = $this->db->query($sql);\n \n\n $result = false; //este es el resultado por defecto\n //si el $save da true (en otras palabras no esta vacio y los datos se llenaron correctamente)\n if($save){\n $result=true;\n }\n return $result;\n }", "public function edit(Proveedor $proveedor)\n {\n if ($proveedor->estado == 'activo') {\n $proveedor->estado = 'inactivo';\n }else{\n \n $proveedor->estado = 'activo';\n \n } \n \n $proveedor->save();\n $proveedores = Proveedor::paginate(10);//Llamar a todos los datos contenidos dentro de la tabla proveedor\n return view('proveedor/proveedor',compact('proveedores'))->with('pagina','proveedor');//llamar a la vista del provee\n }", "function alta_entrada(){\n $e = new Entrada();\n\t\t$precio=$_POST['costo_unitario'];\n\t\t$producto_id=$_POST['cproductos_id'];\n $e->usuario_id = $GLOBALS['usuarioid'];\n $e->empresas_id = $GLOBALS['empresaid'];\n $related = $e->from_array($_POST);\n //if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n $f = new Pr_factura();\n $f->get_by_id($e->pr_facturas_id);\n $e->espacios_fisicos_id = $f->espacios_fisicos_id;\n $e->lote_id = $f->lote_id;\n $e->costo_total = ($e->cantidad * $e->costo_unitario);\n\t\t$e->existencia = $e->cantidad;\n $e->cproveedores_id = $f->cproveedores_id;\n $e->fecha = date(\"Y-m-d H:i:s\");\n if ($e->id == 0)\n unset($e->id);\n if ($e->save($related)) {\n echo $e->id;\n\t\t\t$this->db->query(\"update cproductos set precio_compra='$precio' where id=$producto_id\");\n } else\n echo 0;\n }", "function guardar_receta($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tcom_recetas\n\t\t\t\t\t\t(id, nombre, precio, ganancia, ids_insumos, ids_insumos_preparados, preparacion)\n\t\t\t\tVALUES\n\t\t\t\t\t(\".$datos['id_receta'].\", '\".$datos['nombre'].\"',\".$datos['precio_venta'].\",\n\t\t\t\t\t\t\".$datos['margen_ganancia'].\",\n\t\t\t\t\t\t'\".$datos['ids'].\"','\".$datos['ids_preparados'].\"','\".$datos['preparacion'].\"'\n\t\t\t\t\t)\";\n\t\t// return $sql;\n\t\t$result =$this->insert_id($sql);\n\n\t// Guarda la actividad\n\t\t$fecha=date('Y-m-d H:i:s');\n\n\t\t$texto = ($datos['tipo']==1) ? 'receta' : 'insumo preparado' ;\n\t// Valida que exista el empleado si no agrega un cero como id\n\t\t$usuario = (!empty($_SESSION['accelog_idempleado'])) ?$_SESSION['accelog_idempleado'] : 0 ;\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tcom_actividades\n\t\t\t\t\t\t(id, empleado, accion, fecha)\n\t\t\t\tVALUES\n\t\t\t\t\t('',\".$usuario.\",'Agrega \".$texto.\"', '\".$fecha.\"')\";\n\t\t$actividad=$this->query($sql);\n\n\t\treturn $result;\n\t}", "public function obtenerProveedores()\n { \n $query = $this->db->get('proveedor'); \n\n if ($query->num_rows() > 0)\n return $query->result();\n else\n return $query->result();\n }", "public function readProveedores(){\n $sql='SELECT idProveedor, nombreProveedor, direccion, telefono,correo FROM proveedor where estado=1 AND proveedor.estadoEliminacion=1';\n $params=array(null);\n return Database::getRows($sql, $params);\n }", "function guardarPromo($arg) {\n\t\tSessionHandler()->check_session();\n\t\tdate_default_timezone_set('America/Argentina/La_Rioja');\n\t\t$ids = explode('@', $arg);\n\t\t$mesa = $ids[0];\n\t\t$promo = $ids[1];\n\t\t$cantidad = $ids[2];\n\t\t$pedidoId = $ids[3];\n\t\t\n\t\tif ($pedidoId != null || $pedidoId != 0 || $pedidoId != \"\") {\n\t\t\t$bp = new PromoPedido();\n\t\t\t$bp->pedido = $pedidoId;\n\t\t\t$bp->promo = $promo;\n\t\t\t$bp->cantidad = $cantidad;\n\t\t\t$bp->save();\n\t\t\t\n\t\t\t$md = new Mesa();\n\t\t\t$md->mesa_id = $mesa;\n\t\t\t$md->get();\n\t\t\t$md->disponible = 2;\n\t\t\t$md->save();\n\t\t\tprint($pedidoId);exit;\n\t\t}\n\n\t\t$this->model->fecha = date('Y-m-d');\t\t\n\t\t$this->model->mesa = $mesa;\t\t\n\t\t$this->model->estado = 1;\t\t\n $this->model->save();\n\t\t\n\t\t$pedido_id = $this->model->pedido_id;\n\n\t\t$md = new Mesa();\n\t\t$md->mesa_id = $mesa;\n\t\t$md->get();\n\t\t$md->disponible = 2;\n\t\t$md->save();\n\t\t\n\t\t$bp = new PromoPedido();\n\t\t$bp->pedido = $pedido_id;\n\t\t$bp->promo = $promo;\n\t\t$bp->cantidad = $cantidad;\n\t\t$bp->save();\n\t\tprint($pedido_id);exit;\n\n\t}", "function editar_pr_factura(){\n\n\t\t $u = new entrada();\n $u->usuario_id = $GLOBALS['usuarioid'];\n $u->empresas_id = $GLOBALS['empresaid'];\n\t$precio=$_POST['costo_unitario'];\n\t$producto_id=$_POST['cproductos_id'];\n $u->fecha = date(\"Y-m-d H:i:s\");\n $related = $u->from_array($_POST);\n if ($u->id == 0)\n unset($u->id);\n if ($u->save($related)) {\n$this->db->query(\"update cproductos set precio_compra='$precio' where id=$producto_id\");\n echo $u->id;\n } else\n echo 0; \n \n\t}", "public function ProveedoresPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * from proveedores where codproveedor = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codproveedor\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function store(Request $request, Provedor $provedore)\n {\n //\n // dd($request->all());\n $crm = ProvedorCRM::create($request->all());\n return redirect()->route('provedores.crm.index',['provedore'=>$provedore]);\n }", "public function edit(Proveedor $proveedor)\n {\n\n $distritos = Distrito::all();\n $cb = Distrito::Findorfail($proveedor->distrito_id);\n $cbid = ($cb->id);\n $cbd = ($cb->distrito);\n\n return view('proveedores.edit', [\n 'proveedor' => $proveedor,\n 'distritos'=> $distritos,\n 'cbid' => $cbid,\n 'cbd' => $cbd\n ]);\n \n }", "public function ajoutProduitEncore()\n {\n Produit::create(\n [\n 'uuid' => Str::uuid(),\n 'designation' => 'Mangue',\n 'description' => 'Mangue bien grosse et sucrée! Yaa Proprè !',\n 'prix' => 1500,\n 'like' => 63,\n 'pays_source' => 'Togo',\n 'poids' => 89.5,\n ]\n );\n }", "public function obtener_proveedores()\n {\n return $this->db->get('proveedores')->result();\n }", "public function edit($proveedor)\n { \n $proveedor = Proveedor::find($proveedor);\n $datos = $proveedor->generales;\n $giros = Giro::get();\n $formaContactos = FormaContacto::get();\n return view('proveedores.datosGenerales.edit', ['proveedor' => $proveedor, 'datos' => $datos, 'giros' => $giros, 'formaContactos' => $formaContactos]);\n }", "static public function mdlGuardarIngreso($tabla, $datos){\t\n\n\t\t$dbh = Conexion::conectar();\n\n\t\t$stmt = $dbh->prepare(\"INSERT INTO $tabla(idproveedor, idusuario, tipo_comprobante, serie_comprobante, num_comprobante, fecha_hora, impuesto, total_compra, divisa) VALUES (:idproveedor, :idusuario, :tipo_comprobante, :serie_comprobante, :num_comprobante, :fecha_hora, :impuesto, :total_compra, :divisa)\");\n\n\t\t$stmt->bindParam(\":idproveedor\", $datos[\"proveedor\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":idusuario\", $datos[\"idusuario\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":fecha_hora\", $datos[\"fecha\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":tipo_comprobante\", $datos[\"tipo_comprobante\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":divisa\", $datos[\"divisa_ingreso\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":serie_comprobante\", $datos[\"serie_comprobante\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":num_comprobante\", $datos[\"numero_comprobante\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":impuesto\", $datos[\"impuesto_ingreso\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":total_compra\", $datos[\"total_compra\"], PDO::PARAM_INT);\n\n\t\t\n\n\t\t$stmt->execute();\n\t\t$id = $dbh->lastInsertId();\n\t\treturn $id;\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\t}", "function guardar($arg) {\n\t\tSessionHandler()->check_session();\n\t\tdate_default_timezone_set('America/Argentina/La_Rioja');\n\n\t\t$ids = explode('@', $arg);\n\t\t$mesa = $ids[0];\n\t\t$bebida = $ids[1];\n\t\t$cantidad = $ids[2];\n\t\t$pedidoId = $ids[3];\n\n\t\t//COMPROBAR STOCK DE BEBIDA.\n\t\t\n\t\tif ($pedidoId != null || $pedidoId != 0 || $pedidoId != \"\") {\n\t\t\t$bp = new BebidaPedido();\n\t\t\t$bp->pedido = $pedidoId;\n\t\t\t$bp->bebida = $bebida;\n\t\t\t$bp->cantidad = $cantidad;\n\t\t\t$bp->save();\n\n\t\t\t$md = new Mesa();\n\t\t\t$md->mesa_id = $mesa;\n\t\t\t$md->get();\n\t\t\t$md->disponible = 2;\n\t\t\t$md->save();\n\t\t\tprint($pedidoId);exit;\n\t\t}\n\n\t\t$this->model->fecha = date('Y-m-d');\t\t\n\t\t$this->model->mesa = $mesa;\t\t\n\t\t$this->model->estado = 1;\t\t\n\t\t$this->model->save();\n\t\t\n\t\t$md = new Mesa();\n\t\t$md->mesa_id = $mesa;\n\t\t$md->get();\n\t\t$md->disponible = 2;\n\t\t$md->save();\n\t\t\n\t\t$pedido_id = $this->model->pedido_id;\n\t\t\n\t\t$bp = new BebidaPedido();\n\t\t$bp->pedido = $pedido_id;\n\t\t$bp->bebida = $bebida;\n\t\t$bp->cantidad = $cantidad;\n\t\t$bp->save();\n\t\tprint($pedido_id);exit;\n\n\t}", "public function add_data()\n {\n try\n {\n if($this->id_producto!=NULL) //Identificar si llega un ID nulo o declarado\n {\n $sql=\"UPDATE productos set proveedores_id_proveedor=?,categoria_id_Categoria=?,nom_producto=?,pre_producto=?,can_producto=? WHERE id_producto = ?\";\n \n }else{\n $sql=\"INSERT into productos Values(0,?,?,?,?,?)\";\n }\n $consulta = $this->con->prepare($sql);\n $consulta->bindParam(1,$this->proveedores_id_proveedor);\n $consulta->bindParam(2,$this->categoria_id_Categoria);\n $consulta->bindParam(3,$this->nom_producto);\n $consulta->bindParam(4,$this->pre_producto);\n $consulta->bindParam(5,$this->can_producto); \n if($this->id_producto!=null)//Se asigna el valor del ID si esta declarado\n {\n $consulta->bindParam(6,$this->id_producto); \n }\n $consulta->execute();\n $this->con=null; \n }catch(PDOException $e)//mensaje de error en caso de fallo\n {\n print \"Error: \".$e->getMessage(); \n } \n }", "public function insert($producto);", "public function store(Request $request)\n {\n $codigo = $request->input(\"codigo\");\n $prod = Inventario::where('codigo',$codigo)->get()->first();\n\n if($prod <> NULL){\n $user = $prod->id;\n Session::flash('notify','El producto ya existe!!');\n return Redirect::to('/producto');\n //return (\"El producto ya existe, tiene el id: \".$user);\n }else{\n Inventario::create([\n 'proveedor_id'=>$request['proveedor_id'],\n 'producto'=>$request['producto'],\n 'stock'=>$request['stock'],\n 'precio_prov'=>$request['precio_prov'],\n 'porcentaje'=>$request['porcentaje'],\n 'precio_pub'=>$request['precio_pub'],\n 'recuerdame'=>$request['recuerdame'],\n 'status'=>$request['status'],\n 'codigo'=>$request['codigo'],\n 'path'=>$request['path'],\n 'updated_at'=> \\Carbon\\Carbon::now(),\n ]);\n Session::flash('msg','');\n return Redirect::to('/producto');\n }\n\n\n }", "public function save()\n {\n // datos obligatorios para la insercion/modificacion\n $data = [\n \"propietario\" => $this->owner,\n \"estado\" => $this->state,\n \"nombre\" => $this->name\n ];\n\n // datos opcionales, que pueden no estar establecidos para la \n // insercion/modificacion\n if (isset($this->description)) $data[\"descripcion\"] = $this->description;\n\n // si idProduct no es null, entonces es un update\n if (isset($this->idProduct))\n return $this->dao->update($data, [\"idProducto\" => $this->idProduct]);\n\n // sino, es un insert\n return $this->dao->insert($data);\n }", "private function datos_proveedor()\n {\n $this->template = FALSE;\n \n header('Content-Type: application/json');\n echo json_encode( $this->proveedor->get($_REQUEST['datosproveedor']) );\n }", "public function create()\n {\n $cbd='---Seleccione Distrito---';\n $cbid=\"\";\n $distritos = Distrito::all();\n return view('proveedores.create', [\n 'proveedor' => new Proveedor,\n 'distritos'=> $distritos,\n 'cbid' => $cbid,\n 'cbd' => $cbd\n ]);\n }" ]
[ "0.658083", "0.65154624", "0.64936125", "0.64691424", "0.642821", "0.63903636", "0.6331015", "0.6322302", "0.63174355", "0.62954617", "0.6276084", "0.6269909", "0.6252022", "0.62214845", "0.6216492", "0.62156814", "0.6195148", "0.6162741", "0.6112412", "0.61071867", "0.6095144", "0.6064976", "0.60404295", "0.60377586", "0.60038483", "0.59978014", "0.5951023", "0.5950974", "0.594984", "0.59402937", "0.5917618", "0.5917618", "0.5910806", "0.5908432", "0.5867278", "0.5865509", "0.58262676", "0.5824542", "0.58125246", "0.5809717", "0.58038485", "0.57911855", "0.5784784", "0.5780362", "0.5746082", "0.57406414", "0.57027596", "0.5684773", "0.56579477", "0.56560487", "0.5648575", "0.56402767", "0.56333953", "0.5626279", "0.56160074", "0.5586133", "0.5585878", "0.55844754", "0.55813825", "0.5549254", "0.55434996", "0.554303", "0.5541969", "0.553985", "0.55358523", "0.5521747", "0.5516308", "0.55161923", "0.55079365", "0.5507425", "0.5506216", "0.5498213", "0.5497698", "0.54900765", "0.54780734", "0.54700685", "0.5458381", "0.5458024", "0.54550284", "0.5451469", "0.5445161", "0.54370403", "0.54309666", "0.54228336", "0.5417524", "0.5412113", "0.54105747", "0.5404847", "0.54029787", "0.53888565", "0.53821254", "0.53790134", "0.5372433", "0.5368833", "0.536653", "0.5353312", "0.53512573", "0.5346953", "0.53429514", "0.5341425" ]
0.7514581
0
Elimina un objeto Proveedor en la base de datos.
public function delete($proveedor);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy(Proveedor $proveedor)\n {\n //\n }", "public function destroy(ProveedoresModel $proveedor)\n {\n //\n }", "public function EliminarProveedores()\n\t\t{\n\t\t\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\t\t\t$sql = \" select codproveedor from compras where codproveedor = ? \";\n\t\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t\t$stmt->execute( array(base64_decode($_GET[\"codproveedor\"])) );\n\t\t\t\t$num = $stmt->rowCount();\n\t\t\t\tif($num == 0)\n\t\t\t\t{\n\n\t\t\t\t\t$sql = \" delete from proveedores where codproveedor = ? \";\n\t\t\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t\t\t$stmt->bindParam(1,$codproveedor);\n\t\t\t\t\t$codproveedor = base64_decode($_GET[\"codproveedor\"]);\n\t\t\t\t\t$stmt->execute();\n\n\t\t\t\t\theader(\"Location: proveedores?mesage=1\");\n\t\t\t\t\texit;\n\n\t\t\t\t}else {\n\n\t\t\t\t\theader(\"Location: proveedores?mesage=2\");\n\t\t\t\t\texit;\n\t\t\t\t} \n\n\t\t\t} else {\n\n\t\t\t\theader(\"Location: proveedores?mesage=3\");\n\t\t\t\texit;\n\t\t\t}\t\n\t\t}", "public function eliminar($objeto){\r\n\t}", "function deleteMco_proveedores($PVE_ID)\n {\n \tif($this->gateway->existMco_proveedores($PVE_ID) == 1){\n $result = $this->gateway->deleteMco_proveedores($PVE_ID);\n if($result){\n $this->UnsetRequest();\n return EXITO_OPERACION_REALIZADA;\n }\n else\n {\n return ERROR_OPERACION_NO_REALIZADA;\n }\n }\n else\n {\n return ERROR_DATO_NO_EXISTE;\n }\n }", "public function destroy(Proveedor $proveedor)\n {\n $proveedor -> delete();\n return redirect()->route('proveedores.index')->with('status', 'El proveedor fue eliminado');\n }", "public function destroy(Proveedor $proveedor)\n {\n if ($proveedor->eliminar()) {\n $this->response['code'] = 200;\n $this->response['status'] = 'ok';\n $this->response['modelData'] = [\n 'id' => $proveedor->id,\n 'nombre' => $proveedor->nombre\n ];\n }\n return response()->json($this->response);\n }", "public function delete()\r\n {\r\n $db = Database::getDatabase();\r\n $db->consulta(\"DELETE FROM puesto WHERE idPue = {$this->idPue};\");\r\n }", "public function destroy($id)\n {\n // Comprobamos si el establecimiento existe o no.\n $establecimiento=\\App\\Establecimiento::find($id);\n\n if (count($establecimiento)==0)\n {\n // Devolvemos error codigo http 404\n return response()->json(['error'=>'No existe el Proveedor con id '.$id], 404);\n }\n\n $productos = $establecimiento->productos;\n\n if (sizeof($productos) > 0)\n {\n //Verificar si los productos del establecimineto estan en pedidos\n for ($i=0; $i < count($productos); $i++) { \n $productos[$i]->delete();\n\n $pedidos = $productos[$i]->pedidos;\n\n if (sizeof($pedidos) > 0)\n {\n // Devolvemos un código 409 Conflict. \n return response()->json(['error'=>'Este Proveedor no puede ser eliminado porque su productos están asociados a pedidos.'], 409);\n }\n }\n }\n\n if (sizeof($productos) > 0)\n {\n //Eliminar los productos asociados al establecimiento\n for ($i=0; $i < count($productos); $i++) { \n $productos[$i]->delete();\n }\n }\n\n $usuario=\\App\\User::find($establecimiento->usuario_id);\n\n // Eliminamos la establecimiento.\n $establecimiento->delete();\n\n // Eliminamos el usuario del establecimiento.\n $usuario->delete();\n\n return response()->json(['message'=>'Se ha eliminado correctamente el Proveedor.'], 200);\n }", "public function excluir(){\r\n return (new Database('cartao'))->delete('id = '.$this->id);\r\n }", "public function delete(Propriete $propriete)\n {\n $this->em->remove($propriete);\n $this->em->flush();\n }", "public function destroy(Proveedor $proveedor)\n {\n $proveedor->delete();\n $proveedores = Proveedor::paginate(10);//Llamar a todos los datos contenidos dentro de la tabla proveedor\n return view('proveedor/proveedor',compact('proveedores'))->with('status','Eliminación hecha, Satisfactoriamente...!')->with('pagina','proveedor');//llamar a la vista del provee\n }", "function borrar_empresa_exp($idproveedorexp){\n\t\t$sql=\"delete from catalogo_proveedor_experiencia where IDPROVEEDOREXP='$idproveedorexp'\";\n\t\t$this->query($sql);\n\n\t\treturn;\n\t}", "function borrar_telefono($idproveedor)\n\t{\n\t\t$sql=\"\n\t\tDELETE FROM catalogo_proveedor_telefono WHERE IDPROVEEDOR='$idproveedor'\n\t\t\";\n\t\t$this->query($sql);\n\t\treturn;\n\t}", "public function excluirprofessor() {\n\t\t//Recupera id do aluno\n\t\tif(!$this->uri->segment(\"3\"))\n\t\t\tredirect('/administracao/painel');\n\t\telse \n\t\t\t$intID =$this->uri->segment(\"3\");\n\n\t\t/* Carrega o modelo */\n\t\t$this->load->model('professores_model');\n\n\t\t/* Chama a função excluir do modelo */\n\t\tif ($this->professores_model->delete($intID)) {\n\t\t\tlog_message('success', 'Professor excluido com sucesso!');\n\t\t\tredirect('/administracao/listaprofessores');\n\t\t} else {\n\t\t\tlog_message('error', 'Erro ao excluir o aluno!');\n\t\t}\n\t}", "public function excluir()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"DELETE FROM EncontroComDeus WHERE id = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->id );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n\n }", "public function eliminar(){\n\n $sql = \"DELETE FROM PRODUCTOS WHERE ID = :delet\";\n $delete = $this->db->prepare($sql);\n $delete->execute(array(\":delet\" => \"{$this->getId()}\"));\n\n $result = false;\n\n if($delete){\n $result = true;\n }\n $delete->closeCursor();\n\n return $result;\n }", "public function eliminarProducto($codigo){\r\n //Preparamos la conexion a la bdd:\r\n $pdo=Database::connect();\r\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n $sql=\"delete from producto where codigo=?\";\r\n $consulta=$pdo->prepare($sql);\r\n //Ejecutamos la sentencia incluyendo a los parametros:\r\n $consulta->execute(array($codigo));\r\n Database::disconnect();\r\n }", "function eliminarRelacionProceso(){\n $this->objFunc=$this->create('MODObligacionPago');\n $this->res=$this->objFunc->eliminarRelacionProceso($this->objParam);\n $this->res->imprimirRespuesta($this->res->generarJson());\n }", "function eliminar_procesos_produccion($producto){\n\t\t$sql = \"DELETE FROM prd_productos_procesos WHERE id_producto = \" . $producto;\n\t\t$result = $this->query($sql);\n\n\t\treturn $result;\n\t}", "public function delete () {\n $this->db->delete('emprestimos', array('id_emprestimo' => $this->id_emprestimo));\n }", "public function eliminarPreDetalle(){\n $sql='DELETE FROM predetalle WHERE idCliente = ?';\n $params=array($this->idCliente);\n return Database::executeRow($sql, $params);\n }", "public function deleteproducto()\n\t{\n\n\t\t$idpedido = $_SESSION['idPedido'];\n\t\t$idproducto = $_POST['id'];\n\n\n\t\t$this->query(\"DELETE FROM producto_has_pedido WHERE Pedido_idPedido=$idpedido and Producto_idProductos=$idproducto\");\n\t\t$this->execute();\n\t}", "public function EliminarProducto(Request $request)\n {\n $id=Crypt::decrypt($request->id);\n $Product = Producto::find($id); \n $Product->delete();\n }", "public function excluirEquipe()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"DELETE FROM Equipe WHERE id = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->equipeId );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n }", "public function destroy(Request $request, $id){\n $proveedor = Proveedor::findOrFail($id);\n\n $request->validate([\n 'proveedor_id' => ['required', new SePuedeEliminarProveedor($proveedor)]\n ]);\n\n DB::beginTransaction();\n try {\n $proveedor->eliminar();\n DB::commit();\n\n $filtro = (isset($request->filtro) && !empty($request->filtro))?$request->filtro:'';\n $page = $request->page;\n $proveedores = Proveedor::buscar($filtro)->paginate(5);\n\n return response()->json(view('admin.compras.proveedores.index.include.tProveedores', \n ['proveedores' => $proveedores])->render());\n\n } catch (\\Exception $e) {\n DB::rollBack();\n\n return response()->json([], 500);\n }\n }", "public function eliminar($con){\r\n\t\t$sql = \"DELETE FROM lineaspedidos WHERE idPedido='$this->idPedido' AND idProducto='$this->idProducto'\";\r\n\t\t// Ejecuta la consulta y devuelve el resultado\r\n\t\treturn ($con->query($sql));\r\n\t}", "function borrar_prov_serv_cost($idproveedor,$idservicio){\n\t\t$sql=\"\n\t\tDELETE FROM catalogo_proveedor_servicio_costo_negociado WHERE IDPROVEEDOR='$idproveedor' AND IDSERVICIO='$idservicio'\n\t\t\";\n\t\t$this->query($sql);\n\t\treturn;\n\t}", "public function eliminar($idproducto){\n\t\t\t$db=DB::conectar();\n\t\t\t$eliminar=$db->prepare('DELETE FROM comentarios where IDPRODUCTO=:idproducto');\n\t\t\t$eliminar->bindvalue('idproducto',$idproducto);\n\t\t\t$eliminar->execute();\n\t\t}", "public function delete(){\n return (new Database('cliente'))->delete('id = '.$this->id);\n }", "public function eliminar()\n\t{\n\t\t$idestado = $_POST['idestado'];\n\t\t//en viamos por parametro el id del estado a eliminar\n\t\tEstado::delete($idestado);\n\t}", "public function Eliminar()\n {\n $sentenciaSql = \"DELETE FROM \n detalle_orden \n WHERE \n id_detalle_orden = $this->idDetalleOrden\";\n $this->conn->preparar($sentenciaSql);\n $this->conn->ejecutar();\n }", "public function destroy($id)\n {\n //\n $response = new \\stdClass();\n\n $proveedores = DB::table('proveedor')->where('id', '=', $id)->first();\n if(!$proveedores){\n $response->success =false;\n $response->mensaje = 'no existe el elemento con el id = '.$id;\n return JsonResponse::create($response);\n }\n DB::table('proveedor')\n ->where('id', '=', $id)\n ->delete();\n\n $response->success = true;\n return JsonResponse::create($response);\n\n }", "public function delete_faseetapa($id_p){ \n\n $this->db->where('proy_id', $id_p);\n $this->db->delete('_proyectofaseetapacomponente');\n }", "public function excluir()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"DELETE FROM EquipeDiscipulos WHERE discipuloId = ?\n AND equipeId = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->discipuloId );\n $stm->bindParam(2, $this->equipeId );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n\n }", "public function delete() {\n $conexion = StorianDB::connectDB();\n $borrado = \"DELETE FROM cuento WHERE id=\\\"\".$this->id.\"\\\"\";\n $conexion->exec($borrado);\n }", "function opcion__eliminar()\n\t{\n\t\t$id_proyecto = $this->get_id_proyecto_actual();\n\t\tif ( $id_proyecto == 'toba' ) {\n\t\t\tthrow new toba_error(\"No es posible eliminar el proyecto 'toba'\");\n\t\t}\n\t\ttry {\n\t\t\t$p = $this->get_proyecto();\n\t\t\tif ( $this->consola->dialogo_simple(\"Desea ELIMINAR los metadatos y DESVINCULAR el proyecto '\"\n\t\t\t\t\t.$id_proyecto.\"' de la instancia '\"\n\t\t\t\t\t.$this->get_id_instancia_actual().\"'\") ) {\n\t\t\t\t$p->eliminar_autonomo();\n\t\t\t}\n\t\t} catch (toba_error $e) {\n\t\t\t$this->consola->error($e->__toString());\n\t\t}\n\t\t$this->get_instancia()->desvincular_proyecto( $id_proyecto );\n\t}", "public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }", "public function delete()\n {\n return $this->dao->delete([\"idProducto\" => $this->idProduct]);\n }", "function deletePreDetalle(){\n $sql='DELETE FROM predetalle WHERE idCliente = ?';\n $params=array($this->cliente);\n return Database::executeRow($sql, $params);\n }", "public function destroy(Request $request)\n {\n //\n Proveedores::find($request->id)->delete();\n return redirect('/proveedores/');\n }", "static public function mdlEliminarProveedor($tabla, $datos){\n\n\t\t//$stmt = Conexion::conectar()->prepare(\"DELETE FROM $tabla WHERE id = :id\");\n\t\t$stmt = Conexion::conectar()->prepare(\"UPDATE $tabla SET estatus=0 WHERE id = :id\");\n\n\t\t$stmt -> bindParam(\":id\", $datos, PDO::PARAM_INT);\n\n\t\tif($stmt -> execute()){\n\n\t\t\treturn \"ok\";\n\t\t\n\t\t}else{\n\n\t\t\treturn \"error\";\t\n\n\t\t}\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n\t}", "public function deleteEntidad(){\n $conexion = new Database();\n\t\tif ($this->codigo){\n $sql = sprintf('DELETE FROM agenda_entidades WHERE entidad_id = %d',\n $this->codigo);\n $conexion->exec( $sql );\n }\n }", "public function eliminarProyecto(Request $request)\n\n {\n $proyecto = Proyecto::find($request->get(\"idPro\"));\n $proyecto->estadosdeproyectos_id = $request->get(\"idEliminar\");\n $proyecto->resumen = $request->get('textoEliminar');\n $proyecto->save();\n\n return redirect(\"home\");\n\n }", "public function eliminar($data)\n {\n $cliente=$this->db->query('delete from tab_cliente where id_cliente='.$data); \n }", "public function deleting(Seguimiento $Seguimiento){\n \n }", "public function destroy(Request $request)\n {\n $mint_idProveedor = (int)$request->idProveedor;\n $proveedor = Proveedor::find($mint_idProveedor);\n $proveedor->Estado = null;\n $this->ProveedorRep->Actualizar($proveedor);\n return redirect('/pagProveedor');\n }", "public function eliminar() {\n\t\t\n\t\t\n\t\t$juradodni = $_GET[\"dniJurado\"];\n\t\t\n\t\t$this -> JuradoMapper -> delete($juradodni);\n\n\t\t\n\t\t$this -> view -> redirect(\"jurado\", \"listar\");\n\t\t//falta cambiar\n\t}", "function deleteProyecto($proyecto){\n //no implementado por no requerimiento del proyecto\n }", "public static function destroyEstudiante($idEstu)\n{\n $estudiante = Estudiante::find($idEstu);\n $estudiante->delete();\n}", "public function eliminaPedido($codpedido) {\n $sql = \"SELECT elementoPedido_elementoPedido_id\n FROM tieneElemento\n WHERE pedido_pedido_id = $codpedido\";\n $result = $this->bd->query($sql);\n $numfilas = $result->num_rows;\n /* Elimino las asociaciones del pedido con sus elementos */\n $sql2 = \"DELETE FROM tieneElemento\n WHERE pedido_pedido_id = $codpedido\";\n $result2 = $this->bd->query($sql2);\n /* Elimino los elementos del pedido, con sus elementos de cola y asociaciones */\n for($i=0; $i<$numfilas ; $i++) {\n $row = $result->fetch_assoc();\n $cod = $row[\"elementoPedido_elementoPedido_id\"];\n $sql3 = \"DELETE FROM asociaPlato\n WHERE elementoColaCocina_elementoPedido_elementoPedido_id = $cod\";\n $sql4 = \"DELETE FROM asociaBebida\n WHERE elementoColaBar_elementoPedido_elementoPedido_id = $cod\";\n $sql5 = \"DELETE FROM elementoColaCocina\n WHERE elementoPedido_elementoPedido_id = $cod\";\n $sql6 = \"DELETE FROM elementoColaBar\n WHERE elementoPedido_elementoPedido_id = $cod\";\n $sql7 = \"DELETE FROM elementoPedido\n WHERE elementoPedido_id = $cod\";\n $result3 = $this->bd->query($sql3);\n $result4 = $this->bd->query($sql4);\n $result5 = $this->bd->query($sql5);\n $result6 = $this->bd->query($sql6);\n $result7 = $this->bd->query($sql7);\n }\n /* Elimino el pedido y */\n $sql8 = \"DELETE FROM facturaPedido\n WHERE pedido_pedido_id = $codpedido\";\n// $sql9 = \"DELETE FROM pedido\n// WHERE pedido_id = $codpedido\";\n\n $result8 = $this->bd->query($sql8);\n// $result9 = $this->bd->query($sql9);\n }", "public function insert($proveedor);", "public function eliminarusuario($codigo){\r\n\t//Preparamos la conexion a la bdd:\r\n\t$pdo=Database::connect();\r\n\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t$sql=\"delete from usuario where codigo=?\";\r\n\t$consulta=$pdo->prepare($sql);\r\n//Ejecutamos la sentencia incluyendo a los parametros:\r\n\t$consulta->execute(array($codigo));\r\n\tDatabase::disconnect();\r\n}", "public function select($proveedor);", "public function excluir() {\n\t\t$this->__con->where('p_id', $this->p_id);\n\t\t$excluir = $this->__con->delete('produto');\n\n\t\tif ($excluir>0) {\n\n\t\t\treturn $excluir;\n\n\t\t} else {\n\t\t\tthrow new \\Exception(\"Não foi possível excluir o produto.\", 1);\n\t\t}\n\t\n\t}", "function remove() {\n\t\t$option = JRequest::getCmd('option');\n\t\t// Se obtienen los ids de los registros a borrar\n\t\t$cids = JRequest::getVar('cid', array(0), 'post', 'array');\n $product_type_code = JRequest::getVar('product_type_code');\n\n\t\t// Lanzar error si no se ha seleccionado al menos un registro a borrar\n if (count($cids) < 1 || !$product_type_code) {\n\t\t\tJError::raiseError(500, JText::_('CP.SELECT_AN_ITEM_TO_DELETE'));\n\t\t}\n\n\t\t// Se obtiene el modelo\n\t\t$model = $this->getModel('comments');\n\t\t// Se intenta el borrado\n\t\tif ($model->delete($cids, $product_type_code)) {\n\t\t\t$msg = JText::_('CP.DATA_DELETED');\n\t\t\t$type = 'message';\n\t\t} else {\n\t\t\t// Si hay algún error se ajusta el mensaje\n\t\t\t$msg = $model->getError();\n\t\t\tif (!$msg) {\n\t\t\t\t$msg = JText::_('CP.ERROR_ONE_OR_MORE_DATA_COULD_NOT_BE_DELETED');\n\t\t\t}\n\t\t\t$type = 'error';\n\t\t}\n\n\t\t$this->setRedirect('index.php?option=' . $option . '&view=comments', $msg, $type);\n\t}", "function borrarInscrito() {\n //Creamos la evaluacion\n leerClase('Evaluacion');\n leerClase('Estudiante');\n leerClase('Proyecto_dicta');\n $estudiante = new Estudiante($this->estudiante_id);\n $evaluacion = new Evaluacion($this->evaluacion_id);\n $protecto=$estudiante->getProyecto();\n $sql = \"select p.id as id from \" . $this->getTableName('Proyecto_dicta') . \" as p where p.proyecto_id = '$protecto->id' and p.dicta_id = '$this->dicta_id' \";\n $resultado = mysql_query($sql);\n\n $proyecto_array = mysql_fetch_array($resultado);\n $proyecto_dicta = new Proyecto_dicta($proyecto_array);\n $proyecto_dicta->delete();\n $evaluacion->delete();\n $this->delete();\n }", "public function posteliminar() {\n $model = (new PaisRepository())->Obtener($_POST['id']);\n\n $rh = (new PaisRepository())->Eliminar($model);\n\n print_r(json_encode($rh));\n }", "public function destroy($id)\n {\n $proveedor_id = Crypt::decrypt($id);\n\n try {\n $proveedor = Tipo_Proveedor::findOrfail($proveedor_id)->delete();\n\n flash('Los datos del tipo de proveedor han sido eliminados satisfactoriamente.')->success();\n return redirect('proveedor');\n }catch (\\Exception $e) {\n\n\n flash('Error al intentar eliminar los datos del tipo de proveedor.')->error();\n //flash($e->getMessage())->error();\n return redirect('proveedor');\n }\n }", "public function eliminar ($idpersona)\n\t{\n\t\t$sql=\"DELETE FROM persona WHERE idpersona='$idpersona';\";\n/*echo \"<pre><br>Elin¡minas:<br>\";\nprint_r($sql);\necho \"</pre>\";\ndie();*/\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function delete($producto);", "public function edit(Proveedor $proveedor)\n {\n //\n }", "public function destroy(Request $request, $id)\n {\n //AGREGANDO LA ACCION A BITACORA\n Auth()->user()->registerBinnacle();\n\n $proveedor = proveedor::find($id);\n $proveedor->estado =0;\n $proveedor->save();\n return redirect()->route('proveedors.index');\n }", "public function delete($objet);", "public function Eliminar(){\n\t\t\t$enlace = AccesoBD::Conexion();\n\n\t\t\t$sql = \"DELETE FROM denuncia WHERE ID_DENUNCIA = '$this->idDenuncia'\";\n\n\t\t\tif ($enlace->query($sql) !== TRUE) {\n \t\t\techo \"Error al eliminar la denuncia\";\n \t\t\texit();\n\t\t\t}\n\t\t\techo \"Denuncia eliminada\";\n\t\t}", "public function destroy($prov)\n {\n $proveedor = Proveedor::findOrFail($prov);\n $proveedor->delete();\n $proveedores = Proveedor::all();\n return view('proveedor.index')->with('proveedores', $proveedores);\n }", "public function destroy(anteproyecto $anteproyecto)\n {\n //\n }", "function eliminar($objeto){\n\t\t$sql=\"\tUPDATE\n\t\t\t\t\tcom_recetas\n\t\t\t\tSET\n\t\t\t\t\tstatus = 2\n\t\t\t\tWHERE\n\t\t\t\t\tid = \".$objeto['id'].\";\n\n\t\t\t\tUPDATE\n\t\t\t\t\tapp_productos\n\t\t\t\tSET\n\t\t\t\t\tstatus = 0\n\t\t\t\tWHERE\n\t\t\t\t\tid = \".$objeto['id'].\";\n\n\t\t\t\tUPDATE\n\t\t\t\t\tapp_producto_material\n\t\t\t\tSET\n\t\t\t\t\tstatus = 0\n\t\t\t\tWHERE\n\t\t\t\t\tid_producto = \".$objeto['id'].\";\";\n\t\t// return $sql;\n\t\t$result = $this->dataTransact($sql);\n\n\t\treturn $result;\n\t}", "public function removeProducto(Request $request){\n \n $id_producto = $request['id_producto'];\n return ProductoModel::eliminarProducto($id_producto);\n }", "public function producto_delete($cod){\r\n $sql = \"DELETE FROM productos WHERE id_producto=:miCod\";\r\n\r\n $resultado=$this->db->prepare($sql);\r\n \r\n $resultado->execute(array(\":miCod\"=>$cod));\r\n }", "function borrarProducto ($nombreproducto){\r\n $enc = false;\r\n for ($i = 0; $i < count ($this->productos) && ($enc == false); $i++){\r\n if ($this->productos[$i]->getNombre() == $nomproducto){\r\n $this->productos[$i] = null;\r\n $enc = true;\r\n }\r\n }\r\n }", "public function excluir()\n {\n return (new Database('vagas'))->delete('id = '.$this->id);\n }", "function eliminar_producto_proyecto($id){\n\t\t$conexion_bd = conectar_bd();\n\n\t\t//Prepaprar la consulta\n\t\t$dml = 'DELETE FROM `producto_proyecto` WHERE `producto_proyecto`.`id_producto` = (?)';\n\t\tif ( !($statement = $conexion_bd->prepare($dml)) ){\n\t\t\tdie(\"Error: (\" . $conexion_bd->errno . \") \" . $conexion_bd->error);\n\t\t\treturn 0;\n\t\t\t}\n\n\t\t// Unir los parametros de la funcion con los parametros de la consulta\n\t\t// El primer argumento de bind_param es el formato de cada parametro\n\t\tif (!$statement->bind_param(\"s\", $id)) {\n\t\t\tdie(\"Error en vinculación: (\" . $statement->errno . \") \" . $statement->error);\n\t\t\treturn 0;\n\t\t\t}\n\n\t\t// Ejecutar la consulta\n\t\tif (!$statement->execute()) {\n\t\t\tdie(\"Error en ejecución: (\" . $statement->errno . \") \" . $statement->error);\n\t\t\treturn 0;\n\t\t\t}\n\n\t\t//Desconectarse de la base de datos\n\t\t\t desconectar_bd($conexion_bd);\n\t\t\t return 1;\n \n\t}", "function Elimina($id){\r\n\t\r\n\t\t$db=dbconnect();\r\n\t\r\n\t\t/*Definición del query que permitira eliminar un registro*/\r\n\t\t$sqldel=\"DELETE FROM productos WHERE id_producto=:id\";\r\n\t\r\n\t\t/*Preparación SQL*/\r\n\t\t$querydel=$db->prepare($sqldel);\r\n\t\t\t\r\n\t\t$querydel->bindParam(':id',$id);\r\n\t\t\r\n\t\t$valaux=$querydel->execute();\r\n\t\r\n\t\treturn $valaux;\r\n\t}", "public function destroy(Prueva $prueva)\n {\n //\n }", "public function eliminar(){\n $sql = \"UPDATE especialidad SET Estado = ? WHERE Id_Especialidad = ?;\";\n //preparando la consulta\n $query = $this->conexion->prepare($sql);\n //bindeando los parametros de la consulta prepar\n $query->bindParam(1, $this->estado);\n $query->bindParam(2, $this->id_especialidad);\n //ejecutando\n $result = $query->execute();\n //retornando true si se ejecuto, false si no\n return $result;\n }", "public function delete_product_purchase()\n\t{\n\t\tif(empty($this->request->data['id_cliente']) || empty($this->request->data['produto_id']))\n\t\t{\n\t\t\t$this->Return = false;\n\t\t\t$this->Message = 'Informar produto e codigo do cliente';\n\t\t\t$this->EncodeReturn();\t\n\t\t}\n\n\t\t$CartSession = json_decode(base64_decode($this->request->data['carrinho']), 1);\n\n\t\t$i = 0;\t\t\t\t\n\t\tforeach ($CartSession['item'] as $item) \n\t\t{\n\t\t\tif($item['Produto']['id'] == $this->request->data['produto_id'] && $i == $this->request->data['indice'])\n\t\t\t{\n\t\t\t\tunset($CartSession['item'][$i]);\t\t\t\t\n\t\t\t}\n\n\t\t\t$i++;\n\t\t}\t\t\n\n\t\tsort($CartSession['item']);\t\n\n\t\t##realiza soma de valores\n\t\t$this->CountPurchase($CartSession);\t\n\t\t$this->EncodeReturn();\t\n\t}", "public function EliminarIngredientesProductos()\n{\n\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\t$sql = \" delete from productosvsingredientes where codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codproducto);\n\t\t$stmt->bindParam(2,$codingrediente);\n\t\t$codproducto = base64_decode($_GET[\"codproducto\"]);\n\t\t$codingrediente = base64_decode($_GET[\"codingrediente\"]);\n\t\t$stmt->execute();\n\n\t\techo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-check-square-o'></span> EL INGREDIENTE FUE ELIMINADO EXITOSAMENTE </center>\";\n\t\techo \"</div>\"; \n\t\texit;\n\n\t} else {\n\n\t\techo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-check-square-o'></span> USTED NO PUEDE ELIMINAR INGREDIENTES AGREGADOS, NO ERES EL ADMINISTRADOR DEL SISTEMA </center>\";\n\t\techo \"</div>\"; \n\t\texit;\n\t}\n\n}", "public function destroy($id_cliente){}", "public function eliminaReserva($cod) {\n // 1ro actualizamos la existencia de los productos adicionando lo que no se ha vendido\n $modelocantidad = $this->db->query(\"SELECT p.modelo,(d.cantidad+p.existencia) as existencia FROM producto p,detalle_venta d WHERE p.modelo LIKE d.modelo AND d.cod_venta LIKE '\" . $cod . \"';\")->result_array(); //obtenemos los datos del detalle\n if (sizeof($modelocantidad) > 0) {\n //actualizamos la existencia en producto\n $this->db->update_batch('producto', $modelocantidad, 'modelo');\n if ($this->db->affected_rows() > 0) {\n //3ro eliminamos el detalle de venta de la venta\n $this->db->query(\"delete from detalle_venta where cod_venta like '\" . $cod . \"'\");\n if ($this->db->affected_rows() > 0) {\n //eliminamos los datos de la venta\n $this->db->query(\"delete from venta where cod_venta like '\" . $cod . \"'\");\n if ($this->db->affected_rows() > 0) {\n return \"Exito! Se ha eliminado la reserva de\"; //el nombre se muestra en jquery\n } else {\n return \"Error: No se ha eliminado la reserva de\";\n }\n } else {\n return \"Error: No se ha eliminado el Detalle de la venta de\";\n }\n } else {\n return \"Error: No se ha actualizado la existencia de productos\";\n }\n } else {\n return \"No se tiene registro del detalle de la venta de\";\n }\n }", "function eliminar_insumos($objeto){\n\t\t$sql=\"\tDELETE FROM\n\t\t\t\t\t app_producto_material\n\t\t\t\tWHERE\n\t\t\t\t\tid_producto =\".$objeto['id'];\n\t\t// return $sql;\n\t\t$result = $this->query($sql);\n\n\t\treturn $result;\n\t}", "public function excluir(){\r\n return (new Database('atividades'))->delete('id = '.$this->id);\r\n }", "function deletePreDetalle2()\n {\n $sql='DELETE FROM predetalle WHERE idPreDetalle = ?';\n $params=array($this->idPre);\n return Database::executeRow($sql, $params);\n }", "public function eliminar(){\n if(!isLoggedIn()){\n redirect('usuarios/login');\n }\n //check User Role -- Only ADMINISTRADOR allowed\n if(!checkLoggedUserRol(\"ADMINISTRADOR\")){\n redirect('dashboard');\n }\n\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\n $data = [\n 'especialidadToDelete' => trim($_POST['especialidadToDelete'])\n ];\n \n // Validar carga de especialidadToDelete\n if(empty($data['especialidadToDelete'])){\n $data['especialidadToDelete_error'] = 'No se ha seleccionado la especialidad a eliminar';\n }\n\n // Asegurarse que no haya errores\n if(empty($data['especialidadToDelete_error'])){\n // Crear especialidad\n if($this->especialidadModel->eliminarEspecialidad($data['especialidadToDelete'])){\n flash('especialidad_success', 'Especialidad eliminada exitosamente');\n redirect('especialidades');\n }\n else{\n die('Ocurrió un error inesperado');\n }\n }\n else{\n flash('especialidad_error', $data['especialidadToDelete_error'], 'alert alert-danger');\n redirect('especialidades');\n }\n }\n }", "protected function eliminar_cliente_modelo ($codigo){\n\t\t$query=mainModel::conectar()->prepare(\"DELETE FROM cliente WHERE CuentaCodigo =:Codigo\");\n\t\t$query->bindParam(\":Codigo\",$codigo);\n\t\t$query->execute();\n\t\treturn $query;\n\t}", "public function EliminarDetallesVentasPedidosProductos()\n{\t\t\n\tself::SetNames();\n\t$sql = \" select * from detalleventas where codventa = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num > 1)\n\t{\n\n\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $row;\n\t\t\t}\n\t\t\t$existenciadb = $p[0][\"existencia\"];\n\n\t\t\t$sql = \" delete from detalleventas where coddetalleventa = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$coddetalleventa);\n\t\t\t$coddetalleventa = base64_decode($_GET[\"coddetalleventa\"]);\n\t\t\t$stmt->execute();\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$stmt->bindParam(2, $codproducto);\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$existencia = $existenciadb + $cantventa;\n\t\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codventa);\n\t\t\t$stmt->bindParam(2,$codproducto);\n\t\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$stmt->execute();\n\n################## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #######################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($codproducto));\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$codproducto.\"'\";\n\n\t $array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\n\t\t\t$codproducto = $row['codproducto'];\n\t\t\t$codingrediente = $row['codingrediente'];\n\t\t\t$cantracion = $row['cantracion'];\n\t\t\t$cantingrediente = $row['cantingrediente'];\n\t\t\t$costoingrediente = $row['costoingrediente'];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$stmt->bindParam(3,$codingrediente);\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$codingrediente = strip_tags($codingrediente);\n\t\t$stmt->execute();\n\n\n\t\t\t$update = \" update ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codingrediente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($update);\n\t\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$racion = rount($cantracion*$cantventa,2);\n\t\t\t$cantidadracion = rount($cantingrediente+$racion,2);\n\t\t\t$stmt->execute();\n\n\n\t\t }\n\n}\n################### FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #################\n\n\n\t\t\t$sql4 = \"select * from ventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$paea[] = $row;\n\t\t\t}\n\t\t\t$subtotalivasive = $paea[0][\"subtotalivasive\"];\n\t\t\t$subtotalivanove = $paea[0][\"subtotalivanove\"];\n\t\t\t$iva = $paea[0][\"ivave\"]/100;\n\t\t\t$descuento = $paea[0][\"descuentove\"]/100;\n\t\t\t$totalivave = $paea[0][\"totalivave\"];\n\t\t\t$totaldescuentove = $paea[0][\"totaldescuentove\"];\n\t\t\t\n\t\t\n$sql3 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'SI'\";\n\t\t$stmt = $this->dbh->prepare($sql3);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $row;\n\t\t\t}\n\t\t$preciocompraiva = $row[\"preciocompra\"];\n\t\t$importeiva = $row[\"importe\"];\n\t\t$importe2iva = $row[\"importe2\"];\n\t\n$sql5 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'NO'\";\n\t\t$stmt = $this->dbh->prepare($sql5);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($rov = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$pae[] = $rov;\n\t\t\t}\n\t\t$preciocompra = $rov[\"preciocompra\"];\n\t\t$importe = $rov[\"importe\"];\n\t\t$importe2 = $rov[\"importe2\"];\n\t\t\n\t\t$sql = \" update ventas set \"\n\t\t\t .\" subtotalivasive = ?, \"\n\t\t\t .\" subtotalivanove = ?, \"\n\t\t\t .\" totalivave = ?, \"\n\t\t\t .\" totaldescuentove = ?, \"\n\t\t\t .\" totalpago= ?, \"\n\t\t\t .\" totalpago2= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotalivasive);\n\t\t$stmt->bindParam(2, $subtotalivanove);\n\t\t$stmt->bindParam(3, $totaliva);\n\t\t$stmt->bindParam(4, $totaldescuentove);\n\t\t$stmt->bindParam(5, $total);\n\t\t$stmt->bindParam(6, $total2);\n\t\t$stmt->bindParam(7, $codventa);\n\t\t\n\t\t$subtotalivasive= rount($importeiva,2);\n\t\t$subtotalivanove= rount($importe,2);\n $totaliva= rount($subtotalivasive*$iva,2);\n\t\t$tot= rount($subtotalivasive+$subtotalivanove+$totaliva,2);\n\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t$total= rount($tot-$totaldescuentove,2);\n\t\t$total2= rount($preciocompra,2);\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$stmt->execute();\n\n\t\t\t\t\t\tunset($_SESSION[\"CarritoVentas\"]);\n\n\t?>\n\t\t<script type='text/javascript' language='javascript'>\n\t alert('EL PEDIDO DE PRODUCTOS FUE ELIMINADOS, \\nDE LA MESA EXITOSAMENTE') \n </script> \n\t\t<?php \n\t\t\texit;\n\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\n\t\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $row;\n\t\t\t}\n\t\t\t$existenciadb = $p[0][\"existencia\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$stmt->bindParam(2, $codproducto);\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$existencia = $existenciadb + $cantventa;\n\t\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codventa);\n\t\t\t$stmt->bindParam(2,$codproducto);\n\t\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$stmt->execute();\n\n\n################## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #######################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($codproducto));\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$codproducto.\"'\";\n\n\t $array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\n\t\t\t$codproducto = $row['codproducto'];\n\t\t\t$codingrediente = $row['codingrediente'];\n\t\t\t$cantracion = $row['cantracion'];\n\t\t\t$cantingrediente = $row['cantingrediente'];\n\t\t\t$costoingrediente = $row['costoingrediente'];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$stmt->bindParam(3,$codingrediente);\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$codingrediente = strip_tags($codingrediente);\n\t\t$stmt->execute();\n\n\t\t\t$update = \" update ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codingrediente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($update);\n\t\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$racion = rount($cantracion*$cantventa,2);\n\t\t\t$cantidadracion = rount($cantingrediente+$racion,2);\n\t\t\t$stmt->execute();\n\n\t\t }\n}\n################### FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS ###################\n\n\t\t\t$sql = \" delete from ventas where codventa = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codventa);\n\t\t\t$codventa = base64_decode($_GET[\"codventa\"]);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" delete from detalleventas where coddetalleventa = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$coddetalleventa);\n\t\t\t$coddetalleventa = base64_decode($_GET[\"coddetalleventa\"]);\n\t\t\t$stmt->execute();\n\n#################### AQUI ACTUALIZAMOS EL STATUS DE MESA ####################\n\t\t\t$sql = \" update mesas set \"\n\t\t\t.\" statusmesa = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codmesa = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $statusmesa);\n\t\t\t$stmt->bindParam(2, $codmesa);\n\n\t\t\t$statusmesa = strip_tags('0');\n\t\t\t$codmesa = base64_decode($_GET[\"codmesa\"]);\n\t\t\t$stmt->execute();\n#################### AQUI ACTUALIZAMOS EL STATUS DE MESA ####################\n\n?>\n\t\t<script type='text/javascript' language='javascript'>\n\t alert('LOS PEDIDOS DE PRODUCTOS HAN SIDO ELIMINADOS, \\nDE LA MESA EXITOSAMENTE') \n </script> \n\t\t<?php \n\t\texit;\n\t}\n}", "function excluir($id)\n{\n $produto = Produto::find($id);\n\n // Excluindo este objeto\n $produto->delete();\n\n // Criando uma mensagem para ser enviada a view produto.pesquisar\n $mensagem = \"Produto excluído com sucesso!\";\n\n // Capturando objetos para enviar a view produto.pesquisar\n $produtos = Produto::all();\n\n // Retornando a view produto.pesquisar\n return view('produto.pesquisar')->with('mensagem', $mensagem)->with('produtos', $produtos);\n}", "public function deleteRow()\n {\n $sql = 'DELETE FROM productos\n WHERE id_producto = ?';\n $params = array($this->id);\n return Database::executeRow($sql, $params);\n }", "public function eliminar()\n {\n if (isset ($_REQUEST['id'])){\n $id=$_REQUEST['id'];\n $miConexion=HelperDatos::obtenerConexion();\n $resultado=$miConexion->query(\"call eliminar_rubro($id)\");\n }\n }", "public function destroy($id)\n {\n $prov = Proveedor::findOrFail($id);\n $domicilio = Direccion::findOrFail($prov->id_domicilio);\n $domicilio->delete();\n $prov->delete();\n\n return redirect()->route('proveedores.index'); \n }", "public static function deletaProdutoCarrinho(){\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $expPro = explode(';',self::$carrinho->produto_id);\n $expQuant = explode(';',self::$carrinho->quantidade);\n unset($expPro[self::$posicao]);\n unset($expQuant[self::$posicao]);\n\n //VERIFICA SE TEM PRODUTOS NO CARRINHO\n if($expPro and $expQuant !== ''){\n $impPro = implode(';',$expPro);\n $impQuant = implode(';',$expQuant);\n $query = 'UPDATE carrinhos SET produto_id=:pro, quantidade=:qnt, idCliente=:idC WHERE id=:id';\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1,$impPro);\n $stmt->bindValue(2,$impQuant);\n $stmt->bindValue(3,self::$carrinho->idCliente);\n $stmt->bindValue(4,self::$carrinho->id);\n $stmt->execute();\n if($stmt->rowcount()){\n return true;\n }throw new \\Exception(\"Erro ao Deletar Produto\");\n\n //SE O CARRINHO ESTIVER VAZIO SERA DELETADO\n }else{\n $query = 'DELETE FROM carrinhos WHERE carrinhos.id LIKE :id';\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1,self::$carrinho->id);\n $stmt->execute();\n if($stmt->rowcount()){\n $_SESSION['user']['carrinhoId'] = NULL;\n\n return true;\n }throw new \\Exception(\"Erro ao Deletar Carrinho\");\n }\n }", "function delete() {\n\t\t$sql = \"DELETE FROM \".$this->hr_db.\".hr_person_detail\n\t\t\t\tWHERE psd_ps_id=?\";\n\t\t$this->hr->query($sql, array($this->psd_ps_id));\n\t}", "function deletepanier($user, $product){\t\t// Fonction pour supprimer un produit du panier\n\n\t\tinclude(\"../../modele/modele.php\");\n\n\t\t$sql = 'SELECT * FROM detailcommande WHERE id_product= \"'.$product.'\" AND id_user= \"'.$user.'\" AND actif = 1';\n\t\t$reponse = $bdd->query($sql);\n\t\t\n\t\twhile ($donnees = $reponse->fetch())\n\t\t{\n\t\t\t$sql2 = 'DELETE FROM commande WHERE id_user = \"'.$user.'\" AND id_detailCommande = \"'.$donnees['id'].'\" AND actif = 1 ';\n\t\t\t$reponse2 = $bdd->prepare($sql2);\n\t\t\t$reponse2 ->execute();\n\t\t}\n\t\t$sql3 = 'DELETE FROM detailcommande WHERE id_product= \"'.$product.'\" AND id_user= \"'.$user.'\" AND actif = 1 ';\n\t\t$reponse3 = $bdd->prepare($sql3);\n\t\t$reponse3 ->execute();\n\n\t}", "public function EliminarDetallesVentas()\n{\n\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\tself::SetNames();\n\n\t\t$sql = \" select * from detalleventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num > 1)\n\t\t{\n\n\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t$stmt = $this->dbh->prepare($sql2);\n\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t$num = $stmt->rowCount();\n\n\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t$existenciadb = $p[0][\"existencia\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t$sql = \" update productos set \"\n\t.\" existencia = ? \"\n\t.\" where \"\n\t.\" codproducto = ?;\n\t\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindParam(1, $existencia);\n\t$stmt->bindParam(2, $codproducto);\n\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t$existencia = $existenciadb + $cantventa;\n\t$stmt->execute();\n\n\t$sql = \" delete from detalleventas where coddetalleventa = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindParam(1,$coddetalleventa);\n\t$coddetalleventa = base64_decode($_GET[\"coddetalleventa\"]);\n\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindParam(1,$codventa);\n\t$stmt->bindParam(2,$codproducto);\n\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t$stmt->execute();\n\n################## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($codproducto));\n\t\t$num = $stmt->rowCount();\n if($num>0) {\n\n$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$codproducto.\"'\";\n\n\t$array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t$this->p[] = $row;\n\n\t\t$codproducto = $row['codproducto'];\n\t\t$codingrediente = $row['codingrediente'];\n\t\t$cantracion = $row['cantracion'];\n\t\t$cantingrediente = $row['cantingrediente'];\n\t\t$costoingrediente = $row['costoingrediente'];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$stmt->bindParam(3,$codingrediente);\n\t\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$codingrediente = strip_tags($codingrediente);\n\t\t$stmt->execute();\n\n\t\t$update = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($update);\n\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t$racion = rount($cantracion*$cantventa,2);\n\t\t$cantidadracion = rount($cantingrediente+$racion,2);\n\t\t$stmt->execute();\n\n\t\t }\n}\n############ FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS ##############\n\n\t$sql4 = \"select * from ventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$paea[] = $row;\n\t\t}\n\t\t$subtotalivasive = $paea[0][\"subtotalivasive\"];\n\t\t$subtotalivanove = $paea[0][\"subtotalivanove\"];\n\t\t$iva = $paea[0][\"ivave\"]/100;\n\t\t$descuento = $paea[0][\"descuentove\"]/100;\n\t\t$totalivave = $paea[0][\"totalivave\"];\n\t\t$totaldescuentove = $paea[0][\"totaldescuentove\"];\n\t\t$totaldb = $paea[0][\"totalpago\"];\n\t\t$montopagado = $paea[0][\"montopagado\"];\n\t\t\t\n\t\t\n$sql3 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'SI'\";\n\t\t$stmt = $this->dbh->prepare($sql3);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$pae[] = $row;\n\t\t\t}\n\t\t$preciocompraiva = ($pae[0][\"preciocompra\"]== \"\" ? \"0\" : $pae[0][\"preciocompra\"]);\n\t\t$importeivasi = ($pae[0][\"importe\"]== \"\" ? \"0\" : $pae[0][\"importe\"]);\n\t\t$importe2si = ($pae[0][\"importe2\"]== \"\" ? \"0\" : $pae[0][\"importe2\"]);\n\t\n$sql5 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'NO'\";\n\t\t$stmt = $this->dbh->prepare($sql5);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($roww = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $roww;\n\t\t\t}\n\t\t$preciocompra = ($roww[\"preciocompra\"]== \"\" ? \"0\" : $roww[\"preciocompra\"]);\n\t\t$importeivano = ($roww[\"importe\"]== \"\" ? \"0\" : $roww[\"importe\"]);\n\t\t$importe2 = ($roww[\"importe2\"]== \"\" ? \"0\" : $roww[\"importe2\"]);\n\t\t\nif(base64_decode($_GET[\"ivaproducto\"])==\"SI\"){\t\n\n\t\t$sql = \" update ventas set \"\n\t\t\t .\" subtotalivasive = ?, \"\n\t\t\t .\" totalivave = ?, \"\n\t\t\t .\" totaldescuentove = ?, \"\n\t\t\t .\" totalpago= ?, \"\n\t\t\t .\" montodevuelto= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaliva);\n\t\t$stmt->bindParam(3, $totaldescuentove);\n\t\t$stmt->bindParam(4, $totalpago);\n\t\t$stmt->bindParam(5, $devuelto);\n\t\t$stmt->bindParam(6, $codventa);\n\t\t\n\t\t$subtotal= strip_tags($importeivasi);\n $totaliva= rount($subtotal*$iva,2);\n\t\t$tot= rount($subtotal+$subtotalivanove+$totaliva,2);\n\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t$totalpago= rount($tot-$totaldescuentove,2);\n\t\t$devuelto= ($montopagado== \"0.00\" ? \"0\" : rount($montopagado-$totalpago,2));\n\t\t$codventa = strip_tags($_GET[\"codventa\"]);\n\t\t$stmt->execute();\n\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\nif (base64_decode($_GET[\"tipopagove\"])==\"CONTADO\"){\n\n$sql = \"select ingresos from arqueocaja where codcaja = '\".strip_tags($_GET[\"codcaja\"]).\"' and statusarqueo = '1'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t$ingreso = ($row['ingresos']== \"\" ? \"0.00\" : $row['ingresos']);\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $txtTotal);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$calculo=rount($totaldb-$totalpago,2);\n\t\t$txtTotal = rount($ingreso-$calculo,2);\n\t\t$codcaja = strip_tags($_GET[\"codcaja\"]);\n\t\t$stmt->execute();\n\t}\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\t\t\n\t\t } else {\n\n $sql = \" update ventas set \"\n\t\t\t .\" subtotalivanove = ?, \"\n\t\t\t .\" totaldescuentove = ?, \"\n\t\t\t .\" totalpago= ?, \"\n\t\t\t .\" montodevuelto= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaldescuentove);\n\t\t$stmt->bindParam(3, $totalpago);\n\t\t$stmt->bindParam(4, $devuelto);\n\t\t$stmt->bindParam(5, $codventa);\n\t\t\n\t\t$subtotal= strip_tags($importeivano);\n\t\t$tot= rount($subtotal+$subtotalivasive+$totalivave,2);\n\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t$totalpago= rount($tot-$totaldescuentove,2);\n\t\t$devuelto= ($montopagado== \"0.00\" ? \"0\" : rount($montopagado-$totalpago,2));\n\t\t$codventa = strip_tags($_GET[\"codventa\"]);\n\t\t$stmt->execute();\n\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\nif (base64_decode($_GET[\"tipopagove\"])==\"CONTADO\"){\n\n$sql = \"select ingresos from arqueocaja where codcaja = '\".strip_tags($_GET[\"codcaja\"]).\"' and statusarqueo = '1'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t$ingreso = ($row['ingresos']== \"\" ? \"0.00\" : $row['ingresos']);\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $txtTotal);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$calculo=rount($totaldb-$totalpago,2);\n\t\t$txtTotal = rount($ingreso-$calculo,2);\n\t\t$codcaja = strip_tags($_GET[\"codcaja\"]);\n\t\t$stmt->execute();\n\t}\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\t\t\n\t } \n\necho \"<div class='alert alert-info'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\necho \"<center><span class='fa fa-check-square-o'></span> EL DETALLE DE VENTA DE PRODUCTO FUE ELIMINADO EXITOSAMENTE </center>\";\necho \"</div>\";\nexit;\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $row;\n\t\t\t}\n\t\t\t$existenciadb = $p[0][\"existencia\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$stmt->bindParam(2, $codproducto);\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$existencia = $existenciadb + $cantventa;\n\t\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codventa);\n\t\t\t$stmt->bindParam(2,$codproducto);\n\t\t\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$stmt->execute();\n\n\n################## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #######################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($codproducto));\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$codproducto.\"'\";\n\n\t$array=array();\n\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\n\t\t$codproducto = $row['codproducto'];\n\t\t$codingrediente = $row['codingrediente'];\n\t\t$cantracion = $row['cantracion'];\n\t\t$cantingrediente = $row['cantingrediente'];\n\t\t$costoingrediente = $row['costoingrediente'];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$stmt->bindParam(3,$codingrediente);\n\t\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$codingrediente = strip_tags($codingrediente);\n\t\t$stmt->execute();\n\n\n\t\t$update = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($update);\n\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t$racion = rount($cantracion*$cantventa,2);\n\t\t$cantidadracion = rount($cantingrediente+$racion,2);\n\t\t$stmt->execute();\n\n\n\t\t }\n\n}\n################### FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS ###################\n\n\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\tif (base64_decode($_GET[\"tipopagove\"])==\"CONTADO\"){\n\n\t\t$sql4 = \"select * from ventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\n\t\t\tif($roww = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$paea[] = $roww;\n\t\t\t}\n\t\t$totaldb = $roww[\"totalpago\"];\n\n\t\t$sql = \"select ingresos from arqueocaja where codcaja = '\".strip_tags($_GET[\"codcaja\"]).\"' and statusarqueo = '1'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\tif (isset($row['ingresos'])) { $ingreso = $row['ingresos']; } else { $ingreso ='0.00'; }\n\t\t//$ingreso = $row['ingresos'];\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $txtTotal);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$txtTotal = rount($ingreso-$totaldb,2);\n\t\t$codcaja = strip_tags($_GET[\"codcaja\"]);\n\t\t$stmt->execute();\n\t}\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\n#################### AQUI ACTUALIZAMOS EL STATUS DE MESA ####################\n\t\t$sql = \" update mesas set \"\n\t\t.\" statusmesa = ? \"\n\t\t.\" where \"\n\t\t.\" codmesa = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $statusmesa);\n\t\t$stmt->bindParam(2, $codmesa);\n\n\t\t$statusmesa = strip_tags('0');\n\t\t$codmesa = base64_decode($_GET[\"codmesa\"]);\n\t\t$stmt->execute();\n#################### AQUI ACTUALIZAMOS EL STATUS DE MESA ####################\n\n\t\t$sql = \" delete from ventas where codventa = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$codventa = strip_tags($_GET[\"codventa\"]);\n\t\t$stmt->execute();\n\n\t\t$sql = \" delete from detalleventas where coddetalleventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$coddetalleventa);\n\t\t$coddetalleventa = base64_decode($_GET[\"coddetalleventa\"]);\n\t\t$stmt->execute();\n\n\techo \"<div class='alert alert-info'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<center><span class='fa fa-check-square-o'></span> EL DETALLE DE VENTA DE PRODUCTO FUE ELIMINADO EXITOSAMENTE </center>\";\n\techo \"</div>\";\n\texit;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\techo \"<div class='alert alert-info'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<center><span class='fa fa-check-square-o'></span> USTED NO PUEDE ELIMINAR DETALLES EN VENTAS, NO ERES EL ADMINISTRADOR DEL SISTEMA</center>\";\n\techo \"</div>\";\n\texit;\n\t\t}\n\t}", "public function EliminarDetallesCompras()\n{\n\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\tself::SetNames();\n\t\t$sql = \" select * from detallecompras where codcompra = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codcompra\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num > 1)\n\t\t{\n\n\t\t\t$sql = \" delete from detallecompras where coddetallecompra = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$coddetallecompra);\n\t\t\t$coddetallecompra = base64_decode($_GET[\"coddetallecompra\"]);\n\t\t\t$stmt->execute();\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN INGREDINTE ###################\n\tif($_POST['tipoentrada']==\"INGREDIENTE\"){\n\n\t\t$sql2 = \"select cantingrediente from ingredientes where cantingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"cantingrediente\"];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN PRODUCTO ###################\n\t\t\t} else {\n\n\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"existencia\"];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql = \" update productos set \"\n\t\t.\" existencia = ? \"\n\t\t.\" where \"\n\t\t.\" codproducto = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n\t\t\t}\n\n\t\t$sql4 = \"select * from compras where codcompra = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codcompra\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$paea[] = $row;\n\t\t\t}\n\t\t$subtotalivasic = $paea[0][\"subtotalivasic\"];\n\t\t$subtotalivanoc = $paea[0][\"subtotalivanoc\"];\n\t\t$iva = $paea[0][\"ivac\"]/100;\n\t\t$descuento = $paea[0][\"descuentoc\"]/100;\n\t\t$totalivac = $paea[0][\"totalivac\"];\n\t\t$totaldescuentoc = $paea[0][\"totaldescuentoc\"];\n\n\t$sql3 = \"select sum(importecompra) as importe from detallecompras where codcompra = ? and ivaproductoc = 'SI'\";\n $stmt = $this->dbh->prepare($sql3);\n $stmt->execute( array(base64_decode($_GET[\"codcompra\"])));\n $num = $stmt->rowCount();\n \n if($rowp = $stmt->fetch())\n {\n $p[] = $rowp;\n }\n $importeivasi = ($rowp[\"importe\"]== \"\" ? \"0\" : $rowp[\"importe\"]);\n\n$sql5 = \"select sum(importecompra) as importe from detallecompras where codcompra = ? and ivaproductoc = 'NO'\";\n $stmt = $this->dbh->prepare($sql5);\n $stmt->execute( array(base64_decode($_GET[\"codcompra\"])));\n $num = $stmt->rowCount();\n \n if($roww = $stmt->fetch())\n {\n $pw[] = $roww;\n }\n $importeivano = ($roww[\"importe\"]== \"\" ? \"0\" : $roww[\"importe\"]);\n\n if(base64_decode($_GET[\"ivaproductoc\"])==\"SI\"){\t\n\t\n\t\t$sql = \" update compras set \"\n\t\t\t .\" subtotalivasic = ?, \"\n\t\t\t .\" totalivac = ?, \"\n\t\t\t .\" totaldescuentoc = ?, \"\n\t\t\t .\" totalc= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codcompra = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaliva);\n\t\t$stmt->bindParam(3, $totaldescuentoc);\n\t\t$stmt->bindParam(4, $total);\n\t\t$stmt->bindParam(5, $codcompra);\n\t\t\n\t\t$subtotal= strip_tags($importeivasi);\n $totaliva= rount($subtotal*$iva,2);\n\t\t$tot= rount($subtotal+$subtotalivanoc+$totaliva,2);\n\t\t$totaldescuentoc= rount($tot*$descuento,2);\n\t\t$total= rount($tot-$totaldescuentoc,2);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$stmt->execute();\n\t\t\n\t\t } else {\n\t\t\n\t\t$sql = \" update compras set \"\n\t\t\t .\" subtotalivanoc = ?, \"\n\t\t\t .\" totaldescuentoc = ?, \"\n\t\t\t .\" totalc= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codcompra = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaldescuentoc);\n\t\t$stmt->bindParam(3, $total);\n\t\t$stmt->bindParam(4, $codcompra);\n\t\t\n\t\t$subtotal= strip_tags($importeivano);\n\t\t$tot= rount($subtotal+$subtotalivasic+$totalivac,2);\n\t\t$totaldescuentoc= rount($tot*$descuento,2);\n\t\t$total= rount($tot-$totaldescuentoc,2);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$stmt->execute();\t\t\n\t\t }\t\t\t\t\t\n\n\t\theader(\"Location: detallescompras?mesage=2\");\n\t\texit;\n\n\t\t}\n\t\telse\n\t\t{\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN INGREDINTE ###################\n\tif($_POST['tipoentrada']==\"INGREDIENTE\"){\n\n\t\t$sql2 = \"select cantingrediente from ingredientes where cantingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"cantingrediente\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN PRODUCTO ###################\n\t\t\t} else {\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"existencia\"];\n\n\t\t$sql = \" update productos set \"\n\t\t.\" existencia = ? \"\n\t\t.\" where \"\n\t\t.\" codproducto = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n\t\t$sql = \" delete from compras where codcompra = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$codcompra = base64_decode($_GET[\"codcompra\"]);\n\t\t$stmt->execute();\n\n\t\t$sql = \" delete from detallecompras where coddetallecompra = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$coddetallecompra);\n\t\t$coddetallecompra = base64_decode($_GET[\"coddetallecompra\"]);\n\t\t$stmt->execute();\n\n\t\t\t}\n\n\t\t\theader(\"Location: detallescompras?mesage=2\");\n\t\t\texit;\n\t\t}\n\t}\n\telse\n\t{\n\t\theader(\"Location: detallescompras?mesage=3\");\n\t\texit;\n\t}\n}", "public static function eliminar(){\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n $cita = Cita::find($_POST['id']);\n $cita->eliminar();\n header('Location:' . $_SERVER['HTTP_REFERER']);\n }\n }", "public function delete($id_pedido, $id_producto) {\n $this->db->where('id_pedido', $id_pedido);\n $this->db->where('id_producto', $id_producto);\n $this->db->where('devuelto IS NULL');\n \n //Para eliminar un producto por vez\n $this->db->limit(1);\n \n $this->db->delete('productosXpedido');\n }", "public function delete()\n {\n $LedgerEntyModel = new Core_Model_Finance_Ledger_Entry;\n $purchaseRecord = $this->fetch();\n $ledgerEntryIds = unserialize($purchaseRecord['s_ledger_ids']);\n for($i = 0; $i <= sizeof($ledgerEntryIds)-1; $i += 1) {\n $result = $LedgerEntyModel->deleteById($ledgerEntryIds[$i]);\n }\n $table = $this->getTable();\n $where = $table->getAdapter()->quoteInto(\n 'purchase_id = ?', $this->_purchaseId\n );\n $result = $table->delete($where);\n \n $log = $this->getLoggerService();\n $info = 'Purchase deleted with purchas id = '. $this->_purchaseId;\n $log->info($info);\n \n return $result;\n }", "public function destroy(Profesor $profesor)\n {\n //\n }", "function delete_prodi($id_prodi)\n {\n return $this->db->delete('prodi',array('id_prodi'=>$id_prodi));\n }" ]
[ "0.7843265", "0.76307636", "0.6959245", "0.6580722", "0.64543563", "0.64077103", "0.6384368", "0.63628274", "0.6306772", "0.63024527", "0.6301882", "0.62959117", "0.62944233", "0.6255204", "0.6248938", "0.6215888", "0.61923736", "0.6191895", "0.6170335", "0.6134639", "0.61122304", "0.6105151", "0.6095243", "0.60855305", "0.6077623", "0.6045826", "0.60294265", "0.6007671", "0.6001977", "0.5939688", "0.5936277", "0.59361494", "0.5919399", "0.5916281", "0.5916174", "0.5911247", "0.5908195", "0.5907217", "0.5904915", "0.5900341", "0.5893102", "0.58883816", "0.5879937", "0.5878946", "0.5856437", "0.58526033", "0.5846266", "0.58439493", "0.5838943", "0.583683", "0.5818807", "0.58144796", "0.5805732", "0.5804226", "0.57989895", "0.57931405", "0.5787074", "0.5774144", "0.5766782", "0.5759312", "0.5757089", "0.5750991", "0.57468176", "0.5746811", "0.5742676", "0.57343477", "0.5733126", "0.5726972", "0.5722387", "0.5716721", "0.5715194", "0.57129544", "0.5706118", "0.5699784", "0.5684263", "0.5677232", "0.56736", "0.56652004", "0.5647662", "0.5647131", "0.5643045", "0.56404895", "0.56363034", "0.56287235", "0.56226987", "0.56216085", "0.56167305", "0.5615177", "0.55994993", "0.55823815", "0.55747205", "0.5574175", "0.55704373", "0.55612624", "0.5561184", "0.5560392", "0.55603194", "0.5554148", "0.55468285", "0.5546523" ]
0.8131264
0
Busca un objeto Proveedor en la base de datos.
public function select($proveedor);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_proveedor($idProveedor,$idEmpresa){\n if($idProveedor != '' || $idEmpresa != ''){\n\n $this->_query =\n \"\n select \n idproveedor,\n idempresa,\n nombre_proveedor,\n descripcion_proveedor,\n telefono01,\n telefono02,\n correo,\n celular,\n direccion,\n idestado,\n fecha_alta,\n fecha_um,\n idusuario_alta,\n idusuario_um\n from \n proveedores \n WHERE \n idproveedor = $idProveedor AND\n idempresa = '$idEmpresa' \n ORDER BY nombre_proveedor DESC \n \";\n\n $this->get_result_query();\n\n }\n\n if(count($this->_rows) == 1){\n\n foreach ($this->_rows[0] as $campo => $valor){\n $this->$campo = $valor ;\n }\n\n $this->_confirm = true ;\n $this->_message = \"Se encontro el proveedor\";\n\n }else{\n $this->_confirm = false ;\n $this->_message = \"No se encontro el proveedor\" ;\n }\n\n }", "public function datos_proveedores() \n {\n return Proveedor::all();\n }", "PUBLIC function Proveedor(){\n return $this->belongsto('App\\Models\\proveedor','id');\n }", "public function insert($proveedor);", "public function datos_proveedor_especifico($id) \n {\n return Proveedor::find($id);\n }", "public function show(Proveedor $proveedor)\n {\n //\n }", "public function show(Proveedor $proveedor)\n {\n //\n }", "public function show(Proveedor $proveedor)\n {\n //\n }", "function Proveeedor($cedulaProveedor, $nombre, $telefono, $productos) {\n $this->cedulaProveedor = $cedulaProveedor;\n $this->nombre = $nombre;\n $this->telefono = $telefono;\n $this->productos = $productos;\n }", "public function edit(Proveedor $proveedor)\n {\n //\n }", "public function getProveedorTipo()\n {\n return $this->hasOne(ProveedorTipo::className(), ['id' => 'proveedor_tipo']);\n }", "public function proveedor()\n {\n return $this->hasOne('App\\Proveedor', 'id');\n }", "public function obtenerProveedores()\n { \n $query = $this->db->get('proveedor'); \n\n if ($query->num_rows() > 0)\n return $query->result();\n else\n return $query->result();\n }", "public function ProveedorPorId()\n\t{\n\t\tself::SetNames();\n\t\t$sql = \" select * from proveedores where codproveedor = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET[\"codproveedor\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\t\t\techo \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "public function __construct(){\r\n $this->proveedores=array();\r\n }", "public function obtener_proveedores()\n {\n return $this->db->get('proveedores')->result();\n }", "public function proveedores()\n {\n return $this->belongsTo(Proveedor::class);\n }", "public function show(Proveedores $proveedores)\n {\n //\n }", "public function readProveedores(){\n $sql='SELECT idProveedor, nombreProveedor, direccion, telefono,correo FROM proveedor where estado=1 AND proveedor.estadoEliminacion=1';\n $params=array(null);\n return Database::getRows($sql, $params);\n }", "public function ctlBuscaProveedores(){\n\n\t\t$respuesta = Datos::mdlProveedores();\n\n\t\tforeach ($respuesta as $row => $item){\n\t\t\techo '<option value=\"'.$item[\"nombre\"].'\">'.$item[\"nombre\"].'</option>';\n\t\t}\n\t}", "public function usuarioProveedor()\n {\n \treturn $this->belongsTo('App\\Usuario', 'usuario_id', 'id');\n }", "public function proveedor(){\n return $this->belongsTo(Proveedor::class,'idproveedor','id');\n }", "public function getProveedorEstado()\n {\n return $this->hasOne(ProveedorEstado::className(), ['id' => 'proveedor_estado']);\n }", "public function get_detalle_proveedor($numero_compra){\n\n $conectar=parent::conexion();\n parent::set_names();\n\n $sql=\"select c.fecha_compra,c.numero_compra, c.proveedor, c.cedula_proveedor,c.total,p.id_proveedor,p.cedula,p.razon_social,p.telefono,p.correo,p.direccion,p.fecha,p.estado\n from compras as c, proveedor as p\n where \n \n c.cedula_proveedor=p.cedula\n and\n c.numero_compra=?\n \n ;\";\n\n //echo $sql; exit();\n\n $sql=$conectar->prepare($sql);\n \n\n $sql->bindValue(1,$numero_compra);\n $sql->execute();\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\n\n \n \n }", "public function ProveedoresPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * from proveedores where codproveedor = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codproveedor\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function ListarProveedores()\n{\n\tself::SetNames();\n\t$sql = \" select * from proveedores \";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}", "private function buscar_proveedor()\n {\n $this->template = FALSE;\n \n $json = array();\n foreach($this->proveedor->search($_REQUEST['buscar_proveedor']) as $pro)\n {\n $json[] = array('value' => $pro->nombre, 'data' => $pro->codproveedor);\n }\n \n header('Content-Type: application/json');\n echo json_encode( array('query' => $_REQUEST['buscar_proveedor'], 'suggestions' => $json) );\n }", "public function provider()\n {\n return $this->belongsTo('App\\Provider', 'proveedor_id');\n }", "private function datos_proveedor()\n {\n $this->template = FALSE;\n \n header('Content-Type: application/json');\n echo json_encode( $this->proveedor->get($_REQUEST['datosproveedor']) );\n }", "public function proveedor(){\n return $this->belongsTo('App\\Proveedor', 'proveedor_legajo', 'tecnico_legajo');\n }", "static public function mdlBuscarProveedor($valor) {\r\n\r\n $sql = \"SELECT proveedores.id, proveedores.proveedor, proveedores.contacto, proveedores.direccion, proveedores.id_municipio, municipios.municipio, municipios.id_departamento, departamentos.departamento, proveedores.telefono, proveedores.email FROM proveedores LEFT JOIN municipios ON proveedores.id_municipio = municipios.id LEFT JOIN departamentos ON municipios.id_departamento = departamentos.id WHERE proveedores.proveedor LIKE '%\".$valor.\"%'\";\r\n\r\n $stmt = Conexion::conectar()->prepare($sql);\r\n\r\n $stmt -> execute();\r\n\r\n return $stmt -> fetchAll();\r\n\r\n\r\n }", "public function inventario_consultarProveedoresProducto($idProducto){\n \t\t\t\t\n \t\t$resultado = array();\t\n \t\t\t\n \t\t$query = \"SELECT \n\t\t\t\t\t\t\t PP.costo, P.nombre AS nombreProveedor, P.telefono1\n\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t tb_productos_proveedores AS PP\n\t\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t\t tb_proveedores AS P ON P.idProveedor = PP.idProveedor\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t PP.idProducto = '$idProducto'\";\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t$conexion = parent::conexionCliente();\n\t\t\t\n\t\t\tif($res = $conexion->query($query)){\n\t \n\t /* obtener un array asociativo */\n\t while ($filas = $res->fetch_assoc()) {\n\t $resultado[] = $filas;\n\t }\n\t \n\t /* liberar el conjunto de resultados */\n\t $res->free();\n\t \n\t }\n\t\n\t return $resultado;\n \t\n }", "public function edit(ProveedoresModel $proveedor)\n {\n //\n }", "function listar_proveedores(){\n\t\t$sql=\"\n\tSELECT\n\t\tcp.IDPROVEEDOR IDPROV, cp.NOMBREFISCAL, cp.NOMBRECOMERCIAL, \n\t\tcp.IDTIPODOCUMENTO, cp.IDDOCUMENTO, cp.EMAIL1, cp.EMAIL2, cp.EMAIL3,\n\t\tcp.BRSCH, csb.RAMO, cp.FDGRV, cp.ZTERM, cp.MWSKZ, cp.PARVO, cp.PAVIP,\n\t\tcp.ACTIVO,cp.INTERNO,\n\t\tcp.ARREVALRANKING,\n\t\tcp.CDE,\n\t\tcp.SKILL,\n\t\tcp.EVALFIDELIDAD,\n\t\tcp.EVALINFRAESTRUCTURA,\n\t\tcp.EVALSATISFACCION,\n\t\tcp.IDMONEDA,\n\t\tYEAR(cp.FECHAINICIOACTIVIDADES) ANIO,\n\t\tMONTH(cp.FECHAINICIOACTIVIDADES) MES, \n\t\tDAY(cp.FECHAINICIOACTIVIDADES) DIA,\n\t\tcpu.*,\n\t\tcpt.*\n\tFROM\n\t$this->catalogo.catalogo_proveedor cp\n\t\tLEFT JOIN $this->catalogo.catalogo_proveedor_ubigeo cpu ON cp.IDPROVEEDOR=cpu.IDPROVEEDOR \n\t\tLEFT JOIN $this->catalogo.catalogo_sap_brsch csb ON cp.BRSCH = csb.BRSCH\t\n\t\tLEFT JOIN $this->catalogo.catalogo_proveedor_telefono cpt ON cp.IDPROVEEDOR = cpt.IDPROVEEDOR AND cpt.PRIORIDAD=1\n\t\n\t\t\";\n\n\t$result =$this->query($sql);\n\treturn $result;\n\t}", "function getNitProveedor()\n {\n return $this->NitProveedor;\n }", "public function delete($proveedor);", "public function dataProveedoresInicial ($id_prod, $id_prov) {\n\n //Busqueda de todos los paises donde quiere recibir el productor para filtrar los metodos de envio\n $paises_prod = DB::select(DB::raw(\"SELECT id_pais FROM rdj_productores_paises\n WHERE id_productor=? ORDER BY id_pais\"),[$id_prod]);\n\n $prov = []; //Variable donde se almacenan los datos a responder de la solicitud HTTP\n\n //Busqueda de información basica del proveedor\n $query = DB::select(\n DB::raw(\"SELECT pr.id AS idp, pr.nombre AS prov, pa.nombre AS pais FROM \n rdj_paises pa, rdj_proveedores pr WHERE pa.id=pr.id_pais AND pr.id=?\"),\n [$id_prov]);\n\n //Almacenamiento de la info basica en aux\n $prov[\"idp\"] = $query[0]->idp;\n $prov[\"prov\"] = $query[0]->prov;\n $prov[\"pais\"] = $query[0]->pais;\n \n //Busqueda de los metodos de pago del proveedor\n $query = DB::select(\n DB::raw(\"SELECT CASE WHEN pa.tipo='c' THEN 'Cuota única' WHEN pa.tipo='p'\n THEN 'Por cuotas' END AS tipo, pa.num_cuotas AS numc, pa.porcentaje AS porc,\n pa.meses AS meses, pa.id FROM rdj_metodos_pagos pa WHERE pa.id_proveedor=?\"),\n [$prov[\"idp\"]]);\n \n //Almacenamiento de arreglo de metodos de pagos del proveedor\n $prov[\"pagos\"] = $query;\n\n //Para los metodos de envio, creamos un arreglo ya que pueden ser varios\n $prov[\"envios\"] = [];\n foreach($paises_prod as $pais) { //Para cada pais del productor buscamos si hay metodo de envio\n\n $query = DB::select(\n DB::raw(\"SELECT e.duracion, e.precio, e.id AS id_envio, p.id AS id_pais, p.nombre AS pais,\n CASE WHEN e.tipo='t' THEN 'Terrestre' WHEN e.tipo='a' THEN 'Aéreo'\n WHEN e.tipo='m' THEN 'Marítimo' END AS tipo FROM rdj_paises p,\n rdj_metodos_envios e WHERE e.id_pais=? AND e.id_proveedor=?\n AND e.id_pais=p.id ORDER BY e.id_pais\"),[$pais->id_pais, $prov[\"idp\"]]);\n\n //Agregamos al arreglo si conseguimos un metodo de envio para el pais\n //como pueden haber varios metodos de envio con el mismo pais necesitamos\n //hacer otro foreach\n if($query != []) {\n foreach($query as $met) {\n $metodo = [];\n $metodo[\"detalles\"] = [];\n $metodo[\"id_envio\"] = $met->id_envio;\n $metodo[\"id_pais\"] = $met->id_pais;\n $metodo[\"duracion\"] = $met->duracion;\n $metodo[\"precio\"] = $met->precio;\n $metodo[\"pais\"] = $met->pais;\n $metodo[\"tipo\"] = $met->tipo;\n array_push($prov[\"envios\"],$metodo);\n }\n }\n }\n\n //Para los detalles o modificadores de los metodos de envios conseguidos\n for($i = 0; $i <= sizeof($prov[\"envios\"]) - 1; $i++) {\n //Busqueda de los detalles de un metodo de envio\n $query = DB::select(\n DB::raw(\"SELECT d.id, d.nombre AS det, d.mod_precio AS precio, d.mod_duracion AS duracion\n FROM rdj_detalles_metodos_envios d WHERE d.id_envio=? AND d.id_proveedor=?\n AND d.id_pais=?\"),[$prov[\"envios\"][$i][\"id_envio\"], $id_prov, $prov[\"envios\"][$i][\"id_pais\"]]\n );\n //Agregamos al arreglo si conseguimos un detalle de envio para el metodo\n //como pueden haber varios detalles de envio con el mismo metodo necesitamos\n //hacer otro foreach\n if($query != []) {\n foreach($query as $det) {\n $detalle = [];\n $detalle[\"id\"] = $det->id;\n $detalle[\"det\"] = $det->det;\n $detalle[\"precio\"] = $det->precio;\n $detalle[\"duracion\"] = $det->duracion;\n array_push($prov[\"envios\"][$i][\"detalles\"],$detalle);\n }\n } \n }\n\n /* Buscamos todas las esencias del proveedor y las guardamos */\n $prov[\"esencias\"] = $query = DB::select(\n DB::raw(\"SELECT e.cas_ing_esencia AS cas, e.nombre AS ing, CASE WHEN\n e.naturaleza='n' THEN 'natural' WHEN e.naturaleza='s' THEN 'sintetica' END\n AS tipo FROM rdj_ingredientes_esencias e WHERE e.id_proveedor=? \n ORDER BY e.cas_ing_esencia\"), \n [$id_prov]);\n \n /* Buscamos todos los otros ingredientes del proveedor y los guardamos */\n $prov[\"otros\"] = $query = DB::select(\n DB::raw(\"SELECT o.cas_otro_ing AS cas, o.nombre AS ing\n FROM rdj_otros_ingredientes o WHERE o.id_proveedor=? \n ORDER BY o.cas_otro_ing\"), \n [$id_prov]);\n\n /* Proceso que elimina ingredientes contratados exclusivamente de la lista de ingredientes disponibles */\n $ingsExclusivos = DB::select(DB::raw(\"SELECT dc.cas_ing_esencia AS cas_esen, dc.cas_otro_ing AS cas_otro \n FROM rdj_contratos c, rdj_detalles_contratos dc WHERE c.fecha_apertura=dc.fecha_apertura \n AND c.id_proveedor=dc.id_proveedor AND c.id_proveedor=? AND c.exclusivo=true AND c.cancelacion=false\"),[$id_prov]);\n\n $esenFiltradas = [];\n $otrosFiltrados = [];\n\n foreach($prov[\"esencias\"] as $esen) {\n $cond = false;\n foreach($ingsExclusivos as $ing) {\n if($ing->cas_esen != null && $esen->cas == $ing->cas_esen) \n $cond = true;\n }\n if($cond == false) array_push($esenFiltradas, $esen);\n }\n\n foreach($prov[\"otros\"] as $otro) {\n $cond = false;\n foreach($ingsExclusivos as $ing) {\n if($ing->cas_otro != null && $otro->cas == $ing->cas_otro) \n $cond = true;\n }\n if($cond == false) array_push($otrosFiltrados, $otro);\n }\n\n $prov[\"esencias\"] = $esenFiltradas;\n $prov[\"otros\"] = $otrosFiltrados;\n \n /* Buscamos las presentaciones de cada esencia y las guardamos */\n foreach($prov[\"esencias\"] as $esen) {\n $query = DB::select(\n DB::raw(\"SELECT p.id, p.volumen AS vol, p.precio\n FROM rdj_presents_ings_esencias p WHERE p.cas_ing_esencia=?\n ORDER BY p.id\"),\n [$esen->cas]);\n $esen->cas = Controller::stringifyCas($esen->cas);\n $esen->pres = $query;\n }\n \n /* Buscamos las presentaciones de cada otro ing y las guardamos */\n foreach($prov[\"otros\"] as $otro) {\n $query = DB::select(\n DB::raw(\"SELECT p.id, p.volumen AS vol, p.precio\n FROM rdj_present_otros_ings p WHERE p.cas_otro_ing=?\n ORDER BY p.id\"),\n [$otro->cas]);\n $otro->cas = Controller::stringifyCas($otro->cas);\n $otro->pres = $query;\n }\n\n \n //Devolvemos a la interfaz la data necesaria para continuar\n return response([$prov],200);\n }", "function grabar($datos)\n\t{\n\t\tif (($datos[IDPROVEEDOR]=='') && ($this->exist(\"$this->catalogo.catalogo_proveedor\",'IDPROVEEDOR',\" WHERE NOMBREFISCAL = '$datos[NOMBREFISCAL]'\" )))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$reg_proveedor[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t$reg_proveedor[NOMBREFISCAL] = trim(strtoupper($datos[NOMBREFISCAL]));\n\t\t\t$reg_proveedor[NOMBRECOMERCIAL] = trim(strtoupper($datos[NOMBRECOMERCIAL]));\n\t\t\t$reg_proveedor[IDTIPODOCUMENTO] = $datos[IDTIPODOCUMENTO];\n\t\t\t$reg_proveedor[IDDOCUMENTO] = trim($datos[IDDOCUMENTO]);\n\t\t\t$reg_proveedor[EMAIL1] = trim(strtolower($datos[EMAIL1]));\n\t\t\t$reg_proveedor[EMAIL2] = trim(strtolower($datos[EMAIL2]));\n\t\t\t$reg_proveedor[EMAIL3] = trim(strtolower($datos[EMAIL3]));\n\t\t\t$reg_proveedor[ACTIVO] = $datos[ACTIVO];\n\t\t\t$reg_proveedor[INTERNO] = $datos[INTERNO];\n\n\t\t\tif ($datos[ARREVALRANKING]=='SKILL'){\n\t\t\t\t$reg_proveedor[ARREVALRANKING]=$datos[ARREVALRANKING];\n\t\t\t\t$reg_proveedor[SKILL]= $datos[SKILL];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$reg_proveedor[ARREVALRANKING]='CDE';\n\t\t\t}\n\t\t\t$reg_proveedor[EVALFIDELIDAD]=$datos[EVALFIDELIDAD];\n\t\t\t$reg_proveedor[EVALINFRAESTRUCTURA]=$datos[EVALINFRAESTRUCTURA];\n\t\t\t$reg_proveedor[IDMONEDA]=$datos[IDMONEDA];\n\t\t\t$reg_proveedor[OBSERVACIONES]=$datos[OBSERVACIONES];\n\n\t\t\t$reg_proveedor[BRSCH] = $datos[BRSCH];\n\t\t\t$reg_proveedor[FDGRV] = $datos[FDGRV];\n\t\t\t$reg_proveedor[ZTERM] = $datos[ZTERM];\n\t\t\t$reg_proveedor[MWSKZ] = $datos[MWSKZ];\n\t\t\t$reg_proveedor[PARVO] = $datos[PARVO];\n\t\t\t$reg_proveedor[PAVIP] = $datos[PAVIP];\n\t\t\t$reg_proveedor[FECHAINICIOACTIVIDADES]= trim($datos[ANIO].'-'.$datos[MES].'-'.$datos[DIA]);\n\n\t\t\t$prov_ubigeo[CVEPAIS]= $datos[CVEPAIS];\n\t\t\t$prov_ubigeo[CVEENTIDAD1]= $datos[CVEENTIDAD1];\n\t\t\t$prov_ubigeo[CVEENTIDAD2]= $datos[CVEENTIDAD2];\n\t\t\t$prov_ubigeo[CVEENTIDAD3]= $datos[CVEENTIDAD3];\n\t\t\t$prov_ubigeo[CVEENTIDAD4]= $datos[CVEENTIDAD4];\n\t\t\t$prov_ubigeo[CVEENTIDAD5]= $datos[CVEENTIDAD5];\n\t\t\t$prov_ubigeo[CVEENTIDAD6]= $datos[CVEENTIDAD6];\n\t\t\t$prov_ubigeo[CVEENTIDAD7]= $datos[CVEENTIDAD7];\n\t\t\t$prov_ubigeo[CVETIPOVIA]= $datos[CVETIPOVIA];\n\t\t\t$prov_ubigeo[DIRECCION]= $datos[DIRECCION];\n\t\t\t$prov_ubigeo[NUMERO]= $datos[NUMERO];\n\t\t\t$prov_ubigeo[CODPOSTAL] = $datos[CODPOSTAL];\n\t\t\t$prov_ubigeo[LATITUD] = $datos[LATITUD];\n\t\t\t$prov_ubigeo[LONGITUD] = $datos[LONGITUD];\n\t\t\t$prov_ubigeo[IDUSUARIOMOD]= $datos[IDUSUARIOMOD];\n\t\t\t$prov_ubigeo[REFERENCIA1]= $datos[REFERENCIA1];\n\t\t\t$prov_ubigeo[REFERENCIA2]= $datos[REFERENCIA2];\n\n\t\t\t$datos_telf[CODIGOAREA] = $datos[CODIGOAREA];\n\t\t\t$datos_telf[IDTIPOTELEFONO] = $datos[IDTIPOTELEFONO];\n\t\t\t$datos_telf[NUMEROTELEFONO] = $datos[NUMEROTELEFONO];\n\t\t\t$datos_telf[EXTENSION] = $datos[EXTENSION];\n\t\t\t$datos_telf[IDTSP] = $datos[IDTSP];\n\t\t\t$datos_telf[COMENTARIO]=$datos[TELF_COMENTARIO];\n\t\t\t$datos_telf[IDUSUARIOMOD] = $datos[IDUSUARIOMOD];\n\n\t\t\t$this->borrar_telefono($datos[IDPROVEEDOR]); // BORRA LOS PROVEEDORES\n\n\t\t\tif ( $datos[IDPROVEEDOR]=='')\n\t\t\t{\n\n\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor\",$reg_proveedor);\n\t\t\t\t$datos[IDPROVEEDOR] = $this->reg_id(); //OBTIENE EL ID DEL NUEVO PROVEEDOR\n\t\t\t\t$prov_ubigeo[IDPROVEEDOR]=$datos[IDPROVEEDOR];\n\t\t\t\t$prov_horario[IDPROVEEDOR]=$datos[IDPROVEEDOR];\n\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor_ubigeo\",$prov_ubigeo);\n\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor_horario\",$prov_horario);\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\t$this->update(\"$this->catalogo.catalogo_proveedor\",$reg_proveedor,\" where IDPROVEEDOR = '$datos[IDPROVEEDOR]'\");\n\t\t\t\t$this->update(\"$this->catalogo.catalogo_proveedor_ubigeo\",$prov_ubigeo,\" where IDPROVEEDOR = '$datos[IDPROVEEDOR]'\");\n\t\t\t}\n\n\t\t\tif ($datos[IDPROVEEDOR]!='')\n\t\t\t{\n\t\t\t\tfor($i=0;$i<count($datos_telf[NUMEROTELEFONO]);$i++)\n\t\t\t\t{\n\t\t\t\t\t$telf[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t\t\t$telf[CODIGOAREA]=$datos_telf[CODIGOAREA][$i];\n\t\t\t\t\t$telf[IDTIPOTELEFONO]=$datos_telf[IDTIPOTELEFONO][$i];\n\t\t\t\t\t$telf[NUMEROTELEFONO]=$datos_telf[NUMEROTELEFONO][$i];\n\t\t\t\t\t$telf[EXTENSION]=$datos_telf[EXTENSION][$i];\n\t\t\t\t\t$telf[IDTSP]=$datos_telf[IDTSP][$i];\n\t\t\t\t\t$telf[COMENTARIO]=$datos_telf[COMENTARIO][$i];\n\t\t\t\t\t$telf[IDUSUARIOMOD] = $datos_telf[IDUSUARIOMOD];\n\t\t\t\t\t$telf[PRIORIDAD]=$i+1;\n\n\t\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor_telefono\",$telf);\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$datos_sociedad = $datos[IDSOCIEDAD];\n\n\n\t\t\t// GRABA LOS SERVICIOS DEL PROVEEDOR //\n\t\t\t$sql=\"delete from catalogo_proveedor_servicio where IDPROVEEDOR='$datos[IDPROVEEDOR]'\";\n\t\t\t$this->query($sql);\n\n\t\t\t$nueva_prioridad=1;\n\n\t\t\tforeach ($datos[CHECKSERVICIO] as $servi)\n\t\t\t{\n\t\t\t\t$servicio[IDSERVICIO] = $servi;\n\t\t\t\t$servicio[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t\t$servicio[PRIORIDAD] = $nueva_prioridad;\n\t\t\t\t$servicio[IDUSUARIOMOD] = $datos[IDUSUARIOMOD];\n\n\t\t\t\tif ($servi!='')\n\t\t\t\t{\n\t\t\t\t\t$this->insert_reg('catalogo_proveedor_servicio',$servicio);\n\t\t\t\t\t$nueva_prioridad++;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// GRABA LAS SOCIEDADES DEL PROVEEDOR\n\t\t\t$sql=\"delete from catalogo_proveedor_sociedad where IDPROVEEDOR='$datos[IDPROVEEDOR]'\";\n\t\t\t$this->query($sql);\n\t\t\tforeach ($datos[IDSOCIEDAD] as $soc)\n\t\t\t{\n\t\t\t\t$sociedad[IDSOCIEDAD] = $soc;\n\t\t\t\t$sociedad[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t\t$sociedad[IDUSUARIOMOD] = $datos[IDUSUARIOMOD];\n\t\t\t\t$this->insert_reg('catalogo_proveedor_sociedad',$sociedad);\n\t\t\t}\n\t\t\treturn $datos[IDPROVEEDOR];\n\t\t}\n\t\treturn $datos[IDPROVEEDOR];\n\t}", "public function getProducto(){\n $sql='SELECT idProducto, nombre, precio, descripcion, foto, estado, idCategoria, cantidad, idProveedor from producto WHERE idProducto = ?';\n $params=array($this->id);\n return Database::getRow($sql,$params);\n }", "public function providers()\n {\n return $this->hasMany(Proveedor::class, 'idNivelEstudios');\n }", "public function destroy(Proveedor $proveedor)\n {\n //\n }", "function getByIdMco_proveedores($PVE_ID)\n {\n $data_mco_proveedores = $this->gateway->getByIdMco_proveedores($PVE_ID);\n return $data_mco_proveedores;\n }", "public function consultar_proveedor($codproveedor){\n $lugares=DB::select(\"SELECT nombre_lugar,id_lugar FROM lugar WHERE tipo_lugar='pa' order by nombre_lugar;\");\n $proveedores=DB::select(\"SELECT * FROM proveedor WHERE id_proveedor=$codproveedor\");\n return view('portal/airucab-proveedores',compact('lugares'),compact('proveedores'));\n }", "function carga_datos($idproveedor)\n\t{\n\n\t\t// carga los datos generales\n\t\t$sql=\"\n\t\tSELECT\n\t\t\tcp.IDPROVEEDOR, cp.NOMBREFISCAL, cp.NOMBRECOMERCIAL, \n\t\t\tcp.IDTIPODOCUMENTO, cp.IDDOCUMENTO, cp.EMAIL1, cp.EMAIL2, cp.EMAIL3,\n\t\t\tcp.BRSCH, cp.FDGRV, cp.ZTERM, cp.MWSKZ, cp.PARVO, cp.PAVIP,\n\t\t\tcp.ACTIVO,cp.INTERNO,\n\t\t\tcp.ARREVALRANKING,\n\t\t\tcp.CDE,\n\t\t\tcp.SKILL,\n\t\t\tcp.EVALFIDELIDAD,\n\t\t\tcp.EVALINFRAESTRUCTURA,\n\t\t\tcp.EVALSATISFACCION,\n\t\t\tcp.IDMONEDA,\n\t\t\tcp.OBSERVACIONES,\n\t\t\tYEAR(cp.FECHAINICIOACTIVIDADES) ANIO,\n\t\t\tMONTH(cp.FECHAINICIOACTIVIDADES) MES, \n\t\t\tDAY(cp.FECHAINICIOACTIVIDADES) DIA\n\t\tFROM\n\t\t$this->catalogo.catalogo_proveedor cp\n\t\tWHERE\n\t\t\tIDPROVEEDOR='$idproveedor'\n\t\t\";\n\n\t\t$result=$this->query($sql);\n\t\twhile ($reg = $result->fetch_object()) {\n\t\t\t$this->idproveedor= $reg->IDPROVEEDOR;\n\t\t\t$this->nombrefiscal= $reg->NOMBREFISCAL;\n\t\t\t$this->nombrecomercial = $reg->NOMBRECOMERCIAL;\n\t\t\t$this->idtipodocumento = $reg->IDTIPODOCUMENTO;\n\t\t\t$this->iddocumento = $reg->IDDOCUMENTO;\n\t\t\t$this->idubigeo = $reg->IDUBIGEO;\n\t\t\t$this->activo = $reg->ACTIVO;\n\t\t\t$this->interno = $reg->INTERNO;\n\t\t\t$this->arrevalranking = $reg->ARREVALRANKING;\n\t\t\t$this->cde = $reg->CDE;\n\t\t\t$this->skill = $reg->SKILL;\n\t\t\t$this->evalfidelidad = $reg->EVALFIDELIDAD;\n\t\t\t$this->evalinfraestructura = $reg->EVALINFRAESTRUCTURA;\n\t\t\t$this->evalsatisfaccion = $reg->EVALSATISFACCION;\n\t\t\t$this->moneda = new moneda();\n\t\t\t$this->moneda->carga_datos($reg->IDMONEDA);\n\t\t\t$this->observaciones = $reg->OBSERVACIONES;\n\n\t\t\t$this->email1 = $reg->EMAIL1;\n\t\t\t$this->email2 = $reg->EMAIL2;\n\t\t\t$this->email3 = $reg->EMAIL3;\n\t\t\t$this->brsch = $reg->BRSCH;\n\t\t\t$this->fdgrv = $reg->FDGRV;\n\t\t\t$this->zterm = $reg->ZTERM;\n\t\t\t$this->mwskz = $reg->MWSKZ;\n\t\t\t$this->parvo = $reg->PARVO;\n\t\t\t$this->pavip = $reg->PAVIP;\n\t\t\t$this->anio = $reg->ANIO;\n\t\t\t$this->mes = $reg->MES;\n\t\t\t$this->dia = $reg->DIA;\n\n\t\t}\n\n\t\t// carga los datos de ubigeo\n\t\t$sql=\"\n\t\tselect \n\t\t\t* \n\t\tfrom\n\t\t$this->catalogo.catalogo_proveedor_ubigeo\n\t\twhere\n\t\t\tIDPROVEEDOR='$idproveedor'\n\t\t\";\n\t\t$resul=$this->query($sql);\n\t\twhile ($reg=$resul->fetch_object()) {\n\t\t\t$this->cvepais = $reg->CVEPAIS;\n\t\t\t$this->cveentidad1 = $reg->CVEENTIDAD1;\n\t\t\t$this->cveentidad2 = $reg->CVEENTIDAD2;\n\t\t\t$this->cveentidad3 = $reg->CVEENTIDAD3;\n\t\t\t$this->cveentidad4 = $reg->CVEENTIDAD4;\n\t\t\t$this->cveentidad5 = $reg->CVEENTIDAD5;\n\t\t\t$this->cveentidad6 = $reg->CVEENTIDAD6;\n\t\t\t$this->cveentidad7 = $reg->CVEENTIDAD7;\n\t\t\t$this->cvetipovia = $reg->CVETIPOVIA;\n\t\t\t$this->descripcion = $reg->DESCRIPCION;\n\t\t\t$this->direccion = $reg->DIRECCION;\n\t\t\t$this->codpostal = $reg->CODPOSTAL;\n\t\t\t$this->numero = $reg->NUMERO;\n\t\t\t$this->latitud = $reg->LATITUD;\n\t\t\t$this->longitud = $reg->LONGITUD;\n\t\t\t$this->referencia1 = $reg->REFERENCIA1;\n\t\t\t$this->referencia2 = $reg->REFERENCIA2;\n\t\t}\n\n\t\t// \t CARGA DE LOS TELEFONOS DEL PROVEEDOR //\n\t\t$sql=\"\nSELECT \n\tcpt.IDPROVEEDOR, \n\tcpt.CODIGOAREA,\n\tcpt.IDTIPOTELEFONO,\n\tcpt.NUMEROTELEFONO,\n\tcpt.EXTENSION,\n\tcpt.IDTSP,\n\tcpt.COMENTARIO,\n\tcpt.PRIORIDAD,\n\tcd.DESCRIPCION NOMBRECODIGOAREA,\n\tctsp.DESCRIPCION NOMBRETSP,\n\tctt.DESCRIPCION NOMBRETIPOTELEFONO\nFROM\n\tcatalogo_proveedor_telefono cpt\n\tLEFT JOIN catalogo_ddn cd ON cd.DDN = cpt.CODIGOAREA\n\tLEFT JOIN catalogo_tsp ctsp ON ctsp.IDTSP = cpt.IDTSP\n\tLEFT JOIN catalogo_tipotelefono\tctt ON ctt.IDTIPOTELEFONO = cpt.IDTIPOTELEFONO\nWHERE\n\tcpt.IDPROVEEDOR ='$idproveedor'\n\tORDER BY cpt.PRIORIDAD;\n\t\t\";\n\t\t$resul=$this->query($sql);\n\t\tunset($this->telefonos);\n\t\twhile ($reg = $resul->fetch_object())\n\t\t{\n\t\t\tif ($reg->NUMEROTELEFONO!='')\n\t\t\t{\n\t\t\t\t$this->telefonos[$reg->PRIORIDAD-1]= array(\n\t\t\t\t'IDTIPOTELEFONO'=>$reg->IDTIPOTELEFONO,\n\t\t\t\t'CODIGOAREA' => $reg->CODIGOAREA,\n\t\t\t\t'NUMEROTELEFONO' => strip_tags($reg->NUMEROTELEFONO),\n\t\t\t\t'EXTENSION' => $reg->EXTENSION,\n\t\t\t\t'IDTSP' => $reg->IDTSP,\n\t\t\t\t'TELF_COMENTARIO'=>$reg->COMENTARIO,\n\t\t\t\t'NOMBRECODIGOAREA'=>$reg->NOMBRECODIGOAREA,\n\t\t\t\t'NOMBRETSP'=>$reg->NOMBRETSP,\n\t\t\t\t'NOMBRETIPOTELEFONO'=>$reg->NOMBRETIPOTELEFONO\n\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// CARGA DE LOS SERVICIOS DEL PROVEEDOR //\n\t\t$sql=\"\n\t\tSELECT \n\t\t\tIDSERVICIO\n\t\tFROM\n\t\t\tcatalogo_proveedor_servicio\n\t\tWHERE\n\t\t\tIDPROVEEDOR='$idproveedor'\n\t\t\";\n\t\t$resul=$this->query($sql);\n\t\twhile ($reg = $resul->fetch_object()) {\n\t\t\t$this->servicios[]=$reg->IDSERVICIO;\n\n\t\t}\n\n\t\t// CARGA DE SOCIEDADES DEL PROVEEDOR\n\t\t$sql=\"\n\t\tSELECT \n\t\t\tIDSOCIEDAD\n\t\tFROM\n\t\t\tcatalogo_proveedor_sociedad\n\t\tWHERE\n\t\t\tIDPROVEEDOR='$idproveedor'\n\t\t\";\n\t\t$resul=$this->query($sql);\n\t\twhile ($reg = $resul->fetch_object()) {\n\t\t\t$this->sociedades[$reg->IDSOCIEDAD]=$reg->IDSOCIEDAD;\n\n\t\t}\n\n\t\t// CARGA DE CONTACTOS //\n\t\t$sql=\"\n\t\tSELECT * \n\t\t\tFROM $this->catalogo.catalogo_proveedor_contacto\n\t\tWHERE\t\n\t\t\tIDPROVEEDOR ='$idproveedor'\n\t\t\tORDER BY RESPONSABLE DESC\n\t\t\";\n\t\t$resul=$this->query($sql);\n\t\twhile ($reg = $resul->fetch_object()) {\n\t\t\t$this->contactos[$reg->IDCONTACTO]=$reg->APPATERNO.' '.$reg->APMATERNO.' '.$reg->NOMBRE;\n\t\t}\n\t\treturn;\n\t}", "public function read_tienda_proveedor($idp){\r\n\r\n $sql=\"select p.id_proveedor, p.nombre_establecimiento, p.direccion_fisica, p.direccion_web,\r\n p.descripcion_tienda, t.telefono_usuario, p.id_usuario\r\n from proveedor p\r\n INNER JOIN usuario u on p.id_usuario = u.id_usuario\r\n INNER JOIN no_telefonos_usuario t on p.id_usuario = t.id_usuario\r\n where p.id_proveedor=$idp\";\r\n $resul=mysqli_query($this->con(),$sql);\r\n while($row=mysqli_fetch_assoc($resul)){\r\n $this->proveedores[]=$row;\r\n }\r\n return $this->proveedores;\r\n }", "public function BuscarComprasProveedor() \n{\n\tself::SetNames();\t\t\n\t$sql = \" SELECT compras.codcompra, compras.subtotalivasic, compras.subtotalivanoc, compras.ivac, compras.totalivac, compras.descuentoc, compras.totaldescuentoc, compras.totalc, compras.statuscompra, compras.fechavencecredito, compras.fechacompra, proveedores.ritproveedor, proveedores.nomproveedor, SUM(detallecompras.cantcompra) AS articulos FROM (compras INNER JOIN proveedores ON compras.codproveedor = proveedores.codproveedor) INNER JOIN usuarios ON compras.codigo = usuarios.codigo LEFT JOIN detallecompras ON detallecompras.codcompra = compras.codcompra WHERE proveedores.codproveedor = ? GROUP BY compras.codcompra\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_GET[\"codproveedor\"]) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\n\t\techo \"<div class='alert alert-danger'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN COMPRAS DE PRODUCTOS PARA EL PROVEEDOR SELECCIONADO</center>\";\n\t\techo \"</div>\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function store(ProveedorRequest $request){\n Proveedor::create($request->all());\n\n $filtro = (isset($request->filtro) && !empty($request->filtro))?$request->filtro:'';\n $page = $request->page;\n $proveedores = Proveedor::buscar($filtro)->paginate(5);\n\n return response()->json(view('admin.compras.proveedores.index.include.tProveedores', \n ['proveedores' => $proveedores])->render());\n }", "function getAllMco_proveedores()\n {\n $data_mco_proveedores = $this->gateway->getAllMco_proveedores();\n return $data_mco_proveedores;\n\n }", "static public function mdlIngresarProveedor($tabla, $datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(nombre, rfc, direccion, codpostal, ciudad, email, telefono, contacto, tel_contacto, email_contacto, ultusuario, estatus) VALUES (:nombre, :rfc, :direccion, :codpostal, :ciudad, :email, :telefono, :contacto, :tel_contacto, :email_contacto, :ultusuario, :estatus)\");\n\n\t\t$stmt->bindParam(\":nombre\", $datos[\"nombre\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":rfc\", $datos[\"rfc\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":direccion\", $datos[\"direccion\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":codpostal\", $datos[\"codpostal\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":ciudad\", $datos[\"ciudad\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":email\", $datos[\"email\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":telefono\", $datos[\"telefono\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":contacto\", $datos[\"contacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":tel_contacto\", $datos[\"tel_contacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":email_contacto\", $datos[\"email_contacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":ultusuario\", $datos[\"ultusuario\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":estatus\", $datos[\"estatus\"], PDO::PARAM_INT);\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}", "public function listar_proveedor(){\n $lugares=DB::select(\"SELECT nombre_lugar,id_lugar FROM lugar WHERE tipo_lugar='pa' order by nombre_lugar;\");\n $proveedores=DB::select(\"SELECT * FROM proveedor\");\n return view('portal/airucab-proveedores',compact('lugares'),compact('proveedores'));\n }", "public function getAllProveedores() {\n $proveedores = new CActiveDataProvider('ARTICULOPROVEEDOR', array(\n 'pagination'=>array(\n 'pageSize'=>2000,\n ),\n ));\n $listaProveedores = array();\n //Obtener todos los items del proveedor\n foreach ($proveedores->getData() as $data) {\n //Obtener el proveedor de cada articulo Filtrando su id a traves del ID del proveedor de cada articulo del proveedor\n $proveedorDeArticulo = new CActiveDataProvider('PROVEEDORES', array(\n 'criteria' => array(\n 'condition' => 'id=' . $data['idProveedor'],\n ),\n 'pagination'=>array(\n 'pageSize'=>2000,\n ),\n ));\n //Se recorre el array para procesar la salida de datos del CActiveDataProvider y hacer un GetData() para obtener una matriz de datos\n foreach ($proveedorDeArticulo->getData() as $proveedorItem) {\n //Concatenar datos extra como el Nombre del proveedor\n $listaProveedores[$data['id']] = $data['Nombre'].' - Proveedor: '.$proveedorItem['Nombre'];\n }\n }\n return $listaProveedores;\n }", "public function show(Proveedor $proveedor)\n {\n \n $datos = $proveedor->datosGeneralesProvedor;\n \n $giro='';\n if($datos->giro_id==null){\n $giro='NO DEFINIDO';\n }else{\n $giros=Giro::where('id',$datos->giro_id);\n $giro=$giros->nombre;\n }\n\n $formaContacto='';\n if($datos->forma_contacto_id==null){\n $formaContacto='NO DEFINIDO';\n }else{\n $formaContactos=FormaContacto::where('id',$datos->forma_contacto_id);\n $formaContacto=$formaContactos->nombre;\n }\n \n\n \n \n return view('proveedores.datosGenerales.view',\n ['datos' => $datos, 'proveedor' => $proveedor, 'giro' => $giro, 'formaContacto' => $formaContacto]);\n\n }", "public function ActualizarProveedores()\n\t\t{\n\t\t\tself::SetNames();\n\t\t\tif(empty($_POST[\"ritproveedor\"]) or empty($_POST[\"nomproveedor\"]) or empty($_POST[\"direcproveedor\"]) or empty($_POST[\"tlfproveedor\"]))\n\t\t\t{\n\t\t\t\techo \"1\";\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t$sql = \" select * from proveedores where codproveedor != ? and ritproveedor = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->execute( array($_POST[\"codproveedor\"], $_POST[\"ritproveedor\"]) );\n\t\t\t$num = $stmt->rowCount();\n\t\t\tif($num == 0)\n\t\t\t{\n\n\t\t\t\t$sql = \" update proveedores set \"\n\t\t\t\t.\" ritproveedor = ?, \"\n\t\t\t\t.\" nomproveedor = ?, \"\n\t\t\t\t.\" direcproveedor = ?, \"\n\t\t\t\t.\" tlfproveedor = ?, \"\n\t\t\t\t.\" emailproveedor = ?, \"\n\t\t\t\t.\" contactoproveedor = ? \"\n\t\t\t\t.\" where \"\n\t\t\t\t.\" codproveedor = ?;\n\t\t\t\t\";\n\t\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t\t$stmt->bindParam(1, $ritproveedor);\n\t\t\t\t$stmt->bindParam(2, $nomproveedor);\n\t\t\t\t$stmt->bindParam(3, $direcproveedor);\n\t\t\t\t$stmt->bindParam(4, $tlfproveedor);\n\t\t\t\t$stmt->bindParam(5, $emailproveedor);\n\t\t\t\t$stmt->bindParam(6, $contactoproveedor);\n\t\t\t\t$stmt->bindParam(7, $codproveedor);\n\n\t\t\t\t$ritproveedor = strip_tags($_POST[\"ritproveedor\"]);\n\t\t\t\t$nomproveedor = strip_tags($_POST[\"nomproveedor\"]);\n\t\t\t\t$direcproveedor = strip_tags($_POST[\"direcproveedor\"]);\n\t\t\t\t$tlfproveedor = strip_tags($_POST[\"tlfproveedor\"]);\n\t\t\t\t$emailproveedor = strip_tags($_POST[\"emailproveedor\"]);\n\t\t\t\t$contactoproveedor = strip_tags($_POST[\"contactoproveedor\"]);\n\t\t\t\t$codproveedor = strip_tags($_POST[\"codproveedor\"]);\n\t\t\t\t$stmt->execute();\n\n\t\t\t\techo \"<div class='alert alert-info'>\";\n\t\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\t\techo \"<span class='fa fa-check-square-o'></span> EL PROVEEDOR FUE ACTUALIZADO EXITOSAMENTE\";\n\t\t\t\techo \"</div>\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"3\";\n\t\t\t\texit;\n\t\t\t}\n\t\t}", "function get_entradas_proveedor_list($id) {\n\t\t$u = new Entrada();\n\t\t$sql=\"select distinct on (e.pr_facturas_id) e.pr_facturas_id, e.id as id1, date(e.fecha) fecha, prf.monto_total as importe_factura, pr.razon_social as proveedor,prf.folio_factura, prf.pr_pedido_id, ef.tag as espacio_fisico, eg.tag as estatuse, e.lote_id, cel.tag as estatus_traspaso \".\n\t\t\t\t\"from entradas as e \".\n\t\t\t\t\"left join cproveedores as pr on pr.id=e.cproveedores_id \".\n\t\t\t\t\"left join pr_facturas as prf on prf.id=e.pr_facturas_id \".\n\t\t\t\t\"left join espacios_fisicos as ef on ef.id=e.espacios_fisicos_id \".\n\t\t\t\t\"left join estatus_general as eg on eg.id=e.estatus_general_id \".\n\t\t\t\t\"left join lotes_pr_facturas as lf on lf.pr_factura_id=prf.id \".\n\t\t\t\t\"left join cestatus_lotes as cel on cel.id=lf.cestatus_lote_id \".\n\t\t\t\t\"where e.estatus_general_id=1 and ctipo_entrada=1 and e.cproveedores_id='$id'\".\n\t\t\t\t\"group by e.pr_facturas_id, e.id, e.fecha, importe_factura, pr.razon_social, prf.folio_factura, prf.pr_pedido_id, ef.tag, eg.tag, e.pr_facturas_id, e.cproveedores_id,e.lote_id, cel.tag \".\n\t\t\t\t\"order by e.pr_facturas_id desc,e.fecha desc\";\n\n\t\t//Buscar en la base de datos\n\t\t$u->query($sql);\n\t\tif($u->c_rows > 0){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function obtenerProveedorAtr($id,$field){\n\t\tswitch($field){\n\t\t\tcase \"nombre\":\n\t\t\t\t$field = \"text_razonSocial\";\n\t\t\tbreak;\n\t\t}\n\t\t$connect=conectar();\n\t\t$sql = \"SELECT \".$field.\" FROM proveedores WHERE id_proveedor = '$id'\";\n\t\t$result= mysql_fetch_array(mysql_query($sql,$connect));\n\t\treturn $result[$field];\n\t}", "function lista_proveedores($ubicacion,$idfamilia,$idservicio,$interno,$activo,$texto)\n\t{\n\n\t\t$condicion =\" WHERE 1 \";\n\n\t\tif ($idfamilia!='') $condicion.= \" AND cs.IDFAMILIA ='$idfamilia'\";\n\t\tif ($activo!='') $condicion.= \" AND (cp.ACTIVO = $activo)\";\n\t\tif ($idservicio!='') $condicion.= \" AND (cps.IDSERVICIO = '$idservicio' OR cps.IDSERVICIO ='0' )\";\n\t\tif ($interno!='') $condicion.= \" AND cp.INTERNO = '$interno' \";\n\t\tif ($texto!='') $condicion.= \" AND (cp.NOMBRECOMERCIAL like '%$texto%' OR cp.NOMBREFISCAL like '%$texto%')\";\n\n\t\t/* QUERY BUSCA LOA PROVEEDORES QUE PRESTAN EL SERVICIO*/\n\n\t\t$sql=\"\n\t\t\tSELECT \n\t\t\t\tcp.IDPROVEEDOR\n\t\t\tFROM \n\t\t\t$this->catalogo.catalogo_proveedor cp\n\t\t\t\tLEFT JOIN $this->catalogo.catalogo_proveedor_servicio cps ON cps.IDPROVEEDOR = cp.IDPROVEEDOR \n\t\t\t\tLEFT JOIN $this->catalogo.catalogo_servicio cs ON cs.IDSERVICIO = cps.IDSERVICIO\n\t\t\t\t$condicion\n\t\t\t\t\n\t\t\tGROUP BY cps.IDPROVEEDOR\n\t\t\torder by cp.INTERNO DESC, cp.NOMBRECOMERCIAL ASC\n\t\t\";\n\n\n\t\t\t//\techo $sql;\n\t\t\t\t$res_prv= $this->query($sql);\n\t\t\t\t$lista_prov= array();\n\t\t\t\t$prov = new proveedor();\n\t\t\t\t$poli = new poligono();\n\t\t\t\t$circulo = new circulo();\n\t\t\t\t$point= array('lat'=>$ubicacion->latitud,'lng'=>$ubicacion->longitud);\n\n\t\t\t\tif ($ubicacion->cveentidad1==0){\n\t\t\t\t\twhile ($reg=$res_prv->fetch_object())\n\t\t\t\t\t{\n\t\t\t\t\t\t$lista_prov[$reg->IDPROVEEDOR][DISTANCIA]='';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\twhile ($reg_prv=$res_prv->fetch_object())\n\t\t\t\t\t{\n\t\t\t\t\t\t$prov->carga_datos($reg_prv->IDPROVEEDOR);\n\t\t\t\t\t\t$distancia= geoDistancia($ubicacion->latitud,$ubicacion->longitud,$prov->latitud,$prov->longitud,$prov->lee_parametro('UNIDAD_LONGITUD'));\n\t\t\t\t\t\t$sw=0;\n\n\t\t\t\t\t\t$condicion=\"\";\n\t\t\t\t\t\t$condicion.= \" cuf.CVEPAIS = '$ubicacion->cvepais'\";\n\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD1 in ('$ubicacion->cveentidad1','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD2 in ('$ubicacion->cveentidad2','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD3 in ('$ubicacion->cveentidad3','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD4 in ('$ubicacion->cveentidad4','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD5 in ('$ubicacion->cveentidad5','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD6 in ('$ubicacion->cveentidad6','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD7 in ('$ubicacion->cveentidad7','0'))\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$condicion.= \" OR (\"; \n\n\t\t\t\t\t\tif ($ubicacion->cveentidad1!='0') $condicion.= \" (cuf.CVEENTIDAD1 = '$ubicacion->cveentidad1')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad2!='0') $condicion.= \" AND (cuf.CVEENTIDAD2 = '$ubicacion->cveentidad2')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad3!='0') $condicion.= \" AND (cuf.CVEENTIDAD3 = '$ubicacion->cveentidad3')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad4!='0') $condicion.= \" AND (cuf.CVEENTIDAD4 = '$ubicacion->cveentidad4')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad5!='0') $condicion.= \" AND (cuf.CVEENTIDAD5 = '$ubicacion->cveentidad5')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad6!='0') $condicion.= \" AND (cuf.CVEENTIDAD6 = '$ubicacion->cveentidad6')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad7!='0') $condicion.= \" AND (cuf.CVEENTIDAD7 = '$ubicacion->cveentidad7')\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$condicion .= \" )\";\n\n\t\t\t\t\t\t/* QUERY BUSCA LAS UNIDADES FEDERATIVAS QUE COINCIDAN CON LA UBICACION PARA CADA PROVEEDOR*/\n\t\t\t\t\t\t$sql=\"\n\t\t\tSELECT \n\t\t\t\tcpsxuf.IDPROVEEDOR, cpsxuf.IDUNIDADFEDERATIVA,cpsxuf.ARRAMBITO\n\t\t\tFROM\n\t\t\t $this->catalogo.catalogo_proveedor_servicio_x_unidad_federativa cpsxuf\n\t\t\t\tLEFT JOIN $this->catalogo.catalogo_unidadfederativa cuf ON $condicion\n\t\t\tWHERE \n\t\t\t\tcpsxuf.IDUNIDADFEDERATIVA = cuf.IDUNIDADFEDERATIVA\n\t\t\t\tAND\tcpsxuf.IDPROVEEDOR ='$reg_prv->IDPROVEEDOR'\n\t\t\t\tand cpsxuf.IDSERVICIO IN ('$idservicio', '0')\n\t\t\t\tORDER BY 3 DESC\n\t\t\t\";\n\t\t\t\t\t//echo $sql;\n\t\t\t$res_prv_entid= $this->query($sql);\n\t\t\twhile ($reg_prv_entid= $res_prv_entid->fetch_object())\n\t\t\t{\n\t\t\t\t$lista_prov[$reg_prv_entid->IDPROVEEDOR][DISTANCIA]= $distancia;\n\t\t\t\t$lista_prov[$reg_prv_entid->IDPROVEEDOR][AMBITO]=\t$reg_prv_entid->ARRAMBITO;\n\t\t\t\t$lista_prov[$reg_prv_entid->IDPROVEEDOR][TIPOPOLIGONO] ='ENTIDAD';\n\t\t\t\t$lista_prov[$reg_prv_entid->IDPROVEEDOR][ID] = $reg_prv_entid->IDUNIDADFEDERATIVA;\n\t\t\t\tif ($reg_prv_entid->ARRAMBITO=='LOC') $sw=1; // si hubo algun entidad LOC se activa el sw\n\n\t\t\t}\n\t\t\tif (($ubicacion->latitud !='' )&& ($ubicacion->longitud!=''))\n\t\t\t{\n\t\t\t\t$sql=\"\n\t\t\t\tSELECT \n\t\t\t\t\tcpsxp.IDPROVEEDOR, cpsxp.IDPOLIGONO\n\t\t\t\tFROM \n\t\t\t\t$this->catalogo.catalogo_proveedor_servicio_x_poligono cpsxp\n\t\t\t\tWHERE\n\t\t\t\t\tcpsxp.IDPROVEEDOR ='$reg_prv->IDPROVEEDOR'\n\t\t\t\t\";\n\t\t\t\t$res_prv_poli= $this->query($sql);\n\t\t\t\twhile ($reg_prv_poli = $res_prv_poli->fetch_object())\n\t\t\t\t{\n\t\t\t\t\t// verifica si el punto esta incluido en el poligono\n\t\t\t\t\t$in = pointInPolygon($point,$poli->lee_vertices($reg_prv_poli->IDPOLIGONO));\n\t\t\t\t\tif (( $in ) && ($sw==0))\n\t\t\t\t\t{\n\t\t\t\t\t\t$lista_prov[$reg_prv_poli->IDPROVEEDOR][DISTANCIA]= $distancia;\n\t\t\t\t\t\t$lista_prov[$reg_prv_poli->IDPROVEEDOR][AMBITO]=\t$reg_prv_poli->ARRAMBITO;\n\t\t\t\t\t\t$lista_prov[$reg_prv_poli->IDPROVEEDOR][TIPOPOLIGONO] ='POLIGONO';\n\t\t\t\t\t\t$lista_prov[$reg_prv_poli->IDPROVEEDOR][ID] = $reg_prv_poli->IDPOLIGONO;\n\t\t\t\t\t\tif ($reg_prv_poli->ARRAMBITO=='LOC') $sw=1; // si hubo algun poligono LOC se activa el sw\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$sql=\"\n\t\t\t\tSELECT \n\t\t\t\t\tcpsxc.IDPROVEEDOR, cpsxc.IDCIRCULO\n\t\t\t\tFROM\n\t\t\t\t$this->catalogo.catalogo_proveedor_servicio_x_circulo cpsxc\n\t\t\t\tWHERE\n\t\t\t\t\tcpsxc.IDPROVEEDOR='$res_prv->IDPROVEEDOR'\n\t\t\t\t\";\n\n\t\t\t\t$res_prv_circ = $this->query($sql);\n\t\t\t\twhile ($reg_prv_circ = $res_prv_circ->fetch_object())\n\t\t\t\t{\n\t\t\t\t\t$circulo->leer($reg_prv_circ->IDCIRCULO);\n\t\t\t\t\t$vertices = $circulo->verticesCircle($circulo->latitud,$circulo->longitud,$circulo->radio,$circulo->idmedida);\n\t\t\t\t\t$in= pointInPolygon($point,$vertices);\n\n\t\t\t\t\tif (($in ) && ($sw==0))\n\t\t\t\t\t{\n\t\t\t\t\t\t$lista_prov[$reg_prv_circ->IDPROVEEDOR][DISTANCIA]= $distancia;\n\t\t\t\t\t\t$lista_prov[$reg_prv_circ->IDPROVEEDOR][AMBITO]=\t$reg_prv_circ->ARRAMBITO;\n\t\t\t\t\t\t$lista_prov[$reg_prv_circ->IDPROVEEDOR][TIPOPOLIGONO] ='CIRCULO';\n\t\t\t\t\t\t$lista_prov[$reg_prv_circ->IDPROVEEDOR][ID] = $reg_prv_circ->IDCIRCULO;\n\t\t\t\t\t\tif ($reg_prv_circ->ARRAMBITO=='LOC') $sw=1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // fin de la busqueda por LATITUD Y LONGITUD\n\n\n\n\n\n\t\t\t\t\t} // fin del while del proveedor\n\t\t\t\t}\n\n\t\t\t\t/* LEE LAS PROPORCIONES DE LA FORMULA DEL RANKING */\n\t\t\t\t$sql=\"\n\t\t\tSELECT \t\n\t\t\t\tELEMENTO,PROPORCION \n\t\t\tFROM \n\t\t\t$this->catalogo.catalogo_proporciones_ranking\n\t\t\t\";\n\t\t\t$result=$this->query($sql);\n\n\t\t\twhile($reg = $result->fetch_object())\n\t\t\t$proporcion[$reg->ELEMENTO] = $reg->PROPORCION;\n\n\n\t\t\t$max_costo_int=0;\n\t\t\t$max_costo_ext=0;\n\n\n\t\t\t/* OBTENER DATOS PARA EVALUAR EL RANKING */\n\t\t\tforeach ($lista_prov as $idproveedor=>$proveedor)\n\t\t\t{\n\t\t\t\t$sql=\"\n\t\tSELECT \n\t\t\tIF (cp.ARREVALRANKING='SKILL',IF (cp.SKILL>0,cp.SKILL/100,0), IF (cp.CDE>0,cp.CDE/100,0)) VALRANKING,\n\t\t\tIF (cpscn.MONTOLOCAL IS NULL,0,cpscn.MONTOLOCAL) COSTO,\n\t\t\tIF (cp.EVALSATISFACCION>0,cp.EVALSATISFACCION/100,0) EVALSATISFACCION ,\n\t\t\tcp.EVALINFRAESTRUCTURA EVALINFRAESTRUCTURA,\n\t\t\tcp.EVALFIDELIDAD EVALFIDELIDAD,\n\t\t\tcp.INTERNO\n\t\tFROM \n\t\t$this->catalogo.catalogo_proveedor cp\n\t\t\tLEFT JOIN $this->catalogo.catalogo_proveedor_servicio_costo_negociado cpscn ON cpscn.IDPROVEEDOR = cp.IDPROVEEDOR AND cpscn.IDSERVICIO = '$idservicio' AND cpscn.IDCOSTO = 1\n\t\tWHERE \n\t\t\tcp.IDPROVEEDOR = '$idproveedor' \n\t\t\";\n\t\t//\t\t\t\techo $sql;\n\t\t$result = $this->query($sql);\n\n\t\twhile ($reg=$result->fetch_object())\n\t\t{\n\t\t\tif ($reg->INTERNO){\n\t\t\t\t$temp_prov_int[$idproveedor][VALRANKING] = $reg->VALRANKING;\n\t\t\t\t$temp_prov_int[$idproveedor][COSTO] = $reg->COSTO;\n\t\t\t\t$temp_prov_int[$idproveedor][EVALSATISFACCION] = $reg->EVALSATISFACCION;\n\t\t\t\t$temp_prov_int[$idproveedor][EVALINFRAESTRUCTURA] = $reg->EVALINFRAESTRUCTURA;\n\t\t\t\t$temp_prov_int[$idproveedor][EVALFIDELIDAD] = $reg->EVALFIDELIDAD;\n\t\t\t\tif ($reg->COSTO > $max_costo_int) $max_costo_int= $reg->COSTO;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$temp_prov_ext[$idproveedor][VALRANKING] = $reg->VALRANKING;\n\t\t\t\t$temp_prov_ext[$idproveedor][COSTO] = $reg->COSTO;\n\t\t\t\t$temp_prov_ext[$idproveedor][EVALSATISFACCION] = $reg->EVALSATISFACCION;\n\t\t\t\t$temp_prov_ext[$idproveedor][EVALINFRAESTRUCTURA] = $reg->EVALINFRAESTRUCTURA;\n\t\t\t\t$temp_prov_ext[$idproveedor][EVALFIDELIDAD] = $reg->EVALFIDELIDAD;\n\t\t\t\tif ($reg->COSTO > $max_costo_ext) $max_costo_ext= $reg->COSTO;\n\t\t\t}\n\t\t}\n\n\t\t\t}\n\n\t\t\t/*calcula el Ranking de proveedores internos */\n\n\t\t\tforeach ($temp_prov_int as $idproveedor=>$proveedor)\n\t\t\t{\n\t\t\t\t$valranking = round($proveedor[VALRANKING] * $proporcion[CDE_SKILL],4);\n\t\t\t\t$valcosto = ($proveedor[COSTO]==0)?0:(1-($proveedor[COSTO]/$max_costo_int))*$proporcion[COSTO];\n\t\t\t\t$evalsatisfaccion = round($proveedor[EVALSATISFACCION] * $proporcion[SATISFACCION],2);\n\t\t\t\t$evalinfraestructura = round($proveedor[EVALINFRAESTRUCTURA] * $proporcion[INFRAESTRUCTURA],2);\n\t\t\t\t$evalfidelidad = round($proveedor[EVALFIDELIDAD] * $proporcion[FIDELIDAD],2);\n\t\t\t\t$lista_prov_int[$idproveedor][RANKING] = ($valranking + $valcosto+$evalsatisfaccion + $evalinfraestructura + $evalfidelidad)*100;\n\t\t\t}\n\n\t\t\t/*calcula el Ranking de proveedores externos */\n\t\t\tforeach ($temp_prov_ext as $idproveedor=>$proveedor)\n\t\t\t{\n\t\t\t\t$valranking = round($proveedor[VALRANKING] * $proporcion[CDE_SKILL],4);\n\t\t\t\t$valcosto = ($proveedor[COSTO]==0)?0:(1-($proveedor[COSTO]/$max_costo_ext))*$proporcion[COSTO];\n\t\t\t\t$evalsatisfaccion = round($proveedor[EVALSATISFACCION] * $proporcion[SATISFACCION],2);\n\t\t\t\t$evalinfraestructura = round($proveedor[EVALINFRAESTRUCTURA] * $proporcion[INFRAESTRUCTURA],2);\n\t\t\t\t$evalfidelidad = round($proveedor[EVALFIDELIDAD] * $proporcion[FIDELIDAD],2);\n\t\t\t\t$lista_prov_ext[$idproveedor][RANKING] = ($valranking + $valcosto+$evalsatisfaccion + $evalinfraestructura + $evalfidelidad)*100;\n\t\t\t}\n\n\t\t\t$temp_prov_int = ordernarArray($lista_prov_int,'RANKING',1);\n\t\t\t$temp_prov_ext = ordernarArray($lista_prov_ext,'RANKING',1);\n\n\n\t\t\tforeach ($temp_prov_int as $idproveedor => $proveedor)\n\t\t\t{\n\t\t\t\t$lista_ordenada[$idproveedor] = $lista_prov[$idproveedor];\n\t\t\t\t$lista_ordenada[$idproveedor][RANKING] = $lista_prov_int[$idproveedor][RANKING];\n\t\t\t}\n\t\t\tforeach ($temp_prov_ext as $idproveedor => $proveedor)\n\t\t\t{\n\t\t\t\t$lista_ordenada[$idproveedor] = $lista_prov[$idproveedor];\n\t\t\t\t$lista_ordenada[$idproveedor][RANKING] = $lista_prov_ext[$idproveedor][RANKING];\n\t\t\t}\n\t\t\t/* DEVUELVE EL ARRAY*/\n\t\t\treturn $lista_ordenada ;\n\n\t}", "public function edit(Proveedor $proveedor)\n {\n\n $distritos = Distrito::all();\n $cb = Distrito::Findorfail($proveedor->distrito_id);\n $cbid = ($cb->id);\n $cbd = ($cb->distrito);\n\n return view('proveedores.edit', [\n 'proveedor' => $proveedor,\n 'distritos'=> $distritos,\n 'cbid' => $cbid,\n 'cbd' => $cbd\n ]);\n \n }", "public function read_alltiendas(){\r\n $sql=\"select p.id_proveedor, p.nombre_establecimiento, p.direccion_fisica, p.direccion_web,\r\n p.descripcion_tienda, p.id_usuario\r\n from proveedor p\r\n INNER JOIN usuario u on p.id_usuario = u.id_usuario\";\r\n $resul=mysqli_query($this->con(),$sql);\r\n while($row=mysqli_fetch_assoc($resul)){\r\n $this->proveedores[]=$row;\r\n }\r\n return $this->proveedores;\r\n\r\n }", "public function obtenerProveedorOrden($codigo_proyecto){\n\t\t$query='SELECT c.alm_proy_cod,p.alm_prov_codigo_int, p.alm_prov_nombre \n\t\t\t\tFROM alm_ord_compra_cab c INNER JOIN alm_proveedor p ON c.alm_prov_codigo=p.alm_prov_codigo_int\n\t\t\t\tWHERE c.alm_proy_cod=\"'.$codigo_proyecto.'\"\n\t\t\t\tGROUP BY p.alm_prov_codigo_int';\n\t\treturn $this->mysql->query($query);\n\t}", "public function __construct() {\n $this->adminProveedorModelo = new adminProveedorModelo();\n }", "function obtenerPedido ($cedulaCliente){\n\t\t$x = $this->pdo->prepare('SELECT * FROM pedido where cedulaCliente = ?');\n\t\t$x->execute(array($cedulaCliente));\n\t\treturn $x->fetchALL(PDO::FETCH_OBJ);\n\t}", "function existeProveedor($codigo)\n {\n \tif($this->gateway->existMco_proveedores($codigo) == 1){ \n return ERROR_DATO_EXISTE;\n }\n else\n {\n return EXITO_OPERACION_REALIZADA;\n }\n }", "public function agregar_proveedor(Request $request)\n {\n if(!session('Usuario')) {\n return 'session';\n }\n if(\n empty( $request->input('proveedor_nombre') ) ||\n empty( $request->input('proveedor_rfc') ) ||\n empty( $request->input('proveedor_correo') ) ||\n empty( $request->input('proveedor_telefono') )\n ) {\n return 'empty';\n }\n\n $proveedor = new Proveedor();\n\n $proveedor->RFC = $request->input('proveedor_rfc');\n $proveedor->Nombre = $request->input('proveedor_nombre');\n $proveedor->Telefono = $request->input('proveedor_telefono');\n $proveedor->Email = $request->input('proveedor_correo');\n $proveedor->Adeudo = 0;\n $proveedor->estatus = 1;\n $proveedor->idUsuario = session('idUsuario');\n\n if(!$proveedor->save()) {\n return 'error';\n }\n return 'true';\n }", "function consultar_proveedores(){\n\t\t$this->db->SELECT('*');\n\t\t$this->db->FROM('mantenciones_proveedores');\n\t\t$this->db->order_by(\"id\",\"desc\");\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function createProveedores(Request $request){\n $accion = 'M01';\n $IdProvee = null; \n $CodEmp = $request->get('CodEmp'); \n $TipoDoc = $request->get('TipoDoc'); \n $NomTipDoc = $request->get('NomTipDoc'); \n $NumDoc = $request->get('NumDoc'); \n $Nombre = $request->get('Nombre'); \n $NombComercial = $request->get('NombComercial'); \n $idPais = $request->get('IdPais'); \n $idDepa = $request->get('IdDepartamento');\n $idProv = $request->get('IdProvincia');\n $idDist = $request->get('IdDistrito'); \n $DirPer = $request->get('Direccion'); \n $Telefono = $request->get('Telefono'); \n $Email = $request->get('Email'); \n $Activo = null; \n\n $proveedores = DB::select('call Man_zg_proveedores(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'\n ,array(\n $accion,\n $IdProvee,\n $CodEmp, \n $TipoDoc, \n $NomTipDoc, \n $NumDoc, \n $Nombre, \n $NombComercial, \n $idPais, \n $idDepa,\n $idProv,\n $idDist, \n $DirPer, \n $Telefono, \n $Email, \n $Activo\n \n ));\n return response()->json($request, 201);\n // return response()->json(['proveedor creado'=>$request], 201);\n }", "public function listado(){\n //return view('proveedores.listado', ['proveedores' => Proveedor::all()]);\n return Provincia::find(1)->with(['Pais'])->first(); \n }", "public function create($proveedor)\n {\n $proveedor = Proveedor::find($proveedor);\n $giros = Giro::get();\n $formaContactos = FormaContacto::get();\n return view('proveedores.datosGenerales.create', ['proveedor' => $proveedor, 'giros' => $giros, 'formaContactos' => $formaContactos]);\n }", "private function cambiarProveedor() {\n\n $ok = false;\n\n $em = new EntityManager($this->form->getConection());\n if ($em->getDbLink()) {\n\n // Cambiar factura\n $filtro = \"NumeroFactura='{$this->request['numeroFactura']}' AND IDProveedor='{$this->request['idProveedorAnterior']}'\";\n $query = \"update frecibidas_cab set IDProveedor='{$this->request['idProveedorNuevo']}' where {$filtro}\";\n $em->query($query);\n $this->values['errores'] = $em->getError();\n $okFactura = $em->getAffectedRows();\n\n if ($okFactura) {\n \n $this->values['mensaje'][] = \"Se ha cambiado \" . $okFactura . \" factura.\";\n // Cambiar pedido/s\n $filtro = \"IDFactura='{$this->request['idFactura']}' AND IDProveedor='{$this->request['idProveedorAnterior']}'\";\n $query = \"update pedidos_cab set IDProveedor='{$this->request['idProveedorNuevo']}' where {$filtro}\";\n $em->query($query);\n $this->values['errores'] = $em->getError();\n $nPedidos = $em->getAffectedRows();\n $this->values['mensaje'][] = \"Se han cambiado \" . $nPedidos . \" pedidos.\";\n \n // Cambiar recibos\n $filtro = \"IDFactura='{$this->request['idFactura']}' AND IDProveedor='{$this->request['idProveedorAnterior']}'\";\n $query = \"update recibos_proveedores set IDProveedor='{$this->request['idProveedorNuevo']}' where {$filtro}\";\n $em->query($query);\n $this->values['errores'] = $em->getError();\n $nRecibos = $em->getAffectedRows();\n $this->values['mensaje'][] = \"Se han cambiado \" . $nRecibos . \" recibos.\";\n \n }\n }\n\n $em->desConecta();\n unset($em);\n }", "public function edit($proveedor)\n { \n $proveedor = Proveedor::find($proveedor);\n $datos = $proveedor->generales;\n $giros = Giro::get();\n $formaContactos = FormaContacto::get();\n return view('proveedores.datosGenerales.edit', ['proveedor' => $proveedor, 'datos' => $datos, 'giros' => $giros, 'formaContactos' => $formaContactos]);\n }", "function obtenerCliente ($cedula){\n\t\t$x = $this->pdo->prepare('SELECT * FROM cliente where cedula = ?');\n\t\t$x->execute(array($cedula));\n\t\treturn $x->fetchALL(PDO::FETCH_OBJ);\n\t}", "function entrada_por_traspaso(){\n\t\t$e= new Entrada();\n\t\t$e->usuario_id=$GLOBALS['usuarioid'];\n\t\t$e->empresas_id=$GLOBALS['empresaid'];\n\t\t$related = $e->from_array($_POST);\n\t\t//if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n\t\t$e->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$e->costo_total=($e->cantidad * $e->costo_unitario);\n\t\t$e->cproveedores_id=1;\n\t\t$e->fecha=date(\"Y-m-d H:i:s\");\n\t\tif($e->id==0)\n\t\t\tunset($e->id);\n\t\tif($e->save($related)) {\n\t\t\techo $e->id;\n\t\t} else\n\t\t\techo 0;\n\t}", "public function destroy(ProveedoresModel $proveedor)\n {\n //\n }", "public function store()\n\t{\n\t\t$authuser = Auth::user();\n\t\t$rules = array(\n\t\t\t'proveedor_tipo' => 'not_in:NA',\n\t\t\t'nombre_usuario' => 'required',\n\t\t\t'nombre' => 'required',\n\t\t\t//'direccion' => 'required',\n\t\t\t//'telefono' => 'required',\n\t\t\t//'facebook' => 'required',\n\t\t\t//'twitter' => 'required',\n\t\t\t//'otro_sns' => 'required',\n\t\t\t'longitud' => 'required|numeric',\n\t\t\t'latitud' => 'required|numeric',\n\t\t\t'introduccion' => 'required',\n\t\t\t'descripcion' => 'required',\n\t\t\t'vision' => 'required',\n\t\t\t'productos' => 'required',\n\t\t\t'imagen_intro' => 'mimes:png,gif,jpeg|max:20000',\n\t\t\t'imagen_descripcion' => 'mimes:png,gif,jpeg|max:20000',\n\t\t\t'imagen_vision' => 'mimes:png,gif,jpeg|max:20000',\t\n\t\t);\n\t\t$validator = Validator::make(Input::all(), $rules);\t\t\n\t\t\n\t\tif ($validator->fails()) {\n\t\t\treturn Redirect::to('vistausuario/proveedor/create')\n\t\t\t\t->withErrors($validator)->withInput();\n\t\t} else {\n\t\t\n\t\t$proveedores = new Proveedor;\n\t\t$proveedores_detalle = new ProveedorDetalle;\n\n\t\t$nombreDeUsuario = Input::get('nombre_usuario');\n\n\t\t$proveedores->id=0;\n\t\t$proveedores->proveedor_tipo_idproveedor_tipo=Input::get('proveedor_tipo');\n\t\t$proveedores->nombre_usuario=Input::get('nombre_usuario');\n\t\t$proveedores->nombre=Input::get('nombre');\n\t\t$proveedores->direccion=Input::get('direccion');\n\t\t$proveedores->telefono=Input::get('telefono');\n\t\t$proveedores->facebook=Input::get('facebook');\n\t\t$proveedores->twitter=Input::get('twitter');\n\t\t$proveedores->otro_sns=Input::get('otro_sns');\n\t\t$proveedores->longitud=Input::get('longitud');\n\t\t$proveedores->latitud=Input::get('latitud');\n\t\t$proveedores->habilitar = 0;\n\t\t$proveedores->solicitar_premium= 0;\n\t\t$proveedores->usuario_id = $authuser->id;\n\t\t$proveedores->save();\n\n\t\t$idproveedor = $proveedores->id;\n\n\t\t$proveedores_detalle->id=0;\n\t\t$proveedores_detalle->proveedores_idproveedor=$idproveedor;\n\t\t$proveedores_detalle->proveedores_proveedor_tipo_idproveedor_tipo=Input::get('proveedor_tipo_idproveedor_tipo');\n\t\t$proveedores_detalle->introduccion=Input::get('introduccion');\n\t\t$proveedores_detalle->descripcion=Input::get('descripcion');\n\t\t$proveedores_detalle->vision=Input::get('vision');\n\t\t$proveedores_detalle->productos=Input::get('productos');\n\t\t$proveedores_detalle->proveedores_proveedor_tipo_idproveedor_tipo = Input::get('proveedor_tipo');\n\n\t\tif(!File::exists('images/proveedores/'.$nombreDeUsuario)) {\n\t\t $result = File::makeDirectory('images/proveedores/'.$nombreDeUsuario, 0777);\n\t\t}\n\n\t\t$imagen_intro = Input::file('imagen_intro');\n\t\t$file = $imagen_intro;\n\t\t$rules = array(\n\t\t 'file' => 'required|mimes:png,gif,jpeg|max:20000'\n\t\t);\n\t\t$validator = \\Validator::make(array('file'=> $file), $rules);\n\t\tif($validator->passes()){\n\n\t\t\t$id = Str::random(4);\n\t\t\t$date_now = new DateTime();\n\n\t\t $destinationPath = 'images/proveedores/'.$nombreDeUsuario;\n\t\t $filename = $date_now->format('YmdHis').$id;\n\t\t $mime_type = $file->getMimeType();\n\t\t $extension = $file->getClientOriginalExtension();\n\t\t $upload_success = $file->move($destinationPath, $filename.'.'.$extension);\n\t\t\t$proveedores_detalle->imagen_intro=$filename.'.'.$extension;\n\t\t} else {\n\t\t $proveedores_detalle->imagen_intro = '';\n\t\t}\n\t\t\n\n\t\t$imagen_descripcion = Input::file('imagen_descripcion');\n\t\t$file = $imagen_descripcion;\n\t\t$rules = array(\n\t\t 'file' => 'required|mimes:png,gif,jpeg|max:20000'\n\t\t);\n\t\t$validator = \\Validator::make(array('file'=> $file), $rules);\n\t\tif($validator->passes()){\n\n\t\t $id = Str::random(4);\n\t\t\t$date_now = new DateTime();\n\n\t\t $destinationPath = 'images/proveedores/'.$nombreDeUsuario;\n\t\t $filename = $date_now->format('YmdHis').$id;\n\t\t $mime_type = $file->getMimeType();\n\t\t $extension = $file->getClientOriginalExtension();\n\t\t $upload_success = $file->move($destinationPath, $filename.'.'.$extension);\n\t\t\t$proveedores_detalle->imagen_descripcion=$filename.'.'.$extension;\n\t\t} else {\n\t\t\t$proveedores_detalle->imagen_descripcion='';\n\t\t}\t\n\t\t\n\n\n\t\t$imagen_vision = Input::file('imagen_vision');\n\t\t$file = $imagen_vision;\n\t\t$rules = array(\n\t\t 'file' => 'required|mimes:png,gif,jpeg|max:20000'\n\t\t);\n\t\t$validator = \\Validator::make(array('file'=> $file), $rules);\n\t\tif($validator->passes()){\n\n\t\t $id = Str::random(4);\n\t\t\t$date_now = new DateTime();\n\n\t\t $destinationPath = 'images/proveedores/'.$nombreDeUsuario;\n\t\t $filename = $date_now->format('YmdHis').$id;\n\t\t $mime_type = $file->getMimeType();\n\t\t $extension = $file->getClientOriginalExtension();\n\t\t $upload_success = $file->move($destinationPath, $filename.'.'.$extension);\n\t\t\t$proveedores_detalle->imagen_vision=$filename.'.'.$extension;\n\t\t} else {\n\t\t\t$proveedores_detalle->imagen_vision='';\n\t\t}\t\t\t\t\n\t\t\n\t\t$proveedores_detalle->save();\n\n\t\treturn Redirect::to(\"vistausuario/\")->with(array('usuarioimg'=>$authuser->imagen, 'usuarionombre'=>$authuser->nombre, 'usuarioid'=>$authuser->id));\t\t\n\t\t}\n\t}", "public function RegistrarProveedores()\n{\n\tself::SetNames();\n\tif(empty($_POST[\"ritproveedor\"]) or empty($_POST[\"nomproveedor\"]) or empty($_POST[\"direcproveedor\"]) or empty($_POST[\"tlfproveedor\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\t$sql = \" select ritproveedor from proveedores where ritproveedor = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_POST[\"ritproveedor\"]) );\n\t$num = $stmt->rowCount();\n\tif($num == 0)\n\t{\n\t\t$query = \" insert into proveedores values (null, ?, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $ritproveedor);\n\t\t$stmt->bindParam(2, $nomproveedor);\n\t\t$stmt->bindParam(3, $direcproveedor);\n\t\t$stmt->bindParam(4, $tlfproveedor);\n\t\t$stmt->bindParam(5, $emailproveedor);\n\t\t$stmt->bindParam(6, $contactoproveedor);\n\n\t\t$ritproveedor = strip_tags($_POST[\"ritproveedor\"]);\n\t\t$nomproveedor = strip_tags($_POST[\"nomproveedor\"]);\n\t\t$direcproveedor = strip_tags($_POST[\"direcproveedor\"]);\n\t\t$tlfproveedor = strip_tags($_POST[\"tlfproveedor\"]);\n\t\t$emailproveedor = strip_tags($_POST[\"emailproveedor\"]);\n\t\t$contactoproveedor = strip_tags($_POST[\"contactoproveedor\"]);\n\t\t$stmt->execute();\n\n\t\techo \"<div class='alert alert-success'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<span class='fa fa-check-square-o'></span> EL PROVEEDOR FUE REGISTRADO EXITOSAMENTE\";\n\t\techo \"</div>\";\t\t\n\t\texit;\n\t}\n\telse\n\t{\n\t\techo \"3\";\n\t\texit;\n\t}\n}", "function formularioSeleccionarProveedor() {\nrequire_once \"conexionsql.php\";\nrequire_once \"formularios.php\";\n$conProveedor= \"SELECT ID_PROVEEDOR,PROVEEDOR,CONTACTOS from proveedor WHERE STATUS_ACTIVO = '1' ORDER BY PROVEEDOR ASC\";\n\t//Campo Proveedor\n\t$proveedor= new campoSeleccion(\"selProveedor\",\"formularioCampoSeleccion\",\"$_POST[selProveedor]\",\"onChange\",\"\",$conProveedor,\"--PROVEEDOR--\",\"\");\n\t$selProveedor=$proveedor->retornar();\n\necho \"<form name=\\\"frmEquipo\\\" method=\\\"post\\\" action=\\\"\\\">\";\n\techo \"<input name=\\\"funcion\\\" type=\\\"hidden\\\" value=\\\"1\\\">\";\n\n\techo \"<table class=\\\"formularioTabla\\\"align=center width=\\\"100\\\" border=\\\"0\\\">\";\n\t\techo \"<tr>\";\n\t\t\techo \"<td class=\\\"formularioTablaTitulo\\\" colspan=\\\"2\\\">ELIMINAR PROVEEDOR</td>\n \t\t\t\t</tr>\";\n\t echo \"<tr>\";\n\t\t\techo \"<tr align=center></tr>\n \t\t\t\t</tr>\n<tr align=center><td valign=top class=\\\"formularioCampoTitulo\\\" ><p align=center >PROVEEDOR<br>$selProveedor<br></tr>\";\n\t \techo \"<tr>\";\n\t\t\techo \"<td class=\\\"formularioTablaBotones\\\" colspan=\\\"2\\\"><input name=\\\"btnLimpiar\\\" type=\\\"submit\\\" value=\\\"ELIMINAR\\\">\n\t\t\t</td>\n \t\t</tr>\";\necho \"</table>\";\necho \"</form>\";\t\t\t\t\t\n}", "function setColeccion() {\n $this->query = \"SELECT * FROM PROFESOR\";\n $this->datos = BDConexionSistema::getInstancia()->query($this->query);\n\n for ($x = 0; $x < $this->datos->num_rows; $x++) {\n $this->addElemento($this->datos->fetch_object(\"Profesor\"));\n }\n }", "public function setProducto($pro){ $this->producto = $pro;}", "function Mco_proveedoresManager()\n {\n $this->gateway = Application::getDataGateway(\"mco_proveedores\");\n }", "public function edit(Proveedor $proveedor)\n {\n if ($proveedor->estado == 'activo') {\n $proveedor->estado = 'inactivo';\n }else{\n \n $proveedor->estado = 'activo';\n \n } \n \n $proveedor->save();\n $proveedores = Proveedor::paginate(10);//Llamar a todos los datos contenidos dentro de la tabla proveedor\n return view('proveedor/proveedor',compact('proveedores'))->with('pagina','proveedor');//llamar a la vista del provee\n }", "public function get_reporte_proveedor()\n {\n\t\tif($this->input->post('NombreProveedor_ajaxreporte'))\n\t\t{\n\t\t\t$this->db->like('NombreProveedor', $this->input->post('NombreProveedor_ajaxreporte', TRUE));\n\t\t}\n\t\tif($this->input->post('IdFiscal_ajaxreporte'))\n\t\t{\n\t\t\t$this->db->like('IdFiscal', $this->input->post('IdFiscal_ajaxreporte', TRUE));\n\t\t}\n\t\tif($this->input->post('FechaRegistro_ajaxreporte'))\n\t\t{\n\t\t\t$this->db->like('FechaRegistro', $this->input->post('FechaRegistro_ajaxreporte', TRUE));\n\t\t}\n\n\t\t$this->db->from(\"proveedor\");\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n }", "public function proveedorTraslado(){\n \treturn $this->belongsTo(ProveedorTraslado::class,'proveedor_traslado_id');\n }", "public function store(StoreProveedorRequest $request)\n {//['nombre','estado','celular','direccion']\n $prove = new Proveedor();\n $prove->nombre = $request->input('Nombre');\n $prove->estado = 'activo';\n $prove->celular = $request->input('Telefono');\n $prove->direccion = $request->input('Direccion');\n $prove->save();\n $proveedores = Proveedor::paginate(10);\n return view('proveedor/proveedor',compact('proveedores'))->with('status','Guardado exitoso...!')->with('pagina','proveedor');\n }", "function ListaProveedores() {\n\n\t//obtiene el id del usuario\n\t$sql = \"SELECT * FROM proveedor WHERE estado = 'ACTIVO'\";\n$db = new conexion();\n\t$result = $db->consulta($sql);\n\t$num = $db->encontradas($result);\n\n\t$respuesta->datos = [];\n\t$respuesta->mensaje = \"\";\n\t$respuesta->codigo = \"\";\n\n\tif ($num != 0) {\n\n\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t}\n\n\t\t$respuesta->mensaje = \"Ok\";\n\t\t$respuesta->codigo = 1;\n\t} else {\n\t\t$respuesta->mensaje = \"No existen registros de proveedores!\";\n\t\t$respuesta->codigo = 0;\n\t}\n\n\treturn json_encode($respuesta);\n}", "public function show(ProveedoresModel $proveedor)\n {\n return view('Proveedor.Proveedor', $proveedor);\n }", "public function busca_provincia()\n\t{\n\t\tif($this->input->post('pais_id'))\n\t\t{\n\t\t\techo $this->Select_Dinamico_Model->busca_provincia($this->input->post('pais_id'));\n\t\t}\n\t}", "public function mostrar()\n {\n $clientes=$this->db->get('tab_cliente'); //que es lo mismo que: SELECT * FROM tab_proveedores\n return $clientes->result();\n }", "function addMco_proveedores($PVE_ID,$PVE_NOMBRE,$PVE_DIRECCION,$PVE_TELEFONO,$PVE_CELULAR,$PVE_EMAIL)\n {\n \tif($this->gateway->existMco_proveedores($PVE_ID) == 0){\n $PVE_ID = $this->gateway->maxId();\n $result = $this->gateway->addMco_proveedores($PVE_ID,$PVE_NOMBRE,$PVE_DIRECCION,$PVE_TELEFONO,$PVE_CELULAR,$PVE_EMAIL);\n if($result){\n $this->UnsetRequest();\n return EXITO_OPERACION_REALIZADA;\n }\n else\n {\n return ERROR_OPERACION_NO_REALIZADA;\n }\n }\n else\n { return $this->updateMco_proveedores($PVE_ID,$PVE_NOMBRE,$PVE_DIRECCION,$PVE_TELEFONO,$PVE_CELULAR,$PVE_EMAIL);\n \t//return ERROR_DATO_EXISTE;\n }\n }", "public function readall(){ //read\r\n\r\n $sql=\"select * from proveedor\";\r\n $resul=mysqli_query($this->con(),$sql);\r\n while($row=mysqli_fetch_assoc($resul)){\r\n $this->proveedores[]=$row;\r\n }\r\n return $this->proveedores;\r\n }", "function leer_telefonos($idproveedor){\n\t\t$sql=\"\n\t\tSELECT\n\t\t\tcpt.IDPROVEEDOR,ctsp.DESCRIPCION,\n\t\t\tcpt.CODIGOAREA,\n\t\t\tcpt.NUMEROTELEFONO\n\t\tFROM\n\t\t$this->catalogo.catalogo_proveedor_telefono cpt,\n\t\t$this->catalogo.catalogo_tsp ctsp\n\t\tWHERE\n\t\t\tcpt.IDTSP = ctsp.IDTSP\n\t\t\tAND cpt.IDPROVEEDOR='$idproveedor'\n\t\t\t\";\n\t\t$result = $this->query($sql);\n\t\twhile($reg= $result->fetch_object())\n\t\t{\n\t\t\t$telef[$reg->IDTELEFONO] = array(\n\t\t\t'TSP'=>$reg->DESCRIPCION,\n\t\t\t'CODIGOAREA'=>$reg->CODIGOAREA,\n\t\t\t'NUMEROTELEFONO'=>$reg->NUMEROTELEFONO\n\t\t\t);\n\t\t}\n\t\treturn $telef;\n\t}", "function guardar_producto_proceso($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Valida el tipo de producto: 5-> Receta, 4-> Insumo preparado\n\t\t//$tipo = ($datos['tipo']==1) ? 5 : 4 ;\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tprd_productos_procesos\n\t\t\t\t\t\t(id_producto, id_proceso)\n\t\t\t\tVALUES\n\t\t\t\t\t(\".$datos['id_producto'].\",\".$datos['id_proceso'].\")\";\n\t \t//return $sql;\n\t\t$result =$this->insert_id($sql);\n\n\t\treturn $result;\n\t}", "public function createProducto(){\n $sql='INSERT INTO producto(nombre, precio, descripcion,foto,estado, idCategoria, cantidad, idProveedor,estadoEliminacion) VALUES (?,?,?,?,?,?,?,?,1)';\n $params=array($this->nombre, $this->precio, $this->descripcion, $this->foto, $this->estado, $this->categoria, $this->cantidad, $this->proveedor);\n return Database::executeRow($sql, $params);\n }", "public function getProveedorName($id)\n {\n //Extraer el proveedor del articulo proveedor\n $articuloProveedorProvider = new CActiveDataProvider('ARTICULOPROVEEDOR', array(\n 'criteria' => array(\n 'condition' => 'id='.$id,\n ) ,\n 'pagination'=>array(\n 'pageSize'=>2000,\n ),\n ));\n //Extraer el proveedor del articulo proveedor\n $dProvider = $articuloProveedorProvider->getData();\n $proveedoresProvider = new CActiveDataProvider('PROVEEDORES', array(\n 'criteria' => array(\n 'condition' => 'id='.$dProvider[0]['idProveedor'],\n ) ,\n 'pagination'=>array(\n 'pageSize'=>2000,\n ),\n ));\n //retornar el valor\n $return = $proveedoresProvider->getData();\n return $return[0]['Nombre'];\n }", "public function create()\n {\n $cbd='---Seleccione Distrito---';\n $cbid=\"\";\n $distritos = Distrito::all();\n return view('proveedores.create', [\n 'proveedor' => new Proveedor,\n 'distritos'=> $distritos,\n 'cbid' => $cbid,\n 'cbd' => $cbd\n ]);\n }", "public function getPRODUTOS()\n {\n return $this->hasOne(Produto::className(), ['ID' => 'PRODUTOS_ID']);\n }", "public function buscarCep($objeto){\r\n\t\t$sql = 'SELECT * FROM cep\r\n\t\t\t\t\tINNER JOIN logradouro \tON cep.logradouroID\t= logradouro.logradouroID \r\n\t\t\t\t\tINNER JOIN cidade \t\tON cidade.cidadeId\t= logradouro.cidadeId\r\n\t\t\t\t\tINNER JOIN estado \t\tON estado.estadoId\t= cidade.estadoId\r\n\t\t\t\t\tINNER JOIN pais \t\tON pais.paisId \t\t= estado.paisId\r\n\t\t\t\tWHERE cep.cepNumero = '. $objeto -> getCepNumero();\r\n\t\t$query = mysql_query($sql);\r\n\t\t$qtde = mysql_affected_rows();\r\n\t\t\r\n\t\tif ($qtde == 1) {\r\n\t\t\twhile ($row = mysql_fetch_object($query)){\r\n\t\t\t\t// setado o resultado no objeto\r\n\t\t\t\t$objeto -> setcepId($row -> cepId);\r\n\t\t\t\t$objeto -> setCepNumero($row -> cepNumero);\r\n\t\t\t\t$objeto -> setLogradouroId($row -> logradouroId);\r\n\t\t\t\t$objeto -> setLogradouroNome($row -> logradouroNome);\r\n\t\t\t\t$objeto -> setLogradouroBairro($row -> logradouroBairro);\r\n\t\t\t\t$objeto -> setCidadeId($row -> cidadeId);\r\n\t\t\t\t$objeto -> setCidadeNome($row -> cidadeNome);\r\n\t\t\t\t$objeto -> setEstadoId($row -> estadoId);\r\n\t\t\t\t$objeto -> setEstadoNome($row -> estadoNome);\r\n\t\t\t\t$objeto -> setEstadoUf($row -> estadoUf);\r\n\t\t\t\t$objeto -> setPaisId($row -> paisId);\r\n\t\t\t\t$objeto -> setPaisNome($row -> paisNome);\r\n\t\t\t\treturn $objeto;\r\n\t\t\t}\t\t\t\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public function createNumeroDocumentoProveedor(Request $request){\n\n if($request->user()->can('add_proveedor')) {\n\n $documentoProveedor = DocumentoProveedor::create([\n 'numero' => $request->numero,\n 'tipodocumento_id' => $request->tipodocumento_id,\n 'user_id' => $request->user()->id, //no request\n 'proveedor_id' => $request->provedor_id //no request\n ]);\n if (!$request) {\n ResponseController::set_errors(true);\n ResponseController::set_messages('No has enviado inforamcion para agregar numero de documento');\n return ResponseController::response('BAD REQUEST');\n }\n\n ResponseController::set_messages('Proveedor creado');\n ResponseController::set_data(['proveedor'=>$documentoProveedor->id]);\n return ResponseController::response('OK');\n }\n ResponseController::set_errors(true);\n ResponseController::set_messages('Usuario sin permiso');\n return ResponseController::response('UNAUTHORIZED');\n\n }", "public function dataProveedoresAnual ($id_prod, $id_prov, $fecha_ap_ts) {\n\n $prov = []; //Variable donde se almacenan los datos a responder de la solicitud HTTP\n\n //Busqueda de información basica del proveedor\n $query = DB::select(\n DB::raw(\"SELECT pr.id AS idp, pr.nombre AS prov FROM \n rdj_proveedores pr WHERE pr.id=?\"),\n [$id_prov]);\n\n //Almacenamiento de la info basica en aux\n $prov[\"idp\"] = $query[0]->idp;\n $prov[\"prov\"] = $query[0]->prov;\n \n\n $prov[\"fecha_ap_ts\"] = $fecha_ap_ts;\n\n $prov[\"pedidosCump\"] = DB::select(DB::raw(\"SELECT COUNT(*) FROM rdj_pedidos WHERE\n id_prod_envio=? AND id_prov_envio=? AND fecha_ap_envio=? AND estatus='e'\n GROUP BY estatus,fecha_ap_envio,id_prov_envio,id_prod_envio\"),[$id_prod,$id_prov,$fecha_ap_ts]);\n\n if(sizeof($prov[\"pedidosCump\"]) == 0) {\n $prov[\"pedidosCump\"] = 0;\n }\n else {\n $prov[\"pedidosCump\"] = $prov[\"pedidosCump\"][0]->count;\n }\n \n $prov[\"pedidosRec\"] = DB::select(DB::raw(\"SELECT COUNT(*) FROM rdj_pedidos WHERE\n id_prod_envio=? AND id_prov_envio=? AND fecha_ap_envio=? AND estatus='cprov'\n GROUP BY estatus,fecha_ap_envio,id_prov_envio,id_prod_envio\"),[$id_prod,$id_prov,$fecha_ap_ts]);\n\n if(sizeof($prov[\"pedidosRec\"]) == 0) {\n $prov[\"pedidosRec\"] = 0;\n }\n else {\n $prov[\"pedidosRec\"] = $prov[\"pedidosRec\"][0]->count;\n }\n\n $prov[\"pedidosPend\"] = DB::select(DB::raw(\"SELECT COUNT(*) FROM rdj_pedidos WHERE\n id_prod_envio=? AND id_prov_envio=? AND fecha_ap_envio=? AND estatus='p'\n GROUP BY estatus,fecha_ap_envio,id_prov_envio,id_prod_envio\"),[$id_prod,$id_prov,$fecha_ap_ts]);\n\n if(sizeof($prov[\"pedidosPend\"]) == 0) {\n $prov[\"pedidosPend\"] = 0;\n }\n else {\n $prov[\"pedidosPend\"] = $prov[\"pedidosPend\"][0]->count;\n }\n \n //Devolvemos a la interfaz la data necesaria para continuar\n return response([$prov],200);\n }", "public function pedidos($id)\r\n\t{\r\n\t\t//Carga los datos de pedidos, crear tabla de pedidos\r\n\t\t$this->pedidos = (New Pedidos)->find_by_proveedor_id($id);\r\n\t}", "public function update(Request $request, ProveedoresModel $proveedor)\n {\n //\n }", "function leer_horario($idproveedor){\n\t\t$sql=\"SELECT * FROM catalogo_proveedor_horario WHERE IDPROVEEDOR = '$idproveedor'\";\n\t\t//\t\techo $sql;\n\t\t$result = $this->query($sql);\n\n\t\twhile ($reg = $result->fetch_object())\n\t\t{\n\t\t\t$this->horario = array(\n\t\t\t'HORAINICIO'=>$reg->HORAINICIO,\n\t\t\t'HORAFINAL'=>$reg->HORAFINAL,\n\t\t\t'DOMINGO'=>$reg->DOMINGO,\n\t\t\t'LUNES'=>$reg->LUNES,\n\t\t\t'MARTES'=>$reg->MARTES,\n\t\t\t'MIERCOLES'=>$reg->MIERCOLES,\n\t\t\t'JUEVES'=>$reg->JUEVES,\n\t\t\t'VIERNES'=>$reg->VIERNES,\n\t\t\t'SABADO'=>$reg->SABADO,\n\t\t\t);\n\t\t}\n\t\treturn;\n\t}" ]
[ "0.7329527", "0.72033685", "0.7023036", "0.6996642", "0.68944323", "0.6864452", "0.6864452", "0.6837825", "0.6765021", "0.6744742", "0.6634423", "0.6591746", "0.6589306", "0.6555631", "0.6538108", "0.65228534", "0.65064824", "0.64948326", "0.6491467", "0.64854574", "0.6459801", "0.6399785", "0.6399714", "0.63902706", "0.63605595", "0.6326398", "0.63260764", "0.6319836", "0.630716", "0.62775993", "0.62479854", "0.6206133", "0.6190272", "0.61856604", "0.6135541", "0.6128014", "0.60751516", "0.6064977", "0.6048757", "0.60467887", "0.60160434", "0.6012825", "0.60090446", "0.5995525", "0.59898305", "0.5975726", "0.5961262", "0.59130037", "0.5909913", "0.5898117", "0.58907753", "0.58901656", "0.5882615", "0.58745676", "0.58376974", "0.58075374", "0.5802086", "0.5797622", "0.57714796", "0.5760669", "0.5740953", "0.5730665", "0.5707226", "0.57019377", "0.56970125", "0.56961906", "0.56932414", "0.56495285", "0.5639636", "0.56393707", "0.56357133", "0.5625368", "0.56229097", "0.5619167", "0.5606155", "0.5603144", "0.55837566", "0.558043", "0.5576304", "0.5574039", "0.55706096", "0.5562659", "0.5553224", "0.5541679", "0.55371004", "0.55202556", "0.55110645", "0.55003583", "0.54979163", "0.54918325", "0.5483797", "0.5476809", "0.5473275", "0.54701304", "0.54532266", "0.5448782", "0.5446586", "0.54321766", "0.54140246", "0.5400353" ]
0.7667254
0
Returns the rendered view.
public function render(array $piVars = array()) { $documents = tx_oelib_MapperRegistry ::get('tx_realty_Mapper_RealtyObject')->find($piVars['showUid']) ->getDocuments(); if ($documents->isEmpty()) { return ''; } $result = ''; foreach ($documents as $document) { $link = $this->cObj->typoLink( htmlspecialchars($document->getTitle()), array( 'parameter' => tx_realty_Model_Document::UPLOAD_FOLDER . $document->getFileName(), ) ); $this->setMarker('document_file', $link); $result .= $this->getSubpart('DOCUMENT_ITEM'); } $this->setSubpart('DOCUMENT_ITEM', $result); return $this->getSubpart('FIELD_WRAPPER_DOCUMENTS'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function render()\n\t{\n\t\treturn $this->viewFactory->make($this->view)\n\t\t\t->with( 'presenter', $this )\n\t\t\t->render();\n\t}", "public function render(): mixed\n {\n return $this->view;\n }", "public function getView() {\n return $this->setView();\n }", "public function render()\n {\n $output = '';\n // render the injected views\n if (!empty($this->_views)) {\n foreach ($this->_views as $_view) {\n $output .= $_view->render();\n }\n }\n // render the current view\n $output .= $this->_doRender();\n return $output;\n }", "public function render() {\n\t\t$this->rendered = false;\n\t\tob_start();\n\t\t\t//RENDERING VIEW HERE\n\t\t\trequire_once(\"pages/View/\" . $this->_view);\n\t\t\t$this->content = ob_get_contents();\n\t\tob_end_clean();\n\t\t$this->rendered = true;\n\t\treturn ($this->content);\n\t}", "public function getView()\r\n {\r\n return $this->_controller->getView();\r\n }", "public function render()\n {\n try {\n $this->build();\n } catch (\\Exception $e) {\n return Handler::renderException($e);\n }\n\n return view($this->view, $this->variables())->render();\n }", "protected function getView()\n {\n return $this->view;\n }", "public function getView()\n\t{\n\t\treturn $this->view;\n\t}", "public function view()\n {\n return $this->view;\n }", "public function view()\n {\n return $this->view;\n }", "abstract protected function renderView();", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView()\n {\n return $this->view;\n }", "public function getView() {\n\t\treturn $this->view;\n\t}", "public function getView() {\n\t\treturn $this->view;\n\t}", "public function getView()\r\n {\r\n return $this->view;\r\n }", "public function getView()\n\t{\n\t\treturn $this->_view;\n\t}", "public function getView()\n {\n return $this->_view;\n }", "public function getView()\n {\n return $this->_view;\n }", "public function getView()\n {\n return $this->_view;\n }", "public function getView() {\r\n return $this->_view;\r\n }", "public function getView(){\n\t\treturn $this->view;\n\t}", "public function getView()\n\t{\n\t\tif( !isset( $this->view ) ) {\n\t\t\tthrow new \\Aimeos\\Client\\Html\\Exception( sprintf( 'No view available' ) );\n\t\t}\n\n\t\treturn $this->view;\n\t}", "function getView() {\r\n return $this->view;\r\n }", "protected function getView()\n {\n $this->getBootstrap()->bootstrap('view');\n return $this->getBootstrap()->getResource('view');\n }", "public function __toString()\n {\n $this->rendered = true;\n\n return $this->render($this->view_file, $this->view_data);\n }", "public function getView()\n {\n if (!$this->view) {\n $this->view = Kerisy::$app->get('view');\n $this->view->setDirectory($this->getViewPath());\n }\n return $this->view;\n }", "public function getView()\n\t{\n\t\treturn $this->client->getView();\n\t}", "public function renderView()\n {\n // Is valid record\n $result = $this->prepareRecord();\n if ($result instanceof \\Illuminate\\Http\\RedirectResponse) {\n $this->redirect($result);\n }\n if ($this->contentType == \"json\") {\n $record = $this->Model->toArray();\n // Hook Filter viewModifyRecord\n $record = $this->doFilter(\"viewModifyRecord\", $record);\n // Send Response\n $JsonResponse = new JsonResponse($record, 200);\n $JsonResponse->send();\n exit;\n }\n // Render View\n $parameters = array(\n \"Scaffolding\" => $this,\n );\n $content = view($this->template . \".view\", $parameters)->render();\n return $content;\n }", "public function getView()\n {\n return $this->getService('view');\n }", "public function getView() {\n\t\treturn $this -> st_view;\n\t}", "public function getView()\n {\n $view = App::$locator->view;\n if ($this->layout) {\n $view->setLayout($this->layout);\n }\n \n return $view;\n }", "function getView() {\n\t\treturn $this->View;\n\t}", "function render() \n {\n return View::factory($this->template_path . get_class($this))\n ->set('grid', $this)\n ->render();\n \n }", "public function render() {\n\t\treturn $this->template( 'page' );\n\t}", "public function getView() {\n \t\n \t// Return the current view\n \treturn $this->sView;\n }", "public function render()\n\t{\n\t\t$template = $this->environment->loadTemplate(\\Adhoc\\Locale::file($this->representation));\n\t\treturn $template->render((array)$this->view);\n\t}", "protected function render(){\n //render view\n \n }", "public function getView()\n\t{\n\t\t\n\t\t$parsed = (array)$this->getAsArray();\n\n\t\t$parameters = $this->getParameters();\n\n\t\t$view_array = array_slice($parsed, 0, count($parsed) - count($parameters));\n\t\t\n\t\treturn implode('/', $view_array);\n\n\t}", "public function getView()\n\t{\n\t\tif(NULL === $this->_view) {\n\t\t\t$this->_view = agoractu_view::getInstance();\n\t\t}\n\t\treturn $this->_view;\n\t}", "protected function view()\n {\n return $this->app['view'];\n }", "function render()\n {\n return $this->viewModel->render();\n }", "public function render()\n {\n return $this\n ->blade_instance\n ->view()\n ->make(static::TEMPLATE_NAME, $this->entity_data)\n ->render();\n }", "private function getView()\n {\n if ($this->view) {\n return $this->view;\n }\n\n $this->view = $this->services->get(View::class);\n return $this->view;\n }", "public function render() {\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Executing all modules methods.\" );\n\t\tW2P::getInstance()->modules()->exec_all_functions();\n\t\t\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Generating rendering of the view: {$this->view}\" );\n\t\t\n\t\tob_start ();\n\t\tinclude_once (W2P_INCLUDE . W2P::getInstance()->configuration()->layout_path . '/views/' . $this->view . '.phtml');\n\t\t$this->content = ob_get_clean ();\n\t\t\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Content of the rendered view\" );\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Adding to the project layout\" );\n\t\t\n\t\tinclude (W2P_INCLUDE . W2P::getInstance()->configuration()->layout_path . '/' . $this->layout . '.phtml');\n\t\t\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Layout successfully mastered\" );\n\t\t\n\t\tif (W2P::getInstance()->configuration()->debug)\n\t\t\tW2P::getInstance()->debug()->save_debug ( W2P::getInstance()->configuration()->debug_format );\n\t}", "public function __toString()\n {\n return $this->view->fetch($this->template);\n }", "public function getView() {}", "public function getView() {}", "public function getView()\n {\n if ($this->_view === null) {\n $this->_view = Yii::$app->getView();\n }\n\n return $this->_view;\n }", "public function index()\n\t{\n\t\treturn $this->getView()->render();\n\t}", "public function index()\n {\n return $this->getView()->render();\n }", "public function render(){\n\n if($this->renderedTex){\n\n return $this->renderedTex;\n }\n\n if(!view()->exists($this->stubPath)){\n\n throw new ViewNotFoundException('View ' . $this->stubPath . ' not found.');\n }\n\n \t$this->renderedTex = view($this->stubPath, $this->data)->render();\n\n \treturn $this->renderedTex;\n }", "public function getView()\n\t{\n\t\treturn View::make($this->viewName, [\n\t\t\t'items' => $this->items,\n\t\t]);\n\t}", "public function render()\n {\n return $this->target->render();\n }", "protected function view()\n {\n if (! $this->view) {\n $this->view = Mockery::mock(Factory::class);\n }\n\n return $this->view;\n }", "private function _View() {\n\t \n // $this->_View;\n\t\t\t//$View = ClassRegistry::getObject('');\n\t\treturn $this->_View;\n\t}", "public function render()\n {\n return view(\"layouts.{$this->layout}\");\n }", "final public function render() {\n\t\treturn $this->_view->getBaseView()->element($this->_name, $this->_data, $this->_options);\n\t}", "protected function _render()\n {\n $renderer = $this->param('renderer');\n if ($renderer) {\n return call_user_func($renderer, $this);\n }\n\n ob_start();\n include $this->getTemplateFileName();\n return ob_get_clean();\n }", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}" ]
[ "0.8058752", "0.7948138", "0.7797124", "0.77137196", "0.7698595", "0.76982427", "0.76766634", "0.76019067", "0.7598051", "0.7591253", "0.7591253", "0.75898576", "0.75869364", "0.75869364", "0.75869364", "0.75869364", "0.75869364", "0.75869364", "0.75869364", "0.75869364", "0.7578235", "0.7578235", "0.7567894", "0.74456495", "0.74245405", "0.74245405", "0.74245405", "0.73806804", "0.73690987", "0.734934", "0.73204553", "0.7306653", "0.7283324", "0.7282069", "0.7279244", "0.72684133", "0.72639984", "0.7259954", "0.72515875", "0.7249549", "0.7215598", "0.7194969", "0.711196", "0.71077824", "0.7107468", "0.70789456", "0.707815", "0.70628226", "0.7053607", "0.7033983", "0.70208544", "0.7020545", "0.7010172", "0.700436", "0.700436", "0.7004102", "0.6995942", "0.69854254", "0.69821304", "0.6974159", "0.6973674", "0.6969519", "0.69629365", "0.69622964", "0.6943194", "0.6943156", "0.6925663", "0.6925663", "0.6925663", "0.6925663", "0.6925663", "0.6925663", "0.6925663", "0.6925663", "0.6925663", "0.6925663", "0.6925663", "0.6925663", "0.6925663", "0.6925663", "0.6925663", "0.6925663", "0.6925663", "0.6925584", "0.6925584", "0.6925584", "0.6925584", "0.6925584", "0.6925584", "0.6925584", "0.6925584", "0.6925584", "0.6925584", "0.6925584", "0.6925584", "0.6925584", "0.6925584", "0.6925584", "0.6925584", "0.6925584", "0.6925584" ]
0.0
-1
This function calls the parent data and returns the template to werde_deletecache_admin.tpl
public function render() { parent::render(); return "werde_deletecache_admin.tpl"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function call_admin_template($data = null){\n\t \t\n\t \t$this->load->view('template/admin_template_v', $data);\n\t }", "function doRealDelete()\n {\n /* Query data of this section */\n $this->dbQuerySingle();\n /* Check the presence of GET or POST parameter 'returntoparent'. */\n $this->processReturnToParent();\n /* The function above sets $this->rs to values that shall be\n displayed. By assigning $this->rs to Smarty variable 'section'\n we can fill the values of $this->rs into a template. */\n $this->_smarty->assign('section', $this->rs);\n\n /* Delete the record */\n $this->dbDeleteById();\n /* Delete the corresponding counter */\n $this->dbDeleteCounterById();\n\n /* Left column contains administrative menu */\n $this->_smarty->assign('leftcolumn', \"leftadmin.tpl\");\n }", "function modifyTemplate() {\n if (!$this->isAdmin()) {\n return $this->showStart();\n }\n $entity = 'Template';\n if (isset($_REQUEST['entity'])) {\n $entity = strtolower($_REQUEST['entity']);\n \n }\n $plural = $this->pluralise($entity);\n\n if (isset($_REQUEST['parent_entity']) && isset($_REQUEST['parent_id'])){\n $parent_entity = $_REQUEST['parent_entity'];\n $parent_id = $_REQUEST['parent_id'];\n $conditions = array(strtolower($parent_entity) . '_id' => $parent_id);\n $edit_addition = 'parent_entity='.$parent_entity.'&parent_id='.$parent_id;\n $add_addition = '&' . $edit_addition;\n }\n else {\n $conditions = null;\n $edit_addition = \"id=\";\n $add_addition = \"\";\n }\n\n try {\n $template_list = $this->getListFromDB(strtolower($entity . '_view'), $conditions, null);\n /* make sure unimelb templates are visible in view */\n $properties = array();\n if(count($template_list) > 0 ){\n $properties1 = array_keys(get_object_vars($template_list[0]));\n $properties = str_replace('_', ' ', $properties1);\n \n \n }\n }\n catch(Exception $e) {\n return $this->handle_errors($e);\n }\n $editurl = $this->action . \"?mode=update_item&entity=$entity&\" . $edit_addition ;\n $deleteurl = $this->action . \"?mode=delete&entity=$entity\" . $add_addition;\n $addurl = $this->action . \"?mode=add_item&entity=$entity\" . $add_addition;\n /* screen output*/\n $t = 'admin-list.html';\n $t = $this->twig->loadTemplate($t);\n $output = $t->render(array(\n\t\t\t 'modes' => $this->user_visible_modes,\n\t\t\t 'error' => $this->error,\n\t\t\t 'entity' => $entity,\n\t\t\t 'properties' => $properties,\n\t\t\t 'columns' =>$properties1,\n\t\t\t 'item_list' => $template_list,\n\t\t\t 'addurl' => $addurl,\n\t\t\t 'editurl' => $editurl,\n\t\t\t 'action' => $deleteurl,\n\t\t\t 'plural' => $plural\n\t\t\t ));\n return $output;\n}", "public function view() {\n\t\t\tif ($_SERVER['REQUEST_METHOD'] != 'POST') {\n\t\t\t\t$this->_Result['status'] = Page::HTTP_STATUS_BAD_REQUEST;\n\t\t\t\t$this->_Result['error'] = __('This page accepts posts only');\n\t\t\t\t$this->setHttpStatus($this->_Result['status']);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// _context[0] => entry id to delete\n\t\t\t// _context[1] => fieldId\n\t\t\t// _context[2] => current entry id (parent of entry id to delete)\n\t\t\tif (!is_array($this->_context) || empty($this->_context)) {\n\t\t\t\t$this->_Result['error'] = __('Parameters not found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (count($this->_context) < self::NUMBER_OF_URL_PARAMETERS) {\n\t\t\t\t$this->_Result['error'] = __('Not enough parameters');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (count($this->_context) > self::NUMBER_OF_URL_PARAMETERS) {\n\t\t\t\t$this->_Result['error'] = __('Too many parameters');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate to delete entry ID\n\t\t\t$rawToDeleteEntryId = MySQL::cleanValue($this->_context[0]);\n\t\t\t$toDeleteEntryId = General::intval($rawToDeleteEntryId);\n\t\t\tif ($toDeleteEntryId < 1) {\n\t\t\t\t$this->_Result['error'] = __('No entry no found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate parent field exists\n\t\t\t$parentFieldId = General::intval(MySQL::cleanValue($this->_context[1]));\n\t\t\tif ($parentFieldId < 1) {\n\t\t\t\t$this->_Result['error'] = __('Parent id not valid');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$parentField = FieldManager::fetch($parentFieldId);\n\t\t\tif (!$parentField || empty($parentField)) {\n\t\t\t\t$this->_Result['error'] = __('Parent field not found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate parent entry ID\n\t\t\t$rawEntryId = MySQL::cleanValue($this->_context[2]);\n\t\t\t$entryId = General::intval($rawEntryId);\n\t\t\tif ($entryId < 1) {\n\t\t\t\t$this->_Result['error'] = sprintf(\n\t\t\t\t\t__('Parent entry id `%s` not valid'),\n\t\t\t\t\t$rawEntryId\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate parent entry exists\n\t\t\t$entry = EntryManager::fetch($entryId);\n\t\t\tif ($entry == null || count($entry) != 1) {\n\t\t\t\t$this->_Result['error'] = __('Parent entry not found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (is_array($entry)) {\n\t\t\t\t$entry = $entry[0];\n\t\t\t}\n\t\t\tif ($entry->get('section_id') != $parentField->get('parent_section')) {\n\t\t\t\t$this->_Result['error'] = __('Field and entry do not belong together');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate to delete entry exists\n\t\t\t$toDeleteEntry = EntryManager::fetch($toDeleteEntryId);\n\t\t\tif ($toDeleteEntry == null || count($toDeleteEntry) != 1) {\n\t\t\t\t$this->_Result['error'] = __('Entry not found');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (is_array($toDeleteEntry)) {\n\t\t\t\t$toDeleteEntry = $toDeleteEntry[0];\n\t\t\t}\n\t\t\t\n\t\t\t// Validate entry is not linked anywhere else\n\t\t\tif (!isset($_REQUEST['no-assoc'])) {\n\t\t\t\t//$toDeleteSection = SectionManager::fetch($toDeleteEntry->get('section_id'));\n\t\t\t\t//$toDeleteAssoc = $toDeleteSection->fetchChildAssociations(false);\n\t\t\t\t$toDeleteAssoc = SectionManager::fetchChildAssociations($toDeleteEntry->get('section_id'), false);\n\t\t\t\t//var_dump($toDeleteAssoc);die;\n\t\t\t\t// TODO: find if the toDeleteEntry is linked or not.\n\t\t\t\tif (count($toDeleteAssoc) > 1) {\n\t\t\t\t\t$this->_Result['assoc'] = true;\n\t\t\t\t\t$this->_Result['error'] = __('Entry might be link elsewhere. Do you want to continue?');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Delete the entry\n\t\t\tif (!EntryManager::delete($toDeleteEntryId)) {\n\t\t\t\t$this->_Result['error'] = __('Could not delete the entry');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t$this->_Result['entry-id'] = $entryId;\n\t\t\t$this->_Result['ok'] = true;\n\t\t}", "public function clearCacheCmd($params, \\TYPO3\\CMS\\Core\\DataHandling\\DataHandler $parent) {\n\t\tif ($parent->admin || is_object($parent->BE_USER) && $parent->BE_USER->getTSConfigVal('options.clearCache.pages')) {\n\t\t\tswitch ($params['cacheCmd']) {\n\t\t\t\tcase 'pages':\n\t\t\t\tcase 'all':\n\t\t\t\t\t$this->varnishCacheMgm->clearAllCache();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t}\n\t\t}\n\t}", "public function ajaxClearCache() {\n $this->clearCache();\n $this->_sThisTemplate = \"suaboclearcache_popup.tpl\";\n }", "public function perform( $data = FALSE )\n {\n $this->model->action( 'options','deletePublicCache');\n }", "public function perform( $data = FALSE )\n {\n $this->model->action( 'options','deletePublicCache');\n }", "function outputReloadParentCode()\n {\n global $application;\n\n if ($this -> _ReloadParentWindow != 1)\n return '';\n\n return $this -> mTmplFiller -> fill(\n 'catalog/product_group_edit/',\n 'reload-parent-js.tpl.html',\n array()\n );\n }", "public function delete()\n\t{\n\t\t/* Check permission */\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'template_delete' );\n\n\t\t/* Make sure the user confirmed the deletion */\n\t\t\\IPS\\Request::i()->confirmedDelete();\n\n\t\t$key = \\IPS\\Request::i()->t_key;\n\t\t$return = array(\n\t\t\t'template_content' => NULL,\n\t\t\t'template_id' \t => NULL\n\t\t);\n\t\t\n\t\ttry\n\t\t{\n\t\t\t\\IPS\\cms\\Templates::load( $key )->delete();\n\t\t\t\n\t\t\t/* Now reload */\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$template = \\IPS\\cms\\Templates::load( $key );\n\t\t\t\t\n\t\t\t\t$return['template_location'] = $template->location;\n\t\t\t\t$return['template_content'] = $template->content;\n\t\t\t\t$return['template_id']\t\t = $template->id;\n\t\t\t\t$return['InheritedValue'] = ( $template->user_added ) ? 'custom' : ( $template->user_edited ? 'changed' : 0 );\n\t\t\t}\n\t\t\tcatch( \\OutOfRangeException $ex )\n\t\t\t{\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tcatch( \\OutOfRangeException $ex )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'node_error', '3T285/4', 500, '' );\n\t\t}\n\n\t\t/* Clear guest page caches */\n\t\t\\IPS\\Data\\Cache::i()->clearAll();\n\n\t\tif( \\IPS\\Request::i()->isAjax() )\n\t\t{\n\t\t\t\\IPS\\Output::i()->json( $return );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\\IPS\\Output::i()->redirect( \\IPS\\Http\\Url::internal( 'app=cms&module=pages&controller=templates' ), 'completed' );\n\t\t}\n\t}", "public function cache_delete()\n {\n }", "function call_delete() {\n parent::call_delete();\n }", "public function cleanup() {\r\n $this->clearCache();\r\n $fields = array('id', 'description', 'locked', 'category');\r\n array_push($fields,($this->classKey == 'modTemplate' ? 'templatename' : 'name'));\r\n return $this->success('',$this->object->get($fields));\r\n }", "public function invoice_product_delete()\n {\n $data['nestedView']['pageTitle'] = 'Delete Invoice Product';\n $data['nestedView']['heading'] = \"Delete Invoice Product\";\n $data['nestedView']['cur_page'] = 'Delete Invoice Product';\n $data['nestedView']['parent_page'] = 'date_change';\n $data['nestedView']['list_page'] = 'date_change';\n # Load JS and CSS Files\n $data['nestedView']['js_includes'] = array();\n $data['nestedView']['css_includes'] = array();\n \n # Breadcrumbs\n $data['nestedView']['breadCrumbOptions'] = array( array('label'=>'Home','class'=>'','url'=>SITE_URL));\n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Delete Invoice Product','class'=>'active','url'=>'');\n \n \n\n $data['flag']=1;\n $this->load->view('rollback_invoice/rollback_invoice_product_delete_view',$data);\n }", "public function run(){\n // only for User frontend; cache disable for admin panel\n if($this->tpl == 'menu.php'){\n $menu = Yii::$app->cache->get('menu');\n if($menu) return $menu;\n }\n\n\n// if not, get menu from DB\n// indexBy('id') - make 'key' = 'id' in Array\n// get data from DB\n $this->data = Category::find()->indexBy('id')->asArray()->all();\n// Create Menu Tree\n $this->tree = $this->getTree();\n// Create Html Template for Menu\n $this->menuHtml = $this->getMenuHtml($this->tree);\n\n// set cache, write menu to cache\n if($this->tpl == 'menu.php'){\n Yii::$app->cache->set('menu', $this->menuHtml, 60); // 60 = 1min\n }\n\n return $this->menuHtml;\n\n }", "protected function _content_template() {\n\t}", "protected function content_template() {}", "protected function content_template() {}", "public function delete()\n\t{\n\t\t$db = App\\Db::getInstance();\n\t\t$templateId = $this->getId();\n\t\t$db->createCommand()\n\t\t\t->delete('vtiger_trees_templates', ['templateid' => $templateId])\n\t\t\t->execute();\n\t\t$db->createCommand()\n\t\t\t->delete('vtiger_trees_templates_data', ['templateid' => $templateId])\n\t\t\t->execute();\n\t\t$this->clearCache();\n\t}", "function admin_email_template() {\n\t\t$this->layout=\"admin\";\n\t\tConfigure::write('debug', 0);\n\t\t$staticdatas = $this->EmailTemplate->find('all');\n\t\t//print_r($staticdatas);die;\n\t\t$this->set('manageClass','selected');\n\t\t$this->set(\"staticdatas\",$staticdatas);\n\t}", "protected function content_template() {\n\t}", "function generateTemplateVariableHTML($rec,$cntr) {\n global $_TABLES,$_CONF;\n\n $p = new Template($_CONF['path_layout'] . 'nexflow/admin');\n $p->set_file ('variables','template_variables.thtml');\n $p->set_file ('variable_rec','template_variable_record.thtml');\n\n $p->set_var('template_id',$rec);\n $p->set_var('cntr',$cntr);\n\n $sql = \"SELECT * FROM {$_TABLES['nftemplatevariables']} WHERE nf_templateID='{$rec}' ORDER BY id\";\n $query = DB_Query($sql);\n $numrows = DB_numrows($query);\n if ($numrows > 0) {\n $j=1;\n $p->set_var('show_vars','');\n $p->set_var('vdivid','');\n\n while ( $A = DB_fetchArray($query) ) {\n $edit_link = \"[&nbsp;<a href=\\\"#\\\" onClick='ajaxUpdateTemplateVar(\\\"edit\\\",{$rec},{$cntr},{$j});'\\\">Edit</a>&nbsp;]\";\n $del_link = \"[&nbsp;<a href=\\\"#\\\" onClick='ajaxUpdateTemplateVar(\\\"delete\\\",{$rec},{$cntr},{$j});'\\\">Delete</a>&nbsp;]\";\n $p->set_var('variable_name',$A['variableName']);\n $p->set_var('variable_value',$A['variableValue']);\n $p->set_var('var_id',$j);\n $p->set_var('edit_link',$edit_link);\n $p->set_var('delete_link',$del_link);\n if ($j == 1) {\n $p->parse('template_variable_records','variable_rec');\n } else {\n $p->parse('template_variable_records','variable_rec',true);\n }\n $j++;\n }\n } else {\n $p->set_var('show_vars','none');\n $p->set_var('vdivid',\"vars{$cntr}\");\n $p->set_var('template_variable_records','');\n }\n $p->parse ('output', 'variables');\n $html = $p->finish ($p->get_var('output'));\n $html = htmlentities($html);\n\n return $html;\n}", "function dispEapprvDeleteComment(){\n\t\t$comment_srl = Context::get('comment_srl');\n\n\t\t// if the comment exists, then get the comment information\n\t\tif($comment_srl)\n\t\t{\n\t\t\t$oCommentModel = getModel('comment');\n\t\t\t$oComment = $oCommentModel->getComment($comment_srl, $this->grant->manager);\n\t\t}\n\t\t\n\t\t\t\t// if the comment is not granted, then back to the password input form\n\t\tif(!$oComment->isGranted())\n\t\t{\n\t\t\treturn $this->setTemplateFile('input_password_form');\n\t\t}\n\n\t\tContext::set('oComment',$oComment);\n\t\t/**\n\t\t * add JS filters\n\t\t **/\n\t\tContext::addJsFilter($this->module_path.'tpl/filter', 'delete_comment.xml');\n\t\t$this->setTemplateFile('delete_comment_form');\n\t}", "protected function _content_template() {\n \n }", "public function getAccessMenu($id=0,$dev=0,$deletekey='') {\n $lang = $this->_ci->lang->language['lang'];\n $status = 1;\n $orderby = \"admin_menu_id\";\n $cachetype=2; \n $sql=null;\n $cachekey='Menu-Factory-getAccessMenu-admin_menu_id-'.$id.'-lang-'.$lang;\n $cachetime=60*60*60*1; \n if($cachetype==2){\n /* ############# 2-->cachefile Start############## */ \n $this->CI->load->driver('cache');\n $cache_is_supported=$this->_ci->cache->file->is_supported();\n if($deletekey==1){$deletekeysdata=$this->_ci->cache->file->delete($cachekey);}\n $path=$this->_ci->config->item('cache_path');\n $get_metadata=$this->_ci->cache->file->get_metadata($cachekey);\n $dataresult=$this->_ci->cache->file->get($cachekey);\n if($dataresult){\n $status_msg='form cache file';\n $cache_info=$this->_ci->cache->file->cache_info($cachekey);\n $dataall=array('message'=>'Data form filecache',\n 'status'=>TRUE, \n 'list'=>$dataresult,\n 'count'=>(int)count($dataresult),\n 'cachetime'=>(int)$cachetime,\n 'cachekey'=>$cachekey,\n 'cacheinfo'=>$cache_info); \n $message=$status_msg;\n if($dev==1){\n $data_result=array('data'=>$dataresult,'message'=>$message); \n }else{\n $data_result=$dataresult; \n }\n return $data_result;\n\n }\n elseif(!$dataresult){ \n ###########DB SQL query Start##########\n $query = $this->_ci->db->select(\"*\")->from(\"_admin_access_menu\")->where(array(\"admin_type_id\" => $id))->order_by($orderby, 'ASC')->get();\n //Check if any results were returned\n if ($query->num_rows() > 0) {\n //Create an array to store users\n $users_access = array();\n //Loop through each row returned from the query\n foreach ($query->result() as $row) {\n //Pass the row data to our local function which creates a new user object with the data provided and add it to the users array\n $users_access[] = $row;\n }\n //Return the users array\n }else{ $dataresult=null; }\n $dataresult=$users_access;\n $message='form sql module cache file';\n\n if($dev==1){\n $data_result=array('data'=>$dataresult,'message'=>$message); \n }else{\n $data_result=$users; \n }\n return $data_result;\n }\n ###########DB SQL query End ########### \n }\n else{\n $query = $this->_ci->db->select(\"*\")->from(\"_admin_access_menu\")->where(array(\"admin_type_id\" => $id))->order_by($orderby, 'ASC')->get();\n //Check if any results were returned\n if ($query->num_rows() > 0) {\n //Create an array to store users\n $users_access = array();\n //Loop through each row returned from the query\n foreach ($query->result() as $row) {\n //Pass the row data to our local function which creates a new user object with the data provided and add it to the users array\n $users_access[] = $row;\n }\n //Return the users array\n return $users_access;\n }else{return false; }\n \n }\n }", "protected function _content_template()\n {\n\n }", "public function forTemplate() {\n\t\treturn; \n\t}", "public function rebuild() {\n update_option('responsive_menu_pro_version', '2.8.9');\n\n return $this->view->render(\n 'admin/main.html.twig',\n [\n 'options' => $this->manager->all(),\n 'alert' => ['success' => 'Responsive Menu Pro Database Rebuilt Successfully.']\n ]\n );\n }", "function default_delete(){\n\tglobal $assign_list, $_CONFIG, $_SITE_ROOT, $mod,$log;\n\tglobal $core, $clsModule, $clsButtonNav;\n\t$classTable = \"Setting_Lipe\";\n\t$pkeyTable = \"id\";\n\t//################### CAN NOT MODIFY BELOW CODE ###################\n\t$clsTable = new $classTable();\n\t$pval = isset($_REQUEST[$pkeyTable])? $_REQUEST[$pkeyTable] : \"\";\n\t$c_id = isset($_REQUEST[\"c_id\"])? $_REQUEST[\"c_id\"] : \"\";\n\tif ($pval!=\"\"){\n\t\t$clsTable->deleteOne($pval);\n $log->logThis('DELETE Settting Lipe '.$c_id);\n\t\theader(\"location: ?$_SITE_ROOT&mod=$mod&c_id=$c_id\");\n\t}\n\t$checkList = isset($_REQUEST[\"checkList\"])? $_REQUEST[\"checkList\"] : \"\";\n\tif (is_array($checkList)){\n\t\tforeach ($checkList as $key => $val){\n\t\t\t$clsTable->deleteOne($val);\n\t\t}\n\t\t $username=$_COOKIE['username'];\n\t\t\t\t$actionlog=new ActionLog();\n\t\t\t\t$actionlog->insertValue($username,'Setting Lipe / Delete a lipe ','Course id: '.$c_id);\n\t\theader(\"location: ?$_SITE_ROOT&mod=$mod&c_id=$c_id\");\n\t}\n\tunset($clsTable);\n}", "public function hook_every_page_before_render($projectId = null){\n if(strpos($_SERVER['REQUEST_URI'],'delete_project.php') !== false && $_POST['action'] == 'delete') {\n #Button: Delete the project\n $this->setProjectSetting('email-queue', '');\n }else if(strpos($_SERVER['REQUEST_URI'],'erase_project_data.php') !== false && $_POST['action'] == 'erase_data'){\n #Button: Erase all data\n\n $this->setProjectSetting('email-repetitive-sent', '');\n $this->setProjectSetting('email-records-sent', '');\n $this->setProjectSetting('email-queue', '');\n $this->removeLogs(\"project_id = $projectId and message = 'email-repetitive-sent'\");\n $this->removeLogs(\"project_id = $projectId and message = 'email-records-sent'\");\n $this->removeLogs(\"project_id = $projectId and message = 'email-sent'\");\n $this->removeLogs(\"project_id = $projectId and message = 'email-timestamp-sent'\");\n }else if (\n isset($_REQUEST['route'])\n && isset($_REQUEST['record'])\n && ($_REQUEST['route'] == 'DataEntryController:deleteRecord')\n && ($_REQUEST['record'] != \"\")\n ){\n #Button: Delete record\n\n $record_id = urldecode($_REQUEST['record']);\n\n #Delete email repetitive sent and the list of records before deleting all data\n $email_repetitive_sent = $this->getProjectSetting('email-repetitive-sent');\n $email_repetitive_sent = json_decode($email_repetitive_sent,true);\n $email_records_sent = $this->getProjectSetting('email-records-sent');\n\n if($email_repetitive_sent) {\n foreach ($email_repetitive_sent as $form => $form_value) {\n foreach ($form_value as $alert => $alert_value) {\n foreach ($alert_value as $record => $value) {\n #we delete the found record\n if ($record == $record_id) {\n unset($email_repetitive_sent[$form][$alert][$record]);\n }\n }\n }\n }\n $this->setProjectSetting('email-repetitive-sent', json_encode($email_repetitive_sent));\n }\n if($email_records_sent){\n foreach ($email_records_sent as $index=>$sent){\n $records = array_map('trim', explode(',', $sent));\n foreach ($records as $record){\n if($record == $record_id){\n #Delete list of records sent\n $aux = str_replace(\", \".$record_id,\"\",$email_records_sent[$index], $count);\n if($count == 0){\n $email_records_sent[$index] = str_replace($record_id,\"\",$email_records_sent[$index]);\n }else{\n $email_records_sent[$index] = $aux;\n }\n }else if($record == \"\"){\n #If there are empty values in the string we delete the commas\n $email_records_sent[$index] = str_replace(\", ,\",\",\",$email_records_sent[$index], $count);\n\n }\n }\n }\n $this->setProjectSetting('email-records-sent', $email_records_sent);\n }\n\n $this->removeLogs(\n \"project_id = $projectId and message = 'email-repetitive-sent' \n and record_id='$record_id'\"\n );\n $this->removeLogs(\"project_id = $projectId and message = 'email-records-sent' and value='$record_id'\");\n $this->removeLogs(\"project_id = $projectId and message = 'email-sent' and value='$record_id'\");\n $this->removeLogs(\"project_id = $projectId and message = 'email-timestamp-sent' and value='$record_id'\");\n\n #Delete the queued emails for that record\n $email_queue = $this->getProjectSetting('email-queue');\n $email_queue_aux = $email_queue;\n if($email_queue){\n foreach ($email_queue as $id=>$email){\n if($email['project_id'] == $projectId && $email['record'] == $record_id){\n unset($email_queue_aux[$id]);\n }\n }\n $this->setProjectSetting('email-queue', $email_queue_aux);\n }\n }\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "public function ConfirmSuperadmin($checked_ids, $item_name, $parent_id='', $edit_id='') \n {\n if($item_name=='item') \n $this->data['sub_modules']=$this->CheckSubModuleAccessibility('donation/manage-items');\t \t \n else if($item_name=='image') $this->data['sub_modules']=$this->CheckSubModuleAccessibility('donation/manage-images');\t \t \n \n $this->data['attributes']=$this->Login_model->GetDeletionPopUpAttributes($checked_ids, $item_name, $parent_id);\n \n if($edit_id != '')\n {\n $attributes2 = array('edit_id'=>$edit_id);\n $this->data['attributes']['hidden']=array_merge($this->data['attributes']['hidden'],$attributes2);\n }\n /*\n If you have any additional attribute item wise then you can merge it as follows : \n $attributes2=array('field1'=>'value1','field2'=>'value2');\n $this->data['attributes']['hidden']=array_merge($this->data['attributes']['hidden'],$attributes2);\n If you have any custom message other than common message item wise then assign message to data variable as follows\n Default message\n */\n if($item_name=='item') $this->data['message'] = \"Are you sure you want to delete all selected item(s)\";\n else $this->data['message'] = \"Are you sure you want to delete all selected item(s)\";\n \n $this->adminjavascript->include_admin_js = array('SuperAdminValidationJs');\n $this->admincss->including_css_func = array('PrettyPhotoCss'); \n $this->load->view(admin.'/templates/superadmin-delete',$this->data);\n }", "function ReplaceContentIndex( $data, $template_html )\n{\n $returnval = \"\";\n foreach ($data as $row) {\n //replace fields with values in template\n $content = $template_html;\n\n //haal de info op of de graphic reeds geliked is voeg de klasse toe aan de data\n if (previously_liked($row['gra_id'])) $row['liked'] = 'fas fa-heart';\n else $row['liked'] = 'far fa-heart';\n\n //zorg dat je enkel eigen werk kan verwijderen\n if (IsMe()) {\n $row['action'] = 'lib/deletefile.php';\n $row['delete'] = '<button class=\"deletebutton fa fa-trash\" name=\"deletebutton\" type=\"submit\" value=\"delete\"></button>';\n }\n\n //zorg dat je niet-inloggers geen like button of delete hebben\n if (!isset($_SESSION['use']) or !IsMe()) {\n $row['delete'] = '';\n }\n if (!isset($_SESSION['use'])) $row['permission'] = 'denied';\n\n\n\n foreach ($row as $field => $value) {\n\n //dateformat\n if ($field == 'gra_uploaddate') {\n $new_date = new DateTime($value);\n $value = $new_date->format('F d, Y');\n }\n\n $content = str_replace(\"@@$field@@\", $value, $content);\n }\n $returnval .= $content;\n }\n return $returnval;\n}", "protected function _clearDataCache() {}", "protected function content_template()\n\t{\n\t\t//\n\t}", "public function processaTemplate() {\n return $this->fetch('ricerca_'.$this->_layout.'.tpl');\n }", "public function clearPageCacheContent() {}", "public function ConfirmSuperadmin($checked_ids, $item_name, $parent_id='', $edit_id='') \n {\n if($item_name=='item') \n $this->data['sub_modules']=$this->CheckSubModuleAccessibility('support/manage-items');\t \t \n else if($item_name=='image') $this->data['sub_modules']=$this->CheckSubModuleAccessibility('support/manage-images');\t \t \n \n $this->data['attributes']=$this->Login_model->GetDeletionPopUpAttributes($checked_ids, $item_name, $parent_id);\n \n if($edit_id != '')\n {\n $attributes2 = array('edit_id'=>$edit_id);\n $this->data['attributes']['hidden']=array_merge($this->data['attributes']['hidden'],$attributes2);\n }\n /*\n If you have any additional attribute item wise then you can merge it as follows : \n $attributes2=array('field1'=>'value1','field2'=>'value2');\n $this->data['attributes']['hidden']=array_merge($this->data['attributes']['hidden'],$attributes2);\n If you have any custom message other than common message item wise then assign message to data variable as follows\n Default message\n */\n if($item_name=='item') $this->data['message'] = \"Are you sure you want to delete all selected item(s)\";\n else $this->data['message'] = \"Are you sure you want to delete all selected item(s)\";\n \n $this->adminjavascript->include_admin_js = array('SuperAdminValidationJs');\n $this->admincss->including_css_func = array('PrettyPhotoCss'); \n $this->load->view(admin.'/templates/superadmin-delete',$this->data);\n }", "function templatesrecache()\n\t{\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$justdone = intval( $this->ipsclass->input['justdone'] );\n\t\t$justdone = $justdone ? $justdone : 1;\n\t\t\n\t\t$s = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'skin_sets',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => 'set_skin_set_id > '.$justdone,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'order' => 'set_skin_set_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'limit' => array( 0, 1 ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t )\t\t );\n\t\t\n\t\tif ( $s['set_skin_set_id'] )\n\t\t{\n\t\t\t$this->ipsclass->cache_func->_rebuild_all_caches( array( $s['set_skin_set_id'] ) );\n\t\t\t\n\t\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}&amp;justdone={$s['set_skin_set_id']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />Rebuilt the '{$s['set_name']}' skin cache...\" );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ipsclass->input['step']++;\n\t\t\t\t\t\t\n\t\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />No more skins to rebuild...\" );\n\t\t}\n\t}", "function arvan_total_purge_ajax(){\n \n \n if ( current_user_can( 'manage_options' ) ) {\n \n /**\n * Making Purge request URL\n */\n $arvan_url = Redux::get_option( $this->opt_name, 'arvan-cache-endpoint-url');\n $domain = Redux::get_option( $this->opt_name, 'arvan-domain');\n $full_url = $arvan_url . $domain . '/caching';\n \n if(empty($arvan_url)){\n wp_send_json_error(array(\"message\"=>\"Endpoint url is empty\"));\n return;\n }\n\n $full_url .= '?purge=all';\n \n $arvan_api_key = Redux::get_option( $this->opt_name, 'arvan-api-key');\n \n if(empty($arvan_api_key)){\n wp_send_json_error(array(\"message\"=>\"API Key is empty\"));\n return;\n }\n\n $response = wp_remote_get( $full_url, array(\n 'method' => 'DELETE',\n 'blocking' => true,\n 'headers' => array('Authorization' => $arvan_api_key),\n )\n );\n \n if ( is_wp_error( $response ) ) {\n\n $error_message = $response->get_error_message();\n return \"Something went wrong: $error_message\";\n\n }else{\n\n if(!isset($response['body']))\n return;\n \n $response_object = json_decode($response['body']);\n /**\n * Send a successful response to client JS\n */\n wp_send_json_success($response_object);\n \n }\n }\n\n }", "function index()\n{\n $this->load->module('site_security');\n $this->site_security->_make_sure_is_admin();\n\n $data['query'] = $this->get('date');\n \n $data['flash'] = $this->session->flashdata('delete');\n $data['headline'] = 'Blog';\n $data['view_module'] = 'blog';\n $data['view_file'] = 'manage';\n $this->load->module('templates');\n $this->templates->admin($data);\n}", "public function delete_invoice()\n {\n $data['nestedView']['pageTitle'] = 'Invoice Delete';\n $data['nestedView']['heading'] = \"Invoice Delete\";\n $data['nestedView']['cur_page'] = 'Invoice Delete';\n $data['nestedView']['parent_page'] = 'date_change';\n $data['nestedView']['list_page'] = 'date_change';\n # Load JS and CSS Files\n $data['nestedView']['js_includes'] = array();\n $data['nestedView']['css_includes'] = array();\n \n # Breadcrumbs\n $data['nestedView']['breadCrumbOptions'] = array( array('label'=>'Home','class'=>'','url'=>SITE_URL));\n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Date Change','class'=>'active','url'=>'');\n \n \n\n $data['flag']=1;\n $this->load->view('rollback_invoice/rollback_invoice_delete_view',$data);\n }", "public function potensi_desa(){\n\t\t$data['parent'] = 'master';\n $data['child'] = 'potensi_desa';\n $data['grand_child'] = '';\n $this->load->view('admin/template/header',$data);\n $this->load->view('admin/master/potensi_desa',$data);\n $this->load->view('admin/template/footer');\n\t}", "function parent_edit_view($param1 = '')\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['code'] = $param1;\n $page_data['page_name'] = 'parent_edit';\n $page_data['page_title'] = get_phrase('edit_parent');\n $this->load->view('backend/index', $page_data);\n }", "function display(){\n $cacheRowFile = sugar_cached('modules/') . $this->module_dir . '/collections/'.$this->viewtype. $this->name .'_'. count($this->count_values) . '.tpl';\n if(!$this->checkTemplate($cacheRowFile)){\n $dir = dirname($cacheRowFile);\n if(!file_exists($dir)) {\n\n mkdir_recursive($dir, null, true);\n }\n $cacheRow = $this->ss->fetch($this->findTemplate('Collection'.$this->viewtype.'Row'));\n\n file_put_contents($cacheRowFile, $cacheRow);\n }\n $this->ss->assign('cacheRowFile', $cacheRowFile); \n return $this->ss->fetch($cacheRowFile);\n }", "public function finalize() {\n\n\t\t// template debug\n\t\tif ($this->config) {\n\t\t\tif ($this->config->get('storefront_template_debug')) {\n\t\t\t\t// storefront enabling\n\t\t\t\tif (!IS_ADMIN && !isset($this->session->data['tmpl_debug']) && isset($this->request->get['tmpl_debug'])) {\n\t\t\t\t\t$this->session->data['tmpl_debug'] = isset($this->request->get['tmpl_debug']);\n\t\t\t\t}\n\n\t\t\t\tif ((isset($this->session->data['tmpl_debug']) && isset($this->request->get['tmpl_debug'])) && ($this->session->data['tmpl_debug'] == $this->request->get['tmpl_debug'])) {\n\n\t\t\t\t\t$block_details = $this->layout->getBlockDetails($this->instance_id);\n\t\t\t\t\t$excluded_blocks = array( 'common/head' );\n\n\t\t\t\t\tif (!empty($this->instance_id) && (string)$this->instance_id != '0' && !in_array($block_details['controller'], $excluded_blocks)) {\n\t\t\t\t\t\tif (!empty($this->parent_controller)) {\n\t\t\t\t\t\t\t//build block template file path based on primary template used\n\t\t\t\t\t\t\t//template path is based on parent block 'template_dir'\n\t\t\t\t\t\t\t$tmp_dir = $this->parent_controller->view->data['template_dir'].\"template/\";\n\t\t\t\t\t\t\t$block_tpl_file = $tmp_dir.$this->view->getTemplate();\n\t\t\t\t\t\t\t$prt_block_tpl_file = $tmp_dir.$this->parent_controller->view->getTemplate();\n\t\t\t\t\t\t\t$args = array( 'block_id' => $this->instance_id,\n\t\t\t\t\t\t\t\t\t\t\t'block_controller' => $this->dispatcher->getFile(),\n\t\t\t\t\t\t\t\t\t\t\t'block_tpl' => $block_tpl_file,\n\t\t\t\t\t\t\t\t\t\t\t'parent_id' => $this->parent_controller->instance_id,\n\t\t\t\t\t\t\t\t\t\t\t'parent_controller' => $this->parent_controller->dispatcher->getFile(),\n\t\t\t\t\t\t\t\t\t\t\t'parent_tpl' => $prt_block_tpl_file\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$debug_wrapper = $this->dispatch('common/template_debug', array( 'instance_id' => $this->instance_id, 'details' => $args ));\n\t\t\t\t\t\t\t$debug_output = $debug_wrapper->dispatchGetOutput();\n\t\t\t\t\t\t\t$output = trim($this->view->getOutput());\n\t\t\t\t\t\t\tif (!empty($output)) $output = '<span class=\"block_tmpl_wrapper\">' . $output . $debug_output . '</span>';\n\t\t\t\t\t\t\t$this->view->setOutput($output);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tunset($this->session->data['tmpl_debug']);\n\t\t\t}\n\t\t}\n\t\t$this->view->render();\n\t}", "public function render()\n\t{\n\t\t$template = $this->template;\n\t\t$template->setFile( __DIR__ . '/dataGrid.latte' );\n\n\t\t$template->grid = $this;\n\t\t$template->stencils = $this->stencils;\n\t\t$template->actionWidth = $this->actionWidth;\n\t\t$template->actitle = $this->actitle;\n\t\t$template->acfooter = $this->acfooter;\n\t\t$template->cmd = self::CMD;\n\t\t$template->labels = $this->labels;\n\t\t$template->columns = $this->columns;\n\t\t$template->key = $this->key;\n\t\t$template->isSorting = $this->isSorting();\n\t\t$template->isFiltering = $this->isFiltering();\n\t\t$template->isAdding = $this->isAdding();\n\t\t$template->isRemoving = $this->isRemoving();\n\t\t$template->isEditing = $this->isEditing();\n\t\t$template->hasActions = $this->hasActions();\n\t\t$template->sortable = $this->sortable;\n\t\t$template->sorting = $this->sorting;\n\t\t$template->filtering = $this->filtering;\n\t\t$template->id = $this->id;\n\t\t$template->pgbtn = $this->getPagerButtons();\n\t\t$template->currentPage = $this->getCurrentPage();\n\t\t$template->rowsPerPage = $this->getRowsPerPage();\n\t\t$template->pageCount = $this->getPageCount();\n\n\t\tif ( count( $this->dataSnippet ) ) $template->data = $this->dataSnippet;\n\t\telse $template->data = $this->getData();\n\n\t\t$template->render();\n\t}", "function displayDeleteScreen()\t{\n\t\t$pluginId=$conf['pluginId'];\n\t\t$content=\"feal : displayDeleteScreen unset content\";\n\t\tif ($this->conf['delete'])\t{\t// If deleting is enabled\n\t\t\t$origArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable, $this->recUid);\n\t\t\tif (($GLOBALS['TSFE']->loginUser && $this->conf['requireLogin']) || ($this->aCAuth($origArr) && $this->conf['requireLogin']) || !$this->conf['requireLogin'])\t{\t// Must be logged in OR be authenticated by the aC code in order to delete\n\t\t\t\t\t// If the recUid selects a record.... (no check here)\n\t\t\t\t\t\n\t\t\t\tif (is_array($origArr))\t{\n\n\t\t\t\t\tif ($this->aCAuth($origArr) || $this->metafeeditlib->DBmayFEUserEdit($this->theTable,$origArr, $GLOBALS['TSFE']->fe_user->user,$this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$this->conf))\t{\t// Display the form, if access granted.\n\t\t\t\t\t\t$this->markerArray['###HIDDENFIELDS###'].= '<input type=\"hidden\" name=\"rU['.$pluginId.']\" value=\"'.$this->recUid.'\" />';\n\t\t\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_DELETE_PREVIEW###', $origArr);\n\t\t\t\t\t} else {\t// Else display error, that you could not edit that particular record...\n\t\t\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_NO_PERMISSIONS###');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$content='Object already deleted';\n\t\t\t\t}\n\t\t\t} else {\t// Finally this is if there is no login user. This must tell that you must login. Perhaps link to a page with create-user or login information.\n\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_AUTH###');\n\t\t\t}\n\t\t} else {\n\t\t\t$content='Delete-option is not set in TypoScript';\n\t\t}\n\t\t$content=$content?$content:'No template for delete screen';\n\t\treturn $content;\n\t}", "public function clearServerCache()\n {\n return view('pilot::admin.clear.cache');\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "public function rollback_invoice_delete()\n {\n $data['nestedView']['pageTitle'] = 'Invoice Delete Details';\n $data['nestedView']['heading'] = \"Invoice Delete Details\";\n $data['nestedView']['cur_page'] = 'Invoice Delete Details';\n $data['nestedView']['parent_page'] = 'date_change';\n $data['nestedView']['list_page'] = 'date_change';\n # Load JS and CSS Files\n $data['nestedView']['js_includes'] = array();\n $data['nestedView']['css_includes'] = array();\n \n # Breadcrumbs\n $data['nestedView']['breadCrumbOptions'] = array( array('label'=>'Home','class'=>'','url'=>SITE_URL));\n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Invoice Delete','class'=>'active','url'=>SITE_URL.'delete_invoice'); \n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Invoice Delete Details','class'=>'active','url'=>'');\n\n $invoice_number=$this->input->post('invoice_id',TRUE);\n $invoice_id=$this->Rollback_invoice_m->get_invoice_id($invoice_number);\n $count_receipt_invoice = $this->Common_model->get_data('receipt_invoice',array('invoice_id'=>$invoice_id));\n $count_gatepass = $this->Common_model->get_data('gatepass_invoice',array('invoice_id'=>$invoice_id));\n if(count($count_receipt_invoice)>0 || count($count_gatepass)>0)\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice is involved in Gatepass/StockReceiving. Please Check! </div>');\n redirect(SITE_URL.'delete_invoice'); exit();\n }\n $invoice_type=$this->Rollback_invoice_m->get_invoice_type($invoice_id);\n if($invoice_type['type'] == 2)\n {\n \n $invoice_plant_products=$this->Rollback_invoice_m->get_invoice_do_product($invoice_id);\n \n if(count($invoice_plant_products)!='')\n {\n \n foreach($invoice_plant_products as $key => $value)\n {\n $results['invoice_date']=$value['invoice_date'];\n $results['vehicle_number']=$value['vehicle_number'];\n $results['from']=$value['from'];\n $results['to']=$value['to'];\n $results['invoice_number']=$value['invoice_number'];\n $results['invoice_id']=$value['invoice_id'];\n \n }\n //echo \"<pre>\"; print_r($invoice_plant_products); exit;\n $col=array_column($invoice_plant_products,'amount');\n $sum=array_sum($col);\n $data['sum']=$sum;\n $inv_dos= $this->Rollback_invoice_m->get_invoice_dos($invoice_id);\n $inv_obs= $this->Rollback_invoice_m->get_invoice_obs($invoice_id);\n foreach ($inv_dos as $value)\n {\n $d[]=$value['do_number'];\n $do_date[] =date('d-m-Y',strtotime($value['do_date']));\n } \n $data['inv_dos'] =implode(', ',$d);\n $data['inv_do_dates'] =implode(', ',$do_date);\n $data['tin_num']=37280114257;\n foreach ($inv_obs as $value) \n {\n $ob[]=$value['order_number'];\n $ob_date[] =date('d-m-Y',strtotime($value['order_date']));\n }\n \n $data['inv_obs'] =implode(', ',$ob);\n $data['inv_ob_dates'] =implode(', ',$ob_date);\n $data['results']=$results;\n $data['invoice_plant_product']=$invoice_plant_products;\n $data['flag']=3;\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'delete_invoice');\n }\n }\n elseif($invoice_type['type']== 1)\n {\n $invoice_dist_products=$this->Rollback_invoice_m->get_invoice_do_distributor_product($invoice_id);\n \n if(count($invoice_dist_products)!='')\n {\n foreach($invoice_dist_products as $key => $value)\n {\n $results['invoice_date']=$value['invoice_date'];\n $results['distributor_code']=$value['distributor_code'];\n $results['tin_num']=$value['vat_no'];\n $results['mobile']=$value['mobile'];\n $results['vehicle_number']=$value['vehicle_number'];\n $results['amount']=$value['amount'];\n $results['agency_name']=$value['agency_name'];\n $results['address']=$value['address'];\n $results['lifting']=$value['lifting'];\n $results['location']=$value['distributor_place'];\n $results['invoice_number']=$value['invoice_number'];\n $results['invoice_id']=$value['invoice_id'];\n \n }\n $col=array_column($invoice_dist_products,'amount');\n $sum=array_sum($col);\n $data['sum']=$sum;\n $inv_dos= $this->Rollback_invoice_m->get_invoice_dos($invoice_id);\n $inv_obs= $this->Rollback_invoice_m->get_invoice_obs($invoice_id);\n foreach ($inv_dos as $value)\n {\n $d[]=$value['do_number'];\n $do_date[] =date('d-m-Y',strtotime($value['do_date']));\n } \n $data['inv_dos'] =implode(', ',$d);\n $data['inv_do_dates'] =implode(', ',$do_date);\n\n foreach ($inv_obs as $value) \n {\n $ob[]=$value['order_number'];\n $ob_date[] =date('d-m-Y',strtotime($value['order_date']));\n }\n \n $data['inv_obs'] =implode(', ',$ob);\n $data['inv_ob_dates'] =implode(', ',$ob_date);\n $data['results']=$results;\n $data['invoice_dist_product']=$invoice_dist_products;\n $data['flag']=2;\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'delete_invoice');\n }\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'delete_invoice');\n }\n \n \n \n $this->load->view('rollback_invoice/rollback_invoice_delete_view',$data);\n }", "public function initContent() {\n $this->initTabModuleList();\n $this->initToolbar();\n $this->initPageHeaderToolbar();\n\n if ($this->display == 'edit' || Tools::getValue('display') == 'formPlayer') {\n if (!$this->loadObject(true)) {\n return;\n }\n $this->content = $this->renderForm();\n $this->content.= $this->generateListPlayerLevels();\n $this->content.= $this->generateListPlayerHistory();\n $deletePlayers = false;\n }\n elseif (Tools::isSubmit('addCustomAction')) {\n $this->content = $this->generateFormCustomAction();\n $deletePlayers = false;\n }\n else {\n $this->content = $this->renderList();\n $deletePlayers = true;\n }\n\n // This are the real smarty variables\n $this->context->smarty->assign(\n array(\n 'content' => $this->content,\n 'tab' => 'Players',\n 'loyalty_name' => Configuration::get('krona_loyalty_name', $this->context->language->id, $this->id_shop_group, $this->id_shop),\n 'import' => Configuration::get('krona_import_customer', null, $this->id_shop_group, $this->id_shop),\n 'dont' => Configuration::get('krona_dont_import_customer', null, $this->id_shop_group, $this->id_shop),\n 'deletePlayers' => $deletePlayers,\n 'show_page_header_toolbar' => $this->show_page_header_toolbar,\n 'page_header_toolbar_title' => $this->page_header_toolbar_title,\n 'page_header_toolbar_btn' => $this->page_header_toolbar_btn,\n )\n );\n\n $tpl = $this->context->smarty->fetch(_PS_MODULE_DIR_ . 'genzo_krona/views/templates/admin/main.tpl');\n\n $this->context->smarty->assign(array(\n 'content' => $tpl, // This seems to be anything inbuilt. It's just chance that we both use content as an assign variable\n ));\n\n }", "function delAdminHandler() {\n global $inputs;\n $sql = \"DELETE FROM `admin` WHERE id = \" . $inputs['id'];\n execSql($sql);\n formatOutput(true, 'delete success');\n}", "public function ConfirmDelete($checked_id, $item_name, $parent_id = '', $edit_id = '') \n {\n $this->adminjavascript->include_admin_js = array('ConfirmDeleteJs');\n \n if($item_name=='item') \n $this->data['sub_modules']=$this->CheckSubModuleAccessibility('donation/manage-items');\t \t \n \n $this->data['attributes']=$this->Login_model->GetDeletionPopUpAttributes($checked_id, $item_name, $parent_id);\n if($edit_id != '')\n {\n $attributes2 = array('edit_id' => $edit_id);\n $this->data['attributes']['hidden'] = array_merge($this->data['attributes']['hidden'],$attributes2);\n }\n /*\n If you have any additional attribute item wise then you can merge it as follows : \n $attributes2=array('field1'=>'value1','field2'=>'value2');\n $this->data['attributes']['hidden']=array_merge($this->data['attributes']['hidden'],$attributes2);\n If you have any custom message other than common message item wise then assign message to data variable as follows\n Default message\n */\n if($item_name == \"donation_image_delete\")\n {\n\t$this->data['message']=\"Are you sure want to delete this image.\";\n }\n elseif($item_name == \"remove_clone\")\n {\n $this->data['sub_modules']=$this->CheckSubModuleAccessibility('donation/manage-donation');\t \t \n\t$this->data['message']=\"Are you sure want to unlink this donation from selected donation.\";\n }\n else\n {\n $this->data['message'] = \"Are you sure you want to delete selected items\";\n }\n $this->load->view(admin.'/templates/confirm-delete',$this->data);\n }", "public function admincp_index(){\n\t\tpermission_force_check('r');\n\t\t$default_func = 'created';\n\t\t$default_sort = 'DESC';\n\t\t$data = array(\n\t\t\t'module'=>$this->module,\n\t\t\t'module_name'=>$this->session->userdata('Name_Module'),\n\t\t\t'default_func'=>$default_func,\n\t\t\t'default_sort'=>$default_sort\n\t\t);\n\t\t$this->template->write_view('content','BACKEND/index',$data);\n\t\t$this->template->render();\n\t}", "public function ConfirmDelete($checked_id, $item_name, $parent_id = '', $edit_id = '') \n {\n $this->adminjavascript->include_admin_js = array('ConfirmDeleteJs');\n \n if($item_name=='item') \n $this->data['sub_modules']=$this->CheckSubModuleAccessibility('support/manage-items');\t \t \n \n $this->data['attributes']=$this->Login_model->GetDeletionPopUpAttributes($checked_id, $item_name, $parent_id);\n if($edit_id != '')\n {\n $attributes2 = array('edit_id' => $edit_id);\n $this->data['attributes']['hidden'] = array_merge($this->data['attributes']['hidden'],$attributes2);\n }\n /*\n If you have any additional attribute item wise then you can merge it as follows : \n $attributes2=array('field1'=>'value1','field2'=>'value2');\n $this->data['attributes']['hidden']=array_merge($this->data['attributes']['hidden'],$attributes2);\n If you have any custom message other than common message item wise then assign message to data variable as follows\n Default message\n */\n if($item_name == \"support_image_delete\")\n {\n\t$this->data['message']=\"Are you sure want to delete this image.\";\n }\n elseif($item_name == \"remove_clone\")\n {\n $this->data['sub_modules']=$this->CheckSubModuleAccessibility('support/manage-support');\t \t \n\t$this->data['message']=\"Are you sure want to unlink this support from selected support.\";\n }\n else\n {\n $this->data['message'] = \"Are you sure you want to delete selected items\";\n }\n $this->load->view(admin.'/templates/confirm-delete',$this->data);\n }", "public function delete_builder_template($name = \"%\")\n\t\t{\n\t\t check_ajax_referer('avia_nonce_save','avia-save-nonce');\n\t\t\n $name = isset($_POST['templateName']) ? $_POST['templateName'] : $name;\n $id = AviaStoragePost::get_custom_post('template_builder_snippets');\n\n \n $key = $this->generate_key($name);\n $result = delete_post_meta($id, $key);\n echo 'avia_template_deleted';\n die();\n\t\t}", "public function display($template = null, $cache_id = null, $compile_id = null, $parent = null)\n {\n if(empty($template) === true)\n $template = $this->_template_file;\n \n try {\n parent::display($template, $cache_id, $compile_id, $parent);\n } catch(\\SmartyException $e) {\n $template_file = $this->_template_file;\n $error = $e->getMessage();\n \\dcms\\Log::write(\"Could not display template $template_file! ($error)\", null, 3);\n }\n }", "public function renderRowStorageMenu($entry)\n {\n\n if (false === $this->flags->s_delete)\n return '';\n\n $html = <<<CODE\n <button\n onclick=\"\\$R.del('{$this->urlStorageDelete}{$this->defAction}&objid={$entry['storage_id']}',{confirm:'Confirm to delete.'});\"\n class=\"wgt-button\"\n tabindex=\"-1\" ><i class=\"fa fa-times\" ></i></button>\nCODE;\n\n return $html;\n\n }", "protected function template() {\n\t\treturn '';\n\t}", "public function index( $args ) {\n\t\t// Get database and table.\n\t\t$db = new \\WordPress\\CMS\\DB\\Database( $this->wpdb );\n\t\t$table = $db->get_table( $args['table'] );\n\n\t\t// Give it all to the template.\n\t\t$template = $this->get_template( $table );\n\t\tif ( isset( $args['ident'] ) ) {\n\t\t\t$template->record = $table->get_record( $args['ident'] );\n\t\t\t// Check permission.\n\t\t\tif ( ! Grants::current_user_can( Grants::UPDATE, $table->get_name() ) ) {\n\t\t\t\t$template->add_notice( 'error', 'You do not have permission to update data in this table.' );\n\t\t\t}\n\t\t}\n\t\tif ( ! isset( $template->record ) || false === $template->record ) {\n\t\t\t$template->record = $table->get_default_record();\n\t\t\t// Check permission.\n\t\t\tif ( ! Grants::current_user_can( Grants::CREATE, $table->get_name() ) ) {\n\t\t\t\t$template->add_notice( 'error', 'You do not have permission to create records in this table.' );\n\t\t\t}\n\t\t\t// Add query-string values.\n\t\t\tif ( isset( $args['defaults'] ) ) {\n\t\t\t\t$template->record->set_multiple( $args['defaults'] );\n\t\t\t}\n\t\t}\n\t\t// Don't save to non-updatable views.\n\t\tif ( ! $table->is_updatable() ) {\n\t\t\t$template->add_notice( 'error', \"This table can not be updated.\" );\n\t\t}\n\n\t\t// Enable postboxes (for the history and related tables' boxen).\n\t\twp_enqueue_script( 'dashboard' );\n\n\t\t// Return to URL.\n\t\tif ( isset( $args['return_to'] ) ) {\n\t\t\t$template->return_to = $args['return_to'];\n\t\t}\n\n\t\treturn $template->render();\n\t}", "function admin_template($content=\"\",$titlebar=\"\",$titlepage=\"\",$user=\"\",$menu=\"\",$plugin=\"\"){\n \n $titlebar = ($titlebar!=\"\") ? $titlebar : \"\";\n\t$titlepage = ($titlepage!=\"\") ? $titlepage : \"\";\n $plugin\t = ($plugin!=\"\") ? $plugin : \"\";\n $menu\t = ($menu!=\"\") ? $menu : \"\";\n $content\t= ($content!=\"\") ? $content : \"\";\n\n \n$menu = '\n<div class=\"menu-bar header-sm-height\" data-pages-init=\\'horizontal-menu\\' data-hide-extra-li=\"0\">\n <a href=\"#\" class=\"btn-link toggle-sidebar hidden-lg-up pg pg-close\" data-toggle=\"horizontal-menu\">\n </a>\n <ul>\n <li class=\" active\">\n <a href=\"home.php\">Dashboard</a>\n </li>\n <li>\n <a href=\"list_member.php\"><span class=\"title\">Members</span></a>\n </li>\n <li>\n <a href=\"javascript:;\"><span class=\"title\">Products</span>\n <span class=\" arrow\"></span></a>\n <ul class=\"\">\n <li class=\"\">\n <a href=\"list_products.php\">List Products</a>\n </li>\n <li class=\"\">\n <a href=\"list_categories.php\">List Categories</a>\n </li>\n\t\t\t\t<li class=\"\">\n <a href=\"list_sub_categories.php\">Sub Categories</a>\n </li>\n \n \n </ul>\n </li>\n \n <li class=\"\">\n <a href=\"list_transaction.php\">List Transaction</a>\n </li>\n \n </li>\n\t\t\t<li>\n <a href=\"javascript:;\"><span class=\"title\">Pages</span>\n <span class=\" arrow\"></span></a>\n <ul class=\"\">\n <li class=\"\">\n <a href=\"about_us.php\">About Us</a>\n </li>\n <li class=\"\">\n <a href=\"production.php\">Production</a>\n </li>\n\t\t\t\t<li class=\"\">\n <a href=\"buyers_guide.php\">Buyers Guide</a>\n </li>\n\t\t\t\t<li class=\"\">\n <a href=\"custom_guide.php\">Custom Guide</a>\n </li>\n\t\t\t\t<li class=\"\">\n <a href=\"payment_guide.php\">Payment Guide</a>\n </li>\n </ul>\n </li>\n\t\t\t<li>\n <a href=\"list_contact_us.php\">Incoming Contact Us</a>\n </li>\n \n </ul>\n <a href=\"#\" class=\"search-link d-flex justify-content-between align-items-center hidden-lg-up\" data-toggle=\"search\">Tap here to search <i class=\"pg-search float-right\"></i></a>\n </div>\n';\n \n \n$template = '\n<!DOCTYPE html>\n<html>\n <head>\n <meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\n <meta charset=\"utf-8\" />\n <title>'.$titlebar.' Seagods Wetsuit</title>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no\" />\n <link rel=\"apple-touch-icon\" href=\"pages/ico/60.png\">\n <link rel=\"apple-touch-icon\" sizes=\"76x76\" href=\"pages/ico/76.png\">\n <link rel=\"apple-touch-icon\" sizes=\"120x120\" href=\"pages/ico/120.png\">\n <link rel=\"apple-touch-icon\" sizes=\"152x152\" href=\"pages/ico/152.png\">\n <link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\" />\n <meta name=\"apple-mobile-web-app-capable\" content=\"yes\">\n <meta name=\"apple-touch-fullscreen\" content=\"yes\">\n <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"default\">\n <meta content=\"\" name=\"description\" />\n <meta content=\"\" name=\"author\" />\n <link href=\"assets/plugins/pace/pace-theme-flash.css\" rel=\"stylesheet\" type=\"text/css\" />\n <link href=\"assets/plugins/bootstrap/css/bootstrap.min.css\" rel=\"stylesheet\" type=\"text/css\" />\n <link href=\"assets/plugins/font-awesome/css/font-awesome.css\" rel=\"stylesheet\" type=\"text/css\" />\n <link href=\"assets/plugins/jquery-scrollbar/jquery.scrollbar.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\n <link href=\"assets/plugins/select2/css/select2.min.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\n <link href=\"assets/plugins/switchery/css/switchery.min.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\n <link href=\"pages/css/pages-icons.css\" rel=\"stylesheet\" type=\"text/css\">\n <link class=\"main-stylesheet\" href=\"pages/css/pages.css\" rel=\"stylesheet\" type=\"text/css\" />\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"assets/css/paging.css\">\n\t\n\n\t\n\n\t'.$plugin.'\n </head>\n <body class=\"fixed-header horizontal-menu horizontal-app-menu dashboard\">\n <!-- START HEADER -->\n <div class=\"header\">\n <div class=\"container\">\n <div class=\"header-inner header-md-height\">\n <a href=\"#\" class=\"btn-link toggle-sidebar hidden-lg-up pg pg-menu\" data-toggle=\"horizontal-menu\">\n </a>\n <div class=\"\">\n <a href=\"#\" class=\"search-link hidden-md-down\" data-toggle=\"search\"></a>\n </div>\n <div class=\"d-flex align-items-center\">\n <!-- START User Info-->\n <div class=\"pull-left p-r-10 fs-14 font-heading hidden-md-down\">\n <span class=\"semi-bold\">'.$user.'</span>\n </div>\n <div class=\"dropdown pull-right sm-m-r-5\">\n <button class=\"profile-dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n <span >\n <img src=\"assets/img/s-logo.png\" alt=\"\" width=\"32px\" >\n </span>\n </button>\n <div class=\"dropdown-menu dropdown-menu-right profile-dropdown\" role=\"menu\">\n <!--<a href=\"#\" class=\"dropdown-item\"><i class=\"pg-settings_small\"></i> Settings</a>\n <a href=\"#\" class=\"dropdown-item\"><i class=\"pg-outdent\"></i> Feedback</a>\n <a href=\"#\" class=\"dropdown-item\"><i class=\"pg-signals\"></i> Help</a>-->\n <a href=\"logout.php\" class=\"clearfix bg-master-lighter dropdown-item\">\n <span class=\"pull-left\">Logout</span>\n <span class=\"pull-right\"><i class=\"pg-power\"></i></span>\n </a>\n </div>\n </div>\n <!-- END User Info\n <a href=\"#\" class=\"header-icon pg pg-alt_menu btn-link m-l-10 sm-no-margin d-inline-block\" data-toggle=\"quickview\" data-toggle-element=\"#quickview\"></a>\n --></div>\n </div>\n <div class=\"header-inner justify-content-start header-lg-height title-bar\">\n <div class=\"brand inline align-self-end\">\n <img src=\"assets/img/s-logo.png\" style=\"width:35px;\" >\n </div>\n <h2 class=\"page-title align-self-end\">\n '.$titlepage.'\n </h2>\n </div>\n '.$menu.'\n </div>\n </div>\n\t\n\t<div class=\"page-container \">\n <!-- START PAGE CONTENT WRAPPER -->\n <div class=\"page-content-wrapper \">\n <!-- START PAGE CONTENT -->\n <div class=\"content sm-gutter\">\n <!-- START JUMBOTRON -->\n <div data-pages=\"parallax\">\n <div class=\" container no-padding container-fixed-lg\">\n <div class=\"inner\">\n <!-- START BREADCRUMB -->\n <ol class=\"breadcrumb\">\n <li class=\"breadcrumb-item\"><a href=\"home.php\">Home</a></li>\n <li class=\"breadcrumb-item active\">'.$titlepage.'</li>\n </ol>\n </div>\n </div>\n </div>\n\t\n '.$content.'\n\t\n\t<br><br>\n\t <div class=\" container container-fixed-lg footer\">\n <div class=\"copyright sm-text-center\">\n <p class=\"small no-margin pull-left sm-pull-reset\">\n <span class=\"hint-text\">SeaGods Administrator Page &copy; 2018 </span>\n <span class=\"font-montserrat\"></span>.\n <span class=\"hint-text\">All rights reserved. </span>\n <span class=\"sm-block\"><a href=\"#\" class=\"m-l-10 m-r-10\">Terms of use</a> <span class=\"muted\">|</span> <a href=\"#\" class=\"m-l-10\">Privacy Policy</a></span>\n </p>\n <p class=\"small no-margin pull-right sm-pull-reset\">\n Supported by <span class=\"hint-text\"> XtremeWeb Solution</span>\n </p>\n <div class=\"clearfix\"></div>\n </div>\n </div>\n <!-- END COPYRIGHT -->\n </div>\n <!-- END PAGE CONTENT WRAPPER -->\n </div>\n\t\n <!-- END PAGE CONTAINER -->\n <!--START QUICKVIEW -->\n <div id=\"quickview\" class=\"quickview-wrapper\" data-pages=\"quickview\">\n \n </div>\n \n \n <!-- END QUICKVIEW-->\n <!-- START OVERLAY -->\n <div class=\"overlay hide\" data-pages=\"search\">\n <!-- BEGIN Overlay Content !-->\n <div class=\"overlay-content has-results m-t-20\">\n <!-- BEGIN Overlay Header !-->\n <div class=\"container-fluid\">\n <!-- BEGIN Overlay Logo !\n <img class=\"overlay-brand\" src=\"assets/img/logo.png\" alt=\"logo\" data-src=\"assets/img/logo.png\" data-src-retina=\"assets/img/logo_2x.png\" width=\"78\" height=\"22\">\n <!-- END Overlay Logo !-->\n <!-- BEGIN Overlay Close !-->\n <a href=\"#\" class=\"close-icon-light overlay-close text-black fs-16\">\n <i class=\"pg-close\"></i>\n </a>\n <!-- END Overlay Close !-->\n </div>\n <!-- END Overlay Header !-->\n <div class=\"container-fluid\">\n <!-- BEGIN Overlay Controls !-->\n <input id=\"overlay-search\" class=\"no-border overlay-search bg-transparent\" placeholder=\"Search...\" autocomplete=\"off\" spellcheck=\"false\">\n <br>\n <div class=\"inline-block\">\n <div class=\"checkbox right\">\n <input id=\"checkboxn\" type=\"checkbox\" value=\"1\" checked=\"checked\">\n <label for=\"checkboxn\"><i class=\"fa fa-search\"></i> Search within page</label>\n </div>\n </div>\n <div class=\"inline-block m-l-10\">\n <p class=\"fs-13\">Press enter to search</p>\n </div>\n <!-- END Overlay Controls !-->\n </div>\n <!-- BEGIN Overlay Search Results, This part is for demo purpose, you can add anything you like !-->\n <div class=\"container-fluid\">\n <span>\n <strong>suggestions :</strong>\n </span>\n <span id=\"overlay-suggestions\"></span>\n <br>\n <div class=\"search-results m-t-40\">\n <p class=\"bold\">Pages Search Results</p>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <!-- BEGIN Search Result Item !-->\n \n <!-- END Search Result Item !-->\n <!-- BEGIN Search Result Item !-->\n \n <!-- END Search Result Item !-->\n <!-- BEGIN Search Result Item !-->\n \n <!-- END Search Result Item !-->\n </div>\n \n </div>\n </div>\n </div>\n <!-- END Overlay Search Results !-->\n </div>\n <!-- END Overlay Content !-->\n </div>\n <!-- END OVERLAY -->\n <!-- BEGIN VENDOR JS -->\n <script src=\"assets/plugins/feather-icons/feather.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/pace/pace.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/jquery/jquery-1.11.1.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/modernizr.custom.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/jquery-ui/jquery-ui.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/tether/js/tether.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/bootstrap/js/bootstrap.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/jquery/jquery-easy.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/jquery-unveil/jquery.unveil.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/jquery-ios-list/jquery.ioslist.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/jquery-actual/jquery.actual.min.js\"></script>\n <script src=\"assets/plugins/jquery-scrollbar/jquery.scrollbar.min.js\"></script>\n <script type=\"text/javascript\" src=\"assets/plugins/select2/js/select2.full.min.js\"></script>\n <script type=\"text/javascript\" src=\"assets/plugins/classie/classie.js\"></script>\n <script src=\"assets/plugins/switchery/js/switchery.min.js\" type=\"text/javascript\"></script>\n <!-- END VENDOR JS -->\n <!-- BEGIN CORE TEMPLATE JS -->\n <script src=\"pages/js/pages.min.js\"></script>\n <!-- END CORE TEMPLATE JS -->\n <!-- BEGIN PAGE LEVEL JS -->\n <script src=\"assets/js/scripts.js\" type=\"text/javascript\"></script>\n\t\n\t \n </body>\n</html>\n\n\n';\n\nreturn $template;\n}", "public function execute()\n {\n $resultRedirect = $this->resultRedirectFactory->create();\n $id = $this->getRequest()->getParam('id');\n if ($id) {\n $model = $this->customData;\n $model->load($id);\n try {\n $model->delete();\n $this->messageManager->addSuccessMessage(__('Data Deleted'));\n return $resultRedirect->setPath('*/*/index');\n } catch (\\Exception $e) {\n $this->messageManager->addErrorMessage(__($e->getMessage()));\n return $resultRedirect->setPath('*/*/edit', ['id'=>$id]);\n }\n }\n }", "function _deleteCache() {\n require_once(\"Cache/Output.php\");\n $cache = new Cache_Output($GLOBALS[\"BX_config\"][\"popoon\"][\"cacheContainer\"], $GLOBALS[\"BX_config\"][\"popoon\"][\"cacheParams\"] );\n \n // for the time being, just flush everything...\n @$cache->flush('outputcache');\n $cache->flush('');\n }", "protected function cleanCache()\n {\n parent::cleanCache('com_projectfork');\n }", "public function cleancacheAction() {\n if (Tools_Security_Acl::isAllowed(Tools_Security_Acl::RESOURCE_CONTENT)) {\n try {\n $this->_helper->cache->clean();\n $this->_helper->response->success(\n $this->_helper->language->translate('The entire cache has been cleaned.')\n );\n }\n catch (Exceptions_SeotoasterException $ste) {\n $this->_helper->response->fail($ste->getMessage());\n }\n }\n }", "protected function _content_template_parent() {\n ?>\n <#\n var selector = '<?php echo $this->get_unique_selector(); ?>' + id; \n var css = settings.custom_css;\n #>\n <# if( css.length > 0 ) { #>\n <style scoped>{{ css.replace('[SELECTOR]', selector) }}</style>\n <# } #>\n <?php\n }", "public function onclick_btn_delete_static_block($e){\r\n\t\tif($this->has_admin_panel()) return $this->module_onclick_btn_delete_static_block($e);\r\n\t\treturn $this->msg->modal_no_permission($e);\r\n\t}", "public function onClearCache(Enlight_Event_EventArgs $arguments)\n {\n $arguments->getSubject()->Front()->Plugins()->ViewRenderer()->setNoRender();\n\n if (!empty($_SERVER[\"REMOTE_ADDR\"])\n && !empty($this->Config()->ipLimitation)\n && strpos($this->Config()->ipLimitation, $_SERVER[\"REMOTE_ADDR\"]) === false\n ) {\n return;\n }\n\n Shopware()->Cache()->clean();\n Shopware()->Template()->clearAllCache();\n Shopware()->Template()->clearCompiledTemplate();\n $this->clearSearchCache();\n $this->clearRewriteCache();\n $this->clearFrontendCache($arguments->getSubject()->Request());\n $this->clearProxyCache();\n $this->clearConfigCache();\n exit();\n }", "public function index()\n {\n try{\n $crud = new grocery_CRUD();\n $crud->set_theme('mybootstrap');\n $crud->unset_delete();//grid\n $crud->set_table('project');\n $crud->set_subject('Projects');\n $crud->fields('name', 'template', 'slug','status');\n $crud->required_fields('name');\n $crud->callback_before_insert(array($this,'configure_slug'));\n $crud->callback_before_update(array($this,'configure_slug'));\n $crud->unset_export();\n $crud->unset_print();\n $output = $crud->render();\n $output->title_page = $this->lang->line('admin_project_title');\n $output->main_content = $this->config->item('rpt_views') . 'admin';\n $this->load->view( $this->config->item('rpt_base_template'),$output);\n }catch(Exception $e){\n show_error($e->getMessage().' --- '.$e->getTraceAsString());\n }\n }", "public function action_delete()\n {\n\t $this->template = View::forge('template-admin');\n\n $post = Input::post();\n $entry = Model_Event::find_by_pk($post[\"id\"]);\n\t\tif ($entry){\n\t\t\tif(!$entry->delete()){\n\t\t\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t\t\t$this->template->title = \"イベント一覧\";\n\t\t\t\t$this->template->content = View::forge('event/index', $data);\n\t\t\t}\n\t\t}\n\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t$this->template->title = \"イベント一覧\";\n\t\t$this->template->content = View::forge('event/index', $data);\n }", "function _cache_actions_clear_panels_cache($display) {\n panels_load_include('simple', 'plugins/cache/');\n panels_simple_cache_clear_cache($display);\n\n}", "public function show($content, $name_c='', $cache_time = false){ \r\n\t\r\n\t\t//at first .. \r\n\t\t$page_is\t= ($name_c!='') ? $name_c : $content;\r\n\t\t$cache_time\t= ($cache_time !== false )? $cache_time : $this->cachetime;\r\n\r\n\t\t//global vars \r\n\t\tif (empty($this->vars) || !is_array($this->vars)){ \r\n\t\t\t$this->vars = array(); \r\n\t\t}\r\n\t\tif($this->global_vars == 'on'){\r\n\t\t\t$this->vars = array_merge($this->vars, $GLOBALS);\r\n\t\t}\r\n\r\n\t\t//check step\r\n\t if (empty($this->cachedir)) { \r\n\t \t$this->cachedir = $_ENV[\"TEMP\"]; \r\n\t } \r\n\t if (!is_writeable( $this->cachedir ) ) { \r\n\t \techo \"<i>ERROR :</i> could not be write in cach folder!\"; \r\n\t } \r\n\t\t\r\n\t\t//delete step\r\n\t $npage = $page_is . '.mytpl.php'; \r\n\t $tpage = @filemtime(\"$this->cachedir/$npage\"); \r\n\r\n\t if($tpage >= ($tpage+(3600*$cache_time))){ \r\n\t \t@unlink(\"$this->cachedir/$npage\"); \r\n\t } \r\n\r\n\t\t//including step\r\n\t if(!file_exists(\"$this->cachedir/$npage\")){\t\r\n\r\n\t\t\t\tif ($name_c == ''){\r\n\t\t\t\t\r\n\t\t\t\t\tif(!file_exists(\"$this->Tempdir$npage\")){ \r\n\t\t\t\t\t\techo \"<i>ERROR :</i> <b>$page_is</b> Template Not Found!\"; \r\n\t\t\t\t\t\texit();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tob_start();\r\n\t\t\t\t\tinclude(\"$this->Tempdir$npage\"); \r\n\t\t\t\t\t$pageTemp= ob_get_clean();\r\n\t\t\t\t\t\r\n\t\t\t\t}else {\r\n\t\t\t\t\t$pageTemp = $content;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif($this->php_tags != 'on'){ \r\n\t\t\t\t\t//reomve any any php tags ,, so if you want php code use our code {php}\r\n\t\t\t\t\t$this->remove_php_tags($pageTemp);\r\n\t\t\t\t}\r\n\t\t\t\t//compile content\r\n\t\t\t\t$pageTemp = $this->compile($pageTemp);\t\r\n\t\t\t\t\r\n\t\t\t\t//then\r\n\t\t\t $filenum = @fopen(\"$this->cachedir/$npage\", 'w'); \r\n\t\t\t flock($filenum, LOCK_EX); \r\n\t\t\t @fwrite($filenum, $pageTemp); \r\n\t\t\t fclose($filenum); \r\n\t\t\t\t@chmod($filenum, 0666);\r\n\t } \r\n\t\t\r\n\t\t//get \r\n\t\tob_start();\r\n\t\tinclude(\"$this->cachedir/$npage\"); \r\n\t\t$pageTemp = ob_get_clean();\r\n\t\t//now prepare to print \r\n\t\treturn $pageTemp;\r\n }", "public function rollback_invoice_product_delete()\n {\n $data['nestedView']['pageTitle'] = ' Delete Invoice Product Details';\n $data['nestedView']['heading'] = \"Delete Invoice Product Details\";\n $data['nestedView']['cur_page'] = 'Delete Invoice Product Details';\n $data['nestedView']['parent_page'] = 'date_change';\n $data['nestedView']['list_page'] = 'date_change';\n # Load JS and CSS Files\n $data['nestedView']['js_includes'] = array();\n $data['nestedView']['css_includes'] = array();\n \n # Breadcrumbs\n $data['nestedView']['breadCrumbOptions'] = array( array('label'=>'Home','class'=>'','url'=>SITE_URL));\n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Delete Invoice Product','class'=>'active','url'=>SITE_URL.'invoice_product_delete'); \n $data['nestedView']['breadCrumbOptions'][] = array('label'=>'Delete Invoice Product Details','class'=>'active','url'=>'');\n\n $invoice_number=$this->input->post('invoice_id',TRUE);\n $invoice_id=$this->Rollback_invoice_m->get_invoice_id($invoice_number);\n $count_receipt_invoice = $this->Common_model->get_data('receipt_invoice',array('invoice_id'=>$invoice_id));\n $count_gatepass = $this->Common_model->get_data('gatepass_invoice',array('invoice_id'=>$invoice_id));\n if(count($count_receipt_invoice)>0 || count($count_gatepass)>0)\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice is involved in Gatepass/StockReceiving. Please Check! </div>');\n redirect(SITE_URL.'invoice_product_delete'); exit();\n }\n $invoice_type=$this->Rollback_invoice_m->get_invoice_type($invoice_id);\n if($invoice_type['type'] == 2)\n {\n \n $invoice_plant_products=$this->Rollback_invoice_m->get_invoice_do_product($invoice_id);\n \n if(count($invoice_plant_products)!='')\n {\n \n foreach($invoice_plant_products as $key => $value)\n {\n $results['invoice_date']=$value['invoice_date'];\n $results['vehicle_number']=$value['vehicle_number'];\n $results['from']=$value['from'];\n $results['to']=$value['to'];\n $results['invoice_number']=$value['invoice_number'];\n $results['invoice_id']=$value['invoice_id'];\n \n }\n //echo \"<pre>\"; print_r($invoice_plant_products); exit;\n $col=array_column($invoice_plant_products,'amount');\n $sum=array_sum($col);\n $data['sum']=$sum;\n $inv_dos= $this->Rollback_invoice_m->get_invoice_dos($invoice_id);\n $inv_obs= $this->Rollback_invoice_m->get_invoice_obs($invoice_id);\n foreach ($inv_dos as $value)\n {\n $d[]=$value['do_number'];\n $do_date[] =date('d-m-Y',strtotime($value['do_date']));\n } \n $data['inv_dos'] =implode(', ',$d);\n $data['inv_do_dates'] =implode(', ',$do_date);\n $data['tin_num']=37280114257;\n foreach ($inv_obs as $value) \n {\n $ob[]=$value['order_number'];\n $ob_date[] =date('d-m-Y',strtotime($value['order_date']));\n }\n \n $data['inv_obs'] =implode(', ',$ob);\n $data['inv_ob_dates'] =implode(', ',$ob_date);\n $data['results']=$results;\n $data['invoice_plant_product']=$invoice_plant_products;\n $data['flag']=3;\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'invoice_product_delete');\n }\n }\n elseif($invoice_type['type']== 1)\n {\n $invoice_dist_products=$this->Rollback_invoice_m->get_invoice_do_distributor_product($invoice_id);\n \n if(count($invoice_dist_products)!='')\n {\n foreach($invoice_dist_products as $key => $value)\n {\n $results['invoice_date']=$value['invoice_date'];\n $results['distributor_code']=$value['distributor_code'];\n $results['tin_num']=$value['vat_no'];\n $results['mobile']=$value['mobile'];\n $results['vehicle_number']=$value['vehicle_number'];\n $results['amount']=$value['amount'];\n $results['agency_name']=$value['agency_name'];\n $results['address']=$value['address'];\n $results['lifting']=$value['lifting'];\n $results['location']=$value['distributor_place'];\n $results['invoice_number']=$value['invoice_number'];\n $results['invoice_id']=$value['invoice_id'];\n \n }\n $col=array_column($invoice_dist_products,'amount');\n $sum=array_sum($col);\n $data['sum']=$sum;\n $inv_dos= $this->Rollback_invoice_m->get_invoice_dos($invoice_id);\n $inv_obs= $this->Rollback_invoice_m->get_invoice_obs($invoice_id);\n foreach ($inv_dos as $value)\n {\n $d[]=$value['do_number'];\n $do_date[] =date('d-m-Y',strtotime($value['do_date']));\n } \n $data['inv_dos'] =implode(', ',$d);\n $data['inv_do_dates'] =implode(', ',$do_date);\n\n foreach ($inv_obs as $value) \n {\n $ob[]=$value['order_number'];\n $ob_date[] =date('d-m-Y',strtotime($value['order_date']));\n }\n \n $data['inv_obs'] =implode(', ',$ob);\n $data['inv_ob_dates'] =implode(', ',$ob_date);\n $data['results']=$results;\n $data['invoice_dist_product']=$invoice_dist_products;\n $data['flag']=2;\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'invoice_product_delete');\n }\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Invoice Number Is Not Exist. Please check. </div>');\n \n redirect(SITE_URL.'invoice_product_delete');\n }\n \n \n $this->load->view('rollback_invoice/rollback_invoice_product_delete_view',$data);\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "function admin_pagesBuild($data, $db) {\n\t//permission check for pages delete\n\tif (!checkPermission('delete', 'pages', $data)) {\n\t\t$data->output['abort'] = true;\n\t\t$data->output['abortMessage'] = '<h2>Insufficient User Permissions</h2>You do not have the permissions to access this area.';\n\t\treturn;\n\t}\n\n\t$data->output['delete']='';\n\n\t// Check To See If The Menu Item Exists\n\t$check = $db->prepare('getPageById', 'admin_pages');\n\t$check->execute(array(':id' => $data->action[3]));\n\t$data->output['pageItem'] = $check->fetch();\n\n\tif ($data->output['pageItem']['shortName'] == $data->settings['homepage']) {\n\t\t$data->output['rejectError']='Permission Denied';\n\t\t$data->output['rejectText']='This page is being used as the homepage. It cannot be deleted.';\n\t}\n\n\tif ($data->output['pageItem'] == FALSE || !is_numeric($data->action[3])) {\n\t\t$data->output['rejectError']='insufficient parameters';\n\t\t$data->output['rejectText']='No ID # was entered to be deleted';\n\t} else {\n\t\tif (isset($_POST['fromForm'])) {\n\t\t\tif ($_POST['fromForm']==$data->action[3] && !empty($_POST['delete'])) {\n\t\t\t\tif ($data->output['pageItem']['parent']==0) {\n\t\t\t\t\t$statement=$db->prepare('deleteReplacementByMatch', 'admin_urls');\n\t\t\t\t\t$statement->execute(array(\n\t\t\t\t\t\t\t':match' => '^'.$data->output['pageItem']['shortName'].'(/.*)?$'\n\t\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t\t// Fix Gap In Sort Order By Subtracting 1 From Each One Larger Than It\n\t\t\t\t$statement = $db->prepare('fixSortOrderGap', 'admin_pages');\n\t\t\t\t$statement->execute(array(\n\t\t\t\t\t\t':sortOrder' => $data->output['pageItem']['sortOrder'],\n\t\t\t\t\t\t':parent' => $data->output['pageItem']['parent']\n\t\t\t\t\t));\n\t\t\t\t//--Delete This Page--//\n\t\t\t\tcommon_deleteFromLanguageTables($data, $db, 'pages', 'id', $data->action[3], TRUE);\n\t\t\t\t//--Delete This Page's Children--//\n\t\t\t\tcommon_deleteFromLanguageTables($data, $db, 'pages', 'parent', $data->action[3], TRUE);\n\t\t\t\t$data->output['delete']='deleted';\n\t\t\t} else {\n\t\t\t\t/* from form plus not deleted must == cancelled. */\n\t\t\t\t$data->output['delete']='cancelled';\n\t\t\t}\n\t\t}\n\t}\n}", "public function run()\n {\n $cache = new Cache();\n $this->menuHtml = $cache->get($this->cacheKey);\n if( ! $this->menuHtml) {\n $this->data = \\R::getAssoc(\"SELECT * FROM {$this->table}\");\n $this->tree = $this->getTree();\n $this->menuHtml = $this->getMenuHtml($this->tree);\n\n $cache->set($this->cacheKey, $this->menuHtml, $this->cache);\n }\n $this->output();\n }", "public function execute($operation = NULL)\r\n\t{\r\n\t\tCore_Event::notify(get_class($this) . '.onBeforeExecute', $this, array($operation));\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$return = NULL;\r\n\r\n\t\t\t$Site_Controller_Template = Site_Controller_Template::instance()\r\n\t\t\t\t->templatePath(CMS_FOLDER . TMP_DIR)\r\n\t\t\t\t->chmodFile(CHMOD_FILE)\r\n\t\t\t\t//->server('http://hostcms')\r\n\t\t\t\t;\r\n\r\n\t\t\tswitch ($operation)\r\n\t\t\t{\r\n\t\t\t\tcase NULL: // Показ формы\r\n\t\t\t\t\t// Операция для кнопки\r\n\t\t\t\t\t$this->_formOperation = 'chooseTemplate';\r\n\r\n\t\t\t\t\t$oMainTab = Admin_Form_Entity::factory('Tab')\r\n\t\t\t\t\t\t->caption('Main')\r\n\t\t\t\t\t\t->name('main');\r\n\r\n\t\t\t\t\t$this->addTab($oMainTab);\r\n\r\n\t\t\t\t\t$this->title(Core::_('Site.choose_site_template'));\r\n\r\n\t\t\t\t\t$this->_Admin_Form_Controller->title(\r\n\t\t\t\t\t\t$this->title\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\tob_start();\r\n\r\n\t\t\t\t\t$oXml = $Site_Controller_Template->loadTemplatesXml();\r\n\r\n\t\t\t\t\t?><div id=\"gallery\"><?php\r\n\t\t\t\t\t$aGroups = $oXml->children();\r\n\r\n\t\t\t\t\t$iKeyGroup = 0;\r\n\t\t\t\t\t// цикл по дереву group\r\n\t\t\t\t\tforeach ($aGroups as $oGroup)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// если в группе есть шаблоны\r\n\t\t\t\t\t\tif ($oGroup->templates)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$iKeyTemplate = 0;\r\n\t\t\t\t\t\t\t// цикл по дереву template\r\n\t\t\t\t\t\t\tforeach ($oGroup->templates->template as $oTemplate)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif (strlen(trim((string)$oTemplate->template_file6)) && (int)$oTemplate['id'] != 2782)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$small_width = (string)$oTemplate->template_preview['width'];\r\n\t\t\t\t\t\t\t\t\t$small_height = 200 + 40;\r\n\t\t\t\t\t\t\t\t\t// вывод информации о шаблоне\r\n\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t<div class=\"site_template_block\">\r\n\t\t\t\t\t\t\t\t\t<div class=\"bord_img\" style=\"width: <?php echo $small_width?>px; height:<?php echo $small_height?>px;\">\r\n\r\n\t\t\t\t\t\t\t\t\t\t<a href=\"<?php echo $Site_Controller_Template->server . trim((string)$oTemplate->template_full_preview)?>\" target=\"_blank\">\r\n\t\t\t\t\t\t\t\t\t\t<img src=\"<?php echo $Site_Controller_Template->server . trim((string)$oTemplate->template_preview)?>\" width=\"<?php echo $small_width?>\" />\r\n\t\t\t\t\t\t\t\t\t\t</a>\r\n\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"bottom\">\r\n\t\t\t\t\t\t\t\t\t\t\t<input style=\"float: left\" type=\"radio\" <?php if ($iKeyTemplate == 0 && $iKeyGroup == 0) {echo 'checked=\"checked\"';} ?> name=\"template_id\" id=\"template_<?php echo (string)$oTemplate['id']?>\" value=\"<?php echo (string)$oTemplate['id']?>\" />\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t<label for=\"template_<?php echo (string)$oTemplate['id']?>\" style=\"margin-left: 5px; float: left\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<b><?php echo (string)$oTemplate->template_name?></b>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t\t\t\t\t\t\t<span><?php echo (string)$oGroup->group_name?></span>\r\n\t\t\t\t\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$iKeyTemplate++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$iKeyGroup++;\r\n\r\n\t\t\t\t\t\t// Для HostCMS-6 доступен только основной макет\r\n\t\t\t\t\t\t//break;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div style=\"clear: both\"></div>\r\n\t\t\t\t\t<?php\r\n\r\n\t\t\t\t\t$oMainTab->add(\r\n\t\t\t\t\t\tAdmin_Form_Entity::factory('Code')->html(\r\n\t\t\t\t\t\t\tob_get_clean()\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\t$return = $this->_showEditForm();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'chooseTemplate':\r\n\t\t\t\t\t// Операция для кнопки\r\n\t\t\t\t\t$this->_formOperation = 'chooseTemplateType';\r\n\r\n\t\t\t\t\t$oMainTab = Admin_Form_Entity::factory('Tab')\r\n\t\t\t\t\t\t->caption('Main')\r\n\t\t\t\t\t\t->name('main');\r\n\r\n\t\t\t\t\t$this->addTab($oMainTab);\r\n\r\n\t\t\t\t\t$this->title(Core::_('Site.choose_color_scheme'));\r\n\r\n\t\t\t\t\t$this->_Admin_Form_Controller->title(\r\n\t\t\t\t\t\t$this->title\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\tob_start();\r\n\r\n\t\t\t\t\t$oXml = $Site_Controller_Template->loadTemplatesXml();\r\n\r\n\t\t\t\t\t$iTemplateId = intval(Core_Array::getPost('template_id'));\r\n\t\t\t\t\t$Templates = $oXml->xpath(\"//group/templates/template[@id='{$iTemplateId}']\");\r\n\r\n\t\t\t\t\tif (isset($Templates[0]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// у выбранного шаблона есть цветовые схемы\r\n\t\t\t\t\t\tif (count($Templates[0]->template_types->template_type) > 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t<div id=\"gallery\">\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t// цикл по цветовым схемам\r\n\t\t\t\t\t\t\tforeach ($Templates[0]->template_types as $iKeyTemplateType => $oTemplateType)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$small_width = (string)$oTemplateType->template_type_full_preview['width'];\r\n\t\t\t\t\t\t\t\t$small_height = 200 + 40;\r\n\r\n\t\t\t\t\t\t\t\t?><div class=\"bord_img\" style=\"width: <?php echo $small_width?>px; height:<?php echo $small_height?>px;\">\r\n\r\n\t\t\t\t\t\t\t\t<a href=\"<?php echo $Site_Controller_Template->server . trim((string)$oTemplateType->template_type_full_preview)?>\">\r\n\t\t\t\t\t\t\t\t<img src=\"<?php echo $Site_Controller_Template->server . trim((string)$oTemplateType->template_type_preview)?>\"\r\n\t\t\t\t\t\t\t\twidth=\"<?php echo $small_width?>\" />\r\n\t\t\t\t\t\t\t\t</a>\r\n\r\n\t\t\t\t\t\t\t\t<div style=\"position: absolute; width: 100%; bottom: 5px;\">\r\n\t\t\t\t\t\t\t\t\t<input style=\"float: left;\" type=\"radio\" <?php echo ($iKeyTemplateType == 0) ? 'checked=\"checked\"' : ''?> name=\"template_id\" id=\"template_<?php echo (string)$oTemplateType['id']?>\" value=\"<?php echo (string)$oTemplateType['id']?>\" />\r\n\r\n\t\t\t\t\t\t\t\t\t<label for=\"template_<?php echo (string)$oTemplateType['id']?>\" style=\"margin-left: 5px; float: left\">\r\n\t\t\t\t\t\t\t\t\t\t<b><?php echo (string)$oTemplateType->template_type_name?></b>\r\n\t\t\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t<?php\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\t</div>\r\n\t\t\t\t\t\t\t<?php\r\n\r\n\t\t\t\t\t\t\t$oMainTab->add(\r\n\t\t\t\t\t\t\t\tAdmin_Form_Entity::factory('Code')->html(\r\n\t\t\t\t\t\t\t\t\tob_get_clean()\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\t$return = $this->_showEditForm();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t//break; // Если цветовой схемы нет, переходим к следующему шагу\r\n\t\t\t\tcase 'chooseTemplateType':\r\n\r\n\t\t\t\t\t// Операция для кнопки\r\n\t\t\t\t\t$this->_formOperation = 'createSite';\r\n\r\n\t\t\t\t\t$oMainTab = Admin_Form_Entity::factory('Tab')\r\n\t\t\t\t\t\t->caption('Main')\r\n\t\t\t\t\t\t->name('main');\r\n\r\n\t\t\t\t\t$this->addTab($oMainTab);\r\n\r\n\t\t\t\t\t$this->title(Core::_('Site.template_settings'));\r\n\r\n\t\t\t\t\t$this->_Admin_Form_Controller->title(\r\n\t\t\t\t\t\t$this->title\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\tob_start();\r\n\r\n\t\t\t\t\t$oXml = $Site_Controller_Template->loadTemplatesXml();\r\n\r\n\t\t\t\t\t$iTemplateId = intval(Core_Array::getPost('template_id'));\r\n\t\t\t\t\t$iTemplateTypeId = intval(Core_Array::getPost('template_type_id'));\r\n\r\n\t\t\t\t\t$Templates = $oXml->xpath(\"//group/templates/template[@id='{$iTemplateId}']\");\r\n\r\n\t\t\t\t\tif (isset($Templates[0]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$Template = $Templates[0];\r\n\r\n\t\t\t\t\t\t// ссылка на макет файла\r\n\t\t\t\t\t\t$sTemplateFile = (string)$Template->template_file6;\r\n\r\n\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$Core_Http = Core_Http::instance()\r\n\t\t\t\t\t\t\t\t->url($Site_Controller_Template->server . $sTemplateFile)\r\n\t\t\t\t\t\t\t\t->port(80)\r\n\t\t\t\t\t\t\t\t->timeout(30)\r\n\t\t\t\t\t\t\t\t->execute();\r\n\r\n\t\t\t\t\t\t\t$sFileContents = $Core_Http->getBody();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcatch (Exception $e)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tCore_Message::show($e->getMessage(), 'error');\r\n\t\t\t\t\t\t\t$sFileContents = NULL;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// название архива макета\r\n\t\t\t\t\t\t$aTemplateFileUrl = explode('/', $Site_Controller_Template->server . $sTemplateFile);\r\n\t\t\t\t\t\t$sTemplateFileName = end($aTemplateFileUrl);\r\n\r\n\t\t\t\t\t\t// путь к локальному архиву макета\r\n\t\t\t\t\t\t$sTemplateFileUrl = $Site_Controller_Template->templatePath . $sTemplateFileName;\r\n\r\n\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// запись в файл данных макета\r\n\t\t\t\t\t\t\tif (Core_File::write($sTemplateFileUrl, $sFileContents))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// распаковка архива макета\r\n\t\t\t\t\t\t\t\t$Core_Tar = new Core_Tar($sTemplateFileUrl);\r\n\t\t\t\t\t\t\t\t$Core_Tar->extractModify($Site_Controller_Template->templatePath, $Site_Controller_Template->templatePath);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tCore_Message::show(Core::_('install.write_error', $sTemplateFileUrl), 'error');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcatch (Exception $e)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$flag = FALSE;\r\n\t\t\t\t\t\t\tCore_Message::show($e->getMessage(), 'error');\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Массив из файла template.xml\r\n\t\t\t\t\t\t$oTemplateContentXml = $Site_Controller_Template->loadSelectedTemplateXml();\r\n\r\n\t\t\t\t\t\tif ($oTemplateContentXml)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$aXmlFields = $oTemplateContentXml->xpath(\"fields/field\");\r\n\r\n\t\t\t\t\t\t\tif (count($aXmlFields))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t?><p><?php echo Core::_('install.template_data_information')?></p>\r\n\t\t\t\t\t\t\t\t<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" class=\"admin_table\">\r\n\t\t\t\t\t\t\t\t<tr class=\"admin_table_title\">\r\n\t\t\t\t\t\t\t\t\t<td><?php echo Core::_('install.table_field_param')?></td>\r\n\t\t\t\t\t\t\t\t\t<td><?php echo Core::_('install.table_field_value')?></td>\r\n\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t<?php\r\n\r\n\t\t\t\t\t\t\t\t$aFields = $Site_Controller_Template->getFields($aXmlFields);\r\n\r\n\t\t\t\t\t\t\t\tforeach ($aFields as $aFieldsValue)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$sFieldName = htmlspecialchars($aFieldsValue['Name']);\r\n\t\t\t\t\t\t\t\t\t$sFieldValue = htmlspecialchars($aFieldsValue['Value']);\r\n\t\t\t\t\t\t\t\t\t$sFieldMacros = htmlspecialchars($aFieldsValue['Macros']);\r\n\t\t\t\t\t\t\t\t\t$sFieldExtension = htmlspecialchars($aFieldsValue['Extension']);\r\n\t\t\t\t\t\t\t\t\t$sFieldMaxWidth = intval($aFieldsValue['MaxWidth']);\r\n\t\t\t\t\t\t\t\t\t$sFieldMaxHeight = intval($aFieldsValue['MaxHeight']);\r\n\t\t\t\t\t\t\t\t\t$sFieldListValue = $aFieldsValue['ListValue'];\r\n\r\n\t\t\t\t\t\t\t\t\t$iFieldType = intval($aFieldsValue['Type']);\r\n\r\n\t\t\t\t\t\t\t\t\t// Название поля\r\n\t\t\t\t\t\t\t\t\t?><tr class=\"row\">\r\n\t\t\t\t\t\t\t\t\t\t<td><?php echo $sFieldName?></td>\r\n\t\t\t\t\t\t\t\t\t\t<td><?php\r\n\r\n\t\t\t\t\t\t\t\t\tswitch ($iFieldType)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tcase 0: // текст\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"50\" name=\"<?php echo $sFieldMacros?>\" value=\"<?php echo $sFieldValue?>\" />\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\tcase 1: // список\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t<select name=\"<?php echo $sFieldMacros?>\">\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\tif (count($sFieldListValue) > 0)\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($sFieldListValue as $option_key => $option_value)\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"<?php echo $option_key?>\"><?php echo $option_value?></option>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\tcase 2: // файл\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"file\" size=\"50\" name=\"<?php echo $sFieldMacros?>\" value=\"<?php echo $sFieldValue?>\" />\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\tif (trim($sFieldExtension) != '')\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Разрешенные расширения файла\r\n\t\t\t\t\t\t\t\t\t\t\t\t?><br /><?php echo Core::_('install.allowed_extension', $sFieldExtension)?><?php\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif ($sFieldMaxWidth > 0 && $sFieldMaxHeight > 0)\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Максимальный размер файла\r\n\t\t\t\t\t\t\t\t\t\t\t\t?><br /><?php echo Core::_('install.max_file_size', $sFieldMaxWidth, $sFieldMaxHeight)?><?php\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\tcase 3: // большое текстовое поле\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t<textarea name=\"<?php echo $sFieldMacros?>\" rows=\"5\" cols=\"47\"><?php echo $sFieldValue?></textarea>\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t?></td>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t?></table><?php\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t?><p><?php echo Core::_('install.empty_settings')?></p><?php\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tCore_Message::show(Core::_('install.file_not_found', 'template.xml'), 'error');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$oMainTab->add(\r\n\t\t\t\t\t\tAdmin_Form_Entity::factory('Code')->html(\r\n\t\t\t\t\t\t\tob_get_clean()\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\t$return = $this->_showEditForm();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'createSite':\r\n\t\t\t\t\t$iTemplateId = Core_Array::getPost('template_id');\r\n\t\t\t\t\t$iTemplateTypeId = Core_Array::getPost('template_type_id');\r\n\r\n\t\t\t\t\t// Копируем файлы из ./template/ в папку системы\r\n\t\t\t\t\tif (is_dir($Site_Controller_Template->templatePath . 'template'))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tCore_File::copyDir($Site_Controller_Template->templatePath . 'template', CMS_FOLDER);\r\n\t\t\t\t\t\t\tCore_Message::show(Core::_('install.template_files_copy_success'));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcatch (Exception $e)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tCore_Message::show($e->getMessage(), 'error');\r\n\t\t\t\t\t\t\tCore_Message::show(Core::_('install.template_files_copy_error'), 'error');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (is_file($Site_Controller_Template->templatePath . 'template.php'))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Замены в макете\r\n\t\t\t\t\t\t$aReplace = array();\r\n\r\n\t\t\t\t\t\t// Массив из файла template.xml\r\n\t\t\t\t\t\t$oTemplateContentXml = $Site_Controller_Template->loadSelectedTemplateXml();\r\n\r\n\t\t\t\t\t\tif ($oTemplateContentXml)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$aXmlFields = $oTemplateContentXml->xpath(\"fields/field\");\r\n\r\n\t\t\t\t\t\t\tif (count($aXmlFields))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$aFields = $Site_Controller_Template->getFields($aXmlFields);\r\n\r\n\t\t\t\t\t\t\t\t// цикл по дереву 'fields'\r\n\t\t\t\t\t\t\t\tforeach ($aFields as $aFieldsValue)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$sFieldName = $aFieldsValue['Name'];\r\n\t\t\t\t\t\t\t\t\t$sFieldMacros = $aFieldsValue['Macros'];\r\n\t\t\t\t\t\t\t\t\t$iFieldType = $aFieldsValue['Type'];\r\n\r\n\t\t\t\t\t\t\t\t\t// Файл\r\n\t\t\t\t\t\t\t\t\tif ($iFieldType == 2)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif (isset($_FILES[$sFieldMacros]['tmp_name'])\r\n\t\t\t\t\t\t\t\t\t\t&& is_file($_FILES[$sFieldMacros]['tmp_name'])\r\n\t\t\t\t\t\t\t\t\t\t&& $_FILES[$sFieldMacros]['size'] > 0)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$sFieldPath = $aFieldsValue['Path'];\r\n\t\t\t\t\t\t\t\t\t\t\t$sFieldExtension = $aFieldsValue['Extension'];\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t$sExt = Core_File::getExtension($_FILES[$sFieldMacros]['name']);\r\n\t\t\t\t\t\t\t\t\t\t\t$aAllowedExt = explode(',', $sFieldExtension);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif (strlen(trim($sFieldExtension)) == 0 || in_array($sExt, $aAllowedExt))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (!move_uploaded_file($_FILES[$sFieldMacros]['tmp_name'], CMS_FOLDER . $sFieldPath))\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tCore_Message::show(Core::_('install.file_copy_error', $sFieldPath), 'error');\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tCore_Message::show(Core::_('install.file_disabled_extension', $sFieldName), 'error');\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t// Остальные типы полей\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$aReplace[\"%{$sFieldMacros}%\"] = $_REQUEST[$sFieldMacros];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tinclude($Site_Controller_Template->templatePath . 'template.php');\r\n\r\n\t\t\t\t\t\tCore_Message::show(Core::_('install.template_install_success'));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tCore_Message::show(Core::_('install.file_not_found', 'template.php'), 'error');\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttry\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tis_dir($Site_Controller_Template->templatePath . 'template') && Core_File::deleteDir($Site_Controller_Template->templatePath . 'template');\r\n\t\t\t\t\t\tis_dir($Site_Controller_Template->templatePath . 'tmp') && Core_File::deleteDir($Site_Controller_Template->templatePath . 'tmp');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch (Exception $e){}\r\n\r\n\t\t\t\t\t$return = NULL;\r\n\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$this->_applyObjectProperty();\r\n\t\t\t\t\t$return = FALSE; // Показываем форму\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception $e)\r\n\t\t{\r\n\t\t\tCore_Message::show($e->getMessage(), 'error');\r\n\t\t}\r\n\r\n\t\tCore_Event::notify(get_class($this) . '.onAfterExecute', $this, array($operation));\r\n\r\n\t\treturn $return;\r\n\t}", "function cs_pb_client($die = 0){\n\tglobal $cs_node, $count_node, $post;\n\tif ( isset($_POST['action']) ) {\n\t\t\t$name = $_POST['action'];\n\t\t\t$counter = $_POST['counter'];\n\t\t\t$client_element_size = '50';\n\t\t\t$client_header_title = '';\n\t\t\t$client_gallery = '';\n\t\t\t$client_view = '';\n\t}\n\telse {\n\t\t$name = $cs_node->getName();\n\t\t\t$count_node++;\n\t\t\t$client_header_title = $cs_node->client_header_title;\n\t\t\t$client_gallery = $cs_node->client_gallery;\n\t\t\t$client_view = $cs_node->client_view;\n\t\t\t$client_element_size = $cs_node->client_element_size;\n\t\t\t\t$counter = $post->ID.$count_node;\n\t}\n?> \n\t<div id=\"<?php echo $name.$counter?>_del\" class=\"column parentdelete column_<?php echo $client_element_size?>\" item=\"client\" data=\"<?php echo element_size_data_array_index($client_element_size)?>\" >\n\t\t<div class=\"column-in\">\n <h5><?php echo ucfirst(str_replace(\"cs_pb_\",\"\",$name))?></h5>\n <input type=\"hidden\" name=\"client_element_size[]\" class=\"item\" value=\"<?php echo $client_element_size?>\" >\n <a href=\"javascript:hide_all('<?php echo $name.$counter?>')\" class=\"options\">Options</a> &nbsp; \n <a href=\"#\" class=\"delete-it btndeleteit\">Del</a> &nbsp; \n <a class=\"decrement\" onclick=\"javascript:decrement(this)\">Dec</a> &nbsp; \n <a class=\"increment\" onclick=\"javascript:increment(this)\">Inc</a>\n\t\t</div>\n <div class=\"poped-up\" id=\"<?php echo $name.$counter?>\" style=\"border:none; background:#f8f8f8;\" >\n <div class=\"opt-head\">\n <h5>Edit Client's Options</h5>\n <a href=\"javascript:show_all('<?php echo $name.$counter?>')\" class=\"closeit\">&nbsp;</a>\n </div>\n <div class=\"opt-conts\">\n \t<ul class=\"form-elements\">\n <li class=\"to-label\"><label>Header Title</label></li>\n <li class=\"to-field\">\n <input type=\"text\" name=\"client_header_title[]\" class=\"txtfield\" value=\"<?php echo htmlspecialchars($client_header_title)?>\" />\n <p>Please enter header title.</p>\n </li> \n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Choose Gallery/Album</label></li>\n <li class=\"to-field\">\n <select name=\"client_gallery[]\" class=\"dropdown\">\n \t<option value=\"0\">-- Select Gallery --</option>\n <?php\n $query = array( 'posts_per_page' => '-1', 'post_type' => 'cs_gallery', 'orderby'=>'ID', 'post_status' => 'publish' );\n $wp_query = new WP_Query($query);\n while ($wp_query->have_posts()) : $wp_query->the_post();\n ?>\n <option <?php if($post->post_name==$client_gallery)echo \"selected\";?> value=\"<?php echo $post->post_name; ?>\"><?php echo get_the_title()?></option>\n <?php\n endwhile;\n ?>\n </select>\n <p>Select gallery to show images.</p>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Select View</label></li>\n <li class=\"to-field\">\n <select name=\"client_view[]\" class=\"dropdown\">\n <option <?php if($client_view==\"List View\")echo \"selected\";?> >List View</option>\n <option <?php if($client_view==\"Carousel View\")echo \"selected\";?> >Carousel View</option>\n </select>\n </li> \n </ul>\n <ul class=\"form-elements noborder\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n \t<input type=\"hidden\" name=\"cs_orderby[]\" value=\"client\" />\n <input type=\"button\" value=\"Save\" style=\"margin-right:10px;\" onclick=\"javascript:show_all('<?php echo $name.$counter?>')\" />\n </li>\n </ul>\n </div>\n </div>\n </div>\n<?php\n\tif ( $die <> 1 ) die();\n}", "public function delete()\n {\n $this->invalidateCache();\n parent::delete();\n }", "public function delete()\n {\n $this->invalidateCache();\n parent::delete();\n }", "public static function getTableHTML($cache){\n\n\t\t$current_time = time();\n\t\t$output = 'Refresh after: <b id=\"counter\"></b> second';\n\t\t$output .= '<table id=\"TableViewer\"><tr><th>Key</th><th>Slab</th><th>Size</th><th>Expiration Time</th><th>Expires In</th><th><a href=\"delete_all.php\">Delete ALL</a></th></tr>';\n\t\t$output .= '\n\t\t\t<script>\n\t\t\t\tcounter = Number(document.getElementById(\"refresh_rate\").value)\n\t\t\t\tdocument.getElementById(\"counter\").innerHTML = counter;\n\t\t\t\tfunction openWin(key) {\n\t\t\t\t\tvar url = \"value.php?key=\" + encodeURIComponent(key);\n\t\t\t\t\tvar clientWidth = document.documentElement.clientWidth;\n\t\t\t\t\tvar clientHeight = document.documentElement.clientHeight;\n\t\t\t\t\tmyWindow = window.open(url, \"memcache_value\" ,\"width=\" + (clientWidth - 200) + \",height=\" + (clientHeight - 100) + \",left=\" + (clientWidth/2 - (clientWidth - 200)/2) + \", top=\" + (clientHeight/2 - (clientHeight - 100)/2) + \",scrollbars=yes,resizable=yes,location=no,fullscreen=no,menubar=no,status=no,titlebar=no,toolbar=no\");\n\t\t\t\t\tmyWindow.focus();\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t</script>\n\t\t';\t\n\t\tforeach ($cache->items as $item){\n\t\t\t$item_value_piece = $item->getValuePiece();\n\t\t\tif (strlen($item_value_piece) == 500) {\n\t\t\t\t$item_value_piece = '<font class=\"html_value_piece_color\">' . $item_value_piece . '</font>...';\n\t\t\t} else {\n\t\t\t\t$item_value_piece = '<font class=\"html_value_color\">' . $item_value_piece . '</font>';\n\t\t\t}\n\n\t\t\t$output .= '<tr>';\n\n\t\t\t$output .= '<td class=\"key\"><font class=\"key_color\">' . $item->getKey() . '</font><br>' . $item_value_piece . '</td>';\n\t\t\t$output .= '<td class=\"slab\">' . $item->getSlab() . '</td>';\n\t\t\t$output .= '<td class=\"size\"><a href=\"javascript: openWin(\\'' . $item->getKey() . '\\');\" title=\"Show value...\">' . $item->getSize() . '</a></td>';\n\t\t\t$output .= '<td class=\"expiry_date\">' . $item->getFormattedTime() . '</td>';\n\t\t\t$output .= '<td class=\"expires_in\">' . $item->getFormattedTime($current_time) . '</td>';\n\t\t\t$output .= '<td class=\"delete\"><a href=\"delete.php?delete_item=' . urlencode($item->getKey()) . '\">delete</a></td>';\n\n\t\t\t$output .= '</tr>';\n\n\t\t}//foreach\n\n\t\t$output .= '</table>';\n\n\t\treturn $output;\n\n\t}", "function display_del_form() {\n global $cfg, $lang;\n \n if ($cfg['xml_lang'] == 'ja') {\n $h2_title = 'ログ削除';\n $h3_title = '全てのアクセスログを削除します。';\n $h3_msg = 'マジックワードを入力し、削除ボタンを押して下さい。';\n $h4_title = '※警告 : 使用上の注意';\n $h4_msg = 'このボタンは、テーブル内のデータを全て空にします。(空になるのはデータのみで、'.\n 'テーブルは削除されません。)<br />'.\n 'データベースを初期状態(空)に戻したい場合のみ、自己責任でご使用下さい。';\n } else {\n $h2_title = 'DELETE LOGS';\n $h3_title = 'DELETE ALL LOGS with magic words';\n $h3_msg = 'Enter the magic words and click the button.';\n $h4_title = 'WARNING : PLEASE USE THIS BUTTON WITH CARE.';\n $H4_msg = 'This button empties your log table. '.\n 'Yes, This button is very dangerous.<br />'.\n 'Please push this at your own risk.';\n }\n \n $delete_form =<<<EOD\n<h2>{$h2_title}</h2>\n<h3>{$h3_title}</h3>\n<p>{$h3_msg}</p>\n<div class=\"important\">\n<h4>{$h4_title}</h4>\n<p>{$h4_msg}</p>\n</div>\n<form method=\"post\" action=\"{$_SERVER['PHP_SELF']}\">\n<p>\n{$lang['magic_words']} : \n<input tabindex=\"6\" accesskey=\"m\" type=\"text\" name=\"del\" value=\"\" />\n</p>\n<p>\n<input tabindex=\"6\" accesskey=\"d\" type=\"submit\" value=\"{$lang['del_all_logs']}\" />\n</p>\n</form>\nEOD;\n return $delete_form;\n}" ]
[ "0.62337923", "0.6058721", "0.5875817", "0.5849738", "0.5784982", "0.56534415", "0.5653009", "0.5653009", "0.56236994", "0.56135225", "0.55350953", "0.5499438", "0.54934025", "0.5467574", "0.53767633", "0.53647125", "0.53628564", "0.53628564", "0.5360391", "0.52873087", "0.5286593", "0.52720493", "0.5253926", "0.5253729", "0.525364", "0.5241037", "0.5238152", "0.5228622", "0.5221735", "0.52082956", "0.51978314", "0.51978314", "0.51978314", "0.51978314", "0.51978314", "0.51978314", "0.51973885", "0.5194459", "0.51940614", "0.51893556", "0.5168499", "0.5162667", "0.5158307", "0.5142541", "0.5134582", "0.5125442", "0.5121933", "0.51214826", "0.51185304", "0.51055485", "0.51053196", "0.5103264", "0.5100331", "0.509881", "0.5095553", "0.5095553", "0.5095553", "0.5094367", "0.50932264", "0.5092912", "0.5090355", "0.50860333", "0.5085802", "0.5077822", "0.507038", "0.5066635", "0.5065055", "0.5063174", "0.505954", "0.50568783", "0.5056756", "0.5055868", "0.5053823", "0.5052526", "0.5044976", "0.50448966", "0.5043756", "0.5039852", "0.503719", "0.50368655", "0.5033213", "0.5030007", "0.50279117", "0.50279117", "0.50279117", "0.50279117", "0.50279117", "0.50279117", "0.50279117", "0.50279117", "0.50279117", "0.50279117", "0.50262576", "0.50258994", "0.50219727", "0.5020549", "0.50198895", "0.50198895", "0.50070137", "0.5005616" ]
0.76216197
0
public $permission = 'list'; We do a special check of permissions because our objects is not an instances of modAccessibleObject
public function beforeQuery() { if (!$this->checkPermissions()) { return $this->modx->lexicon('access_denied'); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getObjectPermissions(): array;", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "function list()\n {\n if($this->checkAccess('permission.list') == 1)\n {\n $this->loadAccessRestricted();\n }\n else\n { \n \n $data['permissionRecords'] = $this->permission_model->permissionListing();\n \n $this->global['pageTitle'] = 'School : Permission Listing';\n \n $this->loadViews(\"permission/list\", $this->global, $data, NULL);\n }\n }", "public function is_allowed_to_set_content_object_rights();", "protected function getCheckModifyAccessListHookObjects() {}", "public function getPermissions() {}", "public function getPermissions() {}", "public function & GetPermissions ();", "function _elggx_list_perms_handler($hook, $permission, $is_granted, $params) {\n\tif ($is_granted || empty($params['user'])) {\n\t\treturn;\n\t}\n\t$user = $params['user'];\n\t/* @var ElggUser $user */\n\t$list = $params['list'];\n\t/* @var Elggx_Lists_List $list */\n\n\t$ia = elgg_set_ignore_access();\n\t$entity = get_entity($list->getEntityGuid());\n\telgg_set_ignore_access($ia);\n\n\tif ($entity && $entity->canEdit($user->guid)) {\n\t\treturn true;\n\t}\n}", "abstract public function getPermissions();", "static function getPermissions() {\n if(self::$permissions === false) {\n self::$permissions = new NamedList(array(\n\n ));\n\n EventsManager::trigger('on_system_permissions', array(&self::$permissions));\n } // if\n\n return self::$permissions;\n }", "public function doesCheckModifyAccessListHookModifyAccessAllowed() {}", "static function getPermission()\n {\n return [self::BULLETIN => 'article_createBulletin'];\n }", "function get_permission_list() {\n\t\treturn $this->db->get('system_security.security_permission');\n\t\t\n\t}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "private function canListAndCreate()\n {\n return true;\n }", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function getPermissions();", "public function getAccessionsList(){\n return $this->_get(2);\n }", "public function getAccessionsList(){\n return $this->_get(2);\n }", "protected function getAllowedItems() {}", "protected function getAllowedItems() {}", "protected function getAllowedItems() {}", "public function get_item_permissions_check($request)\n {\n }", "public function isAccess();", "private function filterByPermission(){\n\n }", "abstract protected function canAccess();", "static function access(){\n return onapp_has_permission(array('hypervisors', 'hypervisors.read'));\n }", "public function index()\n {\n return $permissions = $this->permission->all();\n }", "public function checkAccess()\n {\n // need to be modified for security\n }", "function set_can_create_list ($permission)\r\n {\r\n $_SESSION[\"can_create_list\"] = $permission;\r\n }", "public function getAdminPermissions(): array;", "public function getAcl()\n\t{\n\t\t//throw new \\Exception(\"something\");\n\n\t\tif (!isset($this->persistent->acl)) {\n\n\t\t\t$acl = new AclList();\n\n\t\t\t$acl->setDefaultAction(Acl::DENY);\n\n\t\t\t//Register roles\n\t\t\t$roles = array(\n\t\t\t\t'guests' => new Role('Guests'),\n\t\t\t\t'users' => new Role('Users'),\n\t\t\t\t'admins' => new Role('Admins'),\n\t\t\t);\n\t\t\tforeach ($roles as $role) {\n\t\t\t\t$acl->addRole($role);\n\t\t\t}\n\n\t\t\t//Паблик но ложим куку\n\n\t\t\t$publicResources = array(\n\t\t\t\t'login' => array('*'),\n\t\t\t\t'index' => array('*'),\n\t\t\t\t'error' => array('*'),\n\t\t\t\t'auth' => array('*'),\n\t\t\t\t'admin' => ['login']\n\t\t\t);\n\n\n\t\t\t//закрытые\n\t\t\t$privateResources = array(\n\t\t\t\t'index' => array('planing','focus'),\n\t\t\t);\n\n\t\t\t// TODO:пройтись и прописать отдельно права для каждого модуля/контроллера\n\n\t\t\t//закрытые админские\n\t\t\t$adminResources = [\n\t\t\t\t'admin' => [\n\t\t\t\t\t'index'\n\t\t\t\t]\n\t\t\t];\n\t\t\t/*$adminResources = array(\n\t\t\t\t'admin' => array('*'),\n\t\t\t);*/\n\n\t\t\tforeach ($publicResources as $resource => $actions) {\n\t\t\t\t$acl->addResource(new Resource($resource), $actions);\n\t\t\t}\n\n\t\t\tforeach ($privateResources as $resource => $actions) {\n\t\t\t\t$acl->addResource(new Resource($resource), $actions);\n\t\t\t}\n\n\t\t\tforeach ($adminResources as $resource => $actions) {\n\t\t\t\t$acl->addResource(new Resource($resource), $actions);\n\t\t\t}\n\n\t\t\t//по умолчанию всем даем \n\t\t\tforeach ($roles as $role) {\n\t\t\t\tforeach ($publicResources as $resource => $actions) {\n\t\t\t\t\tforeach ($actions as $action){\n\t\t\t\t\t\t//echo 'Role \"' . $role->getName() . '\"' . ' allow to \"' . $resource . '/' . $action . '\";<br />';\n\t\t\t\t\t\t$acl->allow($role->getName(), $resource, $action);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//die();\n\n\t\t\t//Grant acess to private area to role Users\n\t\t\tforeach ($privateResources as $resource => $actions) {\n\t\t\t\tforeach ($actions as $action){\n\t\t\t\t\t$acl->allow('Users', $resource, $action);\n\t\t\t\t\t$acl->allow('Admins', $resource, $action);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ($adminResources as $resource => $actions) {\n\t\t\t\tforeach ($actions as $action){\n\t\t\t\t\t$acl->allow('Admins', $resource, $action);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->persistent->acl = $acl;\n\n\t\t\t/*echo '<pre>';\n\t\t\techo 'new ACL created: <br />';\n\t\t\tvar_dump($this->persistent->acl);\n\t\t\techo '</pre>';\n\t\t\tdie();*/\n\n\t\t\n\t\t} else {\n\t\t\t/*echo '<pre>';\n\t\t\techo 'ACL already exists: <br />';\n\t\t\tvar_dump($this->persistent->acl);\n\t\t\techo '</pre>';\n\t\t\tdie();*/\n\t\t}\n\n\t\treturn $this->persistent->acl;\n\t}", "public function setPermissions() {\r\n\t\tif ($this->canSave) {\r\n\t\t\t$this->canSave = $this->resource->checkPolicy('save');\r\n\t\t}\r\n\t\t$this->canEdit = $this->modx->hasPermission('edit_document');\r\n\t\t$this->canCreate = $this->modx->hasPermission('new_document');\r\n\t\t$this->canPublish = $this->modx->hasPermission('publish_document');\r\n\t\t$this->canDelete = ($this->modx->hasPermission('delete_document') && $this->resource->checkPolicy(array('save' => true, 'delete' => true)));\r\n\t\t$this->canDuplicate = $this->resource->checkPolicy('save');\r\n\t}", "function CheckShowListAccess($item=array())\n {\n if (empty($item)) { return TRUE; }\n\n $res=$this->HasModuleAccess();\n \n return $res;\n }", "function canSeePrivate() {\n \treturn $this->isProjectManager() || (boolean) $this->getSystemPermission('can_see_private_objects');\n }", "public function accesspermissionAction()\r\n {\r\n \r\n $this->sessionAuth->menu_permission('Set_Access_Permission');\r\n $ob_User\t= new User();\r\n $this->view->keyy=$key= trim($this->_request->getParam('user_key',''));\r\n $user_id=0;\r\n if($key)\r\n {\r\n $user_detail=$ob_User->get_transfer_detail_from_key($key);\r\n $user_id=$user_detail['user_id'];\r\n $role_id=$user_detail['account_id'];\r\n }\r\n $this->view->user_id=$user_id;\r\n if($user_id)\r\n {\r\n $ob_Permission\t= new Permission();\r\n $menu_table=$ob_Permission->get_menus();\r\n $this->view->role_permission_table=$ob_Permission->get_role_permission($role_id);\r\n $this->view->user_permission_table=$ob_Permission->get_user_permission($user_id);\r\n $temp_menu_arr=array();\r\n foreach($menu_table as $k=>$v)\r\n {\r\n if(!$v['p_menu_id'])\r\n {\r\n $temp_menu_arr[$v['menu_id']]['menu_name']=$v['menu_name'];\r\n }\r\n else\r\n {\r\n $temp_menu_arr[$v['p_menu_id']]['sub_menues'][$v['menu_id']]=$v['menu_name'];\r\n }\r\n\r\n }\r\n $this->view->menu_table=$temp_menu_arr;\r\n }\r\n else\r\n {\r\n $this->sessionAuth->menu_permission('nope');\r\n }\r\n $layout = $this->_helper->layout();\r\n $layout->setLayout('frontend/onecolumn');\r\n }", "public function checkPermissions();", "public function getAllPermissions(): array;", "public function permissions()\n {\n return [\n 'add parcels', 'edit parcels', 'delete parcels', 'send parcels', 'pick parcels'\n ];\n }", "public static function permissions(): array\n {\n return [];\n }", "public function getPermissionsListAttribute()\n {\n return Permission::orderBy('resource')->get();\n }", "public function index()\n {\n if (Auth::user()->ability('superadministrator', 'read-permissions')){\n return view('permission.read',[\n 'pageheader'=>'权限',\n 'pagedescription'=>'列表',\n 'permissions'=>Permission::all(),\n 'enableUpdate'=>Auth::user()->hasPermission('update-permissions'),\n 'enableDelete'=>Auth::user()->hasPermission('delete-permissions'),\n ]);\n }\n return abort(403,config('yyxt.permission_deny'));\n }", "public function getAllPermissions();", "public function getAllPermissions();", "public function rest_api_permission() {\n return apply_filters('h5p_rest_api_all_permission', current_user_can('edit_others_h5p_contents'));\n }", "public function getAcl() {\n\n //throw new \\Exception(\"something\");\n\n\n\n $acl = new AclList();\n\n $acl->setDefaultAction(Acl::DENY);\n\n //Register roles\n $roles = array(\n 'users' => new Role('Users'),\n 'guests' => new Role('Guests'),\n 'operators' => new Role('Operators')\n );\n foreach ($roles as $role) {\n $acl->addRole($role);\n }\n\n //Private area resources\n $privateResources = array(\n 'report' => array('index', 'main', 'operator', 'mjump', 'network', 'statistics', 'getavgdata', 'payoutreport', 'aggSummary', 'reportbyhour', 'notworking', 'getCarrier', 'getCarrier2', 'statisticsNew', 'index2', 'statistics2', 'lpreport'),\n 'reportmb' => array('index', 'main', 'operator', 'mjump', 'network', 'statistics', 'getavgdata', 'payoutreport', 'aggSummary', 'reportbyhour', 'getCarrier', 'getCarrier2', 'statisticsNew', 'index2', 'statistics2'),\n 'operation' => array('index', 'mainstreamsourcenewname', 'getClientInfo', 'jump', 'updateCampaign', 'getCampaignLink', 'createSource', 'createAggregator', 'getAggInfo', 'link_checker', 'campaign_url', 'createCategory', 'findLatestConv', 'copySource'),\n 'slink' => array('index', 'ajaxtable', 'ajaxinsertgroup', 'ajaxgroupcombo', 'ajaxname', 'ajaxclone', 'ajaxdelete', 'ajaxupdatecell', 'ajaxdeleterow', 'ajaxclonerow', 'ajaxinsertmgroup', 'set_country', 'unset_country'),\n 'smlink' => array('index', 'ajaxtable', 'ajaxinsertgroup', 'ajaxgroupcombo', 'ajaxname', 'ajaxclone', 'ajaxdelete', 'ajaxupdatecell', 'ajaxdeleterow', 'ajaxclonerow', 'ajaxinsertmgroup'),\n 'affiliate' => array('index', 'removeAffiliation', 'updatePayout', 'newAffiliation'),\n 'isp' => array('index', 'get_groups', 'get_group', 'create_group', 'create_isp', 'delete_isp'),\n 'mainstream' => array('index', 'main', 'getCountriesWithDomainid', 'getAllCategories', 'getNjumps', 'getMainstreamHistory', 'saveNewRow'),\n 'mainstreambulk' => array('index', 'gallery', 'updateBannerId', 'insertbanners', 'editbanner', 'searchbanners', 'createBulk', 'editBulk', 'cloneBulk', 'downloadZip', 'tableBulk', 'getNjump', 'getCountry', 'getSources', 'getBulk', 'getBanners', 'downloadXlsx'),\n 'alert' => array('index', 'getSourcesAlerts', 'getClientsAlerts', 'getCountriesAlerts', 'getTablesAlerts', 'newAlert', 'editAlert', 'editTables', 'removeAlert', 'newCountryAlert', 'newAggAlert', 'newSrcAlert', 'getSourceTypeAlerts', 'newSourceTypeAlert'),\n 'invest' => array('index', 'upload', 'report', 'setfilter', 'campaigns', 'getReportExcel', 'totalsRow'),\n 'security' => array('index', 'deletei'),\n 'google' => array('index', 'downloadreport', 'addgooglesource'),\n 'vuclipsreport' => array('index', 'addOne', 'removeOne', 'editOne'),\n 'integration' => array('index', 'save_agregator', 'save_source', 'get_excel', 'report_conversion', 'save_user', 'save_domain', 'delete_domain', 'new_domain', 'get_clicksInfo', 'setEditClicks', 'reverse_multiclick', 'save_risqiq', 'delete_risqiq'),\n 'dashboard' => array('index', 'last7Days', 'percentageShift'),\n 'ticketing' => array('index', 'createTicket', 'editTicket'),\n 'jump' => array('index', 'uploadCsv'),\n 'crm' => array('index', 'getClient', 'createClient', 'editClient', 'getClients', 'last7Days'),\n 'autobid' => array('index', 'addcampaign', 'editcampaign', 'deletecampaign', 'refreshTable', 'downloadReport', 'addAccount', 'resetpass'),\n 'ip' => array('index', 'getIps', 'getCustomIPs', 'getcarriers', 'getclientips', 'testphalconshit', 'addNewCarrier', 'addNewCountry'),\n 'freporting' => array('index', 'upload', 'setFilter', 'updateComment', 'downloadCsv', 'getChart', 'uploadMultiAgg', 'getAffs', 'getAggs'),\n 'sourcesapi' => array('index', 'downloadReport'),\n 'permission' => array('index', 'countries', 'srcagr', 'updatecountry', 'updateAgregators', 'updateSources'),\n 'customreport' => array('index', 'getAttributes', 'savecustomreport', 'createcustom', 'getMyCustomReports', 'echoReport', 'deleteSavedReport', 'downloadReport'),\n 'campaignblocker' => array('index', 'getAffected', 'executeblock', 'executerestore', 'getcampaigns', 'executetemprestore', 'blockbyname'),\n 'rates' => array('index', 'getRateThreeMonths'),\n 'offerpack' => array('index', 'getDims', 'getCarriers', 'newOfferpack', 'newOfferpack2', 'offerpackedit', 'getCarriersMultiple', 'getCampaignJumpName', 'setFilter', 'updateCpa', 'addOffersExcel', 'disableOffer', 'getScreenshot', 'getBanners', 'getCM', 'getAccount', 'deletebanner', 'deletescreenshot', 'getofferinfo', 'updateStatus', 'index2', 'offerpackedit2', 'setFilter2'),\n 'ticketsystem' => array('index', 'editTicket', 'createTicket', 'getUsersMultiple', 'create_ticket', 'sendMessage', 'refreshChat', 'downloadFile', 'uploadFile', 'edit_ticket', 'pickTicket', 'closeTicket', 'reopenTicket', 'setFilter', 'downloadExcel'),\n 'ticketsystem2' => array('index', 'editTicket', 'createTicket', 'getUsersMultiple', 'create_ticket', 'sendMessage', 'refreshChat', 'downloadFile', 'uploadFile', 'edit_ticket', 'pickTicket', 'closeTicket', 'reopenTicket', 'setFilter', 'downloadExcel', 'editticket_itsdes', 'editTicket', 'sendToValidation', 'putOnHold', 'putInProgress', 'refuse', 'request', 'assign', 'ticketok', 'ticketnotok', 'closeticket', 'infosent', 'reopenticket', 'changeDeadline'),\n 'njump' => array('index', 'changeGlobalName', 'getStatistics', 'favoriteNjump', 'getNjumps', 'getnjump', 'newnjump', 'njumpedit', 'njumpclone', 'njumpdelete', 'njumpdeleterow', 'njumpnewrow', 'updatecell', 'njumpsortby', 'indexm', 'njumpeditm', 'mreset', 'getnjumpsbycountry', 'njumpclonemultiplelines', 'njumpdeletemultiplerow'),\n 'landingmanager' => array('index', 'createeditlp', 'getDims', 'setFilter', 'getlpinfo', 'newEditLp', 'getFilters', 'getOfferByGeo', 'insertNewLp', 'newlp', 'getLpInformation', 'saveLp', 'deleteLp', 'viewlp', 'getLpInformationView'),\n 'admin' => array('index', 'displayAgregators', 'removeAgregators', 'removeCountries', 'addAgregators', 'getAllAgregatorsUsers', 'displayCountries', 'getAllCountriesUsers', 'addCountries'),\n 'client' => array('index', 'searchAll', 'getData', 'searchData', 'createClient', 'saveClient', 'updateClient', 'getClientUpdated', 'getTotalRows', 'hideClient', 'getGraphData', 'chatSave', 'getHistoryInfo', 'getIssueInfo'),\n 'sales' => array('index', 'getData', 'createExcel', 'getCarriers')\n );\n foreach ($privateResources as $resource => $actions) {\n $acl->addResource(new Resource($resource), $actions);\n }\n //operation area resources\n $operationResources = array(\n 'operation' => array('index', 'jump', 'updateCampaign', 'getCampaignLink', 'createSource', 'createAggregator', 'getAggInfo', 'link_checker', 'campaign_url', 'createCategory', 'findLatestConv', 'copySource'),\n 'report' => array('index', 'statistics', 'getavgdata', 'aggSummary', 'getCarrier', 'index2', 'statistics2', 'getCarrier2'),\n 'reportmb' => array('index', 'statistics', 'getavgdata', 'aggSummary', 'getCarrier', 'index2', 'statistics2', 'getCarrier2'),\n 'security' => array('index', 'deletei'),\n 'mainstream' => array('index', 'main', 'getCountriesWithDomainid', 'getAllCategories', 'getNjumps', 'getMainstreamHistory', 'saveNewRow'),\n 'mainstreambulk' => array('index'),\n 'vuclipsreport' => array('index', 'addOne', 'removeOne', 'editOne'),\n 'integration' => array('index', 'save_agregator', 'save_source', 'get_excel', 'report_conversion', 'save_user', 'save_domain', 'delete_domain', 'new_domain', 'get_clicksInfo', 'setEditClicks', 'reverse_multiclick', 'save_risqiq', 'delete_risqiq'),\n 'dashboard' => array('index', 'chartinfo', 'reportbyhour', 'percentageShift', 'last7Days', 'getRateThreeMonths'),\n 'ticketing' => array('index', 'createTicket', 'editTicket'),\n 'jump' => array('index', 'uploadCsv'),\n 'crm' => array('index', 'getClient', 'createClient', 'editClient', 'getClients', 'last7Days'),\n 'autobid' => array('index', 'addcampaign', 'editcampaign', 'deletecampaign', 'refreshTable', 'downloadReport', 'addAccount', 'resetpass'),\n 'ip' => array('index', 'getIps', 'getCustomIPs', 'getcarriers', 'getclientips', 'addNewCarrier', 'addNewCountry'),\n 'freporting' => array('index', 'upload', 'setFilter', 'updateComment', 'downloadCsv', 'getChart', 'uploadMultiAgg', 'getAffs', 'getAggs'),\n 'sourcesapi' => array('index', 'downloadReport'),\n 'rates' => array('index', 'getRateThreeMonths'),\n 'offerpack' => array('index', 'getDims', 'getCarriers', 'newOfferpack', 'offerpackedit', 'getCarriersMultiple', 'getCampaignJumpName', 'setFilter', 'updateCpa', 'addOffersExcel', 'disableOffer', 'getScreenshot', 'getBanners', 'getCM', 'getAccount', 'deletebanner', 'deletescreenshot', 'getofferinfo', 'updateStatus', 'index2', 'offerpackedit2', 'setFilter2'),\n 'ticketsystem' => array('index', 'editTicket', 'createTicket', 'getUsersMultiple', 'create_ticket', 'sendMessage', 'refreshChat', 'downloadFile', 'uploadFile', 'edit_ticket', 'pickTicket', 'closeTicket', 'reopenTicket', 'setFilter', 'downloadExcel'),\n 'ticketsystem2' => array('index', 'editTicket', 'createTicket', 'getUsersMultiple', 'create_ticket', 'sendMessage', 'refreshChat', 'downloadFile', 'uploadFile', 'edit_ticket', 'pickTicket', 'closeTicket', 'reopenTicket', 'setFilter', 'downloadExcel', 'editticket_itsdes', 'editTicket', 'sendToValidation', 'putOnHold', 'putInProgress', 'refuse', 'request', 'assign', 'ticketok', 'ticketnotok', 'closeticket', 'infosent', 'reopenticket', 'changeDeadline'),\n 'njump' => array('index'),\n 'campaignblocker' => array('index', 'getAffected', 'executeblock', 'executerestore', 'getcampaigns'),\n 'landingmanager' => array('index', 'createeditlp', 'getDims', 'setFilter', 'getlpinfo', 'newEditLp', 'getFilters', 'getOfferByGeo', 'insertNewLp', 'newlp', 'getLpInformation', 'saveLp', 'deleteLp', 'viewlp', 'getLpInformationView'),\n 'admin' => array('index', 'displayAgregators', 'removeAgregators', 'removeCountries', 'addAgregators', 'getAllAgregatorsUsers', 'displayCountries', 'getAllCountriesUsers', 'addCountries'),\n 'client' => array('index', 'searchAll', 'getData', 'searchData', 'createClient', 'saveClient', 'updateClient', 'getClientUpdated', 'getTotalRows', 'hideClient', 'getGraphData', 'chatSave', 'getHistoryInfo', 'getIssueInfo'),\n 'sales' => array('index', 'getData', 'createExcel', 'getCarriers')\n );\n foreach ($operationResources as $resource => $actions) {\n $acl->addResource(new Resource($resource), $actions);\n }\n\n //Public area resources\n $publicResources = array(\n 'index' => array('index'),\n 'errors' => array('show404', 'show500'),\n 'session' => array('index', 'register', 'start', 'end'),\n 'offerpack' => array('getzip')\n );\n foreach ($publicResources as $resource => $actions) {\n $acl->addResource(new Resource($resource), $actions);\n }\n\n //Grant access to public areas to both users and guests\n foreach ($roles as $role) {\n foreach ($publicResources as $resource => $actions) {\n $acl->allow($role->getName(), $resource, '*');\n }\n }\n\n //Grant acess to private area to role Users\n foreach ($privateResources as $resource => $actions) {\n foreach ($actions as $action) {\n $acl->allow('Users', $resource, $action);\n }\n }\n //Grant acess to operations area to role Operations\n foreach ($operationResources as $resource => $actions) {\n foreach ($actions as $action) {\n $acl->allow('Operators', $resource, $action);\n }\n }\n\n //The acl is stored in session, APC would be useful here too\n $this->persistent->acl = $acl;\n\n\n return $this->persistent->acl;\n }", "abstract protected function getAcl();", "static function access () {\n onapp_debug(__CLASS__.' :: '.__FUNCTION__);\n $return = onapp_has_permission( array( 'roles' ) );\n onapp_debug( 'return => '.$return );\n return $return;\n }", "public static function getList()\n {\n return collect([\n new Permission('control_panel_access', 'Control Panel Access', 'General'),\n new Permission('manage_users', 'Manage Users', 'ACL'),\n new Permission('manage_roles', 'Manage Roles', 'ACL'),\n new Permission('manage_permissions', 'Manage Permissions', 'ACL'),\n ]);\n }", "public function hasAccess($permission);", "public function getAccessList() {\n return $this->_get(16);\n }", "public function listAction()\r\n\t{\r\n\t\t//Access check\r\n\t\t//$acl=Zend_Registry::get('acl');\r\n\t\t$acl=new ResAcl();\r\n\t\t$controller=$this->getRequest()->getControllerName();\r\n\t\tif (!$acl->isAllowed($this->user_role,'role','list')) {\r\n\t\t\t$this->_redirect('/static/noaccess');\r\n\t\t}\r\n\t\t\r\n\t\telse{\r\n\t\t\t//add some code to list controller\r\n\t\t\t$role=new Model_BsRole();\r\n\t\t\t//$result=$role->getAllRole();\r\n\t\t\t$result=$role->numbUsers();\t//number of Users\r\n\t\t\t$this->view->result=$result;\r\n\t\t}\r\n\t}", "public function permissions() {\n\t$this->loadPermissions();\n\treturn $this->permissions;\n}", "function getPermissions(& $obj, &$permissionsElement) {\n\t\t$obj->buildPermissionsArray();\n\t\t$permissions = $obj->getPermissions();\n// \t\tprint \"\\npermissions:\";\n// \t\tprint_r($permissions);\n\t\t\n\t\tif (get_class($obj) != 'site' && $isLocked = $obj->getField('locked')) {\n\t\t\t$locked =& $this->_document->createElement('locked');\n\t\t\t$permissionsElement->appendChild($locked);\n\t\t}\n\t\t\n\t\t$hasView = $this->addPermissions($obj, $permissionsElement, 'view', $permissions);\n\t\t$hasAdd = $this->addPermissions($obj, $permissionsElement, 'add', $permissions);\n\t\t$hasEdit = $this->addPermissions($obj, $permissionsElement, 'edit', $permissions);\n\t\t$hasDelete = $this->addPermissions($obj, $permissionsElement, 'delete', $permissions);\n\t\t$hasDiscuss = $this->addPermissions($obj, $permissionsElement, 'discuss', $permissions);\n\t\t\n\t\tif ($isLocked | $hasView | $hasAdd | $hasEdit | $hasDelete | $hasDiscuss)\n\t\t\t$hasAny = TRUE;\n\t\telse\n\t\t\t$hasAny = FALSE;\n\t\t\n\t\treturn $hasAny;\n\t}", "function custom_permissions() {\n\t\tif ($this->dx_auth->is_logged_in()) {\n\t\t\techo 'My role: '.$this->dx_auth->get_role_name().'<br/>';\n\t\t\techo 'My permission: <br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('edit') != NULL AND $this->dx_auth->get_permission_value('edit')) {\n\t\t\t\techo 'Edit is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Edit is not allowed';\n\t\t\t}\n\t\t\t\n\t\t\techo '<br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('delete') != NULL AND $this->dx_auth->get_permission_value('delete')) {\n\t\t\t\techo 'Delete is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Delete is not allowed';\n\t\t\t}\n\t\t}\n\t}", "function getAllAccess() {\n return ['download', 'remoteAccess', 'remoteService', 'enclave','notAvailable'];\n}", "public function getPermissions() {\r\n $template = $this->getOne('Template');\r\n if (empty($template)) return array();\r\n\r\n /* get permissions for policy */\r\n $c = $this->xpdo->newQuery('modAccessPermission');\r\n $c->sortby('name','ASC');\r\n $permissions = $template->getMany('Permissions',$c);\r\n\r\n $data = $this->get('data');\r\n $lexicon = $template->get('lexicon');\r\n $list = array();\r\n /** @var modAccessPermission $permission */\r\n foreach ($permissions as $permission) {\r\n $desc = $permission->get('description');\r\n if (!empty($lexicon) && $this->xpdo->lexicon) {\r\n if (strpos($lexicon,':') !== false) {\r\n $this->xpdo->lexicon->load($lexicon);\r\n } else {\r\n $this->xpdo->lexicon->load('core:'.$lexicon);\r\n }\r\n $desc = $this->xpdo->lexicon($desc);\r\n }\r\n $active = array_key_exists($permission->get('name'),$data) && $data[$permission->get('name')] ? 1 : 0;\r\n $list[] = array(\r\n $permission->get('name'),\r\n $permission->get('description'),\r\n $desc,\r\n $permission->get('value'),\r\n $active,\r\n );\r\n }\r\n return $list;\r\n }", "public function isAclEnabled(): bool;", "public function permissions()\n\t{\n\t\treturn $this->get('permissions');\n\t}", "function permissions() {\r\n\t\treturn false;\r\n\t}", "public function allow_manage(stdClass $instance) {\n return true;\n }", "public function getListPermission()\n { \n $permissions = Permission::orderBy('id', 'desc');\n \n return Datatables::of($permissions)\n ->addIndexColumn()\n ->editColumn('description', function($permissions){\n if (Entrust::can([\"permissions-detail\"])) {\n return '<a onclick=\"viewDetail('.$permissions->id.');\" class=\"btn btn-xs btn-info\" title=\"Xem chi tiết\" data-tooltip=\"tooltip\"><i class=\"fa fa-eye\" aria-hidden=\"true\"></i></a>';\n } else {\n return null;\n }\n })\n ->editColumn('created_at', function($permissions){\n $time = $permissions->created_at;\n $time_numb = strtotime($time);\n\n return date(\"H:i | d-m-Y\", $time_numb);\n })\n ->addColumn('action', function($permissions){\n $string = '';\n\n if (Entrust::can([\"permissions-manager\"])) {\n $string = $string .'<a class=\"btn btn-xs yellow\" onclick=\"showEdit('.$permissions->id.');\" title=\"Chỉnh sửa\" data-tooltip=\"tooltip\"><i class=\"fa fa-pencil-square-o\" aria-hidden=\"true\"></i></a>';\n }\n\n return $string;\n })\n ->rawColumns(['action', 'description'])\n ->make(true);\n \n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_logistics/equipment');\n }", "public function allow_manage(stdClass $instance) {\n return false;\n }", "public function doesCheckModifyAccessListHookGetsCalled() {}", "public function test_permission_index()\n {\n Permission::index();\n $index = Permission::getIndex();\n // Index there and is the right type?\n $this->assertInstanceOf('Birdmin\\Collections\\PermissionCollection', $index);\n $this->assertGreaterThan(0,$index->count());\n\n // Basic permission exists?\n $this->assertInstanceOf('Birdmin\\Permission', $index->lookup('view', 'Birdmin\\Page'));\n\n // Test the right permission being returned.\n $permission = $index->lookup('view', 'Birdmin\\Page');\n $this->assertEquals('view', $permission->ability);\n $this->assertEquals('Birdmin\\Page', $permission->object);\n\n // Non-existent permission returning null with bogus ability?\n $this->assertNull($index->lookup('wrong', 'Birdmin\\Page'));\n\n // Non-existent permission returning null with bogus model?\n $this->assertNull($index->lookup('view', 'Wrong'));\n }", "public function permissions()\n {\n return $this->permissionModel->findAll();\n }", "public function can_do ( $gid, $app, $object ) {\r\n\r\n // Initializations\r\n $gid = $gid ? $gid : \"''\";\r\n $this->permissions = array();\r\n\r\n // Extract and set permissions array\r\n $permissions = join(\",\", $this->db->getCol(\"SELECT permissions FROM \".PERMISSIONS_TABLE.\" WHERE group_id IN ($gid) AND app = '$app' AND object = '$object'\") );\r\n if( $permissions ) foreach( explode(\",\",$permissions) as $p ) $this->permissions[$p] = 1;\r\n\r\n }", "public function permissions()\n {\n return $this->permissions;\n }", "private function loadPermissions() {\n\tif ($this->permissionsloaded) {return;}\n\t//$mem = DStructMemCache::getInstance();\n\t//if (!$this->permissions = $mem->get(md5(get_class($this->activecontainer).$this->areaname.$this->activecontainer->getID()))) {\n\t\t$this->permissions = $this->activecontainer->permissions();\n\t//\t$mem->set(md5(get_class($this->activecontainer).$this->areaname.$this->activecontainer->getID()), $this->permissions);\n\t//}\n\t$this->permissionsloaded = true;\n}", "public function accesspermission1Action()\r\n {\r\n Zend_Loader::loadClass('Permission');\r\n $this->sessionAuth->menu_permission('Set_Access_Permission');\r\n $ob_User\t= new User();\r\n $key= trim($this->_request->getParam('user_key',''));\r\n $user_id=0;\r\n if($key)\r\n {\r\n $user_detail=$ob_User->get_transfer_detail_from_key($key);\r\n $user_id=$user_detail['user_id'];\r\n $role_id=$user_detail['account_id'];\r\n }\r\n $this->view->user_id=$user_id;\r\n if($user_id)\r\n {\r\n $ob_Permission\t= new Permission();\r\n $menu_table=$ob_Permission->get_menus();\r\n $this->view->role_permission_table=$ob_Permission->get_role_permission($role_id);\r\n $this->view->user_permission_table=$ob_Permission->get_user_permission($user_id);\r\n $temp_menu_arr=array();\r\n foreach($menu_table as $k=>$v)\r\n {\r\n if(!$v['p_menu_id'])\r\n {\r\n $temp_menu_arr[$v['menu_id']]['menu_name']=$v['menu_name'];\r\n }\r\n else\r\n {\r\n $temp_menu_arr[$v['p_menu_id']]['sub_menues'][$v['menu_id']]=$v['menu_name'];\r\n }\r\n\r\n }\r\n //print \"<pre>\"; print_r($this->view->user_permission_table); print \"</pre>\";\r\n //print \"<pre>\"; print_r($temp_menu_arr); print \"</pre>\";\r\n $this->view->menu_table=$temp_menu_arr;\r\n\r\n //exit;\r\n /*$this->view->user_detail=$ob_User->getUserDetails($user_id);\r\n $ob_Credit\t= new Credit();\r\n $user_current_balance=$ob_Credit->get_current_balance($user_id);\r\n $this->view->user_expiary_date=$user_current_balance[$user_id]['expiary_date'];\r\n\r\n $subusers=$ob_User->get_sub_user_ids($user_id,0,0);\r\n $this->view->subusers_count=($subusers)?count(explode(',',$subusers)):0;*/\r\n }\r\n else\r\n {\r\n $this->sessionAuth->menu_permission('nope');\r\n }\r\n\r\n\r\n /*\r\n $ob_User\t= new User();\r\n $this->view->user_rows=$ob_User->get_user_list_rows(0,$quick_search,$arr_limit,$arr_order);\r\n $row_count=$ob_User->get_user_list_rows_count(0,$quick_search);\r\n $arr_rows=array('user_id','account_name','phone','email','nric');\r\n $this->view->page_sorting_images=$this->sessionAuth->get_sorting_html($arr_rows,$arr_order);\r\n\r\n $this->view->page_peginetion=$this->sessionAuth->get_peginetion($row_count,$page,$num_row);*/\r\n//print \"<pre>\"; print_r($aaaaaaa); print \"</pre>\"; exit;\r\n $layout = $this->_helper->layout();\r\n $layout->setLayout('frontend/onecolumn');\r\n }", "function getPermissions(&$record){\n $auth =& Dataface_AuthenticationTool::getInstance();\n $user =& $auth->getLoggedInUser();\n if ( $user ) return Dataface_PermissionsTool::ALL();\n return Dataface_PermissionsTool::NO_ACCESS();\n }", "public function listAction() {\n\n\t}", "public function testPermissionSet()\n {\n }", "protected function _hasModPermission(){\n global $auth;\n return $auth->acl_get('m_inttree');\n }", "public function getPermissions(): array {\n\t\treturn [];\n\t}", "function getPermissions() {\n // For eficientcy, we will just store the names, not the objects\n if ( is_null($this->allPermissions) ) {\n $tmpRole = FactoryObject::newObject(\"_Permission\");\n $this->allPermissions = $tmpRole ->getAllPermissionByIdRole($this->getId());\n } \n\n return $this->allPermissions;\n }", "public function listPermissions($user) {\n return $user->permissions;\n }", "public function checkPermissions() {\r\n\t\treturn $this->modx->hasPermission('edit_document');\r\n\t}", "function menu_permissions($controller,$action,$userID) {\n\t\t App::import('Model','Permission');\n\t\t $this->Permission= new Permission;\n\t\t $cond = \"WHERE controller='$controller' AND action='$action'\";\n\t\t $permissionsResult = $this->Permission->find('first',array(\n\t\t 'fields' => array('user_id'),\n\t\t 'conditions' => $cond,\n\t\t ));\n\t\t if(!empty($permissionsResult)){\n\t\t $users = explode(\",\",$permissionsResult['Permission']['user_id']);\n\t\t\tif (in_array($userID,$users)) {\n\t\t\treturn true;\n\t\t }\n\t\t else{\n\t\t\treturn false;\n\t\t }\n\t\t }\n\t\t return true;\n\t\t \n\t}", "public function accesses()\n {\n return $this->morphMany(Access::class,'accessible','accessible_type','accessible_id','uuid');\n }", "public static function getPermissions(): array\n {\n return [];\n }", "protected function editLockPermissions() {}", "public function testAllPermissions()\n {\n }", "public function getPossiblePermissions();", "public function can($permission);", "function listObjects();", "protected function check_permission()\n {\n return true;\n }", "abstract public function getAccessRights(): array;", "function isAllowedPermission()\n {\n $retObj = array();\n try {\n\n if (isset($_REQUEST['user_id']) && isset($_REQUEST['is_backend']) && isset($_REQUEST['method']))\n {\n $retObj['allowed'] = false;\n\n $params = array(\n 'user_id' => $_REQUEST['user_id'],\n 'is_backend' => $_REQUEST['is_backend'],\n 'method' => $_REQUEST['method']\n );\n\n $aclObj = new AclManager();\n $permissions = $aclObj->getUserPermissions($params);\n\n //c. check if method valid\n foreach($permissions as $permission)\n {\n if($permission['title'] == $params['method']) {\n $retObj['allowed'] = true;\n }\n }\n\n } else {\n\n throw new \\Exception('Unsupported Request: missing critical parameter(s).');\n\n }\n\n } catch (\\Exception $e) {\n\n Api::invalidResponse(\n $e->getMessage(),\n 400,\n Constants::STATUS_INVALID,\n $e,\n true,\n true\n );\n\n }\n\n return Api::apiResponse($retObj, Constants::STATUS_SUCCESSFUL);\n }" ]
[ "0.73302984", "0.71466494", "0.71466494", "0.71466494", "0.71466494", "0.71466494", "0.69460094", "0.6912734", "0.67629665", "0.6662247", "0.6662247", "0.664815", "0.6578824", "0.65046036", "0.6490238", "0.6451869", "0.6414268", "0.6409576", "0.63986313", "0.63986313", "0.6397411", "0.6397411", "0.6397411", "0.63974017", "0.6396231", "0.6396231", "0.6396231", "0.6378221", "0.63569987", "0.63569987", "0.6344828", "0.6344828", "0.6344828", "0.63393235", "0.6332046", "0.6328012", "0.6327898", "0.6320408", "0.6319976", "0.6317665", "0.63123554", "0.62749285", "0.62688386", "0.62536275", "0.62399447", "0.62361", "0.622912", "0.62249386", "0.62148726", "0.61932117", "0.6141231", "0.6138176", "0.61070853", "0.6106445", "0.6106445", "0.6102184", "0.60846573", "0.6065324", "0.6059751", "0.60582685", "0.60417044", "0.60398644", "0.6038563", "0.6032759", "0.601912", "0.6016608", "0.60162455", "0.6009276", "0.6007088", "0.60056293", "0.60034645", "0.6002678", "0.59900725", "0.5989357", "0.59884095", "0.598699", "0.59844285", "0.5976191", "0.5967608", "0.5965701", "0.5961284", "0.59582794", "0.5954696", "0.5950565", "0.5947377", "0.59449685", "0.5943501", "0.59422624", "0.5936358", "0.5927003", "0.5925757", "0.5913042", "0.59078836", "0.5907487", "0.5906618", "0.59050345", "0.590498", "0.59010583", "0.589164", "0.5891102", "0.5886402" ]
0.0
-1
Display a product of the resource.
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Product $product)\r\n {\r\n //\r\n }", "public function show(Product $product)\n {\n \n }", "public function show(Product $product)\n {\n \n }", "public function show(Product $product)\n {\n \n }", "public function show(Product $product)\n {\n\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(Product $product)\n {\n //\n }", "public function show(product $product)\n {\n //\n }", "public function show(product $product)\n {\n //\n }", "function show()\n\t{\n\t\t$this->layout->set(null);\n\t\t$id = getParameter('id');\n\t\t$data = [\n\t\t\t'product' => $this->model->product->find_by_id($id)\n\t\t];\n\t\t$this->view->load('product/show', $data);\n\t}", "public function show($product) {\n \n }", "public function show(Product $product)\n {\n //\n\n }", "public function show(Product $product)\n {\n //\n }", "public function productShowAction($id)\n {\n \n $repositoryProduct = $this->getDoctrine()\n ->getRepository('MainBundle:Product');\n \n \n // find product by id\n $product = $repositoryProduct->find($id);\n \n \n \treturn $this->render('MainBundle:Public:product.html.twig', array(\n 'product' => $product,\n ));\n }", "public function show($product)\n {\n //\n }", "public function show($product)\n {\n\n }", "public function productDetailsAction()\n {\n $vars['productId'] = $this->route['id'];\n $vars['product'] = $this->model->getById($vars['productId']);\n $vars['colors'] = $this->model->getAvailableColors($vars['productId']);\n $this->view->render('Riding Gear', $vars);\n }", "public function show(Product $product)\n {\n // Maybe a model? Will have to see how it works with snipcart's cart\n }", "public function show(Product $product)\n {\n //\n return $product;\n }", "public function actionProductdetail()\n {\n $route = 'merchant.getProduct';\n $request = new getProductRequest();\n $request->setCustomerId($this->customer_id);\n $request->setAuthToken($this->auth_token);\n $request->setWholesalerId(33);\n $request->appendProductIds(4678);\n $result = Proxy::sendRequest($route, $request);\n $header = $result->getHeader();\n $body = getProductResponse::parseFromString($result->getPackageBody());\n return $this->render('index',[\n 'request' => $request->toArray(),\n 'route' => $route,\n 'header' => $header,\n 'body' => $body\n ]);\n }", "public function show(Product $product)\n {\n /*\n * TODO\n * Es necesaria una vista para los detalles del producto?\n * en esta vista se deben mostrar\n * detalles del producto que\n * no estan disponibles en la\n * vista de lista\n */\n }", "public function viewProductAction($id) {\r\n $em=$this->getDoctrine()->getManager();\r\n $product=$em->getRepository('HologramBundle:Product')->find($id);\r\n return $this->render('HologramBundle:Front:oneProduct.html.twig',array('p'=>$product)); \r\n }", "public function show(Product $product)\n {\n return $product;\n }", "public function show(Product $product)\n {\n return $product;\n }", "public function show(Product $product)\n {\n return $product;\n }", "public function show(Product $product)\n {\n return $product;\n }", "public function show(Product $product)\n {\n return $product;\n }", "public function showAction(Product $product)\n {\n\n $em = $this->getDoctrine();\n $id = $product->getId();\n $product = $em->getRepository('AppEducationBundle:Product')->findById($id);\n $product = $product[0];\n $image = $em->getRepository('AppEducationBundle:Image')->findByProduct($id);\n\n $product_data['product'] = $product;\n $product_data['image'] = $image;\n return $this->render('AppEducationBundle:Products:show.html.twig', $product_data);\n }", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function showProduct($id){\n $p = Product::find($id);\n\n \t//Return view with selected product, if it exists.\n \treturn view('others.product', ['product' => $p]);\n }", "public function showAction(Product $product)\n {\n $deleteForm = $this->createDeleteForm($product);\n\n return $this->render('product/show.html.twig', array(\n 'product' => $product,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function viewdetailsAction()\n {\n $productId = $this->_getParam('product_id');\n $product = $this->_model->setId($productId);\n $this->view->product = $product->fetch(); \n \n }", "public function showProductButton() {\n\n\t\techo $this->getProductButton();\n\t}", "public function show()\n {\n $products = \\App\\Product::get();\n return view('products.show')->with('products', $products);\n }", "public function show(Product $products)\n {\n //\n }", "public function show(PicProduct $picProduct)\n {\n //\n }", "public function showProduct()\n {\n $products = DB::table('products')\n ->join('categories','categories.id','=','products.categoryId')\n ->join('manufacturers','manufacturers.id','=','products.manufacturerId')\n ->select('products.*','categories.categoryName','manufacturers.manufacturerName')\n ->get();\n return view('admin.product.manageProduct',compact('products'));\n }", "public function show($id)\n {\n $result['page_set'] = 'product_show';\n\n $product = $this->productService->findProduct($this->decrypt($id));\n $result['name'] = $product->name;\n $result['description'] = $product->description;\n $result['short_description'] = $product->short_description;\n $result['status'] = $product->status;\n $result['images'] = $product->featured_image;\n\n foreach ($product->category as $category) {\n $result['category_name'] = $category->name;\n }\n\n $result['product'] = $product;\n\n return view('admin.modules.product.show', $result);\n }", "public function show(Product $product)\n {\n\n // tarea agregar a producto\n // stock\n // reviews\n // video\n // discount\n\n return view('components/products.show',compact('product'));\n }", "public function show($id) {\n\t\t$product = $this->product->getOneProduct($id);\n\t\treturn $this->response([\"data\" => $product], 200);\n\t}", "public function show(ProductItem $productItem)\n {\n //\n }", "public function show(ProductItem $productItem)\n {\n //\n }", "public function show($product)\n {\n return response()->json(app(GetProductRequest::class)->product($product));\n }", "public function show(ImgProduct $imgProduct)\n {\n //\n }", "public function viewproduct($id) {\n \n $productdetails = ProductProperties::whereProductId($id)->get();\n \n return view ('Product.product-details', compact('productdetails'));\n \n }", "public function show(){\n $per = self::get_permission();\n $all = product::all();\n return view('dashboard.product.show',compact('all','per'));\n }", "public function show(Product $product)\n {\n return $this->showOne($product);\n }", "public function show($id)\n {\n $product = Product::findOrFail($id);\n return 'Name: ' . $product->name\n . '<br/>Price: ' . $product->price\n . '<br/>Image: ' . $product->imgFull;\n }", "public function show(Product $product, $id)\n {\n\t $product = Product::where('id', $id)\n\t ->with('image')\n\t ->with('author')\n\t ->with('category')\n\t ->with('genre')\n\t ->where('ebook', 0)\n\t ->get();\n\n\t return view('age-layouts.' . Session::get('ageGroup') . '.product', ['product' => $product]);\n }", "public function show(Product_option $product_option)\n {\n //\n }", "public function show(ProductProductType $productProductType)\n {\n //\n }", "public function show(Product $product) // passando ciò come parametri alla funzione show ottengo lo stesso risultato di ::find\n {\n // $product = Product::find($id); //quando il prarametro $id è uguale al id del prodotto...\n if($product) {\n $data = [\n 'product' => $product\n ];\n return view('products.show', $data);\n } else {\n abort(404);\n }\n }", "public function showAction($id)\n {\n $dm = $this->getDocumentManager();\n\n $document = $dm->getRepository('StoreBundle:Product')->find($id);\n\n if (!$document) {\n throw $this->createNotFoundException('Unable to find Product document.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n\n return $this->render('StoreBundle:Product:show.html.twig', array(\n 'document' => $document,\n 'delete_form' => $deleteForm->createView(), ));\n }", "public function show($id)\n {\n \n $product = Product::find($id);\n \n return view('admin.product.show')->with('product', $product);\n }", "public function show( $id ) {\n // $product = Product::find( $id );\n $product = DB::table( 'product' )\n ->join( 'type', 'type.id', '=', 'product.type' )\n ->join( 'producer', 'producer.id', '=', 'product.producer' )\n ->select( DB::raw( 'product.id, product.name, type.name as type, producer.name as producer, product.amount, product.image, product.price_input' ) )\n ->orderby( 'product.id', 'desc' )\n ->get();\n //pass posts data to view and load list view\n return view( 'product.show', ['product' => $product[0]] );\n }", "public function show($id)\n {\n $theProduct = Product::find($id);\n\n return view('front.products.show', compact('theProduct'));\n }", "public function show($id)\n {\n return view('shop::product.show');\n }", "public function show($id)\n {\n $product = DB::table('product')\n ->where('product.id', '=', $id)\n ->join('category', 'product.category_id', '=', 'category.id')\n ->join('users', 'product.created_by', '=', 'users.id')\n ->select('product.id', 'product.name', 'product.description', 'product.short_description', 'product.image_url', 'product.dimensions', 'product.serving_size', 'product.shelf_life', 'product.storage', 'product.tags', 'category.name as category', 'users.name as username', 'product.created_at', 'product.updated_at' )\n ->first();\n\n $data = [ 'data' => $product];\n return view('partials.admin.admin-show-product', $data);\n }", "public function show($id)\n {\n //get product by id\n $data['product']=Product::find($id);\n $data['attribute']=Attribute::find($id);\n return view('backend.product.show',compact('data'));\n }", "public function show()\n {\n $products = Product::orderBy('id','desc')->get();\n\n return view('customer.product.show',compact('products'));\n }", "public function show($id)\n {\n return view('product::show');\n }", "public function show($id)\n {\n return view('product::show');\n }", "public function show($id)\n\n {\n\n $product =Product::findOrFail($id);\n\n\n\n return view('backEnd.admin.product.show', ['product' => $product]);\n\n }", "public function show(Product $product)\n {\n return (new ProductResource($product))->response();\n }", "public function product_detail() {\n global $product;\n WC_Gokeep_JS::get_instance()->product_detail( $product );\n }", "public function adminProductAction()\n {\n $productManager = new ProductManager();\n $products = $productManager->getAllProducts();\n return $this->twig->render('admin/admin_products.html.twig', array(\n \"products\" => $products));\n }", "public function show($id)\n {\n //return view('product::show');\n }", "public function actionProduct($slug)\n {\n $productModel = new Product();\n $topImages = $productModel->getTopItems();\n $model = Product::find()->where(['slug' => $slug])->one();\n\n return $this->render('product', [\n 'model' => $model,\n 'topImages' => $topImages,\n ]);\n }", "public function show($id) {\n $product = $this->product->find($id);\n \n $titlle = \"Exibe produdo: $product->name\";\n \n \n return view('painel.products.show', compact('product', 'tittle'));\n \n }", "public function show($id)\n {\n //$product = Product::find($id);\n\n //return view('products.show')->withProduct($product);\n }", "function lb_show_single_product_page_action() {\n\t$product_id = esc_html( $_GET['id'] );\n\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'single_product',\n\t\t\t'products' => lb_get_products_data( 5 ),\n\t\t\t'this_product' => lb_get_product_data_by_id( $product_id ),\n\t\t\t'category' => lb_get_product_category_by_id( $product_id ),\n\t\t)\n\t);\n}", "public function show($id)\n {\n // $product = $this->repository->where('id', $id)->first();\n // $product = $this->repository->find($id);\n\n if(!$product = $this->repository->find($id))\n return redirect()->back();\n\n\n return view('admin.pages.products.show', compact('product'));\n }", "public function show($id)\n {\n $product=Product::find($id);\n return view('admin.product.show',compact('product'));\n\n }" ]
[ "0.80111605", "0.7928877", "0.7928877", "0.7928877", "0.7915743", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7880663", "0.7880663", "0.7874266", "0.7871754", "0.78658336", "0.7851666", "0.77462417", "0.77219254", "0.76703125", "0.76516825", "0.76453173", "0.7589466", "0.7496509", "0.7457596", "0.740474", "0.737946", "0.737946", "0.737946", "0.737946", "0.737946", "0.7326635", "0.7264356", "0.7241136", "0.719717", "0.7196297", "0.7184919", "0.71595335", "0.7155939", "0.71173644", "0.70947427", "0.7091124", "0.70632654", "0.7062096", "0.7062076", "0.7062076", "0.7058071", "0.70470065", "0.7038524", "0.70303184", "0.700105", "0.6990995", "0.6983509", "0.69816834", "0.6978718", "0.69764674", "0.6975755", "0.6973198", "0.6969642", "0.6964148", "0.6963288", "0.695868", "0.69514424", "0.69471246", "0.69259596", "0.69259596", "0.6923793", "0.692319", "0.6922039", "0.69210076", "0.69205666", "0.69172275", "0.6915935", "0.6905251", "0.6901852", "0.68975395", "0.6896553" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { if(array_key_exists('product_image_id', $_REQUEST)){ $id = $_REQUEST['product_image_id']; } // delete image from folder $product_image = ProductImage::find($id); Storage::disk('public_products')->delete($product_image->location); return $this->productImageService->delete($id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Sanitize and enpoint URL by trimming it from spacelike characters on both sides and also stripping (possible multiple) last directory separator on URL (for endpoint string match)
public function sanitizeURL($endpointURL = ""){ $endpointURL = trim($endpointURL); $endpointURL = rtrim($endpointURL, "/"); return $endpointURL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalize($url) {\n\t\t//$result = preg_replace('%(?<!:/|[^/])/|(?<=&)&|&$|%', '', $url);\n\t\t$result=str_replace(array('://','//',':::'),array(':::','/','://'),$url);\n\t\treturn $result;\n\t}", "protected function normalize($url) {\n $matches = array();\n \n $url = str_replace(\"\\\\\", '/', $url);\n \n // no schema\n if (preg_match(\"/\\\\A[^:\\\\/]+:(\\\\/\\\\/.*)/\", $url, $matches))\n $url = $matches[1];\n // no host name or login information\n if (preg_match(\"/\\\\A\\\\/\\\\/[^\\\\/]+(.*)/\", $url, $matches))\n $url = $matches[1];\n // strip fragments\n if (preg_match(\"/\\\\A([^#]+)#/\", $url, $matches))\n $url = $matches[1];\n // strip query string\n if (preg_match(\"/\\\\A([^?]+)\\\\?/\", $url, $matches))\n $url = $matches[1];\n // no trailing slash\n if (substr($url, -1) == '/')\n $url = substr($url, 0, -1);\n \n // process . and ..\n $cleaned = array();\n foreach (explode('/', $url) as $folder) {\n if ($folder == '.')\n continue;\n if (($folder == '') && (count($cleaned) > 0))\n continue;\n \n if ($folder == '..') {\n if (count($cleaned) > 1)\n array_pop($cleaned);\n } else {\n $cleaned[] = $folder;\n }\n }\n \n return implode('/', $cleaned);\n }", "public function cleanUri(){\n return preg_replace('/[^\\da-z\\-\\/\\_]/i', '', filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL));\n }", "function normalize_url($url) {\n\n $url = trim($url);\n if (!$url) return $url;\n\n if (preg_match('~^([a-z0-9_-]+)://~i', $url)) {\n return $url;\n }\n\n return 'http://' . $url;\n }", "function yt_clean_url( $url ) {\n\t\tif ( '' == $url )\n\t\t\treturn;\n\t\t\t\n\t\t$url = preg_replace('/\\?.*/', '', $url);\n\t\t\n\t\treturn $url;\n\t \n\t}", "function format_url($url)\n{\n return '/' . trim($url, '/');\n}", "public function getSanitizedUrl()\n {\n $url = preg_replace(\"/\\\\?.*/\", \"\", $this->url);\n $url = preg_replace(\"/\\\\:\\\\d{4}/\", \"\", $url);\n return $url;\n }", "public static function Zf_URLSanitize() {\n\n /**\n * IF A URL HAS BEEN SET, GET IT FOR SANITIZATION\n */\n $zf_url = isset($_GET['url']) ? $_GET['url'] : null;\n\n\n /**\n * REMOVE THE LAST FORWARD SLASH \"/\" FROM THE URL\n */\n $zf_url = rtrim($zf_url, '/');\n\n\n /**\n * FILTER THE URL TO ONLY REMAIN WITH CLEAN URL\n */\n $zf_url = filter_var($zf_url, FILTER_SANITIZE_URL);\n\n\n /**\n * SPLIT THE URL, WITH \"/\" AS THE DELIMITER WHILE RETURNING EACH PART INTO\n * AN ARRAY\n */\n $zf_url = explode('/', $zf_url);\n\n //print_r($zf_url); echo \"<br><br>\"; //This is strictly for debugging purposes.\n\n\n /**\n * RETURNS AN ARRAY OF THE URL PARTS.\n */\n return $zf_url;\n }", "function filter_url( $url ) {\n\treturn preg_replace( \"/\\s*[^:]+:\\/\\/(www.)?/\", \"$2\", $url );\n\t\n}", "function string_sanitize_url( $p_url ) {\r\n\r\n\t$t_url = strip_tags( urldecode( $p_url ) );\r\n\tif ( preg_match( '?http(s)*://?', $t_url ) > 0 ) { \r\n\t\t// no embedded addresses\r\n\t\tif ( preg_match( '?^' . config_get( 'path' ) . '?', $t_url ) == 0 ) { \r\n\t\t\t// url is ok if it begins with our path, if not, replace it\r\n\t\t\t$t_url = 'index.php';\r\n\t\t}\r\n\t}\r\n\tif ( $t_url == '' ) {\r\n\t\t$t_url = 'index.php';\r\n\t}\r\n\t\r\n\t// split and encode parameters\r\n\tif ( strpos( $t_url, '?' ) !== FALSE ) {\r\n\t\tlist( $t_path, $t_param ) = split( '\\?', $t_url, 2 );\r\n\t\tif ( $t_param !== \"\" ) {\r\n\t\t\t$t_vals = array();\r\n\t\t\tparse_str( $t_param, $t_vals );\r\n\t\t\t$t_param = '';\r\n\t\t\tforeach($t_vals as $k => $v) {\r\n\t\t\t\tif ($t_param != '') {\r\n\t\t\t\t\t$t_param .= '&'; \r\n\t\t\t\t}\r\n\t\t\t\t$t_param .= \"$k=\" . urlencode( strip_tags( urldecode( $v ) ) );\r\n\t\t\t}\r\n\t\t\treturn $t_path . '?' . $t_param;\r\n\t\t} else {\r\n\t\t\treturn $t_path;\r\n\t\t}\r\n\t} else {\r\n\t\treturn $t_url;\r\n\t}\r\n}", "function sanitise_and_normalise_url( $unsafe_url ) {\n\t// Verify whether the URL is encoded. If so, encode it, to be consistent.\n\t// This regular expression was extracted from `wp_sanitize_text_field()`.\n\tif ( preg_match( '/%[a-fA-F0-9]{2}/i', $unsafe_url ) ) {\n\t\t$unsafe_url = urldecode( $unsafe_url );\n\t}\n\n\t// Test whether the URL has a scheme (like `https://`) and a domain. This is to determine whether this is an\n\t// absolute URL or a relative URL.\n\t$url_parts = wp_parse_url( $unsafe_url );\n\n\t// If we're dealing with a relative URL, make sure that there's a leading slash before it.\n\tif ( empty( $url_parts['scheme'] ) || empty( $url_parts['host'] ) ) {\n\t\t$unsafe_url = add_leading_slash( $unsafe_url );\n\t}\n\n\t// Strip query string, hash location and trailing slash.\n\t$unsafe_url = strtok( $unsafe_url, '?#' );\n\t$unsafe_url = rtrim( $unsafe_url, '/' );\n\n\t// We now can safely escape the URL.\n\t$url = esc_url_raw( $unsafe_url );\n\n\treturn $url;\n}", "function bitadma_normalize_url( $url_string, $force_trailing_slash = true ) {\n\n\tif ( $force_trailing_slash ) {\n\t\t$url_string = rtrim( $url_string ,\"/\") . '/';\n\t}\n\n\treturn $url_string;\n}", "public static function normalize($url = '/')\n {\n if (is_array($url)) {\n $url = static::url($url);\n }\n if (preg_match('/^[a-z\\-]+:\\/\\//', $url)) {\n return $url;\n }\n $request = static::getRequest();\n\n if (!empty($request->base) && stristr($url, $request->base)) {\n $url = preg_replace('/^' . preg_quote($request->base, '/') . '/', '', $url, 1);\n }\n $url = '/' . $url;\n\n while (strpos($url, '//') !== false) {\n $url = str_replace('//', '/', $url);\n }\n $url = preg_replace('/(?:(\\/$))/', '', $url);\n\n if (empty($url)) {\n return '/';\n }\n\n return $url;\n }", "public static function clean_url($url)\n\t{\n\t\t// Assume http if not included (but don't remove http since it could be https)\n\t\tif (stripos($url, 'http') === FALSE)\n\t\t{\n\t\t\t$url = 'http://'.$url;\n\t\t}\n\n\t\t// Remove trailing slash/s\n\t\t$url = preg_replace('{/$}', '', $url);\n\n\t\treturn $url;\n\t}", "public static function sanitizeURL($url){\n $parts = parse_url($url);\n $port = isset($parts['port']) ? $parts['port'] : '';\n $scheme = $parts['scheme'];\n $host = $parts['host'];\n $path = isset($parts['path']) ? $parts['path'] : '';\n $port or $port = ($scheme == 'https') ? '443' : '80';\n if(($scheme == 'https' && $port != '443') || ($scheme == 'http' && $port != '80')) {\n $host = \"$host:$port\";\n }\n $sanitizedURL = strtolower(\"$scheme://$host\").$path;\n return $sanitizedURL;\n }", "function standardize_url($url) {\n if(empty($url)) return $url;\n return (strstr($url,'http://') OR strstr($url,'https://')) ? $url : 'http://'.$url;\n}", "private function getPreparedUrlString()\n {\n $urlstring = $this->url->getRawUrl();\n\n // Remove schem if its set\n\n $urlstring = preg_replace('/^([a-z]+:\\/\\/)/i', '', $urlstring);\n\n // Remove double slashes\n\n $urlstring = preg_replace('/(\\/\\/)/i', '/', $urlstring);\n\n // Remove everything before the fist slash and the the slash too.\n\n $slashpos = strpos($urlstring, '/');\n\n if ($slashpos !== false) {\n $urlstring = substr($urlstring, $slashpos +1);\n }\n\n // Check if the last sign a slash to\n\n if (substr($urlstring, -1) == '/') {\n $urlstring = substr($urlstring, 0, strlen($urlstring) -1);\n }\n\n return $urlstring;\n }", "public function filterURL($url) {\n $url = filter_var($url, FILTER_SANITIZE_URL);\n if (filter_var($url, FILTER_VALIDATE_URL)) {\n return \"$url\";\n } else {\n die(\"$url is NOT a valid URL\");\n }\n }", "function _trimendslashurl ($url)\r\r\n{\r\r\n while(substr($url, -1) == \"/\") {\r\r\n $url = substr($url, 0, -1);\r\r\n }\r\r\n return $url;\r\r\n}", "public static function prepURL($url = '')\n {\n $trimmedUrl = trim($url);\n $prepedUrl = '';\n\n // Check if any URL was passed at all\n if ($trimmedUrl) {\n // If the URL contains a protocol, it is ok\n if (preg_match('@^(?:[a-z]+:)?//@i', $trimmedUrl)) {\n $prepedUrl = $trimmedUrl;\n } else {// If no protocol was detected add it to the URI\n $serverProtocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : '';\n $urlProtocol = strtolower(substr($serverProtocol, 0, strpos($serverProtocol, '/')));\n\n $prepedUrl = $urlProtocol ? $urlProtocol . '://' : '//';\n $prepedUrl .= $trimmedUrl;\n }\n }\n\n\n return $prepedUrl;\n }", "function clean_url($url) {\n\n global $globals;\n\n //Remove the AEF Session Code - Also there in parse_br function\n $url = preg_replace('/(\\?|&amp;|;|&)(as=[\\w]{32})(&amp;|;|&|$)?/is', '$1$3', $url);\n\n return $url;\n}", "protected function normaliseUrl($url)\n {\n return '/' . ltrim($url, '/');\n }", "public static function sanitizeUrl(string $url): string\n {\n if (Helpers::configBool('edge-flush.urls.query.fully_cachable')) {\n return $url;\n }\n\n $parsed = static::parseUrl($url);\n\n $query = [];\n\n parse_str($parsed['query'] ?? '', $query);\n\n if (blank($query)) {\n return $url;\n }\n\n $routes = (array) config('edge-flush.urls.query.allow_routes');\n\n $list = $routes[$parsed['path']] ?? null;\n\n if (blank($list)) {\n try {\n $routeName = app('router')\n ->getRoutes()\n ->match(request()->create($url))\n ->getName();\n } catch (\\Throwable) {\n $routeName = '';\n }\n\n $list = $routes[$routeName] ?? null;\n }\n\n $list = collect($list);\n\n $drop = collect($query)->filter(\n fn($_, $name) => !$list->contains($name),\n );\n\n return static::rewriteUrl($query, $drop->keys(), $url);\n }", "protected function normalizeUrl($url)\n {\n if ('/' !== substr($url, 0, 1)) {\n $url = '/'.$url;\n }\n\n // remove the query string\n if (false !== $pos = strpos($url, '?')) {\n $url = substr($url, 0, $pos);\n }\n\n // remove multiple /\n return preg_replace('#/+#', '/', $url);\n }", "public function processUrl(){\n\t\t\n\t\tif (isset($_GET['url'])) {\n\t\t\treturn $url = explode('/',filter_var(rtrim($_GET['url'],'/'),FILTER_SANITIZE_URL));//what we're doing here is attempting to filter the url to make it clean and easy to use in our case we're going to explode the url into an array.\n\t\t}\n\n\n\t}", "public function parseURL()\n {\n $url = $_GET['url']; // localhost/HornyMVC/admin/erfds/sd/ds -> $url = admin/erfds/sd/ds\n\n $url = explode('/', trim($url));\n\n $url = array_slice($url, array_search(\"HornyMVC\", $url) ? array_search(\"HornyMVC\", $url) + 1 : 0);\n\n return $url;\n }", "function Sanitize_url($url) \n{\n $nurl = filter_var($url, FILTER_SANITIZE_URL);\n return $nurl;\n}", "protected function getStrippedUrl()\n {\n return str_replace(parse_url($url = app('request')->url(), PHP_URL_SCHEME) . '://', '', $url);\n }", "function shNormalizeNonSefUrl($url)\n{\n\t$uri = new JURI($url);\n\tshNormalizeNonSefUri($uri);\n\treturn $uri->toString(array('path', 'query', 'fragment'));\n\n}", "function normalise_url( $url ) {\n\t// Sanitise the URL first rather than trying to normalise a non-URL.\n\tif ( empty( esc_url_raw( $url ) ) ) {\n\t\treturn new WP_Error( 'invalid-redirect-url', esc_html__( 'The URL does not validate', 'hm-redirects' ) );\n\t}\n\n\t// Break up the URL into it's constituent parts.\n\t$components = wp_parse_url( $url );\n\n\t// Avoid playing with unexpected data.\n\tif ( ! is_array( $components ) ) {\n\t\treturn new WP_Error( 'url-parse-failed', esc_html__( 'The URL could not be parsed', 'hm-redirects' ) );\n\t}\n\n\t// We should have at least a path or query.\n\tif ( ! isset( $components['path'] ) && ! isset( $components['query'] ) ) {\n\t\treturn new WP_Error( 'url-parse-failed', esc_html__( 'The URL contains neither a path nor query string', 'hm-redirects' ) );\n\t}\n\n\t// Make sure $components['query'] is set, to avoid errors.\n\t$components['query'] = ( isset( $components['query'] ) ) ? $components['query'] : '';\n\n\t// All we want is path and query strings.\n\t// Note this strips hashes (#) too.\n\t$normalised_url = $components['path'];\n\n\t// Remove any trailing slashes.\n\t$normalised_url = untrailingslashit( $normalised_url );\n\n\t// Only append '?' and the query if there is one.\n\tif ( ! empty( $components['query'] ) ) {\n\t\t$normalised_url = $components['path'] . '?' . $components['query'];\n\t}\n\n\treturn $normalised_url;\n}", "protected function prepareUrl()\n {\n $address = rtrim($this->config['url'], '/');\n\n if (substr_compare($address, static::API_PATH, -strlen(static::API_PATH)) !== 0) {\n $address .= static::API_PATH;\n }\n\n return $address;\n }", "function ywig_sanitize_url( $url ) {\n\t$output = esc_url_raw( $url );\n\treturn $output;\n}", "function CleanURL($string, $delimiter = '-') {\n // Remove special characters\n $string = preg_replace(\"/[~`{}.'\\\"\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\_\\=\\+\\/\\?\\>\\<\\,\\[\\]\\:\\;\\|\\\\\\]/\", \"\", $string);\n // Replace blank space with delimeter\n $string = preg_replace(\"/[\\/_|+ -]+/\", $delimiter, $string);\n return $string;\n }", "public function getCleanUrl(): string\n {\n [$cleanUrl,] = explode(\"?\", $this->url);\n\n return $cleanUrl;\n }", "protected function filterUrl($value) {\n if (!preg_match(\"/^[a-z]+\\:\\/\\//\", $value))\n $value = \"http://\".$value;\n return filter_var($value, FILTER_VALIDATE_URL);\n }", "public function stripBaseUrl($url);", "function trim_url($url = '', $separator = '/')\n { \n return $separator.trim(preg_replace('/\\\\\\\\+|\\/+/', $separator, $url), $separator);\n }", "function formatUrl($str, $sep='-'){ #convert white space to dashes for urls\n\t$res = strtolower($str);\n\t$res = preg_replace('/[^[:alnum:]]/', ' ', $res);\n\t$res = preg_replace('/[[:space:]]+/', $sep, $res);\n\treturn trim($res, $sep);\n}", "public static function sanitize(string $url): string\n {\n // e.g. https://api.github.com/repositories/9999999999?access_token=github_token\n $url = Preg::replace('{([&?]access_token=)[^&]+}', '$1***', $url);\n\n $url = Preg::replaceCallback('{^(?P<prefix>[a-z0-9]+://)?(?P<user>[^:/\\s@]+):(?P<password>[^@\\s/]+)@}i', static function ($m): string {\n assert(is_string($m['user']));\n // if the username looks like a long (12char+) hex string, or a modern github token (e.g. ghp_xxx) we obfuscate that\n if (Preg::isMatch('{^([a-f0-9]{12,}|gh[a-z]_[a-zA-Z0-9_]+|github_pat_[a-zA-Z0-9_]+)$}', $m['user'])) {\n return $m['prefix'].'***:***@';\n }\n\n return $m['prefix'].$m['user'].':***@';\n }, $url);\n\n return $url;\n }", "function cleanSocialUrl($url)\n{\n $segment = '[^.:\\/]+';\n preg_match('/(?:https?:\\/\\/)?(?:' . $segment . '\\.)?(' . $segment . '(?:\\.' . $segment . ')+)/', $url, $matches);\n return isset($matches[1]) ? $matches[1] : false;\n}", "protected function cleanUrl($url) {\n\t\treturn str_replace ( 'http://', '', $url );\n\t}", "public static function filter_active_url(){\n $url = get_permalink();\n $url = self::get_relative_permalink($url);\n $url = self::remove_the_slash($url);\n $url = self::turn_dash_to_space($url);\n return $url;\n }", "public static function filterUrl($url, $final = false)\n {\n // Remove repeted '/' for example '///' will be replace by just one '/'\n $url = preg_replace('/(\\/+)/', '/', $url);\n \n // If final is set to true we do some extra filtering.\n if ($final) {\n $url = preg_replace('/^([^a-zA-Z0-9])*/', '', $url);\n }\n \n return $url;\n }", "function format_URL($urlStr){\n $parsed = parse_url($urlStr);\n if (empty($parsed['scheme'])) {\n $urlStr = 'http://' . ltrim($urlStr, '/');\n }\n return $urlStr;\n}", "function mustsee_sanitize_url( $new_value ) {\n if ( '' == $new_value ) { return; }\n\n if ( !preg_match('/http:\\/\\//', $new_value) ) {\n $new_value = 'http://' . $new_value;\n }\n\n return strip_tags( $new_value );\n}", "function tc_sanitize_uploads( $url ) {\r\n $upload_dir = wp_upload_dir();\r\n return str_replace($upload_dir['baseurl'], '', $url);\r\n }", "private function sanitize($segment){\n $chars = $this->config->get('uri_chars');\n $segment = preg_replace(\"/[^\".$chars.\"]/\", \"\", $segment);\n return $segment;\n }", "private function sanitized_url() {\n $url = $_SERVER['SCRIPT_NAME'] . \"?\";\n /* the GET vars used by git-php */\n $git_get = array('p', 'dl', 'b', 'a', 'h', 't');\n foreach ($_GET as $var => $val) {\n if(!in_array($var, $git_get)){\n $get[$var] = $val;\n $url.=\"{$var}={$val}&amp;\";\n }\n }\n return $url;\n }", "protected function escaped($url) {\n $url = trim($url);\n $url = preg_replace('~[^\\\\pL0-9_]+~u', '-', $url);\n $url = trim($url, \"-\");\n $url = iconv(\"utf-8\", \"ASCII//TRANSLIT//IGNORE\", $url);\n $url = preg_replace('~[^-a-zA-Z0-9_]+~', '', $url);\n\n return $url;\n }", "function parseURL()\n{\n if (isset($_GET['url'])) {\n $url = rtrim($_GET['url'], '/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n $url = explode('/', $url);\n return $url;\n }\n}", "public static function sanitizeString($url) {\r\n $url = mb_strtolower($url, 'UTF-8');\r\n $url = iconv('UTF-8', 'ASCII//TRANSLIT', $url);\r\n $url = str_replace(array(\"'\", '\"', ';', ',', ':', ' ', '_'), '-', $url);\r\n $url = preg_replace(\"/[^a-z0-9-]/\", '', $url);\r\n\t$url = str_replace('---', '-', $url);\r\n $url = str_replace('--', '-', $url);\r\n\t$url = trim($url, '-');\r\n\treturn $url;\r\n }", "public function cleanHost() {\r\n\t\t$this->host = preg_replace('/^\\/+|\\/+$/', '', $this->host);\r\n\t}", "protected function normalize_url($url = null)\n\t{\n\t\t$url_parts = parse_url($url);\n\n\t\t$url_parts['port'] = isset($url_parts['port']) ? $url_parts['port'] : 80;\n\n\t\t$scheme = strtolower($url_parts['scheme']);\n\t\t$host = strtolower($url_parts['host']);\n\t\t$port = intval($url_parts['port']);\n\n\t\t$retval = \"{$scheme}://{$host}\";\n\n\t\tif ($port > 0 && ( $scheme === 'http' && $port !== 80 ) || ( $scheme === 'https' && $port !== 443 ))\n\t\t{\n\t\t\t$retval .= \":{$port}\";\n\t\t}\n\n\t\t$retval .= $url_parts['path'];\n\n\t\tif ( !empty($url_parts['query']) )\n\t\t{\n\t\t\t$retval .= \"?{$url_parts['query']}\";\n\t\t}\n\n\t\treturn $retval;\n\t}", "function clean_url($text)\n\t\t{\n\t\t\t$text=strtolower($text);\n\t\t\t$code_entities_match = array(' ','--','&quot;','!','@','#','$','%','^','&','*','(',')','_','+','{','}','|',':','\"','<','>','?','[',']','\\\\',';',\"'\",',','.','/','*','+','~','`','=');\n\t\t\t$code_entities_replace = array('-','-','','','','','','','','','','','','','','','','','','','','','','','','');\n\t\t\t$text = str_replace($code_entities_match, $code_entities_replace, $text);\n\t\t\treturn $text;\n\t\t}", "public function clean_url( $url ) {\n\t\t$parsed_url = parse_url( $url );\n\t\twp_parse_str( $parsed_url['query'], $qs );\n\t\t$qs = array_filter( $qs );\n\t\treturn add_query_arg( $qs, \"{$parsed_url['scheme']}://{$parsed_url['host']}{$parsed_url['path']}\" );\n\t}", "function cleanAliasUrl($string)\n{\n $tr = array('ş', 'Ş', 'ı', 'İ', 'ğ', 'Ğ', 'ü', 'Ü', 'ö', 'Ö', 'ç', 'Ç'); \n $en = array('s', 's', 'i', 'i', 'g', 'g', 'u', 'u', 'o', 'o', 'c', 'c'); \n $string = str_replace ($tr, $en, $string); \n $string = preg_replace (\"`\\[.*\\]`U\", \"\", $string); \n $string = preg_replace ('`&(amp;)?#?[a-z0-9]+;`i', '-', $string); \n $string = htmlentities ($string, ENT_COMPAT, 'utf-8'); \n $string = preg_replace (\"`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig|quot|rsquo);`i\", \"\\\\1\", $string); \n $string = preg_replace (array(\"`[^a-z0-9]`i\", \"`[-]+`\"), \"-\", $string); \n\n return strtolower (trim ($string, '-')); \n}", "function prepare_url($uri = ''): string\n {\n if ($uri === 'http://' or $uri === 'https://' or $uri === '') {\n return '';\n }\n\n /**\n * Converts double slashes in a string to a single slash,\n * except those found in http://\n *\n * http://www.some-site.com//index.php\n *\n * becomes:\n *\n * http://www.some-site.com/index.php\n */\n $uri = preg_replace('#(^|[^:])//+#', '\\\\1/', $uri);\n\n $url = parse_url($uri);\n\n if ( ! $url or ! isset($url[ 'scheme' ])) {\n return (is_https() ? 'https://' : 'http://') . $uri;\n }\n\n return $uri;\n }", "static function return_regularized_url($url)\r\n {\r\n if (filter_var($url, FILTER_VALIDATE_URL)) {\r\n $xyz = explode('.', $url);\r\n $y = '';\r\n if (count($xyz) > 1) {\r\n $j = 1;\r\n foreach ($xyz as $x) {\r\n if (strpos($x, 'www') !== false) {\r\n $y .= str_replace('www', '(.*)?', $x);\r\n } else if ($j == 1) {\r\n $y .= $x;\r\n } else if ($j > 1) {\r\n $y .= '\\.' . $x;\r\n }\r\n $j++;\r\n }\r\n //Now replace the \"http\" with \"http(s)?\" to cover both secure and non-secure\r\n if (strpos($y, 'https') !== false) {\r\n $y = str_replace('https', 'http(s)?', $y);\r\n }else if (strpos($y, 'http') !== false) {\r\n $y = str_replace('http', 'http(s)?', $y);\r\n }\r\n return $y;\r\n } else {\r\n return $url;\r\n }\r\n } else {\r\n return FALSE;\r\n }\r\n }", "protected function prepareUrl($url)\n {\n return ltrim($this->replacePlaceHolder($url), '/');\n }", "function yz_esc_url( $url ) {\n $url = esc_url( $url );\n $disallowed = array( 'http://', 'https://' );\n foreach( $disallowed as $protocole ) {\n if ( strpos( $url, $protocole ) === 0 ) {\n return str_replace( $protocole, '', $url );\n }\n }\n return $url;\n}", "public static function cleanseUrl($url) {\n return preg_replace(\"#\\W#\", \"\", $url);\n }", "function prepareURL($_sUrl) {\n $sUrl = trim($_sUrl);\n if(strlen($sUrl) > 0) {\n //add protocol if necessary\n if(strpos($sUrl, '://') === FALSE) {\n $sUrl = 'http://'.$sUrl;\n }\n //remove ancors if necessary\n if(strpos($sUrl, '#') !== FALSE) {\n list($sUrl) = explode('#', $sUrl, 2);\n }\n //remove after-? marks\n if(strpos($sUrl, '?') !== FALSE) {\n list($sUrl) = explode('?', $sUrl, 2);\n }\n }\n return $sUrl;\n}", "public function sanitizeLocalUrlValidUrlsDataProvider() {}", "public function sanitizeLocalUrlValidPathsDataProvider() {}", "function checkurl($url){\n if(!filter_var($url, FILTER_VALIDATE_URL)){\n return \" \";\n }\n else{\n return $url;\n }\n }", "function seo_url($string)\n{\n //Lower case everything\n $string = strtolower($string);\n //Make alphanumeric (removes all other characters)\n $string = preg_replace(\"/[^a-z0-9_\\s-]/\", \"\", $string);\n //Clean up multiple dashes or whitespaces\n $string = preg_replace(\"/[\\s-]+/\", \" \", $string);\n //Convert whitespaces and underscore to dash\n $string = preg_replace(\"/[\\s_]/\", \"-\", $string);\n return strtolower($string);\n}", "public static function urlPresentational ($url)\r\n\t{\r\n\t\t# Trim whitespace\r\n\t\t$url = trim ($url);\r\n\t\t\r\n\t\t# Remove trailing slash if there is only one subdirectory (or none)\r\n\t\tif (substr_count ($url, '/') <= 4) {\r\n\t\t\tif (substr ($url, -1) == '/') {$url = substr ($url, 0, -1);}\r\n\t\t}\r\n\t\t\r\n\t\t# Remove http:// from the start if followed by www\r\n\t\tif (substr ($url, 0, 10) == 'http://www') {$url = substr ($url, 7);}\r\n\t\t\r\n\t\t# Replace %20 with a space\r\n\t\t$url = str_replace ('%20', ' ', $url);\r\n\t\t\r\n\t\t# Return the result\r\n\t\treturn $url;\r\n\t}", "function clean_urls($text) {\r\n\t$text = strip_tags(lowercase($text));\r\n\t$code_entities_match = array(' ?',' ','--','&quot;','!','@','#','$','%',\r\n '^','&','*','(',')','+','{','}','|',':','\"',\r\n '<','>','?','[',']','\\\\',';',\"'\",',','/',\r\n '*','+','~','`','=','.');\r\n\t$code_entities_replace = array('','-','-','','','','','','','','','','','',\r\n '','','','','','','','','','','','','');\r\n\t$text = str_replace($code_entities_match, $code_entities_replace, $text);\r\n\t$text = urlencode($text);\r\n\t$text = str_replace('--','-',$text);\r\n\t$text = rtrim($text, \"-\");\r\n\treturn $text;\r\n}", "function emr_get_match_url($url) {\n\t$url = emr_remove_scheme($url);\n\t$url = emr_maybe_remove_query_string($url);\n\t$url = emr_remove_size_from_filename($url, true); // and extension is removed.\n\t$url = emr_remove_domain_from_filename($url);\n\treturn $url;\n}", "function formatURL($url) {\n $url = trim($url, '/');\n if (!preg_match('#^http(s)?://#', $url)) {\n $url = 'http://' . $url;\n }\n $urlParts = parse_url($url);\n $domain = preg_replace('/^www\\./', '', $urlParts['host']);\n return $domain;\n}", "private function filterUrl($url){\n\t\t\n\t\t// Get the global config\n\t\tglobal $CrawlerConfig;\n\t\t\n\t\t// Make sure the URL isn't \"#\"\n\t\tif(substr($url, 0, 1) == \"#\") return false;\n\t\t\n\t\tif(substr($url, 0, 2) == \"//\") $url = \"http:\".$url;\n\t\t\n\t\t// If it's already valid, nothing else needs to be done\n\t\tif(filter_var($url, FILTER_VALIDATE_URL)) return $url;\n\t\t\n\t\t// If it's a partial path, generate full path\n\t\tif(substr($url, 0, 1) == \"/\"){\n\t\t\t\n\t\t\t// Glue pieces together\n\t\t\t$turl = $CrawlerConfig['BASE_URL'].$url;\n\t\t\t\n\t\t\t// If it worked, return it\n\t\t\tif(filter_var($turl, FILTER_VALIDATE_URL)) return $turl;\n\t\t}\n\t\t\n\t\t// Temporary URL var\n\t\t$turl = rtrim($this->current_location,\"/\").\"/\".ltrim($url,\"/\");\n\t\t\n\t\t// Try one more time\n\t\tif(filter_var($turl, FILTER_VALIDATE_URL)) return $turl;\n\t\t\n\t\treturn false;\n\t}", "public function parseURL()\n {\n if (isset($_GET['url'])) {\n $url = rtrim($_GET['url'], '/'); //menghapus tanda / di akhir url\n $url = filter_var($url, FILTER_SANITIZE_URL);//memfilter url dari karakter aneh (hack)\n $url = explode('/', $url); //memecah url yang diinput dengan delimiter / dan menjadikannya array\n return $url;\n }\n }", "public function url()\n\t{\n\t\treturn $this->filter(FILTER_SANITIZE_URL);\n\t}", "function emr_remove_domain_from_filename($url) {\n\t$url = str_replace(emr_remove_scheme(get_bloginfo('url')), '', $url);\n\treturn $url;\n\t}", "function cleanStringUrl($cadena){\n\t\t$cadena = strtolower($cadena);\n\t\t$cadena = trim($cadena);\n\t\t$cadena = strtr($cadena,\n\t\t\t\t\t\t\t\t\"ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ\",\n\t\t\t\t\t\t\t\t\"aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn\");\n\t\t$cadena = strtr($cadena,\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\",\"abcdefghijklmnopqrstuvwxyz\");\n\t\t$cadena = preg_replace('#([^.a-z0-9]+)#i', '-', $cadena);\n\t\t$cadena = preg_replace('#-{2,}#','-',$cadena);\n \t$cadena = preg_replace('#-$#','',$cadena);\n \t\t$cadena = preg_replace('#^-#','',$cadena);\n\t\treturn $cadena;\n\t}", "function removeUrlProtocol($url)\n{\n if (preg_match('/^[a-zA-Z_-]+:\\/\\//', $url, $matches)) {\n return substr($url, strlen($matches[0]));\n }\n return $url;\n}", "function sanitize($var) {\n return filter_var($var, FILTER_SANITIZE_URL);\n}", "public static function trimUrl($url){\n\t\t$end = substr(strrchr($url,'/'), 1);\n\t\treturn substr($url, 0, - strlen($end));\n\t}", "public static function str_url(string $url): string {\n\t\t\treturn preg_replace('#/+#', \"/\", trim(str_replace(\"\\\\\", \"/\", str_replace(\"..\", \"\", $url)), \"/ \"));\n\t\t}", "private static function _cleanUri($request_uri)\n {\n //removes everything after, and including, the ?\n $clean_uri = strpos($request_uri,'?') > 0 ? substr($request_uri,0,strpos($request_uri,'?')) : $request_uri;\n\n //remove any unwanted characters\n $clean_uri = Scrubber::washAlphaNumeric($clean_uri,array('-','/','.'));\n\n $paths = explode('/',$clean_uri);\n $count = 0;\n $uri_path = '';\n \n // rebuild path removing extra / and ignoring .\n if (is_array($paths)) {\n foreach ($paths as $path) {\n if (trim($path) && strpos($path,'.') === FALSE) {\n $uri_path .= $path.\"/\";\n }\n }\n } \n\n //remove the final trailing /\n return trim($uri_path) ? substr($uri_path,0,strlen($uri_path)-1) : $uri_path;\n }", "function _filterurl($url) {\n return str_replace(\n array('<','>','(',')','#'),\n array('&lt;','&gt;','&#40;','&#41;','&#35;'),\n $url\n );\n }", "function wp_normalize_path( $path ) {\n\t\t$path = str_replace( '\\\\', '/', $path );\n\t\t$path = preg_replace( '|/+|','/', $path );\n\t\treturn $path;\n\t}", "public static function normalizeURI($uri)\n{\nreturn str_replace('\\\\','/',$uri);\n}", "function normalise_idn_url($url)\n{\n require_code('urls_simplifier');\n $coder_ob = new HarmlessURLCoder();\n return $coder_ob->encode($url);\n}", "function strip_url_console($name)\n\t{\n\t\t/*$name = trim($name);\n\t\t$name = preg_replace(\"/[^0-9a-zA-Z-]+/\", \"\", $name);\n\t\t$name = str_replace(\"---\",\"-\",$name);\n\t\t$name = str_replace(\"----\",\"-\",$name);\n\t\t$name = str_replace(\"--\",\"-\",$name);\n\t\treturn $name;*/\n\t\t$name = trim($name);\n\t\t$name = str_replace(\" \",\"-\",$name);\n\t\t$name = str_replace(\"_\",\"-\",$name);\n\t\t$name = preg_replace(\"/[^0-9a-zA-Z-]+/\", \"\", $name);\n\t\t$name = str_replace(\"----\",\"-\",$name);\n\t\t$name = str_replace(\"---\",\"-\",$name);\n\t\t$name = str_replace(\"--\",\"-\",$name);\n\t\t$name = str_replace(\".\",\"-\",$name);\n\t\treturn strtolower($name);\n\t}", "private function cleanUrl(string $url): string\n {\n $url = rtrim(rtrim($url, '#'), '/');\n\n $fragment = parse_url($url, PHP_URL_FRAGMENT);\n\n if (! empty($fragment)) {\n $url = str_replace(\"#{$fragment}\", '', $url);\n }\n\n return rtrim($url, '?');\n }", "public function testUrl() {\n $this->assertEquals('http://domain.com?key=ber', Sanitize::url('http://domain.com?key=Über'));\n $this->assertEquals('http%3A%2F%2Fdomain.com%3Fkey%3D%C3%9Cber', Sanitize::url(urlencode('http://domain.com?key=Über')));\n }", "public function parseUrl()\n\t\t{\n\t\t\tif(isset($_GET['url']))\n\t\t\t{\n\t\t\t\t// explode(separator, string, limit);\n\t\t\t\treturn $url = explode('/', filter_var(rtrim($_GET['url'], '/'), FILTER_SANITIZE_URL));\n\t\t\t}\n\t\t}", "function acf_strip_protocol($url)\n{\n}", "public function social_sanitize_url($string) {\n return esc_url(trim($string), array('http', 'https'));\n }", "function getRootUrl($url, $remove_scheme, $remove_www, $remove_path, $remove_last_slash)\n {\n if (filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED))\n {\n $url_array=parse_url($url); //parse URL into arrays like $url_array['scheme'], $url_array['host'], etc\n\n $url=str_ireplace($url_array['scheme'].\"://\", \"\", $url); //make URL without scheme, so no :// is included when searching for first or last /\n\n if ($remove_path==1) //remove everything after FIRST / in URL, so it becomes \"real\" root URL\n {\n $first_slash_position=stripos($url, \"/\"); //find FIRST slash - the end of root URL\n if ($first_slash_position>0) //cut URL up to FIRST slash\n {\n $url=substr($url, 0, $first_slash_position+1);\n }\n }\n else //remove everything after LAST / in URL, so it becomes \"normal\" root URL\n {\n $last_slash_position=strripos($url, \"/\"); //find LAST slash - the end of root URL\n if ($last_slash_position>0) //cut URL up to LAST slash\n {\n $url=substr($url, 0, $last_slash_position+1);\n }\n }\n\n if ($remove_scheme!=1) //scheme was already removed, add it again\n {\n $url=$url_array['scheme'].\"://\".$url;\n }\n\n if ($remove_www==1) //remove www.\n {\n $url=str_ireplace(\"www.\", \"\", $url);\n }\n\n if ($remove_last_slash==1) //remove / from the end of URL if it exists\n {\n while (substr($url, -1)==\"/\") //use cycle in case URL already contained multiple // at the end\n {\n $url=substr($url, 0, -1);\n }\n }\n }\n\n return trim($url);\n }", "public static function cleanIncomingUrl($url)\n {\n return str_replace('&amp;', '&', $url);\n }", "function prepare_episode_slug_for_url($slug)\n{\n $slug = trim($slug);\n $slug = rawurlencode($slug);\n\n // allow directories in slug\n return str_replace('%2F', '/', $slug);\n}", "function clean_request_uri($uri) {\n if (FALSE !== ($pos = strpos($uri, '?'))) {\n $uri = substr($uri, 0, $pos);\n }\n return ltrim($uri, '/');\n }", "function sUrl( $url )\r\n\t\t{\r\n\t\t return filter_var( $url, FILTER_SANITIZE_URL );\r\n\t\t \r\n\t\t}", "function decoupe_url($t) {\n//\treturn($t);\n\t$z = strrpos($t, '/');\n\tif ($z != '') {\n\t\t$t = substr($t, $z+1, strlen($t));\n\t\t// RECHERCHE DU DERNIER ?\n\t\t$z = strrpos($t, '?');\n\t\tif ($z != '') {\n\t\t\treturn(substr($t, 0,$z));\n\t\t} else {\n\t\t\treturn($t);\n\t\t}\n\t} else {\n\t\treturn($t);\n\t}\n}", "function clean_url($url, $base_url)\r\n{\r\n\tif(filter_var($url, FILTER_VALIDATE_URL) )\r\n\t{\r\n\r\n\t\t$parse = parse_url($url);\r\n\t\tif( !empty($parse['host']) && $parse['host'] == $base_url )\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}", "public function sanitizeLocalUrlInvalidDataProvider() {}", "public static function cleanURL($url, $dots = false){\r\n\t\t$url = strtolower($url);\r\n\t\t$url = preg_replace('~[^a-z0-9_'.(!$dots?'':'.').']+~', '-', $url);\r\n\t\t$url = preg_replace('~-{2,}~', '-', $url);\r\n\t\t$url = trim($url, \"- \");\r\n\r\n\r\n\t\treturn $url;\r\n\t}", "function validLink($link) {\n if(preg_match(\"/((https?|ftp)\\:\\/\\/)|((skype|spotify|mailto)\\:)/\", $link) || strrpos($link,'.')===false) {\n return $link;\n } else {\n $link = preg_replace(\"|^(http){1}[\\\\\\/:]*|\", \"\", $link);\n $link = preg_replace(\"|[/]{2,}|\",\"/\",$link);\n //$link = preg_replace(\"|[^a-z0-9./]|\",\"\",$link);\n $link = preg_replace(\"|^/|\", \"\", $link);\n return \"http://\".$link;\n }\n}" ]
[ "0.7579714", "0.72950906", "0.7272067", "0.7174074", "0.7110038", "0.7044902", "0.6993038", "0.6835503", "0.6826167", "0.6705912", "0.6696348", "0.66363245", "0.6635605", "0.66131085", "0.66097474", "0.6605475", "0.6601433", "0.65768194", "0.65764415", "0.65260416", "0.6523636", "0.6518252", "0.65000033", "0.64998686", "0.6477291", "0.646533", "0.6451691", "0.64360803", "0.6409353", "0.6362168", "0.6358576", "0.6357862", "0.6349899", "0.63003004", "0.6299536", "0.6298948", "0.62934047", "0.62837887", "0.627851", "0.6273759", "0.6260889", "0.62566864", "0.6247891", "0.62409616", "0.62036717", "0.6203552", "0.61971956", "0.6195563", "0.61905956", "0.61773", "0.61657405", "0.6163865", "0.6160286", "0.6149282", "0.6143161", "0.61409014", "0.6138093", "0.6137542", "0.61367804", "0.6133138", "0.61330825", "0.6099876", "0.60918653", "0.6087142", "0.6064017", "0.6054327", "0.6048938", "0.6038536", "0.60384417", "0.6033297", "0.60250634", "0.602065", "0.60101265", "0.6000369", "0.60003066", "0.5989994", "0.5988655", "0.5980551", "0.59765345", "0.5974018", "0.5970922", "0.59607124", "0.596019", "0.5958238", "0.59580874", "0.59512866", "0.59510255", "0.5944126", "0.5941816", "0.5931005", "0.5930837", "0.5926742", "0.5914874", "0.5904927", "0.59018975", "0.5895285", "0.58951104", "0.5883557", "0.588353", "0.5882131" ]
0.7124804
4
Proccess current endpoint and return its result
public function proccess(){ #Get endpoint params $endpointParams = $this->getEndpointParams(); #Check if endpoint was read if($endpointParams == []) return ["success" => 0, "msg" => "The requested endpoint ({$this->endpointURL}) didn't match any expected command. Please give a check on <a href='index.php'>index.php</a> for a list of available endpoints."]; #Get current command (the first part of endpoint) and also removes it from the arguments array $currentCommand = array_shift($endpointParams); #Execute command and return output switch ($currentCommand) { #List upcoming movies case 'upcoming': return $this->retrieveUpcomingMovies($endpointParams); #Get movie info case 'movie': return $this->retrieveMovie($endpointParams); #Search for movies using terms case 'search': return $this->retrieveSearch($endpointParams); #Fallback default: return ["success" => 0, "msg" => "The command '{$currentCommand}' is unknown! Please give a check on <a href='index.php'>index.php</a> for a list of available endpoints."]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n $this->response->okEmpty();\n return;\n }\n try {\n $this->response->ok($rs->handleRequest());\n\n } catch (UnauthorizedException $e) {\n $this->response->unauthorized();\n\n } catch (MethodNotAllowedException $e) {\n $this->response->methodNotAllowed();\n\n } catch (BadRequestExceptionInterface $e) {\n $this->response->badRequest($e->getMessage());\n\n } catch (UnavailableExceptionInterface $e) {\n $this->response->unavailable($e->getMessage());\n\n } catch (Exception $e) {\n $this->response->unavailable($e->getMessage());\n }\n } else {\n $this->response->badRequest();\n }\n }", "public function process()\n {\n \t$client = $this->client->getClient();\n\n \ttry {\n $response = $client->get($this->buildUrl());\n return new ResponseJson((string)$response->getBody(), true);\n } catch (RequestException $e) {\n return new ResponseJson((string)$e->getResponse()->getBody(), false);\n }\n }", "public function sendRequestToEndpoint(): Response;", "private function requestProcessor() {\n try {\n\n if (empty($this->uri))\n throw new \\Exception(\"Undefined url\");\n\n $ReqHandle = curl_init($this->uri);\n\n $body = json_encode([]);\n if( sizeof($this->data) > 0 )\n $body = json_encode($this->data);\n\n $returnTransfer = 0;\n if( $this->hasResponseToReturn )\n $returnTransfer = 1;\n\n $isPost = 0;\n if( $this->method != 'GET')\n $isPost = 1;\n\n\n if($isPost == 1){\n curl_setopt($ReqHandle,CURLOPT_POST, $isPost);\n curl_setopt($ReqHandle, CURLOPT_POSTFIELDS, $body);\n }\n \n curl_setopt_array($ReqHandle, [\n CURLOPT_RETURNTRANSFER => $returnTransfer,\n CURLOPT_HTTPHEADER => $this->headersToBeUsed\n ]);\n\n\n $result = curl_exec($ReqHandle);\n\n if(curl_errno($ReqHandle)){\n\n return curl_error($ReqHandle);\n }\n\n if($returnTransfer == 1)\n return json_decode($result);\n\n\n\n } catch (\\Throwable $t) {\n new ErrorTracer($t);\n }\n }", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }", "function process_request() {\n\t\tglobal $publishthis;\n\n\t\ttry{\n\n\t\t\t$bodyContent = '';\n\n\t\t\tif ( function_exists( 'wpcom_vip_file_get_contents' ) ) {\n\t\t\t\t$bodyContent = wpcom_vip_file_get_contents( 'php://input', 10, 60 );\n\t\t\t} else {\n\t\t\t\t$bodyContent = file_get_contents( 'php://input' );\n\t\t\t}\n\n\t\t\t$publishthis->log->addWithLevel( array( 'message' => 'Endpoint Request', 'status' => 'info', 'details' => $bodyContent ), \"2\" );\n\n\t\t\t$arrEndPoint = json_decode( $bodyContent, true );\n\n\t\t\t$action = $arrEndPoint[\"action\"];\n\n\t\t\t$pt_settings = $publishthis->get_options();\n\n\t\t\tif( !in_array( $action, array('resetState', 'stopEndpoint', 'resumeEndpoint') ) ) {\n\t\t\t\t$manually_stopped = get_option( 'pt_import_manually_stopped' );\n\t\t\t\tif ( $manually_stopped == 1 ) {\n\t\t\t\t\t$this->sendFailure('Import manually stopped');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch( $action ) {\n\t\t\t\tcase \"verify\":\n\t\t\t\t\t$this->actionVerify();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"publish\":\n\t\t\t\t\tif( $publishthis->get_option( 'curated_publish' ) != 'import_from_manager' ) {\n\t\t\t\t\t\t$this->sendFailure( \"Publishing through CMS is disabled\" );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$feedId = intval( $arrEndPoint[\"feedId\"], 10 );\n\t\t\t\t\t$pageNum = intval( $arrEndPoint[\"pageNum\"], 10 );\n\t\t\t\t\t$importId = $arrEndPoint[\"importId\"];\n\n\t\t\t\t\t$this->actionPublish2( $feedId, $pageNum, $importId );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"getAuthors\":\n\t\t\t\t\t$this->actionGetAuthors();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"getCategories\":\n\t\t\t\t\t$this->actionGetCategories();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"resetState\":\n\t\t\t\t\t$this->resetState();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"stopEndpoint\":\n\t\t\t\t\t$this->stopEndpoint();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"resumeEndpoint\":\n\t\t\t\t\t$this->resumeEndpoint();\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$this->sendFailure( \"Empty or bad request made to endpoint\" );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch( Exception $ex ) {\n\t\t\t//we will log this to the pt logger, but we always need to send back a failure if this occurs\n\n\t\t\t$this->sendFailure( $ex->getMessage() );\n\t\t}\n\n\t\treturn;\n\t}", "public function processRequest();", "private function execute()\n {\n // executes a cURL session for the request, and sets the result variable\n $result = Request::get($this->getRequestURL())->send();\n // return the json result\n return $result->raw_body;\n }", "public function getEndpoint();", "public function getEndpoint();", "public function getEndpoint();", "public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }", "public function & GetResponse ();", "public function executeRequest() {\n if($this->method == \"get_range\") {\n \treturn $this->getRange();\n }\n else {\n \t$this->response->setStatusCode(405, \"Method Not Found\");\n\t\t\t\t\treturn $this->response;\n }\n }", "public abstract function processRequest();", "public function run()\n {\n $requested_url = explode('/', $this->requestUrl);\n\n if (!empty($this->definedRoutes[$this->requestMethod])) {\n foreach ($this->definedRoutes[$this->requestMethod] as $route => $action) {\n $route = explode('/', $route);\n $route_depth = count($route);\n\n // Check for defined route parameters\n for( $i = 0; $i < $route_depth; $i++) {\n if (preg_match('/\\{([\\w?]+?)\\}/',$route[$i])) {\n if (isset($requested_url[$i])) {\n array_push($this->requestParameters, $requested_url[$i]);\n // replace defined route parameters with peer request url parameter for final comparison\n $route[$i] = $requested_url[$i];\n }\n }\n }\n\n // Check for unreplaced route parameters and delete them if are optional parameters (for final comparison)\n for ($j = 0; $j < $route_depth; $j++) {\n if (preg_match('/\\{([\\w]+?)\\?}/', $route[$j])) {\n unset($route[$j]);\n }\n }\n\n $route = implode('/', $route);\n\n // Final comparision. Check requested url is equal to current checking route\n if ($route == $this->requestUrl) {\n $this->matched = true;\n\n if ($action instanceof Closure) {\n return call_user_func_array($action, $this->requestParameters);\n } else if($this->isController($action)) {\n return $this->loadController($action);\n } else {\n throw new Exception('Invalid action for route');\n }\n break; // Route found, stop the operations\n } else {\n $this->reset();\n }\n }\n }\n\n if ($this->matched === false) {\n return $this->exception->notFound();\n }\n }", "public function get() {\n try {\n\n /**\n * Set up request method\n */\n $this->method = 'GET';\n /**\n * Process request and call for response\n */\n return $this->requestProcessor();\n\n\n } catch (\\Throwable $t) {\n new ErrorTracer($t);\n }\n }", "private function invoke() {\n global $user;\n $req =& $this->request;\n try {\n\n if ($req) {\n if (isset($req->uri) && preg_match(\"/^([^\\?]*)(\\?(.*))?$/\", $req->uri, $match)) {\n $this->q = $match[1];\n parse_str($match[3], $_GET);\n }\n }\n \n if (isset($req) && !is_object($req))\n throw new Exception(\"Invalid Request.\", -32600);\n \n \n if (!preg_match(\"/^(?:(\\D\\w*)[\\.\\/])?(\\D\\w*)\\/?(.*)$/\", $this->q, $match))\n throw new Exception(\"Invalid Request.\", -32600);\n \n list(, $c, $m, $a) = $match;\n \n\t\t\n\t\t//if (!$c)\n\t\t//\t$c = jsonrpc_load_class_by_method($m, TRUE);\n \n\n\t\t\n \n if (!($c && class_exists($c, FALSE))) {\n $c = jsonrpc_load_class($c, $m, TRUE);\n }\n \n if (isset($a) && is_string($a) && FALSE !== strpos($a, ','))\n $a = explode(',', $a);\n if (isset($_GET['id']))\n $req->id = $_GET['id'];\n $is_super = $user->uid == 1;\n if ($user->uid == 0 && $_SERVER['REMOTE_ADDR'] == '127.0.0.1' && !isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $is_super = TRUE;\n $user->uid = 1;\n }\n \n //echo $c;\n \n if (!method_exists($c, $m))\n throw new Exception('Method does not exists.', -32601);\n if (variable_get('site_offline', 0) && !$is_super)\n throw new Exception('Site if offline');\n $refl = new ReflectionMethod($c, $m);\n \n\t//$args = array();\n \n if (!isset($req->params)) {\n if ($a)\n $args = $a;\n elseif (isset($_GET['params']))\n $args = explode(',', $_GET['params']);\n elseif (isset($_GET['param']))\n $args = explode(',', $_GET['param']);\n }\n else\n $args = $req->params;\n \n //if(!is_array($args))\n \t\n\n\t//var_dump(count($args) <= $refl->getNumberOfParameters());\n\n //if ($refl->getNumberOfRequiredParameters() <= 1 && is_array($args) && count($args) > $refl->getNumberOfParameters() )\n \n //if($refl->getNumberOfRequiredParameters\n \n $np = $refl->getNumberOfParameters();\n $nr = $refl->getNumberOfRequiredParameters();\n\n\t\t//if ($np == 1 && count($args)\n//var_dump($args);\n//die;\n \n \n \n if ($nr <= 1 && !(is_array($args) && count($args) == $np && $np > 1 ) && isset($req->params))\n $args = array($args);\n\n\n//var_dump($args);\n\n switch (TRUE) {\n case $refl->isStatic():\n $req->result = call_user_func_array(array($c, $m), $args);\n break;\n case $refl->isPublic():\n $inst = $this->instance($c);\n $req->result = call_user_func_array(array($inst, $m), $args);\n break;\n case $refl->isProtected() && $is_super:\n $refl->setAccessible(TRUE);\n $req->result = $refl->invokeArgs(new $c, $args);\n break;\n default:\n throw new Exception(\"Method not found or permission denied on launching $c::$m.\");\n }\n } catch (Exception $e) {\n if (!is_object($req))\n $req = $this->request = (object)NULL;\n $data = isset($e->data) ? $e->data : get_class($e);\n $req->error = array('code' => $e->getCode(), 'message' => $e->getMessage(), 'data' => $data);\n }\n }", "public function run()\n {\n if (!isset($this->routes[$_SERVER['REQUEST_METHOD']])) {\n throw new \\Exception(\"Methode non trouver\");\n }\n foreach ($this->routes[$_SERVER['REQUEST_METHOD']] as $route) {\n if ($route->match($this->url)) {\n return $route->call();\n }\n }\n throw new \\Exception(\"No route trouver pour \" . $this->url);\n\n }", "public function lookup() { return $this->doRequest(); }", "abstract public function response();", "public function getResponse() {}", "public function getResponse() {}", "public function processAction(): Response\n {\n // 1. Transform Request to Query.\n /** @var GetOneQuery $query */\n $query = $this->queryAdapter->buildQueryFromRequest($this->queryRequest);\n\n // 2. Business work thanks to the Query.\n $entity = $this->queryHandler->process($query);\n\n // 3. Format using the business work and return the Response.\n $body = $this->prepareSuccess($entity);\n return $this->responseHandler->create($body)->getResponse();\n }", "protected function handleGET()\n {\n $refresh = $this->request->getParameterAsBool('refresh');\n $scriptable = $this->request->getParameterAsBool('scriptable');\n $service = $this->request->getParameter('service');\n $results = $this->getEventMap($refresh);\n $allEvents = [];\n foreach ($results as $serviceKey => $paths) {\n if (!empty($service) && (0 !== strcasecmp($service, $serviceKey))) {\n unset($results[$serviceKey]);\n } else {\n foreach ($paths as $path => $operations) {\n foreach ($operations['verb'] as $method => $events) {\n if ($scriptable) {\n foreach ($events as $ndx => $event) {\n $temp = [\n $event . '.pre_process',\n $event . '.post_process',\n $event . '.queued',\n ];\n $results[$serviceKey][$path]['verb'][$method] = $temp;\n $allEvents = array_merge($allEvents, $temp);\n }\n } else {\n $allEvents = array_merge($allEvents, $events);\n }\n }\n }\n }\n }\n\n if (!$this->request->getParameterAsBool(ApiOptions::AS_LIST)) {\n return $results;\n }\n\n return ResourcesWrapper::cleanResources(array_values(array_unique($allEvents)));\n }", "public function call()\r\n\t{\r\n\t\t// get the request XML from the DOM document\r\n\t\t$request_xml = $this->__toString();\r\n\t\t\r\n\t\t// get the API function name\r\n\t\t$function_name = get_class($this);\r\n\t\tif (substr($function_name, -4) == 'Mass')\r\n\t\t{\r\n\t\t\t$function_name = substr($function_name, 0, -4);\r\n\t\t}\r\n\t\t$function_name = substr($function_name, strrpos($function_name, '_') + 1);\r\n\t\t\r\n\t\t// make the API call\r\n\t\ttry\r\n\t\t{\r\n\t\t\t// instantiate the SOAP client and make the API call\r\n\t\t\t$client = new SoapClient($this->props['remote_host'].'/external/api/api.wsdl', \r\n\t\t\t\tarray('location' => $this->props['remote_host'].'/external/api/api.php'));\r\n\t\t\t$result = $client->$function_name($this->props['api_version'], $this->props['auth_key'], $request_xml);\r\n\t\t} // end try\r\n\t\t// there was an error trying to make the API call\r\n\t\tcatch (SoapFault $fault)\r\n\t\t{\r\n\t\t\tthrow new Services_WorkXpress_API_Exception(\"SOAP Fault: (faultcode: {$fault->faultcode}; faultstring: {$fault->faultstring})\");\r\n\t\t} // end catch SoapFault\r\n\t\t\r\n\t\t// create a response object\r\n\t\t$class_name = str_replace('Request', 'Response', get_class($this));\r\n\t\tif (substr($class_name, -4) == 'Mass')\r\n\t\t{\r\n\t\t\t$class_name = substr($class_name, 0, -4);\r\n\t\t}\r\n\t\t$response = new $class_name($result);\r\n\t\t\r\n\t\treturn $response;\r\n\t}", "abstract public function processRequest();", "public function call()\n\t{\n\t\tcall_user_func_array(array($this->client, 'request'), func_get_args());\n\n\t\treturn $this->client->getResponse();\n\t}", "final public function handle()\n {\n \n $this->_preHandle();\n \n if ($this->_request->getActionName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the action name.');\n }\n\n if ($this->_request->getProviderName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the provider name.');\n }\n \n ob_start();\n \n try {\n $dispatcher = new ZendL_Tool_Rpc_Endpoint_Dispatcher();\n $dispatcher->setRequest($this->_request)\n ->setResponse($this->_response)\n ->dispatch();\n \n } catch (Exception $e) {\n //@todo implement some sanity here\n die($e->getMessage());\n //$this->_response->setContent($e->getMessage());\n return;\n }\n \n if (($content = ob_get_clean()) != '') {\n $this->_response->setContent($content);\n }\n \n $this->_postHandle();\n }", "public function execute(){\n try {\n $request = $this->getRestClient();\n $raw_response = $request->request();\n } catch (Zend_Http_Client_Exception $e) {\n Mage::helper('unbxd_recommendation')->log(Zend_Log::ERR,\n sprintf($this->getUrl() .\" failed because HTTP error: %s\", $e->getMessage()));\n return Mage::getModel('unbxd_recommendation/api_response')\n ->setErrorMessage(Unbxd_Recommendation_Model_Api_Response::SERVER_ERR);\n }\n return Mage::getModel(\"unbxd_recommendation/api_response\")\n ->setJsonResponse($this->isJsonResponse())\n ->setResponse($raw_response, $this->getUrl());\n }", "public function run(){\n if(!isset($this->routes[$_SERVER['REQUEST_METHOD']])){\n throw new \\Exception('REQUEST_METHOD does not exist');\n }\n foreach($this->routes[$_SERVER['REQUEST_METHOD']] as $route){\n if($route->match($this->url)){\n return $route->call();\n }\n }\n throw new \\Exception(\"e404\");\n }", "protected function getApiResult()\n {\n return Singleton::class('ZN\\Services\\Restful')->get($this->address);\n }", "public function getEndpoint(): string;", "public function getEndpoint(): string;", "public function getEndpoint(): string;", "public function getEndpoint(): string;", "public function processAPI() {\n $file = __dir__ . \"/../Controllers/\" . $this->endpoint . \"Controller.php\";\n\n if (file_exists($file)) {\n require $file;\n $class = \"\\\\Controllers\\\\\" .$this->endpoint . \"Controller\";\n\n } else {\n throw new \\Exception($file . \" does not exist.\");\n }\n\n $response = [];\n switch($this->method) {\n case HttpMethod::DELETE:\n case HttpMethod::POST:\n case HttpMethod::PUT:\n case HttpMethod::PATCH:\n $data = file_get_contents(\"php://input\");\n $this->data = json_decode($data,true);\n break;\n case HttpMethod::GET:\n break;\n default:\n $response = [\n \"Error\" => true,\n \"ErrorMessage\" => \"Unsupported Method: \".$this->method\n ]; \n $status = 405; \n return $this->_response($response,$status);\n break;\n }\n\n $worker = new $class($this->method,$this->data);\n $response = $worker->actionJson();\n\n return $this->_response($response);\n\n }", "public function processApi() {\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n if((int)method_exists($this, $func) > 0)\n $this->$func();\n else\n $this->response('',404);\n }", "public function dispatch()\n\t{\n\t\t$method = $_SERVER['REQUEST_METHOD'];\n\t\tif($method == 'OPTIONS')\n\t\t{\n\t\t\treturn $this->handle(function() {\n\t\t\t\t$response = array('options' => 'Defined!');\n\t\t\t\treturn [200, $response];\n\t\t\t});\n\t\t}\n\n\t\t$uri = $_SERVER['REQUEST_URI'];\n\n\t\t$end = strpos($uri, '?');\n\t\t$path = substr($uri, 0, $end ? $end : strlen($uri));\n\n\t\t$action = NULL;\n\t\t// Match directly, we skip it.\n\t\tif(!empty($this->_routes[$method][$path]))\n\t\t{\n\t\t\t$action = $this->_routes[$method][$path];\n\t\t}\n\n\t\t$argumentsList = array();\n\n\t\tif($action === NULL)\n\t\t{\n\t\t\t/**\n\t\t\t * Match URL\n\t\t\t *\n\t\t\t * WARNING: Known bug, the first endpoint with params to match will be choosen!\n\t\t\t * Example for the path: /order/125/update\n\t\t\t * - /order\n\t\t\t * - /order/{id} <-- This endpoint will be choosen\n\t\t\t * - /order/{id}/update\n\t\t\t */\n\t\t\tforeach($this->_routes[$method] AS $endpoint => $actionParam)\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * Retrieve the params from the endpoint.\n\t\t\t\t */\n\t\t\t\t$paramRegex = '/{[^}]*}/';\n\t\t\t\tpreg_match_all($paramRegex, $endpoint, $params);\n\n\t\t\t\t/* The endpoint wasn't requiring any param, it should be matched before, we skip it. */\n\t\t\t\tif(empty($params[0]))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Generate the regex for URL matching\n\t\t\t\t */\n\t\t\t\t$arguments = array();\n\t\t\t\tforeach($params[0] AS $param)\n\t\t\t\t{\n\t\t\t\t\t$param_name = substr($param, 1, -1);\n\t\t\t\t\t$regexp = '(?P<' . $param_name . '>[^/]+)';\n\t\t\t\t\t$endpoint = str_replace($param, $regexp, $endpoint);\n\t\t\t\t\t$arguments[] = $param_name;\n\t\t\t\t}\n\t\t\t\t$endpoint_matcher = '@^' . $endpoint . '|/?$@';\n\n\t\t\t\t/**\n\t\t\t\t * Match the endpoint.\n\t\t\t\t */\n\t\t\t\tpreg_match($endpoint_matcher, $path, $args);\n\n\t\t\t\t/**\n\t\t\t\t * Endpoint doesn't match.\n\t\t\t\t */\n\t\t\t\tif(empty($args[0]))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Set action and retrieve the list of values.\n\t\t\t\t */\n\t\t\t\t$action = $actionParam;\n\t\t\t\tforeach($arguments AS $name)\n\t\t\t\t{\n\t\t\t\t\t$argumentsList[$name] = $args[$name];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(empty($action))\n\t\t{\n\t\t\treturn $this->handle(function() use($method, $path) {\n\t\t\t\t$response = array('error' => 'Not found!', 'method' => $method, 'route' => $path);\n\t\t\t\treturn [404, $response];\n\t\t\t});\n\t\t}\n\n\t\tif(!$this->checkAuthentication($action))\n\t\t{\n\t\t\treturn $this->handle(function() use($action) {\n\t\t\t\treturn [401, 'Access denied!'];\n\t\t\t});\n\t\t}\n\n\t\treturn $this->handle($action['action'], $argumentsList);\n\t}", "abstract function do_api_request();", "public function processApi();", "public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}", "abstract protected function handleResult();", "public function processApi(){\n\t\t$words = explode(\"/\",$_REQUEST['rquest']);\n\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$words[0])));\n\t\t\n \t\tif(strcmp(\"services\",$func) == 0)\n\t\t\t$this->$func($words[1],$words[2]);\t// you can set as many levels as you want\n\t\telse\n\t\t\t$this->response('',404);\t// response would be \"Page not found\"\n\t}", "public function run(): ResponseInterface {\n\t\treturn $this->handle(self::getServerRequest());\n\t}", "public function endpoint() {\n\t\tglobal $bp;\n\t\tif ( bp_is_current_component( $bp->api->id ) ) {\n\n\t\t\tif ( bp_is_current_action( 'addclient' ) ) {\n\t\t\t\tif ( !empty( $_POST ) ) {\n\t\t\t\t\t$this->process_addclient();\n\t\t\t\t}\n\t\t\t\tbp_api_load_template( 'api/addclient' );\n\t\t\t} else if ( bp_is_current_action( 'request_token' ) ) {\n\t\t\t\t$this->process_request_token();\n\t\t\t} else if ( bp_is_current_action( 'authorize' ) ) {\n\t\t\t\t$this->process_authorize();\n\t\t\t} else if ( bp_is_current_action( 'access_token' ) ) {\n\t\t\t\t$this->process_access_token();\n\t\t\t}\n\n\t\t\trequire( CIAB_PLUGIN_DIR . 'lib/restler/restler.php' );\n\t\t\trequire( CIAB_PLUGIN_DIR . 'api/class.bp-restler.php' );\n\t\t\t$this->restler = new BP_Restler;\n\n\t\t\tdo_action( 'bp_api_init' );\n\n\t\t\t/**\n\t\t\t * @todo Make this non-nonsense\n\t\t\t *\n\t\t\t * Be sure you know what you're doing before you disable OAuth! You can\n\t\t\t * enable admin access to your whole site if you're not careful!\n\t\t\t *\n\t\t\t * You can override OAuth by supplying your own BP_API_Auth class. Make sure\n\t\t\t * it's loaded before we get to this point, so that we don't load OAuth.\n\t\t\t */\n\t\t\tif ( !class_exists( 'BP_API_Auth' ) ) {\n\t\t\t\trequire( CIAB_PLUGIN_DIR . 'api/class.auth.php' );\n\t\t\t}\n\t\t\t$this->restler->addAuthenticationClass( 'BP_API_Auth' );\n\n\t\t\trequire( CIAB_PLUGIN_DIR . 'api/class.api-server-actions.php' );\n\t\t\t$this->restler->addAPIClass( 'BP_API_Server_Actions' );\n\n\t\t\t$this->restler->handle();\n\t\t\tdie();\n\t\t}\n\t}", "abstract public function handle_request();", "public function process($uri)\n {\n return $this->__invoke($uri);\n }", "public function dispatch(): ResponseInterface\n {\n if(!isset($this->current_route)){\n $this->current_route = $this->resolve($this->current_method, $this->current_url);\n }\n\n $hasRoute = isset($this->current_route) && !empty($this->current_route);\n\n if($hasRoute === FALSE){\n return $this->notFound();\n }\n\n $route = $this->current_route;\n $arguments = $route['arguments'] ?? [];\n \\define('INITPHP_ROUTER_CURRENT_ARGUMENTS', $arguments);\n\n $filters = [\n 'before' => [],\n 'after' => [],\n ];\n if(isset($route['options']['middleware']['before'])){\n $filters['before'] = $route['options']['middleware']['before'];\n unset($route['options']['middleware']['before']);\n }\n if(isset($route['options']['middleware']['after'])){\n $filters['after'] = $route['options']['middleware']['after'];\n unset($route['options']['middleware']['after']);\n }\n if(isset($route['options']['middleware']) && !empty($route['options']['middleware'])){\n $filters['before'] = \\array_merge($route['options']['middleware'], $filters['before']);\n $filters['after'] = \\array_merge($route['options']['middleware'], $filters['after']);\n unset($route['options']['middleware']);\n }\n\n $this->middleware_handle($filters['before'], $arguments, self::BEFORE);\n $responseStatusCode = (int)$this->response->getStatusCode();\n if($responseStatusCode < 200 || $responseStatusCode > 299){\n return $this->response;\n }\n if ($route['methods'] === ['LINK']) {\n return $this->execute($route['execute'], $arguments, self::LINK);\n } else {\n if(\\is_callable($route['execute'])){\n \\define('INITPHP_ROUTER_CURRENT_CONTROLLER', '__CALLABLE__');\n \\define('INITPHP_ROUTER_CURRENT_METHOD', '');\n $this->response = $this->execute($route['execute'], $arguments);\n }else{\n $parse = $this->getControllerMethod($route['execute'], $route['options']);\n $parse['controller'] = $this->controllerFind($parse['controller']);\n $reflection = new \\ReflectionClass($parse['controller']);\n $controller = $this->getClassContainer($reflection);\n $this->middleware_handle($this->controller_middlewares_property($controller, $parse['method'], self::BEFORE), $arguments, self::BEFORE);\n \\define('INITPHP_ROUTER_CURRENT_CONTROLLER', \\get_class($controller));\n \\define('INITPHP_ROUTER_CURRENT_METHOD', $parse['method']);\n $responseStatusCode = (int)$this->response->getStatusCode();\n if($responseStatusCode < 200 || $responseStatusCode > 299){\n return $this->response;\n }\n $this->response = $this->execute([$controller, $parse['method']], $arguments);\n $after_middleware = $this->controller_middlewares_property($controller, $parse['method'], self::AFTER);\n if(!empty($after_middleware)){\n $filters['after'] = \\array_merge($filters['after'], $after_middleware);\n }\n }\n }\n\n $this->middleware_handle($filters['after'], $arguments, self::AFTER);\n\n return $this->response;\n }", "public function response();", "public function request() {\n // The basic flow: build the url, make the request, parse and return the\n // output.\n $url = $this->query_builder->getUrl();\n\n // @todo: does this make sense to be in a separate class? Anyway, this shoudl\n // be somehow refactored because it is hard to replace or overwrite it.\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n $response = curl_exec($curl);\n // @todo: very important: check the curl errors here.\n\n return $this->parser->parse($response);\n }", "function process() {\n\t\t\t$response = $this->response();\n\t\t\t$this->setSuccess($response);\n\t\t\treturn $this->responseVar;\n\t\t}", "public function onEndpointRequest( $info, $ftnreq, $send_executor_rsp );", "public function execute()\n\t{\n\t\t$this->prepare();\n\t\t$result = $this->processor->execute( $this->method, $this->url, $this->headers, $this->body, $this->config );\n\n\t\tif ( $result ) { // XXX exceptions?\n\t\t\t$this->response_headers = $this->processor->get_response_headers();\n\t\t\t$this->response_body = $this->processor->get_response_body();\n\t\t\t$this->executed = true;\n\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\t// processor->execute should throw an Exception which would bubble up\n\t\t\t$this->executed = false;\n\n\t\t\treturn $result;\n\t\t}\n\t}", "public function getme(){\n return $this->make_http_request(__FUNCTION__);\n }", "public function processApi() {\r\n\tif($this->securedRest){\r\n\t if(!isset($this->requestSecure) || !isset($this->requestPublicKey)){\r\n\t\t$this->response('Utilisateur non authentifié', 401);\r\n\t }\r\n\t if(!$this->verifyKeys($this->requestPublicKey, $this->requestSecure)){\r\n\t\t$this->response('Utilisateur non authentifié', 401);\r\n\t }\r\n\t}\r\n\t\r\n\t$func = $this->_method;\r\n\tif ((int) method_exists($this, $func) > 0){\r\n\t $this->$func();\r\n\t}else{\r\n\t $this->response('', 404);\r\n\t}\r\n\t\r\n }", "public function processApi(){\r\n\t\t\t$service = explode(\"/\", $_GET['x']);\r\n\t\t\t$this->entity = ucfirst($service[0]);\r\n\t\t\t$this->methode = $service[1];\r\n\t\t\t$func = $this->methode.$this->entity;\r\n\t\t\t$this->addLog('--'.$this->methode.$this->entity);\r\n\t\t\tif((int)method_exists($this,$func) > 0)\r\n\t\t\t\t$this->$func();\r\n\t\t\telse\r\n\t\t\t\t$this->response('',404); // If the method not exist with in this class \"Page not found\".\r\n\t\t\t\t\r\n\t\t}", "public function execute()\n {\n $action = $this->action ?: '__index';\n $params = (array) $this->params;\n\n $response = $this->__preAction($action, $params);\n if ($response !== false) {\n $response = call_user_func_array(array($this, $action), $params);\n }\n\n $response = $this->__postAction($action, $params, $response) ?: $response;\n\n return $response ?: new \\Gini\\CGI\\Response\\Nothing();\n }", "abstract public function request();", "public static function call(){\n\t\t\t$request = self::get_request();\n\t\t\t$method = self::get_method();\n\t\t\t\n\t\t\t$callback_information = self::route($method, $request);\n\t\t\t$callback = $callback_information[0];\n\t\t\t$params = $callback_information[1];\n\n\t\t\t// Start an output buffer, execute the callback function for our route, and store all the captured output in $body:\n\t\t\tob_start();\n\n\t\t\t\tif(count($params) == 0)\n\t\t\t\t\tcall_user_func($callback);\n\t\t\t\telse\n\t\t\t\t\tcall_user_func($callback, $params);\n\t\t\t\t\n\t\t\t\tif (self::$body == '')\n\t\t\t\t\tself::$body = ob_get_contents();\n\t\t\t\t\n\t\t\tob_end_clean();\n\t\t}", "public function processApi()\n {\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['mode'])));\n if((int)method_exists($this,$func) > 0)\n {\n $this->$func();\n } \n else\n {\n $data = array('code' => \"404\", 'status' => \"failure\", \"msg\" => \"requested method not available\", \"data\" => array());\n $this->response($this->json($data)); \n }\n \n // If the method not exist with in this class, response would be \"Page not found\".\n }", "protected function handle()\n {\n $prefix = $this->restful ? \\Phork::router()->getMethod() : $this->prefix;\n $segment = str_replace('.'.$this->format, '', $this->router->getSegment($this->segment));\n \n if (method_exists($this, $method = $prefix.ucfirst($segment))) {\n call_user_func_array(array($this, $method), array_slice(\\Phork::router()->getSegments(), $this->segment + 1));\n } else {\n throw new \\ApiException(\\Phork::language()->translate('Invalid API method'), 400);\n }\n }", "public function processApi() {\n $request = $this->_request['request'];\n $values = $this->_request;\n\n // WARNING: This method needs to add some ways to authenticate the user\n // and should also filter out any dangerous or magic methods before it\n // would be safe. This code is for demonstration purposes only!\n\n if (method_exists($this->database, $request)) {\n if (!empty($_REQUEST['request'])) {\n unset($values['request']);\n $result = $this->database->processRequest($request, $values);\n if (!empty($result)) {\n $this->response($this->json($result), 200);\n }\n else {\n // If no records \"No Content\" status\n $this->response('',204);\n }\n }\n else {\n // If the method not exist with in this class, response would be \"Page not found\".\n $this->response('',404);\n }\n }\n }", "public function run(){\n\t\tif(!$this->parseRequest()){ return; }\n\n\t\t$r = $this->rpcRequest;\n\t\t$classname = $r->obj;\n\t\t$method = $r->method;\n\t\t$params = isset($r->params) ? $r->params : array();\n\t\tob_start();\n\n\t \t// FIXME: Allow for the PHP5 magic __call() method to handle arbitrary/non-\n\t\t// existent methods on the requested object? We'd probably need a\n\t\t// _toSmd() method on the object, then, since there'd be no way to\n\t\t// use reflection to figure out available methods. Either that, or\n\t\t// set it up so you manually register methods with the API.\n\n\t\t// try and instantiate the requested object and call the method\n\t\tif(class_exists($classname)){\n\t\t\t// TODO: perhaps attempt to pass, say, an object ID into the constructor?\n\t\t\t$fn = array(new $classname, $method);\n\t\t\tif(is_callable($fn)){\n\t\t\t\t// call the requested method\n\t\t\t\t$this->responseResult = call_user_func_array($fn, $params);\n\t\t\t}else{\n\t\t\t\t// method doesn't exist\n\t\t\t\t$this->error(\"ROUTING ERROR: Couldn't find {$classname}->{$method}().\");\n\t\t\t\t$this->rpcError(self::JSON_RPC_ERROR_METHOD_NOT_FOUND);\n\t\t\t}\n\t\t}else{\n\t\t\t// can't find the requested class\n\t\t\t$this->error(\"INSTANTIATION ERROR: Couldn't get the object [$classname]\");\n\t\t\t$this->rpcError(self::JSON_RPC_ERROR_INVALID_REQUEST);\n\t\t}\n\n\t\t// ignore any output from print or echo, and clear the buffer\n\t\tob_end_clean();\n\n\t\t$this->sendResponse();\n\t}", "public function processApi()\n {\n\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['x'])));\n if ((int) method_exists($this, $func) > 0) {\n $this->$func();\n }\n else {\n $this->response('', 404);\n }\n }", "public function run()\n\t{\n\t\t// Proxy requests, write headers, and then render response\n\t\treturn $this\n\t\t\t->request()\n\t\t\t->response()\n\t\t;\n\t}", "public function run()\r\n \t{ \t\t\r\n \treturn call_user_func_array(array($this, $this->_load('_route')->get_method()),$this->_load('_route')->get_param());\r\n \t}", "public function perform()\n\t\t{\n##\t\t\t$data_string = json_encode($data);\n\t\t\t$ch = curl_init($this->endpoint);\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->request_type);\n\n\t\t\tif ($this->payload != NULL)\n\t\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $this->payload);\n\t\t\t\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n\t\t\t#curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json'));\n\t\t\t\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers);\n\t\t\t\n\t\t\t$this->result = curl_exec($ch);\n\t\t\t\n\t\t\tif ($ret = json_decode($this->result,true))\n\t\t\t\treturn $ret;\n\t\t\telse\n\t\t\t\tdie(\"ERROR: $this->result\");;\n\t\t\treturn json_decode($this->result,true);\n\t\t}", "public function Execute ()\n {\n $client = $this->GetServiceWrapper()->GetServiceObject();\n $client_options = $this->GetClientOptions();\n $client->setOptions($client_options);\n\n $this->setRouter($this->GetServiceWrapper()->GetRouteStack() );\n\n $request = $client->getRequest();\n $request->setMethod(static::REQUEST_METHOD);\n $request->getUri()->setPath($this->GetRoute());\n\n $this->mServiceResponse = $client->dispatch($request)->GetBody();\n\n $this->mResult = $this->GetResultPrototype();\n\n if (empty($this->mServiceResponse))\n {\n if (true === $this->mThrowEmptyModelExceptions)\n {\n throw new Interrupt\\ModelNotFoundFailure(get_class($this), get_class($this->GetServiceWrapper()->GetPrototype()), $stmt->queryString);\n }\n }\n else\n {\n $this->ProcessResponse();\n }\n\n return $this->mResult;\n }", "public function processRequest() {\n $serviceType = $this->getServiceType();\n if(!$serviceType){return \"Invalid Call ! \\n\";}\n $repoPath = $this->getRepoName();\n if(!defined(\"__APIURL__\" . $serviceType)){\n return \"API URL not found for $serviceType\\n\";\n }\n $apiUrl = sprintf(constant(\"__APIURL__\" . $serviceType), $repoPath);\n $response = $this->makeCurlRequest($apiUrl, 'get');\n switch ($serviceType) {\n case 'github.com':\n return $this->getCountForGit($response);\n break;\n case 'bitbucket.org':\n return $this->getCountForBit($response);\n break;\n default :\n return $response;\n break;\n }\n }", "public function processApi() {\n\t\t$func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['rquest'])));\n\t\tif ((int) method_exists($this, $func) > 0)\n\t\t\t$this -> $func();\n\t\telse\n\t\t\t$this -> response('', 404);\n\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t}", "public function processApi() {\n\t\t$func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['rquest'])));\n\t\tif ((int) method_exists($this, $func) > 0)\n\t\t\t$this -> $func();\n\t\telse\n\t\t\t$this -> response('', 404);\n\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t}", "public function processApi(){\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n if((int)method_exists($this,$func) > 0)\n $this->$func();\n else\n $this->response('',404);\t\t\t\t// If the method not exist with in this class, response would be \"Page not found\".\n }", "public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->response('',404);\t\t\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t\t}", "public function processApi() {\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['request'])));\n if ((int) method_exists($this, $func) > 0)\n $this->$func();\n else\n $this->response('', 404); // If the method not exist with in this class, response would be \"Page not found\".\n }", "protected function invokeParserMethod()\n\t{\n\t\t$http_method = ucfirst(strtolower($this->request->getMethod()));\n\t\t$method = \"parse{$http_method}Response\";\n\t\t\n\t\tif (method_exists($this, $method)) {\n\t\t\treturn $this->{$method}();\n\t\t}\n\t}", "public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }", "public function execute()\n\t{\n\t\t$this->prepare();\n\t\t$result = $this->processor->execute( $this->method, $this->url, $this->headers, $this->body, $this->config );\n\t\t$this->body = ''; // We need to do this as we reuse the same object for performance. Once we've executed, the body is useless anyway due to the changing params\n\t\tif ( $result ) {\n\t\t\t$this->response_headers = $this->processor->getHeaders();\n\t\t\t$this->response_body = $this->processor->getBody();\n\t\t\t$this->executed = true;\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\t$this->executed = false;\n\t\t\treturn $result;\n\t\t}\n\t}", "public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['value'])));\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->response('',404);\t\t\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t\t}", "public function getResponse() {\n\t}", "public function call()\n {\n $this->dispatchRequest($this['request'], $this['response']);\n }", "private function _REST_Handle()\r\n {\r\n // Check encruption requirement\r\n if($this->_get_array_value($_GET,\"AUTH\") == true)\r\n {\r\n $request_command[\"AUTH\"] = true;\r\n \r\n // restore the data from url code\r\n $url_data = $this->_get_array_value($_GET,\"data\");\r\n\r\n // Perform decryption, if clear text input, screw it\r\n $this->load->library('encrypt');\r\n $data_string_decrypt = json_decode($this->encrypt->decode($url_data), true);\r\n \r\n if($data_string_decrypt === NULL || $this->_fail_auth_check($data_string_decrypt))\r\n {\r\n $request_command[\"AUTH\"] = false;\r\n $request_command[\"status\"] = \"Error\";\r\n $request_command[\"status_information\"] = \"Error: Fail AUTH\";\r\n }\r\n }\r\n else\r\n {\r\n $request_command[\"AUTH\"] = false;\r\n $data_string = urldecode($_GET);\r\n $data_string_decrypt = json_decode($data_string, true);\r\n }\r\n \r\n // Obtain necessary data\r\n if($data_string_decrypt !== NULL)\r\n {\r\n $request_command[\"service\"] = $this->_get_array_value($data_string_decrypt,\"service\");\r\n $request_command[\"send_data\"] = $this->_get_array_value($data_string_decrypt,\"send_data\");\r\n }\r\n \r\n // Debug purpose\r\n //echo \"<br> get: \".json_encode($_GET).\"<br>\";\r\n //echo \"<br> result: \".json_encode($request_command).\"<br>\";\r\n return $request_command;\r\n }", "public function run()\n {\n $routes = require BASE_DIR.'/routes/routes.php';\n foreach ($routes as $mainroute) {\n foreach ($mainroute as $route => $method) {\n $args = [];\n if(preg_match(convertUrl($route), $this->request->getCurrentUri(), $args))\n {\n unset($args[0]);\n $args = implode(',', $args);\n\n return $this->response->make($method, $args);\n }\n }\n }\n\n throw new \\Exception(\"Route not found\");\n }", "public function processApi(){\n\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t$this->$func();\n\t\telse\n\t\t\t$this->response('',404);\t// If the method not exist with in this class, response would be \"Page not found\".\n\t}", "public function parse()\n\t{\n\t\t//we don't need to hit the API everytime parse is called\n\t\tif (!$this->response)\n\t\t\t$this->response = $this->request->execute();\n\t\t\n\t\treturn $this->invokeParserMethod();\t\n\t}", "public function processApi(){\n\t\t\t$piece = explode(\"/\", $_SERVER['REQUEST_URI']); \n\t\t\t$func = end($piece);\n\t\t\tif((int)method_exists($this,$func) > 0){\n\t\t\t\t$con = mysqli_connect(\"localhost\",\"root\",\"\",\"playlist\"); \n\t\t\t\t// Check connection\n\t\t\t\tif (mysqli_connect_errno()){\n\t\t\t\t echo \"Failed to connect to MySQL: \" . mysqli_connect_error();\n\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t$this->$func($con); \n\t\t\t}else\n\t\t\t\t$this->response('',404);// If the method not exist with in this class, response would be \"Page not found\".\n\t\t}", "public function call()\n {\n $env = $this->application->environment();\n if (isset($env['HTTP_X_HTTP_METHOD_OVERRIDE'])) {\n // Header commonly used by Backbone.js and others\n $env['light.method_override.original_method'] = $env['REQUEST_METHOD'];\n $env['REQUEST_METHOD'] = strtoupper($env['HTTP_X_HTTP_METHOD_OVERRIDE']);\n } elseif (isset($env['REQUEST_METHOD']) && $env['REQUEST_METHOD'] === 'POST') {\n // HTML Form Override\n $req = new \\Light\\Http\\Request($env);\n $method = $req->post($this->configs['key']);\n if ($method) {\n $env['light.method_override.original_method'] = $env['REQUEST_METHOD'];\n $env['REQUEST_METHOD'] = strtoupper($method);\n }\n }\n $this->next->call();\n }", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "private function dispatch(): void {\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"{$this->apiUrl}/{$this->endpoint}\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => \"CURL_HTTP_VERSION_1_1\",\n CURLOPT_CUSTOMREQUEST => $this->method\n ));\n\n $this->response = curl_exec($curl); \n curl_close($curl);\n }", "public function exec(){\n return curl_exec($this->handler);\n }", "public function response ();", "abstract function run(APIEndpoint $e, array $args);", "public function sendGet ()\n {\n return $this->handleQuery();\n }", "public function process() {\n\n try {\n \n /*\n * !! IMPORTANT !!\n * Collections with a name starting with '$' character are not collection\n * but reserved actions \n */\n if ($this->request['collection'] && substr($this->request['collection'], 0 , 1) === '$') {\n \n /*\n * Action always returns JSON\n */\n $this->request['format'] = self::DEFAULT_RESPONSE_FORMAT;\n \n /*\n * QueryAnalyzer standalone service\n */\n if ($this->request['collection'] === '$analyzeQuery' && class_exists('QueryAnalyzer')) {\n \n /*\n * Change parameter keys to model parameter key\n * and remove unset parameters\n */\n $params = array();\n foreach ($this->request['params'] as $key => $value) {\n if ($value) {\n foreach(array_keys(RestoController::$searchFiltersDescription) as $filterKey) {\n if ($key === RestoController::$searchFiltersDescription[$filterKey]['osKey']) {\n $params[$filterKey] = $value;\n }\n }\n }\n }\n $qa = new QueryAnalyzer($this->dictionary, RestoController::$searchFiltersDescription, class_exists('Gazetteer') ? new Gazetteer($this) : null);\n $this->response = $qa->analyze($params);\n $this->responseStatus = 200;\n }\n else {\n throw new Exception('Not Found', 404);\n }\n }\n /*\n * Collection is requested\n */\n else if ($this->request['collection']) {\n \n /*\n * Collection does not exist\n */\n if (!$this->collections[$this->request['collection']]) {\n throw new Exception('Not Found', 404);\n }\n \n /*\n * Search collection Controller name within collections list\n */\n $controllerName = null;\n foreach (glob(realpath(dirname(__FILE__)) . '/../controllers/*.php', GLOB_NOSORT) as $controller) {\n if ($this->collections[$this->request['collection']]['controller'] === basename($controller, '.php')) {\n $controllerName = basename($controller, '.php');\n break;\n }\n }\n\n /*\n * Invalid controller \n */\n if (!$controllerName) {\n throw new Exception('Invalid collection', 500);\n }\n \n /*\n * HTTP method is PUT, POST or DELETE and no identifier is set\n * \n * HTTP DELETE - Delete new collection (if CollectionManager module is active)\n * HTTP PUT - Update new collection (if CollectionManager module is active)\n */\n if ($this->request['method'] === 'put' && !$this->request['identifier']) {\n if (class_exists('CollectionManager')) {\n $collectionManager = new CollectionManager($this);\n $this->response = $collectionManager->update();\n }\n else {\n throw new Exception('Forbidden', 403);\n }\n }\n else if ($this->request['method'] === 'delete' && !$this->request['identifier']) {\n if (class_exists('CollectionManager')) {\n $collectionManager = new CollectionManager($this);\n $this->response = $collectionManager->delete();\n }\n else {\n throw new Exception('Forbidden', 403);\n }\n }\n /*\n * HTTP GET method on /collection\n * HTTP POST, PUT DELETE on /collection/identifier\n */\n else {\n \n /*\n * Instantiate RestoController\n */\n $controller = new ReflectionClass($controllerName);\n if (!$controller->isInstantiable()) {\n throw new Exception('Bad Request', 400);\n }\n try {\n $method = $controller->getMethod($this->request['method']);\n } catch (ReflectionException $re) {\n throw new Exception('Forbidden', 403);\n }\n\n /*\n * Initialize a controller instance\n */\n if (!$method->isStatic()) {\n $controllerInstance = $controller->newInstance($this);\n $method->invoke($controllerInstance);\n $this->response = $controllerInstance->getResponse();\n $this->responseStatus = $controllerInstance->getResponseStatus();\n $this->responseDescription = $controllerInstance->getDescription();\n } else {\n throw new Exception('Static methods not supported in Controllers', 500);\n }\n if (is_null($this->response)) {\n throw new Exception('Method not allowed', 405);\n }\n }\n }\n /*\n * No collection requested \n * \n * HTTP GET - HTTP 200 (will redirect to home page - see htmlResponse)\n * HTTP POST - Create new collection (if CollectionManager module is active)\n * HTTP PUT - Not allowed\n * HTTP DELETE - Not allowed\n * \n */\n else {\n if ($this->request['method'] === 'get') {\n $this->responseStatus = 200;\n }\n else if ($this->request['method'] === 'post' && class_exists('CollectionManager')) {\n $collectionManager = new CollectionManager($this);\n $this->response = $collectionManager->create();\n }\n else {\n throw new Exception('Method Not Allowed', 405);\n }\n }\n } catch (Exception $re) {\n $this->responseStatus = $re->getCode();\n $this->response = array('ErrorCode' => $re->getCode(), 'ErrorMessage' => $re->getMessage());\n }\n\n /*\n * Special case for stream !\n */\n if ($controllerInstance && $this->responseDescription['forceStream']) {\n return;\n }\n\n /*\n * Output result\n */\n $this->response()->send();\n }", "function process()\n\t\t{\n\t\t\tif (is_object($this->Gateway)) {\n\t\t\t\treturn $this->Gateway->process($this);\n\t\t\t}\n\t\t}", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "public function getResponse();", "public function getResponse();" ]
[ "0.65639985", "0.6370146", "0.63532645", "0.62960577", "0.6245972", "0.6227877", "0.6180581", "0.6141454", "0.6103078", "0.6103078", "0.6103078", "0.6083849", "0.60564953", "0.6042563", "0.60238236", "0.60162574", "0.6006249", "0.59838337", "0.59783524", "0.59680635", "0.59664893", "0.5962832", "0.5962832", "0.5959734", "0.59323573", "0.5926603", "0.592164", "0.5905366", "0.58942705", "0.5888389", "0.58823246", "0.5841276", "0.5839021", "0.5839021", "0.5839021", "0.5839021", "0.5831622", "0.58260196", "0.58226573", "0.58135223", "0.58087265", "0.58017755", "0.58011407", "0.5780384", "0.57760227", "0.57691807", "0.57515234", "0.5748542", "0.57436997", "0.574168", "0.5735514", "0.5730152", "0.57270867", "0.572062", "0.5718792", "0.5718613", "0.57144225", "0.5712965", "0.5710514", "0.5703347", "0.56939965", "0.5693868", "0.56922686", "0.56906575", "0.5686227", "0.56763583", "0.5663727", "0.56628555", "0.5660222", "0.5655272", "0.56550646", "0.56550646", "0.5654045", "0.5653924", "0.5652034", "0.5643423", "0.5640292", "0.5633222", "0.56305474", "0.56263095", "0.56239253", "0.5620588", "0.56198263", "0.56115955", "0.5607005", "0.56021774", "0.5601398", "0.55989563", "0.55989563", "0.55989563", "0.5592743", "0.5586241", "0.55844426", "0.55801964", "0.5576016", "0.5572192", "0.5570657", "0.5562969", "0.55543387", "0.55543387" ]
0.6790981
0
Gets current endpoint parameters.
public function getEndpointParams(){ #Explode current endpoint into parts $currentEndpointParts = explode("/", $this->endpointURL); #Iterate foreach ($this->availableEndpoints as $endpointItem) { #Explode the possible endpoint match $itemParts = explode("/", $endpointItem); #Check if count parts match, skip otherwise if(count($currentEndpointParts) != count($itemParts)) continue; #Prepare parts match flag $partsMatched = true; #Prepare resulting associative array $returnArray = []; #Check for each part foreach ($itemParts as $partIDX => $partTag) { #Flag to check if part is argument $partIsArg = preg_match("/^{[a-zA-Z0-9_-]+}$/", $partTag); #Update flag $partsMatched = $partsMatched && ($partIsArg ? 1 : ($partTag == $currentEndpointParts[$partIDX])); #Skip next checks if didn't matched if(!$partsMatched) break; #Insert into result $returnArray[str_replace(["{","}"], "", $partTag)] = $currentEndpointParts[$partIDX]; } #If matched return item data (an associative array with the named endpoint parts being the keys and the requested endpoint parts being the values) if($partsMatched) return $returnArray; } #Fallback return empty return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getParams()\n {\n return self::$params;\n }", "public function getParams()\n {\n return $this->getEvent()->getRouteMatch()->getParams();\n }", "public function getParams()\n {\n return $this->getAttribute('params', false, null);\n }", "public function paramsGet()\r\n {\r\n return $this->params_get;\r\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function getParams() {\n\t\treturn $this -> v_params;\n\t}", "public function getParams()\n {\n return $this->server;\n }", "public function getParameters() {\n \n return $this->params;\n \n }", "public function get_params() {\n\t\treturn $this->params;\n\t}", "public function get_params() {\n return $this->param;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "function getParams() {\n\t\treturn $this->params;\n\t}", "public static function params()\n\t{\n\t\treturn self::$router->getParams();\n\t}", "public function getParams()\n {\n return $this->params;\n }", "function getParams() {\n return $this->params;\n }", "public function getParameters(/* ... */)\n {\n return $this->_params;\n }", "public function getParams() {\n return $this->params;\n }", "public function getAllParam()\n {\n return isset($this->params) ? $this->params : null;\n }", "public function &getParams() {\n return $this->app->getParams();\n }", "public function params()\n {\n return $this->params;\n }", "public function getParams()\r\n\t{\r\n\t\treturn $this->params;\r\n\t}", "public function getParams()\n {\n return $this->_invokeParams;\n }", "public function getRequestParams()\n {\n return $this->getKey('RequestParams');\n }", "public function getParams() {\n \n return $this->_params;\n }", "public function getParams()\n\t{\n\t\treturn $this->params;\n\t}", "public function getParams()\n {\n return $this->wrapped->getParams();\n }", "public function get_parameters() {\n\t return $this->decodedWebhook['queryResult']['parameters'];\n }", "public function getParams()\n {\n return $this->_params;\n }", "public function getParams()\n {\n return $this->_params;\n }", "public function getParams()\n {\n return $this->_params;\n }", "public function getParams()\n {\n return $this->_params;\n }", "public function getParams() {\n\t\treturn $this->params;\n\t}", "public function getParameters()\n {\n return $this->parameters->all();\n }", "public function getParams() {\n return $this->_params;\n }", "public function getParameters()\n {\n // TODO: Implement getParameters() method.\n }", "public function params()\n {\n return $this->_params;\n }", "public function getParams() {}", "public function getParameters() {}", "public function get_url_get_parameters() {\r\n\t\treturn $this->url_get_parameters;\r\n\t}", "public function url_parameters()\n {\n return $this->_params;\n }", "public function GetParameters()\n {\n return $this->parameters;\n }", "public function getParams()\n\t{\n\t\treturn $this->_params;\n\t}", "public function getParams() {\n\n\t\treturn $this->_params;\n\t}", "public function getApiParameters();", "public function getParams()\n {\n // TODO: Implement getParams() method.\n }", "public function getParams()\n {\n return $this->getBody()->getParams();\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getRequestParameters()\n\t{\n\t\treturn $this->aParameters;\n\t}", "function getParameters() {\n\t\treturn $this->inputParameters;\n\t}", "public function get_parameters() {\r\n\t\treturn $this->parameters;\r\n\t}", "public function appParameters()\n {\n return $this->appParameters;\n }", "public function getParams(){\n\t\treturn $this->params;\n\t}", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "function getParameters() {\n return $this->parameters;\n }", "public function getParameters()\r\n {\r\n return $this->parameters;\r\n }", "public function getParameters() {\n return $this->parameters;\n }", "public function getParameters()\n\t{\n\t\treturn $this->parameters;\n\t}", "public function parameters()\n {\n return $this->parameters;\n }", "public function parameters()\n {\n return $this->parameters;\n }", "public function get_params()\n {\n }", "public function get_params()\n {\n }", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();" ]
[ "0.71558005", "0.71092534", "0.7070225", "0.70625347", "0.7059125", "0.7059125", "0.7059125", "0.7059125", "0.70320123", "0.7030083", "0.7011904", "0.6996613", "0.6970557", "0.69671917", "0.69671917", "0.69671917", "0.69671917", "0.69671917", "0.69671917", "0.69671917", "0.69671917", "0.69671917", "0.69671917", "0.69671917", "0.69671917", "0.69671917", "0.69671917", "0.69671917", "0.69671917", "0.69671917", "0.69521964", "0.69521964", "0.69510555", "0.6944392", "0.6941167", "0.6940847", "0.69331443", "0.6932593", "0.6916855", "0.6908708", "0.6906612", "0.6894048", "0.68924546", "0.6885203", "0.6884181", "0.68839437", "0.6880191", "0.6879047", "0.68706787", "0.68706787", "0.68706787", "0.68706787", "0.6866019", "0.6845796", "0.6838367", "0.6825122", "0.6819465", "0.6798405", "0.6797317", "0.67948276", "0.6788383", "0.6781029", "0.67802846", "0.6780017", "0.67640185", "0.6762057", "0.6761699", "0.67503923", "0.67503923", "0.67503923", "0.67503923", "0.67503923", "0.67503923", "0.67503923", "0.67503923", "0.67503923", "0.67503923", "0.67503923", "0.67461985", "0.6746127", "0.6734829", "0.67298365", "0.6726266", "0.67226064", "0.67226064", "0.67222464", "0.66977584", "0.669163", "0.66748816", "0.6648423", "0.6648423", "0.6641518", "0.6641518", "0.6634105", "0.6634105", "0.6634105", "0.6634105", "0.6634105", "0.6634105", "0.6634105", "0.6634105" ]
0.0
-1
Retrieves upcoming movies from TMDb. A future improvement could consist on error checking from a valid TMDb response, for better handling in frontend. Another future improvement could consist on page number validation, based on "total_pages" result key. A language selection based on user data could also be done.
public function retrieveUpcomingMovies($args=[]){ #Page argument: if not set, fallback to 1 (default) $page = $args["page"] ?? 1; #Define the URL based on api documentation (https://developers.themoviedb.org/3/movies/get-upcoming) $url = "https://api.themoviedb.org/3/movie/upcoming?api_key={$this->apiKey}&language={$this->requestLang}&page={$page}"; #Instantiate a new HTTP handler class $HttpHandler = new HttpHandler(); #Retrieve raw output from the HTTP handler over the URL $outputRaw = $HttpHandler->execGET($url); #Bypass the consumed output return $this->consumeRawOutput($outputRaw); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUpcomingMovies (){\n $response = Http::get('https://api.themoviedb.org/3/movie/upcoming?',\n ['api_key' => $this->apiKey]);\n\n return $response;\n }", "function get_movies(){\n $ch = curl_init();\n $url = $GLOBALS['App-Logic'].\"?\" .http_build_query([\n 'get_movies' => true, //a flag to execute the right code in App-Logic! \n ]);\n\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPGET, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);\n \n $response = curl_exec($ch);\n curl_close($ch);\n\n return json_decode($response,true);\n\n }", "public function doMovieSearch()\n {\n if ( !preg_match( \"/^(.*)(19|20)[0-9]{2}/\", $this->Release, $matches ) )\n {\n $variables = array( 'status' => 'ko', 'message' => 'unable to extract the movie name' );\n }\n else\n {\n $movieTitle = $matches[1];\n\n $scraper = new MkvManagerScraperSubsynchro();\n $movies = array_map(\n function( $movie ) {\n $movie['id'] = str_replace( array( '/', '.' ), array( '|', '~' ), $movie['id'] );\n return $movie;\n },\n $scraper->searchMovies( $movieTitle )\n );\n\n $variables = array( 'status' => 'ok', 'movies' => $movies );\n }\n\n $result = new ezcMvcResult();\n $result->variables += $variables;\n\n return $result;\n }", "public function getMovies()\n {\n $movie = Movie::with('genres', 'cast', 'crew', 'licensors', 'producers', 'studios', 'reviews');\n $getters = Input::get();\n \n // Add offset/limit\n $movie->offset( (@$getters['index'] * @$getters['pageSize']) ?: 0);\n $movie->limit(@$getters['pageSize'] ?: 15);\n\n // Return items\n return $movie->get();\n }", "public function GetMovies()\n {\n $KodiData = new Kodi_RPC_Data(self::$Namespace);\n $KodiData->GetMovies(array(\"properties\" => static::$MovieItemList));\n $ret = $this->SendDirect($KodiData);\n if (is_null($ret))\n return false;\n if ($ret->limits->total > 0)\n return json_decode(json_encode($ret->movies), true);\n return array();\n }", "function get_movies( $query )\n{\n log_error('get_movies');\n $html = get_html($query);\n\n $results = array();\n\n foreach($html->find('#movie_results .theater') as $div) {\n log_error('found a theatre');\n $result = array();\n\n //$theatre_id = $div->find('h2 a',0)->getAttribute('href');\n $theatre_info = $div->find('.info',0)->innertext;\n\n //$result['theatre_id'] = substr( $theatre_id, (strrpos($theatre_id, 'tid=')+4) );\n $result['theatre_name'] = $div->find('.name',0)->innertext;\n\n $pos_info = strrpos( $theatre_info, '<a');\n if( $pos_info !== false )\n $result['theatre_info'] = substr( $theatre_info, 0, strrpos( $theatre_info, '<a'));\n else\n $result['theatre_info'] = $theatre_info;\n\n $result['movies'] = array();\n foreach($div->find('.movie') as $movie) {\n log_error('found a movie - '.$movie->find('.name a',0)->innertext);\n\n $movie_id = $movie->find('.name a',0)->getAttribute('href');\n $movie_id = substr( $movie_id, (strrpos($movie_id, 'mid=')+4) );\n\n log_error('obtained movie_id: '.$movie_id);\n\n $info_raw = $movie->find('.info',0)->innertext;\n $pos = strpos($info_raw, ' - <a');\n\n if( $pos !== false ){\n $info = substr( $info_raw, 0, $pos);\n\n $trailer = urldecode($movie->find('.info a', 0)->getAttribute('href'));\n $trailer = substr($trailer, 7);\n $trailer = substr($trailer, 0, strpos($trailer, '&'));\n }\n else {\n $trailer = '';\n }\n\n // showtimes\n $times = array();\n // echo 'movie: '.$movie->find('.name a',0)->innertext.'<br>';\n // echo $movie->find('.times',0)->childNodes(0);\n foreach($movie->find('.times > span') as $time) {\n // echo 'time: '.$time->innertext.'<br>';\n // echo 'attr: '.$time->getAttribute('style').'<br>';\n\n if( trim($time->getAttribute('style')) != 'padding:0' )\n {\n $time_strip = strip_tags($time->innertext);\n $time_strip = str_replace('&nbsp', '', $time_strip);\n $time_strip = str_replace(' ', '', $time_strip);\n //$time_strip = html_entity_decode($time_strip);\n //echo 'a:'.$time_strip.'<br>';\n /*$pos_time = false;\n $pos_time = strrpos($time->innertext, '-->');\n if( $pos_time !== false ){\n $showtime = substr($time->innertext, $pos_time+3);\n //echo $showtime.'<br>';\n }*/\n //echo $time;\n array_push( $times, $time_strip );\n }\n }\n\n array_push($result['movies'], array(\n 'id' => $movie_id,\n 'name' => $movie->find('.name a',0)->innertext,\n 'info' => $info, // (does <a> exist) ? (yes) : (no)\n 'time' => $times,\n 'trailer' => $trailer\n ));\n }\n\n $results[] = $result;\n }\n\n return $results;\n}", "public function upcoming_movies($page_limit = '16', $page = '1', $country = 'US') {\n $format = variable_get('rottentomatoes_format', '.json');\n $params['page_limit'] = $page_limit;\n $params['page'] = $page;\n $params['country'] = $country;\n return $this->call('lists/movies/upcoming' . $format, $params, 'GET');\n }", "public function run()\n {\n //\n $movies = [\n ['mov_id'=>901,'mov_title'=>'Vertigo','mov_year'=>1958,'mov_time'=>128,'mov_lang'=>'English','mov_dt_rel'=>'1958-08-24','mov_rel_country'=>'UK'],\n ['mov_id'=>902,'mov_title'=>'The Innocents','mov_year'=>1961,'mov_time'=>100,'mov_lang'=>'English','mov_dt_rel'=>'1962-02-19','mov_rel_country'=>'SW'],\n ['mov_id'=>903,'mov_title'=>'Lawrence of Arabia','mov_year'=>1962,'mov_time'=>216,'mov_lang'=>'English','mov_dt_rel'=>'1962-12-11','mov_rel_country'=>'UK'],\n ['mov_id'=>904,'mov_title'=>'The Deer Hunter','mov_year'=>1978,'mov_time'=>183,'mov_lang'=>'English','mov_dt_rel'=>'1979-03-08','mov_rel_country'=>'UK'],\n ['mov_id'=>905,'mov_title'=>'Amadeus','mov_year'=>1984,'mov_time'=>160,'mov_lang'=>'English','mov_dt_rel'=>'1985-01-07','mov_rel_country'=>'UK'],\n ['mov_id'=>906,'mov_title'=>'Blade Runner','mov_year'=>1982,'mov_time'=>117,'mov_lang'=>'English','mov_dt_rel'=>'1982-09-09','mov_rel_country'=>'UK'],\n ['mov_id'=>907,'mov_title'=>'Eyes Wide Shut','mov_year'=>1999,'mov_time'=>159,'mov_lang'=>'English','mov_dt_rel'=>null,'mov_rel_country'=>'UK'],\n ['mov_id'=>908,'mov_title'=>'The Usual Suspects','mov_year'=>1995,'mov_time'=>106,'mov_lang'=>'English','mov_dt_rel'=>'1995-08-25','mov_rel_country'=>'UK'],\n ['mov_id'=>909,'mov_title'=>'Chinatown','mov_year'=>1974,'mov_time'=>130,'mov_lang'=>'English','mov_dt_rel'=>'1974-08-09','mov_rel_country'=>'UK'],\n ['mov_id'=>910,'mov_title'=>'Boogie Nights','mov_year'=>1997,'mov_time'=>155,'mov_lang'=>'English','mov_dt_rel'=>'1998-02-16','mov_rel_country'=>'UK'],\n ['mov_id'=>911,'mov_title'=>'Annie Hall','mov_year'=>1977,'mov_time'=>93,'mov_lang'=>'English','mov_dt_rel'=>'1977-04-20','mov_rel_country'=>'USA'],\n ['mov_id'=>912,'mov_title'=>'Princess Mononoke','mov_year'=>1997,'mov_time'=>134,'mov_lang'=>'Japanese','mov_dt_rel'=>'2001-10-19','mov_rel_country'=>'UK'],\n ['mov_id'=>913,'mov_title'=>'The Shawshank Redemption','mov_year'=>1994,'mov_time'=>142,'mov_lang'=>'English','mov_dt_rel'=>'1995-02-17','mov_rel_country'=>'UK'],\n ['mov_id'=>914,'mov_title'=>'American Beauty','mov_year'=>1999,'mov_time'=>122,'mov_lang'=>'English','mov_dt_rel'=>null,'mov_rel_country'=>'UK'],\n ['mov_id'=>915,'mov_title'=>'Titanic','mov_year'=>1997,'mov_time'=>194,'mov_lang'=>'English','mov_dt_rel'=>'1998-01-23','mov_rel_country'=>'UK'],\n ['mov_id'=>916,'mov_title'=>'Good Will Hunting','mov_year'=>1997,'mov_time'=>126,'mov_lang'=>'English','mov_dt_rel'=>'1998-06-03','mov_rel_country'=>'UK'],\n ['mov_id'=>917,'mov_title'=>'Deliverance','mov_year'=>1972,'mov_time'=>109,'mov_lang'=>'English','mov_dt_rel'=>'1982-10-05','mov_rel_country'=>'UK'],\n ['mov_id'=>918,'mov_title'=>'Trainspotting','mov_year'=>1996,'mov_time'=>94,'mov_lang'=>'English','mov_dt_rel'=>'1996-02-23','mov_rel_country'=>'UK'],\n ['mov_id'=>919,'mov_title'=>'The Prestige','mov_year'=>2006,'mov_time'=>130,'mov_lang'=>'English','mov_dt_rel'=>'2006-11-10','mov_rel_country'=>'UK'],\n ['mov_id'=>920,'mov_title'=>'Donnie Darko','mov_year'=>2001,'mov_time'=>113,'mov_lang'=>'English','mov_dt_rel'=>null,'mov_rel_country'=>'UK'],\n ['mov_id'=>921,'mov_title'=>'Slumdog Millionaire','mov_year'=>2008,'mov_time'=>120,'mov_lang'=>'English','mov_dt_rel'=>'2009-01-09','mov_rel_country'=>'UK'],\n ['mov_id'=>922,'mov_title'=>'Aliens','mov_year'=>1986,'mov_time'=>137,'mov_lang'=>'English','mov_dt_rel'=>'1986-08-29','mov_rel_country'=>'UK'],\n ['mov_id'=>923,'mov_title'=>'Beyond the Sea','mov_year'=>2004,'mov_time'=>118,'mov_lang'=>'English','mov_dt_rel'=>'2004-11-26','mov_rel_country'=>'UK'],\n ['mov_id'=>924,'mov_title'=>'Avatar','mov_year'=>2009,'mov_time'=>162,'mov_lang'=>'English','mov_dt_rel'=>'2009-12-17','mov_rel_country'=>'UK'],\n ['mov_id'=>926,'mov_title'=>'Seven Samurai','mov_year'=>1954,'mov_time'=>207,'mov_lang'=>'Japanese','mov_dt_rel'=>'1954-04-26','mov_rel_country'=>'JP'],\n ['mov_id'=>927,'mov_title'=>'Spirited Away','mov_year'=>2001,'mov_time'=>125,'mov_lang'=>'Japanese','mov_dt_rel'=>'2003-09-12','mov_rel_country'=>'UK'],\n ['mov_id'=>928,'mov_title'=>'Back to the Future','mov_year'=>1985,'mov_time'=>116,'mov_lang'=>'English','mov_dt_rel'=>'1985-12-04','mov_rel_country'=>'UK'],\n ['mov_id'=>925,'mov_title'=>'Braveheart','mov_year'=>1995,'mov_time'=>178,'mov_lang'=>'English','mov_dt_rel'=>'1995-09-08','mov_rel_country'=>'UK'],\n ];\n\n DB::table('movie')->insert($movies);\n\n }", "function add_top_rated_movies()\n {\n $data_added_count = 0;\n $page = 1;\n\n start:\n $url ='/movie/top_rated';\n $data = $this->curl_call($url,$page);\n\n foreach (json_decode($data)->results as $movie_data)\n {\n if (Movie::find($movie_data->id) == null)\n {\n $movie = $this->store_movie($movie_data);\n\n foreach($movie_data->genre_ids as $genre_id ){\n $this->store_movie_category($movie,$genre_id);\n }\n $data_added_count++;\n }\n }\n if ($data_added_count <json_decode($data)->total_results) {\n $page++;\n goto start;\n }\n return $data_added_count. \" movies added successfully\";\n\n }", "public function index()\n {\n $sort = request()->query('sort');\n $order = request()->query('order');\n $page = (int)request()->query('page');\n\n $per_page = 23;\n $fromDate = new Carbon('last month');\n $toDate = new Carbon('next month');\n\n // Laravel does not play nicely with orderBy() and paginate() along Cache. \n // Each page will be cached and sorting will happen inside each page instead of the whole set.\n // the number per page is fixed. so use offset and limit to do the pagination\n $query = Movie::whereBetween('release_date', [$fromDate->toDateTimeString(), $toDate->toDateTimeString()]);\n\n $data = Cache::remember(\n 'movies' . $sort . $order . $page,\n 1,\n function () use ($fromDate, $toDate, $sort, $order, $page, $query, $per_page) {\n $count = $query->count();\n $data = $query->orderBy($sort, $order)\n ->skip(($page - 1) * $per_page)\n ->take($per_page)\n ->get();\n\n $current_page = $page;\n $previous_page = $page - 1;\n $next_page = $page + 1;\n return compact('data', 'count', 'current_page', 'previous_page', 'next_page');\n }\n );\n\n return response()->json($data);\n }", "public function showMovies()\n {\n $context = $this->session->get('movie_data');\n $page = $this->getQueryParam(\n 'page'\n ); // if there is no session data or nobody tried to go to a different page, show existing data\n if (is_null($context) || !is_null($page) || !empty($page)) {\n return $this->getFilteredMovies();\n } else {\n $html = $this->render('index', array('context' => $context));\n $this->session->set('movie_data', null);\n\n return $html;\n }\n }", "public static function watchedMovies()\n {\n return self::where('user_id', Auth::id())\n ->where('watched', 1)\n ->orderBy('created_at', 'desc')\n ->limit(UserMovie::LIMIT)\n ->get();\n }", "public function moviesByYear() {\n $model = $this->model;\n $request = $this->request;\n $movies = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_year_{$this->request->year}\",\n function() use($model, $request) {\n return $model->getMoviesByYear($request->year);\n }\n );\n $this->view->addParameter(\"movies\", $movies);\n }", "public function doMovieSearchReleases()\n {\n $movieId = str_replace( array( '|', '~' ), array( '/', '.' ), $this->MovieId );\n\n $scraper = new MkvManagerScraperSubsynchro();\n\n $releases = array_map(\n function( $release ) {\n $release['id'] = str_replace( array( '/', '.' ), array( '|', '~' ), $release['id'] );\n return $release;\n },\n $scraper->releasesList( $movieId )\n );\n\n $variables = array( 'status' => 'ok', 'releases' => $releases );\n\n $result = new ezcMvcResult();\n $result->variables += $variables;\n\n return $result;\n }", "public function showScheduledMovies()\n {\n try {\n $movieRepository = $this->getRepository('movie');\n $totalMovies = $movieRepository->getRowsCount();\n\n $currentPage = $this->getQueryParam('page');\n $moviesPerPage = $this->getQueryParam('movies_per_page');\n\n $paginator = new Paginator($currentPage, $totalMovies, $moviesPerPage);\n\n $movieList = $movieRepository->loadPage($paginator->getCurrentPage(), $paginator->getResultsPerPage());\n\n $context = [\n 'paginator' => $paginator,\n 'movieList' => $movieList,\n ];\n\n return $this->render('showscheduledmovies', $context);\n } catch (Exception $ex) {\n $this->addErrorMessage('Something went wrong!');\n\n return $this->render('showscheduledmovies', $context);\n }\n }", "public static function getMovies()\n {\n // Instantiate Movie model\n $model = new Movie();\n\n // Get all movies from table\n self::$return_array['movies'] = $model::orderby('movie_title', 'asc')->get();\n\n // Return movies view with list of all movies\n return view('movies', ['return_array' => self::$return_array]);\n }", "public function showAllPaginateActionGet() : object\n {\n $title = \"Show, paginate movies\";\n\n $this->app->db->connect();\n\n //Number of hits, check input\n $hits = $this->checkForNumberOfHits();\n\n // Get max number of pages\n $sql = \"SELECT COUNT(id) AS max FROM movie;\";\n $max = $this->app->db->executeFetchAll($sql);\n $max = ceil($max[0]->max / $hits);\n\n // Get current page, check input\n $page = $this->checkForPage($hits, $max);\n $offset = $hits * ($page - 1);\n\n // Incoming matches valid value sets\n $orderBy = $this->checkOrderByValue();\n $order = $this->checkOrderValue();\n\n $sql = \"SELECT * FROM movie ORDER BY $orderBy $order LIMIT $hits OFFSET $offset;\";\n $res = $this->app->db->executeFetchAll($sql);\n\n $this->app->page->add(\"movie/show-all-paginate\", [\n \"res\" => $res,\n \"max\" => $max,\n ]);\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }", "public function getFilteredMovies()\n {\n $context = [\n 'movieList' => '',\n 'genreList' => '',\n 'conditions' => '',\n 'paginator' => '',\n ];\n\n // get the repository\n $movieRepository = $this->getRepository('movie');\n\n // get the conditions for the query, if any\n $conditions = $this->getConditions();\n\n // structure data for running the query (no pagination just yet)\n $queryConditions = Helper::prepareQueryData($conditions);\n\n try {\n // set default parameters for pagination\n $currentPage = $this->getQueryParam('page');\n $moviesPerPage = $conditions['pagination']['movies_per_page'];\n\n // but if the get parameter for pagination is not empty, use that one instead\n $moviesPerPageParam = $this->getQueryParam('movies_per_page');\n\n if (!empty($moviesPerPageParam)) {\n $moviesPerPage = $moviesPerPageParam;\n }\n\n // get results count for (potentially) filtered search\n $totalMovies = $movieRepository->getFilteredMovieCount($queryConditions);\n\n // get paginator and valid values for pagination\n $paginator = new Paginator($currentPage, $totalMovies, $moviesPerPage);\n $currentPage = $paginator->getCurrentPage();\n $moviesPerPage = $paginator->getResultsPerPage();\n\n // add pagination to query conditions\n $queryConditions['pagination'] = array('page' => $currentPage, 'per_page' => $moviesPerPage);\n\n // get results\n $movies = $movieRepository->loadFilteredMovies($queryConditions);\n\n // also get genres for displaying in the filters\n $genreRepository = $this->getRepository('genre');\n $genres = $genreRepository->loadAll();\n\n // set context for rendering\n $context = [\n 'movieList' => $movies,\n 'genreList' => $genres,\n 'conditions' => $conditions,\n 'paginator' => $paginator,\n ];\n\n // store the results for later use\n $this->session->set('movie_data', $context);\n\n // go to/show homepage\n if ($this->request->isMethod('POST')) {\n return $this->redirectRoute('homepage');\n } else {\n return $this->render('index', $context);\n }\n } catch (Exception $ex) {\n $this->addErrorMessage('Something went wrong while trying to talk to the database.');\n\n return $this->render('index', $context);\n }\n }", "public function get_movie_list($limit=NULL, $offset='', $order=array('field' => 'mrelease_date', 'sort' => 'DESC')) {\n\n $query = $this->make_query('mtitle\n , user_id\n , mtitle_identifier\n , msinopsis\n , mtags\n , mrelease_date'\n , 'srt_movie'\n , array()\n , $limit\n , $offset\n , $order);\n\n if ($query->num_rows() > 0) {\n foreach ($query->result() as $value) {\n $user_id = $value->user_id;\n $key_identifi = $value->mtitle_identifier;\n\n $query2 = $this->make_query('username, email', 'users', array('id =' => $user_id));\n\n $thepizzais = trim($value->mtags);\n $pieces = explode(\" \", $thepizzais);\n if (count($pieces) === 5) {\n $show_tags = '<i class=icon-tags></i>\n <span class=label>' . $pieces[0] . '</span>\n <span class=label>' . $pieces[1] . '</span>\n <span class=label>' . $pieces[2] . '</span>\n <span class=label>' . $pieces[3] . '</span>\n <span class=label>' . $pieces[4] . '</span>\n ';\n } elseif (count($pieces) === 4) {\n $show_tags = '<i class=icon-tags></i>\n <span class=label>' . $pieces[0] . '</span>\n <span class=label>' . $pieces[1] . '</span>\n <span class=label>' . $pieces[2] . '</span>\n <span class=label>' . $pieces[3] . '</span>\n ';\n } elseif (count($pieces) === 3) {\n $show_tags = '<i class=icon-tags></i>\n <span class=label>' . $pieces[0] . '</span>\n <span class=label>' . $pieces[1] . '</span>\n <span class=label>' . $pieces[2] . '</span>\n ';\n } elseif (count($pieces) === 2) {\n $show_tags = '<i class=icon-tags></i>\n <span class=label>' . $pieces[0] . '</span>\n <span class=label>' . $pieces[1] . '</span>\n ';\n } elseif (count($pieces) === 1) {\n $show_tags = '<i class=icon-tag></i>\n <span class=label>' . $pieces[0] . '</span>\n ';\n }\n\n foreach ($query2->result() as $key) {\n $username = $key->username;\n $profile_pic = $this->gravatar->get_gravatar($key->email);\n }\n\n $release_date = dnull_to_default($value->mrelease_date);\n if (!$release_date) {\n $release_date = strftime('%d/%b/%Y', strtotime\n ($value->mrelease_date));\n }\n $wordtime = $this->wordtime->relative_date(strtotime($value->mrelease_date));\n $this->table->add_row(\n '<blockquote class=pull-left>\n <div class=rata_kiri scroll-pane><i class=\"icon-question-sign\"></i>\n <h3><abbr title=attribute>'\n . anchor('data/detail/' . $value->mtitle_identifier, $value->mtitle . '</abbr>') . '\n ' . word_limiter($value->msinopsis, 25) . '</div>\n <small><div class=rata_kiri>' . $show_tags . ' <i class=icon-time></i>' . $wordtime .\n \"<small>\n <div class=pagination>\n <ul>\n <li><a href=#><i class=icon-heart></i><b>\" . $this->hits->get_hits_view($key_identifi) . \"</b></a></li>\n <li><a href=#><i class=icon-comment></i><b>\" . $this->hits->get_hits_lilcomment($key_identifi) . \"</b></a></li>\n <li><a href=#><i class=icon-check></i><b>\" . $this->hits->get_hits_answer($key_identifi) . \"</b></a></li>\n </ul>\n </div>\n <img src='$profile_pic' width='35' title='user picture' alt='user picture' />\" . 'Designer @<cite title=\"Source Title\">Kodepath</cite>\n </small></div></small>\n </blockquote>');\n $this->output_table .=$this->table->generate();\n $this->output_table .='<br/>';\n $this->table->clear();\n }\n return $this->output_table;\n } else {\n return FALSE;\n }\n }", "function pageController($allMovies)\n{\n\n // If $_GET['genre'] holds 'adventure', make $movies hold movies with 'adventure' as a genre.\n\n $data = [];\n // var_dump($_GET);\n\n if(isset($_GET['genre'])) {\n $genre = $_GET['genre'];\n $movies = [];\n\n foreach($allMovies as $movie) {\n if(in_array($genre, $movie['genre'])){\n $movies[] = $movie;\n //sets the search to pull all movies in the movie array set to the genre specified(by user - $genre provides doesn't hardcode the function to a specific genre)\n }\n //refer to needle/haystack concept\n }\n $data['movies'] = $movies; \n\n } elseif(isset($_GET['release'])) {\n $release = $_GET['release'];\n $movies = [];\n\n foreach($allMoveies as $movie) {\n if (in_array($release, $movie['release'])) {\n $movies[] = $movie;\n } \n }\n $data['movies'] = $movies;\n \n } else {\n $data['movies'] = $allMovies;\n }\n // set $data['movies'] to hold all movies (unless another request is made.)\n $data['movies'] = $allMovies;\n\n return $data;\n\n}", "function getMovieInformation($movie)\n{\n if($movie != \"\") {\n $OMDB_API_KEY = '99842c57';\n $omdbUrl = \"http://www.omdbapi.com?s=$movie&apikey=$OMDB_API_KEY&type=movie\";\n $movie = file_get_contents($omdbUrl);\n\n $movieDetails =json_decode($movie, true);\n\n \n if(count($movieDetails['Search'])) {\n $movieList = $movieDetails['Search'];\n // Pick the first movie\n $movie = $movieList[0];\n $movieTitle = $movie[\"Title\"];\n $movieYear = $movie[\"Year\"];\n $moviePoster = $movie[\"Poster\"];\n\n sendFulfillmentResponse($movieTitle, $movieYear, $moviePoster, true);\n } else {\n sendFulfillmentResponse(null, null, null, false);\n }\n } else {\n sendFulfillmentResponse(null, null, null, false);\n }\n \n}", "function getMovieDetails() {\n\t\t\t$url = \"http://api.brightcove.com/services/library?command=find_video_by_reference_id&media_delivery=http&reference_id=\".$this->getMovieID() .\"&video_fields=name,renditions&token=Ekg-LmhL4QrFPEdtjwJlyX2Zi4l6mgdiPnWGP0bKIyKKT_94PTKHrw..\";\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch,CURLOPT_URL,$url);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\t$jsonResponse = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t\t$result = json_decode($jsonResponse);\n\t\treturn $result->renditions;\n\t}", "public function getAllMovies()\n {\n return DB::table('movies')->get();\n }", "public function index()\r\n {\r\n // Case movie detail\r\n if (!empty($_GET['id'])) {\r\n $this->model->id['col'] = 'id_movie';\r\n $this->model->id['val'] = $_GET['id'];\r\n \r\n $detail = $this->model->read();\r\n \r\n if (!empty($detail)) {\r\n $detail[0]->id_genre = $this->model->hasOne(Genre::class, $detail[0]->id_genre)[0]->name;\r\n $detail[0]->id_publisher = $this->model->hasOne(publisher::class, $detail[0]->id_publisher)[0]->name;\r\n }\r\n\r\n $this->render('detail', ['movie' => !empty($detail) ? $detail[0] : 'id is invalid']);\r\n exit;\r\n }\r\n \r\n // Case searoching for movie\r\n if (!empty($this->params['search'])) {\r\n\r\n // time to pagination\r\n\r\n // to serach for a movie\r\n // get query \r\n // display results\r\n // if search result is one then go to detail page (by redirecting) else go to index page\r\n // $this->model->params['WHERE'] => \"title LIKE '%\" . $this->model->params['search'] . \"%'\";\r\n\r\n $this->render('index', ['movies' => $this->model->read()]);\r\n exit;\r\n } \r\n\r\n \r\n \r\n // pagination\r\n $offset = 20;\r\n $p = isset($_GET['p']) ? ($_GET['p'] - 1) * $offset : 0;\r\n $this->model->params = [\r\n 'LIMIT' => $p . ', ' . $offset\r\n ];\r\n\r\n $this->render('index', ['movies' => $this->model->read()]);\r\n }", "public function getFilmInfo($day)\n\t{\n\n\t\tswitch ($day->getName())\n\t\t{\n\t\t\tcase 'Friday':\n\t\t\t\t$day =\"01\";\n\t\t\t\tbreak;\n\t\t\tcase 'Saturday':\n\t\t\t\t$day =\"02\";\n\t\t\t\tbreak;\n\t\t\tcase 'Sunday':\n\t\t\t\t$day =\"03\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//TODO : Do something.\n\t\t\t\tbreak;\n\t\t}\n\n\n\t\t$url =$this->cinemaLink;\n\t\t$data = $this->curl->curlGetReq($url);\n\t\t//Get all selects of movie exc. disabled w text instruction.\n\t\t$query = \"//select[@id ='movie']/option[not(text() = '--- Välj film ---')]\";\n\t\t$select = $this->curl->getDOMData($data,$query);\t\n\t\t\n\t\t//\n\n\t\t//Get the number of movies\n\t\t$numberOfMovies = $select->length;\n\t\t\n\t\t//add date query to the URL\n\t\t$url .=\"check?day=\".$day;\n\t\t/* Iterate through all movies, add them to url, get\n\t\t* and extract times \n\t\t*/\n\t\t$movieTimeRepository = new availableTimeRepository();\n\n\t\tfor($i =1; $i < $numberOfMovies+1; $i++)\n\t\t{\n\t\t\t//get the name of the movie\n\t\t\t$movieName = $select[$i-1]->nodeValue;\n\t\t\t//create a new movieTime object\n\t\t\t$movieTime = new availableTime($movieName);\n\t\t\t//get the times and availability for each movie\n\t\t\t//example of URL with movieQuery: http://localhost:8080/cinema/check?day=02&movie=01\n\t\t\t$movieQuery= ($i <10)? \"&movie=0\".$i: \"&movie=\".$i;\n\t\t\t$data = $this->curl->curlGetReq($url.$movieQuery);\n\t\t\t//decode it and iterate the data\n\t\t\t$movieData =json_decode($data,true);\n\t\t\t\n\t\t\tforeach ($movieData as $movieInfo)\n\t\t\t{\t\n\t\t\t\t//if the status ==1 ==true,it's available\n\t\t\t\tif($movieInfo['status'])\n\t\t\t\t{\t//save the available time to corresponding movie obj.\n\t\t\t\t\t$movieTime->addTime($movieInfo['time']);\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$movieTimeRepository->add($movieTime);\n\n\n\t\t}\t\t\n\t\n\t\treturn $movieTimeRepository;\n\t\t\n\t}", "public function getAllMovies()\n {\n $query = $this->db->get(\"Movies\");\n return $query->result();\n }", "function get_movies(){\n\t$db= $GLOBALS['db'];\n\t$results= $db->query(\"SELECT * FROM movies ORDER BY title \" );\n\treturn $db->resToArray($results);\n}", "public function get_movies()\n {\n return $this->db->order_by('title')\n ->get('tbl_movies')\n ->result_array();\n }", "public function listmovies() {\n $movies = Movie::all();\n require_once('view/admin/movie/listmovies.php');\n }", "public function moviesByDirectorCount() {\n $model = $this->model;\n $request = $this->request;\n $movies = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_director_count_{$this->request->count}\",\n function() use($model, $request) {\n return $model->getMoviesByDirectorCount($request->count);\n }\n );\n $this->view->addParameter(\"directors\", $movies);\n }", "public function Allmovies()\n {\n // $movie = Movies::all();\n\n // return response()->json(\n // [\n // 'status' => 'success',\n // 'movie' => $movie->toArray()\n // ], 200);\n $movie = Movies::select('id', 'name', 'genre')\n ->orderBy('id', 'desc')\n ->get();\n return $movie;\n }", "function movieinit() { \n\t$make = make_movies();\n\t//if ( !$make ) \n\t\t//die ( \"Error! Could not fetch movie list from media server!\" );\n\t\n\t$new \t\t\t= get_new();\n\t$num_new \t\t= count( $new );\n\t\n\t$no_imdbid\t\t= get_no_imdbid();\n\t$num_no_imdbid\t= count( $no_imdbid );\n\t\n\t$no_details\t\t= get_no_details();\n\t$num_no_details\t= count( $no_details );\n\t\n\tif ( $num_new > 0 ) {\n\t\t$html .= \"<p>There are $num_new new movies. Click \".\n\t\t\t\t \"<a href=\\\"{$_SERVER['PHP_SELF']}?step=2\\\">here</a>\".\n\t\t\t\t \" to add them to the database.</p>\\n\";\n\t} else {\n\t\t$html .= \"<p>There are no new movies.</p>\\n\";\t\n\t}\n\t\n\t\n\tif ( $num_no_imdbid > 0 ) {\n\t\t$html .= \"<p>There are $num_no_imdbid movies without IMDB IDs. Click \".\n\t\t\t\t \"<a href=\\\"{$_SERVER['PHP_SELF']}?step=3\\\">here</a>\".\n\t\t\t\t \" to get IMDB IDs for these titles.<br />\\n\".\n\t\t\t\t \"<strong>Note:</strong> This can take several minutes depending on the number \".\n\t\t\t\t \" of movies to lookup.</p>\";\n\t} else {\n\t\t$html .= \"<p>There are no movies without IMDB IDs.</p>\\n\";\t\n\t}\n\t\n\t\n\tif ( $num_no_details > 0 ) {\n\t\t$html .= \"<p>There are $num_no_details movies with IMDB IDs but without details downloaded. Click \".\n\t\t\t\t \"<a href=\\\"{$_SERVER['PHP_SELF']}?step=5\\\">here</a>\".\n\t\t\t\t \" to get details for these movies.</p>\\n\";\n\t} else {\n\t\t$html .= \"<p>There are no movies with IMDB IDs but without details downloaded.</p>\\n\";\t\n\t}\n\t\n\tif ( ( $num_new + $num_no_imdbid + $num_no_details ) == 0 )\n\t\t$html .= \"<p><strong>Go home! There's nothing to do here!</strong></p>\\n\";\n\t\n\treturn $html;\n\n}", "public function movies(Request $request)\n {\n $query = $request->has('query') ? $request->get('query') : '';\n $page = $request->has('page') ? $request->get('page') : 1;\n\n /** @var $item */\n $item = $this->api->searchMovies($query, ['page' => $page]);\n\n if (!$item) {\n abort(404, \"The genre $query is not found.\");\n }\n\n // returns information of a genre\n return response($item);\n }", "public function index() {\n return response()->json( movies::all() );\n }", "public function movieSelectActionGet()\n {\n $title = \"Select a movie\";\n\n //Destroy previous sessions\n $this->app->session->destroy();\n\n // Initiate the session for the game.\n $this->app->session->start();\n\n $this->app->db->connect();\n\n $sql = \"SELECT id, title FROM movie;\";\n $res = $this->app->db->executeFetchAll($sql);\n\n $this->app->page->add(\"movie/movie-select\", [\n \"res\" => $res,\n ]);\n\n if ($this->app->request->getGet(\"showAll\")) {\n $sql = \"SELECT * FROM movie;\";\n $res = $this->app->db->executeFetchAll($sql);\n\n $this->app->page->add(\"movie/show-all\", [\n \"res\" => $res,\n ]);\n }\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }", "public function index()\n {\n return response()->json(\n Movie::where('user_id', Auth::guard('token')->id())->get()\n );\n }", "public function vodVideosFetch(){\n\t\t\t\t$page \t\t\t= \t0;\t// The current page\n\t\t\t\t$sortname \t\t= \t'V.created_date';\t // Sort column\n\t\t\t\t$sortorder\t \t= \t'desc';\t // Sort order\n\t\t\t\t$qtype \t\t\t= \t'';\t // Search column\n\t\t\t\t$query \t\t\t= \t'';\t // Search string\n\t\t\t\t// Get posted data\n\t\t\t\tif (isset($_POST['page'])) \n\t\t\t\t\t{\n\t\t\t\t\t\tif($_POST['page']==1 && isset($_SESSION['PAGE'][$this->getPageName()][$this->getAction()]) && empty($_POST['query']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($_SESSION['PAGE'][$this->getPageName()][$this->getAction()] == 2 && $this->previousAction ==\t$this->currentAction)\t$page\t=\t1;\n\t\t\t\t\t\t\t\telse $page\t\t=\t$_SESSION['PAGE'][$this->getPageName()][$this->getAction()];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$page \t\t\t\t= \tmysql_real_escape_string($_POST['page']);\n\t\t\t\t\t\t\t\t$_SESSION['PAGE'][$this->getPageName()][$this->getAction()]\t=\t$page;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\tif (isset($_POST['sortname'])) \n\t\t\t\t\t{\n\t\t\t\t\t\t$sortname \t= \tmysql_real_escape_string($_POST['sortname']);\n\t\t\t\t\t}\n\t\t\t\tif (isset($_POST['sortorder'])) \n\t\t\t\t\t{\t\t\n\t\t\t\t\t\t$sortorder \t= \tmysql_real_escape_string($_POST['sortorder']);\t\t\n\t\t\t\t\t}\n\t\t\t\tif (isset($_POST['qtype'])) \n\t\t\t\t\t{\n\t\t\t\t\t\t$qtype \t\t= \ttrim(mysql_real_escape_string($_POST['qtype']));\n\t\t\t\t\t}\n\t\t\t\tif(isset($_SESSION['QUERY'][$this->getPageName()][$this->getAction()]))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(trim(mysql_real_escape_string($_POST['query'])) == '' && $this->previousAction ==\t$this->currentAction)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// User is assiging query keyword as empty \n\t\t\t\t\t\t\t\t$query\t=\t'';\n\t\t\t\t\t\t\t\t$_SESSION['QUERY'][$this->getPageName()][$this->getAction()]\t=\t$query;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//User is Refreshing page or coming back to viewed page \n\t\t\t\t\t\t\t\t$query\t=\t$_SESSION['QUERY'][$this->getPageName()][$this->getAction()];\n\t\t\t\t\t\t\t\t$qtype\t=\t$_SESSION['QTYPE'][$this->getPageName()][$this->getAction()];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\tif (!empty($_POST['query'])) \n\t\t\t\t\t{\n\t\t\t\t\t\t$query \t\t= \ttrim(mysql_real_escape_string($_POST['query']));\n\t\t\t\t\t\t$_SESSION['QUERY'][$this->getPageName()][$this->getAction()]\t=\t$query;\n\t\t\t\t\t\t$_SESSION['QTYPE'][$this->getPageName()][$this->getAction()]\t=\ttrim(mysql_real_escape_string($_POST['qtype']));\n\t\t\t\t\t}\n\t\t\t\tif (isset($_POST['rp'])) \n\t\t\t\t\t{\n\t\t\t\t\t\t$rp \t\t= \tmysql_real_escape_string($_POST['rp']);\n\t\t\t\t\t}\n\t\t\t\tif(empty($rp))\n\t\t\t\t\t{\n\t\t\t\t\t\t$rp\t\t\t=\tLMT_SITE_ADMIN_PAGE_LIMIT;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t// Setup sort and search SQL using posted data\n\t\t\t\t$sortSql\t\t\t\t = \t\" order by $sortname $sortorder \";\n\t\t\t\t$searchSql \t\t\t\t = \t($qtype != '' && $query != '') ? \" AND $qtype LIKE '$query%'\" : '';\n\t\t\t\t// Get total count of records\n\t\t\t\t\n\t\t\t\t$instructor\t\t=\t$_SESSION['txtInst'];\n\t\t\t\t$course\t\t\t=\t$_SESSION['txtCourse'];\n\t\t\t\t$instrument_id\t=\t$_SESSION['instrument_id'];\n\t\t\t\t\n\t\t\t\t$sql\t\t\t= \t\"SELECT count(*) FROM tblcourse_vod AS V \n\t\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN tblcourses AS C ON V.course_id=C.course_id \n\t\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN tblusers AS U1 ON C.instructor_id=U1.user_id\n\t\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN tblinstrument_master AS I ON I.instrument_id=C.instrument_id\n\t\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN tblusers AS U2 ON V.created_by=U2.user_id\n\t\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN tblcurrency_type AS CT ON CT.currency_id=V.currency_id\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE C.course_status_id=4 AND C.is_active_vod=1 $searchSql\";\n\t\t\t\t\t\t\t\t\t\t\t\tif($_SESSION['txtInst'])\n\t\t\t\t\t\t\t\t\t\t\t\t$sql\t.=\" AND concat(U.first_name,' ',U.last_name) LIKE '%$instructor%' \";\n\t\t\t\t\t\t\t\t\t\t\t\tif($_SESSION['txtCourse'])\n\t\t\t\t\t\t\t\t\t\t\t\t$sql\t.=\" AND C.title LIKE '%$course%'\";\n\t\t\t\t\t\t\t\t\t\t\t\tif($_SESSION['instrument_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t$sql\t.=\" AND C.instrument_id=$instrument_id \";\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t//C.title='$course' AND concat(U.first_name,' ',U.last_name)='$instructor',C.instrument_id=$instrument_id,\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t$result \t\t\t\t= \t$this->db_query($sql,0);\n\t\t\t\t$row \t\t\t\t\t= \tmysql_fetch_array($result);\n\t\t\t\t$total\t\t\t\t\t= \t$row[0];\n\t\t\t\t// Setup paging SQL\n\t\t\t\t$pageStart \t\t\t\t= \t($page-1)*$rp;\n\t\t\t\tif($pageStart<0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$pageStart\t\t=\t0;\n\t\t\t\t\t}\n\t\t\t\t$limitSql \t\t\t\t= \t\"limit $pageStart, $rp\";\n\t\t\t\t// Return JSON data\n\t\t\t\t$data \t\t\t\t\t= \tarray();\n\t\t\t\t$data['page'] \t\t\t= \t$page;\n\t\t\t\t$data['qtype'] \t\t\t= \t$qtype;\n\t\t\t\t$data['query'] \t\t\t= \t$query;\n\t\t\t\t$data['total'] \t\t\t= \t$total;\n\t\t\t\t$data['rows'] \t\t\t= \tarray();\n\t\t\t\t$sql \t\t\t\t\t= \t\"SELECT C.course_id,C.course_code,C.title,I.name,VL.video_link,CONCAT(U1.first_name,' ',U1.last_name) AS instructor_name,\n\t\t\t\t\t\t\t\t\t\t\t\tDATE_FORMAT(V.created_date,'\".$_SESSION[\"DATE_FORMAT\"][\"M_DATE\"].\" , \".$_SESSION[\"DATE_FORMAT\"][\"M_TIME\"].\"') AS created_date,\n\t\t\t\t\t\t\t\t\t\t\t\tV.sale_price,CT.symbol,CONCAT(U2.first_name,' ',U2.last_name) AS created_by \n\t\t\t\t\t\t\t\t\t\t\t\tFROM tblcourse_vod AS V \n\t\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN tblcourses AS C ON V.course_id=C.course_id \n\t\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN tblcourse_videos AS VL ON VL.course_id=V.course_id AND VL.video_owner_id=C.instructor_id\n\t\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN tblusers AS U1 ON C.instructor_id=U1.user_id\n\t\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN tblinstrument_master AS I ON I.instrument_id=C.instrument_id\n\t\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN tblusers AS U2 ON V.created_by=U2.user_id\n\t\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN tblcurrency_type AS CT ON CT.currency_id=V.currency_id \n\t\t\t\t\t\t\t\t\t\t\t\tWHERE C.course_status_id=4 AND C.is_active_vod=1 \";\n\t\t\t\t\t\t\t\t\t\t\t\tif($_SESSION['txtInst'])\n\t\t\t\t\t\t\t\t\t\t\t\t$sql\t.=\" AND concat(U.first_name,' ',U.last_name) LIKE '%$instructor%' \";\n\t\t\t\t\t\t\t\t\t\t\t\tif($_SESSION['txtCourse'])\n\t\t\t\t\t\t\t\t\t\t\t\t$sql\t.=\" AND C.title LIKE '%$course%'\";\n\t\t\t\t\t\t\t\t\t\t\t\tif($_SESSION['instrument_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t$sql\t.=\" AND C.instrument_id=$instrument_id \";\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$sql\t.= \"$searchSql\t$sortSql $limitSql\";\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$query=\"SELECT U.user_code FROM tbluser_login AS L LEFT JOIN tblusers AS U ON L.login_id=U.login_id WHERE L.login_id=\".$_SESSION['log_id'];\n\t\t\t\t$admin =end($this->getdbcontents_sql($query,0));\n\t\t\t\t$results \t\t\t\t= \t$this->db_query($sql,0);\n\t\t\t\t$i\t\t\t=\t$pageStart;\n\t\t\t\twhile ($row = mysql_fetch_assoc($results)) \n\t\t\t\t\t{\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t$row['play']='<a href=\"javascript:void(0);\" onclick=\"viewVideos(\\''.base64_encode(serialize($admin[\"user_code\"])).'&'.base64_encode(serialize($row[\"course_code\"])).'&'.$row[\"video_link\"].'&Recorded\\')\" class=\"vdo_link\"><img src=\"../images/right_arrow.png\" border=\"0\" title=\"Click here to play\" ></a>';\n\t\t\t\t\t\t$data['rows'][] = array\n\t\t\t\t\t(\n\t\t\t\t'id' => $row['id'],\n\t\t\t\t'cell' => array($i, $row['title'], $row['name'], $row['instructor_name'], $row['created_date'], $row['symbol'].$row['sale_price'],$row['play'],$row['created_by'])\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tob_clean();\n\t\t\t\t$r =json_encode($data);\n\t\t\t\t\n\t\t\t\techo $r;\n\t\t\t\texit;\n\t\t}", "function nt_fn_fetch_movie_info()\r\n{\r\n\tif(!current_user_can('manage_options')){\r\n\t\twp_die( __( 'You do not have sufficient permissions to access this page.' ) );\r\n\t}//end if user is allowed.\r\n\t\r\n\t\r\n\tglobal $rottenTomatoes;\r\n\tif(isset($_POST['movie_id'])) {\r\n\t\t\t\r\n\t// Movie ID Loop \t\t\r\n foreach($_POST['movie_id'] as $mId) {\r\n\t\t\r\n\t\t$movie_id = $mId;\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$result = $rottenTomatoes->getMovieInfo($movie_id);\r\n\t\t\t$search_results = json_decode(json_encode($result),false);\r\n\t\t\t\r\n\t\t\tif (!isset($search_results->title))\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Create post object\r\n\t\t\t$movie_post = array(\r\n\t\t\t\t'post_title' => $search_results->title,\r\n\t\t\t\t'post_content' => $search_results->synopsis,\r\n\t\t\t\t'post_status' => 'publish',\r\n\t\t\t\t'post_author' => 1,\r\n\t\t\t\t'post_category' => array(),\r\n\t\t\t\t'post_type' \t => 'movies'\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$exist_data = get_page_by_title($search_results->title, 'OBJECT', 'movies');\r\n\t\t\tif ($exist_data)\r\n\t\t\t{\r\n\t\t\t\t$movie_post['ID'] = $exist_data->ID;\r\n\t\t\t\twp_update_post($movie_post);\r\n\t\t\t\t$post_id = $exist_data->ID;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Insert the post into the database\r\n\t\t\t\t$post_id = wp_insert_post($movie_post, null );\r\n\t\t\t}\r\n\t\t\t// Upload poster\r\n\t\t\t$image_url = str_replace(\"_tmb\",\"_ori\",$search_results->posters->original);\r\n\t\t\t$upload_dir = wp_upload_dir();\r\n\t\t\t$image_data = file_get_contents($image_url);\r\n\t\t\t$filename = basename($image_url);\r\n\t\t\tif(wp_mkdir_p($upload_dir['path']))\r\n\t\t\t{\r\n\t\t\t\t$file = $upload_dir['path'] . '/' . $filename;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$file = $upload_dir['basedir'] . '/' . $filename;\r\n\t\t\t}\r\n\t\t\tfile_put_contents($file, $image_data);\r\n\t\t\t\r\n\t\t\t$wp_filetype = wp_check_filetype($filename);\r\n\t\t\t\r\n\t\t\t$attachment = array(\r\n\t\t\t\t'post_mime_type' => $wp_filetype['type'],\r\n\t\t\t\t'post_title' => sanitize_file_name($filename),\r\n\t\t\t\t'post_content' => '',\r\n\t\t\t\t'post_status' => 'inherit'\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$attach_id = wp_insert_attachment( $attachment, $file, $post_id );\r\n\t\t\t\r\n\t\t\trequire_once(ABSPATH . 'wp-admin/includes/image.php');\r\n\t\t\t$attach_data = wp_generate_attachment_metadata( $attach_id, $file );\r\n\t\t\t\r\n\t\t\twp_update_attachment_metadata( $attach_id, $attach_data );\r\n\t\t\t\r\n\t\t\tset_post_thumbnail( $post_id, $attach_id );\r\n\t\t\t\r\n\t\t\t// Create genres\r\n\t\t\t$terms = array();\r\n\t\t\tif(isset($search_results->genres)){\r\n\t\t\t\tforeach($search_results->genres as $term):\r\n\t\t\t\t\t$t_exists = term_exists( $term, 'genres' );\r\n\t\t\t\t\tif($t_exists==\"\"):\r\n\t\t\t\t\t\t$t = wp_insert_term( $term, 'genres' );\r\n\t\t\t\t\t\t$terms[] = $t['term_id'];\r\n\t\t\t\t\telse:\r\n\t\t\t\t\t\t$terms[] = $t_exists['term_id'];\r\n\t\t\t\t\tendif;\r\n\t\t\t\tendforeach;\r\n\t\t\t\t\r\n\t\t\t\t//add genres\r\n\t\t\t\twp_set_post_terms( $post_id, $terms, 'genres' );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Create cast\r\n\t\t\t$castterms = array();\r\n\t\t\tif(isset($search_results->genres)){\r\n\t\t\t\tforeach($search_results->abridged_cast as $castterm):\r\n\t\t\t\t\t$t_exists = term_exists( $castterm->name, 'cast' );\r\n\t\t\t\t\tif($t_exists==\"\"):\r\n\t\t\t\t\t\t$t = wp_insert_term( $castterm->name, 'cast');\r\n\t\t\t\t\t\t$castterms[] = $t['term_id'];\r\n\t\t\t\t\telse:\r\n\t\t\t\t\t\t$castterms[] = $t_exists['term_id'];\r\n\t\t\t\t\tendif;\r\n\t\t\t\tendforeach;\r\n\t\t\t\t\r\n\t\t\t\t//add cast\r\n\t\t\t\twp_set_post_terms( $post_id, $castterms, 'cast' );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$director = array();\r\n\t\t\tforeach(json_decode(json_encode($search_results->abridged_directors), true) as $direct)\r\n\t\t\t{\r\n\t\t\t\t$director[] = $direct['name'];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tupdate_post_meta( $post_id, 'directed_by', implode(\",\",$director));\r\n\t\t\t//add release data\r\n\t\t\tupdate_post_meta( $post_id, 'year', $search_results->year);\r\n\t\t\tupdate_post_meta( $post_id, 'release_date', $search_results->release_dates->theater);\r\n\t\t\tupdate_post_meta( $post_id, 'on_dvd', $search_results->release_dates->dvd);\r\n\t\t\tupdate_post_meta( $post_id, 'critics_rating', $search_results->ratings->critics_rating);\r\n\t\t\tupdate_post_meta( $post_id, 'critics_score', $search_results->ratings->critics_score);\r\n\t\t\tupdate_post_meta( $post_id, 'audience_rating', $search_results->ratings->audience_rating);\r\n\t\t\tupdate_post_meta( $post_id, 'audience_score', $search_results->ratings->audience_score);\r\n\t\t\tupdate_post_meta( $post_id, 'studio', $search_results->studio);\r\n\t\t\tupdate_post_meta( $post_id, 'url', $search_results->links->alternate);\r\n\t\t\t$msg = \"Updated Successfully\";\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$msg = \"Update Failed\"; \r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t} // End mID Foreach Loop\r\n\t\r\n\t} // End POST If Condition\r\n if (isset( $msg) && !empty($msg)):\r\n \techo '<div class=\"updated fade\"><p>' . __($msg) . '</p></div>';\t\t\t\r\n endif;\r\n?>\r\n\r\n<div class=\"wrap\">\r\n <h2>Get Movie Info</h2>\r\n <form method=\"POST\" id=\"frmMovies\" name=\"frmMovies\" action=\"\" enctype=\"multipart/form-data\">\r\n <div class=\"movie_container\" style=\"margin-top:10px;\">\r\n <div class=\"tablenav top\">\r\n <div class=\"alignleft actions bulkactions\">\r\n <label>Movie ID:</label>\r\n <input type=\"text\" name=\"get_movie_id\" id=\"get_movie_id\" placeholder=\"Enter Movie Id\" />\r\n <label for=\"imdb_id\">\r\n <input type=\"checkbox\" name=\"imdb_id\" id=\"imdb_id\" value=\"yes\" />\r\n <span>IMDB ID</span> </label>\r\n <input type=\"submit\" disabled=\"disabled\" style=\"display:none;\" />\r\n <input type=\"button\" name=\"get_movies\" id=\"get_movies\" class=\"button\" value=\"Apply\" />\r\n </div>\r\n <div class=\"alignright actions bulkactions\">\r\n <input type=\"button\" value=\"Import\" class=\"button-primary action\" id=\"import\" name=\"import\" />\r\n </div>\r\n </div>\r\n <table id=\"tbl_movie_list\" class=\"wp-list-table widefat fixed pages\">\r\n <thead>\r\n <tr>\r\n <th style=\"\" class=\"manage-column column-cb check-column\" id=\"cb\" scope=\"col\"><label for=\"cb-select-all-1\" class=\"screen-reader-text\">Select All</label>\r\n <input type=\"checkbox\" id=\"cb-select-all-1\"></th>\r\n <th scope=\"col\">Thumbnail</th>\r\n <th scope=\"col\">Title</th>\r\n <th scope=\"col\">Year</th>\r\n <th scope=\"col\">In Theater</th>\r\n <th scope=\"col\">Ratings</th>\r\n </tr>\r\n </thead>\r\n <tbody id=\"the-list\">\r\n </tbody>\r\n </table>\r\n </div>\r\n <div class=\"loader\" style=\"margin:10% auto;display:none;\" align=\"center\"><img src=\"<?php echo plugins_url( 'images/loading.gif', dirname(__FILE__) ) ?>\" /></div>\r\n </form>\r\n</div>\r\n<?php global $RTApiKey;?>\r\n<script type=\"text/javascript\">\r\n// construct the uri with our apikey\r\njQuery(document).ready(function() {\t\r\n\tjQuery(\"#get_movie_id\").focus();\r\n\t\r\n\tjQuery(\"#get_movie_id\").keyup(function(e) {\r\n jQuery(\"#get_movie_id\").css(\"border-color\",\"\"); \r\n });\r\n\t\r\n\tvar apikey = \"<?php echo $RTApiKey;?>\";\r\n\tvar baseUrl = \"http://api.rottentomatoes.com/api/public/v1.0/\";\t\r\n\t// Get Movies\r\n\tjQuery(\"#get_movies\").click(function(e) {\t\r\n\t\tjQuery(\"#tbl_movie_list #the-list\").html('');\r\n\t\tvar mSearch = jQuery(\"#get_movie_id\").val();\r\n\t\tif(mSearch!='')\r\n\t\t{\r\n\t\t\tsuburl = 'movies/'+mSearch+'.json?';\r\n\t\t\tif(jQuery(\"#imdb_id:checked\").length==1)\r\n\t\t\t{\r\n\t\t\t\tsuburl = 'movie_alias.json?id='+mSearch+'&type=imdb&';\r\n\t\t\t}\r\n\t\t\tvar moviesUrl = baseUrl+suburl+'page_limit=50&apikey=' + apikey;\r\n\t\t\t// send off the query\r\n\t\t\tjQuery.jsonp({\r\n\t\t\t\turl: moviesUrl,\r\n\t\t\t\tcallbackParameter: \"callback\",\r\n\t\t\t\tsuccess: searchCallback,\r\n\t\t\t\terror:function(){\r\n\t\t\t\t\tjQuery(\"#tbl_movie_list #the-list\").html('<tr class=\"no-items\"><td colspan=\"6\" class=\"colspanchange\">Account Inactive.</td></tr>');\r\n\t\t\t\t},\r\n\t\t\t\tbeforeSend: function( xhr ) {\r\n\t\t\t\t\tjQuery(\".loader\").show();\r\n\t\t\t\t},\r\n\t\t\t\tcomplete: function (XMLHttpRequest, textStatus) {\r\n\t\t\t\t\tjQuery(\".loader\").hide(); //this was fired\r\n\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\tjQuery(\"#get_movie_id\").css(\"border-color\",\"red\").focus();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t});\r\n\t\r\n\t// Import Movies\r\n\tjQuery(\"#import\").click(function(e) {\t\t\t\r\n\t\tjQuery(\"#frmMovies\").submit();\r\n\t\treturn true;\r\n\t});\r\n\t\r\n\tjQuery(document).on(\"click\",\".import\",function(e) {\r\n\t\tjQuery(\"input[type=checkbox]:input[value=\"+jQuery(this).attr(\"rel\")+\"]\").attr(\"checked\",\"true\");\r\n\t\tjQuery(\"#import\").trigger(\"click\");\r\n });\r\n});\r\n\t \r\n// Get Movies callback for when we get back the results\r\nfunction searchCallback(data) {\r\n\tif(data.error)\r\n\t{\r\n\t\tjQuery(\"#tbl_movie_list #the-list\").html('<tr class=\"no-items\"><td colspan=\"6\" class=\"colspanchange\">'+data.error+'</td></tr>');\r\n\t}\r\n\telse if(data.link_template)\t\r\n\t{\r\n\t\tjQuery(\"#tbl_movie_list #the-list\").html('<tr class=\"no-items\"><td colspan=\"6\" class=\"colspanchange\">Could not find a movie with the specified id</td></tr>');\r\n\t}\r\n\telse\r\n\t{\r\n\t\tvar tbldata = \"\";\r\n\t\tvar movie = data;\r\n\t\t//jQuery(\".displaying-num\").html(data.length+\" item(s)\");\r\n\t\tvar cls =\"alternate\";\r\n\t\ttbldata += '<tr class=\"'+cls+'\"><th class=\"check-column\" scope=\"row\"><input type=\"checkbox\" value=\"'+movie.id+'\" name=\"movie_id[]\" id=\"cb-select-2\"></th><td><img src=\"' + movie.posters.thumbnail + '\" /></td><td>'+movie.title+'<div class=\"row-actions\"> | <span class=\"import\"><a title=\"Import this Movie\" href=\"javascript:void(0);\" class=\"import\" rel=\"'+movie.id+'\">Import</a></span></div></td><td>'+movie.year+'</td><td>'+movie.release_dates.theater+'</td><td>'+movie.ratings.critics_score+'%</td></tr>';\r\n\t}\r\n\tjQuery(\"#tbl_movie_list #the-list\").html(tbldata);\r\n}\r\n</script>\r\n<?php\r\n}", "public function searchYearActionGet()\n {\n $title = \"Search by year\";\n\n $this->app->db->connect();\n\n $fromYear = $this->app->request->getGet(\"fromYear\");\n $toYear = $this->app->request->getGet(\"toYear\");\n\n if ($fromYear && $toYear) {\n $sql = \"SELECT * FROM movie WHERE year >= ? AND year <= ?;\";\n $res = $this->app->db->executeFetchAll($sql, [$fromYear, $toYear]);\n } elseif ($fromYear) {\n $sql = \"SELECT * FROM movie WHERE year >= ?;\";\n $res = $this->app->db->executeFetchAll($sql, [$fromYear]);\n } elseif ($toYear) {\n $sql = \"SELECT * FROM movie WHERE year <= ?;\";\n $res = $this->app->db->executeFetchAll($sql, [$toYear]);\n }\n\n $this->app->page->add(\"movie/search-year\", [\n \"fromYear\" => $fromYear,\n \"toYear\" => $toYear,\n ]);\n\n if (isset($res)) {\n $this->app->page->add(\"movie/show-all\", [\n \"res\" => $res,\n ]);\n }\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }", "public function GetAll()\n {\n try {\n $movieList = array();\n $query = \"SELECT * FROM \" . $this->tableName . \";\";\n $this->connection = Connection::GetInstance();\n $resultSet = $this->connection->Execute($query);\n\n foreach ($resultSet as $row) {\n $movie = new Movie();\n $movie->setId($row[\"id\"]);\n $movie->setName($row[\"movieName\"]);\n $movie->setSummary($row[\"summary\"]);\n $movie->setLanguage($row[\"movieLanguage\"]);\n $movie->setImage($row[\"dir_image\"]);\n $movie->setReleaseDate($row[\"releaseDate\"]);\n //$movie->setGenres($this->GetGenres($row[\"id_movie_api\"]));\n $movie->setRuntime($row[\"runtime\"]);\n array_push($movieList, $movie);\n }\n return $movieList;\n\n } catch (Exception $ex) {\n throw $ex;\n }\n }", "function getRecentVideo()\n\t{\n\t\t$limit = $this->input->post('limit');\n\t\t$page = $this->input->post('page');\n\t\t$response = $this->mapi->getRecentVideo($limit,$page);\n\n\t\techo json_encode($response);\n\t}", "public function index()\n {\n $movies = Movie::paginate(15);\n return MovieResource::collection($movies);\n }", "public function movie_list() {\n $data[\"movies\"] = $this->Movie->findAll();\n\n // Capa de la Vista\n $view['body'] = $this->load->view(\"core/movies/list\", $data, TRUE);\n $view['title'] = \"Listado de películas\";\n $this->parser->parse('core/templates/body', $view);\n }", "function getMovieDB($webtmdb, $mid){\n $url = $webtmdb;\n\n if(!$curld = curl_init()){\n exit;\n }\n curl_setopt($curld, CURLOPT_URL, $url); //loads information from url, in our case a json \n curl_setopt($curld, CURLOPT_RETURNTRANSFER, true); //ends transfer \n $prepros = curl_exec($curld); //executes setopt we set previosly \n curl_close($curld); //close connection \n $json = json_decode($prepros, true); // decode json file we got from API\n //\n /*\n make a table \n original_title - movie name \n https://www.themoviedb.org/t/p/w300_and_h450_bestv2/\".$json['poster_path'] - poster image on a page \n */\n //\n $output = \"<style>th,td{padding: 15px;text-align: left; border-bottom: 1px solid #ddd;}</style><tr><th><a href='tmdb.php/?movieId=\".$mid.\"'>\".$json['original_title'].\"</a></th></tr><tr><img height='200' src='https://www.themoviedb.org/t/p/w300_and_h450_bestv2/\".$json['poster_path'].\"'></tr>\";\n return $output;\n}", "public function indexAction()\n {\n $title = \"Movies\";\n $this->app->db->connect();\n $data = [\n \"res\" => getAll($this->app, \"movie\")\n ];\n\n $this->app->page->add(\"movie/index\", $data);\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n return $this->app->response->redirect(\"movie\");\n }", "public function popularVideos(){\n $search_url = \"videos?part=snippet&order=relevance&chart=mostPopular&videoDefinition=high&videoEmbeddable=true&key={$this->api_key}\";\n $client = new Client($this->base_url);\n $request = $client->get($search_url);\n $response = $request->send();\n $videos = $response->json();\n $video_items = $videos[\"items\"];\n\n $formatted_response = array();\n foreach($video_items as $video_item){\n $video = new Video;\n $video->url = \"https://www.youtube.com/watch?v=\".$video_item[\"id\"];\n $video->name = $video_item[\"snippet\"][\"title\"];\n $video->picture= $video_item[\"snippet\"][\"thumbnails\"][\"high\"][\"url\"];\n $video->type= \"youtube\";\n $video->id = $video_item[\"id\"];\n array_push($formatted_response, $video->toArray());\n }\n return Response::json($formatted_response,200);\n }", "public function testMovieStatus()\n {\n // Find from back date so that results are returned\n $response = $this->get('/api/movies?genre=Animation&showTime=2018-02-01T00:09:00');\n $response->assertStatus(200);\n }", "public function obtainVideos()\n {\n return $this->performRequest('GET','/videos');\n }", "function retrieve_details() {\n\n// 11/25 - this shit needs work...\n \n\t/**\n\t * step 1\n\t * \n\t * retrieve all movies with an imdb_id but no details\n\t */\n\tini_set(\"max_execution_time\", \"300\");\n\t$sql_all = \"SELECT * FROM mr_movie_details WHERE imdb_id > 0 AND date_updated <=> NULL\";\n\t$res_all = mysql_query( $sql_all );\n\n\t// End the script if there are no new movies\n\tif ( mysql_num_rows( $res_all ) > 0 ) {\n\n\t\t/**\n\t\t * step 2\n\t\t *\n\t\t * retrieve all imdb_info and update db\n\t\t */\n\t\n\t\twhile ( $r = mysql_fetch_array( $res_all ) ) {\n\t\n\t\t\t$imdbid = $r['imdb_id'];\n\t\t\t$movie_id = $r['movie_id'];\n\t\t\t$filename = $r['filename'];\n\t\t\n\t\t\t$movie = new imdb( $imdbid );\n\t\t\t$movie->setid( $imdbid );\n\t\t\t\n\t\t\t$title = $movie->title();\n\t\t\t$year = $movie->year();\n\t\t\t$runtime = $movie->runtime();\n\t\t\t$genre = $movie->genre();\n//\t\t\t$genreID \t= get_genre_id( $genre );\n\t\t\t$all_genres = $movie->genres();\n\t\t\t$mpaar \t\t= $movie->mpaa ();\n\t\t\t$tagline\t= $movie->tagline();\n\t\t\t$directors\t= $movie->director();\n\t\t\t$producers\t= $movie->producer();\n\t\t\t$writers\t= $movie->writing();\n\t\t\t$cast\t\t= $movie->cast();\n\t\t\t//$plot \t\t= $movie->plot();\n\t\t\t//$short_plot = substr( $plot[0], 0, 255 );\n\t\t\t\n\n\n\t\t\tif ( strlen( $plot[0] ) > 255 )\n\t\t\t\t$short_plot .= ' [...]';\n\t\t\t\n\t\t\tif ( check_genre( $genre ) == FALSE )\n\t\t\t\tadd_genre( $genre );\n\t\n\t\t\tforeach ( $all_genres as $g ) {\n\t\t\t\tif ( check_genre( $g ) == FALSE )\n\t\t\t\t\tadd_genre( $g );\n\t\n\t\t\t\t// Update movie_genres\n\t\t\t\t$mg_sql = \"INSERT INTO mr_movie_genres (movie_id, genre_id) VALUES \".\n\t\t\t\t\t\" ($movie_id, \". get_genre_id( $g ) .\")\";\n\t\n\t\t\t\t$mg_res = mysql_query( $mg_sql );\n\t\t\t}\n\n/*\n\t\n\t\t\t$theVersion = get_version( substr( $filename, 0, strlen( $filename ) - 4 ) );\n\t\t\t//echo \"Version: $theVersion\";\n\t\t\t//echo $theVersion;\n\t\t\tif ( !check_version( $theVersion ) ) \n\t\t\t\tif ( !add_new_version( $theVersion ) )\n\t\t\t\t\techo \"<p>Couln't add $theVersion version to database.</p>\\n\";\n\t\t\t\t\n\t\t\t$theVersionID = get_version_id( $theVersion );\n*/\t\t\t\n\t\t\t\n// -- THIS NEEDS TO BE EDITED..\n\n\t\t\t$md_sql =\t'UPDATE mr_movie_details SET '.\n\t\t\t\t\t\t' date_updated = NOW(), '.\n\t\t\t\t\t\t' title = '. format_sql( $title ). ', '.\n\t\t\t\t\t\t' year = '. format_sql( $year ). ', '.\n\t\t\t\t\t\t' runtime = '. format_sql( $runtime ). ', '.\n\t\t\t\t\t\t' mpaa_rating = '. format_sql( $mpaar['USA'] ). ', '.\n\t\t\t\t\t\t' tagline = '. format_sql( trim( $tagline ) ) . ' '.\n\t\t\t\t\t\t\" WHERE movie_id = $movie_id LIMIT 1\";\n\n\n\t\t\t$producersSQL = \"INSERT INTO mr_movie_producers (movie_id, producer_id, producer_role) VALUES \";\n\t\t\tfor ( $i = 0; $i < count( $producers ); $i++ ) {\n\t\t\t\t$checkSQL = \"SELECT * FROM mr_producers WHERE producer_name LIKE \". format_sql( trim( $producers[$i]['name'] ), TRUE );\n\t\t\t\t$checkRES = mysql_query( $checkSQL );\n\t\t\t\tif ( mysql_num_rows( $checkRES ) == 0 ) {\n\t\t\t\t\tmysql_query( \"INSERT INTO mr_producers (producer_name) VALUES (\". format_sql( trim( $producers[$i]['name'] ) ) .\")\" );\n\t\t\t\t} else {\n\t\t\t\t\twhile ( $r = mysql_fetch_array( $checkRES ) ) {\n\t\t\t\t\t\t$producer_id = $r['producer_id'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$producersSQL .= \"( $movie_id, $producer_id, \". format_sql( trim( $producers[$i]['role'] ) ) .\"), \";\n\t\t\t}\n\t\t\t$producersSQL = substr( $producersSQL, 0, -2 );\n\t\t\t//echo $producersSQL;\n\t\t\t@mysql_query( $producersSQL );// or die(\"Couldn't add producers! \");\n\n $writersSQL = \"INSERT INTO mr_movie_writers (movie_id, writer_id) VALUES \";\n for ( $i = 0; $i < count( $writers ); $i++ ) {\n $checkSQL = \"SELECT * FROM mr_writers WHERE writer_name LIKE \". format_sql( trim( $writers[$i]['name'] ), TRUE );\n $checkRES = mysql_query( $checkSQL );\n if ( mysql_num_rows( $checkRES ) == 0 ) {\n mysql_query( \"INSERT INTO mr_writers (writer_name) VALUES (\". format_sql( trim( $writers[$i]['name'] ) ) .\")\" );\n } else {\n while ( $r = mysql_fetch_array( $checkRES ) ) {\n $writer_id = $r['writer_id'];\n }\n }\n $writersSQL .= \"( $movie_id, $writer_id ), \";\n }\n $writersSQL = substr( $writersSQL, 0, -2 );\n //echo $writersSQL;\n\t\t\t@mysql_query( $writersSQL );// or die(\"Couldn't add writers!\");\n\n $directorsSQL = \"INSERT INTO mr_movie_directors (movie_id, director_id) VALUES \";\n for ( $i = 0; $i < count( $directors ); $i++ ) {\n $checkSQL = \"SELECT * FROM mr_directors WHERE director_name LIKE \". format_sql( trim( $directors[$i]['name'] ), TRUE );\n $checkRES = mysql_query( $checkSQL );\n if ( mysql_num_rows( $checkRES ) == 0 ) {\n mysql_query( \"INSERT INTO mr_directors (director_name) VALUES (\". format_sql( trim( $directors[$i]['name'] ) ) .\")\" );\n } else {\n while ( $r = mysql_fetch_array( $checkRES ) ) {\n $director_id = $r['director_id'];\n }\n }\n $directorsSQL .= \"( $movie_id, $director_id ), \";\n }\n $directorsSQL = substr( $directorsSQL, 0, -2 );\n //echo $directorsSQL;\n\t\t\t@mysql_query( $directorsSQL );// or die(\"Couldn't add directors!\");\n\n\n $castSQL = \"INSERT INTO mr_movie_actors (movie_id, actor_id, actor_role) VALUES \";\n for ( $i = 0; $i < count( $cast ); $i++ ) { \n $checkSQL = \"SELECT * FROM mr_actors WHERE actor_name LIKE \". format_sql( trim( $cast[$i]['name'] ), TRUE );\n $checkRES = mysql_query( $checkSQL );\n if ( mysql_num_rows( $checkRES ) == 0 ) {\n mysql_query( \"INSERT INTO mr_actors (actor_name) VALUES (\". format_sql( trim( $cast[$i]['name'] ) ) .\")\" );\n } else {\n while ( $r = mysql_fetch_array( $checkRES ) ) {\n $actor_id = $r['actor_id'];\n }\n }\n $castSQL .= \"( $movie_id, $actor_id, \". format_sql( trim( $cast[$i]['role'] ) ) .\"), \";\n }\n $castSQL = substr( $castSQL, 0, -2 );\n //echo $castSQL;\n\t\t\t@mysql_query( $castSQL );// or die(\"Couldn't add cast!\");\n\n\n// directors, writers, cast\n\n\t\n\t\t\t$ratingSQL = \"INSERT INTO mr_movie_ratings (movie_id) VALUES ($movie_id)\";\n\t\t\t$ratingRes = mysql_query( $ratingSQL );\n\t\n\t\t\t$m_sql = \"UPDATE movies SET \".\n\t\t\t\t\" have_details = 'Y', \".\n\t\t\t\t\" version_id = $theVersionID \".\n\t\t\t\t\" WHERE movie_id = $movie_id\";\n\t\n\t\t\t//echo $m_sql;\n\t\t\t\n\t\t\t$md_res = mysql_query( $md_sql );\n//\t\t\t$m_res = mysql_query( $m_sql );\n\t\n\t\t\t$html['msg'] .= \"<div id=\\\"message\\\" class=\\\"updated\\\"><p>Info for <b>$title</b> added to database!</p></div>\\n\";\n\t\n\t\t}\n\t\t\n\t\t$html['main'] .= \"<p>Go <a href=\\\"{$_SERVER['PHP_SELF']}\\\">Home</a>.</p>\\n\";\n\t} else {\n\t\t$html['main'] .= \"<p>There are no movies with IMDB IDs but without details downloaded.</p>\\n\";\n\t}\n\t\n\treturn $html;\n}", "public function getNewestDramaMovie(){\n $movies = Film::with('image')\n ->whereHas('categories',function($q) {\n $q->where('slug','phim-le');\n })\n ->whereHas('genres', function($q){\n $q->where('slug','phim-tam-ly');\n })\n ->orderByDesc('updated_at')\n ->get();\n\n return response_success([\n 'movies' => $movies\n ],'get newest drama movie');\n }", "public function index()\n {\n return Movie::paginate();\n }", "public function movieStatusAction()\n {\n $user = $this->user;\n\n $imdbID = $this->request->getPost('imdbid');\n\n $status = $user->getMovieStatus($imdbID);\n\n //TODO: get movie from DB; check last update; fill that field in $status\n\n echo json_encode($status);\n }", "public function show(Movies $movies)\n {\n //\n }", "private function getMovies($page)\n {\n $response = $this->http->request('GET', $this->url.$page);\n $body = $response->getBody();\n\n return json_decode($body->getContents());\n }", "public function index()\n {\n $movies = Movie::with('genre')->with('reactions')->paginate(10);\n return response()->json($movies, 200);\n }", "public function getTop250Movies()\r\n\t{\r\n\t\treturn $this->makeRequest('/chart/top');\r\n\t}", "public function index() {\n return response()->json(Movie::all());\n }", "function gatherMovieInfo($moviefile, $moviedbid)\n\t{\n\t\t$movieinfo['filepath'] = $moviefile;\n\t\t$movieinfo['moviedbid'] = $moviedbid;\n\n\t\t\n\t\tif ($moviedbid == \"0\") {\n\t\t\t//\n\t\t\t// adding as a custom movie with no moviedb link. Like a home movie.\n\t\t\t//\n\t\t\t$info = pathinfo($moviefile);\n\t\t\t$title = basename($moviefile,'.'.$info['extension']);\n\t\t\t\n\t\t\t$movieinfo['title'] = $title;\n\t\t\t$movieinfo['original_title'] = $title;\n\t\t\t$movieinfo['genres'] = 'Home Movies';\n\t\t}\n\t\telse\n\t\t{\n\t\t\n\t\t\t// get runtime from file\n\t\t\t$meta= new getID3();\n\t\t\t$file = $meta->analyze($moviefile);\n\t\t\t$duration = $file['playtime_seconds'];\n\t\t\t$movieinfo['duration'] = round($duration / 60);\n\n\t\t\t$moviedbinfo = getAPI3Result(\"movie/\" . $moviedbid, \"append_to_response=casts,releases,images\");\n\n\t//\t\t$movieinfo['duration'] = $moviedbinfo['runtime'];\n\t\t\t$movieinfo['title'] = $moviedbinfo['title'];\n\t\t\t$movieinfo['imdbid'] = $moviedbinfo['imdb_id'];\n\t\t\t$movieinfo['original_title'] = $moviedbinfo['original_title'];\n\t\t\t$movieinfo['year'] = substr($moviedbinfo['release_date'],0,4);\n\t\t\t$movieinfo['mpaa'] = getUSRating($moviedbinfo);\n\t\t\t$movieinfo['director'] = getDirector($moviedbinfo);\n\t\t\t$movieinfo['writers'] = getWriters($moviedbinfo);\n\t\t\t$movieinfo['tagline'] = $moviedbinfo['tagline'];\n\t\t\t$movieinfo['genres'] = getGenres($moviedbinfo);\n\t\t\t$movieinfo['overview'] = $moviedbinfo['overview'];\n\t\t\t$movieinfo['plot'] = $moviedbinfo['overview'];\n\t\t\t$movieinfo['actors'] = getActors($moviedbinfo);\n\t\t\t$movieinfo['moviedbruntime'] = $moviedbinfo['runtime'];\n\n\t\t\t$config = getAPI3Result(\"configuration\");\n\n\t\t\t// get the thumbnails\n\t\t\t$thumbnails = \"\";\n\t\t\tforeach($moviedbinfo['images'][\"posters\"] as $poster) {\n\t\t\t\t$fullpath = $config['images']['base_url'] . \"original\" . $poster['file_path'];\n\t\t\t\tif (empty($movieinfo['thumb'])) $movieinfo['thumb'] = $fullpath;\n\t\t\t\t$thumbnails .= \"<thumb>\" . $fullpath . \"</thumb>\";\n\t\t\t}\t\t\t\t\n\t\t\t$movieinfo['allthumbs'] = $thumbnails;\n\t\t}\n\t\t\n\t\treturn $movieinfo;\n\n\t}", "public function index()\n {\n //\n // $movie=movie::paginate(10);\n // return view(\"insert_movie\")->with('movie',$movie);\n return Movie::latest()->get();\n }", "public function query(Movie $movies)\n {\n return $movies->query()->orderBy('release_date', 'desc')->select('id', 'title', 'main_actors', 'director', 'producer', 'release_date', 'genre');\n }", "function getVideos()\n{\n\t//Grab POST data\n\t$pageSize = intval($_POST['pageSize']);\n\t$lastId = intval($_POST['lastId']);\n\n\t//Grab the next <pageSize> videos, starting with <lastId>\n\t$configMode = 'live';\n\t$connectionData = require_once(\"../server-config.php\");\n\t$connectionData = $connectionData[$configMode];\n\t\n\t$pdo = new PDO($connectionData['dsn'], $connectionData['username'], $connectionData['password']);\n\t$sqlStatement = $pdo->prepare(\"\n\t\tSELECT\n\t\t\t`id`, `youtubeUrl`, `message`\n\t\tFROM\n\t\t\t`submissions_previous`\n\t\tWHERE\n\t\t\t`id` > :id\n\t\tLIMIT\n\t\t\t:pageSize;\n\t\");\n\t$sqlStatement->bindValue(\":id\", $lastId);\n\t$sqlStatement->bindValue(\":pageSize\", intval($pageSize), PDO::PARAM_INT);\n\t\n\ttry\n\t{\n\t\t$sqlStatement->execute();\n\t}\n\tcatch (PDOException $error)\n\t{\n\t\techo(json_encode(array('success' => false, 'message' => \"Couldn't get videos.\")));\n\t\treturn;\n\t}\n\t\n\t$results = $sqlStatement->fetchAll(PDO::FETCH_ASSOC);\n\t\n\t\n\t$resultsArray = array(\n\t\t'success' => true,\n\t\t'videos' => $results\n\t);\n\t$jsonArray = json_encode($resultsArray);\n\techo($jsonArray);\n\treturn;\n}", "public function index()\n {\n $query = \"\n SELECT *\n FROM `movies`\n WHERE 1\n ORDER BY `rating` DESC\n LIMIT 10\n \";\n $top_movies = DB::select($query);\n\n return $top_movies;\n // as response we will return an array of data\n return [\n 'success' => true,\n 'message' => 'Response successfully returned.',\n 'errors' => [],\n 'data' => []\n ];\n }", "function isTriggered() {\n\t\tif(!isset($this->data['text'])) {\n\t\t\t$this->printUsage();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$HTTP = new HTTP('api.themoviedb.org');\n\t\t\n\t\t$html = $HTTP->GET('/2.1/Movie.search/'.$this->getConfig('language').'/xml/'.$this->api_key.'/'.urlencode($this->data['text']));\n\t\t$XML = simplexml_load_string($html);\n\t\tif(!$XML) {\n\t\t\t$this->reply('Error on contacting themoviedb.org');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$tmp = $XML->xpath('opensearch:totalResults');\n\t\t$results = (int)$tmp[0];\n\t\tif(!$results) {\n\t\t\tif($this->getConfig('language') != 'en') {\n\t\t\t\t$html = $HTTP->GET('/2.1/Movie.search/en/xml/'.$this->api_key.'/'.urlencode($this->data['text']));\n\t\t\t\t$XML = new SimpleXMLElement($html);\n\t\t\t\tif(!$XML) {\n\t\t\t\t\t$this->reply('Error on contacting themoviedb.org');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t$tmp = $XML->xpath('opensearch:totalResults');\n\t\t\t\t$results = (int)$tmp[0];\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!$results) {\n\t\t\t$this->reply('There is no information available about this movie.');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$tmp = $XML->children()->children();\n\t\t$Movie = $tmp[0];\n\t\t\n\t\t$text = \"\\x02\".$Movie->name.\"\\x02\";\n\t\tif((string)$Movie->original_name != (string)$Movie->name) $text.= ' ('.$Movie->original_name.')';\n\t\tif(!empty($Movie->released)) $text.= \" | \\x02Released:\\x02 \".$Movie->released;\n\t\tif($Movie->rating != '0.0') $text.= \" | \\x02Press Rating:\\x02 \".$Movie->rating.'/10';\n\t\tif(!empty($Movie->certification)) $text.= \" | \\x02Rated:\\x02 \".$Movie->certification;\n\t\t$text.= ' ('.$Movie->url.')';\n\t\t\n\t\t$this->reply($text);\n\t\t$this->reply($Movie->overview);\n\t}", "public function RecentMovies($limit) {\n\n $other = DB::table('film')\n ->select('fl_id', 'fl_name')\n ->take($limit)\n ->orderBy('fl_release_date', 'desc')\n ->get();\n\n return $other;\n }", "public function getFilteredMovies($path, $options)\n {\n $this->options = $options;\n $this->movies = $this->findParsedMovies($path);\n\n if ($this->options['sort-by']) {\n $this->sortMovies($this->options['sort-by']);\n }\n\n if ($this->options['desc']) {\n $this->movies = array_reverse($this->movies, true);\n }\n\n if ($this->options['max-size-movie']) {\n $movies = [];\n foreach ($this->movies as $movieDirectory => $movie) {\n $movieSize = $this->getMovieSizeInMb($movieDirectory);\n if ($movieSize < $this->options['max-size-movie']) {\n $movies[$movieDirectory] = $movie;\n }\n }\n $this->movies = $movies;\n }\n\n if ($this->options['max-size']) {\n $movies = [];\n $this->totalSize = 0;\n foreach ($this->movies as $movieDirectory => $movie) {\n $movieSize = $this->getMovieSizeInMb($movieDirectory);\n if ($this->totalSize + $movieSize <= $this->options['max-size']) {\n $this->totalSize += $movieSize;\n $movies[$movieDirectory] = $movie;\n }\n }\n $this->movies = $movies;\n }\n\n if ($this->options['print-total']) {\n $this->totalSize = 0;\n foreach ($this->movies as $movieDirectory => $movie) {\n $this->totalSize += $this->getMovieSizeInMb($movieDirectory);\n }\n }\n\n if ($this->options['limit'] && -1 !== $this->options['limit']) {\n $this->movies = array_slice($this->movies, 0, $this->options['limit']);\n }\n\n return $this->movies;\n }", "public function Videos(){\n if(!isset($_SESSION[\"oturum\"])){\n header(\"location: \" . URL . \"login\" );\n }\n\n //Model Connections\n $movies = $this->model('Movie');\n $categories = $this->model('Categories');\n\n //Load data from model to views.\n $getVideos = $movies->getAllVideos();\n $getCategories = $categories->getAllCat();\n\n //Load views\n require VIEW_PATH . \"templates/header-yonetim.php\";\n require VIEW_PATH . \"videos/index.php\";\n require VIEW_PATH . \"templates/footer-yonetim.php\";\n }", "public function GetMovie($id)\n {\n try \n { \n $query = \"SELECT * FROM \" . $this->tableName . \" where id=$id;\";\n $this->connection = Connection::GetInstance();\n $resultSet = $this->connection->Execute($query);\n\n $movie = new Movie();\n \n foreach ($resultSet as $row) {\n $movie->setId($row[\"id\"]);\n $movie->setAdult($row[\"adult\"]);\n $movie->setName($row[\"movieName\"]);\n $movie->setSummary($row[\"summary\"]);\n $movie->setLanguage($row[\"movieLanguage\"]);\n $movie->setImage($row[\"dir_image\"]);\n $movie->setReleaseDate($row[\"releaseDate\"]);\n $arrayGenres = $this->MoviesxGenresDAO->GetGenresByMovieId($id);\n $aux = array();\n foreach($arrayGenres as $genreId)\n {\n array_push($aux, $genreId[\"idGenre\"]);\n }\n $movie->setGenres($aux);\n $movie->setRuntime($row[\"runtime\"]);\n // $movie->setPlayingNow($row[\"playingNow\"]);\n }\n \n } catch (Exception $ex) {\n throw $ex;\n } \n\n return $movie;\n }", "function paginatitel(){\r\n\t\tglobal $movie;\r\n\t\techo $movie[0]['title'];\r\n\t}", "public function getLtst() {\n $query = \"SELECT * FROM movies ORDER BY id DESC LIMIT 24\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_CLASS);\n if($result) {\n return json_response(200, \"success\", $result);\n } else {\n return json_response(404, \"No titles found\");\n }\n }", "function getEpisodes($id) {\n\t\t// 99 episodes at a time (start & end index)\n\t\t$url = 'http://feeds.theplatform.com/ps/JSON/PortalService/2.2/getReleaseList?callback=&field=ID&field=contentID&field=PID&field=URL&field=categoryIDs&field=length&field=airdate&field=requestCount&PID=HmHUZlCuIXO_ymAAPiwCpTCNZ3iIF1EG&contentCustomField=Show&contentCustomField=Episode&contentCustomField=Network&contentCustomField=Season&contentCustomField=Zone&contentCustomField=Subject&query=Categories|z/HGTVNEWVC%20-%20New%20Video%20Center&param=Site|shaw.hgtv.ca&param=k0|id&param=v0|399&param=k1|cnt&param=v1|lifestylehomes&param=k2|nk&param=v2|sbrdcst&param=k3|pr&param=v3|hgtv&param=k4|kw&param=v4|shaw&param=k5|test&param=v5|test&param=k6|ck&param=v6|video&param=k7|imp&param=v7|video&param=k8|liveinsite&param=v8|hrtbuy&query=CategoryIDs|'.$id.'&field=thumbnailURL&field=title&field=length&field=description&field=assets&contentCustomField=Part&contentCustomField=Clip%20Type&contentCustomField=Web%20Exclusive&contentCustomField=ChapterStartTimes&contentCustomField=AlternateHeading&startIndex=1&endIndex=200&sortField=airdate&sortDescending=true';\n\t\t$episodes = array();\n\t\t$response = file_get_contents($url);\n\t\tif ($response) {\n\t\t\t$json = json_decode($response);\n\t\t\tforeach ($json->items as $episode) {\n\t\t\t\t$show = null;\n\t\t\t\t$ep = null;\n\t\t\t\t$season = null;\n\t\t\t\t$alternateHeading = null;\n\t\t\t\tforeach ($episode->contentCustomData as $data) {\n\t\t\t\t\tswitch ($data->title) {\n\t\t\t\t\t\tcase 'Show':\n\t\t\t\t\t\t\t$show = $data->value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'Episode':\n\t\t\t\t\t\t\tif ($data->value != '') {\n\t\t\t\t\t\t\t\t$ep = str_pad($data->value, 2, '0', STR_PAD_LEFT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'Season':\n\t\t\t\t\t\t\tif ($data->value != '') {\n\t\t\t\t\t\t\t\t$season = str_pad($data->value, 2, '0', STR_PAD_LEFT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'AlternateHeading':\n\t\t\t\t\t\t\t$alternateHeading = $data->value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// fail if either set is missing\n\t\t\t\tif (!$show) {\n\t\t\t\t\tvar_dump($episode);\n\t\t\t\t\tthrow new Exception('Missing show');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// theres an episode thats labelled as s3 when its actually s1\n\t\t\t\t// check the current episode against the first episode.\n\t\t\t\t// if the first episode is wrong, fuck it, we tried. @todo\n\t\t\t\tif (isset($episodes[0]) && isset($episodes[0]['season']) && $season != $episodes[0]['season']) {\n\t\t\t\t\t$season = $episodes[0]['season'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// things like \"outtakes\" and \"timelapses\" are missing $ep but have an $alternateHeading\n\t\t\t\tif ($alternateHeading) {\n\t\t\t\t\t$title = $show . ' - ' . $alternateHeading . ' - ' . $episode->title;\n\t\t\t\t}\n\t\t\t\telseif ($season && $ep) {\n\t\t\t\t\t$title = $show . ' - S' . $season . 'E' . $ep . ' - ' . $episode->title;\n\t\t\t\t}\n\t\t\t\t// site displays like this if there is no episode #\n\t\t\t\telse {\n\t\t\t\t\t$title = $show . ' - ' . $episode->title;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$xmlString = file_get_contents($episode->URL);\n\t\t\t\tif ($xmlString) {\n\t\t\t\t\t$xml = simplexml_load_string($xmlString);\n\t\t\t\t\t$streamUrl = null;\n\t\t\t\t\tforeach ($xml->choice as $choice) {\n\t\t\t\t\t\tif (strpos($choice->url, 'rtmp://') !== false) {\n\t\t\t\t\t\t\t$streamUrl = $choice->url;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!$streamUrl) {\n\t\t\t\t\t\tthrow new Exception('Failed to find rtmp stream for ' . $id);\n\t\t\t\t\t}\n\t\t\t\t\t$streamParts = explode('<break>', $streamUrl);\n\t\t\t\t\tif (count($streamParts) != 2) {\n\t\t\t\t\t\tthrow new Exception('stream url didnt explode on <break>. url was: ' . $streamUrl);\n\t\t\t\t\t}\n\t\t\t\t\t$stream = $streamParts[0];\n\t\t\t\t\t$playlistFile = $streamParts[1];\n\t\t\t\t\t$playlistFileExtension = pathInfo($playlistFile, PATHINFO_EXTENSION);\n\t\t\t\t\tif ($playlistFileExtension == 'flv') {\n\t\t\t\t\t\t$playlist = 'flv:'.str_replace('.flv', '', $playlistFile);\n\t\t\t\t\t}\n\t\t\t\t\telseif ($playlistFileExtension == 'mp4') {\n\t\t\t\t\t\t$playlist = 'mp4:'.$playlistFile;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthrow new Exception('Unhandled playlist file extension: ' . $playlistFile);\n\t\t\t\t\t}\n\n\t\t\t\t\t$episodes[] = array(\n\t\t\t\t\t 'season' => $season,\n\t\t\t\t\t 'title' => $title,\n\t\t\t\t\t 'stream' => $stream,\n\t\t\t\t\t 'playlist' => $playlist,\n\t\t\t\t\t 'raw' => $episode\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthrow new Exception('episode->url response was empty');\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $episodes;\n\t\t}\n\t\telse {\n\t\t\tthrow new Exception('Episode list response was empty');\n\t\t}\n\t}", "public function doMovieSearchReleaseSubtitles()\n {\n $releaseId = str_replace( array( '|', '~' ), array( '/', '.' ), $this->ReleaseId );\n\n $scraper = new MkvManagerScraperSubsynchro();\n\n $subtitles = array_map(\n function( $subtitle ) {\n $subtitle = str_replace( array( '/', '.' ), array( '|', '~' ), $subtitle );\n return $subtitle;\n },\n $scraper->getReleaseSubtitles( $releaseId )\n );\n\n $variables = array( 'status' => 'ok', 'subtitles' => $subtitles );\n\n $result = new ezcMvcResult();\n $result->variables += $variables;\n\n return $result;\n }", "function getStills($rTMDBID, $rSeason, $rEpisode)\n{\n global $rSettings, $rAdminSettings;\n if (strlen($rAdminSettings[\"tmdb_language\"]) > 0) {\n $rURL = \"https://api.themoviedb.org/3/tv/\" . $rTMDBID . \"/season/\" . $rSeason . \"/episode/\" . $rEpisode . \"/images?api_key=\" . $rSettings[\"tmdb_api_key\"] . \"&language=\" . $rAdminSettings[\"tmdb_language\"];\n } else {\n $rURL = \"https://api.themoviedb.org/3/tv/\" . $rTMDBID . \"/season/\" . $rSeason . \"/episode/\" . $rEpisode . \"/images?api_key=\" . $rSettings[\"tmdb_api_key\"];\n }\n return json_decode(file_get_contents($rURL), true);\n}", "public function search_url($url){\n\n\n //Fetch the movie info\n $json = file_get_contents($url);\n\n //Convert json to array\n $array = json_decode($json);\n\n //Get rid of episode list before var_dumping\n //unset($array[0]->episodes);\n\n //Debug\n /*\n echo '<pre>';\n var_dump($array);\n echo '</pre>';\n */\n\n //Setup the video abstraction layer\n $test = new abstract_media;\n\n //Setup output buffering\n ob_start();\n\n //Echo the results\n if(isset($array[0])){\n if(isset($array[0]->poster->cover)){\n echo '<img src=\"'.$array[0]->poster->cover.'\" /><br />';\n $test->cover = $array[0]->poster->cover;\n }\n\n if(isset($array[0]->title)){\n echo 'Title: '.$array[0]->title.\"<br /> \\r\\n\";\n $test->title = $array[0]->title;\n }\n\n if(isset($array[0]->plot_simple)){\n echo 'Plot: '.$array[0]->plot_simple.\"<br /> \\r\\n\";\n $test->plot_simple = $array[0]->plot_simple;\n }\n\n if(isset($array[0]->year)){\n echo 'Year: '.$array[0]->year.\"<br /> \\r\\n\";\n $test->year = $array[0]->year;\n }\n\n if(isset($array[0]->rated)){\n echo 'Rated: '.$array[0]->rated.\"<br /> \\r\\n\";\n $test->rated = $array[0]->rated;\n }\n\n if(isset($array[0]->rating)){\n echo 'Rating: '.$array[0]->rating.\"<br /> \\r\\n\";\n $test->rating = $array[0]->rating;\n }\n\n if(isset($array[0]->runtime)){\n echo 'Runtime(s): '.implode(', ', $array[0]->runtime).\"<br /> \\r\\n\";\n $test->runtime = $array[0]->runtime;\n }\n\n if(isset($array[0]->genres)){\n echo 'Genre(s): '.implode(', ', $array[0]->genres).\"<br /> \\r\\n\";\n $test->genres = $array[0]->genres;\n }\n\n if(isset($array[0]->language)){\n echo 'Language(s): '.implode(', ', $array[0]->language).\"<br /> \\r\\n\";\n $test->language = $array[0]->language;\n }\n\n if(isset($array[0]->country)){\n echo 'Country(s): '.implode(', ', $array[0]->country).\"<br /> \\r\\n\";\n $test->country = $array[0]->country;\n }\n\n if(isset($array[0]->actors)){\n echo 'Actors: '.implode(', ', $array[0]->actors).\"<br /> \\r\\n\";\n $test->actors = $array[0]->actors;\n }\n\n if(isset($array[0]->directors)){\n echo 'Director(s): '.implode(', ', $array[0]->directors).\"<br /> \\r\\n\";\n $test->directors = $array[0]->directors;\n }\n\n if(isset($array[0]->writers)){\n echo 'Writer(s): '.implode(', ', $array[0]->writers).\"<br /> \\r\\n\";\n $test->writers = $array[0]->writers;\n }\n\n if(isset($array[0]->filming_locations)){\n echo 'Filming Location(s): '.$array[0]->filming_locations.\"<br /> \\r\\n\"; //This is output as a string for some reason\n $test->filming_locations = $array[0]->filming_locations;\n }\n\n if(isset($array[0]->imdb_id)){\n echo 'IMDb id: '.$array[0]->imdb_id.\"<br /> \\r\\n\";\n $test->ibdb_id = $array[0]->imdb_id;\n }\n }\n\n //Save the output buffer contents in the output variable\n $test->output = ob_get_contents();\n ob_end_clean();\n\n //Return the abstract video object\n return $test;\n }", "private function getWWMListingData(){\n\t\t\n\t\t// configure show dates\n\t\t$startDate = Date('Ymd');\n\t\t$endDate = Date('Ymd', strtotime('+4 months'));\n\t\t\n\t\t// gather movie data\n\t\t$movie_data = $this->get_data('http://webservice.cinema-source.com/3.8/?apikey=YOUAPIKEY&query=theater&schedule=yes&house_id=34510&sd=yes&showdate='.$startDate.'&enddate='.$endDate);\n\n\t\treturn $movie_data;\t\t\t\t\t\n\t}", "public function retrieveMovie($args=[]){\n\t\t#ID argument: if not set, fallback to 0\n\t\t$id = $args[\"id\"] ?? 0;\n\t\t#If no ID given, return error\n\t\tif(!$id) return [\"success\" => 0, \"msg\" => \"Empty response from TMDb\"];\n\t\t#Define the URL based on api documentation (https://developers.themoviedb.org/3/movies/get-movie-details)\n\t\t$url = \"https://api.themoviedb.org/3/movie/{$id}?api_key={$this->apiKey}&language={$this->requestLang}\";\n\t\t#Instantiate a new HTTP handler class\n\t\t$HttpHandler = new HttpHandler();\n\t\t#Retrieve raw output from the HTTP handler over the URL\n\t\t$outputRaw = $HttpHandler->execGET($url);\n\t\t#Bypass the consumed output\n\t\treturn $this->consumeRawOutput($outputRaw);\n\t}", "public function index()\n {\n $data = DB::table('movies')->paginate(15);\n return view('backend.movies.index', compact('data'));\n }", "private function getRTSListing(){\n\t\t\t\t\n\t\t// gather movie data\n\t\t$movie_data = json_decode(json_encode((array) simplexml_load_string($this->get_data('http://72352.formovietickets.com:2235/showtimes.xml'))), 1);\n\n\t\treturn $movie_data;\t\t\t\t\t\n\t}", "public function index()\n {\n $movies = Movie::paginate(10);\n return view('movies',compact('movies'));\n }", "public function getMyComingSoons()\n {\n $this->tasteTheCookie();\n \n $cinemaEmail = $_REQUEST[\"cinemaEmail\"];\n $page = $_REQUEST[\"page\"];\n\n $soonmdl = new ComingSoonModel();\n $moviemdl = new MovieModel();\n $comingSoons = $soonmdl->where(\"email\", $cinemaEmail)->limit(20, ($page-1)*20)->find();\n $results = [];\n foreach ($comingSoons as $soon)\n {\n $movie = $moviemdl->find($soon->tmdbID);\n array_push($results, [\n \"movieName\" => $movie->title\n ]);\n }\n\n echo json_encode($results);\n }", "public function get_movie($movie_id) {\n\t\t\n\t\t$tmpl_args = array (\n\t\t\t\"movie-id\" => $movie_id\n\t\t);\n\t\t\n\t\t$json = $this->request(self::API_URL_TMPL_MOVIE, $tmpl_args);\n\t\t\t\t\n\t\tif(isset($json->id) and !empty($json->id)) {\n\t\t\treturn new rt_movie($json, $this);\n\t\t} else {\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t}", "public function moviesAndSeriesByGenre() {\n $model = $this->model;\n $request = $this->request;\n $genre = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_genre_{$this->request->genre}\",\n function() use($model, $request) {\n return $model->getByGenre($request->genre);\n }\n );\n\n if (count($genre[\"movie\"]) + count($genre[\"serie\"]) > 0) {\n $this->view->addParameter(\"movies\", $genre[\"movie\"]);\n $this->view->addParameter(\"series\", $genre[\"serie\"]);\n } else {\n $this->view->addParameter(\"error\", \"Nothing found :/\");\n }\n }", "public function index()\n {\n return \\App\\Movie::all();\n }", "public function getNewestMovie() {\n $movies = Film::with('categories','image')\n ->whereHas('categories', function($query) {\n $query->where('slug', 'phim-le');\n })\n ->orderByDesc('updated_at')\n ->get();\n\n return response_success([\n 'movies' => $movies\n ],'get newest movie ');\n }", "public function movie_show($movie_id = null) {\n // por el metodo de HTTP\n\n if ($movie_id == null) {\n show_404();\n }\n\n $movie = $this->Movie->find($movie_id);\n\n if (!is_object($movie)) {\n show_404();\n }\n\n $vdata[\"name\"] = $movie->name;\n $vdata[\"year\"] = $movie->year;\n $vdata[\"description\"] = $movie->description;\n $vdata[\"image\"] = $movie->image;\n\n // Capa de la Vista\n $view['body'] = $this->load->view(\"core/movies/show\", $vdata, TRUE);\n $view['title'] = \"Mostrar película: \" . $movie->name;\n $this->parser->parse('core/templates/body', $view);\n }", "public function getByString($movie){\n $url = \"http://www.omdbapi.com/?t=\".urlencode($movie).\"&y=&plot=short&r=json\";\n\n if($json = file_get_contents($url)){\n $info = json_decode($json);\n if(isset($info->Title) && $info->Title !=''){\n return $info->Title.\"(\".$info->Year.\") - Rating \".$info->imdbRating.\" - http://www.imdb.com/title/\".$info->imdbID.\"/\";\n }else{\n return 'Couldn\\'t find this movie';\n }\n }else{\n return 'Could not connect.';\n }\n }", "public static function render_movie_list($movies) {\n ?>\n <div class=\"row\" style=\"margin-top: 30px\">\n <div class=\"one-full column\">\n <h4>\n Movie List - <?php echo count($movies) ?> results<?php if(isset($_POST['search'])) echo ' - Search term: '.$_POST['search']; ?>\n <a href=\"MovieInfo.php\" class=\"button-primary u-pull-right\">Add Movie</a>\n </h4>\n \n </div> \n </div>\n\n <?php \n self::render_movies_rows($movies);\n ?>\n \n <?php\n }", "public function getAnnunciLavoroCittaPage($city)\n {\n $client = App::make('client.api');\n\n\n if ($city) {\n\n $response = $client->request('GET', \"/api/vacancy/searchbylocation?key=\" . $city);\n $res = $response->getBody()->getContents();\n $res = json_decode($res, true);\n\n\n $numVacancies = 0;\n $pagine = 0;\n\n if (isset($res)) {\n\n $numVacancies = count($res);\n\n $pagine = round($numVacancies / 20);\n\n\n $tagName = ucfirst($city);\n\n\n if (isset($res)) {\n foreach ($res as $key2 => $vacancy) {\n\n if ($vacancy['is_visible'] == false) {\n unset($res[$key2]);\n }\n }\n }\n\n $client = App::make('client.api');\n $response = $client->request('GET', \"/api/tags/category/JOBFUNCTION\");\n\n\n $jobFunctions = json_decode($response->getBody()->getContents(), true);\n\n\n $categories = [];\n\n foreach ($jobFunctions as $jobFunction) {\n\n if ($jobFunction['has_vacancy']) {\n $name = $jobFunction['name'];\n $link = \"/job-opportunities/\" . $city . \"/\" . $jobFunction['permalink_en'];\n\n\n if (\\Illuminate\\Support\\Facades\\App::getLocale() == \"it\") {\n $link = \"/annunci-lavoro/\" . $city . \"/\" . $jobFunction['permalink_it'];\n $name = $jobFunction['name_it'];\n\n }\n\n $categories[] = [\n \"name\" => $name,\n \"link\" => $link\n ];\n }\n\n }\n\n\n $description = \"Trova annunci di lavoro in \" . $tagName . \" per mettere a frutto il tuo talento. In tutto il mondo.\";\n\n\n if (\\Illuminate\\Support\\Facades\\App::getLocale() != \"it\") {\n $description = \"Find jobs in \" . $tagName . \" to nurture your talent. Worldwide.\";\n }\n if (!empty($res)) {\n usort($res, array($this, 'date_compare'));\n $res = array_reverse($res);\n }\n return View::make('vacancy-city', [\"categories\" => $categories, \"tag\" => $tagName, \"route\" => \"vacancy-category\", \"numVacancies\" => $numVacancies, \"customClass\" => \"jobs\", \"pagine\" => $pagine, \"vacancies\" => $res, \"key\" => $tagName, \"title\" => \"Annunci Lavoro \" . $tagName, \"tagName\" => $tagName, \"description\" => $description]);\n\n }\n\n\n }\n\n\n return Redirect::to('/');\n }", "public function getDiscoverMovie($page = 1) {\n\n\t\t$movies = array();\n\n\t\t$result = $this->_call('discover/movie', 'page='. $page);\n\n\t\tforeach($result['results'] as $data){\n\t\t\t$movies[] = new Movie($data);\n\t\t}\n\n\t\treturn $movies;\n\t}", "public function index()\n {\n $movies = Movies::latest()->paginate(5);\n return view(\"movies.index\",compact(\"movies\"))\n ->with(\"i\", (request()->input(\"page\", 1) - 1) * 5);\n }", "public function getVideos(Request $request)\n {\n $draw = $request[\"draw\"];\n $orderByColumnIndex = $request['order'][0]['column'];\n switch (true) {\n case !empty($request['columns'][$orderByColumnIndex]['data']):\n $orderBy = $request['columns'][$orderByColumnIndex]['data'];\n break;\n default:\n $orderBy = 'created_at';\n break;\n }\n $orderType = $request['order'][0]['dir'];\n $start = $request[\"start\"];\n $length = $request['length'];\n $recordsTotal = VideoRecords::with('videos')->orderBy('created_at', 'desc')->count();\n\n\n\n if(!empty($request['search']['value']) and $request['category'] == '' ){\n $items = VideoRecords::with('videos')\n ->where('title', 'like', '%'.$request['search']['value'].'%')\n ->orWhere('description', 'like', '%'.$request['search']['value'].'%')\n ->orderBy($orderBy, $orderType)\n ->offset($start)\n ->limit($length)\n ->get();\n $recordsFiltered = VideoRecords::with('videos')\n ->where('title', 'like', '%'.$request['search']['value'].'%')\n ->orWhere('description', 'like', '%'.$request['search']['value'].'%')->count();\n $data = $this->getVideoEntriesArray($items);\n }\n\n elseif (!empty($request['search']['value']) and $request['category'] != '' ){\n $items = VideoRecords::with('videos')\n ->where('category_id', '=', $request['category'])\n ->where('title', 'like', '%'.$request['search']['value'].'%')\n ->orWhere('description', 'like', '%'.$request['search']['value'].'%')\n ->orderBy($orderBy, $orderType)\n ->offset($start)\n ->limit($length)\n ->get();\n $recordsTotal = VideoRecords::with('videos')\n ->where('category_id', '=', $request['category'])\n ->count();\n $recordsFiltered = $recordsTotal;\n $data = $this->getVideoEntriesArray($items);\n }\n\n elseif(empty($request['search']['value']) and !empty($request['category']) ){\n $items = VideoRecords::with('videos')\n ->where('category_id', '=', $request['category'])\n ->orderBy($orderBy, $orderType)\n ->offset($start)\n ->limit($length)\n ->get();\n $recordsTotal = VideoRecords::with('videos')\n ->where('category_id', '=', $request['category'])\n ->count();\n $recordsFiltered = $recordsTotal;\n $data = $this->getVideoEntriesArray($items);\n }\n\n else{\n $items = VideoRecords::with('videos')\n ->orderBy($orderBy, $orderType)\n ->offset($start)\n ->limit($length)\n ->get();\n $recordsTotal = VideoRecords::with('videos')\n ->count();\n $recordsFiltered = $recordsTotal;\n $data = $this->getVideoEntriesArray($items);\n }\n\n// else{\n// if (!empty($request['category'])){\n// $items = VideoRecords::with('videos')\n// ->where('category_id', '=', $request['category'])\n// ->orderBy($orderBy, $orderType)\n// ->offset($start)\n// ->limit($length)\n// ->get();\n// $recordsTotal = VideoRecords::with('videos')\n// ->where('category_id', '=', $request['category'])\n// ->count();\n// }else{\n// $items = VideoRecords::with('videos')\n// ->orderBy($orderBy, $orderType)\n// ->offset($start)\n// ->limit($length)\n// ->get();\n// }\n// $recordsFiltered = $recordsTotal;\n// $data = $this->getVideoEntriesArray($items);\n// }\n $output = array(\n \"sEcho\" => intval($draw),\n \"iTotalRecords\" => $recordsTotal,\n \"iTotalDisplayRecords\" => $recordsFiltered,\n \"aaData\" => json_decode(json_encode($data))\n );\n return json_encode($output);\n }", "public function PaginacionVideos()\n\t{\n\t\t$items_per_page = Input::get('can');\n\t\t$ordenar_items = Input::get('orde');\n\t\t$forma_orden = Input::get('por');\n\t\t$campos = array('id', 'title', 'videourl','rate','times_viewed','thumburl');\n $config = ConfigApp::First()->get();\n \n $items = Video::where('published', '=', 1)->where('memberid', '=', $config[0][\"UserJoomla\"])->where('filepath', '!=', 'File')->orderBy($ordenar_items, $forma_orden)->select($campos)->paginate($items_per_page);\n if ($items->isEmpty()) {\n\t\t echo '<div class=\"box-content\"><legend id=\"uniq\" class=\"alert alert-info\">No hay videos para visualizar</legend></div>';\n\t\t exit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$view = View::make('pages.video.items')->with('items', $items);\n\t\t echo $view;\n\t\t exit;\n\t\t}\n\t}", "public function getWatchedVideos($page = 0, $limit = 0) {\n\t\t$conn\t\t\t= $this->connect();\n\t\t$userSession\t= new Container('fo_user');\n\t\t//\tWatched Videos\n\t\t$videoWatchedSession\t= new Container('fo_videos_watched');\n\t\t$skip\t\t\t= ($page - 1) * $limit;\n\t\t$collection\t\t= $conn->snapstate->media_views;\n\t\t$sort\t\t\t= array('date_viewed' => 1);\n\t\t$document\t\t= array('user_id' => (string)$userSession->userSession['_id']);\n\t\t\n\t\t/*\tif($limit > 0)\n\t\t\t$results\t= $collection->find($document)->skip($skip)->limit($limit)->sort($sort);\n\t\telse\n\t\t\t$results\t= $collection->find($document)->sort($sort);\n\t\treturn $results;\t*/\n\t\t\n\t\t/*\t// use all fields\n\t\t$keys = array(\"media_id\" => 1);;\n\t\t// set intial values\n\t\t$initial = array(\"items\" => array());\n\t\t// JavaScript function to perform\n\t\t$reduce = \"function (obj, prev) { prev.items.push(obj.date_viewed); }\";\n\t\t$condition = array('condition' => $document);\n\t\t$results\t= $collection->group($keys, $initial, $reduce, $condition);\n\t\treturn $results;\t\n\t\t\t*/\n\t\t\n\t\t$results\t= $collection->aggregate(array(\n\t\t\t\t\t\t array('$match' => $document),\n\t\t\t\t\t\t array('$group' => array('_id' => '$media_id', 'views' => array('$sum' => 1))),\n\t\t\t\t\t\t));\n\t\t$resultArray['total']\t= (isset($results['result'])) ? count($results['result']) : 0;\n\t\t$sort\t\t= array('views' => -1);\n\t\t$results\t= $collection->aggregate(array(\n\t\t\t\t\t\t\tarray('$match' => $document),\n\t\t\t\t\t\t array('$group' => array('_id' => '$media_id', 'date' => array('$max' => '$date_viewed'), 'views' => array('$sum' => 1))),\n\t\t\t\t\t\t array('$sort' => $sort),\n\t\t\t\t\t\t\tarray('$skip' => $skip),\n\t\t\t\t\t\t\tarray('$limit' => $limit),\n\t\t\t\t\t\t));\n\t\t$resultArray['records']\t= (isset($results['result'])) ? $results['result'] : array();\n\t\treturn $resultArray;\n\t\t\n\t}", "public function moviesAndSeriesByCountry() {\n $model = $this->model;\n $request = $this->request;\n $country = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_country_{$this->request->country}\",\n function() use($model, $request) {\n return $model->getByCountry($request->country);\n }\n );\n\n if (count($country[\"movie\"]) + count($country[\"serie\"]) > 0) {\n $this->view->addParameter(\"movies\", $country[\"movie\"]);\n $this->view->addParameter(\"series\", $country[\"serie\"]);\n } else {\n $this->view->addParameter(\"error\", \"Nothing found :/\");\n }\n }", "function filmdata(){\r\n\tglobal $pdo;\r\n\tglobal $movie;\r\n\tglobal $movie_id;\r\n\tglobal $favoriettext;\r\n\t\t//ophalen genres\r\n\t$sql = \"SELECT genre_name FROM Movie m JOIN movie_genre g on m.movie_id = g.movie_id where m.movie_id = \".$movie_id.\";\";\r\n\t$genres = $pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC) or die(print_r($pdo->errorInfo(), true));\r\n\t\t//ophalen directors\r\n\t$sql = \"SELECT p.firstname, p.lastname FROM Movie m JOIN Movie_Director d ON m.movie_id = d.movie_id JOIN Person p ON d.person_id = p.person_id WHERE d.movie_id = \".$movie_id.\" ORDER BY p.firstname ASC;\";\r\n\t$directors = $pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t//ophalen actors\r\n\t$sql = \"SELECT p.firstname, p.lastname FROM Movie m JOIN Movie_Cast c ON m.movie_id = c.movie_id JOIN Person p ON c.person_id = p.person_id WHERE c.movie_id = \".$movie_id.\" ORDER BY p.firstname ASC;\";\r\n\t$actors = $pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t//lengte van film in uren berekenen\r\n\t$filmlengte = date('G\\u\\u\\r i\\M\\i\\n', mktime(0,$movie[0]['duration']));\r\n\t\t//cover_image vullen\r\n\tif(!isset($movie[0]['cover_image'])){\r\n\t\t$movie[0]['cover_image'] = \"placeholder.png\";\r\n\t}\r\n\t\t//trailer URL vullen\r\n\tif(!isset($movie[0]['URL'])){\r\n\t\t$movie[0]['URL'] = 'https://www.youtube.com/embed/ponurLICAoM';\r\n\t}\r\n\t\t//genres formatten\r\n\tif($genres){\r\n\t\t$formattedgenres = \"\";\r\n\t\tforeach($genres as $genre){\r\n\t\t\t$formattedgenres = $formattedgenres.implode(\" \", $genre).\", \";\r\n\t\t}\r\n\t\t$formattedgenres = rtrim($formattedgenres, \", \");\r\n\t}\r\n\t\t//directors array formatten\r\n\tif($directors){\r\n\t\t$formatteddirectors = \"\";\r\n\t\tforeach($directors as $director){\r\n\t\t\t$formatteddirectors = $formatteddirectors.implode(\" \", $director).\", \";\r\n\t\t}\r\n\t\t$formatteddirectors = rtrim($formatteddirectors, \", \");\r\n\t}\r\n\t\t//actors array formatten\r\n\tif($actors){\r\n\t\t$formattedactors = \"\";\r\n\t\tforeach($actors as $actor){\r\n\t\t\t$formattedactors = $formattedactors.implode(\" \", $actor).\", \";\r\n\t\t}\r\n\t\t$formattedactors = rtrim($formattedactors, \", \");\r\n\t}\r\n\t\t//printen waardes\r\n\techo '<div class=\"movie-flex\">';\r\n\techo '<h1>'.$movie[0]['title'].'</h1>';\r\n\techo '<h3>('.$movie[0]['publication_year'].')</h3>';\r\n\techo '<br>';\r\n\techo '<form action=\"#\" method=\"post\"><input class=\"button\" id=\"submit\" type=\"submit\" name=\"favoriet\" width=\"20\" height=\"10\" value=\"'.$favoriettext.'\"/></form>';\r\n\techo '</div>';\r\n\techo '<p> '.$filmlengte.' | '.$formattedgenres.' | '.$movie[0]['publication_year'].'</p>';\r\n\techo '<div class=\"movie-flex\">';\r\n\techo '<a href=\"data/image_data/'.$movie[0]['cover_image'].'\"><img src=\"data/image_data/'.$movie[0]['cover_image'].'\" height=\"200\" width=\"150\" alt=\"The Matrix\"></a>';\r\n\techo '<div class=\"movieinformation-flex\">';\r\n\techo '<p id=\"description\">'.$movie[0]['description'].'</p>';\r\n\tif(isset($formatteddirectors)){\r\n\t\techo '<p>Directors: '.$formatteddirectors.'.</p>';\r\n\t}\r\n\tif(isset($formattedactors)){\r\n\t\techo '<p>Actors: '.$formattedactors.'.</p>';\r\n\t}\r\n\techo '<button class=\"button\" style=\"width:100px;height:50px\"><a style=\"text-decoration=none;\" href=\"afspelen.php?movie_id='.$movie_id.'\">Afspelen</a></button>';\r\n\techo '</div>';\r\n\techo '</div>';\r\n\techo '<div id=\"trailer\">';\r\n\techo '<iframe width=\"420\" height=\"315\" src=\"'.$movie[0]['URL'].'\"></iframe>';\r\n\techo '</div>';\r\n}", "public static function unwatchedMovies()\n {\n return self::where('user_id', Auth::id())\n ->where('watched', 0)\n ->orderBy('created_at', 'desc')\n ->limit(UserMovie::LIMIT)\n ->get();\n }", "function bgs_Movies_init() {\n\t\n}", "public function index()\n {\n $present = Carbon::now(); \n $user = User::where('id', Auth::user()->id)->firstOrFail();\n if($check = subscriber::where('user_id', Auth::user()->id)->where('status', 'active')->where('end_date', '>', $present)->first()){\n $end = $check->end_date;\n $status = $check->status; \n if($status == 'active' and $present<$end){\n $latestvideo = Video::latest()->first();\n $date = date('Y-m-d');\n $events = DB::table('events')->where('date', '<=', $date)->select('url', 'title'); \n $recentvideos = DB::table('videos')->where('created_at', '<', now())->select('url', 'title')->union($events)->get(); \n return view('users.user.videos.index', compact(['recentvideos', 'latestvideo', 'user']));\n } \n return redirect()->route('usersdashboard')->with('error', 'Sorry your subscription is expired, Please again subscribe to watch our videos'); \n } \n return redirect()->route('usersdashboard')->with('error', 'Sorry you dont have any active subscription, Please subscribe to watch our videos'); \n \n }", "function get_last_movie($owner_id){\n $ch = curl_init();\n $url = $GLOBALS['App-Logic'].\"?\" .http_build_query([\n 'get_last_movie' => true, //a flag to execute the right code in App-Logic! \n 'owner_id' => $owner_id,\n ]);\n\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPGET, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);\n \n $response = curl_exec($ch);\n curl_close($ch);\n\n return json_decode($response,true);\n\n }", "public function index()\n { \n $movies = Movie::fetchMovies();\n return view('pages.admin.movie.viewMovies', compact('movies'));\n\n }", "public function index()\n {\n return MovieResource::collection(Movie::get());\n }" ]
[ "0.71259886", "0.64386976", "0.64118624", "0.6395521", "0.6288417", "0.615633", "0.6142483", "0.59465796", "0.59405535", "0.5924368", "0.58825713", "0.58669883", "0.58641714", "0.5845794", "0.5831325", "0.5796509", "0.5751942", "0.5732884", "0.56883186", "0.56798923", "0.5678998", "0.5654136", "0.55984247", "0.5590706", "0.55790967", "0.5560178", "0.555053", "0.5509443", "0.5506572", "0.5488059", "0.54555976", "0.54401183", "0.5436816", "0.5414349", "0.53724074", "0.5354168", "0.532557", "0.5313317", "0.53074056", "0.5305071", "0.53027326", "0.5301856", "0.5286491", "0.52804255", "0.5277003", "0.52699536", "0.5262571", "0.52373403", "0.52236944", "0.5215474", "0.5200997", "0.51963824", "0.5189646", "0.5180255", "0.5173975", "0.51452714", "0.51360404", "0.51235193", "0.5122396", "0.5120126", "0.5118362", "0.5112646", "0.51030797", "0.5096725", "0.50948393", "0.5091087", "0.5090672", "0.5082553", "0.5080979", "0.5077295", "0.50733054", "0.5067785", "0.50622594", "0.50602776", "0.5054407", "0.5036164", "0.50286806", "0.5021689", "0.5014905", "0.50120676", "0.50102574", "0.50002563", "0.49983478", "0.4994873", "0.49910775", "0.49788207", "0.49777475", "0.49725148", "0.4969491", "0.49604332", "0.49599093", "0.49585336", "0.49567026", "0.4954762", "0.49528596", "0.49523255", "0.4938556", "0.49365696", "0.49332112", "0.49312994" ]
0.67324364
1
Retrieves information from a given movie ID from TMDb. A future improvement could consist on error checking from a valid TMDb response, for better handling in frontend. A language selection based on user data could also be done.
public function retrieveMovie($args=[]){ #ID argument: if not set, fallback to 0 $id = $args["id"] ?? 0; #If no ID given, return error if(!$id) return ["success" => 0, "msg" => "Empty response from TMDb"]; #Define the URL based on api documentation (https://developers.themoviedb.org/3/movies/get-movie-details) $url = "https://api.themoviedb.org/3/movie/{$id}?api_key={$this->apiKey}&language={$this->requestLang}"; #Instantiate a new HTTP handler class $HttpHandler = new HttpHandler(); #Retrieve raw output from the HTTP handler over the URL $outputRaw = $HttpHandler->execGET($url); #Bypass the consumed output return $this->consumeRawOutput($outputRaw); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_movie($movie_id) {\n\t\t\n\t\t$tmpl_args = array (\n\t\t\t\"movie-id\" => $movie_id\n\t\t);\n\t\t\n\t\t$json = $this->request(self::API_URL_TMPL_MOVIE, $tmpl_args);\n\t\t\t\t\n\t\tif(isset($json->id) and !empty($json->id)) {\n\t\t\treturn new rt_movie($json, $this);\n\t\t} else {\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t}", "public function selectMovie($id) {\n\t\t$this->dbAdapter->dbOpen();\n\t\t$result = $this->dbAdapter->movieSelectById($id);\n\t\t$this->dbAdapter->dbClose();\n\t\t$this->error = $this->dbAdapter->lastError();\n\t\t\n\t\treturn $result;\n\t}", "public function getByString($movie){\n $url = \"http://www.omdbapi.com/?t=\".urlencode($movie).\"&y=&plot=short&r=json\";\n\n if($json = file_get_contents($url)){\n $info = json_decode($json);\n if(isset($info->Title) && $info->Title !=''){\n return $info->Title.\"(\".$info->Year.\") - Rating \".$info->imdbRating.\" - http://www.imdb.com/title/\".$info->imdbID.\"/\";\n }else{\n return 'Couldn\\'t find this movie';\n }\n }else{\n return 'Could not connect.';\n }\n }", "public function GetMovie($id)\n {\n try \n { \n $query = \"SELECT * FROM \" . $this->tableName . \" where id=$id;\";\n $this->connection = Connection::GetInstance();\n $resultSet = $this->connection->Execute($query);\n\n $movie = new Movie();\n \n foreach ($resultSet as $row) {\n $movie->setId($row[\"id\"]);\n $movie->setAdult($row[\"adult\"]);\n $movie->setName($row[\"movieName\"]);\n $movie->setSummary($row[\"summary\"]);\n $movie->setLanguage($row[\"movieLanguage\"]);\n $movie->setImage($row[\"dir_image\"]);\n $movie->setReleaseDate($row[\"releaseDate\"]);\n $arrayGenres = $this->MoviesxGenresDAO->GetGenresByMovieId($id);\n $aux = array();\n foreach($arrayGenres as $genreId)\n {\n array_push($aux, $genreId[\"idGenre\"]);\n }\n $movie->setGenres($aux);\n $movie->setRuntime($row[\"runtime\"]);\n // $movie->setPlayingNow($row[\"playingNow\"]);\n }\n \n } catch (Exception $ex) {\n throw $ex;\n } \n\n return $movie;\n }", "public function movie_show($movie_id = null) {\n // por el metodo de HTTP\n\n if ($movie_id == null) {\n show_404();\n }\n\n $movie = $this->Movie->find($movie_id);\n\n if (!is_object($movie)) {\n show_404();\n }\n\n $vdata[\"name\"] = $movie->name;\n $vdata[\"year\"] = $movie->year;\n $vdata[\"description\"] = $movie->description;\n $vdata[\"image\"] = $movie->image;\n\n // Capa de la Vista\n $view['body'] = $this->load->view(\"core/movies/show\", $vdata, TRUE);\n $view['title'] = \"Mostrar película: \" . $movie->name;\n $this->parser->parse('core/templates/body', $view);\n }", "function get_movie($id)\n{\n\t$db = open_database_connection();\n\t$stmt = $db->prepare(\"SELECT DateTime, video, user.name as author,\n\t\t\t\t\t\tmovie.name as title, text\n\t\t\t\t\t\tFROM movie, movie_category, user\n\t\t\t\t\t\tWHERE movie.userID = user.userID \n\t\t\t\t\t\tAND movie.movieID = :id\");\n\t$stmt->execute(array(':id' => $id));\n\t$movie = $stmt->fetchAll(PDO::FETCH_ASSOC);\n close_database_connection($db);\n return $movie[0];\n}", "public function getMovieInfo($idMovie, $option = '', $append_request = ''){\n\t\t$option = (empty($option)) ? '' : '/' . $option;\n\t\t$params = 'movie/' . $idMovie . $option;\n\t\t$result = $this->_call($params, $append_request);\n\t\t\t\n\t\treturn $result;\n\t}", "public static function getTmdbIdUsingImdbId($imdbId) {\n\n\t\tif(empty($imdbId)) {\n\t\t\treturn;\n\t\t}\n\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://api.themoviedb.org/3/movie/$imdbId?api_key=\" . urlencode(TMDB_API_KEY));\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t$json = curl_exec($ch);\n\t\t$error = curl_error($ch);\n\t\tcurl_close($ch);\n\n\t\tif(!empty($error)) {\n\t\t\tUtil::fatal(\"Cannot get tmdbId: \" . $error);\n\t\t}\n\n\t\t$data = json_decode($json);\n\t\t$tmdbId = isset($data->id) ? $data->id : null;\n\n\t\treturn $tmdbId;\n\n\t}", "public function show($id)\n {\n return response()->json(\n Movie::where('user_id', Auth::guard('token')->id())->where('id', $id)->first()\n );\n }", "private function getMovieDataWWM($movie_id){\n\t\t\n\t\t// gather movie data\n\t\t$movie_data = json_decode(json_encode((array) simplexml_load_string($this->get_data('http://webservice.cinema-source.com/3.8/?apikey=THBMB&query=movie&stars=yes&photos=all&movie_id='.trim($movie_id)))), 1);\n\n\t\treturn $movie_data['movie'];\n\t}", "function getMovieInformation($movie)\n{\n if($movie != \"\") {\n $OMDB_API_KEY = '99842c57';\n $omdbUrl = \"http://www.omdbapi.com?s=$movie&apikey=$OMDB_API_KEY&type=movie\";\n $movie = file_get_contents($omdbUrl);\n\n $movieDetails =json_decode($movie, true);\n\n \n if(count($movieDetails['Search'])) {\n $movieList = $movieDetails['Search'];\n // Pick the first movie\n $movie = $movieList[0];\n $movieTitle = $movie[\"Title\"];\n $movieYear = $movie[\"Year\"];\n $moviePoster = $movie[\"Poster\"];\n\n sendFulfillmentResponse($movieTitle, $movieYear, $moviePoster, true);\n } else {\n sendFulfillmentResponse(null, null, null, false);\n }\n } else {\n sendFulfillmentResponse(null, null, null, false);\n }\n \n}", "function gatherMovieInfo($moviefile, $moviedbid)\n\t{\n\t\t$movieinfo['filepath'] = $moviefile;\n\t\t$movieinfo['moviedbid'] = $moviedbid;\n\n\t\t\n\t\tif ($moviedbid == \"0\") {\n\t\t\t//\n\t\t\t// adding as a custom movie with no moviedb link. Like a home movie.\n\t\t\t//\n\t\t\t$info = pathinfo($moviefile);\n\t\t\t$title = basename($moviefile,'.'.$info['extension']);\n\t\t\t\n\t\t\t$movieinfo['title'] = $title;\n\t\t\t$movieinfo['original_title'] = $title;\n\t\t\t$movieinfo['genres'] = 'Home Movies';\n\t\t}\n\t\telse\n\t\t{\n\t\t\n\t\t\t// get runtime from file\n\t\t\t$meta= new getID3();\n\t\t\t$file = $meta->analyze($moviefile);\n\t\t\t$duration = $file['playtime_seconds'];\n\t\t\t$movieinfo['duration'] = round($duration / 60);\n\n\t\t\t$moviedbinfo = getAPI3Result(\"movie/\" . $moviedbid, \"append_to_response=casts,releases,images\");\n\n\t//\t\t$movieinfo['duration'] = $moviedbinfo['runtime'];\n\t\t\t$movieinfo['title'] = $moviedbinfo['title'];\n\t\t\t$movieinfo['imdbid'] = $moviedbinfo['imdb_id'];\n\t\t\t$movieinfo['original_title'] = $moviedbinfo['original_title'];\n\t\t\t$movieinfo['year'] = substr($moviedbinfo['release_date'],0,4);\n\t\t\t$movieinfo['mpaa'] = getUSRating($moviedbinfo);\n\t\t\t$movieinfo['director'] = getDirector($moviedbinfo);\n\t\t\t$movieinfo['writers'] = getWriters($moviedbinfo);\n\t\t\t$movieinfo['tagline'] = $moviedbinfo['tagline'];\n\t\t\t$movieinfo['genres'] = getGenres($moviedbinfo);\n\t\t\t$movieinfo['overview'] = $moviedbinfo['overview'];\n\t\t\t$movieinfo['plot'] = $moviedbinfo['overview'];\n\t\t\t$movieinfo['actors'] = getActors($moviedbinfo);\n\t\t\t$movieinfo['moviedbruntime'] = $moviedbinfo['runtime'];\n\n\t\t\t$config = getAPI3Result(\"configuration\");\n\n\t\t\t// get the thumbnails\n\t\t\t$thumbnails = \"\";\n\t\t\tforeach($moviedbinfo['images'][\"posters\"] as $poster) {\n\t\t\t\t$fullpath = $config['images']['base_url'] . \"original\" . $poster['file_path'];\n\t\t\t\tif (empty($movieinfo['thumb'])) $movieinfo['thumb'] = $fullpath;\n\t\t\t\t$thumbnails .= \"<thumb>\" . $fullpath . \"</thumb>\";\n\t\t\t}\t\t\t\t\n\t\t\t$movieinfo['allthumbs'] = $thumbnails;\n\t\t}\n\t\t\n\t\treturn $movieinfo;\n\n\t}", "public function get($video_id);", "public function detailAction()\n {\n $movieId = $this->dispatcher->getParam('id');\n\n $content = $this->api->get(self::API_ROUTE_MOVIE_CRUD . '/' . $movieId);\n\n if($content instanceof AppError) {\n $this->view->setVar('errors', $content->getMessage());\n } else {\n $this->view->setVar('movie', $content->movie);\n $this->view->setVar('genres', $content->genres);\n $this->view->setVar('videos', $content->videos);\n $this->view->setVar('isFavorite', $content->isFavorite);\n }\n }", "public function getById($id)\n {\n $searchUrl = $this->apiUrl.$this->apiKey.\"/movie/\".$id.\"/\";\n $searchResponse = file_get_contents($searchUrl);\n $searchObj = json_decode($searchResponse, true);\n\n return $searchObj;\n }", "public function show($id)\n {\n $movie = Movie::find($id);\n\n if (!$movie) {\n return $this->notFoundResponse( $id );\n }\n\n return $this->successResponse( $movie, 'Retrieved.');\n }", "public static function getImdbId($tmdbId) {\n\n\t\tif(empty($tmdbId)) {\n\t\t\treturn;\n\t\t}\n\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://api.themoviedb.org/3/movie/$tmdbId?api_key=\" . urlencode(TMDB_API_KEY));\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t$json = curl_exec($ch);\n\t\t$error = curl_error($ch);\n\t\tcurl_close($ch);\n\n\t\tif(!empty($error)) {\n\t\t\tUtil::fatal(\"Cannot get imdbId: \" . $error);\n\t\t}\n\n\t\t$data = json_decode($json);\n\t\t$imdbId = $data->imdb_id;\n\n\t\treturn $imdbId;\n\n\t}", "public function search_id($id){\n $imdb_id = urlencode($id);\n $url = 'http://mymovieapi.com/?ids='.$imdb_id.'&type=json&plot=simple&episode=1&lang=en-US&aka=simple&release=simple&business=0&tech=0';\n search_url($url);\n }", "public function show($id)\n {\n $movie = Movie::findOrFail($id);\n return $movie;\n }", "public function get($id) {\n\t\t$sql = <<<SQL\nselect * from $this->tableName\nwhere id=?\nSQL;\n\n\t\t$stmt = $this->pdo()->prepare($sql);\n\t\t$stmt->execute(array($id));\n\n\t\t$movies = array();\n\t\t$row = $stmt->fetch(\\PDO::FETCH_ASSOC);\n\t\tif($row === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn new Movie($row);\n\t}", "public static function getTmdbId($catId, $title) {\n\n\t\tif(empty($catId) || empty($title)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://api.themoviedb.org/3/search/movie?api_key=\" . urlencode(TMDB_API_KEY) . \"&query=\" . urlencode($title));\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t$json = curl_exec($ch);\n\t\t$error = curl_error($ch);\n\t\tcurl_close($ch);\n\n\t\tif(!empty($error)) {\n\t\t\tUtil::fatal(\"Cannot get tmdbId: \" . $error);\n\t\t}\n\t\t\n\t\t$db = new DB();\n\t\t$checkedTmdbIds = $db->selectCheckedTmdbIds($catId);\n\n\t\t$data = json_decode($json);\n\t\t\n\t\tforeach($data->results as $result) {\n\t\t\t$tmdbId = $result->id;\n\t\t\t\n\t\t\tif(!in_array($tmdbId, $checkedTmdbIds) && !$result->adult) {\n\t\t\t\treturn $tmdbId;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public function test_get_movie_by_id()\n {\n $movie = Movie::first();\n\n $this->get( route('v1.movie.show', ['id' => $movie->id ] ) );\n\n $this->response->assertJson([\n 'success' => 'Movie Found'\n ])->assertStatus(200);\n\n }", "public function findById($movieId)\n {\n $result = $this->getSession()->request(\n '/3/movie/'.$movieId\n );\n return $result;\n }", "public function actionView($id)\n\t{\n $model = $this->loadModel($id);\n $apikey = Yii::app()->params['rtApiKey'];\n $query = urlencode($model->title); // make sure to url encode an query parameters\n // construct the query with our apikey and the query we want to make\n $endpoint = 'http://api.rottentomatoes.com/api/public/v1.0/movies/' . $model->rt_id . '.json?apikey=' . $apikey;\n\n // setup curl to make a call to the endpoint\n $session = curl_init($endpoint);\n\n // indicates that we want the response back\n curl_setopt($session, CURLOPT_RETURNTRANSFER, true);\n\n // exec curl and get the data back\n $data = curl_exec($session);\n\n // remember to close the curl session once we are finished retrieveing the data\n curl_close($session);\n\n // decode the json data to make it easier to parse the php\n $movie = json_decode($data);\n \n //if ($movie === NULL)\n //die('Error parsing json');\n \n\t\t$this->render('view',array(\n 'movie'=>$movie,\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}", "public function show($id)\n {\n $movie = Movie::with('genre')->with('reactions')->find($id);\n if (!$movie){\n return response()->json(['error' => \"Movie with id: $id not found\"], 404);\n }\n return response()->json($movie, 200);\n }", "public function setTmdbId($id){$this->tmdbId=$id;}", "public function getById($id)\n {\n return \\App\\Movie::findOrFail($id)->load('genre');\n }", "function gatherMovieInfoFromLocal( $db, $localdbid ) \n\t{\n\t\t$movie = $db->querySingle($select = \"SELECT * FROM movieview WHERE idMovie='\" . $localdbid . \"'\", true);\n\n\t\t$movieinfo['localdbid'] = $localdbid;\n\t\tif ($movie)\n\t\t{\n\t\t\t$movieinfo['filepath'] = $movie['strPath'] . $movie['strFileName'];\n\t\t\t$movieinfo['duration'] = $movie['c11'];\n\t\t\t$movieinfo['title'] = $movie['c00'];\n\t\t\t$movieinfo['imdbid'] = $movie['c09'];\n\t\t\t$movieinfo['original_title'] = $movie['c16'];\n\t\t\t$movieinfo['year'] = $movie['c07'];\n\t\t\t$movieinfo['mpaa'] = $movie['c12'];\n\t\t\t$movieinfo['director'] = $movie['c15'];\n\t\t\t$movieinfo['writers'] = $movie['c06'];\n\t\t\t$movieinfo['tagline'] = $movie['c03'];\n\t\t\t$movieinfo['genres'] = $movie['c14'];\n\t\t\t$movieinfo['overview'] = $movie['c01'];\n\t\t\t$movieinfo['plot'] = $movie['c02'];\n\t\t\t$movieinfo['allthumbs'] = $movie['c08'];\n\t\t\t\n\n\t\t\tif (preg_match('/\\<thumb\\>(?P<thumb>.*)\\<\\/thumb\\>/', $movieinfo['allthumbs'], $matches)) {\n\t\t\t\t$movieinfo['thumb'] = $matches['thumb'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$movieinfo['thumb'] = '';\n\t\t\t}\n\t\n\t\t\t$actors = $db->query(\"SELECT * FROM actorlinkmovie JOIN actors ON actorlinkmovie.idActor=actors.idActor WHERE idMovie='\" . $localdbid . \"'\");\n\t\t\t$movieinfo['actors'] = \"\";\n\t\t\twhile ($actor = $actors->fetchArray()) {\n\t\t\t\tif (!empty($movieinfo['actors'] )) $movieinfo['actors'] .= \" /\\n\";\n\t\t\t\t$movieinfo['actors'] .= $actor['strActor'] . \" AS \" . $actor['strRole'];\n\t\t\t}\n\t\t\t$actors->finalize();\n\t\t}\n\n\n\t\treturn $movieinfo;\n\t}", "public function type_movie_show($type_movie_id = null) {\n // por el metodo de HTTP\n\n if ($type_movie_id == null) {\n show_404();\n }\n\n $type_movie = $this->Type_movie->find($type_movie_id);\n\n if (!is_object($type_movie)) {\n show_404();\n }\n\n $vdata[\"name\"] = $type_movie->name;\n\n // Capa de la Vista\n $view['body'] = $this->load->view(\"core/types_movie/show\", $vdata, TRUE);\n $view['title'] = \"Mostrar película: \" . $type_movie->name;\n $this->parser->parse('core/templates/body', $view);\n }", "public function getDetails($id) {\n $return = null;\n $actor = DB::table('actors')->where('id', $id)->first();\n\n $otherMovies = DB::table('actors')\n ->join('movie_actor', 'actors.id', '=', 'movie_actor.actor_id')\n ->join('movies', 'movie_actor.movie_id', '=', 'movies.id')\n ->where('actors.id', $id)\n ->select('movies.id', 'movies.title')\n ->get();\n\n $budget = DB::table('actors')\n ->join('movie_actor', 'actors.id', '=', 'movie_actor.actor_id')\n ->join('movies', 'movie_actor.movie_id', '=', 'movies.id')\n ->where('actors.id', $id)\n ->select('movies.id', 'movies.title', 'movies.budget')\n ->orderBy('movies.budget', 'desc')\n ->limit(1)\n ->first();\n\n $gross = DB::table('actors')\n ->join('movie_actor', 'actors.id', '=', 'movie_actor.actor_id')\n ->join('movies', 'movie_actor.movie_id', '=', 'movies.id')\n ->where('actors.id', $id)\n ->select('movies.id', 'movies.title', 'movies.gross')\n ->orderBy('movies.gross', 'desc')\n ->limit(1)\n ->first();\n\n $return['db_movies'] = $otherMovies;\n $return['biggest_budget'] = $budget;\n $return['biggest_gross'] = $gross;\n $return['details'] = $actor;\n return json_encode($return);\n }", "public function show($id)\n {\n $movie = Http::get('https://api.themoviedb.org/3/movie/'.$id.'?api_key='.$this->token.'&append_to_response=credits')->json();\n $downloads = Download::with('cloud_storage')->where('id',$id)->get();\n $casts = Http::get('https://api.themoviedb.org/3/movie/'.$id.'?api_key='.$this->token.'&append_to_response=credits')->json()['credits']??'Test';\n $similars = Http::get('https://api.themoviedb.org/3/movie/'.$id.'/similar?api_key='.$this->token)->json()['results'];\n return view('pages/detailscreen',[\n 'movie'=>$movie,\n 'downloads'=>$downloads,\n 'casts'=>$casts,\n 'similars'=>$similars,\n ]);\n }", "public function show($id) {\n return response()->json(Movie::find($id));\n }", "public function show($id)\n {\n $movie = Movie::findOrFail($id);\n\n // $time = $movie->created_at;\n $user_id = Auth::user()->id;\n\n //add detail view if movie is clicked on \n $client = new Client(\"alphafilms-dev\", 'UCNc5SlThIUbZZMP3VCjMa9vhTXb60VpHps9TiBsD3oQXAKfpS1U8ugXEArsYTlR');\n $request = new Reqs\\AddDetailView($user_id, \"$id\", ['cascadeCreate' => true]);\n\n $request->setTimeout(5000);\n $client->send($request);\n\n return view('user.movies.show', [\n 'movie' => $movie\n ]);\n }", "public function show($id)\n {\n return response()->json( movies::findOrFail($id) );\n }", "public function show($id)\n {\n $movie = Movie::findOrFail($id);\n\n $languages = Language::all();\n $categories = Category::all();\n $genres = Genre::all();\n\n return view('movie/detail', ['movie' => $movie, 'languages' => $languages, 'categories' => $categories, 'genres' => $genres]);\n }", "public function show($id)\n {\n \t$movieData = Movie::where('id',$id)->first();\n \tif ($movieData->count() == 0){\n \t\treturn response()->json(\n \t\t\t[\n \t\t\t\t'error' => 'no result'\n \t\t\t]);\n \t}\n \t$mGenres = $movieData->genres->first()->name;\n \t$mActors = $movieData->actors;\n \t$mActorResult = [];\n \tforeach ($mActors as $key => $actor) {\n \t\t$mActorResult[] = $actor->name;\n \t}\n \t$image = File::where([\n \t\t'type' \t=> 'movie',\n \t\t'type_id' \t=> $id\n \t\t])->first();\n \t$mDir = '';\n \tif ($image != null && $image->count()>0){\n $mDir = $image->dir;\n }\n \t$result = [\n \t\t\t'Name' \t\t=> $movieData->name,\n \t\t\t'Genre'\t\t=> $mGenres,\n \t\t\t'Actors' =>$mActorResult,\n \t\t\t'Rating'\t=> $movieData->rate,\n \t\t\t'Description' => $movieData->description,\n \t\t\t'images' \t\t=> $mDir,\n \t\t];\n\n\n return response()->json($result);\n }", "function readFilmById($id){\n\t\t$requete=\"SELECT *\n\t\t FROM film\n\t\t WHERE idFilm=:id\n\t\t LIMIT 1\";\n \ttry {\n\t\t\t/*$select = $this->db->query($requete);\n\t\t\t$result = $select->fetchAll();\n\t\t\treturn $result[0];*/\n\t\t\t$prep=$this->db->prepare($requete);\n \t\t$prep->bindParam(':id',$id,PDO::PARAM_INT);\n \t\t$prep->execute();\n \t\t$result = $prep->fetch();\n\t\t\treturn $result;\n\t\t} catch ( Exception $e ) {\n\t\t\t\techo \"Error method readFilmById : \", $e->getMessage();\n\t\t\t}\n }", "public function show($id)\n {\n try {\n $movie = \\App\\Movie::find($id);\n $movie_genres = $movie->genres;\n $movie_screens = $movie->screens;\n } catch (\\Throwable $th) {\n error_log($th);\n }\n $movie = [\n 'movie'=>$movie,\n 'genres'=>$movie_genres,\n 'screens'=>$movie_screens\n ];\n return $movie;\n }", "function getMovieDB($webtmdb, $mid){\n $url = $webtmdb;\n\n if(!$curld = curl_init()){\n exit;\n }\n curl_setopt($curld, CURLOPT_URL, $url); //loads information from url, in our case a json \n curl_setopt($curld, CURLOPT_RETURNTRANSFER, true); //ends transfer \n $prepros = curl_exec($curld); //executes setopt we set previosly \n curl_close($curld); //close connection \n $json = json_decode($prepros, true); // decode json file we got from API\n //\n /*\n make a table \n original_title - movie name \n https://www.themoviedb.org/t/p/w300_and_h450_bestv2/\".$json['poster_path'] - poster image on a page \n */\n //\n $output = \"<style>th,td{padding: 15px;text-align: left; border-bottom: 1px solid #ddd;}</style><tr><th><a href='tmdb.php/?movieId=\".$mid.\"'>\".$json['original_title'].\"</a></th></tr><tr><img height='200' src='https://www.themoviedb.org/t/p/w300_and_h450_bestv2/\".$json['poster_path'].\"'></tr>\";\n return $output;\n}", "public function getItem($id)\n\t{\n\t if (!$this->isValidID($id)) {\n\t return false;\n\t }\n $this->setBaseUrl(\"http://gdata.youtube.com/feeds/mobile/videos/$id\");\n $this->addFilter('alt', 'jsonc'); //set the output format to json\n $this->addFilter('format', 6); //only return mobile videos\n $this->addFilter('v', 2); // version 2\n\n return $this->getParsedData();\n\t}", "public function search_movie_by_imdb_id($id, $type = 'imdb') {\n $format = variable_get('rottentomatoes_format', '.json');\n $params['type'] = $type;\n $params['id'] = $id;\n return $this->call('movie_alias/' . $format, $params, 'GET');\n }", "public function movieSelectActionGet()\n {\n $title = \"Select a movie\";\n\n //Destroy previous sessions\n $this->app->session->destroy();\n\n // Initiate the session for the game.\n $this->app->session->start();\n\n $this->app->db->connect();\n\n $sql = \"SELECT id, title FROM movie;\";\n $res = $this->app->db->executeFetchAll($sql);\n\n $this->app->page->add(\"movie/movie-select\", [\n \"res\" => $res,\n ]);\n\n if ($this->app->request->getGet(\"showAll\")) {\n $sql = \"SELECT * FROM movie;\";\n $res = $this->app->db->executeFetchAll($sql);\n\n $this->app->page->add(\"movie/show-all\", [\n \"res\" => $res,\n ]);\n }\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }", "function getMovieDetails() {\n\t\t\t$url = \"http://api.brightcove.com/services/library?command=find_video_by_reference_id&media_delivery=http&reference_id=\".$this->getMovieID() .\"&video_fields=name,renditions&token=Ekg-LmhL4QrFPEdtjwJlyX2Zi4l6mgdiPnWGP0bKIyKKT_94PTKHrw..\";\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch,CURLOPT_URL,$url);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\t$jsonResponse = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t\t$result = json_decode($jsonResponse);\n\t\treturn $result->renditions;\n\t}", "public function show($id)\n {\n $film = Film::find($id);\n if($film) {\n return $film;\n } else {\n return response()->json([\n 'status' => false,\n 'message' => 'Hedef film bulunamadı'\n ]);\n }\n }", "public function show(int $id)\n {\n $film = Film::with('comments')->where('id', $id)->first();\n return $this->sendResponse($film, 'Film retrieved successfully.');\n }", "public function find(int $movieId)\n {\n $stmt = $this->db->getPDO()->prepare(\"SELECT * FROM movie WHERE id=?\");\n $stmt->execute([(int) $movieId]);\n if ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n return new Movie($row);\n }\n return null;\n }", "public function show($id)\n {\n $movie = Movie::where('id', $id)->first();\n if ($movie) {\n return new MovieResource($movie);\n }\n return response()->json(['error' => 'movie not found !'], 404);\n }", "public function show($id) {\n\n if (ctype_digit($id)) {\n $id = (int) $id;\n }\n $validationGenre = Genre::validate(array('id' => $id));\n if ($validationGenre !== true) {\n return Jsend::fail($validationGenre);\n }\n if (!Genre::existTechId($id)) {\n return Jsend::error('genre not found');\n }\n\n return Jsend::success(Genre::find($id)->toArray());\n }", "public function get( $id ){}", "public function getDetail($id) {\n\t\t//Argument 1 must be an integer or string\n\t\tEden_Twitter_Error::i()->argument(1,'int', 'string');\t\t\n\t\t\n\t\t//if it is integer\n\t\tif(is_int($id)) {\n\t\t\t//it is user id\n\t\t\t$this->_query['user_id'] = $id;\n\t\t//else it is string\n\t\t} else {\n\t\t\t//it is screen name\n\t\t\t$this->_query['screen_name'] = $id;\n\t\t}\n\t\t\n\t\treturn $this->_getResponse(self::URL_SHOW, $this->_query);\n\t}", "function infoOneMovie ($movieId){\n global $pdo;\n\n $oneMovieInfoSelect = '\n SELECT *\n FROM movie\n INNER JOIN categories ON categories.cat_id = movie.categories_cat_id\n INNER JOIN support ON support.sup_id = movie.support_sup_id\n ';\n\n\n if (!empty($movieId)) {\n $oneMovieInfoSelect .= ' WHERE mov_id = :movieId';\n }\n\n $request = $pdo->prepare($oneMovieInfoSelect);\n\n if (!empty($movieId)) {\n $request->bindValue(':movieId', $movieId, PDO::PARAM_INT);\n }\n\n if ($request->execute() === false ) {\n print_r( $request->errorInfo() );\n } else {\n $oneMovieInfo = $request->fetch(PDO::FETCH_ASSOC);\n return $oneMovieInfo;\n }\n\n return false;\n}", "public function index_get($id = 0)\n\t{\n if(!empty($id)){\n $data = $this->db->get_where(\"mobil\", ['id' => $id])->row_array();\n }else{\n $data = $this->db->get(\"mobil\")->result();\n }\n \n $this->response($data, REST_Controller::HTTP_OK);\n\t}", "public function getItem($id) {\n\t\n $this->setStandardFilters();\n\t //$this->addFilter('command', 'find_video_by_id');\n\t //$this->addFilter('video_id', $id);\n return $this->getParsedData();\n\t}", "public function getMovie($idMovie, $appendToResponse = 'append_to_response=trailers,images,casts,translations'){\n\t\treturn new Movie($this->_call('movie/' . $idMovie, $appendToResponse));\n\t}", "public function show($id)\n {\n return Movies::findOrFail($id);\n }", "public function show($id)\n {\n $movies = movies::where('id', $id)->first();\n return view('moviedetails')->with('movie',$movies);\n }", "public function show($id)\n {\n try {\n $movie = Movie::with(['actors', 'studio'])->find($id);\n if (!$movie) throw new ModelNotFoundException('movie not found');\n return new MovieResource($movie);\n } catch (ModelNotFoundException $exception) {\n return response()->json([\n 'errors' => $exception->getMessage()\n ], 404);\n } catch (Exception $ex) {\n return response()->json([\n 'message' => $ex->getMessage(),\n ], 500);\n }\n }", "public function show($id)\n {\n $movie = Movies::find($id);\n $movie->stars = $movie->stars;\n $movie->genres = $movie->genres;\n $movie->reviews = $movie->reviews;\n return response()->json($movie);\n }", "function getMovieID() {\n\t\treturn $this->_MovieID;\n\t}", "function getMovieID() {\n\t\treturn $this->_MovieID;\n\t}", "public function show($id)\n {\n $actor=Http::withToken(config('services.tmdb.token'))->get('https://api.themoviedb.org/3/person/'.$id)->json();\n $credits=Http::withToken(config('services.tmdb.token'))->get('https://api.themoviedb.org/3/person/'.$id.'/combined_credits')->json();\n \n $data=new ActordataviewMode($actor,$credits);\n \n return view('actorsda',$data);\n \n }", "public function GetMovieDetails(integer $MovieId)\n {\n if (!is_int($MovieId))\n {\n trigger_error('MovieId must be integer', E_USER_NOTICE);\n return false;\n }\n\n $KodiData = new Kodi_RPC_Data(self::$Namespace);\n $KodiData->GetEpisodeDetails(array(\"movieid\" => $MovieId, \"properties\" => static::$MovieItemList));\n $ret = $this->SendDirect($KodiData);\n if (is_null($ret))\n return false;\n return json_decode(json_encode($ret->moviedetails), true);\n }", "public function show($id)\n {\n $movie = DB::select('SELECT * FROM movies WHERE movie_id = ?', [$id]);\n\n return view('moviedetail', ['movie' => $movie[0]]);\n }", "function retrieve_details() {\n\n// 11/25 - this shit needs work...\n \n\t/**\n\t * step 1\n\t * \n\t * retrieve all movies with an imdb_id but no details\n\t */\n\tini_set(\"max_execution_time\", \"300\");\n\t$sql_all = \"SELECT * FROM mr_movie_details WHERE imdb_id > 0 AND date_updated <=> NULL\";\n\t$res_all = mysql_query( $sql_all );\n\n\t// End the script if there are no new movies\n\tif ( mysql_num_rows( $res_all ) > 0 ) {\n\n\t\t/**\n\t\t * step 2\n\t\t *\n\t\t * retrieve all imdb_info and update db\n\t\t */\n\t\n\t\twhile ( $r = mysql_fetch_array( $res_all ) ) {\n\t\n\t\t\t$imdbid = $r['imdb_id'];\n\t\t\t$movie_id = $r['movie_id'];\n\t\t\t$filename = $r['filename'];\n\t\t\n\t\t\t$movie = new imdb( $imdbid );\n\t\t\t$movie->setid( $imdbid );\n\t\t\t\n\t\t\t$title = $movie->title();\n\t\t\t$year = $movie->year();\n\t\t\t$runtime = $movie->runtime();\n\t\t\t$genre = $movie->genre();\n//\t\t\t$genreID \t= get_genre_id( $genre );\n\t\t\t$all_genres = $movie->genres();\n\t\t\t$mpaar \t\t= $movie->mpaa ();\n\t\t\t$tagline\t= $movie->tagline();\n\t\t\t$directors\t= $movie->director();\n\t\t\t$producers\t= $movie->producer();\n\t\t\t$writers\t= $movie->writing();\n\t\t\t$cast\t\t= $movie->cast();\n\t\t\t//$plot \t\t= $movie->plot();\n\t\t\t//$short_plot = substr( $plot[0], 0, 255 );\n\t\t\t\n\n\n\t\t\tif ( strlen( $plot[0] ) > 255 )\n\t\t\t\t$short_plot .= ' [...]';\n\t\t\t\n\t\t\tif ( check_genre( $genre ) == FALSE )\n\t\t\t\tadd_genre( $genre );\n\t\n\t\t\tforeach ( $all_genres as $g ) {\n\t\t\t\tif ( check_genre( $g ) == FALSE )\n\t\t\t\t\tadd_genre( $g );\n\t\n\t\t\t\t// Update movie_genres\n\t\t\t\t$mg_sql = \"INSERT INTO mr_movie_genres (movie_id, genre_id) VALUES \".\n\t\t\t\t\t\" ($movie_id, \". get_genre_id( $g ) .\")\";\n\t\n\t\t\t\t$mg_res = mysql_query( $mg_sql );\n\t\t\t}\n\n/*\n\t\n\t\t\t$theVersion = get_version( substr( $filename, 0, strlen( $filename ) - 4 ) );\n\t\t\t//echo \"Version: $theVersion\";\n\t\t\t//echo $theVersion;\n\t\t\tif ( !check_version( $theVersion ) ) \n\t\t\t\tif ( !add_new_version( $theVersion ) )\n\t\t\t\t\techo \"<p>Couln't add $theVersion version to database.</p>\\n\";\n\t\t\t\t\n\t\t\t$theVersionID = get_version_id( $theVersion );\n*/\t\t\t\n\t\t\t\n// -- THIS NEEDS TO BE EDITED..\n\n\t\t\t$md_sql =\t'UPDATE mr_movie_details SET '.\n\t\t\t\t\t\t' date_updated = NOW(), '.\n\t\t\t\t\t\t' title = '. format_sql( $title ). ', '.\n\t\t\t\t\t\t' year = '. format_sql( $year ). ', '.\n\t\t\t\t\t\t' runtime = '. format_sql( $runtime ). ', '.\n\t\t\t\t\t\t' mpaa_rating = '. format_sql( $mpaar['USA'] ). ', '.\n\t\t\t\t\t\t' tagline = '. format_sql( trim( $tagline ) ) . ' '.\n\t\t\t\t\t\t\" WHERE movie_id = $movie_id LIMIT 1\";\n\n\n\t\t\t$producersSQL = \"INSERT INTO mr_movie_producers (movie_id, producer_id, producer_role) VALUES \";\n\t\t\tfor ( $i = 0; $i < count( $producers ); $i++ ) {\n\t\t\t\t$checkSQL = \"SELECT * FROM mr_producers WHERE producer_name LIKE \". format_sql( trim( $producers[$i]['name'] ), TRUE );\n\t\t\t\t$checkRES = mysql_query( $checkSQL );\n\t\t\t\tif ( mysql_num_rows( $checkRES ) == 0 ) {\n\t\t\t\t\tmysql_query( \"INSERT INTO mr_producers (producer_name) VALUES (\". format_sql( trim( $producers[$i]['name'] ) ) .\")\" );\n\t\t\t\t} else {\n\t\t\t\t\twhile ( $r = mysql_fetch_array( $checkRES ) ) {\n\t\t\t\t\t\t$producer_id = $r['producer_id'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$producersSQL .= \"( $movie_id, $producer_id, \". format_sql( trim( $producers[$i]['role'] ) ) .\"), \";\n\t\t\t}\n\t\t\t$producersSQL = substr( $producersSQL, 0, -2 );\n\t\t\t//echo $producersSQL;\n\t\t\t@mysql_query( $producersSQL );// or die(\"Couldn't add producers! \");\n\n $writersSQL = \"INSERT INTO mr_movie_writers (movie_id, writer_id) VALUES \";\n for ( $i = 0; $i < count( $writers ); $i++ ) {\n $checkSQL = \"SELECT * FROM mr_writers WHERE writer_name LIKE \". format_sql( trim( $writers[$i]['name'] ), TRUE );\n $checkRES = mysql_query( $checkSQL );\n if ( mysql_num_rows( $checkRES ) == 0 ) {\n mysql_query( \"INSERT INTO mr_writers (writer_name) VALUES (\". format_sql( trim( $writers[$i]['name'] ) ) .\")\" );\n } else {\n while ( $r = mysql_fetch_array( $checkRES ) ) {\n $writer_id = $r['writer_id'];\n }\n }\n $writersSQL .= \"( $movie_id, $writer_id ), \";\n }\n $writersSQL = substr( $writersSQL, 0, -2 );\n //echo $writersSQL;\n\t\t\t@mysql_query( $writersSQL );// or die(\"Couldn't add writers!\");\n\n $directorsSQL = \"INSERT INTO mr_movie_directors (movie_id, director_id) VALUES \";\n for ( $i = 0; $i < count( $directors ); $i++ ) {\n $checkSQL = \"SELECT * FROM mr_directors WHERE director_name LIKE \". format_sql( trim( $directors[$i]['name'] ), TRUE );\n $checkRES = mysql_query( $checkSQL );\n if ( mysql_num_rows( $checkRES ) == 0 ) {\n mysql_query( \"INSERT INTO mr_directors (director_name) VALUES (\". format_sql( trim( $directors[$i]['name'] ) ) .\")\" );\n } else {\n while ( $r = mysql_fetch_array( $checkRES ) ) {\n $director_id = $r['director_id'];\n }\n }\n $directorsSQL .= \"( $movie_id, $director_id ), \";\n }\n $directorsSQL = substr( $directorsSQL, 0, -2 );\n //echo $directorsSQL;\n\t\t\t@mysql_query( $directorsSQL );// or die(\"Couldn't add directors!\");\n\n\n $castSQL = \"INSERT INTO mr_movie_actors (movie_id, actor_id, actor_role) VALUES \";\n for ( $i = 0; $i < count( $cast ); $i++ ) { \n $checkSQL = \"SELECT * FROM mr_actors WHERE actor_name LIKE \". format_sql( trim( $cast[$i]['name'] ), TRUE );\n $checkRES = mysql_query( $checkSQL );\n if ( mysql_num_rows( $checkRES ) == 0 ) {\n mysql_query( \"INSERT INTO mr_actors (actor_name) VALUES (\". format_sql( trim( $cast[$i]['name'] ) ) .\")\" );\n } else {\n while ( $r = mysql_fetch_array( $checkRES ) ) {\n $actor_id = $r['actor_id'];\n }\n }\n $castSQL .= \"( $movie_id, $actor_id, \". format_sql( trim( $cast[$i]['role'] ) ) .\"), \";\n }\n $castSQL = substr( $castSQL, 0, -2 );\n //echo $castSQL;\n\t\t\t@mysql_query( $castSQL );// or die(\"Couldn't add cast!\");\n\n\n// directors, writers, cast\n\n\t\n\t\t\t$ratingSQL = \"INSERT INTO mr_movie_ratings (movie_id) VALUES ($movie_id)\";\n\t\t\t$ratingRes = mysql_query( $ratingSQL );\n\t\n\t\t\t$m_sql = \"UPDATE movies SET \".\n\t\t\t\t\" have_details = 'Y', \".\n\t\t\t\t\" version_id = $theVersionID \".\n\t\t\t\t\" WHERE movie_id = $movie_id\";\n\t\n\t\t\t//echo $m_sql;\n\t\t\t\n\t\t\t$md_res = mysql_query( $md_sql );\n//\t\t\t$m_res = mysql_query( $m_sql );\n\t\n\t\t\t$html['msg'] .= \"<div id=\\\"message\\\" class=\\\"updated\\\"><p>Info for <b>$title</b> added to database!</p></div>\\n\";\n\t\n\t\t}\n\t\t\n\t\t$html['main'] .= \"<p>Go <a href=\\\"{$_SERVER['PHP_SELF']}\\\">Home</a>.</p>\\n\";\n\t} else {\n\t\t$html['main'] .= \"<p>There are no movies with IMDB IDs but without details downloaded.</p>\\n\";\n\t}\n\t\n\treturn $html;\n}", "public function get(string $id);", "protected function detail($id)\n {\n $show = new Show(Movie::findOrFail($id));\n\n $show->field('id', __('Id'));\n $show->field('title', __('标题'));\n $show->field('director', __('导演'));\n $show->field('describe', __('Describe'));\n $show->field('rate', __('Rate'));\n $show->field('released', __('Released'));\n $show->field('release_at', __('Release at'));\n $show->field('created_at', __('Created at'));\n $show->field('updated_at', __('Updated at'));\n\n return $show;\n }", "public function get( $id );", "abstract public function retrieve($id);", "public function show($id)\n {\n $movie = Movie::findorFail($id);\n $otherMovie = DB::table('movies')->where('title_categorie', '=', $movie->title_categorie)->limit(5)->get();\n\n return view('movie.show', compact('movie', 'otherMovie'));\n }", "public function show($id)\n {\n $movie = Movie::findOrFail($id);\n return new MovieResource($movie);\n }", "function getSingleMovie($title, $vote_average, $overview, $releaseDate, $genres, $peer_id, $keyboard)\r\n{\r\n $movieGenres = '';\r\n\r\n foreach ($genres as $genre) {\r\n $movieGenres .= localizeGenreID($genre) . ', ';\r\n }\r\n $movieGenres = rtrim($movieGenres, ', ');\r\n if ($overview !== '') {\r\n $message = $title . '<br>' .\r\n 'Жанры: ' . $movieGenres . '<br>' .\r\n 'Оценка: ' . $vote_average . '<br>' .\r\n 'Дата выхода: ' . $releaseDate . '<br>' .\r\n 'Описание: ' . $overview;\r\n } else {\r\n $message = $title . '<br>' .\r\n 'Жанры: ' . $movieGenres . '<br>' .\r\n 'Оценка: ' . $vote_average . '<br>' .\r\n 'Дата выхода: ' . $releaseDate . '<br>';\r\n }\r\n\r\n request($message, $peer_id, $keyboard, '');\r\n}", "public function readProgramDirectorInfo($id, $title)\r\r\n {\r\r\n $query = \"SELECT * FROM \" . $this->table_program_director . \" WHERE Title = '\" . $title . \"' AND University_Id = \" . $id; \r\r\n \r\r\n\t\t$stmt = $this->conn->getData($query);\r\r\n \r\r\n\t\treturn $stmt;\r\r\n }", "public function viewVideoById($id)\n {\n try {\n $video=VideoContent::where('ID',(int) $id)->first();\n\n if (!empty($video)) {\n $response = APIResponse('200', 'Success', $video);\n } else {\n $response = APIResponse('201', 'No video found.');\n } \n } catch (\\Throwable $e) {\n $response = APIResponse('201', $e->getMessage());\n }\n \n return $response;\n }", "public function getModelsFromMoviesID($movieID) {\n $sampleSQL= \"SELECT * FROM `movies_models`\n WHERE movieID IN (12297, 12298, 12299) ;\";\n return \"{$movieID},\";\n }", "function gatherMovieInfoFromPost( $params ) \n\t{\n\t\tif (!empty($params['localdbid']))\n\t\t\t$movieinfo['localdbid'] = $params['localdbid'];\n\t\t$movieinfo['filepath'] = $params['filepath'];\n\t\t$movieinfo['duration'] = $params['duration'];\n\t\t$movieinfo['title'] = $params['title'];\n\t\t$movieinfo['imdbid'] = $params['imdbid'];\n\t\t$movieinfo['original_title'] = $params['original_title'];\n\t\t$movieinfo['year'] = $params['year'];\n\t\t$movieinfo['mpaa'] = $params['mpaa'];\n\t\t$movieinfo['director'] = $params['director'];\n\t\t$movieinfo['writers'] = $params['writers'];\n\t\t$movieinfo['tagline'] = $params['tagline'];\n\t\t$movieinfo['genres'] = $params['genres'];\n\t\t$movieinfo['overview'] = $params['overview'];\n\t\t$movieinfo['plot'] = $params['overview'];\n\t\t$movieinfo['actors'] = $params['actors'];\n\t\t$movieinfo['thumb'] = isset($params['thumb']) ? urldecode($params['thumb']) : '';\n\t\t$movieinfo['allthumbs'] = urldecode($params['allthumbs']);\n\n\t\treturn $movieinfo;\n\t}", "public function show($id)\n {\n $movie = Movie::findOrFail($id); \n\n return view('movie.show')->with('movie', $movie); \n }", "public function show(Request $request, $id)\n {\n $movie = Movie::find($id); \n return $movie;\n }", "public function getVideoDetails($id) {\n\t\t$conn\t\t\t= $this->connect();\n\t\t$collection\t\t= $conn->snapstate->media;\n\t\t$userSession\t= new Container('fo_user');\n\t\t$results\t\t= $collection->find(array('_id' => new \\MongoID(trim($id))));\n\t\t$resultArray\t= array();\n\t\twhile($results->hasNext())\t{\n\t\t\t$resultArray\t= $results->getNext();\n\t\t}\n\t\treturn $resultArray;\n\t}", "public function show($id)\n\t{\n if(isset($name)){\n $search_url = \"search?part=snippet&q={$name}&order=relevance&type=video&videoDefinition=high&videoEmbeddable=true&key={$this->api_key}\";\n $client = new Client($this->base_url);\n $request = $client->get($search_url);\n $response = $request->send();\n $videos = $response->json();\n $video_items = $videos[\"items\"];\n\n $formatted_response = array();\n foreach($video_items as $video_item){\n $video = new Video;\n $video->url = \"https://www.youtube.com/watch?v=\".$video_item[\"id\"][\"videoId\"];\n $video->name = $video_item[\"snippet\"][\"title\"];\n $video->picture= $video_item[\"snippet\"][\"thumbnails\"][\"high\"][\"url\"];\n $video->type= \"youtube\";\n $video->id = $video_item[\"id\"][\"videoId\"];\n array_push($formatted_response, $video->toArray());\n }\n return Response::json(array('videos' => $formatted_response),200);\n }\n else{\n return Response::json(array('message' => 'bad request, you must pass a name valid key in query string'), 404);\n }\n\t}", "function get(string $id);", "public function search_movie_by_rotten_id($rotten_id) {\n $format = variable_get('rottentomatoes_format', '.json');\n $params = '';\n return $this->call('movies/' . $rotten_id . $format, $params, 'GET');\n }", "public function show($id)\n {\n return view('movie.show', [\n 'movie' => $this->movie->acquisitionMovieInfomation($id),\n ]);\n }", "static function show($id)\n {\n $respuestaBLL = new respuestaBLL();\n $objRespuesta = $respuestaBLL->select($id);\n if ($objRespuesta == null) {\n http_response_code(404);\n return;\n }\n echo json_encode($objRespuesta);\n }", "public function show($id)\n {\n $mv = MvComptable::where('user_id',Auth::user()->c_id)->find($id);\n\n if (is_null($mv)) {\n return $this->sendError(\"mv not exist\");\n }\n\n $bilans = Bilan::where('mv_id',$id)->get();\n if ($bilans->count() === null ) {\n return $this->sendError(\"no results found\");\n }\n return response(['mv'=> $mv,'bilans'=>$bilans, 'message'=>'get data successfully']);\n }", "public function getVideo($id)\n {\n return $this->request->request(self::URI_VIDEO . $id);\n }", "function getDetailsByXSDMF_ID($xsdmf_id)\r\n {\r\n $log = FezLog::get();\r\n $db = DB_API::get();\r\n\r\n $stmt = \"SELECT\r\n s1.*\r\n FROM\r\n \" . APP_TABLE_PREFIX . \"search_key as s1\r\n inner join \" . APP_TABLE_PREFIX . \"xsd_display_matchfields as x1\r\n on xsdmf_sek_id=sek_id\r\n WHERE\r\n xsdmf_id=\" . $db->quote($xsdmf_id, 'INTEGER');\r\n\r\n try {\r\n $res = $db->fetchRow($stmt, array(), Zend_Db::FETCH_ASSOC);\r\n }\r\n catch (Exception $ex) {\r\n $log->err($ex);\r\n return '';\r\n }\r\n if ($res['sek_id']) {\r\n $res['sek_title_db'] = Search_Key::makeSQLTableName($res['sek_title']);\r\n }\r\n return $res;\r\n }", "public function show($id)\n {\n $item = Film::find($id);\n return response()->json($item);\n }", "public function show($id)\n {\n $evnmtdtl = Evnmtdtl::find($id);\n\n if (is_null($evnmtdtl)) {\n return $this->sendError('detail non trouve.');\n }\n return $evnmtdtl;\n }", "public function checkTMDbId($mID) {\n $query = \"SELECT tmdb_id FROM movies WHERE tmdb_id = :tmdb\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindValue(\":tmdb\", $mID);\n $stmt->execute();\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\n if ($result) {\n return true;\n } else {\n return false;\n }\n }", "protected function detail($id)\n {\n $video = VideoModel::findOrFail($id);\n\n $show = new Show($video);\n\n $show->id('ID');\n $show->title('标题');\n\n $show->template_id('转码模板')->as(function ($template_id){\n $roles = json_decode(\\Admin::user()->roles, true)[0];\n $template_group = TranscodeModel::getTemplateGroupInfo($roles[\"template_group\"]);\n return @$template_group[$template_id]? : \"\";\n });\n\n $show->status('转码状态')->as(function ($status){\n return config('transcode')['code'][$status];\n });\n\n $show->taskid('taskid');\n\n if(intval($video->status) === config('transcode')[\"status\"][\"upload\"]){\n $show->filename('预览')->unescape()->as(function ($filename){\n return VideoModel::preview($filename);\n });\n }\n\n $show->created_at('创建时间');\n\n\n $show->panel()->tools(function ($tools) {\n $tools->disableEdit();\n $tools->disableList();\n $tools->disableDelete();\n });\n\n return $show;\n }", "public function show($id)\n {\n return view('movie::show');\n }", "public function get($id) {\n\t}", "public function getVideoInfoWithoutAPI($id)\n {\n $url = 'https://twitter.com/x/status/' . $id;\n\n /* Grab video page */\n $response = VideoPlatformsParser::HTTPGet($url);\n\n /* Make HTML DOM from response */\n $dom = new DOMDocument();\n libxml_use_internal_errors(true); // ignore errors in html on website\n $dom->loadHTML($response);\n\n /* Parse data */\n $return = [];\n $metas = $dom->getElementsByTagName('meta');\n for ($i = 0; $i < $metas->length; $i++) { // check all meta tags\n $meta = $metas->item($i);\n if ($meta->getAttribute('property') == 'og:title') {\n $return['title'] = $meta->getAttribute('content');\n } else if ($meta->getAttribute('property') == 'og:description') {\n $return['description'] = $meta->getAttribute('content');\n } else if ($meta->getAttribute('property') == 'og:image') {\n $return['thumbnail'] = $meta->getAttribute('content');\n } else if ($meta->getAttribute('name') == 'keywords') {\n $return['tags'] = $meta->getAttribute('content');\n $return['tags'] = explode(',', $return['tags']);\n $return['tags'] = array_map('trim', $return['tags']); // remove spaces\n }\n }\n\n return $return;\n }", "function get_movies(){\n $ch = curl_init();\n $url = $GLOBALS['App-Logic'].\"?\" .http_build_query([\n 'get_movies' => true, //a flag to execute the right code in App-Logic! \n ]);\n\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPGET, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);\n \n $response = curl_exec($ch);\n curl_close($ch);\n\n return json_decode($response,true);\n\n }", "abstract public function get($id);", "abstract public function get($id);", "abstract public function get($id);", "public function retrieve($id) {\n $ret = $this->queryNetForum(array('cstkey' => $id));\n \n if(empty($ret)) {\n throw new InvalidArgumentException(_txt('er.id.unk-a', array($id)));\n }\n \n // The returned value should always be keyed on the ID we sent\n return $ret[$id];\n }", "public function retrieve(int $id);", "function getById($id){\n require './../dbconnect.php';\n $query = \"call sp_multmedia_by_id($id);\";\n\n if (!($sentence = $conn->prepare($query)))\n {\n $conn->close();\n die(\"Multimedia Agregar: Fallo la preparacion del query\");\n }\n\n if(!$sentence->execute()){\n $conn->close();\n die(\"Multimedia Agregar: Fallo la ejecucion del query\");\n }\n\n if($result = $sentence->get_result()){\n if($row = $result->fetch_assoc()){\n header(\"Content-type: \".$row['Tipo']);\n echo $row['Contenido'];\n $result->free();\n }\n }\n $conn->close();\n }" ]
[ "0.67438483", "0.66179496", "0.64987767", "0.64970744", "0.64764637", "0.64659", "0.6397904", "0.63852274", "0.62844557", "0.62835896", "0.6255243", "0.6211115", "0.61972845", "0.6171528", "0.61424303", "0.6119006", "0.60897785", "0.60830015", "0.6071513", "0.6030394", "0.60198236", "0.60016495", "0.6001281", "0.5994157", "0.5992037", "0.5990808", "0.59758687", "0.5956391", "0.59485376", "0.59293884", "0.59148616", "0.5906196", "0.58895195", "0.5884323", "0.5859057", "0.5858147", "0.58272076", "0.5814953", "0.5813861", "0.57688314", "0.5753269", "0.5741648", "0.57118624", "0.5696219", "0.56805325", "0.56788594", "0.5663314", "0.56595606", "0.5654249", "0.5651441", "0.5648993", "0.5620632", "0.56071556", "0.55949473", "0.5565244", "0.5555959", "0.55557024", "0.55382335", "0.55266714", "0.55266714", "0.55266154", "0.5521434", "0.5521433", "0.5495399", "0.5486944", "0.54770696", "0.54610765", "0.54497695", "0.54422724", "0.5439029", "0.54369414", "0.54315174", "0.5425642", "0.5416135", "0.5410991", "0.5407204", "0.5404681", "0.5402308", "0.5387226", "0.5373018", "0.5353358", "0.5349852", "0.53471696", "0.53467137", "0.53420115", "0.53163207", "0.53159344", "0.5314729", "0.5294285", "0.5293177", "0.52883154", "0.5272905", "0.526018", "0.5259132", "0.5255705", "0.5255705", "0.5255705", "0.52480006", "0.5243065", "0.52421343" ]
0.66470635
1
Retrieves the search results from TMDb based on a given term. A future improvement could consist on error checking from a valid TMDb response, for better handling in frontend. Another future improvement could consist on page number validation, based on "total_pages" result key. An adult filter based on user data from backend could also be done, as language selection for results.
public function retrieveSearch($args=[]){ #Page argument: if not set, fallback to 1 (default) $page = $args["page"] ?? 1; #Search terms argument: if not set, fallback to empty string $terms = $args["terms"] ?? ''; #If no term given, return error if(!$terms) return ["success" => 0, "msg" => "Empty search term"]; #Prepare terms (URI-encoded) $terms = urlencode($terms); #Define the URL based on api documentation (https://developers.themoviedb.org/3/search/search-movies) $url = "https://api.themoviedb.org/3/search/movie?api_key={$this->apiKey}&language={$this->requestLang}&page={$page}&include_adult=true&query={$terms}"; #Instantiate a new HTTP handler class $HttpHandler = new HttpHandler(); #Retrieve raw output from the HTTP handler over the URL $outputRaw = $HttpHandler->execGET($url); #Bypass the consumed output return $this->consumeRawOutput($outputRaw); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function search($search_term = \"\"){\r\n\t\tif($search_term != \"\"){\r\n\t\t\t$req = $this->config->getDomain() . \"Search\";\r\n\t\t\t$req .= \"?search_term=\" . $search_term;\r\n\t\t\t$req .= \"&dataType=\" . $this->config->getDataType();\r\n\t\t\t$resp = $this->helper->curlGet($req);\r\n\t\t\t$resultsArray = array();\r\n\t\t\tforeach (json_decode($resp) as $obj){\r\n\t\t\t\t$searchResult = new CurtSearchResult;\r\n\t\t\t\t$sR = $searchResult->castToSearchResult($obj);\r\n\t\t\t\tarray_push($resultsArray, $sR);\r\n\t\t\t}\r\n\t\t\treturn $resultsArray;\r\n\t\t} // end if\r\n\t}", "public function search($term = null);", "public function getAll($searchTerm);", "public function search($term)\n {\n try {\n $list = (self::MODEL)\n ::with('enderecos')\n ->where('nome', 'LIKE', \"%{$term}%\")\n ->orWhere('taxvat', 'LIKE', \"%{$term}%\")\n ->get();\n\n return $this->listResponse(ClientTransformer::directSearch($list));\n } catch (\\Exception $exception) {\n return $this->listResponse([]);\n }\n }", "public function findWithCustomQuery($_locale, $searchTerm, $range, $page, $fdcYear = false)\n {\n $finalQuery = new \\Elastica\\Query\\BoolQuery();\n\n if(!is_array($searchTerm)) {\n $searchTerm = array('search' => $searchTerm);\n }\n\n if(!empty($searchTerm['search'])) {\n $stringQuery = new \\Elastica\\Query\\BoolQuery();\n\n $stringQuery\n ->addMust($this->getFieldsQuery($searchTerm['search']))\n //->addShould($this->getFilmsQuery($_locale, $searchTerm, $fdcYear))\n ;\n\n $finalQuery->addMust($stringQuery);\n }\n\n if(isset($searchTerm['professions']) && $searchTerm['professions']) {\n foreach($searchTerm['professions'] as $profession) {\n $finalQuery->addShould($this->getLocalizedFieldsQuery('fr', $profession)); //comparison done with 'fr'\n }\n }\n \n if(isset($searchTerm['genres']) && $searchTerm['genres']) {\n foreach($searchTerm['genres'] as $genre) {\n $finalQuery->addMust($this->getLocalizedGenderFieldsQuery('fr', $genre)); //comparison done with 'fr'\n }\n }\n\n $sortedQuery = new \\Elastica\\Query();\n $sortedQuery\n ->setMinScore(1)\n ->setQuery($finalQuery)\n ->addSort('_score')\n ->addSort(array('firstname' => array('order' => 'asc')))\n ;\n \n $paginatedResults = $this->getPaginatedResults($sortedQuery, $range, $page);\n\n return array(\n 'items' => $paginatedResults->getCurrentPageResults(),\n 'count' => $paginatedResults->getNbResults()\n );\n }", "public function search_result(string $term)\n {\n # select table to count data\n $query = \"SELECT\n (SELECT COUNT(*) FROM news WHERE title LIKE '%{$term}%') as news,\n (SELECT COUNT(*) FROM accounts WHERE username LIKE '%{$term}%' OR email LIKE '%{$term}%') as accounts,\n (SELECT COUNT(*) FROM blog WHERE title LIKE '%{$term}%') as blog,\n (SELECT COUNT(*) FROM contect WHERE seen = 0) as message\n FROM DUAL\";\n # use fake table (use count table)\n return $this->db->query($query)->result_array()[0];\n }", "public function getresults($searchterm)\n {\n $searchTerm = db::escapechars(trim($searchterm));\n \n // Check if there is a campus lock\n $campus = $this->checkCampus();\n if($campus == 'true')\n {\n // Access to all campuses\n $campuslock = '';\n }\n else{\n if($campus == 'false'){\n // No access to search results - no campus specified\n return;\n }\n else{\n $campuslock = $campus; \n }\n }\n // Get the results from the system and display the output\n if(!is_null($searchTerm)){\n $this->findhelp($searchTerm, $campuslock);\n $this->findmembers($searchTerm, $campuslock);\n $this->findgroup($searchTerm, $campuslock);\n $this->findmessages($searchTerm);\n $this->findreminders($searchTerm);\n }\n else{\n print \"<p>No search term provided</p>\";\n }\n \n return;\n }", "public function basicSearch($term)\n {\n return $this->client->search([\n 'index' => $this->index,\n 'type' => $this->type,\n 'body' => [\n 'query' => [\n 'query_string' => [\n 'query' => $term\n ]\n ]\n ]\n ]);\n }", "public function findBySearchTerm($query, $term = '', $facetConfiguration = [], $searchConfiguration = []);", "function search($query, $year=NULL, $page_limit=5, $page=NULL) {\n\t\t\n\t\t$args = array (\n\t\t\t\"q\" => $query,\n\t\t\t\"year\" => (int)$year,\n\t\t\t\"page_limit\" => $page_limit,\n\t\t\t\"page\" => $page\n\t\t);\n\t\t\n\t\t$json = $this->request(self::API_URL_TMPL_SEARCH, array(\n\t\t\t\"query-args\" => $this->collapse_args($args)\n\t\t));\n\t\t\n\t\tif(isset($json->total)) {\n\t\t\t\n\t\t\tif($json->total > 0) {\n\t\t\t\t\n\t\t\t\treturn new rt_search_result($json);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\treturn array();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\treturn NULL;\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function search($term, $returnObject = false) {\n\t\t///implicitly remove error reporting can be changed to 1 to turn on\n\t\terror_reporting(0);\n\n\t\t$data = \"\";\n\t\t$dataObj = null;\n\n\t\t// check the cache to save a remote request\n\t\t$cachedResult = $this->_getCache($term);\n\t\t// anything?\n\t\tif ($cachedResult === false) {\n\t\t\t// no cache. let's ask for help\n\t\t\t\n\t\t\t// we'll attempt to search on each of these fields\n\t\t\t$searchAttempts = array('openfda.brand_name', 'openfda.generic_name');\n\t\t\tforeach ($searchAttempts as $search) {\n\t\t\t\t// grab the search results\n\t\t\t\t$data = file_get_contents(\"https://api.fda.gov/drug/label.json?api_key=TwOhEwWWk1eGlkFl8n1HHCn93bmJity6AZbQGHpj&search={$search}:\\\"{$term}\\\"\");\n\t\t\t\t// grab the object from the JSON response\n\t\t\t\t$dataObj = json_decode($data);\n\n\t\t\t\t// have we encountered an error?\n\t\t\t\tif (!isset($dataObj->error)) {\n\t\t\t\t\t// nope. use what we've got\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_setCache($term, $data);\n\t\t}\n\t\telse {\n\t\t\t// cache hit. use it\n\t\t\t$data = $cachedResult;\n\t\t\t$dataObj = json_decode($data);\n\t\t}\n\n\t\treturn $returnObject ? $dataObj : $data;\n\t}", "public function findBySearchTerm($searchterm = '') {\n\n\t\t\t// create the query object\n\t\t$query = $this->createQuery();\n\n\t\t\t// break up the searchterm into searchwords\n\t\t$searchwords = Tx_Catalogueraisonne_Utility_Search::wordSplit($searchterm);\n\n\t\t\t// create constraints if multiple searchwords\n\t\tif (count($searchwords) > 0) {\n\t\t\tforeach ($searchwords as $searchword) {\n\t\t\t\t$searchword = '%' . $searchword. '%';\n\t\t\t\t$autConstraints[] = $query->like('aut', $searchword);\n\t\t\t\t$titelConstraints[] = $query->like('titel', $searchword);\n\t\t\t\t$seriesConstraints[] = $query->like('series', $searchword);\n\t\t\t}\n\t\t\t$query->matching(\n\t\t\t\t$query-> logicalOr(\n\t\t\t\t\t$query->logicalAnd($autConstraints),\n\t\t\t\t\t$query->logicalAnd($titelConstraints),\n\t\t\t\t\t$query->logicalAnd($seriesConstraints)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t\t// result order\n\t\t$query->setOrderings(\n\t\t\tarray('aut' => Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING),\n\t\t\tarray('titel' => Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING)\n\t\t);\n\n\t\t\t// go\n\t\treturn $query->execute();\n\t}", "public function searchByTerm($term)\n {\n //objet qui permet de crée des requete SQL pour une table donné\n $queryBuilder = $this->createQueryBuilder('article');\n\n // requete sql mais en language PHP qui permet d'aller dans article et de chercher ce qu'on veux en fonction de term\n $query = $queryBuilder\n ->select('article')\n\n ->where('article.content LIKE :term')\n ->setParameter('term', '%'.$term.'%')\n\n //transforme la sorte de requette sql en vrai requette sql\n ->getQuery();\n\n return $query->getResult();\n }", "function doSearch($searchTerm) {\n\t\tif (strlen($searchTerm) > 0) {\t\t\n\t\t\t$link = getDbConnect();\n\t\t\t$preparedStatement = $link->prepare(\"SELECT * FROM urls WHERE url LIKE :searchTerm OR title LIKE :searchTerm OR ip LIKE :searchTerm ORDER BY id DESC LIMIT 50;\");\n\t\t\t$preparedStatement->execute(array(\":searchTerm\" => \"%$searchTerm%\"));\n\t\t\tcheckForDbError($preparedStatement);\n\t\t\treturn parseFullResults($preparedStatement->fetchAll());\n\t\t} else {\n\t\t\treturn getRecents();\n\t\t}\n\t}", "function get_search($word, $searchTerm, $pageItem = 50, $pageNo = 1){\n\t\t// do nothing...\n\n\t\t// have the link of the search as a variable with the query at the end of it\n\t\t$url = \"https://thesession.org/\".$word.\"/search?q=\".$searchTerm.\"&format=json&perpage=\".$pageItem.\"&page=\".$pageNo;\n\n\t\t// put in the curl function\n\t\t$ch = curl_init($url);\n\n\t\t// create an array for the data to be pulled into\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json;', 'Content-Type: application/json'));\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\n\t\t// save response to variable\n\t\t$response = curl_exec($ch);\n\n\t\tif(empty($response)) {\n\t\t\t\t$error = curl_error($ch);\n\t\t //$error now contains the error thrown when curl_exec failed to execute\n\t\t echo $error;\n\t\t} else {\n\n\t\t\t\t//prints out the JSON for the new tunes for the session API\n\t\t\t\t$res = $response;\n\n\t\t\t\t// return JSON object;\n\t\t\t\treturn $res;\n\t\t} \n\n\t}", "public function search( $query, $wordSearch = true, $categorySearch = true, $exact = false, $sortType = 'instanceCount', $includePages = false, $offset = 0, $limit = 100 ){ return $this->APICallSub( '/ul', array( 'search' => $query, 'wordSearch' => $wordSearch, 'categorySearch' => $categorySearch, 'sortType' => $sortType, 'exact' => $exact, 'includePages' => $includePages, 'offset' => $offset, 'limit' => $limit ), \"Could not perform Ultralink search\" ); }", "public static function search($term)\n {\n $sql = \"\n SELECT p.uri as uri, p.name as name, e.data as data\n FROM tbl_element AS e\n INNER JOIN tbl_article AS a ON e.article_id = a.id\n INNER JOIN tbl_page AS p ON a.parent_id = p.id\n WHERE e.data LIKE '%{$term}%'\n \";\n\n foreach ($this->_db->fetchAll($sql) as $result) {\n $result['data'] = unserialize($result['data']);\n }\n\n return isset($result) ? $result : false;\n }", "private function get_results() {\n $cache = new SearchCache();\n\n if ($this->cache and $cache->can_cache()) {\n if (!($resultdocs = $cache->cache($this->term))) {\n $resultdocs = $this->process_results();\n //cache the results so we don't have to compute this on every page-load\n $cache->cache($this->term, $resultdocs);\n //print \"Using new results.\";\n } else {\n //There was something in the cache, so we're using that to save time\n //print \"Using cached results.\";\n } \n } else {\n //no caching :(\n //print \"Caching disabled!\";\n $resultdocs = $this->process_results();\n } \n return $resultdocs;\n }", "public static function requestSearchResults($searchTerm)\n\t{\n\t\treturn UserModel::getSearchResults($searchTerm);\n\t}", "public function searchTerm ($theme, $term){\n $json = new JsonFile ($this->host . '/api/'.$theme.'/key/' . $term);\n $json->parse();\n \n return $json;\n }", "public function find($page, $limit, $term);", "public function find($page, $limit, $term);", "function search($term, $location) {\r\n $url_params = array();\r\n \r\n $url_params['term'] = $term;\r\n $url_params['location'] = $location;\r\n $url_params['limit'] = $GLOBALS['SEARCH_LIMIT'];\r\n \r\n return request($GLOBALS['API_HOST'], $GLOBALS['SEARCH_PATH'], $url_params);\r\n }", "public function set_query($term = '') {\n if (!empty($term)) {\n $this->term = $term;\n }\n\n if (empty($this->term)) {\n $this->validquery = false;\n } else {\n $this->validquery = true;\n }\n\n if ($this->validquery and $this->validindex) {\n $this->results = $this->get_results();\n } else {\n $this->results = array();\n }\n }", "public function search($term = '', $andor = 'AND', $limit = 0, $offset = 0, $userid = 0)\n {\n return false;\n }", "function search($term, $location, $price, $radius, $categories, $sort) {\n $url_params = array();\n \n $url_params['term'] = $term;\n $url_params['location'] = $location;\n $url_params['limit'] = $GLOBALS['SEARCH_LIMIT'];\n\t$url_params['open_now'] = true;\n $url_params['price'] = $price;\n $url_params['radius'] = $radius;\n $url_params['categories'] = $categories;\n $url_params['sort_by'] = $sort;\n \n return request($GLOBALS['API_HOST'], $GLOBALS['SEARCH_PATH'], $url_params);\n}", "function query_api($term, $location) {\r\n $response = json_decode(search($term, $location));\r\n $business_id = $response->businesses[0]->id;\r\n /* \r\n print sprintf(\r\n \"%d local businesses found, querying business info for the top result \\\"%s\\\"\\n\\n <br>\",\r\n count($response->businesses),\r\n $business_id\r\n );\r\n */ \r\n $response = get_business($business_id);\r\n \r\n print sprintf(\"Result for business \\\"%s\\\" found:\\n\", $business_id);\r\n $pretty_response = json_encode(json_decode($response), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\r\n print \"$pretty_response\\n\";\r\n\r\n return json_decode($response, true);\r\n }", "function listAllWithSearch($term) \r\n {\r\n\r\n $newTerm = \"%\".$term.\"%\";\r\n\r\n //new PDOAgent\r\n $p = new PDOAgent(\"mysql\", DB_USER, DB_PASS, DB_HOST, DB_NAME);\r\n\r\n //Connect to the Database\r\n $p->connect();\r\n\r\n //Setup the Bind Parameters\r\n $bindParams = [\"term\"=>$newTerm];\r\n \r\n //Get the results of the insert query (rows inserted)\r\n $results = $p->query(\"SELECT * FROM Coaches WHERE coachFName LIKE :term OR\r\n coachLName LIKE :term OR salary LIKE :term OR teamName LIKE :term \r\n OR dateStarted LIKE :term OR endOfContract LIKE :term;\", $bindParams);\r\n \r\n //Disconnect from the database\r\n $p->disconnect();\r\n \r\n //Return the objects\r\n return $results;\r\n }", "public function query($term) {\n $matches = $this->getMatchesService('vienna',$term,array('showSyn'=>false,'NearMatch'=>false,'includeCommonNames'=>true));\n return $matches;\n }", "public function search($searchTerm)\n {\n $results = array(\n 'snippet' => [],\n 'snippet_code' => [],\n 'page' => [],\n 'product' => [],\n 'actions' => [],\n 'word' => [],\n 'post' => []\n );\n\n $snippets = Yii::$app->user->identity->portal->hasMany(Snippet::className(), ['id' => 'snippet_id'])\n ->viaTable('snippet_portal', ['portal_id' => 'id'])\n ->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'description', $searchTerm],\n ])\n ->limit(10)\n ->all();\n\n foreach ($snippets as $snippet) {\n $results['snippet'][] = [\n 'link' => Url::to([\n '/snippet/edit',\n 'id' => $snippet->id\n ]),\n 'name' => $snippet->name,\n 'id' => $snippet->id,\n 'class' => 'suggest-snippet'\n ];\n }\n\n // SNIPPET CODES / ALTERNATIVES\n\n /** @var SnippetCode[] $snippet_codes */\n $snippet_codes = SnippetCode::find()\n ->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'code', $searchTerm]\n ])\n ->limit(10)\n ->all();\n\n foreach ($snippet_codes as $snippet_code) {\n $results['snippet_code'][] = [\n 'link' => Url::to([\n '/snippet/edit',\n 'id' => $snippet_code['snippet_id'],\n '#' => 'code' . $snippet_code['id'],\n ]),\n 'name' => $snippet_code->getSnippet()->one()->name . ' -> ' . $snippet_code->name,\n 'id' => $snippet_code->id,\n 'class' => 'suggest-snippet-code'\n ];\n }\n\n // Slovnik\n $words = (new Query())->select(\"id, identifier\")->from(\"word\")->where(['like', 'identifier', $searchTerm])\n ->limit(10)->all();\n\n foreach ($words as $word) {\n $results['word'][] = [\n 'link' => Url::to([\n '/word/edit',\n 'id' => $word['id']\n ]),\n 'name' => $word['identifier'],\n 'id' => $word['id'],\n 'class' => 'suggest-word'\n ];\n }\n\n // PAGES\n\n $pages = Page::find()->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'identifier', $searchTerm],\n ['like', 'title', $searchTerm],\n ])\n ->andWhere([\n 'portal_id' => Yii::$app->user->identity->portal_id\n ])\n ->limit(10)\n ->all();\n\n foreach ($pages as $page) {\n $results['page'][] = [\n 'link' => Url::to(['/page/edit', 'id' => $page['id']]),\n 'id' => $page->id,\n 'name' => $page->breadcrumbs,\n 'class' => 'suggest-page'\n ];\n }\n\n // POSTS\n\n $posts = Post::find()->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'identifier', $searchTerm],\n ['like', 'title', $searchTerm],\n ])\n ->andWhere([\n 'portal_id' => Yii::$app->user->identity->portal_id\n ])\n ->limit(10)\n ->all();\n\n foreach ($posts as $post) {\n $results['post'][] = [\n 'link' => Url::to(['/post/edit', 'id' => $post['id']]),\n 'id' => $post->id,\n 'name' => $post->name,\n 'class' => 'suggest-post'\n ];\n }\n\n // PRODUCTS\n\n $products = Product::find()\n ->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'identifier', $searchTerm],\n ])\n ->andWhere([\n 'language_id' => Yii::$app->user->identity->portal->language_id\n ])\n ->limit(10)\n ->all();\n\n foreach ($products as $product) {\n $results['product'][] = [\n 'link' => Url::to([\n '/product/edit',\n 'id' => $product['id']\n ]),\n 'name' => $product->breadcrumbs,\n 'id' => $product->id,\n 'class' => 'suggest-product'\n ];\n }\n\n $processActions = function ($searchTerm, $list, $prefix, $urlSuffix = '') {\n $actions = [];\n foreach ($list as $item) {\n $name = $prefix . $item[0];\n\n if ($searchTerm == '' || (mb_strlen($name) >= mb_strlen($searchTerm) && mb_substr(mb_strtolower($name), 0, mb_strlen($searchTerm)) == mb_strtolower($searchTerm))) {\n $actions[] = [\n 'link' => Url::to([\n '/' . $item[1] . '/' . $urlSuffix,\n ]),\n 'name' => $name,\n 'class' => 'suggest-action'\n ];\n }\n };\n return $actions;\n };\n\n $listActions = [['stránok', 'page'], ['ďakovačiek', 'thanks'], ['prekladov', 'word'], ['multimédii', 'multimedia'], ['snippetov', 'snippet'], ['produktov', 'product'], ['produktových premenných', 'product-var'], ['typov produktu', 'product-type'], ['tagov', 'tag'], ['šablón', 'template'], ['portálov', 'portal'], ['používateľov', 'user'], ['krajín', 'language']];\n $addActions = [['stránku', 'page'], ['ďakovačku', 'thanks'], ['preklad', 'word'], ['snippet', 'snippet'], ['produkt', 'product'], ['produktovú premennú', 'product-var'], ['typ produktu', 'product-type'], ['tag', 'tag'], ['šablónu', 'template'], ['portál', 'portal'], ['používateľa', 'user'], ['krajinu', 'language']];\n\n $results['actions'] += $processActions($searchTerm, $listActions, 'Zoznam ');\n $results['actions'] += $processActions($searchTerm, $addActions, 'Pridať ', 'edit');\n\n return $results;\n }", "function ml_wpsearch_search($querytext)\n{\n $querytext = trim($querytext);\n if (!$querytext) {\n return [null, null, null];\n }\n\n $results = ml_wpsearch_search_query($querytext, array(\n 'start' => isset($_REQUEST['start']) ? $_REQUEST['start'] : 1,\n 'pageLength' => isset($_REQUEST['pageLength']) ? $_REQUEST['pageLength'] : 10,\n ));\n if (null === $results)\n {\n return [null, null, null];\n }\n\n if ($results->getTotal() < 1) {\n return [$results, null, null];\n }\n\n // Paging, we'll provide the URLs here, but it's up to the view\n // to display them.\n $searchPageUrl = ml_wpsearch_url();\n $nextLink = null;\n if ($results->getCurrentPage() < $results->getTotalPages()) {\n $nextLink = add_query_arg(array(\n 's' => urlencode($querytext),\n 'start' => $results->getNextStart(),\n 'pageLength' => $results->getPageLength(),\n ), $searchPageUrl);\n }\n\n $prevLink = null;\n if ($results->getCurrentPage() > 1) {\n $prevLink = add_query_arg(array(\n 's' => urlencode($querytext),\n 'start' => $results->getPreviousStart(),\n 'pageLength' => $results->getPageLength(),\n ), $searchPageUrl);\n }\n\n return [$results, $nextLink, $prevLink];\n}", "public function getSearch(string $term){\n \n try {\n $sql = \"SELECT\n img.*,\n COUNT(DISTINCT lik.id) AS likes ,\n COUNT(DISTINCT dis.id) AS dislikes\n FROM images AS img\n LEFT JOIN image_likes AS lik ON img.id = lik.images_id\n LEFT JOIN image_dislikes AS dis ON img.id = dis.images_id\n WHERE img.title LIKE ? OR img.description LIKE ?\n GROUP BY img.id\n ORDER BY COUNT(lik.images_id) DESC LIMIT 20\";\n \n $statement = $this->connection->prepare($sql);\n $success = $statement->execute([\n '%' . $term . '%',\n '%' . $term . '%'\n ]);\n \n if($success){\n $result = [\n 'status' => 200,\n 'message' => 'Success',\n 'data' => ['data' => $statement->fetchAll(PDO::FETCH_ASSOC)]\n\n ];\n }\n \n }catch(PDOException $e){\n \n return [\n 'status' => 204,\n 'message' => $e->getMessage(),\n 'data' => ['data' => []]\n\n ];\n }\n \n return $result;\n }", "public function scopeSearch($query, $term);", "abstract protected function createQuickSearchFilter($searchTerm);", "private function getSearch() {\n\t\tif( $_SESSION['privilege'] != 'anon' ) {\n\n\t\t\t// If NOT anon then IS logged in so set userID to SESSION['id'] \n\t\t\t$userID = $_SESSION['id'];\n\n\t\t} else {\n\t\t\t\n\t\t\t// For this function default $userID to non-exitent user # 0 \n\t\t\t$userID = 0;\n\n\t\t}\n\n\t\t// Set search term per input OR blank\n\n\t\tif( !isset($_POST['search'])) {\n\t\t\t$_POST['search'] = \"\";\n\t\t}\n\t\t\n\t\tif(strlen($_POST['search']) === 0) {\n\t\t\t$searchTerm = \"\";\n\n\t\t} else {\n\t\t\t$result = $_POST['search'];\n\t\t\t$searchTerm = strtolower($result);\n\t\t}\n\n\t\t$this->data['searchTerm'] = $searchTerm;\n\n\t\t$sql = \"SELECT posts.id, title AS score_title, intro AS score_intro, article AS score_article\n\t\t\tFROM posts\n\t\t\tWHERE\n\t\t\t\t(title LIKE '%$searchTerm%' OR \n\t\t\t\tintro LIKE '%$searchTerm%' OR\n\t\t\t\tarticle LIKE '%$searchTerm%')\";\n\n\t\tif( $_SESSION['privilege'] != 'admin' ) {\n\n\t\t\t$sql .= \" AND (user_id = $userID\n\t\t\t\t\tOR status = 'Approved')\t\n\t\t\t\t\tORDER BY score_title ASC\";\n\t\t\n\t\t} else {\n\n\t\t\t$sql .= \" ORDER BY score_title ASC\";\t\n\n\t\t}\t\t\n\t\n\t\t$result = $this->dbc->query($sql);\n\n\t\tif( !$result || $result->num_rows == 0) {\n\t\t\t$this->data['searchResults'] = \"No results\";\n\t\t} else {\n\t\t\t$this->data['searchResults'] = $result->fetch_all(MYSQLI_ASSOC);\n\t\t}\n\t}", "public function search($q);", "public function getSearchResults() {\n\n $pageTitle = $this->query;\n $result_limit = 'max'; /* max=500 */\n\n $pageTitleForUrl = urlencode($pageTitle);\n /*\n * https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&list=search&titles=Italy&exchars=200&exintro=1&explaintext=1&srsearch=Italy&srlimit=500&srwhat=text&srprop=snippet\n */\n $api_call = '?action=query&format=json&list=search&titles=' . $pageTitleForUrl . '&srsearch=' . $pageTitleForUrl . '&srnamespace=0&srlimit=' . $result_limit . '&sroffset=0&srwhat=text&srprop=snippet';\n\n $api = new API($this->baseUrl);\n $api_result = $api->getAPIResult($api_call);\n\n $response = $this->buildSearchResultsResponse($api_result);\n\n return $response;\n }", "function search() {\n\n /* Start building the query object. We hope to end up with something like:\n $reqeust = '{\n \"from\" : 0,\n \"size\": 10,\n \"query\" : {\n \"terms\" : {\n \"creator\" : [ \"card\" ]\n }\n },\n sort: {\n title: {\n order: \"desc\"\n }\n }\n }';\n */\n $request = array();\n\n // Users can query by specifying an url param like &filter=title:ender\n // TODO: We should allow for multiple filters.\n $key_and_val = explode(\":\", $this->get('GET.filter'));\n if (count($key_and_val) == 2 and !empty($key_and_val[0]) and !empty($key_and_val[1])) {\n $request['query']['query_string']['fields'] = array($key_and_val[0]);\n $request['query']['query_string']['query'] = '*' . $key_and_val[1] . '*';\n $request['query']['query_string']['default_operator'] = 'AND';\n } else {\n $request['query'] = array(\"match_all\" => new stdClass);\n }\n //$request['query']['query_string']['query'] = 'American FactFinder';\n // start parameter (elasticsearch calls this 'from')\n $incoming_start = $this->get('GET.start');\n if (!empty($incoming_start)) {\n $request['from'] = $this->get('GET.start');\n }\n \n // limit parameter (elasticsearch calls this 'size')\n $incoming_limit = $this->get('GET.limit');\n if (!empty($incoming_limit)) {\n $request['size'] = $this->get('GET.limit');\n }\n \n // sort parameter\n $incoming_sort = $this->get('GET.sort');\n $sort_field_and_dir = explode(\" \", $this->get('GET.sort'));\n if (count($sort_field_and_dir) == 2) {\n $request['sort'] = array($sort_field_and_dir[0] => array('order' => $sort_field_and_dir[1]));\n }\n \n // We now have our built request, let's jsonify it and send it to ES\n $jsoned_request = json_encode($request);\n \n $url = $this->get('ELASTICSEARCH_URL') . '_search';\n $ch = curl_init();\n $method = \"GET\";\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($method));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $jsoned_request);\n\n $results = curl_exec($ch);\n curl_close($ch);\n\n // We should have a response. Let's pull the docs out of it\n $cleaned_results = $this->get_docs_from_es_response(json_decode($results, True));\n // callback for jsonp requests\n $incoming_callback = $this->get('GET.callback');\n if (!empty($incoming_callback)) {\n $this->set('callback', $this->get('GET.callback'));\n }\n \n // We don't want dupes. Dedupe based on hollis_id\n //$deduped_docs = $this->dedupe_using_hollis_id($cleaned_results);\n \n // Hopefully we're deduping on intake\n $deduped_docs = $cleaned_results;\n \n $this->set('results', $deduped_docs);\n //$this->set('results', $cleaned_results);\n $path_to_template = 'api/templates/search_json.php';\n echo $this->render($path_to_template);\n }", "public function search($searchTerm)\n {\n// if (!array_key_exists($feed, $this->_feeds)) {\n// throw new Zend_Tool_Project_Exception(sprintf(\n// 'Unknown feed \"%s\"',\n// $feed\n// ));\n// }\n\n// $feed = Zend_Feed_Reader::import($this->_feeds[$feed]);\n// $title = $desc = $link = '';\n// foreach ($feed as $entry) {\n// $title = $entry->getTitle();\n// $desc = $entry->getDescription();\n// $link = $entry->getLink();\n// break;\n// }\n\n\n\n //$content = sprintf(\"%s\\n%s\\n\\n%s\\n\", $title, strip_tags($desc), $link);\n\n $response = $this->_registry->getResponse();\n $response->appendContent(\"Hello '$searchTerm'\");\n return true;\n }", "public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}", "public function get_results() {\n\n\t\t\tif(!isset($_GET['wpusquery'])) {\n\t\t\t\tdie(); // if no data has been entered, quit\n\t\t\t} else {\n\t\t\t\t$searcharray = $_GET['wpusquery'];\n\t\t\t}\n\n\t\t\t$nonce = $_GET['searchNonce'];\n\t\t\tif(!wp_verify_nonce($nonce, 'search-nonce')) // make sure the search nonce matches the nonce generated earlier\n\t\t\t{\n\t\t\t\tdie ('Busted!');\n\t\t\t}\n\n\t\t\tif(class_exists(\"WPUltimateSearchPro\")) {\n\t\t\t\t$this->pro_class->execute_query_pro($searcharray);\n\t\t\t} else {\n\t\t\t\t$this->execute_query_basic($searcharray);\n\t\t\t}\n\t\t}", "private function process_results($all=false) {\n global $USER;\n\n $term = mb_convert_case($this->term, MB_CASE_LOWER, 'UTF-8');\n\n //experimental - return more results\n $strip_arr = array('author:', 'title:', '+', '-', 'doctype:');\n $stripped_term = str_replace($strip_arr, '', $term);\n\n $hits = $this->index->find($term.\" title:\".$stripped_term.\" author:\".$stripped_term);\n //--\n\n $hitcount = count($hits);\n $this->total_results = $hitcount;\n\n if ($hitcount == 0) return array();\n\n $totalpages = ceil($hitcount/$this->results_per_page);\n\n if (!$all) {\n if ($hitcount < $this->results_per_page) {\n $this->pagenumber = 1;\n } else if ($this->pagenumber > $totalpages) {\n $this->pagenumber = $totalpages;\n }\n\n $start = ($this->pagenumber - 1) * $this->results_per_page;\n $end = $start + $this->results_per_page;\n\n if ($end > $hitcount) {\n $end = $hitcount;\n } \n } else {\n $start = 0;\n $end = $hitcount;\n }\n\n $resultdoc = new SearchResult();\n $resultdocs = array();\n\n for ($i = $start; $i < $end; $i++) {\n $hit = $hits[$i];\n\n //check permissions on each result\n if ($this->can_display($USER, $hit->docid, $hit->doctype, $hit->course_id, $hit->group_id, $hit->path, $hit->itemtype, $hit->context_id )) {\n $resultdoc->number = $i;\n $resultdoc->url = $hit->url;\n $resultdoc->title = $hit->title;\n $resultdoc->score = $hit->score;\n $resultdoc->doctype = $hit->doctype;\n $resultdoc->author = $hit->author;\n\n //and store it\n $resultdocs[] = clone($resultdoc);\n } else {\n // lowers total_results one unit\n $this->total_results--;\n }\n }\n\n return $resultdocs;\n }", "function getSearchResults(&$text, &$phrase, Registry &$pluginParam, $itemid, $ordering) {\n\t\t$highlights = array();\n\t\t$search = new Search($this->getJname());\n\t\t$results = $search->ft_pageSearch($text, $highlights);\n\t\t//pass results back to the plugin in case they need to be filtered\n\n\t\t$this->filterSearchResults($results, $pluginParam);\n\t\t$rows = array();\n\t\t$pos = 0;\n\n\t\tforeach ($results as $key => $index) {\n\t\t\t$rows[$pos]->title = Text::_($key);\n\t\t\t$rows[$pos]->text = $search->getPage($key);\n\t\t\t$rows[$pos]->created = $search->getPageModifiedDateTime($key);\n\t\t\t//dokuwiki doesn't track hits\n\t\t\t$rows[$pos]->hits = 0;\n\t\t\t$rows[$pos]->href = JFusionFunction::routeURL(str_replace(':', ';', $this->getSearchResultLink($key)), $itemid);\n\t\t\t$rows[$pos]->section = Text::_($key);\n\t\t\t$pos++;\n\t\t}\n\t\treturn $rows;\n\t}", "public static function search($term)\n\t{\n\t\t$items = (array) FrontendModel::getDB()->getRecords(\n\t\t\t'SELECT p.display_name, p.url, ps1.value AS first_name, ps2.value AS last_name\n\t\t\t FROM profiles AS p\n\t\t\t INNER JOIN profiles_settings AS ps1 ON p.id = ps1.profile_id AND ps1.name = \"first_name\"\n\t\t\t INNER JOIN profiles_settings AS ps2 ON p.id = ps2.profile_id AND ps2.name = \"last_name\"\n\t\t\t WHERE ps1.value LIKE ?\n\t\t\t OR ps2.value LIKE ?\n\t\t\t OR display_name LIKE ?\n\t\t\t LIMIT 8', \n\t\t\tarray(\n\t\t\t\t(string) 's:%:\"%' . $term . '%\";', \n\t\t\t\t(string) 's:%:\"%' . $term . '%\";', \n\t\t\t\t(string) '%' . $term . '%'\n\t\t\t)\n\t\t);\n\n\t\tif(!empty($items))\n\t\t{\n\t\t\tforeach($items as &$item)\n\t\t\t{\n\t\t\t\t$item['url'] = FrontendNavigation::getURLForBlock('profiles') . '/' . $item['url'];\n\t\t\t}\n\t\t}\n\n\t\treturn $items;\n\t}", "public function findByTerm(string $searchTerm): LengthAwarePaginator;", "public function findByTerm(string $searchTerm): LengthAwarePaginator;", "public static function get($searchTerm, $page) {\n return self::paginate($searchTerm, $page);\n }", "public function search(String $term)\n {\n return $this->model->where('username', 'like', '%'.$term.'%')\n ->with('mixes')->get();\n }", "public static function search($query, &$results = array()) {\n\n }", "public function searchByKeyword($query);", "public function search()\n\t{\n\t\tif(isset($_GET['term']))\n\t\t{\n\t\t\t$result = $this->Busca_Model->pesquisar($_GET['term']);\n\t\t\tif(count($result) > 0) {\n\t\t\tforeach ($result as $pr)$arr_result[] = $pr->nome;\n\t\t\t\techo json_encode($arr_result);\n\t\t\t}\n\t\t}\n\t}", "function SearchXml($db,$term){\n $result = $this->HttpClient->get(sprintf($this->eSearchURL,urlencode($db),urlencode($term)));\n if (preg_match(\"/error/i\",$result)){return NULL;}\n return $result;\n }", "public function search() {\n\t\tif(isset($_GET['query'])) $this->query_str = $_GET['query'];\n\t\telse return;\n\n\t\t$raw = null;\n\n\t\t$cache = new Cache($this->query_str);\n\t\t//check if the result is cached\n\t\t\n\t\tif($cache->allow_cache()) {\n\t\t\t$raw = $cache->load_cache();\n\t\t\tif($raw === false) $raw = null;\n\t\t}\n\n\t\tif($raw === null) {\n\t\t\t//check if jar exists\n\t\t\tif(file_exists('../executable/app.jar')) $raw = shell_exec('cd ../executable/ && java -jar app.jar search ' . escapeshellarg($this->query_str));\n\t\t\telse return;\n\n\t\t\t//only save into cached when the escaped string equal to input string\n\t\t\tif($raw !== null && count($raw) > 0 && $cache->allow_cache()) \n\t\t\t\t$cache->save_cache($raw);\n\t\t}\n\n\t\t$this->results = json_decode($raw);\n\n\t\t$this->end_time = microtime(true);\n\t}", "public function searchmusic($term)\n\t{\n\t\t$music_res = null;\n\n\t\t$musics = Music::search($music_res['ids'], $term)\n\t\t\t// ->get(['id', 'name', 'play', 'download', 'views', 'image']);\n\t\t\t->paginate(20, ['id', 'name', 'play', 'views', 'artist', 'download'] );\n\n\t\t$music_results = $this->prepare('music', $musics);\n\n\n\t\tif ($this->request->ajax()) {\n\t\t\treturn $musics;\n\t\t}\n\n\n\t\t$data = [\n\t\t\t'musics' => $musics,\n\t\t\t'query' => $term,\n\t\t\t'title' => $term\n\t\t];\n\n\t\treturn view('search.music', $data);\n\t}", "public function search($query, $year = null, $language = null);", "public function searchContent($searchTerm = '*', $filters = array(), $fields = array(), $sort = array(array('_score' => 'desc'), array('date_revised' => 'desc')), $options = array())\n {\n #$this->getServiceLocator()->get('Logger')->debug('searchTerm called');\n\n $filterObjects = array();\n foreach ($filters as $filterKey => $filterValue) {\n switch ($filterKey) {\n case '_id':\n if (is_array($filterValue)) {\n $elasticaFilterId = new \\Elastica\\Filter\\Ids(null, $filterValue);\n } else {\n $elasticaFilterId = new \\Elastica\\Filter\\Ids(null, array($filterValue));\n }\n $filterObjects[] = $elasticaFilterId;\n break;\n case 'start_date':\n case 'end_date':\n break;\n case 'body':\n case 'headline':\n $elasticaQuery = new \\Elastica\\Query\\QueryString($filterKey . ':' . \\Elastica\\Util::escapeTerm($filterValue));\n $elasticaFilter = new \\Elastica\\Filter\\Query($elasticaQuery);\n $elasticaFilter->setName($filterKey);\n $filterObjects[] = $elasticaFilter;\n break;\n case 'pub_code':\n if (isset($filterValue['all_markets'])) {\n if (isset($filterValue['hide_bloomberg'])) {\n $termFilter = new \\Elastica\\Filter\\Term();\n $termFilter->setTerm('pub_code', 'bloomberg');\n $marketFilter = new \\Elastica\\Filter\\BoolNot($termFilter);\n } else {\n $marketFilter = $termFilter;\n }\n } else {\n $termFilter = new \\Elastica\\Filter\\Term();\n $termFilter->setTerm('pub_code', $filterValue['market_code']);\n if (!isset($filterValue['hide_bloomberg'])) {\n $termFilter2 = new \\Elastica\\Filter\\Term();\n $termFilter2->setTerm('pub_code', 'bloomberg');\n $marketFilter = new \\Elastica\\Filter\\BoolOr();\n $marketFilter->addFilter($termFilter);\n $marketFilter->addFilter($termFilter2);\n } else {\n $marketFilter = $termFilter;\n }\n }\n \n if (!empty($marketFilter)) {\n $filterObjects[] = $marketFilter;\n }\n break;\n case 'pub_bloomberg':\n $termFilter = new \\Elastica\\Filter\\Term();\n $termFilter->setTerm('pub_id', $filterValue);\n $termFilter2 = new \\Elastica\\Filter\\Term();\n $termFilter2->setTerm('pub_code', 'bloomberg');\n $mktFilter = new \\Elastica\\Filter\\BoolOr();\n $mktFilter->addFilter($termFilter);\n $mktFilter->addFilter($termFilter2);\n $filterObjects[] = $mktFilter;\n break;\n default:\n $termFilter = new \\Elastica\\Filter\\Term();\n $termFilter->setTerm($filterKey, $filterValue);\n $filterObjects[] = $termFilter;\n break;\n }\n }\n\n if (!empty($filters['start_date']) || !empty($filters['end_date'])) {\n $elasticaFilterDate = new \\Elastica\\Filter\\Range();\n $filterOptions = array();\n $elasticaFilterDate->setName('range_dates');\n\n if (!empty($filters['start_date'])) {\n $startDate = new \\DateTime($filters['start_date']);\n $filterOptions['gte'] = $startDate->format('c');\n }\n if (!empty($filters['end_date'])) {\n $endDate = new \\DateTime($filters['end_date'] . '23:59:59');\n $filterOptions['lte'] = $endDate->format('c');\n }\n $elasticaFilterDate->addField('date_created', $filterOptions);\n $filterObjects[] = $elasticaFilterDate;\n }\n\n $elasticaQuery = new \\Elastica\\Query();\n\n // Create the actual search object with some data.\n $searchTermSend = (!empty($searchTerm) && ($searchTerm != '*')) ? \\Elastica\\Util::escapeTerm($searchTerm) : '*';\n // unescape phrases\n $searchTermSend = str_replace('\\\"', '\"', $searchTermSend);\n // capitalize booleans\n $searchTermSend = str_replace(' and ', ' AND ', $searchTermSend);\n $searchTermSend = str_replace(' or ', ' OR ', $searchTermSend);\n\n $elasticaQueryString = new \\Elastica\\Query\\QueryString($searchTermSend);\n $elasticaQueryString->setUseDisMax(true);\n $elasticaQueryString->setAutoGeneratePhraseQueries(true);\n if (isset($options['queryfields'])) {\n $elasticaQueryString->setFields($options['queryfields']);\n }\n // this doesn't work right... elasticsearch returns empty fields instead\n // of what we requested\n #if (!empty($fields)) {\n # $elasticaQuery->setFields($fields);\n #}\n if (isset($options['default_operator'])) {\n $elasticaQueryString->setDefaultOperator($options['default_operator']);\n }\n\n if (!empty($filterObjects)) {\n if (count($filterObjects) == 1) {\n $elasticaQuery->setFilter($filterObjects[0]);\n } else {\n $elasticaFilterAnd = new \\Elastica\\Filter\\BoolAnd();\n foreach ($filterObjects as $filter) {\n $elasticaFilterAnd->addFilter($filter);\n }\n $elasticaQuery->setFilter($elasticaFilterAnd);\n }\n }\n\n if (!isset($options['no_facets'])) {\n $facets = array();\n if (!empty($options['facets'])) {\n $facets = $options['facets'];\n } else {\n // These are the default facets\n $facets = array(\n 'pub_name' => array(\n 'field' => 'pub_name',\n 'type' => 'terms',\n ),\n );\n }\n if (!empty($facets)) {\n foreach ($facets as $facetName => $facetOptions) {\n if (!isset($facetOptions['type']) || empty($facetOptions['type'])) {\n $facetOptions['type'] = 'terms';\n }\n if (!isset($facetOptions['size']) || empty($facetOptions['size'])) {\n $facetOptions['size'] = 100;\n }\n if (!isset($facetOptions['order']) || empty($facetOptions['order'])) {\n $facetOptions['order'] = 'count';\n }\n if (!isset($facetOptions['field']) || empty($facetOptions['field'])) {\n // required\n $this->getServiceLocator()->get('Logger')->err(\"Skipping facet $facetName because no field defined\");\n continue;\n }\n switch ($facetOptions['type']) {\n case 'terms':\n $elasticaFacet = new \\Elastica\\Facet\\Terms($facetName);\n $elasticaFacet->setSize($facetOptions['size']);\n $elasticaFacet->setOrder($facetOptions['order']);\n $elasticaFacet->setField($facetOptions['field']);\n // now we need to apply our query to the facet so we only\n // get facet values that are within our results\n if (!empty($filterObjects)) {\n if (count($filterObjects) == 1) {\n $elasticaFacet->setFilter($filterObjects[0]);\n } else {\n $elasticaFilterAnd = new \\Elastica\\Filter\\BoolAnd();\n foreach ($filterObjects as $filter) {\n $elasticaFilterAnd->addFilter($filter);\n }\n $elasticaFacet->setFilter($elasticaFilterAnd);\n }\n }\n $elasticaQuery->addFacet($elasticaFacet);\n $elasticaFacet->setGlobal(false);\n break;\n default:\n # unhandled facet type\n $this->getServiceLocator()->get('Logger')->err(\"Unhandled facet type {$facetOptions['type']}\");\n break;\n }\n }\n }\n }\n\n if (!empty($sort)) {\n $elasticaQuery->setSort($sort);\n }\n\n $elasticaQuery->setQuery($elasticaQueryString);\n\n return $this->search($elasticaQuery, '\\Services\\Elastica\\ResultSet\\Video', $options);\n }", "public function getBedByName() {\n $term = Request::input('term', '');\n\n $results = array();\n $queries = Bed::where('name', 'LIKE', '%'.$term.'%')\n ->take(10)->get();\n foreach ($queries as $query)\n $results[] = ['id' => $query->id,\n 'value' => $query->representation()];\n return response()->json($results);\n }", "public function search($terms){\n\t \n if(!$this->t_mirrors){\n\t\t@$this->retrieveMirrors;\n\t }\n\t if(!$this->t_mirrors){\n\t\treturn false;\n\t }\n\t \n\t $terms=str_replace(' ', '%20', $terms);\n\t $terms=str_replace(\"'\", '%27', $terms);\n\t \n\t \n $url = $this->t_mirrors[0].'/api/GetSeries.php?seriesname='.$terms;\n\n $xmlStr=$this->curl_get_file_contents($url);\n \n $results = new SimpleXMLElement($xmlStr);\n \n $i=0;\n \n foreach ($results->Series as $s) {\n \n $this->t_sResults[$i]=array('seriesid' => $s->seriesid,\n 'SeriesName' => $s->SeriesName,\n 'banner' => $s->banner,\n 'FirstAired' => $s->FirstAired,\n 'Overview' => $s->Overview);\n \n $i++;\n }\n \n return $this->t_sResults;\n \n }", "public static function getAllSdById($term){\n // ->join('clienttype as ct', function($join){\n // $join->on('c.ClientType', '=', 'ct.ClientTypeID');\n // })\n // ->join('acctstat as as', function($join){\n // $join->on('c.AccountStatus', '=', 'as.AcctStatID');\n // })\n // ->where('c.ClientID', '=', $clientIdSd)\n // ->get();\n\n return DB::table('client as c')\n ->join('clienttype as ct', function($join) {\n $join->on('c.ClientType', '=', 'ct.ClientTypeID');\n })\n ->join('acctstat as acs', function($join){\n $join->on('c.AccountStatus', '=', 'acs.AcctStatID');\n })\n ->where('c.ClientID', '=', $term)\n ->orWhere('c.FName', 'like', '%'.$term.'%')\n ->orWhere('c.LName', 'like', '%'.$term.'%')\n // ->where('c.AccountStatus', '=', $status)\n // ->orWhere('c.AccountStatus', '=', $status)\n // ->orWhere('c.AccountStatus', '=', $status)\n ->paginate(10);\n }", "public function searchGlobalTerm ($term){\n $json = new JsonFile ($this->host. '/api/key/' . $term );\n $json->parse();\n \n return $json;\n }", "public function search($query);", "public function search() {\r\n //retrieve query terms from search form\r\n $query_terms = trim($_GET['query-terms']);\r\n\r\n //if search term is empty, list all vacations\r\n if ($query_terms == \"\") {\r\n $this->index();\r\n }\r\n\r\n //search the database for matching movies\r\n $vacations = $this->vacation_model->search_vacation($query_terms);\r\n\r\n if ($vacations === false) {\r\n //handle error\r\n $message = \"An error has occurred.\";\r\n $this->error($message);\r\n return;\r\n }\r\n //display matched movies\r\n $search = new VacationSearch();\r\n $search->display($query_terms, $vacations);\r\n }", "function do_search(&$smartySearchResult,$searchBox) {\n\t\t$searchString = $this->piVars['sword'];\n\t\t#$searchString = ereg_replace('\"', '', $searchString);\t//Delete quotation marks from search value\n\t\t$searchString=$this->check_searchword(strip_tags($searchString)); //strip and check to avoid xss-exploits\n\t\t$sword = preg_split('/[\\s,.\\\"]+/',$searchString);\t\t//Split search string into multiple keywords and store them in an array\n\n\t\t//Set initial where clauses\n\t\t$querypart_where = ' AND tx_civserv_service.pid IN (' . $this->community['pidlist'] . ')';\n\n\t\t$querypart_where2 = ' AND tx_civserv_search_word.uid = tx_civserv_service_sv_searchword_mm.uid_foreign\n\t\t\t\t\t\t\t AND tx_civserv_service_sv_searchword_mm.uid_local = tx_civserv_service.uid';\n\n\t\t$querypart_where3 = '';\n\t\t$querypart_where4 = '';\n\t\t// count($sword) represents the number of search words entered by the user, i.e. 2 for \"blue bird\" and 3 for \"big blue bird\"\n\n\t\tif (!empty($searchString)) {\n\t\t\t// Because UNION is not yet implemented in the sql wrapper class, a lower\n\t\t\t// abstraction level for the sql statement is used. This should be no problem,\n\t\t\t// because UNION is standard in almost all DBMS.\n\t\t\tfor ($i = 0; $i < count($sword); $i++) {\n\t\t\t\tif ($i == 0) {\n\t\t\t\t\t\t$querypart_where .= ' AND (sv_name LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"\n\t\t\t\t\t\t\t\t\t\t\t OR sv_synonym1 LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"\n\t\t\t\t\t\t\t\t\t\t\t OR sv_synonym2 LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"\n\t\t\t\t\t\t\t\t\t\t\t OR sv_synonym3 LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"';\n\n\t\t\t\t\t\t$querypart_where2 .= ' AND (tx_civserv_search_word.sw_search_word LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"';\n\n\t\t\t\t\t\t$querypart_where3 .= ' AND (ms_name LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"\n\t\t\t\t\t\t\t\t\t\t\t OR ms_synonym1 LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"\n\t\t\t\t\t\t\t\t\t\t\t OR ms_synonym2 LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"\n\t\t\t\t\t\t\t\t\t\t\t OR ms_synonym3 LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"';\n\n\t\t\t\t\t\t$querypart_where4 .= ' AND (sw_search_word LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"';\n\n\t\t\t\t\t\t$querypart_where5 = ' AND (sv_name LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"\n\t\t\t\t\t\t\t\t\t\t\t OR sv_synonym1 LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"\n\t\t\t\t\t\t\t\t\t\t\t OR sv_synonym2 LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"\n\t\t\t\t\t\t\t\t\t\t\t OR sv_synonym3 LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"';\n\t\t\t\t} else { //the following are going to supplement the condition starting with 'AND....'\n\t\t\t\t\t$querypart_where .= ' OR sv_name LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"\n\t\t\t\t\t\t\t\t\t\t OR sv_synonym1 LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"\n\t\t\t\t\t\t\t\t\t\t OR sv_synonym2 LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"\n\t\t\t\t\t\t\t\t\t\t OR sv_synonym3 LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"';\n\n\t\t\t\t\t$querypart_where2 .= ' OR tx_civserv_search_word.sw_search_word LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\" ';\n\n\t\t\t\t\t$querypart_where3 .= ' OR ms_name LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"\n\t\t\t\t\t\t\t\t\t\t OR ms_synonym1 LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"\n\t\t\t\t\t\t\t\t\t\t OR ms_synonym2 LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"\n\t\t\t\t\t\t\t\t\t\t OR ms_synonym3 LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"';\n\n\t\t\t\t\t$querypart_where4 .= ' OR sw_search_word LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\" ';\n\n\t\t\t\t\t$querypart_where5 .= ' OR sv_name LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"\n\t\t\t\t\t\t\t\t\t\t OR sv_synonym1 LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"\n\t\t\t\t\t\t\t\t\t\t OR sv_synonym2 LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"\n\t\t\t\t\t\t\t\t\t\t OR sv_synonym3 LIKE \"%' . $GLOBALS['TYPO3_DB']->quoteStr($sword[$i], 'tx_civserv_search_word') . '%\"';\n\t\t\t\t}\n\t\t\t}// end for...\n\t\t\t//all the prepared query-parts need to be finished by an ')'.\n\t\t\t$querypart_where .= ')';\n\t\t\t$querypart_where2 .= ')';\n\t\t\t$querypart_where3 .= ')';\n\t\t\t$querypart_where4 .= ')';\n\t\t\t$querypart_where5 .= ')';\n\n\n\n\t\t\t//Query for getting uid list of matching search words\n\t\t\t$res_searchword = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t\t'uid',\n\t\t\t\t\t\t'tx_civserv_search_word',\n\t\t\t\t\t\t'1 '.\n\t\t\t\t\t\t$querypart_where4 .\n\t\t\t\t\t\t$this->cObj->enableFields('tx_civserv_search_word'),\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t'');\n\n\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res_searchword) > 0) {\n\t\t\t\t$uidlist_searchwords = $this->sql_fetch_array_r($res_searchword);\n\t\t\t} else {\n\t\t\t\t$uidlist_searchwords[0]=''; //Create empty array for 'in_array'-function\n\t\t\t}\n\n\t\t\t//Query for getting uid list of model services\n\t\t\t$res_model_service = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t\t'uid, ms_searchword',\n\t\t\t\t\t\t'tx_civserv_model_service',\n\t\t\t\t\t\t'ms_searchword != 0',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t'');\n\n\t\t\t//Open uid match list\n\t\t\t$searchword_uid_list = '(';\n\t\t\t$list_start = 1;\n\t\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_model_service) ) {\n\t\t\t\t\t$searchword_uid_array = explode(\",\", $row['ms_searchword']);\n\t\t\t\t\tfor ($i = 0 ; $i < count($searchword_uid_array) ; $i++) {\n\t\t\t\t\t\tif ($uidlist_searchwords != NULL && in_array(array('uid' => $searchword_uid_array[$i]),$uidlist_searchwords)) {\n\t\t\t\t\t\t\t$searchword_uid_list .= $list_start ? $row['uid'] : ',' . $row['uid']; //Add model service uid to match list\n\t\t\t\t\t\t\t$list_start = 0;\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}\n\t\t\t//Close uid match list\n\t\t\t$searchword_uid_list .= ')';\n\n\t\t\tif ($searchword_uid_list != '()') {\n\t\t\t\t$querypart_where3 .= ' OR tx_civserv_model_service.uid IN ' . $searchword_uid_list;\n\t\t\t}\n\n\t\t\t$res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db,\n\t\t\t\t\t'SELECT\n\t\t\t\t\t \ttx_civserv_service.uid as uid,\n\t\t\t\t\t \ttx_civserv_service.sv_name as name\n\t\t\t\t\t FROM\n\t\t\t\t\t \ttx_civserv_service\n\t\t\t\t\t WHERE 1 ' .\n\t\t\t\t\t \t $this->cObj->enableFields('tx_civserv_service') .\n\t\t\t\t\t\t$querypart_where . '\n\t\t\t\t\t UNION\n\t\t\t\t\t SELECT\n\t\t\t\t\t \ttx_civserv_service.uid as uid,\n\t\t\t\t\t\ttx_civserv_service.sv_name as name\n\t\t\t\t\t FROM\n\t\t\t\t\t \ttx_civserv_service,\n\t\t\t\t\t\ttx_civserv_search_word,\n\t\t\t\t\t\ttx_civserv_service_sv_searchword_mm\n\t\t\t\t\t WHERE 1 ' .\n\t\t\t\t\t \t$this->cObj->enableFields('tx_civserv_service') .\n\t\t\t\t\t\t$this->cObj->enableFields('tx_civserv_search_word') .\n\t\t\t\t\t\t' AND tx_civserv_service.pid IN (' . $this->community['pidlist'] . ')\n\t\t\t\t\t\t '. $querypart_where2 . '\n\t\t\t\t\t UNION\n\t\t\t\t\t SELECT\n\t\t\t\t\t \ttx_civserv_service.uid as uid,\n\t\t\t\t\t\ttx_civserv_service.sv_name as name\n\t\t\t\t\t FROM\n\t\t\t\t\t \ttx_civserv_service,\n\t\t\t\t\t\ttx_civserv_model_service\n\t\t\t\t\t WHERE 1 ' .\n\t\t\t\t\t \t$this->cObj->enableFields('tx_civserv_service') .\n\t\t\t\t\t\t$this->cObj->enableFields('tx_civserv_model_service') .\n\t\t\t\t\t\t' AND tx_civserv_service.sv_model_service = tx_civserv_model_service.uid\n\t\t\t\t\t\t AND tx_civserv_service.pid IN (' . $this->community['pidlist'] . ')\n\t\t\t\t\t\t '. $querypart_where3 .'\n\t\t\t\t\tUNION\n\t\t\t\t\tSELECT\n\t\t\t\t\t\ttx_civserv_service.uid as uid,\n\t\t\t\t\t\ttx_civserv_service.sv_name as name\n\t\t\t\t\tFROM\n\t\t\t\t\t\ttx_civserv_service,\n\t\t\t\t\t\ttx_civserv_external_service\n\t\t\t\t\tWHERE 1 ' .\n\t\t\t\t\t\t$this->cObj->enableFields('tx_civserv_service') .\n\t\t\t\t\t\t$this->cObj->enableFields('tx_civserv_external_service') .\n\t\t\t\t\t ' AND tx_civserv_external_service.pid in (' . $this->community['pidlist'] . ')\n\t\t\t\t\t AND tx_civserv_external_service.es_external_service = tx_civserv_service.uid\n\t\t\t\t\t '. $querypart_where5 .'\n\t\t\t\t\tUNION\n\t\t\t\t\tSELECT\n\t\t\t\t\t\ttx_civserv_service.uid as uid,\n\t\t\t\t\t\ttx_civserv_service.sv_name as name\n\t\t\t\t\tFROM\n\t\t\t\t\t\ttx_civserv_service,\n\t\t\t\t\t\ttx_civserv_search_word,\n\t\t\t\t\t\ttx_civserv_service_sv_searchword_mm,\n\t\t\t\t\t\ttx_civserv_external_service\n\t\t\t\t\tWHERE 1 ' .\n\t\t\t\t\t\t$this->cObj->enableFields('tx_civserv_service') .\n\t\t\t\t\t\t$this->cObj->enableFields('tx_civserv_search_word') .\n\t\t\t\t\t\t$this->cObj->enableFields('tx_civserv_external_service') .\n\t\t\t\t\t\t' AND tx_civserv_external_service.pid IN (' . $this->community['pidlist'] . ')\n\t\t\t\t\t\t '. $querypart_where2 .'\n\t\t\t\t\t\tAND tx_civserv_external_service.es_external_service = tx_civserv_service.uid\n\t\t\t\t\tORDER BY name'\n\t\t\t);\n\n\t\t\t$rowcount = $GLOBALS['TYPO3_DB']->sql_num_rows($res);\n\t\t\t// Check if query returned any results\n\t\t\tif ($rowcount == 0) {\n\t\t\t\t$GLOBALS['error_message'] = $this->pi_getLL('tx_civserv_pi1_search.no_results','No search results found!');\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t// Output service search results\n\t\t\t\t$row_counter = 0;\n\t\t\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res) ) {\n\t\t\t\t\t$search_data[$row_counter]['link'] = htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'service',id => $row['uid']),1,1));\n\t\t\t\t\t$search_data[$row_counter]['name'] = $row['name'];\n\t\t\t\t\t$row_counter++;\n\t\t\t\t}\n\n\t\t\t\tif ($searchBox) {\n\t\t\t\t\t//$_SERVER['REQUEST_URI'] = $this->pi_linkTP_keepPIvars_url(array(mode => 'search_result'),0,1); //dropped this according to instructions from security review\n\t\t\t\t\t$smartySearchResult->assign('searchbox', $this->pi_list_searchBox());\n\t\t\t\t}\n\n\t\t\t\t$smartySearchResult->assign('service',$search_data);\n\t\t\t\t$smartySearchResult->assign('number',$rowcount);\n\t\t\t\t$smartySearchResult->assign('employee_label',$this->pi_getLL('tx_civserv_pi1_search_result.employee','Matching employees'));\n\t\t\t\t$smartySearchResult->assign('service_label',$this->pi_getLL('tx_civserv_pi1_search_result.service','Matching services'));\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\t// End query services\n\n\t\t// Empty query\n\t\telse {\n\t\t\t$GLOBALS['error_message'] = $this->pi_getLL('tx_civserv_pi1_search.empty_query','Empty query! Search string required.');\n\t\t\treturn false;\n\t\t}\n\t\t// End empty query\n\t}", "function media_bynder_search_facets($selected_facets, $search_term) {\n $full_query = \"\";\n foreach ($selected_facets as $selected_facet_group_name => $selected_facet_group) {\n $full_query .= \"&\" . $selected_facet_group_name . '=' . implode(\",\", $selected_facet_group);\n }\n\n if (isset($search_term) && strlen($search_term) > 0) {\n if (strlen($full_query) > 0) {\n $full_query .= ' ';\n }\n $full_query .= '&keyword=' . $search_term;\n }\n\n $rest_client = media_bynder_rest_client();\n $arr_facets_json = $rest_client->getFacets($full_query);\n\n if ($arr_facets_json) {\n return $arr_facets_json;\n } else {\n drupal_set_message($rest_client->error, 'error');\n return FALSE;\n }\n}", "public function getResults( $searchTerm )\n\t{\n\t\t/* Check we have access */\n\t\tif( !$this->hasAccess() )\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t/* Init */\n\t\t$results = array();\n\t\t$searchTerm = mb_strtolower( $searchTerm );\n\t\t\n\t\t/* Perform the search */\n\t\t$members = \\IPS\\Db::i()->select( \"*\", 'core_members', array( \"LOWER(name) LIKE CONCAT( '%', ?, '%' ) OR LOWER(email) LIKE CONCAT( '%', ?, '%' )\", $searchTerm, $searchTerm ), NULL, 50 ); # Limit to 50 so it doesn't take too long to run\n\t\t\n\t\t/* Format results */\n\t\tforeach ( $members as $member )\n\t\t{\n\t\t\t$member = \\IPS\\Member::constructFromData( $member );\n\t\t\t\n\t\t\t$results[] = \\IPS\\Theme::i()->getTemplate('livesearch')->member( $member );\n\t\t}\n\t\t\t\t\t\n\t\treturn $results;\n\t}", "function performSearch($sessionID, $table, $field, $term, $order){\r\n\t\tif($this->userCanPerformSearch('', $table)){\r\n\t\t\t//Allow user to search by sensitive or normal for level\r\n\t\t\tif($table == 'issues' && $field == 'Level'\r\n\t\t\t && $term!='A' && $term!='a' && $term!='B' && $term!='b'){\r\n\t\t\t\tif(strstr('sensitive', $term))\r\n\t\t\t\t\t$term = 'A';\r\n\t\t\t\telseif(strstr('normal', $term))\r\n\t\t\t\t\t$term = 'B';\r\n\t\t\t}\r\n\t\t\tif($table == 'students'){\r\n\t\t\t\tif(!$this->fieldInTable($table, $field)){\r\n\t\t\t\t\tif($this->fieldInTable('X_PNSY_STUDENT', $field))\r\n\t\t\t\t\t\t$table = 'X_PNSY_STUDENT';\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$table = 'X_PNSY_ADDRESS';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($table == 'students'){\r\n\t\t\t\t$query = \"SELECT * FROM X_PNSY_STUDENT ss, $table s where s.$field like '%$term%' AND s.StudentID IN\r\n\t\t\t\t\t\t\t(SELECT ID FROM X_PNSY_STUDENT WHERE ID = s.StudentID) AND s.StudentID = ss.ID GROUP BY s.StudentID\";\r\n\t\t\t}\r\n\t\t\telseif($table == 'X_PNSY_ADDRESS'){\r\n\t\t\t\t$query = \"SELECT * FROM X_PNSY_STUDENT ss, $table s WHERE s.$field LIKE '%$term%'AND s.ADDRESS_ID IN \r\n\t\t\t\t\t\t\t(SELECT ADDRESS_ID FROM $table WHERE ADDRESS_ID=s.ADDRESS_ID) \r\n\t\t\t\t\t\t\tAND s.ADDRESS_ID=ss.ADDRESS_ID GROUP BY s.ADDRESS_ID\";\r\n\t\t\t\tif($field == 'STREET'){\r\n\t\t\t\t//\"SELECT ID, CONCAT(FirstName, ' ', MiddleIn, ' ', LastName) AS FullName FROM students WHERE\r\n\t\t\t\t//\tCONCAT(FirstName, ' ', MiddleIn, ' ', LastName) LIKE '%$name%'\";\r\n\t\t\t\t\r\n\t\t\t\t\t$query = \"SELECT * FROM X_PNSY_STUDENT ss, $table s WHERE (s.STREET_1 LIKE '%$term%' OR s.STREET_2 LIKE '%$term%'\r\n\t\t\t\t\t\t\tOR s.STREET_3 LIKE '%$term%' OR s.STREET_4 LIKE '%$term%' OR s.STREET_5 LIKE '%$term%') AND s.ADDRESS_ID IN \r\n\t\t\t\t\t\t\t(SELECT ADDRESS_ID FROM $table WHERE ADDRESS_ID=s.ADDRESS_ID) AND s.ADDRESS_ID=ss.ADDRESS_ID GROUP BY s.ADDRESS_ID\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telseif($table == 'X_PNSY_STUDENT' && $field == 'ADVISOR'){\r\n\t\t\t\t$table = 'X_PNSY_FACULTY';\r\n\t\t\t\t$query = \"SELECT s . * FROM X_PNSY_STUDENT s, $table ss WHERE (CONCAT(ss.FIRST_NAME, ' ',\r\n\t\t\t\t\t\t\t ss.LAST_NAME) LIKE '%$term%') AND s.$field IN (SELECT ID FROM $table WHERE ID = s.$field)\r\n\t\t\t\t\t\t\tAND s.$field = ss.ID GROUP BY s.$field, s.ID\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$query = \"SELECT * FROM $table WHERE $field like '%$term%'\";\r\n// Michael Thompson * 12/07/2005 * Added Below line to tack order onto sql sentence\r\n if ($order != \"\") $query .= \" ORDER BY $order\";\r\n\t\t\t$result = mysql_query($query);\r\n\t\t\tfor($i=0; $results = mysql_fetch_assoc($result); $i++){\r\n\t\t\t\t$return[$i] = $results;\r\n\t\t\t}\r\n\t\t\treturn $return;\r\n\t\t}\r\n\t}", "public function search($search_term, $category = 0){\n\t\t\t$this->search_type = self::get_search_type($search_term);\n\t\t\t\n\t\t\t$long = 0;\n\t\t\t$lat = 0;\t\t\t\n\n\t\t\t//postcode?\n\t\t\tif($this->search_type == 'postcode'){\n\n\t\t\t\t//if its a partial postcode, padd it\n\t\t\t\t$clean_postcode = clean_postcode($search_term);\n\t\t\t\t$longlat = get_postcode_location($clean_postcode, 'UK');\n\n\t\t\t\tif($longlat != false){\n\t\t\t\t\t$long = $longlat[0];\n\t\t\t\t\t$lat = $longlat[1];\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//Update the stats table\n\t\t\t\ttableclass_stat::increment_stat(\"search.type.ukpostcode\");\n\t\t\t}\n\t\t\t\n\t\t\t//zipcode?\n\t\t\tif($this->search_type == 'zipcode'){\n\t\t\t\t$clean_postcode = trim($search_term);\n\t\t\t\t$longlat = get_postcode_location($clean_postcode, 'US');\n\t\t\t\tif($longlat == false){\n\t\t\t\t\tarray_push($this->warnings, \"A error occured when trying to find that zip code\");\n\t\t\t\t\ttrigger_error(\"Unable to get location for zipcode: \" . $search_term);\n\t\t\t\t}else{\n\t\t\t\t\t$long = $longlat[0];\n\t\t\t\t\t$lat = $longlat[1];\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Update the stats table\n\t\t\t\ttableclass_stat::increment_stat(\"search.type.zipcode\");\t\t\t\t\n\t\t\t}\n\t\t\t//long lat?\n\t\t\tif($this->search_type == 'longlat'){\n\n\t\t\t\t$split = split(\",\", trim($search_term));\n\t\t\t\t$long = $split[0];\n\t\t\t\t$lat = $split[1];\n\n\n\t\t\t\t//Update the stats table\n\t\t\t\ttableclass_stat::increment_stat(\"search.type.longlat\");\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//Do the search for groups directly covering this location\n\t\t\t$search = factory::create('search');\n\t\t\t$groups = $search->search('group', $this->add_category(array(\n\t\t\t\tarray('long_bottom_left', '<', $long),\n\t\t\t\tarray('long_top_right', '>', $long),\n\t\t\t\tarray('lat_bottom_left', '<', $lat),\n\t\t\t\tarray('lat_top_right', '>', $lat),\n\t\t\t\tarray('confirmed', '=', 1)\t\t\n\t\t\t\t), $category),\n\t\t\t\t'AND'\n\t\t\t);\n\t\t\t\n\t\t\t//Do another search with buffeering based on population density \n\t\t\t$gaze = factory::create('gaze');\n\t\t\t$radius_km = $gaze->get_radius_containing_population($long, $lat, POPULATION_THRESHOLD, MAX_KM_DISTANCE_BUFFER);\n\t\t\t\n\t\t\t//if that worked, do the other search\n\t\t\tif ($radius_km && $gaze->status !='service unavaliable' && !get_http_var('pointonly')) {\n\t\t\t\n\t\t\t\t//work out the buffered long / lat values\n\t\t\t\t$buffered_long = distance_to_longitude($radius_km);\n\t\t\t\t$buffered_lat = distance_to_latitude($radius_km);\n\n\t\t\t\t//make the bounding box\n\t\t\t\t$buffered_bottom_left_long = $long - $buffered_long;\n\t\t\t\t$buffered_bottom_left_lat = $lat - $buffered_lat;\n\t\t\t\t$buffered_top_right_long = $long + $buffered_long;\n\t\t\t\t$buffered_top_right_lat = $lat + $buffered_lat;\n\n\t\t\t\t//do the buffered searches (THIS IS REALY INEFFICANT BUT PEAR DATA OBJECTS DONT DO MIXED AND/OR SEARCHES)\n\t\t\t\t$groups_buffered = array();\n\t\t\t\t$groups_buffered1 = $search->search('group', $this->add_category(array(\n\t\t\t\t\tarray('long_bottom_left', '>', $buffered_bottom_left_long),\n\t\t\t\t\tarray('long_bottom_left', '<', $buffered_top_right_long),\n\t\t\t\t\tarray('lat_bottom_left', '>', $buffered_bottom_left_lat),\n\t\t\t\t\tarray('lat_bottom_left', '<', $buffered_top_right_lat),\n\t\t\t\t\tarray('confirmed', '=', 1)\t\t\t\t\n\t\t\t\t\t), $category),\n\t\t\t\t\t'AND'\n\t\t\t\t);\n\t\t\t\t$groups_buffered = array_merge($groups_buffered, $groups_buffered1);\n\t\t\t\t\n\t\t\t\t$groups_buffered2 = $search->search('group', $this->add_category(array(\n\t\t\t\t\tarray('long_top_right', '<', $buffered_top_right_long),\n\t\t\t\t\tarray('long_top_right', '>', $buffered_top_right_long),\n\t\t\t\t\tarray('lat_top_right', '>', $buffered_bottom_left_lat),\n\t\t\t\t\tarray('lat_top_right', '<', $buffered_top_right_lat),\n\t\t\t\t\tarray('confirmed', '=', 1)\t\t\t\t\n\t\t\t\t\t), $category),\n\t\t\t\t\t'AND'\n\t\t\t\t);\n\t\t\t\t$groups_buffered = array_merge($groups_buffered, $groups_buffered2);\n\t\t\t\t\n\t\t\t\t$groups_buffered3 = $search->search('group', $this->add_category(array(\n\t\t\t\t\tarray('long_bottom_left', '>', $buffered_bottom_left_long),\n\t\t\t\t\tarray('long_bottom_left', '<', $buffered_top_right_long),\n\t\t\t\t\tarray('lat_top_right', '>', $buffered_bottom_left_lat),\n\t\t\t\t\tarray('lat_top_right', '<', $buffered_top_right_lat),\n\t\t\t\t\tarray('confirmed', '=', 1)\t\t\t\t\n\t\t\t\t\t), $category),\n\t\t\t\t\t'AND'\n\t\t\t\t);\n\t\t\t\t$groups_buffered = array_merge($groups_buffered, $groups_buffered3);\n\t\t\t\t\n\t\t\t\t$groups_buffered4 = $search->search('group', $this->add_category(array(\n\t\t\t\t\tarray('long_top_right', '>', $buffered_bottom_left_long),\n\t\t\t\t\tarray('long_top_right', '<', $buffered_top_right_long),\n\t\t\t\t\tarray('lat_bottom_left', '>', $buffered_bottom_left_lat),\n\t\t\t\t\tarray('lat_bottom_left', '<', $buffered_top_right_lat),\n\t\t\t\t\tarray('confirmed', '=', 1)\t\t\t\t\n\t\t\t\t\t), $category),\n\t\t\t\t\t'AND'\n\t\t\t\t);\n\t\t\t\t$groups_buffered = array_merge($groups_buffered, $groups_buffered4);\n\n\t\t\t\t//if we have any buffered groups, add them in\n\t\t\t\tif($groups_buffered){\n\t\t\t\t\t$groups = array_merge($groups, $groups_buffered);\n\t\t\t\t\t\n\t\t\t\t\t//remove any duplicates (again should really be in the database call)\n\t\t\t\t\t$cleaned_groups = array();\n\t\t\t\t\tforeach ($groups as $group){\n\t\t\t\t\t\tif (!isset($cleaned_groups[$group->group_id]))\n\t\t\t\t\t\t\t$cleaned_groups[$group->group_id] = $group;\n\t\t\t\t\t}\n\t\t\t\t\t$groups = array_values($cleaned_groups);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tusort($groups, create_function('$a,$b',\n\t\t\t\t'\n\t\t\t\tif ($a->{category_id} < $b->{category_id}) return -1;\n\t\t\t\tif ($a->{category_id} > $b->{category_id}) return 1;\n\t\t\t\tif ($a->{zoom_level} < $b->{zoom_level}) return 1;\n\t\t\t\tif ($a->{zoom_level} > $b->{zoom_level}) return -1;\n\t\t\t\treturn 0;\n\t\t\t\t'\n\t\t\t));\n\n\t\t\t//Update the stats table\n\t\t\ttableclass_stat::increment_stat(\"search.count\");\n\t\t\t\n\t\t\t//Return search result\n\t\t\treturn array($groups, $long, $lat);\n\t\t\t\n\t\t}", "function results() {\n\t\t$query = $this->input->post('q');\n\t\t$type = $this->input->post('type');\n\t\t$group = $this->input->post('group');\n\t\t\n\t\t$params = $this->uri->uri_to_assoc(3);\n\t\tif ( isset($params['q']) ) $query = $params['q'];\n\t\tif ( isset( $params['page'] )\n\t\t\t&& is_int( $params['page'] ) ) {\n\t\t\t\t$page = $params['page'];\n\t\t\t} else {\n\t\t\t\t$page = 1;\n\t\t\t}\n\t\tif ( isset( $params['size'] )\n\t\t\t&& is_int( $params['size'] ) ) {\n\t\t\t\t$page_size = $params['size'];\n\t\t\t} else {\n\t\t\t\t$page_size = 25;\n\t\t\t}\n\t\t\n\t\t$query = trim($query);\n\t\t\n\t\t// see if this looks like an ISBN \n\t\t// FIXME dunno if we should keep this ability\n\t\tif( strlen($query) == 13 && is_int($query) && substr($query,0,3) == '978' ) {\n\t\t\t$this->load->model('products_model');\n\t\t\t$res = $this->products_model->get_product_by_ean( $query );\n\t\t\tif( $res->num_rows > 0 ) {\n\t\t\t\t$row = $res->row();\n\t\t\t\tredirect('/product/view/' . $row->id );\n\t\t\t}\n\t\t} elseif( strlen( $query ) > 0 ) {\n\t\t\t$res = $this->search_model->search($query, $type, $page, $page_size );\n\t\t\t$results = $res->result();\n\t\t} else {\n\t\t\t$results = array();\n\t\t}\n\t\t\n\t\t\n\t\t$prev = $next = false;\n\t\tif( $page > 1 ) {\n\t\t\t$prev_page = $page - 1;\n\t\t\t$params['page'] = $prev_page;\n\t\t\t$prev = '/search/results/' . $this->assoc_to_uri($params);\n\t\t}\n\t\tif ( count($results) > $page * $page_size ) {\n\t\t\t$next_page = $page + 1;\n\t\t\t$params['page'] = $next_page;\n\t\t\t$next = '/searc/results/' . $this->assoc_to_uri($params);\n\t\t}\n\n\n\t\t$nav['main'] = 'Home';\n\t\t$nav['sub'] = '';\n\t\t$data = array(\n\t\t\t'results' => $results,\n\t\t\t'page' => $page,\n\t\t\t'page_size' => $page_size,\n\t\t\t'query_string' => $query,\n\t\t\t'prev' => $prev,\n\t\t\t'next' => $next,\n\t\t\t'nav' => $nav\n\t\t\t);\t\t\n\t\t\t\t\n\t\t$this->load->view('search/results', $data);\n\t\t\t\t\n\t}", "function search($term, $fields=array(), $limit=array()) { /* {{{ */\n\t\t$querystr = '';\n\t\t$term = trim($term);\n\t\tif($term) {\n\t\t\t$querystr = substr($term, -1) != '*' ? $term.'*' : $term;\n\t\t}\n\t\tif(!empty($fields['owner'])) {\n\t\t\tif(is_string($fields['owner'])) {\n\t\t\t\tif($querystr)\n\t\t\t\t\t$querystr .= ' ';\n\t\t\t\t$querystr .= 'owner:'.$fields['owner'];\n\t\t\t} elseif(is_array($fields['owner'])) {\n\t\t\t\tif($querystr)\n\t\t\t\t\t$querystr .= ' ';\n\t\t\t\t$querystr .= '(owner:';\n\t\t\t\t$querystr .= implode(' OR owner:', $fields['owner']);\n\t\t\t\t$querystr .= ')';\n\t\t\t}\n\t\t}\n\t\tif(!empty($fields['category'])) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$querystr .= '(category:';\n\t\t\t$querystr .= implode(' OR category:', $fields['category']);\n\t\t\t$querystr .= ')';\n\t\t}\n\t\tif(!empty($fields['status'])) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$status = array_map(function($v){return $v+10;}, $fields['status']);\n\t\t\t$querystr .= '(status:';\n\t\t\t$querystr .= implode(' OR status:', $status);\n\t\t\t$querystr .= ')';\n\t\t}\n\t\tif(!empty($fields['user'])) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$querystr .= '(users:';\n\t\t\t$querystr .= implode(' OR users:', $fields['user']);\n\t\t\t$querystr .= ')';\n\t\t}\n\t\tif(!empty($fields['rootFolder']) && $fields['rootFolder']->getFolderList()) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$querystr .= '(path:';\n\t\t\t$querystr .= str_replace(':', 'x', $fields['rootFolder']->getFolderList().$fields['rootFolder']->getID().':');\n\t\t\t$querystr .= ')';\n\t\t}\n\t\tif(!empty($fields['startFolder']) && $fields['startFolder']->getFolderList()) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$querystr .= '(path:';\n\t\t\t$querystr .= str_replace(':', 'x', $fields['startFolder']->getFolderList().$fields['startFolder']->getID().':');\n\t\t\t$querystr .= ')';\n\t\t}\n\t\ttry {\n\t\t\t$result = $this->index->find($querystr, $limit);\n\t\t\t$recs = array();\n\t\t\tforeach($result[\"hits\"] as $hit) {\n\t\t\t\t$recs[] = array('id'=>$hit->id, 'document_id'=>$hit->documentid);\n\t\t\t}\n\t\t\treturn array('count'=>$result['count'], 'hits'=>$recs, 'facets'=>array());\n\t\t} catch (Exception $e) {\n\t\t\treturn false;\n\t\t}\n\t}", "private function filterTerm()\n {\n if(empty($this->term)) {\n return;\n }\n\n $this->query->andWhere(\n ['or',\n ['LIKE', 'message', $this->term],\n ['LIKE', 'category', $this->term],\n ]\n );\n }", "public function searchVocabulary($term, $query, $entityTypeID, $count = 100)\n {\n $useStartsWith = array('script_code' => 1,\n 'language_code' => 1,\n 'gender' => 1,\n 'nationality' => 1,\n 'subject' => 1,\n 'activity' => 1,\n 'occupation' => 1);\n $likeStr = \"%$query%\";\n if (isset($useStartsWith[$term]))\n {\n $likeStr = \"$query%\";\n }\n\n /*\n * $this->enableLogging();\n * $this->logDebug(\"sql.php term: $term likeStr: $likeStr\", array());\n */\n if ($entityTypeID == null)\n {\n $queryStr =\n 'select id,value,type,uri,description\n from vocabulary\n where type=$1 and value ilike $2 order by value asc limit $3';\n $result = $this->sdb->query($queryStr, array($term, $likeStr, $count));\n }\n else\n {\n /*\n * If we have a non-null entityTypeID then the type should be 'name_component'. We could check\n * that although it isn't really necessary. When called with some other type, no records will be\n * returned, presumably because the only values using entity_group are type='name_component'.\n *\n * The values for type name_component are at the end of the file install/sql_files/vocabulary.sql.\n *\n * We need an \"or\" clause because NameAddition and Date are used for multiple name\n * components. Ideally, NameAddition is person and corporateBody and not family, but to simplify\n * things we say null is all three for NameAddition and Date.\n *\n * If null becomes a problem, zero or some other integer that is not an entity type would probably\n * work just as well. Better perhaps since nulls preclude using entity_group in a primary key.\n *\n * It might be better to return these ordered by id instead of value. The UI may have expectations\n * about the order.\n */\n $queryStr =\n 'select id,value\n from vocabulary\n where type=$1 and value ilike $2 and (entity_group=$3 or entity_group is null) order by value asc limit 100';\n $result = $this->sdb->query($queryStr, array($term, $likeStr, $entityTypeID));\n }\n $all = array();\n while($row = $this->sdb->fetchrow($result))\n {\n array_push($all, $row);\n }\n /* Disable sorting name components, for now.\n * if ($term == 'name_component' && count($all) > 1)\n * {\n * return $this->specialSort($all);\n * }\n */\n return $all;\n }", "public function Search($term, &$maxScore) {\r\n if (!array_key_exists($term, $this->sql)) $this->Sql($term);\r\n $db = NetDesign::GetInstance()->MySQL();\r\n // Max score\r\n $maxScore = (int)$db->query(sprintf('SELECT MAX(`__score`) FROM (%s) AS `query` WHERE `__score` > 0', $this->sql[$term]), $this->params)->fetchColumn();\r\n // Perform query\r\n $query = array($this->sql[$term], 'HAVING `__score` > 0');\r\n if (!empty($this->orderBy)) $query[] = sprintf('ORDER BY %s', $this->orderBy);\r\n else $query[] = 'ORDER BY `__score` DESC';\r\n if (!empty($this->limit)) $query[] = sprintf('LIMIT %d, %d', $this->offset, $this->limit);\r\n $query = implode(' ', $query);\r\n $stmt = $db->query($query, $this->params);\r\n $ret = array();\r\n // Create NetDesignSearchRecord\r\n while ($record = $stmt->fetch(PDO::FETCH_ASSOC)) {\r\n // Unset all fields which aren't in this table\r\n $config = $this->config[$record['__table']];\r\n foreach($record as $key => $value) {\r\n if (in_array($key, array('__table', '__score'))) continue;\r\n if (array_key_exists($key, $config['select'])) continue;\r\n unset($record[$key]);\r\n }\r\n $cls = $config['recordClass'];\r\n $ret[] = new $cls($record);\r\n }\r\n return $ret;\r\n }", "public function getSearchResults() {\n\t\t\n\t\t$pages = array();\n\t\n\t\tif ($query = Core\\Request::query('query')) {\n\t\t\n\t\t\t$collection = $this->Automad->getCollection();\n\t\t\n\t\t\tif (array_key_exists($query, $collection)) {\n\t\t\t\n\t\t\t\t// If $query matches an actual URL of an existing page, just get that page to be the only match in the $pages array.\n\t\t\t\t// Since $pages has only one element, the request gets directly redirected to the edit page (see below).\n\t\t\t\t$pages = array($this->Automad->getPage($query));\n\t\t\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\t$Selection = new Core\\Selection($collection);\n\t\t\t\t$Selection->filterByKeywords($query);\n\t\t\t\t$Selection->sortPages(AM_KEY_MTIME . ' desc');\n\t\t\t\t$pages = $Selection->getSelection(false);\n\t\t\t\n\t\t\t}\n\t\n\t\t\t// Redirect to edit mode for a single result or in case $query represents an actually existing URL.\n\t\t\tif (count($pages) == 1) {\n\t\t\t\t$Page = reset($pages);\n\t\t\t\theader('Location: ' . AM_BASE_INDEX . AM_PAGE_DASHBOARD . '?context=edit_page&url=' . urlencode($Page->origUrl));\n\t\t\t\tdie;\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\treturn $pages;\n\t\t\n\t}", "public function search($terms, $page=1, $per_page=15)\n\t{\n\t\t$params = array(\n\t\t\t'q' => $terms,\n\t\t\t'start' => (($page - 1) * $per_page),\n\t\t\t'num' => $per_page,\n\t\t\t'output' => 'xml_no_dtd',\n\t\t\t'client' => 'google-csbe',\n\t\t\t'cx' => $this->site_search_key,\n\t\t\t'ie' => 'utf8',\n\t\t\t'oe' => 'utf8'\n\t\t);\n\n\t\t$url = 'http://www.google.com/search?' . http_build_query($params);\n\t\t$source = file_get_contents($url);\n\n\t\t$document = new \\DomDocument();\n\t\t$document->loadXml($source);\n\t\t$xpath = new \\DOMXpath($document);\n\t\t$results = new \\stdClass();\n\n\t\t$results->page = $page;\n\t\t$results->start = $xpath->evaluate('string(//RES/@SN)');\n\t\t$results->end = $xpath->evaluate('string(//RES/@EN)');\n\t\t$results->total_guess = $xpath->evaluate('string(//RES/M)');\n\t\t$results->has_more = $xpath->evaluate('boolean(//NU)');\n\t\t$results->suggestion = NULL;\n\t\t$results->results = array();\n\n\t\tif ($suggestion = $xpath->evaluate('string(//Spelling/Suggestion)')) {\n\t\t\t$results->suggestion = $suggestion;\n\t\t}\n\n\t\tforeach ($xpath->query('//RES/R') as $result) {\n\t\t\t$results->results[] = (object) array(\n\t\t\t\t'title' => $xpath->evaluate('string(T)', $result),\n\t\t\t\t'excerpt' => $xpath->evaluate('string(S)', $result),\n\t\t\t\t'url' => $xpath->evaluate('string(U)', $result)\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $results;\n\t}", "public static function search() {\r\n $result = lC_Default::find($_GET['q']);\r\n\r\n echo $result;\r\n }", "public function search(Request $request, RepoHost $rh, $term)\n {\n $args = $request->all();\n\n $maxhits = isset($args['maxhits']) ? $args['maxhits'] : 25;\n $page = isset($args['page']) ? $args['page'] : 0;\n $sort = isset($args['sort']) ? $args['sort'] : 'score';\n\n return $rh->search($term, $maxhits, $page, $sort);\n\n }", "function search($institution, $queryType, $queryTerm, $start=0, $limit=10)\n\t{\n\t\t\n\t\tif (strcasecmp($institution,'CASENT') == 0) { $institution = 'CASENT'; }\n\t\tif (strcasecmp($institution,'inbiocri') == 0) { $institution = 'CASENT'; }\n\t\tif (strcasecmp($institution,'lacment') == 0) { $institution = 'CASENT'; }\t\n\t\tif (strcasecmp($institution,'jtlc') == 0) { $institution = 'CASENT'; }\t\n\t\t\n\t\t\n\t\t$server = $this->serverURL[$institution];\n\t\t$resource = $this->resourceCode[$institution] ;\n\n\t\t// Build request message\n\t\t$tree = new XML_Tree();\n\n\t\t$root = & $tree->addRoot(\n\t\t\t\"request\",\n\t\t\t'',\n\t\t\tarray(\n\t\t\t\t\t\"xmlns\" => 'http://digir.net/schema/protocol/2003/1.0',\n\t\t\t\t\t\"xmlns:xsd\" => 'http://www.w3.org/2001/XMLSchema',\n\t\t\t\t\t\"xmlns:xsi\" => 'http://www.w3.org/2001/XMLSchema-instance',\n\t\t\t\t\t\"xmlns:digir\" => 'http://digir.net/schema/protocol/2003/1.0',\n\t\t\t\t\t\"xmlns:dwc\" => 'http://digir.net/schema/conceptual/darwin/2003/1.0',\n\t\t\t\t\t\"xmlns:darwin\" => 'http://digir.net/schema/conceptual/darwin/2003/1.0',\n\t\t\t\t\t\"xsi:schemaLocation\" => 'http://digir.net/schema/protocol/2003/1.0',\n\t\t\t\t\t\"xsi:schemaLocation\" => 'http://digir.net/schema/protocol/2003/1.0 http://digir.sourceforge.net/schema/protocol/2003/1.0/digir.xsd http://digir.net/schema/conceptual/darwin/2003/1.0 http://digir.sourceforge.net/schema/conceptual/darwin/2003/1.0/darwin2.xsd',\n\t\t\t\t\t)\n\t\t\t);\n\n\t\t$header = & $root->addChild(\"header\");\n\t\t$header->addChild(\"version\", \"1.0.0\");\n\t\t$header->addChild(\"sendTime\", date(\"Ymd \\TG:i:s\") ); \n\t\t$header->addChild(\"source\", $_SERVER['SERVER_ADDR']); \n\t\t$header->addChild(\"destination\", \n\t\t\t$server,\n\t\t\tarray(\n\t\t\t\t\"resource\" => $resource\n\t\t\t\t)\n\t\t\t); \n\t\t$header->addChild(\"type\", \"search\");\n\n\t\t$search = & $root->addChild(\"search\");\n\t\t$filter = & $search->addChild(\"filter\");\n\t\t$equals = & $filter->addChild(\"equals\");\n\t\t\n\t\tswitch($queryType)\n\t\t{\n\t\t\tcase 'genus':\n\t\t\t\t$equals->addChild(\"darwin:Genus\", $queryTerm);\n\t\t\t\tbreak;\n\t\t\tcase 'family':\n\t\t\t\t$equals->addChild(\"darwin:Family\", $queryTerm);\n\t\t\t\tbreak;\n\t\t\tcase 'class':\n\t\t\t\t$equals->addChild(\"darwin:Class\", $queryTerm);\n\t\t\t\tbreak;\n\t\t\tcase 'country':\n\t\t\t\t$equals->addChild(\"darwin:Country\", $queryTerm);\n\t\t\t\tbreak;\n\t\t\tcase 'specimen':\n\t\t\t\tswitch ($this->schema[$institution])\n\t\t\t\t{\n\t\t\t\t\tcase \"1.14\":\n\t\t\t\t\t\t$equals->addChild(\"darwin:CatalogNumber\", $queryTerm);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$equals->addChild(\"darwin:CatalogNumberText\", $queryTerm);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\n\t\t$records = & $search->addChild(\"records\",\n\t\t\t\"\",\n\t\t\tarray(\n\t\t\t\t\"limit\" => $limit,\n\t\t\t\t\"start\" => $start\n\t\t\t\t)\n\t\t\t);\n\t\t\t\tif ($this->schema[$institution] == '1.12')\n\t\t\t\t{\n\t\t\t\t$records->addChild(\"structure\",\n\t\t\t\t\t\"\",\n\t\t\t\t\tarray(\n\t//\t\t\t\t\t\"schemaLocation\" => \"http://bnhm.berkeley.museum/manis/DwC/darwin2resultfull.xsd\",\n\n\t\t\t\t\t\t\"schemaLocation\" => \"http://digir.sourceforge.net/schema/conceptual/darwin/result/full/2003/darwin2resultfull.xsd\",\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\n\t\t\t\t\t$structure = & $records->addChild(\"structure\", \"\");\n\n\t\t\t\t\t$element = & $structure->addChild(\"xsd:element\", \"\", \n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"name\" => \"record\"\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t$complexType = & $element->addChild(\"xsd:complexType\", \"\");\n\t\t\t\t\t$sequence = & $complexType->addChild(\"xsd:sequence\", \"\");\n\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:InstitutionCode\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:CollectionCode\"\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:CatalogNumber\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:ScientificName\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:VerbatimCollectingDate\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:DateLastModified\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:YearCollected\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:MonthCollected\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:DayCollected\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:TimeCollected\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Kingdom\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Phylum\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Class\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Order\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Family\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Genus\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Species\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Subspecies\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Country\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:StateProvince\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:County\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Island\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:IslandGroup\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:ContinentOcean\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Locality\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:HorizontalDatum\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Collector\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Remarks\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:TypeStatus\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:OtherCatalogNumbers\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:CollectorNumber\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:FieldNumber\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:GenBankNum\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Latitude\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Longitude\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Sex\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Notes\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:IdentifiedBy\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:YearIdentified\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:MonthIdentified\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:DayIdentified\"\n\t\t\t\t\t\t\t));\n\n\n\n\n\t\t\t\t}\n\t\t$xml = \t$tree->get();\n\n\t\t//echo $xml;\n\n\t\t// Strip XML header\n\t\t$xml = str_replace (\n\t\t\t'<?xml version=\"1.0\"?>', \n\t\t\t'', \n\t\t\t$xml);\n\n\t\t// Remove line breaks\n\t\t$xml = str_replace (\n\t\t\t\"\\n\", \n\t\t\t'', \n\t\t\t$xml);\n\n\t\t// Replace spaces with HEX code\n\t\t$xml = str_replace (\n\t\t\t\" \", \n\t\t\t'%20', \n\t\t\t$xml);\n\n\t\t\t//echo $xml;\n\n\t\t\t$url = \"http://$server?doc=\";\n\t\t\t$url .= $xml;\n\n\t\t//echo $url;\n\n\t\treturn $url;\n\n\n\n\t\t\n\t}", "public function __construct($term = '', $page = 1, $results_per_page = 10, $cache = false) {\n global $CFG;\n\n $this->term = $term;\n $this->pagenumber = $page;\n $this->cache = $cache;\n $this->validquery = true;\n $this->validindex = true;\n $this->results_per_page = $results_per_page;\n\n $index_path = SEARCH_INDEX_PATH;\n\n try {\n $this->index = new Zend_Search_Lucene($index_path, false);\n } catch(Exception $e) {\n $this->validindex = false;\n return;\n } \n\n if (empty($this->term)) {\n $this->validquery = false;\n } else {\n $this->set_query($this->term);\n } \n }", "public function searchTickets()\n {\n $user = Auth::user();\n $input = Input::all();\n\n $results = DB::table('tickets')\n ->where('ticket_id', 'LIKE', '%'.$input['q'].'%')\n ->orWhere('subject', 'LIKE', '%'.$input['q'].'%')\n ->orWhere('created_at', 'LIKE', '%'.$input['q'].'%')\n ->get();\n\n return view('search')->with('user', $user)->with('term', $input['q'])->with('results', $results);\n }", "public function getResultsSearch($textSearch, $obj) {\n if (!is_object($obj)) {\n return false;\n }\n \n $return = $obj->getSearch($textSearch, $this->limit, $this->offset);\n $this->totalRecords = $obj->getTotalRecordsSearch($textSearch);\n return $return;\n }", "public function runQuery($query, array $options = array())\n\t{\n\t\t$original_query = $query;\n\t\t\n\t\tif (isset($options['limit']) && isset($options['offset'])) {\n\t\t\t$query['query']['page'] = ($options['offset'] / $options['limit']);\n\t\t\t$query['query']['hitsPerPage'] = $options['limit'];\n\t\t}\n\t\t\n\t\t$query['terms'] = trim($query['terms']);\n\t\tif (isset($query['query']['numericFilters'])) {\n\t\t\t$query['query']['numericFilters'] = implode(',', $query['query']['numericFilters']);\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t$response = $this->getIndex()->search(array_get($query, 'terms'), array_get($query, 'query'));\n\t\t\t$this->stored_query_totals[md5(serialize($original_query))] = array_get($response, 'nbHits');\n\t\t} catch (\\Exception $e) {\n\t\t\t$response = array();\n\t\t}\n\t\t\n\t\t$results = array();\n\t\t\n\t\tif (array_get($response, 'hits')) {\n\t\t\tforeach (array_get($response, 'hits') as $hit) {\n\t\t\t\t$hit['id'] = array_get($hit, 'objectID');\n\t\t\t\t$hit['_score'] = 1;\n\t\t\t\t$results[] = $hit;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $results;\n\t}", "public function getResults( $searchTerm )\n\t{\n\t\t/* Check we have access */\n\t\tif( !$this->hasAccess() )\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t/* Init */\n\t\t$results = array();\n\t\t$searchTerm = mb_strtolower( $searchTerm );\n\t\t\n\t\t/* Perform the search */\n\t\t$members = \\IPS\\Db::i()->select( \"*\", 'core_members', \\IPS\\Db::i()->like( array( 'name', 'email' ), $searchTerm, TRUE, TRUE, $this->canPerformInlineSearch() ), NULL, 50 ); # Limit to 50 so it doesn't take too long to run\n\n\t\t/* Format results */\n\t\tforeach ( $members as $member )\n\t\t{\n\t\t\t$member = \\IPS\\Member::constructFromData( $member );\n\t\t\t\n\t\t\t$results[] = \\IPS\\Theme::i()->getTemplate('livesearch')->member( $member );\n\t\t}\n\t\t\t\t\t\n\t\treturn $results;\n\t}", "public function search($term)\n {\n $terms = explode(\" \", $term);\n\n $searchQuery = array();\n foreach ($terms as $term) {\n $term = $this->_localConfig->database()->quote(\"[[:<:]]\" . $term . \"[[:>:]]\");\n $searchQuery[] = \"(users.name regexp $term) * 5 + (users.username regexp $term)\";\n }\n\n $searchQuery = implode(\" + \", $searchQuery);\n\n $query = $this->selectAll();\n $query->columns(new Zend_Db_Expr(\"($searchQuery) as hits\"));\n $query->having('hits > 0');\n\n // We need to reset the ordering that was put on in selectAll()\n $query->reset( Zend_Db_Select::ORDER );\n $query->order(\"hits DESC\");\n\n $rows = $this->_localConfig->database()->fetchAll($query);\n\n $models = array();\n foreach ($rows as $row) {\n $model = $this->_getContainer()->User()->setData($row);\n $models[] = $model;\n }\n\n return $models;\n }", "public function search($term, $start = null, $end = null)\n {\n $ci = & get_instance();\n $ci->load->model('talks_model', 'talksModel');\n $ci->load->model('user_attend_model', 'userAttend');\n\n $sql = sprintf(\n \"\n select\n u.username,\n u.full_name,\n u.ID,\n u.admin,\n u.active,\n u.last_login,\n u.email\n from\n user u\n where\n lower(username) like %s or\n lower(full_name) like %s\n \", $this->db->escape('%' . $term . '%'), $this->db->escape('%' . $term . '%')\n );\n $query = $this->db->query($sql);\n $results = $query->result();\n foreach ($results as $key => $user) {\n $results[$key]->talk_count = count(\n $ci->talksModel->getSpeakerTalks($user->ID)\n );\n $results[$key]->event_count = count(\n $ci->userAttend->getUserAttending($user->ID)\n );\n }\n\n return $results;\n }", "public function getRecipeByName($searchTerm)\n {\n \n $db = getAdapter(); \n $statement = $db->createStatement(\"SELECT * FROM Recipe WHERE recipeName LIKE '%\".$searchTerm.\"%'\");\n $result = $statement->execute();\n $rowset = new ResultSet;\n $rowset->initialize($result); \n return $rowset; \n }", "protected function mactut_search(string $term): string\n {\n $proxy = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\Subugoe\\Mathematicians\\Proxy\\MactutProxy::class);\n\n return $proxy->search($term);\n }", "private function searchTag()\n {\n $term = $_REQUEST['term'];\n \n $list = array();\n $sql = \"SELECT * \n FROM \" . TAGS_TBL . \" \n WHERE tag_title LIKE '$term%'\";\n try\n {\n $rows = $this->db->select($sql);\n }\n catch(Exception $Exception){}\n \n if($rows)\n {\n foreach($rows as $index => $row)\n {\n $list[] = stripslashes(trim(ucwords(strtolower($row->tag_title))));\n }\n }\n \n $str = implode('\",\"', $list);\n if($str)\n {\n echo '[\"' . $str . '\"]';\n }\n else\n {\n echo '[]';\n }\n \n exit;\n }", "public function searchAction() {\n\t\n\t if($this->getRequest()->isXmlHttpRequest()){\n\t\n\t $term = $this->getParam('term');\n\t $id = $this->getParam('id');\n\t\n\t if(!empty($term)){\n\t $term = \"%$term%\";\n\t $records = Invoices::findbyCustomFields(\"formatted_number LIKE ? OR number LIKE ?\", array($term, $term));\n\t die(json_encode($records));\n\t }\n\t\n\t if(!empty($id)){\n\t $records = Invoices::find($id);\n\t if($records){\n\t $records = $records->toArray();\n\t }\n\t die(json_encode(array($records)));\n\t }\n\t\n\t $records = Invoices::getAll();\n\t die(json_encode($records));\n\t }else{\n\t die();\n\t }\n\t}", "private function search($result, $keyword)\n {\n return $result->filter(function ($item) use ($keyword) {\n return false !== (stristr($item[\"name\"], $keyword) || stristr($item[\"member_id\"], $keyword));\n })->values();\n }", "public function searchAction()\n {\n $search = $this->createSearchObject();\n $result = $search->searchWord($this->view->word);\n $this->view->assign($result);\n\n if (Model_Query::$debug) {\n $this->view->actionTrace = [\n 'action' => sprintf('%s::searchWord()', get_class($search)),\n 'result' => $result,\n ];\n\n $this->view->queryTrace = Model_Query::$trace;\n }\n\n }", "function display_elastic_search ($q, $filter=null, $from = 0, $size = 20, $callback = '')\n{\n\tglobal $elastic;\n\t\n\t$status = 404;\n\t\t\t\t\n\tif ($q == '')\n\t{\n\t\t$obj = new stdclass;\n\t\t$obj->hits = new stdclass;\n\t\t$obj->hits->total = 0;\n\t\t$obj->hits->hits = array();\n\t\t\n\t\t$status = 200;\n\t}\n\telse\n\t{\t\t\n\t\t// query type\t\t\n\t\t$query_json = '';\n\t\t\n\t\tif ($filter)\n\t\t{\n\t\t\tif (isset($filter->author))\n\t\t\t{\n\t\t\t\t// author search is different( but not working yet)\t\n\t\t\t\t$query_json = \t\t\n\t'{\n\t\"size\":50,\n \"query\": {\n \"bool\": {\n \"must\": [ {\n\t\t\t\t \"multi_match\" : {\n\t\t\t\t \"query\": \"<QUERY>\",\n\t\t\t\t \"fields\":[\"search_data.author\"] \n\t\t\t\t}\n\t\t\t\t}]\n }\n }\n\t}';\n\t\t\t$query_json = str_replace('<QUERY>', $q, $query_json);\n\t\t\t\n\t\t\t// echo $query_json;\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t// default is search on fulltext fields\n\t\tif ($query_json == '')\n\t\t{\n\t\t\t$query_json = '{\n\t\t\t\"size\":50,\n\t\t\t\t\"query\": {\n\t\t\t\t\t\"bool\" : {\n\t\t\t\t\t\t\"must\" : [ {\n\t\t\t\t \"multi_match\" : {\n\t\t\t\t \"query\": \"<QUERY>\",\n\t\t\t\t \"fields\":[\"search_data.fulltext\", \"search_data.fulltext_boosted^4\"] \n\t\t\t\t}\n\t\t\t\t}],\n\t\t\t\"filter\": <FILTER>\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"aggs\": {\n\t\t\t\"type\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.type.keyword\" }\n\t\t\t },\n\t\t\t \"year\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.year\" }\n\t\t\t },\n\t\t\t \"container\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.container.keyword\" }\n\t\t\t },\n\t\t\t \"author\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.author.keyword\" }\n\t\t\t },\n\t\t\t \"classification\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.classification.keyword\" }\n\t\t\t } \n\n\t\t\t}\n\n\t\n\t\t\t}';\n\t\t\t\n\t\t\t$query_json = str_replace('<QUERY>', $q, $query_json);\n\t\t}\n\t\n\t$filter_string = '[]';\n\t\n\tif ($filter)\n\t{\n\t\t$f = array();\n\t\t\n\t\tif (isset($filter->year))\n\t\t{\n\t\t\t$one_filter = new stdclass;\n\t\t\t$one_filter->match = new stdclass;\n\t\t\t$one_filter->match->{'search_data.year'} = $filter->year;\n\t\t\t\n\t\t\t$f[] = $one_filter;\t\t\t\n\t\t}\n\n\t\t// this doesn't work\n\t\tif (isset($filter->author))\n\t\t{\n\t\t\t$one_filter = new stdclass;\n\t\t\t$one_filter->match = new stdclass;\n\t\t\t$one_filter->match->{'search_data.author'} = $filter->author;\n\t\t\t\n\t\t\t$f[] = $one_filter;\t\t\t\n\t\t}\n\t\t\n\t\t$filter_string = json_encode($f);\n\t}\n\t\n\t$query_json = str_replace('<FILTER>', $filter_string, $query_json);\n\t\n\t\n\t$resp = $elastic->send('POST', '_search?pretty', $post_data = $query_json);\n\t\n\n\t\t$obj = json_decode($resp);\n\n\t\t$status = 200;\n\t}\n\t\n\tapi_output($obj, $callback, 200);\n}", "public function search();", "public function search();", "public static function runSearch($searchTerm, $tag = null) {\n $conditions = [];\n $sql = \"SELECT DISTINCT h.title, h.source, h.url, h.start_date\n FROM media_highlights h\";\n if($tag) {\n $sql .= \" JOIN mediahighlights_tags t ON t.mediahighlight_id = h.id\";\n $sql .= \" JOIN media_highlight_tags mt ON mt.name = :tag AND mt.id = t.tag_id\";\n\t\t\t\t\t\t$conditions['tag'] = $tag;\n }\n $sql .= \" WHERE h.is_archived = 0\";\n if($searchTerm) {\n $sql .= \" AND MATCH(h.title, h.source) AGAINST (:search_term)\";\n $conditions['search_term'] = \"%$searchTerm%\";\n }\n $sql .= \" ORDER BY h.start_date DESC\";\n $items = DB::select($sql, $conditions);\n return self::hydrate($items); // takes the raw query and turns it into a collection of models\n }", "public function searchAction()\n\t{\n\t\t// search query\n\t\tif (empty($_GET['query'])) {\n\t\t\t$this->_forward('index');\n\t\t}\n\n\t\t$raw_query = urldecode($_GET['query']);\n\n\t\t// explicitly check to see if it's a barcode\n\t\t$tickets = Tickets::getByBarcode($raw_query);\n\n\t\t// that didn't work; now do a generic search\n\t\tif (empty($tickets)) {\n\t\t\t// split the query up into terms; these are ANDed together by the search function\n\t\t\t// TODO: fullstop too\n\t\t\t$terms = preg_split('/[\\s\\t-_()\\[\\]\\/\\\\,\"\\']+/', $raw_query, PREG_SPLIT_NO_EMPTY);\n\t\t\t$tickets = Tickets::getBySearch($terms, User::isAdmin());\n\t\t}\n\n\t\tif (!empty($tickets)) {\n\t\t\t$this->view->tickets = $tickets;\n\n\t\t\t// if a single ticket, run a check to see if it has been scanned before, \n\t\t\t// or is invalid\n\t\t\tif (count($tickets) == 1) {\n\t\t\t\t$ticket = reset($tickets);\n\n\t\t\t\tif (!$ticket['received_payment']) {\n\t\t\t\t\t$this->view->flagNoPayment = TRUE;\n\t\t\t\t}\n\t\t\t\t$day = date('l', time());\n\n\t\t\t\t// HACK TODO: Magic numbers.\n\t\t\t\tif (($ticket['ticket_type_id'] == 2 && $day == 'Sunday') ||\n\t\t\t\t ($ticket['ticket_type_id'] == 3 && $day == 'Saturday'))\n\t\t\t\t{\n\t\t\t\t\t$this->view->flagWrongDay = TRUE;\n\t\t\t\t}\n\n\t\t\t\t// has this been scanned before?\n\t\t\t\t$scans = Tickets::getScans($ticket['barcode']);\n\t\t\t\tif (!empty($scans)) {\n\t\t\t\t\t$this->view->flagScannedBefore = TRUE;\n\t\t\t\t\t$this->view->scans = $scans;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// no tickets, bail out.\n\t\t$this->view->flagFailedSearch = TRUE;\n\t\t$this->_forward('index');\n\t}", "function getsearch_get(){\n $keyword = $this->get('keyword');\n $result = $this->lecturers_model->getsearch_all($keyword);\n $this->response($result); \n\n }", "public function getResults($query)\n {\n return $this->elasticsearch->search(array_merge(['index' => $this->indexName], $query));\n }", "public function search()\n {\n // acquire the supplied data field or throw an exception\n $field = $this->getConfig('fieldKey');\n $userData = $this->request->getData();\n if (!isset($userData[$field])) {\n throw new BadRequestException('Missing data field');\n }\n \n // retrieve the response from the restful server\n $resource = $this->getConfig('resourceUrl');\n $resourceLoader = new ResourceLoader($resource);\n $data = $resourceLoader->search($userData[$field]);\n \n return [\n 'term' => $data->term,\n 'results' => $data->results,\n ];\n }", "protected static function display_results() {\n $locale = self::$locale;\n self::$composevars = \"method=\".self::get_param('method').\"&amp;datelimit=\".self::get_param('datelimit').\"&amp;fields=\".self::get_param('fields').\"&amp;sort=\".self::get_param('sort').\"&amp;order=\".self::get_param('order').\"&amp;chars=\".self::get_param('chars').\"&amp;forum_id=\".self::get_param('forum_id').\"&amp;\";\n add_to_title($locale['global_201'].$locale['408']);\n\n $search_text = explode(' ', urldecode(self::$search_text));\n $qualified_search_text = [];\n $disqualified_search_text = [];\n\n /*\n * @todo: roadmap on author\n */\n self::$fields_count = self::get_param('fields') + 1;\n for ($i = 0, $k = 0; $i < count($search_text); $i++) {\n if (strlen($search_text[$i]) >= 3) {\n $qualified_search_text[] = $search_text[$i];\n for ($j = 0; $j < self::$fields_count; $j++) {\n // It is splitting to 2 parts.\n self::$search_param[':sword'.$k.$j] = '%'.$search_text[$i].'%';\n }\n $k++;\n } else {\n $disqualified_search_text[] = $search_text[$i];\n }\n }\n unset($search_text);\n self::$swords = $qualified_search_text;\n\n self::$c_swords = count($qualified_search_text) ?: redirect(FUSION_SELF);\n self::$i_swords = count($disqualified_search_text);\n\n self::$swords_keys_for_query = array_keys(self::$search_param);\n self::$swords_values_for_query = array_values(self::$search_param);\n\n // Highlight using Jquery the words. This, can actually parse as settings.\n $highlighted_text = \"\";\n $i = 1;\n foreach ($qualified_search_text as $value) {\n $highlighted_text .= \"'\".$value.\"'\";\n $highlighted_text .= ($i < self::$c_swords ? \",\" : \"\");\n $i++;\n }\n add_to_footer(\"<script type='text/javascript' src='\".INCLUDES.\"jquery/jquery.highlight.js'></script>\");\n add_to_jquery(\"$('.search_result').highlight([\".$highlighted_text.\"],{wordsOnly:true}); $('.highlight').css({backgroundColor:'#FFFF88'});\");\n\n /*\n * Run the drivers via include.. but this method need to change to simplify the kiss concept.\n */\n if (self::get_param('stype') == \"all\") {\n $search_deffiles = [];\n $search_includefiles = makefilelist(INCLUDES.'search/', '.|..|index.php|location.json.php|users.json.php|.DS_Store', TRUE, 'files');\n $search_infusionfiles = makefilelist(INFUSIONS, '.|..|index.php', TRUE, 'folders');\n if (!empty($search_infusionfiles)) {\n foreach ($search_infusionfiles as $files_to_check) {\n if (is_dir(INFUSIONS.$files_to_check.'/search/')) {\n $search_checkfiles = makefilelist(INFUSIONS.$files_to_check.'/search/', \".|..|index.php\", TRUE, \"files\");\n $search_deffiles = array_merge($search_deffiles, $search_checkfiles);\n }\n }\n }\n $search_files = array_merge($search_includefiles, $search_deffiles);\n\n foreach ($search_files as $key => $file_to_check) {\n if (preg_match(\"/include.php/i\", $file_to_check)) {\n if (file_exists(INCLUDES.\"search/\".$file_to_check)) {\n self::__Load(INCLUDES.\"search/\".$file_to_check);\n }\n\n foreach ($search_infusionfiles as $inf_files_to_check) {\n if (file_exists(INFUSIONS.$inf_files_to_check.'/search/'.$file_to_check)) {\n self::__Load(INFUSIONS.$inf_files_to_check.'/search/'.$file_to_check);\n }\n }\n }\n }\n } else {\n if (file_exists(INCLUDES.\"search/search_\".self::get_param('stype').\"_include.php\")) {\n self::__Load(INCLUDES.\"search/search_\".self::get_param('stype').\"_include.php\");\n }\n\n $search_infusionfiles = makefilelist(INFUSIONS, '.|..|index.php', TRUE, 'folders');\n foreach ($search_infusionfiles as $inf_files_to_check) {\n if (file_exists(INFUSIONS.$inf_files_to_check.'/search/search_'.self::get_param('stype').'_include.php')) {\n self::__Load(INFUSIONS.$inf_files_to_check.'/search/search_'.self::get_param('stype').'_include.php');\n }\n }\n }\n\n // Show how many disqualified search texts\n $c_iwords = count($disqualified_search_text);\n if ($c_iwords) {\n $txt = \"\";\n for ($i = 0; $i < $c_iwords; $i++) {\n $txt .= $disqualified_search_text[$i].($i < $c_iwords - 1 ? \", \" : \"\");\n }\n echo \"<div class='well m-t-10 text-center strong'>\".sprintf($locale['502'], $txt).\"</div><br />\";\n }\n\n /*$c_search_result_array = count(self::$search_result_array);\n\n if (self::get_param('stype') == \"all\") {\n $from = self::get_param('rowstart');\n $to = ($c_search_result_array - (self::get_param('rowstart') + 10)) <= 0 ? $c_search_result_array : self::get_param('rowstart') + 10;\n } else {\n $from = 0;\n $to = $c_search_result_array < 10 ? $c_search_result_array : 10;\n }*/\n\n /*\n * HTML output\n */\n if (self::get_param('stype') == \"all\") {\n parent::search_navigation(0);\n echo strtr(Search::render_search_count(), [\n '{%search_count%}' => self::$items_count,\n '{%result_text%}' => ((self::$site_search_count > 100 || parent::search_globalarray(\"\")) ? \"<br/>\".sprintf($locale['530'], self::$site_search_count) : \"<br/>\".self::$site_search_count.\" \".$locale['510'])\n ]);\n } else {\n echo strtr(Search::render_search_count(), [\n '{%search_count%}' => self::$items_count,\n '{%result_text%}' => ((self::$site_search_count > 100 || parent::search_globalarray(\"\")) ? \"<br/><strong>\".sprintf($locale['530'], self::$site_search_count).\"</strong>\" : (empty(self::$site_search_count) ? $locale['500'] : ''))\n ]);\n }\n\n echo \"<div class='search_result'>\\n\";\n echo \"<div class='block'>\\n\";\n foreach (self::$search_result_array as $results) {\n echo $results;\n }\n\n // Now it is by per module. Therefore rowstart does not apply\n //for ($i = $from; $i < $to; $i++) {\n // echo self::$search_result_array[$i];\n //}\n echo \"</div>\\n\";\n echo \"</div>\\n\";\n\n if (self::get_param('stype') != \"all\") {\n echo self::$navigation_result;\n }\n }", "public function action_search()\n\t{\n\t\tglobal $txt, $context;\n\n\t\t// What can we search for?\n\t\t$subActions = array(\n\t\t\t'internal' => array($this, 'action_search_internal', 'permission' => 'admin_forum'),\n\t\t\t'online' => array($this, 'action_search_doc', 'permission' => 'admin_forum'),\n\t\t\t'member' => array($this, 'action_search_member', 'permission' => 'admin_forum'),\n\t\t);\n\n\t\t// Set the subaction\n\t\t$action = new Action('admin_search');\n\t\t$subAction = $action->initialize($subActions, 'internal');\n\n\t\t// Keep track of what the admin wants in terms of advanced or not\n\t\tif (empty($context['admin_preferences']['sb']) || $context['admin_preferences']['sb'] != $subAction)\n\t\t{\n\t\t\t$context['admin_preferences']['sb'] = $subAction;\n\n\t\t\t// Update the preferences.\n\t\t\trequire_once(SUBSDIR . '/Admin.subs.php');\n\t\t\tupdateAdminPreferences();\n\t\t}\n\n\t\t// Setup for the template\n\t\t$context['search_type'] = $subAction;\n\t\t$context['search_term'] = $this->_req->getPost('search_term', 'trim|\\\\ElkArte\\\\Util::htmlspecialchars[ENT_QUOTES]');\n\t\t$context['sub_template'] = 'admin_search_results';\n\t\t$context['page_title'] = $txt['admin_search_results'];\n\n\t\t// You did remember to enter something to search for, otherwise its easy\n\t\tif ($context['search_term'] === '')\n\t\t{\n\t\t\t$context['search_results'] = array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$action->dispatch($subAction);\n\t\t}\n\t}" ]
[ "0.6722495", "0.6616307", "0.65830904", "0.6424559", "0.6418078", "0.6389337", "0.6376947", "0.63332725", "0.6316672", "0.6306289", "0.62978053", "0.6274504", "0.6252879", "0.62103695", "0.6150591", "0.6148551", "0.608889", "0.60886025", "0.6067412", "0.6030703", "0.5988406", "0.5988406", "0.59728855", "0.5951209", "0.59379315", "0.58522713", "0.58369726", "0.5832878", "0.58129144", "0.5804085", "0.57681674", "0.5758108", "0.57343835", "0.57271826", "0.5717335", "0.5711923", "0.5711647", "0.5702922", "0.57000965", "0.56963915", "0.56963366", "0.56935877", "0.5691059", "0.56786054", "0.5657386", "0.5657386", "0.56433755", "0.5609213", "0.559915", "0.5596709", "0.55897045", "0.55733657", "0.5571397", "0.5565774", "0.55657226", "0.55558354", "0.5536901", "0.5536209", "0.5523517", "0.55217606", "0.5517184", "0.5505429", "0.5504383", "0.54938805", "0.54871476", "0.5472191", "0.5468092", "0.5464038", "0.54623777", "0.54617983", "0.5453327", "0.5452679", "0.5451947", "0.5435722", "0.54347897", "0.5434364", "0.5432428", "0.54274863", "0.54227364", "0.5421312", "0.54180074", "0.5414207", "0.54032236", "0.5402518", "0.5397698", "0.5394954", "0.5391038", "0.53900623", "0.5382109", "0.5373622", "0.53578514", "0.5357297", "0.5357297", "0.53547645", "0.5352955", "0.5351854", "0.53497994", "0.5349408", "0.53475136", "0.5347141" ]
0.5880935
25
Proccess the raw ouput from a HTTP request over TMDb into an associative array read as JSON.
public function consumeRawOutput($outputRaw=''){ #If for some unexpected reason it's an empty response, return error message (for future improvement: log the url as it can be an functional error) if(!strlen($outputRaw)) return ["success" => 0, "msg" => "Empty response from TMDb"]; #If for some unexpected reason it's not a JSON response, return error message (for future improvement: log the url and the output as it can be an functional error) if((substr($outputRaw,0,1)!='{') && (substr($outputRaw,0,1)!='[')) return ["success" => 0, "msg" => "Not a JSON response from TMDb"]; #Decode the raw JSON output into an associative array $outputData = json_decode($outputRaw,TRUE); #If there is an error on JSON parsing, return error message (for future improvement: log the url and the output as it can be an functional error) if(json_last_error() != JSON_ERROR_NONE) return ["success" => 0, "msg" => "Not a valid JSON response from TMDb (Error ".json_last_error().")"]; #Return the data return ["success" => 1, "data" => $outputData]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTTNData() {\n\n\t\t$obj = new stdClass();\n\n\t\t$obj->app_id = $this->node->getAppID();\n\t\t$obj->dev_id = $this->node->getDevID();\n\t\t$obj->hardware_serial = $this->node->getHwSerial();\n\n\t\t$obj->port = $this->port;\n\t\t$obj->counter = $this->counter;\n\t\t$obj->payload_raw = $this->payload_raw;\n\t\t$obj->metadata = $this->meta->getTTNMeta();\n\n\t\treturn json_encode($obj);\n\t}", "public static function getJson()\n {\n /*\n {\n \"block_hash\": \"0000000000000000c504bdea36e531d8089d324f2d936c86e3274f97f8a44328\",\n \"block_height\": 293000,\n \"hash\": \"f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449\",\n \"addresses\": [\n \"13XXaBufpMvqRqLkyDty1AXqueZHVe6iyy\",\n \"19YtzZdcfs1V2ZCgyRWo8i2wLT8ND1Tu4L\",\n \"1BNiazBzCxJacAKo2yL83Wq1VJ18AYzNHy\",\n \"1GbMfYui17L5m6sAy3L3WXAtf1P32bxJXq\",\n \"1N2f642sbgCMbNtXFajz9XDACDFnFzdXzV\"\n ],\n \"total\": 70320221545,\n \"fees\": 0,\n \"preference\": \"low\",\n \"relayed_by\": \"\",\n \"confirmed\": \"2014-03-29T01:29:19Z\",\n \"received\": \"2014-03-29T01:29:19Z\",\n \"ver\": 1,\n \"lock_time\": 0,\n \"double_spend\": false,\n \"vin_sz\": 4,\n \"vout_sz\": 1,\n \"confirmations\": 59116,\n \"confidence\": 1,\n \"inputs\": [\n {\n \"prev_hash\": \"583910b7bf90ab802e22e5c25a89b59862b20c8c1aeb24dfb94e7a508a70f121\",\n \"output_index\": 1,\n \"script\": \"4830450220504b1ccfddf508422bdd8b0fcda2b1483e87aee1b486c0130bc29226bbce3b4e022100b5befcfcf0d3bf6ebf0ac2f93badb19e3042c7bed456c398e743b885e782466c012103b1feb40b99e8ff18469484a50e8b52cc478d5f4f773a341fbd920a4ceaedd4bf\",\n \"output_value\": 16450000,\n \"sequence\": 4294967295,\n \"addresses\": [\n \"1GbMfYui17L5m6sAy3L3WXAtf1P32bxJXq\"\n ],\n \"script_type\": \"pay-to-pubkey-hash\"\n },\n {\n \"prev_hash\": \"f6966bb3d3ba0eb97fd11b223fb13c793c0b4a1b3deb575e8ae38d666c1d00d9\",\n \"output_index\": 36,\n \"script\": \"48304502210086de855e03008abcc49335c775973eab9ace2e16c3bfe6536218c1d029287fdb0220129ced657870af63f61cdd4b941996f9a243d1f306e774fc9c5f3dea0af8d581012103cbe40d1d790799a6494c07f844eaf05b4c6deab0b9dee2ee45c8decead12c5cd\",\n \"output_value\": 10061545,\n \"sequence\": 4294967295,\n \"addresses\": [\n \"19YtzZdcfs1V2ZCgyRWo8i2wLT8ND1Tu4L\"\n ],\n \"script_type\": \"pay-to-pubkey-hash\"\n },\n {\n \"prev_hash\": \"9ea2f9695e6694309fb0d8b966afb4678a77a59f160822e33819fada9e0c8288\",\n \"output_index\": 1,\n \"script\": \"48304502201f1eb5b79279258a91c00dee09dff5d6f6ece7c01639e66a6bdd579136ecddee022100d4a9ed93183bf338e51ba80bc1dd10ff03e9e159bd8ea59db3a5c10aa0ccd3400121022667ee37e180c1ad2fef6f16aa52ed27799f629364dfe51e144dd683317dbbd2\",\n \"output_value\": 70000000000,\n \"sequence\": 4294967295,\n \"addresses\": [\n \"1BNiazBzCxJacAKo2yL83Wq1VJ18AYzNHy\"\n ],\n \"script_type\": \"pay-to-pubkey-hash\"\n },\n {\n \"prev_hash\": \"279ccbbab8605390a85fe6f0e4fb04ec1946ee6033054b16fec72e1304742d5d\",\n \"output_index\": 0,\n \"script\": \"483045022100baac0c25867855f62592872cfac522d59fddd590a6cc290c8ad3bbe6b1151b5802204f2713c565ce6b00e5ea00e955d35e3b0878af5474feda35ebbb73232122d5480121023ed3b44ad598e3834e561efed205c221b7bc2e577e752eeaa66e85e60d0381c9\",\n \"output_value\": 293710000,\n \"sequence\": 4294967295,\n \"addresses\": [\n \"13XXaBufpMvqRqLkyDty1AXqueZHVe6iyy\"\n ],\n \"script_type\": \"pay-to-pubkey-hash\"\n }\n ],\n \"outputs\": [\n {\n \"value\": 70320221545,\n \"script\": \"76a914e6aad9d712c419ea8febf009a3f3bfdd8d222fac88ac\",\n \"spent_by\": \"35832d6c70b98b54e9a53ab2d51176eb19ad11bc4505d6bb1ea6c51a68cb92ee\",\n \"addresses\": [\n \"1N2f642sbgCMbNtXFajz9XDACDFnFzdXzV\"\n ],\n \"script_type\": \"pay-to-pubkey-hash\"\n }\n ],\n \"next_inputs\": \"https://api.blockcypher.com/v1/btc/main/txs/f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449?instart=2\\u0026outstart=1\\u0026limit=1\",\n \"error\": \"\",\n \"errors\": []\n }\n */\n\n /** @noinspection SpellCheckingInspection */\n return '{\"block_hash\":\"0000000000000000c504bdea36e531d8089d324f2d936c86e3274f97f8a44328\",\"block_height\":293000,\"hash\":\"f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449\",\"addresses\":[\"13XXaBufpMvqRqLkyDty1AXqueZHVe6iyy\",\"19YtzZdcfs1V2ZCgyRWo8i2wLT8ND1Tu4L\",\"1BNiazBzCxJacAKo2yL83Wq1VJ18AYzNHy\",\"1GbMfYui17L5m6sAy3L3WXAtf1P32bxJXq\",\"1N2f642sbgCMbNtXFajz9XDACDFnFzdXzV\"],\"total\":70320221545,\"fees\":0,\"preference\":\"low\",\"relayed_by\":\"\",\"confirmed\":\"2014-03-29T01:29:19Z\",\"received\":\"2014-03-29T01:29:19Z\",\"ver\":1,\"lock_time\":0,\"double_spend\":false,\"vin_sz\":4,\"vout_sz\":1,\"confirmations\":59116,\"confidence\":1,\"inputs\":[' . TXInputTest::getJson() . '],\"outputs\":[' . TXOutputTest::getJson() . '],\"next_inputs\":\"https://api.blockcypher.com/v1/btc/main/txs/f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449?instart=2\\u0026outstart=1\\u0026limit=1\",\"error\":\"\",\"errors\":[]}';\n }", "public function requestData() {\n\t\t// Set up cURL \n\t\t$curl = curl_init($this->query); \n\t\tcurl_setopt($curl, CURLOPT_POST, false); \n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\t$response = curl_exec($curl);\n\t\tcurl_close($curl);\n\t\t\t\n\t\treturn $this->parseAPIResponse($response);\n\t}", "public function fetchOutput_Raw() {\n list($headers, $body) = $this->getInputModule()->fetchOutput_Raw();\n\n $url = $this->getParameter('url');\n\n // Set up the request for HTTP POST, including the body.\n $req =& new HTTP_Request($url);\n $req->setMethod('POST');\n $req->setBody($body);\n\n // Send whitelisted headers with request.\n $headers_in_whitelist = array_merge(\n array( 'content-type' ),\n $this->getParameter('headers_in_whitelist', array())\n );\n foreach ($headers as $name => $value) {\n if (in_array(strtolower($name), $headers_in_whitelist))\n $req->addHeader($name, $value);\n }\n\n // Fire off the request, get the headers and body.\n $rv = $req->sendRequest();\n $headers = $req->getResponseHeader();\n $body = $req->getResponseBody();\n\n // Pass along only whitelisted headers.\n $headers_out = array();\n $headers_out_whitelist = array_merge(\n array( 'content-type' ),\n $this->getParameter('headers_out_whitelist', array())\n );\n foreach ($headers as $name => $value) {\n if (in_array(strtolower($name), $headers_out_whitelist))\n $headers_out[$name] = $value;\n }\n\n return array($headers_out, $body);\n }", "public function getResponseData();", "public function fetchData()\n {\n // TODO Build URI and add PARAMS, METHODS, API TOKEN etc...\n // TODO Handle POST, GET requests using curl\n // TODO Authentication\n $path = $this->endpoint;\n return json_decode(file_get_contents($path, true));\n }", "private function getJSON(){\n return json_encode($this->getResponseStructure());\n }", "private function parse_result(){\n return json_decode($this->result);\n }", "public function getResponse() : array;", "public function parse(): object\n {\n $parsed = [\n 'host_status' => $this->host_status,\n 'raw' => $this->results,\n ];\n\n if (count($this->round_trip_time) > 0) {\n $parsed['latency'] = $this->round_trip_time['avg'];\n $parsed['rtt'] = (object) $this->round_trip_time;\n }\n\n if (count($this->sequence) > 0) {\n $parsed['sequence'] = (object) $this->sequence;\n }\n\n if (count($this->statistics) > 0) {\n $parsed['statistics'] = (object) $this->statistics;\n }\n\n return (object) $parsed;\n }", "private function _getResponse( $link ) {\n App::import('Core', 'HttpSocket');\n $HttpSocket = new HttpSocket();\n $response = $HttpSocket->get($link); \n \n //Remove non ascii chars - JSON will break because Meetup allows non-ascii characters \n //hack from http://www.stemkoski.com/php-remove-non-ascii-characters-from-a-string/ \n $response = str_replace(\"\\n\",\"[NEWLINE]\",$response); \n $response = preg_replace('/[^(\\x20-\\x7F)]*/','', $response); \n $response = str_replace(\"[NEWLINE]\",\"\\n\",$response); \n \n //decode the returned JSON into a PHP array \n $my_array = json_decode( $response, true ); \n\n return( $my_array ); \n\n }", "public function request(){\n\t\t$request = file_get_contents('php://input');\n\t\treturn json_decode($request,true);\n\t}", "public function getResponse(): array;", "public function getParsedResponse()\n {\n return json_decode($this->response);\n }", "function getTransactions() {\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_URL => \"https://hackathon-be.mybluemix.net/customer/304fd2e19f1c14fe3345cca788e4e83d/amexprofitability\",\n\t CURLOPT_USERAGENT => 'BankBase BOC Hackathon Request'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\n\t$resp_decode = json_decode($resp);\n\treturn $resp_decode;\n}", "public function getResponseData()\n {\n return json_decode($this->responseData);\n }", "private function getResponseData()\n {\n $response = Shopware()->Front()->Response();\n\n return array(\n 'Class' => get_class($response),\n 'Raw header' => $response->getRawHeaders(),\n 'Response code' => $response->getHttpResponseCode(),\n 'Exception' => $response->getException()\n );\n }", "public function getRawResponse();", "public function getVerboseResponse() \n {\n $this->execute();\n \n if ($this->error) {\n return $this->error;\n }\n \n $contentType = $this->getContentType();\n \n $body = ($this->def['dataType'] == 'array' || strpos($contentType, 'json') !== false) ? static::data2json($this->responseText) : $this->responseText;\n \n return [\n 'status' => $this->status,\n 'body' => $body, \n 'info' => $this->responseInfo,\n 'header' => $this->responseHeaders,\n 'request_header' => $this->getRequestHeaders(),\n 'content_type' => $contentType\n ];\n }", "public function getRequestJson(){\n $requestArray = $this->prepareRequestContent($this->prepareRequestMeta());\n \n return json_encode($requestArray);\n }", "public static function json()\n {\n return json_decode(file_get_contents('php://input'), true);\n }", "public static function json()\n {\n return json_decode(file_get_contents('php://input'), true);\n }", "public function gatherFrameworkData()\n {\n $output = array();\n\n // GET variables\n if (count($_GET) == 0) {\n $output['get'] = __d('shared', 'No GET data exists');\n } else {\n $output['get'] = array();\n\n foreach ($_GET as $key => $value) {\n if (! is_numeric($key)) {\n $key = \"'\".$key.\"'\";\n }\n\n if (is_array($value)) {\n $output['get']['&#36;_GET['. $key .']'] = '<pre>'. htmlspecialchars(stripslashes(print_r($value, TRUE))) .'</pre>';\n } else {\n $output['get']['&#36;_GET['. $key .']'] = htmlspecialchars(stripslashes($value));\n }\n }\n }\n\n // POST variables\n if (count($_POST) == 0) {\n $output['post'] = __d('shared', 'No POST data exists');\n } else {\n $output['post'] = array();\n\n foreach ($_POST as $key => $value) {\n if (! is_numeric($key)) {\n $key = \"'\".$key.\"'\";\n }\n\n if (is_array($value)) {\n $output['post']['&#36;_POST['. $key .']'] = '<pre>'. htmlspecialchars(stripslashes(print_r($value, TRUE))) .'</pre>';\n } else {\n $output['post']['&#36;_POST['. $key .']'] = htmlspecialchars(stripslashes($value));\n }\n }\n }\n\n // Server Headers\n $output['headers'] = array();\n\n $headers = array(\n 'HTTP_ACCEPT',\n 'HTTP_USER_AGENT',\n 'HTTP_CONNECTION',\n 'SERVER_PORT',\n 'SERVER_NAME',\n 'REMOTE_ADDR',\n 'SERVER_SOFTWARE',\n 'HTTP_ACCEPT_LANGUAGE',\n 'SCRIPT_NAME',\n 'REQUEST_METHOD',\n ' HTTP_HOST',\n 'REMOTE_HOST',\n 'CONTENT_TYPE',\n 'SERVER_PROTOCOL',\n 'QUERY_STRING',\n 'HTTP_ACCEPT_ENCODING',\n 'HTTP_X_FORWARDED_FOR'\n );\n\n foreach ($headers as $header) {\n $value = (isset($_SERVER[$header])) ? $_SERVER[$header] : '';\n\n $output['headers'][$header] = $value;\n }\n\n // Store the information.\n $this->output['variables'] = $output;\n }", "public function getRequestData()\n {\n return json_decode($this->requestData);\n }", "protected function getJsonDecodedFromPost(){\n // $this->app->response()->header(\"Content-Type\", \"application/json\");\n // obtain the JSON of the body of the request\n $post = json_decode($this->app->request()->getBody(), true); // make it a PHP associative array\n return $post;\n }", "protected function asArray()\n\t{\n\t\treturn \\json_decode($this->response, true);\n\t}", "protected function CrOrgn() {\n header(\"Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}\");\n $postdata = file_get_contents(\"php://input\");\n return json_decode($postdata);\n }", "private function __parse_intput() {\n $requests = JsonParser::decode($this->__raw_input);\n if (is_array($requests) === false or\n empty($requests[0])) {\n $requests = array($requests);\n }\n return ($requests);\n }", "public function get_body()\n {\n return json_decode(file_get_contents('php://input'), TRUE);\n }", "abstract protected function getAdditionalJsonData(): array;", "public function callbackResponse()\n {\n return json_decode(file_get_contents('php://input'));\n }", "public function getEncodedResponse()\n {\n /**\n * Processing Commads List\n */\n if (isset($this->_Response['Commands']) && (!count($this->_Response['Commands']))) unset($this->_Response['Commands']);\n\n /**\n * Processing profiler data\n */\n if (PHP2_System_Profiler::getInstance()->getEnabled())\n {\n $this->_Response['SystemInfo']['Profiler'] = PHP2_System_Profiler::getInstance()->__toHTML();\n }\n\n return $this->_getJSONEncodedResponse();\n }", "public function getRequestData(){\n\t\treturn array( \n \t\t\t'cmd' => $this->getRequestCommand(), \n \t\t\t'params' => $this->getParams() \n\t\t); \n\t}", "public function getArrayResp()\n {\n return json_decode(Yii::$app->request->post(), false);\n }", "function get_records()\n {\n $db = new DB();\n $conn = $db->connect();\n if (empty($conn)) {\n $statusCode = 404;\n $rawData = array(\n 'error' => 'No databases found!'\n );\n } else {\n $statusCode = 200;\n }\n $sql = \"SELECT id, key_name AS user_agent FROM user_agents;\";\n $result = $conn->query($sql);\n $rows = array();\n while ($r = mysqli_fetch_assoc($result)) {\n $rows[] = $r;\n }\n $requestContentType = $_SERVER['HTTP_ACCEPT'];\n $this->setHttpHeaders($requestContentType, $statusCode);\n if (strpos($requestContentType, 'text/html') !== false) {\n $response = $this->encodeHtml($rows);\n echo $response;\n } else if ((strpos($requestContentType, 'application/xml') !== false) || (strpos($requestContentType, 'text/xml') !== false)) {\n $this->setHttpHeaders('application/xml', $statusCode);\n $response = $this->encodeXml($rows);\n echo $response;\n } else {\n #This case is either request type is json or empty\n $this->setHttpHeaders(\"application/json\", $statusCode);\n $response = json_encode($rows);\n echo $response;\n }\n $conn->close();\n }", "private function handleQuery ()\n {\n $result = $this->executeCurl();\n $httpCode = curl_getinfo($this->cURL, CURLINFO_HTTP_CODE);\n\n if ($httpCode != 200 && $httpCode != 201)\n {\n throw new HttpException($httpCode, $result);\n }\n\n return json_decode($result, true);\n }", "public function read()\n {\n $data = array();\n // $result contains the output string\n $result = json_decode(curl_exec($this->connection));\n\n if($result){\n // Cycle through results\n foreach ($result as $row){\n $entity = new Vacancy($row);\n $data[] = $entity;\n }\n }\n return $data;\n }", "public function getData()\n {\n $data = json_decode(file_get_contents(static::INPUT_STREAM), true);\n\n if ($data) {\n return array_merge($this->data->getAll(), $data);\n }\n\n if ($this->isMethod(self::GET)) {\n return array_merge($this->data->getAll(), $_GET);\n }\n\n if ($this->isMethod(self::POST)) {\n return array_merge($this->data->getAll(), $_POST);\n }\n\n return [];\n }", "public function response() {\n return json_decode($this->response);\n }", "private function http_data( $response, $infohashes, string $host ) {\n\t\t$torrents_data = array();\n\n\t\tforeach ( $infohashes as $infohash ) {\n\t\t\t$ben_hash = '/' . preg_quote( pack( 'H*', $infohash ), '/' );\n\t\t\t$search_string = $ben_hash . 'd(8:completei(\\d+)e)?(10:downloadedi(\\d+)e)?(10:incompletei(\\d+)e)?/';\n\t\t\tpreg_match( $search_string, $response, $matches );\n\t\t\tif ( ! empty( $matches ) ) {\n\t\t\t\t$torrent_info['seeders'] = $matches[2] ? intval( $matches[2] ) : 0;\n\t\t\t\t$torrent_info['completed'] = $matches[4] ? intval( $matches[4] ) : 0;\n\t\t\t\t$torrent_info['leechers'] = $matches[6] ? intval( $matches[6] ) : 0;\n\t\t\t\t$torrents_data[ $infohash ] = $torrent_info;\n\t\t\t} else {\n\t\t\t\t$this->collect_infohash( $infohash );\n\t\t\t\t$this->errors[] = 'Invalid infohash (' . $infohash . ') for tracker: ' . $host . '.';\n\t\t\t}\n\t\t}\n\n\t\treturn $torrents_data;\n\t}", "public function getExportAllEdcFromTerminal(){\n\t\t$token = $this->input->cookie('token');\n\t\t\t\n\t\t$api = api_url.\"/api/report/\";\n\n\t\t$curl = curl_init($api);\n\n\t\tcurl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\n\n\t\tcurl_setopt($curl, CURLOPT_HTTPHEADER, array(\n\t\t'Content-Type: application/json',\n\t\t'token: Bearer '.$token)\n\t\t);\n\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true); // Make it so the data coming back is put into a string\n\t\t\n\n\t\t// Send the request\n\t\t$result = curl_exec($curl);\n\n\t\t// Free up the resources $curl is using\n\t\tcurl_close($curl);\n\t\t$jsonData = json_decode($result,true);\n\n\t\t\n\n\t\treturn (object) $jsonData;\n\t}", "private function make_response_array($response) {\n $myarray = array();\n $data = explode(\"\\n\", $response);\n if (strpos($data[0], 'HTTP') === 0) {\n // the first line is a status code\n $myarray['status'] = $data[0];\n array_shift($data);\n }\n foreach ($data as $part) {\n if (json_decode($part)) {\n $myarray[] = json_decode($part);\n continue;\n }\n $middle = explode(\": \", $part, 2);\n $myarray[trim($middle[0])] = trim($middle[1]);\n }\n return $myarray;\n }", "private function http_data($response, $infohashes, $host)\n {\n $torrents_data = [];\n\n foreach ($infohashes as $infohash) {\n $ben_hash = '20:' . pack('H*', $infohash) . 'd';\n $start_pos = strpos($response, $ben_hash);\n if (false !== $start_pos) {\n $start = $start_pos + 24;\n $head = substr($response, $start);\n $end = strpos($head, 'ee') + 1;\n $data = substr($response, $start, $end);\n\n $seeders = '8:completei';\n $torrent_info['seeders'] = $this->get_information($data, $seeders, 'e');\n\n $completed = '10:downloadedi';\n $torrent_info['completed'] = $this->get_information($data, $completed, 'e');\n\n $leechers = '10:incompletei';\n $torrent_info['leechers'] = $this->get_information($data, $leechers, 'e');\n\n $torrents_data[$infohash] = $torrent_info;\n } else {\n $this->collect_infohash($infohash);\n $this->errors[] = 'Invalid infohash (' . $infohash . ') for tracker: ' . $host . '.';\n }\n }\n\n return $torrents_data;\n }", "protected function _jsonData()\n {\n $ob = new stdClass;\n $ob->response = $this->data;\n\n $stack = $GLOBALS['notification']->notify(array(\n 'listeners' => 'status',\n 'raw' => true\n ));\n if (!empty($stack)) {\n $ob->msgs = $stack;\n }\n\n if (!empty($this->tasks)) {\n $ob->tasks = $this->tasks;\n }\n\n return $ob;\n }", "public function getRawData() {}", "function _parse_raw_http_request_urlencoded($input)\n{\n $post_data = array();\n\n $pairs = explode('&', $input);\n foreach ($pairs as $pair) {\n $exploded = explode('=', $pair, 2);\n if (count($exploded) == 2) {\n $key = urldecode($exploded[0]);\n $val = urldecode($exploded[1]);\n if (get_magic_quotes_gpc()) {\n $val = addslashes($val);\n }\n\n if (substr($key, -2) == '[]') {\n $key = substr($key, 0, strlen($key) - 2);\n if (!isset($post_data[$key])) {\n $post_data[$key] = array();\n }\n $post_data[$key][] = $val;\n } else {\n $post_data[$key] = $val;\n }\n }\n }\n\n return $post_data;\n}", "private function process($data) {\n\t\treturn json_decode($data, true);\n\t}", "protected function analyzeResponse() {\n\t\tvar_dump($this->curlResponse);\n\t\t$parts = explode(\"\\r\\n\\r\\n\", $this->curlResponse);\n\n\t\t$response_body = array_pop($parts);\n\t\t$response_headers = implode('', $parts);\n\t\t$http_status_code = $this->curl->getinfo(CURLINFO_HTTP_CODE); \n\n\t\treturn array(trim($response_headers), trim($response_body), $http_status_code);\n\t}", "public function getData()\n {\n $this->validate();\n\n $result = $this->getResult();\n\n if (substr($result, 0, 3) == '{\\\"') {\n $result = stripslashes($result);\n }\n\n $response = json_decode($result, true);\n\n $data = $response[$this->key];\n $data['sign'] = $response['sign'];\n $data['sign_type'] = $response['sign_type'];\n\n return $data;\n }", "public function getAll()\n {\n return $this->jsonToArray($this->applyEncode($this->download()));\n }", "function get_record($process_id)\n{\n\t$obj = new stdclass;\n\t$obj->status = 404;\n\t$obj->process_id = $process_id;\n\t\n\t$url = 'http://www.boldsystems.org/index.php/API_Public/combined?ids=' . $process_id;\n\t$url .= '&format=xml';\n\t$xml = get($url);\n\t\n\tif ($xml != '')\n\t{\t\t\t\t\n\t\t$obj->status = 200;\n\t\t\n\t\t$dom = new DOMDocument;\n\t\t$dom->loadXML($xml);\n\t\t$xpath = new DOMXPath($dom);\n\t\n\t\t$nodeCollection = $xpath->query ('//nucleotides');\n\t\tforeach($nodeCollection as $node)\n\t\t{\n\t\t\t$obj->nucleotides = $node->firstChild->nodeValue;\n\t\t}\n\t\t$nodeCollection = $xpath->query ('//bin_uri');\n\t\tforeach($nodeCollection as $node)\n\t\t{\n\t\t\t$obj->bin_uri = $node->firstChild->nodeValue;\n\t\t}\n\t\t\n\t\t$nodeCollection = $xpath->query ('//coordinates/lat');\n\t\tforeach($nodeCollection as $node)\n\t\t{\n\t\t\t$obj->lat = $node->firstChild->nodeValue;\n\t\t}\n\t\t$nodeCollection = $xpath->query ('//coordinates/lon');\n\t\tforeach($nodeCollection as $node)\n\t\t{\n\t\t\t$obj->lon = $node->firstChild->nodeValue;\n\t\t}\n\t}\n\t\n\t\n\treturn $obj;\n}", "protected function process($input)\n {\n if ($this->responseType !== \"json\") {\n return $input;\n }\n\n // Unpack JSON Data\n $result = json_decode($input, true);\n\n // Catch decoding errors -- turn a bad JSON input into an empty result set\n // containing an appropriate error code.\n if (!$result) {\n $result = array(\n 'recordCount' => 0,\n 'documents' => array(),\n 'errors' => array(\n array(\n 'code' => 'PHP-Internal',\n 'message' => 'Cannot decode JSON response: ' . $input\n )\n )\n );\n }\n\n // Detect errors\n if (isset($result['errors']) && is_array($result['errors'])) {\n foreach ($result['errors'] as $current) {\n $errors[] = \"{$current['code']}: {$current['message']}\";\n }\n $msg = 'Unable to process query<br />Summon returned: ' .\n implode('<br />', $errors);\n throw new SerialsSolutions_Summon_Exception($msg);\n }\n\n return $result;\n }", "public function getData($asArray = false)\r\n {\r\n return json_decode($this->response, $asArray);\r\n }", "public function execute(): object\n {\n $this->buildRequest();\n $client = new HttpClient();\n Log::debug('Creating Digicert Request', [\n 'Method' => $this->requestMethod,\n 'RequestURI' => $this->requestUri,\n 'Options' => $this->options,\n ]);\n RateLimiter::checkLimit();\n $request = $client->request($this->requestMethod, $this->requestUri, $this->options);\n \n return json_decode($request->getBody());\n }", "function processResponse($strResponse) {\n\t\tlist($theHeaders, $theBody) = explode(\"\\r\\n\\r\\n\", $strResponse, 2);\n\t\treturn array('headers' => $theHeaders, 'body' => $theBody);\n\t}", "function getData() {\n checkIfNotAjax();\n $this->libauth->check(__METHOD__);\n $cpData = $this->BeOnemdl->getDataTable();\n $this->BeOnemdl->outputToJson($cpData);\n }", "public function getReturnValues()\n\t{\n\t\t$session = Yii::$app->session;\n\t\t$time = $session->get('screenshotid');\n\t\t$module = Yii::$app->moduleManager->getModule('performance_insights');\n\t\t$moduleBasePath = $module->getBasePath();\n\t\t$imgUrl = Yii::$app->getModule('performance_insights')->getAssetsUrl() . '/screenshots/' . 'screenshot_' . $time . '.png';\n\t\t$inp = $this->readFromLocalFile();\n\t\t$tempArray = json_decode($inp,true);\n\t\t$timeInSec = $this->convertToSeconds($tempArray['fullLoadedTime']);\n\t\t$pageSize = $this->convertToReadableSize($tempArray['responseLength']);\n\t\treturn [\n\t\t\t'timeInSec' => $timeInSec,\n\t\t\t'pageSize' => $pageSize,\n\t\t\t'imgUrl' => $imgUrl\n\t\t];\n\t}", "function http_parse_response()\n\t{\n\t\tlist($headers, $body) = explode(\"\\r\\n\\r\\n\", $this->http_response, 2);\n\t\t$this->http_parse_headers($headers);\n\n\t\tif(isset($this->http_response_headers['Transfer-Encoding']) && 'chunked' == $this->http_response_headers['Transfer-Encoding']):\n \t\t$this->http_response_body = $this->http_chunked_decode($body);\n\t\telse:\n\t\t\t$this->http_response_body = $body;\n\t\tendif;\n\n\t\t$this->http_set_content_type($this->http_default_content_type);\n\t}", "public function getData()\n {\n return (object) $this->_response;\n }", "public function getjson( Request $request ) {\n // This condition checks the `Content-type` and makes sure to \n // decode JSON string from the request body into array.\n if ( 0 === strpos( $request->headers->get( 'Content-Type' ), 'application/json' ) ) {\n $params = json_decode( $request->getContent(), TRUE );\n $request->request->replace( is_array( $params ) ? $params : [] );\n }\n //Using our service to get all the data from the table vizh5p\n $db_logic = \\Drupal::service('vizh5p.db_logic');\n $data = $db_logic->get();\n $datauserarray = array();\n $datacidarray = array();\n $dataattemptarray = array();\n //selecting distinct content id\n foreach ($data as $d) {\n if(!in_array($d->content_id , $datacidarray))\n array_push($datacidarray , $d->content_id);\n }\n sort($datacidarray);\n $cid = $datacidarray[$params['content_id']]; //Finding the content id\n foreach ($data as $d) { //Selecting username based on content id\n if($d->content_id == $cid)\n if(!in_array($d->actor , $datauserarray))\n array_push($datauserarray , $d->actor);\n }\n sort($datauserarray);\n $actor = $datauserarray[$params['username']]; //Finding the username\n\t $i = 0;\n foreach ($data as $d) {\n if($cid == $d->content_id && $actor == $d->actor && $d->verb == 'attempted') {\n $i++;\n array_push($dataattemptarray , $i);\n }\n }\n $attempt = $dataattemptarray[$params['attempt']];\n \n $response = array();\n $c = array();\n $cu = array();\n $cua = array();\n $temp = array();\n $length = count($data);\n for($i = 0 ; $i < $length ; $i++){\n if($data[$i]->content_id == $cid && $data[$i]->verb == \"attempted\"){\n $temp = array();\n $user = $data[$i]->actor;\n array_push($temp , $data[$i]);\n for($j = $i + 1 ; $j < $length ; $j++){\n if($data[$j]->content_id == $cid && $user == $data[$j]->actor && $data[$j]->verb == \"attempted\")\n break;\n if($data[$j]->content_id == $cid && $user == $data[$j]->actor)\n array_push($temp , $data[$j]);\n }\n $case = findtype($temp);\n if($case == \"4\") {\n $len = count($temp);\n $atime = $temp[0]->time;\n $i1time = $temp[1]->time;\n $i2time = $temp[$len - 2]->time;\n $antime = $temp[$len - 1]->time;\n $atime = explode(\".\" , $atime);\n $i1time = explode(\".\" , $i1time);\n $i2time = explode(\".\" , $i2time);\n $antime = explode(\".\" , $antime);\n $t1 = strtotime($atime[0]) . \".\" . $atime[1];\n $t2 = strtotime($i1time[0]) . \".\" . $i1time[1];\n $t3 = strtotime($i2time[0]) . \".\" . $i2time[1];\n $t4 = strtotime($antime[0]) . \".\" . $antime[1];\n array_push($c , array($t2 - $t1 , $t3 - $t2 , $len - 2, $t4 - $t3));\n }\n }\n }\n $length = count($c);\n $response[0][0] = 0;\n $response[0][1] = 0;\n $response[0][2] = 0;\n $response[0][3] = 0;\n for($i = 0 ; $i < $length ; $i++){\n $response[0][0] += $c[$i][0];\n $response[0][1] += $c[$i][1];\n $response[0][2] += $c[$i][2];\n $response[0][3] += $c[$i][3];\n }\n $response[0][0] /= $length;\n $response[0][1] /= $length;\n $response[0][2] /= $length;\n $response[0][3] /= $length;\n \n $length = count($data);\n for($i = 0 ; $i < $length ; $i++){\n if($data[$i]->content_id == $cid && $data[$i]->actor == $actor && $data[$i]->verb == \"attempted\"){\n $temp = array();\n array_push($temp , $data[$i]);\n for($j = $i + 1 ; $j < $length ; $j++){\n if($data[$j]->content_id == $cid && $actor == $data[$j]->actor && $data[$j]->verb == \"attempted\")\n break;\n if($data[$j]->content_id == $cid && $actor == $data[$j]->actor)\n array_push($temp , $data[$j]);\n }\n $case = findtype($temp);\n if($case == \"4\") {\n $len = count($temp);\n $atime = $temp[0]->time;\n $i1time = $temp[1]->time;\n $i2time = $temp[$len - 2]->time;\n $antime = $temp[$len - 1]->time;\n $atime = explode(\".\" , $atime);\n $i1time = explode(\".\" , $i1time);\n $i2time = explode(\".\" , $i2time);\n $antime = explode(\".\" , $antime);\n $t1 = strtotime($atime[0]) . \".\" . $atime[1];\n $t2 = strtotime($i1time[0]) . \".\" . $i1time[1];\n $t3 = strtotime($i2time[0]) . \".\" . $i2time[1];\n $t4 = strtotime($antime[0]) . \".\" . $antime[1];\n array_push($cu , array($t2 - $t1 , $t3 - $t2 , $len - 2 , $t4 - $t3));\n }\n }\n }\n $length = count($cu);\n $response[1][0] = 0;\n $response[1][1] = 0;\n $response[1][2] = 0;\n $response[1][3] = 0;\n for($i = 0 ; $i < $length ; $i++){\n $response[1][0] += $cu[$i][0];\n $response[1][1] += $cu[$i][1];\n $response[1][2] += $cu[$i][2];\n $response[1][3] += $cu[$i][3];\n }\n $response[1][0] /= $length;\n $response[1][1] /= $length;\n $response[1][2] /= $length;\n $response[1][3] /= $length;\n $i = 0;\n foreach ($data as $d) { //Checking attempt number\n if($d->content_id == $cid && $d->actor == $actor && $d->verb == 'attempted') \n $i++;\n if($d->content_id == $cid && $d->actor == $actor && $i == $attempt)\n array_push($cua , $d);\n }\n $case = findtype($cua);\n $response[2][0] = 0;\n $response[2][1] = 0;\n $response[2][2] = 0;\n $response[2][3] = 0;\n if($case == \"2\") {\n $atime = $temp[0]->time;\n $i1time = $temp[1]->time;\n $atime = explode(\".\" , $atime);\n $i1time = explode(\".\" , $i1time);\n $t1 = strtotime($atime[0]) . \".\" . $atime[1];\n $t2 = strtotime($i1time[0]) . \".\" . $i1time[1];\n $cua = array($t2 - $t1);\n $response[2][0] = $cua[0];\n $response[2][2] = 1;\n } elseif($case == \"4\") {\n $len = count($cua);\n $atime = $cua[0]->time;\n $i1time = $cua[1]->time;\n $i2time = $cua[$len - 2]->time;\n $antime = $cua[$len - 1]->time;\n $atime = explode(\".\" , $atime);\n $i1time = explode(\".\" , $i1time);\n $i2time = explode(\".\" , $i2time);\n $antime = explode(\".\" , $antime);\n $t1 = strtotime($atime[0]) . \".\" . $atime[1];\n $t2 = strtotime($i1time[0]) . \".\" . $i1time[1];\n $t3 = strtotime($i2time[0]) . \".\" . $i2time[1];\n $t4 = strtotime($antime[0]) . \".\" . $antime[1];\n $cua = array($t2 - $t1 , $t3 - $t2 , $len - 2 , $t4 - $t3);\n $response[2][0] = $cua[0];\n $response[2][1] = $cua[1];\n $response[2][2] = $cua[2];\n $response[2][3] = $cua[3];\n }\n return new JsonResponse( $response );\n }", "public function getRequestData();", "#[Pure]\nfunction http_get_request_body() {}", "public function data() {\n $request = $this->requestReader->getContents();\n\t\tif ($request) {\n if ($json_post = CJSON::decode($request)){\n\t\t\t\treturn $json_post;\n\t\t\t}else{\n\t\t\t\tparse_str($request,$variables);\n\t\t\t\treturn $variables;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "protected function getContentObject()\n {\n return json_decode($this->response->getContent());\n }", "public static function getJson() {\n\t if(self::isJson()) {\n\t $content = json_decode(file_get_contents('php://input'),1);\t \n\t if($content && is_array($content)) {\n\t return $content;\n\t }\n\t }\n\t return array();\n;\n\t}", "function extract_TAM($json)\n{\n\t# [ticket ] => Ticket reservation code, ie, record locator\n\t# [origem ] => Origin location, as written on ticket\n\t# [destino ] => Destination location. For round-trips not the return destination!\n\t# [idaevolta ] => Flag for round-trip tickets. 0 or 1\n\t# [saida ] => Date/time of departure, 'YYYY-MM-DD HH:mm'\n\t# [chegada ] => Date/time of arrival on destination\n\t# [passageiro] => Passengers list, multiple names joined with ', ' (for AZUL only)\n\t# [voo ] => flight code, as written on ticket\n\t# [milhas ] => Miles spent, integer\n\t# [taxas ] => Boarding fees, float\n\t# [moeda ] => Currency (BRL, USD)\n\n\t$idaevolta = (count($json['ITINERARY_DATA']) > 1) ? 1 : 0;\n\t$ida = $json['ITINERARY_DATA'][0];\n\n\t$data = array();\n\n\t$data['companhia'] = 'TAM';\n\t$data['ticket'] = $json['ArVal'][68];\n\t$data['origem'] = location_TAM($ida['B_LOCATION']);\n\t$data['destino'] = location_TAM($ida['E_LOCATION']);\n\t$data['idaevolta'] = $idaevolta;\n\n\t$data = trip_TAM($json, $data); # Inbound\n\tif($idaevolta)\n\t\t$data = trip_TAM($json, $data, 1); # Outbound\n\n\t$data['milhas'] = 0; # could be in JSON, but is not in email\n\t$data['taxas'] = floatval($json['ArVal'][67]);\n\t$data['moeda'] = $json['ArVal'][66];\n\n\t$data['passageiro'] = ''; # In HTML, not JSON\n\n\treturn $data;\n}", "private function _postResponse( $link ) {\n App::import('Core', 'HttpSocket');\n $HttpSocket = new HttpSocket();\n $response = $HttpSocket->post($link); \n \n //Remove non ascii chars - JSON will break because Meetup allows non-ascii characters \n //hack from http://www.stemkoski.com/php-remove-non-ascii-characters-from-a-string/ \n $response = str_replace(\"\\n\",\"[NEWLINE]\",$response); \n $response = preg_replace('/[^(\\x20-\\x7F)]*/','', $response); \n $response = str_replace(\"[NEWLINE]\",\"\\n\",$response); \n \n //decode the returned JSON into a PHP array \n $my_array = json_decode( $response, true ); \n\n return( $my_array ); \n\n }", "public function getAuthDataFromResponse(): array;", "private function parse($body)\n {\n parse_str($body, $response_array);\n $response = array();\n foreach ($response_array as $k => $v) {\n $key = str_replace('VP', '', $k);\n $response[$key] = $v;\n }\n\n return $response;\n }", "public function get_data(): array;", "public function get_data(): array;", "private function get_db_data() {\r\n\r\n\t\t$db_data = array(\r\n\t\t\t'twitter_id' => $this->api_post_id,\r\n\t\t\t'created_on' => date( 'Y-m-d H:i:s' ),\r\n\t\t\t'time_stamp' => date( 'Y-m-d H:i:s', CTF_Parse_Pro::get_timestamp( $this->api_data ) ),\r\n\t\t\t'last_requested' => date( 'Y-m-d H:i:s' ),\r\n\t\t\t'json_data' => ctf_json_encode( $this->api_data ),\r\n\t\t\t'media_id' => '',\r\n\t\t\t'sizes' => '{}',\r\n\t\t\t'aspect_ratio' => 1,\r\n\t\t\t'images_done' => 0\r\n\t\t);\r\n\r\n\t\treturn $db_data;\r\n\t}", "static function get_data_from_callback()\n {\n $callbackJSONData = file_get_contents('php://input');\n return json_decode($callbackJSONData);\n }", "private function getDataFromApi(): array\n {\n // Input parameters\n $params = [\n 'requests' => json_encode($this->prepareRequests()),\n 'responseType' => 'CSV'\n ];\n\n $result = $this->eapi->sendRequest('', $params);\n $decoded = json_decode($result, true);\n if(is_array($decoded)){\n return $decoded;\n } else {\n throw new \\Exception(\"Non-JSON object or empty response returned from API.\");\n }\n }", "private function getResponseStructure(){\n $success = [];\n if($this->success == false){\n //WE have to show the error\n $success = [];\n $success[\"success\"] = $this->success;\n $success[\"error_code\"] = $this -> error_code;\n $success[\"error_msg\"] = $this -> error_message;\n }else{\n\n $success = [];\n $success[\"success\"] = $this->success;\n if($this->total_elements > 0){\n $success[\"total_elements\"] = $this->total_elements;\n }\n $success[$this->data_root] = $this->data;\n }\n return $success;\n }", "public function postProcessResults(array $blended, $_data = '')\n {\n return json_encode($blended);\n }", "public function body()\n {\n $entityBody = file_get_contents('php://input');\n\n foreach ((array)json_decode($entityBody) as $field => $value) {\n $this->requestStack[$field] = $value;\n }\n return json_decode($entityBody);\n }", "public function getData(): array\n {\n $this->validate('orderNumber', 'amount', 'returnUrl');\n \n $data = [\n 'orderNumber' => $this->getOrderNumber(),\n 'amount' => $this->getAmount(),\n 'returnUrl' => $this->getReturnUrl(),\n ];\n\n $extraParameters = [\n 'currency', 'description', 'language', 'pageView', 'sessionTimeoutSecs', 'features',\n 'bindingId', 'expirationDate', 'failUrl', 'clientId', 'merchantLogin', 'taxSystem',\n ];\n\n foreach ($extraParameters as $parameter) {\n $getter = 'get' . ucfirst($parameter);\n\n if (method_exists($this, $getter)) {\n $value = $this->{$getter}();\n\n if ($value !== null) {\n $data[$parameter] = $value;\n }\n }\n }\n\n if ($this->orderBundle) {\n $data['orderBundle'] = json_encode($this->orderBundle->toArray());\n }\n\n return $data;\n }", "protected function get_decoded_data() {\n return json_decode($this->get_data());\n }", "private function requestProcessor() {\n try {\n\n if (empty($this->uri))\n throw new \\Exception(\"Undefined url\");\n\n $ReqHandle = curl_init($this->uri);\n\n $body = json_encode([]);\n if( sizeof($this->data) > 0 )\n $body = json_encode($this->data);\n\n $returnTransfer = 0;\n if( $this->hasResponseToReturn )\n $returnTransfer = 1;\n\n $isPost = 0;\n if( $this->method != 'GET')\n $isPost = 1;\n\n\n if($isPost == 1){\n curl_setopt($ReqHandle,CURLOPT_POST, $isPost);\n curl_setopt($ReqHandle, CURLOPT_POSTFIELDS, $body);\n }\n \n curl_setopt_array($ReqHandle, [\n CURLOPT_RETURNTRANSFER => $returnTransfer,\n CURLOPT_HTTPHEADER => $this->headersToBeUsed\n ]);\n\n\n $result = curl_exec($ReqHandle);\n\n if(curl_errno($ReqHandle)){\n\n return curl_error($ReqHandle);\n }\n\n if($returnTransfer == 1)\n return json_decode($result);\n\n\n\n } catch (\\Throwable $t) {\n new ErrorTracer($t);\n }\n }", "public function parse2array() {\n\t\t/**\n\t\t * Thanks to Vladimir Struchkov <great_boba yahoo com> for providing the\n\t\t * code to extract base64 encoded values\n\t\t */\n\n\t\t$arr1 = explode( \"\\n\", str_replace( \"\\r\", '', $this->rawdata ) );\n\t\t$i = $j = 0;\n\t\t$arr2 = array();\n\n\t\t/* First pass, rawdata is splitted into raw blocks */\n\t\tforeach ( $arr1 as $v ) {\n\t\t\tif ( trim( $v ) == '' ) {\n\t\t\t\t++ $i;\n\t\t\t\t$j = 0;\n\t\t\t} else {\n\t\t\t\t$arr2[ $i ][ $j ++ ] = $v;\n\t\t\t}\n\t\t}\n\n\t\t/* Second pass, raw blocks are updated with their name/value pairs */\n\t\tforeach ( $arr2 as $k1 => $v1 ) {\n\t\t\t$i = 0;\n\t\t\t$decode = false;\n\t\t\tforeach ( $v1 as $v2 ) {\n\t\t\t\tif ( ereg( '::', $v2 ) ) { // base64 encoded, chunk start\n\t\t\t\t\t$decode = true;\n\t\t\t\t\t$arr = explode( ':', str_replace( '::', ':', $v2 ) );\n\t\t\t\t\t$i = $arr[0];\n\t\t\t\t\t$this->entries[ $k1 ][ $i ] = base64_decode( $arr[1] );\n\t\t\t\t} elseif ( ereg( ':', $v2 ) ) {\n\t\t\t\t\t$decode = false;\n\t\t\t\t\t$arr = explode( ':', $v2 );\n\t\t\t\t\t$count = count( $arr );\n\t\t\t\t\tif ( $count != 2 ) {\n\t\t\t\t\t\tfor ( $i = $count - 1; $i > 1; -- $i ) {\n\t\t\t\t\t\t\t$arr[ $i - 1 ] .= ':' . $arr[ $i ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$i = $arr[0];\n\t\t\t\t\t$this->entries[ $k1 ][ $i ] = $arr[1];\n\t\t\t\t} else {\n\t\t\t\t\tif ( $decode ) { // base64 encoded, next chunk\n\t\t\t\t\t\t$this->entries[ $k1 ][ $i ] .= base64_decode( $v2 );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->entries[ $k1 ][ $i ] = $v2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "abstract function parse_api_response();", "private function readTicket()\n {\n return json_decode($this->ticket->getBody()->getContents());\n }", "private function getData(){\n if($this->type == \"auto\"){\n \n \n $result = $this->get_from_link( self::AUTO_STRING.http_build_query($this->data));\n $array_names = json_decode($result, true); \n //var_dump($array_names); \n if(!isset($array_names)){\n $this->serverSideError(); \n }\n $ans = array(); \n \n foreach($array_names[\"predictions\"] as $key => $value){\n array_push($ans, $value[\"description\"]); \n }\n \n $response['status_code_header'] = 'HTTP/1.1 200 OK'; \n $response['body'] = json_encode($ans); \n \n return $response; \n }\n\n else if($this->type == \"geocode\"){\n \n\n //echo() $this->data); \n $result = $this->get_from_link( self::GEOCODE_STRING.http_build_query($this->data));\n // echo $result; \n $array = json_decode($result, true); \n if(!isset($array)){\n $this->serverSideError(); \n }\n \n $response['status_code_header'] = 'HTTP/1.1 200 OK'; \n $response['body'] = json_encode( $array[\"results\"][0][\"geometry\"][\"location\"]); \n \n return $response; \n }\n }", "function data() {\n $result = $this->fetcher->get($this->url);\n\n if ($result->getStatusCode() == 200) {\n $xml = new SimpleXMLElement($result->getBody());\n\n // WorkflowMax API's standard for error reporting\n if((string)$xml->Status !== 'OK') {\n throw new \\LogicException((string)$xml->ErrorDescription);\n }\n\n $array = json_decode(json_encode($xml), true);\n\n if($this->dataProcessor) {\n $dp = $this->dataProcessor;\n $array = $dp($array);\n }\n\n return $array;\n }\n\n throw new \\LogicException('URL returned status code ' . $result->getStatusCode());\n }", "public function getObservationsAsJSON() {\n \n // Load the observations from the database\n if (!$this->cDatabaseConnection->load($this->cLatestObservations)) {\n $lJSONErrorObject['error'] = $this->cDatabaseConnection->lastError();\n return json_encode($lJSONErrorObject);\n }\n\n // Get the output units from the request if they exist\n $lOutTempUnit = (array_key_exists(\"temp\", $_REQUEST)) ? $_REQUEST['temp']:\"\";\n $lOutSpeedUnit = (array_key_exists(\"speed\", $_REQUEST)) ? $_REQUEST['speed']:\"\";\n $lOutDirUnit = (array_key_exists(\"dir\", $_REQUEST)) ? $lOutDirUnit = $_REQUEST['dir']:\"\";\n $lOutRainUnit = (array_key_exists(\"rain\", $_REQUEST)) ? $_REQUEST['rain']:\"\";\n $lOutBarUnit = (array_key_exists(\"bar\", $_REQUEST)) ? $_REQUEST['bar']:\"\";\n \n // Set the output units for the Latest Observations just retrieved\n (strlen($lOutTempUnit)==0)?:$this->cLatestObservations->setOutputTempUnit($lOutTempUnit);\n (strlen($lOutSpeedUnit)==0)?:$this->cLatestObservations->setOutputWindSpUnit($lOutSpeedUnit);\n (strlen($lOutDirUnit)==0)?:$this->cLatestObservations->setOutputWindDirUnit($lOutDirUnit);\n (strlen($lOutRainUnit)==0)?:$this->cLatestObservations->setOutputRainUnit($lOutRainUnit);\n (strlen($lOutBarUnit)==0)?:$this->cLatestObservations->setOutputBarUnit($lOutBarUnit);\n \n // Get the JSON string from the latest observations\n return $this->cLatestObservations->getJSON();\n\n }", "function parse() {\r\n\t\t/* JSON */\r\n\t\tif (strpos ( $this->response_content_type, \"application/json\" ) !== false) {\r\n\t\t\t$this->response_parsed = json_decode($this->response_body);\r\n\t\t\t/* JSON STREAM */\r\n\t\t} elseif (strpos ( $this->response_content_type, \"json-stream\" ) !== false) {\r\n\t\t\t$stream = split ( \"\\n\", $this->response_body );\r\n\t\t\tif (count ( $stream ) < $stream [0] ['ResultLength']) {\r\n\t\t\t\t// echo \"Invalid JSON Stream. Result Length:\".count($stream);\r\n\t\t\t\t$this->client->status_code = 400;\r\n\t\t\t\t$GLOBALS ['ResultStack']->pushNew ( \"Invalid JSON Stream\", ERROR );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t$jsonServer = new JSON ( JSON_LOOSE_TYPE );\r\n\t\t\t$this->response_parsed = array ();\r\n\t\t\tforeach ( $stream as $line )\r\n\t\t\t\t$this->response_parsed [] = $jsonServer->decode ( $line );\r\n\t\t\t/* DEFAULT */\r\n\t\t} else {\r\n\t\t\t$this->response_parsed = $this->response_body;\r\n\t\t}\r\n\t}", "function km200_GetData( $REST_URL ) \n{ \n $options = array( \n 'http' => array( \n 'method' => \"GET\", \n 'header' => \"Accept: application/json\\r\\n\" .\n \"User-Agent: TeleHeater/2.2.3\\r\\n\" \n ) \n ); \n $context = stream_context_create( $options ); \n $content = @file_get_contents( \n 'http://' . km200_gateway_host . ':' . km200_gateway_port . $REST_URL, \n false, \n $context \n );\n\n if ( false === $content ) \n return false; \n return json_decode( \n km200_Decrypt( \n $content \n ) \n ); \n}", "private function process(HttpSocketResponse $response)\n\t{\n\t\t$result = array();\n\t\tif (!empty($response)) {\n\t\t\t$body = $response->body();\n\t\t\tswitch ($this->format) {\n\t\t\t\tcase 'xml':\n\t\t\t\t\t$xml = Xml::build($body);\n\t\t\t\t\t$temp = Xml::toArray($xml);\n\t\t\t\t\t$result = array('Yourls' => $temp['result']);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'json':\n\t\t\t\t\t$result = array('Yourls' => json_decode($body, true));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$result = $body;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function getData()\n {\n $this->validate('app_id', 'mch_id', 'sub_mch_id', 'out_trade_no', 'cert_path', 'key_path');\n\n $data = array (\n 'appid' => $this->getAppId(),\n 'mch_id' => $this->getMchId(),\n 'sub_mch_id' => $this->getSubMchId(),\n 'device_info' => $this->getDeviceInfo(),//<>\n 'transaction_id' => $this->getTransactionId(),\n 'out_trade_no' => $this->getOutTradeNo(),\n 'out_refund_no' => $this->getOutRefundNo(),\n 'total_fee' => $this->getTotalFee(),\n 'refund_fee' => $this->getRefundFee(),\n 'refund_fee_type' => $this->getRefundFee(),//<>\n 'op_user_id' => $this->getOpUserId() ?: $this->getMchId(),\n 'nonce_str' => md5(uniqid()),\n );\n\n $data = array_filter($data);\n\n $data['sign'] = Helper::sign($data, $this->getApiKey());\n\n return $data;\n }", "abstract public function parsePostData() : array;", "public function getRawData();", "public function getRawData();", "static function getBodyData(): array {\n $data = json_decode(file_get_contents('php://input'), true);\n return !is_null($data)? $data:array();\n }", "public function asArray(): array\n {\n return json_decode($this->result, true);\n }", "public function chartApiOutput() {\n\n $user = Auth::user();\n $chart = new DataChart();\n $mounthOutput = $this->getQueryChart($user);\n $chart->dataset('Last Mounth output', 'line', $mounthOutput->values())\n ->color('rgb(0,123,255)');;\n return json_decode($chart->api());\n }", "abstract protected function getReponseData() ;", "public static function getResponse1013() {\n\n return '{\"indicator\":{\"name\":\"Término de facturación de energía activa del PVPC peaje por defecto\",\"short_name\":\"PVPC T. Defecto\",\"id\":1013,\"composited\":false,\"step_type\":\"linear\",\"disaggregated\":false,\"magnitud\":[{\"name\":\"Precio\",\"id\":23}],\"tiempo\":[{\"name\":\"Hora\",\"id\":4}],\"geos\":[{\"geo_id\":3,\"geo_name\":\"España\"}],\"values_updated_at\":\"2017-03-01T21:01:30.000+01:00\",\"values\":[{\"value\":116.62,\"datetime\":\"2017-03-01T00:00:00.000+01:00\",\"datetime_utc\":\"2017-02-28T23:00:00Z\",\"tz_time\":\"2017-02-28T23:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":110.32,\"datetime\":\"2017-03-01T01:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T00:00:00Z\",\"tz_time\":\"2017-03-01T00:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":108.17,\"datetime\":\"2017-03-01T02:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T01:00:00Z\",\"tz_time\":\"2017-03-01T01:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":107.71,\"datetime\":\"2017-03-01T03:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T02:00:00Z\",\"tz_time\":\"2017-03-01T02:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":107.73,\"datetime\":\"2017-03-01T04:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T03:00:00Z\",\"tz_time\":\"2017-03-01T03:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":108.94,\"datetime\":\"2017-03-01T05:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T04:00:00Z\",\"tz_time\":\"2017-03-01T04:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":119.5,\"datetime\":\"2017-03-01T06:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T05:00:00Z\",\"tz_time\":\"2017-03-01T05:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":121.41,\"datetime\":\"2017-03-01T07:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T06:00:00Z\",\"tz_time\":\"2017-03-01T06:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":119.35,\"datetime\":\"2017-03-01T08:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T07:00:00Z\",\"tz_time\":\"2017-03-01T07:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":119.0,\"datetime\":\"2017-03-01T09:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T08:00:00Z\",\"tz_time\":\"2017-03-01T08:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":118.97,\"datetime\":\"2017-03-01T10:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T09:00:00Z\",\"tz_time\":\"2017-03-01T09:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":117.2,\"datetime\":\"2017-03-01T11:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T10:00:00Z\",\"tz_time\":\"2017-03-01T10:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":113.84,\"datetime\":\"2017-03-01T12:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T11:00:00Z\",\"tz_time\":\"2017-03-01T11:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":114.1,\"datetime\":\"2017-03-01T13:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T12:00:00Z\",\"tz_time\":\"2017-03-01T12:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":113.76,\"datetime\":\"2017-03-01T14:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T13:00:00Z\",\"tz_time\":\"2017-03-01T13:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":111.74,\"datetime\":\"2017-03-01T15:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T14:00:00Z\",\"tz_time\":\"2017-03-01T14:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":107.47,\"datetime\":\"2017-03-01T16:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T15:00:00Z\",\"tz_time\":\"2017-03-01T15:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":110.25,\"datetime\":\"2017-03-01T17:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T16:00:00Z\",\"tz_time\":\"2017-03-01T16:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":116.76,\"datetime\":\"2017-03-01T18:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T17:00:00Z\",\"tz_time\":\"2017-03-01T17:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":120.51,\"datetime\":\"2017-03-01T19:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T18:00:00Z\",\"tz_time\":\"2017-03-01T18:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":121.13,\"datetime\":\"2017-03-01T20:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T19:00:00Z\",\"tz_time\":\"2017-03-01T19:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":123.15,\"datetime\":\"2017-03-01T21:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T20:00:00Z\",\"tz_time\":\"2017-03-01T20:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":121.9,\"datetime\":\"2017-03-01T22:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T21:00:00Z\",\"tz_time\":\"2017-03-01T21:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":120.44,\"datetime\":\"2017-03-01T23:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T22:00:00Z\",\"tz_time\":\"2017-03-01T22:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":123.3,\"datetime\":\"2017-03-02T00:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T23:00:00Z\",\"tz_time\":\"2017-03-01T23:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"}]}}';\n }", "public function getResponseData(): array\n {\n $this->build();\n\n return $this->responseData;\n }", "public function getRawResponse() {\n\t}" ]
[ "0.6107094", "0.57686025", "0.5755359", "0.5730025", "0.5670472", "0.55146486", "0.55010086", "0.5457634", "0.5426471", "0.5416368", "0.54128045", "0.53870744", "0.536124", "0.53555936", "0.53388274", "0.5320885", "0.5286931", "0.524619", "0.5234912", "0.5233756", "0.52230126", "0.52230126", "0.52128303", "0.5207995", "0.51994485", "0.5164729", "0.51574504", "0.5125227", "0.51008344", "0.5096577", "0.5096056", "0.5094842", "0.5088889", "0.50807923", "0.5080323", "0.50678", "0.50645715", "0.5056828", "0.50405675", "0.5035948", "0.50345725", "0.5016049", "0.5011676", "0.49934772", "0.49922588", "0.4980836", "0.4972587", "0.49695197", "0.49577624", "0.49567872", "0.49566892", "0.49553514", "0.49519262", "0.4950795", "0.49452096", "0.49444056", "0.4941338", "0.49272373", "0.4918256", "0.49149716", "0.49146238", "0.49134803", "0.49133867", "0.49121594", "0.4911343", "0.4909356", "0.49075085", "0.49074128", "0.4903868", "0.4893404", "0.4893404", "0.48929128", "0.4891824", "0.48913026", "0.48903775", "0.48883376", "0.48834643", "0.48798838", "0.48797283", "0.48772675", "0.4872259", "0.48656946", "0.48656285", "0.4864561", "0.48569232", "0.4854282", "0.48540875", "0.4853213", "0.48512524", "0.48510408", "0.48502138", "0.48465437", "0.48465437", "0.48385963", "0.48376653", "0.48315963", "0.4831055", "0.48253766", "0.48229763", "0.48225453" ]
0.6109502
0
Determine if the given configuration value exists.
public function has($name) { $default = microtime(true); return $this->get($name, null, $default) !== $default; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function exists($key)\r\n {\r\n return isset($this->config[$key]);\r\n }", "public function exists($value) {\n return FALSE;\n }", "public function hasConfig(string $key): bool;", "public function hasConfig();", "public function hasConfig($key);", "public function has($key)\n {\n if(array_key_exists($key,$this->config_arr))\n return true;\n else\n return false;\n }", "public function has($configKey, $key);", "public function hasConfigValue(string $name): bool\n {\n return isset($this->config[$name]);\n }", "public function exists($key) {\n\t\treturn array_key_exists($key, $this -> settings);\n\t}", "function optionExists($value) {\n foreach ($this->_options as $option) {\n if (isset($option['attr']['value']) && ($option['attr']['value'] == $value)) {\n return true;\n }\n }\n return false;\n }", "public function exists($key, $value = null);", "public static function has($key)\n {\n return isset(self::$config[$key]);\n }", "public function has($key){\n return (array_key_exists($key,$this->settings));\n }", "public function has($key)\n {\n return array_key_exists($key, $this->config);\n }", "public function has($key)\n {\n return array_key_exists($key, $this->config);\n }", "public function exists($name)\n {\n return array_key_exists($name, $this->config);\n }", "public function settingExists($key) {\n return isset($this->options[$key]);\n }", "public static function has($name)\n {\n return array_key_exists($name, self::$config);\n }", "public function checkIfEssentialConfigurationExists() {}", "private function _configurationExists($input) {\n\t\t$check = $this->db->queryFetchSingle(\"SELECT * FROM \"._WE_CREDITSYS_.\" WHERE config_id = ?\", array($input));\n\t\tif($check) return true;\n\t\treturn false;\n\t}", "public function has ($value);", "public static function has($key)\n {\n if (isset(static::$cache[$key])) return true;\n\n $config = DBConfig::where('_key', '=', $key)->first();\n\n if (is_null($config)) return false;\n else return true;\n }", "public function has($name)\n {\n return $this->setting->has($name);\n }", "public static function config_file_exists() {\n // Allow for late static binding by using static.\n $configfilepath = static::get_config_file_path();\n\n // Invalidate opcode php cache, so we get correct status of file.\n core_component::invalidate_opcode_php_cache($configfilepath);\n return file_exists($configfilepath);\n }", "public function has ( $name ) {\n\t\treturn isset($this->config['name']);\n\t}", "public function has(string $value): bool\n {\n return isset($this->items[$value]);\n }", "function conditional_config($config_key) {\n\tif(!chevereto_config($config_key)) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "function option_exists(string $key)\n {\n return Options::exists($key);\n }", "public static function settingExists(string $key): bool\n\t{\n\t\tif (in_array($key, ['favourites', 'streamers'])) return true;\n\n\t\tforeach (self::$settingsFields as $setting) {\n\t\t\tif ($setting['key'] == $key) return true;\n\t\t}\n\t\treturn false;\n\t}", "function option_exists($key)\n {\n return app('option')->exists($key);\n }", "public function valueExists($key,$value){\n $num = $this->getTable()->where($key,$value)->count();\n if($num!=0){\n return true;\n }\n else{\n return false;\n }\n }", "public function hasSetting( $name );", "public function has( $value ) {\n\t\t$formats = $this->get();\n\n\t\treturn isset( $formats[ $value ] );\n\t}", "public function hasValue ($value) {\n\n return array_search($value, $this->values) !== false;\n\n }", "public function hasConfig() {\n\t\treturn (bool)@file_exists($this->fullModulePath.'/config.ini');\n\t}", "final public function hasConfig($key = null)\n {\n $config = $this->getConfig();\n\n if (is_null($key)) {\n return !empty($config);\n } else {\n return array_key_exists($key, $config);\n }\n }", "public function has(string $key): bool\n\t{\n\t\treturn \\array_key_exists($key, $this->valueMap);\n\t}", "function config($key) {\n global $config;\n\n return !empty($config[$key]) ? $config[$key] : false;\n}", "public function hasValue($value) {\n\t\tif ( array_search( $value, $this->store ) !== false ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function has($configProperty) {\n\t\treturn isset($this->{$configProperty}) && $this->{$configProperty} !== null;\n\t}", "public function containsValue($value): bool;", "final public static function isDefined($value)\n {\n self::initOptions();\n\n return in_array($value, self::$options, true);\n }", "protected function exists($name) {\n return $this->configuration->exists($name);\n }", "public function has(string $key): bool\n {\n\t\treturn array_key_exists($key, $this->values);\n\t}", "public function has( $key )\n {\n $this->loadSettingsIfNotLoaded();\n\n return $this->randomDefaultValue !== array_get( $this->settings, $key, $this->randomDefaultValue );\n }", "function has($key) {\n\t\treturn isset($this->valuemap[$key]);\n\t}", "public static function has(string $key)\n {\n $segments = explode('.', $key);\n $file = array_shift($segments);\n $arr = static::loadConfig($file);\n\n foreach ($segments as $seg) {\n if (!array_key_exists($seg, $arr)) {\n return false;\n }\n $arr = $arr[$seg];\n }\n\n return $arr ? true : false;\n }", "public function exists(string $value, string $purpose): bool;", "public function containsValue($value) : bool;", "public static function exists($key, $value){\n if(empty($key) || empty($value)){\n return false;\n }\n \n global $wpdb;\n \n $pk = static::getPk();\n $table_name = $wpdb->prefix.static::$_table;\n $sql = $wpdb->prepare('SELECT '.$pk.' FROM '.$table_name.' WHERE `'.$key.'` = %s LIMIT 1;', $value);\n $results = $wpdb->get_results($sql);\n if(is_array($results) && isset($results[0])){\n return $results[0]->$pk;\n }\n return false;\n }", "public function exists($param, $value)\n\t{\n\t\t# query the database to check if the value is taken\n\t\t# return true is value is taken, false otherwise.\n\t}", "function baseSettings_exists($key)\n {\n return app('BaseSettings_exists')->exists($key);\n }", "public function offsetExists($offset) {\n\t\treturn array_key_exists($offset, $this->config);\n\t}", "public function hasConfig($key) {\n return $this->getConfigAugment()->has($key);\n }", "function config($key){\n $config = include 'config.php';\n\n if(key_exists($key,$config)){\n return $config[$key];\n }\n return false;\n}", "public function offsetExists($offset)\n {\n return $this->configuration_object->has($offset);\n }", "public function hasSetting($key) : bool\n {\n return isset($this->settings[$key]);\n }", "public function hasValue(string $domain, $key = NULL): bool;", "public function has_config() {\n return true;\n }", "public function has_config() {\n return true;\n }", "public function exists($attribute){\n $name = $attribute;\n if ($attribute instanceof ConfigurationAttribute){\n $name = $attribute->getName();\n }\n\n return $this->getAttribute($name) != null;\n }", "public function has(string $key): bool\n {\n return array_key_exists($key, $this->values);\n }", "public function has(string $name): bool\n {\n try {\n $result = $this->configCommand($name);\n } catch (RuntimeException $exception) {\n return false;\n }\n\n return $result->isSuccessful();\n }", "public function hasValue($name);", "public function hasParameter($name)\n {\n return array_key_exists($name, $this->config);\n }", "public function has($name) {\n if ($this->get($name, false) != false)\n return true;\n else \n return false;\n }", "public function has($name)\n {\n return isset($this->values[$name]);\n }", "public function has($name)\n {\n return isset($this->values[$name]);\n }", "public function setExists($value);", "public function exists($key) {\n\t\treturn $this -> get($key) === FALSE;\n\t}", "public function has($key)\n {\n return array_key_exists($key, $this->parsedOptions);\n }", "public function configFileExists() {\n $_fileName = \\Config::get('fontello::config.file');\n $_folderName = \\Config::get('fontello::config.folder');\n if (\\File::exists($_folderName . $_fileName)) {\n $this->_configFile = $_folderName . $_fileName;\n return true;\n }\n return false;\n }", "function has_config() {\n return true;\n }", "public function hasValue($key)\n {\n return isset($this->values[$key]);\n }", "public function exists($key): bool;", "public function isset(): bool\n\t{\n\t\treturn isset($this->_value);\n\t}", "public function has($name)\n {\n return is_string($name) && (\n array_key_exists($name, $this->_values) || array_key_exists($name, $this->_definitions)\n );\n }", "public function configFileExists(string $fileName): bool;", "protected function hasValue(string $opt):bool {\n return array_key_exists($opt, $this->opts);\n }", "public function hasValueForKey($key) {\n\t\treturn array_key_exists($key, $this->store);\n\t}", "public function containsValue($value);", "public function has_config() {\n return false;\n }", "public function has_config() {\n return false;\n }", "public function exists(string $key);", "public function parameterExist($parameterName) {\n $result = array_key_exists($parameterName, $this->params);\n return $result;\n }", "public function has($key) {\n\t\treturn Hash::has($this->_value, $key);\n\t}", "public function hasValue($value)\n {\n return $this->_value == $value;\n }", "function exists($key) {\n\t\treturn isset($this->args[$key]);\n\t}", "static public function has($key)\r\n {\r\n /* Let's make sure we have a valid variable name */\r\n self::validateKey($key);\r\n\r\n /* Fset::get returns null if the specified variable does not exist */\r\n $value = Fset::get(self::$values, $key);\r\n return !is_null($value);\r\n }", "public function containsValue(mixed $value): bool;", "public function hasConfig($key)\n {\n if ( null === $key ) {\n return false;\n }\n\n $this->validateConfigKey($key);\n $configurator = $this->getConfigurator();\n\n return isset($configurator[$key]);\n }", "public function exist($key);", "public function contains($value) {\n\t\treturn $this->hasValue($value);\n\t}", "public function exists($key, $value)\n {\n if (is_null($this->schema)) {\n throw SystemException::forNoSchema();\n }\n\n $search = $this\n ->resource\n ->search($this->schema->getName())\n ->addFilter($key . ' = %s', $value);\n\n return !!$search->getRow();\n }", "public static function exists($key) {\n return isset(self::$vars[$key]);\n }", "public function has(string $key): bool {}", "function has_configuration() {\n\t\treturn true;\n\t}", "public function existSetting(string $name): bool\n {\n return Setting::find()->where(['name' => $name])->exists();\n }", "public function has(string $key): bool;", "public function has(string $key): bool;", "public function has(string $key): bool;" ]
[ "0.7208787", "0.7110511", "0.70404226", "0.69786906", "0.6957485", "0.6914128", "0.68809235", "0.6878708", "0.6852578", "0.68425524", "0.67906773", "0.6727285", "0.67198086", "0.6713348", "0.6713348", "0.66710675", "0.66693467", "0.66596496", "0.663439", "0.66062653", "0.6488441", "0.6460679", "0.6392168", "0.63863516", "0.63782287", "0.6364691", "0.6363097", "0.6357881", "0.63525206", "0.6350572", "0.63486636", "0.63486147", "0.6348156", "0.6330739", "0.6304724", "0.6303354", "0.62768596", "0.62574303", "0.6251445", "0.6244836", "0.6237899", "0.62357306", "0.62258625", "0.6221241", "0.61975193", "0.6186075", "0.61842877", "0.6176054", "0.61647975", "0.61612546", "0.6161138", "0.6136252", "0.6131216", "0.6109984", "0.61033535", "0.60981005", "0.6094875", "0.6093271", "0.609207", "0.609207", "0.60794437", "0.60736656", "0.6068121", "0.60674906", "0.60537285", "0.6020496", "0.6018581", "0.6018581", "0.60170305", "0.60030097", "0.599291", "0.5975302", "0.59736794", "0.59677756", "0.5966068", "0.59621733", "0.5959608", "0.59570265", "0.59550536", "0.5946544", "0.5944076", "0.5935348", "0.5935348", "0.59253925", "0.5924423", "0.5921557", "0.59208214", "0.5920106", "0.5910445", "0.5905132", "0.590329", "0.58892006", "0.5886277", "0.5876861", "0.5876442", "0.5873452", "0.5872793", "0.5870502", "0.58690155", "0.58690155", "0.58690155" ]
0.0
-1