query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
sequencelengths 0
30
| negative_scores
sequencelengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
Get parsed thing text | public function getParsedText()
{
return Mage::helper('cms/data')->getBlockTemplateProcessor()->filter($this->getText());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetParsedText()\n {\n return $this->Parse();\n }",
"function parse( $text, $linestart = true ) {\n\t\tglobal $wgParser, $wgTitle;\n\t\t$parserOutput = $wgParser->parse( $text, $wgTitle, $this->mParserOptions, $linestart );\n\t\treturn $parserOutput->getText();\n\t}",
"protected function readText() { return $this->_text; }",
"function getParsedTeaser() {\n return $this->getParsedData();\n }",
"function parse() {}",
"function parse()\n {\n $str = $this->content;\n foreach($this->vars as $name=>$val)\n {\n $str = str_replace('{'.$name.'}', $val, $str);\n }\n return $str;\n }",
"function cot_parse_html($text)\n{\n\treturn $text;\n}",
"private function getText ()\n {\n\n return $this->text;\n }",
"function parse_text($tree)\n {\n $this->text_handler = 'ubbtexthandler';\n if(isset($this->text_handler))\n {\n if(function_exists($this->text_handler))\n {\n $f = $this->text_handler;\n return $f($tree, $this);\n }\n }\n return $text;\n }",
"public function parseContent()\n {\n if (!empty($this->content)) {\n if (strpos($this->content, '[') !== false || strpos($this->content, '{') !== false) {\n return DoxterShortcodeParser::instance()->parse($this->content);\n }\n\n return $this->content;\n }\n }",
"public function parse();",
"public function parse();",
"public function parse();",
"public function parse();",
"public function getText( ) { \n return $this->text;\n }",
"public function get_text ()\n {\n return $this->text;\n }",
"public function getText() {\n return $this->text;\n }",
"public function getText()\n {\n return $this->data->text;\n }",
"public static function parse($text);",
"public function content(): string\n {\n return app('docs.parser')->parse($this->raw());\n }",
"public function getText() \n {\n return $this->_text;\n }",
"public function getText()\n {\n return $this->text;\n }",
"public function getText()\n {\n return $this->text;\n }",
"function parse ()\n\t{\n\t\t$this->_tokenize();\n\t\treturn $this->_build();\n\t}",
"public function getText() {\n return $this->text;\n }",
"public function getText()\r\n {\r\n return $this->text;\r\n }",
"public function getText() {\n return $this->_text;\n }",
"public function getText();",
"public function getText();",
"public function getText();"
] | [
"0.7285866",
"0.6269679",
"0.62598854",
"0.6078061",
"0.60406524",
"0.6024646",
"0.59861445",
"0.5982567",
"0.5981508",
"0.5964271",
"0.5948029",
"0.5948029",
"0.5948029",
"0.5948029",
"0.59354407",
"0.5912198",
"0.59073836",
"0.59019357",
"0.5873169",
"0.5871904",
"0.58601815",
"0.5857386",
"0.5857386",
"0.58385926",
"0.5833413",
"0.58332497",
"0.5830754",
"0.58242786",
"0.58242786",
"0.58242786"
] | 0.65035397 | 1 |
get last modified team. | function getLastModified(){
$em = $this->getDoctrine()->getManager();
$query = $em->createQuery('SELECT max(t.modified) FROM App\Entity\Team t');
$team = $query->getResult();
$response = json_encode($team);
return new Response($response,Response::HTTP_OK,array('content-type' => 'application/json'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function getLastUpdate($team);",
"public function getTeam()\n {\n return $this->team;\n }",
"public function getProjectTeam()\n {\n return isset($this->project_team) ? $this->project_team : null;\n }",
"public function getProjectTeam();",
"public function getLastModified()\n {\n \treturn $this->lastModified;\n }",
"public function getLastModified()\n\t{\n\t\treturn $this->modified;\n\t}",
"public function getLastModified() {\r\n return $this->lastModified;\r\n }",
"public function getTeam()\n {\n return Wrapper\\Team\\Senior::team($this->getTeamId());\n }",
"public function getLastModified()\n {\n return $this->lastModified;\n }",
"public function getLastModified()\n {\n return $this->lastModified;\n }",
"public function getLastModified()\n {\n return $this->lastModified;\n }",
"public function getLastModified() {\n\t\treturn $this->lastModified;\n\t}",
"public function getTeam() {\n return $this->teamId;\n }",
"public function getLastModified()\n {\n return $this->_lastModified;\n }",
"public function refreshCurrentTeam()\n {\n $this->current_team_id = null;\n\n $this->save();\n\n return $this->currentTeam();\n }",
"function getLastModifiedUser()\n\t\t{\n\t\t\tglobal $connection;\n\n\t\t\t// Build the query\n $sql = \"SELECT FirstName, LastName FROM users ORDER BY LastModifiedOn DESC LIMIT 1\";\n\n // prepare the sql statement\n $stmt = $connection->prepare($sql);\n\n\t\t\t# setting the fetch mode\n\t\t\t$stmt->setFetchMode(PDO::FETCH_OBJ);\n\n // execute the prepared statement\n $stmt->execute();\n\n\n\n\t\t\t/* Fetch the results and operate on them */\n\t\t\twhile($row = $stmt->fetch())\n\t\t\t{\n\t\t\t\t$name = $row->FirstName. \" \" . $row->LastName;\n\t\t\t\treturn $name;\n\n\t\t\t\t/* Close statement */\n\t\t\t\t$connection = null;\n\t\t\t}\n\n\t\t}",
"public function getLastModified()\n {\n return $this->getMTime();\n }",
"public function team()\n {\n $team = request()->user()->team;\n\n if($team) {\n return $team->team_name;\n }\n else {\n return \"no_team\";\n }\n }",
"public function lastModified()\n {\n return $this->lastMod;\n }",
"public function getLastModified()\n {\n if (!empty($this->_item['modified'])) {\n return $this->_item['modified'];\n }\n if (!empty($this->_item['created'])) {\n return $this->_item['created'];\n }\n return parent::getLastModified();\n }",
"public function getLastModified()\r\n {\r\n return $this->getFile()->getMTime();\r\n }",
"function getLastModified()\n {\n return null;\n }",
"function team()\n {\n $teams = Auth::user()->teams();\n return $teams[0];\n }",
"public function getTeam()\n {\n if ($this->type == Config\\Config::SENIOR) {\n $url = Network\\Request::buildUrl(array('file' => 'teamdetails', 'teamID' => $this->getId(), 'version' => Config\\Version::TEAMDETAILS));\n return new Xml\\Team\\Senior(Network\\Request::fetchUrl($url), $this->getId());\n } elseif ($this->type == Config\\Config::YOUTH) {\n $url = Network\\Request::buildUrl(array('file' => 'youthteamdetails', 'youthTeamId' => $this->getId(), 'version' => Config\\Version::YOUTHTEAMDETAILS));\n return new Xml\\Team\\Youth(Network\\Request::fetchUrl($url));\n }\n return null;\n }",
"public function getTeamName ()\r\n {\r\n return $this->teamName;\r\n }",
"public function getLastmodified();",
"public function getLastModified()\n {\n return $this->lastModified ?: time();\n }",
"public function getLastModifiedBy()\n {\n return $this->lastModifiedBy;\n }",
"public function getLastModifiedBy()\n {\n return $this->lastModifiedBy;\n }",
"public function currentTeam()\n {\n if (is_null($this->current_team_id) && $this->hasTeams()) {\n $this->switchToTeam($this->teams->first());\n\n return $this->currentTeam();\n } elseif (! is_null($this->current_team_id)) {\n $currentTeam = $this->teams->find($this->current_team_id);\n\n return $currentTeam ?: $this->refreshCurrentTeam();\n }\n }"
] | [
"0.71309996",
"0.68995994",
"0.6688718",
"0.65818465",
"0.6509271",
"0.6505217",
"0.6481274",
"0.6471053",
"0.64495355",
"0.64495355",
"0.64495355",
"0.64289343",
"0.63902706",
"0.6368546",
"0.6295016",
"0.6287603",
"0.6264061",
"0.62468225",
"0.6207682",
"0.6198316",
"0.6180459",
"0.61511105",
"0.61502266",
"0.614345",
"0.6132126",
"0.6125169",
"0.61052734",
"0.6105066",
"0.6105066",
"0.6091932"
] | 0.69205254 | 1 |
Initialise this file with a default MIME type. | public function __construct() {
$this->setMimeType('application/octet-stream');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getDefaultMimeType():string;",
"private static function initialize()\n {\n $fileName = ExtensionManagementUtility::extPath('extractor') . 'Resources/Private/mime.types';\n $fh = fopen($fileName, 'r');\n if (is_resource($fh)) {\n while (($buffer = fgets($fh, 1024)) !== false) {\n if ($buffer{0} === '#') {\n continue;\n }\n list($mimeType, $extensions) = GeneralUtility::trimExplode(TAB, $buffer, true);\n $extensions = GeneralUtility::trimExplode(' ', $extensions, true);\n static::$mimeTypesMapping[$mimeType] = $extensions;\n foreach ($extensions as $extension) {\n static::$extensionsMapping[$extension] = $mimeType;\n }\n }\n fclose($fh);\n }\n }",
"function populateMimes ()\n\t{\n\t\t$this->mimes[] =\n\t\t\tnew Mime ('image', 'jpeg', array ('jpeg', 'jpg', 'jpe'), '');\n\t\t$this->mimes[] =\n\t\t\tnew Mime ('image', 'gif', array ('gif'), '');\n\t\t$this->mimes[] =\n\t\t\tnew Mime ('image', 'png', array ('png'), '');\n\t}",
"protected function _setDefaultFile() {\n\t\t$this->_file = dirname(__FILE__) . \"/\" . $this->_type . \"/crosswalk\"; \n\t}",
"public function __construct($filepath = null, $mime_type = null)\n {\n\n if ($mime_type) {\n $this->mime_type = $mime_type;\n }\n\n if ($filepath) {\n $this->filepath = $filepath;\n $this->contents = file_get_contents($filepath);\n $this->name = \\basename($filepath);\n \\sb\\Files::fileToMime($this->filepath);\n }\n }",
"public function __construct($filename, $mimetype = NULL, $postname = NULL, $filename, $mimetype = NULL, $postname = NULL)\n {\n }",
"private function set_file_mime_type() {\n $image_type = exif_imagetype($this->image_src);\n if (!$image_type)\n $this->error('The file you supplied isn\\'t a valid image. <br>' . $this->image_src);\n $this->file_mime_type = image_type_to_mime_type($image_type);\n $this->file_extension = image_type_to_extension($image_type, false);\n }",
"public function __construct($file = null, $type = null)\n {\n $this->init($file, $type);\n }",
"public function __construct() {\r\n \r\n $this->headers[] = 'MIME-Version: 1.0';\r\n $this->headers[] = 'Content-type: text/html; charset=iso-8859-1';\r\n \r\n }",
"public function __construct() {\n\t\t\t$this->parameters = array(\n\t\t\t\t'file_name' => null\n\t\t\t);\n\t\t\t$this->type = true;\n\t\t}",
"public function setMIME(string $type) {\n if (strlen($type) != 0) {\n $this->mimeType = $type;\n }\n }",
"public function init()\n {\n $layout = $this->_helper->getHelper('layout');\n $layout->direct()->disableLayout();\n $this->_response->setHeader('Content-Type', 'application/x.atom+xml', true);\n // Atom 1.0 preparation...\n //$this->_response->setHeader('Content-Type', 'application/atom+xml;type=entry', true);\n }",
"public function setFileType($file_type);",
"public function __construct()\n {\n $this->allowedObjectTypes = array('file');\n $this->imageFileTypes = array('gif', 'jpeg', 'jpg', 'png', 'swf');\n $this->forbiddenFileTypes = array('cgi', 'pl', 'asp', 'phtml', 'php', 'php3', 'php4', 'php5', 'exe', 'com', 'bat', 'jsp', 'cfm', 'shtml');\n $this->allowedFileSizes = array('file' => array('uploadFile' => ModUtil::getVar('MUFiles', 'maxSize', 102400)));\n }",
"public function __construct($content, $mime_type = self::TEXT_PLAIN, $charset = self::UTF8) {\n $this->content = (string) $content;\n $this->mime_type = (string) $mime_type;\n $this->charset = (string) $charset;\n }",
"public function setMimeType($mime)\n\t{\n\t\t$this->_mime = trim($mime);\n\t}",
"protected function setHeader()\n {\n Controller::curr()->getResponse()\n ->addHeader(\"Content-Type\", $this->supportedMimeTypes()[0]);\n }",
"function FileSettings() {\n\t\t$this->suffixes = array('txt','csv','xls','xml','ods');\n\t\t$this->mimetypes = array('text/html',\n\t\t\t\t\t\t\t'text/plain',\n\t\t\t\t\t\t\t'text/csv',\n\t\t\t\t\t\t\t'application/octet-stream',\n\t\t\t\t\t\t\t'application/x-octet-stream',\n\t\t\t\t\t\t\t'application/vnd.ms-excel',\n\t\t\t\t\t\t\t'application/excel',\n\t\t\t\t\t\t\t'application/ms-excel',\n\t\t\t\t\t\t\t'application/x-excel',\n\t\t\t\t\t\t\t'application/x-msexcel',\n\t\t\t\t\t\t\t'application/force-download',\n\t\t\t\t\t\t\t'text/comma-separated-values',\n\t\t\t\t\t\t\t'text/x-csv',\n\t\t\t\t\t\t\t'text/x-comma-separated-values',\n\t\t\t\t\t\t\t'application/vnd.oasis.opendocument.spreadsheet');\n\t\t\n\t\t$this->data->sheets[0] = array();\n\t}",
"protected function setMime($mime) {\n $this->_icon = null;\n $this->_mime = $mime;\n $this->changes->addChange('post_mime_type', $mime);\n\n $this->parseType();\n }",
"public function set_content_type($mime_type, $charset = NULL) {\n if (strpos($mime_type, '/') === FALSE) {\n $extension = ltrim($mime_type, '.');\n \n // Is this extension supported?\n if (isset($this->mimes[$extension])) {\n $mime_type = & $this->mimes[$extension];\n \n if (is_array($mime_type)) {\n $mime_type = current($mime_type);\n }\n }\n }\n \n $this->mime_type = $mime_type;\n \n if (empty($charset)) {\n $charset = config_item('charset');\n }\n \n $header = 'Content-Type: ' . $mime_type . (empty($charset) ? '' : '; charset=' . $charset);\n \n $this->headers[] = array(\n $header,\n TRUE \n );\n return $this;\n }",
"public function getMimetype()\n {\n return Mimetypes::getInstance()->fromFilename($this->path) ?: 'text/plain';\n }",
"protected static function initializeFormats()\n {\n static::$formats = array('html' => array('text/html', 'application/xhtml+xml'), 'txt' => array('text/plain'), 'js' => array('application/javascript', 'application/x-javascript', 'text/javascript'), 'css' => array('text/css'), 'json' => array('application/json', 'application/x-json'), 'xml' => array('text/xml', 'application/xml', 'application/x-xml'), 'rdf' => array('application/rdf+xml'), 'atom' => array('application/atom+xml'), 'rss' => array('application/rss+xml'));\n }",
"public function __construct($mime_types_text)\n\t{\n\t\t$this->mime_types_text = $mime_types_text;\n\t}",
"public function init() {\n\t\t\t$this->template();\n\t\t\t$this->template_types();\n\t\t}",
"public function __construct($content_type)\n\t{\n\t\t$this->_content_type = $content_type;\n\t}",
"protected static function initializeFormats()\n {\n static::$formats = array(\n 'html' => array('text/html', 'application/xhtml+xml'),\n 'txt' => array('text/plain'),\n 'js' => array('application/javascript', 'application/x-javascript', 'text/javascript'),\n 'css' => array('text/css'),\n 'json' => array('application/json', 'application/x-json'),\n 'xml' => array('text/xml', 'application/xml', 'application/x-xml'),\n 'rdf' => array('application/rdf+xml'),\n 'atom' => array('application/atom+xml'),\n 'rss' => array('application/rss+xml'),\n );\n }",
"function setMimetype($mimetype, $format = \"converted\")\n {\n $crit = new Criteria();\n $crit->add(FileMimetypePeer::MIMETYPE, $mimetype);\n $themimetype = FileMimetypePeer::doSelectOne($crit);\n \n if (!$themimetype)\n {\n $themimetype = new FileMimetype();\n $themimetype->setMimetype($mimetype);\n if (!$this->getIdentifier())\n {\n throw new Exception(\"You must set the identifier before setting a mime type that does not yet exist in the database\");\n }\n $themimetype->setIdentifier($this->getIdentifier());\n $themimetype->save();\n }\n \n if ($themimetype instanceof FileMimetype)\n {\n if (in_array(strtolower($format), $this->_allowedFormatArray))\n { \n $funcToCall = \"set\".ucfirst($format).\"MimetypeId\";\n }\n else\n {\n throw new Exception(\"Invalid format specified\");\n }\n $this->_reaktorfile->$funcToCall($themimetype->getId());\n }\n else \n {\n if (sfContext::getInstance()->getUser()->hasCredential(\"viewdetailederrors\"))\n {\n throw new Exception(\"Failed when trying to set mime type on file record: Invalid mime type: \".$mimetype);\n }\n throw new Exception(\"Invalid file type, the upload failed\");\n }\n $this->_isunsaved = true;\n }",
"private function enforceMime()\n {\n if (!$this->isMime()) {\n if ($this->getAttachmentCount()) {\n $this->setMessageAsMixed();\n } else {\n $this->setRawHeader('Content-Type', \"text/plain;\\r\\n\\tcharset=\\\"us-ascii\\\"\");\n }\n $this->setRawHeader('Mime-Version', '1.0');\n }\n }",
"public function __construct()\n {\n parent::__construct();\n $this->registerFormatName('Template-Chunked-XHTML');\n $this->setExt(Config::ext() === null ? '.html' : Config::ext());\n $this->template = file_get_contents(Config::template_file());\n }",
"function addMimetype($mime) {\n $this->setValue('mimes', $mime);\n }"
] | [
"0.65640944",
"0.6409269",
"0.6213602",
"0.60931236",
"0.60476214",
"0.6030887",
"0.60209215",
"0.5953556",
"0.59384483",
"0.5909342",
"0.58295995",
"0.5811671",
"0.5774132",
"0.5661009",
"0.56532186",
"0.56342244",
"0.5594919",
"0.5586815",
"0.5574243",
"0.55689615",
"0.5555268",
"0.55398834",
"0.55136186",
"0.5510728",
"0.54905355",
"0.5487189",
"0.5469818",
"0.5456374",
"0.5450431",
"0.54488003"
] | 0.6962395 | 0 |
Set the content of this file. | public abstract function setContent($content); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function setContent(): void\n {\n $this->isFileReadable($this->path);\n $this->content = file_get_contents($this->path);\n }",
"abstract public function setContent($content);",
"public function setContent($content) {\n $this->_content = $content;\n }",
"public function setContent($content)\n {\n $this->_content = $content;\n }",
"public function setContent($content)\n {\n $this->_content = $content;\n }",
"public function setContent($content)\n {\n $this->_content = $content;\n }",
"public function setContent($content);",
"public function setContent($content);",
"function setContent($content)\r\n {\r\n $this->content = $content;\r\n }",
"public function setContent ($content) {\n\t\t$this->content = $content;\n\t}",
"public static function setContent($content){\n\t\tself::$_content = $content;\n\t}",
"public static function setContent($content){\n\t\tself::$_content = $content;\n\t}",
"public function setContent($content)\n{\n\t$this->content=$content;\n}",
"public function setContent($content) {\n $this->content = $content;\n }",
"public function setContent($content) {\n\t\t$this->content = $content;\n\t}",
"protected function setContent($content)\n {\n $this->content = $content;\n }",
"public function setContent($content)\n {\n $this->content = $content;\n }",
"public function setContent($content)\n {\n $this->content = $content;\n }",
"public function setContent($content)\n {\n $this->content = $content;\n }",
"public function setContent($content)\n {\n $this->content = $content;\n }",
"public function setContent($content)\n {\n $this->content = $content;\n }",
"public function setContent($content)\n {\n $this->content = $content;\n }",
"public function setContent($content)\n {\n $this->content = $content;\n }",
"public function setContent($content)\n {\n $this->content = $content;\n }",
"public function setContent($content)\n {\n $this->content = $content;\n }",
"public function setContent($content)\n {\n $this->content = trim($content);\n }",
"public function setContent($content)\n\t{\n\t\t$this->content = $content;\n\t}",
"public function setContent($content)\n {\n $this->m_content = $content;\n }",
"public function setContent(string $content)\n {\n $this->content = $content;\n }",
"public function setContent($value){\n\t\t$this->value\t= $value;\n\t}"
] | [
"0.8349625",
"0.7121774",
"0.71077615",
"0.70738363",
"0.70738363",
"0.70738363",
"0.7064434",
"0.7064434",
"0.7053687",
"0.70150286",
"0.6934134",
"0.6934134",
"0.6933807",
"0.69333506",
"0.6930827",
"0.68911564",
"0.68599355",
"0.68599355",
"0.68599355",
"0.68599355",
"0.68599355",
"0.68599355",
"0.68599355",
"0.68599355",
"0.68599355",
"0.6852276",
"0.6848229",
"0.68095845",
"0.67517567",
"0.6738365"
] | 0.71324617 | 1 |
Does source map contains `sourcesContent` with input source text. | public function withContent()
{
$sc = $this->consumer()->sourcesContent;
return !empty($sc);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasSources() {\n $count = iterator_count($this->iterator);\n $this->iterator->rewind();\n return $count > 0;\n }",
"public function hasSource(){\n return $this->_has(3);\n }",
"public function contains($source);",
"public function isSourceNode();",
"public function sourceFileExists()\n {\n $request = RequestFactory::create(func_get_args(), $this->defaultManipulations);\n\n return $this->source->has($this->getSourcePath($request));\n }",
"public function is_source_added($source_path){\n\t\treturn array_key_exists($source_path, $this->sources);\n\t}",
"public function hasSourceFiles()\n {\n return \\count($this->sourceFiles) > 0;\n }",
"public function hasSourceFiles()\n {\n return count($this->sourceFiles) > 0;\n }",
"public static function hasContent(): bool\n {\n return true;\n }",
"public function hasContent() : bool;",
"public function matches(): bool\n {\n return $this->source instanceof Source;\n }",
"public function hasContent()\n\t{\n\t\treturn true;\n\t}",
"public function hasContent()\n {\n return $this->get(self::CONTENT) !== null;\n }",
"public function hasContent(): bool\n {\n return isset($this->content);\n }",
"public function hasContent()\n {\n return true;\n }",
"public function hasContent()\n {\n return true;\n }",
"public function hasContent()\n {\n return true;\n }",
"public function hasContent()\n {\n return true;\n }",
"public function hasContent() : bool\n {\n return isset($this->content);\n }",
"public function containsSource(SourceInterface $source)\n {\n return array_key_exists($source->sourceId(), $this->sources);\n }",
"public function hasContent(){\n return $this->_has(1);\n }",
"public function hasContent(){\n return $this->_has(7);\n }",
"public function hasSourceFile($path)\n {\n return isset($this->sourceFiles[$path]);\n }",
"public function hasContents() {\n return ($this->contents()->count() > 0) ? true : false;\n }",
"public function shouldRun($path, $content);",
"public function hasSourceid(){\n return $this->_has(4);\n }",
"public function checkIfExists(){\n $query = \"SELECT * \";\n $query .= \" FROM sources \";\n $query .= \" WHERE title= '\" . $this->title . \"'\";\n $query .= \" AND srcId = '\" . $this->srcId . \"'\";\n $query .= \" AND srcType = 'b'\"; \n $total = self::findBySqlCount($query);\n if($total > 0){\n return true;\n }\n return false;\n }",
"public function hasSourceLabel() {\r\n return $this->sourceLabel !== 'NO_SOURCE';\r\n }",
"public static function isContent($url)\n {\n self::loadCache();\n return isset(self::$cache['urls'][$url]) && isset(self::$cache['content'][self::$cache['urls'][$url]]);\n }",
"static public function checkIfSrcExists($source)\n {\n $query = \"SELECT * \";\n $query .= \" FROM sources \";\n $query .= \" WHERE title= '\" . $source->title. \"'\";\n $query .= \" AND year = '\" . $source->year. \"'\";\n $query .= \" AND srcType = 'b'\"; \n $total = self::findBySqlCount($query);\n if($total > 0){\n return true;\n }\n return false;\n }"
] | [
"0.6208308",
"0.6139362",
"0.5969206",
"0.5906765",
"0.58774453",
"0.5863044",
"0.5849699",
"0.58082175",
"0.5797193",
"0.5759169",
"0.55967355",
"0.5594116",
"0.5562872",
"0.5534306",
"0.5519637",
"0.5519637",
"0.5519637",
"0.5519637",
"0.5458239",
"0.54558116",
"0.54555625",
"0.5441643",
"0.53904605",
"0.5356296",
"0.53454745",
"0.5328508",
"0.5311761",
"0.53006077",
"0.52957606",
"0.5285501"
] | 0.647849 | 0 |
Returns the detailed object for a given territory. | protected function getDetailsByTerritory($element, string $type, string $territory = "worldwide") {
$function = "get{$type}DetailsByTerritory";
foreach ($element->$function() as $rdbt) {
foreach ($rdbt->getTerritoryCode() as $tc) {
if (strtolower($tc->value()) === strtolower($territory)) {
$release_details = $rdbt;
break 2;
}
}
}
if ($release_details === null) {
throw new Exception("No details found for territory Worldwide");
}
return $release_details;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function territory()\n {\n return $this->belongsTo('App\\Models\\LocationTerritory', 'territory_id', 'id');\n }",
"public function getDetail($object) {\n\t\t$object = $this->get($object);\n\t\t\n\t\tif(!empty($object) && is_object($object)) {\n\t\t\t$object = $object->toArray();\n\t\t}\n\t\treturn $object;\t\n\t}",
"public function getDetail($mode);",
"private function getTerritoryService()\n {\n $service = new TerritoryService();\n\n return $service;\n }",
"private function getTerritoryService()\n {\n $service = new TerritoryService();\n\n return $service;\n }",
"function view_territory($map_id=0)\n {\n $page = $this->page;\n \n // Check input\n if ($map_id == 0)\n {\n $page['error'] = 'Cannot view a territory without providing a map id.';\n $this->load->view('templatexml', $page);\n return;\n }\n \n // Must exist\n $this->load->model('mapmodel');\n $map = $this->mapmodel->get_by_id($map_id);\n if (!isset($map->map_id))\n {\n $page['error'] = 'Cannot view a territory from a map that is not found.';\n $this->load->view('templatexml', $page);\n return;\n }\n \n $page['map'] = $map;\n $page['content'] = 'map_view_territory';\n $this->load->view('templatexml', $page);\n \n }",
"public function getDetail()\n {\n return $this->get(self::DETAIL);\n }",
"public function getDetail()\n {\n return $this->get(self::DETAIL);\n }",
"public function getTerritories()\n\t{\n\t\treturn $this->getKeyValue('territories'); \n\n\t}",
"abstract public function get_details( $transaction_or_profile_id );",
"function find_territories_by_salesperson_id($id=0) {\n global $db;\n $sql = \"SELECT * FROM territories \";\n $sql .= \"LEFT JOIN salespeople_territories\n ON (territories.id = salespeople_territories.territory_id) \";\n $sql .= \"WHERE salespeople_territories.salesperson_id='\" . $id . \"' \";\n $sql .= \"ORDER BY territories.name ASC;\";\n $territories_result = db_query($db, $sql);\n return $territories_result;\n }",
"public function show($id) \n {\n\t\t$unit_objective= UnitObjective::find($id);\n \t\treturn $unit_objective;\n }",
"public function territories()\n {\n return $this->hasMany('App\\Territory');\n }",
"public function getObject($type);",
"public function show($slug)\n {\n $item = Society::where(['slug'=> $slug, 'status' => 'published'])->firstOrFail();\n\n $society_Object = [\n 'id'=>$item->id,\n 'name'=>$item->name,\n 'category'=>$item->category,\n 'slug'=>$item->slug,\n 'uuid'=>$item->uuid,\n 'user_id'=>$item->user_id,\n 'status'=>$item->status,\n 'description'=>$item->description, \n 'linkedin'=>$item->linkedin,\n 'facebook'=>$item->facebook, \n 'instagram'=>$item->instagram, \n 'contact_mail'=>$item->contact_mail, \n 'head_incharge'=>$item->head_incharge, \n 'pr_incharge'=>$item->pr_incharge, \n 'pr_contact_number'=>$item->pr_contact_number,\n 'head_contact_number'=>$item->head_contact_number, \n 'website'=>$item->website, \n 'referrals'=>$item->referrals, \n 'views'=>$item->views,\n 'society_imgUrl'=> $item->getFirstMediaUrl('soc_logo')\n ];\n return $society_Object;\n }",
"public function getDetails();",
"public function getDetails();",
"function getObjectPageView() {\n\t\treturn $this->getTpl('daoObjectPage', '/shared');\n\t}",
"function find_territory_by_id($id=0) {\n global $db;\n $sql = \"SELECT * FROM territories \";\n $sql .= \"WHERE id='\" . $id . \"';\";\n $territory_result = db_query($db, $sql);\n return $territory_result;\n }",
"public function retreiveByObject($object){\n\n $query = $this->createQuery(\"mdS\")\n ->where ( 'mdS.object_id = ?', $object->getId () )\n ->addWhere ( 'mdS.object_class = ?', $object->getObjectClass () );\n return $query->fetchOne ();\n\t}",
"public function show(Municipality $municipality)\n {\n $municipality->load(['parent', 'barangays']);\n return new Tier3Resource($municipality);\n }",
"public function getInitiativeDetailByDetailId($object) {\n \ttry{\n \t\t$params = [];\n \t\t$params['index'] = $this->index;\n \t\t$params['body']['query']['bool']['must']\t= [ ['terms' => ['initiative_detail_ids' => [$object->microgive_initiative_detail_id]]],\n ['term' => ['enabled'=>(int)1]] ,\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t['nested' => [ 'path' => 'initiative_details',\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t'query' => ['bool' => ['must' => ['term' => ['initiative_details.microgive_initiative_detail_id' => $object->microgive_initiative_detail_id]]]],\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t'inner_hits' => ['from' => (int)0, 'size' => (int)1]]]];\n\n \t\t$results = $this->es_search($params);\n \t\t$robject\t\t=\t new stdClass();\n \t\tif (isset($results['hits']['hits'][0]['inner_hits']['initiative_details']['hits']['hits'])):\n \t\t\tif ($results['hits']['hits'][0]['inner_hits']['initiative_details']['hits']['total']>0):\n \t\t\t\t$docs\t=\t$results['hits']['hits'][0]['inner_hits']['initiative_details']['hits']['hits'];\n \t\t\t\t$row\t\t\t\t\t\t\t=\t\t(object)$results['hits']['hits'][0]['_source'];\n \t\t\t\t$robject\t\t\t\t\t\t=\t $this->setObjectInitiativeDetailByDetailId($row, $object,true);\n \t\t\t\t$robject->initiative_details\t=\t\t$this->setInitiativeDetailByDetailIdObject($docs[0]['_source'], $object,$robject->type);\n \t\t\tendif;\n \t\tendif;\n \t\treturn $robject;\n \t}\n \tcatch(Exception $e)\n \t{ $this->es_error($e); }\n }",
"public function detail()\r\n {\r\n return $this->fetch();\r\n }",
"public function getTerritoryAttribute()\n {\n return data_get($this->field, 'territory.account_territory_id');\n }",
"public function show(Personnel $personnel)\n {\n //\n }",
"public function show($id)\n\t{\n\t\treturn ProcessResponse::process(Municipality::find($id)->first()->get());\n\t}",
"public function getInvestorDetail($investor_id)\n {\n $investor = User::where('id', $investor_id)\n ->select('name', 'email', 'phone', 'address', 'company')\n ->first();\n\n $investor_content = User::where('users.id', $investor_id)\n ->join('notifications', 'users.id', '=', 'notifications.sender_id')\n ->where('notifications.type_notification', NotificationCode::TYPE_FOLLOW)\n ->select(\n 'notifications.common_id as common_id',\n 'notifications.type as type',\n 'notifications.message as message',\n 'notifications.created_at as time',\n 'notifications.status as status'\n )\n ->get();\n\n if (count($investor_content)) {\n foreach ($investor_content as $value) {\n $value->time = Functions::getDateFormatAgo($value->time);\n }\n }\n\n $investor->content = $investor_content;\n\n if (!empty($investor)) {\n return response()->json(\n [\n 'code' => ResponseStatusCode::OK,\n 'data' => $investor,\n ]\n );\n } else {\n return response()->json(\n [\n 'code' => ResponseStatusCode::NOT_FOUND,\n 'message' => \"NOT FOUND\",\n ]\n );\n }\n }",
"public function getEntityDetails($object)\n {\n $id = $label = $details = $image = $avatar = $classLabel = null;\n if ($object instanceof Organization) {\n $id = $object->getId();\n $label = $object->getName();\n $image = 'avatar-organization-small.png';\n $classLabel = $this->translator->trans('oro.organization.entity_label');\n $details = $classLabel;\n } elseif ($object instanceof BusinessUnit) {\n $id = $object->getId();\n $label = $object->getName();\n $image = 'avatar-business-unit-small.png';\n $classLabel = $this->translator->trans('oro.organization.businessunit.entity_label');\n $details = $classLabel\n . ' ' . $this->translator->trans('oro.security.datagrid.share_grid_row_details_from')\n . ' ' . $object->getOrganization()->getName();\n } elseif ($object instanceof User) {\n $id = $object->getId();\n $label = $object->getFirstName() . ' ' . $object->getLastName();\n $image = 'avatar-small.png';\n $classLabel = $this->translator->trans('oro.user.entity_label');\n $avatar = $object->getAvatar()\n ? $this->attachmentManager->getResizedImageUrl(\n $object->getAvatar(),\n AttachmentManager::SMALL_IMAGE_WIDTH,\n AttachmentManager::SMALL_IMAGE_HEIGHT\n )\n : null;\n $details = $classLabel\n . ' ' . $this->translator->trans('oro.security.datagrid.share_grid_row_details_from')\n . ' ' . $object->getOwner()->getName();\n }\n\n return [\n 'id' => $id,\n 'label' => $label,\n 'image' => $image,\n 'avatar' => $avatar,\n 'details' => $details,\n 'classLabel' => $classLabel,\n ];\n }",
"public static function getDetailsOnOpportunity($id){\n return CHController::getModel('organization')->select('SELECT * FROM volunteer_opportunities WHERE id = :id', array(':id' => $id));\n\n return $details;\n }",
"public function show(Request $request, $id)\n {\n// $regionCodes = Region::all();\n// $territoryCodes = Territory::all();\n//\n// $po = DB::table('pos')\n// ->join('zones', 'zones.id', 'pos.zone_id')\n// ->join('regions', 'regions.id', 'pos.region_id')\n// ->join('territories', 'territories.id', 'pos.territory_id')\n// ->join('users', 'users.id', 'pos.distributor_id')\n// ->where('pos.po_number', $request->po_number)\n// ->select('regions.code as region_code', 'territories.code as territory_code', 'users.name as name', 'pos.po_number as po_number',\n// 'pos.date as date')\n// ->get();\n//\n// return $po;\n// return view('PO.index')->with(['regionCodes' => $regionCodes, 'territoryCodes' => $territoryCodes, 'pos' => $po]);\n }"
] | [
"0.62223953",
"0.55941653",
"0.55372304",
"0.53869337",
"0.53869337",
"0.5350572",
"0.5252958",
"0.5252958",
"0.5222654",
"0.51697785",
"0.5168264",
"0.51155293",
"0.5113142",
"0.5106792",
"0.5094873",
"0.50805753",
"0.50805753",
"0.50796205",
"0.50723964",
"0.50483036",
"0.50381297",
"0.50292623",
"0.5019071",
"0.49923012",
"0.4971142",
"0.4960935",
"0.49501526",
"0.49468037",
"0.49256614",
"0.49241292"
] | 0.6382455 | 0 |
A Place belongs to many Categories (Example: A restaurant can be a : Japanese, Malay, Chinese restaurant category as it serves a mix of the food | public function categories()
{
return $this->belongsToMany(\App\Category::class, 'places_categories', 'place_id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function categories();",
"public function categories();",
"public function categories();",
"public function categories(): HasMany\n {\n return $this->hasMany(self::class, 'translation_of');\n }",
"public function categories()\n {\n return $this->morphToMany(Category::class, 'categorizable', 'categorizables');\n }",
"public function categories() {\n return $this->hasMany(Category::class);\n }",
"public function categories()\n {\n return $this->morphMany('App\\Category', 'categorable');\n }",
"public function categories() {\n return $this->morphToMany('App\\Models\\Content\\Category', 'categorized');\n }",
"public function categories(): MorphToMany\n {\n return $this->morphToMany(\n $this->getCategoryClass(),\n 'model',\n 'model_has_categories',\n 'model_id',\n 'category_id'\n );\n }",
"public function categories(){\n return this->hasMany('App\\Category');\n }",
"public function categories(){\n return $this -> belongsToMany('Category');\n }",
"public function categories()\n {\n return $this->hasMany(Category::class);\n }",
"public function categories()\n {\n return $this->morphToMany(Category::class, 'categoryable');\n }",
"public function categories() {\n return $this->hasMany(Category::class);\n }",
"public function foodCategories()\n {\n return $this->hasMany(FoodCategory::class, 'restaurant_id', 'id');\n }",
"public function getCategories()\n {\n return $this->hasMany(Category::class, ['typeId' => 'id']);\n }",
"public function getCategories();",
"public function getCategories();",
"public function getCategories();",
"public function getCategories();",
"public function places() {\n\t\treturn $this->hasMany('App\\Place');\n\t}",
"public function getAllCategories();",
"public function categories(): BelongsToMany {\n\t\treturn $this->belongsToMany(Category::class);\n\t}",
"public static function getAllCategory(){\n \treturn self::orderby('wordingCategory')\n \t\t\t\t->get(['wordingCategory']);\n }",
"public function createCategory();",
"public function categories()\n {\n \treturn $this->belongsTo('App\\Category');\n }",
"public function subcategories()\n {\n //define relationship between categories and subcategories\n //one location has multiple sublocations\n //so we have to specify the name of sublocation model\n return $this->hasMany('App\\Subcategory'); //this is one->many relationship\n }",
"public function getCategorie();",
"public function categories() {\n\t\treturn $this->belongsTo('Category');\n\t}",
"public function getCategory();"
] | [
"0.63538146",
"0.63538146",
"0.63538146",
"0.6178363",
"0.6118984",
"0.60219866",
"0.6011059",
"0.59794855",
"0.597287",
"0.59668493",
"0.59556836",
"0.59062904",
"0.5902919",
"0.5898655",
"0.5882905",
"0.58671343",
"0.5848215",
"0.5848215",
"0.5848215",
"0.5848215",
"0.582529",
"0.5810581",
"0.58066183",
"0.58016133",
"0.5767794",
"0.575859",
"0.5755784",
"0.5749373",
"0.5745773",
"0.57405555"
] | 0.7295719 | 0 |
Build Apple Pay Session Validation parameters | private function getAppleValidationParameters(): array
{
$validationPaymentType = new ApplePayInitialization();
$parameters = $validationPaymentType->generateParameters(
new PaymentDTO([], $validationPaymentType),
false
);
if (APSMerchant::isDebugMode()) {
Logger::getInstance()->debug(
'Apple Pay session Data sent: ' . json_encode($parameters)
);
}
return $parameters;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getAppleValidationHeaderOptions(): array\n {\n $optionsType = new ApplePayHeaderOptions();\n\n $options = $optionsType->generateParameters(\n new PaymentDTO([], $optionsType),\n false\n );\n\n if (APSMerchant::isDebugMode()) {\n Logger::getInstance()->debug(\n 'Apple Pay session connector options: ' . json_encode($options)\n );\n }\n\n return $options;\n }",
"public function getParams() {\n if (!$this->validate()) throw new Service24PayRequestException(\"Invalid request parameters: \" . implode(\", \", $this->errors));\n\n $requestParams = array_filter($this->requestParams);\n\n $requestParams[\"Mid\"] = $this->service24Pay->getMid();\n $requestParams[\"EshopId\"] = $this->service24Pay->getEshopId();\n $requestParams[\"Timestamp\"] = date(\"Y-m-d H:i:s\");\n\n $requestParams[\"Debug\"] = empty($requestParams[\"Debug\"]) ? 'false' : 'true';\n $requestParams[\"PreAuthProvided\"] = empty($requestParams[\"PreAuthProvided\"]) ? 'false' : 'true'; \n $requestParams[\"RedirectSign\"] = empty($requestParams[\"RedirectSign\"]) ? 'false' : 'true';\n\n $requestParams[\"Sign\"] = $this->service24Pay->computeSIGN($requestParams[\"Mid\"] . $requestParams[\"Amount\"] . $requestParams[\"CurrAlphaCode\"] . $requestParams[\"MsTxnId\"] . $requestParams[\"FirstName\"] . $requestParams[\"FamilyName\"] . $requestParams[\"Timestamp\"]);\n\n return $requestParams;\n }",
"protected function buildParameters()\n {\n if(empty($this->_sessionId)){\n throw new Exception('Session ID not set');\n }\n\n $parameters = array(\n 'session' => $this->_sessionId,\n );\n\n return $parameters;\n }",
"public static function buildBasicParametersToken(){\n\t\n\t\t$parameters = array(PayUParameters::PAYER_NAME => 'PayerName-' . rand(10000,9999999) . ' PayerSurname-' .rand(10000,9999999),\n\t\t\t\t\t\t\tPayUParameters::PAYER_ID => 'payerId_123'\t\t\t\t\n\t\t);\n\t\n\t\treturn $parameters;\n\t}",
"public static function buildBasicParameters(){\n\t\t\n\t\t$parameters = array(PayUParameters::REFERENCE_CODE => 'referenceCode-' . rand(10000,999999999),\n\t\t\t\tPayUParameters::PAYER_NAME=> 'PayerName-' . rand(10000,9999999) . ' PayerSurname-' .rand(10000,9999999),\n\t\t\t\tPayUParameters::COUNTRY => PayUCountries::PA,\n\t\t\t\tPayUParameters::ACCOUNT_ID => \"8\",\n\t\t\t\tPayUParameters::CURRENCY => \"USD\",\n\t\t\t\tPayUParameters::DESCRIPTION => 'description-' . rand(10000,9999999),\n\t\t\t\tPayUParameters::VALUE => rand(1000,1500) . '.'.rand(10,99),\n\t\t\t\tPayUParameters::INSTALLMENTS_NUMBER => '1',\n\t\t\t\t);\n\t\t\n\t\t\n\t\treturn $parameters;\n\t}",
"protected function get_reqired_params() {\n return array(\n /*array('name' => 'account_id',\n 'display' => 'Account id',\n 'required' => true),*/\n array('name' => 'buyer_creative_id',\n 'display' => 'Buyer creative id',\n 'required' => true),\n array('name' => 'advertiser_name',\n 'display' => 'Advertiser name',\n 'required' => true),\n array('name' => 'html_snippet',\n 'display' => 'HTML Snippet',\n 'required' => true),\n array('name' => 'click_through_urls',\n 'display' => 'Click through URLs',\n 'required' => true),\n array('name' => 'width',\n 'display' => 'Width',\n 'required' => true),\n array('name' => 'height',\n 'display' => 'Height',\n 'required' => true)\n );\n }",
"public function createMerchantParameters()\n {\n $json = $this->arrayToJson();\n // Se codifican los datos Base64\n return $this->encodeBase64($json);\n }",
"protected function _getRequireSessionWithParams()\n {\n $this->_aRequireSessionWithParams['cl']['mollieFinishPayment'] = true;\n\n return parent::_getRequireSessionWithParams();\n }",
"function _validateParams(array $request, array $needed) {\n global $KeyPublic, $KeyEncoding, $KeyRevoked;\n\n // add login credentials to be checked always:\n // sid (service provider id)\n // spwd (service provider password)\n array_push($needed, \"sid\", \"spwd\");\n\n // Check if all needed values are existing in the request\n foreach($needed as $param) {\n if (!array_key_exists($param, $request)) {\n _generateError($request, EC_MISSING_PARAMETERS, \n \"Missing mandatory value $param\");\n return false;\n }\n }\n\n // validate encrypted data if needed\n // must be receipt:cs:iv:payload, where iv must be hex encoded and cs\n // must be 2 characters\n // maximum length of all is 15MB\n if (in_array(\"data\", $needed)) {\n if (strlen($request[\"data\"]) > MAX_DATA_SIZE * 1024) {\n _generateError($request, EC_INVALID_SIZE, \n \"Size of data > \".MAX_DATA_SIZE.\"KB\");\n return false;\n }\n $data = explode(\":\", $request[\"data\"]);\n if (count($data) != 4) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid data encoding (expecting 4 parts receipt:cs:iv:payload)\");\n return false;\n }\n if (strlen($data[0]) < 4) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid recipt (expecting 4 characters minimum)\");\n return false;\n }\n if (strlen($data[1]) != 2) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid checksum (expecting 2 characters)\");\n return false;\n }\n if (!validateHEX($data[2])) { // hint: empty string is also not hex!\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid data encoding (expecting hex iv)\");\n return false;\n }\n if (strlen($data[3]) < 4) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid data encoding (expecting some payload > 4 characters)\");\n return false;\n }\n }\n\n // validate pkey value if needed \n // (only for future ECC implementation)\n /*\n if (in_array(\"pkey\", $needed)) {\n $pkey = $request[\"pkey\"];\n if (!array_key_exists($pkey, $KeyPublic)) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid pkey value\");\n return false;\n }\n if ($KeyRevoked[$pkey] == TRUE) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Revoked pkey\");\n return false;\n }\n }\n */\n\n // validate pid value(s) if needed\n if (in_array(\"pid\", $needed)) {\n $pids = explode(\" \", $request[\"pid\"]);\n foreach ($pids as $pid) {\n if (!validateHEX($pid)) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid pid value (expecting pid to be hex)\");\n return false;\n }\n }\n }\n\n // validate login\n $sql = \"SELECT password FROM provider WHERE providerid=?\";\n $res = GetOneSQLValue($sql, array($request[\"sid\"]));\n if ($res == 0) {\n _generateError($request, EC_INVALID_CREDENTIALS, \n \"Invalid sid (service provider id)\");\n return false;\n }\n $pwd = $res[\"password\"];\n if ($pwd != $request[\"spwd\"]) {\n _generateError($request, EC_INVALID_CREDENTIALS, \n \"Invalid spwd (service provider password)\");\n return false;\n }\n\n return true;\n}",
"public function validate()\n {\n if (strlen($this['PaymentAccountID']) && !preg_match('/^.{1,50}$/', $this['PaymentAccountID'])) {\n throw new InvalidRequestException('PaymentAccountID should have 50 or fewer characters');\n }\n\n if (isset($this['PaymentAccountType'])) {\n try {\n PaymentAccountType::memberByValue($this['PaymentAccountType']);\n } catch (\\Exception $e) {\n throw new InvalidRequestException('Invalid value for PaymentAccountType');\n }\n }\n\n if (strlen($this['PaymentAccountReferenceNumber'])) {\n if (!preg_match('/^.{1,50}$/', $this['PaymentAccountReferenceNumber'])) {\n throw new InvalidRequestException('PaymentAccountReferenceNumber should have 50 or fewer characters');\n }\n }\n\n if (strlen($this['PaymentBrand']) && !preg_match('/^.{1,50}$/', $this['PaymentBrand'])) {\n throw new InvalidRequestException('PaymentBrand should have 50 or fewer characters');\n }\n\n if (strlen($this['ExpirationMonthBegin'])) {\n if (!preg_match('/^\\d{2}$/', $this['ExpirationMonthBegin']) || $this['ExpirationMonthBegin'] > 12) {\n throw new InvalidRequestException('ExpirationMonthBegin should be a two-digit month');\n }\n }\n\n if (strlen($this['ExpirationMonthEnd'])) {\n if (!preg_match('/^\\d{2}$/', $this['ExpirationMonthEnd']) || $this['ExpirationMonthEnd'] > 12) {\n throw new InvalidRequestException('ExpirationMonthEnd should be a two-digit month');\n }\n }\n\n if (strlen($this['ExpirationYearBegin']) && !preg_match('/^\\d{2}$/', $this['ExpirationYearBegin'])) {\n throw new InvalidRequestException('ExpirationYearBegin should be a two-digit year');\n }\n\n if (strlen($this['ExpirationYearEnd']) && !preg_match('/^\\d{2}$/', $this['ExpirationYearEnd'])) {\n throw new InvalidRequestException('ExpirationYearEnd should be a two-digit year');\n }\n\n if (strlen($this['ExpirationYearBegin']) && strlen($this['ExpirationYearEnd'])) {\n if ($this['ExpirationYearEnd'] < $this['ExpirationYearBegin']) {\n throw new InvalidRequestException('ExpirationYearBegin must be before ExpirationYearEnd');\n }\n if (strlen($this['ExpirationMonthBegin']) && strlen($this['ExpirationMonthEnd'])) {\n if ($this['ExpirationYearBegin'] == $this['ExpirationYearEnd']) {\n if ($this['ExpirationMonthEnd'] < $this['ExpirationMonthBegin']) {\n throw new InvalidRequestException('ExpirationMonthBegin must be before ExpirationMonthEnd');\n }\n }\n }\n }\n }",
"function construct_value_array() {\n $this->credit_card_details = array(\n 'card_number' => $_POST['card_number'],\n 'expiry_date' => array('year' => $_POST['expiry']['year'], 'month' => $_POST['expiry']['month']),\n 'card_code' => $_POST['card_code']\n );\n\n /*\n (TransRequestID,(((CreditCardNumber|CreditCardToken),ExpirationMonth,ExpirationYear,(IsCardPresent|IsECommerce|IsRecurring)?)|(Track1Data|Track2Data)),Amount,NameOnCard?,CreditCardAddress?,CreditCardCity?,CreditCardState?,CreditCardPostalCode?,CommercialCardCode?,SalesTaxAmount?,CardSecurityCode?,Lodging?,Restaurant?,BatchID?,ClientTransID?,InvoiceID?,UserID?,Comment?)\n */\n $gateway_doc = <<<EOXML\n<?xml version=\"1.0\"?>\n<?qbmsxml version=\"4.4\"?>\n<QBMSXML>\n<SignonMsgsRq>\n <SignonDesktopRq>\nEOXML;\n $gateway_doc .= \"<ClientDateTime>\" . date('Y-m-d\\TH:i:s') . \"</ClientDateTime>\";\n $gateway_doc .= \"<ApplicationLogin>\" . QBMS_APP_NAME . \"</ApplicationLogin>\";\n $gateway_doc .= \"<ConnectionTicket>\" . qbms_get_ticket() . \"</ConnectionTicket>\";\n $gateway_doc .= <<<EOXML\n </SignonDesktopRq>\n</SignonMsgsRq>\n<QBMSXMLMsgsRq>\n <CustomerCreditCardChargeRq>\nEOXML;\n $gateway_doc .= \"<TransRequestID>\" . $this->cart_data['session_id'] . \"</TransRequestID>\";\n $gateway_doc .= \"<CreditCardNumber>\" . $this->credit_card_details['card_number'] . \"</CreditCardNumber>\";\n $gateway_doc .= \"<ExpirationMonth>\" . $this->credit_card_details['expiry_date']['month'] . \"</ExpirationMonth>\";\n $gateway_doc .= \"<ExpirationYear>\" . $this->credit_card_details['expiry_date']['year'] . \"</ExpirationYear>\";\n $gateway_doc .= \"<IsCardPresent>false</IsCardPresent>\";\n $gateway_doc .= \"<Amount>\" . number_format($this->cart_data['total_price'],2,'.','') . \"</Amount>\";\n $gateway_doc .= \"<NameOnCard>\" . $this->cart_data['billing_address']['first_name'] . \" \" . $this->cart_data['billing_address']['last_name'] . \"</NameOnCard>\";\n $gateway_doc .= \"<CreditCardAddress>\" . $this->cart_data['billing_address']['address'] . \"</CreditCardAddress>\";\n $gateway_doc .= \"<CreditCardCity>\" . $this->cart_data['billing_address']['city'] . \"</CreditCardCity>\";\n //$gateway_doc .= \"<CreditCardState>\" . $this->cart_data['billing_address'][''] . \"</CreditCardState>\";\n $gateway_doc .= \"<CreditCardPostalCode>\" . $this->cart_data['billing_address']['post_code'] . \"</CreditCardPostalCode>\";\n $gateway_doc .= \"<CardSecurityCode>\" . $this->credit_card_details['card_code'] . \"</CardSecurityCode>\";\n $gateway_doc .= \"<InvoiceID>\" . $this->cart_data['session_id'] . \"</InvoiceID>\";\n $gateway_doc .= \"<Comment>\" . get_option('qbms_form_description') . \"</Comment>\";\n $gateway_doc .= <<<EOXML\n </CustomerCreditCardChargeRq>\n </QBMSXMLMsgsRq>\n</QBMSXML>\nEOXML;\n\n $this->collected_gateway_data = $gateway_doc;\n }",
"private function getEnrollParameters()\n {\n // array we need to convert to XML\n $parameters = [\n \"RequestSource\" => \"PartnerCode\",\n \"Product\" => [\n \"PackageId\" => env('IDCS_PACKAGE'),\n \"ProductUser\" => [\n \"Memberid\" => $this->user->uuid,\n \"EmailAddress\" => $this->user->email,\n \"Password\" => str_random(12),\n \"Address\" => [\n \"Address1\" => $this->user->address,\n \"Address2\" => \"\",\n \"City\" => $this->user->city,\n \"State\" => $this->user->state,\n \"ZipCode\" => $this->user->zip,\n ],\n \"Phone\" => [\n \"PhoneNumber\" => $this->user->phone,\n \"PhoneType\" => \"Home\"\n ],\n \"Person\" => [\n \"FirstName\" => $this->user->first_name,\n \"LastName\" => $this->user->last_name,\n \"MiddleName\" => \"\"\n ]\n ]\n ],\n \"Partner\" => [\n \"partnerAccount\" => env('IDCS_USERNAME'),\n \"partnerCode\" => env('IDCS_USERNAME'),\n \"partnerPassword\" => env('IDCS_PASSWORD'),\n \"Branding\" => env('IDCS_USERNAME')\n ]\n ];\n\n\n $xml = new \\SimpleXMLElement(\"<Request></Request>\");\n\n $this->array_to_xml($parameters, $xml);\n $raw_xml = $xml->asXML();\n $raw_xml = trim(str_replace('<?xml version=\"1.0\"?>', '', $raw_xml));\n\n $parameters = [\n 'xmlRequest' => [\n 'any' => new \\SoapVar($raw_xml, XSD_ANYXML)\n ]\n ];\n\n return $parameters;\n }",
"function getRequestParameters()\n {\n $params = $this->getRawParameters();\n\n $fingerprintOrder = array_merge(\n ['customerId', 'shopId', 'password', 'secret', 'language'],\n $this->fingerprintOrder\n );\n\n $requiredParameters = array_merge(\n ['customerId', 'requestFingerprint', 'password', 'language'],\n $this->requiredParameters\n );\n\n switch ($this->getParam('fundTransferType')) {\n case FundTransferType::EXISTINGORDER:\n $fingerprintOrder[] = 'sourceOrderNumber';\n $requiredParameters[] = 'sourceOrderNumber';\n break;\n case FundTransferType::MONETA:\n $fingerprintOrder[] = 'consumerWalletId';\n $requiredParameters[] = 'consumerWalletId';\n break;\n case FundTransferType::SEPA_CT:\n $fingerprintOrder[] = 'bankAccountOwner';\n $fingerprintOrder[] = 'bankBic';\n $fingerprintOrder[] = 'bankAccountIban';\n $requiredParameters[] = 'bankAccountOwner';\n $requiredParameters[] = 'bankBic';\n $requiredParameters[] = 'bankAccountIban';\n break;\n case FundTransferType::SKRILLWALLET:\n $fingerprintOrder[] = 'consumerEmail';\n $requiredParameters[] = 'consumerEmail';\n $requiredParameters[] = 'customerStatement';\n break;\n }\n\n $params['requestFingerprint'] = Fingerprint::fromParameters($params)\n ->setContext($this->getContext())\n ->setFingerprintOrder($fingerprintOrder);\n $this->assertParametersAreValid($params, $requiredParameters);\n\n return $params;\n }",
"public function buildAdditionalParams()\n\t{\n\t\tglobal $context;\n\n\t\t$arr = $this->getExtraUrlParameters();\n\n\t\t// Only include the session ID in the URL if it's strictly necessary.\n\t\tif (!$this->isUrlSessionCheckDisabled())\n\t\t{\n\t\t\t$arr[$context['session_var']] = $context['session_id'];\n\t\t}\n\n\t\t$extraUrlParameters = '';\n\t\tforeach ($arr as $key => $value)\n\t\t{\n\t\t\t$extraUrlParameters .= sprintf(';%s=%s', $key, $value);\n\t\t}\n\n\t\treturn $extraUrlParameters;\n\t}",
"abstract protected function _paramsASN1();",
"public function getPaymentCreateRequest() {\n $data = null;\n if ($this->amount && $this->currency) {\n // capture pre-authorized payment\n if ($this->parentTransactionId) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"authorization\" => $this->parentTransactionId,\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n }\n // authorize/capture payment using Simplify customer identifier\n else if ($this->cardId) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"customer\" => $this->cardId,\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n }\n // authorize/capture payment using card token\n else if ($this->cardToken) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"token\" => $this->cardToken,\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n }\n // authorize/capture payment using raw card data\n else if ($this->cardNumber) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"card\" => array(\n \"expYear\" => $this->expirationYear,\n \"expMonth\" => $this->expirationMonth, \n \"cvc\" => $this->cvc,\n \"number\" => $this->cardNumber\n ),\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n if ($this->billing) {\n $data[\"card\"][\"name\"] = $this->billing->getName();\n $data[\"card\"][\"addressCity\"] = $this->billing->getCity();\n $data[\"card\"][\"addressLine1\"] = $this->billing->getStreetLine(1);\n $data[\"card\"][\"addressLine2\"] = $this->billing->getStreetLine(2);\n $data[\"card\"][\"addressZip\"] = $this->billing->getPostcode();\n $data[\"card\"][\"addressState\"] = $this->billing->getRegion();\n $data[\"card\"][\"addressCountry\"] = $this->billing->getCountryId();\n }\n } \n }\n return $data;\n }",
"function createCheckoutRequest()\n\t{\n\t\t$this->cart_xml \t\t\t\t\t= \t$this->cart->GetXML();\n\t\t$this->fields_xml \t\t\t\t\t= \t$this->fields->GetXML();\n\n\t\t$ganalytics \t\t\t\t\t\t= \t\"\";\n\t\tif (!empty($this->ganalytics['account']))\n\t\t{\n\t\t\t$ganalytics \t\t\t\t\t.= \t'<google-analytics>';\n\t\t\t$ganalytics \t\t\t\t\t.= \t' <account>' . $this->xmlEscape($this->ganalytics['account']) . '</account>';\n\t\t\t$ganalytics \t\t\t\t\t.= \t'</google-analytics>';\n\t\t}\n\t\t\n\t\tif($this->use_shipping_notification)\n\t\t{\n\t\t\t$use_shipping_xml \t\t\t\t= \"<checkout-settings>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<use-shipping-notification>true</use-shipping-notification>\n\t\t\t\t\t\t\t\t\t\t\t </checkout-settings>\"; \t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$use_shipping_xml \t\t\t\t= \t\"\";\n\t\t}\n\t\t\t\t\n\t\t$request \t\t\t\t\t\t\t= \t'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t\t\t\t\t\t<checkouttransaction ua=\"' . $this->plugin_name . ' ' . $this->version \t\t\t\t. '\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<account>' . $this->xmlEscape($this->merchant['account_id']) \t\t. '</account>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<site_id>' . $this->xmlEscape($this->merchant['site_id']) \t\t\t. '</site_id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<site_secure_code>' . $this->xmlEscape($this->merchant['site_code']) \t\t. '</site_secure_code>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<notification_url>' . $this->xmlEscape($this->merchant['notification_url']) . '</notification_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<cancel_url>' . $this->xmlEscape($this->merchant['cancel_url']) \t\t. '</cancel_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<redirect_url>' . $this->xmlEscape($this->merchant['redirect_url']) \t. '</redirect_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<close_window>' . $this->xmlEscape($this->merchant['close_window']) \t. '</close_window>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t\t <shop>' . \t $this->xmlEscape($this->plugin['shop']) \t\t\t\t\t. '</shop>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_version>' . $this->xmlEscape($this->plugin['shop_version']) \t\t\t. '</shop_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<plugin_version>' . $this->xmlEscape($this->plugin['plugin_version']) \t\t. '</plugin_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<partner>' . $this->xmlEscape($this->plugin['partner']) \t\t\t\t. '</partner>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_root_url>' . $this->xmlEscape($this->plugin['shop_root_url']) \t\t\t. '</shop_root_url>\n\t\t\t\t\t\t\t\t\t\t\t\t </plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<locale>' . $this->xmlEscape($this->customer['locale']) \t\t\t. '</locale>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ipaddress>' . $this->xmlEscape($this->customer['ipaddress']) \t\t. '</ipaddress>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<forwardedip>' . $this->xmlEscape($this->customer['forwardedip']) \t\t. '</forwardedip>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->customer['firstname']) \t\t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->customer['lastname']) \t\t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->customer['address1']) \t\t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->customer['address2']) \t\t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->customer['housenumber']) \t\t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->customer['zipcode']) \t\t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->customer['city']) \t\t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->customer['state']) \t\t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->customer['country']) \t\t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->customer['phone']) \t\t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->customer['email']) \t\t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<referer>' . \t\t $this->xmlEscape($this->customer['referer'])\t\t\t. '</referer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->delivery['firstname']) \t\t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->delivery['lastname']) \t\t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->delivery['address1']) \t\t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->delivery['address2']) \t\t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->delivery['housenumber']) \t\t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->delivery['zipcode']) \t\t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->delivery['city']) \t\t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->delivery['state'])\t \t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->delivery['country']) \t\t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->delivery['phone']) \t\t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->delivery['email']) \t\t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t\t' . $this->cart_xml . '\n\t\t\t\t\t\t\t\t\t\t\t\t\t' . $this->fields_xml . '\n\t\t\t\t\t\t\t\t\t\t\t\t\t' . $ganalytics . '\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t' . $use_shipping_xml . ' \n\t\t\t\t\t\t\t\t\t\t\t\t\t<checkout-settings>\n\t\t\t\t\t\t\t\t\t\t\t\t\t <no-shipping-method>true</no-shipping-method>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</checkout-settings>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<id>' . $this->xmlEscape($this->transaction['id']) \t\t\t. '</id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<currency>' . $this->xmlEscape($this->transaction['currency']) \t\t. '</currency>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<amount>' . $this->xmlEscape($this->transaction['amount']) \t\t. '</amount>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<description>' . $this->xmlEscape($this->transaction['description']) \t. '</description>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<var1>' . $this->xmlEscape($this->transaction['var1']) \t\t\t. '</var1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<var2>' . $this->xmlEscape($this->transaction['var2']) \t\t\t. '</var2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<var3>' . $this->xmlEscape($this->transaction['var3']) \t\t\t. '</var3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<items>' . $this->xmlEscape($this->transaction['items']) \t\t. '</items>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<manual>' . $this->xmlEscape($this->transaction['manual']) \t\t. '</manual>\n\t\t\t\t\t\t\t\t\t\t\t\t<gateway>'. $this->xmlEscape($this->transaction['gateway']) \t\t\t\t. '</gateway>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<signature>' . $this->xmlEscape($this->signature) \t\t\t\t\t\t. '</signature>\n\t\t\t\t\t\t\t\t\t\t\t\t</checkouttransaction>';\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\treturn $request;\n\t}",
"public function validateReceiptCheck($input_params=array()){\n $sample_json = file_get_contents($_FILES['receipt_data']['tmp_name']);\n\n\n \n //$applesharedsecret = '76238eb83ebb44bebfebe4c66999050a';\n //$appleurl ='https://sandbox.itunes.apple.com/verifyReceipt';\n $applesharedsecret = $this->config->item(\"SUBSCRIPTION_PASSWORD\");\n $appleurl = $this->config->item(\"SUBSCRIPTION_ITUNES_URL\");\n //https://buy.itunes.apple.com/verifyReceipt //for production\n\n \n $request = json_encode(array(\"receipt-data\" => $sample_json,\"password\"=>$applesharedsecret));\n // setting up the curl\n\n $ch = curl_init($appleurl);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $request);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));\n $jsonresult = curl_exec($ch);\n\n \n\n $err = curl_error($ch);\n curl_close($ch);\n if($err){\n $return_arr[0]['transaction_id'] = '';\n $return_arr[0]['expiry_date'] = '';\n $return_arr[0]['success'] = 0;\n $return_arr[0]['message'] = $err;\n $return_arr[0]['receipt_data_v1'] =\"\";\n }else{\n $decoded_json = json_decode($jsonresult);\n\n $return_arr =array();\n if(!empty($decoded_json->latest_receipt_info)) {\n \n $expires_date = \"\";\n $transaction_id = \"\";\n $product_id = \"\";\n \n \n foreach ($decoded_json->latest_receipt_info as $value) {\n $gmt_date = $value->expires_date;\n $date1 = explode(' ',$gmt_date);\n $expiry_date_curr = $date1[0].\" \".$date1[1];\n \n if($expires_date == \"\")\n {\n $expires_date = $expiry_date_curr;\n $transaction_id = $value->transaction_id;\n $product_id = $value->product_id;\n }\n if(strtotime($expiry_date_curr) > strtotime($expires_date))\n {\n $expires_date = $expiry_date_curr;\n $transaction_id = $value->transaction_id;\n $product_id = $value->product_id;\n }\n\n }\n \n \n if(strtotime($expires_date) < strtotime(date(\"Y-m-d H:i:s\")))\n {\n $return_arr[0]['success'] = 0;\n $return_arr[0]['message'] = 'Your subscription is expired. Please subscribe again to use app features.'; \n }else\n {\n $return_arr[0]['success'] = 1;\n $return_arr[0]['message'] = 'Subscription purchased successfully.'; \n }\n \n \n $return_arr[0]['transaction_id'] = $transaction_id;\n $return_arr[0]['product_id'] = $product_id;\n $return_arr[0]['expiry_date'] = $expires_date;\n $return_arr[0]['receipt_data_v1'] =$sample_json;\n }else{\n \n $return_arr[0]['transaction_id'] = $transaction_id;\n $return_arr[0]['expiry_date'] = $expiry_date;\n $return_arr[0]['success'] = 0;\n $return_arr[0]['message'] = 'Something went wrong, Please try again!';\n $return_arr[0]['receipt_data_v1'] =\"\";\n }\n }\n return $return_arr;\n \n}",
"public static function requestBuild(){\n $tranDateTime = DateTime::getDateTime();\n $uuid = Uuid::generate()->string;\n $applicationId = \"Sadad\";\n $request = array();\n $request += [\"applicationId\" => $applicationId];\n $request += [\"UUID\" => $uuid];\n $request += [\"tranDateTime\" => $tranDateTime];\n\n return $request;\n }",
"function getEncryptedParams(){\n if(isset($_REQUEST['code'])){\n \n $hash_str = urldecode($_REQUEST['code']);\n \n $str = CCrypter::decrypt($hash_str, Config::CRYPT_KEY, Config::CRYPT_IV);\n \n if(preg_match('/(?=LG\\=.*)(?=.*QID\\=.*)(?=.*MID\\=.*)(?=.*CID\\=.*)(?=.*GID\\=.*)(?=.*PS\\=.*)/', $str)) {\n \n $splited = explode('&',$str);\n $length = count($splited);\n $params=null;\n for($i=0;$i<$length;++$i){\n $line = $splited[$i];\n $split = explode('=',$line);\n $name = preg_replace('/[\\x00-\\x1F\\x80-\\xFF]/', '', $split[0]);\n $value = preg_replace('/[\\x00-\\x1F\\x80-\\xFF]/', '', $split[1]);\n \n if($name == 'PS') { $value = substr($value,0,strlen(Config::PREVIEW_PASSWORD)); }\n \n $params[$name]=$value;\n }\n \n return $params;\n }\n }\n return null;\n}",
"protected function buildRequestParams()\n {\n $Request = [];\n $Request['client_id'] = $this->APIClientId;\n $Request['api_key'] = $this->APIKey;\n $Request['order_id'] = $this->OrderId;\n if (!empty($this->Reason)) {\n $Request['reason'] = $this->Reason;\n }\n $Request['notify'] = $this->Notify;\n $Request['item_id'] = $this->ItemId;\n $this->RequestParams = $Request;\n return $Request;\n }",
"public function getStandardCheckoutFormFields()\n {\n $session = Mage::getSingleton('checkout/session');\n \n $order = $this->getOrder();\n if (!($order instanceof Mage_Sales_Model_Order)) {\n Mage::throwException($this->_getHelper()->__('Cannot retrieve order object'));\n }\n\t\t$billing = $order->getBillingAddress();\n\t\t$shipping = $order->getShippingAddress();\n\t\t$productDetails = $this->getProductItems($order->getAllItems());\n\t\t\n\t\n\t\t$parameter = array();\n\t\t\n\t\t//支付币种\n\t\t$parameter['order_currency']\t= $order->getOrderCurrencyCode();\n\t\t//金额\n\t\t$parameter['order_amount']\t\t= $this->formatAmount($order->getGrandTotal(), $parameter['order_currency']);//sprintf('%.2f', $order->getGrandTotal());\n\n\t\t//判断是否启用3D功能\n\t\tif($this->getConfigData('secure_mode') == 1){\n\t\t\t//检验是否需要3D验证\n\t\t\t$validate_arr = $this->validate3D($parameter['order_currency'], $parameter['order_amount'], $billing, $shipping);\n\t\t}else{\n\t\t\t$validate_arr['terminal'] = $this->getConfigData('terminal');\n\t\t\t$validate_arr['securecode'] = $this->getConfigData('securecode');\n\t\t}\n\n //账户\n\t\t$parameter['account']\t\t\t= $this->getConfigData('account');\n\t\t//终端号\n\t\t$parameter['terminal']\t\t\t= $validate_arr['terminal'];\n\t\t//securecode\n\t\t$parameter['securecode']\t\t= $validate_arr['securecode'];\n\t\t//支付方式\n\t\t$parameter['methods']\t\t\t= 'Credit Card';\n\t\t//订单号\n\t\t$parameter['order_number']\t\t= $order->getRealOrderId();\t\n\t\t//返回地址\n\t\t$parameter['backUrl']\t\t\t= $this->getReturnURL();\n\t\t//服务器响应地址\n\t\t$parameter['noticeUrl']\t\t\t= $this->getNoticeURL();\n\t\t//备注\n\t\t$parameter['order_notes']\t\t= $order->getRealOrderId();\n\t\t//账单人名\n\t\t$parameter['billing_firstName']\t= $this->OceanHtmlSpecialChars($billing->getFirstname());\n\t\t//账单人姓\n\t\t$parameter['billing_lastName']\t= $this->OceanHtmlSpecialChars($billing->getLastname());\n\t\t//账单人email\n\t\t$parameter['billing_email']\t\t= $this->OceanHtmlSpecialChars($order->getCustomerEmail());\n\t\t//账单人电话\n\t\t$parameter['billing_phone']\t\t= $billing->getTelephone();\n\t\t//账单人国家\n\t\t$parameter['billing_country']\t= $billing->getCountry();\n\t\t//账单人州(可不提交)\n\t\t$parameter['billing_state']\t\t= $billing->getRegionCode();\n\t\t//账单人城市\n\t\t$parameter['billing_city']\t\t= $billing->getCity();\n\t\t//账单人地址\n\t\t$parameter['billing_address']\t= $billing->getStreet(1);\n\t\t//账单人邮编\n\t\t$parameter['billing_zip']\t\t= $billing->getPostcode();\t\t\n\t\t//收货人地址信息\n\t\t//收货人名\n\t\t$parameter['ship_firstName']\t= $shipping->getFirstname();\n\t\t//收货人姓\n\t\t$parameter['ship_lastName']\t\t= $shipping->getLastname();\n\t\t//收货人手机\n\t\t$parameter['ship_phone']\t\t= $shipping->getTelephone();\n\t\t//收货人国家\n\t\t$parameter['ship_country']\t\t= $shipping->getCountry();\n\t\t//收货人州\n\t\t$parameter['ship_state']\t\t= $shipping->getRegionCode();\n\t\t//收货人城市\n\t\t$parameter['ship_city']\t\t\t= $shipping->getCity();\n\t\t//收货人地址\n\t\t$parameter['ship_addr']\t\t\t= $shipping->getStreet(1);\n\t\t//收货人邮编\n\t\t$parameter['ship_zip']\t\t\t= $shipping->getPostcode();\n\t\t//产品名称\n\t\t$parameter['productName']\t\t= $productDetails['productName'];\n\t\t//产品SKU\n\t\t$parameter['productSku']\t\t= $productDetails['productSku'];\n\t\t//产品数量\n\t\t$parameter['productNum']\t\t= $productDetails['productNum'];\n\t\t//产品单价\n\t\t$parameter['productPrice']\t\t= $productDetails['productPrice'];\n\t\t//网店程序类型\n\t\t$isMobile\t\t\t\t\t\t= $this->isMobile() ? 'Mobile' : 'PC';\n\t\t$parameter['cart_info']\t\t\t= 'Magento 1.x|V1.9.0|'.$isMobile;\n\t\t//接口版本\n\t\t$parameter['cart_api']\t\t\t= '';\n\t\t//校验源字符串\n\t\t$signsrc\t\t\t\t\t\t= $parameter['account'].$parameter['terminal'].$parameter['backUrl'].$parameter['order_number'].$parameter['order_currency'].$parameter['order_amount'].$parameter['billing_firstName'].$parameter['billing_lastName'].$parameter['billing_email'].$parameter['securecode'];\n\t\t//sha256加密结果\n\t\t$parameter['signValue']\t\t\t= hash(\"sha256\", $signsrc);\n\t\t//支付页面类型\n\t\t$parameter['pages']\t\t\t\t= $this->isMobile() ? 1 : 0;\n\t\t//支付页面语言,默认英语\n\t\t$parameter['language']\t\t\t= '';\n\t\t//支付页面显示商户logo\n\t\t$parameter['logoUrl']\t\t\t= '';\n\t\t\n\n\t\t\n\t\tMage::getSingleton('checkout/session')->setData('pages', $parameter['pages']);\n\t\t\n\t\t\n\t\t//记录发送到oceanpayment的post log\n\t\t$this->postLog($parameter);\n\t\t\n\t \n return $parameter;\n }",
"function makePayment () {\n\t\t$API_UserName \t= $this->API_UserName;\n\t\t$API_Password \t= $this->API_Password;\n\t\t$API_Signature = $this->API_Signature;\n\t\t$API_Endpoint \t= $this->API_Endpoint;\n\t\t$version = $this->version;\n\t\t\t\t\n\t\t/* SET VALUES */\n\t\t $environment \t\t\t\t\t= $this->environment;\t\t\n\t\t $L_BILLINGTYPE0 \t\t\t\t= 'RecurringPayments';\n\t\t\n\t\t$this->loadModel('SbsSubscriberOrganizationDetail');\n\t\t$this->loadModel('SbsSubscriber');\n\t\t$this->loadModel('SbsSubscriberSetting');\t\n\t\t$this->loadModel('CpnSetting');\n\t\t$this->loadModel('SbsEmailTemplateDetail');\t\n\t\t$this->loadModel('SbsEmailTemplate');\n\t\t\t\t\t\t\n\t\tif ($this->request->is('post')) {\n\t\t\t\n\t\t\t\n\t\t\t$obj\t=\tnew PaypalRecurring;\n\t\t\t\n\t\t\t/* PAYPAL API DETAILS */\n\t\t\t$obj->API_UserName \t= urlencode($API_UserName);\n\t\t\t$obj->API_Password \t= urlencode($API_Password);\n\t\t\t$obj->API_Signature = urlencode($API_Signature);\n\t\t\t$obj->API_Endpoint \t= $API_Endpoint;\n\t\t\t$obj->version \t\t= urlencode($version);\t\t\t\n\t\t\t\n\t\t\t// Set request-specific fields.\n\t\t\t$obj->startDate \t= urlencode($profilestartdate);\n\t\t\t$obj->billingPeriod = urlencode($billing_period);\t\t\t\t\n\t\t\t$obj->billingFreq \t= urlencode($billing_frequency);\t\t\t\t\t\t\n\t\t\t$obj->paymentAmount = urlencode($subscription_cost);\n\t\t\t$obj->currencyID \t= urlencode($currency_code);\t\t\t\n\t\t\t$obj->taxamount\t\t= urlencode($service_tax);\t\n\t\t $obj->maxfailedpayments \t = 2; \n\t\t $obj->autobillamount \t = 'AddToNextBilling';\t \n\t\t\t$obj->initamount\t\t\t = $initial_amount;\n\t\t\t$obj->failedinitamountaction = 'CancelOnFailure'; //FAILEDINITAMTACTION\n\t\t\t$obj->environment \t\t\t\t\t\t= $environment;\t\n\t\t\t$obj->paymentType \t\t\t\t\t\t= urlencode($paymentType);\t\n\t\t\t$obj->L_BILLINGTYPE0 \t\t\t\t\t= $L_BILLINGTYPE0;\t\t\n\t\t\t$obj->L_BILLINGAGREEMENTDESCRIPTION0\t= urlencode($L_BILLINGAGREEMENTDESCRIPTION0); \n\t\t\t// creating recurring profile\n\t\t\t$httpParsedResponseAr = $obj->createRecurringPaymentsProfile($token);\n\t\t\t\n\t\t\tif(\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\t\t\n\t\t\t\n\t\t\t\t$profile_id \t= urldecode($httpParsedResponseAr[\"PROFILEID\"]);\n\t\t\t\t$profile_status = urldecode($httpParsedResponseAr[\"PROFILESTATUS\"]);\n\t\t\t\t\n\t\t\t\tswitch ($profile_status) {\n\t\t\t\t\tcase 'ActiveProfile':\n\t\t\t\t\t\t$profile_status = 'Active';\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'PendingProfile':\n\t\t\t\t\t\t$profile_status = 'Pending';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'CancelledProfile':\n\t\t\t\t\t\t$profile_status = 'Cancelled';\n\t\t\t\t\t\tbreak;\t\n\t\t\t\t\tcase 'SuspendedProfile':\n\t\t\t\t\t\t$profile_status = 'Suspended';\n\t\t\t\t\t\tbreak;\t\n\t\t\t\t\tcase 'ExpiredProfile':\n\t\t\t\t\t\t$profile_status = 'Expired';\n\t\t\t\t\t\t break;\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\tif($success){\n \t $this->redirect(array('controller'=>'controller','action' => 'action'));\n\t\t \n }else {\n\t\t\t\t// signupFailure\n\t\t\t\t$methodError \t= 'createRecurringPaymentsProfile';\n\t\t\t\t$errorCode \t= urldecode($httpParsedResponseAr[\"L_ERRORCODE0\"]);\n\t\t\t\t$errorSmallMsg = urldecode($httpParsedResponseAr[\"L_SHORTMESSAGE0\"]);\n\t\t\t\t$errorLongMsg = urldecode($httpParsedResponseAr[\"L_LONGMESSAGE0\"]);\n\t\t\t\t$serverCode = urldecode($httpParsedResponseAr[\"L_SEVERITYCODE0\"]);\n\t\t\t\t\n\t\t\t\t// store in session for later use\n\t\t\t\t$this->Session->write('errorCode',$errorCode);\t\t\t\n\t\t\t\t$this->Session->write('errorSmallMsg',$errorSmallMsg);\n\t\t\t\t$this->Session->write('errorLongMsg',$errorLongMsg);\t\n\t\t\t\t$this->Session->write('serverCode',$serverCode);\t\t\t\n\t\t\t\t$this->redirect(array('controller'=>'controller','action' => 'action/'.$methodError));\n\t\t\t}\n\t\t }\n\t}\n\n}",
"abstract protected function validate_params();",
"function buildParams()\n {\n $this->_aParams = array(\n rawurlencode('oauth_consumer_key') => rawurlencode($this->_consumerKey),\n rawurlencode('oauth_token') => rawurlencode($this->_oAuthToken),\n rawurlencode('oauth_nonce') => rawurlencode($this->_oAuthNonce),\n rawurlencode('oauth_signature_method') => rawurlencode($this->_oAuthSignatureMethod),\n rawurlencode('oauth_timestamp') => rawurlencode($this->_oAuthTimeStamp),\n rawurlencode('oauth_version') => rawurlencode($this->_oAuthVersion)\n );\n \n $this->_aParams[rawurlencode('oauth_signature')] = $this->getSignature();\n }",
"protected function buildParameters()\n {\n if(empty($this->_sessionId)){\n throw new Exception('Session ID not set');\n }\n\n if(empty($this->_moduleNames)){\n throw new Exception('Module Names not set');\n }\n\n if(empty($this->_id)){\n throw new Exception('IDs not set')\n }\n\n $parameters = array(\n 'session' => '$this->_sessionId',\n 'module_name' => '$this->_moduleName',\n 'id' => '$this->_id',\n );\n\n if(!empty($this->_selectFields)){\n $parameters['select_fields'] = $this->_selectFields;\n }\n\n if(!empty($this->_linkNameToFields)){\n $parameters['link_name_to_fields_array'] = $this->_linkNameToFields;\n } \n \n return $parameters; \n }",
"abstract protected function getRequiredRequestParameters();",
"private function getValidApiRequest()\n {\n return [\n 'id' => '5cc06b9fadccf621f80217d0',\n 'name' => 'Review',\n 'description' => 'Review description',\n 'disabled' => 'false',\n 'allowallpaths' => 'false',\n 'type' => '3',\n 'attribute0_attributeid' => '5cc06b9fadccf621f80217ce',\n 'attribute0_name' => 'String',\n 'attribute0_description' => 'String description',\n 'attribute0_type' => '1',\n 'attribute0_required' => 'true',\n 'attribute0_disabled' => 'false',\n 'attribute0_defaultvalue' => 'Default string',\n 'attribute0_predefinedvalues_total' => '0',\n 'attribute1_attributeid' => '5cc09402adccf621f8021956',\n 'attribute1_name' => 'Int',\n 'attribute1_description' => '',\n 'attribute1_type' => '2',\n 'attribute1_required' => 'true',\n 'attribute1_disabled' => 'false',\n 'attribute1_defaultvalue' => '1000',\n 'attribute1_predefinedvalues_total' => '0',\n 'attribute2_attributeid' => '5cc09402adccf621f8021957',\n 'attribute2_name' => 'Dec',\n 'attribute2_description' => '',\n 'attribute2_type' => '3',\n 'attribute2_required' => 'false',\n 'attribute2_disabled' => 'false',\n 'attribute2_defaultvalue' => '1.1',\n 'attribute2_predefinedvalues_total' => '0',\n 'attribute3_attributeid' => '5cc09402adccf621f8021958',\n 'attribute3_name' => 'Bool',\n 'attribute3_description' => '',\n 'attribute3_type' => '4',\n 'attribute3_required' => 'false',\n 'attribute3_disabled' => 'false',\n 'attribute3_defaultvalue' => 'true',\n 'attribute3_predefinedvalues_total' => '0',\n 'attribute4_attributeid' => '5cc09402adccf621f8021959',\n 'attribute4_name' => 'Date',\n 'attribute4_description' => '',\n 'attribute4_type' => '5',\n 'attribute4_required' => 'false',\n 'attribute4_disabled' => 'false',\n 'attribute4_defaultvalue' => '2019-04-03 00:00:00',\n 'attribute4_predefinedvalues_total' => '0',\n 'attribute5_attributeid' => '5cc09402adccf621f802195a',\n 'attribute5_name' => 'Select',\n 'attribute5_description' => '',\n 'attribute5_type' => '6',\n 'attribute5_required' => 'false',\n 'attribute5_disabled' => 'false',\n 'attribute5_defaultvalue' => 'A',\n 'attribute5_predefinedvalue0' => 'A',\n 'attribute5_predefinedvalue1' => 'B',\n 'attribute5_predefinedvalue2' => 'C',\n 'attribute5_predefinedvalues_total' => '3',\n 'attribute6_attributeid' => '5cc09402adccf621f802195b',\n 'attribute6_name' => 'Array',\n 'attribute6_description' => '',\n 'attribute6_type' => '7',\n 'attribute6_required' => 'false',\n 'attribute6_disabled' => 'false',\n 'attribute6_defaultvalue' => 'a,b,c,d',\n 'attribute6_predefinedvalues_total' => '0',\n 'attributes_total' => '7',\n 'user0_name' => 'user1',\n 'user0_read' => 'true',\n 'user0_write' => 'true',\n 'users_total' => '1',\n 'group0_id' => '55557777bbbbccccddddaaaa',\n 'group0_name' => 'EVERYONE',\n 'group0_read' => 'true',\n 'group0_write' => 'true',\n 'groups_total' => '1',\n 'path0' => '/user1',\n 'paths_total' => '1',\n ];\n }",
"function cleanUserInputtedDetails($app, $tainted_parameters)\r\n{\r\n $cleaned_parameters = [];\r\n $validator = $app->getContainer()->get('validator');\r\n\r\n $tainted_username = $tainted_parameters['username'];\r\n //$tainted_email = $tainted_parameters['email'];\r\n\r\n $cleaned_parameters['password'] = $tainted_parameters['password'];\r\n $cleaned_parameters['sanitised_username'] = $validator->sanitiseString($tainted_username);\r\n //$cleaned_parameters['sanitised_email'] = $validator->sanitiseString($tainted_email);\r\n //$cleaned_parameters['sanitised_requirements'] = $validator->sanitiseString($tainted_requirements);\r\n return $cleaned_parameters;\r\n}",
"public function getValidCard()\n {\n return array(\n 'firstName' => 'Example',\n 'lastName' => 'User',\n 'number' => '4111111111111111',\n 'expiryMonth' => rand(1, 12),\n 'expiryYear' => gmdate('Y') + rand(1, 5),\n 'cvv' => rand(100, 999),\n 'billingAddress1' => '123 Billing St',\n 'billingAddress2' => 'Billsville',\n 'billingCity' => 'Billstown',\n 'billingPostcode' => '12345',\n 'billingState' => 'CA',\n 'billingCountry' => 'US',\n 'billingPhone' => '(555) 123-4567',\n 'shippingAddress1' => '123 Shipping St',\n 'shippingAddress2' => 'Shipsville',\n 'shippingCity' => 'Shipstown',\n 'shippingPostcode' => '54321',\n 'shippingState' => 'NY',\n 'shippingCountry' => 'US',\n 'shippingPhone' => '(555) 987-6543',\n );\n }"
] | [
"0.59305614",
"0.5250553",
"0.5245396",
"0.52448666",
"0.52381706",
"0.5170908",
"0.49939978",
"0.4978654",
"0.49766392",
"0.49674365",
"0.4938419",
"0.48977378",
"0.4880765",
"0.48786741",
"0.4871452",
"0.48671123",
"0.48549664",
"0.4841075",
"0.4813213",
"0.47963148",
"0.4764851",
"0.47211507",
"0.4703887",
"0.4670229",
"0.46667197",
"0.46629527",
"0.46447277",
"0.46343735",
"0.46131822",
"0.46041217"
] | 0.7123827 | 0 |
Build Apple Pay Session Validation parameters | private function getAppleValidationHeaderOptions(): array
{
$optionsType = new ApplePayHeaderOptions();
$options = $optionsType->generateParameters(
new PaymentDTO([], $optionsType),
false
);
if (APSMerchant::isDebugMode()) {
Logger::getInstance()->debug(
'Apple Pay session connector options: ' . json_encode($options)
);
}
return $options;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getAppleValidationParameters(): array\n {\n $validationPaymentType = new ApplePayInitialization();\n $parameters = $validationPaymentType->generateParameters(\n new PaymentDTO([], $validationPaymentType),\n false\n );\n\n if (APSMerchant::isDebugMode()) {\n Logger::getInstance()->debug(\n 'Apple Pay session Data sent: ' . json_encode($parameters)\n );\n }\n\n return $parameters;\n }",
"public function getParams() {\n if (!$this->validate()) throw new Service24PayRequestException(\"Invalid request parameters: \" . implode(\", \", $this->errors));\n\n $requestParams = array_filter($this->requestParams);\n\n $requestParams[\"Mid\"] = $this->service24Pay->getMid();\n $requestParams[\"EshopId\"] = $this->service24Pay->getEshopId();\n $requestParams[\"Timestamp\"] = date(\"Y-m-d H:i:s\");\n\n $requestParams[\"Debug\"] = empty($requestParams[\"Debug\"]) ? 'false' : 'true';\n $requestParams[\"PreAuthProvided\"] = empty($requestParams[\"PreAuthProvided\"]) ? 'false' : 'true'; \n $requestParams[\"RedirectSign\"] = empty($requestParams[\"RedirectSign\"]) ? 'false' : 'true';\n\n $requestParams[\"Sign\"] = $this->service24Pay->computeSIGN($requestParams[\"Mid\"] . $requestParams[\"Amount\"] . $requestParams[\"CurrAlphaCode\"] . $requestParams[\"MsTxnId\"] . $requestParams[\"FirstName\"] . $requestParams[\"FamilyName\"] . $requestParams[\"Timestamp\"]);\n\n return $requestParams;\n }",
"protected function buildParameters()\n {\n if(empty($this->_sessionId)){\n throw new Exception('Session ID not set');\n }\n\n $parameters = array(\n 'session' => $this->_sessionId,\n );\n\n return $parameters;\n }",
"public static function buildBasicParametersToken(){\n\t\n\t\t$parameters = array(PayUParameters::PAYER_NAME => 'PayerName-' . rand(10000,9999999) . ' PayerSurname-' .rand(10000,9999999),\n\t\t\t\t\t\t\tPayUParameters::PAYER_ID => 'payerId_123'\t\t\t\t\n\t\t);\n\t\n\t\treturn $parameters;\n\t}",
"public static function buildBasicParameters(){\n\t\t\n\t\t$parameters = array(PayUParameters::REFERENCE_CODE => 'referenceCode-' . rand(10000,999999999),\n\t\t\t\tPayUParameters::PAYER_NAME=> 'PayerName-' . rand(10000,9999999) . ' PayerSurname-' .rand(10000,9999999),\n\t\t\t\tPayUParameters::COUNTRY => PayUCountries::PA,\n\t\t\t\tPayUParameters::ACCOUNT_ID => \"8\",\n\t\t\t\tPayUParameters::CURRENCY => \"USD\",\n\t\t\t\tPayUParameters::DESCRIPTION => 'description-' . rand(10000,9999999),\n\t\t\t\tPayUParameters::VALUE => rand(1000,1500) . '.'.rand(10,99),\n\t\t\t\tPayUParameters::INSTALLMENTS_NUMBER => '1',\n\t\t\t\t);\n\t\t\n\t\t\n\t\treturn $parameters;\n\t}",
"protected function get_reqired_params() {\n return array(\n /*array('name' => 'account_id',\n 'display' => 'Account id',\n 'required' => true),*/\n array('name' => 'buyer_creative_id',\n 'display' => 'Buyer creative id',\n 'required' => true),\n array('name' => 'advertiser_name',\n 'display' => 'Advertiser name',\n 'required' => true),\n array('name' => 'html_snippet',\n 'display' => 'HTML Snippet',\n 'required' => true),\n array('name' => 'click_through_urls',\n 'display' => 'Click through URLs',\n 'required' => true),\n array('name' => 'width',\n 'display' => 'Width',\n 'required' => true),\n array('name' => 'height',\n 'display' => 'Height',\n 'required' => true)\n );\n }",
"public function createMerchantParameters()\n {\n $json = $this->arrayToJson();\n // Se codifican los datos Base64\n return $this->encodeBase64($json);\n }",
"protected function _getRequireSessionWithParams()\n {\n $this->_aRequireSessionWithParams['cl']['mollieFinishPayment'] = true;\n\n return parent::_getRequireSessionWithParams();\n }",
"function _validateParams(array $request, array $needed) {\n global $KeyPublic, $KeyEncoding, $KeyRevoked;\n\n // add login credentials to be checked always:\n // sid (service provider id)\n // spwd (service provider password)\n array_push($needed, \"sid\", \"spwd\");\n\n // Check if all needed values are existing in the request\n foreach($needed as $param) {\n if (!array_key_exists($param, $request)) {\n _generateError($request, EC_MISSING_PARAMETERS, \n \"Missing mandatory value $param\");\n return false;\n }\n }\n\n // validate encrypted data if needed\n // must be receipt:cs:iv:payload, where iv must be hex encoded and cs\n // must be 2 characters\n // maximum length of all is 15MB\n if (in_array(\"data\", $needed)) {\n if (strlen($request[\"data\"]) > MAX_DATA_SIZE * 1024) {\n _generateError($request, EC_INVALID_SIZE, \n \"Size of data > \".MAX_DATA_SIZE.\"KB\");\n return false;\n }\n $data = explode(\":\", $request[\"data\"]);\n if (count($data) != 4) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid data encoding (expecting 4 parts receipt:cs:iv:payload)\");\n return false;\n }\n if (strlen($data[0]) < 4) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid recipt (expecting 4 characters minimum)\");\n return false;\n }\n if (strlen($data[1]) != 2) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid checksum (expecting 2 characters)\");\n return false;\n }\n if (!validateHEX($data[2])) { // hint: empty string is also not hex!\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid data encoding (expecting hex iv)\");\n return false;\n }\n if (strlen($data[3]) < 4) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid data encoding (expecting some payload > 4 characters)\");\n return false;\n }\n }\n\n // validate pkey value if needed \n // (only for future ECC implementation)\n /*\n if (in_array(\"pkey\", $needed)) {\n $pkey = $request[\"pkey\"];\n if (!array_key_exists($pkey, $KeyPublic)) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid pkey value\");\n return false;\n }\n if ($KeyRevoked[$pkey] == TRUE) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Revoked pkey\");\n return false;\n }\n }\n */\n\n // validate pid value(s) if needed\n if (in_array(\"pid\", $needed)) {\n $pids = explode(\" \", $request[\"pid\"]);\n foreach ($pids as $pid) {\n if (!validateHEX($pid)) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid pid value (expecting pid to be hex)\");\n return false;\n }\n }\n }\n\n // validate login\n $sql = \"SELECT password FROM provider WHERE providerid=?\";\n $res = GetOneSQLValue($sql, array($request[\"sid\"]));\n if ($res == 0) {\n _generateError($request, EC_INVALID_CREDENTIALS, \n \"Invalid sid (service provider id)\");\n return false;\n }\n $pwd = $res[\"password\"];\n if ($pwd != $request[\"spwd\"]) {\n _generateError($request, EC_INVALID_CREDENTIALS, \n \"Invalid spwd (service provider password)\");\n return false;\n }\n\n return true;\n}",
"public function validate()\n {\n if (strlen($this['PaymentAccountID']) && !preg_match('/^.{1,50}$/', $this['PaymentAccountID'])) {\n throw new InvalidRequestException('PaymentAccountID should have 50 or fewer characters');\n }\n\n if (isset($this['PaymentAccountType'])) {\n try {\n PaymentAccountType::memberByValue($this['PaymentAccountType']);\n } catch (\\Exception $e) {\n throw new InvalidRequestException('Invalid value for PaymentAccountType');\n }\n }\n\n if (strlen($this['PaymentAccountReferenceNumber'])) {\n if (!preg_match('/^.{1,50}$/', $this['PaymentAccountReferenceNumber'])) {\n throw new InvalidRequestException('PaymentAccountReferenceNumber should have 50 or fewer characters');\n }\n }\n\n if (strlen($this['PaymentBrand']) && !preg_match('/^.{1,50}$/', $this['PaymentBrand'])) {\n throw new InvalidRequestException('PaymentBrand should have 50 or fewer characters');\n }\n\n if (strlen($this['ExpirationMonthBegin'])) {\n if (!preg_match('/^\\d{2}$/', $this['ExpirationMonthBegin']) || $this['ExpirationMonthBegin'] > 12) {\n throw new InvalidRequestException('ExpirationMonthBegin should be a two-digit month');\n }\n }\n\n if (strlen($this['ExpirationMonthEnd'])) {\n if (!preg_match('/^\\d{2}$/', $this['ExpirationMonthEnd']) || $this['ExpirationMonthEnd'] > 12) {\n throw new InvalidRequestException('ExpirationMonthEnd should be a two-digit month');\n }\n }\n\n if (strlen($this['ExpirationYearBegin']) && !preg_match('/^\\d{2}$/', $this['ExpirationYearBegin'])) {\n throw new InvalidRequestException('ExpirationYearBegin should be a two-digit year');\n }\n\n if (strlen($this['ExpirationYearEnd']) && !preg_match('/^\\d{2}$/', $this['ExpirationYearEnd'])) {\n throw new InvalidRequestException('ExpirationYearEnd should be a two-digit year');\n }\n\n if (strlen($this['ExpirationYearBegin']) && strlen($this['ExpirationYearEnd'])) {\n if ($this['ExpirationYearEnd'] < $this['ExpirationYearBegin']) {\n throw new InvalidRequestException('ExpirationYearBegin must be before ExpirationYearEnd');\n }\n if (strlen($this['ExpirationMonthBegin']) && strlen($this['ExpirationMonthEnd'])) {\n if ($this['ExpirationYearBegin'] == $this['ExpirationYearEnd']) {\n if ($this['ExpirationMonthEnd'] < $this['ExpirationMonthBegin']) {\n throw new InvalidRequestException('ExpirationMonthBegin must be before ExpirationMonthEnd');\n }\n }\n }\n }\n }",
"function construct_value_array() {\n $this->credit_card_details = array(\n 'card_number' => $_POST['card_number'],\n 'expiry_date' => array('year' => $_POST['expiry']['year'], 'month' => $_POST['expiry']['month']),\n 'card_code' => $_POST['card_code']\n );\n\n /*\n (TransRequestID,(((CreditCardNumber|CreditCardToken),ExpirationMonth,ExpirationYear,(IsCardPresent|IsECommerce|IsRecurring)?)|(Track1Data|Track2Data)),Amount,NameOnCard?,CreditCardAddress?,CreditCardCity?,CreditCardState?,CreditCardPostalCode?,CommercialCardCode?,SalesTaxAmount?,CardSecurityCode?,Lodging?,Restaurant?,BatchID?,ClientTransID?,InvoiceID?,UserID?,Comment?)\n */\n $gateway_doc = <<<EOXML\n<?xml version=\"1.0\"?>\n<?qbmsxml version=\"4.4\"?>\n<QBMSXML>\n<SignonMsgsRq>\n <SignonDesktopRq>\nEOXML;\n $gateway_doc .= \"<ClientDateTime>\" . date('Y-m-d\\TH:i:s') . \"</ClientDateTime>\";\n $gateway_doc .= \"<ApplicationLogin>\" . QBMS_APP_NAME . \"</ApplicationLogin>\";\n $gateway_doc .= \"<ConnectionTicket>\" . qbms_get_ticket() . \"</ConnectionTicket>\";\n $gateway_doc .= <<<EOXML\n </SignonDesktopRq>\n</SignonMsgsRq>\n<QBMSXMLMsgsRq>\n <CustomerCreditCardChargeRq>\nEOXML;\n $gateway_doc .= \"<TransRequestID>\" . $this->cart_data['session_id'] . \"</TransRequestID>\";\n $gateway_doc .= \"<CreditCardNumber>\" . $this->credit_card_details['card_number'] . \"</CreditCardNumber>\";\n $gateway_doc .= \"<ExpirationMonth>\" . $this->credit_card_details['expiry_date']['month'] . \"</ExpirationMonth>\";\n $gateway_doc .= \"<ExpirationYear>\" . $this->credit_card_details['expiry_date']['year'] . \"</ExpirationYear>\";\n $gateway_doc .= \"<IsCardPresent>false</IsCardPresent>\";\n $gateway_doc .= \"<Amount>\" . number_format($this->cart_data['total_price'],2,'.','') . \"</Amount>\";\n $gateway_doc .= \"<NameOnCard>\" . $this->cart_data['billing_address']['first_name'] . \" \" . $this->cart_data['billing_address']['last_name'] . \"</NameOnCard>\";\n $gateway_doc .= \"<CreditCardAddress>\" . $this->cart_data['billing_address']['address'] . \"</CreditCardAddress>\";\n $gateway_doc .= \"<CreditCardCity>\" . $this->cart_data['billing_address']['city'] . \"</CreditCardCity>\";\n //$gateway_doc .= \"<CreditCardState>\" . $this->cart_data['billing_address'][''] . \"</CreditCardState>\";\n $gateway_doc .= \"<CreditCardPostalCode>\" . $this->cart_data['billing_address']['post_code'] . \"</CreditCardPostalCode>\";\n $gateway_doc .= \"<CardSecurityCode>\" . $this->credit_card_details['card_code'] . \"</CardSecurityCode>\";\n $gateway_doc .= \"<InvoiceID>\" . $this->cart_data['session_id'] . \"</InvoiceID>\";\n $gateway_doc .= \"<Comment>\" . get_option('qbms_form_description') . \"</Comment>\";\n $gateway_doc .= <<<EOXML\n </CustomerCreditCardChargeRq>\n </QBMSXMLMsgsRq>\n</QBMSXML>\nEOXML;\n\n $this->collected_gateway_data = $gateway_doc;\n }",
"private function getEnrollParameters()\n {\n // array we need to convert to XML\n $parameters = [\n \"RequestSource\" => \"PartnerCode\",\n \"Product\" => [\n \"PackageId\" => env('IDCS_PACKAGE'),\n \"ProductUser\" => [\n \"Memberid\" => $this->user->uuid,\n \"EmailAddress\" => $this->user->email,\n \"Password\" => str_random(12),\n \"Address\" => [\n \"Address1\" => $this->user->address,\n \"Address2\" => \"\",\n \"City\" => $this->user->city,\n \"State\" => $this->user->state,\n \"ZipCode\" => $this->user->zip,\n ],\n \"Phone\" => [\n \"PhoneNumber\" => $this->user->phone,\n \"PhoneType\" => \"Home\"\n ],\n \"Person\" => [\n \"FirstName\" => $this->user->first_name,\n \"LastName\" => $this->user->last_name,\n \"MiddleName\" => \"\"\n ]\n ]\n ],\n \"Partner\" => [\n \"partnerAccount\" => env('IDCS_USERNAME'),\n \"partnerCode\" => env('IDCS_USERNAME'),\n \"partnerPassword\" => env('IDCS_PASSWORD'),\n \"Branding\" => env('IDCS_USERNAME')\n ]\n ];\n\n\n $xml = new \\SimpleXMLElement(\"<Request></Request>\");\n\n $this->array_to_xml($parameters, $xml);\n $raw_xml = $xml->asXML();\n $raw_xml = trim(str_replace('<?xml version=\"1.0\"?>', '', $raw_xml));\n\n $parameters = [\n 'xmlRequest' => [\n 'any' => new \\SoapVar($raw_xml, XSD_ANYXML)\n ]\n ];\n\n return $parameters;\n }",
"function getRequestParameters()\n {\n $params = $this->getRawParameters();\n\n $fingerprintOrder = array_merge(\n ['customerId', 'shopId', 'password', 'secret', 'language'],\n $this->fingerprintOrder\n );\n\n $requiredParameters = array_merge(\n ['customerId', 'requestFingerprint', 'password', 'language'],\n $this->requiredParameters\n );\n\n switch ($this->getParam('fundTransferType')) {\n case FundTransferType::EXISTINGORDER:\n $fingerprintOrder[] = 'sourceOrderNumber';\n $requiredParameters[] = 'sourceOrderNumber';\n break;\n case FundTransferType::MONETA:\n $fingerprintOrder[] = 'consumerWalletId';\n $requiredParameters[] = 'consumerWalletId';\n break;\n case FundTransferType::SEPA_CT:\n $fingerprintOrder[] = 'bankAccountOwner';\n $fingerprintOrder[] = 'bankBic';\n $fingerprintOrder[] = 'bankAccountIban';\n $requiredParameters[] = 'bankAccountOwner';\n $requiredParameters[] = 'bankBic';\n $requiredParameters[] = 'bankAccountIban';\n break;\n case FundTransferType::SKRILLWALLET:\n $fingerprintOrder[] = 'consumerEmail';\n $requiredParameters[] = 'consumerEmail';\n $requiredParameters[] = 'customerStatement';\n break;\n }\n\n $params['requestFingerprint'] = Fingerprint::fromParameters($params)\n ->setContext($this->getContext())\n ->setFingerprintOrder($fingerprintOrder);\n $this->assertParametersAreValid($params, $requiredParameters);\n\n return $params;\n }",
"public function buildAdditionalParams()\n\t{\n\t\tglobal $context;\n\n\t\t$arr = $this->getExtraUrlParameters();\n\n\t\t// Only include the session ID in the URL if it's strictly necessary.\n\t\tif (!$this->isUrlSessionCheckDisabled())\n\t\t{\n\t\t\t$arr[$context['session_var']] = $context['session_id'];\n\t\t}\n\n\t\t$extraUrlParameters = '';\n\t\tforeach ($arr as $key => $value)\n\t\t{\n\t\t\t$extraUrlParameters .= sprintf(';%s=%s', $key, $value);\n\t\t}\n\n\t\treturn $extraUrlParameters;\n\t}",
"abstract protected function _paramsASN1();",
"public function getPaymentCreateRequest() {\n $data = null;\n if ($this->amount && $this->currency) {\n // capture pre-authorized payment\n if ($this->parentTransactionId) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"authorization\" => $this->parentTransactionId,\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n }\n // authorize/capture payment using Simplify customer identifier\n else if ($this->cardId) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"customer\" => $this->cardId,\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n }\n // authorize/capture payment using card token\n else if ($this->cardToken) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"token\" => $this->cardToken,\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n }\n // authorize/capture payment using raw card data\n else if ($this->cardNumber) {\n $data = array(\n \"amount\" => $this->amount,\n \"description\" => $this->description,\n \"card\" => array(\n \"expYear\" => $this->expirationYear,\n \"expMonth\" => $this->expirationMonth, \n \"cvc\" => $this->cvc,\n \"number\" => $this->cardNumber\n ),\n \"reference\" => $this->reference,\n \"currency\" => $this->currency\n );\n if ($this->billing) {\n $data[\"card\"][\"name\"] = $this->billing->getName();\n $data[\"card\"][\"addressCity\"] = $this->billing->getCity();\n $data[\"card\"][\"addressLine1\"] = $this->billing->getStreetLine(1);\n $data[\"card\"][\"addressLine2\"] = $this->billing->getStreetLine(2);\n $data[\"card\"][\"addressZip\"] = $this->billing->getPostcode();\n $data[\"card\"][\"addressState\"] = $this->billing->getRegion();\n $data[\"card\"][\"addressCountry\"] = $this->billing->getCountryId();\n }\n } \n }\n return $data;\n }",
"function createCheckoutRequest()\n\t{\n\t\t$this->cart_xml \t\t\t\t\t= \t$this->cart->GetXML();\n\t\t$this->fields_xml \t\t\t\t\t= \t$this->fields->GetXML();\n\n\t\t$ganalytics \t\t\t\t\t\t= \t\"\";\n\t\tif (!empty($this->ganalytics['account']))\n\t\t{\n\t\t\t$ganalytics \t\t\t\t\t.= \t'<google-analytics>';\n\t\t\t$ganalytics \t\t\t\t\t.= \t' <account>' . $this->xmlEscape($this->ganalytics['account']) . '</account>';\n\t\t\t$ganalytics \t\t\t\t\t.= \t'</google-analytics>';\n\t\t}\n\t\t\n\t\tif($this->use_shipping_notification)\n\t\t{\n\t\t\t$use_shipping_xml \t\t\t\t= \"<checkout-settings>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<use-shipping-notification>true</use-shipping-notification>\n\t\t\t\t\t\t\t\t\t\t\t </checkout-settings>\"; \t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$use_shipping_xml \t\t\t\t= \t\"\";\n\t\t}\n\t\t\t\t\n\t\t$request \t\t\t\t\t\t\t= \t'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t\t\t\t\t\t<checkouttransaction ua=\"' . $this->plugin_name . ' ' . $this->version \t\t\t\t. '\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<account>' . $this->xmlEscape($this->merchant['account_id']) \t\t. '</account>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<site_id>' . $this->xmlEscape($this->merchant['site_id']) \t\t\t. '</site_id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<site_secure_code>' . $this->xmlEscape($this->merchant['site_code']) \t\t. '</site_secure_code>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<notification_url>' . $this->xmlEscape($this->merchant['notification_url']) . '</notification_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<cancel_url>' . $this->xmlEscape($this->merchant['cancel_url']) \t\t. '</cancel_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<redirect_url>' . $this->xmlEscape($this->merchant['redirect_url']) \t. '</redirect_url>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<close_window>' . $this->xmlEscape($this->merchant['close_window']) \t. '</close_window>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t\t <shop>' . \t $this->xmlEscape($this->plugin['shop']) \t\t\t\t\t. '</shop>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_version>' . $this->xmlEscape($this->plugin['shop_version']) \t\t\t. '</shop_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<plugin_version>' . $this->xmlEscape($this->plugin['plugin_version']) \t\t. '</plugin_version>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<partner>' . $this->xmlEscape($this->plugin['partner']) \t\t\t\t. '</partner>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<shop_root_url>' . $this->xmlEscape($this->plugin['shop_root_url']) \t\t\t. '</shop_root_url>\n\t\t\t\t\t\t\t\t\t\t\t\t </plugin>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<locale>' . $this->xmlEscape($this->customer['locale']) \t\t\t. '</locale>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ipaddress>' . $this->xmlEscape($this->customer['ipaddress']) \t\t. '</ipaddress>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<forwardedip>' . $this->xmlEscape($this->customer['forwardedip']) \t\t. '</forwardedip>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->customer['firstname']) \t\t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->customer['lastname']) \t\t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->customer['address1']) \t\t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->customer['address2']) \t\t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->customer['housenumber']) \t\t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->customer['zipcode']) \t\t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->customer['city']) \t\t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->customer['state']) \t\t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->customer['country']) \t\t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->customer['phone']) \t\t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->customer['email']) \t\t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<referer>' . \t\t $this->xmlEscape($this->customer['referer'])\t\t\t. '</referer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<firstname>' . $this->xmlEscape($this->delivery['firstname']) \t\t. '</firstname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<lastname>' . $this->xmlEscape($this->delivery['lastname']) \t\t. '</lastname>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address1>' . $this->xmlEscape($this->delivery['address1']) \t\t. '</address1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<address2>' . $this->xmlEscape($this->delivery['address2']) \t\t. '</address2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<housenumber>' . $this->xmlEscape($this->delivery['housenumber']) \t\t. '</housenumber>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<zipcode>' . $this->xmlEscape($this->delivery['zipcode']) \t\t\t. '</zipcode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<city>' . $this->xmlEscape($this->delivery['city']) \t\t\t. '</city>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<state>' . $this->xmlEscape($this->delivery['state'])\t \t\t. '</state>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->delivery['country']) \t\t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<phone>' . $this->xmlEscape($this->delivery['phone']) \t\t\t. '</phone>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<email>' . $this->xmlEscape($this->delivery['email']) \t\t\t. '</email>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</customer-delivery>\n\t\t\t\t\t\t\t\t\t\t\t\t\t' . $this->cart_xml . '\n\t\t\t\t\t\t\t\t\t\t\t\t\t' . $this->fields_xml . '\n\t\t\t\t\t\t\t\t\t\t\t\t\t' . $ganalytics . '\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t' . $use_shipping_xml . ' \n\t\t\t\t\t\t\t\t\t\t\t\t\t<checkout-settings>\n\t\t\t\t\t\t\t\t\t\t\t\t\t <no-shipping-method>true</no-shipping-method>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</checkout-settings>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<id>' . $this->xmlEscape($this->transaction['id']) \t\t\t. '</id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<currency>' . $this->xmlEscape($this->transaction['currency']) \t\t. '</currency>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<amount>' . $this->xmlEscape($this->transaction['amount']) \t\t. '</amount>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<description>' . $this->xmlEscape($this->transaction['description']) \t. '</description>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<var1>' . $this->xmlEscape($this->transaction['var1']) \t\t\t. '</var1>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<var2>' . $this->xmlEscape($this->transaction['var2']) \t\t\t. '</var2>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<var3>' . $this->xmlEscape($this->transaction['var3']) \t\t\t. '</var3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<items>' . $this->xmlEscape($this->transaction['items']) \t\t. '</items>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<manual>' . $this->xmlEscape($this->transaction['manual']) \t\t. '</manual>\n\t\t\t\t\t\t\t\t\t\t\t\t<gateway>'. $this->xmlEscape($this->transaction['gateway']) \t\t\t\t. '</gateway>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</transaction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<signature>' . $this->xmlEscape($this->signature) \t\t\t\t\t\t. '</signature>\n\t\t\t\t\t\t\t\t\t\t\t\t</checkouttransaction>';\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\treturn $request;\n\t}",
"public function validateReceiptCheck($input_params=array()){\n $sample_json = file_get_contents($_FILES['receipt_data']['tmp_name']);\n\n\n \n //$applesharedsecret = '76238eb83ebb44bebfebe4c66999050a';\n //$appleurl ='https://sandbox.itunes.apple.com/verifyReceipt';\n $applesharedsecret = $this->config->item(\"SUBSCRIPTION_PASSWORD\");\n $appleurl = $this->config->item(\"SUBSCRIPTION_ITUNES_URL\");\n //https://buy.itunes.apple.com/verifyReceipt //for production\n\n \n $request = json_encode(array(\"receipt-data\" => $sample_json,\"password\"=>$applesharedsecret));\n // setting up the curl\n\n $ch = curl_init($appleurl);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $request);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));\n $jsonresult = curl_exec($ch);\n\n \n\n $err = curl_error($ch);\n curl_close($ch);\n if($err){\n $return_arr[0]['transaction_id'] = '';\n $return_arr[0]['expiry_date'] = '';\n $return_arr[0]['success'] = 0;\n $return_arr[0]['message'] = $err;\n $return_arr[0]['receipt_data_v1'] =\"\";\n }else{\n $decoded_json = json_decode($jsonresult);\n\n $return_arr =array();\n if(!empty($decoded_json->latest_receipt_info)) {\n \n $expires_date = \"\";\n $transaction_id = \"\";\n $product_id = \"\";\n \n \n foreach ($decoded_json->latest_receipt_info as $value) {\n $gmt_date = $value->expires_date;\n $date1 = explode(' ',$gmt_date);\n $expiry_date_curr = $date1[0].\" \".$date1[1];\n \n if($expires_date == \"\")\n {\n $expires_date = $expiry_date_curr;\n $transaction_id = $value->transaction_id;\n $product_id = $value->product_id;\n }\n if(strtotime($expiry_date_curr) > strtotime($expires_date))\n {\n $expires_date = $expiry_date_curr;\n $transaction_id = $value->transaction_id;\n $product_id = $value->product_id;\n }\n\n }\n \n \n if(strtotime($expires_date) < strtotime(date(\"Y-m-d H:i:s\")))\n {\n $return_arr[0]['success'] = 0;\n $return_arr[0]['message'] = 'Your subscription is expired. Please subscribe again to use app features.'; \n }else\n {\n $return_arr[0]['success'] = 1;\n $return_arr[0]['message'] = 'Subscription purchased successfully.'; \n }\n \n \n $return_arr[0]['transaction_id'] = $transaction_id;\n $return_arr[0]['product_id'] = $product_id;\n $return_arr[0]['expiry_date'] = $expires_date;\n $return_arr[0]['receipt_data_v1'] =$sample_json;\n }else{\n \n $return_arr[0]['transaction_id'] = $transaction_id;\n $return_arr[0]['expiry_date'] = $expiry_date;\n $return_arr[0]['success'] = 0;\n $return_arr[0]['message'] = 'Something went wrong, Please try again!';\n $return_arr[0]['receipt_data_v1'] =\"\";\n }\n }\n return $return_arr;\n \n}",
"public static function requestBuild(){\n $tranDateTime = DateTime::getDateTime();\n $uuid = Uuid::generate()->string;\n $applicationId = \"Sadad\";\n $request = array();\n $request += [\"applicationId\" => $applicationId];\n $request += [\"UUID\" => $uuid];\n $request += [\"tranDateTime\" => $tranDateTime];\n\n return $request;\n }",
"function getEncryptedParams(){\n if(isset($_REQUEST['code'])){\n \n $hash_str = urldecode($_REQUEST['code']);\n \n $str = CCrypter::decrypt($hash_str, Config::CRYPT_KEY, Config::CRYPT_IV);\n \n if(preg_match('/(?=LG\\=.*)(?=.*QID\\=.*)(?=.*MID\\=.*)(?=.*CID\\=.*)(?=.*GID\\=.*)(?=.*PS\\=.*)/', $str)) {\n \n $splited = explode('&',$str);\n $length = count($splited);\n $params=null;\n for($i=0;$i<$length;++$i){\n $line = $splited[$i];\n $split = explode('=',$line);\n $name = preg_replace('/[\\x00-\\x1F\\x80-\\xFF]/', '', $split[0]);\n $value = preg_replace('/[\\x00-\\x1F\\x80-\\xFF]/', '', $split[1]);\n \n if($name == 'PS') { $value = substr($value,0,strlen(Config::PREVIEW_PASSWORD)); }\n \n $params[$name]=$value;\n }\n \n return $params;\n }\n }\n return null;\n}",
"protected function buildRequestParams()\n {\n $Request = [];\n $Request['client_id'] = $this->APIClientId;\n $Request['api_key'] = $this->APIKey;\n $Request['order_id'] = $this->OrderId;\n if (!empty($this->Reason)) {\n $Request['reason'] = $this->Reason;\n }\n $Request['notify'] = $this->Notify;\n $Request['item_id'] = $this->ItemId;\n $this->RequestParams = $Request;\n return $Request;\n }",
"public function getStandardCheckoutFormFields()\n {\n $session = Mage::getSingleton('checkout/session');\n \n $order = $this->getOrder();\n if (!($order instanceof Mage_Sales_Model_Order)) {\n Mage::throwException($this->_getHelper()->__('Cannot retrieve order object'));\n }\n\t\t$billing = $order->getBillingAddress();\n\t\t$shipping = $order->getShippingAddress();\n\t\t$productDetails = $this->getProductItems($order->getAllItems());\n\t\t\n\t\n\t\t$parameter = array();\n\t\t\n\t\t//支付币种\n\t\t$parameter['order_currency']\t= $order->getOrderCurrencyCode();\n\t\t//金额\n\t\t$parameter['order_amount']\t\t= $this->formatAmount($order->getGrandTotal(), $parameter['order_currency']);//sprintf('%.2f', $order->getGrandTotal());\n\n\t\t//判断是否启用3D功能\n\t\tif($this->getConfigData('secure_mode') == 1){\n\t\t\t//检验是否需要3D验证\n\t\t\t$validate_arr = $this->validate3D($parameter['order_currency'], $parameter['order_amount'], $billing, $shipping);\n\t\t}else{\n\t\t\t$validate_arr['terminal'] = $this->getConfigData('terminal');\n\t\t\t$validate_arr['securecode'] = $this->getConfigData('securecode');\n\t\t}\n\n //账户\n\t\t$parameter['account']\t\t\t= $this->getConfigData('account');\n\t\t//终端号\n\t\t$parameter['terminal']\t\t\t= $validate_arr['terminal'];\n\t\t//securecode\n\t\t$parameter['securecode']\t\t= $validate_arr['securecode'];\n\t\t//支付方式\n\t\t$parameter['methods']\t\t\t= 'Credit Card';\n\t\t//订单号\n\t\t$parameter['order_number']\t\t= $order->getRealOrderId();\t\n\t\t//返回地址\n\t\t$parameter['backUrl']\t\t\t= $this->getReturnURL();\n\t\t//服务器响应地址\n\t\t$parameter['noticeUrl']\t\t\t= $this->getNoticeURL();\n\t\t//备注\n\t\t$parameter['order_notes']\t\t= $order->getRealOrderId();\n\t\t//账单人名\n\t\t$parameter['billing_firstName']\t= $this->OceanHtmlSpecialChars($billing->getFirstname());\n\t\t//账单人姓\n\t\t$parameter['billing_lastName']\t= $this->OceanHtmlSpecialChars($billing->getLastname());\n\t\t//账单人email\n\t\t$parameter['billing_email']\t\t= $this->OceanHtmlSpecialChars($order->getCustomerEmail());\n\t\t//账单人电话\n\t\t$parameter['billing_phone']\t\t= $billing->getTelephone();\n\t\t//账单人国家\n\t\t$parameter['billing_country']\t= $billing->getCountry();\n\t\t//账单人州(可不提交)\n\t\t$parameter['billing_state']\t\t= $billing->getRegionCode();\n\t\t//账单人城市\n\t\t$parameter['billing_city']\t\t= $billing->getCity();\n\t\t//账单人地址\n\t\t$parameter['billing_address']\t= $billing->getStreet(1);\n\t\t//账单人邮编\n\t\t$parameter['billing_zip']\t\t= $billing->getPostcode();\t\t\n\t\t//收货人地址信息\n\t\t//收货人名\n\t\t$parameter['ship_firstName']\t= $shipping->getFirstname();\n\t\t//收货人姓\n\t\t$parameter['ship_lastName']\t\t= $shipping->getLastname();\n\t\t//收货人手机\n\t\t$parameter['ship_phone']\t\t= $shipping->getTelephone();\n\t\t//收货人国家\n\t\t$parameter['ship_country']\t\t= $shipping->getCountry();\n\t\t//收货人州\n\t\t$parameter['ship_state']\t\t= $shipping->getRegionCode();\n\t\t//收货人城市\n\t\t$parameter['ship_city']\t\t\t= $shipping->getCity();\n\t\t//收货人地址\n\t\t$parameter['ship_addr']\t\t\t= $shipping->getStreet(1);\n\t\t//收货人邮编\n\t\t$parameter['ship_zip']\t\t\t= $shipping->getPostcode();\n\t\t//产品名称\n\t\t$parameter['productName']\t\t= $productDetails['productName'];\n\t\t//产品SKU\n\t\t$parameter['productSku']\t\t= $productDetails['productSku'];\n\t\t//产品数量\n\t\t$parameter['productNum']\t\t= $productDetails['productNum'];\n\t\t//产品单价\n\t\t$parameter['productPrice']\t\t= $productDetails['productPrice'];\n\t\t//网店程序类型\n\t\t$isMobile\t\t\t\t\t\t= $this->isMobile() ? 'Mobile' : 'PC';\n\t\t$parameter['cart_info']\t\t\t= 'Magento 1.x|V1.9.0|'.$isMobile;\n\t\t//接口版本\n\t\t$parameter['cart_api']\t\t\t= '';\n\t\t//校验源字符串\n\t\t$signsrc\t\t\t\t\t\t= $parameter['account'].$parameter['terminal'].$parameter['backUrl'].$parameter['order_number'].$parameter['order_currency'].$parameter['order_amount'].$parameter['billing_firstName'].$parameter['billing_lastName'].$parameter['billing_email'].$parameter['securecode'];\n\t\t//sha256加密结果\n\t\t$parameter['signValue']\t\t\t= hash(\"sha256\", $signsrc);\n\t\t//支付页面类型\n\t\t$parameter['pages']\t\t\t\t= $this->isMobile() ? 1 : 0;\n\t\t//支付页面语言,默认英语\n\t\t$parameter['language']\t\t\t= '';\n\t\t//支付页面显示商户logo\n\t\t$parameter['logoUrl']\t\t\t= '';\n\t\t\n\n\t\t\n\t\tMage::getSingleton('checkout/session')->setData('pages', $parameter['pages']);\n\t\t\n\t\t\n\t\t//记录发送到oceanpayment的post log\n\t\t$this->postLog($parameter);\n\t\t\n\t \n return $parameter;\n }",
"function makePayment () {\n\t\t$API_UserName \t= $this->API_UserName;\n\t\t$API_Password \t= $this->API_Password;\n\t\t$API_Signature = $this->API_Signature;\n\t\t$API_Endpoint \t= $this->API_Endpoint;\n\t\t$version = $this->version;\n\t\t\t\t\n\t\t/* SET VALUES */\n\t\t $environment \t\t\t\t\t= $this->environment;\t\t\n\t\t $L_BILLINGTYPE0 \t\t\t\t= 'RecurringPayments';\n\t\t\n\t\t$this->loadModel('SbsSubscriberOrganizationDetail');\n\t\t$this->loadModel('SbsSubscriber');\n\t\t$this->loadModel('SbsSubscriberSetting');\t\n\t\t$this->loadModel('CpnSetting');\n\t\t$this->loadModel('SbsEmailTemplateDetail');\t\n\t\t$this->loadModel('SbsEmailTemplate');\n\t\t\t\t\t\t\n\t\tif ($this->request->is('post')) {\n\t\t\t\n\t\t\t\n\t\t\t$obj\t=\tnew PaypalRecurring;\n\t\t\t\n\t\t\t/* PAYPAL API DETAILS */\n\t\t\t$obj->API_UserName \t= urlencode($API_UserName);\n\t\t\t$obj->API_Password \t= urlencode($API_Password);\n\t\t\t$obj->API_Signature = urlencode($API_Signature);\n\t\t\t$obj->API_Endpoint \t= $API_Endpoint;\n\t\t\t$obj->version \t\t= urlencode($version);\t\t\t\n\t\t\t\n\t\t\t// Set request-specific fields.\n\t\t\t$obj->startDate \t= urlencode($profilestartdate);\n\t\t\t$obj->billingPeriod = urlencode($billing_period);\t\t\t\t\n\t\t\t$obj->billingFreq \t= urlencode($billing_frequency);\t\t\t\t\t\t\n\t\t\t$obj->paymentAmount = urlencode($subscription_cost);\n\t\t\t$obj->currencyID \t= urlencode($currency_code);\t\t\t\n\t\t\t$obj->taxamount\t\t= urlencode($service_tax);\t\n\t\t $obj->maxfailedpayments \t = 2; \n\t\t $obj->autobillamount \t = 'AddToNextBilling';\t \n\t\t\t$obj->initamount\t\t\t = $initial_amount;\n\t\t\t$obj->failedinitamountaction = 'CancelOnFailure'; //FAILEDINITAMTACTION\n\t\t\t$obj->environment \t\t\t\t\t\t= $environment;\t\n\t\t\t$obj->paymentType \t\t\t\t\t\t= urlencode($paymentType);\t\n\t\t\t$obj->L_BILLINGTYPE0 \t\t\t\t\t= $L_BILLINGTYPE0;\t\t\n\t\t\t$obj->L_BILLINGAGREEMENTDESCRIPTION0\t= urlencode($L_BILLINGAGREEMENTDESCRIPTION0); \n\t\t\t// creating recurring profile\n\t\t\t$httpParsedResponseAr = $obj->createRecurringPaymentsProfile($token);\n\t\t\t\n\t\t\tif(\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\t\t\n\t\t\t\n\t\t\t\t$profile_id \t= urldecode($httpParsedResponseAr[\"PROFILEID\"]);\n\t\t\t\t$profile_status = urldecode($httpParsedResponseAr[\"PROFILESTATUS\"]);\n\t\t\t\t\n\t\t\t\tswitch ($profile_status) {\n\t\t\t\t\tcase 'ActiveProfile':\n\t\t\t\t\t\t$profile_status = 'Active';\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'PendingProfile':\n\t\t\t\t\t\t$profile_status = 'Pending';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'CancelledProfile':\n\t\t\t\t\t\t$profile_status = 'Cancelled';\n\t\t\t\t\t\tbreak;\t\n\t\t\t\t\tcase 'SuspendedProfile':\n\t\t\t\t\t\t$profile_status = 'Suspended';\n\t\t\t\t\t\tbreak;\t\n\t\t\t\t\tcase 'ExpiredProfile':\n\t\t\t\t\t\t$profile_status = 'Expired';\n\t\t\t\t\t\t break;\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\tif($success){\n \t $this->redirect(array('controller'=>'controller','action' => 'action'));\n\t\t \n }else {\n\t\t\t\t// signupFailure\n\t\t\t\t$methodError \t= 'createRecurringPaymentsProfile';\n\t\t\t\t$errorCode \t= urldecode($httpParsedResponseAr[\"L_ERRORCODE0\"]);\n\t\t\t\t$errorSmallMsg = urldecode($httpParsedResponseAr[\"L_SHORTMESSAGE0\"]);\n\t\t\t\t$errorLongMsg = urldecode($httpParsedResponseAr[\"L_LONGMESSAGE0\"]);\n\t\t\t\t$serverCode = urldecode($httpParsedResponseAr[\"L_SEVERITYCODE0\"]);\n\t\t\t\t\n\t\t\t\t// store in session for later use\n\t\t\t\t$this->Session->write('errorCode',$errorCode);\t\t\t\n\t\t\t\t$this->Session->write('errorSmallMsg',$errorSmallMsg);\n\t\t\t\t$this->Session->write('errorLongMsg',$errorLongMsg);\t\n\t\t\t\t$this->Session->write('serverCode',$serverCode);\t\t\t\n\t\t\t\t$this->redirect(array('controller'=>'controller','action' => 'action/'.$methodError));\n\t\t\t}\n\t\t }\n\t}\n\n}",
"abstract protected function validate_params();",
"function buildParams()\n {\n $this->_aParams = array(\n rawurlencode('oauth_consumer_key') => rawurlencode($this->_consumerKey),\n rawurlencode('oauth_token') => rawurlencode($this->_oAuthToken),\n rawurlencode('oauth_nonce') => rawurlencode($this->_oAuthNonce),\n rawurlencode('oauth_signature_method') => rawurlencode($this->_oAuthSignatureMethod),\n rawurlencode('oauth_timestamp') => rawurlencode($this->_oAuthTimeStamp),\n rawurlencode('oauth_version') => rawurlencode($this->_oAuthVersion)\n );\n \n $this->_aParams[rawurlencode('oauth_signature')] = $this->getSignature();\n }",
"protected function buildParameters()\n {\n if(empty($this->_sessionId)){\n throw new Exception('Session ID not set');\n }\n\n if(empty($this->_moduleNames)){\n throw new Exception('Module Names not set');\n }\n\n if(empty($this->_id)){\n throw new Exception('IDs not set')\n }\n\n $parameters = array(\n 'session' => '$this->_sessionId',\n 'module_name' => '$this->_moduleName',\n 'id' => '$this->_id',\n );\n\n if(!empty($this->_selectFields)){\n $parameters['select_fields'] = $this->_selectFields;\n }\n\n if(!empty($this->_linkNameToFields)){\n $parameters['link_name_to_fields_array'] = $this->_linkNameToFields;\n } \n \n return $parameters; \n }",
"abstract protected function getRequiredRequestParameters();",
"private function getValidApiRequest()\n {\n return [\n 'id' => '5cc06b9fadccf621f80217d0',\n 'name' => 'Review',\n 'description' => 'Review description',\n 'disabled' => 'false',\n 'allowallpaths' => 'false',\n 'type' => '3',\n 'attribute0_attributeid' => '5cc06b9fadccf621f80217ce',\n 'attribute0_name' => 'String',\n 'attribute0_description' => 'String description',\n 'attribute0_type' => '1',\n 'attribute0_required' => 'true',\n 'attribute0_disabled' => 'false',\n 'attribute0_defaultvalue' => 'Default string',\n 'attribute0_predefinedvalues_total' => '0',\n 'attribute1_attributeid' => '5cc09402adccf621f8021956',\n 'attribute1_name' => 'Int',\n 'attribute1_description' => '',\n 'attribute1_type' => '2',\n 'attribute1_required' => 'true',\n 'attribute1_disabled' => 'false',\n 'attribute1_defaultvalue' => '1000',\n 'attribute1_predefinedvalues_total' => '0',\n 'attribute2_attributeid' => '5cc09402adccf621f8021957',\n 'attribute2_name' => 'Dec',\n 'attribute2_description' => '',\n 'attribute2_type' => '3',\n 'attribute2_required' => 'false',\n 'attribute2_disabled' => 'false',\n 'attribute2_defaultvalue' => '1.1',\n 'attribute2_predefinedvalues_total' => '0',\n 'attribute3_attributeid' => '5cc09402adccf621f8021958',\n 'attribute3_name' => 'Bool',\n 'attribute3_description' => '',\n 'attribute3_type' => '4',\n 'attribute3_required' => 'false',\n 'attribute3_disabled' => 'false',\n 'attribute3_defaultvalue' => 'true',\n 'attribute3_predefinedvalues_total' => '0',\n 'attribute4_attributeid' => '5cc09402adccf621f8021959',\n 'attribute4_name' => 'Date',\n 'attribute4_description' => '',\n 'attribute4_type' => '5',\n 'attribute4_required' => 'false',\n 'attribute4_disabled' => 'false',\n 'attribute4_defaultvalue' => '2019-04-03 00:00:00',\n 'attribute4_predefinedvalues_total' => '0',\n 'attribute5_attributeid' => '5cc09402adccf621f802195a',\n 'attribute5_name' => 'Select',\n 'attribute5_description' => '',\n 'attribute5_type' => '6',\n 'attribute5_required' => 'false',\n 'attribute5_disabled' => 'false',\n 'attribute5_defaultvalue' => 'A',\n 'attribute5_predefinedvalue0' => 'A',\n 'attribute5_predefinedvalue1' => 'B',\n 'attribute5_predefinedvalue2' => 'C',\n 'attribute5_predefinedvalues_total' => '3',\n 'attribute6_attributeid' => '5cc09402adccf621f802195b',\n 'attribute6_name' => 'Array',\n 'attribute6_description' => '',\n 'attribute6_type' => '7',\n 'attribute6_required' => 'false',\n 'attribute6_disabled' => 'false',\n 'attribute6_defaultvalue' => 'a,b,c,d',\n 'attribute6_predefinedvalues_total' => '0',\n 'attributes_total' => '7',\n 'user0_name' => 'user1',\n 'user0_read' => 'true',\n 'user0_write' => 'true',\n 'users_total' => '1',\n 'group0_id' => '55557777bbbbccccddddaaaa',\n 'group0_name' => 'EVERYONE',\n 'group0_read' => 'true',\n 'group0_write' => 'true',\n 'groups_total' => '1',\n 'path0' => '/user1',\n 'paths_total' => '1',\n ];\n }",
"function cleanUserInputtedDetails($app, $tainted_parameters)\r\n{\r\n $cleaned_parameters = [];\r\n $validator = $app->getContainer()->get('validator');\r\n\r\n $tainted_username = $tainted_parameters['username'];\r\n //$tainted_email = $tainted_parameters['email'];\r\n\r\n $cleaned_parameters['password'] = $tainted_parameters['password'];\r\n $cleaned_parameters['sanitised_username'] = $validator->sanitiseString($tainted_username);\r\n //$cleaned_parameters['sanitised_email'] = $validator->sanitiseString($tainted_email);\r\n //$cleaned_parameters['sanitised_requirements'] = $validator->sanitiseString($tainted_requirements);\r\n return $cleaned_parameters;\r\n}",
"public function getValidCard()\n {\n return array(\n 'firstName' => 'Example',\n 'lastName' => 'User',\n 'number' => '4111111111111111',\n 'expiryMonth' => rand(1, 12),\n 'expiryYear' => gmdate('Y') + rand(1, 5),\n 'cvv' => rand(100, 999),\n 'billingAddress1' => '123 Billing St',\n 'billingAddress2' => 'Billsville',\n 'billingCity' => 'Billstown',\n 'billingPostcode' => '12345',\n 'billingState' => 'CA',\n 'billingCountry' => 'US',\n 'billingPhone' => '(555) 123-4567',\n 'shippingAddress1' => '123 Shipping St',\n 'shippingAddress2' => 'Shipsville',\n 'shippingCity' => 'Shipstown',\n 'shippingPostcode' => '54321',\n 'shippingState' => 'NY',\n 'shippingCountry' => 'US',\n 'shippingPhone' => '(555) 987-6543',\n );\n }"
] | [
"0.7123827",
"0.5250553",
"0.5245396",
"0.52448666",
"0.52381706",
"0.5170908",
"0.49939978",
"0.4978654",
"0.49766392",
"0.49674365",
"0.4938419",
"0.48977378",
"0.4880765",
"0.48786741",
"0.4871452",
"0.48671123",
"0.48549664",
"0.4841075",
"0.4813213",
"0.47963148",
"0.4764851",
"0.47211507",
"0.4703887",
"0.4670229",
"0.46667197",
"0.46629527",
"0.46447277",
"0.46343735",
"0.46131822",
"0.46041217"
] | 0.59305614 | 1 |
Loads all the nodes in the group | protected function loadAllnodes()
{
$this->set(
'allnodes',
self::getSubObjectIDs(
'StorageNode',
array(
'storagegroupID' => $this->get('id'),
),
'id'
)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function loadAllNodes(){\n if($this->nodes == null){\n if($id = $this->get_adaquizid()){\n $this->nodes = Node::getAllNodes($id);\n }else{\n $this->nodes = array();\n }\n }\n }",
"protected function loadEnablednodes()\n {\n $find = array(\n 'storagegroupID' => $this->get('id'),\n 'id' => $this->get('allnodes'),\n 'isEnabled' => 1\n );\n $nodeids = array();\n $testurls = array();\n foreach ((array)self::getClass('StorageNodeManager')\n ->find($find) as &$node\n ) {\n if ($node->get('maxClients') < 1) {\n continue;\n }\n $nodeids[] = $node->get('id');\n unset($node);\n }\n $this->set('enablednodes', $nodeids);\n }",
"protected function loadChildren() {\n }",
"protected function loadGroups()\n {\n $groups = self::getSubObjectIDs(\n 'GroupAssociation',\n array('hostID' => $this->get('id')),\n 'groupID'\n );\n $groups = self::getSubObjectIDs(\n 'Group',\n array('id' => $groups)\n );\n $this->set('groups', $groups);\n }",
"public function getNodes();",
"public function getNodes();",
"function group_load_all()\n{\n $groups = &drupal_static(__FUNCTION__);\n if ( !isset( $groups)) {\n db_set_active('ocsdb');\n\n $query = db_select( 'ocs_group', 'g');\n $groups = $query->fields( 'g')\n ->execute()\n ->fetchAllAssoc( 'group_id', PDO::FETCH_ASSOC);\n } \n db_set_active('default');\n return $groups;\n}",
"public function loadChildren($group = '')\n {\n $this->classifications = \\HamClassification::sort('name')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n $this->places = \\HamPlace::sort('name')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n $this->sorted_places = \\App\\Helpers\\Helpers::sortFiltersByChildren($this->places);\n $this->galleries = \\HamGallery::sort('name')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n $this->sorted_galleries = \\App\\Helpers\\Helpers::sortFiltersByFloor($this->galleries);\n $this->periods = \\HamPeriod::sort('name')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n $this->centuries = \\HamCentury::sort('temporalorder')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n $this->cultures = \\HamCulture::sort('name')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n $this->worktypes = \\HamWorktype::sort('name')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n $this->colors = \\HamColor::sort('name')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n\n $this->techniques = \\HamTechnique::sort('name')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n $this->mediums = \\HamMedium::sort('name')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n $this->mediumstechniques =\n \\App\\Helpers\\Helpers::mergeMediumsTechniques($this->techniques, $this->mediums);\n $this->sorted_mediumstechniques = \\App\\Helpers\\Helpers::sortFiltersByChildren($this->mediumstechniques);\n }",
"function loadLanes()\n {\n\n $seq=0;\n foreach($this->xml->xpath('//model:process') as $procNode) {\n $seq++;\n $procNode->registerXPathNamespace('model', 'http://www.omg.org/spec/BPMN/20100524/MODEL');\n\n $poolId = self::getAttribute($procNode, 'id');\n \n if ($poolId ===null || $poolId==='')\n $poolId ='process_'.$seq;\n \n $poolName = self::getAttribute($procNode,'name');\n if ($poolName=='')\n $poolName=$poolId;\n Context::Log(INFO, \"model:process tag $poolId - $poolName\");\n \n $pool=new BPMN\\Pool($this->proc);\n $pool->type='pool';\n $pool->id=$poolId;\n $pool->loadFromXML($procNode);\n $pool->name=$poolName;\n\n $this->proc->pools[$poolName]=$pool;\n \n }\n \n \n foreach($this->xml->xpath('//model:lane') as $laneNode) {\n\n $attr=$lane=$laneNode->attributes();\n \n if (isset($attr['name']))\n $lane=$attr['name']->__ToString();\n\n\n foreach(XMLLoader::children($laneNode) as $child) {\n if ($child->getName()=='flowNodeRef')\n {\n $tid=$child->__ToString();\n $pitem=$this->proc->getItemById($tid);\n $pitem->lane= $lane;\n\n Context::Log(\"INFO\", \"Lane node: $lane node $pitem->label\");\n }\n }\n }\n\n }",
"protected function load()\n {\n $this->setObject(node_load($this->object->nid));\n }",
"function load()\n {\n return\n $this\n ->structureload()\n ->groupLoad()\n ->userLoad();\n }",
"function loadNodesWithImages() {\n $query = db_select('file_usage', 'u');\n $query->join('node', 'n', 'u.id = n.nid');\n \n $query->fields('u', ['id'])\n ->condition('n.status', NODE_PUBLISHED);\n $result = $query->execute();\n $nids = array_keys($result->fetchAllAssoc('id'));\n return node_load_multiple($nids);\n }",
"function _load() {\n\t\t$sql = \"SELECT name, description, canManageClasses, canManageUsers, canManageImgLib, restrictNodeEdit, isModerator FROM dbm_user_groups WHERE id=?\";\n\t\t$rs = DBUtils::execSelect($sql, array($this->id));\n\t\tif ($rs->next()) {\n\t\t\t$this->name = $rs->getString(1);\n\t\t\t$this->description = $rs->getString(2);\n\t\t\t$this->canManageClasses = $rs->getBoolean(3);\n\t\t\t$this->canManageUsers = $rs->getBoolean(4);\n\t\t\t$this->canManageImgLib = $rs->getBoolean(5);\n\t\t\t$this->restrictNodeEdit = $rs->getBoolean(6);\n\t\t\t$this->isModerator = $rs->getBoolean(7);\n\t\t} else {\n\t\t\tdie(\"UserGroup _load failed. No such record in database.\");\n\t\t}\n\t}",
"protected function readLiveNodes()\n {\n $this->liveNodes = $this->getChildren(self::LIVE_NODES_ZKNODE);\n }",
"public function loadRoot() {\n $this->loadFromId(1);\n }",
"function loadGroups() {\n $db = & JFactory::getDBO();\n $query = \"SELECT \".$this->group_id.\", \".$this->groups_db.\".group_name, \".\n $this->groups_db.\".description, groupvpn.group_name as gn, groupvpn.group_id FROM \".\n $this->groups_db.\" JOIN groupvpn on \".$this->groups_db.\".group_id = \".\n \"groupvpn.group_id\";\n $db->setQuery($query);\n return $db->loadObjectList($this->group_id);\n }",
"public function setAllLoaded()\n\t{\n\t\t$this->_allChildrenloaded = true;\n\n\t\tforeach ($this->_children as $child)\n\t\t{\n\t\t\t$child->setAllLoaded();\n\t\t}\n\t}",
"protected function loadAll() {\n\t\ttry {\r\n\t\t\tif ($this->loadedAll) return;\n\t\t\t$currentKey\t= $this->key();\n\t\t\twhile ($this->valid()) {\n\t\t\t\t$this->next();\n\t\t\t}\n\t\t\t$this->key\t= $currentKey;\n\t\t\t$this->loadedAll\t= true;\n\t\t}\r\n\t\tcatch (Exception $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\n\t}",
"private function loadUserGroups()\n {\n /*if ( $this->Cache->exists('users/groups/'.$this->uid) )\n $this->groups = $this->Cache->get('users/groups/'.$this->uid);\n else*/\n $this->groups = $this->getUserGroups();\n }",
"public function fetch()\n {\n return $this->tree->generate_nodes_array();\n }",
"protected function loadGroups()\n {\n return FormLayoutGroup::where('object', $this->object->identifier())\n ->orderBy('weight')\n ->get();\n }",
"public function __construct() {\n $this->nodes = array();\n }",
"public function loadGroupCache()\n {\n\n if (file_exists(PATH_CACHE.'resource/group_ids.php')){\n include PATH_CACHE.'resource/group_ids.php';\n } else {\n $this->groupIds = [];\n }\n\n }",
"public function setNodes()\n {\n foreach(array_keys(Core_Model_DiFactory::getNodeManager()->getNodes()) as $nodeId) {\n $this->setNode($nodeId);\n }\n }",
"protected function loadGroupsnotinme()\n {\n $find = array('id' => $this->get('groups'));\n $groups = self::getSubObjectIDs(\n 'Group',\n $find,\n 'id',\n true\n );\n $this->set('groupsnotinme', $groups);\n }",
"abstract public function loadRelationships();",
"public function loadGroup($groupId);",
"private function loadLayers() {\n\t\t$this->layersets = array();\n\t\tforeach($this->configuration['layersets'] as $name => $layers) {\n\t\t\t$this->layersets[$name] = array();\n\t\t\tforeach($layers as $title => $layer) {\n\t\t\t\t//Extract and unset class, so we can use the remains as configuration\n\t\t\t\t$class = $layer['class'];\n\t\t\t\tunset($layer['class']);\n\t\t\t\t$this->layersets[$name][] = new $class($title, $layer);\n\t\t\t}\n\t\t}\n\t}",
"public function getNodes() {\n\t\tif (is_null($this->_nodes)) {\n\t\t\t$this->_nodes = array();\n\t\t\t$data = df_mage()->coreHelper()->jsonDecode($this->getPage()->getNodesData());\n\t\t\t$collection = Df_Cms_Model_Hierarchy_Node::c();\n\t\t\t$collection\n\t\t\t\t->joinCmsPage()\n\t\t\t\t->setOrderByLevel()\n\t\t\t\t->joinPageExistsNodeInfo($this->getPage())\n\t\t\t;\n\t\t\tif (is_array($data)) {\n\t\t\t\tforeach ($data as $v) {\n\t\t\t\t\tif (isset($v['page_exists'])) {\n\t\t\t\t\t\t$pageExists = !!$v['page_exists'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$pageExists = false;\n\t\t\t\t\t}\n\t\t\t\t\t$node = array(\n\t\t\t\t\t\t'node_id' => $v['node_id']\n\t\t\t\t\t\t,'parent_node_id' => $v['parent_node_id']\n\t\t\t\t\t\t,'label' => $v['label']\n\t\t\t\t\t\t,'page_exists' => $pageExists\n\t\t\t\t\t\t,'page_id' => $v['page_id']\n\t\t\t\t\t\t,'current_page' => !!$v['current_page']\n\t\t\t\t\t);\n\t\t\t\t\t$item = $collection->getItemById($v['node_id']);\n\t\t\t\t\t$node['assigned_to_stores'] = !$item ? array() : $this->getPageStoreIds($item);\n\t\t\t\t\t$this->_nodes[]= $node;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tforeach ($collection as $item) {\n\t\t\t\t\t$this->_nodes[]=\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'node_id' => $item->getId()\n\t\t\t\t\t\t\t,'parent_node_id' => $item->getParentNodeId()\n\t\t\t\t\t\t\t,'label' => $item->getLabel()\n\t\t\t\t\t\t\t,'page_exists' => !!$item->getPageExists()\n\t\t\t\t\t\t\t,'page_id' => $item->getPageId()\n\t\t\t\t\t\t\t,'current_page' => !!$item->getCurrentPage()\n\t\t\t\t\t\t\t,'assigned_to_stores' => $this->getPageStoreIds($item)\n\t\t\t\t\t\t)\n\t\t\t\t\t;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->_nodes;\n\t}",
"function openlucius_core_get_all_nodes_in_group($group_nid, $keyed = FALSE) {\n // Get all node ids that have the shared_group_reference $group_nid.\n $query = db_select('field_data_field_shared_group_reference', 'g')\n ->fields('g', array('entity_id'))\n ->condition('g.field_shared_group_reference_nid', $group_nid, '=')\n ->execute();\n\n // Return the query results.\n return $keyed ? $query->fetchAllKeyed(0, 0) : $query->fetchCol();\n}"
] | [
"0.771888",
"0.6929188",
"0.6541274",
"0.65260196",
"0.6390241",
"0.6390241",
"0.6364728",
"0.624463",
"0.62190264",
"0.6165267",
"0.61028636",
"0.6030797",
"0.59285134",
"0.58828276",
"0.58621156",
"0.58181995",
"0.57689965",
"0.5695331",
"0.56851465",
"0.5682157",
"0.566137",
"0.565181",
"0.5647483",
"0.55917144",
"0.5585034",
"0.5569978",
"0.5569276",
"0.5541374",
"0.552291",
"0.55223817"
] | 0.79963183 | 0 |
Loads the enabled nodes in the group | protected function loadEnablednodes()
{
$find = array(
'storagegroupID' => $this->get('id'),
'id' => $this->get('allnodes'),
'isEnabled' => 1
);
$nodeids = array();
$testurls = array();
foreach ((array)self::getClass('StorageNodeManager')
->find($find) as &$node
) {
if ($node->get('maxClients') < 1) {
continue;
}
$nodeids[] = $node->get('id');
unset($node);
}
$this->set('enablednodes', $nodeids);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function loadAllNodes(){\n if($this->nodes == null){\n if($id = $this->get_adaquizid()){\n $this->nodes = Node::getAllNodes($id);\n }else{\n $this->nodes = array();\n }\n }\n }",
"protected function loadAllnodes()\n {\n $this->set(\n 'allnodes',\n self::getSubObjectIDs(\n 'StorageNode',\n array(\n 'storagegroupID' => $this->get('id'),\n ),\n 'id'\n )\n );\n }",
"function group_load_all()\n{\n $groups = &drupal_static(__FUNCTION__);\n if ( !isset( $groups)) {\n db_set_active('ocsdb');\n\n $query = db_select( 'ocs_group', 'g');\n $groups = $query->fields( 'g')\n ->execute()\n ->fetchAllAssoc( 'group_id', PDO::FETCH_ASSOC);\n } \n db_set_active('default');\n return $groups;\n}",
"protected function loadGroups()\n {\n $groups = self::getSubObjectIDs(\n 'GroupAssociation',\n array('hostID' => $this->get('id')),\n 'groupID'\n );\n $groups = self::getSubObjectIDs(\n 'Group',\n array('id' => $groups)\n );\n $this->set('groups', $groups);\n }",
"public function getNodes();",
"public function getNodes();",
"protected function loadChildren() {\n }",
"function load()\n {\n return\n $this\n ->structureload()\n ->groupLoad()\n ->userLoad();\n }",
"private function loadUserGroups()\n {\n /*if ( $this->Cache->exists('users/groups/'.$this->uid) )\n $this->groups = $this->Cache->get('users/groups/'.$this->uid);\n else*/\n $this->groups = $this->getUserGroups();\n }",
"function _load() {\n\t\t$sql = \"SELECT name, description, canManageClasses, canManageUsers, canManageImgLib, restrictNodeEdit, isModerator FROM dbm_user_groups WHERE id=?\";\n\t\t$rs = DBUtils::execSelect($sql, array($this->id));\n\t\tif ($rs->next()) {\n\t\t\t$this->name = $rs->getString(1);\n\t\t\t$this->description = $rs->getString(2);\n\t\t\t$this->canManageClasses = $rs->getBoolean(3);\n\t\t\t$this->canManageUsers = $rs->getBoolean(4);\n\t\t\t$this->canManageImgLib = $rs->getBoolean(5);\n\t\t\t$this->restrictNodeEdit = $rs->getBoolean(6);\n\t\t\t$this->isModerator = $rs->getBoolean(7);\n\t\t} else {\n\t\t\tdie(\"UserGroup _load failed. No such record in database.\");\n\t\t}\n\t}",
"function openlucius_core_get_all_nodes_in_group($group_nid, $keyed = FALSE) {\n // Get all node ids that have the shared_group_reference $group_nid.\n $query = db_select('field_data_field_shared_group_reference', 'g')\n ->fields('g', array('entity_id'))\n ->condition('g.field_shared_group_reference_nid', $group_nid, '=')\n ->execute();\n\n // Return the query results.\n return $keyed ? $query->fetchAllKeyed(0, 0) : $query->fetchCol();\n}",
"function loadGroups() {\n $db = & JFactory::getDBO();\n $query = \"SELECT \".$this->group_id.\", \".$this->groups_db.\".group_name, \".\n $this->groups_db.\".description, groupvpn.group_name as gn, groupvpn.group_id FROM \".\n $this->groups_db.\" JOIN groupvpn on \".$this->groups_db.\".group_id = \".\n \"groupvpn.group_id\";\n $db->setQuery($query);\n return $db->loadObjectList($this->group_id);\n }",
"protected function loadGroupsnotinme()\n {\n $find = array('id' => $this->get('groups'));\n $groups = self::getSubObjectIDs(\n 'Group',\n $find,\n 'id',\n true\n );\n $this->set('groupsnotinme', $groups);\n }",
"protected function readLiveNodes()\n {\n $this->liveNodes = $this->getChildren(self::LIVE_NODES_ZKNODE);\n }",
"protected function loadGroupData() {\n\t\tif ($this->groupData !== null) return;\n\t\t\n\t\t// work-around for setup process (package wcf does not exist yet)\n\t\tif (!PACKAGE_ID) {\n\t\t\t$groupIDs = array();\n\t\t\t$sql = \"SELECT\tgroupID\n\t\t\t\tFROM\twcf\".WCF_N.\"_user_to_group\n\t\t\t\tWHERE\tuserID = ?\";\n\t\t\t$statement = WCF::getDB()->prepareStatement($sql);\n\t\t\t$statement->execute(array($this->user->userID));\n\t\t\twhile ($row = $statement->fetchArray()) {\n\t\t\t\t$groupIDs[] = $row['groupID'];\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$groupIDs = $this->user->getGroupIDs();\n\t\t}\n\t\t\n\t\t$groups = implode(',', $groupIDs);\n\t\t$groupsFileName = StringUtil::getHash($groups);\n\t\t\n\t\t// register cache resource\n\t\tCacheHandler::getInstance()->addResource(\n\t\t\t'groups-'.PACKAGE_ID.'-'.$groups,\n\t\t\tWCF_DIR.'cache/cache.groups-'.PACKAGE_ID.'-'.$groupsFileName.'.php',\n\t\t\t'wcf\\system\\cache\\CacheBuilderUserGroupPermission'\n\t\t);\n\t\t\n\t\t// get group data from cache\n\t\t$this->groupData = CacheHandler::getInstance()->get('groups-'.PACKAGE_ID.'-'.$groups);\n\t\tif (isset($this->groupData['groupIDs']) && $this->groupData['groupIDs'] != $groups) {\n\t\t\t$this->groupData = array();\n\t\t}\n\t}",
"public function loadGroupCache()\n {\n\n if (file_exists(PATH_CACHE.'resource/group_ids.php')){\n include PATH_CACHE.'resource/group_ids.php';\n } else {\n $this->groupIds = [];\n }\n\n }",
"public function loadModules();",
"function loadLanes()\n {\n\n $seq=0;\n foreach($this->xml->xpath('//model:process') as $procNode) {\n $seq++;\n $procNode->registerXPathNamespace('model', 'http://www.omg.org/spec/BPMN/20100524/MODEL');\n\n $poolId = self::getAttribute($procNode, 'id');\n \n if ($poolId ===null || $poolId==='')\n $poolId ='process_'.$seq;\n \n $poolName = self::getAttribute($procNode,'name');\n if ($poolName=='')\n $poolName=$poolId;\n Context::Log(INFO, \"model:process tag $poolId - $poolName\");\n \n $pool=new BPMN\\Pool($this->proc);\n $pool->type='pool';\n $pool->id=$poolId;\n $pool->loadFromXML($procNode);\n $pool->name=$poolName;\n\n $this->proc->pools[$poolName]=$pool;\n \n }\n \n \n foreach($this->xml->xpath('//model:lane') as $laneNode) {\n\n $attr=$lane=$laneNode->attributes();\n \n if (isset($attr['name']))\n $lane=$attr['name']->__ToString();\n\n\n foreach(XMLLoader::children($laneNode) as $child) {\n if ($child->getName()=='flowNodeRef')\n {\n $tid=$child->__ToString();\n $pitem=$this->proc->getItemById($tid);\n $pitem->lane= $lane;\n\n Context::Log(\"INFO\", \"Lane node: $lane node $pitem->label\");\n }\n }\n }\n\n }",
"function loadNodesWithImages() {\n $query = db_select('file_usage', 'u');\n $query->join('node', 'n', 'u.id = n.nid');\n \n $query->fields('u', ['id'])\n ->condition('n.status', NODE_PUBLISHED);\n $result = $query->execute();\n $nids = array_keys($result->fetchAllAssoc('id'));\n return node_load_multiple($nids);\n }",
"private function loadModules(){\n $modulesdir = ADMIN_ABSDIRPATH.$this->modulesdirname;\n $modules = scandir($modulesdir);\n foreach($modules as $module){\n if(substr($module,0,1) != '.'){\n \n $moduleconfig = simplexml_load_file($modulesdir.DIRECTORY_SEPARATOR.$module.DIRECTORY_SEPARATOR.$this->modulesconfigfilename);\n $attrs = $moduleconfig->attributes();\n $config = array(\n 'id' => (String)$attrs['id'],\n 'version' => (String)$attrs['version']\n );\n \n foreach($moduleconfig->children() as $property){\n $propertyname = $property->getName();\n if($propertyname == 'privileges'){\n $config['privileges'] = array();\n foreach($property->children() as $privilege){\n $privattrs = $privilege->attributes();\n $config['privileges'][(String)$privattrs['id']] = (String)$privilege;\n }\n }else if($propertyname == 'dependency'){\n $config[$propertyname] = explode(',', (String)$property);\n }else{\n $config[$propertyname] = (String)$property;\n }\n }\n \n if(isset($config['menugroup'])){\n if(!isset($this->modules[$config['menugroup']])){\n $this->modules[$config['menugroup']] = array();\n }\n $this->modules[$config['menugroup']][$config['id']] = $config;\n }else{\n $this->modules[$config['id']] = $config;\n }\n }\n }\n \n //sorting modules alphabetically\n ksort($this->modules);\n \n //setting the page parentmodule as first\n if(isset($this->modules[$this->firstparentmodule])){\n $firstparentmodule = array(\n $this->firstparentmodule => $this->modules[$this->firstparentmodule]\n );\n unset($this->modules[$this->firstparentmodule]);\n }\n \n //setting the help parentmodule as first\n if(isset($this->modules[$this->lastparentmodule])){\n $lastparentmodule = array(\n $this->lastparentmodule => $this->modules[$this->lastparentmodule]\n );\n unset($this->modules[$this->lastparentmodule]);\n }\n \n $this->modules = array_merge($firstparentmodule,$this->modules,$lastparentmodule);\n }",
"protected function loadGroupData() {\n\t\t// get group data from cache\n\t\t$this->groupData = UserGroupPermissionCacheBuilder::getInstance()->getData($this->getGroupIDs());\n\t\tif (isset($this->groupData['groupIDs']) && $this->groupData['groupIDs'] != $this->getGroupIDs()) {\n\t\t\t$this->groupData = array();\n\t\t}\n\t}",
"protected function loadModules()\n {\n $modules = self::getSubObjectIDs(\n 'ModuleAssociation',\n array('hostID' => $this->get('id')),\n 'moduleID'\n );\n $modules = self::getSubObjectIDs(\n 'Module',\n array('id' => $modules)\n );\n $this->set('modules', $modules);\n }",
"public function loadChildren($group = '')\n {\n $this->classifications = \\HamClassification::sort('name')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n $this->places = \\HamPlace::sort('name')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n $this->sorted_places = \\App\\Helpers\\Helpers::sortFiltersByChildren($this->places);\n $this->galleries = \\HamGallery::sort('name')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n $this->sorted_galleries = \\App\\Helpers\\Helpers::sortFiltersByFloor($this->galleries);\n $this->periods = \\HamPeriod::sort('name')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n $this->centuries = \\HamCentury::sort('temporalorder')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n $this->cultures = \\HamCulture::sort('name')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n $this->worktypes = \\HamWorktype::sort('name')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n $this->colors = \\HamColor::sort('name')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n\n $this->techniques = \\HamTechnique::sort('name')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n $this->mediums = \\HamMedium::sort('name')\n ->sortorder('asc')->usedby($group)->limit($this->_limit_filters)->find();\n $this->mediumstechniques =\n \\App\\Helpers\\Helpers::mergeMediumsTechniques($this->techniques, $this->mediums);\n $this->sorted_mediumstechniques = \\App\\Helpers\\Helpers::sortFiltersByChildren($this->mediumstechniques);\n }",
"protected function loadGroupAssignments()\n\t{\n\t\t// First call the parent\n\t\tparent::loadGroupAssignments();\n\n\t\t// And now convert newline-separated strings into an array.\n\t\tif (!empty($this->addGroups))\n\t\t{\n\t\t\tforeach ($this->addGroups as $levelId => &$addGroups)\n\t\t\t{\n\t\t\t\t$addSqlCommands = explode(\"\\n\", $addGroups);\n\n\t\t\t\tforeach ($addSqlCommands as &$sqlCmd)\n\t\t\t\t{\n\t\t\t\t\t$sqlCmd = preg_replace('/^[\\s]+|[\\s;]+$/', '', $sqlCmd);\n\t\t\t\t}\n\n\t\t\t\t$addGroups = array_filter($addSqlCommands);\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($this->removeGroups))\n\t\t{\n\t\t\tforeach ($this->removeGroups as $levelId => &$removeGroups)\n\t\t\t{\n\t\t\t\t$removeSqlCommands = explode(\"\\n\", $removeGroups);\n\n\t\t\t\tforeach ($removeSqlCommands as &$sqlCmd)\n\t\t\t\t{\n\t\t\t\t\t$sqlCmd = preg_replace('/^[\\s]+|[\\s;]+$/', '', $sqlCmd);\n\t\t\t\t}\n\n\t\t\t\t$removeGroups = array_filter($removeSqlCommands);\n\t\t\t}\n\t\t}\n\t}",
"public function loadGroup($groupId);",
"protected function loadOrderedEnabledModuleNames()\n {\n $modules = sfConfig::get('sf_enabled_modules');\n ksort($modules);\n $modules = array_flip($modules);\n \n $modules = ullCoreTools::orderArrayByArray($modules, sfConfig::get('app_admin_module_global_links_order', array()), false);\n \n $this->modules = array_keys($modules);\n }",
"protected function loadGroups()\n {\n return FormLayoutGroup::where('object', $this->object->identifier())\n ->orderBy('weight')\n ->get();\n }",
"protected function load()\n {\n $this->setObject(node_load($this->object->nid));\n }",
"function loadImportModulesList() {\n unset($this->importModules);\n $sql = \"SELECT module_guid, module_title, modulegroup_id\n FROM %s\n WHERE module_type = 'import' AND module_active = 1\n ORDER BY module_title\";\n if ($res = $this->databaseQueryFmt($sql, $this->tableModules)) {\n while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $this->importModules[$row['module_guid']] = $row;\n }\n }\n }",
"public function setAllLoaded()\n\t{\n\t\t$this->_allChildrenloaded = true;\n\n\t\tforeach ($this->_children as $child)\n\t\t{\n\t\t\t$child->setAllLoaded();\n\t\t}\n\t}"
] | [
"0.6969063",
"0.69663703",
"0.6289892",
"0.6043176",
"0.591045",
"0.591045",
"0.5863092",
"0.58515924",
"0.5831203",
"0.57876474",
"0.57566285",
"0.57288593",
"0.5537909",
"0.55294365",
"0.5506483",
"0.5484687",
"0.54781526",
"0.5468231",
"0.54672515",
"0.54595643",
"0.5449936",
"0.5430975",
"0.5383284",
"0.5369746",
"0.53668433",
"0.5323834",
"0.5309631",
"0.5304744",
"0.5278462",
"0.5257894"
] | 0.8396259 | 0 |
Returns total available slots | public function getTotalAvailableSlots()
{
$tot = (
$this->getTotalSupportedClients()
- $this->getUsedSlots()
- $this->getQueuedSlots()
);
if ($tot < 1) {
return 0;
}
return $tot;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFreeSlots() {\n\n // Count number of free slots.\n $jobs = $this->getRunningJobs();\n $running = count($jobs);\n $num_slots = $this->max_slots - $running;\n if ($num_slots < 0) {\n $num_slots = 0;\n }\n return $num_slots;\n }",
"public function getUsedSlots()\n {\n if (isset(self::$_used['tot'])) {\n return (int)self::$_used['tot'];\n }\n return (int)self::$_used['tot'] = self::getClass('TaskManager')\n ->count(\n array(\n 'stateID' => self::getProgressState(),\n 'storagenodeID' => $this->get('enablednodes'),\n 'typeID' => $this->get('usedtasks'),\n )\n );\n }",
"public function getAvailableSlots()\n {\n return $this->availableSlots;\n }",
"public function occupiedSlotsCount()\n {\n return $this->model->where('free', 0)->with('vehicle','vehicle.vehicle_type')->get()->sum('vehicle.vehicle_type.slots');\n }",
"public function getFreeSlotsNumber() {\n return self::SLOT_PER_TOWN - $this->buildings->count() - $this->buildingsQueue->count();\n }",
"public function getTotalAvailable()\n\t{\n\t\treturn $this->total_available;\n\t}",
"public function get_slotsInUse(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::SLOTSINUSE_INVALID;\n }\n }\n $res = $this->_slotsInUse;\n return $res;\n }",
"public function getQueuedSlots()\n {\n if (isset(self::$_queued['tot'])) {\n return (int)self::$_queued['tot'];\n }\n return (int)self::$_queued['tot'] = self::getClass('TaskManager')\n ->count(\n array(\n 'stateID' => self::getQueuedStates(),\n 'storagenodeID' => $this->get('enablednodes'),\n 'typeID' => $this->get('usedtasks'),\n )\n );\n }",
"public function getAvailableSpace();",
"public function get_slotsCount(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::SLOTSCOUNT_INVALID;\n }\n }\n $res = $this->_slotsCount;\n return $res;\n }",
"public function getMaxSlots() {\n return $this->max_slots;\n }",
"public function getAvailable() {\n\t\t$size=$this->getSize();\n\t\t$used=$this->getUsed();\n\t\treturn $size - $used;\n\t}",
"public function getQuantityAvailable()\n {\n return $this->quantityAvailable;\n }",
"public function count(): int\n {\n return count($this->slots) + 1;\n }",
"public function getAvailable_quantity()\n {\n return $this->available_quantity;\n }",
"public function getFreeCapacity() {\n\t\treturn $this->capacity - $this->totalWeight;\n\t}",
"protected function computeTotalReservations()\n {\n return\n $this->totalDomesticShippingReservations +\n $this->totalInternationalShippingReservations +\n $this->totalTruckingReservations +\n $this->totalCustomsBrokerReservations +\n $this->totalWarehouseReservations;\n }",
"public function getUsedSlots($slotPeriod = 15) {\n $sql = sprintf('SELECT count(*) FROM `orders` WHERE (restaurantId=%d) AND (deliverTime > date_sub(now(),interval %d minute))', $this->getId(), $slotPeriod);\n return $this->getAdapter()->fetchOne($sql);\n }",
"private function calculateTotalAvailable()\n\t{\n\t\t$working_days_count = $this->controller->getWeeksToShowCount() * (7 - count($this->options['non_work_days']));\n\t\t$this->total_available = count($this->getUsers()) * $working_days_count;\n\t}",
"public function getTotalCapacity()\n {\n return $this->totalCapacity;\n }",
"public function available () {\n if ($this->data['available'] == 0) {\n return $this->data['available'];\n }\n\n $num = DB::shift (\n 'select sum(num_attendees) from #prefix#event_registration\n\t\t\t where event_id = ? and\n\t\t\t status = 1 or\n\t\t\t (status = 0 and expires > ?)',\n $this->data['id'],\n gmdate ('Y-m-d H:i:s')\n );\n\n return $this->data['available'] - $num;\n }",
"public function get_slots_available_count( $timeslots, $ymd ) {\n\t\tstatic $counts = array();\n\n\t\tif ( ! empty( $counts[ $ymd ] ) ) {\n\t\t\treturn $counts[ $ymd ];\n\t\t}\n\n\t\t$orders_remaining_for_day = $this->get_orders_remaining_for_day( $ymd );\n\n\t\tif ( ! $orders_remaining_for_day ) {\n\t\t\t$counts[ $ymd ] = 0;\n\n\t\t\treturn $counts[ $ymd ];\n\t\t}\n\n\t\tglobal $wpdb;\n\n\t\t$timeslot_ids = wp_list_pluck( $timeslots, 'id' );\n\t\t$counts[ $ymd ] = array_fill_keys( $timeslot_ids, 0 );\n\n\t\t$reserved_slots = $wpdb->get_results(\n\t\t\t$wpdb->prepare(\n\t\t\t\t\"SELECT datetimeid, COUNT(datetimeid) as count\n\t\t\t\tFROM {$wpdb->prefix}jckwds\n\t\t\t\tWHERE datetimeid LIKE %s\n\t\t\t\tAND NOT (user_id = %d AND processed = 0)\n\t\t\t\tGROUP BY datetimeid\",\n\t\t\t\t$ymd . '_%',\n\t\t\t\t$this->user_id\n\t\t\t),\n\t\t\tARRAY_A\n\t\t);\n\n\t\tforeach ( $counts[ $ymd ] as $slot_id => $count ) {\n\t\t\t$timeslot = Iconic_WDS_Helpers::search_array_by_key_value( 'id', $slot_id, $timeslots );\n\n\t\t\tif ( ! $timeslot ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$counts[ $ymd ][ $slot_id ] = '' === trim( $timeslot['lockout'] ) ? true : absint( $timeslot['lockout'] );\n\t\t}\n\n\t\tif ( empty( $reserved_slots ) || is_wp_error( $reserved_slots ) ) {\n\t\t\t$counts[ $ymd ] = apply_filters( 'iconic_wds_slots_available_count', $counts[ $ymd ], $ymd, $timeslots );\n\n\t\t\treturn $counts[ $ymd ];\n\t\t}\n\n\t\tforeach ( $reserved_slots as $reserved_slot ) {\n\t\t\t$slot_id = str_replace( $ymd . '_', '', $reserved_slot['datetimeid'] );\n\n\t\t\tif ( ! isset( $counts[ $ymd ][ $slot_id ] ) || true === $counts[ $ymd ][ $slot_id ] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$counts[ $ymd ][ $slot_id ] -= absint( $reserved_slot['count'] );\n\t\t}\n\n\t\t$counts[ $ymd ] = apply_filters( 'iconic_wds_slots_available_count', $counts[ $ymd ], $ymd, $timeslots );\n\n\t\treturn $counts[ $ymd ];\n\t}",
"public function getTotalAllocated()\n\t{\n\t\treturn $this->total_allocated;\n\t}",
"public function getNetQtyAllocated()\n {\n return $this->getQtyAllocated();\n }",
"public function getReserveSpace() {\n return $this->reserveSpace;\n }",
"function getDemoSlotsAvailableCount($demo_date,$tchid)\n\t{\n\t\t// For current data Teacher Slots = Get Slots which are after current time only\n\t\tif($demo_date==date(\"Y-m-d\"))\n\t\t\t$slots=$this->runQuery(\"select count(*) as tot from tbl_teacher_slots where tchid=$tchid and CURRENT_TIME() < TIME(slot_to)\");\t\t\t\t\t\n\t\telse\n\t\t\t$slots=$this->runQuery(\"select count(*) as tot from tbl_teacher_slots where tchid=$tchid\");\n\t\t\n\t\t$booked=$this->runQuery(\"select count(*) as tot from demoschedules where teacherid=$tchid and DATE(demodate)='$demo_date' and slot_booked='Y'\");\n\t\tif($slots[0]['tot'] > 0)\n\t\t\treturn $slots[0]['tot']-$booked[0]['tot'];\n\t\telse\n\t\t\treturn 0;\n\t}",
"public function getGrossQtyAllocated()\n {\n return $this->getQtyAllocated() + $this->getQtyDelivered();\n }",
"public function get_total_waiting_list () {\n\t\t$database = $this->db->count_all('waiting_list');\n\t\treturn $database;\n\t}",
"public function getTotalUnitsForSlot(Dominion $dominion, int $slot): int\n {\n return (\n $dominion->{'military_unit' . $slot} +\n $this->queueService->getInvasionQueueTotalByResource($dominion, \"unit{$slot}\")\n );\n }",
"function available() {\n return $this->current_size - $this->pos();\n }"
] | [
"0.8025773",
"0.785454",
"0.7786328",
"0.7704995",
"0.75854415",
"0.72987026",
"0.71237797",
"0.71084017",
"0.7010659",
"0.700093",
"0.69068617",
"0.67777514",
"0.6575135",
"0.64289546",
"0.64258766",
"0.6411252",
"0.637495",
"0.6364862",
"0.6328333",
"0.6322713",
"0.6309381",
"0.6247834",
"0.61967885",
"0.61139023",
"0.61069465",
"0.6077315",
"0.59896356",
"0.5982748",
"0.59726846",
"0.5962115"
] | 0.8517323 | 0 |
Returns total used / in tasking slots | public function getUsedSlots()
{
if (isset(self::$_used['tot'])) {
return (int)self::$_used['tot'];
}
return (int)self::$_used['tot'] = self::getClass('TaskManager')
->count(
array(
'stateID' => self::getProgressState(),
'storagenodeID' => $this->get('enablednodes'),
'typeID' => $this->get('usedtasks'),
)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getQueuedSlots()\n {\n if (isset(self::$_queued['tot'])) {\n return (int)self::$_queued['tot'];\n }\n return (int)self::$_queued['tot'] = self::getClass('TaskManager')\n ->count(\n array(\n 'stateID' => self::getQueuedStates(),\n 'storagenodeID' => $this->get('enablednodes'),\n 'typeID' => $this->get('usedtasks'),\n )\n );\n }",
"public function getFreeSlots() {\n\n // Count number of free slots.\n $jobs = $this->getRunningJobs();\n $running = count($jobs);\n $num_slots = $this->max_slots - $running;\n if ($num_slots < 0) {\n $num_slots = 0;\n }\n return $num_slots;\n }",
"public function getTotalAvailableSlots()\n {\n $tot = (\n $this->getTotalSupportedClients()\n - $this->getUsedSlots()\n - $this->getQueuedSlots()\n );\n if ($tot < 1) {\n return 0;\n }\n return $tot;\n }",
"public function occupiedSlotsCount()\n {\n return $this->model->where('free', 0)->with('vehicle','vehicle.vehicle_type')->get()->sum('vehicle.vehicle_type.slots');\n }",
"public function getFreeSlotsNumber() {\n return self::SLOT_PER_TOWN - $this->buildings->count() - $this->buildingsQueue->count();\n }",
"public function get_slotsInUse(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::SLOTSINUSE_INVALID;\n }\n }\n $res = $this->_slotsInUse;\n return $res;\n }",
"public function getAvailableSlots()\n {\n return $this->availableSlots;\n }",
"public function getTotalAvailable()\n\t{\n\t\treturn $this->total_available;\n\t}",
"public function get_slotsCount(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::SLOTSCOUNT_INVALID;\n }\n }\n $res = $this->_slotsCount;\n return $res;\n }",
"public function getAvailableSpace();",
"public function getUsesRemaining()\n {\n return $this->uses_remaining;\n }",
"public function getAvailable() {\n\t\t$size=$this->getSize();\n\t\t$used=$this->getUsed();\n\t\treturn $size - $used;\n\t}",
"public function getTotalTasks()\n {\n if (array_key_exists(\"totalTasks\", $this->_propDict)) {\n return $this->_propDict[\"totalTasks\"];\n } else {\n return null;\n }\n }",
"protected function computeTotalReservations()\n {\n return\n $this->totalDomesticShippingReservations +\n $this->totalInternationalShippingReservations +\n $this->totalTruckingReservations +\n $this->totalCustomsBrokerReservations +\n $this->totalWarehouseReservations;\n }",
"public function getUsedSlots($slotPeriod = 15) {\n $sql = sprintf('SELECT count(*) FROM `orders` WHERE (restaurantId=%d) AND (deliverTime > date_sub(now(),interval %d minute))', $this->getId(), $slotPeriod);\n return $this->getAdapter()->fetchOne($sql);\n }",
"public function getUsed()\n {\n return $this->used;\n }",
"public function getTotalTasksAttribute()\n {\n return $this->subTasks()->count();\n }",
"public function getTotalAllocated()\n\t{\n\t\treturn $this->total_allocated;\n\t}",
"public function getTotalCapacity()\n {\n return $this->totalCapacity;\n }",
"public function getFreeCapacity() {\n\t\treturn $this->capacity - $this->totalWeight;\n\t}",
"public function getNumberOfUsages()\n {\n return $this->numberOfUsages;\n }",
"public function get_slots_available_count( $timeslots, $ymd ) {\n\t\tstatic $counts = array();\n\n\t\tif ( ! empty( $counts[ $ymd ] ) ) {\n\t\t\treturn $counts[ $ymd ];\n\t\t}\n\n\t\t$orders_remaining_for_day = $this->get_orders_remaining_for_day( $ymd );\n\n\t\tif ( ! $orders_remaining_for_day ) {\n\t\t\t$counts[ $ymd ] = 0;\n\n\t\t\treturn $counts[ $ymd ];\n\t\t}\n\n\t\tglobal $wpdb;\n\n\t\t$timeslot_ids = wp_list_pluck( $timeslots, 'id' );\n\t\t$counts[ $ymd ] = array_fill_keys( $timeslot_ids, 0 );\n\n\t\t$reserved_slots = $wpdb->get_results(\n\t\t\t$wpdb->prepare(\n\t\t\t\t\"SELECT datetimeid, COUNT(datetimeid) as count\n\t\t\t\tFROM {$wpdb->prefix}jckwds\n\t\t\t\tWHERE datetimeid LIKE %s\n\t\t\t\tAND NOT (user_id = %d AND processed = 0)\n\t\t\t\tGROUP BY datetimeid\",\n\t\t\t\t$ymd . '_%',\n\t\t\t\t$this->user_id\n\t\t\t),\n\t\t\tARRAY_A\n\t\t);\n\n\t\tforeach ( $counts[ $ymd ] as $slot_id => $count ) {\n\t\t\t$timeslot = Iconic_WDS_Helpers::search_array_by_key_value( 'id', $slot_id, $timeslots );\n\n\t\t\tif ( ! $timeslot ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$counts[ $ymd ][ $slot_id ] = '' === trim( $timeslot['lockout'] ) ? true : absint( $timeslot['lockout'] );\n\t\t}\n\n\t\tif ( empty( $reserved_slots ) || is_wp_error( $reserved_slots ) ) {\n\t\t\t$counts[ $ymd ] = apply_filters( 'iconic_wds_slots_available_count', $counts[ $ymd ], $ymd, $timeslots );\n\n\t\t\treturn $counts[ $ymd ];\n\t\t}\n\n\t\tforeach ( $reserved_slots as $reserved_slot ) {\n\t\t\t$slot_id = str_replace( $ymd . '_', '', $reserved_slot['datetimeid'] );\n\n\t\t\tif ( ! isset( $counts[ $ymd ][ $slot_id ] ) || true === $counts[ $ymd ][ $slot_id ] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$counts[ $ymd ][ $slot_id ] -= absint( $reserved_slot['count'] );\n\t\t}\n\n\t\t$counts[ $ymd ] = apply_filters( 'iconic_wds_slots_available_count', $counts[ $ymd ], $ymd, $timeslots );\n\n\t\treturn $counts[ $ymd ];\n\t}",
"public function getTotalUnitsForSlot(Dominion $dominion, int $slot): int\n {\n return (\n $dominion->{'military_unit' . $slot} +\n $this->queueService->getInvasionQueueTotalByResource($dominion, \"unit{$slot}\")\n );\n }",
"public function get_total_waiting_list () {\n\t\t$database = $this->db->count_all('waiting_list');\n\t\treturn $database;\n\t}",
"public function count(): int\n {\n return count($this->slots) + 1;\n }",
"public function count() :int\n {\n return count($this->occupiedWorkers) + count($this->freeWorkers);\n }",
"public function getMaxSlots() {\n return $this->max_slots;\n }",
"public function getActiveTaskCount()\n {\n $find = array(\n 'stateID' => self::fastmerge(\n self::getQueuedStates(),\n (array)self::getProgressState()\n ),\n 'hostID' => $this->get('id')\n );\n $count = self::getClass('TaskManager')\n ->count($find);\n return (int)$count;\n }",
"public function getUsedSegments(){\n return $this->usedSegmentsCount;\n }",
"public function getAvailableTasks();"
] | [
"0.7744302",
"0.752495",
"0.732157",
"0.7122487",
"0.70729244",
"0.6810507",
"0.6613635",
"0.6492509",
"0.6454629",
"0.63637424",
"0.632128",
"0.63045156",
"0.62724984",
"0.6257848",
"0.62317723",
"0.62258726",
"0.619521",
"0.6148504",
"0.6097036",
"0.60866636",
"0.6065427",
"0.60455316",
"0.60330915",
"0.6008589",
"0.59989583",
"0.59892476",
"0.5981685",
"0.59654325",
"0.59516853",
"0.59292454"
] | 0.87207776 | 0 |
Returns total queued slots | public function getQueuedSlots()
{
if (isset(self::$_queued['tot'])) {
return (int)self::$_queued['tot'];
}
return (int)self::$_queued['tot'] = self::getClass('TaskManager')
->count(
array(
'stateID' => self::getQueuedStates(),
'storagenodeID' => $this->get('enablednodes'),
'typeID' => $this->get('usedtasks'),
)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function queueTotal()\n {\n return count($this->queue);\n }",
"public function getFreeSlots() {\n\n // Count number of free slots.\n $jobs = $this->getRunningJobs();\n $running = count($jobs);\n $num_slots = $this->max_slots - $running;\n if ($num_slots < 0) {\n $num_slots = 0;\n }\n return $num_slots;\n }",
"public function getTotalAvailableSlots()\n {\n $tot = (\n $this->getTotalSupportedClients()\n - $this->getUsedSlots()\n - $this->getQueuedSlots()\n );\n if ($tot < 1) {\n return 0;\n }\n return $tot;\n }",
"public function getUsedSlots()\n {\n if (isset(self::$_used['tot'])) {\n return (int)self::$_used['tot'];\n }\n return (int)self::$_used['tot'] = self::getClass('TaskManager')\n ->count(\n array(\n 'stateID' => self::getProgressState(),\n 'storagenodeID' => $this->get('enablednodes'),\n 'typeID' => $this->get('usedtasks'),\n )\n );\n }",
"private function queuedItems()\n {\n return Capsule::table('steam_queue')\n ->where('status', 'queued')\n ->count();\n }",
"public function getFreeSlotsNumber() {\n return self::SLOT_PER_TOWN - $this->buildings->count() - $this->buildingsQueue->count();\n }",
"private function getQueueCount() : int {\n $this->refreshQueue();\n return $this->queue->numberOfItems();\n }",
"public function getQueueLength()\n {\n $all = $this->em->getRepository('App:Queue')->tableSize();\n return isset($all[0]['total']) ? $all[0]['total'] : 0;\n }",
"private function getQueueCount() {\n $this->refreshQueue();\n // Get the number of items.\n $number_of_queue = $this->queue->numberOfItems();\n // Wipe things clean so tests are not sitting in the queue later.\n $this->deleteQueue();\n return $number_of_queue;\n }",
"function countQueued($params = NULL) {\n return Notifications_Queue::queue_count($params);\n }",
"public function get_slotsCount(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::SLOTSCOUNT_INVALID;\n }\n }\n $res = $this->_slotsCount;\n return $res;\n }",
"public function getTotalRequestsCount()\n {\n return count($this->queue);\n }",
"public function get_total_waiting_list () {\n\t\t$database = $this->db->count_all('waiting_list');\n\t\treturn $database;\n\t}",
"public function getAvailableSlots()\n {\n return $this->availableSlots;\n }",
"public function getQueuedInboundCount()\n\t{\n\t\t$qd = $this->getQueueDepthData();\n\t\treturn $qd->getInboundCount();\n\t}",
"public function getQueueSize(): int\n {\n return count($this->queue);\n }",
"public function count(): int\n {\n return count($this->slots) + 1;\n }",
"public function occupiedSlotsCount()\n {\n return $this->model->where('free', 0)->with('vehicle','vehicle.vehicle_type')->get()->sum('vehicle.vehicle_type.slots');\n }",
"public function get_slotsInUse(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::SLOTSINUSE_INVALID;\n }\n }\n $res = $this->_slotsInUse;\n return $res;\n }",
"public function getMaxSlots() {\n return $this->max_slots;\n }",
"public function count()\n {\n return $this->queue->count();\n }",
"public function getQueuedStatusCount()\n\t{\n\t\t$qd = $this->getQueueDepthData();\n\t\treturn $qd->getStatusCount();\n\t}",
"public function waitingCount()\n {\n return $this->get('current-waiting', 0);\n }",
"public function getQuantityAvailable()\n {\n return $this->quantityAvailable;\n }",
"public function getNetQtyAllocated()\n {\n return $this->getQtyAllocated();\n }",
"public function getRequestedQuantity()\n {\n return $this->requestedQuantity;\n }",
"public function count() :int\n {\n return count($this->occupiedWorkers) + count($this->freeWorkers);\n }",
"public function getTotalAvailable()\n\t{\n\t\treturn $this->total_available;\n\t}",
"public function outQueueLength()\n {\n return $this->getSNMP()->walk1d( self::OID_IF_OUT_QUEUE_LENGTH );\n }",
"public static function getTeamsQty()\n {\n \treturn count(self::getAllTeams());\n }"
] | [
"0.75007033",
"0.74926096",
"0.7484992",
"0.7454183",
"0.73664546",
"0.6958229",
"0.6905459",
"0.6813791",
"0.68060434",
"0.66024554",
"0.6582179",
"0.65812844",
"0.65608215",
"0.6486061",
"0.6478509",
"0.6471",
"0.64230835",
"0.6349627",
"0.63432443",
"0.6328846",
"0.62644285",
"0.6261333",
"0.6208126",
"0.60767686",
"0.605993",
"0.60527927",
"0.60421574",
"0.60309756",
"0.59917724",
"0.59895486"
] | 0.86277723 | 0 |
Returns total supported clients | public function getTotalSupportedClients()
{
if (isset(self::$_tot['tot'])) {
return (int)self::$_tot['tot'];
}
return (int)self::$_tot['tot'] = self::getSubObjectIDs(
'StorageNode',
array('id' => $this->get('enablednodes')),
'maxClients',
false,
'AND',
'name',
false,
'array_sum'
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNumClients()\n {\n return $this->num_clients;\n }",
"public function nbClient(){\n $client = Client_produit::get();\n return $client->count();\n }",
"public function getClientCount() \n {\n return Client::count();\n }",
"public function getNbClients()\n {\n $db = $this->dbConnect();\n $nbClientsreq = $db->query('SELECT id FROM users WHERE id_groupe = 3');\n $nbClients = $nbClientsreq->rowCount();\n return $nbClients;\n }",
"public function getNumClient()\n {\n return $this->numClient;\n }",
"public function donneNbClients()\n\t\t{\n\t\treturn $this->tousLesClients->nbClients();\n\t\t}",
"public function getClientsNumberAttribute()\n {\n return $this->clients()->count();\n }",
"public function getSupportedEmailClients()\n {\n $url = self::INSTANT_BASE_URI . '/clients';\n\n $response = $this->getClient()->request('GET', $url);\n\n return $this->getResult($response);\n }",
"public function get_clients() {\n\n return $this->make_request( 'clients' );\n\n }",
"public function get_all_clients() {\n\t\t\t$request = $this->base_uri . '/clients?output=' . static::$output;\n\t\t\treturn $this->fetch( $request );\n\t\t}",
"public function get_count_for_options()\n {\n // Import software:\n $l_software_dao = new isys_jdisc_dao_software($this->m_db, $this->m_dao->get_connection());\n $l_return['software_counter'] = $l_software_dao->count_software();\n\n // Import layer 3 nets:\n $l_network_dao = new isys_jdisc_dao_network($this->m_db, $this->m_dao->get_connection());\n $l_return['network_counter'] = $l_network_dao->count_networks();\n\n // Import cluster:\n $l_cluster_dao = new isys_jdisc_dao_cluster($this->m_db, $this->m_dao->get_connection());\n $l_return['cluster_counter'] = $l_cluster_dao->count_cluster();\n\n // Import blade chassis:\n $l_device_dao = new isys_jdisc_dao_devices($this->m_db, $this->m_dao->get_connection());\n $l_return['blade_connections_counter'] = $l_device_dao->count_chassis_connections();\n\n return $l_return;\n }",
"public static function obtenerCantidadClientes(){\n try {\n $conexion = new Conexion();\n $sql = \"SELECT count(*) as cantidad FROM \".self::TABLA.\" WHERE estado = 1\";\n $consulta = $conexion->prepare($sql);\n $consulta->execute();\n $registros = $consulta->fetch();\n return $registros;\n } catch (Exception $e) {\n }\n }",
"public function test_number_of_clients() {\n\n $this->actingAs($this->user)\n ->assertEquals(2, CampaignStatistics::numberOfClients($this->campaign->number, $this->campaign->year));\n }",
"public static function getCountAllTblclientesRegistrados(){ \n\t\t$invitado=1;\n\t\t$check = \"SELECT COUNT(*) FROM tblcliente WHERE tbltipocliente_idtbltipocliente= ? \";\n\n\t\ttry{\n\t\t\t$resultado = ConexionDB::getInstance()->getDb()->prepare($check);\n\t\t\t$resultado->bindParam(1,$invitado,PDO::PARAM_INT);\t\t\t\n\t\t\t$resultado->execute();\n\t\t\treturn $resultado->fetchColumn(); //retorna el numero de count\n\t\t}catch(PDOException $e){\n\t\t\treturn false;\n\t\t}\n\t}",
"public function index()\n {\n return $this->clientInterface->getAllClients();\n }",
"public function totalDBClients(Request $request)\n {\n $totalUsersInDB = DB::connection('mysql2')->table('clients')->count();\n $return = $this->generateResponse('DONE', '200');\n $return['body']['db_users_count'] = $totalUsersInDB;\n\n return response()->json($return, 200);\n }",
"public function get_sorted_clients() {\n \n $this->popular_clients();\n \n return $this->s_clients;\n \n }",
"function fetchSubscriptionListCount()\n {\n return array( 'result' => eZSubscriptionList::count() );\n }",
"public function getClients()\r\n {\r\n return $this->clients;\r\n }",
"public function get_clients()\n {\n $sql = \"SELECT * FROM clients Client \";\n return $this->query($sql);\n }",
"public function clientList ()\n {\n $clients_number = $this->Client->find('count');\n \n $current_page = 1;\n $max_per_page = 20;\n $total_pages = $this->getNumberOfPages($clients_number,$max_per_page);\n \n $clients = $this->getPaginatedList($max_per_page, $current_page);\n $this->set(array ('clients', 'total_pages', 'current_page', 'max_per_page'), array ($clients, $total_pages, $current_page, $max_per_page));\n \n }",
"abstract public function getTotalConnectedUsers();",
"public function getClientes()\n {\n $query = $this->db->query(\"SELECT * FROM clientes\");\n\n $resultado = $query->result_array();\n if($resultado == NULL)\n {\n return 0;\n }\n else\n {\n return $resultado;\n }\n }",
"private function popular_clients() {\n \n $query = \"SELECT c1, c2, c3, c4, c5 FROM entry\";\n \n $arr = array();\n \n $unfiltered = $this->db->get_query($query, $arr);\n \n $this->u_clients = $unfiltered;\n \n $this->sort_clients();\n \n }",
"public function getDriversOnlineCountAttribute()\n {\n return $this->drivers()->where('online', 1)->count();\n }",
"public function findClients() {\n $this->load->model('frontend\\Client');\n $connexion = BddConnexion::getInstance();\n $bdd = new ClientManager($connexion->handle());\n $clients = $bdd->getList();\n\n if (is_null($clients))\n $msgClient = \"Aucun client n'a été trouvé\";\n return $clients;\n }",
"public function countCommercial(){\n\t\t\t\t\t return count($this->listeCommercial());\n\t\t\t\t\t }",
"public function GetOns()\n {\n global $db;\n $ad = $db->query(\"SELECT * FROM users WHERE online = '1'\");\n\t\t$add = $ad->num_rows;\n\t\t//if($add >= 10){$add = $add;}else{$add = \"Muchos\";}\n\t\treturn $add;\n }",
"public function getCustomerCount();",
"function get_all_client()\r\r\n {\r\r\n \t$query = $this->db->get();\r\r\n\r\r\n \treturn $query->result();\r\r\n }"
] | [
"0.7263664",
"0.7244668",
"0.7220061",
"0.69313264",
"0.6904375",
"0.6692692",
"0.66567177",
"0.6251243",
"0.61229706",
"0.6091821",
"0.606119",
"0.60492975",
"0.60377157",
"0.60124755",
"0.5958051",
"0.5953523",
"0.59116495",
"0.5865261",
"0.58512753",
"0.5797986",
"0.5757799",
"0.573735",
"0.5735444",
"0.5723197",
"0.57190454",
"0.5715963",
"0.5714827",
"0.57145953",
"0.569734",
"0.56918836"
] | 0.85765237 | 0 |
Get's the groups master storage node | public function getMasterStorageNode()
{
$masternode = self::getSubObjectIDs(
'StorageNode',
array(
'id' => $this->get('enablednodes'),
'isMaster' => 1,
)
);
$masternode = array_shift($masternode);
if (!($masternode
&& is_numeric($masternode)
&& $masternode > 0)
) {
$masternode = @min($this->get('enablednodes'));
}
if (!$masternode > 0) {
$nodeids = self::getSubObjectIDs(
'StorageNode',
array(
'id' => $this->get('allnodes'),
'isEnabled' => 1,
'isMaster' => 1
)
);
if (count($nodeids) < 1) {
$nodeids = self::getSubObjectIDs(
'StorageNode',
array(
'id' => $this->get('allnodes'),
'isEnabled' => 1
)
);
}
$masternode = @min($nodeids);
}
return new StorageNode($masternode);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function getStorageGroup(): string;",
"public function getMaster();",
"public function getMaster();",
"public static function Get_StorageGroup()\r\n {\r\n $extension = self::$extension;\r\n return $extension->GetSettingValue(\"StorageGroup\");\r\n }",
"function getConsulRedisMaster()\n{\n $master = null;\n $result = json_decode(getCurlRequest(CONSUL_BASE_URL . '/v1/catalog/service/redis?tag=master'), true);\n if(count($result))\n $master = $result[0]['Address'] . ':' . $result[0]['ServicePort'];\n return $master;\n}",
"public function getOptimalStorageNode()\n {\n $getter = 'enablednodes';\n if (count($this->get('enablednodes')) < 1) {\n $getter = 'allnodes';\n }\n $winner = null;\n foreach ((array)self::getClass('StorageNodeManager')\n ->find(\n array('id' => $this->get($getter))\n ) as &$Node\n ) {\n if ($Node->get('maxClients') < 1) {\n continue;\n }\n if ($winner == null\n || $Node->getClientLoad() < $winner->getClientLoad()\n ) {\n $winner = $Node;\n }\n unset($Node);\n }\n if (empty($winner)) {\n $winner = new StorageNode(@min($this->get('enablednodes')));\n }\n return $winner;\n }",
"public function get_master_dn()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n return \"cn=Master,ou=Servers,\" . $this->get_base_dn();\n }",
"public function getOptimalStorageNode()\n {\n return $this->get('optimalStorageNode');\n }",
"public function masters()\n {\n return $this->_client->sentinel('masters');\n }",
"protected function _getGroup()\n\t{ \n\t $group = $this->_mixer->getIdentifier();\n\t return $group;\n\t}",
"public function group() {\n return entity_load($this->group_type, $this->gid);\n }",
"public function getGroup()\n {\n $this->getTopology();\n return $this->group;\n }",
"public function getGroup() {\n return $this->system->groupByID(posix_getgid());\n }",
"public function getMasterDB()\n {\n return $this->masterDB->database_name;\n }",
"function getGroup() { return $this->_repo->getGroup($this->_groupid); }",
"public function getRootStorage() {\n return @$this->attributes['root_storage'];\n }",
"function ocs_admin_master_load( $master_number)\n{\n db_set_active('ocsdb');\n\n $query = db_select( 'ocs_account', 'g');\n $result = $query->fields( 'g')\n ->condition( 'account_key', $master_number, '=')\n ->condition( 'status', '1', '=')\n ->execute();\n\n $member = $result->fetchAssoc();\n\n db_set_active('default');\n return $member;\n}",
"public function getGroup()\n\t{\n\t\treturn $this->groups[$this->extension];\n\t}",
"public function getGroup() {\n $group_id = filegroup($this->__full_path);\n $group_info = posix_getgrgid($group_id);\n return $group_info[\"name\"];\n }",
"public function getGroup()\n {\n return 91;\n }",
"public function getPrimaryGroup();",
"public function getRootNodeName()\n {\n return __('Storage Root');\n }",
"public function getMaster($name){\n \n $info = $this->getClient()->info();\n \n $i = 0;\n while (isset($info['master'. $i])) {\n $params = $this->extract($info['master'. $i]);\n \n if (isset($params['name']) && $params['name'] === $name && isset($params['address'])){\n return array($params['address']['host'], $params['address']['port']);\n }\n \n ++$i;\n }\n \n throw new SentinelError('The sentinel does not know the master address');\n }",
"public function getGroup() {}",
"function getGroup(){\n\t\t\treturn $this->group;\n\t\t}",
"public function master($name)\n {\n return $this->_client->sentinel('master', $name);\n }",
"public function getGroup() {\n if(!isset($this->group)) \n {\n $mapper = new Application_Model_GroupsMapper();\n $this->group = $mapper->findWherePriKeyEquals($this->groups_id);\n }\n return $this->group;\n }",
"public function get_master_hostname()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (is_null($this->config))\n $this->_load_config();\n\n $hostname = (empty($this->config['master_hostname'])) ? '' : $this->config['master_hostname'];\n\n return $hostname;\n }",
"public function getGroup($refreshcache = true) {\n\t$this->loadStatInfo($refreshcache);\n\treturn $this->stat['gid'];\n}",
"public function getThisNode()\n {\n $this->set('storagenode', self::getClass('StorageNode'));\n self::getIPAddress();\n foreach ((array)self::getClass('StorageNodeManager')\n ->find(array('isEnabled' => 1)) as &$StorageNode\n ) {\n $ip = self::resolveHostname($StorageNode->get('ip'));\n if (!in_array($ip, self::$ips)) {\n continue;\n }\n $this->set('storagenode', $StorageNode);\n break;\n }\n if (!$this->get('storagenode')->isValid()) {\n throw new Exception(\n _('No node associated with any addresses of this system')\n );\n }\n }"
] | [
"0.655709",
"0.64532906",
"0.64532906",
"0.60986865",
"0.59706986",
"0.5940118",
"0.5884769",
"0.5877884",
"0.5775137",
"0.56662065",
"0.55849105",
"0.5580915",
"0.5580425",
"0.5577684",
"0.5574496",
"0.5534926",
"0.55181503",
"0.5504441",
"0.54562473",
"0.5443489",
"0.544093",
"0.5394033",
"0.53667986",
"0.53584474",
"0.53564775",
"0.53525966",
"0.5349475",
"0.5291933",
"0.52898985",
"0.5282685"
] | 0.7307616 | 0 |
Get's the optimal storage node | public function getOptimalStorageNode()
{
$getter = 'enablednodes';
if (count($this->get('enablednodes')) < 1) {
$getter = 'allnodes';
}
$winner = null;
foreach ((array)self::getClass('StorageNodeManager')
->find(
array('id' => $this->get($getter))
) as &$Node
) {
if ($Node->get('maxClients') < 1) {
continue;
}
if ($winner == null
|| $Node->getClientLoad() < $winner->getClientLoad()
) {
$winner = $Node;
}
unset($Node);
}
if (empty($winner)) {
$winner = new StorageNode(@min($this->get('enablednodes')));
}
return $winner;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getOptimalStorageNode()\n {\n return $this->get('optimalStorageNode');\n }",
"protected function loadOptimalStorageNode()\n {\n $node = $this\n ->getImage()\n ->getStorageGroup()\n ->getOptimalStorageNode();\n $this->set('optimalStorageNode', $node);\n }",
"public function getMasterStorageNode()\n {\n $masternode = self::getSubObjectIDs(\n 'StorageNode',\n array(\n 'id' => $this->get('enablednodes'),\n 'isMaster' => 1,\n )\n );\n $masternode = array_shift($masternode);\n if (!($masternode\n && is_numeric($masternode)\n && $masternode > 0)\n ) {\n $masternode = @min($this->get('enablednodes'));\n }\n if (!$masternode > 0) {\n $nodeids = self::getSubObjectIDs(\n 'StorageNode',\n array(\n 'id' => $this->get('allnodes'),\n 'isEnabled' => 1,\n 'isMaster' => 1\n )\n );\n if (count($nodeids) < 1) {\n $nodeids = self::getSubObjectIDs(\n 'StorageNode',\n array(\n 'id' => $this->get('allnodes'),\n 'isEnabled' => 1\n )\n );\n }\n $masternode = @min($nodeids);\n }\n return new StorageNode($masternode);\n }",
"public function getAvailableStorage()\n {\n $globalConfig = $this->getServiceLocator()->get('config');\n $diskSize = null;\n $storageName = '';\n foreach ($globalConfig['storageSettings'] as $dir => $st) {\n if ($diskSize == null) {\n $diskSize = str_replace('M', '', exec('df -h -BM ' . $st['path'] . $dir . ' | awk \\'{print $4}\\''));\n $storageName = $dir;\n continue;\n }\n if ($diskSize > ($currentSire = str_replace('M', '', exec('df -h -BM ' . $st['path'] . $dir . ' | awk \\'{print $4}\\'')))) {\n $diskSize = $currentSire;\n $storageName = $dir;\n }\n }\n return $storageName;\n }",
"public function getStorageUtilizationGibPerNode()\n {\n return $this->storage_utilization_gib_per_node;\n }",
"function get_storage_unit()\r\n {\r\n return $this->storage_unit;\r\n }",
"public function getCapacity()\n {\n return $this->getSpec('resources.requests.storage', null);\n }",
"public function getStorageType();",
"public function getCurrentStorage() {\n return @$this->attributes['current_storage'];\n }",
"protected function __checkFreeStorage(){\n global $CW;\n $cwClient = $CW->getClient();\n \n if(!empty($this->db['DBClusterIdentifier'])){\n ## Aurora Volume auto increase until 128TB as of 23/Sep/2021\n return;\n }else{\n $metric = 'FreeStorageSpace';\n $dimensions = [\n [\n 'Name' => 'DBInstanceIdentifier',\n 'Value'=> $this->db['DBInstanceIdentifier']\n ]\n ];\n }\n \n $results = $cwClient->getMetricStatistics([\n 'Dimensions' => $dimensions,\n 'Namespace' => 'AWS/RDS',\n 'MetricName' => $metric,\n 'StartTime' => strtotime('-5 minutes'),\n 'EndTime' => strtotime('now'),\n 'Period' => 300,\n 'Statistics' => ['Average'],\n # 'Unit' => 'None'\n ]);\n \n $GBYTES = 1024 * 1024 * 1024;\n # __pr($this->db['AllocatedStorage']);\n $dp = $results->get('Datapoints');\n $freesize = round($dp[0]['Average']/$GBYTES, 4);\n \n $ratio = ($freesize / $this->db['AllocatedStorage']);\n if($ratio < 0.2){\n $this->results['FreeStorage20pct'] = [-1, $ratio*100 . ' / ' . $freesize . '(GB)'];\n }\n }",
"public function getStorageType()\n\t{\n\t\treturn 'neo4j';\n\t}",
"public function getThisNode()\n {\n $this->set('storagenode', self::getClass('StorageNode'));\n self::getIPAddress();\n foreach ((array)self::getClass('StorageNodeManager')\n ->find(array('isEnabled' => 1)) as &$StorageNode\n ) {\n $ip = self::resolveHostname($StorageNode->get('ip'));\n if (!in_array($ip, self::$ips)) {\n continue;\n }\n $this->set('storagenode', $StorageNode);\n break;\n }\n if (!$this->get('storagenode')->isValid()) {\n throw new Exception(\n _('No node associated with any addresses of this system')\n );\n }\n }",
"function getStorage();",
"protected function getStorage() {\n\t\treturn $this->storage;\n\t}",
"public function get_storage() {\n\t\tif (!empty($this->_storage)) return $this->_storage;\n\t}",
"public function get_storage()\n {\n return $this->storage;\n }",
"public function getStorageUsed()\n {\n if (is_null($this->storageUsed)) {\n $this->storageUsed = 0;\n\n $result = DB::table('textures')\n ->select(DB::raw('SUM(size) AS total_size'))\n ->where('uploader', $this->uid)\n ->first()->total_size;\n\n $this->storageUsed = $result ?: 0;\n }\n\n return (int) $this->storageUsed;\n }",
"public function getRootStorage() {\n return @$this->attributes['root_storage'];\n }",
"function get_storage_space()\n{\n global $nsisweb;\n $path = $nsisweb->get_base_url().'/uploads';\n return array(UPLOAD_SPACE_ALLOWED*1024*1024,(int)(`du -b $path`));\n}",
"public function getStorage();",
"public function getStorage();",
"public function getHighWaterStorage() {\n return @$this->attributes['high_water_storage'];\n }",
"public function getAvailableSpace();",
"public function getStorage()\n {\n return $this->storage;\n }",
"public function getStorage()\n {\n return $this->storage;\n }",
"function getStorageType()\n {\n phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');\n }",
"function getBestDistance(){\n\t\treturn $this->bestDistance;\n\t}",
"protected function getStorage()\n {\n if (!$this->_storage)\n {\n $config = Config::getInstance();\n $this->_storage = $config->getStorage(\"storage\");\n }\n return $this->_storage;\n }",
"public function getStorageType()\n {\n return $this->_storageType;\n }",
"function get_server_hdd_space(){\n \n $free = disk_free_space(\"/var/www/\")\n // $free = (string)trim($free);\n // $free_arr = explode(\"\\n\", $free);\n // $mem = explode(\" \", $free_arr[1]);\n // $mem = array_filter($mem);\n // $mem = array_merge($mem);\n // $memory_free = (($mem[1]-$mem[2])*100/$mem[1]); \n \n // return sprintf('%.2f',$memory_free);\n return sprintf('%.2f',$free);\n}"
] | [
"0.87036556",
"0.73028755",
"0.63203216",
"0.6309235",
"0.6197763",
"0.6171577",
"0.59831524",
"0.5910162",
"0.5759245",
"0.5700235",
"0.5686058",
"0.5677003",
"0.5669578",
"0.5629532",
"0.5628991",
"0.5563998",
"0.55603576",
"0.5560044",
"0.5554899",
"0.55218333",
"0.55218333",
"0.55217",
"0.5489191",
"0.54416007",
"0.5360072",
"0.53281856",
"0.5325541",
"0.5309245",
"0.52806705",
"0.52566713"
] | 0.8346509 | 1 |
Adds a new tag for a template in the database | public function add($template, $tag)
{
if ($template instanceof Template) {
$ref = $template->getRef();
} else {
$ref = (int) $template;
}
$req = 'CALL addTag(:template, :tag)';
$sth = DAO::getDB()->prepare($req);
$sth->bindParam(':template', $ref, PDO::PARAM_INT);
$sth->bindParam(':tag', $tag);
$sth->execute();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addTag($tag);",
"function create_new_tag($tag){\n include('connection.php');\n $sql = 'INSERT INTO tags (tag) VALUES (lower(?))';\n try {\n $results = $db -> prepare($sql);\n $results -> bindValue(1, $tag, PDO::PARAM_STR);\n $results -> execute();\n } catch (Exception $e) {\n echo \"Error: \" . $e -> getMessage() . '<br/>';\n return false;\n }\n return true;\n }",
"function tags_add($tag) {\n if (!tags_is_valid($tag)) return false;\n $id = tags_get_id($tag);\n if ($id) {\n db_query('UPDATE tags SET num = num + 1 WHERE id = %d', $id);\n } else {\n db_query('INSERT INTO tags SET name = %s, num = 1', $tag);\n }\n return true;\n}",
"function addTag($text) {\r\n\t\r\n\t\tglobal $CONN, $CONFIG;\r\n\r\n\t\t//first see if tag already exists\r\n\t\t$text = strip_tags($text);\r\n\t\t$tag_key = $this->getTagKey($text);\r\n\t\tif ($tag_key!=false || empty($text)) {\r\n\t\t\treturn $tag_key;\t\r\n\t\t} else {\r\n\t\t\t$CONN->Execute(\"INSERT INTO {$CONFIG['DB_PREFIX']}tags(text) VALUES ('$text')\");\r\n\t\t\t\r\n\t\t\treturn $CONN->Insert_ID();\r\n\t\t}\t\r\n\t\t\r\n\t}",
"public function creating($tag)\n {\t\n\t\tparent::creating($tag);\n\n Log::Debug(\"Creating tag\", ['tag' => $tag->id]);\n }",
"public function addTag(string $tag): void;",
"public function addTag($tag) {\n $this->changes[] = [\n 'type' => 'tag',\n 'add' => $tag\n ];\n }",
"private function addTagsToQuestion()\n {\n $this->di->dispatcher->forward([\n 'controller' => 'question-tag',\n 'action' => 'add',\n 'params' => [$this->lastInsertedId, $this->Value('tags')]\n ]);\n }",
"public function addTag($tag) \n {\n $this->tags[] = $tag; \n }",
"function add() {\n\t\t$this->Structures->set('template');\n\t\t\n\t\t// CUSTOM CODE: FORMAT DISPLAY DATA\t\t\n\t\t$hook_link = $this->hook('format');\n\t\tif( $hook_link ) { require($hook_link); }\n\t\t\n\t\tif ( !empty($this->request->data) ) {\n\t\t\t$submitted_data_validates = true;\n\t\t\t\n\t\t\t$this->Template->setOwnerAndVisibility($this->request->data);\n\t\t\t\n\t\t\t$hook_link = $this->hook('presave_process');\n\t\t\tif( $hook_link ) { \n\t\t\t\trequire($hook_link); \n\t\t\t}\t\n\t\t\t\n\t\t\tif ( $submitted_data_validates && $this->Template->save($this->request->data)){\n\t\t\t\t$template_id = $this->Template->getLastInsertId();\n\t\t\t\t$this->atimFlash(__('your data has been saved'),'/Tools/Template/edit/'.$template_id );\n\t\t\t}\n\t\t}\n\t}",
"public function addTags($tagData) {\n $this->db->insert_batch('tags', $tagData);\n }",
"public function insert() {\n\t\n\t\tif (isset($this->tag_title)) {\n\t\t\n\t\t\t$sql = \t\"insert into \".$this->table_name.\" (tag_title) \".\n\t\t\t\t\t\"values ('\".$this->tag_title.\")\";\n\t\t\t\n\t\t\tconnection::getConnection()->doExec($sql);\n\t\t\n\t\t\t$this->tag_id = connection::getConnection()->lastInsertID();\n\t\t}\n\t}",
"public function register_tag()\n {\n $this->template->load('admin_temp','register_tag');\n }",
"function add_tag( $data ) {\n $this->load->database('default');\n \n $this->db->insert('tag', $data);\n \n $message = FALSE;\n \n //check if errors were encountered while inserting\n if( $this->db->_error_message() ): \n $message['type'] = \"error\";\n $message['body'] = $this->db->_error_message();\n else:\n $message['type'] = \"success\";\n $message['body'] = \"Successfully added Hadith Tag.\";\n endif;\n \n return $message;\n }",
"function tagsHandler($tag, $post_id)\n\t{\n\t\t$selectID = \"SELECT `id` FROM `tags` WHERE `name` = '\".$tag['name'].\"'\";\n\t\t$insert = \"INSERT INTO `tags` (`name`) VALUES ('\".$tag['name'].\"')\";\n\t\t\n\t\tdebug($selectID);\n\t\t$tag_existing = $this->query($selectID);\n\t\t\t// $tag_existing = $this->query();\n\t\n\n\t\tif(empty($tag_existing))\n\t\t{\n\t\t\t$this->query(\"INSERT INTO `tags` (`name`) VALUES ('\".$tag['name'].\"')\");\n\t\t}\n\t\t\t\n\t\t$tag_id = 1;\n\t\t$this->query(\"INSERT INTO `tags_posts` (post_id, tag_id) VALUES ('\".$post_id.\"', '\".$tag_id.\"')\");\n\t}",
"public function addTag($tag)\n {\n $this->tags[] = $tag;\n }",
"public function addTag($tag)\n {\n $this->tags[] = $tag;\n }",
"function addTags($string){\n\t\t\t\n\t\t\t\n\t\t\t\tif($stmt = $this->con->prepare(\"INSERT INTO TAGS (TagName) VALUES ( ?)\")){\n\t\t\t\t$stmt->bind_param(\"s\", $string);\n\t\t\t\n\n\t\t\tif($stmt->execute())\n\t\t\t\treturn true; \n\t\t\treturn false; \n\t\t}else {\n \t$error = $this->con->error. ' ' . $this->con->errno;\n \techo $error; // 1054 Unknown column 'foo' in 'field list'\n\t\t}\n\t\t}",
"public function addTag(Tx_Addresses_Domain_Model_Tag $tag) {\n \t\t$this->tags[] = $tag;\n\t}",
"public function created($tag)\n {\n parent::created($tag);\n\n Log::Info(\"Created tag\", ['tag' => $tag->id]);\n }",
"private function createTag($tag_name) {\n $this->core->db->insert('tags', array('tag_name' => $tag_name));\n \n return $this->core->db->last_insert_id();\n }",
"function addTemplate($template_data) {\r\n\t\r\n\t\tglobal $CONN, $CONFIG;\r\n\r\n\t\t$name\t\t\t= $template_data['name'];\r\n\t\t$description\t= $template_data['description'];\r\n\t\t$summary_fields\t= $template_data['summary_fields'];\r\n\t\t$date_added\t = $CONN->DBDate(date('Y-m-d H:i:s'));\t\r\n\t\t\r\n\t\tif ($template_data['referer']=='admin') {\r\n\t\t\r\n\t\t\t$type_key=0;\r\n\t\t\r\n\t\t} else {\r\n\t\t\r\n\t\t\t$type_key = 1;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t$CONN->Execute(\"INSERT INTO {$CONFIG['DB_PREFIX']}kb_templates(type_key, name, description, summary_fields, added_by_key, date_added) VALUES ('$type_key', '$name', '$description', '$summary_fields', '$this->_user_key', $date_added)\");\r\n\t\t\r\n\t\techo $CONN->ErrorMsg();\r\n\t\t\r\n\t\t$template_key = $CONN->Insert_ID();\r\n\t\treturn $template_key;\r\n\t\t\t\t\t\t\r\n\t}",
"public function createTagMap()\n {\n $this->create(array(\n 'lesson_id' => $this->getLesson(),\n 'tag_id' => $this->getTag()\n ));\n }",
"public function addTemplate(Template $template)\n {\n $id = $template->getId();\n $this->templates[$id] = $template;\n }",
"public function addTag($tag) {\n $this->tag[] = strtolower($tag);\n }",
"public function addTemplateBit($tag,$bit,$replacements)\n{\n\t$this->bits[$tag]=array('template'=>$bit,'replacements'=>$replacements);\n}",
"public function addTag($tagId) {\n $id = $this->getId();\n if ($id === null) {\n return;\n }\n\n $table = new Yourdelivery_Model_DbTable_Restaurant_Tag();\n $row = $table->createRow();\n $row->restaurantId = $id;\n $row->tagId = $tagId;\n $row->save();\n\n $cacheTag = sprintf('serviceTags%d', $id);\n Default_Helpers_Cache::remove($cacheTag);\n }",
"function addTemplate( &$template ) {\n\t\tob_start();\n\t\t$template->execute();\n\t\t$this->addHtml( ob_get_contents() );\n\t\tob_end_clean();\n\t}",
"private function create_relation_tag(){\n $Tag = new Tag();\n $Tag->set_ids($this->tags);\n $Tag->set_post($this->id);\n $Tag->create_relation();\n }",
"private function addTag($tag_id, $object_id, $object_area, $object_module) {\n return $this->core->db->insert('tags_to_objects', \n array( 'tag_id' => $tag_id, \n 'object_id' => $object_id, \n 'object_area' => $object_area,\n 'object_modul' => $object_module)\n );\n }"
] | [
"0.6613267",
"0.64908034",
"0.6317976",
"0.62531656",
"0.6231304",
"0.61828595",
"0.6138588",
"0.6114039",
"0.60951656",
"0.6023212",
"0.59256667",
"0.59145373",
"0.5898822",
"0.5866547",
"0.5862712",
"0.58504146",
"0.58504146",
"0.58037424",
"0.5802499",
"0.5801828",
"0.57846946",
"0.5764685",
"0.5754926",
"0.57467425",
"0.5729577",
"0.5707079",
"0.5706325",
"0.5683049",
"0.56787217",
"0.5677319"
] | 0.74150807 | 0 |
Deletes an existing template's tag from the database | public function delete($template, $tag)
{
if ($template instanceof Template) {
$ref = $template->getRef();
} else {
$ref = (int) $template;
}
$req = 'DELETE FROM pw_t_tag WHERE tt_template = :ref AND tt_tag = :tag';
$sth = DAO::getDB()->prepare($req);
$sth->bindParam(':ref', $ref, PDO::PARAM_INT);
$sth->bindParam(':tag', $tag);
$sth->execute();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteTag($tag);",
"public function deleting($tag)\n {\n parent::deleting($tag);\n\n Log::Debug(\"Deleting tag\", ['tag' => $tag->id]);\n }",
"public function delete()\n\t{\n\t\t$db = PearDatabase::getInstance();\n\t\t$db->pquery('DELETE FROM vtiger_freetagged_objects WHERE tag_id = ? AND object_id = ?', array($this->get('tag_id'), $this->get('record')));\n\t}",
"public function delete_tag($tag)\n\t{\n\t\t// Not implemented yet\n\t}",
"public function delete()\n {\n $this->forge->deleteNginxTemplate($this->serverId, $this->id);\n }",
"function deleteTemplate(){\n \n $form_data = json_decode(file_get_contents('php://input'));\n $id = $form_data->{'id'};\n $name = $form_data->{'description'};\n $force = $form_data->{'force'};\n \n $this->LookUp->beginTransaction();\n\n $retVal = $this->LookUp->deleteTemplate($id,$force);\n \n if(isset($retVal['tablename']) && $this->checkForErrors('Delete Template Failed. For table: ' . $retVal['tablename'] . \". \", $retVal)){\n $this->LookUp->rollbackTransaction();\n return;\n }else if(null != $retVal && array_key_exists('apperror', $retVal)){\n \n $errorMsg = $retVal['apperror'];\n \n $this->set('frameworkErr', $errorMsg);\n\n $this->LookUp->rollbackTransaction();\n return;\n }\n\n $this->set('name', $name);\n $this->set('frameworkErr', null);\n\n $this->LookUp->endTransaction(); \n \n }",
"function deleteTemplate($template_key) {\r\n\t\r\n\t\tglobal $CONN, $CONFIG;\r\n\t\t\r\n\t\t$CONN->Execute(\"DELETE FROM {$CONFIG['DB_PREFIX']}kb_templates WHERE template_key='$template_key'\");\r\n\t\t\r\n\t\t$CONN->Execute(\"DELETE FROM {$CONFIG['DB_PREFIX']}kb_module_template_links WHERE template_key='$template_key'\");\r\n\t\t\r\n\t\t$CONN->Execute(\"DELETE FROM {$CONFIG['DB_PREFIX']}kb_fields WHERE template_key='$template_key'\");\t\t\r\n\r\n\t\t$rs = $CONN->Execute(\"SELECT entry_key FROM {$CONFIG['DB_PREFIX']}kb_entries WHERE template_key='$template_key'\");\r\n\t\t\r\n\t\twhile (!$rs->EOF) {\r\n\t\t\t\r\n\t\t\t$entry_key = $rs->fields[0];\r\n\t\t\t$this->deleteEntry($entry_key);\r\n\t\t\t$rs->MoveNext();\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\t$rs->Close();\r\n\t\treturn true ;\r\n\t\t\r\n\t}",
"public function delete($template_id = null)\n {\n if($template_id != null)\n {\n \n phpfox::getLib('phpfox.database')->delete($this->_sTable,\n 'template_id = '.$template_id\n );\n }\n }",
"public function destroy($id)\n {\n $template = Template::find($id);\n $template->files()->detach();\n $template->categories()->detach();\n $template->icons()->detach();\n\n $template->delete();\n\n // Reset list order number\n $order_number = 1;\n foreach(Template::orderBy('order_number','asc')->get() as $template){\n $template->order_number = $order_number;\n $template->save();\n $order_number++;\n }\n\n Session::flash('success', 'The template was successfully deleted.');\n\n return redirect()->route('admin.template.index');\n }",
"public static function delete(Tag $tag)\n {\n $tag->delete();\n }",
"protected function _delete()\n { \n $id = (int) $this->id;\n \n //Check if there is a user account associated with this\n \n if ($user = $this->user_id) {\n $user->delete();\n }\n \n $db = get_db();\n \n //Remove all taggings associated with this entity\n $taggings = $db->getTable('Taggings')->findBy(array('entity' => $id));\n \n foreach ($taggings as $tagging) {\n $tagging->delete();\n }\n \n $update_join = \"\n UPDATE $db->EntitiesRelations \n SET entity_id = NULL \n WHERE entity_id = ?\";\n \n $db->exec($update_join, array($id)); \n }",
"public function deleteTemplate(Request $request, Template $template)\n \t{\n \t\t$this->authorize('delete-template', $template);\n \t\t$template->delete();\n\t\treturn response(NULL, 200);\n\t}",
"public function delete_tag(){\r\n\t\t\r\n\t\t/* Get arguments */\r\n\t\t$args = $this->_args;\r\n\t\tif (empty($args)){\r\n\t\t\treturn $this->_redirect('/'.strtolower($this->_getType('plural')));\r\n\t\t}\r\n\t\t\r\n\t\t/* Try associating tag to item */\r\n\t\t$itemsModel = $this->getModel('newitems');\r\n\t\t$itemId = array_shift($args);\r\n\t\t$tag = Request::getString('tag');\r\n\t\t$success = $itemsModel->deleteTag($itemId, $tag);\r\n\t\t\r\n\t\t/* Message */\r\n\t\tif ($success){\r\n\t\t\tMessages::addMessage('<code>'.$tag.'</code> tag removed from '.$this->_getType('singular').' #'.$itemId);\r\n\t\t} else {\r\n\t\t\tMessages::addMessage($this->_getType('singular').' #'.$itemId.' was not changed.', 'error');\r\n\t\t}\r\n\t\t\r\n\t\t/* Redirect to details page */\r\n\t\treturn $this->_redirect('/'.strtolower($this->_getType('plural')).'/details/'.$itemId);\r\n\t\t\r\n\t}",
"public function delete(Vtiger_Request $request)\n\t{\n\t\t$tagModel = new Vtiger_Tag_Model();\n\t\t$tagModel->set('record', $request->get('record'));\n\t\t$tagModel->set('tag_id', $request->get('tag_id'));\n\t\t$tagModel->delete();\n\t}",
"public function deleteByTag($tag)\n {\n if($tagMetaData = $this->getTagMetaData($tag)) {\n foreach($tagMetaData['keys'] as $key) {\n $this->delete($key);\n }\n }\n }",
"public function deleted($tag)\n {\n parent::deleted($tag);\n\n Log::Info(\"Deleted tag\", ['tag' => $tag->id]);\n }",
"public function destroy()\n\t{\n\t\t$tag_id = $this->get('id');\n\n\t\t$comment = $this->toJson();\n\n\t\tforeach ($this->substitutes()->rows() as $row)\n\t\t{\n\t\t\t$row->destroy();\n\t\t}\n\n\t\tforeach ($this->objects()->rows() as $row)\n\t\t{\n\t\t\t$row->destroy();\n\t\t}\n\n\t\t$result = parent::destroy();\n\n\t\tif ($result)\n\t\t{\n\t\t\t$log = Log::blank();\n\t\t\t$log->set('tag_id', $tag_id);\n\t\t\t$log->set('action', 'tag_deleted');\n\t\t\t$log->set('comments', $comment);\n\t\t\t$log->save();\n\t\t}\n\n\t\treturn $result;\n\t}",
"function deleteMapingFromTemplate($selTemplate) {\n\t\t$this -> db -> where('template', $selTemplate);\n\t\tif ($this -> db -> delete($this -> tableName)) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function delete($tag_name, $contact_id)\n {\n $this->Tag->delete($tag_name, $contact_id);\n }",
"public function destroy(Tag $tag)\n {\n //delete attached articles\n if(count($tag->articles)){\n foreach ($tag->articles as $article) {\n $tag->articles()->detach($article);\n }\n }\n $tag->delete();\n return redirect('/admin/tag');\n }",
"public function deleteTemplate($templateId){\n $template = Template::get($templateId);\n $template->setIsDeleted(1);\n $result = $template->update();\n\n return $result;\n }",
"public function removeTemplate($id){\r\n try {\r\n\r\n // @TODO remove all of the 'content assigned' to this template number\r\n \r\n //remove the template form the system\r\n $where = $this->getAdapter()->quoteInto('id = ?', $id);\r\n $result = $this->delete($where);\r\n \r\n // return the right result based on weather we could remove it\r\n if ($result){\r\n return true;\r\n }else{\r\n return 'Unable to find template to delete';\r\n }\r\n } catch (Exception $e) {\r\n echo 'Unable to removeTemplate in Template model: '.$e->getMessage();\r\n }\r\n }",
"public function DeleteByTag($tagName);",
"function drop_template($params) {\n $params = (object) $params;\n $where = empty($params->id) ? \"name = '$params->name'\" : \"id = $params->id\";\n pod_query(\"DELETE FROM @wp_pod_templates WHERE $where LIMIT 1\");\n }",
"public function testDeleteTag() {\n\t\t$tag = $this->_createTag('work');\n\t\t$id = $tag->getId();\n\t\t$tag2 = $this->service->deleteTag($tag);\n\n\t\t$this->assertTrue($tag == $tag, \"'deleteTag' method doesn't return proper object.\");\n\t\t$this->assertInstanceOf('Cvut\\Fit\\BiPwt\\BlogBundle\\Entity\\Tag', $tag2, \"'deleteTag' method doesn't return object of proper class.\");\n\n\t\ttry {\n\t\t\t$tag3 = $this->service->findTag($id);\n\t\t\t$this->assertNull($tag3, \"Deleted tag still can be found.\");\n\t\t} catch(\\Exception $e) {}\n\t}",
"function deleteTags($itemID, $tagID){\n\t\t\t$stmt = $this->con->prepare(\"DELETE FROM Plant_OtherNames WHERE itemID = ? and TagID = ?\");\n\t\t\t$stmt->bind_param(\"is\", $plantID, $tagID);\n\t\t\tif($stmt->execute())\n\t\t\t\treturn true; \n\t\t\treturn false; \n\n\t\t}",
"public function delete()\n {\n if ($this->id == null || $this->id == \"\") {\n throw new ZCRMException(\"Tag ID MUST NOT be null/empty for delete operation\");\n }\n return TagAPIHandler::getInstance()->delete($this->id);\n }",
"public function destroy($id) {\n \ttry {\n \t\t$template = $this->repository->findById($id);\n \t\t\n \t\tif(isset($template->id)){\n\t \t\tif(option('site.template') == $template->zip_name ){\n\t \t\t\t\n\t \t\t\tOption::findByKey('site.template')->update([\n\t \t\t\t\t\t'value' =>'default' ,\n\t \t\t\t]);\n\t \t\t}\n\t \t\t\n\t \t\t$this->repository->delete($id);\n\t \t\t\n\t \t\t//deleting the extracted files also\n\t \t\t$dir = '../resources/views/templates/'.$template->zip_name;\n\t \t\t$assetsDir = '../public/templates/'.$template->zip_name;\n\t \t\ttry{\n\t \t\t\t$deleted = $this->delTree($dir);\n\t \t\t\t$deletedAssets = $this->delTree($assetsDir);\n\t \t\t}catch(\\ErrorException $error){\n\t \t\t\treturn $this->redirect('templates.index')->withFlashMessage('Some error occured while removing the template files');\n\t \t\t}\n \t\t}\n \t\treturn $this->redirect('templates.index');\n \t} catch (ModelNotFoundException $e) {\n \t\treturn $this->redirectNotFound();\n \t}\n }",
"public function deleteTag($tag_id){\n return $this->deleteTagByColumn(\"id\", $tag_id);\n }",
"public function delete_db($id){\n \t// find khusus untuk primary key di database\n \t$emailtemplate = Emailtemplate::find($id);\n \t$emailtemplate->delete();\n\n \treturn redirect('emailtemplate');\n }"
] | [
"0.71714705",
"0.6872038",
"0.68471897",
"0.6799986",
"0.6715634",
"0.66213626",
"0.65904105",
"0.6465614",
"0.6434103",
"0.64217216",
"0.6329786",
"0.6312571",
"0.6300337",
"0.62707627",
"0.6241951",
"0.62208444",
"0.62075484",
"0.6203263",
"0.6187816",
"0.6167304",
"0.6157355",
"0.61502755",
"0.61337805",
"0.61334264",
"0.60918665",
"0.6062471",
"0.6062258",
"0.6045044",
"0.60219765",
"0.6004597"
] | 0.7689366 | 0 |
Finds one address by expression. | protected function findOneAddressBy($expression)
{
if (0 < $this->addresses->count()) {
$criteria = Criteria::create()
->where($expression)
->setMaxResults(1);
$matches = $this->addresses->matching($criteria);
if ($matches->count() == 1) {
return $matches->first();
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function find_address($spec)\n {\n\tforeach ($spec as $x)\n\t{\n\t $ca = $this->get_address($x);\n\t if ($ca->id) break;\n\t}\n\treturn $ca;\n }",
"public function find($expression)\n {\n return Document::find($expression, $this->getElement());\n }",
"public function getSingleAddress()\n {\n $addresses = $this->getAddressList();\n\n return array_shift($addresses);\n }",
"protected function get_register($expression) {\n\n\t\t//replace register addresses with values\n\t\t$tail=$expression; $expression='';\n\t\twhile (preg_match(\"/^(.*?)\\[(\\d+)\\](.*)$/s\",$tail,$m)){\n\t\t\t$expression.= $m[1]; $reg= $m[2]; $tail= $m[3];\n\t\t\t$expression.= $this->registers[$reg];\n\t\t}\n\t\t$expression= '$decimal='.$expression.$tail.';';\n\n\t\t//use eval to evaluate the bitwise logic, nasty\n\t\t//some sort of expression parser is needed there\n\t\teval($expression);\n\n\t\treturn $decimal;\n\t}",
"public function address();",
"public function address();",
"public function _findAddress($cond){\n\t\t$this->recursive = 1;\n\n \t/**\n \t* Inicializa a variavel que guardara as condicoes da busca\n \t*/\n \t$params = array('limit' => LIMIT_SEARCH);\n\n \t/**\n \t* Verifica se o CEP foi informado\n \t*/\n \tif(!empty($cond['zipcode'])){\n \t\t$params['conditions']['Zipcode.code'] = preg_replace('/[^0-9]/', '', $cond['zipcode']);\n \t\t/**\n \t\t* Verifica se os numeros iniciais e finais foram informados\n \t\t*/\n \t\tif(!empty($cond['number_ini'])){\n \t\t\t$cond['number_end'] = !empty($cond['number_end'])?$cond['number_end']:LIMIT_SEARCH;\n \t\t\t$params['conditions']['Address.number BETWEEN ? AND ?'] = array($cond['number_ini'], $cond['number_end']);\n \t\t\t$params['limit'] = $cond['number_end'];\n \t\t\t$params['order'] = 'Address.number';\n \t\t}\n \t}\n\n\t\t$addresses = $this->find('all', $params);\n\n\t\treturn $addresses;\n\t}",
"function get_geolocation_operator ($expression) {\n global $geolocationOperators;\n $found_operator = false;\n \n foreach ($geolocationOperators as $operator) {\n if (strpos($expression, $operator) !== false) {\n $found_operator = $operator;\n break;\n }\n }\n unset($operator);\n \n return $found_operator;\n }",
"public function getFromAddress();",
"public function find(int $id): Address\n {\n return Address::find($id);\n }",
"public function search($expression)\n {\n return Env::search($expression, $this);\n }",
"public function findAddress($street, $type, $hNumber)\n\t{\n\t\t$type = $type? $type : 'փողոց';\n\t\t$hNumber = $hNumber? $hNumber : 0;\n\t\t$street = $this->produceUrlParameter($street);\n\t\t$hNumber = $this->produceUrlParameter($hNumber);\n\t\treturn $this->getContent($this->geoDomain . 'api/param/addresses/' . $street . '/' . $type . '/' . $hNumber);\n\t}",
"function readByNameAddress($name, $address) {\n global $connection;\n $sql = \"SELECT * FROM host WHERE name='${name}' AND address='${address}'\";\n $pdoStm = $connection->query($sql);\n return $pdoStm ? $pdoStm->fetch(PDO::FETCH_ASSOC) : null;\n}",
"public static function findByAddress( $addressArray, $countryCode ) {\n\t\t$addressArray = array_filter( $addressArray );\n\t\t// $req = sprintf( 'http://maps.googleapis.com/maps/api/geocode/json?address=%s®ion=%s&sensor=false', urlencode( implode( ',', $addressArray ) ), $countryCode );\n\t\t// if( !( $response = @file_get_contents( $req ) ) ) {\n\t\t// \tthrow new Exception( sprintf( 'Unable to contact (%s)', $req ) );\n\t\t// }\n\t\t$data = array(\n\t\t\t'address' => implode( ',', $addressArray ),\n\t\t\t'region' => $countryCode,\n\t\t\t'sensor' => 'false'\n\t\t);\n\t\t$params = array();\n\t\tforeach( $data As $param => $paramValue)\n\t\t\t$params[] = urlencode( $param ) . '=' . urlencode( $paramValue );\n\n\t\t$req = new RestfulService( static::API_SERVER, ADDRESSABLE_CACHE_TIMEOUT );\n\t\t$response = $req->request( static::API_SUB_URL . implode( '&', $params ) );\n\t\tswitch( $response->getStatusCode()) {\n\t\t\tcase 200:\n\t\t\t\tif( !( $geoCode = @json_decode( $response->getBody() ) ) ) {\n\t\t\t\t\treturn new Exception( sprintf( 'Unable to decode Address Data: %s', $response->getBody() ) );\n\t\t\t\t}\n\t\t\t\tswitch( $geoCode->status ) {\n\t\t\t\t\tcase static::API_RESPONSE_OK:\n\t\t\t\t\t\t$addressObj = new GoogleMaps_Address_API( $geoCode->results[0] );\n\t\t\t\t\t\treturn $addressObj;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase static::API_RESPONSE_ZERO_RESULTS:\n\t\t\t\t\t\treturn new Exception( sprintf( 'No Results found for: %s', $data[ 'address' ] ) );\n\t\t\t\t\tcase static::API_RESPONSE_OVER_QUERY_LIMIT:\n\t\t\t\t\t\treturn new Exception( 'Addres lookup query limit exceeded' );\n\t\t\t\t\tcase static::API_RESPONSE_REQUEST_DENIED:\n\t\t\t\t\t\treturn new Exception( sprintf( 'Address lookup request denied: %s', $response->getBody() ) );\n\t\t\t\t\tcase static::API_RESPONSE_INVALID_REQUEST:\n\t\t\t\t\t\treturn new Exception( sprintf( 'Invalid address lookup request: %s', $params ) );\n\t\t\t\t\tcase static::API_RESPONSE_UNKNOWN_ERROR:\n\t\t\t\t\t\treturn new Expection( sprintf( 'An unknown error occured during address Lookup: %s', $response->getBody() ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn new Exception( sprintf( 'Error retrieing Address Data: \"%s\"', $response->getBody() ), 1);\n\t\t\t\t\n\t\t}\n\t}",
"public function findDetailsFromCache($arrAddress) {\t\n\t\t$arrCachedData = unserialize($this->cache->get('address_cache'));\n\t\treturn array_search($arrAddress, $arrCachedData);\n\t\t\n\t}",
"public function get_address()\n\t{\n\t\treturn $this->get_first_obj_by_reltype(\"RELTYPE_ADDRESS_ALT\");\n\t}",
"public function getAddress(): Address;",
"abstract protected function getAddress();",
"public function find($identifier);",
"function getAddress1();",
"function arrSearch($array, $expression) {\n\t$result = array();\n\t$expression = preg_replace(\"/([^\\s]+?)(=|<|>|!)/\", \"\\$a['$1']$2\", $expression);\n\ttry {\n\t foreach ($array as $a) {\n\t\t\tif (eval(\"return $expression;\")) {\n\t\t\t\t$result[] = $a;\n\t\t\t}\n\t\t}\n\t} catch (Exception $e) {\n\t echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n\t}\n\treturn $result;\n}",
"public function getResult(string $expression): ResultInterface;",
"public abstract function getAddress();",
"public function getAddress();",
"public function getAddress();",
"public function getAddress();",
"public function getAddress();",
"public function getAddress();",
"public function matchAddr($addr) {\n $sql = 'select CONCAT(address, \\', \\', COALESCE(city_zip, \\'\\')) as address from tax_prop_info where address like \\'%'.$addr.'%\\' limit 10';\n $results = $this->db->query($sql)->result();\n return $results;\n }",
"function search($expression, $data)\n{\n if (!DefaultRuntime::$globalRuntime) {\n DefaultRuntime::$globalRuntime = createRuntime();\n }\n\n return DefaultRuntime::$globalRuntime->search($expression, $data);\n}"
] | [
"0.6319406",
"0.5609863",
"0.5457848",
"0.5453969",
"0.54170763",
"0.54170763",
"0.5381121",
"0.5322059",
"0.5320162",
"0.526975",
"0.52441245",
"0.5217329",
"0.5190175",
"0.51748645",
"0.51549464",
"0.5133289",
"0.51178753",
"0.51103085",
"0.51035136",
"0.5086555",
"0.5075588",
"0.50286466",
"0.5027249",
"0.50250745",
"0.50250745",
"0.50250745",
"0.50250745",
"0.50250745",
"0.50214046",
"0.50142914"
] | 0.77874565 | 0 |
Returns the names of the used traits. | protected function getUsedTraitNames(): array
{
return [
FilterManagerAwareTrait::class,
LoggerAwareTrait::class,
PoolAwareTrait::class,
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUsedTraits(): Collection;",
"public function publicGetTraitNames()\n {\n return parent::getTraitNames();\n }",
"public function getTraits() {\r\n\t\t$out = array();\r\n\t\tforeach ($this->traits as $trait => $class) {\r\n\t\t\t$out[] = get_class($class);\r\n\t\t}\r\n\t\treturn $out;\r\n\t}",
"public function getTraits(): array\n {\n return [];\n }",
"public function getTraits()\r\n {\r\n return array($this->implementationClass);\r\n }",
"public function getClassesAndTraits(): array\n {\n return \\array_merge($this->getClasses(), $this->getTraits());\n }",
"abstract public function getTraits(): array;",
"public function getDeclaredClassesUsingTrait()\n\t{\n\t\t$classes = [];\n\t\tforeach (get_declared_classes() as $class_name) {\n\t\t\tif (in_array($this->name, class_uses($class_name))) {\n\t\t\t\t$classes[$class_name] = new Reflection_Class($class_name);\n\t\t\t}\n\t\t}\n\t\treturn $classes;\n\t}",
"public function getConfiguredTableNames() {\n\t\treturn array_keys($this->definitions);\n\t}",
"public function getNames()\n {\n return array_keys($this->container);\n }",
"public function getInterfaceNames()\n {\n $names = array();\n foreach ( $this->getInterfaces() as $interface )\n {\n $names[] = $interface->getName();\n }\n return $names;\n }",
"public function getClassNames()\n\t{\n\t\treturn array_keys($this->classes);\n\t}",
"public static function names()\n {\n static::initialize();\n\n return array_keys(static::$constants);\n }",
"public function getTypes()\n {\n return array_keys($this->types);\n }",
"public function getNames()\n\t{\n\t\treturn array_keys($this->mergeTemplates);\n\t}",
"public function getTableNames()\n {\n return \\array_keys($this->tables);\n }",
"public function getNames()\n {\n return array_keys((array) $this);\n }",
"public function getTypes() {\n\t\treturn array_keys($this->tca['types']);\n\t}",
"public function allTypes()\n {\n return array_keys($this->_typeIndex);\n }",
"public function getUsedVariables()\n\t{\n\t\treturn array_keys($this->variables);\n\t}",
"public function getFacets() {\n\t\treturn array_keys( $this->facets );\n\t}",
"public function getNames() {\n return array_keys($this->commands);\t\n }",
"public function getFacets()\n {\n return array_keys($this->facets);\n }",
"public function getDescriptorUis()\n {\n return array_keys($this->descriptors);\n }",
"public function traitName(): string\n {\n return $this->traitName;\n }",
"public function getMethods() {\r\n\t\t$out = array();\r\n\t\tforeach ($this->methods as $method) {\r\n\t\t\t$out[] = array(\r\n\t\t\t\t\"trait\"\t\t=> $method->reflect->getName(),\r\n\t\t\t\t\"method\"\t=> $method->method\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $out;\r\n\t}",
"public function getConstantNames()\n\t{\n\t\treturn array_keys($this->constants);\n\t}",
"public function setUsedTraits(Collection $usedTraits): void;",
"public function getOutputNames()\n {\n $outputs = $this->getOutputs();\n\n if ($outputs === null) {\n return null;\n }\n\n return array_keys($outputs);\n }",
"public function keys() {\n\t\treturn array_keys( $this->features );\n\t}"
] | [
"0.7880909",
"0.7546883",
"0.7303516",
"0.6678072",
"0.64503556",
"0.63544506",
"0.63456184",
"0.6328341",
"0.62232065",
"0.62216926",
"0.6122564",
"0.61171633",
"0.61059576",
"0.60804915",
"0.60486704",
"0.6045149",
"0.60034823",
"0.6000843",
"0.59844553",
"0.59735864",
"0.59591204",
"0.59331095",
"0.591988",
"0.5910716",
"0.5828466",
"0.5823094",
"0.5744936",
"0.5697018",
"0.5695996",
"0.5679078"
] | 0.82167506 | 0 |
Changes the image that header_image returns and turns it into a gravatar image | function change_to_gravatar( $image )
{
#$email = "[email protected]";
$email = get_option( 'email' );
$tm = mktime();
return "'http://www.gravatar.com/avatar.php?gravatar_id=". md5( strtolower($email) ) ."&size=110?antiCache=$tm'";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateAvatarGravatar()\n {\n if ($this->getEmail() == '') {\n throw new \\Exception('Unable to generate gravatar profile hash, missing email field for User');\n }\n $hash = md5($this->getEmail());\n $imageUrl = sprintf('http://www.gravatar.com/avatar/%s', $hash);\n $testImageUrl = $imageUrl . '?d=404'; //forces Gravatar to return 404 status code for none existing images\n \n $c = curl_init();\n curl_setopt($c, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($c, CURLOPT_CUSTOMREQUEST, 'HEAD');\n curl_setopt($c, CURLOPT_HEADER, 1);\n curl_setopt($c, CURLOPT_NOBODY, true);\n curl_setopt($c, CURLOPT_URL, $testImageUrl);\n curl_exec($c);\n $statusCode = curl_getinfo($c, CURLINFO_HTTP_CODE);\n \n if ($statusCode === 200) {\n $this->setAvatarGravatar($imageUrl);\n } else {\n $this->setAvatarGravatar('');\n }\n }",
"public function setGravatarPicture($user_id)\n {\n $this->limpid->load->library('Users_Manager', null, 'usersManager');\n $user = $this->limpid->usersManager->getUser($user_id);\n $fileName = uniqid();\n if ($user->avatar == null) {\n $hasGravatar = strpos(@get_headers('https://www.gravatar.com/avatar/' . md5($user->email) . '?d=404')[0], '200') === false ? false : true;\n if ($hasGravatar) {\n if (@file_put_contents('./uploads/avatars/' . $fileName . '.jpg', @file_get_contents('https://www.gravatar.com/avatar/' . md5($user->email) . '?s=' . $this->limpid->config->item('avatar')['max_width']))) {\n $this->limpid->usersManager->editUser($user->id, ['avatar' => $fileName . '.jpg']);\n } else {\n echo'aïe!';\n die();\n }\n }\n }\n }",
"function bavotasan_admin_header_image() {\n\t?>\n\t<div id=\"headimg\">\n\t\t<h1 id=\"site-title\"><?php bloginfo( 'name' ); ?></h1>\n\t\t<h2 id=\"site-description\"><?php bloginfo( 'description' ); ?></h2>\n\t\t<?php if ( $header_image = get_header_image() ) : ?>\n\t\t\t<img src=\"<?php echo esc_url( $header_image ); ?>\" alt=\"\" />\n\t\t<?php endif; ?>\n\t</div>\n\t<?php\n}",
"function gravatar_img($email, $size = null, $rating = null, $default = 'mm')\r\n{\r\n return '<img src=\"'.gravatar($email, $size, $rating, $default).'\" alt=\"Gravatar\" />';\r\n}",
"public function get_user_image() {\r\n\r\n\t\treturn \"assets/\" . \"img/\" . \"profile/\" . \"default/\" . $this->user_image;\r\n\t}",
"private function getGravatar() {\n $user = JFactory::getUser();\n\n // If avatars are turned on, check with gravatar to see if we have an avatar\n if (!$user->guest && JComponentHelper::getParams('com_comments')->get('gravatar')) {\n // Get a empty person row, assign the user id and attempt to load it\n $person = FOFTable::getAnInstance('Person', 'CommentsTable');\n $person->comments_person_id = $user->id;\n $person->load();\n\n require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/gravatar.php';\n $gravatar = new CommentsHelperGravatar($user->email, 404);\n $avatar = $gravatar->getSrc();\n\n // Prepare curl\n require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/curl.php';\n $curl = new CommentsHelperCurl();\n $opt = array(\n CURLOPT_RETURNTRANSFER => true\n );\n $curl->addSession($avatar, $opt);\n\n $image = $curl->exec();\n\n // If gravatar didnt return a 404, then lets copy it to the filesystem and set it on the person row\n if ($image != '404 Not Found') {\n $dest = '/media/com_comments/images/avatars/' . $user->id . '/gravatar.png';\n JFile::write(JPATH_ROOT . $dest, $image);\n $person->avatar = $dest;\n }\n\n // Finally save the row\n $this->_db->insertObject('#__comments_people', $person, 'comments_person_id', false);\n }\n }",
"function tie_custom_gravatar ($avatar) {\n\t$tie_gravatar = tie_get_option( 'gravatar' );\n\tif($tie_gravatar){\n\t\t$custom_avatar = tie_get_option( 'gravatar' );\n\t\t$avatar[$custom_avatar] = \"Custom Gravatar\";\n\t}\n\treturn $avatar;\n}",
"function theme_addgravatar( $avatar_defaults ) {\r\n\t$myavatar = get_bloginfo('template_directory') . '/images/avatar.gif';\r\n\t$avatar_defaults[$myavatar] = 'people';\r\n\treturn $avatar_defaults;\r\n}",
"function pinboard_admin_header_image() {\n\tif ( 'blank' == get_header_textcolor() || '' == get_header_textcolor() )\n\t\t$style = ' style=\"display:none;\"';\n\telse\n\t\t$style = ' style=\"color:#' . get_header_textcolor() . ';\"';\n\t\t$header_image = get_header_image(); ?>\n<div id=\"headimg\">\n\t<h1>\n\t\t<?php if ( ! empty( $header_image ) ) : ?>\n\t\t\t<a id=\"name\" onclick=\"return false;\" href=\"<?php echo esc_url( home_url( '/' ) ); ?>\">\n\t\t\t\t<img src=\"<?php header_image(); ?>\" alt=\"<?php bloginfo( 'name' ); ?>\" width=\"<?php echo ( pinboard_get_option( 'retina_header' ) ? absint( get_custom_header()->width / 2 ) : get_custom_header()->width ); ?>\" height=\"<?php echo ( pinboard_get_option( 'retina_header' ) ? absint( get_custom_header()->height / 2 ) : get_custom_header()->height ); ?>\" />\n\t\t\t</a>\n\t\t<?php endif; ?>\n\t\t<a id=\"name\"<?php echo $style; ?> onclick=\"return false;\" href=\"<?php echo esc_url( home_url( '/' ) ); ?>\"><?php bloginfo( 'name' ); ?></a>\n\t</h1>\n\t<div id=\"desc\"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>\n\t<div class=\"clear\"></div>\n</div>\n<?php\n}",
"public function getAvatarImage()\n {\n return \"<img style='height:36px;width:36px;border-radius:4px;'\"\n .\" src='\".$this->getAvatarURL().\"' alt='\".$this->name.\"' />\";\n }",
"public function gravatar()\n\t{\n\t\t// Generate the Gravatar hash\n\t\t$gravatar = md5(strtolower(trim($this->gravatar)));\n\n\t\t// Return the Gravatar url\n\t\treturn \"//gravatar.org/avatar/{$gravatar}\";\n\t}",
"public function gravatar()\n\t{\n\t\t// Generate the Gravatar hash\n\t\t$gravatar = md5(strtolower(trim($this->gravatar)));\n\n\t\t// Return the Gravatar url\n\t\treturn \"//gravatar.org/avatar/{$gravatar}\";\n\t}",
"public function getGravatar(){\n\t\t$SiteConfig = SiteConfig::current_site_config();\n\t\tif($SiteConfig->DefaultGravatarImageID != 0){\n\t\t\t$default = urlencode(Director::absoluteBaseURL().$SiteConfig->DefaultGravatarImage()->Link());\n\t\t}\n\t\telseif($SiteConfig->DefaultGravatar != ''){\n\t\t\t$default = urlencode($SiteConfig->DefaultGravatar);\n\t\t}\n\t\telse{\n\t\t\t$default = '';\n\t\t}\n\t\tif($SiteConfig->GravatarSize){\n\t\t\t$GravatarSize = $SiteConfig->GravatarSize;\n\t\t}\n\t\telse{\n\t\t\t$GravatarSize = '32';\n\t\t}\n\t\t$link = 'http://www.gravatar.com/avatar/$MD5Email?default='.$default.'&s='.$GravatarSize;\n\t\treturn $link;\n\t}",
"public function updateLogo(){\n\t\t//we get the group of the current user\n\t\t$group = \\User\\User::find( \\Auth::user()->id )->userToGroup()->first();\n\t\t$fileName = $this->_uploadLogo($group->group_id);\n\t\tif( $fileName ) {\n\t\t\t$userGroup = \\UserGroup\\UserGroup::find($group->group_id);\n\t\t\t$userGroup->logo = $fileName;\n\t\t\t$userGroup->save();\n\t\t\treturn $userGroup;\n\t\t}\n\t}",
"function tz_custom_gravatar($avatar_defaults)\n{\n $tz_avatar = get_template_directory_uri() . '/images/gravatar.png';\n $avatar_defaults[$tz_avatar] = 'Custom Gravatar (/images/gravatar.png)';\n return $avatar_defaults;\n}",
"function replace_login_logo() { ?>\r\n\t<?php if ( function_exists( 'ot_get_option' ) ) {\r\n\t\t$logo = ot_get_option( 'logo_upload' );\r\n\t} ?>\r\n\r\n\t<?php if ( ! empty( $logo )) { ?>\r\n\r\n <style type=\"text/css\">\r\n body.login div#login h1 a {\r\n background-image: url(<?php echo $logo; ?>);\r\n padding-bottom: 30px;\r\n -webkit-background-size: auto;\r\n background-size: auto;\r\n height: auto;\r\n width: auto;\r\n }\r\n </style>\r\n\r\n <?php } ?>\r\n\r\n<?php }",
"public function set_avatar($source) {\n switch ($source) {\n case 'g':\n $avatar = get_gravatar($_SESSION['email']);\n break;\n case 't':\n $q = \"select avatar from user_social_acc where user_id='{$_SESSION['user']['user_id']}' and type='t'\";\n $r = mysql_query($q);\n list($avatar) = mysql_fetch_array($r); \n break;\n case 'f':\n $q = \"select avatar from user_social_acc where user_id='{$_SESSION['user']['user_id']}' and type='f'\";\n $r = mysql_query($q);\n list($avatar) = mysql_fetch_array($r); \n break;\n default:\n return false;\n break;\n }\n \n mysql_query(\"update users set avatar='$avatar' where user_id='{$_SESSION['user']['user_id']}'\");\n return mysql_affected_rows();\n }",
"public function avatar()\n {\n $hash = md5(strtolower(trim($this->email())));\n $type = array(\"mp\", \"identicon\", \"monsterid\", \"wavatar\");\n $random_key = array_rand($type);\n $type = $type[$random_key];\n return \"http://www.gravatar.com/avatar/$hash?d=$type&s=200\";\n }",
"function shammah_admin_header_image() {\n\t?>\n\t<div id=\"headimg\">\n\t\t<?php\n\t\tif ( ! display_header_text() )\n\t\t\t$style = ' style=\"display:none;\"';\n\t\telse\n\t\t\t$style = ' style=\"color:#' . get_header_textcolor() . ';\"';\n\t\t?>\n\t\t<h1 class=\"displaying-header-text\"><a id=\"name\"<?php echo $style; ?> onclick=\"return false;\" href=\"<?php echo esc_url( home_url( '/' ) ); ?>\"><?php bloginfo( 'name' ); ?></a></h1>\n\t\t<h2 id=\"desc\" class=\"displaying-header-text\"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></h2>\n\t\t<?php $header_image = get_header_image();\n\t\tif ( ! empty( $header_image ) ) : ?>\n\t\t\t<img src=\"<?php echo esc_url( $header_image ); ?>\" class=\"header-image\" width=\"<?php echo get_custom_header()->width; ?>\" height=\"<?php echo get_custom_header()->height; ?>\" alt=\"\" />\n\t\t<?php endif; ?>\n\t</div>\n\n\n\n<?php }",
"function twentyeleven_admin_header_image() { ?>\n\t<div id=\"headimg\">\n\t\t<?php\n\t\tif ( 'blank' == get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR ) || '' == get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR ) )\n\t\t\t$style = ' style=\"display:none;\"';\n\t\telse\n\t\t\t$style = ' style=\"color:#' . get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR ) . ';\"';\n\t\t?>\n\t\t<h1><a id=\"name\"<?php echo $style; ?> onclick=\"return false;\" href=\"<?php echo home_url( '/' ); ?>\"><?php bloginfo( 'name' ); ?></a></h1>\n\t\t<div id=\"desc\"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>\n\t\t<img src=\"<?php esc_url ( header_image() ); ?>\" alt=\"\" />\n\t</div>\n<?php }",
"function getGravatar( $email, $s = 80, $d = 'mm', $r = 'g', $img = false, $atts = array() ) {\n\t$url = 'https://www.gravatar.com/avatar/';\n\t$url .= md5( strtolower( trim( $email ) ) );\n\t$url .= \"?s=$s&d=$d&r=$r\";\n\tif ( $img ) {\n\t\t$url = '<img src=\"' . $url . '\"';\n\t\tforeach ( $atts as $key => $val )\n\t\t$url .= ' ' . $key . '=\"' . $val . '\"';\n\t\t$url .= ' />';\n\t}\n\treturn $url;\n}",
"public function getAvatar()\n {\n\n return \"/images/avatars/\".$this->getId().\".svg?ver=\".time();\n\n }",
"public static function generateAvatar()\n {\n\n $generator = new RingsGenerator();\n $generator->setBackgroundColor(Color::parseHex('#FFFFFF'));\n\n $identicon = new Identicon(new MD5Preprocessor(), $generator);\n\n $icon = $identicon->getIcon(\\App\\Http\\Controllers\\ClientController::get('client_data', 'avatar_id'));\n\n file_put_contents('/var/www/LAN-HOST.NET/lan-host/public/images/avatars/'.\\App\\Http\\Controllers\\ClientController::getId().'.svg', $icon);\n\n }",
"function get_avatar() {}",
"function kpb_admin_header_image() { ?>\n <div id=\"headimg\">\n <?php\n if ( 'blank' == get_header_textcolor() || '' == get_header_textcolor() )\n $style = ' style=\"display:none;\"';\n else\n $style = ' style=\"color:#' . get_header_textcolor() . ';\"';\n ?>\n <h1><a id=\"name\"<?php echo $style; ?> onclick=\"return false;\" href=\"<?php echo esc_url( home_url( '/' ) ); ?>\"><?php bloginfo( 'name' ); ?></a></h1>\n <div id=\"desc\"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>\n <?php $header_image = get_header_image();\n if ( ! empty( $header_image ) ) : ?>\n <img src=\"<?php echo esc_url( $header_image ); ?>\" alt=\"\" />\n <?php endif; ?>\n </div>\n<?php }",
"public function header_image() {\n\t\t\treturn \"<img id='header-image' alt='We nourish our pupils with an\n\t\t\tengaging focus on Jewish Tradition' src='/img/header-prospective.jpg'\n\t\t\t/>\";\n\t\t}",
"function agc_set_core_avatar_image()\n{\n\tglobal $bp;\n\theader( \"Content-Type: application/json\" );\n\n\tif (! bp_core_avatar_handle_crop( array( 'avatar_dir' => 'avatars','item_id' => bp_loggedin_user_id() , 'original_file' => $_POST['image_src'], 'crop_x' => $_POST['x'], 'crop_y' => $_POST['y'], 'crop_w' => $_POST['w'], 'crop_h' => $_POST['h'] )))\n\t\t$result = array('status' => 'fail', 'msg' => 'There was a problem cropping your avatar, please try uploading it again','upload_path' => $_POST['image_src']);\n\telse\n\t{\n\t\t$step \t = $_POST['step'];\n\t\tagc_login_steps_getset_step($step,true);\n\t\t$result = array('status' => 'success', 'msg' => 'Your new avatar was uploaded successfully!','values' => array('x' => $_POST['x'],'y' => $_POST['y'],'w' => $_POST['w'],'h' => $_POST['h']));\n\t}\n\n\techo json_encode($result);\n\tdie();\n}",
"function satb_get_gravatar( $email, $s = 80, $d = 'mm', $r = 'g', $img = false, $atts = array() ) {\n $url = 'http://www.gravatar.com/avatar/';\n $url .= md5( strtolower( trim( $email ) ) );\n $url .= \"?s=$s&d=$d&r=$r\";\n if ( $img ) {\n $url = '<img src=\"' . $url . '\"';\n foreach ( $atts as $key => $val )\n $url .= ' ' . $key . '=\"' . $val . '\"';\n $url .= ' />';\n }\n return $url;\n}",
"function sample_theme_login_logo() {\n\techo '<style type=\"text/css\">\n\t\th1 a {\n\t\t\tbackground-image:url(https://media.licdn.com/dms/image/C5603AQFriQjM1e7Agg/profile-displayphoto-shrink_200_200/0?e=1526533200&v=alpha&t=CB8YvDeI8XWMPU2leGvBV2r7SwsXJJxarOMhYYFnKw8) !important;\n\t\t\tmargin:0 auto;\n\t\t\theight: 210px !important;\n\t\t\twidth: 210px !important;\n\t\t\tbackground-size: cover !important;\n\t\t}\n\t\t</style>';\n//the WordPress logo is made with a background-image CSS command, so we have to override it with a filter hook and the appropriate '!important' tags. The height, width and background-size commands are there to make sure the size is appropriate.\n}",
"function openlucius_core_fetch_user_image($u, $style = 'ol_50x50', $alt = \"\", $title = \"\", $width = NULL, $height = NULL) {\n\n // Initialize image string.\n $image = '';\n\n // If u is a number it's the uid otherwise it is a user object.\n $account = is_numeric($u) ? user_load($u) : $u;\n\n // The default 'avatar' image.\n $default_uri = drupal_get_path('theme', 'openlucius') . '/images/avatar.png';\n\n // Check if the user has a picture.\n if (!empty($account->picture)) {\n\n // Check if the file was loaded.\n if (!empty($account->picture->uri)) {\n\n if (file_exists($account->picture->uri)) {\n $image = theme('image_style', array(\n 'style_name' => $style,\n 'path' => $account->picture->uri,\n 'alt' => $alt,\n 'title' => $title,\n 'width' => !empty($width) ? $width : '',\n 'height' => !empty($height) ? $height : '',\n ));\n }\n else {\n $image = theme('image', array(\n 'style_name' => 'ol_50x50',\n 'path' => $default_uri,\n 'alt' => $alt,\n 'title' => $title,\n 'width' => !empty($width) ? $width : '',\n 'height' => !empty($height) ? $height : '',\n ));\n }\n }\n // Build path to default picture.\n else {\n $image = theme('image', array(\n 'style_name' => 'ol_50x50',\n 'path' => $default_uri,\n 'alt' => $alt,\n 'title' => $title,\n 'width' => !empty($width) ? $width : '',\n 'height' => !empty($height) ? $height : '',\n ));\n }\n }\n // Build path to default picture.\n else {\n $image = theme('image', array(\n 'style_name' => 'ol_50x50',\n 'path' => $default_uri,\n 'alt' => $alt,\n 'title' => $title,\n 'width' => !empty($width) ? $width : '',\n 'height' => !empty($height) ? $height : '',\n ));\n }\n\n return $image;\n}"
] | [
"0.6986716",
"0.6593583",
"0.65286976",
"0.6506528",
"0.63559526",
"0.6318872",
"0.63122326",
"0.6299528",
"0.6297277",
"0.62868464",
"0.6283981",
"0.6283981",
"0.6271685",
"0.6269817",
"0.62513316",
"0.6245025",
"0.62439835",
"0.6220885",
"0.6201156",
"0.61965954",
"0.61526686",
"0.6146364",
"0.614342",
"0.61216253",
"0.611969",
"0.6117146",
"0.6111545",
"0.61008865",
"0.6084727",
"0.6072698"
] | 0.68906415 | 1 |
Finds the aalm data set application table entry using the authoritative id (i.e. ecash application id.) | public function findApplication($application_id) {
$query = 'SELECT ap.application_id AS application_id,
ap.apr AS apr,
ap.cfe_rule_set_id AS cfe_ruleset_id,
ap.company_id AS company_id,
ap.customer_id AS customer_id,
ap.date_application_status_set AS date_application_status_set,
ap.date_created AS date_created,
ap.date_first_payment AS date_first_payment,
if(ap.date_fund_actual>"1990-01-01",ap.date_fund_actual,NULL) AS date_fund_actual,
ap.date_fund_estimated AS date_fund_estimated,
ap.date_modified AS date_modified,
ap.date_next_contact AS date_next_contact,
ap.enterprise_site_id AS enterprise_site_id,
ap.external_id AS external_id,
ap.finance_charge AS finance_charge,
ap.fund_actual AS fund_actual,
ap.fund_qualified AS fund_qualified,
ap.fund_requested AS fund_requested,
ap.ip_address AS ip_address,
ap.esig_ip_address AS esig_ip_address,
ap.is_react AS is_react,
ap.is_watched AS is_watched,
ap.loan_type_id AS loan_type_id,
ap.modifying_agent_id AS modifying_agent_id,
ap.payment_total AS payment_total,
ap.price_point AS price_point,
ap.rule_set_id AS rule_set_id,
ap.track_id AS track_key,
ap.application_status_id AS application_status_id,
ap.call_time_pref AS call_time_pref,
ap.contact_method_pref AS contact_method_pref,
ap.marketing_contact_pref AS marketing_contact_pref,
ap.olp_process AS olp_process,
ap.application_type AS application_type,
ap.application_id AS application_id,
ap.source AS application_source
FROM application AS ap WHERE ap.application_id = '.$application_id.';';
$result = $this->db->query($query);
$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);
return($rows);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getApplicationByID($application_id) { \n $query = \"SELECT * FROM applications WHERE applicationid = ?\";\n $paramType = \"s\";\n $paramValue = array(\n $application_id\n );\n \n $result = $this->db_handle->runQuery($query, $paramType, $paramValue);\n \n\t\treturn $result;\n }",
"public static function getAppTOCEntry($appname = \"\"){\n\t\tif(empty($appname) || !self::isInstalled($appname)){\n\t\t\treturn false;\n\t\t}\n\t\t$toc = self::readAppTOCsxmle();\n\t\tforeach($toc->applications->application as $entry){\n\t\t\tif($entry->name == $appname){\n\t\t\t\treturn $entry;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"function findHydroApplication($appKey) {\n $bind = array( 0 => $appKey['authority'], 1 => $appKey['reference'], 2 => $appKey['scrape_date'] );\n $application = scraperwiki::select(\"* FROM hydro_applications WHERE authority = ? AND reference = ? AND scrape_date >= ?\", $bind);\n return $application;\n}",
"public function getApplicationAuthoritativeQuery($application_id) {\n\t\t$query = 'SELECT authoritative_id AS authoritativeId,\n\t\t\t\tcompany_id AS companyId,\n\t\t\t\tdate_created AS dateCreated\n\t\t\tFROM authoritative_ids\n\t\t\tWHERE authoritative_id = '.$application_id.';';\n\t\t$result = $this->db->query($query);\n\t\t$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($rows);\n\t}",
"public function find_app( $appid ) {\n\t\t$sth = $this->db->perform( 'SELECT '\n\t\t . 'appkey, secret, vault_secret, name, ping_url '\n\t\t . 'FROM vault_apps '\n\t\t . 'WHERE vault_app_id = ?',\n\t\t [ $appid ] );\n\t\t$row = $sth->fetch();\n\t\tif ( ! $row ) {\n\t\t\tthrow new VaultDataException( \"App $appid not found\" );\n\t\t}\n\n\t\t$app = new App( $row['appkey'], $row['secret'],\n\t\t $row['vault_secret'], $row['name'], $row['ping_url'] );\n\t\t$app->appid = $appid;\n\n\t\treturn $app;\n\t}",
"public function get_application( $application_id ) {\n \n $this->db->select('*');\n $this->db->from('oauth_applications');\n $this->db->where(array(\n 'application_id' => $application_id\n )\n );\n $this->db->limit(1);\n $query = $this->db->get();\n \n if ( $query->num_rows() > 0 ) {\n \n $results = $query->result();\n \n return $results;\n \n } else {\n \n return false;\n \n }\n \n }",
"public function getApp($id){\n $command = new Command($this->host, self::APPS_GET,\"GET\", $this->enableCache, $this->cacheLifetime, $this->cacheFolder);\n $command->setParam(\"id\", $id);\n $command->execute();\n return $command->getData(\"dapp\");\n }",
"function getApplicationId($db,$candidate_id = '') {\n $query = $db->prepare(\"SELECT candidate_courses_map.id as application_id ,courses.drive_name , courses.program_id,users.icam_user_id FROM candidate_courses_map \"\n . \"left join courses on courses.id = candidate_courses_map.course_id left join candidate_details on \"\n . \"candidate_courses_map.candidate_id = candidate_details.id left \"\n . \"join users on candidate_details.user_id = users.id where candidate_courses_map.candidate_id = :candidate_id\");\n \n $query->execute(array(':candidate_id' => $candidate_id));\n $application_arr = $query->fetch(PDO::FETCH_ASSOC);\n \n if(!empty($application_arr['application_id']))\n {\n return $application_arr;\n }\n else \n {\n return FALSE;\n }\n}",
"public static function applicationSet(Application $app) {\r\n //creates database connection if one doesn't already exist\r\n self::setInstance();\r\n \r\n //determine if application already exists in database\r\n $exists = self::$instance->select(\"applications\", [\"id\"], [\"id\"=>$app->getID()]);\r\n \r\n //check to see if application already exists in database\r\n if (sizeof($exists) === 0) {\r\n //create new application if one doesn't exist\r\n $id = self::$instance->insert(\"applications\", self::makeSQLArray($app));\r\n } \r\n else {\r\n //update application if it already exists\r\n self::$instance->update(\"applications\", self::makeSQLArray($app), [\"id\" => $app->getID()]);\r\n $id = $app->getID();\r\n }\r\n \r\n //remove all existing keywords\r\n self::$instance->delete(\"keywords\", [\"id\" => $id]);\r\n \r\n //create an array of the keywords to be inserted\r\n $keyword_array = array();\r\n foreach($app->getKeywords() as $word) {\r\n $keyword_array[] = array(\"id\" => $id, \"word\" => $word);\r\n }\r\n \r\n //insert keywords into keyword table\r\n self::$instance->insert(\"keywords\", $keyword_array);\r\n \r\n return $id;\r\n }",
"function getFacultyApplication($FacultyID){\n\tglobal $conn;\n\t\n\t$sqlGet = sprintf(\"SELECT * FROM `\".DB_PREFIX.\"faculty_applications` WHERE `FacultyID` = '%s' AND `deletedFlag` = 0 LIMIT 1\", $FacultyID);\n\t//Execute the query\n\t$resultGet = db_query($sqlGet,DB_NAME,$conn);\n\t\n\tif(db_num_rows($resultGet)>0){\n\t\t$rowGet = db_fetch_array($resultGet);\n\t\treturn $rowGet;\n\t}\n\telse{\n\t\treturn \"N/A\";\n\t}\n}",
"public function findById(string $appId);",
"public function getEntryId();",
"function get_agama_by_id($param) {\n $sql = \"SELECT * FROM agama WHERE agama_cd = ?\";\n $query = $this->db->query($sql, $param);\n if ($query->num_rows() > 0) {\n $result = $query->row_array();\n $query->free_result();\n return $result;\n } else {\n return 0;\n }\n }",
"public function getApplicationId()\n\t{\n\t\treturn $this->application_id;\n\t}",
"public static function get_app($appid) {\n global $DB;\n $app = $DB->get_record(constants::APP_TABLE, array('appid'=>$appid));\n return $app;\n }",
"public static function applicationGet($id) {\r\n //creates database connection if one doesn't already exist\r\n self::setInstance();\r\n \r\n //try to find applications given the id\r\n $application = self::$instance->select(\"applications\", \"*\", [\"id\" => $id]);\r\n \r\n //check to see if any applications are found\r\n if(count($application) < 1) {\r\n //throws an Exception if no applications were found (invalid id)\r\n throw new Exception(\"Application ID not found\");\r\n }\r\n else {\r\n //create an application object from the database information\r\n \r\n //use the first (and only) result\r\n $application = $application[0];\r\n \r\n $obj = new Application();\r\n $obj->setID($application[\"id\"]);\r\n $obj->setTitle($application[\"title\"]);\r\n $obj->setDeveloper($application[\"developer\"]);\r\n $obj->setPrice($application[\"price\"]);\r\n $obj->setCategory($application[\"category\"]);\r\n \r\n //set links and store compatibility\r\n foreach($application as $field => $value) {\r\n $substring = substr($field, 0, 4);\r\n if ($substring === \"link\") {\r\n $obj->setStoreLink(\\ucfirst(substr($field, 5)), $value);\r\n }\r\n if ($substring === \"comp\") {\r\n if($value == \"1\") {\r\n $obj->setCompatible(\\ucfirst(substr($field, 7)));\r\n }\r\n }\r\n }\r\n \r\n $obj->setDeveloperLink($application[\"developer_link\"]);\r\n $obj->setKeywords(self::applicationGetKeywords($id), true);\r\n $obj->setImageURL($application[\"image_url\"]);\r\n $obj->setDescription($application[\"description\"]);\r\n $obj->setModerationState($application[\"moderation_state\"]);\r\n }\r\n \r\n return $obj;\r\n }",
"public function findByKey(string $appKey);",
"public function getApplicantQuery($application_id) {\n\t\t$query = 'SELECT ap.date_modified AS date_modified,\n\t\t\t\tap.date_created AS date_created,\n\t\t\t\tap.application_id AS application_id,\n\t\t\t\tap.external_id AS external_id,\n\t\t\t\tap.legal_id_type AS legal_id_type,\n\t\t\t\tap.tenancy_type AS tenancy_type,\n\t\t\t\tap.dob AS date_of_birth,\n\t\t\t\tap.dob AS dob,\n\t\t\t\t0 AS date_of_birth_id,\n\t\t\t\tap.legal_id_number AS legal_id_number,\n\t\t\t\t0 AS legal_id_number_id,\n\t\t\t\tap.legal_id_state AS legal_id_state,\n\t\t\t\tap.ssn AS ssn,\n\t\t\t\tsubstr(ap.ssn,7,4) AS ssn_last_four,\n\t\t\t\tap.name_last AS name_last,\n\t\t\t\tap.name_first AS name_first,\n\t\t\t\tap.street AS street,\n\t\t\t\tap.city AS city,\n\t\t\t\tap.county AS county,\n\t\t\t\tap.unit AS unit,\n\t\t\t\tap.state AS state,\n\t\t\t\tap.zip_code AS zip_code,\t\t\t\t\n\t\t\t\tap.dob AS dob,\n\t\t\t\tap.age AS age,\n\t\t\t\tap.residence_start_date AS residence_start_date,\n\t\t\t\tsubstr(ap.ssn,7,4) AS ssn_last4,\n\t\t\t\tIF (av.version IS NULL,1,av.version) AS application_version,\n\t\t\t\tap.modifying_agent_id AS modifying_agent_id\n\t\t\tFROM application AS ap\n\t\t\t\tLEFT JOIN application_version AS av USING (application_id)\n\t\t\tWHERE ap.application_id = '.$application_id.';';\n\n\t\t$result = $this->db->query($query);\n\t\t$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($rows);\n\t}",
"public function getApplicationId()\n {\n return $this->application_id;\n }",
"private function Get_App_Data_From_OLP($application_id)\n\t{\n\t\t$data = array();\n\n\t\t$query = \"\n\t\t\tSELECT\n\t\t\t\tfirst_name\t\tAS name_first,\n\t\t\t\tmiddle_name\t\tAS name_middle,\n\t\t\t\tlast_name\t\tAS name_last,\n\t\t\t\temail\t\t\tAS email_primary,\n\t\t\t\thome_phone\t\tAS phone_home,\n\t\t\t\tcell_phone\t\tAS phone_cell,\n\t\t\t\twork_phone\t\tAS phone_work,\n\t\t\t\tfax_phone\t\tAS phone_fax,\n\t\t\t\twork_ext\t\tAS ext_work,\n\n\t\t\t\tdate_of_birth\tAS dob,\n\t\t\t\tsocial_security_number AS ssn,\n\n\t\t\t\taddress_1\t\tAS home_street,\n\t\t\t\tcity\t\t\tAS home_city,\n\t\t\t\tstate\t\t\tAS home_state,\n\t\t\t\tzip\t\t\t\tAS home_zip,\n\t\t\t\tapartment\t\tAS home_unit,\n\n\t\t\t\temployer\t\tAS employer_name,\n\t\t\t\tdrivers_license_number\tAS state_id_number,\n\n\t\t\t\tdirect_deposit\tAS income_direct_deposit,\n\t\t\t\tincome_type,\n\t\t\t\tpay_frequency\tAS income_frequency,\n\t\t\t\tbank_name,\n\t\t\t\taccount_number\tAS bank_account,\n\t\t\t\trouting_number\tAS bank_aba,\n\t\t\t\tmonthly_net\t\tAS income_monthly_net,\n\t\t\t\tbank_account_type,\n\n\t\t\t\tpaydate_model_id\tAS paydate_model,\n\t\t\t\tIFNULL(ELT(day_of_week, 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'), 'SUN') AS day_of_week,\n\t\t\t\tDATE_FORMAT(pay_date_1, '%Y-%m-%d') AS next_paydate,\n\t\t\t\tday_of_month_1,\n\t\t\t\tday_of_month_2,\n\t\t\t\tweek_1,\n\t\t\t\tweek_2,\n\n\t\t\t\tDATE_FORMAT(pay_date_1, '%Y-%m-%d') AS pay_date_1,\n\t\t\t\tDATE_FORMAT(pay_date_2, '%Y-%m-%d') AS pay_date_2,\n\t\t\t\tDATE_FORMAT(pay_date_3, '%Y-%m-%d') AS pay_date_3,\n\t\t\t\tDATE_FORMAT(pay_date_4, '%Y-%m-%d') AS pay_date_4,\n\n\t\t\t\tfund_amount,\n\t\t\t\tnet_pay,\n\t\t\t\tfinance_charge,\n\t\t\t\tapr,\n\t\t\t\ttotal_payments,\n\t\t\t\tDATE_FORMAT(estimated_fund_date, '%Y-%m-%d') AS fund_date,\n\t\t\t\tDATE_FORMAT(estimated_payoff_date, '%Y-%m-%d') AS payoff_date,\n\t\t\t\t\n\t\t\t\tbest_call_time,\n\t\t\t\tip_address\t\tAS client_ip_address\n\n\t\t\t\t#residence_start_date,\n\t\t\t\t#banking_start_date,\n\t\t\t\t#date_of_hire,\n\t\t\t\t#title AS work_title,\n\n\t\t\t\t#engine AS vehicle_engine,\n\t\t\t\t#keywords AS vehicle_keywords,\n\t\t\t\t#year AS vehicle_year,\n\t\t\t\t#make AS vehicle_make,\n\t\t\t\t#model AS vehicle_model,\n\t\t\t\t#series AS vehicle_series,\n\t\t\t\t#style AS vehicle_style,\n\t\t\t\t#mileage AS vehicle_mileage,\n\t\t\t\t#vin AS vehicle_vin,\n\t\t\t\t#value AS vehicle_value,\n\t\t\t\t#color AS vehicle_color,\n\t\t\t\t#license_plate AS vehicle_license_plate,\n\t\t\t\t#title_state AS vehicle_title_state\n\t\t\tFROM\n\t\t\t\tpersonal\n\t\t\t\tINNER JOIN residence USING (application_id)\n\t\t\t\tINNER JOIN bank_info USING (application_id)\n\t\t\t\tINNER JOIN employment USING (application_id)\n\t\t\t\tINNER JOIN loan_note USING (application_id)\n\t\t\t\tINNER JOIN income USING (application_id)\n\t\t\t\tINNER JOIN paydate USING (application_id)\n\t\t\t\tINNER JOIN campaign_info USING (application_id)\n\t\t\t\t#LEFT JOIN vehicle USING (application_id)\n\t\t\tWHERE\n\t\t\t\tpersonal.application_id = {$application_id}\n\t\t\t\tAND campaign_info.active = 'TRUE'\n\t\t\tLIMIT 1\n\t\t\";\n\n\t\t$mysql_result = $this->olp_sql->Query($this->olp_db, $query);\n\n\t\tif($mysql_result && ($data = $this->olp_sql->Fetch_Array_Row($mysql_result)))\n\t\t{\n\t\t\t$data['paydate'] = array('frequency' => $data['income_frequency']);\n\n\t\t\tlist($data['date_dob_y'], $data['date_dob_m'], $data['date_dob_d']) = explode('-', $data['dob']);\n\t\t\t$data['ssn_part_1'] = substr($data['ssn'], 0, 3);\n\t\t\t$data['ssn_part_2'] = substr($data['ssn'], 3, 2);\n\t\t\t$data['ssn_part_3'] = substr($data['ssn'], 5);\n\n\t\t\t//Taken from ent_cs and slightly modified\n\t\t\tswitch($data['paydate']['frequency'])\n\t\t\t{\n\t\t\t\tcase 'WEEKLY':\n\t\t\t\t\t$data['paydate']['weekly_day'] = $data['day_of_week'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'BI_WEEKLY':\n\t\t\t\t\t$data['paydate']['biweekly_day'] = $data['day_of_week'];\n\t\t\t\t\t$data['paydate']['biweekly_date'] = $data['next_paydate'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'TWICE_MONTHLY':\n\t\t\t\t\tswitch($data['paydate_model'])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'DMDM':\n\t\t\t\t\t\t\t$data['paydate']['twicemonthly_type'] = 'date';\n\t\t\t\t\t\t\t$data['paydate']['twicemonthly_date1'] = $data['day_of_month_1'];\n\t\t\t\t\t\t\t$data['paydate']['twicemonthly_date2'] = $data['day_of_month_2'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$data['paydate']['twicemonthly_type'] = 'week';\n\t\t\t\t\t\t\t$data['paydate']['twicemonthly_week'] = sprintf( '%s-%s', $data['week_1'], $data['week_2'] );\n\t\t\t\t\t\t\t$data['paydate']['twicemonthly_day'] = $data['day_of_week'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'MONTHLY':\n\t\t\t\t\tswitch($data['paydate_model'])\n\t\t\t\t\t{\n\n\t\t\t\t\t\tcase 'DM':\n\t\t\t\t\t\t//rsk changed from week\n\t\t\t\t\t\t\t$data['paydate']['monthly_type'] = 'date';\n\t\t\t\t\t\t\t$data['paydate']['monthly_date'] = $data['day_of_month_1'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'WDW':\n\t\t\t\t\t\t\t$data['paydate']['monthly_type'] = 'day';\n\t\t\t\t\t\t\t$data['paydate']['monthly_week'] = $data['week_1'];\n\t\t\t\t\t\t\t$data['paydate']['monthly_day'] = $data['day_of_week'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$data['paydate']['monthly_type'] = 'after';\n\t\t\t\t\t\t\t$data['paydate']['monthly_after_day'] = $data['day_of_week'];\n\t\t\t\t\t\t\t$data['paydate']['monthly_after_date'] = $data['day_of_month_1'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$data['social_security_number'] = $data['ssn'];\n\t\t\t\n\t\t\t//Create the paydates\n\t\t\t$data['paydates'] = array();\n\t\t\tfor($i = 1; $i <= 4; $i++)\n\t\t\t{\n\t\t\t\t$data['paydates'][] = $data['pay_date_' . $i];\n\t\t\t\tunset($data['pay_date_' . $i]);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//Create qualify information\n\t\t\t$data['qualify_info'] = array(\n\t\t\t\t'fund_date'\t\t=> $data['fund_date'],\n\t\t\t\t'payoff_date'\t=> $data['payoff_date'],\n\t\t\t\t'fund_amount'\t=> $data['fund_amount'],\n\t\t\t\t'net_pay'\t\t=> $data['net_pay'],\n\t\t\t\t'finance_charge'=> $data['finance_charge'],\n\t\t\t\t'apr'\t\t\t=> $data['apr'],\n\t\t\t\t'total_payments'=> $data['total_payments']\n\t\t\t);\n\t\t\t\n\t\t\t\n\t\t\t//Unset unneeded information\n\t\t\tunset($data['ssn'], $data['dob']);\n\n\n\t\t\t$ref_query = \"\n\t\t\t\tSELECT\n\t\t\t\t\tfull_name\tAS name_full,\n\t\t\t\t\tphone\t\tAS phone_home,\n\t\t\t\t\trelationship\n\t\t\t\tFROM\n\t\t\t\t\tpersonal_contact\n\t\t\t\tWHERE\n\t\t\t\t\tapplication_id = {$application_id}\";\n\n\t\t\t$ref_result = $this->olp_sql->Query($this->olp_db, $ref_query);\n\n\t\t\t$count = 0;\n\t\t\twhile($row = $this->olp_sql->Fetch_Array_Row($ref_result))\n\t\t\t{\n\t\t\t\t$ref_count = sprintf('%02d', ++$count);\n\n\t\t\t\t$data['ref_' . $ref_count . '_name_full'] = $row['name_full'];\n\t\t\t\t$data['ref_' . $ref_count . '_phone_home'] = $row['phone_home'];\n\t\t\t\t$data['ref_' . $ref_count . '_relationship'] = $row['relationship'];\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//Create our paydate_model\n\t\t\t$model = new Paydate_Model();\n\t\t\t$model_result = $model->Build_From_Data($data['paydate']);\n\t\t\t\n\t\t\tif($model_result === TRUE)\n\t\t\t{\n\t\t\t\t$data['paydate_model'] = $model->Model_Data();\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}",
"function getApplicant( $pidm )\n\t{\n\t\tif( !isset($GLOBALS['BannerGeneral']) ){\n\t\t\trequire_once('BannerGeneral.class.php');\n\t\t\t$GLOBALS['BannerGeneral'] = new BannerGeneral( PSU::db('banner') );\n\t\t}\n\n\t\t$return = array();\n\n\t\t$return['email'] = self::getApplicantEmail( $pidm );\n\t\t$return['name_first'] = ucwords( PSU::get('idmobject')->getName( $pidm , 'f'));\n\t\t$return['username'] = PSU::get('idmobject')->getIdentifier( $pidm,'pid','login_name' );\n\t\t$return['ldap_user'] = PSU::get('idmobject')->getIdentifier( $pidm,'pid','username' );\n\t\tif( preg_match( '/^app\\./i', $return['username'] )){\n\t\t\t$return['username'] = preg_replace( '/^app\\./i', '', $return['username'] );\n\t\t\t$return['password'] = $GLOBALS['BannerGeneral']->getPin( $pidm );\n\t\t}\n\t\t$return['psuid'] = PSU::get('idmobject')->getIdentifier( $pidm , 'pidm', 'id' );\n\t\t$return['pidm'] = $pidm;\n\n\t\t$v_ug_app = PSU::db('banner')->GetRow( 'SELECT * FROM v_ug_app WHERE pidm = :pidm', compact('pidm') );\n\t\t$return['term_code_entry'] = $v_ug_app['term_code_entry'];\n\t\t$return['apdc_code'] = $v_ug_app['apdc_code'];\n\n\t\treturn( $return );\n\t}",
"public function get_application_id($applicant_id, $job_id) {\n\n $result = $this->doQuery(sprintf(\"\n SELECT APPLICATION_ID\n FROM APPLICATION\n WHERE APPLICANT_ID = '%s'\n AND JOB_ID = '%s'\",\n mysql_real_escape_string($applicant_id),\n mysql_real_escape_string($job_id)\n ));\n\n $row = mysql_fetch_assoc($result);\n\n if (!$row) {\n return false;\n }\n\n return $row['APPLICATION_ID'];\n\n }",
"public function load($appid)\n{\n\t$query = \"SELECT * FROM application WHERE id = $appid\";\n\tinclude '../../delete/connection.php';\n\t$result = pg_query($connection, $query);\n\t\n\tif (pg_num_rows($result) == 1) \n\t{\n\t\t$row = pg_fetch_array($result);\n\t\t$this->id = $row['id'];\n\t\t$this->name = $row['name'];\n\t\t$this->url = $row['url'];\n\t\t$this->baseurl = $row['baseurl'];\n\t}\n\telse\n\t{\n\t\techo 'Either more than 1 result was found or no appication with that application id was found';\n\t}\n}",
"public function getApplicationIdentifier()\n {\n if (array_key_exists(\"applicationIdentifier\", $this->_propDict)) {\n return $this->_propDict[\"applicationIdentifier\"];\n } else {\n return null;\n }\n }",
"function lookupServerInfoByEid($db_application, $eid)\r\n{\r\n\r\n if (!\\Flexio\\Base\\Eid::isValid($eid))\r\n return false; // don't flag an error, but acknowledge that object doesn't exist\r\n\r\n $qeid = $db_application->quote($eid);\r\n\r\n $sql = \"select \".\r\n \" tco.eid as eid, \".\r\n \" tco.host as host, \".\r\n \" tco.port as port, \".\r\n \" tco.database as database, \".\r\n \" tre.location as location \".\r\n \"from \".\r\n \" tbl_connection tco \".\r\n \"inner join \".\r\n \" tbl_resource tre \".\r\n \"on \".\r\n \" tco.eid = tre.connection_eid \".\r\n \"where \".\r\n \" tre.eid = $qeid\";\r\n\r\n $res = $db_application->fetchRow($sql);\r\n\r\n if (!$res)\r\n return false;\r\n\r\n return $res;\r\n}",
"function getApplicationsByInternshipId($internshipId){\n global $con;\n $query = \"SELECT * FROM internship_applications WHERE Internship_Id = '$internshipId' ORDER BY(Application_Id) DESC\";\n $queryExec = mysqli_query($con, $query);\n while($row = mysqli_fetch_assoc($queryExec)){\n $rows[] = $row;\n }\n return $rows;\n }",
"function Get_AP_Id($connection,$table,$AP_Mac)\n{\n\t$query = 'SELECT id from '.$table.' where AP_Mac=\"'.$AP_Mac.'\"';\n\t$exec = mysql_query($query,$connection);\n\tif(mysql_num_rows($exec)>0)\n\t{\n\t\t$network_id = mysql_result($exec,0,\"id\");\t\n\t}\n\telse\n\t{\n\t\t$network_id=\"inexistent\";\n\t}\n\t\n\treturn $network_id;\n}",
"function get_ac_app($app, $case = 0) {\n\tglobal $author_session;\n\n\t// Basic rights\n\t$allow = array('r' => false, 'w' => false, 'e' => false, 'a' => false);\n\n\t// Check if the app ID is present\n\t$app = intval($app);\n\tif ($app < 0) // internal error\n\t\treturn $allow;\n\n\t// Admins can access everything\n\tif ($author_session['status'] == 'admin')\n\t\treturn array('r' => true, 'w' => true, 'e' => true, 'a' => true);\n\t\n\t// This gets set later, if appropriate\n\t$id_case = 0;\n\t$id_author = 0;\n\t$case_open = true;\n\n\tif ($app) {\n\t\t// Existing appointment\n\n\t\t//\n\t\t// Check right on case associated with app, if any\n\t\t// + fetch case access rights. Do not trust the client\n\t\t// provided $case\n\t\t//\n\t\t$query = \"SELECT *, p.id_author as p_id_author\n\t\t\tFROM rh_app as p\n\t\t\tLEFT JOIN rh_case_author as ca ON p.id_case = ca.id_case\n\t\t\tLEFT JOIN rh_case as c ON p.id_case = c.id_case\n\t\t\tWHERE id_app = \" . $app;\n\n\t\t//$result = lcm_query($query);\n\n\t\t/*if (! ($row_app = lcm_fetch_array($result)))\n\t\t\treturn $allow; // Case does not exist, should not happen*/\n\n\t\t// Using p_id_author because lcm_case_author also has an id_author\n\t\t$id_author = $row_app['p_id_author'];\n\t\t$id_case = $row_app['id_case'];\n\n\t\tif ($row_app['status'] == 'deleted' || $row_app['status'] == 'closed')\n\t\t\t$case_open = false;\n\t} else {\n\t\t// New appointment\n\t\t$id_author = $author_session['id_author'];\n\n\t\tif ($case) {\n\t\t\t$id_case = intval($case);\n\n\t\t\tif (! ($id_case > 0))\n\t\t\t\treturn $allow;\n\n\t\t\t// Get AC for case\n\t\t\t$query = \"SELECT *\n\t\t\t\tFROM lcm_case as c \n\t\t\t\tLEFT JOIN lcm_case_author as ca ON c.id_case = ca.id_case\n\t\t\t\tWHERE c.id_case = \" . $id_case;\n\n\t\t\t$result = lcm_query($query);\n\n\t\t\tif (! ($row_app = lcm_fetch_array($result)))\n\t\t\t\treturn $allow; // Case does not exist, should not happen\n\n\t\t\tif ($row_app['status'] == 'deleted' || $row_app['status'] == 'closed')\n\t\t\t\t$case_open = false;\n\t\t}\n\t}\n\n\t//\n\t// General idea:\n\t// If case: use case access rights\n\t// Else, check if user is the creator of the app\n\t//\n\n\t// READ ac\n\tif ($id_case) {\n\t\t$allow['r'] = ($row_app['ac_read'] || ($row_app['ac_read'] != '0' && $row_app['public']));\n\t} else {\n\t\t$allow['r'] = ($id_author == $author_session['id_author']);\n\t}\n\n\t// WRITE ac\n\tif ($id_case) {\n\t\t$allow['w'] = ($row_app['ac_write'] || ($row_app['ac_write'] != '0' && $row_app['pub_write']));\n\t\t$allow['w'] &= $case_open;\n\t} else {\n\t\t$allow['w'] = ($id_author == $author_session['id_author']);\n\t}\n\n\t// EDIT ac\n\tif ($id_case) {\n\t\t$allow['e'] = $row_app['ac_edit'];\n\t\t$allow['e'] &= $case_open;\n\t} else {\n\t\t$allow['e'] = ($id_author == $author_session['id_author']);\n\t}\n\n\t// ADMIN ac\n\tif ($id_case) {\n\t\t$allow['a'] = $row_app['ac_admin'];\n\t\t$allow['a'] &= $case_open;\n\t} else {\n\t\t$allow['a'] = ($id_author == $author_session['id_author']);\n\t}\n\n\treturn $allow;\n}",
"public function get($id) {\n if ($this->has($id)) {\n return $this->app[$id];\n } else {\n return NULL;\n }\n }",
"public function getApplicationId()\n {\n return $this->appId;\n }"
] | [
"0.64530474",
"0.5952085",
"0.59274465",
"0.5690198",
"0.56845474",
"0.5641703",
"0.5509917",
"0.5491538",
"0.5487262",
"0.5434707",
"0.5426248",
"0.5377542",
"0.5355667",
"0.5301354",
"0.5297528",
"0.5280836",
"0.5271923",
"0.5268241",
"0.5243152",
"0.5234646",
"0.5220304",
"0.5207817",
"0.52048445",
"0.5186438",
"0.5179492",
"0.5177891",
"0.5168697",
"0.5147642",
"0.51451147",
"0.5135732"
] | 0.60063195 | 1 |
Sets the applicant account (login and pw) for an applicant associated with an application_id. | public function setApplicantAccount($application_ids,$ap_acnt_id) {
if (is_array($application_ids)) $application_ids = implode(',',$application_ids);
$query = 'UPDATE application SET applicant_account_id ='.$ap_acnt_id.' WHERE application_id IN ('.$application_ids.');';
$result = $this->db->query($query);
return($result->execute());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setApplicationId($appId)\n {\n $this->appId = $appId;\n }",
"public static function setApiCredentials(?string $appId = null, ?string $appKey = null): void\n {\n self::$appId = $appId;\n self::$appKey = $appKey;\n }",
"public function getAndSetApplicationUser();",
"public function setAppId($id)\n {\n $this->applicationid = $id;\n return $this;\n }",
"public static function set_app_id($value) {\n\t\tself::set_config('appID', $value);\n\t}",
"private function setAppID($appID) {\n $this->appID = $appID;\n }",
"public function insertApplicantAccountQuery($app){\n\t\t$date = date(\"Y-m-d G:i:s\");\n\t\t$query = 'INSERT INTO applicant_account (\n\t\t\t\tlogin,\n\t\t\t\tpassword,\n\t\t\t\tdate_created,\n\t\t\t\tdate_modified,\n\t\t\t\tmodifying_agent_id\n\t\t\t) VALUES (\n\t\t\t\t\"'.$app->login_id.'\",\n\t\t\t\t\"'.$app->password.'\",\n\t\t\t\t\"'.$date.'\",\n\t\t\t\t\"'.$date.'\",\n\t\t\t\t'.$app->modifying_agent_id.'\n\t\t\t);';\n\t\t$result = $this->db->query($query);\n\n\t\treturn($this->db->lastInsertId());\n\t}",
"public function setApplication(Application $app)\n {\n $this->app = $app;\n }",
"private function SetAppID($appID){\n\t\t$this->appID = $appID;\n\t}",
"public function setAppId($value)\n {\n return $this->set(self::APPID, $value);\n }",
"public function setAccount($id)\n\t{\n\t\t$this->account = $id;\n\t}",
"public function createAppSpecificPassword($appName = null)\n {\n $request = new \\Zimbra\\Account\\Request\\CreateAppSpecificPassword(\n $appName\n );\n return $this->getClient()->doRequest($request);\n }",
"public function setCookie ( $appId = 0 ) {\n\t\t// todoli qd json vide la premiere fois → déclarer app principale + chemin\n\t\t$this->cookie = $this->json->apps[ $appId ]->chemin;\n\t\tsetcookie( self::GC7_COOKIE, $this->cookie, time() + 10 ** 7 );\n\t}",
"public function setApp($app);",
"public function setAppId($value)\n {\n return $this->set(self::APP_ID, $value);\n }",
"public static function setApplication($app)\n\t{\n\t\tstatic::$app = $app;\n\t}",
"public function setApp($app)\n {\n $this->app = $app;\n }",
"public function setApp($app)\n {\n $this->app = $app;\n }",
"public function setApp($app)\n {\n $this->app = $app;\n }",
"public function setAccount($account)\n {\n if (isset($account)) {\n $this->account = $account;\n }\n }",
"public function setApplication(Application $application)\n {\n if ($this->application == null) {\n $this->application = $application;\n }\n }",
"public function setAppId($app_id)\n {\n $this->app_id = $app_id;\n\n return $this;\n }",
"public function setApplicationKey($key){\n\t\t$this->applicationKey = $key;\n\t}",
"public function setApplication($value);",
"function grantPermit($applicationID){\n $query = \"UPDATE applications SET status='Granted' WHERE applicationid = ?\";\n $paramType = \"i\";\n $paramValue = array(\n $applicationID\n );\n $this->db_handle->update($query, $paramType, $paramValue);\n }",
"public static function setApplicationObject(SApplication &$app) {\n\t\tself::$app = &$app;\n\t}",
"public function setApplication(Application $application)\n {\n $this->application = $application;\n }",
"public function setApplication(Application $application)\n {\n $this->application = $application;\n }",
"public function setAppId(string $appId): self\n {\n $this->appId = $appId;\n return $this;\n }",
"public function createupdateappuser()\n\t\t{\n\t\t\t$logger = Logger::getLogger(__CLASS__);\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$taskCode = \"AppUsers\";\n\t\t\t\t$this->LogAccess($taskCode);\n\t\t\t\t$authResult = $this->Authorize($taskCode);\n\t\t\t\tif ($authResult == \"LOGIN\")\n\t\t\t\t{\n\t\t\t\t\treturn $this->view->outputJson(Constants::$LOGIN, \"\", \"\");\n\t\t\t\t}\n\t\t\t\t$_AppUserRequestHelper = new AppUserRequestHelper();\n\t\t\t\t$_AppUser = $_AppUserRequestHelper->AssembleAppUserSignUpControl();\n\t\t\t\t$AppUserID = 0;\n\t\t\t\tif(isset($_GET[\"rstate\"]) && !empty($_GET[\"rstate\"]))\n\t\t\t\t{\n\t\t\t\t\t$AppUserID = RequestStateHelper::GetRequestState(\"AppUserID\", $_GET[\"rstate\"]);\n\t\t\t\t}\n\t\t\t\t$_AppUser->setAppUserID($AppUserID);\n\t\t\t\t$_AppUser->setRequestStateDictionary(RequestStateHelper::SetRequestState(\"AppUserID\", $_AppUser->getAppUserID(), $_AppUser->getRequestStateDictionary()));\n\t\t\t\t$_AppUserBO = new AppUserBO($this->_UserInfo);\n\t\t\t\t$_AppUserValidator = new AppUserValidator();\n\t\t\t\t$_AppUserValidator->ValidateAppUserSignUpControl($_AppUser, $this->_UserInfo);\n\t\t\t\tif (!$_AppUser->getIsValid())\n\t\t\t\t{\n\t\t\t\t\treturn $this->view->outputJson(Constants::$VALERROR, \"\", $_AppUser->getErrors());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ($_AppUser->getAppUserID() > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$_AppUserBO->UpdateAppUser($_AppUser);\n\t\t\t\t\t}\n\t\t\t\t\tif ($_AppUser->getAppUserID() == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$_AppUser->setPassword(CommonUtils::EncryptTripleDES($_AppUser->getPassword()));\n\t\t\t\t\t\t$_AppUserBO->InsertAppUser($_AppUser);\n\t\t\t\t\t}\n\t\t\t\t\t$_AppUser->setPageMessage(\"Record Updated Successfully!\");\n\t\t\t\t\t$_AppUser->setRequestState(\"ContextName\", \"appusers\");\n\t\t\t\t\tob_start();\n\t\t\t\t\tinclude('views/appuser/_appusersconfirmation.php');\n\t\t\t\t\t$output = ob_get_contents();\n\t\t\t\t\tob_end_clean();\n\t\t\t\t\treturn $this->view->outputJson(Constants::$REFRESHCONTENT, $output, \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception $ex)\n\t\t\t{\n\t\t\t\t$logger->error($ex->getMessage());\n\t\t\t}\n\t\t}"
] | [
"0.5799257",
"0.56948346",
"0.55971646",
"0.55831695",
"0.55281067",
"0.5479888",
"0.5420678",
"0.53932846",
"0.53677744",
"0.5224032",
"0.5221941",
"0.5212303",
"0.52071506",
"0.51841277",
"0.5145959",
"0.51431334",
"0.51216704",
"0.51216704",
"0.51216704",
"0.5096746",
"0.50945246",
"0.5081484",
"0.5078858",
"0.5067863",
"0.5053079",
"0.50454223",
"0.50346243",
"0.50346243",
"0.5027998",
"0.50216335"
] | 0.6306198 | 0 |
Gets the application version table entry details for the application_id. | public function getApplicationVersionQuery($application_id) {
$query = 'SELECT application_id AS applicationiId,
date_created AS dateCreated,
date_modified AS dateModified,
version AS version
FROM application_version
WHERE application_id = '.$application_id.';';
$result = $this->db->query($query);
$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);
return($rows);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function applicationVersionQuery($_application);",
"public static function getApplicationInformation($applicationID)\n {\n $sql_application = new SQL_Application();\n return $sql_application->select($applicationID);\n }",
"public function insertApplicationVersionQuery($app){\n\t\t$date = date(\"Y-m-d G:i:s\");\n\t\t$application_version = 0;\n\t\t$query = 'INSERT INTO application_version (\n\t\t\t\tapplication_id,\n\t\t\t\tversion,\n\t\t\t\tdate_created,\n\t\t\t\tdate_modified\n\t\t\t) VALUES (\n\t\t\t\t'.$app->application_id.',\n\t\t\t\t'.$application_version.',\n\t\t\t\t\"'.$date.'\",\n\t\t\t\t\"'.$date.'\"\n\t\t\t);';\n\t\t$result = $this->db->query($query);\n\n\t\treturn($application_version);\n\t}",
"public function getAppVersion()\n {\n return $this->get(self::APP_VERSION);\n }",
"function get_ampache_db_version() { \n\n\t\t$sql = \"SELECT * FROM `update_info` WHERE `key`='db_version'\"; \n\t\t$db_results = Dba::query($sql); \n\n\t\t$results = Dba::fetch_assoc($db_results); \n\n\t\treturn $results['value'];\n\n\t}",
"public function getApplicationDetailsQuery($application_id) {\n\t\t$query = 'SELECT\n\t\t\t\tap.application_id AS application_id,\n\t\t\t\tap.apr AS apr,\n\t\t\t\tap.customer_id AS customer_id,\n\t\t\t\tap.modifying_agent_id AS modifying_agent_id,\n\t\t\t\tap.cfe_rule_set_id AS cfe_ruleset_id,\n\t\t\t\tap.date_first_payment AS date_first_payment,\n\t\t\t\tif(ap.date_fund_actual>\"1990-01-01\",ap.date_fund_actual,NULL) AS date_fund_actual,\n\t\t\t\tap.date_fund_estimated AS date_fund_estimated,\n\t\t\t\tap.date_next_contact AS date_next_contact,\n\t\t\t\tap.finance_charge AS finance_charge,\n\t\t\t\tap.fund_actual AS fund_actual,\n\t\t\t\tap.fund_qualified AS fund_qualified,\n\t\t\t\tap.fund_requested AS fund_requested,\n\t\t\t\tap.is_watched AS is_watched,\n\t\t\t\tap.payment_total AS payment_total,\n\t\t\t\tap.rule_set_id AS rule_set_id,\n\t\t\t\tap.date_modified AS date_modified,\n\t\t\t\tap.call_time_pref AS call_time_pref,\n\t\t\t\tap.contact_method_pref AS contact_method_pref,\n\t\t\t\tap.marketing_contact_pref AS marketing_contact_pref,\n\t\t\t\tap.call_time_pref AS call_time_pref,\n\t\t\t\tap.contact_method_pref AS contact_method_pref,\n\t\t\t\tap.marketing_contact_pref AS marketing_contact_pref,\n\t\t\t\tap.source AS application_source,\n\t\t\t\tap.application_type AS application_type,\n\t\t\t\tIF (av.version IS NULL,1,av.version) AS application_version\n\t\t\tFROM application AS ap\n\t\t\t\tLEFT JOIN application_version AS av ON (ap.application_id = av.application_id)\n\t\t\tWHERE ap.application_id = '.$application_id.';';\n\t\t$result = $this->db->query($query);\n\t\t$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($rows);\n\t}",
"public function getApplicationAuditQuery($application_id) {\n\t\t$query = 'SELECT aa.application_id AS application_id,\n\t\t\t\taa.table_name AS table_name,\n\t\t\t\t\"application_id\" AS primary_key_name,\n\t\t\t\taa.application_id AS primary_key_value,\n\t\t\t\taa.column_name AS column_name,\n\t\t\t\taa.value_before AS old_value,\n\t\t\t\taa.value_after AS new_value,\n\t\t\t\taa.date_created AS date_updated,\n\t\t\t\taa.agent_id AS modifying_agent_id\n\t\t\tFROM application_audit AS aa\n\t\t\tWHERE aa.application_id = '.$application_id.';';\n\t\t$result = $this->db->query($query);\n\t\t$rows = $result->fetchAll(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($rows);\n\t}",
"function getApplicationByID($application_id) { \n $query = \"SELECT * FROM applications WHERE applicationid = ?\";\n $paramType = \"s\";\n $paramValue = array(\n $application_id\n );\n \n $result = $this->db_handle->runQuery($query, $paramType, $paramValue);\n \n\t\treturn $result;\n }",
"public function get() {\n\t\tif ($this->db->table_exists(self::TABLE)) {\n\t\t\t$row = $this->db->get(self::TABLE)->row();\n\t\t\treturn $row->version;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}",
"public function getVersionId()\n {\n return $this->version_id;\n }",
"public static function getApplicationVersion(): int\n {\n return Application::current()->getVersion();\n }",
"public static function getVersionInfo($id, $version=null, $toolname=null, $instance=null)\n\t{\n\t\t$db = \\App::get('db');\n\t\t// data comes from mysql\n\t\t$query = \"SELECT v.*, d.doi_label as doi \";\n\t\t$query .= \"FROM #__tool_version as v LEFT JOIN #__doi_mapping as d ON d.alias = v.toolname AND d.local_revision=v.revision \";\n\t\tif ($id)\n\t\t{\n\t\t\t$query .= \"WHERE v.id = '\".$id.\"' \";\n\t\t}\n\t\telse if ($version && $toolname)\n\t\t{\n\t\t\tif (is_array($toolname))\n\t\t\t{\n\t\t\t\t$query .= \"LEFT JOIN #__tool_version AS v2 ON v2.revision < v.revision AND v2.toolname=v.toolname \";\n\t\t\t\t$query .= \"WHERE v.toolname IN ('\".implode(\"','\", $toolname).\"') \";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$query.= \"WHERE v.toolname='\".$toolname.\"' \";\n\t\t\t}\n\t\t\tswitch ($version)\n\t\t\t{\n\t\t\t\tcase 'current':\n\t\t\t\t\t$query .= \"AND v.state=1 ORDER BY v.revision DESC\";\n\t\t\t\t\tif (!is_array($toolname))\n\t\t\t\t\t{\n\t\t\t\t\t\t$query .= \" LIMIT 1\";\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 'dev':\n\t\t\t\t\t$query .= \"AND v.state=3\";\n\t\t\t\t\tif (!is_array($toolname))\n\t\t\t\t\t{\n\t\t\t\t\t\t$query .= \" LIMIT 1\";\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$query .= \"AND v.version = '\".$version.\"' \";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telse if ($instance)\n\t\t{\n\t\t\t$query.= \"WHERE v.instance='\".$instance.\"' \";\n\t\t}\n\t\t$db->setQuery( $query );\n\t\treturn $db->loadObjectList();\n\t}",
"public function getVersion()\n {\n $this->db->order_by('id', 'desc');\n return $this->db->get('version', 1)->result();\n }",
"public function getAppVersion()\n {\n if (array_key_exists(\"appVersion\", $this->_propDict)) {\n return $this->_propDict[\"appVersion\"];\n } else {\n return null;\n }\n }",
"public function getDetailsById($appId)\n { \n $sql = $this->select();\n $sql->from($this->_name,array('name', 'price', 'user_id'))\n ->where('id = ?',$appId); \n \n return $this->fetchRow($sql);\n \n }",
"private function getTableVersions(){\n\t\t// Needs a new class for default connection\n\t\t$Database = new \\Database();\n\t\t\n\t\t// Grab all table versions\n\t\tif($Database->Q(array(\n\t\t\t'assoc' => array('connection','title'),\n\t\t\t'query' => 'SELECT title,connection,version FROM fks_versions'\n\t\t))) {\n\t\t\treturn $Database->r['rows'];\n\t\t} else {\n\t\t\treturn array();\n\t\t}\n\t}",
"function get_application_view($program_id) {\n $this->grail->select('application_filename');\n $this->grail->join('client_programs_to_applications', \n 'client_programs_to_applications.application_id = client_applications.application_id');\n $this->grail->where('client_program_id', $program_id);\n $this->grail->from('client_applications'); \n $application_filename = $this->value_or_false($this->grail->get(), 'application_filename');\n\n return $application_filename;\n }",
"public function getVersionID()\n {\n return $this->versionID;\n }",
"public function obtainObjectVersion ()\n {\n return $this->getInvoker()->get($this->getOption('versionColumn'));\n }",
"public function getApplicationId()\n {\n return $this->application_id;\n }",
"public function getApplicationData(){\n $application = $this->at->application();\n\n return $application->fetchApplicationData();\n }",
"public function versionSelected()\n {\n return $this->db->get('ac_version');\n }",
"public function getApplicantQuery($application_id) {\n\t\t$query = 'SELECT ap.date_modified AS date_modified,\n\t\t\t\tap.date_created AS date_created,\n\t\t\t\tap.application_id AS application_id,\n\t\t\t\tap.external_id AS external_id,\n\t\t\t\tap.legal_id_type AS legal_id_type,\n\t\t\t\tap.tenancy_type AS tenancy_type,\n\t\t\t\tap.dob AS date_of_birth,\n\t\t\t\tap.dob AS dob,\n\t\t\t\t0 AS date_of_birth_id,\n\t\t\t\tap.legal_id_number AS legal_id_number,\n\t\t\t\t0 AS legal_id_number_id,\n\t\t\t\tap.legal_id_state AS legal_id_state,\n\t\t\t\tap.ssn AS ssn,\n\t\t\t\tsubstr(ap.ssn,7,4) AS ssn_last_four,\n\t\t\t\tap.name_last AS name_last,\n\t\t\t\tap.name_first AS name_first,\n\t\t\t\tap.street AS street,\n\t\t\t\tap.city AS city,\n\t\t\t\tap.county AS county,\n\t\t\t\tap.unit AS unit,\n\t\t\t\tap.state AS state,\n\t\t\t\tap.zip_code AS zip_code,\t\t\t\t\n\t\t\t\tap.dob AS dob,\n\t\t\t\tap.age AS age,\n\t\t\t\tap.residence_start_date AS residence_start_date,\n\t\t\t\tsubstr(ap.ssn,7,4) AS ssn_last4,\n\t\t\t\tIF (av.version IS NULL,1,av.version) AS application_version,\n\t\t\t\tap.modifying_agent_id AS modifying_agent_id\n\t\t\tFROM application AS ap\n\t\t\t\tLEFT JOIN application_version AS av USING (application_id)\n\t\t\tWHERE ap.application_id = '.$application_id.';';\n\n\t\t$result = $this->db->query($query);\n\t\t$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($rows);\n\t}",
"public function getApplicationStatusHistoryQuery($application_id) {\n\t\t$result = array();\n\t\t$query = 'SELECT ash.application_id AS application_id,\n\t\t\t\tash.date_created AS dateCreated,\n\t\t\t\tash.agent_id AS modifyingAgentId,\n\t\t\t\tash.agent_id AS modifying_agent_id,\n\t\t\t\tash.status_history_id AS statusHistoryId,\n\t\t\t\tash.application_status_id AS id\n\t\t\tFROM status_history AS ash \n\t\t\tWHERE ash.application_id = '.$application_id.\n\t\t\t' ORDER BY ash.date_created;';\n\t\t$result = $this->db->query($query);\n\t\t$return = $result->fetchAll(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($return);\n\t}",
"private function Get_App_Data_From_OLP($application_id)\n\t{\n\t\t$data = array();\n\n\t\t$query = \"\n\t\t\tSELECT\n\t\t\t\tfirst_name\t\tAS name_first,\n\t\t\t\tmiddle_name\t\tAS name_middle,\n\t\t\t\tlast_name\t\tAS name_last,\n\t\t\t\temail\t\t\tAS email_primary,\n\t\t\t\thome_phone\t\tAS phone_home,\n\t\t\t\tcell_phone\t\tAS phone_cell,\n\t\t\t\twork_phone\t\tAS phone_work,\n\t\t\t\tfax_phone\t\tAS phone_fax,\n\t\t\t\twork_ext\t\tAS ext_work,\n\n\t\t\t\tdate_of_birth\tAS dob,\n\t\t\t\tsocial_security_number AS ssn,\n\n\t\t\t\taddress_1\t\tAS home_street,\n\t\t\t\tcity\t\t\tAS home_city,\n\t\t\t\tstate\t\t\tAS home_state,\n\t\t\t\tzip\t\t\t\tAS home_zip,\n\t\t\t\tapartment\t\tAS home_unit,\n\n\t\t\t\temployer\t\tAS employer_name,\n\t\t\t\tdrivers_license_number\tAS state_id_number,\n\n\t\t\t\tdirect_deposit\tAS income_direct_deposit,\n\t\t\t\tincome_type,\n\t\t\t\tpay_frequency\tAS income_frequency,\n\t\t\t\tbank_name,\n\t\t\t\taccount_number\tAS bank_account,\n\t\t\t\trouting_number\tAS bank_aba,\n\t\t\t\tmonthly_net\t\tAS income_monthly_net,\n\t\t\t\tbank_account_type,\n\n\t\t\t\tpaydate_model_id\tAS paydate_model,\n\t\t\t\tIFNULL(ELT(day_of_week, 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'), 'SUN') AS day_of_week,\n\t\t\t\tDATE_FORMAT(pay_date_1, '%Y-%m-%d') AS next_paydate,\n\t\t\t\tday_of_month_1,\n\t\t\t\tday_of_month_2,\n\t\t\t\tweek_1,\n\t\t\t\tweek_2,\n\n\t\t\t\tDATE_FORMAT(pay_date_1, '%Y-%m-%d') AS pay_date_1,\n\t\t\t\tDATE_FORMAT(pay_date_2, '%Y-%m-%d') AS pay_date_2,\n\t\t\t\tDATE_FORMAT(pay_date_3, '%Y-%m-%d') AS pay_date_3,\n\t\t\t\tDATE_FORMAT(pay_date_4, '%Y-%m-%d') AS pay_date_4,\n\n\t\t\t\tfund_amount,\n\t\t\t\tnet_pay,\n\t\t\t\tfinance_charge,\n\t\t\t\tapr,\n\t\t\t\ttotal_payments,\n\t\t\t\tDATE_FORMAT(estimated_fund_date, '%Y-%m-%d') AS fund_date,\n\t\t\t\tDATE_FORMAT(estimated_payoff_date, '%Y-%m-%d') AS payoff_date,\n\t\t\t\t\n\t\t\t\tbest_call_time,\n\t\t\t\tip_address\t\tAS client_ip_address\n\n\t\t\t\t#residence_start_date,\n\t\t\t\t#banking_start_date,\n\t\t\t\t#date_of_hire,\n\t\t\t\t#title AS work_title,\n\n\t\t\t\t#engine AS vehicle_engine,\n\t\t\t\t#keywords AS vehicle_keywords,\n\t\t\t\t#year AS vehicle_year,\n\t\t\t\t#make AS vehicle_make,\n\t\t\t\t#model AS vehicle_model,\n\t\t\t\t#series AS vehicle_series,\n\t\t\t\t#style AS vehicle_style,\n\t\t\t\t#mileage AS vehicle_mileage,\n\t\t\t\t#vin AS vehicle_vin,\n\t\t\t\t#value AS vehicle_value,\n\t\t\t\t#color AS vehicle_color,\n\t\t\t\t#license_plate AS vehicle_license_plate,\n\t\t\t\t#title_state AS vehicle_title_state\n\t\t\tFROM\n\t\t\t\tpersonal\n\t\t\t\tINNER JOIN residence USING (application_id)\n\t\t\t\tINNER JOIN bank_info USING (application_id)\n\t\t\t\tINNER JOIN employment USING (application_id)\n\t\t\t\tINNER JOIN loan_note USING (application_id)\n\t\t\t\tINNER JOIN income USING (application_id)\n\t\t\t\tINNER JOIN paydate USING (application_id)\n\t\t\t\tINNER JOIN campaign_info USING (application_id)\n\t\t\t\t#LEFT JOIN vehicle USING (application_id)\n\t\t\tWHERE\n\t\t\t\tpersonal.application_id = {$application_id}\n\t\t\t\tAND campaign_info.active = 'TRUE'\n\t\t\tLIMIT 1\n\t\t\";\n\n\t\t$mysql_result = $this->olp_sql->Query($this->olp_db, $query);\n\n\t\tif($mysql_result && ($data = $this->olp_sql->Fetch_Array_Row($mysql_result)))\n\t\t{\n\t\t\t$data['paydate'] = array('frequency' => $data['income_frequency']);\n\n\t\t\tlist($data['date_dob_y'], $data['date_dob_m'], $data['date_dob_d']) = explode('-', $data['dob']);\n\t\t\t$data['ssn_part_1'] = substr($data['ssn'], 0, 3);\n\t\t\t$data['ssn_part_2'] = substr($data['ssn'], 3, 2);\n\t\t\t$data['ssn_part_3'] = substr($data['ssn'], 5);\n\n\t\t\t//Taken from ent_cs and slightly modified\n\t\t\tswitch($data['paydate']['frequency'])\n\t\t\t{\n\t\t\t\tcase 'WEEKLY':\n\t\t\t\t\t$data['paydate']['weekly_day'] = $data['day_of_week'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'BI_WEEKLY':\n\t\t\t\t\t$data['paydate']['biweekly_day'] = $data['day_of_week'];\n\t\t\t\t\t$data['paydate']['biweekly_date'] = $data['next_paydate'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'TWICE_MONTHLY':\n\t\t\t\t\tswitch($data['paydate_model'])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'DMDM':\n\t\t\t\t\t\t\t$data['paydate']['twicemonthly_type'] = 'date';\n\t\t\t\t\t\t\t$data['paydate']['twicemonthly_date1'] = $data['day_of_month_1'];\n\t\t\t\t\t\t\t$data['paydate']['twicemonthly_date2'] = $data['day_of_month_2'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$data['paydate']['twicemonthly_type'] = 'week';\n\t\t\t\t\t\t\t$data['paydate']['twicemonthly_week'] = sprintf( '%s-%s', $data['week_1'], $data['week_2'] );\n\t\t\t\t\t\t\t$data['paydate']['twicemonthly_day'] = $data['day_of_week'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'MONTHLY':\n\t\t\t\t\tswitch($data['paydate_model'])\n\t\t\t\t\t{\n\n\t\t\t\t\t\tcase 'DM':\n\t\t\t\t\t\t//rsk changed from week\n\t\t\t\t\t\t\t$data['paydate']['monthly_type'] = 'date';\n\t\t\t\t\t\t\t$data['paydate']['monthly_date'] = $data['day_of_month_1'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'WDW':\n\t\t\t\t\t\t\t$data['paydate']['monthly_type'] = 'day';\n\t\t\t\t\t\t\t$data['paydate']['monthly_week'] = $data['week_1'];\n\t\t\t\t\t\t\t$data['paydate']['monthly_day'] = $data['day_of_week'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$data['paydate']['monthly_type'] = 'after';\n\t\t\t\t\t\t\t$data['paydate']['monthly_after_day'] = $data['day_of_week'];\n\t\t\t\t\t\t\t$data['paydate']['monthly_after_date'] = $data['day_of_month_1'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$data['social_security_number'] = $data['ssn'];\n\t\t\t\n\t\t\t//Create the paydates\n\t\t\t$data['paydates'] = array();\n\t\t\tfor($i = 1; $i <= 4; $i++)\n\t\t\t{\n\t\t\t\t$data['paydates'][] = $data['pay_date_' . $i];\n\t\t\t\tunset($data['pay_date_' . $i]);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//Create qualify information\n\t\t\t$data['qualify_info'] = array(\n\t\t\t\t'fund_date'\t\t=> $data['fund_date'],\n\t\t\t\t'payoff_date'\t=> $data['payoff_date'],\n\t\t\t\t'fund_amount'\t=> $data['fund_amount'],\n\t\t\t\t'net_pay'\t\t=> $data['net_pay'],\n\t\t\t\t'finance_charge'=> $data['finance_charge'],\n\t\t\t\t'apr'\t\t\t=> $data['apr'],\n\t\t\t\t'total_payments'=> $data['total_payments']\n\t\t\t);\n\t\t\t\n\t\t\t\n\t\t\t//Unset unneeded information\n\t\t\tunset($data['ssn'], $data['dob']);\n\n\n\t\t\t$ref_query = \"\n\t\t\t\tSELECT\n\t\t\t\t\tfull_name\tAS name_full,\n\t\t\t\t\tphone\t\tAS phone_home,\n\t\t\t\t\trelationship\n\t\t\t\tFROM\n\t\t\t\t\tpersonal_contact\n\t\t\t\tWHERE\n\t\t\t\t\tapplication_id = {$application_id}\";\n\n\t\t\t$ref_result = $this->olp_sql->Query($this->olp_db, $ref_query);\n\n\t\t\t$count = 0;\n\t\t\twhile($row = $this->olp_sql->Fetch_Array_Row($ref_result))\n\t\t\t{\n\t\t\t\t$ref_count = sprintf('%02d', ++$count);\n\n\t\t\t\t$data['ref_' . $ref_count . '_name_full'] = $row['name_full'];\n\t\t\t\t$data['ref_' . $ref_count . '_phone_home'] = $row['phone_home'];\n\t\t\t\t$data['ref_' . $ref_count . '_relationship'] = $row['relationship'];\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//Create our paydate_model\n\t\t\t$model = new Paydate_Model();\n\t\t\t$model_result = $model->Build_From_Data($data['paydate']);\n\t\t\t\n\t\t\tif($model_result === TRUE)\n\t\t\t{\n\t\t\t\t$data['paydate_model'] = $model->Model_Data();\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}",
"static function version_info() {\n return unserialize(Cache::instance()->get(\"upgrade_checker_version_info\"));\n }",
"function blog_version() {\n\n\t// Create a new app instance.\n\t$App = new App;\n\n\treturn $App->app_version;\n\n}",
"public function getApplicationId()\n\t{\n\t\treturn $this->application_id;\n\t}",
"public function get_application( $application_id ) {\n \n $this->db->select('*');\n $this->db->from('oauth_applications');\n $this->db->where(array(\n 'application_id' => $application_id\n )\n );\n $this->db->limit(1);\n $query = $this->db->get();\n \n if ( $query->num_rows() > 0 ) {\n \n $results = $query->result();\n \n return $results;\n \n } else {\n \n return false;\n \n }\n \n }",
"public function findApplication($application_id) {\n\t\t$query = 'SELECT ap.application_id AS application_id,\n\t\t\tap.apr AS apr,\n\t\t\tap.cfe_rule_set_id AS cfe_ruleset_id,\n\t\t\tap.company_id AS company_id,\n\t\t\tap.customer_id AS customer_id,\n\t\t\tap.date_application_status_set AS date_application_status_set,\n\t\t\tap.date_created AS date_created,\n\t\t\tap.date_first_payment AS date_first_payment,\n\t\t\tif(ap.date_fund_actual>\"1990-01-01\",ap.date_fund_actual,NULL) AS date_fund_actual,\n\t\t\tap.date_fund_estimated AS date_fund_estimated,\n\t\t\tap.date_modified AS date_modified,\n\t\t\tap.date_next_contact AS date_next_contact,\n\t\t\tap.enterprise_site_id AS enterprise_site_id,\n\t\t\tap.external_id AS external_id,\n\t\t\tap.finance_charge AS finance_charge,\n\t\t\tap.fund_actual AS fund_actual,\n\t\t\tap.fund_qualified AS fund_qualified,\n\t\t\tap.fund_requested AS fund_requested,\n\t\t\tap.ip_address AS ip_address,\n\t\t\tap.esig_ip_address AS esig_ip_address,\n\t\t\tap.is_react AS is_react,\n\t\t\tap.is_watched AS is_watched,\n\t\t\tap.loan_type_id AS loan_type_id,\n\t\t\tap.modifying_agent_id AS modifying_agent_id,\n\t\t\tap.payment_total AS payment_total,\n\t\t\tap.price_point AS price_point,\n\t\t\tap.rule_set_id AS rule_set_id,\n\t\t\tap.track_id AS track_key,\n\t\t\tap.application_status_id AS application_status_id,\n\t\t\tap.call_time_pref AS call_time_pref,\n\t\t\tap.contact_method_pref AS contact_method_pref,\n\t\t\tap.marketing_contact_pref AS marketing_contact_pref,\n\t\t\tap.olp_process AS olp_process,\n\t\t\tap.application_type AS application_type,\n\t\t\tap.application_id AS application_id,\n\t\t\tap.source AS application_source\n\t\tFROM application AS ap WHERE ap.application_id = '.$application_id.';';\n\n\t\t$result = $this->db->query($query);\n\t\t$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($rows);\n\t}"
] | [
"0.63187265",
"0.60580415",
"0.5958927",
"0.59504336",
"0.58035344",
"0.5802419",
"0.57578015",
"0.57234865",
"0.5720004",
"0.5656426",
"0.5636766",
"0.5609526",
"0.5604544",
"0.55991024",
"0.54831165",
"0.5462793",
"0.546153",
"0.545885",
"0.54373145",
"0.5430949",
"0.539165",
"0.5391235",
"0.5389592",
"0.5359205",
"0.53467894",
"0.53465074",
"0.53412",
"0.5335024",
"0.53105265",
"0.5310361"
] | 0.71091074 | 0 |
Gets the applicant account table entry detail for the application_id. | public function getApplicantAccountQuery($application_id) {
$query = 'SELECT aa.applicant_account_id AS applicant_account_id,
aa.applicant_account_id AS customer_id,
ap.application_id AS application_id,
aa.password AS password,
aa.login AS login,
aa.modifying_agent_id AS modifying_agent_id
FROM application AS ap
JOIN applicant_account AS aa USING (applicant_account_id)
WHERE ap.application_id = '.$application_id.';';
$result = $this->db->query($query);
$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);
return($rows);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getApplicationProfile($app_id) {\n $em = $this->em;\n $app_data = $em->getRepository('SixthContinentConnectBundle:Application')\n ->findOneBy(array('applicationId' => $app_id));\n if (!$app_data) {\n return false;\n }\n return $app_data;\n }",
"public static function getAccountDetails()\n {\n return self::fetchAdmin($_SESSION['admin_id']);\n }",
"public function getApplicationBusinessAccount($app_id) {\n $em = $this->em;\n $app_business_data = $em->getRepository('SixthContinentConnectBundle:ApplicationBusinessAccount')\n ->findOneBy(array('applicationId' => $app_id, 'isActive'=>1, 'isDeleted'=>0));\n if (!$app_business_data) {\n return false;\n }\n return $app_business_data;\n }",
"public function getApplicantQuery($application_id) {\n\t\t$query = 'SELECT ap.date_modified AS date_modified,\n\t\t\t\tap.date_created AS date_created,\n\t\t\t\tap.application_id AS application_id,\n\t\t\t\tap.external_id AS external_id,\n\t\t\t\tap.legal_id_type AS legal_id_type,\n\t\t\t\tap.tenancy_type AS tenancy_type,\n\t\t\t\tap.dob AS date_of_birth,\n\t\t\t\tap.dob AS dob,\n\t\t\t\t0 AS date_of_birth_id,\n\t\t\t\tap.legal_id_number AS legal_id_number,\n\t\t\t\t0 AS legal_id_number_id,\n\t\t\t\tap.legal_id_state AS legal_id_state,\n\t\t\t\tap.ssn AS ssn,\n\t\t\t\tsubstr(ap.ssn,7,4) AS ssn_last_four,\n\t\t\t\tap.name_last AS name_last,\n\t\t\t\tap.name_first AS name_first,\n\t\t\t\tap.street AS street,\n\t\t\t\tap.city AS city,\n\t\t\t\tap.county AS county,\n\t\t\t\tap.unit AS unit,\n\t\t\t\tap.state AS state,\n\t\t\t\tap.zip_code AS zip_code,\t\t\t\t\n\t\t\t\tap.dob AS dob,\n\t\t\t\tap.age AS age,\n\t\t\t\tap.residence_start_date AS residence_start_date,\n\t\t\t\tsubstr(ap.ssn,7,4) AS ssn_last4,\n\t\t\t\tIF (av.version IS NULL,1,av.version) AS application_version,\n\t\t\t\tap.modifying_agent_id AS modifying_agent_id\n\t\t\tFROM application AS ap\n\t\t\t\tLEFT JOIN application_version AS av USING (application_id)\n\t\t\tWHERE ap.application_id = '.$application_id.';';\n\n\t\t$result = $this->db->query($query);\n\t\t$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($rows);\n\t}",
"public function getAccountId(){\n return $this->account_id;\n }",
"public function findPreviousApplicantAccountQuery($app){\n\t\t$query = 'SELECT ap.ssn AS ssn,\n\t\t\t\tap.dob AS dob,\n\t\t\t\tap.email AS email,\n\t\t\t\tap.applicant_account_id AS applicant_account_id,\n\t\t\t\taa.login AS login_id,\n\t\t\t\taa.password AS password\n\t\t\tFROM application ap\n\t\t\t\tJOIN applicant_account AS aa USING (applicant_account_id)\n\t\t\tWHERE ap.ssn = '.$app->ssn.'\n\t\t\t\tAND ap.dob = \"'.date(\"Y-m-d\",strtotime($app->dob)).'\";';\n\t\t\t\t//AND ap.email =\"'.$app->email.'\"\n\t\t$result = $this->db->query($query);\n\t\t$row = $result->fetch(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($row);\n\t}",
"public static function getApplicationInformation($applicationID)\n {\n $sql_application = new SQL_Application();\n return $sql_application->select($applicationID);\n }",
"public function getAccountId()\n {\n return $this->id;\n }",
"public function get_applicant($applicant_id) {\n\n $result = $this->doQuery(sprintf(\"\n SELECT C.NAME,\n C.EMAIL,\n A.PHONE,\n A.HIGHEST_DEGREE,\n A.YEARS_EXPERIENCE,\n A.CITIZENSHIP,\n A.BIRTH_YEAR,\n A.DESCRIPTION\n FROM APPLICANT A,\n CUSTOMER C\n WHERE A.USER_ID = C.USER_ID\n AND A.USER_ID = '%s';\",\n mysql_real_escape_string($applicant_id)\n ));\n\n $row = mysql_fetch_assoc($result);\n\n if (!$row) {\n return false;\n }\n\n $applicant = array(\n 'name' => $row['NAME'],\n 'email' => $row['EMAIL'],\n 'phone' => $row['PHONE'],\n 'degree' => $row['HIGHEST_DEGREE'],\n 'experience' => $row['YEARS_EXPERIENCE'],\n 'citizenship' => $row['CITIZENSHIP'],\n 'birth' => $row['BIRTH_YEAR'],\n 'description' => $row['DESCRIPTION']\n );\n\n return $applicant;\n\n }",
"public function getDetailsById($appId)\n { \n $sql = $this->select();\n $sql->from($this->_name,array('name', 'price', 'user_id'))\n ->where('id = ?',$appId); \n \n return $this->fetchRow($sql);\n \n }",
"public function fngetapplicantTabDetails($id) {\n $lobjDbAdpt = Zend_Db_Table::getDefaultAdapter();\n $lstrSelect = $lobjDbAdpt->select()\n ->from(array('tbl_applicant') ,array(\"tabValue\" => \"tab_value\"))\n \t\t\t\t\t->where('IdApplicant = ?', $id);\n $larrResult = $lobjDbAdpt->fetchAll($lstrSelect);\n return $larrResult;\n }",
"function getApplicant( $pidm )\n\t{\n\t\tif( !isset($GLOBALS['BannerGeneral']) ){\n\t\t\trequire_once('BannerGeneral.class.php');\n\t\t\t$GLOBALS['BannerGeneral'] = new BannerGeneral( PSU::db('banner') );\n\t\t}\n\n\t\t$return = array();\n\n\t\t$return['email'] = self::getApplicantEmail( $pidm );\n\t\t$return['name_first'] = ucwords( PSU::get('idmobject')->getName( $pidm , 'f'));\n\t\t$return['username'] = PSU::get('idmobject')->getIdentifier( $pidm,'pid','login_name' );\n\t\t$return['ldap_user'] = PSU::get('idmobject')->getIdentifier( $pidm,'pid','username' );\n\t\tif( preg_match( '/^app\\./i', $return['username'] )){\n\t\t\t$return['username'] = preg_replace( '/^app\\./i', '', $return['username'] );\n\t\t\t$return['password'] = $GLOBALS['BannerGeneral']->getPin( $pidm );\n\t\t}\n\t\t$return['psuid'] = PSU::get('idmobject')->getIdentifier( $pidm , 'pidm', 'id' );\n\t\t$return['pidm'] = $pidm;\n\n\t\t$v_ug_app = PSU::db('banner')->GetRow( 'SELECT * FROM v_ug_app WHERE pidm = :pidm', compact('pidm') );\n\t\t$return['term_code_entry'] = $v_ug_app['term_code_entry'];\n\t\t$return['apdc_code'] = $v_ug_app['apdc_code'];\n\n\t\treturn( $return );\n\t}",
"public function getApplicationId()\n {\n return $this->application_id;\n }",
"public function get_application( $application_id ) {\n \n $this->db->select('*');\n $this->db->from('oauth_applications');\n $this->db->where(array(\n 'application_id' => $application_id\n )\n );\n $this->db->limit(1);\n $query = $this->db->get();\n \n if ( $query->num_rows() > 0 ) {\n \n $results = $query->result();\n \n return $results;\n \n } else {\n \n return false;\n \n }\n \n }",
"public function getAccount( $id )\n\t{\n\t\treturn $this->model->getAccount( Security::sanitize($id, 'integer') );\n\t}",
"function get_aq2emp_account($id)\n {\n return $this->db->get_where('aq2emp_accounts',array('id'=>$id))->row_array();\n }",
"public function getAccountId();",
"function getApplicationByID($application_id) { \n $query = \"SELECT * FROM applications WHERE applicationid = ?\";\n $paramType = \"s\";\n $paramValue = array(\n $application_id\n );\n \n $result = $this->db_handle->runQuery($query, $paramType, $paramValue);\n \n\t\treturn $result;\n }",
"public function getApplicationId()\n {\n return $this->appId;\n }",
"public function getAccountId()\n {\n return $this->accountId;\n }",
"public function getAccountId()\n {\n return $this->accountId;\n }",
"public function getAccountId()\n {\n return $this->accountId;\n }",
"public function getApplicationId()\n\t{\n\t\treturn $this->application_id;\n\t}",
"public function insertApplicantAccountQuery($app){\n\t\t$date = date(\"Y-m-d G:i:s\");\n\t\t$query = 'INSERT INTO applicant_account (\n\t\t\t\tlogin,\n\t\t\t\tpassword,\n\t\t\t\tdate_created,\n\t\t\t\tdate_modified,\n\t\t\t\tmodifying_agent_id\n\t\t\t) VALUES (\n\t\t\t\t\"'.$app->login_id.'\",\n\t\t\t\t\"'.$app->password.'\",\n\t\t\t\t\"'.$date.'\",\n\t\t\t\t\"'.$date.'\",\n\t\t\t\t'.$app->modifying_agent_id.'\n\t\t\t);';\n\t\t$result = $this->db->query($query);\n\n\t\treturn($this->db->lastInsertId());\n\t}",
"public function account()\n {\n return $this->account;\n }",
"public function getAccountId()\n {\n return $this->getFieldValue('account_id');\n }",
"public abstract function getActiveAccountId();",
"public function getApplicationDetailsQuery($application_id) {\n\t\t$query = 'SELECT\n\t\t\t\tap.application_id AS application_id,\n\t\t\t\tap.apr AS apr,\n\t\t\t\tap.customer_id AS customer_id,\n\t\t\t\tap.modifying_agent_id AS modifying_agent_id,\n\t\t\t\tap.cfe_rule_set_id AS cfe_ruleset_id,\n\t\t\t\tap.date_first_payment AS date_first_payment,\n\t\t\t\tif(ap.date_fund_actual>\"1990-01-01\",ap.date_fund_actual,NULL) AS date_fund_actual,\n\t\t\t\tap.date_fund_estimated AS date_fund_estimated,\n\t\t\t\tap.date_next_contact AS date_next_contact,\n\t\t\t\tap.finance_charge AS finance_charge,\n\t\t\t\tap.fund_actual AS fund_actual,\n\t\t\t\tap.fund_qualified AS fund_qualified,\n\t\t\t\tap.fund_requested AS fund_requested,\n\t\t\t\tap.is_watched AS is_watched,\n\t\t\t\tap.payment_total AS payment_total,\n\t\t\t\tap.rule_set_id AS rule_set_id,\n\t\t\t\tap.date_modified AS date_modified,\n\t\t\t\tap.call_time_pref AS call_time_pref,\n\t\t\t\tap.contact_method_pref AS contact_method_pref,\n\t\t\t\tap.marketing_contact_pref AS marketing_contact_pref,\n\t\t\t\tap.call_time_pref AS call_time_pref,\n\t\t\t\tap.contact_method_pref AS contact_method_pref,\n\t\t\t\tap.marketing_contact_pref AS marketing_contact_pref,\n\t\t\t\tap.source AS application_source,\n\t\t\t\tap.application_type AS application_type,\n\t\t\t\tIF (av.version IS NULL,1,av.version) AS application_version\n\t\t\tFROM application AS ap\n\t\t\t\tLEFT JOIN application_version AS av ON (ap.application_id = av.application_id)\n\t\t\tWHERE ap.application_id = '.$application_id.';';\n\t\t$result = $this->db->query($query);\n\t\t$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($rows);\n\t}",
"public function getAccount()\n {\n return $this->account;\n }",
"public function getAccount()\n {\n return $this->account;\n }"
] | [
"0.6266431",
"0.61769205",
"0.6051602",
"0.598933",
"0.585746",
"0.584727",
"0.58057696",
"0.5762553",
"0.5755224",
"0.5739213",
"0.5728454",
"0.5727507",
"0.5717988",
"0.5696601",
"0.56593746",
"0.56364477",
"0.5636019",
"0.5597449",
"0.55928993",
"0.5585358",
"0.5585358",
"0.5585358",
"0.55672294",
"0.5548939",
"0.5524728",
"0.54793775",
"0.5444282",
"0.5443773",
"0.544287",
"0.544287"
] | 0.65863156 | 0 |
Gets the application ids for all applications related to a customer id (applicant_account_id). | public function getApplicationIdsForCustomerQuery($customer_id) {
$query = 'SELECT ap.application_id AS application_id
FROM application AS ap
WHERE ap.applicant_account_id = '.$customer_id.';';
$result = $this->db->query($query);
$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);
return($rows);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getApplicantAccountQuery($application_id) {\n\t\t$query = 'SELECT aa.applicant_account_id AS applicant_account_id,\n\t\t\t\taa.applicant_account_id AS customer_id,\n\t\t\t\tap.application_id AS application_id,\n\t\t\t\taa.password AS password,\n\t\t\t\taa.login AS login,\n\t\t\t\taa.modifying_agent_id AS modifying_agent_id\n\t\t\tFROM application AS ap\n\t\t\t\tJOIN applicant_account AS aa USING (applicant_account_id)\n\t\t\tWHERE ap.application_id = '.$application_id.';';\n\t\t$result = $this->db->query($query);\n\t\t$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($rows);\n\t}",
"public function get_applications_for_applicant($applicant_id, $show_all) {\n\n $query = sprintf(\"\n SELECT J.JOB_ID,\n J.TITLE,\n R.COMPANY_NAME,\n R.USER_ID AS RECRUITER_ID,\n A.OPEN_DATE,\n A.STATUS\n FROM JOB J,\n RECRUITER R,\n APPLICATION A\n WHERE J.POSTED_BY = R.USER_ID\n AND A.JOB_ID = J.JOB_ID\n AND A.APPLICANT_ID = '%s'\",\n mysql_real_escape_string($applicant_id)\n );\n\n if (!$show_all) {\n $query .= \"\n AND A.CLOSE_DATE IS NULL\";\n }\n\n $query .= \";\";\n\n $result = $this->doQuery($query);\n\n $applications = array();\n\n while ($row = mysql_fetch_assoc($result)) {\n $applications[] = array(\n 'id' => $row['JOB_ID'],\n 'title' => $row['TITLE'],\n 'recruiter_id' => $row['RECRUITER_ID'],\n 'company' => $row['COMPANY_NAME'],\n 'date_applied' => strtotime($row['OPEN_DATE']),\n 'status' => $row['STATUS']\n );\n }\n\n return $applications;\n\n }",
"public function findAllWithAppsByClientId($iClientId)\n {\n $iClientId = intval($iClientId);\n if ($iClientId <= 0) {\n throw new AM_Exception('Wrong parameter CLIENT_ID given');\n }\n\n $oAppsSubquery = $this->_findWithApplicationSubquery();\n\n $oQuery = $this->_findAllQuery()\n ->setIntegrityCheck(false)\n ->joinInner($oAppsSubquery, 'app_client_id = user.client')\n ->where('user.client = ?', $iClientId);\n $oUsers = $this->fetchAll($oQuery);\n\n return $oUsers;\n }",
"private function getApplications()\n {\n $stmt = $this->user->isFinancialInstitutionStaff() || $this->user->isEmployerStaff() ?\n $this->user->institutable->loanApplications() :\n $this->user->loanApplications();\n\n if ($this->user->isFinancialInstitutionStaff()) {\n $stmt->whereIn(\n 'loan_application_status_id',\n LoanApplicationStatus::getPartnerNonDisbursedStatuses()->pluck('id')->all()\n );\n }\n\n // Employers can access all employee loans which have been submitted for approval\n if ($this->user->isEmployerStaff()) {\n $status = LoanApplicationStatus::getDraftStatus();\n $stmt->where('loan_application_status_id', '<>', $status->id);\n }\n\n return $stmt\n // Employers and borrowers can filter applications by institution\n ->when($this->request->has('institution_id'), function ($q) {\n return $q->where('institution_id', $this->request->get('institution_id'));\n })\n // Employers and financial institutions can filter applications by borrower\n ->when($this->request->has('borrower_id'), function ($q) {\n return $q->where('user_id', $this->request->get('borrower_id'));\n })\n // Financial institutions and borrowers can filter applications by employer\n ->when($this->request->has('employer_id'), function ($q) {\n return $q->where('employer_id', $this->request->get('employer_id'));\n })\n ->orderBy('created_at', 'desc')\n ->paginate($this->request->get('limit', 15));\n }",
"public function applications_for_job($job_id) {\n\n $result = $this->doQuery(sprintf(\"\n SELECT APPLICATION.APPLICATION_ID,\n APPLICANT.USER_ID AS APPLICANT_ID,\n APPLICANT.NAME AS APPLICANT_NAME,\n APPLICATION.STATUS,\n APPLICATION.TEST_SCORE\n FROM APPLICATION,\n CUSTOMER APPLICANT\n WHERE APPLICATION.APPLICANT_ID = APPLICANT.USER_ID\n AND APPLICATION.JOB_ID = '%s';\",\n mysql_real_escape_string($job_id)\n ));\n\n $applications = array();\n\n while ($row = mysql_fetch_assoc($result)) {\n $applications[] = array(\n 'id' => $row['APPLICATION_ID'],\n 'applicant_id' => $row['APPLICANT_ID'],\n 'applicant_name' => $row['APPLICANT_NAME'],\n 'status' => $row['STATUS'],\n 'score' => $row['TEST_SCORE']\n );\n }\n\n return $applications;\n\n }",
"public function getInstalledAppsIds(){\n $command = new Command($this->host, self::APPS_INSTALLED_IDS,\"GET\", $this->enableCache, $this->cacheLifetime, $this->cacheFolder);\n $command->execute();\n return $command->getData(\"ids\");\n }",
"public function getApplicants($id){\n return $this->securityDAO->getApplicantsDAO($id);\n }",
"public function getApplicantQuery($application_id) {\n\t\t$query = 'SELECT ap.date_modified AS date_modified,\n\t\t\t\tap.date_created AS date_created,\n\t\t\t\tap.application_id AS application_id,\n\t\t\t\tap.external_id AS external_id,\n\t\t\t\tap.legal_id_type AS legal_id_type,\n\t\t\t\tap.tenancy_type AS tenancy_type,\n\t\t\t\tap.dob AS date_of_birth,\n\t\t\t\tap.dob AS dob,\n\t\t\t\t0 AS date_of_birth_id,\n\t\t\t\tap.legal_id_number AS legal_id_number,\n\t\t\t\t0 AS legal_id_number_id,\n\t\t\t\tap.legal_id_state AS legal_id_state,\n\t\t\t\tap.ssn AS ssn,\n\t\t\t\tsubstr(ap.ssn,7,4) AS ssn_last_four,\n\t\t\t\tap.name_last AS name_last,\n\t\t\t\tap.name_first AS name_first,\n\t\t\t\tap.street AS street,\n\t\t\t\tap.city AS city,\n\t\t\t\tap.county AS county,\n\t\t\t\tap.unit AS unit,\n\t\t\t\tap.state AS state,\n\t\t\t\tap.zip_code AS zip_code,\t\t\t\t\n\t\t\t\tap.dob AS dob,\n\t\t\t\tap.age AS age,\n\t\t\t\tap.residence_start_date AS residence_start_date,\n\t\t\t\tsubstr(ap.ssn,7,4) AS ssn_last4,\n\t\t\t\tIF (av.version IS NULL,1,av.version) AS application_version,\n\t\t\t\tap.modifying_agent_id AS modifying_agent_id\n\t\t\tFROM application AS ap\n\t\t\t\tLEFT JOIN application_version AS av USING (application_id)\n\t\t\tWHERE ap.application_id = '.$application_id.';';\n\n\t\t$result = $this->db->query($query);\n\t\t$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($rows);\n\t}",
"public function getApplications()\n {\n return $this->hasMany(Application::className(), ['user_id' => 'id']);\n }",
"public function getApplications();",
"public function getApplications(){\n return $this->securityDAO->getApplicationsDAO();\n }",
"public static function getUserApplications($userID)\n {\n $sql_application = new SQL_Application();\n return $sql_application->selectByUser($userID);\n }",
"public function applications() \n {\n $messageLines = $this\n ->messageLines()\n ->where('message_lines.user_id', '!=', $this->user_id)\n ->get();\n\n $applications = [];\n\n foreach ($messageLines as $line) {\n $applications[] = $line->message->relationship;\n }\n\n return collect($applications);\n }",
"public function get_applicant($applicant_id) {\n\n $result = $this->doQuery(sprintf(\"\n SELECT C.NAME,\n C.EMAIL,\n A.PHONE,\n A.HIGHEST_DEGREE,\n A.YEARS_EXPERIENCE,\n A.CITIZENSHIP,\n A.BIRTH_YEAR,\n A.DESCRIPTION\n FROM APPLICANT A,\n CUSTOMER C\n WHERE A.USER_ID = C.USER_ID\n AND A.USER_ID = '%s';\",\n mysql_real_escape_string($applicant_id)\n ));\n\n $row = mysql_fetch_assoc($result);\n\n if (!$row) {\n return false;\n }\n\n $applicant = array(\n 'name' => $row['NAME'],\n 'email' => $row['EMAIL'],\n 'phone' => $row['PHONE'],\n 'degree' => $row['HIGHEST_DEGREE'],\n 'experience' => $row['YEARS_EXPERIENCE'],\n 'citizenship' => $row['CITIZENSHIP'],\n 'birth' => $row['BIRTH_YEAR'],\n 'description' => $row['DESCRIPTION']\n );\n\n return $applicant;\n\n }",
"public function get_application_id($applicant_id, $job_id) {\n\n $result = $this->doQuery(sprintf(\"\n SELECT APPLICATION_ID\n FROM APPLICATION\n WHERE APPLICANT_ID = '%s'\n AND JOB_ID = '%s'\",\n mysql_real_escape_string($applicant_id),\n mysql_real_escape_string($job_id)\n ));\n\n $row = mysql_fetch_assoc($result);\n\n if (!$row) {\n return false;\n }\n\n return $row['APPLICATION_ID'];\n\n }",
"function getInternshipApplicationsByInternshipId($internshipId){\n global $con;\n $query = \"SELECT * FROM internship_applications WHERE Internship_Id = '$internshipId'\";\n $queryExec = mysqli_query($con, $query);\n while($row = mysqli_fetch_assoc($queryExec))\n $rows[] = $row;\n return $rows;\n }",
"public static function applicationGetPending() {\r\n //creates database connection if one doesn't already exist\r\n self::setInstance();\r\n \r\n $apps = self::$instance->select(\"applications\", [\"id\"], [\"moderation_state\" => \"PENDING\", \"ORDER\" => \"id ASC\"]);\r\n \r\n //Create an array to hold app ids\r\n $pending_ids = array();\r\n \r\n //Generate clean array from SQL results\r\n foreach($apps as $app) {\r\n $pending_ids[] = $app[\"id\"];\r\n }\r\n return $pending_ids;\r\n }",
"public function getApplications()\n {\n return $this->hasMany(Application::class, ['task_id' => 'id']);\n }",
"public function getCourseEnquiriesByDynamicApplicationId($dynamicApplicationId){\n\n $dbCondition = array(\n 'dynamicApplicationId =' => $dynamicApplicationId,\n 'requestFor =' => \"course\" \n );\n\n $arguments = array(\n 'table' => \"requestedinfo\",\n 'returnData' => \"courseId\",\n 'dbCondition' => $dbCondition\n );\n $courseEnquiries = $this->getMasterList($arguments);\n if(!empty($courseEnquiries)){\n foreach ($courseEnquiries as $enquiry) {\n $results[] = $enquiry['courseId'];\n }\n }\n return $results;\n }",
"public function getApplicationsAuthorizedInContext(array $request, array $response = []): array\n {\n $uri = 'applications/authorizations/authorized-applications';\n $required = [\n 'contextIdentifier' => self::TYPE_STRING,\n ];\n $this->throwIfInvalid($required, $request);\n\n return $this->client->get($this->buildUrl($uri), $response, $request);\n }",
"public static function applicationGetByCategory($category) {\r\n //creates database connection if one doesn't already exist\r\n self::setInstance();\r\n \r\n $apps = self::$instance->select(\"applications\", [\"id\"], [\"AND\" =>[\"moderation_state\" => \"ACTIVE\", \"category\" => $category]]);\r\n \r\n //Create an array to hold app ids\r\n $app_ids = array();\r\n \r\n //Generate clean array from SQL results\r\n foreach($apps as $app) {\r\n $app_ids[] = $app[\"id\"];\r\n }\r\n return $app_ids;\r\n }",
"static function userApplications($user=null) {\n\t\t\t\n\t\t\t$applications = null;\n\t\t\t\n\t\t\t\n\t\t\t//retrieve user\n\t\t\tif (!$user) {\n\t\t\t\t$user = Auth::CMSuser()->user();\n\t\t\t}\n\n\t\t\t\n\t\t\t//valid user\n\t\t\tif (isset($user) && is_numeric($user->id) && $user->id>=0) {\n\t\t\t\t\n\t\t\t\t$apps = CMSApp::select(['id', 'name'])\n\t\t\t\t\t->whereHas('group', function($query) use ($user) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//check for matching user\n\t\t\t\t\t\t$query->whereHas('permissions', function($query) use ($user) {\n\t\t\t\t\t\t\t$query->where('user', '=', $user->id);\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t//check for any valid permission\n\t\t\t\t\t\t$query->where(function ($whereQuery) {\n\t\t\t\t\t\t\tforeach (CMSAccess::$PERMISSIONS as $permission) {\n\t\t\t\t\t\t\t\t $whereQuery->orWhere('permission', 'LIKE', '%\"' . $permission . '\"%');\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//select distinct applications\n\t\t\t\t\t\t$query->groupBy('application');\n\t\t\t\t\t\t\n\t\t\t\t\t})\n\t\t\t\t\t->get();\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t//get list of applications\n\t\t\t\tif ($apps) {\n\t\t\t\t\t$applications = $apps; \n\t\t\t\t}\n\t\t\t\t\n\t\t\t} //end if (valid user)\n\t\t\t\n\t\t\t\n\t\t\treturn $applications;\n\t\t\t\n\t\t}",
"public function getCollegeEnquiriesByDynamicApplicationId($dynamicApplicationId){\n\n $dbCondition = array(\n 'dynamicApplicationId =' => $dynamicApplicationId,\n 'requestFor =' => \"college\" \n );\n\n $arguments = array(\n 'table' => \"requestedinfo\",\n 'returnData' => \"collegeId\",\n 'dbCondition' => $dbCondition\n );\n $collegeEnquiries = $this->getMasterList($arguments);\n if(!empty($collegeEnquiries)){\n foreach ($collegeEnquiries as $enquiry) {\n $results[] = $enquiry['collegeId'];\n }\n }\n return $results;\n }",
"public function getUserApplications($userId) {\n // but for instance, it prints only an id\n echo '<strong>App id:</strong> ' . $userId;\n }",
"public static function getAllApplicantAccounts()\n\t\t{\n\t\t\ttry \n\t\t\t{\n\t\t\t\t$Cur_useData = AjaxController::getCurrentUserAllData();\n\t\t\t\tif ($Cur_useData['grpid'] == 'NA') {\n\t\t\t\t\t\t$data1 = DB::table('x08')->join('region', 'x08.rgnid', '=', 'region.rgnid')\n\t\t\t\t\t\t\t\t\t->join('x07', 'x08.grpid', '=', 'x07.grp_id')\n\t\t\t\t\t\t\t\t\t->join('barangay', 'x08.barangay', '=', 'barangay.brgyid')\n\t\t\t\t\t\t\t\t\t->join('city_muni', 'x08.city_muni', '=', 'city_muni.cmid')\n\t\t\t\t\t\t\t\t\t->join('province', 'x08.province', '=', 'province.provid')\n\t\t\t\t\t\t\t\t\t->where('x08.grpid', '=', 'C')\n\t\t\t\t\t\t\t\t\t->get();\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\telse if($Cur_useData['grpid'] == 'FDA' || $Cur_useData['grpid'] == 'LO') {\n\t\t\t\t\t\t$data1 = DB::table('x08')->join('region', 'x08.rgnid', '=', 'region.rgnid')\n\t\t\t\t\t\t\t\t\t->join('x07', 'x08.grpid', '=', 'x07.grp_id')\n\t\t\t\t\t\t\t\t\t->join('barangay', 'x08.barangay', '=', 'barangay.brgyid')\n\t\t\t\t\t\t\t\t\t->join('city_muni', 'x08.city_muni', '=', 'city_muni.cmid')\n\t\t\t\t\t\t\t\t\t->join('province', 'x08.province', '=', 'province.provid')\n\t\t\t\t\t\t\t\t\t->join('appform', 'x08.uid', '=', 'appform.uid')\n\t\t\t\t\t\t\t\t\t->where('x08.grpid', '=', 'C')\n\t\t\t\t\t\t\t\t\t->where('appform.assignedLO', '=', $Cur_useData['cur_user'])\n\t\t\t\t\t\t\t\t\t->get();\t\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$data1 = DB::table('x08')->join('region', 'x08.rgnid', '=', 'region.rgnid')\n\t\t\t\t\t\t\t\t\t->join('x07', 'x08.grpid', '=', 'x07.grp_id')\n\t\t\t\t\t\t\t\t\t->join('barangay', 'x08.barangay', '=', 'barangay.brgyid')\n\t\t\t\t\t\t\t\t\t->join('city_muni', 'x08.city_muni', '=', 'city_muni.cmid')\n\t\t\t\t\t\t\t\t\t->join('province', 'x08.province', '=', 'province.provid')\n\t\t\t\t\t\t\t\t\t->where('x08.grpid', '=', 'C')\n\t\t\t\t\t\t\t\t\t->where('x08.rgnid', '=', $Cur_useData['rgnid'])\n\t\t\t\t\t\t\t\t\t->get();\n\t\t\t\t\t}\n\t\t\t\t\treturn $data1;\n\t\t\t} \n\t\t\tcatch (Exception $e) \n\t\t\t{\n\t\t\t\tAjaxController::SystemLogs($e->getMessage());\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}",
"public function getApplications()\n {\n return $this->hasMany(Application::className(), ['category_id' => 'id']);\n }",
"public function getAccountsIds(): ?array\r\n {\r\n if ($id_accounts = self::getOptionId('accounts')) {\r\n return $this->pref->retrieveIds($id_accounts);\r\n }\r\n\r\n return null;\r\n }",
"function GetApplicants($bursary_id, $mysqli){\n\t$sql = \"SELECT * FROM student_bursaries WHERE Bursary_ID=$bursary_id\";\n\t$result = $mysqli->query($sql);\n\t\n\t$student = [];\n\t$counter = 0;\n\t\n\tif ($result->num_rows > 0){\n\t\twhile($row = $result->fetch_assoc()){\n\t\t\t$applicant = new student_bursaries($row[\"Bursary_ID\"], $row[\"Student_ID\"], $row[\"Status\"], $row[\"Application_Date\"]);\n\t\t\t$applicant->Student=getStudent($row[\"Student_ID\"], $mysqli);\n\t\t\t$student[$counter]=$applicant;\n\t\t\t$counter = $counter+1;\n\t\t}\n\t\treturn $student;\n\t\t\n\t}else return null;\n}",
"function getApplicationsByInternshipId($internshipId){\n global $con;\n $query = \"SELECT * FROM internship_applications WHERE Internship_Id = '$internshipId' ORDER BY(Application_Id) DESC\";\n $queryExec = mysqli_query($con, $query);\n while($row = mysqli_fetch_assoc($queryExec)){\n $rows[] = $row;\n }\n return $rows;\n }",
"public function getApps();"
] | [
"0.6321202",
"0.6230288",
"0.573148",
"0.5729852",
"0.57209224",
"0.57157654",
"0.56127435",
"0.55276674",
"0.54995406",
"0.5479082",
"0.5455665",
"0.544408",
"0.53718364",
"0.5353018",
"0.53411955",
"0.5330879",
"0.530778",
"0.5292389",
"0.526031",
"0.52136517",
"0.52012306",
"0.5197562",
"0.5194703",
"0.51926094",
"0.51917297",
"0.51839536",
"0.5106551",
"0.51023936",
"0.5090657",
"0.5070481"
] | 0.7560785 | 0 |
Gets the personal references for an application. | public function getApplicationPersonalReferencesQuery($application_id) {
$query = 'SELECT pr.date_created AS date_created,
pr.application_id AS application_id,
pr.date_modified AS date_modified,
pr.personal_reference_id AS personal_reference_id,
pr.application_id AS application_id,
pr.company_id AS company_id,
pr.name_full AS name_full,
pr.phone_home AS phone_home,
pr.relationship AS relationship,
pr.ok_to_contact AS ok_to_contact
FROM personal_reference AS pr
WHERE pr.application_id = '.$application_id.';';
$result = $this->db->query($query);
$rows = $result->fetchAll(DB_IStatement_1::FETCH_OBJ);
return($rows);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getReferences(){\n\t\t\t$database = new DataBase();\n\t\t\t$sql = \"SELECT name, grade, credits FROM `chElectives` WHERE fn='$this->fn'\";\n\t\t\t$query = $database->executeQuery($sql, 'Failed find user');\n\t\t\t$references = $query->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t\treturn $references;\n\t\t}",
"public function getAppCopies()\n\t{\n if(!isset($this->data))\n\t\t\t$this->loadData();\n\t\treturn $this->data['programAppCopies']->get();\n\t}",
"public function getApplications();",
"public function getApplicationInfos()\n {\n return $this->applicationInfos;\n }",
"public function getReferences();",
"public function getApps();",
"public function friends_getAppUsers() {\n return $this->call_method('facebook.friends.getAppUsers', array());\n }",
"public abstract function getReferences();",
"public function getManagedApps()\n {\n if (array_key_exists(\"managedApps\", $this->_propDict)) {\n if (is_a($this->_propDict[\"managedApps\"], \"\\Microsoft\\Graph\\Model\\AppListItem\") || is_null($this->_propDict[\"managedApps\"])) {\n return $this->_propDict[\"managedApps\"];\n } else {\n $this->_propDict[\"managedApps\"] = new AppListItem($this->_propDict[\"managedApps\"]);\n return $this->_propDict[\"managedApps\"];\n }\n }\n return null;\n }",
"public function getReferants()\n {\n if ($this->_aReferant === null) {\n $this->_aReferant = array();\n\n $sql = 'select distinct(ID_PARAGRAPHE)\n from OFF_PARAGRAPHE\n where TPL_CODE = \\'TPL_FORMULAIRE\\'\n and PAR_TPL_IDENTIFIANT=' . $this->getID();\n\n $rowListe = $this->dbh->query($sql)->fetchAll(PDO::FETCH_COLUMN);\n if (! empty($rowListe)) {\n $this->_aReferant['OFF_PARAGRAPHE'] = $rowListe;\n }\n\n $sql = 'select distinct(ID_PARAGRAPHE)\n from ON_PARAGRAPHE\n where TPL_CODE = \\'TPL_FORMULAIRE\\'\n and PAR_TPL_IDENTIFIANT=' . $this->getID();\n\n $rowListe = $this->dbh->query($sql)->fetchAll(PDO::FETCH_COLUMN);\n if (! empty($rowListe)) {\n $this->_aReferant['ON_PARAGRAPHE'] = $rowListe;\n }\n\n $sql = 'select distinct(ID_PARAGRAPHE)\n from REVISION_PARAGRAPHE\n where TPL_CODE = \\'TPL_FORMULAIRE\\'\n and PAR_TPL_IDENTIFIANT=' . $this->getID();\n\n $rowListe = $this->dbh->query($sql)->fetchAll(PDO::FETCH_COLUMN);\n if (! empty($rowListe)) {\n $this->_aReferant['REVISION_PARAGRAPHE'] = $rowListe;\n }\n }\n\n return $this->_aReferant;\n }",
"public function getPeople()\n {\n\t\treturn $this->people;\n\t}",
"public function getApp() {\n\t\treturn $this->me();\n\t}",
"public function friends_getAppUsers() {\n return $this->execute('friends.getAppUsers', array());\n }",
"public function getApps()\n {\n return $this->apps;\n }",
"public function getApplications(){\n return $this->securityDAO->getApplicationsDAO();\n }",
"public function getApps()\n {\n return $this->_apps;\n }",
"public function getApp();",
"public function getApplications()\n\t{\n\t\treturn $this->applications;\n\t}",
"public function personal()\n {\n return $this->getClient()->getPersonal();\n }",
"protected function getFriendsAppUsers() {\n \n $response = $this->makeApiCallCached(array('method' => 'friends.getAppUsers'));\n \n return $response;\n }",
"private function getEmailReferencesFromStore()\n {\n $emailReferences = $this->emailReferences;\n if (null === $emailReferences) {\n $emailReferences = new ArrayCollection();\n $this->emailReferences = $emailReferences;\n }\n\n return $emailReferences;\n }",
"public static function get_apps() {\n global $DB;\n $app = $DB->get_records(constants::APP_TABLE, array());\n return $app;\n }",
"public function getApplicationData(){\n $application = $this->at->application();\n\n return $application->fetchApplicationData();\n }",
"public function getReferencingKeys();",
"public function getReferences()\n {\n return $this->references;\n }",
"public function getReferences()\n {\n return $this->references;\n }",
"public static function getAllApplications(){\n\t\t$retval = array();\n\t\t$tocZC = self::readAppTOC();\n\t\tforeach($tocZC->applications as $app){\n\t\t\t$retval[] = $app->name;\n\t\t}\n\t\treturn $retval;\n\t}",
"public static function getActiveApplications(){\n\t\t$retval = array();\n\t\t$tocZC = self::readAppTOC();\n\t\tforeach($tocZC->applications as $app){\n\t\t\tif($app->active === \"true\"){\n\t\t\t\t$retval[] = $app->name;\n\t\t\t}\n\t\t}\n\t\treturn $retval;\n\t}",
"public function get(Application $app);",
"public function getApp()\n {\n return $this->get(self::APP);\n }"
] | [
"0.5689319",
"0.5616931",
"0.5525144",
"0.5485755",
"0.5458492",
"0.54446435",
"0.54383147",
"0.5421709",
"0.52737486",
"0.5224476",
"0.52156377",
"0.5202266",
"0.5202058",
"0.5134835",
"0.5107216",
"0.508697",
"0.508686",
"0.508411",
"0.5054765",
"0.5008082",
"0.5006306",
"0.4979678",
"0.49763283",
"0.49699023",
"0.49567857",
"0.49567857",
"0.49531555",
"0.4949205",
"0.4920629",
"0.49117488"
] | 0.66401744 | 0 |
Gets the application history table entry detail for the application_id | public function getApplicationStatusHistoryQuery($application_id) {
$result = array();
$query = 'SELECT ash.application_id AS application_id,
ash.date_created AS dateCreated,
ash.agent_id AS modifyingAgentId,
ash.agent_id AS modifying_agent_id,
ash.status_history_id AS statusHistoryId,
ash.application_status_id AS id
FROM status_history AS ash
WHERE ash.application_id = '.$application_id.
' ORDER BY ash.date_created;';
$result = $this->db->query($query);
$return = $result->fetchAll(DB_IStatement_1::FETCH_OBJ);
return($return);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function history($id)\n {\n return $this->getApi()\n ->execute(\"history/process-instance/{$id}\");\n }",
"public function getApplicationAuditQuery($application_id) {\n\t\t$query = 'SELECT aa.application_id AS application_id,\n\t\t\t\taa.table_name AS table_name,\n\t\t\t\t\"application_id\" AS primary_key_name,\n\t\t\t\taa.application_id AS primary_key_value,\n\t\t\t\taa.column_name AS column_name,\n\t\t\t\taa.value_before AS old_value,\n\t\t\t\taa.value_after AS new_value,\n\t\t\t\taa.date_created AS date_updated,\n\t\t\t\taa.agent_id AS modifying_agent_id\n\t\t\tFROM application_audit AS aa\n\t\t\tWHERE aa.application_id = '.$application_id.';';\n\t\t$result = $this->db->query($query);\n\t\t$rows = $result->fetchAll(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($rows);\n\t}",
"public function get_audit_history($shift_id);",
"function getHistory() {\n\t\treturn $this->query_history;\n\t}",
"public function getRecordHistory()\n {\n return $this->_recordHistory;\n }",
"private function get_history($event){\n\t\t$noteID = $event->get_arg(1);\n\t\t$pageNumber = $event->get_arg(2);\n if(is_null($pageNumber) || !is_numeric($pageNumber))\n $pageNumber = 0;\n else if ($pageNumber <= 0)\n $pageNumber = 0;\n else\n $pageNumber--;\n\n global $config;\n \n\t\t$histiriesPerPage = $config->get_int('notesHistoriesPerPage');\n\t\t\n\t\tglobal $database;\n\t\t$histories = $database->get_all(\"SELECT h.note_id, h.review_id, h.image_id, h.date, h.note, u.name AS user_name \".\n\t\t\t\t\t\t\t\t\t\t\"FROM note_histories AS h \".\n\t\t\t\t\t\t\t\t\t\t\"INNER JOIN users AS u \".\n\t\t\t\t\t\t\t\t\t\t\"ON u.id = h.user_id \".\n\t\t\t\t\t\t\t\t\t\t\"WHERE note_id = ? \".\n\t\t\t\t\t\t\t\t\t\t\"ORDER BY date DESC LIMIT ?, ?\",\n\t\t\t\t\t\t\t\t\t\tarray($noteID, $pageNumber * $histiriesPerPage, $histiriesPerPage));\n\t\t\t\t\t\n\t\t$totalPages = ceil($database->get_one(\"SELECT COUNT(*) FROM note_histories WHERE note_id = ?\", array($noteID)) / $histiriesPerPage);\n\t\t\n\t\t$this->theme->display_history($histories, $pageNumber + 1, $totalPages);\n\t}",
"public function history() {\n return $this->history;\n }",
"private function entryFetchHistory(string $id, string $table) {\n\t\tif (!in_array($table, $this->versionedTables))\n\t\t\treturn array();\n\n\t\t$entries = $this->connection->fetchAll(\n\t\t\t'SELECT * FROM ' . $this->prefix . $table . '_history WHERE id = ? ORDER BY history_timestamp DESC',\n\t\t\tarray($id)\n\t\t);\n\n\t\treturn $entries ? : array();\n\t}",
"public function getHistory()\n {\n return $this->_history;\n }",
"public function action_history()\n\t{\n\t\t$this->access('admin.'.strtolower($this->_admin->resource).'.history');\n\t\t$id = $this->request->param('id');\n\n\t\tif(!$this->request->is_ajax())\n\t\t{\n\t\t\tthrow new Kohana_HTTP_Exception_404;\n\t\t}\n\n\t\t// Needs to be a GET request\n\t\tif($this->request->method() != Request::GET)\n\t\t{\n\t\t\tthrow new Kohana_HTTP_Exception_403('No data was requested.');\n\t\t}\n\n\n\t\t$record = $this->_admin->model->where($this->_admin->primary_key, '=', $id)->find();\n\n\t\tif($record->loaded())\n\t\t{\n\t\t\t$tag_fields = array(\n\t\t\t\t'old_value',\n\t\t\t\t'new_value',\n\t\t\t\t'column_name'\n\t\t\t);\n\t\t\t$tags_group_sql = DB::expr('CAST('.implode(' AS CHAR),\\'|\\',CAST(', $tag_fields).' AS CHAR)');\n\n\t\t\t$datalog = ORM::factory('DataLog')\n\t\t\t\t->select(DB::expr('GROUP_CONCAT('.$tags_group_sql.' SEPARATOR \\'$*/*$\\') concat'))\n\t\t\t\t->where('table_name', '=', $this->_admin->model->table_name())\n\t\t\t\t->and_where('row_pk', '=', $id)\n\t\t\t\t->group_by('date_and_time')\n\t\t\t\t->order_by('date_and_time', 'DESC')\n\t\t\t\t->order_by('id', 'DESC')\n\t\t\t\t->find_all();\n\n\t\t\t$history = [];\n\n\t\t\tforeach($datalog as $data)\n\t\t\t{\n\t\t\t\t$history[] = $data->as_array();\n\t\t\t}\n\t\t\tRD::set(RD::SUCCESS, 'History for :resource #:id has loaded.', array(\n\t\t\t\t\t':resource' => Inflector::singular($this->_resource),\n\t\t\t\t\t':id' => $id\n\t\t\t\t),\n\t\t\t\tarray('history' => $history)\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tRD::set(RD::WARNING, 'History for :resource can\\'t be found.', array(\n\t\t\t\t':resource' => Inflector::singular($this->_resource),\n\t\t\t\t':id' => $id\n\t\t\t));\n\t\t}\n\t}",
"public function lead_history(){\n\t\t\t$SQL = \"SELECT * FROM orderlead_upload_history where parent_id=\".$_GET['id'].\"\";\n\t\t\t\n\t\t\t$query = $this->db->query($SQL);\n\t\t\t\n\t\t\treturn $query->result_array();\n\t\t\t\n\t\t}",
"public function getEntryLog();",
"function history() {\n $id = @$this->params['id'];\n if (!$id) throw new xException('Missing id parameter');\n // Retrieves all versions that impact this record\n // (directly or indirectly)\n $r = xModel::load('version_relation', array(\n 'model_name' => $this->model,\n 'id_field_value' => $id,\n 'xorder_by' => 'versions_relations.version_id',\n 'xorder' => 'DESC'\n ))->get();\n $versions = array();\n foreach ($r as $rr) $versions[] = $rr['version_id'];\n //\n $data = array();\n foreach ($versions as $version) {\n $data[$version] = array(\n 'version' => xModel::load('version', array(\n 'id' => $version\n ))->get(0),\n 'modifications' => xModel::load('version_data', array(\n 'version_id' => $version,\n 'xjoin' => array()\n ))->get(),\n );\n }\n return $data;\n }",
"public function historyCurrent()\n {\n return $this->history()->whereNull('updated_at')->latest()->first();\n }",
"public function getHistory() {\n\n\t\tglobal $db;\n\n\t\tif ( $this->history == null ) {\n\n\t\t\t$this->history = array();\n\t\t\t$dateActioned = $db->getUnixTimeStamp( 'h.date_actioned' );\n\t\t\t$sql = \" select t.id,\n\t\t\t\t\th.id as historyID, h.name, $dateActioned as dateCreated, h.description,\n\t\t\t\t\ts.id as statusID, s.name as statusName, s.closed as statusClosed,\n\t\t\t\t\tsi.id as statusIconID, si.name as statusIconName, si.filename as statusIconFile,\n\t\t\t\t\ttt.id as typeID, tt.name as typeName,\n\t\t\t\t\ttti.id as typeIconID, tti.name as typeIconName, tti.filename as typeIconFile,\n\t\t\t\t\tp.id as priorityID, p.name as priorityName,\n\t\t\t\t\tpi.id as priorityIconID, pi.name as priorityIconName, pi.filename as priorityIconFile,\n\t\t\t\t\tu.id as creatorID, u.name as creatorName, u.email as creatorEmail,\n\t\t\t\t\tpr.id as projectID, pr.name as projectName, pr.parent_id as projectParentID,\n\t\t\t\t\tgr.id as projectGroupID, gr.name as projectGroupName\n\t\t\t\tfrom tasks t\n\t\t\t\t\tright outer join task_history h\n\t\t\t\t\ton h.task_id = t.id\n\t\t\t\t\tinner join task_status s\n\t\t\t\t\ton s.id = h.status_id\n\t\t\t\t\tinner join task_priorities p\n\t\t\t\t\ton p.id = h.priority_id\n\t\t\t\t\tinner join task_types tt\n\t\t\t\t\ton tt.id = h.type_id\n\t\t\t\t\tinner join users u\n\t\t\t\t\ton u.id = h.user_id\n\t\t\t\t\tleft outer join icons tti\n\t\t\t\t\ton tti.id = tt.icon\n\t\t\t\t\tleft outer join icons si\n\t\t\t\t\ton si.id = s.icon\n\t\t\t\t\tleft outer join icons pi\n\t\t\t\t\ton pi.id = p.icon\n\t\t\t\t\tinner join projects pr\n\t\t\t\t\ton pr.id = h.project_id\n\t\t\t\t\tinner join groups gr\n\t\t\t\t\ton gr.id = pr.group_id\n\t\t\t\twhere t.id = '$this->id'\n\t\t\t\torder by h.date_actioned asc \";\n\t\t\tif ( !$res = $db->query($sql) )\n\t\t\t\tError::fatal( $db->getError(), Error::SYS );\n\n\t\t\twhile ( $row = $res->fetch() ) {\n\t\t\t\t$task = Task::getTaskFromRow($row);\n\t\t\t\tarray_unshift( $this->history, $task );\n\t\t\t\tif ( sizeof($this->history) > 0 )\n\t\t\t\t\t$task->previous = $this->history[1];\n\t\t\t}\n\n\t\t\t// now we have ths histories, we can\n\t\t\t// query for any attached documents\n\t\t\t// and then add them to the histories\n\t\t\t$dateCreated = $db->getUnixTimeStamp( 'd.date_created' );\n\t\t\t$sql = \" select h.id as historyID,\n\t\t\t\t\td.id as id, d.name, $dateCreated as dateCreated, d.bin_size, d.bin_type,\n\t\t\t\t\tu.id as userID, u.name as userName, u.email as userEmail\n\t\t\t\tfrom task_history h\n\t\t\t\t\tleft outer join task_docs td\t\t\t\t\t\t\n\t\t\t\t\ton td.task_history_id = h.id\n\t\t\t\t\tinner join docs d\n\t\t\t\t\ton d.id = td.doc_id\n\t\t\t\t\tinner join users u\n\t\t\t\t\ton u.id = d.user_id\n\t\t\t\twhere h.task_id = '$this->id' \";\n\t\t\tif ( !$res = $db->query($sql) )\n\t\t\t\tError::fatal( $db->getError(), Error::SYS );\n\n\t\t\twhile ( $row = $res->fetch() )\n\t\t\t\tforeach ( $this->history as $history )\n\t\t\t\t\tif ( $history->historyID == $row->historyID )\n\t\t\t\t\t\t$history->addDocument( new Document(\n\t\t\t\t\t\t\t$row->id, $row->name,\n\t\t\t\t\t\t\tnew User($row->userID,$row->userName,$row->userEmail),\n\t\t\t\t\t\t\t$row->dateCreated, $row->bin_size, $row->bin_type\n\t\t\t\t\t\t));\n\n\t\t}\n\n\t\treturn $this->history;\n\n\t}",
"public function historyAccount()\n {\n // in a game. This prevents a nasty SELECT * FROM accounts, etc\n return $this->hasOne('Onyx\\Account', 'id', 'account_id')\n ->select('id');\n }",
"public function history($id)\n {\n return view('vendor/backpack/base/show-history-log')\n ->with('personId', $id)\n ->with('datas', $this->historyData->index($id, $this->request));\n }",
"public static function getApplicationInformation($applicationID)\n {\n $sql_application = new SQL_Application();\n return $sql_application->select($applicationID);\n }",
"public function getHistory() {\n return $this->history->getValues();\n }",
"public function getApplicationDetailsQuery($application_id) {\n\t\t$query = 'SELECT\n\t\t\t\tap.application_id AS application_id,\n\t\t\t\tap.apr AS apr,\n\t\t\t\tap.customer_id AS customer_id,\n\t\t\t\tap.modifying_agent_id AS modifying_agent_id,\n\t\t\t\tap.cfe_rule_set_id AS cfe_ruleset_id,\n\t\t\t\tap.date_first_payment AS date_first_payment,\n\t\t\t\tif(ap.date_fund_actual>\"1990-01-01\",ap.date_fund_actual,NULL) AS date_fund_actual,\n\t\t\t\tap.date_fund_estimated AS date_fund_estimated,\n\t\t\t\tap.date_next_contact AS date_next_contact,\n\t\t\t\tap.finance_charge AS finance_charge,\n\t\t\t\tap.fund_actual AS fund_actual,\n\t\t\t\tap.fund_qualified AS fund_qualified,\n\t\t\t\tap.fund_requested AS fund_requested,\n\t\t\t\tap.is_watched AS is_watched,\n\t\t\t\tap.payment_total AS payment_total,\n\t\t\t\tap.rule_set_id AS rule_set_id,\n\t\t\t\tap.date_modified AS date_modified,\n\t\t\t\tap.call_time_pref AS call_time_pref,\n\t\t\t\tap.contact_method_pref AS contact_method_pref,\n\t\t\t\tap.marketing_contact_pref AS marketing_contact_pref,\n\t\t\t\tap.call_time_pref AS call_time_pref,\n\t\t\t\tap.contact_method_pref AS contact_method_pref,\n\t\t\t\tap.marketing_contact_pref AS marketing_contact_pref,\n\t\t\t\tap.source AS application_source,\n\t\t\t\tap.application_type AS application_type,\n\t\t\t\tIF (av.version IS NULL,1,av.version) AS application_version\n\t\t\tFROM application AS ap\n\t\t\t\tLEFT JOIN application_version AS av ON (ap.application_id = av.application_id)\n\t\t\tWHERE ap.application_id = '.$application_id.';';\n\t\t$result = $this->db->query($query);\n\t\t$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($rows);\n\t}",
"function get_history($file_id) {\n if ($file_id === false) {\n return false;\n }\n $stmt = $this->db_lib->prepared_execute(\n $this->DB->jugaad,\n \"SELECT `id`, `action`, `timestamp`, `created_by` FROM `file_versions` WHERE `file_id`=? ORDER BY `id` DESC\",\n \"i\",\n [$file_id]\n );\n if (!$stmt) {\n return false;\n }\n $history_list = $stmt->get_result()->fetch_all(MYSQLI_ASSOC);\n return $history_list;\n }",
"function get_history($floor = null) {\n\t// Build the base response.\n\thttp_response_code(200);\n\t$response = array(\n\t\t\"info\" => array(\n\t\t\t\"level\" => 2,\n\t\t\t\"status\" => \"ok\",\n\t\t\t\"message\" => \"Devices history found in database.\"\n\t\t),\n\t\t\"list\" => array()\n\t);\n\n\t// Go through devices adding them as arrays to the response.\n\tforeach (History\\Entry::List($floor) as $entry) {\n\t\tarray_push($response[\"list\"], $entry->as_array());\n\t}\n\n\t// Send response.\n\techo json_encode($response);\n}",
"public function historyList($query = null)\n {\n return $this->getApi()\n ->execute('history/process-instance', $query);\n }",
"public function get_post_history($post_id = 0)\n {\n }",
"function getCallHistory()\n\t{\n\t\treturn $this->call_hist;\n\t}",
"public function getApplicationData(){\n $application = $this->at->application();\n\n return $application->fetchApplicationData();\n }",
"public function get_all_history()\n {\n $sentence = new SentenceUtil();\n $sentence->fromCommand(\"/system/history/getall\");\n $this->talker->send($sentence);\n $rs = $this->talker->getResult();\n $i = 0;\n if ($i < $rs->size()) {\n return $rs->getResultArray();\n } else {\n return \"No History\";\n }\n }",
"private function getHistory()\n {\n $action = $this->getGET('action', null);\n if ($action == \"delete\") {\n /* @var User $user */\n $user = $this->data['user'];\n $history = $user->history;\n if (key_exists($_GET['key'], $history)) {\n unset($history[$_GET['key']]);\n $user->history = $history;\n $user->save();\n FlashMessage::add(FlashMessage::TYPE_SUCCESS, 'Datensatz erfolgreich gelöscht.');\n Helpers::redirect(str_replace('&edit=1', '', $_SERVER['REQUEST_URI']));\n }\n }\n }",
"public function individual_history($data){\n\t\t$this->db->select('*');\n\t\t$this->db->from('tbl_history');\n\t\t$this->db->order_by('id','desc');\n\t\t$this->db->where('item_id',$data);\n\t\t$this->db->where('status','0');\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}",
"public function getChatHistId() {\n return $this->chat_hist_id;\n }"
] | [
"0.5938399",
"0.59300804",
"0.5914717",
"0.58536106",
"0.5760868",
"0.575154",
"0.56979185",
"0.5686537",
"0.5670773",
"0.5607788",
"0.56044865",
"0.5602684",
"0.5602218",
"0.5587695",
"0.5565245",
"0.55480665",
"0.5546113",
"0.554499",
"0.55339354",
"0.55296856",
"0.5510787",
"0.5440364",
"0.5439265",
"0.5427079",
"0.5421538",
"0.54206485",
"0.53859377",
"0.53723073",
"0.5366018",
"0.5358677"
] | 0.6640351 | 0 |
Gets the application status table entry detail for the application_status_id. | public function getApplicationStatusQuery($application_status_id) {
$query = 'SELECT date_created AS dateCreated,
date_modified AS dateModified,
application_status_id AS id,
application_status_name AS name
FROM application_status
WHERE application_status_id = '.$application_status_id.';';
$result = $this->db->query($query);
$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);
return($rows);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function lookup_application_status() {\n\n return $this->get_lookup_table(\"APPLICATION_STATUS_LU\");\n\n }",
"function get_application($status='pending')\n\t{\n\t\treturn $this->_query_reader->get_row_as_array('get_leave_list_data', array('search_query'=>\" L.teacher_id='\".$this->native_session->get('__user_id').\"' AND L.status='\".$status.\"' \", 'order_by'=>' L.last_updated DESC ', 'limit_text'=>'1'));\n\t}",
"function getInternshipApplicationStatus($applicationId){\n global $con;\n $query = \"SELECT * FROM internship_applications WHERE Application_Id = '$applicationId'\";\n $queryExec = mysqli_query($con, $query);\n $row = mysqli_fetch_assoc($queryExec);\n return $row['Application_Status'];\n }",
"public function getStatusId()\n {\n return $this->__get(\"status_id\");\n }",
"public function getApplicationStatusHistoryQuery($application_id) {\n\t\t$result = array();\n\t\t$query = 'SELECT ash.application_id AS application_id,\n\t\t\t\tash.date_created AS dateCreated,\n\t\t\t\tash.agent_id AS modifyingAgentId,\n\t\t\t\tash.agent_id AS modifying_agent_id,\n\t\t\t\tash.status_history_id AS statusHistoryId,\n\t\t\t\tash.application_status_id AS id\n\t\t\tFROM status_history AS ash \n\t\t\tWHERE ash.application_id = '.$application_id.\n\t\t\t' ORDER BY ash.date_created;';\n\t\t$result = $this->db->query($query);\n\t\t$return = $result->fetchAll(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($return);\n\t}",
"public function getApplicationStatus()\n {\n return $this->application_status;\n }",
"function getStatusColor($application_id, $application_status_id = NULL)\n\t{\n\t\tif ($application_status_id != NULL)\n\t\t{\n\t\t\treturn $this->getStatusColorById($application_status_id);\n\t\t}\n\t\n\t\t$app = ECash::getApplicationById($application_id);\n\n\t\treturn $this->getStatusColorById($app->application_status_id);\n\t}",
"public static function findByStatus($status)\n {\n $db = Zend_Registry::get('dbAdapter');\n\n $query = $db->select()\n ->from( array(\"r\" => \"rabatt\") )\n ->where( \"r.status = \" . $status );\n\n return $db->fetchRow($query);\n }",
"public static function getAllApplicationStatus() // Get All Application Status\n\t\t{\n\t\t\ttry \n\t\t\t{\n\t\t\t\t$data = DB::table('apptype')->orderBy('apt_seq', 'asc')->get();\n\t\t\t\tif ($data) {\n\t\t\t\t\tfor ($i=0; $i < count($data); $i++) { \n\t\t\t\t\t\tif (isset($data[$i]->apt_reqid)) { // Required\n\t\t\t\t\t\t\t$test = DB::table('apptype')->where('aptid', '=', $data[$i]->apt_reqid)->first();\n\t\t\t\t\t\t\tif ($test) {\n\t\t\t\t\t\t\t\t$data[$i]->apt_req_name = $test->aptdesc;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$data[$i]->apt_req_name = null;\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$data[$i]->apt_req_name = null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (isset($data[$i]->apt_isUpdateTo)) { // Update\n\t\t\t\t\t\t\t$test1 = DB::table('apptype')->where('aptid', '=', $data[$i]->apt_isUpdateTo)->first();\n\t\t\t\t\t\t\tif ($test1) {\n\t\t\t\t\t\t\t\t$data[$i]->apt_upd_name = $test1->aptdesc;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$data[$i]->apt_upd_name = null;\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$data[$i]->apt_upd_name = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t\t} \n\t\t\tcatch (Exception $e) \n\t\t\t{\n\t\t\t\tAjaxController::SystemLogs($e->getMessage());\n\t\t\t\treturn null;\t\n\t\t\t}\n\t\t}",
"public static function findByStatus($status)\n {\n $db = Zend_Registry::get('dbAdapter');\n\n $query = $db->select()\n ->from( array(\"m\" => \"meal_extras\") ) \n ->where( \"m.status = \" . $status );\n\n return $db->fetchRow($query); \n }",
"public static function get_status_display( $status ) {\n $booking_statuses = Inventor_Bookings_Logic::booking_statuses();\n echo array_key_exists( $status, $booking_statuses ) ? $booking_statuses[ $status ] : $status;\n }",
"public function getAppStatus()\n {\n return $this->app_status;\n }",
"public function getStatus()\n {\n return $this->hasOne(Status::className(), ['id' => 'status_id']);\n }",
"public function getStatus()\n {\n return $this->hasOne(Status::className(), ['id' => 'status_id']);\n }",
"public function getStatus($id){\n $getStatus = $this->find($id);\n return $getStatus->status;\n }",
"private function entryFetchWithStatus(string $id, string $status, string $table) {\n\t\tif (!in_array($table, $this->versionedTables)) \n\t\t\treturn array();\n\n\t\t$vars[] = $status;\n\t\tif ($id === '-1') {\n\t\t\t$where = '';\n\t\t} else {\n\t\t\t$where = ' AND id = ?';\n\t\t\t$vars[] = $id;\n\t\t}\n\n\t\t$entry = $this->connection->fetchAssoc(\n\t\t\t'SELECT * FROM ' . $this->prefix . $table . '_history WHERE history_status = ?' . $where,\n\t\t\t$vars\n\t\t);\n\t\treturn $entry ? : array();\n\t}",
"public function getStatusById($id)\r\n {\r\n $row = $this->get($id);\r\n return $row->status;\r\n }",
"public function getStatusByID($statusID)\n {\n $result = self::$dbInterface -> query(\"SELECT statusName FROM status WHERE statusID='\".$statusID.\"'\");\n return $result;\n }",
"public function getApplicationStatus() {\n $this->db->select('*');\n $this->db->from('application_status as');\n $this->db->where('as.is_active', 1);\n $result = $this->db->get();\n return $result->result_array();\n }",
"public function getStatusId();",
"public function application_details($id)\n {\n $application = Application::join('category', 'application.category_id', '=', 'category.id')\n ->join('users', 'application.user_id', '=', 'users.id')\n ->where('application.id', $id)\n ->select('application.*', 'category.category_name', 'users.full_name')->get();\n \n if(!empty($application[0]->id)) {\n $this->responseStatusCode = $this->statusCodes->success;\n $response = api_create_response($application[0], $this->successText, 'Application List.');\n\n }else {\n $this->responseStatusCode = $this->statusCodes->not_found;\n $response = api_create_response(2, $this->failureText, 'No Application Found.');\n }\n \n return response()->json($response, $this->responseStatusCode);\n }",
"public function show(Status $status)\n {\n return new StatusResource($status);\n }",
"private function Get_Status_Dates($application_id)\n\t{\n\t\t$status_histories = array();\n\n\t\t$application_id = (int)$application_id;\n\n\t\t$query = \"SELECT s.name, h.application_status_id, h.date_created\n\t\t\t\t FROM status_history as h, application_status as s\n\t\t\t\t WHERE h.application_id = {$application_id}\n\t\t\t\t \tAND h.application_status_id = s.application_status_id\n\t\t\t\t ORDER BY status_history_id ASC\";\n\n\t\t$result = $this->QueryOLP($query);\n\n\t\t$x = 0;\n\t\twhile($row = $this->olp_sql->Fetch_Object_Row($result))\n\t\t{\n\t\t\tif($row->name == 'ldb_unsynched' || $row->name == 'ldb_synched') continue;\n\n\t\t\t$status_histories[$x] = array(\"name\" => $row->name,\n\t\t\t\t\t\t\t\t\t \"date\" => $row->date_created);\n\n\t\t\t//If verification or underwriting grab the loan actions\n\t\t\tif($row->name == 'verification' || $row->name == 'underwriting')\n\t\t\t{\n\t\t\t\t//Grab loan actions\n\t\t\t\t$query = \"SELECT action_name\n\t\t\t\t\t \t FROM application_loan_action\n\t\t\t\t\t WHERE application_id = {$application_id}\";\n\t\n\t\t\t\t$loan_actions = $this->QueryOLP($query);\n\t\t\t\t\n\t\t\t\tif($this->olp_sql->Row_Count($loan_actions) != 0)\n\t\t\t\t{\n\t\t\t\t\t$status_histories[$x][\"loan\"] = array();\n\t\t\t\t\twhile($la = $this->olp_sql->Fetch_Object_Row($loan_actions))\n\t\t\t\t\t{\n\t\t\t\t\t\t$status_histories[$x][\"loan\"][] = $la->action_name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!isset($status_histories[$x][\"loan\"])) $status_histories[$x][\"loan\"] = null;\n\n\t\t\t++$x;\n\t\t}\n\n\t\treturn $status_histories;\n\t}",
"public function getApplicationStatus()\n\t{\n\t\t$emails = OphCoTherapyapplication_Email::model()->forEvent($this->event);\n\t\tif (!$emails->exists()) {\n\t\t\treturn self::STATUS_PENDING;\n\t\t}\n\n\t\t$diag = $this->getElement('Element_OphCoTherapyapplication_Therapydiagnosis');\n\n\t\tif ($diag->hasLeft() && !$emails->leftEye()->unarchived()->exists() ||\n\t\t $diag->hasRight() && !$emails->rightEye()->unarchived()->exists()) {\n\t\t\treturn self::STATUS_REOPENED;\n\t\t} else {\n\t\t\treturn self::STATUS_SENT;\n\t\t}\n\t}",
"protected function status($status)\n {\n return $this->builder->where('status', $status);\n }",
"public static function getApplicationInformation($applicationID)\n {\n $sql_application = new SQL_Application();\n return $sql_application->select($applicationID);\n }",
"function getApplicationByID($application_id) { \n $query = \"SELECT * FROM applications WHERE applicationid = ?\";\n $paramType = \"s\";\n $paramValue = array(\n $application_id\n );\n \n $result = $this->db_handle->runQuery($query, $paramType, $paramValue);\n \n\t\treturn $result;\n }",
"public function getStatus()\n\t{\n\t\treturn $this->getKeyValue('status'); \n\n\t}",
"public function get_application( $application_id ) {\n \n $this->db->select('*');\n $this->db->from('oauth_applications');\n $this->db->where(array(\n 'application_id' => $application_id\n )\n );\n $this->db->limit(1);\n $query = $this->db->get();\n \n if ( $query->num_rows() > 0 ) {\n \n $results = $query->result();\n \n return $results;\n \n } else {\n \n return false;\n \n }\n \n }",
"function get_status($id) {\n\n// check if status db is up to date\n\n\n// update old entries\n\n\n// return status information as xml\n\n\t}"
] | [
"0.66222197",
"0.6469725",
"0.6085777",
"0.5955261",
"0.5931541",
"0.5927158",
"0.59160215",
"0.59109855",
"0.57488894",
"0.57172614",
"0.56817895",
"0.56732076",
"0.56698096",
"0.56698096",
"0.5631339",
"0.5630972",
"0.56186175",
"0.5610225",
"0.55521923",
"0.55285263",
"0.55098045",
"0.5428712",
"0.5421513",
"0.5403113",
"0.539891",
"0.5389526",
"0.5388793",
"0.53856844",
"0.53753936",
"0.5364372"
] | 0.6544404 | 1 |
Gets the bank information details for the application_id | public function getBankQuery($application_id) {
$query = 'SELECT ap.application_id AS application_id,
ap.date_created AS date_created,
ap.date_modified AS date_modified,
IF (av.version IS NULL,1,av.version) AS version,
0 AS bank_info_id,
ap.bank_aba AS bank_aba,
ap.bank_account AS bank_account_normal,
ap.bank_account AS bank_account,
ap.income_direct_deposit AS is_direct_deposit_old,
ap.income_direct_deposit AS income_direct_deposit,
IF(ap.income_direct_deposit = "yes", TRUE, FALSE) as is_direct_deposit,
ap.banking_start_date AS banking_start_date,
ap.bank_name AS bank_name,
ap.bank_account_type AS bank_account_type,
ap.modifying_agent_id AS modifying_agent_id
FROM application AS ap
LEFT JOIN application_version AS av USING (application_id)
WHERE ap.application_id = '.$application_id.' LIMIT 1;';
$result = $this->db->query($query);
$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);
return($rows);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function fetchDefaultBankDetail() {\n $userObj = \\Auth::user();\n $bankDetail = '';\n if ($userObj->stripe_bank_account_id != '') {\n \\Stripe\\Stripe::setApiKey(env('STRIPE_SECRET'));\n $bankDetail = \\Stripe\\Account::retrieve($userObj->stripe_bank_account_id);\n }\n return $bankDetail;\n }",
"public function bankInfo()\n {\n return $this->hasOne('App\\Bank', 'vendor_id');\n }",
"public function show($id)\n {\n return Bank::find($id);\n }",
"public function getApplicationBusinessAccount($app_id) {\n $em = $this->em;\n $app_business_data = $em->getRepository('SixthContinentConnectBundle:ApplicationBusinessAccount')\n ->findOneBy(array('applicationId' => $app_id, 'isActive'=>1, 'isDeleted'=>0));\n if (!$app_business_data) {\n return false;\n }\n return $app_business_data;\n }",
"public function getBankAccount()\n {\n return $this->bank_account;\n }",
"public function getIdBank()\n {\n return $this->id_bank;\n }",
"public function get_bank_info($param1 = \"\"){\n if ($param1 != \"\") {\n $this->db->where('id', $param1);\n }\n return $this->db->get('bank_info');\n }",
"public function new_get_beneficiary_bank()\n\t{\n\t\t$case_type = $this->input->post('case_type');\n\t\t$case_status = $this->input->post('case_status');\n\t\t$payment_by = $this->input->post('payment_by');\n\t\t$source_bank = $this->input->post('source_bank');\n\t\t$source_account = $this->input->post('source_account');\n\t\t$status_batch = $this->input->post('status_batch');\n\t\t$client = $this->input->post('client');\n\t\t$user = '';\n\n\t\techo $this->new_case->get_beneficiary_bank($case_type, $case_status, $payment_by, $source_bank, $source_account, $status_batch, $client, $user);\n\t}",
"public function listBank()\n {\n return Bank::all();\n }",
"public function getBankAccount()\n {\n return $this->bankAccount;\n }",
"public function getBankInfo(&$jsondecodebank)\n {\n //$idno='1';\n $caserefno = session('caserefno');\n $url = 'http://'.env('WS_IP', 'perkesows.com').'/api/wsmotion/bankinfo?caserefno='.$caserefno;\n\n $ch = curl_init();\n \n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_PROXY, '');\n \n curl_setopt($ch, CURLOPT_HTTPGET, TRUE);\n curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));\n \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n $result = curl_exec($ch);\n $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n \n\n $jsondecodebank =json_decode($result);\n // $data =$jsondecode->{'data'};\n\n //close connection\n curl_close($ch);\n //return view('noticeAccident.certificateEmployee',['data'=>$jsondecode]);\n //return view ('noticeAccident.obForm');\n // return $httpcode; //$httpcode will contain json data returned by API\n\n }",
"public function detail($id){\n\t\t\t// $id = strtoupper($id);\n\t\t\t// if(empty($id) || $id == \"\") $this->redirect(BASE_URL.\"bank/\");\n\n\t\t\t// $data_detail = !empty($this->BankModel->getById($id)) ? $this->BankModel->getById($id) : false;\n\n\t\t\t// if(!$data_detail) $this->redirect(BASE_URL.\"bank/\");\n\n\t\t\t// $css = array(\n\t\t\t// \t'assets/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css',\n\t\t\t// );\n\t\t\t// $js = array(\n\t\t\t// \t'assets/bower_components/datatables.net/js/jquery.dataTables.min.js', \n\t\t\t// \t'assets/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js',\n\t\t\t// \t'app/views/bank/js/initView.js',\n\t\t\t// \t'app/views/bank/js/initForm.js',\n\t\t\t// );\n\n\t\t\t// $config = array(\n\t\t\t// \t'title' => array(\n\t\t\t// \t\t'main' => 'Data Bank',\n\t\t\t// \t\t'sub' => 'Detail Data Bank',\n\t\t\t// \t),\n\t\t\t// \t'css' => $css,\n\t\t\t// \t'js' => $js,\n\t\t\t// );\n\n\t\t\t// $status = ($data_detail['status'] == \"AKTIF\") ? '<span class=\"label label-success\">'.$data_detail['status'].'</span>' : '<span class=\"label label-danger\">'.$data_detail['status'].'</span>';\n\t\t\t\n\t\t\t// $_SESSION['token_bank']['view'] = md5($this->auth->getToken());\n\t\t\t// $_SESSION['token_bank']['edit'] = md5($this->auth->getToken());\n\t\t\t// $_SESSION['token_bank']['delete'] = md5($this->auth->getToken());\n\t\t\t\n\t\t\t// $this->token = array(\n\t\t\t// \t'view' => password_hash($_SESSION['token_bank']['view'], PASSWORD_BCRYPT),\n\t\t\t// \t'edit' => password_hash($_SESSION['token_bank']['edit'], PASSWORD_BCRYPT),\n\t\t\t// \t'delete' => password_hash($_SESSION['token_bank']['delete'], PASSWORD_BCRYPT)\n\t\t\t// );\n\n\t\t\t// $data = array(\n\t\t\t// \t'id_bank' => $data_detail['id'],\n\t\t\t// \t'nama' => $data_detail['nama'],\n\t\t\t// \t'saldo' => $this->helper->cetakRupiah($data_detail['saldo']),\n\t\t\t// \t'status' => $status,\n\t\t\t// \t'token' => $this->token,\n\t\t\t// );\n\n\t\t\t// // echo \"<pre>\";\n\t\t\t// // print_r($this->token);\n\t\t\t// // echo \"</pre>\";\n\t\t\t// $this->layout('bank/view', $config, $data);\n\t\t}",
"public static function getApplicationInformation($applicationID)\n {\n $sql_application = new SQL_Application();\n return $sql_application->select($applicationID);\n }",
"public function getBankList();",
"public function getDetailsById($appId)\n { \n $sql = $this->select();\n $sql->from($this->_name,array('name', 'price', 'user_id'))\n ->where('id = ?',$appId); \n \n return $this->fetchRow($sql);\n \n }",
"public function account() {\n\t\t$accountInfo = $this->bitcasaClientApi->getBitcasaAccountDataApi()->requestAccountInfo();\n \treturn $accountInfo;\n }",
"public function detail($id){\n\t\t\t$id = strtoupper($id);\n\t\t\tif(empty($id) || $id == \"\") $this->redirect(BASE_URL.\"bank/\");\n\n\t\t\t$data_detail = !empty($this->BankModel->getById($id)) ? $this->BankModel->getById($id) : false;\n\n\t\t\tif(!$data_detail) $this->redirect(BASE_URL.\"bank/\");\n\n\t\t\t$css = array(\n\t\t\t\t'assets/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css',\n\t\t\t);\n\t\t\t$js = array(\n\t\t\t\t'assets/bower_components/datatables.net/js/jquery.dataTables.min.js', \n\t\t\t\t'assets/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js',\n\t\t\t\t'app/views/bank/js/initView.js',\n\t\t\t\t'app/views/bank/js/initForm.js',\n\t\t\t);\n\n\t\t\t$config = array(\n\t\t\t\t'title' => array(\n\t\t\t\t\t'main' => 'Data Bank',\n\t\t\t\t\t'sub' => 'Detail Data Bank',\n\t\t\t\t),\n\t\t\t\t'css' => $css,\n\t\t\t\t'js' => $js,\n\t\t\t);\n\n\t\t\t$status = ($data_detail['status'] == \"AKTIF\") ? '<span class=\"label label-success\">'.$data_detail['status'].'</span>' : '<span class=\"label label-danger\">'.$data_detail['status'].'</span>';\n\t\t\t\n\t\t\t$_SESSION['token_bank']['view'] = md5($this->auth->getToken());\n\t\t\t$_SESSION['token_bank']['edit'] = md5($this->auth->getToken());\n\t\t\t$_SESSION['token_bank']['delete'] = md5($this->auth->getToken());\n\t\t\t\n\t\t\t$this->token = array(\n\t\t\t\t'view' => password_hash($_SESSION['token_bank']['view'], PASSWORD_BCRYPT),\n\t\t\t\t'edit' => password_hash($_SESSION['token_bank']['edit'], PASSWORD_BCRYPT),\n\t\t\t\t'delete' => password_hash($_SESSION['token_bank']['delete'], PASSWORD_BCRYPT)\n\t\t\t);\n\n\t\t\t$data = array(\n\t\t\t\t'id_bank' => $data_detail['id'],\n\t\t\t\t'nama' => $data_detail['nama'],\n\t\t\t\t'saldo' => $this->helper->cetakRupiah($data_detail['saldo']),\n\t\t\t\t'status' => $status,\n\t\t\t\t'token' => $this->token,\n\t\t\t);\n\n\t\t\t// echo \"<pre>\";\n\t\t\t// print_r($this->token);\n\t\t\t// echo \"</pre>\";\n\t\t\t$this->layout('bank/view', $config, $data);\n\t\t}",
"public function accountInfo()\n {\n return $this->sendAPIRequest('GET',\"/account\");\n }",
"public function show($id)\n {\n //return response()->json($bank);\n }",
"public function getBankAccounts()\n {\n return $this->get('/bank_accounts/index');\n }",
"public function getBankCode()\n {\n return $this->bank_code;\n }",
"public function getSavingAccountById() {\n $query = 'SELECT * FROM ' . $this->table . ' WHERE id = :id';\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':id', $this->id);\n $stmt->execute();\n $result = Utility::stmtToArray($stmt);\n $this->balance = $result[0]['balance'];\n $this->interest_rate = $result[0]['interest_rate'];\n $this->user_id = $result[0]['user_id'];\n return $result;\n }",
"public function show($id)\n\t{\n\t\t$bank = $this->repo->findOrFail($id);\n\n\t\treturn $this->rest->response(200, $bank);\n\t}",
"public function vendor_bank_details()\n {\n return $this->hasOne(VendorBankDetail::class, 'user_id', 'id');\n }",
"public function getBankname()\n {\n return $this->bankname;\n }",
"function getDataBank(){\n\t\n\t$db\t\t\t=\tnew\tDb_connection();\n\t$enkripsi\t=\tnew Enkripsi();\n\t\n\t$sql\t\t=\tsprintf(\"SELECT IDBANK, NAMA_BANK FROM m_bank WHERE STATUS = 1 ORDER BY NAMA_BANK\");\n\t$result\t\t=\t$db->query($sql);\n\t$data\t\t=\tarray();\n\t\n\tif($result){\n\n\t\tif(count($result) > 0){\n\n\t\t\tforeach($result as $key){\n\t\n\t\t\t\tarray_push($data, array($enkripsi->encode($key['IDBANK']), $key['NAMA_BANK']));\n\t\t\t\n\t\t\t}\n\n\t\t} else {\n\t\n\t\t\tarray_push($data, array('','Data tidak ditemukan'));\n\t\n\t\t}\n\n\t} else {\n\n\t\tarray_push($data, array('','Data tidak ditemukan'));\n\n\t}\n\n\techo json_encode($data);\n\tdie();\n\t\t\n}",
"public function getBank()\n {\n return $this->hasOne(Bank::className(), ['id' => 'bank_id']);\n }",
"public function show($id)\n {\n $account = BankAccount::find($id);\n if(! $account){\n return response()->json([\n \"status\" => \"error\",\n \"errors\" => \"Account Not Found\"\n ]);\n\n }\n\n return response()->json([\n \"status\" => \"success\",\n \"data\" => $account\n ], 200);\n }",
"public function index()\n {\n $bankname = BankName::get();\n return view('internals.bankinfo')->with('bankme', $bankname);\n }",
"public function getBillingInformation(CommonController $common){\n\t\t$billinginfo = array();\t\t\n\t\t//$frgtpwdata['email'] = $_REQUEST['customer_id'];\n\t\t$billingFlg = (isset($_REQUEST['billing_flag']))? trim($_REQUEST['billing_flag']): '1';\n\t\t$accessToken = $_REQUEST['oauth_token'];\n\t\t\n\t\t$data = $common->getCurl($billinginfo, $common->api_url().'customers/me/','GET',$accessToken);\n\t\tif($data){\n\t\t\t$billingData = array();\n\t\t\t$billingData['customer'] = array('customer_id'=>$data->id, 'email'=>$data->email);\n\t\t\t$billingData['address'] = new StdClass;\n\t\t\tif(count($data->addresses) > 0){\n\t\t\t\tforeach($data->addresses as $key=>$val)\n\t\t\t\t{\n\t\t\t\t\tif(($billingFlg == 1 && isset($val->default_billing) && $val->default_billing == true) || ($billingFlg == 0 && isset($val->default_shipping) && $val->default_shipping == true)) \n\t\t\t\t\t{\n\t\t\t\t\t\t/*$billingData['address']['address_id'] = $val->id;\n\t\t\t\t\t\t$billingData['address']['f_name'] = $val->firstname;\n\t\t\t\t\t\t$billingData['address']['l_name'] = $val->lastname;\n\t\t\t\t\t\t$billingData['address']['company'] = (isset($val->company))?$val->company : '';\n\t\t\t\t\t\t$billingData['address']['address'] = implode(',', $val->street);\n\t\t\t\t\t\t$billingData['address']['city'] = $val->city;\n\t\t\t\t\t\t$billingData['address']['state'] = $val->region->region_code;\n\t\t\t\t\t\t$billingData['address']['postcode'] = $val->postcode;\n\t\t\t\t\t\t$billingData['address']['country_id'] = $val->country_id;\n\t\t\t\t\t\t$billingData['address']['telephone'] = $val->telephone;*/\n\t\t\t\t\t\t$billingData['address']->address_id = $val->id;\n\t\t\t\t\t\t$billingData['address']->f_name = $val->firstname;\n\t\t\t\t\t\t$billingData['address']->l_name = $val->lastname;\n\t\t\t\t\t\t$billingData['address']->company = (isset($val->company))?$val->company : '';\n\t\t\t\t\t\t$billingData['address']->address = implode(',', $val->street);\n\t\t\t\t\t\t$billingData['address']->city = $val->city;\n\t\t\t\t\t\t$billingData['address']->state = $val->region->region_code;\n\t\t\t\t\t\t$billingData['address']->postcode = $val->postcode;\n\t\t\t\t\t\t$billingData['address']->country_id = $val->country_id;\n\t\t\t\t\t\t$billingData['address']->telephone = $val->telephone;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$json = '{ \"success\" : \"1\", \"data\" : ['.json_encode($billingData).'], \"message\" : \"\"}';\n\t\t} else {\n\t\t\t$json = '{ \"success\" : \"0\", \"data\" : [], \"message\" : \"Invalid data.\"}';\n\t\t}\n\t\treturn $this->SendResponse ( $json );\n\t}"
] | [
"0.6411849",
"0.6374879",
"0.6324565",
"0.6309071",
"0.62510914",
"0.6212165",
"0.6190475",
"0.6168072",
"0.6137882",
"0.609122",
"0.6087548",
"0.60283506",
"0.5964391",
"0.5958993",
"0.59581256",
"0.5941015",
"0.59116197",
"0.5904465",
"0.5890119",
"0.5869313",
"0.5858377",
"0.5836116",
"0.58338374",
"0.57459223",
"0.5733646",
"0.5711017",
"0.56955487",
"0.5695195",
"0.56838965",
"0.56773674"
] | 0.7185056 | 0 |
Gets the campaign information details for the application_id | public function getCampaignQuery($application_id) {
$query = 'SELECT cmi.campaign_info_id AS campaign_info_id,
cmi.application_id AS application_id,
cmi.campaign_name AS campaign_name,
st.name AS friendly_name,
cmi.promo_id AS promo_id,
cmi.promo_sub_code AS promo_sub_code,
st.name AS site,
st.license_key AS license_key,
cmi.application_id AS application_id
FROM campaign_info AS cmi
JOIN site AS st USING (site_id)
WHERE cmi.application_id = '.$application_id.' LIMIT 1;';
$result = $this->db->query($query);
$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);
return($rows);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCampaignInfo($id_campaign) {\n\n $sql = \"SELECT\n campaign.id_campaign AS id,\n name AS camp_name,\n description AS camp_description,\n to_char(start_date, 'MM/DD/YYYY HH24:MI') AS camp_start,\n to_char(end_date, 'MM/DD/YYYY HH24:MI') AS camp_end\n FROM ctn_campaigns campaign\n WHERE campaign.id_campaign = $id_campaign;\n \";\n return $this->doQueryArray($sql);\n\n }",
"public function getCampaignById($campaign_id, $application_id)\n {\n $endpoint = \"/email/public/v1/campaigns/{$campaign_id}\";\n\n $queryString = $this->buildQueryString(['appId' => $application_id]);\n\n return $this->request('get', $endpoint, [], $queryString);\n }",
"public function getCampaignId()\n {\n return $this->campaign_id;\n }",
"public function getIdCampaign()\n {\n return $this->id_campaign;\n }",
"function viewcampaign($request){\r\n\t\t$id = intval($request->param(\"ID\"));\r\n\t\t$this->campaign = CampaignMonitorCampaign::get()->byID($id);\r\n\t\tif(!$this->campaign) {\r\n\t\t\treturn $this->httpError(404, _t(\"CAMPAIGNMONITORSIGNUPPAGE.CAMPAIGN_NOT_FOUND\", \"Message not found.\"));\r\n\t\t}\r\n\t\treturn array();\r\n\t}",
"public function actionCampaign()\n {\n $campaignAlias = \\Yii::$app->request->getQueryParam('campaignAlias');\n $user = $this->getUser();\n $campaign = Campaign::findOne(['userId' => $user->id, 'status' => Campaign::STATUS_ACTIVE, 'alias' => $campaignAlias]);\n $response = array();\n if (count($campaign) != 0) {\n $response = $campaign->toArray(['amountRaised', 'goalAmount', 'startDate', 'endDate']);\n $response['name'] = $campaign->name;\n $response['description'] = $campaign->description;\n $response['alias'] = $campaign->alias;\n $response['goalAmount'] = $campaign->goalAmount;\n $response['amountRaised'] = $campaign->amountRaised;\n $response['numberOfDonations'] = $campaign->getDonations()->count();\n $response['numberOfDonors'] = $campaign->getDonations()->count('DISTINCT email');\n// $donationsArray = [];\n// $donations = $campaign->getDonations()->all();\n// foreach ($donations as $donation) {\n// $donationsArray[] = $donation->toArray(['id', 'amount', 'nameFromForm', 'comments', 'paymentDate']);\n// }\n $response['donations'] = [];//;$donationsArray;\n }\n return $response;\n }",
"public function GetCampaign($name) {\n\t\treturn $this->doQuery(\"campaigns/\".$name, \"GET\");\n\t}",
"public function get_campaigns() {\n\t\treturn $this->campaigns;\n\t}",
"public function getCampaign(int $id)\n {\n $path = '/campaigns/' . urlencode($id);\n $url = $this->buildUrl($path);\n $response = $this->makeRequest('GET', $url);\n return $response;\n }",
"public function getCampaign()\n {\n return $this->isCampaign() ? $this->campaign : null;\n }",
"public function ListCampaigns() {\n\t\treturn $this->doQuery(\"campaigns\", \"GET\");\n\t}",
"Public Abstract Function getCampaignByIdAPI($Id);",
"Public Function getCampaign($ID)\n\t{\n\t\t//ID \tapiCampaignId \tuser__id \tproviderType \taccountId \tname \tbudget \tsearchTarget \tupdated \tstatus\n\t\t$Output = new PPCCampaignObject();\n\t\t$Data = $this->_db->fetchRow(\"SELECT id, apiCampaignId, user__id, providerType, accountId, name, budget, searchTarget, updated, status FROM bevomedia_ppc_campaigns WHERE id = {$ID}\");\n\t\t$Output->providerType = $Data->providerType;\n\t\t$Output->campaignId = $Data->id;\n $Output->accountId = $Data->accountId;\n\t\t$Output->apiCampaignId = $Data->apiCampaignId;\n\t\t$Output->user__id = $Data->user__id;\n\t\t$Output->name = $Data->name;\n\t\t$Output->budget = $Data->budget;\n\t\t$Output->searchTarget = $Data->searchTarget;\n\t\t$Output->status = $Data->status;\n\t\t$Output->updated = $Data->updated;\n\t\t$Output->negativeKeywords = $this->getCampaignNegativeKeywords($ID);\n\t\t$Output->geotargetCountries = $this->getCampaignGeotargetCountries($ID);\n\t\treturn $Output;\n\t}",
"public function getApiCampaignId()\n {\n return $this->scopeConfig->getValue(\n self::XML_PATH_API_CAMPAIGN_ID,\n ScopeInterface::SCOPE_STORE\n );\n }",
"public function getCampaignID()\r\n {\r\n return $this->cid;\r\n }",
"public static function getCampaign($id)\n {\n // construct url\n $url = self::getBaseUrl() . '?' . http_build_query(array(\n 'id' => $id\n ));\n\n // query app nexus server\n $response = self::makeRequest($url, Api::GET);\n\n // wrap response with app nexus object\n return new AppNexusObject($response, AppNexusObject::MODE_READ_WRITE);\n }",
"Public Function getCampaigns()\n\t{\n\t\treturn $this->_db->fetchAll('SELECT * FROM bevomedia_ppc_campaigns WHERE accountId = ' . $this->id . ' AND providerType = ' . $this->providerType);\n\t}",
"private function retrieve_campaign()\n {\n global $wpdb;\n /* Executes the query */\n $query = 'SELECT * FROM ' . wp_adpress_campaigns::campaigns_table() . ' WHERE id=' . $this->id . ';';\n $results = $wpdb->get_row($query, ARRAY_A);\n if ($results === false) {\n $this->state = 'unset';\n return false;\n } else {\n $this->state = 'set';\n /* Populate the campaign object */\n $this->settings = unserialize($results['settings']);\n $this->ad_definition = unserialize($results['ad_definition']);\n return true;\n }\n }",
"public function retrieveCampaignAds(int $client, int $campaign)\n {\n }",
"public function getAll(){\n\t\t $campaignService = $this->api->getService('CampaignService');\n\t\t\n\t\t # Create selector.\n\t\t $selector = new \\Selector();\n\t\t $selector->fields = array('Id', 'Name', 'Impressions', 'Clicks', 'Cost', 'Ctr');\n\n\t\t $selector->ordering[] = new \\OrderBy('Name', 'ASCENDING');\n\t\t\n\t\t # Create paging controls.\n\t\t $selector->paging = new \\Paging(0, \\AdWordsConstants::RECOMMENDED_PAGE_SIZE);\n\t\t \n\t\t $selector->predicates[] = new \\Predicate('Status', 'IN', array('ACTIVE'));\n \t\t \n\t\t //$selector->predicates[] = new \\Predicate('Status', 'NOT_IN', array('PAUSED'));\n\t\t \n\n\t\t # Date Range\n\t\t $dateRange = new \\DateRange();\n\t\t $dateRange->min = date('Ymd', strtotime('-2 week'));\n\t\t $dateRange->max = date('Ymd', strtotime('-1 day'));\n\t\t $selector->dateRange = $dateRange;\n\t\t \n\t\t do {\n\t\t\t# Make the get request.\n\t\t\t$page = $campaignService->get($selector);\n\t\t\n\t\t\t# Display results.\n\t\t\tif (isset($page->entries)) {\n\t\t\t foreach ($page->entries as $campaign) {\n\t\t\t\t$campaigns_array[] = $campaign;\t\t\t\t\n\t\t\t }\n\t\t\t}\n\t\t\t# Advance the paging index.\n\t\t\t$selector->paging->startIndex += \\AdWordsConstants::RECOMMENDED_PAGE_SIZE;\n\t\t } while ($page->totalNumEntries > $selector->paging->startIndex);\n\t\t \n\t\n\t\treturn $campaigns_array;\n\t}",
"public function campaignName() {\n return $this->campaignName;\n }",
"public function getGamemasterCampaign($gm_id) {\n $mysqli = $this->connect();\n\n $query = \"SELECT id, title FROM campaigns WHERE gamemaster=?\";\n $query = $mysqli->real_escape_string($query);\n\n $stmt = $mysqli->stmt_init();\n\n if(!$stmt->prepare($query)) {\n\tprint(\"Failed to prepare statement!\");\n } else {\n\t$stmt->bind_param('i', $gm_id);\n\t$stmt->execute();\n\t$stmt->bind_result($id, $title);\n\t$stmt->fetch();\n\n\t$campaign = array(\n\t\t\t 'id' => $id,\n\t\t\t 'title' => $title\n\t\t\t );\n }\n $stmt->close();\n $mysqli->close();\n return $campaign;\n }",
"public function getCampaignId()\n {\n return isset($this->campaign_id) ? $this->campaign_id : 0;\n }",
"public function getApplicationDetailsQuery($application_id) {\n\t\t$query = 'SELECT\n\t\t\t\tap.application_id AS application_id,\n\t\t\t\tap.apr AS apr,\n\t\t\t\tap.customer_id AS customer_id,\n\t\t\t\tap.modifying_agent_id AS modifying_agent_id,\n\t\t\t\tap.cfe_rule_set_id AS cfe_ruleset_id,\n\t\t\t\tap.date_first_payment AS date_first_payment,\n\t\t\t\tif(ap.date_fund_actual>\"1990-01-01\",ap.date_fund_actual,NULL) AS date_fund_actual,\n\t\t\t\tap.date_fund_estimated AS date_fund_estimated,\n\t\t\t\tap.date_next_contact AS date_next_contact,\n\t\t\t\tap.finance_charge AS finance_charge,\n\t\t\t\tap.fund_actual AS fund_actual,\n\t\t\t\tap.fund_qualified AS fund_qualified,\n\t\t\t\tap.fund_requested AS fund_requested,\n\t\t\t\tap.is_watched AS is_watched,\n\t\t\t\tap.payment_total AS payment_total,\n\t\t\t\tap.rule_set_id AS rule_set_id,\n\t\t\t\tap.date_modified AS date_modified,\n\t\t\t\tap.call_time_pref AS call_time_pref,\n\t\t\t\tap.contact_method_pref AS contact_method_pref,\n\t\t\t\tap.marketing_contact_pref AS marketing_contact_pref,\n\t\t\t\tap.call_time_pref AS call_time_pref,\n\t\t\t\tap.contact_method_pref AS contact_method_pref,\n\t\t\t\tap.marketing_contact_pref AS marketing_contact_pref,\n\t\t\t\tap.source AS application_source,\n\t\t\t\tap.application_type AS application_type,\n\t\t\t\tIF (av.version IS NULL,1,av.version) AS application_version\n\t\t\tFROM application AS ap\n\t\t\t\tLEFT JOIN application_version AS av ON (ap.application_id = av.application_id)\n\t\t\tWHERE ap.application_id = '.$application_id.';';\n\t\t$result = $this->db->query($query);\n\t\t$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($rows);\n\t}",
"public function application_details($id)\n {\n $application = Application::join('category', 'application.category_id', '=', 'category.id')\n ->join('users', 'application.user_id', '=', 'users.id')\n ->where('application.id', $id)\n ->select('application.*', 'category.category_name', 'users.full_name')->get();\n \n if(!empty($application[0]->id)) {\n $this->responseStatusCode = $this->statusCodes->success;\n $response = api_create_response($application[0], $this->successText, 'Application List.');\n\n }else {\n $this->responseStatusCode = $this->statusCodes->not_found;\n $response = api_create_response(2, $this->failureText, 'No Application Found.');\n }\n \n return response()->json($response, $this->responseStatusCode);\n }",
"public function insertCampaignQuery($app){\n\t\t$date = date(\"Y-m-d G:i:s\");\n\t\t$campaign_info = $app->campaign_info;\n\t\t$query = 'INSERT INTO campaign_info (\n\t\t\t\tdate_created,\n\t\t\t\tdate_modified,\n\t\t\t\tcampaign_name,\n\t\t\t\tapplication_id,\n\t\t\t\tpromo_id,\n\t\t\t\tpromo_sub_code,\n\t\t\t\tsite_id,\n\t\t\t\treservation_id\n\t\t\t) VALUES (\n\t\t\t\t\"'.$date.'\",\n\t\t\t\t\"'.$date.'\",\n\t\t\t\t\"'.$campaign_info->campaign_name.'\",\n\t\t\t\t'.$app->application_id.',\n\t\t\t\t\"'.$campaign_info->promo_id.'\",\n\t\t\t\t\"'.$campaign_info->promo_sub_code.'\",\n\t\t\t\t'.$app->site_id.',\n\t\t\t\t\"'.$campaign_info->reservation_id.'\"\n\t\t\t);';\n\t\t$result = $this->db->query($query);\n\n\t\treturn($this->db->lastInsertId());\n\t}",
"public static function getAppInfo() {\n\t\t$info = false;\n\t if (self::$site === false) {\n\t\t self::$site = Settings::get( \"crm_conn_site\");\n\t }\n\t if (self::$portal === false) {\n\t\t self::$portal = Settings::get( \"crm_conn_portal\");\n\t }\n\t if (self::$app_id === false) {\n\t\t self::$app_id = Settings::get( \"crm_conn_app_id\");\n\t }\n\t if (self::$secret === false) {\n\t\t self::$secret = Settings::get( \"crm_conn_secret\");\n\t }\n\t if (self::$site && self::$portal && self::$app_id && self::$secret) {\n\t\t $info = [\n\t\t \t'site' => self::$site,\n\t\t \t'portal' => self::$portal,\n\t\t \t'app_id' => self::$app_id,\n\t\t \t'secret' => self::$secret,\n\t\t ];\n\t }\n\t\treturn $info;\n }",
"public function show($id)\n {\n return new AdvertisementCampaignResource(AdvertisementCampaign::findOrFail($id));\n }",
"public function campaign()\n\t{\n\t\treturn $this->belongsTo('Campaign', 'campaign_id');\n\t}",
"public function getCampaigns()\r\n {\r\n // with a draft status of 1\r\n $select = new Select('launchcampaign');\r\n \r\n $select->columns(array('campaign_id', 'title', 'campaign_status'))\r\n ->where(\"draft_status = '1'\");\r\n \r\n $adapter = $this->table_gateway->getAdapter();\r\n \r\n $query = $adapter->query($this->sql->buildSqlString($select), $adapter::QUERY_MODE_EXECUTE);\r\n \r\n $holder = array();\r\n \r\n foreach ($query as $key => $row) {\r\n $holder[$key] = $row;\r\n }\r\n \r\n return $holder;\r\n }"
] | [
"0.68331015",
"0.64153266",
"0.622766",
"0.60589886",
"0.6025219",
"0.592668",
"0.59235036",
"0.5913644",
"0.58999103",
"0.58436596",
"0.5843422",
"0.5826757",
"0.58124495",
"0.5793131",
"0.5776582",
"0.57761425",
"0.5715748",
"0.565754",
"0.56490165",
"0.5626435",
"0.5625581",
"0.55958015",
"0.5587681",
"0.5549373",
"0.55441034",
"0.5531891",
"0.55307645",
"0.548747",
"0.5450276",
"0.5448225"
] | 0.6711737 | 1 |
Finds a specific contact_info entry by application_id and contact type. | public function getContactInfoQuery($application_id,$contact_type = false) {
$primary = false;
if ($contact_type == "primary") {
$primary = true;
$query = 'SELECT ap.contact_method_pref AS contact_type
FROM application AS ap
WHERE ap.application_id = '.$application_id;
$result = $this->db->query($query);
$row = $result->fetch(DB_IStatement_1::FETCH_OBJ);
if ($row->contact_type == 'no preference') $contact_type = 'phone_home';
else $contact_type = $row->contact_type;
}
if (!$contact_type) $contact_type_ary = array('phone_cell','phone_home','phone_fax','email','phone_work');
else $contact_type_ary = array($contact_type);
$rows = array();
foreach($contact_type_ary as $contact_type){
$contact_type_name_string = ', ap.'.$contact_type.' AS contact_info_value';
$query = 'SELECT ap.application_id AS contact_info_id,
ap.application_id AS application_id,
"'.$contact_type.'" AS contact_type,
ap.modifying_agent_id AS modifying_agent_id'.
$contact_type_name_string.'
FROM application AS ap
WHERE ap.application_id = '.$application_id;
$result = $this->db->query($query);
$row = $result->fetch(DB_IStatement_1::FETCH_OBJ);
$rows[] = $row;
}
return($rows);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function findContact($field, $value){\n\t\t\tif(isset($field)&&isset($value)){\n\t\t\t\t$this->query = \"SELECT * FROM contacts WHERE $field = '$value'\" or die(\"Error ...\".mysqli_error($this->myConnection));\n\t\t\t\t$result = $this->myConnection->query($this->query);\t\n\t\t\t\tif(isset($result)){\n\t\t\t\t\t//num_rows value =1 then an object has been retrieve from the contacts table\n\t\t\t\t\tif($result->num_rows == 1){\n\t\t\t\t\t\techo \"<table><tr><th>Firstname</th><th>Surname</th><th>Email</th><th>Mobile</th></tr>\";\n\t\t\t\t\t\twhile ($row = mysqli_fetch_array($result)){\n\t\t\t\t\t\t\techo \"<tr><td>\".$row[\"firstname\"].\"</td><td>\".$row[\"surname\"].\"</td><td>\".$row[\"email\"].\"</td><td id='tdM'>\".$row[\"mobile\"].\"</td></tr>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"</table>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//value entered doesn't exist so no object has been returned\n\t\t\t\tif($result->num_rows == 0){\n\t\t\t\t\techo strtoupper($value).\" could not be found!!!!!\";\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function findContactByID($id) {\r\n Log::info(\"Entering ProfileBusinessService.findContactByID()\");\r\n \r\n //get credentials for accessing the database\r\n $servername = config(\"database.connections.mysql.host\");\r\n $dbname = config(\"database.connections.mysql.database\");\r\n $username = config(\"database.connections.mysql.username\");\r\n $password = config(\"database.connections.mysql.password\");\r\n \r\n //create connection\r\n $conn = new PDO(\"mysql:host=$servername;dbname=$dbname\", $username, $password);\r\n $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n \r\n //create a profile dao with this connection and try to find contact info by id\r\n $service = new ProfileDataService($conn);\r\n $flag = $service->findContactByID($id);\r\n \r\n //return the finder results\r\n Log::info(\"Exit ProfileBusinessService.findContactByID() with \" . print_r($flag, true));\r\n return $flag;\r\n }",
"public function findContact($contactId)\n {\n return $this->ploomesConfig->ODataObject\n ->from('Contacts')\n ->where('Id',$contactId)\n ->expand('Phones')\n ->first();\n }",
"private function contact($id)\n\t{\n\t\tif(is_numeric($id)) {\n\t\t\t$Contact = Contact::find($id);\n\t\t\tif ($Contact) {\n\t\t\t\treturn $Contact;\n\t\t\t}\n\t\t}\n\n\t\t$query = Contact::where('external_key', $id);\n $count = $query->count();\n\n\t\tif (!$count) {\n\t\t\tresponse()->json([\n\t\t\t\t'status' => 'error',\n\t\t\t\t'data' => [],\n\t\t\t\t'messages' => ['Record not found'],\n\t\t\t])->send();\n\t\t\texit;\n\t\t}\n\n\t\tif ($count > 1) {\n\t\t\tresponse()->json([\n\t\t\t\t'status' => 'error',\n\t\t\t\t'data' => [],\n\t\t\t\t'messages' => ['Multiple records found'],\n\t\t\t])->send();\n\t\t\texit;\n\t\t}\n\n\t\treturn $query->first();\n\t}",
"public function getContactInformation();",
"public function getContactInfo($key)\n\t{\n\t\treturn object_get($this->contact_info, $key, null);\n\t}",
"function getContactListbyType($owner_id, $contact_type, $dataHelper) {\n if (!is_object($dataHelper))\n {\n throw new Exception(\"client_db_function.inc.php : getContactListbyType : DataHelper Object did not instantiate\", 104);\n }\n\n if (strlen(trim($owner_id)) <= 0)\n {\n throw new Exception(\"client_db_function.inc.php : getContactListbyType : Missing Parameter owner_id.\", 143);\n }\n\n if (strlen(trim($contact_type)) <= 0)\n {\n throw new Exception(\"client_db_function.inc.php : getContactListbyType : Missing Parameter contact_type.\", 143);\n }\n\n try\n {\n $dataHelper->setParam(\"'\" . $owner_id . \"'\", \"I\");\n $dataHelper->setParam(\"'\" . $contact_type . \"'\", \"I\");\n $arrContactList = $dataHelper->fetchRecords(\"SP\", 'GetContactList');\n $dataHelper->clearParams();\n return $arrContactList;\n }\n catch (Exception $e)\n {\n throw new Exception(\"client_db_function.inc.php : getContactList : Failed : \" . $e->getMessage(), 145);\n }\n}",
"public function find_contact_by_id( $contact_id ) {\n\t\treturn $this->get( $this->get_url( 'contacts/' . intval( $contact_id ) ) );\n\t}",
"public function getContactInfo() {\n $sql = \"SELECT * FROM contact_info, users where users.uid=contact_info.userid ORDER BY date_create DESC limit 1\";\n \n return $this->query($sql);\n }",
"public function getType($id) {\n try {\n $this->openDb();\n $res = $this->contactsGateway->selectByIdType($id);\n $this->closeDb();\n return $res;\n } catch (Exception $e) {\n $this->closeDb();\n throw $e;\n }\n return $this->contactsGateway->find($id);\n }",
"public function findById($id)\n {\n foreach ($this as $contact) {\n /** @var SFContact $contact */\n if ($contact->Id == $id) {\n return $contact;\n }\n }\n\n return null;\n }",
"protected function find_entry(){\n\t\t$wpdb = $this->get_wpdb();\n if ( $wpdb ) {\n $table = $wpdb->prefix . 'cf_form_entries';\n $sql = $wpdb->prepare(\"SELECT * FROM $table WHERE `id` = %d AND `form_id` = %s\", $this->entry_id, $this->form['ID']);\n $results = $wpdb->get_results($sql);\n if (!empty($results)) {\n $this->found = true;\n $this->entry = new Caldera_Forms_Entry_Entry();\n $this->entry->set_form_object($results[0]);\n } else {\n $this->found = false;\n }\n }\n\n\t}",
"public function getContact() {\n\t\t$rule = new Intra_Filter();\n\t\t$rule->whereIn('c_id', $this->get('c_id'));\n\t\t$rule->whereRecordlist('p_class', 'Contact');\n\t\treturn Person::load($rule)->current();\n\t}",
"public static function findbyName($name) {\r\n\t\treturn Doctrine::getTable ( 'ContactsTypes' )->findOneBy ( 'name', $name, Doctrine_Core::HYDRATE_ARRAY );\r\n\t}",
"public function show(contact_info $contact_info)\n {\n //\n }",
"public function testFindContact()\n\t{\n\t\t$contact = Contact::find(\"3f73432a-2b95-4ae7-b5d6-79808e74c254\");\n\n\t\t/*\n\t\t|------------------------------------------------------------\n\t\t| Assertion\n\t\t|------------------------------------------------------------\n\t\t*/\n\t\t$this->assertTrue($contact->ContactID == \"3f73432a-2b95-4ae7-b5d6-79808e74c254\");\n\t}",
"function apigee_appdashboard_app_contact_get($entity, array $options, $name, $type, $context)\n{\n if ($entity instanceOf ApigeeCompanyAppEntity) {\n $company = new \\Apigee\\ManagementAPI\\Company(devconnect_default_org_config());\n $company = $company->load($entity->companyName);\n return $company->getAttribute('ADMIN_EMAIL');\n } else {\n return $entity->developer;\n }\n}",
"protected function _find($type, $id) {\n if (is_array($id)) {\n return $this->__mfind($this->index(), $type, $id);\n } else {\n return $this->__find($this->index(), $type, $id);\n }\n }",
"public function show($id)\n {\n $dato = ContactType::where( 'ctype_id', '=', $id)\n ->first();\n return $this->showOne($dato,200);\n }",
"function searchContacts($pattern, $handleOnly = FALSE,\n $type = SURFERCONTACT_STATUS_ACCEPTED, $number = NULL, $offset = NULL, $sort = 'ASC') {\n\n $surferId = $this->surfer;\n\n // Default Sorting\n $sort = ($sort != 'DESC') ? 'ASC' : 'DESC';\n\n // Create an empty array for contacts\n $contacts = array();\n\n // Create contact type condition depending on $type argument\n $typeCondition = 'c.surfercontact_status = 2';\n if ($type == SURFERCONTACT_STATUS_PENDING) {\n $typeCondition = 'c.surfercontact_status = 1';\n } elseif ($type == SURFERCONTACT_STATUS_BOTH) {\n $typeCondition = 'c.surfercontact_status IN (1, 2)';\n }\n\n //include_once(PAPAYA_INCLUDE_PATH.'system/base_searchstringparser.php');\n //$parser = new searchStringParser();\n //$parser->tokenMinLength = 2;\n if ($handleOnly) {\n $searchFields = array('s.surfer_handle');\n } else {\n $searchFields = array('s.surfer_handle', 's.surfer_givenname', 's.surfer_surname');\n }\n\n // cant use papaya search string parser, e.g. because we want allow to search for \"And\"\n // as a part of a name\n $filter = array();\n foreach ($searchFields as $searchField) {\n if (count($filter) > 0) {\n $filter[] = 'OR';\n }\n\n $filter[] = sprintf(\"%s LIKE '%%%s%%'\", $searchField, $this->escapeStr($pattern));\n }\n\n //if ($filter = $parser->getSQL($pattern, $searchFields, PAPAYA_SEARCH_BOOLEAN)) {\n if (count($filter) > 0) {\n // Select all records in which our surfer is either requestor or requested\n $sql = \"SELECT DISTINCT\n s.surfer_id,\n s.surfer_handle,\n s.surfer_givenname,\n s.surfer_surname,\n c.surfercontact_status\n FROM %s c, %s s\n WHERE (\" . str_replace('%', '%%', implode(' ', $filter)) . \")\n AND ((c.surfercontact_requestor='%s'\n AND c.surfercontact_requested = s.surfer_id\n AND s.surfer_valid != 4)\n OR (c.surfercontact_requested='%s'\n AND c.surfercontact_requestor = s.surfer_id\n AND s.surfer_valid != 4))\n AND %s\n ORDER BY s.surfer_handle \" . $sort;\n $sqlParams = array($this->tableContacts, $this->tableSurfer, $surferId,\n $surferId, $typeCondition);\n if ($res = $this->databaseQueryFmt($sql, $sqlParams, $number, $offset)) {\n while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $contacts[$row['surfer_id']] = $row;\n }\n $this->absCount = $res->absCount();\n }\n }\n\n return $contacts;\n }",
"function getContactDetails($contact_id, $dataHelper) {\n if (!is_object($dataHelper))\n {\n throw new Exception(\"contact_function.inc.php : getContactDetails : DataHelper Object did not instantiate\", 104);\n }\n\n if (strlen(trim($contact_id)) <= 0)\n {\n throw new Exception(\"contact_function.inc.php : getContactDetails : Missing Parameter contact_id.\", 143);\n }\n\n try\n {\n $strSqlQuery = \"SELECT * FROM client_contact_details WHERE client_contact_id = '\" . trim($contact_id) . \"';\";\n $arrResult = $dataHelper->fetchRecords(\"QR\", $strSqlQuery);\n return $arrResult;\n }\n catch (Exception $e)\n {\n throw new Exception(\"contact_function.inc.php : Error in getContactDetails.\" . $e->getMessage(), 734);\n }\n}",
"public function getContactByType(string $type): ?string\n {\n $pattern = '//epp:epp/epp:response/epp:resData/domain:infData/domain:contact[php:functionString(\"XPath\\quote\", @type) = \\'%s\\']';\n $node = $this->getFirst(sprintf($pattern, XPath\\quote($type)));\n if ($node === null) {\n return null;\n }\n\n return $node->nodeValue;\n }",
"function getSalesforceContact($phone, $access_token, $domain, $name) {\n $url = \"https://\" . $domain . \".salesforce.com/services/data/v36.0/parameterizedSearch\";\n $params = array(\n \"q\" => $phone,\n \"fields\" => [\"id\", \"firstName\", \"lastName\", \"phone\"],\n \"sobjects\" => [ array(\"name\" => $name)],\n \"in\" => \"ALL\"\n );\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST,true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Accept: application/json',\n 'Authorization: Bearer ' . $access_token\n ));\n\n $output = curl_exec($ch);\n $info = curl_getinfo($ch);\n curl_close($ch);\n\n $result = json_decode($output);\n\n if(isset($result[0]->Id)) {\n return $result[0];\n } else {\n return null;\n }\n}",
"public function getContactCategory()\n {\n return $this->hasOne(ContactCategory::class, ['id' => 'type']);\n }",
"public function findContactById($id) {\n return null;\n }",
"public function contactInfo()\n {\n return $this->hasOne('App\\ContactInfo');\n }",
"public function contact($nameOrEmail)\n {\n if ($this->contacts === null) {\n $this->getContacts();\n }\n\n foreach ($this->contacts as $c) {\n if ($c->name == $nameOrEmail || $c->email == $nameOrEmail) {\n return $c;\n }\n }\n\n throw new Exceptions\\NotFoundException(\"Contact not found.\");\n }",
"public function find($code) {\r\n //$operator = \"\";\r\n $result = $this->db->query(\"select * from \" . self::TABLE . \" where \" . self::C_CODE . \"='$code'\");\r\n\r\n $contact = new Contact();\r\n\r\n while ($rows = $result->fetch(PDO::FETCH_ASSOC)) {\r\n $contact->setCode(utf8_encode($rows[self::C_CODE]));\r\n $contact->setNom(utf8_encode($rows[self::C_NOM]));\r\n $contact->setAdresse(utf8_encode($rows[self::C_ADRESSE]));\r\n $contact->setCp(utf8_encode($rows[self::C_CP]));\r\n $contact->setVille(utf8_encode($rows[self::C_VILLE]));\r\n $contact->setPays(utf8_encode($rows[self::C_PAYS]));\r\n $contact->setTel1(utf8_encode($rows[self::C_TEL1]));\r\n $contact->setTel2(utf8_encode($rows[self::C_TEL2]));\r\n $contact->setTel3(utf8_encode($rows[self::C_TEL3]));\r\n $contact->setTel4(utf8_encode($rows[self::C_TEL4]));\r\n $contact->setEmail(utf8_encode($rows[self::C_EMAIL]));\r\n $contact->setAdresse(utf8_encode($rows[self::C_ADRESSE]));\r\n $contact->setAdresse2(utf8_encode($rows[self::C_ADRESSE2]));\r\n $contact->setAdresse3(utf8_encode($rows[self::C_ADRESSE3]));\r\n $contact->setAdresse4(utf8_encode($rows[self::C_ADRESSE4]));\r\n }\r\n\r\n return $contact;\r\n }",
"public static function findIdentity($id)\r\n {\r\n return ContactDB::getActiveContactById($id);\r\n }",
"public function findOne($id) {\n $contact = Contact::findOrFail($id);\n broadcast(new ContactsRetrieved($contact));\n return response()->json('retrieved');\n }"
] | [
"0.5742313",
"0.56659",
"0.558956",
"0.5503771",
"0.5491775",
"0.5449341",
"0.54367995",
"0.5413459",
"0.5339294",
"0.52888775",
"0.5246891",
"0.5246215",
"0.5226188",
"0.5225803",
"0.52153474",
"0.51966745",
"0.5191501",
"0.5173174",
"0.51575786",
"0.5150284",
"0.5141802",
"0.5140576",
"0.5109686",
"0.5088997",
"0.5036069",
"0.5030011",
"0.50247234",
"0.49527514",
"0.49409997",
"0.4919025"
] | 0.6495882 | 0 |
Gets the do not loan audit details for a ssn. | public function getDoNotLoanAuditQuery($ssn) {
$query = 'SELECT dl.ssn AS ssn,
dl.company_id AS company_id,
dl.value_before AS old_value,
dl.value_after AS new_value,
dl.table_name AS table_name,
dl.agent_id AS modifying_agent_id,
dl.date_created AS date_created
FROM do_not_loan_audit AS dl
WHERE dl.ssn = '.$ssn.'
ORDER BY dl.date_created;';
$result = $this->db->query($query);
return($result->fetchAll(DB_IStatement_1::FETCH_OBJ));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDoNotLoanFlagQuery($ssn) {\n\t\t$query = 'SELECT dl.ssn AS ssn,\n\t\t\t\tct.name AS category,\n\t\t\t\tdl.company_id AS company_id,\n\t\t\t\tdl.other_reason AS other_reason,\n\t\t\t\tdl.explanation AS explanation,\n\t\t\t\tdl.agent_id AS modifying_agent_id,\n\t\t\t\tif(dl.active_status = \"inactive\",false,true) AS active_status,\n\t\t\t\tdl.active_status AS active_status_new,\n\t\t\t\tdl.date_created AS date_created,\n\t\t\t\tdl.date_modified AS date_modified\n\t\t\tFROM do_not_loan_flag AS dl \n\t\t\t\tJOIN do_not_loan_flag_category AS ct USING (category_id)\n\t\t\tWHERE dl.ssn = '.$ssn.'\n\t\t\tORDER BY dl.date_modified;';\n\t\t$result = $this->db->query($query);\n\t\t$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($rows);\n\t}",
"public function getDoNotLoanFlagAllQuery($ssn) {\n\t\t$query = 'SELECT dl.ssn AS ssn,\n\t\t\t\tct.name AS category,\n\t\t\t\tdl.company_id AS company_id,\n\t\t\t\tdl.other_reason AS other_reason,\n\t\t\t\tdl.explanation AS explanation,\n\t\t\t\tdl.agent_id AS modifying_agent_id,\n\t\t\t\tif(dl.active_status = \"inactive\",false,true) AS active_status,\n\t\t\t\tdl.active_status AS active_status_new,\n\t\t\t\tdl.date_created AS date_created,\n\t\t\t\tdl.date_modified AS date_modified\n\t\t\tFROM do_not_loan_flag AS dl\n\t\t\t\tJOIN do_not_loan_flag_category AS ct USING (category_id)\n\t\t\tWHERE dl.ssn = '.$ssn.'\n\t\t\tORDER BY dl.date_modified;';\n\t\t$result = $this->db->query($query);\n\t\treturn($result->fetchAll(DB_IStatement_1::FETCH_OBJ));\n\t}",
"function get_audit_trail_logs(){\n\t\t$pagepointer = '';\n\t\tif(isset($_SESSION['temp_storage']['pagepointer']) && $_SESSION['temp_storage']['pagepointer']){\n\t\t\t$pagepointer = $_SESSION['temp_storage']['pagepointer'];\n\t\t}\n\t\t\n\t\t$oldurl = 'tmp/audit_logs/';\n\t\t\n\t\t$array_to_return = array();\n\t\t\n\t\tif(is_dir($pagepointer.$oldurl)){\n\t\t\t//3. Open & Read all files in directory\n\t\t\t$cdir = opendir($pagepointer.$oldurl);\n\t\t\twhile($cfile = readdir($cdir)){\n\t\t\t\tif(!($cfile=='.' || $cfile=='..')){\n\t\t\t\t\t//Check if report exists\n\t\t\t\t\t$get_name = explode('.',$cfile);\n\t\t\t\t\tif(isset($get_name[0]) && $get_name[0]){\n\t\t\t\t\t\t$array_to_return[$get_name[0]] = date('j-M-Y',($get_name[0]/1)).' Log';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($cdir);\n\t\t}\n\t\t\n\t\treturn $array_to_return;\n\t}",
"public function getLoanHistory() {\r\n\t\r\n\t}",
"function getDetails($jnl_id)\r\n\t{\r\n\t\t$log = FezLog::get();\r\n\t\t$db = DB_API::get();\r\n\r\n\t\tif(empty($jnl_id) || !is_numeric($jnl_id)) {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\r\n\t\t$stmt = \"SELECT\r\n *\r\n FROM\r\n \" . APP_TABLE_PREFIX . \"journal\r\n WHERE\r\n jnl_id = \".$db->quote($jnl_id, 'INTEGER');\r\n\t\ttry {\r\n\t\t\t$res = $db->fetchRow($stmt);\r\n\t\t}\r\n\t\tcatch(Exception $ex) {\r\n\t\t\t$log->err($ex);\r\n\t\t\treturn '';\r\n\t\t}\r\n\r\n\t\t$res[\"jnl_issns\"] = Journal::getISSNs($jnl_id);\r\n\t\t\r\n\t\treturn $res;\r\n\t}",
"public function getPurchaseStatusChangeHistory(Sale $sale)\n {\n }",
"public function getAuditTrailLogs(Request $request){\n \t\treturn $this->createGetResponse($request,(new AuditLogs)->newQuery()\n ->orderBy('AUDIT_LOGS_ID','DESC'));\n \t}",
"public function getOutstandingByLoanId($loan_id)\n {\n return Repayment::where('loan_id', $loan_id)->where('payment_status', 'unpaid')->get();\n }",
"public function get_audit_history($shift_id);",
"public function get_audit_history($shift_id) {\n $sql_audits = $this->conn->execute_query(\"SELECT * FROM ShiftAuditTrail WHERE ShiftID=?\",\"d\",$shift_id);\n $audits = array();\n foreach ($sql_audits[1] as $sql_audit) {\n array_push($audits, new AuditTrail($sql_audit[\"ShiftID\"],\n strtotime($sql_audit[\"ModificationDate\"]),\n $sql_audit[\"Details\"]));\n }\n return $audits;\n }",
"function _auditfiles_used_not_managed_get_file_data($file_id) {\n // Get the file information for the specified file ID from the database.\n $connection = Database::getConnection();\n $query = 'SELECT * FROM {file_usage} WHERE fid = ' . $file_id;\n $file = $connection->query($query)->fetchObject();\n\n $url = Url::fromUri('internal:/'.$file->type . '/' . $file->id);\n $result = Link::fromTextAndUrl($file->type . '/' . $file->id, $url)->toString();\n return [\n 'fid' => $file->fid,\n 'module' => $file->module . ' ' . t('module'),\n 'id' => $result,\n 'count' => $file->count,\n ];\n }",
"public function getSummary()\n {\n //Check to make sure we have a user, otherwise, blame it on the robot\n if ($this->user->id) {\n $name = $this->user->first_name . \" \" . $this->user->last_name;\n } else {\n $name = \"Fisdap Robot\";\n }\n $signoffDTFormat = 'M j, Y \\a\\t Hi';\n\n // Change timezone to program timezone\n date_default_timezone_set('America/Chicago');\n\n /** @var DateTime $signoffDT */\n $signoffDT = $this->timestamp;\n $programSettings = $this->shift->student->program->program_settings;\n\n if ($programSettings && $programSettings->timezone && $programSettings->timezone->mysql_offset) {\n $signoffDT->setTimezone(DateTime::createFromFormat('O', $programSettings->timezone->mysql_offset)->getTimezone());\n $signoffDTFormat = $signoffDT->format($signoffDTFormat);\n } else {\n $signoffDT->setTimezone(new DateTimeZone('America/Chicago'));\n $signoffDTFormat = $signoffDT->format($signoffDTFormat);\n }\n\n return $this->change->name . \" by \" . $name . \" - \" . $signoffDTFormat;\n }",
"public function list_saldo(){\n\t\t$response = $this->mod3->getRecords(false,\"A.CALUMNO>0 GROUP BY 1,2,3\");\n\t\tif(empty($response)){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn $response;\n\t\t}\n\t}",
"function readAlliNotice($aid) {\n\t list($aid) = $this->escape_input((int) $aid);\n\n\t\t$q = \"SELECT * from \" . TB_PREFIX . \"ali_log where aid = $aid ORDER BY date DESC\";\n\t\t$result = mysqli_query($this->dblink,$q);\n\t\treturn $this->mysqli_fetch_all($result);\n\t}",
"public function s_slip_info($s_id) {\n $query = $this->db->query(\"SELECT total FROM slip WHERE id=$s_id\");\n foreach ($query->result_array() as $row) {\n $data = $row['total'];\n }return $data;\n }",
"public function attributesToHideForAudit(): array\n {\n // Use this method to hide attributes from Audit Trail entry\n return $this->auditTimestampAttributes();\n }",
"function GetLoanStatus($MySSN, $Link)\n{\n\t$Host=\"localhost\";\n\t//$User=\"lightnin_Tony\";\n\t//$Password=\"ipowerwe\";\n\t$DBname=\"lightnin_LoanApps\";\n\t$TableName=\"ApplicantInfo\";\n\n\t$TempField = ereg_replace(\"[^[:digit:]]\", \"\", $MySSN);\n\n\t$Query = \"SELECT LoanStatus from $TableName where SSN = $TempField\";\n\t/*print (\"In GetLoanStatus () Query is $Query<br>\\n\");*/\n\n\t$Result=mysql_db_query($DBname, $Query, $Link); // look for the match\n\n\n\tif (!mysql_query ($Query, $Link)) // check the results of the query\n\t{\n\t\tprint (\"Error-->Link |$Link|<br>\\n\");\n\n\t\tprint (\"<br><center><font face='Verdana' size='5' color='#000099'><strong>Warning!</strong></font><br><br>\");\n\t\tprint (\"<font face='Verdana' size='2' color='#000099'>Applicant Not Found.<br><br>\\n\");\n\t\tprint (\"Social Security Number<font face='Verdana' size='3' color='#000099'>'$MySSN' </font>\");\n\t\tprint (\"<font face='Verdana' size='2' color='#000099'>was the passed Social Security Number.</font><br>\\n\");\n\n\t\techo mysql_errno() . \": \" . mysql_error(). \"\\n\";\n\t\tmysql_close($Link);\n\t\tdie (\"Error in GetLoanStatus()\");\n\t}\n\n\t$Record=mysql_fetch_array($Result);\t// fetch the matching row in the ApplicantInfo table\n\n\tif (empty($Record[LoanStatus]))\n\t{\n\t\t$Name= \"Not Found!\";\n\t}\n\telse\n\t{\n\t\t$Name=$Record[LoanStatus];\n\t}\n\n\treturn ($Name);\n}",
"function sms_survey_getoutlogs($link_id) {\n\t$ret = array();\n\t$db_query = \"SELECT * FROM \"._DB_PREF_.\"_featureSurvey_log WHERE link_id='$link_id' AND incoming='0' ORDER BY id\";\n\t$db_result = dba_query($db_query);\n\t$i = 0;\n\twhile ($db_row = dba_fetch_array($db_result)) {\n\t\t$ret[$i] = $db_row;\n\t\t$i++;\n\t}\n\treturn $ret;\n}",
"public function index()\n {\n return view('audits.general-audit');\n }",
"public function get_average_salary_internal()\n { \n echo $this->get_average_salary('internals'); \n }",
"function getLoanInfo($loanId)\n {\n global $Kiva;\n $loanInfo = array();\n \n try\n {\n $loanInfo = $Kiva->getLoanInfo($loanId);\n }\n catch (Exception $e)\n {\n echo __FUNCTION__ . ' failed. ' . $e->getMessage();\n }\n \n return $loanInfo;\n }",
"function ambilauditinternal(){\n return $this->db->query(\"SELECT * FROM halaman_statis where id_halstatis = '23'\");\n }",
"public function getAnyWarnings() { \n $warningsString = '';\n $txnId = $this->paypalIPNDataValue['txn_id'];\n $paypalReceiptsRecords = SSFDB::getDB()->getArrayFromQuery('SELECT txnId from paypalReceipts where txnId = \"' . $txnId . '\"');\n $paymentInPaypalReceiptsTable = (count($paypalReceiptsRecords) == 1);\n $payPalWorksRecords = SSFDB::getDB()->getArrayFromQuery('SELECT checkOrPaypalNumber from works where checkOrPaypalNumber = \"' . $txnId . '\"');\n $paymentAlreadyAppliedInWorksTable = (count($payPalWorksRecords) == 1);\n $paymentAlreadyApplied = $paymentInPaypalReceiptsTable || $paymentAlreadyAppliedInWorksTable;\n if ($paymentAlreadyAppliedInWorksTable) {\n $paypalAmtPaid = $this->paypalIPNDataValue['payment_gross'];\n $dbAmtPaid = $this->dbWorkDataValue['amtPaid'];\n if ($dbAmtPaid != $paypalAmtPaid) {\n $warningsString .= \"** Amount Paid does not match. \" . $paypalAmtPaid . \" from IPN replaced \" . $dbAmtPaid . \" from the works table. \"; // . PHP_EOL;\n }\n $paypalHowPaid = $this->dbWorkDataValue['howPaid'];\n if ($paypalHowPaid != 'paypal') {\n $warningsString .= '** Payment method does not match: \"paypal\" replaced the current payment method, \"' . $paypalHowPaid . '.\" '; // . PHP_EOL;\n }\n $dbDatePaid = $this->dbWorkDataValue['datePaid'];\n $dp = new DateTime($this->paypalIPNDataValue['payment_date']);\n $paypalDatePaid = $dp->format('Y-m-d');\n if ($dbDatePaid != $paypalDatePaid) {\n $warningsString .= '** Date paid does not match: the IPN payment date, ' . $paypalDatePaid . ', replaced the existing payment date, ' . $dbDatePaid . '. '; // . PHP_EOL;\n }\n }\n// SSFDebug::globalDebugger()->belch('bbb. warningsString', $warningsString, 1);\n return $warningsString;\n }",
"public function getAllAttacksbyDateForAccessLog($date,$case_no){\r\n\t\t$is_valid = $this->isValidateDate($date,'Y-m-d');\r\n\t\tif(!$is_valid){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$start_date_time = date('Y-m-d H:i:s', strtotime($date.' 00:00:00'));\r\n\t\t$end_date_time = date('Y-m-d H:i:s', strtotime($date.' 24:00:00'));\r\n\r\n\t\t$conn = connect_pdo();\r\n\t\t$log_datas = $conn->prepare(\"SELECT * FROM `log_access` WHERE `case_no` = :case_no AND `date_time` BETWEEN :start_date_time AND :end_date_time ORDER BY `date_time`\");\r\n\t\t\r\n\t\t$log_datas->bindParam(':case_no', $case_no);\r\n\t\t$log_datas->bindParam(':start_date_time', $start_date_time);\r\n\t\t$log_datas->bindParam(':end_date_time', $end_date_time);\r\n\t\t$log_datas->execute();\r\n\t\t//Check if any row was attacked\r\n\t\t$result = array();\r\n\t\t$manual_injection = fetchAttackTags(\"mansqli\");\r\n\t\t$auto_injection = fetchAttackTags(\"autosqli\");\r\n\t\t$default_shell = fetchAttackTags(\"backdoor\");\r\n\t\t$xss = fetchAttackTags(\"xss\");\r\n\t\twhile($scans = $log_datas->fetch(PDO::FETCH_ASSOC)) {\r\n\t\t\t\r\n\t\t if(check_matches($scans['link_ref'], $manual_injection)) { \r\n\t \t \t$scans['attack_type'] = 'MANUAL_SQL_INJECTION';\r\n\t \t \t$scans['attack_description'] = 'Manual SQL injection on Referrer URL';\r\n\t\t \t$result[] = $scans;\r\n\t\t }\r\n\t\t\r\n\t\t if(check_matches($scans['link_ref'], $auto_injection)) { \r\n\t\t \t$scans['attack_type'] = 'AUTO_SQL_INJECTION';\r\n\t \t \t$scans['attack_description'] = 'Auto SQL injection on Referrer URL';\r\n\t\t \t$result[] = $scans;\r\n\t\t }\r\n\t\t\r\n\t\t if(check_matches($scans['http_header'], $manual_injection)) { \r\n\t\t \t$scans['attack_type'] = 'MANUAL_SQL_INJECTION';\r\n\t \t \t$scans['attack_description'] = 'Manual SQL injection on header';\r\n\t\t \t$result[] = $scans;\r\n\t\t }\r\n\t\t\r\n\t\t if(check_matches($scans['http_header'], $auto_injection)) { \r\n\t\t \t$scans['attack_type'] = 'AUTO_SQL_INJECTION';\r\n\t \t \t$scans['attack_description'] = 'Auto SQL injection on header';\r\n\t\t \t$result[] = $scans;\r\n\t\t }\r\n\t\t\r\n\t\t if(check_matches($scans['link_ref'], $default_shell)) { \r\n\t\t \t$scans['attack_type'] = 'DEFAULT_SHELL';\r\n\t \t \t$scans['attack_description'] = 'Default shell on Referrer URL';\r\n\t\t \t$result[] = $scans;\r\n\t\t }\r\n\t\t\r\n\t\t if(check_matches($scans['link_ref'], $xss)) {\r\n\t\t \t$scans['attack_type'] = 'XSS_DET';\r\n\t \t \t$scans['attack_description'] = 'XSS attack on Referrer URL'; \r\n\t\t \t$result[] = $scans;\r\n\t\t }\r\n\t\t\r\n\t\t if(check_matches($scans['http_header'], $xss)) { \r\n\t\t \t$scans['attack_type'] = 'XSS_DET';\r\n\t \t \t$scans['attack_description'] = 'XSS attack on header';\r\n\t\t \t$result[] = $scans;\r\n\t\t }\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\treturn $result;\r\n\r\n\t}",
"public function getNews() {\n $result= $this->db->row('SELECT login, sumin, sumout\n FROM tariffs INNER JOIN accounts \n\t ON tariffs.uid = accounts.id ORDER BY tariffs.unixTimeStart DESC');\n return $result;\n }",
"public function getSalesDetails() {\n return $this->getParameter('sales_details');\n }",
"public function school_that_complete_audit_phase_2()\n\t{\n\t\t$this->db->where(\"a.make_school_disabled\",\"1\");\n\t\t//$this->db->where('a.date_added >=', '2019-11-12 00:00:00');\n\t\treturn $this->db->select('a.*, b.name AS state_name,c.name As district_name')\n\t\t\t\t\t->from('gsp_school AS a')\n\t\t\t\t\t->join('states AS b', 'a.state=b.id', 'left')\n\t\t\t\t\t->join('cities AS c', 'a.district=c.id', 'left')\n\t\t\t\t\t->where('a.complete_status','0')\n ->where('a.progress',100)\n\t\t\t\t\t->get()->result();\n\t\t\n\t\t\n\t}",
"public function getArspltdsale()\n {\n return $this->arspltdsale;\n }",
"public function getDisability($selAll = false) {\n\t\t\tif (!$selAll) {\n\t\t\t\t$SQL = \"\n\t\t SELECT state.dccode as code,\n\t\t state.dcdesc as disability,\n\t\t CASE sdtype\n\t\t WHEN 1 THEN 'Primary'\n\t\t WHEN 2 THEN 'Secondary'\n\t\t WHEN 3 THEN 'Other'\n\t\t END as type\n\t\t FROM webset.std_disabilitymst std\n\t\t INNER JOIN webset.statedef_disablingcondition state ON std.dcrefid = state.dcrefid\n\t\t WHERE stdrefid = \" . $this->tsrefid . \"\n\t\t ORDER BY sdtype, state.dccode\n\t \";\n\t\t\t} else {\n\t\t\t\t$SQL = \"\n\t\t SELECT state.dccode as code,\n\t\t state.dcdesc as disability,\n\t\t CASE sdtype\n\t\t WHEN 1 THEN 'Primary'\n\t\t WHEN 2 THEN 'Secondary'\n\t\t WHEN 3 THEN 'Other'\n\t\t END as type,\n\t\t std.dcrefid\n\t\t FROM webset.statedef_disablingcondition state\n\t\t LEFT JOIN webset.std_disabilitymst std ON (std.dcrefid = state.dcrefid AND stdrefid = \" . $this->tsrefid . \")\n\t WHERE screfid = \" . VNDState::factory()->id . \"\n\t\t\t\t\t AND (recdeactivationdt IS NULL or now()< recdeactivationdt)\n\t\t ORDER BY dccode\n\t \";\n\t\t\t}\n\n\t\t\treturn $this->execSQL($SQL)->assocAll();\n\t\t}",
"protected function payout_details( string $payout_id ) {\n try {\n $client = new \\GuzzleHttp\\Client;\n \n $headers = array();\n $headers[] = 'Content-Type: application/json';\n $headers[] = 'Authorization: Bearer ' . $this->get_access_token();\n\n $response = $client->request( 'GET', 'https://api.sandbox.paypal.com/v1/payments/payouts/' . $payout_id, array(\n 'auth' => array( $this->get_client_id(), $this->get_secret() ),\n 'headers' => $headers,\n 'verify' => false\n ) );\n\n $result = (string) $response->getBody();\n\n return $result;\n }catch( Exception $e ) {\n $response = json_decode( (string) $e->getResponse()->getBody() );\n\n throw new Exception( sprintf( '<strong>%s</strong> - %s', $response->name, $response->message ) );\n }\n }"
] | [
"0.5659475",
"0.5426723",
"0.4998067",
"0.494168",
"0.49236134",
"0.49203408",
"0.484631",
"0.48351657",
"0.48256662",
"0.47755724",
"0.4759649",
"0.47027248",
"0.46829632",
"0.46203846",
"0.45761523",
"0.4571981",
"0.44834262",
"0.4481716",
"0.4474968",
"0.44721168",
"0.44651875",
"0.44614914",
"0.44511375",
"0.44454613",
"0.44246113",
"0.44175914",
"0.44110432",
"0.43973556",
"0.43764594",
"0.43680593"
] | 0.7285923 | 0 |
Gets the all of do not loan audit flags for a ssn. | public function getDoNotLoanFlagAllQuery($ssn) {
$query = 'SELECT dl.ssn AS ssn,
ct.name AS category,
dl.company_id AS company_id,
dl.other_reason AS other_reason,
dl.explanation AS explanation,
dl.agent_id AS modifying_agent_id,
if(dl.active_status = "inactive",false,true) AS active_status,
dl.active_status AS active_status_new,
dl.date_created AS date_created,
dl.date_modified AS date_modified
FROM do_not_loan_flag AS dl
JOIN do_not_loan_flag_category AS ct USING (category_id)
WHERE dl.ssn = '.$ssn.'
ORDER BY dl.date_modified;';
$result = $this->db->query($query);
return($result->fetchAll(DB_IStatement_1::FETCH_OBJ));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDoNotLoanFlagQuery($ssn) {\n\t\t$query = 'SELECT dl.ssn AS ssn,\n\t\t\t\tct.name AS category,\n\t\t\t\tdl.company_id AS company_id,\n\t\t\t\tdl.other_reason AS other_reason,\n\t\t\t\tdl.explanation AS explanation,\n\t\t\t\tdl.agent_id AS modifying_agent_id,\n\t\t\t\tif(dl.active_status = \"inactive\",false,true) AS active_status,\n\t\t\t\tdl.active_status AS active_status_new,\n\t\t\t\tdl.date_created AS date_created,\n\t\t\t\tdl.date_modified AS date_modified\n\t\t\tFROM do_not_loan_flag AS dl \n\t\t\t\tJOIN do_not_loan_flag_category AS ct USING (category_id)\n\t\t\tWHERE dl.ssn = '.$ssn.'\n\t\t\tORDER BY dl.date_modified;';\n\t\t$result = $this->db->query($query);\n\t\t$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($rows);\n\t}",
"public function getDoNotLoanAuditQuery($ssn) {\n\t\t$query = 'SELECT dl.ssn AS ssn,\n\t\t\t\tdl.company_id AS company_id,\n\t\t\t\tdl.value_before AS old_value,\n\t\t\t\tdl.value_after AS new_value,\n\t\t\t\tdl.table_name AS table_name,\n\t\t\t\tdl.agent_id AS modifying_agent_id,\n\t\t\t\tdl.date_created AS date_created\n\t\t\tFROM do_not_loan_audit AS dl\n\t\t\tWHERE dl.ssn = '.$ssn.'\n\t\t\tORDER BY dl.date_created;';\n\n\t\t$result = $this->db->query($query);\n\t\treturn($result->fetchAll(DB_IStatement_1::FETCH_OBJ));\n\t}",
"public static function flags() {\n\t\t $obj = new CMS_Record_Flag;\n\t\t return $obj->fetch(array(\"table\" => static::$table));\n\t}",
"public function getFlags();",
"public function getFlags();",
"private function GetFlags($flags) {\n $flag = array();\n $flag[\"unread\"] = 0;\n $flag[\"read\"] = 1;\n $flag[\"priority\"] = 1;\n $flag[\"external\"] = 0;\n $flag[\"flagged\"] = 0;\n $flag[\"replied\"] = 0;\n $flag[\"forwarded\"] = 0;\n $flag[\"flagRepFwd\"] = \"nnn\";\n\n $strlen = strlen($flags);\n for ($i=0;$i<$strlen;$i++) {\n $char = substr(strtolower($flags),$i,1);\n switch ($char) {\n case 'f': \n $flag[\"flagged\"] = 1; $flag[\"flagRepFwd\"][0] = \"F\"; break;\n case 'r':\n $flag[\"replied\"] = 1; $flag[\"flagRepFwd\"][1] = \"R\"; break;\n case 'w':\n $flag[\"forwarded\"] = 1; $flag[\"flagRepFwd\"][2] = \"W\"; break;\n case 'u':\n $flag[\"unread\"] = 1; \n $flag[\"read\"] = 0; \n\t\t\t\t\tbreak;\n case '!':\n $flag[\"priority\"] = 2; break;\n case '?':\n $flag[\"priority\"] = 0; break;\n case 'y':\n $flag[\"external\"] = 1;\n }\n }\n return $flag;\n }",
"public function attributesToHideForAudit(): array\n {\n // Use this method to hide attributes from Audit Trail entry\n return $this->auditTimestampAttributes();\n }",
"private function _sieve_list_of_flags(&$flags) {\n return '[\"' . implode('\", \"', array_keys($flags)). '\"] ';\n }",
"public function getStatusFlags()\n {\n // Initialise:\n \n $flags = [];\n \n // Is Extended Object Versioned?\n \n if ($this->owner->hasExtension(Versioned::class)) {\n \n if ($this->owner->isOnLiveOnly()) {\n \n // Extended Object Removed from Draft:\n \n $flags['removedfromdraft'] = array(\n 'text' => _t(__CLASS__ . '.ONLIVEONLYSHORT', 'On live only'),\n 'title' => _t(__CLASS__ . '.ONLIVEONLYSHORTHELP', 'Record is live, but removed from draft'),\n );\n \n } elseif ($this->owner->isArchived()) {\n \n // Extended Object Archived:\n \n $flags['archived'] = [\n 'text' => _t(__CLASS__ . '.ARCHIVEDSHORT', 'Archived'),\n 'title' => _t(__CLASS__ . '.ARCHIVEDHELP', 'Record is removed from draft and live')\n ];\n \n } elseif ($this->owner->isOnDraftOnly()) {\n \n // Extended Object Added to Draft:\n \n $flags['addedtodraft'] = [\n 'text' => _t(__CLASS__ . '.ADDEDTODRAFTSHORT', 'Draft'),\n 'title' => _t(__CLASS__ . '.ADDEDTODRAFTHELP', 'Record has not been published yet')\n ];\n \n } elseif ($this->owner->isModifiedOnDraft()) {\n \n // Extended Object Modified on Draft:\n \n $flags['modified'] = [\n 'text' => _t(__CLASS__ . '.MODIFIEDONDRAFTSHORT', 'Modified'),\n 'title' => _t(__CLASS__ . '.MODIFIEDONDRAFTHELP', 'Record has unpublished changes')\n ];\n \n }\n \n }\n \n // Apply Extensions:\n \n $this->owner->extend('updateStatusFlags', $flags);\n \n // Answer Flags:\n \n return $flags;\n }",
"public function getFlags(): array;",
"function get_notification_states(){\n\t\treturn array(\n\t\t\t'read' => 'Read',\n\t\t\t'unread' => 'Unread',\n\t\t);\n\t}",
"public function listForbiddenStates(): array;",
"public static function getHookFlags(): int\n {\n }",
"public function getDisability($selAll = false) {\n\t\t\tif (!$selAll) {\n\t\t\t\t$SQL = \"\n\t\t SELECT state.dccode as code,\n\t\t state.dcdesc as disability,\n\t\t CASE sdtype\n\t\t WHEN 1 THEN 'Primary'\n\t\t WHEN 2 THEN 'Secondary'\n\t\t WHEN 3 THEN 'Other'\n\t\t END as type\n\t\t FROM webset.std_disabilitymst std\n\t\t INNER JOIN webset.statedef_disablingcondition state ON std.dcrefid = state.dcrefid\n\t\t WHERE stdrefid = \" . $this->tsrefid . \"\n\t\t ORDER BY sdtype, state.dccode\n\t \";\n\t\t\t} else {\n\t\t\t\t$SQL = \"\n\t\t SELECT state.dccode as code,\n\t\t state.dcdesc as disability,\n\t\t CASE sdtype\n\t\t WHEN 1 THEN 'Primary'\n\t\t WHEN 2 THEN 'Secondary'\n\t\t WHEN 3 THEN 'Other'\n\t\t END as type,\n\t\t std.dcrefid\n\t\t FROM webset.statedef_disablingcondition state\n\t\t LEFT JOIN webset.std_disabilitymst std ON (std.dcrefid = state.dcrefid AND stdrefid = \" . $this->tsrefid . \")\n\t WHERE screfid = \" . VNDState::factory()->id . \"\n\t\t\t\t\t AND (recdeactivationdt IS NULL or now()< recdeactivationdt)\n\t\t ORDER BY dccode\n\t \";\n\t\t\t}\n\n\t\t\treturn $this->execSQL($SQL)->assocAll();\n\t\t}",
"public function getHiddenForAudit(): array\n {\n if (!isset($this->hiddenInAuditTrail)) {\n $this->makeHiddenForAudit(\n $this->attributesToHideForAudit()\n );\n }\n\n return $this->hiddenInAuditTrail;\n }",
"protected function _getAll()\n\t{\n\t\treturn $this->call(\"ticket.severity.getAll\");\n\t}",
"public function getFstatFlags()\n {\n $flags = array();\n \n $filter = $this->getFilter();\n $filter = is_null($filter) ? '' : $filter->getExpression();\n\n // if start row set, apply rowNumber filter.\n if ($this->getStartRow()) {\n $filter = $filter ? '(' . $filter . ') & ' : '';\n $filter = $filter . 'rowNumber > ' . $this->getStartRow();\n }\n\n // filter option.\n if ($filter) {\n $flags[] = '-F';\n $flags[] = $filter;\n }\n\n // subset of fields option.\n if (count($this->getLimitFields())) {\n $flags[] = '-T';\n $flags[] = implode(' ', $this->getLimitFields());\n }\n\n // maximum results option.\n if ($this->getMaxFiles() !== null) {\n $flags[] = '-m';\n $flags[] = $this->getMaxFiles();\n }\n\n // files in change option.\n if ($this->getLimitToChangelist() !== null) {\n $flags[] = '-e';\n $flags[] = $this->getLimitToChangelist();\n\n // for the default change, we want to fetch opened files\n if ($this->getLimitToChangelist() === P4_Change::DEFAULT_CHANGE) {\n $this->setLimitToOpened(true);\n }\n }\n\n // only opened files option.\n if ($this->getLimitToOpened()) {\n $flags[] = '-Ro';\n }\n\n // only files that need resolve option.\n if ($this->getLimitToNeedsResolve()) {\n $flags[] = \"-Ru\";\n }\n\n // sort options.\n if ($this->getSortBy() !== null) {\n $handled = false;\n $clauses = $this->getSortBy();\n if (count($clauses) == 1) {\n list ($field, $options) = each($clauses);\n if ($this->_isInternalSortField($field) && !isset($options)) {\n $handled = true;\n switch ($field) {\n case static::SORT_DATE:\n $flags[] = '-Sd';\n break;\n case static::SORT_HEAD_REV:\n $flags[] = '-Sr';\n break;\n case static::SORT_HAVE_REV:\n $flags[] = '-Sh';\n break;\n case static::SORT_FILE_TYPE:\n $flags[] = '-St';\n break;\n case static::SORT_FILE_SIZE:\n $flags[] = '-Ss';\n break;\n }\n }\n }\n\n if (!$handled) {\n $expressions = array();\n foreach ($clauses as $field => $options) {\n if (strpos($field, '#') !== false) {\n $field = preg_replace('/#/', '', $field);\n } else {\n $field = \"attr-$field\";\n }\n if (!isset($options)) {\n $options = array(static::SORT_ASCENDING);\n }\n $expressions[] = \"$field=\". join('', $options);\n }\n $flags[] = '-S';\n $flags[] = join(',', $expressions);\n }\n\n }\n\n // reverse sort option.\n if ($this->getReverseOrder()) {\n $flags[] = '-r';\n }\n\n // standard options.\n $flags[] = '-Oal';\n\n return $flags;\n }",
"public function getSystemFlags()\n {\n return $this->getFirstAttribute($this->schema->systemFlags());\n }",
"public function getMsgFlags()\n {\n return array();\n }",
"public function getFlags()\n {\n return $this->flags;\n }",
"public function getFlags()\n {\n return $this->flags;\n }",
"public function getFlags()\n {\n return $this->flags;\n }",
"public function getFlags()\n {\n return $this->flags;\n }",
"public function getFlags()\n {\n return $this->flags;\n }",
"public function getFlags()\n {\n return $this->flags;\n }",
"public function getFlaggings() {\n return $this->flaggings;\n }",
"function _auditfiles_used_not_managed_get_file_list() {\n // Get all the file IDs in the file_usage table that are not in the\n // file_managed table.\n $connection = Database::getConnection();\n $config = \\Drupal::config('auditfiles_config.settings');\n $query = 'SELECT DISTINCT fid FROM {file_usage} fu WHERE fid NOT IN (SELECT fid FROM {file_managed})';\n $maximum_records = $config->get('auditfiles_report_options_maximum_records') ? $config->get('auditfiles_report_options_maximum_records') : 250;\n if ($maximum_records > 0) {\n $query .= ' LIMIT ' . $maximum_records;\n }\n return $connection->query($query)->fetchCol();\n }",
"public function getAllEmergencyForSecurity();",
"public function getGlobalFlags()\n {\n $this->reader->seek($this->offset + 10);\n\n return $this->readLong() & self::MASK;\n }",
"public static function getAllDismissedNotifications() {\n\t\treturn array_values( json_decode( wp_json_encode( self::getDismissedNotifications() ), true ) );\n\t}"
] | [
"0.64064145",
"0.6138323",
"0.54727465",
"0.53011996",
"0.53011996",
"0.51867026",
"0.51129854",
"0.51049846",
"0.50020236",
"0.49781638",
"0.49651146",
"0.49165106",
"0.49002492",
"0.4884256",
"0.4856051",
"0.4829859",
"0.48007485",
"0.47909775",
"0.47799155",
"0.47397918",
"0.47397918",
"0.47397918",
"0.47397918",
"0.47397918",
"0.47397918",
"0.4739014",
"0.4689553",
"0.4687932",
"0.46665308",
"0.46617556"
] | 0.66824883 | 0 |
Inserts campaign information into the table. | public function insertCampaignQuery($app){
$date = date("Y-m-d G:i:s");
$campaign_info = $app->campaign_info;
$query = 'INSERT INTO campaign_info (
date_created,
date_modified,
campaign_name,
application_id,
promo_id,
promo_sub_code,
site_id,
reservation_id
) VALUES (
"'.$date.'",
"'.$date.'",
"'.$campaign_info->campaign_name.'",
'.$app->application_id.',
"'.$campaign_info->promo_id.'",
"'.$campaign_info->promo_sub_code.'",
'.$app->site_id.',
"'.$campaign_info->reservation_id.'"
);';
$result = $this->db->query($query);
return($this->db->lastInsertId());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function run()\n\t{\n\t\t\\DB::table('campaigns')->truncate();\n \n\t\t\\DB::table('campaigns')->insert(array (\n\t\t\t0 => \n\t\t\tarray (\n\t\t\t\t'id' => '1',\n\t\t\t\t'dealer_id' => '1',\n\t\t\t\t'name' => '5k Campaign',\n\t\t\t\t'added_by_id' => '1',\n\t\t\t\t'active' => '1',\n\t\t\t\t'created_at' => '2014-07-18 05:54:56',\n\t\t\t\t'updated_at' => '2014-07-18 05:54:56',\n\t\t\t),\n\t\t\t1 => \n\t\t\tarray (\n\t\t\t\t'id' => '2',\n\t\t\t\t'dealer_id' => '1',\n\t\t\t\t'name' => '10k Campaign',\n\t\t\t\t'added_by_id' => '1',\n\t\t\t\t'active' => '1',\n\t\t\t\t'created_at' => '2014-07-18 05:54:56',\n\t\t\t\t'updated_at' => '2014-07-19 05:23:28',\n\t\t\t),\n\t\t\t2 => \n\t\t\tarray (\n\t\t\t\t'id' => '3',\n\t\t\t\t'dealer_id' => '1',\n\t\t\t\t'name' => '20k Campaign',\n\t\t\t\t'added_by_id' => '1',\n\t\t\t\t'active' => '1',\n\t\t\t\t'created_at' => '2014-07-18 05:54:56',\n\t\t\t\t'updated_at' => '2014-07-19 05:23:18',\n\t\t\t),\n\t\t));\n\t}",
"private function insert_new()\n {\n global $wpdb;\n /* Row */\n $data = array(\n 'id' => $this->id,\n 'settings' => serialize($this->settings),\n 'ad_definition' => serialize($this->ad_definition)\n );\n /* Format */\n $format = array(\n '%d',\n '%s',\n '%s'\n );\n /* Insert the row */\n $result = $wpdb->insert(wp_adpress_campaigns::campaigns_table(), $data, $format);\n\n /* Set the Class state */\n if ($result !== false) {\n // TODO: Remove ambiguity of state with a new property for saving\n $this->state = 'set';\n }\n return $result;\n }",
"public function insert() {\r\n $dbConnection = dbConnect();\r\n \r\n $name = $_POST['name'];\r\n $addr1 = $_POST['addr1'];\r\n $addr2 = $_POST['addr2'];\r\n $addr3 = $_POST['addr3'];\r\n $addr4 = $_POST['addr4'];\r\n $postcode = $_POST['postcode'];\r\n $email = $_POST['email'];\r\n $stylesheet = $_POST['stylesheet'];\r\n $bannerstyle = addslashes($_POST['bannerstyle']);\r\n $bannercontent = addslashes($_POST['bannercontent']);\r\n $bannerimage = addslashes($_POST['bannerimage']);\r\n $menustyle = addslashes($_POST['menustyle']);\r\n $bodystyle = addslashes($_POST['bodystyle']);\r\n\r\n $sql = \"INSERT INTO customers \"\r\n . \"(name, addr1, addr2, addr3, addr4, postcode, email\" \r\n . \"stylesheet, bannerstyle, bannercontent, bannerimage) \"\r\n . \"menustyle, bodystyle \"\r\n . \"VALUES ('$name', '$addr1', '$addr2','$addr3','$addr4', \"\r\n .\"'$postcode', '$email', '$stylesheet', '$bannerstyle', \"\r\n . \"'$bannercontent' '$bannerimage', $menustyle, $bodystyle)\";\r\n\r\n\t$dbConnection->query($sql)\r\n or die(\"Failed to insert record : \" . $dbConnection->error);\r\n }",
"private function insert_new()\n {\n global $wpdb;\n //TODO: check that the data is valid\n /* Ad data */\n $data = array(\n 'id' => $this->id,\n 'campaign_id' => $this->campaign_id,\n 'ad_settings' => serialize($this->param),\n 'status' => $this->status,\n 'ad_stats' => serialize($this->stats),\n 'user_id' => $this->user_id,\n 'time' => $this->time\n );\n\n /* Columns Format */\n $format = array(\n '%d',\n '%d',\n '%s',\n '%s',\n '%s',\n '%d',\n '%s'\n );\n\n $result = $wpdb->insert(wp_adpress_ads::ads_table(), $data, $format);\n\n /* Set the Class state */\n if ($result !== false) {\n $this->state = 'set';\n }\n return $result;\n }",
"public function insert()\n {\n $this->_cleanFields();\n \n parent::insert();\n }",
"private function insert() {\n // use prepared statements\n // save an insert id\n }",
"function new_campaign(){\n\t\t\n\t\tif($_POST){\n\t\t\t$site = Site::find( $_REQUEST['site_id'] );\n\t\t\tif($site){\n\t\t\t\t$camp = new Campaign(array(\n\t\t\t\t\t'name'\t\t\t=>\t$_REQUEST['name'],\n\t\t\t\t\t'description'\t=>\t$_REQUEST['description'],\n\t\t\t\t\t'site_id'\t\t=>\t$site->id\n\t\t\t\t));\n\t\t\t\t$camp->save();\n\t\t\t}\n\t\t}\n\n\t\t$sites = Site::find('all');\n\t\t$this->view->sites = $sites;\n\t\t\n\t\t\n\t}",
"public function processInsert() {\r\n\t\t$columnValues = $this->getPostedColumnValues();\r\n\t\t$this->model->insert($this->table, $columnValues);\r\n\t}",
"public function save()\n {\n if ($this->state === 'unset') {\n // Insert the new Campaign to Database\n $this->insert_new();\n // Build Empty Ad Units\n $this->buildAdUnits();\n } else {\n $this->update_db();\n // Remove Old Ad Units\n $this->destroyAdUnits();\n // Rebuild the Ad Units\n $this->buildAdUnits();\n }\n }",
"function insert_data() {\r\n insert_field_data();\r\n insert_record_data();\r\n insert_group_data();\r\n}",
"function createCampaign() {\n\t\tif (empty ( $this->_campaign_id )) {\n\n\t\t\t$wrap = new CS_REST_Campaigns ( NULL, $this->_api_key );\n\t\t\t$result = $wrap->create ( $this->getClientId (), array (\n\t\t\t\t\t'Subject' => $this->_params ['subject'],\n\t\t\t\t\t'Name' => $this->_params ['name'] . ' ' . date ( 'Y-m-d h:i s' ),\n\t\t\t\t\t'FromName' => $this->_params ['fromName'],\n\t\t\t\t\t'FromEmail' => $this->_params ['fromEmail'],\n\t\t\t\t\t'ReplyTo' => $this->getReplyToEmail (),\n\t\t\t\t\t'HtmlUrl' => $this->_template_path,\n\t\t\t\t\t'TextUrl' => $this->_template_path,\n\t\t\t\t\t'ListIDs' => array (\n\t\t\t\t\t\t\t$this->_listId\n\t\t\t\t\t)\n\t\t\t// 'SegmentIDs' => array('9a0ab5aeda4e73e2b87ce153a1e5d90f')\n\t\t\t\t\t\t) );\n\n\t\t\tif ($result->was_successful ()) {\n\t\t\t\t$this->_campaign_id = $result->response;\n\t\t\t} else {\n\t\t\t\techo 'Failed with code ' . $result->http_status_code . \"\\n<br />\";\n\t\t\t\t/*\n\t\t\t\t * \"<pre>\"; var_dump ( $result->response ); echo '</pre>';\n\t\t\t\t */\n\t\t\t}\n\t\t}\n\t}",
"public function insert()\n\t\t{\n\t\t\t$this->save();\n\t\t}",
"protected function create()\r\n\t{\r\n\t\tglobal $wpdb;\r\n\t\t\r\n\t\t$this->assert_not_trashed();\r\n\t\t\r\n\t\t// TODO: Support arbitrary data\r\n\t\t\r\n\t\t$column_names = array_flip( $this->get_column_names() );\r\n\t\tunset($column_names['id']);\r\n\t\t$column_names\t= implode(',', array_keys($column_names));\r\n\t\t\r\n\t\t$placeholders\t= implode(',', $this->get_column_placeholders());\r\n\t\t$parameters\t\t= $this->get_column_parameters();\r\n\t\t\r\n\t\t$qstr = \"INSERT INTO `{$this->table_name}` ($column_names) VALUES ($placeholders)\";\r\n\t\t$stmt = $wpdb->prepare($qstr, $parameters);\r\n\t\t$wpdb->query($stmt);\r\n\t\t\r\n\t\t$this->id = $wpdb->insert_id;\r\n\t}",
"public function new_campaign() {\n $this->CI->form_validation->set_rules('campaign', 'Campaign', 'trim|required');\n $this->CI->form_validation->set_rules('description', 'Description', 'trim');\n if ($this->CI->form_validation->run()) {\n $c = $this->CI->input->post('campaign');\n $d = $this->CI->input->post('description');\n $this->CI->ecl('Campaign')->create($c,$d);\n }\n else {\n display_mess(18);\n }\n }",
"private function update_db()\n {\n global $wpdb;\n\n /* Row */\n $data = array(\n 'settings' => serialize($this->settings),\n 'ad_definition' => serialize($this->ad_definition)\n );\n\n /* Row */\n $row = array('id' => $this->id);\n\n /* Format */\n $format = array(\n '%s',\n '%s'\n );\n /* Insert the row */\n $result = $wpdb->update(wp_adpress_campaigns::campaigns_table(), $data, $row, $format);\n return $result;\n }",
"public function Insert(){\n $pdo = Conecta::getPdo();\n //Cria o sql passa os parametros e etc\n $sql = \"INSERT INTO $this->table (idcpf, email, senha, idsituacao, created, updated) VALUES \"\n . \" (?,?,?,?,?,NULL)\";\n $consulta = $pdo->prepare($sql);\n $consulta ->bindValue(1, $this->getIdCpf() );\n $consulta ->bindValue(2, $this->getEmail() );\n $consulta ->bindValue(3, $this->getSenha() );\n $consulta ->bindValue(4, $this->getIdsituacao() );\n $consulta ->bindValue(5, $this->created );\n $consulta ->execute();\n $last = $pdo->lastInsertId();\n }",
"function InsertProduct($title, $published, $cat1, $cat2, $image, $specs, $sku, $price, $colors)\n //inserts this campaign object into the DB as a new row\n{\n $created = date('Y-m-d h:i:s');\n\n try{\n\n require 'connect.php';\n\n $data = array('id' => NULL, 'title' => $title, 'published' => $published, 'cat1' => $cat1, 'cat2' => $cat2, 'image' => $image, 'specs' => $specs, 'sku' => $sku, 'price' => $price, 'colors' => $colors, 'created' => $created);\n $STH = $DBH->prepare(\"INSERT INTO products (id, title, published, cat1, cat2, image, specs, sku, price, colors, created) value (:id, :title, :published, :cat1, :cat2, :image, :specs, :sku, :price, :colors, :created)\");\n $STH->execute($data);\n\n //$this->id = $DBH->lastInsertId();\n }\n catch(PDOException $e) {\n echo $e->getMessage();\n }\n\n\n}",
"private function insertInfo() {\n\t\t$stmt = Database::$conn->prepare($this->query_info);\n\n\t\t$stmt->bindParam(':tournament_id', $this->data['tournament_id']);\n\t\t// date is format yymmdd_hhmmss\n\t\t$stmt->bindParam(':date', date('ymdHis'));\n\n\t\tif ($stmt->execute()) {\n\t\t\t$this->id_of_result = Database::$conn->lastInsertId();\n\t\t}\n\t\telse {\n\t\t\t$this->success = false;\n\t\t\t$this->error_msg = \"Failed to execute query\";\n\t\t}\n\t}",
"Public Function addCampaign($name, $apiCampaignId = 0, $budget = 0, $SearchContent = '')\n\t{\n\t\t//TABLE STRUCTURE FOR `ppc_campaigns`\n\t\t//{ID (int PK), apiCampaignId (biguint20), user__id (int), providerType (smallint), accountId (int), name (varchar50), budget (float), searchTarget (varchar13), updated (tinyint)}\n\t\t$Insert = array();\n\t\t$Insert['user__id'] = $this->user__id;\n\t\t$Insert['providerType'] = $this->providerType;\n\t\t$Insert['accountId'] = $this->id;\n\t\t$Insert['name'] = $name;\n\t\t$Insert['apiCampaignId'] = $apiCampaignId;\n\t\t$Insert['budget'] = $budget;\n\t\t$Insert['SearchContent'] = $SearchContent;\n\t\t\n\t\tif($this->getCampaignId($name) !== false)\n\t\t\treturn $this->getCampaignId($name);\n\t\t\n\t\tforeach($Insert as $k=>$v)\n\t\t\t$Insert[$k] = $this->_db->quote($v);\n\t\t\t\n\t\t$Sql = \"INSERT INTO bevomedia_ppc_campaigns (user__id, providerType, accountId, name, apiCampaignId, budget, searchTarget) VALUES ($Insert[user__id], $Insert[providerType], $Insert[accountId], $Insert[name], $Insert[apiCampaignId], $Insert[budget], $Insert[SearchContent])\";\n\n\t\t$this->_db->exec($Sql);\n\t\treturn floatval($this->_db->lastInsertId());\n\t}",
"public function insert_record(){\n\n\t\t}",
"public function run()\n {\n DB::table('memberships')->insert([\n\n ]);\n }",
"function insert_incidents($table,$emailid, $incidents)\n\t{\n\t\t\n\t\t$this->sql3 = \"SELECT report_time FROM reports order by report_time desc\";\n\n\t\t\tif ($result = mysqli_query($this->connect, $this->sql3)) {\n\t\t\t while ($fieldinfo = $result -> fetch_field()) {\n\t\t\t\t$row = mysqli_fetch_assoc($result);\n\t\t\t\t$varr=$row['report_time'];\n\t\t\t }\n\t\t\t}\n\t\t\n\t\t$this->sql =\n \"INSERT INTO \" . $table . \" (report_time, incidents) VALUES ('\" . $varr . \"','\" . $incidents . \"')\";\n\t\tif (mysqli_query($this->connect, $this->sql)) \n\t\t{\n return true;\n } \n\t\telse \n\t\t\treturn false;\n\t}",
"public function run()\n {\n CompanyProfile::truncate();\n\n CompanyProfile::insert([\n \t[ 'field' => 'address', 'value' => 'PO Box 16122 Collins Street West, Victoria 8007 Australia' ],\n \t[ 'field' => 'email', 'value' => '[email protected]' ],\n \t[ 'field' => 'phone', 'value' => '+18882936433' ],\n [ 'field' => 'bitcoin_address', 'value' => '18yPTZTbHFVwpcPrUSUMhy3b91vKcwutdK' ],\n [ 'field' => 'about-us', 'value' => '' ],\n [ 'field' => 'what-is-forex', 'value' => '' ],\n ]);\n }",
"public function bulk_insert ($table_quotef, $columns, $data);",
"public function run()\n {\n $info = [\n \t\tarray(\n \t\t\t'id' => 1,\n \t\t\t'address' => 'Córdoba-Argentina (CP 5018)',\n \t\t\t'email' => '[email protected]',\n \t\t\t'phone' => NULL,\n \t\t\t'facebook' => NULL,\n \t\t\t'twitter' => NULL\n \t\t)\n \t];\n \tDB::table('info_contacts')->insert($info);\n }",
"public function run()\n {\n foreach ($this->values as $value) {\n $value['created_at'] = date('Y-m-d H:i:s');\n $value['updated_at'] = date('Y-m-d H:i:s');\n DB::table('contract_classifications')->insert($value);\n }\n }",
"protected function _insert()\n {\n// \t$boardTable = new \\Board\\Board();\n// \t$_board = $boardTable->fetchRow(array('id = ?' => $this->board_id));\n// \tif($_board) {\n// \t\t$this->category_id = $_board->category_id;\n// \t}\n \t$this->date_added = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n \t$this->date_modified = $this->date_added;\n \t/////////////// price\n// \t$price = \\Currency\\Currency::findPrice($this->description);\n// \tif($price) {\n// \t\t$this->gift = 1;\n// \t\t$this->price = $price->price;\n// \t\t$this->currency_code = $price->code;\n// \t}\n// \tif($this->source_id) {\n// \t\t$media = new \\Media\\Helper\\UrlInfo();\n// \t\tif($media->parseUrl($this->from)) {\n// \t\t\t$this->video = 1;\n// \t\t}\n// \t}\n \t//v4\n \tif($this->source_id) {\n \t\t$this->md5_from = md5($this->from);\n \t} else {\n \t\t$this->md5_from = null;\n \t}\n }",
"public function run()\n {\n $faker = Faker\\Factory::create();\n for($i=1;$i<16;$i++){\n DB::table('Campaigns')->insert([\n 'name' => $faker->sentence(4),\n 'user_id'=>$faker->numberBetween(1,20),\n 'status'=>$faker->numberBetween(1,3),\n 'start_day'=>$faker->dateTimeThisYear('-1 month'),\n 'end_day'=>$faker->dateTimeThisYear('+1 month'),\n 'budget' => $faker->randomNumber(8),\n 'bid_amount'=>$faker->randomNumber(6),\n 'description'=>$faker->paragraph(3),\n 'product_id'=>$faker->unique()->numberBetween(1,30),\n 'link'=>$faker->unique()->imageUrl(),\n 'banner'=>$faker->text,\n 'type_id'=>$faker->numberBetween(1,2),\n ]);\n }\n }",
"public function store(StoreCampaign $request)\n {\n $campaign = new Campaign();\n $campaign->name=$request->name;\n $campaign->media_id=$request->media_id;\n $campaign->advertiser_email=$request->advertiser_email;\n $campaign->flag_id = 1;\n $campaignDetail = new CampaignDetail();\n $campaignDetail->kpi=$request->kpi;\n $campaignDetail->objective_id=$request->objective_id;\n $campaignDetail->period_from = Datetime::handlerDateTime($request->period_from_date, $request->period_from_time);\n $campaignDetail->period_to=Datetime::handlerDateTime($request->period_to_date, $request->period_to_time);\n $campaignDetail->budget_type_id=$request->budget_type_id;\n $campaignDetail->campaign_period_budget=$request->campaign_period_budget;\n $campaignDetail->std_daily_budget=$request->std_daily_budget;\n $campaignDetail->std_bidding_method_id = $request->std_bidding_method_id;\n $campaign->save();\n $campaign->campaignDetail()->save($campaignDetail);\n return $campaign;\n }",
"abstract public function insert( $fields );"
] | [
"0.62747",
"0.5802687",
"0.5799815",
"0.5794227",
"0.57728434",
"0.5671454",
"0.56711936",
"0.5554468",
"0.5547301",
"0.5541601",
"0.5520204",
"0.5461565",
"0.54159606",
"0.5375531",
"0.53660095",
"0.5351772",
"0.5339079",
"0.5333288",
"0.53277737",
"0.53257984",
"0.5299321",
"0.5298977",
"0.5295556",
"0.5294675",
"0.52809864",
"0.5274597",
"0.5272752",
"0.5257264",
"0.5248105",
"0.5241707"
] | 0.6164963 | 1 |
Inserts application version into the table. | public function insertApplicationVersionQuery($app){
$date = date("Y-m-d G:i:s");
$application_version = 0;
$query = 'INSERT INTO application_version (
application_id,
version,
date_created,
date_modified
) VALUES (
'.$app->application_id.',
'.$application_version.',
"'.$date.'",
"'.$date.'"
);';
$result = $this->db->query($query);
return($application_version);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function insertVersion(&$version) {\n\t\tif ($version->getCurrent()) {\n\t\t\t// Version to insert is the new current, reset old current\n\t\t\t$this->update('UPDATE versions SET current = 0 WHERE current = 1 AND product = ?', $version->getProduct());\n\t\t}\n\t\tif ($version->getDateInstalled() == null) {\n\t\t\t$version->setDateInstalled(Core::getCurrentDate());\n\t\t}\n\n\t\treturn $this->update(\n\t\t\tsprintf('INSERT INTO versions\n\t\t\t\t(major, minor, revision, build, date_installed, current, product_type, product)\n\t\t\t\tVALUES\n\t\t\t\t(?, ?, ?, ?, %s, ?, ?, ?)',\n\t\t\t\t$this->datetimeToDB($version->getDateInstalled())),\n\t\t\tarray(\n\t\t\t\t(int) $version->getMajor(),\n\t\t\t\t(int) $version->getMinor(),\n\t\t\t\t(int) $version->getRevision(),\n\t\t\t\t(int) $version->getBuild(),\n\t\t\t\t(int) $version->getCurrent(),\n\t\t\t\t$version->getProductType(),\n\t\t\t\t$version->getProduct()\n\t\t\t)\n\t\t);\n\t}",
"function create_app_version_id($link, $data, $app_id, $version) // Colorize: green\n { // Colorize: green\n // Ignore PhpAlignmentVerifier [BEGIN] // Colorize: green\n $sql = \"INSERT INTO \" . DB_TABLE_APP_VERSIONS // Colorize: green\n . \" (app_id, version, hash, completed)\" // Colorize: green\n . \" VALUES(\" // Colorize: green\n . \" '\" . $link->real_escape_string($app_id) . \"',\" // Colorize: green\n . \" '\" . $link->real_escape_string($version) . \"',\" // Colorize: green\n . \" '',\" // Colorize: green\n . \" '0'\" // Colorize: green\n . \")\"; // Colorize: green\n // Ignore PhpAlignmentVerifier [END] // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n $result = $link->query($sql); // Colorize: green\n die_if_sql_failed($result, $link, $data, $sql); // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n return $link->insert_id; // Colorize: green\n }",
"protected function ensureVersionTableExists(){\n\t\t\tif($this->TableExists(static::VERSION_TABLE_NAME) === false){\n\t\t\t\t$this->CreateTable(static::VERSION_TABLE_NAME, new ColDefs(\n\t\t\t\t\tnew ColumnDefinition(\n\t\t\t\t\t\tstatic::COLUMN_VERSION,\n\t\t\t\t\t\tarray( 'Type' => ColumnType::Text, 'Size' => 100 )\n\t\t\t\t\t),\n\t\t\t\t\tnew ColumnDefinition(\n\t\t\t\t\t\tstatic::COLUMN_NAME,\n\t\t\t\t\t\tarray( 'Type' => ColumnType::Text, 'Size' => 100 )\n\t\t\t\t\t)\n\t\t\t\t), new IndexDefs);\n\t\t\t}\n\t\t}",
"function insertVersion(&$version, $isPlugin = false) {\n\t\t$isNewVersion = true;\n\n\t\tif ($version->getCurrent()) {\n\t\t\t// Find out whether the last installed version is the same as the\n\t\t\t// one to be inserted.\n\t\t\t$versionHistory =& $this->getVersionHistory($version->getProductType(), $version->getProduct());\n\t\t\t$oldVersion =& array_shift($versionHistory);\n\t\t\tif ($oldVersion) {\n\t\t\t\tif ($version->compare($oldVersion) == 0) {\n\t\t\t\t\t// The old and the new current versions are the same so we need\n\t\t\t\t\t// to update the existing version entry.\n\t\t\t\t\t$isNewVersion = false;\n\t\t\t\t} elseif ($version->compare($oldVersion) == 1) {\n\t\t\t\t\t// Version to insert is newer than the existing version entry.\n\t\t\t\t\t// We reset existing entry.\n\t\t\t\t\t$this->update('UPDATE versions SET current = 0 WHERE current = 1 AND product = ?', $version->getProduct());\n\t\t\t\t} else {\n\t\t\t\t\t// We do not support downgrades.\n\t\t\t\t\tfatalError('You are trying to downgrade the product \"'.$version->getProduct().'\" from version ['.$oldVersion->getVersionString().'] to version ['.$version->getVersionString().']. Downgrades are not supported.');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($isNewVersion) {\n\t\t\t// We only change the install date when we insert new\n\t\t\t// version entries.\n\t\t\tif ($version->getDateInstalled() == null) {\n\t\t\t\t$version->setDateInstalled(Core::getCurrentDate());\n\t\t\t}\n\n\t\t\t// Insert new version entry\n\t\t\treturn $this->update(\n\t\t\t\tsprintf('INSERT INTO versions\n\t\t\t\t\t(major, minor, revision, build, date_installed, current, product_type, product, product_class_name, lazy_load, sitewide)\n\t\t\t\t\tVALUES\n\t\t\t\t\t(?, ?, ?, ?, %s, ?, ?, ?, ?, ?, ?)',\n\t\t\t\t\t$this->datetimeToDB($version->getDateInstalled())),\n\t\t\t\tarray(\n\t\t\t\t\t(int) $version->getMajor(),\n\t\t\t\t\t(int) $version->getMinor(),\n\t\t\t\t\t(int) $version->getRevision(),\n\t\t\t\t\t(int) $version->getBuild(),\n\t\t\t\t\t(int) $version->getCurrent(),\n\t\t\t\t\t$version->getProductType(),\n\t\t\t\t\t$version->getProduct(),\n\t\t\t\t\t$version->getProductClassName(),\n\t\t\t\t\t($version->getLazyLoad()?1:0),\n\t\t\t\t\t($version->getSitewide()?1:0)\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t// Update existing version entry\n\t\t\treturn $this->update(\n\t\t\t\t'UPDATE versions SET current = ?, product_class_name = ?, lazy_load = ?, sitewide = ?\n\t\t\t\t\tWHERE product_type = ? AND product = ? AND major = ? AND minor = ? AND revision = ? AND build = ?',\n\t\t\t\tarray(\n\t\t\t\t\t(int) $version->getCurrent(),\n\t\t\t\t\t$version->getProductClassName(),\n\t\t\t\t\t($version->getLazyLoad()?1:0),\n\t\t\t\t\t($version->getSitewide()?1:0),\n\t\t\t\t\t$version->getProductType(),\n\t\t\t\t\t$version->getProduct(),\n\t\t\t\t\t(int) $version->getMajor(),\n\t\t\t\t\t(int) $version->getMinor(),\n\t\t\t\t\t(int) $version->getRevision(),\n\t\t\t\t\t(int) $version->getBuild()\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}",
"protected function addHistory($version)\n\t{\n\t\t$this->db->table($this->table)\n\t\t\t\t->insert([\n\t\t\t\t\t'version'\t => $version,\n\t\t\t\t\t'name'\t\t => $this->name,\n\t\t\t\t\t'group'\t\t => $this->group,\n\t\t\t\t\t'namespace'\t => $this->namespace,\n\t\t\t\t\t'time'\t\t => time(),\n\t\t]);\n\t\tif (is_cli())\n\t\t{\n\t\t\t$this->cliMessages[] = \"\\t\" . CLI::color(lang('Migrations.added'), 'yellow') . \"($this->namespace) \" . $version . '_' . $this->name;\n\t\t}\n\t}",
"protected function setDbVersion($version)\n {\n $version = (int)$version;\n return $this->pdo->exec(\"TRUNCATE version; INSERT INTO version VALUES ({$version})\");\n }",
"public function ensure_version() {\n $installed_version = $this->options['version'];\n if ($installed_version !== $this->version) {\n $this->_update_database();\n }\n }",
"public function run()\n {\n \\App\\Models\\Version::insert([\n [\n 'version_code' => '1',\n 'version_name' => '1.0',\n 'description' => 'Version hiện tại',\n 'force_upgrade' => true,\n 'category' => 'customer',\n 'device_type' => 'android'\n ],[\n 'version_code' => '1',\n 'version_name' => '1.0',\n 'description' => 'Version hiện tại',\n 'force_upgrade' => true,\n 'category' => 'shipper',\n 'device_type' => 'android'\n ], [\n 'version_code' => '1',\n 'version_name' => '1.0',\n 'description' => 'Version hiện tại',\n 'force_upgrade' => true,\n 'category' => 'customer',\n 'device_type' => 'ios',\n ], [\n 'version_code' => '1',\n 'version_name' => '1.0',\n 'description' => 'Version hiện tại',\n 'force_upgrade' => true,\n 'category' => 'shipper',\n 'device_type' => 'ios',\n ]\n ]);\n }",
"public function stt_activate() {\n global $wpdb;\n $table_version = get_option('stt_table_version');\n if (!$table_version) {\n // Insert latest version of the database.\n $table_name = static::table_name();\n $sql = \"CREATE TABLE IF NOT EXISTS {$table_name} (\n id int NOT NULL AUTO_INCREMENT,\n priority int NOT NULL,\n order_schema char(30),\n post_id bigint(20) unsigned,\n primary key (id)\n );\";\n\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n dbDelta( $sql );\n update_option('stt_table_version', '1');\n }\n }",
"public function run()\n {\n DB::table('applications')->insert([\n 'display_name' => 'Bookmarks',\n 'identifier' => 'BOOKMARK',\n 'description' => 'Site bookmarks',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now()\n ]);\n }",
"public static function save_dbversion()\n\t{\n\t\tOptions::set( 'db_version', Version::DB_VERSION );\n\t}",
"public function set(?string $version): void\n {\n $dbSetting = $this->table->findByName('db_version')->first();\n if (!$dbSetting) {\n $dbSetting = $this->table->newEntity();\n }\n $dbSetting->set('value', $version);\n $this->table->save($dbSetting);\n }",
"function create_software_entry(string $name, string $version, string $registration_no, int $status) // -> integer\n{\n $inserted_id = null;\n $conn = meta_open_db();\n if ($stmt = $conn->prepare(\"INSERT INTO `SoftwareEquipment`(`Name`, `Version`, `RegistrationNumber`, `Supported`) VALUES (?,?,?,?)\"))\n {\n $stmt->bind_param(\"sssi\", $name, $version, $registration_no, $status);\n if (!$stmt->execute()) return null;\n $inserted_id = $conn->insert_id;\n $stmt->close();\n }\n $conn->close();\n return (2 * $inserted_id + 1);\n}",
"public function run()\n\t{\n\t\tDB::table('applications')->insert(\n\t\t\t[\n\t\t\t\t'appid' => 730,\n\t\t\t\t'name' => 'Counter-Strike: Global Offensive',\n\t\t\t\t'marketable' => 1\n\t\t\t]\n\t\t);\n\t\tDB::table('applications')->insert(\n\t\t\t[\n\t\t\t\t'appid' => 570,\n\t\t\t\t'name' => 'Dota 2',\n\t\t\t\t'marketable' => 1\n\t\t\t]\n\t\t);\n\t}",
"function InsertNewApp($appname,$appversion,$appdescription,$appicon) {\n include \"mysqlconnect.php\";\n\n $image_link = \"http://\".$_SERVER['HTTP_HOST'].\"/\".substr($_SERVER['REQUEST_URI'],0,strpos($_SERVER['REQUEST_URI'],\"application.php\")).\"/\".$appicon;\n \n $app_list = array(\"status\" => \"200\") + array(\"results\" => \"Nothing Happened\"); \n \n try {\n \n $stmt = $conn->prepare(\"INSERT INTO application (\n appname,\n version,\n enabled,\n description,\n imagepath\n ) \n VALUES( \n :appname,\n :version,\n 1,\n :description,\n :imagepath\n )\");\n \n $stmt->bindParam(':appname',$appname,PDO::PARAM_STR,50);\n $stmt->bindParam(':version',$appversion,PDO::PARAM_STR,50);\n $stmt->bindParam(':description',$appdescription,PDO::PARAM_STR,50);\n $stmt->bindParam(':imagepath',$appicon,PDO::PARAM_STR,255);\n $stmt->execute();\n $app_list = array(\"status\" => \"201\") + array(\"results\" => \"Created\"); \n \n \n } catch(PDOException $e){\n \n \n //echo \"Something went wrong...\";\n $app_list = $stmt->errorInfo();\n $app_list = array(\"status\" => \"400\") + array(\"results\" => $e->getMessage()); \n }\n \n return $app_list;\n\n }",
"protected function update_db_version() {\n\t\tupdate_option( $this->version_key, $this->edge_version );\n\t}",
"public function run()\n {\n new_version::create([\n\n 'enable' => 0\n\n ]);\n }",
"public function run()\n {\n $this->table('vendors')\n ->insert([\n [\n 'name' => 'SA',\n 'full_name' => 'Sales Assits'\n ]\n ])\n ->saveData();\n }",
"public function run()\n {\n $games =game::all();\n $gameVersions = [];\n foreach($games as $game){\n $versionStart = 2010;\n for($i = 0 ; $i <= 10 ; $i++){\n\n $gameVersions[] = [\n 'game_id' => $game->id,\n 'version' => $versionStart +$i,\n 'created_at' => $game->created_at->addYear($i),\n 'updated_at' => $game->created_at->addYear($i)\n ];\n \n }\n }\n gameVersion::insert($gameVersions); \n }",
"protected static function init () {\r\n // If there's no table to store database versions, create it.\r\n if (!App::database()->tableExists(static::$db_table)) {\r\n $fields = array();\r\n $fields[] = \"uid INT(11) UNSIGNED AUTO_INCREMENT\";\r\n $fields[] = \"version VARCHAR(30) NOT NULL\";\r\n $fields[] = \"updated INT(10) UNSIGNED NOT NULL\";\r\n\r\n // Make the database.\r\n App::database()->createTable(static::$db_table, static::$primary_key, $fields);\r\n }\r\n }",
"function upgradeTableDb( $from_version )\r\n {\r\n // $from_version is the current version of this game database, in numerical form.\r\n // For example, if the game was running with a release of your game named \"140430-1345\",\r\n // $from_version is equal to 1404301345\r\n \r\n // Example:\r\n// if( $from_version <= 1404301345 )\r\n// {\r\n// $sql = \"ALTER TABLE xxxxxxx ....\";\r\n// self::DbQuery( $sql );\r\n// }\r\n// if( $from_version <= 1405061421 )\r\n// {\r\n// $sql = \"CREATE TABLE xxxxxxx ....\";\r\n// self::DbQuery( $sql );\r\n// }\r\n// // Please add your future database scheme changes here\r\n//\r\n//\r\n\r\n\r\n }",
"function replicate_app_version($link, $data, $app_version_id, $app_id, $version, $secret_key) // Colorize: green\n { // Colorize: green\n $replicate_data = [ // Colorize: green\n \"app_version_id\" => $app_version_id, // Colorize: green\n \"app_id\" => $app_id, // Colorize: green\n \"version\" => $version, // Colorize: green\n \"secret_key\" => $secret_key // Colorize: green\n ]; // Colorize: green\n // Colorize: green\n replicate($link, $data, $replicate_data, \"/rest/replicate_app_version.php\"); // Colorize: green\n }",
"public function actionCreate()\n {\n $version = new Version();\n \n $lastRecord = Version::find()->orderBy(['id' => SORT_DESC])->one();\n \n if (!$lastRecord) { // This is the first record\n $version->version = '0.0';\n $version->live = 0;\n }\n else { // Record already exists\n $version->version = strval(floatval($lastRecord->version) + 0.1);\n $version->live = 0;\n }\n \n if ($version->save()) {\n Yii::$app->session->setFlash('success', 'New version ' . $version->version . ' successfully created.');\n }\n else {\n Yii::$app->session->setFlash('danger', 'Something went wrong.');\n }\n \n return $this->redirect(['admin/index']);\n }",
"private static function checkDBVersion()\n {\n\t\t\tglobal $wpdb;\n\n // Get current DB version of plugin\n\t\t\t$current_db_version = get_option( \"sc_gds_db_version\" );\n\n if( $current_db_version == self::$db_version )\n return;\n\n $sql = \"CREATE TABLE IF NOT EXISTS `\" . $wpdb->prefix . self::$tablename . \"` (\n `post_id` int(11) NOT NULL,\n `meta_id` int(11) NOT NULL,\n `post_type` varchar(20) NOT NULL,\n `lat` float(10,6) DEFAULT NULL,\n `lng` float(10,6) DEFAULT NULL,\n PRIMARY KEY (`post_id`),\n KEY `post_type` (`post_type`,`lat`,`lng`)\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8;\";\n\n require_once( ABSPATH . \"wp-admin/includes/upgrade.php\" );\n\n dbDelta( $sql );\n\n // Update options with new DB version\n update_option( \"sc_gds_db_version\", self::$db_version );\n\t\t}",
"private function handleMigrationTable(): void\n\t{\n\t\t$this->connection->query('\n\t\t\tCREATE TABLE IF NOT EXISTS ' . $this->databaseVersionTable . ' (\n\t\t\t\tuser VARCHAR(10) NOT NULL,\n\t\t\t\tversion SMALLINT UNSIGNED NOT NULL,\n\t\t\t\tdate DATETIME NOT NULL,\n\t\t\t\tPRIMARY KEY (user)\n\t\t\t);\n\t\t');\n\t}",
"public static function update_db_version_if_not_exists() {\n\t\tif (self::get_db_version() === FALSE) {\n\t\t\tself::update_db_version();\n\t\t\tself::$_version = self::get_db_version();\n\t\t}\n\t}",
"public function actionCreate()\n {\n $this->layout = \"layout1\";\n $model = new VersionUpgrade();\n $data = APP::find()->asArray()->all();\n if(Yii::$app->request->isPost){\n $post = Yii::$app->request->post();\n $model->app_id = $post['VersionUpgrade']['app_id'];\n $model->status = $post['VersionUpgrade']['status'];\n $model->type = $post['VersionUpgrade']['type'];\n $model->version_code = $post['VersionUpgrade']['version_code'];\n $model->apk_url = $post['VersionUpgrade']['apk_url'];\n $model->upgrade_point = $post['VersionUpgrade']['upgrade_point'];\n $model->create_time = time();\n if($model->load($model) || $model->validate()){\n if($model->save(false)){\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }else{\n var_dump($model->getErrors());\n exit;\n }\n\n }\n return $this->render('create', [\n 'model' => $model,\n 'data'=>$data,\n ]);\n }",
"private function addToDatabase($appName, $packageName, $imageTitle)\n {\n $this->_dbApps->insertParentApp($this->_deviceId, $this->_parentId, $appName, $packageName, $imageTitle);\n\n $dbDefaultApp = new Application_Model_DbTable_DeviceDefaultApps();\n $status = $dbDefaultApp->isProductiveApp($packageName) ? 'N' : 'Y';\n\n foreach ($this->getChildList() as $child) {\n $childId = $child['child_id'];\n $this->_dbApps->insertChildApp($this->_deviceId, $childId, $appName, $packageName, $imageTitle, $status);\n }\n }",
"public function store(Request $request)\n {\n\n $v=new Version();\n $v->state=$request->state;\n $v->nroVersion=$request->version; //unique\n $v->nroCredits=$request->credits;\n $v->startDate=$request->startDate;\n $v->finishDate=$request->finishDate;\n $v->price=$request->price;\n $v->discountPrice=$request->discountPrice;\n $v->enrollmentPrice=$request->enrollPrice;\n $v->coo_id=$request->cId;\n $v->program_id=$request->programId;\n\n $v->save();\n\n $req=$request->req;\n foreach ($req as $key=>$value)\n {\n $arrReq[]=[\n\n 'req_id'=>$req[$key],\n 'version_id'=>$v->id\n ];\n }\n DB::table('ReqVersions')->insert($arrReq);\n redirect('programs');\n\n }",
"function upgradeTableDb( $from_version )\n {\n // $from_version is the current version of this game database, in numerical form.\n // For example, if the game was running with a release of your game named \"140430-1345\",\n // $from_version is equal to 1404301345\n \n // Example:\n// if( $from_version <= 1404301345 )\n// {\n// // ! important ! Use DBPREFIX_<table_name> for all tables\n//\n// $sql = \"ALTER TABLE DBPREFIX_xxxxxxx ....\";\n// self::applyDbUpgradeToAllDB( $sql );\n// }\n// if( $from_version <= 1405061421 )\n// {\n// // ! important ! Use DBPREFIX_<table_name> for all tables\n//\n// $sql = \"CREATE TABLE DBPREFIX_xxxxxxx ....\";\n// self::applyDbUpgradeToAllDB( $sql );\n// }\n// // Please add your future database scheme changes here\n//\n//\n\n\n }"
] | [
"0.67065936",
"0.62797683",
"0.5869244",
"0.5777497",
"0.5758944",
"0.5678391",
"0.5601909",
"0.55535764",
"0.55435747",
"0.5540188",
"0.5495688",
"0.54483527",
"0.5404871",
"0.53957987",
"0.53330743",
"0.5331693",
"0.53081745",
"0.52882075",
"0.52859575",
"0.5203866",
"0.51977724",
"0.5197342",
"0.51889753",
"0.51645815",
"0.5160741",
"0.51346445",
"0.51186",
"0.5114074",
"0.511118",
"0.5110959"
] | 0.73264825 | 0 |
Inserts react affiliations into the table. | public function insertReactAffiliationQuery($ra,$app){
$date = date("Y-m-d G:i:s");
$query = 'INSERT INTO react_affiliation (
react_application_id,
date_created,
date_modified,
company_id,
application_id,
agent_id
) VALUES (
'.$app->application_id.',
"'.$date.'",
"'.$date.'",
'.$app->company_id.',
'.$ra->application_id.',
'.$ra->agent_id.'
);';
$result = $this->db->query($query);
return(true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function processInserts() {\n\n\t\t$this->insertArtists();\n\t}",
"public function insert()\n {\n $this->_cleanFields();\n \n parent::insert();\n }",
"public function run()\r\n {\r\n \r\n\r\n \\DB::table('affilates')->delete();\r\n \r\n \\DB::table('affilates')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'code_limit' => 6,\n 'about_system' => '<p><strong><span style=\"font-size: 18pt; color: #e03e2d;\">How it works ? <span style=\"font-size: 14pt;\"> </span></span><br /><br />Once the system is enabled user will able to put refer code on register screen if refer code is valid then settled amount is given to that referral user\\'s wallet (IF his wallet is active).</strong><br /><strong>IF refer code is invalid user will see invalid refer code warning on register screen unless he put correct refer code or remove the refer code.</strong></p>\r\n<p>IF <label><span style=\"color: #000000;\"><strong>Credit wallet amount on first purchase settings</strong></span> is <span style=\"text-decoration: underline;\"><strong>enabled </strong></span>then after being refered, user need to purchase something. Once their order is delivered successfully then referal code user will get their amount in <strong>wallet</strong>. </label><label class=\"switch\"></label></p>\r\n<p>IF <label><span style=\"color: #000000;\"><strong>Credit wallet amount on first purchase settings</strong></span> is<strong> </strong><span style=\"text-decoration: underline;\"><strong>dis</strong><strong>abled </strong></span>then after being refered, referal code user will get their amount in <strong>wallet</strong>. </label></p>\r\n<p><span style=\"color: #000000;\"><strong>After Enable the Affiliate system user will have a have a refer screen to share his affilated link and he will able to trace which user is signup with his refer code on his dashboard under My Account section.</strong></span></p>',\n 'enable_affilate' => 0,\n 'refer_amount' => 0.06,\n 'enable_purchase' => 0,\n 'created_at' => '2021-05-10 10:34:46',\n 'updated_at' => '2021-05-10 22:26:43',\n ),\n ));\r\n \r\n \r\n }",
"public function insert()\n {\n \tif ($this->isAvailable())\n \t\treturn false;\n\n \t$this->extendDefaults();\n\n \t$id = \\DB::table($this->table)\n\t \t->insert(array(\n\t \t\t\"id\" => null,\n \"user_id\" => $this->get(\"user_id\"),\n \"account_id\" => $this->get(\"account_id\"),\n \"action_follow\" => $this->get(\"action_follow\"),\n \"action_unfollow\" => $this->get(\"action_unfollow\"),\n \"action_like\" => $this->get(\"action_like\"),\n \"action_comment\" => $this->get(\"action_comment\"),\n \"action_welcomedm\" => $this->get(\"action_welcomedm\"),\n \"action_repost\" => $this->get(\"action_repost\"),\n \"action_viewstory\" => $this->get(\"action_viewstory\"),\n \"comments\" => $this->get(\"comments\"),\n \"dms\" => $this->get(\"dms\"),\n \"follow_cicle\" => $this->get(\"follow_cicle\"),\n \"target\" => $this->get(\"target\"),\n \"gender\" => $this->get(\"gender\"),\n \"ignore_private\" => $this->get(\"ignore_private\"),\n \"has_picture\" => $this->get(\"has_picture\"),\n \"business\" => $this->get(\"business\"),\n \"items\" => $this->get(\"items\"),\n \"blacklist\" => $this->get(\"blacklist\"),\n \"bad_words\" => $this->get(\"bad_words\"),\n \"whitelist\" => $this->get(\"whitelist\"),\n \"unfollow_all\" => $this->get(\"unfollow_all\"),\n \"keep_followers\" => $this->get(\"keep_followers\"),\n \"timeline_feed\" => $this->get(\"timeline_feed\"),\n \"cicle_action\" => $this->get(\"cicle_action\"),\n \t\t\"cicle_follow\" => $this->get(\"cicle_follow\"),\n \t\t\"cicle_count\" => $this->get(\"cicle_count\"),\n \t\t\"follow_count\" => $this->get(\"follow_count\"),\n \"speed\" => $this->get(\"speed\"),\n \"daily_pause\" => $this->get(\"daily_pause\"),\n \"daily_pause_from\" => $this->get(\"daily_pause_from\"),\n \"daily_pause_to\" => $this->get(\"daily_pause_to\"),\n \"is_active\" => $this->get(\"is_active\"),\n \"schedule_date\" => $this->get(\"schedule_date\"),\n \"all_schedules\" => $this->get(\"all_schedules\"),\n \"end_date\" => $this->get(\"end_date\"),\n \"last_action_date\" => $this->get(\"last_action_date\"),\n \"running\" => $this->get(\"running\"),\n \"data\" => $this->get(\"data\"),\n\t \t));\n\n \t$this->set(\"id\", $id);\n \t$this->markAsAvailable();\n \treturn $this->get(\"id\");\n }",
"public function insert()\n {\n DB::table('users')\n //metoda ::table pentru a spune unde\n // adaugam\n ->insert([\n ['email' =>\n '[email protected]', 'votes' => 0],\n\n ['email' => '[email protected]', 'votes' => 0]\n ]);\n // metoda insert()\n // pentru a spune ce facem\n }",
"protected function insert () {\n\n }",
"public function run()\n {\n DB::table('memberships')->insert([\n\n ]);\n }",
"public function sql_insert()\n\t{\n\t\tparent::sql_insert();\n\t\tif (!is_null($this->categories))\n\t\tforeach ($this->categories as $cat) {\n\t\t\tCategorizedItem::add($cat, $this->slug);\n\t\t}\n\t}",
"public static function set_affiliate($affinfo){\n $conn = DatabaseConnection::get_connection();\n $sql = 'INSERT INTO affiliation (affname, email, phone, street1, street2, city, state, zip) \n VALUES(:affname, :email, :phone, :street1, :street2, :city, :state, :zip)';\n if($stmt = $conn->prepare($sql)){\n $stmt->bindParam(':affname', $affinfo['affname']);\n $stmt->bindParam(':email', $affinfo['email']);\n $stmt->bindParam(':phone', $affinfo['phone']);\n $stmt->bindParam(':street1', $affinfo['street1']);\n $stmt->bindParam(':street2', $affinfo['street2']);\n $stmt->bindParam(':city', $affinfo['city']);\n $stmt->bindParam(':state', $affinfo['state']);\n $stmt->bindParam(':zip', $affinfo['zip']);\n try {\n $stmt->execute();\n } catch (PDOException $e){\n\t\t\t\t//Gets the error if the query fails to execute\n echo $e->getMessage();\n return false;\n }\n return true;\n } else {\n\t\t\t//Fetches the SQLSTATE associated with the last operation on the database handle\n echo $stmt->errorCode();\n return false;\n }\n }",
"public function run()\n {\n DB::table('sponsors')->insert([\n 'sponsor_application_id' => 3,\n 'amount' => 100,\n 'reference' => Paystack::genTranxRef(),\n 'updated_at' => \\Carbon\\Carbon::now(),\n 'created_at' => \\Carbon\\Carbon::now(), \n ]);\n\n DB::table('sponsors')->insert([\n 'sponsor_application_id' => 3,\n 'amount' => 100,\n 'reference' => Paystack::genTranxRef(),\n 'updated_at' => \\Carbon\\Carbon::now(),\n 'created_at' => \\Carbon\\Carbon::now(), \n ]);\n\n DB::table('sponsors')->insert([\n 'sponsor_application_id' => 6,\n 'amount' => 150,\n 'reference' => Paystack::genTranxRef(),\n 'updated_at' => \\Carbon\\Carbon::now(),\n 'created_at' => \\Carbon\\Carbon::now(), \n ]);\n\n DB::table('sponsors')->insert([\n 'sponsor_application_id' => 8,\n 'amount' => 190,\n 'reference' => Paystack::genTranxRef(),\n 'updated_at' => \\Carbon\\Carbon::now(),\n 'created_at' => \\Carbon\\Carbon::now(), \n ]);\n\n DB::table('sponsors')->insert([\n 'sponsor_application_id' => 8,\n 'amount' => 500,\n 'reference' => Paystack::genTranxRef(),\n 'updated_at' => \\Carbon\\Carbon::now(),\n 'created_at' => \\Carbon\\Carbon::now(), \n ]);\n\n DB::table('sponsors')->insert([\n 'sponsor_application_id' => 16,\n 'amount' => 50,\n 'reference' => Paystack::genTranxRef(),\n 'updated_at' => \\Carbon\\Carbon::now(),\n 'created_at' => \\Carbon\\Carbon::now(), \n ]);\n\n DB::table('sponsors')->insert([\n 'sponsor_application_id' => 21,\n 'amount' => 210,\n 'reference' => Paystack::genTranxRef(),\n 'updated_at' => \\Carbon\\Carbon::now(),\n 'created_at' => \\Carbon\\Carbon::now(), \n ]);\n\n DB::table('sponsors')->insert([\n 'sponsor_application_id' => 38,\n 'amount' => 109,\n 'reference' => Paystack::genTranxRef(),\n 'updated_at' => \\Carbon\\Carbon::now(),\n 'created_at' => \\Carbon\\Carbon::now(), \n ]);\n\n DB::table('sponsors')->insert([\n 'sponsor_application_id' => 39,\n 'amount' => 400,\n 'reference' => Paystack::genTranxRef(),\n 'updated_at' => \\Carbon\\Carbon::now(),\n 'created_at' => \\Carbon\\Carbon::now(), \n ]);\n\n DB::table('sponsors')->insert([\n 'sponsor_application_id' => 39,\n 'amount' => 10,\n 'reference' => Paystack::genTranxRef(),\n 'updated_at' => \\Carbon\\Carbon::now(),\n 'created_at' => \\Carbon\\Carbon::now(), \n ]);\n\n DB::table('sponsors')->insert([\n 'sponsor_application_id' => 39,\n 'amount' => 100,\n 'reference' => Paystack::genTranxRef(),\n 'updated_at' => \\Carbon\\Carbon::now(),\n 'created_at' => \\Carbon\\Carbon::now(), \n ]);\n\n DB::table('sponsors')->insert([\n 'sponsor_application_id' => 44,\n 'amount' => 100,\n 'reference' => Paystack::genTranxRef(),\n 'updated_at' => \\Carbon\\Carbon::now(),\n 'created_at' => \\Carbon\\Carbon::now(), \n ]);\n\n DB::table('sponsors')->insert([\n 'sponsor_application_id' => 44,\n 'amount' => 200,\n 'reference' => Paystack::genTranxRef(),\n 'updated_at' => \\Carbon\\Carbon::now(),\n 'created_at' => \\Carbon\\Carbon::now(), \n ]);\n\n }",
"function hook_call_center_insert(CallCenter $call_center) {\n db_insert('mytable')\n ->fields(array(\n 'id' => entity_id('call_center', $call_center),\n 'extra' => print_r($call_center, TRUE),\n ))\n ->execute();\n}",
"public function update()\n {\n // run the update SQL script to update alter existing tables and create existing ones\n \n // update existing users to add affiliate id\n \n // return back();\n }",
"public function run()\n {\n DB::table('news_to_user')->insert([\n 'news_id' => '1',\n 'user_id' => '1',\n 'relationship_id' => '1',\n ]);\n DB::table('news_to_user')->insert([\n 'news_id' => '1',\n 'user_id' => '1',\n 'relationship_id' => '2'\n ]);\n }",
"public function insert($assessmentAiclassifier);",
"public function insert()\n\t\t{\n\t\t\t$this->save();\n\t\t}",
"public function on_insert() {}",
"public function insert(): void\n {\n parent::insert();\n }",
"public function install_table()\n {\n global $Article_Reaction_DB;\n $Article_Reaction_DB = new Article_Reaction_DB();\n $Article_Reaction_DB->install_article_reaction_table();\n \n }",
"public function run()\n {\n AffiliateLink::factory(5)->create(['affiliate_id' => 1]);\n AffiliateLink::factory(5)->create(['affiliate_id' => 2]);\n AffiliateLink::factory(5)->create(['affiliate_id' => 3]);\n AffiliateLink::factory(5)->create(['affiliate_id' => 4]);\n }",
"function addBusiness( $name,\r\n $email,\r\n $business,\r\n $phone,\r\n $address,\r\n $city,\r\n $state,\r\n $zip,\r\n $website,\r\n $type,\r\n $description,\r\n $wifi, \r\n $chair, \r\n $urls,\r\n $approved )\r\n {\r\n // db connection parameters\r\n global $dbhost, $dbuser, $dbpass, $dbname;\r\n\r\n $connection = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);\r\n\r\n //inserting into subscriber table with results\r\n $sql = \"INSERT INTO ilr_business \";\r\n $sql .= \"( fullname, email, businessname, phone, address, city, \";\r\n $sql .= \"state, zip, website, type, description, wifi, wchair, imageurl, approved)\";\r\n $sql .= \" VALUES ( '{$name}', '{$email}', '{$business}', '{$phone}',\";\r\n $sql .= \" '{$address}', '{$city}', '{$state}', '{$zip}','{$website}',\";\r\n $sql .= \" '{$type}', '{$description}' , '{$wifi}', '{$chair}', '{$urls}', '{$approved}')\";\r\n\r\n // make query and store results\r\n $result = mysqli_query( $connection, $sql );\r\n\r\n //test and report successful insertion into DB\r\n if( $result )\r\n {\r\n // Success\r\n echo \"Success! Subsciber added to ilr_business DB.\";\r\n\r\n // return event record id\r\n $last_id = mysqli_insert_id($connection);\r\n return $last_id;\r\n } \r\n else\r\n {\r\n // Failure\r\n die(\"Database query failed. \" . mysqli_error($connection));\r\n }\r\n\r\n // close db connection\r\n mysqli_close($connection);\r\n}",
"public function hookInstall(){\n $sql = \"CREATE TABLE IF NOT EXISTS `{$this->_db->Annotate}` (\n `id` BIGINT UNSIGNED NOT NULL auto_increment PRIMARY KEY,\n `text` TEXT,\n `user_id` BIGINT UNSIGNED NOT NULL,\n `item_id` BIGINT UNSIGNED NOT NULL,\n `bookmark` TINYINT NOT NULL DEFAULT 0,\n `modified` TIMESTAMP NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP\n ) ENGINE = MYISAM;\";\n\n $this->_db->query($sql);\n\n $this->_installOptions();\n }",
"public function run()\n {\n DB::table('donation')->insert(\n [\n 'category' => 12,\n 'deadline' => Carbon::create('2021', '04', '28')->format(\"Y-m-d\"),\n 'idCampaigner' => 11,\n 'photo' => 'images/donation/pantiAsuhan.jpeg',\n 'purpose' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque, fugiat, nobis inventore cupiditate porro a non fugit maxime possimus repellendus officiis iusto blanditiis deserunt asperiores quia quod nemo adipisci dicta exercitationem sequi doloribus cum ipsum! Tempore quis, id praesentium accusamus, ea aut expedita quo atque neque dolore optio eum sed aliquam. Dignissimos velit earum tempora in recusandae cupiditate eligendi, aliquam est obcaecati corrupti eos odio exercitationem iste totam ipsum sequi! Fuga iure repudiandae impedit, illum corporis alias. Explicabo modi voluptatibus ipsum nisi omnis vel saepe rerum unde repellat nam delectus velit ea cumque, aperiam facere enim! Corporis earum debitis aperiam?\n \n Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque, fugiat, nobis inventore cupiditate porro a non fugit maxime possimus repellendus officiis iusto blanditiis deserunt asperiores quia quod nemo adipisci dicta exercitationem sequi doloribus cum ipsum! Tempore quis, id praesentium accusamus, ea aut expedita quo atque neque dolore optio eum sed aliquam. Dignissimos velit earum tempora in recusandae cupiditate eligendi, aliquam est obcaecati corrupti eos odio exercitationem iste totam ipsum sequi! Fuga iure repudiandae impedit, illum corporis alias. Explicabo modi voluptatibus ipsum nisi omnis vel saepe rerum unde repellat nam delectus velit ea cumque, aperiam facere enim! Corporis earum debitis aperiam?',\n 'status' => 0,\n 'title' => 'Bantu perpanjangan kontrak Panti Asuhan Sejahtera Bersama',\n 'assistedSubject' => 'Panti Asuhan',\n 'donationCollected' => 16000000,\n 'donationTarget' => 1500000,\n 'created_at' => Carbon::now()->format('Y-m-d'),\n 'bank' => 1,\n 'accountNumber' => \"112233445566\"\n ]\n );\n DB::table('donation')->insert(\n [\n 'category' => 9,\n 'deadline' => Carbon::create('2021', '04', '28')->format(\"Y-m-d\"),\n 'idCampaigner' => 12,\n 'photo' => 'images/donation/tupperware.jpg',\n 'purpose' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque, fugiat, nobis inventore cupiditate porro a non fugit maxime possimus repellendus officiis iusto blanditiis deserunt asperiores quia quod nemo adipisci dicta exercitationem sequi doloribus cum ipsum! Tempore quis, id praesentium accusamus, ea aut expedita quo atque neque dolore optio eum sed aliquam. Dignissimos velit earum tempora in recusandae cupiditate eligendi, aliquam est obcaecati corrupti eos odio exercitationem iste totam ipsum sequi! Fuga iure repudiandae impedit, illum corporis alias. Explicabo modi voluptatibus ipsum nisi omnis vel saepe rerum unde repellat nam delectus velit ea cumque, aperiam facere enim! Corporis earum debitis aperiam?\n \n Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque, fugiat, nobis inventore cupiditate porro a non fugit maxime possimus repellendus officiis iusto blanditiis deserunt asperiores quia quod nemo adipisci dicta exercitationem sequi doloribus cum ipsum! Tempore quis, id praesentium accusamus, ea aut expedita quo atque neque dolore optio eum sed aliquam. Dignissimos velit earum tempora in recusandae cupiditate eligendi, aliquam est obcaecati corrupti eos odio exercitationem iste totam ipsum sequi! Fuga iure repudiandae impedit, illum corporis alias. Explicabo modi voluptatibus ipsum nisi omnis vel saepe rerum unde repellat nam delectus velit ea cumque, aperiam facere enim! Corporis earum debitis aperiam?',\n 'status' => 1,\n 'title' => 'Bantu Wan membeli Tupperwarenya yang hilang',\n 'assistedSubject' => 'Kehidupan Sosial',\n 'donationCollected' => 50000,\n 'donationTarget' => 42000,\n 'created_at' => Carbon::now()->format('Y-m-d'),\n 'bank' => 2,\n 'accountNumber' => \"18283681623\"\n ]\n );\n DB::table('donation')->insert(\n [\n 'category' => 7,\n 'deadline' => Carbon::create('2021', '04', '15')->format(\"Y-m-d\"),\n 'idCampaigner' => 13,\n 'photo' => 'images/donation/telorGulung.jpg',\n 'purpose' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque, fugiat, nobis inventore cupiditate porro a non fugit maxime possimus repellendus officiis iusto blanditiis deserunt asperiores quia quod nemo adipisci dicta exercitationem sequi doloribus cum ipsum! Tempore quis, id praesentium accusamus, ea aut expedita quo atque neque dolore optio eum sed aliquam. Dignissimos velit earum tempora in recusandae cupiditate eligendi, aliquam est obcaecati corrupti eos odio exercitationem iste totam ipsum sequi! Fuga iure repudiandae impedit, illum corporis alias. Explicabo modi voluptatibus ipsum nisi omnis vel saepe rerum unde repellat nam delectus velit ea cumque, aperiam facere enim! Corporis earum debitis aperiam?\n \n Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque, fugiat, nobis inventore cupiditate porro a non fugit maxime possimus repellendus officiis iusto blanditiis deserunt asperiores quia quod nemo adipisci dicta exercitationem sequi doloribus cum ipsum! Tempore quis, id praesentium accusamus, ea aut expedita quo atque neque dolore optio eum sed aliquam. Dignissimos velit earum tempora in recusandae cupiditate eligendi, aliquam est obcaecati corrupti eos odio exercitationem iste totam ipsum sequi! Fuga iure repudiandae impedit, illum corporis alias. Explicabo modi voluptatibus ipsum nisi omnis vel saepe rerum unde repellat nam delectus velit ea cumque, aperiam facere enim! Corporis earum debitis aperiam?',\n 'status' => 1,\n 'title' => 'Bantu Pak Udil membangun usaha telor gulung',\n 'assistedSubject' => 'Pekerjaan',\n 'donationCollected' => 5000000,\n 'donationTarget' => 1250000,\n 'created_at' => Carbon::now()->format('Y-m-d'),\n 'bank' => 3,\n 'accountNumber' => \"2876201623\"\n ]\n );\n DB::table('donation')->insert(\n [\n 'category' => 1,\n 'deadline' => Carbon::create('2021', '03', '24')->format(\"Y-m-d\"),\n 'idCampaigner' => 11,\n 'photo' => 'images/donation/androidStudio.png',\n 'purpose' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque, fugiat, nobis inventore cupiditate porro a non fugit maxime possimus repellendus officiis iusto blanditiis deserunt asperiores quia quod nemo adipisci dicta exercitationem sequi doloribus cum ipsum! Tempore quis, id praesentium accusamus, ea aut expedita quo atque neque dolore optio eum sed aliquam. Dignissimos velit earum tempora in recusandae cupiditate eligendi, aliquam est obcaecati corrupti eos odio exercitationem iste totam ipsum sequi! Fuga iure repudiandae impedit, illum corporis alias. Explicabo modi voluptatibus ipsum nisi omnis vel saepe rerum unde repellat nam delectus velit ea cumque, aperiam facere enim! Corporis earum debitis aperiam?\n \n Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque, fugiat, nobis inventore cupiditate porro a non fugit maxime possimus repellendus officiis iusto blanditiis deserunt asperiores quia quod nemo adipisci dicta exercitationem sequi doloribus cum ipsum! Tempore quis, id praesentium accusamus, ea aut expedita quo atque neque dolore optio eum sed aliquam. Dignissimos velit earum tempora in recusandae cupiditate eligendi, aliquam est obcaecati corrupti eos odio exercitationem iste totam ipsum sequi! Fuga iure repudiandae impedit, illum corporis alias. Explicabo modi voluptatibus ipsum nisi omnis vel saepe rerum unde repellat nam delectus velit ea cumque, aperiam facere enim! Corporis earum debitis aperiam?',\n 'status' => 2,\n 'title' => 'Bantu Bokir membeli RAM untuk mengerjakan Tugas Android',\n 'assistedSubject' => 'Mahasiswa',\n 'donationCollected' => 750000,\n 'donationTarget' => 750000,\n 'created_at' => Carbon::create('2021', '03', '15')->format(\"Y-m-d\"),\n 'bank' => 4,\n 'accountNumber' => \"112233445566\"\n ]\n );\n DB::table('donation')->insert(\n [\n 'category' => 5,\n 'deadline' => Carbon::create('2021', '03', '26')->format(\"Y-m-d\"),\n 'idCampaigner' => 10,\n 'photo' => 'images/donation/hpTiktok.jpg',\n 'purpose' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque, fugiat, nobis inventore cupiditate porro a non fugit maxime possimus repellendus officiis iusto blanditiis deserunt asperiores quia quod nemo adipisci dicta exercitationem sequi doloribus cum ipsum! Tempore quis, id praesentium accusamus, ea aut expedita quo atque neque dolore optio eum sed aliquam. Dignissimos velit earum tempora in recusandae cupiditate eligendi, aliquam est obcaecati corrupti eos odio exercitationem iste totam ipsum sequi! Fuga iure repudiandae impedit, illum corporis alias. Explicabo modi voluptatibus ipsum nisi omnis vel saepe rerum unde repellat nam delectus velit ea cumque, aperiam facere enim! Corporis earum debitis aperiam?\n \n Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque, fugiat, nobis inventore cupiditate porro a non fugit maxime possimus repellendus officiis iusto blanditiis deserunt asperiores quia quod nemo adipisci dicta exercitationem sequi doloribus cum ipsum! Tempore quis, id praesentium accusamus, ea aut expedita quo atque neque dolore optio eum sed aliquam. Dignissimos velit earum tempora in recusandae cupiditate eligendi, aliquam est obcaecati corrupti eos odio exercitationem iste totam ipsum sequi! Fuga iure repudiandae impedit, illum corporis alias. Explicabo modi voluptatibus ipsum nisi omnis vel saepe rerum unde repellat nam delectus velit ea cumque, aperiam facere enim! Corporis earum debitis aperiam?',\n 'status' => 2,\n 'title' => 'Bantu Bu Yanti membeli HP untuk bermain TikTok',\n 'assistedSubject' => 'Pekerjaan',\n 'donationCollected' => 2500000,\n 'donationTarget' => 2500000,\n 'created_at' => Carbon::create('2021', '03', '17')->format(\"Y-m-d\"),\n 'bank' => 1,\n 'accountNumber' => \"0972289566\"\n ]\n );\n DB::table('donation')->insert(\n [\n 'category' => 13,\n 'deadline' => Carbon::create('2021', '04', '06')->format(\"Y-m-d\"),\n 'idCampaigner' => 12,\n 'photo' => 'images/donation/gereja.jpg',\n 'purpose' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque, fugiat, nobis inventore cupiditate porro a non fugit maxime possimus repellendus officiis iusto blanditiis deserunt asperiores quia quod nemo adipisci dicta exercitationem sequi doloribus cum ipsum! Tempore quis, id praesentium accusamus, ea aut expedita quo atque neque dolore optio eum sed aliquam. Dignissimos velit earum tempora in recusandae cupiditate eligendi, aliquam est obcaecati corrupti eos odio exercitationem iste totam ipsum sequi! Fuga iure repudiandae impedit, illum corporis alias. Explicabo modi voluptatibus ipsum nisi omnis vel saepe rerum unde repellat nam delectus velit ea cumque, aperiam facere enim! Corporis earum debitis aperiam?\n \n Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque, fugiat, nobis inventore cupiditate porro a non fugit maxime possimus repellendus officiis iusto blanditiis deserunt asperiores quia quod nemo adipisci dicta exercitationem sequi doloribus cum ipsum! Tempore quis, id praesentium accusamus, ea aut expedita quo atque neque dolore optio eum sed aliquam. Dignissimos velit earum tempora in recusandae cupiditate eligendi, aliquam est obcaecati corrupti eos odio exercitationem iste totam ipsum sequi! Fuga iure repudiandae impedit, illum corporis alias. Explicabo modi voluptatibus ipsum nisi omnis vel saepe rerum unde repellat nam delectus velit ea cumque, aperiam facere enim! Corporis earum debitis aperiam?',\n 'status' => 3,\n 'title' => 'Bantu Pembangunan rumah Ibadah di Makasar',\n 'assistedSubject' => 'Rumah Ibadah',\n 'donationCollected' => 800000000,\n 'donationTarget' => 800000000,\n 'created_at' => Carbon::create('2021', '03', '17')->format(\"Y-m-d\"),\n 'bank' => 3,\n 'accountNumber' => \"09876281\"\n ]\n );\n DB::table('donation')->insert(\n [\n 'category' => 3,\n 'deadline' => Carbon::create('2021', '03', '30')->format(\"Y-m-d\"),\n 'idCampaigner' => 11,\n 'photo' => 'images/donation/gereja.jpg',\n 'purpose' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque, fugiat, nobis inventore cupiditate porro a non fugit maxime possimus repellendus officiis iusto blanditiis deserunt asperiores quia quod nemo adipisci dicta exercitationem sequi doloribus cum ipsum! Tempore quis, id praesentium accusamus, ea aut expedita quo atque neque dolore optio eum sed aliquam. Dignissimos velit earum tempora in recusandae cupiditate eligendi, aliquam est obcaecati corrupti eos odio exercitationem iste totam ipsum sequi! Fuga iure repudiandae impedit, illum corporis alias. Explicabo modi voluptatibus ipsum nisi omnis vel saepe rerum unde repellat nam delectus velit ea cumque, aperiam facere enim! Corporis earum debitis aperiam?\n \n Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque, fugiat, nobis inventore cupiditate porro a non fugit maxime possimus repellendus officiis iusto blanditiis deserunt asperiores quia quod nemo adipisci dicta exercitationem sequi doloribus cum ipsum! Tempore quis, id praesentium accusamus, ea aut expedita quo atque neque dolore optio eum sed aliquam. Dignissimos velit earum tempora in recusandae cupiditate eligendi, aliquam est obcaecati corrupti eos odio exercitationem iste totam ipsum sequi! Fuga iure repudiandae impedit, illum corporis alias. Explicabo modi voluptatibus ipsum nisi omnis vel saepe rerum unde repellat nam delectus velit ea cumque, aperiam facere enim! Corporis earum debitis aperiam?',\n 'status' => 3,\n 'title' => 'Bantu Tatang Berobat',\n 'assistedSubject' => 'Difabel',\n 'donationCollected' => 15000000,\n 'donationTarget' => 15000000,\n 'created_at' => Carbon::create('2021', '03', '20')->format(\"Y-m-d\"),\n 'bank' => 3,\n 'accountNumber' => \"55674298312\"\n ]\n );\n DB::table('donation')->insert(\n [\n 'category' => 5,\n 'deadline' => Carbon::create('2021', '04', '10')->format(\"Y-m-d\"),\n 'idCampaigner' => 12,\n 'photo' => 'images/donation/keyboard.jpg',\n 'purpose' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque, fugiat, nobis inventore cupiditate porro a non fugit maxime possimus repellendus officiis iusto blanditiis deserunt asperiores quia quod nemo adipisci dicta exercitationem sequi doloribus cum ipsum! Tempore quis, id praesentium accusamus, ea aut expedita quo atque neque dolore optio eum sed aliquam. Dignissimos velit earum tempora in recusandae cupiditate eligendi, aliquam est obcaecati corrupti eos odio exercitationem iste totam ipsum sequi! Fuga iure repudiandae impedit, illum corporis alias. Explicabo modi voluptatibus ipsum nisi omnis vel saepe rerum unde repellat nam delectus velit ea cumque, aperiam facere enim! Corporis earum debitis aperiam?\n \n Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque, fugiat, nobis inventore cupiditate porro a non fugit maxime possimus repellendus officiis iusto blanditiis deserunt asperiores quia quod nemo adipisci dicta exercitationem sequi doloribus cum ipsum! Tempore quis, id praesentium accusamus, ea aut expedita quo atque neque dolore optio eum sed aliquam. Dignissimos velit earum tempora in recusandae cupiditate eligendi, aliquam est obcaecati corrupti eos odio exercitationem iste totam ipsum sequi! Fuga iure repudiandae impedit, illum corporis alias. Explicabo modi voluptatibus ipsum nisi omnis vel saepe rerum unde repellat nam delectus velit ea cumque, aperiam facere enim! Corporis earum debitis aperiam?',\n 'status' => 4,\n 'title' => 'Bantu Hizkia Membeli Keyboard',\n 'assistedSubject' => 'Hardware',\n 'donationCollected' => 1500000,\n 'donationTarget' => 1500000,\n 'created_at' => Carbon::create('2021', '03', '30')->format(\"Y-m-d\"),\n 'bank' => 2,\n 'accountNumber' => \"332086539123\"\n ]\n );\n }",
"function register_affiliate($post) {\n\textract($post);\n\tif ( filter_var( $userEmailTxt, FILTER_VALIDATE_EMAIL ) ) {\n\t\t$dup_check = \"SELECT * FROM register_users WHERE email = '\" . mysql_real_escape_string($userEmailTxt) . \"' AND is_affiliate = 1\";\n\t\t$res = mysql_query($dup_check);\n\t\tif (mysql_num_rows($res) > 0)\n\t\t\treturn false;\n\t\n\t\t$sql = \"\n\t\t\tINSERT INTO register_users SET \n\t\t\tu_name = '\" . mysql_real_escape_string($fName_txt) . ' ' . mysql_real_escape_string($lName_txt) . \"' , \n\t\t\temail = '\" . mysql_real_escape_string($userEmailTxt) . \"' , \n\t\t\t`password`= MD5('\" . mysql_real_escape_string($password) . \"'), \n\t\t\tis_affiliate='1'\n\t\t\";\n\t\tif (mysql_query($sql)) {\n\t\t\t$user_id = mysql_insert_id();\n\t\t\t$sql_profile = \"INSERT INTO affiliate_account SET user_id = '\" . $user_id . \"', balance = 0.00, last_modified = NOW()\";\n\t\t\tmysql_query($sql_profile);\n\t\t\tsendEmail($userEmailTxt, 'Send With Style - Affiliate Program Joining', \"<b>Dear \" . $fName_txt . ' ' . $lName_txt . \",</b><br><br>We welcome you to Send With Style Affiliate program. This will allow you to market your own affiliate link to our website on different portals or email campaigns. This will let you make more and more money on each registration , impressions, sale. Further you could visit details on <a href='http://www.designsoftstudios.net/demo22/custom_projects/invitation_card/index.php?p=affiliate'>our affiliate page</a>.<br><br>Your account is ready to use please login here to access your affiliate account:<a href='http://www.designsoftstudios.net/demo22/custom_projects/invitation_card/index.php?p=affiliate&action=login'>http://www.designsoftstudios.net/demo22/custom_projects/invitation_card/index.php?p=affiliate&action=login</a><br><br>For any further queries please feel free to contact Send With Style support team.<br><br>Thanks!<br>Send With Style Team\");\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t} else {\n\t\treturn false;\n\t}\n\n}",
"function insertActors($link, $movieId, $actors) {\n $server=\"localhost\";\n $dbuser=\"root\";\n $password=\"\";\n $link=mysqli_connect($server,$dbuser,$password);\n mysqli_select_db($link, \"moviereview\");\n $actorsArray = explode(',', $actors);\n \n //Delete any existing movie_actor records for this movie before inserting the new records\n $sql_insert=\"call sp_ResetMovieActor($movieId)\";\n\n foreach($actorsArray as $actor){\n $sql_insert=\"call sp_InsertMovieActor($movieId, $actor)\";\n if(!mysqli_query($link, $sql_insert))\n {\n echo json_encode(\"Actor insert errors: \".mysqli_error($link));\n }\n }\n\n mysqli_close($link);\n }",
"public function insert($dbHandler,$accId,$firstName,$lastName,$email,$password,$picture,$upic){\n\n\t\t//This is the Query//\n\n\t\tmysqli_query($dbHandler,\"INSERT INTO `scattr_users` (`AccId`,`FirstName`,`LastName`, `Email`,`Password`,`Picture`,`UPic`) VALUES ('$accId','$firstName','$lastName','$email','$password','$picture','$upic');\");\n\t\n\t}",
"function achieve($aID, $sID, $testCase, $justification) {\n //Establish DB connection\n $con = mysqli_connect(\"localhost\", \"root\"); //Create DB connection\n mysqli_select_db($con, \"automatedtestsuite\");\n \n if(!mysqli_query($con, \"INSERT INTO activityanswers VALUES ('$aID', '$sID', '$testCase', '$justification')\")) {\n echo \"Error occured creating test case: \" . mysqli_error($con); \n }\n }",
"public function insert()\n {\n $db = Db::getDb();\n $db->insert(\n 'dcd_callback',\n [\n 'boxId' => $this->getBoxId(),\n 'totalAmount' => $this->getTotalAmount(),\n 'successAmount' => $this->getSuccessAmount(),\n 'errorAmount' => $this->getErrorAmount(),\n 'dateTime' => date('Y-m-d H:i:s'),\n ]\n );\n }",
"public function run()\n {\n DB::table('accounts')->insert(\n [\n [\n 'remaining_amount',\n 'disburse_amount',\n 'branch_id',\n 'borrower_id',\n 'disbursed_by',\n ]\n \n ]\n \n );\n }",
"private function insert() {\n // use prepared statements\n // save an insert id\n }",
"private function v26_upgrade() {\n\t\taffiliate_wp()->affiliates->coupons->create_table();\n\t\t@affiliate_wp()->utils->log( 'Upgrade: The coupons table has been created.' );\n\n\t\t// Enable the affiliate coupons setting (will not cause unexpected behavior).\n\t\t@affiliate_wp()->settings->set( array(\n\t\t\t'affiliate_coupons' => true,\n\t\t), $save = true );\n\n\t\t$this->upgraded = true;\n\t}"
] | [
"0.55511594",
"0.5392151",
"0.5350918",
"0.52977276",
"0.52771986",
"0.52392733",
"0.51942366",
"0.51215595",
"0.5088332",
"0.50717986",
"0.50546175",
"0.5033817",
"0.50208014",
"0.50195557",
"0.5010664",
"0.5004879",
"0.5004821",
"0.49785328",
"0.4976443",
"0.49758643",
"0.49736854",
"0.49608693",
"0.4953884",
"0.49287575",
"0.49263763",
"0.4925662",
"0.49155083",
"0.48983377",
"0.48837814",
"0.48482266"
] | 0.5507792 | 1 |
Updates the applicant table. | public function updateApplicantQuery($apl,$ap_id){
$date = date("Y-m-d G:i:s");
$query = 'UPDATE application AS apl SET
apl.age = '.$apl->age.',
apl.city = "'.$apl->city.'",
apl.date_modified = "'.$date.'",
apl.legal_id_state = "'.$apl->legal_id_state.'",
apl.name_first = "'.$apl->name_first.'",
apl.name_last = "'.$apl->name_last.'",
apl.residence_start_date = "'.date("Y-m-d",strtotime($apl->residence_start_date)).'",
apl.state = "'.$apl->state.'",
apl.county = "'.$apl->county.'",
apl.street = "'.$apl->street.'",
apl.unit = "'.$apl->unit.'",
apl.zip_code = "'.$apl->zip_code.'",
apl.tenancy_type = "'.$apl->tenancy_type.'",
apl.modifying_agent_id = '.$apl->modifying_agent_id.',
apl.ssn = "'.$apl->ssn.'",
apl.dob = "'.$apl->date_of_birth.'",
apl.ssn_last_four = "'.substr($apl->ssn,-4).'",
apl.legal_id_number = "'.$apl->legal_id_number.'"
WHERE application_id ='.$ap_id.';';
$result = $this->db->query($query);
return($result->rowCount());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update()\n {\n // run the update SQL script to update alter existing tables and create existing ones\n \n // update existing users to add affiliate id\n \n // return back();\n }",
"public function update(ApplicantRequest $request, Applicant $applicant)\n {\n //$applicant->update($request->all());\n $applicant->update($request->except('majors'));\n\n $applicantMajorIds = [];\n foreach ($applicant['majors'] as $item){\n $applicantMajorIds[] = $item['id'];\n }\n\n //print_r($applicantMajorIds);\n\n\n // $applicant->majors()->findOrFail($majors)\n\n $majors = explode(\",\", $request['majors']);\n foreach ($majors as $id) {\n if ($id >= 0 ) {\n $majors = Major::findOrFail($id);\n\n if(in_array($id, $applicantMajorIds))\n $applicant->majors()->detach($majors);\n $applicant->majors()->attach($majors);\n }\n }\n\n }",
"public function UpdateApplication() {\r\n\t\tglobal $pdo;\r\n\r\n\t\t$id = (isset($_POST['id'])) ? $_POST['id'] : null;\r\n\t\t$status = (isset($_POST['status'])) ? $_POST['status'] : null;\r\n\t\t$comment = (isset($_POST['comment'])) ? $_POST['comment'] : null;\r\n\r\n\t\tif (!Permissions::init()->hasPermission(\"VIEW_SLT\")) {\r\n\t\t\tHelpers::addAuditLog(\"AUTHENTICATION_FAILED::{$_SERVER['REMOTE_ADDR']} Triggered An Unauthenticated Response In `StaffController::UpdateApplication`\");\r\n\t\t\techo Helpers::NewAPIResponse([\"message\" => \"Unauthorised\", \"success\" => false]);\r\n\t\t\texit;\r\n\t\t}\r\n\r\n\t\t$stmt = $pdo->prepare(\"UPDATE staff_applications SET status = :status, comment = :comment WHERE id = :id\");\r\n\t\t$stmt->bindValue(':status', $status);\r\n\t\t$stmt->bindValue(':comment', $comment);\r\n\t\t$stmt->bindValue(':id', $id);\r\n\t\t$db_call = $stmt->execute();\r\n\r\n\t\tif (!$db_call) {\r\n\t\t\techo Helpers::NewAPIResponse([\"message\" => \"Failed to update application\", \"success\" => false]);\r\n\t\t\texit;\r\n\t\t}\r\n\r\n\t\techo Helpers::NewAPIResponse([\"message\" => \"success\", \"success\" => true]);\r\n\t}",
"function editApplicant() {\r\n global $dbh,\r\n $applicant_id,\r\n $first_name,\r\n $middle_name,\r\n $last_name,\r\n $ssn,\r\n $date_of_birth,\r\n $pri_phone,\r\n $address_line_one,\r\n $city_name,\r\n $state_cd,\r\n $postal_cd,\r\n $agreement_sw,\r\n $page_title;\r\n $sql = <<<HereDoc\r\nselect\r\n applicant_id,\r\n first_name,\r\n middle_name,\r\n last_name,\r\n ssn,\r\n date_of_birth,\r\n pri_phone,\r\n address_line_one,\r\n city_name,\r\n state_cd,\r\n postal_cd,\r\n agreement_sw\r\nfrom applicants\r\nwhere email_id='$email_id'\r\nHereDoc;\r\n if ( !$sth = mysqli_query($dbh,$sql) ) {\r\n $message= mysqli_error($dbh);\r\n echo <<<HereDoc\r\n <div class=\"alert alert-warning\"> $message </div>\r\nHereDoc;\r\n return;\r\n }\r\n if ( mysqli_num_rows($sth) > 0 ) {\r\n while ($row = mysqli_fetch_array($sth)) {\r\n foreach( $row AS $key => $val ) {\r\n $$key = stripslashes($val);\r\n }\r\n }\r\n }\r\n header(\"Location: /job_app/forms/applicant_form.php?edit=edit\");\r\n}",
"public function migrate_applicants() {\t\t\n\t\t$db = Helium::db();\n\n\t\t// Limit to unmigrated applicants only\n\t\t$this->require_role('national_admin');\n\t\t\n\t\t$query = \"INSERT INTO participants (applicant_id) SELECT applicant_id FROM applicants WHERE finalized=1 AND applicant_id NOT IN (SELECT applicant_id FROM participants)\";\n\t}",
"public function update(AdminAppointmentRequest $request, AdminAppointmentModel $admin_appointment_show)\n {\n // echo \"update called\";\n $admin_appointment_show->update($request->all());\n return redirect()->route('admin_appointment_show.index')->with(\"message\",\"Updated Successfully!\");\n }",
"public function updateApplicationQuery($app){\n\t\t$date = date(\"Y-m-d G:i:s\");\n\t\t$query = 'UPDATE application AS ap\n\t\t\tSET \n\t\t\t\tap.apr = '.$app->apr.',\n\t\t\t\tap.customer_id = '.$app->customer_id.',\n\t\t\t\tap.cfe_rule_set_id = '.$app->cfe_ruleset_id.',\n\t\t\t\tap.date_first_payment = \"'.date(\"Y-m-d\",strtotime($app->date_first_payment)).'\",\n\t\t\t\tap.date_fund_actual = \"'.date(\"Y-m-d\",strtotime($app->date_fund_actual)).'\",\n\t\t\t\tap.date_fund_estimated = \"'.date(\"Y-m-d\",strtotime($app->date_fund_estimated)).'\",\n\t\t\t\tap.date_next_contact = \"'.date(\"Y-m-d\",strtotime($app->date_next_contact)).'\",\n\t\t\t\tap.finance_charge = '.$app->finance_charge.',\n\t\t\t\tap.fund_actual = '.$app->fund_actual.',\n\t\t\t\tap.fund_qualified = '.$app->fund_qualified.',\n\t\t\t\tap.fund_requested = '.$app->fund_requested.',\n\t\t\t\tap.is_watched = \"'.$app->is_watched.'\",\n\t\t\t\tap.payment_total = '.$app->payment_total.',\n\t\t\t\tap.rule_set_id = '.$app->rule_set_id.',\n\t\t\t\tap.date_modified = \"'.$date.'\",\n\t\t\t\tap.call_time_pref = \"'.$app->call_time_pref.'\",\n\t\t\t\tap.contact_method_pref = \"'.$app->contact_method_pref.'\",\n\t\t\t\tap.marketing_contact_pref = \"'.$app->marketing_contact_pref.'\",\n\t\t\t\tap.esig_ip_address = \"'.$app->esig_ip_address.'\",\n\t\t\t\tap.modifying_agent_id = '.$app->modifying_agent_id.'\n\t\t\tWHERE ap.application_id ='.$app->application_id.';';\n\t\t$result = $this->db->query($query);\n\t\treturn($result->rowCount());\n\t}",
"public function update($id)\n\t{\n\t\t// Application Log\n\t\t\t$application = Application::findOrFail($id);\n\t\t\t$prev_action = ApplicationLog::where('application_id','=',$id)->orderBy('action_datetime','desc');\n\t\t\tif($prev_action->count() > 0){\n\t\t\t\t$prev_action = $prev_action->first();\n\t\t\t}else{\n\t\t\t\t$prev_action = NULL;\n\t\t\t}\n\t\t\t$timestamp = Carbon::now();\n\t\t\t$visit_number = 1;\n\t\t\tif(is_null($prev_action)){\n\t\t\t\t$prev_action_datetime = 0;\n\t\t\t}else{\n\t\t\t\t$prev_action_datetime = $prev_action->action_datetime;\n\t\t\t}\n\t\t\tDB::table('application_logs')->insert(array(\n\t\t\t\t\t\t\t'action_type' => 5,\n\t\t\t\t\t\t\t'application_id' => $application->application_id,\n\t\t\t\t\t\t\t'visit_number' => $visit_number,\n\t\t\t\t\t\t\t'employee_user_id' => Employee::first()->user_id,\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\tchange 'employee_user_id' to real employee id\n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t'action_datetime' => $timestamp,\n\t\t\t\t\t\t\t'prev_action_datetime' => $prev_action_datetime,\n\t\t\t\t\t\t\t'result' => Input::get('approve'),\n\t\t\t\t\t\t\t'note' => Input::get('note')\n\t\t\t));\n\t\t$application->current_salary = Input::get('current_salary');\n\t\t$application->expected_salary = Input::get('expected_salary');\n\t\t$application->position_salary = Input::get('position_salary');\n\t\t$application->final_salary = Input::get('final_salary');\n\t\t$application->cola = Input::get('cola');\n\t\t$application->application_current_status_id = Input::get('approve')?6:9;\n\t\t$application->note = Input::get('note');\n\t\t$application->save();\n\n\t\t/*$application->intOffSchedule()->whereAppCsId(4)->whereVisitNumber($visit_number)->delete();\n\t\tDB::table('int_off_schedules')->insert(array(\n\t\t\t\t\t\t'app_cs_id' => 4,\n\t\t\t\t\t\t'visit_number' => $visit_number,\n\t\t\t\t\t\t'application_id' => $application->application_id,\n\t\t\t\t\t\t'datetime' => Input::get('date_time'),\n\t\t\t\t\t\t'location' => Input::get('location')\n\t\t));*/\n\n\t\t// return Response::json(array('success' => true));\n\t\t$applications = Requisition::find($id)->application()->whereApplicationCurrentStatusId(5)->get();\n\t\treturn View::make('recruiter.offering.package.show', compact('applications'))->with('requisition_id',$application->requisition_id);\n\t\n\t}",
"public function update($assessmentAiclassifier);",
"function jsonUpdateApplicant() {\n\t\tif (Request::ajax())\n\t\t{\n\t\t $id = Input::get('id');\n\t\t $status = Input::get('status');\n\n\t\t $decoded_json_id = json_decode($id);\n\n\n\t\t // Get all data of all the ids in the array\n\t\t if (count($decoded_json_id) > 0) {\n\n\t\t \tif ($status == 'hire') {\n\t\t \t\t$date_hired = Input::get('date_hired');\n\n\t\t \t\tforeach ($decoded_json_id as $id) {\n\n\t\t \t\t\t$employee_work_id = $this->applicants->generate_work_id(2317);\n\n\t\t \t\t\t$data = $this->applicants->find($id, 'id')->update(['employment_status' => 'active',\n\t\t \t\t\t 'membership_status' => 'associate',\n\t\t \t\t\t 'date_hired' => $date_hired,\n\t\t \t\t\t 'employee_work_id' => $employee_work_id]);\t\n\t\t \t\t}\n\t\t \t\t\n\t\t \t} else {\n\t\t \t\t$data = $this->applicants->findWhereIn('id', $decoded_json_id, ['position'])->update(['employment_status' => $status]);\n\t\t \t}\n\t\t \t\n\t\t \t return Response::json($data);\n\t\t }\n\n\t\t \n\t\t}\n\t}",
"public function index()\n {\n $inputs = request()->all();\n $id = $inputs['id'];\n $count=0;\n// echo \"select count(distinct la_serial_id) as count from loan_applications where\n// la_serial_no='\" . date(\"dmY\") . \"' group by la_serial_id\";\n $applicant_count = LoanApplication::selectRaw(\"count(distinct la_serial_id) as count\")\n ->whereRaw(\"la_serial_no='\" . date(\"dmY\") . \"'\")\n ->get()\n ->groupBy(\"la_serial_id\")->first();\n $count = (int)$applicant_count[0][\"count\"];\n\n $la_applicant = LoanApplication::where(\"la_applicant_id\",'=',$id)->first();\n\n if($la_applicant->la_serial_no==null){\n $count=$count + 1;\n $la_applicant = LoanApplication::where(\"la_applicant_id\",'=',$id)->get();\n foreach ($la_applicant as $applicant) {\n $applicant->la_serial_no = date(\"dmY\");\n $applicant->la_serial_id = $count;\n $applicant->user_id = Auth::id();\n $applicant->save();\n }\n } else {\n $la_applicant_update = LoanApplication::where(\"la_applicant_id\", '=', $id)\n ->get();\n foreach ($la_applicant_update as $applicant) {\n $applicant->la_serial_no = $la_applicant->la_serial_no;\n $applicant->la_serial_id = $la_applicant->la_serial_id;\n $applicant->user_id = Auth::id();\n $applicant->save();\n }\n }\n\n\n\n $la_applicant = LoanApplication::where(\"la_applicant_id\",'=',$id)->first();\n\n $arr[\"la_serial_no\"] = $la_applicant->la_serial_no;\n $arr[\"la_serial_id\"] = $la_applicant->la_serial_id;\n $arr[\"loan_application\"] = $la_applicant;\n $arr[\"applicant\"] = ApplicantData::find($id);\n $arr[\"applicants\"] = ApplicantData::selectRaw(\"distinct applicant_data.id,name,applicant_approved\")\n ->leftjoin('loan_applications', function ($join) use ($la_applicant) {\n $join->on(\"applicant_data.id\", \"=\", 'loan_applications.applicant_id')\n ->whereRaw(\"la_serial_no = '\" . $la_applicant->la_serial_no . \"' and la_serial_id = '\" . $la_applicant->la_serial_id . \"'\");\n })\n ->whereRaw(\n \"(\n (applicant_data.id = $id)\n OR\n (applicant_data.id in \n (select applicant_id from loan_applications where la_applicant_id=\" . $id . \" \n and la_serial_no = '\" . $la_applicant->la_serial_no . \"' and la_serial_id = '\" . $la_applicant->la_serial_id . \"'))\n )\n \n OR\n (\n applicant_data.id in\n (\n select applicant_id from loan_applications where la_applicant_id in\n (\n select applicant_data.id from applicant_data where\n (\n (applicant_data.id = $id)\n OR\n (applicant_data.id in (select applicant_id from loan_applications where la_applicant_id=\" . $id . \" and la_serial_no = '\" . $la_applicant->la_serial_no . \"' and la_serial_id = '\" . $la_applicant->la_serial_id . \"'))\n )\n ) and la_serial_no = '\" . $la_applicant->la_serial_no . \"' and la_serial_id = '\" . $la_applicant->la_serial_id . \"'\n )\n )\n \n and applicant_data.user_id='\" . Auth::id() . \"'\")->get();\n\n\n $arr[\"capacity_data\"] = AASource::where(\"type\", \"facility_type\")->get();\n $arr[\"facilities\"] = FacilityInfo::whereRaw(\"\n status='new_facility' and \n applicant_id=\" . $id . \" and \".\n \"la_id='\". $arr[\"la_serial_no\"] . \"_\".$arr[\"la_serial_id\"].\"'\")\n ->get();\n\n\n\n\n return view(\"uploader.index\")->with($arr);\n }",
"public function fnupdapplicantTabDetails($id,$tabvalue) {\n $lobjDbAdpt = Zend_Db_Table::getDefaultAdapter();\n $formData['tab_value'] = $tabvalue;\n $where = 'IdApplicant = ' . $id;\n $lobjDbAdpt->update('tbl_applicant', $formData, $where);\n }",
"public function applicant()\n {\n return $this->belongsTo(Applicant::class);\n }",
"public function update(UpdateApplicationRequest $request, $id)\n\t{\n\t\tif (! is_null($request->get('recommendation_level'))){\n\t\t\t$values = $request->only('recommendation_level');\n\n\t\t\t$application = Application::find($id);\n\n\t\t\tif (!$application){\n\t\t\t\tResponse::json(['message' => 'Application not found']);\n\t\t\t}\n\n\t\t\t$application->recommendation_level = $request->get('recommendation_level');\n\t\t\t$application->save();\n\n\n\t\t\treturn Response::json([\n\t\t\t\t'message' => 'Application Updated', \n\t\t\t\t'new_rec_level' => $request->get('recommendation_level')\n\t\t\t\t], 200);\n\t\t}\n\t\telse {\n\t\t\t$application = Application::find($id);\n\n\t\t\tif (!$application){\n\t\t\t\tResponse::json(['message' => 'Application not found']);\n\t\t\t}\n\n\t\t\t$application->semester = $request->get('selected_semester');\n\t\t\t$application->year = $request->get('selected_year');\n\t\t\t$application->uid = $request->get('student_uid');\n\t\t\t$application->student_type = $request->get('selected_student_type');\n\t\t\t$application->requested_course = $request->get('selected_course');\n\t\t\t$application->additional_details = $request->get('addit_info');\n\t\t\t$application->international_student = $request->get('intl_student');\n\t\t\t$application->origin_country = $request->get('country_origin');\n\t\t\t$application->save();\n\n\t\t\treturn Response::json([\n\t\t\t\t'message' => 'Application Updated',\t\t\t\t\n\t\t\t], 200);\n\t\t}\n\t}",
"public function applicant()\n {\n return $this->belongsTo('App\\Models\\Applicant', 'applicant_id');\n }",
"function editApplication($name, $gender, $number, $town, $occupation, $contactname, $contactnumber, $location, $project, $application_id, $landuse_id) {\n $query = \"UPDATE applications SET name = ?,gender = ?,phoneno = ?,town = ?, occupation = ?,contactname = ?,contactnumber = ?,location = ?,project_type = ?, WHERE applicationid = ?\";\n $paramType = \"sssssssssi\";\n $paramValue = array(\n strtoupper($name),\n $gender,\n $number,\n ucwords($town),\n ucwords($occupation),\n strtoupper($contactname),\n $contactnumber,\n $location,\n strtoupper($project),\n $application_id\n );\n \n $this->db_handle->update($query, $paramType, $paramValue);\n }",
"function updateApp(){\n $applicationID = $_POST['applicationID'];\n $documentID = $_POST['documentID'];\n $statusUpdate = $_POST['statusUpdate'];\n $remarks = $_POST['remarks'];\n\n //check if there is matching application\n $sql = \"SELECT * FROM `application` WHERE applicationID = $applicationID\";\n $check = db_search($sql);\n\n\n if($check!=null){\n //update application status and remarks if no error\n $sql1 = \"UPDATE Application SET applicationStatus = '$statusUpdate', remarks = '$remarks' WHERE applicationID = '$applicationID' AND documentID_fk = '$documentID'\";\n $queryUpdate = db_result($sql1);\n if($queryUpdate==null){\n echo '<script> alert(\"Error occur! Please retry again!\")</script>';\n echo \"<script> window.location.assign('Application.php'); </script>\";\n }else{\n $accepted = 'ACCEPTED';\n //To check if the status is chosen as 'ACCEPTED'\n if(strcmp($statusUpdate, $accepted)==0){\n //reduce the available slots by 1 from the selected crisis trip\n $sql2 = \"UPDATE `crisistrip` SET `availableSlots`= availableSlots-1 WHERE cTID = (SELECT cTID_fk FROM application WHERE applicationID = $applicationID)\";\n $tripUpdate = db_result($sql2);\n if($tripUpdate == null){\n echo '<script> alert(\"Application status has been updated!\")</script>';\n echo '<script> alert(\"Error: Available slots is not deducted\")</script>';\n }else{\n echo '<script> alert(\"Application status has been updated!\")</script>';\n echo '<script> alert(\"Available slots have been updated!\")</script>';\n }\n echo \"<script> window.location.assign('Application.php'); </script>\";\n } else {\n echo '<script> alert(\"Application status has been updated!\")</script>';\n echo \"<script> window.location.assign('Application.php'); </script>\";\n }\n }\n }\n else{\n echo '<script> alert(\"This application does not exist!\")</script>';\n echo \"<script> window.location.assign('Application.php'); </script>\";\n }\n}",
"public function update(ApplicationRequest $request, $id)\n {\n try {\n $application = Applications::find($id);\n $application->lastname = $request->get('lastname') ?? '';\n $application->firstname = $request->get('firstname') ?? '';\n $application->lastname_kanji = $request->get('lastname_kanji') ?? ($request->get('lastname') ?? '');\n $application->firstname_kanji = $request->get('firstname_kanji') ?? ($request->get('firstname') ?? '');\n $application->lastname_furigana = $request->get('lastname_furigana') ?? ($request->get('lastname') ?? '');\n $application->firstname_furigana = $request->get('firstname_furigana') ?? ($request->get('firstname') ?? '');\n $application->home_phone = $request->get('home_phone');\n $application->mobile_phone = $request->get('mobile_phone');\n $application->levels = !empty($request->levels) ? implode(\",\",$request->levels) : '';\n \n $application->office_name = $request->office_name;\n $application->office_address = $request->office_address;\n $application->office_phone = $request->office_phone;\n $application->school_name = $request->school_name;\n $application->school_address = $request->school_address;\n $application->school_phone = $request->school_phone;\n \n if(!empty($request->get('address'))) {\n if($application->address != $request->get('address')) {\n $application->address = $request->get('address');\n }\n }\n if(!empty($request->get('join_date'))) {\n $application->join_date = $request->get('join_date');\n }\n\n if(!empty($request->get('birthday'))) { \n $application->birthday = $request->get('birthday');\n }\n\n if(!empty($request->get('toiawase_referral'))) {\n $application->toiawase_referral = $request->get('toiawase_referral');\n }\n if(!empty($request->get('toiawase_memo'))) {\n $application->toiawase_memo = $request->get('toiawase_memo');\n }\n $application->email = $request->get('email');\n \n $application->save();\n\n $custom_fields = CustomFields::where('data_model', 'Applications')->get();\n if ($custom_fields) {\n foreach ($custom_fields as $custom_field) {\n $field = CustomFieldValue::where('model_id', $application->id)->where('custom_field_id', $custom_field->id)->first();\n if ($field) {\n if ( !empty($request->{'custom_'.$custom_field->field_name}) ) {\n $field->field_value = $request->{'custom_'.$custom_field->field_name};\n $field->save();\n } else {\n $field->delete();\n }\n } else {\n if ( !empty($request->{'custom_'.$custom_field->field_name}) ) {\n CustomFieldValue::create([\n 'custom_field_id' => $custom_field->id,\n 'model_id' => $application->id,\n 'field_value' => $request->{'custom_'.$custom_field->field_name}\n ]);\n }\n }\n }\n }\n\n return redirect('/applications/'.$id)->with('success', __('messages.application-has-been-updated'));\n } catch (\\Exception $e) {\n return redirect()->back()->withInput()->with('error', $e->getMessage());\n }\n }",
"public function approveApplicant($id){\n return $this->securityDAO->approveApplicantDAO($id);\n }",
"public function update(User $user, Applicat $applicat)\n {\n //\n }",
"public function getApproveApp($id){\n $app = App::find($id);\n $app->status = 3;\n $app->update();\n return redirect('reviewer/view/app');\n }",
"public function store(Request $request)\n {\n try {\n $inputs = $request->all();\n $applicant_la = LoanApplication::find($inputs[\"id\"]);\n $applicant_la->update($inputs);\n echo \"success\";\n } catch (\\Exception $e) {\n\n echo $e->getMessage();\n }\n\n //print_r($applicant_la);\n }",
"public function postEdit(Request $request) {\n \n $this->validate(\n $request,\n [\n 'name' => 'required|min:2',\n 'acronym' => 'required|min:2',\n 'description' => 'required|min:4',\n ]\n );\n\n $app = \\App\\Application::find($request->id);\n $app->name = $request->name;\n $app->description = $request->description;\n $app->acronym = $request->acronym;\n\n $app->save();\n\n \\Session::flash('flash_message','Your application was updated.');\n\n return redirect('/applications/edit/'.$request->id);\n }",
"public function update($id)\n\t{\n\t\t$application = $this->apps->find($id);\n\n $input = Input::except('_token');\n\n if(!Input::has('IsOnlineApplication'))\n {\n $input['IsOnlineApplication'] = 0;\n }\n\n if(!input::has('show_in_list'))\n {\n $input['show_in_list'] = 0;\n }\n\n if($application->update($input))\n {\n return Redirect::back();\n }\n else\n {\n return Redirect::back()->with('errors', $application->getErrors())->withInput();\n }\n\n\n\n\t}",
"public function applicant()\n {\n $this->setPrefix('applicant');\n return $this;\n }",
"public function update(Request $request, Appoinment $appoinment)\n {\n //\n }",
"public function getTableName() {\n return 'applicant';\n }",
"public function userActivateByAdminApplicant($active)\n {\n $sql = \"UPDATE Applicant SET\n\t\t\t\t isActive=:isActive\n\t\t\t\t WHERE AppID = :id\";\n\n $stmt = $this->db->pdo->prepare($sql);\n $stmt->bindValue(':isActive', 0);\n $stmt->bindValue(':id', $active);\n $result = $stmt->execute();\n if ($result) {\n echo \"<script>location.href='ViewApplicantsAdmin.php';</script>\"; //\"<script>location.href='index.php';</script>\";\n Session::set('msg', '<div class=\"alert alert-success alert-dismissible mt-3\" id=\"flash-msg\">\n\t\t\t\t\t\t\t\t <a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">×</a>\n\t\t\t\t\t\t\t\t <strong>Success !</strong> User account Registered Successfully !</div>');\n } else {\n echo \"<script>location.href='ViewApplicantsAdmin.php';</script>\";\n Session::set('msg', '<div class=\"alert alert-danger alert-dismissible mt-3\" id=\"flash-msg\">\n\t\t\t\t\t\t\t\t <a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">×</a>\n\t\t\t\t\t\t\t\t <strong>Error !</strong> User Not Registered !</div>');\n }\n }",
"public function update_status_of_application($status, $application_id) {\n $application_details = $this->get_applications($application_id, 'application');\n if ($application_details->num_rows() > 0) {\n $application_details = $application_details->row_array();\n if ($status == 'approve') {\n $application_data['status'] = 1;\n $this->db->where('id', $application_id);\n $this->db->update('applications', $application_data);\n\n $instructor_data['is_instructor'] = 1;\n $this->db->where('id', $application_details['user_id']);\n $this->db->update('users', $instructor_data);\n\n $this->session->set_flashdata('flash_message', get_phrase('application_approved_successfully'));\n redirect(site_url('admin/instructor_application'), 'refresh');\n }else{\n $this->db->where('id', $application_id);\n $this->db->delete('applications');\n $this->session->set_flashdata('flash_message', get_phrase('application_deleted_successfully'));\n redirect(site_url('admin/instructor_application'), 'refresh');\n }\n }else{\n $this->session->set_flashdata('error_message', get_phrase('invalid_application'));\n redirect(site_url('admin/instructor_application'), 'refresh');\n }\n }",
"public function update(Request $request, $id){\n \n $escalation = Escalation::findOrFail($id);\n $escalation->application = $request->application;\n $escalation->support_ba = $request->support_ba;\n $escalation->support_clrk = $request->support_clrk;\n $escalation->site = $request->site;\n $escalation->prod_assignment = $request->prod_assignment;\n $escalation->comments = $request->comments;\n $escalation->save();\n\n return redirect()->route('escalation.show',$escalation)->with('update', 'Escalation was updated');;\n }"
] | [
"0.60933644",
"0.60378385",
"0.59539753",
"0.5788047",
"0.5766314",
"0.5666802",
"0.5655435",
"0.55815846",
"0.5572005",
"0.555256",
"0.5534502",
"0.5523489",
"0.54880327",
"0.5467899",
"0.54605454",
"0.545514",
"0.54317105",
"0.54032815",
"0.5402257",
"0.53945327",
"0.53883064",
"0.5380763",
"0.53661865",
"0.5333498",
"0.53304213",
"0.53253496",
"0.5305309",
"0.53044885",
"0.52878666",
"0.5282851"
] | 0.62579155 | 0 |
Updates the application related table. | public function updateApplicationQuery($app){
$date = date("Y-m-d G:i:s");
$query = 'UPDATE application AS ap
SET
ap.apr = '.$app->apr.',
ap.customer_id = '.$app->customer_id.',
ap.cfe_rule_set_id = '.$app->cfe_ruleset_id.',
ap.date_first_payment = "'.date("Y-m-d",strtotime($app->date_first_payment)).'",
ap.date_fund_actual = "'.date("Y-m-d",strtotime($app->date_fund_actual)).'",
ap.date_fund_estimated = "'.date("Y-m-d",strtotime($app->date_fund_estimated)).'",
ap.date_next_contact = "'.date("Y-m-d",strtotime($app->date_next_contact)).'",
ap.finance_charge = '.$app->finance_charge.',
ap.fund_actual = '.$app->fund_actual.',
ap.fund_qualified = '.$app->fund_qualified.',
ap.fund_requested = '.$app->fund_requested.',
ap.is_watched = "'.$app->is_watched.'",
ap.payment_total = '.$app->payment_total.',
ap.rule_set_id = '.$app->rule_set_id.',
ap.date_modified = "'.$date.'",
ap.call_time_pref = "'.$app->call_time_pref.'",
ap.contact_method_pref = "'.$app->contact_method_pref.'",
ap.marketing_contact_pref = "'.$app->marketing_contact_pref.'",
ap.esig_ip_address = "'.$app->esig_ip_address.'",
ap.modifying_agent_id = '.$app->modifying_agent_id.'
WHERE ap.application_id ='.$app->application_id.';';
$result = $this->db->query($query);
return($result->rowCount());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update()\n\t{\n\t\t$event = new stdClass();\n\t\t$event->type = self::EVENT_BEFORE_UPDATE;\n\t\t$this->notifyObservers($event);\n\n\t\tif (count($this->altered_columns))\n\t\t{\n\t\t\t$column_data = $this->getColumnData();\n\t\t\t$modified = array_intersect_key($column_data, $this->altered_columns);\n\t\t\t$pk = array_intersect_key($column_data, array_flip($this->getPrimaryKey()));\n\n\t\t\t$db = $this->getDatabaseInstance(self::DB_INST_WRITE);\n\n\t\t\t$query = \"\n\t\t\t\tUPDATE \" . $this->getTableName() . \"\n\t\t\t\tSET\n\t\t\t\t\".implode(\" = ?, \", array_keys($modified)).\" = ?\n\t\t\t\tWHERE\n\t\t\t\t\t\".implode(\" = ? AND \", array_keys($pk)).\" = ?\n\t\t\t\";\n\t\t\n\t\t\tif(isset($_SESSION['LOCK_LAYER']['App_Info'][$this->application_id]) && $_SESSION['LOCK_LAYER']['App_Info'][$this->application_id]['date_modified'] != false)\n\t\t\t{\n\t\t\t\tif(is_numeric($_SESSION['LOCK_LAYER']['App_Info'][$this->application_id]['date_modified']))\n\t\t\t\t\t$query .= \" AND date_modified = FROM_UNIXTIME('\" . $_SESSION['LOCK_LAYER']['App_Info'][$this->application_id]['date_modified'] .\"')\";\n\t\t\t\telse\n\t\t\t\t\t$query .= \" AND date_modified = FROM_UNIXTIME('\" . strtotime($_SESSION['LOCK_LAYER']['App_Info'][$this->application_id]['date_modified']) .\"')\";\n\t\t\t}\n\n\t\t\t$st = $db->prepare($query);\n\t\t\t$st->execute(\n\t\t\t\tarray_merge(\n\t\t\t\t\tarray_values($modified),\n\t\t\t\t\tarray_values($pk)\n\t\t\t\t)\n\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\n\t\t\t//we now update the lock layer stuff so that the application can be updated multiple times per request\n\t\t\t//that's not ideal, but sometimes that's what good coding with a bad base requires -jeffd\n\t\t\tif(isset($_SESSION['LOCK_LAYER']['App_Info'][$this->application_id]) && $_SESSION['LOCK_LAYER']['App_Info'][$this->application_id]['date_modified'] != false)\n\t\t\t{\n\t\t\t\t$this->loadBy(array(\"application_id\" => $this->application_id));\n\t\t\t\t$_SESSION['LOCK_LAYER']['App_Info'][$this->application_id]['date_modified'] = date('Y-m-d H:i:s',$this->date_modified);\n\t\t\t}\n\n\t\t\t$this->affected_row_count = $st->rowCount();\n\t\t\t$this->setDataSynched();\n\n\t\t\t$event = new stdClass();\n\t\t\t$event->type = self::EVENT_UPDATE;\n\t\t\t$this->notifyObservers($event);\n\n\t\t}\n\t\t\n\t\treturn $this->affected_row_count;\n\t}",
"public function update()\n {\n // run the update SQL script to update alter existing tables and create existing ones\n \n // update existing users to add affiliate id\n \n // return back();\n }",
"public function update($table);",
"public function update($table);",
"public function UpdateApplication() {\r\n\t\tglobal $pdo;\r\n\r\n\t\t$id = (isset($_POST['id'])) ? $_POST['id'] : null;\r\n\t\t$status = (isset($_POST['status'])) ? $_POST['status'] : null;\r\n\t\t$comment = (isset($_POST['comment'])) ? $_POST['comment'] : null;\r\n\r\n\t\tif (!Permissions::init()->hasPermission(\"VIEW_SLT\")) {\r\n\t\t\tHelpers::addAuditLog(\"AUTHENTICATION_FAILED::{$_SERVER['REMOTE_ADDR']} Triggered An Unauthenticated Response In `StaffController::UpdateApplication`\");\r\n\t\t\techo Helpers::NewAPIResponse([\"message\" => \"Unauthorised\", \"success\" => false]);\r\n\t\t\texit;\r\n\t\t}\r\n\r\n\t\t$stmt = $pdo->prepare(\"UPDATE staff_applications SET status = :status, comment = :comment WHERE id = :id\");\r\n\t\t$stmt->bindValue(':status', $status);\r\n\t\t$stmt->bindValue(':comment', $comment);\r\n\t\t$stmt->bindValue(':id', $id);\r\n\t\t$db_call = $stmt->execute();\r\n\r\n\t\tif (!$db_call) {\r\n\t\t\techo Helpers::NewAPIResponse([\"message\" => \"Failed to update application\", \"success\" => false]);\r\n\t\t\texit;\r\n\t\t}\r\n\r\n\t\techo Helpers::NewAPIResponse([\"message\" => \"success\", \"success\" => true]);\r\n\t}",
"public function onUpdate(ApplicationEvent $event)\n {\n $wizard = new ModelWizard($event->getDbh(), $event->getRouter(), $event->getRegistry(), $event->getData());\n $wizard->update();\n }",
"public static function updateTable() {\n if ( !function_exists( 'dbDelta' ) ) {\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n }\n $dbDeltaTableFile = sprintf( '%s%s', kWPPlaceholdersDirectoryPath, kWPPlaceholdersPlacesTableFilename );\n $file = file_get_contents( $dbDeltaTableFile );\n $sql = sprintf( $file, self::tableName() );\n @dbDelta( $sql );\n }",
"public function update()\n {\n // TODO find diff (actual/new_in_model) and make sql\n }",
"public function update(ApplicationRequest $request, $id)\n {\n try {\n $application = Applications::find($id);\n $application->lastname = $request->get('lastname') ?? '';\n $application->firstname = $request->get('firstname') ?? '';\n $application->lastname_kanji = $request->get('lastname_kanji') ?? ($request->get('lastname') ?? '');\n $application->firstname_kanji = $request->get('firstname_kanji') ?? ($request->get('firstname') ?? '');\n $application->lastname_furigana = $request->get('lastname_furigana') ?? ($request->get('lastname') ?? '');\n $application->firstname_furigana = $request->get('firstname_furigana') ?? ($request->get('firstname') ?? '');\n $application->home_phone = $request->get('home_phone');\n $application->mobile_phone = $request->get('mobile_phone');\n $application->levels = !empty($request->levels) ? implode(\",\",$request->levels) : '';\n \n $application->office_name = $request->office_name;\n $application->office_address = $request->office_address;\n $application->office_phone = $request->office_phone;\n $application->school_name = $request->school_name;\n $application->school_address = $request->school_address;\n $application->school_phone = $request->school_phone;\n \n if(!empty($request->get('address'))) {\n if($application->address != $request->get('address')) {\n $application->address = $request->get('address');\n }\n }\n if(!empty($request->get('join_date'))) {\n $application->join_date = $request->get('join_date');\n }\n\n if(!empty($request->get('birthday'))) { \n $application->birthday = $request->get('birthday');\n }\n\n if(!empty($request->get('toiawase_referral'))) {\n $application->toiawase_referral = $request->get('toiawase_referral');\n }\n if(!empty($request->get('toiawase_memo'))) {\n $application->toiawase_memo = $request->get('toiawase_memo');\n }\n $application->email = $request->get('email');\n \n $application->save();\n\n $custom_fields = CustomFields::where('data_model', 'Applications')->get();\n if ($custom_fields) {\n foreach ($custom_fields as $custom_field) {\n $field = CustomFieldValue::where('model_id', $application->id)->where('custom_field_id', $custom_field->id)->first();\n if ($field) {\n if ( !empty($request->{'custom_'.$custom_field->field_name}) ) {\n $field->field_value = $request->{'custom_'.$custom_field->field_name};\n $field->save();\n } else {\n $field->delete();\n }\n } else {\n if ( !empty($request->{'custom_'.$custom_field->field_name}) ) {\n CustomFieldValue::create([\n 'custom_field_id' => $custom_field->id,\n 'model_id' => $application->id,\n 'field_value' => $request->{'custom_'.$custom_field->field_name}\n ]);\n }\n }\n }\n }\n\n return redirect('/applications/'.$id)->with('success', __('messages.application-has-been-updated'));\n } catch (\\Exception $e) {\n return redirect()->back()->withInput()->with('error', $e->getMessage());\n }\n }",
"public function update(Request $request, Application $application)\n {\n //\n }",
"public function update() {\n\t\t\n\t\t$mods = $this->_data_modified[$this->_data_position];\n\t\tif (count($mods) < 1) return true; // no changes.\n\t\t\t\n\t\t// Build data\n\t\t$changes = [];\n\t\tforeach ($mods as $mod) $changes[$mod] = $this->__get($mod);\n\t\t\n\t\t// Build URL\n\t\t$url = \"table/\".$this->_table_name.\"/\".$this->__get(\"sys_id\");\n\t\t\n\t\t// Use GlideAccess to run the PUT command \n\t\t// Throw a GlideAccessException or a GlideAuthenticationException on error \n\t\t$result = $this->_access->put($url, json_encode($changes));\n\t\t\t\n\t\t// Clear out the pending updates for this record\n\t\t$this->_data_modified[$this->_data_position] = [];\n\t}",
"protected function update() {\n $this->generateUpdate();\n $this->typeTransacction();\n }",
"private function updateReplItemsTable()\n {\n $connection = $this->resource->getConnection(ResourceConnection::DEFAULT_CONNECTION);\n $lsTableName = $this->resource->getTableName('ls_replication_repl_item');\n try {\n $connection->update($lsTableName, ['is_updated' => 1]);\n } catch (Exception $e) {\n $this->logger->debug($e->getMessage());\n }\n }",
"protected function updateTable()\n {\n $connection = $this->entityManager->getConnection();\n try {\n $query = sprintf(\n 'ALTER TABLE `%s` CHANGE evaluation_generation_date generated_at DATETIME',\n $this->tableName\n );\n\n $connection->exec($query);\n } catch (InvalidFieldNameException $ex) {\n }\n try {\n $query = sprintf(\n 'ALTER TABLE `%s` CHANGE display_name title VARCHAR(255) NOT NULL',\n $this->tableName\n );\n\n $connection->exec($query);\n } catch (InvalidFieldNameException $ex) {\n }\n try {\n $query = sprintf(\n 'ALTER TABLE `%s` ADD COLUMN category VARCHAR(255) NOT NULL',\n $this->tableName\n );\n\n $connection->exec($query);\n } catch (DriverException $ex) {\n }\n try {\n $query = sprintf(\n 'ALTER TABLE `%s` ADD COLUMN brand VARCHAR(255) NOT NULL',\n $this->tableName\n );\n\n $connection->exec($query);\n } catch (DriverException $ex) {\n }\n try {\n $query = sprintf(\n 'ALTER TABLE `%s` ADD COLUMN state VARCHAR(255) NOT NULL',\n $this->tableName\n );\n\n $connection->exec($query);\n } catch (DriverException $ex) {\n }\n try {\n $query = sprintf(\n 'ALTER TABLE `%s` ADD COLUMN cid VARCHAR(255) NOT NULL',\n $this->tableName\n );\n\n $connection->exec($query);\n } catch (DriverException $ex) {\n }\n try {\n $query = ('DROP TABLE IF EXISTS `medium`');\n $connection->exec($query);\n } catch (DriverException $ex) {\n }\n try {\n $query = ('DROP TABLE IF EXISTS `evaluation_mediums`');\n $connection->exec($query);\n } catch (DriverException $ex) {\n }\n try {\n $query = sprintf(\n 'ALTER TABLE `%s` DROP COLUMN uid',\n $this->tableName\n );\n\n $connection->exec($query);\n } catch (DriverException $ex) {\n }\n }",
"function updateInDatabase(){\n }",
"public function update()\n\t\t{\n\t\t\t// with an insert instead.\n\t\t\t$this->save();\n\t\t}",
"public function update($id)\n\t{\n\t\t// Application Log\n\t\t\t$application = Application::findOrFail($id);\n\t\t\t$prev_action = ApplicationLog::where('application_id','=',$id)->orderBy('action_datetime','desc');\n\t\t\tif($prev_action->count() > 0){\n\t\t\t\t$prev_action = $prev_action->first();\n\t\t\t}else{\n\t\t\t\t$prev_action = NULL;\n\t\t\t}\n\t\t\t$timestamp = Carbon::now();\n\t\t\t$visit_number = 1;\n\t\t\tif(is_null($prev_action)){\n\t\t\t\t$prev_action_datetime = 0;\n\t\t\t}else{\n\t\t\t\t$prev_action_datetime = $prev_action->action_datetime;\n\t\t\t}\n\t\t\tDB::table('application_logs')->insert(array(\n\t\t\t\t\t\t\t'action_type' => 5,\n\t\t\t\t\t\t\t'application_id' => $application->application_id,\n\t\t\t\t\t\t\t'visit_number' => $visit_number,\n\t\t\t\t\t\t\t'employee_user_id' => Employee::first()->user_id,\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\tchange 'employee_user_id' to real employee id\n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t'action_datetime' => $timestamp,\n\t\t\t\t\t\t\t'prev_action_datetime' => $prev_action_datetime,\n\t\t\t\t\t\t\t'result' => Input::get('approve'),\n\t\t\t\t\t\t\t'note' => Input::get('note')\n\t\t\t));\n\t\t$application->current_salary = Input::get('current_salary');\n\t\t$application->expected_salary = Input::get('expected_salary');\n\t\t$application->position_salary = Input::get('position_salary');\n\t\t$application->final_salary = Input::get('final_salary');\n\t\t$application->cola = Input::get('cola');\n\t\t$application->application_current_status_id = Input::get('approve')?6:9;\n\t\t$application->note = Input::get('note');\n\t\t$application->save();\n\n\t\t/*$application->intOffSchedule()->whereAppCsId(4)->whereVisitNumber($visit_number)->delete();\n\t\tDB::table('int_off_schedules')->insert(array(\n\t\t\t\t\t\t'app_cs_id' => 4,\n\t\t\t\t\t\t'visit_number' => $visit_number,\n\t\t\t\t\t\t'application_id' => $application->application_id,\n\t\t\t\t\t\t'datetime' => Input::get('date_time'),\n\t\t\t\t\t\t'location' => Input::get('location')\n\t\t));*/\n\n\t\t// return Response::json(array('success' => true));\n\t\t$applications = Requisition::find($id)->application()->whereApplicationCurrentStatusId(5)->get();\n\t\treturn View::make('recruiter.offering.package.show', compact('applications'))->with('requisition_id',$application->requisition_id);\n\t\n\t}",
"protected final function update(): void\n {\n if (empty($this->fields)) {\n return;\n }\n\n static::$driver->transaction(function (Driver $driver) {\n $driver->sql($this->generateUpdateStatement());\n\n foreach ($this->fields as $name => $bind) {\n $driver->bindValue($bind, $this->dbModel->{$name});\n }\n\n $driver->bindValue($this->primaryKey, $this->dbModel->{$this->primaryKey});\n $driver->execute(NULL, true);\n });\n }",
"public function updateCategoryDb()\n\t{\n\t}",
"private function updateAppHeadById(Int $appId, Array $dataArr){\n return QP_App_Head::where('row_id', $appId)\n ->update($dataArr);\n }",
"function UpdateApp($appid,$appname,$appversion,$appdescription,$appicon)\n {\n include \"mysqlconnect.php\";\n\n $image_link = \"https://\".$_SERVER['HTTP_HOST'].\"/\".substr($_SERVER['REQUEST_URI'],0,strpos($_SERVER['REQUEST_URI'],\"application.php\")).\"/\".$appicon;\n \n $app_list = array(\"status\" => \"200\") + array(\"results\" => \"Nothing Happened\"); \n \n try {\n \n $stmt = $conn->prepare(\"UPDATE application SET \n appname = :appname,\n version = :version,\n description = :description,\n imagepath = :imagepath\n WHERE appid = :appid\");\n \n $stmt->bindParam(':appid',$appid,PDO::PARAM_INT);\n $stmt->bindParam(':appname',$appname,PDO::PARAM_STR,50);\n $stmt->bindParam(':version',$appversion,PDO::PARAM_STR,50);\n $stmt->bindParam(':description',$appdescription,PDO::PARAM_STR,50);\n $stmt->bindParam(':imagepath',$appicon,PDO::PARAM_STR,255);\n $stmt->execute();\n $app_list = array(\"status\" => \"200\") + array(\"results\" => \"OK\"); \n \n \n } catch(PDOException $e){\n \n \n //echo \"Something went wrong...\";\n $app_list = $stmt->errorInfo();\n $app_list = array(\"status\" => \"400\") + array(\"results\" => $e->getMessage()); \n }\n \n return $app_list;\n\n }",
"public function update()\n {\n $this->updateLastUpdated();\n $where = $this->buildWhereFromPrimary();\n $result = $this->connection->master()->autoUpdate($this->tableWithDBPrefix(), $this, $where);\n }",
"function updateNewTable()\n\t{\n\t\tset_time_limit(0);\n\t\tApp::import('model','Category');\n\t\t$this->Category = new Category();\n\t\t\n\t\tApp::import('model','CountyCategory');\n\t\t$this->CountyCategory = new CountyCategory();\n\t\t\n\t\t$cat = $this->Category->find('all');\n\t\t\n\t\tforeach($cat as $cat) {\n\t\t\t\t\t$county = '';\n\t\t\t\t\t$county = array_values(array_filter(explode(',',$cat['Category']['county'])));\n\t\t\t\t\tif(is_array($county) && !empty($county)) {\n\t\t\t\t\t\tforeach($county as $county) {\n\t\t\t\t\t\t\t$save2 = '';\n\t\t\t\t\t\t\t$save2['CountyCategory']['id'] = '';\n\t\t\t\t\t\t\t$save2['CountyCategory']['county_id'] = $county;\n\t\t\t\t\t\t\t$save2['CountyCategory']['category_id'] = $cat['Category']['id'];\n\t\t\t\t\t\t\t$this->CountyCategory->save($save2,false);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"function db_update(){\r\n\t\tinclude('sql_start.php');\r\n\t\t$sql = \"UPDATE \".TBL_DEVICES.\" SET \";\r\n\t\tmysql_close();\r\n\t}",
"function reviewApplication($applicationID){\n $query = \"UPDATE applications SET status='New' WHERE applicationid = ?\";\n $paramType = \"i\";\n $paramValue = array(\n $applicationID\n );\n $this->db_handle->update($query, $paramType, $paramValue);\n }",
"private function update() {\n // use prepared statements\n }",
"private function updateDatabase()\n {\n $this->model->update([\n 'picture' => $this->filename,\n ]);\n }",
"private function Update_Synced_Apps()\n\t{\n\t\t$synced_id = $this->Get_Synced_Status();\n\t\t$unsynced_id = $this->Get_Un_Synced_Status();\n\n\t\tforeach($this->unsynced_apps as $app)\n\t\t{\n\t\t\t$query = \"UPDATE status_history\n\t\t\t\t\t SET application_status_id = {$synced_id}\n\t\t\t\t\t WHERE application_status_id = {$unsynced_id}\n\t\t\t\t\t\tAND application_id = {$app['application_id']}\";\n\t\t\t\t\n\t\t\t$result = $this->QueryOLP($query);\n\t\t}\n\t\treturn true;\n\t}",
"public function update() {\r\n\t\t$this->_update();\r\n\t}",
"public function updateApplication($application, $applicationName, $applicationDescription, $imageIds)\n {\n\n // run the try block below for\n\n try{\n\n $sqlQuery = \"SELECT id FROM applications WHERE application_name='{$application}'\";\n\n $stmt = $this->_DB->_pdo->query($sqlQuery);\n\n\n $query = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $applicationId = $query['0']['id'];\n\n\n }catch (PDOException $e){\n $e->getMessage();\n echo \"Select unsuccesful\";\n }\n\n\n //Update applications table information\n\n try\n {\n $sqlQuery = \"UPDATE applications SET application_name='{$applicationName}',\n application_description='{$applicationDescription}',\n image={$imageIds[0]}\n WHERE id='$applicationId'\";\n\n $stmt = $this->_DB->_pdo->prepare($sqlQuery);\n\n\n $stmt->execute();\n\n echo \"Update Success\";\n }catch(PDOException $e)\n {\n echo \"unsuccesfull\";\n $e->getMessage();\n }\n\n\n // Update application_images table 'id' field\n try\n {\n $sqlQuery = \"SELECT id FROM application_images WHERE application_id={$applicationId}\";\n\n $query = $this->_DB->_pdo->query($sqlQuery)->fetchAll(PDO::FETCH_ASSOC);\n\n $applicationImagesRefIds = $query;\n\n\n }catch (PDOException $e){\n echo\"unsuccessful SELECT\";\n\n }\n\n // Update Application_images\n\n // from this arrach for loop through and up usimage image IDS array with $index\n\n $i = 0;\n foreach($imageIds as $imageId)\n {\n \n\n $sql = \"UPDATE application_images SET image_id={$imageId} where id={$applicationImagesRefIds[$i]['id']}\";\n\n $stmt = $this->_DB->_pdo->prepare($sql);\n $stmt->execute();\n $i++;\n\n }\n }"
] | [
"0.5881824",
"0.58518696",
"0.57311404",
"0.57311404",
"0.57108855",
"0.56329745",
"0.56225216",
"0.5556563",
"0.5538574",
"0.551343",
"0.55105734",
"0.5429727",
"0.5425598",
"0.53803",
"0.53794426",
"0.5368458",
"0.53245276",
"0.5312306",
"0.5298869",
"0.5298456",
"0.52697563",
"0.5261284",
"0.5259772",
"0.5254243",
"0.5251804",
"0.52505857",
"0.5249195",
"0.5246346",
"0.5222733",
"0.52225965"
] | 0.58569974 | 1 |
Retrieves the pay date info details for the update from an application_id | public function getPaydateDetailsQuery($application_id) {
$query = 'SELECT ap.application_id AS application_id,
ap.paydate_model AS paydate_model,
ap.income_source AS income_source,
ap.income_frequency AS income_frequency,
ap.day_of_week AS day_of_week,
ap.income_monthly AS income_monthly,
ap.income_direct_deposit AS income_direct_deposit_old,
IF(ap.income_direct_deposit = "yes", TRUE, FALSE) as income_direct_deposit,
ap.income_date_soap_1 AS income_date_soap_1,
ap.income_date_soap_2 AS income_date_soap_2,
ap.last_paydate AS last_paydate,
ap.day_of_month_1 AS day_of_month_1,
ap.day_of_month_2 AS day_of_month_2,
ap.week_1 AS week_1,
ap.week_2 AS week_2
FROM application AS ap
WHERE ap.application_id = '.$application_id.';';
$result = $this->db->query($query);
$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);
return($rows);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update_pnr_details($app_reference) {\r\n $response['data'] = array();\r\n $response['status'] = FAILURE_STATUS;\r\n $api_request = $this->get_update_pnr_request($app_reference);\r\n \r\n if ($api_request['status']) {\r\n $header_info = $this->get_header();\r\n $api_response = $this->CI->api_interface->get_json_response($api_request['data']['service_url'], $api_request['data']['request'], $header_info);\r\n \r\n if ($this->valid_api_response($api_response)) {\r\n $response['data'] = $api_response['BookingDetails'];\r\n $response['status'] = SUCCESS_STATUS;\r\n }\r\n }\r\n\r\n return $response;\r\n }",
"public function updatePaydateInfoQuery($paydate){\n\t\t$date = date(\"Y-m-d G:i:s\");\n\t\t$query = 'UPDATE application SET\n\t\t\t\tdate_modified = \"'.$date.'\",\n\t\t\t\tday_of_month_1 = '.$paydate->day_of_month_1.',\n\t\t\t\tday_of_month_2 = '.$paydate->day_of_month_2.',\n\t\t\t\tincome_date_soap_1 = \"'.$paydate->income_date_soap_1.'\",\n\t\t\t\tincome_date_soap_2 = \"'.$paydate->income_date_soap_2.'\",\n\t\t\t\tincome_direct_deposit = '.(((strtolower($paydate->income_direct_deposit) == \"no\") || !($paydate->income_direct_deposit)) ? '\"no\"' : '\"yes\"').',\n\t\t\t\tincome_monthly = '.$paydate->income_monthly.',\n\t\t\t\tlast_paydate = \"'.date(\"Y-m-d\",strtotime($paydate->last_paydate)).'\",\n\t\t\t\tweek_1 = '.$paydate->week_1.',\n\t\t\t\tweek_2 = '.$paydate->week_2.',\n\t\t\t\tday_of_week = \"'.$paydate->day_of_week.'\",\n\t\t\t\tincome_frequency = \"'.$paydate->income_frequency.'\",\n\t\t\t\tincome_source = \"'.$paydate->income_source.'\",\n\t\t\t\tpaydate_model = \"'.$paydate->paydate_model.'\",\n\t\t\t\tmodifying_agent_id = '.$paydate->modifying_agent_id.'\n\t\t\tWHERE application_id ='.$paydate->application_id.';';\n\t\t\t// employer_name = \"'.$paydate->employer_name.'\",\n\n\t\t$result = $this->db->query($query);\n\t\treturn($result->rowCount());\n\t}",
"private function Get_App_Data_From_OLP($application_id)\n\t{\n\t\t$data = array();\n\n\t\t$query = \"\n\t\t\tSELECT\n\t\t\t\tfirst_name\t\tAS name_first,\n\t\t\t\tmiddle_name\t\tAS name_middle,\n\t\t\t\tlast_name\t\tAS name_last,\n\t\t\t\temail\t\t\tAS email_primary,\n\t\t\t\thome_phone\t\tAS phone_home,\n\t\t\t\tcell_phone\t\tAS phone_cell,\n\t\t\t\twork_phone\t\tAS phone_work,\n\t\t\t\tfax_phone\t\tAS phone_fax,\n\t\t\t\twork_ext\t\tAS ext_work,\n\n\t\t\t\tdate_of_birth\tAS dob,\n\t\t\t\tsocial_security_number AS ssn,\n\n\t\t\t\taddress_1\t\tAS home_street,\n\t\t\t\tcity\t\t\tAS home_city,\n\t\t\t\tstate\t\t\tAS home_state,\n\t\t\t\tzip\t\t\t\tAS home_zip,\n\t\t\t\tapartment\t\tAS home_unit,\n\n\t\t\t\temployer\t\tAS employer_name,\n\t\t\t\tdrivers_license_number\tAS state_id_number,\n\n\t\t\t\tdirect_deposit\tAS income_direct_deposit,\n\t\t\t\tincome_type,\n\t\t\t\tpay_frequency\tAS income_frequency,\n\t\t\t\tbank_name,\n\t\t\t\taccount_number\tAS bank_account,\n\t\t\t\trouting_number\tAS bank_aba,\n\t\t\t\tmonthly_net\t\tAS income_monthly_net,\n\t\t\t\tbank_account_type,\n\n\t\t\t\tpaydate_model_id\tAS paydate_model,\n\t\t\t\tIFNULL(ELT(day_of_week, 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'), 'SUN') AS day_of_week,\n\t\t\t\tDATE_FORMAT(pay_date_1, '%Y-%m-%d') AS next_paydate,\n\t\t\t\tday_of_month_1,\n\t\t\t\tday_of_month_2,\n\t\t\t\tweek_1,\n\t\t\t\tweek_2,\n\n\t\t\t\tDATE_FORMAT(pay_date_1, '%Y-%m-%d') AS pay_date_1,\n\t\t\t\tDATE_FORMAT(pay_date_2, '%Y-%m-%d') AS pay_date_2,\n\t\t\t\tDATE_FORMAT(pay_date_3, '%Y-%m-%d') AS pay_date_3,\n\t\t\t\tDATE_FORMAT(pay_date_4, '%Y-%m-%d') AS pay_date_4,\n\n\t\t\t\tfund_amount,\n\t\t\t\tnet_pay,\n\t\t\t\tfinance_charge,\n\t\t\t\tapr,\n\t\t\t\ttotal_payments,\n\t\t\t\tDATE_FORMAT(estimated_fund_date, '%Y-%m-%d') AS fund_date,\n\t\t\t\tDATE_FORMAT(estimated_payoff_date, '%Y-%m-%d') AS payoff_date,\n\t\t\t\t\n\t\t\t\tbest_call_time,\n\t\t\t\tip_address\t\tAS client_ip_address\n\n\t\t\t\t#residence_start_date,\n\t\t\t\t#banking_start_date,\n\t\t\t\t#date_of_hire,\n\t\t\t\t#title AS work_title,\n\n\t\t\t\t#engine AS vehicle_engine,\n\t\t\t\t#keywords AS vehicle_keywords,\n\t\t\t\t#year AS vehicle_year,\n\t\t\t\t#make AS vehicle_make,\n\t\t\t\t#model AS vehicle_model,\n\t\t\t\t#series AS vehicle_series,\n\t\t\t\t#style AS vehicle_style,\n\t\t\t\t#mileage AS vehicle_mileage,\n\t\t\t\t#vin AS vehicle_vin,\n\t\t\t\t#value AS vehicle_value,\n\t\t\t\t#color AS vehicle_color,\n\t\t\t\t#license_plate AS vehicle_license_plate,\n\t\t\t\t#title_state AS vehicle_title_state\n\t\t\tFROM\n\t\t\t\tpersonal\n\t\t\t\tINNER JOIN residence USING (application_id)\n\t\t\t\tINNER JOIN bank_info USING (application_id)\n\t\t\t\tINNER JOIN employment USING (application_id)\n\t\t\t\tINNER JOIN loan_note USING (application_id)\n\t\t\t\tINNER JOIN income USING (application_id)\n\t\t\t\tINNER JOIN paydate USING (application_id)\n\t\t\t\tINNER JOIN campaign_info USING (application_id)\n\t\t\t\t#LEFT JOIN vehicle USING (application_id)\n\t\t\tWHERE\n\t\t\t\tpersonal.application_id = {$application_id}\n\t\t\t\tAND campaign_info.active = 'TRUE'\n\t\t\tLIMIT 1\n\t\t\";\n\n\t\t$mysql_result = $this->olp_sql->Query($this->olp_db, $query);\n\n\t\tif($mysql_result && ($data = $this->olp_sql->Fetch_Array_Row($mysql_result)))\n\t\t{\n\t\t\t$data['paydate'] = array('frequency' => $data['income_frequency']);\n\n\t\t\tlist($data['date_dob_y'], $data['date_dob_m'], $data['date_dob_d']) = explode('-', $data['dob']);\n\t\t\t$data['ssn_part_1'] = substr($data['ssn'], 0, 3);\n\t\t\t$data['ssn_part_2'] = substr($data['ssn'], 3, 2);\n\t\t\t$data['ssn_part_3'] = substr($data['ssn'], 5);\n\n\t\t\t//Taken from ent_cs and slightly modified\n\t\t\tswitch($data['paydate']['frequency'])\n\t\t\t{\n\t\t\t\tcase 'WEEKLY':\n\t\t\t\t\t$data['paydate']['weekly_day'] = $data['day_of_week'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'BI_WEEKLY':\n\t\t\t\t\t$data['paydate']['biweekly_day'] = $data['day_of_week'];\n\t\t\t\t\t$data['paydate']['biweekly_date'] = $data['next_paydate'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'TWICE_MONTHLY':\n\t\t\t\t\tswitch($data['paydate_model'])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'DMDM':\n\t\t\t\t\t\t\t$data['paydate']['twicemonthly_type'] = 'date';\n\t\t\t\t\t\t\t$data['paydate']['twicemonthly_date1'] = $data['day_of_month_1'];\n\t\t\t\t\t\t\t$data['paydate']['twicemonthly_date2'] = $data['day_of_month_2'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$data['paydate']['twicemonthly_type'] = 'week';\n\t\t\t\t\t\t\t$data['paydate']['twicemonthly_week'] = sprintf( '%s-%s', $data['week_1'], $data['week_2'] );\n\t\t\t\t\t\t\t$data['paydate']['twicemonthly_day'] = $data['day_of_week'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'MONTHLY':\n\t\t\t\t\tswitch($data['paydate_model'])\n\t\t\t\t\t{\n\n\t\t\t\t\t\tcase 'DM':\n\t\t\t\t\t\t//rsk changed from week\n\t\t\t\t\t\t\t$data['paydate']['monthly_type'] = 'date';\n\t\t\t\t\t\t\t$data['paydate']['monthly_date'] = $data['day_of_month_1'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'WDW':\n\t\t\t\t\t\t\t$data['paydate']['monthly_type'] = 'day';\n\t\t\t\t\t\t\t$data['paydate']['monthly_week'] = $data['week_1'];\n\t\t\t\t\t\t\t$data['paydate']['monthly_day'] = $data['day_of_week'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$data['paydate']['monthly_type'] = 'after';\n\t\t\t\t\t\t\t$data['paydate']['monthly_after_day'] = $data['day_of_week'];\n\t\t\t\t\t\t\t$data['paydate']['monthly_after_date'] = $data['day_of_month_1'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$data['social_security_number'] = $data['ssn'];\n\t\t\t\n\t\t\t//Create the paydates\n\t\t\t$data['paydates'] = array();\n\t\t\tfor($i = 1; $i <= 4; $i++)\n\t\t\t{\n\t\t\t\t$data['paydates'][] = $data['pay_date_' . $i];\n\t\t\t\tunset($data['pay_date_' . $i]);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//Create qualify information\n\t\t\t$data['qualify_info'] = array(\n\t\t\t\t'fund_date'\t\t=> $data['fund_date'],\n\t\t\t\t'payoff_date'\t=> $data['payoff_date'],\n\t\t\t\t'fund_amount'\t=> $data['fund_amount'],\n\t\t\t\t'net_pay'\t\t=> $data['net_pay'],\n\t\t\t\t'finance_charge'=> $data['finance_charge'],\n\t\t\t\t'apr'\t\t\t=> $data['apr'],\n\t\t\t\t'total_payments'=> $data['total_payments']\n\t\t\t);\n\t\t\t\n\t\t\t\n\t\t\t//Unset unneeded information\n\t\t\tunset($data['ssn'], $data['dob']);\n\n\n\t\t\t$ref_query = \"\n\t\t\t\tSELECT\n\t\t\t\t\tfull_name\tAS name_full,\n\t\t\t\t\tphone\t\tAS phone_home,\n\t\t\t\t\trelationship\n\t\t\t\tFROM\n\t\t\t\t\tpersonal_contact\n\t\t\t\tWHERE\n\t\t\t\t\tapplication_id = {$application_id}\";\n\n\t\t\t$ref_result = $this->olp_sql->Query($this->olp_db, $ref_query);\n\n\t\t\t$count = 0;\n\t\t\twhile($row = $this->olp_sql->Fetch_Array_Row($ref_result))\n\t\t\t{\n\t\t\t\t$ref_count = sprintf('%02d', ++$count);\n\n\t\t\t\t$data['ref_' . $ref_count . '_name_full'] = $row['name_full'];\n\t\t\t\t$data['ref_' . $ref_count . '_phone_home'] = $row['phone_home'];\n\t\t\t\t$data['ref_' . $ref_count . '_relationship'] = $row['relationship'];\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//Create our paydate_model\n\t\t\t$model = new Paydate_Model();\n\t\t\t$model_result = $model->Build_From_Data($data['paydate']);\n\t\t\t\n\t\t\tif($model_result === TRUE)\n\t\t\t{\n\t\t\t\t$data['paydate_model'] = $model->Model_Data();\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}",
"public function getApplicationDetailsQuery($application_id) {\n\t\t$query = 'SELECT\n\t\t\t\tap.application_id AS application_id,\n\t\t\t\tap.apr AS apr,\n\t\t\t\tap.customer_id AS customer_id,\n\t\t\t\tap.modifying_agent_id AS modifying_agent_id,\n\t\t\t\tap.cfe_rule_set_id AS cfe_ruleset_id,\n\t\t\t\tap.date_first_payment AS date_first_payment,\n\t\t\t\tif(ap.date_fund_actual>\"1990-01-01\",ap.date_fund_actual,NULL) AS date_fund_actual,\n\t\t\t\tap.date_fund_estimated AS date_fund_estimated,\n\t\t\t\tap.date_next_contact AS date_next_contact,\n\t\t\t\tap.finance_charge AS finance_charge,\n\t\t\t\tap.fund_actual AS fund_actual,\n\t\t\t\tap.fund_qualified AS fund_qualified,\n\t\t\t\tap.fund_requested AS fund_requested,\n\t\t\t\tap.is_watched AS is_watched,\n\t\t\t\tap.payment_total AS payment_total,\n\t\t\t\tap.rule_set_id AS rule_set_id,\n\t\t\t\tap.date_modified AS date_modified,\n\t\t\t\tap.call_time_pref AS call_time_pref,\n\t\t\t\tap.contact_method_pref AS contact_method_pref,\n\t\t\t\tap.marketing_contact_pref AS marketing_contact_pref,\n\t\t\t\tap.call_time_pref AS call_time_pref,\n\t\t\t\tap.contact_method_pref AS contact_method_pref,\n\t\t\t\tap.marketing_contact_pref AS marketing_contact_pref,\n\t\t\t\tap.source AS application_source,\n\t\t\t\tap.application_type AS application_type,\n\t\t\t\tIF (av.version IS NULL,1,av.version) AS application_version\n\t\t\tFROM application AS ap\n\t\t\t\tLEFT JOIN application_version AS av ON (ap.application_id = av.application_id)\n\t\t\tWHERE ap.application_id = '.$application_id.';';\n\t\t$result = $this->db->query($query);\n\t\t$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($rows);\n\t}",
"function get_update_pnr_request($app_reference) {\r\n $response['status'] = SUCCESS_STATUS;\r\n $response['data'] = array();\r\n $request_params = array();\r\n $this->credentials('BookingDetails');\r\n if (empty($app_reference) == false) {\r\n $request_params['AppReference'] = $app_reference;\r\n } else {\r\n $response['status'] = FAILURE_STATUS;\r\n }\r\n $response['data']['request'] = json_encode($request_params);\r\n $response['data']['service_url'] = $this->service_url;\r\n return $response;\r\n }",
"private function Get_Correct_Fund_Info($application_id)\n\t{\n\t\t$qualify_info = array();\n\n\t\t$query = \"SELECT\n\t\t\t\t\tDATE_FORMAT(estimated_fund_date, '%Y-%m-%d') AS fund_date,\n\t\t\t\t\tDATE_FORMAT(estimated_payoff_date, '%Y-%m-%d') AS payoff_date,\n\t\t\t\t\tfund_amount,\n\t\t\t\t\tfinance_charge,\n\t\t\t\t\ttotal_payments,\n\t\t\t\t\tapr,\n\t\t\t\t\tpay_frequency,\n\t\t\t\t\tmonthly_net\n\t\t\t\tFROM\n\t\t\t\t\tloan_note\n\t\t\t\t\tINNER JOIN income USING (application_id)\n\t\t\t\tWHERE\n\t\t\t\t\tloan_note.application_id = {$application_id}\";\n\n\t\t$result = $this->QueryOLP($query);\n\n\t\tif($this->olp_sql->Row_Count($result) !== 0)\n\t\t{\n\t\t\t$qualify_info = $this->olp_sql->Fetch_Array_Row($result);\n\n\t\t\tswitch (strtoupper($qualify_info['pay_frequency']))\n\t\t\t{\n\t\t\t\tcase 'WEEKLY':\n\t\t\t\t\t$qualify_info['net_pay'] = round(($qualify_info['monthly_net'] * 12) / 52);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'BI_WEEKLY':\n\t\t\t\t\t$qualify_info['net_pay'] = round(($qualify_info['monthly_net'] * 12) / 26);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'TWICE_MONTHLY':\n\t\t\t\t\t$qualify_info['net_pay'] = round($qualify_info['monthly_net'] / 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'MONTHLY':\n\t\t\t\t\t$qualify_info['net_pay'] = $qualify_info['monthly_net'];\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tunset($qualify_info['pay_frequency']);\n\t\t}\n\n\t\treturn $qualify_info;\n\t}",
"public function updateApplicationQuery($app){\n\t\t$date = date(\"Y-m-d G:i:s\");\n\t\t$query = 'UPDATE application AS ap\n\t\t\tSET \n\t\t\t\tap.apr = '.$app->apr.',\n\t\t\t\tap.customer_id = '.$app->customer_id.',\n\t\t\t\tap.cfe_rule_set_id = '.$app->cfe_ruleset_id.',\n\t\t\t\tap.date_first_payment = \"'.date(\"Y-m-d\",strtotime($app->date_first_payment)).'\",\n\t\t\t\tap.date_fund_actual = \"'.date(\"Y-m-d\",strtotime($app->date_fund_actual)).'\",\n\t\t\t\tap.date_fund_estimated = \"'.date(\"Y-m-d\",strtotime($app->date_fund_estimated)).'\",\n\t\t\t\tap.date_next_contact = \"'.date(\"Y-m-d\",strtotime($app->date_next_contact)).'\",\n\t\t\t\tap.finance_charge = '.$app->finance_charge.',\n\t\t\t\tap.fund_actual = '.$app->fund_actual.',\n\t\t\t\tap.fund_qualified = '.$app->fund_qualified.',\n\t\t\t\tap.fund_requested = '.$app->fund_requested.',\n\t\t\t\tap.is_watched = \"'.$app->is_watched.'\",\n\t\t\t\tap.payment_total = '.$app->payment_total.',\n\t\t\t\tap.rule_set_id = '.$app->rule_set_id.',\n\t\t\t\tap.date_modified = \"'.$date.'\",\n\t\t\t\tap.call_time_pref = \"'.$app->call_time_pref.'\",\n\t\t\t\tap.contact_method_pref = \"'.$app->contact_method_pref.'\",\n\t\t\t\tap.marketing_contact_pref = \"'.$app->marketing_contact_pref.'\",\n\t\t\t\tap.esig_ip_address = \"'.$app->esig_ip_address.'\",\n\t\t\t\tap.modifying_agent_id = '.$app->modifying_agent_id.'\n\t\t\tWHERE ap.application_id ='.$app->application_id.';';\n\t\t$result = $this->db->query($query);\n\t\treturn($result->rowCount());\n\t}",
"public function getDetailsById($appId)\n { \n $sql = $this->select();\n $sql->from($this->_name,array('name', 'price', 'user_id'))\n ->where('id = ?',$appId); \n \n return $this->fetchRow($sql);\n \n }",
"public function get_booking_details_appt_api($orderid) {\r\t\t\t$query = \"select `b`.`booking_status`,`b`.`booking_date_time`,`p`.`net_amount`,`oci`.`client_name`,`oci`.`client_email`,`oci`.`client_personal_info`,`p`.`payment_method`,`oci`.`client_phone`,`s`.`title` as `service_title`,`b`.`gc_event_id` ,`b`.`gc_staff_event_id` ,`b`.`staff_ids` from `ct_bookings` as `b`,`ct_payments` as `p`,`ct_order_client_info` as `oci`,`ct_services` as `s`where `b`.`order_id` = `p`.`order_id`and `b`.`order_id` = '\" . $orderid . \"'and `b`.`order_id` = `oci`.`order_id`and `b`.`service_id` = `s`.`id` GROUP BY `b`.`booking_status`,`b`.`booking_date_time`,`p`.`net_amount`,`oci`.`client_name`,`oci`.`client_email`,`oci`.`client_personal_info`,`p`.`payment_method`,`oci`.`client_phone`,`s`.`title`,`b`.`gc_event_id` ,`b`.`gc_staff_event_id` ,`b`.`staff_ids`\";\r\t\t\t$result = mysqli_query($this->conn, $query);\r\t\t\t$value = mysqli_fetch_array($result);\r\t\t\treturn $value; \r\t\t}",
"public function getPaidDate();",
"function today_get()\n {\n //Transfering id to Model\n $data = $this->model->today_order_details();\n //Sending Request Response \n $this->return_response($data);\n }",
"public function getDeclineApp($id){\n $app = App::find($id);\n $app->status = 0;\n $app->update();\n return redirect('reviewer/view/app');\n }",
"public function view_OB_apdetails($request_id = NULL){\n\t\t$val = $this->get_obdetails_DB($request_id);\n\t\t$ob = $val[0];\n\t\t$endorser = $val[1];\n\t\t$head = $val[2];\n\t\t$tl = $val[3];\n\t\t$sv = $val[4];\n\t\t$date_submitted = $val[5];\n\t\treturn view('ob_approval_details', ['ob' => $ob, 'endorser' => $endorser, 'head' => $head, 'tl' => $tl, 'sv' => $sv,'request_id' => $request_id, 'date_submitted' => $date_submitted]);\n\t}",
"public function updateAdminPaypalDetails()\n {\n /* code goes here */\n }",
"public function getNextPayDate($id)\n {\n $user_pay_dates = DB::table('payments')\n ->select(\n DB::raw('payments.*'),\n DB::raw('accounts.id as acc_id'),\n DB::raw('users.id as user_idd')\n )\n ->leftJoin('accounts', 'payments.account_no_id', 'accounts.id')\n ->leftJoin('users', 'accounts.user_id', 'users.id')\n ->where('users.id', '=', $id)\n ->get();\n\n $user_pay_dates = json_decode(json_encode($user_pay_dates), true);\n $user_pay_dates = array_column($user_pay_dates, 'user_pay_date');\n\n\n // GET THE REAL PAYMENTS DATE FOR THE CLIENT\n $pay_dates = DB::table('user_pay_modes')\n ->select(\n DB::raw('user_pay_modes.pay_dates')\n )\n ->where('user_pay_modes.user_id', '=', $id)\n ->get();\n\n $pay_dates = explode(';', $pay_dates);\n $client_pay_dates = array_filter(array_map('trim', $pay_dates));\n $client_pay_dates = str_replace('[{\"pay_dates\":\"[\\\"', '', $client_pay_dates);\n $client_pay_dates = str_replace('[{\"pay_dates\":\"', '', $client_pay_dates);\n $client_pay_dates = str_replace('\\\"]\"}]', '', $client_pay_dates);\n $client_pay_dates = str_replace('\"}]', '', $client_pay_dates);\n $client_pay_dates = str_replace('\\\",\\\"', ',', $client_pay_dates);\n\n foreach ($client_pay_dates as $key => $value) {\n $client_pay_dates = $value;\n }\n\n $client_pay_dates = explode(',', $client_pay_dates);\n\n $data['next_pay_date'] = array_diff($client_pay_dates, $user_pay_dates);\n\n if (empty($data['next_pay_date'])) {\n\n $data['next_pay_date'] = \"FULLY PAID\";\n } else {\n\n $data['next_pay_date'] = min(array_diff($client_pay_dates, $user_pay_dates));\n }\n\n // GET CLIENTS NEXT PAYMENT DATE\n // $data['next_pay_date'] = min(array_diff($client_pay_dates, $user_pay_dates));\n\n return $data['next_pay_date'];\n }",
"public function findApplication($application_id) {\n\t\t$query = 'SELECT ap.application_id AS application_id,\n\t\t\tap.apr AS apr,\n\t\t\tap.cfe_rule_set_id AS cfe_ruleset_id,\n\t\t\tap.company_id AS company_id,\n\t\t\tap.customer_id AS customer_id,\n\t\t\tap.date_application_status_set AS date_application_status_set,\n\t\t\tap.date_created AS date_created,\n\t\t\tap.date_first_payment AS date_first_payment,\n\t\t\tif(ap.date_fund_actual>\"1990-01-01\",ap.date_fund_actual,NULL) AS date_fund_actual,\n\t\t\tap.date_fund_estimated AS date_fund_estimated,\n\t\t\tap.date_modified AS date_modified,\n\t\t\tap.date_next_contact AS date_next_contact,\n\t\t\tap.enterprise_site_id AS enterprise_site_id,\n\t\t\tap.external_id AS external_id,\n\t\t\tap.finance_charge AS finance_charge,\n\t\t\tap.fund_actual AS fund_actual,\n\t\t\tap.fund_qualified AS fund_qualified,\n\t\t\tap.fund_requested AS fund_requested,\n\t\t\tap.ip_address AS ip_address,\n\t\t\tap.esig_ip_address AS esig_ip_address,\n\t\t\tap.is_react AS is_react,\n\t\t\tap.is_watched AS is_watched,\n\t\t\tap.loan_type_id AS loan_type_id,\n\t\t\tap.modifying_agent_id AS modifying_agent_id,\n\t\t\tap.payment_total AS payment_total,\n\t\t\tap.price_point AS price_point,\n\t\t\tap.rule_set_id AS rule_set_id,\n\t\t\tap.track_id AS track_key,\n\t\t\tap.application_status_id AS application_status_id,\n\t\t\tap.call_time_pref AS call_time_pref,\n\t\t\tap.contact_method_pref AS contact_method_pref,\n\t\t\tap.marketing_contact_pref AS marketing_contact_pref,\n\t\t\tap.olp_process AS olp_process,\n\t\t\tap.application_type AS application_type,\n\t\t\tap.application_id AS application_id,\n\t\t\tap.source AS application_source\n\t\tFROM application AS ap WHERE ap.application_id = '.$application_id.';';\n\n\t\t$result = $this->db->query($query);\n\t\t$rows = $result->fetch(DB_IStatement_1::FETCH_OBJ);\n\t\treturn($rows);\n\t}",
"public function seeDetails($id)\n {\n try {\n $settings = GeneralSettings::query()->whereIn('business_account_id', getDependentUserIds())->first();\n $history = LeaseHistory::query()->findOrFail($id);\n\n $lease = $history->lease;\n\n $json_step_data = collect(json_decode($history->json_data_steps, true));\n $final_data = [];\n $final_data['valuation_type'] = is_null($history->modify_id) ? \"Initial Valuation\" : $history->leaseModification->valuation;\n\n //$base_date = $account_base_date = getParentDetails()->baseDate->final_base_date;\n if($settings->date_of_initial_application == 2){\n $base_date = $account_base_date = Carbon::parse(getParentDetails()->baseDate->final_base_date)->subYear(1);\n } else {\n $base_date = $account_base_date = Carbon::parse(getParentDetails()->baseDate->final_base_date);\n }\n\n //$start_date = Carbon::parse(is_null($history->modify_id) ? $json_step_data['underlying_asset']['accural_period'] : $history->leaseModification->effective_from);\n $start_date = Carbon::parse(is_null($history->modify_id) ? $json_step_data['underlying_asset']['lease_start_date'] : $history->leaseModification->effective_from);\n\n $base_date = ($start_date->lessThan($base_date)) ? $base_date : $start_date;\n\n $final_data['effective_date'] = $base_date;\n\n $final_data[\"value_of_lease_asset\"] = $json_step_data['underlying_asset']['value_of_lease_asset'];\n\n $source = $json_step_data[\"lessor_details\"][\"lease_contract_id\"];\n\n $payments = $json_step_data['lease_payments'];\n foreach ($payments as $payment) {\n // No need to show the Non Lease Component Payments...\n if($payment['type'] != '2'){\n $payment_details = [];\n $payment_details['payment_name'] = $payment['name'];\n $payment_details['effective_lease_start_date'] = $final_data['effective_date'];\n $payment_details['lease_end_date'] = $json_step_data['underlying_asset']['lease_end_date'];\n $payment_details['undiscounted_lease_liability'] = $payment['undiscounted_value'];\n $payment_details['present_value'] = $payment['present_value'];\n $final_data['payments'][] = $payment_details;\n }\n }\n\n //termination option from the json data...\n if ($json_step_data['termination_option']['lease_termination_option_available'] == \"yes\" && $json_step_data['termination_option']['exercise_termination_option_available'] == \"yes\") {\n $final_data['payments'][] = [\n 'payment_name' => 'Termination Penalty',\n 'effective_lease_start_date' => $final_data['effective_date'],\n 'lease_end_date' => $json_step_data['termination_option']['lease_end_date'],\n 'undiscounted_lease_liability' => $json_step_data['termination_option']['undiscounted_value'],\n 'present_value' => $json_step_data['termination_option']['present_value']\n ];\n }\n\n //residual value guarantee\n if ($json_step_data['residual_value']['any_residual_value_gurantee'] == \"yes\") {\n $final_data['payments'][] = [\n 'payment_name' => 'Residual Value Guarantee',\n 'effective_lease_start_date' => $final_data['effective_date'],\n 'lease_end_date' => $json_step_data['underlying_asset']['lease_end_date'],\n 'undiscounted_lease_liability' => $json_step_data['residual_value']['undiscounted_value'],\n 'present_value' => $json_step_data['residual_value']['present_value']\n ];\n }\n\n //purchase option\n if (isset($json_step_data['purchase_option']) && $json_step_data['purchase_option']['purchase_option_clause'] == 'yes' && $json_step_data['purchase_option']['purchase_option_exerecisable'] == \"yes\") {\n $final_data['payments'][] = [\n 'payment_name' => 'Purchase Option',\n 'effective_lease_start_date' => $final_data['effective_date'],\n 'lease_end_date' => $json_step_data['purchase_option']['expected_lease_end_date'],\n 'undiscounted_lease_liability' => $json_step_data['purchase_option']['undiscounted_value'],\n 'present_value' => $json_step_data['purchase_option']['present_value']\n ];\n }\n\n\n $currency_settings = ReportingCurrencySettings::query()->whereIn('business_account_id', getDependentUserIds())->first();\n\n $show_statutory = false;\n $exchange_rate = 1;\n $statutory_currency = $currency_settings->statutory_financial_reporting_currency;\n if ($currency_settings && ($currency_settings->statutory_financial_reporting_currency != $lease->lease_contract_id)) {\n $destination = $currency_settings->statutory_financial_reporting_currency;\n $show_statutory = true;\n if (Carbon::parse($json_step_data['underlying_asset']['accural_period'])->greaterThan(Carbon::parse($base_date))) {\n $date = Carbon::parse($json_step_data['underlying_asset']['accural_period'])->format('Y-m-d');\n } else {\n $date = $base_date;\n }\n //check for the subsequent and fetch the exchange rate for the effective date in that case...\n if ($final_data['valuation_type'] == \"Subsequent Valuation\") {\n $date = $final_data['effective_date'];\n }\n\n $exchange_rate = fetchCurrencyExchangeRate($date, $source, $destination);\n }\n\n $final_data['lease_currency'] = $source;\n\n $final_data['statutory_currency'] = $currency_settings->statutory_financial_reporting_currency;\n\n $final_data['lease_balances'] = is_array($json_step_data['lease_balance']) ? $json_step_data['lease_balance'] : [];\n\n $final_data['initial_direct_cost'] = (count($json_step_data['initial_direct_cost']) > 1) ? $json_step_data['initial_direct_cost'] : [];\n\n $final_data['lease_incentives'] = (count($json_step_data['lease_incentives']) > 1) ? $json_step_data['lease_incentives'] : [];\n\n $final_data['dismantling_cost'] = (count($json_step_data['dismantling_cost']) > 1) ? $json_step_data['dismantling_cost'] : [];\n\n return view('leasevaluation.partials._see_details_valuation', compact(\n 'final_data',\n 'show_statutory',\n 'exchange_rate',\n 'statutory_currency',\n 'account_base_date'\n ));\n\n\n } catch (\\Exception $e) {\n abort(404);\n }\n }",
"public function get_booking_details_appt($orderid){\r $query = \"select\r`b`.`booking_status`,`b`.`booking_date_time`,`p`.`net_amount`,`oci`.`client_name`,`oci`.`client_email`,`oci`.`client_personal_info`,`p`.`payment_method`,`oci`.`client_phone`,`s`.`title` as `service_title`,`b`.`gc_event_id` ,`b`.`gc_staff_event_id` ,`b`.`staff_ids` ,`b`.`reject_reason` ,`oci`.`order_duration` from\r`ct_bookings` as `b`,`ct_payments` as `p`,`ct_order_client_info` as `oci`,`ct_services` as `s`\rwhere `b`.`order_id` = `p`.`order_id`\rand `b`.`order_id` = '\".$orderid.\"'\rand `b`.`order_id` = `oci`.`order_id`\rand `b`.`service_id` = `s`.`id`\rGROUP BY `b`.`booking_status`,`b`.`booking_date_time`,`p`.`net_amount`,`oci`.`client_name`,`oci`.`client_email`,`oci`.`client_personal_info`,`p`.`payment_method`,`oci`.`client_phone`,`s`.`title`,`b`.`gc_event_id` ,`b`.`gc_staff_event_id` ,`b`.`staff_ids` ,`b`.`reject_reason` ,`oci`.`order_duration`\";\r $result=mysqli_query($this->conn,$query);\r $value=mysqli_fetch_array($result);\r return $value;\r }",
"public static function update_payment_details($data)\n {\n try{\n //$updateddata['amount_paid'] = $data['amount_paid'];\n $updateddata['amount_actual'] = $data['amount_actual'];\n $updateddata['payment_status'] = $data['payment_status'];\n $updateddata['billing_time'] = date('Y-m-d H:i:s', strtotime($data['billing_time']));\n $updateddata['updated_by'] = Yii::$app->user->id;\n $updateddata['date_updated'] = date('Y-m-d H:i:s');\n\n $payment_id = $data['payment_id'];\n\n //update data in database\n Yii::$app->db->createCommand()->update('core_payments', $updateddata, \"payment_id = $payment_id\")->execute();\n \n $response ['status'] = 200;\n $response ['message'] = \"Payment updated successfully\";\n return $response;\n } catch (ErrorException $ex) {\n Yii::warning('Error while updating payment details.');\n Yii::warning($ex->getMessage());\n \n $response ['status'] = 400;\n $response ['message'] = \"Error while updating payment details\";\n return $response;\n }\n \n }",
"function GetTransactionDetails(){\n\t// GetTransactionDetails requires a Transaction ID, and GetExpressCheckoutDetails requires Token returned by SetExpressCheckOut\n\t$padata = \t'&TOKEN='.urlencode(_GET('token'));\n\t$httpParsedResponseAr = $this->PPHttpPost('GetExpressCheckoutDetails', $padata, PPL_API_USER, PPL_API_PASSWORD, PPL_API_SIGNATURE, PPL_MODE);\n\tif(\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])){\n\t\t\n\t\t/*#### SAVE BUYER INFORMATION IN DATABASE ###*/ \n\n\t\t\n\t\tglobal $wpdb;\n\t\t$fields = _SESSION('formdata');\n\t\t$data = array(\n\t\t\t'fields' \t=> json_encode(_SESSION('formdata')), \n\t\t\t'transaction_id' \t=> $httpParsedResponseAr[\"TRANSACTIONID\"], \n\t\t\t'status' \t=> strtoupper($httpParsedResponseAr[\"ACK\"]), \n\t\t);\n\t\t$wpdb->insert($wpdb->prefix.'ab_inquiries' , $data);\n\t\t$lastid = $wpdb->insert_id;\n$to = '[email protected]';\n$subject = 'EVENTS SUMMARY';\n$headers = \"From: \" . $email . \"\\r\\n\";\n\t\t\t//$headers .= \"CC: [email protected]\\r\\n\";\n$headers .= \"MIME-Version: 1.0\\r\\n\";\n$headers .= \"Content-Type: text/html; charset=ISO-8859-1\\r\\n\";\n$message = '<html><body>';\n$message .= '<table rules=\"all\" style=\"border-color: #666;\" cellpadding=\"10\">';\n\n$product = $fields['product'];\nunset($fields['product']);\nforeach ($fields as $key => $value) {\n\t$message .= \"<tr><td><strong>\".$key.\":</strong> </td><td>\" . $value . \"</td></tr>\";\n}\nif (is_array($product)) {\n\tforeach ($product as $key1) {\n\t\t$message .= \"<tr><td><strong>Product:</strong> </td><td>Name: \" . $key1['ItemName'] . \", ItemNumber: \" . $key1['ItemNumber'] . \" , ItemQty:\" . $key1['ItemQty'] . \" , ItemPrice:\" . $key1['ItemPrice'] . \"</td></tr>\";\n\t}\n}\n$message .= \"</table>\";\n$message .= \"</body></html>\";\n$mail = wp_mail( $to, $subject, $message, $headers);\necho \"<script>window.location = '\".site_url('/sucess/?paymentID='.$lastid).\"'</script>\";\n\n\t}\n\telse {\n\t\techo '<div style=\"color:red\"><b>GetTransactionDetails failed:</b>'.urldecode($httpParsedResponseAr[\"L_LONGMESSAGE0\"]).'</div>';\n\t\techo '<pre>';\n\t\tprint_r($httpParsedResponseAr);\n\t\techo '</pre>';\n\t}\n}",
"public function getApproveApp($id){\n $app = App::find($id);\n $app->status = 3;\n $app->update();\n return redirect('reviewer/view/app');\n }",
"public static function getAllDataEvaluateOne($appid) // Get All Information on Single Application\n\t\t{\n\t\t\ttry \n\t\t\t{\n\t\t\t\t$data = DB::table('appform')\n\t\t\t\t\t\t->leftJoin('x08', 'appform.uid', '=', 'x08.uid')\n\t\t\t\t\t\t->leftJoin('barangay', 'appform.brgyid', '=', 'barangay.brgyid')\n\t\t\t\t\t\t->leftJoin('city_muni', 'appform.cmid', '=', 'city_muni.cmid')\n\t\t\t\t\t\t->leftJoin('province', 'appform.provid', '=', 'province.provid')\n\t\t\t\t\t\t->leftJoin('hfaci_serv_type', 'appform.hfser_id', '=', 'hfaci_serv_type.hfser_id') \n\t\t\t\t\t\t->leftJoin('trans_status', 'appform.status', '=', 'trans_status.trns_id')\n\t\t\t\t\t\t->leftJoin('facmode', 'appform.facmode', '=', 'facmode.facmid')\n\t\t\t\t\t\t->select('appform.*', 'appform.street_name', 'appform.street_name as streetname', 'x08.zipcode' ,'barangay.brgyname', 'city_muni.cmname', 'province.provname', 'appform.recommendedtime', 'appform.recommendeddate', 'hfaci_serv_type.*', 'appform.aptid', 'appform.status', 'trans_status.trns_desc', 'facmode.facmdesc', 'appform.street_number')\n\t\t\t\t\t\t->where('appform.appid', '=', $appid)\n\t\t\t\t\t\t->first();\n\t\t\t\t\n\t\t\t\tif (isset($data) && ($data->recommendedtime !== null && $data->recommendeddate !== null)) {\n\t\t\t\t\t\t$newT = Carbon::parse($data->proposedInspectiontime);\n\t\t\t\t\t\t$data->formattedPropTime = $newT->format('g:i A');\n\t\t\t\t\t\t$newD = Carbon::parse($data->proposedInspectiondate);\n\t\t\t\t\t\t$data->formattedPropDate = $newD->toFormattedDateString();\n\t\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t\t\n\t\t\t\t\n\t\t\t} \n\t\t\tcatch (Exception $e) \n\t\t\t{\n\t\t\t\tAjaxController::SystemLogs($e->getMessage());\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}",
"public function get_ob_checking_date()\n\t{\n\t\t$case_type = $this->input->post('case_type');\n\t\t$case_status = $this->input->post('case_status');\n\t\t$client = $this->input->post('client');\n\t\techo $this->new_case->get_ob_checking_date($case_type, $case_status, $client);\n\t}",
"public function getUpdateView() {\n $reqUserId = getSessionUserId();\n $user = new User();\n if ($reqUserId > 0) {\n $user->findUserById($reqUserId);\n } else {\n echo \"You have to be logged in to access user info!\";\n }\n $this->validateRequest(array('budgetId'));\n $budget_id = (int) $_REQUEST['budgetId'];\n \n $budget = new Budget();\n if ($budget->loadById($budget_id)) {\n $sources = $budget->loadSources();\n $budgetClosed = !$budget->active;\n $allocated = $budget->getAllocatedFunds();\n $submitted = $budget->getSubmittedFunds();\n $paid = $budget->getPaidFunds();\n $transfered = $budget->getTransferedFunds();\n $remaining = $budget->amount - $allocated - $submitted - $paid - $transfered;\n $this->respond(true, 'Returning data', array(\n 'amount' => $budget->amount,\n 'closed' => $budgetClosed,\n 'reason' => $budget->reason,\n 'req_user_authorized' => strpos(BUDGET_AUTHORIZED_USERS, \",\" . $reqUserId . \",\") !== false,\n 'seed' => $budget->seed,\n 'sources' => $sources,\n 'notes' => $budget->notes,\n 'remaining' => money_format('%i', $remaining),\n 'allocated' => money_format('%i', $allocated),\n 'submitted' => money_format('%i', $submitted),\n 'paid' => money_format('%i', $paid),\n 'transferred' => money_format('%i', $transfered) \n ));\n } else {\n $this->respond(true, 'Invalid budget id');\n }\n }",
"public function get_update_info () {\n $this->error = '';\n $fields = array( \"action\" => \"get_update_info\", \"auth\" => \"{$this->auth}\" );\n $response = $this->_sendRequest ( $fields );\n if ( $response ) {\n if ( $response[ \"status\" ] == \"success\" ) {\n if ( isset ( $response[ 'data' ] ) ) {\n if ( gettype ( $response[ 'data' ] ) == 'string' ) {\n $response[ 'data' ] = json_decode ( $response[ 'data' ] );\n }\n }\n //$new_version = $response[ \"data\" ]->new_version; // The latest version of the plugin\n //$package_url = $response[ \"data\" ]->package; // The automatic update package URL\n return isset ( $response[ 'data' ] ) ? $response[ 'data' ] : false;\n } else {\n // output error message found in $response[\"errmsg\"]\n $this->error = $response[ 'errmsg' ];\n }\n }\n return false;\n }",
"function save_booking($app_booking_id, $book_params, $currency_obj, $module = 'b2c') {\r\n // debug($book_params);exit;\r\n //Need to return following data as this is needed to save the booking fare in the transaction details\r\n $response['fare'] = $response['domain_markup'] = $response['level_one_markup'] = 0;\r\n $book_total_fare = array();\r\n $book_domain_markup = array();\r\n $book_level_one_markup = array();\r\n $master_transaction_status = 'BOOKING_INPROGRESS';\r\n $master_search_id = $book_params['search_id'];\r\n\r\n $domain_origin = get_domain_auth_id();\r\n $app_reference = $app_booking_id;\r\n $booking_source = $book_params['token']['booking_source'];\r\n\r\n //PASSENGER DATA UPDATE\r\n $total_pax_count = count($book_params['passenger_type']);\r\n $pax_count = $total_pax_count;\r\n\r\n //Extract ExtraService Details\r\n $extra_service_details = $this->extract_extra_service_details($book_params);\r\n\r\n //PREFERRED TRANSACTION CURRENCY AND CURRENCY CONVERSION RATE \r\n $transaction_currency = get_application_currency_preference();\r\n $application_currency = admin_base_currency();\r\n $currency_conversion_rate = $currency_obj->transaction_currency_conversion_rate();\r\n //********************** only for calculation\r\n $safe_search_data = $this->search_data($master_search_id);\r\n $safe_search_data = $safe_search_data['data'];\r\n $is_domestic = $safe_search_data['is_domestic'];\r\n $safe_search_data['is_domestic_one_way_flight'] = false;\r\n $from_to_trip_type = $safe_search_data['trip_type'];\r\n $cabin_class = $safe_search_data['v_class'];\r\n if (strtolower($from_to_trip_type) == 'multicity') {\r\n $from_loc = $safe_search_data['from'][0];\r\n $to_loc = end($safe_search_data['to']);\r\n $journey_from = $safe_search_data['from_city'][0];\r\n $journey_to = end($safe_search_data['to_city']);\r\n } else {\r\n $from_loc = $safe_search_data['from'];\r\n $to_loc = $safe_search_data['to'];\r\n $journey_from = $safe_search_data['from_city'];\r\n $journey_to = $safe_search_data['to_city'];\r\n }\r\n \r\n $safe_search_data['is_domestic_one_way_flight'] = $GLOBALS['CI']->flight_model->is_domestic_flight($from_loc, $to_loc);\r\n if ($safe_search_data['is_domestic_one_way_flight'] == false && strtolower($from_to_trip_type) == 'circle') {\r\n // $multiplier = $pax_count * 2; //Multiply with 2 for international round way\r\n $multiplier = $pax_count;\r\n } else if (strtolower($from_to_trip_type) == 'multicity') {\r\n $multiplier = $pax_count * count($safe_search_data['from']);\r\n } else {\r\n $multiplier = $pax_count;\r\n }\r\n $token = $book_params['token']['token'];\r\n\r\n //********************* only for calculation\r\n $master_booking_source = array();\r\n $currency = $currency_obj->to_currency;\r\n $deduction_cur_obj = clone $currency_obj;\r\n //Storing Flight Details - Every Segment can repeate also\r\n $segment_summary = array();\r\n $ext_mkp_dvd = count($token);\r\n foreach ($token as $token_index => $token_value) {\r\n $segment_details = $token_value['SegmentDetails'];\r\n $segment_summary[$token_index] = $token_value['SegmentSummary'];\r\n $Fare = $token_value['FareDetails']['api_PriceDetails'];\r\n $seg_count = 0;\r\n foreach ($segment_details as $seg_k => $seg_v) {\r\n $seg_count += count($seg_v);\r\n }\r\n $multiplier = $multiplier*$seg_count;\r\n $tmp_domain_markup = 0;\r\n $tmp_level_one_markup = 0;\r\n $itinerary_price = $Fare['BaseFare'];\r\n\r\n //Calculation is different for b2b and b2c\r\n //Specific Markup Config\r\n $specific_markup_config = array();\r\n $specific_markup_config = $this->get_airline_specific_markup_config($segment_details); //Get the Airline code for setting airline-wise markup\r\n $for_commission_details = array(); \r\n $final_booking_price_details = $this->get_final_booking_price_details($Fare, $multiplier, $specific_markup_config, $currency_obj, $deduction_cur_obj, $module, $token_value, $is_domestic);\r\n\r\n if($module == 'b2c'){\r\n $total_markup = $final_booking_price_details['admin_markup'];\r\n }\r\n else{\r\n\t\t\t\t$temp_agt_markup = $final_booking_price_details['agent_markup'];\r\n $final_booking_price_details['agent_markup'] += ($book_params[\"markup\"]/$ext_mkp_dvd);\r\n\t\t\t\tif(trim($book_params['markup'])!=\"\" && $book_params['markup']>=0){\r\n\t\t\t\t\t$final_booking_price_details['agent_markup'] -= $temp_agt_markup;\r\n\t\t\t\t}\r\n $total_markup = $final_booking_price_details['admin_markup'] + $final_booking_price_details['agent_markup'];\r\n }\r\n $gst_value = 0;\r\n if($final_booking_price_details['admin_markup'] > 0 ){\r\n $gst_details = $GLOBALS['CI']->custom_db->single_table_records('gst_master', '*', array('module' => 'flight'));\r\n if($gst_details['status'] == true){\r\n if($gst_details['data'][0]['gst'] > 0){\r\n $gst_value = ($final_booking_price_details['admin_markup']/100) * $gst_details['data'][0]['gst'];\r\n }\r\n }\r\n }\r\n\r\n \r\n $commissionable_fare = $final_booking_price_details['commissionable_fare'];\r\n $trans_total_fare = $final_booking_price_details['trans_total_fare'];\r\n $admin_markup = $final_booking_price_details['admin_markup'];\r\n $agent_markup = $final_booking_price_details['agent_markup'];\r\n $admin_commission = $final_booking_price_details['admin_commission'];\r\n $agent_commission = $final_booking_price_details['agent_commission'];\r\n $admin_tds = $final_booking_price_details['admin_tds'];\r\n $agent_tds = $final_booking_price_details['agent_tds'];\r\n \r\n //**************Ticketing For Each Token START\r\n //Following Variables are used to save Transaction and Pax Ticket Details\r\n $pnr = '';\r\n $book_id = '';\r\n $source = '';\r\n $ref_id = '';\r\n $transaction_status = 0;\r\n $GetBookingResult = array();\r\n $transaction_description = '';\r\n $getbooking_StatusCode = '';\r\n $getbooking_Description = '';\r\n $getbooking_Category = '';\r\n $WSTicket = array();\r\n $WSFareRule = array();\r\n //Saving Flight Transaction Details\r\n $tranaction_attributes = array();\r\n $pnr = '';\r\n $book_id = '';\r\n //$source = $this->get_tbo_source_name($token_value['Source']);\r\n $source = '';\r\n $ref_id = '';\r\n $transaction_status = $master_transaction_status;\r\n $transaction_description = '';\r\n //Get Booking Details\r\n $getbooking_status_details = '';\r\n $getbooking_StatusCode = '';\r\n $getbooking_Description = '';\r\n $getbooking_Category = '';\r\n $tranaction_attributes['Fare'] = $Fare;\r\n $sequence_number = $token_index;\r\n //Transaction Log Details\r\n $ticket_trans_status_group[] = $transaction_status;\r\n $book_total_fare[] = $trans_total_fare;\r\n $book_domain_markup[] = $admin_markup;\r\n $book_level_one_markup[] = $agent_markup;\r\n //Need individual transaction price details\r\n //SAVE Transaction Details\r\n $transaction_insert_id = $GLOBALS['CI']->flight_model->save_flight_booking_transaction_details(\r\n $app_reference, $transaction_status, $transaction_description, $pnr, $book_id, $source, $ref_id, json_encode($tranaction_attributes), $sequence_number, $currency, $commissionable_fare, $admin_markup, $agent_markup, $admin_commission, $agent_commission, $getbooking_StatusCode, $getbooking_Description, $getbooking_Category, $admin_tds, $agent_tds, $gst_value\r\n );\r\n $transaction_insert_id = $transaction_insert_id['insert_id'];\r\n //Saving Passenger Details\r\n $i = 0;\r\n for ($i = 0; $i < $total_pax_count; $i++) {\r\n $passenger_type = $book_params['passenger_type'][$i];\r\n $is_lead = (empty($book_params['lead_passenger'][$i]))? 0: 1;\r\n $title = get_enum_list('title', $book_params['name_title'][$i]);\r\n $first_name = $book_params['first_name'][$i];\r\n $middle_name = ''; //$book_params['middle_name'][$i];\r\n $last_name = $book_params['last_name'][$i];\r\n $date_of_birth = $book_params['date_of_birth'][$i];\r\n $gender = get_enum_list('gender', $book_params['gender'][$i]);\r\n\r\n $passenger_nationality_id = intval($book_params['passenger_nationality'][$i]);\r\n $passport_issuing_country_id = intval($book_params['passenger_passport_issuing_country'][$i]);\r\n $passenger_nationality = $GLOBALS['CI']->db_cache_api->get_country_list(array('k' => 'origin', 'v' => 'name'), array('origin' => $passenger_nationality_id));\r\n $passport_issuing_country = $GLOBALS['CI']->db_cache_api->get_country_list(array('k' => 'origin', 'v' => 'name'), array('origin' => $passport_issuing_country_id));\r\n\r\n $passenger_nationality = isset($passenger_nationality[$passenger_nationality_id]) ? $passenger_nationality[$passenger_nationality_id] : '';\r\n $passport_issuing_country = isset($passport_issuing_country[$passport_issuing_country_id]) ? $passport_issuing_country[$passport_issuing_country_id] : '';\r\n\r\n $passport_number = $book_params['passenger_passport_number'][$i];\r\n $passport_expiry_date = $book_params['passenger_passport_expiry_year'][$i] . '-' . $book_params['passenger_passport_expiry_month'][$i] . '-' . $book_params['passenger_passport_expiry_day'][$i];\r\n //$status = 'BOOKING_CONFIRMED';//Check it\r\n $status = $master_transaction_status;\r\n\r\n //Pax fare attribute\r\n $passenger_attributes = array();\r\n if($passenger_type == 'Adult'){\r\n $passenger_attributes = $token_value['PassengerFareBreakdown']['ADT']; \r\n }else if($passenger_type == 'Child'){\r\n $passenger_attributes = $token_value['PassengerFareBreakdown']['CHD'];\r\n }else{\r\n $passenger_attributes = $token_value['PassengerFareBreakdown']['INF'];\r\n }\r\n \r\n\r\n\r\n $flight_booking_transaction_details_fk = $transaction_insert_id; //Adding Transaction Details Origin\r\n //SAVE Pax Details\r\n $pax_insert_id = $GLOBALS['CI']->flight_model->save_flight_booking_passenger_details(\r\n $app_reference, $passenger_type, $is_lead, $title, $first_name, $middle_name, $last_name, $date_of_birth, $gender, $passenger_nationality, $passport_number, $passport_issuing_country, $passport_expiry_date, $status, json_encode($passenger_attributes), $flight_booking_transaction_details_fk);\r\n\r\n //Save passenger ticket information\r\n $passenger_ticket_info = $GLOBALS['CI']->flight_model->save_passenger_ticket_info($pax_insert_id['insert_id']);\r\n }//Adding Pax Details Ends\r\n //Saving Segment Details\r\n \r\n foreach ($segment_details as $seg_k => $seg_v) {\r\n $curr_segment_indicator = 1;\r\n foreach ($seg_v as $ws_key => $ws_val) {\r\n $FareRestriction = '';\r\n $FareBasisCode = '';\r\n $FareRuleDetail = '';\r\n $airline_pnr = '';\r\n $cabin_baggage = $ws_val['CabinBaggage'];\r\n $checkin_baggage = $ws_val['Baggage'];\r\n $is_refundable = @$token_value['Attr']['IsRefundable']; \r\n if(isset($is_refundable) && !empty($is_refundable) && $is_refundable == 1){\r\n $is_refundable = 'Refundable';\r\n }\r\n else{\r\n $is_refundable = 'Non Refundable';\r\n }\r\n $AirlineDetails = $ws_val['AirlineDetails'];\r\n $OriginDetails = $ws_val['OriginDetails'];\r\n $DestinationDetails = $ws_val['DestinationDetails'];\r\n //$segment_indicator = $ws_val['SegmentIndicator'];\r\n $segment_indicator = ($curr_segment_indicator++);\r\n\r\n $airline_code = $AirlineDetails['AirlineCode'];\r\n $airline_name = $AirlineDetails['AirlineName'];\r\n $flight_number = $AirlineDetails['FlightNumber'];\r\n $fare_class = $AirlineDetails['FareClass'];\r\n $from_airport_code = $OriginDetails['AirportCode'];\r\n $from_airport_name = $OriginDetails['AirportName'];\r\n $to_airport_code = $DestinationDetails['AirportCode'];\r\n $to_airport_name = $DestinationDetails['AirportName'];\r\n $departure_datetime = date('Y-m-d H:i:s', strtotime($OriginDetails['DateTime']));\r\n $arrival_datetime = date('Y-m-d H:i:s', strtotime($DestinationDetails['DateTime']));\r\n $iti_status = '';\r\n $operating_carrier = $AirlineDetails['AirlineCode'];\r\n $attributes = array('craft' => @$ws_val['Craft'], 'ws_val' => $ws_val);\r\n \r\n //SAVE ITINERARY\r\n $GLOBALS['CI']->flight_model->save_flight_booking_itinerary_details(\r\n $app_reference, $segment_indicator, $airline_code, $airline_name, $flight_number, $fare_class, $from_airport_code, $from_airport_name, $to_airport_code, $to_airport_name, $departure_datetime, $arrival_datetime, $iti_status, $operating_carrier, json_encode($attributes), $FareRestriction, $FareBasisCode, $FareRuleDetail, $airline_pnr, $cabin_baggage, $checkin_baggage, $is_refundable);\r\n }\r\n }//End Of Segments Loop\r\n }//End Of Token Loop\r\n //Save Master Booking Details\r\n $book_total_fare = array_sum($book_total_fare);\r\n $book_domain_markup = array_sum($book_domain_markup);\r\n $book_level_one_markup = array_sum($book_level_one_markup);\r\n $phone_country_code = $book_params['phone_country_code'];\r\n $phone = $book_params['passenger_contact'];\r\n \r\n $alternate_number = '';\r\n $email = $book_params['billing_email'];\r\n $start = $token[0];\r\n $end = end($token);\r\n\r\n $journey_start = $segment_summary[0][0]['OriginDetails']['DateTime'];\r\n $journey_start = date('Y-m-d H:i:s', strtotime($journey_start));\r\n $journey_end = end(end($segment_summary));\r\n $journey_end = $journey_end['DestinationDetails']['DateTime'];\r\n $journey_end = date('Y-m-d H:i:s', strtotime($journey_end));\r\n $payment_mode = $book_params['payment_method'];\r\n $created_by_id = intval(@$GLOBALS['CI']->entity_user_id);\r\n\r\n $passenger_country_id = intval($book_params['billing_country']);\r\n //$passenger_city_id = intval($book_params['billing_city']);\r\n $passenger_country = $GLOBALS['CI']->db_cache_api->get_country_list(array('k' => 'origin', 'v' => 'name'), array('origin' => $passenger_country_id));\r\n //$passenger_city = $GLOBALS['CI']->db_cache_api->get_city_list(array('k' => 'origin', 'v' => 'destination'), array('origin' => $passenger_city_id));\r\n\r\n $passenger_country = isset($passenger_country[$passenger_country_id]) ? $passenger_country[$passenger_country_id] : '';\r\n //$passenger_city = isset($passenger_city[$passenger_city_id]) ? $passenger_city[$passenger_city_id] : '';\r\n $passenger_city = $book_params['billing_city'];\r\n\r\n $attributes = array('country' => $passenger_country, 'city' => $passenger_city, 'zipcode' => $book_params['billing_zipcode'], 'address' => $book_params['billing_address_1']);\r\n $flight_booking_status = $master_transaction_status;\r\n $gst_details = '';\r\n if(!empty($book_params['gst_number'])){\r\n $gst_details = array();\r\n $gst_details['gst_number'] = $book_params['gst_number'];\r\n $gst_details['gst_company_name'] = $book_params['gst_company_name'];\r\n $gst_details['gst_email'] = $book_params['gst_email'];\r\n $gst_details['gst_phone'] = $book_params['gst_phone'];\r\n $gst_details['gst_address'] = $book_params['gst_address'];\r\n $gst_details['gst_state'] = $book_params['gst_state'];\r\n $gst_details = json_encode($gst_details);\r\n }\r\n $booking_billing_type = $book_params['selected_pm'];\r\n //SAVE Booking Details\r\n\t\t$price_attr = json_encode($book_params[\"token\"][\"token\"][0][\"PassengerFareBreakdown\"], true);\r\n $GLOBALS['CI']->flight_model->save_flight_booking_details(\r\n $domain_origin, $flight_booking_status, $app_reference, $cabin_class, $booking_source, $phone, $alternate_number, $email, $journey_start, $journey_end, $journey_from, $journey_to, $payment_mode, json_encode($attributes), $created_by_id, $from_loc, $to_loc, $from_to_trip_type, $transaction_currency, $currency_conversion_rate, $gst_details, $phone_country_code, $booking_billing_type, $price_attr);\r\n\r\n //Save Passenger Baggage Details\r\n \r\n if (isset($extra_service_details['ExtraServiceDetails']['Baggage']) == true && valid_array($extra_service_details['ExtraServiceDetails']['Baggage']) == true) {\r\n $this->save_passenger_baggage_info($app_reference, $book_params, $extra_service_details['ExtraServiceDetails']['Baggage']);\r\n }\r\n\r\n\r\n //Save Passenger Meals Details\r\n if (isset($extra_service_details['ExtraServiceDetails']['Meals']) == true && valid_array($extra_service_details['ExtraServiceDetails']['Meals']) == true) {\r\n $this->save_passenger_meal_info($app_reference, $book_params, $extra_service_details['ExtraServiceDetails']['Meals']);\r\n }\r\n //Save Passenger Meals Details\r\n if (isset($extra_service_details['ExtraServiceDetails']['Seat']) == true && valid_array($extra_service_details['ExtraServiceDetails']['Seat']) == true) {\r\n $this->save_passenger_seat_info($app_reference, $book_params, $extra_service_details['ExtraServiceDetails']['Seat']);\r\n }\r\n //Meal Preference\r\n if (isset($extra_service_details['ExtraServiceDetails']['MealPreference']) == true && valid_array($extra_service_details['ExtraServiceDetails']['MealPreference']) == true) {\r\n $this->save_passenger_meal_preference($app_reference, $book_params, $extra_service_details['ExtraServiceDetails']['MealPreference']);\r\n }\r\n //Seat Preference\r\n if (isset($extra_service_details['ExtraServiceDetails']['SeatPreference']) == true && valid_array($extra_service_details['ExtraServiceDetails']['SeatPreference']) == true) {\r\n $this->save_passenger_seat_preference($app_reference, $book_params, $extra_service_details['ExtraServiceDetails']['SeatPreference']);\r\n }\r\n\r\n //Add Extra Service Price to published price\r\n $GLOBALS['CI']->flight_model->add_extra_service_price_to_published_fare($app_reference);\r\n\r\n //Adding Extra services Total Price\r\n $extra_services_total_price = $GLOBALS['CI']->flight_model->get_extra_services_total_price($app_reference);\r\n // $book_total_fare += $extra_services_total_price;\r\n\r\n /* * ************ Update Convinence Fees And Other Details Start ***************** */\r\n //Convinence_fees to be stored and discount\r\n $convinence = 0;\r\n $discount = 0;\r\n $convinence_value = 0;\r\n $convinence_type = 0;\r\n $convinence_type = 0;\r\n if ($module == 'b2c') {\r\n $total_transaction_amount = $book_total_fare + $book_domain_markup;\r\n $bd_attrs = $book_params;\r\n $pg_name = $bd_attrs[\"selected_pm\"];\r\n $payment_method = $bd_attrs[\"payment_method\"];\r\n $bank_code = $bd_attrs[\"bank_code\"];\r\n if($payment_method == \"credit_card\")\r\n $method = \"CC\";\r\n if($payment_method == \"debit_card\")\r\n $method = \"DC\";\r\n if($payment_method == \"paytm_wallet\")\r\n $method = \"PPI\";\r\n if($payment_method == \"wallet\")\r\n $method = \"wallet\";\r\n $convinence_array = $currency_obj->get_instant_recharge_convenience_fees($total_transaction_amount, $method, $bank_code);\r\n $convinence = $convinence_array[\"cf\"];\r\n $supplier_fees = $convinence_array[\"sf\"];\r\n $pace_fees = $convinence_array[\"pf\"];\r\n $convinence_value = $convinence;\r\n $convinence_type = \"plus\";\r\n $convinence_per_pax = 0; \r\n $discount = $book_params['promo_code_discount_val'];\r\n $promo_code = $book_params['promo_code'];\r\n } elseif ($module == 'b2b') {\r\n $tta_temp = $book_total_fare + $book_domain_markup+$book_level_one_markup;\r\n $bd_attrs = $book_params;\r\n $pg_name = $bd_attrs[\"selected_pm\"];\r\n $payment_method = $bd_attrs[\"payment_method\"];\r\n $bank_code = $bd_attrs[\"bank_code\"];\r\n if($payment_method == \"credit_card\")\r\n $method = \"CC\";\r\n if($payment_method == \"debit_card\")\r\n $method = \"DC\";\r\n if($payment_method == \"paytm_wallet\")\r\n $method = \"PPI\";\r\n if($payment_method == \"wallet\")\r\n $method = \"wallet\";\r\n $convinence_array = $currency_obj->get_instant_recharge_convenience_fees($tta_temp, $method, $bank_code);\r\n $convinence = $convinence_array[\"cf\"];\r\n $supplier_fees = $convinence_array[\"sf\"];\r\n $pace_fees = $convinence_array[\"pf\"];\r\n $convinence_value = $convinence;\r\n $convinence_type = \"plus\";\r\n $discount = 0;\r\n $convinence_per_pax = 0;\r\n }\r\n $GLOBALS['CI']->load->model('transaction');\r\n //SAVE Convinience and Discount Details\r\n $GLOBALS['CI']->transaction->update_convinence_discount_details('flight_booking_details', $app_reference, $discount, $promo_code, $convinence, $convinence_value, $convinence_type, $convinence_per_pax, 0, $pace_fees, $supplier_fees);\r\n /* * ************ Update Convinence Fees And Other Details End ***************** */\r\n\r\n /**\r\n * Data to be returned after transaction is saved completely\r\n */\r\n $response['fare'] = $book_total_fare;\r\n $response['admin_markup'] = $book_domain_markup;\r\n $response['agent_markup'] = $book_level_one_markup;\r\n $response['convinence'] = $convinence;\r\n $response['discount'] = $discount;\r\n\r\n $response['status'] = $flight_booking_status;\r\n $response['status_description'] = $transaction_description;\r\n $response['name'] = $first_name;\r\n $response['phone'] = $phone;\r\n\r\n return $response;\r\n }",
"function update_app($phone,$agent_id,$sn,$actv_date,$appt_time,$adsl_no,$mobile_no,$iptv_no,$inst_add,$applcnt_name,$nric,$product,$speed,$ssp,$dealer,$notes,$snd_contact,$prod_officer,$campaign,$date)\n\t\t{\n\n\t\t\t//$where = \"author_id = 1 AND status = 'active'\";\n\t\t\t\n\t\t\t//$str = $this->db->update_string('table_name', $data, $where); \n\t\t\t//return $this->db->query(\"UPDATE trck_sales SET SN = '$sn',last_update = NOW(),actv_date = '$actv_date',appt_time = '$appt_time',ADSL_NO = '$adsl_no',mobile_no = '$mobile_no',phone_no = '$phone',IPTV_NO = '$iptv_no',inst_add = '$inst_add',app_name = '$applcnt_name',NRIC = '$nric',product = '$product',speed = '$speed',SSP = '$ssp',dealer = '$dealer',agent_id = '$agent_id',notes = \\\"$notes\\\",snd_contact = '$snd_contact',prod_officer = '$prod_officer',campaign = '$campaign' WHERE phone_no ='$phone' and agent_id = '$agent_id'\");\n\t\t\t\n\t\t\t$data = array(\n\t\t\t\t\t 'SN' => $sn ,\n\t\t\t\t\t 'last_update' => $date,\n\t\t\t\t\t 'actv_date' => $actv_date,\n\t\t\t\t\t 'appt_time' => $appt_time,\n\t\t\t\t\t 'ADSL_NO' => $adsl_no,\n\t\t\t\t\t 'mobile_no' => $mobile_no,\n\t\t\t\t\t 'phone_no' => $phone,\n\t\t\t\t\t 'IPTV_NO' => $iptv_no,\n\t\t\t\t\t 'inst_add' => $inst_add,\n\t\t\t\t\t\t'app_name' => $applcnt_name,\n\t\t\t\t\t 'NRIC' => $nric ,\n\t\t\t\t\t 'product' => $product,\n\t\t\t\t\t 'speed' => $speed,\n\t\t\t\t\t 'SSP' => $ssp,\n\t\t\t\t\t 'dealer' => $dealer,\n\t\t\t\t\t 'agent_id' => $agent_id,\n\t\t\t\t\t 'notes' => $notes,\n\t\t\t\t\t 'snd_contact' => $snd_contact,\n\t\t\t\t\t 'prod_officer' => $prod_officer,\n\t\t\t\t\t 'campaign' => $campaign\n\t\t\t\t\t);\n\t\t\tif (isset($_POST['update'])) {\n\t\t\t\t$data_2 = array('appt_date' => $date);\n\t\t\t\t$data = array_merge($data, $data_2);\n\t\t\t}\n\t\t\t\t$this->db->where('phone_no',$phone);\n\t\t\t\t$this->db->where('agent_id',$agent_id);\n\t\t\t\treturn $this->db->update('trck_sales', $data);\n\t\t\t\t\t\n\t\t\n\t\t}",
"public function upcomingAppoinment(){\n\t\tif(empty($_SESSION['service'])){\n\t\t\tredirect(\"Service/login\");\n\t\t}\n\t\t$_POST['user_id'] = $_SESSION['service']->data->id;\n\t\t$_POST['token']=$_SESSION['service']->token;\n\t\t$_POST['user_type'] =2;\n\t\t$_POST['appoinment_id'] = $this->uri->segment('3');\n\t\t$service_url = api_base_url('getAppoinmentDetails');\n\t\t$curl_post_data = $_POST;\n\t\t$response = call_postMethod($type = \"POST\",$service_url,$curl_post_data);\n\t\t$data = json_decode($response);\n\n\t\t$title['title']=\"Appointment Detail\";\n\t\t$this->load->view('includes/service/metadata',$title);\n\t\t$this->load->view('includes/service/header',$title);\n\t\t$this->load->view('includes/service/sidebar');\n\t\t$this->load->view('service/upcoming_appointments',$data);\n\t\t$this->load->view('includes/service/footer');\t\n\t}",
"private function fix_appoitnment(){\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\t$user_id = $_GET['user_id'];\n\t\t\t$doc_id = $_GET['doctor_id'];\n\t\t\t$created_at = date('Y-m-d H:i:s');\n\t\t\t$updated_at = date('Y-m-d H:i:s');\n\t\t\tif(isset($user_id)) {\n\t\t\t\t\t$availability = $this->_request['doctor_availability_time'];\n\t\t\t\t\tif(!isset($_POST['doctor_availability_time'])){\n\t\t\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter specializaton is required\");\n\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t\t}\n\t\t\t\t\tif(!isset($availability) && $availability=''){\n\t\t\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Time is required\");\n\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t\t} else{\n\t\t\t\t\t\t\t$sql = \"SELECT `doctor_ava_time` FROM doctor_timeslot WHERE `doctor_id` = \".$doc_id.\" \";\n\t\t\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t\t\t$searchResult = $stmt->execute();\n\t\t\t\t\t\t\t$results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t//If time is selected by another user\n\t\t\t\t\t\t\tforeach($results as $res){\n\t\t\t\t\t\t\t\t$res = array_merge($res);\n\t\t\t\t\t\t\t\t\tif(in_array($_POST['doctor_availability_time'], $res)) {\n\t\t\t\t\t\t\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Please select another time as doctor is busy\");\n\t\t\t\t\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t//Lunch time\n\t\t\t\t\t\t$lunch_st = \"01:00:00\";\n\t\t\t\t\t\t$lunch_end = \"02:00:00\";\n\t\t\t\t\t\t$inuput_val = DateTime::createFromFormat('H:i:s', $_POST['doctor_availability_time']);\n\t\t\t\t\t\t$lts = DateTime::createFromFormat('H:i:s', $lunch_st);\n\t\t\t\t\t\t$lte = DateTime::createFromFormat('H:i:s', $lunch_end);\n\t\t\t\t\t\tif($inuput_val >= $lts && $inuput_val <= $lte) {\n\t\t\t\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Lunch time, please select another time\");\n\t\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$sql = \"INSERT INTO doctor_timeslot (`doctor_id`, `doctor_ava_time`, `patient_id`, `created_at`, `updated_at`) VALUES ( \".$doc_id.\",'\".$_POST['doctor_availability_time'].\"',\".$user_id.\", '\".$created_at.\"', '\".$updated_at.\"')\";\n\t\t\t\t\t\t$execute = $this->db->query($sql);\n\t\t\t\t\t\tprint_r($execute);\n\t\t\t\t\t\t\tif($execute) {\n\t\t\t\t\t\t\t\t$error = array('status' => \"Sucess\", \"msg\" => \"Appoitment fixed\");\n\t\t\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t} else{\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Session expired\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t}",
"public function get_assessment($assessmentID) {\n\t\t$app_id = $this->db\n\t\t\t\t ->select('app_id')\n\t\t\t\t ->from('assessments')\n\t\t\t\t ->where('assessment_id',$assessmentID)\n\t\t\t\t ->get();\n\t\t$app_id = $app_id->result();\n\t\t\n\n\t\t//get application_id (New or Renew)\n\t\t$application_id = $this->db\n\t\t\t\t\t\t ->select('application_id')\n\t\t\t\t\t\t ->from('applications')\n\t\t\t\t\t\t ->where('app_id',$app_id[0]->app_id)\n\t\t\t\t\t\t ->get();\n\t\t$application_id = $application_id->result();\n\n\t\t//get business_nature in business_line table for the business\n\t\t$buss_nature_id = $this->db\n\t\t\t\t\t\t ->select('buss_nature_id')\n\t\t\t\t\t\t ->from('business_line')\n\t\t\t\t\t\t ->where('app_id',$app_id[0]->app_id)\n\t\t\t\t\t\t ->get();\n\t\t$buss_nature_id = $buss_nature_id->result();\n\n \t$assessments = $this->db\n\t\t\t\t\t\t->distinct()\n\t\t\t\t\t\t->select('bn.business_nature, apptype.types application_type,b.payment_id,b.permit_number,b.old_permit_number')\n\t\t\t\t\t\t->select('bar.brgy')\n\t\t\t\t\t\t->select('b.ownership_id,o.firstname, o.middlename, o.lastname, o.house_no_bldg_name,o.o_subdivision_street,o.o_muni,o.o_province, o.contact_number')\n\t\t\t\t\t\t->select('assess.total_tax_due, assess.assessment_id,assess.breakdowns, assess.status, assess.assessment_date,assess.flag_paid_all,assess.tfos,assess.addtltfo')\n\t\t\t\t\t\t->select('a.buss_id, a.owner_id, bl.capital')\n\t\t\t\t\t\t->select('a.application_id, pt.types payment_type')\n\t\t\t\t\t\t->select('p.pay_id,p.count,p.pay_status')\n\t\t\t\t\t\t->from('assessments assess')\n\t\t\t\t\t\t->join('applications a', 'assess.app_id=a.app_id', 'inner')\n\t\t\t\t\t\t->join('business_line bl', 'a.app_id=bl.app_id', 'inner')\n\t\t\t\t\t\t->join('businessess b', 'a.buss_id=b.buss_id', 'inner')\n\t\t\t\t\t\t->join('payment_type pt', 'b.payment_id=pt.payment_id', 'inner')\n\t\t\t\t\t\t->join('business_nature bn', 'bl.buss_nature_id=bn.buss_nature_id', 'inner')\n\t\t\t\t\t\t->join('payments p','assess.assessment_id=p.assessment_id','left')\n\t\t\t\t\t\t/* ->join('required_tfo rtfo', 'bn.buss_nature_id=rtfo.buss_nature_id', 'inner')\n\t\t\t\t\t\t->join('tfo t', 'rtfo.tfo_id=t.tfo_id', 'inner') */\n\t\t\t\t\t\t->join('application_type apptype', 'a.application_id=apptype.application_id', 'inner')\n\t\t\t\t\t\t->join('owners o', 'a.owner_id=o.owner_id', 'inner')\n\t\t\t\t\t\t->join('brgys bar', 'bar.brgy_id=o.brgy_id', 'inner')\n\t\t\t\t\t\t->where(array('assess.assessment_id' =>$assessmentID,\n\t\t\t\t\t\t'bl.buss_nature_id'\t =>$buss_nature_id[0]->buss_nature_id\n\t\t\t\t\t\t))->get();\n \t\t/* ->where(array('assess.assessment_id' =>$assessmentID,\n\t\t\t\t\t\t 'rtfo.application_id' =>$application_id[0]->application_id,\n\t\t\t\t\t\t 'bl.buss_nature_id'\t =>$buss_nature_id[0]->buss_nature_id\n\t\t\t\t ))->get(); */\n\t\t\t//echo $this->db->_error_message();\n\t\t// echo $this->db->last_query();\n \t$tfos = array();\n\t\t$owner = array();\n\t\t$current_date = date('m/d/Y');\n\n \tif($assessments->num_rows() > 0) {\n \t\t$tfo = $assessments->result();\n\t\t\t//print_r($tfo);\n \t\t$i = 0;\n \t\tforeach ($tfo as $item) {\n\t\t\t// print_r($item);\n\t\t\t\t$owner['owner'] = $item->firstname . ' ' . $item->middlename . ' ' . $item->lastname;\n\t\t\t\t$owner['address'] = (($item->house_no_bldg_name == 'N/A') ? ' ' : $item->house_no_bldg_name).' '. (($item->house_no_bldg_name=='N/A') ? ' ' : $item->house_no_bldg_name) .' '.(($item->brgy == 'N/A') ? ' ' : $item->brgy).' '. (($item->o_subdivision_street == 'N/A') ? ' ' : $item->o_subdivision_street) .' ' .(($item->o_muni) ? ' ' : $item->o_muni);\n\t\t\t\t$owner['contact_number'] = $item->contact_number;\n\t\t\t\t$owner['application_type'] = $item->application_type;\n\t\t\t\t$owner['payment_type'] = $item->payment_type;\n\t\t\t\t$owner['business_nature'] = $item->business_nature;\n\t\t\t\t$owner['assessment_id'] = $item->assessment_id;\n\t\t\t\t$owner['buss_id'] = $item->buss_id;\n\t\t\t\t$owner['pay_status'] = $item->pay_status;\t\t\t\t\n\t\t\t\t$owner['owner_id'] = $item->owner_id;\n\t\t\t\t$owner['payment_id'] = $item->payment_id;\n\t\t\t\t$owner['total'] = (float)$item->total_tax_due;\n\t\t\t\t$owner['paid_all'] = $item->flag_paid_all;\n\t\t\t\t$owner['pay_id'] = $item->pay_id;\n\t\t\t\t$owner['permit_number'] = $item->permit_number;\n\t\t\t\t$owner['ownership_id'] = $item->ownership_id;\n\t\t\t\t$owner['breakdowns'] = json_decode($item->breakdowns,true);\n\t\t\t\t$owner['bustax'] = json_decode($item->tfos,true);\n\t\t\t\t$owner['bustax2'] = json_decode($item->addtltfo,true);\n\t\t\t\t$count[] = $item->count;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$owner['count'] = $count;\n\t\t\t return [\n\t\t\t\t'owner' => $owner\n\t\t\t\t\t];\n \t} else {\n \t\treturn false;\n\n \t}\n\t}"
] | [
"0.61340773",
"0.596523",
"0.5866217",
"0.56859326",
"0.563757",
"0.5607861",
"0.5600416",
"0.5487249",
"0.53792167",
"0.53307927",
"0.5273162",
"0.5242855",
"0.5160667",
"0.5131883",
"0.51084155",
"0.5095373",
"0.5086852",
"0.50817114",
"0.5081523",
"0.50647336",
"0.5051281",
"0.50342757",
"0.5008248",
"0.5005672",
"0.49945006",
"0.49866575",
"0.49714044",
"0.49659076",
"0.4961545",
"0.49599123"
] | 0.64935327 | 0 |
Updates the employment info table. | public function updateEmploymentInfoQuery($employment){
$date = date("Y-m-d G:i:s");
$query = 'UPDATE application SET
employer_name = "'.$employment->employer_name.'",
date_hire = "'.$employment->date_hire.'",
job_title = "'.$employment->job_title.'",
supervisor = "'.$employment->supervisor.'",
date_hire = "'.$employment->date_hire.'",
job_tenure = "'.$employment->job_tenure.'",
phone_work = "'.$employment->phone_work.'",
phone_work_ext = "'.$employment->phone_work_ext.'",
date_modified = "'.$date.'",
modifying_agent_id = '.$employment->modifying_agent_id.'
WHERE application_id ='.$employment->application_id.';';
$result = $this->db->query($query);
return($result->rowCount());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function updateEmployee() {\n\t\tif ($this->ltype->data[0]['isAnnual'] == 1){\n\t\t\t$sql = \"UPDATE annual_leave a, business_years b SET a.leave_left = a.leave_left - 0.5 \";\n\t\t\t$sql .= \" WHERE a.emp_id =\".$this->page->ctrl['subrecord'].\" AND a.year_id = b.business_year_id AND b.year_start<='\".$this->data[0]['half_date'].\"'\";\n\t\t\t$sql .= \" AND b.year_end >= '\".$this->data[0]['half_date'].\"'\";\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}",
"function editEmpHistory() {\r\n global $dbh;\r\n\r\n $applicant_id = $_SESSION['applicant_id'];\r\n $e_id = $_REQUEST['id'];\r\n $e_name = $_REQUEST['e-name'];\r\n $e_phone = $_REQUEST['e-phone'];\r\n $e_city = $_REQUEST['e-city'];\r\n $e_state = $_REQUEST['e-state'];\r\n $e_start_date = $_REQUEST['e-start-date'];\r\n $e_end_date = $_REQUEST['e-end-date'];\r\n $e_position = $_REQUEST['e-position'];\r\n $e_description = $_REQUEST['e-description'];\r\n\r\n $edit_emp_history_sql = <<<SQL\r\n UPDATE employment\r\n SET e_name = \"$e_name\",\r\n e_phone = \"$e_phone\",\r\n e_city = \"$e_city\",\r\n e_state = \"$e_state\",\r\n e_start_date = \"$e_start_date\",\r\n e_end_date = \"$e_end_date\",\r\n e_position = \"$e_position\",\r\n e_description = \"$e_description\"\r\n WHERE id = $e_id AND applicant_id = $applicant_id;\r\n\r\nSQL;\r\n\r\n $edit_emp_history_result = $dbh->query($edit_emp_history_sql);\r\n\r\n if ($edit_emp_history_result) {\r\n header(\"Location: /job_app/view_employment_records.php\");\r\n } else {\r\n echo \"There was an error. Please try again.\";\r\n mysqli_error($dbh);\r\n }\r\n\r\n}",
"function UpdateEmployment($data) {\n \n try {\n \n $this->pdo->update('user_employment', $data, '`id`=' . $data['id']);\n if ($data['current_company'] == 'yes') {\n $query = \"UPDATE `user_employment` SET `current_company` = 'no',`noticeperiod`='',`current_ctc`='' WHERE `user_id` =\" . $data['user_id'] . \" and `id`!=\" . $data['id'] . \"\";\n \n $select = $this->pdo->prepare($query);\n $select->execute();\n }\n } catch (PDOException $e) {\n $this->setError($e->getMessage());\n //$this->setError('Record Not Inserted');\n return false;\n }\n }",
"function UpdateEmpInfo($post_array, $tablename = 'ehr_pim_tmp')\r\n {\r\n //pr($post_array);pr($_POST);exit;\r\n \t$pk = ($tablename == 'ehr_pim_tmp' ? array('company_id','emp_seqno') : array('seg_segment_no','id'));\r\n //$companyid = $this->companyID;\r\n /*\r\n // remarked by dennis 2008-06-03\r\n $_record[\"address_tel\"] = $post_array[\"address_tel\"];\r\n $_record[\"mobiletel\"] = $post_array[\"mobiletel\"];\r\n $_record[\"email\"] = $post_array[\"email\"];\r\n $_record[\"tel_part\"] = $post_array[\"tel_part\"];\r\n $_record[\"address\"] = $post_array[\"address\"];\r\n $_record[\"address_man\"] = $post_array[\"address_man\"];\r\n $_record[\"addresszipcode\"] = $post_array[\"addresszipcode\"];\r\n $_record[\"mailaddress\"] = $post_array[\"mailaddress\"];\r\n $_record[\"mailaddress_man\"] = $post_array[\"mailaddress_man\"];\r\n $_record[\"mailaddresszipcode\"] = $post_array[\"mailaddresszipcode\"];\r\n $_record[\"emergencycontactor\"] = $post_array[\"emergencycontactor\"];\r\n $_record[\"emergencycontactor_tel\"] = $post_array[\"emergencycontactor_tel\"];\r\n\t\t\t*/\r\n \t//pr($pk);\r\n $_record = array();\r\n foreach($post_array as $key=>$val)\r\n {\r\n $_record[$key] = $val;\r\n }\r\n if ($tablename == 'ehr_pim_tmp')\r\n {\r\n\t $_record['company_id'] = $this->companyID;\r\n\t $_record['emp_seqno'] = $this->empSeqNO;\r\n\t $_record['data_status']= '0';\r\n }\r\n $_record['update_program'] = 'ESS';\r\n $_record['update_by'] = $this->empSeqNO;\r\n \r\n //$this->DBConn->debug = true;\r\n //$this->DBConn->StartTrans();\r\n //PR($_record);EXIT;\r\n // for HQ add by dennis 2010-10-08\r\n $stmt = 'begin pk_erp.p_set_segment_no(:companyid); end;';\r\n $this->DBConn->Execute($stmt,array('companyid'=>$this->companyID));\r\n $this->DBConn->Replace($tablename,$_record, $pk,true);\r\n\t\t\t//$this->DBConn->CommitTrans();\r\n return $this->DBConn->Affected_Rows();\r\n }",
"public function updateEmployee() {\n\t \t$sqlQuery = \"UPDATE \" . $this->dbTable . \"SET \n\t \t\tname = :name,\n\t \t\temail = :email,\n\t \t\tage = :age,\n\t \t\tdesignation = :designation,\n\t \t\tcreated = :created\n\t \t\tWHERE id = :id\n\t \t\";\n\n\t \t$stmt = $this->conn->prepare($sqlQuery);\n\n\t \t$this->name = htmlspecialchars(strip_tags($this->name));\n\t \t$this->email = htmlspecialchars(strip_tags($this->email));\n\t \t$this->age = htmlspecialchars(strip_tags($this->age));\n\t \t$this->designation = htmlspecialchars(strip_tags($this->designation));\n\t \t$this->created = htmlspecialchars(strip_tags($this->created));\n\t \t$this->id = htmlspecialchars(strip_tags($this->id));\n\n\t \t$stmt->bindParam(\":name\", $this->name);\n\t \t$stmt->bindParam(\":email\", $this->email);\n\t \t$stmt->bindParam(\":age\", $this->age);\n\t \t$stmt->bindParam(\":designation\", $this->designation);\n\t \t$stmt->bindParam(\":created\", $this->created);\n\t \t$stmt->bindParam(\":id\", $this->id);\n\n\t \tif ($stmt->execute()) {\n\t \t\treturn true;\n\t \t} else {\n\t \t\treturn false;\n\t \t}\n\t }",
"public function edit(Employment $employment): bool\n {\n }",
"public function updateEmployee(){\n// require once db connection\n\n\t$id=$this->employeeid;\n\t$sql=\"UPDATE Employee SET firts_name=?,last_name=?,employmentDate=?,gender=?,contact_no=?,role=? WHERE empID='$id'\";\n\n\t$stmt = $dbconn->prepare($sql);\n\n\t$fname=$this->firstname;\n\t$laname=$this->lastname;\n\t$edate=$this->employmentdate;\n\t$gen=$this->gender;\n\t$contact=$this->contactnumber;\n\t$rl=$this->role;\n\n\t$stmt->bind_param('i','s','s','s','s','i','s', $id,$fname,$lname,$edate,$gender,$contact,$rl);\n\t$stmt->execute(); \n $stmt->close();\n}",
"public function update(Request $request)\n\t{\n\t\t//return $request->all();\n\t\t$organization_id = Session::get('organization_id');\n\n\t\t$hrm_employee = HrmEmployee::where('id',$request->input('id'))->first();\n\t\t\n\t\tif($request->input('staff_type_id') != null){\n\t\t\t$hrm_employee->staff_type_id = $request->input('staff_type_id');\n\t\t}\n\t\t$hrm_employee->person_id = $request->input('person_id');\n\n\t\tif($request->input('title_id') != null){\n\t\t\t$hrm_employee->title_id = $request->input('title_id');\n\t\t}\n\t\t$hrm_employee->employee_code = $request->input('employee_code');\n\t\t$hrm_employee->first_name = $request->input('first_name');\n\t\t$hrm_employee->last_name = $request->input('last_name');\n\t\t$hrm_employee->email = $request->input('email');\n\t\t$hrm_employee->phone_no = $request->input('phone_no');\n\t\t\n\t\tif($request->input('gender_id') != null){\n\t\t\t$hrm_employee->gender_id = $request->input('gender_id');\n\t\t}\n\t\t\n\t\tif($request->input('blood_group_id') != null){\n\t\t\t$hrm_employee->blood_group_id = $request->input('blood_group_id');\n\t\t}\n\t\t\n\t\tif($request->input('marital_status') != null){\n\t\t\t$hrm_employee->marital_status = $request->input('marital_status');\n\t\t}\n\t\t$hrm_employee->save();\n\t\tCustom::userby($hrm_employee, false);\n\n\t\t$work_periods = HrmEmployeeWorkingPeriod::where('employee_id',$request->input('id'))->first();\n\n\t\tif($request->input('joined_date') != null){\n\t\t\t$work_periods->joined_date = ($request->input('joined_date')!=null) ? Carbon::parse($request->input('joined_date'))->format('Y-m-d') : null;\n\t\t}\n\t\t\n\t\tif($request->input('branch_id') != null)\n\t\t{\n\t\t\t$work_periods->branch_id = $request->input('branch_id');\n\t\t}\n\t\t$work_periods->save();\n\n\t\tCustom::userby($work_periods, false);\n\n\t\t$designation = DB::table('hrm_employee_designation')\n\t\t->where('employee_id',$request->input('id'))\n\t\t->update(['designation_id' =>($request->input('designation_id') != null) ? $request->input('designation_id') : null\n\t\t]);\n\n\t\tif($request->input('address') != null)\n\t\t{\n\t\t\t$employee_address = HrmEmployeeAddress::where('employee_id', $request->input('id'))->first();\n\t\t\t$employee_address->employee_id = $request->input('id');\n\t\t\t$employee_address->person = $request->input('first_name');\n\t\t\t$employee_address->address = $request->input('address');\n\t\t\t$employee_address->city_id = $request->input('city_id');\n\t\t\t$employee_address->pin = $request->input('pin');\n\t\t\t$employee_address->google = $request->input('google');\n\t\t\t$employee_address->address_type = 0;\n\t\t\t$employee_address->save();\n\n\t\t\tCustom::userby($employee_address, false);\n\t\t}\n\n\t\tif($request->input('address') != null)\n\t\t{\n\t\t\t$employee_address = HrmEmployeeAddress::where('employee_id', $request->input('id'))->first();\n\t\t\t$employee_address->employee_id = $request->input('id');\n\t\t\t$employee_address->person = $request->input('first_name');\n\t\t\t$employee_address->address = $request->input('address');\n\t\t\t$employee_address->city_id = $request->input('city_id');\n\t\t\t$employee_address->pin = $request->input('pin');\n\t\t\t$employee_address->google = $request->input('google');\n\t\t\t$employee_address->address_type = 1;\n\t\t\t$employee_address->save();\n\n\t\t\tCustom::userby($employee_address, false);\n\t\t}\n\n\t\t$employees = HrmEmployee::select('hrm_employees.id','hrm_employees.first_name','hrm_employees.employee_code','hrm_employees.phone_no','hrm_employees.email','genders.display_name as gender','blood_groups.display_name as blood_group')\n\t\t->leftjoin('genders','hrm_employees.gender_id','=','genders.id')\n\t \t->leftjoin('blood_groups','hrm_employees.blood_group_id','=','blood_groups.id')\n\t \t->where('hrm_employees.id',$hrm_employee->id)\n\t\t->where('hrm_employees.organization_id',$organization_id)->first();\n\n\t\treturn response()->json(['status' => 1, 'message' => 'Employees'.config('constants.flash.added'), 'data' => ['id' => $employees->id, 'name' => $employees->first_name,'code'=>$employees->employee_code,'phone_no'=>$employees->phone_no, 'email'=> $employees->email, 'blood_group'=> $employees->blood_group,'gender' => $employees->gender]]);\n\t}",
"public function update()\n\t{\n\t\t$post \t\t\t\t\t= $this->input->post();\n\t\t$this->id \t\t\t\t= $post['id'];\n\t\t$this->employee_code \t= $post['employee_code'];\n\t\t$this->name \t\t\t= $post['name'];\n\t\t$this->relationship \t= $post['relationship'];\n\t\t$this->contact \t\t\t= $post['contact'];\n\t\t$this->address \t\t\t= $post['address'];\n\n\t\t$this->db->insert('ms_family', $this, array('employee_code'=>$post['employee_code']));\n\t}",
"function amend_employee(int $employee_id, $job_title, $phone_no, $first_name, $last_name, $email, $dept_code)\n{\n $current_state = get_employee($employee_id);\n\n if (empty($current_state)) return null;\n if ($job_title === null) $job_title = $current_state[\"job_title\"];\n if ($phone_no === null) $phone_no = $current_state[\"phone_no\"];\n if ($first_name === null) $first_name = $current_state[\"first_name\"];\n if ($last_name === null) $last_name = $current_state[\"last_name\"];\n if ($email === null) $email = $current_state[\"email\"];\n if ($dept_code === null) $dept_code = $current_state[\"dept_code\"];\n\n $conn = meta_open_db();\n if ($stmt = $conn->prepare(\"UPDATE `Employee` SET `JobTitle`=?, `PhoneNumber`=?, `FirstName`=?, `LastName`=?, `Email`=?, `DepartmentCode`=? WHERE `ID`=?\"))\n {\n $stmt->bind_param(\"ssssssi\", $job_title, $phone_no, $first_name, $last_name, $email, $dept_code, $employee_id);\n $stmt->execute();\n $stmt->close();\n }\n $conn->close();\n}",
"public function update():int {\n if ($this->empId === -1) {\n if (null === $this->empCode || empty($this->empCode)) {\n return -1;\n }\n $vals = [$this->phone, $this->fname, $this->lname, $this->isMan, $this->state, $this->empCode];\n return $this->insert($vals);\n }\n $vals = [$this->phone, $this->fname, $this->lname, $this->isMan, $this->state, $this->empCode, $this->empId];\n $where = 'emp_id = ?';\n return $this->updateTable($where, $vals);\n }",
"function addEmployment($data) {\n try {\n $sql = \"INSERT INTO `user_employment`( `user_id`, `designation`, `organization`, `current_company`, `started_working_year`, `started_working_month`, `worked_till_year`, `worked_till_month`, `description`, `noticeperiod`, `current_ctc`) VALUES (\" . $data['user_id'] . \", '\" . $data['designation'] . \"','\" . $data['organization'] . \"','\" . $data['current_company'] . \"','\" . $data['started_working_year'] . \"','\" . $data['started_working_month'] . \"','\" . $data['worked_till_year'] . \"','\" . $data['worked_till_month'] . \"','\" . $data['description'] . \"','\" . $data['noticeperiod'] . \"','\" . $data['current_ctc'] . \"')\";\n $stmt = $this->pdo->prepare($sql);\n $stmt->execute();\n $id = $this->pdo->lastInsertId();\n \n if ($data['current_company'] == 'yes') {\n echo \"inside update\" . $data['current_company'];\n $query = \"UPDATE `user_employment` SET `current_company` = 'no',`noticeperiod`='',`current_ctc`='' WHERE `user_id` =\" . $data['user_id'] . \" and `id`!=\" . $id . \"\";\n \n $select = $this->pdo->prepare($query);\n $select->execute();\n }\n \n $query = \"UPDATE `users` SET `is_experienced` = 'yes' WHERE `id` =\" . $data['user_id'] . \"\";\n \n $select = $this->pdo->prepare($query);\n $select->execute();\n } catch (PDOException $e) {\n $this->setError('Record Not Inserted');\n return false;\n }\n return $id;\n }",
"public function actionUpdatePersonalInfo(){\n $model = \\employer\\models\\Employer::findOne(Yii::$app->user->identity->employer_id);\n \n if($model){\n $model->scenario = \"updatePersonalInfo\";\n \n if(!Yii::$app->params['isDemo']){\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->getSession()->setFlash('success', Yii::t('register', 'Your personal information has been updated'));\n return $this->redirect(['setting/index']);\n }\n }\n }\n \n return $this->render('updatePersonalInfo', [\n 'model' => $model,\n ]);\n }",
"public function update(Request $request, $id)\n {\n $peopleModel = People::findOrFail($id);\n if (isset($request['add_education']) && $request['add_education']) {\n $educationData = $this->educationValidator($request);\n $peopleModel->universityHistory()->save(new \\App\\Models\\DegreeHistory($educationData));\n return Redirect::back()->withInput($request->except([\"University_Name\",\"Degree_title\",\"Start_year\", \"Finish_year\"]));\n }\n\n if (isset($request['add_career']) && $request['add_career']) {\n $careerData = $this->careerValidator($request);\n $peopleModel->careerHistory()->save(new \\App\\Models\\CareerHistory([\n \"Position_Name\" => $careerData[\"Position_Name\"], \"Company_Name\" => $careerData[\"Company_Name\"],\n \"Current_Position_Status\" => $careerData[\"Current_Position_Status\"],\n \"Start_Date_At_Position\" => Carbon::create($careerData[\"Start_year\"], $careerData[\"Start_Month\"],1,0),\n \"Finish_Date_At_Position\" => Carbon::create($careerData[\"Finish_year\"], $careerData[\"Finish_Month\"],1,0),\n ]));\n return Redirect::back()->withInput($request->except([\"Position_Name\",\"Company_Name\",\"Start_year\", \"Finish_year\",\"Start_Month\", \"Finish_Month\", \"Current_Position_Status\"]));\n }\n\n $peopleFields = $this->peopleValidator($request);\n\n $employeeFields = $this->employeeValidator($request);\n $addressFields = $this->addressValidator($request);\n\n $peopleModel->employee()->first()->fill($employeeFields)->save();\n if ($peopleModel->address()->first()) {\n $peopleModel->address()->first()->fill($addressFields)->save();\n }\n else\n {\n $adressModel = $peopleModel->address()->create($addressFields);\n $peopleFields['AddressId'] = $adressModel->AddressId;\n }\n $peopleModel->fill($peopleFields)->save();\n\n return redirect(route('admin.employee.index'))->with('flash', 'The Company was updated');\n }",
"function UpdateEmployee(){\n $empID = $_POST[\"employeeID\"];\n if($empID == '') \n {\n echo 'Action Requested Update Employee: Please enter employee id';\n return;\n }\n\n $con = new Connection('northwind');\n $Parms = ['emp_id' => $empID]; \n $stmt = $con->executeStatement('SELECT * FROM employee WHERE employee_id = :emp_id', $Parms);\n\n if ($row = $stmt->fetch())\n {\n $Employee = new Employee($row['employee_id'], $row['employee_name'], $row['employee_work_start_date']);\n $EmpName = trim($_POST[\"employeeName\"]) == '' ? $Employee -> getEmpName() : trim($_POST[\"employeeName\"]);\n $EmpStartDate = $_POST[\"employeeWorkStartDate\"] == '' ? $Employee -> getEmpWorkStartDate() : $_POST[\"employeeWorkStartDate\"];\n\n $Parms = [\"emp_id\" => $Employee -> getEmpID(), \n \"emp_name\" => $EmpName, \n \"emp_start_date\" => $EmpStartDate]; \n $stmt = $con->executeStatement(\"update employee set employee_name = :emp_name, employee_work_start_date = :emp_start_date where employee_id = :emp_id\", $Parms);\n\n echo 'employee updated successfully'; \n }\n else {\n echo \"No employee with employee_id $empID found\";\n }\n\n echo '<h3>List of all Employees</h3>';\n DisplayAllEmployees($con); \n }",
"public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\", lastname=\\\"$this->lastname\\\", cellphone=\\\"$this->cellphone\\\", client_id=$this->client_id, city_id=$this->city_id where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}",
"public function updateHospitalDetails($data) {\n extract($data);\n // print_r($data);\n $sql = \"UPDATE hospital_tab SET hosp_name = '$hospital_name',hosp_email = '$hosp_email',hosp_location = '$hospital_location',\"\n . \"hosp_addr = '$hospital_address',hosp_number = '$hospital_num' WHERE hosp_id = '$hosp_id'\";\n // echo $sql;die();\n $this->db->query($sql);\n if ($this->db->affected_rows() > 0) {\n return 200;\n } else {\n return 500;\n }\n }",
"public function update()\n {\n $jobId = Helper::getIdFromUrl('job');\n if(!(int)$_POST['end_year']){\n $_POST['end_year'] = NULL;\n }\n $job = $_POST;\n\n // Set updated_by ID and set the date of updating\n $job['user_id'] = Helper::getUserIdFromSession();\n $job['updated_by'] = Helper::getUserIdFromSession();\n $job['updated'] = date('Y-m-d H:i:s');\n\n // Update the record in the database\n JobModel::load()->update($job, $jobId);\n\n // Return to the job-overview\n header(\"Location: /job\");\n\n }",
"function UpdateEmployer()\n\t\t{ \n\t\t\tif ($_POST['Cancel']=='Cancel') { \n\t\t\t\t$this->ListEmployers();\n\t\t\t \tdie();\n\t\t \t}\n\t\t $oEmployer->id\t\t\t\t\t=\thtmlentities($_POST['id'],ENT_QUOTES);\n\t $oEmployer->first_name\t\t\t=\thtmlentities($_POST['first_name'],ENT_QUOTES);\n\t\t\t$oEmployer->last_name\t\t\t=\thtmlentities($_POST['last_name'],ENT_QUOTES);\n\t\t\t$oEmployer->company_name\t\t=\thtmlentities($_POST['company_name'],ENT_QUOTES);\n\t\t\t$oEmployer->job_title\t\t\t=\thtmlentities($_POST['job_title'],ENT_QUOTES);\n\t\t\t$oEmployer->address\t\t\t\t=\thtmlentities($_POST['address'],ENT_QUOTES);\n\t\t\t$oEmployer->province\t =\thtmlentities($_POST['province_id'],ENT_QUOTES);\n\t\t\t$oEmployer->city\t =\thtmlentities($_POST['city'],ENT_QUOTES);\n\t\t\t$oEmployer->logo\t\t\t\t=\thtmlentities($_POST['logo'],ENT_QUOTES);\n\t\t\t$oEmployer->postal_code\t\t\t=\thtmlentities($_POST['postal_code'],ENT_QUOTES);\n\t\t\t$oEmployer->postal_code1\t\t=\thtmlentities($_POST['postal_code1'],ENT_QUOTES);\n\t\t\t$oEmployer->phone_no1\t\t\t=\thtmlentities($_POST['phone_no1'],ENT_QUOTES);\n\t\t\t$oEmployer->phone_no2\t\t\t=\thtmlentities($_POST['phone_no2'],ENT_QUOTES);\n\t\t\t$oEmployer->phone_no3\t\t\t=\thtmlentities($_POST['phone_no3'],ENT_QUOTES);\n\t\t\t$oEmployer->ext\t\t\t\t\t=\thtmlentities($_POST['ext'],ENT_QUOTES);\n\t\t\t$oEmployer->epassword\t\t\t=\t$_POST['password'];\n\t\t\t$oEmployer->hear_mode\t\t\t=\timplode(\",\",$_POST['hear_mode']);\n\t\t\t$oEmployer->company_bio\t\t\t=\thtmlentities($_POST['company_bio'],ENT_QUOTES);\n\t\t\t$oEmployer->comp_website\t\t=\thtmlentities($_POST['company_website'],ENT_QUOTES);\n\t\t\t$oEmployer->security_question\t=\thtmlentities($_POST['security_question'],ENT_QUOTES);\n\t\t\t$oEmployer->security_ans\t\t=\thtmlentities($_POST['answer'],ENT_QUOTES);\n\t\t\t$oEmployer->newsletter\t\t\t=\t$_POST['newsletter'];\n\t\t\t$oEmployer->staffing_agency\t\t=\t$_POST['staffing_agency'];\n\t\t\t\n\t\t\t$OVE[]\t=\tnew ValidationElement(array('First Name'=>$oEmployer->first_name), array('Blank'));\n\t\t\t$OVE[]\t=\tnew ValidationElement(array('Last Name'=>$oEmployer->last_name), array('Blank'));\n\t\t\t$OVE[]\t=\tnew ValidationElement(array('Company Name'=>$oEmployer->company_name), array('Blank'));\n\t\t\t$OVE[]\t=\tnew ValidationElement(array('Job Title'=>$oEmployer->job_title), array('Blank'));\n\t\t\t$OVE[]\t=\tnew ValidationElement(array('Address'=>$oEmployer->address), array('Blank'));\n\t\t\t$OVE[]\t=\tnew ValidationElement(array('Province'=>$oEmployer->province), array('Blank'));\n\t\t\t$OVE[]\t=\tnew ValidationElement(array('City'=>$oEmployer->city), array('Blank'));\n\t\t\t$OVE[]\t=\tnew ValidationElement(array('Postal Code'=>$oEmployer->postal_code), array('Blank'));\n\t\t\t$OVE[]\t=\tnew ValidationElement(array('Postal Code'=>$oEmployer->postal_code1), array('Blank'));\n\t\t\t$OVE[]\t=\tnew ValidationElement(array('Phone no'=>$oEmployer->phone_no1), array('Blank'));\n\t\t\t$OVE[]\t=\tnew ValidationElement(array('Phone no'=>$oEmployer->phone_no2), array('Blank'));\n\t\t\t$OVE[]\t=\tnew ValidationElement(array('Phone no'=>$oEmployer->phone_no3), array('Blank'));\n\t\t\t\n\t\t\t\n\t\t\t$OVE[]\t=\tnew ValidationElement(array('Security Question'=>$oEmployer->security_question), array('Blank'));\n\t\t\t$OVE[]\t=\tnew ValidationElement(array('Security Answer'=>$oEmployer->security_ans), array('Blank'));\n\t\t\t$oVC\t\t\t\t\t=\t\tnew ValidationCheck($OVE);\n\t\t $bResponse \t\t\t\t= \t\t$oVC->Check();\n\t\t\t$errorMessage\t\t\t=\t\timplode(\"<br>\", $oVC->SErrorMsg);\n\t if($bResponse==0)\n\t\t\t{\n\t\t\t\t$this->EmployerEdit($errorMessage);\n\t\t\t \tdie();\n\t\t\t} else {\n\t\t\t\n\t\t\t\t$rs= $this->oModel->UpdateAdminEmployer($oEmployer);\n\t\t\t \theader(\"location:\".$_CONF['AdminURL'].\"index.php?stage=employer&mode=ListEmployers&msg=1&search_field=$_REQUEST[search_field]&search_text=$_REQUEST[search_text]\");\n\t\t\t}\n\t\t}",
"public function update()\n {\n $params = [\n\t\t\t'first_name'\t=> $this->input->post('first_name'),\n\t\t\t'last_name'\t\t=> $this->input->post('last_name'),\n\t\t\t'designation'\t=> $this->input->post('designation'),\n\t\t\t'based'\t\t => $this->input->post('based'),\n\t\t\t'gender'\t\t=> $this->input->post('gender'),\n\t\t\t'salary'\t => $this->input->post('salary')\n ];\n $empId = $this->input->post('emp_id');\n $this->employeeservice->setEmpId($empId);\n\n $msg = $this->employeeservice->updateEmployee($params);\n // employee model -> edit by emp_id\n // echo json_encode($params[\"emp_id\"]);\n echo json_encode($msg);\n // echo $params[\"emp_id\"];\n }",
"public function store(\\Modules\\Employee\\Http\\Requests\\EmployeeReInitializeRequest $request)\n { \n\n $employee_job_info=EmployeeJobInfo::where('employees_master_id','=',$request->employees_master_id)->get();\n\n $data['date']=date('Y-m-d');\n $data['remarks']=\"Reinitialized in Branch : \".Branch::find($request->department_branch_id)->first()->branch_name.\", Department: \".Department::find($request->department_id)->first()->department_name.\" as \".Designation::find($request->designation_id)->first()->designation_name.\n\n\n $employee_job_info[0]->update(['relieving_date'=>NULL]);\n $employee_job_info[0]->update($request->all());\n\n EmployeeWorkHistoryInCompany::create($data); \n $request->session()->flash('status', 'Task was successful!');\n return back();\n }",
"public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",email=\\\"$this->email\\\",last_name=\\\"$this->last_name\\\",username=\\\"$this->username\\\",rol=$this->rol,plant_id=$this->plant_id where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}",
"public function workupdate(Request $request)\n {\n $exp = Experience::find($request->id);\n\n $exp->update([\n 'job_title' => $request->job_title,\n 'company' => $request->company,\n 'industri_id' => $request->industri_id,\n 'position' => $request->position,\n 'salary' => $request->salary,\n 'jenis_gaji' => $request->jenis_gaji,\n 'des_pos' => $request->des_pos,\n 'email' => $request->email,\n 'work_from' => $request->work_from,\n 'work_till' => $request->work_till,\n 'user_id' => $request->user_id,\n ]);\n\n $emp = Employee::where('user_id', $request->user_id)->first();\n $expe = Experience::where('user_id', $request->user_id)->get();\n $totalExp = 0;\n\n foreach ($expe as $row) {\n $end = $row->work_till;\n $start = $row->work_from;\n $totalExp += $end - $start;\n }\n\n $emp->update([\n 'exp_total' => $totalExp\n ]);\n\n return redirect('/emp/resume')->with([\n 'success' => 'Data Diri Berhasil Diubah!'\n ]);\n\n }",
"public function setEmployeeHireDate(?DateTime $value): void {\n $this->getBackingStore()->set('employeeHireDate', $value);\n }",
"public function actionUpdateCompanyInfo(){\n $model = \\employer\\models\\Employer::findOne(Yii::$app->user->identity->employer_id);\n \n if($model){\n $model->scenario = \"updateCompanyInfo\";\n \n if(!Yii::$app->params['isDemo']){\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->getSession()->setFlash('success', Yii::t('register', 'Your company information has been updated'));\n return $this->redirect(['setting/index']);\n }\n }\n }\n \n return $this->render('updateCompanyInfo', [\n 'model' => $model,\n ]);\n }",
"public function update(){\n \n // if password needs to be updated\n $password_set=!empty($this->password) ? \", password = :password\" : \"\";\n \n // if no posted password, do not update the password\n $query = \"UPDATE \" . $this->table_name . \"\n SET\n firstName = :firstName,\n middleName = :middleName,\n lastName = :lastName,\n email = :email,\n contact = :contact,\n dateOfBirth = :dateOfBirth,\n dateOfJoin = :dateOfJoin,\n location = :location,\n empRole = :empRole,\n empType = :empType,\n empStatus = :empStatus,\n manager = :manager,\n departmentId = :departmentId\n WHERE empId = :empId\";\n \n // prepare the query\n $stmt = $this->conn->prepare($query);\n \n // sanitize\n $this->empId=htmlspecialchars(strip_tags($this->empId));\n $this->firstName=htmlspecialchars(strip_tags($this->firstName));\n $this->middleName=htmlspecialchars(strip_tags($this->middleName));\n $this->lastName=htmlspecialchars(strip_tags($this->lastName));\n $this->email=htmlspecialchars(strip_tags($this->email));\n $this->contact=htmlspecialchars(strip_tags($this->contact));\n $this->dateOfBirth=htmlspecialchars(strip_tags($this->dateOfBirth));\n $this->dateOfJoin=htmlspecialchars(strip_tags($this->dateOfJoin));\n $this->location=htmlspecialchars(strip_tags($this->location));\n $this->empRole=htmlspecialchars(strip_tags($this->empRole));\n $this->empType=htmlspecialchars(strip_tags($this->empType));\n $this->empStatus=htmlspecialchars(strip_tags($this->empStatus));\n $this->manager=htmlspecialchars(strip_tags($this->manager));\n $this->manager=htmlspecialchars(strip_tags($this->manager));\n \n // bind the values\n $stmt->bindParam(':empId', $this->empId);\n $stmt->bindParam(':firstName', $this->firstName);\n $stmt->bindParam(':middleName', $this->middleName);\n $stmt->bindParam(':lastName', $this->lastName);\n $stmt->bindParam(':contact', $this->contact);\n $stmt->bindParam(':email', $this->email);\n $stmt->bindParam(':dateOfBirth', date( \"Y-m-d\", strtotime($this->dateOfBirth)));\n $stmt->bindParam(':dateOfJoin', date( \"Y-m-d\", strtotime($this->dateOfJoin)));\n $stmt->bindParam(':location', $this->location);\n $stmt->bindParam(':empRole', $this->empRole);\n $stmt->bindParam(':empType', $this->empType);\n $stmt->bindParam(':empStatus', $this->empStatus);\n $stmt->bindParam(':manager', $this->manager);\n $stmt->bindParam(':departmentId', $this->departmentId); \n \n // execute the query\n if($stmt->execute()){\n return true;\n }\n \n return false;\n }",
"public function setEmployeeOrgData(?EmployeeOrgData $value): void {\n $this->getBackingStore()->set('employeeOrgData', $value);\n }",
"public function updateOpportunities(){\n }",
"public function updateEmp_batches(){\n $sql=\"INSERT INTO empdetail_batches_map (`empno`,`batchid`) VALUES ('$this->author','$this->recentBatchID')\";\n mysqli_query($this->conn, $sql) or die(mysqli_error($this->conn));\n }",
"public function updated(Employee $employee)\n {\n //\n }"
] | [
"0.63976103",
"0.62146026",
"0.60682577",
"0.588828",
"0.5856727",
"0.5823175",
"0.57058275",
"0.5680162",
"0.5673776",
"0.558724",
"0.5585352",
"0.5563745",
"0.55492926",
"0.5540481",
"0.55390286",
"0.54666543",
"0.5459022",
"0.5449859",
"0.5413873",
"0.5375609",
"0.5372999",
"0.5366782",
"0.5366072",
"0.5351909",
"0.53515023",
"0.5292695",
"0.5278205",
"0.5271325",
"0.52710664",
"0.52707005"
] | 0.71800977 | 0 |
Updates the personal reference table. | public function updatePersonalReferenceQuery($reference){
$date = date("Y-m-d G:i:s");
$query = 'UPDATE personal_refernce SET
date_modified = "'.$date.'",
company_id = '.$reference->company_id.',
name_full = "'.$reference->name_full.'",
phone_home = "'.$reference->phone_home.'",
relationship = "'.$reference->relationship.'",
verified = "'.$reference->verified.'",
ok_to_contact = "'.$reference->ok_to_contact.'",
modifying_agent_id = '.$reference->modifying_agent_id.'
WHERE personal_refernce_id ='.$reference->personal_refernce_id.';';
$result = $this->db->query($query);
return($result->rowCount());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update()\n {\n // run the update SQL script to update alter existing tables and create existing ones\n \n // update existing users to add affiliate id\n \n // return back();\n }",
"public function updateReferences()\n {\n foreach ( $this->references as $reference )\n $this->connection->execute( $reference );\n\n $this->references = array();\n }",
"public function update($prePupillaryReflex);",
"public static function updatenomenclaturetable($id_nomenclatureupdatenew, $referencepreviouspost, $newreference) {\n $con = mdlconection::connect();\n $referenceupdate = mdlinventory::definerReferenceupdate($referencepreviouspost, $newreference);\n $updateintotableusers = \"update nomenclature set reference = '$referenceupdate' where id_nomenclature = '$id_nomenclatureupdatenew'\";\n if (!mysqli_query($con, $updateintotableusers)) {\n die('Error: ' . mysqli_error($con));\n }\n }",
"function testCounterpartyUpdate($ref) {\n\t\t$result = $this->np->model('Counterparty')->update(array(\n\t\t\t'Ref' => $ref,\n\t\t\t'CounterpartyProperty' => 'Recipient',\n\t\t\t// City code of 'Андреевка (Харьков)'\n\t\t\t'CityRef' => 'a9280688-94c0-11e3-b441-0050568002cf',\n\t\t\t'CounterpartyType' => 'PrivatePerson',\n\t\t\t'FirstName' => 'Петр',\n\t\t\t'MiddleName' => 'Сидорович',\n\t\t\t'LastName' => 'Иванович',\n\t\t\t'Phone' => '380501112234',\n\t\t));\n\t\t$this->assertTrue($result['success']);\n\t}",
"public function saveTableRefs()\n {\n $arr_current_page = MooConfig::get('arr_current_page');\n if (!isset($arr_current_page['controller']['table_mapping'])) {\n return;\n }\n\n $db =& JFactory::getDBO();\n $table_mapping =& $arr_current_page['controller']['table_mapping'];\n\n $arr_external_table = array();\n foreach ($table_mapping as $table_name_str => $values) {\n $ref = isset($arr_current_page['controller']['table_mapping'][$table_name_str]['ref'])\n ? $arr_current_page['controller']['table_mapping'][$table_name_str]['ref']\n : MooHelper::makeSingular(MooConfig::get('current_page')) . '_id';\n\n $updateBool = isset($values['update']);\n\n if (!$updateBool) {\n $query = 'DELETE FROM ' . $table_name_str . ' '\n . 'WHERE ' . $ref . ' IN('\n .\n (\n !is_array($this->id)\n ? $this->id\n : implode(', ', $this->id)\n )\n . ')';\n $db->setQuery($query);\n $db->query();\n }\n $multivalue = isset($values['multivalue']);\n if (!$multivalue) {\n $external_row = new MooTable($table_name_str);\n if (!$updateBool) {\n foreach ($values as $key => $value) {\n if (is_array($value)) {\n $post_value = JRequest::getVar($key, '', 'post', 'string', JREQUEST_ALLOWRAW);\n if (is_array($post_value)) {\n $post_value = $post_value[0];\n }\n\n $external_row->$value['column'] = $post_value;\n }\n }\n } else {\n // TODO - Update Bool === true\n }\n\n $external_row->$ref = $this->id;\n $this->convertNullStrToNull($external_row);\n// debug($external_row);\n if (!$external_row->store(false, true)) {\n JError::raiseError(500, $external_row->getError());\n }\n\n } else {\n $total = count(JRequest::getVar($values['count']));\n if ($total === 0) {\n return;\n }\n\n if (!$updateBool) {\n for ($i = 0; $i < $total; $i += 1) {\n $external_row = new MooTable($table_name_str);\n foreach ($values as $key => $value) {\n if (is_array($value)) { // column to store\n if ($values['count'] == $key) { // count is the key that compares to which other values can be empty and still be stored\n $arr_keys = JRequest::getVar($key);\n if ($arr_keys[$i] == '' || $arr_keys[$i] === 'NULL') {\n $empty = true;\n continue;\n } else {\n $empty = false;\n }\n// echo 'arr_keys[$i] = ' . $arr_keys[$i] . '<br />';\n\n $external_row->$value['column'] = $arr_keys[$i];\n\n if ($key == 'time') {\n $external_row->$value['column'] = date('H:i:s', strtotime($arr_keys[$i]));\n }\n } else {\n // TODO - HTML always allowed...\n $other_data = JRequest::getVar($value['column'], '', 'post', 'string', JREQUEST_ALLOWRAW);\n if ($other_data[$i] === 'NULL') {\n $other_data[$i] = NULL;\n }\n\n $external_row->$value['column'] = $other_data[$i];\n\n // TODO - empty evaluates to true if 0 or empty string... make function to check if column supports null\n// if (empty($other_data[$i])) {\n// $empty = true;\n// } else {\n// $empty = false;\n// }\n }\n }\n $external_row->$values['ref'] = $this->id;\n }\n// echo $external_row->image_id . '<br />' . $external_row->carousel_id; die;\n if (!$empty && !$external_row->store()) {\n JError::raiseError(500, $external_row->getError());\n }\n }\n } else {\n $count_values = JRequest::getVar($values['count']);\n for ($i = 0; $i < $total; $i += 1) {\n $external_row = new MooTable($table_name_str);\n\n $current_count_value = $count_values[$i];\n\n $primary_key_arr = array(\n $ref => $this->id,\n $values['count'] => $current_count_value\n );\n\n $external_row->load($primary_key_arr);\n\n $query = $db->getQuery(true);\n $query\n ->update($table_name_str)\n ->where($ref . ' = ' . $this->id . ' AND ' . $values['count'] . ' = ' . $current_count_value);\n\n foreach ($values as $key => $value) {\n if ($values['count'] === $key || !is_array($value)) {\n continue;\n }\n\n // TODO - HTML always allowed...\n $other_data = JRequest::getVar($value['column'], '', 'post', 'string', JREQUEST_ALLOWRAW);\n if ($other_data[$i] === 'NULL') {\n $other_data[$i] = NULL;\n }\n\n $query->set($value['column'] . ' = ' . $other_data[$i]);\n }\n\n $db->setQuery($query);\n $db->query();\n }\n }\n }\n }\n }",
"function update(){\n\t\t$this->mdl_fees->update();\n\t}",
"public function update(Request $request)\n\t{\n\t\t$user_id = Auth::id();\n\n\t\t$people = PersonalPeople::find($request->input('id'));\n\t\t$people->name = $request->input('name');\n\t\t$people->relationship_id = $request->input('relationship_id');\n\t\t$people->dob = $request->input('dob');\n\t\t$people->mobile = $request->input('mobile');\n\t\t$people->email = $request->input('email');\n\t\t$people->aadhar = $request->input('aadhar');\n\t\t$people->pan = $request->input('pan');\n\t\t$people->user_id = $user_id;\n\t\t$people->save();\n\n\t\tCustom::userby($people, true);\n\n\t\t$relationship = PersonalRelationship::find($request->input('relationship_id'));\n\n\t\tif($request->input('category_id') != null) {\n\n\t\t\t$category = PersonalCategory::find($request->input('category_id'));\n\t\t\t$ledger = AccountLedger::find($category->ledger_id);\n\t\t\t$ledgergroup = AccountGroup::find($ledger->group_id);\n\n\t\t\t$personal_ledger = AccountLedgerType::where('name', 'personal')->first();\n\t\t\t$year = AccountFinancialYear::where('user_id', $user_id)->first();\n\n\t\t\t$account_type = User::find(Auth::id());\n\t\t \n\t\t\t$people->ledger_id = Custom::create_ledger($people->name, $account_type, $people->name, $personal_ledger->id, null, null, $ledgergroup->id, $year->books_year, 'debit', '0.00', Session::get('ledger_approval'), '0', $user_id, 'true');\n\t\t\t$people->save();\n\n\t\t}\n\t\t\n\n\t\treturn response()->json(['status' => 1, 'message' => 'People'.config('constants.flash.updated'), 'data' => ['id' => $people->id, 'name' => $people->name, 'mobile' => $people->mobile, 'email' => ($people->email != null) ? $people->email: \"\", 'aadhar' => ($people->aadhar != null) ? $people->aadhar : \"\", 'pan' => ($people->pan != null) ? $people->pan : \"\"]]);\n\t}",
"function testContactPersonUpdate($counterpartyRef) {\n\t\t$existedContactPerson = $this->np->getCounterpartyContactPersons($counterpartyRef);\n\t\t$result = $this->np->model('ContactPerson')->update(array(\n\t\t\t'Ref' => $existedContactPerson['data'][0]['Ref'],\n\t\t\t'CounterpartyRef' => $counterpartyRef,\n\t\t\t'FirstName' => 'Петр',\n\t\t\t'MiddleName' => 'Сидорович',\n\t\t\t'LastName' => 'Иванов',\n\t\t\t'Phone' => '0501112266',\n\t\t));\n\t\t$this->assertTrue($result['success']);\n\t}",
"public function update_record(){\n\t\t\t\n\t\t}",
"public function testUpdateCustomerProfile()\n {\n }",
"public function updateReference($data, $referenceId)\n {\n //update on DB\n $cr = CandidateReference::find($referenceId);\n\n $cr->candidate_id = 1958;\n\n $cr->employer_name = $data['employer_name'];\n $cr->contactEmail = $data['contact_email'];\n $cr->companyName = $data['company_name'];\n $cr->description = $data['description'];\n $cr->recorded_date = date('Y-m-d H:i:s');\n $cr->contact_phone = $data['contact_phone'];\n\n $cr = $cr->save();\n\n //recreate for angular variables\n $data['id'] = $referenceId;\n\n return $data;\n }",
"public function update($tblPermiso);",
"function editRefree()\r\n{\r\n\t$errorMessage = '';\r\n\t$userId \t = $_POST['userid'];\r\n\t$plNo \t = $_POST['plno'];\r\n\t$listId \t = $_POST['listid'];\r\n\t$refid \t = $_POST['ippis'];\r\n\t\r\n\t\r\n\t$sql = \"SELECT id, member_id FROM security_users\r\n\t\t\tWHERE pl_no = '$refid'\";\r\n\t$result = dbQuery($sql);\r\n\t\tif (dbNumRows($result) == 1) {\r\n\t\t\t$row \t = dbFetchAssoc($result);\r\n\t\t\t$memberid = $row['member_id'];\r\n\r\n\t\t\tif ($memberid == '1'){\r\n\t\t\t$sql = \"UPDATE refree set refid = '$refid', modify_id = '$userId', modify_on = now() WHERE pl_no = '$plNo' AND id = '$listId'\";\r\n\t\t\t$result = dbQuery($sql);\t\r\n\t\t\t$errorMessage = 'Refree was successfully updated';\r\n\t\t\t}else {\t\r\n\t\t\t$errorMessage = 'This member is not Coop Member and Staff';\t\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$errorMessage = 'There is no member with Member Id '.$refid ;\r\n\t\t}\r\n\t\t\t\r\n\t\r\n\treturn $errorMessage;\r\n}",
"public function update($tblEnterPayment);",
"public function update()\n {\n Database::update( $this->table, $this->members, \"id='\".$this->id.\"'\");\n }",
"public function addReferal(){\n if(func_num_args()>0):\n $data = func_get_arg(0);\n \n $select = $this->select()\n ->setIntegrityCheck(false)\n ->from(array('r'=>'refer_friends'),array('r.email','r.ref_id'))\n ->where('email = ?',$data['email'])\n ->where('ref_by = ?',$data['ref_by']);\n $result = $this->getAdapter()->fetchRow($select); \n if($data['email']==$result['email']):\n $udata = array('req_count' => new Zend_Db_Expr('req_count + 1'),'ref_date'=> new Zend_Db_Expr('CURDATE()'));\n $this->update($udata,'ref_id =' . $result['ref_id']);\n else:\n $idata['email'] = $data['email'];\n $idata['ref_by'] = $data['ref_by'];\n $idata['ref_date'] = new Zend_Db_Expr('CURDATE()');\n $idata['req_count'] = 1;\n $this->insert($idata);\n endif;\n else:\n throw new Exception(\"Argument not passed\");\n endif;\n }",
"public function update()\n { if (is_null($this->id))\n trigger_error(\"Contributor::update(): Attempt to update a Contributor object that does not have its ID property set.\", E_USER_ERROR);\n\n // Update the Contributor\n $conn = new PDO(DB_DSN, DB_USER, DB_PASS);\n $sql = \"UPDATE contributor SET FirstName=:firstname, FamilyName=:familyname, UserID=:userID, Orcid=:orcid, OrcidCode=:orcidcode, OrcidAccessToken=:orcidaccesstoken WHERE ContributorID = :id\";\n $st = $conn->prepare($sql);\n \n \n $st->bindValue(\":firstname\", $this->firstName, PDO::PARAM_STR);\n $st->bindValue(\":familyname\", $this->familyName, PDO::PARAM_STR); \n $st->bindValue(\":userID\", $this->userID, PDO::PARAM_INT);\n $st->bindValue(\":orcid\", $this->orcid, PDO::PARAM_STR);\n $st->bindValue(\":orcidcode\", $this->orcidCode, PDO::PARAM_STR);\n $st->bindValue(\":orcidaccesstoken\", $this->orcidAccessToken, PDO::PARAM_STR);\n $st->bindValue(\":id\", $this->id, PDO::PARAM_INT);\n $st->execute();\n $conn = null;\n }",
"public function update($table);",
"public function update($table);",
"public function updateRecords(updateable $update_item, $lib_item){\n echo 'update personal details';\n }",
"public function updated(Ref $ref)\n {\n \n\n }",
"public function update(): void {\n parent::updateByString(['member_id']);\n }",
"function update_person($data,$where,$table)\n {\n $this->db->where($where);\n $this->db->update($table,$data);\n }",
"function setReference($reference);",
"public function update(){\n\t\n\t\t$email = $this->auth->get_info()->email;\n\t\t\n\t\t$data = array(\n\t\t\t'address'=> $this->input->post('inputProfileAddress'),\n\t\t\t'description' => $this->input->post('inputProfileAbout'),\n\t\t\t'edu_history' => $this->input->post('inputProfileEducation'),\n\t\t\t'work_history' => $this->input->post('inputProfileWork'),\n\t\t\t'skills' => $this->input->post('inputSkills'),\n\t\t\t'interest_area' => $this->input->post('inputInterest'),\n\t\t\t'location_pref' => $this->input->post('inputLocation'),\n\t\t);\n\t\t$this -> resume_profile_model -> update($email,$data); \n\t\t$this -> index();\t\n\t}",
"public function update(Request $request, Refaccion $refaccion)\n {\n $refaccion->fill($request->all());\n if ($refaccion->save()) {\n return response()->json($this->messages['update.success'], 200);\n }\n return response()->json($this->messages['update.fail'], Response::HTTP_CONFLICT);\n }",
"private function updateRelationshipVariable ()\n {\n foreach ( $this->implementation->getRelationshipList () as $relationshipName )\n {\n $rel = $this->implementation->getOldFormat ( $relationshipName ) ;\n $this->relationships [ $relationshipName ] = $rel ;\n }\n }",
"public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",email=\\\"$this->email\\\",last_name=\\\"$this->last_name\\\",username=\\\"$this->username\\\",rol=$this->rol,plant_id=$this->plant_id where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}",
"public function update($person);"
] | [
"0.5658592",
"0.5546896",
"0.54884905",
"0.5432684",
"0.535879",
"0.533881",
"0.5317227",
"0.53015393",
"0.52792656",
"0.52341604",
"0.5222849",
"0.5187293",
"0.5176527",
"0.51609373",
"0.509494",
"0.50904864",
"0.50897235",
"0.50858897",
"0.50811595",
"0.50811595",
"0.5070197",
"0.50647116",
"0.50626785",
"0.5060472",
"0.5055846",
"0.50530726",
"0.5049916",
"0.50364375",
"0.50298756",
"0.50157005"
] | 0.6251577 | 0 |
has_length_greater_than('abcd', 3) validate string length spaces count towards length use trim() if spaces should not count | function has_length_greater_than($value, $min) {
$length = strlen($value);
return $length > $min;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function has_length_greater_than($value, $min)\n{\n $length = strlen($value);\n return $length > $min;\n}",
"public static function isValidLength($text , $length) {\n\t $text = explode(\" \" , $text );\n\t if(count($text) > $length)\n\t\t\t return false;\n\t else\n\t\t\t return true;\n\t}",
"function check_length_ge ($field, $lenght) {\n if(strlen($field) >= $lenght) {\n return true;\n } else {\n return false;\n }\n}",
"function check_length_le ($field, $lenght) {\n if(strlen($field) <= $lenght) {\n return true;\n } else {\n return false;\n }\n}",
"function has_length_greater_than($value, $min)\n {\n $length = strlen($value);\n return $length > $min;\n }",
"function validateLength($value, $length){\n if(strlen($value) > $length){\n return true;\n }\n else {\n return false;\n }\n}",
"private function hasValidLength(): bool\n {\n return (strlen($this->getValue()) >= 3 && strlen($this->getValue()) <= 20);\n }",
"function checkLength($str, $len) {\n return strlen(trim($str)) === $len;\n}",
"function has_length_less_than($value, $max)\n{\n $length = strlen($value);\n return $length < $max;\n}",
"function has_length($str, $options){\r\n if(isset($options['max'])){\r\n return strlen($str) > $options['max'];\r\n }\r\n if(isset($options['min'])){\r\n return strlen($str) < $options['min'];\r\n }\r\n if(isset($options['exact'])){\r\n return strlen($str) == $options['exact'];\r\n }\r\n}",
"function isValidLength(string $string = \"\"): bool\n{\n return mb_strlen($string) >= 2;\n}",
"function has_length_less_than($value, $max) {\n $length = strlen($value);\n return $length < $max;\n}",
"function has_length_greater_than($value, $min) {\n $length = strlen($value);\n return $length > $min;\n }",
"function checkLength($str , $min, $max){\n preg_match_all('/./u',$str,$matches);\n $len=count($matches[0]);\n if($len < $min || $len > $max){\n return false;\n }else{\n return true;\n }\n}",
"function has_length($value, $options=array()) {\n return strlen($value) >= $options['min'] \n\t\t&& strlen($value) <= $options['max'];\n }",
"function valid_length($field, $min, $max) {\n\t$trimmed =trim($field);\n\treturn (strlen($trimmed) >= $min && strlen($trimmed) <= $max);\n}",
"function has_length_less_than($value, $max)\n {\n $length = strlen($value);\n return $length < $max;\n }",
"function validateLengthName($name)\n\t{\n\t\t//if it's NOT valid\n\t\tif(strlen($name) < 3)\n\t\t\treturn false;\n\t\t//if it's valid\n\t\telse\n\t\t\treturn true;\n\t}",
"function has_length($value, $options=[]) {\n if(isset($options['max']) && (strlen($value) > (int)$options['max'])) {\n return false;\n }\n if(isset($options['min']) && (strlen($value) < (int)$options['min'])) {\n return false;\n }\n if(isset($options['exact']) && (strlen($value) != (int)$options['exact'])) {\n return false;\n }\n return true;\n}",
"function has_length_exactly($value, $exact) {\n $length = strlen($value);\n return $length == $exact;\n}",
"function has_length_less_than($value, $max) {\n $length = strlen($value);\n return $length < $max;\n }",
"function check_length_e ($field, $lenght) {\n if(strlen($field) == $lenght) {\n return true;\n } else {\n return false;\n }\n}",
"function checkLength($string, $min, $max) {\r\n\t$length = strlen ($string);\r\n\tif (($length < $min) || ($length > $max)) {\r\n\t\treturn FALSE;\r\n\t} else {\r\n\t\treturn TRUE;\r\n\t}\r\n}",
"function has_length($value, $options=array()) {\n $length = strlen($value);\n if(isset($options['max']) && ($length > $options['max'])) {\n return false;\n } elseif(isset($options['min']) && ($length < $options['min'])) {\n return false;\n } elseif(isset($options['exact']) && ($length != $options['exact'])) {\n return false;\n } else {\n return true;\n }\n }",
"function has_length($value, $options=array()) {\n $length = strlen($value);\n if(isset($options['max']) && ($length > $options['max'])) {\n return false;\n } elseif(isset($options['min']) && ($length < $options['min'])) {\n return false;\n } elseif(isset($options['exact']) && ($length != $options['exact'])) {\n return false;\n } else {\n return true;\n }\n }",
"function check_length($text, $name, $min_length, $max_length)\n{\n\t$text_length = strlen($text);\n\n\tif($min_length > 0 && empty($text))\n\t{\n\t\tOutput::HardError('The ' . $name . ' cannot be blank.');\n\t}\n\telse if($text_length > $max_length)\n\t{\n\t\tOutput::HardError('The ' . $name . ' was ' . number_format($text_length - $max_length) . ' characters over the limit (' . number_format($max_length) . ').');\n\t}\n\telse if($text_length < $min_length) \n\t{\n\t\tOutput::HardError('The ' . $name . ' was too short.');\n\t}\n}",
"function isMinLength($input, $length) {\n if (mb_strlen($input,'UTF-8') >= $length){\n return true; \n }\n return false;\n}",
"public function test_length_min_returns_true_when_not_optional_and_input_greater() {\n $optional = false;\n $params = [2];\n\n $result = self::$validator->validate( 'abcdef', $optional, $params );\n $this->assertTrue( $result );\n }",
"function has_max_length($value,$max)\n\t\t\t{\n\t\t\t\n\t\t\t return(strlen($value) <= $max);\n\t\t\t}",
"function isMaxLength($input, $length) {\n if (mb_strlen($input,'UTF-8') <= $length){\n return true; \n }\n return false;\n}"
] | [
"0.7530653",
"0.74182236",
"0.7407929",
"0.7365027",
"0.73113894",
"0.72928065",
"0.7282664",
"0.723028",
"0.72265255",
"0.7187611",
"0.7156935",
"0.71469676",
"0.71267486",
"0.7083454",
"0.70779413",
"0.7053762",
"0.70319283",
"0.6975963",
"0.69669825",
"0.6922463",
"0.6896023",
"0.68658805",
"0.68084335",
"0.6801299",
"0.6801299",
"0.67944443",
"0.67552644",
"0.67346674",
"0.6677805",
"0.6675626"
] | 0.74483865 | 1 |
has_length_exactly('abcd', 4) validate string length spaces count towards length use trim() if spaces should not count | function has_length_exactly($value, $exact) {
$length = strlen($value);
return $length == $exact;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkLength($str, $len) {\n return strlen(trim($str)) === $len;\n}",
"function has_length_exactly($value, $exact)\n {\n $length = strlen($value);\n return $length == $exact;\n }",
"function isValidLength(string $string = \"\"): bool\n{\n return mb_strlen($string) >= 2;\n}",
"private function hasValidLength(): bool\n {\n return (strlen($this->getValue()) >= 3 && strlen($this->getValue()) <= 20);\n }",
"function has_length_exactly($value, $exact) {\n $length = strlen($value);\n return $length == $exact;\n }",
"public static function isValidLength($text , $length) {\n\t $text = explode(\" \" , $text );\n\t if(count($text) > $length)\n\t\t\t return false;\n\t else\n\t\t\t return true;\n\t}",
"function checkLength($str , $min, $max){\n preg_match_all('/./u',$str,$matches);\n $len=count($matches[0]);\n if($len < $min || $len > $max){\n return false;\n }else{\n return true;\n }\n}",
"function validateLength($value, $length){\n if(strlen($value) > $length){\n return true;\n }\n else {\n return false;\n }\n}",
"function validateLengthName($name)\n\t{\n\t\t//if it's NOT valid\n\t\tif(strlen($name) < 3)\n\t\t\treturn false;\n\t\t//if it's valid\n\t\telse\n\t\t\treturn true;\n\t}",
"function check_length_ge ($field, $lenght) {\n if(strlen($field) >= $lenght) {\n return true;\n } else {\n return false;\n }\n}",
"private function isRequiredLength(string $password) : bool\n {\n return strlen($password) >= 6;\n }",
"function check_length_e ($field, $lenght) {\n if(strlen($field) == $lenght) {\n return true;\n } else {\n return false;\n }\n}",
"function check_length_le ($field, $lenght) {\n if(strlen($field) <= $lenght) {\n return true;\n } else {\n return false;\n }\n}",
"function has_length($str, $options){\r\n if(isset($options['max'])){\r\n return strlen($str) > $options['max'];\r\n }\r\n if(isset($options['min'])){\r\n return strlen($str) < $options['min'];\r\n }\r\n if(isset($options['exact'])){\r\n return strlen($str) == $options['exact'];\r\n }\r\n}",
"function valid_length($field, $min, $max) {\n\t$trimmed =trim($field);\n\treturn (strlen($trimmed) >= $min && strlen($trimmed) <= $max);\n}",
"static function MatchesLength($string,$min=false,$max=false,$emptyIsValid=false)\n {\n\n $string =trim($string);\n\n if(!$min && !$max)\n {\n throw new \\Exception('$max or $min parameter should be specified',400);\n }\n\n if(!empty($string))\n {\n //If string isn't or\n if($min && strlen($string) < $min)\n {\n //If string is lesser than the min allowed size\n return false;\n }\n\n if($max && strlen($string) > $max)\n {\n //If string is greater than the max allowed size\n return false;\n }\n }\n elseif(empty($string) && !$emptyIsValid )\n {\n return false;\n }\n\n\n\n return true;\n\n }",
"function checkLength($string, $min, $max) {\r\n\t$length = strlen ($string);\r\n\tif (($length < $min) || ($length > $max)) {\r\n\t\treturn FALSE;\r\n\t} else {\r\n\t\treturn TRUE;\r\n\t}\r\n}",
"function has_length($value, $options=array()) {\n return strlen($value) >= $options['min'] \n\t\t&& strlen($value) <= $options['max'];\n }",
"function has_length($value, $options=[]) {\n if(isset($options['max']) && (strlen($value) > (int)$options['max'])) {\n return false;\n }\n if(isset($options['min']) && (strlen($value) < (int)$options['min'])) {\n return false;\n }\n if(isset($options['exact']) && (strlen($value) != (int)$options['exact'])) {\n return false;\n }\n return true;\n}",
"function has_length_greater_than($value, $min)\n{\n $length = strlen($value);\n return $length > $min;\n}",
"function minLength($string, $requireLenght) {\n if (strlen($string) < $requireLenght) {\n return true;\n } else {\n return false;\n }\n }",
"function isMinLength($input, $length) {\n if (mb_strlen($input,'UTF-8') >= $length){\n return true; \n }\n return false;\n}",
"function validateStringLength ($string, $length, $option = 'exactly') {\n if(is_array($length) && isset($length[0], $length[1])) {\n $minLength = $length[0];\n $maxLength = $length[1];\n }\n $len = strlen($string);\n\n if(isset($maxLength, $minLength)) {\n if($len < $minLength || $len > $maxLength) {\n return false;\n }\n } elseif($option === 'minimum') {\n $minLength = $length;\n if($len < $minLength) {\n return false;\n }\n } elseif($option === 'maximum') {\n $maxLength = $length;\n if($len > $maxLength) {\n return false;\n }\n } elseif($option === 'exactly') {\n $exactLength = $length;\n if(!($len === $exactLength)) {\n return false;\n }\n }\n\n return TRUE;\n\n}",
"function has_length_less_than($value, $max)\n{\n $length = strlen($value);\n return $length < $max;\n}",
"function moreThan3($input){\n $val = str_split($input);\n return sizeof($val) >= 3;\n }",
"function validName($name){\n if(strlen(trim($name))>4 && !empty($name)){\n return true;\n }\n else return false;\n }",
"public function testStringWithLessLength()\n {\n $string = \"Lorem ipsum dolor sit amet\"; // 26 chars\n $input = new Input($string);\n\n $maxLengthValidator = new MaxLength(50);\n\n $input->attach($maxLengthValidator);\n\n $isValid = $input->isValid();\n\n $this->assertTrue($isValid);\n }",
"function has_length($value, $options=array()) {\n $length = strlen($value);\n if(isset($options['max']) && ($length > $options['max'])) {\n return false;\n } elseif(isset($options['min']) && ($length < $options['min'])) {\n return false;\n } elseif(isset($options['exact']) && ($length != $options['exact'])) {\n return false;\n } else {\n return true;\n }\n }",
"function has_length($value, $options=array()) {\n $length = strlen($value);\n if(isset($options['max']) && ($length > $options['max'])) {\n return false;\n } elseif(isset($options['min']) && ($length < $options['min'])) {\n return false;\n } elseif(isset($options['exact']) && ($length != $options['exact'])) {\n return false;\n } else {\n return true;\n }\n }",
"function has_length_greater_than($value, $min) {\n $length = strlen($value);\n return $length > $min;\n}"
] | [
"0.76116514",
"0.7256874",
"0.7199389",
"0.71127397",
"0.7106693",
"0.71054435",
"0.69139946",
"0.68276244",
"0.6735168",
"0.6715943",
"0.6710836",
"0.66998184",
"0.66828555",
"0.66618496",
"0.6638404",
"0.6562475",
"0.6556173",
"0.6480877",
"0.6453367",
"0.64453083",
"0.6438045",
"0.6429972",
"0.6413238",
"0.641276",
"0.6407082",
"0.6395183",
"0.6385453",
"0.6365409",
"0.6365409",
"0.6362997"
] | 0.7466167 | 1 |
Die with an error message if the download fails. | private function download_error( $message, $title = '', $status = 404 ) {
wp_die( $message, $title, array( 'response' => $status ) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function throw_download_errors( $url ) {\n\n\t\t\t$message = false;\n\n\t\t\tswitch ( $url ) {\n\t\t\t\tcase 'key_missed':\n\t\t\t\t\t$message = __( 'Monstroid key not provided', 'monstroid-dashboard' );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'request_failed':\n\t\t\t\t\t$message = __( 'Can\\'t send download request. Please, try again later', 'monstroid-dashboard' );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'empty_response':\n\t\t\t\t\t$message = __( 'Empty result returned. Please, try again later', 'monstroid-dashboard' );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'key_invalid':\n\t\t\t\t\t$message = __( 'Your license key are invalid. Please, contact our support team.', 'monstroid-dashboard' );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tif ( false !== $message ) {\n\t\t\t\twp_send_json_error( array( 'message' => $message ) );\n\t\t\t}\n\n\t\t}",
"public function testFailDownloadFromUrl()\n {\n // Create an ImageCachingManager object which will fail\n $logger = $this->createMock(LoggerInterface::class);\n // simulate cURL failing to download file\n $curlWrapper = $this->createMock(CurlWrapper::class);\n $curlWrapper->method('download')\n ->willThrowException(new \\Exception('HTTP 404'));\n $filesystem = $this->createMock(FilesystemAbstraction::class);\n $filesystem->method('saveToDisk')\n ->willReturn(true);\n $failingImageCachingManager = new ImageCachingManager(self::CACHE_DIR, self::PUBLIC_DIR, $logger, $curlWrapper, $filesystem);\n\n $localPath = $failingImageCachingManager->downloadFromUrl(self::IMAGE_URL, self::RECORD_ID);\n\n // Function downloadFromUrl() should return false\n $this->assertEquals(false, $localPath);\n // Error should not be empty!\n $this->assertEquals(true, !empty($failingImageCachingManager->getErrorMessage()));\n }",
"protected function download()\n {\n echo \"Downloading source HTML...\\n\";\n\n // Run the download\n $this->dl->run(storage_path());\n\n if ($this->dl->isDownloaded()) {\n // Store the downloaded file name\n $this->filename = $this->dl->getFilename();\n } else {\n throw new DownloadFailedException(\"Whoops, it looks like the download failed.\");\n }\n }",
"function errexit($error) {\n\n $filename = \"amp-raw-download-error\";\n header(\"Content-Type: text/plain\");\n header(\"Content-Disposition: attachment; filename=$filename\");\n echo 'ERROR: '.htmlspecialchars($error);\n flush();\n exit();\n\n}",
"public function testSuccessDownloadFromUrl()\n {\n $localPath = $this->imageCachingManager->downloadFromUrl(self::IMAGE_URL, self::RECORD_ID);\n\n // Correct path should be returned\n $this->assertEquals('/var/www/project/public/cache/1/funny-games-1997-1S-KA-to-KP4.jpg', $localPath);\n // Error property should be empty\n $this->assertEquals(true, empty($this->imageCachingManager->getErrorMessage()));\n }",
"public function testFlysystemFileDownloadIgnoresInvalidScheme() {\n $this->assertNull(flysystem_file_download('invalid://module_file/file.txt'));\n }",
"private function failed()\n\t{\n\t\theader(\"Content-Type: image/gif\");\n\t\treadfile(TL_ROOT.'/system/modules/documentsearch/html/failed.gif');\n\t\texit;\n\t}",
"public function download($file) {\n\t\treturn $this->log_error();\n\t}",
"public function testDownloadPackageWithInvalidActivation()\n {\n $response2 = $this->json('GET', '/api/v1/packages/' . $this->package->slug . '/download', [\n 'activation' => 'invalid-activation-id'\n ]);\n\n $response2\n ->assertStatus(401);\n }",
"public function testDownload()\n {\n vfsStream::setup('upload_dir', 777, array('public1.pdf' => 'test'));\n\n $this->client->request('GET', '/exam/download/public1.pdf');\n\n $this->assertTrue($this->client->getResponse()->isSuccessful());\n\n ob_start();\n // Send the response to the output buffer\n $this->client->getResponse()->sendContent();\n // Get the contents of the output buffer\n $content = ob_get_contents();\n // Clean the output buffer and end it\n ob_end_clean();\n\n $this->assertEquals('test', $content);\n\n $this->client->request('GET', '/exam/download/non_exists.pdf');\n $this->assertTrue($this->client->getResponse()->isRedirect('/exam/'));\n }",
"abstract function download($force);",
"public function testDownloadMethodReturnsString(): void\n {\n $downloader = new FakeDownloader();\n $this->assertIsString($downloader->download('http://google.com/'),\n 'Download method has not returned string'\n );\n }",
"public function error() {\n\t\treturn curl_error ( $this->handle );\n\t}",
"public function testVerifiedDownload(): void\n {\n $fixtureName = 'Simple';\n $updater = $this->getSystemInTest($fixtureName);\n\n $testFilePath = static::getFixturePath($fixtureName, 'server/targets/testtarget.txt', false);\n $testFileContents = file_get_contents($testFilePath);\n $this->assertSame($testFileContents, $updater->download('testtarget.txt')->getContents());\n\n // If the file fetcher returns a file stream, the updater should NOT try\n // to read the contents of the stream into memory.\n $stream = $this->prophesize('\\Psr\\Http\\Message\\StreamInterface');\n $stream->getMetadata('uri')->willReturn($testFilePath);\n $stream->getContents()->shouldNotBeCalled();\n $stream->rewind()->shouldNotBeCalled();\n $stream->getSize()->willReturn(strlen($testFileContents));\n $updater->download('testtarget.txt');\n\n // If the target isn't known, we should get an exception.\n try {\n $updater->download('void.txt');\n $this->fail('Expected a NotFoundException to be thrown, but it was not.');\n } catch (NotFoundException $e) {\n $this->assertSame('Target not found: void.txt', $e->getMessage());\n }\n\n $stream = Utils::streamFor('invalid data');\n $this->serverStorage->fileContents['testtarget.txt'] = $stream;\n try {\n $updater->download('testtarget.txt');\n $this->fail('Expected InvalidHashException to be thrown, but it was not.');\n } catch (InvalidHashException $e) {\n $this->assertSame(\"Invalid sha256 hash for testtarget.txt\", $e->getMessage());\n $this->assertSame($stream, $e->getStream());\n }\n }",
"public function test_check_file_method_for_nonexistent_file()\n {\n $result = web_service::check_file($this->nonexistent_url);\n\n $this->assertInternalType('array', $result);\n $this->assertArrayHasKey('status', $result);\n $this->assertArrayHasKey('code', $result);\n $this->assertFalse($result['status']);\n $this->assertContains($result['code'], array(\n 404,\n 0,\n ));\n }",
"function teamspeak3_download_file($sFilePath, $sFilename, $b404OnError=true)\n{\n\tif(!file_exists($sFilePath))\n\t{\n\t\tif($b404OnError)\n\t\t{\n\t\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\t\techo \"404 Not Found\";\n\t\t}\n\t\treturn;\n\t}\n\t\n\t// Make the file available for the browser (as a file download).\n\t$sContentType = (substr(strrchr($sFilePath,'.'),1) == 'sqlitedb') ? \"application/x-sqlite3\" : \"text/plain\";\n\theader(\"Content-Type: {$sContentType}\");\n\theader(\"Content-Disposition: attachment; filename=\\\"{$sFilename}\\\"\");\n\techo file_get_contents($sFilePath);\n}",
"private function __failed()\n {\n $this->response(array(\n 'status' => 'failed'\n ), 403);\n }",
"private function __failed()\n {\n $this->response(array(\n 'status' => 'failed'\n ), 403);\n }",
"public abstract function download ($url, $path, array $headers = array());",
"public function download(){\r\n\t\tdownload($this->arquivo_nome);\r\n\t}",
"public function createDownload()\n\t{\n\t\t\t$download=new Download();\n\t\t\t$download->downloadIP='';\n\t\t\t$download->downloadAgent='';\n\t\t\t$download->downloadEmail='';\n\t\t\t$download->downloadCode='';\n\n\t\t\tif($download->save())\n\t\t\t{\n\t\t\t\t// return success\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t\t//return try downloading again\n\t\t\t}\n\t}",
"public function download($dest)\n\t{\n\t\t$url = $this->getFileURL();\n\t\t\n\t\tif (!$url) {\n\t\t\tthrow new Exception(__('No file to download'));\n\t\t}\n\t\t\n\t\tif (!is_writable(dirname($dest))) {\n\t\t\tthrow new Exception(__('Root directory is not writable.'));\n\t\t}\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$client = netHttp::initClient($url,$path);\n\t\t\t$client->setTimeout(4);\n\t\t\t$client->setUserAgent($_SERVER['HTTP_USER_AGENT']);\n\t\t\t$client->useGzip(false);\n\t\t\t$client->setPersistReferers(false);\n\t\t\t$client->setOutput($dest);\n\t\t\t$client->get($path);\n\t\t\t\n\t\t\tif ($client->getStatus() != 200) {\n\t\t\t\t@unlink($dest);\n\t\t\t\tthrow new Exception();\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tthrow new Exception(__('An error occurred while downloading archive.'));\n\t\t}\n\t}",
"public function testPdfNotFound(): void\n {\n $this->client->request('GET', '/api/invoice/download/fake');\n\n // Then the response status code should be 404.\n static::assertResponseStatusCodeSame(404);\n }",
"public function testFetchError() {\n $this->mockHandler->append(new RequestException('', new Request(200, 'http://google.com')));\n $this->fetcher->fetch($this->feed->reveal(), new State());\n }",
"public function testFlysystemFileDownloadFindsValidScheme() {\n file_put_contents('vfs://module_file/file.txt', '1234');\n\n $return = flysystem_file_download('vfs://module_file/file.txt');\n\n $this->assertSame(2, count($return));\n $this->assertSame('txt/flysystem', $return['Content-Type']);\n $this->assertSame(4, $return['Content-Length']);\n }",
"function make_download_file($name, $download, $download_location) {\n if ($filename = _make_download_file($download)) {\n if (!drush_get_option('ignore-checksums') && !_make_verify_checksums($download, $filename)) {\n return FALSE;\n }\n drush_log(dt('@project downloaded from @url.', array('@project' => $name, '@url' => $download['url'])), 'ok');\n return make_download_file_unpack($filename, $download_location, (isset($download['filename']) ? $download['filename'] : ''));\n }\n make_error('DOWNLOAD_ERROR', dt('Unable to download @project from @url.', array('@project' => $name, '@url' => $download['url'])));\n return FALSE;\n}",
"function make_download_file($name, $download, $download_location) {\n if ($filename = _make_download_file($download)) {\n if (!drush_get_option('ignore-checksums') && !_make_verify_checksums($download, $filename)) {\n return FALSE;\n }\n drush_log(dt('@project downloaded from @url.', array('@project' => $name, '@url' => $download['url'])), 'ok');\n return make_download_file_unpack($filename, $download_location, (isset($download['filename']) ? $download['filename'] : ''));\n }\n make_error('DOWNLOAD_ERROR', dt('Unable to download @project from @url.', array('@project' => $name, '@url' => $download['url'])));\n return FALSE;\n}",
"function Dowload($fileUrl,$filepath){\n\n //The path & filename to save to.\n echo $fileUrl.\"link download <br>\";\n $saveTo = $filepath.\"/\".basename($fileUrl);\n echo $saveTo.\" sve <br>\";\n //Open file handler.\n $fp = fopen($saveTo, 'w+');\n\n //If $fp is FALSE, something went wrong.\n if($fp === false){\n throw new Exception('Could not open: ' . $saveTo);\n }\n\n //Create a cURL handle.\n $ch = curl_init($fileUrl);\n\n //Pass our file handle to cURL.\n curl_setopt($ch, CURLOPT_FILE, $fp);\n\n //Timeout if the file doesn't download after 20 seconds.\n curl_setopt($ch, CURLOPT_TIMEOUT, 20);\n\n //Execute the request.\n $test = curl_exec($ch);\n if($test){\n echo \"thanh cong\";\n $k = true;\n }\n else{ //echo \"that bai\";\n if (strlen(strstr($fileUrl, \"https://\")) > 0) {\n $fileUrl = str_replace(\"https://\", \"http://\", $fileUrl);\n $ch = curl_init($fileUrl);\n\n //Pass our file handle to cURL.\n curl_setopt($ch, CURLOPT_FILE, $fp);\n\n //Timeout if the file doesn't download after 20 seconds.\n curl_setopt($ch, CURLOPT_TIMEOUT, 20);\n\n //Execute the request.\n $test = curl_exec($ch);\n if($test){\n $k = true;\n }\n else\n $k = false;\n }\n else if (strlen(strstr($fileUrl, \"http://\")) > 0) {\n $fileUrl = str_replace(\"http://\", \"https://\", $fileUrl);\n $ch = curl_init($fileUrl);\n\n //Pass our file handle to cURL.\n curl_setopt($ch, CURLOPT_FILE, $fp);\n\n //Timeout if the file doesn't download after 20 seconds.\n curl_setopt($ch, CURLOPT_TIMEOUT, 20);\n\n //Execute the request.\n $test = curl_exec($ch);\n if($test){\n $k = true;\n }\n else\n $k = false;\n }\n else\n {\n //$fileUrl = $_POST[\"url_web\"].'/'.$fileUrl;\n echo \"vào them tên miền <br>\";\n $fileUrl = str_replace(\"../\", $_POST[\"url_web\"].'/', $fileUrl);\n $ch = curl_init($fileUrl);\n\n //Pass our file handle to cURL.\n curl_setopt($ch, CURLOPT_FILE, $fp);\n\n //Timeout if the file doesn't download after 20 seconds.\n curl_setopt($ch, CURLOPT_TIMEOUT, 20);\n\n //Execute the request.\n $test = curl_exec($ch);\n if($test){\n $k = true;\n }\n else\n $k = false;\n }\n\n }\n if($k){\n //If there was an error, throw an Exception\n if(curl_errno($ch)){\n throw new Exception(curl_error($ch));\n return;\n }\n\n //Get the HTTP status code.\n $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\n //Close the cURL handler.\n curl_close($ch);\n\n if($statusCode == 200){\n echo 'Downloaded!';\n } else{\n echo \"Status Code: \" . $statusCode;\n }\n }\n }",
"public function testFileNotExist()\n {\n $crawler = new Crawler('test', 1, ['localFile'=>true]); //non existing url/path\n\n $crawler->traverse();\n $ret = $crawler->getLinks();\n \n $this->assertArrayHasKey('test', $ret);\n $this->assertEquals($ret['test']['status_code'], 404);\n }",
"public static function sendNotFoundAccess() {\n header('HTTP/1.1 404 Not Found');\n die(\"<span style='color:red'>ERROR: Please contact your CodevTT administrator</span>\");\n }"
] | [
"0.6972481",
"0.6647418",
"0.6248793",
"0.6186429",
"0.6094808",
"0.6056076",
"0.6054609",
"0.600744",
"0.5952662",
"0.5732783",
"0.5633448",
"0.5597927",
"0.5549032",
"0.5527724",
"0.55272204",
"0.5479237",
"0.5450449",
"0.5450449",
"0.5439509",
"0.5437811",
"0.5425377",
"0.5405201",
"0.53952247",
"0.5361827",
"0.53482556",
"0.5329366",
"0.5329366",
"0.53214276",
"0.5320027",
"0.530889"
] | 0.72112954 | 0 |
This function is used to make a JSON post call to rackspace cloud service. internally used by all objects in this package. This function makes use of a authenticated RackAuth object. If you are planning to use a cached AuthToken, make sure to populate a RackAuth object with at least AuthToken and XServerManagement Url. | public function postAuthenticatedRequest($Url, RackAuth $RackAuth, $PostData=null)
{
$PostUrl = $RackAuth->getXServerManagementUrl()."/".$Url;
$AuthToken = $RackAuth->getXAuthToken();
//echo $AuthToken;
$Response = self::post($PostUrl, array("X-Auth-Token"=>$AuthToken,"Content-Type"=>"application/json"),$PostData);
return $Response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function os_remote_post( string $url, array $headers = array(), array $data = array(), array $options = array() ) \n{\n\treturn App\\Caller::post($url, $headers, $data, $options);\n}",
"protected function authenticate()\n\t{\n\t\t// Send the scoped token request to Keystone\n\t\t$message = [\n\t\t\t'auth' => [\n\t\t\t\t'identity' => [\n\t\t\t\t\t'methods' => [\n\t\t\t\t\t\t'password',\n\t\t\t\t\t],\n\t\t\t\t\t'password' => [\n\t\t\t\t\t\t'user' => [\n\t\t\t\t\t\t\t'name' => $this->username,\n\t\t\t\t\t\t\t'domain' => [\n\t\t\t\t\t\t\t\t'name' => \"Default\",\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'password' => $this->password,\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'scope' => [\n\t\t\t\t\t'project' => [\n\t\t\t\t\t\t'id' => $this->tenantId,\n\t\t\t\t\t\t'domain' => [\n\t\t\t\t\t\t\t'name' => 'Default'\n\t\t\t\t\t\t]\n\t\t\t\t\t]\n\t\t\t\t]\n\t\t\t],\n\t\t];\n\t\t$json = json_encode($message);\n\t\t$url = rtrim($this->authEndpoint, '/') . '/auth/tokens';\n\n\t\t$request = new Request('POST', $url);\n\t\t$request->data = $json;\n\t\t$request->setHeader('Accept', 'application/json');\n\t\t$request->setHeader('Content-Type', 'application/json');\n\t\t$request->setHeader('Content-Length', strlen($request->data));\n\n\t\t$response = $request->getResponse();\n\n\t\t// Get the tenant (project) ID\n\t\t$this->tenantId = $response->body->token->project->id;\n\n\t\t// Get the token and its expiration\n\t\t$this->token = $response->headers['X-Subject-Token'];\n\t\t$date = new DateTime($response->body->token->expires_at);\n\t\t$this->tokenExpiration = $date->getTimestamp();\n\n\t\t// Loop through the serviceCatalog and index the Swift endpoints\n\t\tif (isset($response->body->token->catalog))\n\t\t{\n\t\t\tforeach ($response->body->token->catalog as $service)\n\t\t\t{\n\t\t\t\tif ($service->type != 'object-store')\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (!isset($service->endpoints))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tforeach ($service->endpoints as $endpoint)\n\t\t\t\t{\n\t\t\t\t\t$this->endPoints[$endpoint->region_id] = $endpoint->url;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Callback\n\t\tif (is_callable($this->authenticationCallback))\n\t\t{\n\t\t\tcall_user_func_array($this->authenticationCallback, [&$this, $response]);\n\t\t}\n\n\t\treturn $this->token;\n\t}",
"public function store()\n {\n $opts = ['lrs_id' => $this->lrs->_id];\n $client = $this->client_repo->store([\n 'authority' => [\n 'name' => 'API Client',\n 'mbox' => 'mailto:[email protected]'\n ]\n ], $opts);\n\n if ($client) {\n $returnCredentials = array(\n 'key' => $client->api['basic_key'],\n 'secret' => $client->api['basic_secret']\n );\n\n return \\Response::json($returnCredentials, 200);\n } else {\n return \\Response::json('I\\'m a teapot', 418);\n }\n }",
"function post(string $url, array $data, string $auth = \"\", string $message = \"\"): SalsahResponse {\n return $this->makeJsonRequest(self::METHOD_POST, $auth, $url, $data, $message);\n }",
"public function post() {\n\n\t\t// Read payload\n\t\t$payload = json_decode(file_get_contents('php://input'), true);\n\t\tif (!$payload) {\n\t\t\theader('HTTP/ 404 No data', true, 404);\n\t\t\tprint('{\"errorCode\": \"ts-loginErrorNoData\"}');\n\t\t\tdie();\n\t\t}\n\t\tif (!array_key_exists('user', $payload) || !array_key_exists('password', $payload)) {\n\t\t\tprint('{\"errorCode\": \"ts-loginErrorNoData\"}');\n\t\t\theader('HTTP/ 404 Invalid data', true, 404);\n\t\t\tdie();\n\t\t}\n\n\t\t// Verify user: TODO\n\t\tif ($payload['user'] != 'alle' || $payload['password'] != 'prova') {\n\t\t\tprint('{\"errorCode\": \"ts-loginErrorInvalidCredentials\"}');\n\t\t\theader('HTTP/ 401 Invalid credentials', true, 401);\n\t\t\tdie();\n\t\t}\n\n\t\t// Get DB connection and load SQL statements\n\t\t$db = Common::getDBConnection();\n\t\t$sqlStmts = Common::loadSqlStatements(__FILE__);\n\n\t\t// Read data and write answer (or error)\n\t\t$userData = new \\Ayesh\\CaseInsensitiveArray\\Strict(\n\t\t\t$db\n\t\t\t->prepare($sqlStmts['0001'])\n\t\t\t->bindParam(':tenantId', $_SERVER['TENANT_ID'], PDO::PARAM_INT)\n\t\t\t->bindParam(':name', $payload['user'], PDO::PARAM_STR, 64)\n\t\t\t->execute()->fetch(PDO::FETCH_ASSOC)\n\t\t);\n\n\t\t// Cleanup\n\t\tCommon::closeDbConnection($db);\n\n\t\t// Build answer\n\t\tif ($userData['name']) {\n\n\t\t\theader(\"Content-type: application/json\");\n\t\t\t$tokenExpiration = time() + TOKEN_TIMEOUT;\n\t\t\t$token = (new Builder())\n\t\t\t->setIssuer($_SERVER['TENANT_ID']) \t\t\t\t\t\t\t// Configures the issuer (iss claim)\n\t\t\t// ->setAudience(config_get('DNS_SUFFIX')) \t\t\t\t\t// Configures the audience (aud claim)\n\t\t\t->setId(base64_encode(openssl_random_pseudo_bytes(12)), false)\t// Configures the id (jti claim), replicating as a header item\n\t\t\t->setIssuedAt(time()) // Configures the time that the token was issue (iat claim)\n\t\t\t->setNotBefore(time()) // Configures the time that the token can be used (nbf claim)\n\t\t\t->setExpiration($tokenExpiration) \t\t\t\t// Configures the expiration time of the token (exp claim)\n\t\t\t->set('uGUID', $userData['userGUID']) \t\t\t// Configures a new claim, called \"uGUID\"\n\t\t\t->set('uId', $userData['userId']) \t\t\t\t\t// Configures a new claim, called \"uId\"\n\t\t\t->set('name', $userData['name']) \t\t\t\t\t\t\t\t// Configures a new claim, called \"name\"\n\t\t\t->sign(new Sha256(), $_SERVER['JWT_SECRET']) \t\t\t\t\t// Sign the token\n\t\t\t->getToken()\n\t\t\t;\n\t\t\t$answer = array(\n\t\t\t\t'token' => (string)$token,\n\t\t\t\t'userGUID' => $userData['userGUID'],\n\t\t\t\t'expires' => $tokenExpiration\n\t\t\t);\n\t\t\treturn json_encode($answer);\n\n\t\t} else {\n\n\t\t\tprint('{\"errorCode\": \"ts-loginErrorUserNotFound\"}');\n\t\t\theader('HTTP/ 401 User ' . $payload['user'] . ' not found', true, 401);\n\t\t\tdie();\n\n\t\t}\n\n\t}",
"public function setToken() {\n if ($this->verbose) {\n echo $this->apiConfig[\"set_token\"] . PHP_EOL;\n echo PHP_EOL;\n }\n\n $curl = curl_init($this->apiConfig[\"set_token\"] . \"?grant_type=client_credentials\");\n\n if ($this->verbose) {\n print_r($curl);\n echo PHP_EOL;\n echo PHP_EOL;\n }\n\n $header = array();\n $header[] = \"Content-type: application/x-www-form-urlencoded\";\n $header[] = \"Authorization: Basic \" . base64_encode($this->key . \":\" . $this->secret);\n\n if ($this->verbose) {\n print_r($header);\n echo PHP_EOL;\n echo PHP_EOL;\n }\n\n curl_setopt($curl, CURLOPT_HTTPHEADER, $header);\n curl_setopt($curl, CURLOPT_POST, true);\n // curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_VERBOSE, 1);\n $resp = curl_exec($curl);\n\n if ($this->verbose) {\n print_r($resp);\n echo PHP_EOL;\n echo PHP_EOL;\n }\n\n $this->payload = json_decode($resp);\n }",
"public function sendPostRequest();",
"public function httpAuth()\n {\n $client_id = $this->settings['client_id'];\n $client_secret = $this->settings['client_secret'];\n\n $headerToken = base64_encode(\"$client_id:$client_secret\");\n\n $headers = array('Accept' => 'application/json', 'Authorization' => \"Basic $headerToken\");\n\n $request_path = \"api/oauth/token\";\n $domain = $this->ddnDomain();\n $full_url = $domain . $request_path;\n\n $data = array('grant_type' => 'client_credentials');\n $body = Body::form($data);\n $response = Request::post($full_url, $headers, $body);\n\n return $response;\n }",
"public function post($data) {\n // $logger = \\Drupal::logger(\"MozuClient\");\n\n // $logger->info('Cart Item:' . print_r($data, true));\n // $response = array(\n // \"data\" => $data,\n // );\n // return new ResourceResponse($response);\n\n if(!$data){\n $response = ['message' => 'No Cart Item Defined'];\n $requestResponse = new ResourceResponse($response);\n }\n\n $KiboApiClientInstance = KiboApiClient::getInstance();\n\n $kiboCartItemService = new CartItemResource($KiboApiClientInstance->getKiboApiContext($data['kiboAuthToken']));\n switch ($data['type']) {\n case 'get':\n $response = $kiboCartItemService->getOrCreateCart();\n break;\n case 'add':\n $response = $kiboCartItemService->addItemToCart($data['data']);\n break;\n case 'update':\n $response = $kiboCartItemService->updateCartItem($data->data, $data['data']['id']);\n break;\n case 'remove':\n $response = $kiboCartItemService->deleteCartItem($data['data']['id']);\n break;\n default :\n $response = $kiboCartItemService->getCartItem($data['data']['id']);\n }\n \n //Json Encode\n //This is me giving up\n $requestResponse = new ResourceResponse(json_encode($response));\n\n //Hack to invalidate cache for every call\n $build = array(\n '#cache' => array(\n 'max-age' => 0,\n ),\n );\n $requestResponse->addCacheableDependency($build);\n\n return $requestResponse;\n \n}",
"function token_post() {\n \n $this->oauth_server->handleTokenRequest(OAuth2\\Request::createFromGlobals())->send();\n }",
"public function send()\n {\n $responseConfig = array(\n 'UserName' => $this->getUserName(),\n 'Secret' => $this->getSecret()\n );\n list($httpResponseHeader, $responseData) = $this->_postRequest();\n return new PacNet_Raven_Model_Api_Service_Response(\n $responseConfig,\n $httpResponseHeader,\n $responseData,\n $this->getServiceName());\n }",
"private static function auth () {\n\n\t\t$content = http_build_query ( array (\n\t\t\t'grant_type' => 'client_credentials'\n\t\t) );\n\n\t\t$context = array (\n\t\t\t'http' => array (\n\t\t\t\t'method' => 'POST',\n\t\t\t\t'header' => array (\n\t\t\t\t\t\"User-Agent: illbethere.in\",\n\t\t\t\t\t\"Authorization: Basic \" . static::encodeKeys(),\n\t\t\t\t\t\"Content-Length: \". strlen( $content ),\n\t\t\t\t\t\"Content-Type: application/x-www-form-urlencoded;charset=UTF-8\"\n\t\t\t\t),\n\t\t\t\t'timeout' => 5,\n\t\t\t\t'content' => $content\n\t\t\t)\n\t\t);\n\n\t\treturn static::request ( static::token_uri, $context );\n\t}",
"public function asPostRequest()\n {\n $url = $this->asUrl();\n\n return parent::request('POST', $url, $this->post_data, $this->fqb_access_token, $this->fqb_etag);\n }",
"function kappaApiPost($url, $data) {\n $APISettings = \\Tohur\\SocialConnect\\Models\\Apisettings::instance()->get('api', []);\n if (!strlen($APISettings['Streamelements']['streamelementskey']))\n throw new ApplicationException('Streamelements API access is not configured. Please configure it on the API Settings page.');\n $token = $APISettings['Streamelements']['streamelementskey'];\n $Postdata = $data;\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($ch, CURLOPT_POSTFIELDS, $Postdata);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Authorization: Bearer ' . $token,\n 'Accept: application/json',\n 'Content-Type: text/plain'\n ));\n curl_exec($ch);\n curl_close($ch);\n }",
"function firebaseAuthAPIPost( $urlSegment, $data = array() ) {\n\t$config = getConfig();\n\t// build the URL, with the API key appended\n\t$url = 'https://www.googleapis.com/identitytoolkit/v3/relyingparty/' . $urlSegment . '?key=' . $config->firebase->apiKey;\n\t$response = post( $url, $data );\n\t\n\tif ( $response['error'] ) return $response;\n\t\n\t// parse json\n\t$response['content'] = json_decode( $response['content'] );\n\tif ( $response['content'] === null ) {\n\t\treturn array( 'error' => 'Malformed json.' );\n\t}\n\n\treturn $response;\n}",
"function call_rest_post($url,$data='')\n\t{\n\t\t$result = $this->curl->simple_post($url , $data , array(CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST=> false));\t\n\t\treturn $result;\n\t}",
"function call_rest_post($url,$data='')\n\t{\n\t\t$result = $this->curl->simple_post($url , $data , array(CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST=> false));\t\n\t\treturn $result;\n\t}",
"public function sendRequest() \n { \n $result = (new Client())\n ->post($this->url(), $this->parameters());\n\n return $result;\n }",
"function send_request($url, $json_value, $user, $password) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($json_value));\n curl_setopt($ch, CURLOPT_HEADER, 1);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json'));\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch,CURLOPT_USERPWD, $user.':'.$password);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($ch);\n curl_close($ch);\n}",
"function post($url, $parameters = array() , $multi = false) { \n \n $response = $this->oAuthRequest($url, 'POST', $parameters , $multi ); \n if ($this->format === 'json' && $this->decode_json) { \n return json_decode($response, true); \n } \n return $response; \n }",
"function pushRequest($playerID, $domainID, $token){\r\n\t$ch = curl_init();\r\n\r\n\tcurl_setopt($ch, CURLOPT_URL, 'https://api.broadsign.com:10889/rest/host/v16/push_request');\r\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\tcurl_setopt($ch, CURLOPT_POST, 1);\r\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, \"{ \\\"domain_id\\\": \".$domainID.\", \\\"player_id\\\": \".$playerID.\", \\\"request_json\\\": \\\"string\\\"}\");\r\n\r\n\t$headers = array();\r\n\t$headers[] = 'Accept: application/json';\r\n\t$headers[] = 'Content-Type: application/json';\r\n\t$headers[] = 'Authorization: Bearer '.$token;\r\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\r\n\r\n\t$result = curl_exec($ch);\r\n\tif (curl_errno($ch)) {\r\n\t\techo 'Error:' . curl_error($ch);\r\n\t}\r\n\tcurl_close($ch);\r\n\t\r\n}",
"protected function postRequest($command, $params = array()) {\n\n $this->prepareCommand($command, $params);\n if ($this->getToken()) {\n $this->curl->setHeader('Authorization', 'Bearer ' . $this->getToken());\n }\n $this->curl->post(ZENCI_GOOGLE_CE_API_URI . '/' . $this->project_id . '/' . $command, $params);\n $response = $this->getResponse();\n return $response;\n }",
"function sendMMPost($response) {\n\tglobal $configmm;\n\t$msg = json_encode($response);\n\t$client = new Vtiger_Net_Client($configmm['posturl']);\n\t$client->setHeaders(array(\n\t\t'Content-Type' => 'application/json',\n\t\t'Content-Length' => strlen($msg),\n\t));\n\t$client->doPost($msg);\n}",
"public function post($method, array $fields = array(), $auth_token = null) {\n\t\treturn $this->fetch($this->buildUrl($method, $auth_token), $fields, 'POST');\n\t}",
"public function token_post()\n {\n $headers = $this->input->request_headers();\n\n if (array_key_exists('Authorization', $headers) && !empty($headers['Authorization'])) {\n $decodedToken = AUTHORIZATION::validateToken($headers['Authorization']);\n if ($decodedToken != false) {\n $this->set_response($decodedToken, REST_Controller::HTTP_OK);\n return;\n }\n }\n\n $this->set_response(\"Unauthorised\", REST_Controller::HTTP_UNAUTHORIZED);\n }",
"function post($url, $parameters = array() , $multi = false, $source = 'auth') {\n\t\t\tif ($source == 'client') {\n\t\t\t\t$parameters['access_token'] = $this->access_token;\n\t\t\t\t$parameters['oauth_consumer_key'] = $this->client_id;\n\t\t\t\t$parameters['openid'] = $this->openId;\n\t\t\t}\n\t\t\tif ($source == 'qplus') {\n\t\t\t\t$parameters['openid'] = $this->openId;\n\t\t\t\t$parameters['access_token'] = $this->access_token;\n\t\t\t\t$parameters['appid'] = '100' . QZONE_ID;\n\t\t\t}\n\t\t\t$response = $this->oAuthRequest($url, 'POST', $parameters , $multi );\n\t\t\tif (strpos($url, \"notify_tasksys\")) {\n\t\t\t\treturn $response;\n\t\t\t}\n\t\t\tif ($this->format === 'json' && $this->decode_json) {\n\t\t\t\treturn json_decode($response, true);\n\t\t\t}\n\t\t\treturn $response;\n\t\t}",
"public static function post()\n {\n $payload = file_get_contents('php://input');\n $payload = json_decode($payload);\n return self::createAuto($payload);\n }",
"public function token_post()\n {\n $headers = $this->input->request_headers();\n \n if (array_key_exists('Authorization', $headers) && !empty($headers['Authorization'])) {\n $decodedToken = AUTHORIZATION::validateToken($headers['Authorization']);\n if ($decodedToken != false) {\n $this->set_response($decodedToken, REST_Controller::HTTP_OK);\n return;\n }\n }\n\n $this->set_response(\"Unauthorised\", REST_Controller::HTTP_UNAUTHORIZED);\n }",
"public function index_post()\n {\n $dummy_user = [\n 'username' => 'ninjasanket',\n 'password' => 'gravityworrier',\n ];\n $username = $this->post('username');\n $password = $this->post('password');\n if (trim($username) === $dummy_user['username'] && trim($password) === $dummy_user['password']) {\n $token = AUTHORIZATION::generateToken(['username' => $dummy_user['username']]);\n $status = parent::HTTP_OK;\n $response = ['status' => $status, 'token' => $token];\n $this->response($response, $status);\n } else {\n $this->response(['status' => false, 'code' => parent::HTTP_UNAUTHORIZED, 'message' => 'Invalid username or password!'], parent::HTTP_UNAUTHORIZED);\n }\n }",
"public function httpPost($url, $data) //自訂的httpPost Function $url:JWT Server, $data:JWT字串\n\t{\n\t\t$curl = curl_init($url);\n \tcurl_setopt($curl, CURLOPT_POST, true);\n \tcurl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\n \tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYHOST,0);\n\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER,0);\n \t$response = curl_exec($curl);\n \tcurl_close($curl);\n \treturn (json_decode($response, true));\n\t}"
] | [
"0.5639037",
"0.56200975",
"0.55974716",
"0.55778164",
"0.5564881",
"0.5493008",
"0.5357759",
"0.5357522",
"0.533059",
"0.52952456",
"0.52897024",
"0.5269422",
"0.5262457",
"0.5251491",
"0.52449185",
"0.5222114",
"0.5222114",
"0.51974136",
"0.51896614",
"0.5170963",
"0.51706505",
"0.5165307",
"0.51554936",
"0.5154387",
"0.51454705",
"0.51415795",
"0.5140101",
"0.51327807",
"0.51223844",
"0.51026106"
] | 0.6469364 | 0 |
This function is used to make a HTTP DELETE call to rackspace cloud service. internally used by all objects in this package. This function makes use of a authenticated RackAuth object. If you are planning to use a cached AuthToken, make sure to populate a RackAuth object with at least AuthToken and XServerManagement Url. | public function postAuthenticatedDeleteRequest($Url, RackAuth $RackAuth)
{
$PostUrl = $RackAuth->getXServerManagementUrl()."/".$Url;
$AuthToken = $RackAuth->getXAuthToken();
//echo $AuthToken;
$Response = self::post($PostUrl, array("X-Auth-Token"=>$AuthToken,"Content-Type"=>"application/json"),$PostData,false,true);
return $Response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function os_remote_delete( string $url, array $headers = array(), array $data = array(), array $options = array() ) \n{\n\treturn App\\Caller::delete($url, $headers, $data, $options);\n}",
"function call_rest_delete($url,$data='')\n\t{\n\t\t$result = $this->curl->simple_delete($url , $data , array(CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST=> false));\t\n\t\treturn $result;\n\t}",
"function call_rest_delete($url,$data='')\n\t{\n\t\t$result = $this->curl->simple_delete($url , $data , array(CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST=> false));\t\n\t\treturn $result;\n\t}",
"public function del(string $uri, array $params): ResponseInterface;",
"public function delete() {\n $this->client->deleteData($this->uri);\n }",
"function http_delete($uri, $data=NULL, array $query_params=array(), array $headers=array()) {\n $copts = array(CURLOPT_CUSTOMREQUEST => 'DELETE');\n\n if(isset($data)) {\n $stream = fopen('data:text/plain;base64,' . base64_encode($data), 'r');\n $copts[CURLOPT_UPLOAD] = TRUE;\n $copts[CURLOPT_INFILE] = $stream;\n $copts[CURLOPT_INFILESIZE] = strlen($data);\n }\n\n return $this->request($uri, $query_params, $headers, $copts);\n }",
"function delete(string $url, string $auth = \"\", string $message = \"\"): SalsahResponse {\n return $this->makeJsonRequest(self::METHOD_DELETE, $auth, $url, [], $message);\n }",
"function delete($url, array $options = [])\n{\n return request('DELETE', $url, $options);\n}",
"protected function deleteRequest($command, $params = array()) {\n\n $this->prepareCommand($command, $params);\n\n if ($this->getToken()) {\n $this->curl->setHeader('Authorization', 'Bearer ' . $this->getToken());\n }\n\n $this->curl->delete(ZENCI_GOOGLE_CE_API_URI . '/' . $this->project_id . '/' . $command, $params, FALSE);\n\n $response = $this->getResponse();\n return $response;\n }",
"public function destroy($id)\n{\n\n$this->client->request('DELETE', config('global.url').'bills/'.$id, [\n 'headers' => [\n 'token' => Auth::user()->token\n ]]);\nreturn redirect('/vouchers');\n}",
"public function delete(string $url, RequestOptionsInterface $requestOptions) : ResponseInterface;",
"public function delete(){\n\n\t\t$this->authenticator->logout();\n\n\t\t$this->auth_response->setStatusCode(204);\n\t\t$this->auth_response->sendHeaders();\n\n\t\t$output = array(\n\t\t\t'content'\t=> 'Logged out!',\n\t\t\t'code'\t\t=> 'success',\n\t\t);\n\n\t\tTemplate::compose(false, $output, 'json');\n\n\t}",
"public function delete(): Response\n {\n $this->transport->setMethod('DELETE')->request($this->db);\n\n return $this->transport->getResponse();\n }",
"public static function httpDelete($route, bool $withToken = true, array $extraHttpHeaders = []): ApiOutput\n {\n return self::executeRequest('DELETE', $route, null, $withToken, Format::JSON, Format::JSON, $extraHttpHeaders);\n }",
"public function sendDelete($endpoint, array $data = array());",
"function hostcontrol_RequestDelete($params)\n{\n $api_client = new HostControlAPIClient(HostControlHelper::getApiUrl($params), $params['ApiKey']);\n $domainname = strtolower($params[\"sld\"] . \".\" . $params[\"tld\"]);\n\n try\n {\n $api_client->domain->delete($domainname);\n }\n catch(HostControlAPIClientError $e)\n {\n HostControlHelper::debugLog($params, 'delete-domain', array($domainname), $e);\n return array('error' => $e->getMessage());\n }\n\n return true;\n}",
"public function asDeleteRequest()\n {\n $url = $this->asUrl();\n\n return parent::request('DELETE', $url, [], $this->fqb_access_token, $this->fqb_etag);\n }",
"public function httpDelete($path, $queryStringParams = [], $headers = [], $timeout = 45)\n {\n // where are we connecting to?\n $url = BuildUrl::from($this->baseUrl, $path, $queryStringParams);\n\n // build the HTTP request\n curl_setopt($this->curlHandle, CURLOPT_URL, $url);\n curl_setopt($this->curlHandle, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\n // remember what we're sending\n $request = [\n 'url' => $url,\n 'method' => 'DELETE',\n ];\n\n // make the call\n return $this->httpCall($request, $headers, $timeout);\n }",
"public function delete()\n {\n //fetch endpoint information from schema file\n $endpoint = $this->getEndpoint(\"destroy\");\n\n if($this->id)\n {\n $response = $this->api->request(\"/api/\".str_ireplace('{id}',$this->id,$endpoint->href),$endpoint->method);\n\n switch($response['code']) {\n case \"200\":\n return $response;\n break;\n\n default:\n throw new SaleskingException(\"DELETE_ERROR\",\"Deleting failed, an error happend\",$response);\n break;\n }\n }\n else\n {\n throw new SaleskingException(\"DELETE_IDNOTSET\",\"could not delete object\");\n }\n }",
"function delete($url, $parameters = array()) { \n $response = $this->oAuthRequest($url, 'DELETE', $parameters); \n if ($this->format === 'json' && $this->decode_json) { \n return json_decode($response, true); \n } \n return $response; \n }",
"public function delete()\n {\n $data = $this->buildRequest($this);\n\n return $this->sendDeleteRequest($data, get_class());\n }",
"public function apiTokenDelete($tokenName,$param)\n {\n\n if ($this->connected) {\n\n try {\n $client = new \\http\\Client;\n $request = new \\http\\Client\\Request;\n\n $request->setRequestUrl(self::TOKEN_URL . '/' . self::COMPANY_ID . '/' . $tokenName . \"/\" . $param);\n $request->setRequestMethod('DELETE');\n $request->setHeaders(array(\n 'content-type' => 'application/json',\n 'authorization' => 'Bearer ' . $this->access_token\n\n ));\n\n $client->enqueue($request)->send();\n $response = $client->getResponse();\n\n return $response->getBody();\n\n } catch (HttpException $ex) {\n\n echo $ex->getMessage();\n }\n }\n else\n return false;\n }",
"function delete($val, $token = NULL) {\n \n // Initialize a cURL session\n $curl = curl_init($val);\n curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);\n curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)');\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);\n \n if ($token) {\n $authorization = \"Authorization: Bearer \" . $token; // **Prepare Autorisation Token**\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json', $authorization));\n }\n \n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n $data = curl_exec($curl);\n curl_close($curl);\n return $data;\n \n }",
"protected function executeDelete()\n\t{\n\t\tcurl_setopt($this->curlHandle, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\t\t$this->doExecute();\n\t}",
"public function delete() {\n\t\t$args = func_get_args() ;\n\t\treturn $this->__call('delete', $args) ;\n\t}",
"public function delete($data=array()){\n\t\t\treturn $this->requestor->delete(sprintf( $this->requests['delete']['url'] , $this->accountid ),$data);\n\t\t}",
"public function delete(Request $request, Response $response, array $args = []): Response;",
"function delete($url = \"\",$options = array()){\n\t\tif(is_array($url)){\n\t\t\t$options = $url;\n\t\t\t$url = \"\";\n\t\t}\n\t\t$options[\"request_method\"] = \"DELETE\";\n\t\treturn $this->fetchContent($url,$options);\n\t}",
"public function delete($uri, $body = null, array $headers = []): ResponseInterface;",
"public function deleteGet(): void {\n\t\t$this->response = $this->_request::send(\n\t\t\t$_ENV['HOME_URL'] . '/folder1/folder2/my-class/my-aspect',\n\t\t\t['id' => 4, 'methodUsed' => 'DELETE', 'description' => 'Request with DELETE method. Use to remove data. Response should be the successful of the action.'],\n\t\t\t'DELETE',\n\t\t\tnull,\n\t\t\t$this->httpCode\n\t\t);\n\t}"
] | [
"0.6699267",
"0.6381638",
"0.6381638",
"0.6285652",
"0.612239",
"0.6111044",
"0.60893095",
"0.60618967",
"0.60026556",
"0.5956172",
"0.5944225",
"0.59397507",
"0.5929744",
"0.59241956",
"0.5886462",
"0.5857991",
"0.5823084",
"0.5795214",
"0.5772618",
"0.5764929",
"0.57603395",
"0.574265",
"0.5725962",
"0.57253575",
"0.5724495",
"0.5718048",
"0.57162887",
"0.5713461",
"0.5688257",
"0.56855893"
] | 0.6884278 | 0 |
return last HTTP response code | function getLastHTTPCode()
{
return self::$LastHTTPCode;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lastStatusCode() { return $this->http_status; }",
"public function getLastStatusCode(): int\n {\n if (!($this->lastResponse instanceof Response)) {\n return -1;\n }\n\n return $this->lastResponse->getStatusCode();\n }",
"public function getHTTPResponseCode()\n {\n $headers = get_headers($this->uri);\n\n return (int) substr($headers[0], 9, 3);\n }",
"public function getLastHttpCode()\r\n {\r\n if (!$this->requested)\r\n throw new \\Exception('No requests done to get the last http code' . PHP_EOL);\r\n\r\n return $this->getHttpInfo('http_code');\r\n }",
"function get_response_code() {\n return (int) $this->response_info[\"http_code\"];\n }",
"public function get_http_response_code()\n\t{\n\t\treturn $this->get_info(CURLINFO_HTTP_CODE);\n\t}",
"function getResponseCode ()\n\t{\n\t\treturn $this->responseCode;\n\t}",
"public function getResponseCode();",
"public function getResponseCode();",
"public function getResponseCode()\n {\n return $this->_instance->getResponseCode();\n }",
"public function http_status()\n {\n return $this->response_code;\n }",
"function getStatusCode(){\n\t\tif(preg_match(\"/^HTTP\\\\/.\\\\.. ([0-9]{3})/\",$this->getResponseHeaders(),$matches)){\n\t\t\treturn (int)$matches[1];\n\t\t}\n\t}",
"public function getStatusCode() {\n\t \treturn http_response_code();\n\t }",
"public function getResponseCode()\n {\n return $this->httpRequest->getResponseCode();\n }",
"public function getHttp_code()\n {\n return $this->http_code;\n }",
"public function getResponseCode()\r\n\t{\r\n\t\treturn $this->responseCode;\r\n\t}",
"public function getHttpCode(){\n return $this->responseHttpCode;\n }",
"protected function getResponseCode()\r\n\t{\r\n\t\treturn $this->_responseCode;\r\n\t}",
"public function get_response_code()\n {\n return $this->_server_response_code;\n }",
"function getHttpCode();",
"public static function getCode ()\n\t{\n\t\treturn self::$curl_last_info['http_code'];\n\t}",
"public function getHttpCode()\n\t{\n\t\treturn $this->HeaderResponseCode;\n\t}",
"public function getResponseCode()\n {\n return $this->responseCode;\n }",
"public function getResponseCode()\n {\n return $this->responseCode;\n }",
"public function getResponseCode()\n {\n return $this->responseCode;\n }",
"public function getStatusCode(): int;",
"public function getStatusCode(): int;",
"public function getStatusCode(): int;",
"public function getResponseCode() {\n return $this->_response_code;\n }",
"public function getHTTPStatusCode() : int\n {\n return $this->HTTPStatusCode;\n }"
] | [
"0.83485425",
"0.79457587",
"0.7920594",
"0.79199445",
"0.76317394",
"0.7605449",
"0.7597185",
"0.74973726",
"0.74973726",
"0.74642247",
"0.7461948",
"0.7459657",
"0.74574465",
"0.7453728",
"0.7446465",
"0.7430152",
"0.74195033",
"0.7417665",
"0.7393305",
"0.7379332",
"0.73269963",
"0.7314304",
"0.7300799",
"0.7300799",
"0.7300799",
"0.72811764",
"0.72811764",
"0.72811764",
"0.72711974",
"0.7256673"
] | 0.80583656 | 1 |
get the listed info on the queued job requests | public static function getqueuedorderslist()
{
global $json_api;
try {
if (isset($json_api->query->type)) {
$t = $json_api->query->type;
$data = array();
if ($t == 'processed') {
} else if ($t == 'all') {
} else {
throw new Exception("invalid param", 1337);
}
};
api_handler::outSuccessDataTable($data);
} catch (Exception $e) {
api_handler::outFail($e->getCode(), $e->getMessage());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function __getRequests() {\n $sql = 'SELECT \"name\" FROM \"request\"';\n $res = $this->__execSql($sql);\n return array_map(function($v) { return $v['name']; }, $res);\n }",
"public function getQueues();",
"public function getRequests(): array\n {\n return $this->_aRequests;\n }",
"public function getJobs() {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }",
"public function getRequests()\n\t{\n\t\treturn $this->requests();\n\t}",
"public function listQueues();",
"private function queuedItems()\n {\n return Capsule::table('steam_queue')\n ->where('status', 'queued')\n ->count();\n }",
"function ciniki_poma_web_processRequestQueue(&$ciniki, $settings, $tnid, $args) {\n\n \n $page = array(\n 'title'=>$args['page_title'],\n 'breadcrumbs'=>$args['breadcrumbs'],\n 'blocks'=>array(),\n 'submenu'=>array(),\n );\n\n $page['breadcrumbs'][] = array('name'=>'Queue', 'url'=>$args['base_url'] . '/queue');\n\n $date_format = 'M j, Y';\n\n $api_queue_update = 'ciniki/poma/queueObjectUpdate/';\n\n //\n // Get the list of active queued items for the customer\n //\n $strsql = \"SELECT ciniki_poma_queued_items.id, \"\n . \"ciniki_poma_queued_items.object, \"\n . \"ciniki_poma_queued_items.object_id, \"\n . \"ciniki_poma_queued_items.description, \"\n . \"ciniki_poma_queued_items.quantity \"\n . \"FROM ciniki_poma_queued_items \"\n . \"WHERE ciniki_poma_queued_items.customer_id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['customer']['id']) . \"' \"\n . \"AND ciniki_poma_queued_items.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND ciniki_poma_queued_items.status = 40 \"\n . \"ORDER BY ciniki_poma_queued_items.description \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.poma', array(\n array('container'=>'items', 'fname'=>'id', \n 'fields'=>array('id', 'object', 'object_id', 'name'=>'description', 'queue_quantity'=>'quantity')),\n ));\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n }\n $ordered = array();\n if( isset($rc['items']) && count($rc['items']) > 0 ) {\n $ordered = $rc['items'];\n }\n \n //\n // Get the list of active queued items for the customer\n //\n $strsql = \"SELECT ciniki_poma_queued_items.id, \"\n . \"ciniki_poma_queued_items.object, \"\n . \"ciniki_poma_queued_items.object_id, \"\n . \"ciniki_poma_queued_items.description, \"\n . \"ciniki_poma_queued_items.quantity \"\n . \"FROM ciniki_poma_queued_items \"\n . \"WHERE ciniki_poma_queued_items.customer_id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['customer']['id']) . \"' \"\n . \"AND ciniki_poma_queued_items.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND ciniki_poma_queued_items.status = 10 \"\n . \"ORDER BY ciniki_poma_queued_items.description \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.poma', array(\n array('container'=>'items', 'fname'=>'id', \n 'fields'=>array('id', 'object', 'object_id', 'name'=>'description', 'queue_quantity'=>'quantity')),\n ));\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n }\n $active = array();\n if( isset($rc['items']) ) {\n $active = $rc['items'];\n }\n\n if( count($ordered) > 0 ) {\n $page['blocks'][] = array('type'=>'orderqueue', 'size'=>'wide', 'ordered'=>'yes',\n 'api_queue_update'=>$api_queue_update,\n 'intro'=>\"Here is the list of items from your queue on order.\",\n// 'pretext'=>'There are ',\n// 'posttext'=>' on order for you',\n 'queue'=>$ordered);\n }\n if( count($active) > 0 ) {\n $page['blocks'][] = array('type'=>'orderqueue', 'size'=>'wide',\n 'title'=>(count($ordered) > 0 ? 'Queued Items' : ''),\n 'api_queue_update'=>$api_queue_update,\n 'intro'=>\"Here is the list of items you have in your queue.\",\n// 'pretext'=>'You have ',\n// 'posttext'=>' in your queue',\n 'queue'=>$active);\n }\n if( count($active) == 0 && count($ordered) == 0 ) {\n $page['blocks'][] = array('type'=>'content', 'content'=>\"You don't have any items in your queue. \"\n . \"To add item, browse the products and click on the cart icon to add it to your queue.\");\n }\n\n return array('stat'=>'ok', 'page'=>$page);\n}",
"public function getRequests() : array\n {\n return $this->requests;\n }",
"public function getQueues()\n {\n return array_keys($this->_data);\n }",
"public function getRequests()\n {\n return $this->requests;\n }",
"private function trackableJobInitData()\n {\n Queue::setConnectionName('database');\n\n return [\n 'user_id' => $this->user->id,\n 'input' => [\n 'job_type' => \\App\\Models\\JobStatus::JOB_TYPE_MISCELLANEOUS,\n 'job_task_name' => 'Example Trackable Job With Subtasks',\n 'queue_stack_wait' => Queue::size() \n ]\n ];\n }",
"public function getRunningJobs() {\n $jobs = array();\n // TODO: impelement this function.\n return $jobs;\n }",
"public function list_sync_requests() {\n\t\t$stmt = $this->database->prepare(\"SELECT * FROM sync_request WHERE server_id = ?\");\n\t\t$stmt->bind_param('d', $this->id);\n\t\t$stmt->execute();\n\t\t$result = $stmt->get_result();\n\t\t$reqs = array();\n\t\twhile($row = $result->fetch_assoc()) {\n\t\t\t$reqs[] = new SyncRequest($row['id'], $row);\n\t\t}\n\t\treturn $reqs;\n\t}",
"public function getAfterJobs();",
"public function getJobs()\n {\n return $this->_configData->getJobs();\n }",
"public function getJobs()\n {\n return $this->jobs;\n }",
"public function getJobs()\n {\n return $this->jobs;\n }",
"public function getJobs()\n {\n return $this->jobs;\n }",
"public function getJobs() {\n return $this->_getJobs();\n }",
"public function getQueue() {\n return $this->queue->getValues();\n }",
"public function getQueuedSignups()\n {\n return array();\n }",
"public function jobs()\n {\n return $this->urgentJobs()\n + $this->readyJobs()\n + $this->reservedJobs()\n + $this->delayedJobs()\n + $this->buriedJobs()\n ;\n }",
"protected function marshalPushedJob()\n\t{\n\t\t$r = $this->request;\n\n\t\t/*Log::info('SqsQueue marshalPushedJob', array(\t'MessageId' => $this->parseOutMessageId($r),\n \t\t\t\t\t'Body' => $this->parseOutMessage($r),\n \t\t\t\t\t'pushed' => true,\n\t\t\t\t\t\t\t ));\n\t\t*/\n\n\t\treturn array(\n\t\t\t'MessageId' => $this->parseOutMessageId($r),\n\t\t\t'Body' => $this->parseOutMessage($r)\n\t\t);\n\t}",
"public function getJobs() {\n return $this->jobs;\n }",
"public function getJobs() {\n return $this->jobs;\n }",
"public function list_sync_requests() {\n\t\t$stmt = $this->database->prepare(\"SELECT * FROM sync_request WHERE server_id = ? ORDER BY account_name\");\n\t\t$stmt->bind_param('d', $this->id);\n\t\t$stmt->execute();\n\t\t$result = $stmt->get_result();\n\t\t$reqs = array();\n\t\twhile($row = $result->fetch_assoc()) {\n\t\t\t$reqs[] = new SyncRequest($row['id'], $row);\n\t\t}\n\t\treturn $reqs;\n\t}",
"public function get_queue_status() {\n\t\t$queue = $this->get_queue();\n\t\t$pending = count( $queue['pending'] );\n\t\t$done = count( $queue['done'] );\n\t\t$processing = count( $queue['processing'] );\n\t\t$error = count( $queue['error'] );\n\t\t$total = $done + $pending + $processing + $error;\n\t\t$completed = $done;\n\t\t$file = null;\n\t\tif ( ! empty( $queue['processing'][0] ) ) {\n\t\t\t$file = get_attached_file( $queue['processing'][0] );\n\t\t}\n\t\t$percent = 100;\n\t\tif ( $completed < $total ) {\n\t\t\t$percent = round( ( $completed + $error ) / ( $total ) * 100, 1 );\n\t\t}\n\n\t\t$return = array(\n\t\t\t'total' => $total,\n\t\t\t'processing' => $processing,\n\t\t\t'current_file' => $file ? basename( $file ) : null,\n\t\t\t'pending' => $pending + $processing,\n\t\t\t'done' => $completed,\n\t\t\t'error' => $queue['error'],\n\t\t\t'percent' => $percent,\n\t\t);\n\t\tif ( ! empty( $queue['started'] ) ) {\n\t\t\t$return['started'] = $queue['started'];\n\t\t}\n\n\t\t// Auto Stop.\n\t\tif ( 100 === $return['percent'] ) {\n\t\t\t$this->stop_queue();\n\t\t}\n\n\t\treturn $return;\n\t}",
"public function readyJobs()\n {\n return $this->get('current-jobs-ready', 0);\n }",
"public function getQueue(): array\n {\n return $this->queue;\n }"
] | [
"0.68424475",
"0.6463775",
"0.6404877",
"0.6371992",
"0.636563",
"0.6301932",
"0.6278865",
"0.6276319",
"0.62729067",
"0.6262488",
"0.6246588",
"0.61920846",
"0.6166091",
"0.6092647",
"0.6054491",
"0.6041055",
"0.6030044",
"0.6030044",
"0.6030044",
"0.59952986",
"0.599454",
"0.5993758",
"0.5971332",
"0.5966269",
"0.59659564",
"0.59659564",
"0.5965234",
"0.5935894",
"0.5924758",
"0.5900743"
] | 0.6479626 | 1 |
Returns a number of random tracks from the users saved tracks given by the query string 'count' | function randomTracks(Request $request) {
$count = $request->input('count', 5);
$maxOffset = 50;
$tracks = [];
// Get a track to find the number of tracks we currently have
$res = $this->spotifyService->get('https://api.spotify.com/v1/me/tracks' . '?limit=1');
$data = $res->getData();
$totalTracks = $data['total'] - 1; // Minus 1 for index
// Get random track numbers
$trackNums = [];
for ($i=0; $i < $count; $i++) {
while(in_array($num = mt_rand(0, $totalTracks), $trackNums)){}
$trackNums[] = $num;
}
// Sort track nums ascending
sort($trackNums);
// Split the requests into groups to make as few API calls as possible
$trackRequests = [];
$this->rangeGroup($trackNums, $maxOffset, $trackRequests);
// Each track request contains a group of tracks that should fit into one request
foreach ($trackRequests as $trackRequest) {
// Offest is just the first track #
$offset = $trackRequest[0];
// Limit is the range of the values in the request
$limit = $trackRequest[count($trackRequest) - 1] - $trackRequest[0] + 1;
// Do the request
$res = $this->spotifyService->get("https://api.spotify.com/v1/me/tracks?offset=$offset&limit=$limit");
if ($res->getSuccess() == false) {
// If we had a problem, resturn the access code
return response()->json(['success' => false, 'status_code' => $res->getStatusCode()]);
} else {
$data = $res->getData();
foreach ($trackRequest as $trackIdx) {
// Get the information from the track
$trackInfo = $data['items'][$trackIdx - $offset]['track'];
$track = [
'name' => $trackInfo['name'],
'url' => $trackInfo['external_urls']['spotify'],
'album_name' => $trackInfo['album']['name'],
'album_url' => $trackInfo['album']['external_urls']['spotify'],
'artist_name' => $trackInfo['artists'][0]['name'],
'artist_url' => $trackInfo['artists'][0]['external_urls']['spotify'],
'preview_url' => $trackInfo['preview_url'],
'spotify_id' => $trackInfo['id'],
'spotify_uri' => $trackInfo['uri'],
'album_img' => $trackInfo['album']['images'][2]['url'],
];
$tracks[] = $track;
}
}
}
return response()->json(['success' => true, 'data' => $tracks]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function popular($count)\n {\n return self::withCount('questions')\n ->orderBy('questions_count', 'desc')\n ->take($count)\n ->get();\n }",
"public static function fake($count = null)\n {\n// return self::runTest(self::$table, $count);\n for ($i = 1; $i <= $count; $i++) {\n $data = [\n 'poster' => self::$faker->name(),\n 'poster_id' => self::$faker->numberBetween(1, Info::$tables['users']['fakeCount']),\n 'poster_ip' => self::$faker->ipv4(),\n 'poster_email' => self::$faker->safeEmail(),\n 'message' => self::$faker->text(550),\n 'posted' => self::$faker->unixTime('now'),\n 'topic_id' => self::$faker->numberBetween(1, Info::$tables['topics']['fakeCount'])\n ];\n self::addData(self::$table, $data);\n if($i === self::$limit) {\n $count = $count - $i;\n self::pushLog(self::$table, $count, (microtime(true) - Container::get('start')));\n return $count;\n }\n }\n self::pushLog(self::$table, $count, (microtime(true) - Container::get('start')));\n return null;\n }",
"function getRandomMovies($count = 10){\n global $pdo;\n\n $sql = \"SELECT * FROM movies_full\n ORDER BY RAND()\n LIMIT $count\";\n $query = $pdo->prepare($sql);\n $query->execute();\n\n return $query->fetchALL();\n }",
"function AddRandomTracksFromLibrary($trackids, $library, $user, $num)\n{\n $tracks = GetAllPlaylistTrackIds($library, $user);\n shuffle($tracks);\t\n if ($num > 0)\n {\n $tracks = array_slice($tracks, 0, $num);\n }\n foreach ($tracks as $item)\n {\n array_push($trackids, $item);\n }\n return $trackids;\n}",
"public function pull_winners(Request $request, $id, $count)\n {\n if($request->query->get('count')) {\n $count = $request->query->get('count');\n }\n\n $this->app['page']['title'] = 'POMPdeLUX Facebook galleri';\n $this->app['page']['browser_title'] = ' » Vindere';\n\n $gallery_pictures = $this->app['db']->fetchAll(\"SELECT * FROM gallery_pictures p LEFT JOIN gallery_users u ON (u.uid = p.uid) WHERE p.gallery_id = ? ORDER BY RAND() LIMIT {$count}\", array((int) $id));\n\n $this->app['page']->setGalleryId($id);\n $this->app['page']->setPictures($gallery_pictures);\n\n return $this->app->render(\"Admin/pictures.twig\");\n }",
"function KRS_STG_stt2_db_get_random_terms($count)\r\n\t{\r\n\t\t$result = wp_cache_get('stt2_random_terms');\r\n\t\tif (false == $result) {\r\n\t\t\tglobal $wpdb;\r\n\t\t\t$result = $wpdb->get_results(\"SELECT `meta_value`,`post_id` FROM `\" . $wpdb->prefix . \"stt2_meta` WHERE `post_id` != 0 ORDER BY RAND() LIMIT \" . $count . \";\");\r\n\t\t\twp_cache_set('stt2_random_terms', $result, 3600);\r\n\t\t}\r\n\t\treturn $result;\r\n\t}",
"public function getNextResults($count);",
"function AddRandomTracksFromBundle($trackids, $bundle, $num)\n{\n shuffle($bundle);\t\n $bundleSample = array_slice($bundle, 0, $num);\n foreach ($bundleSample as $item)\n {\n array_push($trackids, $item);\n }\n return $trackids;\n}",
"public function getCount();",
"public function getCount();",
"public function getCount();",
"public function getCount();",
"public function getCount();",
"public function getCount();",
"public static function getRecentReportsByCount($count = 10) {\n\n if ($count == '') {\n $count = 10;\n }\n\n return self::findPIREPS(array(), intval($count));\n }",
"public function setCount($count);",
"public function get($count = NULL) {\n\t\tif(is_null($count))\n\t\t\treturn $this->model->take(5)->get();\n\t\telse\n\t\t\treturn $this->model->take($count)->get();\n\t}",
"function list_popular_hashtags($length)\n{\n $db = \\Db::dbc();\n\n $hashtags = [];\n\n $query = $db->prepare(\"SELECT nameHashtag FROM hashtag GROUP BY nameHashtag ORDER BY count(nameHashtag) DESC\");\n $query->execute();\n\n while (($result = $query->fetch()) && $length > 0) {\n $length = $length - 1;\n $hashtags[] = $result[\"nameHashtag\"];\n }\n\n return $hashtags;\n}",
"public static function ListRandom($count = 8) {\n $barang = array();\n while ($count > 0) {\n $random = rand(self::GetRowMax(), self::GetRowMax());\n $model = Barang::model()->findByAttributes(array('BARANG_ID'=>$random, 'BARANG_STATUS'=>self::AKTIF));\n if($model !== null) {\n array_push($barang, $model);\n $count--;\n }\n }\n \n return $barang;\n }",
"public function getSimilarShownCountAction()\n {\n $sql = 'SELECT COUNT(id) FROM s_articles';\n $count = Shopware()->Db()->fetchOne($sql);\n\n $this->View()->assign(['success' => true, 'data' => ['count' => $count]]);\n }",
"public function index(Request $request, ?int $count = null)\n {\n return response()->json($this->interactionRepository->getRecentlyPlayed($request->user(), $count));\n }",
"public function getMostPopularItems($count = null)\n {\n $command = $this->client->getCommand('GetMostPopularItems', array(\n 'howMany' => $count,\n ));\n\n return $this->client->execute($command)->json();\n }",
"function getFavoritesCount($uid)\n\t{\n\t\tglobal $db;\n\t\t$sqlFavCount =\"SELECT count(*) as Favcount FROM `rs_favorites` WHERE `user_id`='\".$uid.\"'\";\n\t\t$resFavCount =$db->select_data($sqlFavCount);\n\t\treturn $resFavCount[0]['Favcount'];\n\t}",
"public function random($count){\n $blog = Blog::select('*')\n ->inRandomOrder()\n ->limit($count)\n ->get();\n\n $data['blogs'] = $blog;\n \n return response()->json([\n 'response_code'=>'00',\n 'response_message'=>'Success Create Data',\n 'data'=>$data\n ],200);\n }",
"function us_get_sharing_counts( $url, $providers ) {\r\n\t// TODO One-end hashing function needed\r\n\t$transient = 'us_sharing_count_' . md5( $url );\r\n\t// Will be used for array keys operations\r\n\t$flipped = array_flip( $providers );\r\n\t$cached_counts = get_transient( $transient );\r\n\tif ( is_array( $cached_counts ) ) {\r\n\t\t$counts = array_intersect_key( $cached_counts, $flipped );\r\n\t\tif ( count( $counts ) == count( $providers ) ) {\r\n\t\t\t// The data exists and is complete\r\n\t\t\treturn $counts;\r\n\t\t}\r\n\t} else {\r\n\t\t$counts = array();\r\n\t}\r\n\r\n\t// Facebook share count\r\n\tif ( in_array( 'facebook', $providers ) AND ! isset( $counts['facebook'] ) ) {\r\n\t\t$fb_query = 'SELECT share_count FROM link_stat WHERE url = \"';\r\n\t\t$remote_get_url = 'https://graph.facebook.com/fql?q=' . urlencode( $fb_query ) . $url . urlencode( '\"' );\r\n\t\t$result = wp_remote_get( $remote_get_url, array( 'timeout' => 3 ) );\r\n\t\tif ( is_array( $result ) ) {\r\n\t\t\t$data = json_decode( $result['body'], TRUE );\r\n\t\t} else {\r\n\t\t\t$data = NULL;\r\n\t\t}\r\n\t\tif ( is_array( $data ) AND isset( $data['data'] ) AND isset( $data['data'][0] ) AND isset( $data['data'][0]['share_count'] ) ) {\r\n\t\t\t$counts['facebook'] = $data['data'][0]['share_count'];\r\n\t\t} else {\r\n\t\t\t$counts['facebook'] = '0';\r\n\t\t}\r\n\t}\r\n\r\n\t// Twitter share count\r\n\tif ( in_array( 'twitter', $providers ) AND ! isset( $counts['twitter'] ) ) {\r\n\t\t// Twitter is not supporting sharing counts API and has no plans for it at the moment\r\n\t\t$counts['twitter'] = '0';\r\n\t}\r\n\r\n\t// Google+ share count\r\n\tif ( in_array( 'gplus', $providers ) AND ! isset( $counts['gplus'] ) ) {\r\n\t\t// Cannot use the official API, as it requires a separate key, and even with this key doesn't work\r\n\t\t$result = wp_remote_get( 'https://plusone.google.com/_/+1/fastbutton?url=' . $url, array( 'timeout' => 3 ) );\r\n\t\tif ( is_array( $result ) AND preg_match( '~\\<div[^\\>]+id=\\\"aggregateCount\\\"[^\\>]*\\>([^\\>]+)\\<\\/div\\>~', $result['body'], $matches ) ) {\r\n\t\t\t$counts['gplus'] = $matches[1];\r\n\t\t} else {\r\n\t\t\t$counts['gplus'] = '0';\r\n\t\t}\r\n\t}\r\n\r\n\t// LinkedIn share count\r\n\tif ( in_array( 'linkedin', $providers ) AND ! isset( $counts['linkedin'] ) ) {\r\n\t\t$result = wp_remote_get( 'http://www.linkedin.com/countserv/count/share?url=' . $url . '&format=json', array( 'timeout' => 3 ) );\r\n\t\tif ( is_array( $result ) ) {\r\n\t\t\t$data = json_decode( $result['body'], TRUE );\r\n\t\t} else {\r\n\t\t\t$data = NULL;\r\n\t\t}\r\n\t\t$counts['linkedin'] = isset( $data['count'] ) ? $data['count'] : '0';\r\n\t}\r\n\r\n\t// Pinterest share count\r\n\tif ( in_array( 'pinterest', $providers ) AND ! isset( $counts['pinterest'] ) ) {\r\n\t\t$result = wp_remote_get( 'http://api.pinterest.com/v1/urls/count.json?callback=receiveCount&url=' . $url, array( 'timeout' => 3 ) );\r\n\t\tif ( is_array( $result ) ) {\r\n\t\t\t$data = json_decode( rtrim( str_replace( 'receiveCount(', '', $result['body'] ), ')' ), TRUE );\r\n\t\t} else {\r\n\t\t\t$data = NULL;\r\n\t\t}\r\n\t\t$counts['pinterest'] = isset( $data['count'] ) ? $data['count'] : '0';\r\n\t}\r\n\r\n\t// VK share count\r\n\tif ( in_array( 'vk', $providers ) AND ! isset( $counts['vk'] ) ) {\r\n\t\t$result = wp_remote_get( 'http://vkontakte.ru/share.php?act=count&index=1&url=' . $url, array( 'timeout' => 3 ) );\r\n\t\tif ( is_array( $result ) ) {\r\n\t\t\t$data = intval( trim( str_replace( ');', '', str_replace( 'VK.Share.count(1, ', '', $result['body'] ) ) ) );\r\n\t\t} else {\r\n\t\t\t$data = NULL;\r\n\t\t}\r\n\t\t$counts['vk'] = ( ! empty( $data ) ) ? $data : '0';\r\n\t}\r\n\r\n\t// Caching the result for the next 2 hours\r\n\tset_transient( $transient, $counts, 2 * HOUR_IN_SECONDS );\r\n\r\n\treturn $counts;\r\n}",
"function stt_random_terms($count = 10)\r\n\t{\r\n\t\t$options = get_option('KRS_STG_stt2_settings');\r\n\t\t$searchterms = KRS_STG_stt2_db_get_random_terms($count);\r\n\t\tif (!empty($searchterms)) {\r\n\t\t\t$result = KRS_STG_stt2_function_prepare_searchterms($searchterms, $options, true);\r\n\t\t\treturn $result;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function setCount($var)\n {\n GPBUtil::checkInt32($var);\n $this->count = $var;\n }",
"public function custom_rand_no($table, $countwith=1890){\n \t$getres = DB::table($table)->select('id')->latest()->first();\n \t$param1 = 0;\n \tif(!empty(@$getres)){\n \t\t$param1 = @$getres->id;\n \t}\n \t$param2 = intval($countwith) + intval($param1);\n \t$rand_no = 'QZ_'.rand(0,999).$param2;\n \treturn $rand_no;\n }",
"function KRS_STG_stt2_db_get_popular_terms($count)\r\n\t{\r\n\t\t$result = wp_cache_get('stt2_popular_terms');\r\n\t\tif (false == $result) {\r\n\t\t\tglobal $wpdb;\r\n\t\t\t$result = $wpdb->get_results(\"SELECT `meta_value`,`meta_count`,`post_id` FROM `\" . $wpdb->prefix . \"stt2_meta` WHERE `post_id` != 0 ORDER BY `meta_count` DESC LIMIT \" . $count . \";\");\r\n\t\t\twp_cache_set('stt2_popular_terms', $result, 86400);\r\n\t\t}\r\n\t\treturn $result;\r\n\t}",
"public function getRecommendations(LarafySeed $seed, int $limit = 10)\n {\n $json = $this->get()->request('/recommendations', array_merge([\n 'limit' => $limit,\n 'market' => $this->market,\n ], $seed->getArrayForAPI()));\n\n return $json->tracks;\n }"
] | [
"0.5979886",
"0.5838451",
"0.57957846",
"0.5792537",
"0.5503219",
"0.5457387",
"0.5318029",
"0.53158414",
"0.53146076",
"0.53146076",
"0.53146076",
"0.53146076",
"0.53146076",
"0.53146076",
"0.5275762",
"0.52392524",
"0.52172226",
"0.52002645",
"0.51912606",
"0.5164639",
"0.51586425",
"0.51389205",
"0.51184964",
"0.511749",
"0.51103485",
"0.51092327",
"0.5103184",
"0.51009244",
"0.51001024",
"0.5087145"
] | 0.68663156 | 0 |
Creates a playlist from the tracks sent in the Request body | function createPlaylist(Request $request) {
// Retreive the info from the JSON request
$data = $request->json()->all();
$trackUris = $data['trackUris'];
$playlistName = $data['name'];
$user = $this->getUser();
// Send the request to create a new playlist
$uri = 'https://api.spotify.com/v1/users/' . $user->spotify_id . '/playlists';
$res = $this->spotifyService->post($uri, [
'headers' => [
'Authorization' => 'Bearer ' . $this->session->get('access_token'),
'Content-Type' => 'application/json',
],
'json' => [
'name' => $playlistName
]
]);
// Get the ID for the newly created playlist
$playlistInfo = $res->getData();
$playlistId = $playlistInfo['id'];
// Send the request to add the tracks to the new playlist
$uri = 'https://api.spotify.com/v1/users/' . $user->spotify_id . '/playlists/' . $playlistId . '/tracks';
$res = $this->spotifyService->post($uri, [
'headers' => [
'Authorization' => 'Bearer ' . $this->session->get('access_token'),
'Content-Type' => 'application/json',
],
'json' => [
'uris' => $trackUris,
]
]);
$info = $res->getData();
return response()->json(array('success' => true, 'playlist' => $playlistInfo, 'tracks' => $info));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createPlaylist($title,$description = \"\",$privacy = \"public\",$tags = array()) {\n\t\t\t$object = json_encode(array(\n\t\t\t\t\"snippet\" => array(\n\t\t\t\t\t\"title\" => $title,\n\t\t\t\t\t\"description\" => $description,\n\t\t\t\t\t\"tags\" => $tags\n\t\t\t\t),\n\t\t\t\t\"status\" => array(\n\t\t\t\t\t\"privacyStatus\" => $privacy,\n\t\t\t\t)\n\t\t\t));\n\t\t\t$response = $this->call(\"playlists?part=snippet,status\",$object,\"POST\");\n\t\t\tif (!isset($response->id)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn new BigTreeYouTubePlaylist($response,$this);\n\t\t}",
"public function createPlaylist(array $playlist) {\n $response = $this->api->post('/playlist', array('playlist' => $playlist));\n\n return $response->success ? $response->data : array();\n }",
"public function addPlaylist()\n {\n $this->validatePresentedData(['name']);\n\n $playlistName = $this->request->get('name');\n\n $playlistModel = new PlaylistModel;\n\n $currentUserId = $this->user->getId();\n\n if ($playlistModel->getPlaylistByName($playlistName, $currentUserId) !== false) {\n throw new BadRequestException('Playlist with this name already exists!');\n }\n\n $playlistId = $playlistModel->addPlaylist($playlistName, $currentUserId);\n\n $responseData = ['playlist' => ['id' => $playlistId, 'userId' => $currentUserId, 'name' => $playlistName]];\n\n $this->response->addHeader('201 Created')->send($responseData);\n }",
"function createPlaylistItem($playlist,$video,$position = false,$note = false,$start_at = false,$end_at = false) {\n\t\t\t$object = array(\n\t\t\t\t\"snippet\" => array(\n\t\t\t\t\t\"playlistId\" => $playlist,\n\t\t\t\t\t\"resourceId\" => array(\"kind\" => \"youtube#video\",\"videoId\" => $video)\n\t\t\t\t),\n\t\t\t\t\"contentDetails\" => array()\n\t\t\t);\n\t\t\tif ($position !== false) {\n\t\t\t\t$object[\"snippet\"][\"position\"] = $position;\n\t\t\t}\n\t\t\tif ($note !== false) {\n\t\t\t\t$object[\"contentDetails\"][\"note\"] = $note;\n\t\t\t}\n\t\t\tif ($start_at !== false) {\n\t\t\t\t$object[\"contentDetails\"][\"startAtMs\"] = $this->timeJoin($start_at);\n\t\t\t}\n\t\t\tif ($end_at !== false) {\n\t\t\t\t$object[\"contentDetails\"][\"endAtMs\"] = $this->timeJoin($end_at);\n\t\t\t}\n\t\t\t$response = $this->call(\"playlistItems?part=snippet,contentDetails,status\",json_encode($object),\"POST\");\n\t\t\tif (!isset($response->id)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn new BigTreeYouTubePlaylistItem($response,$this);\n\t\t}",
"public function createPlaylist(string $name): PlaylistInterface\n {\n $controller = $this->getController();\n\n $data = $controller->soap(\"AVTransport\", \"CreateSavedQueue\", [\n \"Title\" => $name,\n \"EnqueuedURI\" => \"\",\n \"EnqueuedURIMetaData\" => \"\",\n ]);\n\n $playlist = new Playlist($data[\"AssignedObjectID\"], $controller);\n\n $this->playlists[] = $playlist;\n\n return $playlist;\n }",
"public function store($playlist_name, Request $request)\n {\n $playlist = $this->playListByName($playlist_name);\n if (!$playlist) {\n return response()->json(['msg'=>\"Invalid playlist\"], 404);\n }\n $input = $request->all();\n\n //set the playlist id to the one based in the url\n $input['playlist_id'] = $playlist->id;\n\n if(!array_key_exists('priority', $input)) {\n $lastSong = $this->song->where('playlist_id', '=', $playlist->id)\n ->orderby('priority', 'desc')->first();\n\n if (!$lastSong)\n $input['priority'] = $this->priorityDistance;\n else\n $input['priority'] = floor($lastSong->priority) + $this->priorityDistance;\n }\n $validator = Validator::make($input, $this->song->validationRules());\n\n if ($validator->fails()) {\n return response()->json($validator->errors(), 400);\n }\n\n $newSong = new $this->song();\n $newSong->fill($input);\n\n\n $newSong->save();\n return response()->json($newSong, 200);\n }",
"public function create($data)\n {\n $songs = [];\n switch ($data->type) {\n case 'upload':\n foreach ($data->music as $item) {\n $id = $this->songRepository->create($data->user()->id, substr($item->getClientOriginalName(), 0, -4), $data->playlist_id, $data->author_id, $data->genre_id);\n $uploaded = $this->fileService->upload($item, $id . '.mp3');\n $songs[] = ['id' => $id, 'uploaded' => $uploaded];\n }\n if (empty($songs)) {\n return false;\n }\n break;\n case 'url':\n $tmpName = Str::random(10);\n $uploaded = $this->fileService->downloadByUrl($data->url, $tmpName);\n if ($uploaded) {\n $id = $this->songRepository->create($data->user()->id, $data->name, $data->playlist_id, $data->author_id, $data->genre_id);\n $uploaded = $this->fileService->endDownloadByUrl($id, $tmpName);\n $songs[] = ['id' => $id, 'uploaded' => $uploaded];\n } else {\n return false;\n }\n break;\n default:\n return false;\n }\n\n return $songs;\n }",
"public function tracksAction(){\n\t $request = $this->getRequest();\n\t $userId = $this->params()->fromRoute('id');\n\t $result = array();\n\t $result['list'] = $this->translator->translate('There is not any Spotify account set yet');\n\t $serviceLocator = $this->getServiceLocator();\n\t $config = $serviceLocator->get('Config');\n\t try {\n\t $session = new \\SpotifyWebAPI\\Session($config['SpotifyClient']['client_id'], $config['SpotifyClient']['client_secret'], $config['SpotifyClient']['redirect_uri']);\n\t \n $spotify_user_id = $this->getServiceLocator()->get('SpotifyProfileService')->findByCodeAndUserId('user_id', $userId);\n $playlistId = $this->getServiceLocator()->get('SpotifyProfileService')->findByCodeAndUserId('playlist', $userId);\n $record = $this->getServiceLocator()->get('SpotifyProfileService')->findByCodeAndUserId('access_token', $userId);\n \n\t if($record){\n\t $api = new \\SpotifyWebAPI\\SpotifyWebAPI();\n\t \n\t $session->setRefreshToken($record->getValue());\n\t $session->refreshToken();\n\t \n\t $accessToken = $session->getAccessToken();\n\t \n\t // Set the new access token on the API wrapper\n\t $api->setAccessToken($accessToken);\n\t \n\t if($playlistId){\n $playlist = $api->getUserPlaylist($spotify_user_id->getValue(), $playlistId->getValue());\n $result['link'] = $playlist->external_urls->spotify;\n $result['title'] = $playlist->name;\n \t $result['list'] = '<ul class=\"list-inline\">';\n \t if($playlist->tracks->items){\n \t foreach($playlist->tracks->items as $item){\n \t if($playlist->owner->id == $spotify_user_id->getValue()) {\n\t\t\t\t\t\t\t\t\tif(!empty($item->track->external_urls->spotify)){\n\t\t\t\t\t\t\t\t\t\t$result['list'] .= '<li><a target=\"_blank\" href=\"' . $item->track->external_urls->spotify . '\"><img class=\"img-responsive img-thumbnail\" alt=\"' . $item->track->name . '\" title=\"' . $item->track->name .'(' . $item->track->artists[0]->name .')\" src=\"' . $item->track->album->images[2]->url. '\" width=\"64\" /></a></li>';\n\t\t\t\t\t\t\t\t\t}\n \t }\n \t }\n \t }\n \t $result['list'] .= '</ul>';\n\t }else{\n\t $result['list'] = $this->translator->translate('There is no playlist preference set yet');\n\t }\n\t }\n }catch (\\Exception $e){\n $result = $e->getMessage();\n }\n\t die(json_encode($result));\n\t}",
"public function store(Request $request)\n {\n $playlist_id = 'PLpcSpRrAaOaoIqHQddZOdbRrzr5dJtgSs';\n\n $playlistInfo = $this->getPlaylistInfo($playlist_id);\n\n $playlist = new Playlist;\n\n $playlist->user_id = Auth::user()->id;\n $playlist->publish_date = date(\"Y-m-d H:i:s\", strtotime($playlistInfo['publishDate']));\n $playlist->playlist_id = $playlist_id;\n $playlist->e_tag = $playlistInfo['e_tag'];\n $playlist->title = $playlistInfo['title'];\n $playlist->description = $playlistInfo['description'];\n $playlist->thumbnail = $playlistInfo['thumbnail'];\n $playlist->video_iframe = $playlistInfo['video_iframe'];\n $playlist->channel_title = $playlistInfo['channelTitle'];\n\n $playlist->save();\n }",
"public function playlistracksAction(){\n\t $request = $this->getRequest();\n\t $userId = $this->params()->fromRoute('id');\n\t $playlistId = $this->params()->fromRoute('playlist');\n\t $result = array();\n\t $result['list'] = $this->translator->translate('There is not any Spotify account set yet');\n\t $serviceLocator = $this->getServiceLocator();\n\t $config = $serviceLocator->get('Config');\n\t try {\n\t $session = new \\SpotifyWebAPI\\Session($config['SpotifyClient']['client_id'], $config['SpotifyClient']['client_secret'], $config['SpotifyClient']['redirect_uri']);\n\t \n\t // Get a random and already Spotify User AUTHORIZED from the database\n $spotifyUserID = $this->getServiceLocator()->get('SpotifyProfileService')->findByCode('user_id');\n if(!$spotifyUserID->getUserId()){\n $result['list'] = $this->translator->translate('There is not any Spotify user set in the database yet');\n die(json_encode($result));\n }\n \n $spotify_user_id = $this->getServiceLocator()->get('SpotifyProfileService')->findByCodeAndUserId('user_id', $spotifyUserID->getUserId());\n $record = $this->getServiceLocator()->get('SpotifyProfileService')->findByCodeAndUserId('access_token', $spotifyUserID->getUserId());\n \n\t if($record){\n\t $api = new \\SpotifyWebAPI\\SpotifyWebAPI();\n\t \n\t $session->setRefreshToken($record->getValue());\n\t $session->refreshToken();\n\t \n\t $accessToken = $session->getAccessToken();\n\t \n\t // Set the new access token on the API wrapper\n\t $api->setAccessToken($accessToken);\n\t \n\t if($playlistId){\n $playlist = $api->getUserPlaylist($userId, $playlistId);\n $result['link'] = $playlist->external_urls->spotify;\n $result['title'] = $playlist->name;\n \t $result['list'] = '<h4><i class=\"fa fa-spotify\"></i> <a target=\"_blank\" href=\"'.$playlist->external_urls->spotify.'\">'.$playlist->name.'</a></h4><ul class=\"list-inline\">';\n \t if($playlist->tracks->items){\n \t foreach($playlist->tracks->items as $item){\n \t $result['list'] .= '<li><a target=\"_blank\" href=\"' . $item->track->external_urls->spotify . '\"><img class=\"img-responsive img-thumbnail\" alt=\"' . $item->track->name . '\" title=\"' . $item->track->name .'(' . $item->track->artists[0]->name .')\" src=\"' . $item->track->album->images[2]->url. '\" width=\"48\" /></a></li>';\n \t }\n \t }\n \t $result['list'] .= '</ul>';\n\t }else{\n\t $result['list'] = $this->translator->translate('There is no playlist preference set yet');\n\t }\n\t }\n }catch (\\Exception $e){\n $result = $e->getMessage();\n }\n\t die(json_encode($result));\n\t}",
"public function createPlaylist(User $loggedInUser = null, array $title = null)\n {\n return $this->createCollection(Series::TYPE_PLAYLIST, $loggedInUser, $title);\n }",
"public function tracks()\n {\n // Get all Tracks\n $tracks = Track::with('album','artist')\n ->where('user_id', Auth::user()->id)\n // ->whereHas('album', function ($query) {\n // $query->where(DB::raw('YEAR(released_at)'), 2015);\n // })\n // ->orderBy('added_at', 'desc')\n ->dynamicOrderBy($this->order)\n ->get();\n\n // Sort Tracks & sort by decade\n // $grouped = $tracks->sortBy('album.released_at')->groupBy(function ($item, $key) {\n // return (int) floor($item->album->released_at->format('Y') / 10) * 10;\n // });\n\n // Loop and create decade Playlist & add Tracks\n // foreach ($grouped->toArray() as $decade => $tracks) {\n // $playlist = $api->createUserPlaylist(Auth::user()->spotify_id, [\n // 'name' => $decade . 's'\n // ]);\n\n // foreach ($tracks as $track) {\n // $api->addUserPlaylistTracks(Auth::user()->spotify_id, $playlist->id, $track['spotify_id']);\n // }\n // }\n\n // Filter Tracks by Playlist Rules\n foreach ($this->rules as $rule) {\n switch ($rule->key)\n {\n case 'artist':\n $tracks = $tracks->filter(function ($track, $key) use ($rule) {\n if ($rule->comparison_operator == 'contains') {\n return (stripos($track->artist->name, $rule->value) !== false);\n } elseif ($rule->comparison_operator == 'not_contains') {\n return (stripos($track->artist->name, $rule->value) === false);\n } elseif ($rule->comparison_operator == '=') {\n return (strcmp($track->artist->name, $rule->value) === 0);\n } elseif ($rule->comparison_operator == '!=') {\n return (strcmp($track->artist->name, $rule->value) !== 0);\n } elseif ($rule->comparison_operator == 'begins_with') {\n return (strpos($track->artist->name, $rule->value) === 0);\n } elseif ($rule->comparison_operator == 'ends_with') {\n return (strpos(strrev($track->artist->name), strrev($rule->value)) === 0);\n }\n });\n break;\n case 'album':\n $tracks = $tracks->filter(function ($track, $key) use ($rule) {\n if ($rule->comparison_operator == 'contains') {\n return (stripos($track->album->name, $rule->value) !== false);\n } elseif ($rule->comparison_operator == 'not_contains') {\n return (stripos($track->album->name, $rule->value) === false);\n } elseif ($rule->comparison_operator == '=') {\n return (strcmp($track->album->name, $rule->value) === 0);\n } elseif ($rule->comparison_operator == '!=') {\n return (strcmp($track->album->name, $rule->value) !== 0);\n } elseif ($rule->comparison_operator == 'begins_with') {\n return (strpos($track->album->name, $rule->value) === 0);\n } elseif ($rule->comparison_operator == 'ends_with') {\n return (strpos(strrev($track->album->name), strrev($rule->value)) === 0);\n }\n });\n break;\n case 'date_added':\n $tracks = $tracks->filter(function ($track, $key) use ($rule) {\n if ($rule->comparison_operator == '=') {\n return $track->added_at->hour(0)->minute(0)->second(0)->eq(Carbon::parse($rule->value));\n } elseif ($rule->comparison_operator == '!=') {\n return $track->added_at->hour(0)->minute(0)->second(0)->ne(Carbon::parse($rule->value));\n } elseif ($rule->comparison_operator == '<') {\n return $track->added_at->hour(0)->minute(0)->second(0)->lt(Carbon::parse($rule->value));\n } elseif ($rule->comparison_operator == '>') {\n return $track->added_at->hour(0)->minute(0)->second(0)->gt(Carbon::parse($rule->value));\n }\n });\n break;\n case 'year':\n $tracks = $tracks->filter(function ($track, $key) use ($rule) {\n if ($rule->comparison_operator == '=') {\n return $track->album->released_at->format('Y') == $rule->value;\n } elseif ($rule->comparison_operator == '!=') {\n return $track->album->released_at->format('Y') != $rule->value;\n } elseif ($rule->comparison_operator == '<') {\n return $track->album->released_at->format('Y') < $rule->value;\n } elseif ($rule->comparison_operator == '>') {\n return $track->album->released_at->format('Y') > $rule->value;\n }\n });\n break;\n }\n }\n\n /*$tracks = $tracks->sortBy(function ($track, $key) {\n return $track->album->released_at->format('Y');\n });*/\n /*$tracks = $tracks->sortBy(function ($track, $key) {\n return sprintf('%-12s%s', $track->album->released_at->format('Y'), $track->album->name);\n });*/\n\n // Sort the playlist manually\n /*if ($this->order == 'album') {\n // Compare Album name\n $tracks = $tracks->sort(function ($a, $b) {\n return strcmp($a->album->name, $b->album->name);\n });\n } elseif ($this->order == 'year_asc') {\n $tracks = $tracks->sort(function ($first, $second) {\n // Track Years are the same so sort by Artist\n if (strcmp($first->album->released_at->format('Y'), $second->album->released_at->format('Y')) === 0) {\n return strcmp($first->artist, $second->artist);\n }\n\n // Track Years are the same so sort by Album\n // if (strcmp($first->album->released_at->format('Y'), $second->album->released_at->format('Y')) === 0) {\n // return strcmp($first->album->name, $second->album->name);\n // }\n\n // Compare Years\n return strcmp($first->album->released_at->format('Y'), $second->album->released_at->format('Y'));\n });\n } elseif ($this->order == 'year_desc') {\n $tracks = $tracks->sort(function ($first, $second) {\n // Track Years are the same so sort by Artist\n if (strcmp($first->album->released_at->format('Y'), $second->album->released_at->format('Y')) === 0) {\n return strcmp($first->artist, $second->artist);\n }\n\n // Compare Years 2nd then 1st to reverse\n return strcmp($second->album->released_at->format('Y'), $first->album->released_at->format('Y'));\n });\n }*/\n\n // Finally limit the playlist\n if ($this->limit) {\n $tracks = $tracks->take($this->limit);\n }\n\n return $tracks;\n }",
"function playlist()\n {\n // create client object with app credentials\n $client = new Services_Soundcloud('6adba59452a769c447fa24d030a99782', 'f2c4a2bb691a678ef69b724be8e7031a', 'http://final/index.php');\n \n // check if client was properly created \n if (!$client)\n {\n print(\"Server Error\");\n exit();\n }\n // inspired by http://stackoverflow.com/questions/11411076/sound-cloud-error\n try {\n // get access token for user\n $accessToken = $_SESSION['accessToken'];\n \n $userId = $_SESSION['soundCloudId'];\n $userName = $_SESSION['username'];\n \n // create array with users soundcloud song favorites\n $playlist = json_decode($client->get(\"users/{$userId}/favorites\"), true);\n\n } catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {\n var_dump($e->getMessage());\n exit();\n }\n \n return $playlist; \n }",
"public function __construct($playlist, $unique_playlist_id)\n {\n $this->playlist = $playlist;\n $this->unique_playlist_id = $unique_playlist_id;\n }",
"private function getcURLResponsePlaylist() {\n /**\n * proxy for Brightcove RESTful APIs\n * gets an access token, makes the request, and returns the response\n * Accessing:\n * (note you should *always* access the proxy via HTTPS)\n * Method: POST\n * request body (accessed via php://input) is a JSON object with the following properties\n *\n * {string} url - the URL for the API request\n * {string} [requestType=GET] - HTTP method for the request\n * {string} [requestBody] - JSON data to be sent with write requests\n * {string} [client_id] - OAuth2 client id with sufficient permissions for the request\n * {string} [client_secret] - OAuth2 client secret with sufficient permissions for the request\n *\n * if client_id, client_secret, or account_id are not included in the request, default values will be used\n *\n * @returns {string} $response - JSON response received from the API\n */\n\n /** \n security checks\n if you want to do some basic security checks, such as checking the origin of the\n the request against some white list, this is the place to do it\n CORS enablement and other headers\n \n header(\"Access-Control-Allow-Origin: *\");\n header(\"Content-type: application/json\");\n header(\"X-Content-Type-Options: nosniff\");\n header(\"X-XSS-Protection\");\n */\n /**\n default account values\n if you work on one Brightcove account, put in the values below\n if you do not provide defaults, the client id, and client secret must\n be sent in the request body for each request\n */\n $account_id = env('account_id');\n $client_id = env('cms_playlist_client_id');\n $client_secret = env('cms_playlist_client_secret');\n $request_url = env('cms_playlist_url').$account_id.'/playlists';\n\n $auth_string = \"{$client_id}:{$client_secret}\";\n $request_oauth = env('oauth_url').\"?grant_type=client_credentials\";\n $ch = curl_init($request_oauth);\n curl_setopt_array($ch, array(\n CURLOPT_POST => TRUE,\n CURLOPT_RETURNTRANSFER => TRUE,\n CURLOPT_SSL_VERIFYPEER => FALSE,\n CURLOPT_USERPWD => $auth_string,\n CURLOPT_HTTPHEADER => array(\n 'Content-type: application/x-www-form-urlencoded',\n ),\n ));\n\n $response = curl_exec($ch);\n curl_close($ch);\n\n // Check for errors\n if ($response === FALSE) {\n $message = \"Error: there was a problem with your Oauth API call\" + curl_error($ch);\n Log::debug($message);\n die();\n }\n\n // Decode the response\n $responseData = json_decode($response, TRUE);\n $access_token = $responseData[\"access_token\"];\n\n // get request type or default to GET\n $method = \"GET\";\n\n /**\n more security checks\n optional: you might want to check the URL for the API request here\n and make sure it is to an approved API\n and that there is no suspicious code appended to the URL\n\n get the URL and authorization info from the form data\n send the http request\n */\n \n $ch = curl_init($request_url);\n curl_setopt_array($ch, array(\n CURLOPT_CUSTOMREQUEST => $method,\n CURLOPT_RETURNTRANSFER => TRUE,\n CURLOPT_SSL_VERIFYPEER => FALSE,\n CURLOPT_HTTPHEADER => array(\n 'Content-type: application/json',\n \"Authorization: Bearer {$access_token}\",\n )\n ));\n $response = curl_exec($ch);\n curl_close($ch);\n\n /**\n Check for errors and log them if any\n note that logging will fail unless\n the file log.txt exists in the same\n directory as the proxy and is writable\n */\n if ($response === FALSE) {\n $message = \"Error: there was a problem with your CMS API call\" + curl_error($ch);\n Log::debug($message);\n die();\n }\n\n /**\n Decode the response\n $responseData = json_decode($response, TRUE);\n return the response to the AJAX caller\n TRUE will convert STD Object to assoc Array\n */\n $responseDecoded = json_decode($response, TRUE);\n if (!isset($responseDecoded)) {\n $response = '{null}';\n }\n\n return $responseDecoded;\n }",
"public function CreatePlaylist($usuario, $nombre_playlist)\r\n\t{\r\n\t\t$this->CheckToken();\r\n\r\n\t\t$respuesta = $this->api->createUserPlaylist($usuario, array(\r\n\t\t\t'name' => $nombre_playlist\r\n\t\t));\r\n\t\treturn $respuesta;\r\n\t}",
"public function executeNewPL(sfWebRequest $request) {\n $user = $this->getUser();\n if ($user->isAuthenticated()) {\n //creo el objeto y lo cargo\n $pl = new Playlist();\n $pl->setUserId($user->getGuardUser()->getId());\n $pl->setDescription($request->getParameter('obj'));\n $pl->setIsActive('1');\n //guardo el objeto\n $pl->save();\n $id = $pl->getId();\n $pl->setName('My playlist_' . $id);\n $pl->save();\n return sfView::NONE;\n }\n }",
"public function createPlaylist(string|array|object $userId, array|object $options = []): array|object\n {\n if (is_array($userId) || is_object($userId)) {\n trigger_error(\n 'Calling SpotifyWebAPI::createPlaylist() without a user ID is deprecated.',\n E_USER_DEPRECATED\n );\n\n $options = $userId;\n $uri = '/v1/me/playlists';\n } else {\n $userId = $this->uriToId($userId, 'user');\n $uri = '/v1/users/' . $userId . '/playlists';\n }\n\n $options = json_encode($options);\n\n $headers = [\n 'Content-Type' => 'application/json',\n ];\n\n $this->lastResponse = $this->sendRequest('POST', $uri, $options, $headers);\n\n return $this->lastResponse['body'];\n }",
"function randomTracks(Request $request) {\n\n\t\t$count = $request->input('count', 5);\n\n\t\t$maxOffset = 50;\n\t\t$tracks = [];\n\n\t\t// Get a track to find the number of tracks we currently have\n\t\t$res = $this->spotifyService->get('https://api.spotify.com/v1/me/tracks' . '?limit=1');\n\t\t$data = $res->getData();\n\n\t\t$totalTracks = $data['total'] - 1; // Minus 1 for index\n\n\t\t// Get random track numbers\n\t\t$trackNums = [];\n\t\tfor ($i=0; $i < $count; $i++) {\n\t\t\twhile(in_array($num = mt_rand(0, $totalTracks), $trackNums)){}\n\t\t\t$trackNums[] = $num;\n\t\t}\n\n\t\t// Sort track nums ascending\n\t\tsort($trackNums);\n\n\t\t// Split the requests into groups to make as few API calls as possible\n\t\t$trackRequests = [];\n\t\t$this->rangeGroup($trackNums, $maxOffset, $trackRequests);\n\n\t\t// Each track request contains a group of tracks that should fit into one request\n\t\tforeach ($trackRequests as $trackRequest) {\n\n\t\t\t// Offest is just the first track #\n\t\t\t$offset = $trackRequest[0]; \n\t\t\t// Limit is the range of the values in the request\n\t\t\t$limit = $trackRequest[count($trackRequest) - 1] - $trackRequest[0] + 1;\n\n\t\t\t// Do the request\n\t\t\t$res = $this->spotifyService->get(\"https://api.spotify.com/v1/me/tracks?offset=$offset&limit=$limit\");\n\t\t\t\n\t\t\tif ($res->getSuccess() == false) {\n\t\t\t\t// If we had a problem, resturn the access code\n\t\t\t\treturn response()->json(['success' => false, 'status_code' => $res->getStatusCode()]);\n\t\t\t} else {\n\t\t\t\t$data = $res->getData();\n\t\t\t\tforeach ($trackRequest as $trackIdx) {\n\t\t\t\t\t// Get the information from the track\n\t\t\t\t\t$trackInfo = $data['items'][$trackIdx - $offset]['track'];\n\t\t\t\t\t$track = [\n\t\t\t\t\t\t'name' => $trackInfo['name'],\n\t\t\t\t\t\t'url' => $trackInfo['external_urls']['spotify'],\n\t\t\t\t\t\t'album_name' => $trackInfo['album']['name'],\n\t\t\t\t\t\t'album_url' => $trackInfo['album']['external_urls']['spotify'],\n\t\t\t\t\t\t'artist_name' => $trackInfo['artists'][0]['name'],\n\t\t\t\t\t\t'artist_url' => $trackInfo['artists'][0]['external_urls']['spotify'],\n\t\t\t\t\t\t'preview_url' => $trackInfo['preview_url'],\n\t\t\t\t\t\t'spotify_id' => $trackInfo['id'],\n\t\t\t\t\t\t'spotify_uri' => $trackInfo['uri'],\n\t\t\t\t\t\t'album_img' => $trackInfo['album']['images'][2]['url'],\n\t\t\t\t\t];\n\t\t\t\t\t$tracks[] = $track;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn response()->json(['success' => true, 'data' => $tracks]);\n\t}",
"public function playlistsAction(){\n\t $request = $this->getRequest();\n\t $userId = $this->params()->fromRoute('id');\n\t $result = $this->translator->translate('There is not any Spotify account set yet');\n\t $serviceLocator = $this->getServiceLocator();\n\t $config = $serviceLocator->get('Config');\n\t try {\n\t $session = new \\SpotifyWebAPI\\Session($config['SpotifyClient']['client_id'], $config['SpotifyClient']['client_secret'], $config['SpotifyClient']['redirect_uri']);\n\t \n\t $spotify_user_id = $this->getServiceLocator()->get('SpotifyProfileService')->findByCodeAndUserId('user_id', $userId);\n\t $record = $this->getServiceLocator()->get('SpotifyProfileService')->findByCodeAndUserId('access_token', $userId);\n\t \n\t if($record){\n\t $api = new \\SpotifyWebAPI\\SpotifyWebAPI();\n\t \n\t $session->setRefreshToken($record->getValue());\n\t $session->refreshToken();\n\t \n\t $accessToken = $session->getAccessToken();\n\t \n\t // Set the new access token on the API wrapper\n\t $api->setAccessToken($accessToken);\n\t \n\t if($spotify_user_id){\n \t $playlists = $api->getUserPlaylists($spotify_user_id->getValue());\n \t \n \t $result = '<ul class=\"list-inline\">';\n \t if($playlists->items){\n \t foreach($playlists->items as $playlist){\n \t if($playlist->owner->id == $spotify_user_id->getValue()) {\n \t $result .= '<li><a target=\"_blank\" href=\"' . $playlist->external_urls->spotify . '\">'. $playlist->name .' <span title=\"' . $this->translator->translate('Tracks') .'\" class=\"badge badge-default\">' . $playlist->tracks->total .'</span></a></li>';\n \t }\n \t }\n \t }\n \t $result .= '</ul>';\n\t }\n\t }\n }catch (\\Exception $e){\n $result = $e->getMessage();\n }\n\t \n\t die($result);\n\t}",
"public function create($id)\n {\n /*validasi*/\n $validate = Validator::make(request()->all(), [\n 'song_id' => 'required|numeric',\n ]);\n\n $user=$this->songuser();\n $playlistsong = Playlist::where('user_id','=',$user->id)\n ->where('playlists.id','=',$id)\n ->first();\n\n #Kondisi ketika id tidak ada\n if ($playlistsong == null){\n throw new PbeNotAuthorizedException();\n\n #Kondisi jika validasi gagal\n }elseif ($validate->fails()){\n return $this->failResponse($validate->errors()->getMessages(), 400);\n }\n #Kondisi ketika tidak terjadi error\n $playlistsong = new Playlistsong();\n $playlistsong->song_id = request('song_id');\n $playlistsong->playlist_id = $id;\n $playlistsong->save();\n return $this->successResponse(['playlists' => $playlistsong], 201);\n }",
"private function create_player($playlist) {\n\t\t$tracks = '';\n\n\t\tforeach($playlist as $track) {\n\t\t\t$tracks .= '<li><a href=\"' . $track['url'] . '\">' . $track['title'] . '</a></li>' . \"\\n\";\n\t\t}\n\n\t\t$player = '<div class=\"jplayer-container\">\n\t\t\t<div id=\"jquery_jplayer_1\" class=\"jp-jplayer\"></div>\n\t\t\t<div class=\"jp_ui\" id=\"jp_interface_1\">\n <ul id=\"jp-controls\">\n <li><a href=\"#\" class=\"jp-play\" tabindex=\"1\"><img src=\"' . PLUGIN_URL . 'img/play.png\" alt=\"play\"></a></li>\n <li><a href=\"#\" class=\"jp-pause\" tabindex=\"1\"><img src=\"' . PLUGIN_URL . 'img/pause.png\" alt=\"play\"></a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"jp-previous\" tabindex=\"1\"><img src=\"' . PLUGIN_URL . 'img/previous.png\" alt=\"play\"></a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"jp-next\" tabindex=\"1\"><img src=\"' . PLUGIN_URL . 'img/next.png\" alt=\"play\"></a></li>\n </ul>\n\t <div class=\"jp-progress\">\n\t \t<div class=\"jp-seek-bar\">\n\t \t<div class=\"jp-play-bar\"></div>\n \t </div>\n \t </div>\n </div>\n <div id=\"jp_playlist_1\" class=\"jp-playlist\">\n <ul>' . $tracks . '</ul>\n </div>\n </div>';\n\n\t return $player;\n\t}",
"public function store(Request $request)\n {\n return response($this->playlistUnitService->store($request));\n }",
"function tracks() {\n\n\t\t$res = $this->spotifyService->get('https://api.spotify.com/v1/me/tracks');\n\t\t$data = $res->getData();\n\n\t\t$more = true;\n\t\t$uri = 'https://api.spotify.com/v1/me/tracks';\n\t\t$tracks = [];\n\n\t\twhile ($more) {\n\t\t\t$res = $this->spotifyService->get($uri);\n\t\t\t$data = $res->getData();\n\n\t\t\tforeach ($data['items'] as $item) {\n\t\t\t\t$track = $item['track'];\n\t\t\t\t$name = $track['name'];\n\t\t\t\t$trackUrl = $track['external_urls']['spotify'];\n\t\t\t\t$album = $track['album']['name'];\n\t\t\t\t$artist = $track['artists'][0]['name'];\n\n\t\t\t\t$tracks[] = $name;\n\t\t\t}\n\n\t\t\tif ($data['next'] == null) {\n\t\t\t\t$more = false;\n\t\t\t} else {\n\t\t\t\t$uri = $data['next'];\n\t\t\t}\n\t\t}\n\t\treturn response()->json(['success' => true, 'data' => $tracks]);\n\t}",
"protected function playlistPostStructureRequest($data = null)\n {\n\n $resourcePath = '/items/playlist/structure';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('api-key');\n if ($apiKey !== null) {\n $headers['api-key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function addSongToPlaylist($playlistId)\n {\n $this->validatePresentedData(['track', 'artist', 'album']);\n\n $track = $this->request->get('track');\n $artist = $this->request->get('artist');\n $album = $this->request->get('album');\n\n $songsModel = new SongsModel;\n $currentUserId = $this->user->getId();\n\n if ($songsModel->isSongInPlaylist($track, $artist, $album, $playlistId, $currentUserId)) {\n throw new BadRequestException('Song already in specified playlist!');\n }\n\n $songId = $songsModel->addSongToPlaylist($track, $artist, $album, $playlistId, $currentUserId);\n\n $responseData = [\n 'song' => [\n 'id' => $songId,\n 'track' => $track,\n 'artist' => $artist,\n 'album' => $album,\n 'playlistId' => $playlistId,\n 'userId' => $currentUserId\n ]\n ];\n\n $this->response->addHeader('201 Created')->send($responseData);\n }",
"public function setPlaylistId($playlist_id);",
"public function get_playlist() {\n\t\t$response = $this->send_request( 'GET', '/playlist' );\n\n\t\tif ( is_wp_error( $response ) ) {\n\t\t\t$this->handle_error( $response );\n\n\t\t\treturn [\n\t\t\t\t'series' => [],\n\t\t\t];\n\t\t}\n\n\t\treturn $response;\n\t}",
"public function actionCreate()\n\t{\n\t\t$model=new AdminFeaturePlaylistModel;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['AdminFeaturePlaylistModel']))\n\t\t{\n\t\t\t$model->attributes=$_POST['AdminFeaturePlaylistModel'];\n\t\t\tif($model->save())\n\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"function playlistItemsListByPlaylistId($youtube, $part, $maxResults, $playlistId) {\n $response = $youtube->playlistItems->listPlaylistItems(\n $part,\n array(\n 'maxResults' => $maxResults,\n 'playlistId' => $playlistId\n )\n );\n\n printResults($response);\n}"
] | [
"0.6585202",
"0.65553683",
"0.64808136",
"0.6343489",
"0.6257053",
"0.618825",
"0.6180563",
"0.61796355",
"0.61435974",
"0.61074936",
"0.60595185",
"0.5984885",
"0.5971926",
"0.5878864",
"0.5802031",
"0.5779584",
"0.5764034",
"0.5750712",
"0.5749219",
"0.5737912",
"0.5721174",
"0.570086",
"0.56906873",
"0.5681362",
"0.5616843",
"0.5614015",
"0.5597079",
"0.55921584",
"0.5514456",
"0.54840684"
] | 0.7457361 | 0 |
Helper function that takes in an array of SORTED numbers and groups numbers that are within the range given by $max. $groups should be given as the array to be filled | function rangeGroup($array, $max, &$groups) {
if ($groups == null)
$groups = [];
if (empty($array)) {
return;
}
if (count($array) == 1) {
// Last array, just add it to the splits
$groups[] = [$array[0]];
return;
}
if ($array[1] > $array[0] + $max) {
// If this number isn't in a group with the number above it, add it to the splits and move on
$groups[] = [$array[0]];
$this->rangeGroup(array_slice($array, 1), $max, $groups);
return;
}
$bestCount = 0;
for($i=0; $i<count($array); $i++) {
$count = 0; // How many numbers we can include
$current = $array[$i];
for($j=$i; $j<count($array); $j++) {
if ($array[$j] > ($current + $max)) {
// If it isn't in range, break out
break;
}
// If it is in the range, incease the count, and save this top idx
$count++;
}
if($count < $bestCount) {
// We've had a better grouping before, so use it
$bestIdx = $i - 1;
$adding = array_slice($array, $bestIdx, $bestCount);
$below = array_slice($array, 0, $bestIdx);
$above = array_slice($array, $bestIdx + $bestCount);
// Add to the current splits
$groups[] = $adding;
// Add the ranges for the numbers above and below
$this->rangeGroup($above, $max, $groups);
$this->rangeGroup($below, $max, $groups);
return;
}
// This is the best count we've had so far, so store it
$bestCount = $count;
$bestIdx = $i;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function MissingNumericRange($actual_ranges, $min_range, $max_range)\n{\n $array_return = array();\n $r_count = 0;\n $r_len = count($actual_ranges);\n $first_max = 0;\n if ($r_len != 0) {\n foreach ($actual_ranges as $key => $range) {\n $ext = false;\n if ($r_count == 0) {\n $ext = true;\n if ($range[\"min\"] > $min_range) {\n array_push($array_return, array(\"id\" => 0, \"min\" => $min_range, \"max\" => ($range[\"min\"] - 1)));\n $first_max = $range[\"max\"];\n } else {\n $first_max = $range[\"max\"];\n }\n }\n if ($r_count == $r_len - 1) {\n $ext = true;\n if ($range[\"max\"] < $max_range) {\n array_push($array_return, array(\"id\" => 0, \"min\" => ($range[\"max\"] + 1), \"max\" => $max_range));\n }\n\n\n $first_max = $first_max + 1;\n if ($first_max >= $range[\"min\"]) {\n $first_max = $range[\"max\"];\n } else {\n array_push($array_return, array(\"id\" => 0, \"min\" => $first_max, \"max\" => ($range[\"min\"] - 1)));\n $first_max = $range[\"max\"];\n }\n\n }\n if (!$ext) {\n $first_max = $first_max + 1;\n if ($first_max == $range[\"min\"]) {\n $first_max = $range[\"max\"];\n } else {\n array_push($array_return, array(\"id\" => 0, \"min\" => $first_max, \"max\" => ($range[\"min\"] - 1)));\n $first_max = $range[\"max\"];\n }\n }\n $r_count++;\n }\n } else {\n array_push($array_return, array(\"id\" => 0, \"min\" => $min_range, \"max\" => $max_range));\n }\n array_multisort(array_column($array_return, 'min'), SORT_ASC, $array_return);\n return $array_return;\n}",
"private function closestGroups($input){\n\n if(empty($input['inputArray']) || empty($input['inputGroups'])) return false;\n $inputArray = explode(',', $input['inputArray']);\n $inputGroups = $input['inputGroups'];\n $outputArray = array();\n\n // Check if values are numeric\n foreach($inputArray as $inputArrayElem) if(!is_numeric($inputArrayElem)) return false;\n if(!is_numeric($inputGroups)) return false;\n // Check that number of groups is not greater than number of elements in an input array\n if($inputGroups>count($inputArray)) return false;\n\n // Create desired number of groups\n for($i=0; $i<$inputGroups; $i++) $outputArray[] = array();\n // Sort input array descending\n rsort($inputArray);\n // Take each element from input array and go through groups\n foreach ($inputArray as $inputArrayElem) {\n // Find group with lowest sum\n $lowestSum = array_sum($outputArray[0]);\n $lowestSumKey = 0;\n foreach($outputArray as $key => $outputArrayElem){\n $outputArrayElemSum = array_sum($outputArrayElem);\n if($outputArrayElemSum<$lowestSum){\n $lowestSum = $outputArrayElemSum;\n $lowestSumKey = $key;\n }\n }\n // Add input element to group with lowest sum\n $outputArray[$lowestSumKey][] = $inputArrayElem;\n }\n\n // Create output array\n $result = array();\n foreach ($outputArray as $outputArrayElem) {\n // Show all elements in group and their sum\n $outputArrayElemImploded = implode(',', $outputArrayElem);\n $outputArrayElemFinal = $outputArrayElemImploded . ' = ' . array_sum($outputArrayElem);\n $result['result'][] = $outputArrayElemFinal;\n }\n\n// var_dump($outputArray);\n $result['inputArray'] = $input['inputArray'];\n $result['inputGroups'] = $input['inputGroups'];\n return $result;\n\n }",
"function get_numbers($numbers, $min, $max) {\r\n\r\n $sorted_list = array();\r\n\r\n foreach ($numbers as $num) {\r\n // if $num is within range, add to $sorted_list\r\n if ($num >= $min && $num <= $max) {\r\n $sorted_list[] = $num;\r\n }\r\n }\r\n return $sorted_list;\r\n }",
"public function member_group_query($groups, $max = null, $start = 0)\n {\n $_groups = '';\n foreach ($groups as $group) {\n if ($_groups != '') {\n $_groups .= ' OR ';\n }\n $_groups .= 'groupid=' . strval($group);\n }\n return $this->connection->query('SELECT * FROM ' . $this->connection->get_table_prefix() . 'user2groups g LEFT JOIN ' . $this->connection->get_table_prefix() . 'users u ON g.userid=u.userid WHERE ' . $_groups . ' ORDER BY groupid ASC', $max, $start, false, true);\n }",
"public function member_group_query($groups, $max = null, $start = 0) // Doesn't support multi usergroups currently. I don't think it's needed\n {\n $_groups = '';\n foreach ($groups as $group) {\n if ($_groups != '') {\n $_groups .= ' OR ';\n }\n $_groups .= 'ID_GROUP=' . strval($group);\n }\n return $this->connection->query('SELECT * FROM ' . $this->connection->get_table_prefix() . 'members WHERE ' . $_groups . ' ORDER BY ID_GROUP,ID_MEMBER ASC', $max, $start);\n }",
"function gn1(array $list, int $min = 0): array {\n $size = count($list);\n $opts = [];\n $uniq = [];\n $dmax = 0;\n $best = ['rank' => 0, 'grps' => [$list]];\n\n for ($prev = $list[0], $i = 1; $i < $size; ++$i) {\n $dist = $list[$i] - $prev;\n $prev = $list[$i];\n if ($dist > $min && !in_array($dist, $uniq))\n $uniq[] = $dist;\n if ($dmax < $dist)\n $dmax = $dist;\n }\n\n $list[] = $list[$size - 1] + $dmax + 1;\n\n foreach ($uniq as $maxd) {\n $opt = [\n 'dist' => $maxd,\n 'grps' => [],\n 'gdis' => [],\n 'edis' => [],\n 'enum' => [],\n 'rank' => 0,\n ];\n $gnum = 0;\n\n for (\n $temp = [$prev = $list[0]],\n $ante = null,\n $enum = 1,\n $sdis = 0,\n $i = 1; $i <= $size; ++$i) {\n $dist = $list[$i] - $prev;\n $prev = $list[$i];\n if ($dist <= $maxd) {\n $temp[] = $list[$i];\n $sdis += $dist;\n ++$enum;\n }\n else {\n $opt['grps'][] = $temp;\n $opt['edis'][] = $enum == 1 ? 0 : $sdis / ($enum - 1);\n $opt['enum'][] = $enum;\n if ($ante)\n $opt['gdis'][] = $temp[0] - $ante[count($ante) - 1];\n ++$gnum;\n $ante = $temp;\n $temp = [$list[$i]];\n $enum = 1;\n $sdis = 0;\n }\n }\n\n if ($gnum > 1) {\n if ($gnum == 2)\n array_unshift($opt['gdis'], 0);\n\n //$gdmx = max($opt['gdis']);\n $gdmx = array_sum($opt['gdis']) / count($opt['gdis']);\n //$edmx = max($opt['edis']);\n $edmx = array_sum($opt['edis']) / $gnum;\n $enmx = max($opt['enum']);\n\n $opt['rank'] =\n // distance between groups\n (array_reduce($opt['gdis'], function($sum, $val) use($gdmx) {\n return $sum + min($val, $gdmx) / max($val, $gdmx);\n }, 0) / count($opt['gdis'])) +\n // distance between elements in group\n (array_reduce($opt['edis'], function($sum, $val) use($edmx) {\n return $sum + min($val, $edmx) / max($val, $edmx);\n }, 0) / $gnum) +\n // equality number of elements\n (array_reduce($opt['enum'], function($sum, $val) use($enmx) {\n return $sum + $val / $enmx;\n }, 0) / $gnum);\n\n if ($best['rank'] < $opt['rank'])\n $best = $opt;\n }\n }\n\n return $best['grps'];\n}",
"function checkDuplicate($index, $key) {\n global $tableau, $groupNum, $MAXVALUE, $MINVALUE;\n $numbers = array();\n echo '[checkDuplicate] Je teste la case ' .$index.PHP_EOL;\n if($tableau['check'][$index] == true) return null;\n $tableau['check'][$index] = true;\n if($tableau['value'][$index] == 1)\n {\n echo '[checkDuplicate] La case '. $index. ' est un 1, je l`\\'ajoute au tableau '.$key.PHP_EOL;\n $groupNum[$key][] = $index;\n if($index+5 < $MAXVALUE)\n {\n echo '[checkDuplicate] Je teste la case ' .($index+5). 'via la case '.$index.PHP_EOL;\n $numbers = checkDuplicate($index+5, $key);\n if($numbers !== null) $groupNum[$key][] = $numbers;\n }\n if(!in_array($index, array(4, 9, 14, 19, 24)))\n {\n echo '[checkDuplicate] Je teste la case ' .($index+1). 'via la case '.$index.PHP_EOL;\n $numbers = checkDuplicate($index+1, $key);\n if($numbers !== null) $groupNum[$key][] = $numbers;\n }\n if(!in_array($index, array(0, 5, 10, 15, 20)))\n {\n echo '[checkDuplicate] Je teste la case ' .($index-1). 'via la case '.$index.PHP_EOL;\n $numbers = checkDuplicate($index-1, $key);\n if($numbers !== null) $groupNum[$key][] = $numbers;\n }\n if($index-5 > $MINVALUE)\n {\n echo '[checkDuplicate] Je teste la case ' .($index-5). 'via la case '.$index.PHP_EOL;\n $numbers = checkDuplicate($index-5, $key);\n if($numbers !== null) $groupNum[$key][] = $numbers;\n }\n }\n else return null;\n return $numbers;\n}",
"function setGroups(array $groups);",
"abstract protected function _buildGroupBy( $group );",
"function limited_array($array=array(),$begin,$max) {\n $array_exp = array();\n $range=range($begin=($begin-1), ($begin+$max-1));\n foreach($array as $key => $wert) {\n if(array_var_exists($key, $range))\n $array_exp[$key] = $wert;\n }\n\n return $array_exp;\n}",
"private function getTeamsByGroups($teamsList)\n {\n $groupedTeams = array(\n 'Group A' => array(),\n 'Group B' => array(),\n 'Group C' => array(),\n 'Group D' => array(),\n 'Group E' => array(),\n 'Group F' => array(),\n 'Group G' => array(),\n 'Group H' => array()\n );\n\n $moreThan8SameCountries = false;\n $countriesArray = array();\n foreach ($teamsList as $team){\n $country = $team['country'];\n if(array_key_exists($country,$countriesArray)){\n $countriesArray[$country] +=1;\n }else{\n $countriesArray[$country] =1;\n }\n }\n foreach ($countriesArray as $value){\n if($value > 8){\n $moreThan8SameCountries = true;\n }\n }\n //some sanitary checks\n if(count($teamsList) != 32 || count($groupedTeams) !=8 || $moreThan8SameCountries == true){\n echo \"Mismatched gropus and team count or more than 8 similar countries\";die;\n }\n $domesticChampions = array();\n foreach ($teamsList as $key=>$team) {\n if($team['domestic_champ']){\n array_push($domesticChampions,$team);\n unset($teamsList[$key]);\n }\n }\n //some sanitary checks ...if domestic champs are not 8 , grouping is not possible\n if(count($domesticChampions) !=8){\n echo \"domestic champs are not 8 , grouping is not possible\";die;\n }\n\n $count = 1;\n while(!empty($teamsList)){\n //iterate through each group and add a team to it\n foreach ($groupedTeams as &$group){\n if(!empty($teamsList)){\n $addAndGoToNext = true;\n //generate random team from teams list\n $randomKey = array_rand($teamsList);\n $randomTeam = $teamsList[$randomKey];\n if(!empty($group)){\n foreach ($group as $includedTeams){\n if(count($group) == 4 ){\n $addAndGoToNext = false;\n }\n if($randomTeam['country'] == $includedTeams['country']){\n $addAndGoToNext = false;\n }\n }\n }else{\n //first team in any group is champion team\n $randomChampionTeamKey = array_rand($domesticChampions);\n $randomChampTeam = $domesticChampions[$randomChampionTeamKey];\n array_push($group,$randomChampTeam);\n unset($domesticChampions[$randomChampionTeamKey]);\n //we dont want to insert any team further , since all checks are above\n $addAndGoToNext = false;\n }\n //if all if fine add team to group\n if($addAndGoToNext){\n array_push($group,$randomTeam);\n unset($teamsList[$randomKey]);\n }\n }\n }\n $count++;\n //no random group could be generated retry.\n if($count>8){\n return array();\n }\n }\n return $groupedTeams;\n }",
"public function genererListeYear2($min, $max){\n\n\t\t$listNb = array(); \n\t\tfor($i=$min;$i <= $max;$i++) { \n\t\t\t$listNb[$i] = $i;\n\t\t}\n\t\treturn $listNb;\n\t}",
"public static function make_groups($array, $size)\n {\n $i = 0;\n $groups = array();\n while ($i < count($array))\n {\n $groups[] = array_slice($array, $i, $size);\n $i += $size;\n }\n return $groups;\n }",
"private function get_representative_groups(){\n\t\t$americas_groups = $this->groups_by_box(array(-150, 60, -30, -50), 4);\n\t\t$european_groups = $this->groups_by_box(array(-5, 70, 50, 30), 1);\n\t\t$african_groups = $this->groups_by_box(array(-15, 25, 60, -40), 1);\n\t\t$asian_groups = $this->groups_by_box(array(60, 90, 170, -60), 2);\t\t\t\n\n\t\treturn array_merge($european_groups, $americas_groups, $african_groups, $asian_groups);\t\n\t}",
"function breakingRecords(array $scores): array\n{\n $min = $max = $scores[0];\n $sumHigh = $sumLow = 0;\n\n for($i = 1, $len = count($scores); $i < $len; $i++) {\n if ($scores[$i] > $max) {\n $max = $scores[$i];\n ++$sumHigh;\n }\n if ($scores[$i] < $min) {\n $min = $scores[$i];\n ++$sumLow;\n }\n }\n\n return [$sumHigh, $sumLow];\n}",
"public function splitTeams(Group ...$groups) : Round {\n\t\tif (count($groups) === 0) {\n\t\t\t$groups = $this->getGroups();\n\t\t}\n\n\t\t$teams = $this->getTeams(true, Constants::SEED);\n\t\tif ($this::isSeeded($teams)) {\n\t\t\tFunctions::sortAlternate($teams);\n\t\t}\n\t\telse {\n\t\t\tshuffle($teams);\n\t\t}\n\n\t\t$split = ceil(count($teams) / count($groups));\n\t\tforeach ($groups as $where) {\n\t\t\tif (count($teams) > 0) {\n\t\t\t\t$where->addTeam(...array_splice($teams, 0, $split));\n\t\t\t}\n\t\t}\n\t\treturn $this;\n\t}",
"function get_max_and_min($array){\n\t$max = $array[0];\n\t$min = $array[0];\n \n\tfor($i = 0; $i < count($array); $i++) {\n\t\tif($array[$i]>$max)\n\t\t{\n\t\t\t$max = $array[$i];\n\t\t}\n\t\telseif($array[$i] < $min)\n\t\t{\n\t\t\t$min = $array[$i];\n\t\t}\n\t}\n\t$new_array = array(\"max\" => $max, \"min\" => $min);\n\tvar_dump($new_array);\n}",
"public function genererListeSaison($min, $max){\n\n\t\t$listNb = array(); \n\t\tfor($i=$min;$i <= $max;$i++) { \n\t\t\t$listNb[$i] = ($i-1).'/'.$i;\n\t\t}\n\t\treturn $listNb;\n\t}",
"public function reverseTransform($groups)\n {\n $value = new ArrayCollection();\n if (is_array($groups) && array_key_exists('groups_collection', $groups)) {\n $groups = $groups['groups_collection'];\n foreach ($groups as $groupId => $group) {\n if (array_key_exists('group', $group) && $group['group']) {\n $group = $this->groupRepository->find($groupId);\n if (null !== $group && in_array($group->getSite()->getId(), $this->availableSiteIds)) {\n $value->add($group);\n }\n }\n }\n }\n\n return $value;\n }",
"function get_groups(){\r\n\t$grps = Group::getListByUserId($_SESSION['personId']);\r\n\t$a = sizeof($grps);\r\n\t settype($a, \"integer\");\r\n\t $html1 ='';\r\n\t $html2 ='';\r\n\t for($i=0;$i<$a/2;$i++){\r\n\t $img= $grps[$i]['icon_link'];\r\n\t $id= $grps[$i]['id'];\r\n\t \r\n\t $html1.= '<a href=\"backend/main.php?id='.urlencode($id).'&action=viewGroup\" class=\"detail\">';\r\n\t $html1.= '<img class=\"pics\" src=\"'.$img.'\" /></a>';\r\n\t\r\n\t }\r\n\t $b=($a/2)+1;\r\n\t for($i=$b;$i<$a;$i++){\r\n\t $img= $grps[$i]['icon_link'];\r\n\t $id= $grps[$i]['id'];\r\n\t \r\n\t $html2.= '<a href=\"backend/main.php?id='.urlencode($id).'&action=viewGroup\" class=\"detail\">';\r\n\t $html2.= '<img class=\"pics\" src=\"'.$img.'\" /></a>';\r\n\t }\r\n\t $a= array();\r\n\t $a[0]= $html1; $a[1]= $html2;\r\n\t return $a;\r\n\t }",
"function OverLapFunction($time) {\n $groups = array(); // groups have starting time, ending\n // time and items they contain\n foreach ($time as $item) {\n // if we don't find a group to put this item in, we create a new one\n $found = false;\n foreach ($groups as $group) {\n // basically the whole if statement looks for overlapping between\n // the group and the current item\n if (($item[1] >= $group[1] && $item[1] <= $group[2]) ||\n ($item[2] >= $group[1] && $item[2] <= $group[2]))\n $group['items'][] = $item; // add the item to its group\n $found = true;\n break;\n }\n if (!$found) { // no group that fits this item; create a new one\n $groups[] = array(\n 'start_time' => $item[1], // start and end times\n 'end_time' => $item[2], // are the item's\n 'items' => array($item),\n );\n }\n }\n return $groups;\n}",
"public function setGroupNGroups($value) {}",
"function forceGroupAssignment($unassignedStudents, $emptyGroups)\n {\n $numStudents = count($unassignedStudents);\n if ($numStudents > count($emptyGroups)*$this->max_places)\n {\n throw new Exception(\n 'Number of unassigned students is higher than the number of free places in empty groups');\n }\n\n /* We have enough places, duplicate the list of empty groups at most `max_places` times to accommodate the\n given number of unassigned students. */\n $groupList = $emptyGroups;\n while (count($groupList) < $numStudents)\n {\n $groupList = array_merge($groupList, $emptyGroups);\n }\n\n $i = 0;\n $forced_groups = array();\n while ($i < $numStudents)\n {\n $student = $unassignedStudents[$i];\n $group = $groupList[$i];\n $group_id = $group['id'];\n if (!array_key_exists($group_id, $forced_groups))\n $forced_groups[$group_id] = array( 'group' => $group, 'students' => array());\n $forced_groups[$group_id]['students'][] = $student;\n $this->dumpVar('setting student to group', array($student, $group));\n // $this->setGroupIdForStudent($student['id'], $group_id, true);\n $i++;\n }\n\n $this->dumpVar('forced groups', $forced_groups);\n return $forced_groups;\n }",
"function recalcDupScores($final_groups)\r\n\t{\r\n\t\tforeach ($final_groups as $key => $group)\r\n\t\t{\r\n\t\t\t$base_record = new RecordObject($group['pid']);\r\n\t\t\tforeach ($group['list'] as $dup_pid => $dup_item) {\r\n\t\t\t\tif ($dup_item['isi_loc'] == $group['isi_loc']) {\r\n\t\t\t\t\t$final_groups[$key]['list'][$dup_pid]['probability'] = 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$dup_record = new RecordObject($dup_item['pid']);\r\n\t\t\t\t\t$final_groups[$key]['list'][$dup_pid]['probability']\r\n\t\t\t\t\t= $this->compareRecords($base_record, $dup_record);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $final_groups;\r\n\t}",
"function groupByNbPerson($listPeople, $nbPerson){\n $allGroup = array();\n $listPeople = shuffleAssoc($listPeople);\n\n $j = 0;\n $i = 0;\n foreach ($listPeople as $person) {\n if($j >= $nbPerson){\n $j = 0;\n $i++;\n }\n $allGroup[$i][$j] = $person;\n $j++;\n }\n return $allGroup;\n}",
"public function groups();",
"function gradingStudents(array $grades): array\n{\n\n return array_map(function ($grade) {\n $multiple = $grade + (5 - $grade % 5);\n return $grade >= 38 && $multiple - $grade < 3 ? $multiple : $grade;\n }, $grades);\n}",
"public function genererListeYear($min, $max){\n\n\t\t$listNb = array(); \n\t\tfor($i=$min;$i <= $max;$i++) { \n\t\t\t$listNb[$i] = $i;\n\t\t}\n\t\treturn $listNb;\n\t}",
"protected function DP_getSampleUsersToCoursegroups($count_users, $count_coursegroups, $ident_num_start, $with_fallback = true) {\r\n\r\n $users_and_coursegroups = array(); //endresultat: array('default' => array('users' => null, 'coursegroups' => null), 'fallback' => array('users' => null, 'coursegroups' => null));\r\n\r\n //get values from other providers\r\n $users = $this->DP_getSampleStudents($count_users, $ident_num_start, $with_fallback);\r\n $coursegroups = $this->DP_getSampleCoursegroups($count_coursegroups, $ident_num_start, $with_fallback);\r\n\r\n //assign to our array\r\n foreach ($users as $u) {\r\n $users_and_coursegroups[$u['type']]['users'][] = $u;\r\n }\r\n foreach ($coursegroups as $cg) {\r\n $users_and_coursegroups[$u['type']]['coursegroups'][] = $cg;\r\n }\r\n\r\n $unique = _okl_testing_get_dataprovider_identifier() . '_userstogroups_' . $ident_num_start;\r\n $randomizer = \\RealisticFaker\\OklDataCreator::get($unique);\r\n\r\n $sample = array();\r\n $users_per_group = max(1, floor($count_users / $count_coursegroups));\r\n foreach ($users_and_coursegroups as $type => $values) {\r\n foreach ($values['coursegroups'] as $cg) {\r\n $sample[] = array('coursegroup_title' => $cg['title'], 'users' => array(), 'type' => $type);\r\n }\r\n foreach ($values['users'] as $u) {\r\n $random_key = $randomizer->randomKey($sample);\r\n $sample[$random_key]['users'][] = array('name' => $u['name'], 'mail' => $u['mail']);\r\n }\r\n }\r\n\r\n\r\n return $sample;\r\n }",
"protected function _fill_number($max)\n {\n return range(1, $max);\n }"
] | [
"0.6003045",
"0.58239734",
"0.57714623",
"0.56696206",
"0.54500604",
"0.5375255",
"0.51295054",
"0.50859314",
"0.5066292",
"0.4995679",
"0.49248087",
"0.48823872",
"0.48518875",
"0.4846177",
"0.48360977",
"0.4833463",
"0.48085743",
"0.48077577",
"0.47934124",
"0.47924128",
"0.47897843",
"0.47783285",
"0.4768024",
"0.4758381",
"0.47516412",
"0.4735698",
"0.47181433",
"0.47147286",
"0.4695846",
"0.46869257"
] | 0.83507776 | 0 |
Test the setting of the $timezone static property from null to a value and back to null | public function testSetTimezoneMethod()
{
$timezone = 'America/New_York';
$this->assertEquals(null, Customer::$timezone);
Customer::setTimezone($timezone);
$this->assertEquals($timezone, Customer::$timezone);
Customer::setTimezone();
$this->assertEquals(null, Customer::$timezone);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testTimezoneStaticPropertyFromBaseModel()\n {\n $zone = 'America/New_York';\n\n Customer::$timezone = $zone;\n\n $timezone = (new User)->getTimezone();\n\n $this->assertEquals($zone, $timezone);\n\n Customer::setTimezone();\n }",
"public function testTimezoneStaticPropertyFromNewModel()\n {\n Customer::$timezone = 'America/New_York';\n\n $class = new class extends \\Illuminate\\Database\\Eloquent\\Model {\n use \\Luminary\\Services\\Timezone\\TimezoneModelTrait;\n };\n\n $timezone = (new $class)->getTimezone();\n\n $this->assertEquals(null, $timezone);\n\n Customer::setTimezone();\n }",
"public function getTimezone(): string|null;",
"public function testSameTimeZone(){\n $date = new \\DateTime();\n $boolean = DateTimeValidator::timeZone($date, 'UTC');\n $this->assertTrue($boolean);\n }",
"public function testNotSameTimeZone(){\n $date = new \\DateTime();\n $boolean = DateTimeValidator::timeZone($date, 'Asia/Tokyo');\n $this->assertFalse($boolean);\n }",
"public function testTimezoneTrait()\n {\n Customer::setTimezone('UTC');\n\n $zone = 'America/New_York';\n $result = Customer::first();\n\n $before = $result->created_at;\n\n Customer::setTimezone($zone);\n\n $after = $result->created_at;\n\n $time = time();\n $transitions = (new DateTimeZone($zone))->getTransitions($time, $time);\n $offset = $transitions[0]['offset'];\n\n $this->assertEquals('UTC', $before->timezoneName);\n $this->assertEquals($zone, $after->timezoneName);\n $this->assertEquals($offset, $after->offset);\n\n // Reset the timezone\n Customer::setTimezone();\n }",
"public function setTimezone($value);",
"public function getDefaultTimezone(): string|null;",
"public static function set_timezone(string $timezone) { self::$timezone = $timezone; }",
"public function testProperty()\n {\n $model = new ModelInstance();\n\n self::assertNull($model->dateTimezoneTest);\n\n $model->dateTimezoneTest = 'America/Chicago';\n self::assertEquals(\n 'America/Chicago',\n $model->dateTimezoneTest->getName()\n );\n\n $model->dateTimezoneTest = 'America/New_York';\n self::assertEquals(\n 'America/New_York',\n $model->dateTimezoneTest->getName()\n );\n\n $model->dateTimezoneTest = 'asdf';\n self::assertNull($model->dateTimezoneTest);\n }",
"public function testDefaultTimezone()\n {\n $this->assertSame('UTC', Data_Reader::$default_timezone);\n }",
"public static function setTimeZone($timezone)\n {\n self::$timezone = $timezone ?: self::$timezone;\n }",
"public function setTimezone($timezone = null)\r\n\t{\r\n\t\treturn $this->setTimezone($timezone === null ? self::$utc : is_string($timezone) ? ($timezone === 'UTC' ? self::$utc : new \\DateTimeZone($timezone)) : ($timezone instanceof \\DateTimeZone ? $timezone : $timezone->getTimezone()));\r\n\t}",
"protected function setTimezone()\n {\n $setter = new TimezoneSetter();\n $setter->register();\n }",
"public function hasTimeZone()\n {\n return $this->get(self::TIMEZONE) !== null;\n }",
"public function _timeZoneSet()\n {\n $timeZone = $this->config->item('timeZone');\n if ($timeZone== '') {\n $timeZone=\"Europe/Dublin\";\n }\n date_default_timezone_set($timeZone);\n }",
"public static function timezone($timezone)\n\t{\n\t\tif ($timezone === NULL)\n\t\t{\n\t\t\t// Disable notices when using date_default_timezone_get\n\t\t\t$ER = error_reporting(~E_NOTICE);\n\n\t\t\t$timezone = date_default_timezone_get();\n\n\t\t\t// Restore error reporting\n\t\t\terror_reporting($ER);\n\t\t}\n\n\t\tif (date_default_timezone_set($timezone) === TRUE)\n\t\t{\n\t\t\t// Set the system timezone\n\t\t\tself::$timezone = $timezone;\n\t\t}\n\t}",
"public function setTimezone($timezone): self;",
"public function testNullDateTime() {\n $this->assertSame(Structr::ize(null)\n ->isDateTime()\n ->run(), null);\n }",
"public static function getTimezoneLocalInternal() /*: ?\\DateTimeZone*/\n {\n if (!static::$timezoneLocal) {\n return null;\n }\n return clone static::$timezoneLocal;\n }",
"public static function setUserTimezone(\\DateTimeZone $timezone = null)\n {\n self::$localTimezone = $timezone;\n }",
"public function hasTimezone(): bool;",
"protected function _initTimeZone()\n\t{\n\t\tif (isset($this->_config['configuration']['timezone'])) {\n\t\t\tdate_default_timezone_set($this->_config['configuration']['timezone']);\n\t\t}\n\t}",
"public function testGetDefaultTimezone() {\n $ic = new ICalTimezoneGenerator();\n $this->assertAttributeEquals($ic->getTimestampFormat(),\n 'timestampFormat',\n $ic);\n }",
"public function testGetSetTimezone() {\n $ic = new ICalTimezoneGenerator();\n $timestamp = 'Y-m-D H:i:s';\n $ic->setTimestampFormat($timestamp);\n $this->assertEquals($timestamp, $ic->getTimestampFormat());\n }",
"public function isTimezone($val, $default = null) {\n\t\t$val = $this->field($val, $default);\n\t\treturn (bool) preg_match(\"/^[-+]((0[0-9]|1[0-3]):([03]0|45)|14:00)$/\", $val);\n\t}",
"private static function setTimeZone() {\n\t date_default_timezone_set('UTC');\n\t}",
"public function testGetTimezoneReturnsIni()\n {\n ini_set('date.timezone', 'Pacific/Galapagos');\n $this->assertEquals('Pacific/Galapagos', TimezoneUtil::getTimezone());\n }",
"function set_timezone($timezone)\n{\n date_default_timezone_set($timezone);\n}",
"function is_timezone_problem()\n{\n\t// check if date is loaded and DateTimeZone class exists (this should be true since 5.2.0)\n\tif( extension_loaded('date') && class_exists('DateTimeZone') )\n\t{\n\t\t$error_message = 'Invalid or empty date.timezone setting detected.';\n\t\t$status = improvedIniGet('date.timezone');\n\n\t\tif( !empty($status) )\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$tz = new DateTimeZone($status);\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\t// timezone is invalid\n\t\t\t\treturn $error_message;\n\t\t\t}\n\n\t\t\t// timezone is set and working\n\t\t\treturn null;\n\t\t}\n\n\t\t// timezone is empty\n\t\treturn $error_message;\n\t}\n\n\t// extension isn't loaded so we don't check\n\treturn null;\n}"
] | [
"0.6899886",
"0.66361135",
"0.6584228",
"0.65245646",
"0.6510604",
"0.6476173",
"0.6441086",
"0.6401208",
"0.62532574",
"0.62196547",
"0.61839",
"0.61688745",
"0.61675525",
"0.60648525",
"0.60534143",
"0.6013309",
"0.6000287",
"0.59957474",
"0.5987386",
"0.59780097",
"0.5977538",
"0.5967109",
"0.59533983",
"0.59303117",
"0.5843599",
"0.577053",
"0.57583195",
"0.5736925",
"0.5703257",
"0.5690378"
] | 0.72975826 | 0 |
Test Timezone Trait isn't affected by other models when trait property is inherited from the class itself | public function testTimezoneStaticPropertyFromNewModel()
{
Customer::$timezone = 'America/New_York';
$class = new class extends \Illuminate\Database\Eloquent\Model {
use \Luminary\Services\Timezone\TimezoneModelTrait;
};
$timezone = (new $class)->getTimezone();
$this->assertEquals(null, $timezone);
Customer::setTimezone();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testTimezoneStaticPropertyFromBaseModel()\n {\n $zone = 'America/New_York';\n\n Customer::$timezone = $zone;\n\n $timezone = (new User)->getTimezone();\n\n $this->assertEquals($zone, $timezone);\n\n Customer::setTimezone();\n }",
"public function testTimezoneTrait()\n {\n Customer::setTimezone('UTC');\n\n $zone = 'America/New_York';\n $result = Customer::first();\n\n $before = $result->created_at;\n\n Customer::setTimezone($zone);\n\n $after = $result->created_at;\n\n $time = time();\n $transitions = (new DateTimeZone($zone))->getTransitions($time, $time);\n $offset = $transitions[0]['offset'];\n\n $this->assertEquals('UTC', $before->timezoneName);\n $this->assertEquals($zone, $after->timezoneName);\n $this->assertEquals($offset, $after->offset);\n\n // Reset the timezone\n Customer::setTimezone();\n }",
"public function testProperty()\n {\n $model = new ModelInstance();\n\n self::assertNull($model->dateTimezoneTest);\n\n $model->dateTimezoneTest = 'America/Chicago';\n self::assertEquals(\n 'America/Chicago',\n $model->dateTimezoneTest->getName()\n );\n\n $model->dateTimezoneTest = 'America/New_York';\n self::assertEquals(\n 'America/New_York',\n $model->dateTimezoneTest->getName()\n );\n\n $model->dateTimezoneTest = 'asdf';\n self::assertNull($model->dateTimezoneTest);\n }",
"public function testSetTimezoneMethod()\n {\n $timezone = 'America/New_York';\n\n $this->assertEquals(null, Customer::$timezone);\n\n Customer::setTimezone($timezone);\n\n $this->assertEquals($timezone, Customer::$timezone);\n\n Customer::setTimezone();\n\n $this->assertEquals(null, Customer::$timezone);\n }",
"public function setTimezone($value);",
"public function testSameTimeZone(){\n $date = new \\DateTime();\n $boolean = DateTimeValidator::timeZone($date, 'UTC');\n $this->assertTrue($boolean);\n }",
"public function testNotSameTimeZone(){\n $date = new \\DateTime();\n $boolean = DateTimeValidator::timeZone($date, 'Asia/Tokyo');\n $this->assertFalse($boolean);\n }",
"protected function setTimezone()\n {\n $setter = new TimezoneSetter();\n $setter->register();\n }",
"public function setTimezone($timezone): self;",
"public function supportsTimezoneOverride() {\n\t\treturn $this->realConn->supportsTimezoneOverride();\n\t}",
"public function hasTimezone(): bool;",
"protected function setUp()\n {\n date_default_timezone_set('GMT');\n $this->object = new Timezone('Asia/Manila');\n }",
"public function testGetSetTimezone() {\n $ic = new ICalTimezoneGenerator();\n $timestamp = 'Y-m-D H:i:s';\n $ic->setTimestampFormat($timestamp);\n $this->assertEquals($timestamp, $ic->getTimestampFormat());\n }",
"public function testZone() {\n $zone = new Zone([\n 'id' => 'test',\n 'label' => 'Test',\n 'territories' => [\n ['country_code' => 'HU'],\n ['country_code' => 'RS'],\n ],\n ]);\n $this->testEntity->field_zone = $zone;\n $this->testEntity->save();\n\n $this->testEntity = $this->reloadEntity($this->testEntity);\n $this->assertEquals($zone, $this->testEntity->field_zone->value);\n }",
"public function __construct()\n {\n date_default_timezone_set('UTC');\n parent::__construct();\n }",
"public function testGetDefaultTimezone() {\n $ic = new ICalTimezoneGenerator();\n $this->assertAttributeEquals($ic->getTimestampFormat(),\n 'timestampFormat',\n $ic);\n }",
"public function testDefaultTimezone()\n {\n $this->assertSame('UTC', Data_Reader::$default_timezone);\n }",
"public function __construct()\n {\n date_default_timezone_set(get_company_option('timezone', get_option('timezone','Asia/tehran')));\n\n }",
"public function __construct()\n {\n parent::__construct();\n date_default_timezone_set(SYSTEM_TIMEZONE);\n }",
"public function isTimeBased() {\n return false;\n }",
"public function testTimezoneToTerritory()\n {\n $value = Zend_Locale_Data::getList('de_AT', 'timezonetoterritory');\n $result = [\n '001' => 'America/Rio_Branco',\n 'BI' => 'Africa/Bujumbura',\n 'BW' => 'Africa/Gaborone',\n 'CD' => 'Africa/Lubumbashi',\n 'MW' => 'Africa/Blantyre',\n 'RW' => 'Africa/Kigali',\n 'ZM' => 'Africa/Lusaka',\n 'ZW' => 'Africa/Harare',\n 'DJ' => 'Africa/Djibouti',\n 'ER' => 'Africa/Asmera',\n 'ET' => 'Africa/Addis_Ababa',\n 'KM' => 'Indian/Comoro',\n 'MG' => 'Indian/Antananarivo',\n 'SO' => 'Africa/Mogadishu',\n 'TZ' => 'Africa/Dar_es_Salaam',\n 'UG' => 'Africa/Kampala',\n 'YT' => 'Indian/Mayotte',\n 'LS' => 'Africa/Maseru',\n 'SZ' => 'Africa/Mbabane',\n 'AO' => 'Africa/Luanda',\n 'BJ' => 'Africa/Porto-Novo',\n 'CF' => 'Africa/Bangui',\n 'CG' => 'Africa/Brazzaville',\n 'CM' => 'Africa/Douala',\n 'GA' => 'Africa/Libreville',\n 'GQ' => 'Africa/Malabo',\n 'NE' => 'Africa/Niamey',\n 'TD' => 'Africa/Ndjamena',\n 'BZ' => 'America/Belize',\n 'CA' => 'America/Winnipeg',\n 'CR' => 'America/Costa_Rica',\n 'GT' => 'America/Guatemala',\n 'HN' => 'America/Tegucigalpa',\n 'MX' => 'America/Mexico_City',\n 'SV' => 'America/El_Salvador',\n 'BS' => 'America/Nassau',\n 'HT' => 'America/Port-au-Prince',\n 'JM' => 'America/Jamaica',\n 'KY' => 'America/Cayman',\n 'PA' => 'America/Panama',\n 'TC' => 'America/Grand_Turk',\n 'BH' => 'Asia/Bahrain',\n 'IQ' => 'Asia/Baghdad',\n 'KW' => 'Asia/Kuwait',\n 'QA' => 'Asia/Qatar',\n 'YE' => 'Asia/Aden',\n 'AG' => 'America/Antigua',\n 'AI' => 'America/Anguilla',\n 'AN' => 'America/Curacao',\n 'AW' => 'America/Aruba',\n 'BB' => 'America/Barbados',\n 'BM' => 'Atlantic/Bermuda',\n 'BQ' => 'America/Kralendijk',\n 'DM' => 'America/Dominica',\n 'GD' => 'America/Grenada',\n 'GL' => 'America/Thule',\n 'GP' => 'America/Guadeloupe',\n 'KN' => 'America/St_Kitts',\n 'LC' => 'America/St_Lucia',\n 'MF' => 'America/Marigot',\n 'MQ' => 'America/Martinique',\n 'MS' => 'America/Montserrat',\n 'PR' => 'America/Puerto_Rico',\n 'SX' => 'America/Lower_Princes',\n 'TT' => 'America/Port_of_Spain',\n 'VC' => 'America/St_Vincent',\n 'VG' => 'America/Tortola',\n 'VI' => 'America/St_Thomas',\n 'GU' => 'Pacific/Guam',\n 'AQ' => 'Antarctica/Palmer',\n 'AD' => 'Europe/Andorra',\n 'AL' => 'Europe/Tirane',\n 'AT' => 'Europe/Vienna',\n 'BA' => 'Europe/Sarajevo',\n 'BE' => 'Europe/Brussels',\n 'CH' => 'Europe/Zurich',\n 'CZ' => 'Europe/Prague',\n 'DE' => 'Europe/Berlin',\n 'DK' => 'Europe/Copenhagen',\n 'ES' => 'Europe/Madrid',\n 'GI' => 'Europe/Gibraltar',\n 'HR' => 'Europe/Zagreb',\n 'HU' => 'Europe/Budapest',\n 'IT' => 'Europe/Rome',\n 'LI' => 'Europe/Vaduz',\n 'LU' => 'Europe/Luxembourg',\n 'MC' => 'Europe/Monaco',\n 'ME' => 'Europe/Podgorica',\n 'MK' => 'Europe/Skopje',\n 'MT' => 'Europe/Malta',\n 'NL' => 'Europe/Amsterdam',\n 'NO' => 'Europe/Oslo',\n 'PL' => 'Europe/Warsaw',\n 'RS' => 'Europe/Belgrade',\n 'SE' => 'Europe/Stockholm',\n 'SI' => 'Europe/Ljubljana',\n 'SK' => 'Europe/Bratislava',\n 'SM' => 'Europe/San_Marino',\n 'TN' => 'Africa/Tunis',\n 'VA' => 'Europe/Vatican',\n 'XK' => 'Europe/Belgrade',\n 'AX' => 'Europe/Mariehamn',\n 'BG' => 'Europe/Sofia',\n 'CY' => 'Asia/Nicosia',\n 'EG' => 'Africa/Cairo',\n 'FI' => 'Europe/Helsinki',\n 'GR' => 'Europe/Athens',\n 'JO' => 'Asia/Amman',\n 'LB' => 'Asia/Beirut',\n 'SY' => 'Asia/Damascus',\n 'FO' => 'Atlantic/Faeroe',\n 'BF' => 'Africa/Ouagadougou',\n 'CI' => 'Africa/Abidjan',\n 'GB' => 'Europe/London',\n 'GH' => 'Africa/Accra',\n 'GM' => 'Africa/Banjul',\n 'GN' => 'Africa/Conakry',\n 'IE' => 'Europe/Dublin',\n 'ML' => 'Africa/Bamako',\n 'MR' => 'Africa/Nouakchott',\n 'SH' => 'Atlantic/St_Helena',\n 'SL' => 'Africa/Freetown',\n 'SN' => 'Africa/Dakar',\n 'ST' => 'Africa/Sao_Tome',\n 'TG' => 'Africa/Lome',\n 'OM' => 'Asia/Muscat',\n 'LK' => 'Asia/Colombo',\n 'KH' => 'Asia/Phnom_Penh',\n 'LA' => 'Asia/Vientiane',\n 'TH' => 'Asia/Bangkok',\n 'KP' => 'Asia/Pyongyang',\n ];\n $this->assertEquals($result, $value);\n\n $value = Zend_Locale_Data::getContent('de_AT', 'timezonetoterritory', 'GU');\n $this->assertEquals(\"Pacific/Guam\", $value);\n }",
"public function testTimezoneToCity()\n {\n $value = Zend_Locale_Data::getList('de_AT', 'timezonetocity');\n $result = [\n 'Unbekannt' => 'Etc/Unknown',\n 'Tirana' => 'Europe/Tirane',\n 'Erivan' => 'Asia/Yerevan',\n 'Wostok' => 'Antarctica/Vostok',\n 'Dumont D\\'Urville' => 'Antarctica/DumontDUrville',\n 'Wien' => 'Europe/Vienna',\n 'Brüssel' => 'Europe/Brussels',\n 'Wagadugu' => 'Africa/Ouagadougou',\n 'Porto Novo' => 'Africa/Porto-Novo',\n 'Saint-Barthélemy' => 'America/St_Barthelemy',\n 'Bermudas' => 'Atlantic/Bermuda',\n 'São Paulo' => 'America/Sao_Paulo',\n 'Atikokan' => 'America/Coral_Harbour',\n 'St. John\\'s' => 'America/St_Johns',\n 'Zürich' => 'Europe/Zurich',\n 'Osterinsel' => 'Pacific/Easter',\n 'Kaxgar' => 'Asia/Kashgar',\n 'Bogotá' => 'America/Bogota',\n 'Havanna' => 'America/Havana',\n 'Kap Verde' => 'Atlantic/Cape_Verde',\n 'Curaçao' => 'America/Curacao',\n 'Weihnachts-Inseln' => 'Indian/Christmas',\n 'Nikosia' => 'Asia/Nicosia',\n 'Prag' => 'Europe/Prague',\n 'Büsingen' => 'Europe/Busingen',\n 'Dschibuti' => 'Africa/Djibouti',\n 'Kopenhagen' => 'Europe/Copenhagen',\n 'Algier' => 'Africa/Algiers',\n 'Kairo' => 'Africa/Cairo',\n 'El Aaiún' => 'Africa/El_Aaiun',\n 'Asmara' => 'Africa/Asmera',\n 'Kanaren' => 'Atlantic/Canary',\n 'Addis Abeba' => 'Africa/Addis_Ababa',\n 'Fidschi' => 'Pacific/Fiji',\n 'Chuuk' => 'Pacific/Truk',\n 'Pohnpei' => 'Pacific/Ponape',\n 'Färöer' => 'Atlantic/Faeroe',\n 'Tiflis' => 'Asia/Tbilisi',\n 'Akkra' => 'Africa/Accra',\n 'Nuuk' => 'America/Godthab',\n 'Ittoqqortoormiit' => 'America/Scoresbysund',\n 'Athen' => 'Europe/Athens',\n 'Süd-Georgien' => 'Atlantic/South_Georgia',\n 'Hongkong' => 'Asia/Hong_Kong',\n 'Port Numbay' => 'Asia/Jayapura',\n 'Kolkata' => 'Asia/Calcutta',\n 'Bagdad' => 'Asia/Baghdad',\n 'Teheran' => 'Asia/Tehran',\n 'Reykjavík' => 'Atlantic/Reykjavik',\n 'Rom' => 'Europe/Rome',\n 'Jamaika' => 'America/Jamaica',\n 'Tokio' => 'Asia/Tokyo',\n 'Bischkek' => 'Asia/Bishkek',\n 'Komoren' => 'Indian/Comoro',\n 'St. Kitts' => 'America/St_Kitts',\n 'Pjöngjang' => 'Asia/Pyongyang',\n 'Kaimaninseln' => 'America/Cayman',\n 'Aktobe' => 'Asia/Aqtobe',\n 'St. Lucia' => 'America/St_Lucia',\n 'Wilna' => 'Europe/Vilnius',\n 'Luxemburg' => 'Europe/Luxembourg',\n 'Tripolis' => 'Africa/Tripoli',\n 'Kischinau' => 'Europe/Chisinau',\n 'Macao' => 'Asia/Macau',\n 'Malediven' => 'Indian/Maldives',\n 'Mexiko-Stadt' => 'America/Mexico_City',\n 'Kathmandu' => 'Asia/Katmandu',\n 'Muskat' => 'Asia/Muscat',\n 'Warschau' => 'Europe/Warsaw',\n 'Azoren' => 'Atlantic/Azores',\n 'Lissabon' => 'Europe/Lisbon',\n 'Asunción' => 'America/Asuncion',\n 'Katar' => 'Asia/Qatar',\n 'Réunion' => 'Indian/Reunion',\n 'Bukarest' => 'Europe/Bucharest',\n 'Belgrad' => 'Europe/Belgrade',\n 'Moskau' => 'Europe/Moscow',\n 'Wolgograd' => 'Europe/Volgograd',\n 'Jekaterinburg' => 'Asia/Yekaterinburg',\n 'Nowosibirsk' => 'Asia/Novosibirsk',\n 'Nowokuznetsk' => 'Asia/Novokuznetsk',\n 'Krasnojarsk' => 'Asia/Krasnoyarsk',\n 'Jakutsk' => 'Asia/Yakutsk',\n 'Wladiwostok' => 'Asia/Vladivostok',\n 'Sachalin' => 'Asia/Sakhalin',\n 'Kamtschatka' => 'Asia/Kamchatka',\n 'Riad' => 'Asia/Riyadh',\n 'Khartum' => 'Africa/Khartoum',\n 'Singapur' => 'Asia/Singapore',\n 'St. Helena' => 'Atlantic/St_Helena',\n 'Mogadischu' => 'Africa/Mogadishu',\n 'São Tomé' => 'Africa/Sao_Tome',\n 'Salvador' => 'America/El_Salvador',\n 'Lower Prince\\'s Quarter' => 'America/Lower_Princes',\n 'Damaskus' => 'Asia/Damascus',\n 'Lomé' => 'Africa/Lome',\n 'Duschanbe' => 'Asia/Dushanbe',\n 'Port-of-Spain' => 'America/Port_of_Spain',\n 'Taipeh' => 'Asia/Taipei',\n 'Daressalam' => 'Africa/Dar_es_Salaam',\n 'Uschgorod' => 'Europe/Uzhgorod',\n 'Kiew' => 'Europe/Kiev',\n 'Saporischja' => 'Europe/Zaporozhye',\n 'Beulah, North Dakota' => 'America/North_Dakota/Beulah',\n 'New Salem, North Dakota' => 'America/North_Dakota/New_Salem',\n 'Center, North Dakota' => 'America/North_Dakota/Center',\n 'Vincennes, Indiana' => 'America/Indiana/Vincennes',\n 'Petersburg, Indiana' => 'America/Indiana/Petersburg',\n 'Tell City, Indiana' => 'America/Indiana/Tell_City',\n 'Knox, Indiana' => 'America/Indiana/Knox',\n 'Winamac, Indiana' => 'America/Indiana/Winamac',\n 'Marengo, Indiana' => 'America/Indiana/Marengo',\n 'Vevay, Indiana' => 'America/Indiana/Vevay',\n 'Monticello, Kentucky' => 'America/Kentucky/Monticello',\n 'Taschkent' => 'Asia/Tashkent',\n 'Vatikan' => 'Europe/Vatican',\n 'St. Vincent' => 'America/St_Vincent',\n 'St. Thomas' => 'America/St_Thomas',\n 'Ho-Chi-Minh-Stadt' => 'Asia/Saigon',\n ];\n $this->assertEquals($result, $value, var_export($value, 1));\n\n $value = Zend_Locale_Data::getContent('de_AT', 'timezonetocity', 'Fidschi');\n $this->assertEquals(\"Pacific/Fiji\", $value);\n }",
"protected function setUp()\n {\n DateTime::setUserTimezone(null);\n DateTime::setServerTimezone(null);\n DateTime::setDefaultFormat('');\n }",
"public function __setTimezone__Carbon($value)\r\n\t{\r\n\t\treturn parent::setTimezone(static::safeCreateDateTimeZone($value));\r\n\t}",
"function testLocatieMagNietLeegZijn(){\n $tijd = new \\DateTimeImmutable();\n $veiling = new Veiling($tijd, null);\n }",
"public function testTimeZones()\n {\n $timeString = '20160607160855.488750';\n $utTime = new \\DateTime('2016-06-07 16:08:55', new \\DateTimeZone('utc'));\n $boottime = new Boottime();\n\n // Positive timezone offsets\n for ($i = 0; $i <= 12; ++$i) {\n $expectedTime = clone $utTime;\n $expectedTime->modify(\"-$i hour\");\n $offset = sprintf('%03d', $i * 60);\n\n $this->assertSame(\n $boottime->read(\"echo ; echo '{$timeString}+{$offset}'\"),\n $expectedTime->getTimestamp()\n );\n }\n\n // Negative timezone offsets\n for ($i = 0; $i <= 12; ++$i) {\n $expectedTime = clone $utTime;\n $expectedTime->modify(\"+$i hour\");\n $offset = sprintf('%03d', $i * 60);\n\n $this->assertSame(\n $boottime->read(\"echo ; echo '{$timeString}-{$offset}'\"),\n $expectedTime->getTimestamp()\n );\n }\n }",
"public function _timeZoneSet()\n {\n $timeZone = $this->config->item('timeZone');\n if ($timeZone== '') {\n $timeZone=\"Europe/Dublin\";\n }\n date_default_timezone_set($timeZone);\n }",
"function myTime($zone=\"Europe/London\") {\n\t\tdate_default_timezone_set($zone);\n\t\treturn $this->__construct();\n\t}",
"public function testTerritoryToTimezone()\n {\n $value = Zend_Locale_Data::getList('de_AT', 'territorytotimezone');\n $result = ['America/Rio_Branco' => '001', 'Asia/Kabul' => '001',\n 'Africa/Maputo' => '001', 'Africa/Bujumbura' => 'BI', 'Africa/Gaborone' => 'BW',\n 'Africa/Lubumbashi' => 'CD', 'Africa/Blantyre' => 'MW', 'Africa/Kigali' => 'RW',\n 'Africa/Lusaka' => 'ZM', 'Africa/Harare' => 'ZW', 'Africa/Nairobi' => '001',\n 'Africa/Djibouti' => 'DJ', 'Africa/Asmera' => 'ER', 'Africa/Addis_Ababa' => 'ET',\n 'Indian/Comoro' => 'KM', 'Indian/Antananarivo' => 'MG', 'Africa/Mogadishu' => 'SO',\n 'Africa/Dar_es_Salaam' => 'TZ', 'Africa/Kampala' => 'UG', 'Indian/Mayotte' => 'YT',\n 'Africa/El_Aaiun' => '001', 'Africa/Johannesburg' => '001', 'Africa/Maseru' => 'LS',\n 'Africa/Mbabane' => 'SZ', 'Africa/Lagos' => '001', 'Africa/Luanda' => 'AO',\n 'Africa/Porto-Novo' => 'BJ', 'Africa/Kinshasa' => 'CD', 'Africa/Bangui' => 'CF',\n 'Africa/Brazzaville' => 'CG', 'Africa/Douala' => 'CM', 'Africa/Libreville' => 'GA',\n 'Africa/Malabo' => 'GQ', 'Africa/Niamey' => 'NE', 'Africa/Ndjamena' => 'TD',\n 'Asia/Aqtobe' => '001', 'America/Juneau' => '001', 'America/Anchorage' => '001',\n 'Asia/Almaty' => '001', 'America/Manaus' => '001', 'America/Chicago' => '001',\n 'America/Belize' => 'BZ', 'America/Winnipeg' => 'CA', 'America/Costa_Rica' => 'CR',\n 'America/Guatemala' => 'GT', 'America/Tegucigalpa' => 'HN', 'America/Mexico_City' => 'MX',\n 'America/El_Salvador' => 'SV', 'America/New_York' => '001', 'America/Nassau' => 'BS',\n 'America/Toronto' => 'CA', 'America/Port-au-Prince' => 'HT', 'America/Jamaica' => 'JM',\n 'America/Cayman' => 'KY', 'America/Panama' => 'PA', 'America/Grand_Turk' => 'TC',\n 'America/Denver' => '001', 'America/Edmonton' => 'CA',\n 'America/Hermosillo' => 'MX',\n 'America/Los_Angeles' => '001',\n 'America/Vancouver' => 'CA',\n 'America/Tijuana' => 'MX',\n 'Asia/Anadyr' => '001',\n 'Asia/Aqtau' => '001',\n 'Asia/Riyadh' => '001',\n 'Asia/Bahrain' => 'BH',\n 'Asia/Baghdad' => 'IQ',\n 'Asia/Kuwait' => 'KW',\n 'Asia/Qatar' => 'QA',\n 'Asia/Aden' => 'YE',\n 'America/Buenos_Aires' => '001',\n 'America/Argentina/San_Luis' => '001',\n 'Asia/Yerevan' => '001',\n 'Asia/Ashgabat' => '001',\n 'America/Halifax' => '001',\n 'America/Antigua' => 'AG',\n 'America/Anguilla' => 'AI',\n 'America/Curacao' => 'AN',\n 'America/Aruba' => 'AW',\n 'America/Barbados' => 'BB',\n 'Atlantic/Bermuda' => 'BM',\n 'America/Kralendijk' => 'BQ',\n 'America/Dominica' => 'DM',\n 'America/Grenada' => 'GD',\n 'America/Thule' => 'GL',\n 'America/Guadeloupe' => 'GP',\n 'America/St_Kitts' => 'KN',\n 'America/St_Lucia' => 'LC',\n 'America/Marigot' => 'MF',\n 'America/Martinique' => 'MQ',\n 'America/Montserrat' => 'MS',\n 'America/Puerto_Rico' => 'PR',\n 'America/Lower_Princes' => 'SX',\n 'America/Port_of_Spain' => 'TT',\n 'America/St_Vincent' => 'VC',\n 'America/Tortola' => 'VG',\n 'America/St_Thomas' => 'VI',\n 'Australia/Adelaide' => '001',\n 'Australia/Eucla' => '001',\n 'Australia/Sydney' => '001',\n 'Australia/Perth' => '001',\n 'Asia/Baku' => '001',\n 'Atlantic/Azores' => '001',\n 'Asia/Dhaka' => '001',\n 'America/Adak' => '001',\n 'Asia/Thimphu' => '001',\n 'America/La_Paz' => '001',\n 'Asia/Kuching' => '001',\n 'America/Sao_Paulo' => '001',\n 'Europe/London' => '001',\n 'Asia/Brunei' => '001',\n 'Atlantic/Cape_Verde' => '001',\n 'Antarctica/Casey' => '001',\n 'Pacific/Saipan' => '001',\n 'Pacific/Guam' => 'GU',\n 'Asia/Harbin' => '001',\n 'Pacific/Chatham' => '001',\n 'America/Santiago' => '001',\n 'Antarctica/Palmer' => 'AQ',\n 'Asia/Shanghai' => '001',\n 'Asia/Choibalsan' => '001',\n 'Indian/Christmas' => '001',\n 'Indian/Cocos' => '001',\n 'America/Bogota' => '001',\n 'Pacific/Rarotonga' => '001',\n 'America/Havana' => '001',\n 'Antarctica/Davis' => '001',\n 'America/Santo_Domingo' => '001',\n 'Antarctica/DumontDUrville' => '001',\n 'Asia/Dushanbe' => '001',\n 'America/Paramaribo' => '001',\n 'Asia/Dili' => '001',\n 'Pacific/Easter' => '001',\n 'America/Guayaquil' => '001',\n 'Europe/Paris' => '001',\n 'Europe/Andorra' => 'AD',\n 'Europe/Tirane' => 'AL',\n 'Europe/Vienna' => 'AT',\n 'Europe/Sarajevo' => 'BA',\n 'Europe/Brussels' => 'BE',\n 'Europe/Zurich' => 'CH',\n 'Europe/Prague' => 'CZ',\n 'Europe/Berlin' => 'DE',\n 'Europe/Copenhagen' => 'DK',\n 'Europe/Madrid' => 'ES',\n 'Europe/Gibraltar' => 'GI',\n 'Europe/Zagreb' => 'HR',\n 'Europe/Budapest' => 'HU',\n 'Europe/Rome' => 'IT',\n 'Europe/Vaduz' => 'LI',\n 'Europe/Luxembourg' => 'LU',\n 'Europe/Monaco' => 'MC',\n 'Europe/Podgorica' => 'ME',\n 'Europe/Skopje' => 'MK',\n 'Europe/Malta' => 'MT',\n 'Europe/Amsterdam' => 'NL',\n 'Europe/Oslo' => 'NO',\n 'Europe/Warsaw' => 'PL',\n 'Europe/Belgrade' => 'RS',\n 'Europe/Stockholm' => 'SE',\n 'Europe/Ljubljana' => 'SI',\n 'Europe/Bratislava' => 'SK',\n 'Europe/San_Marino' => 'SM',\n 'Africa/Tunis' => 'TN',\n 'Europe/Vatican' => 'VA',\n 'Europe/Bucharest' => '001',\n 'Europe/Mariehamn' => 'AX',\n 'Europe/Sofia' => 'BG',\n 'Asia/Nicosia' => 'CY',\n 'Africa/Cairo' => 'EG',\n 'Europe/Helsinki' => 'FI',\n 'Europe/Athens' => 'GR',\n 'Asia/Amman' => 'JO',\n 'Asia/Beirut' => 'LB',\n 'Asia/Damascus' => 'SY',\n 'Atlantic/Canary' => '001',\n 'Atlantic/Faeroe' => 'FO',\n 'Atlantic/Stanley' => '001',\n 'Pacific/Fiji' => '001',\n 'America/Cayenne' => '001',\n 'Indian/Kerguelen' => '001',\n 'Asia/Bishkek' => '001',\n 'Pacific/Galapagos' => '001',\n 'Pacific/Gambier' => '001',\n 'Asia/Tbilisi' => '001',\n 'Pacific/Tarawa' => '001',\n 'Atlantic/Reykjavik' => '001',\n 'Africa/Ouagadougou' => 'BF',\n 'Africa/Abidjan' => 'CI',\n 'Africa/Accra' => 'GH',\n 'Africa/Banjul' => 'GM',\n 'Africa/Conakry' => 'GN',\n 'Europe/Dublin' => 'IE',\n 'Africa/Bamako' => 'ML',\n 'Africa/Nouakchott' => 'MR',\n 'Atlantic/St_Helena' => 'SH',\n 'Africa/Freetown' => 'SL',\n 'Africa/Dakar' => 'SN',\n 'Africa/Sao_Tome' => 'ST',\n 'Africa/Lome' => 'TG',\n 'America/Goose_Bay' => '001',\n 'America/Scoresbysund' => '001',\n 'America/Godthab' => '001',\n 'Asia/Dubai' => '001',\n 'Asia/Muscat' => 'OM',\n 'America/Guyana' => '001',\n 'Pacific/Honolulu' => '001',\n 'Asia/Hong_Kong' => '001',\n 'Asia/Hovd' => '001',\n 'Asia/Calcutta' => '001',\n 'Asia/Colombo' => 'LK',\n 'Indian/Chagos' => '001',\n 'Asia/Saigon' => '001',\n 'Asia/Phnom_Penh' => 'KH',\n 'Asia/Vientiane' => 'LA',\n 'Asia/Bangkok' => 'TH',\n 'Asia/Makassar' => '001',\n 'Asia/Jayapura' => '001',\n 'Asia/Jakarta' => '001',\n 'Asia/Tehran' => '001',\n 'Asia/Irkutsk' => '001',\n 'Asia/Jerusalem' => '001',\n 'Asia/Tokyo' => '001',\n 'Asia/Kamchatka' => '001',\n 'Asia/Karachi' => '001',\n 'Asia/Kashgar' => '001',\n 'Asia/Qyzylorda' => '001',\n 'Asia/Seoul' => '001',\n 'Asia/Pyongyang' => 'KP',\n 'Pacific/Kosrae' => '001',\n 'Asia/Krasnoyarsk' => '001',\n 'Europe/Samara' => '001',\n 'Pacific/Kwajalein' => '001',\n 'Africa/Monrovia' => '001',\n 'Pacific/Kiritimati' => '001',\n 'Asia/Chongqing' => '001',\n 'Australia/Lord_Howe' => '001',\n 'Asia/Macau' => '001',\n 'Antarctica/Macquarie' => '001',\n 'Asia/Magadan' => '001',\n 'Asia/Kuala_Lumpur' => '001',\n 'Indian/Maldives' => '001',\n 'Pacific/Marquesas' => '001',\n 'Pacific/Majuro' => '001',\n 'Indian/Mauritius' => '001',\n 'Antarctica/Mawson' => '001',\n 'America/Santa_Isabel' => '001',\n 'America/Mazatlan' => '001',\n 'Asia/Ulaanbaatar' => '001',\n 'Europe/Moscow' => '001',\n 'Asia/Rangoon' => '001',\n 'Pacific/Nauru' => '001',\n 'Asia/Katmandu' => '001',\n 'Pacific/Noumea' => '001',\n 'Pacific/Auckland' => '001',\n 'Antarctica/McMurdo' => 'AQ',\n 'America/St_Johns' => '001',\n 'Pacific/Niue' => '001',\n 'Pacific/Norfolk' => '001',\n 'America/Noronha' => '001',\n 'Asia/Novosibirsk' => '001',\n 'Asia/Omsk' => '001',\n 'Asia/Oral' => '001',\n 'Pacific/Palau' => '001',\n 'Pacific/Port_Moresby' => '001',\n 'America/Asuncion' => '001',\n 'America/Lima' => '001',\n 'Asia/Manila' => '001',\n 'Pacific/Enderbury' => '001',\n 'America/Miquelon' => '001',\n 'Pacific/Pitcairn' => '001',\n 'Pacific/Ponape' => '001',\n 'Indian/Reunion' => '001',\n 'Antarctica/Rothera' => '001',\n 'Asia/Sakhalin' => '001',\n 'Asia/Samarkand' => '001',\n 'Pacific/Apia' => '001',\n 'Indian/Mahe' => '001',\n 'Asia/Singapore' => '001',\n 'Pacific/Guadalcanal' => '001',\n 'Atlantic/South_Georgia' => '001',\n 'Asia/Yekaterinburg' => '001',\n 'Antarctica/Syowa' => '001',\n 'Pacific/Tahiti' => '001',\n 'Asia/Taipei' => '001',\n 'Asia/Tashkent' => '001',\n 'Pacific/Fakaofo' => '001',\n 'Pacific/Tongatapu' => '001',\n 'Pacific/Truk' => '001',\n 'Europe/Istanbul' => '001',\n 'Pacific/Funafuti' => '001',\n 'America/Montevideo' => '001',\n 'Asia/Urumqi' => '001',\n 'Pacific/Efate' => '001',\n 'America/Caracas' => '001',\n 'Asia/Vladivostok' => '001',\n 'Europe/Volgograd' => '001',\n 'Antarctica/Vostok' => '001',\n 'Pacific/Wake' => '001',\n 'Pacific/Wallis' => '001',\n 'Asia/Yakutsk' => '001',\n 'America/Yakutat' => '001'];\n $this->assertEquals($result, $value);\n\n $value = Zend_Locale_Data::getContent('de_AT', 'territorytotimezone', 'Antarctica/Vostok');\n $this->assertEquals(\"001\", $value);\n }",
"function __construct() {\n date_default_timezone_set('Europe/Warsaw');\n }"
] | [
"0.7900138",
"0.745785",
"0.69719625",
"0.67446727",
"0.63387305",
"0.6225623",
"0.62038594",
"0.61541903",
"0.61164373",
"0.61011595",
"0.607213",
"0.5993507",
"0.5990712",
"0.5886468",
"0.5861796",
"0.5809852",
"0.5789149",
"0.5687893",
"0.5685175",
"0.5684258",
"0.5671678",
"0.5644607",
"0.5618636",
"0.5555749",
"0.55535614",
"0.55491436",
"0.5520458",
"0.5514782",
"0.5475297",
"0.5454176"
] | 0.74611497 | 1 |
Test Timezone Trait is shared for all models extending the base model shared by Customers and Users | public function testTimezoneStaticPropertyFromBaseModel()
{
$zone = 'America/New_York';
Customer::$timezone = $zone;
$timezone = (new User)->getTimezone();
$this->assertEquals($zone, $timezone);
Customer::setTimezone();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testTimezoneTrait()\n {\n Customer::setTimezone('UTC');\n\n $zone = 'America/New_York';\n $result = Customer::first();\n\n $before = $result->created_at;\n\n Customer::setTimezone($zone);\n\n $after = $result->created_at;\n\n $time = time();\n $transitions = (new DateTimeZone($zone))->getTransitions($time, $time);\n $offset = $transitions[0]['offset'];\n\n $this->assertEquals('UTC', $before->timezoneName);\n $this->assertEquals($zone, $after->timezoneName);\n $this->assertEquals($offset, $after->offset);\n\n // Reset the timezone\n Customer::setTimezone();\n }",
"public function testTimezoneStaticPropertyFromNewModel()\n {\n Customer::$timezone = 'America/New_York';\n\n $class = new class extends \\Illuminate\\Database\\Eloquent\\Model {\n use \\Luminary\\Services\\Timezone\\TimezoneModelTrait;\n };\n\n $timezone = (new $class)->getTimezone();\n\n $this->assertEquals(null, $timezone);\n\n Customer::setTimezone();\n }",
"public function testSetTimezoneMethod()\n {\n $timezone = 'America/New_York';\n\n $this->assertEquals(null, Customer::$timezone);\n\n Customer::setTimezone($timezone);\n\n $this->assertEquals($timezone, Customer::$timezone);\n\n Customer::setTimezone();\n\n $this->assertEquals(null, Customer::$timezone);\n }",
"protected function setUp()\n {\n date_default_timezone_set('GMT');\n $this->object = new Timezone('Asia/Manila');\n }",
"public function testSameTimeZone(){\n $date = new \\DateTime();\n $boolean = DateTimeValidator::timeZone($date, 'UTC');\n $this->assertTrue($boolean);\n }",
"public function testTimezoneToCity()\n {\n $value = Zend_Locale_Data::getList('de_AT', 'timezonetocity');\n $result = [\n 'Unbekannt' => 'Etc/Unknown',\n 'Tirana' => 'Europe/Tirane',\n 'Erivan' => 'Asia/Yerevan',\n 'Wostok' => 'Antarctica/Vostok',\n 'Dumont D\\'Urville' => 'Antarctica/DumontDUrville',\n 'Wien' => 'Europe/Vienna',\n 'Brüssel' => 'Europe/Brussels',\n 'Wagadugu' => 'Africa/Ouagadougou',\n 'Porto Novo' => 'Africa/Porto-Novo',\n 'Saint-Barthélemy' => 'America/St_Barthelemy',\n 'Bermudas' => 'Atlantic/Bermuda',\n 'São Paulo' => 'America/Sao_Paulo',\n 'Atikokan' => 'America/Coral_Harbour',\n 'St. John\\'s' => 'America/St_Johns',\n 'Zürich' => 'Europe/Zurich',\n 'Osterinsel' => 'Pacific/Easter',\n 'Kaxgar' => 'Asia/Kashgar',\n 'Bogotá' => 'America/Bogota',\n 'Havanna' => 'America/Havana',\n 'Kap Verde' => 'Atlantic/Cape_Verde',\n 'Curaçao' => 'America/Curacao',\n 'Weihnachts-Inseln' => 'Indian/Christmas',\n 'Nikosia' => 'Asia/Nicosia',\n 'Prag' => 'Europe/Prague',\n 'Büsingen' => 'Europe/Busingen',\n 'Dschibuti' => 'Africa/Djibouti',\n 'Kopenhagen' => 'Europe/Copenhagen',\n 'Algier' => 'Africa/Algiers',\n 'Kairo' => 'Africa/Cairo',\n 'El Aaiún' => 'Africa/El_Aaiun',\n 'Asmara' => 'Africa/Asmera',\n 'Kanaren' => 'Atlantic/Canary',\n 'Addis Abeba' => 'Africa/Addis_Ababa',\n 'Fidschi' => 'Pacific/Fiji',\n 'Chuuk' => 'Pacific/Truk',\n 'Pohnpei' => 'Pacific/Ponape',\n 'Färöer' => 'Atlantic/Faeroe',\n 'Tiflis' => 'Asia/Tbilisi',\n 'Akkra' => 'Africa/Accra',\n 'Nuuk' => 'America/Godthab',\n 'Ittoqqortoormiit' => 'America/Scoresbysund',\n 'Athen' => 'Europe/Athens',\n 'Süd-Georgien' => 'Atlantic/South_Georgia',\n 'Hongkong' => 'Asia/Hong_Kong',\n 'Port Numbay' => 'Asia/Jayapura',\n 'Kolkata' => 'Asia/Calcutta',\n 'Bagdad' => 'Asia/Baghdad',\n 'Teheran' => 'Asia/Tehran',\n 'Reykjavík' => 'Atlantic/Reykjavik',\n 'Rom' => 'Europe/Rome',\n 'Jamaika' => 'America/Jamaica',\n 'Tokio' => 'Asia/Tokyo',\n 'Bischkek' => 'Asia/Bishkek',\n 'Komoren' => 'Indian/Comoro',\n 'St. Kitts' => 'America/St_Kitts',\n 'Pjöngjang' => 'Asia/Pyongyang',\n 'Kaimaninseln' => 'America/Cayman',\n 'Aktobe' => 'Asia/Aqtobe',\n 'St. Lucia' => 'America/St_Lucia',\n 'Wilna' => 'Europe/Vilnius',\n 'Luxemburg' => 'Europe/Luxembourg',\n 'Tripolis' => 'Africa/Tripoli',\n 'Kischinau' => 'Europe/Chisinau',\n 'Macao' => 'Asia/Macau',\n 'Malediven' => 'Indian/Maldives',\n 'Mexiko-Stadt' => 'America/Mexico_City',\n 'Kathmandu' => 'Asia/Katmandu',\n 'Muskat' => 'Asia/Muscat',\n 'Warschau' => 'Europe/Warsaw',\n 'Azoren' => 'Atlantic/Azores',\n 'Lissabon' => 'Europe/Lisbon',\n 'Asunción' => 'America/Asuncion',\n 'Katar' => 'Asia/Qatar',\n 'Réunion' => 'Indian/Reunion',\n 'Bukarest' => 'Europe/Bucharest',\n 'Belgrad' => 'Europe/Belgrade',\n 'Moskau' => 'Europe/Moscow',\n 'Wolgograd' => 'Europe/Volgograd',\n 'Jekaterinburg' => 'Asia/Yekaterinburg',\n 'Nowosibirsk' => 'Asia/Novosibirsk',\n 'Nowokuznetsk' => 'Asia/Novokuznetsk',\n 'Krasnojarsk' => 'Asia/Krasnoyarsk',\n 'Jakutsk' => 'Asia/Yakutsk',\n 'Wladiwostok' => 'Asia/Vladivostok',\n 'Sachalin' => 'Asia/Sakhalin',\n 'Kamtschatka' => 'Asia/Kamchatka',\n 'Riad' => 'Asia/Riyadh',\n 'Khartum' => 'Africa/Khartoum',\n 'Singapur' => 'Asia/Singapore',\n 'St. Helena' => 'Atlantic/St_Helena',\n 'Mogadischu' => 'Africa/Mogadishu',\n 'São Tomé' => 'Africa/Sao_Tome',\n 'Salvador' => 'America/El_Salvador',\n 'Lower Prince\\'s Quarter' => 'America/Lower_Princes',\n 'Damaskus' => 'Asia/Damascus',\n 'Lomé' => 'Africa/Lome',\n 'Duschanbe' => 'Asia/Dushanbe',\n 'Port-of-Spain' => 'America/Port_of_Spain',\n 'Taipeh' => 'Asia/Taipei',\n 'Daressalam' => 'Africa/Dar_es_Salaam',\n 'Uschgorod' => 'Europe/Uzhgorod',\n 'Kiew' => 'Europe/Kiev',\n 'Saporischja' => 'Europe/Zaporozhye',\n 'Beulah, North Dakota' => 'America/North_Dakota/Beulah',\n 'New Salem, North Dakota' => 'America/North_Dakota/New_Salem',\n 'Center, North Dakota' => 'America/North_Dakota/Center',\n 'Vincennes, Indiana' => 'America/Indiana/Vincennes',\n 'Petersburg, Indiana' => 'America/Indiana/Petersburg',\n 'Tell City, Indiana' => 'America/Indiana/Tell_City',\n 'Knox, Indiana' => 'America/Indiana/Knox',\n 'Winamac, Indiana' => 'America/Indiana/Winamac',\n 'Marengo, Indiana' => 'America/Indiana/Marengo',\n 'Vevay, Indiana' => 'America/Indiana/Vevay',\n 'Monticello, Kentucky' => 'America/Kentucky/Monticello',\n 'Taschkent' => 'Asia/Tashkent',\n 'Vatikan' => 'Europe/Vatican',\n 'St. Vincent' => 'America/St_Vincent',\n 'St. Thomas' => 'America/St_Thomas',\n 'Ho-Chi-Minh-Stadt' => 'Asia/Saigon',\n ];\n $this->assertEquals($result, $value, var_export($value, 1));\n\n $value = Zend_Locale_Data::getContent('de_AT', 'timezonetocity', 'Fidschi');\n $this->assertEquals(\"Pacific/Fiji\", $value);\n }",
"public function testTimezoneToTerritory()\n {\n $value = Zend_Locale_Data::getList('de_AT', 'timezonetoterritory');\n $result = [\n '001' => 'America/Rio_Branco',\n 'BI' => 'Africa/Bujumbura',\n 'BW' => 'Africa/Gaborone',\n 'CD' => 'Africa/Lubumbashi',\n 'MW' => 'Africa/Blantyre',\n 'RW' => 'Africa/Kigali',\n 'ZM' => 'Africa/Lusaka',\n 'ZW' => 'Africa/Harare',\n 'DJ' => 'Africa/Djibouti',\n 'ER' => 'Africa/Asmera',\n 'ET' => 'Africa/Addis_Ababa',\n 'KM' => 'Indian/Comoro',\n 'MG' => 'Indian/Antananarivo',\n 'SO' => 'Africa/Mogadishu',\n 'TZ' => 'Africa/Dar_es_Salaam',\n 'UG' => 'Africa/Kampala',\n 'YT' => 'Indian/Mayotte',\n 'LS' => 'Africa/Maseru',\n 'SZ' => 'Africa/Mbabane',\n 'AO' => 'Africa/Luanda',\n 'BJ' => 'Africa/Porto-Novo',\n 'CF' => 'Africa/Bangui',\n 'CG' => 'Africa/Brazzaville',\n 'CM' => 'Africa/Douala',\n 'GA' => 'Africa/Libreville',\n 'GQ' => 'Africa/Malabo',\n 'NE' => 'Africa/Niamey',\n 'TD' => 'Africa/Ndjamena',\n 'BZ' => 'America/Belize',\n 'CA' => 'America/Winnipeg',\n 'CR' => 'America/Costa_Rica',\n 'GT' => 'America/Guatemala',\n 'HN' => 'America/Tegucigalpa',\n 'MX' => 'America/Mexico_City',\n 'SV' => 'America/El_Salvador',\n 'BS' => 'America/Nassau',\n 'HT' => 'America/Port-au-Prince',\n 'JM' => 'America/Jamaica',\n 'KY' => 'America/Cayman',\n 'PA' => 'America/Panama',\n 'TC' => 'America/Grand_Turk',\n 'BH' => 'Asia/Bahrain',\n 'IQ' => 'Asia/Baghdad',\n 'KW' => 'Asia/Kuwait',\n 'QA' => 'Asia/Qatar',\n 'YE' => 'Asia/Aden',\n 'AG' => 'America/Antigua',\n 'AI' => 'America/Anguilla',\n 'AN' => 'America/Curacao',\n 'AW' => 'America/Aruba',\n 'BB' => 'America/Barbados',\n 'BM' => 'Atlantic/Bermuda',\n 'BQ' => 'America/Kralendijk',\n 'DM' => 'America/Dominica',\n 'GD' => 'America/Grenada',\n 'GL' => 'America/Thule',\n 'GP' => 'America/Guadeloupe',\n 'KN' => 'America/St_Kitts',\n 'LC' => 'America/St_Lucia',\n 'MF' => 'America/Marigot',\n 'MQ' => 'America/Martinique',\n 'MS' => 'America/Montserrat',\n 'PR' => 'America/Puerto_Rico',\n 'SX' => 'America/Lower_Princes',\n 'TT' => 'America/Port_of_Spain',\n 'VC' => 'America/St_Vincent',\n 'VG' => 'America/Tortola',\n 'VI' => 'America/St_Thomas',\n 'GU' => 'Pacific/Guam',\n 'AQ' => 'Antarctica/Palmer',\n 'AD' => 'Europe/Andorra',\n 'AL' => 'Europe/Tirane',\n 'AT' => 'Europe/Vienna',\n 'BA' => 'Europe/Sarajevo',\n 'BE' => 'Europe/Brussels',\n 'CH' => 'Europe/Zurich',\n 'CZ' => 'Europe/Prague',\n 'DE' => 'Europe/Berlin',\n 'DK' => 'Europe/Copenhagen',\n 'ES' => 'Europe/Madrid',\n 'GI' => 'Europe/Gibraltar',\n 'HR' => 'Europe/Zagreb',\n 'HU' => 'Europe/Budapest',\n 'IT' => 'Europe/Rome',\n 'LI' => 'Europe/Vaduz',\n 'LU' => 'Europe/Luxembourg',\n 'MC' => 'Europe/Monaco',\n 'ME' => 'Europe/Podgorica',\n 'MK' => 'Europe/Skopje',\n 'MT' => 'Europe/Malta',\n 'NL' => 'Europe/Amsterdam',\n 'NO' => 'Europe/Oslo',\n 'PL' => 'Europe/Warsaw',\n 'RS' => 'Europe/Belgrade',\n 'SE' => 'Europe/Stockholm',\n 'SI' => 'Europe/Ljubljana',\n 'SK' => 'Europe/Bratislava',\n 'SM' => 'Europe/San_Marino',\n 'TN' => 'Africa/Tunis',\n 'VA' => 'Europe/Vatican',\n 'XK' => 'Europe/Belgrade',\n 'AX' => 'Europe/Mariehamn',\n 'BG' => 'Europe/Sofia',\n 'CY' => 'Asia/Nicosia',\n 'EG' => 'Africa/Cairo',\n 'FI' => 'Europe/Helsinki',\n 'GR' => 'Europe/Athens',\n 'JO' => 'Asia/Amman',\n 'LB' => 'Asia/Beirut',\n 'SY' => 'Asia/Damascus',\n 'FO' => 'Atlantic/Faeroe',\n 'BF' => 'Africa/Ouagadougou',\n 'CI' => 'Africa/Abidjan',\n 'GB' => 'Europe/London',\n 'GH' => 'Africa/Accra',\n 'GM' => 'Africa/Banjul',\n 'GN' => 'Africa/Conakry',\n 'IE' => 'Europe/Dublin',\n 'ML' => 'Africa/Bamako',\n 'MR' => 'Africa/Nouakchott',\n 'SH' => 'Atlantic/St_Helena',\n 'SL' => 'Africa/Freetown',\n 'SN' => 'Africa/Dakar',\n 'ST' => 'Africa/Sao_Tome',\n 'TG' => 'Africa/Lome',\n 'OM' => 'Asia/Muscat',\n 'LK' => 'Asia/Colombo',\n 'KH' => 'Asia/Phnom_Penh',\n 'LA' => 'Asia/Vientiane',\n 'TH' => 'Asia/Bangkok',\n 'KP' => 'Asia/Pyongyang',\n ];\n $this->assertEquals($result, $value);\n\n $value = Zend_Locale_Data::getContent('de_AT', 'timezonetoterritory', 'GU');\n $this->assertEquals(\"Pacific/Guam\", $value);\n }",
"public function testProperty()\n {\n $model = new ModelInstance();\n\n self::assertNull($model->dateTimezoneTest);\n\n $model->dateTimezoneTest = 'America/Chicago';\n self::assertEquals(\n 'America/Chicago',\n $model->dateTimezoneTest->getName()\n );\n\n $model->dateTimezoneTest = 'America/New_York';\n self::assertEquals(\n 'America/New_York',\n $model->dateTimezoneTest->getName()\n );\n\n $model->dateTimezoneTest = 'asdf';\n self::assertNull($model->dateTimezoneTest);\n }",
"public function setTimezone($value);",
"public function testCityToTimezone()\n {\n $value = Zend_Locale_Data::getList('de_AT', 'citytotimezone');\n $result = [\n 'Etc/Unknown' => 'Unbekannt',\n 'Europe/Tirane' => 'Tirana',\n 'Asia/Yerevan' => 'Erivan',\n 'Antarctica/Vostok' => 'Wostok',\n 'Antarctica/DumontDUrville' => 'Dumont D\\'Urville',\n 'Europe/Vienna' => 'Wien',\n 'Europe/Brussels' => 'Brüssel',\n 'Africa/Ouagadougou' => 'Wagadugu',\n 'Africa/Porto-Novo' => 'Porto Novo',\n 'America/St_Barthelemy' => 'Saint-Barthélemy',\n 'Atlantic/Bermuda' => 'Bermudas',\n 'America/Sao_Paulo' => 'São Paulo',\n 'America/Coral_Harbour' => 'Atikokan',\n 'America/St_Johns' => 'St. John\\'s',\n 'Europe/Zurich' => 'Zürich',\n 'Pacific/Easter' => 'Osterinsel',\n 'Asia/Kashgar' => 'Kaxgar',\n 'America/Bogota' => 'Bogotá',\n 'America/Havana' => 'Havanna',\n 'Atlantic/Cape_Verde' => 'Kap Verde',\n 'America/Curacao' => 'Curaçao',\n 'Indian/Christmas' => 'Weihnachts-Inseln',\n 'Asia/Nicosia' => 'Nikosia',\n 'Europe/Prague' => 'Prag',\n 'Europe/Busingen' => 'Büsingen',\n 'Africa/Djibouti' => 'Dschibuti',\n 'Europe/Copenhagen' => 'Kopenhagen',\n 'Africa/Algiers' => 'Algier',\n 'Africa/Cairo' => 'Kairo',\n 'Africa/El_Aaiun' => 'El Aaiún',\n 'Africa/Asmera' => 'Asmara',\n 'Atlantic/Canary' => 'Kanaren',\n 'Africa/Addis_Ababa' => 'Addis Abeba',\n 'Pacific/Fiji' => 'Fidschi',\n 'Pacific/Truk' => 'Chuuk',\n 'Pacific/Ponape' => 'Pohnpei',\n 'Atlantic/Faeroe' => 'Färöer',\n 'Asia/Tbilisi' => 'Tiflis',\n 'Africa/Accra' => 'Akkra',\n 'America/Godthab' => 'Nuuk',\n 'America/Scoresbysund' => 'Ittoqqortoormiit',\n 'Europe/Athens' => 'Athen',\n 'Atlantic/South_Georgia' => 'Süd-Georgien',\n 'Asia/Hong_Kong' => 'Hongkong',\n 'Asia/Jayapura' => 'Port Numbay',\n 'Asia/Calcutta' => 'Kolkata',\n 'Asia/Baghdad' => 'Bagdad',\n 'Asia/Tehran' => 'Teheran',\n 'Atlantic/Reykjavik' => 'Reykjavík',\n 'Europe/Rome' => 'Rom',\n 'America/Jamaica' => 'Jamaika',\n 'Asia/Tokyo' => 'Tokio',\n 'Asia/Bishkek' => 'Bischkek',\n 'Indian/Comoro' => 'Komoren',\n 'America/St_Kitts' => 'St. Kitts',\n 'Asia/Pyongyang' => 'Pjöngjang',\n 'America/Cayman' => 'Kaimaninseln',\n 'Asia/Aqtobe' => 'Aktobe',\n 'America/St_Lucia' => 'St. Lucia',\n 'Europe/Vilnius' => 'Wilna',\n 'Europe/Luxembourg' => 'Luxemburg',\n 'Africa/Tripoli' => 'Tripolis',\n 'Europe/Chisinau' => 'Kischinau',\n 'Asia/Macau' => 'Macao',\n 'Indian/Maldives' => 'Malediven',\n 'America/Mexico_City' => 'Mexiko-Stadt',\n 'Asia/Katmandu' => 'Kathmandu',\n 'Asia/Muscat' => 'Muskat',\n 'Europe/Warsaw' => 'Warschau',\n 'Atlantic/Azores' => 'Azoren',\n 'Europe/Lisbon' => 'Lissabon',\n 'America/Asuncion' => 'Asunción',\n 'Asia/Qatar' => 'Katar',\n 'Indian/Reunion' => 'Réunion',\n 'Europe/Bucharest' => 'Bukarest',\n 'Europe/Belgrade' => 'Belgrad',\n 'Europe/Moscow' => 'Moskau',\n 'Europe/Volgograd' => 'Wolgograd',\n 'Asia/Yekaterinburg' => 'Jekaterinburg',\n 'Asia/Novosibirsk' => 'Nowosibirsk',\n 'Asia/Novokuznetsk' => 'Nowokuznetsk',\n 'Asia/Krasnoyarsk' => 'Krasnojarsk',\n 'Asia/Yakutsk' => 'Jakutsk',\n 'Asia/Vladivostok' => 'Wladiwostok',\n 'Asia/Sakhalin' => 'Sachalin',\n 'Asia/Kamchatka' => 'Kamtschatka',\n 'Asia/Riyadh' => 'Riad',\n 'Africa/Khartoum' => 'Khartum',\n 'Asia/Singapore' => 'Singapur',\n 'Atlantic/St_Helena' => 'St. Helena',\n 'Africa/Mogadishu' => 'Mogadischu',\n 'Africa/Sao_Tome' => 'São Tomé',\n 'America/El_Salvador' => 'Salvador',\n 'America/Lower_Princes' => 'Lower Prince\\'s Quarter',\n 'Asia/Damascus' => 'Damaskus',\n 'Africa/Lome' => 'Lomé',\n 'Asia/Dushanbe' => 'Duschanbe',\n 'America/Port_of_Spain' => 'Port-of-Spain',\n 'Asia/Taipei' => 'Taipeh',\n 'Africa/Dar_es_Salaam' => 'Daressalam',\n 'Europe/Uzhgorod' => 'Uschgorod',\n 'Europe/Kiev' => 'Kiew',\n 'Europe/Zaporozhye' => 'Saporischja',\n 'America/North_Dakota/Beulah' => 'Beulah, North Dakota',\n 'America/North_Dakota/New_Salem' => 'New Salem, North Dakota',\n 'America/North_Dakota/Center' => 'Center, North Dakota',\n 'America/Indiana/Vincennes' => 'Vincennes, Indiana',\n 'America/Indiana/Petersburg' => 'Petersburg, Indiana',\n 'America/Indiana/Tell_City' => 'Tell City, Indiana',\n 'America/Indiana/Knox' => 'Knox, Indiana',\n 'America/Indiana/Winamac' => 'Winamac, Indiana',\n 'America/Indiana/Marengo' => 'Marengo, Indiana',\n 'America/Indiana/Vevay' => 'Vevay, Indiana',\n 'America/Kentucky/Monticello' => 'Monticello, Kentucky',\n 'Asia/Tashkent' => 'Taschkent',\n 'Europe/Vatican' => 'Vatikan',\n 'America/St_Vincent' => 'St. Vincent',\n 'America/St_Thomas' => 'St. Thomas',\n 'Asia/Saigon' => 'Ho-Chi-Minh-Stadt',\n ];\n $this->assertEquals($result, $value, var_export($value, 1));\n\n $value = Zend_Locale_Data::getContent('de_AT', 'citytotimezone', 'Pacific/Fiji');\n $this->assertEquals(\"Fidschi\", $value);\n }",
"public function testTerritoryToTimezone()\n {\n $value = Zend_Locale_Data::getList('de_AT', 'territorytotimezone');\n $result = ['America/Rio_Branco' => '001', 'Asia/Kabul' => '001',\n 'Africa/Maputo' => '001', 'Africa/Bujumbura' => 'BI', 'Africa/Gaborone' => 'BW',\n 'Africa/Lubumbashi' => 'CD', 'Africa/Blantyre' => 'MW', 'Africa/Kigali' => 'RW',\n 'Africa/Lusaka' => 'ZM', 'Africa/Harare' => 'ZW', 'Africa/Nairobi' => '001',\n 'Africa/Djibouti' => 'DJ', 'Africa/Asmera' => 'ER', 'Africa/Addis_Ababa' => 'ET',\n 'Indian/Comoro' => 'KM', 'Indian/Antananarivo' => 'MG', 'Africa/Mogadishu' => 'SO',\n 'Africa/Dar_es_Salaam' => 'TZ', 'Africa/Kampala' => 'UG', 'Indian/Mayotte' => 'YT',\n 'Africa/El_Aaiun' => '001', 'Africa/Johannesburg' => '001', 'Africa/Maseru' => 'LS',\n 'Africa/Mbabane' => 'SZ', 'Africa/Lagos' => '001', 'Africa/Luanda' => 'AO',\n 'Africa/Porto-Novo' => 'BJ', 'Africa/Kinshasa' => 'CD', 'Africa/Bangui' => 'CF',\n 'Africa/Brazzaville' => 'CG', 'Africa/Douala' => 'CM', 'Africa/Libreville' => 'GA',\n 'Africa/Malabo' => 'GQ', 'Africa/Niamey' => 'NE', 'Africa/Ndjamena' => 'TD',\n 'Asia/Aqtobe' => '001', 'America/Juneau' => '001', 'America/Anchorage' => '001',\n 'Asia/Almaty' => '001', 'America/Manaus' => '001', 'America/Chicago' => '001',\n 'America/Belize' => 'BZ', 'America/Winnipeg' => 'CA', 'America/Costa_Rica' => 'CR',\n 'America/Guatemala' => 'GT', 'America/Tegucigalpa' => 'HN', 'America/Mexico_City' => 'MX',\n 'America/El_Salvador' => 'SV', 'America/New_York' => '001', 'America/Nassau' => 'BS',\n 'America/Toronto' => 'CA', 'America/Port-au-Prince' => 'HT', 'America/Jamaica' => 'JM',\n 'America/Cayman' => 'KY', 'America/Panama' => 'PA', 'America/Grand_Turk' => 'TC',\n 'America/Denver' => '001', 'America/Edmonton' => 'CA',\n 'America/Hermosillo' => 'MX',\n 'America/Los_Angeles' => '001',\n 'America/Vancouver' => 'CA',\n 'America/Tijuana' => 'MX',\n 'Asia/Anadyr' => '001',\n 'Asia/Aqtau' => '001',\n 'Asia/Riyadh' => '001',\n 'Asia/Bahrain' => 'BH',\n 'Asia/Baghdad' => 'IQ',\n 'Asia/Kuwait' => 'KW',\n 'Asia/Qatar' => 'QA',\n 'Asia/Aden' => 'YE',\n 'America/Buenos_Aires' => '001',\n 'America/Argentina/San_Luis' => '001',\n 'Asia/Yerevan' => '001',\n 'Asia/Ashgabat' => '001',\n 'America/Halifax' => '001',\n 'America/Antigua' => 'AG',\n 'America/Anguilla' => 'AI',\n 'America/Curacao' => 'AN',\n 'America/Aruba' => 'AW',\n 'America/Barbados' => 'BB',\n 'Atlantic/Bermuda' => 'BM',\n 'America/Kralendijk' => 'BQ',\n 'America/Dominica' => 'DM',\n 'America/Grenada' => 'GD',\n 'America/Thule' => 'GL',\n 'America/Guadeloupe' => 'GP',\n 'America/St_Kitts' => 'KN',\n 'America/St_Lucia' => 'LC',\n 'America/Marigot' => 'MF',\n 'America/Martinique' => 'MQ',\n 'America/Montserrat' => 'MS',\n 'America/Puerto_Rico' => 'PR',\n 'America/Lower_Princes' => 'SX',\n 'America/Port_of_Spain' => 'TT',\n 'America/St_Vincent' => 'VC',\n 'America/Tortola' => 'VG',\n 'America/St_Thomas' => 'VI',\n 'Australia/Adelaide' => '001',\n 'Australia/Eucla' => '001',\n 'Australia/Sydney' => '001',\n 'Australia/Perth' => '001',\n 'Asia/Baku' => '001',\n 'Atlantic/Azores' => '001',\n 'Asia/Dhaka' => '001',\n 'America/Adak' => '001',\n 'Asia/Thimphu' => '001',\n 'America/La_Paz' => '001',\n 'Asia/Kuching' => '001',\n 'America/Sao_Paulo' => '001',\n 'Europe/London' => '001',\n 'Asia/Brunei' => '001',\n 'Atlantic/Cape_Verde' => '001',\n 'Antarctica/Casey' => '001',\n 'Pacific/Saipan' => '001',\n 'Pacific/Guam' => 'GU',\n 'Asia/Harbin' => '001',\n 'Pacific/Chatham' => '001',\n 'America/Santiago' => '001',\n 'Antarctica/Palmer' => 'AQ',\n 'Asia/Shanghai' => '001',\n 'Asia/Choibalsan' => '001',\n 'Indian/Christmas' => '001',\n 'Indian/Cocos' => '001',\n 'America/Bogota' => '001',\n 'Pacific/Rarotonga' => '001',\n 'America/Havana' => '001',\n 'Antarctica/Davis' => '001',\n 'America/Santo_Domingo' => '001',\n 'Antarctica/DumontDUrville' => '001',\n 'Asia/Dushanbe' => '001',\n 'America/Paramaribo' => '001',\n 'Asia/Dili' => '001',\n 'Pacific/Easter' => '001',\n 'America/Guayaquil' => '001',\n 'Europe/Paris' => '001',\n 'Europe/Andorra' => 'AD',\n 'Europe/Tirane' => 'AL',\n 'Europe/Vienna' => 'AT',\n 'Europe/Sarajevo' => 'BA',\n 'Europe/Brussels' => 'BE',\n 'Europe/Zurich' => 'CH',\n 'Europe/Prague' => 'CZ',\n 'Europe/Berlin' => 'DE',\n 'Europe/Copenhagen' => 'DK',\n 'Europe/Madrid' => 'ES',\n 'Europe/Gibraltar' => 'GI',\n 'Europe/Zagreb' => 'HR',\n 'Europe/Budapest' => 'HU',\n 'Europe/Rome' => 'IT',\n 'Europe/Vaduz' => 'LI',\n 'Europe/Luxembourg' => 'LU',\n 'Europe/Monaco' => 'MC',\n 'Europe/Podgorica' => 'ME',\n 'Europe/Skopje' => 'MK',\n 'Europe/Malta' => 'MT',\n 'Europe/Amsterdam' => 'NL',\n 'Europe/Oslo' => 'NO',\n 'Europe/Warsaw' => 'PL',\n 'Europe/Belgrade' => 'RS',\n 'Europe/Stockholm' => 'SE',\n 'Europe/Ljubljana' => 'SI',\n 'Europe/Bratislava' => 'SK',\n 'Europe/San_Marino' => 'SM',\n 'Africa/Tunis' => 'TN',\n 'Europe/Vatican' => 'VA',\n 'Europe/Bucharest' => '001',\n 'Europe/Mariehamn' => 'AX',\n 'Europe/Sofia' => 'BG',\n 'Asia/Nicosia' => 'CY',\n 'Africa/Cairo' => 'EG',\n 'Europe/Helsinki' => 'FI',\n 'Europe/Athens' => 'GR',\n 'Asia/Amman' => 'JO',\n 'Asia/Beirut' => 'LB',\n 'Asia/Damascus' => 'SY',\n 'Atlantic/Canary' => '001',\n 'Atlantic/Faeroe' => 'FO',\n 'Atlantic/Stanley' => '001',\n 'Pacific/Fiji' => '001',\n 'America/Cayenne' => '001',\n 'Indian/Kerguelen' => '001',\n 'Asia/Bishkek' => '001',\n 'Pacific/Galapagos' => '001',\n 'Pacific/Gambier' => '001',\n 'Asia/Tbilisi' => '001',\n 'Pacific/Tarawa' => '001',\n 'Atlantic/Reykjavik' => '001',\n 'Africa/Ouagadougou' => 'BF',\n 'Africa/Abidjan' => 'CI',\n 'Africa/Accra' => 'GH',\n 'Africa/Banjul' => 'GM',\n 'Africa/Conakry' => 'GN',\n 'Europe/Dublin' => 'IE',\n 'Africa/Bamako' => 'ML',\n 'Africa/Nouakchott' => 'MR',\n 'Atlantic/St_Helena' => 'SH',\n 'Africa/Freetown' => 'SL',\n 'Africa/Dakar' => 'SN',\n 'Africa/Sao_Tome' => 'ST',\n 'Africa/Lome' => 'TG',\n 'America/Goose_Bay' => '001',\n 'America/Scoresbysund' => '001',\n 'America/Godthab' => '001',\n 'Asia/Dubai' => '001',\n 'Asia/Muscat' => 'OM',\n 'America/Guyana' => '001',\n 'Pacific/Honolulu' => '001',\n 'Asia/Hong_Kong' => '001',\n 'Asia/Hovd' => '001',\n 'Asia/Calcutta' => '001',\n 'Asia/Colombo' => 'LK',\n 'Indian/Chagos' => '001',\n 'Asia/Saigon' => '001',\n 'Asia/Phnom_Penh' => 'KH',\n 'Asia/Vientiane' => 'LA',\n 'Asia/Bangkok' => 'TH',\n 'Asia/Makassar' => '001',\n 'Asia/Jayapura' => '001',\n 'Asia/Jakarta' => '001',\n 'Asia/Tehran' => '001',\n 'Asia/Irkutsk' => '001',\n 'Asia/Jerusalem' => '001',\n 'Asia/Tokyo' => '001',\n 'Asia/Kamchatka' => '001',\n 'Asia/Karachi' => '001',\n 'Asia/Kashgar' => '001',\n 'Asia/Qyzylorda' => '001',\n 'Asia/Seoul' => '001',\n 'Asia/Pyongyang' => 'KP',\n 'Pacific/Kosrae' => '001',\n 'Asia/Krasnoyarsk' => '001',\n 'Europe/Samara' => '001',\n 'Pacific/Kwajalein' => '001',\n 'Africa/Monrovia' => '001',\n 'Pacific/Kiritimati' => '001',\n 'Asia/Chongqing' => '001',\n 'Australia/Lord_Howe' => '001',\n 'Asia/Macau' => '001',\n 'Antarctica/Macquarie' => '001',\n 'Asia/Magadan' => '001',\n 'Asia/Kuala_Lumpur' => '001',\n 'Indian/Maldives' => '001',\n 'Pacific/Marquesas' => '001',\n 'Pacific/Majuro' => '001',\n 'Indian/Mauritius' => '001',\n 'Antarctica/Mawson' => '001',\n 'America/Santa_Isabel' => '001',\n 'America/Mazatlan' => '001',\n 'Asia/Ulaanbaatar' => '001',\n 'Europe/Moscow' => '001',\n 'Asia/Rangoon' => '001',\n 'Pacific/Nauru' => '001',\n 'Asia/Katmandu' => '001',\n 'Pacific/Noumea' => '001',\n 'Pacific/Auckland' => '001',\n 'Antarctica/McMurdo' => 'AQ',\n 'America/St_Johns' => '001',\n 'Pacific/Niue' => '001',\n 'Pacific/Norfolk' => '001',\n 'America/Noronha' => '001',\n 'Asia/Novosibirsk' => '001',\n 'Asia/Omsk' => '001',\n 'Asia/Oral' => '001',\n 'Pacific/Palau' => '001',\n 'Pacific/Port_Moresby' => '001',\n 'America/Asuncion' => '001',\n 'America/Lima' => '001',\n 'Asia/Manila' => '001',\n 'Pacific/Enderbury' => '001',\n 'America/Miquelon' => '001',\n 'Pacific/Pitcairn' => '001',\n 'Pacific/Ponape' => '001',\n 'Indian/Reunion' => '001',\n 'Antarctica/Rothera' => '001',\n 'Asia/Sakhalin' => '001',\n 'Asia/Samarkand' => '001',\n 'Pacific/Apia' => '001',\n 'Indian/Mahe' => '001',\n 'Asia/Singapore' => '001',\n 'Pacific/Guadalcanal' => '001',\n 'Atlantic/South_Georgia' => '001',\n 'Asia/Yekaterinburg' => '001',\n 'Antarctica/Syowa' => '001',\n 'Pacific/Tahiti' => '001',\n 'Asia/Taipei' => '001',\n 'Asia/Tashkent' => '001',\n 'Pacific/Fakaofo' => '001',\n 'Pacific/Tongatapu' => '001',\n 'Pacific/Truk' => '001',\n 'Europe/Istanbul' => '001',\n 'Pacific/Funafuti' => '001',\n 'America/Montevideo' => '001',\n 'Asia/Urumqi' => '001',\n 'Pacific/Efate' => '001',\n 'America/Caracas' => '001',\n 'Asia/Vladivostok' => '001',\n 'Europe/Volgograd' => '001',\n 'Antarctica/Vostok' => '001',\n 'Pacific/Wake' => '001',\n 'Pacific/Wallis' => '001',\n 'Asia/Yakutsk' => '001',\n 'America/Yakutat' => '001'];\n $this->assertEquals($result, $value);\n\n $value = Zend_Locale_Data::getContent('de_AT', 'territorytotimezone', 'Antarctica/Vostok');\n $this->assertEquals(\"001\", $value);\n }",
"public function __construct()\n {\n date_default_timezone_set('UTC');\n parent::__construct();\n }",
"public function supportsTimezoneOverride() {\n\t\treturn $this->realConn->supportsTimezoneOverride();\n\t}",
"public function __construct()\n {\n date_default_timezone_set(get_company_option('timezone', get_option('timezone','Asia/tehran')));\n\n }",
"public function setTimezone($timezone): self;",
"public function testNotSameTimeZone(){\n $date = new \\DateTime();\n $boolean = DateTimeValidator::timeZone($date, 'Asia/Tokyo');\n $this->assertFalse($boolean);\n }",
"public function testDefaultTimezone()\n {\n $this->assertSame('UTC', Data_Reader::$default_timezone);\n }",
"public function convertUTCToTZ()\n {\n\n }",
"public function testGetSetTimezone() {\n $ic = new ICalTimezoneGenerator();\n $timestamp = 'Y-m-D H:i:s';\n $ic->setTimestampFormat($timestamp);\n $this->assertEquals($timestamp, $ic->getTimestampFormat());\n }",
"protected function setTimezone()\n {\n $setter = new TimezoneSetter();\n $setter->register();\n }",
"public function timestampsTz()\n {\n $this->timestampTz('created_at');\n\n $this->timestampTz('updated_at');\n }",
"public function __construct()\n {\n parent::__construct();\n date_default_timezone_set(SYSTEM_TIMEZONE);\n }",
"public function hasTimezone(): bool;",
"public function __construct()\n {\n parent::__construct();\n date_default_timezone_set('Asia/Jakarta');\n }",
"public static function setTimezone(){\n $tz = Sys::get('config')->timezone;\n if(ThisUser::islogged()){\n $utz = ThisUser::get(\"timezone\");\n if(!empty($utz)){\n $tz = $utz;\n }\n }\n if(!in_array($tz,timezone_identifiers_list()))\n $tz = \"UTC\";\n date_default_timezone_set($tz);\n // Adjust in DB\n //Sys::$Db->setTimezone();\n }",
"public function testAddZoneAudit()\n {\n }",
"public function testGetDefaultTimezone() {\n $ic = new ICalTimezoneGenerator();\n $this->assertAttributeEquals($ic->getTimestampFormat(),\n 'timestampFormat',\n $ic);\n }",
"function timezone()\n {\n return resolve(TimezoneHelper::class);\n }",
"public function provides()\n {\n return ['timezones'];\n }",
"public function getTimezone(){\n\t\treturn parent::getSingleValue('2');\n\t}"
] | [
"0.76220787",
"0.7244942",
"0.65219223",
"0.6207172",
"0.61827457",
"0.613578",
"0.60950625",
"0.6046181",
"0.60056126",
"0.6000204",
"0.59915954",
"0.59810996",
"0.59744984",
"0.5964459",
"0.59192204",
"0.58990496",
"0.5884279",
"0.5860231",
"0.5853834",
"0.58513755",
"0.5816835",
"0.58119416",
"0.58027136",
"0.5753059",
"0.5720036",
"0.5716496",
"0.56790763",
"0.5668177",
"0.56641066",
"0.56626177"
] | 0.7901571 | 0 |
Is classic editor ? | private static function is_classic() {
if ( isset( $_GET['classic-editor'] ) ) {
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function isEditor()\n {\n if (php_uname('n') === 'eurybe' /*&& PHP_SAPI == 'cli'*/) {\n // for now only allow editing on phoebe\n return true;\n }\n if (php_uname('n') === 'phoebe' /*&& PHP_SAPI == 'cli'*/) {\n // for now only allow editing on phoebe\n return true;\n }\n \n return false;\n }",
"public function is_editor($allowed_editors) {\n\t\treturn true;\n\n\t}",
"public function isInteractiveContent() : bool;",
"public static function is_gb_editor() {\r\n\r\n\t\t// TODO: Find a better way to check if is GB editor API call.\r\n\t\treturn defined( 'REST_REQUEST' ) && REST_REQUEST && ! empty( $_REQUEST['context'] ) && 'edit' === $_REQUEST['context']; // phpcs:ignore\r\n\t}",
"public function editor();",
"function is_wysiwyg($type = null)\n\t{\n\t\tif ($type == null)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn ($this->type == $type);\n\t\t}\n\t}",
"public static function isLayoutEditorExists(){\r\n\t\t\r\n\t\t$classExists = class_exists(\"LayoutEditorGlobals\");\r\n\t\tif($classExists == true)\r\n\t\t\treturn(true);\r\n\t\r\n\t\treturn(false);\r\n\t}",
"public function isInteractive();",
"public function isInteractive();",
"function moments_qodef_is_gutenberg_editor() {\n\t\treturn class_exists( 'WP_Block_Type' );\n\t}",
"public function debug_editor( $block_editor = true ) : bool {\n\t\t$show_legacy = \\filter_input( INPUT_GET, 'disable-editor', FILTER_VALIDATE_BOOLEAN );\n\n\t\tif ( $show_legacy ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $block_editor;\n\t}",
"public function getEditor();",
"private static function isCodeMirrorOnPage( IContextSource $context ) {\n\t\treturn in_array( Action::getActionName( $context ), [ 'edit', 'submit' ] ) &&\n\t\t\t// CodeMirror on textarea wikitext editors doesn't support RTL (T170001)\n\t\t\t!$context->getTitle()->getPageLanguage()->isRTL();\n\t}",
"public function getIsEditor()\n {\n return $this->hasRole(Role::GROUP_EDITOR);\n }",
"function bbp_use_wp_editor($default = 1)\n{\n}",
"public function getTypeEditor($book)\n\t{\n\t\treturn $book->bookable_type == 'App\\Models\\Editor';\n\t}",
"function disabled_rich_editor($allow_rich_editor) {\n\t\tglobal $post;\n\n\t\tif($post->post_name == 'contact') {\n\t\t\treturn false;\t\t \n\t\t}\n\t\treturn $allow_rich_editor;\n\t}",
"public function isEdit()\n {\n return ($this->section && $this->docname && $this->content);\n }",
"public function isEditing()\n {\n return $this->isMode(static::MODE_EDIT);\n }",
"public function classicEditorStyle()\n {\n add_editor_style(get_stylesheet_directory_uri() . td_asset_path('/css/classic-editor.css'));\n }",
"function tinyMceEditor() {\n\n $init = '\n mode : \"textareas\",\n theme : \"advanced\",\n editor_selector : \"mceEditor\",\n plugins : \"safari,paste,inlinepopups,autosave\",\n width: \"100%\",\n height: 100,\n theme_advanced_toolbar_location : \"top\",\n theme_advanced_toolbar_align : \"left\",\n theme_advanced_buttons1 : \"undo,redo,pastetext,pasteword,selectall,|,bold,italic,underline,strikethrough,|,link,unlink,|,cleanup,code\",\n theme_advanced_buttons2 : \"\",\n theme_advanced_buttons3 : \"\",\n theme_advanced_statusbar_location : \"bottom\",\n entity_encoding : \"raw\",\n relative_urls : false,\n inline_styles : false,\n ';\n return $this->tinyMceInit($init);\n\n }",
"public static function wysiwyg() {\n\t}",
"public function is_code_field(){\n\t\treturn ( $this->ui == \"code\" );\n\t}",
"public function isEdit()\n {\n return $this->getMode() === static::MODE_EDIT;\n }",
"public function isEditable(): bool;",
"public function setEditor( $name );",
"public function isEditable () : bool {\n return true;\n }",
"public function isEdited();",
"abstract function isEditable();",
"public function isInteractive() {\n return false;\n }"
] | [
"0.7475971",
"0.6888979",
"0.6607554",
"0.65956813",
"0.64745116",
"0.6318188",
"0.62467134",
"0.6213083",
"0.6213083",
"0.6208498",
"0.61855096",
"0.612243",
"0.6061671",
"0.60348976",
"0.6019327",
"0.5991226",
"0.5909726",
"0.58881825",
"0.5867486",
"0.5779686",
"0.5759341",
"0.5723832",
"0.5695674",
"0.56797945",
"0.5669326",
"0.5655021",
"0.56487745",
"0.56417066",
"0.56270134",
"0.5624502"
] | 0.7968095 | 0 |
Get the edited post ID (early) when loading the Edit Post screen. | private static function get_edited_post_id() {
if ( !empty( $_GET['post'] ) &&
!empty( $_GET['action'] ) &&
$_GET['action'] === 'edit' &&
!empty( $GLOBALS['pagenow'] ) &&
$GLOBALS['pagenow'] === 'post.php' ) {
return (int) $_GET['post']; // post_ID
}
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_post_id()\n {\n global $post;\n return $this->post_id = $post->ID;\n }",
"public function get_post_id() {\n\t\treturn $this->post_id;\n\t}",
"function get_edit_post_link() {\n\t\treturn add_query_arg( 'edit', $this->force_get_nonce( 'edit' ), $this->get_permalink() );\n\t}",
"function id() {\n\t\treturn (int) $this->_post->ID;\n\t}",
"public function edit($postID){\n\n $entry = Post::find($postID);\n\n\t\t$this->authorize('update', $entry);\n\t\t\n $entry->title = Input::get('postTitle');\n $entry->type = Input::get('postType');\n $entry->content = Input::get('cont');\n $entry->description = Input::get('shortDescr');\n\n $entry->save();\n\n return Redirect::route('showPost', ['postID'=>$postID]);\n }",
"public function getId_post()\n {\n return $this->id_post;\n }",
"public function edit(post $post)\n {\n //\n }",
"public function edit(post $post)\n {\n //\n }",
"public function edit() {\n\t\t\t$myPost = MyPosts::find($this->request->args[0]);\n\t\t\t\n\t\t\t//if the post couldn't be fetched, redirect to index\n\t\t\tif (!$myPost) {\n\t\t\t\t$this->redirect('MyPosts::index');\n\t\t\t}\n\t\t\t\n\t\t\t//If we have post data, attempt to save\n\t\t\tif (($this->request->data) && $myPost->save($this->request->data)) {\n\t\t\t\t//If save was successful, redirect to the new post\n\t\t\t\t$this->redirect( array(\n\t\t\t\t'MyPosts::view', \n\t\t\t\t'args' => array($myPost->id)\n\t\t\t\t));\n\t\t\t}\n\t\t\t\n\t\t\t//If we haven't been redirected, then send the post info to the view\n\t\t\treturn compact('myPost');\n\t\t}",
"public function getEditObjectId()\n {\n if (null === ($sId = $this->_sEditObjectId)) {\n if (null === ($sId = marm_shopgate::getRequestParameter(\"oxid\"))) {\n /** @noinspection PhpUndefinedMethodInspection */\n $sId = marm_shopgate::getSessionVar(\"saved_oxid\");\n }\n }\n\n return $sId;\n }",
"public function edit(Post $post)\n {\n //\n }",
"public function edit(Post $post)\n {\n //\n }",
"public function edit(Post $post)\n {\n //\n }",
"public function edit(Post $post)\n {\n //\n }",
"public function edit(Post $post)\n {\n //\n }",
"public function edit(Post $post)\n {\n //\n }",
"public function edit(Post $post)\n {\n //\n }",
"public function edit(Post $post)\n {\n //\n }",
"public function edit(Post $post)\n {\n //\n }",
"public function edit(Post $post)\n {\n //\n }",
"public function edit(Post $post)\n {\n //\n }",
"public function edit(Post $post)\n {\n //\n }",
"public function edit(Post $post)\n {\n //\n }",
"public function edit(Post $post)\n {\n //\n }",
"public function edit(Post $post)\n {\n //\n }",
"public function edit(Post $post)\n {\n //\n }",
"public function edit(Post $post)\n {\n //\n }",
"public function edit(Post $post)\n {\n //\n }",
"public function editPost()\n {\n $session = new PHPSession();\n\t\tif ($session->get('admin') == NULL || !$session->get('admin')) {\n return $this->redirect(parent::ERROR_403_PATH);\n }\n $postManager = new PostManager('Post');\n $post = $postManager->getBySlug($_GET['slug']);\n\n $handlerPicture = new HandlerPicture();\n $picture = $handlerPicture->searchPicture($post->getDatePublication());\n\n $uuid = Uuid::uuid4();\n $uuid = $uuid->toString();\n $session->set('token', $uuid);\n\n return $this->render('admin/editPost.html.twig', [\n 'post' => $post,\n 'picture' => $picture\n ]);\n }",
"public function getPost_id()\n {\n return $this->post_id;\n }"
] | [
"0.6904256",
"0.676462",
"0.67640847",
"0.6748867",
"0.6746103",
"0.6736478",
"0.67008317",
"0.67008317",
"0.6684632",
"0.6684304",
"0.6680986",
"0.6680986",
"0.6680986",
"0.6680986",
"0.6680986",
"0.6680986",
"0.6680986",
"0.6680986",
"0.6680986",
"0.6680986",
"0.6680986",
"0.6680986",
"0.6680986",
"0.6680986",
"0.6680986",
"0.6680986",
"0.6680986",
"0.6680986",
"0.6662322",
"0.6661236"
] | 0.8724096 | 0 |
Output only. Unique identifier of the `DeliveryPipeline`. Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; | public function getUid()
{
return $this->uid;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUid() {\n\t\treturn $this->uid;\n\t}",
"public function getUid() {\n\t\treturn $this->uid;\n\t}",
"public function getUid()\n\t{\n\t\treturn $this->uid;\n\t}",
"public function getUid()\n\t{\n\t\treturn $this->uid;\n\t}",
"public function getUid()\n {\n return $this->_uid;\n }",
"public function getToUid();",
"public function getUID()\n {\n return $this->UID;\n }",
"public function getUid() {\n\t\treturn $this -> data['UID'];\n\t}",
"public function getUid() {\n return $this->get('uid');\n }",
"public function getGenerationUuid()\n {\n return $this->generationUuid;\n }",
"public function getFlowUuid()\n {\n return $this->flowUuid;\n }",
"public function uid() {\n\t\treturn $this->unique();\n\t}",
"public function uid() { return $this->_m_uid; }",
"public function get_uid() {\n return $this->uid;\n }",
"public function getUid()\n\t{\n\t\treturn $this->getField('uid');\n\t}",
"function getToUserID() {\n\t\treturn $this->_ToUserID;\n\t}",
"public function getUid() {\n return $this->get(self::UID);\n }",
"public function getUid() {\n return $this->get(self::UID);\n }",
"protected function get_unique_id() {\n\t\treturn sha1( serialize( $this->callback ) . serialize( $this->params ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize\n\t}",
"public function getUUID()\n {\n return $this->uUID;\n }",
"public function getUUID()\n {\n return $this->uUID;\n }",
"public function getUUID()\n {\n return $this->uUID;\n }",
"function getUID()\n {\n return $this->_uid;\n }",
"public function getUid()\n {\n return $this->get(self::UID);\n }",
"public function getUid()\n {\n return $this->get(self::UID);\n }",
"public function getPusherUsrId()\n {\n return $this->pusherUsrId;\n }",
"public static function userId()\n {\n return self::payloadUser('id');\n }",
"public function getUserIdentifier(): string\n {\n return (string) $this->output;\n }",
"public function getUniqueEmailMessageId()\n\t{\n\t\t$uid = 'TAC-' . $this->getAccessCode() . '.';\n\t\t$uid .= uniqid('', true) . '-' . App::getSetting('core.site_id');\n\t\t$uid .= '@' . md5(App::getSetting('core.site_url', 'deskpro'));\n\n\t\treturn $uid;\n\t}",
"public function getUniqueID()\n {\n return $this->uniqueID;\n }"
] | [
"0.5321296",
"0.5321296",
"0.52813363",
"0.52813363",
"0.5267061",
"0.51855415",
"0.517839",
"0.51567566",
"0.5125283",
"0.5120821",
"0.50948286",
"0.50740236",
"0.50530976",
"0.5043794",
"0.50429404",
"0.5030721",
"0.49948063",
"0.49948063",
"0.4988055",
"0.49784207",
"0.49784207",
"0.49784207",
"0.49702168",
"0.49546522",
"0.49546522",
"0.49539405",
"0.48970604",
"0.48008445",
"0.4798313",
"0.47957486"
] | 0.53238547 | 0 |
User annotations. These attributes can only be set and used by the user, and not by Cloud Deploy. Generated from protobuf field map annotations = 4; | public function setAnnotations($var)
{
$arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
$this->annotations = $arr;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function annotate(array $annotations)\n {\n }",
"public function getAnnotations()\n {\n return $this->annotations;\n }",
"public function getAnnotations()\n {\n return $this->annotations;\n }",
"public static function ignoreAnnotations() {}",
"abstract public function annotate(array $annotations);",
"public function getAnnotations(){ }",
"public function getAnnotations() : array\n {\n return $this->annotations;\n }",
"public function setAnnotations(array $annotations) : self\n {\n $this->initialized['annotations'] = true;\n $this->annotations = $annotations;\n return $this;\n }",
"public function getAnnotations() {\n\t\tif(count($this->annotations) < 1) $this->annotations = $this->parser->getParams();\t// Get all the annotations\n\t\t\n\t\treturn $this->annotations;\n\t}",
"public function getAnnotations() {\n\t\tif(count($this->annotations) < 1) $this->annotations = $this->parser->getParams();\t// Get all the annotations\n\t\t\n\t\treturn $this->annotations;\n\t}",
"public function getAnnotations() {\n\t\tif(count($this->annotations) < 1) $this->annotations = $this->parser->getParams();\t// Get all the annotations\n\t\t\n\t\treturn $this->annotations;\n\t}",
"public function setUserLabels($var)\n {\n $arr = GPBUtil::checkMapField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->user_labels = $arr;\n\n return $this;\n }",
"public function setUserLabels($var)\n {\n $arr = GPBUtil::checkMapField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->user_labels = $arr;\n\n return $this;\n }",
"public function getAnnotations($annotation_name = null);",
"public static function getAdditionalValues()\r\n\t{\r\n\t\treturn array(\r\n\t\t\t'ANNOTATION' => self::ANNOTATION,\r\n\t\t);\r\n\t}",
"protected function getUserAttributes() {\n return array_map('trim', explode(\"\\r\\n\", $this->userSettings->get('user_mapping.attributes')));\n }",
"public function canAnnotate($user_guid = 0, $annotation_name = '') {\n\t\treturn _elgg_services()->userCapabilities->canAnnotate($this, $user_guid, $annotation_name);\n\t}",
"protected function parse_annotations() {\n\t\t$class = new \\ReflectionClass( static::class );\n\t\t$properties = $class->getProperties( \\ReflectionProperty::IS_PUBLIC );\n\t\tforeach ( $properties as $property ) {\n\t\t\t$doc_block = $property->getDocComment();\n\t\t\tif ( ! stristr( $doc_block, '@property' ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$this->annotations[ $property->getName() ] = array(\n\t\t\t\t'type' => $this->parse_annotations_var( $doc_block ),\n\t\t\t\t'sanitize' => $this->parse_annotation_sanitize( $doc_block ),\n\t\t\t\t'rule' => $this->parse_annotation_rule( $doc_block ),\n\t\t\t);\n\t\t}\n\t}",
"public function setAnnotation($var) {}",
"private function assignAnnotations(): void\n {\n $swagResponses = array_filter($this->annotations, function ($annotation) {\n return $annotation instanceof SwagResponseSchema;\n });\n\n foreach ($swagResponses as $annotate) {\n $mimeTypes = $annotate->mimeTypes;\n if (empty($mimeTypes)) {\n $mimeTypes = $this->config->getResponseContentTypes();\n }\n\n foreach ($mimeTypes as $mimeType) {\n $content = (new Content())->setMimeType($mimeType);\n\n $response = (new Response())->setCode($annotate->httpCode)->setDescription($annotate->description);\n\n if (empty($annotate->schemaFormat) && empty($annotate->schemaItems) && empty($annotate->refEntity)) {\n $response->pushContent($content);\n $this->operation->pushResponse($response);\n continue;\n }\n\n $schema = $this->buildSchemaFromAnnotationAndMimeType($annotate, $mimeType);\n\n $content->setSchema($schema);\n\n $response->pushContent($content);\n\n $this->operation->pushResponse($response);\n }\n }\n }",
"private function parseValues($annotations, \\PHPUnit_Framework_TestCase $test)\n {\n $result = [];\n $typeList = self::getTypeList();\n foreach ($annotations as $subject) {\n if (!preg_match('/^([a-z_]+)\\s(enabled|disabled)$/', $subject, $matches)) {\n self::fail(\"Invalid @magentoCache declaration: '{$subject}'\", $test);\n }\n list(, $requestedType, $isEnabled) = $matches;\n $isEnabled = $isEnabled == 'enabled' ? 1 : 0;\n if ('all' === $requestedType) {\n $result = [];\n foreach ($typeList->getTypes() as $type) {\n $result[$type['id']] = $isEnabled;\n }\n } else {\n $result[$requestedType] = $isEnabled;\n }\n }\n return $result;\n }",
"public function annotate();",
"public function setCustomAttributes($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Sugarcrm\\Apis\\Iam\\User\\V1alpha\\CustomAttribute::class);\n $this->custom_attributes = $arr;\n\n return $this;\n }",
"public function getAnnotations()\n {\n $annotations = [];\n $tags = $this->getTags();\n $tagNames = array_keys($tags);\n foreach ($tagNames as $tagName) {\n if (empty($tags[$tagName])) {\n $annotations[] = $tagName;\n } elseif (is_array($tags[$tagName])) {\n foreach ($tags[$tagName] as $tagValue) {\n $annotations[] = $tagName . ' ' . $tagValue;\n }\n } else {\n $annotations[] = $tagName . ' ' . $tags[$tagName];\n }\n }\n return $annotations;\n }",
"abstract protected function prepareAnnotations(array $annotations, PdfObject\\PageObject $pageObject);",
"public function getAnnotation() {}",
"protected function userMapping() {\n $user_mapping = [];\n\n if ($user_mappings = $this->userMapping->get('user_mapping')) {\n foreach ($user_mappings as $field_name => $mapping) {\n if (empty($mapping['attribute'])) {\n continue;\n }\n\n $user_mapping[$field_name] = $mapping;\n }\n }\n\n return $user_mapping;\n }",
"public function listMylibraryAnnotations($optParams = array())\n {\n $params = array();\n $params = array_merge($params, $optParams);\n return $this->call('list', array($params), \"Books_Annotations\");\n }",
"public function get_users_scores_and_annotation_counts() {\n return $this->annotation->select(DB::raw('name, score, count(*) as annotation_count'))->get();\n }",
"public function setAnnotation(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Tracing\\V1\\Span_TimeEvent_Annotation::class);\n $this->writeOneof(2, $var);\n }"
] | [
"0.60545343",
"0.5864959",
"0.5864959",
"0.57794386",
"0.57556957",
"0.57154393",
"0.5711464",
"0.56425595",
"0.5542426",
"0.5542426",
"0.5542426",
"0.5472504",
"0.5472504",
"0.5295572",
"0.5266401",
"0.5187012",
"0.51652974",
"0.5060082",
"0.49934712",
"0.49590084",
"0.4956629",
"0.4901321",
"0.48744377",
"0.48402745",
"0.48382092",
"0.4787665",
"0.4765638",
"0.47639048",
"0.47522742",
"0.4746212"
] | 0.6152597 | 0 |
SerialPipeline defines a sequential set of stages for a `DeliveryPipeline`. Generated from protobuf field .google.cloud.deploy.v1.SerialPipeline serial_pipeline = 8; | public function getSerialPipeline()
{
return $this->readOneof(8);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setSerialPipeline($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Deploy\\V1\\SerialPipeline::class);\n $this->writeOneof(8, $var);\n\n return $this;\n }",
"public function setPrerequisiteStage($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->prerequisite_stage = $arr;\n\n return $this;\n }",
"public function getFlatPipeline()\n {\n return $this->flatPipeline;\n }",
"public function pipe(callable ...$stages) {\n $pipeline = clone $this;\n foreach ($stages as $stage) {\n $pipeline->stages[] = $stage;\n }\n return $pipeline;\n }",
"public function getPipeline(): array;",
"public static function getPipeline()\n {\n /** @var \\Bugsnag\\Client $instance */\n return $instance->getPipeline();\n }",
"public function setSerial($serial)\n {\n $this->serial = $serial;\n\n return $this;\n }",
"public function getSerial()\n {\n return $this->fields['serial'];\n }",
"public function ChangePipeline()\n\t{\n\t\t$customer = PipelineItems::where('pipelineStatus', \"true\")->select('customer.name', 'agent.name');\n\t\t$result = [];\n\t\t$customer->chunk(500, function ($properties) use (&$result) {\n\t\t\tforeach ($properties as $property) {\n\t\t\t\t$result[] = $property;\n\t\t\t}\n\t\t});\n\n\t\t// $leadList=LeadDetails::where('active',1)->taget();\n\t\tforeach ($result as $cust) {\n\t\t\t$custName = ltrim(ucwords(strtolower($cust->customer['name'])));\n\t\t\tif (isset($cust->agent)) {\n\t\t\t\t$agent = ltrim(ucwords(strtolower($cust->agent['name'])));\n\t\t\t\tPipelineItems::where('_id', new ObjectId($cust->_id))->update(array('agent.name' => $agent));\n\t\t\t}\n\t\t\tPipelineItems::where('_id', new ObjectId($cust->_id))->update(array('customer.name' => $custName));\n\t\t}\n\t\techo \"success\";\n\t}",
"public function getSerial()\n {\n return $this->serial;\n }",
"public function getPipeline()\n {\n return array_map(\n function (Stage $stage) { return $stage->getExpression(); },\n $this->stages\n );\n }",
"public function build(ProcessorInterface $processor = null) {\n return new Pipeline($this->stages, $processor);\n }",
"public function getPrerequisiteStage()\n {\n return $this->prerequisite_stage;\n }",
"public function pipeline() {}",
"public function project(array $pipeline)\n {\n $this->addStage('$project', $pipeline);\n return $this;\n }",
"public static function sequential()\n {\n $definition = new ProcessDefinition();\n\n $c1 = new Condition();\n $c2 = new Condition();\n $c3 = new Condition();\n $t1 = new Task();\n $t2 = new Task();\n\n $definition\n ->addCondition($c1)\n ->addTask($c1, $t1, $c2)\n ->addTask($c2, $t2, $c3)\n ->setSource($c1)\n ->setSink($c3);\n\n return $definition;\n }",
"public function add(MatchablePipelineInterface $pipeline): void;",
"public function __construct(Pipeline $pipeline, $passable)\n {\n $this->pipeline = $pipeline;\n $this->passable = $passable;\n }",
"private function serial_running() {\n\t\t$serial_running = false;\n\t\tforeach ($this->processes as $process) {\n\t\t\tif ($process->is_running() and !$process->is_parallel()) {\n\t\t\t\t$serial_running = true;\n\t\t\t}\n\t\t}\n\t\treturn $serial_running;\n\t}",
"public function getLicenseSerial()\r\n {\r\n $moduleConfig = $this->getModuleConfig();\r\n return (string) $moduleConfig->serial;\r\n }",
"public function pipe($object, $pipeline = null);",
"public function getParallelParts() {\n return @$this->attributes['parallel_parts'];\n }",
"public function getSerialNumber()\n {\n return $this->serialNumber;\n }",
"public function getPipelines($parameters = [])\n {\n return $this->client->request('GET', '/pipelines', NULL, $parameters);\n }",
"public function createPipeline($name, $parameters = [])\n {\n $parameters += [\n 'name' => $name,\n ];\n\n return $this->client->request('POST', '/pipelines', NULL, $parameters);\n }",
"public function filterBySerial($serial)\n {\n $this->filter[] = $this->field('serial').' = '.$this->quote($serial);\n return $this;\n }",
"public function stages()\n {\n return $this->morphMany(Stage::class, 'stageable');\n }",
"public function getSequenceType()\n {\n return $this->sequenceType;\n }",
"function getPipeline()\n {\n\t\t$args = new safe_args();\n\t\t$args->set('hmpartner_id', \tNOTSET, 'sqlsafe');\n\t\t$args->set('refresh', \t\t'N', 'sqlsafe');\n\t\t$args = $args->get(func_get_args());\n\t\t\t\t\n\t\tinclude_once('class.pipeline.php');\n\t\t$pipe = new pipeline;\n \t\t\n# \tif( $GLOBALS['appshore_data']['current_user']['type_id'] == 'Partner' && $GLOBALS['appshore_data']['current_user']['hmpartner_id'] )\n#\t\t\t$args['hmpartner_id'] = $GLOBALS['appshore_data']['current_user']['hmpartner_id'];\n\n\t\t$pipe->generate($args['hmpartner_id'], $args['refresh']);\n\n\t\tif ( $pipeline = $pipe->get($args['hmpartner_id']) )\n\t\t{\n\t\t\t$count = count($pipeline);\n\t\t\treset($pipeline);\n\t\t\tfor( $i = 0; $i < $count; $i++ )\n\t\t\t{\n\t\t\t\t$val = current($pipeline);\n\t\t\t\t$key = key($pipeline);\n\t\t\t\tif( preg_match('/(pct|pbg)/', $key) ) // percentage\n\t\t\t\t\t$result['pipeline'][$key] = number_format($val,2).'%';\n\t\t\t\telse if( preg_match('/(com|fat|ifa|pft|funding)/', $key) ) // currency\n\t\t\t\t\t$result['pipeline'][$key] = '$'.number_format((int)$val);\n\t\t\t\telse\n\t\t\t\t\t$result['pipeline'][$key] = $val;\n\t\t\t\tnext($pipeline);\n\t\t\t}\n\t\t}\n\t\t\t\n \t\t$_SESSION[$this->appName]['hmpartner_id'] = $args['hmpartner_id']; \t\t\n\t\t$GLOBALS['appshore_data']['server']['xml_render'] = true;\n \t\treturn $result;\n\t}",
"abstract public function stages (): array;"
] | [
"0.79383993",
"0.4932319",
"0.4787718",
"0.4577235",
"0.452515",
"0.45083222",
"0.4459618",
"0.4456185",
"0.43958604",
"0.43876526",
"0.43532145",
"0.4347692",
"0.4336828",
"0.43121758",
"0.4263358",
"0.42561305",
"0.41938135",
"0.41615245",
"0.40609187",
"0.40005264",
"0.39988032",
"0.3983886",
"0.39756915",
"0.39424437",
"0.39384225",
"0.3925325",
"0.3904194",
"0.38982806",
"0.3891767",
"0.38836482"
] | 0.72882795 | 1 |
SerialPipeline defines a sequential set of stages for a `DeliveryPipeline`. Generated from protobuf field .google.cloud.deploy.v1.SerialPipeline serial_pipeline = 8; | public function setSerialPipeline($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\SerialPipeline::class);
$this->writeOneof(8, $var);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSerialPipeline()\n {\n return $this->readOneof(8);\n }",
"public function setPrerequisiteStage($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->prerequisite_stage = $arr;\n\n return $this;\n }",
"public function getFlatPipeline()\n {\n return $this->flatPipeline;\n }",
"public function pipe(callable ...$stages) {\n $pipeline = clone $this;\n foreach ($stages as $stage) {\n $pipeline->stages[] = $stage;\n }\n return $pipeline;\n }",
"public function getPipeline(): array;",
"public static function getPipeline()\n {\n /** @var \\Bugsnag\\Client $instance */\n return $instance->getPipeline();\n }",
"public function setSerial($serial)\n {\n $this->serial = $serial;\n\n return $this;\n }",
"public function getSerial()\n {\n return $this->fields['serial'];\n }",
"public function ChangePipeline()\n\t{\n\t\t$customer = PipelineItems::where('pipelineStatus', \"true\")->select('customer.name', 'agent.name');\n\t\t$result = [];\n\t\t$customer->chunk(500, function ($properties) use (&$result) {\n\t\t\tforeach ($properties as $property) {\n\t\t\t\t$result[] = $property;\n\t\t\t}\n\t\t});\n\n\t\t// $leadList=LeadDetails::where('active',1)->taget();\n\t\tforeach ($result as $cust) {\n\t\t\t$custName = ltrim(ucwords(strtolower($cust->customer['name'])));\n\t\t\tif (isset($cust->agent)) {\n\t\t\t\t$agent = ltrim(ucwords(strtolower($cust->agent['name'])));\n\t\t\t\tPipelineItems::where('_id', new ObjectId($cust->_id))->update(array('agent.name' => $agent));\n\t\t\t}\n\t\t\tPipelineItems::where('_id', new ObjectId($cust->_id))->update(array('customer.name' => $custName));\n\t\t}\n\t\techo \"success\";\n\t}",
"public function getSerial()\n {\n return $this->serial;\n }",
"public function getPipeline()\n {\n return array_map(\n function (Stage $stage) { return $stage->getExpression(); },\n $this->stages\n );\n }",
"public function build(ProcessorInterface $processor = null) {\n return new Pipeline($this->stages, $processor);\n }",
"public function getPrerequisiteStage()\n {\n return $this->prerequisite_stage;\n }",
"public function pipeline() {}",
"public function project(array $pipeline)\n {\n $this->addStage('$project', $pipeline);\n return $this;\n }",
"public static function sequential()\n {\n $definition = new ProcessDefinition();\n\n $c1 = new Condition();\n $c2 = new Condition();\n $c3 = new Condition();\n $t1 = new Task();\n $t2 = new Task();\n\n $definition\n ->addCondition($c1)\n ->addTask($c1, $t1, $c2)\n ->addTask($c2, $t2, $c3)\n ->setSource($c1)\n ->setSink($c3);\n\n return $definition;\n }",
"public function add(MatchablePipelineInterface $pipeline): void;",
"public function __construct(Pipeline $pipeline, $passable)\n {\n $this->pipeline = $pipeline;\n $this->passable = $passable;\n }",
"private function serial_running() {\n\t\t$serial_running = false;\n\t\tforeach ($this->processes as $process) {\n\t\t\tif ($process->is_running() and !$process->is_parallel()) {\n\t\t\t\t$serial_running = true;\n\t\t\t}\n\t\t}\n\t\treturn $serial_running;\n\t}",
"public function getLicenseSerial()\r\n {\r\n $moduleConfig = $this->getModuleConfig();\r\n return (string) $moduleConfig->serial;\r\n }",
"public function pipe($object, $pipeline = null);",
"public function getParallelParts() {\n return @$this->attributes['parallel_parts'];\n }",
"public function getSerialNumber()\n {\n return $this->serialNumber;\n }",
"public function getPipelines($parameters = [])\n {\n return $this->client->request('GET', '/pipelines', NULL, $parameters);\n }",
"public function createPipeline($name, $parameters = [])\n {\n $parameters += [\n 'name' => $name,\n ];\n\n return $this->client->request('POST', '/pipelines', NULL, $parameters);\n }",
"public function filterBySerial($serial)\n {\n $this->filter[] = $this->field('serial').' = '.$this->quote($serial);\n return $this;\n }",
"public function stages()\n {\n return $this->morphMany(Stage::class, 'stageable');\n }",
"public function getSequenceType()\n {\n return $this->sequenceType;\n }",
"function getPipeline()\n {\n\t\t$args = new safe_args();\n\t\t$args->set('hmpartner_id', \tNOTSET, 'sqlsafe');\n\t\t$args->set('refresh', \t\t'N', 'sqlsafe');\n\t\t$args = $args->get(func_get_args());\n\t\t\t\t\n\t\tinclude_once('class.pipeline.php');\n\t\t$pipe = new pipeline;\n \t\t\n# \tif( $GLOBALS['appshore_data']['current_user']['type_id'] == 'Partner' && $GLOBALS['appshore_data']['current_user']['hmpartner_id'] )\n#\t\t\t$args['hmpartner_id'] = $GLOBALS['appshore_data']['current_user']['hmpartner_id'];\n\n\t\t$pipe->generate($args['hmpartner_id'], $args['refresh']);\n\n\t\tif ( $pipeline = $pipe->get($args['hmpartner_id']) )\n\t\t{\n\t\t\t$count = count($pipeline);\n\t\t\treset($pipeline);\n\t\t\tfor( $i = 0; $i < $count; $i++ )\n\t\t\t{\n\t\t\t\t$val = current($pipeline);\n\t\t\t\t$key = key($pipeline);\n\t\t\t\tif( preg_match('/(pct|pbg)/', $key) ) // percentage\n\t\t\t\t\t$result['pipeline'][$key] = number_format($val,2).'%';\n\t\t\t\telse if( preg_match('/(com|fat|ifa|pft|funding)/', $key) ) // currency\n\t\t\t\t\t$result['pipeline'][$key] = '$'.number_format((int)$val);\n\t\t\t\telse\n\t\t\t\t\t$result['pipeline'][$key] = $val;\n\t\t\t\tnext($pipeline);\n\t\t\t}\n\t\t}\n\t\t\t\n \t\t$_SESSION[$this->appName]['hmpartner_id'] = $args['hmpartner_id']; \t\t\n\t\t$GLOBALS['appshore_data']['server']['xml_render'] = true;\n \t\treturn $result;\n\t}",
"abstract public function stages (): array;"
] | [
"0.7286795",
"0.49311346",
"0.47863716",
"0.45753044",
"0.45251772",
"0.4508686",
"0.44574413",
"0.44543317",
"0.43959978",
"0.4385834",
"0.43513483",
"0.43476078",
"0.43356454",
"0.4312166",
"0.42630807",
"0.42555138",
"0.41937068",
"0.41613948",
"0.40589112",
"0.4000075",
"0.39981797",
"0.3982313",
"0.39737788",
"0.3941395",
"0.39374045",
"0.39229345",
"0.3901368",
"0.3897407",
"0.3892702",
"0.38821492"
] | 0.7936597 | 0 |
Output only. Information around the state of the Delivery Pipeline. Generated from protobuf field .google.cloud.deploy.v1.PipelineCondition condition = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; | public function setCondition($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\PipelineCondition::class);
$this->condition = $var;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCondition() \n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"public function getCondition()\n {\n return $this->condition;\n }",
"protected function getCondition()\n {\n return $this->condition;\n }",
"public function condition()\n {\n return $this->condition;\n }",
"public function getProductCondition()\n {\n return $this->product_condition;\n }",
"public function get_condition()\n {\n return $this->condition;\n }",
"public function getCondition();",
"public function getProductCondition() {\n //return the value product condition\n return $this->ProductCondition;\n }",
"public function getCondition(): ?FHIRString\n\t{\n\t\treturn $this->condition;\n\t}",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getCondition()\n {\n return $this->get(self::CONDITION);\n }",
"public function getConditionEvaluation()\n {\n return $this->condition_evaluation;\n }",
"public function getConditionString()\n {\n return 'true';\n }",
"public function getConditionDescription()\n {\n return $this->conditionDescription;\n }",
"public function getDeviceCondition()\n {\n return $this->device_condition;\n }",
"public function getCondition(): string\n {\n }",
"public function getConditionInfo() : array\n {\n return $this->conditionInfo;\n }",
"public function getConditionDefinition()\n {\n return $this->conditionDefinition;\n }",
"public function getCondition()\n {\n return [];\n }",
"public function getConditionId()\n {\n return $this->_fields['ConditionId']['FieldValue'];\n }",
"public function setConditionEvaluation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Asset\\V1\\ConditionEvaluation::class);\n $this->condition_evaluation = $var;\n\n return $this;\n }",
"public function jiraDeployStatus() : string\n {\n return $this->paramsArray['parameters']['jira.trigger.deploy.state'];\n }"
] | [
"0.57192904",
"0.5703839",
"0.5703839",
"0.5703839",
"0.5703839",
"0.5703839",
"0.56150573",
"0.5576538",
"0.5549414",
"0.5507753",
"0.5479586",
"0.54487",
"0.5251199",
"0.52182376",
"0.52182376",
"0.52182376",
"0.52182376",
"0.52182376",
"0.52182376",
"0.5151593",
"0.5131493",
"0.5091851",
"0.497372",
"0.49553117",
"0.49399874",
"0.49299777",
"0.4878938",
"0.4834194",
"0.4804845",
"0.47943965"
] | 0.7546813 | 0 |
ManyToOne (inverse side) Get fkFolhapagamentoPrevidencia | public function getFkFolhapagamentoPrevidencia()
{
return $this->fkFolhapagamentoPrevidencia;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFkPessoalContrato()\n {\n return $this->fkPessoalContrato;\n }",
"public function getFkFolhapagamentoEvento()\n {\n return $this->fkFolhapagamentoEvento;\n }",
"public function getFkFolhapagamentoEvento()\n {\n return $this->fkFolhapagamentoEvento;\n }",
"public function getFkFolhapagamentoEvento()\n {\n return $this->fkFolhapagamentoEvento;\n }",
"function get_relation_fk($attr, $tabla){\n $relacion = $tabla->get_relationship($attr);\n if (count($relacion->foreign_key) < 2){\n $fk = null;\n if (count($relacion->foreign_key) > 0)\n $fk = $relacion->foreign_key[0];\n return $fk;\n }else{\n throw new Exception(\"La relacion $attr tiene una\n clave foranea compuesta.\");\n }\n}",
"public function getFkEmpenhoPreEmpenho()\n {\n return $this->fkEmpenhoPreEmpenho;\n }",
"public function getFkPessoalPensao()\n {\n return $this->fkPessoalPensao;\n }",
"public function getFkFolhapagamentoRegistroEvento()\n {\n return $this->fkFolhapagamentoRegistroEvento;\n }",
"public function getFkFolhapagamentoEvento1()\n {\n return $this->fkFolhapagamentoEvento1;\n }",
"public function getFkFolhapagamentoEvento3()\n {\n return $this->fkFolhapagamentoEvento3;\n }",
"public function getFkFrotaVeiculo()\n {\n return $this->fkFrotaVeiculo;\n }",
"public function getFkPessoalEspecialidade()\n {\n return $this->fkPessoalEspecialidade;\n }",
"public function getFkOrcamentoPrevisaoDespesas()\n {\n return $this->fkOrcamentoPrevisaoDespesas;\n }",
"public function getFkFolhapagamentoReajuste()\n {\n return $this->fkFolhapagamentoReajuste;\n }",
"public function getFkFolhapagamentoEvento2()\n {\n return $this->fkFolhapagamentoEvento2;\n }",
"public function GetIdPaiDispositivo()\n\t{\n\t\treturn $this->_phreezer->GetManyToOne($this, \"rel_id_dipositivopai_dispositivofilho\");\n\t}",
"protected function __foreignKey()\n {\n }",
"public function getFundo()\n {\n return $this->hasOne(Fundo::className(), ['id' => 'Fundo_id']);\n }",
"public function getFkDividaParcelaOrigens()\n {\n return $this->fkDividaParcelaOrigens;\n }",
"public function obtenerForeignField($nombrecampo){\n $arreglo=$this->fillRelations();\n $nombrecampoforaneo=null;\n $claseforanea=$this->fieldsLink(false)[$nombrecampo];\n foreach($arreglo[$claseforanea][0] as $campoforaneo=>$campolocal){\n if($nombrecampo===$campolocal){\n $nombrecampoforaneo=$campoforaneo;\n }\n }\n return $nombrecampoforaneo; \n }",
"public function getFkPessoalEspecialidades()\n {\n return $this->fkPessoalEspecialidades;\n }",
"public function getFkOrcamentoEntidade()\n {\n return $this->fkOrcamentoEntidade;\n }",
"public function getFkOrcamentoEntidade()\n {\n return $this->fkOrcamentoEntidade;\n }",
"public function getFkOrcamentoEntidade()\n {\n return $this->fkOrcamentoEntidade;\n }",
"public function getFkOrcamentoEntidade()\n {\n return $this->fkOrcamentoEntidade;\n }",
"public function getFkOrcamentoEntidade()\n {\n return $this->fkOrcamentoEntidade;\n }",
"public function getFkEmpenhoEmpenho()\n {\n return $this->fkEmpenhoEmpenho;\n }",
"public function getFkEmpenhoEmpenho()\n {\n return $this->fkEmpenhoEmpenho;\n }",
"public function getFkFolhapagamentoPeriodoMovimentacao()\n {\n return $this->fkFolhapagamentoPeriodoMovimentacao;\n }",
"public function getFkFolhapagamentoPeriodoMovimentacao()\n {\n return $this->fkFolhapagamentoPeriodoMovimentacao;\n }"
] | [
"0.68438864",
"0.67881155",
"0.67881155",
"0.67881155",
"0.6683572",
"0.6640086",
"0.6636193",
"0.6623423",
"0.66219723",
"0.65198445",
"0.6488526",
"0.6439644",
"0.63856375",
"0.6361016",
"0.6356872",
"0.63360524",
"0.6309518",
"0.6300564",
"0.6268568",
"0.626795",
"0.62627697",
"0.6260338",
"0.6260338",
"0.6260338",
"0.6260338",
"0.6260338",
"0.6251072",
"0.6251072",
"0.62321126",
"0.62321126"
] | 0.76887083 | 0 |
Test inject search exception | public function testInjectSearchException()
{
$this->expectException(RuntimeException::class);
$request = new ServerRequest();
$response = new Response();
$eventManager = new EventManager();
$controller = new Controller($request, $response, 'Search', $eventManager);
$behaviorRegistryMock = $this->getMockBuilder(BehaviorRegistry::class)
->setMockClassName('BehaviorRegistry')
->getMock();
$behaviorRegistryMock->expects($this->once())
->method('has')
->will($this->returnValue(false));
$tableMock = $this->getMockBuilder(Table::class)
->setMockClassName('SearchesTable')
->onlyMethods(['behaviors'])
->addMethods(['filterParams'])
->getMock();
$tableMock->expects($this->any())
->method('behaviors')
->will($this->returnValue($behaviorRegistryMock));
$this->getTableLocator()->set('Search', $tableMock);
$queryMock = $this->getMockBuilder(\Cake\ORM\Query::class)
->disableOriginalConstructor()
->getMock();
$subject = new Subject();
$subject->query = $queryMock;
$listener = new SearchListener($controller, [
'enabled' => [
'Crud.beforeLookup',
],
]);
$listener->injectSearch(new Event('Crud.beforePaginate', $subject));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testSearchKeok()\n {\n }",
"public function testNonDIInject()\n {\n $this->expectException(Exception::class);\n $s1 = $this->factory('atk4/core/tests/SeedTestMock', ['foo'=>'hello']);\n $this->assertTrue($s1 instanceof SeedDITestMock);\n $this->assertEquals(['hello'], $s1->args);\n }",
"public function testLookupAdvice()\n {\n }",
"#[@test]\n public function getInjectionWrongIndex() {\n $this->assertNull($this->args->getInjection(5));\n }",
"public function testSearch()\r\n {\r\n $this->getBrowser()\r\n ->get('/search', array('q' => 'test'))\r\n ->with('request')->begin()\r\n ->isParameter('action', 'search')\r\n ->isParameter('module', 'recherche')\r\n ->end()\r\n ->with('response')->begin()\r\n ->isStatusCode(200)\r\n ->end()\r\n ;\r\n }",
"private function searchInDbTest() {\n $count = count(TagController::searchInDb(\"TestTAG\"));\n TagController::saveTagInDb(\"TestTAGAwesomenessIsAwesome\");\n if (!assert(count(TagController::searchInDb(\"TestTAG\"))===$count+1)) {\n parent::addError(\"searchInDbTest Failed!\");\n }\n }",
"public function testSearchAddressFail()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(new mainPage)\n ->assertSee('Pide lo que te pida el cuerpo')\n ->assertSee('Comida a domicilio online cerca de ti')\n ->type('@address', 'fail')\n ->press('@searchRest')\n ->assertPathIs('/');\n });\n }",
"public function testUserSearchMustFail()\n {\n $dataSearch = [];\n $dataSearch['search'] = 'TestUser';\n $dataSearch['limit'] = 100;\n $buildParams = http_build_query($dataSearch, PHP_QUERY_RFC1738);\n $url = route('user.index');\n $fullUrl = \"$url?$buildParams\";\n $response = $this->getJson($fullUrl);\n\n $response\n ->assertStatus(200);\n }",
"public function testFind()\n {\n $this->markTestIncomplete('このテストは、まだ実装されていません。');\n }",
"public function testNotFoundException( )\n {\n $this->expectException( NotFoundExceptionInterface::class );\n $this->expectException( SalesmanNotFoundException::class );\n $this->sut->get( 22 );\n }",
"public function testSearch()\n {\n $results = $this->client->search(array('query' => 'hello'));\n $this->assertEquals(is_object($results), true, 'Should return an object');\n $this->assertEquals(is_array($results->results), true,\n 'Should return an object containing an array called \"results\"');\n $this->assertGreaterThan(0, $results->results[0]->id, 'Returns a non-numeric id for results[0]');\n $this->assertEquals($this->client->getDebug()->lastResponseCode, '200', 'Does not return HTTP code 200');\n }",
"public function testNonExistentProductSearch(): void\n {\n $searchCriteria = $this->buildSearchCriteria('nonExistentProduct');\n $serviceInfo = $this->buildServiceInfo($searchCriteria);\n\n $response = $this->_webApiCall($serviceInfo, $searchCriteria);\n\n self::assertArrayHasKey('search_criteria', $response);\n self::assertArrayHasKey('items', $response);\n self::assertCount(0, $response['items']);\n }",
"public function test_failed_search_type()\n {\n $this->expectException(\\Atomescrochus\\Gracenote\\Exceptions\\UsageErrors::class);\n $this->expectExceptionMessage('This search type is invalid.');\n\n $gracenote = new \\Atomescrochus\\Gracenote\\Gracenote();\n $gracenote->searchType('this_is_wrong');\n }",
"public function testValidateUserSearchExceptionPageInvalid()\n {\n try {\n $this->_flickrProxy->proxyValidateUserSearch(['per_page' => 10, 'page' => 1.23]);\n $this->fail('Expected Zend_Service_Exception not thrown');\n } catch (Zend_Service_Exception $e) {\n $this->assertStringContainsString('\"page\" option', $e->getMessage());\n }\n }",
"public function testSearches()\n {\n $search_terms = array(\n [\"search\" => \"smith\", \"display\" => \"yielded 100 results and was limited by the directory application. Please try to refine your search to find the appropriate party.\"],\n [\"search\" => \"standifer\", \"display\" => \"Your search for 'standifer' yielded 2 results.\"],\n [\"search\" => \"Angie brown\", \"display\" => \"100 results, and was limited by the directory application. Please try to refine your search to find the appropriate party.\"],\n [\"search\" => \"noresults\", \"display\" =>\"Your search for 'noresults' yielded 0 results.\"]\n );\n \n foreach ($search_terms as $search_term){\n $visited = '/search/' . $search_term[\"search\"];\n $results = $search_term[\"display\"];\n $this->visit($visited)\n ->see($results);\n }\n }",
"public function testSearchLooks()\n {\n }",
"public function testValidateTagSearchExceptionPageInvalid()\n {\n try {\n $this->_flickrProxy->proxyValidateTagSearch(['per_page' => 10, 'page' => 1.23]);\n $this->fail('Expected Zend_Service_Exception not thrown');\n } catch (Zend_Service_Exception $e) {\n $this->assertStringContainsString('\"page\" option', $e->getMessage());\n }\n }",
"public function testGetWithValueNotFoundError()\n {\n $this->expectException(NotFoundException::class);\n\n $this->container->get('foo');\n }",
"public function testTagSearchExceptionOptionInvalid()\n {\n try {\n $this->_flickr->tagSearch('irrelevant', ['unexpected' => null]);\n $this->fail('Expected Zend_Service_Exception not thrown');\n } catch (Zend_Service_Exception $e) {\n $this->assertStringContainsString('parameters are invalid', $e->getMessage());\n }\n }",
"public function testSearchOnType()\r\n {\r\n // create a new Repository to be used later\r\n $repo = $this->em->getRepository(Communication::class);\r\n\r\n // create an array with values to search with\r\n $cleanQuery = array();\r\n $cleanQuery[] = 'Phone';\r\n\r\n // query the database\r\n $results = $repo->CommunicationSearch($cleanQuery);\r\n\r\n // Assert that size of the query returns the expected number of results\r\n $this->assertEquals(3, sizeof($results));\r\n }",
"function tests_model_find_automatic_exception(){\n\n $post_id = $this->factory->post->create_many(100, array(\n 'post_type' => 'book'\n ));\n\n // ---- Act\n\n try{\n\n $book = $this->app->book->findByName(1); // This method doesn' exists\n\n }catch(Exception $e){\n\n // ---- Assert\n $this->assertEquals($e->getMessage(), \"Trying to access a method that doesn't exists\");\n\n }\n\n }",
"public function testSearchWithoutTerm() \n {\n // No search term should redirect to the homepage\n $this->visit('/search/')\n ->see('SEARCH THE UNIVERSITY OF FLORIDA DIRECTORY');\n }",
"public function testSearchIndexingIsDisabled() {\n\t\t$this->markTestIncomplete('Requires manual testing for now');\n\t}",
"public function testNotFound() {\n\n\t\tob_start();\n\t\t$this->controller->notFound();\n\t\t$output = ob_get_clean();\n\n\t\t$this->assertTrue($this->didFindString($output, 'amt-notfound'));\n\n\t}",
"#[@test]\n public function isInjectedByIndex() {\n $this->assertTrue($this->args->isInjected(0));\n }",
"public function testWPQuerySearchExcerpt() {\n\t\t$post_ids = array();\n\n\t\t$post_ids[0] = ep_create_and_sync_post();\n\t\t$post_ids[1] = ep_create_and_sync_post();\n\t\t$post_ids[2] = ep_create_and_sync_post( array( 'post_excerpt' => 'findme test' ) );\n\t\t$post_ids[3] = ep_create_and_sync_post();\n\t\t$post_ids[4] = ep_create_and_sync_post();\n\n\t\tep_refresh_index();\n\n\t\t$args = array(\n\t\t\t's' => 'findme',\n\t\t);\n\n\t\tadd_action( 'ep_wp_query_search', array( $this, 'action_wp_query_search' ), 10, 0 );\n\n\t\t$query = new WP_Query( $args );\n\n\t\t$this->assertTrue( ! empty( $this->fired_actions['ep_wp_query_search'] ) );\n\n\t\t$this->assertEquals( $query->post_count, 1 );\n\t\t$this->assertEquals( $query->found_posts, 1 );\n\t}",
"public function testFindConfigEmptyException() {\n\t\t$this->Model->find('config');\n\t}",
"public function testSearch()\n {\n $this->url('http://www.google.de/');\n $element = $this->byName('q');\n $element->click();\n $this->keys('oculus');\n $button = $this->byName('btnG');\n $button->click();\n $this->assertEquals('oculus - Google-Suche', $this->title());\n }",
"public function testSearchWithNoContent()\n {\n $this->json('GET', 'api/v1/unauth/search', ['search_content' => null])\n ->assertStatus(403)\n ->assertJson([\n \"success\" => \"false\",\n \"error\" => \"search content is empty\"\n ]);\n\n $this->json('GET', 'api/v1/unauth/search', [])\n ->assertStatus(403)\n ->assertJson([\n \"success\" => \"false\",\n \"error\" => \"search content is empty\"\n ]);\n }",
"public function test_likeFind() {\n\n }"
] | [
"0.64120835",
"0.6016492",
"0.5986093",
"0.5965334",
"0.5958013",
"0.595149",
"0.593078",
"0.5880154",
"0.585919",
"0.58431715",
"0.5829149",
"0.5821384",
"0.5767122",
"0.57508063",
"0.5732034",
"0.5706723",
"0.57060426",
"0.56890124",
"0.56803006",
"0.5672852",
"0.5656805",
"0.56548434",
"0.563861",
"0.56268716",
"0.56213593",
"0.5615527",
"0.5597923",
"0.55656886",
"0.5551912",
"0.55468994"
] | 0.7227245 | 0 |
Retrieve Account Tree ( | public function getAccountTree($params = array())
{
$params['api_key'] = $this->api_key;
$params['auth_token'] = $this->auth_token;
$params['folder_id'] = 0;
$params['params[]'] = 'nozip';
$ret_array = array();
$data = $this->makeRequest('action=get_account_tree', $params);
if ($this->_checkForError($data))
{
return false;
}
$tree_count = count($data);
global $tree_count;
for ($i = 0, $tree_count = count($data); $i < $tree_count; $i ++)
{
$a = $data[$i];
switch ($a['tag'])
{
case 'FOLDER' :
if (is_array($a['attributes']))
{
$ret_array[$i]['folder_id'] = $a['attributes']['ID'];
$ret_array[$i]['folder_name'] = $a['attributes']['NAME'];
}
break;
case 'FILE' :
if (is_array($a['attributes']))
{
$ret_array[$i]['file_id'] = $a['attributes']['ID'];
$ret_array[$i]['file_name'] = $a['attributes']['FILE_NAME'];
$ret_array[$i]['description'] = $a['attributes']['DESCRIPTION'];
$ret_array[$i]['created'] = $a['attributes']['CREATED'];
$ret_array[$i]['updated'] = $a['attributes']['UPDATED'];
$ret_array[$i]['size'] = $a['attributes']['SIZE'];
$tree_count ++;
}
break;
}
}
if ($this->_debug)
{
echo '<h2>Account Tree Return</h2>';
$this->_a($ret_array);
"<br/>";
print_r($a);
echo '<hr />';
}
return $ret_array;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function tree()\n {\n if(!$this->current_user->can('list_contract'))\n return $this->prepareResponse('contracts.NOT_AUTHORIZED_LIST_ER');\n\n $root = $this->_get_root_directory($this->current_user->id);\n $root->children;\n \n function traverse(&$children)\n {\n foreach ($children as $child)\n {\n $child->load('children');\n traverse($child->children);\n }\n };\n\n traverse($root->children);\n\n return $root->toArray();\n }",
"public function GetAllAccounts()\n {\n $accounts = array(1,2,3,4,5);\n $data['Accounts'] = $this->ChartModel->GetAccountTree($accounts);\n // echo \"<pre>\";\n // print_r($data);\n // exit();\n $this->load->view('Accounts/header');\n $this->load->view('Accounts/coa/tree',$data);\n $this->load->view('Accounts/footer');\n $this->load->view('Accounts/js/chartofaccountJs');\n }",
"abstract public function getTree();",
"public static function getAccountOfNode($node)\r\n\t{\r\n\t\t$result = array();\r\n\t\t$accounts = Quick::single('core/definition_account')->cache()->getAccountOfNode($node);\r\n\t\t$i = 0;\r\n\t\t\r\n\t\tforeach ($accounts as $account) {\t\t\t\r\n\t\t\t$result[$i] = array(\r\n 'text' => $account['account_code'] . '-' . $account['account_name'],\r\n 'id' => $account['account_id'],\r\n 'name' => $account['account_id'], \r\n 'leaf' => false,\r\n\t\t\t\t\t'cls'=>'tree-new-icon',\r\n\t\t\t\t\t'icon' => '',\r\n\t\t\t\t\t'parent_id' => $account['account_parent_id']\r\n\t\t\t);\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\treturn $result;\r\n\t}",
"function getHieraricalAccounts($tree_structure, $level = 0, $parent_id = null) {\n\n $html = \"\";\n\n $space_limit = $level * 3;\n $spaces = '';\n\n for($i = 0; $i<$space_limit; $i++){\n $spaces .= \" \";\n }\n\n $heirarchy_indicator = 'l_';\n if (is_array($tree_structure) && count($tree_structure)) {\n\n foreach ($tree_structure as $key => $leaf) {\n $active = \"\";\n if($leaf['parent_id'] == 0){\n $active = \"style='background-color:#f2f2f2;'\";\n $heirarchy_indicator = '';\n }\n $selected = \"\";\n if($leaf['id'] == $parent_id){\n $selected = \"selected = 'selected'\";\n// $selected = $leaf['parent_id'];\n }\n $html .= \"<option \".$active.\" value='\".$leaf['id'].\"' \".$selected.\">\\n\";\n\n $html .= $spaces.$heirarchy_indicator.$leaf['account_name'].\"</option>\\n\";\n if (isset($leaf[\"descendants\"])) {\n $level++;\n $html .= getHieraricalAccounts($leaf[\"descendants\"], $level, $parent_id);\n }\n\n }\n }\n return $html;\n\n }",
"public function getAccount() {\n\t\t\n\t}",
"public function getAccountList() {\n return parent::_requestData('get','accounts');\n }",
"public function get_head($code)\n {\n\n $accounts = array($code);\n $data = $this->ChartModel->GetAccountTreeby_parent_ledger($accounts);\n $parent = '';\n //print_r($data).'<br>';\n foreach($data as $key => $value) {\n foreach ($data[$key] as $key1 => $value1) {\n if (isset($value1->AccountName)) {\n echo '<ul><li>'.$value1->AccountName.'<br>';\n } else {\n foreach ($value1 as $key2 => $value2) {\n if (isset($value2->AccountName)) {\n } else {\n if($key2 == 'Child0'){\n echo '<li>'.$value1[0]->AccountName.'<br>';\n }\n else if($key2 == 'Child1'){\n echo '<li>'.$value1[1]->AccountName.'<br>';\n }\n else if($key2 == 'Child2'){\n echo '<li>'.$value1[2]->AccountName.'<br>';\n }\n else if($key2 == 'Child3'){\n echo '<li>'.$value1[3]->AccountName.'<br>';\n }\n else if($key2 == 'Child4'){\n echo '<li>'.$value1[4]->AccountName.'<br>';\n }\n else if($key2 == 'Child5'){\n echo '<li>'.$value1[5]->AccountName.'<br>';\n }\n else if($key2 == 'Child6'){\n echo '<li>'.$value1[6]->AccountName.'<br>';\n }\n else if($key2 == 'Child7'){\n echo '<li>'.$value1[7]->AccountName.'<br>';\n }\n foreach ($value2 as $key3 => $value3) {\n //echo $key3.'<br>';\n if (isset($value3->AccountName)) {\n }\n else {\n if($key3 == 'Child0'){\n echo '<li>'.$value2[0]->AccountName.'<br>';\n }\n else if($key3 == 'Child1'){\n echo '<li>'.$value2[1]->AccountName.'<br>';\n }\n else if($key3 == 'Child2'){\n echo '<li>'.$value2[2]->AccountName.'<br>';\n }\n else if($key == 'Child3'){\n echo '<li>'.$value2[3]->AccountName.'<br>';\n }\n else if($key3 == 'Child4'){\n echo '<li>'.$value2[4]->AccountName.'<br>';\n }\n else if($key3 == 'Child5'){\n echo '<li>'.$value2[5]->AccountName.'<br>';\n }\n else if($key3 == 'Child6'){\n echo '<li>'.$value2[6]->AccountName.'<br>';\n }\n else if($key3 == 'Child7'){\n echo '<li>'.$value2[7]->AccountName.'<br>';\n }\n else if($key3 == 'Child8'){\n echo '<li>'.$value2[8]->AccountName.'<br>';\n } else if($key3 == 'Child9'){\n echo '<li>'.$value2[9]->AccountName.'<br>';\n } else if($key3 == 'Child10'){\n echo '<li>'.$value2[10]->AccountName.'<br>';\n } else if($key3 == 'Child11'){\n echo '<li>'.$value2[11]->AccountName.'<br>';\n } else if($key3 == 'Child12'){\n echo '<li>'.$value2[12]->AccountName.'<br>';\n }\n foreach ($value3 as $key4 => $value4) {\n if (isset($value4->AccountName)) {\n echo 'subchild' . $value4->AccountName . $key3 . '<br>';\n }\n }\n }\n }\n\n\n // echo \"<pre>\";\n // print_r($value3);\n // print_r($value3);\n }\n\n\n }\n }\n }\n }\n //print_r($value1);\n // print_r($treedata);\n }",
"public function getparentaccountinfo(){\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n $parent_account_id = $this->input->post('id');\n\n $account_arr = $this->account_mod->get_parent_account_by_id($parent_account_id);\n //print_r($transaction_arr); exit();\n\n header('Cache-Control: no-cache, must-revalidate');\n header('Expires: ' . date('r', time() + (86400 * 365)));\n header('Content-type: application/json');\n\n echo json_encode(array(\n 'id' => $account_arr->id,\n 'name' => $account_arr->name,\n 'description' => $account_arr->description,\n 'status' => $account_arr->status\n ));\n exit();\n }\n }",
"function get_root($token, $get_children=FALSE) {\n\t\t$uri = \"https://\".$this->get_hostname($token).\"/sf/v3/Items\";\n\t\tif ($get_children == TRUE) {\n\t\t\t$uri .= \"?\\$expand=Children\";\n\t\t}\n\t\t//echo \"GET \".$uri.\"\\n\";\n\t \n\t\t$headers = $this->get_authorization_header($token);\n\t\t \n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $uri);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 300);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t \n\t\t$curl_response = curl_exec ($ch);\n\t \n\t\t$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t\t$curl_error_number = curl_errno($ch);\n\t\t$curl_error = curl_error($ch);\n\t \n\t\t//echo $curl_response.\"\\n\"; // output entire response\n\t\t//echo $http_code.\"\\n\"; // output http status code\n\t\t \n\t\tcurl_close ($ch);\n\t \n\t\t$root = json_decode($curl_response);\n\t\t//print_r($root); // print entire json response\n\t\t//echo $root->Id.\" \".$root->CreationDate.\" \".$root->Name.\"\\n\";\n\t\tif (property_exists($root, \"Children\")) {\n\t\t\tforeach($root->Children as $child) {\n\t\t\t\t//echo $child->Id.\" \".$child->CreationDate.\" \".$child->Name.\"\\n\";\n\t\t\t}\n\t\t}\n\t}",
"public function getAccount(){\n\t\t$db = $this->getDbTable()->getAdapter();\n\t\t$query = $db->select()\n\t\t->from( array('a'=>'account'), array('id','name','number','orientation') )\n\t\t->join(array( 'at'=>'accountType' ), 'a.accountTypeid=at.id', array('accountTypeName'=>'at.name'))\t\t\n\t\t->where('a.id=?',$this->getId());\t\t\n\n\t\t$results = $db->fetchAll( $query );\n\t\t$container = array();\t\t\n\t\tif( isset( $results ) ){\n\t\t\t$container = array_shift($results);\n\t\t\treturn $container;\n\t\t}\n\t\telse{\n\t\t return null;\n\t\t}\t\n\t}",
"public function tree() {\n\t\t\t$this->listAll();\n\t\t\tif ($this->return[\"status\"] == \"success\") {\n\t\t\t\t$this->return[\"results\"] = catToTree($this->return[\"results\"],true);\n\t\t\t\t$up = isset($this->req[\"up\"]) ? $this->req[\"up\"] : 0;\n\t\t\t\t$this->return[\"results\"] = $this->return[\"results\"][$up];\n\t\t\t}\n\t\t}",
"public function getTree() {\n /**\n * A pid is passed in via the drupal menu that represents the page your on. A second pid is\n * passed by the tree when the nod is expanded. This requested_pid is the pid passed by the tree.\n * If it is not set or if it is root, then we want to build the tree based on the root node,\n * otherwise build the tree for the passed node.\n */\n if (module_exists('sidora_performance_monitor')) sidora_performance_monitor_start(\"f:getTree\");\n $requested_pid = (!isset($this->node) || $this->node == 'root') ? $this->root : $this->node;\n $this->getParents($this->pid); // Sets an instance variable used in other functions thoughout this function.\n if (module_exists('sidora_performance_monitor')) sidora_performance_monitor_start(\"c:buildTree\");\n $tree = $this->buildTree($requested_pid);\n if (module_exists('sidora_performance_monitor')) sidora_performance_monitor_write_out(\"c:buildTree\",\"tree builder\");\n if (module_exists('sidora_performance_monitor')) sidora_performance_monitor_write_out(\"f:getTree\",\"tree creator\");\n return json_encode(array('success' => TRUE, 'data' => $tree, 'parents' => $this->parents));\n }",
"public function getAccountHierarchy($id, $listColumns = false)\n\t{\n\t\t\\App\\Log::trace('Entering getAccountHierarchy(' . $id . ') method ...');\n\n\t\t$listViewHeader = [];\n\t\t$listViewEntries = [];\n\t\t$listColumns = $listColumns ? $listColumns : App\\Config::module('Accounts', 'COLUMNS_IN_HIERARCHY');\n\t\tif (empty($listColumns)) {\n\t\t\t$listColumns = $this->list_fields_name;\n\t\t}\n\n\t\t$hierarchyFields = [];\n\t\tforeach ($listColumns as $fieldLabel => $fieldName) {\n\t\t\tif (\\App\\Field::getFieldPermission('Accounts', $fieldName)) {\n\t\t\t\t$listViewHeader[] = $fieldLabel;\n\t\t\t}\n\t\t\t$field = \\App\\Field::getFieldInfo($fieldName, 'Accounts');\n\t\t\t$hierarchyFields[] = $field;\n\t\t}\n\t\t$this->hierarchyFields = $hierarchyFields;\n\t\t$accountsList = [];\n\n\t\t// Get the accounts hierarchy from the top most account in the hierarch of the current account, including the current account\n\t\t$encounteredAccounts = [$id];\n\t\t$accountsList = $this->__getParentAccounts($id, $accountsList, $encounteredAccounts);\n\t\t$baseId = current(array_keys($accountsList));\n\t\t$accountsList = [$baseId => $accountsList[$baseId] ?? []];\n\t\t// Get the accounts hierarchy (list of child accounts) based on the current account\n\t\t$accountsList[$baseId] = $this->__getChildAccounts($baseId, $accountsList[$baseId], $accountsList[$baseId]['depth']);\n\t\t$this->getHierarchyData($id, $accountsList[$baseId], $baseId, $listViewEntries);\n\t\t\\App\\Log::trace('Exiting getAccountHierarchy method ...');\n\t\treturn ['header' => $listViewHeader, 'entries' => $listViewEntries];\n\t}",
"public function getAccountTree(ManagedCustomer $account, $accounts, $links) : Array\n {\n return [\n 'name' => $account->name,\n 'id' => $account->customerId,\n 'accounts' => array_key_exists($account->customerId, $links) ?\n array_map(function (\\ManagedCustomerLink $childLink) use($accounts, $links) {\n return $this->getAccountTree($accounts[$childLink->clientCustomerId], $accounts, $links);\n }, $links[$account->customerId]) : []\n ];\n }",
"function getAccountById(string $id){\nreturn $this->get(\"/ledger/account/{$id}\");\n}",
"private function getTree() \n {\n $tree = new Warecorp_Tree('zanby_groups__hierarchy_tree');\n return $tree->getTree($this->getId(), '*', false);\n }",
"public function tree(){\n $this->query();\n $ot=$this->fetch();\n\n $ors=new Ontology_relationships($this->cfg,['ontology_term_id'=>$ot['ontology_term_id']]);\n $ors->query();\n $or=$ors->fetch();\n\n // If no relationships just return a list of items. \n if(null==$or){\n $out=[];\n while($ot){\n\tarray_push($out,$ot);\n\t$ot=$this->fetch();\n }\n return $out;\n }\n\n // else, if we have relationships\n $out=[];\n while($ot){\n $op_id=$or['ontology_parent_id'];\n if(null==$op_id){\n\t$out['root']=$ot;\n }else{\n\tif(array_key_exists($op_id,$out)){\n\t array_push($out[$op_id],$ot);\n\t}else{\n\t $out[$op_id]=[$ot];\n\t}\n }\n \n $ot=$this->fetch();\n if($ot){\n\t$ors=new Ontology_relationships($this->cfg,['ontology_term_id'=>$ot['ontology_term_id']]);\n\t$ors->query();\n\t$or=$ors->fetch_one('tree');\n }\n }\n return $out;\n }",
"public function account() {\n\t\tif ($this->params['loggedIn']) {\n\t $this->getURIData();\n\t\t\t$func = \"view\";\n\t\t\tif (isset($this->uriVars['id'])) {\n\t\t\t\t$func = $this->uriVars['id'];\n\t\t\t} else if (isset($this->uriVars['mode'])) {\n\t\t\t\t$func = $this->uriVars['mode'];\n\t\t\t} // END if\n\t\t\t$this->data['account'] = $this->auth->accountDetails();\n\t\t\t/*--------------------------------------\n\t\t\t/\tView the account details\n\t\t\t/-------------------------------------*/\n\t\t\tif ($func == \"view\") {\n\t\t\t\t$levelStr = '';\n\t\t\t\tif ($this->data['account']->levelId != -1 && $this->data['account']->levelId != 0) {\n\t\t\t\t\t$levelList = loadSimpleDataList('userLevel');\n\t\t\t\t\tforeach($levelList as $key => $value) {\n\t\t\t\t\t\tif ($this->data['account']->levelId == $key) {\n\t\t\t\t\t\t\t$levelStr = \"L\".$key.\" - \".$value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} // END if\n\t\t\t\t\t} // END foreach\n\t\t\t\t} // END if\n\t\t\t\t$this->data['account']->userLevel = $levelStr;\n\t\t\t\t\n\t\t\t\t$typeStr = '';\n\t\t\t\tif ($this->data['account']->typeId != -1 && $this->data['account']->typeId != 0) {\n\t\t\t\t\t$typeList = loadSimpleDataList('userType');\n\t\t\t\t\tforeach($typeList as $key => $value) {\n\t\t\t\t\t\tif ($this->data['account']->typeId == $key) {\n\t\t\t\t\t\t\t$typeStr = $value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} // END if\n\t\t\t\t\t} // END foreach\n\t\t\t\t} // END if\n\t\t\t\t$this->data['account']->userType = $typeStr;\n\t\t\t\t\n\t\t\t\t$accessStr = '';\n\t\t\t\tif ($this->data['account']->accessId != -1 && $this->data['account']->accessId != 0) {\n\t\t\t\t\t$accessList = loadSimpleDataList('accessLevel');\n\t\t\t\t\tforeach($accessList as $key => $value) {\n\t\t\t\t\t\tif ($this->data['account']->accessId == $key) {\n\t\t\t\t\t\t\t$accessStr = \"L\".$key.\" - \".$value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} // END if\n\t\t\t\t\t} // END foreach\n\t\t\t\t} // END if\n\t\t\t\t$this->data['account']->accessLevel = $accessStr;\n\t\t\t\t$this->params['subTitle'] = $this->data['subTitle'] = 'Account Details';\n\t\t\t\t$this->params['content'] = $this->load->view($this->views['ACCOUNT'], $this->data, true);\n\t\t\t\t$this->makeNav();\n\t\t\t\t$this->displayView();\n\t\t\t/*--------------------------------------\n\t\t\t/\tEdit the account details\n\t\t\t/-------------------------------------*/\n\t\t\t} else {\n\t\t\t\t$this->form_validation->set_rules('email', 'Email Address', 'required|trim|valid_email');\n\t\t\t\t$this->form_validation->set_error_delimiters('<p class=\"error\">', '</p>');\n\t\t\t\t\n\t\t\t\tif ($this->form_validation->run() == false) {\n\t\t\t\t\t$this->params['subTitle'] = $this->data['subTitle'] = 'Edit Account';\n\t\t\t\t\t$this->data['input'] = $this->input;\n\t\t\t\t\t$this->params['content'] = $this->load->view($this->views['ACCOUNT_EDIT'], $this->data, true);\n\t\t\t\t\t$this->params['pageType'] = PAGE_FORM;\n\t\t\t\t\t$this->makeNav();\n\t\t\t\t\t$this->displayView();\n\t\t\t\t} else {\n\t\t\t\t\tif ($this->input->post('email') != $this->data['account']->email) {\n\t\t\t\t\t\t$this->db->select('email')->from('users_core')->where('email',$this->input->post('email'));\n\t\t\t\t\t\t$query = $this->db->get();\n\t\t\t\t\t\tif ($query->num_rows() != 0) {\n\t\t\t\t\t\t\t$this->session->set_flashdata('message', '<p class=\"error\">Account Update Failed. The email address <b>'.$this->input->post('email').'</b> is already in use. Please choose a different e-mail address.</p>');\n\t\t\t\t\t\t\tredirect('user/account/edit');\n\t\t\t\t\t\t} // END if\n\t\t\t\t\t} // END if\n\t\t\t\t\t$session_auth = $this->session->userdata($this->config->item('session_auth'));\n\t\t\t\t\t$change = $this->auth->account_update($this->input,$session_auth);\n\t\t\t\t\tif ($change) {\n\t\t\t\t\t\t$this->session->set_flashdata('message', '<p class=\"success\">Your account details were successfully changed.</p>');\n\t\t\t\t\t\tredirect('user/account');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$message = '<p class=\"error\">Account Update Failed.';\n\t\t\t\t\t\tif ($this->auth->get_status_code() != 0) {\n\t\t\t\t\t\t\t$message .= ' '.$this->auth->get_status_message().'</p>';\n\t\t\t\t\t\t} // END if\n\t\t\t\t\t\t$message .= '</p >';\n\t\t\t\t\t\t$this->session->set_flashdata('message', $message);\n\t\t\t\t\t\tredirect('user/account/edit');\n\t\t\t\t\t} // END if\n\t\t\t\t} // END if\n\t\t\t} // END if\n\t } else {\n\t $this->session->set_flashdata('loginRedirect',current_url());\t\n\t\t\tredirect('user/login');\n\t } // END if\n\t}",
"public function getTreeData()\n {\n $data = [\n 'data' => __(\"Trees\"),\n 'type' => 'class',\n 'attributes' => [\n 'id' => \\tao_helpers_Uri::encode($this->getRootClass()->getUri()),\n 'class' => 'node-class',\n 'data-uri' => $this->getRootClass()->getUri()\n ],\n\n ];\n\n $sublasses = $this->getRootClass()->getSubClasses(false);\n\n if (count($sublasses)) {\n $data['children'] = [];\n }\n\n foreach ($sublasses as $class) {\n $data['children'][] = [\n 'data' => $class->getLabel(),\n 'type' => 'instance',\n 'attributes' => [\n 'id' => \\tao_helpers_Uri::encode($class->getUri()),\n 'class' => 'node-instance',\n 'data-uri' => $class->getUri()\n ]\n ];\n }\n\n //retrieve resources permissions\n $user = $this->getSession()->getUser();\n $permissions = $this->getResourceService()->getResourcesPermissions($user, $data);\n\n //expose the tree\n $this->returnJson([\n 'tree' => $data,\n 'permissions' => $permissions\n ]);\n }",
"public function account()\n {\n return $this->hasOne('App\\Models\\Account', 'id_parent');\n\t}",
"public function getAccounts()\n {\n }",
"public function get_tree(){\n\t\tif(DEBUG_MODE){\n\t\t\tBLog::addToLog('[SoftModules]: get_tree()');\n\t\t\t}\n\t\t$brouter=BRouter::getInstance();\n\t\t$pages=$brouter->getsoftmodules();\n\t\tif(DEBUG_MODE){\n\t\t\tBLog::addToLog('[SoftModules]: Pages: '.var_export($pages,true));\n\t\t\t}\n\t\t$this->get_tree_node($pages);\n\t\treturn $pages;\n\t\t}",
"public function getAccount()\n {\n\n \t\t\n $query=$this->db->get('account');\n\t\t return $query->result();\n }",
"function getTree($node){\r\n\t\t$nodes = $this->display_children($node);\r\n\t\tprint json_encode($nodes);\r\n\t}",
"public function getAccounts(): array;",
"public function getPagesTree();",
"public function getTree()\n\t{\n\t\tif($this->user->hasRight('page_view'))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$this->setResponse(new Record('tree', $this->buildTreeArray()));\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}",
"public function getchildaccountinfo(){\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n $child_account_id = $this->input->post('id');\n\n $account_arr = $this->account_mod->get_child_account_by_id($child_account_id);\n //print_r($transaction_arr); exit();\n\n header('Cache-Control: no-cache, must-revalidate');\n header('Expires: ' . date('r', time() + (86400 * 365)));\n header('Content-type: application/json');\n\n echo json_encode(array(\n 'id' => $account_arr->id,\n 'name' => $account_arr->name,\n 'parent_account_id' => $account_arr->parent_account_id,\n 'description' => $account_arr->description,\n 'status' => $account_arr->status\n ));\n exit();\n }\n }",
"public function getFaresTree() \n {\n $travelService = new TravelService();\n return $travelService->getFaresTree();\n }"
] | [
"0.6911555",
"0.644326",
"0.63796514",
"0.6209639",
"0.615927",
"0.6114073",
"0.6089732",
"0.59424174",
"0.59410954",
"0.5856106",
"0.58366877",
"0.5812325",
"0.5800224",
"0.57845116",
"0.5730936",
"0.5719291",
"0.5700284",
"0.5693108",
"0.56920224",
"0.5654871",
"0.5645031",
"0.5635992",
"0.5631812",
"0.5626908",
"0.5626903",
"0.5598377",
"0.559626",
"0.55861205",
"0.5581089",
"0.5576982"
] | 0.72062624 | 0 |
Author Description $page (object) $username (string) returns the pagespecific description for a specified author | function authorDescription($page, $username) {
$description = "";
$authors = yaml($page->meta())['authors'];
foreach ($authors as $author) {
if ($author['username'] == $username) {
$description = $author['description'];
}
}
return $description;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function show_authors()\r\n{\r\n\t$tpl =& get_tpl();\r\n\t$db = get_db();\r\n\t$user = $db->query(\r\n\t'SELECT user_id AS id, user_name AS name, user_email AS email, user_website AS website, '\r\n\t\t.'author_name AS author, author_id AS authorid '\r\n\t\t.'FROM user LEFT JOIN author ON user_id=user_id_fk WHERE user_id='.$_GET['id'].' AND user_valid=1 LIMIT 1');\r\n\tif(!$user)\r\n\t{\r\n\t\tprintf('Errormessage: %s', $db->error);\r\n\t}\r\n\tif($user->num_rows < 1)\r\n\t{\r\n\t\theader('Location: index.php');\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$tpl['userinfo'] = $user->fetch_assoc();\r\n\t}\r\n\t$user->close();\r\n\t//now we grab authorage\r\n\t$authors = $db->query('SELECT usertoauthor_comment AS comment, author_id AS id, author_name AS name, author_count AS books, author_date AS date '\r\n\t\t.'FROM author LEFT JOIN usertoauthor ON author_id_fk=author_id WHERE usertoauthor.user_id_fk='.$_GET['id'].' and author_valid=1 ORDER BY author_name ASC');\r\n\tif(!$authors )\r\n\t{\r\n\t\tprintf('Errormessage: %s', $db->error);\r\n\t}\r\n\t$tpl['authors'] =& $authors;\r\n\t//page assignments\r\n\t$tpl['title'] = $tpl['userinfo']['name'].'\\'s Profile';\r\n\t$tpl['nest'] = '';\r\n\t$tpl['keywords'] = 'user profile information contact links book favorites';\r\n\t$tpl['description'] = 'Profile information for a user, show user favorite authors';\r\n\t//assign sub \"template\"\r\n\t$files['page'] = 'userauthor.html';\r\n\t//create sidebar\r\n\tinclude('../lib/sidebar.php');\r\n\t//show the \"template\"\r\n\tshow_tpl($tpl, $files);\r\n\treturn;\r\n}",
"public function ogAuthor();",
"function authors( $author )\r\n{ ?>\r\n\t<title>Author : @<?php echo( $author ); ?> - <?php showOption( 'name' ); ?></title><?php\r\n\t$posts = $GLOBALS['JBLDB'] -> select( 'posts', '*', array( 'state' => 'published', 'ilk' => 'article', 'author' => $author ), array( 'created', 'DESC') );\r\n\tif ( !isset( $post['error'] ) ) {\r\n\t\trequire_once( _ABSTHEMES_ . getOption( 'activetheme' ) .'/templates/archive.php' );\r\n\t} else {\r\n\t\trequire_once( _ABSTHEMES_ . getOption( 'activetheme' ) .'/templates/404.php' );\r\n\t}\r\n}",
"public function author();",
"public function author();",
"function show_profile()\r\n{\r\n\t$tpl =& get_tpl();\r\n\t$db = get_db();\r\n\t$profile = $db->query(\r\n\t'SELECT author_id AS id, author_name AS name, author_contact AS email, author_date AS date, '\r\n\t\t.'author_text AS text, user_name AS user, user_id AS userid '\r\n\t\t.'FROM author LEFT JOIN user ON user_id=user_id_fk WHERE author_id='.$_GET['id'].' AND author_valid=1 LIMIT 1');\r\n\tif(!$profile )\r\n\t{\r\n\t\tprintf('Errormessage: %s', $db->error);\r\n\t}\r\n\tif($profile ->num_rows < 1)\r\n\t{\r\n\t\theader('Location: index.php');\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$tpl['profile'] = $profile ->fetch_assoc();\r\n\t}\r\n\t$profile ->close();\r\n\t//page assignments\r\n\t$tpl['title'] = $tpl['profile']['name'].'\\'s Profile';\r\n\t$tpl['nest'] = '';\r\n\t$tpl['keywords'] = 'author profile information contact links';\r\n\t$tpl['description'] = 'Profile information for an author';\r\n\t//assign sub \"template\"\r\n\t$files['page'] = 'author.html';\r\n\t//create sidebar\r\n\tinclude('../lib/sidebar.php');\r\n\t//show the \"template\"\r\n\tshow_tpl($tpl, $files);\r\n\treturn;\r\n}",
"function templatic_customize_supreme_author_bio_pages( $setting, $object ) {\r\n\t\tif ( \"supreme_theme_settings[supreme_author_bio_pages]\" == $object->id && !current_user_can( 'unfiltered_html' ) )\r\n\t\t\t$setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) );\r\n\t\t/* Return the sanitized setting and apply filters. */\r\n\t\treturn apply_filters( \"templatic_customize_supreme_author_bio_pages\", $setting, $object );\r\n\t}",
"public function getAuthorName();",
"public function findByAuthor($slug, $page, $size);",
"function profileedit_page_handler($page) {\n\n\t\t\tglobal $CONFIG;\n\n\t\t\t// The username should be the file we're getting\n\t\t\tif (isset($page[0])) {\n\t\t\t\tswitch ($page[0])\n\t\t\t\t{\n\t\t\t\t\tdefault: include($CONFIG->pluginspath . \"profile/defaultprofile.php\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t}",
"function pendrell_author_info( $avatar = true ) {\n\n // Exit early if the author has no description\n if ( !get_the_author_meta( 'description' ) )\n return;\n\n // Initialize\n $output = $avatar_html = '';\n $author = '<span class=\"p-name p-author fn\">' . get_the_author() . '</span>';\n\n // Author description\n $output .= get_the_author_meta( 'description' );\n\n // Only add this stuff to author info boxes\n if ( is_singular() ) {\n $output = '<h3>' . $author . '</h3>' . $output;\n if ( is_multi_author() )\n $output .= '<footer class=\"author-link\"><a href=\"' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '\" rel=\"author\">' . sprintf( __( 'View all posts by %s<span class=\"nav-arrow\"> →</span>', 'pendrell' ), $author ) . '</a></footer>';\n }\n\n // Wrap the author description\n $output = '<div class=\"author-description\">' . $output . '</div>';\n\n // Avatar handling\n if ( $avatar === true ) {\n $avatar_html = pendrell_author_avatar( get_the_author_meta( 'user_url' ), PENDRELL_BASELINE * 4 ); // Must match the value in `/src/scss/lib/_author.scss'\n if ( !empty ( $avatar_html ) )\n $output = '<div class=\"author-avatar\">' . $avatar_html . '</div>' . $output;\n }\n\n // Wrap it all up and return\n return '<div class=\"author author-info h-card\">' . $output . '</div>';\n}",
"function wrny_author_info() {\n\t\n\tif( !get_post_meta( get_the_ID(), 'hide_author_info', true ) ) {\n\t\n\t\techo '<div id=\"author-info\">';\n\t\t\n\t\tif( function_exists( 'coauthors' ) ) {\n\t\t\t$coauthors = get_coauthors();\n\t\t\t\n\t\t\tforeach( $coauthors as $coauthor ) {\n\t\t\t\n\t\t\t\t// set some vars\n\t\t\t\t$name = $coauthor->display_name;\n\t\t\t\t$bio = $coauthor->description;\n\t\t\t\t$url = get_home_url() . '/author/' . $coauthor->user_nicename;\n\t\t\t\t\n\t\t\t\tif( $coauthor->type == 'guest-author' ) {\n\t\t\t\t\t// guest author\n\t\t\t\t\t$author_id = $coauthor->ID;\n\t\t\t\t} else {\n\t\t\t\t\t// wp user\n\t\t\t\t\t$author_id = get_the_author_meta( 'ID', $coauthor->ID );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// author box\n\t\t\t\techo '\t<div class=\"author-info-box\">';\n\t\t\t\techo '\t\t<a href=\"' . $url . '\">';\n\n\t\t\t\tuserphoto_the_author_thumbnail();\t\t\t\t\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\tif( has_post_thumbnail( $author_id ) ) {\n\t\t\t\t\techo get_the_post_thumbnail( $author_id, 'author-thumb' );\n\t\t\t\t} else {\n\t\t\t\t\tuserphoto_the_author_thumbnail();\t\t\t\t\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\techo '\t\t</a>';\t\t\t\t\n\t\t\t\techo '\t\t<h3><a href=\"' . $url . '\">' . $name . '</a></h3>';\n\t\t\t\techo '\t\t<p>' . $bio . '</p>';\n\t\t\t\techo '\t\t<div class=\"clear\"></div>';\n\t\t\t\techo '\t</div><!--.author-info-box-->';\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\techo '</div><!--#author-info-->';\n\t\t\n\t}\n\t\n}",
"function inkpro_author_info_blox() {\r\n\r\n\tif (\r\n\t\tis_single()\r\n\t\t&& get_the_author_meta( 'description' )\r\n\t\t&& ! wolf_get_theme_mod( 'blog_hide_author' )\r\n\t\t&& 'post' == get_post_type() || 'review' == get_post_type()\r\n\t)\r\n\t{\r\n\t\tget_template_part( 'partials/author-bio' );\r\n\t}\r\n}",
"function GetAuthor()\r\n\t{\r\n\t\treturn \"Pierre-Luc Germain (plger on the forge & forum)\";\r\n\t}",
"public function findRecipesByAuthor(int $page = 1, $user): Pagerfanta\n {\n $query = $this->getEntityManager()\n ->createQuery(\"\n SELECT r\n FROM App:Recipe r\n WHERE r.author = '{$user->getId()}'\n OR r.isPublic = true\n ORDER BY r.publishedAt DESC\n \")\n ;\n return $this->createPaginator($query, $page);\n }",
"public function getTitles($username);",
"function write_author_profile() {\n\tif ( get_post_format() || get_theme_mod( 'write_hide_author_profile' ) ) {\n\t\treturn;\n\t}\n\t?>\n\t<div class=\"author-profile\">\n\t\t<div class=\"author-profile-avatar\">\n\t\t\t<?php echo get_avatar( get_the_author_meta( 'ID' ), 75 ); ?>\n\t\t</div><!-- .author-profile-avatar -->\n\t\t<div class=\"author-profile-meta\">\n\t\t\t<div class=\"author-profile-name\"><strong><a class=\"author-profile-description-link\" href=\"<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>\" rel=\"author\"><?php the_author() ?></a></strong></div>\n\t\t</div><!-- .author-profile-meta -->\n\t\t<div class=\"author-profile-description\">\n\t\t\t<?php the_author_meta( 'description' ); ?>\n\t\t</div><!-- .author-profile-description -->\n\t</div><!-- .author-profile -->\n\t<?php\n}",
"public function theAuthorMeta($field = '')\n {\n echo $this->Hook->applyFilters('the_author_' . $field, $this->getTheAuthorMeta($field), $this->user_id);\n }",
"function cmsms_post_author($template_type = 'page', $show = true) {\r\n\tif ($template_type == 'page') {\r\n\t\t$out = '<span class=\"cmsms_post_user_name\">' . \r\n\t\t\tesc_html__('by', 'yoga-fit') . ' ' . \r\n\t\t\t'<a href=\"' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '\" title=\"' . esc_attr__('Posts by', 'yoga-fit') . ' ' . esc_attr(get_the_author_meta('display_name')) . '\" class=\"vcard author\"><span class=\"fn\" rel=\"author\">' . esc_html(get_the_author_meta('display_name')) . '</span></a>' . \r\n\t\t'</span>';\r\n\t} elseif ($template_type == 'post') {\r\n\t\t$cmsms_option = cmsms_get_global_options();\r\n\t\t$out = '';\r\n\t\t\r\n\t\tif ($cmsms_option[CMSMS_SHORTNAME . '_blog_post_author']) {\r\n\t\t\t$out .= '<span class=\"cmsms_post_user_name\">' . \r\n\t\t\t\tesc_html__('by', 'yoga-fit') . ' ' . \r\n\t\t\t\t'<a href=\"' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '\" title=\"' . esc_attr__('Posts by', 'yoga-fit') . ' ' . esc_attr(get_the_author_meta('display_name')) . '\" class=\"vcard author\"><span class=\"fn\" rel=\"author\">' . esc_html(get_the_author_meta('display_name')) . '</span></a>' . \r\n\t\t\t'</span>';\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tif ($show) {\r\n\t\techo $out;\r\n\t} else {\r\n\t\treturn $out;\r\n\t}\r\n}",
"function nuqneH_print_post_author( $author ) {\r\n print '<div class=\"just-an-author\">' . get_the_author_meta( 'nickname', $author ) . '</div>' ;\r\n}",
"function humanstxt()\n{\n?>\n <link type=\"text/plain\" rel=\"author\" href=\"<?php echo get_site_url(null, '/humans.txt'); ?>\" />\n<?php\n}",
"public function setAuthorUsername($username) {\n $this->authorUsername = $username;\n }",
"function seth_godin_stuff () {\nif (is_single()) {\n?>\n<p class=\"after_post\"><?php the_author_meta('description'); ?><p/>\n<?php\n}\n}",
"function page_list($username, $offset = 0, $limit = 20, $sort = 'relevance', $order = 'desc')\t{\n\tif(!$username){\n\t\t$user = elgg_get_logged_in_user_entity();\n\t} else {\n\t\t$user = get_user_by_username($username);\n\t}\n\t\n\tif (!$user) {\n\t\tthrow new InvalidParameterException('registration:usernamenotvalid');\n\t}\n\t// set up params\n\t$params = array(\n\t\t'username' => $username,\n\t\t'offset' => $offset,\n\t\t'limit' => $limit,\n\t\t'sort' => $sort,\n\t\t'order' => $order\n\t);\n\tif($username){\n\t\t$result[\"pages\"]=json_decode(elgg_view_resource('pages/owner',$params));\n\t}else{\n\t\t$result[\"pages\"]=\"Please give username\";\n\t}\n\t\n\treturn $result;\n}",
"function the_authors() {\n\techo get_the_authors($id);\n}",
"public function get_author()\n {\n return 'Kamen Blaginov / Chris Graham / temp1024';\n }",
"function authorSelector($author=NULL) {\n\tglobal $_zp_authority,$_zp_current_admin_obj;\n\tif (empty($author)) {\n\t\t$author = $_zp_current_admin_obj->getUser();\n\t}\n\t$authors = array($author=>$author);\n\tif (zp_loggedin(MANAGE_ALL_PAGES_RIGHTS | MANAGE_ALL_NEWS_RIGHTS)) {\n\t\t$admins = $_zp_authority->getAdministrators();\n\t\tforeach($admins as $admin) {\n\t\t\tif($admin['rights'] & (ADMIN_RIGHTS | ZENPAGE_PAGES_RIGHTS | ZENPAGE_NEWS_RIGHTS)) {\n\t\t\t\t$authors[$admin['user']] = $admin['user'];\n\t\t\t}\n\t\t}\n\t}\n\t?>\n\t<select size='1' name=\"author\" id=\"author\">\n\t\t<?php\n\t\tgenerateListFromArray(array($author), $authors, false, false);\n\t\t?>\n\t</select>\n\t<?php\n}",
"function ys_display_profile($userid= '' ) {\n if ( $userid== '' ) {\n global $authordata;\n $author = $authordata;\n } else {\n $author = get_userdata( $userid);\n }\n\n\n // Create output in selected post page\n $ys_show_profile = '\n\t<div class=\"ys-str-display\" id=\"your_sign-bio-\">\n\n\t\t<div class=\"ys_avatar\">';\n $ys_show_profile .= get_avatar( $author->ID, 80 );\n $user_info = get_userdata(1);\n //$post_info .= get_the_date('l, F j, Y');\n\n $ys_show_profile .= '</div>\n <ul class=\"bloc\">\n\n <li class=\"ys_profile\">';\n\n $ys_get_author_public_name = apply_filters( 'ys_get_author_public_name', 'rel=\"nofollow\"' );\n\n if( $author->user_url ) {\n $ys_show_profile .= '<h4><a href=\"' . $author->user_url . '\" ' . $ys_get_author_public_name . '>' . $author->display_name . '</a></h4>';\n } else {\n $ys_show_profile .= '<h4>' . $author->display_name . '</h4>';\n }\n\n $ys_show_profile .= '\n\t\t</li>\n \t\t\t<li class=\"ys_user_role\">' . implode (',',$user_info->roles). '</li>\n \t\t\t</ul>\n\n\n <ul class=\"bloc-2\">\n\n\t\t\t<li class=\"ys_post_date\">' .date_i18n( get_option ( 'date_format' ), get_the_time( 'U' ) ) .'</li>\n\n\t\t\t<li class=\"ys_previous_posts\"><a href=\"' . get_author_posts_url( $author->ID ) . '\" rel=\"nofollow\">' . __( 'previous posts', 'ys-trad' ) . '</a></li>\n </ul>\n\n \t\t\t<div class=\"ys_description bloc-3\" >\"'. $author->user_description.'\"</div>\n\n\t</div>';\n\n return $ys_show_profile;\n}",
"function PLG_getPLGAuthor($fileName)\n{\n return(PLG_getPluginValue($fileName,\"pluginAuthor\"));\n}",
"function hide_author_on_pages() {\n\t\tremove_meta_box( 'commentsdiv', 'page', 'normal' );\n\t\tremove_meta_box( 'commentstatusdiv', 'page', 'normal' );\n\t}"
] | [
"0.62916845",
"0.62119484",
"0.6055806",
"0.60501844",
"0.60501844",
"0.5998331",
"0.5910883",
"0.58686775",
"0.5865945",
"0.5840375",
"0.58290136",
"0.5796925",
"0.57762355",
"0.5762588",
"0.57539773",
"0.5664959",
"0.56512773",
"0.56470406",
"0.5640103",
"0.5639904",
"0.5629025",
"0.56287366",
"0.5619581",
"0.5607289",
"0.5602825",
"0.55971515",
"0.5576148",
"0.5575052",
"0.55745816",
"0.5538342"
] | 0.8533945 | 0 |
String to Excerpt Used when saving pages to create the excerpt field again Gets the first 300 characters, removes Markdown headings, converts the remainder to HTML, strips tags and encoded characters, and removes any (completed) kirbytags Used for page saving with just the new text | function stringToExcerpt($string) {
$temp = $string;
$temp = kirbytext($temp); // Turn into HTML
$temp = strip_tags($temp); // Remove all HTML tags
$temp = preg_replace( "/\r|\n/", " ", $temp); // Remove line breaks
$temp = substr($temp, 0, 300); // Limit to 300 characters
$temp = preg_match('/(.*)\s/', $temp, $matches); // Remove anything after the last complete word
if (isset($matches[1])) {
$temp = $matches[1];
} else {
$temp = "";
}
return $temp;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function keativa_excerpt($kea_text) {\n $chars = 250;\n $kea_text = $kea_text.\" \";\n $kea_text = substr($kea_text,0,$chars);\n $kea_text = substr($kea_text,0,strrpos($kea_text,' '));\n $kea_text = $kea_text.\"...\";\n\t\t$kea_text = html_entity_decode(strip_tags($kea_text));\n return $kea_text;\n }",
"function excerpt($string) {\n $string = substr($string, 0, 100); //hanya menampilkan 10 karakter awal\n\n return $string . '...';\n}",
"public function getExcerpt()\n {\n // return substr(strip_tags($this->body),0,150).'...';\n $s = substr(strip_tags($this->body),0,150);\n return substr($s, 0, strrpos($s, ' ')).'...';\n }",
"protected function buildExcerpt()\n {\n if (isset($this->matter['excerpt'])) {\n return ;\n }\n\n $contents = preg_replace('~\\{%.*?%\\}|\\n|\\r~', '', $this->contents);\n $contents = preg_replace('~\\s+~', ' ', $contents);\n $contents = substr(trim(strip_tags($contents), ' .'), 0, 500);\n\n if (strpos($contents, '.') !== false) {\n $contents = substr($contents, 0, strrpos($contents, '.'));\n }\n\n $this->matter['excerpt'] = $contents;\n }",
"function improved_trim_excerpt($text) {\n\tglobal $ex_length, $ex_tags;\n\n\tif(pl_has_editor()){\n\t\t$allowed_tags = ( isset( $ex_tags ) && '' != $ex_tags ) ? $ex_tags : '';\n\t\t$excerpt_len = ( isset( $ex_length ) && '' != $ex_length ) ? $ex_length : 55;\n\t} else {\n\t\t$allowed_tags = (pl_setting('excerpt_tags')) ? pl_setting('excerpt_tags') : '';\n\t\t$excerpt_len = (pl_setting('excerpt_len')) ? pl_setting('excerpt_len') : 55;\n\t}\n\n\t$raw_excerpt = $text;\n\tif ( '' == $text ) {\n\t\t$text = get_the_content('');\n\n\t\t$text = strip_shortcodes( $text );\n\n\n\t\t$text = apply_filters('the_content', $text);\n\n\t\t$text = preg_replace('@<script[^>]*?>.*?</script>@si', '', $text); // PageLines - Strip JS\n\n\t\t$text = str_replace(']]>', ']]>', $text);\n\n\t\t$text = strip_tags($text, $allowed_tags); // PageLines - allow more tags\n\n\n\t\t$excerpt_length = apply_filters('excerpt_length', $excerpt_len );\n\t\t$excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');\n\n\t\t$words = preg_split('/[\\n\\r\\t ]+/', $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY);\n\n\t\tif ( count($words) > $excerpt_length ) {\n\t\t\tarray_pop($words);\n\t\t\t$text = implode(' ', $words);\n\t\t\t$text = $text . $excerpt_more;\n\t\t} else\n\t\t\t$text = implode(' ', $words);\n\n\t}\n\treturn apply_filters('wp_trim_excerpt', $text, $raw_excerpt);\n}",
"function adventure_tours_do_excerpt( $string, $word_limit ) {\n\t\tif ( $string ) {\n\t\t\tif ( '0' === $word_limit || 0 === $word_limit ) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\t$string = strip_shortcodes( $string );\n\t\t\t$string = $word_limit > 0 ? wp_trim_words( $string, $word_limit, '') : wp_strip_all_tags( $string );\n\t\t}\n\n\t\treturn $string;\n\t}",
"public function getExcerptAttribute()\n {\n $chapeau = strip_tags($this->chapeau, '<b><i><strong><em>');\n $content = strip_tags($this->content, '<b><i><strong><em>');\n\n return str_limit($chapeau . $content, 200);\n }",
"function custom_excerpt($content, $lenght){\r\n\t\t$content = strip_tags($content, '<p><br />');\r\n\t\t$content = substr($content, 0, $lenght);\r\n\t\treturn $content;\r\n\t}",
"public static function makeExcerpt($str, $length=180, $hellip=false)\n {\n\n // Ensure that the excerpt is parsed but prevent the [[smarty]] tags from being executed\n // $str = parse_intro_or_body($str, false, 0, true);\n // remove the [[smarty]] tags for clean output\n $str = preg_replace('/\\[\\[.*\\]\\]/', ' ', $str);\n\n $from = array(\""\", \"\\n\", \"\\r\", \">\");\n $to = array('\"', \" \", \" \", \"> \");\n\n $excerpt = str_replace($from, $to, $str);\n $excerpt = strip_tags(@html_entity_decode($excerpt, ENT_NOQUOTES, 'UTF-8'));\n $excerpt = trim(preg_replace(\"/\\s+/i\", \" \", $excerpt));\n $excerpt = Tools::trimText($excerpt, $length, false, $hellip);\n\n return $excerpt;\n\n }",
"public function excerpt() : string\n {\n $firstNonEmptyParagraph = $this->content()->filter(static function (Fragment $fragment) : bool {\n return $fragment instanceof TextElement && $fragment->isParagraph() && ! $fragment->isEmpty();\n })->first();\n\n if (! $firstNonEmptyParagraph instanceof TextElement) {\n return '';\n }\n\n $words = array_slice(explode(' ', $firstNonEmptyParagraph->text()), 0, 50);\n return implode(' ', $words) . '…';\n }",
"function excerpt_new($num){\n\n $excerpt = get_the_content();\n\n $excerpt = strip_shortcodes($excerpt);\n\n $excerpt = strip_tags($excerpt);\n\n $the_str = substr($excerpt, 0, $num);\n\n echo $the_str .\"...\";\n\n}",
"function dr_get_clean_excerpt( $excerpt ) {\n\n\t$excerpt = wpautop( wp_strip_all_tags( $excerpt ) );\n\n\treturn $excerpt;\n\n}",
"function custom_trim_excerpt($text) { \n\tglobal $post;\n\tif ( '' == $text ) {\n\t\t$text = get_the_content('');\n\t\t$text = apply_filters('the_content', $text);\n\t\t$text = str_replace(']]>', ']]>', $text);\n\t\t$text = strip_tags($text);\n\t\t$excerpt_length = 800;\n\t\t$words = explode(' ', $text, $excerpt_length + 1);\n\t\tif (count($words) > $excerpt_length) {\n\t\t\tarray_pop($words);\n\t\t\tarray_push($words, '...');\n\t\t\t$text = implode(' ', $words);\n\t\t}\n\t}\n\treturn $text;\n}",
"function custom_wp_trim_excerpt($text, $allowed_tags = '<p>,<h1>,<h2>,<h3>,<h4>,<h5>,<h6>,<blockquote>,<pre>,<code>,<hr />,<br>,<br />', $excerpt_word_count = 60, $excerpt_end = '') {\n\t/* Set default value for excerpt_end */\n\tif($excerpt_end) $excerpt_end = '... <a href=\"'. get_permalink($post->ID) . '\">' . __(\"more\",\"scapegoat\") .' →</a>';\n\t$raw_excerpt = $text;\n\tif ( '' == $text ) {\n\t\t/* Retrieve the post content */\n\t\t$text = get_the_content('');\n \n\t\t/* Delete all shortcode tags from the content */\n\t\t$text = strip_shortcodes( $text );\n \n\t\t$text = apply_filters('the_content', $text);\n\t\t$text = str_replace(']]>', ']]>', $text);\n \n \t\t/* Add the allowed HTML tags separated by a comma */\n\t\t$text = strip_tags($text, $allowed_tags);\n \n \t\t/* Change the excerpt word count to any integer you like */\n\t\t$excerpt_length = apply_filters('excerpt_length', $excerpt_word_count);\n \n \t\t/* Change the excerpt endind to something else */\n\t\t$excerpt_more = apply_filters('excerpt_more', ' ' . $excerpt_end);\n \n\t\t$words = preg_split(\"/[\\n\\r\\t ]+/\", $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY);\n\t\tif ( count($words) > $excerpt_length ) {\n\t\t\tarray_pop($words);\n\t\t\t$text = implode(' ', $words);\n\t\t\t$text = $text . $excerpt_more;\n\t\t} else {\n\t\t\t$text = implode(' ', $words);\n\t\t}\n\t}\n\treturn apply_filters('wp_trim_excerpt', $text, $raw_excerpt);\n}",
"function icopyright_trim_excerpt($text) {\r\n $raw_excerpt = $text;\r\n $isSingle = is_single();\r\n $isPage = is_page();\r\n if ($isSingle || $isPage) {\r\n return apply_filters('icopyright_trim_excerpt', $text, $raw_excerpt);\r\n }\r\n\r\n //if empty text\r\n if ('' == $text) {\r\n //if there is no excerpt crafted from add post admin\r\n //WordPress will use the_content instead.\r\n //therefore we need to remove tools filter in content,\r\n //so as not to cause duplicate,\r\n //anyway the strip_tags below will cause the tools bars to malfunction\r\n\t\tremove_filter('the_content', 'auto_add_icopyright_toolbars');\r\n\r\n //The following are default wp_trim_excerpt() behaviour, left for theme compatibility.\r\n //codes copy and paste from wp_trim_excerpt with added explanation.\r\n\r\n //if empty use content.\r\n $text = get_the_content('');\r\n \r\n //remove shortcodes\r\n $text = strip_shortcodes($text);\r\n //apply content filters\r\n $text = apply_filters('the_content', $text);\r\n \r\n //replace > with html character entity to prevent script executing.\r\n $text = str_replace(']]>', ']]>', $text);\r\n \r\n //excerpt_length filter, default 55 words\r\n $excerpt_length = apply_filters('excerpt_length', 55);\r\n //excerpt_more filter, default [...]\r\n $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');\r\n // split the phrase by any number of commas or space characters,\r\n // which include \" \", \\r, \\t, \\n and \\f\r\n \r\n // code from wp_trim_words in formatting.php\r\n $text = preg_replace( '@<(script|style)[^>]*?>.*?</\\\\1>@si', '', $text );\r\n $text = strip_tags($text);\r\n \r\n $text = trim( $text); \r\n \r\n \r\n $words = preg_split(\"/[\\n\\r\\t ]+/\", $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY);\r\n if (count($words) > $excerpt_length) {\r\n array_pop($words);\r\n $text = implode(' ', $words);\r\n $text = $text . $excerpt_more;\r\n } else {\r\n $text = implode(' ', $words);\r\n }\r\n }\r\n return apply_filters('icopyright_trim_excerpt', $text, $raw_excerpt);\r\n\r\n}",
"function trim_excerpt($text) {\n return $text . '…';\n}",
"function gentle_my_excerpt($string, $word_limit) {\n\t$words = explode(' ', $string, ($word_limit + 1));\n\tif (count($words) > $word_limit)\n\t array_pop($words);\n\n\t//$content = preg_replace('/<img[^>]+./','', $words);\n\n\treturn strip_tags(implode(' ', $words) . '...');\n}",
"function custom_trim_excerpt($text) {\n\n global $post;\n\n if ( '' == $text ) {\n\n $text = get_the_content('');\n $text = apply_filters('the_content', $text);\n $text = str_replace(']]>', ']]>', $text);\n $text = strip_tags($text);\n $excerpt_length = 15;\n $words = explode(' ', $text, $excerpt_length + 1);\n if (count($words) > $excerpt_length) {\n array_pop($words);\n array_push($words, '...');\n $text = implode(' ', $words);\n }\n\n }\n\n return $text;\n}",
"function improved_trim_excerpt($text = '',$wordLimit = 25) {\n if ( '' == $text ) {\n $text = get_the_content('');\n }\n\n $text = apply_filters('the_content', $text);\n $text = str_replace('\\]\\]\\>', ']]>', $text);\n $text = strip_tags($text, '<ol>,<h1>,<h2>,<h3>,<h4>,<ul>,<li>,<p>');\n $excerpt_length = $wordLimit;\n $words = explode(' ', $text, $excerpt_length + 1);\n\n if (count($words)> $excerpt_length) {\n array_pop($words);\n array_push($words, '[...]');\n $text = implode(' ', $words);\n }\n\n return $text;\n}",
"function tie_excerpt($text, $chars = 120) {\n\t$text = $text.\" \";\n\t$text = mb_substr( $text , 0 , $chars , 'UTF-8');\n\t$text = $text.\"...\";\n\treturn $text;\n}",
"function splitExcerpt() {\t}",
"function new_wp_trim_excerpt($text)\n{\n $raw_excerpt = $text;\n if ('' == $text) {\n $text = get_the_content('');\n\n $text = strip_shortcodes($text);\n\n $text = apply_filters('the_content', $text);\n $text = str_replace(']]>', ']]>', $text);\n /*\n * Hi, future...\n *\n * Maybe I should not allow iframes... but I want the videos\n * to show in the excerpt too, maybe I will remove <iframe> from\n * here and add post custom field to add video right after the post content\n */\n $text = strip_tags($text, '<a><iframe><p><br><strong><ul><li>');\n $excerpt_length = apply_filters('excerpt_length', 55);\n $excerpt_length = 155;\n\n $excerpt_more = apply_filters('excerpt_more', ' '.'[...]');\n $words = preg_split('/(<a.*?a>)|\\n|\\r|\\t|\\s/', $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);\n if (count($words) > $excerpt_length) {\n array_pop($words);\n $text = implode(' ', $words);\n $text = $text.$excerpt_more;\n } else {\n $text = implode(' ', $words);\n }\n }\n\n return apply_filters('new_wp_trim_excerpt', $text, $raw_excerpt);\n}",
"function excerpt($body, $limit) {\n if (!empty($body)) {\n $body = strip_tags($body);\n $sentences = explode(' ', $body);\n $words = \"\";\n $counter = 1;\n foreach ($sentences as $word) {\n if ($counter > $limit) {\n break;\n }\n $words .= $word.\" \";\n $counter++;\n }\n return $words.\" …\";\n }\n return false;\n }",
"function get_custom_excerpt($lenght) {\n\n if (!$lenght) {\n $lenght = 360;\n }\n\n if (has_excerpt()) {\n $excerpt = get_the_excerpt();\n } else {\n $excerpt = apply_filters('the_content', get_post_field('post_content', get_the_ID()));\n }\n\n $excerpt = wp_strip_all_tags($excerpt);\n $excerpt = mb_strimwidth($excerpt, 0, $lenght, '...');\n return $excerpt;\n\n}",
"function replace_excerpt($content) {\n return str_replace('[…]',\n '...',\n $content\n );\n}",
"function auxin_the_trim_excerpt( $post_id = null, $char_length = null, $exclude_strip_shortcode_tags = null, $skip_more_tag = false, $wrap_excerpt_with = '' ){\n echo auxin_get_the_trim_excerpt( $post_id, $char_length, $exclude_strip_shortcode_tags, $skip_more_tag, $wrap_excerpt_with );\n}",
"function truckindia_clean($excerpt, $substr) {\r\n\r\n $string = strip_tags(do_shortcode($excerpt));\r\n if ($substr>0) {\r\n $string = substr($string, 0, $substr);\r\n }\r\n return $string.' ...';\r\n }",
"public function getExcerptAttribute()\n {\n return Str::words(strip_tags($this->attributes['content']), 30);\n }",
"function dynamic_excerpt($length) {\n global $post;\n $text = $post->post_excerpt;\n if ( '' == $text ) {\n $text = get_the_content('');\n $text = apply_filters('the_content', $text);\n $text = str_replace(']]>', ']]>', $text);\n }\n $text = strip_shortcodes($text); // optional, recommended\n $text = strip_tags($text); // use ' $text = strip_tags($text,'<p><a>'); ' if you want to keep some tags\n $text = mb_substr($text,0,$length).' ...';\n echo $text; // Use this is if you want a unformatted text block\n //echo apply_filters('the_excerpt',$text); // Use this if you want to keep line breaks\n}",
"public function foodbakery_trim_content() {\n\n global $post;\n $read_more = '....';\n $the_content = get_the_content($post->ID);\n if ( strlen(esc_html__(get_the_content($post->ID))) > 200 ) {\n $the_content = substr(esc_html__(get_the_content($post->ID)), 0, 200) . $read_more;\n }\n\n return $the_content;\n }"
] | [
"0.67891383",
"0.67465276",
"0.67452693",
"0.6716818",
"0.6647451",
"0.6635912",
"0.6576285",
"0.6570543",
"0.6553166",
"0.6506933",
"0.6451329",
"0.6318648",
"0.63110316",
"0.6278592",
"0.6257763",
"0.62536156",
"0.6245525",
"0.6210922",
"0.61991304",
"0.619578",
"0.61953855",
"0.6179553",
"0.6155124",
"0.6146858",
"0.6144467",
"0.61237204",
"0.6104984",
"0.61043483",
"0.60969096",
"0.60834277"
] | 0.7720605 | 0 |
Acorn Textify get the raw text of a string containing anchor tags or Markdown links | function acornTextify($string) {
if (strpos($string, 'a href="')) {
$string = preg_replace('/<a.*?>(.*?)<\/a>/', '$1', $string);
}
if (preg_match('/\[(.*)]\((.*)\)/', $string)) {
$string = preg_replace('/\[(.*)]\((.*)\)/', '$1', $string);
}
return trim($string);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function microbot_format_text_as_html($text) {\n $text = preg_replace_callback(\"/<(https?:\\/\\/.+?)>/\", function($matches) {\n $url = $matches[1];\n $url_pretty = rtrim(rtrim(explode(\"://\", $url, 2)[1], \"?\"), \"/\");\n $url_escaped = htmlentities($url);\n $url_pretty_escaped = htmlentities($url_pretty);\n return <<<EOT\n<a href=\"{$url_escaped}\">{$url_pretty_escaped}</a>\nEOT;\n }, $text);\n\n return nl2br(trim($text));\n}",
"public function getLinkText()\n {\n return trim($this->getParsedValue()->Text ?? '');\n }",
"function raw_urls_to_links($text){\n\t\t$text = \" $text \";\n\t\t$text = preg_replace('#(https?://[^\\s<>{}()]+[^\\s.,<>{}()])#i', '<a href=\"$1\" rel=\"nofollow\">$1</a>', $text);\n\t\t$text = preg_replace('#(\\s)([a-z0-9\\-]+(?:\\.[a-z0-9\\-\\~]+){2,}(?:/[^ <>{}()\\n\\r]*[^., <>{}()\\n\\r])?)#i', \n\t\t\t'$1<a href=\"http://$2\" rel=\"nofollow\">$2</a>', $text);\n\n\t\t$text = trim($text);\n\t\treturn $text;\n\t}",
"function toHTML(&$text = ''){\n\t\t\t$referenceLinks = array();\n\t\t\t$rgx = '/^[ ]{0,3}\\[([0-9a-z]+)\\]: ([^ \\n]+)( .([^\\'\\\"]+).|)/m';\n\t\t\t$r = preg_match_all($rgx,$text,$m);\n\t\t\tforeach($m[0] as $k=>$v){$referenceLinks[$m[1][$k]] = array('link'=>$m[2][$k],'title'=>$m[4][$k] ? $m[4][$k] : '');}\n\t\t\t$text = preg_replace($rgx,'',$text);\n\n\t\t\t$text = preg_replace('/^[\\xEF\\xBB\\xBF|\\x1A]/','',$text);\n\t\t\t$text = preg_replace('/\\n[\\n]+/',\"\\n\\n\",$text);\n\t\t\t$text = preg_replace('/\\r\\n/',PHP_EOL,$text);\n\t\t\t$text = preg_replace('! !',' ',$text);\n\n\t\t\t/* Párrafos */\n\t\t\t$text = explode(\"\\n\\n\",$text);\n\t\t\t$text = '<p>'.implode('</p>'.PHP_EOL.'<p>',str_replace(array('<','>'),array('<','>'),$text)).'</p>'.PHP_EOL;\n\t\t\t/* INI-hr */\n\t\t\t$text = preg_replace('/<p>\\*[\\* ]+<\\/p>[\\n\\t ]*/m','<hr/>'.PHP_EOL,$text);\n\t\t\t$text = preg_replace('/<p>\\-[\\- ]+<\\/p>[\\n\\t ]*/m','<hr/>'.PHP_EOL,$text);\n\t\t\t/* INI-Blockquote */\n\t\t\t$text = preg_replace('/<p>> ([^<]+)<\\/p>[\\n\\t ]*/m','<blockquote><p>$1</p></blockquote>'.PHP_EOL,$text);\n\t\t\t$text = preg_replace_callback('/<blockquote><p>([^<]+)<\\/p><\\/blockquote>/m',function($m){return '<blockquote><p>'.str_replace(PHP_EOL.'> ',' ',$m[1]).'</p></blockquote>';},$text);\n\t\t\t/* INI-ol */$text = preg_replace_callback('/<p>[ ]{0,3}[0-9]+\\. ([^<]+)<\\/p>/m',function($m){$t = preg_split('/\\n[ ]{0,3}(?:[\\-\\+\\*]|[0-9]+\\.)[ ]*/m',$m[1]);return '<ol><li>'.implode('</li><li>',$t).'</li></ol>';},$text);\n\t\t\t/* INI-ul */$text = preg_replace_callback('/<p>[ ]{0,3}[\\-\\+\\*] ([^<]+)<\\/p>/m',function($m){$t = preg_split('/\\n[ ]{0,3}[\\-\\+\\*][ ]*/m',$m[1]);return '<ul><li>'.implode('</li><li>',$t).'</li></ul>';},$text);\n\t\t\t/* INI-h1 */$text = preg_replace('/<p>([^\\n<]+)\\n[\\=]+<\\/p>/m','<h1>$1</h1>',$text);\n\t\t\t/* INI-h2 */$text = preg_replace('/<p>([^\\n<]+)\\n[\\-]+<\\/p>/m','<h2>$1</h2>',$text);\n\t\t\t/* INI-generic headers */$text = preg_replace_callback('/<p>[ ]*([#]+)[ ]*([^<]+[^#])[ ]*[#]+[ ]*<\\/p>/m',function($m){$l = strlen($m[1]);return '<h'.$l.'>'.$m[2].'</h'.$l.'>';},$text);\n\t\t\t/* Images */\n\t\t\t$text = preg_replace('/\\!\\[([^\\]]*)\\]\\((?<imgSrc>[^\\) ]+|)( .([^\\'\\\"]*).|)\\)/m','<img src=\"$2\" alt=\"$1\" title=\"$4\"/>',$text);\n\t\t\t/* Links */\n\t\t\t$text = preg_replace('/<(http:[^>]+)>/m','<a href=\"$1\">$1</a>',$text);\n\t\t\t$text = preg_replace_callback('!\\[(?<name>[^\\]]+)\\]\\((?<link>https?:[^\\) ]+|\\{%[^\\) ]+|//[^\\) ]+)( .(?<alt>[^\\'\\\"]*).|)\\)!m',function($m){\n\t\t\t\tif( empty($m['alt']) ){$m['alt'] = $m['name'];}\n\t\t\t\treturn '<a href=\"'.$m['link'].'\" alt=\"'.$m['alt'].'\" title=\"'.$m['name'].'\">'.$m['name'].'</a>';\n\t\t\t},$text);\n\t\t\t/* INI-Reference Links */\n\t\t\t$text = preg_replace_callback('/\\[([^\\]]+)\\]\\[([^\\]]*)\\]/m',function($m) use ($referenceLinks){\n\t\t\t\tif( isset($referenceLinks[$m[2]]) ){return '<a href=\"'.$referenceLinks[$m[2]]['link'].'\" alt=\"'.$referenceLinks[$m[2]]['title'].'\" title=\"'.$referenceLinks[$m[2]]['title'].'\">'.$m[1].'</a>';}\n\t\t\t\treturn '<a href=\"\">'.$m[1].'</a>';\n\t\t\t},$text);\n\t\t\t/* END-Reference Links */\n\t\t\t/* INI-Table */\n\t\t\t$text = preg_replace_callback('/[^\\|<>]+\\|[^\\n<>]+/m',function($m){$t = explode('|',$m[0]);foreach($t as $k=>$v){$t[$k] = trim($v);}return '<tr><td>'.implode('</td><td>',$t).'</td></tr>'.PHP_EOL;},$text);\n\t\t\t$text = preg_replace('/<p>[^<]*<tr>/m','<table><tbody>'.PHP_EOL.'<tr>',$text);\n\t\t\t$text = preg_replace('/<\\/tr>[^<]*<\\/p>/m','</tr>'.PHP_EOL.'</tbody></table>',$text);\n\t\t\t$text = preg_replace_callback('/<table[^>]*>[^<]*<tbody[^>]*>[^<]*(<tr>[^\\n]+<\\/tr>[^<]*)<tr><td>[:\\-]+<\\/td>.*?<\\/tr>/m',function($m){return '<table><thead>'.PHP_EOL.str_replace(array('<td','td>'),array('<th','th>'),$m[1]).'</thead><tbody>';},$text);\n\t\t\t/* END-Table */\n\n\t\t\t/* Bold */$text = preg_replace('/\\*\\*([^*\\n]+)\\*\\*/m','<strong>$1</strong>',$text);\n\t\t\t/* Bold */$text = preg_replace('/__([^_\\n]+)__/m','<strong>$1</strong>',$text);\n\t\t\t/* Italic */$text = preg_replace('/\\*([^*\\n]+)\\*/m','<em>$1</em>',$text);\n\t\t\t/* Italic */$text = preg_replace('/_([^_\\n]+)_/m','<em>$1</em>',$text);\n\n\t\t\t/* Cleanup */\n\t\t\t$text = preg_replace('/<p>[ \\n\\t]*<\\/p>/','',$text);\n\t\t\t$text = preg_replace('/[ \\n\\t]*<\\/p>/','</p>',$text);\n\t\t\t$text = trim($text);\n\n\t\t\treturn true;\n\t\t}",
"private static function processLinks($text) {\n $text = utf8_decode( $text );\n $text = preg_replace('@(https?://([-\\w\\.]+)+(d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?)@', '<a href=\"$1\">$1</a>', $text );\n $text = preg_replace(\"#(^|[\\n ])@([^ \\\"\\t\\n\\r<]*)#ise\", \"'\\\\1<a href=\\\"http://www.twitter.com/\\\\2\\\" >@\\\\2</a>'\", $text);\n $text = preg_replace(\"#(^|[\\n ])\\#([^ \\\"\\t\\n\\r<]*)#ise\", \"'\\\\1<a href=\\\"http://hashtags.org/search?query=\\\\2\\\" >#\\\\2</a>'\", $text);\n return $text;\n }",
"public static function links($text)\n {\n $text = preg_replace_callback('#\"([^\"]+)\":\"([^\"]+)\"#', array('Markup', 'anchors'), $text);\n $text = text::auto_link($text);\n\n return $text;\n }",
"public function getAnchorText()\n {\n return $this->getValue('nb_catalog_tag_lang_anchor_text');\n }",
"public function getInternalLinkContent();",
"function markdown($str) {\n $str = pairUp($str, '**', '<strong>', '</strong>');\n $str = pairUp($str, '*', '<em>', '</em>');\n $str = pairUp($str, '__', '<u>', '</u>');\n $str = pairUp($str, '~~', '<s>', '</s>');\n $str = findLinks($str);\n $str = escapeCleanup($str);\n return $str;\n}",
"function Dizkus_undo_make_clickable($text)\n{\n $text = preg_replace(\"#<!-- BBCode auto-link start --><a href=\\\"(.*?)\\\" target=\\\"_blank\\\">.*?</a><!-- BBCode auto-link end -->#i\", \"\\\\1\", $text);\n $text = preg_replace(\"#<!-- BBcode auto-mailto start --><a href=\\\"mailto:(.*?)\\\">.*?</a><!-- BBCode auto-mailto end -->#i\", \"\\\\1\", $text);\n return $text;\n}",
"public static function createHTMLLinks($text)\n\t{\n\t\treturn SpoonFilter::replaceURLsWithAnchors($text, false);\n\t}",
"static function intLinks2xml($a_text)\n\t{\n\t\tglobal $objDefinition;\n\n\t\t$rtypes = $objDefinition->getAllRepositoryTypes();\n\n\t\t// internal links\n\t\t//$any = \"[^\\]]*\";\t// this doesn't work :-(\n\t\t$ws= \"[ \\t\\r\\f\\v\\n]*\";\n\t\t$ltypes = \"page|chap|term|media|obj|dfile|sess|wpage|\".implode($rtypes, \"|\");\n\t\t// empty internal links\n\t\twhile (eregi(\"\\[(iln$ws((inst$ws=$ws([\\\"0-9])*)?$ws\".\n\t\t\t\"((\".$ltypes.\")$ws=$ws([\\\"0-9])*)$ws\".\n\t\t\t\"(target$ws=$ws(\\\"(New|FAQ|Media)\\\"))?$ws(anchor$ws=$ws(\\\"([^\\\"])*\\\"))?$ws))\\]\\[\\/iln\\]\", $a_text, $found))\n\t\t{\n\t\t\t$a_text = str_replace($found[0], \"\",$a_text);\n\t\t}\n\t\t\n\t\twhile (eregi(\"\\[(iln$ws((inst$ws=$ws([\\\"0-9])*)?$ws\".\n\t\t\t\"((\".$ltypes.\")$ws=$ws([\\\"0-9])*)$ws\".\n\t\t\t\"(target$ws=$ws(\\\"(New|FAQ|Media)\\\"))?$ws(anchor$ws=$ws(\\\"([^\\\"])*\\\"))?$ws))\\]\", $a_text, $found))\n\t\t{\n\t\t\t$attribs = ilUtil::attribsToArray($found[2]);\n\t\t\t$inst_str = $attribs[\"inst\"];\n\t\t\t// pages\n\t\t\tif (isset($attribs[\"page\"]))\n\t\t\t{\n\t\t\t\t$tframestr = \"\";\n\t\t\t\tif (!empty($found[10]))\n\t\t\t\t{\n\t\t\t\t\t$tframestr = \" TargetFrame=\\\"\".$found[10].\"\\\" \";\n\t\t\t\t}\n\t\t\t\t$ancstr = \"\";\n\t\t\t\tif ($attribs[\"anchor\"] != \"\")\n\t\t\t\t{\n\t\t\t\t\t$ancstr = ' Anchor=\"'.$attribs[\"anchor\"].'\" ';\n\t\t\t\t}\n\t\t\t\t$a_text = eregi_replace(\"\\[\".$found[1].\"\\]\",\n\t\t\t\t\t\"<IntLink Target=\\\"il_\".$inst_str.\"_pg_\".$attribs[page].\"\\\" Type=\\\"PageObject\\\"\".$tframestr.$ancstr.\">\", $a_text);\n\t\t\t}\n\t\t\t// chapters\n\t\t\telse if (isset($attribs[\"chap\"]))\n\t\t\t{\n\t\t\t\tif (!empty($found[10]))\n\t\t\t\t{\n\t\t\t\t\t$tframestr = \" TargetFrame=\\\"\".$found[10].\"\\\" \";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$tframestr = \"\";\n\t\t\t\t}\n\t\t\t\t$a_text = eregi_replace(\"\\[\".$found[1].\"\\]\",\n\t\t\t\t\t\"<IntLink Target=\\\"il_\".$inst_str.\"_st_\".$attribs[chap].\"\\\" Type=\\\"StructureObject\\\"\".$tframestr.\">\", $a_text);\n\t\t\t}\n\t\t\t// glossary terms\n\t\t\telse if (isset($attribs[\"term\"]))\n\t\t\t{\n\t\t\t\tswitch ($found[10])\n\t\t\t\t{\n\t\t\t\t\tcase \"New\":\n\t\t\t\t\t\t$tframestr = \" TargetFrame=\\\"New\\\" \";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$tframestr = \" TargetFrame=\\\"Glossary\\\" \";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$a_text = eregi_replace(\"\\[\".$found[1].\"\\]\",\n\t\t\t\t\t\"<IntLink Target=\\\"il_\".$inst_str.\"_git_\".$attribs[term].\"\\\" Type=\\\"GlossaryItem\\\" $tframestr>\", $a_text);\n\t\t\t}\n\t\t\t// wiki pages\n\t\t\telse if (isset($attribs[\"wpage\"]))\n\t\t\t{\n\t\t\t\t$tframestr = \"\";\n/*\t\t\t\tswitch ($found[10])\n\t\t\t\t{\n\t\t\t\t\tcase \"New\":\n\t\t\t\t\t\t$tframestr = \" TargetFrame=\\\"New\\\" \";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$tframestr = \" TargetFrame=\\\"Glossary\\\" \";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}*/\n\t\t\t\t$a_text = eregi_replace(\"\\[\".$found[1].\"\\]\",\n\t\t\t\t\t\"<IntLink Target=\\\"il_\".$inst_str.\"_wpage_\".$attribs[wpage].\"\\\" Type=\\\"WikiPage\\\" $tframestr>\", $a_text);\n\t\t\t}\n\t\t\t// media object\n\t\t\telse if (isset($attribs[\"media\"]))\n\t\t\t{\n\t\t\t\tif (!empty($found[10]))\n\t\t\t\t{\n\t\t\t\t\t$tframestr = \" TargetFrame=\\\"\".$found[10].\"\\\" \";\n\t\t\t\t\t$a_text = eregi_replace(\"\\[\".$found[1].\"\\]\",\n\t\t\t\t\t\t\"<IntLink Target=\\\"il_\".$inst_str.\"_mob_\".$attribs[media].\"\\\" Type=\\\"MediaObject\\\"\".$tframestr.\">\", $a_text);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$a_text = eregi_replace(\"\\[\".$found[1].\"\\]\",\n\t\t\t\t\t\t\"<IntLink Target=\\\"il_\".$inst_str.\"_mob_\".$attribs[media].\"\\\" Type=\\\"MediaObject\\\"/>\", $a_text);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// direct download file (no repository object)\n\t\t\telse if (isset($attribs[\"dfile\"]))\n\t\t\t{\n\t\t\t\t$a_text = eregi_replace(\"\\[\".$found[1].\"\\]\",\n\t\t\t\t\t\"<IntLink Target=\\\"il_\".$inst_str.\"_dfile_\".$attribs[dfile].\"\\\" Type=\\\"File\\\">\", $a_text);\n\t\t\t}\n\t\t\t// repository items (id is ref_id (will be used internally but will\n\t\t\t// be replaced by object id for export purposes)\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach ($objDefinition->getAllRepositoryTypes() as $t)\n\t\t\t\t{\n\t\t\t\t\tif (isset($attribs[$t]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$obj_id = $attribs[$t];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isset($attribs[\"obj\"]))\n\t\t\t\t{\n\t\t\t\t\t$obj_id = $attribs[\"obj\"];\n\t\t\t\t}\n\n\t\t\t\tif ($obj_id > 0)\n\t\t\t\t{\n\t\t\t\t\tif ($inst_str == \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$a_text = eregi_replace(\"\\[\".$found[1].\"\\]\",\n\t\t\t\t\t\t\t\"<IntLink Target=\\\"il_\".$inst_str.\"_obj_\".$obj_id.\"\\\" Type=\\\"RepositoryItem\\\">\", $a_text);\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$a_text = eregi_replace(\"\\[\".$found[1].\"\\]\",\n\t\t\t\t\t\t\t\"<IntLink Target=\\\"il_\".$inst_str.\"_\".$found[6].\"_\".$obj_id.\"\\\" Type=\\\"RepositoryItem\\\">\", $a_text);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$a_text = eregi_replace(\"\\[\".$found[1].\"\\]\", \"[error: iln\".$found[1].\"]\",$a_text);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\twhile (eregi(\"\\[(iln$ws((inst$ws=$ws([\\\"0-9])*)?\".$ws.\"media$ws=$ws([\\\"0-9])*)$ws)/\\]\", $a_text, $found))\n\t\t{\n\t\t\t$attribs = ilUtil::attribsToArray($found[2]);\n\t\t\t$inst_str = $attribs[\"inst\"];\n\t\t\t$a_text = eregi_replace(\"\\[\".$found[1].\"/\\]\",\n\t\t\t\t\"<IntLink Target=\\\"il_\".$inst_str.\"_mob_\".$attribs[media].\"\\\" Type=\\\"MediaObject\\\"/>\", $a_text);\n\t\t}\n\t\t$a_text = eregi_replace(\"\\[\\/iln\\]\",\"</IntLink>\",$a_text);\n\t\treturn $a_text;\n\t}",
"function esc_textlinks( $body ) {\n\t\t\treturn preg_replace( '#<(https?://[^*]+)>#', '$1', $body );\n\t\t}",
"function agora_html($text)\n\t{\n\t\treturn $text;\n\t}",
"public function getPlainTextContent();",
"function autolink($text, $target=NULL, $nofollow=true){\n\n\t\t // grab anything that looks like a URL...\n\t\t $urls = General::__autolink_find_URLS($text);\n\n\t\t if(!empty($urls)){ // i.e. there were some URLS found in the text{\n\t\t array_walk($urls, array('General', '__autolink_create_html_tags'), array('target'=>$target, 'nofollow'=>$nofollow));\n\t\t $text = strtr($text, $urls);\n\t\t }\n\n\t\t return $text;\n\t\t}",
"function tweet_to_link_text($text = ''){\n\t$reg_exUrl = \"/(http|https|ftp|ftps)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/\";\n\n\t$text = preg_replace('/([0-9|#][\\x{20E3}])|[\\x{00ae}|\\x{00a9}|\\x{203C}|\\x{2047}|\\x{2048}|\\x{2049}|\\x{3030}|\\x{303D}|\\x{2139}|\\x{2122}|\\x{3297}|\\x{3299}][\\x{FE00}-\\x{FEFF}]?|[\\x{2190}-\\x{21FF}][\\x{FE00}-\\x{FEFF}]?|[\\x{2300}-\\x{23FF}][\\x{FE00}-\\x{FEFF}]?|[\\x{2460}-\\x{24FF}][\\x{FE00}-\\x{FEFF}]?|[\\x{25A0}-\\x{25FF}][\\x{FE00}-\\x{FEFF}]?|[\\x{2600}-\\x{27BF}][\\x{FE00}-\\x{FEFF}]?|[\\x{2900}-\\x{297F}][\\x{FE00}-\\x{FEFF}]?|[\\x{2B00}-\\x{2BF0}][\\x{FE00}-\\x{FEFF}]?|[\\x{1F000}-\\x{1F6FF}][\\x{FE00}-\\x{FEFF}]?/u', '', $text);\n\n\t// Check if there is a url in the text\n\tif(preg_match($reg_exUrl, $text, $url)) {\n\n\t // make the urls hyper links\n\t return preg_replace($reg_exUrl, \"<a href='{$url[0]}'>{$url[0]}</a> \", $text);\n\n\t} else {\n\n\t // if no urls in the text just return the text\n\t return $text;\n\n\t}\n}",
"function bamobile_mobiconnector_get_plaintext( $string, $keep_image = false, $keep_link = false ){\r\n\t// Get image tags\r\n\tif( $keep_image ){\r\n\t\tif( preg_match_all( \"/\\<img[^\\>]*src=\\\"([^\\\"]*)\\\"[^\\>]*\\>/is\", $string, $match ) ){\r\n\t\t\tforeach( $match[0] as $key => $_m )\t{\r\n\t\t\t\t$textimg = '';\r\n\t\t\t\tif( strpos( $match[1][$key], 'data:image/png;base64' ) === false ){\r\n\t\t\t\t\t$textimg = \" \" . $match[1][$key];\r\n\t\t\t\t}\r\n\t\t\t\tif( preg_match_all( \"/\\<img[^\\>]*alt=\\\"([^\\\"]+)\\\"[^\\>]*\\>/is\", $_m, $m_alt ) ){\r\n\t\t\t\t\t$textimg .= \" \" . $m_alt[1][0];\r\n\t\t\t\t}\r\n\t\t\t\t$string = str_replace( $_m, $textimg, $string );\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Get link tags\r\n\tif( $keep_link ){\r\n\t\tif( preg_match_all( \"/\\<a[^\\>]*href=\\\"([^\\\"]+)\\\"[^\\>]*\\>(.*)\\<\\/a\\>/isU\", $string, $match ) ){\r\n\t\t\tforeach( $match[0] as $key => $_m )\t{\r\n\t\t\t\t$string = str_replace( $_m, $match[1][$key] . \" \" . $match[2][$key], $string );\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t$string = str_replace( ' ', ' ', strip_tags( $string ) );\r\n\treturn preg_replace( '/[ ]+/', ' ', $string );\r\n}",
"public static function anchor(): string;",
"function linkify($text) {\n $matches = array(\n '/([A-Za-z]+:\\/\\/[A-Za-z0-9-_]+\\.[A-Za-z0-9-_:%&\\?\\/.=]+)/',\n '/(^|[^\\w])(#[\\d\\w\\-]+)/',\n '/(^|[^\\w])(@([\\d\\w\\-]+))/'\n );\n \n $replacements = array(\n '<a href=\"$1\">$1</a>',\n '$1<a href=\"http://search.twitter.com/search?q=$2\">$2</a>',\n '$1@<a href=\"http://twitter.com/$3\">$3</a>'\n );\n \n return preg_replace($matches, $replacements, $text);\n}",
"public function getHtmlTextContent();",
"public function getFullText();",
"public static function autolink($text)\n\t\t{\n\t\t\t/* http formatted */\n\t\t\t$text = preg_replace(\"#([\\n ])([a-z]+?)://([a-z0-9\\-\\.,\\?!%\\*_\\#:;~\\\\&$@\\/=\\+]+)#ie\",\n\t\t\t\t\"'\\\\1<a href=\\\"\\\\2://\\\\3\\\" >\\\\2://\\\\3</a>'\", $text);\n\t\t\t/* www formatted */\n\t\t\t$text = preg_replace(\"#^(www)\\.([a-z0-9\\-]+)\\.([a-z0-9\\-.\\~]+)((?:/[a-z0-9\\-\\.,\\?!%\\*_\\#:;~\\\\&$@\\/=\\+]*)?)#i\",\n\t\t\t\t\"<a href=\\\"http://www.\\\\2.\\\\3\\\">www.\\\\2.\\\\3\\</a>\", $text);\n\t\t\t/* e-mail formatted */\n\t\t\t$text = preg_replace(\"#^([a-z0-9\\-_.]+?)@([\\w\\-]+\\.([\\w\\-\\.]+\\.)?[\\w]+)#i\",\n\t\t\t\t\"<a href=\\\"mailto:\\\\1@\\\\2\\\">\\\\1@\\\\2</a>\", $text);\n\t\t\t\treturn $text;\n\t\t}",
"private function _convert_anchor($node)\n\t{\n\t\tglobal $txt;\n\n\t\t$href = htmlspecialchars_decode($node->getAttribute('href'));\n\t\t$href = strtr($href, array('(' => '%28', ')' => '%29', '[' => '%5B', ']' => '%5D', '&' => '%26a'));\n\n\t\t$title = $node->getAttribute('title');\n\t\t$class = $node->getAttribute('class');\n\t\t$value = $this->_get_value($node);\n\n\t\t// Provide a more compact [name] if none is given\n\t\tif ($value == $node->getAttribute('href') || empty($value))\n\t\t{\n\t\t\t$value = empty($title) ? $txt['link'] : $title;\n\t\t}\n\n\t\t// Special processing just for our own footnotes\n\t\tif ($class === 'target' || $class === 'footnote_return')\n\t\t{\n\t\t\t$markdown = $value;\n\t\t}\n\t\telseif (!empty($title))\n\t\t{\n\t\t\t$markdown = '[' . $value . '](' . $href . ' \"' . $title . '\")';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$markdown = '[' . $value . ']( ' . $href . ' )';\n\t\t}\n\n\t\treturn $markdown;\n\t}",
"static public function plainToHtml($txt)\r\n {\r\n if (! $txt)\r\n {\r\n return '';\r\n }\r\n\r\n\t // Kills double spaces and spaces inside tags.\r\n\t while( !( strpos($txt,' ') === FALSE ) ) $txt = str_replace(' ',' ',$txt);\r\n\t $txt = str_replace(' >','>',$txt);\r\n\t $txt = str_replace('< ','<',$txt);\r\n\r\n\t // Transforms accents in html entities.\r\n\t $txt = htmlentities($txt);\r\n\r\n\t // We need some HTML entities back!\r\n\t $txt = str_replace('"','\"',$txt);\r\n\t $txt = str_replace('<','<',$txt);\r\n\t $txt = str_replace('>','>',$txt);\r\n\t $txt = str_replace('&','&',$txt);\r\n\r\n\t // Ajdusts links - anything starting with HTTP opens in a new window\r\n\t $txt = str_ireplace(\"<a href=\\\"http://\",\"<a target=\\\"_blank\\\" href=\\\"http://\",$txt);\r\n\t $txt = str_ireplace(\"<a href=http://\",\"<a target=\\\"_blank\\\" href=http://\",$txt);\r\n\r\n\t // Basic formatting\r\n\t $eol = ( strpos($txt,\"\\r\") === FALSE ) ? \"\\n\" : \"\\r\\n\";\r\n\t $html = '<p>'.str_replace(\"$eol$eol\",\"</p><p>\",$txt).'</p>';\r\n\t $html = str_replace(\"$eol\",\"<br />\\n\",$html);\r\n\t $html = str_replace(\"</p>\",\"</p>\\n\\n\",$html);\r\n\t $html = str_replace(\"<p></p>\",\"<p> </p>\",$html);\r\n\r\n\t // Wipes <br> after block tags (for when the user includes some html in the text).\r\n\t $wipebr = Array(\"table\",\"tr\",\"td\",\"blockquote\",\"ul\",\"ol\",\"li\");\r\n\r\n\t for ($x = 0; $x < count($wipebr); $x++)\r\n {\r\n\t $tag = $wipebr[$x];\r\n\t $html = str_ireplace(\"<$tag><br />\",\"<$tag>\",$html);\r\n\t $html = str_ireplace(\"</$tag><br />\",\"</$tag>\",$html);\r\n\t }\r\n\r\n\t return $html;\r\n\t}",
"function linkfyText($text){\n\t\t$linkfyText='<a href=\"?subpage=xsocial-profile&profile_of='.$this->api->auth->model->id.'\">'.$text.'</a>';\n\t\treturn $linkfyText;\n\n\t}",
"public static function convertTextToHTML($text){\n\t\t$text = preg_replace_callback(self::REGEX_URL, function($matches){ \n\t\t\treturn sprintf('<a href=\"%s\" target=\"_blank\" rel=\"nofollow external\">%s</a>', $matches[0], Utils::shortenURL($matches[2]));\n\t\t}, $text);\n\n\t\t$text = nl2br($text);\n\t\treturn $text;\n\t}",
"public function content(): string\n {\n return app('docs.parser')->parse($this->raw());\n }",
"public function getText()\n\t{\n\t\treturn html_entity_decode(strip_tags($this->getHtml()), ENT_QUOTES, 'UTF-8');\n\t}",
"public function FilterTextLink($a)\n {\n $a = stripslashes(htmlspecialchars($a));\n $a = trim($a);\n $a = str_replace('\"', '"', $a);\n $a = str_replace(\"'\", \"'\", $a);\n $a = str_replace(\"<script\", \"\", $a);\n $a = str_replace(\" \", \"-\", $a);\n $a = str_replace(\"[\", \"(\", $a);\n $a = str_replace(\"]\", \")\", $a);\n $a = str_replace(\"á\", \"a\", $a);\n $a = str_replace(\"é\", \"e\", $a);\n $a = str_replace(\"í\", \"i\", $a);\n $a = str_replace(\"ó\", \"o\", $a);\n $a = str_replace(\"ú\", \"u\", $a);\n\n $a = str_replace(\"á\", \"a\", $a);\n $a = str_replace(\"é\", \"e\", $a);\n $a = str_replace(\"í\", \"i\", $a);\n $a = str_replace(\"ó\", \"o\", $a);\n $a = str_replace(\"ú\", \"u\", $a);\n\n $a = str_replace(\"!\", \"\", $a);\n $a = str_replace(\"¡\", \"\", $a);\n $a = str_replace(\"?\", \"\", $a);\n $a = str_replace(\"¿\", \"\", $a);\n $a = str_replace(\"/\", \"\", $a);\n $a = str_replace(\".\", \"\", $a);\n $a = str_replace(\",\", \"\", $a);\n $a = str_replace(\"ñ\", \"n\", $a);\n $a = str_replace($a, strtolower($a), $a);\n return $a;\n }"
] | [
"0.62963104",
"0.6195697",
"0.6175821",
"0.6172133",
"0.6168495",
"0.61452985",
"0.6021573",
"0.596009",
"0.59184605",
"0.59129024",
"0.59075725",
"0.5843654",
"0.5822526",
"0.5814842",
"0.57592624",
"0.5737777",
"0.56906587",
"0.56716216",
"0.5670023",
"0.5669131",
"0.56673956",
"0.566351",
"0.5627133",
"0.5583465",
"0.5579674",
"0.5574117",
"0.55729264",
"0.5567527",
"0.555282",
"0.5542048"
] | 0.72552603 | 0 |
Get Video ID From either YouTube or Vimeo URLs | function getVideoID($url) {
if (str::contains($url, 'youtu')) {
if (preg_match("/^((https?:\/\/)?(w{0,3}\.)?youtu(\.be|(be|be-nocookie)\.\w{2,3}\/))((watch\?v=|v|embed)?[\/]?(?P<id>[a-zA-Z0-9-_]{11}))/si", $url, $matches)) {
return $matches['id'];
}
}
elseif (str::contains($url, 'vimeo.com')) {
return substr(parse_url($url, PHP_URL_PATH), 1);
}
else {
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ts_get_video_id($url)\n{\n $url = trim($url);\n\n if(preg_match(\"/^[a-z0-9\\-_]+$/i\", $url) || ctype_digit($url))\n return $url;\n\n $url_parts = parse_url($url);\n $url_part = (is_array($url_parts)) ? ts_array2object($url_parts) : $url_parts;\n\n if(is_object($url_part) && isset($url_part->host))\n {\n $host_names = explode(\".\", $url_part->host);\n $url_part->host = $host_names[count($host_names)-2] . \".\" . $host_names[count($host_names)-1];\n\n if(($url_part->host == 'youtube.com') || ($url_part->host == 'youtu.be'))\n {\n if($url_part->host == 'youtube.com')\n {\n if($url_part->query)\n {\n parse_str($url_part->query);\n }\n\n if(isset($v)) :\n $id = $v;\n elseif(strpos($url_part->path, '/v/') !== false) :\n $id_parts = explode('/v/', $url_part->path, 2);\n $id = end($id_parts);\n elseif(strpos($url_part->path, '/embed/') !== false) :\n $id_parts = explode('/embed/', $url_part->path, 2);\n $id = end($id_parts);\n else :\n $id = '';\n endif;\n }\n else\n {\n $id = substr($url_part->path, 1);\n }\n\n return $id;\n }\n elseif($url_part->host == 'vimeo.com')\n {\n if($url_part->path == '/channels/hd') :\n $id = $url_part->fragment;\n elseif(substr($url_part->path, 0, 7) == '/video/' || substr($url_part->path, 0, 8) == '/groups/' || substr($url_part->path, 0, 10) == '/channels/') :\n $id_parts = explode('/', $url_part->path);\n $id = end($id_parts);\n else :\n $id = substr($url_part->path, 1);\n endif;\n\n if(ctype_digit($id))\n return $id;\n }\n elseif($url_part->host == 'vine.co')\n {\n if(substr($url_part->path, 0, 3) == '/v/')\n return current(explode('/', substr($url_part->path, 3)));\n }\n }\n\n return null;\n}",
"function getYouTubeVideoId($url)\r\n{\r\n $video_id = false;\r\n $url = parse_url($url);\r\n if (!empty($url[\"path\"])) {\r\n if (strcasecmp($url['host'], 'youtu.be') === 0) {\r\n $video_id = substr($url['path'], 1);\r\n } elseif (strcasecmp($url['host'], 'www.youtube.com') === 0) {\r\n if (isset($url['query'])) {\r\n parse_str($url['query'], $url['query']);\r\n if (isset($url['query']['v'])) {\r\n $video_id = $url['query']['v'];\r\n }\r\n }\r\n if ($video_id == false) {\r\n $url['path'] = explode('/', substr($url['path'], 1));\r\n if (in_array($url['path'][0], array('e', 'embed', 'v'))) {\r\n $video_id = $url['path'][1];\r\n }\r\n }\r\n }\r\n }\r\n return $video_id;\r\n}",
"private function videoIDFromUrl(string $url): ?string {\n $host = parse_url($url, PHP_URL_HOST);\n\n if ($host === self::SHORT_DOMAIN) {\n $path = parse_url($url, PHP_URL_PATH) ?? \"\";\n return preg_match(\"`^/?(?<videoID>[\\w-]{11})`\", $path, $matches) ? $matches[\"videoID\"] : null;\n } else {\n $parameters = [];\n parse_str(parse_url($url, PHP_URL_QUERY) ?? \"\", $parameters);\n return $parameters[\"v\"] ?? null;\n }\n\n return null;\n }",
"static function getVimeoIDfromURL($url)\n {\n if (empty($url)) return '';\n $match = self::getVimeoInfoFromURL($url);\n return empty($match) ? '' : $match[3];\n }",
"function getVideoId() {\n if ( is_null( $this->video_id ) ) {\n if ( false !== strpos( $this->web_link, 'youtube.com/watch?v=' ) ) {\n $video_parts = explode( 'youtube.com/watch?v=', $this->web_link );\n $video_id_parts = explode( '&', $video_parts[1] );\n $this->video_id = $video_id_parts[0];\n } else {\n $this->video_id = false;\n }\n }\n return $this->video_id;\n }",
"function um_youtube_id_from_url( $url ) {\r\n\t$pattern =\r\n\t\t'%^# Match any youtube URL\r\n\t\t(?:https?://)? # Optional scheme. Either http or https\r\n\t\t(?:www\\.)? # Optional www subdomain\r\n\t\t(?: # Group host alternatives\r\n\t\t youtu\\.be/ # Either youtu.be,\r\n\t\t| youtube\\.com # or youtube.com\r\n\t\t (?: # Group path alternatives\r\n\t\t\t/embed/ # Either /embed/\r\n\t\t | /v/ # or /v/\r\n\t\t | /watch\\?v= # or /watch\\?v=\r\n\t\t ) # End path alternatives.\r\n\t\t) # End host alternatives.\r\n\t\t([\\w-]{10,12}) # Allow 10-12 for 11 char youtube id.\r\n\t\t$%x';\r\n\t$result = preg_match( $pattern, $url, $matches );\r\n\tif (false !== $result) {\r\n\t\treturn $matches[1];\r\n\t}\r\n\r\n\treturn false;\r\n}",
"function extractUTubeVidId($url){\n\t\t\t\t\t\t$vid_id = \"\";\n\t\t\t\t\t\t$flag = false;\n\t\t\t\t\t\tif(isset($url) && !empty($url)){\n\t\t\t\t\t\t\t/*case1 and 2*/\n\t\t\t\t\t\t\t$parts = explode(\"?\", $url);\n\t\t\t\t\t\t\tif(isset($parts) && !empty($parts) && is_array($parts) && count($parts)>1){\n\t\t\t\t\t\t\t\t$params = explode(\"&\", $parts[1]);\n\t\t\t\t\t\t\t\tif(isset($params) && !empty($params) && is_array($params)){\n\t\t\t\t\t\t\t\t\tforeach($params as $param){\n\t\t\t\t\t\t\t\t\t\t$kv = explode(\"=\", $param);\n\t\t\t\t\t\t\t\t\t\tif(isset($kv) && !empty($kv) && is_array($kv) && count($kv)>1){\n\t\t\t\t\t\t\t\t\t\t\tif($kv[0]=='v'){\n\t\t\t\t\t\t\t\t\t\t\t\t$vid_id = $kv[1];\n\t\t\t\t\t\t\t\t\t\t\t\t$flag = true;\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\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\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*case 3*/\n\t\t\t\t\t\t\tif(!$flag){\n\t\t\t\t\t\t\t\t$needle = \"youtu.be/\";\n\t\t\t\t\t\t\t\t$pos = null;\n\t\t\t\t\t\t\t\t$pos = strpos($url, $needle);\n\t\t\t\t\t\t\t\tif ($pos !== false) {\n\t\t\t\t\t\t\t\t\t$start = $pos + strlen($needle);\n\t\t\t\t\t\t\t\t\t$vid_id = substr($url, $start, 11);\n\t\t\t\t\t\t\t\t\t$flag = true;\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\treturn $vid_id;\n\t\t\t\t\t}",
"protected static function getVideoId($url)\n {\n\n $video_id = false;\n\n $regexp = array('/^https?:\\/\\/(www\\.youtube\\.com|youtube\\.com|youtu\\.be).*\\/(watch\\?v=)?(.*)/', 3);\n\n if(preg_match($regexp[0], $url, $matches, PREG_OFFSET_CAPTURE) > 0)\n {\n // regexp match key\n $match_key = $regexp[1];\n\n // define video id\n $video_id = $matches[$match_key][0];\n\n // Fixes the youtube &feature_gdata bug\n if(strpos($video_id, \"&\"))\n {\n $video_id = substr($video_id, 0, strpos($video_id, \"&\"));\n }\n }\n\n // here we should have a valid video_id or false if service not matching\n return $video_id;\n }",
"private function videoIDFromUrl(string $url): ?string {\n return preg_match(\"`^/?(medias|embed)/(?<videoID>[\\w-]+)`\", parse_url($url, PHP_URL_PATH) ?? \"\", $matches) ? $matches[\"videoID\"] : null;\n }",
"function yt_url_to_id($url){\n\tif (preg_match('%(?:youtube(?:-nocookie)?\\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\\.be/)([^\"&?/ ]{11})%i', $url, $match))\n return $match[1];\n\treturn false;\n}",
"function getYoutubeId($ytURL) \n\t\t {\n\t\t\t $urlData = parse_url($ytURL);\n\t\t\t //echo '<br>'.$urlData[\"host\"].'<br>';\n\t\t\t if($urlData[\"host\"] == 'www.youtube.com') // Check for valid youtube url\n\t\t\t {\n\t\t\t\t $ytvIDlen = 11;\t// This is the length of YouTube's video IDs\n \n\t\t\t\t // The ID string starts after \"v=\", which is usually right after \n\t\t\t\t // \"youtube.com/watch?\" in the URL\n\t\t\t\t $idStarts = strpos($ytURL, \"?v=\");\n \n\t\t\t\t // In case the \"v=\" is NOT right after the \"?\" (not likely, but I like to keep my \n\t\t\t\t // bases covered), it will be after an \"&\":\n\t\t\t\t if($idStarts === FALSE)\n\t\t\t\t\t $idStarts = strpos($ytURL, \"&v=\");\n\t\t\t\t // If still FALSE, URL doesn't have a vid ID\n\t\t\t\t if($idStarts === FALSE)\n\t\t\t\t\t die(\"YouTube video ID not found. Please double-check your URL.\");\n \n\t\t\t\t // Offset the start location to match the beginning of the ID string\n\t\t\t\t $idStarts +=3;\n \n\t\t\t\t // Get the ID string and return it\n\t\t\t\t $ytvID = substr($ytURL, $idStarts, $ytvIDlen);\n \n\t\t\t\t return $ytvID;\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t //echo 'This is not a valid youtube video url. Please, give a valid url...';\n\t\t\t\t return 0;\n\t\t\t }\n \n\t\t }",
"private function extractVideoId($video_url)\n {\n $start_position = stripos($video_url, \".com/\");\n return ltrim(substr($video_url, $start_position), \".com/\");\n }",
"function getYoutubeId($youtube_id) {\n preg_match('/(\\\\?v=|\\/v\\/|\\.be\\/)([-_a-zA-Z0-9]+)/i',$youtube_id,$matches);\n return end($matches);\n}",
"function si_get_video_image($url){\r\n\tif(preg_match('/youtube/', $url)) {\t\t\t\r\n\t\tif(preg_match('/[\\\\?\\\\&]v=([^\\\\?\\\\&]+)/', $url, $matches)) {\r\n\t\t\treturn \"http://img.youtube.com/vi/\".$matches[1].\"/default.jpg\"; \r\n\t\t}\r\n\t}\r\n\telseif(preg_match('/vimeo/', $url)) {\t\t\t\r\n\t\tif(preg_match('~^http://(?:www\\.)?vimeo\\.com/(?:clip:)?(\\d+)~', $url, $matches))\t{\r\n\t\t\t\t$id = $matches[1];\t\r\n\t\t\t\tif (!function_exists('curl_init')) die('CURL is not installed!');\r\n\t\t\t\t$url = \"http://vimeo.com/api/v2/video/\".$id.\".php\";\r\n\t\t\t\t$ch = curl_init();\r\n\t\t\t\tcurl_setopt($ch, CURLOPT_URL, $url);\r\n\t\t\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\r\n\t\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n\t\t\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 10);\r\n\t\t\t\t$output = unserialize(curl_exec($ch));\r\n\t\t\t\t$output = $output[0][\"thumbnail_medium\"]; \r\n\t\t\t\tcurl_close($ch);\r\n\t\t\t\treturn $output;\r\n\t\t}\r\n\t}\t\t\r\n}",
"public static function getIdVideoYoutube($url) {\n\t\tparse_str ( parse_url ( $url, PHP_URL_QUERY ), $params );\n\t\t\n\t\tif (key_exists ( 'v', $params )) {\n\t\t\treturn $params ['v'];\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"function getdmid($url){\n\n$checkdm = explode(\".\", $url);\n\nif ($checkdm[1] == \"dailymotion\" ){\n\n\t//gets vid id\n$dm_start = explode(\"/video/\",$url,2);\n$dm_end = explode(\"&\",$dm_start[1],2);\n$gotid = $dm_end[0];\nreturn $gotid;\n}\n}",
"static function getYoutubeIDfromURL($url)\n {\n if (empty($url)) return '';\n $match = self::getYoutubeInfoFromURL($url); \n return empty($match) ? '' : $match[5];\n }",
"function get_video_frames_links($text)\n{\n\tif(strstr($text, \"youtube.com\"))\n\t{\n\t\tpreg_match(\"#v=([\\w\\-]+)#\", $text, $youtube_video_id);\n\t\t$youtube_video_id = end($youtube_video_id);\n\t\t\n\t\t$href = \"http://www.youtube.com/v/{$youtube_video_id}\";\n\t\t\n\t\treturn $href;\n\t}\n\telse\n\t# Detect Vimeo Link\n\tif(strstr($text, \"vimeo.com\"))\n\t{\n\t\tpreg_match(\"#com/(\\d+)#\", $text, $vimeo_video_id);\n\t\t$vimeo_video_id = end($vimeo_video_id);\n\t\t\n\t\t$href = \"http://vimeo.com/moogaloop.swf?clip_id={$vimeo_video_id}\";\n\t\t\n\t\treturn $href;\n\t}\n\t\n\treturn null;\n}",
"private static function youtubeUrlToId($youtubeUrl) {\r\n\t\t\t$url=parse_url($youtubeUrl);\r\n\t\t\t$vars=YoutubeDownloader::decodeUrlVariables($url[\"query\"]);\r\n\r\n\t\t\t//MediaDownloaderLogger::debug(\"id: \".$vars[\"v\"]);\r\n\r\n\t\t\treturn $vars[\"v\"];\r\n\t\t}",
"function GetVid($url){\r\n\r\n\tif(empty($url))return false;\r\n\t\r\n\t\tpreg_match(\"/\\/v\\/(.*?)\\//i\", $url, $ketStr);\r\n\t\t\r\n\tif(empty($ketStr)){\r\n\t\r\n\t\tfor($i=0; $i<3; $i++){\r\n\t\t\r\n\t\t\t$c = getfile($url, $url, null);\r\n\t\t\r\n\t\t\tif($c)break;\r\n\t\t\r\n\t\t}\t\r\n\t\tpreg_match(\"/,vcode:[\\s]+\\'([X]{1}.*?)\\'/i\", $c, $ketStr);\t\t\r\n\t\tif(empty($ketStr))preg_match(\"/,iid:[\\s]+([0-9]+)/i\", $c, $ketStr);\r\n\r\n }\r\n\tif(!empty($ketStr[1]))$key = $ketStr[1];\r\n\t\r\n\tif(empty($key))return false;\r\n\t\r\n\treturn $key;\r\n}",
"function check_video_url($url) {\n\t/* Not good enough -_-\n\t$props = array();\n\tparse_str(parse_url($url, PHP_URL_QUERY), $props);\n\tif (array_key_exists('v', $props)) {\n\t\treturn $props['v'];\n\t} else {\n\t\treturn false;\n\t}\n\t*/\n\t// Awesome code from http://stackoverflow.com/questions/3392993 !!\n\t$matches = array();\n\tpreg_match(\"#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\\/)[^&\\n]+(?=\\?)|(?<=v=)[^&\\n]+|(?<=youtu.be/)[^&\\n]+#\", $url, $matches);\n\tif (count($matches) < 1) {\n\t\treturn false;\n\t\treturn ''; // why did I ever even do this?\n\t} else {\n\t\treturn $matches[0];\n\t}\n}",
"protected function getVideo($request_url){\n //fix youtube and vimeo url\n $url = $request_url;\n if(strpos($url,'youtube')){\n $slice_url = explode('&', $url);\n return $video_url = str_replace('watch?v=', 'embed/', $slice_url[0]);\n }elseif (strpos($url, 'vimeo')){\n return $video_url = str_replace('vimeo.com', 'player.vimeo.com/video', $url);\n }\n }",
"function getgvid($url){\n\n$checkgv = explode(\".\", $url);\n\nif ($checkgv[1] == \"google\" ){\n\n\t//gets vid id\n$gv_start = explode(\"docid=\",$url,2);\n$gv_end = explode(\"&\",$gv_start[1],2);\n$gotid = $gv_end[0];\nreturn $gotid;\n}\n}",
"function video_embed_jwplayer_get_media_id($url) {\n //\n // the url is in the form: http(s)://content.jwplatform.com/[TYPE/]MEDIA_ID[-TEMP_ID].EXT[?parameters]\n //\n // get file name\n $splits = explode('/', $url);\n $media_id = array_pop($splits);\n\n //\n // remove extension and signing parameters\n if ($media_id && $pos = strpos($media_id, '.')) {\n $media_id = substr($media_id, 0, $pos);\n }\n\n //\n // remove template id. if any\n if ($media_id && $pos = strpos($media_id, '-')) {\n $media_id = substr($media_id, 0, $pos);\n }\n\n return $media_id ? $media_id : false;\n}",
"function youtube_embed_url($youtube_url)\n{\n preg_match('/[\\\\?\\\\&]v=([^\\\\?\\\\&]+)/', $youtube_url, $matches);\n\n if (isset($matches[1])) {\n return 'https://www.youtube.com/embed/' . $matches[1];\n }\n\n return $youtube_url;\n}",
"public static function youtube_id_from_url($url)\n {\n $pattern =\n '%^# Match any youtube URL\n (?:https?://)? # Optional scheme. Either http or https\n (?:www\\.)? # Optional www subdomain\n (?: # Group host alternatives\n youtu\\.be/ # Either youtu.be,\n | youtube\\.com # or youtube.com\n (?: # Group path alternatives\n /embed/ # Either /embed/\n | /v/ # or /v/\n | /watch\\?v= # or /watch\\?v=\n ) # End path alternatives.\n ) # End host alternatives.\n ([\\w-]{10,12}) # Allow 10-12 for 11 char youtube id.\n $%x';\n $result = preg_match($pattern, $url, $matches);\n if ($result) {\n return $matches[1];\n }\n\n return false;\n }",
"public static function getYoutubeID($link)\n {\n $video_id = explode(\"?v=\", $link); // For videos like http://www.youtube.com/watch?v=...\n if (empty($video_id[1])) {\n $video_id = explode(\"/v/\", $link);\n } // For videos like http://www.youtube.com/watch/v/..\n\n if (isset($video_id) && isset($video_id[1])) {\n $video_id = explode(\"&\", $video_id[1]); // Deleting any other params\n $video_id = $video_id[0];\n\n return $video_id;\n } else {\n return $link;\n }\n }",
"public function GetYouTubeVideoURL($youtube_video_id)\n\t\t{\n\t\t //$youtube_page = $this->_GetPage('http://youtube.com/watch?v='.$youtube_video_id);\n\t\t $youtube_video_url = '';\n\t\t parse_str(getContents(\"http://www.youtube.com/get_video_info?video_id=$youtube_video_id\"));\n\t\t //fix for the change done in july 2010 by youtube , get_video.php now shows 404 error\n\t\t $video_url_array = array();\n\t\t if(isset($fmt_stream_map))\n\t\t {\n\t\t \t$fmt_arr = explode('||', $fmt_stream_map);\n\t\t\t\t/*\n\t\t \tArray\n\t\t\t\t(\n\t\t\t\t [0] => 35|http://v22.lscache7.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor%2Coc%3AU0dXRlROVl9FSkNNN19MSFpB&fexp=907112%2C906402&algorithm=throttle-factor&itag=35&ipbits=0&burst=40&sver=3&expire=1281438000&key=yt1&signature=D87C06539B8E7E45F3B23E67B18E71ABA7C40D3C.25E6FD5D5A287A8D12D3B529538B714C820C03C3&factor=1.25&id=bd383b3d449589d2\n\t\t\t\t [1] => tc.v22.cache7.c.youtube.com,34|http://v9.lscache4.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor%2Coc%3AU0dXRlROVl9FSkNNN19MSFpB&fexp=907112%2C906402&algorithm=throttle-factor&itag=34&ipbits=0&burst=40&sver=3&expire=1281438000&key=yt1&signature=7FB4BE69348EAB16E3F95DBBED18F6B24419A788.B6F98C705150CA3C8D69663F3FC9B72BEE9E86D8&factor=1.25&id=bd383b3d449589d2\n\t\t\t\t [2] => tc.v9.cache4.c.youtube.com,5|http://v22.lscache6.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor%2Coc%3AU0dXRlROVl9FSkNNN19MSFpB&fexp=907112%2C906402&algorithm=throttle-factor&itag=5&ipbits=0&burst=40&sver=3&expire=1281438000&key=yt1&signature=3484C904A33E8D1BA9CED9A5ABB6AC91A8FF6F43.5E91B7D7315439ED8E1BCEAEF600E5AAF3611E5F&factor=1.25&id=bd383b3d449589d2\n\t\t\t\t [3] => tc.v22.cache6.c.youtube.com\n\t\t\t\t)\n\n\t\t\t\t*/\n\n\t\t \tif(count($fmt_arr))\n\t\t \t{\n\t\t \t\tforeach($fmt_arr as $fmt_url)\n\t\t \t\t{\n\t\t \t\t\t$url_arr = explode('|', $fmt_url);\n\t\t \t\t\t if($coma_pos = strrpos($url_arr[0], ','))\n\t\t \t\t\t {\n\t\t \t\t\t \t$video_format = substr($url_arr[0], $coma_pos+1);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t else\n\t\t\t\t\t\t {\n\t\t\t\t\t\t \t$video_format = $url_arr[0];\n\t\t\t\t\t\t }\n\t\t\t\t\t\t if($url_arr[1])\n\t\t\t\t\t\t \t$video_url_array[$video_format] = $url_arr[1];\n\t\t\t\t\t}\n\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($video_url_array[5]))\n\t\t\t\t$youtube_video_url = $video_url_array[5];\n\t\t\telse if(isset($video_url_array[34]))\n\t\t\t\t$youtube_video_url = $video_url_array[34];\n\t\t\telse if(isset($video_url_array[35]))\n\t\t\t\t$youtube_video_url = $video_url_array[35];\n\n\n\t /*if ((empty($youtube_video_url)) AND isset($token))\n\t\t \t{\n\t\t \t\t$youtube_video_url = \"http://www.youtube.com/get_video.php?video_id=$youtube_video_id&t=$token\";\n\t\t\t}*/\n\n\t\t\t## If video embed status not allowed then, using the following code we get the video url ##\n\t\t\t## referSite:- http://www.longtailvideo.com/support/forum/General-Chat/19265/-Solution-Youtube-Get-Video-Part-2-\n\t\t\tif(empty($youtube_video_url))\n\t\t\t{\n\t\t\t\t/** Get information from server, for error reporting **/\n\t\t\t\t$host = $_SERVER['HTTP_HOST'];\n\t\t\t\t$user_ip = $_SERVER['REMOTE_ADDR'];\n\n\t\t\t\t/** Parameters **/\n\t\t\t\tparse_str(getContents(\"http://youtube.com/get_video_info?video_id={$youtube_video_id}\"),$i);\n\t\t\t\tif($i['status'] != 'ok')\n\t\t\t\t{\n\t\t\t\t\tif($i['errorcode'] != '150')\n\t\t\t\t\t\treturn $youtube_video_url = ''; //** #ERROR \"This video is not available.\"\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//** Cache | Suggestion by @borkul\n\t\t\t\t\t\tparse_str(getContents(\"http://v.leefjedichter.nl/cache/?h={$host}\"),$cache);\n\t\t\t\t\t\tif($cache['status'] == 'limit')\n\t\t\t\t\t\t\treturn $youtube_video_url = ''; //** #ERROR \"Please try again in a few seconds.\" @end Cache\n\t\t\t\t\t\t$matches = explode('\\'SWF_ARGS\\':', getContents(\"http://www.youtube.com/watch?v={$youtube_video_id}\"));\n\t\t\t\t\t\t\t$match = explode('\\'SWF_GAM_URL\\'', $matches[1]);\n\n\t\t\t\t\t\t$matches = str_replace('\", \"','&',str_replace('\": \"','=',$match[0])); parse_str(str_replace(array('{','}'),'',$matches),$i);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/** Video Format **/\n\t\t\t\tif(!isset($i['fmt_map']))\n\t\t\t\t\treturn $youtube_video_url = ''; //** #ERROR \"Video format not found.\"\n\n\t\t\t\tpreg_match_all (\"/(.*?),/is\", $i['fmt_map'], $fmt_map);\n\t\t\t\tforeach($fmt_map[1] as $fmt_i => $fmt_value)\n\t\t\t\t{\n\t\t\t\t\t$fmt_value = explode('/',$fmt_value);\n\t\t\t\t\t\tif($fmt_value[0] == 34) {$fmt = 34;} else{$fmt = 6;}\n\t\t\t\t}\n\n\t\t\t\t/** Get Video **/\n\t\t\t\t$token = isset($i['token'])?$i['token']:'';\n\t\t\t\t$url = \"http://www.youtube.com/get_video.php?video_id={$youtube_video_id}&vq=2&fmt={$fmt}&t={$token}\";\n\t\t\t\t$headers = get_headers($url,1); //** Request the headers from get_video\n\n\t\t\t\t$HTTP = explode(' ',$headers[0]);\n\t\t\t\tparse_str(getContents(\"http://v.leefjedichter.nl/POST/?v={$youtube_video_id}&h={$host}&i={$user_ip}&c=\".$HTTP[1]),$request); //** Post video data and youtube headers\n\n\t\t\t\t$video = $headers['Location'];\n\n\t\t\t\tif(!isset($video)) //If get headers failed\n\t\t\t\t{\n\t\t\t\t\t$fmt_url_map = explode(',',$i['fmt_url_map']);\n\t\t\t\t\t//** Get video from fmt_url_map\n\t\t\t\t\t$fmt_url_map = explode(',',$i['fmt_url_map']);\n\t\t\t\t\tforeach( $fmt_url_map as $fmt_i => $fmt_url)\n\t\t\t\t\t{\n\t\t\t\t\t\t$fmt_url = explode('|',$fmt_url);\n\t\t\t\t\t\tif($fmt_url[0] == 34 || $fmt_url[0] == 6) $video = $fmt_url[1]; break;\n\t\t\t\t\t}\n\t\t\t\t\tif(!isset($video))\n\t\t\t\t\t{\n\t\t\t\t\t\t$fmt_url = explode('|',$fmt_url_map[0]);\n\t\t\t\t\t\t$video = $fmt_url[1];//** Get the video if no formats are found.\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(is_array($video)) $video = $video[0]; //** Check if the video is in an array | Suggestion by @Greg\n\n\t\t\t\tif(!isset($video))\n\t\t\t\t\treturn $youtube_video_url = ''; //** #ERROR \"This video is not available.\"\n\n\t\t\t\t$youtube_video_url = $video;\n\t\t\t}\n\t\t return $youtube_video_url;\n\t\t}",
"function videoContentDetail($url)\r\n {\r\n $host = explode('.', str_replace('www.', '', strtolower(parse_url($url, PHP_URL_HOST))));\r\n $host = isset($host[0]) ? $host[0] : $host;\r\n switch ($host) {\r\n case 'vimeo':\r\n $video_id = substr(parse_url($url, PHP_URL_PATH), 1);\r\n $hash = json_decode(file_get_contents(\"http://vimeo.com/api/v2/video/{$video_id}.json\"));\r\n return array(\r\n 'provider' => 'Vimeo',\r\n 'title' => $hash[0]->title,\r\n 'description' => str_replace(array(\"<br>\", \"<br/>\", \"<br />\"), NULL, $hash[0]->description),\r\n 'description_nl2br' => str_replace(array(\"\\n\", \"\\r\", \"\\r\\n\", \"\\n\\r\"), NULL, $hash[0]->description),\r\n 'thumbnail' => $hash[0]->thumbnail_large,\r\n 'video' => \"https://vimeo.com/\" . $hash[0]->id,\r\n 'embed_video' => \"https://player.vimeo.com/video/\" . $hash[0]->id,\r\n );\r\n break;\r\n case 'youtube':\r\n preg_match(\"/v=([^&#]*)/\", parse_url($url, PHP_URL_QUERY), $video_id);\r\n $video_id = $video_id[1];\r\n $hash = json_decode(file_get_contents(\"http://gdata.youtube.com/feeds/api/videos/{$video_id}?v=2&alt=jsonc\"));\r\n return array(\r\n 'provider' => 'YouTube',\r\n 'title' => $hash->data->title,\r\n 'description' => str_replace(array(\"<br>\", \"<br/>\", \"<br />\"), NULL, $hash->data->description),\r\n 'description_nl2br' => str_replace(array(\"\\n\", \"\\r\", \"\\r\\n\", \"\\n\\r\"), NULL, nl2br($hash->data->description)),\r\n 'thumbnail' => $hash->data->thumbnail->hqDefault,\r\n 'video' => \"http://www.youtube.com/watch?v=\" . $hash->data->id,\r\n 'embed_video' => \"http://www.youtube.com/v/\" . $hash->data->id,\r\n );\r\n break;\r\n }\r\n }",
"function urlToThumbnail($video) {\n\n // Stripping down to URL\n preg_match('/src=\"(.+?)\"/', $video, $matches_url );\n $src = $matches_url[1];\n\n // Attempting to get Youtube\n preg_match('/embed(.*?)?feature/', $src, $matches_id );\n if ($matches_id != NULL) {\n $id = $matches_id[1];\n $id = str_replace( str_split( '?/' ), '', $id );\n\n $MaxResURL = 'https://img.youtube.com/vi/' . $id . '/maxresdefault.jpg';\n\n $curl = curl_init();\n curl_setopt_array($curl, array( \n CURLOPT_URL => $MaxResURL,\n CURLOPT_HEADER => true,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_NOBODY => true));\n\n $response = explode(\"\\n\", curl_exec($curl));\n curl_close($curl);\n\n //var_dump($response); \n\n //If maxres image exists do something with it.\n if (strpos($response[0], '200') !== false) { \n return $MaxResURL;\n } else {\n // print 'Some Other IMG';\n return 'https://img.youtube.com/vi/' . $id . '/hqdefault.jpg';\n }\n } else {\n // Attempting to get Vimeo\n preg_match('/video(.*?)?app_id/', $src, $matches_id );\n\n $id = $matches_id[1];\n $id = str_replace( str_split( '?/' ), '', $id );\n\n $hash = unserialize(file_get_contents(\"https://vimeo.com/api/v2/video/$id.php\"));\n\n return $hash[0]['thumbnail_large'];\n }\n\n }"
] | [
"0.8645141",
"0.78601193",
"0.75004315",
"0.7410207",
"0.7405391",
"0.7404184",
"0.73582083",
"0.7351221",
"0.7305819",
"0.7278222",
"0.71171093",
"0.7084695",
"0.70393854",
"0.7028925",
"0.69650704",
"0.6923758",
"0.68931836",
"0.6882303",
"0.68656063",
"0.67926425",
"0.6754864",
"0.67099464",
"0.6704724",
"0.6694215",
"0.66738194",
"0.65985656",
"0.6584411",
"0.65716946",
"0.65224856",
"0.6520199"
] | 0.83970225 | 1 |
Text Significant Difference detector Used to determine whether a string was "updated" or just simply "modified" depending on how different the two are. If the word "update" appears more or less in the two, then that's also considered significantly different | function textSigDiff($oldtext, $newtext) {
similar_text($oldtext, $newtext, $percent);
$changed = ($percent < 95) ? true : false;
if (substr_count(strtolower($oldtext), 'update') != substr_count(strtolower($newtext), 'update')) {
$updateDiff = true;
} else {
$updateDiff = false;
}
if ($changed == true or $updateDiff == true) {
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function xdiff_string_bdiff($old_data, $new_data)\n{\n}",
"public function testDelta()\n {\n $this->d->setChanges(array(\n array(Diff::EQUAL, \"jump\"),\n array(Diff::DELETE, \"s\"),\n array(Diff::INSERT, \"ed\"),\n array(Diff::EQUAL, \" over \"),\n array(Diff::DELETE, \"the\"),\n array(Diff::INSERT, \"a\"),\n array(Diff::EQUAL, \" lazy\"),\n array(Diff::INSERT, \"old dog\"),\n ));\n $text1 = $this->d->text1();\n $this->assertEquals(\"jumps over the lazy\", $text1);\n\n $delta = $this->d->toDelta();\n $this->assertEquals(\"=4\\t-1\\t+ed\\t=6\\t-3\\t+a\\t=5\\t+old dog\", $delta);\n\n // Convert delta string into a diff.\n $this->assertEquals($this->d->getChanges(), $this->d->fromDelta($text1, $delta)->getChanges());\n\n // Generates error (19 != 20).\n try {\n $this->d->fromDelta($text1 . 'x', $delta);\n $this->fail();\n } catch (\\InvalidArgumentException $e) {\n }\n\n // Generates error (19 != 18).\n try {\n $this->d->fromDelta(mb_substr($text1, 1), $delta);\n $this->fail();\n } catch (\\InvalidArgumentException $e) {\n }\n\n // Test deltas with special characters.\n $this->d->setChanges(array(\n array(Diff::EQUAL, Utils::unicodeChr(0x0680) . \" \\x00 \\t %\"),\n array(Diff::DELETE, Utils::unicodeChr(0x0681) . \" \\x01 \\n ^\"),\n array(Diff::INSERT, Utils::unicodeChr(0x0682) . \" \\x02 \\\\ |\"),\n ));\n\n $text1 = $this->d->text1();\n $this->assertEquals(Utils::unicodeChr(0x0680) . \" \\x00 \\t %\" . Utils::unicodeChr(0x0681) . \" \\x01 \\n ^\", $text1);\n\n $delta = $this->d->toDelta();\n $this->assertEquals(\"=7\\t-7\\t+%DA%82 %02 %5C %7C\", $delta);\n\n // Convert delta string into a diff.\n $this->assertEquals($this->d->getChanges(), $this->d->fromDelta($text1, $delta)->getChanges());\n\n // Verify pool of unchanged characters.\n $this->d->setChanges(array(\n array(Diff::INSERT, \"A-Z a-z 0-9 - _ . ! ~ * ' ( ) ; / ? : @ & = + $ , # \"),\n ));\n\n $text2 = $this->d->text2();\n $this->assertEquals(\"A-Z a-z 0-9 - _ . ! ~ * ' ( ) ; / ? : @ & = + $ , # \", $text2);\n\n $delta = $this->d->toDelta();\n $this->assertEquals(\"+A-Z a-z 0-9 - _ . ! ~ * ' ( ) ; / ? : @ & = + $ , # \", $delta);\n\n // Convert delta string into a diff.\n $this->assertEquals($this->d->getChanges(), $this->d->fromDelta(\"\", $delta)->getChanges());\n }",
"public function testText(){\n $this->d->setChanges(array(\n array(Diff::EQUAL, \"jump\"),\n array(Diff::DELETE, \"s\"),\n array(Diff::INSERT, \"ed\"),\n array(Diff::EQUAL, \" over \"),\n array(Diff::DELETE, \"the\"),\n array(Diff::INSERT, \"a\"),\n array(Diff::EQUAL, \" lazy\"),\n ));\n $this->assertEquals(\n \"jumps over the lazy\",\n $this->d->text1()\n );\n $this->assertEquals(\n \"jumped over a lazy\",\n $this->d->text2()\n );\n }",
"public static function articleCountWordDiff(&$article,&$user,$newText, $summary,$flag, $fake1, $fake2, &$flags, $revision, &$status, $baseRevId){\r\n\t\tglobal $wgContentNamespaces, $wgSitename;\r\n\t\twfProfileIn(__METHOD__);\r\n\t\t\r\n\t\tif ( is_null( $revision ) ) {\r\n\t\t\t// nothing's changed, quit early\r\n\t\t\twfProfileOut( __METHOD__ );\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\tif( !in_array($article->getTitle()->getNamespace(), $wgContentNamespaces) ) {\r\n\t\t\twfProfileOut( __METHOD__ );\r\n\t\t\treturn true;\t\r\n\t\t}\r\n\t\t\r\n\t\t// do not push reverts \r\n\t\t$baseRevision = Revision::newFromId( $baseRevId );\r\n\t\tif ( $baseRevision && $revision->getTextId() == $baseRevision->getTextId() ) {\r\n\t\t\twfProfileOut( __METHOD__ );\r\n\t\t\treturn true; \r\n\t\t}\r\n\t\t\r\n\t\t$diff = 0;\r\n\t\t$wNewCount = strlen( $newText );\r\n\t\t$wOldCount = strlen( $article->getRawText() );\r\n\t\t$countDiff = $wNewCount - $wOldCount;\r\n\r\n\t\tif ($countDiff > self::$MIN_CHARS_TO_PUSH){\r\n\t\t\t$params = array(\r\n\t\t\t\t'$ARTICLENAME' => $article->getTitle()->getText(),\r\n\t\t\t\t'$WIKINAME' => $wgSitename,\r\n\t\t\t\t'$ARTICLE_URL' => $article->getTitle()->getFullURL( 'ref=fbfeed&fbtype=largeedit' ),\r\n\t\t\t\t'$EVENTIMG' => self::$eventImage,\r\n\t\t\t\t'$SUMMART' => $summary,\r\n\t\t\t\t'$TEXT' => self::shortenText( self::parseArticle( $article, $newText ))\t\t\t\r\n\t\t\t);\r\n\t\t\tself::pushEvent( self::$messageName, $params, __CLASS__ );\r\n\t\t}\r\n\r\n\t\twfProfileOut(__METHOD__);\r\n\t\treturn true;\r\n\t}",
"public function get_diff( $update ) {\n\n\t\t$strings = array(\n\t\t\t'name',\n\t\t\t'product',\n\t\t\t'summary',\n\t\t\t'description',\n\t\t\t'homepage',\n\t\t\t'installation',\n\t\t);\n\n\t\tob_start();\n\n\t\tforeach( $strings as $string ) :\n\t\t\t$diff = wp_text_diff( $this->{$string}, $update->{$string} );\n\n\t\t\tif ( empty( $diff ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t?>\n\n\t\t<div class=\"param\">\n\t\t\t<h4><?php echo ucfirst( $string ); ?></h4>\n\t\t\t<?php echo $diff; ?>\n\t\t</div>\n\n\t\t<?php\n\t\tendforeach;\n\n\t\t$current_category = !empty( $this->category ) ? get_term( $this->category, 'pkp_category' ) : '';\n\t\t$update_category = !empty( $update->category ) ? get_term( $update->category, 'pkp_category' ) : '';\n\t\t$diff = wp_text_diff( $current_category->name, $update_category->name );\n\n\t\tif ( !empty( $diff ) ) :\n\t\t?>\n\n\t\t<div class=\"param\">\n\t\t\t<h4><?php esc_html_e( 'Category' ); ?></h4>\n\t\t\t<?php echo $diff; ?>\n\t\t</div>\n\n\t\t<?php\n\t\tendif;\n\n\t\treturn ob_get_clean();\n\t}",
"private function hasFix($string, $update)\n {\n return !(strpos($string, trim($update)) === false);\n }",
"function diff ($string1, $string2)\n{\n\tif (!extension_loaded (\"xdiff\"))\n\t{\n\t\t$result = @dl (\"xdiff.so\"); // avoid the E_WARNING\n\t\tif (!$result)\n\t\t{\n\t\t\treturn \"Note: xdiff not available for diffing. Outputting both strings:\\nString1:\\n$string1\\nString2:\\n$string2\";\n\t\t}\n\t}\n\n\tif (strlen ($string1) > 5000000 || strlen ($string2) > 5000000)\n\t\treturn \"Too big to xdiff. Outputting both strings:\\nString1:\\n$string1\\nString2:\\n$string2\";\n\n\treturn xdiff_string_diff (\"$string1\\n\", \"$string2\\n\");\n}",
"function levenshtein ($str1, $str2) {}",
"public function testCleanupSemanticLossless()\n {\n // Null case.\n $this->d->setChanges(array());\n $this->d->cleanupSemanticLossless();\n $this->assertEquals(array(), $this->d->getChanges());\n\n // Blank lines.\n $this->d->setChanges(array(\n array(Diff::EQUAL, \"AAA\\r\\n\\r\\nBBB\"),\n array(Diff::INSERT, \"\\r\\nDDD\\r\\n\\r\\nBBB\"),\n array(Diff::EQUAL, \"\\r\\nEEE\"),\n ));\n $this->d->cleanupSemanticLossless();\n $this->assertEquals(array(\n array(Diff::EQUAL, \"AAA\\r\\n\\r\\n\"),\n array(Diff::INSERT, \"BBB\\r\\nDDD\\r\\n\\r\\n\"),\n array(Diff::EQUAL, \"BBB\\r\\nEEE\"),\n ), $this->d->getChanges());\n\n // Line boundaries.\n $this->d->setChanges(array(\n array(Diff::EQUAL, \"AAA\\r\\nBBB\"),\n array(Diff::INSERT, \" DDD\\r\\nBBB\"),\n array(Diff::EQUAL, \" EEE\"),\n ));\n $this->d->cleanupSemanticLossless();\n $this->assertEquals(array(\n array(Diff::EQUAL, \"AAA\\r\\n\"),\n array(Diff::INSERT, \"BBB DDD\\r\\n\"),\n array(Diff::EQUAL, \"BBB EEE\"),\n ), $this->d->getChanges());\n\n // Word boundaries.\n $this->d->setChanges(array(\n array(Diff::EQUAL, \"The c\"),\n array(Diff::INSERT, \"ow and the c\"),\n array(Diff::EQUAL, \"at.\"),\n ));\n $this->d->cleanupSemanticLossless();\n $this->assertEquals(array(\n array(Diff::EQUAL, \"The \"),\n array(Diff::INSERT, \"cow and the \"),\n array(Diff::EQUAL, \"cat.\"),\n ), $this->d->getChanges());\n\n // Alphanumeric boundaries.\n $this->d->setChanges(array(\n array(Diff::EQUAL, \"The-c\"),\n array(Diff::INSERT, \"ow-and-the-c\"),\n array(Diff::EQUAL, \"at.\"),\n ));\n $this->d->cleanupSemanticLossless();\n $this->assertEquals(array(\n array(Diff::EQUAL, \"The-\"),\n array(Diff::INSERT, \"cow-and-the-\"),\n array(Diff::EQUAL, \"cat.\"),\n ), $this->d->getChanges());\n\n // Hitting the start.\n $this->d->setChanges(array(\n array(Diff::EQUAL, \"a\"),\n array(Diff::DELETE, \"a\"),\n array(Diff::EQUAL, \"ax\"),\n ));\n $this->d->cleanupSemanticLossless();\n $this->assertEquals(array(\n array(Diff::DELETE, \"a\"),\n array(Diff::EQUAL, \"aax\"),\n ), $this->d->getChanges());\n\n // Hitting the end.\n $this->d->setChanges(array(\n array(Diff::EQUAL, \"xa\"),\n array(Diff::DELETE, \"a\"),\n array(Diff::EQUAL, \"a\"),\n ));\n $this->d->cleanupSemanticLossless();\n $this->assertEquals(array(\n array(Diff::EQUAL, \"xaa\"),\n array(Diff::DELETE, \"a\"),\n ), $this->d->getChanges());\n\n // Sentence boundaries.\n $this->d->setChanges(array(\n array(Diff::EQUAL, \"The xxx. The \"),\n array(Diff::INSERT, \"zzz. The \"),\n array(Diff::EQUAL, \"yyy.\"),\n ));\n $this->d->cleanupSemanticLossless();\n $this->assertEquals(array(\n array(Diff::EQUAL, \"The xxx.\"),\n array(Diff::INSERT, \" The zzz.\"),\n array(Diff::EQUAL, \" The yyy.\"),\n ), $this->d->getChanges());\n }",
"function diff($stringA, $stringB, $message='') {\n if (! isset($this->_reporter)) {\n trigger_error('Can only show diff within test methods');\n }\n if($message != '')\n $this->_reporter->paintMessage($message);\n $this->_reporter->paintDiff($stringA, $stringB);\n }",
"static function stringDiff($actual, $expect) {\n $scanTo = min(strlen($actual), strlen($expect));\n for ($posn = 0; $posn < $scanTo; ++$posn) {\n if ($actual[$posn] != $expect[$posn]) {\n break;\n }\n }\n if ($posn > 30) {\n $from = $posn - 30;\n $bias = 30;\n } else {\n $from = 0;\n $bias = $posn;\n }\n $aSeg = substr($actual, $from, 60);\n $eSeg = substr($expect, $from, 60);\n // If the strings match, return nothing.\n if ($aSeg == $eSeg) {\n return '';\n }\n $scanTo = max(strlen($aSeg), strlen($eSeg));\n $endAt = min(strlen($aSeg), strlen($eSeg));\n $diff = str_repeat(' ', $scanTo);\n for ($ind = 0; $ind < $scanTo; ++$ind) {\n if ($ind < strlen($eSeg) && ($ech = $eSeg[$ind]) < ' ') {\n $eSeg[$ind] = ' ';\n $diff[$ind] = '-';\n }\n if ($ind < strlen($aSeg) && ($ach = $aSeg[$ind]) < ' ') {\n $aSeg[$ind] = ' ';\n $diff[$ind] = '-';\n }\n if ($ind >= $endAt) {\n $diff[$ind] = '*';\n continue;\n }\n if ($ech != $ach) {\n $diff[$ind] = '|';\n }\n }\n return 'Mismatched strings at ' . $posn . chr(10)\n . 'Actual: <' . $aSeg . '>' . chr(10)\n . 'Diff: ' . $diff . chr(10)\n . 'Expect: <' . $eSeg . '>' . chr(10);\n }",
"function similar_text ($first, $second, &$percent = null) {}",
"function segmentForDiff( $text ) {\n\t\treturn $text;\n\t}",
"public static function diffCommonSuffix($old, $new, $stringUtil)\n {\n if ($stringUtil->strlen($old) == 0 || $stringUtil->strlen($new) == 0 || $stringUtil->substr($old, $stringUtil->strlen($old) - 1, 1) != $stringUtil->substr($new, $stringUtil->strlen($new) - 1, 1)) {\n return 0;\n }\n\n // Binary Search\n $pointerMin = 0;\n $pointerMax = min($stringUtil->strlen($old), $stringUtil->strlen($new));\n $pointerMid = $pointerMax;\n $pointerEnd = 0;\n $oldLen = $stringUtil->strlen($old);\n $newLen = $stringUtil->strlen($new);\n while ($pointerMin < $pointerMid) {\n if ($stringUtil->substr($old, $oldLen - $pointerMid, $pointerMid - $pointerEnd) == $stringUtil->substr($new, $newLen - $pointerMid, $pointerMid - $pointerEnd)) {\n $pointerMin = $pointerMid;\n $pointerEnd = $pointerMin;\n } else {\n $pointerMax = $pointerMid;\n }\n $pointerMid = floor(($pointerMax - $pointerMin) / 2 + $pointerMin);\n }\n return $pointerMid;\n }",
"function inferContrastFromPhrase($phrase)\n {\n $haystack = strtoupper($phrase);\n\n //Look for indication of both\n $both_contrast_ind = FALSE; //Assume not both\n $both_contrast_ind[] = 'W&WO CONT';\n $both_contrast_ind[] = 'WITH AND WITHOUT CONT';\n foreach($both_contrast_ind as $needle)\n {\n $p = strpos($haystack, $needle);\n if($p !== FALSE)\n {\n $both_contrast_ind = TRUE;\n break;\n }\n }\n if(!$both_contrast_ind)\n {\n //Look for the NO indicators\n $no_contrast = NULL;\n $no_contrast_ind = array();\n $no_contrast_ind[] = 'W/O CONT';\n $no_contrast_ind[] = 'W/N CONT';\n $no_contrast_ind[] = 'WO CONT';\n $no_contrast_ind[] = 'WN CONT';\n $no_contrast_ind[] = 'NO CONT';\n $no_contrast_ind[] = 'WITHOUT CONT';\n foreach($no_contrast_ind as $needle)\n {\n $p = strpos($haystack, $needle);\n if($p !== FALSE)\n {\n $no_contrast = TRUE;\n break;\n }\n }\n\n //Look for the YES indicators\n $yes_contrast = NULL;\n $yes_contrast_ind = array();\n $yes_contrast_ind[] = 'W CONT';\n $yes_contrast_ind[] = 'WITH CONT';\n $yes_contrast_ind[] = 'W/IV CONT';\n $yes_contrast_ind[] = 'INCLUDE CONT';\n $yes_contrast_ind[] = 'INC CONT';\n foreach($yes_contrast_ind as $needle)\n {\n $p = strpos($haystack, $needle);\n if($p !== FALSE)\n {\n $yes_contrast = TRUE;\n break;\n }\n }\n\n //Return our analysis result.\n if($no_contrast && $yes_contrast === NULL)\n {\n return FALSE;\n }\n if($no_contrast === NULL && $yes_contrast)\n {\n return TRUE;\n }\n }\n \n //No clues or confusing indications.\n return NULL;\n }",
"public function testLevenshtein()\n {\n $this->d->setChanges(array(\n array(Diff::DELETE, \"abc\"),\n array(Diff::INSERT, \"1234\"),\n array(Diff::EQUAL, \"xyz\"),\n ));\n $this->assertEquals(4, $this->d->levenshtein());\n\n // Levenshtein with leading equality.\n $this->d->setChanges(array(\n array(Diff::EQUAL, \"xyz\"),\n array(Diff::DELETE, \"abc\"),\n array(Diff::INSERT, \"1234\"),\n ));\n $this->assertEquals(4, $this->d->levenshtein());\n\n // Levenshtein with middle equality.\n $this->d->setChanges(array(\n array(Diff::DELETE, \"abc\"),\n array(Diff::EQUAL, \"xyz\"),\n array(Diff::INSERT, \"1234\"),\n ));\n $this->assertEquals(7, $this->d->levenshtein());\n }",
"public function testRenderWordGlues1(): void\n {\n $word = new Word([], ['wordGlues' => [' ', '-']]);\n $mbOld = new MbString('good-looking-x');\n $mbNew = new MbString('good--y');\n\n $word->render($mbOld, $mbNew);\n\n $oldDiff = str_replace(RendererConstant::HTML_CLOSURES, RendererConstant::HTML_CLOSURES_DEL, $mbOld->get());\n $newDiff = str_replace(RendererConstant::HTML_CLOSURES, RendererConstant::HTML_CLOSURES_INS, $mbNew->get());\n\n static::assertSame('good-<del>looking-x</del>', $oldDiff);\n static::assertSame('good-<ins>-y</ins>', $newDiff);\n }",
"function rebuildtexts($diffs) {\n $text1 = \"\";\n $text2 = \"\";\n foreach ($diffs as $change) {\n if ($change[0] != Diff::INSERT) {\n $text1 .= $change[1];\n }\n if ($change[0] != Diff::DELETE) {\n $text2 .= $change[1];\n }\n }\n return array($text1, $text2);\n }",
"public function testRenderWordGlues2(): void\n {\n $word = new Word([], ['wordGlues' => [' ', '-']]);\n $mbOld = new MbString('of the Indo-Euopearn legguanas, Porto-Idno-Eorpuaen, did not have aieltrcs. Msot of the lanaguges in this flamiy do not hvae diiefnte or ieiinfntde atrciels: three is no actirle in Ltain or Ssknarit, nor in some meodrn Indo-Eoeapurn lgagaenus, scuh as the falmeiis of Salvic lnggaeuas (epexct for Bulraiagn and Mneiodaacn, whcih are reahtr dviiittcsne amnog the Saivlc lagauegns in thier gmrmaar), Btialc leaauggns and mnay Indo-Aaryn lgugneaas. Aluogthh Csiacslal Greek had a dtiniefe artlcie (wichh has srivvued itno Modren Gerek and wichh bears snotrg fcaiutonnl raeelmnscbe to the Gramen deiinfte arltcie, whcih it is rtealed to), the erailer Hmeoirc Geerk used this alctrie llrgeay as a prnuoon or dioravsttmnee, wareehs the erlaseit known form of Geerk konwn as Meayenacn Gerek did not have any acrlties. Atilcres dvlpeeoed inleenddpenty in svaeerl lagnauge fmieials. In mnay lagnuegas, the form of the atrlice may vary acdrocnig to the gneedr, nbmuer, or csae of its nuon. In smoe laganegus the artcile may be the only idiaitnocn of the case. Many languages do not utilize articles at all, and may use other ways of denoting old versus incipient information, such as topic comment constructions.');\n $mbNew = new MbString('of the Indo-European languages, Proto-Indo-European, did not have articles. Most of the languages in this family do not have definite or indefinite articles: there is no article in Latin or Sanskrit, nor in some modern Indo-European languages, such as the families of Slavic languages (epexct for Bulraiagn and Mneiodaacn, whcih are reahtr dviiittcsne amnog the Saivlc lagauegns in thier gmrmaar), Btialc leaauggns and mnay Indo-Aaryn lgugneaas. Aluogthh Csiacslal Greek had a dtiniefe artlcie (wichh has srivvued itno Modren Gerek and wichh bears snotrg fcaiutonnl raeelmnscbe to the Gramen deiinfte arltcie, whcih it is rtealed to), the erailer Hmeoirc Geerk used this alctrie llrgeay as a prnuoon or dioravsttmnee, wareehs the erlaseit known form of Geerk konwn as Meayenacn Gerek did not have any acrlties. Atilcres dvlpeeoed inleenddpenty in svaeerl lagnauge fmieials. In mnay lagnuegas, the form of the atrlice may vary acdrocnig to the gneedr, nbmuer, or csae of its nuon. In smoe laganegus the artcile may be the only idiaitnocn of the case. Many languages do not utilize articles at all, and may use other ways of denoting old versus incipient information, such as topic comment constructions.');\n\n $word->render($mbOld, $mbNew);\n\n $oldDiff = str_replace(RendererConstant::HTML_CLOSURES, RendererConstant::HTML_CLOSURES_DEL, $mbOld->get());\n $newDiff = str_replace(RendererConstant::HTML_CLOSURES, RendererConstant::HTML_CLOSURES_INS, $mbNew->get());\n\n static::assertSame('of the Indo-<del>Euopearn legguanas</del>, <del>Porto-Idno-Eorpuaen</del>, did not have <del>aieltrcs</del>. <del>Msot</del> of the <del>lanaguges</del> in this <del>flamiy</del> do not <del>hvae diiefnte</del> or <del>ieiinfntde atrciels</del>: <del>three</del> is no <del>actirle</del> in <del>Ltain</del> or <del>Ssknarit</del>, nor in some <del>meodrn</del> Indo-<del>Eoeapurn lgagaenus</del>, <del>scuh</del> as the <del>falmeiis</del> of <del>Salvic lnggaeuas</del> (epexct for Bulraiagn and Mneiodaacn, whcih are reahtr dviiittcsne amnog the Saivlc lagauegns in thier gmrmaar), Btialc leaauggns and mnay Indo-Aaryn lgugneaas. Aluogthh Csiacslal Greek had a dtiniefe artlcie (wichh has srivvued itno Modren Gerek and wichh bears snotrg fcaiutonnl raeelmnscbe to the Gramen deiinfte arltcie, whcih it is rtealed to), the erailer Hmeoirc Geerk used this alctrie llrgeay as a prnuoon or dioravsttmnee, wareehs the erlaseit known form of Geerk konwn as Meayenacn Gerek did not have any acrlties. Atilcres dvlpeeoed inleenddpenty in svaeerl lagnauge fmieials. In mnay lagnuegas, the form of the atrlice may vary acdrocnig to the gneedr, nbmuer, or csae of its nuon. In smoe laganegus the artcile may be the only idiaitnocn of the case. Many languages do not utilize articles at all, and may use other ways of denoting old versus incipient information, such as topic comment constructions.', $oldDiff);\n static::assertSame('of the Indo-<ins>European languages</ins>, <ins>Proto-Indo-European</ins>, did not have <ins>articles</ins>. <ins>Most</ins> of the <ins>languages</ins> in this <ins>family</ins> do not <ins>have definite</ins> or <ins>indefinite articles</ins>: <ins>there</ins> is no <ins>article</ins> in <ins>Latin</ins> or <ins>Sanskrit</ins>, nor in some <ins>modern</ins> Indo-<ins>European languages</ins>, <ins>such</ins> as the <ins>families</ins> of <ins>Slavic languages</ins> (epexct for Bulraiagn and Mneiodaacn, whcih are reahtr dviiittcsne amnog the Saivlc lagauegns in thier gmrmaar), Btialc leaauggns and mnay Indo-Aaryn lgugneaas. Aluogthh Csiacslal Greek had a dtiniefe artlcie (wichh has srivvued itno Modren Gerek and wichh bears snotrg fcaiutonnl raeelmnscbe to the Gramen deiinfte arltcie, whcih it is rtealed to), the erailer Hmeoirc Geerk used this alctrie llrgeay as a prnuoon or dioravsttmnee, wareehs the erlaseit known form of Geerk konwn as Meayenacn Gerek did not have any acrlties. Atilcres dvlpeeoed inleenddpenty in svaeerl lagnauge fmieials. In mnay lagnuegas, the form of the atrlice may vary acdrocnig to the gneedr, nbmuer, or csae of its nuon. In smoe laganegus the artcile may be the only idiaitnocn of the case. Many languages do not utilize articles at all, and may use other ways of denoting old versus incipient information, such as topic comment constructions.', $newDiff);\n }",
"function calcAuthorLevenshtein($left, $right)\r\n\t{\r\n\t\t$pattern = '/[\\s,.]/';\r\n\t\t$left = preg_replace($pattern,'',$left);\r\n\t\t$right = preg_replace($pattern,'',$right);\r\n\t\treturn levenshtein($left, $right);\r\n\t}",
"function accuratelev($a,$b){\n\t$a = strtoupper($a);\n\t$b = strtoupper($b);\n\n\t$splitteda = split(\" \",$a);\n\t$splittedb = split(\" \",$b);\n\n\t$totaldistance = 0;\n\tif (count($splitteda) == 0 || count($splittedb) == 0) {\n\t\treturn levenshtein($a, $b);\n\t}\n\n\tforeach($splitteda as $sa)\n\t{\n\t\t$tmplev = -1;\n\n\t\tforeach($splittedb as $sb)\n\t\t{\n\t\t\t$localev = levenshtein($sa, $sb);\n\t\t\tif ($localev < $tmplev || $tmplev<0) {\n\t\t\t\t$tmplev = $localev;\n\t\t\t}\n\t\t}\n\n\t $totaldistance += $tmplev;\n\t}\n\n\treturn $totaldistance;\n}",
"final static function dts_diff($old)\r\n\t{\r\n\t\t//date format must be \"m d Y H:i:s\"\r\n\t\t$new \t= self::dts();\r\n\t\t$od \t= explode(' ', $old);\r\n\t\t$ot \t= explode(':', $od[3]);\r\n\t\t$nd \t= explode(' ', $new);\r\n\t\t$nt \t= explode(':', $nd[3]);\r\n\r\n\t\t$res \t= 0;\r\n\r\n\t\t$res \t+= ($nd[2] > $od[2]) ? self::y2sec($nd[2] - $od[2]) : 0;\r\n\t\t$res \t+= ($nd[0] > $od[0]) ? self::m2sec($nd[0] - $od[0]) : 0;\r\n\t\t$res \t+= ($nd[1] > $od[1]) ? self::d2sec($nd[1] - $od[1]) : 0;\r\n\t\t$res \t+= ($nt[0] > $ot[0]) ? self::hr2sec($nt[0] - $ot[0]) : 0;\r\n\t\t$res \t+= ($nt[1] > $ot[1]) ? self::min2sec($nt[1] - $ot[1]) : 0;\r\n\t\t$res \t+= ($nt[2] > $ot[2]) ? \t\t\t\t ($nt[2] - $ot[2]) : 0;\r\n\r\n\t\treturn $res;\r\n\t}",
"public function testMain()\n {\n // Null case.\n $this->assertEquals(array(), $this->d->main(\"\", \"\", false)->getChanges());\n\n // Equality.\n $this->assertEquals(\n array(\n array(Diff::EQUAL, \"abc\"),\n ),\n $this->d->main(\"abc\", \"abc\", false)->getChanges()\n );\n\n // Check '0' strings\n $this->assertEquals(\n array(\n array(Diff::EQUAL, \"0\"),\n array(Diff::INSERT, \"X\"),\n array(Diff::EQUAL, \"12\"),\n array(Diff::INSERT, \"X\"),\n array(Diff::EQUAL, \"0\"),\n array(Diff::INSERT, \"X\"),\n array(Diff::EQUAL, \"34\"),\n array(Diff::INSERT, \"X\"),\n array(Diff::EQUAL, \"0\"),\n ),\n $this->d->main(\"0120340\", \"0X12X0X34X0\", false)->getChanges()\n );\n\n $this->assertEquals(\n array(\n array(Diff::EQUAL, \"0\"),\n array(Diff::DELETE, \"X\"),\n array(Diff::EQUAL, \"12\"),\n array(Diff::DELETE, \"X\"),\n array(Diff::EQUAL, \"0\"),\n array(Diff::DELETE, \"X\"),\n array(Diff::EQUAL, \"34\"),\n array(Diff::DELETE, \"X\"),\n array(Diff::EQUAL, \"0\"),\n ),\n $this->d->main(\"0X12X0X34X0\", \"0120340\", false)->getChanges()\n );\n\n\n $this->assertEquals(\n array(\n array(Diff::DELETE, \"Apple\"),\n array(Diff::INSERT, \"Banana\"),\n array(Diff::EQUAL, \"s are a\"),\n array(Diff::INSERT, \"lso\"),\n array(Diff::EQUAL, \" fruit.\"),\n ),\n $this->d->main(\"Apples are a fruit.\", \"Bananas are also fruit.\", false)->getChanges()\n );\n\n $this->assertEquals(\n array(\n array(Diff::DELETE, \"a\"),\n array(Diff::INSERT, Utils::unicodeChr(0x0680)),\n array(Diff::EQUAL, \"x\"),\n array(Diff::DELETE, \"\\t\"),\n array(Diff::INSERT, \"\\x00\"),\n ),\n $this->d->main(\"ax\\t\", Utils::unicodeChr(0x0680) . \"x\\x00\", false)->getChanges()\n );\n\n // Overlaps.\n $this->assertEquals(\n array(\n array(Diff::DELETE, \"1\"),\n array(Diff::EQUAL, \"a\"),\n array(Diff::DELETE, \"y\"),\n array(Diff::EQUAL, \"b\"),\n array(Diff::DELETE, \"2\"),\n array(Diff::INSERT, \"xab\"),\n ),\n $this->d->main(\"1ayb2\", \"abxab\", false)->getChanges()\n );\n\n $this->assertEquals(\n array(\n array(Diff::INSERT, \"xaxcx\"),\n array(Diff::EQUAL, \"abc\"),\n array(Diff::DELETE, \"y\"),\n ),\n $this->d->main(\"abcy\", \"xaxcxabc\", false)->getChanges()\n );\n\n $this->assertEquals(\n array(\n array(Diff::DELETE, \"ABCD\"),\n array(Diff::EQUAL, \"a\"),\n array(Diff::DELETE, \"=\"),\n array(Diff::INSERT, \"-\"),\n array(Diff::EQUAL, \"bcd\"),\n array(Diff::DELETE, \"=\"),\n array(Diff::INSERT, \"-\"),\n array(Diff::EQUAL, \"efghijklmnopqrs\"),\n array(Diff::DELETE, \"EFGHIJKLMNOefg\"),\n ),\n $this->d->main(\"ABCDa=bcd=efghijklmnopqrsEFGHIJKLMNOefg\", \"a-bcd-efghijklmnopqrs\", false)->getChanges()\n );\n\n // Large equality.\n $this->assertEquals(\n array(\n array(Diff::INSERT, \" \"),\n array(Diff::EQUAL, \"a\"),\n array(Diff::INSERT, \"nd\"),\n array(Diff::EQUAL, \" [[Pennsylvania]]\"),\n array(Diff::DELETE, \" and [[New\"),\n ),\n $this->d->main(\"a [[Pennsylvania]] and [[New\", \" and [[Pennsylvania]]\", false)->getChanges()\n );\n\n // Emoji\n $this->assertEquals(\n array(\n array(Diff::EQUAL, \"Car\"),\n array(Diff::INSERT, \" — 🚘\"),\n array(Diff::EQUAL, \"!\"),\n ),\n $this->d->main(\"Car!\", \"Car — 🚘!\", false)->getChanges()\n );\n\n\n // Timeout.\n // 100ms\n $this->d->setTimeout(0.1);\n $a = \"`Twas brillig, and the slithy toves\\nDid gyre and gimble in the wabe:\\nAll mimsy were the borogoves,\\nAnd the mome raths outgrabe.\\n\";\n $b = \"I am the very model of a modern major general,\\nI've information vegetable, animal, and mineral,\\nI know the kings of England, and I quote the fights historical,\\nFrom Marathon to Waterloo, in order categorical.\\n\";\n // Increase the text lengths by 1024 times to ensure a timeout.\n for ($i = 0; $i < 10; $i++) {\n $a .= $a;\n $b .= $b;\n }\n $startTime = microtime(1);\n $this->d->main($a, $b);\n $endTime = microtime(1);\n\n // Test that we took at least the timeout period.\n $this->assertGreaterThanOrEqual($this->d->getTimeout(), $endTime - $startTime);\n\n // Test that we didn't take forever (be forgiving).\n // Theoretically this test could fail very occasionally if the\n // OS task swaps or locks up for a second at the wrong moment.\n // TODO must be $this->d->getTimeout() * 2, but it need some optimization of linesToCharsMunge()\n $this->assertLessThan($this->d->getTimeout() * 15, $endTime - $startTime);\n $this->d->setTimeout(0);\n\n // Test the linemode speedup.\n // Must be long to pass the 100 char cutoff.\n // Simple line-mode.\n $a = str_repeat(\"1234567890\\n\", ceil(Diff::LINEMODE_THRESOLD / strlen($a)));\n $b = str_repeat(\"abcdefghij\\n\", ceil(Diff::LINEMODE_THRESOLD / strlen($b)));\n $this->assertEquals(\n $this->d->main($a, $b, false)->getChanges(),\n $this->d->main($a, $b, true)->getChanges()\n );\n\n // Simple line-mode with multiple line breaks.\n $a = \"12345\\n\\n67890\\n\";\n $a = str_repeat($a, ceil(Diff::LINEMODE_THRESOLD / strlen($a)));\n $b = \"abcde\\n\\nfghij\\n\";\n $b = str_repeat($b, ceil(Diff::LINEMODE_THRESOLD / strlen($b)));\n $this->assertEquals(\n $this->d->main($a, $b, false)->getChanges(),\n $this->d->main($a, $b, true)->getChanges()\n );\n\n // Simple line-mode with multiple line breaks but without leading line break\n $a = \"12345\\n\\n67890\\n\";\n $a = str_repeat($a, ceil(Diff::LINEMODE_THRESOLD / strlen($a))) . '0';\n $b = \"abcde\\n\\nfghij\\n\";\n $b = str_repeat($b, ceil(Diff::LINEMODE_THRESOLD / strlen($b))) . 'a ';\n $this->assertEquals(\n $this->d->main($a, $b, false)->getChanges(),\n $this->d->main($a, $b, true)->getChanges()\n );\n\n // Single line-mode.\n $a = str_repeat(\"1234567890\", 13);\n $b = str_repeat(\"abcdefghij\", 13);\n $this->assertEquals(\n $this->d->main($a, $b, false)->getChanges(),\n $this->d->main($a, $b, true)->getChanges()\n );\n\n function rebuildtexts($diffs) {\n // Construct the two texts which made up the diff originally.\n $text1 = \"\";\n $text2 = \"\";\n foreach ($diffs as $change) {\n if ($change[0] != Diff::INSERT) {\n $text1 .= $change[1];\n }\n if ($change[0] != Diff::DELETE) {\n $text2 .= $change[1];\n }\n }\n return array($text1, $text2);\n }\n // Overlap line-mode.\n $a = str_repeat(\"1234567890\\n\", 13);\n $b = \"abcdefghij\\n1234567890\\n1234567890\\n1234567890\\nabcdefghij\\n1234567890\\n1234567890\\n1234567890\\nabcdefghij\\n1234567890\\n1234567890\\n1234567890\\nabcdefghij\\n\";\n $this->assertEquals(\n rebuildtexts($this->d->main($a, $b, false)->getChanges()),\n rebuildtexts($this->d->main($a, $b, true)->getChanges())\n );\n\n // Test null inputs.\n try {\n $this->d->main(null, null);\n $this->fail();\n } catch (\\InvalidArgumentException $e) {\n }\n }",
"public static function get_text_version() {\n\n\n }",
"function findMatch($arr, $target, &$start, $diff, $idioma, &$log, $hasAp, $lenDiff) {\r\n\r\n\t//pulls the character list\r\n\tglobal $aValid;\r\n\t\r\n\t//this tracks the location in the spanish array, the english array tends to get ahead of itself because it separates compound words\r\n\t$startingPoint = $start;\r\n\t$start += $diff;\r\n\t$end = $start + 50;\r\n\t\r\n\t//It cycles until it hits the end of the array, which you better hope it doesn't\r\n\t//If it does, that usually means that there is a difference between the tagged and original files.\r\n\twhile ($start < endKey($arr) and $start <= $end) {\r\n\t\t\r\n\t\t//This is the array of the next element in the comparison array\r\n\t\t$tester = stringToArray($arr[$start]);\r\n\t\t\r\n\t\t//This is the word in that array\r\n\t\t$subTest = $tester[0];\r\n\t\t\r\n\t\t//This determines whether the word in this array is the same as the word we are looking for\r\n\t\tif ($subTest == $target) {\r\n\t\t\t\r\n\t\t\tif ($hasAp == true) { $start++;}\r\n\t\t\t\r\n\t\t\t//next time start by looking at the next word\r\n\t\t\t$start++;\r\n\t\t\t\r\n\t\t\t//array of the next element in the array, which is the ending character position of the current word\r\n\t\t\t$endingS = stringToArray($arr[$start]);\r\n\t\t\t\r\n\t\t\t//this is that position\r\n\t\t\t$endingC = $endingS[0] - $lenDiff;\r\n\t\t\t\r\n\t\t\t//this is the calculated character position of the first letter of the current word\r\n\t\t\t$startC = $endingC - mb_strlen($target, \"UTF-8\") + 1;\r\n\t\t\t\r\n\t\t\t//this is the array for the next line, which is the speaker\r\n\t\t\t$speakerS = stringToArray($arr[$start+1]);\r\n\t\t\t\r\n\t\t\t//this is that speaker\r\n\t\t\t$speakerC = $speakerS[0];\r\n\t\t\t\r\n\t\t\t//this is the array for the next line, which possibly contains punctuation\r\n\t\t\t$nextS = explode(\"\t\", $arr[$start+2]);\r\n\t\t\t\r\n\t\t\t//this is the contents of that line\r\n\t\t\t$nextC = $nextS[0];\r\n\t\t\t\r\n\t\t\t//this is the POS tag for that line\r\n\t\t\t$nextZ = $nextS[1];\r\n\t\t\t\r\n\t\t\t//this will be a blank slot for punctuation\r\n\t\t\t$punc = '';\r\n\t\t\t\t\t\t\r\n\t\t\t//executes if we do not have punctuation\r\n\t\t\tif (!in_array($nextZ, $aValid)) {\r\n\t\t\t\t\r\n\t\t\t\t//we need to skip the lines that had the ending character position and the speaker's id\r\n\t\t\t\t$start += 1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//executes if we do have punctuation\r\n\t\t\telseif ($start+3 < endKey($arr)) {\r\n\t\t\t\t\r\n\t\t\t\t//this is the punctuation so far\r\n\t\t\t\t$punc = $nextC;\r\n\t\t\t\t\r\n\t\t\t\t//we need to skip the lines that had the ending character position, the speaker's id, and the punctuation\r\n\t\t\t\t$start += 2;\r\n\t\t\t\t\r\n\t\t\t\t//this is an array for the next line, which may contain more punctuation\r\n\t\t\t\t$nextW = explode ('\t', $arr[$start+1]);\r\n\t\t\t\t\r\n\t\t\t\t//this is the item for that line\r\n\t\t\t\t$nextX = $nextW[0];\r\n\t\t\t\t\r\n\t\t\t\t//this is the POS tag for that line\r\n\t\t\t\t$nextY = $nextW[1];\r\n\t\t\t\t\r\n\t\t\t\t//executes if we are indeed dealing with a second line of punctuation\r\n\t\t\t\tif (in_array($nextY, $aValid)) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//add this punctuation to the previous punctuation\r\n\t\t\t\t\t$punc = $punc.\" \".$nextX;\r\n\t\t\t\t\t\r\n\t\t\t\t\t//skip this line in the next pass\r\n\t\t\t\t\t$start += 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//this array now contains the target item, the punctuation, the starting character, the ending character, and the speaker's id\r\n\t\t\tif ($hasAp == true) { $start = $startingPoint;}\r\n\t\t\telseif ($idioma == \"English\") {$start -= $diff;}\r\n\t\t\treturn (array($tester[1], $tester[2], $punc, $startC, $endingC, $speakerC));\r\n\t\t}\r\n\t\t\r\n\t\tif ($start >= $end - 8){\r\n\t\t\t$log .= \"Error in file at around line $start in Treetagger file\\n\";\r\n\t\t\t$start = $startingPoint;\t\t\t\r\n\t\t\treturn (array(\"Error\", \"Error\", \"Error\", \"Error\", \"Error\", \"Error\"));\r\n\t\t}\r\n\t\t\r\n\t\t//increment to the next item in the array\r\n\t\t$start++;\r\n\t}\r\n}",
"protected function calculateDistance($str1,$str2){\n if((strlen($str1))>=(strlen($str2)))\n {\n $lengthOfLongerText = strlen($str1);\n }\n else {\n $lengthOfLongerText = strlen($str2);\n }\n //this while loop will count the number of differences between the characters\n $i = 0; $count = 0;\n while ($i<$lengthOfLongerText)\n {\n if ($str1[$i] != $str2[$i]){\n $count++;\n }\n $i++;\n }\n return $count;\n\n }",
"function getDiff($a, $b) {\n\t$diff = array();\n\n\t// Run the diff command, pass in -w, because change in whitespace doesn't\n\t// _really_ change the validity of our output\n\texec(\"diff -w $a $b\", $diff);\n\n\tif ( empty($diff) )\n\t\treturn false;\n\telse\n\t\treturn implode( \"\\n\", $diff);\n}",
"function diff( $old, $new, $options = false )\n {\n $fromversion = $old->attribute('version');\n $toversion = $new->attribute('version');\n $identifer = $new->attribute('contentclass_attribute_identifier');\n if($fromversion > $toversion){\n $tmp = $fromversion;\n $fromversion = $toversion;\n $toversion = $tmp;\n }\n $comparedversion = array();\n $extradetials = array();\n foreach($new->attribute('object')->attribute('versions') as $version){\n if($version->attribute('version') >= $fromversion && $version->attribute('version') <= $toversion){\n $datamap = $version->attribute('data_map');\n if(isset($datamap[$identifer])){\n $comparedversion[$version->attribute('version')] = unserialize($datamap[$identifer]->attribute('data_text'));\n $extradetials[$version->attribute('version')] = array('creator' => $version->attribute('creator'),\n 'created' => $version->attribute('created'));\n }\n }\n }\n return array( 'classcontent' => $new->attribute('contentclass_attribute')->content(),\n 'old' => $old,\n 'new' => $new,\n 'oldversion' => $old->attribute('version'),\n 'newversion' => $new->attribute('version'),\n 'versionshistory' => $comparedversion,\n 'extrainfo' => $extradetials);\n }",
"function hook_entity_diff_alter($entity_diffs, $context) {\n}",
"function segmentForDiff( $text ) {\n\t\treturn preg_replace(\n\t\t\t\"/([\\\\xc0-\\\\xff][\\\\x80-\\\\xbf]*)/e\",\n\t\t\t\"' ' .\\\"$1\\\"\", $text );\n\t}"
] | [
"0.60505545",
"0.5991801",
"0.59676665",
"0.563385",
"0.54910463",
"0.5481684",
"0.54746413",
"0.54541165",
"0.52734387",
"0.52556384",
"0.5250268",
"0.5198567",
"0.5196341",
"0.51212174",
"0.5097056",
"0.5069901",
"0.5039656",
"0.5039588",
"0.5017342",
"0.49394304",
"0.49373826",
"0.4886584",
"0.485328",
"0.4843667",
"0.48109862",
"0.4791218",
"0.47804666",
"0.47701162",
"0.47608933",
"0.47561496"
] | 0.7890931 | 0 |
Is Feed Request Returns whether or not the request is coming from a JSON or RSS Feed, allowing tags like (image:) or (video:) to react accordingly | function isFeedRequest() {
$format = pathinfo($_SERVER['REQUEST_URI'], PATHINFO_EXTENSION);
if (in_array($format, array('rss','xml','atom','json'))) {
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function http_request_is_feed($content_type, $data) {\n $pos = strpos($content_type, ';');\n if ($pos !== FALSE) {\n $content_type = substr($content_type, 0, $pos);\n }\n $content_type = strtolower($content_type);\n if (strpos($content_type, 'xml') !== FALSE) {\n return TRUE;\n }\n\n // @TODO: Sometimes the content-type can be text/html but still be a valid\n // feed.\n return FALSE;\n}",
"public function isFeedItem(): bool;",
"function simple_feed_request( $rss ) {\n\tif ( isset( $rss['feed'] ) && !isset( $rss['post_type'] ) ) {\n\t\t// Return posts of post types of your choice like 'post' and 'news'\n\t\t$rss['post_type'] = array( 'any' );\n\t}\n\treturn $rss;\n}",
"static function feed($url,$isxml=TRUE) {\n\t\t$result=json_decode(\n\t\t\tNet::http(\n\t\t\t\t'GET http://ajax.googleapis.com/ajax/services/feed/load',\n\t\t\t\thttp_build_query(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'v'=>'1.0',\n\t\t\t\t\t\t'q'=>$url,\n\t\t\t\t\t\t'num'=>'-1',\n\t\t\t\t\t\t'output'=>$isxml?'xml':'json'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\tTRUE\n\t\t);\n\t\tif (is_null($result['responseData'])) {\n\t\t\ttrigger_error($result['responseDetails']);\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn $result['responseData'][$isxml?'xmlString':'feed'];\n\t}",
"public function onRequestUrl(&$url)\n {\n // If example.com/feed, then true\n if ($url == 'feed') {\n $this->giveFeed = true;\n }\n }",
"protected function isRSS()\n {\n return isset($this->urlParams['RSS']) && strcasecmp($this->urlParams['RSS'], 'rss') == 0;\n }",
"function http_request_find_feeds($html) {\n $matches = array();\n preg_match_all(HTTP_REQUEST_PCRE_LINK_TAG, $html, $matches);\n $links = $matches[1];\n $valid_links = array();\n\n // Build up all the links information.\n foreach ($links as $link_tag) {\n $attributes = array();\n $candidate = array();\n\n preg_match_all(HTTP_REQUEST_PCRE_TAG_ATTRIBUTES, $link_tag, $attributes, PREG_SET_ORDER);\n foreach ($attributes as $attribute) {\n // Find the key value pairs, attribute[1] is key and attribute[2] is the\n // value. However, if the link tag used single quotes, the value might\n // be in attribute[3] instead.\n if (empty($attribute[2])) {\n $attribute[2] = $attribute[3];\n }\n if (!empty($attribute[1]) && !empty($attribute[2])) {\n $candidate[drupal_strtolower($attribute[1])] = drupal_strtolower(decode_entities($attribute[2]));\n }\n }\n\n // Examine candidate to see if it s a feed.\n // @TODO: could/should use http_request_is_feed ??\n if (isset($candidate['rel']) && $candidate['rel'] == 'alternate') {\n if (isset($candidate['href']) && isset($candidate['type']) && strpos($candidate['type'], 'xml') !== FALSE) {\n // All tests pass, its a valid candidate.\n $valid_links[] = $candidate['href'];\n }\n }\n }\n\n return $valid_links;\n}",
"function custom_rss_request( $args ) {\n\tif ( isset( $args['feed'] ) && ! isset( $args['post_type'] ) ) {\n\t\t$args['post_type'] = array('post', 'video', 'document');\n\t}\n\n\treturn $args;\n}",
"public function getFeed(RequestContext $request);",
"function is_feed_image($a_tag) {\n\t$image_exts = explode(',', 'png,jpg,jpeg,gif,bmp,tif,tiff,svg');\n\tforeach($image_exts as $ext) {\n\t\tif (str_endswith($a_tag->href, '.' . trim($ext), true) || str_contains($a_tag->innertext, '.' . trim($ext) . '?', false)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}",
"function myFeedFilter($query)\n{\n if ($query->is_feed)\n {\n // If a Feed do we have the post_type URL parameter (query_string)?\n if (isset($_GET['post_type']))\n {\n // Convert the post_type URL parameter to an array. Then set the query post_type value to that array\n $post_types = explode(',', $_GET['post_type']);\n //var_dump($post_types);\n $query->set('post_type', $post_types);\n }\n }\n return $query;\n}",
"public function parseFeed($content, $header='')\n {\n\n if (!$content instanceof SimpleXMLElement) {\n $content = simplexml_load_string($content);\n }\n\n if (!empty($content)) {\n unset($this->feed);\n\n if (isset($content->channel)) { // Try to parse RSS 0.91, 0.92 and 2.0\n $this->feed->items = $this->parseItemsRSS($content->channel->item);\n $this->feed->title = (String) $content->channel->title;\n $this->feed->description = (String) $content->channel->description;\n $this->feed->link = (String) $content->channel->link;\n $this->feed->updated = strtotime($content->channel->lastBuildDate);\n\n } else if (isset($content->entry)) { // Atom 1.0\n // Try to get the source of this feed\n $this->feed->link = null;\n foreach ($content->link as $key => $link) {\n if ($link->attributes()->rel != 'self') {\n $this->feed->link = $link->attributes()->href;\n break;\n }\n }\n\n $this->feed->items = $this->parseItemsAtom($content->entry);\n $this->feed->title = (String) $content->title;\n $this->feed->updated = strtotime($content->updated);\n\n } else { // Unknown format\n echo 'ERROR(Feed): This Feed is not valid or is not supported: '\n . $url . PHP_EOL;\n return false;\n }\n\n if (!empty($header)) {\n $this->feed->etag = NULL;\n if (isset($header['etag'])) {\n $this->feed->etag = $header['etag'];\n }\n if (empty($this->feed->updated)) {\n // Very difficult to happen,\n // but there are some servers that we can't get any\n // kind of \"last modified time\"\n if (empty($header['last-modified'])) {\n $this->feed->updated = time();\n } else {\n $this->feed->updated = strtotime($header['last-modified']);\n }\n }\n }\n\n return $this->feed;\n } else {\n return false;\n }\n }",
"public function testDetermineFeedType()\n {\n $this->assertTrue(false);\n }",
"public function can_create_feed() {\n\n\t\treturn $this->initialize_api();\n\n\t}",
"public function feed(Request $request) :object\n {\n $validated = $request->validate([\n 'profile' => 'required|string',\n 'take' => 'required|numeric|min:1|max:12',\n 'expiration' => 'required|numeric',\n ]);\n\n // Let's make sure the traffic comes from our own website\n if (config('statamic-instagram-user-feed.check_referer')) {\n $referer = request()->headers->get('referer');\n $startWithAppUrl = starts_with($referer, config('app.url'));\n if (empty($referer) || !$startWithAppUrl) {\n abort(404);\n }\n }\n\n return $this->instagramFeed->getFeed($validated['profile'], (int)$validated['take'], (int) $validated['expiration']);\n }",
"function feed_is_plugin_page() {\n $server_uri = \"http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}\";\n //for example I added just one of page to check - feed_index as in feed_wp_pointer_content function\n foreach (array('feed-nu') as $allowURI) {\n if(stristr($server_uri, $allowURI)) return true;\n }\n return false;\n}",
"function get_feed($feed_parameter) {\n switch($feed_parameter) {\n case 'fy':\n $feed = 'yes';\n break;\n case 'fn':\n $feed = 'no';\n break;\n default:\n $feed = 'no';\n break;\n }\n return $feed;\n }",
"public function sf_parse_request() {\n\t\tglobal $wp;\n\t\tif ( isset( $wp->query_vars[ self::FEED_PARAM ] ) ) {\n\t\t\tGenerator::get_instance()->render( isset( $_GET['version'] ) );\n\t\t}\n\t}",
"public function feed_request($q) {\n \n if (isset($q['feed']) ) {\n if(empty($q['post_type'])) $q['post_type'] = array('post');\n $q['post_type'][] = $this->Id;\n }\n return $q;\n\n }",
"function zilla_add_portfolio_to_rss( $request ) {\n if (isset($request['feed']) && !isset($request['post_type']))\n $request['post_type'] = array('post', 'portfolio');\n\n return $request;\n}",
"function is_rocket_cache_feed() {\n\t\t_deprecated_function( __FUNCTION__, '2.10' );\n\t\treturn get_rocket_option( 'cache_feed', false );\n\t}",
"public function can_create_feed() {\n\t\treturn $this->square_api_ready() && $this->has_square_card_field();\n\t}",
"public function load_feed(){\n\t\ttry {\n\t\t\t$feed = CA_Social::getFeed($this->self['id'], $this->input->get('checkpoint'), $this->input->get('public'));\n\t\t\t$this->ajaxResponse(array(\n\t\t\t\t'status' => TRUE,\n\t\t\t\t'feed' => $feed,\n\t\t\t));\n\t\t}catch(Exception $e){\n\t\t\t$this->ajaxResponse(array(\n\t\t\t\t'status' => FALSE,\n\t\t\t\t'message' => $e->getMessage(),\n\t\t\t));\n\t\t}\n\t}",
"public function process()\n {\n if (!Phpfox::isModule('socialbridge'))\n {\n return false;\n }\n \n // Additional params\n $iLimit = $this->getParam('iLimit') ? $this->getParam('iLimit') : Phpfox::getParam('feed.feed_display_limit');\n $sViewId = $this->getParam('sViewId') ? $this->getParam('sViewId') : 'all';\n $iUserId = intval($this->getParam('user_id'));\n $bIsCustomFeedView = false;\n $sCustomViewType = null;\n\n if (PHPFOX_IS_AJAX && ($iUserId = $this->getParam('profile_user_id')))\n {\n if (!defined('PHPFOX_IS_USER_PROFILE'))\n {\n define('PHPFOX_IS_USER_PROFILE', true);\n }\n $aUser = Phpfox::getService('user')->get($iUserId);\n $this->template()->assign(array('aUser' => $aUser));\n }\n\n if (PHPFOX_IS_AJAX && $this->request()->get('callback_module_id'))\n {\n $aCallback = Phpfox::callback($this->request()->get('callback_module_id') . '.getFeedDisplay', $this->request()->get('callback_item_id'));\n $this->setParam('aFeedCallback', $aCallback);\n }\n\n $aFeedCallback = $this->getParam('aFeedCallback', null);\n\n $bIsProfile = (is_numeric($iUserId) && $iUserId > 0);\n\n if ($this->request()->get('feed') && $bIsProfile)\n {\n switch ($this->request()->get('flike'))\n {\n default:\n if ($sPlugin = Phpfox_Plugin::get('feed.component_block_display_process_flike'))\n {\n eval($sPlugin);\n }\n }\n }\n\n if (defined('PHPFOX_IS_USER_PROFILE') && !Phpfox::getService('user.privacy')->hasAccess($iUserId, 'feed.view_wall'))\n {\n return false;\n }\n\n if (defined('PHPFOX_IS_PAGES_VIEW') && !Phpfox::getService('pages')->hasPerm(null, 'pages.share_updates'))\n {\n $aFeedCallback['disable_share'] = true;\n }\n\n $iFeedPage = $this->request()->get('page', 0);\n\n if ($this->request()->getInt('status-id') \n || $this->request()->getInt('comment-id') \n || $this->request()->getInt('link-id') \n || $this->request()->getInt('plink-id') //Fix TIMELINE\n || $this->request()->getInt('poke-id') \n || $this->request()->getInt('feed'))\n {\n $bIsCustomFeedView = true;\n if ($this->request()->getInt('status-id'))\n {\n $sCustomViewType = Phpfox::getPhrase('socialstream.status_update') . ': #' . $this->request()->getInt('status-id');\n }\n elseif ($this->request()->getInt('link-id'))\n {\n $sCustomViewType = Phpfox::getPhrase('socialstream.link') . ': #' . $this->request()->getInt('link-id');\n }\n elseif ($this->request()->getInt('poke-id'))\n {\n $sCustomViewType = Phpfox::getPhrase('socialstream.poke') . ': #' . $this->request()->getInt('poke-id');\n }\n elseif ($this->request()->getInt('comment-id'))\n {\n $sCustomViewType = Phpfox::getPhrase('socialstream.wall_comment') . ': #' . $this->request()->getInt('comment-id');\n\n Phpfox::getService('notification.process')->delete('feed_comment_profile', $this->request()->getInt('comment-id'), Phpfox::getUserId());\n }\n elseif ($this->request()->getInt('feed'))\n {\n $sCustomViewType = Phpfox::getPhrase('socialstream.feed');\n }\n }\n\n $iUserId = intval($this->getParam('user_id')); // fix an unknown error\n\n $aRows = Phpfox::getService('socialstream.feed')->callback($aFeedCallback)->get(($iUserId > 0 ? $iUserId : null), ($this->request()->get('feed') ? $this->request()->get('feed') : null), $iFeedPage, false, $sViewId);\n\n header('c-arows: ' . count($aRows));\n\n if (($this->request()->getInt('status-id') || $this->request()->getInt('comment-id') || $this->request()->getInt('link-id') || $this->request()->getInt('poke-id')) && isset($aRows[0]))\n {\n $aRows[0]['feed_view_comment'] = true;\n $this->setParam('aFeed', array_merge(array('feed_display' => 'view', 'total_like' => $aRows[0]['feed_total_like']), $aRows[0]));\n }\n\n (($sPlugin = Phpfox_Plugin::get('feed.component_block_display_process')) ? eval($sPlugin) : false);\n\n if ($bIsCustomFeedView && !count($aRows) && $bIsProfile)\n {\n $aUser = $this->getParam('aUser');\n\n $this->url()->send($aUser['user_name'], null, Phpfox::getPhrase('feed.the_activity_feed_you_are_looking_for_does_not_exist'));\n }\n\n $iUserid = ($bIsProfile > 0 ? $iUserId : null);\n $iTotalFeeds = (int)Phpfox::getComponentSetting(($iUserid === null ? Phpfox::getUserId() : $iUserid), 'feed.feed_display_limit_' . ($iUserid !== null ? 'profile' : 'dashboard'), $iLimit);\n\n if (!Phpfox::isMobile())\n {\n $this->template()->assign(array('sHeader' => ''));\n }\n\n $iCurUserId = Phpfox::getUserId();\n $sView = $bIsProfile ? \"profile\" : \"index\";\n\n $oUser = Phpfox::getService('user');\n $aUser = $oUser->get($iUserId);\n //Fix for egift module\n if (isset($aUser['birthday']))\n {\n $aUser['birthday_time_stamp'] = $aUser['birthday'];\n $aUser['birthday'] = $oUser->age($aUser['birthday']);\n $aUser['is_user_birthday'] = ((empty($aUser['birthday_time_stamp']) ? false : (int)floor(Phpfox::getLib('date')->daysToDate($aUser['birthday_time_stamp'], null, false)) === 0 ? true : false));\n }\n $this->setParam('aUser', $aUser);\n\n $iWallOwnerId = !empty($aUser['user_id']) ? $aUser['user_id'] : $iCurUserId;\n \n $this->template()->assign(array(\n 'sView' => $sView,\n 'iWallOwnerId' => $iWallOwnerId,\n 'iCurUserId' => $iCurUserId\n ));\n \n $aRows = Phpfox::getService('socialstream.feed')->fillVisibility($aRows, $iCurUserId, $sView, $iWallOwnerId);\n $aRows = Phpfox::getService('socialstream.feed')->displayLinks($aRows);\n\n if (Phpfox::getService('socialbridge')->timeline())\n {\n $this->template()->assign(array('aFeedTimeline' => Phpfox::getService('socialstream.feed')->getTimeline(), 'sLastDayInfo' => Phpfox::getService('socialstream.feed')->getLastDay()));\n\n if (!PHPFOX_IS_AJAX)\n {\n $aUser = $this->getParam('aUser');\n\n $aTimeline = Phpfox::getService('socialstream.feed')->getTimeLineYears($aUser['user_id'], $aUser['birthday_search']);\n\n $this->template()->assign(array('aTimelineDates' => $aTimeline));\n }\n }\n \n $this->template()->assign(array(\n 'iUserId' => $iUserId,\n 'aFeeds' => $aRows,\n 'iFeedNextPage' => ($iFeedPage + 1),\n 'iFeedCurrentPage' => $iFeedPage,\n 'iTotalFeedPages' => 1,\n 'aFeedVals' => $this->request()->getArray('val'),\n 'sCustomViewType' => $sCustomViewType,\n 'aFeedStatusLinks' => Phpfox::getService('feed')->getShareLinks(),\n 'aFeedCallback' => $aFeedCallback,\n 'bIsCustomFeedView' => $bIsCustomFeedView,\n 'sTimelineYear' => $this->request()->get('year'),\n 'sTimelineMonth' => $this->request()->get('month'),\n 'sFeedType' => 'normal'\n ));\n\n //Fix for timeline\n if ($iFeedPage == 0)\n {\n Phpfox::getLib('request')->set('resettimeline', true);\n }\n\n if ($bIsProfile && Phpfox::getService('socialbridge')->timeline())\n {\n if (!Phpfox::getService('user.privacy')->hasAccess($iUserId, 'feed.display_on_profile'))\n {\n return false;\n }\n }\n\n return 'block';\n }",
"private function isValidPodcastFeed() {\n /* Preconditions:\n\t * - $this->podcastFileContents has trused XML in it\n\t *\n\t * Postconditions:\n\t * - Return TRUE if we can probably process this feed\n\t * - Throw exception if we cannot process this feed\n\t */\n\n\t\t# Test for valid, digestable XML\n\t\t$this->podcastXML = $this->isValidXML();\n\t\tif ($this->podcastXML === FALSE) {\n\t\t\t// If this is not XML, let's not bother going further\n\t\t\tthrow new Exception('The document at \"' . $this->podcastURL . '\" is not valid XML');\n\t\t}\n\t\t// Note, now podcastXML now contains a SimpleXML object of the raw file.\n\t\t\n\t\t# Test for Channel Tag\n\t\tif (isset($this->podcastXML->channel) === FALSE) {\n\t\t\tthrow new Exception('The document at \"' . $this->podcastURL . '\" does not contain a <channel> tag where appropriate. \n\t\t\t\tAs a result, this does not appear to be a podcast feed.'); \n\t\t}\n\t\t\n\t\t# Test for Enclosure Tag(s)\n\t\t$counter = 0;\n\t\t$foundEnclosure = FALSE;\n\t\t\n\t\t# Let's go ahead and store the number of podcast items now since this is a frequently used value\n\t\t$this->totalFeedItems = count($this->podcastXML->channel[0]->item);\n\t\t\n\t\t# Loop through all podcast items\n\t\twhile (($counter < $this->totalFeedItems) AND ($foundEnclosure === FALSE)) {\n\t\t\tif (isset($this->podcastXML->channel[0]->item[$counter]->enclosure['url'])) {\n\t\t\t\t# Ensure we have enough data in the enclosure tag for processing\n\t\t\t\t$foundEnclosure = TRUE;\n\t\t\t}\n\t\t\t\n\t\t\t// Loop through all items in the feed as needed. Ideally, this loop is only executed once.\n\t\t\t$counter++;\n\t\t}\n\t\t\n\t\tif ($foundEnclosure === FALSE) {\n\t\t\tthrow new Exception('The document at \"' . $this->podcastURL . '\" does not contain any appropriate englosure tags where appropriate. \n\t\t\t\tAs a result, this does not appear to be a podcast feed.'); \t\t\t\n\t\t}\n\t\t\n\t\treturn TRUE;\n }",
"public abstract function loadFeed($data);",
"function filer(){\n\t\tif(empty($this->feeds)){\n\t\t $this->status = \"No feeds selected\";\n\t\t $this->retval = false;\n\t\t\treturn false;\n\t\t}\n\t\tif($this->ctype == 'text'){\n\t\t\t//Awsome, this is easy to handle!\n \n //Let's filter out any html/script injection.\n $this->content_o = htmlspecialchars($this->content_i);\n $this->name = htmlspecialchars($this->name);\n\n $this->mime_type = 'text/plain';\n\t\t\t$this->type_id = 2; //SELF: THIS IS BAD AND DUMB AND STUPID\n\t\t\t$content = new Content(); \n\t\t\tif($content->create_content($this->name, $this->user_id, $this->content_o, $this->mime_type, $this->type_id, $this->start_date, $this->end_date, null)){\n\n\t\t\t\t$this->cid = $content->id;\n\t\t\t\t\n\t\t\t\t$this->submit_tofeeds();\n\t\t\t\t\n\t\t\t\t$this->status = \"\";\n\t\t\t\t$this->retval = true;\n\t\t\t\treturn true; //The content is finished uploading\n\t\t\t} else {\n\t\t\t\t$this->retval = false;\n\t\t\t\t$this->status = $this->status . 'Content Failed: ' . $content->status;\n\t\t\t\treturn false; //Failure making a content isn't a good thing\n\t\t\t}\n\t\t\n\t\t} elseif($this->ctype == 'weather'){\n\t\t\t//Awsome, this is easy to handle as well\n\t\t\t$this->content_o = $this->content_i;\n\t\t\t$this->mime_type = 'text/html';\n\t\t\t$this->type_id = 5; //SELF: THIS IS BAD AND DUMB AND STUPID\n\t\t\t$content = new Content();\n\t\t\tif($content->create_content($this->name, $this->user_id, $this->content_o, $this->mime_type, $this->type_id, $this->start_date, $this->end_date, null)){\n\n\t\t\t\t$this->cid = $content->id;\n\t\t\t\t\n\t\t\t\t$this->submit_tofeeds();\n\t\t\t\t\n\t\t\t\t$this->status = \"\";\n\t\t\t\t$this->retval = true;\n\t\t\t\treturn true; //The content is finished uploading\n\t\t\t} else {\n\t\t\t\t$this->retval = false;\n\t\t\t\t$this->status = $this->status . $content->status;\n\t\t\t\treturn false; //Failure making a content isn't a good thing\n\t\t\t}\n\t\t}elseif($this->ctype == 'rss'){\n\t\t\t//Awsome, this is easy to handle as well\n\t\t\t$this->content_o = $this->content_i;\n\t\t\t$this->mime_type = 'text/html';\n\t\t\t$this->type_id = 6; //SELF: THIS IS BAD AND DUMB AND STUPID\n\t\t\t$content = new Content();\n\t\t\tif($content->create_content($this->name, $this->user_id, $this->content_o, $this->mime_type, $this->type_id, $this->start_date, $this->end_date, null)){\n\n\t\t\t\t$this->cid = $content->id;\n\t\t\t\t\n\t\t\t\t$this->submit_tofeeds();\n\t\t\t\t\n\t\t\t\t$this->status = \"\";\n\t\t\t\t$this->retval = true;\n\t\t\t\treturn true; //The content is finished uploading\n\t\t\t} else {\n\t\t\t\t$this->retval = false;\n\t\t\t\t$this->status = $this->status . $content->status;\n\t\t\t\treturn false; //Failure making a content isn't a good thing\n\t\t\t}\n\t\t}elseif($this->ctype == 'rico'){\n\t\t\t//Awsome, this is easy to handle as well\n\t\t\t$this->content_o = $this->content_i;\n\t\t\t$this->mime_type = 'text/html';\n\t\t\t$this->type_id = 8; //SELF: THIS IS BAD AND DUMB AND STUPID\n\t\t\t$content = new Content();\n\t\t\tif($content->create_content($this->name, $this->user_id, $this->content_o, $this->mime_type, $this->type_id, $this->start_date, $this->end_date, null)){\n\n\t\t\t\t$this->cid = $content->id;\n\t\t\t\t\n\t\t\t\t$this->submit_tofeeds();\n\t\t\t\t\n\t\t\t\t$this->status = \"\";\n\t\t\t\t$this->retval = true;\n\t\t\t\treturn true; //The content is finished uploading\n\t\t\t} else {\n\t\t\t\t$this->retval = false;\n\t\t\t\t$this->status = $this->status . $content->status;\n\t\t\t\treturn false; //Failure making a content isn't a good thing\n\t\t\t}\n\t\t}elseif($this->ctype == 'dynamic'){\n\t\t\t//Awsome, this is equi easy to handle as well\n\t\t\t$this->content_o = $this->content_i;\n\t\t\t$this->mime_type = 'text/html';\n\t\t\t$this->type_id = 4; //SELF: THIS IS BAD AND DUMB AND STUPID\n\t\t\t$content = new Content();\n\t\t\tif($content->create_content($this->name, $this->user_id, $this->content_o, $this->mime_type, $this->type_id, $this->start_date, $this->end_date, null)){\n\n\t\t\t\t$this->cid = $content->id;\n\t\t\t\t\n\t\t\t\t$this->submit_tofeeds();\n\t\t\t\t\n\t\t\t\t$this->status = \"\";\n\t\t\t\t$this->retval = true;\n\t\t\t\treturn true; //The content is finished uploading\n\t\t\t} else {\n\t\t\t\t$this->retval = false;\n\t\t\t\t$this->status = $this->status . $content->status;\n\t\t\t\treturn false; //Failure making a content isn't a good thing\n\t\t\t}\n\t\t} elseif($this->ctype == 'file'){\n\t\t\t//echo \"Identified a file upload\";\n\t\t\tif($this->content_i['error'] == 0 && is_uploaded_file($this->content_i['tmp_name'])){\n\t\t\t\t$pre_type = $this->typer();\n\t\t\t\t\n\t\t\t\t//echo \"Type: $pre_type \";\n\t\t\t\tif($pre_type == \"image/jpeg\" || $pre_type == \"image/pjpeg\" || $pre_type == \"image/jpg\"){\n\t\t\t\t\t//echo \"Bananas\";\n\t\t\t\t\t$this->jpeg_cleaner();\n\t\t\t\t} elseif ($pre_type == \"image/png\" || $pre_type == \"image/x-png\"){ //Wierd IE sends x-png\n\t\t\t\t\t$this->png_cleaner();\n\t\t\t\t} elseif ($pre_type == \"image/gif\"){\n\t\t\t\t\t$this->gif_cleaner();\n\t\t\t\t} elseif ($pre_type == \"application/vnd.ms-powerpoint\"){\n\t\t\t\t\t$this->ppt_cleaner();\n\t\t\t\t} elseif ($pre_type == \"application/pdf\"){\n\t\t\t\t\t$this->pdf_cleaner(); \n\t\t\t\t} else {\n\t\t\t\t\tunlink($this->content_i['tmp_name']); //Delete it since its def a virus duh!\n\t\t\t\t\t$this->status = $this->status .\"We could not recognize the type of file you submitted. \";\n\t\t\t\t\t$this->retval = false;\n\t\t\t\t\treturn false; //Unknown filetype\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->retval = false;\n\t\t\t\t$this->status = \"Error receiving your file. Please contact an administrator if this error repeats. \";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}elseif($this->ctype == 'banner'){\n\t\t\t//echo \"Identified a file upload\";\n\t\t\tif($this->content_i['error'] == 0 && is_uploaded_file($this->content_i['tmp_name'])){\n\t\t\t\t$pre_type = $this->typer();\n\t\t\t\t\n\t\t\t\t//echo \"Type: $pre_type \";\n\t\t\t\tif($pre_type == \"image/jpeg\" || $pre_type == \"image/pjpeg\" || $pre_type == \"image/jpg\"){\n\t\t\t\t\t//echo \"Bananas\";\n\t\t\t\t\t$this->jpeg_cleaner_banner();\n\t\t\t\t} elseif ($pre_type == \"image/png\" || $pre_type == \"image/x-png\"){ //Wierd IE sends x-png\n\t\t\t\t\t$this->png_cleaner_banner();\n\t\t\t\t} elseif ($pre_type == \"image/gif\"){\n\t\t\t\t\t$this->gif_cleaner_banner();\n\t\t\t\t}else {\n\t\t\t\t\tunlink($this->content_i['tmp_name']); //Delete it since its def a virus duh!\n\t\t\t\t\t$this->status = $this->status .\"We could not recognize the type of file you submitted. \";\n\t\t\t\t\t$this->retval = false;\n\t\t\t\t\treturn false; //Unknown filetype\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->retval = false;\n\t\t\t\t$this->status = \"Error receiving your file. Please contact an administrator if this error repeats. \";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else {\n\t\t\t$this->status = $this->status . \"We could not recognize the uploader used. \";\n\t\t\t//Unknown ctype == bad\n\t\t\t$this->retval = false;\n\t\t\treturn false;\n\t\t}\n\t}",
"protected function isApplicable(Request $request)\n {\n return $request->isXmlHttpRequest() || strpos($request->headers->get('Content-Type'), 'application/json') === 0;\n }",
"function isValidFeed($value, $empty, &$params, &$formvars) {\n\n if (empty($formvars['url'])) return false;\n $feed = $this->rss->fetchRSS($formvars['url']);\n if (!isset($feed['items_count']) || $feed['items_count'] < 1) return false;\n return true;\n\n }",
"public function can_create_feed() {\n\n\t\treturn $this->has_valid_account_id();\n\n\t}"
] | [
"0.7465508",
"0.69234115",
"0.63745767",
"0.6199973",
"0.6167737",
"0.61520046",
"0.607401",
"0.59591866",
"0.5957458",
"0.5799835",
"0.57776046",
"0.57483804",
"0.5723148",
"0.570801",
"0.56306064",
"0.5598466",
"0.5554141",
"0.5517714",
"0.5500888",
"0.5497145",
"0.54782075",
"0.5476939",
"0.54341274",
"0.5423696",
"0.54153806",
"0.5374295",
"0.5348557",
"0.5310501",
"0.5255307",
"0.5241845"
] | 0.7896813 | 0 |
/ User color returns the user's color if set | function userColor($username) {
if (site()->user($username)->color() != "") {
return (string)site()->user($username)->color();
} else {
return (string)site()->coloroptions()->split(',')[0];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getColor($username);",
"function fontColor()\n{\n\t\n\tglobal $spojeni, $db;\n\t$query = mysql_query(\"SELECT * FROM `$db`.`user` WHERE `user`.`id` = '\".user().\"'\", $spojeni);\n\tif (mysql_num_rows($query) != 0){\n\t\t$d = mysql_fetch_array($query);\n\t\tif(empty($d[\"font_color\"])) return \"black\";\n\t\telse return $d[\"font_color\"];\n\t}\n\telse return \"black\";\n}",
"function slate_pro_get_user_admin_color() {\n\t$user_id = get_current_user_id();\n\t$user_info = get_userdata( $user_id );\n\tif ( ! ( $user_info instanceof WP_User ) ) {\n\t\treturn;\n\t}\n\t$user_admin_color = $user_info->admin_color;\n\n\treturn $user_admin_color;\n}",
"public function getColor();",
"public\tfunction\tgetColor()\t{\n\t\t\t\t\t\t\t\t\t\t\t\treturn\t$this->color;\n\t\t\t\t\t\t\t\t}",
"public function getColor(){\n //this es en esta clase\n return $this->color;\n }",
"public function getColor(){\n //this es en esta clase\n return $this->color;\n }",
"public function getColor(){\n\t\t//Busca en esta clase la propiedad x\n\t\treturn $this->color;\n\t}",
"public function getColor() {\n\t\treturn $this->_dataHelper->getSomeColor();\n\t}",
"public function getDefaultColor();",
"function gogreen_get_color(){\n return gogreen_get_color_scheme();\n}",
"function get_color() {\n return $this->get_mapped_property('color');\n }",
"public function getColor()\n\t{\n return $this->color;\n }",
"public function getColor(){\n return $this->$color;\n }",
"abstract protected function getColor();",
"function getColor($color) {\t \r\n\t\treturn $this->colors[$color]; \r\n\t}",
"public function getColor(): string\n {\n return $this->color;\n }",
"function get_color( $color = null ) {\n\treturn $color ? 'bg-' . $color : 'bg-None';\n}",
"public function getColor()\r\n {\r\n return $this->color;\r\n }",
"function Color($color = 0){\n if($this -> handle == false) return false;\n if($this -> pcp_color != true) return false;\n \n switch($color){\n case 1:\n $select = kbyte(49);\n break;\n \n default:\n $select = kbyte(48);\n }\n \n return $this -> Append(kbyte(27) . \"r\" . $select);\n }",
"public function getColor ()\r\n {\r\n return $this->color;\r\n }",
"function getColor() {\n\t\treturn $this->color;\n\t}",
"public function getColor()\n {\n return $this->color;\n }",
"function getColor()\n {\n return $this->readColor();\n }",
"public function getColor(){\n return $this->color;\n }",
"public function hasColor()\n {\n return ($this->color != '') ? true : false;\n }",
"public function getColorValue ($color) {}",
"public function getColor()\n\t{\n\t\treturn $this->color;\n\t}",
"public function getColor()\n {\n return $this->color;\n }",
"public function getColor()\n {\n return $this->color;\n }"
] | [
"0.7382533",
"0.7228216",
"0.72094935",
"0.70387214",
"0.6926088",
"0.6755032",
"0.6755032",
"0.6754805",
"0.6703463",
"0.6698707",
"0.6696398",
"0.6675258",
"0.6669774",
"0.6668237",
"0.66618997",
"0.66606885",
"0.6657503",
"0.66428393",
"0.6641219",
"0.66402024",
"0.6631336",
"0.6625014",
"0.66156644",
"0.6604465",
"0.66030806",
"0.658663",
"0.65846276",
"0.6583989",
"0.655162",
"0.655162"
] | 0.80321825 | 0 |
/ Remote Image Downloader stores a remote image locally and returns the image's URL cannot return the image object because an error occurs, the image is not readable yet | function downloadedImageURL($filename, $pageuri, $remoteURL) {
$page = site()->page($pageuri);
// If the image doesn't already exist, then it must be downloaded
//if (!$page->image($filename . '.jpg')) {
if (!$page->images()->findBy('name', $filename)) {
if ($remoteURL == 'youtube') {
$youtubeid = substr(strstr($filename, '-'), 1);
$remoteURL = youtube_image($youtubeid);
}
if ($remoteURL == 'vimeo') {
$vimeoid = substr(strstr($filename, '-'), 1);
$vimeothumburl = "https://vimeo.com/api/v2/video/" . $vimeoid . ".php";
$hash = unserialize(@file_get_contents($vimeothumburl));
$vimeothumb = $hash[0]['thumbnail_large'];
$remoteURL = $vimeothumb;
}
$extension = pathinfo($remoteURL, PATHINFO_EXTENSION);
// strip any query parameters and lowercase
$extension = strtolower(strtok($extension, '?'));
// lowercase
$imagepath = kirby()->roots()->content() . '/' . $page->diruri() . '/' . $filename . '.' . $extension;
$response_code = get_http_response_code($remoteURL);
if ($response_code == 200) {
copy($remoteURL, $imagepath);
} else {
$imageURL = 'null';
}
/*
if (get_headers($remoteURL)[0] == 'HTTP/1.0 200 OK') {
copy($remoteURL, $imagepath);
} elseif (get_headers($remoteURL)[0] == 'HTTP/1.0 200 OK') {
copy($remoteURL, $imagepath);
} else {
$imageURL = 'null';
}
*/
} else {
$extension = $page->images()->findBy('name', $filename)->extension();
}
if (!isset($imageURL)) {
$imageURL = $page->contentURL() . '/' . $filename . '.' . $extension;
}
return $imageURL;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function download_image() {\n $image_resource = file_get_contents($this->image_src);\n $basename = basename($this->image_src);\n if (!stripos($basename, '.' . $this->file_extension)) {\n $basename .= '.' . $this->file_extension;\n }\n $image_location = dirname($this->cached_image_directory) . '/' . $basename;\n if (!file_exists($image_location)) {\n if (!file_put_contents($image_location, $image_resource)) {\n $this->error('Could not download the remote image');\n }\n }\n $this->image_src = $image_location;\n }",
"public function image_url()\r\n {\r\n if (! $this->image)\r\n return;\r\n\r\n return Storage::url($this->image);\r\n }",
"public function getImage()\n {\n $image = $this->image();\n $this->image = $image->url();\n return $this->image;\n }",
"private function fetchImage($url)\n {\n // fetching images require logged in state\n if (!$this->logged_in) {\n $this->login();\n }\n\n if (function_exists('sys_get_temp_dir') && is_writable(sys_get_temp_dir()) &&\n ($tmpFile = tempnam(sys_get_temp_dir(), 'img_'))) {\n /* We have opened a tmpfile */\n } else {\n throw new Exception('Unable to fetch the image to make it attachable, sys_temp_dir is not writable');\n }\n\n $this->getUrl($url, ['sink' => $tmpFile]);\n\n return $tmpFile;\n }",
"public function getImageUrl();",
"public function getImageUrl()\r\n {\r\n return $this->_image_url;\r\n }",
"public function fetchImage($url = null) {\n $filePath = WWW_ROOT . \"files/temp\";\n\n if (!is_dir($filePath)) {\n //mkdir($filePath, 0777, true);\n }\n\n if ($url == null) {\n return false;\n }\n $ext = self::getFileExtension($url);\n //$ext = pathinfo($url, PATHINFO_EXTENSION);\n $name = self::generateRandomValue(40);\n $name = $name . '.' . $ext;\n\n if (null != $name) {\n\n $fileUrl = $url;\n\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => $fileUrl,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_CONNECTTIMEOUT => 0,\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_SSL_VERIFYHOST => 0,\n CURLOPT_FOLLOWLOCATION => 1,\n CURLOPT_REFERER => 'http://www.google.com',\n CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13'\n ));\n\n $resp = curl_exec($curl);\n\n if (!curl_errno($curl)) {\n $info = curl_getinfo($curl);\n if ($info['http_code'] == '200') {\n $filePath = $filePath . '/' . $name;\n file_put_contents($filePath, $resp);\n }\n }\n curl_close($curl);\n }\n return $name;\n }",
"public function getImageUrl()\n\t{\n\t\treturn $this->image_url;\n\t}",
"public function get_url()\n {\n return $this->imageUrl;\n }",
"public function getUrlImage()\n {\n return $this->urlImage;\n }",
"public function grab_image($url,$email){\n$saveto=$this->userFolder($email).\"/media/\";\n \n $ch = curl_init ($url);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);\n $raw=curl_exec($ch);\n curl_close ($ch);\n if(file_exists($saveto)){\n unlink($saveto);\n }\n $fp = fopen($saveto,'x');\n fwrite($fp, $raw);\n fclose($fp);\n}",
"private function fetch_image() {\n $image_size = getimagesize($this->image_src);\n $image_width = $image_size[0];\n $image_height = $image_size[1];\n $mime_array = explode('/', $this->file_mime_type);\n $file_mime_as_ext = end($mime_array);\n $image_dest_func = 'imagecreate';\n if ($this->gd_version >= 2)\n $image_dest_func = 'imagecreatetruecolor';\n if (in_array($file_mime_as_ext, array('gif', 'jpeg', 'png'))) {\n $image_src_func = 'imagecreatefrom' . $this->file_extension;\n $image_create_func = 'image' . $this->file_extension;\n } else {\n $this->error('The image you supply must have a .gif, .jpg/.jpeg, or .png extension.');\n return false;\n }\n $this->increase_memory_limit();\n $image_src = @call_user_func($image_src_func, $this->image_src);\n $image_dest = @call_user_func($image_dest_func, $image_width, $image_height);\n if ($file_mime_as_ext === 'jpeg') {\n $background = imagecolorallocate($image_dest, 255, 255, 255);\n imagefill($image_dest, 0, 0, $background);\n } elseif (in_array($file_mime_as_ext, array('gif', 'png'))) {\n imagealphablending($image_src, false);\n imagesavealpha($image_src, true);\n imagealphablending($image_dest, false);\n imagesavealpha($image_dest, true);\n }\n imagecopy($image_dest, $image_src, 0, 0, 0, 0, $image_width, $image_height);\n switch ($file_mime_as_ext) {\n case 'jpeg':\n $created = imagejpeg($image_dest, $this->cached_filename, $this->quality->jpeg);\n break;\n case 'png':\n $created = imagepng($image_dest, $this->cached_filename, $this->quality->png);\n break;\n case 'gif':\n $created = imagegif($image_dest, $this->cached_filename);\n break;\n default:\n return false;\n break;\n }\n imagedestroy($image_src);\n imagedestroy($image_dest);\n $this->reset_memory_limit();\n return $created;\n }",
"public function getImageURL() {\r\n\t\treturn $this->getProperty(\"image_url\");\r\n\t}",
"public function getCoverPhotoRemoteUrl(): string;",
"public function getImageUrl(){\n return Url::to($this->detailDir.$this->pic); \n }",
"function cache_image($image_url){\n\t\t$image_path = '../propic/cache/';\n\t\t//get the name of the file\n\t\t$exploded_image_url = explode(\"/\",$image_url);\n\t\t$image_filename = trim(end($exploded_image_url));\n\t\t$exploded_image_filename = explode(\".\",$image_filename);\n\t\t$extension = end($exploded_image_filename);\n\t\t//make sure its an image\n\t\tif($extension==\"gif\"||$extension==\"jpg\"||$extension==\"jpeg\"||$extension==\"png\"){\n\t\t\t//get the remote image\n\t\t\t$image_to_fetch = file_get_contents($image_url);\n\t\t\t//save it\n\t\t\t$local_image_file = fopen($image_path.$image_filename, 'w+');\n\t\t\tchmod($image_path.$image_filename,0755);\n\t\t\tfwrite($local_image_file, $image_to_fetch);\n\t\t\tfclose($local_image_file);\necho \"yes\";\t\n\t\t}\n\t}",
"public function getImage () {}",
"abstract public function imageUrl(): string;",
"public function testSuccessDownloadFromUrl()\n {\n $localPath = $this->imageCachingManager->downloadFromUrl(self::IMAGE_URL, self::RECORD_ID);\n\n // Correct path should be returned\n $this->assertEquals('/var/www/project/public/cache/1/funny-games-1997-1S-KA-to-KP4.jpg', $localPath);\n // Error property should be empty\n $this->assertEquals(true, empty($this->imageCachingManager->getErrorMessage()));\n }",
"public function getLiveCoverPhotoRemoteUrl(): string;",
"function downloadImage($strUrl,$cutPrefix=null,$cache=true)\n{\n $curl = new Curl();\n $url_info = parse_url($strUrl);\n @mkdir('/tmp/' . date('Ymd'));\n $filename = '/tmp/'.date('Ymd').'/'.md5($url_info['path']).(is_array($cutPrefix)?'_'.join('_',$cutPrefix):'').'.jpg';\n if($cache && file_exists($filename)){//get cache\n }else{\n $filename = $curl->download($strUrl, $filename);\n if($filename && $cutPrefix){\n //do cut\n cutImage($filename, $cutPrefix);\n }\n }\n if(!file_exists($filename)){\n throw new Exception('can not download image '.$strUrl.' to '.$filename);\n }\n return $filename;\n}",
"public function getImageUrl()\n {\n return $this->_imageUrl;\n }",
"private function _fetch_remote_file( $url, $post ) {\n\t\t\t$file_name = basename( $url );\n\n\t\t\t$local_file = trailingslashit( get_template_directory() ) . 'envato_setup/images/' . $file_name;\n\t\t\t\n\t\t\t$upload = false;\n\t\t\tif ( is_file( $local_file ) && filesize( $local_file ) > 0 ) {\n\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/file.php' );\n\t\t\t\tWP_Filesystem();\n\t\t\t\tglobal $wp_filesystem;\n\t\t\t\t$file_data = $wp_filesystem->get_contents( $local_file );\n\t\t\t\t$upload = wp_upload_bits( $file_name, 0, $file_data, $post['upload_date'] );\n\t\t\t\tif ( $upload['error'] ) {\n\t\t\t\t\treturn new WP_Error( 'upload_dir_error', $upload['error'] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! $upload || $upload['error'] ) {\n\t\t\t\t// get placeholder file in the upload dir with a unique, sanitized filename\n\t\t\t\t$upload = wp_upload_bits( $file_name, 0, '', $post['upload_date'] );\n\t\t\t\tif ( $upload['error'] ) {\n\t\t\t\t\treturn new WP_Error( 'upload_dir_error', $upload['error'] );\n\t\t\t\t}\n\n\t\t\t\t// fetch the remote url and write it to the placeholder file\n\t\t\t\t//$headers = wp_get_http( $url, $upload['file'] );\n\n\t\t\t\t$max_size = (int) apply_filters( 'import_attachment_size_limit', 0 );\n\n\t\t\t\t// we check if this file is uploaded locally in the source folder.\n\t\t\t\t$response = wp_remote_get( $url );\n\t\t\t\tif ( is_array( $response ) && ! empty( $response['body'] ) && $response['response']['code'] == '200' ) {\n\t\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/file.php' );\n\t\t\t\t\t$headers = $response['headers'];\n\t\t\t\t\tWP_Filesystem();\n\t\t\t\t\tglobal $wp_filesystem;\n\t\t\t\t\t$wp_filesystem->put_contents( $upload['file'], $response['body'] );\n\t\t\t\t\t//\n\t\t\t\t} else {\n\t\t\t\t\t// required to download file failed.\n\t\t\t\t\t/*$upload = false;*/\n\t\t\t\t\t@unlink( $upload['file'] );\n\n\t\t\t\t\treturn new WP_Error( 'import_file_error', esc_html__( 'Remote server did not respond','listeo' ) );\n\t\t\t\t}\n\n\t\t\t\t$filesize = filesize( $upload['file'] );\n\n\t\t\t\tif ( isset( $headers['content-length'] ) && $filesize != $headers['content-length'] ) {\n\t\t\t\t\t@unlink( $upload['file'] );\n\n\t\t\t\t\treturn new WP_Error( 'import_file_error', esc_html__( 'Remote file is incorrect size','listeo' ) );\n\t\t\t\t}\n\n\t\t\t\tif ( 0 == $filesize ) {\n\t\t\t\t\t@unlink( $upload['file'] );\n\n\t\t\t\t\treturn new WP_Error( 'import_file_error', esc_html__( 'Zero size file downloaded','listeo' ) );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $max_size ) && $filesize > $max_size ) {\n\t\t\t\t\t@unlink( $upload['file'] );\n\n\t\t\t\t\treturn new WP_Error( 'import_file_error', sprintf( esc_html__( 'Remote file is too large, limit is %s','listeo' ), size_format( $max_size ) ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// keep track of the old and new urls so we can substitute them later\n\t\t\t$this->_imported_post_id( $url, $upload['url'] );\n\t\t\t$this->_imported_post_id( $post['guid'], $upload['url'] );\n\t\t\t// keep track of the destination if the remote url is redirected somewhere else\n\t\t\tif ( isset( $headers['x-final-location'] ) && $headers['x-final-location'] != $url ) {\n\t\t\t\t$this->_imported_post_id( $headers['x-final-location'], $upload['url'] );\n\t\t\t}\n\n\t\t\treturn $upload;\n\t\t}",
"private function check_image($img) {\n if (remote_file_exists($img, 1)) {\n return $img;\n } else {\n return \"\";\n }\n }",
"public function getImageUrl()\n {\n return $this->imageUrl;\n }",
"public function getImageUrl()\n {\n $uploads = Yii::getAlias('@albumes');\n $imagen = glob($uploads . \"/$this->id.*\");\n $s3 = Yii::$app->get('s3');\n\n if (count($imagen) != 0) {\n $ruta = $imagen[0];\n } else {\n $ruta = $uploads . \"/$this->id.jpg\";\n if (!$s3->exist($ruta)) {\n $ruta = $uploads . \"/$this->id.png\";\n }\n }\n\n if (file_exists($ruta)) {\n return \"/$ruta\";\n } elseif ($s3->exist($ruta)) {\n $s3->commands()->get($ruta)->saveAs($ruta)->execute();\n return \"/$ruta\";\n } else {\n return \"/$uploads/disco.png\";\n }\n }",
"private function _getPathsForUrl($image)\n {\n $urlParts = parse_url($image);\n $pathParts = pathinfo($urlParts['path']);\n $hashRemoteUrl = craft()->imager->getSetting('hashRemoteUrl');\n\n if ($hashRemoteUrl) {\n if (is_string($hashRemoteUrl) && $hashRemoteUrl == 'host') {\n $parsedDirname = substr(md5($urlParts['host']), 0, 10) . $pathParts['dirname'];\n } else {\n $parsedDirname = md5($urlParts['host'] . $pathParts['dirname']);\n }\n } else {\n $parsedDirname = str_replace('.', '_', $urlParts['host']) . $pathParts['dirname'];\n }\n\n $this->sourcePath = craft()->path->getRuntimePath() . 'imager/' . $parsedDirname . '/';\n $this->targetPath = craft()->imager->getSetting('imagerSystemPath') . $parsedDirname . '/';\n $this->targetUrl = craft()->imager->getSetting('imagerUrl') . $parsedDirname . '/';\n $this->sourceFilename = $this->targetFilename = $pathParts['basename'];\n\n // check if the temp path for remote files exists or can be created.\n if (!IOHelper::getRealPath($this->sourcePath)) {\n IOHelper::createFolder($this->sourcePath, craft()->config->get('defaultFolderPermissions'), true);\n\n if (!IOHelper::getRealPath($this->sourcePath)) {\n throw new Exception(Craft::t('Temp folder “{sourcePath}” does not exist and could not be created',\n array('sourcePath' => $this->sourcePath)));\n }\n }\n\n // check if the file is already downloaded\n if (!IOHelper::fileExists($this->sourcePath . $this->sourceFilename) || (IOHelper::getLastTimeModified($this->sourcePath . $this->sourceFilename)->format('U') + craft()->imager->getSetting('cacheDurationRemoteFiles') < time())) {\n @file_put_contents($this->sourcePath . $this->sourceFilename, fopen($image, 'r'));\n\n if (!IOHelper::fileExists($this->sourcePath . $this->sourceFilename)) {\n throw new Exception(Craft::t('File could not be downloaded and saved to “{sourcePath}”',\n array('sourcePath' => $this->sourcePath)));\n }\n }\n }",
"public function getImageURL()\n\t{\n\t\t$path = Config::get('dream.paths.vote');\n\t\treturn url(\"{$path}/{$this->image}\");\n\t}",
"function request_image($url) {\n $max_size = 1024 * 1024 * 3;\n $promote_tmp_dir = \"/tmp/jnm-promote\";\n if (!is_dir($promote_tmp_dir)) {\n mkdir($promote_tmp_dir, 755);\n }\n $file = $promote_tmp_dir.\"/\".md5($url);\n\n $fh = fopen($file, \"wb\");\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_HEADER, 0);\n curl_setopt($curl, CURLOPT_FILE, $fh);\n curl_setopt($curl, CURLOPT_PROGRESSFUNCTION, function($dl_size, $dl_progress, $ul_size, $ul_progress) {\n return ($dl_progress > $max_size);\n });\n $status = curl_exec($curl);\n curl_close($curl);\n fclose($fh);\n\n /* twitter does not let us post images larger than 3MB */\n if ($status === false || filesize($file) > $max_size) {\n return false;\n }\n\n $finfo = new finfo(FILEINFO_MIME_TYPE);\n $mimetype = $finfo->file($file);\n\n if (!in_array($mimetype, ['image/jpeg', 'image/png', 'image/gif'])) {\n return false;\n }\n\n return $file;\n}",
"public function save()\n {\n if (!$this->validate()) {\n return null;\n }\n\n $image = $this->downloadImage($this->url);\n\n if (is_wp_error($image)) {\n return null;\n }\n\n return $image;\n }"
] | [
"0.7860076",
"0.6769196",
"0.66775316",
"0.66402024",
"0.6626112",
"0.66182774",
"0.65609",
"0.65335965",
"0.65295035",
"0.65233415",
"0.65218234",
"0.650556",
"0.65027696",
"0.6491933",
"0.648201",
"0.6461445",
"0.6428101",
"0.63821864",
"0.6379438",
"0.63683873",
"0.6346539",
"0.63419914",
"0.6339732",
"0.6335015",
"0.63226163",
"0.63007015",
"0.6278026",
"0.62748384",
"0.6241851",
"0.62134284"
] | 0.7081564 | 1 |
Returns the path to the pdfinfo utility. | protected function getPdfInfo()
{
if (version_compare(TYPO3_version, '8.0', '>=')) {
$pdfInfo = is_file($this->settings['tools_pdfinfo'])
? $this->settings['tools_pdfinfo']
: GeneralUtility::getFileAbsFileName($this->settings['tools_pdfinfo']);
} else {
$pdfInfo = GeneralUtility::getFileAbsFileName($this->settings['tools_pdfinfo'], false);
}
return $pdfInfo;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetSiteInfoPath() {\n\t\t\tif($this->GetOption('use_rewrite')===true) {\n\t\t\t\treturn trailingslashit($this->GetHomePath()) . SIG_FILE_NAME;\n\t\t\t} else {\n\t\t\t\treturn trailingslashit($this->GetOption('file_path')) . SIG_FILE_NAME;\t\n\t\t\t}\n\t\t}",
"public function pathinfo()\n {\n die('pathinfo');\n }",
"public function getPathInfo(): string\n {\n return $this->pathInfo;\n }",
"function getParserPath() {\n\t\t// to link smilies directly, without\n\t\t// changing paths through different applications.\n\t\n\t\t$f = __FILE__;\n\t\t$f = str_replace('\\\\', '/', $f); // Windows\n\t\t\n\t\t$dr = preg_quote($_SERVER['DOCUMENT_ROOT']);\n\t\t\n\t\t\n\t\t\n\t\t$parser_filename = basename($f);\n\t\t\n\t\t$path = preg_replace(\"#^($dr)#\", null, $f);\n\t\t$path = pathinfo($path, PATHINFO_DIRNAME) . '/' . $parser_filename;\n\t\t\n\t\t\n\t\t\n\t\tdefine('PARSER_FILENAME', $parser_filename);\n\t\treturn define('PARSER_ORIGINAL_PATH', $path);\n\t\t\n\t}",
"protected function getInformationTargetPath()\n {\n if ($path = array_get($this->config, 'path')) {\n return $path;\n }\n\n return rtrim($this->getInformationTargetBasePath(), DIRECTORY_SEPARATOR)\n . DIRECTORY_SEPARATOR\n . $this->getInformationTargetRelativePath();\n }",
"private function getPdfBinary()\n {\n $os = $this->detectOs();\n\n if ('windows' === $os) {\n return 'wemersonjanuario/wkhtmltox-windows-64bit/bin/wkhtmltopdf.exe';\n }\n if ('mac' === $os) {\n return 'messagedigital/wkhtmltopdf-osx/bin/wkhtmltopdf-osx';\n }\n\n $architecture = $this->detectArchitecture();\n\n return sprintf(\n 'h4cc/wkhtmltopdf-%s/bin/wkhtmltopdf-%s',\n $architecture,\n $architecture\n );\n }",
"public static function path()\n {\n \treturn substr(__DIR__, 0, -11);\n }",
"public function info($options = false) {\n\t\tif (!($info = pathinfo( $this->_filename, $options ))) {\n\t\t\tthrow new Sea_Exception ( 'Impossible d\\'accéder au donné de \"' . $this->_filename );\n\t\t}\n\t\t\n\t\treturn $info;\n\t}",
"function getPHPReportsFilePath(){\n\t\t$sPath = getPHPReportsIncludePath();\n\t\tif(!is_null($sPath))\n\t\t\treturn $sPath;\n\t\t// put your distro path here\n\t\treturn \"/var/htdocs/phpreports/\"; \n\t}",
"public function getPdfUrlPath()\n {\n return $this->invoicePdfUrlPath;\n }",
"protected function filename()\n {\n return 'Pdf_' . date('YmdHis');\n }",
"private function getCertificateFile()\n {\n if (DEBUG) {\n return ROOT_DIR . DIRECTORY_SEPARATOR . CERTIFICATE_PATH_DEVELOP;\n } else {\n return ROOT_DIR . DIRECTORY_SEPARATOR . CERTIFICATE_PATH;\n }\n }",
"public function getPathInfo();",
"public function getPathInfo();",
"public function getPdfFilePath()\n {\n return $this->invoicePdfFilePath;\n }",
"function accapi_get_file_path()\n{\n\treturn __FILE__;\n}",
"public function getPathInfo(): ?string { return $this->get(self::PATH_INFO, NULL); }",
"function pathinfo ($path, $options = 'PATHINFO_DIRNAME | PATHINFO_BASENAME | PATHINFO_EXTENSION | PATHINFO_FILENAME') {}",
"public function filename(){\n\t\treturn $this->info(PATHINFO_FILENAME);\n\t}",
"function info($path = null) {\n\t\treturn $this->run('info', array($this->working . $path));\n\t}",
"private function _getTocPath() {\n return $this->_getOption('baseDir') . $this->_getOption('tocFile');\n }",
"function info($filename);",
"public function getVersionPath(): string\n {\n return $this::VERSIONS[$this->version];\n }",
"protected function getOutputPath() : string\n {\n $path = $this->getPathByOptionOrConfig('path', 'controller_target_path');\n\n return sprintf('%s/%s.php', $path, $this->getControllerName());\n }",
"public function getPathInfo()\n {\n return rtrim(parent::getPathInfo(), '/') ?: '/';\n }",
"protected function getExecutable()\n {\n return realpath(__DIR__ . '/../../bin/phptea');\n }",
"public function path(): string\n {\n return Docs::path(\n $this->category.'/'\n .$this->page\n .($this->subpage == '' ? '' : '/'.$this->subpage)\n .'.md'\n );\n }",
"public function toString() {\n if ($home= getenv('HOME')) { // Un*x or Cygwin\n $separator= '/';\n $bases= array(getcwd() => '.', $home => '~', getenv('APPDATA') => '$APPDATA');\n } else if (0 === strncasecmp(PHP_OS, 'Win', 3)) {\n $separator= '\\\\';\n $bases= array(getcwd() => '.', getenv('APPDATA') => '%APPDATA%');\n } else {\n $separator= DIRECTORY_SEPARATOR;\n $bases= array(getcwd() => '.');\n }\n\n $path= $this->compactPath(rtrim($this->path, DIRECTORY_SEPARATOR), $bases);\n return\n str_replace('ClassLoader', 'CL', $this->getClass()->getSimpleName()).\n '<'.strtr($path, DIRECTORY_SEPARATOR, $separator).'>'\n ;\n }",
"public static function directory()\n {\n return PCERHOME.'/';\n }",
"public function serviceProviderFilePath()\n {\n return $this->getPath('ServiceProvider');\n }"
] | [
"0.6282535",
"0.61772364",
"0.59674525",
"0.580521",
"0.575391",
"0.5726693",
"0.57058835",
"0.570165",
"0.565089",
"0.5631842",
"0.5611468",
"0.56066906",
"0.5602908",
"0.5602908",
"0.56018203",
"0.55744445",
"0.5570142",
"0.5568893",
"0.5554739",
"0.554408",
"0.55421776",
"0.5514462",
"0.5506073",
"0.5492373",
"0.5491205",
"0.54874325",
"0.5480518",
"0.5459705",
"0.5453568",
"0.5438698"
] | 0.76123506 | 0 |
Get stream meta data | public function getMetaData()
{
return stream_get_meta_data($this->_handle);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stream_get_meta_data ($stream) {}",
"public function getMetaData(){\n return $this->meta;\n }",
"public function getMetaData()\n {\n return $this->metaData;\n }",
"public function getMetaData() {\n return $this->metaData;\n }",
"public function _getMetaInformation()\n {\n return $this->meta;\n }",
"public function getMetaData()\n {\n return $this->_metadata;\n }",
"public function getMetaData();",
"public function getMetaData();",
"protected function getMetaData()\n\t{\n\t\treturn $this->data = json_decode(file_get_contents($this->meta_file), true);\n\t}",
"public function getResponseMeta()\n {\n return $this->response['meta'];\n }",
"public function getInfo() {\n include 'meta.php';\n return $meta;\n }",
"public function metadata() {\n return $this->metadata;\n }",
"public function getMetaData(): string\n {\n return Helper::createMetaDataXml(\"-1\", \"-1\", [\n \"dc:title\" => $this->getTitle() ?: \"Stream\",\n \"upnp:class\" => \"object.item.audioItem.audioBroadcast\",\n \"desc\" => [\n \"_attributes\" => [\n \"id\" => \"cdudn\",\n \"nameSpace\" => \"urn:schemas-rinconnetworks-com:metadata-1-0/\",\n ],\n \"_value\" => \"SA_RINCON65031_\",\n ],\n ]);\n }",
"abstract public function getMetadata();",
"public function getMeta() {}",
"public function get_metadata()\n {\n return $this->metadata;\n }",
"public function get_metadata()\n {\n return $this->metadata;\n }",
"public function getMeta()\n\t{\n\t\t// Build the request path.\n\t\t$path = '/meta';\n\n\t\treturn $this->processResponse($this->client->get($this->fetchUrl($path)), 200);\n\t}",
"public function getMetadata();",
"public function getMetadata();",
"public function getMetadata();",
"public function getMeta();",
"public function getMeta();",
"public function getMetaRaw();",
"public function getMeta()\n {\n return $this->getValue('meta');\n }",
"public static function getMeta();",
"private function getMetadata()\n {\n if ($this->phar->hasMetadata())\n {\n return $this->phar->getMetadata();\n }\n else\n {\n return [\n 'hashMap' => []\n ];\n }\n }",
"public function getMetadata() {\n return $this->_metadata;\n }",
"public function getMeta()\n\t{\n\t\treturn $this->webserviceMeta;\n\t}",
"public function getMetadata()\n {\n return $this->metadata;\n }"
] | [
"0.85849386",
"0.69932103",
"0.6936939",
"0.68932295",
"0.6878988",
"0.68562835",
"0.68274647",
"0.68274647",
"0.679696",
"0.67316115",
"0.6646187",
"0.66270894",
"0.66123295",
"0.6591955",
"0.65661216",
"0.6526082",
"0.6526082",
"0.6496051",
"0.64823127",
"0.64823127",
"0.64823127",
"0.6466615",
"0.6466615",
"0.6448109",
"0.64268225",
"0.64208215",
"0.6367433",
"0.636278",
"0.6353005",
"0.6308589"
] | 0.84700525 | 1 |
Set the publishable workflow flag. | public function setPublishable($publishable)
{
$this->publishable = $publishable;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setPublishable($publishable)\n {\n $this->published = $publishable;\n }",
"public function setIsWorkflowInEffect()\n {\n // if there is a workflow applied, we can't set the publishing date directly, only the 'desired' publishing date\n $effective = $this->getWorkflowService()->getDefinitionFor($this->owner);\n $this->isWorkflowInEffect = $effective ? true : false;\n }",
"public function setIsPublishedAttribute($isPublished)\n {\n $this->attributes['is_published'] = (bool)$isPublished;\n }",
"public function setIsArchived(?bool $value): void {\n $this->getBackingStore()->set('isArchived', $value);\n }",
"public function publ($flag = true) {\n\t\t$this->publ = (boolean) $flag;\n\t\treturn $this;\n\t}",
"public function setIsManagementRestricted(?bool $value): void {\n $this->getBackingStore()->set('isManagementRestricted', $value);\n }",
"public function setIsPublish($IsPublish)\n {\n $this->__set(\"is_publish\", $IsPublish);\n }",
"public function setShouldBePublished( bool $bool ) : Asset\n {\n if( !c\\BooleanValues::isBoolean( $bool ) )\n throw new e\\UnacceptableValueException( \"The value $bool must be a boolean\" );\n \n $this->getProperty()->shouldBePublished = $bool;\n return $this;\n }",
"public function setIsPublisher($status) {\n\t\t\\Scrivo\\ArgumentCheck::assertArgs(func_get_args(), array(\n\t\t\tarray(\\Scrivo\\ArgumentCheck::TYPE_BOOLEAN)\n\t\t));\n\n\t\t$this->isPublisher = $status;\n\t}",
"function setPublished($inParm) {\r\n\t\t$this->published = $inParm;\r\n\t}",
"function publish() {\n\t $this->set('published','true');\n\t $this->update();\n }",
"public function set_publicPage(bool $publicPage){\n\t\t$this->publicPage = $publicPage;\n\t}",
"public function setIsPublisherAttested($val)\n {\n $this->_propDict[\"isPublisherAttested\"] = $val;\n return $this;\n }",
"public function setIsEnabledForMicrosoftStoreForBusiness(?bool $value): void {\n $this->getBackingStore()->set('isEnabledForMicrosoftStoreForBusiness', $value);\n }",
"public function setPublished($published);",
"public function setPublished($published);",
"public function setPublished($published);",
"public function setPublished($published);",
"public function setPublished($published);",
"public function setPublished($published);",
"public function setPublished($published);",
"public function setPublished($published);",
"public function setPublished($published);",
"public function setPublished($published);",
"public function setPublished($published);",
"public function setPublished($published);",
"public function setPublished($published);",
"public function setPublished($published);",
"public function setPublished($published);",
"public function set_is_public( $value ) {\n\t\t$this->definition[ self::DEF_PUBLIC ] = ( $value ? 'public' : 'hidden' );\n\t}"
] | [
"0.6855121",
"0.6437826",
"0.6197548",
"0.59634006",
"0.59357893",
"0.59125346",
"0.5776866",
"0.5758364",
"0.5756402",
"0.57560414",
"0.5716993",
"0.57153124",
"0.5622681",
"0.5559316",
"0.5556331",
"0.5556331",
"0.5556331",
"0.5556331",
"0.5556331",
"0.5556331",
"0.5556331",
"0.5556331",
"0.5556331",
"0.5556331",
"0.5556331",
"0.5556331",
"0.5556331",
"0.5556331",
"0.5556331",
"0.55520546"
] | 0.67865944 | 1 |
Get the link type. The link type is used to explicitly determine which of the uri, route and content fields are used to determine the link which will bre rendered for the menu item. If it is empty this will be determined automatically. | public function getLinkType()
{
return $this->linkType;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLinkType();",
"public function getLinkType()\n {\n return null;\n }",
"public function getXsiTypeName() {\n return \"LinkType\";\n }",
"function determineLinkType()\n\t{\n\t\t// determine link type and target\n\t\t$ltype = ($_SESSION[\"il_link_type\"] == \"\")\n\t\t\t? $this->default_type\n\t\t\t: $_SESSION[\"il_link_type\"];\n\t\t$ltype_arr = explode(\"_\", $ltype);\n\t\t\n\t\tif (!isset($this->ltypes[$ltype_arr[0]]) &&\n\t\t\t!isset($this->ltypes[$ltype]))\n\t\t{\n\t\t\t$this->link_type = $this->default_type;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->link_type = ($ltype_arr[0] == \"\")\n\t\t\t\t? $this->default_type\n\t\t\t\t: $ltype_arr[0];\n\t\t\t$this->link_target = $ltype_arr[1];\n\t\t}\n\t}",
"public function getLinkTypeId () {\n\t\t$val = $this->cacheGetPlain('link_type_id');\n \tif (is_null($val))\n \t\treturn $this->cacheSetPlain('link_type_id', $this->getOffering()->getLinkTypeId());\n \telse\n \t\treturn $val;\n\t}",
"public function getType()\n {\n return $this->route->getType();\n }",
"protected function findLinkType(array $data, string $link): string\n {\n $dokType = $data['doktype'];\n \n if ($dokType === 199) {\n return AbstractMenuRenderer::TYPE_LINK_SPACER;\n }\n \n if ($dokType === 3) {\n if (! GeneralUtility::isOnCurrentHost($link)) {\n return AbstractMenuRenderer::TYPE_LINK_EXTERNAL;\n }\n \n return AbstractMenuRenderer::TYPE_LINK_INTERNAL;\n }\n \n return AbstractMenuRenderer::TYPE_LINK_PAGE;\n }",
"public function LinkTypeTile(): string;",
"public function LinkTypeHandlerName(): string;",
"public function getLinkTypes();",
"public function getQuickLinkType(): string {\n return $this->quickLinkType;\n }",
"public function getDefaultShareLinkType()\n {\n return $this->getProperty(\"DefaultShareLinkType\");\n }",
"public function getLinkRelationType() {\n return reset($this->rel);\n }",
"public function getXsiTypeName() {\n return \"Link\";\n }",
"public function getLinkedProductType()\n {\n return $this->_get(self::KEY_LINKED_PRODUCT_TYPE);\n }",
"public function link($type='')\n\t{\n\t\t$link = 'index.php?option=com_tags&tag=' . $this->get('tag');\n\n\t\tswitch (strtolower($type))\n\t\t{\n\t\t\tcase 'edit':\n\t\t\t\t$link .= '&task=edit';\n\t\t\tbreak;\n\n\t\t\tcase 'delete':\n\t\t\t\t$link .= '&task=delete';\n\t\t\tbreak;\n\n\t\t\tcase 'permalink':\n\t\t\tdefault:\n\n\t\t\tbreak;\n\t\t}\n\n\t\treturn $link;\n\t}",
"public function setLinksType($link_type = 'all')\n {\n $this->link_type = $link_type;\n }",
"function getLink(array $links, $type) {\n foreach ($links as $link) {\n if ($link->getRel() == $type) {\n return $link->getHref();\n }\n }\n return \"\";\n}",
"public function getLinkTypeRepository()\n {\n return $this->linkTypeRepository;\n }",
"public function getTypeUrl() {}",
"public function getTypeUrl() {}",
"public function getLinkNameAttribute()\n\t{\n\t\treturn $this->attributes['section_type_name'];\n\t}",
"public function getResourceType()\n {\n return $this->route->getResourceType();\n }",
"public function getLinkTypeRepository();",
"public function getLink($type)\n\t{\n\t\tif (!isset($this->links[$type]))\n\t\t\tthrow new \\InvalidArgumentException(\"Link type $type doesnt exist.\");\n\t\treturn $this->links[$type];\n\t}",
"public function getLinkTypes()\n {\n return $this->getLinkTypeRepository()->findAll();\n }",
"function type( $as_name = false )\r\n {\r\n if ( !$as_name )\r\n {\r\n return $this->ModuleType;\r\n }\r\n else\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->query_single( $row, \"SELECT Module, Type FROM eZModule_LinkModuleType\r\n WHERE ID='$this->ModuleType'\" );\r\n return $row;\r\n }\r\n }",
"public function type()\n {\n if ($this->_uri) {\n $res = $this->get($this->_uri);\n return $res->type();\n } else {\n return null;\n }\n }",
"public function get_type(){\r\n\t\tswitch(true){\r\n\t\t\tcase !!$this->_exception:\r\n\t\t\t\treturn 'error';\r\n\t\t\tcase !!$this->get_name():\r\n\t\t\t\treturn 'page';\r\n\t\t\tdefault:\r\n\t\t\t\treturn 'home';\r\n\t\t}\r\n\t}",
"function __link($type){\n\n\tglobal $_linksFiles;\n\n\t$files = $_linksFiles[$type];\n\t$_link = '';\n\n\tif (!empty($files) AND is_array($files)){\n\t\tforeach($files as $link){\n\t\t\tif (file_exists(APP . str_replace('/', DIRECTORY_SEPARATOR, $link))){\n\t\t\t\t$_link[] = LINK . $link;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $_link;\n}"
] | [
"0.823226",
"0.77139944",
"0.73104084",
"0.7106052",
"0.7023399",
"0.6796352",
"0.66936576",
"0.6621605",
"0.649995",
"0.6487688",
"0.6371094",
"0.6362878",
"0.6347862",
"0.62842786",
"0.6235694",
"0.6082527",
"0.60313696",
"0.59682876",
"0.5956526",
"0.5946467",
"0.5946467",
"0.5903609",
"0.5876937",
"0.58518976",
"0.5826655",
"0.5786609",
"0.5782083",
"0.5737923",
"0.5725462",
"0.5707948"
] | 0.821189 | 1 |
Renvoie l'identifiant d'icone svg correspondant au role de l'utilisateur | public function roleSvg()
{
switch ($this->role) {
case "":
return "cq-user-question";
case self::ROLE_ADMIN:
return "cq-user-admin";
case self::ROLE_SIMPLE_HUMAN:
default:
return "cq-user-no-sign";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function avatar(){\n global $connection;\n $login_id = \"\";\n if (isset($_SESSION['id'])) {\n $login_id = $_SESSION['id'];\n }\n \n $view_vender_query = \"SELECT * FROM users WHERE id= $login_id\";\n $select_vender_by_id = mysqli_query($connection, $view_vender_query); \n while($row = mysqli_fetch_assoc($select_vender_by_id)){\n $image1 = $row['image1'];\n}\n\n echo '<span class=\"user-icon\"> <img src=\"./images/'.$image1.'\" alt=\"\" class=\"rounded-circle mb10\"></span>';\n\n }",
"public function getAvatar()\n {\n\n return \"/images/avatars/\".$this->getId().\".svg?ver=\".time();\n\n }",
"public function getId_utilisateur()\n {\n return $this->id_utilisateur;\n }",
"public function getImagen_usuario()\n {\n return $this->imagen_usuario;\n }",
"function id_ordine_user($idu){\r\n \r\n $sql = \"SELECT retegas_ordini.id_utente FROM retegas_ordini WHERE (((retegas_ordini.id_ordini)='$idu'));\";\r\n $ret = mysql_query($sql);\r\n $row = mysql_fetch_row($ret);\r\n return $row[0];\r\n}",
"function avatar2(){\n global $connection;\n $login_id = \"\";\n if (isset($_SESSION['id'])) {\n $login_id = $_SESSION['id'];\n }\n \n $view_vender_query = \"SELECT * FROM users WHERE id= $login_id\";\n $select_vender_by_id = mysqli_query($connection, $view_vender_query); \n while($row = mysqli_fetch_assoc($select_vender_by_id)){\n $image1 = $row['image1'];\n}\n\n echo '<img src=\"./images/'.$image1.'\" alt=\"\" class=\"rounded-circle\"></div>';\n }",
"public function getIdentity(): string;",
"public function getUserPieId() {\r\n\t\t$pieId = null;\r\n $userId = $this->getUserId();\r\n\t\tif ($userId) {\r\n $pieId = $this->_getPieModel()->fetchPieId($userId,'USER');\r\n } else {\r\n $pieId = 'new';\r\n }\r\n return $pieId;\r\n }",
"public function usuarioRepresentante($repoid){\r\n\r\n $sql = \"SELECT\r\n cd_usuario,\r\n ds_login,\r\n usurefoid,\r\n dt_exclusao\r\n FROM\r\n usuarios\r\n WHERE\r\n usurefoid = $repoid\r\n AND\r\n usudepoid = 9\r\n \";\r\n\r\n $rs = $this->executarQuery($sql);\r\n\r\n if(pg_num_rows($rs) < 0){\r\n return false;\r\n }else{\r\n return pg_fetch_all($rs);\r\n }\r\n\r\n }",
"function getAvatarParticipanteId($participante_id){\n\t$id_avatar = get_user_meta($participante_id, '_avatar_id', true);\n\treturn attachment_image_url( $id_avatar, 'full');\n}",
"function recupererAnnonce($id_utilisateur) {\r\n $res = $this->db->query(\"SELECT * FROM Annonce WHERE utilisateur=$id_utilisateur\");\r\n $annonce = $res->fetchall(PDO::FETCH_CLASS|PDO::FETCH_PROPS_LATE,'Annonce');\r\n return $annonce;\r\n }",
"public function getPseudoUtilisateur()\n {\n return $this->pseudoUtilisateur;\n }",
"public function getIdentity();",
"public function getIdentity();",
"public function getIdentity();",
"public function getIdentity();",
"public function getIdUtilisateur()\n {\n return $this->id_utilisateur;\n }",
"function getGroupeUtilisateur($idVisiteur){\n\t\t\n\t\t// Obtient la liste des groupes dans lesquels se trouve le visiteur. (la requête ne regarde pas le type qui est toujours =1 si ceci devait changer, revoir la requête)\n\t\t$query = \"select id_groupe from `\".$this->tablePrefix.\"groupe-element` where `\".$this->tablePrefix.\"groupe-element`.id_element='\".$idVisiteur.\"' and `\".$this->tablePrefix.\"groupe-element`.table_element='1'\"; // 1 => type ressource=personne\n\t\t$result = $this->connection->query($query);\n\t\t$listeGroupeVisiteur = $this->connection->getRowArrays($result);\n\n\t\t // print_r($listeGroupeVisiteur);\n\n\t\treturn $listeGroupeVisiteur;\n\t}",
"public function getUserIdentifier();",
"public function getUserIdentifier();",
"public function getIdUtilisateur()\n {\n return $this->Id_utilisateur;\n }",
"function getID($user){}",
"public function getUserId(){\n return $this->nUserId_SR;\n }",
"function get_id_prof_principal() {\r\n\t\t\t\r\n\t\t$sql=\"SELECT id_ens\r\n\t\t\t\t FROM les_classes\r\n\t\t\t\t WHERE id_cla='$this->id_cla'\";\t \t\t \r\n\r\n\t\t$result = $this->bdd->executer($sql);\r\n\t\t\t\r\n\t\tif ($ligne = mysql_fetch_assoc($result)) {\r\n\t\t\treturn\t$ligne['id_ens'];\r\n\t\t}\r\n\t\telse return 0;\r\n\t\t\t\r\n\t}",
"public function getOwnerNsid();",
"function _usersId(){\n $admin = false;\n if($this->Auth->user())\n return $this->Auth->user('nhanvien_id');\n }",
"private function getuserid() {\n\n\n $em = $this->getDoctrine()->getManager();\n $user_security = $this->container->get('security.context');\n // authenticated REMEMBERED, FULLY will imply REMEMBERED (NON anonymous)\n if ($user_security->isGranted('IS_AUTHENTICATED_FULLY')) {\n $user = $this->get('security.context')->getToken()->getUser();\n $user_id = $user->getId();\n /*$group = $user->getIdgroup();*/\n /*if (isset($group)) {\n $group_id = $group->getId();\n } else {\n $group_id = 0;\n }*/\n } else {\n $user_id = 0;\n // $group_id = 0;\n }\n return $user_id;\n }",
"public function getIdUtilisateur()\n\t{\n\t\treturn $this->_idUtilisateur;\n\t}",
"public function getUtilisateurId()\n {\n return $this->utilisateurId;\n }",
"function uid(){ \n return Yii::app()->user->id; \n }"
] | [
"0.5420513",
"0.53526765",
"0.5247375",
"0.5235523",
"0.52165073",
"0.51832056",
"0.5142452",
"0.51230896",
"0.5121112",
"0.51128983",
"0.5104886",
"0.50552005",
"0.5049459",
"0.5049459",
"0.5049459",
"0.5049459",
"0.5045232",
"0.50449413",
"0.5034529",
"0.5034529",
"0.5027242",
"0.49712688",
"0.4959473",
"0.49520344",
"0.49511713",
"0.49477696",
"0.49403653",
"0.4931583",
"0.49129927",
"0.48968545"
] | 0.589395 | 0 |
Try to checkout with valid flat fee shipping option | function testCheckoutFlatFeeShipping() {
$productA = $this->objFromFixture('Product', 'productA');
$taxRate = $this->objFromFixture('FlatFeeTaxRate', 'gstNewZealand');
$countryNZ = $this->objFromFixture('Country_Shipping', 'newZealand');
$buyer = $this->objFromFixture('Customer', 'buyer');
$checkoutPage = DataObject::get_one('CheckoutPage');
$accountPage = DataObject::get_one('AccountPage');
$this->loginAs('admin');
$productA->doPublish();
$checkoutPage->doPublish();
$accountPage->doPublish();
$this->logOut();
$this->assertTrue($productA->isPublished());
$this->loginAs($buyer);
$orders = $buyer->Orders();
$this->assertEquals(1, $orders->Count());
$this->get(Director::makeRelative($productA->Link()));
$this->submitForm('AddToCartForm_AddToCartForm', null, array(
'Quantity' => 1
));
$order = CartControllerExtension::get_current_order();
$items = $order->Items();
$this->assertEquals(1, $items->Count());
$this->assertEquals($productA->ID, $items->First()->Object()->ID);
$this->get(Director::makeRelative($checkoutPage->Link()));
//Set a modification for this Order via updateOrderFormCart
$data = $this->getFormDataNested('CheckoutForm_OrderForm');
$this->post(
Director::makeRelative($checkoutPage->Link() . 'updateOrderFormCart'),
$data
);
$this->get(Director::makeRelative($checkoutPage->Link()));
$this->submitForm('CheckoutForm_OrderForm', null, array(
'Shipping[Country]' => $countryNZ->ID,
'Modifiers[FlatFeeTax]' => $taxRate->ID
));
$orders = $buyer->Orders();
$orders->sort('ID', "ASC");
$this->assertEquals(2, $orders->Count());
$order = $orders->Last();
$this->assertEquals(15, $taxRate->Rate);
$realTotal = $order->SubTotal->getAmount() * 1.15;
$this->assertEquals($orders->Last()->Total->getAmount(), $realTotal);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function jr_woocommerce_custom_fee() {\n\n\tif ( ( is_admin() && ! defined( 'DOING_AJAX' ) ) || ! is_checkout() ) {\n\t\treturn;\n\t}\n\n\t$chosen_gateway = WC()->session->chosen_payment_method;\n\n\t$fee = 1.99;\n\n\tif ( $chosen_gateway == 'cod' ) {\n\t\tWC()->cart->add_fee( __( 'Shipping option fee', 'storefront' ), $fee, false, '' );\n\t}\n}",
"public function check_fee( $post_data ) {\n\t\tparse_str( $post_data, $checkout_fields );\n\n\t\t$allowed = Iconic_WDS_Checkout::is_delivery_slots_allowed();\n\n\t\tif ( ! $allowed ) {\n\t\t\tWC()->session->__unset( 'jckwds_timeslot_fee' );\n\t\t\tWC()->session->__unset( 'jckwds_same_day_fee' );\n\t\t\tWC()->session->__unset( 'jckwds_next_day_fee' );\n\t\t\tWC()->session->__unset( 'jckwds_day_fee' );\n\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( $checkout_fields['jckwds-delivery-time'] ) ) {\n\t\t\t$timeslot_fee = $this->extract_fee_from_option_value( $checkout_fields['jckwds-delivery-time'] );\n\n\t\t\tif ( $timeslot_fee > 0 ) {\n\t\t\t\tWC()->session->set( 'jckwds_timeslot_fee', $timeslot_fee );\n\t\t\t} else {\n\t\t\t\tWC()->session->__unset( 'jckwds_timeslot_fee' );\n\t\t\t}\n\t\t} else {\n\t\t\tWC()->session->__unset( 'jckwds_timeslot_fee' );\n\t\t}\n\n\t\tif ( $this->settings['datesettings_fees_same_day'] > 0 ) {\n\t\t\t$same_day = $this->get_same_day_date( $this->date_format() );\n\t\t\tif ( isset( $checkout_fields['jckwds-delivery-date'] ) && $checkout_fields['jckwds-delivery-date'] === $same_day ) {\n\t\t\t\tWC()->session->set( 'jckwds_same_day_fee', $this->settings['datesettings_fees_same_day'] );\n\t\t\t} else {\n\t\t\t\tWC()->session->__unset( 'jckwds_same_day_fee' );\n\t\t\t}\n\t\t} else {\n\t\t\tWC()->session->__unset( 'jckwds_same_day_fee' );\n\t\t}\n\n\t\tif ( $this->settings['datesettings_fees_next_day'] > 0 ) {\n\t\t\t$next_day = $this->get_next_day_date( $this->date_format() );\n\t\t\tif ( isset( $checkout_fields['jckwds-delivery-date'] ) && $checkout_fields['jckwds-delivery-date'] === $next_day ) {\n\t\t\t\tWC()->session->set( 'jckwds_next_day_fee', $this->settings['datesettings_fees_next_day'] );\n\t\t\t} else {\n\t\t\t\tWC()->session->__unset( 'jckwds_next_day_fee' );\n\t\t\t}\n\t\t} else {\n\t\t\tWC()->session->__unset( 'jckwds_next_day_fee' );\n\t\t}\n\n\t\t$day_fees = array_filter( Iconic_WDS_Settings::get_day_fees() );\n\n\t\tif ( ! empty ( $day_fees ) ) {\n\t\t\t$ymd = ! empty( $checkout_fields['jckwds-delivery-date-ymd'] ) ? $checkout_fields['jckwds-delivery-date-ymd'] : false;\n\n\t\t\tif ( ! $ymd ) {\n\t\t\t\tWC()->session->__unset( 'jckwds_day_fee' );\n\t\t\t} else {\n\t\t\t\t$date = DateTime::createFromFormat( 'Ymd', $ymd, wp_timezone() );\n\t\t\t\t$day = $date->format( 'w' );\n\n\t\t\t\tif ( isset( $day_fees[ $day ] ) ) {\n\t\t\t\t\tWC()->session->set( 'jckwds_day_fee', $day_fees[ $day ] );\n\t\t\t\t} else {\n\t\t\t\t\tWC()->session->__unset( 'jckwds_day_fee' );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tWC()->session->__unset( 'jckwds_day_fee' );\n\t\t}\n\t}",
"protected function _assignFreeShipping(){\n //get delivery postcode\n $delivery_address = new Address($this->context->cart->id_address_delivery);\n //if no postcode setted\n if (!$delivery_address->postcode)\n $delivery_address->postcode = 75000; //set temporary postcode\n\n $id_zone = Address::getZoneByZipCode($delivery_address->postcode);\n $zone = new Zone($id_zone);\n\n if ($this->display_debug) $this->errors[] = \"Cart id #\".$this->context->cart->id; //Debug message\n //get total with taxes\n $total_wt = $this->context->cart->getTotalProductsPriceWithTax();\n\n //set freeShipping roof\n $free_shipping = $zone->free_shipping;\n\n //@TODO Manage free shipping according to Carrier free_shipping instead of Zone free_shipping\n //========================================================\n //Temporary solution (hard coding)\n //\n //Hard Code to manage \"livraison le soir\" and \"livraison express\" special cases:\n //\"livraison le soir\" is a jet carrier, but should be considered as Ecolo for prices\n //\"livraison express\" is a UPS carrier, but it has its own free shipping price\n //(different than Saver which use the normal free shipping for UPS zone\n //==========\n\n //get Ecolos free_shipping\n $ecolo_zone = new Zone(ID_ZONE_ECOLOTRANS);\n\n //set special free shipping case\n ////Used to show the good price for \"livraison le soir\" or \"Livraison Express\" (see order-carrier.tpl line 418)\n $special_case_free_shipping = false;\n if (($id_zone == ID_ZONE_JET && $total_wt >= $ecolo_zone->free_shipping) ||\n ($id_zone == ID_ZONE_UPS && $total_wt >= DELIVERY_FREE_SHIPPING_UPS_EXPRESS))\n $special_case_free_shipping = true;\n\n $this->context->smarty->assign(array(\n 'special_case_free_shipping' => $special_case_free_shipping //Used to show the good price for \"livraison le soir\" or \"Livraison Express\" (see order-carrier.tpl line 418)\n ));\n\n\n //for free shipping calculus reconsidere as zone Ecolo if \"livraison le soir\" selected\n $carrier = new Carrier($this->context->cart->id_carrier);\n\n if ($carrier->name == 'Livraison le soir'){\n if ($this->display_debug)\n $this->errors[] = \"Zone Jet, reconsidered as Ecolo for free shipping price: Livraison le soir\";\n $zone = $ecolo_zone;\n $free_shipping = $zone->free_shipping;\n }\n\n ////for free shipping calculus reconsidere as zone Ecolo if \"livraison le soir\" selected\n if ($carrier->name == 'Livraison Express'){\n if ($this->display_debug)\n $this->errors[] = \"Zone Ups, using constant var (in settings.inc) for free shipping price: Livraison Express\";\n $free_shipping = DELIVERY_FREE_SHIPPING_UPS_EXPRESS; //see config/settings.inc.php line 65\n }\n //=========================================================\n\n if ($total_wt >= $free_shipping || $this->context->cart->custom_relay > 0 ||\n $this->context->smarty->getTemplateVars('is_adjustment') == true){\n if ($this->display_debug) $this->errors[] = \"Free shipping\"; //Debug message\n //total product price > free shipping price OR ajustment cart\n\n //create and add a new FreeShipping rule\n $this->context->cart->addCustomFreeShippingRule();\n $this->context->smarty->assign(array(\n 'free_shipping' => true,\n ));\n }\n else{\n if ($this->display_debug) $this->errors[] = \" NOT Free shipping, delete free shipping if exist\"; //Debug message\n //Delete FreeShipping rule if found\n $this->context->cart->deleteCustomFreeShippingRule();\n $this->context->smarty->assign(array(\n 'free_shipping' => false,\n ));\n }\n }",
"public static function validate() {\n// avoid hack attempts during the checkout procedure by checking the internal cartID\n if (!isset($_SESSION['shipping'], $_SESSION['sendto'], $_SESSION['cart']->cartID, $_SESSION['cartID'])\n || ($_SESSION['cart']->cartID !== $_SESSION['cartID']))\n {\n tep_redirect(tep_href_link('checkout_shipping.php', '', 'SSL'));\n }\n }",
"public function testCalcDeliveryCostFreeShipped()\n {\n // deleting discounts to ignore bundle problems\n foreach ( $this->aDiscounts as $oDiscount )\n $oDiscount->delete();\n\n modConfig::getInstance()->setConfigParam( 'blCalculateDelCostIfNotLoggedIn', false );\n modConfig::getInstance()->setConfigParam( 'blEnterNetPrice', true );\n\n $oAdmin = new oxuser();\n $oAdmin->load( 'oxdefaultadmin' );\n\n $oBasket = new oxbasket();\n $oBasket->setBasketUser( $oAdmin );\n $this->oArticle->oxarticles__oxfreeshipping = new oxField(true, oxField::T_RAW);\n $this->oArticle->save();\n $oBasket->addToBasket( $this->oArticle->getId(), 1 );\n $oBasket->calculateBasket( false );\n\n $oPrice = $oBasket->getCosts( 'oxdelivery' );\n\n $this->assertEquals( 0, $oPrice->getBruttoPrice() );\n }",
"function isFreeShipping($total_price = null) {\n\t\t// doprava muze byt zdarma bud proto, ze CENA ZBOZI V KOSIKU JE VYSSI NEZ NEJNIZSI MOZNA MEZ PRO DOPRAVU ZDARMA\n\t\t// anebo v kosiku mam ZBOZI, KTERE UMOZNUJE DOPRAVU ZDARMA ((neostrata nad 1200,- || syncare nad 700,-) && GEIS s platbou predem) \n\t\t/*\n\t\t * zjistim nejmensi moznou cenu objednavky, od ktere je doprava zdarma (mimo osobni odber)\n\t\t * a pokud mam objednavku alespon v dane hodnote, je mozna doprava zdarma\n\t\t */\n\t\tApp::import('Model', 'Shipping');\n\t\t$this->Shipping = &new Shipping;\n\t\t$shipping = $this->Shipping->lowestFreeShipping();\n\t\t\n\t\t// pokud nemam rovnou zadanou cenu zbozi, musim vytahnout data z kosiku\n\t\tif (!$total_price) {\n\t\t\t$total_price = $this->totalPrice();\n\t\t}\n\n\t\t$free = $total_price > $shipping['Shipping']['free'];\n\t\t\n\t\t// doprava je mozna zdarma vzdy jen pro GEIS platbu predem - ID 32, 35\n\t\t$manufacturer_free_shipping_ids = array(32, 35);\n\t\t$i = 0;\n\t\twhile (!$free && $i < count($manufacturer_free_shipping_ids)) {\n\t\t\t$manufacturer_free_shipping_id = $manufacturer_free_shipping_ids[$i];\n\t\t\t$free = $free || $this->CartsProduct->Product->OrderedProduct->Order->manufacturers_free_shipping($manufacturer_free_shipping_id);\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\tif (!$free) {\n\t\t\t$free = $free || $this->CartsProduct->Product->OrderedProduct->Order->cart_product_count_free_shipping($manufacturer_free_shipping_id);\n\t\t}\n\n\t\treturn $free;\n\t}",
"function plugin_republic_add_to_cart_validation( $passed, $product_id, $quantity, $variation_id=null ) {\n if( $_POST['mspp_addresses'] == \"\") {\n $passed = false;\n wc_add_notice( __( 'Select shipping address before adding to cart.', 'plugin-republic' ), 'error' );\n }\n return $passed;\n}",
"function my_custom_checkout_field_process() {\n if ( ! $_POST['pennsylvania_shipping'] )\n wc_add_notice( __( '<strong>Liquor Store Number</strong> is required' ), 'error' );\n}",
"function calculate_shipping( $package = array() ) {\n\n\t\tif( ! $this->pickup_coords ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$country = $package['destination']['country'];\n\t\t$city = trim( $package['destination']['city'] );\n\n\t\tif( 'cape town' == strtolower( $city ) ) {\n\t\t\t$customer_city = 'CPT';\n\t\t} elseif( 'johannesburg' == strtolower( $city ) ) {\n\t\t\t$customer_city = 'JHB';\n\t\t} else {\n\t\t\t$customer_city = '';\n\t\t}\n\n\t\tif( 'ZA' == $country && $customer_city == $this->city ) {\n\n\t\t\t$delivery_location = $this->get_customer_location( $package );\n\n\t\t\t$no_address_message = sprintf( __( '%1$sWe could not locate your address - please make sure it is correct to enable WumDrop courier delivery.%2$s', 'woocommerce-wumdrop' ), '<b>', '</b>' );\n\n\t\t\tif( ! $delivery_location ) {\n\t\t\t\t// wc_add_notice( $no_address_message, 'success' );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$street_address = $package['destination']['address'];\n\n\t\t\tif( ! isset( $street_address ) || empty( $street_address ) || stripos( $delivery_location['address'], $street_address ) === false ) {\n\t\t\t\twc_add_notice( $no_address_message, 'success' );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$delivery_cost = $this->get_delivery_cost( $this->pickup_coords, $delivery_location['location'], $customer_city, $package );\n\n\t\t\tif( $delivery_cost === false ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Display formatted delivery address for confirmation\n\t\t\t$notice = sprintf( __( 'Your address for WumDrop courier delivery is:%1$sIf this is not correct, please edit your address before placing your order.%2$s', 'woocommerce-wumdrop' ), '<br/><b>' . $delivery_location['address'] . '</b><br/><small><em>', '</em></small>' );\n\t\t\twc_add_notice( $notice, 'success' );\n\n\t\t\t$rate = array(\n\t\t\t\t'id' => $this->id . '_delivery',\n\t\t\t\t'label' => $this->title,\n\t\t\t\t'cost' => $delivery_cost,\n\t\t\t\t'taxes' => false\n\t\t\t);\n\n\t\t\t// Register the rate\n\t\t\t$this->add_rate( $rate );\n\n\t\t}\n\n\t}",
"private function setShippingInformation()\n {\n if ($this->_checkoutSession->getLastRealOrder()->getIsVirtual()) {\n $this->_paymentRequest->setShipping()->setAddressRequired()->withParameters('false');\n } else {\n $this->_paymentRequest->setShipping()->setAddressRequired()->withParameters('true');\n $shipping = $this->_checkoutSession->getLastRealOrder()->getShippingAddress();\n if ($shipping) {\n if (count($shipping->getStreet()) === 4) {\n $this->_paymentRequest->setShipping()->setAddress()->withParameters(\n $shipping->getStreetLine(1),\n $shipping->getStreetLine(2),\n $shipping->getStreetLine(4),\n \\UOL\\PagSeguro\\Helper\\Data::fixPostalCode($shipping->getPostcode()),\n $shipping->getCity(),\n $this->getRegionAbbreviation($shipping),\n $this->getCountryName($shipping['country_id']),\n $shipping->getStreetLine(3)\n );\n } else {\n $address = \\UOL\\PagSeguro\\Helper\\Data::addressConfig($shipping['street']);\n\n $this->_paymentRequest->setShipping()->setAddress()->withParameters(\n $this->getShippingAddress($address[0], $shipping),\n $this->getShippingAddress($address[1]),\n $this->getShippingAddress($address[3]),\n \\UOL\\PagSeguro\\Helper\\Data::fixPostalCode($shipping->getPostcode()),\n $shipping->getCity(),\n $this->getRegionAbbreviation($shipping),\n $this->getCountryName($shipping['country_id']),\n $this->getShippingAddress($address[2])\n );\n }\n\n $this->_paymentRequest->setShipping()->setType()\n ->withParameters(\\PagSeguro\\Enum\\Shipping\\Type::NOT_SPECIFIED); //Shipping Type\n $this->_paymentRequest->setShipping()->setCost()\n ->withParameters(number_format($this->getShippingAmount(), 2, '.', '')); //Shipping Coast\n }\n }\n }",
"public function validShippingAddress()\r\n {\r\n if (!$this->{'checkout.shipping_address.country'}\r\n || !$this->{'checkout.shipping_address.region'}\r\n //|| !$this->{'checkout.shipping_address.postal_code'} // TODO Only require this if the country requires it\r\n ) {\r\n return false;\r\n }\r\n \r\n return true;\r\n }",
"public function getOrderShippingCost($params, $shipping_cost)\n\t{\n\t\tif (!$this->active)\n\t\t\treturn false;\n\t\tif (!Configuration::get('TNT_CARRIER_LOGIN') || !Configuration::get('TNT_CARRIER_PASSWORD') || !Configuration::get('TNT_CARRIER_NUMBER_ACCOUNT'))\n\t\t\treturn false;\n\t\tif (!Configuration::get('TNT_CARRIER_SHIPPING_ADDRESS1') || !Configuration::get('TNT_CARRIER_SHIPPING_ZIPCODE') || !Configuration::get('TNT_CARRIER_SHIPPING_CITY'))\n\t\t\treturn false;\n\t\tif (!extension_loaded('soap'))\n\t\t\treturn false;\n\t\t\n\t\t$product = $params->getProducts();\n\t\t$weight = 0;\n\t\t$add = 0;\n\t\t$id_customer = $params->id_customer;\n\t\t$id_adress_delivery = $params->id_address_delivery;\n\t\t$info = Db::getInstance()->getRow('SELECT postcode, city, company FROM `'._DB_PREFIX_.'address` WHERE `id_address` = \"'.(int)($id_adress_delivery).'\"');\n\t\tforeach($product as $k => $v)\n\t\t\t$weight += (float)($v['weight'] * (int)$v['cart_quantity']);\n\t\t$serviceCache = new serviceCache($params->id, $info['postcode'], $info['city'], $info['company'], Configuration::get('TNT_CARRIER_SHIPPING_ZIPCODE'), Configuration::get('TNT_CARRIER_SHIPPING_CITY'));\n\t\t$serviceCache->clean();\n\n\t\tif (!$serviceCache->getFaisabilityAtThisTime())\n\t\t{\n\t\t\t$serviceCache->deletePreviousServices();\n\t\t\t$tntWebService = new TntWebService();\n\t\t\t$typeDestinataire = array();\n\t\t\t$typeDestinataire[] = 'INDIVIDUAL';\n\t\t\t$typeDestinataire[] = 'DROPOFFPOINT';\n\t\t\tif ($info['company'] != '')\n\t\t\t\t$typeDestinataire[] = 'ENTERPRISE';\n\n\t\t\t$faisability = $tntWebService->getFaisability($typeDestinataire, $info['postcode'], $this->putCityInNormeTnt($info['city']), date(\"Y-m-d\", strtotime(\"now\")));//\"2012-05-02\");\n\t\t\tif (!is_array($faisability) && strrpos($faisability, \"(zip code / city)\") === 0)\n\t\t\t\t$serviceCache->errorCodePostal();\n\t\t\telse if (is_array($faisability))\n\t\t\t\t$serviceCache->putInCache($faisability);\n\t\t\tif ($faisability == null)\n\t\t\t\treturn false;\n\t\t}\n\t\t$service = $serviceCache->getServices();\n\t\tif ($service != NULL)\n\t\t\tforeach ($service as $v)\n\t\t\t{\n\t\t\t\tif (Configuration::get('TNT_CARRIER_'.pSQL($v['code']).'_ID'))\n\t\t\t\t{\n\t\t\t\t\tif (Configuration::get('TNT_CARRIER_'.pSQL($v['code']).'_ID') == $this->id_carrier)\n\t\t\t\t\t\t$priceCarrier = Configuration::get('TNT_CARRIER_'.pSQL($v['code']).'_OVERCOST');\n\t\t\t\t}\n\t\t\t\telse if (Configuration::get('TNT_CARRIER_'.substr(pSQL($v['code']), 0, 2).'_ID'))\n\t\t\t\t\tif (Configuration::get('TNT_CARRIER_'.substr(pSQL($v['code']), 0, 2).'_ID') == $this->id_carrier)\n\t\t\t\t\t\t$priceCarrier = Configuration::get('TNT_CARRIER_'.substr(pSQL($v['code']), 0, 2).'_OVERCOST');\n\t\t\t}\n\t\t$zero = 0;\n\t\t$weightLimit = Db::getInstance()->getRow('SELECT additionnal_charges FROM `'._DB_PREFIX_.'tnt_carrier_weight` WHERE `weight_min` < \"'.(float)($weight).'\" AND (`weight_max` > \"'.(float)($weight).'\" OR `weight_max` = \"'.(float)$zero.'\")');\n\t\t$currency = Db::getInstance()->getRow('SELECT conversion_rate FROM `'._DB_PREFIX_.'currency` WHERE `id_currency` = \"'.(int)($params->id_currency).'\"');\n\t\tif ($weightLimit != null)\n\t\t\t$add += (float)($weightLimit['additionnal_charges']);\n\t\tif (substr($info['postcode'], 0, 2) == \"20\")\n\t\t\t$add += (float)(Configuration::get('TNT_CARRIER_CORSE_OVERCOST'));\n\t\tif (isset($priceCarrier))\n\t\t\treturn ((($priceCarrier + $add) * $currency['conversion_rate']) + $shipping_cost);\n\t\treturn false;\n\t}",
"public function process_free_checkout()\n {\n //checkout data\n $checkout_data = Session::get('checkout_data');\n //ship data\n $ship_data = Session::get('order_ship');\n\n //send products via mail\n PaymentController::send_order_products_to_mailbox($ship_data, $checkout_data);\n\n //save order info\n $order_id = PaymentController::save_free_order_info($ship_data, $checkout_data);\n\n PaymentController::save_order_ship_info($order_id, $checkout_data, $ship_data);\n\n Session::put('checkout_success', true);\n\n return Redirect::to('checkout_success');\n }",
"function checkout(Request $request)\n {\n $valid = false;\n\n $delivery_type = session(\"delivery_type\");\n //$shipping_cost = session(\"shipping_cost\");\n //echo $shipping_cost;\n $final_total = session(\"final_total\");\n $coureer = session(\"coureer\");\n $user_address = session(\"user_address\");\n \n if(!empty($delivery_type) && \n !empty($final_total) && !empty($coureer) && \n !empty($user_address)){\n $valid = true;\n }\n\n // check destination , coureer , delivery type terpilih atau tidak\n if(!empty(Cart::content()) && $valid)\n {\n // INSERT KE Order_tbl\n $order_id = $this->insert($request); \n\n //redirect()->to(\"memberarea\")->send();\n $user = Auth::guard(\"user\")->user();\n\n $objDemo = new \\stdClass();\n /* $objDemo->demo_one = 'Demo One Value';\n $objDemo->demo_two = 'Demo Two Value';\n $objDemo->sender = 'SenderUserName';\n $objDemo->receiver = 'ReceiverUserName';*/\n // send email \n Mail::to([$user->email])->send(new OrderEmail($objDemo));\n // clear cart \n Cart::destroy();\n\n session()->forget('voucher_code');\n session()->forget('voucher_nominal');\n session()->forget('voucher_type');\n session()->forget(\"total_weight\");\n session()->forget(\"shipping_cost\");\n session()->forget(\"final_total\");\n session()->forget(\"user_address\");\n\n // hapus semua bentuk session\n //$request->session()->flush();\n\n // untuk sementara redirect ke memberarea\n //redirect()->to(\"memberarea\")->send();\n return redirect(\"detail_order/$order_id\");\n //echo \"success\";\n }\n else\n {\n $err_text = \"\";\n if(empty($user_address)){\n $err_text .= \" You must choose User Address ,\";\n }\n if(empty($delivery_type)){\n $err_text .= \" You must choose Type of Delivery ,\";\n }\n if(empty($coureer)){\n $err_text .= \" You must choose Coureer ,\";\n }\n if(empty(Cart::content())){\n $err_text .= \" You must choose the Product ,\";\n }\n \n //echo \"error\";\n // untuk sementara redirect ke cart\n $err_el = \" $err_text \";\n return redirect(\"shipping\")->with(\"msg_shipping\",$err_el);\n //return abort(404);\n }\n \n }",
"public function shippingMethodAction(Request $request){\n $user = $this->get('security.token_storage')->getToken()->getUser();\n $error=false;\n $em = $this->getDoctrine()->getManager();\n $cart = $em->getRepository('AppBundle:Cart')\n ->findMyCart($user);\n\n $form = $this->createForm(ShippingModeForm::class);\n\n //only handles data on POST\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n $airport = $form['airport']->getData();\n $airline = $form['airline']->getData();\n\n $em = $this->getDoctrine()->getManager();\n\n //Get the Applicable Rates table\n $shippingRate = $em->getRepository(\"AppBundle:ShippingRate\")\n ->findOneBy([\n 'airline'=>$airline,\n 'airport'=>$airport\n ]);\n if (!$shippingRate){\n $error=true;\n return $this->render('grower/checkout/shipping-method.htm.twig', [\n 'growerCheckoutForm' => $form->createView(),\n 'cart' => $cart[0],\n 'error'=>$error\n ]);\n }\n\n\n $this->container->get('session')->set('airline', $airline->getId());\n $this->container->get('session')->set('airport', $airport->getId());\n\n //var_dump($shippingRate);exit;\n $cartTotal=$cart[0]->getCartTotal();\n $cartWeight = $cart[0]->getCartWeight();\n\n $shippingCost = $this->calculateShipping($cartWeight,$shippingRate);\n $shippingCost = $this->container->get('crysoft.currency_converter')->convertAmount($shippingCost,'USD',$user->getMyCompany()->getCurrency());\n\n $cart[0]->setShippingCost($shippingCost);\n $cartTotal+=$shippingCost;\n $cart[0]->setCartTotal($cartTotal);\n $em->persist($cart[0]);\n $em->flush();\n return $this->redirectToRoute('confirm-order');\n\n }\n\n return $this->render('grower/checkout/shipping-method.htm.twig', [\n 'growerCheckoutForm' => $form->createView(),\n 'cart' => $cart[0],\n 'error'=>$error\n ]);\n }",
"public function isShipping();",
"public static function shippingFees()\n {\n return Format::price(self::shippingPrice()) . config('cart.currency');\n }",
"public function calculate_shipping( $package = array() ) { \n try{\n $request = $this->lalamove->request($this->lalamove_apikey, $this->lalamove_secret, $this->lalmove_mode, $this->lalamove_stoername, $this->lalamove_phone);\n if(!$request) {\n if( ! wc_has_notice( 'Calculate shipping - couldn\\'t connect to lalamove api', 'notice' ) ) {\n wc_add_notice( 'Calculate shipping - couldn\\'t connect to lalamove api', 'notice' );\n }\n return;\n }\n $date = new DateTime();\n $scheduleAt = $date->format('Y-m-d\\TH:i:s.00\\Z');\n $qbody = $this->lalamove->get_quotation_body($scheduleAt, $package);\n $response = $request->quotation($qbody);\n if(!$response) {\n wc_add_notice( 'no value response'.$response, 'notice' );\n return;\n }\n ob_start();\n echo '<pre>';\n print_r($qbody);\n echo '</pre>';\n $output = ob_get_contents();\n ob_end_clean();\n $code = json_decode($response['code']);\n $res = json_decode($response['body']);\n if($code != '200'){\n wc_add_notice($request->showmsg($res->message).$res->message.$code.$output , 'notice' );\n return;\n }\n else {\n $_SESSION['order_cost'] = $res->totalFee;\n $this->add_rate(\n array(\n 'label' => $this->title,\n 'cost' => $res->totalFee,\n 'taxes' => false,\n 'package' => $package,\n )\n );\n }\n }\n catch(Exception $e) {\n wc_add_notice($e->getMessage(), 'errorrrr');\n } \n }",
"public function testGetFDeliveryCostsIfNotSet()\n {\n $oBasket = $this->getProxyClass( \"oxBasket\" );\n $this->assertFalse( $oBasket->getFDeliveryCosts() );\n }",
"public function create_check_debit() {\n\n\t\t$this->request_data = array(\n\t\t\t'method' => 'tele_check',\n\t\t\t'transaction_type' => 'purchase',\n\t\t\t'amount' => round( floatval( $this->get_order()->payment_total ) * 100 ), // cents\n\t\t\t'currency_code' => SV_WC_Order_Compatibility::get_prop( $this->get_order(), 'currency', 'view' ),\n\t\t\t'tele_check' => array(\n\t\t\t\t'check_number' => $this->get_order()->payment->check_number,\n\t\t\t\t'check_type' => $this->get_order()->payment->check_type,\n\t\t\t\t'routing_number' => $this->get_order()->payment->routing_number,\n\t\t\t\t'account_number' => $this->get_order()->payment->account_number,\n\t\t\t\t'customer_id_number' => str_replace( array( '-', ' ' ), '', $this->get_order()->payment->customer_id_number ),\n\t\t\t\t'customer_id_type' => $this->get_order()->payment->customer_id_type,\n\t\t\t\t'accountholder_name' => trim( $this->get_order()->get_formatted_billing_full_name() ),\n\t\t\t\t'client_email' => SV_WC_Order_Compatibility::get_prop( $this->get_order(), 'billing_email' ),\n\t\t\t),\n\t\t\t'billing_address' => array(\n\t\t\t\t'street' => trim( SV_WC_Order_Compatibility::get_prop( $this->get_order(), 'billing_address_1' ) . ' ' . SV_WC_Order_Compatibility::get_prop( $this->get_order(), 'billing_address_2' ) ),\n\t\t\t\t'city' => SV_WC_Order_Compatibility::get_prop( $this->get_order(), 'billing_city' ),\n\t\t\t\t'state_province' => SV_WC_Helper::str_truncate( SV_WC_Order_Compatibility::get_prop( $this->get_order(), 'billing_state' ), 2 ),\n\t\t\t\t'zip_postal_code' => SV_WC_Helper::str_truncate( SV_WC_Order_Compatibility::get_prop( $this->get_order(), 'billing_postcode' ), 5 ),\n\t\t\t\t'country' => SV_WC_Helper::str_truncate( SV_WC_Order_Compatibility::get_prop( $this->get_order(), 'billing_country' ), 2 ),\n\t\t\t),\n\t\t);\n\t}",
"public function shipping_method_validation() {\n\t\t\t\n $this->session->keep_flashdata('redirectURL');\n\t\t\t\n $this->load->library('form_validation');\n\t\t\t\n\t\t$this->form_validation->set_error_delimiters('<div class=\"alert alert-danger text-danger text-center\"><i class=\"fa fa-exclamation-triangle\" aria-hidden=\"true\"></i> ', '</div>');\n\t\t\t\n\t\t$this->form_validation->set_rules('shipping','Shipping','required|trim|xss_clean');\n \n\t\t\t\n $this->form_validation->set_message('required', '%s cannot be blank!');\n\t\t\t\t\t\n\t\tif ($this->form_validation->run()){\n\t\t\t\n\t\t\t$shipping_details = explode('-',$this->input->post('shipping'));\n\t\t\t\n\t\t\t//get shipping type, domestic or international\n\t\t\t$shipping_type = $shipping_details[0];\n\t\t\t\n\t\t\t//get shipping company name\n\t\t\t$shipping_company = $shipping_details[1];\n\t\t\t\n\t\t\t//get unit shipping cost\n\t\t\t$shipping_costs = $shipping_details[2];\n\t\t\t\n\t\t\t//count items in cart\n\t\t\t$cart_count = count($_SESSION[\"cart_array\"]);\n\t\t\t\n\t\t\t//get additional items shipping costs\n\t\t\t//as a fraction of initial shipping cost\n\t\t\t$additional_items_unit_cost = $shipping_costs / 2;\n\t\t\t\n\t\t\t//count additional items\n\t\t\t$additional_items_count = $cart_count - 1;\n\t\t\t\n\t\t\t//get additional items cost\n\t\t\t$total_additional_items_cost = $additional_items_unit_cost * $additional_items_count;\n\t\t\t\n\t\t\t//calculate total shipping cost\n\t\t\t$total_shipping_costs = $shipping_costs + $total_additional_items_cost;\n\t\t\t/*\n\t\t\t$session = array(\n\t\t\t\t'shipping_type' => $shipping_type,\n\t\t\t\t'shipping_company' => $shipping_company,\n\t\t\t\t'shipping_costs' => $shipping_costs,\n\t\t\t\t'total_shipping_costs' => $total_shipping_costs,\n\t\t\t\t'shipping_method' => 1,\n\t\t\t);\n\t\t\t*/\n\t\t\t//$this->session->set_userdata($session);\n\t\t\t\n\t\t\t\n\t\t\t// SET SHIPPING SESSION\n\t\t\t$_SESSION[\"shipping_array\"] = array(\n\t\t\t\t0 => array(\n\t\t\t\t\t\"shipping_type\" => $shipping_type, \n\t\t\t\t\t\"shipping_company\" => $shipping_company, \n\t\t\t\t\t\"shipping_costs\" => $shipping_costs,\n\t\t\t\t\t\"total_shipping_costs\" => $total_shipping_costs,\n\t\t\t\t\t\"shipping_method\" => 1,\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\t\n\t\t\t$data['success'] = true;\n\t\t\t$data['previous_step'] = $this->input->post('previous_step');\n\t\t\t$data['step'] = $this->input->post('step');\n\t\t\t//redirect to next page\n\t\t\t//redirect('checkout/shipping-method');\n\t\t\t\t\n }else {\t\t\n\t\t\t//redirects to contact information page\n\t\t\t//$this->contact_information();\t\n\t\t\t$data['success'] = false;\n\t\t\t$data['notif'] = '<div class=\"text-center floating-alert-box\" role=\"alert\">'.validation_errors().'</div>';\n }\n\t\t\t\n\t\t\t// Encode the data into JSON\n\t\t\t$this->output->set_content_type('application/json');\n\t\t\t$data = json_encode($data);\n\n\t\t\t// Send the data back to the client\n\t\t\t$this->output->set_output($data);\n\t\t\t//echo json_encode($data);\t\t\n }",
"public function testGetFDeliveryCosts()\n {\n modConfig::getInstance()->setConfigParam( 'blCalculateDelCostIfNotLoggedIn', true );\n $oPrice = $this->getMock( 'oxprice', array( 'getBruttoPrice' ) );\n $oPrice->expects( $this->any() )->method( 'getBruttoPrice' )->will( $this->returnValue( 11.588 ) );\n $oBasket = $this->getProxyClass( \"oxBasket\" );\n $oBasket->setNonPublicVar('_aCosts', array ( \"oxdelivery\" => $oPrice ) );\n $this->assertEquals( \"11,59\", $oBasket->getFDeliveryCosts() );\n }",
"protected function validateDeliveryOption($delivery_option)\n {\n }",
"function _validateMultiple() {\n\t\t\t$helper = Mage::helper( 'sales' );\n\t\t\t$quote = $this->getQuote( );\n\n\t\t\tif (!$quote->isVirtual( )) {\n\t\t\t\t$address = $quote->getShippingAddress( );\n\t\t\t\t$addressValidation = $address->validate( );\n\n\t\t\t\tif ($addressValidation !== true) {\n\t\t\t\t\tMage::throwException( $helper->__( 'Please check shipping address information. %s', implode( ' ', $addressValidation ) ) );\n\t\t\t\t}\n\n\t\t\t\tforeach ($quote->getAllShippingAddresses( ) as $address) {\n\n\t\t\t\t\tif ($address->isVirtual( )) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$method = $address->getShippingMethod( );\n\t\t\t\t\t$rate = $address->getShippingRateByCode( $method );\n\n\t\t\t\t\tif (( !$quote->isVirtual( ) && ( !$method || !$rate ) )) {\n\t\t\t\t\t\tMage::throwException( $helper->__( 'Please specify a shipping method for %s warehouse.', $address->getWarehouseTitle( ) ) );\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$addressValidation = $quote->getBillingAddress( )->validate( );\n\n\t\t\tif ($addressValidation !== true) {\n\t\t\t\tMage::throwException( $helper->__( 'Please check billing address information. %s', implode( ' ', $addressValidation ) ) );\n\t\t\t}\n\n\n\t\t\tif (!$quote->getPayment( )->getMethod( )) {\n\t\t\t\tMage::throwException( $helper->__( 'Please select a valid payment method.' ) );\n\t\t\t}\n\n\t\t\treturn $this;\n\t\t}",
"public function checkIfAccountHasFloat()\n {\n try\n {\n if( $this->getBillingType() != 'postpaid')\n {\n if ( $this->getBillingRate() >= OrganizationsFloat::where('org_id', '=', $this->getOrganizationID($this->request))->value('available_balance') )\n {\n Log::info(\"Insufficient Account Float For Request: \" . json_encode($this->request));\n\n exit(\"Insufficient Account Float\");\n }\n }\n }\n catch(Exception $exc)\n {\n Log::error($exc);\n } \n\n }",
"public function handleShipping() { \n $error = array('status' => false);\n $model = new ShippingInfoForm();\n $model->setAttributeByDefault();\n\n $creditCardModel = new CreditCardForm;\n\n if (isset($_POST['ShippingInfoForm'])) {\n $model->attributes = $_POST['ShippingInfoForm'];\n\n if ($model->validate()) {\n $shipping_id = UserProfile::model()->saveShippingInfo($_POST['ShippingInfoForm']);\n Yii::app()->session['shipping_id'] = $shipping_id; \n $this->redirect($this->createUrl(\"/web/payment/placeOrder\"));\n }\n }\n \n $shipping_country_name = \"\";\n // getting shipping country name on behalf of country_id(region id) to disable the Cash On Delivery option for international customers\n $shipping_country_name = Region::model()->getRegionName($model->shipping_country);\n \n $criteria = new CDbCriteria;\n if ($country_list = Cart::model()->getCartCountryList()) {\n\n $criteria->addInCondition(\"name\", $country_list);\n }\n $criteria->order = \"name ASC\";\n $regionList = CHtml::listData(Region::model()->findAll($criteria), 'id', 'name');\n $this->render('//payment/payment_method', array(\n 'model' => $model,\n 'regionList' => $regionList,\n 'creditCardModel' => $creditCardModel,\n 'country_name' => $shipping_country_name,\n 'error' => $error\n ));\n }",
"public function checkoutfinalpickup(Request $request){\n\n $cust_id = Auth::user()->Cust_ID;\n $fname = $request->input('finalCustomer_FName');\n $mname = $request->input('finalCustomer_MName');\n $lname = $request->input('finalCustomer_LName');\n $contact = $request->input('finalCustomer_Number');\n $email = Auth::user()->email;\n $status = \"PENDING\";\n $type = \"online\";\n\n //dd($request->finalPickup_Date);\n\n $sales_order = new sales_order([\n 'customer_ID' => $cust_id,\n 'Customer_Fname' => $fname,\n 'Customer_Mname' => $mname,\n 'Customer_Lname' => $lname,\n 'Contact_Num' => $contact,\n 'email_Address' => $email,\n 'Status' => $status,\n 'Type' => $type,\n ]);\n\n $sales_order -> save();\n\n $sales_order_ID = $sales_order->sales_order_ID;\n\n foreach(Cart::instance('flowerwish')->content() as $row){\n\n $salesflower = new sales_order_flowers([\n 'Sales_Order_ID' => $sales_order_ID,\n 'Flower_ID' => $row->id,\n 'QTY' => $row->qty,\n 'Unit_Price' => $row->price,\n 'Total_Amt' => $row->options->T_Amt,\n ]);\n $salesflower->save();\n }\n\n $customer_ID = $request->input('customer_ID');\n $recipientfname = $request->input('finalCustomer_FName');\n $recipientmname = $request->input('finalCustomer_MName');\n $recipientlname = $request->input('finalCustomer_LName');\n $paymentmethod = $request->input('final_paymentMethod');\n $orderdetailstatus = \"PENDING\";\n $orderdetailmethod = $request->input('final_shippingMethod');\n $orderdetailcontact = $request->input('finalCustomer_Number');\n $amount = (str_replace(array(','), array(''), Cart::instance('finalboqcart')->subtotal()) + str_replace(array(','), array(''),\n Cart::instance('flowerwish')->subtotal()) );\n $vat = ($amount * .12);\n $orderdetails = new order_details([\n 'Order_ID' => $sales_order_ID,\n 'Customer_ID' => $cust_id,\n 'Recipient_Fname' => $recipientfname,\n 'Recipient_Mname' => $recipientmname,\n 'Recipient_Lname' => $recipientlname,\n 'Status' => $orderdetailstatus,\n 'Payment_Mode' => $paymentmethod,\n 'Subtotal' => $amount ,\n 'Delivery_Charge' => \"0\",\n 'Total_Amt' => $amount + $vat + 0,\n 'email_Addresss' => $email,\n 'Contact_Num' => $orderdetailcontact,\n 'shipping_method' => $orderdetailmethod,\n 'VAT' => $vat,\n 'BALANCE'=> $amount + $vat + 0,\n ]);\n\n $orderdetails->save();\n $lastid = $orderdetails->id;\n\n $deliverydate = date('Y-m-d',strtotime($request->finalPickup_Date));\n $deliverytime = date('Y-m-d',strtotime($request ->finalPickup_Date)).\" \".date('H:i:s', strtotime($request->input('finalPickup_Time')));\n $Scheduletype = $request->input('final_shippingMethod');\n $schedulestatus = \"PENDING\";\n\n $shop_schedule = new shop_schedule([\n 'Order_ID' => $sales_order_ID,\n 'Customer_fname'=>$recipientfname,\n 'Customer_lname'=>$recipientlname,\n 'Date_of_Event' => $deliverydate,\n 'Time' => $deliverytime,\n 'Schedule_Type' => $Scheduletype,\n 'shedule_status' => \"P\",\n ]);\n\n $shop_schedule -> save();\n\n if(Cart::instance('finalboqcart')->count() == 0){\n\n Cart::instance('flowerwish')->destroy();\n Cart::instance('finalboqcart')->destroy();\n Cart::instance('finalacccart')->destroy();\n Cart::instance('finalflowerbqt')->destroy();\n\n\n Session::put('orderid', $sales_order_ID);\n Return redirect() -> route('geteditaccount');\n\n }\n else{\n $validator = 0;\n $validator2 = 0;\n $bouquets = DB::table('bouquet_details')->get();\n $bouquetsF = DB::table('bouquet_flowers')->get();\n $bouquetsA = DB::table('bouquet_acessories')->get();\n $bouquetsSOF = DB::table('sales_order_bouquet_flowers')->get();\n $bouquetsSOA = DB::table('sales_order_acessories')->get();\n\n foreach(Cart::instance('finalboqcart')->content() as $row1){\n $validator = 0;\n\n foreach($bouquets as $bqt){\n if($row1->id == $bqt->bouquet_ID){\n //nageexist na\n $validator = 1;\n break;\n }\n }//end of looking for existing bqt\n\n if($validator == 1)\n {\n $salesboquet = new sales_order_bouquet([\n 'Order_ID' => $sales_order_ID,\n 'Bqt_ID' => $row1->id,\n 'Unit_Price' => $row1->price,\n 'QTY' => $row1->qty,\n 'Amt' => $row1->qty * $row1->price,\n ]);\n $salesboquet->save();\n foreach(Cart::instance('finalflowerbqt')->content() as $row1_1)\n {\n if($row1_1->options->Bqt_ID == $row1->id)\n {\n foreach($bouquetsF as $bouquetsF2)\n {\n if($bouquetsF2->bouquet_ID == $row1_1->options->Bqt_ID\n and $bouquetsF2->flower_id == $row1_1->id)\n {\n $flowerexistence = 0;\n foreach($bouquetsSOF as $bouquetsSOF2)\n {\n if($bouquetsSOF2->Order_ID == $sales_order_ID\n and $bouquetsSOF2->Bqt_ID == $row1_1->options->Bqt_ID\n and $bouquetsSOF2->Flower_ID == $row1_1->id\n and $row1_1->options->Bqt_ID == $row1->id)\n {\n $flowerexistence = 1;\n break;\n }\n }\n if($flowerexistence == 0)\n {\n $salesbouquetflower = new sales_order_bouquet_flowers([\n 'Order_ID' => $sales_order_ID,\n 'Bqt_ID' => $row1->id,\n 'Flower_ID' => $row1_1->id,\n 'Price' => $row1_1->price,\n 'QTY' => $row1_1->qty,\n 'Total_Amt' => $row1_1->qty * $row1_1->price,\n ]);\n $salesbouquetflower->save();\n }\n }\n }//search for existing flowers for the specific bqt\n }\n }//\n foreach(Cart::instance('finalacccart')->content() as $row1_2)\n {\n if($row1_2->options->Bqt_ID == $row1->id)\n {\n foreach($bouquetsA as $bouquetsA2)\n {\n if($bouquetsA2->bouquet_ID == $row1_2->options->Bqt_ID\n and $bouquetsA2->acessory_ID == $row1_2->id)\n {\n $acrsExistence = 0;\n foreach($bouquetsSOA as $bouquetsSOA2)\n {\n if($bouquetsSOA2->Order_ID == $sales_order_ID\n and $bouquetsSOA2->BQT_ID == $row1_2->options->Bqt_ID\n and $bouquetsSOA2->Acessories_ID == $row1_2->id\n and $row1_2->options->Bqt_ID == $row1->id)\n {\n $acrsExistence = 1;\n break;\n }\n }\n if($acrsExistence == 0)\n {\n $salesbouquetacc = new sales_order_acessories([\n 'Order_ID' => $sales_order_ID,\n 'BQT_ID' => $row1->id,\n 'Acessories_ID' => $row1_2->id,\n 'Price' => $row1_2->price,\n 'QTY' => $row1_2->qty,\n 'Amt' => $row1_2->qty * $row1_2->price,\n ]);\n $salesbouquetacc->save();\n }\n }\n }\n }\n }\n }\n\n\n//-------------------------------------------------------------------------------------------------\n else if($validator != 1)\n {\n //create a new Bouquet\n $bouquet_details = new bouquet_details([\n 'price' => $row1->price,\n 'count_ofFlowers' => $row1->options->count,\n 'Type' => \"custom\",\n 'Order_ID' => $sales_order_ID,\n ]);\n\n $bouquet_details->save();\n $Newbouquet_ID = $bouquet_details->bouquet_ID;\n\n\n foreach(Cart::instance('finalflowerbqt')->content() as $row2)\n {\n if($row2->options->Bqt_ID == $row1->id)\n {\n foreach($bouquetsF as $bouquetsF2_2_1)\n {\n $ExistingBqtFlwr = 0;\n //echo $bouquetsF2_2_1->bouquet_ID.\"|\".$Newbouquet_ID.\"|\".$bouquetsF2_2_1->flower_id.\"|\".$row2->id.\"--------\\n\";\n if($bouquetsF2_2_1->bouquet_ID == $bouquet_details->bouquet_ID\n AND $bouquetsF2_2_1->flower_id == $row2->id){\n $ExistingBqtFlwr = 1;\n break;\n }\n }\n if($ExistingBqtFlwr == 0){\n $bouquet_flowers = new bouquet_flowers([\n 'bouquet_ID' => $Newbouquet_ID,\n 'flower_id' => $row2->id,\n 'qty' => $row2->qty,\n ]);\n\n $bouquet_flowers->save();\n }\n }\n//---------------------------------------------------------------------------------------------------------------------------------\n }\n\n\n foreach(Cart::instance('finalacccart')->content() as $row3)\n {\n if($row3->options->Bqt_ID == $row1->id)\n {\n foreach($bouquetsA as $bouquetsA2_1_2_1)\n {\n $ExistingBqtAcrs = 0;\n if($bouquetsA2_1_2_1->bouquet_ID == $bouquet_details->bouquet_ID\n AND $bouquetsA2_1_2_1->acessory_ID == $row3->id)\n {\n $ExistingBqtAcrs = 1;\n break;\n }\n }\n if($ExistingBqtAcrs == 0)\n {\n $bouquet_accessories = new bouquet_acessories([\n 'bouquet_ID' => $Newbouquet_ID,\n 'acessory_ID' => $row3->id,\n 'qty' => $row3->qty,\n ]);\n $bouquet_accessories->save();\n }\n }\n }\n\n $bouquetsF = DB::table('bouquet_flowers')->get();\n $bouquetsA = DB::table('bouquet_acessories')->get();\n $bouquetsSOF = DB::table('sales_order_bouquet_flowers')->get();\n $bouquetsSOA = DB::table('sales_order_acessories')->get();\n\n\n // foreach(Cart::instance('finalboqcart')->content() as $row4){\n\n //if($row4->id == $row1->id){\n $salesboquet = new sales_order_bouquet([\n 'Order_ID' => $sales_order_ID,\n 'Bqt_ID' => $Newbouquet_ID,\n 'Unit_Price' => $row1->price,\n 'QTY' => $row1->qty,\n 'Amt' => $row1->qty * $row1->price,\n ]);\n\n $salesboquet->save();\n //}\n //}\n\n\n\n foreach(Cart::instance('finalflowerbqt')->content() as $row1_1_2)\n {\n if($row1_1_2->options->Bqt_ID == $row1->id)\n {\n //dd($row1_1_2->options->Bqt_ID,$row1->id);\n foreach($bouquetsF as $bouquetsF2_2)\n {\n if($bouquetsF2_2->bouquet_ID == $bouquet_details->bouquet_ID\n and $bouquetsF2_2->flower_id == $row1_1_2->id)\n {\n //dd($bouquetsF2_2->bouquet_ID,$bouquet_details->bouquet_ID,$bouquetsF2_2->flower_id,$row1_1_2->id);\n $salesbouquetflower = new sales_order_bouquet_flowers([\n 'Order_ID' => $sales_order_ID,\n 'Bqt_ID' => $Newbouquet_ID,\n 'Flower_ID' => $row1_1_2->id,\n 'Price' => $row1_1_2->price,\n 'QTY' => $row1_1_2->qty,\n 'Total_Amt' => $row1_1_2->qty * $row1_1_2->price,\n ]);\n $salesbouquetflower->save();\n }\n }//search for existing flowers for the specific bqt\n }\n }//\n foreach(Cart::instance('finalacccart')->content() as $row1_2_2)\n {\n if($row1_2_2->options->Bqt_ID == $row1->id)\n {\n foreach($bouquetsA as $bouquetsA2_2)\n {\n if($bouquetsA2_2->bouquet_ID == $bouquet_details->bouquet_ID\n and $bouquetsA2_2->acessory_ID == $row1_2_2->id)\n {\n $salesbouquetacc = new sales_order_acessories([\n 'Order_ID' => $sales_order_ID,\n 'BQT_ID' => $Newbouquet_ID,\n 'Acessories_ID' => $row1_2_2->id,\n 'Price' => $row1_2_2->price,\n 'QTY' => $row1_2_2->qty,\n 'Amt' => $row1_2_2->qty * $row1_2_2->price,\n ]);\n $salesbouquetacc->save();\n }\n }\n }\n }//\n }\n }\n\n Cart::instance('flowerwish')->destroy();\n Cart::instance('finalboqcart')->destroy();\n Cart::instance('finalacccart')->destroy();\n Cart::instance('finalflowerbqt')->destroy();\n\n Session::put('orderid', $sales_order_ID);\n Return redirect() -> route('geteditaccount');\n\n }\n }",
"public static function isActivatedByFreemius(){\r\n \r\n\t\tglobal $unl_fs;\r\n\t\t\r\n if(isset($unl_fs) == false)\r\n \treturn(false);\r\n \t\r\n $isActivated = $unl_fs->is_paying();\r\n \t\r\n return($isActivated);\r\n\t}",
"function calculate_shipping_cost() {\n // via teleportation, shipping is fixed\n return 20.00;\n}",
"public function hasFee(){\n return $this->_has(16);\n }"
] | [
"0.65262103",
"0.6446199",
"0.62748593",
"0.62558967",
"0.6229285",
"0.620169",
"0.59690785",
"0.5923004",
"0.5908369",
"0.5868264",
"0.58657753",
"0.5855358",
"0.58522403",
"0.5813242",
"0.57948685",
"0.57623947",
"0.5746258",
"0.57410383",
"0.56967777",
"0.5684111",
"0.5675483",
"0.5660783",
"0.5643011",
"0.5622534",
"0.5610569",
"0.5607349",
"0.5603446",
"0.5580771",
"0.5568949",
"0.554178"
] | 0.7213987 | 0 |
Extract colors from a CSS or Sass file | function get_colors( $path ) {
$dir = get_stylesheet_directory();
if ( file_exists( $dir . $path ) ) {
$css_vars = file_get_contents( $dir . $path ); // phpcs:ignore WordPress.WP.AlternativeFunctions
preg_match_all( ' /#([a-f]|[A-F]|[0-9]){3}(([a-f]|[A-F]|[0-9]){3})?\b/', $css_vars, $matches );
return $matches[0];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function custom_colors_get_sass() {\n\t\tinclude_once( ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php' );\n\t\tinclude_once( ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php' );\n\n\t\tif ( ! class_exists( 'WP_Filesystem_Direct' ) )\n\t\t\treturn false;\n\n\t\t$wp_filesystem = new WP_Filesystem_Direct( null );\n\t\t$sass = $wp_filesystem->get_contents( get_template_directory() . '/css/colors.scss' );\n\t\tunset( $wp_filesystem );\n\n\t\t// This is slower, but okay since the results will be cached indefinitely.\n\t\tif ( empty( $sass ) ) {\n\t\t\t$request = wp_remote_get( get_template_directory_uri() . '/css/colors.scss' );\n\t\t\t$sass = wp_remote_retrieve_body( $request );\n\t\t}\n\n\t\treturn $sass;\n\t}",
"protected function findColors($cssFile) {\n\t\t$data = $this->cssPrepare(file_get_contents($cssFile));\n\n\t\t/* read line-by-line */\n\t\t$lines = preg_split('/\\n/', $data, false, PREG_SPLIT_NO_EMPTY);\n\n\t\tforeach ($lines as $line) {\n\t\t\t@preg_match('/^(.*)\\{(.*)\\}$/', $line, $matches);\n\t\t\tif ($matches && count($matches) == 3) {\n\t\t\t\t$className = $matches[1];\n\t\t\t\t$styles = preg_split('/\\;/', $matches[2], false, PREG_SPLIT_NO_EMPTY);\n\n\t\t\t\tif ($styles) {\n\t\t\t\t\tforeach ($styles as $declaration) {\n\t\t\t\t\t\t$parts = preg_split('/\\:/', $declaration, 2);\n\t\t\t\t\t\tif (count($parts) == 2) {\n\t\t\t\t\t\t\t$property = trim($parts[0]);\n\t\t\t\t\t\t\t$value = trim($parts[1]);\n\t\t\t\t\t\t\t/* Hex colors */\n\t\t\t\t\t\t\tif (preg_match_all('/(#[a-f0-9]{3,6})/i', $value, $colorMatch)) {\n\t\t\t\t\t\t\t\tfor ($x = 0; $x < count($colorMatch[0]); $x++) {\n\t\t\t\t\t\t\t\t\t$matchLength = strlen($colorMatch[1][$x]);\n\t\t\t\t\t\t\t\t\tif ($matchLength == 7 || $matchLength == 4) {\n\t\t\t\t\t\t\t\t\t\tif ($matchLength == 4)\n\t\t\t\t\t\t\t\t\t\t\t$colorMatch[0][$x] = $colorMatch[0][$x].str_replace('#', '', $colorMatch[0][$x]);\n\t\t\t\t\t\t\t\t\t\t$this->addToMatchResults(\n\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t'color' => strtolower($colorMatch[0][$x]),\n\t\t\t\t\t\t\t\t\t\t\t\t'stylesheet' => $cssFile,\n\t\t\t\t\t\t\t\t\t\t\t\t'class' => $className,\n\t\t\t\t\t\t\t\t\t\t\t\t'property' => $property,\n\t\t\t\t\t\t\t\t\t\t\t\t'value' => $value\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\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/* named colors */\n\t\t\t\t\t\t\telse if (preg_match_all('/\\b('.$this->colorRegex.')\\b/i', $value, $colorMatch)) {\n\t\t\t\t\t\t\t\tfor ($x = 0; $x < count($colorMatch[0]); $x++) {\n\t\t\t\t\t\t\t\t\t$this->addToMatchResults(\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'color' => strtolower($this->colorNames[strtolower($colorMatch[1][$x])]),\n\t\t\t\t\t\t\t\t\t\t\t'stylesheet' => $cssFile,\n\t\t\t\t\t\t\t\t\t\t\t'class' => $className,\n\t\t\t\t\t\t\t\t\t\t\t'property' => $property,\n\t\t\t\t\t\t\t\t\t\t\t'value' => $value\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/* rgb colors */\n\t\t\t\t\t\t\telse if (preg_match_all('/\\brgba?\\s?\\(\\s?(\\d+)\\s?,\\s?(\\d+)\\s?,\\s?(\\d+)\\s?(,\\s?(\\d+)\\s?)?\\)/i', $value, $colorMatch)) {\n\t\t\t\t\t\t\t\tfor ($x = 0; $x < count($colorMatch[0]); $x++){\n\t\t\t\t\t\t\t\t\t$hexcolor = $this->rgb2hex($colorMatch[1][$x], $colorMatch[2][$x], $colorMatch[3][$x]);\n\t\t\t\t\t\t\t\t\t$this->addToMatchResults(\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'color' => '#'.$hexcolor,\n\t\t\t\t\t\t\t\t\t\t\t'stylesheet' => $cssFile,\n\t\t\t\t\t\t\t\t\t\t\t'class' => $className,\n\t\t\t\t\t\t\t\t\t\t\t'property' => $property,\n\t\t\t\t\t\t\t\t\t\t\t'value' => $value\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}",
"function fetchCSS($file){\n\n\t$html = file($file);\n\n\t$css = '';\n\t$collect = false;\n\n\tforeach($html as $line => $str){\n\n\t\tif(preg_match('/<style.+(.*)[^\\<]/', $str, $match)){\n\t\t\t //echo \"Beginning of the css\";\n\t\t\t $collect = true;\n\t\t}elseif(preg_match('/\\<\\/style\\>/', $str)){\n\t\t\t//return $css;\n\t\t\t$collect = false;\n\t\t}else{\n\t\t\tif($collect) $css .= trim($str);\n\t\t}\n\t}\n\t\n\t$stylelines = explode(\"}\", $css);\n\n\t$styles = array();\n\n\tforeach($stylelines as $lines => $line){\n\t\t$selector = substr($line, 0, strpos($line, \"{\"));\n\t\t$stylelines = substr($line, strpos($line, \"{\") + 1, strlen($line));\n\t\t\n\t\t$rulelines = explode(\";\", $stylelines);\n\n\t\tforeach($rulelines as $ruleline => $set){\n\t\t\tlist($stylename, $stylevalue) = explode(\":\", $set);\n\t\t\n\t\t\t$styles[$selector][trim($stylename)] = trim($stylevalue);\n\t\t}\n\t\t//echo $selector . \" = \" . $rules . \"\\n\";\n\t}\n\n\treturn $styles;\n}",
"public function getCss()\n {\n $parser = new \\Less_Parser(\n array(\n 'cache_dir' => Config::get('concrete.cache.directory'),\n 'compress' => (bool) Config::get('concrete.theme.compress_preprocessor_output'),\n 'sourceMap' => !Config::get('concrete.theme.compress_preprocessor_output') && (bool) Config::get('concrete.theme.generate_less_sourcemap'),\n )\n );\n $parser = $parser->parseFile($this->file, $this->sourceUriRoot);\n if (isset($this->variableCollection) && $this->variableCollection instanceof NormalizedVariableCollection) {\n $variables = [];\n foreach ($this->variableCollection->getValues() as $variable) {\n $variables[$variable->getName()] = (string) $variable->getValue();\n }\n $parser->ModifyVars($variables);\n }\n $css = $parser->getCss();\n return $css;\n }",
"function theme_boost_training_get_main_scss_content($theme) {\n global $CFG;\n\n $scss = file_get_contents(\"{$CFG->dirroot}/theme/boost_training/scss/boost_training.scss\");\n\n $scss = str_replace(\"'background-color'\", $theme->settings->headercolor, $scss);\n $scss = str_replace(\"'text-color'\", $theme->settings->textcolor, $scss);\n\n return $scss;\n}",
"public function getCss() {\n $arr = [];\n foreach ($this->css as $css) {\n if (preg_match(\"/^([a-z]+\\:)?\\/\\//i\", $css))\n $arr[] = $css;\n else\n $arr[] = fileUrl(\"library/\".$this->name.\"/\".$css);\n }\n return $arr;\n }",
"function fett_foundation_get_scss($options = FALSE) {\n $file = file_get_contents(dirname(dirname(__FILE__)) . '/assets/foundation/scss/foundation.scss');\n preg_match_all(\"/components\\/(.*)?\\\"/\",$file,$matches, PREG_PATTERN_ORDER);\n $names = array();\n if(!empty($matches[1]) && is_array($matches[1])){\n foreach($matches[1] as $match){\n $names[$match] = ucwords(str_replace('-',' ',$match));\n }\n }\n return $names;\n}",
"public function firstColorAsCSS()\n {\n return $this->stops[0]['rgb'];\n }",
"function css_preg($matches)\n{\n\tglobal $CSS_MATCHES;\n\t$ret=count($CSS_MATCHES);\n\t$CSS_MATCHES[]=$matches[0];\n\n\treturn '<color-'.strval($ret).'>';\n}",
"function getGradientColors($line){\n $startBracket = strpos($line, '(');\n $endBracket = strpos($line, ')');\n $colors = explode(',',substr($line, $startBracket+1, $endBracket-$startBracket-1)); \n return $colors;\n}",
"function gogreen_get_color(){\n return gogreen_get_color_scheme();\n}",
"function theme_colors()\n { \n return theme_facilities('colors');\n }",
"function ndotone_get_color_scheme_css($colors)\n{\n\t$colors = wp_parse_args($colors, array(\n\t\t\t'header_textcolor' => '',\n\t\t\t'content_background_color' => '',\n\t\t\t'main_text_color' => '',\n\t\t\t'secondary_text_color' => '',\n\t\t\t'primary_link_color'\t\t\t=> '',\n\t\t\t'secondary_link_color'\t\t\t=> '',\n\t\t\t'sidebar_color' \t\t=> '',\n\t\t\t'border_color' => '',\n\t));\n\n\treturn <<<CSS\n\t/* Color Scheme */\n\n\t/* Content Background Color */\n\tbody {\n\t\tbackground-color: {$colors['content_background_color']};\n\t}\n\n\t.hfeed .overflow .post-content:after {\n background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, {$colors['content_background_color']} 50%);\n }\n\n\t/* Header Text Color */\n\t.site-title a,\n\t.site-description {\n\t\tcolor: {$colors['header_textcolor']};\n\t}\n\n\t/* Main Text Color */\n\tbody,\n\tinput,\n\tselect,\n\ttextarea,\n\t.hfeed .entry-title a,\n \t.navigation .post-title,\n \t.site-main #infinite-handle span,\n\t.entry-footer .cat-links a:hover {\n\t\tcolor: {$colors['main_text_color']};\n\t}\n\n\tbutton:hover,\n\tinput[type=\"button\"]:hover,\n\tinput[type=\"reset\"]:hover,\n\tinput[type=\"submit\"]:hover,\n\tinput[type=\"text\"]:hover,\n\tinput[type=\"email\"]:hover,\n\tinput[type=\"url\"]:hover,\n\tinput[type=\"password\"]:hover,\n\tinput[type=\"search\"]:hover,\n\tinput[type=\"number\"]:hover,\n\tinput[type=\"tel\"]:hover,\n\tinput[type=\"range\"]:hover,\n\tinput[type=\"date\"]:hover,\n\tinput[type=\"month\"]:hover,\n\tinput[type=\"week\"]:hover,\n\tinput[type=\"time\"]:hover,\n\tinput[type=\"datetime\"]:hover,\n\tinput[type=\"datetime-local\"]:hover,\n\tinput[type=\"color\"]:hover,\n\ttextarea:hover,\n\t.pagination .page-numbers.current {\n\t\tborder-color: {$colors['main_text_color']};\n\t\tcolor: {$colors['main_text_color']};\n\t}\n\n\tinput[type=\"text\"]:focus,\n\tinput[type=\"email\"]:focus,\n\tinput[type=\"url\"]:focus,\n\tinput[type=\"password\"]:focus,\n\tinput[type=\"search\"]:focus,\n\tinput[type=\"number\"]:focus,\n\tinput[type=\"tel\"]:focus,\n\tinput[type=\"range\"]:focus,\n\tinput[type=\"date\"]:focus,\n\tinput[type=\"month\"]:focus,\n\tinput[type=\"week\"]:focus,\n\tinput[type=\"time\"]:focus,\n\tinput[type=\"datetime\"]:focus,\n\tinput[type=\"datetime-local\"]:focus,\n\tinput[type=\"color\"]:focus,\n\ttextarea:focus {\n\t\tcolor: {$colors['main_text_color']};\n\t}\n\n \t.site-main #infinite-handle span button::after {\n\t\tbackground-color: {$colors['main_text_color']};\n\t}\n\n\t/* Secondary Text Color */\n\t.widget,\n\tbody.error404 .error-404 {\n\t\tcolor: {$colors['secondary_text_color']};\n\t}\n\n\t.widget .search-field:hover,\n\tbody.error404 .search-form .search-field:hover {\n\t\tborder-color: {$colors['secondary_text_color']};\n\t}\n\n\t.side-title .fa.fa-home {\n\t\tbackground-color: {$colors['secondary_text_color']};\n\t}\n\n\t/* Primary Link Color */\n\ta,\n\t.site-title a:hover,\n\t.site-title a:focus,\n\t.widget a:hover,\n\t.widget a:focus,\n\t.entry-footer a:hover,\n\t.entry-footer a:focus,\n\t.entry-footer .tags-links a:hover,\n\t.comment-metadata a:hover,\n\t.comment-metadata a:focus,\n\t.hfeed .entry-title a:hover,\n\t.hfeed .entry-title a:focus,\n\t.search-form .search-submit:hover,\n\t.search-form .search-submit:focus,\n\t.widget .tagcloud a:hover,\n\t.site-footer a:hover,\n\t.site-footer a:focus,\n\t.site-main #infinite-handle span button:hover,\n\t.site-main #infinite-handle span button:focus {\n color: {$colors['primary_link_color']};\n\t}\n\n\t.main-navigation a:hover,\n\t.main-navigation a:focus,\n\t.main-navigation .nav-site-title:hover,\n\t.main-navigation .nav-site-title:focus,\n\t.menu-toggle:hover,\n\t.menu-toggle.toggled,\n\t.dropdown-toggle:hover,\n\t.dropdown-toggle.toggled:after {\n\t\tcolor: {$colors['primary_link_color']};\n\t}\n\n\t.navigation .nav-previous a:hover .meta-nav,\n\t.navigation .nav-previous a:focus .meta-nav,\n\t.navigation .nav-next a:hover .meta-nav,\n\t.navigation .nav-next a:focus .meta-nav,\n\t.pagination a:hover,\n\t.pagination a:focus,\n\t.pagination .prev:hover,\n\t.pagination .prev:focus,\n\t.pagination .next:hover,\n\t.pagination .next:focus{\n\t\t color: {$colors['primary_link_color']};\n\t}\n\n \t.sticky-post,\n \tmark,\n \tins,\n \t.entry-footer .cat-links a:hover,\n \t.side-title .fa.fa-home:hover,\n \t.side-title .fa.fa-home:focus,\n \t.hfeed .cover-link,\n \t.site-main #infinite-handle span button:hover:after,\n \t.site-main #infinite-handle span button:focus:after {\n background-color: {$colors['primary_link_color']};\n\t}\n\n\t.entry-footer .tags-links a:hover,\n\tinput[type=\"text\"]:focus,\n\tinput[type=\"email\"]:focus,\n\tinput[type=\"url\"]:focus,\n\tinput[type=\"password\"]:focus,\n\tinput[type=\"search\"]:focus,\n\tinput[type=\"number\"]:focus,\n\tinput[type=\"tel\"]:focus,\n\tinput[type=\"range\"]:focus,\n\tinput[type=\"date\"]:focus,\n\tinput[type=\"month\"]:focus,\n\tinput[type=\"week\"]:focus,\n\tinput[type=\"time\"]:focus,\n\tinput[type=\"datetime\"]:focus,\n\tinput[type=\"datetime-local\"]:focus,\n\tinput[type=\"color\"]:focus,\n\ttextarea:focus,\n\t.widget .search-field:focus,\n\t.widget .tagcloud a:hover,\n\tbody.error404 .search-form .search-field:focus {\n\t\tborder-color: {$colors['primary_link_color']};\n\t}\n\n\t/* Secondary Link Color */\n\ta:hover,\n\ta:focus,\n\ta:active,\n\t.main-navigation a,\n\t.main-navigation .nav-site-title,\n\t.widget a,\n\t.widget.widget_archive li,\n\t.widget ul li.cat-item,\n\t.widget select,\n\t.search-form .search-submit,\n\t.wp-caption-text,\n\t.site-footer,\n\t.site-footer a,\n\t.page-links,\n\t.navigation.post-navigation .meta-nav,\n\t.post-password-form label,\n\t.comment-metadata a,\n\t.menu-toggle,\n\t.dropdown-toggle,\n\t.pagination .nav-links,\n\t.pagination a,\n\t.entry-footer .cat-links a {\n\t\tcolor: {$colors['secondary_link_color']};\n\t}\n\n\t.search-field::-webkit-input-placeholder {\n\t\tcolor: {$colors['secondary_link_color']};\n\t}\n\t.search-field:-moz-placeholder {\n\t\tcolor: {$colors['secondary_link_color']};\n\t}\n\t.search-field::-moz-placeholder {\n\t\tcolor: {$colors['secondary_link_color']};\n\t}\n\t.search-field:-ms-input-placeholder {\n\t\tcolor: {$colors['secondary_link_color']};\n\t}\n\n\tbutton, input[type=\"button\"],\n\tinput[type=\"reset\"],\n\tinput[type=\"submit\"] {\n\t\tborder-color: {$colors['secondary_link_color']};\n\t\tcolor: {$colors['secondary_link_color']};\n\t}\n\n\tinput[type=\"text\"],\n\tinput[type=\"email\"],\n\tinput[type=\"url\"],\n\tinput[type=\"password\"],\n\tinput[type=\"search\"],\n\tinput[type=\"number\"],\n\tinput[type=\"tel\"],\n\tinput[type=\"range\"],\n\tinput[type=\"date\"],\n\tinput[type=\"month\"],\n\tinput[type=\"week\"],\n\tinput[type=\"time\"],\n\tinput[type=\"datetime\"],\n\tinput[type=\"datetime-local\"],\n\tinput[type=\"color\"],\n\ttextarea {\n\t\tcolor: {$colors['secondary_link_color']};\n\t\tborder-color: {$colors['secondary_link_color']};\n\t}\n\n\t.widget .widget-title:after {\n\t\tbackground-color: {$colors['secondary_link_color']};\n\t}\n\n\t.widget .search-field,\n\t.widget select,\n\t.widget .tagcloud a,\n\t.widget table,\n\t.main-navigation ul li,\n\tbody.error404 .search-form .search-field {\n\t\tborder-color: {$colors['secondary_link_color']};\n\t}\n\n\t/* Sidebar Color */\n\t.sidebar-right,\n\t.sidebar-left,\n\t.site-footer .site-info,\n\t.site-footer .social-navigation,\n\t.main-navigation,\n\t.main-navigation ul ul li,\n\tbody.error404,\n\tbody.error404 .error-404,\n\tbody.error404 .search-form .search-field {\n\t\tbackground-color: {$colors['sidebar_color']};\n\t}\n\n\t.side-title .fa.fa-home {\n\t\t\tcolor: {$colors['sidebar_color']};\n\t}\n\n\t@media screen and (max-width: 1440px) {\n\t\t.site-footer .site-copyright,\n\t\tbody.no-left-sidebar .site-info {\n\t\t\tbackground-color: {$colors['sidebar_color']};\n\t\t}\n\t}\n\n\t@media screen and (max-width: 1170px) {\n\t\t.site-footer .site-copyright,\n\t\tbody.no-right-sidebar .social-navigation,\n\t\tbody.no-right-sidebar .site-copyright {\n\t\t\tbackground-color: {$colors['sidebar_color']};\n\t\t}\n\t}\n\n\t/* Border Color */\n\t.main-navigation ul li,\n\t.hfeed .post-content,\n\t.hfeed .page-header,\n\t.entry-meta,\n\t.entry-footer,\n\t.entry-footer .tags-links a,\n\t.author-info-wrapper,\n\t.navigation .nav-previous .meta-nav,\n\t.navigation .nav-next .meta-nav,\n\t.navigation .nav-links,\n\t.comments-title-wrapper,\n\t.comment-navigation,\n\t.comment-list > .comment,\n\t.comment-list > .comment .children .comment-body,\n\t.site-footer .site-copyright,\n\ttable tr,\n\ttable td,\n\ttable th {\n\t\tborder-color: {$colors['border_color']};\n\t}\n\n\t@media screen and (min-width: 1170px) {\n\t\t.main-navigation ul ul li:first-child > a {\n\t\t\tborder-color: {$colors['border_color']};\n\t\t}\n\t}\n\n\tbody.no-left-sidebar .site-info,\n\tbody.no-sidebar .site-footer,\n\tbody.no-right-sidebar .social-navigation {\n\t\t\tborder-color: {$colors['border_color']};\n\t}\n\n\tblockquote:before {\n\t\tcolor: {$colors['border_color']};\n\t}\n\n\tcode,\n\tpre,\n\t.entry-footer .cat-links a {\n\t\tbackground-color: {$colors['border_color']};\n\t}\n\n\tdiv.sharedaddy h3.sd-title:before {\n\t\tborder-color: {$colors['border_color']} !important;\n\t}\n\n\t@media screen and (max-width: 1440px) {\n\t\t.sidebar-right,\n\t\tbody.no-right-sidebar .site-copyright {\n\t\t\tborder-color: {$colors['border_color']} !important;\n\t\t}\n\t}\n\n\t@media screen and (max-width: 1170px) {\n\t\t.sidebar-left {\n\t\t\tborder-color: {$colors['border_color']} !important;\n\t\t}\n\t}\n\nCSS;\n}",
"public function listColors($dir) {\n\t\t$this->matchResults = array();\n\n\t\t$cssFiles = array();\n\t\tif (!is_array($dir)) $dir = array($dir);\n\t\tforeach ($dir as $d)\n\t\t\t$cssFiles = array_merge($cssFiles, $this->findCssFiles($d, '*.css'));\n\n\t\t$this->colorNames = $this->genColorNames();\n\n\t\t$reg = array();\n\t\tforeach ($this->colorNames as $cn => $hex)\n\t\t\t$reg[] = preg_quote($cn, '/');\n\t\t$this->colorRegex = implode('|', $reg);\n\n\t\t$ignore = array();\n\t\tforeach ($this->ignoreFiles as $i)\n\t\t\t$ignore[] = preg_quote($i, '/');\n\n\t\t$ignoreRegex = '('.implode($ignore, '|').')';\n\n\t\tforeach ($cssFiles as $cssFile) {\n\t\t\tif (strlen($ignoreRegex) == 2 || !preg_match('/'.$ignoreRegex.'/', $cssFile))\n\t\t\t\t$colors = $this->findColors($cssFile);\n\t\t}\n\n\t\t$this->sortMatches();\n\n\t\treturn $this->displayColors();\n\t}",
"public static function sass() {\n\t\t$parser = null;\n\n\t\t$args = func_get_args();\n\t\t$html = '';\n\t\tforeach ($args as $file) {\n\t\t\tif (preg_match('/^(.*)\\.sass$/', $file)) {\n\t\t\t\t$file = str_replace('.sass', '', $file);\n\t\t\t}\n\t\t\t$css_file = WEBROOT.DS.'sass'.DS.$file.'.css';\n\t\t\t$sass_file = WEBROOT.DS.'sass'.DS.$file.'.sass';\n\n\t\t\t$css_time = 0;\n\t\t\t$sass_time = filemtime($sass_file);\n\t\t\tif (file_exists($css_file)) $css_time = filemtime($css_file);\n\n\t\t\tif ($sass_time > $css_time) {\n\t\t\t\tif ( ! $parser) {\n\t\t\t\t\trequire_once VENDORS.DS.'Phamlp'.DS.'sass'.DS.'SassParser.php';\n\t\t\t\t\t$parser = new SassParser(array(\n\t\t\t\t\t'cache' => Config::load('app.sass.cache'),\n\t\t\t\t\t'cache_location' => CACHE.DS.'sass',\n\t\t\t\t\t'css_location' => WEBROOT.DS.'sass',\n\t\t\t\t\t'load_paths' => array('./'),\n\t\t\t\t\t'style' => Config::load('app.sass.style')\n\t\t\t\t\t));\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\t$css = $parser->toCss($file);\n\t\t\t\t\tfile_put_contents($css_file, $css);\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\ttrigger_error($e->getMessage(), E_USER_ERROR);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$html .= self::css('/sass/'.$file);\n\t\t}\n\n\t\treturn $html;\n\t}",
"function get_colors(){\n\n global $table; global $id;\n\n $GLOBALS['primary1']=getDataByProp($table, $id, \"'primarycolor1'\");\n $GLOBALS['primary1']=$GLOBALS['primary1']['value'];\n\n $GLOBALS['primary2']=getDataByProp($table, $id, \"'primarycolor2'\");\n $GLOBALS['primary2']=$GLOBALS['primary2']['value'];\n\n $GLOBALS['secondary1']=getDataByProp($table, $id, \"'secondarycolor1'\");\n $GLOBALS['secondary1']=$GLOBALS['secondary1']['value'];\n }",
"public function getImageColors () {}",
"public function getColor();",
"function csstoolsexp_color_names()\n{\n return array(\n 'indianred' => '#CD5C5C', 'lightcoral' => '#F08080',\n 'salmon' => '#FA8072', 'darksalmon' => '#E9967A',\n 'lightsalmon' => '#FFA07A', 'crimson' => '#DC143C',\n 'red' => '#FF0000', 'firebrick' => '#B22222',\n 'darkred' => '#8B0000', 'pink' => '#FFC0CB',\n 'lightpink' => '#FFB6C1', 'hotpink' => '#FF69B4',\n 'deeppink' => '#FF1493', 'mediumvioletred' => '#C71585',\n 'palevioletred' => '#DB7093', 'lightsalmon' => '#FFA07A',\n 'coral' => '#FF7F50', 'tomato' => '#FF6347',\n 'orangered' => '#FF4500', 'darkorange' => '#FF8C00',\n 'orange' => '#FFA500', 'gold' => '#FFD700',\n 'yellow' => '#FFFF00', 'lightyellow' => '#FFFFE0',\n 'lemonchiffon' => '#FFFACD', 'lightgoldenrodyellow' => '#FAFAD2',\n 'papayawhip' => '#FFEFD5', 'moccasin' => '#FFE4B5',\n 'peachpuff' => '#FFDAB9', 'palegoldenrod' => '#EEE8AA',\n 'khaki' => '#F0E68C', 'darkkhaki' => '#BDB76B',\n 'lavender' => '#E6E6FA', 'thistle' => '#D8BFD8',\n 'plum' => '#DDA0DD', 'violet' => '#EE82EE',\n 'orchid' => '#DA70D6', 'fuchsia' => '#FF00FF',\n 'magenta' => '#FF00FF', 'mediumorchid' => '#BA55D3',\n 'mediumpurple' => '#9370DB', 'blueviolet' => '#8A2BE2',\n 'darkviolet' => '#9400D3', 'darkorchid' => '#9932CC',\n 'darkmagenta' => '#8B008B', 'purple' => '#800080',\n 'indigo' => '#4B0082', 'slateblue' => '#6A5ACD',\n 'darkslateblue' => '#483D8B', 'mediumslateblue' => '#7B68EE',\n 'greenyellow' => '#ADFF2F', 'chartreuse' => '#7FFF00',\n 'lawngreen' => '#7CFC00', 'lime' => '#00FF00',\n 'limegreen' => '#32CD32', 'palegreen' => '#98FB98',\n 'lightgreen' => '#90EE90', 'mediumspringgreen' => '#00FA9A',\n 'springgreen' => '#00FF7F', 'mediumseagreen' => '#3CB371',\n 'seagreen' => '#2E8B57', 'forestgreen' => '#228B22',\n 'green' => '#008000', 'darkgreen' => '#006400',\n 'yellowgreen' => '#9ACD32', 'olivedrab' => '#6B8E23',\n 'olive' => '#808000', 'darkolivegreen' => '#556B2F',\n 'mediumaquamarine' => '#66CDAA', 'darkseagreen' => '#8FBC8F',\n 'lightseagreen' => '#20B2AA', 'darkcyan' => '#008B8B',\n 'teal' => '#008080', 'aqua' => '#00FFFF',\n 'cyan' => '#00FFFF', 'lightcyan' => '#E0FFFF',\n 'paleturquoise' => '#AFEEEE', 'aquamarine' => '#7FFFD4',\n 'turquoise' => '#40E0D0', 'mediumturquoise' => '#48D1CC',\n 'darkturquoise' => '#00CED1', 'cadetblue' => '#5F9EA0',\n 'steelblue' => '#4682B4', 'lightsteelblue' => '#B0C4DE',\n 'powderblue' => '#B0E0E6', 'lightblue' => '#ADD8E6',\n 'skyblue' => '#87CEEB', 'lightskyblue' => '#87CEFA',\n 'deepskyblue' => '#00BFFF', 'dodgerblue' => '#1E90FF',\n 'cornflowerblue' => '#6495ED', 'mediumslateblue' => '#7B68EE',\n 'royalblue' => '#4169E1', 'blue' => '#0000FF',\n 'mediumblue' => '#0000CD', 'darkblue' => '#00008B',\n 'navy' => '#000080', 'midnightblue' => '#191970',\n 'cornsilk' => '#FFF8DC', 'blanchedalmond' => '#FFEBCD',\n 'bisque' => '#FFE4C4', 'navajowhite' => '#FFDEAD',\n 'wheat' => '#F5DEB3', 'burlywood' => '#DEB887',\n 'tan' => '#D2B48C', 'rosybrown' => '#BC8F8F',\n 'sandybrown' => '#F4A460', 'goldenrod' => '#DAA520',\n 'darkgoldenrod' => '#B8860B', 'peru' => '#CD853F',\n 'chocolate' => '#D2691E', 'saddlebrown' => '#8B4513',\n 'sienna' => '#A0522D', 'brown' => '#A52A2A',\n 'maroon' => '#800000', 'white' => '#FFFFFF',\n 'snow' => '#FFFAFA', 'honeydew' => '#F0FFF0',\n 'mintcream' => '#F5FFFA', 'azure' => '#F0FFFF',\n 'aliceblue' => '#F0F8FF', 'ghostwhite' => '#F8F8FF',\n 'whitesmoke' => '#F5F5F5', 'seashell' => '#FFF5EE',\n 'beige' => '#F5F5DC', 'oldlace' => '#FDF5E6',\n 'floralwhite' => '#FFFAF0', 'ivory' => '#FFFFF0',\n 'antiquewhite' => '#FAEBD7', 'linen' => '#FAF0E6',\n 'lavenderblush' => '#FFF0F5', 'mistyrose' => '#FFE4E1',\n 'gainsboro' => '#DCDCDC', 'lightgrey' => '#D3D3D3',\n 'silver' => '#C0C0C0', 'darkgray' => '#A9A9A9',\n 'gray' => '#808080', 'dimgray' => '#696969',\n 'lightslategray' => '#778899', 'slategray' => '#708090',\n 'darkslategray' => '#2F4F4F', 'black' => '#000000',\n );\n}",
"public static function supports_custom_colors() {\n\t\t// We need Jetpack's SASS super powers.\n\t\treturn function_exists( 'jetpack_sass_css_preprocess' );\n\t}",
"function twentytwenty_get_customizer_color_vars() {\n\t$colors = array(\n\t\t'content' => array(\n\t\t\t'setting' => 'background_color',\n\t\t),\n\t\t'header-footer' => array(\n\t\t\t'setting' => 'header_footer_background_color',\n\t\t),\n\t);\n\treturn $colors;\n}",
"public static function getColors(): array\n {\n return static::$colors;\n }",
"function cssToArray($css){\n $array = explode(';',$css,-1);\n $new_array = array();\n foreach($array as $a){\n $b = explode(':', $a);\n $new_array[str_replace(' ', '', $b[0])] = trim(str_replace(array('px', '#'), '', $b[1]));\n }\n return $new_array;\n}",
"public static function getColors() {\n\t\treturn array(\n\t\t 'Green'=>Yii::t('actions', 'Green'),\n\t\t '#3366CC'=>Yii::t('actions', 'Blue'),\n\t\t 'Red'=>Yii::t('actions', 'Red'),\n\t\t 'Orange'=>Yii::t('actions', 'Orange'),\n\t\t 'Black'=>Yii::t('actions', 'Black'),\n\t\t);\n\t}",
"function tinymce_custom_colors() {\r\n\t\t\t$colors = genesis_get_option( 'tinymce_colors', 'vi-settings' );\r\n\t\t\tif( !empty( $colors ) ) {\r\n\t\t\t\t$custom_colors = array();\r\n\t\t\t\tforeach( $colors as $color ) {\r\n\t\t\t\t\t$color = str_replace( '#', '', $color );\r\n\t\t\t\t\t$custom_colors[$color] = $color;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn $custom_colors;\r\n\t\t\t}\r\n\t\t}",
"function getColors()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$set = $ilDB->query(\"SELECT * FROM style_color WHERE \".\n\t\t\t\"style_id = \".$ilDB->quote($this->getId(), \"integer\").\" \".\n\t\t\t\"ORDER BY color_name\");\n\t\t\n\t\t$colors = array();\n\t\twhile ($rec = $ilDB->fetchAssoc($set))\n\t\t{\n\t\t\t$colors[] = array(\n\t\t\t\t\"name\" => $rec[\"color_name\"],\n\t\t\t\t\"code\" => $rec[\"color_code\"]\n\t\t\t\t);\n\t\t}\n\t\t\n\t\treturn $colors;\n\t}",
"static function colors() {\n\n\t\t\t$arry[\"nc\"] = \"\u0003\u00030\";\n\t\t\t$arry[\"blue\"] = \"\u0003\u00032\";\n\t\t\t$arry[\"green\"] = \"\u0003\u00033\";\n\t\t\t$arry[\"lightred\"] = \"\u0003\u00034\";\n\t\t\t$arry[\"red\"] = \"\u0003\u00035\";\n\t\t\t$arry[\"purple\"] = \"\u0003\u00036\";\n\t\t\t$arry[\"orange\"] = \"\u0003\u00037\";\n\t\t\t$arry[\"yellow\"] = \"\u0003\u00038\";\n\t\t\t$arry[\"lightgreen\"] = \"\u0003\u000311\";\n\t\t\t$arry[\"lightblue\"] = \"\u0003\u000312\";\n\t\t\t$arry[\"lightpurple\"] = \"\u0003\u000313\";\n\t\t\t$arry[\"grey\"] = \"\u0003\u000314\";\n\t\t\t$arry[\"lightgrey\"] = \"\u0003\u000315\";\n\t\t\t$arry[\"darkwhite\"] = \"\u0003\u000316\";\n\t\t\treturn $arry;\n\n }",
"function _highlight_file2($fl,$ret){\n if(!isset($ret)) $ret = false;\n $str = highlight_file($fl, true);\n preg_match_all(\"/\\<span style=\\\"color: #([\\d|A|B|C|D|E|F]{6})\\\"\\>.*?\\<\\/span\\>/\", $str, $mtch);\n $m = array_unique($mtch[1]);\n\n $cls = '<style scoped>';\n $rpl = array(\"</a>\");\n $mtc = array(\"</span>\");\n $i = 0;\n foreach($m as $clr) {\n $cls .= 'a.c'. $i .'{color:#'. $clr .'}';\n $rpl[] = '<a class=\"c'. $i++ .'\">';\n $mtc[] = '<span style=\"color: #'. $clr. '\">';\n }\n $cls .= '</style>';\n $str2 = str_replace($mtc, $rpl, $str);\n if($ret) return array($cls, $str2);\n else echo '<style scoped>' . $cls . $str2;\n}",
"function elgg_get_loaded_css() {\n\treturn elgg_get_loaded_external_files('css', 'head');\n}",
"function pwa_set_wp_scss_variables() {\n $default_css_vars = array(\n// 'accent_color' => '#0071bc',\n );\n\n // Retrieve all theme modification values for the current theme\n $mods = get_theme_mods();\n if ( ! $mods ) {\n return;\n }\n\n // Prepare the array\n $variables = array();\n\n // Loop through each default setting and setup CSS variables to values from Customizer or set defaults\n foreach( $default_css_vars as $setting => $default_value ) {\n $variables[ $setting ] = array_key_exists( $setting, $mods ) ? $mods[ $setting ] : $default_value;\n }\n return $variables;\n}"
] | [
"0.66290694",
"0.6492477",
"0.6222261",
"0.6028518",
"0.5981603",
"0.58887625",
"0.5736073",
"0.57153064",
"0.56899446",
"0.5564172",
"0.5503159",
"0.5412854",
"0.53929484",
"0.539073",
"0.53877187",
"0.53807855",
"0.5355788",
"0.5352132",
"0.53496677",
"0.5346164",
"0.533483",
"0.53318816",
"0.5331558",
"0.52703893",
"0.5267368",
"0.52601826",
"0.5259011",
"0.52576506",
"0.52567804",
"0.523702"
] | 0.7446195 | 0 |
Adjust the brightness of a color (HEX) | function adjust_brightness( $hex, $steps ) {
// Steps should be between -255 and 255. Negative = darker, positive = lighter
$steps = max( -255, min( 255, $steps ) );
// Normalize into a six character long hex string
$hex = str_replace( '#', '', $hex );
if ( 3 === strlen( $hex ) ) {
$hex = str_repeat( substr( $hex, 0, 1 ), 2 ) . str_repeat( substr( $hex, 1, 1 ), 2 ) . str_repeat( substr( $hex, 2, 1 ), 2 );
}
// Split into three parts: R, G and B
$color_parts = str_split( $hex, 2 );
$return = '#';
foreach ( $color_parts as $color ) {
$color = hexdec( $color ); // Convert to decimal
$color = max( 0, min( 255, $color + $steps ) ); // Adjust color
$return .= str_pad( dechex( $color ), 2, '0', STR_PAD_LEFT ); // Make two char hex code
}
return $return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pearl_adjust_brightness($hex, $steps)\r\r\n{\r\r\n\t$steps = max(-255, min(255, $steps));\r\r\n\r\r\n\t// Normalize into a six character long hex string\r\r\n\t$hex = str_replace('#', '', $hex);\r\r\n\tif (strlen($hex) == 3) {\r\r\n\t\t$hex = str_repeat(substr($hex, 0, 1), 2) . str_repeat(substr($hex, 1, 1), 2) . str_repeat(substr($hex, 2, 1), 2);\r\r\n\t}\r\r\n\r\r\n\t// Split into three parts: R, G and B\r\r\n\t$color_parts = str_split($hex, 2);\r\r\n\t$return = '#';\r\r\n\r\r\n\tforeach ($color_parts as $color) {\r\r\n\t\t$color = hexdec($color); // Convert to decimal\r\r\n\t\t$color = max(0, min(255, $color + $steps)); // Adjust color\r\r\n\t\t$return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code\r\r\n\t}\r\r\n\r\r\n\treturn $return;\r\r\n}",
"function adjustBrightness($hex, $steps) {\n\t// created by Torkil Johnsen http://stackoverflow.com/posts/11951022/revisions\n // Steps should be between -255 and 255. Negative = darker, positive = lighter\n $steps = max(-255, min(255, $steps));\n // Normalize into a six character long hex string\n $hex = str_replace('#', '', $hex);\n if (strlen($hex) == 3) {\n $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);\n }\n // Split into three parts: R, G and B\n $color_parts = str_split($hex, 2);\n $return = '#';\n foreach ($color_parts as $color) {\n $color = hexdec($color); // Convert to decimal\n $color = max(0,min(255,$color + $steps)); // Adjust color\n $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code\n }\n return $return;\n}",
"function adjustBrightness($hexCode, $adjustPercent) {\n $hexCode = ltrim($hexCode, '#');\n\n if (strlen($hexCode) == 3) {\n $hexCode = $hexCode[0] . $hexCode[0] . $hexCode[1] . $hexCode[1] . $hexCode[2] . $hexCode[2];\n }\n\n $hexCode = array_map('hexdec', str_split($hexCode, 2));\n\n foreach ($hexCode as & $color) {\n $adjustableLimit = $adjustPercent < 0 ? $color : 255 - $color;\n $adjustAmount = ceil($adjustableLimit * $adjustPercent);\n\n $color = str_pad(dechex($color + $adjustAmount), 2, '0', STR_PAD_LEFT);\n }\n\n return '#' . implode($hexCode);\n}",
"function adjustBrightness($hex, $steps) {\n\t\t\t $steps = max(-255, min(255, $steps));\n\n\t\t\t // Normalize into a six character long hex string\n\t\t\t $hex = str_replace('#', '', $hex);\n\t\t\t if (strlen($hex) == 3) {\n\t\t\t $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);\n\t\t\t }\n\n\t\t\t // Split into three parts: R, G and B\n\t\t\t $color_parts = str_split($hex, 2);\n\t\t\t $return = '#';\n\n\t\t\t foreach ($color_parts as $color) {\n\t\t\t $color = hexdec($color); // Convert to decimal\n\t\t\t $color = max(0,min(255,$color + $steps)); // Adjust color\n\t\t\t $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code\n\t\t\t }\n\n\t\t\t return $return;\n\t\t\t}",
"function kirki_twentytwelve_alter_color( $color ) {\n return Kirki_Color::adjust_brightness( $color, -50 );\n}",
"function storefront_adjust_color_brightness( $hex, $steps ) {\n\t// Steps should be between -255 and 255. Negative = darker, positive = lighter.\n\t$steps = max( -255, min( 255, $steps ) );\n\n\t// Format the hex color string.\n\t$hex = str_replace( '#', '', $hex );\n\n\tif ( 3 == strlen( $hex ) ) {\n\t\t$hex = str_repeat( substr( $hex, 0, 1 ), 2 ) . str_repeat( substr( $hex, 1, 1 ), 2 ) . str_repeat( substr( $hex, 2, 1 ), 2 );\n\t}\n\n\t// Get decimal values.\n\t$r = hexdec( substr( $hex, 0, 2 ) );\n\t$g = hexdec( substr( $hex, 2, 2 ) );\n\t$b = hexdec( substr( $hex, 4, 2 ) );\n\n\t// Adjust number of steps and keep it inside 0 to 255.\n\t$r = max( 0, min( 255, $r + $steps ) );\n\t$g = max( 0, min( 255, $g + $steps ) );\n\t$b = max( 0, min( 255, $b + $steps ) );\n\n\t$r_hex = str_pad( dechex( $r ), 2, '0', STR_PAD_LEFT );\n\t$g_hex = str_pad( dechex( $g ), 2, '0', STR_PAD_LEFT );\n\t$b_hex = str_pad( dechex( $b ), 2, '0', STR_PAD_LEFT );\n\n\treturn '#' . $r_hex . $g_hex . $b_hex;\n}",
"function adjustBrightness($hex, $steps) {\n $steps = max(-255, min(255, $steps));\n\n // Format the hex color string\n $hex = str_replace('#', '', $hex);\n if (strlen($hex) == 3) {\n $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);\n }\n\n // Get decimal values\n $r = hexdec(substr($hex,0,2));\n $g = hexdec(substr($hex,2,2));\n $b = hexdec(substr($hex,4,2));\n\n // Adjust number of steps and keep it inside 0 to 255\n $r = max(0,min(255,$r + $steps));\n $g = max(0,min(255,$g + $steps)); \n $b = max(0,min(255,$b + $steps));\n\n $r_hex = str_pad(dechex($r), 2, '0', STR_PAD_LEFT);\n $g_hex = str_pad(dechex($g), 2, '0', STR_PAD_LEFT);\n $b_hex = str_pad(dechex($b), 2, '0', STR_PAD_LEFT);\n\n return '#'.$r_hex.$g_hex.$b_hex;\n}",
"function adjustBrightness($hex, $steps) {\n $steps = max(-255, min(255, $steps));\n\n // Normalize into a six character long hex string\n $hex = str_replace('#', '', $hex);\n if (strlen($hex) == 3) {\n $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);\n }\n\n // Split into three parts: R, G and B\n $color_parts = str_split($hex, 2);\n $return = '#';\n\n foreach ($color_parts as $color) {\n $color = hexdec($color); // Convert to decimal\n $color = max(0,min(255,$color + $steps)); // Adjust color\n $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code\n }\n\n return $return;\n }",
"function ts_adjustBrightness($hex, $steps) {\r\n $steps = max(-255, min(255, $steps));\r\n // Format the hex color string\r\n $hex = str_replace('#', '', $hex);\r\n if (strlen($hex) == 3) {\r\n $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);\r\n }\r\n // Get decimal values\r\n $r = hexdec(substr($hex,0,2));\r\n $g = hexdec(substr($hex,2,2));\r\n $b = hexdec(substr($hex,4,2));\r\n // Adjust number of steps and keep it inside 0 to 255\r\n $r = max(0,min(255,$r + $steps));\r\n $g = max(0,min(255,$g + $steps)); \r\n $b = max(0,min(255,$b + $steps));\r\n $r_hex = str_pad(dechex($r), 2, '0', STR_PAD_LEFT);\r\n $g_hex = str_pad(dechex($g), 2, '0', STR_PAD_LEFT);\r\n $b_hex = str_pad(dechex($b), 2, '0', STR_PAD_LEFT);\r\n return '#'.$r_hex.$g_hex.$b_hex;\r\n}",
"function idaho_webmaster_adjust_brightness( $hex, $steps ) {\n\t\t// Steps should be between -255 and 255. Negative = darker, positive = lighter.\n\t\t$steps = max( -255, min( 255, $steps ) );\n\n\t\t// Normalize into a six character long hex string.\n\t\t$hex = str_replace( '#', '', $hex );\n\n\t\t// If the string is 3 length then repeat to 6.\n\t\tif ( 3 === strlen( $hex ) ) {\n\t\t\t$hex = str_repeat( substr( $hex,0,1 ), 2 ).str_repeat( substr( $hex,1,1 ), 2 ).str_repeat( substr( $hex,2,1 ), 2 );\n\t\t}\n\n\t\t// Split into three parts: R, G and B.\n\t\t$color_parts = str_split( $hex, 2 );\n\t\t$return = '#';\n\n\t\tforeach ( $color_parts as $color ) {\n\t\t\t$color = hexdec( $color ); // Convert to decimal.\n\t\t\t$color = max( 0, min( 255, $color + $steps ) ); // Adjust color.\n\t\t\t$return .= str_pad( dechex( $color ), 2, '0', STR_PAD_LEFT ); // Make two char hex code.\n\t\t}\n\n\t\treturn $return;\n\t}",
"function get_brightness($hex) {\n // strip off any leading #\n $hex = str_replace('#', '', $hex);\n if(strlen($hex) == 3) {\n $hex = $hex[0].$hex[0].$hex[1].$hex[1].$hex[2].$hex[2];\n }\n \n $c_r = hexdec(substr($hex, 0, 2));\n $c_g = hexdec(substr($hex, 2, 2));\n $c_b = hexdec(substr($hex, 4, 2));\n \n return (($c_r * 299) + ($c_g * 587) + ($c_b * 114)) / 1000;\n}",
"function adjustBrightness($hex, $steps) {\n\t $steps = max(-255, min(255, $steps));\n\n\t // Format the hex color string\n\t $hex = str_replace('#', '', $hex);\n\t if (strlen($hex) == 3) {\n\t $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);\n\t }\n\n\t // Get decimal values\n\t $r = hexdec(substr($hex,0,2));\n\t $g = hexdec(substr($hex,2,2));\n\t $b = hexdec(substr($hex,4,2));\n\n\t // Adjust number of steps and keep it inside 0 to 255\n\t $r = max(0,min(255,$r + $steps));\n\t $g = max(0,min(255,$g + $steps)); \n\t $b = max(0,min(255,$b + $steps));\n\n\t $r_hex = str_pad(dechex($r), 2, '0', STR_PAD_LEFT);\n\t $g_hex = str_pad(dechex($g), 2, '0', STR_PAD_LEFT);\n\t $b_hex = str_pad(dechex($b), 2, '0', STR_PAD_LEFT);\n\n\t return '#'.$r_hex.$g_hex.$b_hex;\n\t}",
"function colourBrightness($hex, $percent) {\n \t$hash = '';\n \tif (stristr($hex,'#')) {\n \t\t$hex = str_replace('#','',$hex);\n \t\t$hash = '#';\n \t}\n \t/// HEX TO RGB\n \t$rgb = array(hexdec(substr($hex,0,2)), hexdec(substr($hex,2,2)), hexdec(substr($hex,4,2)));\n \t//// CALCULATE\n \tfor ($i=0; $i<3; $i++) {\n \t\t// See if brighter or darker\n \t\tif ($percent > 0) {\n \t\t\t// Lighter\n \t\t\t$rgb[$i] = round($rgb[$i] * $percent) + round(255 * (1-$percent));\n \t\t} else {\n \t\t\t// Darker\n \t\t\t$positivePercent = $percent - ($percent*2);\n \t\t\t$rgb[$i] = round($rgb[$i] * $positivePercent) + round(0 * (1-$positivePercent));\n \t\t}\n \t\t// In case rounding up causes us to go to 256\n \t\tif ($rgb[$i] > 255) {\n \t\t\t$rgb[$i] = 255;\n \t\t}\n \t}\n \t//// RBG to Hex\n \t$hex = '';\n \tfor($i=0; $i < 3; $i++) {\n \t\t// Convert the decimal digit to hex\n \t\t$hexDigit = dechex($rgb[$i]);\n \t\t// Add a leading zero if necessary\n \t\tif(strlen($hexDigit) == 1) {\n \t\t$hexDigit = \"0\" . $hexDigit;\n \t\t}\n \t\t// Append to the hex string\n \t\t$hex .= $hexDigit;\n \t}\n \treturn $hash.$hex;\n }",
"function originaltint(){\n\tglobal $hue, $luminance, $saturation;\n\t$temp_satu = round($saturation/2 ,0);\n\tif ($luminance < 50) {\n\t\t$luminance += 50;\n\t}elseif($luminance > 60) {\n\t\t$luminance = ($luminance/2) + 50;\n\t}\n\techo \"hsl(\". round($hue, 0). \",\" . $temp_satu . \"%,\" . $luminance.\"%)\"; \n}",
"function udesign_get_color_brightness($hexStr) {\n // Gets a proper hex string\n $hexStr = preg_replace(\"/[^0-9A-Fa-f]/\", '', $hexStr); \n $rgbArray = array();\n //If a proper hex code, convert using bitwise operation. No overhead... faster\n if (strlen($hexStr) == 6) { \n $colorVal = hexdec($hexStr);\n $rgbArray['red'] = 0xFF & ($colorVal >> 0x10);\n $rgbArray['green'] = 0xFF & ($colorVal >> 0x8);\n $rgbArray['blue'] = 0xFF & $colorVal;\n } elseif (strlen($hexStr) == 3) { //if shorthand notation, need some string manipulations\n $rgbArray['red'] = hexdec(str_repeat(substr($hexStr, 0, 1), 2));\n $rgbArray['green'] = hexdec(str_repeat(substr($hexStr, 1, 1), 2));\n $rgbArray['blue'] = hexdec(str_repeat(substr($hexStr, 2, 1), 2));\n } else { //Invalid hex color code\n return false; \n }\n return (($rgbArray['red']*299) + ($rgbArray['green']*587) + ($rgbArray['blue']*114))/1000;\n}",
"static public function adjust_brightness( $value, $steps, $type ) {\n\t\t$is_rgb = strstr( $value, 'rgb' );\n\n\t\t// Get rgb vars.\n\t\tif ( $is_rgb ) {\n\t\t\t$rgb = explode( ',', preg_replace( '/[a-z\\(\\)]/', '', $value ) );\n\t\t\t$r = $rgb[0];\n\t\t\t$g = $rgb[1];\n\t\t\t$b = $rgb[2];\n\t\t\t$a = count( $rgb ) > 3 ? $rgb[3] : false;\n\t\t} else {\n\t\t\t$rgb = self::hex_to_rgb( $value );\n\t\t\t$r = $rgb['r'];\n\t\t\t$g = $rgb['g'];\n\t\t\t$b = $rgb['b'];\n\t\t}\n\n\t\t// Should we darken the color?\n\t\tif ( 'reverse' == $type && $r + $g + $b > 382 ) {\n\t\t\t$steps = -$steps;\n\t\t} elseif ( 'darken' == $type ) {\n\t\t\t$steps = -$steps;\n\t\t}\n\n\t\t// Adjustr the rgb values.\n\t\t$steps = max( -255, min( 255, $steps ) );\n\t\t$r = max( 0, min( 255, $r + $steps ) );\n\t\t$g = max( 0, min( 255, $g + $steps ) );\n\t\t$b = max( 0, min( 255, $b + $steps ) );\n\n\t\t// Return the adjusted color value.\n\t\tif ( $is_rgb ) {\n\t\t\t$value = false === $a ? \"rgb($r,$g,$b)\" : \"rgba($r,$g,$b,$a)\";\n\t\t} else {\n\t\t\t$r_hex = str_pad( dechex( $r ), 2, '0', STR_PAD_LEFT );\n\t\t\t$g_hex = str_pad( dechex( $g ), 2, '0', STR_PAD_LEFT );\n\t\t\t$b_hex = str_pad( dechex( $b ), 2, '0', STR_PAD_LEFT );\n\t\t\t$value = $r_hex . $g_hex . $b_hex;\n\t\t}\n\n\t\treturn $value;\n\t}",
"function get_brightness($hex) {\n\t// returns brightness value from 0 to 255\n\n\t// strip off any leading #\n\t$hex = str_replace('#', '', $hex);\n\n\t$c_r = hexdec(substr($hex, 0, 2));\n\t$c_g = hexdec(substr($hex, 2, 2));\n\t$c_b = hexdec(substr($hex, 4, 2));\n\n\treturn (($c_r * 299) + ($c_g * 587) + ($c_b * 114)) / 1000;\n}",
"function mts_lighten_color( $color, $amount = 10 ) {\n\n\t$hsl = mts_hex_to_hsl( $color );\n\n\t// Lighten\n\t$hsl['L'] = ( $hsl['L'] * 100 ) + $amount;\n\t$hsl['L'] = ( $hsl['L'] > 100 ) ? 1 : $hsl['L']/100;\n\t\n\t// Return as HEX\n\treturn mts_hsl_to_hex($hsl);\n}",
"public function modulateImage ($brightness, $saturation, $hue) {}",
"function complimenttint(){\n\tglobal $hue, $luminance, $saturation;\n\t$temp_satu = round($saturation/2 ,0);\n\tif ($luminance < 50) {\n\t\t$luminance += 50;\n\t}elseif($luminance > 50) {\n\t\t$luminance = ($luminance/2) + 50;\n\n\t}\n\techo \"hsl(\". dethue($hue) . \",\" . $temp_satu . \"%,\" . $luminance.\"%)\"; \n}",
"public static function adjustBrightness($hexColor, $steps)\n {\n // Steps should be between -255 and 255. Negative = darker, positive = lighter\n $steps = max(-255, min(255, $steps));\n\n // Normalize into a six character long hex string\n $hexColor = self::normalize($hexColor);\n\n // Split into three parts: R, G and B\n $color_parts = str_split($hexColor, 2);\n $return = '#';\n\n foreach ($color_parts as $color) {\n $color = hexdec($color); // Convert to decimal\n $color = max(0, min(255, $color + $steps)); // Adjust color\n $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code\n }\n\n return $return;\n }",
"public function getBrightness(): int;",
"public function modulateImage($brightness, $saturation, $hue) {\n\t}",
"public function colourchanger($hex, $percent) {\r\n\t\t$hash = '';\r\n\t\tif (stristr($hex,'#')) {\r\n\t\t\t$hex = str_replace('#','',$hex);\r\n\t\t\t$hash = '#';\r\n\t\t}\r\n\t\t/// HEX TO RGB\r\n\t\t$rgb = array(hexdec(substr($hex,0,2)), hexdec(substr($hex,2,2)), hexdec(substr($hex,4,2)));\r\n\t\tfor ($i=0; $i<3; $i++) {\r\n\t\t\t// See if brighter or darker\r\n\t\t\tif ($percent > 0) {\r\n\t\t\t\t// Lighter\r\n\t\t\t\t$rgb[$i] = round($rgb[$i] * $percent) + round(255 * (1-$percent));\r\n\t\t\t} else {\r\n\t\t\t\t// Darker\r\n\t\t\t\t$positivePercent = $percent - ($percent*2);\r\n\t\t\t\t$rgb[$i] = round($rgb[$i] * $positivePercent) + round(0 * (1-$positivePercent));\r\n\t\t\t}\r\n\t\t\t// In case rounding up causes us to go to 256\r\n\t\t\tif ($rgb[$i] > 255) {\r\n\t\t\t\t$rgb[$i] = 255;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//// RBG to Hex\r\n\t\t$hex = '';\r\n\t\tfor($i=0; $i < 3; $i++) {\r\n\t\t\t// Convert the decimal digit to hex\r\n\t\t\t$hexDigit = dechex($rgb[$i]);\r\n\t\t\t// Add a leading zero if necessary\r\n\t\t\tif(strlen($hexDigit) == 1) {\r\n\t\t\t$hexDigit = \"0\" . $hexDigit;\r\n\t\t\t}\r\n\t\t\t// Append to the hex string\r\n\t\t\t$hex .= $hexDigit;\r\n\t\t}\r\n\t\treturn $hash.$hex;\r\n\t}",
"function mts_darken_color( $color, $amount = 10 ) {\n\n\t$hsl = mts_hex_to_hsl( $color );\n\n\t// Darken\n\t$hsl['L'] = ( $hsl['L'] * 100 ) - $amount;\n\t$hsl['L'] = ( $hsl['L'] < 0 ) ? 0 : $hsl['L']/100;\n\n\t// Return as HEX\n\treturn mts_hsl_to_hex($hsl);\n}",
"function modifyColor($color, $direction) {\r\n if(!preg_match('/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i', $color, $elements));\r\n\r\n if(!isset($direction) || $direction == \"lighter\") {\r\n $modify = 45;\r\n } else {\r\n $modify = -50;\r\n }\r\n\r\n for($index = 1; $index <= 3; $index++) {\r\n $elements[$index] = hexdec($elements[$index]);\r\n $elements[$index] = round($elements[$index] + $modify);\r\n\r\n if($elements[$index] > 255) {\r\n $elements[$index] = 255;\r\n } elseif(\r\n $elements[$index] < 0) { $elements[$index] = 0;\r\n }\r\n $elements[$index] = dechex($elements[$index]);\r\n }\r\n $result = '#' . str_pad($elements[1],2,\"0\",STR_PAD_LEFT) . str_pad($elements[2],2,\"0\",STR_PAD_LEFT) . str_pad($elements[3],2,\"0\",STR_PAD_LEFT);\r\n return $result;\r\n }",
"function getHighContrastColor($hexcolor) {\n \n \t// do we have a CSS color name\n \t// if so we convert and use that\n \t// otherwise use the param\n \t$hexcolor_local = modCiviCRMFullCalendarHelper::GetColor($hexcolor);\n \tif ( $hexcolor_local == null ) {\n \t\t$hexcolor_local = $hexcolor;\n \t}\n \n \n \tdefine(\"_BLACK\", \"000000\");\n \tdefine(\"_WHITE\", \"FFFFFF\");\n \t// determine R, G and B values from the HEX color\n \t$hexcolor_local = strlen($hexcolor_local) == 7 ? substr($hexcolor_local, 1) : $hexcolor_local;\n \tif(strlen($hexcolor_local) == 6){\n \t\t$r = substr($hexcolor_local,0,2);\n \t\t$g = substr($hexcolor_local,2,2);\n \t\t$b = substr($hexcolor_local,4,2);\n \n \t\t$brightness = (hexdec($r) * 0.299) + (hexdec($g) * 0.587) + (hexdec($b) * 0.114);\n \t\tif ( $brightness <= 125) { return _WHITE; }\n \t}\n \t// default\n \treturn _BLACK;\n }",
"function complimentshadow() {\n\tglobal $hue, $luminance, $saturation;\n\t$half_lumi = $luminance/2;\n\t$temp_satu = $saturation + $half_lumi;\n\techo \"hsl(\". dethue($hue) . \",\" . $temp_satu . \"%,\" . $half_lumi .\"%)\"; \n}",
"public function setBrightness(int $amount): self;",
"public function setRalColorHex($ralColorHex);"
] | [
"0.7535692",
"0.7463516",
"0.7455052",
"0.732841",
"0.7283035",
"0.72807896",
"0.72027194",
"0.7193265",
"0.7133411",
"0.70984906",
"0.707392",
"0.7021367",
"0.68160415",
"0.6709921",
"0.66929513",
"0.6587155",
"0.65723157",
"0.6507322",
"0.6472305",
"0.6442365",
"0.6370655",
"0.63381726",
"0.6216786",
"0.60422903",
"0.60114026",
"0.5995951",
"0.5971742",
"0.5930943",
"0.5917405",
"0.5836206"
] | 0.7554047 | 0 |
Get file upload errors | public function getUploadErrors()
{
return $this->uploadErrors;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUploadError() : int\n {\n return UPLOAD_ERR_OK;\n }",
"public function getErrorMessage()\n {\n switch ($this->error) {\n case UPLOAD_ERR_OK:\n return 'There is no error, the file uploaded with success';\n case UPLOAD_ERR_INI_SIZE:\n return 'The uploaded file exceeds the upload_max_filesize directive in php.ini';\n case UPLOAD_ERR_FORM_SIZE:\n return 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form';\n case UPLOAD_ERR_PARTIAL:\n return 'The uploaded file was only partially uploaded';\n case UPLOAD_ERR_NO_FILE:\n return 'No file was uploaded';\n case UPLOAD_ERR_NO_TMP_DIR:\n return 'Missing a temporary folder';\n case UPLOAD_ERR_CANT_WRITE:\n return 'Failed to write file to disk';\n case UPLOAD_ERR_EXTENSION:\n return 'File upload stopped by extension';\n default:\n return 'Unknown upload error';\n }\n }",
"function getUploadFileErrorMessage($field)\r\n {\r\n if (isset($_FILES) && isset($_FILES[$field]) && $_FILES[$field]['error'] != 0) {\r\n\r\n $messages = array(UPLOAD_ERR_INI_SIZE => 'The uploaded file exceeds the max filesize (php)',\r\n UPLOAD_ERR_FORM_SIZE => 'The uploaded file exceeds the max file size (html)',\r\n UPLOAD_ERR_PARTIAL => 'The uploaded file was only partially uploaded.',\r\n // UPLOAD_ERR_NO_FILE => 'No file was uploaded.', // removed as it is used on pages with non-required upload field\r\n UPLOAD_ERR_NO_TMP_DIR => 'Missing a temporary folder.',\r\n UPLOAD_ERR_CANT_WRITE => 'Failed to write file to disk',\r\n UPLOAD_ERR_EXTENSION => 'File upload stopped by extension'\r\n );\r\n\r\n if (isset($messages[$_FILES[$field]['error']])) {\r\n return $messages[$_FILES[$field]['error']];\r\n }\r\n }\r\n return '';\r\n }",
"function upload_errors($err_code) {\n switch ($err_code) { \n case UPLOAD_ERR_INI_SIZE: \n return 'The uploaded file exceeds the upload_max_filesize directive in php.ini'; \n case UPLOAD_ERR_FORM_SIZE: \n return 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form'; \n case UPLOAD_ERR_PARTIAL: \n return 'The uploaded file was only partially uploaded'; \n case UPLOAD_ERR_NO_FILE: \n return 'No file was uploaded'; \n case UPLOAD_ERR_NO_TMP_DIR: \n return 'Missing a temporary folder'; \n case UPLOAD_ERR_CANT_WRITE: \n return 'Failed to write file to disk'; \n case UPLOAD_ERR_EXTENSION: \n return 'File upload stopped by extension'; \n default: \n return 'Unknown upload error'; \n } \n}",
"function file_upload_error($error_integer) {\n\t$upload_errors = array(\n\t\t// http://php.net/manual/en/features.file-upload.errors.php\n\t\tUPLOAD_ERR_OK \t\t\t\t=> \"No errors.\",\n\t\tUPLOAD_ERR_INI_SIZE \t=> \"Larger than upload_max_filesize.\",\n\t UPLOAD_ERR_FORM_SIZE \t=> \"Larger than form MAX_FILE_SIZE.\",\n\t UPLOAD_ERR_PARTIAL \t\t=> \"Partial upload.\",\n\t UPLOAD_ERR_NO_FILE \t\t=> \"No file.\",\n\t UPLOAD_ERR_NO_TMP_DIR => \"No temporary directory.\",\n\t UPLOAD_ERR_CANT_WRITE => \"Can't write to disk.\",\n\t UPLOAD_ERR_EXTENSION \t=> \"File upload stopped by extension.\"\n\t);\n\treturn $upload_errors[$error_integer];\n\n\t/*\n\t\n\t\tUPLOAD_ERR_OK => 0\n\n\t\tUPLOAD_ERR_INI_SIZE = 1\n\n\t\tUPLOAD_ERR_FORM_SIZE = 2\n\n\t\tUPLOAD_ERR_PARTIAL = 3\n\n\t\tUPLOAD_ERR_NO_FILE = 4\n\n\t\tUPLOAD_ERR_NO_TMP_DIR = 5\n\n\t\tUPLOAD_ERR_NO_FILE = 6\n\n\t\tUPLOAD_ERR_CANT_REWRITE = 7\n\n\t\tUPLOAD_ERR_EXTENSION = 8\n\t\n\t\n\t*/\n\n\n\n\n\n}",
"public static function checkFileErrors()\n {\n foreach ($_FILES['userfile']['error'] as $k => $error) {\n if ($error > 0) {\n $errors[$k] = $error;\n } else {\n if (isset($_POST['label'][$k]) && strlen(trim($_POST['label'][$k])) > 0) {\n //$files = $_FILES['userfile'][$k];\n $files_label[$k] = $_POST['label'][$k];\n }\n }\n }\n\n /** IF NO ERRORS CONTINUE **/\n if (count($errors) === 0) {\n /** IF FILE GOT A LABEL CONTINUE **/\n if (count($_FILES['userfile']['error']) === count($files_label)) {\n return $output = array('success' => 'File is OK');\n } else {\n // NO DESCRIPTION FOR SOME FILE\n $output = array('error' => 'Не сте добавили описание на файл');\n }\n\n } else {\n // CHECK FOR TYPE OF ERROR\n $output = static::uploadedFileErrorCheck($errors);\n\n }\n return $output;\n }",
"public function checkUploadError($fileArray) {\n\n\t\tswitch($fileArray['error']) {\n\t\t\tcase UPLOAD_ERR_OK:\n\t\t\tcase UPLOAD_ERR_NO_FILE: break;\n\t\t\tcase UPLOAD_ERR_INI_SIZE: $this->addError($this->maxSizeMessage); break;\n\t\t\tcase UPLOAD_ERR_EXTENSION: $this->addError($this->extMessage); break;\n\t\t\tcase UPLOAD_ERR_NO_TMP_DIR: $this->addError('Не указана директория временных файлов'); break;\n\t\t\tcase UPLOAD_ERR_CANT_WRITE: $this->addError('Нет прав на запись'); break;\n\t\t\tdefault: $this->addError('Неизвестная ошибка, код: '.$fileArray['error']);\n\t\t}\n\t}",
"public function getUploadErrorMessage($err) {\r\n\t\t$msg = null;\r\n\t\tswitch ($err) {\r\n\t\t\tcase UPLOAD_ERR_OK:\r\n\t\t\t\tbreak;\r\n\t\t\tcase UPLOAD_ERR_INI_SIZE:\r\n\t\t\t\t$msg = ('The uploaded file exceeds the upload_max_filesize directive ('.ini_get('upload_max_filesize').') in php.ini.');\r\n\t\t\t\tbreak;\r\n\t\t\tcase UPLOAD_ERR_FORM_SIZE:\r\n\t\t\t\t$msg = ('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.');\r\n\t\t\t\tbreak;\r\n\t\t\tcase UPLOAD_ERR_PARTIAL:\r\n\t\t\t\t$msg = ('The uploaded file was only partially uploaded.');\r\n\t\t\t\tbreak;\r\n\t\t\tcase UPLOAD_ERR_NO_FILE:\r\n\t\t\t\t$msg = ('No file was uploaded.');\r\n\t\t\t\tbreak;\r\n\t\t\tcase UPLOAD_ERR_NO_TMP_DIR:\r\n\t\t\t\t$msg = ('The remote server has no temporary folder for file uploads.');\r\n\t\t\t\tbreak;\r\n\t\t\tcase UPLOAD_ERR_CANT_WRITE:\r\n\t\t\t\t$msg = ('Failed to write file to disk.');\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t$msg = ('Unknown File Error. Check php.ini settings.');\r\n\t\t}\r\n\t\t\r\n\t\treturn $msg;\r\n\t}",
"public function checkFileErrors()\n {\n foreach ($_FILES['userfile']['error'] as $k => $error) {\n if ($error > 0) {\n $errors[$k] = $error;\n } else {\n if (isset($_POST['label'][$k]) && strlen(trim($_POST['label'][$k])) > 0) {\n //$files = $_FILES['userfile'][$k];\n $files_label[$k] = $_POST['label'][$k];\n }\n }\n }\n\n /** IF NO ERRORS CONTINUE **/\n if (count($errors) === 0) {\n /** IF FILE GOT A LABEL CONTINUE **/\n if (count($_FILES['userfile']['error']) === count($files_label)) {\nreturn $output = array('success' => 'File is OK');\n } else {\n // NO DESCRIPTION FOR SOME FILE\n $output = array('error' => 'Не сте добавили описание на файл');\n }\n\n } else {\n // CHECK FOR TYPE OF ERROR\n $output = $this->uploadedFileErrorCheck($errors);\n\n }\n return $output;\n }",
"protected function file_upload_error($errno)\n {\n switch ($errno)\n {\n case UPLOAD_ERR_INI_SIZE:\n case UPLOAD_ERR_FORM_SIZE:\n return $GLOBALS['phorms_tr']['filefield_toolarge'];\n \n case UPLOAD_ERR_PARTIAL:\n return $GLOBALS['phorms_tr']['filefield_uploaderror'];\n \n case UPLOAD_ERR_NO_FILE:\n return $GLOBALS['phorms_tr']['filefield_notsent'];\n \n case UPLOAD_ERR_NO_TMP_DIR:\n case UPLOAD_ERR_CANT_WRITE:\n case UPLOAD_ERR_EXTENSION:\n return sprintf($GLOBALS['phorms_tr']['filefield_syserror'], $errno);\n \n case UPLOAD_ERR_OK:\n default:\n return false;\n }\n }",
"function upload_errors($err_code) {\n\tswitch ($err_code) { \n case UPLOAD_ERR_INI_SIZE: \n return '<div class=\"alert alert-danger\" role=\"alert\">Image file size is too big. Please try a smaller image</div>'; \n case UPLOAD_ERR_FORM_SIZE: \n return '<div class=\"alert alert-danger\" role=\"alert\">Image file size is too big. Please try a smaller image</div>'; \n case UPLOAD_ERR_PARTIAL: \n return '<div class=\"alert alert-danger\" role=\"alert\">Product listing updated but product image did not uploaded properly.</div>'; \n case UPLOAD_ERR_NO_FILE: \n return '<div class=\"alert alert-danger\" role=\"alert\">Product listing updated but product image did not uploaded.</div>'; \n case UPLOAD_ERR_NO_TMP_DIR: \n return '<div class=\"alert alert-danger\" role=\"alert\">There seems to be a problem. please try again.</div>'; \n case UPLOAD_ERR_CANT_WRITE: \n return '<div class=\"alert alert-danger\" role=\"alert\">There seems to be a problem. please try again.</div>'; \n case UPLOAD_ERR_EXTENSION: \n return '<div class=\"alert alert-danger\" role=\"alert\">There seems to be a problem. please try again.</div>'; \n default: \n return '<div class=\"alert alert-danger\" role=\"alert\">There seems to be a problem. please try again.</div>'; \n } \n}",
"function file_upload_error_message($error_code) {\n switch ($error_code) {\n case UPLOAD_ERR_INI_SIZE:\n return 'The uploaded file exceeds the upload_max_filesize directive in php.ini';\n case UPLOAD_ERR_FORM_SIZE:\n return 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form';\n case UPLOAD_ERR_PARTIAL:\n return 'The uploaded file was only partially uploaded';\n case UPLOAD_ERR_NO_FILE:\n return 'No file was uploaded';\n case UPLOAD_ERR_NO_TMP_DIR:\n return 'Missing a temporary folder';\n case UPLOAD_ERR_CANT_WRITE:\n return 'Failed to write file to disk';\n case UPLOAD_ERR_EXTENSION:\n return 'File upload stopped by extension';\n default:\n return 'Unknown upload error';\n }\n}",
"function file_upload_error_message($error_code) {\n switch ($error_code) {\n case UPLOAD_ERR_INI_SIZE:\n return 'The uploaded file exceeds the upload_max_filesize directive in php.ini';\n case UPLOAD_ERR_FORM_SIZE:\n return 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form';\n case UPLOAD_ERR_PARTIAL:\n return 'The uploaded file was only partially uploaded';\n case UPLOAD_ERR_NO_FILE:\n return 'No file was uploaded';\n case UPLOAD_ERR_NO_TMP_DIR:\n return 'Missing a temporary folder';\n case UPLOAD_ERR_CANT_WRITE:\n return 'Failed to write file to disk';\n case UPLOAD_ERR_EXTENSION:\n return 'File upload stopped by extension';\n default:\n return 'Unknown upload error';\n }\n}",
"function file_upload_error_message($error_code) {\n switch ($error_code) {\n case UPLOAD_ERR_INI_SIZE:\n return 'The uploaded file exceeds the upload_max_filesize directive in php.ini';\n case UPLOAD_ERR_FORM_SIZE:\n return 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form';\n case UPLOAD_ERR_PARTIAL:\n return 'The uploaded file was only partially uploaded';\n case UPLOAD_ERR_NO_FILE:\n return 'No file was uploaded';\n case UPLOAD_ERR_NO_TMP_DIR:\n return 'Missing a temporary folder';\n case UPLOAD_ERR_CANT_WRITE:\n return 'Failed to write file to disk';\n case UPLOAD_ERR_EXTENSION:\n return 'File upload stopped by extension';\n default:\n return 'Unknown upload error';\n }\n}",
"public function getUserErrorMessage()\n {\n switch ($this->error) {\n case UPLOAD_ERR_OK:\n return \"OK\";\n case UPLOAD_ERR_INI_SIZE || UPLOAD_ERR_FORM_SIZE:\n return \"The upload file exceeds the limit.\";\n case UPLOAD_ERR_PARTIAL:\n return \"The uploaded file was only partially uploaded.\";\n case UPLOAD_ERR_NO_FILE:\n return \"No file was uploaded.\";\n case UPLOAD_ERR_CANT_WRITE:\n return \"Failed to write file to disk.\";\n case UPLOAD_ERR_EXTENSION:\n return \"A PHP extension stopped the file upload.\";\n default:\n return \"Unknown error.\";\n }\n }",
"protected function processFileUploadErrors($errors)\n {\n foreach ($errors as $error) {\n \\XLite\\Core\\TopMessage::addError(static::t($error[0], !empty($error[1]) ? $error[1] : array()));\n }\n }",
"function upload_error($result)\r\n{\r\n\tswitch ($result){\r\n\tcase 1:\r\n\t\treturn \"UPLOAD_ERR_INI_SIZE\";\r\n\tcase 2:\r\n\t\treturn \"UPLOAD_ERR_FORM_SIZE\";\r\n\tcase 3:\r\n\t\treturn \"UPLOAD_ERR_PARTIAL\";\r\n\tcase 4:\r\n\t\treturn \"UPLOAD_ERR_NO_FILE\";\r\n\tcase 5:\r\n\t\treturn \"File has already been uploaded\";\r\n\tcase 6:\r\n\t\treturn \"Failed to move file from temporary directory\";\r\n\tcase 7:\r\n\t\treturn \"Upload file failed\";\r\n\t}\r\n}",
"public function getErrors();",
"public function getErrors();",
"public function getErrors();",
"public function getErrors();",
"public function getErrors();",
"public function getErrors();",
"public function getErrors();",
"public function getErrors();",
"function file_upload_error_message($error_code)\n{\n switch ($error_code)\n {\n case UPLOAD_ERR_INI_SIZE:\n case UPLOAD_ERR_FORM_SIZE:\n\t\tcase 2:\n return T_('Uploaded Image was too big');\n\n case UPLOAD_ERR_PARTIAL:\n return T_('Error In Uploading');\n\n case UPLOAD_ERR_NO_FILE:\n return T_('No file was uploaded');\n\n case UPLOAD_ERR_NO_TMP_DIR:\n return T_('Missing a temporary folder');\n\n case UPLOAD_ERR_CANT_WRITE:\n return T_('Failed to write file to disk');\n\n case UPLOAD_ERR_EXTENSION:\n return T_('File upload stopped by extension');\n\n default:\n return T_('Unknown upload error');\n }\n}",
"function upload_error($result)\n{\n\tswitch ($result){\n\tcase 1:\n\t\treturn \"UPLOAD_ERR_INI_SIZE\";\n\tcase 2:\n\t\treturn \"UPLOAD_ERR_FORM_SIZE\";\n\tcase 3:\n\t\treturn \"UPLOAD_ERR_PARTIAL\";\n\tcase 4:\n\t\treturn \"UPLOAD_ERR_NO_FILE\";\n\tcase 5:\n\t\treturn \"File has already been uploaded\";\n\tcase 6:\n\t\treturn \"Failed to move file from temporary directory\";\n\tcase 7:\n\t\treturn \"Upload file failed\";\n\t}\n}",
"function wpcf_admin_import_export_file_upload_error($file, $error_msg)\n{\n echo '<div class=\"message error\"><p>' . $error_msg . '</p></div>';\n}",
"function simpleUploadError($fieldname) {\n\t\tif (isset ($_FILES[$fieldname]['name']) && (empty ($_FILES[$fieldname]['error']))) {\n\t\t\tif (is_uploaded_file($_FILES[$fieldname]['tmp_name'])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\n\t\tswitch ($_FILES[$fieldname]['error']) {\n\t\t\tcase UPLOAD_ERR_FORM_SIZE :\n\t\t\tcase UPLOAD_ERR_INI_SIZE :\n\t\t\t\treturn ImageUtility :: UPL_TOOBIG;\n\t\t\t\tbreak;\n\n\t\t\tcase UPLOAD_ERR_PARTIAL :\n\t\t\tcase UPLOAD_ERR_NO_TMP_DIR :\n\t\t\tcase UPLOAD_ERR_CANT_WRITE :\n\t\t\t\treturn ImageUtility :: UPL_INTERNAL;\n\t\t\t\tbreak;\n\n\t\t\tcase UPLOAD_ERR_EXTENSION :\n\t\t\t\treturn ImageUtility :: UPL_EXTENSION;\n\t\t\t\tbreak;\n\n\t\t\tcase UPLOAD_ERR_NO_FILE :\n\t\t\tdefault :\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t}\n\t}",
"protected function checkFileUpload( \\Psr\\Http\\Message\\UploadedFileInterface $file )\n\t{\n\t\tif( $file->getError() !== UPLOAD_ERR_OK )\n\t\t{\n\t\t\tswitch( $file->getError() )\n\t\t\t{\n\t\t\t\tcase UPLOAD_ERR_INI_SIZE:\n\t\t\t\tcase UPLOAD_ERR_FORM_SIZE:\n\t\t\t\t\tthrow new \\Aimeos\\Admin\\JQAdm\\Exception( 'The uploaded file exceeds the max. allowed filesize' );\n\t\t\t\tcase UPLOAD_ERR_PARTIAL:\n\t\t\t\t\tthrow new \\Aimeos\\Admin\\JQAdm\\Exception( 'The uploaded file was only partially uploaded' );\n\t\t\t\tcase UPLOAD_ERR_NO_FILE:\n\t\t\t\t\tthrow new \\Aimeos\\Admin\\JQAdm\\Exception( 'No file was uploaded' );\n\t\t\t\tcase UPLOAD_ERR_NO_TMP_DIR:\n\t\t\t\t\tthrow new \\Aimeos\\Admin\\JQAdm\\Exception( 'Temporary folder is missing' );\n\t\t\t\tcase UPLOAD_ERR_CANT_WRITE:\n\t\t\t\t\tthrow new \\Aimeos\\Admin\\JQAdm\\Exception( 'Failed to write file to disk' );\n\t\t\t\tcase UPLOAD_ERR_EXTENSION:\n\t\t\t\t\tthrow new \\Aimeos\\Admin\\JQAdm\\Exception( 'File upload stopped by extension' );\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new \\Aimeos\\Admin\\JQAdm\\Exception( 'Unknown upload error' );\n\t\t\t}\n\t\t}\n\t}"
] | [
"0.75002974",
"0.7138456",
"0.6964524",
"0.6919157",
"0.6761095",
"0.6679287",
"0.6639344",
"0.66104615",
"0.6600968",
"0.6563977",
"0.6559198",
"0.6551959",
"0.65273154",
"0.65273154",
"0.6502059",
"0.6406116",
"0.63644874",
"0.6353913",
"0.6353913",
"0.6353913",
"0.6353913",
"0.6353913",
"0.6353913",
"0.6353913",
"0.6353913",
"0.63010174",
"0.6285793",
"0.6280607",
"0.62643254",
"0.62555987"
] | 0.79880625 | 0 |
Get the value of updatedAt3 | public function getUpdatedAt3()
{
return $this->updatedAt3;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updatedAt();",
"public function updatedAt();",
"public function getUpdatedValue() {\n\t\treturn $this->getValue();\n\t}",
"public function getTimestampUpdated();",
"public function getUpdateAt()\n {\n return $this->update_at;\n }",
"public function getUpdateAt()\n {\n return $this->update_at;\n }",
"public function getUpdateAt()\n {\n return $this->update_at;\n }",
"public function getUpdateAt()\n {\n return $this->update_at;\n }",
"public function getUpdateAt()\n {\n return $this->update_at;\n }",
"public function getUpdateAt()\n {\n return $this->update_at;\n }",
"public function getUpdated() {\n return $this->updated;\n }",
"public function getUpdated()\r\n {\r\n return $this->updated;\r\n }",
"public function updateTime()\r\n {\r\n return Arr::get($this->info, 'updateTime');\r\n }",
"public function getUpdatedAt1()\n {\n return $this->updatedAt1;\n }",
"public function getUpdated() {\n\t\treturn $this->updated;\n\t}",
"public function getUpdated() {\n\t\treturn $this->updated;\n\t}",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function lastUpdate(){\r\n\t\treturn $this->_lastUpdate;\r\n\t}",
"public function updatedAt(): ?string;",
"public function getTime_updated()\n {\n return $this->time_updated;\n }",
"public function getFeedItemUpdated()\n {\n return $this->updated_at;\n }"
] | [
"0.7104257",
"0.7104257",
"0.670815",
"0.663348",
"0.65035415",
"0.65035415",
"0.65035415",
"0.65035415",
"0.65035415",
"0.65035415",
"0.6499826",
"0.64896417",
"0.6458994",
"0.6456215",
"0.64139986",
"0.64139986",
"0.6411907",
"0.6411907",
"0.6411907",
"0.6411907",
"0.6411907",
"0.6411907",
"0.6411907",
"0.6411907",
"0.6411907",
"0.6411907",
"0.6388555",
"0.63851",
"0.6381175",
"0.6354975"
] | 0.7550968 | 0 |
Converts an AwaitGenerator to a VoidCallback | public static function g2c(Generator $generator, ?callable $onComplete = null, $catches = []) : Await{
/** @var Await<T> $await */
$await = new Await();
$await->generator = $generator;
$await->onComplete = $onComplete;
if(is_callable($catches)){
$await->catches = ["" => $catches];
}else{
$await->catches = $catches;
}
$executor = [$generator, "rewind"];
while($executor !== null){
$executor = $await->wakeup($executor);
}
return $await;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUnsubscribeRequestHandler(): \\Closure\n {\n return function($bot)\n {\n Subscriber::where('telegram_id', $bot->getUser()->getId())->delete();\n $bot->reply('Done ^_^');\n };\n }",
"public static function f2c(callable $closure, ?callable $onComplete = null, $catches = []) : Await{\n\t\treturn self::g2c($closure(), $onComplete, $catches);\n\t}",
"public static function promise(Closure $closure) : Generator{\n\t\t$resolve = yield Await::RESOLVE;\n\t\t$reject = yield Await::REJECT;\n\n\t\t$closure($resolve, $reject);\n\t\treturn yield Await::ONCE;\n\t}",
"abstract protected function getCallbackCase(): callable;",
"public function async(\\Closure $unitOfWork, mixed ...$args): Future;",
"private function wakeup(callable $executor) : ?callable{\n\t\ttry{\n\t\t\t$this->sleeping = false;\n\t\t\t$executor();\n\t\t}catch(Throwable $throwable){\n\t\t\t$this->reject($throwable);\n\t\t\treturn null;\n\t\t}\n\n\t\tif(!$this->generator->valid()){\n\t\t\t$ret = $this->generator->getReturn();\n\t\t\t$this->resolve($ret);\n\t\t\treturn null;\n\t\t}\n\n\t\t// $key = $this->generator->key();\n\t\t$this->current = $current = $this->generator->current() ?? self::RESOLVE;\n\n\t\tif($current === self::RESOLVE){\n\t\t\treturn function() : void{\n\t\t\t\t$promise = new AwaitChild($this);\n\t\t\t\t$this->promiseQueue[] = $promise;\n\t\t\t\t$this->lastResolveUnrejected = $promise;\n\t\t\t\t$this->generator->send(Closure::fromCallable([$promise, \"resolve\"]));\n\t\t\t};\n\t\t}\n\n\t\tif($current === self::RESOLVE_MULTI){\n\t\t\treturn function() : void{\n\t\t\t\t$promise = new AwaitChild($this);\n\t\t\t\t$this->promiseQueue[] = $promise;\n\t\t\t\t$this->lastResolveUnrejected = $promise;\n\t\t\t\t$this->generator->send(static function(...$args) use($promise) : void{\n\t\t\t\t\t$promise->resolve($args);\n\t\t\t\t});\n\t\t\t};\n\t\t}\n\n\t\tif($current === self::REJECT){\n\t\t\tif($this->lastResolveUnrejected === null){\n\t\t\t\t$this->reject(new AwaitException(\"Cannot yield Await::REJECT without yielding Await::RESOLVE first; they must be yielded in pairs\"));\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn function() : void{\n\t\t\t\t$promise = $this->lastResolveUnrejected;\n\t\t\t\tassert($promise !== null);\n\t\t\t\t$this->lastResolveUnrejected = null;\n\t\t\t\t$this->generator->send(Closure::fromCallable([$promise, \"reject\"]));\n\t\t\t};\n\t\t}\n\n\t\t$this->lastResolveUnrejected = null;\n\n\t\tif($current === self::RACE){\n\t\t\tif(count($this->promiseQueue) === 0){\n\t\t\t\t$this->reject(new AwaitException(\"Yielded Await::RACE when there is nothing racing\"));\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t$hasResult = 0; // 0 = all pending, 1 = one resolved, 2 = one rejected\n\t\t\tforeach($this->promiseQueue as $promise){\n\t\t\t\tif($promise->state === self::STATE_RESOLVED){\n\t\t\t\t\t$hasResult = 1;\n\t\t\t\t\t$result = $promise->resolved;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif($promise->state === self::STATE_REJECTED){\n\t\t\t\t\t$hasResult = 2;\n\t\t\t\t\t$result = $promise->rejected;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($hasResult !== 0){\n\t\t\t\tforeach($this->promiseQueue as $p){\n\t\t\t\t\t$p->cancelled = true;\n\t\t\t\t}\n\t\t\t\t$this->promiseQueue = [];\n\t\t\t\tassert(isset($result));\n\t\t\t\tif($hasResult === 1){\n\t\t\t\t\treturn function() use ($result) : void{\n\t\t\t\t\t\t$this->generator->send($result);\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tassert($hasResult === 2);\n\t\t\t\treturn function() use ($result) : void{\n\t\t\t\t\t$this->generator->throw($result);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t$this->sleeping = true;\n\t\t\treturn null;\n\t\t}\n\n\t\tif($current === self::ONCE || $current === self::ALL){\n\t\t\tif($current === self::ONCE && count($this->promiseQueue) !== 1){\n\t\t\t\t$this->reject(new AwaitException(\"Yielded Await::ONCE when the pending queue size is \" . count($this->promiseQueue) . \" != 1\"));\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t$results = [];\n\n\t\t\t// first check if nothing is immediately rejected\n\t\t\tforeach($this->promiseQueue as $promise){\n\t\t\t\tif($promise->state === self::STATE_REJECTED){\n\t\t\t\t\tforeach($this->promiseQueue as $p){\n\t\t\t\t\t\t$p->cancelled = true;\n\t\t\t\t\t}\n\t\t\t\t\t$this->promiseQueue = [];\n\t\t\t\t\t$ex = $promise->rejected;\n\t\t\t\t\treturn function() use ($ex) : void{\n\t\t\t\t\t\t$this->generator->throw($ex);\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($this->promiseQueue as $promise){\n\t\t\t\t// if anything is pending, some others are pending and some others are resolved, but we will eventually get rejected/resolved from the pending promises\n\t\t\t\tif($promise->state === self::STATE_PENDING){\n\t\t\t\t\t$this->sleeping = true;\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tassert($promise->state === self::STATE_RESOLVED);\n\t\t\t\t$results[] = $promise->resolved;\n\t\t\t}\n\n\t\t\t// all resolved\n\t\t\t$this->promiseQueue = [];\n\t\t\treturn function() use ($current, $results) : void{\n\t\t\t\t$this->generator->send($current === self::ONCE ? $results[0] : $results);\n\t\t\t};\n\t\t}\n\n\t\tif($current instanceof Generator){\n\t\t\tif(!self::$warnedDeprecatedDirectYield) {\n\t\t\t\techo \"\\n\" . 'NOTICE: `yield $generator` has been deprecated, please use `yield from $generator` instead.' . \"\\n\";\n\t\t\t\tself::$warnedDeprecatedDirectYield = true;\n\t\t\t}\n\n\t\t\tif(!empty($this->promiseQueue)){\n\t\t\t\t$this->reject(new UnawaitedCallbackException(\"Yielding a generator\"));\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t$child = new AwaitChild($this);\n\t\t\t$await = Await::g2c($current, [$child, \"resolve\"], [$child, \"reject\"]);\n\n\t\t\tif($await->state === self::STATE_RESOLVED){\n\t\t\t\t$return = $await->resolved;\n\t\t\t\treturn function() use ($return) : void{\n\t\t\t\t\t$this->generator->send($return);\n\t\t\t\t};\n\t\t\t}\n\t\t\tif($await->state === self::STATE_REJECTED){\n\t\t\t\t$ex = $await->rejected;\n\t\t\t\treturn function() use ($ex) : void{\n\t\t\t\t\t$this->generator->throw($ex);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t$this->sleeping = true;\n\t\t\t$this->current = self::ONCE;\n\t\t\t$this->promiseQueue = [$await];\n\t\t\treturn null;\n\t\t}\n\n\t\t$this->reject(new AwaitException(\"Unknown yield value\"));\n\t\treturn null;\n\t}",
"public function getCallback();",
"public function callback($callback);",
"public function testSkipClosure()\n {\n $visitorInterface = $this->createMock('JMS\\Serializer\\VisitorInterface');\n $type = array();\n $context = $this->createMock('JMS\\Serializer\\Context');\n $closure = function () {\n };\n\n $this->assertNull($this->closureHandler->skipClosure($visitorInterface, $closure, $type, $context));\n }",
"private function callback_generator ($middlewares): callable {\n return function ($request) use ($middlewares) {\n $response;\n \n foreach ($this->middleware_generator($request, $middlewares) as $callback) {\n $response = $callback;\n // If $response returns Wordpress response, we break the iterator \n // and shortcircuit the return. \n if (is_a($response, 'WP_REST_Response')) {\n break;\n }\n }\n \n return $response;\n };\n }",
"public function attempt(callable $callback): mixed;",
"public function make(Closure $callback = null);",
"function register_shutdown_function (callable $callback, $parameter = null, $_ = null) {}",
"public function send(callback $sender = null): void;",
"public function runCallback($callback)\n {\n }",
"public function each(Closure $callback): void;",
"public function collect(callable $callback): ISeq;",
"protected function complete(Closure $callback = null)\n {\n if ($callback instanceof Closure) {\n return $callback($this);\n }\n }",
"public function streamEvents(): \\Generator;",
"public function setAsyncHandler(AsyncHandler $handler);",
"public function toClosure(): \\Closure;",
"public function when($callback): self;",
"public function block(): void;",
"abstract public function consume($callback, array $options = array());",
"public function run($callback);",
"public function traverse(callable $cb): Type;",
"public function after(callable $cb);",
"public function yield ( $key, $expire, $callback )\n {\n if ( !is_callable($callback) )\n throw new \\r8\\Exception\\Argument(2, \"Callback\", \"Must be callable\");\n\n $result = $this->get( $key );\n\n if ( $result === null ) {\n $result = $callback();\n $this->set($key, $result, $expire);\n }\n\n return $result;\n }",
"public function callAsync(): RestClientResponseInterface\n {\n }",
"public function setUuidGenerator(\\Closure $generator): void\n {\n $this->uuidGenerator = $generator;\n }"
] | [
"0.5142111",
"0.5093312",
"0.50718486",
"0.50660074",
"0.5040324",
"0.49730733",
"0.48427135",
"0.48285913",
"0.47000954",
"0.4681933",
"0.46758002",
"0.46082476",
"0.46040976",
"0.4575195",
"0.4572766",
"0.4560168",
"0.45320815",
"0.45096356",
"0.4496118",
"0.44238886",
"0.44160974",
"0.4410438",
"0.439474",
"0.43734077",
"0.43707436",
"0.43564054",
"0.43521252",
"0.43444872",
"0.43353397",
"0.4323179"
] | 0.53143454 | 0 |
Given an array of generators, executes them simultaneously, and returns an array with each generator mapped to the value. Throws exception as soon as any of the generators throws an exception. | public static function all(array $generators) : Generator{
if(count($generators) === 0){
return [];
}
foreach($generators as $k => $generator){
$resolve = yield;
$reject = yield self::REJECT;
self::g2c($generator, static function($result) use($k, $resolve) : void{
$resolve([$k, $result]);
}, $reject);
}
$all = yield self::ALL;
$return = [];
foreach($all as [$k, $result]) {
$return[$k] = $result;
}
return $return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function combine(array $generators): \\Generator;",
"function gen(): iterable {\n yield 1;\n yield 2;\n yield 3;\n}",
"private static function raceSemaphore(array $inputs) : array{\n\t\t$wrapped = [];\n\n\t\t// This channel acts as a semaphore that only starts one input at a time.\n\t\t$ch = new Channel;\n\t\t$ch->sendWithoutWait(null);\n\n\t\tforeach($inputs as $k => $input){\n\t\t\t/** @var Generator $input */\n\t\t\t$wrapped[$k] = (function() use($input, $ch){\n\t\t\t\tyield from $ch->receive();\n\n\t\t\t\t$input->rewind();\n\t\t\t\tif(!$input->valid()) {\n\t\t\t\t\treturn $input->getReturn();\n\t\t\t\t}\n\n\t\t\t\t$ch->sendWithoutWait(null);\n\t\t\t\twhile($input->valid()) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$send = yield $input->key() => $input->current();\n\t\t\t\t\t\t$input->send($send);\n\t\t\t\t\t} catch(Throwable $e) {\n\t\t\t\t\t\t$input->throw($e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $input->getReturn();\n\t\t\t})();\n\t\t}\n\n\t\treturn $wrapped;\n\t}",
"function foo() {\n\tyield 1;\n\tyield from [2,3,4];\n\tyield 5;\n}",
"function map(array $array, callable $callback): array\n{\n\treturn \\array_map($callback, $array);\n}",
"public function loadMultiple(array $ids = []): \\Generator;",
"public function generate()\n {\n $args = func_get_args();\n $res = call_user_func_array($this->get_generator(), $args);\n return $res;\n }",
"function chain($funcs,$args=NULL) {\n\t\t$out=array();\n\t\tforeach (is_array($funcs)?$funcs:$this->split($funcs) as $func)\n\t\t\t$out[]=$this->call($func,$args);\n\t\treturn $out;\n\t}",
"function chain($funcs,$args=NULL) {\n\t\t$out=array();\n\t\tforeach (is_array($funcs)?$funcs:$this->split($funcs) as $func)\n\t\t\t$out[]=$this->call($func,$args);\n\t\treturn $out;\n\t}",
"private function middleware_generator ($request, $middlewares): Iterable {\n $response = [];\n\n foreach($middlewares as $callback) {\n $response = $callback($request, $response);\n yield $response;\n }\n }",
"function zip(iterable $as): callable\n{\n return static function (iterable $bs) use ($as): Generator {\n $i = new MultipleIterator();\n $i->attachIterator($as instanceof Iterator ? $as : new ArrayIterator($as));\n $i->attachIterator($bs instanceof Iterator ? $bs : new ArrayIterator($bs));\n foreach ($i as $values) {\n yield $values;\n }\n };\n}",
"public static function map(array $array, callable $callback) : array\n {\n $result = [];\n foreach ($array as $key => $item) {\n $response = $callback($item, $key);\n if (is_array($response)) {\n $result[current(array_keys($response))] = current(array_values($response));\n } else {\n $result[$key] = $response;\n }\n }\n return $result;\n }",
"public static function map($callback)\n {\n if (!is_callable($callback)) {\n throw new \\InvalidArgumentException('$callback isn\\'t callable');\n }\n\n $iter = D::zip(array_slice(func_get_args(), 1));\n\n return static::reduce($iter, function ($result, $item) use ($callback) {\n $result[] = call_user_func_array($callback, $item);\n return $result;\n }, []);\n }",
"function map(array $objects, callable $function)\n{\n return array_map($function, $objects);\n}",
"function arrayMap($callback, $arr1)\n{\n $results = array();\n $args = array();\n if (func_num_args() > 2) $args = (array)array_shift(array_slice(func_get_args() , 2));\n foreach ($arr1 as $index => $value) {\n $temp = $args;\n array_unshift($temp, $value);\n if (is_array($value)) {\n array_unshift($temp, $callback);\n $results[$index] = call_user_func_array(array(\n 'self',\n 'arrayMap'\n ) , $temp);\n }\n else {\n $results[$index] = call_user_func_array($callback, $temp);\n }\n }\n\n return $results;\n}",
"function execute_gatherers(array $gatherers): array {\n\n\t$report = [];\n\n\tforeach ($gatherers as $path) {\n\n\t\t$name = basename($path);\n\t\tif (!is_readable($path)) {\n\t\t\tinfo(sprintf(\"Gatherer '%s' not found. Skipping.\", $path));\n\t\t\tcontinue;\n\t\t}\n\n\t\tinfo(\"Gathering from '$name' ...\");\n\t\texec(\"chmod +x $path\");\n\t\texec($path, $resultLines, $retval);\n\n\t\tif ($retval !== 0) {\n\t\t\tinfo(sprintf(\"Gatherer '%s' returned non-zero value %d. Skipping.\", $name, $retval));\n\t\t\tcontinue;\n\t\t}\n\n\t\t$data = parse_ini_string(implode(\"\\n\", $resultLines), false, INI_SCANNER_TYPED);\n\t\tif ($data === false) {\n\t\t\tinfo(sprintf(\"Gatherer '%s' returned invalid data. Skipping.\", $name));\n\t\t\tcontinue;\n\t\t}\n\n\t\t$report += $data;\n\n\t}\n\n\treturn $report;\n\n}",
"protected function makePromises(): Traversable\n {\n foreach ($this->getMetadataList() as $metadata) {\n $link = $metadata->getResource($this->getResourceType());\n if ('' === $link) {\n continue;\n }\n yield $metadata->uuid() => $this->satHttpGateway->getAsync($link);\n }\n }",
"public function asyncMapN(callable ...$callbacks): Collection;",
"function chain(iterable ...$iterables): Iterator\n{\n return Iterator::from(static function () use ($iterables): Generator {\n foreach ($iterables as $iterable) {\n yield from $iterable;\n }\n });\n}",
"public static function invoke($array, $callable, $arguments = array())\n {\n // If one argument given for each iteration, create an array for it\n if (!is_array($arguments)) {\n $arguments = ArraysMethods::repeat($arguments, sizeof($array));\n }\n\n // If the callable has arguments, pass them\n if ($arguments) {\n return array_map($callable, $array, $arguments);\n }\n\n return array_map($callable, $array);\n }",
"function generateCombinations(array $values, int $count = 0)\n {\n $permCount = count($values) ** $count;\n\n // Iterate and yield:\n for ($i = 0; $i < $permCount; $i++) {\n yield getCombination($values, $count, $i);\n }\n }",
"function array_map (callable $callback, array $arr1, array $_ = null) {}",
"public static function concat()\n {\n foreach (func_get_args() as $xs) {\n foreach ($xs as $x) {\n yield $x;\n }\n }\n }",
"abstract public function process($values): array;",
"function gen_one_to_three()\n{\n for ($i = 1; $i <= 3; $i++) {\n // Note that $i is preserved between yields.\n yield $i;\n }\n}",
"public function provideArrayMergeWithDynamicNumberOfArrays(): Generator\n {\n yield 'merging a single array' => [\n [0 => 'a', 'a' => 2, 1 => 1],\n [1 => 'a', 'a' => 2, '4' => 1]\n ];\n\n yield 'combined with array union operator' => [\n [0 => 1, 1 => 2, 2 => 3],\n [1, 2, 3] + [4, 5, 6],\n ];\n }",
"public function emitBatch(array $events);",
"function gen_one_to_three() {\r\n for ($i = 1; $i <= 3; $i++) {\r\n // Note that $i is preserved between yields.\r\n yield $i;\r\n }\r\n}",
"protected function combine(?array $values)\r\n {\r\n $class = $this->algorithm;\r\n $algorithm = new $class;\r\n return $algorithm->evaluate($values);\r\n }",
"function map($list, callable $callback): array\n{\n $agg = [];\n\n /**\n * @var array-key $key\n */\n foreach ($list as $key => $value) {\n $agg[$key] = $callback($value, $key);\n }\n\n return $agg;\n}"
] | [
"0.72675216",
"0.57339376",
"0.5540953",
"0.52563274",
"0.51697844",
"0.5161776",
"0.5148515",
"0.5138116",
"0.5138116",
"0.5028591",
"0.5018796",
"0.5005478",
"0.49710742",
"0.4963106",
"0.49470234",
"0.49401265",
"0.4901148",
"0.487456",
"0.4839444",
"0.48339158",
"0.4829383",
"0.47889024",
"0.47879133",
"0.47657228",
"0.47582582",
"0.47499686",
"0.47498143",
"0.47417328",
"0.47343978",
"0.47204927"
] | 0.6163603 | 1 |
Executes a callbackstyle async function using JavaScript Promiselike API. This differs from JavaScript Promise in that $closure is NOT executed until it is yielded and processed by an Await runtime. | public static function promise(Closure $closure) : Generator{
$resolve = yield Await::RESOLVE;
$reject = yield Await::REJECT;
$closure($resolve, $reject);
return yield Await::ONCE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function async(\\Closure $unitOfWork, mixed ...$args): Future;",
"public function toClosure(): \\Closure;",
"public function executeAsynchronous( Command $command, \\Closure $localCallback = null ) {\n return $this->fork( $command, $localCallback );\n }",
"public static function f2c(callable $closure, ?callable $onComplete = null, $catches = []) : Await{\n\t\treturn self::g2c($closure(), $onComplete, $catches);\n\t}",
"public function closure()\n {\n return $this->_closure;\n }",
"public function execute(Closure $callback)\n {\n $this->callback = $callback;\n\n return $this;\n }",
"public function __invoke(\\Closure $closure): string;",
"public function promise();",
"public function make(Closure $callback = null);",
"public function execDynamicClosure($closure, array $args)\n {\n $clone = $closure->bindTo($this, $this);\n\n return call_user_func_array($clone, $args);\n }",
"public function wait($callback = null)\n {\n parent::wait($callback);\n\n return $this->getReturnValue();\n }",
"abstract public function function(): Closure;",
"function run(){\n\t\treturn $this->closure;\n\t}",
"public function callback($callback);",
"abstract public function execute(Request_Async $request_async);",
"protected function executeCallback($class, $method, $args, \\Closure $closure)\n {\n //todo add caching here\n $result = call_user_func($closure);\n\n $this->queryBuilder->resetBuilder();\n\n return $result;\n }",
"public function run($callback);",
"public function executeClosure(\n ProxyInterface $object,\n string &$methodName,\n array &$arguments,\n Visibility &$requiredScope,\n string &$statedClassOrigin,\n callable &$returnCallback\n ): StateInterface;",
"public function getCallback();",
"protected function ExecuteClosure($Closure, $CaptureOutput) {\n\n if ($CaptureOutput) {\n ob_start();\n }\n\n // execute and measure\n $this->MeasuringClosureStart();\n $Result= call_user_func($Closure);\n $this->MeasuringClosureEnd();\n\n // what to return\n return $CaptureOutput\n ? ob_get_clean()\n : $Result;\n }",
"abstract protected function getCallbackCase(): callable;",
"public function executeAsync($command);",
"public function run( callable$task ):Promise\n\t{\n\t\treturn new Promise( $this->_event_loop, function( $resolve, $reject )use( $task ){\n\t\t\t\n\t\t\t$gen= $task();\n\t\t\t\n\t\t\tif(!( $gen instanceof \\Generator ) )\n\t\t\t\treturn $resolve( $gen );\n\t\t\t\n\t\t\t$connect= $step= null;\n\t\t\t\n\t\t\t$connect= function()use( $gen, &$step ){\n\t\t\t\t$current= $gen->current();\n\t\t\t\t\n\t\t\t\tif( !self::is_thenable( $current ) )\n\t\t\t\t\t$current= Promise::resolve( $this->_event_loop, $current );\n\t\t\t\t\n\t\t\t\t$current->then( $step );\n\t\t\t};\n\t\t\t\n\t\t\t$step= function( $value )use( $gen, $resolve, &$connect ){\n\t\t\t\t$gen->send( $value );\n\t\t\t\t\n\t\t\t\tif( $gen->valid() )\n\t\t\t\t\t$connect();\n\t\t\t\telse\n\t\t\t\t\t$resolve( $gen->getReturn() );\n\t\t\t};\n\t\t\t\n\t\t\t$connect();\n\t\t} );\n\t}",
"protected function call(\\Closure $closure)\n {\n $closureParameters = (new ReflectionFunction($closure))->getParameters();\n\n call_user_func($closure, $this->fulfill(... $closureParameters));\n }",
"abstract public function run(Task $task, \\Closure $callback = null);",
"function getClosure()\n {\n return function () {\n return $this->val;\n };\n }",
"public static function execStaticCallable(Closure $closure, array $args)\n {\n $clone = $closure->bindTo(null, static::class);\n\n return call_user_func_array($clone, $args);\n }",
"public function execute()\n {\n $callable = $this->callable;\n return $callable();\n }",
"public function getClosure()\n {\n return $this->closure;\n }",
"public function callAsync(): RestClientResponseInterface\n {\n }"
] | [
"0.6700503",
"0.575971",
"0.550533",
"0.54172254",
"0.5351845",
"0.5273665",
"0.52631354",
"0.5257789",
"0.5210434",
"0.520013",
"0.5165893",
"0.51298946",
"0.5112124",
"0.510113",
"0.50955486",
"0.5091235",
"0.50820553",
"0.50562286",
"0.504175",
"0.5026967",
"0.5017411",
"0.500728",
"0.4993382",
"0.4971741",
"0.4956236",
"0.49407554",
"0.48925394",
"0.48905703",
"0.48849776",
"0.48657432"
] | 0.62026817 | 1 |
Add a new method to be called during modifier processing. | public function addModifier($method_name, $arguments = array()) {
// @todo Maybe we should validate the method names here?
$this->modifiers[] = array(
'method_name' => $method_name,
'arguments' => $arguments,
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function add($modifier)\n {\n $this->modifiers->push($modifier);\n }",
"public function setMethods($var) {}",
"public function addMethod(PhpMethod $method) {\n array_push($this->methods, $method);\n }",
"public function modifier()\n {\n }",
"public function modifier()\n {\n }",
"public function add(Closure $modifier): QueryModifier;",
"public function setMethod(&$method);",
"protected function addMagicMethods()\n {\n foreach ($this->magicMethods as $magic => $real) {\n list($className, $name) = explode('::', $real);\n if ((!class_exists($className) && !interface_exists($className)) || !method_exists($className, $name)) {\n continue;\n }\n $method = new \\ReflectionMethod($className, $name);\n $class = new \\ReflectionClass($className);\n\n if (!in_array($magic, $this->usedMethods)) {\n if ($class !== $this->root) {\n $this->methods[] = new Method($method, $this->alias, $class, $magic, $this->interfaces, $this->classAliases);\n }\n $this->usedMethods[] = $magic;\n }\n }\n }",
"public function setMethod($var) {}",
"public function hookMethod()\n {\n }",
"abstract public function setMethod($method);",
"public function addModifier($modifier)\n {\n $modifier = \"\\\\PHP\\\\Expando\\\\Modifier\\\\$modifier\";\n $this->_modifiers[] = new $modifier($this->_path);\n return $this;\n }",
"public function setMethod($method);",
"public function setMethod($method);",
"public function setMethod($method);",
"public function setMethod($method);",
"public function setMethod($method);",
"public function registerMethod($method) { \n $this->methods[] = $method;\n }",
"function add_method($method) {\n\t\tif (false !== $this->closed_xml) {\n\t\t\tthrow new Exception($GLOBALS[\"lib_cake_errors\"][CLOSED_XML], CLOSED_XML);\n\t\t}\n\n\t\t$this->insert(\"<method type=\\\"\" . rawurlencode($method) . \"\\\">\");\n\t\t$this->depth += 2;\t\n\t}",
"public function setAddMethod()\n {\n return $this->setCalendar('method', Calendar::METHOD_ADD);\n }",
"public static function mapModifier($name, $function)\n\t{\n\t\t// validate modifier\n\t\tif(!SpoonFilter::isValidAgainstRegexp('/[a-zA-Z0-9\\_\\-]+/', (string) $name)) throw new SpoonTemplateException('Modifier names can only contain a-z, 0-9 and - and _');\n\n\t\t// class method\n\t\tif(is_array($function))\n\t\t{\n\t\t\t// not enough elements\n\t\t\tif(count($function) != 2) throw new SpoonTemplateException('The array should contain the class and static method.');\n\n\t\t\t// method doesn't exist\n\t\t\tif(!method_exists($function[0], $function[1])) throw new SpoonTemplateException('The method \"'. $function[1] .'\" in the class '. $function[0] .' does not exist.');\n\n\t\t\t// all fine\n\t\t\tself::$modifiers[(string) $name] = $function;\n\t\t}\n\n\t\t// regular function\n\t\telse\n\t\t{\n\t\t\t// function doesn't exist\n\t\t\tif(!function_exists((string) $function)) throw new SpoonTemplateException('The function \"'. (string) $function .'\" does not exist.');\n\n\t\t\t// all fine\n\t\t\tself::$modifiers[(string) $name] = $function;\n\t\t}\n\t}",
"public function addMethod($method)\n {\n $this->methods[] = $method;\n\n return $this;\n }",
"public function mapModifier($name, $function)\n\t{\n\t\tSpoonTemplateModifiers::mapModifier($name, $function);\n\t}",
"public function run() {\n $alter_log = array();\n $total_requested = count($this->modifiers);\n foreach ($this->modifiers as $key => $modifier) {\n if (!method_exists($this, $modifier['method_name'])) {\n \\MigrationTools\\Message::make('The modifier method @method does not exist and was skipped.', array('@method' => $modifier['method_name']), WATCHDOG_DEBUG);\n }\n // The modifier exists, so run it.\n // Reset QueryPath pointer to top of document.\n $this->queryPath->top();\n\n $count = call_user_func_array(array($this, $modifier['method_name']), $modifier['arguments']);\n // Record only what worked.\n if ($count) {\n $args = implode(', ', $modifier['arguments']);\n $alter_log[] = \"x{$count} {$modifier['method_name']}({$args}) \";\n }\n }\n \\MigrationTools\\Message::makeSummary($alter_log, $total_requested, 'Modifiers applied successfully:');\n }",
"public function defineMethods() {\n\t\t$methodNames = $this->allMethodNames();\n\t\tforeach($methodNames as $methodName) {\n\t\t\tif(substr($methodName,0,8) == 'generate') {\n\t\t\t\t$this->addWrapperMethod(substr($methodName,8), 'getFormattedImage');\n\t\t\t}\n\t\t}\n\t\t\n\t\tparent::defineMethods();\n\t}",
"public function add($callable);",
"function setMethod($methodVerb);",
"public function addModifier($name) {\n\t\tif(isset($this->form->modifier[$name])) {\n\t\t\tif(!in_array($name, $this->modifier)) {\n\t\t\t\t$this->modifier[] = $name;\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}",
"function registerMethod($name, $method) {\r\n\t\t$this->methods[$name] = $method;\r\n\t}",
"public function _remap($method)\n {\n if (method_exists($this, $method)) {\n $this->{\"{$method}\"}();\n }\n }"
] | [
"0.6579254",
"0.61538285",
"0.61384594",
"0.6129755",
"0.6129755",
"0.6076841",
"0.6002394",
"0.5987389",
"0.5984822",
"0.59408975",
"0.5925683",
"0.5922628",
"0.58735704",
"0.58735704",
"0.58735704",
"0.58735704",
"0.58735704",
"0.5828174",
"0.58241624",
"0.57986206",
"0.57896644",
"0.57624006",
"0.57062995",
"0.5701726",
"0.56887186",
"0.5670872",
"0.5665768",
"0.5651841",
"0.56016326",
"0.55865616"
] | 0.7259237 | 0 |
Runs the modifiers and reports which were successful. | public function run() {
$alter_log = array();
$total_requested = count($this->modifiers);
foreach ($this->modifiers as $key => $modifier) {
if (!method_exists($this, $modifier['method_name'])) {
\MigrationTools\Message::make('The modifier method @method does not exist and was skipped.', array('@method' => $modifier['method_name']), WATCHDOG_DEBUG);
}
// The modifier exists, so run it.
// Reset QueryPath pointer to top of document.
$this->queryPath->top();
$count = call_user_func_array(array($this, $modifier['method_name']), $modifier['arguments']);
// Record only what worked.
if ($count) {
$args = implode(', ', $modifier['arguments']);
$alter_log[] = "x{$count} {$modifier['method_name']}({$args}) ";
}
}
\MigrationTools\Message::makeSummary($alter_log, $total_requested, 'Modifiers applied successfully:');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function process() {\n\t\tif (!$this->checkPermissions()) {\n\t\t\treturn $this->failure($this->modx->lexicon('access_denied'));\n\t\t}\n\n\t\treturn parent::process();\n\t}",
"function run() {\n\t\t// rather than being one greater than the last known update\n\n\t\treturn UPDATE_SUCCESS;\n\n\t}",
"public function run()\n {\n $this->level();\n }",
"public function testModifyAbilityScore():void\n {\n $this->abilityScoreManager->getStrength()->addModifier('oger krafthandschuhe', 4);\n $modifiers = $this->abilityScoreManager->getStrength()->listModifiers();\n $this->assertEquals([['oger krafthandschuhe',4]], $modifiers);\n\n //calculate modified abilityscore\n $this->assertEquals(4, $this->abilityScoreManager->getStrength()->getAbilityModifier());\n\n //remove modifier\n $this->abilityScoreManager->getStrength()->removeModifier('oger krafthandschuhe');\n $modifiers = $this->abilityScoreManager->getStrength()->listModifiers();\n $this->assertEquals([], $modifiers);\n }",
"public function actionRun(){\n\t\t$info = ReportAnalyseFiles::find()\n\t\t\t->where([ 'status' => -1 ])\n\t\t\t->orderBy([ 'id' => SORT_ASC ])\n\t\t\t->one();\n\n\t\tif( !$info ){\n\t\t\treturn $this->echoLog(\"no data need to handle\");\n\t\t}\n\n\t\t$ret = false;\n\n\t\tswitch ( $info['action'] ){\n\t\t\tcase 1:\n\t\t\t\t$ret = $this->handleKeyword( $info );\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$info->status = $ret?1:0;\n\t\t$info->updated_time = date(\"Y-m-d H:i:s\");\n\t\t$info->update(0);\n\t\treturn $this->echoLog(\"it's over\");\n\t}",
"public function doRun(): bool;",
"protected function perform(...$args)\n {\n $this->moderateable->activate();\n }",
"protected function afterPasses(){}",
"function PostModeration()\n{\n\t// !! We'll shift these later bud.\n\tloadLanguage('ModerationCenter');\n\tloadTemplate('ModerationCenter');\n\n\t// Probably need this...\n\tloadSource('ModerationCenter');\n\n\t// Allowed sub-actions, you know the drill by now!\n\t$subactions = array(\n\t\t'approve' => 'ApproveMessage',\n\t\t'posts' => 'UnapprovedPosts',\n\t\t'topics' => 'UnapprovedPosts',\n\t);\n\n\t// Pick something valid...\n\tif (!isset($_REQUEST['sa']) || !isset($subactions[$_REQUEST['sa']]))\n\t\t$_REQUEST['sa'] = 'posts';\n\n\t$subactions[$_REQUEST['sa']]();\n}",
"protected function postprocessSuccessActionModify()\n {\n \\XLite\\Core\\TopMessage::addInfo('Profile has been modified successfully');\n }",
"public function execute()\n {\n //Now load all patches, and save the resulting changed patches for later (not used yet)\n $changed = $this->patcher->uploadPatches($this->loader->getVersions()->getBuild());\n\n\n if ($changed) {\n $this->getBatch()->addMessage(sprintf($this->_('%d new or changed patch(es).'), $changed));\n }\n }",
"public function run()\n {\n if (! $this->actions){\n return;\n }\n\n return $this->runHooks($this->actions);\n }",
"public function runPostHooks() {\n $success = true;\n /* load posthooks */\n $this->formit->loadHooks('post',$this->config);\n $this->formit->postHooks->loadMultiple($this->config['hooks'],$this->dictionary->toArray());\n\n /* process form */\n if ($this->formit->preHooks->hasErrors() && $this->modx->getOption('preventPostHooksIfPreHooksErrors',$this->config,true)) {\n /* prevent scripts from running with prehook errors */\n $success = false;\n $this->formit->preHooks->processErrors();\n } elseif ($this->formit->postHooks->hasErrors()) {\n $success = false;\n $this->formit->postHooks->processErrors();\n } else {\n /* assign new values from postHooks */\n $this->dictionary->fromArray($this->formit->postHooks->fields);\n }\n return $success;\n }",
"function run()\r\n {\r\n $cmd = getRequest('cmd');\r\n \r\n switch($cmd)\r\n { \r\n \t case 'ViewEmployeeProfile'\t\t: $this->ViewEmployeeProfile(); \t\tbreak;\r\n \t case 'ViewPersonalProfile' \t: $this->ViewPersonalProfile(); \t\tbreak;\r\n \t\t case 'PersonalPhotoUpSkin' \t: $this->PersonalPhotoUpSkin(); \tbreak;\r\n case 'UploadPersonalPhoto' \t: $this->UploadPersonalPhoto(); \t\tbreak;\r\n case 'add'\t\t\t\t\t\t: $this->showEditor(\"change pass\"); \tbreak;\r\n case 'change'\t\t\t\t\t: $this->showSuccessText(); \t\t\tbreak;\r\n case 'fail'\t\t\t\t\t: $this->showFailureText(); \t\t\tbreak;\r\n default\t\t\t\t\t\t: $cmd = 'add'; $this->showEditor(\"change pass\");\r\n }\r\n \r\n if($cmd=='add')\r\n {\r\n include_once(CURRENT_APP_SKIN_FILE);\r\n }\r\n \r\n return true; \r\n }",
"protected function executeProlog() {}",
"public function execute()\n {\n echo $result = $this->_check();\n }",
"public function processCommandPending() {\n $statusCode = $this->updateSoftware();\n if ($statusCode!=200) echo \"ERROR updating files: \".$this->yellow->page->get(\"pageError\").\"\\n\";\n echo \"Your website has \".($statusCode!=200 ? \"not \" : \"\").\"been updated: Please run command again\\n\";\n return $statusCode;\n }",
"function run( ) { \n $this->preProcess( ); \n return parent::run( );\n }",
"public function run()\n {\n $this->call(adminRoles::class);\n $this->call(editAdministrationPermission::class);\n $this->call(editPostPermission::class);\n $this->call(editUsersPermission::class);\n $this->call(editRolesPermission::class);\n $this->call(moderatorRoles::class);\n $this->call(ownerRoles::class);\n $this->call(ownerUsers::class);\n $this->call(permissionRole::class);\n $this->call(viewPerPermission::class);\n }",
"public function run()\n {\n $permission = [\n [\n 'id' => 65,\n 'name' => 'tools-update-existing_prime_code',\n 'display_name' => 'Allow to update existing Prime code',\n 'description' => 'Allow to update prime code and meta-activity in case it was already used and found in a Prime upload',\n ],\n ];\n\n foreach ($permission as $key => $value) {\n Permission::create($value);\n }\n }",
"public function process() {\n $command = $this->getCommand();\n if ($command != null) {\n $this->verifyCommand($command);\n } else {\n $this->help();\n }\n }",
"public function run()\n {\n if (count($this->args) <= 1) {\n $this->help();\n return static::EXIT_CODE_ARGS_LIST;\n }\n\n switch ($this->args[1]) {\n case 'generate':\n return $this->runGenerate();\n break;\n\n case 'runTests':\n return $this->runTests();\n break;\n\n case 'help':\n case '--help':\n default:\n $this->help();\n return static::EXIT_CODE_OK;\n }\n }",
"protected function innerExecute()\n\t{\n\t if ($this->isExecuted()) {\n\t return $this->manageMatchAllEarlierResults();\n\t }\n\n $input = $this->getInputFromAction();\n if ($input) {\n $this->setRegex(new \\Gbili\\Regex\\Regex($input, $this->regexStr));\n $this->lastInput = $input;\n \n $this->regex->execute($this->useMatchAll);\n return $this->regex->isValid();\n //@todo after the regex is applied, a callback should be allowed to attempt to refactor the output\n }\n\n return false;\n\t}",
"public function doExecute()\n\t{\n\t\t$args = $this->input->args;\n\t\t$args = implode(' ', $args);\n\n\t\tif ($args == 'add subsystem')\n\t\t{\n\t\t\t$this->check();\n\t\t\t$this->addSubsystem();\n\t\t}\n\t\telseif ($args == 'project init')\n\t\t{\n\t\t\t$this->check();\n\t\t\t$this->initProject();\n\t\t}\n\t\telseif ($args == 'convert template')\n\t\t{\n\t\t\t$this->check();\n\t\t\t$this->convertTemplate();\n\t\t}\n\t\telseif ($this->input->get('help') == 1)\n\t\t{\n\t\t\t$this->showHelp();\n\t\t}\n\n\t\t$this->showHelp();\n\n\t\t$this->out(\"Command {$args} not found.\");\n\t\t$this->close();\n\t}",
"public function postUpdate() {\n\n\t\t$this->cmd_order = 0;\n\n\t\t$this->addCommandKey(\"POWER\", \"power\", \"fa-power-off\");\n\t\t$this->addCommandKey(\"AUX_INPUT\", \"aux\");\n\n\t\t$this->addCommandKey(\"PRESET_1\", \"1\");\n\t\t$this->addCommandKey(\"PRESET_2\", \"2\");\n\t\t$this->addCommandKey(\"PRESET_3\", \"3\");\n\t\t$this->addCommandKey(\"PRESET_4\", \"4\");\n\t\t$this->addCommandKey(\"PRESET_5\", \"5\");\n\t\t$this->addCommandKey(\"PRESET_6\", \"6\");\n\n\t\t$this->addCommandKey(\"PLAY\", \"play\", \"fa-play\");\n\t\t$this->addCommandKey(\"PAUSE\", \"pause\", \"fa-pause\");\n\t\t// $this->addCommandKey(\"PLAY_PAUSE\",\"play\");\n\n\t\t$this->addCommandKey(\"VOLUME_UP\", \"vol up\", \"\");\n\t\t$this->addCommandKey(\"VOLUME_DOWN\", \"vol down\", \"\");\n\t\t// $this->addCommandKey(\"PLAY_PAUSE\",\"play\");\n\n\t\t$this->addCommandKey(\"PREV_TRACK\", \"prev track\", \"fa-fast-backward\");\n\t\t$this->addCommandKey(\"NEXT_TRACK\", \"next track\", \"fa-fast-forward\");\n\n\t\t$this->addCommandKey(\"ADD_FAVORITE\", \"add favorite\", \"fa-smile-o\");\n\t\t$this->addCommandKey(\"REMOVE_FAVORITE\", \"remove favorite\", \"fa-frown-o\");\n\n\t\t$this->addCommandVolume(\"\", false);\n\t\t//\t$this->addCommandSay(\"\");\n\n\t}",
"protected function passesChecks()\n {\n if ($this->runsOnce && CommandRecord::hasCompleted($this->name)) {\n return $this->fail(\"Command has run before.\");\n }\n\n if ($this->runsOnce && CommandRecord::isInProgress($this->name)) {\n return $this->fail(\"Command is running.\");\n }\n\n if ($this->hasRunTooManyTimes()) {\n return $this->fail(\"Command has been run or requested too many times.\");\n }\n\n foreach ($this->runsIf as $name) {\n if (! CommandRecord::hasCompleted($name)) {\n return $this->fail(\"Command {$name} has not run yet.\");\n }\n }\n\n foreach ($this->doesntRunIf as $name) {\n if (CommandRecord::hasCompleted($name)) {\n return $this->fail(\"Command {$name} has already run.\");\n }\n }\n\n if ($this->commandRecord()->hasStarted()) {\n throw new \\Exception('The monitored command ' . $this->commandRecord()->id . ' has already started.');\n }\n\n return true;\n }",
"protected function doRun()\n {\n $this->setRunResult(\n $this->strategy->run(\n $this->converter->run(\n $this->api->run(\n $this->context\n )\n )\n )\n );\n }",
"public function run()\n {\n $this->criarAdmin();\n<<<<<<< HEAD\n $this->criarCoord();\n $this->criarProf();\n $this->criarAten();\n=======\n>>>>>>> ecd420b87383ebef89dc91064cd10d2a7b2649ce\n }",
"function run_tool()\n\t{\n\t\tif (!function_exists('cache_moderators'))\n\t\t{\n\t\t\tglobal $phpbb_root_path, $phpEx;\n\n\t\t\tinclude(\"{$phpbb_root_path}includes/functions_admin.$phpEx\");\n\t\t}\n\n\t\tcache_moderators();\n\n\t\ttrigger_error('RECACHE_MODERATORS_COMPLETE');\n\t}",
"protected function _afterModify()\r\n\t{}"
] | [
"0.5440896",
"0.52705365",
"0.5178008",
"0.50852495",
"0.5058402",
"0.5042046",
"0.5036745",
"0.49995688",
"0.4968356",
"0.49576467",
"0.49247673",
"0.4909162",
"0.4905525",
"0.48952132",
"0.48704702",
"0.47985253",
"0.4783247",
"0.4775595",
"0.4774904",
"0.47615892",
"0.47573733",
"0.4738387",
"0.47367433",
"0.47316942",
"0.4726157",
"0.47238952",
"0.47234157",
"0.47225502",
"0.4703461",
"0.47028854"
] | 0.7303085 | 0 |
/ Function to get deactivated results param 1 : listComp : List of company ids param 2 : branchQuery : | function getDeactivatedUsers($company_id,$branchQuery='')
{
$listComp=$this->getChildCompanies_1($company_id);
if(empty($listComp))$listComp=1;
/*$sqlGetDeaactivUsers="SELECT u.user_id,u.username,ot.type_name access_level,u.name fname,if(u.surname<>'',u.surname,'-') surname,if(u.accnt_locked <>'N','Failed Login 3 Times',if(u.6months_deactivation<>'N','Not Logged in for 6 Months',if(u.active<>'Y','Manually Deactivated by Admin','-'))) reason,c.name region,'-' branch
FROM users u,company c,comp_users cu,officer_types ot
WHERE u.user_id=cu.user_id and (u.access_level='company1' or u.access_level='company2' or u.access_level='company3' or u.access_level='company4')
and u.officer_type=ot.type_id and c.company_id=cu.company_id and u.active = 'N' and u.accnt_locked = 'Y' and c.company_id IN ($listComp) GROUP BY u.user_id
UNION
SELECT u.user_id,u.username,'Officer' access_level,u.name fname,if(u.surname<>'',u.surname,'-') surname,if(u.accnt_locked <>'N','Failed Login 3 Times',if(u.6months_deactivation<>'N','Not Logged in for 6 Months',if(u.active<>'Y','Manually Deactivated by Admin','-'))) reason,c.name region,o.name branch
FROM users u,liason_officer lo1,lo_org lo2,organisation o,company c
WHERE u.user_id=lo1.user_id and lo1.lo_id=lo2.lo_id and lo2.org_id=o.org_id and o.company_id=c.company_id and u.access_level='officer' and u.active = 'N' and u.accnt_locked = 'Y' $branchQuery
GROUP BY u.user_id
";*/
$sqlGetDeaactivUsers="SELECT u.user_id,u.username,ot.type_name access_level,u.name fname,if(u.surname<>'',u.surname,'-') surname,if(u.accnt_locked <>'N','Failed Login 3 Times',if(u.6months_deactivation<>'N','Not Logged in for 6 Months',if(u.active<>'Y','Manually Deactivated by Admin','-'))) reason,c.name region,'-' branch
FROM users u,company c,comp_users cu,officer_types ot
WHERE u.user_id=cu.user_id and (u.access_level='company1' or u.access_level='company2' or u.access_level='company3' or u.access_level='company4')
and u.officer_type=ot.type_id and c.company_id=cu.company_id and u.active = 'N' and (u.accnt_locked = 'N' OR u.accnt_removed = 'N') and c.company_id IN ($listComp) GROUP BY u.user_id";
$result=$this->getDBRecords($sqlGetDeaactivUsers);
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function CourseTypeList($branch)\r\n{\r\n$sql = $this->done->prepare(\"SELECT `C_Code`,`C_Ins_Method` from `course` WHERE (Branch = FIND_IN_SET('COL/A', Branch) OR Branch = FIND_IN_SET('COL/A', Branch)) AND C_Status = 'Active' ORDER BY `C_Code` ASC\");\r\n$sql->execute(array($branch,\"ALL\",\"Active\"));\r\nreturn $sql->fetchALL(PDO::FETCH_OBJ);\r\n}",
"public function getBranchs($data = array(),$filter_array=array()){\n\t\t$sql = \"SELECT *,CONCAT(ib.first_name,' ',ib.last_name) as name,am.email FROM `\" . DB_PREFIX . \"international_branch` ib LEFT JOIN `\" . DB_PREFIX . \"account_master` am ON am.user_name=ib.user_name AND am.user_id = ib.international_branch_id AND am.user_type_id = '4' LEFT JOIN \" . DB_PREFIX . \"address addr ON (ib.address_id = addr.address_id) WHERE ib.is_delete = '0'\";\n\t\t//echo $sql;die;\t\t\n\t\tif(!empty($filter_array)){\t\t\t\n\t\t\tif(!empty($filter_array['email'])){\n\t\t\t\t$sql .= \" WHERE am.email LIKE '%\".$filter_array['email'].\"%'\";\n\t\t\t}\t\t\t\n\t\t\tif($filter_array['status'] != ''){\n\t\t\t\t$sql .= \" WHERE ib.status = '\".$filter_array['status'].\"' \";\n\t\t\t}\t\t\t\n\t\t\tif(!empty($filter_array['name'])){\n\t\t\t\t$sql .= \" HAVING name LIKE '%\".$this->escape($filter_array['name']).\"%'\";\n\t\t\t}\t\t\t\t\t\t\t\n\t\t}\t\t\n\t\tif (isset($data['sort'])) {\n\t\t\t$sql .= \" ORDER BY \" . $data['sort'];\t\n\t\t} else {\n\t\t\t$sql .= \" ORDER BY international_branch\";\t\n\t\t}\n\n\t\tif (isset($data['order']) && ($data['order'] == 'DESC')) {\n\t\t\t$sql .= \" DESC\";\n\t\t} else {\n\t\t\t$sql .= \" ASC\";\n\t\t}\t\t\n\t\tif (isset($data['start']) || isset($data['limit'])) {\n\t\t\tif ($data['start'] < 0) {\n\t\t\t\t$data['start'] = 0;\n\t\t\t}\t\t\t\n\t\t\tif ($data['limit'] < 1) {\n\t\t\t\t$data['limit'] = 20;\n\t\t\t}\t\n\t\t\t$sql .= \" LIMIT \" . (int)$data['start'] . \",\" . (int)$data['limit'];\n\t\t}\n\t\t//echo $sql;die;\n\t\t$data = $this->query($sql);\n\t\tif($data->num_rows){\n\t\t\treturn $data->rows;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function getCompanyBranchList($companyid,$branchid=false,$unionbranchid=false,$groupid=false){\n\t\t//DB::select( DB::raw('set sql_mode='''));\n $companyBranch = CompanyBranch::where('company_id',$companyid);\n if($branchid!=false && $branchid!=''){\n $companyBranch->where('id',$branchid);\n }\n if($unionbranchid!=false && $unionbranchid!=''){\n $companyBranch->where('union_branch_id',$unionbranchid);\n }\n if($groupid!=false && $groupid!=''){\n $union_branch_ids = DB::table('union_group_branches')->where('union_group_id',$groupid)->pluck('union_branch_id');\n $companyBranch->whereIn('union_branch_id',$union_branch_ids);\n }\n $companyBranch->where('status',1);\n \n return $companyBranch->get();\n }",
"public function getabandonedAction()\n {\n \tif (!$this->_authenticate()) {\n \t\treturn;\n \t}\n \n \ttry {\n \t\t$request = $this->getRequest();\n \t\t$helper = Mage::helper('eyehubspot');\n \t\t$maxperpage = $request->getParam('maxperpage', self::MAX_ORDER_PERPAGE);\n \t\t$multistore = $request->getParam ('multistore', self::IS_MULTISTORE );\n \t\t$maxAssociated = $request->getParam('maxassoc', self::MAX_ASSOC_PRODUCT_LIMIT);\n \t\t$start = date('Y-m-d H:i:s', $request->getParam('start', 0));\n \t\t$end = date('Y-m-d H:i:s', time() - $request->getParam('offset', self::IS_ABANDONED_IN_SECS));\n \t\t$websiteId = Mage::app()->getWebsite()->getId();\n \t\t$store = Mage::app()->getStore();\n \t\t$stores = $helper->getStores();\n \t\t$storeId = Mage::app()->getStore()->getId();\n \t\t$custGroups = $helper->getCustomerGroups();\n \t\t$collection = Mage::getModel('sales/quote')->getCollection();\n \t\t$returnData = array();\n \n \t\t// setup the query and page size\n \t\t$collection->addFieldToFilter('updated_at', array(\n \t\t\t\t'from' => $start,\n \t\t\t\t'to' => $end,\n \t\t\t\t'date' => true\n \t\t))\n \t\t->addFieldToFilter('is_active', array('neq' => 0))\n \t\t->addFieldToFilter('customer_email', array('like' => '%@%'))\n \t\t->addFieldToFilter('items_count', array('gt' => 0))\n \t\t->setOrder('updated_at', Varien_Data_Collection::SORT_ORDER_ASC)\n \t\t->setPageSize($maxperpage);\n \n \t // only add the filter if store id > 0\n if (!($multistore) && $storeId) {\n $collection->addFieldToFilter('store_id', array('eq' => $storeId));\n }\n \n \t\tforeach ($collection as $cart) {\n \t\t\t$result = $helper->convertAttributeData($cart);\n \t\t\t$groupId = (int)$cart->getCustomerGroupId();\n \n \t\t\tif (isset($custGroups[$groupId])) {\n \t\t\t\t$result['customer_group'] = $custGroups[$groupId];\n \t\t\t} else {\n \t\t\t\t$result['customer_group'] = 'Guest';\n \t\t\t}\n \n \t\t\t$result['website_id'] = (isset($stores[$result['store_id']]['website_id']))? $stores[$result['store_id']]['website_id']: $websiteId;\n $result['store_url'] = (isset($stores[$result['store_id']]['store_url']))? $stores[$result['store_id']]['store_url']: $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);\n $result['media_url'] = (isset($stores[$result['store_id']]['media_url']))? $stores[$result['store_id']]['media_url']:$store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); \n $result['shipping_address'] = $helper->convertAttributeData($cart->getShippingAddress());\n \t\t\t$result['billing_address'] = $helper->convertAttributeData($cart->getBillingAddress());\n \t\t\t$result['items'] = array();\n \n \t\t\t$cartItems = Mage::getModel('sales/quote_item')->getCollection()\n \t\t\t->setQuote($cart)\n \t\t\t->setOrder('base_price', Varien_Data_Collection::SORT_ORDER_DESC)\n \t\t\t->setPageSize($maxAssociated);\n \n \t\t\t \n \t\t\tforeach ($cartItems as $item) {\n \t\t\t\tif (!$item->isDeleted() && !$item->getParentItemId()) {\n \t\t\t\t\t$helper->loadCatalogData($item, $storeId, $websiteId, $maxAssociated);\n \t\t\t\t\t$result['items'][] = $helper->convertAttributeData($item);\n \n \t\t\t\t}\n \t\t\t}\n \n \n \t\t\t// make sure there are items before adding to return\n \t\t\tif (count($result['items'])) {\n \t\t\t\t$returnData[$cart->getId()] = $result;\n \t\t\t}\n \t\t}\n \t} catch (Exception $e) {\n \t\t$this->_outputError(\n \t\t\t\tself::ERROR_CODE_UNKNOWN_EXCEPTION,\n \t\t\t\t'Unknown exception on request',\n \t\t\t\t$e\n \t\t);\n \t\treturn;\n \t}\n \n \t$this->_outputJson(array(\n \t\t\t'abandoned' => $returnData,\n \t\t\t'stores' => $stores\n \t));\n }",
"public function getDeclinedCompaniesForDataTable(){\n return $this->query()->where('isvalidated', 3)->orderBy('id', 'asc');\n }",
"function getBranchList($db, $varname, $default = \"\", $extra = \"\", $criteria = \"\", $action = \"\", $listonly = false)\n{\n $strResult = \"\";\n if (!$listonly) {\n $strResult .= \"<select name=\\\"$varname\\\" $action>\\n\";\n }\n $strResult .= $extra;\n $strSQL = \"SELECT * FROM hrd_branch $criteria ORDER BY branch_code \";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n $strCode = $rowDb['branch_code'];\n $strName = $rowDb['branch_name'];\n ($strCode == $default) ? $strSelect = \"selected\" : $strSelect = \"\";\n $strResult .= \"<option value=\\\"$strCode\\\" $strSelect>$strCode - $strName</option>\\n\";\n }\n if (!$listonly) {\n $strResult .= \"</select>\\n\";\n }\n return $strResult;\n}",
"function getBranchListAction($param = 'all'){\n \n require_once MODULES . '/business/models/branch.php';\n $model = new Viven_Model_Branch;\n \n return $model -> getBranchList($param);\n \n }",
"static function getComplaints($params)\n {\n\t$con =$params['dbconnection'];\t\n\t$orders=array(); \n\t$query = \"SELECT \n\tc.*,\n\tu.`name`,\n\tu.`email`,\n\tu.`phone`\n\tFROM `complain` as c INNER JOIN `users` as u ON(c.`user_id`=u.`id`)\n\tORDER BY c.`id` DESC LIMIT \".$params['index'].\",\".$params['index2'].\" \";\n\t$result = mysqli_query($con,$query) ;\n\tif (mysqli_error($con) != '')\n\t return \"mysql_Error:-\".mysqli_error($con);\n\tif (mysqli_num_rows($result) > 0) \n\t{\n\t\t while ($row = mysqli_fetch_assoc($result)) \n\t\t $orders[] = $row;\n\t}\n\t\n\tif(!empty($orders))\n\treturn $orders;\n\telse return '';\n }",
"static function getAllBranches($params)\n {\n\t$con =$params['dbconnection'];\t\n\t$branches=array(); \n\t$branchesCount=\"\";\n\t$search=\"\";\n\tif($params['search']!=\"\")\n\t$search=\"WHERE (b.`name` LIKE '%\".$params['search'].\"%')\";\n\t\n\t\n\tif($params['admin_id'] !=\"\")\n\t{\n\t\t$query = \"SELECT COUNT(b.`id`) as branchesCount FROM `branches` \n\t\tas b INNER JOIN `admin` as a ON(b.`admin_id`=a.`id`)\".$search.\"\";\n\t\t$result = mysqli_query($con,$query) ;\n\t\tif (mysqli_error($con) != '')\n\t\t return \"mysql_Error:-\".mysqli_error($con);\n\t\tif (mysqli_num_rows($result) > 0) \n\t\t{\n\t\t\t $row = mysqli_fetch_assoc($result);\t\n\t\t\t $branchesCount=$row['branchesCount'];\n\t\t}\n\t}\n\t\n\t$query = \"SELECT \n\tb.*,\n\ta.`name` as branchManagerName\n\tFROM `branches` as b INNER JOIN `admin` as a ON(b.`admin_id`=a.`id`)\n\t\".$search.\"\n\tORDER BY b.`id` DESC LIMIT \".$params['index'].\",\".$params['index2'].\" \";\n\t$result = mysqli_query($con,$query) ;\n\tif (mysqli_error($con) != '')\n\t return \"mysql_Error:-\".mysqli_error($con);\n\tif (mysqli_num_rows($result) > 0) \n\t{\n\t\t while ($row = mysqli_fetch_assoc($result)) \n\t\t {\n\t\t\t\t$row['coordinator_id']=$row['admin_id'];\n\t\t\t\tunset($row['admin_id']);\n\t\t\t\t$branches[] = $row;\n\t\t }\n\t}\n\t\n\tif(!empty($branches))\n\t{\n\t\tif( $branchesCount !=\"\")\n\t\treturn array(\"branches\"=>$branches ,\"branchesCount\"=>$branchesCount ) ;\n\t\treturn $branches;\n\t}\n\telse return '';\n }",
"function get_inactive_courses($max_results = MAX_SEARCH_RESULT)\n{\n\tglobal $conn;\n\t$stmt = $conn->prepare('SELECT course_code, course_name\n\t\tFROM tbl_courses WHERE NOT is_active ORDER BY course_code LIMIT :max_results');\n\t$stmt->bindValue(':max_results', $max_results);\n\treturn execute_fetch_all($stmt);\n}",
"static function getBranches($params)\n {\n\t\n\t$con =$params['dbconnection'];\t\n\t$branches=array(); \n\t\n\t$subquery=\"\";\n\tif($params['admin_id'] =='')\n\t{\n\t\tif($params['localTime']=='')\n\t\t$params['localTime']='02:00:00';\n\t\t$subquery=\"WHERE (('{$params['localTime']}' between CAST(`start_1_timing` AS TIME) AND CAST(`end_1_timing` AS TIME))\n\t\tOR ('{$params['localTime']}' between CAST(`start_2_timing` AS TIME) AND CAST(`end_2_timing` AS TIME))\n\t\tOR ('{$params['localTime']}' between CAST(`start_3_timing` AS TIME) AND CAST(`end_3_timing` AS TIME)))\";\n\t}\n\t\n\t$query = \"SELECT \n\t`id`,\n\t`admin_id` as coordinator_id,\n\t`name`,\n\t`name_ar`,\n\t`address`,\n\t`latitude`,\n\t`longitude`\n\tFROM `branches` \n\t\".$subquery.\"\n\tORDER BY `id` DESC LIMIT 0,100 \";\n\t$result = mysqli_query($con,$query) ;\n\tif (mysqli_error($con) != '')\n\t return \"mysql_Error:-\".mysqli_error($con);\n\tif (mysqli_num_rows($result) > 0) \n\t{\n\t\t while ($row = mysqli_fetch_assoc($result)) \n\t\t {\n\t\t\t\n\t\t\tif($params['langset']=='0')\n\t\t\tunset($row['name_ar']);else {$row['name']=$row['name_ar']; unset($row['name_ar']);}; \n\t\t\t$row['localTime']=$params['localTime'];\n\t\t $branches[] = $row;\n\t\t }\n\t}\n\t\n\tif(!empty($branches))\n\treturn $branches;\n\telse return '';\n }",
"public function get_course_list_by_tenant($tenant_id, $is_inactive = 0) {\n\n if ($this->data['user']->role_id == 'TRAINER') {\n\n $this->db->select(\"c.course_id, c.crse_name, c.crse_type, c.class_type, \"\n\n . \"c.language, c.pre_requisite, c.certi_level, c.crse_manager\");\n\n $this->db->from(\"course c\");\n\n $this->db->where(\"c.tenant_id\", $tenant_id);\n\n $this->db->where(\"c.crse_status\", 'ACTIVE');\n\n $this->db->join('course_class ccl', 'ccl.course_id = c.course_id'\n\n . ' AND FIND_IN_SET(' . $this->data['user']->user_id . ',ccl.classroom_trainer)');\n\n $result = $this->db->get(); \n\n $courses = $result->result();\n\n foreach ($courses as $item) {\n\n $tenant_courses[$item->course_id] = $item->crse_name;\n\n }\n\n \n\n }else{\n\n $this->db->select(\"c.course_id, c.crse_name, c.crse_type, c.class_type, \"\n\n . \"c.language, c.pre_requisite, c.certi_level, c.crse_manager\");\n\n $this->db->from(\"course c\");\n\n $this->db->where(\"c.tenant_id\", $tenant_id);\n\n if (empty($is_inactive)) {\n\n $this->db->where(\"c.crse_status\", 'ACTIVE');\n\n }\n\n $this->db->order_by(\"c.crse_name\");\n\n if ($this->data['user']->role_id == 'SLEXEC') {\n\n $this->traineelist_querychange();\n\n }\n\n $result = $this->db->get();\n\n $courses = $result->result();\n\n $tenant_courses = array(); \n\n $current_page = $this->uri->segment(2);\n\n $filter_array = array('certificates','attendance','soa_report');\n\n if ($this->data['user']->role_id == 'CRSEMGR' && in_array($current_page, $filter_array)) {\n\n $logged_in_user_id = $this->data['user']->user_id;\n\n foreach ($courses as $item) {\n\n $crse_manager_arr = explode(',', $item->crse_manager);\n\n if (in_array($logged_in_user_id, $crse_manager_arr)) {\n\n $tenant_courses[$item->course_id] = $item->crse_name;\n\n }\n\n }\n\n } else {\n\n foreach ($courses as $item) {\n\n $tenant_courses[$item->course_id] = $item->crse_name;\n\n }\n\n } \n\n \n\n }\n\n return $tenant_courses;\n\n }",
"protected function getListQuery()\n\t{\n\t\t// Create a new query object.\n\t\t$db = $this->getDbo();\n\t\t$query = $db->getQuery(true);\n\n\t\t// Select the required fields from the table.\n\t\t$query->select(\n\t\t\t$this->getState(\n\t\t\t\t'list.select',\n\t\t\t\t'a.branch_id, a.title, a.path, a.project_id' .\n\t\t\t\t', a.published, a.access, a.created_date, a.user_id' .\n\t\t\t\t', a.summary, a.updated_date, a.last_build_id'\n\t\t\t)\n\t\t);\n\t\t$query->from('#__code_branches AS a');\n\n\t\t// Join over the asset groups.\n\t\t$query->select('ag.title AS access_level');\n\t\t$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');\n\n\t\t// Join over the categories.\n\t\t$query->select('c.title AS project_title');\n\t\t$query->join('LEFT', '#__code_projects AS c ON c.project_id = a.project_id');\n\n\t\t// Join over the users for the author.\n\t\t$query->select('ua.name AS author_name');\n\t\t$query->join('LEFT', '#__users AS ua ON ua.id = a.user_id');\n\n\t\t// Filter by access level.\n\t\tif ($access = $this->getState('filter.access')) {\n\t\t\t$query->where('a.access = ' . (int) $access);\n\t\t}\n\n\t\t// Filter by published state\n\t\t$published = $this->getState('filter.published');\n\t\tif (is_numeric($published)) {\n\t\t\t$query->where('a.published = ' . (int) $published);\n\t\t}\n\t\telse if ($published === '') {\n\t\t\t$query->where('(a.published = 0 OR a.published = 1)');\n\t\t}\n\n\t\t// Filter by a single or group of projects.\n\t\t$projectId = $this->getState('filter.project_id');\n\t\tif (is_numeric($projectId)) {\n\t\t\t$query->where('a.project_id = '.(int) $projectId);\n\t\t}\n\t\telse if (is_array($projectId)) {\n\t\t\tJArrayHelper::toInteger($projectId);\n\t\t\t$projectId = implode(',', $projectId);\n\t\t\t$query->where('a.project_id IN ('.$projectId.')');\n\t\t}\n\n\t\t// Filter by author\n\t\t$authorId = $this->getState('filter.author_id');\n\t\tif (is_numeric($authorId)) {\n\t\t\t$type = $this->getState('filter.author_id.include', true) ? '= ' : '<>';\n\t\t\t$query->where('a.user_id '.$type.(int) $authorId);\n\t\t}\n\n\t\t// Filter by search in title.\n\t\t$search = $this->getState('filter.search');\n\t\tif (!empty($search)) {\n\t\t\tif (stripos($search, 'id:') === 0) {\n\t\t\t\t$query->where('a.branch_id = '.(int) substr($search, 3));\n\t\t\t}\n\t\t\telse if (stripos($search, 'author:') === 0) {\n\t\t\t\t$search = $db->Quote('%'.$db->getEscaped(substr($search, 7), true).'%');\n\t\t\t\t$query->where('(ua.name LIKE '.$search.' OR ua.username LIKE '.$search.')');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$search = $db->Quote('%'.$db->getEscaped($search, true).'%');\n\t\t\t\t$query->where('(a.title LIKE '.$search.' OR a.path LIKE '.$search.')');\n\t\t\t}\n\t\t}\n\n\t\t// Add the list ordering clause.\n\t\t$orderCol\t= $this->state->get('list.ordering');\n\t\t$orderDirn\t= $this->state->get('list.direction');\n\t\t$query->order($db->getEscaped($orderCol.' '.$orderDirn));\n\n\t\t//echo nl2br(str_replace('#__','jos_',$query));\n\t\treturn $query;\n\t}",
"function getlist_company()\n\t{\n\t\t$this->db->select('cp.CompanyId,cp.Name,cp.EmailAddress,cp.Website,cp.AddressesId,cp.PhoneNumber,cp.IsActive,(SELECT COUNT(u.UserId) FROM tbluser as u WHERE u.CompanyId=cp.CompanyId) as isdisabled');\n\t\t$result = $this->db->get('tblcompany cp');\n\t\t$res=array();\n\t\tif($result->result())\n\t\t{\n\t\t\t$res=$result->result();\n\t\t}\n\t\treturn $res;\n\t}",
"function get_branch($branch_id)\r\n{\r\n\t$sql = \"SELECT \".TB_PREF.\"cust_branch.*,\".TB_PREF.\"salesman.salesman_name \r\n\t\tFROM \".TB_PREF.\"cust_branch, \".TB_PREF.\"salesman \r\n\t\tWHERE \".TB_PREF.\"cust_branch.salesman=\".TB_PREF.\"salesman.salesman_code \r\n\t\tAND branch_code=\".db_escape($branch_id);\r\n\t\r\n\t$result = db_query($sql, \"Cannot retreive a customer branch\");\r\n\t\r\n\treturn db_fetch($result); \t\r\n}",
"function get_unallocated_users($conn, $manager_id) {\n $sql = \"SELECT * FROM user_tbl \n WHERE manager_id = $manager_id\n AND active_status = 1\n AND user_id NOT IN (SELECT user_id FROM representative_allocated\n WHERE site_rep_active_status = 1)\";\n\n return $conn->query($sql);\n}",
"public function bulkOperationsActivatieDeactivate() {\n ini_set('display_errors', 1);\n ini_set('display_startup_errors', 1);\n error_reporting(E_ALL);\n $this->db->save_queries = FALSE;\n $trans_id = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;\n $bulk_operation_pid = ($this->uri->segment(4)) ? $this->uri->segment(4) : 0;\n $start_val = ($this->uri->segment(5)) ? $this->uri->segment(5) : 0;\n $limit = ($this->uri->segment(6)) ? $this->uri->segment(6) : 0;\n $server_id = ($this->uri->segment(7)) ? $this->uri->segment(7) : 1;\n $backend_setup_id = ($this->uri->segment(8)) ? $this->uri->segment(8) : 0;\n $int_activated=0;\n $blkopr = new bulkoperationmodel();\n $uploaded_opns_details = $blkopr->getTransactionDetails($trans_id);\n \n if(count($uploaded_opns_details)>0){\n $status = $uploaded_opns_details->act_type;\n $dealerId = $uploaded_opns_details->dealer_id;\n write_to_file(\"In Bulkoperations controller bulkOperationsActivatieDeactivate trans_id \".$trans_id.\" bulk_operation_pid \".$bulk_operation_pid.\" start_val\".$start_val.\" limit\".$limit.' $status '.$status);\n $operation_id = $this->Process_Model->getoperation_id('bulk_operation_with_file_upload',$dealerId);\n if ($status == 1) { //1 means activations\n $int_activated = $blkopr->bulkActivations($trans_id, $bulk_operation_pid, $start_val, $limit, $server_id, $backend_setup_id,0,$operation_id);\n } else if ($status == 2) { // 2 for deactivations\n $int_activated = $blkopr->bulkDeactivations($trans_id, $bulk_operation_pid, $start_val, $limit, $server_id, $backend_setup_id,0,$operation_id);\n } else if ($status == 3) { // 3 for reactivations\n $int_activated = $blkopr->bulkReactivations($trans_id, $bulk_operation_pid, $start_val, $limit, $server_id, $backend_setup_id,0,$operation_id);\n }\n }\n echo $int_activated;\n }",
"function Get_Not_Expired_Companies($Name_Start = null){\n\n\t\t$Word_Start = \"A\";\n\t\tif($Name_Start != null){\n\t\t\t$Word_Start = $Name_Start;\n\t\t}\n\n\t\t$query = \"select COM_ID as company_id,COM_NAME as company_name,COM_Name_Amharic as company_name_amharic, COM_REG_DATE as registration_date\n\t\t,CAT_Name as category,CAT_Name_Amharic as category_amharic,ADDR_ID as address_id,Belong_to as belong_to,PAY_STAT.Registration_Type,if(PAY_STAT.Expiration_Date<CURDATE(),'EXPIRED','NOT_EXPIRED') as Expiration_Date\nfrom (select COM.ID as COM_ID,COM.Name as COM_NAME,COM.Name_Amharic as COM_Name_Amharic,COM.Registration_date as COM_REG_DATE,\n\t\t\t COM_ADDR.company_id as COM_ADDR_COM_ID, COM_ADDR.address_id as COM_ADDR_ADDR_ID,\n\t\t\t ADDR.ID as ADDR_ID,ADDR.Belong_to\n\t\tfrom company as COM\n\t\tinner join company_address as COM_ADDR\n\t\ton COM.ID = COM_ADDR.company_id\n\t\tinner join address as ADDR\n\t\ton ADDR.ID = COM_ADDR.address_id) as com_addr_spec\n\n\t\tinner join\n\t\t(select COM_CAT.company_id as COM_CAT_COM_ID, COM_CAT.category_id as COM_CAT_CAT_ID,\n\t\t\t\tCAT.ID as CAT_ID,CAT.Name as CAT_Name,CAT.Name_Amharic as CAT_Name_Amharic\n\t\tfrom company_category as COM_CAT\n\t\tinner join category as CAT\n\t\ton COM_CAT.category_id = CAT.id) as cat_spec\n\n\t\ton COM_ID = COM_CAT_COM_ID\n\n\t\tinner join\n\t\tpayment_status as PAY_STAT\n\t\ton COM_ID = PAY_STAT.ID\nwhere COM_Name like '$Word_Start%' and CURDATE() < PAY_STAT.Expiration_Date\nORDER by company_name\";\n\n\t\t$result = mysqli_query($this->getDbc(),$query);\n\n\t\tif($result){\n\t\t\treturn $result;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\n\t}",
"function bbp_admin_repair_list_components_filter()\n{\n}",
"function showAllActiveDeactiveUsers($active=0,$is_deleted=0,$searchkey=''){\n\t\tglobal $db;\t\t\n\t\t$sql = \"select * from users where `groupid` = '1' \";\n\t\tif(!empty($searchkey)){\n\t\t\tif($searchkey['searchkey']!=''){\n\t\t\t\t$sql.= \" and (`pfirstname` LIKE '%\".$searchkey['searchkey'].\"%' or `plastname` LIKE '%\".$searchkey['searchkey'].\"%' or `sfirstname` LIKE '%\".$searchkey['searchkey'].\"%' or `slastname` LIKE '%\".$searchkey['searchkey'].\"%' or`phone` = '\".$searchkey['searchkey'].\"' or `username` LIKE '%\".$searchkey['searchkey'].\"%') \";\n\t\t\t}\n\t\t\tif($searchkey['user_type']!=''){\n\t\t\t\t$sql.= \" and `user_type` = '\".$searchkey['user_type'].\"' \";\n\t\t\t}\n\t\t\t/*if($searchkey['district']!=''){\n\t\t\t\t$sql.= \" and `district` = '\".$searchkey['district'].\"' \";\n\t\t\t}\n\t\t\tif($searchkey['village']!=''){\n\t\t\t\t$sql.= \" and `village` = '\".$searchkey['village'].\"' \";\n\t\t\t}*/\n\t\t}\n\t\tif($is_deleted == '1'){\n\t\t\t$sql.= \" and is_deleted ='\".$is_deleted.\"' order by id DESC \";\n\t\t} else {\n\t\t\t$sql.= \" and block_status='\".$active.\"' and is_deleted ='\".$is_deleted.\"' order by id DESC \";\n\t\t}\n\t\t//echo $sql;\n\t\treturn $usersResult = $db->run_query($sql);\n\t}",
"static function filter_rows($l_usr, $app_status, $branch_id = null)\n {\n $contracts = Contract::whereHas('application', function($query) use($app_status) {\n $query->orderBy('id', 'desc')->where('status', $app_status);\n })->whereHas('office', function($que) use($l_usr, $branch_id) {\n if ($l_usr->role_id == 3) {//Recepcionista\n //$que->where('user_id', $l_usr->id);\n }\n $que->whereHas('branch', function($q) use($l_usr, $branch_id) {\n if ($branch_id) {\n $q->where('id', $branch_id);\n }\n if ($l_usr->role_id == 2) {//Franquiciatario\n $q->where('user_id', $l_usr->id);\n }\n });\n })->get();\n\n return $contracts;\n }",
"function getProductDetails($searchId) {\n //$res = $productList == '' ? '' : \" AND cp.ProductId NOT IN ($productList)\";\n $sqlEmployeeDetails = \"SELECT ProductId, Code, Name FROM product WHERE ProductId='$searchId'\";\n $stmtEmp = find($sqlEmployeeDetails);\n\n return $stmtEmp;\n}",
"protected function getListQuery()\r\n\t{\r\n\r\n\t}",
"public function get_deactive_suppliers() {\n\n $this->db->select('t1.*');\n $this->db->from('supplier t1');\n $this->db->where('t1.Status', 0);\n $result = $this->db->get();\n return $result;\n }",
"function get_active_jobs($start_date, $end_date) \n{\n\t$CI = &get_instance();\n\t$site_id = isset(currentuserinfo()->site_id) ? currentuserinfo()->site_id : 9;\n\t$CI->db->select(\"job_order_id,added_by,status,date(created_time) as date_field\");\n\t$CI->db->where(\"site_id\", $site_id);\n\t!empty($start_date) ? $CI->db->where(\"date(created_time) >=\", $start_date) : '';\n\t!empty($end_date) ? $CI->db->where(\"date(created_time) <=\", $end_date) : '';\n\t$query = $CI->db->get(\"job_order_history\");\n\t//echo $CI->db->last_query();die;\n\t$result1 = $query->result();\n\t$inactive_jobs = array();\n\tforeach ($result1 as $k => $v) {\n\t\t($v->status == 3) ? $inactive_jobs[$v->date_field][] = $v->job_order_id : '';\n\t}\n\n\tforeach ($result1 as $k => $v) {\n\t\tforeach ($inactive_jobs as $kk => $vv) {\n\t\t\tif ($v->date_field == $kk) {\n\t\t\t\tif (in_array($v->job_order_id, $inactive_jobs[$kk])\n\t\t\t\t\t) {\n\t\t\t\t\t\tunset($result1[$k]);\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$return_arr = array();\n\tforeach ($result1 as $k => $v) {\n\t\t$return_arr[$v->date_field][$v->added_by][] = $v->job_order_id;\n\t}\n\tunset($result1);\n\tforeach ($return_arr as $date_field => $added_by) {\n\t\tforeach ($return_arr[$date_field] as $k => $v) {\n\t\t\t$return_arr[$date_field][$k] = array_unique($return_arr[$date_field][$k]);\n\t\t}\n\t}\n\treturn $return_arr;\n}",
"protected function listAvailable(){\n $firm_query = 'SELECT \n USERS_X_FIRM.firm_id, FIRM.firm_name\n FROM\n USERS_X_FIRM\n LEFT JOIN\n FIRM ON USERS_X_FIRM.firm_id = FIRM.firm_id\n WHERE\n user_id = ' . Flow::app()->auth->getUserId() . ';';\n $firms = Flow::app()->pdo->query($firm_query)->fetchAll(PDO::FETCH_OBJ);\n $query = 'SELECT DISTINCT\n USERS_X_FIRM.firm_id,\n FIRM.firm_name,\n `case`.timestamp_stop,\n `case`.id AS case_id,\n `case`.`name` AS case_name,\n `case`.id_pn,\n `transition`.id AS transition_id,\n `transition`.`name` AS transition_name,\n TRANSITIONS_X_ROLE.id_role,\n ROLES.role_name,\n `REFERENCES`.referenced_transition_id,\n `REFERENCES`.value\n\n FROM\n USERS_X_FIRM\n LEFT JOIN \n FIRM ON FIRM.firm_id = USERS_X_FIRM.firm_id\n LEFT JOIN\n `case` ON `case`.firm = USERS_X_FIRM.firm_id\n LEFT JOIN\n transition ON `case`.id_pn = transition.id_pn\n LEFT JOIN\n TRANSITIONS_X_ROLE ON TRANSITIONS_X_ROLE.id_prechod = transition.id\n LEFT JOIN\n ROLES ON ROLES.role_id = TRANSITIONS_X_ROLE.id_role\n LEFT JOIN\n `REFERENCES` ON `REFERENCES`.transition_id = transition.id\n WHERE \n `case`.timestamp_stop IS NULL\n AND (\n EXISTS( \n SELECT \n *\n FROM\n USERS_X_ROLE\n WHERE\n user_id = ' . Flow::app()->auth->getUserId() . '\n AND USERS_X_FIRM.firm_id = USERS_X_ROLE.firm_id\n AND TRANSITIONS_X_ROLE.id_role = USERS_X_ROLE.role_id\n ) \n OR referenced_transition_id IS NOT NULL \n OR id_role IS NULL\n );' ;\n $result = Flow::app()->pdo->query($query)->fetchAll(PDO::FETCH_OBJ);\n $data = $this->sanitizeTasksData($result);\n \n foreach ($data as $firm_id=>$firm){\n foreach($firm['cases'] as $case_id=>$case){\n foreach ($case['tasks'] as $task_id=>$task){\n if(!TransitionModel::model()->isEnabled($case_id, $task_id)){\n unset($data[$firm_id]['cases'][$case_id]['tasks'][$task_id]);\n }\n elseif($task['reference'] != NULL || $task['referencevalue']){\n $ref = $this->resolveReferences($firm_id, $case_id, $task_id, $task['reference'], $task['referencevalue'], $task['id_role'], $case['id_pn']);\n switch ($ref){\n case [FALSE, FALSE]:\n unset($data[$firm_id]['cases'][$case_id]['tasks'][$task_id]);\n break;\n case [TRUE, FALSE]:\n $data[$firm_id]['cases'][$case_id]['tasks'][$task_id]['reference'] = NULL;\n break;\n case [TRUE, TRUE]:\n $data[$firm_id]['cases'][$case_id]['tasks'][$task_id]['reference'] = 1;\n break;\n }\n }\n }\n if(empty($data[$firm_id]['cases'][$case_id]['tasks'])){\n unset($data[$firm_id]['cases'][$case_id]);\n }\n }\n if(empty($data[$firm_id]['cases'])){\n unset($data[$firm_id]);\n }\n }\n if(isset($_GET['ajaxify'])){\n\n $this->renderPartial('listavailable.table', ['firm_cases' => $data, 'firms' => $firms]);\n }\n else{\n $this->render('listavailable', ['firm_cases' => $data, 'firms' => $firms]);\n }\n }",
"public function report_bounce_list($params) {\n\t\t$request_url = \"{$this->url}&api_action=campaign_report_bounce_list&api_output={$this->output}&{$params}\";\n\t\t$response = parent::curl($request_url);\n\t\treturn $response;\n\t}",
"public function index(Request $request)\n {\n $oInput = $request->all();\n\n $oQb = CompanyBranch::with(['companyId','countryId','cityId','createdBy','updatedBy','deletedBy'])->orderByDesc('updated_at');\n $oQb = QB::where($oInput,\"id\",$oQb);\n $oQb = QB::whereLike($oInput,\"en_name\",$oQb);\n $oQb = QB::whereLike($oInput,\"ar_name\",$oQb);\n $oQb = QB::whereLike($oInput,\"en_manager_name\",$oQb);\n $oQb = QB::whereLike($oInput,\"ar_manager_name\",$oQb);\n $oQb = QB::whereLike($oInput,\"address_1\",$oQb);\n $oQb = QB::whereLike($oInput,\"address_2\",$oQb);\n $oQb = QB::whereLike($oInput,\"address_3\",$oQb);\n $oQb = QB::whereLike($oInput,\"address_4\",$oQb);\n $oQb = QB::whereLike($oInput,\"postal_code\",$oQb);\n $oQb = QB::whereLike($oInput,\"state_region\",$oQb);\n $oQb = QB::whereLike($oInput,\"phone_1\",$oQb);\n $oQb = QB::whereLike($oInput,\"phone_2\",$oQb);\n $oQb = QB::whereLike($oInput,\"phone_3\",$oQb);\n $oQb = QB::whereLike($oInput,\"fax_2\",$oQb);\n $oQb = QB::whereLike($oInput,\"fax_3\",$oQb);\n $oQb = QB::whereLike($oInput,\"email\",$oQb);\n $oQb = QB::whereLike($oInput,\"website\",$oQb);\n $oQb = QB::whereLike($oInput,\"status\",$oQb);\n $oQb = QB::whereLike($oInput,\"remarks_1\",$oQb);\n $oQb = QB::whereLike($oInput,\"remarks_2\",$oQb);\n $oQb = QB::whereLike($oInput,\"remarks_3\",$oQb);\n $oQb = QB::where($oInput,\"company_id\",$oQb);\n $oQb = QB::where($oInput,\"city_id\",$oQb);\n $oQb = QB::where($oInput,\"country_id\",$oQb);\n \n $oCompanyBranches = $oQb->paginate(10);\n \n $oResponse = responseBuilder()->success(__('message.general.list',[\"mod\"=>\"Company Branch\"]), $oCompanyBranches, false);\n $this->urlRec(26, 0, $oResponse);\n return $oResponse;\n }",
"protected function getListQuery()\n\t{\n\t\t$db = Factory::getDbo();\n\t\t$query = $db->getQuery(true);\n\n\t\t$filterClient = $this->getState('filter.vendor_client', '');\n\n\t\tif ($filterClient)\n\t\t{\n\t\t\t$client = $filterClient;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$client = '';\n\t\t}\n\n\t\t$currency = $this->getState('filter.currency', '');\n\t\t$TjvendorFrontHelper = new TjvendorFrontHelper;\n\t\t$vendor_id = $TjvendorFrontHelper->getVendor();\n\t\t$columns = array('vendors.vendor_id');\n\t\t$query->select($db->quoteName($columns));\n\t\t$query->select('pass.*');\n\t\t$query->from($db->quoteName('#__tjvendors_vendors', 'vendors'));\n\t\t$query->join('LEFT', $db->quoteName('#__tjvendors_passbook', 'pass') .\n\t\t\t' ON (' . $db->quoteName('vendors.vendor_id') . ' = ' . $db->quoteName('pass.vendor_id') . ')');\n\t\t$query->where($db->quoteName('pass.id') . ' is not null');\n\n\t\tif (!empty($vendor_id))\n\t\t{\n\t\t\t$query->where($db->quoteName('vendors.vendor_id') . ' = ' . $db->quote($vendor_id));\n\t\t}\n\n\t\tif ($client != 'all' && $client != '')\n\t\t{\n\t\t\t$query->where($db->quoteName('pass.client') . ' = ' . $db->quote($client));\n\t\t}\n\n\t\tif (!empty($currency))\n\t\t{\n\t\t\t$query->where($db->quoteName('pass.currency') . ' = ' . $db->quote($currency));\n\t\t}\n\n\t\t$db->setQuery($query);\n\n\t\t// Filter by search in title\n\t\t$search = $this->getState('filter.search');\n\n\t\tif (!empty($search))\n\t\t{\n\t\t\tif (stripos($search, 'id:') === 0)\n\t\t\t{\n\t\t\t\t$query->where('pass.id = ' . (int) substr($search, 3));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$search = $db->Quote('%' . $db->escape($search, true) . '%');\n\t\t\t\t$query->where('(' . $db->quoteName('vendors.vendor_title') . ' LIKE ' . $search .\n\t\t\t\t\t\t\t'OR ' . $db->quoteName('pass.currency') . ' LIKE' . $search .\n\t\t\t\t\t\t\t'OR ' . $db->quoteName('pass.client') . ' LIKE' . $search .\n\t\t\t\t\t\t\t'OR ' . $db->quoteName('pass.vendor_id') . ' LIKE' . $search . ')');\n\t\t\t}\n\t\t}\n\n\t\t$transactionType = $this->getState('filter.transactionType', '');\n\n\t\tif (!empty($transactionType))\n\t\t{\n\t\t\tif ($transactionType == \"Debit\")\n\t\t\t{\n\t\t\t\t$query->where($db->quoteName('debit') . \" >0 \");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$query->where($db->quoteName('credit') . \" >0 \");\n\t\t\t}\n\t\t}\n\n\t\t$fromDate = $this->getState('filter.fromDate', '');\n\t\t$toDate = $this->getState('filter.toDate', '');\n\n\t\tif (empty($toDate) && !empty($fromDate))\n\t\t{\n\t\t\t$query->where($db ->quoteName('transaction_time') . \" >= \" . $db->quote($fromDate));\n\t\t}\n\t\telseif (empty($fromDate) && !empty($toDate))\n\t\t{\n\t\t\t$query->where($db ->quoteName('transaction_time') . \" <= \" . $db->quote($toDate));\n\t\t}\n\t\telseif (!empty($fromDate) && !empty($toDate))\n\t\t{\n\t\t\t$query->where($db ->quoteName('transaction_time') . 'BETWEEN' . \"'$fromDate'\" . 'AND' . \"'$toDate'\");\n\t\t}\n\n\t\t// Add the list ordering clause.\n\t\t$orderCol = $this->state->get('list.ordering');\n\t\t$orderDirn = $this->state->get('list.direction');\n\n\t\tif (!in_array(strtoupper($orderDirn), array('ASC', 'DESC')))\n\t\t{\n\t\t\t$orderDirn = 'DESC';\n\t\t}\n\n\t\tif ($orderCol && $orderDirn)\n\t\t{\n\t\t\t$query->order($db->escape($orderCol . ' ' . $orderDirn));\n\t\t}\n\n\t\treturn $query;\n\t}",
"public function getListData()\n { \n $result = new \\stdClass();\n\n if($this->listFilter['search'] != null || $this->listFilter['priority'] != null || $this->listFilter['status'] != null)\n {\n\n /* Put listing query with search here.. */\n\n $searchby = $this->listTableHead[ $this->listFilter['searchby'] ]['tableName'].'.'.$this->listTableHead[ $this->listFilter['searchby'] ]['tableField'];\n\n $response = $this->client->post('customercare/get/list',\n [\n 'json' => [\n 'page' => $this->listFilter['page'] != null ? $this->listFilter['page'] : 1,\n 'perpage' => (int)$this->listFilter['perpage'],\n 'filter' => [\n \"lower(\".$searchby.\")\" => [\n 'like' => $this->listFilter['search'] != null ? '%'.strtolower($this->listFilter['search']).'%' : null\n ],\n 'priority' => $this->listFilter['priority'] != 0 ? (int)$this->listFilter['priority'] : null,\n 'status' => $this->listFilter['status'] != 0 ? (int)$this->listFilter['status'] : null\n ]\n ],\n 'headers' => [\n 'Accept' => 'application/json',\n 'x-access-token' => $this->getToken()\n ]\n ]\n );\n\n $result->dataQuery = json_decode($response->getBody());\n\n }else{\n\n /* Put listing query without search word here.. */\n $response = $this->client->post('customercare/get/list', \n [\n 'json' => [\n 'page' => $this->listFilter['page'] != null ? $this->listFilter['page'] : 1,\n 'perpage' => (int)$this->listFilter['perpage']\n ],\n 'headers' => [\n 'Accept' => 'application/json',\n 'x-access-token' => $this->getToken()\n ]\n ]\n );\n\n $result->dataQuery = json_decode($response->getBody());\n }\n\n return $result;\n \n }"
] | [
"0.5944363",
"0.5580223",
"0.54166013",
"0.54049546",
"0.5382386",
"0.5349709",
"0.5332318",
"0.5281806",
"0.5198508",
"0.5188296",
"0.518533",
"0.51538897",
"0.51495075",
"0.5134156",
"0.51322675",
"0.5072065",
"0.5070487",
"0.50601447",
"0.50594103",
"0.5043389",
"0.5038676",
"0.50379086",
"0.5036008",
"0.5005971",
"0.4989319",
"0.49862978",
"0.49827173",
"0.49749714",
"0.49718773",
"0.49585387"
] | 0.7174645 | 0 |
Asserts that the given piece of code throws an exception of the given type and exception message. Adapted from | protected static function assertException($expectedTypeOrTypeMessagePair, \Closure $function, $message = '')
{
if (is_array($expectedTypeOrTypeMessagePair)) {
[$expectedType, $expectedMessage] = $expectedTypeOrTypeMessagePair;
} else {
$expectedType = $expectedTypeOrTypeMessagePair;
$expectedMessage = null;
}
$exception = null;
try {
call_user_func($function);
} catch (\Exception $e) {
$exception = $e;
}
self::assertThat($exception, new Constraint\Exception($expectedType), $message);
if ($expectedMessage !== null) {
self::assertThat($exception, new Constraint\ExceptionMessage($expectedMessage), $message);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testErrorMessagePassedCorrectly(): void\n {\n $this->expectExceptionMessage($this->message);\n\n throw $this->class;\n }",
"public function testInvalidTypeThrowsException()\n {\n $this->expectException(TransactionTypeException::class);\n $this->expectExceptionMessageRegExp('/Foo/');\n\n $class = TypeMap::FindClass('Foo');\n }",
"public function testHandleException()\n {\n $query = new class extends Query {\n protected function handleException(\\Throwable $exception)\n {\n throw new \\TypeError('Test: '.$exception->getMessage(), $exception->getCode(), $exception);\n }\n };\n\n $this->assertException(\\TypeError::class, function () use ($query) {\n $query->from(['foo', 'bar']);\n }, function (\\TypeError $exception) {\n $this->assertStringStartsWith('Test: ', $exception->getMessage());\n $this->assertInstanceOf(InvalidArgumentException::class, $exception->getPrevious());\n });\n }",
"public function custom_exceptions_are_straightforward()\n\t{\n\t\ttry\n\t\t{\n\t\t\tthrow new CustomException(\"wello!\");\n\t\t}\n\t\tcatch (CustomException $e)\n\t\t{\n\n\t\t}\n\t\tassert_that(get_class($e))->is_identical_to(__);\n\t\tassert_that($e->getMessage())->is_identical_to(__);\n\t}",
"public function testCode()\n {\n $expression = new ThrowExpression($this, \\Exception::class, 500);\n\n $exception = new \\Exception('', 500);\n\n $this->assertNull($expression->resolve($exception));\n }",
"public function testIfInstantiationThrowsExceptionsOnInvalidCodesOrMessagesClassName( string $constantsClassesTranslatorClassName, string $inputConstantsClassClassName, string $outputConstantsClassClassName, string $expectedExceptionClassName, int $expectedExceptionCode, string $expectedExceptionMessage ): void\n\t{\n\t\t$this->expectException( $expectedExceptionClassName );\n\t\t$this->expectExceptionCode( $expectedExceptionCode );\n\t\t$this->expectExceptionMessage( $expectedExceptionMessage );\n\n\t\tnew $constantsClassesTranslatorClassName( $inputConstantsClassClassName, $outputConstantsClassClassName );\n\t}",
"public function testMessage()\n {\n $expression = new ThrowExpression($this, \\Exception::class, 500, 'test');\n\n $exception = new \\Exception('test', 500);\n\n $this->assertNull($expression->resolve($exception));\n }",
"public function testSetTypeWithInvalidArgumentException() {\n\n $obj = new DataTablesColumn();\n\n try {\n\n $obj->setType(\"exception\");\n } catch (Exception $ex) {\n\n $this->assertInstanceOf(InvalidArgumentException::class, $ex);\n $this->assertEquals('The type \"exception\" is invalid', $ex->getMessage());\n }\n }",
"public function testException()\n {\n $rules = ['text' => ['required', 'max:5', 'samed:code']];\n $validator = new Validator(['text' => 'code'], $rules);\n try {\n $validator->passed();\n }catch (\\Exception $ex){\n $this->assertInstanceOf(RuleNotFoundException::class, $ex);\n }\n }",
"public function test_repeated_code_exception_in_same_type(){\n $this->expectException(RepeatedCodeException::class);\n\n $planType = $this->createPlanType();\n \n $this->createPlan('test_code', $planType);\n $this->createPlan('test_code', $planType);\n }",
"protected function throwException($msg){\n\t\tthrow new \\InvalidArgumentException($this->name . ' ' . $msg);\n\t}",
"public function testConstructWithMessage()\n {\n $message = 'Test message.';\n $exception = new class($message) extends AbstractException {};\n\n self::assertEquals($message, $exception->getMessage(), 'The message must be set properly.');\n self::assertEquals(0, $exception->getCode(), 'The code must always be zero.');\n self::assertNull($exception->getPrevious(), 'No previous exception must be present.');\n }",
"function throws($sMsg='excetion',$iCode=-1,$data=[]){\n if(defined('BIND_MODULE')){\n $sM = ucfirst(BIND_MODULE);\n }else{ // df\n $sM = 'Base';\n }\n $sE = \"\\\\src\\\\base\\\\exception\\\\\".$sM.\"Exception\";\n // throw (new $sE($sMsg,$iCode))->setData($data);\n throw new $sE($sMsg,$iCode,$data);\n}",
"public function setExpectedException( $exception, $message = '', $code = null ) {\n\t\tif ( method_exists( 'PHPUnit_Framework_TestCase', 'setExpectedException' ) ) {\n\t\t\tPHPUnit_Framework_TestCase::setExpectedException( $exception, $message, $code );\n\t\t} else {\n\t\t\t$this->expectException( $exception );\n\t\t\tif ( '' !== $message ) {\n\t\t\t\t$this->expectExceptionMessage( $message );\n\t\t\t}\n\t\t\tif ( null !== $code ) {\n\t\t\t\t$this->expectExceptionCode( $code );\n\t\t\t}\n\t\t}\n\t}",
"public function testException(){\n $exp = new CommandLineException(\"Test\");\n $this->assertEquals(strval($exp), \"De\\Uniwue\\RZ\\Lyra\\Exceptions\\CommandLineException: [0]: CMD Exception: Test\\n\");\n }",
"public function testInvalidEmailAddress()\n {\n $this->expectException(TypeException::class);\n new EmailAddress('[email protected]@wrong');\n }",
"function throwException($message = null,$code = null) {\n throw new Exception($message,$code);\n}",
"public function testException()\n {\n $key = 'flight';\n $errorMsg = sprintf('Unable to find data at key %s', $key);\n $exp = new PutContentsNotFoundException($errorMsg, $key);\n $this->assertTrue(\n $exp instanceof \\Exception\n );\n\n $stringval = $exp->__toString();\n $this->assertTrue(\n strlen($stringval)>0\n );\n }",
"public function setExpectedException($exception, $message = '', $code = null)\n {\n if (\\method_exists('PHPUnit_Framework_TestCase', 'setExpectedException')) {\n parent::setExpectedException($exception, $message, $code);\n } else {\n $this->expectException($exception);\n if ('' !== $message) {\n $this->expectExceptionMessage($message);\n }\n if (null !== $code) {\n $this->expectExceptionCode($code);\n }\n }\n }",
"public function testException()\r\n {\r\n $expectedException = false;\r\n try {\r\n self::$compareApi->compare(self::$oneTermInputJSONarray, TestConfiguration::$RETINA_NAME);\r\n } catch (Exception $e) {\r\n $expectedException = true;\r\n }\r\n $this->assertTrue($expectedException);\r\n\r\n # testing JSON parse exception in the input\r\n $expectedException = false;\r\n try {\r\n self::$compareApi->compare(self::$syntaxErrorJSONarray, TestConfiguration::$RETINA_NAME);\r\n } catch (Exception $e) {\r\n $expectedException = true;\r\n }\r\n $this->assertTrue($expectedException);\r\n }",
"public function assert($expression, $message='')\n {\n if (!$expression) {\n throw new Exception($message);\n }\n }",
"public function testCanThrowErrorWithCustomMessage(): void\n {\n $p = new ErrorProcessor();\n $p->setMessage('Error has been thrown!');\n $p->setCode(1602422720);\n\n $this->expectException(ErrorException::class);\n $this->expectExceptionMessage('Error has been thrown!');\n $this->expectExceptionCode(1602422720);\n\n $this->defaultTask->addProcessor($p);\n $this->migraine->execute();\n }",
"public function testValidateError()\n {\n $instance = new IsType('string');\n\n $this->expectException(InvalidValueException::class);\n $this->expectExceptionMessageRegExp('#Unalowed type \"[a-zA-Z]+\". Allowed is \"[a-zA-Z]+\"#');\n\n $instance->validate(12);\n }",
"public function testExceptionThrown()\n {\n $response = $this->request->send();\n $this->assertInstanceOf(ErrorResponse::class, $response);\n $this->assertEquals(false, $response->isSuccessful());\n $this->assertEquals('The access token you\\'ve used is not a valid sandbox API access token', $response->getMessage());\n }",
"public function testCaseExprException1(): void\n {\n // $this->expectException(Exception::class);\n $this->q()->caseExpr()\n ->caseWhen(['status'], 't2.expose_new')\n ->render();\n }",
"public function testMethodThrowsException() {\n $error_var = NULL;\n try {\n $this->form->{self::METHOD}();\n } catch (\\Error $error) {\n $error_var = $error;\n }\n $this->assertInstanceOf('Error', $error_var);\n }",
"public function testAssertInt(): void\n\t{\n\t\t$this->expectException(\\InvalidArgumentException::class);\n\t\tValidator::assertInt(__FUNCTION__, 'chicken');\n\t}",
"public function testBuildFailsForInvalidKey()\n {\n $this->expectException(\\TypeError::class);\n\n @new IPCStorage(\"invalid\");\n }",
"public function testCallStaticInvalidArgumentException()\n {\n $this->expectException(\\InvalidArgumentException::class);\n MyEnum::NOT_EXISTS();\n }",
"public function to_throw($expected) {\n $result = false;\n \n if (is_callable($this->value)) {\n try {\n $this->value->__invoke();\n } catch (\\Exception $e) {\n if (is_a($e, $expected)) {\n $result = true;\n }\n }\n }\n \n $this->report($result, 'to throw', $expected);\n }"
] | [
"0.671585",
"0.6595523",
"0.6529814",
"0.6497294",
"0.6405127",
"0.6072245",
"0.6032835",
"0.60209674",
"0.6016453",
"0.59916586",
"0.59619075",
"0.59087765",
"0.58963466",
"0.5884087",
"0.58760387",
"0.5864672",
"0.5862002",
"0.5805687",
"0.5776701",
"0.57764",
"0.5767841",
"0.5710559",
"0.5703412",
"0.56744546",
"0.56730235",
"0.5664333",
"0.56612223",
"0.56470716",
"0.5641244",
"0.56249106"
] | 0.6637348 | 1 |
Get the value of nif | public function getNif()
{
return $this->nif;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNis()\n {\n return $this->nis;\n }",
"function getNVal() {\n\t\treturn $this->getProperty ( \"n_val\" );\n\t}",
"public function setNif(string $nif)\n {\n $this->nif = $nif;\n\n return $this;\n }",
"public function getNit(){\n\t\treturn $this->_mNit;\n\t}",
"public function getNit()\n {\n return $this->nit;\n }",
"public function getNiyNigk()\n {\n return $this->niy_nigk;\n }",
"public function getNipd()\n {\n return $this->nipd;\n }",
"public function getN()\n {\n return $this->get(self::N);\n }",
"public function getN()\n {\n return $this->get(self::N);\n }",
"public function getN()\n {\n return $this->get(self::N);\n }",
"public function getNip()\n {\n return $this->nip;\n }",
"public function getNcm()\n {\n return $this->ncm;\n }",
"public function getNik()\n {\n return $this->nik;\n }",
"public function getNationalNumber() {\r\n\t\treturn $this->national_number;\r\n\t}",
"public function getN() : GMP\n {\n return $this->n;\n }",
"function getNationalIdentificationNumber();",
"public function getNational_number() {\r\n\t\treturn $this->national_number;\r\n\t}",
"public function getNik()\n {\n return $this->nik;\n }",
"public function getNbHNuit(): ?float {\n return $this->nbHNuit;\n }",
"public function getnumfact()\n {\n return $this->numfact;\n }",
"public function getIpi()\n {\n return $this->ipi;\n }",
"protected function valor_totalipi($itnotafiscal){\r\n\t\t$notafiscal = $this->arr_notafiscal[$itnotafiscal[\"idnotafiscal\"]];\r\n\t\t$natoperacao = $this->arr_natoperacao[$notafiscal[\"natoperacao\"]];\r\n\r\n\t\t$modelo = $this->modelo($notafiscal);\r\n\r\n\t\t$estabelecimento = $this->arr_estabelecimento[$notafiscal[\"codestabelec\"]];\r\n\t\t$tipoatividade = (is_array($estabelecimento) ? $estabelecimento[\"tipoatividade\"] : $this->estabelecimento->gettipoatividade());\r\n\r\n\t\tif(in_array($notafiscal[\"status\"], array(\"C\", \"I\", \"D\")) || in_array($modelo, array(\"65\"))){\r\n\t\t\t$totalipi = null;\r\n\t\t}elseif($tipoatividade === \"D\" && $natoperacao[\"geraspedipi\"] === \"S\"){\r\n\t\t\t$totalipi = $itnotafiscal[\"totalipi\"];\r\n\t\t}elseif(in_array($notafiscal[\"operacao\"], array(\"CP\", \"DF\")) && !$this->gerar_contmatic){\r\n\t\t\t$totalipi = 0;\r\n\t\t}else{\r\n\t\t\t$totalipi = $itnotafiscal[\"totalipi\"];\r\n\t\t}\r\n\r\n\t\treturn $totalipi;\r\n\t}",
"public function getFInic()\n {\n return $this->f_inic;\n }",
"public function getNreg()\n {\n\n return $this->nreg;\n\n }",
"public function getIpiVIPI()\n {\n return $this->ipi_vIPI;\n }",
"protected function get_nis( $param = array()){\n if( !is_array($param)){\n $this->add_obj_dele_db( null );\n return null;\n }\n else{\n //! make nis` object\n $name_session = $param ['name_session'] ;\n $nis_number = 0 ; \n $nis_obj = new Save_Nis_Model();\n $nis_obj = $nis_obj->getobj( $name_session );\n //! get number \n if( ! is_null($nis_obj) && $nis_obj->first()){\n $this->add_obj_dele_db( $nis_obj );\n $nis_number = $nis_obj->first()->nis; \n }\n else{\n $santri = new Santri_Model();\n $nis_number = $santri->getmaxnisplus($name_session);\n }\n return $nis_number;\n }\n }",
"public function getIin()\n {\n return substr($this->getValue(), 0, 6);\n }",
"public function getNrc()\n {\n return $this->nrc;\n }",
"public function getVIPI()\n {\n return $this->vIPI;\n }",
"public function getNic():?string {\n return substr($this->siret,9,5);\n }"
] | [
"0.64521533",
"0.64173377",
"0.6221111",
"0.6059272",
"0.6000455",
"0.5949847",
"0.5925294",
"0.58899754",
"0.58899754",
"0.58899754",
"0.5798297",
"0.57807016",
"0.57010585",
"0.5674798",
"0.56699413",
"0.5642776",
"0.5629125",
"0.562875",
"0.5623545",
"0.5581162",
"0.5577424",
"0.55547845",
"0.55486923",
"0.5545049",
"0.5523102",
"0.55223686",
"0.5484273",
"0.5436553",
"0.5435286",
"0.54330516"
] | 0.817265 | 0 |
Set the value of nif | public function setNif(string $nif)
{
$this->nif = $nif;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNif()\n {\n return $this->nif;\n }",
"public function __construct($nif = null)\n {\n $this\n ->setNif($nif);\n }",
"function setNVal($nval) {\n\t\treturn $this->setProperty ( \"n_val\", $nval );\n\t}",
"public function setN($value)\n {\n return $this->set(self::N, $value);\n }",
"public function setN($value)\n {\n return $this->set(self::N, $value);\n }",
"public function setN($value)\n {\n return $this->set(self::N, $value);\n }",
"public function setNip($nip);",
"public function setNit($nit){\n\t\t$this->_mNit = $nit;\n\t\tString::validateNit($nit, 'Nit inválido.');\n\t}",
"public function setNimi($nimi){\n $this -> nimi =$nimi;\n }",
"function setValorNota($nValorNota) {\n $this->oObjCalculo->setValorNota($nValorNota);\n }",
"public function getNis()\n {\n return $this->nis;\n }",
"public function setNumpre($iNumpre){\n $this->iNumpre = $iNumpre;\n }",
"public function setN($n)\n {\n $this->n = $n;\n return $this;\n }",
"public function setNip($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->nip !== $v) {\n $this->nip = $v;\n $this->modifiedColumns[] = PtkPeer::NIP;\n }\n\n\n return $this;\n }",
"public function setNumnf($data)\n {\n self::$numnf = $data;\n }",
"public function executeNmi()\n {\n $this->push16($this->registers->getPC());\n $this->push($this->registers->getP());\n $this->registers->setStatusBit(Registers::I, 1);\n $addr = $this->memory->read16(0xFFFA);\n $this->registers->setPC($addr);\n $this->interrupts->setInterrupt(Interrupts::NMI, false);\n }",
"public function setValor($nValor) {\n $this->nValor = $nValor;\n }",
"public function setNumber($var) {}",
"public function setNumber($var) {}",
"public function setNumber($var) {}",
"public function setNumber($var) {}",
"public function getNit(){\n\t\treturn $this->_mNit;\n\t}",
"public function setNumberValue($var) {}",
"public\tfunction\tsetNbChair($nbchair)\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$this->nbchair\t=\t$nbchair;\n\t\t\t\t\t\t\t\t}",
"public function getNit()\n {\n return $this->nit;\n }",
"public function setNumpar($iNumpar){\n $this->iNumpar = $iNumpar;\n }",
"public function setIf(TIfExpressionType $if)\n {\n $msg = null;\n if (!$if->isOK($msg)) {\n throw new \\InvalidArgumentException($msg);\n }\n $this->if = $if;\n return $this;\n }",
"public function setNumeroNota($iNumeroNota) {\n $this->iNumeroNota = $iNumeroNota;\n }",
"public function getNiyNigk()\n {\n return $this->niy_nigk;\n }",
"public function setNiyNigk($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->niy_nigk !== $v) {\n $this->niy_nigk = $v;\n $this->modifiedColumns[] = PtkPeer::NIY_NIGK;\n }\n\n\n return $this;\n }"
] | [
"0.7145153",
"0.63120216",
"0.60776675",
"0.6021519",
"0.6021519",
"0.6021519",
"0.58267564",
"0.5803207",
"0.57874954",
"0.54787284",
"0.54604864",
"0.5409019",
"0.5371807",
"0.53577775",
"0.53521746",
"0.5351261",
"0.5286671",
"0.5280136",
"0.5280136",
"0.5280136",
"0.5280136",
"0.5268022",
"0.5219206",
"0.5150002",
"0.5146685",
"0.51156956",
"0.5080017",
"0.5079504",
"0.5077817",
"0.50758255"
] | 0.7548524 | 0 |
Here I build object that contain all active rooms and his messages with relationships. Thats provide for me easyaccessed data about all chats by user id | public static function buildConversationModelFor($user_id){
$rooms = RoomsModel::join("room_members", "room_members.room_id", "=", "rooms.id")
->where("room_members.user_id", $user_id)
->get("rooms.*");
return $rooms;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function chat()\n {\n return $this->hasMany(Room::class);\n }",
"public function getMessages(){\n return $this->hasMany('App\\Models\\MessagesModel', 'room_id', 'id')->orderBy('created_at', \"DESC\")->get();\n }",
"public function chats()\n {\n return $this->hasMany(Chat::class);\n }",
"public static function getChatsWith()\n\t{\n return SQL::exec('SELECT sender_id,receiver_id FROM chat WHERE sender_id=? OR receiver_id=? ORDER BY id DESC', [session::isAuthorized(),session::isAuthorized()], SQL::FETCHALL);\n\t}",
"public function index()\n {\n /* get invitation */\n $limit = 10;\n $invites = Invite::where('email', Auth::user()->email)\n ->orderBy('created_at', 'desc')\n ->paginate($limit)\n ->through(function ($invite) {\n\n $room = Rooms::find($invite->room_id);\n return [\n 'id' => $invite->id,\n 'roomid' => $invite->room_id,\n 'cleandate' => date('d M Y, H:ia', strtotime($invite->created_at)),\n 'person' => User::find($room->owner)->name,\n 'id_encrypt' => Crypt::encryptString($invite->id),\n 'roomname' => $room->name,\n ];\n });\n\n /* public chat room */\n $joined_public = Member::where('member_id', Auth::user()->id)\n ->join('rooms', 'rooms.id', '=', 'member.rooms_id')\n ->where('private', 0)\n ->count();\n $total_public = Rooms::where('private', 0)\n ->count();\n\n /* private chat room */\n $joined_private = Member::where('member_id', Auth::user()->id)\n ->join('rooms', 'rooms.id', '=', 'member.rooms_id')\n ->where('private', 1)\n ->count();\n $total_private = Rooms::where('private', 1)\n ->count();\n\n /* my chat room */\n $limit = 10;\n $myrooms = Rooms::where('owner', Auth::user()->id)\n ->orderBy('created_at', 'desc')\n ->paginate($limit)\n ->through(function ($room) {\n\n $count_member = Member::where('rooms_id', $room->id)->count();\n $count_message = Message::where('room_id', $room->id)->count();\n return [\n 'name' => $room->name,\n 'count_member' => $count_member,\n 'count_message' => $count_message,\n ];\n });\n\n return Inertia::render('Dashboard', [\n 'invites' => $invites, \n 'joined_public' => $joined_public, \n 'total_public' => $total_public,\n 'joined_private' => $joined_private, \n 'total_private' => $total_private,\n 'myrooms' => $myrooms\n ]);\n }",
"public function getRoomsCreatedByUser($id)\n {\n return Room::with('tenants')\n ->where('user_id', $id)->get();\n }",
"public function chatRooms() {\n $nrooms = count($this->chatrooms);\n $chatrooms = '';\n if($nrooms > 0) {\n for($i=0; $i<$nrooms; $i++) {\n $id = ($i==0) ? 'id=\"s_room\"' : '';\n $chatrooms .= '<span class=\"chatroom\" '.$id.' onclick=\"setChatRoom(this)\">'.$this->chatrooms[$i].'</span>';\n }\n }\n else $chatrooms = '<span><b> - Chat</span>';\n\n return $chatrooms;\n }",
"public function getMessages(ChatRoom $room)\n {\n return ChatMessage::fromRoom($room->id)\n ->orderBy('id', 'desc')\n ->with('user:id,name,avatar')\n ->with(['recipients' => function($query) {\n $query->select('user_id AS id', 'name', 'avatar');\n }])\n ->limit(100)\n ->get()\n ->map(function ($room) {\n $room->user->setAppends(['avatar_url']);\n return $room;\n })\n ->reverse()\n ->values(); // converting object to array\n }",
"public function getAdminAndDoctorChats()\n { \n \n $_AdminAndDoctorChats= Users::Join('profiles', 'users.profile_id', '=', 'profiles.id') \n ->where('profiles.description','=', 'ADMIN') \n ->whereNull('users.deleted_at') \n ->select(DB::raw(\"users.id, users.avatar, CONCAT(IFNULL(users.name,users.email),' ',IFNULL(users.last_name,'')) as user_name, \n null as date, null as time\"))\n ->orderBy('users.id', 'desc')\n ->get();\n \n \n $chats= Chats::Join('users', 'users.id', '=', 'chats.user_id')\n ->Join('profiles', 'users.profile_id', '=', 'profiles.id')\n ->where('chats.doctor_id_parent',Auth::user()->id) \n ->whereNull('users.deleted_at') \n ->select(DB::raw(\"chats.id, chats.doctor_id_parent, \n date(chats.created_at) as date, time(chats.created_at) as time, (CASE WHEN profiles.description = 'DOCTOR' THEN 'amber-7' ELSE 'primary' END) AS bgcolor,\n (CASE WHEN profiles.description = 'DOCTOR' THEN 'Yo' ELSE users.name END) AS who, \n chats.comment\"))\n ->orderBy('chats.id', 'desc')->get();\n\n $_AdminAndDoctorChats[0]['chat_history_being_doctor']=$chats;\n\n $_avatarMe = Users::where('users.id', Auth::user()->id) \n ->select('users.avatar')\n ->get();\n\n return response()\n ->json([\n 'AllDoctorsChats' => $_AdminAndDoctorChats,\n 'avatarMe'=>$_avatarMe\n ]);\n }",
"function getChatroomComments($CID, $UID)\r\n\t{\r\n\t\t/***** Verify that the user is subscribed to the chatroom *****/\r\n\t\t//$sql = \"SELECT Name, Comment FROM Users INNER JOIN Comments WHERE Chatroom_Id = '$CID';\";\r\n\t\t//$chatroomComments = $_SESSION['db']->select($sql);\r\n\t\t\r\n\t\t/***** Get the comments for the selected chatroom ****/\r\n\t\t\t$sql = \"SELECT Name, Comment FROM Users INNER JOIN Comments WHERE Chatroom_Id = '$CID' AND UID = User_Id;\";\r\n\t\t\t$chatroomComments = $_SESSION['db']->select($sql);\r\n\t\t\t\r\n\t\t\t/**** If there is a count, we know the user has subscribed to chatrooms ***/\r\n\t\t\tif (count($chatroomComments) > 0)\r\n\t\t\t{\r\n\t\t\t\t$myarray = array();\r\n\t\t\t\t$nameArray = array();\r\n\t\t\t\t$commentArray = array();\r\n\t\t\t\t//echo \"WTF MATE\";\r\n\t\t\t\t//echo count($matchedChatrooms);\r\n\t\t\t\tfor ($i = 0; $i < count($chatroomComments); ++$i) {\r\n \t\t\t// echo $chatroomComments[$i]['Name'];\r\n \t\t\t// echo \"<br>\";\r\n \t\t\t// echo $chatroomComments[$i]['Comment'];\r\n \t\t\t// echo \"<br>\";\r\n\t\t\t\t\tarray_push($nameArray, $chatroomComments[$i]['Name']);\r\n\t\t\t\t\tarray_push($commentArray, $chatroomComments[$i]['Comment']);\r\n \t\t\t}\r\n\t\t\t\t$myarray['Name'] = $nameArray;\r\n\t\t\t\t$myarray['Comment'] = $commentArray;\r\n\t\t\t\t//echo json_encode($commentArray);\r\n\t\t\t\techo json_encode($myarray);\r\n\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\t$hasSubscribed = FALSE;\r\n\t\t\t\techo \"No comments for this chatroom\t\";\r\n\t\t\t}\t\t\t\r\n\t\r\n\t}",
"public function getMessages()\n {\n return $this->hasMany(Messages::className(), ['chat_id' => 'id']);\n }",
"public function rooms()\n {\n return $this->hasMany(Room::class, 'owner_id');\n }",
"public function index()\n {\n $chats = Chat::with('users')\n \t->select(DB::raw('ANY_VALUE(chats.id) as id, ANY_VALUE(chats.channel_identifier) as channel_identifier, ANY_VALUE(chats.created_at) as created_at, ANY_VALUE(chats.updated_at) as updated_at, count(message_user.id) as unseen_message_count, ANY_VALUE(messages.created_at) as message_created_at'))\n ->leftJoin('messages', 'messages.chat_id', 'chats.id')\n ->leftJoin('message_user', 'message_user.message_id', 'messages.id')\n ->where(function ($query) {\n \t $query->whereHas('users', function ($innerQuery) {\n \t \t$innerQuery->where('chat_user.user_id', auth()->id());\n \t })\n \t ->orWhereHas('messages.recievers', function ($innerQuery) {\n \t \t$innerQuery->where('message_user.user_id', auth()->id());\n \t });\n })\n\t ->orderBy('unseen_message_count', 'desc')\n\t ->orderBy('messages.id', 'desc')\n ->groupBy('chats.id')\n\t ->paginate();\n\n collect($chats->items())->each(function($chat) {\n $chat->load([ 'messages' => function ($query) {\n $query->orderBy('id', 'desc')->take(1);\n }, 'messages.recievers', 'messages.user' ]);\n });\n\n\t return response()->json([ 'chats' => $chats ]);\n }",
"public static function getChats() {\n $em = dbconnection::getInstance()->getEntityManager() ;\n $chatRepository = $em->getRepository('chat');\n $chats = $chatRepository->findAll();\n\n return $chats;\n\n }",
"public function getUnsortedMessages(){\n return $this->hasMany('App\\Models\\MessagesModel', 'room_id', 'id')->get();\n }",
"public function chatUsers()\n\t{\n\t\treturn $this->hasMany('\\App\\Models\\Chat\\User', 'user_id');\n\t}",
"public function message_list($me = null, $some = 1) {\n// $m = new MongoClient();\n//\n// echo \"Connection to database successfully </br>\";\n// // select a database\n// $db = $m->dicu;\n//\n// echo \"Database dicu selected </br>\" ;\n// $collection = $db->messages;\n// echo \"Collection selected succsessfully </br>\";\n//\n// $cursor = $collection->find();\n// // iterate cursor to display title of documents\n//\n// foreach ($cursor as $document) {\n// echo $document[\"_id\"].'</br>';\n// echo $document[\"sender\"].'</br>';\n// echo $document[\"receiver\"] . \"</br>\";\n// echo $document[\"message\"] . \"</br></br></br>\";\n// }\n//\n// die();\n $this->layout = false;\n header('Content-Type: application/json');\n\n// NEW RULE ******\n// need to check sender_deleted / receiver_deleted\n// if sender deleted do not show the conversation to sender, same for receiver\n\n $this->autoLayout = false;\n\n $chat_validity = $this->Chat->find('all', array(\n//'recursive' => -1,\n 'joins' => array(\n array(\n 'table' => 'friends',\n 'alias' => 'Friend',\n 'type' => 'LEFT',\n 'conditions' => array(\n \"(Chat.sender = Friend.userId1 AND Chat.receiver = Friend.userId2)\nOR (Chat.receiver = Friend.userId2 AND Chat.sender = Friend.userId1)\"\n )\n )\n ),\n 'conditions' => array(\n 'OR' => array(\n array('Chat.receiver' => $me, 'Chat.receiver_deleted' => 0),\n array('Chat.sender' => $me, 'Chat.sender_deleted' => 0)\n )\n ),\n 'fields' => array('Chat.id', 'Sender.*', 'Receiver.*', 'Friend.is_accepted', 'Chat.created')\n ));\n\n //print_r($chat_validity); exit;\n if (!empty($chat_validity)) {\n $chat_ids = Set::extract('/Chat/id', $chat_validity);\n\n /* $chat_ids = Set::extract('/Chat/id', $chat_validity);\n //var_dump($chat_ids);\n // TODO: we should not proceed further if $chat_ids are empty!\n if(empty($chat_ids)){\n var_dump($chat_ids);\n echo json_encode(array('success' => true, 'message_list' => null));\n }\n exit; */\n\n $this->loadModel('MongoMessage');\n $db = $this->MongoMessage->getDataSource('Mongodb.MongodbSource');\n $m = new MongoClient();\n\n //select a database\n $db = $m->dicu;\n $collection = $db->messages;\n\n $cursor = $collection->find();\n // iterate cursor to display title of documents\n\n $message_lists = array();\n\n /* $int_index = 0;\n foreach ($cursor as $document) {\n $message_lists['retval'][$int_index]['last_message'] = '';\n $message_lists['retval'][$int_index]['count'] = 0;\n $message_lists['retval'][$int_index]['sender'] = $document[\"sender\"];\n $message_lists['retval'][$int_index]['receiver'] = $document[\"receiver\"];\n $message_lists['retval'][$int_index]['created_at'] = 0;\n $message_lists['retval'][$int_index]['has_image'] = 0;\n $int_index++;\n }\n print_r($message_lists);\n exit; \n */\n\n \n\n $keys = array(\"chat_id\" => 1);\n\n $initial = array(\"last_message\" => '', 'count' => 0, 'sender', 'receiver', 'created_at' => 0, 'has_image' => 0);\n\n $reduce = \"function (obj, prev) {\n if(prev.created_at < obj.created_at ) \n { prev.last_message = obj.message; \tprev.created_at = obj.created_at; }\n if(obj.receiver == $me && !obj.is_read)\tprev.count++; \n prev.sender = obj.sender; \n prev.receiver = obj.receiver; \n prev.has_image = obj.has_image; \n }\";\n $condition = array('condition' => array(\"chat_id\" => array('$in' => $chat_ids)));\n //var_dump($condition);\n $message_lists = $collection->group($keys, $initial, $reduce);\n\n /* \n echo json_encode($message_lists['retval']);\n die();\n $message_lists = $db->group(array(\n 'key' => array(\"chat_id\" => 1),\n 'initial' => array(\"last_message\" => '', 'count' => 0, 'sender', 'receiver', 'created_at' => 0, 'has_image' => 0),\n 'reduce' => \"function (obj, prev) { if(prev.created_at < obj.created_at ) { prev.last_message = obj.message; \tprev.created_at = obj.created_at; }\n if(obj.receiver == $me && !obj.is_read)\tprev.count++; \n prev.sender = obj.sender; \n prev.receiver = obj.receiver; \n prev.has_image = obj.has_image; \n }\",\n 'options' => array('condition' => array(\"chat_id\" => array('$in' => $chat_ids)))\n ), $this->MongoMessage\n ); \n */\n\n $mongo_message_lists = array();\n foreach ($message_lists['retval'] as $k => $v) {\n if (isset($v['created_at']->sec)) {\n if (!empty($v['created_at']->sec)) {\n //echo $v['created_at']->sec .\"hekjhjk\";\n $message_lists['retval'][$k]['time'] = $v['created_at']->sec;\n unset($message_lists['retval'][$k]['created_at'], $message_lists['retval'][$k][0], $message_lists['retval'][$k][1]);\n $mongo_message_lists[$k]['MongoMessage'] = $message_lists['retval'][$k];\n }\n }\n }\n if (!empty($message_lists)) {\n $this->_latest_activity($me);\n\n /* $message_lists = usort($message_lists, $this->cmp);\n $message_lists = Set::sort($message_lists['retval'], '{n}.time', 'DESC');\n print_r($message_lists); exit; */\n\n $block_list = $this->Chat->query('SELECT userId1 FROM blocks WHERE userId2 = '.$me.';');\n \n $this->set(compact('mongo_message_lists', 'me', 'chat_validity', 'block_list'));\n\n //$this->set(compact('mongo_message_lists', 'me', 'chat_validity', 'some'));\n\n /* $this->set(compact('mongo_message_lists'));\n echo json_encode(array('success' => true, 'mongo_message_lists' => $mongo_message_lists, 'me' => $me, 'some' => $some));\n exit; */\n\n } else {\n echo json_encode(array('success' => false, 'message_list' => 'no data'));\n exit;\n }\n } else {\n $no_data = array();\n die(json_encode(array('success' => true, 'message_list' => $no_data)));\n }\n }",
"function chat_list($req, $con){\r\n\t$user_id = $_REQUEST['user_id'];\r\n\t$chat_listtype=$_REQUEST['chat_listtype'];\r\n\t$cur_date = date(\"y-m-d\");\r\n\t$cur_time = date('H:i:s');\r\n\t$date_time = $cur_date.\" \".$cur_time;\r\n\r\n\tif($user_id != ''){\r\n/////Many to many data start here//////\r\n\t\t$ssq=\"SELECT acgm.group_id as chat_group_id, acgm.group_member, acg.id as group_id , acg.group_name, acg.group_icon FROM `athlete_chat_group_member` as acgm left join athlete_chat_group as acg on acgm.group_id=acg.id where acgm.group_member=$user_id and acg.group_type='$chat_listtype' \";\r\n//exit;\r\n\t\t$ressq = mysqli_query($con, $ssq);\r\n\t\t$nummem=mysqli_num_rows($ressq);\r\n\t\tif($nummem>0){\r\n\t\t\twhile($rowssq = mysqli_fetch_assoc($ressq))\r\n\t\t\t{\r\n\t\t\t\t$chats_type = \"MtoM\";\r\n\t\t\t\t$id_name = mysqli_query($con, \"SELECT * from `athlete_chat_group` where `id` = '$rowssq[group_id]'\");\r\n\t\t\t\t$chatlist['front_id'] = $to_id;\r\n\t\t\t\tif($in_row = mysqli_fetch_assoc($id_name))\r\n\t\t\t\t{\r\n\t\t\t\t\t$chatlist['name'] = $in_row['group_name'];\r\n\t\t\t\t\t$chatlist['profile_image'] = $in_row['group_icon'];\r\n\t\t\t\t\t$chatlist['admin_id'] = $in_row['admin_id'];\r\n\t\t\t\t}\r\n\t\t\t\t$pp=\"SELECT * from `athlete_chatlist` where `to_id` = '$rowssq[group_id]' and chat_type='\".$chats_type.\"'\";\r\n\t\t\t\t$id_names = mysqli_query($con, $pp);\r\n\t\t\t\t$chatlist['front_id'] = $rowssq[group_id];\r\n\t\t\t\tif($in_rows = mysqli_fetch_assoc($id_names))\r\n\t\t\t\t{\r\n\t\t\t\t\t$from_ids=$in_rows['from_id'];\r\n\t\t\t\t\t$to_ids=$in_rows['to_id'];\r\n\t\t\t\t\t$datet=$in_rows['date_time'];\r\n\t\t\t\t}\r\n\t\t\t\t$rrr=\"SELECT * from `athlete_users` where `user_id` = '$from_ids'\";\r\n\t\t\t\t$id_name = mysqli_query($con, $rrr);\r\n\t\t\t\tif($in_row = mysqli_fetch_assoc($id_name))\r\n\t\t\t\t{\r\n\t\t\t\t\t$sender_name = $in_row['user_name']; \r\n\t\t\t\t}\r\n\t\t\t\t$rrrr=\"SELECT count(*) AS `total` from `dummy_group_msg` where `member_id` = '$user_id' && `group_id` = '$to_ids' && `status` = 0\";\r\n\t\t\t\t$count_msg = mysqli_query($con,$rrrr);\r\n\t\t\t\tif($msg_row = mysqli_fetch_assoc($count_msg))\r\n\t\t\t\t{\r\n\t\t\t\t\t$chatlist['count_msg'] = $msg_row['total'];\r\n\t\t\t\t}\r\n\t\t\t\t$rrrrr=\"SELECT * from `user_chat_msg` where `from_id` = '$from_ids' && `to_id` = '$to_ids' && `date_time` = '$datet' && `chat_type`= '$chats_type'\";\r\n\t\t\t\t$msg_des = mysqli_query($con,$rrrrr);\r\n\t\t\t\tif($msg_details = mysqli_fetch_assoc($msg_des))\r\n\t\t\t\t{\r\n\t\t\t\t\t$chatlist['msg_type'] = $msg_details['msg_type'];\r\n\t\t\t\t\t$chatlist['chat_type'] = $msg_details['chat_type'];\r\n\t\t\t\t\t$chatlist['description'] = $sender_name.\" : \".$msg_details['description'];\r\n\t\t\t\t\t$chatlist['date_time'] = $msg_details['date_time'];\r\n\t\t\t\t\t$chatlist['cur_date'] = $msg_details['cur_date'];\r\n\t\t\t\t\t$chatlist['cur_time'] = $msg_details['cur_time'];\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$chatlist1[] = $chatlist;\r\n\t\t\t}\r\n\t\t}\r\n/////Many to many data ends here//////\r\n///////One to one message start//////\r\n\t\tif($chat_listtype=='group_chat'){\r\n\t\t\t$res = mysqli_query($con, \"SELECT * from `athlete_chatlist` WHERE (`from_id`='$user_id' || `to_id`='$user_id') and chat_type='OtoO' order by `date_time` desc\");\r\n\t\t\twhile($row = mysqli_fetch_assoc($res))\r\n\t\t\t{\r\n\t\t\t\t$chat_type = $row['chat_type'];\r\n\t\t\t\t$to_id = $row['to_id'];\r\n\t\t\t\t$from_id = $row['from_id'];\r\n\t\t\t\t$chats_type = \"OtoO\";\r\n\t\t\t\tif($from_id != $user_id)\r\n\t\t\t\t{\r\n\t\t\t\t\t$date_time = $row['date_time'];\r\n\t\t\t\t\t$chatlist['from_id'] = $row['from_id'];\r\n\t\t\t\t\t$chatlist['to_id'] = $row['to_id'];\r\n\t\t\t\t\t$id_name = mysqli_query($con, \"SELECT * from `athlete_users` where `user_id` = '$from_id'\");\r\n\t\t\t\t\t$chatlist['front_id'] = $from_id;\r\n\t\t\t\t\tif($in_row = mysqli_fetch_assoc($id_name))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$chatlist['name'] = $in_row['user_name'];\r\n\t\t\t\t\t\t$chatlist['profile_image'] = PROFILE_IMAGE.$in_row['profile_image'];\r\n\t\t\t\t\t\t$chatlist['admin_id'] = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$count_msg = mysqli_query($con,\"SELECT count(*) AS `total` from `user_chat_msg` where `from_id` = '$from_id' && `to_id` = '$to_id' && `chat_type`= '$chats_type' && `status` = '0' \");\r\n\t\t\t\t\tif($msg_row = mysqli_fetch_assoc($count_msg)){\r\n\t\t\t\t\t\t$chatlist['count_msg'] = $msg_row['total'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$msg_des = mysqli_query($con,\"SELECT * from `user_chat_msg` where `from_id` = '$from_id' && `to_id` = '$to_id' && `date_time` = '$date_time' && `chat_type`= '$chats_type'\");\r\n\t\t\t\t\tif($msg_details = mysqli_fetch_assoc($msg_des))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$chatlist['msg_type'] = $msg_details['msg_type'];\r\n\t\t\t\t\t\t$chatlist['chat_type'] = $msg_details['chat_type'];\r\n\t\t\t\t\t\t$chatlist['description'] = $msg_details['description'];\r\n\t\t\t\t\t\t$chatlist['date_time'] = $msg_details['date_time'];\r\n\t\t\t\t\t\t$chatlist['cur_date'] = $msg_details['cur_date'];\r\n\t\t\t\t\t\t$chatlist['cur_time'] = $msg_details['cur_time'];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if($from_id == $user_id)\r\n\t\t\t\t{\r\n\t\t\t\t\t$date_time = $row['date_time'];\r\n\t\t\t\t\t$chatlist['from_id'] = $row['from_id'];\r\n\t\t\t\t\t$chatlist['to_id'] = $row['to_id'];\r\n\t\t\t\t\t$chatlist['front_id'] = $to_id;\r\n\t\t\t\t\t$id_name = mysqli_query($con, \"SELECT * from `athlete_users` where `user_id` = '$to_id'\");\r\n\t\t\t\t\tif($in_row = mysqli_fetch_assoc($id_name))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$chatlist['name'] = $in_row['user_name'];\r\n\t\t\t\t\t\t$chatlist['profile_image'] = PROFILE_IMAGE.$in_row['profile_image'];\r\n\t\t\t\t\t\t$chatlist['admin_id'] = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$chatlist['count_msg'] = \"0\";\r\n\t\t\t\t\t$msg_des = mysqli_query($con,\"SELECT * from `user_chat_msg` where `from_id` = '$from_id' && `to_id` = '$to_id' && `date_time` = '$date_time' && `chat_type`= '$chats_type'\");\r\n\t\t\t\t\tif($msg_details = mysqli_fetch_assoc($msg_des))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$chatlist['msg_type'] = $msg_details['msg_type'];\r\n\t\t\t\t\t\t$chatlist['chat_type'] = $msg_details['chat_type'];\r\n\t\t\t\t\t\t$chatlist['description'] = $msg_details['description'];\r\n\t\t\t\t\t\t$chatlist['date_time'] = $msg_details['date_time'];\r\n\t\t\t\t\t\t$chatlist['cur_date'] = $msg_details['cur_date'];\r\n\t\t\t\t\t\t$chatlist['cur_time'] = $msg_details['cur_time'];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$chatlist1[] = $chatlist;\r\n\t\t\t\tunset($chatlist);\r\n\t\t\t}\r\n\t\t}\r\n////For one to one message data end//\r\n\t\tif ($chatlist1)\r\n\t\t{\r\n\t\t\t$empt1 = array(\"res\" => '1', \"result\"=>$chatlist1);\r\n\t\t\techo json_encode($empt1);\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\t$empt1 = array(\"res\" => '0', \"result\" => 'Data Not Found');\r\n\t\t\techo json_encode($empt1);\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$data['res'] = \"0\";\r\n\t\t$data['result'] = \"Please enter all required fields.\";\r\n\t\techo json_encode($data);\r\n\t}\r\n}",
"public function list() {\n $token = bin2hex(random_bytes(32));\n $_SESSION['token'] = $token;\n \n $chats = Chats::findCurrentChats();\n // For each chat of the current user, we add a message property containing the last message of the chat\n foreach($chats as $key=>$contact) {\n $chats[$key]['message']=Messages::getLast($chats[$key]['chat_id']);\n }\n // We only display chats that have messages\n $activeChats = array_filter($chats, function($chat){\n return $chat['message'] == true;\n });\n //And we sort them by last message date\n usort($activeChats, function($a, $b) {\n return strcmp($b[\"message\"]->created_at, $a[\"message\"]->created_at);\n }); \n $this->show('chat/list', ['activeChats'=>$activeChats, 'token'=>$token]);\n }",
"public function getChat(int $id) {\n //get token for authentification\n $token = bin2hex(random_bytes(32));\n $_SESSION['token'] = $token;\n\n $chat = Chats::find($id);\n if(!$chat) {\n header('HTTP/1.0 403 Forbidden'); \n die('You are not allowed to access this file.'); \n }\n \n //For the chat, find the user that is not the current user \n $contacts = $chat->findUsers();\n \n // If our logged in user is not part of the chat's users we return a 403\n $isAuthorized = false;\n foreach ($contacts as $contact) {\n $id = $contact->id;\n if($id == $_SESSION['id']) {\n $isAuthorized = true;\n }\n }\n if(!$isAuthorized) {\n header('HTTP/1.0 403 Forbidden'); \n die('You are not allowed to access this file.'); \n }\n \n\n $contacts = array_filter($contacts, function($contact){\n return $contact->id != $_SESSION['id'];\n });\n //We get an array, and keep only the first result\n foreach($contacts as $contactUser) {\n $contact=$contactUser;\n break;\n }\n $messages = $chat->findMessages();\n // When the current user enters the chat, we set the status of the messages to \"read\", if he is not the author\n foreach($messages as $message) { \n if($message->getAuthorId() !== $_SESSION['id']) {\n $message->setIsRead(true);\n $message->update();\n } \n }\n $this->show('chat/chat', ['messages'=>$messages, 'contact'=>$contact, 'chat'=>$chat, 'token'=>$token]); \n }",
"public function getMessagesFor($id){\n\n Message::where('from', $id)->where('to', Auth::user()->id)->update(['read' => true]);\n \n $messages = Message::where(function($q) use ($id) {\n $userID = Auth::user()->id;\n $q->where('from', $userID);\n $q->where('to', $id);\n })->orWhere(function($q) use($id) {\n $userID = Auth::user()->id;\n $q->where('from', $id);\n $q->where('to', $userID);\n })->get(); //This query is (a = 1 and b = 2 || c = 1 and d = 2 )\n return response()->json($messages);\n \n }",
"public function room() {\n return $this->hasMany('App\\Models\\Room\\Room');\n }",
"public function get()\n {\n //$contacts = User::where('id', '!=', auth()->id())->get();\n $contacts=DB::table('users')\n ->select('users.*')->distinct()->join('messages', function($join){\n $join->on('users.id','=','messages.from'); \n $join->orOn('users.id','=','messages.to');\n })->where('messages.from','=',auth()->id())\n ->orWhere('messages.to','=',auth()->id())->where('users.id', '<>', Auth::id())->get();\n //SELECT DISTINCT users.* FROM `users`, `messages` WHERE messages.from = \n //users.id Or messages.to = users.id and messages.from = 5 or messages.to = 5\n\n // get a collection of items where sender_id is the user who sent us a message\n // and messages_count is the number of unread messages we have from hi\n $unreadIds = Message::select(\\DB::raw('`from` as sender_id, count(`from`) as messages_count'))\n ->where('to', auth()->id())\n ->where('read', false)\n ->groupBy('from')\n ->get(); \n\n // add an unread key to each contact with the count of unread messages\n $contacts = $contacts->map(function($contact) use ($unreadIds) {\n $contactUnread = $unreadIds->where('sender_id', $contact->id)->first();\n\n $contact->unread = $contactUnread ? $contactUnread->messages_count : 0;\n\n return $contact;\n });\n \n \n\n\n return response()->json($contacts);\n }",
"public function getMiniList($user_id, $q = '') {\n\t\t$this->loadModel('User');\n\t\t$this->loadModel('ChatMember');\n\t\t$this->loadModel('Group');\n\n\t\t$conditions = array(\n\t\t\t'ChatContact.user_id' => $user_id,\n\t\t\t'ChatContact.initiator_id !=' => $user_id,\n\t\t\t'ChatContact.group_id IS NULL',\n\t\t);\n\t\t$order = array(\n\t\t\t'ChatContact.active_count' => 'DESC',\n\t\t 'ChatContact.modified' => 'DESC',\n\t\t);\n\t\t$aContacts = $this->find('all', compact('conditions', 'order', 'recursive'));\n\t\t// добавлять в комнату других юзеров может только иницитор открытия комнаты или его изначальный оппонент\n\t\t// $aID = Hash::extract($aContacts, '{n}.ChatContact.room_id');\n\t\t$aPrivateRooms = array();\n\t\t$aGroupID = array();\n\t\t$count = -1;\n\t\tforeach($aContacts as &$_row) {\n\t\t\t$count ++;\n\t\t\t$roomID = $_row['ChatContact']['room_id'];\n\n\t\t\t$mConditions = array('ChatMember.user_id' => $user_id, 'ChatMember.room_id' => $roomID, 'ChatMember.is_deleted' => '1');\n\t\t\t$isDeleted = $this->ChatMember->find('first', array('conditions' => $mConditions));\n\t\t\tif($isDeleted) {\n\t\t\t\tunset($aContacts[$count]);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$members = $this->ChatMember->getRoomMembers($roomID);\n\n\t\t\t// исключаем текущего юзера]\n\t\t\t$members = array_combine($members, $members);\n\t\t\tunset($members[$user_id]);\n\t\t\t$members = array_values($members);\n\n\t\t\t$_row['ChatContact']['members'] = $members;\n\n\t\t\tif ( count($members) == 1 && Hash::get($_row, 'ChatContact.group_id') == null ) {\n\t\t\t\t$aPrivateRooms[$members[0]] = $_row;\n\t\t\t}\n\t\t\tif ($_row['ChatContact']['group_id']) {\n\t\t\t\t$aGroupID[] = $_row['ChatContact']['group_id'];\n\t\t\t}\n\t\t}\n $aGroups = Hash::combine($this->Group->findAllById($aGroupID), '{n}.Group.id', '{n}');\n\t\t$aID = Hash::extract($aContacts, '{n}.ChatContact.initiator_id');\n\t\t$aResult = array();\n\t\tif ($q) {\n\t\t\t$aUsers = $this->User->search($user_id, $q);\n\t\t\t// по обсуждению с Ярославом показываем чат-контакты только для приватных комнат\n\t\t\t// и только тех юзеров, кот. есть в списке найденных в порядке очередности поиска\n\t\t\tforeach($aUsers as $row) {\n\t\t\t\t$user_id = $row['User']['id'];\n\t\t\t\tif (isset($aPrivateRooms[$user_id])) {\n\t\t\t\t\t$row = array_merge($row, $aPrivateRooms[$user_id]);\n\t\t\t\t}\n\t\t\t\t$aResult[] = $row;\n\t\t\t}\n\t\t}else {\n\t\t\t// Просто показываем весь контакт лист в привязке к оппоненту, который последним писал в комнату\n\t\t\t$aUsers = $this->User->getUsers($aID);\n\t\t\tforeach($aContacts as $row) {\n\n $temp = $row;\n if(!is_null($row['ChatContact']['group_id'])) {\n $temp['ChatContact']['group_url'] = Router::url(array('controller' => 'Chat', 'action' => 'group', $row['ChatContact']['group_id']));\n $temp['ChatContact']['logo'] = $aGroups[$row['ChatContact']['group_id']]['GroupMedia']['url_img'];\n $temp['ChatContact']['group_name'] = $aGroups[$row['ChatContact']['group_id']]['Group']['title'];\n $temp['ChatContact']['responsible_id'] = $aGroups[$row['ChatContact']['group_id']]['Group']['responsible_id'];\n }\n $aResult[] = array_merge($temp, $aUsers[$row['ChatContact']['initiator_id']]);\n\t\t\t}\n\t\t}\n\n\t\treturn array('aUsers' => $aResult, 'aGroups' => $aGroups);\n\t}",
"public function get()\n {\n $contactids = Contact::where('user_id','=', auth()->id() )->get();\n $contacts = [];\n foreach ($contactids as $contid) {\n $contact = User::where('id', '=', $contid->user_contact_id)->first();\n $contacts[] = $contact;\n }\n \n\n // get a collection of items where sender_id is the user who sent us a message\n // and messages_count is the number of unread messages we have from him\n $unreadIds = Message::select(\\DB::raw('`from` as sender_id, count(`from`) as messages_count, max(`created_at`) as created_at'))\n ->where('to', auth()->id())\n ->where('read', false)\n ->groupBy('from')\n ->get();\n \n $last_msg_rcvd = Message::select(\\DB::raw('`from` as sender_id, max(`created_at`) as created_at'))\n ->where('to', auth()->id())\n ->where('read', true)\n ->groupBy('from')\n ->get();\n // add an unread key to each contact with the count of unread messages\n $contacts = collect($contacts);\n $contacts = $contacts->map(function($contact) use ($unreadIds, $last_msg_rcvd) {\n $contactUnread = $unreadIds->where('sender_id', $contact->id)->first();\n $last_msg = $last_msg_rcvd->where('sender_id', $contact->id)->first();\n\n $contact->unread = $contactUnread ? $contactUnread->messages_count : 0;\n if ($contactUnread) {\n $contact->msg_time = strtotime($contactUnread->created_at);\n }\n else{\n if ($last_msg) {\n $contact->msg_time = strtotime($last_msg->created_at);\n } else {\n $contact->msg_time = 0;\n } \n }\n return $contact;\n });\n\n return response()->json($contacts);\n }",
"public function rooms()\n {\n return $this->belongsToMany('App\\Room', 'reservation_reservable', 'id_reserva', 'id_reservable')\n ->withPivot(\n 'adults',\n 'children',\n 'infants'\n );\n }",
"public function chats(): object\n {\n $params = array(\n 'request' => '/chat',\n 'payload' => '',\n 'method' => 'GET'\n );\n\n return $this->request($params);\n }",
"protected function setChatRoomCnt() {\n $chatroomcnt = ' '; // stores chat room content\n\n // if file for current chat room exists, gets its content, else, display 'no chat', and current user\n if(file_exists($this->fileroom)) {\n $chatroomcnt = file_get_contents($this->fileroom);\n $chatusers = $this->getChatUsers($chatroomcnt); // get the list with online users\n\n // if access to add new chat text\n if(isset($_POST['adchat'])) {\n $adchat = trim(htmlentities($_POST['adchat'], ENT_NOQUOTES, 'utf-8')); // Transform HTML characters, and delete external whitespace\n if(get_magic_quotes_gpc()) $adchat = stripslashes($adchat); // Removes slashes added by get_magic_quotes_gpc\n\n // gets chat text rows\n preg_match_all('#(\\<p\\>(.*?)\\</p\\>)#is', $chatroomcnt, $found);\n $chatrows = $found[1];\n\n // if text added, sets the new row at the end, and keep the last $maxrows rows\n if(strlen($adchat)<1 || strlen($adchat)<201) {\n $chatrows[] = '<p><span class=\"chatusr\">• '.$this->chatuser.' - </span><em>'.date('j F H:i').'</em><span class=\"chat\">- '. $this->formatBbcode($adchat). '</span></p>';\n $chatrows = array_slice($chatrows, -($this->maxrows));\n }\n\n // sets chat room content\n $chatroomcnt = '<div id=\"chats\"><q>'.time().'</q>'. implode('', $chatrows). '</div>' .$chatusers;\n }\n else {\n // replace users list with new one (\"/is\" pattern case-insensitive, include newlines)\n $chatroomcnt = preg_replace('#\\<div id=\"chatusers\"\\>\\<h4 id=\"onl\"\\>Online\\</h4\\>(.*?)\\</div\\>#is', $chatusers, $chatroomcnt);\n }\n }\n else $chatroomcnt = '<div id=\"chats\">'.$this->lsite['notchat'].'</div>'. $this->getChatUsers('');\n\n if(strlen($chatroomcnt) > 10) {\n // write the chat content in TXT file, returns $chatroomcnt, or message error\n if(file_put_contents($this->fileroom, $chatroomcnt)) return $chatroomcnt;\n else return sprintf($this->lsite['err_savechat'], $this->fileroom);\n }\n }",
"public function getRooms()\n {\n return $this->hasMany(Rooms::className(), ['buildings_id' => 'buildings_id']);\n }",
"public function rooms()\n {\n return $this->hasMany('App\\Entities\\QuoteOptionHotelRoom', 'quote_option_id', 'quote_option_id');\n }"
] | [
"0.6747788",
"0.6455078",
"0.62024575",
"0.603215",
"0.59732497",
"0.59289247",
"0.59244496",
"0.588618",
"0.5880293",
"0.5856496",
"0.5838319",
"0.5837216",
"0.5821238",
"0.5789476",
"0.5774469",
"0.57706296",
"0.5732775",
"0.57285655",
"0.5723906",
"0.569872",
"0.5692397",
"0.568729",
"0.5682475",
"0.5653698",
"0.56521785",
"0.56484157",
"0.5641096",
"0.5631795",
"0.560758",
"0.5595325"
] | 0.6817267 | 0 |
Get all members of the room | public function getMembers(){
return $this->hasMany('App\Models\RoomsMembersModel', 'room_id', 'id')->get();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getMembersInRoom($room_id)\r\n {\r\n $query = \" SELECT\r\n room_member_id,\r\n u.user_id,\r\n username,\r\n member_type\r\n FROM room_members AS rm, users AS u\r\n WHERE rm.user_id = u.user_id AND rm.room_id = '{$room_id}'\";\r\n $result = @mysql_query($query) or die('getMembersInRoom: ' . mysql_error());\r\n return $result;\r\n }",
"public function getRooms() {\n $query = $this->query('SELECT rooms.*, users.username AS \"host_username\"\n FROM rooms\n LEFT JOIN users\n ON (users.id = rooms.id)');\n $query->execute();\n return $query->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function getMembersList(){\n return $this->_get(10);\n }",
"public function allMembers()\n {\n $allmembers = $this->pdo->Select(\"Select * from users\");\n\n return $allmembers;\n }",
"public function getMembers() {\n $query = $this->getRepository()->getMembersQuery();\n $this->getRepository()->setActiveCriteria($query);\n return $query->getQuery()->execute();\n }",
"public function get_rooms() {\n\t\t\n\t\treturn $this->make_request( 'rooms', array(), 'GET', 'rooms' );\n\t\t\n\t}",
"public function getRoomList() {\n $db = new PDOData();\n $data = $db->doQuery(\"\n select *\n from room\n order by room_id asc;\n \");\n\n return $data;\n }",
"public function getMembers();",
"public function getMembers();",
"public function getRoomUsers(Room $room)\n {\n return $this->redis->smembers($this->keyRoomUsers($room));\n }",
"function getMembers()\n {\n return Factory::createMany('user', $this->_members);\n }",
"public function getUsers()\n {\n return $this->members;\n }",
"public function getMembersList(){\n return $this->_get(7);\n }",
"public function getMembers()\n {\n return $this->members;\n }",
"public function getMembers()\n {\n return $this->members;\n }",
"public function getCalendarRoomList()\n\t{\n\t\t$result = $this->myPdoObj\n\t\t\t->select('id_room, name_room')\n\t\t\t->table('rooms')\n\t\t\t->limit(START_ROOM, END_ROOM)\n\t\t\t->query()\n\t\t\t->commit();\n\n\t\treturn $result;\n\t}",
"public function getMembersAsUser(){\n return $this->hasMany('App\\Models\\RoomsMembersModel', 'room_id', 'id')\n ->get()\n ->map(function (RoomsMembersModel $member){\n return User::find($member->user_id);\n })->reject(function ($member) {\n return empty($member);\n })->all();\n }",
"public function getAll(){\n\t\t$query = \"SELECT idrooms, id_cinema,name,capacity,price FROM \".$this->tableName;\n\t\t\t$roomsList = array();\n $this->connection = Connection::GetInstance();\n\n $result = $this->connection->Execute($query);\n\n foreach($result as $row)\n {\n $room = new Room($row[\"capacity\"],$row[\"id_cinema\"],$row[\"name\"],$row[\"price\"]);\n\t\t\t\t$room->setId($row['idrooms']);\n array_push($roomsList, $room);\n }\n\t\treturn $roomsList;\n\t}",
"public function actionList() {\n $criteria = new CDbCriteria();\n if (HSetting::Get('roomOrder', 'room') == 0) {\n $criteria->order = 'name ASC';\n } else {\n $criteria->order = 'last_visit DESC';\n }\n\n $memberships = RoomMembership::model()->with('room')->findAllByAttributes(array(\n 'user_id' => Yii::app()->user->id,\n 'status' => RoomMembership::STATUS_MEMBER,\n ), $criteria);\n\n $this->renderPartial('list', array('memberships' => $memberships), false, true);\n }",
"function get_all_rooms_info ()\n\t{\n\t\t$query_stmt = $this->database_conn->prepare (\"SELECT * FROM rooms ORDER BY number\");\n\t\t$query_stmt->execute ();\n\t\treturn $query_stmt->fetchAll ();\n\t}",
"public function index()\n {\n return Room::getAllRooms();\n }",
"public function members()\n {\n // method must return relationship object\n $usergroups = $this->usergroup()->get();\n $members = [];\n foreach($usergroups as $test) {\n $members[] = $test->user;\n }\n $members = new Collection($members);\n dump($members);\n return $members;\n }",
"public function getAdmins()\n {\n\n $admins = array();\n\n $adminMemberships = RoomMembership::model()->findAllByAttributes(array('room_id' => $this->getOwner()->id, 'admin_role' => 1));\n\n foreach ($adminMemberships as $admin) {\n $admins[] = $admin->user;\n }\n\n return $admins;\n }",
"public function listMemberRoom($roomId)\n {\n\n $url = $this->matrixServer . '/_matrix/client/r0/rooms/' . $roomId . '/members?access_token=' . Session::get('accesToken')->original;\n\n return $this->http->get($url);\n }",
"public function getAllMember()\r\n {\r\n return $this->db->get('tbl_member')->result_array();\r\n }",
"public function findRoommates($uid, $room_id){\n\t\t$query = \"SELECT user_id \n FROM room_member WHERE room_id = ? AND user_id <> ?\";\n\n\t\t$stmt = $this->prepareStatement($query);\n\t\t$bind = $stmt->bind_param(\"ii\", $room_id, $uid);\n\t\tif(!$bind)\n\t\t\treturn NULL;\n\t\t\n\t\t$exec = $stmt->execute();\n\t\tif(!$exec)\n\t\t\treturn NULL;\n\t\t\t\n\t\t$stmt->store_result();\n\t\t\t\n\t\tif($stmt->num_rows == 0)\n\t\t\treturn NULL;\n\t\t\t\n require_once \"../common/person.php\";\n\t\t\n\t\t$roommates = array();\n $stmt->bind_result($user_id);\n\n\t\twhile($stmt->fetch()){\n $mate = new Person($user_id, \"\", \"\");\n $roommates[] = $mate;\n }\n\t\t\n\t\treturn $roommates;\t\t\n\t}",
"public function getmembers() { \r\n $result = $this->model->getmembers();\r\n print_r(json_encode($result)); exit;\r\n }",
"public function getAllMembers(){\n \n //Base ya ha sido creada al haber hecho include\n\n //Lo primero que hace es traer toda la tabla de la base de datos.\n $sql = \"SELECT * FROM TEAM\";\n \n $conexion = $this->base->prepare($sql);\n\n //Ahora tengo un array de elementos asociativos\n //AQUI TENGO EL ARRAY \n\n $conexion->execute();\n \n //Ahora tengo un array de elementos asociativos\n $this->AllTeamMembers = $conexion->fetchAll(\\PDO::FETCH_ASSOC);\n\n \n return $this->AllTeamMembers;\n }",
"public static function getRooms () {\n return self::$rooms;\n }",
"public function getRooms()\n {\n $query = $this->createQueryBuilder('r')->select('r');\n \n return $query->getQuery()->getResult(\\Doctrine\\ORM\\Query::HYDRATE_ARRAY);\n }"
] | [
"0.73841906",
"0.7251108",
"0.72159916",
"0.7209884",
"0.716016",
"0.71589625",
"0.71170783",
"0.71057755",
"0.71057755",
"0.71043384",
"0.7083083",
"0.7018579",
"0.7008404",
"0.69842184",
"0.69842184",
"0.6975219",
"0.69677734",
"0.68830633",
"0.6882944",
"0.68549544",
"0.6832364",
"0.6798835",
"0.67785096",
"0.6758303",
"0.67454314",
"0.67366695",
"0.67284137",
"0.67151386",
"0.6704221",
"0.6667519"
] | 0.7646678 | 0 |
Get all members of the room except me | public function getMembersExceptMe(){
return $this->hasMany('App\Models\RoomsMembersModel', 'room_id', 'id')->where("user_id", "!=" ,Auth::id())->get();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getMembersAsUser(){\n return $this->hasMany('App\\Models\\RoomsMembersModel', 'room_id', 'id')\n ->get()\n ->map(function (RoomsMembersModel $member){\n return User::find($member->user_id);\n })->reject(function ($member) {\n return empty($member);\n })->all();\n }",
"public function getOutsideMembers(User $viewer)\n {\n $outside_members = array();\n $result = DB::inst()->query(\"SELECT users.* FROM suggestions_users\n INNER JOIN users ON users.id = suggestions_users.user_id\n WHERE suggestion_id = {$this->id} AND\n NOT EXISTS(\n SELECT * FROM group_memberships WHERE group_id IN (\n SELECT group_id FROM group_memberships WHERE user_id = {$viewer->id}\n ) AND user_id = users.id\n )\");\n\n while ($outside_member_row = DB::inst()->fetchAssoc($result)) {\n $outside_member = new User();\n $outside_member->populateFromRow($outside_member_row);\n $outside_members[] = $outside_member;\n }\n\n return $outside_members;\n }",
"public function getMembers(){\n return $this->hasMany('App\\Models\\RoomsMembersModel', 'room_id', 'id')->get();\n }",
"public static function getMembersInRoom($room_id)\r\n {\r\n $query = \" SELECT\r\n room_member_id,\r\n u.user_id,\r\n username,\r\n member_type\r\n FROM room_members AS rm, users AS u\r\n WHERE rm.user_id = u.user_id AND rm.room_id = '{$room_id}'\";\r\n $result = @mysql_query($query) or die('getMembersInRoom: ' . mysql_error());\r\n return $result;\r\n }",
"public function findRoommates($uid, $room_id){\n\t\t$query = \"SELECT user_id \n FROM room_member WHERE room_id = ? AND user_id <> ?\";\n\n\t\t$stmt = $this->prepareStatement($query);\n\t\t$bind = $stmt->bind_param(\"ii\", $room_id, $uid);\n\t\tif(!$bind)\n\t\t\treturn NULL;\n\t\t\n\t\t$exec = $stmt->execute();\n\t\tif(!$exec)\n\t\t\treturn NULL;\n\t\t\t\n\t\t$stmt->store_result();\n\t\t\t\n\t\tif($stmt->num_rows == 0)\n\t\t\treturn NULL;\n\t\t\t\n require_once \"../common/person.php\";\n\t\t\n\t\t$roommates = array();\n $stmt->bind_result($user_id);\n\n\t\twhile($stmt->fetch()){\n $mate = new Person($user_id, \"\", \"\");\n $roommates[] = $mate;\n }\n\t\t\n\t\treturn $roommates;\t\t\n\t}",
"public function getRooms() {\n $query = $this->query('SELECT rooms.*, users.username AS \"host_username\"\n FROM rooms\n LEFT JOIN users\n ON (users.id = rooms.id)');\n $query->execute();\n return $query->fetchAll(PDO::FETCH_ASSOC);\n }",
"function memberUsers($onlyMe=false, $ids_only = false) {\r\n global $Controller, $DB;\r\n $this->loadMembers();\r\n\r\n $onlyMe = (bool)$onlyMe;\r\n if($this->_memberUsers[$onlyMe]) {\r\n $users = $this->_memberUsers[$onlyMe];\r\n }\r\n elseif($this->_MEMBERS) {\r\n $groups = $DB->spine->asList(array('class' => 'Group', 'id' => $this->_MEMBERS), 'id');\r\n if($groups) {\r\n $users = array_diff($this->_MEMBERS, $groups);\r\n if(!$onlyMe) {\r\n foreach($groups as $group) {\r\n if($group == EVERYBODY_GROUP || $group == MEMBER_GROUP) continue;\r\n $group = $Controller->$group(OVERRIDE);\r\n if($group) $users = array_merge($users, $group->memberUsers(false, true));\r\n }\r\n }\r\n } else $users = $this->_MEMBERS;\r\n $this->_memberUsers[$onlyMe] = $users;\r\n } else return array();\r\n $users = array_unique($users);\r\n if($ids_only) return $users;\r\n else return $Controller->get($users, OVERRIDE);\r\n }",
"public function getPlayers(){return $this->getMembers();}",
"public function getMembersList(){\n return $this->_get(10);\n }",
"public function getMembersList(){\n return $this->_get(7);\n }",
"public function getUsers()\n {\n return $this->members;\n }",
"public function getAdmins()\n {\n\n $admins = array();\n\n $adminMemberships = RoomMembership::model()->findAllByAttributes(array('room_id' => $this->getOwner()->id, 'admin_role' => 1));\n\n foreach ($adminMemberships as $admin) {\n $admins[] = $admin->user;\n }\n\n return $admins;\n }",
"public function getUsers(){\n $userIds = array();\n foreach( $this->members as $member ){\n if( !empty( $member->id) ){\n $userIds[] = $member->id;\n }\n }\n foreach( $this->pending as $member ){\n if( !empty( $member->id) ){\n $userIds[] = $member->id;\n }\n }\n foreach( $this->blocked as $member ){\n if( !empty( $member->id) ){\n $userIds[] = $member->id;\n }\n }\n $userIds[] = $this->owner->id;\n return array_unique($userIds);\n }",
"public function getRoomUsers(Room $room)\n {\n return $this->redis->smembers($this->keyRoomUsers($room));\n }",
"public function getNotAllocatedMembers($ministry_id, $member_filters = [])\n {\n $fillable = $this->model->getFillable();\n\n $members = $this->getModel()\n ->whereNotIn('members.id', function($query) use ($ministry_id) {\n $query->select('members_in_group.member_id')\n ->from('members_in_group')\n ->join('groups', 'members_in_group.group_id', '=', 'groups.id')\n ->where('groups.ministry_id', $ministry_id);\n });\n\n foreach ($member_filters as $key => $value) {\n if (in_array($key, $fillable)) {\n $members = $members->where(\"members.$key\", $value);\n }\n }\n\n return $members->select('members.*')->orderBy('members.id')->get();\n }",
"public function get_non_dropped_participants($id){\n\n\t\t$event = Event::find($id);\n\t\tif($event->event_type === 'multifacility' || $event->event_type === 'ladder'){\n\t\t\treturn Event::with(array(\n\t\t\t\t'users' => function($query){\n\t\t\t\t\t$query->wherePivot('confirmed', '=', 1);\n\t\t\t\t}\n\t\t\t))->find($id);\n\t\t}\n\t\telse{\n\t\t\treturn Event::with(array(\n\t\t\t\t'users' => function($query){\n\t\t\t\t\t$query->wherePivot('rsvped', '!=', null)->wherePivot('unavailable','=',0);\n\t\t\t\t}\n\t\t\t))->find($id);\n\t\t}\n\n\t}",
"function getRoomsAvailableToCurrentUser() {\n\tglobal $con, $login_session;\n\t$sql = \"SELECT placename FROM users_rooms\n\t\t\tWHERE username='{$login_session}'\n\t\t\tOR (SELECT permission_level FROM users WHERE username='{$login_session}')=2\n GROUP BY placename\n\t\t\tORDER BY placename ASC\";\n\t\t\t\n\t$result = mysqli_query($con, $sql);\n\t$rows = array();\n\twhile ($row = mysqli_fetch_assoc($result)) {\n\t\t$rows[] = $row;\n\t}\n\treturn $rows;\n}",
"public function getAllExceptAuth(): Collection;",
"public function getMembers();",
"public function getMembers();",
"static function getOnlineUsers() {\n $users = getEntities(array(\n \"type\" => \"User\",\n \"metadata_name\" => \"session\",\n \"metadata_value\" => \"NULL\",\n \"operand\" => \"IS NOT\"\n ));\n return $users;\n }",
"public function members()\n {\n return $this->belongsToMany(Character::class, 'arena_team_member', 'arenaTeamId', 'guid', 'arenaTeamId', 'guid')\n ->as('member');\n }",
"public function allMembers()\n {\n $allmembers = $this->pdo->Select(\"Select * from users\");\n\n return $allmembers;\n }",
"public function get_non_confirmed_participants($id){\n\n\t\t$event = Event::with(array(\n\t\t\t'users' => function($query){\n\t\t\t\t$query->wherePivot('rsvped', '=', null);\n\t\t\t}\n\t\t))->find($id);\n\t\treturn $event->users;\n\n\t}",
"public function getPeople(){\n $user = Auth::guard('api')->user();\n\n $users = User::where('id', '!=', $user->id)->whereNull('is_admin')->orWhere('is_admin', false)->orderBy('username', 'asc')->get();\n\n foreach ($users as $key => $user){\n if($user->isBlocked()){\n unset($users[$key]);\n }\n }\n\n return response()->json($users,200);\n }",
"function getMembers()\n {\n return Factory::createMany('user', $this->_members);\n }",
"public function getMembers(){\n // Get online users userID\n $data = $this->db->select(\"\n SELECT\n u.userID,\n u.username,\n u.firstName,\n u.lastName,\n u.isactive,\n ug.userID,\n ug.groupID,\n g.groupID,\n g.groupName,\n g.groupFontColor,\n g.groupFontWeight\n FROM\n \".PREFIX.\"users u\n LEFT JOIN\n \".PREFIX.\"users_groups ug\n ON u.userID = ug.userID\n LEFT JOIN\n \".PREFIX.\"groups g\n ON ug.groupID = g.groupID\n WHERE\n u.isactive=1\n GROUP BY\n u.userID\n ORDER BY\n u.userID ASC, g.groupID DESC\n \");\n return $data;\n }",
"public function getMembers()\n {\n return $this->members;\n }",
"public function getMembers()\n {\n return $this->members;\n }",
"public function getAvailable(){\n $this->retrieveData();\n return $this->roomList;\n }"
] | [
"0.6391535",
"0.6287975",
"0.6247274",
"0.6072228",
"0.6068423",
"0.5989298",
"0.59761375",
"0.5959378",
"0.5956491",
"0.5895304",
"0.5890104",
"0.58647406",
"0.58557576",
"0.585495",
"0.579895",
"0.5789566",
"0.57855654",
"0.576024",
"0.5721686",
"0.5721686",
"0.56860167",
"0.56513876",
"0.56441605",
"0.56173474",
"0.5614385",
"0.56100124",
"0.55752283",
"0.5561636",
"0.5561636",
"0.55594367"
] | 0.82555515 | 0 |
attach the core object and the binder, which connects stockpile data to souk. This binder object should remain consistent throughout your application. | public function __construct( Iface $core, StockpileBinder_Iface $binder ){
parent::__construct( $core );
$this->binder = $binder;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function onSprinklesInitialized()\n {\n // Set container for data model\n Model::$ci = $this->ci;\n\n // Set container for environment info class\n EnvironmentInfo::$ci = $this->ci;\n\n $this->registerStreams();\n }",
"abstract public function attach();",
"public function initialize() {\n\t\t$this->attachObject('request', function() {\n\t\t\treturn Titon::registry()->factory('titon\\net\\Request');\n\t\t});\n\n\t\t$this->attachObject('response', function() {\n\t\t\treturn Titon::registry()->factory('titon\\net\\Response');\n\t\t});\n\t}",
"public function attach() { }",
"public function bind(YiiImageTransfer $core)\n {\n $this->_core = $core;\n }",
"protected static function boot()\n {\n parent::boot();\n static::addGlobalScope(new BuyerScope);\n }",
"public abstract function bindOn();",
"public function bound()\n {\n\n $this->data = app()->cacheService()\n ->get(['setting', 'load'], 0, function () {\n return $this->buildFromRepository();\n });\n }",
"public function attach() {\n\t\tsession_set_save_handler(\n\t\t\tarray($this, 'open'),\n\t\t\tarray($this, 'close'),\n\t\t\tarray($this, 'read'),\n\t\t\tarray($this, 'write'),\n\t\t\tarray($this, 'destroy'),\n\t\t\tarray($this, 'gc')\n\t\t);\n\t}",
"public function __construct()\n {\n $this->providerStack = new ProviderStack();\n }",
"protected function initStorageObjects()\n {\n $this->brand = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n }",
"protected function registerBaseBindings()\n {\n static::setInstance($this);\n $this->instance('app', $this);\n $this->instance(\\Mimicry\\Foundation\\App::class, $this);\n $this->instance(\\Illuminate\\Container\\Container::class, $this);\n $this->singleton(\\Mimicry\\Foundation\\Kernel::class, \\Mimicry\\Foundation\\Kernel::class);\n }",
"public function __construct( Environment $env )\n\t{\n\t\t$this->env\t\t= $env;\n\t\t$this->model\t= new Model_Shop_Bridge( $env );\n\t\t$this->readBridges();\n\t//\tif( $this->discoverBridges( TRUE ) )\n\t//\t\t$this->readBridges();\n\t}",
"public function __construct()\n {\n $this->registerBaseBindings();\n }",
"protected function initStorageObjects() {\n\t\t/**\n\t\t * Do not modify this method!\n\t\t * It will be rewritten on each save in the extension builder\n\t\t * You may modify the constructor of this class instead\n\t\t */\n\t\t$this->bistum = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n\t\t\n\t\t$this->url = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n\t}",
"public function __wakeup() {\n $this->init();\n }",
"public function setUp()\n {\n $this->binder = new Binder();\n $this->databaseBindingModule = new DatabaseBindingModule();\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::addGlobalScope(new IntegrationBitrix24ProductScope());\n }",
"public function __construct()\n {\n parent::__construct(\n Mage::getModel('brontosoftware_connector/impl_core_scoped'),\n Mage::getModel('brontosoftware_connector/settings'),\n Mage::getModel('brontosoftware_connector/impl_core_productCacheBridge'));\n }",
"function bind(array $data) {\n\t\t$this->_bindData = $data;\n\t}",
"protected function initStorageObjects()\n {\n $this->areapoints = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n $this->event = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n }",
"protected function boot() {\n\n $c = $this->services = new Container();\n\n // Register plugin and kirby core as service parameter\n $this->share('name', $this->name());\n $this->share('version', $this->version());\n $this->share('root', $this->kirby->roots()->plugins() . DS . $this->name());\n\n // Register the path finder as service\n $this->share('finder', function($c) {\n return new Finder($c->get('root'));\n });\n\n // Register configuration store as service\n $this->share('config', function($c) {\n return new Config($c->get('root'), $c->get('name'));\n });\n\n // Register file cache as service\n $this->share('cache', function($c) {\n return new FileCache($c->finder()->cache());\n });\n\n // Register database connection as service\n $this->share('db', function($c) {\n $connections = $c->config()->get('database.connections');\n $default = $c->config()->get('database.default', 'sqlite');\n $credentials = array_merge($connections[$default], array('type' => $default));\n return new Database($credentials);\n });\n\n // Dynamically resolve database connections for models once a connection\n // is requested\n Model::resolver(function() use ($c) { return $c->get('db'); });\n\n }",
"public function __construct()\n {\n parent::__construct();\n $this->rbcApi = app(Rbc::class);\n }",
"protected function registerBaseBindings()\n {\n static::setInstance($this);\n\n $this->instance('app', $this);\n\n $this->instance(Container::class, $this);\n\n $this->instance(PackageManifest::class, new PackageManifest(\n new Filesystem(), $this->basePath(), $this->getCachedPackagesPath()\n ));\n }",
"public function initialize() {\n @set_time_limit(0);\n @ini_set('memory_limit','1024M');\n $quipPath = $this->modx->getOption('quip.core_path',null,$this->modx->getOption('core_path').'components/quip/');\n $this->modx->addPackage('quip',$quipPath.'model/');\n }",
"public function bind() {\r\n $listeners = $this->cache->get('app-listeners', function () {\r\n foreach ($this->resolver->getListeners() as $file) {\r\n try {\r\n $binding = $this;\r\n require_once($file);\r\n } catch (\\Throwable $e) {\r\n $this->logger->warn(\"Unable to include $file: \" . $e->getMessage());\r\n }\r\n }\r\n\r\n $listeners = $this->getListeners();\r\n\r\n if ($this->database->isConnected()) {\r\n /** @var ModelEx $eventModel */\r\n if ($eventModel = $this->resolver->getModel('Event', true)) {\r\n try {\r\n foreach ($eventModel::all() as $item) {\r\n $attrs = $item->attributesToArray();\r\n list($class, $func) = @explode('@', $attrs['handler']);\r\n $event = array_merge($attrs, ['event' => $attrs['name'], 'handler' => [sprintf('\\\\%s', ltrim($class, '\\\\')), $func ?? 'index']]);\r\n\r\n $listeners[] = $event;\r\n }\r\n } catch (\\Exception $e) {\r\n }\r\n }\r\n }\r\n\r\n return $listeners;\r\n }, 300);\r\n\r\n foreach ($listeners as $listener) {\r\n $this->dispatcher->listen($listener['event'], $listener['handler'], $listener['priority'] ?? 99, $listener['data'] ?? '');\r\n }\r\n }",
"public function init() {\n\t\t$this->g = new \\GUMP;\n\t}",
"protected function initStorageObjects() {\n\t\t/**\n\t\t* Do not modify this method!\n\t\t* It will be rewritten on each save in the extension builder\n\t\t* You may modify the constructor of this class instead\n\t\t*/\n\t\t$this->apps = new Tx_Extbase_Persistence_ObjectStorage();\n\t}",
"protected function registerBaseBindings()\n {\n static::setInstance($this);\n\n $this->instance('app', $this);\n }",
"private function __construct() {\n $this->carrierApi = new Mobi_Mtld_DA_Carrier_CarrierApi();\n }"
] | [
"0.5830605",
"0.57933456",
"0.5523876",
"0.5490144",
"0.5429341",
"0.53206456",
"0.5252526",
"0.52429676",
"0.5241389",
"0.5221128",
"0.5210757",
"0.51760143",
"0.51399076",
"0.51288253",
"0.5122905",
"0.510704",
"0.5086042",
"0.50355464",
"0.5009627",
"0.4996144",
"0.49930748",
"0.49913627",
"0.49808675",
"0.4976246",
"0.49650288",
"0.49605048",
"0.49517044",
"0.49306226",
"0.4930495",
"0.49255592"
] | 0.6561048 | 0 |
bid on an item. | function bid( $id, $bid, array $data = NULL ){
$d = new \Gaia\Store\KVP( $data );
// wrapped in try/catch so we can manage transactions.
try {
// kick off a transaction if we aren't attached to one already.
Transaction::start();
// send the bid off to the core object for the first step of the process.
$listing = $this->prepListing( $this->core->bid( $id, $bid, $data ) );
// grab the listing's state prior to the bid we just made.
$prior = $listing->priorstate();
// if there was a previous bid, take their bid out of escrow and refund it.
if( $prior && ( ! $d->enable_proxy || $prior->proxybid != $listing->proxybid ) ){
$this->cancelBid( $listing->priorstate(), $data );
}
// if the bid actually changed hands, go ahead and escrow funds for the bidder.
// so that the bidder can actually pay for what they bid when the time comes.
if( ! $d->enable_proxy || ! $prior || $prior->proxybid != $listing->proxybid ){
// set up a transfer object between the currency account and the currency escrow.
$bidder = $this->transfer( $this->currencyAccount($listing->bidder ),
$this->currencyEscrow( $listing->bidder ) );
// subtracting moves funds into escrow.
$bidder->subtract( $this->currencyId(), $bid, $this->prepData( $data, $listing, 'bid') );
}
// commit the transaction if we started it.
Transaction::commit();
// all done.
return $listing;
} catch( Exception $e ){
// evil! revert the transaction.
Transaction::rollback();
// toss the exception again up the chain.
throw $e;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function BidNow( $item, $bid ) {\n $item = self::_item($item);\n\n if (!$bid = toNum($bid)) return;\n\n $log = self::GroupLogFile($item.'.bidnow');\n\n // esniper config. file will be only as long as required on file system\n self::writeEsniperCfg();\n $cmd = array('Core::BidNow', Registry::get('bin_esniper'),\n esf_User::UserDir(), $item, $bid, $log);\n if (Exec::getInstance()->ExecuteCmd($cmd, $res, Registry::get('SuDo'))) {\n Messages::Error($res);\n } else {\n Messages::Success(Translation::get('Auction.AuctionBiddedNow', $item));\n // refresh auction data\n AuctionHTML::clearBuffer($item);\n $auction = self::fetchAuction($item, FALSE);\n self::$Auctions[$item] = $auction;\n self::Save($auction, FALSE);\n }\n self::removeEsniperCfg();\n }",
"function getBid(){\n\t\tif($this->bid==\"\") {\n\t\t\t$this->obtainBid();\n\t\t}\n\t\treturn $this->bid;\n\t}",
"public function getBid()\n {\n return $this->bid;\n }",
"public function updateItemBid($data)\n\n\n {\n\t\tself::getConnection();\n\n\n $qry=\"select `first_name`,`id`,`username`,`last_name`,`email`,\n\t `mobile`,`country`,`billing_address`,`billing_state`,`billing_city`,`billing_zip`\n\t\t from mobile_users where id ='\".$data['user_id'].\"' \";\n \t\n\t\tself::$dbo->doQuery($qry);\n\t\t$result = self::$dbo->getResultRow();\n \t\n\t\t//print_r($result); exit();\n if($result['first_name'] != null && $result['last_name'] != null && $result['billing_state'] != null && $result['billing_zip'] != null && $result['billing_city'] != null && $result['country'] != null)\n {\n \n\t\t$qry = \"INSERT INTO `bids` \n\t\t ( `auction_item_id`, `user_id`, `payment_method_id`,`amount`,`paid`,`order_id`,`time`) \n\t\t VALUES ('\".$data['item_id'].\"', '\".$data['user_id'].\"', '\".$data['method'].\"','\".$data['amount'].\"',0,NULL,NOW()); \";\n\t\t \tself::$dbo->doQuery($qry);\n\t\t \t if ($insId > 0)\n\t\t \t {\n\t\t \t $this->pushNotification($data);\n\t\t \t }\n\t\t \n\t\t\treturn $insId = self::$dbo->getInsertID();\n\t\t}\n else\n\t\t\t{\n\t\t\treturn 2;\n\t\t\t}\n\t\n\n\t }",
"public function bid(Member $member, Auction $auction) {\n return $member->sell_permission\n && !$member->banned\n && $auction->open\n && $member->id != $auction->seller_id\n && !$auction->holdsLatestBid($member->id);\n }",
"public function submitBid(Request $request)\n {\n $this->validate($request, [\n 'auction_item_id' => 'required',\n 'user_id' => 'required',\n 'price' => 'required'\n ]);\n\n //FIND HIGHEST BID\n $highest_bid = Bid::where('auction_item_id', $request->auction_item_id)->orderBy('price', 'desc')->first();\n \n //ENTER BID IF HIGHER THAN PREVIOUS BIDS\n if( !$highest_bid || $highest_bid->price < $request->price){\n $bid = Bid::create([\n 'auction_item_id' => $request->auction_item_id,\n 'user_id' => $request->user_id,\n 'price' => $request->price\n ]);\n\n //ADD HIGHEST BIDDER TO AUCTION ITEMS TABLE\n $auction_item = AuctionItem::findOrFail($request->auction_item_id);\n $auction_item->user_id = $request->user_id;\n $auction_item->save();\n \n return([\n 'submit' => true\n ]);\n }\n\n\n return([\n 'submit' => false\n ]);\n \n }",
"public function __construct(Item $item, $bid)\n {\n //\n $this->item = $item;\n $this->bid = $bid;\n }",
"public static function getBid( $auction ) {\n $auction = self::_auction($auction);\n if (!$auction) return FALSE;\n $group = self::getGroup($auction);\n return !empty($auction['mybid'])\n ? $auction['mybid']\n : ( self::$Groups[$group]['t']\n ? self::$Groups[$group]['b']-$auction['shipping']\n : self::$Groups[$group]['b'] );\n }",
"public function getBid()\n {\n if( isset($this->data['bid']) && $this->data['bid'] != 0)\n {\n return $this->data['bid'];\n }\n // not set\n else\n {\n return null;\n }\n }",
"public function get_bids($item_id) {\n $query = $this->db->query(\"SELECT Rate, Email FROM Bids WHERE Item_id = \".$item_id.\" \n ORDER BY Rate DESC;\");\n return $query->result_array();\n }",
"public function __construct($bid)\n {\n //\n $this->bid = $bid;\n }",
"public function getBidGroupItem()\n {\n return $this->bidGroupItem;\n }",
"public function book($itemID)\n {\n $hotelItem = HotelItem::find((int)$itemID);\n if (!$hotelItem) {\n notFoundError(400, \"invalid hotel item ID\");\n }\n if ($hotelItem->availability > 0) {\n $hotelItem->availability--;\n $hotelItem->save();\n header('Content-type: application/json', true, 200);\n echo json_encode(['result' => true]);\n exit;\n } else {\n notFoundError(400, 'no more rooms on this hotel.');\n }\n }",
"public function setBid($bid)\n {\n $this->bid = $bid;\n\n return $this;\n }",
"public function getBlock($bid);",
"public function newbid() {\n $Task = new Task();\n\n // TODO Input Validation\n $task_title = isset($_GET['title']) ? $_GET['title'] : \"\";\n $task_creator_username = isset($_GET['creator_username']) ? $_GET['creator_username'] : \"\";\n $bid_amount = isset($_POST['bid_amount']) ? (int)$_POST['bid_amount'] : \"\";\n $bid_details = isset($_POST['bid_details']) ? $this->sanitize($_POST['bid_details']) : \"\";\n\n // Save this bid to database\n $Task->createTaskBid($task_title, $task_creator_username, $bid_amount, $bid_details);\n\n // Redirect back to this task's page\n header('location: ' . URL . 'tasks/task?title=' . $task_title . '&creator_username=' . $task_creator_username);\n }",
"private function obtainBid(){\n\t\t//Store the content of the web\n\t\t$retrievedhtml = $this->getHTML();\n\n\t\t//Pattern to parse the price\n\t\t$pattern = '/itemprop=\"price\">(.*?)<\\/span>/';\n\t\t\n\t\tpreg_match_all($pattern, $retrievedhtml, $match);\n\t\t\n\t\t$this->bid=$match[1][0];\n\t}",
"public function Awardbids($question, $user_id)\n\n {\n \t//select first bid time\n\n \t$firstBids \t\t= DB::table('question_bids')\n \t\t\t\t\t\t->where('question_id', $question)\n \t\t\t\t\t\t->orderby('created_at', 'asc')->first();\n\n \t$firstBid_time \t= $firstBids->created_at;\n\n \t//select all bids,limit it to 25 bids \n\n \t$firstBids \t\t= DB::table('question_bids')\n \t\t\t\t\t\t->select('bidpoints')\n \t\t\t\t\t\t->where('question_id', $question)\n \t\t\t\t\t\t->limit(25)->oderby('bidpoints', 'desc')->get();\n\n \t//assing the best biddder\n\n \t//turn the result to array\n \t\t\t\t\t\t\n \t$bidders_toarray = collect($firstBids)->toArray();\n\n \t//sort the bidders\n\n \t$best_sorted = arsort($bidders_toarray);\n\n \t//best bidders \n\n \t$best_bidder = $best_sorted[0];\n\n \t//insert the best bidder\n\n \tDB::table('question_matrices')\n \t\t\t->where('question_id', $question)\n \t\t\t->where('tutor_id', $best_bidder)\n ->update(\n [\n 'tutor_id' => $request->user_id, \n 'assigned' => 1,\n 'current' => 0, \n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString()\n ]\n );\n\n //create an isntance of the question\n\n $updateQuestion = new UpdateQuestionController;\n\n //Bid post comments\n\n $updateQuestion-> postComment(\"Thank you for taking this question. Please provide a quality, plagiarism free answer within the deadline\", $request->update);\n \n }",
"function setIbic_Bid($value) {\n $this->_ibic_Bid = trim($value);\n }",
"public function saveClick(Item $item)\n {\n $query = Doctrine_Core::getTable('Item')->updateClicks($item);\n }",
"public function item_bijwerken(Item $item, $aantal)\r\n {\r\n\r\n $id = $item->getId(); //new, before we were passing $id directly, now we getting it this way\r\n\r\n //if ($aantal == 0) {\r\n if ($aantal === 0) {\r\n\r\n //$this->item_verwijderen($id); //original\r\n $this->item_verwijderen($item);\r\n\r\n } elseif (($aantal > 0) && ($aantal != $this->items[$id]['aantal'])) {\r\n\r\n $this->items[$id]['aantal'] = $aantal;\r\n\r\n echo \"<p>U hebt nu $aantal widget(s) '{$item->getNaam()}' in de kleur {$item->getKleur()} en de maat {$item->getMaat()} in uw winkelwagentje.</p>\\n\";\r\n\r\n }\r\n\r\n }",
"public function ban()\n {\n Auth::findThrottleByUserId($this->id)->ban();\n }",
"public function carauctionbid()\n\t{\n\t\treturn $this->BelongsTo('App\\Carauctionbid');\n\t}",
"public function update_bid($campaign){\n $this->CI->load->model('V2_group_model');\n $group = $this->CI->V2_group_model->get_group_by_campaign_id($campaign['id']);\n\n// $group['network_group_id'] = '6036088403608';\n// $campaign['bid'] = '0.15';\n\n\n $response = $this->facebookad->update_bid($group['network_group_id'], $campaign['bid']);\n\n return true;\n\n }",
"function on_item_restock(&$item) { return; }",
"public function getBid()\n {\n $bids = $this->response()->getBiddingStrategyConfiguration()->getBids() ?? [];\n\n $bidAmount = 0;\n\n foreach ($bids as $bid) {\n if ($bid->getBidsType() == 'CpcBid' && ($this->getBidStrategy() == \"CPC\" || $this->getBidStrategy() == \"ECPC\")) {\n $bidAmount = $bid->getbid()->getMicroAmount();\n break;\n }\n\n if ($bid->getBidsType() == 'CpaBid' && $this->getBidStrategy() == \"CPA\") {\n $bidAmount = $bid->getbid()->getMicroAmount();\n break;\n }\n }\n\n return (($bidAmount) ? round(intval($bidAmount) / 1000000, 2) : 0);\n }",
"function UpdateBid($post)\n\t{\n\t\tglobal $db;\n\t\t$sql= \" UPDATE \".BID_MASTER\n\t\t\t.\" SET \"\n\t\t\t.\" bid_desc = '\".$post['dec'].\"' \"\n\t\t\t.\" WHERE bid_id = '\".$post['bid_id'].\"' AND project_id = '\".$post['project_id'].\"' \";\n\t\t$db->query($sql);\n\t}",
"function GetBidBy_User($user_login_id)\n\t{\n\t\tglobal $db;\n\t\t$sql= \" SELECT * FROM \".BID_MASTER .\" AS BM \"\n\t\t\t .\" LEFT JOIN \".project_MASTER.\" AS PM ON BM.project_id = PM.project_id\"\n\t\t\t .\" WHERE BM.bid_by_user = '\".$user_login_id.\"' \";\n\t\t$db->query($sql);\n\t}",
"public function useItem($id) {\n if ($id == 1 and $this->healthPoints < $this->healthMax) { //medicine\n $this->heal($this->healthMax / 2);\n } else if ($id == 2 and $this->healthPoints < $this->healthMax) { //elixer\n $this->heal($this->healthMax);\n } else {\n return;\n }\n\n $count = 0;\n while (true) {\n if ($id == $this->inventory[$count]->id) {\n $this->inventory[$count]->amount--;\n break;\n }\n $count++;\n }\n }",
"public function legalbid_decline() {\n\t\t\tGLOBAL $page;\n\t\t\t\n\t\t\tlogin::log(login::getUserID(),\"Declined the auction with id of \".safe::get(\"id\"));\n\t\t\t\n\t\t\t\t$db = new database();\n\t\t\t\t$dbx = new database();\n\t\t\t\t$dbe = new database();\n\t\t\t\t$db->query(\"UPDATE `legalbid_items` SET `startdate` = NOW( ) ,`verify` = '2', comment='\".safe::post('comment').\"' WHERE `id` =\".safe::get(\"id\").\" LIMIT 1 ;\");\n\t\t\t\n\t\t\t\t$sids = $db->getFirst(\"SELECT sellid FROM `legalbid_items` WHERE id=\".safe::get(\"id\").\"\");\n\t\t\t\t$sid = $sids['sellid'];\n\t\t\t\n\t\t\t\t$sql = \"SELECT email FROM `legalbid_users` WHERE id='\".$sid.\"';\";\n\t\t\t\t$emailss = $dbx->getFirst($sql);\n\t\t\t\t$emailx = $emailss['email'];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$sql = \"SELECT * FROM legalbid_items WHERE id=\".safe::get(\"id\").\" LIMIT 1;\";\n\t\t\t\t$details = $dbe->getFirst($sql);\n\t\t\t\t$det = $details;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\t$subject = \"Your claim addition to legalbid.co.uk has not been accepted\";\n\t\t\t\t\t\t\t$messagetosend = \"To whom it may concern.\\n\\nUnfortunately a claim you added to legalbid has not been accepted.\\n\\n\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$messagetosend .= $det[\"title\"] . \"\\n\" . $det[\"desc\"];\n\t\t\t\t\t\t\t\t$messagetosend .= \"\\n\\nThe reason given for this was\\n\" . safe::post('comment');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$messagetosend .= \"\\n\\nIf you wish to discuss this item further please contact us.\";\n\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$Name = \"legalbid.co.uk\"; //senders name\n\t\t\t\t\t\t\t$email = \"[email protected]\"; //senders e-mail adress\n\t\t\t\t\t\t\t$recipient = $emailx; //recipient\n\t\t\t\t\t\t\t$header = \"From: \". $Name . \" <\" . $email . \">\\r\\n\"; //optional headerfields\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t mail($recipient, $subject, $messagetosend, $header);\n\t\t\t\t\n\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\t\t\n\t\t}"
] | [
"0.73852336",
"0.6736876",
"0.6507422",
"0.6347805",
"0.62573695",
"0.62014806",
"0.6172723",
"0.59760684",
"0.5966016",
"0.58205897",
"0.5709838",
"0.5619578",
"0.5610602",
"0.55267763",
"0.5507686",
"0.5507545",
"0.54836774",
"0.54621315",
"0.5430092",
"0.5401418",
"0.5378694",
"0.5364032",
"0.53577614",
"0.53422505",
"0.5317226",
"0.5302308",
"0.52883756",
"0.52831453",
"0.5272467",
"0.52665085"
] | 0.6765299 | 1 |
simple stockpile transfer factory method. | protected function transfer( $a, $b ){
return new \Gaia\Stockpile\Transfer( $a, $b );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function transfer();",
"public function transfer()\n {\n }",
"abstract protected function transfer($data);",
"public function transfer($args) {\n\t\techo \"Not implemented yet.\\n\";\n\t}",
"public static function transferStockService()\n {\n return self::getService('inventorysuccess/service_transfer_transferService');\n }",
"public function initiateTransfer()\n {\n }",
"private function transferOrderStock(TransferOrder $transfer_order)\n {\n // use $stock->move($from_location, $to_location)\n // for better receivings stock tracking\n\n $location = Location::find($transfer_order->location_id);\n $item = Inventory::find($transfer_order->purchase_order_product->inventory->id);\n $stock = InventoryStock::find($item->id);\n $stock = InventoryStock::where('inventory_id', $item->id)->where('location_id', $location->id)->first();\n $reason = 'New stock from Transfer Order #'.$transfer_order->id;\n\n // dd($transfer_order->location, $item, $stock);\n \n // Add the stocks to the existing inventory stock location else create a new one.\n if ($stock) {\n // Add to existing inventory stock.\n $stock->add($transfer_order->quantity, $reason);\n } else {\n // Create new inventory stock to add new stocks to.\n $stock = new InventoryStock;\n $stock->inventory_id = $item->id;\n $stock->location_id = $location->id;\n $stock->quantity = $transfer_order->quantity;\n // $stock->cost = '5.20';\n $stock->reason = $reason;\n $stock->aisle = isset($transfer_order->aisle) ? $transfer_order->aisle : null;\n $stock->row = isset($transfer_order->row) ? $transfer_order->row : null;\n $stock->bin = isset($transfer_order->bin) ? $transfer_order->bin : null;\n $stock->save();\n }\n\n // Link the stock movement to the transfer order.\n $stock->getLastMovement()->update(['transfer_order_id' => $transfer_order->id]);\n\n // dd($location, $item, $stock);\n \n return $stock;\n }",
"abstract public function stocks();",
"public function __construct(Stock $stock)\n {\n parent::__construct();\n $this->stock = $stock;\n }",
"public function createTransction() {\n }",
"public function createTransction() {\n }",
"public function makeTransfer()\n {\n try {\n $db = $this->conn->connect();\n\n $sql = \"INSERT INTO transactions (from_amount, from_account, to_amount, to_account)\n VALUES (:famount, :faccount, :tamount, :taccount)\";\n $stmt = $db->prepare($sql);\n $stmt->bindParam(':famount', $this->from_amount);\n $stmt->bindParam(':faccount', $this->from_account);\n $stmt->bindParam(':tamount', $this->to_amount);\n $stmt->bindParam(':taccount', $this->to_account);\n\n $stmt->execute();\n echo \"New records created successfully\";\n } catch (PDOException $e) {\n echo \"Error: \" . $e->getMessage();\n }\n }",
"public function copy(): Exchange;",
"abstract protected function create();",
"public function _buildTransfer($options)\n {\n $destinations = $options['destinations'];\n // Convert Ditcoin amount to atomic units\n if(gettype($destinations) == \"object\"){\n $destinations->amount = $destinations->amount * 1e8;\n $destinations = array($destinations);\n } else {\n foreach ($destinations as &$destination){\n $destination->amount = $destination->amount * 1e8;\n }\n }\n // Define Mixin\n $mixin = (isset($options['mixin']) ? $options['mixin'] : 4);\n // Define Unlock Time\n $unlock_time = (isset($options['unlock_time']) ? $options['unlock_time'] : 0);\n // Define Payment ID\n $payment_id = (isset($options['payment_id']) ? $options['payment_id'] : null);\n // Define if have to Do Not Relay\n $do_not_relay = (isset($options['do_not_relay']) ? $options['do_not_relay'] : false);\n // Define Priority\n $priority = (isset($options['priority']) ? $options['priority'] : 0);\n // Define if have to Get Transaction Hex hash\n $get_tx_hex = (isset($options['get_tx_hex']) ? $options['get_tx_hex'] : false);\n // Define if have to Get Transaction Key hash\n $get_tx_key = (isset($options['get_tx_key']) ? $options['get_tx_key'] : false);\n // Build params array\n $params = [\n 'destinations' => $destinations,\n 'mixin' => $mixin,\n 'unlock_time' => $unlock_time,\n 'payment_id' => $payment_id,\n 'do_not_relay' => $do_not_relay,\n 'priority' => $priority,\n 'get_tx_hex' => $get_tx_hex,\n 'get_tx_key' => $get_tx_key\n ];\n // Set algorithm type if using transfer_split method\n if($options['method'] == \"transfer_split\"){\n $new_algorithm = (isset($options['new_algorithm']) ? $options['new_algorithm'] : false);\n $params['new_algorithm'] = $new_algorithm;\n }\n // Build request body\n $body = [\n 'method' => $options['method'],\n 'params' => $params\n ];\n return $body;\n }",
"function createFlyer()\r\n {\r\n \r\n }",
"abstract public function create();",
"abstract public function create();",
"abstract public function create();",
"abstract public function create();",
"abstract public function create();",
"function __construct() {\n $this->deposit();\n }",
"public function testCreateKeokTransferred()\n {\n }",
"public function transfer(): array;",
"public function testExecuteSepaMoneyTransfer()\r\n {\r\n }",
"public function createShipmentAndGetWaybill();",
"public function setStock($stock)\n {\n $this->stock = $stock;\n\n return $this;\n }",
"public function testCreateStock(){\n $this->json(\"POST\", 'api/stock',['product_name'=>\"GSM antenna\",'selling_price'=>200.45,'reorder_level'=>3,'barcode'=>'123457890'])\n ->seeJson(['successful'=>true]);\n\n }",
"public function testRequestSepaMoneyTransfer()\r\n {\r\n }",
"abstract public function newHand(\\Cilex\\Cards\\Hand $hand);"
] | [
"0.6746004",
"0.655095",
"0.5938871",
"0.5884198",
"0.57994545",
"0.5535409",
"0.546959",
"0.5127498",
"0.51173294",
"0.51024944",
"0.51024944",
"0.50837666",
"0.5069113",
"0.5025363",
"0.5013897",
"0.49704412",
"0.49446732",
"0.49446732",
"0.49446732",
"0.49446732",
"0.49446732",
"0.49394226",
"0.49203232",
"0.4901675",
"0.4876433",
"0.48653153",
"0.4859929",
"0.48593765",
"0.4833727",
"0.48299596"
] | 0.7232189 | 0 |
factory method for instantiating the user's stockpile currency account. | protected function currencyAccount( $user_id ){
$stockpile = $this->binder->currencyAccount( $user_id );
if( ! $stockpile instanceof \Gaia\Stockpile\Iface ) {
throw new Exception('invalid stockpile object', $stockpile );
}
return $stockpile;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function currencyEscrow( $stockpile ){\n if( method_exists( $this->binder, 'currencyEscrow') ){\n $user_id = ( $stockpile instanceof \\Gaia\\Stockpile\\Iface ) ? $stockpile->user() : $stockpile;\n $stockpile = $this->binder->currencyEscrow( $user_id );\n if( ! $stockpile instanceof \\Gaia\\Stockpile\\Iface ) {\n throw new Exception('invalid stockpile object', $stockpile );\n }\n return $stockpile;\n }\n if( ! $stockpile instanceof \\Gaia\\Stockpile\\Iface ) $stockpile = $this->currencyAccount( $stockpile );\n \n switch( $stockpile->coreType() ) {\n \n case 'tally':\n $class = '\\gaia\\stockpile\\tally';\n break;\n \n case 'serial-tally':\n $class = '\\gaia\\stockpile\\hybrid';\n break;\n \n default:\n throw new Exception('invalid stockpile object', $stockpile );\n }\n \n return new $class( $stockpile->app() . '_souk', $stockpile->user());\n }",
"public function __construct() {\n $this->account= new Account();\n $this->account->setLastchange(Date::now());\n $this->account->setChangedby($this->getClassName());\n $this->account->setBz_id(10000);\n }",
"public function init(){\r\n\t\t\r\n\t\t$accounts = new Accounts();\r\n\t\t$accounts->userID = $_SESSION['userID'];\r\n\t\t\r\n\t\tif(!isset($_SESSION['accounts'])){\r\n\t\t\t$_SESSION['accounts'] = $accounts->getAccounts();\r\n\t\t}\r\n\t\t\r\n\t\tif(isset($_SESSION['payAccountID'])){\r\n\t\t\t$this->setAccountSelected($_SESSION['payAccountID']);\r\n\t\t}\r\n\t\t\r\n\t\tif(isset($_SESSION['payBillerID'])){\r\n\t\t\t$biller = new Billers();\r\n\t\t\t$biller->billerID = $_SESSION['payBillerID'];\r\n\t\t\t$biller->getBiller();\r\n\t\t\t$_SESSION['payBillerCode'] = $biller->billerCode;\r\n\t\t\t$_SESSION['payBillerName'] = $biller->billerName;\r\n\t\t\t$_SESSION['payBillerNickname'] = $biller->billerNickname;\r\n\t\t\t$_SESSION['payCustomerRef'] = $biller->customerReference;\r\n\t\t}\r\n\t}",
"protected function itemAccount( $user_id ){\n $stockpile = $this->binder->itemAccount( $user_id );\n if( ! $stockpile instanceof \\Gaia\\Stockpile\\Iface ) {\n throw new Exception('invalid stockpile object', $stockpile );\n }\n return $stockpile;\n }",
"function __construct(){\n\n $this->PayFlowProClient = new buzz;\n\n }",
"public static function createAccount(){\n $newAccount = Account::create([\n 'user_id' => auth()->id()\n ]);\n\n //crea una caja en pesos por default asociada a la cuenta creada\n $newPesosBox = SavingBox::create([\n 'currency_id' => 1,\n 'account_id' => $newAccount->id,\n ]);\n\n }",
"public function create($data)\n {\n $currency = Currency::create($data);\n return $currency;\n }",
"function Account()\n {\n //set debug mode using conf value\n if (isset($config)) {\n $this->setDebugMode($config->debug_mode);\n }\n if ($this->getDebugMode()) {\n //echo 'account constructor<br>';\n }\n $this->Login();\n $this->user_id = $this->getSessionUserId();\n /* if($this->USER_isUserAuthorized()){\n $this->user_id = $this->USER_getUserId();\n } */\n //$this->initService();\n parent::__construct();\n //$this->setTableName('service');\n //$this->setPrimaryKey('service_id');\n }",
"public function __construct($account = self::ACCOUNT_ID, $key = self::SECRET_KEY, $mode = self::MODE) \n {\n $this->accountId = $account;\n $this->secretKey = $key;\n $this->mode = $mode;\n }",
"public function provideAccount() {\n return $this->session->__getLoggedInAccount() ?? new Account();\n }",
"public function __construct() {\n $this->currencyImporter = \\Drupal::service('commerce_price.currency_importer');\n }",
"protected function _getIntuitAnywhereAccount()\r\n\t{\r\n\t\treturn new IntuitAnywhere_Account($this->_i_anywhere);\r\n\t}",
"public function getAccount ()\n\t\t{\n\t\t\treturn new Account ($this->Pull ('Account')->getValue ());\n\t\t}",
"function __construct() {\n $this->deposit();\n }",
"public function __construct() {\n\t\tif (defined('__TRANSACTIONS_BLUEPAY')) {\n\t\t\t$config = unserialize(__TRANSACTIONS_BLUEPAY);\n\t\t\t$this->accountId = $config['accountId'];\n\t\t\t$this->secretKey = $config['secretKey'];\n\t\t\t$this->mode = !empty($config['mode']) ? $config['mode'] : self::MODE;\n\t\t} else {\n\t\t\tthrow new Exception(__('Bluepay configuration not setup.'));\n\t\t\tbreak;\n\t\t}\n\t}",
"public function create(): Account;",
"public function __construct(AccountInterface $current_user) {\n $this->currentUser = $current_user;\n }",
"private function getNewUserCurrency(int $userId, int $type, int $amount): UserCurrency\n {\n $userCurrency = new UserCurrency();\n\n return $userCurrency\n ->setUserId($userId)\n ->setType($type)\n ->setAmount($amount);\n }",
"public static function newFromUserInput(PhabricatorUser $user, $string) {\n return self::newFromString($string, self::getDefaultCurrency());\n }",
"function init() {\n parent::init();\n\n if (!Yii::app()->user->isGuest) {\n $this->user = ClientUtility::getUser();\n $this->ticker = new eTicker();\n }\n }",
"public function __construct($account)\n\t{\n\t\t$this->account = $account;\n\t}",
"protected function _construct()\n {\n $this->_init('shipperhq_shipper/quote_packages');\n }",
"public function init()\n {\n\n $options = $this->getOptions();\n\n /*\n * Note that Zend_Currency only accepts locales which include a region.\n * This means that all given locale which only include the language\n * will throw an exception. For example the locale 'en' will throw an\n * exception whereas the locale 'en_US' will return 'USD' as currency.\n */\n\n $locale = isset($options['defaultCurrency'])?$options['defaultCurrency']:'en_GB';\n $this->_currentLocale = $locale;\n $currency = new Zend_Currency($locale);\n\n //TODO:: This has to be improved according to user settings;\n\n return $currency;\n }",
"protected function create_sandbox_account(){\n\t$fname = 'John'; // PI first name\n\t$mi = 'H'; // PI middle name\n\t$lname = 'Smith'; // PI last name\n\t$group_name = 'Smith'; // group name\n\t$group_type = 'Academia'; // group type or location\n\t$discipline = 'Chemistry'; // discipline\n\t$institution = 'Nano University'; // name of institution\n\t$address = \"Nano University\\nDepartment of Chemistry\\n1000 Nano Drive, NY, New York, 10031\"; // institution adress\n\t$phone = '1111-555-5555';\n\t$fax = '1111-555-5555';\n\t$email = '[email protected]';\n\t$password1 = 'sandbox'; // this password should be the same\n\t$password2 = 'sandbox';\n\t$keywords = 'software,materials, photons, laser, bio materials, sensors'; // research keywords\n\t$description = \"Some Cool\\nEnvironmentally Friendly Research\"; // research keywords\n\t$piurl = 'www.nano.edu/jhsmith'; // the group web page of the PI\n\t$piurl = checkURL($piurl);\n\n\t$term = 4;\n\t$cost = 0;\n\t$activate_date = $this->get_lis_date();\n\t$status = 'active';\n\t$expire_date = $this->get_expire_date($activate_date, $status, $term); // automatically set\n\t$storage = 50;\n\t$max_users = '25';\n\t$time_zone = 'UTC';\n\t$notes = 'Sandbox User Account';\n\t$group_pi = \"$fname $mi. $lname\";\n\t$name = $this->userobj->name;\n\t$department_id = ''; // blank on purpose\n\t$manager_id = $this->userobj->userid;\n\t$activate_code = $this->get_activation_code();\n\t$login_count = 0;\n\t$network_ids = '';\n\n\tif(!empty($notes)) {\n\t $notes = $name.' ('.$this->get_lis_date_time().\") >>Account Created\\n$notes\\n\";\n\t}\n\telse {\n\t $notes = $name.' ('.$this->get_lis_date_time().\") >>Account Created\\n\";\n\t}\n\n\t$this->load->model('managedb_model');\n\n\t// if this account already exist remove it\n\t$account_id = strtolower($lname).'1';\n\tif($this->account_model->account_exists($account_id)) {\n\t $dir = $this->admin_filemanager->move_to_trash($account_id);\n\t $login_count = $this->managedb_model->get_MyLIS_property($account_id, 'login.count');\n\t // dump and then remove tables from LISDB\n\t $this->account_model->remove_MyLIS_tables($account_id);\n\t $this->account_model->remove_MyLIS_users($account_id);\n\t} else {\n\t $login_count = 0;\n\t}\n\n\t$data['account_id'] = $account_id;\n\t$data['fname'] = $fname;\t\t $data['term'] = $term;\n\t$data['mi'] = $mi;\t\t\t $data['cost'] = $cost;\n\t$data['lname'] = $lname;\t\t $data['activate_date'] = $activate_date;\n\t$data['group_name'] = $group_name;\t $data['expire_date'] = $expire_date;\n\t$data['group_type'] = $group_type;\t $data['status'] = $status;\n\t$data['discipline'] = $discipline;\t $data['storage'] = $storage;\n\t$data['institution'] = $institution;\t $data['max_users'] = $max_users;\n\t$data['address'] = $address;\t\t $data['time_zone'] = $time_zone;\n\t$data['phone'] = $phone;\t\t $data['activate_code'] = $activate_code;\n\t$data['fax'] = $fax;\t\t\t $data['notes'] = $notes;\n\t$data['email'] = $email;\t\t $data['department_id'] = $department_id;\n\t$data['network_ids'] = $network_ids;\t $data['manager_id'] = $manager_id;\n\t$data['password1'] = $password1;\t $data['group_pi'] = $group_pi;\n\t$data['keywords'] = $keywords;\t\t $data['description'] = $description;\n\t$data['piurl'] = $piurl;\n\t\n\t$this->account_model->add_account($data);\n\n\t// create the tables associated wthis account\n\t$this->managedb_model->create_MyLIS_tables($account_id);\n\n\t// now add the username and password for login purposes\n\t$this->account_model->add_account_admin($data);\n\n\t// add default and location into account database categories\n\t$this->account_model->set_default_database_entries($account_id);\n\n\t// set the version number\n\t$this->account_model->set_version_number($account_id,$this->version);\n\n\t// set the login count now\n\t$this->account_model->set_login_count($account_id,$login_count);\n\n\t// add the dummy information to this account\n\t$this->load->model('datasource_model');\n\t$this->datasource_model->add_sandbox_data($account_id);\n\n\t// now create a directory for this account\n\t$props = array(\n\t 'lis.account' => $account_id,\n\t 'lis.expire' => $expire_date,\n\t 'lis.status' => 'demo',\n\t 'lis.timezone' => $time_zone,\n\t 'storage.quota' => $storage,\n\t 'max.users' => $max_users,\n\t 'group.name' => $group_name,\n\t 'site.manager' => $group_pi,\n\t 'site.manager.email' => $email\n\t);\n\n\t$this->admin_filemanager->create_MyLIS_directory($account_id, $props);\n\n\t$title = 'New Account Created!';\n\t$message = 'Sandbox account has been created successfully!';\n\t$destination = base_url().'admin/accounts';\n\tshowModal($title,$message,$destination);\n }",
"public function __construct()\n {\n $this->key = Mage::getStoreConfig('billysbilling/api/key');\n }",
"public function __construct(ProviderAccounts $provider_account)\n {\n $this->provider_account = $provider_account;\n }",
"public function construct() {\n $this->initiate(\"skin_install\");\n $this->make_db();\n\n $code_user = $this->user_switch();\n\n return $code_user;\n }",
"protected function itemEscrow( $stockpile ){\n if( method_exists( $this->binder, 'itemEscrow') ){\n $user_id = ( $stockpile instanceof \\Gaia\\Stockpile\\Iface ) ? $stockpile->user() : $stockpile;\n $stockpile = $this->binder->currencyEscrow( $user_id );\n if( ! $stockpile instanceof Stockpile\\Iface ) {\n throw new Exception('invalid stockpile object', $stockpile );\n }\n return $stockpile;\n }\n if( ! $stockpile instanceof Stockpile\\Iface ) $stockpile = $this->itemAccount( $stockpile );\n \n switch( $stockpile->coreType() ) {\n case 'serial': \n $class = '\\gaia\\stockpile\\serial';\n break;\n \n case 'tally':\n $class = '\\gaia\\stockpile\\tally';\n break;\n \n case 'serial-tally':\n $class = '\\gaia\\stockpile\\hybrid';\n break;\n \n default:\n throw new Exception('invalid stockpile object', $stockpile );\n }\n \n return new $class( $stockpile->app() . '_souk', $stockpile->user());\n }",
"function __construct()\n {\n parent::__construct();\n $this->_srp = new SRP_SHA1_256();\n if ( $this->getState() == (SrpSession::INITIALIZED or SrpSession::READY) ) {\n try {\n $this->_shex = $this->getValue('SRP_shex');\n $this->_Ahex = $this->getValue('SRP_Ahex');\n $this->_Bhex = $this->getValue('SRP_Bhex');\n $this->_Khex = $this->getValue('SRP_Khex');\n $this->_username = $this->getValue('SRP_I');\n $this->_userid = $this->getValue('userid');\n $this->_setState(SrpSession::READY);\n } catch (InvalidArgumentException $e) {\n $this->_setState(SrpSession::NOT_INITIALIZED);\n }\n }\n }",
"public function __construct(Stock $stock)\n {\n parent::__construct();\n $this->stock = $stock;\n }"
] | [
"0.591217",
"0.5660544",
"0.5513408",
"0.5504744",
"0.54469043",
"0.5428741",
"0.5411625",
"0.54001844",
"0.53847855",
"0.5371844",
"0.5362188",
"0.5308586",
"0.52867514",
"0.52817523",
"0.52750826",
"0.5251715",
"0.52497435",
"0.52276456",
"0.5200302",
"0.51996136",
"0.51966494",
"0.51739126",
"0.5172589",
"0.51662356",
"0.5155009",
"0.5148687",
"0.5137963",
"0.51269674",
"0.512188",
"0.5120865"
] | 0.6575289 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.