query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Listen to the Governorate deleting event. | public function deleting(Governorate $governorate)
{
//
} | [
"public function on_delete() {}",
"private function onDelete()\r\n {\r\n if ($this->_accessLevel < ACCESS_LEVEL_DELETE)\r\n {\r\n $this->listByView(__('Invalid user level for action.'));\r\n return;\r\n }\r\n\r\n /* Bail out if we don't have a valid company ID. */\r\n if (!$this->isRequiredIDValid('companyID', $_GET))\r\n {\r\n $this->listByView(__('Invalid company ID.'));\r\n return;\r\n }\r\n\r\n $companyID = $_GET['companyID'];\r\n\r\n $companies = new Companies($this->_siteID);\r\n $rs = $companies->get($companyID);\r\n\r\n if (empty($rs))\r\n {\r\n $this->listByView(__('The specified company ID could not be found.'));\r\n return;\r\n }\r\n\r\n if ($rs['defaultCompany'] == 1)\r\n {\r\n $this->listByView(__('Cannot delete internal postings company.'));\r\n return;\r\n }\r\n\r\n if (!eval(Hooks::get('CLIENTS_ON_DELETE_PRE'))) return;\r\n\r\n $companies->delete($companyID);\r\n\r\n /* Delete the MRU entry if present. */\r\n $_SESSION['OSATS']->getMRU()->removeEntry(\r\n DATA_ITEM_COMPANY, $companyID\r\n );\r\n\r\n if (!eval(Hooks::get('CLIENTS_ON_DELETE_POST'))) return;\r\n\r\n osatutil::transferRelativeURI('m=companies&a=listByView');\r\n }",
"public function after_delete() {}",
"function delete(){\r\n\t\tglobal $wpdb;\r\n\t\tif( $this->is_recurring() ){\r\n\t\t\t//Delete the recurrences then this recurrence event\r\n\t\t\t$this->delete_events();\r\n\t\t}\r\n\t\t$result = $wpdb->query ( $wpdb->prepare(\"DELETE FROM \". $wpdb->prefix . EM_EVENTS_TABLE .\" WHERE event_id=%d\", $this->id) );\r\n\t\tif($result !== false){\r\n\t\t\t$bookings_result = $this->get_bookings()->delete();\r\n\t\t}\r\n\t}",
"static function listenToDeleteDocument(sfEvent $request)\n {\n $model = $event['object'];\n\n $docFields = $model->getSolrDocumentFields();\n $solr = uvmcSolrServicesManager::getInstance()->getService();\n $solr->deleteById($docFields['id']);\n }",
"function hook_simplenews_subscriber_delete(SimplenewsSubscriber $subscriber) {\n\n}",
"protected function afterDeletion() {}",
"public function forceDeleted(EventSubscribe $eventSubscribe)\n {\n //\n }",
"abstract public function handleDelete($event);",
"protected function afterDelete () {}",
"public function trigger_after_delete() {\n\t\n\t}",
"function enrolment_delete() {\n //never actually called\n }",
"public function registerWishlistDelete()\n {\n if(!$this->config->wishlistTracking)\n {\n return;\n }\n\n $viewAssign = $this->view->getAssign();\n\n $sDelete = $this->request->getParam('sDelete');\n if($sDelete)\n {\n $sql= \"SELECT articleID FROM s_order_notes WHERE id = ?\";\n\n $orderNote = Shopware()->Db()->fetchRow($sql, array($sDelete));\n if($orderNote)\n {\n $product = Shopware()->Modules()->Articles()->sGetArticleById($orderNote['articleID']);\n\n if($product)\n {\n $categories = $this->getProductCategories($product['articleID']);\n\n $this->registerEvent('wishlist_remove', array(\"product\" => array(\n \"id\" => $product['articleID'],\n \"name\" => $product['articlename'],\n \"sku\" => $product['ordernumber'],\n \"price\" => $product['price'],\n \"category\" => $categories,\n )));\n }\n }\n }\n }",
"public function onAdtypeDeleted($event)\n {\n //dispatch(new UpdateCache($event->adtype, true));\n }",
"public function deleted(Expense $expense)\n {\n //\n }",
"public function deleted(LeadEscalation $leadEscalation)\n {\n //\n }",
"public function delete()\n {\n $this->forge->deleteWebhook($this->serverId, $this->siteId, $this->id);\n }",
"protected function deleteRelated()\n{\n\t$el = $this->getTemplate()->elements['ondelete'];\n\tif ($el['type'] != 'event') return;\n\n\tforeach ($el['delete_array'] as $relationId) {\n\t\t$found = $this->related($relationId);\n\t\tif ($found) $found->delete();\n\t}\n}",
"public function deleteSportEvent()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve the model collection loader. | public function collectionLoader()
{
if (!isset($this->collectionLoader)) {
throw new RuntimeException(
sprintf('Collection Loader is not defined for "%s"', get_class($this))
);
}
return $this->collectionLoader;
} | [
"protected function collectionLoader()\n {\n if ($this->collectionLoader === null) {\n $this->collectionLoader = $this->createCollectionLoader();\n }\n\n return $this->collectionLoader;\n }",
"protected function createCollectionLoader()\n {\n return new CollectionLoader([\n 'logger' => $this->logger,\n 'factory' => $this->modelFactory(),\n ]);\n }",
"public function getModelLoader() {\n return $this->modelLoader;\n }",
"protected function collectionLoader()\n {\n if (!isset($this->collectionLoader)) {\n throw new RuntimeException(\n sprintf('Collection Loader is not defined for \"%s\"', get_class($this))\n );\n }\n\n return $this->collectionLoader;\n }",
"protected function getLoader()\n {\n return $this->loader;\n }",
"protected function getLoader()\n {\n // Construct object for loading cover images if it does not already exist:\n if (!$this->loader) {\n $cacheDir = $this->getCacheDir();\n $this->loader = new Loader(\n $this->getConfig(),\n $this->getServiceLocator()->get('VuFind\\ContentCoversPluginManager'),\n $this->getServiceLocator()->get('VuFindTheme\\ThemeInfo'),\n $this->getServiceLocator()->get('VuFind\\Http')->createClient(),\n $cacheDir\n );\n \\VuFind\\ServiceManager\\Initializer::initInstance(\n $this->loader, $this->getServiceLocator()\n );\n }\n return $this->loader;\n }",
"public function getLoader()\n {\n return $this->_loader;\n }",
"public function getLoader()\n {\n return $this->loader;\n }",
"public function getLoader() {\n return $this->loader;\n }",
"protected function getLoader()\n {\n // Construct object for loading cover images if it does not already exist:\n if (!$this->loader) {\n //wie gehen wir mit dem cache Manager um??\n $cacheDir = $this->getServiceLocator()->get('Resources\\CacheManager')\n ->getCache('cover')->getOptions()->getCacheDir();\n\n //I think we don't need the ThemeInfo Type for our purposes\n $this->loader = new Loader(\n $this->getConfig(),\n $this->getServiceLocator()->get('Resources\\ContentCoversPluginManager'),\n //$this->getServiceLocator()->get('VuFindTheme\\ThemeInfo'),\n $this->getServiceLocator()->get('VuFind\\Http')->createClient(),\n $cacheDir\n );\n //Initializers are not necessary - an assumption\n //\\VuFind\\ServiceManager\\Initializer::initInstance(\n // $this->loader, $this->getServiceLocator()\n //);\n }\n return $this->loader;\n }",
"public function getLoader(): Loader\n {\n return $this->loader;\n }",
"public function getLoader()\n {\n return Provider::getServices()->get('ClassLoader');\n }",
"protected function getLoaderService()\n {\n }",
"public static function getLoader()\n {\n /** @var \\Illuminate\\Translation\\Translator $instance */\n return $instance->getLoader();\n }",
"static private function _getLoader() {\n\t\tif(self::isNull(self::$_loader)) {\n\t\t\tself::$_loader = Loader::getImageLoader(self::webiny()->getConfig()->get('components.image'));\n\t\t}\n\n\t\treturn self::$_loader;\n\t}",
"public function getRelationLoader()\n {\n return $this->relationLoader;\n }",
"public function getServiceLoader()\r\n\t{\r\n\t\treturn $this->_serviceLoader;\r\n\t}",
"public function getObjectLoader()\n {\n return new \\gihp\\Object\\Loader($this->io);\n }",
"public function getFileLoader()\n {\n return $this->loader;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sanitizes argument string into actual PHP type/object as new Argument instance | public static function factory(string $argument): static
{
$argument = trim($argument);
// remove grouping parantheses
if (
Str::startsWith($argument, '(') &&
Str::endsWith($argument, ')')
) {
$argument = trim(substr($argument, 1, -1));
}
// string with single quotes
if (
Str::startsWith($argument, "'") &&
Str::endsWith($argument, "'")
) {
$string = substr($argument, 1, -1);
$string = str_replace("\'", "'", $string);
return new static($string);
}
// string with double quotes
if (
Str::startsWith($argument, '"') &&
Str::endsWith($argument, '"')
) {
$string = substr($argument, 1, -1);
$string = str_replace('\"', '"', $string);
return new static($string);
}
// array: split and recursive sanitizing
if (
Str::startsWith($argument, '[') &&
Str::endsWith($argument, ']')
) {
$array = substr($argument, 1, -1);
$array = Arguments::factory($array);
return new static($array);
}
// numeric
if (is_numeric($argument) === true) {
return new static((float)$argument);
}
// Closure
if (Str::startsWith($argument, '() =>')) {
$query = Str::after($argument, '() =>');
$query = trim($query);
return new static(fn () => $query);
}
return new static(match ($argument) {
'null' => null,
'true' => true,
'false' => false,
// resolve parameter for objects and methods itself
default => new Query($argument)
});
} | [
"public function testValidPassArgsToConstructor()\n {\n $a = new Argument(\"j\", \"something\");\n\n $this->assertEquals(\"something\", $a->value());\n $this->assertEquals(\"j\", $a->name());\n\n // Test casting to a string\n $this->assertEquals(\"something\", (string)$a);\n }",
"function parseArgument($arg, $expectedType)\r\n{\r\n $type = \"\";\r\n $value = $arg;\r\n\r\n switch ($expectedType) {\r\n case \"symb\":\r\n if (preg_match('/^int@[+-]?[\\d]+$/', $arg)) {\r\n $type = \"int\";\r\n $value = substr($arg, 4, strlen($arg));\r\n break;\r\n }\r\n if (preg_match('/^string@/', $arg)) {\r\n $type = \"string\";\r\n $value = substr($arg, 7, strlen($arg));\r\n if (preg_match_all('/\\\\\\\\[0-9]{3}/', $value) !== preg_match_all('/\\\\\\\\/', $value))\r\n exit(23);\r\n break;\r\n }\r\n if (preg_match('/^bool@(true|false)$/', $arg)) {\r\n $type = \"bool\";\r\n $value = substr($arg, 5, strlen($arg));\r\n break;\r\n }\r\n if (preg_match('/^float@0x([a-f]|[\\d])(\\.[\\d|a-f]*)?p(\\+|-)?[\\d]*$/i', $arg)) {\r\n $type = \"float\";\r\n $value = substr($arg, 6, strlen($arg));\r\n break;\r\n }\r\n if (preg_match('/^nil@nil$/', $arg)) {\r\n $type = \"nil\";\r\n $value = \"nil\";\r\n break;\r\n }\r\n\r\n case \"var\":\r\n if (preg_match('/^(GF|TF|LF)@[a-z_\\-$&%*!?A-Z][a-z_\\-$&%*!?0-9A-Z]*$/', $arg)) {\r\n $type = \"var\";\r\n break;\r\n }\r\n fprintf(STDERR, \"Expected type VAR or SYMBOL, got input: $arg\\n\");\r\n exit(23);\r\n\r\n case \"type\":\r\n if (preg_match('/^int$|^bool$|^string$|^nil$|^float$/', $arg)) {\r\n $type = \"type\";\r\n break;\r\n }\r\n fprintf(STDERR, \"Expected type TYPE, got input: $arg\\n\");\r\n exit(23);\r\n\r\n case \"label\":\r\n if (preg_match('/^[a-z_\\-$&%*!?A-Z][a-z_\\-$&%*!?0-9A-Z]*$/', $arg)) {\r\n $type = \"label\";\r\n break;\r\n }\r\n fprintf(STDERR, \"Expected type LABEL, got input: $arg\\n\");\r\n exit(23);\r\n }\r\n\r\n $value = preg_replace([\"/&/\", \"/>/\", \"/</\", '/\\'/', \"/\\\"/\"], [\"&\", \">\", \"<\", \"'\", \""\"], $value);\r\n return [$type, $value];\r\n}",
"public function addArgumentFromInputString($input)\n {\n $pos = strpos($input, ':');\n if($pos === false) {\n $argument = new Argument($input);\n $this->addArgument($argument);\n return $argument;\n }\n $name = substr($input, 0, $pos);\n $oldpos = $pos + 1;\n $pos = strpos($input, ':', $oldpos);\n \n if($pos === false) {\n $need = substr($input, $oldpos, strlen($input) - $oldpos);\n $argument = new Argument($name, $need);\n $this->addArgument($argument);\n return $argument;\n }\n $need = substr($input, $oldpos, $pos - $oldpos);\n $oldpos = $pos + 1;\n $pos = strpos($input, ':', $oldpos);\n if($pos === false) {\n $type = substr($input, $oldpos, strlen($input) );\n $argument = new Argument($name, $need, $type);\n $this->addArgument($argument);\n return $argument;\n }\n $type = substr($input, $oldpos, $pos - $oldpos);\n $oldpos = $pos + 1;\n \n $description = substr($input, $oldpos, strlen($input));\n $argument = new Argument($name, $need, $type, $description);\n $this->addArgument($argument);\n return $argument;\n \n }",
"function newArgument(array $config = []): Argument\n{\n invariant(isset($config['name']), 'Must provide name.');\n\n return new Argument(\n $config['name'],\n $config['description'] ?? null,\n $config['type'] ?? null,\n $config['defaultValue'] ?? null,\n $config['astNode'] ?? null\n );\n}",
"function abstract_arg(string $description): AbstractArgument\n{\n return new AbstractArgument($description);\n}",
"function RealizeArgs($placeholder, array $args = array());",
"function validArgument($str,$type,$parentElem,$numOfArg) {\r\n global $xmlOutput;\r\n switch ($type) {\r\n case \"symb\": // if not a constant should fallthrough and check if not var\r\n // check if symb\r\n if (substr_count($str,\"@\") > 0) {\r\n $part = explode('@',$str);\r\n $val = \"\";\r\n $valType = \"\";\r\n\r\n if (count($part) != 2) { // check proper type@value\r\n if ((count($part) > 2) && ($part[0] == \"string\")) { //string exception (string@string@lalala is valid)\r\n $valType = $part[0];\r\n $val = $part[1];\r\n for ($i=2; $i < count($part) ; $i++) {\r\n $val = $val . \"@\" . $part[$i];\r\n }\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n $val = $part[1];\r\n $valType = $part[0];\r\n }\r\n\r\n\r\n if (isType($valType)) {\r\n if (validValue($val,$valType)) {\r\n\r\n $val = htmlspecialchars($val);\r\n\r\n $argElem = $xmlOutput->createElement(\"arg\" . $numOfArg,$val);\r\n $argElem->setAttribute(\"type\",$valType);\r\n $parentElem->appendChild($argElem);\r\n return true;\r\n } else {\r\n return false; // return error if it is meant to be a constant but with wrong value\r\n }\r\n }\r\n }\r\n case \"var\":\r\n //check if var\r\n if (substr_count($str,\"@\") == 1) {\r\n $part = explode('@',$str);\r\n if (count($part) != 2) { // check proper frame@ID\r\n return false;\r\n }\r\n\r\n $frame = $part[0];\r\n $id = $part[1];\r\n\r\n if ($frame == \"GF\" || $frame == \"LF\" || $frame == \"TF\") {\r\n if (validID($id)) {\r\n\r\n $var = htmlspecialchars($str);\r\n\r\n $argElem = $xmlOutput->createElement(\"arg\" . $numOfArg,$var);\r\n $argElem->setAttribute(\"type\",\"var\");\r\n $parentElem->appendChild($argElem);\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n return false;\r\n }\r\n break;\r\n case \"label\":\r\n // check if label\r\n if (validID($str)) {\r\n $argElem = $xmlOutput->createElement(\"arg\" . $numOfArg,htmlspecialchars($str));\r\n $argElem->setAttribute(\"type\",\"label\");\r\n $parentElem->appendChild($argElem);\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n break;\r\n case \"type\":\r\n // check if type\r\n if (isType($str)) {\r\n $argElem = $xmlOutput->createElement(\"arg\" . $numOfArg,$str);\r\n $argElem->setAttribute(\"type\",\"type\");\r\n $parentElem->appendChild($argElem);\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n break;\r\n default:\r\n return false;\r\n break;\r\n }\r\n\r\n return true;\r\n }",
"#[@test]\n public function getArgumentTypeForObject() {\n $params= XPClass::forName('net.xp_framework.unittest.rest.server.mock.MockArgs')\n ->newInstance()->getClass()->getMethod('methodWithAnotherArgument')->getParameters();\n $this->args->addArgument('another', $params[0]);\n \n $this->assertEquals(XPClass::forName('lang.Object'), $this->args->getArgumentType('another'));\n }",
"public function testParseArguments() {\n\t\t$this->assertSame(array( 1, 2 ), PhpSourceUtilities::parseArguments('1,2'));\n\t\t$this->assertSame(array( 1, 2 ), PhpSourceUtilities::parseArguments('1, 2'));\n\t\t$this->assertSame(array( 1, 2 ), PhpSourceUtilities::parseArguments('\"1\", 2'));\n\t\t$this->assertSame(array( 'one', 'two' ), PhpSourceUtilities::parseArguments('one, two'));\n\t\t$this->assertSame(array( 'one', 'two' ), PhpSourceUtilities::parseArguments('\"one\", two'));\n\t\t$this->assertSame(array( 'one', 'two' ), PhpSourceUtilities::parseArguments('\\'one\\', \\'two\\''));\n\t\t$this->assertSame(array( 1, 'two', 'three, and a bit', 'four', 5.6 ), PhpSourceUtilities::parseArguments('1, \\'two\\', \"three, and a bit\", four, \"5.6\"'));\n\t}",
"public function validateArguments();",
"public function fromString($string);",
"function __construct($argument)\n\t{\n\t}",
"abstract protected function encodeArgument( $input );",
"public static function parse($obj)\n {\n if ($obj instanceof IntString) {\n return $obj;\n }\n\n if (is_integer($obj)) {\n return new IntString($obj);\n }\n\n try {\n $intValue = (int) Text::ensureIsString($obj);\n } catch (InvalidArgumentException $e) {\n $args = [\n 'position' => '1st',\n 'expected' => 'string\" or \"integer',\n 'actual' => typeof($obj),\n ];\n\n $msg = msg('Invalid argument type.');\n $msg .= msg(\n ' {position} parameter must to be an instance of \"{expected}\"; \"{actual}\" given.',\n $args\n );\n\n throw new InvalidArgumentException($msg, 1, $e);\n }\n\n $stringValue = ltrim($obj, \"${intValue}\");\n\n // Validate that 0 (zero) is not interpreted as '' (empty string)\n if ($stringValue === $obj) {\n $msg = msg('Invalid argument value.');\n $msg .= msg(' \"{0}\" (string) must to start with an integer.', $obj);\n\n throw new InvalidArgumentException($msg);\n }\n\n return new IntString($intValue, $stringValue);\n }",
"function set_sanitize_args( $type, $value, $filter_name, $args ) {\n\n\t\t$this->set( 'type', $type );\n\t\t$this->set( 'value', $value );\n\t\t$this->set( 'filter_name', $filter_name );\n\t\t$this->set( 'args', $args );\n\n\t}",
"public function validateArguments() {}",
"function createInputFromARGV(array $argv) : InputInterface\n{\n $inputDefinition = (new InputDefinition([\n new InputArgument('port', InputArgument::REQUIRED),\n new InputArgument('balance', InputArgument::REQUIRED | InputArgument::IS_ARRAY),\n new InputOption('silence', '', InputOption::VALUE_NONE),\n ]));\n return new ArgvInput($argv, $inputDefinition);\n}",
"static function create_from_string($classSpec, $firstArg = null) {\n\t\tif(!isset(self::$_cache_inst_args[$classSpec.$firstArg])) {\n\t\t\t// an $extension value can contain parameters as a string,\n\t\t\t// e.g. \"Versioned('Stage','Live')\"\n\t\t\tif(strpos($classSpec,'(') === false) {\n\t\t\t\tif($firstArg === null) self::$_cache_inst_args[$classSpec.$firstArg] = Object::create($classSpec);\n\t\t\t\telse self::$_cache_inst_args[$classSpec.$firstArg] = Object::create($classSpec, $firstArg);\n\t\t\t\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\tlist($class, $args) = self::parse_class_spec($classSpec);\n\t\t\t\t\n\t\t\t\tif($firstArg !== null) array_unshift($args, $firstArg);\n\t\t\t\tarray_unshift($args, $class);\n\t\t\t\t\n\t\t\t\tself::$_cache_inst_args[$classSpec.$firstArg] = call_user_func_array(array('Object','create'), $args);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn clone self::$_cache_inst_args[$classSpec.$firstArg];\n\t}",
"public function testSetArgument()\n\t{\n\t\t$object = new \\stdClass;\n\n\t\t$array = array(\n\t\t\t'test' => array(\n\t\t\t\t'foo' => 'bar',\n\t\t\t\t'test' => 'test'\n\t\t\t)\n\t\t);\n\n\t\t$this->instance->setArgument('object', $object);\n\t\t$this->assertTrue($this->instance->hasArgument('object'));\n\t\t$this->assertSame($object, $this->instance->getArgument('object'));\n\n\t\t$this->instance->setArgument('array', $array);\n\t\t$this->assertTrue($this->instance->hasArgument('array'));\n\t\t$this->assertSame($array, $this->instance->getArgument('array'));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get wiki name for given attraction id | public function get_attrWikiName($attrId){
$this->db->where('attr_id',$attrId);
$query = $this->db->get('attractions');
return ($query->num_rows() > 0) ? $query->row()->wiki_name : false;
} | [
"public function get_attraction($id);",
"public function get_lesson_name($lesson_id){\n\t\tif( !is_numeric($lesson_id) ) die('-1') ;\n\n\t\t$lesson = $this->m_lesson->get_by(array( m_lesson::COLUMN_ID => $lesson_id ) , TRUE , FALSE) ;\n\t\tif($lesson == NULL ) die('-1') ;\n\t\t\n\t\techo $lesson->{m_lesson::COLUMN_NAME} ;\n \t}",
"function getActionNameById($actionId) {\n $sql = \"SELECT action_id, action_name\n FROM %s\n WHERE action_id = %d\";\n $sqlParams = array($this->tableActions, $actionId);\n $result = NULL;\n if ($res = $this->databaseQueryFmt($sql, $sqlParams)) {\n if ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $result = $row['action_name'];\n }\n }\n return $result;\n }",
"public function getAttributeName($id)\n {\n $names = $this->getAttributes();\n\n return isset($names[$id]) ? $names[$id] : $id;\n }",
"function getElementName($xpath, $id) {\n\t\tif (!isset($id)) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$name = '';\n\t\tforeach($xpath->query('//menu[@id=\\'' . $id . '\\']') as $node) {\n\t\t $name = $node->getAttribute(\"name\");\n\t\t}\n\n\t\tforeach($xpath->query('//item[@id=\\'' . $id . '\\']') as $node) {\n\t\t\t$name = $node;\n\t\t}\n\t\t\n\t\treturn $name;\n\t}",
"private function getActionName()\n {\n if (empty($this->action_name)) {\n $this->action_name = substr($this->name, 0, strlen($this->name) - 6);\n }\n\n return $this->action_name;\n }",
"function sqifGetPropertyLabel( $id ) {\n\t$label = \\SMWDIProperty::findPropertyLabel( $id );\n\tif ( $label !== '' ) {\n\t\treturn $label;\n\t} elseif ( ( $id !== '' ) && ( $id[0] == '_' ) ) {\n\t\treturn $id;\n\t} else {\n\t\treturn smwfNormalTitleText( $id );\n\t}\n}",
"function imdbapiActorUrl($name, $id) {\n global $imdbServer;\n\n if ($id) {\n $path = 'name/'.urlencode($id).'/';\n } else {\n $path = 'find/?s=nm&q='.urlencode($name);\n }\n\n return $imdbServer.'/'.$path;\n}",
"function dev_get_title_from_id( $id ) {\n\treturn ucwords( str_replace( array( '-', '_' ), ' ', $id ) );\n}",
"public function getTermName($id) {\n $term = Term::load($id);\n return $term->getName();\n }",
"public function getName($id) {\n $type = $this->getTypes($id);\n return $type['name'];\n }",
"function get_category_name($id)\n {\n \t$ci = & get_instance();\n \treturn $ci->db->get_where('xx_categories', array('id' => $id))->row_array()['name'];\n }",
"public function getMenuNameById($id)\n {\n $CI =& get_instance();\n if (isset($id) && is_numeric($id) && $id != 0) {\n $sql = \"select name from menu where id=?\";\n $query = $CI->db->query($sql, $id);\n if ($query->num_rows() > 0) {\n $result = $query->result();\n return ($result[0]->name);\n }\n } else {\n return '-';\n }\n }",
"function get_text_name($id){\n\t\t$pool = DatabasePool::instance();\n\t\t$text = $pool->query('GET_TEXT',$id);\n\t\tDatabasePool::kill();\n\t\treturn $text[0]['name'];\n\t}",
"function get_mdlname($id) {\n global $CFG, $DB;\n $origin = $DB->get_record(\"local_lsf_category\", array(\"ueid\" => $id), \"origin\")->origin;\n $mdlid = $DB->get_record(\"local_lsf_category\", array(\"ueid\" => $origin), \"mdlid\")->mdlid;\n $cat = $DB->get_record(\"course_categories\", array(\"id\" => $mdlid), \"name\");\n return $cat->name;\n}",
"private function getActionFunctioName()\n {\n return 'action' . $this->route->getAction();\n }",
"function get_skill_type_name(int $id) : string\n\t{\n\t\t$CI =& get_instance();\n\t\t$CI->db->where('id', $id);\n\t\treturn $CI->db->get('skill_types', 1)->row()->name;\n\t}",
"public function get_product_attribute_detail_name_by_id($id)\n {\n $this->db->select('product_attribute_detail`.`name`');\n $query = $this->db->where('`product_attribute_detail`.`id`', $id);\n $query = $this->db->get('`product_attribute_detail`');\n $result = $query->result_array();\n return $result[0]['name'];\n }",
"public function getNameAttribute()\n {\n $components = explode('-', $this->id);\n if (array_key_exists($components[1], config('terms'))) {\n return config('terms')[$components[1]].' '.$components[0];\n } else {\n return str_replace('_', ' ', title_case($components[1])).' '.$components[0];\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Configure the existing middlewares | private function setupMiddlewares()
{
$this->addMiddlewares($this->container->get('config')->get('middlewares.after'));
$this->addMiddlewares($this->container->get('config')->get('middlewares.before'));
} | [
"public function setMiddlewares(array $middlewares = []);",
"public function registerMiddlewares()\n {\n foreach ($this->middlewares() as $name => $middleware) {\n $this->http->middlewares($middleware, $name);\n }\n\n if ($this->app['config']->get('log.enable')) {\n $this->http->middlewares($this->logMiddleware(), 'orc.log');\n }\n }",
"abstract protected function addAppMiddleware();",
"public function getMiddlewares();",
"private function registerMiddlewares() {\n\t\t\n\t\t$this->app['router']->middlewareGroup('hotcoffee', [\n\t\t\t\\TaffoVelikoff\\HotCoffee\\Http\\Middleware\\Auth::class,\n\t\t\t\\TaffoVelikoff\\HotCoffee\\Http\\Middleware\\HotCoffee::class\n\t\t]);\n\n\t}",
"public function getMiddlewares(): array;",
"private function configureMiddleware()\n {\n if (!$this->isLumen()) {\n $kernel = $this->app->make(Kernel::class);\n $kernel->prependToMiddlewarePriority(EnsureRequestsAreStateful::class);\n }\n }",
"private function addMiddleware()\n {\n foreach ($this->middlewares as $middleware) {\n $this->handler->addMiddleware($middleware);\n }\n }",
"public function defaultRouteMiddlewares()\n {\n }",
"protected function registerMiddlewares()\n {\n if (!$this->app['config']->get('gatekeeper.middleware.register')) {\n return;\n }\n\n $router = $this->app['router'];\n\n switch (true) {\n case method_exists($router, 'aliasMiddleware'):\n $registerMethod = 'aliasMiddleware';\n break;\n case method_exists($router, 'middleware'):\n $registerMethod = 'middleware';\n break;\n default:\n return;\n }\n\n foreach ($this->middlewares as $key => $class) {\n $router->$registerMethod($key, $class);\n }\n }",
"protected function registerMiddlewares()\n {\n if (!$this->app['config']->get('laravay.middleware.register')) {\n return;\n }\n $router = $this->app['router'];\n if (method_exists($router, 'middleware')) {\n $registerMethod = 'middleware';\n } elseif (method_exists($router, 'aliasMiddleware')) {\n $registerMethod = 'aliasMiddleware';\n } else {\n return;\n }\n foreach ($this->middlewares as $key => $class) {\n $router->$registerMethod($key, $class);\n }\n }",
"protected function registerMiddlewares()\n {\n $router = $this->app['router'];\n\n if (method_exists($router, 'middleware')) {\n $registerMethod = 'middleware';\n } elseif (method_exists($router, 'aliasMiddleware')) {\n $registerMethod = 'aliasMiddleware';\n } else {\n return;\n }\n\n foreach ($this->middlewares as $key => $class) {\n $router->$registerMethod($key, $class);\n }\n }",
"public function configureSlim()\n {\n $config = [];\n\n $config['determineRouteBeforeAppMiddleware'] = true;\n $config['addContentLengthHeader'] = true;\n\n $this->setConfig($config);\n }",
"public function resetMiddlewares ()\n {\n $this->middlewares = [];\n }",
"abstract public function requestMiddlewares(): array;",
"private function middlewareHandler()\n {\n if ($this->getDI()->has('middleware_aliases') === false) {\n return;\n }\n\n # get all the middlewares in the config/app.php\n $middleware = new Middleware(config()->app->middlewares);\n\n $instances = [];\n $aliases = $this->getDI()->get('middleware_aliases')->toArray();\n\n foreach ($aliases as $alias) {\n $class = $middleware->get($alias);\n $instances[] = new $class;\n }\n\n # register all the middlewares\n $command_bus = new CommandBus($instances);\n $command_bus->handle($this->request);\n }",
"protected function registerMiddleware()\n {\n $router = $this->app['router'];\n $router->aliasMiddleware('admin.auth', AdminAuth::class);\n $router->aliasMiddleware('admin.guest', RedirectIfAdminAuth::class);\n $router->aliasMiddleware('avored', AvoRedCore::class);\n }",
"protected function installMiddleware()\n {\n copy(\n SPARK_PATH.'/resources/stubs/app/Http/Middleware/Authenticate.php',\n app_path('Http/Middleware/Authenticate.php')\n );\n\n copy(\n SPARK_PATH.'/resources/stubs/app/Http/Middleware/VerifyCsrfToken.php',\n app_path('Http/Middleware/VerifyCsrfToken.php')\n );\n }",
"public function initMiddleware(App $app)\n {\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the attachments for the post. Simple wrapper for get_children() function to handle multiple attachments. | public function get_attachments( $args = '' ) {
global $post;
$defaults = array(
'post_parent' => $post->ID,
'post_type' => 'attachment',
'post_status' => 'inherit',
'post_mime_type' => '', // 'application' for documents only
'orderby' => 'menu_order ID',
'order' => 'ASC',
'numberposts' => -1,
//'suppress_fun' => true
);
$args = wp_parse_args( $args, $defaults );
$attachments = get_children($args);
if ( empty($attachments) ) {
return false;
} else {
return $attachments;
}
} | [
"protected function _shortcode_get_attachments( $atts ) {\n\t\t$attachments = array();\n\n\t\tif ( ! empty( $atts['include'] ) ) :\n\t\t\t$_attachments = get_posts( array(\n\t\t\t\t'include' => $atts['include'],\n\t\t\t\t'post_status' => 'inherit',\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order' => $atts['order'],\n\t\t\t\t'orderby' => $atts['orderby']\n\t\t\t) );\n\n\t\t\tforeach ( $_attachments as $key => $val )\n\t\t\t\t$attachments[$val->ID] = $_attachments[$key];\n\n\t\telseif ( ! empty( $atts['exclude'] ) ) :\n\t\t\t$attachments = get_children( array(\n\t\t\t\t'post_parent' => $atts['id'],\n\t\t\t\t'exclude' => $atts['exclude'],\n\t\t\t\t'post_status' => 'inherit',\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order' => $atts['order'],\n\t\t\t\t'orderby' => $atts['orderby']\n\t\t\t) );\n\n\t\telse :\n\t\t\t$attachments = get_children( array(\n\t\t\t\t'post_parent' => $atts['id'],\n\t\t\t\t'post_status' => 'inherit',\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order' => $atts['order'],\n\t\t\t\t'orderby' => $atts['orderby']\n\t\t\t) );\n\t\tendif;\n\n\t\treturn $attachments;\n\t}",
"function wpfu_get_attachments( $post_id ) {\n $att_list = array();\n\n $args = array(\n 'post_type' => 'attachment',\n 'numberposts' => -1,\n 'post_status' => null,\n 'post_parent' => $post_id,\n 'order' => 'ASC',\n 'orderby' => 'ID'\n );\n\n $attachments = get_posts( $args );\n\n foreach ($attachments as $attachment) {\n $att_list[] = array(\n 'id' => $attachment->ID,\n 'title' => $attachment->post_title,\n 'url' => wp_get_attachment_url( $attachment->ID ),\n 'mime' => $attachment->post_mime_type\n );\n }\n\n return $att_list;\n}",
"function ipress_get_post_attachement( $post_id, $att_type ){\n\n // get attachment data\n $attachments = get_posts( [\n 'post_type' => 'attachment',\n 'post_mime_type' => $att_type,\n 'numberposts' => -1,\n 'post_parent' => $post_id\n ] );\n\n // return attachments \n return $attachments;\n}",
"function lex_get_post_attachement( $post_id, $att_type ){\r\n\t$attachments = get_posts( array(\r\n\t\t'post_type' => 'attachment',\r\n\t\t'post_mime_type' => $att_type,\r\n\t\t'numberposts' => -1,\r\n\t\t'post_parent' => $post_id\r\n\t));\r\n\t\r\n\treturn $attachments;\r\n}",
"function get_the_attachments($type = null, $id = 0)\n{\n global $wpdb;\n $post = &get_post($id);\n $id = isset($post->ID) ? (int) $post->ID : (int) $id;\n\n if (!empty($type))\n {\n $type = strtolower(preg_replace(\"/ /i\", \"_\", $type));\n }\n\n $sql = \"SELECT p.*, m.meta_value \" . CATTACHMENT_GALLERY_CATEGORY_FIELD_NAME . \"\n FROM {$wpdb->posts} p\n LEFT JOIN {$wpdb->postmeta} m ON\n (p.id = m.post_id AND m.meta_key = '\" . CATTACHMENT_GALLERY_CATEGORY_METADATA . \"')\n WHERE p.post_parent = {$id}\n AND p.post_type = 'attachment'\n AND p.post_status != 'trash'\n \" . (!empty($type) ? \"AND m.meta_value = '%s'\" : \"\") . \"\n ORDER BY p.menu_order ASC\";\n\n $statement = $wpdb->prepare($sql, $type);\n $results = $wpdb->get_results($statement);\n return $results;\n}",
"function get_attachments_from_post($post_id_array)\n{\n global $attach_config;\n\n $attachments = [];\n\n if (!is_array($post_id_array)) {\n if (empty($post_id_array)) {\n return $attachments;\n }\n\n $post_id = (int)$post_id_array;\n\n $post_id_array = [];\n $post_id_array[] = $post_id;\n }\n\n $post_id_array = implode(', ', array_map('\\intval', $post_id_array));\n\n if ($post_id_array == '') {\n return $attachments;\n }\n\n $display_order = ((int)$attach_config['display_order'] == 0) ? 'DESC' : 'ASC';\n\n $sql = 'SELECT a.post_id, d.*\n\t\tFROM ' . BB_ATTACHMENTS . ' a, ' . BB_ATTACHMENTS_DESC . \" d\n\t\tWHERE a.post_id IN ($post_id_array)\n\t\t\tAND a.attach_id = d.attach_id\n\t\tORDER BY d.filetime $display_order\";\n\n if (!($result = DB()->sql_query($sql))) {\n bb_die('Could not get attachment informations for post number ' . $post_id_array);\n }\n\n $num_rows = DB()->num_rows($result);\n $attachments = DB()->sql_fetchrowset($result);\n DB()->sql_freeresult($result);\n\n if ($num_rows == 0) {\n return [];\n }\n\n return $attachments;\n}",
"public function getAttachments()\n {\n return $this->getMedia(\"attachment\");\n }",
"function roots_get_all_attachements(){\n\t$attachments = array();\n\t$uploads = wp_upload_dir();\n\t\n\t// Custom post + text urls\n\t$custompostvalues = (array) array_filter((array) get_post_custom_values(\"_wp_format_media\"));\n\t$urls = array_merge($custompostvalues, roots_get_urls(get_the_content()));\n\t\n\t// Load all old-school attachments\n\t$args = array(\n\t\t'post_parent' => get_the_ID(),\n\t\t'post_type' => 'attachment',\n\t\t'orderby' => 'post_mime_type title',\n\t\t'order' => 'ASC'\n\t);\n\t$children =& get_children( $args );\n\tforeach($children as $child){\n\t\tif(($index = array_search(wp_get_attachment_url($child->ID), $urls)) || ($index = array_search($child->guid, $urls))){\n\t\t\tif(in_array($urls[$index], $custompostvalues))\n\t\t\t\t$child->featured = true;\n\t\t\tunset($urls[$index]);\n\t\t}\n\t\t$attachments[] = $child;\n\t}\n\n\t// Add all urls\n\tforeach($urls as $url){\n\t\t$filetype = wp_check_filetype($url);\n\t\t// If we can't find the filetype, it's probably not a file url\n\t\tif(empty($filetype['type'])) continue;\n\t\t\n\t\t// Try to find a local attachment\n\t\tif($id = roots_get_attachment_id_by_url($url)){\n\t\t\t$post = get_post($id);\n\t\t\tif(in_array($url, $custompostvalues))\n\t\t\t\t$post->featured = true;\n\t\t\t$attachments[] = $post;\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\t// Remote attachment\n\t\t$new = array(\n\t\t\t\"guid\" => $url,\n\t\t\t\"post_title\" => basename($url),\n\t\t\t\"post_type\" => \"attachment\",\n\t\t\t\"post_mime_type\" => $filetype['type']\n\t\t);\n\t\tif(in_array($url, $custompostvalues))\n\t\t\t$new['featured'] = true;\n\t\t\n\t\t$attachments[] = (object) $new;\n\t}\n\t\n\t// Remove duplicates\n\t$encountered = array();\n\tforeach($attachments as $k=>$a){\n\t\tif(in_array($a->guid, $encountered)) unset($attachments[$k]);\n\t\t$encountered[] = $a->guid;\n\t}\n\t\n\tuasort($attachments, '_roots_order_attachments');\n\treturn $attachments;\n}",
"public function getAttachments()\n {\n return isset($this->data['attachments']) ? $this->data['attachments'] : [];\n }",
"function ipress_get_post_attachment( $post_id, $att_type ){\n\n\t// Get attachment data\n\t$attachments = get_posts( [\n\t\t'post_type'\t\t\t=> 'attachment',\n\t\t'post_mime_type'\t=> $att_type,\n\t\t'numberposts'\t\t=> -1,\n\t\t'post_parent'\t\t=> $post_id\n\t] );\n\n\t// Return attachments\t \n\treturn $attachments;\n}",
"public function getAttachments()\n {\n return $this->attachment_list;\n }",
"function qw_get_post_files($post_id)\n{\n $child_args = array(\n \"post_type\" => \"attachment\",\n \"post_parent\" => $post_id,\n );\n\t\t// Get images for this post\n $files = get_posts($child_args);\n\n if(is_array($files))\n\t\t{\n return $files;\n }\n return false;\n}",
"function get_post_attachments($id, &$post)\n{\n\tglobal $attachcache, $mybb, $theme, $templates, $forumpermissions, $lang;\n\n\t$validationcount = 0;\n\t$tcount = 0;\n\t$post['attachmentlist'] = $post['thumblist'] = $post['imagelist'] = '';\n\tif(!isset($forumpermissions))\n\t{\n\t\t$forumpermissions = forum_permissions($post['fid']);\n\t}\n\n\tif(isset($attachcache[$id]) && is_array($attachcache[$id]))\n\t{ // This post has 1 or more attachments\n\t\tforeach($attachcache[$id] as $aid => $attachment)\n\t\t{\n\t\t\tif($attachment['visible'])\n\t\t\t{ // There is an attachment thats visible!\n\t\t\t\t$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);\n\t\t\t\t$attachment['filesize'] = get_friendly_size($attachment['filesize']);\n\t\t\t\t$ext = get_extension($attachment['filename']);\n\t\t\t\tif($ext == \"jpeg\" || $ext == \"gif\" || $ext == \"bmp\" || $ext == \"png\" || $ext == \"jpg\")\n\t\t\t\t{\n\t\t\t\t\t$isimage = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$isimage = false;\n\t\t\t\t}\n\t\t\t\t$attachment['icon'] = get_attachment_icon($ext);\n\t\t\t\t$attachment['downloads'] = my_number_format($attachment['downloads']);\n\n\t\t\t\tif(!$attachment['dateuploaded'])\n\t\t\t\t{\n\t\t\t\t\t$attachment['dateuploaded'] = $attachment['dateline'];\n\t\t\t\t}\n\t\t\t\t$attachdate = my_date('normal', $attachment['dateuploaded']);\n\t\t\t\t// Support for [attachment=id] code\n\t\t\t\tif(stripos($post['message'], \"[attachment=\".$attachment['aid'].\"]\") !== false)\n\t\t\t\t{\n\t\t\t\t\t// Show as thumbnail IF image is big && thumbnail exists && setting=='thumb'\n\t\t\t\t\t// Show as full size image IF setting=='fullsize' || (image is small && permissions allow)\n\t\t\t\t\t// Show as download for all other cases\n\t\t\t\t\tif($attachment['thumbnail'] != \"SMALL\" && $attachment['thumbnail'] != \"\" && $mybb->settings['attachthumbnails'] == \"yes\")\n\t\t\t\t\t{\n\t\t\t\t\t\teval(\"\\$attbit = \\\"\".$templates->get(\"postbit_attachments_thumbnails_thumbnail\").\"\\\";\");\n\t\t\t\t\t}\n\t\t\t\t\telseif((($attachment['thumbnail'] == \"SMALL\" && $forumpermissions['candlattachments'] == 1) || $mybb->settings['attachthumbnails'] == \"no\") && $isimage)\n\t\t\t\t\t{\n\t\t\t\t\t\teval(\"\\$attbit = \\\"\".$templates->get(\"postbit_attachments_images_image\").\"\\\";\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\teval(\"\\$attbit = \\\"\".$templates->get(\"postbit_attachments_attachment\").\"\\\";\");\n\t\t\t\t\t}\n\t\t\t\t\t$post['message'] = preg_replace(\"#\\[attachment=\".$attachment['aid'].\"]#si\", $attbit, $post['message']);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Show as thumbnail IF image is big && thumbnail exists && setting=='thumb'\n\t\t\t\t\t// Show as full size image IF setting=='fullsize' || (image is small && permissions allow)\n\t\t\t\t\t// Show as download for all other cases\n\t\t\t\t\tif($attachment['thumbnail'] != \"SMALL\" && $attachment['thumbnail'] != \"\" && $mybb->settings['attachthumbnails'] == \"yes\")\n\t\t\t\t\t{\n\t\t\t\t\t\teval(\"\\$post['thumblist'] .= \\\"\".$templates->get(\"postbit_attachments_thumbnails_thumbnail\").\"\\\";\");\n\t\t\t\t\t\tif($tcount == 5)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$thumblist .= \"<br />\";\n\t\t\t\t\t\t\t$tcount = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t++$tcount;\n\t\t\t\t\t}\n\t\t\t\t\telseif((($attachment['thumbnail'] == \"SMALL\" && $forumpermissions['candlattachments'] == 1) || $mybb->settings['attachthumbnails'] == \"no\") && $isimage)\n\t\t\t\t\t{\n\t\t\t\t\t\teval(\"\\$post['imagelist'] .= \\\"\".$templates->get(\"postbit_attachments_images_image\").\"\\\";\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\teval(\"\\$post['attachmentlist'] .= \\\"\".$templates->get(\"postbit_attachments_attachment\").\"\\\";\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$validationcount++;\n\t\t\t}\n\t\t}\n\t\tif($validationcount > 0 && is_moderator($post['fid'], \"canviewunapprove\"))\n\t\t{\n\t\t\tif($validationcount == 1)\n\t\t\t{\n\t\t\t\t$postbit_unapproved_attachments = $lang->postbit_unapproved_attachment;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$postbit_unapproved_attachments = $lang->sprintf($lang->postbit_unapproved_attachments, $validationcount);\n\t\t\t}\n\t\t\teval(\"\\$post['attachmentlist'] .= \\\"\".$templates->get(\"postbit_attachments_attachment_unapproved\").\"\\\";\");\n\t\t}\n\t\tif($post['thumblist'])\n\t\t{\n\t\t\teval(\"\\$post['attachedthumbs'] = \\\"\".$templates->get(\"postbit_attachments_thumbnails\").\"\\\";\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$post['attachedthumbs'] = '';\n\t\t}\n\t\tif($post['imagelist'])\n\t\t{\n\t\t\teval(\"\\$post['attachedimages'] = \\\"\".$templates->get(\"postbit_attachments_images\").\"\\\";\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$post['attachedimages'] = '';\n\t\t}\n\t\tif($post['attachmentlist'] || $post['thumblist'] || $post['imagelist'])\n\t\t{\n\t\t\teval(\"\\$post['attachments'] = \\\"\".$templates->get(\"postbit_attachments\").\"\\\";\");\n\t\t}\n\t}\n}",
"function get_campaign_attachments( $post_ids ) {\n\n\tglobal $wpdb;\n\n\tif ( empty( $post_ids ) ) {\n\t\treturn [];\n\t}\n\n\t$sql = '\n\t\tSELECT id\n\t\tFROM %1$s\n\t\tWHERE post_type = \\'attachment\\'\n\t\tAND post_parent IN (' . generate_list_placeholders( $post_ids, 2 ) . ')';\n\n\t$prepared_sql = $wpdb->prepare(\n\t\t$sql, // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t\tarray_merge( [ $wpdb->posts ], $post_ids )\n\t);\n\t$results = $wpdb->get_results( $prepared_sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t$attachment_ids = array_map(\n\t\tfunction ( $result ) {\n\t\t\treturn $result->id;\n\t\t},\n\t\t$results\n\t);\n\n\t/**\n\t * Post thumbnails\n\t */\n\t$sql = '\n\t\tSELECT meta_value\n\t\tFROM %1$s\n\t\tWHERE ( meta_key = \\'_thumbnail_id\\' OR meta_key = \\'background_image_id\\' )\n\t\tAND post_id IN(' . generate_list_placeholders( $post_ids, 2 ) . ')';\n\n\t$prepared_sql = $wpdb->prepare(\n\t\t$sql, // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t\tarray_merge( [ $wpdb->postmeta ], $post_ids )\n\t);\n\t$results = $wpdb->get_results( $prepared_sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\n\t$attachment_ids = array_merge(\n\t\t$attachment_ids,\n\t\tarray_map(\n\t\t\tfunction ( $result ) {\n\t\t\t\treturn $result->meta_value;\n\t\t\t},\n\t\t\t$results\n\t\t)\n\t);\n\n\t$sql = '\n\t\t\tSELECT post_content\n\t\t\tFROM %1$s\n\t\t\tWHERE ID IN(' . generate_list_placeholders( $post_ids, 2 ) . ')\n\t\t\tAND post_content REGEXP \\'((wp-image-|wp-att-)[0-9][0-9]*)|gallery_block_style|wp\\:planet4\\-blocks|href=|src=\\'';\n\n\t$prepared_sql = $wpdb->prepare( $sql, array_merge( [ $wpdb->posts ], $post_ids ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t$results = $wpdb->get_results( $prepared_sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\n\tforeach ( (array) $results as $text ) {\n\t\t$text = $text->post_content;\n\t\t$attachment_ids = array_merge( $attachment_ids, get_attachments_used_in_content( $text ) );\n\t}\n\n\t$attachment_ids = array_unique( $attachment_ids );\n\tsort( $attachment_ids );\n\n\t// The post ids are reordered as sort all attachment ids first and then append the post id to array.(Added for simplification of import process).\n\t$attachment_ids = array_diff( $attachment_ids, $post_ids );\n\t$post_ids = array_merge( $attachment_ids, $post_ids );\n\n\treturn $post_ids;\n}",
"public function getAttachmentElements()\n {\n $return = [];\n $elements = $this->getAllElements();\n\n foreach ($elements as $e) {\n if (\n isset($e->vars['body']) &&\n (\n (\n $e->getContentType() != '' || // == \"message/rfc822\"\n $e->getContentDisposition() == 'attachment' ||\n $e->getContentDispositionFilename() != '' ||\n $e->getContentTypeName() != ''\n // ||\t$e->getContentDisposition() == \"inline\"\n )\n and\n $e->hasParent()\n )\n ) {\n $return[] = $e;\n }\n\n /*\n elseif($e->parent === NULL)\n {\n $return[] = $e;\n }\n */\n }\n return $return;\n }",
"public function getAttachments()\n {\n return (isset($this->_metadata['_attachments']) ? $this->_metadata['_attachments'] : array());\n }",
"public function attachments()\n {\n return $this->morphMany(\\App\\Models\\Attachment::class, 'attachable')->orderBy('created_at', 'asc');\n }",
"public function get_attachment_image() {\n\n\t\t// Check if the post itself is an image attachment.\n\t\tif ( wp_attachment_is_image( $this->args['post_id'] ) ) {\n\t\t\t$attachment_id = $this->args['post_id'];\n\t\t}\n\n\t\t// If the post is not an image attachment, check if it has any image attachments.\n\t\telse {\n\n\t\t\t// Get attachments for the inputted $post_id.\n\t\t\t$attachments = get_children(\n\t\t\t\tarray(\n\t\t\t\t\t'numberposts' => 1,\n\t\t\t\t\t'post_parent' => $this->args['post_id'],\n\t\t\t\t\t'post_status' => 'inherit',\n\t\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t\t'order' => 'ASC',\n\t\t\t\t\t'orderby' => 'menu_order ID',\n\t\t\t\t\t'fields' => 'ids'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Check if any attachments were found.\n\t\t\tif ( !empty( $attachments ) )\n\t\t\t\t$attachment_id = array_shift( $attachments );\n\t\t}\n\n\t\tif ( !empty( $attachment_id ) )\n\t\t\t$this->_get_image_attachment( $attachment_id );\n\t}",
"private function WP_Post_attachments($graph, $post) {\r\n $args = array( 'post_type' => 'attachment', 'numberposts' => null, 'post_status' => 'inherit', 'post_parent' => $post->ID );\r\n $attachments = get_posts($args);\r\n\r\n if ($attachments) {\r\n foreach ($attachments as $attachment) {\r\n $post_resource = $graph->resource($post->guid);\r\n $post_resource->add('sioc:attachment', $graph->resource($attachment->guid));\r\n\r\n $attachment_resource = $graph->resource($attachment->guid);\r\n $attachment_resource->set('rdfs:seeAlso', $graph->resource($this->return_seeAlso_resource(get_attachment_link($attachment->ID))));\r\n }\r\n }\r\n return $graph;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete cache from menu | private function _deleteCacheData()
{
Cache::delete(CACHE_MENU);
} | [
"protected function deleteMenuCacheFile(): void\n {\n if (file_exists($this->getMenuCachePath())) {\n unlink($this->getMenuCachePath());\n }\n }",
"public static function clearMenuCache()\n {\n Application::getInstance()->getTaggedCache()->clearByTag('bitrix:menu');\n }",
"protected function _afterDelete(){\r\n\t\t$menu = $this->_menus->getEntryById($this->_current_entry['menu_id']);\t\t\r\n\t\tif($menu){\r\n\t\t\tHelpers_Content_Cache::clearMenuCache($menu->menu_system_name);\r\n\t\t}\r\n }",
"public function clearCacheAction() {\n $storeId = Mage::app()->getStore()->getId();\n $cache = Mage::getSingleton('core/cache');\n $key = 'homepage-mega-menu-' . $storeId;\n\n $data = $cache->clean('homepage_cache');\n if ($data) {\n Mage::getSingleton('adminhtml/session')\n ->addSuccess(Mage::helper('adminhtml')->__('Menu cache cleared successfully'));\n }\n $this->_redirect('*/*/index');\n }",
"public function forgetMenusCache()\n {\n \\Cache::forget(config('menu.cache-keys.menus'));\n }",
"function wp_cache_clear_cache_on_menu() {\n\tglobal $wpdb;\n\twp_cache_clear_cache( $wpdb->blogid );\n}",
"public static function clearCache() {\n\t\tWCF::getCache()->clear(WCF_DIR.'cache', 'cache.pageMenu-*.php');\n\t}",
"function updateMenu() {\n delete_transient('cfMenu');\n }",
"public function afterDataDelete() {\n //删除菜单缓存\n Yii::$app->cacheManage->site_menu = null;\n }",
"public function delete() {\n\t\tif (MiCache::$setting === null) {\n\t\t\tMiCache::config();\n\t\t}\n\n\t\t$cacheKey = MiCache::key(func_get_args());\n\t\tCache::delete($cacheKey, MiCache::$setting);\n\t}",
"function menu_cache_clear($menu_name = 'navigation') {\n $cache_cleared = &drupal_static(__FUNCTION__, array());\n\n if (empty($cache_cleared[$menu_name])) {\n cache_clear_all('links:' . $menu_name . ':', 'cache_menu', TRUE);\n $cache_cleared[$menu_name] = 1;\n }\n elseif ($cache_cleared[$menu_name] == 1) {\n drupal_register_shutdown_function('cache_clear_all', 'links:' . $menu_name . ':', 'cache_menu', TRUE);\n $cache_cleared[$menu_name] = 2;\n }\n\n // Also clear the menu system static caches.\n menu_reset_static_cache();\n}",
"public function deleteCache(){\n\n\t\tif(file_exists($this->key)){\n\t\t\tunlink($this->key);\n\t\t}\n\n\t}",
"function xu_clean_nav_menu_cache() {\n\txu_cache_delete_group( 'xu_wp_nav_menu' );\n}",
"public function deleteCacheState();",
"public function deleteCache ()\n {\n unlink ( PATH.'cache/' .$this->_file_name .'.cache.txt' );\n }",
"public function removeCache(): void;",
"public function menu_cache_clear_all()\n {\n return menu_cache_clear_all();\n }",
"function admin_bar_delete_cache() {\n\t\tif ( function_exists( 'current_user_can' ) && false == current_user_can( 'delete_others_posts' ) ) return false;\n\t\tif ( wp_verify_nonce( $_REQUEST[ '_wpnonce' ], 'delete-css-cache' ) ) {\n\t\t\t$this->delete_cache();\n\t\t\twp_redirect( preg_replace( '/[ <>\\'\\\"\\r\\n\\t\\(\\)]/', '', $_GET[ 'path' ] ) );\n\t\t\tdie();\n\t\t}\n\t}",
"public function cache_clear() {\n\t\t$cache = WP_CLI::get_cache();\n\n\t\tif ( ! $cache->is_enabled() ) {\n\t\t\tWP_CLI::error( 'Cache directory does not exist.' );\n\t\t}\n\n\t\t$cache->clear();\n\n\t\tWP_CLI::success( 'Cache cleared.' );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return value of created_by_name field | function getCreatedByName() {
return $this->getFieldValue('created_by_name');
} | [
"public function getCreated_By_Name()\n\t{\n\t\treturn isset($this->owner->createdBy) ? $this->owner->createdBy->username : null;\n\t}",
"public function getCreatedBy() : string\n {\n return $this->getProperty()->createdBy;\n }",
"public function getCreatedBy()\n\t{\n\t\treturn $this->{static::CREATED_BY};\n\t}",
"public function getCreatedby()\n {\n return $this->createdby;\n }",
"function getCreatorUserName() {\n\t\treturn $this->data_array['user_name'];\n\t}",
"public function getCreatedBy() {\n\n return $this->s_createdby;\n\n }",
"public function getCreatorLabel()\n {\n return User::findIdentity($this->created_by)->username;\n }",
"public function getCreatedBy()\r\n {\r\n return $this->created_by;\r\n }",
"function getCreatedById() {\n return $this->getFieldValue('created_by_id');\n }",
"public function getCreatedByColumn()\n {\n return defined('static::CREATED_BY') ? static::CREATED_BY : 'created_by';\n }",
"function getCreatedByEmail() {\n return $this->getFieldValue('created_by_email');\n }",
"function setCreatedByName($value) {\n return $this->setFieldValue('created_by_name', $value);\n }",
"public function getCreatedBy();",
"public function getCreatedBy() {\n return $createdBy;\n }",
"public function getCreatedBy()\n {\n return $this->createdBy;\n }",
"public function get_createdBy() {\n return $this->createdBy;\n }",
"public function getCreatedByColumn()\n {\n return defined('static::CREATED_BY') ?\n static::CREATED_BY : UserstampNames::baseColumnName(UserstampNames::CREATED);\n }",
"public function getCreateUserName()\n {\n $user = self::findOne(['id' => $this->create_user_id]);\n return $user->name;\n }",
"protected function getCreatedByColumn()\n {\n return 'created_by';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the modelStartupPerformanceScore property value. The user experience analytics model level startup performance score. Valid values 1.79769313486232E+308 to 1.79769313486232E+308 | public function getModelStartupPerformanceScore(): ?float {
$val = $this->getBackingStore()->get('modelStartupPerformanceScore');
if (is_null($val) || is_float($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'modelStartupPerformanceScore'");
} | [
"public function getStartupPerformanceScore(): ?float {\n $val = $this->getBackingStore()->get('startupPerformanceScore');\n if (is_null($val) || is_float($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'startupPerformanceScore'\");\n }",
"public function getMinScore()\n {\n return $this->minScore;\n }",
"public function getMinBackendScore(): float\n {\n return min(1.0, max(0.1, (float) $this->scopeConfig->getValue(\n static::XML_PATH_SIZE_MIN_SCORE_BACKEND\n )));\n }",
"public function getOsVersionAppHealthScore()\n {\n if (array_key_exists(\"osVersionAppHealthScore\", $this->_propDict)) {\n return $this->_propDict[\"osVersionAppHealthScore\"];\n } else {\n return null;\n }\n }",
"public function getCloudManagementScore()\n {\n if (array_key_exists(\"cloudManagementScore\", $this->_propDict)) {\n return $this->_propDict[\"cloudManagementScore\"];\n } else {\n return null;\n }\n }",
"public function get_score_min()\n\t{\n\t\treturn $this->score_min;\n\t}",
"public function getEndpointAnalyticsScore()\n {\n if (array_key_exists(\"endpointAnalyticsScore\", $this->_propDict)) {\n return $this->_propDict[\"endpointAnalyticsScore\"];\n } else {\n return null;\n }\n }",
"public function getScoreStudentScore() {\n\t\treturn ($this->scoreStudentScore);\n\t}",
"public function getCloudIdentityScore()\n {\n if (array_key_exists(\"cloudIdentityScore\", $this->_propDict)) {\n return $this->_propDict[\"cloudIdentityScore\"];\n } else {\n return null;\n }\n }",
"public function getWindowsScore()\n {\n if (array_key_exists(\"windowsScore\", $this->_propDict)) {\n return $this->_propDict[\"windowsScore\"];\n } else {\n return null;\n }\n }",
"protected function get_seo_score_dimension() {\n // Make sure WP SEO or WP SEO Premium is active and if a singular post is displayed\n $score_label = '';\n if ( monsterinsights_is_wp_seo_active() && is_singular() ) {\n $score_label = $this->get_wp_seo_score( get_the_ID() );\n }\n return $score_label;\n }",
"public function getKloutScore()\n {\n return $this->_get(self::KLOUT_SCORE);\n }",
"public function getBaselineScore()\n {\n return $this->baseline_score;\n }",
"public function getComputerScore()\n {\n return $this->computerScore;\n }",
"public function getPerformance(){\n \n if ($this->target_value == 0 || $this->endline_value == 0) {\n return 0;\n } else {\n return (($this->endline_value-$this->target_value)/$this->target_value);\n }\n }",
"public function getScore()\n {\n return $this->score;\n }",
"public function getCpuRealtimeRuntime() : int\n {\n return $this->cpuRealtimeRuntime;\n }",
"public function getAvgScore() {\n return $this->avgScore;\n }",
"public function get_min_score_if_attempted() {\n return $this->min_score_if_attempted;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
read a user tag from database | function Smarty_tags_read_user_tag()
{
$sql = sprintf("SELECT *
FROM %s
WHERE user_plugin_id = '%d'",
$this->cms->tbname['papoo_smarty_user_plugins'],
$this->db->escape($this->checked->user_plugin_id)
);
$result = $this->db->get_results($sql, ARRAY_A);
if (!count($result)) {
$this->content->template['error8'] = $result = 1;
} // wrong id given, doesn't exist
return $result;
} | [
"protected function readTags()\n\t{\n\t\t$this->import('FrontendUser', 'User');\n\t\t$this->import('Database');\n\t\t$arrTags = $this->Database->prepare(\"SELECT tag FROM tl_tag WHERE tid = ? AND from_table = ? ORDER BY tag ASC\")\n\t\t\t->execute($this->User->id, 'tl_member')\n\t\t\t->fetchEach('tag');\n\t\treturn count($arrTags) ? implode(\",\", $arrTags) : '';\n\t}",
"function retrieve_tags($user_id)\n\t{\n\t\t$this->db->select('saved_tags');\n\t\t$this->db->from('users');\n\t\t$this->db->where('id',$user_id);\n\t\t$query = $this->db->get();\n\t\t\n\t\t//there should only be 1 result\n\t\t$result = $query->row();\n\t\treturn Saved_Tag_Descriptor::from_string($result->saved_tags);\n\t}",
"public function findWithTagById($user);",
"public function readTag() {}",
"private function load_tag($tag)\n {\n $e = explode(\":\", $tag);\n $username = \"\";\n if(sizeof($e) == 2) {\n $tag = $e[1];\n $username = $e[0];\n }\n\n if(!$username) $username = mySpiresUser::current_username();\n if(!$username) return;\n\n // We first get all entries corresponding to a tag\n if ($tag == \"Recent\") {\n $results = mySpires::db_query(\"SELECT * FROM entries WHERE username = '{$username}' AND bin=0\n ORDER BY TIMESTAMP(updated) DESC LIMIT 60\");\n } elseif ($tag == \"Untagged\" || $tag == \"\") {\n $results = mySpires::db_query(\"SELECT * FROM entries WHERE username = '{$username}' AND bin=0 AND tags = ''\");\n } else {\n $results = mySpires::db_query(\"SELECT * FROM entries WHERE username = '{$username}' AND bin=0 AND tags LIKE '%%{$tag}%%'\");\n }\n\n // Now we need to prepare a list of IDs for the records table.\n // When searching for a tag \"Fluids\" mySQL will also return \"Holographic Fluids\". We need to eliminate these.\n // $entries = Array();\n $idArray = [];\n while ($entry = $results->fetch_object()) {\n $tagArray = explode(\",\", $entry->tags);\n\n if ($tag == \"Untagged\" || $tag == \"Recent\") $idArray[] = $entry->id;\n else {\n foreach ($tagArray as $dbtag) {\n if (trim($dbtag) == trim($tag)) {\n $idArray[] = $entry->id;\n break;\n }\n }\n }\n }\n\n $response = mySpires::find_records([\"id\" => implode(\",\", $idArray)]);\n foreach($response as $raw) $this->{$raw->id} = new mySpires_Record($raw);\n }",
"public static function ADMIN_CLASSIFY_GET_USER_TAGS(){\n\t $SQL_String = \"SELECT * FROM user_tags WHERE owner=:user ORDER BY edit_time DESC;\";\n\t return $SQL_String;\n\t}",
"private function getPrivateUsersEntityTag()\n {\n $tag = $this->em->getRepository('APITaskBundle:Tag')->findOneBy([\n 'title' => 'Users private Tag',\n ]);\n\n if (null !== $tag) {\n return $tag;\n }\n\n $this->getClient(true)->request('POST', $this->getBaseUrl(),\n ['title' => 'Users private Tag', 'color' => '555555', 'public' => false],\n [], ['Authorization' => 'Bearer ' . $this->userToken, 'HTTP_AUTHORIZATION' => 'Bearer ' . $this->userToken]);\n $this->assertEquals(201, $this->getClient()->getResponse()->getStatusCode());\n\n // Check if Entity was created\n $createdTag = json_decode($this->getClient()->getResponse()->getContent(), true);\n $createdTag = $createdTag['data'];\n $this->assertTrue(array_key_exists('id', $createdTag));\n\n return $this->em->getRepository('APITaskBundle:Tag')->find($createdTag['id']);\n }",
"static function getTagUser($conn, $id) {\n $stmt = $conn->prepare(\"SELECT libelle, competence, points_experience, niveau, nb_vote FROM competence_utilisateur, competence WHERE utilisateur = $id AND competence.id = competence_utilisateur.competence\");\n\t\t$stmt->execute();\n\t\t$count = $stmt->rowCount();\n\t\t\n\t\tif($count != 0)\n\t\t\treturn $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\telse\n\t\t\treturn NULL;\n }",
"function get_user_tag($uId)\n {\n $this->db->select('tag_id');\n $this->db->where('uId',$uId);\n $query = $this->db->get('user_private_tag');\n $result = array();\n if($query->num_rows() > 0)\n {\n foreach($query->result() as $row)\n {\n array_push($result,$row->tag_id);\n }\n }\n return $result;\n }",
"public function detailRecordByDos($tag) {\n $command = Yii::app()->db->createCommand('SELECT record_id, title' . LANG . ', content' . LANG . ', hit, description' . LANG . ' FROM ' . $this->tableName() . ' WHERE tag' . LANG . '=:tag AND dos_usernames_username=\\'dos\\'');\n $command->bindParam(\":tag\", $tag, PDO::PARAM_STR);\n $row = $command->queryRow();\n if ($row) {\n //Update hit\n $this->updateHit($row['hit'] + 1, $row['record_id']);\n return $row;\n }\n }",
"public function userTagAction()\n {\n $this->denyAccessUnlessGranted('ROLE_USER');\n\n $user = $this->getUser();\n\n $em = $this->getDoctrine()->getManager();\n\n $userTags = $em->getRepository('AppBundle:Tag')\n ->getTagsByUser($user);\n\n return $this->render('tag/user.html.twig', array(\n 'tags' => $userTags,\n ));\n }",
"function list_users($tag){\n\t\t\n\t\tif(is_int($tag)){\n\t\t\t$find_users\t= \t\"SELECT `user_id` FROM `user_tags` WHERE `tag_id` = '$tag';\";\n\t\t\t$query\t\t=\t@mysql_query($find_users,$this->connection); \t\t\n\t\t\tif (!$query) {\n \tdie(\"jforg_tags.list_user: Das SQL SELECT ist fehlgeschlagen - $query\");\n\t\t\t}\n\t\t\twhile ($row = mysql_fetch_assoc($query)) {\n $userids[] = $row['user_id']; \n\t\t\t}\n\t\t}\telseif(is_string($tag)){\n $tag_id = $this->get_tag_id($tag);\n\t\t\t\n\t\t\t$find_users\t= \t\"SELECT `user_id` FROM `user_tags` WHERE `tag_id` = '$tag_id';\";\n\t\t\t$query\t\t=\t@mysql_query($find_users,$this->connection);\n \t\t\n\t\t\tif (!$query) {\n \tdie(\"jforg_tags.list_user: Das SQL SELCT ist fehlgeschlagen - $query\");\n\t\t\t}\n\t\t\twhile ($row = mysql_fetch_assoc($query)) {\n $userids[] = $row['user_id']; \n }\n\t\t} else {\n\t\t\tdie(\"$tag is not an int or a string\");\n }\n\t\treturn $userids;\n\t}",
"function get_user_tags($user_id) {\n\t\t$user_tags \t= \t\"SELECT * FROM `user_tags` WHERE `user_id` = '$user_id';\";\n\t\t$query\t\t=\t@mysql_query($user_tags,$this->connection);\n\t\tif (!$query) {\n die(\"jforg_tags.get_user_tags: Die SQL Abfrage ist fehlgeschlagen - $user_tags\");\n\t\t}\n\t\twhile ($row = mysql_fetch_assoc($query)) {\n $tagids[] = $this->get_tag_value((int) $row['tag_id']); \n }\n\t\treturn $tagids;\t\t\n\t}",
"function recommand_tag4user($user_id)\n\t {\n\t //todo\n\t\t$user_cate_data = $this->User_data->get_user_tags($user_id);\n\t }",
"public function getbyTag($tag = null)\n {\n $this->db->select('id, title, userID, name, content, email, timestamp,tag, answerCount')\n ->from($this->getSource())\n ->where('tag = ?')\n ->orderBy('timestamp DESC');\n $this->db->execute([$tag]);\n $this->db->setFetchModeClass(__CLASS__);\n\n return $this->db->fetchAll();\n }",
"protected function readTags() {\n\t\t// include files\n\t\trequire_once(WCF_DIR.'lib/data/tag/TagCloud.class.php');\n\t\t\n\t\t// get tags\n\t\t$tagCloud = new TagCloud(WCF::getSession()->getVisibleLanguageIDArray());\n\t\t$this->tags = $tagCloud->getTags();\n\t}",
"function get_tagId_by_name($tag){\n\t\tglobal $db;\n\t\t\n\t\t$sQl = \"select tagId from cms_tbl_tags where tag_name = '\".$tag.\"'\";\n\t\t$result = $db->get_var($sQl);\n\t\tif ($result)\n\t\t\t{\n\t\t\treturn $result;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t\t}\n\t}",
"public function readUser() {\n $meta = json_decode($this->ctrlr->__openid['Openid']['meta'], true);\n if(!empty($meta) && !empty($meta['slideshare_user'])):\n if(!empty($meta['slideshare_user']['password'])):\n $meta['slideshare_user']['password'] = $this->Gatekeeper->decode($meta['slideshare_user']['password']);\n endif;\n $this->ctrlr->set(\"slideUser\", $meta['slideshare_user']);\n return $meta['slideshare_user'];\n endif;\n }",
"function dbGetTagName($OTID)\n{\n $sql = \"SELECT tagName FROM outreachTags \";\n $sql .= \"WHERE OTID = :OTID;\";\n $proxyFields = array(\":OTID\" => $OTID);\n $result = db_query($sql, $proxyFields)->fetchAll(PDO::FETCH_ASSOC);\n\n if ($result) {\n return $result[0]['tagName'];\n }\n return false;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the inheritdoc annotation | public function getInheritdoc()
{
return $this->find('inheritdoc', 'TagInheritdoc', true);
} | [
"protected function isInheritDoc ()\n {\n $content = $this->commentParser->getComment()->getContent();\n\n return preg_match('#{@inheritdoc}#i', $content) === 1;\n }",
"public static function echoInheritdocBlock()\n {\n echo \" /**\\n\";\n echo \" * @inheritdoc\\n\";\n echo \" */\\n\";\n }",
"public function get_annotation()\n {\n return $this->annotation;\n }",
"public function getAnnotations();",
"public function getAnnotator();",
"abstract protected function getAnnotationClass();",
"public function getDocComment() {\n return $this->forwardCallToReflectionSource( __FUNCTION__ );\n }",
"public function getAnnotations()\n {\n return $this->parseAnnotations($this->getDocComment());\n }",
"public function inheritsAnnotationFields();",
"public function getAnnotationSpec()\n {\n return $this->annotation_spec;\n }",
"public function getDocDefaults()\n {\n return array(\n 'classComments' => 'This is %name% class.',\n );\n }",
"public function getDocComment();",
"public function getDocComment()\n\t{\n\t\tif (isset($this->reflectionProperty))\n\t\t\treturn $this->reflectionProperty->getDocComment();\n\t\tif ($this->readMethod)\n\t\t\treturn $this->readMethod->getDocComment();\n\t\treturn '';\n\t}",
"public function getDocFilename() {\r\n\t\treturn $this->class->name.($this->class instanceof AClassDoc ? \"-class\" : \"-interface\").\".html\";\r\n\t}",
"public static function getDocType(){ }",
"public function phpDoc(): array;",
"protected function getDocblock()\n\t{\n\t\treturn $this->property->getDocComment();\n\t}",
"public function getAnnotations() {\n return $this->properties['annotations'];\n }",
"public function getAnnotationFilePath();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if the triangle is scalene (no two sides are equal) | public function isScalene()
{
return !$this->isIsosceles();
} | [
"public function isTriangle()\n {\n // exactly 3 (implicitly distinct) edges\n return (\\count($this->walk->getEdges()) === 3 &&\n // exactly three distinct vertices\n \\count($this->walk->getVertices()->getVerticesDistinct()) === 3 &&\n // this is actually a cycle\n $this->isCycle());\n }",
"public function isLowerTriangular(): bool\n {\n return true;\n }",
"function isTriangle($side1, $side2, $side3)\n {\n if ($side1 + $side2 <= $side3) return false;\n if ($side1 + $side3 <= $side2) return false;\n if ($side2 + $side3 <= $side1) return false;\n\n return true;\n }",
"public function isSymmetric(): bool {\n if (!$this->isSquare()) {\n return false;\n }\n $ar = $this->transpose();\n for ($i = 0; $i < $this->row; ++$i) {\n for ($j = 0; $j < $this->col; ++$j) {\n if ($ar->data[$i * $this->col + $j] != $this->data[$i * $this->col + $j]) {\n unset($ar);\n return false;\n }\n }\n }\n unset($ar);\n return true;\n }",
"public function isIsosceles()\n {\n $sizes = $this->getRoundedSideSizes();\n\n return\n $sizes[self::AB_SIDE] == $sizes[self::AC_SIDE] ||\n $sizes[self::AB_SIDE] == $sizes[self::BC_SIDE] ||\n $sizes[self::BC_SIDE] == $sizes[self::AC_SIDE];\n }",
"public function isSquare(): bool\n {\n return $this->rows === $this->columns;\n }",
"public function isPerfectSquare(): bool;",
"public function isSquare(){\n if($this->length==$this->width){\n return true;\n } else {\n return false;\n }\n }",
"public function isSquareMatrix()\n {\n return (bool) ($this->countX()===$this->countY());\n }",
"public function symmetric() : bool\n {\n if (!$this->isSquare()) {\n return false;\n }\n\n for ($i = 0; $i < $this->m - 1; ++$i) {\n $rowA = $this->a[$i];\n\n for ($j = $i + 1; $j < $this->n; ++$j) {\n if ($rowA[$j] != $this->a[$j][$i]) {\n return false;\n }\n }\n }\n\n return true;\n }",
"public function isSphere()\n {\n return ($this->a == $this->b);\n }",
"public function isSquare()\n {\n return $this->size->cols == $this->size->rows;\n }",
"final public function is_square()\n {\n return $this->ndim == 2\n && $this->shape[0] == $this->shape[1];\n }",
"public function square()\n {\n return $this->rows === $this->columns;\n }",
"public function isSquare()\n\t{\n\t\treturn ($this->getWidth() == $this->getHeight());\n\t}",
"function IsVertical(){}",
"function isTriangle($x1, $y1, $x2, $y2, $x3, $y3)\n {\n if (($y3 - $y2) * ($x2 - $x1) == ($y2 - $y1) * ($x3 - $x2)) {\n return (\"Points doesn't form triangle.\");\n } else {\n return (\"Given points form a triangle.\");\n }\n }",
"public function isSimplified() : bool\n {\n return $this->greatestCommonDivisor()->equals(Decimal::one());\n }",
"public function isVector(): bool\n {\n return $this->rows === 1 || $this->columns === 1;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a selection config parameter object. | public function createSelectionConfigParameter(
string $id,
$defaultValue,
array $selection
): SelectionConfigParameter {
return new SelectionConfigParameter($id, $defaultValue, $selection);
} | [
"protected function createParameterDriver()\n {\n $determiner = new Determiners\\Parameter(\n $this->app['config']['localize-middleware']['parameter']\n );\n\n $determiner->setFallback($this->app['config']['app']['fallback_locale']);\n\n return $determiner;\n }",
"public function createConfig()\n {\n $num = array_push($this->configData, new Parameter());\n\n return $this->configData[$num - 1];\n }",
"protected function newParam()\n {\n return app(ParamBuilder::class)->build($this->resourceName);\n }",
"public function createOption();",
"private function createParam(){\n $this->param = new \\stdClass();\n }",
"public function createParameter(): Parameter\n {\n return (new Parameter('query', $this->ref, $this->name))\n ->setDescription($this->description)\n ->setRequired($this->isRequired)\n ->setDeprecated($this->isDeprecated)\n ->setStyle($this->style)\n ->setExplode($this->explode)\n ->setExample($this->example)\n ->setAllowEmptyValue($this->allowEmptyValue)\n ->setSchema(\n (new Schema())\n ->setType($this->type)\n ->setEnum($this->enum)\n ->setFormat($this->format)\n );\n }",
"public static function get_choice_options_parameters() {\n return new external_function_parameters (array('choiceid' => new external_value(PARAM_INT, 'choice instance id')));\n }",
"public function createParameterBuilder(array $config = []): ParameterBuilderInterface;",
"public static function build( $xml ){\n\t\t\n\t\t//se instancia un nuevo param.\n\t\t$paramConfig = new ParamConfig();\n\t\t\n\t\t/*par�metro*/\n\t\t$param_attributes = array();\n\t\tforeach ($xml->attributes() as $key=>$value) {\n\t\t\t$param_attributes[$key] = $value . '';\t\n\t\t}\n\n\t\t$paramConfig->setName( $param_attributes['name'] );\n\t\t$paramConfig->setValue( $param_attributes['value'] );\n\t\t\n\t\treturn $paramConfig;\n\t}",
"protected function _make_options ()\n {\n return new PROJECT_PANEL_OPTIONS ();\n }",
"public function createParameter($name, $value, $type = null)\n {\n return new Parameter($name, $value, $type);\n }",
"protected function create_options() {}",
"public static function createNew() : ParameterRecord\n {\n $object = new ParameterRecord();\n $object->id = \\Programster\\PgsqlObjects\\Utils::generateUuid();\n $object->m_isSavedInDatabase = false;\n return $object;\n }",
"public function &createOption()\n\t{\n\t\treturn $this->addOption( Option::factory() );\n\t}",
"protected function setParamConfig()\n {\n $this->paramConfig = ArrayManipulation::deepMerge($this->paramConfig, array(\n 'name' => array(\n 'name' => 'Name der Tabelle',\n 'type' => 'textfield'\n ),\n 'max' => array(\n 'name' => 'Maximale Anzahl Anmeldungen (0 = unendlich)',\n 'type' => 'textfield',\n 'help' => 'Nützlich für Event-Anmeldungen wo z.B. nur für 80 Personen Platz ist. Berechnung kann mit Zuweisung der Event-Felder unten optimiert werden.'\n ),\n 'max_error' => array(\n 'name' => 'Text, wenn die maximale Anzahl erreicht ist',\n 'type' => 'textarea',\n 'placeholder' => __('Es sind keine weiteren Anmeldungen möglich.', 'lbwp'),\n 'help' => 'Anstelle des Formulars, wird dieser Text angezeigt, wenn die maximale Anzahl Datensätze erreicht ist.'\n ),\n ));\n\n // Allow the data table to show itself as a sending segment for newsletters\n if (LbwpCore::isModuleActive('NewsletterBase') && LocalMailService::isWorking()) {\n $this->paramConfig['use_segments'] = array(\n 'name' => 'Versandsegmente für Newsletter',\n 'type' => 'dropdown',\n 'values' => array(\n 0 => 'Keine Segmente zur Verfügung stellen',\n 1 => 'Versandsegmente im Newsletter-Tool anzeigen'\n ),\n 'help' => 'Dieser Datenspeicher wir beim Versand von Newslettern Versandsegmente zur Verfügung stellen. Wenn er mit einem Event verknüpft wird, sind zusätzliche Segmente möglich.'\n );\n }\n\n // Allow assignment of an event, if module is active\n if (LbwpCore::isModuleActive('Events')) {\n $this->paramConfig['event_id'] = array(\n 'name' => 'Verknüpfung mit Event',\n 'type' => 'dropdown',\n 'values' => $this->getAssignableEvents(),\n 'help' => 'Damit können Event-Informationen direkt im Datenspeicher angezeigt werden.'\n );\n\n $this->paramConfig['subscribe_field'] = array(\n 'name' => 'Anmelde-Feld',\n 'type' => 'textfield',\n 'help' => 'Es kann jedes Auswahl- oder Text-Feld verknüpft werden. Bitte das Zahnrädchen benutzen.'\n );\n\n $this->paramConfig['subscribe_condition'] = array(\n 'name' => 'Anmelde-Kondition',\n 'type' => 'textfield',\n 'help' => 'Wert, den das Anmelde-Feld haben muss, damit die Anmeldung gültig ist.'\n );\n\n $this->paramConfig['subscribers_field'] = array(\n 'name' => 'Feld für Personenzahl',\n 'type' => 'textfield',\n 'help' => 'Bitte Zahnrädchen verwenden um auf ein Zahlenfeld zu verweisen. Wir hier nichts selektiert, gilt jeder Datensatz, dessen Anmelde-Kondition zutrifft als eine Person. Wird dieses Feld verwendet, wir die angemeldete Anzahl Personen bei der zugelassenen Anzahl Anmeldungen miteinbezogen.'\n );\n\n $this->paramConfig['emailid_field'] = array(\n 'name' => 'Erkennungs-Feld',\n 'type' => 'textfield',\n 'help' => 'Wenn Sie via Newsletter Einladen kann hier ein unsichtbares Feld mit der Kennung der eingeladenen Person verwiesen werden. Damit kann der Datenspeicher ein Newsletter-Segment bilden, welches einen Versand an alle Personen enthält, welche die Einladung noch nicht beantwortet haben.'\n );\n }\n\n // Additional params to add edit link functionality\n $this->paramConfig['notify_mail_setting'] = array(\n 'name' => 'Bestätigungs-E-Mail',\n 'type' => 'dropdown',\n 'values' => array(\n 0 => 'Keine Bestätigungs-E-Mail senden',\n 1 => 'Bestätigungs-E-Mail ohne Bearbeitungs-Link',\n 2 => 'Bestätigungs-E-Mail mit Bearbeitungs-Link',\n ),\n 'help' => 'Die Bestätigungsmail enthält den unten eingegebenen Text, welcher auch alle Formular-Felder darstellen kann. Falls gewünscht, kann die E-Mail einen Link beinhalten welcher es dem Besucher erlaubt die Daten später anzupassen.'\n );\n\n $this->paramConfig['notify_mail_subject'] = array(\n 'name' => 'Betreffzeile Bestätigung',\n 'type' => 'textfield'\n );\n\n $this->paramConfig['notify_mail_email'] = array(\n 'name' => 'E-Mail-Feld (Empfänger)',\n 'type' => 'textfield'\n );\n\n $this->paramConfig['notify_mail_replyto'] = array(\n 'name' => 'Antwort-Adresse',\n 'type' => 'textfield',\n 'help' => 'An wen sollen Antworten auf diese E-Mail gesendet werden? Wird das Feld nicht ausgefüllt, wird die System-Adresse verwendet.'\n );\n\n $this->paramConfig['notify_mail_content'] = array(\n 'name' => 'E-Mail Inhalt',\n 'type' => 'textarea',\n 'help' => 'Hier können Sie Ihren E-Mail Inhalt definieren. Sie können Formularfelder verwenden indem Sie die Feld-ID z.B. wie folgt verwenden: {email_adresse}. Der Bearbeitungs-Link wird, sofern aktiviert, unter dem Text hinzugefügt. Die Tabelle mit allen Formular-Daten können Sie mit der Variable {lbwp:formContent} einfügen.'\n );\n }",
"public function __construct($_optionName,$_optionSelectionDetails = NULL)\r\n\t{\r\n\t\tparent::__construct(array('OptionName'=>$_optionName,'OptionSelectionDetails'=>$_optionSelectionDetails));\r\n\t}",
"public function __construct($selection)\n {\n $this->selection = $this->normalize($selection);\n }",
"static function &creer_VirtualDeviceConfigSpec(&$liste_option, $sort_en_erreur = false, $entete = __CLASS__) {\n\t\t\n\t\t$objet = new VirtualDeviceConfigSpec ( $sort_en_erreur, $entete );\n\t\t$objet->_initialise ( array (\n\t\t\t\t\"options\" => $liste_option \n\t\t) );\n\t\treturn $objet;\n\t}",
"protected function configureEntrySelection()\n {\n $sel = new \\dbfe\\SelectQuery();\n $sel->columns = [ 'primary_key', 'title_column', 'group_column', 'title_specifier' ];\n $sel->table_spec = 'primaryTable';\n $sel->order = [ ];\n return $sel;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter data by $filters $filters = array( filter => array( column => $name name of the column type => WHERE type of SQL condition (based on class FilterCondition condition types) datatype => TEXT|NUMERIC|DATE data type of the column (based on class FilterCondition filter types) SELECT and BOOLEAN filters are translated as TEXT filter with EQUAL( = ) condition cond => $condition SQL operator ( = , > , value for condition the filter value (text, %text, 50, ...) columnFunction => $function SQL function for use on column (DATE, ...) optional valueFunction => $function SQL function for use on value (DATE, ...) optional ) ) | public function filterData(array $filters): void; | [
"public function filterData(array $filters);",
"private function filters($Query = array(), $Filters = NULL) {\n\n if ($Filters != NULL){\n if (is_string($Filters)){\n $Query['filters'] = array(\n 'items' => array(\n 'primaryColumnFilter' => array(\n 'filterType' => 1,\n 'comparisonType' => 3,\n 'isEnabled' => true,\n 'trimDateTimeParameterToDate' => false,\n 'leftExpression' => array(\n 'expressionType' => 1,\n 'functionType' => 1,\n 'macrosType' => 34\n ),\n 'rightExpression' => array(\n 'expressionType' => 2,\n 'parameter' => array(\n 'dataValueType' => 0,\n 'value' => $Filters\n )\n )\n )\n ),\n 'logicalOperation' => 0,\n 'isEnabled' => true,\n 'filterType' => 6\n );\n }\n elseif (is_array($Filters)){\n if (isset($Filters['items'])){\n if (count($Filters['items']) > 0){\n if (isset($Filters['logicalOperation'])) {\n $LogicalOperatorType = $Filters['logicalOperation'];\n }\n else {\n // AND\n $LogicalOperatorType = 0;\n }\n $Query['filters'] = array (\n 'logicalOperation' => 0,\n 'isEnabled' => true,\n 'filterType' => 6,\n 'items' => array (\n 'CustomFilters' => array (\n 'logicalOperation' => $LogicalOperatorType,\n 'isEnabled' => true,\n 'filterType' => 6,\n 'items' => array (),\n )\n )\n );\n\n foreach ($Filters['items'] as $Column => $parameter) {\n // https://academy.bpmonline.com/api/jscoreapi/7.12.0/index.html?_ga=2.104770368.1168104844.1543204589-1794740920.1543204589#!/api/Terrasoft.core.enums.ComparisonType\n if (isset($parameter['comparisonType'])){\n $comparisonType = $parameter['comparisonType'];\n }\n else {\n // EQUAL\n $comparisonType = 3;\n }\n $Query['filters']['items']['CustomFilters']['items'] = array_merge(\n $Query['filters']['items']['CustomFilters']['items'],\n array(\n 'customFilter' . $Column . '_PHP' => array (\n 'filterType' => 1,\n 'comparisonType' => $comparisonType,\n 'isEnabled' => true,\n 'trimDateTimeParameterToDate' => false,\n 'leftExpression' => array (\n 'expressionType' => 0,\n 'columnPath' => $Column,\n ),\n 'rightExpression' => array (\n 'expressionType' => 2,\n 'parameter' => array (\n 'dataValueType' => $parameter['dataValueType'],\n 'value' => $parameter['value'],\n ),\n ),\n ),\n )\n );\n }\n }\n }\n elseif (isset($Filters['filters'])){\n $Query['filters'] = $Filters['filters'];\n }\n }\n }\n return $Query;\n }",
"public static function fetchFilteredEventDetails($filters) {\n \t$sql = self::fetchAllEventDetailsSql();\n\n \tforeach ($filters as $filter_type => $filter_values) {\n \t\t$table_name = '';\n \t\tswitch ($filter_type) {\n \t\t\tcase 'city':\n \t\t\t\t$sql .= ' AND (c1.`city_id` IN ('.implode(',', $filter_values).')\n \t\t\t\t\t\t OR c2.`city_id` IN ('.implode(',', $filter_values).')) ';\n \t\t\t\tbreak;\n\n \t\t\tcase 'event_type':\n \t\t\t\t$table_name = empty($table_name) ? 'event_types' : $table_name;\n \t\t\tcase 'terrain':\n \t\t\t\t$table_name = empty($table_name) ? 'terrains' : $table_name;\n \t\t\t\t$sql .= ' AND '. $table_name .'.'. $filter_type .'_id IN ('.implode(',', $filter_values).') ';\n \t\t\t\tbreak;\n \t\t\t\n \t\t\tcase 'distance':\n \t\t\tcase 'cost':\n \t\t\t\t$filter_type = $filter_type == 'cost' ? 'amount' : $filter_type;\n \t\t\t\t$total_filters = count($filter_values);\n \t\t\t\t$sql .= $total_filters > 0 ? ' AND (' : '';\n\n \t\t\t\t$index = 0;\n \t\t\t\tforeach ($filter_values as $filter_value) {\n \t\t\t\t\t$start_end_values = explode('-', $filter_value);\n\n \t\t\t\t\tif (count($start_end_values) == 2) {\n \t\t\t\t\t\t$start_end_values[0] = $filter_type == 'distance' ? $start_end_values[0] * 1000 : $start_end_values[0];\n \t\t\t\t\t\t$start_end_values[1] = ($filter_type == 'distance' && $start_end_values[1] != 'inf') ?\n \t\t\t\t\t\t\t\t\t\t\t\t$start_end_values[1] * 1000 : $start_end_values[1];\n\n \t\t\t\t\t\t$sql .= $index > 0 ? ' OR ' : '';\n \t\t\t\t\t\t$sql .= '(events.'.$filter_type.' >= ' . $start_end_values[0] . ' ';\n \t\t\t\t\t\tif ($start_end_values[1] != 'inf') {\n \t\t\t\t\t\t\t$sql .= ' AND events.'.$filter_type.' <= ' . $start_end_values[1] . ' ';\n \t\t\t\t\t\t}\n \t\t\t\t\t\t$sql .= ')';\n\t\t\t\t\t\t\t$index++;\n \t\t\t\t\t}\n \t\t\t\t}\n\n \t\t\t\t$sql .= $total_filters > 0 ? ')' : '';\n \t\t\t\tbreak;\n\n \t\t\tcase 'cycle_available':\n \t\t\t\t$filter_value = $filter_values[0] ?? -1;\n \t\t\t\tif ($filter_value != -1) {\n \t\t\t\t\t$sql .= ' AND '. $filter_type .' = '. $filter_value .' ';\n \t\t\t\t}\n \t\t\t\tbreak;\n \t\t}\n \t}\n\n \t$sql .= ' ORDER BY start_date ASC ';\n \t$events = DB::select($sql);\n \treturn $events;\n }",
"public static function buildSimpleFilters($filters_array, $filters)\n {\n $w = ' 1=1 ';\n foreach ($filters_array as $k => $v) {\n\n $v = self::prepareFilter($v);\n\n if (empty($v['table'])) continue;\n\n if (empty($v['field'])) $v['field'] = $k;\n\n $v = self::prepareFilter($v);\n\n $antiFilter = self::getAntiFilter($filters, $k);\n\n if($v['type'] == 'integer'){\n if (isset($filters[$k])){\n $w.= \" AND {$v['table']}.`{$v['field']}` = {$filters[$k]}\";\n }\n if (isset($filters[$k.'From'])){\n $w.= \" AND {$v['table']}.`{$v['field']}` >= {$filters[$k.'From']}\";\n }\n if (isset($filters[$k.'To'])){\n $w.= \" AND {$v['table']}.`{$v['field']}` <= {$filters[$k.'To']}\";\n }\n }\n elseif($v['type'] == 'daterange'){ //some filters not work with timestamp value, other do not work with date-time formatted filter!\n if (isset($filters[$k.'From'])){\n// $w.= \" AND {$v['table']}.`{$v['field']}` >= \".((new \\DateTime())->createFromFormat('Y-m-d H:i:s', $filters[$k.'From'])->getTimestamp());\n $w.= \" AND {$v['table']}.`{$v['field']}` >= '{$filters[$k.'From']}'\";\n }\n if (isset($filters[$k.'To'])){\n// $w.= \" AND {$v['table']}.`{$v['field']}` <= \".((new \\DateTime())->createFromFormat('Y-m-d H:i:s', $filters[$k.'To'])->getTimestamp());\n $w.= \" AND {$v['table']}.`{$v['field']}` <= '{$filters[$k.'To']}'\";\n }\n }\n elseif($v['type'] == 'timerange'){ //some filters not work with timestamp value, other do not work with date-time formatted filter!\n if (isset($filters[$k.'From'])){\n $w.= \" AND {$v['table']}.`{$v['field']}` >= \".((new \\DateTime())->createFromFormat('Y-m-d H:i:s', $filters[$k.'From'])->getTimestamp());\n }\n if (isset($filters[$k.'To'])){\n $w.= \" AND {$v['table']}.`{$v['field']}` <= \".((new \\DateTime())->createFromFormat('Y-m-d H:i:s', $filters[$k.'To'])->getTimestamp());\n }\n }\n elseif($v['type'] == 'multilist'){\n if (isset($filters[$k])) {\n if(!is_array($filters[$k])){\n $filters[$k] = explode(',', $filters[$k]);\n }\n $filters[$k] = implode('\\',\\'', $filters[$k]);\n if(!empty($v['uppercase'])){//TODO: add to QB version\n $filters[$k] = strtoupper($filters[$k]);\n $w .= \" AND UPPER({$v['table']}.`{$v['field']}`) {$antiFilter} IN ('{$filters[$k]}')\";\n }\n else{\n $w .= \" AND {$v['table']}.`{$v['field']}` {$antiFilter} IN ('{$filters[$k]}')\";\n }\n }\n }\n else{\n if (isset($filters[$k])) {\n $w .= \" AND {$v['table']}.`{$v['field']}` {$antiFilter} LIKE '{$filters[$k]}'\";\n }\n }\n }\n return $w;\n }",
"private function fetchByFilters($filters)\n {\n $sql = \"SELECT * FROM $this->tableName\" // Can use partial/empty title\n . \" WHERE $this->title LIKE :title\";\n foreach($filters as $attribute => $value) { // Associative attribute and value\n if($value) { // Ignore false/null/empty filters\n switch($attribute) {\n case 'genre':\n $sql .= $this->addGenreSQL($value);\n break;\n case 'director':\n $sql .= $this->addDirectorSQL($value);\n break;\n case 'actor':\n $sql .= $this->addActorSQL($value);\n break;\n case 'year_from':\n $sql .= \" AND $this->yearOfRelease >= $value\";\n break;\n case 'year_to':\n $sql .= \" AND $this->yearOfRelease <= $value\";\n break;\n case 'price':\n $sql .= \" AND $this->priceBand = $value\";\n break;\n default: // Do nothing if key not recognised\n break;\n }\n }\n }\n $results = $this->dbh->prepare($sql);\n $results->execute([':title' => '%' . $filters[$this->title] . '%']);\n return $results;\n }",
"public static function buildFilterSQL($filters)\n {\n $columns = Symphony::Database()->fetch('DESCRIBE `tbl_tracker_activity`');\n foreach($columns as $key => $column) {\n $columns[$key] = $column['Field'];\n }\n\n $filter_sql = '';\n\n // If we've got a $filters array, let's build the SQL\n // TODO: I imagine this can be made more elegant\n if (!empty($filters) && is_array($filters)) {\n $filter_sql .= ' WHERE ';\n $i = 0;\n\n // Iterate over the field filters\n foreach($filters as $field => $options) {\n\n // Prevent fatal error when filter field doesn't exist\n if (!in_array($field,$columns)) { return; }\n\n // If there's more than one field filter\n if ($i > 0) {\n $filter_sql .= ' AND ';\n }\n\n // Allow custom SQL by passing a string\n // TODO: Is this a security concern?\n if (!is_array($options)) {\n $filter_sql .= '`' . $field . '` ' . $options . ' ';\n }\n\n // Iterate over the filter values and group them with OR\n else {\n foreach($options as $num => $option) {\n if ($num == 0 && count($options) > 1) {\n $filter_sql .= ' (';\n }\n if ($num > 0) {\n $filter_sql .= ' OR ';\n }\n $filter_sql .= '`' . $field . '` = \"' . $option . '\"';\n if (count($options) > 1 && $option == end($options)) {\n $filter_sql .= ')';\n }\n }\n }\n $i++;\n }\n }\n\n return $filter_sql;\n }",
"protected function build_where_clause( Filters $filters ) {\n\t\t$where = [];\n\t\t$prepare = [];\n\n\t\tif ( ( $after_cursor = $filters->get_after_cursor() ) && $after_cursor->get_last_date() ) {\n\t\t\t$where[] = '(created_at, id) > (%s, %d)';\n\t\t\t$prepare[] = $after_cursor->get_last_date()->format( 'Y-m-d H:i:s' );\n\t\t\t$prepare[] = $after_cursor->get_last_id();\n\t\t}\n\n\t\tif ( ( $before_cursor = $filters->get_before_cursor() ) && $before_cursor->get_last_date() ) {\n\t\t\t$where[] = '(created_at, id) < (%s, %d)';\n\t\t\t$prepare[] = $before_cursor->get_last_date()->format( 'Y-m-d H:i:s' );\n\t\t\t$prepare[] = $before_cursor->get_last_id();\n\t\t}\n\n\t\tif ( $actor_type = $filters->get_actor_type() ) {\n\t\t\t$where[] = 'actor_type = %s';\n\t\t\t$prepare[] = $actor_type;\n\t\t}\n\n\t\tif ( $actor_id = $filters->get_actor_identifier() ) {\n\t\t\t$where[] = 'actor_id = %s';\n\t\t\t$prepare[] = $actor_id;\n\t\t}\n\n\t\tif ( $comment = $filters->get_search() ) {\n\t\t\t$like = '%' . $this->wpdb->esc_like( $comment ) . '%';\n\t\t\t$where[] = '( comment LIKE %s OR host LIKE %s )';\n\t\t\t$prepare[] = $like;\n\t\t\t$prepare[] = $like;\n\t\t}\n\n\t\tif ( $created_after = $filters->get_created_after() ) {\n\t\t\t$where[] = 'created_at > %s';\n\t\t\t$prepare[] = $created_after->format( 'Y-m-d H:i:s' );\n\t\t}\n\n\t\tif ( $created_before = $filters->get_created_before() ) {\n\t\t\t$where[] = 'created_at < %s';\n\t\t\t$prepare[] = $created_before->format( 'Y-m-d H:i:s' );\n\t\t}\n\n\t\treturn [ $where, $prepare ];\n\t}",
"private function filter() {\n $globalSearch = array();\n $havingSearch = array();\n $columnSearch = array();\n $dtColumns = self::pluck($this->columns, 'dt');\n\n if (isset($this->request['search']) && $this->request['search']['value'] != '') {\n $str = $this->request['search']['value'];\n\n for ($i = 0, $ien = count($this->request['columns']); $i < $ien; $i++) {\n $requestColumn = $this->request['columns'][$i];\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\n $column = $this->columns[$columnIdx];\n\n if ($requestColumn['searchable'] == 'true') {\n if(strpos($column['db'], \"GROUP_CONCAT\") !== false){\n $havingSearch[] = $column['db'] . \" LIKE '%$str%'\";\n }else{\n $globalSearch[] = $column['db'] . \" LIKE '%$str%'\";\n }\n }\n }\n }\n\n // Individual column filtering\n if(isset($this->request['columns'])){\n for ($i = 0, $ien = count($this->request['columns']); $i < $ien; $i++) {\n $requestColumn = $this->request['columns'][$i];\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\n $column = $this->columns[$columnIdx];\n \n $str = $requestColumn['search']['value'];\n \n if ($requestColumn['searchable'] == 'true' && $str != '') {\n if( !(strpos($column['db'], \"GROUP_CONCAT\") !== false) ){\n $columnSearch[] = $column['db'] . \" LIKE '%$str%'\";\n }\n }\n }\n }\n \n\n // Combine the filters into a single string\n $where = '';\n $having = '';\n \n if (count($globalSearch)) {\n $where = '(' . implode(' OR ', $globalSearch) . ')';\n }\n if (count($havingSearch)) {\n $having = '(' . implode(' OR ', $havingSearch) . ')';\n }\n\n if (count($columnSearch)) {\n $where = $where === '' ?\n implode(' AND ', $columnSearch) :\n $where . ' AND ' . implode(' AND ', $columnSearch);\n }\n\n if ($where !== '') {\n $this->query->andWhere($where);\n }\n if ($having !== '') {\n /*\n * @ToDo \n * There is some bugs when you use GROUP_CONCAT function\n **/\n //$this->query->having($having);\n }\n }",
"public function applyFilter($criteria, $filters)\n {\n foreach ($filters as $filter => $value) {\n switch ($filter) {\n case \"state\":\n $criteria->with[] = 'state';\n $criteria->compare('state.slug', $value, true);\n break;\n\n case \"body\":\n $criteria->with[] = 'bodyType';\n $criteria->addCondition('(bodyType.id = :bodyTypeID OR bodyType.title LIKE :bodyTypeTitle)');\n $criteria->params[':bodyTypeID'] = urldecode($value);\n $criteria->params[':bodyTypeTitle'] = str_replace('-', ' ', urldecode($value));\n break;\n\n case \"car_type\":\n $criteria->addCondition('car.car_type_id = :carTypeID');\n $criteria->params[':carTypeID'] = $value;\n break;\n\n case \"gearbox\":\n $criteria->addCondition('car.gearbox_id = :gearboxID');\n $criteria->params[':gearboxID'] = $value;\n break;\n\n case \"body_state\":\n $criteria->addCondition('car.body_state_id = :bodyStateID');\n $criteria->params[':bodyStateID'] = $value;\n break;\n\n case \"fuel\":\n $criteria->addCondition('car.fuel_id = :fuelID');\n $criteria->params[':fuelID'] = $value;\n break;\n\n case \"plate\":\n $criteria->with[] = 'plateType';\n $criteria->addCondition('(plateType.id = :plateTypeID OR plateType.title LIKE :plateTypeTitle)');\n $criteria->params[':plateTypeID'] = urldecode($value);\n $criteria->params[':plateTypeTitle'] = str_replace('-', ' ', urldecode($value));\n break;\n\n case \"color\":\n $criteria->addCondition('car.body_color_id = :bodyColorID');\n $criteria->params[':bodyColorID'] = $value;\n break;\n\n case \"model\":\n $criteria->with[] = 'model';\n $criteria->compare('model.slug', $value, true);\n break;\n\n case \"price\":\n $prices = explode('-', $value);\n $criteria->compare('car.purchase_type_id', Cars::PURCHASE_TYPE_CASH, false);\n $criteria->addBetweenCondition('car.purchase_details', $prices[0] * 1000000, $prices[1] * 1000000);\n break;\n }\n }\n $criteria->order = \"car.update_date DESC\";\n return $criteria;\n }",
"protected function get_filters_sql_and_params() {\n global $DB;\n\n $filter = 'id IS NOT NULL';\n $params = array();\n\n if (!empty($this->filters->runid)) {\n $filter .= ' AND runid = :runid';\n $params['runid'] = $this->filters->runid;\n }\n\n if (!empty($this->filters->taskid)) {\n $filter .= ' AND taskid = :taskid';\n $params['taskid'] = $this->filters->taskid;\n }\n\n if (!empty($this->filters->logtype)) {\n $list = explode(',', $this->filters->logtype);\n list($insql, $plist) = $DB->get_in_or_equal($list, SQL_PARAMS_NAMED);\n $filter .= \" AND logtype $insql\";\n $params += $plist;\n }\n\n if (!empty($this->filters->element)) {\n $filter .= ' AND element = :element';\n $params['element'] = $this->filters->element;\n }\n\n if (!empty($this->filters->action)) {\n $filter .= ' AND action = :action';\n $params['action'] = $this->filters->action;\n }\n\n if (!empty($this->filters->datefrom)) {\n $filter .= \" AND time >= :datefrom\";\n $params += array('datefrom' => $this->filters->datefrom);\n }\n if (!empty($this->filters->datetill)) {\n $filter .= \" AND time <= :datetill\";\n $params += array('datetill' => $this->filters->datetill);\n }\n\n return array($filter, $params);\n }",
"public function getSalesByFilters(array $filters)\n {\n $sql = \"SELECT\n customers.name customerName,\n mail,\n products.name productName,\n price,\n version,\n sales.created_at\n FROM sales \n left JOIN products ON product_id = products.id\n left JOIN customers ON customer_id = customers.id\n WHERE customers.name LIKE '%\" . $filters['customerName'] . \"%'\n AND products.name LIKE '%\" . $filters['productName'] . \"%'\";\n\n if ($filters['productPrice'] !== '')\n $sql .= \" AND products.price = \" . $filters['productPrice'];\n\n $this->db->query($sql);\n\n return $this->db->resultSet();\n }",
"public function SetFilters($filters) {$this->filters = $filters;}",
"public function prepare_filters($filtersinputsource = null) {\n\n if (is_null($filtersinputsource)) {\n $filtersinputsource = $_GET;\n }\n\n // Capture filters values in input.\n $filterclause = '';\n $filterkeys = preg_grep('/^filter'.$this->instance->id.'_/', array_keys($filtersinputsource));\n $globalfilterkeys = preg_grep('/^filter0_/', array_keys($filtersinputsource));\n $filters = array();\n $filterinputs = array();\n\n foreach ($filterkeys as $key) {\n $filterinputs[$key] = clean_param($filtersinputsource[$key], PARAM_TEXT);\n }\n\n foreach ($globalfilterkeys as $key) {\n $radical = str_replace('filter0_', '', $key);\n $cond = array_key_exists($radical, $this->filterfields->translations);\n $canonicalfilter = ($cond) ? $this->filterfields->translations[$radical] : $radical;\n if ($this->is_filter_global($canonicalfilter)) {\n $filterinputs[$key] = clean_param($filtersinputsource[$key], PARAM_TEXT);\n }\n }\n\n // Recombine filter values into a filtering querystring segment.\n $filterquerystringelms = array();\n foreach ($filterinputs as $key => $value) {\n if (is_array($value)) {\n foreach ($value as $v) {\n $filterquerystringelms[] = \"{$key}=\".urlencode($v);\n }\n } else {\n $filterquerystringelms[] = \"{$key}=\".urlencode($value);\n }\n }\n $filterquerystring = implode('&', $filterquerystringelms);\n\n // Process defaults if setup, faking $filtersinputsource input but not when reporting all data!\n $alldata = optional_param('alldata', 0, PARAM_BOOL);\n if (!empty($this->filterfields->defaults) && !$alldata) {\n foreach ($this->filterfields->defaults as $filter => $default) {\n $cond = array_key_exists($filter, $this->filterfields->translations);\n $canonicalfilter = ($cond) ? $this->filterfields->translations[$filter] : $filter;\n $voidstr = null;\n $default = (preg_match('/LAST|FIRST/i', $default)) ? $this->filter_get_results($filter, $canonicalfilter, $default, false, $voidstr /* no print out */) : $default ;\n\n if ($this->is_filter_global($filter)) {\n if (!array_key_exists('filter0_'.$canonicalfilter, $filterinputs)) {\n $filterinputs['filter0_'.$canonicalfilter] = $default;\n }\n } else {\n if (!array_key_exists('filter'.$this->instance->id.'_'.$canonicalfilter, $filterinputs)) {\n $filterinputs['filter'.$this->instance->id.'_'.$canonicalfilter] = $default;\n }\n }\n }\n }\n\n if (!empty($filterinputs)) {\n foreach ($filterinputs as $key => $value) {\n\n if ($value == '*') {\n // Strip out catch all options.\n continue;\n }\n\n $radical = preg_replace('/filter\\d+_/','', $key);\n $cond = isset($this->filterfields->filtercanonicalfield[$radical]);\n $sqlfiltername = ($cond) ? $this->filterfields->filtercanonicalfield[$radical] : $radical;\n if ($value !== '' && !is_null($value)) {\n if (!is_array($value)) {\n $filters[] = \" $sqlfiltername = '\".str_replace(\"'\", \"''\", $value).\"' \";\n } else {\n if (count($value) >= 1 || $value[0] != 0) {\n $filters[] = \" $sqlfiltername IN ('\".implode(\"','\", str_replace(\"'\", \"''\", $value)).\"') \";\n }\n }\n $this->filtervalues[$radical] = $value;\n }\n }\n }\n\n // Build filtering SQL clause and insert it at placeholder.\n if (!preg_match('/\\bWHERE\\b/si', $this->sql)) {\n $filterclause = ' WHERE 1=1 ';\n }\n if (!empty($filters)) {\n $filterclause .= ' AND '. implode('AND', $filters);\n }\n\n $this->filteredsql = str_replace('<%%FILTERS%%>', $filterclause, $this->sql);\n\n return $filterquerystring;\n }",
"public function filter($dataSet)\r\n {\r\n if (null == $dataSet) {\r\n $dataSet = $this->dataSet;\r\n }\r\n if (null == $dataSet || !is_array($dataSet)) {\r\n require_once 'Zend/Filter/Exception.php';\r\n throw new Zend_Filter_Exception('A data set to filter is required, and must be an array');\r\n }\r\n\r\n foreach ($this->_filterTable as $row) {\r\n\r\n // If we have a normal, plain literal field name...\r\n if (is_string($row['fieldSpec']) && !($row['flags'] & self::PATTERN)) {\r\n\r\n // Filter the specific field\r\n $field = $row['fieldSpec'];\r\n\r\n // If the given field does not exist, we're not going to try to \r\n // filter it.\r\n if (isset($dataSet[$field])) {\r\n $dataSet[$field] = $row['filter']->filter($dataSet[$field]);\r\n }\r\n\r\n // If we have a field name pattern...\r\n } else if (is_string($row['fieldSpec']) && $row['flags'] & self::PATTERN) {\r\n\r\n // Filter each matching field\r\n foreach ($dataSet as $field => $value) {\r\n if (isset($dataSet[$field]) &&\r\n 1 == preg_match($row['fieldSpec'], $field)) {\r\n $dataSet[$field] = $row['filter']->filter($dataSet[$field]);\r\n }\r\n }\r\n\r\n // If we have an array of fields to filter individually...\r\n } else if (is_array($row['fieldSpec'])) {\r\n\r\n // Filter each given field name\r\n foreach ($row['fieldSpec'] as $field) {\r\n\r\n // If the given field does not exist, we're not going to try \r\n // to filter it.\r\n if (isset($dataSet[$field])) {\r\n $dataSet[$field] = $row['filter']->filter($dataSet[$field]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return $dataSet;\r\n }",
"public function testFiltersComplex()\n {\n $db = \\db::getSingleton();\n $filters = [\n 'field1' => 'value1',\n 'fx' => null,\n 'f1' => [1, 2, 3]\n ];\n \n // the test\n list($sql, $aParams) = $db->filters($filters);\n \n // asserts\n $this->assertEquals(\" 1=1 AND field1 = $1 AND fx IS NULL AND f1 IN ($2,$3,$4) \", $sql);\n $this->assertCount(4, $aParams);\n $this->assertEquals('value1', $aParams[0]);\n $this->assertEquals(1, $aParams[1]);\n $this->assertEquals(2, $aParams[2]);\n $this->assertEquals(3, $aParams[3]);\n }",
"public function applyFilters($filters) {\n foreach($filters as $filter) {\n $key = key($filters);\n \n switch ($key) {\n case 'order_by':\n $filter_key = key($filter);\n $this->db->order_by($filter_key, $filter[$filter_key]);\n break;\n \n default:\n $this->db->{$key}($filter);\n break;\n }\n\n next($filters);\n }\n }",
"protected function _buildWhere(array $filter_data = array())\n {\n $where = \"1\";\n\t\t\n\t\t//Price\n\t\tif( isset($filter_data['price_1']) && $filter_data['price_1'] )\n\t\t{\n\t\t\t$where .= \" AND {$this->c_table}.price >= \".(float)($filter_data['price_1']);\n\t\t}\n\t\tif( isset($filter_data['price_2']) && $filter_data['price_2'] )\n\t\t{\n\t\t\t$where .= \" AND {$this->c_table}.price <= \".(float)($filter_data['price_2']);\n\t\t}\n\t\t\n\t\t//Business lunch\n\t\tif( isset($filter_data['business_lunch']) && $filter_data['business_lunch'] )\n\t\t{\n\t\t\t$where .= \" AND {$this->c_table}.business_lunch=1\";\n\t\t}\n\t\t\n\t\t//With photo\n\t\tif( isset($filter_data['with_photo']) && $filter_data['with_photo'] )\n\t\t{\n\t\t\t$where .= \" AND {$this->c_table}.photo1 != ''\";\n\t\t}\n\t\t\n\t\t//Possible activities in the restaurant\n\t\tif( isset($filter_data['possible_activities']) && !empty($filter_data['possible_activities']) )\n\t\t{\n\t\t\t$where .= $this->_buildOrWhereForArray('possible_activities',$filter_data['possible_activities']);\n\t\t}\n\t\t\n\t\t//Cuisine\n\t\tif( isset($filter_data['cuisine']) && !empty($filter_data['cuisine']) )\n\t\t{\n\t\t\t$where .= $this->_buildOrWhereForArray('cuisine',$filter_data['cuisine']);\n\t\t}\n \n\t\treturn $where;\n }",
"function get_sparql_filters($filters){\n\tif(count($filters) > 0){\n\t\t\tforeach ($filters as $filter){\n\t\t\t\t$filter = str_replace(\"And\",\"&\",$filter);\n\t\t\t\t$explode = explode(\",\",$filter);\n\t\t\t\t\n\t\t\t\t$value = str_replace(\"And\",\"&\",base64_decode($explode[1]));\n\t\t\t\t\n\t\t\t\tif(eregi(\":\",$value) && !eregi(\"http://\",$value))\n\t\t\t\t\t$filtrosql .= \"?a $explode[0] $value .\";\n\t\t\t\telseif(eregi(\"http://\",$value))\n\t\t\t\t\t$filtrosql .= \"?a $explode[0] <$value> .\";\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\t$filtrosql .= \"?a $explode[0] \\\"$value\\\" .\";\t\t\n\t\t\t}\n\t}\n\treturn $filtrosql;\n}",
"function setFieldsFiltering($filter_fields_array = \"\"){\n $req_selSearchType = $this->getVariable('_ff_selSearchType');\n $req_onSUBMIT_FILTER = $this->getVariable('_ff_onSUBMIT_FILTER');\n \n if(is_array($filter_fields_array)){\n foreach($filter_fields_array as $fldName => $fldValue){\n $this->filter_fields[$fldName] = $fldValue;\n } \n if($req_onSUBMIT_FILTER != \"\"){\n $search_type_start = \"AND\";\n if($req_selSearchType == \"0\"){\n $search_type = \"AND\"; \n }else{\n $search_type = \"OR\";\n }\n if(!substr_count(strtolower($this->sql_view), \"where\")) $this->sql_view .= \" WHERE 1=1 \";\n foreach($filter_fields_array as $fldName => $fldValue){\n $table_field_name=\"\"; \n $table_field_name = $fldValue['table'].\"_\".$fldValue['field'];\n if(isset($_REQUEST[$this->unique_prefix.\"_ff_\".$table_field_name]) && trim($_REQUEST[$this->unique_prefix.\"_ff_\".$table_field_name]) !== \"\"){ \n $filter_field_operator = $table_field_name.\"_operator\"; \n if(isset($fldValue['case_sensitive']) && ($fldValue['case_sensitive'] != true)){\n $fldTableField = $this->getLcaseFooByDbType().\"(\".(($fldValue['table'] != \"\") ? $fldValue['table'].\".\" : \"\" ).$fldValue['field'].\")\";\n $fldTableFieldName = strtolower($_REQUEST[$this->unique_prefix.\"_ff_\".$table_field_name]);\n }else{\n $fldTableField = (($fldValue['table'] != \"\") ? $fldValue['table'].\".\" : \"\" ).$fldValue['field']; \n $fldTableFieldName = $_REQUEST[$this->unique_prefix.\"_ff_\".$table_field_name];\n }\n if(isset($fldValue['comparison_type']) && (strtolower($fldValue['comparison_type']) == \"numeric\")){\n $left_geresh =\"\"; \n }else{\n $left_geresh =\"'\"; \n } \n if(isset($_REQUEST[$this->unique_prefix.\"_ff_\".$filter_field_operator])){ \n if(isset($fldValue['comparison_type']) && (strtolower($fldValue['comparison_type']) == \"binary\")) $comparison_type = \"BINARY\";\n else $comparison_type =\"\";\n if($_REQUEST[$this->unique_prefix.\"_ff_\".$filter_field_operator] == \"like\"){\n $this->sql_view .= \" $search_type_start $fldTableField \".$_REQUEST[$this->unique_prefix.\"_ff_\".$filter_field_operator].\" \".$comparison_type.\" '%\".$fldTableFieldName.\"%'\";\n }else if($_REQUEST[$this->unique_prefix.\"_ff_\".$filter_field_operator] == \"like%\"){\n $this->sql_view .= \" $search_type_start $fldTableField \".substr($_REQUEST[$this->unique_prefix.\"_ff_\".$filter_field_operator], 0, 4).\" \".$comparison_type.\" '\".$fldTableFieldName.\"%'\";\n }else if($_REQUEST[$this->unique_prefix.\"_ff_\".$filter_field_operator] == \"%like\"){\n $this->sql_view .= \" $search_type_start $fldTableField \".substr($_REQUEST[$this->unique_prefix.\"_ff_\".$filter_field_operator], 1, 4).\" \".$comparison_type.\" '%\".$fldTableFieldName.\"'\";\n }else{\n $this->sql_view .= \" $search_type_start $fldTableField \".$_REQUEST[$this->unique_prefix.\"_ff_\".$filter_field_operator].\" $left_geresh\".$fldTableFieldName.\"$left_geresh \";\n }\n }else{\n $this->sql_view .= \" $search_type_start $fldTableField = $left_geresh\".$fldTableFieldName.\"$left_geresh \"; \n } \n if($search_type_start !== $search_type){ $search_type_start = $search_type; }\n }\n }\n $this->dataSource($this->db_handler, $this->sql_view);\n }\n } \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a corrispondance table between action_n and numbers. | public function anumbers(){
$sql = "SELECT action_n, number FROM action";
$mat = $this->vmsql->get($sql);
$mat2 = array();
foreach($mat as $a){
$mat2[$a['action_n']]= $a['number'];
}
return $mat2;
} | [
"private function make_table_numbers()\n {\n $div1 = '';\n $div2 = '';\n $div3 = '';\n $div4 = '';\n $div5 = '';\n $div6 = '';\n\n /**\n * Arrays with the items we want to present from corresponding tables.\n */\n $q_lines = array(\n 'activedays' => 'Active Days',\n 'l_total' => 'Lines',\n 'words' => 'Words',\n 'characters' => 'Characters',\n 'exclamations' => 'Exclamations',\n 'questions' => 'Questions',\n 'uppercased' => 'UPPERCASED Lines',\n 'monologues' => 'Monologues',\n 'topmonologue' => 'Longest Monologue',\n 'actions' => 'Actions Performed',\n 'slaps' => 'Slaps Given',\n 'slapped' => 'Slaps Received',\n 'urls' => 'URLs');\n\n $q_events = array(\n 'm_op' => 'Ops \\'+o\\' Given',\n 'm_opped' => 'Ops \\'+o\\' Received',\n 'm_deop' => 'deOps \\'-o\\' Given',\n 'm_deopped' => 'deOps \\'-o\\' Received',\n 'm_voice' => 'Voices \\'+v\\' Given',\n 'm_voiced' => 'Voices \\'+v\\' Received',\n 'm_devoice' => 'deVoices \\'-v\\' Given',\n 'm_devoiced' => 'deVoices \\'-v\\' Received',\n 'joins' => 'Channel Joins',\n 'parts' => 'Channel Parts',\n 'quits' => 'IRC Quits',\n 'kicks' => 'Kicks Given',\n 'kicked' => 'Kicks Received',\n 'nickchanges' => 'Nick Changes',\n 'topics' => 'Topics Set');\n\n $q_smileys = array(\n 's_01' => ':)',\n 's_02' => ';)',\n 's_03' => ':(',\n 's_04' => ':P',\n 's_05' => ':D',\n 's_06' => ';(',\n 's_07' => ':/',\n 's_08' => '\\\\o/',\n 's_09' => ':))',\n 's_10' => '<3',\n 's_11' => ':o',\n 's_12' => '=)',\n 's_13' => ':-)',\n 's_14' => ':x',\n 's_15' => ':\\\\',\n 's_16' => 'D:',\n 's_17' => ':|',\n 's_18' => ';-)',\n 's_19' => ';P',\n 's_20' => '=]',\n 's_21' => ':3',\n 's_22' => '8)',\n 's_23' => ':<',\n 's_24' => ':>',\n 's_25' => '=P',\n 's_26' => ';x',\n 's_27' => ':-D',\n 's_28' => ';))',\n 's_29' => ':]',\n 's_30' => ';D',\n 's_31' => '-_-',\n 's_32' => ':S',\n 's_33' => '=/',\n 's_34' => '=\\\\',\n 's_35' => ':((',\n 's_36' => '=D',\n 's_37' => ':-/',\n 's_38' => ':-P',\n 's_39' => ';_;',\n 's_40' => ';/',\n 's_41' => ';]',\n 's_42' => ':-(',\n 's_43' => ':\\'(',\n 's_44' => '=(',\n 's_45' => '-.-',\n 's_46' => ';((',\n 's_47' => '=X',\n 's_48' => ':[',\n 's_49' => '>:(',\n 's_50' => ';o');\n\n /**\n * Retrieve all items and fill the divs.\n */\n $smileys = 0;\n $tables = array('q_lines', 'q_events', 'q_smileys');\n\n foreach ($tables as $table) {\n $query = @mysqli_query($this->mysqli, 'select * from `'.$table.'` where `ruid` = '.$this->ruid) or $this->output('critical', 'mysqli: '.mysqli_error($this->mysqli));\n $rows = mysqli_num_rows($query);\n\n if (!empty($rows)) {\n $result = mysqli_fetch_object($query);\n\n foreach (${$table} as $key => $fullkey) {\n if (!empty($result->$key)) {\n if ($table == 'q_smileys') {\n $stats[htmlspecialchars($fullkey)] = (int) $result->$key;\n $smileys += (int) $result->$key;\n } else {\n $stats[$fullkey] = (int) $result->$key;\n }\n }\n }\n }\n }\n\n if ($smileys != 0) {\n $stats['Smileys'] = $smileys;\n }\n\n arsort($stats);\n $maxrows = ceil(count($stats) / 3);\n $current_column = 1;\n $current_row = 1;\n\n foreach ($stats as $fullkey => $value) {\n if ($current_row > $maxrows) {\n $current_column += 2;\n $current_row = 1;\n }\n\n ${'div'.$current_column} .= number_format($value).'<br />';\n ${'div'.($current_column + 1)} .= $fullkey.'<br />';\n $current_row++;\n }\n\n return '<div class=\"odd\">'.substr($div1, 0, -6).'</div><div class=\"even\">'.substr($div2, 0, -6).'</div><div class=\"odd\">'.substr($div3, 0, -6).'</div><div class=\"even\">'.substr($div4, 0, -6).'</div><div class=\"odd\">'.substr($div5, 0, -6).'</div><div class=\"even\">'.substr($div6, 0, -6).'</div>'.\"\\n\";\n }",
"private function createTable($source, $target)\n {\n $last = count($target) - 1;\n $size = (int) log(count($source), count($target));\n $number = array_fill(0, $size, $target[0]);\n $next = array_fill(0, $size, 0);\n $limit = count($source);\n $table = [$source[0] => implode('', $number)];\n\n for ($i = 1; $i < $limit; $i++) {\n for ($j = $size - 1; $next[$j] === $last; $j--) {\n $number[$j] = $target[0];\n $next[$j] = 0;\n }\n\n $number[$j] = $target[++$next[$j]];\n $table[$source[$i]] = implode('', $number);\n }\n\n return $table;\n }",
"abstract public function generate($tabulations);",
"private function createInteractionTable($interactions, $id_dataset)\n {\n $thead = array\n (\n 'edit' => 'Edit', 'delete' => 'Delete', 'id' => 'ID', 'name' => 'Molecule', 'charge' => 'Q', 'LogP' => 'LogP', 'LogK' => 'LogK',\n 'Position' => 'X_min', 'Penetration' => 'G_pen', 'Water' => 'G_wat', 'LogPerm' => 'LogPerm', 'theta' => 'Theta', 'abs_wl' => 'abs_wl', 'fluo_wl' => 'fluo_wl',\n 'QY' => 'QY', 'lt' => 'lt'\n );\n $hidden = array();\n\n foreach ($interactions as $i) \n {\n $i->name = $i->substance->name;\n\n foreach ($thead as $key => $v) \n {\n if (in_array($key, array('edit','delete')))\n {\n continue;\n }\n\n if (($i->$key === NULL || $i->$key == \"NULL\" || $i->$key == '') && (!isset($hidden[$key]) || $hidden[$key] == 0))\n {\n $hidden[$key] = 0;\n }\n else\n {\n $hidden[$key] = 1;\n }\n }\n }\n\n\n $table = '<table class=\"dataset-table\"><thead><tr>';\n\n foreach ($thead as $key => $h) \n {\n if (isset($hidden[$key]) && $hidden[$key] == 0)\n continue;\n $table .= '<td>' . $h . '</td>';\n }\n\n $table .= '</tr></thead><tbody>';\n\n foreach ($interactions as $i) \n {\n $table .= '<tr id=\"' . $i->id . '\">';\n foreach ($thead as $key => $v) \n {\n if (($key !== 'edit' && $key !== 'delete'))\n if ($hidden[$key] == 0)\n continue;\n if ($v == 'Edit')\n $table .= '<td onclick=\"modal_editor(\\'' . $i->id . '\\')\"><span class=\"glyphicon glyphicon-pencil\"></span></td>';\n\n else if ($v == 'Delete')\n $table .= '<td onclick=\"delete_interaction(\\'' . $id_dataset . '\\',\\'' . $i->id . '\\')\"><span style=\"color:red;\" class=\"glyphicon glyphicon-remove\"></span></td>';\n\n else\n $table .= '<td>' . $i->$key . '</td>';\n }\n\n $table .= '</tr>';\n }\n\n $table .= '</tbody></table>';\n \n return $table;\n }",
"function gen_successors($n) {\n\n\tglobal $M, $C;\n\t$new_states = array();\n\t$boat = $n['b'] ? 0 : 1;\n\n\t\t// Move 1C>\n\t\tif($n['b'] == 1 && $n['c'] > 0) {\n\t\t\t$new_states[] =\n\t\t\t\tarray(\n\t\t\t\t\t'p' => $n,\n\t\t\t\t\t'm' => $n['m'],\n\t\t\t\t\t'c' => $n['c']-1,\n\t\t\t\t\t'b' => $boat,\n\t\t\t\t\t'a' => \"Moved 1 Cannibal Right\"\n\t\t\t\t);\n\t\t}\n\n\t\t// Move 2C>\n\t\tif($n['b'] == 1 && $n['c'] > 1) {\n\t\t\t$new_states[] =\n\t\t\t\tarray(\n\t\t\t\t\t'p' => $n,\n\t\t\t\t\t'm' => $n['m'],\n\t\t\t\t\t'c' => $n['c']-2,\n\t\t\t\t\t'b' => $boat,\n\t\t\t\t\t'a' => \"Moved 2 Cannibals Right\"\n\t\t\t\t);\n\t\t}\n\n\t\t// Move 1C<\n\t\tif($n['b'] == 0 && $n['c'] < $C) {\n\t\t\t$new_states[] =\n\t\t\t\tarray(\n\t\t\t\t\t'p' => $n,\n\t\t\t\t\t'm' => $n['m'],\n\t\t\t\t\t'c' => $n['c']+1,\n\t\t\t\t\t'b' => $boat,\n\t\t\t\t\t'a' => \"Moved 1 Cannibal Left\"\n\t\t\t\t);\n\t\t}\n\n\t\t// Move 2C<\n\t\tif($n['b'] == 0 && $n['c'] < ($C-1)) {\n\t\t\t$new_states[] =\n\t\t\t\tarray(\n\t\t\t\t\t'p' => $n,\n\t\t\t\t\t'm' => $n['m'],\n\t\t\t\t\t'c' => $n['c']+2,\n\t\t\t\t\t'b' => $boat,\n\t\t\t\t\t'a' => \"Moved 2 Cannibals Left\"\n\t\t\t\t);\n\t\t}\n\n\t\t// Move 1M>\n\t\tif($n['b'] == 1 && $n['m'] > 0) {\n\t\t\t$new_states[] =\n\t\t\t\tarray(\n\t\t\t\t\t'p' => $n,\n\t\t\t\t\t'm' => $n['m']-1,\n\t\t\t\t\t'c' => $n['c'],\n\t\t\t\t\t'b' => $boat,\n\t\t\t\t\t'a' => \"Moved 1 Missionary Right\"\n\t\t\t\t);\n\t\t}\n\n\t\t// Move 2M>\n\t\tif($n['b'] == 1 && $n['m'] > 1) {\n\t\t\t$new_states[] =\n\t\t\t\tarray(\n\t\t\t\t\t'p' => $n,\n\t\t\t\t\t'm' => $n['m']-2,\n\t\t\t\t\t'c' => $n['c'],\n\t\t\t\t\t'b' => $boat,\n\t\t\t\t\t'a' => \"Moved 2 Missionaries Right\"\n\t\t\t\t);\n\t\t}\n\n\t\t// Move 1M<\n\t\tif($n['b'] == 0 && $n['m'] < $M) {\n\t\t\t$new_states[] =\n\t\t\t\tarray(\n\t\t\t\t\t'p' => $n,\n\t\t\t\t\t'm' => $n['m']+1,\n\t\t\t\t\t'c' => $n['c'],\n\t\t\t\t\t'b' => $boat,\n\t\t\t\t\t'a' => \"Moved 1 Missionary Left\"\n\t\t\t\t);\n\t\t}\n\n\t\t// Move 2M<\n\t\tif($n['b'] == 0 && $n['m'] < ($M-1)) {\n\t\t\t$new_states[] =\n\t\t\t\tarray(\n\t\t\t\t\t'p' => $n,\n\t\t\t\t\t'm' => $n['m']+2,\n\t\t\t\t\t'c' => $n['c'],\n\t\t\t\t\t'b' => $boat,\n\t\t\t\t\t'a' => \"Moved 2 Missionaries Left\"\n\t\t\t\t);\n\t\t}\n\n\t\t// Move 1M1C>\n\t\tif($n['b'] == 1 && $n['m'] > 0 && $n['c'] > 0) {\n\t\t\t$new_states[] =\n\t\t\t\tarray(\n\t\t\t\t\t'p' => $n,\n\t\t\t\t\t'm' => $n['m']-1,\n\t\t\t\t\t'c' => $n['c']-1,\n\t\t\t\t\t'b' => $boat,\n\t\t\t\t\t'a' => \"Moved 1 M. and 1 C. Right\"\n\t\t\t\t);\n\t\t}\n\n\t\t// Move 1M1C<\n\t\tif($n['b'] == 0 && $n['m'] < $M && $n['c'] < $C) {\n\t\t\t$new_states[] =\n\t\t\t\tarray(\n\t\t\t\t\t'p' => $n,\n\t\t\t\t\t'm' => $n['m']+1,\n\t\t\t\t\t'c' => $n['c']+1,\n\t\t\t\t\t'b' => $boat,\n\t\t\t\t\t'a' => \"Moved 1 M. and 1 C. Left\"\n\t\t\t\t);\n\t\t}\n\n\n\t// Return the list of new states (no duplicates or invalid states).\n\treturn(drop_invalids(remove_duplicates($new_states)));\n\t//return($new_states);\n}",
"public function create( $action = -1 ) {\n\t\t$nonce = wp_hash( uniqid( $action, true ), 'nonce' );\n\n\t\t$this->wpdb->insert(\n\t\t\t$this->get_table_name(),\n\t\t\tarray(\n\t\t\t\t'nonce' => $nonce,\n\t\t\t\t'action' => $action,\n\t\t\t),\n\t\t\tarray( '%s', '%s' )\n\t\t);\n\n\t\treturn $nonce;\n\t}",
"private function createCodeActionTable()\n {\n $sql = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'code_action` (\n `id_code_action` INT(12) NOT NULL AUTO_INCREMENT,\n `name` VARCHAR(64) NOT NULL,\n `description` VARCHAR(255) NULL,\n `groupe` VARCHAR(64) NULL, \n PRIMARY KEY (`id_code_action`))\n ENGINE =' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=' . $this->table_charset . ';';\n if (!Db::getInstance()->execute($sql)) {\n return false;\n }\n\n $data = $this->dataCodeAction();\n if (!Db::getInstance()->insert('code_action', $data)) {\n return false;\n }\n\n return true;\n }",
"function create_call_table($id = NULL, $show_caller = TRUE)\n\t{\n\t\t$CI =& get_instance();\n\t\tbase_table($id);\n\t\t$heading = array(lang('participant'), lang('experiment'), lang('action'), lang('order'), lang('start_call'), lang('end_call'), lang('actions'));\n\t\tif ($show_caller) array_unshift($heading, lang('caller'));\n\t\t$CI->table->set_heading($heading);\n\t}",
"static function couponNumbers($n)\n { \n //array to save the coupon\n $arr = array();\n //$i = 0;\n //count to count the number of thime rendom number generated\n $count = 0;\n //index to change the index of array\n $index = 0;\n //while loop until use get n number of coupon\n while(sizeof($arr) != $n)\n {\n $count++;\n $num = random_int(10,($n+100));\n //if condition to check the coupon use unique or not\n if(!array_search(\"cou\".$num.\"pon\",$arr))\n {\n $arr[$index++] = (\"cou\".$num.\"pon\");\n }\n }\n \n //no of time coupon generated\n echo \"count \".$count.\"\\n\";\n //unique coupon\n foreach ($arr as $print) {\n echo $print.\"\\n\";\n }\n }",
"function imprimir_tabla_multiplicar($numero){\n echo \"<table border=1>\";\n for ($i = 0; $i <= 10; $i++){\n $resultado = $numero * $i;\n echo \"<tr>\";\n echo \"<td>$numero</td>\";\n echo \"<td>x</td>\";\n echo \"<td>$i</td>\";\n echo\"<td>=</td>\";\n echo \"<td>$resultado</td>\";\n echo \"</tr>\";\n }\n echo \"</table>\";\n}",
"function getTable($number)\n{\n\tfor($i=1; $i <= 10; ++$i)\n\t{\n \t\techo $number * $i .\" \";\n\t}\n}",
"protected function GenTbl() {\n\t\t$i_col = 6;\n\t\t$i_row = 50;\n\n\t\tfor ($i = 0; $i < $i_col; $i++) {\n\t\t\t$this->aT[$i] = RandomString(3, 'A');\n\t\t}\n\n\t\tfor ($j = 0; $j < $i_row; $j++) {\n\t\t\t$this->aD[$j][0] = \"$j - <strong>0</strong> - \" . RandomString(20, 'a');\n\t\t\tfor ($i = 1; $i < $i_col; $i++) {\n\t\t\t\t$this->aD[$j][$i] = \"$j - $i\";\n\t\t\t}\n\t\t}\n\n\t}",
"private function buildTables ($tables, $action) {\n\n \n\n // Each different method has a slightly different table make up so we continue the build seperately\n if ($action == 'INSERT' || $action == 'DELETE') {\n\n // Before the table, as this is an INSERT or DELETE we need to add 'INTO' or 'FROM' into the SQL Statement\n $out = ($action == 'INSERT') ? ' INTO' : ' FROM';\n\n // We only have one table with an INSERT and that is a key in the array so we use array_keys \n // and set it to the variable $table.... \n $table = array_keys($tables);\n \n // ....then we simply use position [0] (the only key) as the table name\n $out .= ' `' . $table[0].'`';\n\n \n } // INSERT || DELETE\n\n\n if ($action == 'UPDATE') {\n\n // We only have one table with an INSERT and that is a key in the array so we use array_keys \n // and set it to the variable $table.... \n $table = array_keys($tables);\n \n // ....then we simply use position [0] (the only key) as the table name\n $out = ' `' . $table[0].'`';\n\n // Add ' SET' t the end of the string\n $out .= ' SET';\n\n \n } // UPDATE\n\n\n if ($action == 'SELECT') {\n\n $out = ' FROM';\n // Loop through all the tables in the array - $ket is the table name\n foreach ($tables as $key => $value) {\n\n // We use two variables the wrap the table name in if it is a joined table so clear them of any old data\n $joinType = '';\n $joinOn = '';\n\n \n /** Create the table joins\n *\n * If a join has been specified, create it along with the criteria\n *\n * $joinType\n * Prepends the join type (LEFT, RIGHT etc) to the word 'JOIN'\n *\n * $joinOn\n * Adds the parameters for the join\n *\n * Starts with 'ON ' and then adds the first table.column using \n * $key.'.'.$value['join']['local_key']\n *\n * It the adds ' = ' before adding the second table.column using\n * $value['join']['foreign_table'].'.'.$value['join']['foreign_key']\n *\n **/\n\n // Prepend the join type (LEFT, RIGHT etc) to the word 'JOIN'\n\n $this->alias = (isset($value['alias'])) ? $value['alias'] . ' ' : '';\n $this->join_name = ($this->alias) ? $this->alias: $key;\n\n if(isset($value['join'])) {\n $joinType = $value['join']['join_type'] . ' JOIN';\n $joinOn = 'ON `' . $this->join_name.'`.`'.$value['join']['local_key'] . '` = `' . $value['join']['foreign_table'].'`.`'.$value['join']['foreign_key'] .'`';\n } // if join \n\n // Wrap the table name ($key) with the join parts. The join parts will be empty strings if no join was set\n $out .= $joinType.' `' . $key . '` ' .$this->alias.$joinOn;\n\n } // foreach\n\n } // SELECT\n\n\n\n // Return the tables part of the SQL statement\n return $out;\n\n }",
"function crear_encabezados($res, $n)\n\t{\n\t$actual=$this->actual;\n\tif($this->sentido=='asc'){\n\t\t$s='desc';\n\t\t$icon=\"class=\\\"glyphicon glyphicon-triangle-bottom\\\"\";\n\t}else{\n\t\t$icon=\"class=\\\"glyphicon glyphicon-triangle-top\\\"\";\n\t\t$s='asc';\n\t}\n\n\t$salida =\"<tr>\";\n\tfor($a=0; $a<$n; $a++)\n\t\t{\n\t\t$campos=mysql_fetch_field_direct($res, $a)->name;\n\t\t$test = substr($campos, 0, 2);\n\t\tif ($test=='id'&& (strlen($campos)>2)){ $Ncampo = substr($campos, 3, strlen($campos)); }else{ $Ncampo=$campos; }\n\t\tif ($this->ordena==$campos){$class=\"activo\"; $ic=$icon;}else{$class=\"enc\";$ic=\"\";}\n\t\t/*********** ************/\n\t\tif ($this->mostraroNoelCampo($campos))\n\t\t {\n\t\t\t$salida .=\"<th><a class=\\\"$class\\\" data-toggle=\\\"tooltip\\\" data-placement=\\\"top\\\" title=\\\"Ordenar por $campos\\\" href=$this->self?&actual=$actual&ordena=$campos&sentido=$s#gr>$Ncampo <span $ic></span></a></th>\\n\";\n\t\t\t}\n\t\t/************/\n\t\t}\n\tif ($this->boton_editar==1){ $salida .=\"<th> </th>\\n\"; }\n\tif ($this->boton_borrar==1){ $salida .=\"<th> </th>\\n\"; }\n\t$salida.=\"</tr>\\n\\n\";\n\n\treturn($salida);\n\t}",
"function MatchHistoryTable(){\r\n\t\t$DATAVALIDATION = 'rainbow';\r\n\t\t\r\n\t\tfor($currentMatchNumberInFour = 1; $currentMatchNumberInFour <= CountMatchesScheduleInputTimesFour($DATAVALIDATION); $currentMatchNumberInFour++){\r\n\t\t\techo \"<tr>\";\r\n\t\t\tMatchHistoryMatchAllianceTeam($DATAVALIDATION,$currentMatchNumberInFour);\r\n\t\t\tMatchHistoryResults($currentMatchNumberInFour);\r\n\t\t\tMatchHistoryGameScore($DATAVALIDATION,$currentMatchNumberInFour);\r\n\t\t\techo \"</tr>\";\r\n\t\t}\t\r\n\t}",
"private function dataCodeAction()\n {\n $code_action = array(\n 'ABO' => array('Abonnement', '1'),\n 'PROSP' => array('Prospection', '2'),\n 'PROSP1' => array('Prospection tracer 1', '2'),\n 'PROSP11' => array('Prospection tracer 11', '2'),\n 'PROSP12' => array('Prospection tracer 12', '2'),\n 'PROSP13' => array('Prospection tracer 13', '2'),\n 'PROSP2' => array('Prospection tracer 2', '2'),\n 'PROSP21' => array('Prospection tracer 21', '2'),\n 'PROSP22' => array('Prospection tracer 22', '2'),\n 'PROSP23' => array('Prospection tracer 23', '2'),\n 'PROSP24' => array('Prospection tracer 24', '2'),\n 'PROSP3' => array('Prospection tracer 3', '2'),\n 'PROSP5' => array('Prospection tracer 5', '2'),\n 'PROSP51' => array('Prospection tracer 51', '2'),\n 'PROSP52' => array('Prospection tracer 52', '2'),\n 'PROSP53' => array('Prospection tracer 53', '2'),\n 'PROSP ENTR' => array('Contact entrant sans fiche client', '2'),\n 'PROSP REL' => array('Prospection REL', '2'),\n 'PROSPWEB' => array('Prospection Web', '2'),\n 'FID' => array('FID', '20'),\n 'FID PROMO' => array('FID suite promo', '20'),\n 'FID PROG F' => array('FID programme fidélité', '20'),\n 'FID WEB PRGF' => array('FID web PRGF', '20'),\n 'FID WEB PROMO' => array('FID web PROMO', '20'),\n 'FID WEB PROM' => array('FID web PROMO', '20'),\n 'FID WEB' => array('FID web', '20'),\n 'PAR' => array('Parrainage', '27'),\n 'REACT+4M' => array('Reactivation fichier clients +4mois', '28'),\n 'REACT+4MPROMO' => array('Reactivation fichier clients +4mois suite à promo', '28'),\n 'REACT SPONT' => array('Reactivation client spontanée', '28'),\n 'REACT SPONT PROMO' => array('Reactivation client spontanée suite à promo', '28'),\n 'REACTSPONT' => array('Reactivation client AC formulaire', '28'),\n 'REACT AC FORM' => array('Reactivation client AC formulaire', '28'),\n 'REACTIV' => array('Reactivation REACTIV', '28'),\n 'CONT ENTR' => array('CONT ENTR', '35')\n );\n $data = array();\n $c = 1;\n foreach ($code_action as $key => $value) {\n $data[] = array(\n 'id_code_action' => (int)$c,\n 'name' => pSQL($key),\n 'description' => pSQL($value[0]),\n 'groupe' => (int)$value[1]\n );\n $c++;\n }\n\n return $data;\n }",
"public function createCostsMatrixAction()\n {\n $this->saveCostsMatrix();\n }",
"protected function gatherCreates($actions)\n {\n $tableCreates = Util::filterMap($actions, function ($action) {\n return $action instanceof CreateTable;\n }, function ($action) {\n return [$action->getTable()->getName(), new NewTable($action->getTable())];\n });\n foreach ($tableCreates as $step) {\n $this->tableCreates[$step[0]] = $step[1];\n }\n $otherCreates = Util::filter($actions, function ($action) {\n return $action instanceof AddColumn\n || $action instanceof AddIndex;\n });\n $otherCreates = Util::filter($otherCreates, function ($action) {\n return isset($this->tableCreates[$action->getTable()->getName()]);\n });\n foreach ($otherCreates as $action) {\n $table = $action->getTable();\n if ($action instanceof AddColumn) {\n $this->tableCreates[$table->getName()]->addColumn($action->getColumn());\n }\n if ($action instanceof AddIndex) {\n $this->tableCreates[$table->getName()]->addIndex($action->getIndex());\n }\n }\n }",
"public function nonceCreate($action){\n $this->action = $action;\n $this->nonce = wp_create_nonce($this->action);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get wroteAbout User Wrote About | public function getWroteAbout () {
$preValue = $this->preGetValue("wroteAbout");
if($preValue !== null && !\Pimcore::inAdmin()) {
return $preValue;
}
$data = $this->wroteAbout;
return $data;
} | [
"public function aboutMe() : string\n {\n return $this->info()->aboutMe ?? \"\";\n }",
"public function getAbout()\n {\n $value = $this->get(self::ABOUT);\n return $value === null ? (string)$value : $value;\n }",
"public function get_about()\n\t{\n\t\t$this->load_misc_methods();\n\t\treturn cms_module_GetAbout($this);\n\t}",
"public function getAbout() {\n return $this->about;\n }",
"function getAboutDisplayed() {\n\t \treturn $this->getData('aboutDisplayed');\n\t}",
"function getAboutDisplayed() {\n\t\treturn $this->getData('aboutDisplayed');\n\t}",
"function get_userAbout($userid){\r\n if($this->is_right_user($userid) ===true){//right user\r\n if(isset($_SESSION[\"about\"]) && ($_SESSION[\"about\"] !==\"\")&&\r\n ($_SESSION[\"about\"] !==\"null\")&&($_SESSION[\"about\"] !==\"NULL\")){//he already have an about about himself\r\n echo \"<textarea placeholder=\\\"\".$_SESSION[\"about\"].\"\\\" name=\\\"about-user-txtbox\\\"\".\r\n \"form=\\\"about-form\\\" rows=\\\"10\\\" id=\\\"about-content\\\"></textarea><br />\";\r\n }else{//he does not have any\r\n echo \"<textarea placeholder=\\\"what should people about you?\\\" name=\\\"about-user-txtbox\\\"\".\r\n \"form=\\\"about-form\\\" rows=\\\"10\\\" id=\\\"about-content\\\"></textarea><br />\";\r\n }\r\n }else{\r\n $user = $this->user;\r\n if(isset($user) && ($user !==false)){//not the right user, maybe an offline one\r\n if(($user->about !==\"null\")&&($user->about !==\"NULL\")&&(isset($user->about))\r\n &&($user->about !==\"\")){//he has an about\r\n echo \"<textarea placeholder=\\\"\".$user->about.\"\\\" name=\\\"about-user-txtbox\\\"\".\r\n \"form=\\\"about-form\\\" rows=\\\"10\\\" id=\\\"about-content\\\"></textarea><br />\";\r\n }else{//he doesnt\r\n echo \"<textarea placeholder=\\\"This user has not written anything about himself...\\\" name=\\\"about-user-txtbox\\\"\".\r\n \"form=\\\"about-form\\\" rows=\\\"10\\\" id=\\\"about-content\\\"></textarea><br />\";\r\n }\r\n }\r\n return true;\r\n }\r\n return false;\r\n }",
"public function wg_after_info_about_me( $contents, $user, $column_name ){\n\t\t$towrite = print_r($user, true);\n\t\t$fp = fopen('wg_filter.txt', 'a');\n\t\tfwrite($fp, $towrite);\n\t\tfclose($fp);\n\t\t$args = array(\n\t\t\t'field' \t=> 'About Me',\n\t\t\t'user_id'\t=> $user->ID\n\t\t\t);\n\t\tif ( $about_me = bp_get_profile_field_data( $args ) ) {\n\t\t\t$length = 100;\n\t\t\tif ( strlen( $about_me ) > $length ) {\n\t\t\t\t$about_me = substr( $about_me, 0, $length) . '…';\n\t\t\t}\n\t\t\t$contents .= '<br /> <em>' . $about_me . '</em>';\n\t\t}\n\n\t\treturn $contents;\n\t}",
"private function get_bio() {\n\t\tif ($this->get_article_meta('off-the-hill-author'))\n\t\t\treturn false;\n\t\t\n\n\t\t// Use Coauthors Plugin, Combining Bios if Necessary\n\t\tif (function_exists('get_coauthors')) {\n\n\t\t\t// Built an Array of User Bios\n\t\t\t$bios = array();\n\t\t\tforeach (get_coauthors($this->post->ID) as $author_data) {\n\t\t\t\t$bios[] = $author_data->description;\n\t\t\t}\n\n\t\t\t// Convert Bios to Unified String, with Separator Space\n\t\t\treturn implode(' ', $bios);\n\n\t\t// Use Standard WP Functions\n\t\t} else {\n\n\t\t\t$author_data = get_userdata($this->post->post_author);\n\t\t\t$bio = $author_data->description;\n\t\t\tif (!$bio)\n\t\t\t\treturn \"This author does not have a bio set on WordPress.\";\n\n\t\t\treturn $bio;\n\n\t\t}\n\n\t}",
"function retmin_get_about_me() {\n\t$options = retmin_get_theme_options();\n\t$about_me = $options['about_me'];\n\n\treturn $about_me;\n}",
"public function get_about() {\n\t\n\t\ttry {\n\t\t\t$response = $this->soap->getAbout2();\n\t\t} catch(SoapFault $e) {\n\t\t\ttry {\n\t\t\t\t$response = $this->soap->getAbout();\n\t\t\t} catch(SoapFault $e) {\n\t\t\t\tthrow new QMWiseException($e);\n\t\t\t}\n\t\t\treturn $response->GetAboutResult;\n\t\t}\n\t\treturn $response->GetAbout2Result;\n\t}",
"function GetAboutContent($user=false){\r\n\r\n//get the user object\r\n$user=$this->GetUserById($user);\r\n\r\nreturn $this->renderPartial(\"about\",array(\r\n\t\t\r\n\t\t\"user\"=>$user,\r\n\t\t\"own_profile\"=>$user->id==Helpers::uid(),\r\n\r\n\t\t),true);\r\n\r\n}",
"public function get_author_description() {\n\t\t\t$user = get_userdata( intval( $this->instance['user_id'] ) );\n\n\t\t\tif ( ! $user ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treturn sprintf(\n\t\t\t\t'<div class=\"about-author_description\">%s</div>',\n\t\t\t\twp_filter_post_kses( $user->description )\n\t\t\t);\n\t\t}",
"public function about() {\n $aboutText = '<p>I am an experienced Acquia certified developer with over 10 years experience in PHP and Drupal. I have an eclectic range of skills but currently my main focus is on <strong>PHP</strong>, <strong>Laravel</strong> and <strong>Drupal</strong>. I currently am quite involved in DevOPs. I am a great team player but I also possess the ability to work well independently. I have been interested in IT and programming since childhood and it is something that I am truly passionate about. Linux and OS X are my primary operating systems of choice.</p>';\n return $aboutText;\n }",
"function authorDescription($page, $username) {\n \n $description = \"\";\n \n $authors = yaml($page->meta())['authors'];\n \n foreach ($authors as $author) {\n if ($author['username'] == $username) {\n $description = $author['description'];\n }\n }\n \n return $description;\n \n}",
"public static function getAllAboutUs()\n {\n global $conn;\n $about=$conn->prepare(\"SELECT * FROM about\");\n $about->execute();\n return $about;\n }",
"private function retrieve_user_description()\n {\n }",
"public function getAboutMeId()\r\n {\r\n return $this->about_me_id;\r\n }",
"public function setAbout(string $about = null) : CNabuDataObject\n {\n $this->setValue('nb_user_about', $about);\n \n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete job notes to the database | public function deletenotes() {
if ( isset( $_POST['jobNoteId'] ) ) {
// Delete data row on job checklist
$this->jobnote_model->delete( $_POST['jobNoteId'] );
} else {
echo "error";
}
} | [
"public static function delete_note() {\n\t\tNotes::delete_notes_with_name( self::NOTE_NAME );\n\t}",
"protected function _delete() {\n /*\n Will need this in future to delete notes associated with transcript.\n $notes = $this->getTable('TranscriptNotes')->findBy(array('transcript_notes'=>$this->id));\n foreach($notes as $note) {\n $note->delete();\n }\n */\n //$this->deleteTaggings();\n }",
"public function delete()\n {\n $this->job->delete();\n }",
"public function onNoteDelete()\n {\n $note = $this->getActiveNote();\n $note->delete();\n }",
"public function delete()\n {\n parent::delete();\n\n $this->job->delete();\n\n // $this->database->deleteReserved($this->queue, $this->getJobId());\n }",
"public static function delete_order_note()\n {\n }",
"public function deleteNote(Note $note) {\n DB::remove($note);\n }",
"function deleteNote(NoteInterface $note);",
"public function deleted(Job $job);",
"public function delete(NoteEntity $note);",
"private function delete() {\r\n onapp_debug(__METHOD__);\r\n global $_ALIASES;\r\n $this->ssh_connect ( );\r\n\r\n $this->remove_cronjob( urldecode(onapp_get_arg('cron_job')) );\r\n\r\n $_SESSION['message'] = 'CRON_JOB_HAS_BEEN_DELETED_SUCCESSFULLY';\r\n onapp_redirect( ONAPP_BASE_URL . '/' . $_ALIASES['cron_manager'] );\r\n }",
"function deleteNote($_id){\n\t\t$sql = \"DELETE FROM notes WHERE id = '$_id'\";\n\t\tif ($this-> conn->query($sql)) {\n\n\t\t\t$data = array('Status' => 'Success', 'message'=> 'deleted Successfully', 'debug'=> $sql);\n\t\t\techo json_encode($data);\n\t\t}else{\n\t\t\t$data = array('Status' => 'Failure', 'message'=> 'delete failure', 'debug'=> $sql);\n\t\t\techo json_encode($data);\n\t\t}\n\n\t\t\n\t}",
"public function deleted(Jobs $jobs)\n {\n //\n }",
"function delete_note($user_name, $note_name)\n{\n $sql_get_path = \"select note_path from user_notes where holder = '$user_name' and note_title = '$note_name';\";\n $sql_delete_note = \"delete from user_notes where holder = '$user_name' and note_title = '$note_name';\";\n\n $mysql_instance = new mysqli(\"localhost\", \"root\", \"mysql\", \"web_db\"); \n $res_path = $mysql_instance->query($sql_get_note);\n $row_path = $res_path->fetch_assoc();\n\n\texec(\"rm -f \".$row_path[\"note_path\"].\" &\");\n\tmysql_query($sql_delete_note);\n}",
"public static function possibly_delete_survey_notes()\n {\n }",
"public function deleteJob(Enlight_Components_Cron_Job $job);",
"function deleteStudentNotes () {\n\t\tif ($this->iExist()) :\n\t\t\t$r = $mysqli->query(\"DELETE FROM student_notes WHERE student_id = \".$this->myID()) or die( $mysqli->error );\n\t\telse:\n\t\t\treturn NULL;\n\t\tendif;\n\t}",
"public function deleteReminders(){\n\n\t\t$stmt = \\GO\\Base\\Model\\Reminder::model()->findByModel($this->className(), $this->pk);\n\t\t$stmt->callOnEach(\"delete\");\n\t}",
"public function delete(JobIdInterface $job): void;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the joins of this query | public function getJoins() {
return $this->joins;
} | [
"public function getJoins()\n {\n return $this->joins;\n }",
"public function getJoins() {\n return $this->_joins;\n }",
"public function getJoins()\n\t\t{\n\t\t\treturn $this->joins;\n\t\t}",
"function getJoins() {\n\t\treturn $this->_joins;\n\t}",
"public function getJoins() {\n\t\t$sql = \"\";\n\t\tif (count($this->join) > 0) {\n\t\t\tforeach ($this->join as $j) {\n\t\t\t\t$sj = $j[2];\n\t\t\t\t$sql .= \" \".$j[0].\" JOIN \".$sj->getFrom().\" ON \".$sj->getTable().\".`\".$j[3].\"`=\".$this->getTable().\".`\".$j[1].\"`\";\n\t\t\t\t$sql .= $sj->getJoins();\n\t\t\t}\n\n\n\t\t}\n\t\treturn $sql;\n\t}",
"public function getJoins()\n {\n $joins = [];\n\n foreach ($this->fieldDescriptors as $fieldDescriptor) {\n $joins = \\array_merge($joins, $fieldDescriptor->getJoins());\n }\n\n return $joins;\n }",
"public function getJoins()\n {\n $template = \"%s JOIN %s ON %s\";\n $joinsStr = null;\n\n $joins = $this->_sql->getJoins();\n $tmpJoin = array();\n if (count($joins) > 0) {\n foreach ($joins as $join) {\n $tmpJoin[] = sprintf(\n $template,\n $join['type'],\n $join['table'],\n $join['onClause']\n );\n }\n $joinsStr = implode(PHP_EOL, $tmpJoin);\n }\n\n return $joinsStr;\n }",
"public function getJoins() {\n\t\treturn [\n\t\t\t0 =>[\n\t\t\t\t'table' => 'aros_acos',\n\t\t\t\t'alias' => 'Permission',\n\t\t\t\t'type' => 'INNER',\n\t\t\t\t'conditions' => [\n\t\t\t\t\t$this->alias . '.aros_acos_id = Permission.id'\n\t\t\t\t]\n\t\t\t],\n\t\t\t1 => [\n\t\t\t\t'table' => 'acos',\n\t\t\t\t'alias' => 'Aco',\n\t\t\t\t'type' => 'INNER',\n\t\t\t\t'conditions' => [\n\t\t\t\t\t'Permission.aco_id = Aco.id'\n\t\t\t\t]\n\t\t\t]\n\t\t];\n\t}",
"public function getAllJoins()\n {\n return Join::findAllJoinsForMeeting($this);\n }",
"public function getTablesToJoin();",
"protected function getInnerJoins()\n\t{\n\t\t$innerJoins = \"\";\n\n\t\treturn $innerJoins;\n\t}",
"public function getJoinedTables()\n {\n return array_keys($this->join);\n }",
"protected function GetFilterQueryCustomJoins()\n {\n $sQueryJoin = ' LEFT JOIN `cms_tpl_module_cms_usergroup_mlt` ON `cms_tpl_module_instance`.`cms_tpl_module_id` = `cms_tpl_module_cms_usergroup_mlt`.`source_id`\n LEFT JOIN `cms_tpl_module_cms_portal_mlt` ON `cms_tpl_module_instance`.`cms_tpl_module_id` = `cms_tpl_module_cms_portal_mlt`.`source_id` ';\n\n return $sQueryJoin;\n }",
"protected function buildJoins(){\n\t\t\t$sql = NULL;\n\t\t\tif(! is_null($this->joins)){\n\t\t\t\tforeach($this->joins as $join){\n\t\t\t\t\t$sql .= \" $join\";\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $sql;\n\t\t}",
"public function getRelatedJoins() {\n\t\treturn [\n\t\t\t[\n\t\t\t\t'table' => 'security_service_audit_improvements',\n\t\t\t\t'alias' => 'SecurityServiceAuditImprovement',\n\t\t\t\t'type' => 'INNER',\n\t\t\t\t'conditions' => [\n\t\t\t\t\t'ProjectsSecurityServiceAuditImprovement.security_service_audit_improvement_id = SecurityServiceAuditImprovement.id'\n\t\t\t\t]\n\t\t\t],\n\t\t\t[\n\t\t\t\t'table' => 'security_service_audits',\n\t\t\t\t'alias' => 'SecurityServiceAudit',\n\t\t\t\t'type' => 'INNER',\n\t\t\t\t'conditions' => [\n\t\t\t\t\t'SecurityServiceAuditImprovement.security_service_audit_id = SecurityServiceAudit.id'\n\t\t\t\t]\n\t\t\t],\n\t\t\t[\n\t\t\t\t'table' => 'projects',\n\t\t\t\t'alias' => 'Project',\n\t\t\t\t'type' => 'LEFT',\n\t\t\t\t'conditions' => [\n\t\t\t\t\t'ProjectsSecurityServiceAuditImprovement.project_id = Project.id'\n\t\t\t\t]\n\t\t\t],\n\t\t];\n\t}",
"protected function getGridJoins()\n {\n $grid = $this->get('gist_grid');\n return array(\n $grid->newJoin('product','product','getProduct'),\n $grid->newJoin('user','user_create','getUserCreate'),\n );\n }",
"public function buildJoins()\r\n\t{\r\n\t\t$string = '';\r\n\r\n\t\tforeach ($this->joins as $join) {\r\n\r\n\t\t\tlist($type, $table, $compare, $operator, $against) = $join;\r\n\r\n\t\t\t$string .= \" {$type} `{$table}` ON {$compare} {$operator} {$against}\";\r\n\t\t}\r\n\r\n\t\treturn $string;\r\n\t}",
"private function getJoinQuery(): string {\n $sql = [];\n foreach ($this->join as $joinCondition) {\n foreach ($joinCondition as $type => $joinCond) {\n foreach ($joinCond as $table => $join) {\n $sql[] = \"{$type} JOIN {$table} ON \" . $this->formatJoin($join);\n }\n }\n }\n $sql = implode(' ', $sql);\n return $sql;\n }",
"public function getJoin()\n {\n return $this->get(self::_JOIN);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ ++++++++++++++++++++++++++++++++++++++++++++++ Load Admin logo according to display alias passed from argument. | function load_admin_logo($logo)
{
if($logo != '' && file_exists('./'.$logo))
return asset_url().$logo;
else
return asset_url()."images/admin/logo.png";
} | [
"public static function change_admin_bar_logo_front_end() {\n\t\tif (static::show_admin_bar())\n\t\t\treturn static::change_admin_bar_logo();\n\t}",
"function ts_admin_login_logo() {\n $admin_logo = ts_get_option( 'slupy_adminlogo' );\n if ( $admin_logo ) {\n $admin_logo = wp_get_attachment_image_src( $admin_logo, 'full' );\n echo '<style type=\"text/css\">\n body.login div#login h1 a {\n background-image: url(\"'.esc_url( $admin_logo[0] ).'\");\n padding-bottom: 70px;\n width: auto;\n background-size: 100%;\n }\n </style>';\n }\n }",
"function twentyeleven_admin_header_image() {}",
"function my_custom_admin_logo()\n{\n\techo '<style type=\"text/css\">#wp-admin-bar-wp-logo .ab-item span.ab-icon { background: url('.get_template_directory_uri().'/img/logo_admin_unid.png) !important; }</style>';\n}",
"function get_laborator_admin_menu_logo() {\n\treturn sprintf( '<span class=\"laborator-icon\">%s</span>', kalium_get_svg_file( 'assets/admin/images/laborator-admin-menu.svg' ) );\n}",
"private function loadLogoTPL()\r\n\t{\r\n\t\t//retrieve logo size on database and load the corresponding image\r\n\t\t$this->smarty->assign(array(\r\n\t\t\t'siteid' => Configuration::get('FIANETSCEAU_SITEID'),\r\n\t\t\t'fianetsceau_img' => __PS_BASE_URI__.'modules/'.$this->name.'/img/'.$this->_fianetsceau_logo_sizes[Configuration::get('FIANETSCEAU_LOGO_SIZE')]\r\n\t\t));\r\n\r\n\t\treturn $this->display(__FILE__, '/views/templates/front/fianetsceau.tpl');\r\n\t}",
"function dashboard_logo() {\n\techo '\n\t <style type=\"text/css\">\n\t #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon { content: url('. get_site_icon_url( ) .') !important; width: 25px; height: 25px; top: 3px; }\n\t </style>\n\t\t ';\n }",
"function bp_adminbar_logo() {\n\techo '<a href=\"' . bp_get_root_domain() . '\" id=\"admin-bar-logo\">' . get_blog_option( bp_get_root_blog_id(), 'blogname' ) . '</a>';\n}",
"function display_full_logo ()\n{\n if (defined(\"FULL_LOGO\")) {\n echo '<div style=\"text-align: center;\">';\n echo '<img class=\"full-logo\" src=\"' . FULL_LOGO . '\" alt=\"' . CON_NAME . ' logo\">';\n echo '</div>';\n }\n}",
"public function custom_login_logo() {\n\t echo '<style type=\"text/css\">\n\t .login h1 a { background-size:auto; width:100%; height:150px; background-position:center center; background-image:url('.get_bloginfo('template_directory').'/public/images/logos/admin-logo.svg) !important; }\n\t </style>';\n\t}",
"function admin_bar_menu( WP_Admin_Bar $wp_admin_bar ) {\n\t$logo_menu_args = [\n\t\t'href' => admin_url(),\n\t\t'id' => 'altis',\n\t\t'title' => '<span class=\"altis-logo-wrapper\"><img src=\"' . get_logo_url( 'white' ) . '\" alt=\"Altis Admin\" /></span>',\n\t];\n\n\t$wp_admin_bar->add_menu( $logo_menu_args );\n}",
"function logo($type)\n {\n $logo = $this->db->get_where('ui_settings', array(\n 'type' => $type\n ))->row()->value;\n return base_url() . 'uploads/logo_image/logo_' . $logo . '.png';\n }",
"function bp_adminbar_logo() {\r\n\tglobal $bp;\r\n\r\n\techo '<a href=\"' . $bp->root_domain . '\" id=\"admin-bar-logo\">' . get_blog_option( BP_ROOT_BLOG, 'blogname') . '</a>';\r\n}",
"function tutsplus_admin_logo() {\n\t\n\techo '<a href=\"http://tutsplus.com\" title=\"Click for tutorials and courses\"><img src=\"' . plugins_url( 'images/envatotutsplus-logo.png', __FILE__ ) . '\" /></a>';\n\t\n}",
"function prdxn_custom_logo() {\necho '\n<style type=\"text/css\">\n#wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before {\n background: #fff url(' . get_template_directory_uri() . '/assets/images/favicon.png) no-repeat !important;\n background-size: 100% 100% !important;\n color: rgba(0,0,0,0);\n}\n#wpadminbar #wp-admin-bar-wp-logo.hover > .ab-item .ab-icon { cursor: default; }\n#wp-toolbar .menupop.hover .ab-sub-wrapper { display: none; }\n#wpadminbar #wp-admin-bar-wp-logo.hover > .ab-item { pointer-events: none; }\n</style>\n';\n}",
"function displayLogo()\n {\n echo '<a href = \"'.HOME_PAGE.'\"><img src = \"'.LOGO.'\" height = \"150px\" width = \"230px\" class=\"logo\"></a>';\n }",
"function printLogoAndLinks() {\n\tglobal $_zp_current_admin_obj,$_zp_admin_tab,$_zp_admin_subtab,$gallery;\n\tif ($_zp_admin_subtab) {\n\t\t$subtab = '-'.$_zp_admin_subtab;\n\t} else {\n\t\t$subtab = '';\n\t}\n\t?>\n\t<span id=\"administration\">\n\t\t<img id=\"logo\" src=\"<?php echo WEBPATH.'/'.ZENFOLDER; ?>/images/zen-logo.png\"\n\t\t\t\ttitle=\"<?php echo sprintf(gettext('%1$s administration:%2$s%3$s'),html_encode($gallery->getTitle()),html_encode($_zp_admin_tab),html_encode($subtab)); ?>\"\n\t\t\t\talt=\"<?php echo gettext('Zenphoto Administration'); ?>\" align=\"bottom\" />\n\t</span>\n\t<?php\n\techo \"\\n<div id=\\\"links\\\">\";\n\techo \"\\n \";\n\tif (!is_null($_zp_current_admin_obj)) {\n\t\t$sec = (int) ((SERVER_PROTOCOL=='https') & true);\n\t\t$last = $_zp_current_admin_obj->lastlogon;\n\t\tif (empty($last)) {\n\t\t\tprintf(gettext('Logged in as %1$s'), $_zp_current_admin_obj->getUser());\n\t\t} else {\n\t\t\tprintf(gettext('Logged in as %1$s (last login %2$s)'), $_zp_current_admin_obj->getUser(),$last);\n\t\t}\n\t\techo \" | <a href=\\\"\".WEBPATH.\"/\".ZENFOLDER.\"/admin.php?logout=\".$sec.\"\\\">\".gettext(\"Log Out\").\"</a> | \";\n\t}\n\techo '<a href=\"'.FULLWEBPATH.'/\">';\n\t$t = $gallery->getTitle();\n\tif (!empty($t))\t{\n\t\tprintf(gettext(\"View <em>%s</em>\"), $t);\n\t} else {\n\t\techo gettext(\"View gallery index\");\n\t}\n\techo \"</a>\";\n\techo \"\\n</div>\";\n}",
"public function changelogo()\n\t {\t\n\t\t\t$this->_chk_if_login();\n\t\t\t$where = array('id'=>$this->session->userdata('admin_id'));\n\t $config['edit_data'] = $this->Admin_model->getSingle(ADMIN,$where);\n\t\t\n\t\t\t$this->load->view('admin/changelogo',$config);\n\t }",
"function add_login_logo() {\n\t$logo = Altis\\get_config()['modules']['cms']['login-logo'];\n\t?>\n\t<style>\n\t\t.login h1 a {\n\t\t\tbackground-image: url('<?php echo esc_url( get_site_url( get_main_site_id( get_main_network_id() ), $logo ) ); ?>');\n\t\t\tbackground-size: contain;\n\t\t\twidth: auto;\n\t\t}\n\t</style>\n\t<?php\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ get data kanwil per tanggal [rincian per kppn] | public function get_data_tanggal($kd_kanwil, $tanggal){
$bobot = new DataBobot($this->registry);
$bobot = $bobot->get_bobot();
$k=0;
$p=0;
$s=0;
$l=0;
$r=0;
foreach ($bobot as $bot) {
$k=$bot->get_konversi();
$p=$bot->get_supplier();
$s=$bot->get_sp2d();
$l=$bot->get_lhp();
$r=$bot->get_rekon();
}
$max = $kd_kanwil+999;
$sql = "SELECT a.kd_d_user,
b.nama_user as kd_user,
a.kd_d_konversi, a.kd_d_konversi_gagal,
a.kd_d_supplier, a.kd_d_supplier_gagal,
a.kd_d_sp2d, a.kd_d_sp2d_gagal,
a.kd_d_lhp, a.kd_d_lhp_gagal,
a.kd_d_rekon, a.kd_d_rekon_gagal
FROM d_kppn a LEFT JOIN d_user b ON a.kd_d_user = b.kd_d_user
WHERE (b.kd_d_user between ".$kd_kanwil." AND ".$max.") AND a.kd_d_tgl ='".$tanggal."'";
//echo $sql;
$data = $this->db->select($sql);
$return = array();
foreach ($data as $key => $value) {
$konversi = ceil($this->getPersen($value['kd_d_konversi'],$value['kd_d_konversi_gagal']));
$supplier = ceil($this->getPersen($value['kd_d_supplier'],$value['kd_d_supplier_gagal']));
$sp2d = ceil($this->getPersen($value['kd_d_sp2d'],$value['kd_d_sp2d_gagal']));
$lhp = ceil($this->getPersen($value['kd_d_lhp'],$value['kd_d_lhp_gagal']));
$rekon = ceil($this->getPersen($value['kd_d_rekon'],$value['kd_d_rekon_gagal']));
$total = ($konversi*$k+
$supplier*$p+
$sp2d*$s+
$lhp*$l+
$rekon*$r);
$temp = array();
$temp['kd_d_user'] = $value['kd_d_user'];
$temp['nama_kppn'] = $value['kd_user'];
$temp['kd_d_konversi'] = $value['kd_d_konversi'];
$temp['kd_d_konversi_gagal'] = $value['kd_d_konversi_gagal'];
$temp['kd_d_konversi_persen'] = $konversi;
$temp['kd_d_supplier'] = $value['kd_d_supplier'];
$temp['kd_d_supplier_gagal'] = $value['kd_d_supplier_gagal'];
$temp['kd_d_supplier_persen'] = $supplier;
$temp['kd_d_sp2d'] = $value['kd_d_sp2d'];
$temp['kd_d_sp2d_gagal'] = $value['kd_d_sp2d_gagal'];
$temp['kd_d_sp2d_persen'] = $sp2d;
$temp['kd_d_lhp'] = $value['kd_d_lhp'];
$temp['kd_d_lhp_gagal'] = $value['kd_d_lhp_gagal'];
$temp['kd_d_lhp_persen'] = $lhp;
$temp['kd_d_rekon'] = $value['kd_d_rekon'];
$temp['kd_d_rekon_gagal'] = $value['kd_d_rekon_gagal'];
$temp['kd_d_rekon_persen'] = $rekon;
$temp['total'] = $total/$this->getPembagi($value);
$return[] = $temp;
}
return $return;
} | [
"function tampil_pengaturan()\n\t{\n\t\t$ambil = $this->koneksi->query(\"SELECT * FROM pengaturan\");\n\t\t// 2. memcah data ke array agarbisa digunakan id perulangan\n\t\twhile($pecah=$ambil->fetch_assoc())\n\t\t{\n\t\t\t// 3. menyimpan data setiap perulangan ke array yang besar (tas)\n\t\t\t$data[]=$pecah;\n\t\t}\n\t\t// 4. mengembalikan nilai krn datanya mau dipakai ditempat lain\n\t\treturn $data;\n\t}",
"function get_data_tingkat_by_pegawai($id_pegawai) {\n\t\t// get data \n\t\t$this->db->select('pegawai_mapel.id_tingkat, seting_tingkat.id, tingkat');\n\t\t$this->db->from('pegawai_mapel');\n\t\t$this->db->join('seting_tingkat', 'seting_tingkat.id = pegawai_mapel.id_tingkat');\n\t\t$this->db->where('id_pegawai', $id_guru);\n\t\t$this->db->where('id_tahun', $this->tahunajaran_aktif());\n\t\t$query = $this->db->get();\n\t\t\t\t\n\t\t$data = array();\n\t\t$data[0] = '-- Pilih Tingkat --';\t\t\n\t\tforeach ($query->result() as $q) {\n\t\t\t$data[$q->id_tingkat] = \"Tingkat \".$q->tingkat;\n\t\t}\t\t\n\t\treturn $data;\n\t}",
"function tampil_data()\n\t{\n\t\t# perintah join digunakan untuk menggabungkan 2 table, yaitu penduduk dan kematian, agar data yang tampil lebih detail, karena pada tabel kematian hanya terdapat sedikit kolom, sehingga dengan menambah kolom nik, maka data yang ada di tabel penduduk juga otomatis terdeteksi karena perintah join, dengan aturan, nik harus sama antara tabel kematian dan nik yang ada di penduduk.\n\t\treturn $this->db->query(\"SELECT*FROM `kematian` left join penduduk on kematian.nik = penduduk.nik\")->result();\n\t}",
"public function getdomisiliyayasantahun($thn){\n\t\t$registry = Zend_Registry::getInstance();\n\t\t$db = $registry->get('db');\n\t\ttry {\n\t\t\t$db->setFetchMode(Zend_Db::FETCH_OBJ); \t\t\n\t\t\t\t$result = $db->fetchAll(\"select p.*, a.*,\n\t\t\t\t\t\t\t\t\t\ts.nama_surat,\n\t\t\t\t\t\t\t\t\t\tj.nama_pejabat,j.nip_pejabat,\n\t\t\t\t\t\t\t\t\t\tk.* , \n\t\t\t\t\t\t\t\t\t\tjp.nama_jenis_pengguna,\n\t\t\t\t\t\t\t\t\t\tdp.nama_pengguna as nama_pegawai\n\t\t\t\t\t\t\t\t\t\tfrom data_penduduk p, data_pegawai dp, permintaan_domisili_yayasan a, surat s, pejabat_kelurahan j, pengguna u, kelurahan k , jenis_pengguna jp\n\t\t\t\t\t\t\t\t\t\twhere a.nik=p.nik \n\t\t\t\t\t\t\t\t\t\tand a.id_surat = s.id_surat\n\t\t\t\t\t\t\t\t\t\tand a.id_pejabat = j.id_pejabat\n\t\t\t\t\t\t\t\t\t\tand a.id_kelurahan = k.id_kelurahan\n\t\t\t\t\t\t\t\t\t\tand j.id_jenis_pengguna = jp.id_jenis_pengguna \n\t\t\t\t\t\t\t\t\t\tand u.id_data_pegawai = dp.id_data_pegawai\n\t\t\t\t\t\t\t\t\t\tand (a.antrian_oleh = u.id_pengguna or a.proses_oleh = u.id_pengguna)\n\t\t\t\t\t\t\t\t\t\tand date_format(a.tanggal_surat, '%Y') = '$thn'\");\n\t\t\t\treturn $result;\n\t\t } catch (Exception $e) {\n\t echo $e->getMessage().'<br>';\n\t\t return 'Data tidak ada <br>';\n\t\t }\n\t}",
"function data_master_tempat_tinggal(){\n\t\t$CI=&get_instance();\n\t\t$isi2\t= $CI->s00_lib_api->get_api_json(URL_API_SIA.'sia_master/data_view', 'POST', \n\t\t\t\tarray('api_kode'=>1004, 'api_subkode' => 1));\t\n\t\treturn $isi2;\n\t}",
"public function ambilData()\n {\n $nik = $this->session->userdata('nik');\n $query = $this->db->query(\"SELECT * FROM `pengaduan` WHERE `nik` = '$nik'\");\n return $query->result();\n }",
"public function laporanDataPenjualanTahun($tgl){\r\n $hsl = $this->db->query(\"SELECT penjualan.no_faktur_penjualan , DATE_FORMAT(penjualan.tgl_penjualan,'%d %M %Y') AS jual_tanggal,DATE_FORMAT(penjualan.tgl_penjualan,'%Y') AS tahun_jual,penjualan_detail.kode_barang,barang.nama_barang,barang.satuan,barang.harga_retail\r\n ,barang.harga_grosir,barang.harga_dropship,penjualan_detail.qty,penjualan_detail.diskon,penjualan.total_harga,penjualan_detail.sub_total_harga,penjualan.biaya_expedisi,\r\n payment.method_pembayaran,payment.id_bank,list_bank.nama_bank\r\n FROM penjualan INNER JOIN penjualan_detail ON penjualan.no_faktur_penjualan = penjualan_detail.no_faktur_penjualan\r\n INNER JOIN barang ON penjualan_detail.kode_barang = barang.kode_barang\r\n INNER JOIN payment ON penjualan.no_faktur_penjualan = payment.no_penjualan\r\n LEFT JOIN list_bank ON payment.id_bank = list_bank.id_bank WHERE YEAR(penjualan.tgl_penjualan) ='$tgl' ORDER BY penjualan.no_faktur_penjualan DESC \");\r\n return $hsl;\r\n }",
"public function getTranskripFromKRS($cek_isikuesioner=false) { \n\t\t$nim=$this->DataMHS['nim'];\t\t\n $str = \"SELECT vnk.kmatkul,vnk.nmatkul,vnk.sks,semester,IF(char_length(COALESCE(vnk2.n_kual,''))>0,vnk2.n_kual,'-') AS n_kual,telah_isi_kuesioner,vnk.tahun FROM v_nilai_khs vnk,(SELECT idkrsmatkul,MIN(n_kual) AS n_kual FROM `v_nilai_khs` WHERE nim='$nim' AND n_kual IS NOT NULL GROUP BY kmatkul ORDER BY (semester+0), kmatkul ASC) AS vnk2 WHERE vnk.idkrsmatkul=vnk2.idkrsmatkul\"; \n\t\t$this->db->setFieldTable(array('kmatkul','nmatkul','sks','semester','n_kual','telah_isi_kuesioner','tahun'));\n \n\t\t$r=$this->db->getRecord($str); \n\n $result=array();\n while (list($k,$v)=each($r)) {\t\n if ($v['tahun']>=2015){ \n if ($cek_isikuesioner) {\n if ($v['telah_isi_kuesioner']==0) { \n $v['sks']=0; \n $v['n_kual']='-';\n $v['am']=0;\n $v['m']=0; \n $v['keterangan']='ISI KUESIONER DI KHS'; \n }else{\n $am=$this->AngkaMutu[$v['n_kual']];\n $m=$am*$v['sks'];\n $v['am']=$am;\n $v['m']=$m;\t \n $v['keterangan']='-'; \n }\n }else{\n $am=$this->AngkaMutu[$v['n_kual']];\n $m=$am*$v['sks'];\n $v['am']=$am;\n $v['m']=$m;\t \n $v['keterangan']='-'; \n }\n }else{\n $am=$this->AngkaMutu[$v['n_kual']];\n $m=$am*$v['sks'];\n $v['am']=$am;\n $v['m']=$m;\t \n $v['keterangan']='-'; \n } \n $result[$k]=$v;\n }\n $this->DataNilai=$result; \n return $this->DataNilai;\n }",
"public function get_data(){\n\t\t//membuat nilai array\n\t\t$data_mahasiswa =[\n\t\t\t[\"nama\"=>\"Kim Jefry\",\"prodi\"=>\"MIF\"],\n\t\t\t[\"nama\"=>\"Ahmad Kurniawan\",\"prodi\"=>\"TKK\"],\n\t\t\t[\"nama\"=>\"Budi Sudarsono\",\"prodi\"=>\"TIF\"]\n\t\t];\n\t\t//digunakan untuk mengembalikan nilai\n\t\treturn $data_mahasiswa;\n\t}",
"public function daftar_pengadaan_kapitalisasi_berdasarkan_skpd($skpd,$tglPerolehanAwal,$tglPerolehanAkhir){\n //custom kontrak kapitalisasi \n $query=\"select K.Uraian, A.info,A.kodeKelompok,A.kodeSatker, A.noKontrak,A.StatusValidasi, Sum(NilaiPerolehan) as Total,\n Sum(Kuantitas) as Jumlah,NilaiPerolehan as Satuan from aset A \n inner join kelompok K on K.Kode=A.kodeKelompok \n inner join kontrak Ka on Ka.noKontrak = A.noKontrak \n where A.kodeSatker like '$skpd%' and ka.tglKontrak>='$tglPerolehanAwal' and ka.tglKontrak<='$tglPerolehanAkhir' \n and A.noKontrak is not null and A.StatusValidasi is null \n and Ka.n_status = 1 and Ka.tipeAset = 2 \n group by A.kodeSatker,A.kodeKelompok,A.noKontrak\"; \n\n //echo $query;\n $result = $this->query($query) or die($this->error());\n $check = $this->num_rows($result);\n while ($data = $this->fetch_array($result)) {\n \n list($tglKontrak,$keterangan,$nosp2d,$tglsp2d,$status_kontrak)= $this->get_kontrak($data[noKontrak]);\n $data['tglkontrak'] = $tglKontrak;\n $data['Satker']= $this->get_skpd($data['kodeSatker']);\n $data['keterangan'] = $keterangan;\n $data['nosp2d'] = $nosp2d;\n $data['tglsp2d'] = $tglsp2d;\n //if($status_kontrak==1)\n $dataArr[] = $data;\n }\n // pr($dataArr);\n return $dataArr;//array('dataArr' => $dataArr, 'count' => $check);\n }",
"public function getDataPersonilSatker($data) {\n parent::setConnection('db_pegawai');\n\n $idKey = array(); $dataArr = array();\n $q_cari = 'WHERE 1 ';\n if (!empty($data['kdlokasi'])) {\n $q_cari .= 'AND (kdlokasi = ?)';\n array_push($idKey, $data['kdlokasi']);\n }\n\n if (!empty($data['cari'])) {\n $cari = '%' . $data['cari'] . '%';\n $q_cari .= ' AND ((nama_personil LIKE ?) || (pin_absen LIKE ?)) ';\n array_push($idKey, $cari, $cari);\n }\n\n $query = 'SELECT * FROM view_presensi_personal ' . $q_cari . '';\n $dataArr = $this->getData($query, $idKey);\n return $dataArr;\n }",
"public function getDataPeg($id){\r\n $q = \"SELECT KOLOK, KLOGAD,SPMU FROM PERS_PEGAWAI1 WHERE NRK='\".$id.\"'\";\r\n //$q = \"SELECT KOLOK, KLOGAD,SPMU FROM \\\"vw_jabatan_terakhir\\\" WHERE NRK='\".$id.\"'\";\r\n $query = $this->db->query($q)->row();\r\n \r\n return $query;\r\n }",
"function spefisik_data_pemberi($dataid_kuasa_akta)\n\t{\n\n\t\t# codenya sql sepert select*from penduduk where nik = $datanik dimna $datanik adalah yg sudah dipilih. jadi cuma 1 row.\n\t\t$query = $this->db->query(\"SELECT*FROM kuasa_akta left join penduduk on kuasa_akta.nik_pemberi_kuasa = penduduk.nik where id_kuasa_akta = $dataid_kuasa_akta\");\n\n\t\t// itu adalah perintah sql join 2 table, yaitupenduduk dan beda nama, karena data yanglenkap ada ditable pendudukjadiharus dijoin, \n\t\treturn $query->row();\n\t\t\n\t}",
"public function tarikTunai()\n {\n $sql = \"\n SELECT \n kas_bank.nama nama_akun,\n penjualan.nomor,\n profil.nama,\n t.jumlah\n FROM\n penjualan_tarik_tunai t\n JOIN\n penjualan ON penjualan.id = t.penjualan_id\n JOIN\n profil ON profil.id = penjualan.profil_id\n JOIN\n kas_bank ON kas_bank.id = t.kas_bank_id\n WHERE\n t.updated_at >= :tanggalAwal\n AND t.updated_at < :tanggalAkhir\n ORDER BY kas_bank.nama , penjualan.nomor \n \";\n\n if ($this->groupByProfil['inv']) {\n $sql = \"\n select nama_akun, nama, sum(jumlah) jumlah\n from ({$sql}) t\n group by nama_akun, nama\n order by nama_akun, nama\n \";\n }\n\n $command = Yii::app()->db->createCommand($sql);\n\n $command->bindValues([\n ':tanggalAwal' => $this->tanggalAwal,\n ':tanggalAkhir' => $this->tanggalAkhir\n ]);\n \n return $command->queryAll();\n }",
"public function dataRealRKO()\n\t{\n\t\t\n\t\t$rows = DB::select(\"\n\t\t\tSELECT\tROUND(IFNULL(SUM(a.nilai)/1000000,0),1) AS JML_REAL_RKO\n\t\t\tFROM d_rko_pagu2 a\n\t\t\tLEFT OUTER JOIN d_rko b ON(a.id_rko=b.id)\n\t\t\tLEFT OUTER JOIN(\n\t\t\t\tSELECT\ta.id_rko,\n\t\t\t\t\tb.nourut\n\t\t\t\tFROM(\n\t\t\t\t\tSELECT\tid_rko,\n\t\t\t\t\t\tMAX(id) AS max_id\n\t\t\t\t\tFROM d_rko_status\n\t\t\t\t\tGROUP BY id_rko\n\t\t\t\t) a\n\t\t\t\tLEFT OUTER JOIN d_rko_status b ON(a.max_id=b.id)\n\t\t\t) c ON(a.id_rko=c.id_rko)\n\t\t\tWHERE b.kdsatker=? AND b.thang=? AND c.nourut>=4\n\t\t\",[\n\t\t\tsession('kdsatker'),\n\t\t\tsession('tahun')\n\t\t]);\n\t\t\t\n\t\treturn $rows[0]->JML_REAL_RKO;\n\t\t\n\t}",
"function getMonitoringRuang($conn,$kodeunit, $periode,$tgl,$waktumin,$waktumax) {\n\t\t\t//array jenis\n\t\t\t$jeniskul=array('K'=>'Kuliah','P'=>'Praktikum','R'=>'Tutorial');\n\t\t\t$status=array('0'=>'Tatap Muka','-1'=>'Online');\t\n\t\t\t// mendapatkan ruang\n\t\t\t$sql = \"select koderuang from \".static::table('ms_ruang').\" where isaktif=-1 order by koderuang\";\n\t\t\t$rs = $conn->Execute($sql);\n\t\t\t\n\t\t\t//info left dan right\n\t\t\t$sql_unit=\"select infoleft, inforight from gate.ms_unit where kodeunit='$kodeunit'\";\n\t\t\t$unit=$conn->Execute($sql_unit);\t\t\t\n\t\t\t$u_row = $unit->FetchRow();\n\t\t\t\n\t\t\t$a_jadwal = array();\n\t\t\twhile($row = $rs->FetchRow())\n\t\t\t\t$a_jadwal[$row['koderuang']] = array();\n\t\t\t\n\t\t\t// mendapatkan jadwal\n\t\t\t$sql = \"select p.namadepan,p.gelardepan,p.namatengah,p.namabelakang,p.gelarbelakang,mu.namaunit,k.kodemk,m.namamk,k.kelasmk,k.tglkuliahrealisasi,\n\t\t\t\t\tkoderuangrealisasi,waktumulairealisasi,waktuselesairealisasi,k.jeniskuliah,k.isonline\n\t\t\t\t\tfrom \".static::table().\" k join \".static::table('ak_matakuliah').\" m using (thnkurikulum,kodemk)\n\t\t\t\t\tjoin akademik.ak_kelas kls using (thnkurikulum,kodemk,kelasmk,periode,kodeunit)\n\t\t\t\t\tleft join akademik.ak_mengajar am on am.thnkurikulum=kls.thnkurikulum and am.kodemk=kls.kodemk and am.kelasmk=kls.kelasmk and am.periode=kls.periode and am.kodeunit=kls.kodeunit\n\t\t\t\t\tleft join sdm.ms_pegawai p on p.idpegawai::text=am.nipdosen\n\t\t\t\t\tleft join gate.ms_unit mu on mu.kodeunit = k.kodeunit\n\t\t\t\t\tleft join gate.ms_unit u on u.kodeunit = k.kodeunit\n\t\t\t\t\twhere k.periode = '$periode' and k.tglkuliahrealisasi='$tgl' AND \n\t\t\t\t\t\t u.infoleft>='\".$u_row['infoleft'].\"' AND u.inforight<='\".$u_row['inforight'].\"'\";\n\t\t\t$rs = $conn->Execute($sql);\n\t\t\t\n\t\t\twhile($row = $rs->FetchRow()) {\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif($row['tglkuliahrealisasi'] == $tgl) {\n\t\t\t\t\t\t$t_jadwal = array();\n\t\t\t\t\t\t$t_jadwal['waktumulairealisasi'] = trim($row['waktumulairealisasi']);\n\t\t\t\t\t\t$t_jadwal['waktuselesairealisasi'] = trim($row['waktuselesairealisasi']);\n\t\t\t\t\t\t$t_jadwal['kodemk'] = $row['kodemk'];\n\t\t\t\t\t\t$t_jadwal['namamk'] = $row['namamk'];\n\t\t\t\t\t\t$t_jadwal['kelasmk'] = $row['kelasmk'];\n\t\t\t\t\t\t$t_jadwal['namaunit'] = $row['namaunit'];\n\t\t\t\t\t\t$t_jadwal['jeniskul'] = $jeniskul[$row['jeniskuliah']];\n\t\t\t\t\t\t$t_jadwal['status'] = $status[$row['isonline']];\n\t\t\t\t\t\t$t_jadwal['isonline'] = $row['isonline'];\n\t\t\t\t\t\t$t_jadwal['namadosen'] = $row['gelardepan'].' '.$row['namadepan'].' '.$row['namatengah'].' '.$row['namabelakang'].', '.$row['gelarbelakang'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t// hanya yang lengkap\n\t\t\t\t\t\tif(empty($t_jadwal['waktumulairealisasi']) or empty($t_jadwal['waktuselesairealisasi']))\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$a_jadwal[$row['koderuangrealisasi']][$t_jadwal['waktumulairealisasi']][] = $t_jadwal;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//masuykkan data untuk monitoring ujian\n\t\t\t$sqlujian=\"select uj.*,k.namamk,u.namaunit from \".static::table('ak_jadwalujian').\" uj\n\t\t\t\t\t\tjoin \".static::table('ak_kurikulum').\" k using (thnkurikulum,kodeunit,kodemk)\n\t\t\t\t\t\tjoin gate.ms_unit u using (kodeunit)\n\t\t\t\t\t\twhere uj.periode = '$periode' and uj.tglujian='$tgl' AND \n\t\t\t\t\t\t u.infoleft>='\".$u_row['infoleft'].\"' AND u.inforight<='\".$u_row['inforight'].\"'\";\n\t\t\t$rsujian = $conn->Execute($sqlujian);\n\t\t\twhile($rowujian = $rsujian->FetchRow()) {\n\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif($rowujian['tglujian'] == $tgl) {\n\t\t\t\t\t\t$t_jadwal = array();\n\t\t\t\t\t\t$t_jadwal['waktumulairealisasi'] = trim($rowujian['waktumulai']);\n\t\t\t\t\t\t$t_jadwal['waktuselesairealisasi'] = trim($rowujian['waktuselesai']);\n\t\t\t\t\t\t$t_jadwal['kodemk'] = $rowujian['kodemk'];\n\t\t\t\t\t\t$t_jadwal['namamk'] = $rowujian['namamk'];\n\t\t\t\t\t\t$t_jadwal['kelasmk'] = $rowujian['kelasmk'];\n\t\t\t\t\t\t$t_jadwal['namaunit'] = $rowujian['namaunit'];\n\t\t\t\t\t\t$t_jadwal['jeniskul'] = 'Ujian';\n\t\t\t\t\t\t$t_jadwal['status'] = 'Tatap Muka';\n\t\t\t\t\t\t$t_jadwal['isonline'] = -2;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// hanya yang lengkap\n\t\t\t\t\t\tif(empty($t_jadwal['waktumulairealisasi']) or empty($t_jadwal['waktuselesairealisasi']))\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$a_jadwal[$rowujian['koderuang']][$t_jadwal['waktumulairealisasi']][] = $t_jadwal;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// diurutkan dulu\n\t\t\tforeach($a_jadwal as $t_ruang => $t_jadwal)\n\t\t\t\tksort($a_jadwal[$t_ruang]);\n\t\t\t\n\t\t\t$a_bentrok = array();\n\t\t\tforeach($a_jadwal as $t_ruang => $t_mjadwal) {\n\t\t\t\t$t_lmulai = $waktumin;\n\t\t\t\t\n\t\t\t\tif(!empty($t_mjadwal)) {\n\t\t\t\t\tforeach($t_mjadwal as $t_ajadwal) {\n\t\t\t\t\t\tforeach($t_ajadwal as $t_jadwal) {\n\t\t\t\t\t\t\t$t_mulai = $t_jadwal['waktumulairealisasi'];\n\t\t\t\t\t\t\t$t_selesai = $t_jadwal['waktuselesairealisasi'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($t_mulai > $t_selesai) {\n\t\t\t\t\t\t\t\t$t_temp = $t_mulai;\n\t\t\t\t\t\t\t\t$t_mulai = $t_selesai;\n\t\t\t\t\t\t\t\t$t_selesai = $t_temp;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// tertumpuk jadwal lain\n\t\t\t\t\t\t\tif($t_selesai <= $t_lmulai and !empty($t_truang['id'])) {\n\t\t\t\t\t\t\t\t$a_bentrok[$t_truang['id']] = true;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// buat jadwal kosong\n\t\t\t\t\t\t\tif($t_mulai > $t_lmulai) {\n\t\t\t\t\t\t\t\t$t_truang = array();\n\t\t\t\t\t\t\t\t$t_truang['mulai'] = $t_lmulai;\n\t\t\t\t\t\t\t\t$t_truang['selesai'] = $t_mulai;\n\t\t\t\t\t\t\t\t$t_truang['lebar'] = Date::lamaMenit($t_lmulai,$t_mulai);\n\t\t\t\t\t\t\t\t$t_truang['status'] = false;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$a_truang[$t_ruang][] = $t_truang;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$t_lmulai = $t_mulai;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if($t_mulai < $t_lmulai) {\n\t\t\t\t\t\t\t\tif($t_selesai < $t_lmulai)\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$t_mulai = $t_lmulai;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($t_selesai > $waktumax)\n\t\t\t\t\t\t\t\t$t_selesai = $waktumax;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$t_truang = array();\n\t\t\t\t\t\t\t$t_truang['mulai'] = $t_mulai;\n\t\t\t\t\t\t\t$t_truang['selesai'] = $t_selesai;\n\t\t\t\t\t\t\t$t_truang['lebar'] = Date::lamaMenit($t_mulai,$t_selesai);\n\t\t\t\t\t\t\t$t_truang['status'] = true;\n\t\t\t\t\t\t\t$t_truang['keterangan'] = $t_jadwal['jeniskul'].'<br>'.$t_jadwal['kodemk'].' - '.$t_jadwal['namamk'].'<br>Kelas '.$t_jadwal['kelasmk'].': '.CStr::formatJam($t_mulai).' - '.CStr::formatJam($t_selesai).'<br>Prodi: '.$t_jadwal['namaunit'].'<br> Status: '.$t_jadwal['status'].'<br>Dosen: '.$t_jadwal['namadosen'];\n\t\t\t\t\t\t\t$t_truang['kodemk'] = $t_jadwal['kodemk'].' ('.$t_jadwal['kelasmk'].')';\n\t\t\t\t\t\t\t$t_truang['isonline'] = $t_jadwal['isonline'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$a_truang[$t_ruang][] = $t_truang;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$t_lmulai = $t_selesai;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// bila ada sisa\n\t\t\t\tif($t_lmulai < $waktumax) {\n\t\t\t\t\t$t_truang = array();\n\t\t\t\t\t$t_truang['mulai'] = $t_lmulai;\n\t\t\t\t\t$t_truang['selesai'] = $waktumax;\n\t\t\t\t\t$t_truang['lebar'] = Date::lamaMenit($t_lmulai,$waktumax);\n\t\t\t\t\t$t_truang['status'] = false;\n\t\t\t\t\t\n\t\t\t\t\t$a_truang[$t_ruang][] = $t_truang;\n\t\t\t\t\t\n\t\t\t\t\t$t_lmulai = $waktumax;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $a_truang;\n\t\t}",
"public function actionGetRiwayatAmbilKirimSample() {\n\t\theader(\"content-type:application/json\");\n $format = new MyFormatter();\n $data = array();\n $data['is_found'] = 0;\n $data['pesan'] = \"Data tidak ditemukan!\";\n $data['data'] = '';\n $statusPasien = '';\n\t\t$tglPendaftaran = '';\n\t\tif (isset($_GET['pasienmasukpenunjang_id'])) {\n\t\t\t$pasienmasukpenunjang_id = $_GET['pasienmasukpenunjang_id'];\n\t\t\t$sql = \"SELECT * FROM pengambilansample_t \"\n\t\t\t\t\t. \"JOIN samplelab_m ON pengambilansample_t.samplelab_id=samplelab_m.samplelab_id \"\n\t\t\t\t\t. \"WHERE pasienmasukpenunjang_id=\".$pasienmasukpenunjang_id;\n\t\t\t$loadData = Yii::app()->db->createCommand($sql)->queryAll();\t\n\t\t\t$i = 0;\n\t\t\tforeach ($loadData as $datum) {\n\t\t\t\t$data['data'][$i]['ambilsample']=$datum;\t\t\t\t\n\t\t\t\t$sql = \"SELECT * FROM kirimsamplelab_t \"\n\t\t\t\t\t. \"JOIN pengambilansample_t ON kirimsamplelab_t.pengambilansample_id=pengambilansample_t.pengambilansample_id \"\n\t\t\t\t\t. \"JOIN labklinikrujukan_m ON labklinikrujukan_m.labklinikrujukan_id=kirimsamplelab_t.labklinikrujukan_id \"\n\t\t\t\t\t. \"WHERE pengambilansample_t.pengambilansample_id=\".$datum['pengambilansample_id'];\n\t\t\t\t$loadData2 = Yii::app()->db->createCommand($sql)->queryRow();\t\t\t\t\n\t\t\t\tif (sizeof($loadData2)>0) {\t\n\t\t\t\t\t$data['data'][$i]['kirimsample']=$loadData2;\n\t\t\t\t}\n\t\t\t\t$data['is_found'] = 1;\n\t\t\t\t$data['pesan'] = \"Data ditemukan!\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n $encode = CJSON::encode($data);\n echo \"jsonCallback(\".$encode.\")\";\n\t}",
"function RekapByOPD_GetQuery($tgl, $KondisiKIB) {\r\n\t//left join (select c, d, e, sum(biaya_pemeliharaan ) as jmlHrgPD_PLH from v2_pindahtangan_pelihara where tgl_pemindahtanganan < '$tgl' and tambah_aset=1 $KondisiKIB group by c) hh on aa.c=hh.c\r\n\t//left join (select c, d, e, sum(biaya_pemeliharaan ) as jmlHrgGR_PLH from v2_gantirugi_pelihara where tgl_gantirugi < '$tgl' and tambah_aset=1 $KondisiKIB group by c) jj on aa.c=jj.c\r\n\r\n $sqry = \"\r\n\t\t(select aa.c as c, aa.d as d, aa.e as e, aa.nm_skpd,\r\n\t\t\tbb.jmlBrgHPS, bb.jmlHrgHPS, cc.jmlPLH, cc.jmlHrgPLH, dd.jmlAman, dd.jmlHrgAman, ee.jmlBrgBI, ee.jmlHrgBI,\r\n\t\t\tff.jmlHrgHPS_PLH, gg.jmlHrgHPS_AMAN, hh.jmlHrgPD_PLH, ii.jmlHrgPD_AMAN, kk.jmlHrgGR_AMAN, ll.jmlBrgPD, ll.jmlHrgPD\r\n\t\tfrom ref_skpd aa\r\n\t\t\tleft join (select c, d, e, sum(jml_barang) as jmlBrgHPS, sum(jml_harga ) as jmlHrgHPS from v_penghapusan_bi where tgl_penghapusan < '$tgl' $KondisiKIB group by c) bb on aa.c=bb.c\r\n\t\t\tleft join (select c, d, e, sum(jml_barang) as jmlBrgPD, sum(jml_harga ) as jmlHrgPD from v_pindahgantirugi_bi where tgl < '$tgl' $KondisiKIB group by c) ll on aa.c=ll.c\r\n\r\n\r\n\t\t\tleft join (select c, d, e, count(*) as jmlPLH, sum(biaya_pemeliharaan ) as jmlHrgPLH from v_pemelihara where tgl_pemeliharaan < '$tgl' and tambah_aset=1 $KondisiKIB group by c) cc on aa.c=cc.c\r\n\t\t\tleft join (select c, d, e, count(*) as jmlAman, sum(biaya_pengamanan ) as jmlHrgAman from v_pengaman where tgl_pengamanan < '$tgl' and tambah_aset=1 $KondisiKIB group by c) dd on aa.c=dd.c\r\n\t\t\tleft join (select c, d, e, sum(jml_barang) as jmlBrgBI, sum(jml_harga ) as jmlHrgBI from buku_induk where tgl_buku < '$tgl'\r\n\r\n\t\t\t\t$KondisiKIB group by c) ee on aa.c=ee.c\r\n\r\n\r\n\t\t\tleft join (select c, d, e, sum(biaya_pemeliharaan ) as jmlHrgHPS_PLH from v2_penghapusan_pelihara where tgl_penghapusan < '$tgl' and tambah_aset=1 $KondisiKIB group by c) ff on aa.c=ff.c\r\n\t\t\tleft join (select c, d, e, sum(biaya_pengamanan ) as jmlHrgHPS_AMAN from v2_penghapusan_pengaman where tgl_penghapusan < '$tgl' and tambah_aset=1 $KondisiKIB group by c) gg on aa.c=gg.c\r\n\r\n\t\t\tleft join (select c, d, e, sum(biaya_pemeliharaan ) as jmlHrgPD_PLH from v3_pindah_gantirugi_pelihara where tgl < '$tgl' and tambah_aset=1 $KondisiKIB group by c) hh on aa.c=hh.c\r\n\r\n\t\t\tleft join (select c, d, e, sum(biaya_pengamanan ) as jmlHrgPD_AMAN from v2_pindahtangan_pengaman where tgl_pemindahtanganan < '$tgl' and tambah_aset=1 $KondisiKIB group by c) ii on aa.c=ii.c\r\n\t\t\tleft join (select c, d, e, sum(biaya_pengamanan ) as jmlHrgGR_AMAN from v2_gantirugi_pengaman where tgl_gantirugi < '$tgl' and tambah_aset=1 $KondisiKIB group by c) kk on aa.c=kk.c\r\n\r\n\r\n\r\n\t\twhere aa.d='00' and aa.e='00'\r\n\t\t)union(\r\n\t\tselect aa.c as c, aa.d as d, aa.e as e, aa.nm_skpd,\r\n\t\t\tbb.jmlBrgHPS, bb.jmlHrgHPS, cc.jmlPLH, cc.jmlHrgPLH, dd.jmlAman, dd.jmlHrgAman, ee.jmlBrgBI, ee.jmlHrgBI,\r\n\t\t\tff.jmlHrgHPS_PLH, gg.jmlHrgHPS_AMAN, hh.jmlHrgPD_PLH, ii.jmlHrgPD_AMAN, kk.jmlHrgGR_AMAN, ll.jmlBrgPD, ll.jmlHrgPD\r\n\t\tfrom ref_skpd aa\r\n\t\t\tleft join (select c, d, e, sum(jml_barang) as jmlBrgHPS, sum(jml_harga ) as jmlHrgHPS from v_penghapusan_bi where tgl_penghapusan < '$tgl' $KondisiKIB group by c,d) bb on aa.c=bb.c and aa.d=bb.d\r\n\t\t\tleft join (select c, d, e, sum(jml_barang) as jmlBrgPD, sum(jml_harga ) as jmlHrgPD from v_pindahgantirugi_bi where tgl < '$tgl' $KondisiKIB group by c,d) ll on aa.c=ll.c and aa.d=ll.d\r\n\r\n\r\n\t\t\tleft join (select c, d, e, count(*) as jmlPLH, sum(biaya_pemeliharaan ) as jmlHrgPLH from v_pemelihara where tgl_pemeliharaan < '$tgl' and tambah_aset=1 $KondisiKIB group by c,d) cc on aa.c=cc.c and aa.d=cc.d\r\n\t\t\tleft join (select c, d, e, count(*) as jmlAman, sum(biaya_pengamanan ) as jmlHrgAman from v_pengaman where tgl_pengamanan < '$tgl' and tambah_aset=1 $KondisiKIB group by c,d) dd on aa.c=dd.c and aa.d=dd.d\r\n\t\t\tleft join (select c, d, e, sum(jml_barang) as jmlBrgBI, sum(jml_harga ) as jmlHrgBI from buku_induk where tgl_buku < '$tgl' $KondisiKIB group by c,d) ee on aa.c=ee.c and aa.d=ee.d\r\n\t\t\tleft join (select c, d, e, sum(biaya_pemeliharaan ) as jmlHrgHPS_PLH from v2_penghapusan_pelihara where tgl_penghapusan < '$tgl' and tambah_aset=1 $KondisiKIB group by c,d) ff on aa.c=ff.c and aa.d=ff.d\r\n\t\t\tleft join (select c, d, e, sum(biaya_pengamanan ) as jmlHrgHPS_AMAN from v2_penghapusan_pengaman where tgl_penghapusan < '$tgl' and tambah_aset=1 $KondisiKIB group by c,d) gg on aa.c=gg.c and aa.d=gg.d\r\n\r\n\t\t\tleft join (select c, d, e, sum(biaya_pemeliharaan ) as jmlHrgPD_PLH from v3_pindah_gantirugi_pelihara where tgl < '$tgl' and tambah_aset=1 $KondisiKIB group by c,d) hh on aa.c=hh.c and aa.d=hh.d\r\n\r\n\t\t\tleft join (select c, d, e, sum(biaya_pengamanan ) as jmlHrgPD_AMAN from v2_pindahtangan_pengaman where tgl_pemindahtanganan < '$tgl' and tambah_aset=1 $KondisiKIB group by c,d) ii on aa.c=ii.c and aa.d=ii.d\r\n\r\n\t\t\tleft join (select c, d, e, sum(biaya_pengamanan ) as jmlHrgGR_AMAN from v2_gantirugi_pengaman where tgl_gantirugi < '$tgl' and tambah_aset=1 $KondisiKIB group by c,d) kk on aa.c=kk.c\tand aa.d=kk.d\r\n\r\n\r\n\t\twhere aa.d <>'00' and aa.e='00'\r\n\t\t)union(\r\n\t\tselect aa.c as c, aa.d as d, aa.e as e, aa.nm_skpd,\r\n\t\t\tbb.jmlBrgHPS, bb.jmlHrgHPS, cc.jmlPLH, cc.jmlHrgPLH, dd.jmlAman, dd.jmlHrgAman, ee.jmlBrgBI, ee.jmlHrgBI,\r\n\t\t\tff.jmlHrgHPS_PLH, gg.jmlHrgHPS_AMAN, hh.jmlHrgPD_PLH, ii.jmlHrgPD_AMAN, kk.jmlHrgGR_AMAN, ll.jmlBrgPD, ll.jmlHrgPD\r\n\t\tfrom ref_skpd aa\r\n\t\t\tleft join (select c, d, e, sum(jml_barang) as jmlBrgHPS, sum(jml_harga ) as jmlHrgHPS from v_penghapusan_bi where tgl_penghapusan < '$tgl' $KondisiKIB group by c,d,e) bb on aa.c=bb.c and aa.d=bb.d and aa.e=bb.e\r\n\t\t\tleft join (select c, d, e, sum(jml_barang) as jmlBrgPD, sum(jml_harga ) as jmlHrgPD from v_pindahgantirugi_bi where tgl < '$tgl' $KondisiKIB group by c,d,e) ll on aa.c=ll.c and aa.d=ll.d and aa.e=ll.e\r\n\r\n\r\n\t\t\tleft join (select c, d, e, count(*) as jmlPLH, sum(biaya_pemeliharaan ) as jmlHrgPLH from v_pemelihara where tgl_pemeliharaan < '$tgl' and tambah_aset=1 $KondisiKIB group by c,d,e) cc on aa.c=cc.c and aa.d=cc.d and aa.e=cc.e\r\n\t\t\tleft join (select c, d, e, count(*) as jmlAman, sum(biaya_pengamanan ) as jmlHrgAman from v_pengaman where tgl_pengamanan < '$tgl' and tambah_aset=1 $KondisiKIB group by c,d,e) dd on aa.c=dd.c and aa.d=dd.d and aa.e=dd.e\r\n\t\t\tleft join (select c, d, e, sum(jml_barang) as jmlBrgBI, sum(jml_harga ) as jmlHrgBI from buku_induk where tgl_buku < '$tgl' $KondisiKIB group by c,d,e) ee on aa.c=ee.c and aa.d=ee.d and aa.e=ee.e\r\n\t\t\tleft join (select c, d, e, sum(biaya_pemeliharaan ) as jmlHrgHPS_PLH from v2_penghapusan_pelihara where tgl_penghapusan < '$tgl' and tambah_aset=1 $KondisiKIB group by c,d,e) ff on aa.c=ff.c and aa.d=ff.d and aa.e=ff.e\r\n\t\t\tleft join (select c, d, e, sum(biaya_pengamanan ) as jmlHrgHPS_AMAN from v2_penghapusan_pengaman where tgl_penghapusan < '$tgl' and tambah_aset=1 $KondisiKIB group by c,d,e) gg on aa.c=gg.c and aa.d=gg.d and aa.e=gg.e\r\n\r\n\t\t\tleft join (select c, d, e, sum(biaya_pemeliharaan ) as jmlHrgPD_PLH from v3_pindah_gantirugi_pelihara where tgl < '$tgl' and tambah_aset=1 $KondisiKIB group by c,d,e) hh on aa.c=hh.c and aa.d=hh.d and aa.e=hh.e\r\n\r\n\t\t\tleft join (select c, d, e, sum(biaya_pengamanan ) as jmlHrgPD_AMAN from v2_pindahtangan_pengaman where tgl_pemindahtanganan < '$tgl' and tambah_aset=1 $KondisiKIB group by c,d,e) ii on aa.c=ii.c and aa.d=ii.d and aa.e=ii.e\r\n\r\n\t\t\tleft join (select c, d, e, sum(biaya_pengamanan ) as jmlHrgGR_AMAN from v2_gantirugi_pengaman where tgl_gantirugi < '$tgl' and tambah_aset=1 $KondisiKIB group by c,d,e) kk on aa.c=kk.c and aa.d=kk.d\tand aa.e=kk.e\r\n\r\n\r\n\t\twhere aa.c<>'00' and aa.d <>'00' and aa.e<>'00'\r\n\t\t)\r\n\t\torder by c, d, e\r\n\t\t\";\r\n //echo $sqry;\r\n return $sqry;\r\n}",
"function get_list_data_rute_by_kode_frekuensi($params) {\n $sql = \"SELECT a.*, kode_izin, kode_frekuensi,\n (\n IF(SUBSTRING(b.dos, 1, 1) = 0, 0, 1) + IF(SUBSTRING(b.dos, 2, 1) = 0, 0, 1) + IF(SUBSTRING(b.dos, 3, 1) = 0, 0, 1) +\n IF(SUBSTRING(b.dos, 4, 1) = 0, 0, 1) + IF(SUBSTRING(b.dos, 5, 1) = 0, 0, 1) + IF(SUBSTRING(b.dos, 6, 1) = 0, 0, 1) +\n IF(SUBSTRING(b.dos, 7, 1) = 0, 0, 1)\n )'frekuensi', \n aircraft_type, aircraft_capacity, dos, ron, pairing, izin_start_date, izin_expired_date,\n izin_penundaan_start, izin_penundaan_end\n FROM izin_data a\n INNER JOIN izin_rute b ON a.izin_id = b.izin_id\n WHERE b.kode_frekuensi = ? AND airlines_id = ? AND b.izin_active = '1'\";\n $query = $this->db->query($sql, $params);\n // echo $this->db->last_query();\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Changes the value of a specific lab component in the lab order | public function changeValue(LabComponent $lab_component, $value)
{
// clean input
if (! is_numeric($value)) {
throw new Exception("The value of the lab component must be a number");
}
// Lab order not in the database, store and move on (not sure about this one, as it might be better to throw an exception instead)
if (! $this->labOrderInDatabase()) {
$this->createLabOrder();
}
// lab test for the given patient is not in the database, which is a serious problem
if (! $this->labTestInDatabase($lab_component)) {
throw new Exception("This lab test has not been ordered for the patient");
}
// lab test id for the current component to have the results updated
$lab_test_id = $this->getLabTestId($lab_component);
$query = "UPDATE `PatientLabTests` SET `Value` = :Value WHERE `PatientLabTestId` = :PatientLabTestId;";
$stmt_change_value = $this->con->prepare($query);
$stmt_change_value->bindParam(":Value", $value);
$stmt_change_value->bindParam(":PatientLabTestId", $lab_test_id);
$stmt_change_value->execute();
} | [
"function SetRowLabelValue($row, $value){}",
"function setLabel();",
"public function setLabel($value) { $this->_label = $value; }",
"function setValueLabel($valueLabel = \"\") {\n $this->valueLabel = $valueLabel;\n }",
"abstract protected function updateValue();",
"public function setLabel() {\n }",
"function update_tb_lab($id_lab,$params)\n {\n $this->db->where('id_lab',$id_lab);\n return $this->db->update('tb_lab',$params);\n }",
"private function changesku(){\t \r\n\t $this->chartValue(); //adding to output\r\n\t $this->idleStHealthChk(); //adding to output\r\n\t}",
"function SetColLabelValue($col, $value){}",
"private function updateSpecificTest(LaboratoryTest $labTest, string $result)\n {\n $labTest->result = $result;\n $labTest->save();\n }",
"public function setComponent($name, $value)\n {\n $this->components[$name]['value'] = $value;\n $this->components[$name]['type'] = filter_var($value, FILTER_VALIDATE_INT) !== false ? (int) $value : (string) $value;\n }",
"public function setAssignedValue($value){ }",
"function setScore( &$value )\r\n {\r\n $this->Score = $value;\r\n }",
"protected function setComponentValue($component, $value, $unit_type) {\n $this->components[$component] = $this->getUnit($unit_type)->toBase($value);\n }",
"function setLabel($label=\"\"){\n\t\t\t$this->obj->label = $label;\t\n\t\t}",
"function SetColLabelValue($col, $label){}",
"function setLabel($label){\r\n\t\t$this->label = $label;\r\n\t}",
"public function setCustomizedLabel(?string $value): void {\n $this->getBackingStore()->set('customizedLabel', $value);\n }",
"public function _setLabName($labName) {\n\t\t$this->_labName = $labName;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if an InputArgument object exists by name or position. | public function hasArgument($name)
{
return $this->_input->hasArgument($name);
} | [
"public function hasArgument($name);",
"public function hasArgument($name)\n {\n return isset($this->arguments[$name]);\n }",
"public function existsNamedArg($name)\n {\n return array_key_exists($name, $this->args);\n }",
"public function has_argument($name) {\n if (isset($this->_request_arguments[$name])) {\n return true;\n } else {\n return false;\n }\n }",
"public function hasArgumentAtPosition($position)\n {\n return isset($this->arguments[$position]);\n }",
"private function isArgumentDefined($position)\n {\n return isset($this->definedArguments[$position]);\n }",
"public function hasInput($name);",
"private function issetArgument(string $arg): bool\n {\n return array_key_exists($arg, $this->scriptArguments);\n }",
"public function existArgumentsInAttribute(array $arguments, ReflectionAttribute $attribute): bool;",
"public function argumentValueIsSet(string $name) : bool;",
"public function acceptsArguments()\n {\n return ($this->argumentName !== null);\n }",
"public function hasArgument($key) {}",
"public function hasArgumentByShortName($name)\n\t{\n\t\tforeach ($this->arguments as $arg) {\n\t\t\tif ($arg->getShortName() == $name) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function defined($name, array $argv = null)\n {\n // The argument isn't defined if it's not defined by the calling code.\n if (!$this->exists($name)) {\n return false;\n }\n\n $argument = $this->arguments[$name];\n $command_arguments = $this->getArguments($argv);\n\n foreach ($command_arguments as $command_argument) {\n if ($this->isArgument($argument, $command_argument)) {\n return true;\n }\n }\n\n return false;\n }",
"public function hasInput();",
"function argExists($arg, $cmd_list) \n{ \n\t$k = array_search($arg, $cmd_list); \n\tif ($k != FALSE) {\n\t\treturn TRUE;\n\t}\n\telse {\n\t\treturn FALSE; \n\t}\n}",
"private static function _hasArgument() {\n\t\treturn (self::$_argi < self::$_argc);\n\t}",
"public function offsetExists($name)\n {\n return array_key_exists($name, $this->parameters);\n }",
"protected function hasArgument(string $name, Config $config): bool\n {\n foreach ($config->getArguments() as $argument) {\n if ($argument->getName() === $name) {\n return true;\n }\n }\n\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the filter group symbol | function getFilterGroupSymbolic() {
return $this->_filterGroupSymbolic;
} | [
"public static function getTemplateGroupSymbol()\n {\n return self::$_templateGroupSymbol;\n }",
"public function getGroupOperator()\n\t{\n\t\treturn $this->groupOperator; \n\n\t}",
"function &getFilterGroup() {\n\t\treturn $this->_filterGroup;\n\t}",
"protected static function _getDefaultFilterGroup()\n {\n return get_called_class() . 'Filter';\n }",
"public static function get_filter_group($tag) {\n\t\t\t$tag = self::sanitize($tag);\n\t\t\t$delimiter = \"from\";\n\t\t\t\n\t\t\t$filter_group = false;\n\t\t\tif ($words = explode(\" \", $tag)) {\n\t\t\t\tif ($key = array_search($delimiter, $words)) {\n\t\t\t\t\t$filter_group = trim($words[$key+1]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $filter_group;\n\t\t}",
"public function getCurrencyGroupSeparator(){\r\n return $this->currencyGroupSeparator;\r\n }",
"public function getGroupFormat(): string {}",
"public function getFilterSeparator(): string\n {\n return \"~\";\n }",
"protected function FormatGroupBy()\n {\n return self::FormatCSC('GROUP BY', $this->group_by);\n }",
"public function getGroupingSeparator(): string\n {\n return $this->groupingSeparator;\n }",
"public function getGroupFormat() {}",
"public function getSymbol()\r\n {\r\n return \"#\";\r\n }",
"public function group() {\n\t\treturn ($this->contribution) ? $this->contribution->getGroup()->title : '';\n\t}",
"public function getGroupingSeparator()\n {\n return $this->groupingSeparator;\n }",
"public function getFilter(): string\n {\n return $this->_filter;\n }",
"public function getFilterGroupsDataProvider()\n {\n\n return [\n 'equal' => [\n 'operator' => '==',\n ],\n 'in' => [\n 'operator' => '()',\n ],\n ];\n }",
"public function get_group_key() {\n\t\treturn $this->sort_group_column_key;\n\t}",
"public function getFilterName(): string;",
"private function _get_group_by() {\n if (isset($this->group_by)) {\n if (is_array($this->group_by)) {\n $this->group_by = implode(',' . \"\\n\\t\", $this->group_by);\n }\n return 'GROUP BY' . \"\\n\" . \"\\t\" . $this->group_by . \"\\n\" . '';\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests moving a node to first child below it's current position. | public function test_move_to_first_child_below()
{
$root_node = ORM::factory('test_orm_mptt', 1);
$node_3 = ORM::factory('test_orm_mptt', 3);
$node_3->move_to_first_child($root_node);
$node_2 = ORM::factory('test_orm_mptt', 2);
// Make sure the parent_id was set correctly
$this->assertEquals(1, $node_3->parent_id);
// Make sure the space was adjusted correctly
$this->assertEquals(2, $node_3->lft);
$this->assertEquals(7, $node_3->rgt);
$this->assertEquals(8, $node_2->lft);
$this->assertEquals(9, $node_2->rgt);
} | [
"public function test_move_to_first_child_above()\r\n\t{\r\n\t\t$node_3 = ORM::factory('test_orm_mptt', 3);\r\n\t\t$node_2 = ORM::factory('test_orm_mptt', 2);\r\n\t\t\r\n\t\t$node_2->move_to_first_child($node_3);\r\n\t\t\r\n\t\t$node_3->reload();\r\n\t\t$node_4 = ORM::factory('test_orm_mptt', 4);\r\n\r\n\t\t// Make sure the parent_id was set correctly\r\n\t\t$this->assertEquals(3, $node_2->parent_id);\r\n\t\t\r\n\t\t// Make sure the space was adjusted correctly\r\n\t\t$this->assertEquals(3, $node_2->left());\r\n\t\t$this->assertEquals(4, $node_2->right());\r\n\t\t$this->assertEquals(9, $node_3->right());\r\n\t\t$this->assertEquals(5, $node_4->left());\r\n\t\t$this->assertEquals(8, $node_4->right());\r\n\t}",
"public function moveToFirstChildNode(): bool\n {\n $moved = FALSE;\n $node = $this->currentNode->firstChild;\n \n if ($node instanceof \\DOMNode) {\n $this->currentNode = $node;\n $moved = TRUE;\n }\n \n return $moved;\n }",
"public function testMoveToFirstChildNodeReturnsTrueAndMovesCursorWhenCursorOnElementNodeWhithChildNode(): void\n {\n $sut = new XmlTraverser($this->getXml('firstchildnode_0002.xml'));\n \n // Before.\n $beforeValue = \"\\n\".\n \" <!-- Comment -->\\n\".\n \" <first>foo</first>\\n\";\n self::assertSame('root', $sut->getLocalName());\n self::assertSame('http://example.org', $sut->getNamespace());\n self::assertSame($beforeValue, $sut->getValue());\n \n self::assertTrue($sut->moveToFirstChildNode());\n \n // After.\n self::assertSame('', $sut->getLocalName());\n self::assertSame('', $sut->getNamespace());\n self::assertSame(\"\\n \", $sut->getValue());\n }",
"public function testMoveToFirstChildNodeReturnsFalseAndDoesNotMoveCursorWhenCursorOnElementNodeWhithNoChildNode(): void\n {\n $sut = new XmlTraverser($this->getXml('firstchildnode_0001.xml'));\n \n $localName = 'root';\n $namespace = 'http://example.org';\n $value = '';\n \n // Before.\n self::assertSame($localName, $sut->getLocalName());\n self::assertSame($namespace, $sut->getNamespace());\n self::assertSame($value, $sut->getValue());\n \n self::assertFalse($sut->moveToFirstChildNode());\n \n // After.\n self::assertSame($localName, $sut->getLocalName());\n self::assertSame($namespace, $sut->getNamespace());\n self::assertSame($value, $sut->getValue());\n }",
"public abstract function moveBelow($node);",
"public function testFindFirstChild() {\n\t\t$node = $this->loadNode(0,NI_LEVELS-1);\n\t\t$child = $node->firstChild()->find();\n\n\t\t$this->assertTrue($child->isChildOf($node));\n\t\t$this->assertEquals(1,$child->getPosition());\n\t\t$this->assertEquals($child,$node->firstChild);\n\t}",
"public function move_to_first_child($target)\n\t{\n\t\treturn $this->move($target, TRUE, 1, 1, TRUE);\n\t}",
"public function moveToLeftOf($node);",
"function setNodeAsFirstChild($node, $target)\r\n {\r\n return $this->_moveSubtree($node, $target[$this->left_column_name]+1);\r\n }",
"public function testMoveChildren(): void\n {\n $this->createChildren();\n $parent = $this->dm->find($this->type, '/functional/parent');\n $child = $parent->allChildren->first();\n\n $this->dm->move($child, '/functional/elsewhere');\n\n $this->dm->flush();\n $this->dm->clear();\n\n $child = $this->dm->find(null, '/functional/elsewhere');\n $this->assertInstanceOf($this->type, $child);\n $parent = $this->dm->find(null, '/functional/parent');\n $this->assertInstanceOf($this->type, $parent);\n $this->assertCount(3, $parent->allChildren);\n }",
"public function testMoveToFirstChildNodeReturnsTrueAndMovesCursorWhenCursorOnAttributeNode(): void\n {\n $sut = new XmlTraverser($this->getXml('firstchildnode_0003.xml'));\n $sut->moveToFirstAttribute();\n \n // Before.\n self::assertSame('first', $sut->getLocalName());\n self::assertSame('http://example.org', $sut->getNamespace());\n self::assertSame('foo', $sut->getValue());\n \n self::assertTrue($sut->moveToFirstChildNode());\n \n // After.\n self::assertSame('', $sut->getLocalName());\n self::assertSame('', $sut->getNamespace());\n self::assertSame('foo', $sut->getValue());\n }",
"public function test_insert_as_first_child()\r\n\t{\r\n\t\t$node_3 = ORM::factory('test_orm_mptt', 3);\r\n\t\t$node_4 = ORM::factory('test_orm_mptt', 4);\r\n\t\t\r\n\t\t$child_node = ORM::factory('test_orm_mptt')->insert_as_first_child($node_3);\r\n\t\t\r\n\t\t$node_3->reload();\r\n\t\t$node_4->reload();\r\n\t\t\r\n\t\t$this->assertTrue($child_node->is_child($node_3));\r\n\r\n\t\t// Make sure the parent_id was set correctly\r\n\t\t$this->assertEquals(3, $child_node->parent_id);\r\n\t\t\r\n\t\t// Make sure the space was adjusted correctly\r\n\t\t$this->assertEquals(5, $child_node->lft);\r\n\t\t$this->assertEquals(11, $node_3->rgt);\r\n\t\t$this->assertEquals(7, $node_4->lft);\r\n\t}",
"public function moveAsFirst($target)\n\t{\n\t\treturn $this->moveNode($target, $target->{$this->leftAttribute} + 1, 1);\n\t}",
"public function testMoveNode()\n {\n }",
"public function testMoveChildToNthChild_Right() {\n\t\t$n = rand(3,NI_CHILDREN);\n\t\t// Get a node positioned below $n\n\t\t$node = $this->loadNode(1,NI_LEVELS-1,1,$n-1);\n\n\t\t$target = $node->parent()->find();\n\t\t$descendants = $target->descendants()->count();\n\n\t\t$this->assertNotEquals($node->name,$target->child($n)->find()->name);\n\t\t$this->assertEquals($node->descendants()->count()+1,$node->moveToNthChild($target,$n));\n\n\t\t$this->assertEquals($descendants,$target->descendants()->count());\n\t\t$this->assertEquals($node->name,$target->child($n)->find()->name);\n\t\t$this->assertKeyEquals($node,$target->getChild($n));\n\t}",
"protected function moveFirstChildBefore()\n\t{\n\t\t$branches = $this->getBranches();\n\t\t$this->choose->parentNode->insertBefore(array_pop($branches)->firstChild, $this->choose);\n\t\tforeach ($branches as $branch)\n\t\t{\n\t\t\t$branch->removeChild($branch->firstChild);\n\t\t}\n\t}",
"public function moveAsFirst($target) {\n return $this->moveNode($target, $target->{$this->leftAttribute} + 1, 1);\n }",
"public function moveChildsBefore($nodeId);",
"public function moveAsFirstChildOf(CActiveRecord $node, CActiveRecord $parentNode)\n\t{\n\t\t$this->getProperties($colLeft, $colRight, $colLevel, $colParent);\n\t\tif ($parentNode === $node || $node->isAncestorOf($parentNode)) {\n\t\t\tthrow new CException(\"Cannot move node as first child of itself or into a descendant\");\n\t\t\treturn false;\n\t\t}\n\t\t$oldLevel = $node->$colLevel;\n\t\t$node->$colLevel = $parentNode->$colLevel + 1;\n\t\t$node->$colParent = $parentNode->getPrimaryKey();\n\t\t$node->save();\n\t\t$this->_updateNode($node, $parentNode->$colLeft + 1, $node->$colLevel - $oldLevel);\n\n\t\treturn true;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the register user card information, to use it when we prepare the checkout. | public function registerUserCard()
{
$this->register_user_card = true;
return $this;
} | [
"public function setCreditCardUser($creditCardUser) { $this->creditCardUser = $creditCardUser ; }",
"private function setStripeDetails()\n {\n $this->setStripeApi();\n $token = $this->stripeCardToken();\n $this->stripeCustomerId = $this->stripeCustomerId($token);\n $this->cardBrand =$token->card->brand;\n $this->cardLastFour = $token->card->last4;\n }",
"private function fillUserWithDetails() {\n\t\t$email = $this->user->getEmail();\n\t\t$this->user = $this->usersRepository->getUser($email);\n\t}",
"private function saveUserCardDetails($cardVendor, $cardShortCode)\n {\n }",
"public function setCard(Request $request)\n {\n $user = auth()->user();\n\n if (is_null($user->meta->sitecpayment_id) && $request->input('sitecpaymentToken')) {\n $user->meta->createAsSierraTecnologiaCustomer($request->input('sitecpaymentToken'));\n } elseif ($request->input('sitecpaymentToken')) {\n $user->meta->updateCard($request->input('sitecpaymentToken'));\n }\n\n return redirect('store/account/card')->with('message', 'Successfully set your credit card');\n }",
"public function set_user_data() {\n\t\tglobal $current_user;\n\n\t\t$this->current_user = $current_user;\n\n\t\t$this->debug();\n\t}",
"function setUserCardId( $id )\n {\n $this -> userCardId = $id;\n }",
"function learn_press_checkout_user_form_register() {\n\t\tlearn_press_get_template( 'checkout/form-register.php' );\n\t}",
"private function fillPincode(User $user, Request $request) {\n $user->Pincode = $request->pincode;\n }",
"protected function _prepareRegisterToken(){\r\n\r\n $payment = $this->_service->getPayment();\r\n $helper = $this->_getHelper();\r\n $cards = Mage::getModel('realex/realex_source_cards');\r\n $transactionReference = $this->_service->getTransactionReference();\r\n\r\n\r\n $request = array(\r\n 'attributes' => array(\r\n 'timestamp' => $helper->getTimestamp(),\r\n 'type' => 'card-new'\r\n ),\r\n 'merchantid' => array('value' => $helper->getConfigData('realex','vendor')),\r\n 'orderid' => array('value' => $transactionReference . '-card')\r\n );\r\n\r\n $card = array(\r\n\r\n 'ref' => array('value' => $helper->getCardReference($cards->getGatewayCardType($payment->getCcType()))),\r\n 'payerref' => array('value' => $this->_payerRef),\r\n 'number'=>array('value' => ($this->_service->getMd('card_number')?$this->_service->getMd('card_number'):$payment->getCcNumber())),\r\n 'expdate' =>array('value' => $helper->getCreditCardDate($payment)),\r\n 'chname' => array('value' => ($helper->ss($payment->getCcOwner(),100))),\r\n 'type' => array('value' => $cards->getGatewayCardType($payment->getCcType())),\r\n );\r\n\r\n if($payment->getCcSsIssue()){\r\n $card['issueno'] = array('value' => $payment->getCcSsIssue());\r\n }\r\n\r\n $request['card'] = $card;\r\n\r\n $sha1hash = array(\r\n $request['attributes']['timestamp'] ,\r\n $request['merchantid']['value'],\r\n $request['orderid']['value'],\r\n '',\r\n '',\r\n $this->_payerRef,\r\n $request['card']['chname']['value'],\r\n $request['card']['number']['value']\r\n );\r\n\r\n $request['sha1hash'] = array('value' => $helper->generateSha1Hash($helper->getConfigData('realex','secret'),$sha1hash));\r\n\r\n $this->_message->setData(array('request'=>$request));\r\n return $this;\r\n\r\n\r\n }",
"public function registeruser() {\n $this->register();\n\n }",
"function _save_user_details()\n\t{\n\t\t$txn_id = $this->session->userdata('txn_id');\n\t\t$this->database->SaveUserIdOnCheckout($this->tank_auth->get_user_id(), $txn_id);\n\n\t\t//Address must be there else _validate_address() will fail\n\t}",
"public function addCard(\\Pley\\Entity\\User\\User $user, \\Pley\\Payment\\Method\\CreditCard $card);",
"public function add_card_to_user($data) {\r\n\t\t$info = array(\r\n\t\t\t\"card_id\" => $data['card_id']\r\n\t\t);\r\n\t\t$this->db->where('user_id', $data['user_id']);\r\n\t\t$this->db->update('user_wallet_id', $info);\r\n\t}",
"public function setDefaultUserValues() {\n $this->setAttributes([\n 'name' => $this->user->getName(),\n 'email' => $this->user->email,\n 'phone' => $this->user->profile->phone,\n 'address' => $this->user->profile->getFullAddress(),\n ]);\n }",
"public function initUser()\n {\n $userData = $this->repository->getUser($this->getAuthIdentifier());\n\n if ($userData) {\n foreach ($userData as $key => $value) {\n $this->{$key} = $value;\n }\n }\n\n $this->initialized = true;\n }",
"function merchantRegister($userDetails){\n\ttry {\n\t\t$user = new MangoPay\\UserLegal();\n\t\t$user->Name \t\t\t\t\t\t\t\t\t= $userDetails['CompanyName'];\n\t\t$user->Email \t\t\t\t\t\t\t\t\t= $userDetails['Email'];\n\t\t$user->LegalPersonType \t\t\t\t\t\t\t= \"BUSINESS\";\n\t\t$user->LegalRepresentativeFirstName\t\t\t\t= $userDetails['FirstName'];\n\t\t$user->LegalRepresentativeLastName \t\t\t\t= $userDetails['LastName'];\n\t\t$user->LegalRepresentativeEmail\t\t\t\t\t= $userDetails['Email'];\n\t\t$user->HeadquartersAddress\t\t\t\t\t\t= $userDetails['Address'];\n\t\t$user->LegalRepresentativeBirthday \t\t\t\t= strtotime($userDetails['Birthday']);\n\t\t$user->LegalRepresentativeNationality\t\t\t= $userDetails['Country'];\n\t\t$user->LegalRepresentativeCountryOfResidence\t= $userDetails['Country'];\n\t\t$user->Tag\t\t\t\t\t\t\t\t\t\t= 'Merchant - ' . $userDetails['CompanyName'];\n\t\t\n\t\t//call create function\n\t\t$createdUser \t\t\t\t= $mangoPayApi->Users->Create($user);\n\t\tif(isset($createdUser->Id)) {\n\t\t\treturn $createdUser->Id;\n\t\t}\n\t\telse {\n\t\t\treturn 0;\n\t\t}\n\t}\n\tcatch(Exception $e) {\n\t\treturn $e;//error in field values\n\t}\n}",
"protected function _initUser()\n {\n if ($this->_oUser = $this->getUser()) {\n if ($this->getViewConfig()->isUserLoggedIn()) {\n $this->_oUser->setType(KlarnaUser::LOGGED_IN);\n }\n } else {\n $this->_oUser = KlarnaUtils::getFakeUser($this->_aOrderData['billing_address']['email']);\n }\n\n $oCountry = oxNew(Country::class);\n $this->_oUser->oxuser__oxcountryid = new Field(\n $oCountry->getIdByCode(\n strtoupper($this->_aOrderData['billing_address']['country'])\n ),\n Field::T_RAW\n );\n\n $oBasket = Registry::getSession()->getBasket();\n $oBasket->setBasketUser($this->_oUser);\n\n\n }",
"public function register() {\n\n\t\terror_log('try ufRegister');\n $user = $this->ufRegister();\n\t\terror_log('ufRegister done');\n $this->storeOAuth($user->id);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate internal style for HB Column Layout. | function mkhb_column_layout( $options ) {
$style = '';
// Column Padding.
if ( ! empty( $options['padding'] ) ) {
$style .= "padding: {$options['padding']};";
}
// Column Margin.
if ( ! empty( $options['margin'] ) ) {
$style .= "margin: {$options['margin']};";
}
return $style;
} | [
"function column_styles(){\n _e('<style type=\"text/css\">');\n foreach ($this->column_styles as $column => $styles) {\n _e('.widefat .column-'.$column.' { '.$styles.' }');\n }\n _e('</style>');\n }",
"function ep_add_order_column_styles() {\n\t?><style>\n\t\t.column-menu_order {\n\t\t\twidth: 10%;\n\t\t}\n\t</style><?php\n}",
"function exultic_columns_styles() {\r\n\techo \"\\n\".'<style type=\"text/css\">\r\n .column-exultic_post_id, .column-exultic_attachments_id { width: 50px; }\r\n .column-exultic_post_attachments { width: 100px; }\r\n .column-author { width: 130px!important; }\r\n</style>'.\"\\n\";\r\n}",
"protected function generateCSS() {}",
"public abstract function outputCssStyle();",
"function voyage_mikado_sidebar_columns_class() {\n\n\t\t$sidebar_class = array();\n\t\t$sidebar_layout = voyage_mikado_sidebar_layout();\n\n\t\tswitch($sidebar_layout):\n\t\t\tcase 'sidebar-33-right':\n\t\t\t\t$sidebar_class[] = 'mkdf-two-columns-66-33';\n\t\t\t\tbreak;\n\t\t\tcase 'sidebar-25-right':\n\t\t\t\t$sidebar_class[] = 'mkdf-two-columns-75-25';\n\t\t\t\tbreak;\n\t\t\tcase 'sidebar-33-left':\n\t\t\t\t$sidebar_class[] = 'mkdf-two-columns-33-66';\n\t\t\t\tbreak;\n\t\t\tcase 'sidebar-25-left':\n\t\t\t\t$sidebar_class[] = 'mkdf-two-columns-25-75';\n\t\t\t\tbreak;\n\n\t\tendswitch;\n\n\t\t$sidebar_class[] = 'clearfix';\n\n\t\treturn voyage_mikado_class_attribute($sidebar_class);\n\n\t}",
"function admin_column_classes() {\n $output = 'pz-xs-12';\n \n switch ($this->admin_column_width) {\n case 3:\n $output .= ' pz-sm-3 pz-md-6 pz-lg-3';\n break;\n case 4:\n $output .= ' pz-sm-4 pz-md-6 pz-lg-4';\n break;\n case 6:\n $output .= ' pz-sm-6';\n break;\n }\n \n return $output;\n }",
"function aton_qodef_sidebar_columns_class() {\n\n $sidebar_class = array();\n $sidebar_layout = aton_qodef_sidebar_layout();\n\n switch($sidebar_layout):\n case 'sidebar-33-right':\n $sidebar_class[] = 'qodef-two-columns-66-33';\n break;\n case 'sidebar-25-right':\n $sidebar_class[] = 'qodef-two-columns-75-25';\n break;\n case 'sidebar-33-left':\n $sidebar_class[] = 'qodef-two-columns-33-66';\n break;\n case 'sidebar-25-left':\n $sidebar_class[] = 'qodef-two-columns-25-75';\n break;\n\n endswitch;\n\n $sidebar_class[] = 'clearfix';\n\n return aton_qodef_class_attribute($sidebar_class);\n\n }",
"function moments_qodef_sidebar_columns_class() {\n\n\t\t$sidebar_class = array();\n\t\t$sidebar_layout = moments_qodef_sidebar_layout();\n\n\t\tswitch ( $sidebar_layout ):\n\t\t\tcase 'sidebar-33-right':\n\t\t\t\t$sidebar_class[] = 'qodef-two-columns-66-33';\n\t\t\t\tbreak;\n\t\t\tcase 'sidebar-25-right':\n\t\t\t\t$sidebar_class[] = 'qodef-two-columns-75-25';\n\t\t\t\tbreak;\n\t\t\tcase 'sidebar-33-left':\n\t\t\t\t$sidebar_class[] = 'qodef-two-columns-33-66';\n\t\t\t\tbreak;\n\t\t\tcase 'sidebar-25-left':\n\t\t\t\t$sidebar_class[] = 'qodef-two-columns-25-75';\n\t\t\t\tbreak;\n\n\t\tendswitch;\n\n\t\t$sidebar_class[] = 'clearfix';\n\n\t\treturn moments_qodef_class_attribute( $sidebar_class );\n\n\t}",
"function setDimensionStyle($column_number,$style) {\n \n \n return null;\n }",
"public function addHighlighting()\n {\n $styledColumns = [];\n foreach ($this->rows as $key => $column)\n {\n $styledColumn = $column;\n if (is_array($column))\n {\n $auditColumn = AuditDataLayer::searchInRowSet('column_name', $column['column_name'], $this->auditColumns);\n // Highlighting for data table column types and audit.\n if (!empty($column['data']))\n {\n if (isset($column['data']) && !isset($column['audit']))\n {\n if (!isset($column['column_name']))\n {\n $styledColumns[$key - 1]['column_name'] = sprintf('<mm_column>%s</>', $styledColumns[$key - 1]['column_name']);\n }\n $styledColumn['column_name'] = sprintf('<mm_column>%s</>', $styledColumn['column_name']);\n $styledColumn['data'] = sprintf('<mm_type>%s</>', $styledColumn['data']);\n }\n else if (!isset($column['data']) && isset($column['audit']))\n {\n $styledColumn['audit'] = sprintf('<mm_type>%s</>', $styledColumn['audit']);\n }\n else if (strcmp($column['data'], $column['audit']))\n {\n if (!isset($column['column_name']))\n {\n $styledColumns[$key - 1]['column_name'] = sprintf('<mm_column>%s</>', $styledColumns[$key - 1]['column_name']);\n }\n $styledColumn['column_name'] = sprintf('<mm_column>%s</>', $styledColumn['column_name']);\n $styledColumn['data'] = sprintf('<mm_type>%s</>', $styledColumn['data']);\n $styledColumn['audit'] = sprintf('<mm_type>%s</>', $styledColumn['audit']);\n }\n }\n else\n {\n if (!isset($column['data']) && isset($column['audit']) && !isset($auditColumn))\n {\n $styledColumn['audit'] = sprintf('<mm_type>%s</>', $styledColumn['audit']);\n }\n // Highlighting for audit table column types and audit_columns in config file.\n $searchColumn = AuditDataLayer::searchInRowSet('column_name', $styledColumn['column_name'], $this->auditColumns);\n if (isset($searchColumn))\n {\n $configType = $this->auditColumns[$searchColumn]['column_type'];\n if (isset($configType) && !isset($column['audit']))\n {\n $styledColumn['column_name'] = sprintf('<mm_column>%s</>', $styledColumn['column_name']);\n $styledColumn['config'] = sprintf('<mm_type>%s</>', $styledColumn['config']);\n }\n else if (!isset($configType) && isset($column['audit']))\n {\n $styledColumn['audit'] = sprintf('<mm_type>%s</>', $column['audit']);\n }\n else if (strcmp($configType, $column['audit']))\n {\n $styledColumn['column_name'] = sprintf('<mm_column>%s</>', $styledColumn['column_name']);\n $styledColumn['audit'] = sprintf('<mm_type>%s</>', $column['audit']);\n $styledColumn['config'] = sprintf('<mm_type>%s</>', $styledColumn['config']);\n }\n }\n else\n {\n if (strcmp($styledColumn['audit'], $styledColumn['config']))\n {\n if (!isset($column['column_name']))\n {\n $styledColumns[$key - 1]['column_name'] = sprintf('<mm_column>%s</>', $styledColumns[$key - 1]['column_name']);\n }\n $styledColumn['column_name'] = sprintf('<mm_column>%s</>', $styledColumn['column_name']);\n $styledColumn['audit'] = sprintf('<mm_type>%s</>', $column['audit']);\n $styledColumn['config'] = sprintf('<mm_type>%s</>', $styledColumn['config']);\n }\n }\n }\n }\n $styledColumns[] = $styledColumn;\n }\n\n $this->rows = $styledColumns;\n }",
"function get_column_header_colour() {\n return array(217, 217, 217);\n }",
"private function drawColumns()\n {\n for($column = 1; $column < $this->week_length; $column++) {\n $column_x = ($column * $this->grid_column_width) + $this->grid_bounding_x1;\n $this->line(\n $column_x,\n $this->padding + $this->header_height,\n $column_x,\n $this->y - $this->padding - 1,\n 1\n );\n }\n }",
"public static function getDefaultColumnLayout() {}",
"function _buildHeader()\r\n {\r\n $cnt = 0;\r\n foreach ($this->_dg->columnSet as $column) {\r\n //Define Content\r\n $str = $column->columnName;\r\n $this->_worksheet->write(0, $cnt, $str);\r\n $cnt++;\r\n }\r\n }",
"function _buildHeader()\n {\n $cnt = 0;\n foreach ($this->_dg->columnSet as $column) {\n //Define Content\n $str = $column->columnName;\n $this->_worksheet->write(0, $cnt, $str);\n $cnt++;\n }\n }",
"public function renderCellLayout()\n {\n $x = $this->oPdf->GetX();\n $y = $this->oPdf->GetY();\n\n //border size BORDER_SIZE\n $this->oPdf->SetLineWidth( $this->getBorderSize() );\n\n if ( !$this->isTransparent() )\n {\n //fill color = BACKGROUND_COLOR\n list ( $r, $g, $b ) = $this->getBackgroundColor();\n $this->oPdf->SetFillColor( $r, $g, $b );\n }\n\n //Draw Color = BORDER_COLOR\n list ( $r, $g, $b ) = $this->getBorderColor();\n $this->oPdf->SetDrawColor( $r, $g, $b );\n\n $this->oPdf->Cell( $this->getCellDrawWidth(), $this->getCellDrawHeight(), '', $this->getBorderType(), 0, '', !$this->isTransparent() );\n\n $this->oPdf->SetXY( $x, $y );\n }",
"public function headerColumnsProvider()\n {\n return [[new \\Urbania\\AppleNews\\Format\\TableColumnStyle()]];\n }",
"protected function customizeColumnsConfig()\n {\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
================================================================================================================== Getters ================================================================================================================== Getter of settings key | public function get_settings_key() {
return $this->settings_key;
} | [
"public function get_setting_key(){\n\t\treturn $this->v_setting_key;\n\t}",
"public function get_option_key() {\n return $this->plugin_id . $this->id . '_settings';\n }",
"public function settingsKey($key)\n {\n if (!is_array($this->settings) || !isset($this->settings[$key])) {\n return false;\n }\n\n return $this->settings[$key];\n }",
"public function getConfigKey(): string\n {\n return self::CONFIG_KEY;\n }",
"public function getConfigKey()\n {\n return self::CONFIG_KEY;\n }",
"public function configKey()\n {\n return $this->configKey;\n }",
"public function getConfigKey(): string\n {\n return $this->configKey;\n }",
"public function getSettingName()\n\t{\n\t\treturn $this->setting_name;\n\t}",
"abstract protected function _settingsKeys();",
"public function get_sitekey() {\n\t\treturn get_option( $this->setting_sitekey );\n\t}",
"public function get_setting_id() {\n\n\t\treturn $this->setting_id;\n\t}",
"public static function firstSettingsTabKey()\n {\n return static::settingsTabs()->tabs[0]->key;\n }",
"static function get_setting( $key ) {\n\t\t$settings = self::get_settings();\n\t\tif ( isset( $settings[$key] ) ) {\n\t\t\treturn $settings[$key];\n\t\t}\n\t\treturn false;\n\t}",
"function getSetting($key, $setting_type)\n {\n return App\\Settings::getSetting($key, $setting_type);\n }",
"public function getKey()\n {\n return Config::getKey(get_class($this->config));\n }",
"public function settingsCacheKey()\n {\n return 'user.settings.'.$this->id;\n }",
"function getConfigurationKey() ;",
"function get_settings_nonce_key() {\n return $this->get_plugin_prefix_slug() . '-save-settings';\n }",
"final public function get_poll_settings_meta_key() {\n\t\treturn 'forminator_addon_' . $this->addon->get_slug() . '_poll_settings';\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When no files are found then throw exception. | public function testWhenNoFilesAreFoundThenThrowException()
{
$applicationPath = '/project/Dokra/sample/application';
$storage = \Mockery::mock('FileStorage')->makePartial();
$storage->shouldReceive('files')->with($applicationPath)->once()->andReturn([]);
/** @var \Dokra\Application $app */
$app = \Mockery::mock(Application::class)->makePartial();
$app->setConfig(Application::STORAGE, $storage);
$app->setConfig(Application::PROJECT_PATH, $applicationPath);
$app->addTask(Task::SCAN_FILES);
$app->run();
} | [
"protected function detectMissingFiles() {}",
"public function testMissingFile()\n {\n $this->expectException(\\InvalidArgumentException::class);\n \n processor::processFile('tests/testfiles/nofile.xml');\n }",
"public function testGettingFilesWithInvalidPath()\n {\n $this->assertEquals([], $this->fileSystem->getFiles(__FILE__));\n }",
"public function testNoSuchFile()\n {\n try\n {\n $filePart = new ezcMailFile( dirname( __FILE__) . \"/data/fly_not_exit.jpg\" );\n }\n catch ( ezcBaseFileNotFoundException $e )\n {\n return;\n }\n $this->fail( \"Invalid file failed or wrong exception thrown\" );\n }",
"public function testFileNotFoundThrowsExceptionWithFileNotFound() {\n\t\tthrow FileSystemException::withFileNotFound(\"/file/not/found.ext\");\n\t}",
"public function checkFiles() {\n $iterator = new FilesystemIterator($this->recordPath, FilesystemIterator::SKIP_DOTS);\n $count = iterator_count($iterator);\n\n if (\n $count < 3\n ||\n !file_exists($this->transcriptionsPath)\n ||\n !file_exists($this->fileidsPath)\n ) {\n throw new Exception('User\\'s model directory doesn\\'t contain files for adaptation!');\n }\n }",
"public function filesMustExist();",
"public function testNotExistsFile()\n {\n $file = 'test.csv';\n $format = 'csv';\n\n try {\n $reader = ImportFactory::getReader($format, $file);\n $this->fail('Must throw FileNotFoundException');\n } catch (FileNotFoundException $ex) {\n\n }\n }",
"public function testInvokeThrowsExceptionIfFileDoesNotExist()\n\t{\n\t\t$this->setExpectedException('InvalidArgumentException');\n\t\t\n\t\t(new Validate())(vfsStream::url('path/to/bar.php'));\n\t\t\n\t\treturn;\n\t}",
"public function testFileNotFoundException()\n {\n $this->expectException(FileNotFoundException::class);\n $this->_file_ext_detector->detect('tests/Helpers/file0.jpg');\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 }",
"public function testListDirAndFilesIsFalse()\n {\n $fileFinder = new FileFinder();\n $directory = 'public/file-finder/not-found';\n\n // list all directories and files\n $directory = storage_path(\"app/\" . $directory);\n $result = $fileFinder->listDirAndFiles($directory);\n\n $this->assertTrue(count($result) == 0);\n }",
"public function testAddFileMethodThrowsExpectedExceptionForFileThatNotExists()\n {\n $engine = $this->createEngineFixture();\n $engine->addFile($this->createRunResourceURI('pdepend_'));\n }",
"private function _throwExceptionIfBaseDirectoryDoesNotExists()\n {\n if (!file_exists($this->_baseDirectory)) {\n throw new \\Exception(\"Base directory does not exists\");\n }\n }",
"public function testThrowExceptionOnPassedNonExistsFile()\n {\n $this->expectException(Exception::class);\n $this->expectExceptionMessageRegExp('~is not readable~i');\n\n new StaticReference(null);\n }",
"function check_files($filenames) {\n if (\n !is_dir($filenames->dir)\n || !file_exists($filenames->parser)\n || !file_exists($filenames->intr)\n || !file_exists($filenames->xml)\n || !file_exists($filenames->cfg)\n ){\n fwrite(STDERR, \"ERROR: Invalid File was specified\\n\");\n exit(41);\n }\n}",
"private function assertFilenameExists()\n {\n if (is_null($this->file_name)) {\n throw new Exception(\"Filename is required\");\n }\n }",
"public function testExpectFileNotFoundException()\n {\n // We are expecting the Exception to be thrown ...\n $this->expectException(\\Exceptions\\FileSystem\\FileNotFoundException::class);\n\n // Let's get the exception to throw\n $file = __DIR__ . 'directory/image_0.png';\n\n if ( ! file_exists($file) ) {\n throw new \\Exceptions\\FileSystem\\FileNotFoundException();\n }\n }",
"public function testExpectNotAFileException()\n {\n // We are expecting the Exception to be thrown ...\n $this->expectException(\\Exceptions\\FileSystem\\NotAFileException::class);\n\n // Let's get the exception to throw\n $file = __DIR__ . 'directory';\n\n if ( ! is_file($file) ) {\n throw new \\Exceptions\\FileSystem\\NotAFileException();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Sum of values in matrix between coordinates queued | public function sumCube($line, $xArray, $yArray, $zArray, $matrix) {
$coordinate = explode(" ", substr($line, 6, strlen($line) - 1));
if(count($coordinate) == 6) {
$suma=0;
$this->sortArray($xArray,'a');
foreach($xArray as $x) {
if($x < $coordinate[0] || $x > $coordinate[3]) {
continue;
}
$this->sortArray($yArray[$x], 'a');
foreach($yArray[$x] as $y) {
if($y < $coordinate[1] || $y > $coordinate[4]) {
continue;
}
$this->sortArray($zArray[$x][$y], 'a');
foreach($zArray[$x][$y] as $z){
if(($z < $coordinate[2]) || ($z > $coordinate[5])) {
continue;
}
$suma += (int)$matrix[$x][$y][$z];
}
}
}
return $suma . "<br>";
} else {
exit;
}
} | [
"function sum(Matrix $matrix) {\n if($matrix->col == $this->col && $this->row == $matrix->row) {\n $result = new Matrix($this->col, $this->row);\n for($i = 1; $i <= $this->row; $i++)\n for ($i2 = 1; $i2 <= $this->col; $i2++)\n $result->setValue($i, $i2, $matrix->mat[$i][$i2] + $this->mat[$i][$i2]);\n\n return $result;\n }\n else\n return trigger_error(\"not same size matrix, couldn't sum values\");\n }",
"function sum_adjacent_cells($matrix, $row, $column) {\n\n $sum = 0;\n\n // offsets clockwise\n $sum += $matrix[$row][$column - 1];\n $sum += $matrix[$row - 1][$column - 1];\n $sum += $matrix[$row - 1][$column];\n $sum += $matrix[$row - 1][$column + 1];\n $sum += $matrix[$row][$column + 1];\n $sum += $matrix[$row + 1][$column + 1];\n $sum += $matrix[$row + 1][$column];\n $sum += $matrix[$row + 1][$column - 1];\n\n return $sum;\n}",
"public function testSumMatrix()\n {\n $numArray = NumPHP::arange(1, 12)->reshape(3, 4);\n\n $expectedNumArray = new NumArray(78);\n $this->assertNumArrayEquals($expectedNumArray, $numArray->sum());\n }",
"public function sum(int|float|\\numphp\\matrix $value): matrix {\n if ($value instanceof self) {\n if ($this->row != $value->row || $this->col != $value->col) {\n self::_err('Inavlid matrix size');\n }\n $ar = $this->copyMatrix();\n for ($i = 0; $i < $this->row; ++$i) {\n for ($j = 0; $j < $this->col; ++$j) {\n $ar->data[$i * $this->col + $j] += $value->data[$i * $this->col + $j];\n }\n }\n return $ar;\n } else {\n $ar = $this->copyMatrix();\n for ($i = 0; $i < $this->row; ++$i) {\n for ($j = 0; $j < $this->col; ++$j) {\n $ar->data[$i * $this->col + $j] += $value;\n }\n }\n return $ar;\n }\n }",
"function matrixElementsSum(array $matrix): int\n{\n $summary = array_sum($matrix[0]);\n $rowLength = count($matrix);\n $elemLength = count($matrix[0]);\n\n for ($i = 1; $i < $rowLength; $i++) {\n for ($j = 0; $j < $elemLength; $j++) {\n if ($matrix[$i - 1][$j] === 0) {\n $matrix[$i][$j] = 0;\n }\n }\n $summary += array_sum($matrix[$i]);\n }\n\n return $summary;\n}",
"function sum()\n {\n return array_sum($this->values);\n }",
"public function sum() {\n\t\treturn array_sum($this->val());\n\t}",
"private function sum_positions($x1, $y1, $z1, $x2, $y2, $z2){\n\t\t$sum = 0;\n\t\tfor ( $x = $x1; $x <= $x2; $x++ ){\n\t\t\tfor ( $y = $y1; $y <= $y2; $y++ ){\n\t\t\t\tfor ( $z = $z1; $z <= $z2; $z++ ){\n\t\t\t\t\t$sum += $this->getValues($x, $y, $z);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $sum;\n\t}",
"public function sum() : ColumnVector\n {\n return ColumnVector::quick(array_map('array_sum', $this->a));\n }",
"public function sum() {\n $sum= 0;\n for ($i= 0, $s= sizeof($this->series[0]->values); $i < $s; $i++) {\n $sum+= $this->series[0]->values[$i];\n }\n return $sum;\n }",
"public function testSumMatrixAxis2()\n {\n $numArray = NumPHP::arange(1, 12)->reshape(3, 4);\n\n $numArray->sum(2);\n }",
"function add_matrix ($a,$b,$rows,$cols) {\n $mx = array();\n for ($i=0; $i<$rows; $i++) {\n\t\tfor ($j=0; $j<$cols; $j++) {\n\t\t\t$mx[$i][$j] = $a[$i][$j]+$b[$i][$j];\n\t\t}\n }\n return($mx);\n}",
"public function sum()\n {\n return array_sum($this->values);\n }",
"public function sum()\n {\n return array_sum($this->toArray());\n }",
"function getSumWXY(){ \n $SumWXY = 0.0; \n for ($i = 0; $i < $this->n; $i++) {\n $SumWXY += ($this->W[$i]*$this->X[$i]*$this->Y[$i]);\n }\n return $SumWXY;\n }",
"public function sum()\n {\n return array_sum($this->data);\n }",
"public function calcSum()\n {\n return array_sum($this->outcome);\n }",
"public function computeGlobalMatrix($matrix) {\n\t\t$CM = $this->zcm;\n\t\tforeach ($CM as $k => $v) {\n\t\t\t$CM[$k] = array_sum(array_column($matrix, $k));\n\t\t}\n\t\treturn $CM;\n\t}",
"function array_sum (array $array) {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SVWUpdateCurrent Update the current SVW settings. | public function SVWUpdateCurrent(\Controle\SVW\UpdateCurrent $parameters) {
return $this->__soapCall(
'SVW_UpdateCurrent',
array($parameters),
array('uri'=>'https://api.nmbrs.nl/soap/v2.1/CompanyService')
);
} | [
"public function SVWUpdateCurrent(\\Controle\\sub1\\sub2\\SVW\\UpdateCurrent $parameters) {\n return $this->__soapCall(\n 'SVW_UpdateCurrent',\n array($parameters),\n array('uri'=>'https://api.nmbrs.nl/soap/v2.1/CompanyService')\n );\n\t}",
"public function SVWUpdateCurrent(\\Controle\\sub1\\sub2\\SVW\\UpdateCurrent $parameters) {\n return $this->__soapCall(\n 'SVW_UpdateCurrent',\n array($parameters),\n array('uri'=>'https://api.nmbrs.nl/soap/v2.1/EmployeeService')\n );\n\t}",
"function syndicate_out_update_settings( $currentSettings ) {\n\n\t\t$newSettings = $currentSettings;\n\t\tswitch ( $currentSettings['options_version'] ) {\n\t\t\tcase 0: case 1: # Upgrades version 0 or 1 to version 2\n\t\t\t\tunset( $newSettings['options_version'] );\n\t\t\t\t$newSettings['group'][0] = $newSettings;\n\t\t\tcase 2: # Upgrades from version 2 to version 3; adds authenticated and api\n\t\t\t\tif ( isset( $newSettings['group'] ) && is_array( $newSettings['group'] ) ) {\n\t\t\t\t\tforeach ( $newSettings['group'] AS $groupId => $groupArray ) {\n\t\t\t\t\t\tif ( isset( $groupArray['servers'] ) && is_array( $groupArray['servers'] ) ) {\n\t\t\t\t\t\t\tforeach ( $groupArray['servers'] AS $serverId => $serverDetails ) {\n\t\t\t\t\t\t\t\tif ( ! isset( $serverDetails['authenticated'] ) ) {\n\t\t\t\t\t\t\t\t\t$newSettings['group'][$groupId]['servers'][$serverId]['authenticated'] = null;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( ! isset( $serverDetails['api'] ) ) {\n\t\t\t\t\t\t\t\t\t$newSettings['group'][$groupId]['servers'][$serverId]['api'] = null;\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\tbreak;\n\t\t}\n\t\t$newSettings['options_version'] = SO_OPTIONS_VERSION;\n\t\tupdate_option( 'so_options', $newSettings );\n\n\t}",
"public function updateSettings();",
"private function update_current_version_code() {\n\t\tupdate_option( DLM_Constants::OPTION_CURRENT_VERSION, DLM_VERSION );\n\t}",
"public function update_settings() {\n\n $this->system_settings_model->save( $_POST, 1 );\n\n // Send back a simple JSON response to confirm.\n $array[] = array( 'type' => 'System settings updated' );\n $this->json_library->print_array_json( $array );\n }",
"function update_extension($current='')\n\t{\n\t\tglobal $DB;\n\n\t\tif ($current == '' OR $current == $this->version)\n\t\t\treturn FALSE;\n\n\t\t// update the version\n\t\t$DB->query(\"UPDATE exp_extensions SET version = '\" . $DB->escape_str($this->version) . \"' WHERE class = '\" . get_class($this) . \"'\");\n\t}",
"public function update() {\r\n\t\t$update_version = get_option( 'mainwp_child_update_version' );\r\n\r\n\t\tif ( $update_version === $this->update_version ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tMainWP_Helper::update_option( 'mainwp_child_update_version', $this->update_version, 'yes' );\r\n\t}",
"public function WageTaxUpdateCurrent(\\Controle\\sub1\\sub2\\WageTax\\UpdateCurrent $parameters) {\n return $this->__soapCall(\n 'WageTax_UpdateCurrent',\n array($parameters),\n array('uri'=>'https://api.nmbrs.nl/soap/v2.1/EmployeeService')\n );\n\t}",
"public function update()\n {\n $currentVersion = $this->getCurrentVersion();\n\n $updatesToRun = $this->updateList->getUpdatesToRun($currentVersion);\n\n $this->log->info(\"Starting global update.\", [\n \"updatesToRun\" => $updatesToRun->pluck(\"name\")->all()\n ]);\n\n foreach ($updatesToRun as $update)\n $this->runUpdate($update, $currentVersion);\n }",
"public function WageTaxUpdateCurrent(\\Controle\\WageTax\\UpdateCurrent $parameters) {\n return $this->__soapCall(\n 'WageTax_UpdateCurrent',\n array($parameters),\n array('uri'=>'https://api.nmbrs.nl/soap/v2.1/EmployeeService')\n );\n\t}",
"public function update($current = '')\n\t{\n\t\t// Are they the same?\n\t\tif ($current >= $this->version)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$current = str_replace('.', '', $current);\n\n\t\t// Two Digits? (needs to be 3)\n\t\tif (strlen($current) == 2) $current .= '0';\n\n\t\t$update_dir = PATH_THIRD.strtolower($this->module_name).'/updates/';\n\n\t\t// Does our folder exist?\n\t\tif (@is_dir($update_dir) === TRUE)\n\t\t{\n\t\t\t// Loop over all files\n\t\t\t$files = @scandir($update_dir);\n\n\t\t\tif (is_array($files) == TRUE)\n\t\t\t{\n\t\t\t\tforeach ($files as $file)\n\t\t\t\t{\n\t\t\t\t\tif ($file == '.' OR $file == '..' OR strtolower($file) == '.ds_store') continue;\n\n\t\t\t\t\t// Get the version number\n\t\t\t\t\t$ver = substr($file, 0, -4);\n\n\t\t\t\t\t// We only want greater ones\n\t\t\t\t\tif ($current >= $ver) continue;\n\n\t\t\t\t\trequire $update_dir . $file;\n\t\t\t\t\t$class = 'FormsUpdate_' . $ver;\n\t\t\t\t\t$UPD = new $class();\n\t\t\t\t\t$UPD->do_update();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Upgrade The Module\n\t\t$this->EE->db->set('module_version', $this->version);\n\t\t$this->EE->db->where('module_name', ucfirst($this->module_name));\n\t\t$this->EE->db->update('exp_modules');\n\n\t\treturn TRUE;\n\t}",
"public function setCurrentVal_getCurrentVal() {}",
"function update_settings()\n {\n }",
"public function updateCurrent() {\n $this->current = [];\n for($i = 0; $i < sizeof($this->nodes); $i++) {\n $node = $this->nodes[$i];\n $this->current[] = $node->current();\n }\n $this->updateKey();\n }",
"public function updateSettings()\n {\n\n }",
"public function update()\n\t{\n\t\t$this->title = LocalConfiguration::get('app.title');\n\t\t$this->version = LocalConfiguration::get('app.version');\n\t\t$this->enable = LocalConfiguration::get('app.enable');\n\t}",
"public function update($current = '')\n\t{\n\t\t// Are they the same?\n\t\tif ($current >= $this->version)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// For Version < 2.0\n \tif ($current < '2.0' )\n \t{\n\n \t}\n\n\t\t// Upgrade The Module\n\t\t$this->EE->db->set('module_version', $this->version);\n\t\t$this->EE->db->where('module_name', ucfirst($this->module_name));\n\t\t$this->EE->db->update('exp_modules');\n\n\t\treturn TRUE;\n\t}",
"public function update()\n\t{\n\t\t// Store version of the installed plugin for future updates\n\t\tupdate_option('gdd_spr_version', self::VERSION);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
discardAllTickets resets ticket list | public function discardAllTickets()
{
$result = $this->client->DiscardAllTickets();
$this->errorHandling($result, 'Could not discard all tickets at FRITZ!Box');
} | [
"private function deleteAllTickets()\n {\n unset($_SESSION['shoppingCart']);\n }",
"public function clearAllTicketCodes() {\r\n\t\t$this->ticketCodes = array();\r\n\t\t$this->saveCodesToSession();\r\n\t}",
"public function cancel()\n {\n\n foreach ($this->tickets as $ticket)\n {\n $ticket->release();\n }\n }",
"public function unsetTicketName(): void\n {\n $this->ticketName = [];\n }",
"function unblock_all() {\n\t\t$this->blocked = array();\n\t}",
"public function clearSoPickedLotserials()\n {\n $this->collSoPickedLotserials = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function reset(): void\n {\n $this->issues = [];\n }",
"public function resetAll()\n\t{\n\t\tif(isset($_SESSION['token'])) unset($_SESSION['token']);\n\t}",
"public function resetMessagesAll();",
"public function unmarkAllExecutions() {}",
"public function clearInvTransferLotserials()\n {\n $this->collInvTransferLotserials = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearRequests()\n {\n $this->pendingRequests = [];\n }",
"public function clearBuyListings()\n {\n $this->collBuyListings = null; // important to set this to NULL since that means it is uninitialized\n $this->collBuyListingsPartial = null;\n }",
"public function clearSitTicketsUsuarioss()\n\t{\n\t\t$this->collSitTicketsUsuarioss = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public static function unmarkAll() {\n\t\tWCF::getSession()->unregister('markedThreads');\n\t}",
"public static function unmarkAll() {\n\t\tWCF::getSession()->unregister('markedStories');\n\t}",
"public function clearAllTournaments()\n\t{\n\t\t$this->tournaments = array();\n\t}",
"public function clearSitTicketsReasignadoss()\n\t{\n\t\t$this->collSitTicketsReasignadoss = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function cancelAllSessionOrders() : array;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the Doctrine entity manager. | protected function getEntityManager()
{
return $this->getService('doctrine')->getManager();
} | [
"public function getManager()\n {\n return $this->get('doctrine.orm.entity_manager');\n }",
"public function getEntityManager()\n {\n return $this->serviceLocator->get('doctrine.entitymanager.orm_default');\n }",
"public static function getEntityManager() {\n return self::container()->get('manager.entity');\n }",
"private function getEntityManager() {\n return $this->entity_manager;\n }",
"protected function entityManager() {\n\t\treturn $this->serviceLocator->get('Doctrine\\ORM\\EntityManager');\n\t}",
"protected function getDoctrine_Orm_EntityManagerService()\n {\n return $this->get('doctrine.orm.default_entity_manager');\n }",
"public function getEntityManager()\n {\n return $this['orm.em'];\n }",
"public function getManager()\r\n\t{\r\n\t\treturn $this->em;\r\n\t}",
"protected function getManager()\n {\n if ($this->em == NULL) {\n $this->em = $this->getDoctrine()->getManager();\n }\n return $this->em;\n }",
"public function getEntityManager()\n {\n $this->init();\n return $this->em;\n }",
"protected function getEntityManager()\n {\n if (null === $this->entityManager) {\n $this->setEntityManager($this->getServiceLocator()->get('Doctrine\\ORM\\EntityManager'));\n }\n return $this->entityManager;\n }",
"protected function getEntityManager()\n {\n if (null === $this->entityManager) \n {\n $this->setEntityManager($this->getServiceLocator()->get('Doctrine\\ORM\\EntityManager'));\n\t}\n return $this->entityManager;\n }",
"static public function getEntitymanager() {\n return Adapter::getInstance()->getEntitymanager();\n }",
"protected function getDoctrineManager()\n {\n return Doctrine_Manager::getInstance();\n }",
"protected function getEntityManager() {\n\t\treturn (!$this->entityManager) ?\n\t\t\t\t$this->\n\t\t\t\tsetEntityManager(\n\t\t\t\t\t$this->getServiceLocator()->get('Doctrine\\ORM\\EntityManager')\n\t\t\t\t)->entityManager\n\t\t\t\t:\n\t\t\t\t$this->entityManager;\n\t}",
"public static function getEntityManager()\n {\n if (self::$entityManager === null)\n {\n self::connectToDatabase();\n }\n return self::$entityManager;\n }",
"public function getEntityManager()\n {\n if (empty(static::$entityManager)) {\n $config = Setup::createAnnotationMetadataConfiguration(Settings::getEntityPaths(), Settings::isDevMode());\n $connection = Settings::getDbConnection();\n\n static::$entityManager = LooEntityManager::create($connection, $config);\n }\n\n return static::$entityManager;\n }",
"public function getDbEntityManager()\n {\n return $this['db.orm.em'];\n }",
"public static function getEntityManager(){\n\n $isDevMode = true;\n $proxyDir = null;\n $cache = null;\n $useSimpleAnnotationReader = false;\n $config = Setup::createAnnotationMetadataConfiguration(array(__DIR__ . \"/../Service\"), $isDevMode, $proxyDir, $cache, $useSimpleAnnotationReader);\n\n // database configuration parameters\n $conn = array(\n 'driver' => 'pdo_mysql',\n 'host' => '172.20.0.1',\n 'dbname' => 'phonebook',\n 'user' => 'root',\n 'password' => 'example'\n );\n\n // obtaining the entity manager\n return $entityManager = EntityManager::create($conn, $config);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is this itemId in the expanded list? | function isExpanded ($itemId)
{
if (!isset ($_GET['expand']))
{
return false;
}
$expanded = explode (",", $_GET['expand']);
while (list ($key, $val) = each($expanded))
{
if ($val == $itemId)
{
//
// yep, in the expanded list
//
return true;
}
}
return false;
} | [
"function IsExpanded(wxTreeItemId $item){}",
"public function hasItemIdsList()\n {\n return $this->item_ids !== null;\n }",
"public function isExpanded() {}",
"public function hasItemId()\n {\n return $this->item_id !== null;\n }",
"protected function isItemAdded(): bool\n {\n return in_array($this->id, $this->items);\n }",
"public function detailVisible()\n {\n foreach ($this->Items as $item) {\n if (StartsString(\"detail_\", $item->Name) && $item->Visible) {\n return true;\n }\n }\n return false;\n }",
"private function inItem()\n\t{\n\t\tif ($this->version == 'RSS 1.0' || $this->version == 'RSS 2.0')\n\t\t{\n\t\t\tif (in_array('ITEM', $this->insideItem) && $this->currentTag != 'ITEM')\n\t\t\treturn TRUE;\n\t\t} elseif ($this->version == 'ATOM 1') {\n\t\t\tif (in_array('ENTRY', $this->insideItem) && $this->currentTag != 'ENTRY')\n\t\t\treturn TRUE; \n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}",
"function hasItem() {\n foreach($this->item_list as $list) {\n if($list->count() > 0)\n return true;\n }\n\n return false;\n }",
"private function inItem()\n\t{\n\t\tif($this->version == 'RSS 1.0' || $this->version == 'RSS 2.0')\n\t\t{\n\t\t\tif(in_array('ITEM', $this->insideItem) && $this->currentTag != 'ITEM')\n\t\t\treturn TRUE;\n\t\t}\n\t\telseif($this->version == 'ATOM 1')\n\t\t{\n\t\t\tif(in_array('ENTRY', $this->insideItem) && $this->currentTag != 'ENTRY')\n\t\t\treturn TRUE; \n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}",
"public function containingOneItem(): bool\n {\n return $this->counting(1);\n }",
"public function inListForItemContainedReturnsTrueDataProvider() {}",
"public function item_exists() {\n return ! (empty( $this->item_id ));\n }",
"public function isInList(): bool\n {\n return $this->getListifyPosition() !== null;\n }",
"public function is_expanded()\n\t{\n\t\treturn \\CCSession::get( 'earth.pages.page-'.$this->id.'.expanded', false );\n\t}",
"public function isExpandable(): bool\n {\n return $this->expandable;\n }",
"public function hasItemModalDetail(): bool\n {\n return (bool)count($this->itemDetailsModal);\n }",
"public function isItemsQtyVisible()\n {\n return $this->_rootElement->find($this->productCounter, Locator::SELECTOR_XPATH)->isVisible();\n }",
"public function isExpandable()\n {\n return !empty($this->children);\n }",
"public function hasItemLevel()\n {\n return $this->item_level !== null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds configurationspecific cartitem data | public function wc_bonster_add_cart_item_data( $cart_item_data, $product_id ) {
// Get product type
$terms = get_the_terms( $product_id, 'product_type' );
$product_type = ! empty( $terms ) && isset( current( $terms )->name ) ? sanitize_title( current( $terms )->name ) : 'simple';
if($product_type != 'bonscomposite')
return $cart_item_data;
$data_items_cart = isset($_REQUEST['bons_data_order']) ? json_decode( stripslashes_deep($_REQUEST['bons_data_order']), true ):array();
if( count($data_items_cart) > 0 ){
$compositeData = array();
if ( isset($data_items_cart['basicItems']) ) {
foreach ($data_items_cart['basicItems'] as $key => $item) {
// $qtyTotal = $item['qty']*$item['qtyOrder'];
$row = array(
'product_id' => $item['productId'],
'quantity' => $item['qty'],
'qtyOrder' => $item['qtyOrder'],
'title' => $item['name'],
'regular_price' => $item['price'],
);
$compositeData[] = $row;
}
}
if ( isset($data_items_cart['additionalItems']) ) {
foreach ($data_items_cart['additionalItems'] as $key => $composition) {
foreach ($composition as $item) {
$qtyTotal = $item['qty']*$item['qtyOrder'];
$row = array(
'product_id' => $item['productId'],
'quantity' => $item['qty'],
'qtyOrder' => $item['qtyOrder'],
'title' => $item['name'],
'regular_price' => $item['price'],
'is_additional' => true,
);
$compositeData[] = $row;
}
}
}
// echo "<pre>", print_r($compositeData);die;
$cart_item_data['bons_composite_data'] = $compositeData;
}
return $cart_item_data;
} | [
"private function addItemsConfig()\n {\n $this->addItem(\n $this->rowFactory->create(\n 'ConfigSetting',\n [\n 'title' => 'Full Page Caching Application',\n 'path' => 'system/full_page_cache/caching_application',\n 'recommended' => Config::VARNISH,\n 'source' => \\Magento\\PageCache\\Model\\System\\Config\\Source\\Application::class,\n 'buttons' => '[devdocs-guides]/config-guide/varnish/config-varnish.html'\n ]\n )\n );\n if (version_compare($this->productMetadata->getVersion(), '2.2.0.dev', '<')) {\n if (!$this->runningHttp2()) {\n $this->addItem(\n $this->rowFactory->create(\n 'ConfigSetting',\n [\n 'title' => 'Enable JavaScript Bundling',\n 'path' => 'dev/js/enable_js_bundling',\n 'recommended' => true,\n 'buttons' => '[devdocs-guides]/frontend-dev-guide/themes/js-bundling.html'\n ]\n )\n );\n $this->addItem(\n $this->rowFactory->create(\n 'ConfigSetting',\n [\n 'title' => 'Merge JavaScript Files',\n 'path' => 'dev/js/merge_files',\n 'recommended' => true,\n 'buttons' => '[devdocs-guides]/config-guide/prod/prod_perf-optimize.html' .\n '#magento---performance-optimizations'\n ]\n )\n );\n $this->addItem(\n $this->rowFactory->create(\n 'ConfigSetting',\n [\n 'title' => 'Merge CSS Files',\n 'path' => 'dev/css/merge_css_files',\n 'recommended' => true,\n 'buttons' => '[devdocs-guides]/config-guide/prod/prod_perf-optimize.html' .\n '#magento---performance-optimizations'\n ]\n )\n );\n }\n $this->addItem(\n $this->rowFactory->create(\n 'ConfigSetting',\n [\n 'title' => 'Minify JavaScript Files',\n 'path' => 'dev/js/minify_files',\n 'recommended' => true,\n 'buttons' => '[devdocs-guides]/config-guide/prod/prod_perf-optimize.html' .\n '#magento---performance-optimizations'\n ]\n )\n );\n $this->addItem(\n $this->rowFactory->create(\n 'ConfigSetting',\n [\n 'title' => 'Minify CSS Files',\n 'path' => 'dev/css/minify_files',\n 'recommended' => true,\n 'buttons' => '[devdocs-guides]/config-guide/prod/prod_perf-optimize.html' .\n '#magento---performance-optimizations'\n ]\n )\n );\n $this->addItem(\n $this->rowFactory->create(\n 'ConfigSetting',\n [\n 'title' => 'Minify HTML',\n 'path' => 'dev/template/minify_html',\n 'recommended' => true,\n 'buttons' => '[devdocs-guides]/config-guide/prod/prod_perf-optimize.html' .\n '#magento---performance-optimizations'\n ]\n )\n );\n };\n $this->addItem(\n $this->rowFactory->create(\n 'ConfigSetting',\n [\n 'title' => 'Asynchronous sending of sales emails',\n 'path' => 'sales_email/general/async_sending',\n 'recommended' => true,\n 'buttons' => '[user-guides]/configuration/sales/sales-emails.html' .\n '#stores---configuration---sales---sales-emails'\n ]\n )\n );\n }",
"public function addItems()\n {\n $code = $this->getCode();\n\n $items = $this->getItems();\n\n $add = array();\n if ($items) {\n $datetime = date('Y-m-d H:i:s');\n foreach ($items as $item) {\n $add[] = array(\n 'code' => $code,\n 'contact_id' => $this->getContact()->getId(),\n 'product_id' => $item['product_id'],\n 'sku_id' => $item['sku_id'],\n 'create_datetime' => $datetime,\n 'quantity' => $item['quantity'],\n 'type' => $item['type'],\n 'service_id' => $item['service_id'],\n 'service_variant_id' => $item['service_variant_id'],\n 'parent_id' => $item['parent_id'],\n );\n }\n (new shopQuickorderPluginCartItemsModel())->multipleInsert($add);\n }\n }",
"public function addItem(Cart $cart, CartItem $item);",
"protected function setCartDataLayer() {\n if($this->fullActionName === 'checkout_index_index'){\n $this->addVariable('list', 'cart');\n }\n \n $quote = $this->getQuote();\n $cart = [];\n\n\n $addToCartProductQueue = $this->_checkoutSession->getData('add_to_cart_product_queue');\n\n $items = [];\n\n if ($quote->getItemsCount()) {\n $cart['hasItems'] = true;\n\n // set items\n foreach($quote->getAllVisibleItems() as $item) {\n if ($item->getParentItemId()) {\n $parentItem = $this->quoteItemFactory->create()->load($item->getParentItemId());\n $parentPrice = $parentItem->getPriceInclTax();\n }\n\n $items[] = [\n 'sku' => $item->getSku(),\n 'name' => $item->getName(),\n 'price' => (isset($parentPrice)) ? floatval($parentPrice) : floatval($item->getPriceInclTax()),\n 'quantity' => $item->getQty(),\n 'product_id' => $item->getProductId(),\n 'image_url' => $this->_imageHelper->init($item->getProduct(), 'product_base_image')->setImageFile($item->getProduct()->getSmallImage())->getUrl(),\n 'added' => (in_array($item->getProductId(), $addToCartProductQueue)),\n 'tags' => $this->getProductCategoryNames($item->getProduct())\n ];\n\n if (in_array($item->getProductId(), $addToCartProductQueue)) {\n unset($addToCartProductQueue[array_search($item->getProductId(), $addToCartProductQueue)]);\n $this->_checkoutSession->setData('add_to_cart_product_queue', $addToCartProductQueue);\n }\n }\n\n $cart['quote_id'] = $quote->getId();\n $cart['items'] = $items;\n $cart['total'] = floatval($quote->getGrandTotal());\n $cart['itemCount'] = $quote->getItemsCount();\n\n //set coupon code\n $coupon = $quote->getCouponCode();\n \n $cart['hasCoupons'] = $coupon ? true : false;\n\n if($coupon){\n $cart['couponCode'] = $coupon;\n }\n }\n else{\n $cart['hasItems'] = false;\n }\n $this->addVariable('cart', $cart);\n \n return $this;\n }",
"private function addToCart() {\n\t}",
"public function add_cart_item_data( $cart_items, $product_id = 0, $variation_id = 0 ) { \r\n wpf_product_charges_global_load( $product_id );\r\n global $wpf_products; \r\n \r\n if ( ! $product_id ) {\r\n return $cart_items;\r\n }\r\n $wpf_fields = wpf_get_cart_data( $product_id ); \r\n if ( ! empty( $wpf_fields ) ) {\r\n $cart_items['wpf_fields'] = $wpf_fields; \r\n } \r\n\r\n return $cart_items;\r\n }",
"public function createCartItem();",
"public function setShoppingCart()\n\t{\n\t\t$shopping_cart='';\n\n\t\t# Was this a Shopping Cart transaction?\n\t\tif($this->txn_type == \"cart\")\n\t\t{\n\t\t\t$num_cart_items=$this->num_cart_items;\n\t\t\tif(($_SERVER['REQUEST_METHOD']=='POST') && !empty($_POST))\n\t\t\t{\n\t\t\t\t$shopping_cart.=\"Shopping cart information:<br />\\n\";\n\t\t\t\t# Loop through the Shopping Cart Items and assign the info to variables.\n\t\t\t\tfor($i=1; $i <= $num_cart_items; $i++)\n\t\t\t\t{\n\t\t\t\t\t# $i will increase each time till it equals the number of items in the cart.\n\t\t\t\t\t$cartitemname=\"item_name\".$i;\n\t\t\t\t\t$cartitemname=$_POST[$cartitemname];\n\t\t\t\t\t$cartitemnumber=\"item_number\".$i;\n\t\t\t\t\t$cartitemnumber=$_POST[$cartitemnumber];\n\t\t\t\t\t$cartitem_quantity=\"quantity\".$i;\n\t\t\t\t\t$cartitem_quantity=$_POST[$cartitem_quantity];\n\t\t\t\t\t$carton0=\"option_name1_\".$i;\n\t\t\t\t\t$carton0=$_POST[$carton0];\n\t\t\t\t\t$cartos0=\"option_selection1_\".$i;\n\t\t\t\t\t$cartos0=$_POST[$cartos0];\n\t\t\t\t\t$carton1=\"option_name2_\".$i;\n\t\t\t\t\t$carton1=$_POST[$carton1];\n\t\t\t\t\t$cartos1=\"option_selection2_\".$i;\n\t\t\t\t\t$cartos1=$_POST[$cartos1];\n\t\t\t\t\t# Append our shopping cart item variable with the first iteration of info.\n\t\t\t\t\t$shopping_cart.=\"item name\".$i.\": \".urldecode($cartitemname).\"<br />\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"item number\".$i.\": \".$cartitemnumber.\"<br />\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"item quantity\".$i.\": \".$cartitem_quantity.\"<br />\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"option name1_\".$i.\": \".urldecode($carton0).\"<br />\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"option selection1_\".$i.\": \".$cartos0.\"<br />\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"option name2_\".$i.\": \".urldecode($carton1).\"<br />\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"option selection2_\".$i.\": \".$cartos1.\"<br />\\n\";\n\t\t\t\t}\n\t\t\t\t# After we have looped through all the items, append our variable with a line break.\n\t\t\t\t$shopping_cart.=\"<br />\\n\";\n\t\t\t}\n\t\t}\n\t\t$this->shopping_cart=$shopping_cart;\n\t}",
"public function addCartItem()\r\n\t\t{\r\n\t\t\tif(isset($_GET['pid'])) {\r\n\t\t\t\r\n\t\t\t\t$product_id = $_GET['pid'];\r\n\t\t\t\t\r\n\t\t\t\t//check that product ID is valid number\r\n\t\t\t\tif(!is_numeric($product_id)) {\r\n\t\t\t\t\techo \"Invalid product ID\";\r\n\t\t\t\t\tdie();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$productData = $this->store_m->getSingleProduct($product_id);\r\n\t\t\t\t\r\n\t\t\t\t$data = array(\r\n\t\t\t\t\t'id' => $product_id,\r\n\t\t\t\t\t'qty' => '1',\r\n\t\t\t\t\t'price' => $productData['0']['price'],\r\n\t\t\t\t\t'name' => $productData['0']['name'],\r\n\t\t\t\t\t'options' => array('sku' => $productData['0']['code'], 'photo' => $productData['0']['photo'])\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t$this->cart->insert($data);\r\n\t\t\t\tredirect('store', 'refresh');\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\techo \"No Product Found.\";\r\n\t\t\t\tdie();\r\n\t\t\t}\r\n\t\t}",
"public function addItem($id,$phone)\n{\n\n//$price = (int)str_replace(\"$\",\"\",$phone->price);//converts the price value back to string.\n //$quantity= $phone->id;\n\t$price = $phone->price; \n\t$name = $phone->name;\n\t$image = $phone->image;\n //$num = $phone->id;\n\n//First check if the phone is in the previous cart or not\n if(array_key_exists($id,$this->items))\n {\n //$productToAdd = $this->items[$id];\n $productToAdd = $items[$id]; //added\n $productToAdd['num']++;\n }\n else //if it is the first time the user is adding the item to the cart\n {\n $productToAdd = ['num' => 1, 'price'=>$price, 'name'=>$name,'image'=>$image]; \n }\n $this->items[$id] = $productToAdd;\n $this->totalQuantity++;\n $this->totalPrice = $this->totalPrice + $price;\n}",
"private function mini_cart_data()\r\n\t{\r\n\t\t$this->data['mini_cart_items'] = $this->flexi_cart->cart_items();\r\n\t}",
"public function addCartItemAction()\n {\n if (($data = \\System\\Helper::getJSONParameters()) !== false) {\n $product = new \\Models\\Product();\n\n if (!empty($data['order_data']) && !empty($data['server_url']) && !empty($data['quantity'])) {\n $default_products = $product->getServerDefaultProducts($data['server_url']);\n $min_period = 1;\n\n if (!empty($default_products)) {\n $item = ['products' => []];\n $selected_products = [];\n\n foreach ($default_products as $default_product) {\n foreach ($data['order_data'] as $ordered_product) {\n if ($default_product['id'] == $ordered_product['id']) { // Default product ordered\n $item['products'][] = [\n 'sub_cat_id' => $default_product['sub_category_id'],\n 'id' => $default_product['id']\n ];\n $selected_products[] = $default_product;\n } else {\n if (!empty($default_product['upgrade_products'])) {\n foreach ($default_product['upgrade_products'] as $upgrade_product) {\n if ($upgrade_product['id'] == $ordered_product['id']) { // Upgraded product ordered\n $item['products'][] = [\n 'sub_cat_id' => $upgrade_product['sub_category_id'],\n 'id' => $upgrade_product['id']\n ];\n $selected_products[] = $upgrade_product;\n if ($upgrade_product['minimal_period'] > $min_period) {\n $min_period = (int)$upgrade_product['minimal_period'];\n }\n }\n }\n }\n }\n }\n }\n\n if (!empty($item['products'])) {\n if ($min_period > $_SESSION['min_period']) {\n $_SESSION['min_period'] = $min_period;\n }\n\n if ($data['quantity'] > 0 && $data['quantity'] < 11) {\n $item['quantity'] = $data['quantity'];\n } else {\n $item['quantity'] = 1;\n }\n\n $item['server_url'] = $data['server_url'];\n $item['server_location'] = $data['location'];\n $item['comment'] = isset($data['comment']) ? $data['comment'] : '';\n\n if (!empty($data['edit']) && isset($data['cart_item_id'])) {\n $_SESSION['cart'][$data['cart_item_id']] = $item;\n echo 1;\n\n return;\n } else {\n echo (int)$product->addItemToCart($item);\n\n return;\n }\n\n\n }\n }\n }\n }\n echo 0;\n }",
"private function mini_cart_data()\r\n\t{\r\n\t\t$this->data['mini_cart_items'] = $this->flexi_cart_admin->cart_items();\r\n\t}",
"function kl_build_add_to_cart_data($added_product, $quantity, $cart)\n{\n $wck_cart = wck_build_cart_data( $cart );\n $added_product_id = $added_product->get_id();\n\n return array(\n '$value' => (float) $cart->total,\n 'AddedItemCategories' => (array) kl_strip_explode(wc_get_product_category_list( $added_product_id )),\n 'AddedItemDescription' => (string) $added_product->get_description(),\n 'AddedItemImageURL' => (string) wp_get_attachment_url(get_post_thumbnail_id($added_product_id)),\n 'AddedItemPrice' => (float) $added_product->get_price(),\n 'AddedItemQuantity' => (int) $quantity,\n 'AddedItemProductID' => (int) $added_product_id,\n 'AddedItemProductName' => (string) $added_product->get_name(),\n 'AddedItemSKU' => (string) $added_product->get_sku(),\n 'AddedItemTags' => (array) kl_strip_explode(wc_get_product_tag_list( $added_product_id )),\n 'AddedItemURL' => (string) $added_product->get_permalink(),\n 'ItemNames' => (array) $wck_cart['ItemNames'],\n 'Categories' => (array) $wck_cart['Categories'],\n 'ItemCount' => (int) $wck_cart['Quantity'],\n 'Tags' => (array) $wck_cart['Tags'],\n '$extra' => $wck_cart['$extra']\n );\n}",
"function simply_add_cart_item_data($cart_item_data, $product_id)\n{\n $key = 'realprice';\n if (isset($_POST[$key]))\n $cart_item_data['custom_data'][$key] = $_POST[$key];\n return $cart_item_data;\n}",
"private function addItem($productData,$case=\"\"){\n\n $data = $productData;\n $productId = isset($data) && isset($data['productId'])?$data['productId']:'';\n $productExists = false;\n $isProductAlreadyExistsinCart = false;\n \n if(!empty($productId)){\n $isProductAlreadyExistsinCart = Cart::search(array(\"id\" => $productId));\n if(isset($isProductAlreadyExistsinCart))\n $getCurrentStatusOfProduct = Cart::get($isProductAlreadyExistsinCart[0]);\n }\n\n\n if(!empty($data) && $isProductAlreadyExistsinCart && empty($case)){\n \t $productId = isset($data['productId'])?$data['productId']:'';\n \t $productTitle = isset($data['productTitle'])?$data['productTitle']:'';\n \t $productPrice = isset($data['productPrice'])?$data['productPrice']:'';\n\n if(isset($getCurrentStatusOfProduct['qty']) && !empty($productId) && !empty($productTitle) && !empty($productPrice))\n {\n \t$oldQty = $getCurrentStatusOfProduct['qty'];\n \t$newQty = $oldQty + 1;\n \tCart::update($isProductAlreadyExistsinCart[0],$newQty);\n \t$updatedPriceForThisProduct = Cart::get($isProductAlreadyExistsinCart[0])['subtotal']; \n \t$updatedTotalPrice = '<p>Total <span>Rs '.Cart::total().'</span></p>'; \n $cartArray = json_decode(json_encode(Cart::content()), true);\n $itemIndex = array_search($isProductAlreadyExistsinCart[0], array_keys($cartArray));\n $cartItemCount = $this->getItemCountInCart();\n \n\n\t \t $cartItem = \"<li data-index='\".$itemIndex.\"' >\";\n \t\t\t\t $cartItem .= '<div class=\"user-cart-item-name\">'.$productTitle.'</div>';\n \t\t\t\t $cartItem .= '<span data-product-id = \"'.$productId.'\" class=\"cd-qty\"><span class=\"dec-button\"></span><input type=\"text\" class=\"user-cart-qty\" value=\"'.$newQty.'\" /><span class=\"inc-button\"></span></span>';\n \t\t\t\t $cartItem .= '<div class=\"cd-price\">Rs '.$updatedPriceForThisProduct.'</div>';\n \t\t\t\t $cartItem .= '</li>';\n\n $response = array( \"status\" => \"true\",\n \"cartItem\" => $cartItem,\n \"totalPrice\" => $updatedTotalPrice,\n \"cartItemCount\" => $cartItemCount,\n \"itemIndex\" => $itemIndex \n );\n\t\t\t\t return $response;\n }\n }\n\n\n else if(!empty($case) && $case === 'incrementCount' && !empty($productId) && $isProductAlreadyExistsinCart){\n if(isset($getCurrentStatusOfProduct['qty']))\n {\n \t$oldQty = $getCurrentStatusOfProduct['qty'];\n \t$newQty = $oldQty + 1;\n \tCart::update($isProductAlreadyExistsinCart[0],$newQty);\n \t$cartItemCount = $this->getItemCountInCart();\n $updatedPriceForThisProduct = \"Rs \".Cart::get($isProductAlreadyExistsinCart[0])['subtotal']; \n \t$updatedTotalPrice = '<p>Total <span>Rs '.Cart::total().'</span></p>'; \n\n\t\t\t $response = array( \"status\" => \"true\",\n \"itemSubtotal\" => $updatedPriceForThisProduct,\n \"totalPrice\" => $updatedTotalPrice, \n \"cartItemCount\" => $cartItemCount,\n \"newQty\" => $newQty\n );\n return $response; \n }\n }\n\n else if(!empty($data)){\n \t$productTitle = isset($data['productTitle'])?$data['productTitle']:'';\n \t$productPrice = isset($data['productPrice'])?$data['productPrice']:'';\n\n \tif(!empty($productId) && !empty($productTitle) && !empty($productPrice)){\n $itemIndex = Cart::count(false) ;\n \t\t Cart::add($productId, $productTitle, 1, $productPrice);\n\t \t $cartItem = \"<li data-index='\".$itemIndex.\"'>\";\n \t\t\t\t $cartItem .= '<div class=\"user-cart-item-name\">'.$productTitle.'</div>';\n \t\t\t\t $cartItem .= '<span data-product-id = \"'.$productId.'\" class=\"cd-qty\"><span class=\"dec-button\"></span><input type=\"text\" class=\"user-cart-qty\" value=\"1\" /><span class=\"inc-button\"></span></span>';\n \t\t\t\t $cartItem .= '<div class=\"cd-price\">Rs '.$productPrice.'</div>';\n \t\t\t\t $cartItem .= '</li>';\n $updatedTotalPrice = '<p>Total <span>Rs '.Cart::total().'</span></p>'; \n \t\t\t\t $cartItemCount = $this->getItemCountInCart();\n\t\t\t\t $response = array( \"status\" => \"true\",\n \"cartItem\" => $cartItem,\n \"totalPrice\" => $updatedTotalPrice,\n \"cartItemCount\" => $cartItemCount,\n \"itemIndex\" => $itemIndex \n );\n return $response;\n \t}\n\n }\n return array(\"status\" => \"false\");\n\n\t}",
"public static function bkap_add_cart_item_data( $cart_item_meta, $product_id ){\n\t\tglobal $wpdb;\n\n\t\t$duplicate_of = bkap_common::bkap_get_product_id( $product_id );\n\t\n\t\t$is_bookable = bkap_common::bkap_get_bookable_status( $duplicate_of );\n\n\t\t$allow_bookings = apply_filters( 'bkap_cart_allow_add_bookings', true, $cart_item_meta );\n\n\t\tif ( $is_bookable && ( !array_key_exists( 'bundled_by', $cart_item_meta ) ) && $allow_bookings ) {\n \t\tif ( isset( $_POST['booking_calender'] ) ) {\n \t\t\t$date_disp = $_POST['booking_calender'];\n \t\t}\n \t\t\n \t\tif ( isset($_POST['time_slot'] ) ) {\n \t\t\t$time_disp = $_POST['time_slot'];\n \t\t}\n \t\t\n \t\tif ( isset( $_POST['wapbk_hidden_date'] ) ) {\n \t\t\t$hidden_date = $_POST['wapbk_hidden_date'];\n \t\t}\n \t\t\n \t\t$resource_id = 0;\n \t\tif( isset( $_POST['bkap_front_resource_selection'] ) ){\n \t\t $resource_id = $_POST['bkap_front_resource_selection'];\n \t\t}\n \t\n \t\t$booking_settings = get_post_meta( $duplicate_of, 'woocommerce_booking_settings', true );\t\t\t\n \t\t$product = wc_get_product( $product_id );\t\n \t\t$product_type = $product->get_type();\n \t\t\n \t\t// Initialize the variables\n \t\t$date_disp_checkout = '';\n \t\t$hidden_date_checkout = '';\n \t\t$diff_days = 1;\n \t\t$block_info = \"\";\n\n \t\tif ( isset( $booking_settings['booking_enable_multiple_day'] ) && $booking_settings['booking_enable_multiple_day'] == 'on' ) {\n \t\t\t\n \t\t\tif( isset( $_POST['block_option'] ) && $_POST['block_option'] != \"\" ) {\n \t\t\t\t$block_info = $_POST['block_option'];\n \t\t\t}\n \t\t if ( isset( $_POST['booking_calender_checkout'] ) ) {\n \t\t\t\t$date_disp_checkout = $_POST['booking_calender_checkout'];\n \t\t\t}\n \t\t\t\n \t\t\tif ( isset( $_POST['wapbk_hidden_date_checkout'] ) ) {\n \t\t\t\t$hidden_date_checkout = $_POST['wapbk_hidden_date_checkout'];\n \t\t\t}\n \t\t\t\n \t\t\tif ( isset( $_POST['wapbk_diff_days'] ) ) {\n \t\t\t\t$diff_days = $_POST['wapbk_diff_days'];\n \t\t\t}\n \t\t\t\n \t\t\t$variation_id = 0;\n \t\t\t\n \t\t\tif ( $product_type == 'variable' && isset( $_POST['variation_id'] ) ) {\n \t\t\t\t$variation_id = $_POST['variation_id'];\n \t\t\t}\n \t\t\t\n \t\t} \n\t\n \t\t$global_settings = json_decode( get_option( 'woocommerce_booking_global_settings' ) );\n \t\t\n \t\tif ( isset( $date_disp ) && $date_disp != \"\" ) {\n \t\t\t$cart_arr = array();\n \t\t\t\n \t\t\tif ( isset( $date_disp ) ) {\n \t\t\t\t$cart_arr['date'] = $date_disp;\n \t\t\t}\n \t\t\t\n \t\t\tif ( isset( $time_disp ) ) {\n \t\t\t\t$cart_arr['time_slot'] = $time_disp;\n \t\t\t}\n \t\t\t\n \t\t\tif ( isset($hidden_date ) ) {\n \t\t\t\t$cart_arr['hidden_date'] = $hidden_date;\n \t\t\t}\n \t\t\t\n \t\t\t$cart_arr['date_checkout'] = $date_disp_checkout;\n \t\t\t$cart_arr['hidden_date_checkout'] = $hidden_date_checkout;\n \t\t\t$cart_arr['resource_id'] = $resource_id;\n\n \t\t\t$cart_arr['fixed_block'] = $block_info;\n \t\t\t\n \t\t\tif ( isset( $_POST['variation_id'] ) ) {\n \t\t\t\t$variation_id = $_POST['variation_id'];\n \t\t\t}\n \t\t\telse {\n \t\t\t\t$variation_id = '0';\n \t\t\t}\n \n \t\t\tif ( ! isset( $cart_item_meta[ 'bundled_by' ] ) ) {\n \t\t\t$price = 0;\n \t\t\tif ( isset( $_POST[ 'bkap_price_charged' ] ) && is_numeric( $_POST[ 'bkap_price_charged' ] ) ) {\n $price = $_POST[ 'bkap_price_charged' ];\n } else { // It's a string when the product is a grouped product\n \t\n $price_array = explode( ',', $_POST[ 'bkap_price_charged' ] );\n foreach ($price_array as $array_k => $array_v ) {\n $per_product_array = explode( ':', $array_v );\n \n if ( $per_product_array[ 0 ] == $duplicate_of ) {\n $price = $per_product_array[ 1 ];\n $child_product_id = $per_product_array[ 0 ];\n break;\n }\n }\n }\n \t\t\t$gf_options_price = 0;\n \t\t\t$wpa_options_price = 0;\n \t\t\t\t\n \t\t\t// GF Compatibility\n \t\t\tif ( isset( $_POST[ 'bkap_gf_options_total' ] ) && $_POST[ 'bkap_gf_options_total' ] != 0 ) {\n \t\t\t $gf_options_price = $_POST[ 'bkap_gf_options_total' ];\n \t\t\t}\n \t\t\t\t\n \t\t\t//Woo Product Addons compatibility\n \t\t\t$wpa_diff = 1;\n \t\t\tif( isset( $global_settings->woo_product_addon_price ) && $global_settings->woo_product_addon_price == 'on' ) {\n \t\t\t\t$wpa_diff = $diff_days;\n \t\t\t}\n\n \t\t\t// Set the price per quantity as Woocommerce multiplies the price set with the qty\n \t\t\t$product_quantity = 1;\n if ( isset( $_POST[ 'quantity' ] ) && is_array( $_POST[ 'quantity' ] ) ) {\n \t\t\t $product_quantity = $_POST[ 'quantity' ][$product_id];\n\t\t\t //$final_price = $final_price / $qty_value;\n \t\t\t} else if ( isset( $_POST[ 'quantity' ] ) && $_POST[ 'quantity' ] > 1 ) {\n //$final_price = $final_price / $_POST[ 'quantity' ];\n $product_quantity = $_POST[ 'quantity' ];\n $cart_arr[ 'qty' ] = $_POST[ 'quantity' ];\n \t\t\t}\n\n \t\t\t$wpa_options_price = bkap_common::woo_product_addons_compatibility_cart( $wpa_diff, $cart_item_meta, $product_quantity );\n\n \t\t\t$gf_options_price = apply_filters( 'bkap_modify_cart_gf_prices', $gf_options_price, $product_quantity );\n\n \t\t\t$final_price = ( $price + $gf_options_price + $wpa_options_price ) / $product_quantity;\n\n \t\t\t$cart_arr[ 'price' ] = $final_price;\n \t\t\t} else if ( isset( $cart_item_meta[ 'bundled_by' ] ) && isset( $cart_item_meta[ 'bundled_item_id' ] ) ) {\n\n \t\t\t\t$bundled_item_obj = wc_pb_get_bundled_item($cart_item_meta[ 'bundled_item_id' ]);\n \t\t\t\tif ( $bundled_item_obj->is_priced_individually() ) {\n \t\t\t\t\t$cart_arr[ 'price' ] = $bundled_item_obj->get_price() * $diff_days;\n\n \t\t\t\t}\n \t\t\t}\n \t\t\t$cart_arr = (array) apply_filters('bkap_addon_add_cart_item_data', $cart_arr, $product_id, $variation_id,$cart_item_meta );\n \t\t\t\n \t\t\t//Added to add the selected currency on the product page from WPML Multi currency dropdown\n \t\t\tif ( function_exists( 'icl_object_id' ) ) {\n \t\t\t global $woocommerce_wpml, $woocommerce;\n \t\t\t if ( isset( $woocommerce_wpml->settings[ 'enable_multi_currency' ] ) && $woocommerce_wpml->settings[ 'enable_multi_currency' ] == '2' ) {\n \t\t\t $client_currency = $woocommerce->session->get( 'client_currency' );\n \t\t\t $cart_arr[ 'wcml_currency' ] = $client_currency;\n \t\t\t }\n \t\t\t}\n\t\t\n \t\t\t$cart_item_meta['bkap_booking'][] = $cart_arr;\n \t\t}\n\t\t}else if ( array_key_exists( 'bundled_by', $cart_item_meta ) && $cart_item_meta['bundled_by'] !== '' ) {\n\n\t\t\t$cart_arr = array();\n\n\t\t\tif ( isset( WC()->cart->cart_contents[$cart_item_meta['bundled_by']]['bkap_booking'] ) ) {\n\t\t\t\t$bundle_parent_booking = WC()->cart->cart_contents[$cart_item_meta['bundled_by']]['bkap_booking'][0];\n\t\t\t}\n\n\t\t\t$bundle_stamp = $cart_item_meta['stamp'][$cart_item_meta['bundled_item_id']];\n\t\t\t$bundle_item = wc_pb_get_bundled_item($cart_item_meta['bundled_item_id']);\n\n\t\t\tif ( $bundle_item->is_priced_individually() ) {\n\t\t\t\tif ( isset( $bundle_stamp['variation_id'] ) && $bundle_stamp['variation_id'] !== '' ) {\n\t\t\t\t\t$bundle_variation = wc_get_product( $bundle_stamp['variation_id'] );\n\t\t\t\t\t$cart_arr['price'] = $bundle_variation->get_price();\n\t\t\t\t\tif ( isset( $bundle_stamp['discount'] ) && $bundle_stamp['discount'] !== '' ) {\n\t\t\t\t\t\t$cart_arr['price'] = $cart_arr['price'] - ( $cart_arr['price'] * $bundle_stamp['discount']/100 );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( isset( $_POST['wapbk_diff_days'] ) ) {\n\t\t\t\t\t\t$cart_arr['price'] = $cart_arr['price'] * $_POST['wapbk_diff_days'];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif ( isset( $_POST['wapbk_diff_days'] ) && $_POST['wapbk_diff_days'] > 0 ) {\n\t\t\t\t\t\t$cart_arr['price'] = $bundle_item->get_price() * $_POST['wapbk_diff_days'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$cart_arr['price'] = $bundle_item->get_price();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( $is_bookable && isset( $bundle_parent_booking ) ) {\n\t\t\t\t$cart_arr['date'] = $bundle_parent_booking['date'];\n\t\t\t\t$cart_arr['hidden_date'] = $bundle_parent_booking['hidden_date'];\n\t\t\t\t$cart_arr['date_checkout'] = $bundle_parent_booking['date_checkout'];\n\t\t\t\t$cart_arr['hidden_date_checkout'] = $bundle_parent_booking['hidden_date_checkout'];\n\n\t\t\t\tif ( isset( $bundle_parent_booking['time_slot'] ) ) {\n\t\t\t\t\t$cart_arr['time_slot'] = $bundle_parent_booking['time_slot'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( isset( $cart_arr['date'] ) || isset( $cart_arr['price'] ) ) {\n\t\t\t\t$cart_item_meta['bkap_booking'][] = $cart_arr;\n\t\t\t}\n\t\t}else {\n\n\t\t\t$cart_item_meta = apply_filters( 'bkap_cart_modify_meta', $cart_item_meta );\n\t\t}\n\n\t\treturn $cart_item_meta;\n\t}",
"public function addToCart(): void\n {\n //añadimos un Item con la cantidad indicada al Carrito\n Cart::add($this->oferta->id, $this->product->name, $this->oferta->getRawOriginal('offer_prize'), $this->quantity);\n //emite al nav-cart el dato para que lo actualize\n $this->emitTo('nav-cart', 'refresh');\n }",
"function addToCart($param=array()){\r\n\t\tif(element('attrb_key', $param)){\r\n\t\t\t//if set attribute option\r\n\t\t\t$attrb = $this->product_m->getAttrbByKey(element('id_prod', $param), element('attrb_key', $param));\r\n\t\t\tif($attrb){\r\n\t\t\t\t// if attribute match\r\n\t\t\t\t$options = hackAttrib($attrb->attribute);\r\n\t\t\t\t$price = modules::run('store/product/prod_price', $param['id_prod'], $attrb->id);\r\n\t\t\t\t$rowid = $this->is_in_cart($param['id_prod'], $attrb->id);\r\n\t\t\t\t\r\n\t\t\t\t$ins_data['price'] = $price['origin'];\r\n\t\t\t\t$ins_data['options'] = $options;\r\n\t\t\t\t$ins_data['id_attrb'] = $attrb->id;\r\n\t\t\t\t\r\n\t\t\t\t$check_param['id_attrb'] = $attrb->id;\r\n\t\t\t\t$check_param['id_prod'] = $param['id_prod'];\r\n\t\t\t}else{\r\n\t\t\t$rowid = $this->is_in_cart($param['id_prod'], false);\r\n\t\t\t$price = modules::run('store/product/prod_price', $param['id_prod']);\r\n\t\t\t$ins_data['price'] = $price['final'];\r\n\t\t\t$check_param['id_prod'] = $param['id_prod'];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$rowid = $this->is_in_cart($param['id_prod'], false);\r\n\t\t\t$price = modules::run('store/product/prod_price', $param['id_prod']);\r\n\t\t\t$ins_data['price'] = $price['final'];\r\n\t\t\t$check_param['id_prod'] = $param['id_prod'];\r\n\t\t}\r\n\t\tif(!$rowid){\r\n\t\t\t$check_param['qty'] = $param['qty'];\r\n\t\t}else{\r\n\t\t\t$cartItem = $this->getCartItem($rowid);\r\n\t\t\t$check_param['qty'] = $param['qty']+$cartItem['qty'];\r\n\t\t\t$final_qty = $param['qty']+$cartItem['qty'];\r\n\t\t}\r\n\t\t$check = $this->validateProduct($check_param);\r\n\t\tif($check['status'] == 'on' && !$rowid){\t\r\n\t\t// if product valid and available and not exist on cart\r\n\t\t\t$prd_prm = array(\r\n\t\t\t\t'select' => 'name, price, currency, weight',\r\n\t\t\t\t'id' => $param['id_prod'],\r\n\t\t\t\t);\r\n\t\t\t$qp = $this->product_m->getProdById($prd_prm);\r\n\t\t\t$prod = $qp['prod'];\r\n\t\t\t$ins_data['id'] = $param['id_prod'];\r\n\t\t\t$ins_data['qty'] = $check_param['qty'];\r\n\t\t\t$ins_data['name'] = $prod->name;\r\n\t\t\t$ins_data['weight'] = $prod->weight;\r\n\t\t\t$check['addtocart'] = 'success';\r\n\t\t\t$check['rowid'] = $rowid;\r\n\t\t\t$ins = $this->cart->insert($ins_data);\r\n\t\t\t$this->upd_ship_fee();\r\n\t\t\treturn $check;\r\n\t\t\r\n\t\t}\r\n\t\telseif($check['status'] == 'on' && $rowid){\r\n\t\t\t$update_data = array(\r\n\t\t\t\t'rowid' => $rowid,\r\n\t\t\t\t'qty' => $final_qty);\r\n\t\t\t$ins = $this->exe_updateCart($rowid, $final_qty);\r\n\t\t\t$check['addtocart'] = 'success';\r\n\t\t\treturn $check;\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn $check;\r\n\t\t}\r\n\t\t\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create node of specific type. | function drush_my_drushcom_create_node($type){
global $user;
if ($type) {
$values = array(
'type' => $type,
'uid' => $user->uid,
'status' => 1,
'comment' => 1,
'promote' => 0,
);
$entity = entity_create('node', $values);
$ewrapper = entity_metadata_wrapper('node', $entity);
$title = _generateRandomString(15);
$ewrapper->title->set($title);
$my_body_content = _generateRandomString(200);
$ewrapper->body->set(array('value' => $my_body_content));
$ewrapper->body->summary->set(substr($my_body_content, 0, 50));
$ewrapper->save();
// Cheking if node was created
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node');
$query->propertyCondition('type', $type);
$query->propertyCondition('status', 1);
$query->fieldCondition('body', 'value', $my_body_content);
$result = $query->execute();
if (isset($result['node']))
$message = t('Node "@title" of "@type" type was created!!!', array('@title' => $title, '@type' => $type));
else
$message = t('ERROR: Something go wrong, node wasn\'t created');
drush_print($message);
}
else
drush_print(t('Specify your content type'));
} | [
"public function createNode();",
"function create_node() {\n $type = drush_get_option('type');\n $title = drush_get_option('title');\n $body = drush_get_option('body');\n // get content types\n $contentTypes = \\Drupal::entityTypeManager()\n ->getStorage('node_type')\n ->loadMultiple();\n $types = [];\n foreach ($contentTypes as $contentType) {\n $types[$contentType->getOriginalId()] = $contentType->label();\n }\n if (!isset($type)) {\n $type = drush_choice($types, dt(\"Choose content type\"));\n }\n if (empty($type)) {\n return drush_user_abort();\n }\n if (!isset($title)) {\n $title = drush_prompt(\"Enter node title\", NULL, TRUE);\n }\n if (!isset($body)) {\n $body = drush_prompt(\"Enter node body\", NULL, TRUE);\n }\n try {\n $data = ['type' => $type, 'title' => $title, 'body' => $body];\n $nodeManager = new NodeManager();\n if ($link = $nodeManager->createNode($data)) {\n return drush_log(dt('Node created with title !title, click on !link link to open.', ['!title' => $title, '!link' => $link]), 'success');\n }\n }\n catch (Exception $ex) {\n return drush_set_error('mydrush', dt('Something went wrong while creating node.'));\n }\n}",
"public function makeNode() {\n global $user;\n\n $node = array(\n 'uid' => $user->uid,\n 'status' => 1,\n 'type' => 'platform',\n 'title' => $this->name,\n 'created' => time(),\n 'validated' => TRUE,\n\n 'publish_path' => $this->publishpath,\n 'makefile' => $this->makefile,\n 'web_server' => $this->webserver,\n 'platform_status' => $this->status,\n 'verified' => $this->verified ? $this->verified : 0,\n );\n\n if ($this->nid) {\n $node['nid'] = $this->nid;\n }\n\n $this->node = (object)$node;\n }",
"abstract protected function createNode($parent = NULL);",
"protected function createNodeType() {\n $node_type = NodeType::create([\n 'type' => 'page',\n 'label' => 'Page',\n ]);\n $node_type->save();\n $workflow = $this->createEditorialWorkflow();\n $workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'page');\n $workflow->save();\n }",
"function custom_new_node_create($uid, $type, $title, $status, $is_stored = false) {\n $langcode = $current_user->getPreferredLangcode();\n\n $node = Node::create(array(\n 'type' => $type,\n 'status' => $status,\n 'langcode' => $langcode,\n 'uid' => $uid,\n 'title' => $title,\n ));\n\n if ($is_stored) {\n if ($node->save()) {\n //\\Drupal::logger('custom')->notice(t('Node stored.'));\n return $node;\n }\n else{\n \\Drupal::logger('custom')->error(t('Node FAILED to store.'));\n return null;\n }\n }\n \n return $node;\n}",
"public function createNodeDefinitionTemplate();",
"function create($type_namespace_uri, $type_name){}",
"public function createNewNode() {\n\n // check that required inputs are defined\n $params = $this->subsetArray($this->_params, array_merge([\"class\"], array_keys($this->_annotypes)));\n\n // check required permission to edit the graph\n $this->checkEditPermissions();\n\n if (strlen($params['name']) < 2) {\n throw new Exception(\"Name too short\");\n }\n\n $this->dblock([NC_TABLE_CLASSES, NC_TABLE_NODES, NC_TABLE_ANNOTEXT]);\n\n // get the class id associated with the class name\n $classinfo = $this->getClassInfo($params['class']);\n $params['class_id'] = $classinfo['class_id'];\n if ($classinfo['connector'] != 0) {\n throw new Exception(\"Invalid class for a node\");\n }\n\n // check if this node name already exists \n $nodeexists = $this->getNameAnnoRootId($this->_netid, $params['name'], false);\n if ($nodeexists) {\n throw new Exception(\"Node name already exists\");\n }\n\n // if reached here, create the new node (uses batch insert with one node) \n $params['status'] = NC_ACTIVE;\n $nodeid = $this->batchInsertNodes([$params]);\n\n $this->dbunlock();\n\n // log entry for creation\n $this->logActivity($this->_uid, $this->_netid, \"created node\", $params['name'], $params['title']);\n $this->sendNewObjectEmail(\"node\");\n\n return $nodeid;\n }",
"public function actionCreate()\n {\n $type = Yii::$app->request->getQueryParam('type');\n $model = new Node();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"function createNode($form_values, $type) {\n\tif (!isset($type) OR !isset($form_values['pid'])) {\n\t\treturn false;\n\t}\n\n\tglobal $user;\n\t$old_user = $user;\n\t$user = user_load(1);\n\t$node_url = '/fedora/repository/' . $form_values['pid'];\n\n\tif (variable_get('islandora_sync_translation_enabled', 0) == 0 || !isset($form_values[\"metadigit_lang\"])) {\n\t\t$lang = \"\"; //language neutral\n\t}\n\telse {\n\t\t$lang = $form_values[\"metadigit_lang\"];\n\t}\n\n\t// add node properties\n\t$node = new stdClass();\n\t$node->type = $type;\n\t$node->title = $form_values['dc:title']; //TODO:handle on module configuration page\n\t$node->uid = $user->uid;\n\t$node->language = $lang;\n\t$node->created = time();\n\t$node->changed = $node->created;\n\t$node->status = 1;\n\t$node->comment = 0;\n\t$node->promote = 0;\n\t$node->moderate = 0;\n\t$node->sticky = 0;\n\n\t//We add CCK field data to the node. To be sure to use only valid ccks for this type of node we extract all cck fields names\n\t// sing content_field api call. Then we execute the assignement where the $key from $ccks hash table is one of the cck fields.\n\t__hashCCK($node, $form_values, $type);\n\n\t//TODO add islandora_sync_createnode_alter hook passando $node e $ccks\n\t//TODO spostare in islandora_mag invocando l'hook\n\t$node->body = \"<a href=\\\"\" . $node_url . \"\\\">\" . $form_values['dc:title'] . \"</a>\";\n\n\t__createNodeImage(&$node, $form_values['pid']);\n\n\tnode_save($node);\n\t$user = $old_user; //restore user\n\n\treturn trim($node->nid);\n}",
"private function generateTestNodeType() {\n return \\entity_create('node_type',\n array(\n 'type' => 'test_behavior_settings_node_type',\n 'name' => 'Test Behavior Settings Node Type',\n )\n );\n }",
"private function createNewNode()\n {\n return $this\n ->container\n ->get('elcodi.factory.menu_node')\n ->create();\n }",
"abstract protected function _buildNode();",
"public function testCreateNode()\n {\n }",
"function createNode($id, $tag, $attributes, $type = 'append')\n {\n $types = array('append', 'prepend', 'insertBefore', 'insertAfter');\n if(!in_array($type, $types))\n {\n $type = 'append';\n }\n settype($attributes, 'array');\n $this->_actions[] = array(\n 'action' => 'create',\n 'id' => $id,\n 'tag' => $tag,\n 'attributes' => $attributes,\n 'type' => $type,\n );\n return;\n }",
"public static function add_node_type($type, array $type_info)\n {\n self::$_node_types[$type] = $type_info;\n }",
"function createNodeContentType ( array $settings ) {\n // We define the node type as an associative array.\n $contentTypeData = array (\n 'type' => $settings[ 'type' ] ,\n 'name' => $settings[ 'name' ] ,\n 'base' => 'node_content' ,\n 'description' => $settings[ 'description' ] ,\n 'custom' => FALSE ,\n );\n\n $contentType = node_type_set_defaults ( $contentTypeData );\n $contentType->custom = 0;\n $contentType->modified = 0;\n $contentType->locked = 0;\n\n //set comment setting if none is given\n if ( ! isset ( $settings[ 'comments' ] ) ) $settings[ 'comments' ] = 0;\n variable_set ( 'comment_' . $settings[ 'type' ] , $settings[ 'comments' ] );\n\n //core node type save\n node_type_save ( $contentType );\n\n if ( isset ( $settings[ 'body' ] ) ) {\n $body = new stdClass();\n $body->type = $settings['type'];\n if ( ! isset ( $settings[ 'bodylabel' ] ) ) $settings[ 'bodylabel' ] = \"Body\";\n\n node_add_body_field ( $body , $settings[ 'bodylabel' ] );\n }\n\n\n}",
"public function createBlock($type) {\n $this->completeNode();\n $this->current->appendNode($type);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Let update the author sell badge | public function updateAuthorSellBadgeStat($author_id, $productID, $item_price_get, $dl_id)
{
$this->db->set('sb_user_id', $author_id);
$this->db->set('sb_item_id', $productID);
$this->db->set('sb_amount', $item_price_get);
$this->db->set('sb_dl_id', $dl_id);
$this->db->insert('zd_sell_badge');
return TRUE;
} | [
"public function testUpdateItemBuyer()\n {\n }",
"public function updateAuthor()\n {\n }",
"function awardBadge($user_id, $badge_id){\n $obj['UserBadge']['user_id'] = $user_id;\n $obj['UserBadge']['badge_id'] = $badge_id;\n \n if($this->save($obj)){\n return true;\n } else {\n return false;\n }\n }",
"public function updateBadge($id)\n {\n $data = array(\n 'badge' => $this->input->post('badge')\n );\n $this->Pengajar_model->updateBadgesSiswa($data, $id);\n redirect('pengajar/filtersiswa');\n }",
"function mpgp_authorship_badge_short () { \n\n\n\n\n$mpgp_author_name = esc_attr( get_the_author_meta( 'preferredname', $user->ID ) );\n$mpgp_author_display = esc_attr( get_the_author_meta( 'display_name', $user->ID ) );\n$mpgp_author_url = esc_attr( get_the_author_meta( 'mpgpauthor', $user->ID ) );\nif(is_author){\n$authororme = 12;\n}\nelse {\n$authororme = 23;\n}\nif($mpgp_author_name==NULL) \n\t\t\t\t\t{\n\t\t\t\t\t\t$authorizing = $mpgp_author_display;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t\n\t\t\t\t\t$authorizing = $mpgp_author_name;\n\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t$mpgpreturn = \"<g:plus href='\";\n\t\t\t\t$mpgpreturn .= $mpgp_author_url;\n\t\t\t\t$mpgpreturn .= \"' rel='\";\n\t\t\t\tif(is_author){ $mpgpreturn .=\"author\";}\n\t\t\t\telse {$mpgpreturn .= \"me\";}\n\t\t\t\t$mpgpreturn .= \"' width='170' height='69' title='Google Plus Profile for \";\n\t\t\t\t$mpgpreturn .= $authorizing; \n\t\t\t\t$mpgpreturn .=\"'>\";\n\t\t\t\t$mpgpreturn .= \"</g:plus>\";\n\n\t\treturn $mpgpreturn;\n}",
"function wpachievements_up_add_badges($user_id,$ach_ID,$achievement){\n\n $badges = get_user_meta($user_id, '_userpro_badges', true);\n\n // find if that badge exists\n if (is_array($badges)){\n foreach($badges as $k => $badge){\n if( isset($badge['badge_id']) ){\n if ( $badge['badge_id'] == $ach_ID ) {\n unset($badges[$k]);\n }\n }\n }\n update_user_meta($user_id, '_userpro_badges', $badges);\n }\n\n // add new badge to user\n $badges[] = array(\n 'badge_url' => $achievement[6],\n 'badge_title' => $achievement[0],\n 'badge_id' => $ach_ID\n );\n update_user_meta($user_id, '_userpro_badges', $badges);\n\n }",
"public function grantBadge($badge, $users);",
"function bimber_mycred_add_badge( $args ) {\n\t$perform = filter_var( $_POST['options']['import_mycred_badges'], FILTER_VALIDATE_BOOLEAN );\n\tif ( ! $perform ) {\n\t\treturn;\n\t}\n\n\tif ( isset( $args['menu_order'] ) ){\n\t\t$order = (int) $args['menu_order'];\n\t} else {\n\t\t$order = 10;\n\t}\n\n\t$post = array(\n\t\t'post_title' => wp_strip_all_tags( $args['name'] ),\n\t\t'post_status' => 'publish',\n\t\t'post_type' \t=> 'mycred_badge',\n\t\t'post_excerpt'\t=> $args['excerpt'],\n\t\t'menu_order'\t=> $order,\n\t);\n\t$post_id = wp_insert_post( $post );\n\t// convert image names to attachement ids before we add them to meta.\n\t$args['main_image'] = bimber_mycred_sideload_image( $args['main_image'], $post_id );\n\tif ( null === $args['main_image'] ) {\n\t\treturn;\n\t}\n\tforeach ( $args['levels'] as $i => $level ) {\n\t\t$level['attachment_id'] = bimber_mycred_sideload_image( $level['attachment_id'], $post_id);\n\t\tif ( null === $level['attachment_id'] ) {\n\t\t\treturn;\n\t\t}\n\t\t$args['levels'][$i] = $level;\n\t}\n\n\tupdate_post_meta( $post_id, 'manual_badge', $args['manual'] );\n\tupdate_post_meta( $post_id, 'main_image', $args['main_image'] );\n\tupdate_post_meta( $post_id, 'badge_prefs', $args['levels'] );\n\tif ( isset( $args['importslug'] ) ) {\n\t\tupdate_post_meta( $post_id, '_bimber_mycred_import_slug', $args['importslug'] );\n\t}\n}",
"public function executeUpdateBN(sfWebRequest $request)\n {\n if( !$this->getUser()->hasCredential(array('Administrator','Staff','Member'), false)){\n $this->getUser()->setFlash(\"warning\", 'You don\\'t have permission to access this url '.$request->getReferer());\n $this->redirect('dashboard/index');\n }\n\n\n $member = MemberPeer::retrieveByPK($request->getParameter('id'));\n $this->forward404Unless($member);\n\n if($request->getParameter('type', 0)=='b'){\n $member->setBadgeMade(date());\n $member->save();\n }else if($request->getParameter('type', 0)=='n'){\n $member->setNotebookSent(date());\n $member->save();\n }\n\n return $this->redirect('@member_needsbn');\n }",
"function GrantBadge($badgeName)\n\t{\n\t\t\n\t\tglobal $Cmysql; // We access the database, so we must hook the class here\n\t\tglobal $Ctemplate; // We use templates here, hook the class\n\t\t\n\t\tif ( array_key_exists($badgeName, $this->badge_array) == FALSE )\n\t\t{\n\t\t\t// If we tried to grant a badge which does not exist\n\t\t\t$Ctemplate->useTemplate(\"badge_err\", array(\n\t\t\t\t'BADGE_NAME'\t=>\t$badgeName // Name of the badge\n\t\t\t), FALSE ); // We output an error message\n\t\t\treturn; // Terminate function execution\n\t\t}\n\t\t\n\t\t$already = mysql_num_rows($Cmysql->Query(\"SELECT earndate FROM badges WHERE userid='\" .$Cmysql->EscapeString($_SESSION['uid']). \"' AND badgename='\" .$Cmysql->EscapeString($badgeName). \"'\")); // Select whether the user already earned the requested badge\n\t\t// If $already != 0 (usally 1), the user already has the badge, we need to do nothing here\n\t\t\n\t\tif ( $already == 0 )\n\t\t{\n\t\t\t// If the user does not have the badge\n\t\t\t// give it to him/her\n\t\t\t\n\t\t\t$Cmysql->Query(\"INSERT INTO badges(userid, badgename, earndate) VALUES (\n\t\t\t\t'\" .$Cmysql->EscapeString($_SESSION['uid']). \"',\n\t\t\t\t'\" .$Cmysql->EscapeString($badgeName). \"',\n\t\t\t\t'\" .time(). \"')\"); // Give the badge\n\t\t}\n\t}",
"function bim_update_gradebook( $bim ) {\n global $DB;\n\n // need to make sure we have cmidnumber set\n if ( ! isset( $bim->cmidnumber ) ) {\n if ( ! $cm = get_coursemodule_from_instance( 'bim', $bim->id )) {\n print_error( 'bim_cmiderror', 'bim' );\n } else {\n $bim->cmidnumber = $cm->id;\n }\n }\n // update the gradebook entry if configured to\n if ( $bim->grade > 0 ) {\n // get sum max marks for all this bim's questions\n $max_sql = \"SELECT bim,sum(max_mark) as max from {bim_questions} where bim= ? group by bim\";\n $max_results = $DB->get_records_sql($max_sql, array($bim->id));\n $max_total = $max_results[$bim->id]->max;\n\n // only do the update if max_total is greater than 0\n if ( $max_total > 0 ) {\n // get the list of students with released results and the sum of \n // their marks for released posts\n $raw_sql = \"SELECT userid,sum(mark) as mark from {bim_marking} where bim= ? and status='Released' group by userid\";\n $grades = $DB->get_records_sql( $raw_sql, array( $bim->id ) );\n\n // calculate the grade/mark to stick in the gradebook\n foreach ( $grades as $userid => $grade ) {\n $grade->posts_percentage = $grade->mark * (100/$max_total);\n\n $grade->rawgrade = ($grade->posts_percentage/100) * $bim->grade;\n } \n // update the gradebook for all the students\n bim_grade_item_update( $bim, $grades );\n } // max_total > 0 \n } // bim->grade > 0\n}",
"public function testUpdatePublisherSuggestion()\n {\n\n }",
"function Update($post,$logo,$en_buyers_slogan,$en_buyers_description)\n\t{\n\t global $db;\n\t\t$sql=\"UPDATE \".PROFILE_MASTER\n\t\t .\" SET \"\n\t\t\t.\" seller_logo = '\".$logo.\"',\"\n\t\t\t.\" buyers_slogan = '\".mysql_real_escape_string($en_buyers_slogan).\"',\"\n\t\t\t.\" buyers_description = '\".mysql_real_escape_string($en_buyers_description).\"',\"\n\t\t\t.\" buyers_profile_status = '1' \"\n\t\t .\" WHERE user_auth_id ='\".$post['User_Id'].\"'\"; \n\t\treturn($db->query($sql));\n\t}",
"public function update() {\n\t\t\n\t\tif ( ($this->user_id == 0) || ($this->package_id == 0) ) { return false; }\n\t\t\n\t\t$rate_action = get_query_var( 'rate', '');\n\t\t\n\t\tswitch ( $rate_action ) {\n\t\t\tcase 'coolfoto':\n\t\t\t\t$this->add_rating('coolfoto');\n\t\t\t\tbreak;\n\t\t\tcase 'no_coolfoto':\n\t\t\t\t$this->remove_rating('coolfoto');\n\t\t\t\tbreak;\n\t\t\tcase 'goodwork':\n\t\t\t\t$this->add_rating('goodwork');\n\t\t\t\tbreak;\n\t\t\tcase 'no_goodwork':\n\t\t\t\t$this->remove_rating('goodwork');\n\t\t\t\tbreak;\n\t\t\tcase 'nicetext':\n\t\t\t\t$this->add_rating('nicetext');\n\t\t\t\tbreak;\n\t\t\tcase 'no_nicetext':\n\t\t\t\t$this->remove_rating('nicetext');\n\t\t\t\tbreak;\n\t\t\tcase 'mething':\n\t\t\t\t$this->add_rating('mething');\n\t\t\t\tbreak;\n\t\t\tcase 'no_mething':\n\t\t\t\t$this->remove_rating('mething');\n\t\t\t\tbreak;\n\t\t}\n\t}",
"protected function giveBadgesForThisCommit( \\Iterator $badges, Commit $commit )\r\n\t{\r\n\t\tforeach ( $badges as $badge )\r\n\t\t{\r\n\t\t\t$commit->setIn_game( 1 );\r\n\t\t\tif ( $badge->check( $commit ) )\r\n\t\t\t{\r\n\t\t\t\t$commit->getAuthor()->addBadge( $badge );\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function testUpdateBundleItem()\n {\n }",
"private function get_badge()\n {\n }",
"public function postbadgeeditconfirmAction()\n {\n // get the view vars\n $site = $this->view->site; /* @var BeMaverick_Site $site */\n $errors = $this->view->errors;\n\n $requiredParams = array(\n 'responseId',\n 'userId',\n );\n\n $optionalParams = array(\n 'badgeId',\n );\n\n $input = $this->processInput( $requiredParams, $optionalParams, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n $response = $site->getResponse( $input->responseId );\n $badge = $site->getBadge( $input->badgeId );\n $user = $site->getUser( $input->userId );\n\n // delete all current badges for this user\n $givenBadgeIds = $user->getGivenResponseBadgeIds( $response );\n foreach ( $givenBadgeIds as $givenBadgeId ) {\n $givenBadge = $site->getBadge( $givenBadgeId );\n $response->deleteBadge( $givenBadge, $user );\n }\n\n // add the badge\n if ( $badge ) {\n $response->addBadge( $badge, $user );\n BeMaverick_Util::sendNotificationForBadgeGiven( $site, $response, $badge, $user, $response->getUser() );\n }\n\n // send success to as the response\n $res = $this->getResponse();\n $res->setHeader( 'Content-Type', 'application/json' );\n $res->setHeader( 'Cache-Control', 'private, no-store, no-cache' );\n $res->setHeader( 'Pragma', 'no-cache' );\n $res->setHeader( 'Expires', 'Sat, 01 Jan 2000 00:00:00 GMT' );\n\n $res->setBody(\n json_encode(\n array(\n 'success' => true\n )\n )\n );\n }",
"function deliveryUpdate($user_id, $beer_id,$amount,$price){\n\n\t\t$q1=\"INSERT INTO beers_bought (admin_id,beer_id,amount,price) VALUES ('$user_id', '$beer_id','$amount','$price')\";\n\t\t$result= $this -> mysqli -> query($q1) or die (\"query 1 failed!\");\n\n\t\tif ($this->isStocked($beer_id)){\n\t\t\t$q2=\"UPDATE stock SET in_stock= in_stock +'$amount' WHERE beer_id='$beer_id'\";\n\t\t}\n\t\telse {\n\t\t\t$q2=\"INSERT IGNORE INTO stock (beer_id, in_stock, threshold, order_amount) VALUES('$beer_id', '$amount', 20,20)\";\n\t\t}\n\t\t$result= $this -> mysqli -> query($q2) or die (\"query 3 failed!\");\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves a section given the semester and CRN. Null if it can't be found | public static function getByCrn(Semester $semester, string $crn): ?Section
{
global $section_tbl;
Logger::info("Retrieving section from database. Semester: " . $semester->getCode() . " CRN: $crn");
$pdo = PDOWrapper::getConnection();
$semester_id = $semester->getId();
$smt = $pdo->prepare("SELECT * FROM $section_tbl WHERE semester_id=:semester_id AND crn=:crn LIMIT 1");
$smt->bindParam(":semester_id", $semester_id, PDO::PARAM_INT);
$smt->bindParam(":crn", $crn, PDO::PARAM_STR);
if (!$smt->execute())
{
Logger::error("Section retrieval failed. Error info: " . Logger::obj($smt->errorInfo()));
Logger::error("Could not retrieve section. Semester: " . $semester->getCode() . " CRN: $crn");
return null;
}
$data = $smt->fetch(PDO::FETCH_ASSOC);
if (!$data) return null;
return new Section(Course::getById($data['course_id']), $semester, $data['section'], $crn, $data['active'],
$data['id']);
} | [
"function unh_d1_client_getsectionSemester($section = '') {\n $ret = '';\n \n if (!empty($section) && array_key_exists('associatedTerm', $section)) {\n $ret = $section['associatedTerm']['name'];\n }\n \n return $ret;\n}",
"function getSection($semester_id, $course_code, $course_number)\n {\n $query = $this->db->query(\"\n SELECT\n sections.id,\n sections.letter,\n sections.professor,\n sections.capacity\n FROM sections\n INNER JOIN courses\n ON sections.course_id = courses.id\n INNER JOIN semesters\n ON sections.semester_id = semesters.id\n WHERE semesters.id = '$semester_id' AND courses.code = '$course_code' AND courses.number = '$course_number'\");\n\n if($query->num_rows() == 0)\n return FALSE;\n\n $sections = [];\n\n foreach ($query->result() as $row)\n {\n array_push($sections, [\n 'sect' => $row,\n 'lect' => $this->getLecturesBySectID($row->id),\n 'tuts' => $this->getTutorialsBySectID($row->id),\n 'labs' => $this->getLabsBySectID($row->id)\n ]);\n }\n\n return $sections;\n }",
"function getSection($semester_id, $course_id)\n {\n $query = $this->db->query(\"\n SELECT\n *\n FROM sections\n WHERE semester_id = '$semester_id' AND course_id = '$course_id'\");\n\n if($query->num_rows() == 0)\n return FALSE;\n\n $sections = [];\n\n $this->load->model('lecture');\n $this->load->model('tutorial');\n $this->load->model('laboratory');\n\n foreach ($query->result() as $row)\n {\n array_push($sections, [\n 'sect' => $row,\n 'lect' => $this->lecture->getLecturesBySectID($row->id),\n 'tuts' => $this->tutorial->getTutorialsBySectID($row->id),\n 'labs' => $this->laboratory->getLabsBySectID($row->id)\n ]);\n }\n\n return $sections;\n }",
"public function getSection($region);",
"public function getSectionBDD($n){\n\n $sql = 'SELECT * FROM section WHERE s_id = '. $n;\n\n $results = $this->makeselect($sql);\n if (empty($results)) {\n return NULL;\n }\n $maSection = array();\n foreach ($results as $key => $value) {\n $maSection[] = new Section($value);\n }\n return $maSection[0];\n }",
"public function get_Section() {\r\n\t\t$section_array = $this->get_Sections();\r\n\t\treturn $section_array[0];\r\n\t}",
"private function getSection()\n {\n $this->section = $this->modelFactory()->get($this->sectionClass());\n\n return $this->section;\n }",
"function getSection($key);",
"function get_course_from_crn($course_rn, $semester_id)\n{\n\tglobal $conn;\n\t$stmt = $conn->prepare('SELECT tbl_courses.course_code, course_name\n\t\tFROM tbl_classes, tbl_courses WHERE course_rn = :crn AND\n\t\tsemester_id = :semester AND tbl_classes.course_code = tbl_courses.course_code');\n\t$stmt->bindValue(':crn', $course_rn);\n\t$stmt->bindValue(':semester', $semester_id);\n\treturn execute_fetch_one($stmt);\n}",
"public function getSection($name = null);",
"function get_course($crn) {\n if (!isset($this->course_schedule)) {\n return false;\n }\n \n foreach($this->course_schedule as $course) {\n if (strcasecmp($crn, $course['CRN']) === 0) {\n return $course;\n }\n }\n \n return false;\n }",
"function getstudentlist_section($dept,$year,$section)\r\n\t{\r\n\t\trequire_once('../db_config.php');\r\n\t\t$query5 = \"SELECT regnumber,studentname FROM src.studentmaster WHERE regnumber in \"\r\n\t\t\t\t\t.\"(SELECT regnumber FROM src.relation WHERE sectionid in \"\r\n\t\t\t\t\t\t.\"( SELECT sectionid FROM src.sectionmaster WHERE $section_class_object->department='$dept' and $section_class_object->year='$year' and )\" \t\t\t \t. \"$section_class_object->section='$section'))\";\r\n\r\n\t\t$result5 = mysql_query($query5);\r\n\t\t$success = mysql_num_rows($result5);\r\n\t\tif($success == -1)\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}",
"public function getSection(): string\n {\n return $this->section;\n }",
"public function getSection(){\n $section = array_shift($this->sections);\n if ( $section === null ) {\n $stack = $this->getStack();\n if ( !empty($stack) ) {\n $this->clearStack();\n return $stack;\n }\n }\n return $section;\n }",
"public function get_section()\n\t{\n\t\treturn $this->section;\n\t}",
"function get_valid_sections($semester) {\n global $CFG;\n \n $sql = \"SELECT sec.*\n FROM {$CFG->prefix}block_courseprefs_sections sec,\n {$CFG->prefix}course cou\n WHERE sec.semestersid = {$semester->id}\n AND sec.idnumber = cou.idnumber\n AND cou.visible = 1\n AND sec.idnumber IS NOT NULL\n AND sec.status = 'completed'\";\n\n return get_records_sql($sql);\n}",
"public function get_section()\n {\n return $this->_section;\n }",
"public function getSection()\n {\n return $this->section;\n }",
"public function GetSection()\n {\n if ( empty(self::$_init) ) {\n self::$_init = 1;\n self::$_section = new Section();\n }\n return self::$_section;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the java version available on this machine 1.X, where X is the version returned. Returns 0 if there is no Java available. | public static function getJavaVersionAvailable(){
static $javaVersion = null;
if (isset($javaVersion) !== true){
if (\preg_match(
<<<'EOT'
`(?xm)
# 1.X, where X is the version we're interested in.
" \d+ \. (?<version> \d+ )
`u
EOT
, \shell_exec('java -version 2>&1'),
$matches
)){
$javaVersion = \intval($matches['version']);
} else {
$javaVersion = 0;
}
}
return $javaVersion;
} | [
"public function getJavaVersion() {\n \t\t$cmd = \"java -version\";\n\t\t$return_code = $this->exec($cmd,$output,$err);\n\t\t$out = $this->getOutput();\n \t\t// if command could not be executed\n\t\tif ($return_code == 127) {\n\t\t\t// java is not installed or not in path\n\t\t\t// FIXME i18n\n\t\t\t$out->addWikiText( 'Java is not installed or configured.' );\n\t\t} else {\n\t\t\t$out->addWikiText('https://upload.wikimedia.org/wikipedia/de/thumb/e/e1/Java-Logo.svg/75px-Java-Logo.svg.png is installed ✓');\n\t\t\t$out->addWikiText( '<pre>'.$err.'</pre>');\n\t\t}\n \t}",
"private function osx_system_version () {\n\t\tif ($handle = popen(\"/usr/bin/sw_vers\", \"r\")) {\n\t\t while (!feof($handle)) {\n\t\t\t\t$buffer = fgets($handle, 1024);\n\t\t\t\tif (eregi(\"^ProductVersion:[[:space:]]*(.*)\", $buffer, $captures)) {\n\t\t\t\t\t$parts = explode(\".\", $captures[1]);\n\t\t\t\t\treturn $parts[0].$parts[1];\n\t\t\t\t}\n\t\t\t}\n\t\t\tpclose($handle);\n\t\t}\n\n\t\t// Return 10.0 which is the olden system we can run on\n\t\treturn \"100\";\n\t}",
"function check_for_java($minimum_version = 1.40) {\n $result = array();\n exec(\"java -version 2>&1\", $result);\n if (!isset($result[0])) return false;\n if (stripos($result[0], \"is not recognized\") !== false) return false;\n $matches = array();\n if (preg_match(\"/\\\"(\\d+\\.\\d+)/\", $result[0], $matches)) {\n $version = $matches[1];\n return (floatval($version) >= floatval($minimum_version)); \n }\n return false;\n }",
"protected function getJavaInstalledStatus()\n {\n $status = GeneralUtility::makeInstance(Status::class,\n 'Apache Tika',\n 'Java OK'\n );\n\n if (!$this->isJavaInstalled()) {\n $status = GeneralUtility::makeInstance(Status::class,\n 'Apache Tika',\n 'Java Not Found',\n '<p>Please install Java.</p>',\n Status::ERROR\n );\n }\n\n return $status;\n }",
"public static function getPythonVersion()\n {\n $version = null;\n if (CommandUtility::checkCommand('python')) {\n $python = escapeshellarg(CommandUtility::getCommand('python'));\n $cmd = $python . ' -V 2>&1';\n static::exec($cmd, $out, $ret);\n if ($ret === 0) {\n $versionLine = array_shift($out);\n if (preg_match('/Python ([0-9.]+)/', $versionLine, $matches)) {\n $version = $matches[1];\n }\n }\n }\n return $version;\n }",
"public function version()\n {\n exec('uname -a', $result);\n if (preg_match('/(.*)#/', $result[0], $matches)) {\n return trim($matches[1]);\n }\n return 'Unknown version';\n }",
"public function getCurrentVersion()\n\t{\n\t\t$returnValue = 0;\n\t\t$sql = \"SELECT * FROM information_schema.tables where table_name='\" . $this->mVersionsTable . \"'\";\n\t\t$result = $this->query( $sql, __FILE__, __LINE__ );\n\t\tif( $this->numRows( $result ) < 1 )\n\t\t{\n\t\t\t$returnValue = -1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sql = \"SELECT MAX( version_number ) FROM \" . $this->mVersionsTable;\n\t\t\t$result = $this->query( $sql, __FILE__, __LINE__ );\n\t\t\t$row = $this->fetchRow( $result );\n\t\t\t$returnValue = (is_numeric( $row[0] )) ? $row[0] : 0;\n\t\t}\n\t\t\n\t\treturn $returnValue;\n\t}",
"public function getMinPhp()\r\n\t{\r\n\t\t//get version from PHP. Note this should be in format 'x.x.x' but on some systems will look like this: eg. 'x.x.x-unbuntu5.2'\r\n\t\t$phpV = $this->getServerPhp();\r\n\t\t$minV = $this->_min_php;\r\n\t\t$passes = false;\r\n\t\r\n\t\tif ($phpV[0] >= $minV[0]) {\r\n\t\t\tif (empty($minV[2]) || $minV[2] == '*') {\r\n\t\t\t\t$passes = true;\r\n\t\t\t} elseif ($phpV[2] >= $minV[2]) {\r\n\t\t\t\tif (empty($minV[4]) || $minV[4] == '*' || $phpV[4] >= $minV[4]) {\r\n\t\t\t\t\t$passes = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//if it doesn't pass raise a Joomla Notice\r\n\t\tif (!$passes) :\r\n\t\tJError::raiseNotice('VERSION_ERROR',sprintf(JText::_('ERROR_PHP_VERSION'),$minV,$phpV));\r\n\t\tendif;\r\n\t\r\n\t\t//return minimum PHP version\r\n\t\treturn $this->_min_php;\r\n\t}",
"public function isJavaInstalled();",
"public static function getVersion() {\n exec('apache2 -v', $ary, $ret);\n $line = $ary[0];\n $ary = explode(':', $line);\n $ary[1];\n $ary = explode('/', $ary[1]);\n preg_match(\"/\\d+(\\.\\d+)+/\", $ary[1], $matches);\n return $matches[0];\n }",
"public function getOperatingSystemVersion();",
"public static function getVersionNumber()\n {\n $return = 0;\n $res = ConsoleTool::capture('mysql --version', $return);\n if (0 === $return) {\n if (preg_match('![0-9]+\\.[0-9]+\\.[0-9]+!', $res, $match)) {\n return $match[0];\n }\n }\n return false;\n }",
"public function getVersion(): int\n {\n $this->ensureHoldLock();\n\n return $this->version;\n }",
"public function os_version()\n {\n $show = $this->fetchParam(\"show\", NULL, NULL, FALSE, TRUE);\n $os_version_major = $this->getBrowserInfo()['os_version_major'];\n $os_version_minor = $this->getBrowserInfo()['os_version_minor'];\n $os_version_patch = $this->getBrowserInfo()['os_version_patch'];\n $version = $os_version_major . '.' . $os_version_minor . '.' . $os_version_patch;\n\n switch ($show)\n {\n case 'major':\n return $os_version_major;\n break;\n case 'minor':\n return $os_version_minor;\n break;\n case 'patch':\n return $os_version_patch;\n break;\n case 'all':\n return $version;\n break;\n }\n }",
"function _version()\n {\n $result = false;\n $version = '';\n if (function_exists('ps_get_majorversion')) {\n $version = ps_get_majorversion();\n } else if (function_exists('ps_get_value')) {\n $version = ps_get_value($this->_ps, 'major', 0); \n } else {\n ob_start();\n phpinfo(8);\n $php_info = ob_get_contents();\n ob_end_clean();\n\n if (ereg(\"<td[^>]*>pslib Version *<\\/td><td[^>]*>([^<]*)<\\/td>\",\n $php_info, $result))\n {\n $version = $result[1];\n }\n } \n \n if (ereg('([0-9]{1,2})\\.[0-9]{1,2}(\\.[0-9]{1,2})?', trim($version), $result)) {\n return $result[1];\n } else {\n return $version;\n }\n }",
"public function getVersion () {\n\treturn ($version = file_get_contents('VERSION'))\n\t ? $version : \"JSunic 0.0 Invalid\";\n }",
"public function getPHPVersion();",
"public static function version()\n\t{\n\t\tstatic $version = null;\n\n\t\tif (!isset($version))\n\t\t{\n\t\t\t$version = self::call('', 'repository', array('--version'));\n\t\t}\n\n\t\treturn $version;\n\t}",
"function minPhpVersion()\n {\n // return by reference only exist in 5.1 and above\n if (isset($this->returns[\"byRef\"])) {\n return \"5.1.0rc1\";\n }\n\n // default: 4.0\n return \"4.0.0\"; // TODO test for real lower bound\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test to get an account by Id. | public function testAccountById()
{
$accounts = Accounts::fetch($this->getTestAccountId());
$this->assertEquals($accounts['status'], 200);
$this->assertArrayHasKey('account', $accounts['data']);
} | [
"public function testGet_ValidInput_AccountbyidObject()\n {\n $response = $this->client->get('/api/accounts/1');\n\n $this->assertEquals(200, $response->getStatusCode());\n\n $data = $response->getBody()->getContents(); \n \n }",
"public function findAccountById($id)\r\n {\r\n return $this->accountQuery->where(['id' => $id])->one();\r\n }",
"public function get_account_by_id( $id ) {\n\t\t\treturn $this->build_request( \"accounts/$id\" )->fetch();\n\t\t}",
"public static function get ($id) {\n // Retrieve account resources.\n $account = Json::get('account', $id);\n\n // If account resource is not avaiable, internal server error.\n if ($account == 1)\n return 1;\n if ($account == 2)\n return 2;\n\n // Account found.\n return $account;\n }",
"public function findAccountById($id)\n {\n return $this->accountQuery->where(['id' => $id])->one();\n }",
"public function testGetSingleAccount()\n {\n // Parameters for the API call\n $accountIdentifier = 'sdkautotest2';\n\n // Set callback and perform API call\n $result = null;\n self::$controller->setHttpCallBack($this->httpResponse);\n try {\n $result = self::$controller->getAccount($accountIdentifier);\n } catch (APIException $e) {\n }\n\n // Test response code\n $this->assertEquals(\n 200,\n $this->httpResponse->getResponse()->getStatusCode(),\n \"Status is not 200\"\n );\n\n // Test whether the captured response is as we expected\n $this->assertNotNull($result, \"Result does not exist\");\n\n $this->assertTrue(\n TestHelper::isJsonObjectProperSubsetOf(\n \"{\\n \\\"accountIdentifier\\\": \\\"sdkautotest2\\\",\\n \\\"accountNumber\\\": \\\"A11720237\\\",\\n \\\"displayName\" .\n \"\\\": \\\"SDK Auto Testing 2\\\",\\n \\\"currencyCode\\\": \\\"USD\\\",\\n \\\"currentBalance\\\": 0,\\n \\\"createdAt\\\"\" .\n \": \\\"2018-04-26T18:13:45.196Z\\\",\\n \\\"status\\\": \\\"ACTIVE\\\",\\n \\\"contactEmail\\\": \\\"test@example.com\\\"\" .\n \"\\n}\",\n $this->httpResponse->getResponse()->getRawBody(),\n true,\n true,\n false\n ),\n \"Response body does not match in keys and/or values\"\n );\n }",
"public function testGetAccount()\n {\n // Test non existing account\n $this->get('account/test')->assertResponseStatus(404);\n $this->seeJsonStructure(['error']);\n\n // Test existing account\n $this->get('account/' . $this->account->getNumber())->assertResponseOk();\n $this->seeJsonEquals($this->account->toArray());\n }",
"public static function getAccount ($id = null) {\n if (!$id) { \n $id = session::getUserId();\n }\n $db = new db();\n $row = $db->selectOne('account', 'id', $id);\n return $row;\n }",
"public function testGetSubAccountById()\n {\n $subAccount = self::$accountApi->subAccount(self::$SUB_ACCOUNT_GET_ID);\n\n self::assertValidSubAccountUser(\n $subAccount,\n [\n 'id' => self::$SUB_ACCOUNT_GET_ID,\n 'name' => self::$SUB_ACCOUNT_GET_NAME,\n ]\n );\n }",
"public function getAccount($accountid) {\r\n $path = \"account/$accountid\";\r\n return self::performRequest($path);\r\n }",
"public function testGetSubaccountById()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_code = 200;\n // Create a mock response\n $expected = new \\Karix\\Model\\AccountResponse();\n // Create a mock handler\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([\n new \\GuzzleHttp\\Psr7\\Response($expected_code, [], $expected),\n ]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler]);\n\n $apiInstance = new Api\\AccountsApi(\n $client,\n $config\n );\n $uid = \"uid_example\";\n\n try {\n $result = $apiInstance->getSubaccountById($uid);\n $this->assertEquals($expected, $result);\n } catch (Exception $e) {\n $this->fail(\"Exception when calling AccountsApi->getSubaccountById: \".$e->getMessage());\n }\n }",
"public function getAccountById(string $id) : Account\n {\n return $this->table->where(['id' => $id])->firstOrFail();\n }",
"public function testAccount()\n\t{\n\t\tAuth::login(1);\n\n\t\t$response = $this->httpGet('account');\n\t\t$this->assertTrue($response->foundation->isOk());\n\n\t\tAuth::logout();\n\t}",
"public function test_cannot_show_account_with_invalid_id()\n {\n // use a transaction id that doesn't exist\n $mock_account_id = 10;\n\n $response = $this->getJson('/api/accounts'.'/'.$mock_account_id .'/');\n \n $response->assertStatus(400);\n \n }",
"public function testAccountDetailsAreReturned()\n {\n /** @var \\Pterodactyl\\Models\\User $user */\n $user = User::factory()->create();\n\n $response = $this->actingAs($user)->get('/api/client/account');\n\n $response->assertOk()->assertJson([\n 'object' => 'user',\n 'attributes' => [\n 'id' => $user->id,\n 'admin' => false,\n 'username' => $user->username,\n 'email' => $user->email,\n 'first_name' => $user->name_first,\n 'last_name' => $user->name_last,\n 'language' => $user->language,\n ],\n ]);\n }",
"private function findAccountById(AccountId $id)\n {\n $account = $this->accountRepository->findById($id);\n\n if ($account) {\n return $account;\n }\n\n throw AccountIdIsNotFound::withId($id);\n }",
"public function findAccount($id)\n {\n return BitcoinUser::find($id);\n }",
"public function testAccountsByUserId()\n {\n $accounts = Accounts::user($this->getTestUserId());\n\n $this->assertEquals($accounts['status'], 200);\n $this->assertArrayHasKey('accounts', $accounts['data']);\n }",
"function testGetId()\n {\n echo 'Test GetAmount' . \"\\n\";\n $user = self::getUser('teamowner@team.com');\n $activity = $user->getStairsActivities();\n $this->assertEquals($activity[0]->getId(), 11);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get artgroups, optionally filtered with the parent id, as an id => name array. | function organism_artgroup_get_all_as_array($parent = false, $deep = 0) {
if ($parent != false) {
$sql = "SELECT * FROM {organism_artgroup} WHERE parent=:parent AND parent != id ORDER BY name";
$sql_args = array(
':parent' => $parent
);
} else {
$sql = "SELECT * FROM {organism_artgroup} WHERE parent IS NULL ORDER BY name";
$sql_args = array();
}
$result = db_query($sql, $sql_args);
$output = array();
$spacer = '';
for ($i = 0; $i < $deep; $i++)
//$spacer = $spacer . ' ';
$spacer = $spacer.'...';
foreach ($result as $top) {
$output[$top->id] = $spacer . t($top->name);
// use + array union operator to not re-index the arrays as with array_merge()
$output += organism_artgroup_get_all_as_array($top->id, $deep + 1);
}
return $output;
} | [
"function organism_artgroup_get_children($artgroup_id = false, $output = false, $organism_id = false) {\n\t$join = '';\n\tif (!$artgroup_id) {\n\t\t$artgroup_id = SPECIESGROUP_ALL;\n\t}\n\t$wooor = array(\n\t\t\t':parent' => $artgroup_id\n\t);\n\n\t$join = 'JOIN {organism_artgroup_subscription} oas ' . 'ON oas.organism_artgroup_id = oa.id '\n\t\t\t. 'AND oas.organism_id=:organism_id ';\n\t$wooor[':organism_id'] = $organism_id;\n\t$top_sql = 'SELECT oa.id id, oas.organism_id organism_id FROM {organism_artgroup} oa ' . $join\n\t\t\t. ' WHERE oa.parent=:parent AND oa.parent!=oa.id';\n\t$top_result = db_query($top_sql, $wooor);\n\n\tif (!$output) {\n\t\t$output = array();\n\t}\n\n\tforeach ($top_result as $top) {\n\t\tif ($organism_id) {\n\t\t\tif ($top->organism_id != \"\") {\n\t\t\t\t$output[] = $top->id;\n\t\t\t}\n\t\t} else {\n\t\t\tif ($top->id == '') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$output[] = $top->id;\n\t\t}\n\t\t$output = organism_artgroup_get_children($top->id, $output, $organism_id);\n\t}\n\n\treturn $output;\n}",
"public static function groupList()\n {\n $category = Category::all();\n $array = [];\n foreach ($category->where('category_id', 0) as $parent){\n\n $array[$parent->title] = array();\n\n foreach($parent->children as $attribute) {\n $array[$parent->title][$attribute->id] = $attribute->title;\n }\n }\n\n return $array;\n }",
"public function getChildren() {\n $return = (array) Nymph::getEntities(\n ['class' => '\\Tilmeld\\Entities\\Group'],\n ['&',\n 'equal' => ['enabled', true],\n 'ref' => ['parent', $this]\n ]\n );\n return $return;\n }",
"public function collateAncestorIDs()\n {\n $parent = $this;\n $items = [];\n while ($parent instanceof Group) {\n $items[] = $parent->ID;\n $parent = $parent->getParent();\n }\n return $items;\n }",
"public function getGroups();",
"public function getGroups(): array;",
"protected function getGroupInfo(): array\n {\n $rtn = [];\n $groups = $this->groupStore->getWhere([], 100, 0, ['title' => 'ASC']);\n\n foreach ($groups['items'] as $group) {\n $thisGroup = ['title' => $group->getTitle()];\n $projects = $this->projectStore->getByGroupId($group->getId(), false);\n\n $thisGroup['projects'] = $projects['items'];\n $thisGroup['summary'] = $this->getSummaryHtml($thisGroup['projects']);\n\n $rtn[] = $thisGroup;\n }\n\n return $rtn;\n }",
"public function AllParentGroups()\n {\n $otherGroupsArray = $this->ProductGroups()->map('ID', 'ID')->toArray();\n\n return ProductGroup::get()->filter(\n array(\n 'ID' => array($this->ParentID => $this->ParentID) + $otherGroupsArray,\n )\n );\n }",
"function get_record_groups($id)\n {\n /* empty for address books don't supporting groups */\n return array();\n }",
"public static function getGroups();",
"public function all_child_group()\n\t{\n\t\t$this->db->where('group_status = 1 AND group_parent > 0');\n\t\t$this->db->order_by('group_name', 'ASC');\n\t\t$query = $this->db->get('group');\n\t\t\n\t\treturn $query;\n\t}",
"private function fetchGroups($ids = []) {\n $groups = [];\n try {\n $params = [\n 'sequential' => FALSE,\n 'return' => [\"title\"],\n 'options' => ['limit' => 0],\n ];\n if (!empty($ids)) {\n $params['id'] = ['IN' => $ids];\n }\n $api_groups = $this->civicrmApi->get('group', $params);\n if (!empty($api_groups)) {\n foreach ($api_groups as $gid => $group) {\n $groups[$gid] = $group['title'];\n }\n }\n }\n catch (\\Exception $e) {\n\n }\n return $groups;\n }",
"public function getShowGroups();",
"public function getAlbums()\n {\n return GalleryAlbum::get()->filter('ParentID', $this->ID);\n }",
"function getGroupListByEventId($eventId=null)\n {\n if (empty($eventId) || is_null($eventId)) {\n return;\n }\n $tmp = $this->find('all', array(\n 'conditions' => array('event_id' => $eventId), 'fields'=>array('id', 'group_id')\n ));\n return $tmp;\n }",
"public function getHierarchyGroupIds() \n {\n $return = array();\n $tree = new Warecorp_Tree('zanby_groups__hierarchy_tree', \"type = 'item'\");\n $tree_nodes = $tree->getTree($this->id);\n if ( $tree_nodes ) {\n foreach ($tree_nodes as $tree_node) {\n $return[] = $tree_node['group_id'];\n }\n }\n return $return;\n }",
"function getGroupParentList($gid)\n {\n if (!isset($this->_groupParentList[$gid])) {\n $name = $this->getGroupName($gid);\n $pos = strpos($name, ':');\n if ($pos == false) {\n $this->_groupParentList[$gid] = array();\n return $this->_groupParentList[$gid];\n }\n\n $parents = array();\n while ($pos) {\n $name = substr($name, 0, $pos);\n $parents[] = $name;\n $pos = strpos($name, ':');\n }\n\n $query = 'SELECT group_uid, group_name FROM horde_groups '\n . ' WHERE group_name IN (' . str_repeat('?, ', count($parents) - 1) . '?) ';\n $parents = $this->_db->getAssoc($query, false, $parents);\n if (is_a($parents, 'PEAR_Error')) {\n return $parents;\n }\n\n $this->_groupParentList[$gid] = $parents;\n }\n\n return $this->_groupParentList[$gid];\n }",
"private function build_group_list()\r\n {\r\n $groups = $this->group_model->get_all();\r\n\r\n $list = array();\r\n\r\n foreach($groups as $group)\r\n {\r\n $list[$group->id] = $group->name;\r\n }\r\n\r\n return $list;\r\n }",
"function organism_artgroup_get_artgroup($artgroup_id, $just_the_name = false) {\n\tif (!$artgroup_id)\n\t\treturn;\n\t$artg = db_query(\n\t\t'SELECT * FROM {organism_artgroup} ' . 'WHERE id=:id',\n\t\tarray(':id' => $artgroup_id))->fetchAssoc();\n\tif ($just_the_name)\n\t\treturn $artg['name'];\n\treturn $artg;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write the todo list of things to do for the node. The worker will pass a list of pending todos for it or other workers to accomplish. | function write_todo( $todo ){
$this->store_todo( $this->get_user_id(), $todo );
} | [
"function writeTasks(&$tasks) {\n // converts the array of tasks to json array\n $json = json_encode($tasks);\n // saves the json to the tasks' file\n file_put_contents('./data/tasks.json', $json);\n}",
"public function print_todo() {\n\t\t\tforeach ($this->todo as $id => $item) {\n\t\t\t\techo \"<li>\" . $item . PHP_EOL .\n\t\t\t\t\t \"<br /><a href=\\\"actions/chart.php?project=\" . $this->name . \"&act=del_todo&id=\" . $id . \"\\\"><input type=\\\"button\\\" class=\\\"button-delete\\\" /></a> <a href=\\\"actions/chart.php?project=\" . $this->name . \"&act=todo_to_doing&id=\" . $id . \"\\\"><input type=\\\"button\\\" class=\\\"button-next\\\" /></a></li>\";\n\t\t\t}\n\t\t}",
"function ToDoList(){\n\t/*\n\tdo your customize action here\n\t*/\n\t\n\t//call the default function\n\tListing('ToDo');\n}",
"public function obterTodos() {\n }",
"function writeTasks($tasks){\n $json = json_encode($tasks);//CONVERT INTO JSON and put it in the file\n file_put_contents('./data/tasks.json', $json);\n}",
"public function traerTodo()\n {\n }",
"public function updateToDoList(){\n\t\t$db = $this->db;\n\t\tif(count($this->errors)<1 && is_array($this->toDoList)){ //no error, to do list is an array\n\t\t\t\n\t\t\tforeach($this->toDoList as $item){\n\t\t\t\t$itemUUID = $item[\"itemUUID\"];\n\t\t\t\t$where = array();\n\t\t\t\t$where[] = \"itemUUID = '$itemUUID' \";\n\t\t\t\t$data = array('solr_indexed' => 1);\n\t\t\t\t$db->update('noid_bindings', $data, $where);\n\t\t\t}\n\t\t\t\n\t\t\t$this->totalIndexed = count($this->toDoList);\n\t\t}\n }",
"protected function listcurrentTasks()\n {\n $stmt = $this->task->read();\n $num = $stmt->rowCount();\n \n if ($num>0) {\n \n $task_arr = [];\n $task_arr[\"records\"] = [];\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n extract($row);\n $task_record=array(\n \"id\" => $id,\n \"task\" => $task,\n \"due_date\" => $this->showDate($due_date),\n \"is_completed\" => ($is_completed == 1) ? 'Yes' : 'No',\n );\n array_push($task_arr[\"records\"], $task_record);\n }\n \n return $this->_response(array(\"status\" => \"success\", \"data\" => $task_arr[\"records\"], \"message\" => \"TO-DO Listing\", 200));\n }\n \n return $this->_response(array(\"status\" => \"error\",\"message\" => \"No data available\", 500));\n }",
"public function index_todo() {\n\n\t\t# if not logged in -> redirect to the login page\n\t\tif (!$this->user) {\n\t\t\tRouter::redirect('/users/login');\n\t\t}\n\n\t\t# Set up the View\n\t\t$this->template->content = View::instance('v_todo_index_todo');\n\t\t$this->template->title = \"TO DOs\";\n\n \t# Query the database for to do's\n \t$q = \"\tSELECT \n\t\t todo.todo_id,\n\t\t todo.user_id,\n\t\t todo.topic,\n\t\t todo.created,\n\t\t todo.priority,\n\t\t todo.done,\n\t\t addressbook.addressbook_id AS address_id,\n\t\t addressbook.first_name,\n\t\t addressbook.last_name,\n\t\t addressbook.emailHome,\n\t\t addressbook.emailWork,\n\t\t addressbook.skype,\n\t\t addressbook.phoneNumberWork,\n\t\t addressbook.mobilePhoneNumber,\n\t\t addressbook.phoneNumberHome\n\t\t FROM todo\n\t\t JOIN addressbook ON\n\t\t \taddressbook.addressbook_id = todo.addressbook_id\n\t\t WHERE todo.done = '0'\n\t\t AND todo.user_id = \".$this->user->user_id;\n\n\t\t$todos = DB::instance(DB_NAME)->select_rows($q);\n\n\t\t# if list is empty display a message\n\t\tif (empty($todos)) {\n\t\t\t$messageEmpty = \"Your TO DO list is empty<br>You can add TO DOs via the main menu\";\n\t\t} else {\n\t\t\t$messageEmpty = \" \";\n\t\t}\n\n\t\t# Pass data to the View and render the View\n\t\t$this->template->content->todos = $todos;\n\t\t$this->template->content->messageEmpty = $messageEmpty;\t\t\n\t\techo $this->template;\n\t}",
"public function process_todo_item(){\n\n\t\tcheck_ajax_referer( 'bcit_todo_ajax_nonce', 'security' );\n\n\t\t$save_me = false;\n\n\t\tif ( isset( $_POST['title'] ) && ! empty( $_POST['title'] ) && current_user_can( 'create_todo_list' ) ){\n\t\t\t$save_me = true;\n\t\t}\n\n\t\tif ( true === $save_me ){\n\n\t\t\t$args = $this->save_task( $_POST );\n\n\t\t} else {\n\t\t\t$args = array(\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => 'Task not saved',\n\t\t\t);\n\t\t}\n\n\t\twp_send_json_success( $args );\n\n\t}",
"function teamwork_action_create_task($teamwork_person, $teamwork_tasklist, $teamwork_date, $teamwork_task) {\n global $user;\n $key = db_query('SELECT api_key FROM {teamwork_api} WHERE uid = :uid', array(':uid' => $user->uid))->fetchField();\n $company = db_query('SELECT company_name FROM {teamwork_api} WHERE uid = :uid', array(':uid' => $user->uid))->fetchField();\n $task_list_people_id = $teamwork_person;\n $task_list_id = $teamwork_tasklist;\n $task_date = date('Ymd', $teamwork_date);\n $task_name = $teamwork_task;\n $arr = array(\n 'todo-item' => array(\n 'content' => $task_name,\n 'responsible-party-id' => $task_list_people_id,\n 'due-date' => $task_date\n )\n );\n $json = json_encode($arr);\n $channel = curl_init();\n curl_setopt($channel, CURLOPT_URL, \"https://{$company}.teamwork.com/todo_lists/{$task_list_id}/todo_items.json\");\n curl_setopt($channel, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($channel, CURLOPT_POST, 1);\n curl_setopt($channel, CURLOPT_POSTFIELDS, $json);\n curl_setopt($channel, CURLOPT_HTTPHEADER, array(\n \"Authorization: BASIC \" . base64_encode($key . \":xxx\") ,\n \"Content-type: application/json\"\n ));\n curl_exec($channel);\n curl_close($channel);\n}",
"public function addTodo($sender) {\n $this->csi->lblTodos->html .= \"<div><b>\" . $this->counter . \".: </b>\" . $this->csi->txtTodo->value . \"</div>\";\n $this->csi->txtTodo->value = \"\";\n $this->counter++;\n }",
"protected function makeTodo($todo){\n if($todo[\"status\"]==0){\n echo '\n <div class=\"todo\" todo-importance=\"'.$todo[\"importance\"].'\" status=\"'.$todo[\"status\"].'\" todo-id=\"'.$todo[\"id\"].'\">\n <p>'.$todo[\"content\"].'</p>\n <div class=\"operations-container\">\n <button class=\"done done-todo\" ><i class=\"fas fa-check done\"></i></button>\n <button class=\"delete delete-todo\"><i class=\"far fa-trash-alt delete\"></i></button>\n \n </div>\n </div>\n ';\n }\n }",
"public function writeSaveQueue() {}",
"public function setAsTodo() : void\n {\n $this->status = self::STATUS_TODO;\n }",
"public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_assign($todo){\n \\SYSTEM\\SQL\\SYS_SAIMOD_TODO_ASSIGN::QI(array($todo,\\SYSTEM\\SECURITY\\security::getUser()->id));\n return \\SYSTEM\\LOG\\JsonResult::ok();}",
"public static function write()\n\t{\n\t\tif (static::$is_cli)\n\t\t{\n\t\t\tcall_user_func_array(array(\"\\\\Cli\", 'write'), func_get_args());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tstatic::$writes[] = func_get_args();\n\t\t}\n\t}",
"public function listToDo() {\n\t\treturn $this->collection;\n\t}",
"public function actionCompletetodo($servicetask_id,$task_id,$team_loc,$taskunit_id,$todo_id,$team_id,$case_id){\n \t$checkAccess = (new ProjectSecurity)->checkTeamAccess($team_id,$team_loc,$case_id);\n \tif(!$checkAccess){\n $team_name = Team::findOne($team_id)->team_name;\n return 'This action is available only to '.$team_name.' Team Members.';\n }\n \t$taskunit = TasksUnits::findOne($taskunit_id);\n \t$task_info = Tasks::findOne($task_id);\n \tif($taskunit->unit_status!=1){\n \t\treturn 'ToDo cannot be complete unless the task has Started.';\n \t}\n \t\t$model = $this->findTodoModel($todo_id);\n \tif ($model->assigned == 0 || $model->assigned == \"\") {\n \t\treturn \"The Todo cannot be Completed unless the ToDo has been Assigned.\";\n \t}\n \t$model->complete=1;\n \t$model->save(false);\n \t(new ActivityLog)->generateLog('ToDo', 'Completed', $todo_id, $task_id);\n \t$duration = \"0 days 0 hours 0 min\";\n \t(new TasksUnitsTodoTransactionLog)->generateLog($todo_id,$task_id,$taskunit_id,$taskunit->unit_assigned_to,9,$duration);\n \t/* Sending ToDo Completed Subscription Alert Email CHANGE */\n \t//SettingsEmail::sendEmail\n\t\tEmailCron::saveBackgroundEmail(18, 'is_completed_todos', $data = array('case_id' => $task_info->client_case_id, 'todo_id' =>$todo_id, 'service_id' => $servicetask_id, 'project_id' => $task_id, 'task_unit_id' => $taskunit_id));\n \t/* Sending ToDo Completed Subscription Alert Email */\n \treturn 'OK';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper method. Just passes through the HTML code BackendNavGenerator::get() returns. | public function renderBackendNavigation() : string
{
$backendNavGenerator = new BackendNavGenerator();
return $backendNavGenerator->get();
} | [
"public function renderBackendNav()\n {\n $backNavGen = new BackNavGen();\n return $backNavGen->get();\n }",
"public static function get_nav_content() {\n\t\t\techo Elementor\\Plugin::instance()->frontend->get_builder_content_for_display( self::get_nav_id() );\n\t\t}",
"public function getNav();",
"private function generateNavBarElement()\n {\n\t return $this->generateNavBar('white');\n }",
"public function getHTML()\n {\n // Variables\n $navbarId = $this->config[\"config\"][\"navbar-id\"];\n $navbarClass = $this->config[\"config\"][\"navbar-class\"];\n $ulClass = $this->config[\"config\"][\"ul-class\"];\n\n // Make navbar\n $html = \"<div id='{$navbarId}' class='{$navbarClass}'>\"\n . \"<ul class='{$ulClass}'>\";\n\n foreach ($this->config[\"items\"] as $val) {\n // Don't add 'login' route if already logged in\n // Don't add 'user' route if not logged in\n // Don't add 'admin' if user isn't an admin\n if ($this->shouldBeSkipped($val[\"route\"])) {\n continue;\n }\n if ($val['dropdown']) {\n // Dropdown\n $html .= $this->getDropdownHTML($val);\n } else {\n // No drop dropdown\n $route = call_user_func($this->urlCreator, $val[\"route\"]);\n $active = $val[\"route\"] === $this->currentRoute ? \"active\" : \"\";\n $html .= \"<li class='{$active}'><a href='{$route}'>{$val['text']}</a></li>\";\n }\n }\n\n $html .= \"</ul></div>\";\n return $html;\n }",
"public function navbar() {\n return $this->render_from_template('core/navbar', $this->page->navbar);\n }",
"function generate_page_nav ( $db ){\n\t\treturn \"\n\t\t\t\t\".generate_site_nav($db);\n\t}",
"function sp_render_navbar_menu()\n{\n $menu = new NavbarGenerator(MenuStorage::getNavbarMenus());\n return $menu->renderHtml();\n}",
"public function getNavigation();",
"public function generateNavs(){\n\n $navs = Config::get('backend::navs');\n $activeClass = Config::get('backend::active_nav_class');\n\n $navHTML = '<ul class=\"_fwfl _db _m0 vertical-nav\">';\n foreach($navs as $order => $nav){\n if($order == 0){\n $navHTML .= '<li class=\"vertical-nav-top\">';\n }else{\n $navHTML .= '<li>';\n }\n $navHTML .= '<a href=\"' . url($nav['url']) . '\" class =\"' . $this->showActiveClass($activeClass, $nav['nav_name']) . '\">'\n . '<i class=\"' . $nav['icon'] . ' left-nav-icon\"></i>'\n . '<span class=\"left-nav-txt\"> ' . $nav['txt'] . '</span>'\n . '<i class=\"fa fa-angle-left left-nav-arrow\"></i>'\n . '</a></li>';\n }\n\n $navHTML .= '</ul>';\n\n return $navHTML;\n }",
"public function nav()\n\t{\n\t\treturn $this->append('nav');\n\t}",
"public function getNavigationHTMLString() {\n\t\treturn $this->naviString;\n\t}",
"public function getHtmlPage(){\n global $path, $session, $orga;\n //function getPage will return an array with $pageTitle and $content\n $getPage = $this->getPage();\n $style = \"style_user.css\";\n if ($session->get('admin_mode')){\n $style = \"style_admin.css\";\n }\n $navbar_view = new View($this->getNavbarData(), \"navbar_template.html\");\n $footer_view = new View([\n \"{{ orga_name }}\" => $orga[\"name\"],\n \"{{ orga_logo_src }}\" => $orga[\"logo_src\"],\n \"{{ orga_website }}\" => $orga[\"website\"],\n \"{{ orga_address }}\" => $orga[\"address\"],\n \"{{ orga_city }}\" => $orga[\"city\"],\n \"{{ orga_state }}\" =>$orga[\"state\"],\n \"{{ orga_zipcode }}\" => $orga[\"zipcode\"],\n \"{{ orga_country }}\" => $orga[\"country\"],\n \"{{ orga_email }}\" => $orga[\"email\"],\n \"{{ orga_phone }}\" => $orga[\"phone\"]\n ], \"footer.html\");\n $view = new View([\n \"{{ pageTitle }}\" => $getPage[0],\n \"{{ user_or_admin_style }}\" => $style,\n \"{{ navBar }}\" => $navbar_view->_html,\n \"{{ content }}\" => $getPage[1],\n \"{{ footer }}\" => $footer_view->_html,\n \"{{ path }}\" => $path\n ], \"page_template.html\");\n return $view->_html;\n }",
"function internal_nav() {\n\treturn '<nav class=\"long-page-nav\"><a href=\"#table-of-contents\">Return to Trust Indicators</a> | <a href=\"'.get_referral_url().'\">Go Back to the Article</a></nav>';\n}",
"public function home_nav_display() {\n\t\t// Build the output to return for use by the shortcode.\n\t\tob_start();\n\t\t?>\n\t\t<nav>\n\t\t\t<ul>\n\t\t\t\t<li class=\"metroTitle\"> <ul class=\"label\">\n\t\t\t\t\t\t<h2>Design + production</h2>\n\t\t\t\t\t</ul></li>\n\t\t\t\t<li class=\"web\"><a href=\"/web/\"> <ul class=\"label\">\n\t\t\t\t\t\t\t<h3>Web + social media</h3>\n\t\t\t\t\t\t\t<li class=\"descripto\">University Marketing and Communications creates compelling websites that deliver the messages you want and the information readers seek.</li> </ul></a></li>\n\t\t\t\t<li class=\"email\"><a href=\"/email/\"> <ul class=\"label\">\n\t\t\t\t\t\t\t<h3>Email</h3>\n\t\t\t\t\t\t\t<li class=\"descripto\">Email is the #1 activity on smartphones and tablets, according to Pew Research. University Marketing and Communications writes and designs emails that captivate readers on the full range of devices.</li> </ul></a></li>\n\t\t\t\t<li class=\"printed\"><a href=\"/print/\"> <ul class=\"label\">\n\t\t\t\t\t\t\t<h3>Printed materials</h3>\n\t\t\t\t\t\t\t<li class=\"descripto\">Want your print publications to get noticed, read, and remembered? We’ll work with you to strategically plan print pieces that build awareness of your initiatives and shape audience attitudes.</li> </ul></a></li>\n\t\t\t\t<li class=\"presentations\"><a href=\"/presentations/\"> <ul class=\"label\">\n\t\t\t\t\t\t\t<h3>Presentations</h3>\n\t\t\t\t\t\t\t<li class=\"descripto\">Deliver your message with clarity and impact, while leveraging the strength of the WSU brand.</li> </ul></a></li>\n\t\t\t\t<li class=\"photo\"><a href=\"/photos-video/\"> <ul class=\"label\">\n\t\t\t\t\t\t\t<h3>Photography + video</h3>\n\t\t\t\t\t\t\t<li class=\"descripto\">The work of University Marketing and Communications photographers and videographers entertains and educates while advancing the WSU brand.</li> </ul></a></li>\n\t\t\t</ul>\n\t\t</nav>\n\t\t<?php\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\n\t\treturn $content;\n\t}",
"function navItem() {\n global $securePages; \n global $navItem_Names; \n $navContent = \"\";\n\n for ($i = 0; $i < count($securePages); $i++) {\n $navContent .= \"<li class='navList_Item'>\n <a href='index.php?content=\" . $securePages[$i] . \"' id = '\" . $securePages[$i] .\"link' class = '\" . activePage($securePages[$i]) . \"' >\" . $navItem_Names[$i] . \"</a>\n </li>\";\n }\n\n return $navContent;\n }",
"private function render()\n\t{\n\t\t$html = '<nav class=\"navbar ' . $this->navbar_class . \n\t\t\t'\" role=\"navigation\"><div class=\"' . $this->container_class . '\">';\n\n\t\t$html .= $this->brandAndToggle();\n\t\t$html .= $this->navbarItems();\n\n\t\t$html .= '</div></nav>';\n\n\t\treturn $html;\n\t}",
"private function _getPageNavigation() {\n \t$Template = \"<div class=\\\"pageNav\\\">\" .\n \t\t\t\t\"<div class=\\\"prev\\\">[PREV-LINK]</div>\" .\n \t\t\t\t\"<div class=\\\"next\\\">[NEXT-LINK]</div>\" .\n \t\t\t\t\"</div>\";\n \t$Prev = \"« Older\";\n \t$Next = \"Newer »\";\n\t $rVal = \"\";\n\t \n\t // If this is Not a Single Post, Return a Blank\n\t $RecordCount = 0;\n\t if ( array_key_exists('RecordCount', $this->settings) ) {\n\t \t$RecordCount = $this->settings['RecordCount'];\n\t }\n\t if ( $RecordCount != 1 ) { return $rVal; }\n\t \n\t $data = $this->content->getPagePagination();\n\t if ( is_array($data) ) {\n\t \t$rVal = $Template;\n\t \t$PrevHREF = $NextHREF = \"\";\n\t \tif ( array_key_exists('Prev', $data) ) {\n\t\t \t$PrevURL = str_replace(\"[HOMEURL]\", $this->settings['HomeURL'], $data['Prev']['PostURL']);\n\t\t \t$PrevHREF = \"<a href=\\\"$PrevURL\\\" title=\\\"\" . $data['Prev']['Title'] . \"\\\">$Prev</a>\";\n\t \t}\n\n\t \tif ( array_key_exists('Next', $data) ) {\n\t\t \t$NextURL = str_replace(\"[HOMEURL]\", $this->settings['HomeURL'], $data['Next']['PostURL']);\n\t\t \t$NextHREF = \"<a href=\\\"$NextURL\\\" title=\\\"\" . $data['Next']['Title'] . \"\\\">$Next</a>\";\n\t \t}\n\n\t \t// Replace the Strings Accordingly\n\t \t$rVal = str_replace(\"[PREV-LINK]\", $PrevHREF, $rVal);\n\t \t$rVal = str_replace(\"[NEXT-LINK]\", $NextHREF, $rVal);\n\t }\n\n\t // Return the Page Navigation\n\t return $rVal;\n }",
"function getNav() {\n //reserve memory for $html\n $html = \"\";\n\n $html .= \"<div class=\\\"grid_16 navigation\\\">\\n\";\n\t$html .= \"<ul class=\\\"nav\\\">\\n\";\n $html .= \"<li><a href=\\\"index.php\\\" title=\\\"Home\\\">Home</a></li>\\n\";\n $html .= \"<li>\\n\";\n $html .= \"<a href=\\\"#\\\" title=\\\"Training Programs\\\">Training Programs</a>\\n\";\n $html .= \"<ul>\\n\";\n $html .= \"<li><a href=\\\"uc.php\\\">University of California</a></li>\\n\";\n\t$html .= \"<li><a href=\\\"comm.php\\\">Community Colleges</a></li>\\n\";\n $html .= \"</ul>\\n\";\n $html .= \"</li>\\n\";\n $html .= \"</ul>\\n\\n\";\n $html .= \"<div class=\\\"clear\\\"></div></div>\\n\";\n\t\n\techo $html;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle the Publication "force deleted" event. | public function forceDeleted(Publication $pulbication)
{
//
} | [
"public function onBeforeDelete() {\n\t\tif ( !$this->owner->Syndicated && ($this->owner->Status == 'Unpublished' || $this->owner->IsDeletedFromStage) ) {\n\t\t\t$record = new BlogSyndicatorDeletedEntry();\n\t\t\t$record->EntryID = $this->owner->ID;\n\t\t\t$record->write();\n\t\t}\n\t}",
"protected function afterDeletion() {}",
"protected function afterDelete () {}",
"public function deleted()\n {\n // do something after delete\n }",
"public function forceDeleted(Prescription $prescription)\n {\n //\n }",
"public function on_delete() {}",
"public function forceDeleted(Professor $professor)\n {\n //\n }",
"protected function afterDelete()\n {\n }",
"public function forceDeleted(UserPublicInfo $userPublicInfo)\n {\n //\n }",
"public function forceDeleted(Remission $remission)\n {\n //\n }",
"public function forceDelete();",
"public function onBeforeDelete()\n {\n $this->owner->AccessTokens()->removeAll();\n }",
"public function forceDelete()\n {\n }",
"public function flagAsDeleted () {\n // xxx finish\n }",
"public function forceDeleted(Woman $woman)\n {\n\n }",
"public function forceDeleted(PermissionApproved $permissionApproved)\n {\n //\n }",
"public function forceDeleted(Event $event)\n {\n //\n }",
"protected function _postDelete()\n { }",
"protected function before_delete() {\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve post title. If the post is protected and the visitor is not an admin, then "Protected" will be displayed before the post title. If the post is private, then "Private" will be located before the post title. | function get_the_title( $post = 0 ) {
$post = get_post( $post );
$title = isset( $post->post_title ) ? $post->post_title : '';
$id = isset( $post->ID ) ? $post->ID : 0;
if ( ! is_admin() ) {
if ( ! empty( $post->post_password ) ) {
/**
* Filters the text prepended to the post title for protected posts.
*
* The filter is only applied on the front end.
*
* @since 2.8.0
*
* @param string $prepend Text displayed before the post title.
* Default 'Protected: %s'.
* @param WP_Post $post Current post object.
*/
$protected_title_format = apply_filters( 'protected_title_format', __( 'Protected: %s' ), $post );
$title = sprintf( $protected_title_format, $title );
} elseif ( isset( $post->post_status ) && 'private' == $post->post_status ) {
/**
* Filters the text prepended to the post title of private posts.
*
* The filter is only applied on the front end.
*
* @since 2.8.0
*
* @param string $prepend Text displayed before the post title.
* Default 'Private: %s'.
* @param WP_Post $post Current post object.
*/
$private_title_format = apply_filters( 'private_title_format', __( 'Private: %s' ), $post );
$title = sprintf( $private_title_format, $title );
}
}
/**
* Filters the post title.
*
* @since 0.71
*
* @param string $title The post title.
* @param int $id The post ID.
*/
return apply_filters( 'the_title', $title, $id );
} | [
"function getTitle() {\n return apply_filters( 'the_title', $this->post->post_title );\n }",
"public function getPostTitle();",
"public function get_title() {\n\t\treturn $this->post ? $this->post->post_title : '';\n\t}",
"public function get_title()\n {\n return $this->post ? $this->post->post_title : '';\n }",
"public function get_title() {\n\t\treturn $this->get_field( 'post_title' );\n\t}",
"public function getPostTitle(): string {\n\t\treturn ($this->postTitle);\n\t}",
"public function getPostTitle()\n {\n return $this->post_title;\n }",
"public function get_title() {\n\t\treturn apply_filters( 'the_title', $this->post_title, $this->ID );\n\t}",
"public function get_title() {\n return $this->post_title;\n }",
"public function get_title() {\n\t\treturn $this->resource->post_title;\n\t}",
"public function title()\n {\n return apply_filters('the_title', $this->post_title, $this->ID);\n }",
"public function getPostTitleDisplay()\n {\n return $this->post_title_display;\n }",
"function getPageTitle() {\n\t\t$this->processFrontpageTag();\n\t\t\n\t\treturn $this->pagedata['title'];\n\t}",
"protected function getTitle() {\n return ($this->page->title);\n }",
"function prism_postheader_posttitle() {\n\t\t\n\t\t$posttitle = \"\\n\\n\\t\\t\\t\\t\\t\";\n\t if (is_single() || is_page()) {\n\t $posttitle .= '<h1 class=\"entry-title\">' . get_the_title() . \"</h1>\\n\";\n\t } elseif (is_404()) { \n\t $posttitle .= '<h1 class=\"entry-title\">' . __('Not Found', 'prism') . \"</h1>\\n\";\n\t } else {\n\t $posttitle .= '<h2 class=\"entry-title\">';\n\t $posttitle .= sprintf('<a href=\"%s\" title=\"%s\" rel=\"bookmark\">%s</a>',\n\t \t\t\t\t\t\tapply_filters('the_permalink', get_permalink()),\n\t\t\t\t\t\t\t\t\tsprintf( esc_attr__('Permalink to %s', 'prism'), the_title_attribute( 'echo=0' ) ),\n\t \t\t\t\t\t\tget_the_title()); \n\t $posttitle .= \"</h2>\\n\";\n\t }\n\t \n\t return apply_filters('prism_postheader_posttitle',$posttitle); \n\t\n\t}",
"public function getTitle() {\n\t\t\t// TODO: Implement a meaningful title in all\n\t\t\t// subclasses and make this function abstract?\n\t\t\treturn showPagename($this->pagename);\n\t\t}",
"public function the_title() {\n\t\techo wp_kses_post( apply_filters( 'the_title', $this->get_title() ) );\n\t}",
"public function share_title() {\n\t\t$post_title = html_entity_decode( $this->share_post()->post_title, ENT_COMPAT, 'UTF-8' );\n\n\t\tif ( false != ( $alternate_title = trim( get_post_meta( absint( $this->share_post()->ID ), '_pn_title_alternate', true ) ) ) ) {\n\t\t\t$post_title = $alternate_title;\n\t\t}\n\n\t\treturn $post_title;\n\t}",
"public static function getPageTitle() {\r\n // Set the current page of the WP query since it's used by SEO plugins.\r\n global $wp_query, $page;\r\n $oldPage = $wp_query->get('page');\r\n if ($page > 1) {\r\n $wp_query->set('page', $page);\r\n }\r\n else {\r\n $wp_query->set('page', null);\r\n }\r\n\r\n // Get the title.\r\n $title = self::getPageTitleHelper();\r\n $title = html_entity_decode($title, ENT_QUOTES, 'UTF-8');\r\n\r\n // Set back the current page.\r\n $wp_query->set('page', $oldPage);\r\n\r\n // Return the title.\r\n return $title;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the cached data for the given subject and key. If you want to get George's friends from the cache, you ask for: $data = Y_Cache::get('george', Y_Cache::FRIENDS); Like memcached, we return false when a key is not available in the cache. | static public function get($subject, $key) {
$cache = self::singleton();
$key = self::generateKey($subject, $key);
if (!isset(self::$local[$key])) {
self::$local[$key] = $cache->get($key);
Y_Log::debug('cache get remote %s', $key);
} else
Y_Log::debug('cache get local %s', $key);
return self::$local[$key];
} | [
"public function get($key) {\n\t\t// First, check to see if the result has been cached.\n\t\tif (!isset($this->_cache[$key])) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Second, check its freshness.\n\t\tif ($this->_cache[$key]['time'] < time() - self::$_lifespan) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn $this->_cache[$key]['data'];\n\t}",
"public function fetch($key) {\n\t\t$stmt_cache = md5(__METHOD__);\n\t\t\n\t\tif(!isset($this->stmts[$stmt_cache])){\n\t\t\t$this->stmts[$stmt_cache] = $this->db->prepare(\"\n\t\t\t\tSELECT\n\t\t\t\t\texpires_by,\n\t\t\t\t\tdata\n\t\t\t\tFROM\n\t\t\t\t\tsb_cache_mysql\n\t\t\t\tWHERE\n\t\t\t\t\tcache_key = :cache_key\n\t\t\t\");\n\t\t\t\n\t\t}\n\t\t\n\t\t$stmt = $this->stmts[$stmt_cache];\n\t\t\n\t\t$result = $stmt->execute(Array(\n\t\t\t':cache_key' => $key\n\t\t));\n\t\t\n\t\t$rows = $stmt->fetchAll();\n\t\t\n\t\tif(isset($rows[0]) && ($rows[0]->expires_by == 0 || time() < $rows[0]->expires_by)){\n\t\t\n\t\t\t$data = @unserialize($rows[0]->data);\n\t\t\t\n\t\t\tif($data){\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t$this->delete($key);\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"protected function GetCachedData($key)\n {\n if (is_null($this->MemConnection) === TRUE) {\n $this->library->load->library(\"memlibrary\");\n $this->MemConnection = $this->library->memlibrary;\n return $this->MemConnection->Get($key);\n } else {\n return $this->MemConnection->Get($key);\n }\n }",
"private function getDataFromCache($key = null)\n\t{\n\t\t//in case caching is disabled return null\n\t\tif ($this->isCacheBypassed()) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$data_from_cache = null;\n\t\t$refresh_required = false;\n\n\t\t//get the content of the entire cache storage\n\t\t$cache = $this->getArrayFromJsonFile($this->cache_file);\n\n\t\t//check if the $key was cached previously\n\t\tif (isset($key) && isset($cache[$key])) {\n\t\t\t$data = $cache[$key];\n\n\t\t\tswitch ($key) {\n\t\t\t\tcase 'users': //users have a simple cache structure\n\t\t\t\t\tforeach ($data as $created => $users) {\n\t\t\t\t\t\tif (strtotime($created) >= (time() - $this->options['cache_minutes'] * 60)) {\n\t\t\t\t\t\t\t//found an entry that is still active\n\t\t\t\t\t\t\t$data_from_cache = $users;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//stale cache entry so can be dropped\n\t\t\t\t\t\t\tunset($cache[$key][$created]);\n\t\t\t\t\t\t\t$refresh_required = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault: //all other cached data is based on the start date and week count\n\t\t\t\t\t$start_length_key = $this->controller->getScheduleStartingDay() . '__' .\n\t\t\t\t\t\t\t\t\t\t$this->controller->getWeeksToShowCount();\n\t\t\t\t\tif (array_key_exists($start_length_key, $data)) {\n\t\t\t\t\t\tif (strtotime($data[$start_length_key]['created']) >= (time() - $this->options['cache_minutes'] * 60)) {\n\t\t\t\t\t\t\t//found an entry that is still active\n\t\t\t\t\t\t\t$data_from_cache = $data[$start_length_key]['content'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//stale cache entry so can be dropped\n\t\t\t\t\t\t\tunset($cache[$key][$start_length_key]);\n\t\t\t\t\t\t\t$refresh_required = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t//need to refresh the cache storage to remove expired keys\n\t\tif ($refresh_required) {\n\t\t\t$this->cacheData(null, $cache);\n\t\t}\n\n\t\treturn $data_from_cache;\n\t}",
"function core_cache_Get($key)\n{\n $cache = coresys_cache_Initialize();\n RETURN $cache->get($key);\n}",
"public function getObjFromCache($key);",
"function get($key) {\n return $this->memcached->get($key);\n }",
"function memcached_get($key){\n if($key&&$memcached=memcached_connect()){\n $result = $memcached->get($key);\n }else{\n $result = false;\n }\n return $result;\n}",
"public function isCached($key);",
"function wp_cache_get_by_key( $server_key, $key, $group = '', $cache_cb = null, &$cas_token = null ) {\n\tglobal $wp_object_cache;\n\n\tif ( func_num_args() > 3 )\n\t\treturn $wp_object_cache->getByKey( $server_key, $key, $group, $cache_cb, $cas_token );\n\telse\n\t\treturn $wp_object_cache->getByKey( $server_key, $key, $group );\n}",
"public function get($key)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$time = cms_db()->BindTimeStamp(time());\n\t\t\t$result = cms_db()->GetOne(\"select v FROM {cache} WHERE k = ? and expiry > ?\", array($key, $time));\n\t\t\tif ($result)\n\t\t\t\treturn unserialize($result);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t\n\t\t}\n\t\treturn null;\n\t}",
"public function get() {\n\n if(!$this->isAvailable() || $this->isIgnored()) return false;\n\n return $this->data = \\Kirby\\Toolkit\\Cache::get($this->id); \n \n }",
"function getCache($key)\n {\n try {\n $result = Redis::get($key);\n if (!empty($result)) return json_decode($result);\n return false;\n } catch (Throwable $e) {\n report($e); //Just logging , Not throw error\n }\n }",
"public function get_data_to_cache();",
"public function get($key) {\n try {\n $result = parent::check($key);\n }\n catch (\\Exception $e) {\n //Cache failure, will cause false to be returned\n }\n if ($result !== null && $result !== '') {\n return @unserialize($result);\n }\n return false;\n }",
"public function getMetadata(string $key, $subject = null);",
"function wp_cache_get_by_key($server_key, $key, $group = '', $force = \\false, &$found = \\null, $cache_cb = \\null, &$cas_token = \\null)\n {\n }",
"public function getResponseFromCache() {\n\t\t\t// Check for a valid cache component\n\t\t\tif ( ( $cacheComponent = $this->getCacheComponent() ) === null ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Get cache configuration\n\t\t\t$cacheConfig = $this->getCacheConfig();\n\n\t\t\t// Get key\n\t\t\t$key = ArrayHelper::getValue( $cacheConfig, \"key\", \"invalid\" );\n\n\t\t\t// Check if the current key exists in cache and attempt to retrieve it\n\t\t\tif ( $cacheComponent->exists( $key ) === false || ( $data = $cacheComponent->hget( $key, \"data\" ) ) === null ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Set found in cache status\n\t\t\t$this->setWasFoundInCache( true );\n\n\t\t\t// Return data\n\t\t\treturn $data;\n\t\t}",
"function oop_cache_get_data($cid) {\n return generic_cache_get_data(OOP_DB__CACHE, $cid);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes the given note from the regatta | public function deleteNote(Note $note) {
DB::remove($note);
} | [
"public static function delete_note() {\n\t\tNotes::delete_notes_with_name( self::NOTE_NAME );\n\t}",
"public static function delete_note( $note ) {\n\t\t$note->set_is_deleted( 1 );\n\t\t$note->save();\n\t}",
"public function delete( $note )\n\t{\n\t\t$entry = $this->get_entry( $note['postID'], $note['userID'] );\n\t\tif ( $entry ) {\n\t\t\t$where = array( 'id' => $entry->id );\n\t\t\t$where_format = array( '%d' );\n\n\t\t\t$this->_wpdb->delete( $ekNotesTable, $where, $where_format );\n\t\t}\n\t}",
"function deleteNote(NoteInterface $note);",
"public function delete(NoteEntity $note);",
"public function removeNote()\n {\n }",
"public function onNoteDelete()\n {\n $note = $this->getActiveNote();\n $note->delete();\n }",
"public function deleteNoteAction(Note $note){\n if (!$note) {\n throw $this->createNotFoundException('Error! no note found for id '.$id);\n }\n\t\t$em = $this->getDoctrine()->getEntityManager();\n $em->remove($note);\n $em->flush();\n // return new Response('Note deleted!');\n $this->addFlash('notice', 'Note has been deleted!');\n return $this->redirectToRoute('notes_homepage');\n\t}",
"public static function delete_order_note()\n {\n }",
"public static function delete_note() {\n $request_id = absint( $_REQUEST['request'] );\n $note = absint( $_REQUEST['note_id'] );\n\n wp_delete_comment( $note, true );\n\n ob_start();\n include WooCommerce_Warranty::$base_path .'templates/list-item-notes.php';\n $list = ob_get_clean();\n\n die( $list );\n }",
"public function remove_note_from_case()\n {\n $this->load->model('cases_model', 'cases');\n $note_id = $this->input->post('note_id');\n $this->cases->remove_note_from_case($note_id);\n }",
"public static function deleteNote(\\Evernote\\Model\\Note $note)\n {\n $client = Client::getCleint();\n\n $client->deleteNote($note);\n }",
"public function delete(){\n if (empty($this->pad)){\n msg('Your pad is empty.');\n closeNode();\n }else{\n msg('Please send the number of the note you want to delete from your pad :');\n bindNode('deleteNote');\n }\n\n\n }",
"public function testRemoveNote() \n\t{\t\n\t\t$response = $this->actingAs($this->user)->json('DELETE', 'api/deleteNote/' . $this->notes->first()->id, $this->notes->first()->toArray());\n\n\t\t$response\n\t\t\t->assertSuccessful();\n\t}",
"Function removeAdminNote($noteid)\n {\n $sql = \"DELETE FROM \".TABLE_USER_NOTES.\" WHERE ID = \".intval($noteid);\n if ($exe = runQuery($sql))\n {\n return 1;\n }\n else\n {\n return 0;\n }\n }",
"public function testDelete() {\n // Insert\n $ph_website_note = $this->phactory->create( 'website_notes' );\n\n // Delete it!\n $this->account_note->id = $ph_website_note->website_note_id;\n $this->account_note->remove();\n\n // Shouldn't exist\n $ph_website_note = $this->phactory->get( 'website_notes', array( 'website_note_id' => $ph_website_note->website_note_id ) );\n\n $this->assertNull( $ph_website_note );\n }",
"function devel_notes_delete_confirm(&$form_state, $note) {\n $form = array();\n $form['#note'] = $note;\n return confirm_form($form,\n t('Are you sure you want to delete the note %note?', array('%note' => $note->short)),\n isset($_GET['destination']) ? $_GET['destination'] : 'admin/devel_notes/note/' . $note->note_id,\n t('This action cannot be undone'),\n t('Delete'),\n t('Cancel')\n );\n}",
"public function delete_note($student_note_id) {\n\t\tmysqli_query($this->connection,\"\" );\n\n\n\t\tif (mysqli_affected_rows($this->connection) >= 1 ) {\n\t\t\t\n\t\t\techo \"yeah this workd\";\n\t\t\n\t\t} else {\n\t\t\n\t\t\techo \"nah this didn't work\";\n\t\t\n\t\t}\n\n\t\t\n\t}",
"public function delete_note_id(Request $request, $id_note){\n \t$note = ContactNote::find($id_note);\n\n if (sizeof($note) == 0){\n \treturn response('No contact note with that specific id found', 404);\n }\n\n $note->delete();\n\n return 204;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a or'ed regex list and quotes all disjunct members | private function _orRegexpList( $list ) {
return join( '|', array_map( 'quotemeta', $list ) );
} | [
"function orWith(array ...$expressions): array\n {\n return ['or', ...$expressions];\n }",
"protected function buildRegexPatterns()\n {\n $regex = [];\n $regex[self::ESCAPABLE] = self::REGEX_ESCAPABLE;\n $regex[self::ESCAPED_CHAR] = '\\\\\\\\' . $regex[self::ESCAPABLE];\n $regex[self::IN_DOUBLE_QUOTES] = '\"(' . $regex[self::ESCAPED_CHAR] . '|[^\"\\x00])*\"';\n $regex[self::IN_SINGLE_QUOTES] = '\\'(' . $regex[self::ESCAPED_CHAR] . '|[^\\'\\x00])*\\'';\n $regex[self::IN_PARENS] = '\\\\((' . $regex[self::ESCAPED_CHAR] . '|[^)\\x00])*\\\\)';\n $regex[self::REG_CHAR] = '[^\\\\\\\\()\\x00-\\x20]';\n $regex[self::IN_PARENS_NOSP] = '\\((' . $regex[self::REG_CHAR] . '|' . $regex[self::ESCAPED_CHAR] . '|\\\\\\\\)*\\)';\n $regex[self::TAGNAME] = '[A-Za-z][A-Za-z0-9-]*';\n $regex[self::BLOCKTAGNAME] = '(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|title|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)';\n $regex[self::ATTRIBUTENAME] = '[a-zA-Z_:][a-zA-Z0-9:._-]*';\n $regex[self::UNQUOTEDVALUE] = '[^\"\\'=<>`\\x00-\\x20]+';\n $regex[self::SINGLEQUOTEDVALUE] = '\\'[^\\']*\\'';\n $regex[self::DOUBLEQUOTEDVALUE] = '\"[^\"]*\"';\n $regex[self::ATTRIBUTEVALUE] = '(?:' . $regex[self::UNQUOTEDVALUE] . '|' . $regex[self::SINGLEQUOTEDVALUE] . '|' . $regex[self::DOUBLEQUOTEDVALUE] . ')';\n $regex[self::ATTRIBUTEVALUESPEC] = '(?:' . '\\s*=' . '\\s*' . $regex[self::ATTRIBUTEVALUE] . ')';\n $regex[self::ATTRIBUTE] = '(?:' . '\\s+' . $regex[self::ATTRIBUTENAME] . $regex[self::ATTRIBUTEVALUESPEC] . '?)';\n $regex[self::OPENTAG] = '<' . $regex[self::TAGNAME] . $regex[self::ATTRIBUTE] . '*' . '\\s*\\/?>';\n $regex[self::CLOSETAG] = '<\\/' . $regex[self::TAGNAME] . '\\s*[>]';\n $regex[self::OPENBLOCKTAG] = '<' . $regex[self::BLOCKTAGNAME] . $regex[self::ATTRIBUTE] . '*' . '\\s*\\/?>';\n $regex[self::CLOSEBLOCKTAG] = '<\\/' . $regex[self::BLOCKTAGNAME] . '\\s*[>]';\n $regex[self::HTMLCOMMENT] = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->';\n $regex[self::PROCESSINGINSTRUCTION] = '[<][?].*?[?][>]';\n $regex[self::DECLARATION] = '<![A-Z]+' . '\\s+[^>]*>';\n $regex[self::CDATA] = '<!\\[CDATA\\[[\\s\\S]*?]\\]>';\n $regex[self::HTMLTAG] = '(?:' . $regex[self::OPENTAG] . '|' . $regex[self::CLOSETAG] . '|' . $regex[self::HTMLCOMMENT] . '|' .\n $regex[self::PROCESSINGINSTRUCTION] . '|' . $regex[self::DECLARATION] . '|' . $regex[self::CDATA] . ')';\n $regex[self::HTMLBLOCKOPEN] = '<(?:' . $regex[self::BLOCKTAGNAME] . '(?:[\\s\\/>]|$)' . '|' .\n '\\/' . $regex[self::BLOCKTAGNAME] . '(?:[\\s>]|$)' . '|' . '[?!])';\n $regex[self::LINK_TITLE] = '^(?:\"(' . $regex[self::ESCAPED_CHAR] . '|[^\"\\x00])*\"' .\n '|' . '\\'(' . $regex[self::ESCAPED_CHAR] . '|[^\\'\\x00])*\\'' .\n '|' . '\\((' . $regex[self::ESCAPED_CHAR] . '|[^)\\x00])*\\))';\n\n $this->regex = $regex;\n }",
"protected static function logicalOR(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('OR', $values);\n\t}",
"function _OR_($args) {\n\t$q = false;\n\t$args = func_get_args(); \n\n\tif (is_array($args[0]) && sizeof($args)) {\n\t\t// trying to pass as array of args\n\t\t$args = $args[0];\n\t\tif (!sizeof($args))\n\t\t\tthrow new Exception(\"Cannot create _OR_ expression without arguments.\");\n\t}\n\n\tforeach($args as $arg)\n\t\tif (!$q)\n\t\t\t$q = new Q($arg);\n\t\telse\n\t\t\t$q = $q->add(new Q($arg), \"|\");\n\n\treturn $q;\n}",
"function parse_conditions_or($arr)\n{\n\tif(isset($var->or))\n\t{\n\t\treturn \"( \" . parse_conditions($var->or[0]) . \" OR \" . parse_conditions($var->or[1]) . \") \";\n\t}\n\telse\n\t\tdie(\"Invalid argument $arr in function: <b>parse_conditions_or</b>\");\n}",
"public function orNest()\n {\n return $this->nest('OR');\n }",
"public function orParenthesis();",
"function grammatical_list ($glue, $list, $conjunction = \"and\")\n{\n $output = $list;\n if (is_array($list)) {\n if (count($list) == 2) {\n $output = implode(\" $conjunction \", $list);\n } else {\n for ($i = 0; $i < count($list); $i ++) {\n $prefix = \"\";\n if ($i + 1 == count($list)) {\n $prefix = $conjunction;\n }\n $adjusted_list[] = $prefix . \" \" . $list[$i];\n }\n $output = implode($glue, $adjusted_list);\n }\n }\n return $output;\n}",
"public function addOr($expression);",
"public function createOr()\n {\n $o = new OrSelector();\n $this->appendSelector($o);\n\n return $o;\n }",
"public function metaQueryRelation_OR(){\n return $this->metaQueryRelation('OR');\n }",
"public function orConditionGroup();",
"public function opOR() {\n\t\treturn 'OR';\n\t}",
"public function orWhere();",
"public function _or() {\n \treturn $this->_binOp('or');\n }",
"public function buildRegExpForReferences()\n {\n $bookNames = []; \n $bookShortName = []; \n $bookAbbrevs = []; \n $bookAliases = []; \n\n foreach ($this->getLibraryBooks() as $library => $books) { \n\n foreach ($books as $b) { \n $bookNames[] = $this->getName($b); \n $bookShortNames[] = $this->getShortName($b); \n $bookAbbrevs[] = $this->getAbbreviation($b); \n foreach ($this->getAliases($b) as $alias) { \n $bookAliases[] = $alias; \n }\n }\n\n }\n\n // Combine with longest names first, add flexible spacing. \n\n $patterns = []; \n foreach ($bookNames as $name) { \n $patterns[] = str_replace(\n ' ', '\\s+', \n preg_quote(strtolower($name))\n ); \n }\n foreach ($bookShortNames as $shortName) { \n $patterns[] = str_replace(\n ' ', '\\s+', \n preg_quote(strtolower($shortName))\n ); \n }\n foreach ($bookAbbrevs as $abbrev) { \n $patterns[] = str_replace(\n ' ', '\\s+', \n preg_quote($abbrev)\n ); \n }\n foreach ($bookAliases as $aliases) { \n $patterns[] = str_replace(\n ' ', '\\s+', \n preg_quote($aliases)\n ); \n }\n\n $uniquePatterns = array_unique($patterns); \n $regexp = '/((' \n . join('|', $uniquePatterns) \n . ')[\\\\s\\\\.]+[\\\\d\\\\:\\\\;\\\\,\\\\.\\\\,\\\\-]*[\\\\d]+' \n . ')/im'; \n\n return $regexp; \n }",
"private function convertToOrJunction()\n {\n $index = count($this->clauses) - 1;\n $this->clauses[$index]['junction'] = 'or';\n }",
"public function or_not_group_start()\n\t{\n\t\treturn $this->group_start('NOT ', 'OR ');\n\t}",
"public function compileOr(string $query): string\n {\n return $query ? $this->wrap($query, '(|') : '';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that constraintDescription() returns a string when instantiated. | public function testConstraintDescriptionReturnsStringWhenInstantiated(): void
{
$declSpecSeqConst = $this->declSpecSeqConstFactory->createConstraintDescription(
"foo DeclarationSpecifierSequence\n bar DeclarationSpecifier"
);
$sut = new ParameterDeclarationConstraint($declSpecSeqConst);
self::assertSame(
"Parameter declaration\n".
" foo DeclarationSpecifierSequence\n".
" bar DeclarationSpecifier",
$sut->constraintDescription()
);
} | [
"public function testToString()\n {\n $class = 'Asdasd1Ay9182YE1';\n $constraint = $this->createConstraint($class);\n $this->assertContains($class, $constraint->toString(), 'The constraint string must feature the type name');\n }",
"public function testConstraintDescriptionReturnsString(): void\n {\n $consts = [];\n $consts[] = ConceptConstraintDoubleBuilder::createCVQualifierConstraint($this)\n ->buildConstraintDescription('foo')\n ->getDouble();\n $consts[] = ConceptConstraintDoubleBuilder::createCVQualifierConstraint($this)\n ->buildConstraintDescription('bar')\n ->getDouble();\n \n $sut = new CVQualifierSequenceConstraint($consts);\n self::assertSame(\n \"Constant/volatile qualifier sequence (2)\\n\".\n \" foo\\n\".\n \" bar\", \n $sut->constraintDescription()\n );\n }",
"public function testConstraintDescriptionReturnsStringWhenNoConstraint(): void\n {\n $sut = new NestedNameSpecifierConstraint();\n self::assertSame(\n 'Nested name specifier (0)', \n $sut->constraintDescription()\n );\n }",
"public function testConstraintDescriptionReturnsStringWhenInstantiated(): void\n {\n $sut = new PtrAbstractDeclaratorConstraint();\n self::assertSame('Pointer abstract declarator', $sut->constraintDescription());\n }",
"public function testConstraintDescriptionReturnsStringWhenCreateBool(): void\n {\n $sut = DeclarationSpecifierConstraint::createBool();\n self::assertSame(\n \"Declaration specifier\\n\".\n \" Simple type specifier \\\"bool\\\"\", \n $sut->constraintDescription()\n );\n }",
"public function testGetConceptNameReturnsString(): void\n {\n $sut = new IdentifierConstraint('foo');\n self::assertSame('Identifier', $sut->getConceptName());\n }",
"public function testToStringReturnsStringWhenCreateConst(): void\n {\n $sut = CVQualifierConstraint::createConst();\n self::assertSame('constant CV qualifier', $sut->toString());\n }",
"public function testGetConceptNameReturnsStringWhenInstantiated(): void\n {\n $prmDeclClauseConst = $this->prmDeclClauseConstFactory->createDummy();\n \n $sut = new ParametersAndQualifiersConstraint($prmDeclClauseConst);\n self::assertSame('Parameters and qualifiers', $sut->getConceptName());\n }",
"public function testConstraintDescriptionReturnsStringWhenCreateIdentifier(): void\n {\n $idConst = ConceptConstraintDoubleBuilder::createIdentifierConstraint($this)\n ->buildConstraintDescription(\n \"foo Identifier\\n\".\n \" bar string\"\n )\n ->getDouble();\n \n $sut = UnqualifiedIdConstraint::createIdentifier($idConst);\n self::assertSame(\n \"Unqualified identifier\\n\".\n \" foo Identifier\\n\".\n \" bar string\", \n $sut->constraintDescription()\n );\n }",
"public function testConstraintDescriptionReturnsStringWhenInstantiatedAndAbstractDeclaratorConstraintSet(): void\n {\n $declSpecSeqConst = $this->declSpecSeqConstFactory->createConstraintDescription(\n \"foo DeclarationSpecifierSequence\\n\".\n \" bar DeclarationSpecifier\"\n );\n $abstDcltorConst = ConceptConstraintDoubleBuilder::createAbstractDeclaratorConstraint($this)\n ->buildConstraintDescription('abstract declarator description')\n ->getDouble();\n \n $sut = new ParameterDeclarationConstraint($declSpecSeqConst);\n $sut->setAbstractDeclaratorConstraint($abstDcltorConst);\n self::assertSame(\n \"Parameter declaration\\n\".\n \" foo DeclarationSpecifierSequence\\n\".\n \" bar DeclarationSpecifier\\n\".\n \" abstract declarator description\", \n $sut->constraintDescription()\n );\n }",
"public function testGetNameReturnsString(): void\n {\n $constraintFactory = $this->prophesize(ConceptConstraintFactoryInterface::class)->reveal();\n \n $sut = new ValidData('foo', $constraintFactory, 'foo');\n self::assertSame('', $sut->getName());\n \n $sut->setName('bar');\n self::assertSame('bar', $sut->getName());\n \n $sut->setName('baz');\n self::assertSame('baz', $sut->getName());\n \n $sut->setName('');\n self::assertSame('', $sut->getName());\n }",
"public function __toString() {\n return $this->constraint;\n }",
"public function testGetConceptNameReturnsStringWhenCreateConst(): void\n {\n $sut = CVQualifierConstraint::createConst();\n self::assertSame('Constant CV qualifier', $sut->getConceptName());\n }",
"public function testConstraintDescriptionReturnsStringWhenCreateWCharT(): void\n {\n $sut = DeclarationSpecifierConstraint::createWCharT();\n self::assertSame(\n \"Declaration specifier\\n\".\n \" Simple type specifier \\\"wchar_t\\\"\", \n $sut->constraintDescription()\n );\n }",
"public function testGetConceptNameReturnsString(): void\n {\n $consts = [];\n $consts[] = ConceptConstraintDoubleBuilder::createCVQualifierConstraint($this)\n ->getDouble();\n \n $sut = new CVQualifierSequenceConstraint($consts);\n self::assertSame('Constant/volatile qualifier sequence', $sut->getConceptName());\n }",
"public function testConstraintDescriptionReturnsStringWhenCreateDIdPQual(): void\n {\n $didConst = ConceptConstraintDoubleBuilder::createDeclaratorIdConstraint($this)\n ->buildToString('foo declarator identifier')\n ->buildConstraintDescription(\n \"foo DeclaratorId\\n\".\n \" foo IdExpression\"\n )\n ->getDouble();\n $prmQualConst = ConceptConstraintDoubleBuilder::createParametersAndQualifiersConstraint($this)\n ->buildToString('bar parameters and qualifiers')\n ->buildConstraintDescription(\n \"bar ParameterDeclarationClause\\n\".\n \" bar ParameterDeclarationList\"\n )\n ->getDouble();\n \n $sut = NoptrDeclaratorConstraint::createDeclaratorIdParametersAndQualifiers(\n $didConst, \n $prmQualConst\n );\n self::assertSame(\n \"No-pointer declarator with foo declarator identifier and \".\n \"bar parameters and qualifiers\\n\".\n \" foo DeclaratorId\\n\".\n \" foo IdExpression\\n\".\n \" bar ParameterDeclarationClause\\n\".\n \" bar ParameterDeclarationList\", \n $sut->constraintDescription()\n );\n }",
"public function testConstraintDescriptionReturnsStringWhenInstantiatedAndPtrOperatorSequenceConstraintIsSet(): void\n {\n $ptrOpSeqConst = ConceptConstraintDoubleBuilder::createPtrOperatorSequenceConstraint($this)\n ->buildConstraintDescription('pointer operator sequence constraint description')\n ->getDouble();\n \n $sut = new PtrAbstractDeclaratorConstraint();\n $sut->setPtrOperatorSequenceConstraint($ptrOpSeqConst);\n self::assertSame(\n \"Pointer abstract declarator\\n\".\n \" pointer operator sequence constraint description\", \n $sut->constraintDescription()\n );\n }",
"public function testFailureDescriptionWhenInstantiatedAndInvalid(): void\n {\n $this->expectException(ExpectationFailedException::class);\n $this->expectExceptionMessageMatches('` is a parameter declaration`');\n \n $declSpecSeqConst = $this->declSpecSeqConstFactory->createConstraintDescription(\n 'foo description'\n );\n \n $sut = new ParameterDeclarationConstraint($declSpecSeqConst);\n $sut->evaluate(NULL, '', FALSE);\n }",
"public function testToStringReturnsStringWhenInstantiatedAndAbstractDeclaratorConstraintSet(): void\n {\n $declSpecSeqConst = $this->declSpecSeqConstFactory->createDummy();\n $abstDcltorConst = ConceptConstraintDoubleBuilder::createAbstractDeclaratorConstraint($this)\n ->getDouble();\n \n $sut = new ParameterDeclarationConstraint($declSpecSeqConst);\n $sut->setAbstractDeclaratorConstraint($abstDcltorConst);\n self::assertSame('parameter declaration', $sut->toString());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get purchase limit collection of all rules in a single query | public function getPurchaseLimits(array $rules, Cart $cart): Collection
{
$query = PurchaseLimit::withoutTrashed()
->where(function (Builder $query) use ($cart, $rules) {
foreach ($rules as $rule) {
$query->orWhere(function (Builder $q) use ($cart, $rule) {
$rule->query($q, $cart);
});
}
});
return $query->get();
} | [
"public function getProductSetLimit();",
"public function getLimitOptions();",
"public function filter(Collection $purchaseLimits, CartLine $cartLine): Collection;",
"function getMaxResultsPerCollection();",
"public function getLimit(): TrancheLimit;",
"public function getPurchaseCapLimit();",
"public function getProductLimit();",
"public function getLimitFields(): array;",
"public function supplierProductsWithCriteriaItems(): Collection;",
"public function getRuleCollection()\n {\n /* @var $collection Sminmlc_TargetRule_Model_Mysql4_Rule_Collection */\n $collection = Mage::getResourceModel('sminmlc_targetrule/rule_collection');\n $collection->addApplyToFilter($this->getType())\n ->addProductFilter($this->getProduct()->getId())\n ->addIsActiveFilter()\n ->setPriorityOrder()\n ->setFlag('do_not_run_after_load', true);\n\n return $collection;\n }",
"function getCollectionPart($options=array()) {\n global $DB;\n\n $p['start'] = 0;\n $p['limit'] = 0;\n $p['recursive'] = true;\n $p['childrens'] = false;\n\n foreach ($options as $key => $value) {\n $p[$key] = $value;\n }\n\n $this->RuleList = new SingletonRuleList($this->getRuleClassName(), $this->entity);\n $this->RuleList->list = array();\n\n //Select all the rules of a different type\n $sql = $this->getRuleListQuery($p);\n $result = $DB->query($sql);\n\n if ($result) {\n while ($data=$DB->fetch_assoc($result)) {\n //For each rule, get a Rule object with all the criterias and actions\n $tempRule = $this->getRuleClass();\n $tempRule->fields = $data;\n $this->RuleList->list[] = $tempRule;\n }\n }\n }",
"public function execute(Collection $purchaseLimits, Cart $cart): void;",
"public function getItemsCriteria() {}",
"public function getActiveCampaignAll(){\n $collection = $this->getCollection();\n $store = Mage::app()->getStore();\n $current_date = Mage::getModel('core/date')->gmtDate();\n $collection->addFieldToFilter(array('store','store'), array(array('finset'=>$store->getId()),array('finset'=>0)))\n ->addFieldToFilter('status', '1')\n ->addFieldToFilter('end_time', array('from'=>$current_date))\n ->getSelect()\n ->order('priority DESC')\n ->order('end_time ASC')\n ;\n return $collection;\n }",
"public function limitProductReviews($collection)\n {\n $collection->setStoreFilter($this->_role->getStoreIds());\n }",
"public function getQueryRules();",
"public function supplierProductsWithCriteriaItems():Collection\n {\n return SupplierProduct::with(\"criteriaItems\")->get();\n }",
"function _get_limits($page, $size, $max){\n $data = array();\n \n# ------------------------ Get the desired page ------------------------ # \n \n if(is_numeric($page)){\n if($page > 0)\n $data[0] = floor($page);\n else if($page == 0){ // Select all products in db\n $data[0] = 0;\n $data[1] = $max;\n return $data;\n }\n else\n $data[0] = 1;\n }\n else\n $data[0] = 1;\n \n# ------------------------ Get number of desired products ------------------------ # \n \n if(is_numeric($size)){\n if($size > 0)\n $data[1] = floor($size);\n else\n $data[1] = 10; // Default page size is 10\n }\n else\n $data[1] = 10; // Default page size is 10\n \n# ------------------------ Get number of products in database ------------------------ # \n\n $max = _get_count(); \n\n# ------------------------ Get the first product in the list ------------------------ # \n \n $firstProd = ($data[0] * $data[1]) - $data[1];\n \n if($firstProd > $max){\n $data[0] = $max - $data[1];\n }\n else\n $data[0] = $firstProd;\n \n return $data;\n}",
"public function amountOverFive(): ResourceCollection\n {\n return ProductResource::collection($this->productsRepository->getProductsWithAmountOver(5));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Encode a string in modified UTF7 | function imap_utf7_encode($buf) {} | [
"function __stringToUtf7($string) {\n $return = '';\n $utf7 = array(\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',\n 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',\n 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g',\n 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',\n 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2',\n '3', '4', '5', '6', '7', '8', '9', '+', ','\n );\n\n $state = 0;\n if (!empty($string)) {\n $i = 0;\n while ($i <= strlen($string)) {\n $char = substr($string, $i, 1);\n if ($state == 0) {\n if ((ord($char) >= 0x7F) || (ord($char) <= 0x1F)) {\n if ($char) {\n $return .= '&';\n }\n $state = 1;\n } elseif ($char == '&') {\n $return .= '&-';\n } else {\n $return .= $char;\n }\n } elseif (($i == strlen($string) ||\n !((ord($char) >= 0x7F)) || (ord($char) <= 0x1F))) {\n if ($state != 1) {\n if (ord($char) > 64) {\n $return .= '';\n } else {\n $return .= $utf7[ord($char)];\n }\n }\n $return .= '-';\n $state = 0;\n } else {\n switch($state) {\n case 1:\n $return .= $utf7[ord($char) >> 2];\n $residue = (ord($char) & 0x03) << 4;\n $state = 2;\n break;\n case 2:\n $return .= $utf7[$residue | (ord($char) >> 4)];\n $residue = (ord($char) & 0x0F) << 2;\n $state = 3;\n break;\n case 3:\n $return .= $utf7[$residue | (ord($char) >> 6)];\n $return .= $utf7[ord($char) & 0x3F];\n $state = 1;\n break;\n }\n }\n $i++;\n }\n return $return;\n }\n return '';\n }",
"function utf8_encode ($data) {}",
"function encodeUTF8($str)\n{\n\t$str = preg_replace(\"/[\\u0080-\\u07ff]/g\", chr(0xc0 | ord($str[0]) >> 6 . 0x80 | ord($str[0]) & 0x3f), $str);\n\t$str = preg_replace(\"/[\\u0800-\\uffff]/g\", chr(0xe0 | ord($str[0]) >> 12 . 0x80 | ord($str[0]) >> 6 & 0x3F . 0x80 | ord($str[0]) & 0x3f), $str);\n\n\treturn $str;\n}",
"static public function Utf7_to_utf8($string) {\n if (function_exists(\"iconv\")){\n return @iconv(\"UTF-7\", \"UTF-8\", $string);\n }\n else\n ZLog::Write(LOGLEVEL_WARN, \"Utils::Utf7_to_utf8() 'iconv' is not available. Charset conversion skipped.\");\n\n return $string;\n }",
"static public function Utf8_to_utf7($string) {\n if (function_exists(\"iconv\")){\n return @iconv(\"UTF-8\", \"UTF-7\", $string);\n }\n else\n ZLog::Write(LOGLEVEL_WARN, \"Utils::Utf8_to_utf7() 'iconv' is not available. Charset conversion skipped.\");\n\n return $string;\n }",
"public static function utf8_encode($str)\n {\n $str = utf8_encode($str);\n\n if (false === strpos($str, \"\\xC2\")) {\n return $str;\n } else {\n\n static $cp1252ToUtf8Keys = null;\n static $cp1252ToUtf8Values = null;\n\n if ($cp1252ToUtf8Keys === null) {\n $cp1252ToUtf8Keys = array_keys(self::$cp1252ToUtf8);\n $cp1252ToUtf8Values = array_values(self::$cp1252ToUtf8);\n }\n\n return str_replace($cp1252ToUtf8Keys, $cp1252ToUtf8Values, $str);\n }\n }",
"function to7bit($text)\n\t{\n\t\tglobal $CFG;\n\n\t\t$text = mb_convert_encoding($text,'HTML-ENTITIES',$CFG['site']['charset']);\n\t\t$text = preg_replace( array('/ß/','/&(..)lig;/', '/&([aouAOU])uml;/','/&(.)[^;]*;/'), array('ss',\"$1\",\"$1\".'e',\"$1\"), $text);\n\t\treturn $text;\n\t}",
"public function encode($string) {\n return utf8_encode($string);\n }",
"function encodeToUTF8($string) {\n return mb_convert_encoding($string, \"UTF-8\");\n}",
"public static function utf8encode($string) {\r\n\t\tif (mb_check_encoding($string, 'UTF-8')) {\r\n\t\t\treturn $string;\r\n\t\t}\r\n\r\n\t\treturn utf8_encode($string);\r\n\t}",
"function encoding( $str )\n{\n\t$search = array( '?', '=', '&' );\n\t$replace = array( '%3F', '%3D', '%26' );\n\n\t$str = str_replace( $search,$replace, $str );\n\t$str = urlencode( $str );\n\treturn $str;\n}",
"function charset_encode_tis_620 ($string) {\n // don't run encoding function, if there is no encoded characters\n if (! preg_match(\"'&#[0-9]+;'\",$string) ) return $string;\n\n $string=preg_replace(\"/&#([0-9]+);/e\",\"unicodetotis620('\\\\1')\",$string);\n // $string=preg_replace(\"/&#[xX]([0-9A-F]+);/e\",\"unicodetotis620(hexdec('\\\\1'))\",$string);\n\n return $string;\n}",
"function selective_encode_utf8($string) {\n if(!is_utf8($string)) {\n return utf8_encode($string);\n }\n return $string;\n }",
"function _utf8_encode($in_str)\r\n {\r\n $out_str = $in_str;\r\n if (strtolower($this->CharSet) == 'utf-8' && preg_match('/[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f-\\xff]/',\r\n $in_str)) {\r\n if ($out_str) {\r\n // define start delimimter, end delimiter and spacer\r\n $end = \"?=\";\r\n $start = \"=?\" . $this->CharSet . \"?B?\";\r\n $spacer = $end . $this->_newline . ' ' . $start;\r\n\r\n // determine length of encoded text within chunks\r\n // and ensure length is even\r\n $length = 512 - strlen($start) - strlen($end);\r\n $length = floor($length / 4) * 4;\r\n\r\n // encode the string and split it into chunks\r\n // with spacers after each chunk\r\n $out_str = base64_encode($out_str);\r\n $out_str = chunk_split($out_str, $length, $spacer);\r\n\r\n // remove trailing spacer and\r\n // add start and end delimiters\r\n $spacer = preg_quote($spacer);\r\n $out_str = preg_replace(\"/\" . $spacer . \"$/\", \"\", $out_str);\r\n $out_str = $start . $out_str . $end;\r\n }\r\n }\r\n return $out_str;\r\n }",
"Function utf8RawUrlEncode($str) {\r\n $len = strlen($str);\r\n $res = \"\";\r\n $i = 0;\r\n $mb = function_exists(\"mb_substr\");\r\n while ($i < $len) {\r\n if ($mb) $chk = mb_substr($str, $i, 3);\r\n else $chk = substr($str, $i, 3);\r\n if(preg_match(\"/%[0-9a-f]/i\", $chk)) {\r\n $res .= $chk;\r\n $i += 3;\r\n }\r\n else {\r\n if ($mb) $charAt = mb_substr($str, $i, 1);\r\n else $charAt = substr($str, $i, 1);\r\n $charOrd = ord($charAt);\r\n if (($charOrd >= 65 && $charOrd <= 90)\r\n || ($charOrd >= 97 && $charOrd <= 122)\r\n || ($charOrd >= 48 && $charOrd <= 57)\r\n || ($charOrd == 33)\r\n || ($charOrd == 36)\r\n || ($charOrd == 95)) {\r\n // this is alphanumeric or $-_.+!*'(), which according\r\n // to RFC1738 we don't escape\r\n $res .= $charAt;\r\n }\r\n else {\r\n if (ord($charAt) >= 0x80 && is_utf8($charAt)) {\r\n $charOrd = utf8ord($charAt);\r\n $hexValStr = \"%u\" . sprintf(\"%04x\", $charOrd);\r\n $res .= $hexValStr;\r\n }\r\n elseif ($charOrd > 0) {\r\n $res .= \"%\";\r\n $hexValStr = sprintf(\"%02x\", $charOrd);\r\n $res .= $hexValStr;\r\n }\r\n }\r\n $i += 1;\r\n }\r\n } // while\r\n return $res;\r\n}",
"function charset_encode_cp1255 ($string) {\n // don't run encoding function, if there is no encoded characters\n if (! preg_match(\"'&#[0-9]+;'\",$string) ) return $string;\n\n $string=preg_replace(\"/&#([0-9]+);/e\",\"unicodetocp1255('\\\\1')\",$string);\n // $string=preg_replace(\"/&#[xX]([0-9A-F]+);/e\",\"unicodetocp1255(hexdec('\\\\1'))\",$string);\n\n return $string;\n}",
"public function convert_to_utf8($text) {\n\t $map = array(\n\t chr(0x8A) => chr(0xA9),\n\t chr(0x8C) => chr(0xA6),\n\t chr(0x8D) => chr(0xAB),\n\t chr(0x8E) => chr(0xAE),\n\t chr(0x8F) => chr(0xAC),\n\t chr(0x9C) => chr(0xB6),\n\t chr(0x9D) => chr(0xBB),\n\t chr(0xA1) => chr(0xB7),\n\t chr(0xA5) => chr(0xA1),\n\t chr(0xBC) => chr(0xA5),\n\t chr(0x9F) => chr(0xBC),\n\t chr(0xB9) => chr(0xB1),\n\t chr(0x9A) => chr(0xB9),\n\t chr(0xBE) => chr(0xB5),\n\t chr(0x9E) => chr(0xBE),\n\t chr(0x80) => '€',\n\t chr(0x82) => '‚',\n\t chr(0x84) => '„',\n\t chr(0x85) => '…',\n\t chr(0x86) => '†',\n\t chr(0x87) => '‡',\n\t chr(0x89) => '‰',\n\t chr(0x8B) => '‹',\n\t chr(0x91) => '‘',\n\t chr(0x92) => '’',\n\t chr(0x93) => '“',\n\t chr(0x94) => '”',\n\t chr(0x95) => '•',\n\t chr(0x96) => '–',\n\t chr(0x97) => '—',\n\t chr(0x99) => '™',\n\t chr(0x9B) => '’',\n\t chr(0xA6) => '¦',\n\t chr(0xA9) => '©',\n\t chr(0xAB) => '«',\n\t chr(0xAE) => '®',\n\t chr(0xB1) => '±',\n\t chr(0xB5) => 'µ',\n\t chr(0xB6) => '¶',\n\t chr(0xB7) => '·',\n\t chr(0xBB) => '»',\n\t );\n\t return html_entity_decode(mb_convert_encoding(strtr($text, $map), 'UTF-8', 'ISO-8859-1'), ENT_QUOTES, 'UTF-8');\n\t}",
"function utf_encode($s){\n\t\t if(function_exists('iconv')){\n\t\t\t\treturn iconv(\"CP1251\",\"UTF-8\",$s);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $this->CP1251toUTF8($s);\n\t\t\t}\n\t\t}",
"function encodeString( $theString )\n\t{\n\t\t//\n\t\t// Detect encoding.\n\t\t//\n\t\tif( mb_detect_encoding( $theString ) != 'UTF-8' )\n\t\t\t$theString = mb_convert_encoding( $theString, 'UTF-8' );\n\t\t\n\t\treturn '0x'.bin2hex( $theString );\t\t\t\t\t\t\t\t\t\t\t// ==>\n\t\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function returns records of certificat from table referentiel_certificat order by lastname, firstname of userid | function referentiel_get_certificats_id_users($refrefid){
global $DB;
if (!empty($refrefid)){
$sql = "SELECT c.userid, u.lastname, u.firstname
FROM {referentiel_certificat} as c, {user} as u
WHERE c.ref_referentiel=:refid
AND c.userid = u.id ORDER BY u.lastname, u.firstname ";
return $DB->get_records_sql($sql, array("refid" => "$refrefid"));
}
return NULL;
} | [
"function referentiel_get_certificats($referentiel_referentiel_id, $select=\"\", $order=\"\"){\r\nglobal $DB;\r\n\tif (!empty($referentiel_referentiel_id)){\r\n\t\tif (empty($order)){\r\n\t\t\t$order= 'userid ASC ';\r\n\t\t}\r\n\t\t$params= array(\"refid\" => \"$referentiel_referentiel_id\");\r\n $sql=\"SELECT * FROM {referentiel_certificat} WHERE ref_referentiel=:refid $select ORDER BY $order \";\r\n return $DB->get_records_sql($sql, $params);\r\n\t}\r\n\telse\r\n\t\treturn 0;\r\n}",
"function referentiel_liste_certificats($id_referentiel){\r\n\tif (isset($id_referentiel) && ($id_referentiel>0)){\r\n\t\t$records_certificat = referentiel_get_certificats($id_referentiel);\r\n\t\tif (!$records_certificat){\r\n\t\t\tprint_error(get_string('nocertificat','referentiel'), \"certificat.php?d=$id_referentiel&mode=add\");\r\n\t\t}\r\n\t else {\r\n\t\t\t\r\n?>\r\n<h3><?php print_string('certificat','referentiel') ?></h3>\r\n<table class=\"certificat\" cellpadding=\"5\">\r\n<?php\r\n \t\t// afficher\r\n\t\t\tforeach ($records_certificat as $record_a){\r\n \t\t$certificat_id=$record_a->id;\r\n\t\t\t\t$commentaire_certificat = stripslashes($record_a->commentaire_certificat);\r\n\t\t\t\t$competences_certificat = $record_a->competences_certificat;\r\n\t\t\t\t$decision_jury = stripslashes($record_a->decision_jury);\r\n\t\t\t\t$ref_referentiel = $record_a->ref_referentiel;\r\n\t\t\t\t$userid = $record_a->userid;\r\n\t\t\t\t$teacherid = $record_a->teacherid;\r\n\t\t\t\t$date_decision = $record_a->date_decision;\r\n?>\r\n<tr valign=\"top\" class=\"certificat\" > \r\n <td class=\"certificat\" align=\"right\" width=\"20%\">\r\n\t<b><?php print_string('id','referentiel'); ?> : </b>\r\n </td>\r\n <td class=\"certificat\" align=\"left\">\r\n\t<?php p($certificat_id) ?>\r\n </td>\r\n <td class=\"certificat\" align=\"right\" width=\"20%\">\r\n <b><?php print_string('etudiant','referentiel')?> : </b>\r\n </td>\r\n <td class=\"certificat\" align=\"left\">\r\n\t\t<?php p($userid) ?>\r\n </td>\r\n</tr>\r\n\r\n<tr valign=\"top\" class=\"certificat\" > \r\n <td class=\"certificat\" align=\"right\" width=\"20%\">\r\n\t<b><?php print_string('decision_jury','referentiel') ?>:</b>\r\n\t</td>\r\n <td class=\"certificat\" align=\"left\">\r\n <?php echo (nl2br($decision_jury)); ?>\r\n </td>\r\n\t<td class=\"certificat\" align=\"right\" width=\"20%\">\r\n\t<b><?php print_string('date_decision','referentiel') ?> : </b>\r\n\t</td>\t\r\n <td class=\"certificat\" align=\"left\">\r\n\t\t<?php p($date_decision) ?>\r\n </td>\t\t\r\n</tr>\r\n<tr valign=\"top\" class=\"certificat\" > \r\n <td class=\"certificat\" align=\"right\" width=\"20%\">\r\n\t<b><?php print_string('commentaire','referentiel') ?>:</b>\r\n\t</td>\r\n <td class=\"certificat\" align=\"left\" colspan=\"3\">\r\n <?php echo (nl2br($commentaire_certificat)); ?>\r\n </td>\r\n</tr>\r\n<tr valign=\"top\" class=\"certificat\" > \r\n <td class=\"certificat\" align=\"right\" width=\"20%\">\r\n\t<b><?php print_string('liste_codes_competence','referentiel') ?> : </b>\r\n\t</td>\r\n <td class=\"certificat\" align=\"left\" colspan=\"3\">\r\n\t\t<?php p(referentiel_affiche_liste_codes_competence('/',$competences_certificat)); ?>\r\n </td>\r\n</tr>\r\n<tr valign=\"top\" class=\"certificat\" > \r\n <td class=\"certificat\" align=\"right\" width=\"20%\">\r\n <b><?php print_string('referent','referentiel') ?> : </b>\r\n </td>\r\n\t<td class=\"certificat\" align=\"left\" colspan=\"3\">\r\n\t<?php p($teacherid); ?>\r\n </td>\r\n</tr>\t\r\n<?php\r\n\t\t\t}\r\n\t\t}\r\n?>\t\t\t\t\t\r\n</table>\t\t\t\t\r\n<?php\r\n\t}\r\n}",
"function referentiel_get_liste_certificats($referentiel_instance, $course, $context,\r\n $list_userids='', $userid_filtre=0, $gusers, $select_acc=0, $select_all=0,\r\n $force_generation=0) {\r\nglobal $debug_special;\r\nglobal $USER;\r\nstatic $referentiel_id = NULL;\r\n\r\n $records=array();\r\n\r\n if ($referentiel_instance){\r\n\r\n $roles=referentiel_roles_in_instance($referentiel_instance->id);\r\n $iseditor=$roles->is_editor;\r\n $isadmin=$roles->is_admin;\r\n $isteacher=$roles->is_teacher;\r\n $istutor=$roles->is_tutor;\r\n $isstudent=$roles->is_student;\r\n\r\n // recuperer les certificats\r\n if (!empty($list_userids)){ // liste d'utilisateurs obtenus par les pedagogies\r\n if (!empty($force_generation)){\r\n // echo \"<br />DEBUG :: lib_certificat.php :: 226 <br />$list_userids\\n\";\r\n referentiel_force_certificats_from_userslist($list_userids, $referentiel_instance->ref_referentiel);\r\n }\r\n // resultat trié dans l'ordre alphabetique des utilisateurs\r\n $records=referentiel_get_certificats_from_userslist($list_userids, $referentiel_instance->ref_referentiel);\r\n }\r\n else if ($isadmin && $select_all){ //\r\n //tous les certificats\r\n // $record_id_users = referentiel_get_all_users_with_certificate($referentiel_instance->ref_referentiel);\r\n $records = referentiel_get_certificats_users($referentiel_instance->ref_referentiel);\r\n }\r\n else { // recuperer les utilisateurs filtres\r\n if (!empty($userid_filtre)){ // un seul certificat\r\n $record_id_users = referentiel_get_students_course($course->id, $userid_filtre, 0);\r\n }\r\n else { // teachers :: les certificats du cours seulement\r\n if (!empty($select_acc)){\r\n // eleves accompagnes\r\n $record_id_users = referentiel_get_accompagnements_teacher($referentiel_instance->id, $course->id, $USER->id);\r\n }\r\n else{\r\n $record_id_users = referentiel_get_students_course($course->id, $userid_filtre, 0);\r\n }\r\n\r\n // groupes ?\r\n if ($gusers && $record_id_users){\r\n $record_users = array_intersect($gusers, array_keys($record_id_users));\r\n // recopier\r\n $record_id_users=array();\r\n foreach ($record_users as $record_id){\r\n $a_obj=new stdClass();\r\n $a_obj->userid=$record_id;\r\n $record_id_users[]=$a_obj;\r\n }\r\n }\r\n }\r\n if ($record_id_users){\r\n foreach ($record_id_users as $record_id) { // afficher la liste d'users\r\n $records[]=referentiel_certificat_user($record_id->userid, $referentiel_instance->ref_referentiel);\r\n }\r\n }\r\n }\r\n\r\n } // if referentiel\r\n return $records;\r\n\r\n}",
"public function get_all_certificate_by_id(){\n\t\t$customer = $this->db->query(\"SELECT * FROM `user_custtomers` where user_id = '\".$this->session->userdata('user_id').\"'\");\n\t\t$cus_id = $customer->row();\n\t\tif(isset($cus_id->customer_id)){\n\t $cus_id->customer_id;\n\t\t$query = $this->db->query(\"SELECT * FROM `certificate`\n\t\t\t\t\t\t\t\t\tINNER JOIN `products` ON (`certificate`.`products_id` = `products`.`products_id`) \n\t\t\t\t\t\t\t\t\tWHERE `certificate`.`delete_bit`=0 AND `products`.`delete_bit`=0 AND `certificate`.customer_id='\".$cus_id->customer_id.\"' \");\n\t\t\t\t\t\t\t\t//echo\t$this->db->last_query();\n\t\t return $query->result_array();}\n\t}",
"function getUserCertif(){\n\t\t$id = addslashes($_COOKIE['uid']);\n\n\t\t$qry = \"select cert.id, admin, dtcr, dtexp, hash, len, ops, subj, cert.dtc, ca, pkey from user,cert where user.id = uid\";\n\n\t\tif($re = $this->db->query($qry)){\n\t\t\t$i = 0;\n\t\t\t$r = array();\n\t\t\twhile ($result = $re->fetch_array()) { \n\t\t\t\t$r[$i] = $result;\n\t\t\t\t$i += 1;\n\t\t\t}\n\t\t\treturn $r;\n\t\t}\n\t\treturn null;\n\n\t}",
"public static function get_user_certification_details($certifid, $userid){\n global $DB;\n $query = \"SELECT\n comp.timecompleted,\n comp.timeexpires,\n comp.duedate,\n cua.duedate as assignmentduedate,\n cca.timeexpires as lasttimeexpires,\n cca.timewindowsopens as lasttimewindowsopens\n FROM {certif_user_assignments} cua \n LEFT JOIN {certif_completions} comp ON comp.certifid = cua.certifid AND comp.userid = cua.userid\n LEFT JOIN (\n SELECT\n cca.userid,\n cca.certifid,\n MAX(cca.timewindowsopens) as timewindowsopens,\n MAX(cca.timecompleted) as timecompleted,\n MAX(cca.timeexpires) as timeexpires\n FROM {certif_completions_archive} cca\n GROUP by cca.userid, cca.certifid\n ) as cca ON cca.userid = cua.userid AND cca.certifid = cua.certifid\n WHERE cua.certifid = :certifid\n AND cua.userid = :userid\n \";\n\n $params = [];\n $params['userid'] = $userid;\n $params['certifid'] = $certifid;\n\n $details = $DB->get_record_sql($query, $params);\n\n $details->windowopen = 0;\n $details->overdue = 0;\n if($details->duedate > 0 && $details->duedate < time()){\n $details->overdue = 1;\n }\n if($details->lasttimewindowsopens > 0 && $details->lasttimewindowsopens < time()){\n $details->windowopened = 1;\n }\n return $details;\n }",
"public function lstCustomerCertificates(){\n\t\t$Sql = \"SELECT \n\t\t\t\t\ta.customer_certificate_id,\n\t\t\t\t\ta.customer_id,\n\t\t\t\t\ta.customer_work_id,\n\t\t\t\t\ta.customer_type_id,\n\t\t\t\t\t(select certificate_name from rs_tbl_certificates WHERE certificate_id=a.certificate_id) as certificate_name,\n\t\t\t\t\ta.certificate_id\n\t\t\t\tFROM\n\t\t\t\t\trs_tbl_customer_certificates as a\n\t\t\t\tWHERE \n\t\t\t\t\t1=1\";\n\t\t\n\t\tif($this->isPropertySet(\"customer_certificate_id\", \"V\"))\n\t\t\t$Sql .= \" AND customer_certificate_id=\" . $this->getProperty(\"customer_certificate_id\");\n\t\t\t\n\t\tif($this->isPropertySet(\"customer_id\", \"V\"))\n\t\t\t$Sql .= \" AND customer_id=\" . $this->getProperty(\"customer_id\");\n\t\t\n\t\tif($this->isPropertySet(\"customer_work_id\", \"V\"))\n\t\t\t$Sql .= \" AND customer_work_id=\" . $this->getProperty(\"customer_work_id\");\n\t\t\t\n\t\tif($this->isPropertySet(\"customer_work_id\", \"V\"))\n\t\t\t$Sql .= \" AND customer_work_id=\" . $this->getProperty(\"customer_work_id\");\n\t\t\n\t\tif($this->isPropertySet(\"certificate_id_array\", \"V\")){\n\t\t\t$Sql .= \" AND certificate_id IN (\" . $this->getProperty(\"certificate_id_array\") . \")\";\n\t\t}\n\t\n\t\tif($this->isPropertySet(\"certificate_id\", \"V\"))\n\t\t\t$Sql .= \" AND certificate_id=\" . $this->getProperty(\"certificate_id\");\n\t\t\n\t\tif($this->isPropertySet(\"GROUPBY\", \"V\")){\n\t\t\t$Sql .= \" GROUP BY \" . $this->getProperty(\"GROUPBY\");\n\t\t}\n\t\t\n\t\tif($this->isPropertySet(\"ORDERBY\", \"V\")){\n\t\t\t$Sql .= \" ORDER BY \" . $this->getProperty(\"ORDERBY\");\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tif($this->isPropertySet(\"limit\", \"V\"))\n\t\t\t$Sql .= $this->appendLimit($this->getProperty(\"limit\"));\n\t\t$this->dbQuery($Sql);\n\t}",
"public static function get_issued_certificates($userid) {\n global $DB, $USER;\n\n // Somente administradores podem ver os certificados dos outros usuarios.\n if ($USER->id != $userid && !is_siteadmin()) {\n return [];\n }\n\n $sql = 'SELECT sci.*, sc.name, c.id as courseid, c.fullname, c.shortname\n FROM {simplecertificate_issues} sci\n INNER JOIN {simplecertificate} sc ON sc.id = sci.certificateid\n INNER JOIN {course} c ON sc.course = c.id\n WHERE sci.timedeleted IS NULL AND sci.userid = :userid\n ORDER BY c.fullname, sci.timecreated';\n\n $params = ['userid' => $userid];\n\n $certificates = $DB->get_records_sql($sql, $params);\n\n if (empty($certificates)) {\n return [];\n }\n\n $fs = get_file_storage();\n\n $returndata = [];\n foreach ($certificates as $certificate) {\n if (!$fs->file_exists_by_hash($certificate->pathnamehash)) {\n continue;\n }\n\n $returndata[] = $certificate;\n }\n\n return $returndata;\n }",
"function makeCertBlock($affil_id){\n\n\n\n $cert_print_block = \"\";\n\n\n\n $affiliates_certifications_rel = \"affiliates_certifications_rel\";//relationship table\n\n $hyp_certifications =\"hyp_certifications\";//certifications descriptions table\n\n\n\n // Lookup related certification numbers array through affil_cert_rel by id#\n\n $cert_id_lookup = \"SELECT list_id FROM $affiliates_certifications_rel WHERE affil_id=$affil_id\";\n\n $cert_id_result=mysql_query($cert_id_lookup);// or die(mysql_error())\n\n\n\n //Get certifications id#'s array from array reciept...\n\n while ($row = mysql_fetch_array($cert_id_result)){\n\n $list_id=$row['list_id'];\n\n\n\n // Lookup description for each cert_id#\n\n $desc_lookup=\"SELECT * FROM $hyp_certifications WHERE id=$list_id\";\n\n $cert_desc_result=mysql_query($desc_lookup);// or die(mysql_error())\n\n while ($inner_loop = mysql_fetch_array($cert_desc_result)){\n\n $cert_desc = $inner_loop['desc'];\n\n $cert_print_block .= \" \".$cert_desc;\n\n\n\n }//end desc - fetching loop\n\n }//end id# - fetching loop\n\n\n\n return $cert_print_block;\n\n\n\n}",
"public function getClinicUsers(){\n\t\t$user_ids = array();\n\t\t$licence_data = $this->reg->get('sess')->get('licence');\n\t\t$idLicence = $licence_data['idLicence'];\n\t\t$clinic_data = $this->reg->get('sess')->get('clinic');\n\t\t$idClinic = $clinic_data['idClinic'];\n\t\t//\n\t\t$query = 'SELECT user.idUser FROM user, licence_admin WHERE user.idUser = licence_admin.idUser AND licence_admin.idLicence=\"'.intVal($idLicence).'\";';\n\t\t$rs = $this->reg->get('db')->query($query);\n\t\tif($rs && $rs->num_rows){\n\t\t\tforeach($rs->rows AS $idRow =>$row){\n\t\t\t\t$user_ids[] = $row['idUser'];\n\t\t\t\t}\n\t\t\t}\n\t\t$query = 'SELECT user.idUser FROM user, clinic_user WHERE user.idUser = clinic_user.idUser AND clinic_user.idClinic=\"'.intVal($idClinic).'\";';\n\t\tunset($rs);\n\t\t$rs = $this->reg->get('db')->query($query); \n\t\tif($rs && $rs->num_rows){\n\t\t\tforeach($rs->rows AS $idRow =>$row){\n\t\t\t\t$user_ids[] = $row['idUser'];\n\t\t\t\t}\n\t\t\t}\n\t\tunset($rs);\n\t\t$user_ids = array_unique($user_ids);\t\t\n\t\t//\n\t\treturn $user_ids;\n\t\t}",
"function get_user_profil_kapal($params) {\n $sql = \"SELECT * FROM \n (\n SELECT a.*, c.role_id, c.role_nm, login_date, ip_address\n FROM com_user a\n INNER JOIN com_role_user b ON a.user_id = b.user_id\n INNER JOIN com_role c ON c.role_id = b.role_id\n LEFT JOIN com_user_login d ON a.user_id = d.user_id\n WHERE a.user_id = ? AND c.role_id = ?\n ORDER BY login_date DESC\n ) result \n GROUP BY user_id\";\n $query = $this->db->query($sql, $params);\n if ($query->num_rows() > 0) {\n $result = $query->row_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }",
"public function getEmployeesfnameasc(){\n // log into database\n $user = \"root\";\n $pass = \"root\";\n $dbh = new PDO('mysql:host=localhost;dbname=ssl;port=8889', $user, $pass);\n\n // grab all the employees from the database\n $st = $dbh->prepare(\"select empFName, empLName, empPhone, empEmail from employees ORDER BY empFName ASC\");\n $st->execute();\n $result = $st->fetchAll();\n return $result;\n }",
"public function pesquisarCertificadoAction() {\r\n try {\r\n $this->getHelper('layout')->disableLayout();\r\n \r\n $params = $this->_getAllParams();\r\n $params = $this->_helper->util->urldecodeGet($params); \r\n $params = $this->_helper->util->utf8Decode($params); \r\n $params['limit'] = 5; \r\n \r\n $this->view->dataGrid = $this->_helper->util->utf8Encode($this->certificadoDbTable->getDataGrid($params)); \r\n \r\n } catch (Exception $e) { \r\n echo $e->getMessage();\r\n die('ERRO|Ocorreu um erro ao tentar executar a operação. Tente novamente. Caso persista, contate o administrador do sistema.');\r\n }\r\n }",
"public function getUserSecCompanyList($userid) {\n \n \n \n /*\n \n \n \n \n \n */\n $this->db->distinct();\n $this->db->select('user_securities.comid,company.com_name');\n $this->db->from('user_securities');\n $this->db->join('company', 'user_securities.comid = company.comid');\n $where = \"user_securities.userid = \" . $userid . \" AND user_securities.status = 'BOUGHT'\";\n $this->db->where($where);\n $query = $this->db->get();\n\n $result = $query->result();\n if ($result) {\n return $result;\n } else {\n return FALSE;\n }\n }",
"function getEOIUser($eoiid, $userid)\n {\n $ay_res= array();\n \n $this->db->select('*');\n $this->db->from('eoi_user');\n $this->db->where('eoiid', $eoiid);\n $this->db->where('userid', $userid);\n $query= $this->db->get();\n \n\n foreach($query->result() as $row)\n {\n $ay_res[]= $row->eoiid; \n $ay_res[]= $row->userid; \n $ay_res[]= $row->subdate; \n $ay_res[]= $row->title; \n $ay_res[]= $row->org; // 4 \n $ay_res[]= $row->doc1; \n $ay_res[]= $row->doc2; \n $ay_res[]= $row->is_proposal; \n }\n return $ay_res; \n }",
"function certificateuv_get_participants($certificateid) {\n global $DB;\n\n $sql = \"SELECT DISTINCT u.id, u.id\n FROM {user} u, {certificateuv_issues} a\n WHERE a.certificateid = :certificateid\n AND u.id = a.userid\";\n return $DB->get_records_sql($sql, array('certificateid' => $certificateid));\n}",
"private function getUserCertExpire ()\n\t\t{\n\t\t\t$dbs = new DB ( $this->config['database'] );\n $search = $dbs->query(\"SELECT * FROM tbl_vpn_cert_expire WHERE org_id = \" . trim($this->c) );\n if ( count($search) ) {\n\t\t\t\t$this->result['data']['id'] = $search[0]['org_id'];\n\t\t\t\t$this->result['data']['certificate_expire'] = $search[0]['org_cert_expire'];\n\t\t\t} else \n\t\t\t\t$this->result['data']['result'] = \"Not found [error code:100:101]\";\n\n\t\t\t$dbs->CloseConnection ();\n\t\t\treturn ;\n\t\t}",
"function ajax_list_exemption_certificates() {\r\n\tglobal $current_user;\r\n\t\r\n\t//get_currentuserinfo();\r\n\r\n\t$customer_id = is_user_logged_in() ? $current_user->user_login : '';\r\n\r\n\tif ( $customer_id ) {\r\n\t\t$certificates = get_user_exemption_certs( $customer_id );\r\n\r\n\t\tif ( count( $certificates ) > 0 ) {\r\n\t\t\t$final_certificates = new stdClass();\r\n\t\t\t$final_certificates->cert_list = $certificates;\r\n\r\n\t\t\t// Convert to JSON and return\r\n\t\t\tdie( json_encode( $final_certificates ) );\r\n\t\t} else {\r\n\t\t\tdie( '{cert_list:[]}' );\r\n\t\t}\r\n\t} else {\r\n\t\tdie( '{cert_list:[]}' );\r\n\t}\r\n}",
"public function getAllUserDetails()\n\t{ \n\t\t$userCondi = $this->userCondi;\t\n\t\t$db = Zend_Db_Table::getDefaultAdapter();\n\t $query = \"SELECT StaffCode,StaffName FROM local_user_mapping WHERE StaffStatus='AC' $userCondi ORDER BY StaffName\"; \n\t \n\t\treturn $result = $db->fetchAll($query);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generates a cell with string length as width and place it on the pdf. | function placeText($text){
$cellWidth = $this->GetStringWidth($text) + 4;
//Cell($cellWidth, $cellHeight, $text, $borderOption);
return $this->Cell($cellWidth, 10, $text, 1);
} | [
"protected function generateCell() {\n return \"\";\n }",
"public function createCell();",
"function sistema_operativo($string) {\r\n$this->setxy(5,$this->recuperar_base2()+23);\r\n$this->SetFont('Arial','B',10);\r\n$this->cell(200,8,$string);\r\n\r\n}",
"function CellFit($w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = 0, $link = '', $scale = 0, $force = 1) {\r\n // CellFit developed by Patrick Benny (www.fpdf.org)\r\n //Get string width\r\n $str_width = $this->GetStringWidth($txt);\r\n\r\n //Calculate ratio to fit cell\r\n if ($w == 0) {\r\n $w = $this->w - $this->rMargin - $this->x;\r\n }\r\n $ratio = 0;\r\n if ($str_width != 0) {\r\n $ratio = ($w - $this->cMargin * 2) / $str_width;\r\n }\r\n\r\n $fit = ($ratio < 1 || ($ratio > 1 && $force == 1));\r\n if ($fit) {\r\n switch ($scale) {\r\n //Character spacing\r\n case 0:\r\n //Calculate character spacing in points\r\n $char_space = ($w - $this->cMargin * 2 - $str_width) / max($this->MBGetStringLength($txt) - 1, 1) * $this->k;\r\n //Set character spacing\r\n $this->_out(sprintf('BT %.2f Tc ET', $char_space));\r\n break;\r\n\r\n //Horizontal scaling\r\n case 1:\r\n //Calculate horizontal scaling\r\n $horiz_scale = $ratio * 100.0;\r\n //Set horizontal scaling\r\n $this->_out(sprintf('BT %.2f Tz ET', $horiz_scale));\r\n break;\r\n }\r\n //Override user alignment (since text will fill up cell)\r\n $align = '';\r\n }\r\n\r\n //Pass on to Cell method\r\n $this->Cell($w, $h, $txt, $border, $ln, $align, $fill, $link);\r\n\r\n //Reset character spacing/horizontal scaling\r\n if ($fit) {\r\n $this->_out('BT ' . ($scale == 0 ? '0 Tc' : '100 Tz') . ' ET');\r\n }\r\n }",
"function write_cell ($type, $text, $attribute='')\n{\n printf (\" <%s %s>%s</%s>\\n\",\n\t $type, $attribute,\n\t $text,\n\t $type);\n}",
"function CustomCell_Text($pLeft, $pMaxWidth, $pTop, $pText, $pFont=NULL, $pWeight=NULL) {\n $this->temp_custCellLeft = $pLeft;\n $this->temp_custCellTop = $pTop;\n $this->temp_custCellText = $pText;\n $this->temp_custCellFont = $pFont;\n $this->temp_custCellWeight = $pWeight;\n $this->temp_custCellWidth = $pMaxWidth;\n $this->output_Method('CustomCell_Text');\n}",
"function CellSmallCaps($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')\n\t{\n\t\t//Output a cell\n\t\t$k=$this->k;\n\t\tif($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak())\n\t\t{\n\t\t\t//Automatic page break\n\t\t\t$x=$this->x;\n\t\t\t$ws=$this->ws;\n\t\t\tif($ws>0)\n\t\t\t{\n\t\t\t\t$this->ws=0;\n\t\t\t\t$this->_out('0 Tw');\n\t\t\t}\n\t\t\t$this->AddPage($this->CurOrientation,$this->CurPageFormat);\n\t\t\t$this->x=$x;\n\t\t\tif($ws>0)\n\t\t\t{\n\t\t\t\t$this->ws=$ws;\n\t\t\t\t$this->_out(sprintf('%.3F Tw',$ws*$k));\n\t\t\t}\n\t\t}\n\t\tif($w==0)\n\t\t\t$w=$this->w-$this->rMargin-$this->x;\n\t\t$s='';\n\t\tif($fill || $border==1)\n\t\t{\n\t\t\tif($fill)\n\t\t\t\t$op=($border==1) ? 'B' : 'f';\n\t\t\telse\n\t\t\t\t$op='S';\n\t\t\t$s=sprintf('%.2F %.2F %.2F %.2F re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op);\n\t\t}\n\t\tif(is_string($border))\n\t\t{\n\t\t\t$x=$this->x;\n\t\t\t$y=$this->y;\n\t\t\tif(strpos($border,'L')!==false)\n\t\t\t\t$s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k);\n\t\t\tif(strpos($border,'T')!==false)\n\t\t\t\t$s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k);\n\t\t\tif(strpos($border,'R')!==false)\n\t\t\t\t$s.=sprintf('%.2F %.2F m %.2F %.2F l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k);\n\t\t\tif(strpos($border,'B')!==false)\n\t\t\t\t$s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k);\n\t\t}\n\t\tif($txt!=='')\n\t\t{\n\t\t\tif($align=='R')\n\t\t\t\t$dx=$w-$this->cMargin-$this->GetStringWidth($txt);\n\t\t\telseif($align=='C')\n\t\t\t\t$dx=($w-$this->GetStringWidth($txt))/2;\n\t\t\telse\n\t\t\t\t$dx=$this->cMargin;\n\t\t\tif($this->ColorFlag)\n\t\t\t\t$s.='q '.$this->TextColor.' ';\n\t\t\t$txt2=str_replace(')','\\\\)',str_replace('(','\\\\(',str_replace('\\\\','\\\\\\\\',$txt)));\n\n\t\t\t$firstDx = $dx;\n\t\t\tfor ($i=0; $i<strlen($txt2); $i++) {\n\t\t\t\t$letter = $txt2[$i];\n\t\t\t\t$upper = strpos(\"ABCDEFGHIJKLMNOPQRSTUVWXZ0123456789`!@#$%^&*()_=+|'\\\";:{}[]?,.<>\",$letter);\n\t\t\t\tif ($upper === false) { // the letter is lowercase\n\t\t\t\t\tif($i==0){ // for the first char\n\t\t\t\t\t\t$s.=sprintf(' BT /F%d %.2F Tf',$this->CurrentFont['i'],$this->FontSizePt*0.8);\n\t\t\t\t\t\t$s.=sprintf(' %.2F %.2F Td (%s) Tj',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,strtoupper($letter));\n\t\t\t\t\t\t$s.=sprintf(' /F%d %.2F Tf ET',$this->CurrentFont['i'],$this->FontSizePt);\n\t\t\t\t\t} else { // if there is no first char\n\t\t\t\t\t\t$s.=sprintf(' BT /F%d %.2F Tf',$this->CurrentFont['i'],$this->FontSizePt*0.8);\n\t\t\t\t\t\t$dx+=($this->GetStringWidth(substr($txt2,$i-1,1)))*1.02;\n\t\t\t\t\t\t$s.=sprintf(' %.2F %.2F Td (%s) Tj',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,strtoupper($letter));\n\t\t\t\t\t\t$s.=sprintf(' /F%d %.2F Tf ET',$this->CurrentFont['i'],$this->FontSizePt);\n\t\t\t\t\t}\n\t\t\t\t} else { //case the letter is uppercase\n\t\t\t\t\tif($i == 0){ //for the first char\n\t\t\t\t\t\t$s.=sprintf(' BT %.2F %.2F Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$letter);\n\t\t\t\t\t} else { // if there is no first char\n\t\t\t\t\t\t$dx+=($this->GetStringWidth(substr($txt2,$i-1,1)))*1.02;\n\t\t\t\t\t\t$s.=sprintf(' BT %.2F %.2F Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$letter);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif($this->underline)\n\t\t\t\t$s.=' '.$this->_dounderline($this->x+$firstDx,$this->y+.5*$h+.3*$this->FontSize,$txt);\n\t\t\tif($this->ColorFlag)\n\t\t\t\t$s.=' Q';\n\t\t\tif($link)\n\t\t\t\t$this->Link($this->x+$firstDx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link);\n\t\t}\n\t\tif($s)\n\t\t\t$this->_out($s);\n\t\t$this->lasth=$h;\n\t\tif($ln>0)\n\t\t{\n\t\t\t//Go to next line\n\t\t\t$this->y+=$h;\n\t\t\tif($ln==1)\n\t\t\t\t$this->x=$this->lMargin;\n\t\t}\n\t\telse\n\t\t\t$this->x+=$w;\n\t}",
"public function setTableWidth($string) {\n $this->tableWidth = \"style=\\\"width:$string\\\"\";\n }",
"public function write() {\n\t\tif (!($this->_page instanceof Zend_Pdf_Page)) {\n\t\t\tthrow new Zend_Pdf_Exception(\"The PDF page that the cell is attempting to write to is not a valid page.\");\n\t\t}\n\t\tif (!($this->_font instanceof Zend_Pdf_Resource_Font)) {\n\t\t\tthrow new Zend_Pdf_Exception('No font has been set');\n\t\t}\n\t\tif ($this->isAutoHeight()) {\n\t\t\t$this->_height=$this->_autoHeight;\n\t\t}\n\t\tif ($this->isAutoWidth()) {\n\t\t\t$this->_width=$this->_autoWidth;\n\t\t}\n\t\t\n\t\t//positions of the cell's box\n\n\t\t//initalize the diminsions to defaults\n\t\t$top=$this->_y;\n\t\t$left=$this->_x;\n\t\t$right=$left+$this->getWidth();\n\t\t$bottom=$top+$this->getHeight();\n\t\t\n\t\tif ($this->_position & Zend_Pdf_Cell::POSITION_BOTTOM) {\n\t\t\t$top=$this->getHeight();\n\t\t\t$bottom=$top+$this->getHeight();\n\t\t}\n\t\tif ($this->_position & Zend_Pdf_Cell::POSITION_CENTER_X) {\n\t\t\t$left=$this->_page->getWidth()/2 - $this->getWidth()/2 + $this->_x;\n\t\t\t$right=$left+$this->getWidth();\n\t\t}\n\t\tif ($this->_position & Zend_Pdf_Cell::POSITION_CENTER_Y) {\n\t\t\t$top=$this->_page->getHeight()/2 + $this->getHeight()/2 - $this->_y;\t\t\t\n\t\t\t$bottom=$top-$this->getHeight();\t\t\n\t\t}\n\t\tif ($this->_position & Zend_Pdf_Cell::POSITION_TOP ) {\n\t\t\t$top=$this->_page->getHeight();\n\t\t\t$bottom=$top+$this->getHeight();\n\t\t}\n\t\tif ($this->_position & Zend_Pdf_Cell::POSITION_RIGHT) {\n\t\t\t$left=$this->_page->getWidth() - $this->getWidth();\n\t\t\t$right=$left+$this->getWidth();\n\t\t}\n\t\t$currentY=$top;\n\t\t//save the page's font so we can put it back after writing the cell\n\t\t$pageFont=$this->_page->getFont();\n\t\t$fontSize=$this->_page->getFontSize();\n\t\t\n\t\t\t\t\n\t\t//restore old size and font\n\t\t$this->_page->setFont($pageFont,$fontSize);\n\t\t//draw the border\n\t\tif ($this->_border['size']>0) {\n\t\t\t$style=new Zend_Pdf_Style();\n\t\t\t$style->setLineColor($this->getBorderColor());\n\t\t\t$style->setFillColor(new Zend_Pdf_Color_RGB(255,255,255));\n\t\t\t$style->setLineDashingPattern($this->getBorderPattern());\n\t\t\t$this->_page->setStyle($style);\n\t\t\t$this->_page->drawRectangle($right,$top,$left,$bottom);\n\t\t\t$style->setFillColor(new Zend_Pdf_Color_RGB(0,0,0));\n\t\t\t$this->_page->setStyle($style);\n\t\t}\n\t\t\n\t\t//draw every section of every page.\n\t\tfor ($i=0;$i<count($this->_text);$i++) {\n\t\t\t$currentX=0;\n\t\t\tswitch ($this->_text[$i]['alignment']) {\n\t\t\t\tcase Zend_Pdf_Cell::ALIGN_RIGHT:\n\t\t\t\t\t$currentX=$right - $this->_text[$i]['width'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase Zend_Pdf_Cell::ALIGN_CENTER:\n\t\t\t\t\t$currentX=($right-$left)/2+$left-$this->_text[$i]['width']/2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Zend_Pdf_Cell::ALIGN_JUSTIFY:\n\t\t\t\t\t//@todo\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$currentX=$left;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t//add the offset\n\t\t\t$currentX+=$this->_text[$i]['x'];\n\t\t\t$currentY-=$this->_text[$i]['height'];\n\t\t\t//count() - 4 because of the 4 properties to this text.\n\t\t\tfor ($j=0;$j<count($this->_text[$i])-4;$j++) {\t\t\t\t\n\t\t\t\t$this->_page->setFont($this->_text[$i][$j]['font'],$this->_text[$i][$j]['fontSize']);\n\t\t\t\t$this->_page->drawText($this->_text[$i][$j]['text'],$currentX,$currentY,$this->_text[$i][$j]['encoding']);\n\t\t\t\t$currentX+=$this->_text[$i][$j]['width'];\t\t\n\t\t\t}\n\t\t}\n\t}",
"private function renderCell(CellInterface $cell, int $colWidth) : string\n {\n $filler = str_repeat(self::CHAR_CELL_PADDING, ($colWidth - $cell->getWidth()));\n if ($cell->getAlign() == Cell::ALIGN_LEFT) {\n $content = self::CHAR_CELL_PADDING . $cell->getValue() . $filler . self::CHAR_CELL_PADDING;\n } else {\n $content = self::CHAR_CELL_PADDING . $filler . $cell->getValue() . self::CHAR_CELL_PADDING;\n }\n return $content;\n }",
"function column($col, $heightPer, $height)\n{\n echo \"<td class=\\\"columnContainerCell\\\" width=\\\"\" . 95/$col . \"%\\\" rowspan=\\\"11\\\">\\n\";\n echo \"<table class=\\\"columnContainer\\\" height=\\\"\" . (((100/11)/$heightPer)*($height)) . \"%\\\">\\n\";\n echo \"<tr>\\n\";\n echo \"<td class=\\\"column\\\">\";\n \n //Display the count in the bar\n //Displayed vertically as not to change column width\n if ($height != 0)\n {\n //echo \"<font size=\\\"0\\\" color=\\\"white\\\">\";\n $heightArray = str_split($height);\n for($i = 0; $i < count($heightArray); $i++)\n echo $heightArray[$i].\"<br>\";\n //echo \"</font>\";\n }\n echo \"\\n\";\n echo \"</td>\\n\";\n echo \"</tr>\\n\";\n echo \"</table>\\n\";\n echo \"</td>\\n\"; \n}",
"function generate_vehicle_list_pdf($columnsValues,$total_vehicles,$data,$allconstants,$Customer){\n\t\n\t$heightdynamic =12;\n\t\t\n\t\t$columnwidtharrays = array(15,50,45,50,30);\n\t\t\n\t\t$this->AddPage();\n\t\t\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\n\t\t$c=0;\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\n\t\t\n\t\t\n\t\t\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$x= $this->GetX();\n\t\t$y= $this->GetY();\t\t\n\n\t\t$this->SetFont('Arial', 'B', 6);\t\t\t\n\n\t\t$this->MultiCell(25, 8, 'Total Vehicles: ',0,'','L',true);\n\t\t$this->SetFont('Arial','', 6);\n\t\t$this->SetY($y); //Reset the write point\n $this->SetX($x+25);\t\t\n\t\t$this->MultiCell(100, 8, $total_vehicles ,0,'','L',true);\t\n\t\t$this->SetY($y); //Reset the write point\n $this->SetX($x+125);\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\t\t$this->SetFont('Arial','', 6);\n\t\t$this->SetY($y); //Reset the write point\n $this->SetX($x+150);\t\n\t\t$this->MultiCell(40, 8, '' ,0,'','L',true);\t\n\t\t$this->Ln(6);\n\t\t\n\t\t\n\t\t}\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n\t\tforeach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t $y= $this->GetY();\n\t\t\t\n\t\t\t\n\t\t\tif($c==0 )\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'','C',true);\n\t\t\telse\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'','C',true);\n\t\t\t$this->SetY($y); //Reset the write point\n $this->SetX($x +$columnwidtharrays[$c]);\n\t\t \n\t\t $c++;\n\t\t \n\n\t\t}\n\t\t$this->SetFont('Arial', '', 10);\n\t\t$i=0;\n\t\t$this->Ln();\n\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\t\t\n\t\t\n\t\t\t$vc_reg_no = $val['ActivationDeactivationVehicle']['vc_reg_no'];\n\t\t\t$vc_chasis_no = $val['ActivationDeactivationVehicle']['vc_chasis_no'];\n\t\t\t$vc_veh_type = $allconstants[$val['ActivationDeactivationVehicle']['vc_veh_type']];\n\t\t\t$vc_status = $allconstants[$val['ActivationDeactivationVehicle']['vc_status']];\n\t\t\t\n\t\t\t\n\t\t\t$font_size=7;\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_reg_no, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\n\t\t\t$col[] = array('text' => $vc_chasis_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_veh_type, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_status, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$columns[]=$col;\n\t\t\t$this->WriteTable($columns); \n\t\t\t$i++;\n\t\n\t\t}\n\t\n\t\n\t}",
"function printCell( $options = [ 'type' => null, 'lnBefore' => null, 'fontFamily' => null, 'fontStyle' => null, 'fontSize' => null ],\n $width = null, $height = null, $text = null, $border = null, $ln = null, $align = null, $fill = null, $link = null ) {\n\n $printCellParameters = get_defined_vars();\n if ( $printCellParameters[ 'options' ][ 'fontFamily' ] === null ) {\n $printCellParameters[ 'options' ][ 'fontFamily' ] = ( ( $this->defaultFamily === null ) ? 'Arial' : $this->defaultFamily );\n }\n\n if ( $options[ 'type' ] !== null ) {\n $printCellParameters = $this->cellType( $options[ 'type' ], $printCellParameters );\n }\n\n $this->SetFont( $printCellParameters[ 'options' ][ 'fontFamily' ], $printCellParameters[ 'options' ][ 'fontStyle' ], $printCellParameters[ 'options' ][ 'fontSize' ] );\n\n if ( is_numeric( $printCellParameters[ 'options' ][ 'lnBefore' ] ) || $printCellParameters[ 'options' ][ 'lnBefore' ] === true ) {\n if ( $printCellParameters[ 'options' ][ 'lnBefore' ] === true ) { $printCellParameters[ 'options' ][ 'lnBefore' ] = null; }\n $this->Ln( $printCellParameters[ 'options' ][ 'lnBefore' ] );\n }\n\n $textUtf8Decoded = utf8_decode( $text );\n $this->Cell( $printCellParameters[ 'width' ], $printCellParameters[ 'height' ], $textUtf8Decoded, $printCellParameters[ 'border' ], $printCellParameters ['ln'], $printCellParameters['align'], $printCellParameters[ 'fill' ], $printCellParameters[ 'link' ] );\n }",
"function _setWidthTable($font,$fontSize)\n {\n global $svg;\n\n foreach ($this->fields as $field) {\n $this->width = max($this->width, $svg->getStringWidth($field,$font,$fontSize));\n }\n $this->width += $svg->getStringWidth(' ',$font,$fontSize);\n /*\n * it is unknown what value must be added, because\n * table title is affected by the tabe width value\n */\n while ($this->width < $svg->getStringWidth($this->_getTitle(),$font,$fontSize)) {\n $this->width += 7;\n }\n }",
"function pdf_stringwidth(& $pdf, $text, $font, $fontsize)\n\t{\n\t# check text\n\tif(! strlen($text))\n\t\treturn(0);\n\n\t# check if font is valid\n\tif(sscanf($font, \"/F%d\", $whatever) != 1)\n\t\tdie(__FUNCTION__ . \": invalid font: \" . $font);\n\n\t# check if fontsize is valid\n\tif($fontsize == 0)\n\t\tdie(__FUNCTION__ . \": invalid fontsize: \" . $fontsize);\n\n\t# check if font is loaded\n\tif(! isset($pdf[\"resources\"][\"/Font\"][$font]))\n\t\tdie(__FUNCTION__ . \": font not found: \" . $font);\n\n\t# check if pointer is valid\n\tif(sscanf($pdf[\"resources\"][\"/Font\"][$font], \"%d %d R\", $object_id, $object_version) != 2)\n\t\tdie(__FUNCTION__ . \": invalid pointer.\");\n\n\t# set counter\n\t$width = 0;\n\n\t# convert to iso\n\t$text = utf8_decode($text);\n\n\t# count width of chars\n\tforeach(str_split($text) as $char)\n\t\t$width += $pdf[\"objects\"][$object_id][\"dictionary\"][\"/Widths\"][ord($char)];\n\n\treturn($width / 1000 * $fontsize);\n\t}",
"public function Visualize($table_data,$font_size) {\r\n $ww_table = $this->wordWrapTable($table_data,$font_size,true);\r\n $rows = count($ww_table);\r\n $cols= array_keys ($ww_table[0]);\r\n $col_size = array();\r\n if ($this->encoding->useMB()) {\r\n $plus = mb_convert_encoding(\"+\",$this->encoding->getEncodingType());\r\n $newline = mb_convert_encoding(\"\\n\",$this->encoding->getEncodingType());\r\n $dash = mb_convert_encoding(\"-\",$this->encoding->getEncodingType());\r\n $space = mb_convert_encoding(\" \",$this->encoding->getEncodingType());\r\n $vert = mb_convert_encoding('|',$this->encoding->getEncodingType());\r\n $out = mb_convert_encoding(\"\",$this->encoding->getEncodingType());\r\n } else {\r\n $plus = \"+\";\r\n $newline = \"\\n\";\r\n $dash = \"-\";\r\n $space = \" \";\r\n $vert = '|';\r\n $out = \"\";\r\n }\r\n $lengths = array();\r\n for ($r = 0; $r < $rows; $r++) {\r\n $lengths[$r] = array();\r\n }\r\n foreach ($cols as $col) {\r\n $max = 0;\r\n for ($r = 0; $r <$rows ; $r++) {\r\n $z = count($ww_table[$r][$col]);\r\n for ($i =0; $i < $z; $i++) {\r\n $line = $ww_table[$r][$col][$i];\r\n if ($this->encoding->useMB()) {\r\n $w = mb_strlen($line,$this->encoding->getEncodingType());\r\n } else {\r\n $w = strlen($line);\r\n }\r\n $lengths[$r][$col][$i] = $w;\r\n if ($w > $max) {\r\n $max = $w;\r\n }\r\n }\r\n }\r\n $col_size[$col] = $max;\r\n }\r\n //now do the display\r\n for ($r = 0; $r < $rows ; $r++) {\r\n foreach ($cols as $col) {\r\n $out .= $plus;\r\n for ($j=0 ; $j < $col_size[$col]; $j++) {\r\n $out .= $dash;\r\n }\r\n }\r\n $out .= $plus . $newline;\r\n $z = count( ($ww_table[$r][$cols[0]]) ) ;\r\n for ($i = 0; $i < $z; $i++) {\r\n foreach ($cols as $col) {\r\n $out .= $vert . $ww_table[$r][$col][$i];\r\n for ($j = $lengths[$r][$col][$i]; $j < $col_size[$col]; $j++) {\r\n $out .= $space;\r\n }\r\n }\r\n $out .= $vert . $newline;\r\n }\r\n }\r\n foreach ($cols as $col) {\r\n $out .= $plus;\r\n for ($j=0 ; $j < $col_size[$col]; $j++) {\r\n $out .= $dash;\r\n }\r\n }\r\n $out .= $plus . $newline;\r\n return $out;\r\n \r\n }",
"function createBlankTD($i,$str='<td valign=\"middle\" align=\"center\" class=\"timtd\">---</td>'){\n return ($i > 0 ? str_repeat($str,$i):str_repeat($str,0));\n}",
"function cellOfText($pText, $pColSpan=1) {\n $this->cell_Start($pColSpan);\n $this->cell_Text($pText);\n $this->cell_End(); \n}",
"function width()\n {\n $this->_font->width($this->_text);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the value for the class member ldapSynced. | public function setLdapSynced($ldapSynced)
{
$this->ldapSynced = $ldapSynced;
} | [
"public function sync() {\n $service = Injector::inst()->get('LDAPService');\n if (\n !$service->enabled() ||\n !$this->owner->GUID\n ) {\n return;\n }\n $service->updateLDAPFromMember($this->owner);\n $service->updateLDAPGroupsForMember($this->owner);\n }",
"public function setSyncedStatus() {\n if ($this->getDrupalEntity()) {\n $entity = $this->getDrupalEntity()->value();\n // Dynamically creating an object property that would allow us to know\n // that this entity has already been saved by the content hub connector\n // and does not need to re-trigger the entity_save() hooks.\n $entity->__content_hub_synchronized = TRUE;\n $entity->__content_hub_origin = $this->getOrigin();\n $this->setDrupalEntity($this->getDrupalEntityType(), $entity);\n }\n }",
"public function setSyncLdap( bool $bool ) : Property\n {\n $this->checkBoolean( $bool );\n $this->sync_ldap = $bool;\n return $this;\n }",
"public function setLastDynamicsSync(): void;",
"public function setSyncing($status);",
"public function setLastDirectorySyncDateTime($val)\n {\n $this->_propDict[\"lastDirectorySyncDateTime\"] = $val;\n return $this;\n }",
"public function syncLdap()\n {\n $this->updateName();\n $this->updateEmail();\n $this->updateInfo();\n $this->save();\n }",
"public function setSyncTime(): void\n {\n }",
"public function setSyncToken($value){\n return $this->setParameter('sync_token', $value);\n }",
"protected function set_sync_token( $sync_token ) {\n\t\tset_transient( 'wc_bookings_gcalendar_sync_token', $sync_token, self::TOKEN_TRANSIENT_TIME );\n\t}",
"public static function permissionSynced(\\Closure|string|array $callback): void\n {\n static::registerLaratrustEvent('permission.synced', $callback);\n }",
"function setSyncToken($token);",
"public function setLastSyncDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastSyncDateTime', $value);\n }",
"public function setLastSync($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->last_sync !== null || $dt !== null) {\n $currentDateAsString = ($this->last_sync !== null && $tmpDt = new DateTime($this->last_sync)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '1901-01-01 00:00:00') // or the entered value matches the default\n ) {\n $this->last_sync = $newDateAsString;\n $this->modifiedColumns[] = JadwalPeer::LAST_SYNC;\n }\n } // if either are not null\n\n\n return $this;\n }",
"public function setIsSyncAllowed($val)\n {\n $this->_propDict[\"isSyncAllowed\"] = $val;\n return $this;\n }",
"public static function syncFromDirectory() {\n $allRecords = UserDirectory::singleton() -> fetchAll();\n\n self::syncUsers($allRecords[\"users\"]);\n self::syncGroups($allRecords[\"groups\"]);\n self::syncMembership($allRecords[\"groups\"]);\n\n // save sync timestamp in wp-option\n self::updateLastSyncTimestamp();\n }",
"public function testUpdateLdapServer()\n {\n }",
"public function setSyncStatus(?WindowsAutopilotSyncStatus $value): void {\n $this->getBackingStore()->set('syncStatus', $value);\n }",
"public static function enableSyncingFor($class): void\n {\n unset(static::$syncingDisabledFor[$class]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=> Returns an array of all existing causes <=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<= | public function getCauses(): array
{
return $this->causes;
} | [
"public function getSuppressedIssues()\n {\n return [];\n }",
"public function getCauses(): Generator {\n\t\tforeach ($this->violations as $violation) {\n\t\t\t$cause = $violation->getCause();\n\t\t\tif (isset($cause)) {\n\t\t\t\tyield $cause;\n\t\t\t}\n\t\t}\n\t}",
"protected function getCauses() {\n // @TODO: Potentially combine this with getActionTypes() to DRY up code.\n $data = array();\n $data['primary'] = NULL;\n $data['secondary'] = NULL;\n\n $primary_cause_id = dosomething_helpers_extract_field_data($this->node->field_primary_cause);\n $secondary_cause_ids = dosomething_helpers_extract_field_data($this->node->field_cause);\n\n if ($primary_cause_id) {\n $data['primary'] = $this->getTaxonomyTerm($primary_cause_id);\n }\n\n if ($secondary_cause_ids) {\n if (is_array($secondary_cause_ids)) {\n $secondary_causes = array();\n\n foreach($secondary_cause_ids as $tid) {\n $secondary_causes[] = $this->getTaxonomyTerm($tid);\n }\n }\n else {\n $secondary_causes[] = $this->getTaxonomyTerm($secondary_cause_ids);\n }\n\n $data['secondary'] = $secondary_causes;\n }\n\n return $data;\n }",
"public function getAllCauses() {\n $causes = Cause::all();\n\n return $this->collectionOfCausesToOutputArray($causes->all());\n }",
"public function getUnworkedWithoutOrganization() {\n\n $aStack = array();\n foreach ($this->getAllBugs() as $oTicket) {\n /* @var $oTicket Bug */\n if ($oTicket->isContainer() === false and $oTicket->isOrga() === false and $oTicket->isStatusAtMost(Bug::STATUS_CONFIRMED) and $oTicket->isWorkedOn(Bug::STATUS_CLOSED) !== true) {\n $aStack[$oTicket->id()] = $oTicket;\n }\n }\n\n ksort($aStack);\n return $aStack;\n }",
"public function getUsesFixed() {\n return array_filter($this->getFixes(), function (CollectorFix $fix) {\n return $fix->isUses();\n });\n }",
"public static function getConflicts()\n {\n return self::$_conflicts;\n }",
"function getAllExceptions()\n {\n $result = false;\n if (!empty($this->recur[\"changed_occurences\"])) {\n $result = array();\n foreach($this->recur[\"changed_occurences\"] as $exception) {\n $result[] = $exception[\"basedate\"];\n }\n return $result;\n }\n return $result;\n }",
"public function findIrrelevants(): array\n {\n }",
"public function getConflicts()\n {\n $conflicts = array();\n foreach ($this->_xml->xpath('//conflicts') as $addon) {\n $conflicts[] = (string) $addon;\n }\n\n return $conflicts;\n }",
"private function getValidChangeFrequencies(): array\n {\n return [\n ChangeFrequencyEnum::ALWAYS,\n ChangeFrequencyEnum::HOURLY,\n ChangeFrequencyEnum::DAILY,\n ChangeFrequencyEnum::WEEKLY,\n ChangeFrequencyEnum::MONTHLY,\n ChangeFrequencyEnum::YEARLY,\n ChangeFrequencyEnum::NEVER,\n ];\n }",
"public function fix() : array {}",
"function getBugs()\n {\n if ($this->bugs != null) {\n return $this->bugs;\n } else\n return array();\n }",
"function _get_8th_report_errors() {\n return array(\n 'No receiving area status found',\n 'No receiving area lsa article 61 date found',\n 'No receiving area Related Sensitive area found',\n 'No receiving area designation date found',\n 'No receiving area nitrogen information found',\n 'No receiving area phosphorus information found',\n 'No receiving area B information found',\n 'No receiving area C information found',\n 'No receiving area relevant directive information found',\n 'No receiving area morphology information found',\n 'No receiving area hydrology information found',\n 'No receiving area hydraulic information found',\n 'No receiving area absence risk information found',\n 'No receiving area plants information found',\n 'No receiving area plants capacity information found',\n 'No receiving area incoming N-tot measured information found',\n 'No receiving area incoming N-tot calculated information found',\n 'No receiving area incoming N-tot estimated information found',\n 'No receiving area incoming P-tot measured information found',\n 'No receiving area incoming P-tot calculated information found',\n 'No receiving area incoming P-tot estimated information found',\n 'No receiving area discharged N-tot measured information found',\n 'No receiving area discharged N-tot calculated information found',\n 'No receiving area discharged N-tot estimated information found',\n 'No receiving area discharged P-tot measured information found',\n 'No receiving area discharged P-tot calculated information found',\n 'No receiving area discharged P-tot estimated information found',\n 'No receiving area root of corresponding GIS-data file found',\n 'No receiving area other directive information found',\n 'No receiving area other directive information date found',\n 'No receiving area root of correspo GIS-data file found',\n 'No receiving area article 54 applied information found',\n 'No receiving area name parameter found',\n 'No receiving area starting date of application found',\n 'No receiving area lsa hyperlink found',\n 'No receiving area lsa begin life date found',\n 'No receiving area lsa end life date found',\n 'No big cities found in the dataset',\n 'No agglomeration big id information found',\n );\n}",
"public function getUniqueAffectedRevs() {\n\t\treturn array_unique( array_merge( $this->getAffectedRevs(), $this->getAffectedBugRevs() ) );\n\t}",
"private function loadReasons(): array {\n $storage = \\Drupal::entityTypeManager()->getStorage('taxonomy_term');\n $query = $storage->getQuery()->accessCheck(FALSE)\n ->sort('weight')\n ->condition('status', 1)\n ->condition('vid', 'rejection_reasons');\n $reasons = [];\n foreach ($storage->loadMultiple($query->execute()) as $term) {\n $name = $term->name->value;\n $desc = $term->description->value ?: '';\n $desc = str_replace('in the Comments field', 'below', $desc);\n $reasons[] = [$name, rtrim($desc, '.')];\n }\n return $reasons;\n }",
"abstract protected function getNonReportableExceptions(): array;",
"protected function getNonReportableExceptions(): array\n {\n return [];\n }",
"public function violations()\n {\n $taxi_complaints = $this->taxi_complaints();\n $violations = [];\n\n foreach ($taxi_complaints as $k => $taxi_complaint)\n {\n // Add to array only if not empty\n if (!empty($taxi_complaint->violations()))\n {\n // Group violations by taxi_complaint.id\n $violations[$taxi_complaint->id] = $taxi_complaint->violations();\n }\n }\n\n return $violations;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Table level events Page Selecting event | function Page_Selecting(&$filter) {
// Enter your code here
} | [
"function ChangeSelection($page){}",
"function SetSelection($page){}",
"public function beforeSelect() {\r\n \r\n }",
"private function setPageSelect()\n {\n $GLOBALS['TSFE']->sys_page = Tx_Smarty_Service_Compatibility::makeInstance('t3lib_pageSelect');\n $GLOBALS['TSFE']->sys_page->versioningPreview = false;\n $GLOBALS['TSFE']->sys_page->versioningWorkspaceId = false;\n $GLOBALS['TSFE']->where_hid_del = ' AND pages.deleted=0';\n $GLOBALS['TSFE']->sys_page->init(false);\n $GLOBALS['TSFE']->sys_page->where_hid_del .= ' AND pages.doktype<200';\n $GLOBALS['TSFE']->sys_page->where_groupAccess\n = $GLOBALS['TSFE']->sys_page->getMultipleGroupsWhereClause('pages.fe_group', 'pages');\n }",
"protected static function handlePageEvent($page_event) {\n\t\tif($page_event->page) {\n\t\t\tforeach($page_event->page->revision->blocks as $region_name => $sections) {\n\t\t\t\tforeach($sections as $section_index => $section_def) {\n\t\t\t\t\tforeach($section_def['blocks'] as $block_index => $block_data) {\n\t\t\t\t\t\t$definition = BlockDefinition::fromDefinitionFile(BlockDefinition::locateDefinition(BlockDefinition::idFromNameAndVersion($block_data['definition_name'], $block_data['definition_version'])));\n\t\t\t\t\t\t$definition->onPageStatusChange($page_event, $block_data, $region_name, $section_index, $section_def, $block_index);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected function onSelected(){}",
"function culturefeed_pages_page_events(CultureFeed_Cdb_Item_Page $page) {\n\n $curr_page = isset($_GET['page']) ? $_GET['page'] : 0;\n\n // Add start index (page number we want) + items per page\n $parameters[] = new \\CultuurNet\\Search\\Parameter\\Start($curr_page * CULTUREFEED_PAGES_ADMIN_EVENTS_COUNT);\n $parameters[] = new \\CultuurNet\\Search\\Parameter\\Rows(CULTUREFEED_PAGES_ADMIN_EVENTS_COUNT);\n\n // Add grouping so returned events are not duplicate.\n $parameters[] = new \\CultuurNet\\Search\\Parameter\\Group();\n\n // Search on events that have a relation to the page ID.\n $parameters[] = new \\CultuurNet\\Search\\Parameter\\FilterQuery('type:event OR type:production');\n $parameters[] = new \\CultuurNet\\Search\\Parameter\\Query('\"'.$page->getId().'\"');\n\n // Add sorting.\n $sort_field = 'startdate';\n $direction = 'asc';\n if (isset($_GET['order'])) {\n\n $direction = $_GET['sort'];\n\n switch ($_GET['order']) {\n\n case t('Title'):\n $sort_field = 'title_sort';\n break;\n\n case t('Date'):\n $sort_field = 'startdate';\n break;\n\n case t('Reactions'):\n $sort_field = 'comment_count';\n break;\n\n }\n\n }\n\n $parameters[] = new \\CultuurNet\\Search\\Parameter\\Sort($sort_field, $direction);\n $service = culturefeed_get_search_service();\n\n // Execute search and show results.\n $build = array();\n try {\n\n $result = $service->search($parameters);\n pager_default_initialize($result->getTotalCount(), CULTUREFEED_PAGES_ADMIN_EVENTS_COUNT);\n\n $build['page'] = array(\n '#theme' => 'culturefeed_pages_events_admin_page',\n '#items' => $result->getItems(),\n '#page' => $page,\n );\n }\n catch (Exception $e) {\n watchdog_exception('culturefeed_pages', $e);\n $build['error'] = array('#markup' => t('There was an error while loading the activities.'));\n }\n\n culturefeed_pages_set_page_breadcrumb($page);\n\n return $build;\n\n}",
"public function selectEvent(){\n return $this->connect->getData(\"SELECT * FROM `tbl_events`\");\n }",
"function pagefromtemplate(Doku_Event $event) {\n if($event->data['tpl']) { \n $this->page_from_template = $event->data['tpl']; \n }\n }",
"public function addSelectEvent( $event )\n {\n if ( ! is_callable( $event ) ) {\n throw new Exception( \"Given event is not callable (it's not a function).\" );\n }\n \n $tables = array();\n $numTables = func_num_args();\n for ( $i = 1; $i < $numTables; $i++ ) {\n $tables[]= strtolower( func_get_arg( $i ) );\n }\n \n $tablesEvent = array( 'tables' => $tables, 'event' => $event );\n if ( $this->events == null ) {\n $this->events = array( $tablesEvent );\n } else {\n $this->events[]= $tablesEvent;\n }\n }",
"function event_poll_page_handler($page) {\n\n\telgg_load_library('elgg:event_poll');\n\t$page_type = $page[0];\n\tswitch ($page_type) {\t\t\n\t\tcase 'add':\n\t\tcase 'edit':\n\t\t\tgatekeeper();\n\t\t\techo event_poll_get_page_content_edit($page_type,$page[1]);\n\t\t\tbreak;\n\t\tcase 'vote':\n\t\t\tgatekeeper();\n\t\t\techo event_poll_get_page_content_vote($page[1]);\n\t\t\tbreak;\n\t\tcase 'schedule':\n\t\t\tgatekeeper();\n\t\t\techo event_poll_get_page_content_schedule($page[1]);\n\t\t\tbreak;\n\t\tcase 'list':\n\t\t\tgatekeeper();\n\t\t\techo event_poll_get_page_content_list($page[1]);\n\t\t\tbreak;\n\t\tcase 'get_times_dropdown':\n\t\t\tgatekeeper();\n\t\t\techo event_poll_get_times_dropdown();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn FALSE;\n\t}\n\treturn TRUE;\n}",
"public function pageChanged($sender,$param)\n\t{\n\t\t$this->DataList->CurrentPageIndex=$param->NewPageIndex;\n\t\t$this->populateData();\n\t}",
"public function preDqlSelect(Doctrine_Event $event) {\n\t\t$params = $event->getParams();\n\t\t$query = $event->getQuery();\n\t\t$tableName = $event->getInvoker()->getTable()->name;\n\t\t\n\t\t\t// delete\n\t\tif (isset($this->_options['delete'])) {\n\t\t\t$deleteField = $params['alias'] . '.' . $this->_options['delete'];\n\t\t\tif (!$query->contains($deleteField)) {\n\t\t\t\t$query->addWhere($deleteField . ' = ?', array(false));\n\t\t\t}\n\t\t}\n\n\t\t\t// disabled\n\t\t$showDisabled = $tableName == 'pages' ? $GLOBALS['TSFE']->showHiddenPage : $GLOBALS['TSFE']->showHiddenRecords;\n\t\tif (!$showDisabled && isset($this->_options['disabled'])) {\n\t\t\t$disabledField = $params['alias'] . '.' . $this->_options['disabled'];\n\t\t\tif (!$query->contains($disabledField)) {\n\t\t\t\t$query->addWhere($disabledField . ' = ?', array(false));\n\t\t\t}\n\t\t}\n\n\t\t\t// starttime\n\t\tif (isset($this->_options['starttime'])) {\n\t\t\t$starttimeField = $params['alias'] . '.' . $this->_options['starttime'];\n\t\t\tif (!$query->contains($starttimeField)) {\n\t\t\t\t$query->addWhere($starttimeField . ' <= ?', array($GLOBALS['SIM_ACCESS_TIME']));\n\t\t\t}\n\t\t}\n\n\t\t\t// endtime\n\t\tif (isset($this->_options['endtime'])) {\n\t\t\t$endtimeField = $params['alias'] . '.' . $this->_options['endtime'];\n\t\t\tif (!$query->contains($endtimeField)) {\n\t\t\t\t$query->addWhere($endtimeField . ' = 0 OR ' . $endtimeField . ' > ?', array($GLOBALS['SIM_ACCESS_TIME']));\n\t\t\t}\n\t\t}\n\n\t\t\t// fe_group\n\t\tif (isset($this->_options['fe_group'])) {\n\t\t\t$feGroupField = $params['alias'] . '.' . $this->_options['fe_group'];\n\t\t\tif (!$query->contains($feGroupField)) {\n\t\t\t\t$memberGroups = t3lib_div::intExplode(',',$GLOBALS['TSFE']->gr_list);\n\t\t\t\t$orChecks = array();\n\t\t\t\t$orChecks[] = $feGroupField . '=\\'\\'';\n\t\t\t\t$orChecks[] = $feGroupField . ' IS NULL';\n\t\t\t\t$orChecks[] = $feGroupField . '=\\'0\\'';\n\t\t\t\tforeach($memberGroups as $groupUid)\t{\n\t\t\t\t\t$orChecks[] = '(' . $feGroupField . ' LIKE \\'%,' . $groupUid . ',%\\' OR ' . $feGroupField . ' LIKE \\'' . $groupUid . ',%\\' OR ' . $feGroupField . ' LIKE \\'%,' . $groupUid . '\\' OR ' . $feGroupField . ' = \\'' . $groupUid . '\\')';\n\t\t\t\t}\n\t\t\t\t$query->addWhere(implode(' OR ',$orChecks));\n\t\t\t}\n\t\t}\n\t}",
"public function getSitepageEventsSelect($params = array()) {\n\n $table = Engine_Api::_()->getDbtable('events', 'sitepageevent');\n $rName = $table->info('name');\n\n $locationTable = Engine_Api::_()->getDbtable('locationitems', 'seaocore');\n $locationName = $locationTable->info('name');\n \n\t\t$pagePackagesTable = Engine_Api::_()->getDbtable('packages', 'sitepage');\n\t\t$pagePackageTableName = $pagePackagesTable->info('name');\n\t\t\n\t\t$tablePage = Engine_Api::_()->getDbtable('pages', 'sitepage');\n\t\t$tablePageName = $tablePage->info('name');\n\t\t\n $select = $table->select();\n $select = $select\n ->setIntegrityCheck(false)\n ->from($rName);\n\n $select = $select\n ->where($rName . '.search = ?', '1');\n\t\t$select->join($tablePageName, \"$tablePageName.page_id = $rName.page_id\", array('page_id', 'title AS page_title', 'closed', 'approved', 'declined', 'draft', 'expiration_date', 'owner_id', 'photo_id as page_photo_id'))\n\t\t\t->join($pagePackageTableName, \"$pagePackageTableName.package_id = $tablePageName.package_id\",array('package_id', 'price'));\n\t\t\t\n if ((isset($params['sitepage_location']) && !empty($params['sitepage_location'])) ) {\n if (isset($params['locationmiles']) && (!empty($params['locationmiles']))) {\n $longitude = 0;\n $latitude = 0;\n \n //check for zip code in location search.\n if(empty($params['Latitude']) && empty($params['Longitude'])) {\n $selectLocQuery = $locationTable->select()->where('location = ?', $params['sitepage_location']);\n $locationValue = $locationTable->fetchRow($selectLocQuery);\n $enableSocialengineaddon = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('seaocore');\n if (empty($locationValue)) {\n $getSEALocation = array();\n if (!empty($enableSocialengineaddon)) {\n $getSEALocation = Engine_Api::_()->getDbtable('locations', 'seaocore')->getLocation(array('location' => $params['sitepage_location']));\n }\n if (empty($getSEALocation)) {\n // $locationLocal = $params['sitepage_location'];\n $urladdress = str_replace(\" \", \"+\", $params['sitepage_location']);\n //Initialize delay in geocode speed\n $delay = 0;\n //Iterate through the rows, geocoding each address\n $geocode_pending = true;\n while ($geocode_pending) {\n $key = Engine_Api::_()->seaocore()->getGoogleMapApiKey();\n if (!empty($key)) {\n $request_url = \"https://maps.googleapis.com/maps/api/place/textsearch/json?query=$urladdress&sensor=true&key=$key\";\n } else {\n $request_url = \"https://maps.googleapis.com/maps/api/geocode/json?address=$urladdress&sensor=true\";\n }\n\n $ch = @curl_init();\n $timeout = 5;\n curl_setopt($ch, CURLOPT_URL, $request_url);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n ob_start();\n curl_exec($ch);\n curl_close($ch);\n $json_resopnse = Zend_Json::decode(ob_get_contents());\n ob_end_clean();\n $status = $json_resopnse['status'];\n if (strcmp($status, \"OK\") == 0) {\n //Successful geocode\n $geocode_pending = false;\n $result = $json_resopnse['results'];\n\n //Format: Longitude, Latitude, Altitude\n $latitude = (float) $result[0]['geometry']['location']['lat'];\n $longitude = (float) $result[0]['geometry']['location']['lng'];\n }\n }\n } else {\n $latitude = (float) $getSEALocation->latitude;\n $longitude = (float) $getSEALocation->longitude;\n }\n } else {\n $latitude = (float) $locationValue->latitude;\n $longitude = (float) $locationValue->longitude;\n }\n } else {\n $latitude = (float) $params['Latitude'];\n $longitude = (float) $params['Longitude'];\n }\n\n $radius = $params['locationmiles']; //in miles\n\n $flage = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitetagcheckin.proximity.search.kilometer', 0);\n if (!empty($flage)) {\n $radius = $radius * (0.621371192);\n }\n $latitudeRadians = deg2rad($latitude);\n $latitudeSin = sin($latitudeRadians);\n $latitudeCos = cos($latitudeRadians);\n $select->join($locationName, \"$rName.seao_locationid = $locationName.locationitem_id \", array(\"latitude\", \"longitude\", \"(degrees(acos($latitudeSin * sin(radians($locationName.latitude)) + $latitudeCos * cos(radians($locationName.latitude)) * cos(radians($longitude - $locationName.longitude)))) * 69.172) AS distance\"));\n $sqlstring = \"(degrees(acos($latitudeSin * sin(radians($locationName.latitude)) + $latitudeCos * cos(radians($locationName.latitude)) * cos(radians($longitude - $locationName.longitude)))) * 69.172 <= \" . \"'\" . $radius . \"'\";\n $sqlstring .= \")\";\n $select->where($sqlstring);\n $select->order(\"distance\");\n } else {\n $select->join($locationName, \"$rName.seao_locationid = $locationName.locationitem_id\");\n $select->where(\"`{$locationName}`.formatted_address LIKE ? or `{$locationName}`.location LIKE ? or `{$locationName}`.city LIKE ? or `{$locationName}`.state LIKE ?\", \"%\" . urldecode($params['sitepage_location']) . \"%\");\n //}\n }\n } elseif (!empty($params['latitude']) && !empty($params['longitude'])) {\n $radius = Engine_Api::_()->getApi('settings', 'core')->getSetting('sgl.geolocation.range', 100); // in miles\n $latitude = $params['latitude'];\n $longitude = $params['longitude'];\n $flage = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.proximity.search.kilometer', 0);\n if (!empty($flage)) {\n $radius = $radius * (0.621371192);\n }\n $latitudeRadians = deg2rad($latitude);\n $latitudeSin = sin($latitudeRadians);\n $latitudeCos = cos($latitudeRadians);\n $select->join($locationName, \"$rName.seao_locationid = $locationName.locationitem_id\", array(\"(degrees(acos($latitudeSin * sin(radians($locationName.latitude)) + $latitudeCos * cos(radians($locationName.latitude)) * cos(radians($longitude - $locationName.longitude)))) * 69.172) AS distance\"));\n $sqlstring = \"(degrees(acos($latitudeSin * sin(radians($locationName.latitude)) + $latitudeCos * cos(radians($locationName.latitude)) * cos(radians($longitude - $locationName.longitude)))) * 69.172 <= \" . \"'\" . $radius . \"'\";\n $sqlstring .= \")\";\n $select->where($sqlstring);\n $select->order(\"distance\");\n } else {\n $select->joinLeft($locationName, \"$rName.seao_locationid = $locationName.locationitem_id\");\n }\n \n\t\t\tif (!empty($params['title'])) {\n\t\t\t\t$select->where($tablePageName . \".title LIKE ? \", '%' . $params['title'] . '%');\n\t\t\t}\n\n\t\t\tif (!empty($params['search_event'])) {\n\t\t\t\t$select->where($rName . \".title LIKE ?\" , '%' . $params['search_event'] . '%');\n\t\t\t}\n\n// \t\t\tif (!empty($params['category'])) {\n// \t\t\t\t$select->where($tablePageName . '.category_id = ?', $params['category']);\n// \t\t\t}\n\n\t\t\tif (!empty($params['category_id'])) {\n\t\t\t\t$select->where($tablePageName . '.category_id = ?', $params['category_id']);\n\t\t\t}\n\n// \t\t\tif (!empty($params['subcategory'])) {\n// \t\t\t\t$select->where($tablePageName . '.subcategory_id = ?', $params['subcategory']);\n// \t\t\t}\n\n\t\t\tif (!empty($params['subcategory_id'])) {\n\t\t\t\t$select->where($tablePageName . '.subcategory_id = ?', $params['subcategory_id']);\n\t\t\t}\n\n// \t\t\tif (!empty($params['subsubcategory'])) {\n// \t\t\t\t$select->where($tablePageName . '.subsubcategory_id = ?', $params['subsubcategory']);\n// \t\t\t}\n\n\t\t\tif (!empty($params['subsubcategory_id'])) {\n\t\t\t\t$select->where($tablePageName . '.subsubcategory_id = ?', $params['subsubcategory_id']);\n\t\t\t}\n\t\t\t\n\t\t\tif (isset($params['orderby']) && $params['orderby'] == 'view_count') {\n\t\t\t\t\t$select = $select\n\t\t\t\t\t\t\t\t\t\t\t\t\t->order($rName .'.view_count DESC')\n\t\t\t\t\t\t\t\t\t\t\t\t\t->order($rName .'.creation_date DESC');\n\t\t\t} elseif (isset($params['orderby']) && $params['orderby'] == 'member_count') {\n\t\t\t\t$select = $select\n\t\t\t\t\t\t\t\t\t\t\t\t->order($rName .'.member_count DESC');\n\t\t\t} elseif (isset($params['orderby']) && $params['orderby'] == 'creation_date') {\n\t\t\t\t$select = $select\n\t\t\t\t\t\t\t\t\t\t\t\t->order($rName .'.creation_date DESC');\n\t\t\t} elseif (isset($params['orderby']) && $params['orderby'] == 'starttime') {\n\t\t\t\t$select = $select\n\t\t\t\t\t\t\t\t\t\t\t\t->order(!empty($params['orderby']) ? $params['orderby'] . ' ASC' : $rName .'.starttime ASC');\n\t\t\t}\n\t\t\t\n\t\t $viewer_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n\t\t\tif(isset($params['show']) && $params['show'] == 'my_event') {\n\t\t\t\t$select->where($rName . '.user_id = ?', $viewer_id);\n\t\t\t}\n\t\t\telseif(isset($params['show']) && $params['show'] == 'past_event') {\n\t\t\t\t$select->where(\"$rName.endtime < FROM_UNIXTIME(?)\", time());\n\t\t\t}\n\t\t\telseif((isset($params['show']) && $params['show'] == 'upcoming_event')) {\n\t\t\t\t$select->where(\"$rName.endtime > FROM_UNIXTIME(?)\", time());\n\t\t\t\t$select->order($rName . '.starttime ASC');\n\t\t\t}\n\t\t\telseif ((isset($params['show']) && $params['show'] == 'sponsored_event')) {\n\t\t\t\t\t\n\t\t\t\t\t$select->where($pagePackageTableName . '.price != ?', '0.00');\n\t\t\t\t\t$select->order($pagePackageTableName . '.price' . ' DESC');\n\t\t\t}\n\t\t\telseif (isset($params['show']) && $params['show'] == 'Networks') {\n\t\t\t\t\t$select = $tablePage->getNetworkBaseSql($select, array('browse_network' => 1));\n\n\t\t\t}\n\t\t\telseif((isset($params['show']) && $params['show'] == 'featured')) {\n\t\t\t\t$select = $select\n\t\t\t\t\t\t\t\t\t\t\t\t->where($rName . '.featured = ?', 1)\n\t\t\t\t\t\t\t\t\t\t\t\t->order($rName .'.creation_date DESC');\n\t\t\t}\n\t\t\telseif (isset($params['show']) && $params['show'] == 'my_like') {\n\t\t\t\t$likeTableName = Engine_Api::_()->getDbtable('likes', 'core')->info('name');\n\t\t\t\t$viewer_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n\t\t\t\t$select\n\t\t\t\t\t\t\t\t->join($likeTableName, \"$likeTableName.resource_id = $tablePageName.page_id\")\n\t\t\t\t\t\t\t\t->where($likeTableName . '.poster_type = ?', 'user')\n\t\t\t\t\t\t\t\t->where($likeTableName . '.poster_id = ?', $viewer_id)\n\t\t\t\t\t\t\t\t->where($likeTableName . '.resource_type = ?', 'sitepage_page');\n\t\t\t}\n\t\t\t\n\t\t $select = $select\n\t\t\t\t\t\t\t\t\t\t\t->where($tablePageName . '.search = ?', '1')\n\t\t\t\t\t\t\t\t\t\t\t->where($tablePageName . '.closed = ?', '0')\n\t\t\t\t\t\t\t\t\t\t\t->where($tablePageName . '.approved = ?', '1')\n\t\t\t\t\t\t\t\t\t\t\t->where($tablePageName . '.declined = ?', '0')\n\t\t\t\t\t\t\t\t\t\t\t->where($tablePageName . '.draft = ?', '1');\n\t\t\tif (Engine_Api::_()->sitepage()->hasPackageEnable()) {\n\t\t\t\t$select->where($tablePageName . '.expiration_date > ?', date(\"Y-m-d H:i:s\"));\n\t\t\t}\n\n// \t\tif (isset($params['order_by']) && !empty($params['order_by'])) {\n// \t\t\t// Endtime\n// \t\t\tif($params['order_by'] == 1 ) {\n// \t\t\t\t$select->where(\"endtime <= FROM_UNIXTIME(?)\", time());\n// \t\t\t} elseif($params['order_by'] == 2 ) {\n// \t\t\t\t$select->where(\"endtime > FROM_UNIXTIME(?)\", time());\n// \t\t\t}\n// \t\t}\n\n // Convert times\n// $viewer = Engine_Api::_()->user()->getViewer();\n// $oldTz = date_default_timezone_get();\n// date_default_timezone_set($viewer->timezone); \n// $start = strtotime($params['starttime']['date']);\n// $end = strtotime($params['endtime']['date']);\n// date_default_timezone_set($oldTz);\n// $startTime = date('Y-d-m', $start);\n// $endTime = date('Y-d-m', $end);\n\n\n\n\t\tif(!empty($params['starttime']['date'])) {\n\t\t $startTime = date(\"Y-m-d\", strtotime($params['starttime']));\n\t\t\t$select->where($rName . '.starttime >= ?', $startTime);\n \t}\n\n\t\tif(!empty($params['endtime']['date'])) {\n\t\t $endTime = date(\"Y-m-d\", strtotime($params['endtime']));\n $select->where($rName . '.endtime <= ?', $endTime);\n \t}\n\t\treturn $select;\n\t}",
"public function event_insert_page()\n\t{\n\t\t$data['title'] \t\t= 'News & Event';\n\t\t$data['page_path'] \t= 'admin/event/event_insert';\n\t\t$this->load->view('admin/master', $data); \n\t}",
"public function onPageIndexChanged($param)\n\t{\n\t\t$this->raiseEvent('OnPageIndexChanged',$this,$param);\n\t}",
"function BeforeProcessList(&$conn,&$pageObject)\n{\n\n\t\tglobal $transjawatan;\n\n$sql = \"SELECT * FROM `pejawatan_ref_position`\";\n$rs = CustomQuery($sql);\nwhile($data = db_fetch_array($rs))\n{\n$transjawatan[$data['id']] = $data['name'];\n}\n\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n;\t\t\n}",
"function alumni_event() {\n\t\tif (addon_status('alumni')) {\n\t\t\t$page_data['page_name'] = 'alumni_event';\n\t\t\t$page_data['page_title'] = get_phrase('alumni_event');\n\t\t\t$this->load->view('frontend/'.$this->theme.'/index', $page_data);\n\t\t}else{\n\t\t\tredirect(site_url(), 'refresh');\n\t\t}\n\t}",
"public function onPageLoad($event) {\n if (Config::get('log.pageload') == true) {\n if (!is_array($event)) {\n $event = array($event);\n }\n Log::debug('Page Loading', $event);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function locationReport menampilkan view locationReport param: | public function locationReport()
{
$lokasi = Lokasi::all(); //memanggil semua data di tabel lokasi
$data = [
'page'=> 'inventaris',
'lokasi' => $lokasi // data lokasi diparse dengan alias 'asset'
];
return view('karyawan.inventaris.asset.locationReport', $data); // Menampilkan view locationReport dan menambahkan variabel $data ke tampilan tadi
} | [
"public function locationReport()\n {\n return view('cm_reports',array(\n\t 'title'=>'Location Report',\n\t 'reports'=>$this->reports,\n\t 'locations' => \\App\\Location::all()));\n }",
"public function Reports(){\n\n $data['page']= \"Admin/reports_vw\";\n\n $data['provinces']=$this->ReportModel->get_record('province');\n\n $this->load->view('common/template',$data);\n\n\n }",
"public function asset_log_report()\n\t{\n\t\t$data['page_title'] = \"Master Tipe Asset\";\n\t\t$data['page_tree'] = \"report\";\n\t\t$data['page_menu'] = \"log\";\n\n\t\t$this->load->view('laporan-log',$data);\n\t}",
"public function report_listing()\n\t{\n\t\t//to move query functions to model,wanna complete this today so...why worry\n\t\t// same conundrum as when making inventory haha\n\t\t$report_listing_data = $this->get_report_listing_data();\n\n\t\t// echo \"<pre>\";print_r($inventory);exit;\n\t\t$data['report_listing_data'] = $report_listing_data;\n\t\t$data['title'] = \"Report Listing\";\n\t\t$data['banner_text'] = \"Report Listing Management\";\n\t\t$view = 'shared_files/template/dashboard_v';\n\t\t$data['content_view'] = \"Admin/report_listing_v\";\n\t\t$this->load->view($view,$data);\n\t}",
"public function locationAction(){\n\t\t\t$storeCol = Mage::getModel('storelocator/storelocator')->getCollection()\n\t\t\t\t->addFieldToFilter('status',1)\n\t\t\t\t->setOrder('sortorder', 'ASC');\n\t\t\t$xml = '<?xml version=\"1.0\"?>\n\t\t\t<markers>';\n if($storeCol->count()){\n foreach($storeCol as $storeData){\t\n $countryname = Mage::helper('storelocator')->getCountryNameById($storeData['country']);\n\t\t\t\t$xml.='<marker storeid=\"'.$storeData->getId().'\" name=\"'.$storeData->getName().'\" lat=\"'.$storeData->getLatitude().'\" lng=\"'.$storeData->getLongitude().'\" category=\"'.$storeData->getCategory().'\" address=\"'.$storeData->getAddress().'\" city=\"'.$storeData->getCity().'\" state=\"'.$storeData->getState().'\" postal=\"'.$storeData->getZipcode().'\" country=\"'.$countryname.'\" phone=\"'.$storeData->getPhone().'\" email=\"'.$storeData->getEmail().'\" web=\"'.$storeData->getWebUrl().'\" hours1=\"'.$storeData->getHours1().'\" hours2=\"'.$storeData->getHours2().'\" hours3=\"'.$storeData->getHours3().'\" storeimage=\"'.$storeData->getStoreimage().'\" fax=\"'.$storeData->getFax().'\" featured=\"\" />';\n\t\t\t } \n }else{\n $xml.= '<marker name=\"No Record Found.\"/>';\n }\n\t\t\t\t\t\t\n\t\t\techo $xml.='</markers>';\t\t\t\n\t}",
"function servicioreportes()\r\n {\r\n $data['sistema'] = $this->sistema;\r\n \r\n if($this->acceso(142)){\r\n $data['page_title'] = \"Reportes\";\r\n $data['_view'] = 'reportes/servicioreportes';\r\n\r\n $this->load->view('layouts/main',$data);\r\n\r\n }\r\n\r\n\r\n }",
"function report(){\n\t\tif(!$this->User_model->isApprover())\n\t\t\t$this->logout();\n\t\t\n\t\t$data['title'] = 'PAC PR SYSTEM - REPORTS';\n\t\t$data['content'] = $this->load->view('report_view', null, true);\n\t\t$this->load->view('template_view_ash', $data);\n\t}",
"public function printLocationReport (Request $request)\n {\n $report = Asset::where('lokasi_id', $request->input('lokasi'))->get(); //memanggil data asset sesuai dengan lokasi\n $lokasi = $request->input('lokasi');\n\n $data = [\n 'report' => $report, //data asset di parse dengan alias 'report'\n 'lokasi' => $lokasi,\n ];\n\n $pdf = PDF::loadView('karyawan.inventaris.asset.report',$data); //mencetak report dengan template report.blade.php dengan data $report\n return $pdf->inline('dokumen.pdf'); //mereturn download link file location report dgn filename 'dokumen.pdf'\n }",
"protected abstract function getTravelReport();",
"function servicioreportes()\r {\r\r if($this->acceso(142)){\r $data['page_title'] = \"Reportes\";\r $data['_view'] = 'reportes/servicioreportes';\r\r $this->load->view('layouts/main',$data);\r\r }\r\r\r }",
"public function allLocationAction() {\r\n\r\n //USER VALIDATION\r\n if (!$this->_helper->requireUser()->isValid())\r\n return;\r\n\r\n //LOCAITON ENABLE OR NOT\r\n if (!Engine_Api::_()->sitestore()->enableLocation()) {\r\n return $this->_forward('requireauth', 'error', 'core');\r\n }\r\n\r\n //GET NAVIGATION\r\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('sitestoreproduct_main');\r\n\r\n $this->view->sitestores_view_menu = 4;\r\n\r\n //GET STORE ID, STORE OBJECT AND THEN CHECK STORE VALIDATION\r\n $this->view->store_id = $store_id = $this->_getParam('store_id');\r\n\r\n //$location_id = $this->_getParam('location_id');\r\n $this->view->sitestore = $sitestore = Engine_Api::_()->getItem('sitestore_store', $store_id);\r\n if (empty($sitestore)) {\r\n return $this->_forward('notfound', 'error', 'core');\r\n }\r\n\r\n //START MANAGE-ADMIN CHECK\r\n $isManageAdmin = Engine_Api::_()->sitestore()->isManageAdmin($sitestore, 'edit');\r\n if (empty($isManageAdmin)) {\r\n return $this->_forward('requireauth', 'error', 'core');\r\n }\r\n\r\n $isManageAdmin = Engine_Api::_()->sitestore()->isManageAdmin($sitestore, 'map');\r\n if (empty($isManageAdmin)) {\r\n return $this->_forward('requireauth', 'error', 'core');\r\n }\r\n //END MANAGE-ADMIN CHECK\r\n if (!empty($sitestore->location)) {\r\n $mainLocationId = Engine_Api::_()->getDbtable('locations', 'sitestore')->getLocationId($sitestore->store_id, $sitestore->location);\r\n $this->view->mainLocationObject = Engine_Api::_()->getItem('sitestore_location', $mainLocationId);\r\n $value['mainlocationId'] = $mainLocationId;\r\n }\r\n $value['id'] = $sitestore->getIdentity();\r\n $value['mapshow'] = 'Map Tab';\r\n $store = $this->_getParam('store');\r\n\r\n $this->view->location = $paginator = Engine_Api::_()->getDbtable('locations', 'sitestore')->getLocation($value);\r\n\r\n $paginator->setItemCountPerPage(10);\r\n $this->view->paginator = $paginator->setCurrentPageNumber($store);\r\n }",
"function comprareportes()\r\r {\r\r if($this->acceso(137)){\r\r\r $data['page_title'] = \"Reportes\";\r $data['_view'] = 'reportes/comprareportes';\r\r $this->load->view('layouts/main',$data);\r\r }\r\r \r }",
"function trailreport() \n\t {\n\t $data['pagetitle'] = 'Uploaded KML';\n\t\t$data['active_tab_kml'] = 'active';\n\t\t$data['user_id'] = $this->userId;\n\t\t$data['basesegment'] = $this->uri->segment(2);\n\t\t$data['segment'] = $this->uri->segment(3);\t\n\t\t$query =$this->db->query('SELECT county_trail_report.* FROM `county_trail_report` WHERE `county_trail_report`.`upload_by_id` = '.$data['user_id'].' group by `county_trail_report`.`county_name`');\n\t\t$data['trailList']= $query->result();\n\t\t\n\t\t$this->load->view('user/traillist/trailreport',$data);\n\t}",
"public function storedetaillocationAction(){\n $id = $this->getRequest()->getParam('id');\n $storeData = Mage::getModel('storelocator/storelocator')->load($id);\n if($storeData && $storeData->getId()){\n $countryname = Mage::helper('storelocator')->getCountryNameById($storeData->getCountry());\n\t\t\t$xml = '<?xml version=\"1.0\"?>\n\t\t\t<markers>';\n\t\t\t$xml .='<marker storeid=\"'.$storeData->getId().'\" name=\"'.$storeData->getName().'\" lat=\"'.$storeData->getLatitude().'\" lng=\"'.$storeData->getLongitude().'\" category=\"'.$storeData->getCategory().'\" address=\"'.$storeData->getAddress().'\" city=\"'.$storeData->getCity().'\" state=\"'.$storeData->getState().'\" postal=\"'.$storeData->getZipcode().'\" country=\"'.$countryname.'\" phone=\"'.$storeData->getPhone().'\" email=\"'.$storeData->getEmail().'\" web=\"'.$storeData->getWebUrl().'\" hours1=\"'.$storeData->getHours1().'\" hours2=\"'.$storeData->getHours2().'\" hours3=\"'.$storeData->getHours3().'\" storeimage=\"'.$storeData->getStoreimage().'\" fax=\"'.$storeData->getFax().'\" featured=\"\" />';\n\t\t\techo $xml.='</markers>';\t\t\t\n }else{\n echo $xml = '<?xml version=\"1.0\"?>\n\t\t\t <markers><marker name=\"No Record Found.\"/></markers>'; \n }\n\t}",
"public function display_location_list(){\n\t\tif ($this->checkLogin('CA') == ''){\n\t\t\tredirect('deals_crm');\n\t\t}else {\n\t\t\t$this->data['heading'] = 'Location List';\n\t\t\t$condition = array();\n\t\t\t$this->data['locationList'] = $this->location_model->get_all_details(LOCATIONS,$condition);\n\t\t\t$this->load->view('crmadmin/country/display_location',$this->data);\n\t\t}\n\t}",
"public function cmReportUpdate()\n {\n return view('cm_reports',array(\n\t 'title'=>'New Job',\n\t 'reports'=>$this->reports,\n\t 'locations' => \\App\\Location::all()\n\t ));\n }",
"public function crystal_report_view()\n\t{\n\t\t$this->data['crystal_report']=$this->reports_personnel_schedule_model->crystal_report_view();\n\t\t$this->load->view('employee_portal/report_personnel/schedule/crystal_report',$this->data);\n\t}",
"function global_report(){\n $replace['browser_title'] = 'Tx Xchange: Select Report Type';\n $replace['header'] = $this->build_template($this->get_template(\"header\"));\n $replace['sidebar'] = $this->sidebar() ;\n $replace['heading'] = 'Report Type';\n $replace['breadcrumb'] = $this->breadcrumb('global_report');\n $replace['report_type'] = $this->value('report_type') != \"\"?$this->value('report_type'):\"one\";\n $replace['body'] = $this->build_template($this->get_template(\"global_report\"),$replace);\n $this->output = $this->build_template($this->get_template(\"main\"),$replace);\n }",
"public function viewReportsByPlacement() {\n\n $data = json_decode($this->input->post_get('data'), true);\n\n $range = $this->modReports->range(urldecode($data['range']), $data['start'], $data['end']);\n\n $result = $this->modPlacements->viewReportsByPlacement($data['partner'], $data['placementId'], $range['start'], $range['end'], $data['page'], $data['limit']);\n\n $reports['reports'] = $result;\n echo json_encode($reports);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function returns the current instance of logger, if no instance exists it creates one | public static function getInstance()
{
if (!self::$instance) {
self::$instance = new logger;
}
return self::$instance;
} | [
"public static function getInstance()\n {\n if (!self::$instance)\n {\n self::$instance = new logger;\n }\n return self::$instance;\n }",
"private function getLogger()\r\n {\r\n if ($this->logger === null) {\r\n $this->logger = $this->create();\r\n }\r\n\r\n return $this->logger;\r\n }",
"public static function instance() {\n\t\treturn new Logger();\n\t}",
"public static function getInstance() {\n if (!isset(self::$instance)) {\n self::$instance = new Logger();\n }\n return self::$instance;\n }",
"protected function getLogger()\n {\n // errors.\n if (is_null($this->logger)) {\n $this->logger = new NoLog();\n }\n return $this->logger;\n }",
"function logger_instance($name = null)\n {\n if ($name instanceof LoggerInterface) {\n return $name;\n }\n\n return Log::getLog($name);\n }",
"static public function get_instance( )\n\t{\n\t\tif (is_null(self::$_instance)) {\n\t\t\tself::$_instance = new Log( );\n\t\t}\n\n\t\treturn self::$_instance;\n\t}",
"public static function getInstance() : Logger\n {\n static $instance = new Logger;\n return $instance;\n }",
"public function logger() {\n\t\tif (!$this->logger) {\n\t\t\t$this->logger = new Logger();\n\t\t}\n\t\treturn $this->logger;\n\t}",
"protected function getLogger()\n {\n if (!$this->logger) {\n $this->logger = new NullLogger();\n }\n return $this->logger;\n }",
"protected function getLogger()\n {\n return $this->logger ?: new NullLogger();\n }",
"public static function create()\n {\n return new Logger();\n }",
"public function getLogger()\n {\n if (empty($this->logger)) {\n $this->logger = PMSELogger::getInstance();\n }\n\n return $this->logger;\n }",
"function GetLogger()\n\t{\n\t\tif ($this->log == NULL)\n\t\t{\n\t\t\t$this->log = new Monolog\\Logger('name');\n\t\t\t$this->log->pushHandler(new Monolog\\Handler\\StreamHandler(__FILE__ . \".log\", Monolog\\Logger::INFO));\n\t\t}\n\t\treturn $this->log;\n\t}",
"protected function getLogger()\n {\n if (!$this->_logger) {\n $this->_logger = PayPal\\Core\\PayPalLoggingManager::getInstance(__CLASS__);\n }\n\n return $this->_logger;\n }",
"public static function instance()\n\t{\n\t\t// make sure we have an instance\n\t\tstatic::$monolog or static::_init();\n\n\t\t// return the created instance\n\t\treturn static::$monolog;\n\t}",
"public function getLogger()\n {\n\n if (!$this->logger) {\n $sl = $this->getServiceLocator();\n // check we were able to get a service locator\n $this->logger = $sl->get('logger');\n }\n return $this->logger;\n }",
"public function getLogger()\n {\n if ($this->_logger === null) {\n $this->setLogger(Yii::getLogger());\n }\n\n return $this->_logger;\n }",
"public function getLogger() : Logger {\n return $this->logger;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/return new AuthPlugin( $container>get(AuthenticationService::class), $container>get(UsersTable::class) ); | public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
$authPlugin = new AuthPlugin();
if ($container->has(AuthenticationService::class)) {
// set the dependency
$authPlugin->setAuthenticationService(
$container->get(AuthenticationService::class)
);
} elseif ($container->has(AuthenticationServiceInterface::class)) {
$authPlugin->setAuthenticationService(
$container->get(AuthenticationServiceInterface::class)
);
}
if ($container->has(UsersTable::class)) {
$authPlugin->setUsersTable(
$container->get(UsersTable::class)
);
}
return $authPlugin;
} | [
"public function getAuthService();",
"protected function getAuthService()\n {\n return $this->services['auth'] = new \\phpbb\\auth\\auth();\n }",
"protected function getPlugin () {\r\n\t\treturn $this->mb->get('Pkj\\Minibase\\Plugin\\AuthPlugin\\AuthPlugin');\r\n\t}",
"public function __construct() {\n global $conf;\n // call parent\n # parent::__constructor();\n\n //check if there is already an authentication plugin selected\n if( isset($_SESSION[DOKU_COOKIE]['plugin']['authchained']['module']) &&\n !empty($_SESSION[DOKU_COOKIE]['plugin']['authchained']['module']) ) {\n\n //get previously selected authentication plugin\n $this->chained_auth =& plugin_load('auth',$_SESSION[DOKU_COOKIE]['plugin']['authchained']['module']);\n if ( is_null($this->chained_auth) || !$this->chained_auth->success ) {\n $this->success = false;\n }\n }\n\n //get authentication plugins\n if($this->getConf('authtypes')){\n foreach(explode(\":\",$this->getConf('authtypes')) as $tmp_plugin){\n $tmp_class =& plugin_load('auth',$tmp_plugin);\n\n if ( !is_null($tmp_class) || $tmp_class->success ) {\n $tmp_module = array($tmp_plugin,$tmp_class);\n array_push($this->chained_plugins, $tmp_module);\n $this->any_external |= $tmp_class->canDo('external');\n } else {\n msg(\"Problem constructing $tmp_plugin\",-1);\n $this->success = false;\n }\n }\n } else {\n $success = false;\n }\n\n // If defined, instantiate usermanager authtype.\n // No need to check for duplicates, \"plugin_load\" does that for us.\n if($this->getConf('usermanager_authtype')){\n $this->usermanager_auth =& plugin_load('auth',$this->getConf('usermanager_authtype'));\n if(is_null($this->usermanager_auth) || !$this->usermanager_auth->success ) {\n msg(\"Problem constructing usermanager authtype: \".$this->getConf('usermanager_authtype'),-1);\n $this->success = false;\n }\n } else {\n $this->usermanager_auth =& $this->chained_auth;\n }\n\n //debug\n // print_r($chained_plugins);\n }",
"public function __construct(){\n $this->auth = new AuthenticationService();\n }",
"protected function getService_AuthService()\n {\n return $this->services['service.auth'] = new \\SRC\\Service\\Auth(array('client_id' => '8ngYCiwuH0efEzgGQWcsLxuLqrkDwsgX', 'client_secret' => 'EY6J8-81adMpmSJwD1kddHbzcOSwDY2fUcCZ5MGkvNds9L2-TsycHCh6gsr1ZL24', 'domain' => 'dudich.auth0.com', 'scope' => 'openid email email_verified app_metadata iss sub aud exp iat', 'connection' => 'Username-Password-Authentication'));\n }",
"public function getPlugin()\n {\n $plugin = new GlassOnion_Controller_Plugin_AccessControl();\n $plugin->setAcl($this->getAcl());\n $plugin->setAccessDeniedPage($this->getLoginPage());\n $role = $this->getRole();\n if (null != $role) {\n $plugin->setRole($role);\n }\n return $plugin;\n }",
"public function __construct(){\n parent::__construct();\n $app = App::getInstance();\n $this->auth = new DBAuth($app->getDb());\n }",
"function SugarAuthenticate()\n\t{\n\t // check in custom dir first, in case someone want's to override an auth controller\n\t SugarAutoLoader::requireWithCustom('modules/Users/authentication/'.$this->authenticationDir.'/' . $this->userAuthenticateClass . '.php');\n\n $this->userAuthenticate = new $this->userAuthenticateClass();\n\t}",
"protected function getAction_AuthService()\n {\n return $this->services['action.auth'] = new \\SRC\\Action\\Auth($this->get('service.auth'));\n }",
"public function authentication(){\n }",
"function ZkAuthImplementor($options) {\n /* Instantiate the Authentication Implementor Here! */\n }",
"public static function getAuthPlugins()\n\t{\n\t\t$pls = $GLOBALS['ilPluginAdmin']->getActivePluginsForSlot(\n\t\t\t\tIL_COMP_SERVICE,\n\t\t\t\t'Authentication',\n\t\t\t\t'authhk'\n\t\t);\n\t\t$pl_objs = array();\n\t\tforeach($pls as $pl)\n\t\t{\n\t\t\t$pl_objs[] = $GLOBALS['ilPluginAdmin']->getPluginObject(\n\t\t\t\t\tIL_COMP_SERVICE,\n\t\t\t\t\t'Authentication',\n\t\t\t\t\t'authhk',\n\t\t\t\t\t$pl\n\t\t\t);\n\t\t}\n\t\treturn $pl_objs;\n\t}",
"function &getAuth($jname)\r\n {\r\n static $auth_instances;\r\n if (!isset($auth_instances )) {\r\n $auth_instances = array();\r\n }\r\n\r\n //only create a new authentication instance if it has not been created before\r\n if (!isset($auth_instances[$jname] )) {\r\n $filename = JPATH_ADMINISTRATOR.DS.'components'.DS.'com_jfusion'.DS.'plugins'.DS. $jname .DS.'auth.php';\r\n\t\t if (file_exists($filename)){\r\n\t\t\t\t //load the Abstract Auth Class\r\n\t\t\t\trequire_once(JPATH_ADMINISTRATOR .DS.'components'.DS.'com_jfusion'.DS.'models'.DS.'model.abstractauth.php');\r\n\t\t\t\t//load the plugin class itself\r\n \trequire_once($filename);\r\n $class = \"JFusionAuth_\" . $jname;\r\n $auth_instances[$jname]= new $class;\r\n return $auth_instances[$jname];\r\n \t\t} else {\r\n \t\t$result = false; // prevent php warning\r\n \t\t\treturn $result;\r\n \t\t}\r\n } else {\r\n return $auth_instances[$jname];\r\n }\r\n }",
"public function newInstance()\n {\n return new Auth($this->segment);\n }",
"public function getAuthHandler(): AuthInterface\n {\n return $this->auth;\n }",
"private function useAuthentication() {\n\t\tQuantum::registry(\"authentication_class\",$this->config['authentication']['class']);\n\t\tQuantum::registry(\"authentication_sign\",$this->config['authentication']['sign']);\n\t\tQuantum::registry(\"authentication_timeout\",$this->config['authentication']['logintimeout']);\n\n\t\t$className = explode(\".\",Quantum::registry(\"authentication_class\"));\n\t\t$className = $className[count($className) - 1];\n\t\t\n\t\tQuantum::registry(\"authentication_className\",$className);\n\t\tuses (\"core.base.Authentication\");\n\n\t\ttrace(\"using authentication module '\".$className.\"'\",$this);\n\n\t\tif ($this->config['authentication']['create']) {\n\t\t\tuses (Quantum::registry(\"authentication_class\"));\n\t\t\ttrace(\"creating authentication class '\".$className.\"'\",$this);\n\t\t\t$this->_authentication = new $className;\n\t\t\tQuantum::registry(\"auth\",$this->_authentication->getClassName());\n\t\t}\n\t}",
"public static function factory() {\n\t\treturn new Auth;\n\t}",
"public function __construct()\n {\n parent::__construct();\n $this->import('BackendUser', 'User');\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the offset from the origin timezone to the remote timezone, in seconds. | function get_timezone_offset($remote_tz, $origin_tz = null) {
if($origin_tz === null) {
if(!is_string($origin_tz = date_default_timezone_get())) {
return false; // A UTC timestamp was returned -- bail out!
}
}
$origin_dtz = new DateTimeZone($origin_tz);
$remote_dtz = new DateTimeZone($remote_tz);
$origin_dt = new DateTime("now", $origin_dtz);
$remote_dt = new DateTime("now", $remote_dtz);
$offset = $origin_dtz->getOffset($origin_dt) - $remote_dtz->getOffset($remote_dt);
return $offset;
} | [
"function tz_offset() {\n $origin_tz = date_default_timezone_get();\n $origin_dtz = new DateTimeZone($origin_tz);\n $remote_dtz = new DateTimeZone('UTC');\n $origin_dt = new DateTime(\"now\", $origin_dtz);\n $remote_dt = new DateTime(\"now\", $remote_dtz);\n $offset = $origin_dtz->getOffset($origin_dt) - $remote_dtz->getOffset($remote_dt);\n return $offset;\n}",
"function timezone_offset($remote_tz = 'America/Denver', $origin_tz = 'UTC')\n {\n return Date::getTimezoneOffset($remote_tz, $origin_tz);\n }",
"function get_timezone_offset($remote_tz, $origin_tz = null) {\n if($origin_tz === null) {\n if(!is_string($origin_tz = date_default_timezone_get())) {\n return false; // A UTC timestamp was returned -- bail out!\n }\n }\n $origin_dtz = new DateTimeZone($origin_tz);\n $remote_dtz = new DateTimeZone($remote_tz);\n $origin_dt = new DateTime(\"now\", $origin_dtz);\n $remote_dt = new DateTime(\"now\", $remote_dtz);\n $offset = $origin_dtz->getOffset($origin_dt) - $remote_dtz->getOffset($remote_dt);\n return $offset;\n }",
"function get_timezone_offset($remote_tz, $origin_tz = null)\n\t{\n\t\t$dst = $this->getDST($date='');\n\t\tif($origin_tz === null)\n\t {\n\t if(!is_string($origin_tz = date_default_timezone_get()))\n\t {\n\t return false; // A UTC timestamp was returned -- bail out!\n\t }\n\t }\n\t $origin_dtz = new DateTimeZone($origin_tz);\n\t $remote_dtz = new DateTimeZone($remote_tz);\n\t $origin_dt = new DateTime(\"now\", $origin_dtz);\n\t $remote_dt = new DateTime(\"now\", $remote_dtz);\n\t $offset = $origin_dtz->getOffset($origin_dt) - $remote_dtz->getOffset($remote_dt);\n\t $offset = $offset - ($dst*3600);\n\t\treturn $offset;\n\t}",
"public static function timezone_offset()\n {\n $remote_tz = 'America/Los_Angeles';\n $origin_tz = 'America/New_York';\n if (($origin_tz === null) && !is_string($origin_tz = date_default_timezone_get())) {\n return false; // A UTC timestamp was returned -- bail out!\n }\n $origin_dtz = new DateTimeZone($origin_tz);\n $remote_dtz = new DateTimeZone($remote_tz);\n $origin_dt = new DateTime(\"now\", $origin_dtz);\n $remote_dt = new DateTime(\"now\", $remote_dtz);\n $offset = $origin_dtz->getOffset($origin_dt) - $remote_dtz->getOffset($remote_dt);\n return $offset / 2400;\n }",
"public function getTimezoneOffset () {\n\t\treturn -(int)(((int)(date(\"Z\", (int)($this->__t))) / 60));\n\t}",
"function yourls_tzp_timezoned_offset($timezone = 'UTC') {\n $tz = new DateTime('now', new DateTimeZone($timezone));\n return $tz->getOffset()/3600;\n}",
"public function tz_offset_seconds(): int\n {\n return $this->tz_offset_seconds;\n }",
"function getTimezoneOffset() {\n\t\tglobal $wpdb;\n\t\t//calculate mysql timezone offset by converting MySQL's \n\t\t// NOW() to a timestamp and subtracting UTC current time\n\t\t// from it. Note: conversion to timestamp is affected by\n\t\t// PHP TZ setting, so remove that offset from calculation\n\t\t$tzoffset=false;\n\t\t$mysql_now = $wpdb->get_var(\"SELECT NOW() AS mysql_now\");\n\t\t$now = ((int)(time()/1800))*1800; //truncate to 1/2 hour\n\t\tif ($mysql_now!=\"\") {\n\t\t\tif (function_exists('date_timestamp_get')) {\n\t\t\t\t$mysql_dt = new DateTime($mysql_now);\n\t\t\t\t$mysql_time = $mysql_dt->getTimestamp();\n\t\t\t\t$adjust = $mysql_dt->getOffset();\n\t\t\t} else {\n\t\t\t\t$mysql_time = strtotime($mysql_now);\n\t\t\t\t$adjust = (int)date('Z');\n\t\t\t}\n\t\t\t$tzoffset = ((int)($mysql_time/1800))*1800 - $now;\n\t\t\tif (is_numeric($adjust)) $tzoffset += $adjust;\n\t\t}\n\t\treturn $tzoffset;\n\t}",
"public function getTimezoneOffset()\r\r\r\n\t{\r\r\r\n\t\t$timezoneId = $this->getTimezone();\r\r\r\n\t\tif(array_key_exists($timezoneId, $this->getTimezoneList()))\r\r\r\n\t\t{ \r\r\r\n\t\t\t$date = new Zend_Date();\r\r\r\n\t\t $date->setTimezone($timezoneId);\r\r\r\n\t\t\r\r\r\n\t\t\treturn (int) - $date->getGmtOffset();\r\r\r\n\t\t\t\r\r\r\n\t\t}\r\r\r\n\t\treturn 0;\r\r\r\n\t}",
"public static function getTimezoneOffset()\n {\n return + 2 * 60;\n }",
"private function getTimeZoneOffset()\n {\n if (null === $this->offset) {\n $time = new \\DateTime('now', new \\DateTimeZone($this->localeSettings->getTimeZone()));\n $this->offset = $time->format('P');\n }\n\n return $this->offset;\n }",
"public function getTimezoneOffset() {\n $timezone = $this->setupTimezone();\n $offset = 0;\n if ($timezone) {\n $dtz = new \\DateTimeZone($timezone);\n $dt = new \\DateTime('now', $dtz);\n $offset = $dtz->getOffset($dt);\n }\n return $offset;\n }",
"function getOffset() {\n\t\treturn ((float) $this->_offset) / 3600.0;\n\t}",
"public function getTimezoneoffset()\n {\n return $this->timezoneoffset;\n }",
"function core_datetime_offset($tz=0) {\n\t$n = (int)$tz;\n\t$m = $n % 100;\n\t$h = ($n-$m) / 100;\n\t$num = ($h * 3600) + ($m * 60);\n\treturn ( $num ? $num : 0 );\n}",
"public function getTimezoneOffset() {\r\n return $this->timezone_offset;\r\n }",
"public function getTimeZoneOffset() {\n\t\t$timezoneString = get_option( 'timezone_string' );\n\t\tif ( $timezoneString ) {\n\t\t\treturn $timezoneString;\n\t\t}\n\n\t\t$offset = (float) get_option( 'gmt_offset' );\n\t\t$hours = (int) $offset;\n\t\t$minutes = ( $offset - $hours );\n\t\t$sign = ( $offset < 0 ) ? '-' : '+';\n\t\t$absHour = abs( $hours );\n\t\t$absMins = abs( $minutes * 60 );\n\t\t$tzOffset = sprintf( '%s%02d:%02d', $sign, $absHour, $absMins );\n\n\t\treturn $tzOffset;\n\t}",
"public function getTzoffsetto()\n {\n return $this->tzoffsetto;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the TVShow's episode count | public function getTVShowEpisodeCount() {
return $this->_data['episode_count'];
} | [
"public function getEpisodesCount()\n {\n return $this->data['fields']['episodes_count'];\n }",
"public function getShowCountWithEpisodes(){\n\t\t$total = ORM::for_table('shows')->select_expr('COUNT(DISTINCT(shows.id)) AS shows_count')->join('episodes', 'shows.id = episodes.show_id')->find_one();\n return $total->shows_count;\n }",
"public function getNumEpisodes() {\n return $this->_data['number_of_episodes'];\n }",
"public function getEpisodeCount(){\n $e = mysql_query(\"SELECT count(*) as total FROM episodes\") or die(mysql_error());\n extract(mysql_fetch_array($e));\n return $total;\n }",
"public function getTvShowCount()\n {\n return $this->tvShowCount;\n }",
"public function getReleaseEpisodeCount()\n {\n return $this->releaseEpisodeCount;\n }",
"public static function totalEpisode($filters=array()){\n $episode = self::setFilters($filters);\n return $episode->count();\n }",
"public function getEpisodesWatched(): int\n {\n return $this->episodesWatched;\n }",
"function get_total_episode_num($series_id, $season, $episode){\n return $this->db->query(\"\n select\n count(*) as total\n from vs_series_links\n where series_id=$series_id\n and season = $season\n and episode = $episode\n\n \");\n \n }",
"protected function countMissingEpisodes() : int {\n $episodesCount = 0;\n foreach ($this->series as $series) {\n $expected = $series->episodesTotal();\n $actual = $series->episodesCount();\n if ($expected !== $actual) {\n $episodesCount += $expected - $actual;\n }\n }\n return $episodesCount;\n }",
"public function getNbSeasons()\n {\n\t\t$today = new \\DateTime('now');\n\t\t$maxNbSeason = 0;\n\t\tforeach($this->episodes as $key => $episode)\n\t\t{\n\t\t\tif($episode->getSeasonNumber() > $maxNbSeason AND $episode->getFirstAired() < $today)\n\t\t\t{\n\t\t\t\t$maxNbSeason = $episode->getSeasonNumber();\n\t\t\t}\n\t\t}\n return $maxNbSeason;\n }",
"public function get_video_count() {\n\t\t\t$video_count = $this->_wpdb->get_var( 'SELECT count( * ) FROM ' . $this->_videoinfotable . ' WHERE featured=1 and publish=1' );\n\t\t\treturn $video_count;\n\t\t}",
"static function countVideos()\n {\n $db = DB::getInstance();\n\n $req = $db->query('\n SELECT COUNT(*) as `videos_count` FROM videos\n ');\n\n if (!$req)\n {\n // Notify error\n return -1;\n }\n else\n {\n $count = $req->fetch()[0];\n return $count;\n }\n }",
"public function getNbEpisodesInSeason($season)\n {\n\t\t$today = new \\DateTime('now');\n\t\t$maxNbEpisode = 0;\n\t\tforeach($this->episodes as $key => $episode)\n\t\t{\n\t\t\tif($episode->getSeasonNumber() == $season AND $episode->getFirstAired() < $today)\n\t\t\t{\n\t\t\t\tif($episode->getEpisodeNumber() > $maxNbEpisode)\n\t\t\t\t{\n\t\t\t\t\t$maxNbEpisode = $episode->getEpisodeNumber();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n return $maxNbEpisode;\n }",
"public function get_countof_videocategories() { // function for getting settings data starts\n\t\t\tglobal $wpdb;\n\t\t\t$query = 'SELECT count( * ) FROM ' . $wpdb->prefix . 'hdflvvideoshare_playlist WHERE is_publish=1';\n\t\t\treturn $this->_wpdb->get_var ( $query );\n\t\t}",
"public function getSeasonsCount()\n {\n return $this->data['fields']['seasons_count'];\n }",
"public function getEpisodes(){\n\t\treturn $this->episodes;\n\t}",
"public function getTtnEpisode();",
"function getActivityCount()\n {\n $db = &atkGetDb();\n $result = $db->getrows(\"SELECT count(*) as activitycount FROM activity\");\n return $result[0]['activitycount'];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Computes a score for the given surplus compared to the given need. | private static function computeSurplusScore(HTMLRestrictions $surplus, HTMLRestrictions $needed): int {
// Compute a score for surplus elements, while taking into account how much
// impact each surplus element has:
$surplus_score = 0;
foreach ($surplus->getAllowedElements() as $tag_name => $attributes_config) {
// 10^6 per surplus tag.
if (!isset($needed->getAllowedElements()[$tag_name])) {
$surplus_score += pow(10, 6);
}
// 10^5 per surplus "any attributes allowed".
if ($attributes_config === TRUE) {
$surplus_score += pow(10, 5);
}
if (!is_array($attributes_config)) {
continue;
}
foreach ($attributes_config as $attribute_name => $attribute_config) {
// 10^4 per surplus wildcard attribute.
if (strpos($attribute_name, '*') !== FALSE) {
$surplus_score += pow(10, 4);
}
// 10^3 per surplus attribute.
else {
$surplus_score += pow(10, 3);
}
// 10^2 per surplus "any attribute values allowed".
if ($attribute_config === TRUE) {
$surplus_score += pow(10, 2);
}
if (!is_array($attribute_config)) {
continue;
}
foreach ($attribute_config as $allowed_attribute_value => $allowed_attribute_value_config) {
// 10^1 per surplus wildcard attribute value.
if (strpos($allowed_attribute_value, '*') !== FALSE) {
$surplus_score += pow(10, 1);
}
// 10^0 per surplus attribute value.
else {
$surplus_score += pow(10, 0);
}
}
}
}
return $surplus_score;
} | [
"function total_scores($scores, $penalty)\n\t{\n\t\t\n\t\t$min = 10.0;\n\t\t$max = $total = 0;\n\t\tforeach ($scores as $score) {\n\t\t\tif($min > $score) \n\t\t\t\t$min = $score;\n\t\t\tif($max < $score)\n\t\t\t\t$max = $score;\n\t\t\t$total += $score;\n\t\t}\n\t\t$total -= $penalty;\n\t\t$total -= ($min + $max);\n\t\treturn $total;\n\t}",
"function finalGrade($exam, $projects) {\n if($exam > 90 || $projects > 10) return 100;\n if($exam > 75 && $projects >= 5) return 90;\n if($exam > 50 && $projects >= 2) return 75;\n \n return 0;\n \n}",
"function calculateTermQualityPoints($clid,$semester,$year){\n //Initialize the temporary variables\n $totalhours=0;\n //Query to return the student's grades and credit hours\n $result = mysql_query(\"Select grade, sum(credit_hours) FROM(( Select grade, credit_hours FROM take T, class Cl WHERE T.grade IS NOT NULL and T.grade<>'I' and T.grade <> 'CR' and T.grade <> 'NC' and T.grade <> 'W' and T.clid = '$clid' and Cl.section_num = T.section_num and Cl.semester = T.semester and Cl.year = T.year and Cl.course_num = T.course_num and Cl.course_dept = T.course_dept and Cl.credit_hours IS NOT NULL and T.semester='$semester' and T.year='$year') UNION ALL (Select T.grade,Co.credit_hours FROM take T,course Co WHERE T.grade IS NOT NULL and T.grade<>'I' and T.grade <> 'NC' and T.grade <> 'W' and T.grade <> 'CR' and T.clid = '$clid' and T.course_dept = Co.course_dept and T.course_num = Co.course_num and T.semester='$semester' and T.year='$year' and NOT EXISTS(select * from class Cl WHERE Cl.course_dept = Co.course_dept and Cl.course_num = Co.course_num and Cl.credit_hours IS NOT NULL))) AS result GROUP BY grade;\") or die(mysql_error());\n //Find the quality points per class\n while($row = mysql_fetch_array($result)){\n //Is the grade an A?\n if($row['grade'] == 'A')\n //If so, increment totalhours by four times the sum of the credit hours\n $totalhours+=4*$row['sum(credit_hours)'];\n //Is the grade a B?\n else if ($row['grade']=='B')\n //If so, increment totalhours by 3 times the sum of the credit hours\n $totalhours+=3*$row['sum(credit_hours)'];\n //Is the grade a C?\n else if ($row['grade']=='C')\n //If so, increment totalhours by 2 times the sum of the credit hours\n $totalhours+=2*$row['sum(credit_hours)'];\n //Is the grade a D?\n else if ($row['grade']=='D')\n //If so, increment totalhours by the sum of the credit hours\n $totalhours+=1*$row['sum(credit_hours)'];\n }\n return $totalhours;\n}",
"function calculate_game_score(&$w_team, &$l_team)\n\t{\n\t\treturn 50 * (1-$this->winning_propability($w_team, $l_team, 0, 0));\n\t}",
"public function calculateManningScore()\n {\n // No skills required means all is covered.\n if(empty($this->skills)) {\n return 100;\n }\n\n // No people, no points.\n if(empty($this->people)) {\n return 0;\n }\n\n // Start at optimal score.\n $score = 100.0;\n\n // Count how covered each required skill is.\n $coverageCounts = array_map(\n function(Skill $skill)\n {\n return $this->countSkillCoverage($skill->id);\n },\n $this->skills\n );\n\n // Subtract for every skill that isn't covered.\n foreach($coverageCounts as $coverageCount) {\n if(0 === $coverageCount) {\n $score -= (100.0 / count($this->skills));\n }\n }\n\n // If all skills are covered, boost the score for excessive coverage.\n if(100.0 === $score) {\n foreach($coverageCounts as $coverageCount) {\n if($coverageCount > 1) {\n $score += (100.0 / count($this->skills)) * ($coverageCount - 1);\n }\n }\n }\n\n return round($score);\n }",
"function local_fitcheck_calc_grade($test, $data) {\n if ($data == 'null') {\n return 'null';\n }\n $maxminrange = $test->maxresult - $test->minresult;\n if ($test->method != 2) {\n if ($test->minmax) {\n $calcresult = (($maxminrange - ($data - $test->minresult)) / $maxminrange) * 5 + 1;\n } else {\n $calcresult = (($data - $test->minresult) / $maxminrange) * 5 + 1;\n }\n } else {\n if ($test->minmax) {\n $calcresult = (($maxminrange - ((0 - $test->maxresult) + $data)) / $maxminrange) * 5 + 1;\n } else {\n $calcresult = (((0 - $test->minresult) + $data) / $maxminrange) * 5 + 1;\n }\n }\n if ($calcresult > 6) {\n $calcresult = 6;\n } else if ($calcresult < 1) {\n $calcresult = 1;\n }\n return round($calcresult, 2);\n}",
"private function computeScore()\n {\n foreach ($this->duels as $coasterId => $duels) {\n $duelScores = array_map(\n function ($value) {\n if ($value == 0) {\n return 50;\n } elseif ($value > 0) {\n return 100;\n } else {\n return 0;\n }\n },\n $duels\n );\n\n $this->ranking[$coasterId] = array_sum($duelScores) / count($duelScores);\n }\n\n // Tri décroissant\n arsort($this->ranking);\n }",
"function fitness($coursesExpected, $coursesSuggested){\n \n $totalFitness = 0.0;\n\n //adds 1/the rank of the course in the list.\n foreach($coursesExpected as $course){\n $totalFitness += 1/(array_search($course,$coursesSuggested));\n }\n\n return $totalFitness;\n }",
"function get_gpa($score, $passedScore = 50)\n {\n $basePassedScore = 50;\n $interval = $basePassedScore - $passedScore;\n $reduceScoreInterval = ($interval) / 9;\n\n $scoreA = 85 - ($reduceScoreInterval * 3);\n $scoreBPlus = 80 - ($reduceScoreInterval * 1);\n $scoreB = 70 - ($reduceScoreInterval * 1);\n $scoreCPlus = 65 - ($reduceScoreInterval * 1);\n $scoreC = $passedScore;\n $scoreD = $scoreC - 5;\n $scoreE = $scoreD - 5;\n\n $gpa = \"\";\n\n if ($score >= $scoreA) {\n $gpa = \"4.0\";\n } else if ($score >= $scoreBPlus) {\n $gpa = \"3.5\";\n } else if ($score >= $scoreB) {\n $gpa = \"3.0\";\n } else if ($score >= $scoreCPlus) {\n $gpa = \"2.5\";\n } else if ($score >= $scoreC) {\n $gpa = \"2.0\";\n } else if ($score >= $scoreD) {\n $gpa = \"1.5\";\n } else if ($score >= $scoreE) {\n $gpa = \"1.0\";\n } else if ($score == \"N/A\") {\n $gpa = \"N/A\";\n } else {\n $gpa = \"0.00\";\n }\n\n return $gpa;\n }",
"function calculateQualityPoints($clid){\n //Initialize the temporary variables\n $totalhours=0;\n //Query to return the student's grades and credit hours\n $result = mysql_query(\"Select grade, sum(credit_hours) FROM(( Select grade, credit_hours FROM take T, class Cl WHERE T.grade IS NOT NULL and T.grade<>'I' and T.grade <> 'CR' and T.grade <> 'NC' and T.grade <> 'W' and T.clid = '$clid' and Cl.section_num = T.section_num and Cl.semester = T.semester and Cl.year = T.year and Cl.course_num = T.course_num and Cl.course_dept = T.course_dept and Cl.credit_hours IS NOT NULL) UNION ALL (Select S.grade, Co.credit_hours FROM spec_cred S, course Co WHERE S.grade IS NOT NULL and S.grade <> 'I' and S.grade <> 'CR' and S.grade <> 'NC' and S.grade <> 'W' and !S.transfer and S.clid = '$clid' and S.course_dept = Co.course_dept and S.course_num = Co.course_num) UNION ALL (Select T.grade,Co.credit_hours FROM take T,course Co WHERE T.grade IS NOT NULL and T.grade<>'I' and T.grade <> 'NC' and T.grade <> 'W' and T.grade <> 'CR' and T.clid = '$clid' and T.course_dept = Co.course_dept and T.course_num = Co.course_num and NOT EXISTS(select * from class Cl WHERE Cl.course_dept = Co.course_dept and Cl.course_num = Co.course_num and Cl.credit_hours IS NOT NULL))) AS result GROUP BY grade;\") or die(mysql_error());\n while($row = mysql_fetch_array($result)){\n //Is the grade an A?\n if($row['grade'] == 'A')\n //If so, increment totalhours by four times the sum of the credit hours\n $totalhours+=4*$row['sum(credit_hours)'];\n //Is the grade a B?\n else if ($row['grade']=='B')\n //If so, increment totalhours by 3 times the sum of the credit hours\n $totalhours+=3*$row['sum(credit_hours)'];\n //Is the grade a C?\n else if ($row['grade']=='C')\n //If so, increment totalhours by 2 times the sum of the credit hours\n $totalhours+=2*$row['sum(credit_hours)'];\n //Is the grade a D?\n else if ($row['grade']=='D')\n //If so, increment totalhours by the sum of the credit hours\n $totalhours+=1*$row['sum(credit_hours)'];\n }\n return $totalhours;\n}",
"public function get_my_final_score() {\n $query = $this->db->select_sum('robot_return')->select_sum('investment')->order_by('end_stamp', 'desc')->get_where('game_data', array(\n 'phase' => $this->config->item('phase'),\n 'user_id' => $this->getMyId(),\n ));\n if ($query->num_rows() == 0) {\n return '0';\n }\n $result = $query->result_array();\n $invested = intval($result[0]['investment']);\n $saved = intval($this->config->item('credits') - $invested);\n return $result[0]['robot_return'] + $saved;\n }",
"private function score_alcohol_use() {\t\t\t\t\t\t//&&& no alcohol use section in scoring\r\n\t\t$data = $this->data['alcohol_use'];\r\n\t\tif($this->demographics['gender']==\"M\"){\r\n\t\t\t$q39=$this->scoreValue(array(5,4,3,2,1),$data['q39']);\r\n\t\t}else{\r\n\t\t\t$q39=$this->scoreValue(array(5,3,1,1,1),$data['q39']);\r\n\t\t}\r\n\t\t$q40=$this->scoreValue(array(1,5),$data['q40']);\r\n\t\t$ob=new stdClass();\r\n\t\t$ob->total=0;\r\n\t\t$ob->data=array('q39'=>array($q39,.6),\r\n\t\t\t\t\t\t'q40'=>array($q40,.4));\r\n\r\n\t\tforeach($ob->data as &$rec){\r\n\t\t\t$rec[2] = $rec[0] * $rec[1];\r\n\t\t\t$ob->total += $rec[2];\r\n\t\t}\r\n\t\treturn $ob;\r\n\t}",
"function emarking_calculate_grade($emarking, $totalscore, $totalrubricscore) {\n if (isset($emarking->adjustslope) && $emarking->adjustslope) {\n $finalgrade = min($emarking->grade,\n ((($emarking->adjustslopegrade - $emarking->grademin) / $emarking->adjustslopescore) * $totalscore) +\n $emarking->grademin);\n } else {\n $finalgrade = ((($emarking->grade - $emarking->grademin) / $totalrubricscore) * $totalscore) + $emarking->grademin;\n }\n return $finalgrade;\n}",
"function calc_dream_mp_score_a($db, $dreamid, $personid) {\n global $pwpdo;\n $query = \"select pw_vote.vote as mpvote, pw_dyn_dreamvote.vote as dreamvote from\n pw_vote, pw_dyn_dreamvote, pw_division, pw_mp where\n pw_vote.division_id = pw_division.division_id and\n pw_dyn_dreamvote.division_number = pw_division.division_number and\n pw_dyn_dreamvote.division_date = pw_division.division_date\n and pw_vote.mp_id = pw_mp.mp_id\n and pw_mp.person = ? and pw_dyn_dreamvote.dream_id = ?\";\n\n $qrowarray=$pwpdo->fetch_all_rows($query,array($personid,$dreamid));\n $t = 0.0;\n $c = 0.0;\n foreach ($qrowarray as $qrow)\n {\n $weight = 1;\n $mpvote = $qrow['mpvote'];\n $mpvote = str_replace(\"tell\", \"\", $mpvote);\n $dreamvote = $qrow['dreamvote'];\n if ($dreamvote == \"aye3\" or $dreamvote == \"no3\") {\n $dreamvote = str_replace(\"3\", \"\", $dreamvote);\n $weight = 3;\n }\n $t += $weight;\n\n if ($mpvote == $dreamvote)\n $c += $weight;\n elseif ($mpvote == \"both\" or $dreamvote == \"both\")\n $c = $c + ($weight / 2);\n }\n\n return array($c, $t);\n}",
"function grade($grade){\r\n\t\t$points;\r\n\t\tif($grade === \"A+\" || $grade === \"A\" || $grade === \"a\" || $grade === \"a+\"){\r\n\t\t\t$points = 4.00;\r\n\t\t}else if($grade === \"A-\" || $grade === \"a-\"){\r\n\t\t\t$points = 3.70;\r\n\t\t}else if($grade === \"B+\" || $grade === \"b+\"){\r\n\t\t\t$points = 3.30;\r\n\t\t}else if($grade === \"B\" || $grade === \"b\"){\r\n\t\t\t$points = 3.00;\r\n\t\t}else if($grade === \"B-\" || $grade === \"b-\"){\r\n\t\t\t$points = 2.70;\r\n\t\t}else if($grade === \"C+\" || $grade === \"c+\"){\r\n\t\t\t$points = 2.30;\r\n\t\t}else if($grade === \"C\" || $grade === \"c\"){\r\n\t\t\t$points = 2.00;\r\n\t\t}else if($grade === \"C-\" || $grade === \"c-\"){\r\n\t\t\t$points = 1.70;\r\n\t\t}else if($grade === \"D+\" || $grade === \"d+\"){\r\n\t\t\t$points = 1.30;\r\n\t\t}else if($grade === \"D\" || $grade === \"d\"){\r\n\t\t\t$points = 1.00;\r\n\t\t}else if($grade === \"E\" || $grade === \"e\" || $grade === \"D-\" || $grade === \"d-\" || $grade === \"E+\" || $grade === \"E-\" || $grade === \"e+\" || $grade === \"e-\"){\r\n\t\t\t$points = 0.00;\r\n\t\t}else{\r\n\t\t\t$points = 0.00;\r\n\t\t}\r\n\r\n\t\treturn $points;\r\n\t}",
"public function grade() {\n\t\t$listSubmission = $this->submissions;\n\t\t$correctAnswer = 0;\n\t\t$wrongAnswer = 0;\n\t\t$blankAnswer = 0;\n\t\t$totalScore = 0;\n\t\t\n\t\tforeach($listSubmission as $submission)\n\t\t\t$submission->grade();\n\t\t\n\t\t/*\n\t\tforeach($listSubmission as $submission) {\n\t\t\t$problem = $submission->problem;\n\n\t\t\tif($submission->answer == null || $submission->answer===\"\") {\n\t\t\t\t$blankAnswer++;\n\t\t\t\t$totalScore += $problem->blank_score;\n\t\t\t} else if($submission->answer == $problem->answer) {\n\t\t\t\t$correctAnswer++;\n\t\t\t\t$totalScore += $problem->correct_score;\n\t\t\t} else {\n\t\t\t\t$wrongAnswer++;\n\t\t\t\t$totalScore += $problem->wrong_score;\n\t\t\t}\n\t\t}\n\t\t*/\n\t\t$this->score = $totalScore;\n\t\t$this->correct = $correctAnswer;\n\t\t$this->wrong = $wrongAnswer;\n\t\t$this->blank = $blankAnswer;\n\t\t\n\t\t$this->save();\n\t}",
"function emarking_calculate_grade($emarking, $totalscore, $totalrubricscore) {\n\tif (isset ( $emarking->adjustslope ) && $emarking->adjustslope) {\n\t\t$finalgrade = min ( $emarking->grade, ((($emarking->adjustslopegrade - $emarking->grademin) / $emarking->adjustslopescore) * $totalscore) + $emarking->grademin );\n\t} else {\n\t\t$finalgrade = ((($emarking->grade - $emarking->grademin) / $totalrubricscore) * $totalscore) + $emarking->grademin;\n\t}\n\n\treturn $finalgrade;\n}",
"public function add_score() {\n $this->score;\n $this->totalscore = 0;\n\n foreach($this->score as $score_value) {\n $this->totalscore += $score_value;\n };\n\n $this->check_hand();\n\n //Set aces to value 1 if necessary\n while (($this->totalscore > 21) AND ($this->aces > 0)) {\n $this->totalscore -= 10;\n $this->aces--;\n }\n\n }",
"function calculateTermGpa($clid,$semester,$year){\n //Initialize the temporary variables\n $tempgpa=0;\n $chours=0;\n //Query to return the student's grades and credit hours for a semester\n $result = mysql_query(\"Select grade, sum(credit_hours) FROM(( Select grade, credit_hours FROM take T, class Cl WHERE T.grade IS NOT NULL and T.grade<>'I' and T.grade <> 'CR' and T.grade <> 'NC' and T.grade <> 'W' and T.clid = '$clid' and Cl.section_num = T.section_num and Cl.semester = T.semester and Cl.year = T.year and Cl.course_num = T.course_num and Cl.course_dept = T.course_dept and Cl.credit_hours IS NOT NULL and T.semester='$semester' and T.year='$year') UNION ALL (Select T.grade,Co.credit_hours FROM take T,course Co WHERE T.grade IS NOT NULL and T.grade<>'I' and T.grade <> 'NC' and T.grade <> 'W' and T.grade <> 'CR' and T.clid = '$clid' and T.course_dept = Co.course_dept and T.course_num = Co.course_num and T.semester='$semester' and T.year='$year' and NOT EXISTS(select * from class Cl WHERE Cl.course_dept = Co.course_dept and Cl.course_num = Co.course_num and Cl.credit_hours IS NOT NULL))) AS result GROUP BY grade;\") or die(mysql_error());\n //Calculate the GPA\n while($row = mysql_fetch_array($result)){\n //Is the grade an A?\n if($row['grade'] == 'A')\n //If so, increment tempgpa by four times the sum of the credit hours\n $tempgpa+=4*$row['sum(credit_hours)'];\n //Is the grade a B?\n else if ($row['grade']=='B')\n //If so, increment tempgpa by 3 times the sum of the credit hours\n $tempgpa+=3*$row['sum(credit_hours)'];\n //Is the grade a C?\n else if ($row['grade']=='C')\n //If so, increment tempgpa by 2 times the sum of the credit hours\n $tempgpa+=2*$row['sum(credit_hours)'];\n //Is the grade a D?\n else if ($row['grade']=='D')\n //If so, increment tempgpa by the sum of the credit hours\n $tempgpa+=1*$row['sum(credit_hours)'];\n //Increment chours by the sum of the credit hours\n $chours+=$row['sum(credit_hours)'];\n }\n //Divide tempgpa by chours to get the student's GPA\n\tif($chours == 0) return 0;\n \telse return round($tempgpa/$chours,2);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enable a unrecommended extension. Should Warn. | public function testUnrecommendedWarn() {
$this->drush('pm-download', array('php'), $this->options);
$this->drush('pm-enable', array('php'), $this->options);
$this->drush('audit-extensions', array(), $this->options + array(
'detail' => NULL,
'json' => NULL,
));
$output = json_decode($this->getOutput());
$this->assertEquals(\SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_FAIL, $output->checks->SiteAuditCheckExtensionsUnrecommended->score);
} | [
"public function enableExtendedPrivacy() {\n\t\t$this->extendedPrivacy = true;\n\t}",
"function drush_pm_enable() {\n // Get the data built during the validate phase\n $extension_info = drush_get_context('PM_ENABLE_EXTENSION_INFO');\n $modules = drush_get_context('PM_ENABLE_MODULES');\n $themes = drush_get_context('PM_ENABLE_THEMES');\n\n // Inform the user which extensions will finally be enabled.\n $extensions = array_merge($modules, $themes);\n if (empty($extensions)) {\n return drush_log(dt('There were no extensions that could be enabled.'), 'ok');\n }\n else {\n drush_print(dt('The following extensions will be enabled: !extensions', array('!extensions' => implode(', ', $extensions))));\n if(!drush_confirm(dt('Do you really want to continue?'))) {\n return drush_user_abort();\n }\n }\n\n // Enable themes.\n if (!empty($themes)) {\n drush_theme_enable($themes);\n }\n\n // Enable modules and pass dependency validation in form submit.\n if (!empty($modules)) {\n drush_module_enable($modules);\n }\n\n // Inform the user of final status.\n $result_extensions = drush_get_named_extensions_list($extensions);\n $problem_extensions = array();\n $role = drush_role_get_class();\n foreach ($result_extensions as $name => $extension) {\n if ($extension->status) {\n drush_log(dt('!extension was enabled successfully.', array('!extension' => $extension->name)), 'ok');\n $perms = $role->getModulePerms($extension->name);\n if (!empty($perms)) {\n drush_print(dt('!extension defines the following permissions: !perms', array('!extension' => $extension->name, '!perms' => implode(', ', $perms))));\n }\n }\n else {\n $problem_extensions[] = $extension->name;\n }\n }\n if (!empty($problem_extensions)) {\n return drush_set_error('DRUSH_PM_ENABLE_EXTENSION_ISSUE', dt('There was a problem enabling !extension.', array('!extension' => implode(',', $problem_extensions))));\n }\n // Return the list of extensions enabled\n return $extensions;\n}",
"public function enabled(Extension $extension);",
"function disable_extension()\n\t{\n\t\treturn TRUE;\n\t}",
"public function disable_extension()\r\n {\r\n \tif (APP_VER < 2.0)\r\n \t{\r\n \t\treturn ee()->output->show_user_error('general', str_replace('%url%', \r\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tBASE.AMP.'C=modules',\r\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tee()->lang->line('disable_module_to_disable_extension')));\r\n\t\t}\t\t\t\t\t\r\n\t}",
"public function enable(Extension $extension);",
"protected function setAvailableExtensions() {}",
"public function enableOption();",
"public function activate_extension()\n {\n \tif (APP_VER < 2.0)\n \t{\n \t\treturn ee()->output->show_user_error('general', str_replace('%url%', \n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tBASE.AMP.'C=modules',\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tee()->lang->line('enable_module_to_enable_extension')));\n\t\t}\n\t}",
"public static function allow_enabling_features_with_incompatible_plugins() : void\n {\n }",
"public function activate_extension()\r\n {\r\n \tif (APP_VER < 2.0)\r\n \t{\r\n \t\treturn ee()->output->show_user_error('general', str_replace('%url%', \r\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tBASE.AMP.'C=modules',\r\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tee()->lang->line('enable_module_to_enable_extension')));\r\n\t\t}\r\n\t}",
"function wp_maybe_grant_resume_extensions_caps($allcaps)\n {\n }",
"public function enable(): void\n {\n }",
"function DisableExtension( $id, $minVersion = NULL, $maxVersion = NULL ) {\n ApplicationProcess::$ExtensionPolicy['disable'][] = array( 'id' => $id, 'minVersion' => $minVersion, 'maxVersion' => $maxVersion );\n}",
"public function extensionDisabled(ExtensionPostDisabledEvent $event): void\n {\n }",
"public function enableProtection()\n {\n $this->protectionDisabled = false;\n }",
"function disable_extension()\n\t{\n\t\tglobal $DB;\n\t\tif ($this->DEV_MODE) $DB->query(\"DELETE FROM exp_extensions WHERE class = '$this->classname'\");\n\t}",
"public function disable_extension()\n\t{\n\t\t$this->EE->db->where('class', __CLASS__);\n\t\t$this->EE->db->delete('exp_extensions');\n\t}",
"function activate_extension()\n\t{\n\t\treturn TRUE;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return '/ecomm/custom/ithumb/phpThumb.php?src='.$img. '&w=100&h=100&zc=1&q=95&hash=' . ; | function getThumb($img) {
return phpThumbURL('src=../'.$img. '&w=100&h=100&zc=1&q=95', '/ecomm/custom/ithumb/phpThumb.php');
} | [
"function getThumbnail($md5)\n{\n return $_SERVER[\"PHP_SELF\"] . \"?getthumb=$md5\";\n}",
"function thumb($src, $width = 0, $height = 0, $quality = 80) {\n $url = \"/thumb.php?src=$src\";\n if ($width != 0) {\n $url .= \"&w=$width\";\n }\n if ($height != 0) {\n $url .= \"&h=$height\";\n }\n $url .= \"&q=$quality\";\n return $url;\n}",
"function phpThumbURL($ParameterString) {\r\n\tglobal $PHPTHUMB_CONFIG;\r\n\treturn 'phpThumb.php?'.$ParameterString.'&hash='.md5($ParameterString.@$PHPTHUMB_CONFIG['high_security_password']);\r\n}",
"function getThumbAjax($urlThumb, $alt='', $class='', $width='', $height=''){\n if($urlThumb !=''){\n return '<img src=\"'.ROOTHOST.$urlThumb.'\" width=\"'.$width.'\" height=\"'.$height.'\" class=\"'.$class.'\" alt=\"'.$alt.'\">';\n }\n else{\n return '<img src=\"'.ROOTHOST.THUMB_DEFAULT.'\" width=\"'.$width.'\" height=\"'.$height.'\" class=\"'.$class.'\">';\n }\n}",
"function timthumb( $src, $width, $height, $zoomcrop = 0, $echo = true ) {\n\t$url = GE_URL . \"inc/timthumb.php?src=$src&w=$width&h=$height&zc=$zc\";\n\tif ( $echo ) {\n\t\techo $url;\n\t}\n\telse {\n\t\treturn $url;\n\t}\n}",
"function thumb_script()\n{\n\t$url_full=get_param('url');\n\tif (strpos($url_full,'://')===false) $url_full=base64_decode($url_full);\n\n\trequire_code('images');\n\n\t$new_name=url_to_filename($url_full);\n\tif (!is_saveable_image($new_name)) $new_name.='.png';\n\tif (is_null($new_name)) warn_exit(do_lang_tempcode('URL_THUMB_TOO_LONG'));\n\t$file_thumb=get_custom_file_base().'/uploads/auto_thumbs/'.$new_name;\n\tif (!file_exists($file_thumb))\n\t{\n\t\tconvert_image($url_full,$file_thumb,-1,-1,intval(get_option('thumb_width')),false);\n\t}\n\t$url_thumb=get_custom_base_url().'/uploads/auto_thumbs/'.rawurlencode($new_name);\n\n\tif ((strpos($url_thumb,chr(10))!==false) || (strpos($url_thumb,chr(13))!==false))\n\t\tlog_hack_attack_and_exit('HEADER_SPLIT_HACK');\n\theader('Location: '.$url_thumb);\n}",
"function thumb_script()\n{\n $url_full = get_param_string('url');\n if (strpos($url_full, '://') === false) {\n $url_full = base64_decode($url_full);\n }\n\n require_code('images');\n\n $new_name = url_to_filename($url_full);\n if (!is_saveable_image($new_name)) {\n $new_name .= '.png';\n }\n $file_thumb = get_custom_file_base() . '/uploads/auto_thumbs/' . $new_name;\n if (!file_exists($file_thumb)) {\n convert_image($url_full, $file_thumb, -1, -1, intval(get_option('thumb_width')), false);\n }\n $url_thumb = get_custom_base_url() . '/uploads/auto_thumbs/' . rawurlencode($new_name);\n\n require_code('mime_types');\n $mime_type = get_mime_type($url_thumb, false);\n header('Content-Type: ' . $mime_type . '; authoritative=true;');\n\n if ((strpos($url_thumb, \"\\n\") !== false) || (strpos($url_thumb, \"\\r\") !== false)) {\n log_hack_attack_and_exit('HEADER_SPLIT_HACK');\n }\n header('Location: ' . escape_header($url_thumb));\n}",
"public function fbPhoto($fbid,$type=\"large\"){\n \n return \"\".SERVER_URL.\"system_files/modules/resizer/imgresize?src=https://graph.facebook.com/\".$fbid.\"/picture?type=\".$type.\"&w=250&h=250&zc=1&a=t\";\n}",
"function thumbnail($img, $width) : string {\n $imgString = \"<img src='\" . $img . \"' width=\" . $width . \">\";\n $returnString = hyperlink($img, $imgString);\n return $returnString;\n}",
"function getPhotoThumbnail($_url) {\n\t\treturn str_replace(\"disp\", \"thumb\", $_url);\n\t}",
"function thumbnail($url,$width){\n return \"<a href='\".\"$url\".\"'> <img src='\".\"$url\".\"'> width='\".\"$width\".\"px' </img> </a>\";\n}",
"public function getImageURL()\n \t{\n \t\tglobal $_CMAPP;\n \t\n \t\t$url = \"\";\n \t\tswitch($this->method) {\n \t\tcase self::METHOD_DB:\n \t\t\t$url = \"$_CMAPP[media_url]/imagewrapper.php?method=db&frm_codeFile=\".$this->codeFile;\n \t\t\tbreak;\n \t\tcase self::METHOD_SESSION:\n \t\t\t$rand = rand(0,100000);\n \t\t\t$_SESSION['amadis']['imageview'][$rand] = serialize($this->imageObj) ;\n \t\t\t$url = \"$_CMAPP[media_url]/imagewrapper.php?method=session&frm_id=$rand\";\n \t\t\tbreak;\n \t\tcase self::METHOD_DEFAULT:\n \t\t\tif($this->thumb) $url = $_CMAPP['thumbs_url']. '/' . $this->imageObj;\n \t\t\telse $url = $_CMAPP['images_url'] . '/' . $this->imageObj;\n \t\t\tbreak;\n \t\t}\n \t\treturn $url;\n \t}",
"public function getUrlImageThumb()\n {\n\n if (!empty($this->imageID)) {\n $urlImage = UniteFunctionsWPRev::getUrlAttachmentImage($this->imageID, UniteFunctionsWPRev::THUMB_MEDIUM);\n } else {\n\n //get from cache\n\n if (!empty($this->imageFilepath)) {\n $urlImage = UniteBaseClassRev::getImageUrl($this->imageFilepath, 200, 100, true);\n } else {\n $urlImage = $this->imageUrl;\n }\n }\n\n\n\n if (empty($urlImage)) {\n $urlImage = $this->imageUrl;\n }\n\n\n\n return($urlImage);\n }",
"public function get_resized_url() {\n\t\t$params = array( 'width' => $this->width, 'height' => $this->height, 'quality' => $this->quality, 'crop' => $this->crop);\n\t\t$image_url = esc_url($this->src);\n\t\tif (empty ($this->src) && $this->use_thumb == true) {\n\t\t\t$image_url = $this->get_mypost_thumb_url();\n\t\t\t$image_url = bfi_thumb( $image_url, $params );\t\t\t\n\t\t}\n\t\telse {\n\t\t\t$image_url = bfi_thumb( $image_url, $params );\n\t\t}\n\t\tif (empty($image_url)) {\n\t\t\t$image_url = $this->no_thumb();\t\t\t\n\t\t}\t\t\n\t\treturn $image_url;\n\t}",
"public function getThumb($id,$ttype) {\n\t\t$styletext = (!empty($style)) ? \"style='$style'\" : '' ;\n\n\n\t\t$thumb_loc = \"/thumbnails/$ttype/${id}.jpg\";\n \t //echo \"Looking for $thumb_loc\" . BRNL ;\n\n\t\tif (file_exists(SITE_PATH . $thumb_loc)) {\n\t\t\treturn $thumb_loc;\n\n\t\t}\n\n\n\t\t// else build one using gd\n\t\t//echo \".. building new. \" . BRNL;\n\n\t\tif ($id != $this->id) {\n\t\t\t$load_error = $this->loadId($id) ;\n\t\t\tif (!empty($load_error)){ // returned errors\n\t\t\t\treturn \"<p class='red'> **ERROR** \" . $load_error . '</p>';\n\t\t\t}\n\t\t}\n\t\tif (! file_exists(SITE_PATH . $this->local_src)){\n\t\t\treturn \"<p class='red'> **ERROR** id $id local source does not exist.</p>\";\n\t\t}\n\n\t\t$this -> buildGdImage($id,$this->local_src, $ttype);\n\t\treturn $thumb_loc;\n\n}",
"function base_the_youtube_thumb($youtube_url){\r\n echo '<img class=\"img-videos\" src=\"http://img.youtube.com/vi/'.base_get_youtube_id($youtube_url).'/0.jpg\" />';\r\n}",
"public function getURLToPhoto(): string {\n return \"photo.php?p=\" . $this->id;\n }",
"function thumbnail($imageFile, $width)\n{\n return hyperlink($imageFile,\"<img src='\".$imageFile.\"' alt='HTML code image' height='200' width='\".$width.\"'>\");\n}",
"function DDBWP_thumbimage_filter($src,$att='&w=100&h=100&zc=1&q=80',$isresize=0)\r\n{\r\n\tglobal $thumb_url;\r\n\tif(strtolower(get_option('ddbwpthemes_timthumb'))=='yes' || get_option('ddbwpthemes_timthumb')=='' || $isresize)\r\n\t$imgurl = DDB_PUGIN_URL.'/thumb.php?src='.$src.$att.$thumb_url;\r\n\telse\r\n\t$imgurl = $src;\r\n\t\r\n\treturn apply_filters('DDBWP_thumbimage_filter',$imgurl);\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'homepageSection' | protected function homepageSectionRequest($homepage_section_id, $fields = null)
{
// verify the required parameter 'homepage_section_id' is set
if ($homepage_section_id === null || (is_array($homepage_section_id) && count($homepage_section_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $homepage_section_id when calling homepageSection'
);
}
$resourcePath = '/homepage_sections/{homepage_section_id}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($fields !== null) {
$queryParams['fields'] = ObjectSerializer::toQueryValue($fields);
}
// path params
if ($homepage_section_id !== null) {
$resourcePath = str_replace(
'{' . 'homepage_section_id' . '}',
ObjectSerializer::toPathValue($homepage_section_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
$httpBody = $_tempBody;
if($headers['Content-Type'] === 'application/json') {
// \stdClass has no __toString(), so we should encode it manually
if ($httpBody instanceof \stdClass) {
$httpBody = \GuzzleHttp\json_encode($httpBody);
}
// array has no __toString(), so we should encode it manually
if(is_array($httpBody)) {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
}
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"protected function allHomepageSectionsRequest($fields = null, $sorts = null)\n {\n\n $resourcePath = '/homepage_sections';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($fields !== null) {\n $queryParams['fields'] = ObjectSerializer::toQueryValue($fields);\n }\n // query params\n if ($sorts !== null) {\n $queryParams['sorts'] = ObjectSerializer::toQueryValue($sorts);\n }\n\n\n // body params\n $_tempBody = null;\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\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function deleteHomepageSectionRequest($homepage_section_id)\n {\n // verify the required parameter 'homepage_section_id' is set\n if ($homepage_section_id === null || (is_array($homepage_section_id) && count($homepage_section_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $homepage_section_id when calling deleteHomepageSection'\n );\n }\n\n $resourcePath = '/homepage_sections/{homepage_section_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($homepage_section_id !== null) {\n $resourcePath = str_replace(\n '{' . 'homepage_section_id' . '}',\n ObjectSerializer::toPathValue($homepage_section_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\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 \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\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\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 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function updateHomepageSectionRequest($homepage_section_id, $body, $fields = null)\n {\n // verify the required parameter 'homepage_section_id' is set\n if ($homepage_section_id === null || (is_array($homepage_section_id) && count($homepage_section_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $homepage_section_id when calling updateHomepageSection'\n );\n }\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling updateHomepageSection'\n );\n }\n\n $resourcePath = '/homepage_sections/{homepage_section_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($fields !== null) {\n $queryParams['fields'] = ObjectSerializer::toQueryValue($fields);\n }\n\n // path params\n if ($homepage_section_id !== null) {\n $resourcePath = str_replace(\n '{' . 'homepage_section_id' . '}',\n ObjectSerializer::toPathValue($homepage_section_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\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 \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\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\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 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function homepage()\n {\n $get = array();\n $get['is_home'] = 1;\n $get['single'] = 1;\n $data = $this->get($get);\n return $data;\n }",
"public function testHomepageSection()\n {\n }",
"protected function restShopBuilderPagesGetRequest()\n {\n\n $resourcePath = '/rest/shop_builder/pages';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\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 OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function section()\n {\n require APP . 'class/entity/section.php';\n $sectionEntity = new Section();\n $sectionList = json_encode($sectionEntity->getSectionDetail());\n\n //$keys = $this->_getObjectKeys($sectionList[0]);\n\n require APP . 'view/dashboard/section/index.php';\n }",
"function homepageAction()\n\t {\n\t \t$this->view->loginStatus = $this->isLoggedIn();\n\t \t\n\t \t$this->_helper->layout()->setLayout('layout_homepage');\n\t \t\n\t \t$fitnessPages = new FitnessWebsitePages();\n \t $fitnessPagesMulti= new FitnessWebsitePagesMultilang();\n \t \n \t \n \t $defaultLang = $this->getDefaultLanguage();\n \t $pageId = $fitnessPages->getPageByName('Homepage');\n \t \n \t \n \t \n \t $pageContent = $fitnessPagesMulti->getPage($pageId['page_id'],$defaultLang);\n \t \n \t $this->view->pageTitle = $pageContent['page_title'];\n \t $pageContent1 = str_replace(\"<strong>\",\"<b>\",$pageContent['page_content']);\n $this->view->pageContent = str_replace(\"</strong>\",\"</b>\",$pageContent1);\n\t\t\t$pageContent2 = str_replace(\"<strong>\",\"<b>\",$pageContent['page_content_sub']);\n $this->view->pageContent2 = str_replace(\"</strong>\",\"</b>\",$pageContent2);\n \t $this->view->defaultLang = $defaultLang;\n\t }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $homepageSections = $em->getRepository('EmauxBundle:HomepageSections')->findAll();\n\n return $this->render('homepagesections/index.html.twig', array(\n 'homepageSections' => $homepageSections,\n ));\n }",
"protected function restPluginsSeoSitemapGetRequest()\n {\n\n $resourcePath = '/rest/plugins/seo/sitemap';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\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\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public static function home( ) {\n\n\t\treturn new Request( RequestType::home );\n\t}",
"function orgright_client_create_front_pages() {\n $node = new stdClass;\n $node->type = 'public';\n $node->title = st('Authorised Access Only');\n $node->body = st('<p><strong>Access to this site is only available to authorised persons</strong></p><p>You will need a login and password to use this site. If you do not have a login, you will need to contact an appropriate member of your organisation to receive a login. If you do have a login, but have lost/forgotten your password, then you will need to contact the person in your organisation responsible for administering this site to get a new one issued.</p>');\n $node->teaser = $node->body;\n $node->format = 1;\n $node->uid = 1;\n $node->status = 1;\n $node->promote = 1;\n $node->sticky = 1;\n $node->created = time();\n $node->changed = time();\n $node->comment = 0;\n $node->moderate = 0;\n $node->tnid = 0;\n $node->translate = 0;\n $node->language = '';\n\n //orgright_client_include('node');\n node_save($node);\n\n // Create the front \"welcome page\" for logged in users\n $node = new stdClass;\n $node->type = 'page';\n $node->title = st('Welcome');\n $node->body = st('<p><strong>Welcome to your orgRight site.</strong></p><p>This site is for members of the committee and other individuals involved in managing or running your organisation. It does not provide features that will allow it to be used as a general access site for communication with members of the public about your organisation.</p>');\n $node->teaser = $node->body;\n $node->format = 1;\n $node->uid = 1;\n $node->status = 1;\n $node->promote = 1;\n $node->sticky = 1;\n $node->created = time();\n $node->changed = time();\n $node->comment = 0;\n $node->moderate = 0;\n $node->tnid = 0;\n $node->translate = 0;\n $node->language = '';\n\n //orgright_client_include('node');\n node_save($node);\n\n // Create a URL aliases for this page\n $alias = new stdClass;\n $alias->src = 'node/' . $node->nid;\n $alias->dst = 'welcome';\n drupal_write_record('url_alias', $alias);\n\n}",
"public function defaultAction(){\n \t$this->request->component = $this->defaultComponent;\n \t$this->request->task = $this->defaultTask;\n \t$this->request->params[\"pageType\"] = $this->defaultPageType;\n \t$this->request->params[\"page\"] = $this->defaultPage;\n\n }",
"function subrequest(IPage $page){\r\n\t\t$sub = new SubRequest($page);\r\n\t\t$sub = $sub->Execute('GET');\r\n\t\treturn $sub;\r\n\t}",
"function ouwiki_create_new_section($course, $cm, $ouwiki, $subwiki, $pagename, $newcontent,\n $sectionheader, $formdata) {\n $sourcepage = ouwiki_get_current_page($subwiki, $pagename);\n $sectiondetails = ouwiki_get_new_section_details($sourcepage->xhtml, $sectionheader);\n ouwiki_save_new_version_section($course, $cm, $ouwiki, $subwiki, $pagename,\n $sourcepage->xhtml, $newcontent, $sectiondetails, $formdata);\n}",
"private function fronteEnd() {\n\n //default: show client and project options\n config(['visibility.foo_modal_client_fields' => true]);\n\n //merge data\n request()->merge([\n 'resource_query' => 'ref=page',\n ]);\n }",
"public function getSections(Request $r){\n $page = $r->has(\"page\") && $r->input(\"page\") > 0 ? $r->input(\"page\") : 1;\n $quantity = $r->has(\"quantity\") ? $r->input(\"quantity\") : 15;\n $quantity = min(max($quantity, 1), 100);\n\n $sections = DB::table(\"sections\");\n if($r->has(\"category-id\") && is_numeric($r->input(\"category-id\"))){\n $sections = $sections->where(\"category_id\",\"=\",$r->input(\"category-id\"));\n }\n $total = $sections->count();\n $sections = $sections->limit($quantity)->offset(($page-1)*$quantity)->get();\n\n $data = [\n \"total\" => $total,\n \"content\" => []\n ];\n $user = Auth::user();\n foreach($sections as $index=>$content){\n $section = Section::find($content->id);\n $isRead = !$user? true : $section->isReadBy($user->id);\n $data[\"content\"][$index] = [\n \"id\"=>$content->id,\n \"name\"=>$content->name,\n \"image\"=>$content->image,\n \"color\"=>$content->color,\n \"categoryId\"=>$content->category_id,\n \"isRead\"=>$isRead\n ];\n }\n\n return response()->json($data, 200);\n }",
"function qed_ajax_action_get_header_section() {\r\n\t\t$response = array(\r\n\t\t\t'success' => false,\r\n\t\t);\r\n\r\n\t\t$nonce = $_POST['headerSectionNonce'];\r\n\t\t$device_type = $_POST['type'];\r\n\t\t$page_id = (int) $_POST['pageId'];\r\n\t\t$section_meta_service = qed_di( 'header_section' );\r\n\t\t$section_meta = $section_meta_service ? $section_meta_service->get_section_meta_by_id( $page_id ) : array();\r\n\t\t$option_pre_key = ( $device_type ) ? 'mobile_' : '';\r\n\r\n\t\t$response['id'] = $page_id;\r\n\t\t$response['meta'] = $section_meta;\r\n\r\n\r\n\t\t$mode = isset( $section_meta[ $device_type ][ $option_pre_key . 'section_mode' ] ) ? $section_meta[ $device_type ][ $option_pre_key . 'section_mode' ] : 'hide';\r\n\t\tif ( 'banner' === $mode && empty( $section_meta[ $device_type ][ $option_pre_key . 'banner_image' ] ) ) {\r\n\t\t\t$mode = 'hide';\r\n\t\t}\r\n\r\n\t\tif ( wp_verify_nonce( $nonce, 'swish-header-section-nonce' ) ) {\r\n\r\n\t\t\tswitch ( $mode ) {\r\n\t\t\t\tcase 'banner':\r\n\t\t\t\t\t$response['type'] = 'banner';\r\n\t\t\t\t\tob_start();\r\n\t\t\t\t\tqed_render_template_part( 'templates/header/ajax/banner', '', $section_meta );\r\n\t\t\t\t\t$response['html'] = ob_get_clean();\r\n\t\t\t\t\t$response['success'] = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'slider':\r\n\t\t\t\t\t$is_home = ( 'home' === qed_check_if_home() || 'default' === qed_check_if_home() ) ? true : false;\r\n\t\t\t\t\t$slider_id = 'bxslider' . get_the_ID();\r\n\t\t\t\t\t$bxslider_options = array();\r\n\t\t\t\t\tif ( $is_home ) {\r\n\t\t\t\t\t\t$bxslider_options['pause'] = intval( $section_meta[ $device_type ][ $option_pre_key . 'slider_timeout' ] ) * 1000;\r\n\t\t\t\t\t\t$bxslider_options['speed'] = intval( $section_meta[ $device_type ][ $option_pre_key . 'slider_fadespeed' ] ) * 1000;\r\n\t\t\t\t\t\t$bxslider_options['mode'] = 'fade';\r\n\t\t\t\t\t\t$bxslider_options['infiniteLoop'] = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$bxslider_options['pager'] = false;\r\n\t\t\t\t\t$bxslider_options['controls'] = false;\r\n\r\n\t\t\t\t\t$response['type'] = 'slider';\r\n\t\t\t\t\t$response['config'] = array(\r\n\t\t\t\t\t\t'sliderSelector' => '#' . $slider_id,\r\n\t\t\t\t\t\t'sliderType' => $device_type,\r\n\t\t\t\t\t\t'sliderOptions' => $bxslider_options,\r\n\t\t\t\t\t);\r\n\t\t\t\t\tob_start();\r\n\t\t\t\t\tqed_render_template_part( 'templates/header/ajax/slider', '', $section_meta );\r\n\t\t\t\t\t$response['html'] = ob_get_clean();\r\n\t\t\t\t\t$response['success'] = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'hide':\r\n\t\t\t\t\t$response['type'] = 'hide';\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tif ( ! $response['success'] ) {\r\n\t\t\theader( 'HTTP/1.1 400 Bad Request', true, 400 );\r\n\t\t}\r\n\r\n\t\twp_send_json( $response );\r\n\t\tdie();\r\n\t}",
"protected function create_section_data() {\n\t\t$this->in_out();\n\t\t$this->active_link();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets as activityOID The activity to which this duration information relates. | public function getActivityOID()
{
return $this->activityOID;
} | [
"public function getTargetActivityOID()\n {\n return $this->targetActivityOID;\n }",
"public function getActivityId()\n {\n return $this->activity_id;\n }",
"public function getActivityId()\n {\n return $this->activityId;\n }",
"public function getActivityId(): int\n {\n return $this->activityId;\n }",
"public function getActivityId()\n {\n return $this->readOneof(21);\n }",
"public function activityActorId();",
"function get_activity () {\r\n if ($this->activity != null)\r\n return $this->activity;\r\n else\r\n return null;\r\n }",
"public function getActivity()\n {\n if (array_key_exists(\"activity\", $this->_propDict)) {\n if (is_a($this->_propDict[\"activity\"], \"\\Beta\\Microsoft\\Graph\\Model\\TeamworkDeviceActivity\") || is_null($this->_propDict[\"activity\"])) {\n return $this->_propDict[\"activity\"];\n } else {\n $this->_propDict[\"activity\"] = new TeamworkDeviceActivity($this->_propDict[\"activity\"]);\n return $this->_propDict[\"activity\"];\n }\n }\n return null;\n }",
"public function getActivity()\n {\n return $this->activity;\n }",
"public function getActivityTime()\n {\n return $this->activity_time;\n }",
"public function getExternalcourseActivityId()\n {\n if (array_key_exists(\"externalcourseActivityId\", $this->_propDict)) {\n return $this->_propDict[\"externalcourseActivityId\"];\n } else {\n return null;\n }\n }",
"public function getActid()\n {\n return $this->actid;\n }",
"public function getCurrentActivityId(): ?string;",
"public function getPintuanActivityId()\n {\n $value = $this->get(self::pintuan_activity_id);\n return $value === null ? (integer)$value : $value;\n }",
"function getActivity($activityID){\n\t\t\t\n\t\t\t$activity = getDatabaseInfo(\"activities\",\"activity_id\", $activityID);\n\t\t\t$activityName = $activity['ACTIVITY_NAME'];\n\t\t\t\n\t\t\treturn $activityName;\n\t\t}",
"function getJoinOnActivityID()\n { \n return $this->getJoinOnFieldX('staffactivity_id');\n }",
"public function getIActId()\n {\n return $this->get(self::IACTID);\n }",
"public function activity()\n {\n return Activity::i();\n }",
"public function getActivityName()\n {\n return $this->activityName;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation privateCancelAllByCurrencyGetAsyncWithHttpInfo Cancels all orders by currency, optionally filtered by instrument kind and/or order type. | public function privateCancelAllByCurrencyGetAsyncWithHttpInfo($currency, $kind = null, $type = null)
{
$returnType = 'object';
$request = $this->privateCancelAllByCurrencyGetRequest($currency, $kind, $type);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | [
"public function privateCancelAllGetWithHttpInfo()\n {\n $request = $this->privateCancelAllGetRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('object' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, 'object', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = 'object';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function privateCancelAllByCurrencyGetWithHttpInfo($currency, $kind = null, $type = null)\n {\n $request = $this->privateCancelAllByCurrencyGetRequest($currency, $kind, $type);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('object' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, 'object', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = 'object';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function privateCancelAllByCurrencyGetAsync($currency, $kind = null, $type = null)\n {\n return $this->privateCancelAllByCurrencyGetAsyncWithHttpInfo($currency, $kind, $type)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function publicGetCurrenciesGetAsyncWithHttpInfo()\n {\n $returnType = 'object';\n $request = $this->publicGetCurrenciesGetRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function listCurrenciesAsyncWithHttpInfo()\n {\n $returnType = '\\GateApi\\Model\\Currency[]';\n $request = $this->listCurrenciesRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function orderCancelAllAfterWithHttpInfo($timeout)\n {\n $returnType = 'object';\n $request = $this->orderCancelAllAfterRequest($timeout);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function defCurrenciesGetWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\InlineResponse20072[]';\n $request = $this->defCurrenciesGetRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if (!in_array($returnType, ['string','integer','bool'])) {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\InlineResponse20072[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getCurrenciesAsyncWithHttpInfo($x_game_key, string $contentType = self::contentTypes['getCurrencies'][0])\n {\n $returnType = '\\MetaFab\\Model\\GetCurrencies200ResponseInner[]';\n $request = $this->getCurrenciesRequest($x_game_key, $contentType);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function privateCancelAllByInstrumentGetWithHttpInfo($instrument_name, $type = null)\n {\n $request = $this->privateCancelAllByInstrumentGetRequest($instrument_name, $type);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('object' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, 'object', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = 'object';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function cancelOrdersAsyncWithHttpInfo($currency_pair, $side = null, $account = null)\n {\n $returnType = '\\GateApi\\Model\\Order[]';\n $request = $this->cancelOrdersRequest($currency_pair, $side, $account);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function privateGetOpenOrdersByCurrencyGetRequest($currency, $kind = null, $type = null)\n {\n // verify the required parameter 'currency' is set\n if ($currency === null || (is_array($currency) && count($currency) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $currency when calling privateGetOpenOrdersByCurrencyGet'\n );\n }\n\n $resourcePath = '/private/get_open_orders_by_currency';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($currency !== null) {\n $queryParams['currency'] = ObjectSerializer::toQueryValue($currency);\n }\n // query params\n if ($kind !== null) {\n $queryParams['kind'] = ObjectSerializer::toQueryValue($kind);\n }\n // query params\n if ($type !== null) {\n $queryParams['type'] = ObjectSerializer::toQueryValue($type);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\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 Bearer (Auth. Token) authentication (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getCurrencyAsyncWithHttpInfo($code)\n {\n $returnType = '\\KnetikCloud\\Model\\CurrencyResource';\n $request = $this->getCurrencyRequest($code);\n\n return $this->client->sendAsync($request)->then(function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }, function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n \"[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})\",\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n });\n }",
"public function listAllCurrenciesRatesAsyncWithHttpInfo(string $contentType = self::contentTypes['listAllCurrenciesRates'][0], \\SnapTrade\\RequestOptions $requestOptions = new \\SnapTrade\\RequestOptions())\n {\n $returnType = '\\SnapTrade\\Model\\ExchangeRatePairs[]';\n [\"request\" => $request, \"serializedBody\" => $serializedBody] = $this->listAllCurrenciesRatesRequest($contentType);\n\n // Customization hook\n $this->beforeSendHook($request, $requestOptions, $this->config);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function listAllCurrenciesRatesWithHttpInfo(string $contentType = self::contentTypes['listAllCurrenciesRates'][0], \\SnapTrade\\RequestOptions $requestOptions = new \\SnapTrade\\RequestOptions())\n {\n [\"request\" => $request, \"serializedBody\" => $serializedBody] = $this->listAllCurrenciesRatesRequest($contentType);\n\n // Customization hook\n $this->beforeSendHook($request, $requestOptions, $this->config);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n if (\n ($e->getCode() == 401 || $e->getCode() == 403) &&\n !empty($this->getConfig()->getAccessToken()) &&\n $requestOptions->shouldRetryOAuth()\n ) {\n return $this->listAllCurrenciesRatesWithHttpInfo(\n $contentType,\n $requestOptions->setRetryOAuth(false)\n );\n }\n\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\SnapTrade\\Model\\ExchangeRatePairs[]' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\SnapTrade\\Model\\ExchangeRatePairs[]' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\SnapTrade\\Model\\ExchangeRatePairs[]', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\SnapTrade\\Model\\ExchangeRatePairs[]';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\SnapTrade\\Model\\ExchangeRatePairs[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function cancelOptionsOrdersWithHttpInfo($contract = null, $underlying = null, $side = null)\n {\n $request = $this->cancelOptionsOrdersRequest($contract, $underlying, $side);\n\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n $responseBody = $e->getResponse() ? (string) $e->getResponse()->getBody() : null;\n if ($responseBody !== null) {\n $gateError = json_decode($responseBody, true);\n if ($gateError !== null && isset($gateError['label'])) {\n throw new GateApiException(\n $gateError,\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $responseBody\n );\n }\n }\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $responseBody\n );\n }\n\n $returnType = '\\GateApi\\Model\\OptionsOrder[]';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }",
"public function getCurrencyWithHttpInfo($code)\n {\n $returnType = '\\KnetikCloud\\Model\\CurrencyResource';\n $request = $this->getCurrencyRequest($code);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n \"[$statusCode] Error connecting to the API ({$request->getUri()})\",\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), '\\KnetikCloud\\Model\\CurrencyResource', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), '\\KnetikCloud\\Model\\Result', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function setCancellationInfo(\\Diadoc\\Api\\Proto\\Events\\CancellationInfo $value=null)\n {\n return $this->set(self::CANCELLATIONINFO, $value);\n }",
"public function servicesCancelAsyncWithHttpInfo($api_key, $v, $content_type, $body)\n {\n $returnType = '';\n $request = $this->servicesCancelRequest($api_key, $v, $content_type, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getV1ServicesB2cnoConsumersAsyncWithHttpInfo($query = null, $status = null, $page = '1', $perPage = '20')\n {\n $returnType = '\\Vertaislaina\\Maventa\\AutoXChange\\Entity\\CompanyConsumersConsumer[]';\n $request = $this->getV1ServicesB2cnoConsumersRequest($query, $status, $page, $perPage);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the value of top. | public function setTop($top)
{
$this->top = $top;
return $this;
} | [
"protected function setTop($val) {\n $val = ($val < 1 ? 1 : $val);\n $h = Tui::$observer->height;\n $val = ($val > $h ? $h : $val);\n $this->location->top = $val;\n }",
"public function setTop($value)\n {\n return $this->set('Top', $value);\n }",
"public function setTop($val)\n {\n $this->_propDict[\"top\"] = floatval($val);\n return $this;\n }",
"public function top($value) {\n return $this->setProperty('top', $value);\n }",
"public function updateTopValue()\n {\n $values = $this->valuesToArray();\n $top_emotion = null;\n $top_value = null;\n\n foreach($values as $emotion => $value)\n {\n if($top_value == null)\n {\n $top_emotion = $emotion;\n $top_value = $value;\n }\n else\n {\n if($value > $top_value)\n {\n $top_emotion = $emotion;\n $top_value = $value;\n }\n }\n }\n\n $this->TopEmotion = $top_emotion;\n $this->TopValue = $top_value;\n }",
"public function setTop($top)\n {\n if(is_numeric($top))\n {\n $this->top = $top;\n \n return true;\n }\n \n return false;\n }",
"public function setTopflg()\n {\n $this->parameters['topflg'] = 1;\n }",
"public function setLineTop($value);",
"public function moveToTop()\n {\n Application::executeControlCommand($this->getJqControlId(), $this->getJqSetupFunction(), \"moveToTop\", Application::PRIORITY_LOW);\n }",
"protected function assignFixedTopPage(): void\n {\n $this->owner->TopPageID = $this->getFixedTopPageID();\n }",
"public function setTopCounter($topCounter)\n {\n $this->topCounter = $topCounter;\n }",
"public function unsetTop()\n\t{\n\t\t$this->is_top=false;\n\t\t$this->save();\n\t}",
"public function setTop($top) {\n $this->_annotationDictionary->Rect->items[3]->touch();\n $this->_annotationDictionary->Rect->items[3]->value = $top;\n\n return $this;\n }",
"public function MoveToTop()\n {\n $this->CallJqUiMethod(\"moveToTop\");\n }",
"public function appendTop(Top $value) {\n return $this->append(self::TOP, $value);\n }",
"public function top($value) {\n return $this->css('top', $value);\n }",
"public function setTopParent($value)\n {\n return $this->set('TopParent', $value);\n }",
"public function setTopOfImage($topOfImage)\n {\n if (intval($this->topOfImage) !== intval($topOfImage)) {\n $this->topOfImage = intval($topOfImage);\n }\n }",
"function _fillTop()\n {\n return $this->_top + $this->_padding; \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a multiline user input (from stream) | public function getInputMultiLine(); | [
"protected function stdinReadln() {\n return <<<EOF\nhello\nworld\n\nEOF;\n }",
"private function _readInput() {\n $input = fopen('php://stdin', 'r');\n\n $message = fgets($input);\n return $this->_trigerMessage($message);\n }",
"public function getStdin();",
"function read() {\n global $debug;\n $input = str_replace(\"\\n\", \"\", fgets(STDIN, 4096));\n if ($debug)\n errlog($input);\n return $input;\n}",
"private function readline()\n {\n if ($this->hasReadline) {\n $line = readline($this->getPrompt());\n } else {\n $this->output->write($this->getPrompt());\n $line = fgets(STDIN, 1024);\n $line = (false === $line || '' === $line) ? false : rtrim($line);\n }\n return $line;\n }",
"function get_input(){\n $in_stream = fopen(\"php://stdin\", \"r\");\n # read a line from the stdin.\n $line = fgets($in_stream);\n\n fclose($in_stream);\n return $line;\n}",
"public function getStdin(): string {}",
"public function cli_keyboardInput()\n {\n // Have to open the stdin stream only ONCE! otherwise I cannot read multiple lines from it... :\n if (!$this->stdin) {\n $this->stdin = fopen('php://stdin', 'r');\n }\n while (false == ($line = fgets($this->stdin, 1000))) {\n }\n return trim($line);\n }",
"private function readline()\n {\n if ($this->hasReadline) {\n $line = readline($this->prompt);\n } else {\n $this->output->write($this->prompt);\n $line = fgets(STDIN, 1024);\n $line = (!$line && strlen($line) == 0) ? false : rtrim($line);\n }\n\n return $line;\n }",
"public static function stdin($raw = false)\n {\n return $raw ? fgets(STDIN) : rtrim(fgets(STDIN), PHP_EOL);\n }",
"public function readLine();",
"function read_stdin() {\n $fr=fopen(\"php://stdin\",\"r\"); // open our file pointer to read from stdin\n $input = fgets($fr,128); // read a maximum of 128 characters\n $input = rtrim($input); // trim any trailing spaces.\n fclose ($fr); // close the file handle\n return $input; // return the text entered\n}",
"private function stdin()\n {\n return file_get_contents('php://stdin');\n }",
"function readUserInput($text){\n\treturn trim(readline(\"$text\"));\n}",
"function input(string $info): string\n{\n echo \"$info : \";\n $result = fgets(STDIN);\n return trim($result); // trim untuk menghilangkan whitespace/enter \n}",
"public function readLine($prompt);",
"function inputMethod() {\n return fgets(STDIN, self::INPUT_LENGTH);\n }",
"static function cli_stdin_get(){\n\t\t$streams = [STDIN];\n\t\t$null = NULL;\n\t\tif(stream_select($streams, $null, $null, 0)){\n\t\t\treturn stream_get_contents(STDIN);\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function readInput()\n {\n $read = array(STDIN);\n $write = NULL;\n $exclude = NULL;\n stream_select($read, $write, $exclude, 0);\n stream_set_blocking(STDIN, 0);\n\n return stream_get_contents(STDIN, -1);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convenience method which changes table.column to alias.column. Using this method you can maintain SQL abstraction while using column aliases. $c>addAlias("alias1", TablePeer::TABLE_NAME); $c>addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); | public static function alias($alias, $column)
{
return str_replace(TargetPeer::TABLE_NAME.'.', $alias.'.', $column);
} | [
"public static function alias($alias, $column)\n\t{\n\t\treturn str_replace(MemberPeer::TABLE_NAME.'.', $alias.'.', $column);\n\t}",
"public static function alias($alias, $column)\n\t{\n\t\treturn str_replace(TblAdherentPeer::TABLE_NAME.'.', $alias.'.', $column);\n\t}",
"public static function alias($alias, $column)\n\t{\n\t\treturn str_replace(AlpzaMiembroAsociadosPeer::TABLE_NAME.'.', $alias.'.', $column);\n\t}",
"public static function alias($alias, $column)\n\t{\n\t\treturn str_replace(VehiclePeer::TABLE_NAME.'.', $alias.'.', $column);\n\t}",
"public static function alias($alias, $column)\n {\n return str_replace(EmpleadoPeer::TABLE_NAME.'.', $alias.'.', $column);\n }",
"public static function alias($alias, $column)\n\t{\n\t\treturn str_replace(AppointmentPeer::TABLE_NAME.'.', $alias.'.', $column);\n\t}",
"public static function alias($alias, $column)\n\t{\n\t\treturn str_replace(UserPeer::TABLE_NAME.'.', $alias.'.', $column);\n\t}",
"public function setAlias(string $alias){ $this->tableAlias = $alias; }",
"protected function addAddSelectColumnsAliased(&$script)\n {\n $script .= \"\n /**\n * Add all the columns needed to create a new object.\n *\n * Note: any columns that were marked with lazyLoad=\\\"true\\\" in the\n * XML schema will not be added to the select list and only loaded\n * on demand.\n *\n * @param criteria object containing the columns to add.\n * @param string \\$alias The alias for the current table.\n * @throws PropelException Any exceptions caught during processing will be\n * rethrown wrapped into a PropelException.\n */\n public static function addSelectColumnsAliased(Criteria \\$criteria, \\$alias)\n {\n\";\n foreach ($this->getTable()->getColumns() as $col) {\n if (!$col->isLazyLoad()) {\n $script .= \"\n \\$criteria->addSelectColumn(\".$this->getPeerClassname().\"::alias(\\$alias, \".$this->getPeerClassname().\"::\".$this->getColumnName($col).\"));\n\";\n } // if !col->isLazyLoad\n } // foreach\n $script .=\"\n }\n\";\n }",
"private function tableAlias(){\n if($this->alias){\n return $this->alias;\n }//if\n return $this->table;\n }",
"public static function addAliasSelectColumns( $alias, Criteria $criteria)\n {\n $criteria->addSelectColumn($alias.'.ID');\n\n $criteria->addSelectColumn($alias.'.REFERENCE');\n\n $criteria->addSelectColumn($alias.'.LOKALREAKTOR');\n\n $criteria->addSelectColumn($alias.'.LIVE');\n\n $criteria->addSelectColumn($alias.'.SUBREAKTOR_ORDER');\n }",
"protected function prepareTableAliases()\n {\n $this->addTableAliasesForJoinIdentifiers(['']);\n if (isset($this->definition['filters'])) {\n $this->addTableAliasesForFilters($this->definition['filters']);\n }\n foreach ($this->definition['columns'] as $column) {\n $this->addTableAliasesForJoinIdentifiers($this->getJoinIdentifiers($column['name']));\n }\n if (isset($this->definition['grouping_columns'])) {\n foreach ($this->definition['grouping_columns'] as $column) {\n $this->addTableAliasesForJoinIdentifiers($this->getJoinIdentifiers($column['name']));\n }\n }\n }",
"public function alias($field = NULL, $join = NULL)\n\t{\t\n\t\t$meta = $this->meta();\n\t\t\n\t\t// Return the model's alias if nothing is passed\n\t\tif (!$field)\n\t\t{\n\t\t\treturn $meta->table;\n\t\t}\n\t\t\n\t\t// Split off the table name; we already know that\n\t\tif (strpos($field, '.') !== FALSE)\n\t\t{\t\t\t\n\t\t\tlist(, $field) = explode('.', $field);\n\t\t}\n\t\t\n\t\t// Check and concatenate\n\t\tif ($this->field($field))\n\t\t{\n\t\t\t$field = $this->field($field)->column;\n\t\t}\n\t\t\n\t\tif ($join)\n\t\t{\n\t\t\treturn $meta->table.'.'.$field;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $field;\n\t\t}\n\t}",
"public function getAlias(){\n return $this->table_as;\n }",
"public function set_table_alias($alias) {\n\t\t$this->table = new DBTableAlias($this->table, $alias);\n\t}",
"public function quoteColumnAlias($name)\n\t{\n\t\treturn parent::quoteColumnAlias($name, '`', '`');\n\t}",
"protected function convertTableAlias($alias)\n {\n return ' '.$alias;\n\n }",
"public function testQuerySelectJoinWithAlias()\n {\n $sql = 'SELECT * FROM \"table\" INNER JOIN \"join\" AS \"j\" ON \"j\".\"tableId\" = \"table\".\"id\"';\n $select = (new Select($this->mockConnection))->from('table')->join('join', 'j.tableId', '=', 'table.id', 'j');\n $this->assertEquals($sql, $select->toSql());\n }",
"public function aliasColumns($query)\n\t{\n\t\t$class = isset($this) ? $this->className() : static::className();\n\t\t$ret_val = [];\n\t\t$has = is_array($class::has()) ? $class::has() : null;\n\t\tswitch(is_null($has))\n\t\t{\n\t\t\tcase false:\n\t\t\tforeach($has as $property=>$value)\n\t\t\t{\n\t\t\t\t$special = explode(':', $property);\n\t\t\t\tswitch(sizeof($special))\n\t\t\t\t{\n\t\t\t\t\tcase 2:\n\t\t\t\t\t$property = $special[1];\n\t\t\t\t\t$column = $special[0];\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 1:\n\t\t\t\t\t$property = $special[0];\n\t\t\t\t\t$column = $property;\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t$column = $property;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tif(count($ret_val))\n\t\t\t$query->select(array_merge($ret_val, array_keys($class::getTableSchema()->columns)));\n\t\telse\n\t\t\t$query->select('*');\n\n\t\t\\nitm\\helpers\\QueryFilter::aliasFields($query, $class::tableName());\n\t\treturn $query;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Description This method searchs for a Item Images for a tenant. Arguments api_key: auth_token: tnid: The ID of the tenant to get Item Image for. start_needle: The search string to search for. limit: The maximum number of entries to return. Returns | function ciniki_ags_itemImageSearch($ciniki) {
//
// Find all the required and optional arguments
//
ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');
$rc = ciniki_core_prepareArgs($ciniki, 'no', array(
'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),
'start_needle'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Search String'),
'limit'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Limit'),
));
if( $rc['stat'] != 'ok' ) {
return $rc;
}
$args = $rc['args'];
//
// Check access to tnid as owner, or sys admin.
//
ciniki_core_loadMethod($ciniki, 'ciniki', 'ags', 'private', 'checkAccess');
$rc = ciniki_ags_checkAccess($ciniki, $args['tnid'], 'ciniki.ags.itemImageSearch');
if( $rc['stat'] != 'ok' ) {
return $rc;
}
//
// Get the list of itemimages
//
$strsql = "SELECT ciniki_ags_item_images.id, "
. "ciniki_ags_item_images.item_id, "
. "ciniki_ags_item_images.name, "
. "ciniki_ags_item_images.permalink, "
. "ciniki_ags_item_images.flags, "
. "ciniki_ags_item_images.sequence "
. "FROM ciniki_ags_item_images "
. "WHERE ciniki_ags_item_images.tnid = '" . ciniki_core_dbQuote($ciniki, $args['tnid']) . "' "
. "AND ("
. "name LIKE '" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . "%' "
. "OR name LIKE '% " . ciniki_core_dbQuote($ciniki, $args['start_needle']) . "%' "
. ") "
. "";
if( isset($args['limit']) && is_numeric($args['limit']) && $args['limit'] > 0 ) {
$strsql .= "LIMIT " . ciniki_core_dbQuote($ciniki, $args['limit']) . " ";
} else {
$strsql .= "LIMIT 25 ";
}
ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');
$rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.ags', array(
array('container'=>'itemimages', 'fname'=>'id',
'fields'=>array('id', 'item_id', 'name', 'permalink', 'flags', 'sequence')),
));
if( $rc['stat'] != 'ok' ) {
return $rc;
}
if( isset($rc['itemimages']) ) {
$itemimages = $rc['itemimages'];
$itemimage_ids = array();
foreach($itemimages as $iid => $itemimage) {
$itemimage_ids[] = $itemimage['id'];
}
} else {
$itemimages = array();
$itemimage_ids = array();
}
return array('stat'=>'ok', 'itemimages'=>$itemimages, 'nplist'=>$itemimage_ids);
} | [
"public function imageSearch()\n {\n $this->img_src = \"https://ae01.alicdn.com/kf/HTB1RrfMjCYTBKNjSZKbq6xJ8pXai/T-Shirt-Women-Summer-Short-Sleeve-V-Neck-t-shirt-Female-Cactus-Funny-Letter-Print-T.jpg\";\n\n // add extra query params\n $query = [\n\t\t\t//'q' => 'site:bellelily.com', // optional, get results for that image only in specific site\n ];\n \n $results = (new GoogleAdapter)->grisSearch($img_src, $query);\n \n dd($results);\n }",
"public function SearchImages() {\n $searchImagesObj = new SearchImages($this->credentials,$this->apiBaseUri,$this->container);\n return $searchImagesObj;\n }",
"public function getImages( $args ) \r\n\t{\r\n\t\t$__args = array_merge( \r\n\t\t\tarray(\r\n\t\t\t\t'options'\t=> \"'EnableHighlighting'\",\r\n\t\t\t\t'format'\t=> 'json',\r\n\t\t\t\t'maxResults'\t=> 10, // Max results\r\n\t\t\t\t'adultFilters'\t=> \"'Off'\",\r\n\t\t\t\t'imageFilters'\t=> \"'Size:Large'\",\r\n\t\t\t\t'query'\t\t=> '',\r\n\t\t\t\t'return'\t=> 'array'\r\n\t\t\t),\r\n\t\t\t$args\r\n\t\t);\r\n\t\textract( $__args, EXTR_SKIP );\r\n\r\n\t\t//$http = new CurlHttpAdapter();\r\n\t\t$this->adapter->setConfig( array( \r\n\t\t\t'host'\t\t=> self::BingApiHost, \r\n\t\t\t'curl_http_auth'=> $this->bingApiKey . ':' . $this->bingApiKey, \r\n\t\t\t'use_ssl'\t=> true \r\n\t\t) );\r\n\t\t\r\n\t\t$apiUrl = $this->adapter->setUrl( 'Data.ashx/Bing/Search/v1/Image' );\r\n\t\t$params = array(\r\n\t\t\t'Options'\t=> $options,\r\n\t\t\t'$format'\t=> $format,\t\t// json | xml\r\n\t\t\t'$top'\t\t=> $maxResults,\r\n\t\t\t'Adult'\t\t=> $adultFilters,\r\n\t\t\t'ImageFilters'\t=> $imageFilters,\t// Size:Small|Medium|Large|\r\n\t\t\t'Query'\t\t=> \"'\" . $query . \"'\",\t// should be already url encoded\r\n\t\t);\r\n\t\t$response = $this->adapter->get( $apiUrl, $params );\r\n\t\t$result = json_decode( $response );\r\n\t\t\r\n\t\tif ( $result == false ) \r\n\t\t\treturn false;\r\n\t\t\t\r\n\t\tif ( $return == 'object' )\r\n\t\t\treturn $result;\r\n\r\n\t\t// If $result is requested as array format.\r\n\t\t$images = array();\r\n\t\tforeach( $result->d->results as $image ) {\r\n\t\t\t$images[] = array(\r\n\t\t\t\t'ID'\t\t=> $image->ID,\r\n\t\t\t\t'Title'\t\t=> htmlentities( $image->Title ),\r\n\t\t\t\t'MediaUrl'\t=> $image->MediaUrl,\r\n\t\t\t\t'ThumbnailUrl'\t=> $image->Thumbnail->MediaUrl,\r\n\t\t\t\t'Width'\t\t=> (int) $image->Width,\r\n\t\t\t\t'Height'\t=> (int) $image->Height,\r\n\t\t\t\t'ContentType'\t=> isset( $image->ContentType ) ? $image->ContentType : '',\r\n\t\t\t\t'FileSize'\t=> (int) $image->FileSize,\r\n\t\t\t\t'SourceUrl'\t=> $image->SourceUrl\r\n\t\t\t);\r\n\t\t}\r\n\t\r\n\t\treturn $images;\r\n\t}",
"function ciniki_ags_itemImageList($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner, or sys admin.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'ags', 'private', 'checkAccess');\n $rc = ciniki_ags_checkAccess($ciniki, $args['tnid'], 'ciniki.ags.itemImageList');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Get the list of itemimages\n //\n $strsql = \"SELECT ciniki_ags_item_images.id, \"\n . \"ciniki_ags_item_images.item_id, \"\n . \"ciniki_ags_item_images.name, \"\n . \"ciniki_ags_item_images.permalink, \"\n . \"ciniki_ags_item_images.flags, \"\n . \"ciniki_ags_item_images.sequence \"\n . \"FROM ciniki_ags_item_images \"\n . \"WHERE ciniki_ags_item_images.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.ags', array(\n array('container'=>'itemimages', 'fname'=>'id', \n 'fields'=>array('id', 'item_id', 'name', 'permalink', 'flags', 'sequence')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['itemimages']) ) {\n $itemimages = $rc['itemimages'];\n $itemimage_ids = array();\n foreach($itemimages as $iid => $itemimage) {\n $itemimage_ids[] = $itemimage['id'];\n }\n } else {\n $itemimages = array();\n $itemimage_ids = array();\n }\n\n return array('stat'=>'ok', 'itemimages'=>$itemimages, 'nplist'=>$itemimage_ids);\n}",
"function image_search()\r\n\t{\r\n\t\t$SERVICE_URL = \"http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=20062007&output=json&query=\";\r\n\t\t\r\n\t\t//elaborar el url adecuado para este servicio\r\n\t\t\r\n\t\t$peticion_url = $this->elaborar_url($SERVICE_URL,$site,$intitle,$inurl,$filetype,$excluidos);\r\n\t\t\r\n\t\t//conectarse y obtener la respuesta en formato nativo\r\n\t\t\r\n\t\t$this->respuesta_raw = $this->buscar($peticion_url);\t\t//TODO: validar una respuesta exitosa\r\n\t\t\r\n\t\t//transformar la respuesta raw a finjira\r\n\t\t\r\n\t\t$this->respuesta_findjira = $this->image_parse();\t\t\t\t//web_parse utiliza respuesta_raw para transformarla\r\n\t\t\r\n\t}",
"public static function getSearchImages($search) {\n // returns collection of images\n return Image::where(\"id\", \"LIKE\", \"%$search%\")\n ->orWhere(\"alt_text\", \"LIKE\", \"%$search%\")\n ->orWhere(\"category\", \"LIKE\", \"%$search%\")->get();\n }",
"function getPhotos($term, $limit = 10, $page = 1) {\r\n App::import('Vendor', 'phpFlickr/phpFlickr');\r\n $flickr =& new phpFlickr(Configure::read('Flickr.settings.key'));\r\n $results = $flickr->photos_search(\r\n array('tags' => $term, 'tag_mode' => 'any', 'per_page' => $limit, 'page' => $page)\r\n );\r\n\r\n\t\tforeach ($results['photo'] as $key => $result) {\r\n\t\t\t$results['photo'][$key]['square_image_url'] = $flickr->buildPhotoURL($result, 'square');\r\n $results['photo'][$key]['large_image_url'] = $flickr->buildPhotoURL($result, 'large');\r\n\t\t}\r\n\r\n\t\treturn $results;\r\n }",
"function ciniki_ags_sapos_itemSearch($ciniki, $tnid, $args) {\n\n if( $args['start_needle'] == '' ) {\n return array('stat'=>'ok', 'items'=>array());\n }\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'dateFormat');\n $date_format = ciniki_users_dateFormat($ciniki);\n\n //\n // Search by code, name \n //\n $strsql = \"SELECT items.id, \"\n . \"eitems.id AS exhibit_item_id, \"\n . \"items.code, \"\n . \"items.name AS description, \"\n . \"items.unit_amount, \"\n . \"items.unit_discount_amount, \"\n . \"items.unit_discount_percentage, \"\n . \"items.taxtype_id, \"\n . \"items.shipping_profile_id, \"\n . \"eitems.inventory AS num_available, \"\n . \"(exhibits.flags&0x0800) AS search_priority, \"\n . \"exhibits.name AS exhibit_name \"\n . \"FROM ciniki_ags_items AS items \"\n . \"INNER JOIN ciniki_ags_exhibit_items AS eitems ON (\"\n . \"items.id = eitems.item_id \"\n . \"AND eitems.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \") \"\n . \"INNER JOIN ciniki_ags_exhibits AS exhibits ON (\"\n . \"eitems.exhibit_id = exhibits.id \"\n . \"AND exhibits.status < 90 \"\n// . \"AND (exhibits.end_date = '0000-00-00' OR exhibits.end_date > NOW()) \"\n . \"AND exhibits.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \") \"\n . \"INNER JOIN ciniki_ags_exhibitors AS exhibitors ON (\"\n . \"items.exhibitor_id = exhibitors.id \"\n . \"AND exhibitors.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \") \"\n . \"WHERE items.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND (items.code LIKE '\" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR items.code LIKE '% \" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR items.name LIKE '\" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR items.name LIKE '% \" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR exhibitors.display_name LIKE '\" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR exhibitors.display_name LIKE '% \" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \") \"\n . \"ORDER BY items.code, search_priority DESC, items.name, eitems.inventory DESC, items.notes \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.ags', array(\n array('container'=>'items', 'fname'=>'id',\n 'fields'=>array('id', 'exhibit_item_id', 'code', 'description', \n 'unit_amount', 'unit_discount_amount', 'unit_discount_percentage', \n 'taxtype_id', 'shipping_profile_id',\n 'exhibit_name', 'num_available')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $items = array();\n if( isset($rc['items']) ) {\n foreach($rc['items'] as $item) {\n $item['flags'] = 0x02;\n $item['description'] = $item['exhibit_name'] . ' - ' . $item['description'];\n $item['object'] = 'ciniki.ags.exhibititem';\n $item['object_id'] = $item['exhibit_item_id'];\n $item['quantity'] = 1;\n $item['notes'] = '';\n $items[] = array('item'=>$item);\n }\n }\n\n return array('stat'=>'ok', 'items'=>$items); \n}",
"function ciniki_fatt_sapos_itemSearch($ciniki, $tnid, $args) {\n\n if( $args['start_needle'] == '' ) {\n return array('stat'=>'ok', 'items'=>array());\n }\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'dateFormat');\n $date_format = ciniki_users_dateFormat($ciniki);\n\n //\n // Search by code, name or date\n // Show how many spots left for each offering\n //\n $strsql = \"SELECT ciniki_fatt_offerings.id, \"\n . \"ciniki_fatt_offerings.start_date, \"\n . \"ciniki_fatt_offerings.date_string, \"\n . \"ciniki_fatt_offerings.location, \"\n . \"ciniki_fatt_offerings.seats_remaining, \"\n . \"ciniki_fatt_offerings.price, \"\n . \"ciniki_fatt_courses.code, \"\n . \"ciniki_fatt_courses.name, \"\n . \"ciniki_fatt_courses.taxtype_id \"\n . \"FROM ciniki_fatt_courses \"\n . \"INNER JOIN ciniki_fatt_offerings ON (\"\n . \"ciniki_fatt_courses.id = ciniki_fatt_offerings.course_id \"\n . \"AND ciniki_fatt_offerings.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND UNIX_TIMESTAMP(ciniki_fatt_offerings.start_date) > (UNIX_TIMESTAMP(UTC_TIMESTAMP())-86400) \"\n . \") \"\n . \"WHERE ciniki_fatt_courses.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND (ciniki_fatt_courses.name LIKE '\" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR ciniki_fatt_courses.name LIKE '% \" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR ciniki_fatt_courses.code LIKE '\" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR ciniki_fatt_courses.code LIKE '% \" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \") \"\n . \"ORDER BY ciniki_fatt_offerings.start_date \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryIDTree');\n $rc = ciniki_core_dbHashQueryIDTree($ciniki, $strsql, 'ciniki.fatt', array(\n array('container'=>'offerings', 'fname'=>'id',\n 'fields'=>array('id', 'code', 'name', 'start_date', 'date_string', 'location', 'seats_remaining', 'price', 'taxtype_id')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['offerings']) ) {\n $offerings = $rc['offerings'];\n } else {\n return array('stat'=>'ok', 'items'=>array());\n }\n\n $items = array();\n foreach($offerings as $oid => $offering) {\n $item = array(\n 'status'=>0,\n 'object'=>'ciniki.fatt.offering',\n 'object_id'=>$offering['id'],\n 'code'=>'',\n 'description'=>$offering['name'] . ' - ' . $offering['date_string'],\n 'quantity'=>1,\n 'unit_amount'=>$offering['price'],\n 'unit_discount_amount'=>0,\n 'unit_discount_percentage'=>0,\n 'taxtype_id'=>$offering['taxtype_id'], \n 'notes'=>'',\n 'registrations_available'=>$offering['seats_remaining'],\n );\n if( $offering['seats_remaining'] < 0 ) {\n $item['available_display'] = abs($offering['seats_remaining']) . ' oversold';\n } elseif( $offering['seats_remaining'] == 0 ) {\n $item['available_display'] = 'SOLD OUT';\n } elseif( $offering['seats_remaining'] > 0 ) {\n $item['available_display'] = $offering['seats_remaining'];\n }\n // Flags: No Quantity, Registration Item\n $item['flags'] = 0x28;\n $items[] = array('item'=>$item);\n }\n\n return array('stat'=>'ok', 'items'=>$items); \n}",
"function getimages() {\n\t\t$result = '';\n\t\t$images = null;\n\t\t$whereSQL = '';\n\t\t$folderID = isset($_GET['folderID']) ? (int) $_GET['folderID'] : 0;\n\t\t$searchText = (isset($_GET['searchText']) && $_GET['searchText'] != 'undefined' && $_GET['searchText'] != 'null') ? Convert::raw2sql($_GET['searchText']) : '';\n\n\t\t$folder = DataObject::get_by_id('Folder', (int) $_GET['folderID']);\n\t\t\n\t\tif($folder) {\n\t\t\t$folderList = $folder->getDescendantIDList('Folder');\n\t\t\tarray_unshift($folderList, $folder->ID);\n\n\t\t\t$whereSQL = 'ParentID IN (' . implode(', ', $folderList) . ')';\n\t\t\tif($searchText) $whereSQL .= \" AND Filename LIKE '%$searchText%'\";\n\t\t\t\n\t\t\t$images = DataObject::get('Image', $whereSQL, 'Title');\n\t\t\t\n\t\t} else {\n\t\t\tif($searchText) {\n\t\t\t\t$whereSQL = \"Filename LIKE '%$searchText%'\";\n\n\t\t\t\t$images = DataObject::get('Image', $whereSQL, 'Title');\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($images) {\n\t\t\t$result .= '<ul>';\n\t\t\tforeach($images as $image) {\n\t\t\t\t$thumbnail = $image->getFormattedImage('StripThumbnail');\n\t\t\t\tif ($thumbnail instanceof Image_Cached) { \t//Hack here... \n\t\t\t\t\t// Constrain the output image to a 600x600 square. This is passed to the destwidth/destheight in the class, which are then used to\n\t\t\t\t\t// set width & height properties on the <img> tag inserted into the CMS. Resampling is done after save\n\t\t\t\t\t$width = $image->Width;\n\t\t\t\t\t$height = $image->Height;\n\t\t\t\t\tif($width > 600) {\n\t\t\t\t\t\t$height *= (600 / $width);\n\t\t\t\t\t\t$width = 600;\n\t\t\t\t\t}\n\t\t\t\t\tif($height > 600) {\n\t\t\t\t\t\t$width *= (600 / $height);\n\t\t\t\t\t\t$height = 600;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$result .= \n\t\t\t\t\t\t'<li>' .\n\t\t\t\t\t\t\t'<a href=\" ' . $image->Filename . '?r=' . rand(1,100000) . '\">' .\n\t\t\t\t\t\t\t\t'<img class=\"destwidth=' . round($width) . ',destheight=' . round($height) . '\" src=\"'. $thumbnail->URL . '?r=' . rand(1,100000) . '\" alt=\"' . $image->Title . '\" title=\"' . $image->Title . '\" />' .\n\t\t\t\t\t\t\t'</a>' .\n\t\t\t\t\t\t'</li>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$result .= '</ul>';\n\t\t} else {\n\t\t\tif($folder) {\n\t\t\t\t$result = '<h2>' . _t('ThumbnailStripField.NOFOLDERIMAGESFOUND', 'No images found in') . ' ' . $folder->Title . '</h2>';\n\t\t\t} else {\n\t\t\t\t$result = '<h2>' . _t('ThumbnailStripField.NOIMAGESFOUND', 'No images found') . '</h2>';\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"public function getImageFromSearch($q){\n $dstFile = \\Yii::$app->params['tmpDir'] . DIRECTORY_SEPARATOR . mktime(true);\n try{\n exec('cd ' . \\Yii::$app->params['tmpDir'] . ' && wget -O ' . $dstFile . ' --timeout=10 --connect-timeout=10 --read-timeout=10 --tries=1 -t 1 https://www.bing.com/images/search?' . build_query(['q' => $q]));\n\n $document = \\phpQuery::newDocumentHTML(file_get_contents($dstFile));\n foreach($document->find('.content .thumb') as $node){\n\n $href = $node->getAttribute('href');\n if(!empty($href)){\n unlink($dstFile);\n return [$this->loadImage($href)];\n }\n }\n }\n catch (\\Exception $e){\n\n }\n\n unlink($dstFile);\n return [];\n }",
"public function imagesGetAllFoldersRequest($tenant_id = null)\n {\n\n $resourcePath = '/api/storage/v1/images/folders/all';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($tenant_id !== null) {\n if('form' === 'form' && is_array($tenant_id)) {\n foreach($tenant_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['tenantId'] = $tenant_id;\n }\n }\n\n\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 []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n // aurigmafix 6\n if (gettype($formParamValueItem) === 'object') {\n if (!($formParamValueItem instanceof StreamInterface \n || $formParamValueItem instanceof \\Iterator \n || method_exists($formParamValueItem, '__toString'))) {\n $formParamValueItem = json_encode($formParamValueItem);\n }\n } \n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\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('X-API-Key');\n if ($apiKey !== null) {\n $headers['X-API-Key'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n // this endpoint requires OAuth (access token)\n // aurigmafix 3\n $token = $this->config->getAccessToken();\n if ($token !== null && $token !== '' && !ctype_space($token)) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n // aurigmafix 3\n $token = $this->config->getAccessToken();\n if ($token !== null && $token !== '' && !ctype_space($token)) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n // aurigmafix 3\n $token = $this->config->getAccessToken();\n if ($token !== null && $token !== '' && !ctype_space($token)) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createImageSearch($query, $page = 1, $limit = 50)\n {\n $client = new Client(self::BING_API_BASE_URL, $this->accountKey);\n $search = new ImageSearch($client, $query, $page, $limit);\n return $search;\n }",
"public function cloudinarySearch(Request $request, Page $page) {\n\n // $cloudinary = \\Cloudder::getApi();\n // return $cloudinary->tags(['max_results' => '100']);\n\n // $cloudinary = \\Cloudder::getSearch();\n // return $cloudinary->expression('tags:eddie')->with_field('tags')->max_results(10)->execute();\n\n // return $cloudinary->resources_by_tag('eddie', [\n // 'next_cursor' => $request->input('next'),\n // 'with_field' => 'tags',\n // ]);\n // return cl_image_tag($res['resources'][0]['public_id'], array(\"width\"=>100, \"height\"=>100, \"crop\"=>\"fit\"));\n\n if ($request->input('q', false)) {\n $answer = [];\n $results = [];\n $cloudinary = \\Cloudder::getApi();\n $items = $cloudinary->resources_by_tag(str_replace(' ', '', $request->input('q')), [\n 'next_cursor' => $request->input('next', ''),\n 'with_field' => 'tags',\n ]);\n\n foreach ($items['resources'] as $i) {\n $results[] = [\n 'id' => $i['public_id'],\n 'text' => $i['public_id'],\n 'img' => cl_image_tag($i['public_id'], array(\"width\"=>100, \"height\"=>100, \"crop\"=>\"fit\")),\n ];\n }\n\n if (isset($items['next_cursor'])) {\n $answer['pagination']['more'] = true;\n $answer['pagination']['next'] = $items['next_cursor'];\n } else {\n $answer['pagination']['more'] = false;\n $answer['pagination']['next'] = null;\n }\n\n $answer['results'] = $results;\n\n return $answer;\n }\n }",
"function ciniki_artcatalog_searchQuick($ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'start_needle'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Search'), \n 'limit'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Limit'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n \n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'artcatalog', 'private', 'checkAccess');\n $rc = ciniki_artcatalog_checkAccess($ciniki, $args['tnid'], 'ciniki.artcatalog.searchQuick'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'dateFormat');\n $date_format = ciniki_users_dateFormat($ciniki);\n\n $strsql = \"SELECT ciniki_artcatalog.id, image_id, name, media, catalog_number, size, framed_size, \"\n . \"ROUND(price, 2) AS price, location, type, \"\n . \"IF(status>=50, 'yes', 'no') AS sold, \"\n . \"ciniki_artcatalog.last_updated \"\n// . \"IF((flags&0x02)=0x02,'yes','no') AS sold \"\n// . \"IF(ciniki_artcatalog.category='', 'Uncategorized', ciniki_artcatalog.category) AS cname \"\n// . \"IF(ciniki_artcatalog.status=1, 'open', 'closed') AS status \"\n . \"FROM ciniki_artcatalog \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND (name LIKE '\" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR name like '% \" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR catalog_number like '\" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR media like '\" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR media like '% \" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR location like '\" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR location like '% \" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR notes like '\" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR notes like '% \" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \") \"\n . \"\";\n $strsql .= \"ORDER BY name, location \"\n . \"\";\n if( isset($args['limit']) && $args['limit'] != '' && $args['limit'] > 0 ) {\n $strsql .= \"LIMIT \" . ciniki_core_dbQuote($ciniki, $args['limit']) . \" \";\n }\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.artcatalog', array(\n array('container'=>'items', 'fname'=>'id', \n 'fields'=>array('id', 'type', 'name', 'image_id', 'media', 'catalog_number', 'size', 'framed_size', 'price', 'location', 'sold', 'last_updated')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['items']) ) {\n return array('stat'=>'ok', 'items'=>array());\n }\n ciniki_core_loadMethod($ciniki, 'ciniki', 'images', 'hooks', 'loadThumbnail');\n $rsp = array('stat'=>'ok', 'items'=>$rc['items']);\n foreach($rsp['items'] as $iid => $item) {\n //\n // Load the images\n //\n if( isset($item['image_id']) && $item['image_id'] > 0 ) {\n $rc = ciniki_images_hooks_loadThumbnail($ciniki, $args['tnid'], \n array('image_id'=>$item['image_id'], 'maxlength'=>75, 'last_updated'=>$item['last_updated'], 'reddot'=>$item['sold']));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $rsp['items'][$iid]['image'] = 'data:image/jpg;base64,' . base64_encode($rc['image']);\n }\n }\n\n return $rsp;\n}",
"public static function search($key, $query, $options=array())\n {\n return parent::_search($key, 'image', $query, $options);\n }",
"function findImages(array $imageIds);",
"private static function get_searchedimage($keyword)\n {\n global $bodyreader;\n if (empty($keyword)) return array();\n $config = '\n {\n \"rss\": {\n \"tag\": \"td\",\n \"key\": \"style\",\n \"value\": \"width:25%;word-wrap:break-word\",\n \"quantity\": 5,\n \"image\": {\n \"tag\": \"img\",\n \"getattribute\": \"src\",\n \"quantity\":1\n }\n }\n }';\n $keyword = substr(strip_tags(urldecode($keyword)), 0, 400);\n $keyword = urlencode($keyword);\n $config_arr = static::json2array($config);\n $url = \"https://www.google.com/search?site=&tbm=isch&source=hp&biw=1242&bih=763&q=\" . $keyword;\n $imgs = $bodyreader->parse_advance($url, $config_arr[\"rss\"], array(\"image\"));\n if (empty($imgs[0][\"image\"])) $imgs[0][\"image\"] = \"\";\n return $imgs;\n }",
"abstract protected function getItems($selector, $key, $start, $limit, $storage);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new ItemCompra entity. | public function createAction(Request $request)
{
$entity = new ItemCompra();
$form = $this->createCreateForm($entity);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($entity);
$em->flush();
return $this->redirect($this->generateUrl('itemcompra_show', array('id' => $entity->getId())));
}
return $this->render('JYGRevestimientosBundle:ItemCompra:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
));
} | [
"public function newAction()\n {\n $entity = new ItemCompra();\n $form = $this->createCreateForm($entity);\n\n return $this->render('JYGRevestimientosBundle:ItemCompra:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"private function createCreateForm(ItemCompra $entity)\n {\n $form = $this->createForm(new ItemCompraType(), $entity, array(\n 'action' => $this->generateUrl('itemcompra_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }",
"public function createNewTestItem()\n {\n $item = $this->itemFactory->createEntity();\n $item->setName('Product1');\n $item->setNumber('123');\n $item->setQuantity(2);\n $item->setQuantityUnit('Pcs');\n $item->setUseProductsPrice(true);\n $item->setTax(20);\n $item->setPrice($this->productPrice->getPrice());\n $item->setDiscount(10);\n $item->setDescription('This is a description');\n $item->setWeight(15.8);\n $item->setWidth(5);\n $item->setHeight(6);\n $item->setLength(7);\n $item->setCreated(new DateTime());\n $item->setChanged(new DateTime());\n $item->setProduct($this->product);\n $item->setSupplier($this->account);\n $item->setSupplierName($this->account->getName());\n\n return $item;\n }",
"public function crearFromItem(Item $producto){\n $bodegas=Bodega::model()->findAll();\n if(is_array($bodegas)){\n foreach($bodegas as $key =>$value){\n $crit=self::setCriterio($producto->id,$value->id);\n $item_bodega=Itembodega::model()->find($crit);\n if($item_bodega==null){\n $relacion=new ItemBodega;\n $relacion->setScenario('ínsert');\n $relacion->idbodega=$value->id;\n $relacion->iditem=$producto->id;\n $relacion->stock=0;\n $relacion->stockcomprometido=0;\n $relacion->stockporllegar=0;\n $relacion->stockcomprometido=0;\n $relacion->idempresa=$this->empresa_id;\n $relacion->save();\n }\n }\n }\n }",
"public\n function actionCreate()\n {\n $model = new Item();\n $categories = Category::getCategoriesDropdown();\n $brands = Brand::getBrandsDropdown();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->addFlash(\"info\", Yii::t('app', 'Item created successfully'));\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'categories' => $categories,\n 'brands' => $brands\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Compra();\n $proveedores = Proveedor::find()->orderBy('nombrecorto ASC')->all();\n $conceptos = CompraConcepto::find()->orderBy('concepto ASC')->all();\n $tipocompra = \\app\\models\\TipoCompraProceso::find()->where(['=','estado_tipo', 0])->orderBy('id_tipo_compra ASC')->all();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $model->usuariosistema = Yii::$app->user->identity->username; \n $model->update();\n $this->calculo($model->id_compra);\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'proveedores' => ArrayHelper::map($proveedores, \"idproveedor\", \"nombreProveedores\"),\n 'conceptos' => ArrayHelper::map($conceptos, \"id_compra_concepto\", \"concepto\"),\n 'tipocompra' => ArrayHelper::map($tipocompra, 'id_tipo_compra', \"descripcion\"),\n ]);\n }",
"public function newAction()\n {\n $entity = new itemCarrito();\n $form = $this->createCreateForm($entity);\n\n return $this->render('cartBundle:itemCarrito:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function actionCreate()\n {\n $model = new Comercios();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function createAction()\n {\n $entity = new PagoCompra();\n $request = $this->getRequest();\n $form = $this->createForm(new PagoCompraType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('pagocompra_show', array('id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }",
"public function createCartItem();",
"public function createItem()\n {\n $pdo = DBConfig::openConnection();\n $query = $pdo->prepare('INSERT INTO Items (classID, name, imgURL, Description, userID, note)\n VALUES (:classID, :name, :imgURL, :Description, :userID, :note)');\n $query->bindValue(':classID', $this->classID, PDO::PARAM_STR);\n $query->bindValue(':name', $this->name, PDO::PARAM_STR);\n $query->bindValue(':imgURL', $this->imgURL, PDO::PARAM_STR);\n $query->bindValue(':Description', $this->Description, PDO::PARAM_STR);\n $query->bindValue(':userID', $this->userID, PDO::PARAM_STR);\n $query->bindValue(':note', $this->note, PDO::PARAM_STR);\n $query->execute();\n $query->CloseCursor();\n DBConfig::closeConnection($pdo);\n }",
"public function actionCreate()\n {\n $model = new Item();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function newAction()\n {\n $entity = new Item();\n $form = $this->createForm(new ItemType(), $entity);\n\n return $this->render('StriideInventoryBundle:Item:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'json_types' => json_encode($this->get('striide_inventory.types')->getInventoryTypesArray()),\n 'form_theme' => 'StriideTwitterbootstrapBundle:Form:form_theme.html.twig',\n 'crumbs' => array(\n array('href' => $this->get('router')->generate('StriideInventoryBundle_homepage'),\n 'label' => $this->get('translator')->trans('Inventory')),\n array('href' => $this->get('router')->generate('StriideInventoryBundle_admin_item_new'),\n 'label' => $this->get('translator')->trans('Create new Item'))\n )\n ));\n }",
"public function actionCreate()\r\n {\r\n $this->layout = \"cafeLayout\";\r\n $model = new Citem();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n Yii::$app->getSession()->setFlash('success', \"<span style='font-weight: bold; font-size: 20px;'>تم إضافة بيانات المنتج بنجاح تقدر حضرت تضيف بيانات لمنتجات آخري. </span>\");\r\n\r\n return $this->redirect(['create'], [\r\n 'model' => $model,\r\n ]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function newAction()\n {\n $entity = new Item();\n $form = $this->createForm(new ItemType(), $entity);\n\n return $this->render('TouqInventoryBundle:Item:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }",
"public function actionCreate()\n {\n $model = new Item();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function createAction()\n {\n $entity = new PlanCompras();\n $request = $this->getRequest();\n $form = $this->createForm(new PlanComprasType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('plancompras_show', array('id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }",
"public function actionCreate()\n {\n $model = new Complaint();\n \n $authUserId = Yii::$app->user->identity->user_id;\n\n $status = ComplaintHelper::decodeStatusFromValue(\"submited\");\n \n $complaint = Yii::$app->request->post(); \n $complaint['Complaint']['level'] = 1;\n $complaint['Complaint']['created_by'] = $authUserId;\n $complaint['Complaint']['applicant_id'] = $authUserId;\n $complaint['Complaint']['status'] = $status;\n $complaint['Complaint']['level'] = 0;\n $complaint['Complaint']['updated_by'] = $authUserId;\n\n if ($model->load($complaint) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->complaint_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function createAction()\n {\n $entity = new Critere();\n $request = $this->getRequest();\n $form = $this->createForm(new CritereType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('critere_show', array('id' => $entity->getId())));\n \n }\n\n return $this->render('ProjetCoursBundle:Critere:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$this>twilio = new Twilio(getenv('twilio.sid'),getenv('twilio.token'),getenv('twilio.phone'),false); | public function __construct() {
$this->twilioService = new Services_Twilio(getenv('twilio.sid'),getenv('twilio.token'));
} | [
"function setupTwilio() {\n\tsession_start();\n\t\n\t// the API information\n\t$sid = \"AC64aea60ecd667ddb260c9a89adc0e2d0\"; \n\t$token = \"815ac8b5450cbd1fa78b9e2f1f2c8957\"; \n\tglobal $client;\n\t$client = new Services_Twilio($sid, $token);\n\t\n\t// a collection of all numbers\n\tglobal $twilioNumbers;\n\t$twilioNumbers = array(\"+15147001712\", \"+15147001713\", \"+15147001714\", \"+15147001716\", \"+15147001775\", \"+15147001785\", \"+15147001786\", \"+15147001796\", \"+15147001902\", \"+15147001904\", \"+15147001916\", \"+15147001917\", \"+15147001918\", \"+15147001923\", \"+15147001924\", \"+15147001925\", \"+15147001936\", \"+15147001937\", \"+15147001943\", \"+15147001946\");\n\t\n\t// global counter for iterating through twilio numbers\n\tglobal $twilioIterator;\n\t$twilioIterator = 0;\n}",
"function twilioSMS($phone, $code)\n{\n//$token = getenv(\"TWILIO_AUTH_TOKEN\"); //Add env var later\n\n$to = $phone; //my personal phone number will be passed by external script later\n$message = \"Your Pilizard 2-factor code is \".$code;\n\n$sid = \"\"; //ask Robert for sid access\n$token = \"\"; //testing only, remove in final release\n\n$twilio = new Client($sid, $token); //authenticate with twilio\n\n$message = $twilio->messages\n ->create($to, // to\n [\n \"body\" => $message,\n \"from\" => \"+12019879741\" //accounts phone number can be ENV var later okay to hardcode for now\n ]\n );\n//print($message->sid);\n}",
"public function twilio_init() {\n Log::twilio('twilio_init() from model '.get_class($this).' with account_sid '.Config::get('application.twilio.account_sid'));\n Bundle::start('twilio');\n $this->twilio = new Services_Twilio(Config::get('application.twilio.account_sid'),Config::get('application.twilio.account_token'));\n }",
"public function __construct()\n {\n // $this->authy = new \\Authy\\AuthyApi(config('laravel-essentials.twilio')['AUTHY_API_KEY']);\n // Twilio credentials\n $this->sid = config('laravel-essentials.twilio')['TWILIO_ACCOUNT_SID'];\n $this->authToken = config('laravel-essentials.twilio')['TWILIO_AUTH_TOKEN'];\n $this->twilioFrom = config('laravel-essentials.twilio')['TWILIO_PHONE'];\n }",
"public function __construct(){\n $this->client = new Twilio\\Rest\\Client($this->sid,$this->token);\n }",
"public function __construct()\n\t{\n\t $this->authy = new AuthyApi(config('app.twilio')['AUTHY_API_KEY']);\n\n\t // Twilio credentials\n\t $this->sid = config('app.twilio')['TWILIO_ACCOUNT_SID'];\n\t $this->authToken = config('app.twilio')['TWILIO_AUTH_TOKEN'];\n\t $this->twilioFrom = config('app.twilio')['TWILIO_PHONE'];\n\t}",
"function send_text( $to , $message ){\n\t// Step 1: Download the Twilio-PHP library from twilio.com/docs/libraries, \n // and move it into the folder containing this file.\n require \"twilio/Services/Twilio.php\";\n \n // Step 2: set AccountSid and AuthToken from www.twilio.com/user/account\n // See Readme to for details with using the Heroku shell to set these\n $AccountSid = getenv('TWILIO_ACCOUNT');\n $AuthToken = getenv('TWILIO_AUTH');\n\n $from = getenv('TWILIO_NUMBER');\n // Pulls the voting number from the heroku shell too\n \n // Step 3: instantiate a new Twilio Rest Client\n $client = new Services_Twilio( $AccountSid, $AuthToken );\n \n // Step 4: make an array of people to end to.\n $sms = $client->account->sms_messages->create( \n $from, // our number\n $to, // their number \n $message // the message being sent\n );\n return true;\n}",
"public function __construct()\n {\n $sid = config('laraveltwilio.account_sid');\n $token = config('laraveltwilio.auth_token');\n\n $this->client = new Client($sid, $token); \n }",
"function tw_get_twilio_client() {\r\n\t$options = tw_get_admin_options();\r\n\t$sid = $options['sid'];\r\n\t$token = $options['auth'];\r\n\r\n\treturn new Client( $sid, $token );\r\n}",
"public function __construct()\n {\n $decryptor = Mage::helper('core');\n\n $this->AccountSid = Mage::helper('twilio')->getAccountSID();\n $this->AuthToken = Mage::helper('twilio')->getAuthToken();\n $this->twilioNumber = Mage::helper('twilio')->getTwilioNumber();\n $this->smsNotificationNumber = Mage::helper('twilio')->getSMSNotificationNumber();\n\n parent::__construct($this->AccountSid, $this->AuthToken);\n }",
"function getTwilioObject() \n\t{\n\t\t$twilio_creds = $this->getTwlioCreds();\n\t\t$client = new Services_Twilio($twilio_creds['accountSid'], $twilio_creds['authToken']);\n\t\treturn $client;\n\t}",
"protected function createTwilioDriver()\n {\n $config = $this->app['config']->get('sms.twilio', []);\n\n return new TwilioSMS(\n new \\Services_Twilio($config['account_sid'], $config['auth_token']),\n $config['auth_token'],\n $this->app['request']->url(),\n $config['verify']\n );\n }",
"protected function createTwilioDriver()\n {\n $config = $this->app['config']->get('sms.twilio', []);\n\n return new TwilioSMS(\n new Twilio($config['account_sid'], $config['auth_token']),\n $config['auth_token'],\n ''\n );\n }",
"public function createTwilioDriver()\n\t{\n\t\treturn new TwilioEngine(\n\t\t\t$this->app->make(TwilioClientInterface::class)\n\t\t\t\t->chat->services(config('chat.twilio.chat_service_sid'))\n\t\t);\n\t}",
"protected function createTwilioDriver(): Twilio\n {\n $config = $this->container['config']->get('phone.drivers.twilio');\n\n $twilio = new TwilioClient($config['account_sid'], $config['auth_token']);\n\n return new Twilio($twilio);\n }",
"public function __construct()\n {\n // $this->sms = new \\Mediumart\\Orange\\SMS\\SMS($client);\n }",
"function _voiptwilio_call_handler($call_id=NULL, $response_action=NULL) {\n\n$msg = \"in voiptwilio_call_handler() with call_id: $call_id, response_action: $response_action, and _REQUEST: \" . print_r($_REQUEST, TRUE);\n$vars = array();\n//watchdog('voiptwilio', $msg, $vars, WATCHDOG_INFO);\n//dsm($msg);\n\n // validate $_REQUEST['AccountSid'] to avoid hack attempts\n $server = VoipServer::getServer('twilio');\n $server_config = $server->getConfig();\n $account_sid = $server_config['voiptwilio_account_sid'];\n $incoming_sid = $_REQUEST['AccountSid'];\n if ($account_sid != $incoming_sid) {\n $msg = '_voip_twilio_call_handler called with invalid AccountSid: @sid';\n $params = array('@sid' => $incoming_sid);\n watchdog('voiptwilio', $msg, $params, WATCHDOG_WARNING);\n return FALSE; // TODO: should we return an error response to the server?\n }\n\n // handle incoming call requests\n if(!$call_id) {\n\n // make sure incoming calls are allowed in the system\n // NOTE: Since incoming calls always arrive with anonymous user, make sure\n // that anonymous users have permission to make inbound calls\n $allowed = user_access('make inbound calls');\n if(!$allowed) {\n // log the issue\n $msg = 'Unauthorized call received with AccountSid: @sid';\n $params = array('@sid' => $incoming_sid);\n watchdog('voiptwilio', $msg, $params, WATCHDOG_WARNING);\n\n // notify the caller\n $text = t('I am sorry, but incoming calls are not allowed in this system.');\n $response = \"<Say>$text</Say><Hangup/>\";\n $rc = _voiptwilio_send_response($response);\n return; // NOTE: this function MUST not return any value. If it does,\n // the output to Twilio will get messed up with Drupal hmtl...\n }\n \n $call = array();\n $call_guid = $_REQUEST['CallGuid']; // unique identifier of the call, 34 char\n $call['call_id'] = $call_guid;\n $call['source'] = 'twilio';\n $call['call_status'] = VOIPCALL_IN_PROGRESS;\n $call['start_time'] = time();\n\n // create a new node for the call\n $call = (array)voipcall_save($call);\n }\n else {\n // load the variables already associated with the call, if any\n $call_nid = voipcall_get_nid_from_call_id($call_id);\n $call = (array)node_load($call_nid);\n }\n\n // update common call variables\n if(!isset($call['field_voipcall_caller_number'][0]['value'])) $call['caller_number'] = $_REQUEST['Caller'];\n if(!isset($call['field_voipcall_caller_name'][0]['value'])) $call['caller_name'] = $_REQUEST['CallerName'];\n if(!isset($call['field_voipcall_dest_number'][0]['value'])) $call['dest_number'] = $_REQUEST['Called'];\n\n // update script variables\n $script = unserialize($call['field_voipcall_script'][0]['value']); \n $call['script'] = $script;\n\n // store call location, if available\n $call_location = array();\n if(isset($_REQUEST['CallerCity'])) $call_location['caller_city'] = $_REQUEST['CallerCity'];\n if(isset($_REQUEST['CallerState'])) $call_location['caller_state'] = $_REQUEST['CallerState'];\n if(isset($_REQUEST['CallerZip'])) $call_location['caller_zip'] = $_REQUEST['CallerZip'];\n if(isset($_REQUEST['CallerCountry'])) $call_location['caller_country'] = $_REQUEST['CallerCountry'];\n if(isset($_REQUEST['CalledCity'])) $call_location['called_city'] = $_REQUEST['CalledCity'];\n if(isset($_REQUEST['CalledState'])) $call_location['called_state'] = $_REQUEST['CalledState'];\n if(isset($_REQUEST['CalledZip'])) $call_location['calldr_zip'] = $_REQUEST['CalledZip'];\n if(isset($_REQUEST['CalledCountry'])) $call_location['called_country'] = $_REQUEST['CalledCountry'];\n if($call_location) {\n $call['script']->setVar('call_location', $call_location);\n }\n\n $hangup = FALSE;\n\n // update the status of the call\n $call_status = $_REQUEST['CallStatus']; \n switch($call_status) {\n default:\n $msg = 'Invalid CallStatus: @status';\n $params = array('@status' => $call_status);\n voipcall_processing_error('voiptwilio', $call, $msg, $params);\n return FALSE;\n break;\n case 'failed':\n $msg = 'Twilio processing error';\n $params = array();\n voipcall_processing_error('voiptwilio', $call, $msg, $params);\n $hangup = TRUE;\n break;\n case 'in-progress':\n $call['call_status'] = VOIPCALL_IN_PROGRESS;\n break;\n case 'completed':\n $call['call_status'] = VOIPCALL_COMPLETED;\n $hangup = TRUE;\n break;\n case 'busy':\n $call['call_status'] = VOIPCALL_BUSY;\n $hangup = TRUE;\n break;\n case 'no-answer':\n $call['call_status'] = VOIPCALL_NO_ANSWER;\n $hangup = TRUE;\n break;\n }\n\n // update dial status, if available\n // Note: dial status is only available in case of a previously made\n // outbound call request\n $dial_status = $_REQUEST['DialStatus'];\n if($dial_status) {\n switch($dial_status) {\n default:\n $call['call_status'] = VOIPCALL_ERROR;\n $error_message = 'Invalid DialStatus for outbound dial request: ' . $dial_status;\n $call['error_message'] = $error_message;\n watchdog('voiptwilio', $error_msg, array(), WATCHDOG_ERROR);\n voipcall_save($call);\n return FALSE;\n break;\n case 'fail': // From: REST API - making calls\n case 'failed': // From: TwiML Reference - Dial verb\n $call['script']->setVar('dial_status', VOIPCALL_ERROR);\n break;\n case 'answered':\n $call['script']->setVar('dial_status', VOIPCALL_IN_PROGRESS);\n break;\n case 'busy':\n $call['script']->setVar('dial_status', VOIPCALL_BUSY);\n break;\n case 'no-answer':\n $call['script']->setVar('dial_status', VOIPCALL_NO_ANSWER);\n break;\n // NOTE: apparently, Twilio does not detect answering machines with the TwiML Dial verb. The following error codes are only valid for making calls via REST API\n case 'answered-machine':\n $call['script']->setVar('dial_status', VOIPCALL_ANSWERED_MACHINE);\n break;\n case 'answered-human':\n $call['script']->setVar('dial_status', VOIPCALL_ANSWERED_HUMAN);\n break;\n case 'hangup-machine':\n $call['script']->setVar('dial_status', VOIPCALL_MACHINE_HANGUP);\n break;\n }\n }\n\n // process responses to requests previously-issued by the call script\n if(!$hangup && $response_action) {\n switch($response_action) {\n default:\n $msg = 'Invalid response_action: @action';\n $params = array('action' => $response_action);\n voipcall_processing_error('voiptwilio', $call, $msg, $params);\n return FALSE;\n break;\n case 'process_conference':\n case 'process_dial':\n // nothing special to be done here. dial_status has already been \n // updated a few lines above\n break;\n case 'process_get_input':\n $call['script']->setVar('input_digits', $_REQUEST['Digits']);\n break;\n case 'process_record':\n // Note: I'm adding an '.mp3' at the end of the url to make sure we use the mp3 file (check http://www.twilio.com/docs/demos/voicerecorder)\n $call['script']->setVar('recording_url', $_REQUEST['RecordingUrl'] . '.mp3');\n $call['script']->setVar('recording_duration', $_REQUEST['Duration']);\n $call['script']->setVar('recording_file_size', $_REQUEST['RecordingFileSize']);\n $call['script']->setVar('recording_digits', $_REQUEST['Digits']);\n break;\n }\n }\n\n if($hangup) {\n // update core hangup variables\n $call['end_time'] = time();\n if(!$duration) {\n $start_time = $call['field_voipcall_start_time'][0]['value'];\n if($start_time) {\n $duration = $call['end_time'] - $start_time;\n }\n else {\n $duration = isset($_REQUEST['Duration'])?$_REQUEST['Duration']:NULL;\n }\n }\n $call['duration'] = $duration;\n }\n\n // update the voipcall node with the new values\n $call = voipcall_save($call);\n\n // process the call script\n $rc = _voiptwilio_script_handler($call);\n\n return; // NOTE: this function MUST not return any value. If it does, the\n // output to Twilio will get messed up with Drupal hmtl...\n}",
"public function twilio()\n {\n return $this->twilio;\n }",
"function index(){\n $response = new Services_Twilio_Twiml();\n $response->sms(\"Reply with one of the following keywords:\nmonkey, dog, pigeon, owl.\");\n echo $response;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is called as a callback function by array_filter(), to compare the latest data (latest) to the most recent feed data (feed). If this function returns true, the current feed element is included in a new list of elements to use. If this function returns false, the current feed element is excluded. If the feed data is newer, the latest value is unset to avoid both being included in the merged feed. | function compare_arrays($feed) {
global $latest;
// loop through output elements and compare to this element of orig
foreach ($latest as $sitekey => $sitevalue) {
// find elements with the same names
if ($sitevalue['name'] == $feed['name']) {
// see which is newer
if ($sitevalue['reading']['obsTime'] > $feed['reading']['obsTime']) {
// if output is newer, don't include this orig element
return false;
} else {
// if orig is newer, do include it, and unset this element from output
unset($latest[$sitekey]);
return true;
}
}
}
// if none of latest elements match this feed element, include it
return true;
} | [
"function merge_site_data($feed, $latest) {\n global $latest;\n // if feed not found, use new values\n if(!isset($feed)) {\n return $latest;\n }\n // keep elements from $feed that are more recent than indentically named \n // elements in $latest.\n // Older matching elements are unset() from $latest to avoid duplication\n // when arrays are merged.\n $ret = array_filter($feed, 'compare_arrays');\n \n if(count($latest)>0) {\n // now add any remaining contents of $latest to ret\n $ret = array_merge($latest, $ret);\n } else {\n // if no elements are left in $latest, no changes have been\n // made to the data feed.\n $ret = false;\n }\n \n return $ret;\n}",
"private function _parse_feed()\n\t{\n\t\t// Max number of feeds to keep\n\t\t$max_feeds = 100;\n\n\t\t// Today's Date\n\t\t$today = strtotime('now');\n\n\t\t// Get All Feeds From DB\n\t\t$feeds = ORM::factory('feed')->find_all();\n\t\tforeach ($feeds as $feed)\n\t\t{\n\t\t\t$last_update = $feed->feed_update;\n\n\t\t\t// Has it been more than 24 hours since the last update?\n\t\t\t// Since its a manual refresh, we don't need to set a time\n\t\t\tif ( ((int)$today - (int)$last_update) > 0\t)\t// 86400 = 24 hours\n\t\t\t{\n\t\t\t\t// Parse Feed URL using Feed Helper\n\t\t\t\t$feed_data = feed::simplepie( $feed->feed_url );\n\n\t\t\t\tforeach ($feed_data->get_items(0,50) as $feed_data_item)\n\t\t\t\t{\n\t\t\t\t\t$title = $feed_data_item->get_title();\n\t\t\t\t\t$link = $feed_data_item->get_link();\n\t\t\t\t\t$description = $feed_data_item->get_description();\n\t\t\t\t\t$date = $feed_data_item->get_date();\n\t\t\t\t\t$latitude = $feed_data_item->get_latitude();\n\t\t\t\t\t$longitude = $feed_data_item->get_longitude();\n\n\t\t\t\t\t// Make Sure Title is Set (Atleast)\n\t\t\t\t\tif (isset($title) AND !empty($title ))\n\t\t\t\t\t{\n\t\t\t\t\t\t// We need to check for duplicates!!!\n\t\t\t\t\t\t// Maybe combination of Title + Date? (Kinda Heavy on the Server :-( )\n\t\t\t\t\t\t$dupe_count = ORM::factory('feed_item')->where('item_title',$title)->where('item_date',date(\"Y-m-d H:i:s\",strtotime($date)))->count_all();\n\n\t\t\t\t\t\tif ($dupe_count == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Does this feed have a location??\n\t\t\t\t\t\t\t$location_id = 0;\n\t\t\t\t\t\t\t// STEP 1: SAVE LOCATION\n\t\t\t\t\t\t\tif ($latitude AND $longitude)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$location = new Location_Model();\n\t\t\t\t\t\t\t\t$location->location_name = Kohana::lang('ui_admin.unknown');\n\t\t\t\t\t\t\t\t$location->latitude = $latitude;\n\t\t\t\t\t\t\t\t$location->longitude = $longitude;\n\t\t\t\t\t\t\t\t$location->location_date = date(\"Y-m-d H:i:s\",time());\n\t\t\t\t\t\t\t\t$location->save();\n\t\t\t\t\t\t\t\t$location_id = $location->id;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$newitem = new Feed_Item_Model();\n\t\t\t\t\t\t\t$newitem->feed_id = $feed->id;\n\t\t\t\t\t\t\t$newitem->location_id = $location_id;\n\t\t\t\t\t\t\t$newitem->item_title = $title;\n\n\t\t\t\t\t\t\tif (isset($description) AND !empty($description))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$newitem->item_description = $description;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (isset($link) AND !empty($link))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$newitem->item_link = $link;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (isset($date) AND !empty($date))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$newitem->item_date = date(\"Y-m-d H:i:s\",strtotime($date));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Set todays date\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$newitem->item_date = date(\"Y-m-d H:i:s\",time());\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (isset($feed_type) AND ! empty($feed_type))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$newitem->feed_type = $feed_type;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$newitem->save();\n\n\t\t\t\t\t\t\t// Action::feed_item_add - Feed Item Received!\n\t\t\t\t\t\t\tEvent::run('ushahidi_action.feed_item_add', $newitem);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Get Feed Item Count\n\t\t\t\t$feed_count = ORM::factory('feed_item')->where('feed_id', $feed->id)->count_all();\n\t\t\t\tif ($feed_count > $max_feeds)\n\t\t\t\t{\n\t\t\t\t\t// Excess Feeds\n\t\t\t\t\t$feed_excess = $feed_count - $max_feeds;\n\n\t\t\t\t\t// Delete Excess Feeds\n\t\t\t\t\tforeach (ORM::factory('feed_item')\n\t\t\t\t\t\t\t\t\t\t->where('feed_id', $feed->id)\n\t\t\t\t\t\t\t\t\t\t->orderby('id', 'ASC')\n\t\t\t\t\t\t\t\t\t\t->limit($feed_excess)\n\t\t\t\t\t\t\t\t\t\t->find_all() as $del_feed)\n\t\t\t\t\t{\n\t\t\t\t\t\t$del_feed->delete($del_feed->id);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Set feed update date\n\t\t\t\t$feed->feed_update = strtotime('now');\n\t\t\t\t$feed->save();\n\t\t\t}\n\t\t}\n\t}",
"public function filter_existing(array $feeds)\n\t{\n\t\t$ids = array();\n\t\tforeach ($feeds as $key => $row)\n\t\t{\n\t\t\t$ids[$key] = $row['id'];\n\t\t}\n\t\t\n\t\t// get existing\n\t\t$feed = $this->get_feed();\n\t\t$result = $feed->existing_ids($ids);\n\t\t$result = (array)$result;\n\t\t\n\t\tforeach ($result as $row)\n\t\t{\n\t\t\t$id = Dc_Uuid::import($row['feed_id'])->string;\n\t\t\t$id = str_replace('-', '', $id);\n\t\t\t$pos = array_search($id, $ids);\n\t\t\t\n\t\t\tif ($pos !== false)\n\t\t\t{\n\t\t\t\t// remove the id from feeds\n\t\t\t\tunset($feeds[$pos]);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $feeds;\n\t}",
"public function isLatest();",
"function plugin_feedupdatecheck_links2($feed, $topic, $update_data, $limit, $updated_type = '', $updated_topic = '', $updated_id = '')\n{\n global $_TABLES;\n\n $is_current = true;\n\n if ($updated_type != 'links') {\n // we're not interested\n $updated_type = '';\n $updated_topic = '';\n $updated_id = '';\n }\n\n $sql = \"SELECT lid FROM {$_TABLES['links']}\" . links_buildSql ($topic, $limit);\n $result = DB_query ($sql);\n $num = DB_numRows ($result);\n\n $lids = array ();\n for ($i = 0; $i < $num; $i++) {\n $A = DB_fetchArray ($result);\n\n if ($A['lid'] == $updated_id) {\n // this feed has to be updated - no further checks needed\n return false;\n }\n\n $lids[] = $A['lid'];\n }\n $current = implode (',', $lids);\n\n return ($current != $update_data) ? false : true;\n}",
"public function merge(ActivityFeed $newerFeed): ActivityFeed\n {\n if (count($this->getItems()) > 0) {\n $prepend = $newerFeed->getItemsAfter($this->getItems()[0]);\n } else {\n $prepend = $newerFeed->getItems();\n }\n\n return new ActivityFeed(array_merge($prepend, $this->getItems()));\n }",
"public function getFeedItemsFromRSS($feed_url, $feed_id, $new_feed = true)\n {\n\n $content = file_get_contents($feed_url); \n try { \n\n $rss = new SimpleXmlElement($content); \n\n try{\n\n $rss_data = json_decode(json_encode((array)$rss), TRUE);\n $feed_item_array = $rss_data['item'];\n $feed_item_array = array_reverse($feed_item_array);\n\n\n if(!$new_feed){\n // Get the *last* stored Feed Item\n $stmt = $this->db->prepare(\"SELECT * FROM feed_contents WHERE feed_id=:feed_id ORDER BY id DESC LIMIT 1\");\n $stmt->bindParam(\"feed_id\", $feed_id, PDO::PARAM_INT);\n $stmt->execute();\n $feed_last_content = $stmt->fetch(PDO::FETCH_OBJ);\n\n $count=$stmt->rowCount();\n\n // Can use array_column for > PHP 5.5\n // Get all Feed title from the feed(external)\n $feed_titles_array = array_map(function($element) {\n return $element['title'];\n }, $feed_item_array);\n\n // Compare the last stored from DB to feed_titles_array to save new content\n $key_element = array_search($feed_last_content->title, $feed_titles_array);\n\n // if found, remove old content.\n if($key_element){\n $feed_item_array = array_slice($feed_item_array, $key_element+1);\n }elseif($count){\n // If the last saved item is not in the fetched list, then the DB feed content is outdated. So remove old contents in DB.\n $this->deleteFeedContent($feed_id);\n }\n }\n\n /*\n // Insert by single row. Large number of SQL queries\n foreach($feed_item_array as $each_item) {\n \n $stmt = $this->db->prepare(\"INSERT INTO feed_contents(feed_id, title, description, permalink) VALUES ($feed_id, :title, :description, :permalink)\"); \n $stmt->bindParam(\"title\", $each_item['title'], PDO::PARAM_STR);\n\n $description = mb_strimwidth($each_item['description'], 0, 197, '...');\n $stmt->bindParam(\"description\", $description,PDO::PARAM_STR);\n $stmt->bindParam(\"permalink\", $each_item['link'],PDO::PARAM_STR);\n // $stmt->bindParam(\"publish_date\", $each_item->dc:date,PDO::PARAM_STR) ;\n $stmt->execute();\n }\n */\n\n // Insertion by batch. Single query to insert all elements.\n $stmt = $this->db->prepare('INSERT INTO feed_contents (feed_id, title, description, permalink) VALUES (:feed_id, :title, :description, :permalink)');\n\n $this->db->beginTransaction();\n\n foreach ($feed_item_array as $each_item) {\n $description = mb_strimwidth($each_item['description'], 0, 397, '...');\n $stmt->execute([\n ':feed_id' => $feed_id,\n ':title' => $each_item['title'],\n ':description' => $description,\n ':permalink' => $each_item['link'],\n ]);\n }\n\n $this->db->commit();\n\n // update last_updated timeframe.\n $stmt=$this->db->prepare(\"UPDATE feeds SET last_updated = NOW() WHERE id = $feed_id\");\n $stmt->execute();\n\n return \"Success\";\n \n \n }\n catch(PDOException $e) {\n return $e->getMessage();\n }\n\n }\n catch(Exception $e){ \n return $e->getMessage();\n }\n \n }",
"public function compareCollections() {\n foreach ($this->brafton_articles as $article) {\n $brafton_id = $article->getId();\n $this->linker = $this->storeConnection->getLinkArray();\n $existing_article = array_key_exists($brafton_id,$this->linker);\n if($existing_article==true) {\n $need_update = $this->checkForUpdate($this->storeConnection, $this->linker, $article, $brafton_id);\n }\n if(!$existing_article || $need_update){ //adding articles to array that either do not exist in the \n array_push($this->articles_to_post,$article); //Shopify store blog or exist, but require updating\n } else {\n echo '<span style=\"font-size:22px;display: block;text-align: center;\">Article '.$brafton_id.' already exists in blog </span><br />';\n }\n }\n return $this->articles_to_post; //returning list of new and or updated articles\n }",
"public function checkUpdate()\r\n {\r\n \tif (($this->getFrequency() + $this->getLastUpdate()) > time()) {\r\n return $this;\r\n }\r\n\r\n $feedData = array();\r\n\r\n $feedXml = $this->getFeedData();\r\n if ($feedXml && $feedXml->channel && $feedXml->channel->item) {\r\n foreach ($feedXml->channel->item as $item) {\r\n $feedData[] = array(\r\n 'severity' => (int)$item->severity,\r\n 'date_added' => $this->getDate((string)$item->pubDate),\r\n 'title' => (string)$item->title,\r\n 'description' => (string)$item->description,\r\n 'url' => (string)$item->link,\r\n );\r\n }\r\n if ($feedData) {\r\n Mage::getModel('adminnotification/inbox')->parse(array_reverse($feedData));\r\n }\r\n\r\n }\r\n $this->setLastUpdate();\r\n\r\n return $this;\r\n }",
"function fetch_feed() {\n include_once(ABSPATH . WPINC . '/rss.php');\n $rssdata = fetch_rss($this->feed_uri);\n \n // filter out already posted items, if necessary\n if ($lastpost = get_option('digest_post_last_post')) {\n $datefilter = create_function('$item', 'return ('.$lastpost.' < strtotime($item[\\'pubdate\\']));');\n $rssdata->items = array_filter($rssdata->items, $datefilter);\n }\n \n return $rssdata;\n }",
"public function checkUpdate()\n {\n if (($this->getFrequency() + $this->getLastUpdate()) > time()) {\n return $this;\n }\n\n $feedData = array();\n\n $feedXml = $this->getFeedData();\n\n if ($feedXml && $feedXml->channel && $feedXml->channel->item) {\n foreach ($feedXml->channel->item as $item) {\n $feedData[] = array(\n 'severity' => (int)$item->severity,\n 'date_added' => $this->getDate((string)$item->pubDate),\n 'title' => (string)$item->title,\n 'description' => (string)$item->description,\n 'url' => (string)$item->link,\n );\n }\n\n if ($feedData) {\n Mage::getModel('adminnotification/inbox')->parse(array_reverse($feedData));\n }\n\n }\n $this->setLastUpdate();\n\n return $this;\n }",
"private function update_feeds() {\n\t\t// Retrieve feeds\n\t\t$rows = $this->get_feeds();\n\t\tif($rows) {\n\t\t\t$time = time();\n\t\t\tforeach($rows as $row) {\n\t\t\t\t$feed = $row['feed'];\n\t\t\t\t$checkdate = $row['date'];\n\t\t\t\t$query = urldecode($row['query']);\n\t\t\t\t$id = array_pop(explode('/', $feed));\n\t\t\t\t$rss = $this->make_feed($query, $id, $time, $checkdate);\n\t\t\t\t// Updated ?\n\t\t\t\tif($rss) {\n\t\t\t\t\t// Update the date\n\t\t\t\t\t$delete = \"DELETE FROM <\".BASENAME.\"/feeds> { <$rss> dc:date ?old . } \";\n\t\t\t\t\t$this->connector->query($delete);\n\t\t\t\t\t$date = date('c', $time);\n\t\t\t\t\t$insert = \"INSERT INTO <\".BASENAME.\"/feeds> { <$rss> dc:date \\\"$date\\\" . } \";\n\t\t\t\t\t$this->connector->query($insert);\n\t\t\t\t\t// Notify the PuSH hub server\n\t\t\t\t\t$this->push($rss);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static function pruneEntries (\n\t)\t\t\t\t\t// RETURNS <bool> TRUE if the entry is created, FALSE if not.\n\t\n\t// FeedCore::pruneEntries();\n\t{\n\t\t// Get the first ID created (so that we're only running this algorithm on the oldest values)\n\t\tif(!$checkID = (int) Database::selectValue(\"SELECT id FROM feed_data ORDER BY id DESC LIMIT 1\", array()))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Prepare Values\n\t\t$sourceTable = \"feed_data\";\n\t\t$destinationTable = \"feed_data_old\";\n\t\t$sqlWhere = \"id < ? AND date_posted < ?\";\n\t\t$sqlInput = array($checkID + 1000, time() - self::$pruneDuration);\n\t\t$sqlLimit = 1000;\n\t\t\n\t\t// Run the Pruning Action\n\t\treturn DBTransfer::move($sourceTable, $destinationTable, $sqlWhere, $sqlInput, $sqlLimit);\n\t}",
"public function latest_feed_get()\n {\n\n $w_latlng = (bool) $this->get('wlatlng');\n\n\n $lost_item = $this->lost_item->get();\n $found_item = $this->found_item->get();\n $pet = $this->pet_model->get();\n $person = $this->person_model->get();\n\n $items_con['conditions'] = array(\n 'status' => 'New'\n );\n $items = $this->item->get($items_con);\n $feed_items = array();\n //null array fix\n $lost_item = $lost_item != NULL ? $lost_item : array();\n $found_item = $found_item != NULL ? $found_item : array();\n $pet = $pet != NULL ? $pet : array();\n $person = $person != NULL ? $person : array();\n\n $item_count = $items == null? 0: count($items);\n for ($i = 0; $i < $item_count; $i++) {\n\n //Check the item reported by\n $reported_by = $items[$i]['reported_by'];\n $postedBy = \"\";\n $accountImage = \"\";\n if ($reported_by == \"Mobile User\") {\n $account_data = $this->account->get(array(\"id\" => $items[$i]['account_id'])); //get account_data\n $postedBy = $account_data['first_name'] . \" \" . $account_data['last_name'];\n $accountImage = \"http://makatizen.x10host.com/\" . $account_data['image'];\n } else {\n $account_data = $this->barangay->get_brgyuser_details(array(\"id\" => $items[$i]['account_id']));\n $user_data = $this->user->getRows(array('id' => $account_data['brgy_account_id']));\n\n //Get Barangay Details\n $barangayData = $this->barangay->get(array('id' => $user_data['brgy_id']));\n $accountImage = base_url() . $barangayData['logo'];\n $postedBy = \"Brgy. \" . ucwords(strtolower($barangayData['name']));\n }\n\n foreach ($lost_item as $row) {\n $location_data = $this->item_location->get(array(\"id\" => $row['location_id']));\n if ($items[$i]['item_id'] == $row['id'] && $items[$i]['type'] == \"Lost\" && $items[$i]['report_type'] == \"Personal Thing\") {\n $item_images = $this->item->get_item_images($items[$i]['id']);\n\n $feed_items[$i] = array(\n \"item_id\" => (int)$items[$i]['id'],\n \"item_type\" => $items[$i]['type'],\n \"item_created_at\" => $items[$i]['published_at'],\n \"item_status\" => $items[$i]['status'],\n \"account_name\" => $postedBy,\n \"account_image_url\" => $accountImage,\n \"item_image_url\" => $item_images[0]['file_path'],\n \"item_title\" => ucfirst(strtolower($row['item_name'])),\n \"item_description\" => ucfirst($row['item_description']),\n \"item_location\" => $row['additional_location_info'] . \" \" . $location_data['name'],\n );\n\n if ($w_latlng) {\n $feed_items[$i]['location_latlng'] = array(\n 'latitude' => (double) $location_data['latitude'],\n 'longitude' => (double)$location_data['longitude']\n );\n }\n\n }\n }\n\n foreach ($found_item as $row) {\n $location_data = $this->item_location->get(array(\"id\" => $row['location_id']));\n if ($items[$i]['item_id'] == $row['id'] && $items[$i]['type'] == \"Found\" && $items[$i]['report_type'] == \"Personal Thing\") {\n $item_images = $this->item->get_item_images($items[$i]['id']);\n $feed_items[$i] = array(\n \"item_id\" => (int)$items[$i]['id'],\n \"item_type\" => $items[$i]['type'],\n \"item_created_at\" => $items[$i]['published_at'],\n \"item_status\" => $items[$i]['status'],\n \"account_name\" => $postedBy,\n \"account_image_url\" => $accountImage,\n \"item_image_url\" => $item_images[0]['file_path'],\n \"item_title\" => ucfirst(strtolower($row['item_name'])),\n \"item_description\" => ucfirst($row['item_description']),\n \"item_location\" => $row['additional_location_info'] . \" \" . $location_data['name'],\n );\n\n if ($w_latlng) {\n $feed_items[$i]['location_latlng'] = array(\n 'latitude' => (double) $location_data['latitude'],\n 'longitude' => (double)$location_data['longitude']\n );\n }\n }\n }\n\n foreach ($pet as $row) {\n $location_data = $this->item_location->get(array(\"id\" => $row['location_id']));\n if ($items[$i]['item_id'] == $row['id'] && $items[$i]['report_type'] == \"Pet\") {\n $item_images = $this->item->get_item_images($items[$i]['id']);\n $feed_items[$i] = array(\n \"item_id\" => (int)$items[$i]['id'],\n \"item_type\" => $items[$i]['type'],\n \"item_created_at\" => $items[$i]['published_at'],\n \"item_status\" => $items[$i]['status'],\n \"account_name\" => $postedBy,\n \"account_image_url\" => $accountImage,\n \"item_image_url\" => $item_images[0]['file_path'],\n \"item_title\" => $row['breed'] . \" \" . $row['type'],\n \"item_description\" => ucfirst($row['description']),\n \"item_location\" => $row['additional_location_info'] . \" \" . $location_data['name'],\n );\n\n if ($w_latlng) {\n $feed_items[$i]['location_latlng'] = array(\n 'latitude' => (double) $location_data['latitude'],\n 'longitude' => (double)$location_data['longitude']\n );\n }\n }\n }\n\n foreach ($person as $row) {\n $location_data = $this->item_location->get(array(\"id\" => $row['location_id']));\n if ($items[$i]['item_id'] == $row['id'] && $items[$i]['report_type'] == \"Person\") {\n $item_images = $this->item->get_item_images($items[$i]['id']);\n $feed_items[$i] = array(\n \"item_id\" => (int)$items[$i]['id'],\n \"item_type\" => $items[$i]['type'],\n \"item_created_at\" => $items[$i]['published_at'],\n \"item_status\" => $items[$i]['status'],\n \"account_name\" => $postedBy,\n \"account_image_url\" => $accountImage,\n \"item_image_url\" => $item_images[0]['file_path'],\n \"item_title\" => ucfirst(strtolower($row['sex'] . \" \" . $row['age_group'] . \" \" . $row['age_range'])) . \" years old\",\n \"item_description\" => ucfirst($row['description']),\n \"item_location\" => $row['additional_location_info'] . \" \" . $location_data['name'],\n );\n\n if ($w_latlng) {\n $feed_items[$i]['location_latlng'] = array(\n 'latitude' => (double) $location_data['latitude'],\n 'longitude' => (double)$location_data['longitude']\n );\n }\n }\n }\n }\n\n if ($feed_items) {\n $this->response(array(\n \"total_results\" => count($feed_items),\n \"feed_items\" => $feed_items\n ), REST_Controller::HTTP_OK);\n } else {\n $this->response(array(\n \"total_results\" => 0,\n \"feed_items\" => array()\n ), REST_Controller::HTTP_OK);\n }\n }",
"public function get_feed() {\n\t\t$added_items = [];\n\n\t\t$feed_items = $this->retrieve_feed();\n\t\tif ( ! $feed_items || empty( $feed_items ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ( $feed_items as $feed_item ) {\n\t\t\tif ( ! $this->item_exists( $feed_item->Id ) ) {\n\t\t\t\t$id = $this->insert_feed_item_as_post( $feed_item );\n\t\t\t\t$added_items[] = $id;\n\t\t\t}\n\t\t}\n\n\t\treturn $added_items;\n\t}",
"private function _filter_images($feed) \n {\n $images = array();\n $links = array();\n $combined = array();\n\n if (!empty($feed->statuses)) {\n\n foreach ($feed->statuses as $tweet) {\n\n // If it is twitter media/image\n if (isset($tweet->entities) && isset($tweet->entities->media)) {\n\n foreach ($tweet->entities->media as $image) {\n\n if (!empty($image->media_url) && !empty($image->url)) {\n\n $images[md5($image->media_url)]['img'] = $image->media_url;\n $images[md5($image->media_url)]['source'] = $image->url;\n $images[md5($image->media_url)]['date'] = $this->format_date($tweet->created_at, true);\n\n }\n\n }\n\n }\n\n // If it is links to other networks\n if (isset($tweet->entities) && isset($tweet->entities->urls)) {\n\n foreach ($tweet->entities->urls as $url) {\n\n if (!empty($url->expanded_url) && !empty($url->url)) {\n\n $links[md5($url->expanded_url)]['img'] = $url->expanded_url;\n $links[md5($url->expanded_url)]['source'] = $url->url;\n $links[md5($url->expanded_url)]['date'] = $this->format_date($tweet->created_at, true);\n\n }\n\n }\n\n }\n\n }\n\n $combined = array_merge($this->_extractimages($links), $images);\n\n if ($combined) {\n // Remove any doubles\n $combined = array_map('unserialize', array_unique(array_map('serialize', $combined)));\n\n // Remove images without img url or source url\n foreach ($combined as $key => $image) {\n if(empty($image['img']) || empty($image['source'])) {\n unset($combined[$key]);\n }\n }\n }\n\n return $combined;\n\n } else {\n return array();\n }\n }",
"public function checkFeed()\n {\n /* @see Belvg_All_Model_Feed */\n Mage::getModel('belvgall/feed')->checkUpdate();\n return $this;\n }",
"public static function isFeed() {\n\t\treturn self::$current_get['feed'] != false;\n\t}",
"function test_get_feed_posts_filter() {\n global $uc_dailydigest_widget;\n\n $original = $uc_dailydigest_widget->get_feed_posts($this->test_feed);\n $pre_filter_length = sizeof($original);\n\n $filtered1 = $uc_dailydigest_widget->get_feed_posts($this->test_feed, \"UConn Today\");\n $one_filter_length = sizeof($filtered1);\n\n $this->assertGreaterThan( $one_filter_length, $pre_filter_length );\n\n $filtered2 = $uc_dailydigest_widget->get_feed_posts($this->test_feed, \"UConn Today; Research, Funding, and Awards\");\n\n $two_filter_length = sizeof($filtered2);\n\n $this->assertGreaterThan( $two_filter_length, $one_filter_length );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the project structure (arms, events, forms, fields) of the current or specified project. The returned array is structured like so: [ "pid" => "project_id", "record_id" => "record_id_field_name", "longitudinal" => true|false, "forms" => [ "form name" => [ "name" => "form name", "repeating" => true|false, "repeating_event" => true|false, "arms" => [ arm_id => [ "id" => arm_id ], ... ], "events" => [ event_id => [ "id" => event_id, "name" => "event name", "repeating" => true|false ], ... ], "fields" => [ "field name", "field name", ... ] ], ... ], "events" => [ event_id => [ "id" => event_id, "name" => "event name", "repeating" => true|false, "arm" => arm_id, "forms" => [ "form_name" => [ "name" => "form_name", "repeating" => true|false ], ... ] ], ... ], "arms" => [ arm_id => [ "id" => arm_id "events" => [ event_id => [ "id" => event_id, "name" => "event name" ], ... ], "forms" => [ "form name" => [ "name" => "form name" ], ... ] ], ... ], "fields" => [ "field name" => [ "name" => "field name", "form" => "form name", "repeating_form" => true|false, "repeating_event" => true|false, "events" => [ event_id => [ (same as "events" => event_id see above) ], ... ], "metadata" => [ (same as in $Proj) ] ], ... ] ] | function getProjectDataStructure($pid = null) {
$pid = $pid === null ? $this->getProjectId() : $this->framework->requireProjectId($pid);
// Check cache.
if (array_key_exists($pid, self::$ProjectDataStructureCache)) return self::$ProjectDataStructureCache[$pid];
// Use REDCap's Project class to get some of the data. Specifically, unique event names are not in the backend database.
$proj = new \Project($pid);
$proj->getUniqueEventNames();
$proj->getRepeatingFormsEvents();
// Prepare return data structure.
$ps = array(
"pid" => $pid,
"longitudinal" => $proj->longitudinal,
"record_id" => $this->framework->getRecordIdField($pid),
"forms" => array(),
"events" => array(),
"arms" => array(),
"fields" => array(),
);
// Gather data - arms, events, forms.
foreach ($proj->events as $this_arm) {
$this_arm_id = $this_arm["id"];
$ps["arms"][$this_arm_id]["id"] = $this_arm_id;
$ps["arms"][$this_arm_id]["events"] = array();
$ps["arms"][$this_arm_id]["forms"] = array();
foreach ($this_arm["events"] as $this_event_id => $this_event) {
$ps["arms"][$this_arm_id]["events"][$this_event_id] = array (
"id" => $this_event_id,
"name" => $proj->uniqueEventNames[$this_event_id]
);
$ps["events"][$this_event_id]["id"] = $this_event_id;
$ps["events"][$this_event_id]["name"] = $proj->uniqueEventNames[$this_event_id];
$ps["events"][$this_event_id]["repeating"] = false;
$ps["events"][$this_event_id]["arm"] = $this_arm_id;
foreach ($proj->eventsForms[$this_event_id] as $this_form) {
$ps["arms"][$this_arm_id]["forms"][$this_form] = array (
"name" => $this_form
);
$ps["events"][$this_event_id]["forms"][$this_form] = array (
"name" => $this_form,
"repeating" => false
);
$ps["forms"][$this_form]["name"] = $this_form;
$ps["forms"][$this_form]["repeating"] = false;
$ps["forms"][$this_form]["repeating_event"] = false;
$ps["forms"][$this_form]["arms"][$this_arm_id] = array(
"id" => $this_arm_id
);
$ps["forms"][$this_form]["events"][$this_event_id] = array(
"id" => $this_event_id,
"name" => $proj->uniqueEventNames[$this_event_id],
"repeating" => false
);
}
}
}
// Gather data - fields.
foreach ($proj->metadata as $this_field_name => $this_field_info) {
$this_form = $this_field_info["form_name"];
$ps["fields"][$this_field_name] = array (
"name" => $this_field_name,
"form" => $this_form,
"repeating_form" => false,
"repeating_event" => false
);
$ps["forms"][$this_form]["fields"][] = $this_field_name;
}
// Gather data - repeating forms, events.
$repeating = $this->getRepeatingFormsEvents($pid);
foreach ($repeating["forms"] as $eventId => $forms) {
foreach ($forms as $form) {
$ps["events"][$eventId]["forms"][$form]["repeating"]= true;
$ps["forms"][$form]["repeating"] = true;
// Augment fields.
foreach ($ps["fields"] as $field => &$field_info) {
if ($field_info["form"] == $form) {
$field_info["repeating_form"] = true;
}
}
}
}
foreach ($repeating["events"] as $eventId => $forms) {
$ps["events"][$eventId]["repeating"] = true;
foreach ($forms as $form) {
$ps["forms"][$form]["repeating_event"] = true;
$ps["forms"][$form]["events"][$eventId]["repeating"] = true;
// Augment fields.
foreach ($ps["fields"] as $field => &$field_info) {
if ($field_info["form"] == $form) {
$field_info["repeating_event"] = true;
}
}
}
}
// Augment fields with events.
foreach ($ps["forms"] as $formName => $formInfo) {
foreach ($formInfo["fields"] as $field) {
foreach ($formInfo["events"] as $eventId => $_) {
$ps["fields"][$field]["events"][$eventId] = $ps["events"][$eventId];
}
}
}
// Augment fields with field metadata.
foreach ($ps["fields"] as $field => &$field_data) {
$field_data["metadata"] = $proj->metadata[$field];
}
// Add to cache.
self::$ProjectDataStructureCache[$pid] = $ps;
return $ps;
} | [
"function getProjectDataStructure($pid = null) {\n\n $pid = $pid === null ? $this->getProjectId() : $this->framework->requireProjectId($pid);\n\n // Check cache.\n if (array_key_exists($pid, self::$ProjectDataStructureCache)) return self::$ProjectDataStructureCache[$pid];\n\n // Prepare return data structure.\n $ps = array(\n \"pid\" => $pid,\n \"project\" => $this->getProject(),\n \"longitudinal\" => $this->getProject()->longitudinal,\n \"multiple_arms\" => $this->getProject()->multiple_arms,\n // Events are ordered by day_offset in redcap_events_metadata\n \"first_event_id\" => array_key_first($this->getProject()->events[1][\"events\"]), \n \"record_id\" => $this->framework->getRecordIdField($pid),\n \"forms\" => array(),\n \"events\" => array(),\n \"arms\" => array(),\n \"fields\" => array(),\n );\n\n // Gather data - arms, events, forms.\n // Some of this might be extractable from $proj, but this is just easier.\n $params = array($pid);\n $sql = \"SELECT a.arm_id, m.event_id, f.form_name\n FROM redcap_events_arms a\n JOIN redcap_events_metadata m\n ON a.arm_id = m.arm_id AND a.project_id = ?\n JOIN redcap_events_forms f\n ON f.event_id = m.event_id\";\n if (!$ps[\"longitudinal\"]) {\n // Limit to the \"first\" event (i.e. the one in Project) - there may be more if the \n // project has ever been longitudinal.\n $sql .= \" AND m.event_id = ?\";\n array_push($params, $ps[\"first_event_id\"]);\n }\n $result = $this->framework->query($sql, $params);\n while ($row = $result->fetch_assoc()) {\n $event_id = $row[\"event_id\"] * 1;\n $event_name = $this->getProject()->uniqueEventNames[$event_id];\n $arm_id = $row[\"arm_id\"] * 1;\n $form_name = $row[\"form_name\"];\n\n $ps[\"arms\"][$arm_id][\"id\"] = $arm_id;\n $ps[\"arms\"][$arm_id][\"events\"][$event_id] = array(\n \"id\" => $event_id,\n \"name\" => $event_name,\n );\n $ps[\"arms\"][$arm_id][\"forms\"][$form_name] = array(\n \"name\" => $form_name\n );\n $ps[\"events\"][$event_id][\"id\"] = $event_id;\n $ps[\"events\"][$event_id][\"name\"] = $event_name;\n $ps[\"events\"][$event_id][\"repeating\"] = false;\n $ps[\"events\"][$event_id][\"arm\"] = $arm_id;\n $ps[\"events\"][$event_id][\"forms\"][$form_name] = array(\n \"name\" => $form_name,\n \"repeating\" => false\n );\n $ps[\"forms\"][$form_name][\"name\"] = $form_name;\n $ps[\"forms\"][$form_name][\"repeating\"] = false;\n $ps[\"forms\"][$form_name][\"repeating_event\"] = false;\n $ps[\"forms\"][$form_name][\"arms\"][$arm_id] = array(\n \"id\" => $arm_id\n );\n $ps[\"forms\"][$form_name][\"events\"][$event_id] = array(\n \"id\" => $event_id,\n \"name\" => $event_name,\n \"repeating\" => false\n );\n }\n // Gather data - fields. Again, this could be got from $proj, but this is more straightforward to process.\n // TODO: Do indeed get this from Project. This is more complicated than it seems.\n \n $result = $this->framework->query(\"\n SELECT field_name, form_name\n from redcap_metadata\n where project_id = ?\n order by field_order asc\n \", $pid);\n while ($row = $result->fetch_assoc()) {\n $ps[\"fields\"][$row[\"field_name\"]] = array(\n \"name\" => $row[\"field_name\"],\n \"form\" => $row[\"form_name\"],\n \"repeating_form\" => false,\n \"repeating_event\" => false,\n );\n $ps[\"forms\"][$row[\"form_name\"]][\"fields\"][] = $row[\"field_name\"];\n }\n // Gather data - repeating forms, events.\n $repeating = $this->getRepeatingFormsEvents($pid);\n foreach ($repeating[\"forms\"] as $eventId => $forms) {\n foreach ($forms as $form) {\n $ps[\"events\"][$eventId][\"forms\"][$form][\"repeating\"]= true;\n $ps[\"forms\"][$form][\"repeating\"] = true;\n // Augment fields.\n foreach ($ps[\"fields\"] as $field => &$field_info) {\n if ($field_info[\"form\"] == $form) {\n $field_info[\"repeating_form\"] = true;\n }\n }\n }\n }\n foreach ($repeating[\"events\"] as $eventId => $forms) {\n $ps[\"events\"][$eventId][\"repeating\"] = true;\n foreach ($forms as $form) {\n $ps[\"forms\"][$form][\"repeating_event\"] = true;\n $ps[\"forms\"][$form][\"events\"][$eventId][\"repeating\"] = true;\n // Augment fields.\n foreach ($ps[\"fields\"] as $field => &$field_info) {\n if ($field_info[\"form\"] == $form) {\n $field_info[\"repeating_event\"] = true;\n }\n }\n }\n }\n // Augment fields with events.\n foreach ($ps[\"forms\"] as $formName => $formInfo) {\n foreach ($formInfo[\"fields\"] as $field) {\n foreach ($formInfo[\"events\"] as $eventId => $_) {\n $ps[\"fields\"][$field][\"events\"][$eventId] = $ps[\"events\"][$eventId];\n }\n }\n }\n // Augment fields with field metadata.\n foreach ($ps[\"fields\"] as $field => &$field_data) {\n $field_data[\"metadata\"] = $this->getProject()->metadata[$field];\n }\n\n // Add to cache.\n self::$ProjectDataStructureCache[$pid] = $ps;\n\n return $ps;\n }",
"function projectData( $project, $fields )\n{\n $select = DB::table( prefix( 'projects' ) )->select( $fields, [ 'where' => 'id = \\'' . DB::escape( $project ) . '\\'' ] )->getEntry( 0 );\n if( is_array( $fields ) )\n return $select->getFields();\n else\n return $select->getField( $fields );\n}",
"public function getProjectInfo()\n {\n if ($this->id) {\n return [\n 'id' => $this->id,\n 'code' => $this->getCode(),\n 'name' => $this->getName(),\n 'path' => $this->getPaths(),\n 'langs' => $this->getLangsIds(),\n 'lang' => $this->getLang()\n ];\n }\n\n return [];\n }",
"function getProject() {\n\n $module_pagedata = array();\n $ar = split(\";\", $GLOBALS[\"pagedata\"][\"module\"]);\n for ($c = 0; $c < sizeof($ar); $c++) {\n $a = split(\"=\", $ar[$c]);\n $module_pagedata[$a[0]] = $a[1];\n }\n\n if ($module_pagedata[\"projects\"] != \"\") {\n $this->project = $module_pagedata[\"projects\"];\n }\n }",
"public function getRelatedProject(){\r\n $lRet = Array();\r\n $lJid = $this -> mJid;\r\n $lSrc = $this -> mSrc;\r\n $lArrShowFields = CCor_Cfg::get('job-rel.projects.fields',Array());\r\n // Id is mandatory, for link\r\n if (!in_array('id',$lArrShowFields)){\r\n array_unshift($lArrShowFields,'id');\r\n }\r\n $lStrSqlShowFields = ''; // Fields to show\r\n\r\n // preparation for SQL\r\n foreach ($lArrShowFields as $lKey){\r\n $lStrSqlShowFields.= 'p.'.$lKey.',';\r\n }\r\n $lStrSqlShowFields = substr($lStrSqlShowFields,0,-1);\r\n $lSql = 'SELECT '.$lStrSqlShowFields.' FROM al_job_pro_'.MID.' as p';\r\n $lSql.= ' LEFT JOIN al_job_sub_'.MID.' as s on p.id= s.pro_id WHERE jobid_'.$lSrc.'=\"'.addslashes($lJid).'\"';\r\n $lQry = new CCor_Qry($lSql);\r\n\r\n if ($lRow = $lQry -> getAssoc()){\r\n $lRet = $lRow;\r\n }\r\n return $lRet;\r\n }",
"function get_projects(){\n\t$query = \"SELECT `id`,`name` FROM \".$GLOBALS['imgt_tbPrefix'].\"project ORDER BY id;\";\n\t$result = mysql_query($query,$GLOBALS['imgt_sql_conn']) or die(mysql_errno().\":\".mysql_error());\n\t$index = 0;\n\twhile ($row = mysql_fetch_array($result)) {\n\t\t$projects[$index]['id'] = $row['id'];\n\t\t$projects[$index]['name'] = $row['name'];\n\t\t$index ++;\n\t}\n\treturn $projects;\n}",
"private function ListProjects()\n {\n include_once('../cdash/common.php');\n $query = pdo_query(\"SELECT id,name FROM project WHERE public=1 ORDER BY name ASC\");\n while($query_array = pdo_fetch_array($query))\n {\n $project['id'] = $query_array['id'];\n $project['name'] = $query_array['name'];\n $projects[] = $project;\n }\n return $projects;\n }",
"public function getProjects();",
"function currentProject($field = null) {\n\t\tif (isset($_SESSION[\"Project\"][\"id\"])) {\n\t\t\t$currentProjectId = $_SESSION[\"Project\"][\"id\"];\n\t\t\tif (isset($field) && $field == 'id') {\n\t\t\t\treturn $currentProjectId;\n\t\t\t} else {\n\t\t\t\t$this->loadModel('Project');\n\t\t\t\t$currentProject = $this->Project->find('first', array(\n\t\t\t\t\t'recursive' => 0,\n\t\t\t\t\t'conditions' => array('Project.id' => $currentProjectId)\n\t\t\t\t));\n\t\t\t\tif (isset($field) && $field != null) {\n\t\t\t\t\treturn $currentProject['Project'][$field];\n\t\t\t\t} else {\n\t\t\t\t\treturn $currentProject['Project'];\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function getAllProjects() {\r\n\t\t\t$sql = \"SELECT * FROM Project\";\r\n\t\t\treturn parent::get($sql);\r\n\t\t}",
"public function ProjectInformation();",
"public function get_projects() {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}",
"function get_project($id)\n {\n return $this->db->get_where('project',array('id'=>$id))->row_array();\n }",
"private function getAllProjects()\n {\n $url = $this->base_uri.'project?expand=description,lead,issueTypes,url,projectKeys';\n $projects = $this->request($url);\n return $projects;\n }",
"public function read($projectId = null)\n {\n // This is ugly, but we have to do this to prevent an\n // unexpected T_PAAMAIYM_NEKUDOTAYIM\n $container = $this->container;\n\n if (!empty($projectId)) {\n $project = $this->orm->find('\\Architect\\ORM\\src\\Project', $projectId);\n\n if (empty($project)) {\n $container['result']->setData(array('message' => 'Project not found'));\n $container['result']->setCode($container['response_code']::ERROR_NOTFOUND);\n return $container['result'];\n }\n\n $context = $project->getContext();\n\n $container['result']->setData(array(\n 'project_id' => $project->getId(),\n 'project_name' => $project->getProjectName(),\n 'project_description' => $project->getProjectDescription(),\n 'context' => !empty($context) ? $context : false,\n 'tasks' => $this->returnTasks($project->getTasks()),\n 'created' => $project->getCreated(),\n 'updated' => $project->getUpdated(),\n ));\n\n return $container['result'];\n }\n\n $repository = $this->orm->getRepository('\\Architect\\ORM\\src\\Project');\n $projects = $repository->findAll();\n\n $result = array();\n\n foreach ($projects as $project) {\n $context = $project->getContext();\n\n $result[] = array(\n 'project_id' => $project->getId(),\n 'project_name' => $project->getProjectName(),\n 'project_description' => $project->getProjectDescription(),\n 'context' => !empty($context) ? $context : false,\n 'created' => $project->getCreated(),\n 'updated' => $project->getUpdated(),\n );\n }\n\n $container['result']->setData($result);\n return $container['result'];\n }",
"function all_projects() {\r\n if(empty($this->_projects)) {\r\n return array('No Projects');\r\n } else {\r\n return $this->_projects;\r\n }\r\n }",
"public function getProjects() {\n $qResult = $this->sql->query('SELECT repo, descr, languages FROM projects');\n if(!$qResult) {\n die('Failed to get projects');\n }\n $result = [];\n while ($row = $qResult->fetchArray(SQLITE3_ASSOC)) {\n $result[] = $row;\n }\n return $result;\n }",
"public function getAllProjects()\n {\n return $this->sendRequest('project');\n }",
"public function getProjects()\n {\n return $this->getApi()->project()->query(['contact' => $this->getUrl()]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
insert car details along with user_id | public function create_car($user_id, $car_no, $car_model, $car_layout, $file_name, $ac_availability, $music_system, $air_bag, $seat_belt, $created_at)
{
$stmt = $this->conn->prepare("INSERT INTO car_details(user_id,car_no, car_model, car_layout, car_image, ac_availability,music_system,air_bag, seat_belt,creation_time) VALUES(?,?,?,?,?,?,?,?,?,?)");
$stmt->bind_param("ssssssssss", $user_id, $car_no, $car_model, $car_layout, $file_name, $ac_availability, $music_system, $air_bag, $seat_belt, $created_at);
$result = $stmt->execute();
$stmt->close();
if ($result) {
return true;
} else {
return false;
}
} | [
"public function insert_to_car_table()\n {\n $this->connect();\n $this->connection->exec(\"INSERT INTO car(Car_Id, Car, Car_Color, Year_of_manufacture)VALUES\n ('1','ford focus','blue','1993'),\n ('2','fiat','red','1993'),\n ('3','golf','black','1998'),\n ('4','fiat','red','1998'),\n ('5','nissan','white','1999'),\n ('6','fiat','red','1999'),\n ('7','bmw','white','1999'),\n ('8','nissan','white','2000'),\n ('9','fiat','red','2000'),\n ('10','bmw','white','2000'),\n ('11','golf','black','2003'),\n ('12','bmw','white','2003'),\n ('13','golf','black','2008'),\n ('14','ford focus','blue','2008'),\n ('15','fiat','blue','2008'),\n ('16','nissan','white','2018'),\n ('17','fiat','blue','2018')\"); \n $this->disconnect(); \n }",
"public function add_details() {\n $oldData = $this->Session->read('Car');\n if(!empty($this->request->data) && $this->request->is('post')) {\n $sessionId = substr(md5(uniqid(rand(), TRUE)), 16, 16);\n $this->Session->write('Car', $this->request->data);\n $this->Session->write('session_id', $sessionId);\n $this->redirect(array('controller' => 'cars', 'action' => 'add_user', '?' => array('session_id' => $sessionId)));\n } else if(!empty($oldData)) {\n $this->request->data = $oldData;\n }\n $brands = $this->Brand->find('list');\n $brand_models = $this->BrandModel->find('list');\n $categories = $this->Category->find('list');\n $countries = $this->Country->find('list');\n $fuels = $this->Fuel->find('list');\n $regions = $this->Region->find('list');\n $towns = $this->Town->find('list');\n\n $this->set(compact('brands', 'brand_models', 'categories', 'countries', 'fuels', 'regions', 'towns'));\n }",
"function createNewCar($carInfo) {\n $this->db->trans_start();\n $this->db->insert('tbl_car_detail', $carInfo);\n \n $insert_id = $this->db->insert_id();\n \n $this->db->trans_complete();\n return $insert_id;\n }",
"public function insert() {\n\t\t$this->insert_user();\n\t}",
"function add_car_detail($params)\n {\n try{\n $this->db->insert('car_detail',$params);\n return $this->db->insert_id();\n } catch (Exception $ex) {\n throw new Exception('Car_detail_model model : Error in add_car_detail function - ' . $ex);\n } \n }",
"public function setUpCarProfile(array $data, $user){\n \n $this->car->make = $data['make'];\n $this->car->model = $data['model'];\n $this->car->year = $data['year'];\n if (!is_null($data['car_profile_pic'])){\n $this->car->car_profile_pic = $data['car_profile_pic'];\n }\n if (!is_null($data['picture1'])){\n $this->car->picture1 = $data['picture1'];\n }\n if (!is_null($data['picture2'])){\n $this->car->picture2 = $data['picture2'];\n }\n $this->car->user = $user;\n \n $this->em->persist($this->car);\n $this->em->flush();\n }",
"public function ocenture_insert() {\r\n\r\n Logger::log(\"inserting user manually into ocenture\");\r\n require_once( OCENTURE_PLUGIN_DIR . 'lib/Ocenture.php' );\r\n\r\n $ocenture = new Ocenture_Client($this->clientId);\r\n\r\n $params = [\r\n 'args' => [\r\n 'ProductCode' => 'YP83815',\r\n 'ClientMemberID' => 'R26107633',\r\n 'FirstName' => 'Francoise ',\r\n 'LastName' => 'Rannis Arjaans',\r\n 'Address' => '801 W Whittier Blvd',\r\n 'City' => 'La Habra',\r\n 'State' => 'CA',\r\n 'Zipcode' => '90631-3742',\r\n 'Phone' => '(562) 883-3000',\r\n 'Email' => 'francoisearjaans@gmail.com',\r\n 'Gender' => 'Female',\r\n 'RepID' => '101269477',\r\n ]\r\n ];\r\n \r\n Logger::log($params);\r\n $result = $ocenture->createAccount($params);\r\n //if ($result->Status == 'Account Created') \r\n {\r\n $params['args']['ocenture'] = $result;\r\n $this->addUser($params['args']); \r\n }\r\n Logger::log($result);\r\n \r\n }",
"public function add_owner($id){\n $car = Car::find($id);\n $owner=new Owner();\n $owner->name = 'Sonam';\n $car->owner()->save($owner);\n }",
"public function addUserCarRecall($userCarId)\n\t{\n\t\t//get year make model of given id\n\t\t$stmt = $this->conn->prepare('SELECT year, make, model from userCar where id = :id');\n\t\t$stmt->bindParam(':id', $userCarId);\n\t\t$stmt->setFetchMode(PDO::FETCH_ASSOC);\n\t\t$stmt->execute();\t\t\n\n\t\t$res = $stmt->fetch();\n\t\t$year = $res['year'];\n\t\t$make = $res['make'];\n\t\t$model = $res['model'];\n\n\t\t//get all recall ids of given year,make,model\n\t\t$results = $this->getCarRecalls($year,$make,$model);\n\n\t\t//for each id insert row into table with userCarId\n\t\tforeach($results as $result)\n\t\t{\n\t\t $recallId = $result['id'];\n\t\t $this->conn->query(\"insert into userCarRecall (id, recallId, checked) values($userCarId,$recallId,0)\");\n\t\t} \n\t}",
"function insertUser(){\n\t\t$this->copyFrom('POST');\n\t\t$this->save(); // execute insert into the table\n }",
"public function create($car_id) {\n\t\t\t$slug = $this->input->post('slug');\n\t\t\t$data['car'] = $this->carslisting_model->get_cars($slug);\n\t\t\t// Query for getting comments\n\t\t\t$data['comments'] = $this->car_comment_model->get_comments($car_id);\n\n\t\t\t// Validation rule for comment\n\t\t\t$this->form_validation->set_rules('body', 'Body', 'required');\n\n\t\t\t\t// Check if comment validation is FALSE, if FALSE redirect to view\n\t\t\t\tif ($this->form_validation->run() === FALSE) {\n\t\t\t\t\t$this->load->view('templates/header');\n\t\t\t\t\t$this->load->view('carslisting/view', $data);\n\t\t\t\t\t$this->load->view('templates/footer');\n\t\t\t\t} else {\n\t\t\t\t\t// If comment validation is successful and no errors query for creating comment is executed\n\t\t\t\t\t$this->car_comment_model->create_comment($car_id);\n\t\t\t\t\t// Redirect to carslisting view page after query execution\n\t\t\t\t\tredirect('carslisting/' . $slug);\n\t\t\t\t}\n\n\t\t}",
"function insert_into_business_user(){\n\t\t// Set parameters and execute\n\t\t/*\n\t\t$first_name = \"Michael\";\n\t\t$last_name = \"Thiessen\";\n\t\t$location = 1;\n\t\t$password = \"1234567\";\n\t\t$email = \"michael@demo.com\";\n\t\t$image = 1;\n\t\t$address = \"ул. Черно Море 43\";\n\t\t$telephone_num = 0898346423;\n\t\t*/\n\t\tglobal $conn,$app;\n\t\t$req = $app->request();\n\t\t$body = json_decode($req->getBody());\n\t\t\n\t\t$sql = \"INSERT INTO user (first_name, last_name, location, password, email, image) VALUES (?, ?, ?, ?, ?, ?)\";\n\t\t$stmt = $conn->prepare($sql);\n\t\tif($stmt === false) {\n\t\t echo json_encode('Wrong SQL: ' . $sql . ' Error: ' . $conn->errno . ' ' . $conn->error, E_USER_ERROR);\n\t\t return;\n\t\t}\n\t\t$sql1 = \"INSERT INTO business_user (address, telephone_num, user) VALUES (?, ?, ?)\";\n\t\t$stmt1 = $conn->prepare($sql1);\n\t\tif($stmt1 === false) {\n\t\t echo json_encode('Wrong SQL: ' . $sql . ' Error: ' . $conn->errno . ' ' . $conn->error, E_USER_ERROR);\n\t\t return;\n\t\t}\n\t\telse {\n\t\t\t$conn->query(\"START TRANSACTION\");\n\t\t\t\n\t\t // Bind parameters. Types: s = string, i = integer, d = double, b = blob \n\t\t $stmt->bind_param(\"ssissi\", $body->first_name, $body->last_name, $body->location, $body->password, $body->email, $body->image);\n\t\t $stmt->execute();\n\t\t\t\n\t\t\t$last_user_id = $conn->insert_id;\n\t\t\techo \"last_user_id: $last_user_id\";\n\t\t\t\n\t\t\t // Bind parameters. Types: s = string, i = integer, d = double, b = blob \n\t\t $stmt1->bind_param(\"ssi\", $body->address, $body->telephone_num, $last_user_id);\n\t\t $stmt1->execute();\n\t\t\t\n\t\t\t$conn->query(\"COMMIT\");\n\t\t\t$conn->close();\n\t\t\t//echo \"New records created successfully\\n\";\n\t\t}\n\t}",
"function insert_into_special_recipe(){\n\t\t// Set parameters and execute\n\t\t/*\n\t\t$user = 42;\n\t\t$recipe = 33;\n\t\t*/\n\t\tglobal $app, $conn;\n\t\t$req = $app->request();\n\t\t$body = json_decode($req->getBody());\n\t\t$sql = \"INSERT INTO special_recipe (user, recipe) VALUES (?, ?)\";\n\t\t$stmt = $conn->prepare($sql);\n\t\tif($stmt === false) {\n\t\t echo json_encode('Wrong SQL: ' . $sql . ' Error: ' . $conn->errno . ' ' . $conn->error, E_USER_ERROR);\n\t\t return;\n\t\t}\n\t\telse {\n\t\t // Bind parameters. Types: s = string, i = integer, d = double, b = blob \n\t\t $stmt->bind_param(\"ii\", $body->user, $body->recipe);\n\t\t $stmt->execute();\n\t\t\t//echo \"New records created successfully\\n\";\n\t\t}\n\t}",
"function recommendedInfo($user)\n {\n // prepare sql statement\n $sql = \"INSERT INTO recommendedInfo (fname, lname, email, phone)\n VALUES (:fname, :lname, :email, :phone)\";\n\n // save prepared statement\n $statement = $this->_dbh->prepare($sql);\n\n // assign values\n $fname = $user->getFname();\n $lname = $user->getLname();\n $email = $user->getEmail();\n $phone = $user->getPhone();\n\n // bind params\n $statement->bindParam(':fname', $fname, PDO::PARAM_STR);\n $statement->bindParam(':lname', $lname, PDO::PARAM_STR);\n $statement->bindParam(':email', $email, PDO::PARAM_STR);\n $statement->bindParam(':phone', $phone, PDO::PARAM_STR);\n\n // execute insert into recommendedInfo\n $statement->execute();\n\n global $f3;\n $lastID = $this->_dbh->lastInsertId();\n $f3->set('recommendedInfoID', $lastID);\n }",
"public static function setContractorId() {\n\n $sql = \"UPDATE contractor SET users_id='8' WHERE id='3'\";\n self::insert($sql);\n\n\n }",
"public function insert_record(){\n\n\t\t}",
"function add_user_company($params)\n {\n $this->db->insert('user_company',$params);\n return $this->db->insert_id();\n }",
"function add_vehicle($vehicle_id) {\n global $db;\n $query = 'INSERT INTO vehicles (year, model, price, type_id, class_id, make_id)\n VALUES (:year, :model, :price, :type_id, :class_id, :make_id)';\n $statement = $db->prepare($query);\n $statement->bindValue(':year', $year);\n $statement->bindValue(':model', $model);\n $statement->bindValue(':price', $price);\n $statement->bindValue(':type_id', $type_id);\n $statement->bindValue(':class_id', $vehicle_name);\n $statement->bindValue(':make_id', $make_id);\n $statement->execute();\n $statement->closeCursor();\n }",
"function insertCardInfo($creditcard){\n\t\t$userObj = new user;\n\t\t$auth = new mysqldatabaserrs;\n\t\t$dbconn = $auth->connectdb();\n\t\t$query = 'INSERT INTO `creditcardinfo` (`cardNum`, `cardtype`,`name`, `address`, `cv`, `expireddate`, `userId`) VALUES (:cardNum,:cardtype,:name,:address,:cvv,:expireddate,:userId);';\n\t\t$stmt = $dbconn->prepare($query);\n\n\t\t/*bind values to escape*/\n\t\t$stmt->bindValue(':cardNum',$creditcard->getCardNum());\t\n\t\t$stmt->bindValue(':name',$creditcard->getName());\n\t\t$stmt->bindValue(':address',$creditcard->getAddress());\n\t\t$stmt->bindValue(':cvv',$creditcard->getCV());\n\t\t$stmt->bindValue(':cardtype',$creditcard->getCardType());\n\t\t$stmt->bindValue(':expireddate',$creditcard->getExpireDate()); \n\t\t$stmt->bindValue(':userId',$creditcard->getUserId());\t\t\t\n\t\t$stmt->execute();\n\t\t$insertedID = $dbconn->lastInsertId();\n\t\techo $insertedID;\n\t\tif($insertedID>0){\n\t\t\t$query = 'UPDATE `user` SET `verified`=:verified where id=:userId;';\n\t\t\t$stmt = $dbconn->prepare($query);\n\n\t\t\t/*bind values to escape*/\n\t\t\t$stmt->bindValue(':verified',1);\t\n\t\t\t$stmt->bindValue(':userId',$creditcard->getUserId());\t\t\t\n\t\t\t$stmt->execute();\n\t\t}\n\t\t$auth->closeconnection($dbconn);\n\t\t\n\t\treturn $creditcard;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the Taxs associated with the Company. | protected function taxs()
{
return $this->hasMany('App\Tax', 'comp_id');
} | [
"public function getAllTax()\n {\n return $this->taxService->getAll();\n }",
"public function getTaxes();",
"public static function getListTax() {\t\t\r\n\t\treturn Quick::single('accountant/list_tax')->cache()->getListTax();\r\n\t}",
"public function getTaxes()\n {\n return $this->taxes;\n }",
"public function getOrganizationTaxes()\n {\n return OrganizationAPIHandler::getInstance()->getOrganizationTaxes();\n }",
"public function getTaxes() {\n return $this->taxes;\n }",
"public function getTaxons()\n {\n return $this->taxons;\n }",
"public function listTaxAuthorities()\n {\n $path = \"/api/v2/definitions/taxauthorities\";\n $guzzleParams = [\n 'query' => [],\n 'body' => null\n ];\n return $this->restCall($path, 'GET', $guzzleParams);\n }",
"function getTaxes()\n {\n // @ tax\n global $application;\n $retval = \"\";\n $this->_Tax_Item = array();\n $this->areIncludedTaxesPresent = false;\n\n if ($this->_form_style == ORDERS_INFO_ADVANCED_FORM)\n {\n foreach ($this->_order[\"Price\"][\"taxes\"] as $key => $value)\n {\n $this->_Tax_Item[\"TaxId\"] = $key;\n $this->_Tax_Item['TaxName'] = prepareHTMLDisplay($value[\"name\"]);\n $this->_Tax_Item['TaxAmount'] = ($value[\"value\"] == PRICE_N_A) ? 0.0000 : $value[\"value\"];\n $this->_Tax_Item[\"is_included\"] = $value[\"is_included\"];\n $retval .= $this->TemplateFiller->fill(\"checkout/\" . $this->template_folder . \"/\", \"order-tax-item.tpl.html\", array());\n\n if ($value[\"is_included\"] == 1)\n $this->areIncludedTaxesPresent = true;\n }\n }\n\n foreach ($this->_order[\"Price\"][\"tax_dops\"] as $key => $value)\n {\n $this->_Tax_Item[\"TaxId\"] = $key;\n $this->_Tax_Item['TaxName'] = prepareHTMLDisplay($value[\"name\"]);\n $this->_Tax_Item['TaxAmount'] = $value[\"value\"];\n\n $formula_array = array();\n $formula = explode(',', $value[\"formula\"]);\n foreach ($formula as $id)\n {\n $formula_array[] = $this->_order[\"Price\"][\"taxes\"][$id][\"name\"];\n }\n $this->_Tax_Item[\"formula\"] = implode(' + ', $formula_array);\n\n $retval .= $this->TemplateFiller->fill(\"checkout/\" . $this->template_folder . \"/\", \"order-tax-dis-op-item.tpl.html\", array());\n }\n\n // - .\n $res = modApiFunc(\"TaxExempts\", \"getOrderFullTaxExempts\", $this->order_id);\n if ($this->_form_style == ORDERS_INFO_SIMPLE_FORM)\n {\n if (sizeof($res) == 1)\n {\n $prices = getKeyIgnoreCase('price', $this->_order);\n $this->_Tax_Item[\"TaxId\"] = \"taxExemption\";\n $this->_Tax_Item['TaxName'] = getMsg('SYS', \"FULL_TAX_EXEMPT_MSG\");\n $this->_Tax_Item['TaxAmount'] = -1 * getKeyIgnoreCase(\"OrderTaxTotal\", $prices);\n $this->_Tax_Item[\"is_included\"] = 0;\n $retval .= $this->TemplateFiller->fill(\"checkout/\" . $this->template_folder . \"/\", \"order-tax-item.tpl.html\", array());\n }\n }\n else if ($this->_form_style == ORDERS_INFO_ADVANCED_FORM\n && count($this->_order[\"Price\"][\"taxes\"]) > 0)\n {\n $taxExemptEnabled = modApiFunc('Settings','getParamValue','TAXES_PARAMS','ALLOW_FULL_TAX_EXEMPTS');\n if (sizeof($res) == 1)\n {\n $this->_Tax_Item[\"TaxId\"] = \"taxExemption\";\n $this->_Tax_Item['TaxName'] = getMsg('SYS',\"FULL_TAX_EXEMPT_MSG\");\n $this->_Tax_Item['TaxAmount'] = \"<input type=checkbox name='taxExemption' checked onFocus='setPricesAsEdited();'>\";\n $this->_Tax_Item[\"is_included\"] = 0;\n $retval .= $this->TemplateFiller->fill(\"checkout/\" . $this->template_folder . \"/\", \"order-tax-item.tpl.html\", array());\n }\n else if ($taxExemptEnabled == \"true\")\n {\n // is ALLOW_FULL_TAX_EXEMPTS enabled?\n $this->_Tax_Item[\"TaxId\"] = \"taxExemption\";\n $this->_Tax_Item['TaxName'] = getMsg('SYS',\"FULL_TAX_EXEMPT_MSG\");\n $this->_Tax_Item['TaxAmount'] = '<input type=\"checkbox\" name=\"taxExemption\" onFocus=\"setPricesAsEdited();\">';\n $this->_Tax_Item[\"is_included\"] = 0;\n $retval .= $this->TemplateFiller->fill(\"checkout/\" . $this->template_folder . \"/\", \"order-tax-item.tpl.html\", array());\n }\n }\n\n // show warning about included taxes\n if ($this->_form_style == ORDERS_INFO_ADVANCED_FORM\n && $this->areIncludedTaxesPresent == true\n && $this->DisplayIncludedTax == true)\n {\n $this->_Tax_Item[\"TaxId\"] = 0;\n $this->_Tax_Item['TaxName'] = getMsg('SYS',\"INCLUDED_TAX_EDIT_MSG\");\n $this->_Tax_Item['TaxAmount'] = '';\n $this->_Tax_Item[\"is_included\"] = 0;\n $retval .= $this->TemplateFiller->fill(\"checkout/\" . $this->template_folder . \"/\", \"order-tax-item.tpl.html\", array());\n }\n\n return $retval;\n }",
"public function action_gettaxval()\n {\n $common_model = Model::factory( 'commonmodel' );\n echo $company_tax = ( FARE_SETTINGS == 2 && !empty( $_REQUEST['company'] ) ) ? $common_model->company_tax( $_REQUEST['company'] ) : TAX;\n exit;\n }",
"public function taxRates()\n {\n if (!isset($this->tax_rates)) {\n $this->tax_rates = new Services\\TaxRatesService($this->api_client);\n }\n\n return $this->tax_rates;\n }",
"public function taxes()\n {\n return $this->hasMany(Tax::class);\n }",
"public function getTaxInvoiced();",
"function list_taxes()\n\t{\n\t\tlog_debug(\"accounts_taxes_manage_soap\", \"Executing list_taxes()\");\n\n\t\tif (user_permissions_get(\"accounts_taxes_view\"))\n\t\t{\n\t\t\t// fetch taxes\n\t\t\t$sql_obj\t\t= New sql_query;\n\t\t\t$sql_obj->string\t= \"SELECT id, name_tax, taxrate, chartid, taxnumber, description FROM account_taxes\";\n\t\t\t$sql_obj->execute();\n\n\t\t\t$return = NULL;\n\t\t\tif ($sql_obj->num_rows())\n\t\t\t{\n\t\t\t\t$sql_obj->fetch_array();\n\n\t\t\t\t// package data into array for passing back to SOAP client\n\t\t\t\tforeach ($sql_obj->data as $data)\n\t\t\t\t{\n\t\t\t\t\t$return_tmp\t\t\t= NULL;\n\t\t\t\t\t$return_tmp[\"id\"]\t\t= $data[\"id\"];\n\t\t\t\t\t$return_tmp[\"name_tax\"]\t\t= $data[\"name_tax\"];\n\t\t\t\t\t$return_tmp[\"taxrate\"]\t\t= $data[\"taxrate\"];\n\t\t\t\t\t$return_tmp[\"chartid\"]\t\t= $data[\"chartid\"];\n\t\t\t\t\t$return_tmp[\"chartid_label\"]\t= sql_get_singlevalue(\"SELECT CONCAT_WS('--', code_chart, description) as value FROM account_charts WHERE id='\". $data[\"chartid\"] .\"'\");\n\t\t\t\t\t$return_tmp[\"taxnumber\"]\t= $data[\"taxnumber\"];\n\t\t\t\t\t$return_tmp[\"description\"]\t= $data[\"description\"];\n\n\t\t\t\t\t$return[] = $return_tmp;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $return;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new SoapFault(\"Sender\", \"ACCESS_DENIED\");\n\t\t}\n\n\t}",
"public function getTaxRefunded();",
"public function getCurHisTaxes()\n {\n return $this->hasMany(CurHisTax::className(), ['currency_id' => 'currency_id']);\n }",
"public function getAllSettingTaxes()\n {\n\treturn $this->setRequestData(self::RESOURCE_SETTING_TAXES);\n }",
"public function getTaxInvoices() {\n return response()->json(TaxInvoice::all());\n }",
"public function getTax(){\n\t\treturn $this->db->get_where('tax',array('delete_status'=>0))->result();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dispatch notification for the followers of a thread. | public function dispatchNotification(Event $event)
{
$this->Followers = TableRegistry::get('ForumThreadsFollowers');
$followers = $this->Followers
->find()
->where([
'ForumThreadsFollowers.thread_id' => $event->data['thread_id']
])
->contain([
'Users' => function ($q) {
return $q->select([
'id'
]);
}
])
->select([
'ForumThreadsFollowers.id',
'ForumThreadsFollowers.thread_id',
'ForumThreadsFollowers.user_id'
])
->toArray();
if (empty($followers)) {
return true;
}
foreach ($followers as $follower) {
if ($follower->user_id != $event->data['sender_id']) {
$event->data['follower'] = $follower;
$this->newNotification($event);
}
}
return true;
} | [
"public function userFollowed(CakeEvent $event) {\n\t\t$UserFollower = ClassRegistry::init('UserFollower');\n\t\t$data = $UserFollower->read(null, $event->id);\n\t\t\n\t\t// Keep track of who has had a message created about this already.\n\t\t$messaged = array();\n\t\t\n\t\t/* 1. Add a message the followed users feed */\n\t\tif (!in_array($data['UserFollower']['following_user_id'], $messaged)) {\n\t\t\t\n\t\t\t$UserFollower->User->Message->create();\n\t\t\t$UserFollower->User->Message->save(array(\n\t\t\t\t'Message' => array(\n\t\t\t\t\t'id' => null,\n\t\t\t\t\t'bomb_id' => null,\n\t\t\t\t\t// The user_id in this case in the user being followed\n\t\t\t\t\t'user_id' => $data['UserFollower']['following_user_id'],\n\t\t\t\t\t// The related user id is the id of the user who clicked follow\n\t\t\t\t\t'related_user_id' => $data['UserFollower']['user_id'],\n\t\t\t\t\t'title' => 'followed you.',\n\t\t\t\t\t'type' => MESSAGE_TYPE_FOLLOWED,\n\t\t\t\t)\n\t\t\t));\n\t\t\t$messaged[] = $data['UserFollower']['following_user_id'];\n\t\t\t\n\t\t\t\n\t\t\t// Check if the followed user wants to get push notifications about this\n\t\t\t$user = $UserFollower->User->findById($data['UserFollower']['following_user_id']);\n\t\t\tif (!empty($user) && $user['User']['notification_followers']) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// The notification_followers option can be 0 = OFF, 1 = Everyone, 2 = Only people the user is following\n\t\t\t\t$following_user_ids = $UserFollower->User->findFollowerIds($data['UserFollower']['user_id']);\n\t\t\t\tif ($user['User']['notification_followers'] != 1 || in_array($data['UserFollower']['following_user_id'], $following_user_ids)) {\n\t\t\t\t\t\n\t\t\t\t\t// Queue up the push notification\n\t\t\t\t\t$msg = 'You have a new follower';\n\t\t\t\t\t\n\t\t\t\t\t$Notification = ClassRegistry::init('Notification');\n\t\t\t\t\t$Notification->create();\n\t\t\t\t\t$Notification->save(array(\n\t\t\t\t\t\t'Notification' => array(\n\t\t\t\t\t\t\t'id' => null,\n\t\t\t\t\t\t\t'type' => 'basic',\n\t\t\t\t\t\t\t'description' => $msg,\n\t\t\t\t\t\t\t'html' => '',\n\t\t\t\t\t\t\t'recipients' => '',\n\t\t\t\t\t\t\t'published' => 1,\n\t\t\t\t\t\t\t'user_id' => $user['User']['id'],\n\t\t\t\t\t\t\t'send_date' => date('Y-m-d'),\n\t\t\t\t\t\t\t'send_time' => date('H:i:s'),\n\t\t\t\t\t\t\t'status' => 'queued',\n\t\t\t\t\t\t\t'target' => 'individual',\n\t\t\t\t\t\t\t'whitelisted' => Configure::read('Push.whitelist_active'),\n\t\t\t\t\t\t)\n\t\t\t\t\t));\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"public function follow($reciever_user_id1, $reciever_user_id2, $notify)\n {\n $reciever_user_id = $this->getRecieverID($reciever_user_id1, $reciever_user_id2);\n $message = $this->getFollowNotificationMessage($this->id);\n $this->InsertIntoNotificationtable($reciever_user_id, $message, $notify);\n \n \n //send email to user\n $to = $this->getEmail($reciever_user_id);\n $name = $this->getUserFLNameOrRestNameOrEstName($this->id);\n $header = EMAILHEADER;\n $subject = $name. \" is following you \";\n $subText = ' is following you';\n $buttonText = 'follow back';\n $emailMessage = $this->getRelationshipEmailBody($name, $subText, $buttonText, $to);\n \n\n file_put_contents(TEMPPICPATH.\"\".$to.\".png\", $this->checkPicture($this->getUserImage($this->id)));\n $image_path = TEMPPICPATH.\"\".$to.\".png\";\n $image_name = $to.\".png\"; \n \n $this->send_relationship_mail($to, $subject, $emailMessage, $header, $name, $image_path, $image_name);\n }",
"public function follower(){\n\t\t\t$id=AuthComponent::user('id');\n\t\t\t$this->loadModel('User');\n\t\t\t$this->loadModel('Tweet');\n\n\t\t\t$this->Paginator->settings = array(\n\t\t 'conditions'=>array('User.id'=>$this->Follower->getFolloweridList($id)),\n\t\t 'limit' => 10\n\t\t );\n\t\t $feed = $this->Paginator->paginate('User');\n\t\t $this->set('followers',$feed);\n\n\t\t\t$this->setSidebarData($id);\n\t\t}",
"function follow_notify($pid,$commenter_name,$comment) {\n\t$uids = array();\n\t$post_follows = post_follows_load_by_pid($pid);\n\tforeach ($post_follows as $follower) {\n\t\t$uids[] = $follower['User_ID'];\n\t}\n\tforeach ($uids as $uid) {\n\t\t$post = post_load($pid);\n\t\t$user = user_load($uid);\n\t\t$to = $user['User_Mail'];\n\t\t$subject = 'Notification for the post \"'.$post['Post_Title'].'\"';\n\t\t$from = 'okms.vietnam@gmail.com';\n\t\tsend_mail($to,$subject,'\n<table style=\"border: 1px solid black;\">\n\t<tr style=\"border: 1px solid black;\">\n\t\t<td>\n\t\t\t<img src=\"'.currentURL().'/images/banner_email.png\" width=\"480\" height=\"80\" />\n\t\t</td>\n\t</tr>\n\t<tr style=\"border: 1px solid black;\">\n\t\t<td>\n\t\t\t<p>Hi <b>'.$user['User_Fullname'].'</b></p>\n\t\t\t<p>'.$commenter_name.' commented on the post that you have followed</p>\n\t\t\t<p>'.$commenter_name.' wrote: \"'.$comment.'\"</p>\n\t\t\t<p><a href=\"'.currentURL().'/question/'.$post['Post_URL'].'\">Go to comments</a> now</p>\n\t\t</td>\n\t</tr>\n</table>\n\t\t',$from);\n\t}\n}",
"public function send_notification_to_followers(Request $request) {\n\n $followers = Follower::select('user_id as id',\n 'users.name as name', \n 'users.email as email', \n 'users.picture',\n 'users.description' ,\n 'followers.follower as follower_id' ,\n 'followers.created_at as created_at'\n )\n ->leftJoin('users' , 'users.id' ,'=' , 'followers.follower')\n ->where('user_id', $request->id)\n ->orderBy('created_at', 'desc')\n ->get();\n\n\n $user = User::find($request->id);\n\n // Save Notification\n\n $notification = NotificationTemplate::getRawContent(LIVE_STREAM_STARTED, $user);\n\n $content = $notification ? $notification : LIVE_STREAM_STARTED;\n\n foreach ($followers as $key => $value) {\n \n $email_data['name'] = $value->name;\n\n $email_data['streamer'] = $user->name;\n\n $email_data['subject'] = $user->name.' '.tr('new_video_streaming');\n\n $email_data['page'] = \"emails.user.notification\";\n\n $email_data['email'] = $value->email;\n\n $this->dispatch(new \\App\\Jobs\\SendEmailJob($email_data));\n\n UserNotification::save_notification($value->follower_id, $content, $request->video_id,LIVE_STREAM_STARTED , $request->id);\n\n }\n\n return response()->json(true);\n\n }",
"public function handleUserFollowed($event)\n {\n foreach ($event->user->followers as $subscriber)\n {\n FeedActivities::create(\"user_followed_user\", $event->targetUser, $event->user);\n }\n }",
"public function notify(): void {\n foreach($this->observers as $obs) {\n $obs->update($this);\n\n $this->notifications[] = $this->getFavorites();\n }\n }",
"protected function _notifyThread()\n {\n if (!preg_match('#^/direct_v2/threads/([^/]+)/items/(.+)$#D', $this->path, $matches)) {\n $this->_client->debug('Path %s does not match thread item regexp', $this->path);\n\n return;\n }\n list($path, $threadId, $threadItemId) = $matches;\n $json = HttpClient::api_body_decode($this->value);\n if (!is_object($json)) {\n $this->_client->debug('Failed to decode thread item notify JSON: %s', json_last_error_msg());\n\n return;\n }\n /** @var EventPayload\\Notify $notifyPayload */\n $notifyPayload = $this->_client->mapToJson($json, new EventPayload\\Notify());\n $this->_rtc->emit('thread-notify', [$threadId, $threadItemId, $notifyPayload]);\n }",
"public function followNewFollowers($args) {\n $user_id = (int)$args['user_id'];\n $user = new User($user_id);\n $access_token_id = $args['id'];\n if (!$user->ifUserHasConfigValue('auto_follow', $access_token_id)) {\n return;\n }\n\n $instagram = $this->inicializeInstagramSocializer($user_id, $args);\n\n /* @var Instagram_follower[] $followers */\n $followers = $user\n ->instagram_follower\n ->where('need_follow', true)\n ->where('access_token_id', $access_token_id)\n ->get();\n foreach($followers as $follower) {\n $answer = $instagram->modifyUserRelationship($follower->follower_id, 'follow');\n if ($answer->meta->code != 200) {\n echo $answer->meta->error_message;\n if ($answer->meta->error_type == 'OAuthPermissionsException') {\n break;\n }\n } else {\n $follower->setNeedFollow(false);\n $follower->save();\n }\n }\n }",
"public function followUID(){\r\n if (isset($_GET['id']) && $this->e->get('uid') && isset($_SERVER ['HTTP_REFERER'])) {\r\n\r\n # YOU CANT FOLLOW YOUR SELF\r\n if ($this->e->get('uid') === $_GET['id']) {\r\n die('security@networks.co.id');\r\n }\r\n\r\n $o = new Apps\\Netcoid\\Models\\Follow;\r\n $u = new Apps\\Netcoid\\Models\\Users;\r\n \r\n $status = $o->isFollowingUID($this->e->get('uid'), $_GET['id']);\r\n $user = $u->getData($_GET['id']);\r\n\r\n # SETTING UP FOR FOLLOW\r\n $f['follow_uid'] = $this->e->get ( 'uid' );\r\n $f['target_uid'] = $_GET ['id'];\r\n \r\n # @todo nanti diganti pake $_SERVER ['HTTP_REFERER'] aja? biar gak ambil dr database\r\n if (empty($status)) {\r\n $o->set($f);\r\n $this->h->setMessage('Following '. $user['name'] .'!'); \r\n header('Location: ' . $_SERVER ['HTTP_REFERER']);\r\n } else {\r\n die('security@networks.co.id');\r\n }\r\n }\r\n }",
"public function updateFollowers($args) {\n $user_id = (int)$args['user_id'];\n $user = new User($user_id);\n $access_token_id = $args['id'];\n \n $twitter = $this->inicializeTwitterSocializer($user_id, $args);\n\n $user->twitter_follower\n ->where('still_follow', true)\n ->where('access_token_id', $access_token_id)\n ->update([\n 'still_follow' => false\n ]);\n\n $answer = $twitter->get_followers();\n if ($answer->errors) {\n foreach($answer->errors as $err) {\n log_message('TASK_ERROR', __FUNCTION__ . 'Twitter error: code: '.$err->code.'. Message: ' . $err->message);\n }\n } else {\n $followersIds = $answer->ids;\n Twitter_follower::create()\n ->where_in('follower_id', $followersIds)\n ->where('user_id', $user_id)\n ->where('access_token_id', $access_token_id)\n ->update([\n 'unfollow_time' => null,\n 'still_follow' => true\n ]);\n $exists_followers_ids = Twitter_follower::create()\n ->where_in('follower_id', $followersIds)\n ->where('user_id', $user_id)\n ->where('access_token_id', $access_token_id)\n ->get()->all_to_array('follower_id');\n $new_followers_ids = [];\n foreach($exists_followers_ids as $exists_followers_id) {\n if(!in_array($exists_followers_id['follower_id'], $followersIds)) {\n $new_followers_ids[] = $exists_followers_id['follower_id'];\n }\n }\n foreach ($new_followers_ids as $new_followers_id) {\n $twitterFollower = new Twitter_follower();\n $twitterFollower->setFollowerId($new_followers_id);\n $twitterFollower->setUserId($user_id);\n if ($user->ifUserHasConfigValue('auto_send_welcome_message', $access_token_id)) {\n $twitterFollower->setNeedMessage(true);\n }\n if ($user->ifUserHasConfigValue('auto_follow', $access_token_id)) {\n $twitterFollower->setNeedFollow(true);\n }\n $twitterFollower->setStillFollow(true);\n $twitterFollower->setAccessTokenId($access_token_id);\n $twitterFollower->save();\n }\n\n $unfollowers_query = [\n 'still_follow' => false,\n 'unfollow_time' => null,\n 'start_follow_time' => null,\n 'end_follow_time' => null,\n 'access_token_id' => $access_token_id\n ];\n\n $new_unfollowers_count = $user->twitter_follower\n ->where($unfollowers_query)\n ->count();\n\n $user->twitter_follower\n ->where($unfollowers_query)\n ->update([\n 'unfollow_time' => time()\n ]);\n Social_analytics::updateAnalytics(\n $access_token_id,\n Social_analytics::NEW_UNFOLLOWERS_ANALYTICS_TYPE,\n $new_unfollowers_count\n );\n }\n }",
"public function followed_posts() {\n self::$base = \"/posts/followed_posts\";\n $this->_display( $this->_followed_posts_by_date() );\n }",
"public function follow($userName);",
"public function follow()\n\t{\n\t\t/* BENCHMARK */ $this->benchmark->mark('func_follow_start');\n\n\t\t// add to follows and followed_by\n\t\t\t$this->connection_save_model->update($this->user,$this->node,'F',2,$this->add);\n\n\t\t// return unfollow button as the opposite of this\n\t\t\t$new_button=$this->connection_button_model->connection_button('unfollow',$this->user,$this->node);\n\n\t\t/* BENCHMARK */ $this->benchmark->mark('func_follow_end');\n\n\t\texit(json_encode($new_button));\n\t}",
"public function followFollowers()\r\n {\r\n $this->debug('Checking for followers');\r\n \r\n $nbFollowers = 0;\r\n \r\n $limit = self::MAX_FOLLOWING;\r\n \r\n foreach ($this->client->getFollowers() as $follower)\r\n {\r\n if ($this->getBotAccountInfo('friends_count') >= $limit - $nbFollowers)\r\n {\r\n $this->debug('Max followers number reached, skipped mass following process');\r\n \r\n return 0;\r\n }\r\n \r\n if ($this->client->existsFriendship($this->getUsername(), $follower['screen_name']))\r\n {\r\n continue;\r\n }\r\n\r\n try\r\n {\r\n $this->client->createFriendship($follower['screen_name'], true);\r\n \r\n $this->debug(sprintf('Following new follower: \"%s\"', $follower['screen_name']));\r\n \r\n $nbFollowers++;\r\n }\r\n catch (Exception $e)\r\n {\r\n $this->debug(sprintf('Skipping following \"%s\": \"%s\"', $follower['screen_name'], $e->getMessage()));\r\n }\r\n }\r\n \r\n $this->debug(sprintf('%s follower%s added', 0 === $nbFollowers ? 'No' : (string) $nbFollowers, $nbFollowers > 1 ? 's' : ''));\r\n \r\n return $nbFollowers;\r\n }",
"function follow($user, ActivitySourceInterface $subject);",
"abstract public function followUser( $user );",
"public function follow($params)\n {\n // Throw 401 if not logged in\n $token = $this->require_authentication();\n $currUser = $token->getUser()->getUserId();\n // Throw 401 if not logged in\n $id = $params['userId'];\n\n // See if there is a ref param to redirect to\n if(array_key_exists('ref', $_POST)) {\n $referrer = $_POST['ref'];\n } else {\n $referrer = '/users/all';\n }\n\n try {\n // Add to DB\n $db = $this->getDBConn();\n $follow = new Following();\n $res = $follow->setUserFrom($currUser)\n ->setUserTo($id)\n ->commit($db);\n\n error_log(\"Added following relationship \" . $follow->getFollowId());\n $this->addFlashMessage('Now following user.', self::FLASH_LEVEL_SUCCESS);\n } catch (\\PDOException $dbErr) {\n $this->addFlashMessage('Database error on adding following relationship:<br>' . $dbErr->getMessage(), self::FLASH_LEVEL_SERVER_ERR);\n }\n\n $this->redirect($referrer);\n }",
"public function GetMyFollowers($UID)\r\n {\r\n // section -64--88-52-1--43214224:1325c0244f0:-8000:0000000000000982 begin\r\n // section -64--88-52-1--43214224:1325c0244f0:-8000:0000000000000982 end\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DATE TO Day FORMAT | function DateToDay($Date)
{
return date("d", strtotime($Date));
} | [
"function convert_day($day) {\n\t\tif (strlen($day) == 1) { \n\t\t\t$day = str_pad($day, 2, \"0\", STR_PAD_LEFT); \n\t\t}\n\t\treturn $day;\n\t}",
"function dayToStringConvert($day)\n{\n return '+' . $day . 'day';\n}",
"public function toStringDay() {\n return date(\"Y-m-d\", $this->sec); }",
"abstract protected function formatDays($n);",
"function convert_date_to_daymmdd($date) {\n\t$date = date('l m/d', strtotime($date));\n\n\treturn $date;\n}",
"function DDtoDay( $inputDate ) {\r\n\t\t $dateString = array(0 =>'','st','nd','rd','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','st','nd','rd','th','th','th','th','th','th','th','st'); \r\n\t\t\t$returnDate = ''; \r\n\t\t\t$tempDate = intval($inputDate); \r\n\t\t\t\tif ($tempDate >= 1 && $tempDate <= 31){\r\n\t\t\t\t $returnDate = $inputDate . $dateString[$tempDate];\r\n\t\t\t}\r\n\t\t\treturn $returnDate;\r\n\t\t}",
"function daysToDate ($days, $format=\"%Y-%m-%d\")\r\n\t\t{\r\n\t\t\t$days -= 1721119;\r\n\t\t\t$century = floor(( 4 * $days - 1) / 146097);\r\n\t\t\t$days = floor(4 * $days - 1 - 146097 * $century);\r\n\t\t\t$day = floor($days / 4);\r\n\t\t\t$year = floor(( 4 * $day + 3) / 1461);\r\n\t\t\t$day = floor(4 * $day + 3 - 1461 * $year);\r\n\t\t\t$day = floor(($day + 4) / 4);\r\n\t\t\t$month = floor(( 5 * $day - 3) / 153);\r\n\t\t\t$day = floor(5 * $day - 3 - 153 * $month);\r\n\t\t\t$day = floor(($day + 5) / 5);\r\n\r\n\t\t\tif ($month < 10) {\r\n\t\t\t $month +=3;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t $month -=9;\r\n\t\t\t if ($year++ == 99) {\r\n\t\t\t\t$year = 0;\r\n\t\t\t\t$century++;\r\n\t\t\t }\r\n\t\t\t}\r\n\r\n\t\t\t$century = sprintf(\"%02d\", $century);\r\n\t\t\t$year = sprintf(\"%02d\", $year);\r\n\t\t\t$month = sprintf(\"%02d\", $month);\r\n\t\t\t$day = sprintf(\"%02d\", $day);\r\n\r\n\t\t\treturn ($this->formatDate(\"$century$year-$month-$day\", $format));\r\n\t\t}",
"public function getDay(): string\n {\n return $this->toLocalizedString('d');\n }",
"function date2day($date)\n{\n return ctype_digit(substr($date,4,1)) ? substr($date,6,2) : substr($date,8,2);\n}",
"function get_date_dayformat($my_date)\r\n{\r\n\t//-- 15.02.2008 - nwj - bug ref 66235 \r\n\tif($my_date==1)return \"st\";\r\n\r\n //-- get last digit\r\n $last_digit= $my_date % 10;\r\n $first_digit = substr($my_date,0,1);\r\n\r\n $format;\r\n if($last_digit==1)\r\n {\r\n $format=($first_digit==1)?\"th\":\"st\";\r\n }\r\n else if($last_digit==2)\r\n {\r\n $format=($first_digit==1)?\"th\":\"nd\";\r\n }\r\n else if($last_digit==3)\r\n {\r\n $format=($first_digit==1)?\"th\":\"rd\";\r\n }\r\n else\r\n {\r\n $format=\"th\";\r\n }\r\n return $format;\r\n}",
"public function int_to_day($num) {\n \tif ($num > 6 | $num < 0) {\n\t die('int_to_day($num), 0<$num<6');\n\t}\n switch ($num) {\n\t case 0:\n\t return \"Mon\";\n\t case 1:\n\t \treturn \"Tue\";\n\t case 2:\n\t \treturn \"Wed\";\n\t case 3:\n\t \treturn \"Thu\";\n\t case 4:\n\t \treturn \"Fri\";\n\t case 5:\n\t \treturn \"Sat\";\n\t case 6:\n\t \treturn \"Sun\";\n\t}\n }",
"function dayConvert($day){\n\tswitch ($day){\n\t\tcase \"Monday\": return 1;\n\t\tcase \"Tuesday\": return 2;\n\t\tcase \"Wednesday\": return 3;\n\t\tcase \"Thursday\": return 4;\n\t\tcase \"Friday\": return 5;\n\t\tcase \"Saturday\": return 6;\n\t\tcase \"Sunday\": return 7;\n\t}\n}",
"public function getDayDate()\n {\n return $this->getDate('day');\n }",
"public function test_number_to_day_method()\n {\n $day = Date_Time_Format::number_to_day(5);\n\n $this->assertEquals('petak', $day);\n\n $day = Date_Time_Format::number_to_day(1, 'english');\n\n $this->assertEquals('monday', $day);\n\n $day = Date_Time_Format::number_to_day(6, 'serbian', FALSE);\n\n $this->assertEquals('Subota', $day);\n\n $false_values = array(\n 'nothing',\n -5,\n 0,\n 8,\n );\n\n foreach ($false_values as $value)\n {\n $day = Date_Time_Format::number_to_day($value);\n\n $this->assertFalse($day);\n }\n }",
"public function day()\n\t{\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\treturn gmdate('j', $this->ee_date());\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn ee()->localize->format_date('%j');\n\t\t}\n\t}",
"function getDay()\n {\n $datetime = \\DateTime::createFromFormat('Y-m-d', $this->_currentDate);\n return $datetime->format('D');\n }",
"public static function day()\n\t{\n\t\treturn date('d');\n\t}",
"public function getDayShortName(): string\n {\n return $this->format('D');\n }",
"function date_yyyymmdd($dat_ToFormat) {\r\n\t\treturn substr($dat_ToFormat,6,4).'-'.substr($dat_ToFormat,3,2).'-'.substr($dat_ToFormat,0,2);\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Section Opts Loads section options simply | function section_opts(){ return array(); } | [
"public function options_load();",
"public function loadOptions()\n {\n }",
"public function display_settings_section() {}",
"function LoadOptions() {\n\t\t$options = get_option('amzshcs');\n\n\t\tif (isset($options['showcases'][$this->_identifier])) {\n\t\t\t$showcaseOptions = $options['showcases'][$this->_identifier];\n\n\t\t\tif (isset($showcaseOptions['associateid'])) {\n\t\t\t\t$this->_associateId = $showcaseOptions['associateid'];\n\t\t\t}\n\n\t\t\tif (isset($showcaseOptions['displaynum'])) {\n\t\t\t\t$this->_displayNum = $showcaseOptions['displaynum'];\n\t\t\t}\n\n\t\t\tif (isset($showcaseOptions['items'])) {\n\t\t\t\t$this->_items = $showcaseOptions['items'];\n\t\t\t}\n\n\t\t\tif (isset($showcaseOptions['locale'])) {\n\t\t\t\t$this->_locale = $showcaseOptions['locale'];\n\t\t\t}\n\n\t\t\tif (isset($showcaseOptions['name'])) {\n\t\t\t\t$this->_name = $showcaseOptions['name'];\n\t\t\t}\n\n\t\t\tif (isset($showcaseOptions['sortmethod'])) {\n\t\t\t\t$this->_sortMethod = $showcaseOptions['sortmethod'];\n\t\t\t}\n\t\t}\n\t}",
"public static function display_settings_section() {}",
"public function load_section ()\n\t\t{\n\t\t\t$request = array(\n\t\t\t\t'section' => isset($_REQUEST['section']) ? strip_tags($_REQUEST['section']) : false\n\t\t\t);\n\n\t\t\tif( isset($request['section']) && $request['section'] == 'insane_mode' ){\n\t\t\t\tdie( json_encode(array(\n\t\t\t\t\t'status' => 'redirect',\n\t\t\t\t\t'url' => admin_url( 'admin.php?page=WooZoneLite_insane_import' )\n\t\t\t\t)));\n\t\t\t}\n\n\t\t\t// get module if isset\n\t\t\t$activated_modules = isset($this->cfg['activate_modules']) ? $this->cfg['activate_modules'] : array();\n\t\t\tif ( ! in_array( $request['section'], $activated_modules) ) {\n\t\t\t\tdie( json_encode(array('status' => 'err', 'msg' => 'invalid section want to load!')) );\n\t\t\t}\n\n\t\t\t$tryed_module = $this->cfg['modules'][$request['section']];\n\n\t\t\tif( isset($tryed_module) && count($tryed_module) > 0 ){\n\t\t\t\t// Turn on output buffering\n\t\t\t\tob_start();\n\n\t\t\t\t$opt_file_path = $tryed_module['folder_path'] . 'options.php';\n\t\t\t\tif( is_file($opt_file_path) ) {\n\t\t\t\t\trequire_once( $opt_file_path );\n\t\t\t\t}\n\t\t\t\t$options = ob_get_clean(); //copy current buffer contents into $message variable and delete current output buffer\n\n\t\t\t\tif(trim($options) != \"\") {\n\t\t\t\t\t$options = json_decode($options, true);\n\n\t\t\t\t\t// Derive the current path and load up aaInterfaceTemplates\n\t\t\t\t\t$plugin_path = dirname(__FILE__) . '/';\n\t\t\t\t\tif(class_exists('aaInterfaceTemplates') != true) {\n\t\t\t\t\t\trequire_once($plugin_path . 'settings-template.class.php');\n\n\t\t\t\t\t\t// Initalize the your aaInterfaceTemplates\n\t\t\t\t\t\t$aaInterfaceTemplates = new aaInterfaceTemplates($this->cfg);\n\n\t\t\t\t\t\t// then build the html, and return it as string\n\t\t\t\t\t\t$html = $aaInterfaceTemplates->build_page($options, $this->alias, $tryed_module);\n\n\t\t\t\t\t\t// fix some URI\n\t\t\t\t\t\t$html = str_replace('{plugin_folder_uri}', $tryed_module['folder_uri'], $html);\n\n\t\t\t\t\t\tif(trim($html) != \"\") {\n\t\t\t\t\t\t\t$headline = '';\n\t\t\t\t\t\t\tif( isset($tryed_module[$request['section']]['in_dashboard']['icon']) ){\n\t\t\t\t\t\t\t\t$headline .= '<img src=\"' . ($tryed_module['folder_uri'] . $tryed_module[$request['section']]['in_dashboard']['icon'] ) . '\" class=\"WooZoneLite-headline-icon\">';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$headline .= $tryed_module[$request['section']]['menu']['title'] . \"<span class='WooZoneLite-section-info'>\" . ( $tryed_module[$request['section']]['description'] ) . \"</span>\";\n\n\t\t\t\t\t\t\t$has_help = isset($tryed_module[$request['section']]['help']) ? true : false;\n\t\t\t\t\t\t\tif( $has_help === true ){\n\n\t\t\t\t\t\t\t\t$help_type = isset($tryed_module[$request['section']]['help']['type']) && $tryed_module[$request['section']]['help']['type'] ? 'remote' : 'local';\n\t\t\t\t\t\t\t\tif( $help_type == 'remote' ){\n\t\t\t\t\t\t\t\t\t$headline .= '<a href=\"#load_docs\" class=\"WooZoneLite-show-docs\" data-helptype=\"' . ( $help_type ) . '\" data-url=\"' . ( $tryed_module[$request['section']]['help']['url'] ) . '\" data-operation=\"help\">HELP</a>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$headline .= '<a href=\"#load_docs\" class=\"WooZoneLite-show-feedback\" data-helptype=\"' . ( 'remote' ) . '\" data-url=\"' . ( $this->feedback_url ) . '\" data-operation=\"feedback\">Feedback</a>';\n\n\t\t\t\t\t\t\tdie( json_encode(array(\n\t\t\t\t\t\t\t\t'status' => 'ok',\n\t\t\t\t\t\t\t\t'headline' => $headline,\n\t\t\t\t\t\t\t\t'html' => $html\n\t\t\t\t\t\t\t)) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdie(json_encode(array('status' => 'err', 'msg' => 'invalid html formatter!')));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function init_sections () {\n\t\n\t\t$sections = array();\n\n\t\t$sections['default-settings'] = array(\n\t\t\t\t\t'name' \t\t\t=> __( 'General Settings', 'wooslider' ), \n\t\t\t\t\t'description'\t=> __( 'Settings to apply to all slideshows, unless overridden.', 'wooslider' )\n\t\t\t\t);\n\n\t\t$sections['control-settings'] = array(\n\t\t\t\t\t'name' \t\t\t=> __( 'Control Settings', 'wooslider' ), \n\t\t\t\t\t'description'\t=> __( 'Customise the ways in which slideshows can be controlled.', 'wooslider' )\n\t\t\t\t);\n\n\t\t$sections['button-settings'] = array(\n\t\t\t\t\t'name' \t\t\t=> __( 'Button Settings', 'wooslider' ), \n\t\t\t\t\t'description'\t=> __( 'Customise the texts of the various slideshow buttons.', 'wooslider' )\n\t\t\t\t);\n\t\t\n\t\t$this->sections = $sections;\n\t\t\n\t}",
"public function LoadSectionInfo() {\n\t\t$this->url = parse_url($_SERVER['REQUEST_URI']);\n\t\tif ($this->url === false)\n\t\t\tthrow new Exception(\"Can't parse url\");\n\n\t\t$path_to_section_config = $this->SearchAncestorFile($this->url['path'], '.section.php');\n\t\t$this->SECTION = !empty($path_to_section_config) ? require($path_to_section_config) : [];\n\n\t\t$this->TITLE = isset($this->SECTION['TITLE']) ? $this->SECTION['TITLE'] : $this->TITLE;\n\n\t\tif (isset($this->SECTION['TEMPLATE'])) {\n\t\t\t$this->SetTemplate($this->SECTION['TEMPLATE']);\n\t\t}\n\t\tif (isset($this->SECTION['WRAPPER'])) {\n\t\t\t$this->SetWrapper($this->SECTION['WRAPPER']);\n\t\t}\n\t}",
"function generalOptions(){\n\t\t$this->includePanel('general');\n\t}",
"public function sp_options_section() {\n\t\t$this->get_section_markup('Suggested Products');\n\t}",
"public function section_intro() {\n\t\t\t// echo \"<pre>\";\n\t\t\t// print_r( get_option( 'wolf_maintenance_settings' ) );\n\t\t\t// echo \"</pre>\";\n\t\t}",
"function prism_do_opt_section_main() {\n\t$prism_opt_section_main = '';\n\techo ( apply_filters( 'prism_theme_opt_section_main' , $prism_opt_section_main ) );\n}",
"public function custom_settings_section() {\n\t\tprint( 'Some Text' );\n\t}",
"protected function loadOptions()\n {\n \n // we still want to display default ones, right?\n parent::loadOptions();\n \n $this->defaultOptions[] = array('options' => array('-s', '--set-option-value'), \n 'callback' => 'setOption', \n 'description' => 'Testing my new option description');\n \n }",
"protected abstract function _setupOptions();",
"public function add_settings_sections()\n\t{\n\t\t$this->add_section( 'section-info', 'Section Info', 'print_section_info' );\n\t}",
"public function print_section_info() {\r\n//\t\tprint 'Enter your settings below:';\r\n\t}",
"function setup_addSection($section)\n{\n $option['group'] = $section;\n return $option;\n}",
"public function displayAdminOptionsPage()\n {\n include_once('partials/options.php');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check whether the expiration time claim is present. | public function hasExpirationTime(): bool
{
return $this->has(RegisteredClaim::NAME_EXPIRATION_TIME);
} | [
"public function claimHasExpired(): bool\n {\n if (!$this->claimed_at && !$this->verified_at) {\n return true;\n }\n\n if ($this->verified_at) {\n return true;\n }\n\n return $this->claimed_at && $this->claimed_at->diffInMinutes() >= 5;\n }",
"public function hasExpirationDate()\n {\n return isset($this->user_expiration);\n }",
"private function checkExpiration ( $expiration_time )\n\t{\n\t\treturn ( time() < $expiration_time );\n\t}",
"public function hasExpiry() {\n\t\treturn $this->hasInteger('expiry');\n\t}",
"public function hasExpired()\n {\n //return false if subscription have no expiry date defined.\n if( $this->expires_on == null ) return false;\n\n $now = new Carbon;\n return $this->expires_on < $now;\n }",
"public function hasExpired()\n {\n return $this->expires < time();\n }",
"public function accessTokenValid()\n {\n return $this->expire_time > time();\n }",
"public function isOnTime(\n string $token\n ): bool {\n $payload = $this->decodePayload($token);\n $iat = $payload['iat'] ?? null;\n $exp = $payload['exp'] ?? null;\n if (empty($iat) || empty($exp)) {\n throw new \\Exception('Invalid JWT Token', 401);\n }\n\n $validUntil = date('Y-m-d H:i:s', $iat + $exp);\n $moment = date('Y-m-d H:i:s');\n if ($moment > $validUntil) {\n throw new \\Exception('Expired JWT Token', 401);\n }\n return true;\n }",
"public function shouldExpire()\n {\n return null !== $this->expires;\n }",
"private function isTokenExpired()\r\n {\r\n $hourdiff = round((strtotime($this->getCurrentDate()) - strtotime($this->tokenCreatedAt)) / 60, 1);\r\n\r\n return ($hourdiff >= HelperMethods::config('token_expiry'));\r\n }",
"public function hasExpiresAt() : bool\n {\n return isset($this->expiresAt);\n }",
"public function getIsExpirationRequired()\n {\n if (array_key_exists(\"isExpirationRequired\", $this->_propDict)) {\n return $this->_propDict[\"isExpirationRequired\"];\n } else {\n return null;\n }\n }",
"public function getHasExpired(): bool\n {\n $currentDate = new DateTime();\n if ($this->instagramToken === null) {\n return true;\n }\n return $currentDate > $this->instagramToken->getExpiresIn();\n }",
"public function hasExpired()\n {\n return $this->_markedExpiredByCache || (!empty($this->_ttl) && $this->_ttl <= \\DateTime());\n }",
"public function hasExpired()\n {\n if (version_compare(phpversion(), '5.2.0', '>=')) {\n $dateString = $this->expiryYear . '-' . ($this->expiryMonth + 1) . '-01 00:00:00';\n $expiry_date = \\DateTime::createFromFormat('Y-m-d H:i:s', $dateString);\n $today = new \\DateTime();\n\n return ($today >= $expiry_date) ? true : false;\n } else {\n $card = mktime(0, 0, 0, $this->expiryMonth, '01', $this->expiryYear);\n $today = mktime(0, 0, 0, date('m'), date('d'), date('Y'));\n $cont = $card - $today;\n\n return ($cont < 0) ? true : false;\n }\n\n }",
"private function has_valid_expiration_timestamp_in_incoming_request_body() {\n\t\treturn $this->array_has_integer_at_index( $this->incoming_request_body, 'expires' );\n\t}",
"protected function verifyExpClaim(): void\n {\n if (array_key_exists('exp', $this->claims)) {\n $exp = $this->claims['exp'];\n\n if (is_numeric($exp) && strval($exp) == intval($exp)) {\n if ($exp < (time() - static::$leeway)) {\n throw new ExpiredJwtException('The JWT has expired.', $this);\n }\n } else {\n throw new InvalidJwtException('Invalid \"exp\" value.', $this);\n }\n }\n }",
"public function hasExpiredTrial()\n {\n return $this->trial_ends_at && $this->trial_ends_at->isPast();\n }",
"public function needsRefresh()\n {\n $now = new \\DateTime();\n $utcTime = new \\DateTimeZone('UTC');\n\n try {\n $tokenTime = new \\DateTime($this->expiresAt);\n $tokenTime->setTimezone($utcTime);\n } catch (\\Exception $e) {\n // Sets time for current time if fails\n $tokenTime = $now;\n }\n\n // If the Token is older than now\n return ($tokenTime <= $now);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a paginator for Question | public function getQuestionsPaginator($params = array())
{
$paginator = Zend_Paginator::factory($this->getQuestionsSelect($params));
if( !empty($params['page']) )
{
$paginator->setCurrentPageNumber($params['page']);
}
if( !empty($params['limit']) )
{
$paginator->setItemCountPerPage($params['limit']);
}
if( empty($params['limit']) )
{
$page = (int) Engine_Api::_()->getApi('settings', 'core')->getSetting('question.page', 10);
$paginator->setItemCountPerPage($page);
}
return $paginator;
} | [
"public function getPaginatorAdapter();",
"public function getResponsePaginator(): HttpResponsePaginator;",
"public function getPagination();",
"public function getPaginator(): QueryPaginatorInterface;",
"public function getPaginatorAdapter() {}",
"private function getPaginator()\n {\n return $this->_paginator;\n }",
"protected function getPaginator() {\n\t\treturn $this->get('knp_paginator');\n\t}",
"public function getPaginator()\n {\n return $this->paginator;\n }",
"public function getResultsPerPage();",
"public function getQuestionEntriesPerPage()\n {\n return $this->questionEntriesPerPage;\n }",
"public function getPaginate() {\n /*\n * Iniciando valores.\n */\n $showPages = $this->_showPages;\n $pages = [];\n $pageItems = false;\n $transformer = $this->getTransformer();\n /*\n * Recuperando valores\n */\n $limit = $this->getLimit();\n $pageNumber = (int) $this->getCurrentPage();\n /*\n * Recuperando y clonando builders\n */\n $originalBuilder = $this->getBuilder();\n /**\n * We make a copy of the original builder to leave it as it is\n */\n $builder = clone($originalBuilder);\n /**\n * We make a copy of the original builder to count the total of records\n */\n $totalBuilder = clone($builder);\n $columns = $this->_columns;\n /*\n * Comprobando si el numero de pagina es menor que cero, se iguala a 1\n */\n if ($pageNumber <= 0) {\n $pageNumber = 1;\n }\n /*\n * Calculando numero de registro\n */\n $number = $limit * ($pageNumber - 1);\n /*\n * Estableciendo el limite evitando negativos\n */\n if ($number < $limit) {\n /*\n * establece el limite \n */\n $builder->limit($limit);\n } else {\n /*\n * Establece limite incio-final\n */\n $builder->limit($limit, $number);\n }\n /*\n * Obteniendo consulta\n */\n $query = $builder->getQuery();\n /*\n * Calculando numero de pagina anterior\n */\n if ($pageNumber == 1) {\n $before = 1;\n } else {\n $before = $pageNumber - 1;\n }\n /*\n * ejecutando la consulta\n */\n $pageItems = $query->execute();\n /*\n * Generando flags para having y groups\n */\n $hasHaving = !empty($totalBuilder->getHaving());\n $groups = $totalBuilder->getGroupBy();\n $hasGroup = !empty($groups);\n /**\n * Change the queried columns by a COUNT(*)\n */\n if ($hasHaving && !$hasGroup) {\n if (empty($columns)) {\n throw new Exception(\"When having is set there should be columns option provided for which calculate row count\");\n }\n $totalBuilder->columns($columns);\n } else {\n $totalBuilder->columns(\"COUNT(*) [rowcount]\");\n }\n /**\n * Change 'COUNT()' parameters, when the query contains 'GROUP BY'\n */\n if ($hasGroup) {\n /*\n * Si groups es un array se crea valor separado por comas\n */\n if (gettype($groups) == \"array\") {\n $groupColumn = implode(\", \", $groups);\n } else {\n $groupColumn = $groups;\n }\n /*\n * Sino existe clausula having\n */\n if (!$hasHaving) {\n $totalBuilder->groupBy(null)->columns([\"COUNT(DISTINCT \" . $groupColumn . \") AS [rowcount]\"]);\n } else {\n $totalBuilder->columns([\"DISTINCT \" . $groupColumn]);\n }\n }\n /**\n * Remove the 'ORDER BY' clause, PostgreSQL requires this\n */\n $totalBuilder->orderBy(null);\n\n /**\n * Obtain the PHQL for the total query\n */\n $totalQuery = $totalBuilder->getQuery();\n\n /**\n * Obtain the result of the total query\n * If we have having perform native count on temp table\n */\n if ($hasHaving) {\n $sql = $totalQuery->getSql();\n $modelClass = $builder->_models;\n\n if (gettype($modelClass) == \"array\") {\n $modelClass = array_values($modelClass)[0];\n }\n\n $model = new $modelClass();\n $dbService = $model->getReadConnectionService();\n $db = $totalBuilder->getDI()->get($dbService);\n $row = $db->fetchOne(\"SELECT COUNT(*) as \\\"rowcount\\\" FROM (\" . $sql[\"sql\"] . \") as T1\", Db::FETCH_ASSOC, $sql[\"bind\"]);\n $rowcount = $row ? intval($row[\"rowcount\"]) : 0;\n $totalPages = \\intval(\\ceil($rowcount / $limit));\n } else {\n $result = $totalQuery->execute();\n $row = $result->getFirst();\n $rowcount = $row ? \\intval($row->rowcount) : 0;\n $totalPages = \\intval(\\ceil($rowcount / $limit));\n }\n\n if ($pageNumber < $totalPages) {\n $next = $pageNumber + 1;\n } else {\n $next = $totalPages;\n }\n //Rango de Paginacion\n $range = (int) $showPages / 2;\n /*\n * Obteniendo rango derecho\n */\n $rightRange = $totalPages - $pageNumber;\n $rest = 0;\n /*\n * Si el rango derecho es menos que rango\n */\n if ($rightRange < $range) {\n /*\n * Residuo es la restade range y rangoderecho\n */\n $rest = $range - $rightRange;\n }\n /*\n * Obteniendo rango izquierdo\n */\n $leftRange = $pageNumber - ($range + $rest);\n /*\n * Generado paginas.\n * Iniciando en numero de paginas hasta rangoizquierdo\n */\n for ($i = $pageNumber; $i > $leftRange; $i--) {\n /*\n * Si la pagina es cero se detiene\n */\n if ($i == 0)\n break;\n /*\n * Almacena numero de paginas a la izquierda.\n */\n $pages[] = $i;\n }\n /*\n * Comprobando el numero de pagina es menor al rango para obtener\n * el rango de paginas a la derecha\n */\n if ($pageNumber < $range) {\n $rightRange = $showPages;\n } else {\n $rightRange = $pageNumber + $range;\n }\n /*\n * Generando paginas a la derecha.\n * Iniciando en la pagina actual hasta el rango derecho \n */\n for ($i = $pageNumber + 1; $i <= $rightRange; $i++) {\n /*\n * Si el contador rebasa el total de paginas se detiene\n */\n if ($i > $totalPages)\n break;\n /*\n * Almacenando numero de paginas a la derechas\n */\n $pages[] = $i;\n }\n /*\n * Ordenando paginas\n */\n \\sort($pages);\n /*\n * Creando clases estandar\n */\n $page = new \\stdClass();\n $page->items = $pageItems;\n $page->first = 1;\n $page->before = $before;\n $page->current = $this->getCurrentPage();\n $page->last = $totalPages;\n $page->next = $next;\n $page->totalPages = $totalPages;\n $page->totalItems = $rowcount;\n $page->limit = $this->getLimit();\n \n return $page;\n }",
"abstract protected function getPaginationView();",
"protected function getPagination(){\r\n return $this->_di->make('\\Of\\Std\\Pagination');\r\n }",
"public static function getTasks(): Paginator;",
"public function getItemsPerPage();",
"public function getJoinPagesForQuery() {}",
"public function getQuestions();",
"public function getPagination()\n {\n return $this->get(self::pagination);\n }",
"private function getRelatedPages()\n {\n return\n DB::query(\"\nSELECT id, cdate, title FROM articles\nWHERE id IN (SELECT bind FROM pages_related WHERE item = {$this->id})\nORDER BY cdate DESC\")\n ->fetchAll(PDO::FETCH_FUNC, function ($id, $cdate, $title) {\n return [\n 'id' => (int)$id,\n 'cdate' => FFIECommon::_date_format($cdate),\n 'title' => trim($title)\n ];\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unset product attribute value (translations) | public function unsetAttributeValue(Model $product, Model $attributeInstance, $locale = null)
{
$attributeValues = AttributeValue::where('product_id', '=', $product->id)
->where('attribute_id', '=', $attributeInstance->id);
// Delete Value locales
if ($locale) {
return AttributeValueTranslation::whereIn('translatable_id', array_pluck($attributeValues->get(), 'id'))
->where('locale', '=', $locale)
->delete();
}
// Delete Value
return $attributeValues->delete();
} | [
"public function unsetCustomAttributeValues(): void\n {\n $this->customAttributeValues = [];\n }",
"public function deleteValue() {\n\t\tLoader::db()->Execute('delete from atMultilingualAttribute where avID = ?', array($this->getAttributeValueID()));\n\t}",
"function removeOptionValueFromProduct($get) {\n\t\t$this->getAndPrepare('option_id',$get,$optionId);\n\t\t$this->getAndPrepare('option_value_id',$get,$optionValueId);\n\t\tamDB::query(\"delete from \".TABLE_PRODUCTS_ATTRIBUTES.\" where options_id = '$optionId' and options_values_id = '$optionValueId' and products_id = '$this->intPID'\");\n\t}",
"public function testRemoveValues()\n {\n $this->attr->setKey('many')\n ->setValues(['multitude', 'myriad', 'mucho'], false);\n\n $this->attr->removeValue('myriad');\n\n $this->assertEquals(\n 'many=\"multitude mucho\"',\n $this->attr->render()\n );\n }",
"function removeAllAttributesFromProduct( $prop) {\r\n\t\t$idProduct\t\t= (integer)($prop[\"idProduct\"]);\r\n\t\t$format\t\t\t= isset($prop[\"format\"])? $prop[\"format\"]: \"OBJECT\";\r\n\t\t\r\n\t\tif ( !$idProduct) {\r\n\t\t\tif ( $format == 'JSON') {\r\n\t\t\t\tprint( PHP_EOL .\"//product id missing!\". PHP_EOL);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$sql\t= \"\r\n\t\t\tDELETE FROM\r\n\t\t\t\tgt8_products_features\r\n\t\t\tWHERE\r\n\t\t\t\tid_product\t= $idProduct\r\n\t\t\";\r\n\t\tmysql_query( $sql);\r\n\t\t\r\n\t\tif ( $format == \"JSON\") {\r\n\t\t\tprint(PHP_EOL .\"//#affected rows: \". mysql_affected_rows() . PHP_EOL);\r\n\t\t}\r\n\t\t\r\n\t\tLogAdmActivity( array(\r\n\t\t\t\"action\"\t=> \"delete\",\r\n\t\t\t\"page\"\t\t=> \"products/attributes/\",\r\n\t\t\t\"name\"\t\t=> 'all',\r\n\t\t\t\"value\"\t\t=> '',\r\n\t\t\t\"idRef\"\t\t=> $idProduct\r\n\t\t));\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"public function revert()\n {\n /** @var EavSetup $eavSetup */\n $eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]);\n $eavSetup->removeAttribute(Product::ENTITY, ProductAttributeInterface::CODE_AW_FAQ_ARTICLES);\n }",
"public function unsetManufacturer() {\r\n\r\n\t\tself::errorReset();\r\n\r\n\t\t$this->unsetAttribute(\"/manufacturer\");\r\n\t}",
"public function unsetAllAttributeValue()\n {\n foreach ($this->attributes as $key=>$val) {\n $this->$key = null;\n }\n }",
"function lt_clear_lang_meta() {\n\n $prefix = LT_META_PREFIX;\n\n //get order id\n $order_id = lt_get_order_cookie();\n \n //clear translate to order meta\n update_post_meta( $order_id, $prefix . 'tran_to', '' );\n \n}",
"public function clean_translations() {\n db_update('taxonomy_term_data')\n ->fields(array('i18n_tsid' => 0))\n ->condition('i18n_tsid', $this->tsid)\n ->execute(); \n }",
"function dbDeleteProdAttr($iProduct){\n $GLOBALS['oFF']->deleteInFile( DB_PRODUCT_ATTRIBUTES, $iProduct, 0 );\n }",
"public function unsetAttribute($index)\n {\n unset($this->attribute[$index]);\n }",
"public function unsetLookupAttribute($index)\n {\n unset($this->lookupAttribute[$index]);\n }",
"public function unsetSku(): void\n {\n $this->sku = [];\n }",
"public function uninstallAttributes()\n {\n if ($this->versionCompare('5.5.0', '>=')) {\n $service = $this->container->get('shopware_attribute.crud_service');\n $service->delete('s_order_basket_attributes', 'wuunderconnector_wuunder_parcelshop_id');\n $service->delete('s_order_details_attributes', 'wuunderconnector_wuunder_parcelshop_id');\n } else {\n Shopware()->Models()->removeAttribute(\n 's_order_basket_attributes',\n 'wuunderconnector',\n 'wuunder_parcelshop_id');\n Shopware()->Models()->addAttribute(\n 's_order_details_attributes',\n 'wuunderconnector',\n 'wuunder_parcelshop_id');\n }\n\n $metaDataCacheDoctrine = Shopware()->Models()->getConfiguration()->getMetadataCacheImpl();\n $metaDataCacheDoctrine->deleteAll();\n\n Shopware()->Models()->generateAttributeModels(array('s_order_basket_attributes'));\n Shopware()->Models()->generateAttributeModels(array('s_order_details_attributes'));\n }",
"function remove_attribute($name)\n\t{\n\t\tunset($this->attributes[$name]);\n\t}",
"function wc_delete_attribute($id)\n {\n }",
"function remove_attribute($attrib) \r\n\t{\r\n \tunset($this->attributes[strtolower($attrib)]);\r\n\t}",
"public function removeUnicodeLocaleAttribute($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fungsi menampilkan form Input Nilai | public function inputNilai(){
// Jika session data username tidak ada maka akan dialihkan kehalaman login
if (!isset($this->session->userdata['username'])) {
redirect(base_url("login"));
}
// Menampilkan data berdasarkan id-nya yaitu username
$rowAdm = $this->Users_model->get_by_id($this->session->userdata['username']);
$dataAdm = array(
'wa' => 'Web administrator',
'univ' => 'STMIK Mardira Indonesia',
'username' => $rowAdm->username,
'email' => $rowAdm->email,
'level' => $rowAdm->level,
);
// Menampung data yang diinputkan
$data = array(
'button' => 'Proses',
'back' => site_url('nilai/inputNilai'),
'action' => site_url('nilai/inputNilai_action'),
'kode_matakuliah' => set_value('kode_matakuliah'),
'id_thn_akad' => set_value('id_thn_akad'),
);
$this->load->view('header',$dataAdm); // Menampilkan bagian header dan object data users
$this->load->view('nilai/inputNilai_form', $data); // Menampilkan halaman form input nilai
$this->load->view('footer'); // Menampilkan bagian footer
} | [
"public function inputNilai(){\n\t // Jika session data username tidak ada maka akan dialihkan kehalaman login\t\t\t\n\t if (!isset($this->session->userdata['username'])) {\n\t\tredirect(base_url(\"login\"));\n\t }\t\n\t \n\t // Menampilkan data berdasarkan id-nya yaitu username \n\t $rowAdm = $this->Users_model->get_by_id($this->session->userdata['username']);\n\t $dataAdm = array(\t\n\t\t\t'wa' => 'Web administrator',\n\t\t\t'univ' => 'SmartCard Course',\n\t\t\t'username' => $rowAdm->username,\n\t\t\t'email' => $rowAdm->email,\n\t\t\t'level' => $rowAdm->level,\n\t\t);\n\t \n\t // Menampung data yang diinputkan\n $data = array(\n 'button' => 'Proses',\n\t\t'back' => site_url('nilai/inputNilai'),\n 'action' => site_url('nilai/inputNilai_action'),\n\t 'kode_matapelajaran' => set_value('kode_matapelajaran'),\n\t\t'id_thn_akad' => set_value('id_thn_akad'),\n\t );\t\t\n\t\t\n $this->load->view('header',$dataAdm); // Menampilkan bagian header dan object data users\t \n $this->load->view('nilai/inputNilai_form', $data); // Menampilkan halaman form input nilai\n\t\t$this->load->view('footer'); // Menampilkan bagian footer\n }",
"function form_iku() {\n\n\t\t$par\t= array('id'=>$this->user->get_id(), 'periode'=>date('Y'));\n $sasaran_iku = $this->api->post($this->url->remun . '/sasaran_iku', $par);\n \n if (empty($sasaran_iku)){\n\t\t\t$this->form_iku_baru();\n\t\t} else {\n\t\t\t$id= $sasaran_iku[0]['ID'];\n\t\t\t$this->form_iku_edit($id);\n\t\t}\n }",
"public function InputCantidad() {\n\t\t\tif(AppValidar::PeticionAjax() == true AND isset($_POST) == true) {\n\t\t\t\t$DatosPost = AppFormato::Espacio()->MatrizDatos($_POST);\n\t\t\t\t$Plantilla = new NeuralPlantillasTwig('Tienda');\n\t\t\t\t$Plantilla->Parametro('Cantidad', $DatosPost['Cantidad']);\n\t\t\t\techo $Plantilla->MostrarPlantilla('Inventario/Editar/CampoInputCantidad.html');\n\t\t\t}\n\t\t\telse {\n\t\t\t\theader(\"Location: \".NeuralRutasApp::RutaUrlApp('Central'));\n\t\t\t\texit();\n\t\t\t}\n\t\t}",
"function cek_input()\n\t{\n\t\t$this->form_validation->set_rules('nama','Nama','required');\n\t\t$this->form_validation->set_rules('email','Email','required');\n\t\t$this->form_validation->set_rules('konfir_email','Konfirmasi email','required');\n\n\t\tif($this->form_validation->run() != false)\n\t\t{\n\t\t\techo \"Form Validation sudah oke\";\n\t\t}else\n\t\t{\n\t\t\t$this->load->view('view_form_validation');\n\t\t}\n\n\t}",
"private function verifica_campos() {\n if(!empty($this->input->post('nome'))){\n $this->doença=$this->input->post('nome');\n }\n if(!empty($this->input->post('alergia_nome'))){\n $this->alergia=$this->input->post('alergia_nome');\n }\n \n if (!empty($this->input->post('nome_medica'))){\n $this->medicamento=$this->input->post('nome_medica');\n }\n }",
"public function validate() {\r\n if ($this->get_nama() == \"\") {\r\n $this->_error .= \"Nama Jenis Surat Cuti belum diinput!</br>\";\r\n $this->_valid = FALSE;\r\n }\r\n }",
"public function input1($champs){\n echo \"<div class='col-xs-12 col-sm-12 col-md-12 col-lg-12 form-row'>\n <input type='text' name='$champs' placeholder='$champs' class='form-control normal'>\n </div>\";\n\n }",
"public function input_ukuran_peternakan(){\n\t\t\tif(!isset($_SESSION['nilai_pengisian_skala']) || !isset($_SESSION['pengisian_ahp'])) {\n\t\t\t\techo 'error: empty session';\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Set Session\n\t\t\t$_SESSION['ukuran_peternakan'] = $this->input->post('ukuran_peternakan');\n\n\t\t\t// Redirect Halaman Pengisian Skala\n\t\t\t$this->halaman_input_skala_ayam();\n\t\t}",
"public function inputquiz(){\n\t\tglobal $CONFIG, $basedomain;\n\t\t$soal=$_POST['soal'];\n\t\t$pilihan1=$_POST['pilihan1'];\n\t\t$pilihan2=$_POST['pilihan2'];\n\t\t$pilihan3=$_POST['pilihan3'];\n\t\t$pilihan4=$_POST['pilihan4'];\n\t\t$keterangan=$_POST['keterangan'];\n\t\t$jawaban=$_POST['jawaban'];\n\t\t$kursus=$_POST['kursus'];\n\t\t$materi=$_POST['materi'];\n\t\t$groupkursus=$_POST['groupkursus'];\n\t\t$n_status=$_POST['quizstatus'];\n\n\n\t\t// pr($_POST);\n\t\t$data=$this->models->inputquiz($soal,$pilihan1,$pilihan2,$pilihan3,$pilihan4,$jenissoal,$keterangan,$jawaban,$kursus,$materi,$groupkursus, $n_status);\n\t\t//kondisi untuk memberi peringatan proses input berhasil atau tidak\n\t\t// pr($data);\n\t\tif ($data==1){\n\t\t\techo \"<script>alert('data berhasil disimpan');</script>\";\n\t\t\tredirect($basedomain.'quiz/quizlist');\n\t\t}\n\n\t}",
"function crea_formulario() {\n global $campos;\n foreach ($campos as $campo => $valor) {\n if (!(is_numeric($campo))) {\n echo \"<label for = $campo>$campo</label>\";\n echo \"<input type = text name = valorNuevo[] value = '$valor' /><br />\";\n echo \"<input type = hidden name = campos[] value = '$campo' />\";\n echo \"<input type = hidden name = valorAnt[] value= '$valor' />\";\n }\n }\n}",
"public function form_nst()\n\t{\n\t\t// Mengambil list cabang2 \n\t\t$data['pertanyaan'] = $this->data_m->get('tb_cabang')->result();\n\t\t$this->template->load('template2', 'request_support_form/form_nst', $data);\n\t}",
"function tambah()\n\t{\n\t\t$data['judul'] = \"Tambah Kategori\";\n\t\t$this->theme->set_ui('admin/tambahkategori', $data);\n\n\t\t//mengambil semua inputan dari form\n\t\t$inputan = $this->input->post();\n\n\t\t//Jika ada inputan\n\t\tif($inputan)\n\t\t{\n\t\t\t$this->Mkategori->simpan_kategori($inputan);\n\t\t\tredirect(\"admin/kategori\");\n\t\t}\n\t}",
"public function set_pelajaran_name($val) { $this->input['pelajaran'] = $val ; }",
"function tambah_aksi(){\n\t\t$nama = $this->input->post('nama');\n\t\t$alamat = $this->input->post('alamat');\n\t\t$pekerjaan = $this->input->post('pekerjaan');\n\n\t\t// data akan disimpan dalam array, dengan penamaan seperti berikut. \n\t\t$data = array(\n\t\t\t'nama' => $nama,\n\t\t\t'alamat' => $alamat,\n\t\t\t'pekerjaan' => $pekerjaan\n\t\t\t);\n\t\t\t// lalu data ini akan diproses oleh model, lalu akan menginputkan data, lalu akan dimasukkan kedalam database user\n\t\t$this->m_data->input_data($data,'user');\n\t\t// dan jika berhasil maka dia akan kembalike tampilan awal \n\t\tredirect('crud/index');\n\t}",
"public function mostraFormCibo(){\n //assegnazione a smarty per mostrare la form di inserimento di un nuovo cibo\n $this->smarty->display(\"NuovoIngrediente.tpl\");\n }",
"public function mostrar_nombre(){\n if($this -> nombre !== \"\"){\n echo 'value=\"'.$this -> nombre .'\"';\n }\n }",
"function TambahTipeCustomer()\n {\n // header title\n $text = \"Tambah Tipe Customer\";\n HeaderTitle($text);\n \n // form\n TambahTipeCustomerForm();\n }",
"public function tambahdataguru(){\n\t\t$guru['nama'] = $this->input->post('nama');\n\t\t$guru['mapel'] = $this->input->post('mapel');\n\t\t$guru['telp'] = $this->input->post('telp');\n\n\t\t$query = $this->crud_siswa->tambahdataguru($guru);\n\t\tredirect('beranda/tampil');\n\t}",
"function formVolumeKubus(){\n\t\techo \"<form action='' method='POST'>\n\t\t\t\t<div class='judul'>\n\t\t\t\t\t<h2>Mencari <u>Volume Kubus</u></h2>\n\t\t\t\t</div>\n\t\t\t\t<input type='text' name='kondisi' value='2' hidden>\n\t\t\t\t<label for='sisi'>Masukkan Sisi</label>\n\t\t\t\t<input type='number' name='sisi' placeholder='Masukkan Sisi ...'>\n\t\t\t\t<button class='buttonHitung' type='submit' name='hitungVolumeKubus'>Hitung</button>\n\t\t\t</form>\";\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send inventory update feed | protected function sendInventoryFeed() {
// set up basic connection
$conn_id = ftp_connect(SPS_FTP_SERVER);
$login_result = ftp_login($conn_id, SPS_FTP_USERNAME, SPS_FTP_USERPASS);
if ((!$conn_id) || (!$login_result)) {
Log::error("FTP connection has failed! Attempted to connect to " . SPS_FTP_SERVER . " for user " . SPS_FTP_USERNAME);
exit;
} else {
Log::info("Connected to " . SPS_FTP_SERVER . " for user " . SPS_FTP_USERNAME);
}
ftp_pasv($conn_id, true);
/** AMZ MWS Server Configs **/
$config = [
'ServiceURL' => $this->serviceUrl,
'ProxyHost' => null,
'ProxyPort' => -1,
'MaxErrorRetry' => 3
];
/** AMZ MWS details **/
$service = new \MarketplaceWebService_Client(
CC_AWS_ACCESS_KEY_ID,
CC_AWS_SECRET_ACCESS_KEY,
$config,
CC_APPLICATION_NAME,
CC_APPLICATION_VERSION
);
/** Get contents of NAV inventory feed **/
$feed = "/sftp-arp-root/CampClub/Inventory/out/inventory.xml";
$timeStampOB = new \DateTime('now', new \DateTimeZone('America/Denver'));
$timeStamp = $timeStampOB->format('Y-m-d_H:i:s');
$feedHandle = @fopen(resource_path('inc/xml/out/campclubInventoryUpdate_' . $timeStamp . '.xml'), 'w+');
if(@ftp_fget($conn_id, $feedHandle, $feed, FTP_ASCII, 0)) {
Log::info("successfully written to $feedHandle");
} else {
Log::error("There was a problem while downloading $feed to $feedHandle");
}
rewind($feedHandle);
/** Set up & send AMWS call **/
$parameters = array (
'Merchant' => CC_MERCHANT_ID,
'MarketplaceId' => CC_MARKETPLACE_ID,
'FeedType' => '_POST_INVENTORY_AVAILABILITY_DATA_',
'FeedContent' => $feedHandle,
'PurgeAndReplace' => false,
'ContentMd5' => base64_encode(md5(stream_get_contents($feedHandle), true))
);
$request = new \MarketplaceWebService_Model_SubmitFeedRequest($parameters);
try {
$response = $service->submitFeed($request);
if ($response->isSetSubmitFeedResult()) {
$submitFeedResult = $response->getSubmitFeedResult();
if ($submitFeedResult->isSetFeedSubmissionInfo()) {
$feedSubmissionInfo = $submitFeedResult->getFeedSubmissionInfo();
$submissionInfo = "Feed details: type " . $feedSubmissionInfo->getFeedType() . " submitted on " . $feedSubmissionInfo->getSubmittedDate()->format(DATE_FORMAT);
Log::info($submissionInfo);
}
}
} catch (\MarketplaceWebService_Exception $ex) {
$errorMessage =
"Error exception: " . $ex->getMessage() .
" Status code: " . $ex->getStatusCode() .
" Error code: " . $ex->getErrorCode() .
" Error type: " . $ex->getErrorType() .
" Request ID: " . $ex->getRequestId();
Log::error($errorMessage);
}
// Delete the file from the FTP server
if (@ftp_delete($conn_id, $feed)) {
Log::info("$feed deleted successful");
} else {
Log::error("could not delete $feed");
}
@fclose($feedHandle);
} | [
"public function massUpdateAction()\n {\n $postData = $this->getRequest()->getPost();\n\n // Error handling\n if ( empty( $postData['inventory']) ) {\n $message = $this->__('Error: No items selected');\n Mage::getSingleton('adminhtml/session')->addError($message);\n\n $this->_redirect('*/*');\n return;\n }\n\n // Decode the serialized data\n $inventory = Mage::helper('adminhtml/js')->decodeGridSerializedInput( $postData['inventory'] );\n\n // Iterate through all of the POST data and save the new inventory data\n foreach ( $inventory as $productId => $data ) {\n $product = Mage::getModel('catalog/product')->load($productId);\n $item = Mage::getModel('cataloginventory/stock_item')\n ->loadByProduct($productId)\n ->setQtyOnHand($data['qty_on_hand'])\n ->save();\n\n // Set a successful message for each item\n $message = $this->__('%s (%s) has been saved. Qty on Hand: %s',$product->getName(),$product->getSku(),$data['qty_on_hand']);\n Mage::getSingleton('adminhtml/session')->addSuccess($message);\n }\n\n // Redirect back to the inventory list\n $this->_redirect('*/*');\n }",
"abstract protected function sync_inventory_changes();",
"public function updateListAction()\n { \n try{\n $oYCube = new AsignYellowcubeCore();\n $aResponse = $oYCube->getInventory();\n\n // save in database \n if ($aResponse['success']) {\n $oModel = new Inventory();\n $iCount = $oModel->saveInventoryData($aResponse['data']);\n\n $this->View()->assign(\n array(\n 'success' => true,\n 'dcount' => $iCount\n )\n );\n } else {\n $this->View()->assign(\n array(\n 'success' => false,\n 'code' => -1\n )\n ); \n } \n } catch(Exception $e) { \n $oLogs = new Errorlogs();\n $oLogs->saveLogsData('Inventory', $e);\n\n $this->View()->assign(\n array(\n 'success' => false,\n 'code' => $e->getCode(), \n 'message' => $e->getMessage()\n )\n );\n } \n }",
"public static function updateInventory(){\n $arrCart = Products_Controller::getCartFromSession();\n if(!empty($arrCart)){\n foreach($arrCart as $key => $strValue){\n $intAvailableProducts = (int) Products_Controller::getAvailableProducts($key);\n $intUpdatedProducts = $intAvailableProducts - $strValue;\n update_post_meta($key ,'_meta_information_points_qty', (int) $intUpdatedProducts);\n }\n }\n }",
"public function update() {\r\n\tItem::$rawItems[$this->idItem]['amount'] = $this->amount;\r\n\tItem::$rawItems[$this->idItem]['priece'] = $this->priece;\r\n\tItem::$rawItems[$this->idItem]['name'] = $this->name;\r\n}",
"public function updated(Inventory $inventory)\n {\n //\n }",
"public function actionNeweggInventoryUpdate()\n {\n ob_start();\n\n $connection = Yii::$app->get(Yii::$app->getBaseDb());\n\n $dbList = Yii::$app->getDbList();\n\n $processedMerchantCount = 0;\n $size = 100;\n\n $result = NeweggCronSchedule::find()->where(['cron_name' => 'update_inventory'])->one();\n if ($result && $result['cron_data'] != \"\") {\n $cron_array = json_decode($result['cron_data'], true);\n } else {\n $cron_array = $connection->createCommand(\"SELECT * FROM `merchant_db` WHERE `app_name` LIKE '%\" . Data::APP_NAME_NEWEGG_US . \"%'\")->queryAll();\n }\n\n if (is_array($cron_array) && count($cron_array)) {\n foreach ($cron_array as $key => $merchant) {\n try {\n\n if (!in_array($merchant['db_name'], $dbList)) {\n unset($cron_array[$key]);\n continue;\n }\n\n if ($processedMerchantCount == $size)\n break;\n $processedMerchantCount++;\n unset($cron_array[$key]);\n\n Yii::$app->dbConnection = Yii::$app->get($merchant['db_name']);\n Yii::$app->merchant_id = $merchant['merchant_id'];\n Yii::$app->shop_name = $merchant['shop_name'];\n\n $query = \"SELECT `config`.`seller_id`, `config`.`authorization`,`config`.`secret_key`,`shop`.`purchase_status`, `shop`.`token`, `shop`.`email`,`shop`.`app_status`, `shop`.`install_status`, `shop`.`currency` FROM `newegg_configuration` `config` INNER JOIN (SELECT `token`, `app_status`, `install_status`,`purchase_status`,`email`, `merchant_id`, `currency` FROM `newegg_shop_detail` WHERE `merchant_id`='{$merchant['merchant_id']}') `shop` ON `shop`.`merchant_id` = `config`.`merchant_id` WHERE `config`.`merchant_id`='{$merchant['merchant_id']}'\";\n\n $configData = Data::sqlRecords($query, 'one');\n\n if ($configData) {\n $isValidate = Neweggappdetail::validateApiCredentials($configData['seller_id'], $configData['secret_key'], $configData['authorization']);\n\n if (!$configData['install_status'] || $configData['purchase_status'] == \"License Expired\" || $configData['purchase_status'] == \"Trail Expired\" || $configData['app_status'] == \"uninstall\") {\n continue;\n }\n\n $configData['merchant_id'] = $merchant['merchant_id'];\n $configData['shop_url'] = $merchant['shop_name'];\n\n $obj = new NeweggproductController(Yii::$app->controller->id, '');\n $obj->actionInventoryupdate($configData, true);\n }\n } catch (Exception $e) {\n Data::createLog(\"order sync exception \" . $e->getMessage() . PHP_EOL . $e->getTraceAsString(), 'NeweggOrderCron/exception.log', 'a', true);\n if (isset($cron_array[$key]))\n unset($cron_array[$key]);\n continue;\n } catch (\\yii\\db\\IntegrityException $e) {\n Data::createLog(\"order sync db-integrity-exception \" . $e->getMessage() . PHP_EOL . $e->getTraceAsString(), 'NeweggOrderCron/exception.log', 'a', true);\n if (isset($cron_array[$key]))\n unset($cron_array[$key]);\n continue;\n } catch (\\yii\\db\\Exception $e) {\n Data::createLog(\"order sync db-exception \" . $e->getMessage() . PHP_EOL . $e->getTraceAsString(), 'NeweggOrderCron/exception.log', 'a', true);\n if (isset($cron_array[$key]))\n unset($cron_array[$key]);\n continue;\n }\n }\n }\n\n if (count($cron_array) == 0)\n $result->cron_data = \"\";\n else\n $result->cron_data = json_encode($cron_array);\n\n $result->save(false);\n $html = ob_get_clean();\n }",
"public function rakutenInventoryAction ()\n\t{\n\t\ttry {\n\t\t\t$cron = Mage::getModel('productfeed/cron');\n\t\t\t$cron->processRakutenInventoryFeed();\n\t\t\t$text = '<h1>Done</h1>';\n\t\t} catch (Exception $e) {\n\t\t\t$text = '<h1>' . $e->getMessage() . '</h1><br /><pre>' . $e->getTraceAsString() . '</pre>';\n\t\t}\n\t\t$this->_renderLayoutMessage($text);\n\t}",
"public function testUpdateUserInventoryStatus()\n {\n }",
"public function updateQtyAction()\n {\n try {\n $invoice = $this->_initInvoice(true);\n \t$this->_changeInvoice($invoice);\n\n $this->loadLayout();\n $response = $this->getLayout()->getBlock('order_items')->toHtml();\n } catch (Mage_Core_Exception $e) {\n $response = array(\n 'error' => true,\n 'message' => $e->getMessage()\n );\n $response = Mage::helper('core')->jsonEncode($response);\n } catch (Exception $e) {\n $response = array(\n 'error' => true,\n 'message' => $this->__('Cannot update item quantity.')\n );\n $response = Mage::helper('core')->jsonEncode($response);\n }\n $this->getResponse()->setBody($response);\n }",
"public function execute()\n {\n $fileList = $this->getFileList(parent::FTP_INVENTORY_DIR);\n\n if (count($fileList) > 0) {\n foreach ($fileList as $statusFile) {\n $skus = $this->getInventoryData($statusFile['filename']);\n\n // TODO - if the process is slows down: try direct inserting the (qty and status) data and re-indexing\n $productCollection = $this->getProductCollection($skus);\n /** @var \\Magento\\Catalog\\Model\\Product $product */\n foreach ($productCollection as $product) {\n $qty = $this->inventoryData[$product->getSku()];\n $product->setStockData(\n [\n 'qty' => $qty, // qty\n 'is_in_stock' => $qty > 0 ? 1 : 0, // Stock Availability\n ]\n )->save();\n $this->logger->info(\n __('Product inventory updated for sku: \"%1\" as: \"%2\"', $product->getSku(), $qty)\n );\n }\n }\n }\n }",
"public function flushFeed($items, $feedType = 'inventory'){\n\n\t\t//invoque Repricing\n\n\t\tif($feedType == 'repricing'){\n\n\t\t\t$xmlFeeds = $this->creating_POST_PRODUCT_PRICING_DATA($items);\n\t\t\t\n\t\t\tif($this->filename == '')\n\t\t\t\t$this->filename = 'reprice_'.date(\"Ymd-H-is\").'.xml';\n\n\t\t\t$feedHandle = @fopen(WWW_ROOT.'files/FEED_LOG/'.$this->filename, 'arw+');\n\n\t\t\tfwrite($feedHandle, $xmlFeeds);\n\n\t\t\trewind($feedHandle);\n\n\t\t\t$this->request = new MarketplaceWebService_Model_SubmitFeedRequest();\n\n\t\t\t$this->request->setMerchant(Configure::read('PETER.MWS.SELLER_ID'));\n\n\t\t\t$this->request->setMarketplaceIdList(array(\"Id\" => array(Configure::read('PETER.MWS.MARKETPLACE_ID'))));\n\n\t\t\t$this->request->setFeedType('_POST_PRODUCT_PRICING_DATA_');\n\n\t\t\t$this->request->setContentMd5(base64_encode(md5(stream_get_contents($feedHandle), true)));\n\n\t\t\trewind($feedHandle);\n\n\t\t\t$this->request->setPurgeAndReplace(false);\n\n\t\t\t$this->request->setFeedContent($feedHandle);\n\n\t\t\t$this->invokeSubmitFeed($this->service, $this->request);\n\n\t\t\trewind($feedHandle);\n\n\t\t}\n\n\t\tif($feedType == 'inventory'){\n\n\t\t\t// \t\t\tdebug('INVEN');\n\n\t\t\t$xmlFeeds = $this->creating_POST_INVENTORY_AVAILABILITY_DATA($items);\n\t\t\t\n\t\t\t$this->filename = 'inventory_'.date(\"Ymd-H-is\").'.xml';\n\n\t\t\t$feedHandle = @fopen(WWW_ROOT.'files/FEED_LOG/'.$this->filename, 'arw+');\n\n\t\t\tfwrite($feedHandle, $xmlFeeds);\n\n\t\t\trewind($feedHandle);\n\n\t\t\t$this->request = new MarketplaceWebService_Model_SubmitFeedRequest();\n\n\t\t\t$this->request->setMerchant(Configure::read('PETER.MWS.SELLER_ID'));\n\n\t\t\t$this->request->setMarketplaceIdList(array(\"Id\" => array(Configure::read('PETER.MWS.MARKETPLACE_ID'))));\n\n\t\t\t$this->request->setFeedType('_POST_INVENTORY_AVAILABILITY_DATA_');\n\n\t\t\t$this->request->setContentMd5(base64_encode(md5(stream_get_contents($feedHandle), true)));\n\n\t\t\trewind($feedHandle);\n\n\t\t\t$this->request->setPurgeAndReplace(false);\n\n\t\t\t$this->request->setFeedContent($feedHandle);\n\n\t\t\t$this->invokeSubmitFeed($this->service, $this->request);\n\n\t\t\trewind($feedHandle);\n\n\t\t}\n\n\t\treturn null;\n\t}",
"function update_quantity_to_remote(LocalInventoryItem $inventoryItem)\n {\n if (!$this->registry) {\n throw new UnmetDependency('unmet dependency: Registry object');\n }\n if ($this->listing_provider == 'ebay') {\n if ($inventoryItem->balance == $this->balance) {\n throw new StockSyncNotRequiredException(\"listing#{$this->uniqid} local balance is {$this->balance}, new proposed balance is {$inventoryItem->balance}\");\n }\n \n $new_quantity = $inventoryItem->balance;\n\n # handle the multiply\n if ($multiply = $this->_get_multiply()) {\n $new_quantity = ($new_quantity / $multiply);\n }\n print(\"trying new quantity $new_quantity\\n\");\n\n $api_keys = $this->api_keys($this->registry);\n $api = new ReviseInventoryStatus($api_keys);\n $requestxml = '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n <ReviseInventoryStatusRequest xmlns=\"urn:ebay:apis:eBLBaseComponents\">\n <RequesterCredentials>\n <eBayAuthToken>' . $api_keys->requestToken . '</eBayAuthToken>\n </RequesterCredentials>\n <InventoryStatus>\n <ItemID>' . $this->itemid . '</ItemID>\n <SKU>' . $this->sku . '</SKU>\n <Quantity>' . $new_quantity . '</Quantity>\n </InventoryStatus>\n <MessageID>1</MessageID>\n <WarningLevel>High</WarningLevel>\n <Version>' . $api_keys->compatLevel . '</Version>\n </ReviseInventoryStatusRequest>';\n\n /** @var EbayApiResponse $response */\n $response = $api->execute($requestxml);\n $resp = new RemoteResponse($response->http_status_code, $response->error, empty($response->error), ['xml' => $response->xml]);\n return $resp;\n } elseif ($this->listing_provider == 'etsy') {\n /** @var EtsyApiKeysModel $api_keys */\n $api_keys = $this->api_keys();\n if (empty($api_keys)) {\n throw new ApiKeyNotFoundException(\"etsy api key for listing#{$this->uniqid} not found\");\n }\n $api = new EtsyApi($api_keys);\n $api->updateInventory([\n\n ]);\n }\n }",
"public function updateQtyAction()\n {\n try {\n $creditmemo = $this->_initCreditmemo(true);\n $this->loadLayout();\n $response = $this->getLayout()->getBlock('order_items')->toHtml();\n } catch (Mage_Core_Exception $e) {\n $response = array(\n 'error' => true,\n 'message' => $e->getMessage()\n );\n $response = Mage::helper('core')->jsonEncode($response);\n } catch (Exception $e) {\n $response = array(\n 'error' => true,\n 'message' => $this->__('Cannot update the item\\'s quantity.')\n );\n $response = Mage::helper('core')->jsonEncode($response);\n }\n $this->getResponse()->setBody($response);\n }",
"public static function update_all_inventory() {\n\n\t\t$query_args = array(\n\t\t\t'fields' => 'ids',\n\t\t\t'post_type' => 'product',\n\t\t\t'nopaging' => true,\n\t\t\t'meta_key' => '_wc_shipwire_manage_stock',\n\t\t\t'meta_value' => 'yes',\n\t\t);\n\n\t\t// get the SKUs for product managed by shipwire\n\t\t$query = new WP_Query( $query_args );\n\n\t\tif ( $query->post_count ) {\n\n\t\t\t$success = self::update_inventory( $query->posts );\n\n\t\t\tif ( $success ) {\n\n\t\t\t\twc_shipwire()->log_update( sprintf( _n( 'Updated inventory for %d product.', 'Updated inventory for %d products.', $query->post_count, 'woocommerce-shipwire' ), $query->post_count ) );\n\n\t\t\t\tdo_action( 'wc_shipwire_all_inventory_updated', $query->posts );\n\t\t\t}\n\t\t}\n\n\t\treturn $query->post_count;\n\t}",
"public function update_price_at_mws_inventory(){\n\t\tdebug(date('Y-m-d H:i:s'));\n\t\t\n\t\tApp::import('Model','Master');\r\n\t\t\r\n\t\t$master = new Master();\n\t\t\n\t\t$master->update_price_at_mws_inventory();\n\t\t\n\t\tdebug(date('Y-m-d H:i:s'));\n\t\t\n\t}",
"public function updateKitInventory() {\n\t\textract($this->request->data);\n\t\t//this->request->data contains\n\t\t//array(\n\t\t//\t'pullQty' => '1',\n\t\t//\t'itemId' => '90',\n\t\t//\t'rowId' => '52d08471-8838-4330-b765-00ed47139427',\n\t\t//\t'onHand' => 'undefined',\n\t\t//\t'mode' => 'pull'\n\t\t//)\n\t\t//setup return array\n\t\t$orderItemType = $this->Item->OrderItem->field('catalog_type', array('id' => $rowId));\n\t\tif($orderItemType & (ON_DEMAND | INVENTORY_KIT)){\n\t\t\t$orderItemCatId = $this->Item->OrderItem->field('catalog_id', array('id' => $rowId));\n\t\t\t$this->requestAction(array('controller' => 'Catalogs', 'action' => 'kitAdjustment', $orderItemCatId, abs($pullQty), $orderItemType));\n\t\t\t$onHand = $this->Item->field('quantity', array('id' => $itemId));\n\t\t}\n\t\treturn $onHand;\n\t}",
"protected function updateItem() {\n\t\t$this->identifySKU();\n\t\t\n\t\t$articleIdent = 'SKU: '.$this->cItem['SKU'].' ('.\n\t\t\t'Title: '.(!empty($this->cItem['ItemTitle']) ? $this->cItem['ItemTitle'] : '-').'; '.\n\t\t\t'MeinpaketID: '.$this->cItem['MeinpaketID'].\n\t\t\t')';\n\t\t\n\t\tif ((int)$this->cItem['pID'] <= 0) {\n\t\t\t$this->log(\"\\n\".$articleIdent.' not found');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$this->log(\"\\n\".$articleIdent.' found (pId: '.$this->cItem['pID'].')');\n\t\t\n\t\tif (!$this->fetchProductData()) {\n\t\t\t// unknown product\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$batchItem = array();\n\t\tif (!$this->checkQuantityPriceUpdate($batchItem)) {\n\t\t\t// nothing to update\n\t\t\treturn;\n\t\t}\n\t\t#echo print_m($batchItem, '$batchItem');\n\t\t$this->addToBatch($batchItem);\n\t\t\n\t\treturn;\n\t}",
"public function syncInventoryPriority()\n {\n \n // get the items simply by time stamp of today\n $daysback_options = explode (',',$this->option('sync_inventory_warhsname'))[3] ;\n $daysback = intval(!empty($daysback_options) ? $daysback_options : 10); // change days back to get inventory of prev days\n $stamp = mktime(1 - ($daysback*24), 0, 0);\n $bod = date(DATE_ATOM,$stamp);\n $url_addition = '(WARHSTRANSDATE ge '.$bod. ' or PURTRANSDATE ge '.$bod .' or SALETRANSDATE ge '.$bod.')';\n if($this->option('variation_field')) {\n // $url_addition .= ' and ' . $this->option( 'variation_field' ) . ' eq \\'\\' ';\n }\n $response = $this->makeRequest('GET', 'LOGPART?$select=PARTNAME&$filter= '.urlencode($url_addition).' &$expand=LOGCOUNTERS_SUBFORM,PARTBALANCE_SUBFORM', [], $this->option('log_inventory_priority', false));\n\n // check response status\n if ($response['status']) {\n\n $data = json_decode($response['body_raw'], true);\n\n foreach($data['value'] as $item) {\n\n // if product exsits, update\n\n $option_filed = explode (',',$this->option('sync_inventory_warhsname'))[2] ;\n $field = (!empty($option_filed) ? $option_filed : 'PARTNAME');\n $args = array(\n 'post_type' => array('product', 'product_variation'),\n 'meta_query'\t=>\tarray(\n array(\n 'key' => '_sku',\n 'value'\t=> $item[$field]\n )\n )\n );\n $my_query = new \\WP_Query( $args );\n if ( $my_query->have_posts() ) {\n while ( $my_query->have_posts() ) {\n $my_query->the_post();\n $product_id = get_the_ID();\n\n\n }\n }else{\n $product_id = 0;\n }\n\n //if ($id = wc_get_product_id_by_sku($item['PARTNAME'])) {\n if(!$product_id == 0){\n // update_post_meta($product_id, '_sku', $item['PARTNAME']);\n // get the stock by part availability\n $stock = $item['LOGCOUNTERS_SUBFORM'][0]['DIFF'];\n\n // get the stock by specific warehouse\n $wh_name = explode (',',$this->option('sync_inventory_warhsname'))[0];\n $foo =$this->option('sync_inventory_warhsname');\n $foo2 = explode (',',$this->option('sync_inventory_warhsname'))[1];\n $is_deduct_order = explode (',',$this->option('sync_inventory_warhsname'))[1] == 'ORDER';\n $orders = $item['LOGCOUNTERS_SUBFORM'][0]['ORDERS'];\n foreach($item['PARTBALANCE_SUBFORM'] as $wh_stock){\n if($wh_stock['WARHSNAME'] == $wh_name) {\n $stock = $wh_stock['TBALANCE'] > 0 ? $wh_stock['TBALANCE'] : 0; // stock\n if ($is_deduct_order) {\n $stock = $wh_stock['TBALANCE'] - $orders > 0 ? $wh_stock['TBALANCE'] - $orders : 0; // stock - orders\n }\n }\n }\n $statuses = explode (',',$this->option('sync_inventory_warhsname'))[4];\n if(!empty($statuses)){\n $stock -= $this->get_items_total_by_status($product_id);\n $item['order_status_qty'] = $this->get_items_total_by_status($product_id);\n }\n $item['stock'] = $stock;\n $item = apply_filters('simply_sync_inventory_priority',$item);\n $stock = $item['stock'];\n update_post_meta($product_id, '_stock', $stock);\n // set stock status\n if (intval($stock) > 0) {\n // update_post_meta($product_id, '_stock_status', 'instock');\n $stock_status = 'instock';\n } else {\n // update_post_meta($product_id, '_stock_status', 'outofstock');\n $stock_status = 'outofstock';\n }\n $variation = wc_get_product($product_id);\n // $variation->set_stock_status($stock_status);\n $variation->save();\n }\n }\n // add timestamp\n $this->updateOption('inventory_priority_update', time());\n } else {\n /**\n * t149\n */\n $this->sendEmailError(\n $this->option('email_error_sync_inventory_priority'),\n 'Error Sync Inventory Priority',\n $response['body']\n );\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Multiple roles field callback. | public function field_enable_multi_roles() { ?>
<label>
<input type="checkbox" name="members_settings[multi_roles]" value="true" <?php checked( members_multiple_user_roles_enabled() ); ?> />
<?php esc_html_e( 'Allow users to be assigned more than a single role.', 'members' ); ?>
</label>
<?php } | [
"public static function multiple_roles_field()\n {\n global $pagenow, $user_id;\n \n if (in_array($pagenow, array('user-edit.php', 'user-new.php')))\n {\n $editable_roles = get_editable_roles();\n \n if ($user_id)\n {\n $user = get_user_to_edit($user_id);\n $user_roles = array_intersect(array_values($user->roles), array_keys($editable_roles));\n }\n else\n {\n $user_roles = null;\n }\n\n $roles = array();\n foreach ($editable_roles as $role => $details) \n {\n $roles[$role] = translate_user_role($details['name']); \n }\n \n piklist::render('shared/field-user-role', array(\n 'user_roles' => $user_roles\n ,'roles' => $roles\n ), false);\n }\n }",
"public static function _bulkUserRoleEdit() {\n\t\tif ( ! empty( $_GET[ stripslashes( __CLASS__ ) . '-nonce' ] ) && wp_verify_nonce(\n\t\t\t\tfilter_input( INPUT_GET, stripslashes( __CLASS__ ) . '-nonce', FILTER_SANITIZE_STRING ),\n\t\t\t\t__FILE__ . get_current_user_id() . __CLASS__\n\t\t\t)\n\t\t) {\n\t\t\t$addRole = filter_input( INPUT_GET, stripslashes( __CLASS__ ) . '-add-role', FILTER_SANITIZE_STRING );\n\t\t\t$removeRole = filter_input( INPUT_GET, stripslashes( __CLASS__ ) . '-remove-role', FILTER_SANITIZE_STRING );\n\t\t\t$userIds = array_map( 'absint', (array) filter_input( INPUT_GET, 'users', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ) );\n\n\t\t\tif ( ! empty( $userIds ) && ( ! empty( $addRole ) || ! empty( $removeRole ) ) ) {\n\t\t\t\t// Loop through all selected users and verify current user can edit them.\n\t\t\t\tforeach ( $userIds as $userId ) {\n\t\t\t\t\t// Verify user has permission to promote the user\n\t\t\t\t\tif ( ! current_user_can( 'promote_user', $userId ) ) {\n\t\t\t\t\t\twp_die( sprintf(\n\t\t\t\t\t\t/* Translator note: %d is the user ID that cannot be edited. */\n\t\t\t\t\t\t\tesc_html__( 'You can\\'t edit user with ID %d', 'dfwood-wp-multiple-roles' ),\n\t\t\t\t\t\t\t$userId\n\t\t\t\t\t\t) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the user doesn't already belong to the blog, bail.\n\t\t\t\t\tif ( is_multisite() && ! is_user_member_of_blog( $userId ) ) {\n\t\t\t\t\t\twp_die(\n\t\t\t\t\t\t\t'<h1>' . esc_html__( 'Cheatin’ uh?', 'dfwood-wp-multiple-roles' ) . '</h1>' .\n\t\t\t\t\t\t\t'<p>' . esc_html__( 'One of the selected users is not a member of this site.', 'dfwood-wp-multiple-roles' ) . '</p>',\n\t\t\t\t\t\t\t403\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Verify the user isn't trying to promote themselves, prevents accidental loss of privileges.\n\t\t\t\t\tif ( get_current_user_id() === $userId ) {\n\t\t\t\t\t\twp_die( esc_html__( 'You are not allowed to edit your own user role(s)!', 'dfwood-wp-multiple-roles' ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If we make it here, then there are no known issues adding/removing requested roles.\n\t\t\t\t// We are doing a second loop to avoid updating any users if we can't update all of them.\n\t\t\t\tforeach ( $userIds as $userId ) {\n\t\t\t\t\t$user = get_userdata( $userId );\n\n\t\t\t\t\tif ( ! empty( $addRole ) ) {\n\t\t\t\t\t\t$user->add_role( $addRole );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! empty( $removeRole ) ) {\n\t\t\t\t\t\t$user->remove_role( $removeRole );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Go back to the users page, ensure our GET args are cleared out and show confirmation message.\n\t\t\t\twp_safe_redirect( add_query_arg( 'update', 'promote', admin_url( 'users.php' ) ) );\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t}",
"public function rolesForUser();",
"public function field_select_roles() { ?>\n\n\t\t<p class=\"description\">\n\t\t\t<?php esc_html_e( 'Select which roles should have admin access.', 'members' ); ?>\n\t\t</p>\n\n\t\t<div class=\"wp-tab-panel\">\n\n\t\t<ul>\n\t\t\t<?php foreach ( members_get_roles() as $role ) :\n\n\t\t\t\t$disabled = in_array( $role->name, get_roles_with_permanent_access() ); ?>\n\n\t\t\t\t<li>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<?php if ( ! $disabled ) : ?>\n\n\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"members_admin_access_settings[roles][]\" value=\"<?php echo esc_attr( $role->name ); ?>\" <?php checked( role_has_access( $role->name ) ); ?> />\n\n\t\t\t\t\t\t<?php else : ?>\n\n\t\t\t\t\t\t\t<input readonly=\"readonly\" disabled=\"disabled\" type=\"checkbox\" name=\"members_admin_access_settings[roles][]\" value=\"<?php echo esc_attr( $role->name ); ?>\" <?php checked( role_has_access( $role->name ) ); ?> />\n\n\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t<?php echo esc_html( $role->label ); ?>\n\t\t\t\t\t</label>\n\t\t\t\t</li>\n\n\t\t\t<?php endforeach; ?>\n\t\t</ul>\n\n\t\t</div><!-- .wp-tab-panel -->\n\t<?php }",
"public function getRolesForSelect();",
"function mrpu_add_multiple_roles_ui($user)\n{\n\t// Not allowed to edit user - bail\n\tif (!current_user_can('edit_user', $user->ID)) {\n\t\treturn;\n\t}\n\n\t$current_action = current_action();\n\t$current_screen = get_current_screen();\n\n\t$roles = get_editable_roles();\n\t//Ensure only admins or users with edit_users role can assign roles\n\t$user_can_edit_users = current_user_can('edit_users');\n\t$user_roles = array_intersect(array_values($user->roles), array_keys($roles));\n\n\tif ($user_can_edit_users) :\n?>\n\t<div class=\"mrpu-roles-container\">\n\t\t<h3><?php _e('User Roles', 'multiple-roles-per-user'); ?></h3>\n\t\t<table class=\"form-table\">\n\t\t\t<tr>\n\t\t\t\t<th><label for=\"user_credits\"><?php _e('Roles', 'multiple-roles-per-user'); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<?php foreach ($roles as $role_id => $role_data) : ?>\n\t\t\t\t\t\t<label for=\"user_role_<?php echo esc_attr($role_id); ?>\">\n\t\t\t\t\t\t\t<input type=\"checkbox\" id=\"user_role_<?php echo esc_attr($role_id); ?>\" value=\"<?php echo esc_attr($role_id); ?>\" name=\"mrpu_user_roles[]\" <?php echo in_array($role_id, $user_roles) ? ' checked=\"checked\"' : ''; ?> />\n\t\t\t\t\t\t\t<?php echo $role_data['name']; ?>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t<br />\n\t\t\t\t\t<span class=\"description\"><?php _e('Select one or more roles for this user.', 'multiple-roles-per-user'); ?></span>\n\t\t\t\t\t<?php wp_nonce_field('mrpu_set_roles', '_mrpu_roles_nonce'); ?>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>\n\t<?php endif; ?>\n\t<?php if ('profile' !== $current_screen->id) : ?>\n\t\t<?php\n\t\t// Do some hacking around to hide the built-in user roles selector\n\t\t// First hide it with CSS and then get rid of it with jQuery\n\t\t?>\n\t\t<style>\n\t\t\tlabel[for=\"role\"],\n\t\t\tselect#role {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t</style>\n\t\t<script type=\"text/javascript\">\n\t\t\t(function($) {\n\t\t\t\t$(document).ready(function() {\n\t\t\t\t\tvar row = $('select#role').closest('tr');\n\t\t\t\t\tvar clone = row.clone();\n\t\t\t\t\t// clone.insertAfter( $('select#role').closest('tr') );\n\t\t\t\t\trow.html($('.mrpu-roles-container tr').html());\n\t\t\t\t\t$('.mrpu-roles-container').remove();\n\t\t\t\t})\n\t\t\t})(jQuery)\n\t\t</script>\n\t<?php endif; ?>\n<?php }",
"function eve_api_admin_roles_form_submit($form, &$form_state) {\n if ((int) variable_get('eve_api_blue_role', 2) != 2) {\n $uids = array();\n $result = db_query('SELECT uid FROM {users_roles} WHERE rid = :rid', array(\n ':rid' => (int) variable_get('eve_api_blue_role', 2),\n ));\n\n if ($result->rowCount()) {\n foreach ($result->fetchAll() as $row) {\n $uids[] = $row->uid;\n }\n }\n\n if (!empty($uids)) {\n user_multiple_role_edit($uids, 'remove_role', (int) variable_get('eve_api_blue_role', 2));\n user_multiple_role_edit($uids, 'add_role', (int) $form_state['values']['blue_role']);\n }\n }\n\n if ((int) variable_get('eve_api_alliance_role', 2) != 2) {\n $uids = array();\n $result = db_query('SELECT uid FROM {users_roles} WHERE rid = :rid', array(\n ':rid' => (int) variable_get('eve_api_alliance_role', 2),\n ));\n\n if ($result->rowCount()) {\n foreach ($result->fetchAll() as $row) {\n $uids[] = $row->uid;\n }\n }\n\n if (!empty($uids)) {\n user_multiple_role_edit($uids, 'remove_role', (int) variable_get('eve_api_alliance_role', 2));\n user_multiple_role_edit($uids, 'add_role', (int) $form_state['values']['alliance_role']);\n }\n }\n\n if ((int) variable_get('eve_api_unverified_role', 2) != 2) {\n $uids = array();\n $result = db_query('SELECT uid FROM {users_roles} WHERE rid = :rid', array(\n ':rid' => (int) variable_get('eve_api_unverified_role', 2),\n ));\n\n if ($result->rowCount()) {\n foreach ($result->fetchAll() as $row) {\n $uids[] = $row->uid;\n }\n }\n\n if (!empty($uids)) {\n user_multiple_role_edit($uids, 'remove_role', (int) variable_get('eve_api_unverified_role', 2));\n user_multiple_role_edit($uids, 'add_role', (int) $form_state['values']['unverified_role']);\n }\n }\n\n if ((int) variable_get('eve_api_ceo_role', 2) != 2) {\n $uids = array();\n $result = db_query('SELECT uid FROM {users_roles} WHERE rid = :rid', array(\n ':rid' => (int) variable_get('eve_api_ceo_role', 2),\n ));\n\n if ($result->rowCount()) {\n foreach ($result->fetchAll() as $row) {\n $uids[] = $row->uid;\n }\n }\n\n if (!empty($uids)) {\n user_multiple_role_edit($uids, 'remove_role', (int) variable_get('eve_api_ceo_role', 2));\n user_multiple_role_edit($uids, 'add_role', (int) $form_state['values']['ceo_role']);\n }\n }\n\n if ((int) variable_get('eve_api_director_role', 2) != 2) {\n $uids = array();\n $result = db_query('SELECT uid FROM {users_roles} WHERE rid = :rid', array(\n ':rid' => (int) variable_get('eve_api_director_role', 2),\n ));\n\n if ($result->rowCount()) {\n foreach ($result->fetchAll() as $row) {\n $uids[] = $row->uid;\n }\n }\n\n if (!empty($uids)) {\n user_multiple_role_edit($uids, 'remove_role', (int) variable_get('eve_api_director_role', 2));\n user_multiple_role_edit($uids, 'add_role', (int) $form_state['values']['director_role']);\n }\n }\n\n variable_set('eve_api_blue_role', (int) $form_state['values']['blue_role']);\n variable_set('eve_api_alliance_role', (int) $form_state['values']['alliance_role']);\n variable_set('eve_api_unverified_role', (int) $form_state['values']['unverified_role']);\n variable_set('eve_api_ceo_role', (int) $form_state['values']['ceo_role']);\n variable_set('eve_api_director_role', (int) $form_state['values']['director_role']);\n\n drupal_set_message(t('The roles have been updated and will be updated with the next scheduled cron tasks.'));\n}",
"public function getUserRoles();",
"public function render_field_roles() {\n\n\t\t$options = (array) get_option( 'bd_passexp_settings', [] );\n\t\t$roles = get_editable_roles();\n\n\t\tforeach ( $roles as $role => $role_data ) {\n\n\t\t\t$name = sanitize_key( $role );\n\t\t\t$value = ( ! $options ) ? ( 'administrator' === $role ? 0 : 1 ) : ( empty( $options['roles'][ $name ] ) ? 0 : 1 );\n\n\t\t\tprintf(\n\t\t\t\t'<p><input type=\"checkbox\" name=\"bd_passexp_settings[roles][%1$s]\" id=\"bd_passexp_settings[roles][%1$s]\" %2$s value=\"1\"><label for=\"bd_passexp_settings[roles][%1$s]\">%3$s</label></p>',\n\t\t\t\tesc_attr( $name ),\n\t\t\t\tchecked( $value, 1, false ),\n\t\t\t\tesc_html( $role_data['name'] )\n\t\t\t);\n\n\t\t}\n\n\t}",
"public function saveRoles($roles)\n {\n }",
"public function rolesPermissions();",
"function custom_field_roles( $custom_fields ) {\r\n\r\n\t\t\t$fields = maybe_unserialize( $custom_fields );\r\n\r\n\t\t\tif ( ! is_array( $fields ) )\r\n\t\t\t\treturn false;\r\n\r\n\t\t\tforeach ( $fields as $field_key => $field_settings ) {\r\n\r\n\t\t\t\tif ( strstr( $field_key , 'role_' ) ) {\r\n\t\t\t\t\tif ( is_array( $field_settings['options'] ) ) {\r\n\t\t\t\t\t\treturn array_keys( $field_settings['options'] );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\t\t}",
"protected function add_content_roles() {\n\t\t\t$wp_deault_roles = [\n\t\t\t\t'administrator' => true,\n\t\t\t\t'editor' => true,\n\t\t\t\t'author' => true,\n\t\t\t\t'contributor' => true,\n\t\t\t\t'subscriber' => true\n\t\t\t];\n\n\t\t\tif ( isset( $_REQUEST['action'] ) ) {\n\t\t\t\t// Security check.\n\t\t\t\tif ( 'delete' === $_REQUEST['action'] ) {\n\t\t\t\t\t$wp_nonce = isset( $_REQUEST['_wpnoncedelrole'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnoncedelrole'] ) ) : ''; // input var okay.\n\t\t\t\t\tif ( ! wp_verify_nonce( $wp_nonce, 'wpda-manage-roles-settings' ) ) {\n\t\t\t\t\t\twp_die( __( 'ERROR: Not authorized', 'wp-data-access' ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay.\n\t\t\t\t\tif ( ! wp_verify_nonce( $wp_nonce, 'wpda-manage-roles-settings' ) ) {\n\t\t\t\t\t\twp_die( __( 'ERROR: Not authorized', 'wp-data-access' ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( 'save' === $_REQUEST['action'] ) {\n\t\t\t\t\tWPDA::set_option(\n\t\t\t\t\t\tWPDA::OPTION_WPDA_ENABLE_ROLE_MANAGEMENT,\n\t\t\t\t\t\tisset( $_REQUEST['enable_role_management'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['enable_role_management'] ) ) : 'off' // input var okay.\n\t\t\t\t\t);\n\n\t\t\t\t\tWPDA::set_option(\n\t\t\t\t\t\tWPDA::OPTION_WPDA_USE_ROLES_IN_SHORTCODE,\n\t\t\t\t\t\tisset( $_REQUEST['use_roles_in_shortcode'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['use_roles_in_shortcode'] ) ) : 'off' // input var okay.\n\t\t\t\t\t);\n\n\t\t\t\t\tif ( isset( $_REQUEST['wpda_role_name'] ) && is_array( $_REQUEST['wpda_role_name'] ) &&\n\t\t\t\t\t isset( $_REQUEST['wpda_role_label'] ) && is_array( $_REQUEST['wpda_role_label'] )\n\t\t\t\t\t) {\n\t\t\t\t\t\t$no_roles = count( $_REQUEST['wpda_role_name'] );\n\t\t\t\t\t\tfor ( $i = 0; $i < $no_roles; $i ++ ) {\n\t\t\t\t\t\t\t$sanitized_new_role_name = sanitize_text_field( wp_unslash( $_REQUEST['wpda_role_name'][ $i ] ) ); // input var okay.\n\t\t\t\t\t\t\t$sanitized_new_role_label = sanitize_text_field( wp_unslash( $_REQUEST['wpda_role_label'][ $i ] ) ); // input var okay.\n\t\t\t\t\t\t\tadd_role( $sanitized_new_role_name, $sanitized_new_role_label );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'message_text' => __( 'Settings saved', 'wp-data-access' ),\n\t\t\t\t\t\t]\n\t\t\t\t\t);\n\t\t\t\t\t$msg->box();\n\t\t\t\t} elseif ( 'delete' === $_REQUEST['action'] ) {\n\t\t\t\t\tif ( isset( $_REQUEST['delete_role_name'] ) ) {\n\t\t\t\t\t\t$sanitized_role_name = sanitize_text_field( wp_unslash( $_REQUEST['delete_role_name'] ) ); // input var okay.\n\t\t\t\t\t\t$all_users = get_users(\n\t\t\t\t\t\t\t[ 'role' => $sanitized_role_name ]\n\t\t\t\t\t\t);\n\t\t\t\t\t\tforeach ( $all_users as $user ) {\n\t\t\t\t\t\t\t$wp_user = new \\WP_User( $user->ID );\n\t\t\t\t\t\t\t$wp_user->remove_role( $sanitized_role_name );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tremove_role( $sanitized_role_name );\n\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => __( 'Settings saved', 'wp-data-access' ),\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\t\t\t\t\t}\n\t\t\t\t} elseif ( 'setdefaults' === $_REQUEST['action'] ) {\n\t\t\t\t\t// Set back to default values.\n\t\t\t\t\tWPDA::set_option( WPDA::OPTION_WPDA_ENABLE_ROLE_MANAGEMENT );\n\t\t\t\t\tWPDA::set_option( WPDA::OPTION_WPDA_USE_ROLES_IN_SHORTCODE );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$enable_role_management = WPDA::get_option( WPDA::OPTION_WPDA_ENABLE_ROLE_MANAGEMENT );\n\t\t\t$use_roles_in_shortcode = WPDA::get_option( WPDA::OPTION_WPDA_USE_ROLES_IN_SHORTCODE );\n\t\t\t?>\n\t\t\t<form id=\"wpda_settings_manage_roles\"\n\t\t\t\t method=\"post\"\n\t\t\t\t action=\"?page=<?php echo esc_attr( $this->page ); ?>&tab=roles\">\n\n\t\t\t\t<table class=\"wpda-table-settings\">\n\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t<?php echo __( 'Plugin Role Management', 'wp-data-access' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"enable_role_management\"\n\t\t\t\t\t\t\t\t\t<?php echo 'on' === $enable_role_management ? 'checked' : ''; ?>/>\n\t\t\t\t\t\t\t\t<?php echo __( 'Enable role management', 'wp-data-access' ); ?>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"use_roles_in_shortcode\"\n\t\t\t\t\t\t\t\t\t<?php echo 'on' === $use_roles_in_shortcode ? 'checked' : ''; ?>/>\n\t\t\t\t\t\t\t\t<?php echo __( 'Use roles in shortcode wpdadiehard (Data Projects)', 'wp-data-access' ); ?>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t<?php echo __( 'Available Roles', 'wp-data-access' ); ?>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div id=\"list_roles\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tglobal $wp_roles;\n\t\t\t\t\t\t\t\tforeach ( $wp_roles->roles as $role => $val ) {\n\t\t\t\t\t\t\t\t\t$is_wp_role = isset( $wp_deault_roles[ $role ] );\n\t\t\t\t\t\t\t\t\t$role_label = isset( $val['name'] ) ? $val['name'] : $role;\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<div id=\"<?php echo $role; ?>\">\n\t\t\t\t\t\t\t\t<span class=\"dashicons <?php echo $is_wp_role ? 'dashicons-wordpress' : 'dashicons-trash'; ?>\"\n\t\t\t\t\t\t\t\t\t style=\"font-size: 14px; vertical-align: text-top;<?php echo $is_wp_role ? '' : ' cursor: pointer;'; ?>\"></span>\n\t\t\t\t\t\t\t\t\t\t<?php echo $role_label; ?>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<a href=\"void(0);\" class=\"page-title-action\" onclick=\"add_new_role(); return false;\">Add\n\t\t\t\t\t\t\t\t\tNew Role</a>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\n\t\t\t\t</table>\n\n\t\t\t\t<div class=\"wpda-table-settings-button\">\n\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"save\"/>\n\t\t\t\t\t<input type=\"submit\"\n\t\t\t\t\t\t value=\"<?php echo __( 'Save Manage Roles Settings', 'wp-data-access' ); ?>\"\n\t\t\t\t\t\t class=\"button button-primary\"/>\n\t\t\t\t\t<a href=\"javascript:void(0)\"\n\t\t\t\t\t onclick=\"if (confirm('<?php echo __( 'Reset to defaults?', 'wp-data-access' ); ?>')) {\n\t\t\t\t\t\t\t jQuery('input[name=\\'action\\']').val('setdefaults');\n\t\t\t\t\t\t\t jQuery('#wpda_settings_manage_roles').trigger('submit');\n\t\t\t\t\t\t\t }\"\n\t\t\t\t\t class=\"button button-secondary\">\n\t\t\t\t\t\t<?php echo __( 'Reset Manage Roles Settings To Defaults', 'wp-data-access' ); ?>\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\t\t\t\t<?php wp_nonce_field( 'wpda-manage-roles-settings', '_wpnonce', false ); ?>\n\n\t\t\t</form>\n\n\t\t\t<form id=\"delete_role_form\"\n\t\t\t\t method=\"post\"\n\t\t\t\t action=\"?page=<?php echo esc_attr( $this->page ); ?>&tab=roles\">\n\t\t\t\t<input type=\"hidden\" id=\"delete_role_name\" name=\"delete_role_name\" value=\"\">\n\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"delete\">\n\t\t\t\t<?php wp_nonce_field( 'wpda-manage-roles-settings', '_wpnoncedelrole', false ); ?>\n\t\t\t</form>\n\n\n\t\t\t<script type='text/javascript'>\n\t\t\t\tfunction add_new_role() {\n\t\t\t\t\tjQuery('#list_roles').append(\n\t\t\t\t\t\t'<div>' +\n\t\t\t\t\t\t' <span class=\"dashicons dashicons-trash\" style=\"font-size: 14px; vertical-align: text-top; cursor: pointer;\" onclick=\"jQuery(this).parent().remove();\"></span>' +\n\t\t\t\t\t\t' <label for=\"wpda_role_name[]\">Name: </label><input name=\"wpda_role_name[]\" style=\"vertical-align: middle; text-transform: lowercase;\"/>' +\n\t\t\t\t\t\t' <label for=\"wpda_role_label[]\">Label: </label><input name=\"wpda_role_label[]\" style=\"vertical-align: middle;\"/>' +\n\t\t\t\t\t\t'</div>');\n\t\t\t\t}\n\n\t\t\t\tjQuery('.dashicons-trash').on('click', function (e) {\n\t\t\t\t\tif (confirm('<?php echo __( 'Delete role?\\nRole will be removed from all users.\\nThis action cannot be undone! ', 'wp-data-access' ); ?>')) {\n\t\t\t\t\t\tparent = jQuery(e.target).parent();\n\t\t\t\t\t\tparent_id = parent.attr('id');\n\t\t\t\t\t\tjQuery('#delete_role_name').val(parent_id);\n\t\t\t\t\t\tjQuery('#delete_role_form').submit();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t</script>\n\n\t\t\t<?php\n\t\t}",
"public function addRoles($newRoles);",
"function add_roles()\n\t{\n\t\tif ($this->roles !== FALSE && $this->usr_id !== NULL)\n\t\t{\n\t\t\t$insert = \"INSERT INTO \".APP_SCHEMA.\".USR_ROLE (ROLE_ID,USR_ID) VALUES (?, ?)\";\n\t\t\t\t\n\t\t\t$this->db2->set_sql($insert)->prepare();\n\t\t\t\n\t\t\tforeach ($this->roles as $role_id)\n\t\t\t{\n\t\t\t\t$this->db2->set_params(array($role_id, $this->usr_id))->execute();\n\t\t\t}\n\t\t}\n\t}",
"protected function get_roles_data()\n {\n }",
"public function setRoles($roles);",
"public function testIfMultipleRolesAreAdded(): void {\r\n\r\n $this -> acl -> addRoles(['administrator', 'moderator']);\r\n $this -> assertIsArray($this -> acl -> getRoles());\r\n $this -> assertCount(2, $this -> acl -> getRoles());\r\n\r\n $role = $this -> acl -> getRole('administrator');\r\n $this -> assertInstanceOf('sFire\\\\Permissions\\\\Acl\\\\Role', $role);\r\n\r\n $role = $this -> acl -> getRole('moderator');\r\n $this -> assertInstanceOf('sFire\\\\Permissions\\\\Acl\\\\Role', $role);\r\n }",
"public function getRoles()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a time input field. | public function time($name, $value = null, $options = []) {
return $this->input ( 'time', $name, $value, $this->appendClassToOptions ( $options, 'form-control' ) );
} | [
"abstract protected function timepickerField();",
"function time( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_TIME,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t null,\n\t Form::DATA_STRING\n );\n\t}",
"public function input_time( $args ) {\n\n\t\t$this->input_text( $args, 'time' );\n\t}",
"function IFTime($name, $value = null, $options = [])\n{\n return IFInput('time', $name, $value, $options);\n}",
"public function time(string $fieldName, array $options = []): string\n {\n $options += [\n 'value' => null,\n ];\n $options = $this->_initInputField($fieldName, $options);\n $options['type'] = 'time';\n\n return $this->widget('datetime', $options);\n }",
"function addTime($name) {\n $field = (new Fields\\TimePicker($name));\n\n return $this->addField($field);\n }",
"public function printTimeField(array $field)\n {\n $cssId = $this->getCssIdById($field['id']);\n $hasHint = ('' !== (string)$field['hint']);\n $hintId = $cssId . '-help';\n $sClass = \"\";\n if ($field['errors']) {\n $sClass = \"helium-is-invalid\";\n }\n\n\n $value = (string)$field['value'];\n $useSecond = $field['useSecond'];\n $tempName = \"_\" . $field['htmlName'];\n\n $hour = 0;\n $minute = 0;\n $second = 0;\n if ($value) {\n $p = explode(\":\", $value);\n if (true === $useSecond) {\n list($hour, $minute, $second) = $p;\n } else {\n list($hour, $minute) = $p;\n }\n }\n $hour = (int)$hour;\n $minute = (int)$minute;\n $second = (int)$second;\n\n $useSecond = true;\n\n\n ?>\n <div class=\"field form-group cfi-control\" id=\"<?php echo $cssId; ?>\"\n data-cfi-id=\"<?php echo htmlspecialchars($field['id']); ?>\">\n <?php $this->printFieldLabel($field); ?>\n <div class=\"form-inline d-sm-flex\">\n <div>\n <input data-main=\"<?php echo $field['id']; ?>\"\n class=\"input-time input-time-hours form-control mr-2 <?php echo $sClass; ?>\"\n type=\"number\"\n name=\"<?php echo $tempName . \"[hours]\"; ?>\"\n min=\"0\" max=\"23\"\n <?php if (true === $hasHint): ?>\n aria-describedby=\"<?php echo $hintId; ?>\"\n <?php endif; ?>\n value=\"<?php echo htmlspecialchars($hour); ?>\"/> <?php echo $this->options['text']['hours']; ?>\n </div>\n <div>\n <input class=\"input-time input-time-minutes form-control ml-sm-3 mr-2 <?php echo $sClass; ?>\"\n type=\"number\"\n name=\"<?php echo $tempName . \"[minutes]\"; ?>\"\n min=\"0\" max=\"59\"\n value=\"<?php echo htmlspecialchars($minute); ?>\"/> <?php echo $this->options['text']['minutes']; ?>\n </div>\n\n <?php if (true === $useSecond): ?>\n <div>\n <input class=\"input-time input-time-seconds form-control ml-sm-3 mr-2 <?php echo $sClass; ?>\"\n type=\"number\" name=\"<?php echo $tempName . \"[seconds]\"; ?>\"\n min=\"0\" max=\"59\"\n value=\"<?php echo htmlspecialchars($second); ?>\"/> <?php echo $this->options['text']['seconds']; ?>\n </div>\n <?php endif; ?>\n </div>\n\n\n <input class=\"input-target\" type=\"hidden\" name=\"<?php echo htmlspecialchars($field['htmlName']); ?>\"\n value=\"<?php echo htmlspecialchars($field['value']); ?>\">\n\n\n <?php $this->printErrorsAndHint($field); ?>\n </div>\n <?php\n }",
"function createTime($attributesInput=array())\r\n\t{\r\n\t\t$cal = \"<input type='text' \". $this->applyAttrs($attributesInput). \"/>\";\t\t\r\n\t\t$cal .= \"<script> $(\\\"input[name='\".$attributesInput[\"name\"].\"']\\\").timeEntry({spinnerImage: '\".IMAGES_PATH.\"timeentry/spinnerDefault.png',ampmPrefix: ' '}).parent(\\\".timeEntry_wrap\\\").addClass('hidden'); \r\n\t\t</script>\";\r\n\t\treturn $cal;\r\n\t}",
"function greater_jackson_habitat_do_field_timepicker( $args = array() ) {\n\tgreater_jackson_habitat_field_helpers()->fields->do_field_timepicker( $args['name'], $args );\n}",
"public function txtTime_Create($strControlId = null) {\n\t\t\t$this->txtTime = new QIntegerTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtTime->Name = QApplication::Translate('Time');\n\t\t\t$this->txtTime->Text = $this->objConvergenceTime->Time;\n\t\t\treturn $this->txtTime;\n\t\t}",
"function get_input_time($value = array()){\n\t\t\tforeach($this->time_order as $item){\n\t\t\t\tswitch($this->time_map[$item]){\n\t\t\t\t\tcase \"h\":\n\t\t\t\t\tcase \"g\":\n\t\t\t\t\tcase \"G\":\n\t\t\t\t\tcase \"H\":\n\t\t\t\t\t\t$input .= \"<input type='text' name='hour' value='\".$value['hour'].\"' size='2'>\";\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"i\":\n\t\t\t\t\t\t$input .= \"<input type='text' name='minute' value='\".$value['minute'].\"' size='2'>\";\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"s\":\n\t\t\t\t\t\t$input .= \"<input type='text' name='second' value='\".$value['second'].\"' size='2'>\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $input;\n\t\t}",
"public static function time( array $attrs = null )\n {\n return new Input( self::TYPE_TIME, $attrs );\n }",
"function pyis_dpd_helpscout_do_field_timepicker( $args = array() ) {\n\tpyis_dpd_helpscout_fieldhelpers()->fields->do_field_timepicker( $args['name'], $args );\n}",
"public function setTime(){\r\n\t\t$this->rules['time'] = true;\r\n\t\treturn $this;\r\n\t}",
"protected function getForm_Type_TimeService()\n {\n return $this->services['form.type.time'] = new \\Symfony\\Component\\Form\\Extension\\Core\\Type\\TimeType();\n }",
"protected function createTimestampField()\n {\n return FormField::create_tag(\n 'input',\n array(\n 'type' => 'text',\n 'id' => $this->ID() . '_Timestamp',\n 'name' => $this->getName() . '_Timestamp',\n 'value' => time(),\n 'style' => 'display:none!important',\n )\n );\n }",
"protected function createTimeField($field) {\n\n\t\t// Prepare variables.\n\t\t$type = $field->FieldType;\n\t\t$name = $field->RawName;\n\t\t$title = $field->PrettyName ?: $name;\n\n\t\t// Create the field.\n\t\t$nfield = new $type($name, $title);\n\t\t$nfield->setDescription($field->Description);\n\n\t\t// Configure the field.\n\t\tswitch ($type) {\n\t\t\tcase 'DateField':\n\t\t\t\t$nfield->setConfig('datavalueformat', 'yyyy-MM-dd');\n\t\t\t\t$nfield->setConfig('showcalendar', 1);\n\t\t\t\tbreak;\n\n\t\t\tcase 'DatetimeField':\n\t\t\t\t$nfield->setConfig('datavalueformat', 'yyyy-MM-dd HH:mm');\n\t\t\t\t$nfield->getDateField()->setConfig('showcalendar', 1);\n\t\t\t\tbreak;\n\n\t\t\tcase 'TimeField':\n\t\t\t\t$nfield->setConfig('timeformat', 'HH:mm');\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Done.\n\t\treturn $nfield;\n\t}",
"public function ov_time($name, $value = ''){\n $args = func_get_args(); array_shift($args); array_shift($args);\n return $this->generate_input('time', $name, $value, true, $args);\n }",
"static function add_auto_time(): void {\n\t\tself::add_acf_field(self::auto_time, [\n\t\t\t'label' => 'Time to auto add/remove',\n\t\t\t'type' => 'time_picker',\n\t\t\t'instructions' => '',\n\t\t\t'required' => 1,\n\t\t\t'conditional_logic' => [\n\t\t\t\t[\n\t\t\t\t\t[\n\t\t\t\t\t\t'field' => self::qualify_field(self::auto_add),\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => '1',\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t[\n\t\t\t\t\t\t'field' => self::qualify_field(self::auto_remove),\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => '1',\n\t\t\t\t\t]\n\t\t\t\t]\n\t\t\t],\n\t\t\t'wrapper' => [\n\t\t\t\t'width' => '15',\n\t\t\t\t'class' => '',\n\t\t\t\t'id' => '',\n\t\t\t],\n\t\t\t'display_format' => 'g:i a',\n\t\t\t'return_format' => 'H:i',\n\t\t]);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$header['AccessControlAllowOrigin' ] = ''; | function getAllowOrigins(){
$header['Access-Control-Allow-Methods'] = 'GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS';
$header['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization, auth-user';
$header['access-control-max-age'] = 1728000;
$header['access-control-expose-headers'] = 'WWW-Authenticate, Server-Authorization';
$header['access-control-allow-credentials'] = true;
$header['P3P'] = 'CP="CAO PSA OUR"'; // Makes IE to support cookies
#colocando o tempo restante do token (seconds)
$timeTokenTimeLeft = Request::get('token_time_left');
if( $timeTokenTimeLeft ){
$header['access-token-time-left'] = $timeTokenTimeLeft;
$header['Access-Control-Expose-Headers'] = 'access-token-time-left';
}
return $header;
} | [
"function allowOriginHeader()\n{\n // Get the request origin\n $httpOrigin = isset($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : null;\n\n // Check against valid origins and set headers (see VALID_ORIGINS in config.php)\n if (in_array($httpOrigin, VALID_ORIGINS)) {\n header('Access-Control-Allow-Credentials: true');\n header(\"Access-Control-Allow-Origin: ${httpOrigin}\");\n header('Vary: Origin');\n }\n}",
"protected function setHeaderAllowOrigin()\n {\n if (!headers_sent()) {\n $ConfigDb = new \\Rdb\\Modules\\RdbAdmin\\Models\\ConfigDb($this->Container);\n $allowOrigins = $ConfigDb->get('rdbadmin_SiteAllowOrigins');\n unset($ConfigDb);\n\n if (is_scalar($allowOrigins) && !empty($allowOrigins)) {\n $allowOriginsArray = array_map('trim', explode(',', $allowOrigins));\n $headers = array_change_key_case(apache_request_headers());\n if (isset($headers['origin']) && is_array($allowOriginsArray)) {\n foreach ($allowOriginsArray as $allowOrigin) {\n $allowOrigin = strtolower(trim($allowOrigin));\n if (strtolower(trim($headers['origin'])) === $allowOrigin) {\n // if found allowed origin matched the request origin.\n break;\n }\n }// endforeach;\n } elseif (is_array($allowOriginsArray)) {\n $allowOriginsArray = array_values($allowOriginsArray);\n $allowOrigin = array_shift($allowOriginsArray);\n $allowOrigin = strtolower(trim($allowOrigin));\n }\n unset($allowOriginsArray, $headers);\n }\n unset($allowOrigins);\n\n if (isset($allowOrigin)) {\n header('Access-Control-Allow-Origin: ' . $allowOrigin);\n unset($allowOrigin);\n }\n }\n }",
"public static function setAccessControlOrigin($origin) {\n\t\tself::header ( 'Access-Control-Allow-Origin', $origin );\n\t}",
"function set_cors()\n{\n // Permitir el dominio de origen\n if (isset($_SERVER['HTTP_ORIGIN'])) {\n // Ajustar aqui dominios para consumo permitidos\n header(\"Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}\");\n header('Access-Control-Allow-Credentials: true');\n header('Access-Control-Max-Age: 86400'); // cache por 1 dia\n }\n\n // Access-Control headers recibidas durante la petición OPTIONS\n if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {\n if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']))\n header(\"Access-Control-Allow-Methods: GET, POST, OPTIONS\");\n\n if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']))\n header(\"Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}\");\n\n die();\n }\n}",
"public function send_cors_headers() {\n $origin = get_http_origin();\n\n if ( $origin ) {\n header( 'Access-Control-Allow-Headers: Authorization' );\n }\n }",
"function initCors() {\n\n // Allow from any origin\n if (isset($_SERVER['HTTP_ORIGIN'])) {\n \n header(\"Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}\");\n header('Access-Control-Allow-Credentials: true');\n header('Access-Control-Max-Age: 86400'); // cache for 1 day\n }\n\n // Access-Control headers son recibidas durante solicitudes OPTION \n if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {\n\n if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']))\n // Cabecera para acceso a metodos GET, PUT, POST, DELETE, OPTIONS etc\n header(\"Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS\"); \n\n if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']))\n header(\"Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}\");\n\n exit(0);\n }\n\n}",
"protected function setAllowOriginHeader($origin)\n {\n header('Access-Control-Allow-Origin: ' . $origin);\n// header('Access-Control-Allow-Methods: *');\n// header('Access-Control-Allow-Headers: *');\n if($this->allowMethods !== false){\n header('Access-Control-Allow-Methods: '.$this->allowMethods);\n }\n if($this->allowHeaders !== false){\n header('Access-Control-Allow-Headers: '.$this->allowHeaders);\n }\n if (\\Yii::app()->request->requestType == 'OPTIONS') {\n \\Yii::app()->end();\n }\n }",
"protected function _prepareHeaders()\n {\n $this->getResponse()\n ->clearHeaders()\n ->setHeader('Access-Control-Allow-Origin', '*');\n }",
"function cors() {\n\tif (isset($_SERVER['HTTP_ORIGIN'])) {\n\t\theader(\"Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}\");\n\t\theader('Access-Control-Allow-Credentials: true');\n\t\theader('Access-Control-Max-Age: 86400'); // cache for 1 day\n\t}\n\t// Access-Control headers are received during OPTIONS requests\n\tif ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {\n\t\tif (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']))\n\t\t\theader(\"Access-Control-Allow-Methods: GET, POST, OPTIONS\");\n\t\tif (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']))\n\t\t\theader(\"Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}\");\n\t\texit(0);\n\t}\n}",
"public function cors()\n {\n if (isset($this->cors)) {\n $this->headers = 'Access-Control-Allow-Headers, Content-Type, Authorization';\n }\n }",
"public function setCORS() {\n header(\"Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}\");\n header(\"Access-Control-Allow-Credentials: true\");\n header(\"Access-Control-Max-Age: 1800\");\n }",
"public function setCorsHeaders()\n {\n $origin = (trim($this->originHeader)) ? $this->originHeader : '*';\n\n $this->setHeader(\"Access-Control-Allow-Origin: $origin\");\n $this->setHeader('Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS');\n $this->setHeader('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization');\n $this->setHeader('Access-Control-Max-Age: 600');\n $this->setHeader('Content-Type: ' . $this->getContentType());\n }",
"function enable_cors()\n{\n\n if (isset($_SERVER['HTTP_ORIGIN'])) {\n header(\"Access-Control-Allow-Origin: \" . $_SERVER['HTTP_ORIGIN']);\n header('Access-Control-Allow-Credentials: true');\n header('Access-Control-Max-Age: 86400');\n }\n\n if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {\n if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'])) {\n header(\"Access-Control-Allow-Methods: GET, POST, OPTIONS\");\n }\n if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) {\n header(\"Access-Control-Allow-Headers:\" . $_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']);\n }\n exit(0);\n }\n}",
"private function setCORSHeaders()\n {\n\n /*\n * Only set access to known servers\n */\n $httpOrigin = filter_input(INPUT_SERVER, 'HTTP_ORIGIN', FILTER_SANITIZE_STRING);\n if (isset($httpOrigin) && $this->corsIsAllowed($httpOrigin)) {\n header('Access-Control-Allow-Origin: *');\n header('Access-Control-Allow-Credentials: true');\n header('Access-Control-Max-Age: 3600');\n }\n\n /*\n * Control header are received during OPTIONS requests\n */\n $httpRequestMethod = filter_input(INPUT_SERVER, 'HTTP_ACCESS_CONTROL_REQUEST_METHOD', FILTER_SANITIZE_STRING);\n if (isset($httpRequestMethod)) {\n header('Access-Control-Allow-Methods: GET, POST, DELETE, PUT, OPTIONS');\n }\n\n $httpRequestHeaders = filter_input(INPUT_SERVER, 'HTTP_ACCESS_CONTROL_REQUEST_HEADERS', FILTER_SANITIZE_STRING);\n if (isset($httpRequestHeaders)) {\n header('Access-Control-Allow-Headers: ' . $httpRequestHeaders);\n }\n\n return null;\n }",
"function wrg_preflight() {\n\t$request_method = isset( $_SERVER['REQUEST_METHOD'] ) ? $_SERVER['REQUEST_METHOD'] : 'GET';\n\n\t$origin = get_http_origin();\n\n\tif ( is_allowed_http_origin( $origin ) ) {\n\t\theader( 'Access-Control-Allow-Origin: ' . $origin );\n\t\theader( 'Access-Control-Allow-Credentials: true' );\n\t\theader( 'Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE' );\n\t\theader( 'Access-Control-Allow-Headers: Access-Control-Allow-Origin, Access-Control-Allow-Credentials, Origin, Authorization, Credentials, Content-Type' );\n\t\thttp_response_code( 200 );\n\n\t\tif ( 'OPTIONS' === $request_method ) {\n\t\t\texit;\n\t\t}\n\t}\n}",
"protected function setAllowOriginHeader($origin)\n {\n header('Access-Control-Allow-Origin: ' . $origin);\n }",
"public function crossdomain()\n {\n // setup Cross Domain Origin\n header(\"Access-Control-Allow-Origin: *\");\n // setup Header's fields\n header(\"Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Content-Header, Authenticate\");\n // setup credentials\n header('Access-Control-Allow-Credentials: true');\n // setup method support\n header('Access-Control-Allow-Methods: GET, POST, PUT, OPTIONS');\n }",
"public function handlePreflight()\n {\n handleCorsRequest();\n header(\"Access-Control-Allow-Methods: POST, DELETE\");\n header(\"Access-Control-Allow-Credentials: true\");\n header(\"Access-Control-Allow-Headers: Content-Type, X-Requested-With, Cache-Control\");\n }",
"function addCORHeaders()\n {\n $origin = $this->getRequestOrigin();\n $allowed_domains = $this->getAllowedDomains();\n\n if (in_array(strtolower($origin), $allowed_domains, true))\n {\n header('Access-Control-Allow-Origin: *', true);\n header('Access-Control-Allow-Headers: Content-Type, authorization', true);\n }\n\n\n return ($_SERVER['REQUEST_METHOD'] == 'OPTIONS');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Form the notification into the form of a Firebase Cloud Message. | public function toFCM($notifiable, FirebaseMessage $message); | [
"public function toFirebase($notifiable)\n {\n $medication = $this->medication;\n // return (new FirebaseMessage)\n // ->withTitle(\"Hi, $notifiable->name\")\n // ->withBody(\"Time for your medication, $medication->drug_name on $medication->dosage\")\n // ->asNotification($notifiable->fcm_token); // OR ->asMessage($deviceTokens);\n\n $deviceTokens = [];\n $deviceTokens[] = $notifiable->fcm_token;\n\n $fields = [\n 'registration_ids' => $deviceTokens,\n 'notification' => [\n 'title' => \"Hi, $notifiable->name\",\n 'body' => \"Time for your medication, $medication->drug_name on $medication->dosage\",\n 'image' => \"/ee\",\n 'click_action' => 2,\n 'medication_id' => $medication->id\n ],\n 'priority' => 1\n ];\n \n return (new FirebaseMessage)\n ->fromArray($fields)\n ->asMessage($deviceTokens); // OR ->asMessage($deviceTokens);\n }",
"public function formatNotification()\n {\n $notification = array();\n\n $notification['title'] = $this->title;\n $notification['message'] = $this->message;\n $notification['android_channel_id'] = $this->androidChannelId;\n\n if (!empty($this->count))\n $notification['msgcnt'] = $this->count;\n if (!empty($this->audio))\n $notification['soundname'] = $this->audio;\n\n\n return $notification;\n }",
"function fcm_send($title,$text,$token,$msgdata=\"\"){\n $API_ACCESS_KEY = 'API_KEY_FCM';\n\n\t$data = array(\n\t\t\"msgdata\" => $msgdata\n\t);\n // prep the bundle\n $msg = array(\n 'title' => $title,\n 'body' => $text,\n 'sound' => \"default\"\n );\n $fields = array(\n 'to' => $token,\n 'notification' => $msg,\n 'data' => $data\n );\n\n\n $headers = array(\n 'Authorization: key='.$API_ACCESS_KEY,\n 'Content-Type: application/json'\n );\n\n #Send Reponse To FireBase Server\n $ch = curl_init();\n curl_setopt($ch,CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');\n curl_setopt($ch,CURLOPT_POST, true);\n curl_setopt($ch,CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch,CURLOPT_POSTFIELDS, json_encode( $fields ));\n $result = curl_exec($ch);\n curl_close($ch);\n //echo $result;\n}",
"public function buildBodyForNotificationType()\r\n {\r\n $messageTemplate = $this->_translator->translate('notification_message-' . $this->_notificationType);\r\n \r\n return $this->_translator->translate('notification-header') . \r\n str_replace(array_keys($this->_notificationData), array_values($this->_notificationData), $messageTemplate) . \r\n $this->_translator->translate('notification-footer');\r\n }",
"function build_email_message() {\n $this->full_email_message = \"New contact message from \" . $this->website_name . \"\\r\\n Sender name: \" . $this->sender_name->input_value . \"\\r\\n Sender email: \" . $this->sender_email->input_value . \"\\r\\n Subject: \" . $this->sender_subject->input_value . \"\\r\\n Message: \". $this->sender_message->input_value;\n }",
"function notifyByFirebase($title,$body,$tokens,$data = [] , $is_notification = true) // paramete 5 =>>>> $type\n {\n $registrationIDs = $tokens;\n $fcmMsg = array(\n 'body' => $body,\n 'title' => $title,\n 'sound' => \"default\",\n 'color' => \"#203E78\"\n );\n $fcmFields = array(\n 'registration_ids' => $registrationIDs,\n 'priority' => 'high',\n 'data' => $data\n );\n if($is_notification){\n $fcmFields['notification'] = $fcmMsg;\n }\n //dd(env('FIREBASE_API_ACCESS_KEY'));\n $headers = array(\n 'Authorization: key='.env('FIREBASE_API_ACCESS_KEY'),\n 'Content-Type: application/json'\n );\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fcmFields));\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}",
"function notifyByFireBase($title,$body,$tokens,$data = []){\n // https://gist.github.com/rolinger/d6500d65128db95f004041c2b636753a\n\n $registrationIDs = $tokens;\n\n $fcmMsg = array(\n 'body' => $body,\n 'title' => $title,\n 'sound' => \"default\",\n 'color' => \"#203E78\"\n );\n\n $fcmFields = array(\n 'registration_ids' => $registrationIDs,\n 'priority' => 'high',\n 'notification' => $fcmMsg,\n 'data' => $data\n );\n\n $headers = array(\n 'Authorization: key='.env('FIRE_BASE_API_ACCESS_KEY'),\n 'Content-Type: application/json'\n );\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fcmFields));\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}",
"public static function sendFCMMsg($args) {\n /* for multiple tokens for all un-sent notificaiotn in notification queue*/\n $registrationIDs = [];\n /* For one token */\n $to = '';\n if(isset($args['registrationIDs'])) {\n $registrationIDs = $args['registrationIDs'];\n }\n if($args['to']) {\n $to = $args['to'];\n }\n $notification = $args['notification'];\n $title = stripslashes($notification->title);\n $message = stripslashes($notification->content);\n $id = $notification->id;\n $imgURL = $notification->image;\n $picURL = '';\n $headers = self::getFCMHeaders();\n $fcmFields = self::createFCMFields($registrationIDs, $to, $title, $message, $id, $imgURL, $picURL);\n print_r($fcmFields);\n $ch = curl_init();\n curl_setopt( $ch,CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send' );\n curl_setopt( $ch,CURLOPT_POST, true );\n curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );\n curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );\n curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );\n curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fcmFields ) );\n //HTTP debugging\n $fp = fopen(dirname(__FILE__).'/errorlog.txt', 'w');\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n curl_setopt($ch, CURLOPT_STDERR, $fp);\n fclose($fp);\n $result = curl_exec($ch );\n curl_close( $ch );\n $result = json_decode($result);\n error_log($result);\n if(isset($result->results)) {\n $fcmResponse = $result->results;\n if(count($fcmResponse) == 1) {\n $fcmResponse_element = $fcmResponse[0];\n if(isset($fcmResponse_element->error) && $fcmResponse_element->error == 'InvalidRegistration') {\n $de_reg = KibarToken::updateTokenIs_register($to, 0);\n }\n if(isset($fcmResponse_element->message_id)) {\n $updateSentProp = KibarNotification::updateSentProperty($args['entry_id'], 1);\n }\n }\n }\n }",
"function fcmNotice(Request $request){\n $optionBuilder = new OptionsBuilder();\n $optionBuilder->setTimeToLive(1*1) //$optionBuilder->setTimeToLive(60*20);\n ->setCollapseKey('a_collapse_key');\n\n $notificationBuilder = new PayloadNotificationBuilder('WebFCM - Video call requested');\n $notificationBuilder->setBody('WebFCM - A patient is waiting for you.')\n ->setSound('default');\n\n $dataBuilder = new PayloadDataBuilder();\n $dataBuilder->addData([\n 'bdcare' => 'true',\n 'body' => 'WebFCM - Body of Your Notification in Data',\n 'title' => 'WebFCM - Title of Your Notification in Title',\n 'room' => 'fcm web',\n 'identity' => 'WebFCM',\n 'access_token' => 'WebFCM',\n ]);\n\n $option = $optionBuilder->build();\n $notification = $notificationBuilder->build();\n $noticeData = $dataBuilder->build();\n\n $token = $request->fcm_token;\n $downstreamResponse = FCM::sendTo($token, $option, null, $noticeData);\n // $downstreamResponse->numberSuccess();\n\n dd($downstreamResponse);\n }",
"private function set_message() {\n\t\t$this->message = FrmFieldsHelper::basic_replace_shortcodes( $this->settings['email_message'], $this->form, $this->entry );\n\n\t\t$prev_mail_body = $this->message;\n\t\t$pass_entry = clone $this->entry; // make a copy to prevent changes by reference\n\t\t$mail_body = FrmEntriesHelper::replace_default_message(\n\t\t\t$prev_mail_body,\n\t\t\tarray(\n\t\t\t\t'id' => $this->entry->id,\n\t\t\t\t'entry' => $pass_entry,\n\t\t\t\t'plain_text' => $this->is_plain_text,\n\t\t\t\t'user_info' => $this->include_user_info,\n\t\t\t)\n\t\t);\n\n\t\t// Add the user info if it isn't already included\n\t\tif ( $this->include_user_info && $prev_mail_body === $mail_body ) {\n\t\t\t$data = $this->entry->description;\n\t\t\t$mail_body .= \"\\r\\n\\r\\n\" . __( 'User Information', 'formidable' ) . \"\\r\\n\";\n\t\t\t$this->maybe_add_ip( $mail_body );\n\t\t\t$mail_body .= __( 'User-Agent (Browser/OS)', 'formidable' ) . ': ' . FrmEntriesHelper::get_browser( $data['browser'] ) . \"\\r\\n\";\n\t\t\t$mail_body .= __( 'Referrer', 'formidable' ) . ': ' . $data['referrer'] . \"\\r\\n\";\n\t\t}\n\n\t\t$this->message = $mail_body;\n\n\t\t$this->message = do_shortcode( $this->message );\n\n\t\tif ( $this->is_plain_text ) {\n\t\t\t$this->message = wp_specialchars_decode( strip_tags( $this->message ), ENT_QUOTES );\n\t\t}\n\n\t\t$this->message = apply_filters( 'frm_email_message', $this->message, $this->package_atts() );\n\t}",
"public function toMessage()\n {\n return array_merge($this->attributes, [\n 'topic' => $this->topic,\n 'event' => $this->name,\n 'version' => $this->version,\n ]);\n }",
"public function build()\n {\n $message = new Message();\n $message->subject = $this->subject;\n $message->recipient = $this->recipient;\n $message->content = $this->content;\n $message->timestamp = date('Y-m-d');\n\n return $message;\n }",
"public function pushNotificationToAndroid()\n {\n // API access key from Google API's Console\n define( 'API_ACCESS_KEY', 'AIzaSyD1Y-YDMpsd2MQiBIdAUb5oZwrPJRLzqgQ' );\n $registrationIds = array('d_x2FYw-EhY:APA91bGKCP0yDS7wwfs_h5lFCBsjK6erjJfKYc7ignQXe3eSTQRqcKr9R_GC-FAcmFNs_3yU2ynILLUQbZR7izBO1SeoFkqioBE0OS9DE2pAMUG1s4RJDXVGl2oky0m6am5lYQ-7-6FZ');\n // prep the bundle\n $msg = array\n (\n 'message' => 'here is a message. message',\n 'title' => 'This is a title. title',\n 'subtitle' => 'This is a subtitle. subtitle',\n 'tickerText' => 'Ticker text here...Ticker text here...Ticker text here',\n 'vibrate' => 1,\n 'sound' => 1\n );\n $fields = array\n (\n 'registration_ids' => $registrationIds,\n 'data' => $msg\n );\n \n $headers = array\n (\n 'Authorization: key=' . API_ACCESS_KEY,\n 'Content-Type: application/json'\n );\n \n $ch = curl_init();\n curl_setopt( $ch,CURLOPT_URL, 'https://android.googleapis.com/gcm/send' );\n curl_setopt( $ch,CURLOPT_POST, true );\n curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );\n curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );\n curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );\n curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );\n $result = curl_exec($ch );\n curl_close( $ch );\n echo $result;\n }",
"function sendPushNotification($fields) \n { \n \n //firebase server url to send the curl request\n $url = 'https://fcm.googleapis.com/fcm/send';\n \n //building headers for the request\n $headers = array(\n 'Authorization: key=' . FIREBASE_API_KEY,\n 'Content-Type: application/json'\n );\n\n //Initializing curl to open a connection\n $ch = curl_init();\n \n //Setting the curl url\n curl_setopt($ch, CURLOPT_URL, $url);\n \n //setting the method as post\n curl_setopt($ch, CURLOPT_POST, true);\n\n //adding headers \n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n \n //disabling ssl support\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n \n //adding the fields in json format \n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));\n \n //finally executing the curl request \n $result = curl_exec($ch);\n if ($result === FALSE) {\n die('Curl failed: ' . curl_error($ch));\n }\n \n //Now close the connection\n curl_close($ch);\n \n //and return the result \n return json_decode($result);\n }",
"function send_message($token, $title, $message, $type) {\n\n\t/*\n\tTitle \t: Transaction Details\n\tMessage :\n\tToday Bottles 3\n\tTotal Amount - 50 | Total Balance - 100\n\t */\n\n\trequire_once 'library/firebase.php';\n\trequire_once 'library/push.php';\n\n\t$firebase = new Firebase();\n\t$push = new Push();\n\n\t// optional payload\n\t$payload = array();\n\t$payload['team'] = 'India';\n\t$payload['score'] = '5.6';\n\n\t$push->setTitle($title);\n\t$push->setMessage($message);\n\t// $push->setImage('');\n\t$push->setType($type);\n\n\t$push->setIsBackground(FALSE);\n\t$push->setPayload($payload);\n\n\t$json = $response = '';\n\n\t$json = $push->getPush();\n\t$response = $firebase->send($token, $json);\n\treturn $response;\n}",
"public function getMessageAttribute()\n {\n $notification = Config::get('lorekeeper.notifications.'.$this->notification_type_id);\n\n $message = $notification['message'];\n\n // Replace the URL... \n $message = str_replace('{url}', url($notification['url']), $message);\n\n // Replace any variables in data... \n $data = $this->data;\n if($data && count($data)) {\n foreach($data as $key => $value) {\n $message = str_replace('{'.$key.'}', $value, $message);\n }\n }\n\n return $message;\n }",
"function push_notifications_mass_push_form($form, $form_state) {\n $form['message'] = array(\n '#type' => 'fieldset',\n '#title' => t('Push Notification Message'),\n '#description' => t('Compose the elements of your push notification message.'),\n '#tree' => TRUE,\n );\n\n $form['message']['alert'] = array(\n '#type' => 'textfield',\n '#title' => t('Push Message'),\n '#description' => t('Compose the message to send out (!limit characters max.)', array(\n '!limit' => PUSH_NOTIFICATIONS_APNS_PAYLOAD_SIZE_LIMIT,\n )),\n '#default_value' => (isset($form_state['values']['message']['alert'])) ? $form_state['values']['message']['alert'] : '',\n '#required' => TRUE,\n '#size' => 128,\n '#maxlength' => PUSH_NOTIFICATIONS_APNS_PAYLOAD_SIZE_LIMIT,\n '#weight' => 10,\n );\n\n if (module_exists('locale')) {\n $form['language'] = array(\n '#type' => 'select',\n '#title' => t('Language'),\n '#options' => push_notifications_used_languages(),\n '#description' => t('Optionally, only select the push notifications to recipients with this language.'),\n '#default_value' => (isset($form_state['values']['language'])) ? $form_state['values']['language'] : '',\n '#weight' => 12,\n );\n }\n\n // Only show Android option if Android credentials are available.\n $recipients_options = array('ios' => t('iOS (iPhone/iPad)'));\n if (PUSH_NOTIFICATIONS_GCM_API_KEY || PUSH_NOTIFICATIONS_FCM_SERVER_KEY) {\n $recipients_options['android'] = t('Android');\n }\n $form['recipients'] = array(\n '#type' => 'checkboxes',\n '#title' => t('Recipients'),\n '#description' => t('Select the recipients for this push message'),\n '#options' => $recipients_options,\n );\n if (count($recipients_options) == 1) {\n $form['recipients']['#default_value'] = array(key($recipients_options));\n }\n\n $form['token'] = array(\n '#type' => 'textfield',\n '#title' => t('Token'),\n '#description' => t('Place a token here to send the message to only one recipient.'),\n '#maxlength' => 255,\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Send Push Notification'),\n '#weight' => 50,\n );\n\n return $form;\n}",
"function host_cancle($from, $to, $togcm, $type, $message, $sender_name, $event_refrence){\n$arr = array(\"host\" => $from,\n\t \"to_id\" => $to,\n\t \"payload_type\" => $type,\n\t \"sender_name\" => $sender_name,\n\t \"event_reference\" => $event_refrence,\n \"payload_message\" => $message);\n$new_payload = json_encode($arr);\nsend_gcm_notify($togcm, $new_payload);\n}",
"public function convert_notification( $form, $nf_notification ) {\n\n\t\t// If notification type is redirect, convert to confirmation.\n\t\tif ( 'redirect' === $nf_notification['type'] ) {\n\n\t\t\t// Create a new confirmation.\n\t\t\t$confirmation = array(\n\t\t\t\t'id' => uniqid(),\n\t\t\t\t'isActive' => '1' === $nf_notification['active'] ? true : false,\n\t\t\t\t'name' => $nf_notification['name'],\n\t\t\t\t'type' => 'redirect',\n\t\t\t\t'url' => $nf_notification['redirect_url'],\n\t\t\t);\n\n\t\t\t// Add confirmation to form.\n\t\t\t$form['confirmations'][ $confirmation['id'] ] = $confirmation;\n\n\t\t}\n\n\t\t// If notification type is success message, convert to confirmation.\n\t\tif ( 'success_message' === $nf_notification['type'] ) {\n\n\t\t\t// Create a new confirmation.\n\t\t\t$confirmation = array(\n\t\t\t\t'id' => uniqid(),\n\t\t\t\t'isActive' => '1' === $nf_notification['active'] ? true : false,\n\t\t\t\t'name' => $nf_notification['name'],\n\t\t\t\t'type' => 'message',\n\t\t\t\t'message' => $this->convert_to_merge_tags( $form, $nf_notification['success_msg'] ),\n\t\t\t);\n\n\t\t\t// Add confirmation to form.\n\t\t\t$form['confirmations'][ $confirmation['id'] ] = $confirmation;\n\n\t\t}\n\n\t\t// If notification type is email, convert to notification.\n\t\tif ( 'email' === $nf_notification['type'] ) {\n\n\t\t\t// Create a new notification.\n\t\t\t$notification = array(\n\t\t\t\t'id' => uniqid(),\n\t\t\t\t'isActive' => '1' === $nf_notification['active'] ? true : false,\n\t\t\t\t'name' => $nf_notification['name'],\n\t\t\t\t'message' => $this->convert_to_merge_tags( $form, $nf_notification['email_message'] ),\n\t\t\t\t'subject' => $this->convert_from_backticks( $form, $nf_notification['email_subject'], false ),\n\t\t\t\t'to' => $this->convert_from_backticks( $form, $nf_notification['to'] ),\n\t\t\t\t'toType' => 'email',\n\t\t\t\t'from' => $this->convert_from_backticks( $form, $nf_notification['from_address'] ),\n\t\t\t\t'fromName' => $this->convert_from_backticks( $form, $nf_notification['from_name'] ),\n\t\t\t\t'replyTo' => $this->convert_from_backticks( $form, $nf_notification['reply_to'] ),\n\t\t\t\t'bcc' => $this->convert_from_backticks( $form, $nf_notification['bcc'] ),\n\t\t\t);\n\n\t\t\t// Add notification to form.\n\t\t\t$form['notifications'][ $notification['id'] ] = $notification;\n\n\t\t}\n\n\t\treturn $form;\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Construct function param array $dbInfo //database config param string $dbKey//db key param return $fetchMode; | public function __construct($dbKey,$fetchMode=self::DB_FETCH_ASSOC){
$this->_dbKey=$GLOBALS['DB'][$dbKey];
$this->_fetchMode=$fetchMode;
} | [
"abstract public function &db();",
"function smf_db_initiate($db_server, $db_name, $db_user, $db_passwd, $db_prefix, $db_options = array())\n{\n\tglobal $smcFunc, $mysql_set_mode, $db_in_transact, $sqlite_error;\n\n\t// Map some database specific functions, only do this once.\n\tif (!isset($smcFunc['db_fetch_assoc']) || $smcFunc['db_fetch_assoc'] != 'sqlite_fetch_array')\n\t\t$smcFunc += array(\n\t\t\t'db_query' => 'smf_db_query',\n\t\t\t'db_quote' => 'smf_db_quote',\n\t\t\t'db_fetch_assoc' => 'sqlite_fetch_array',\n\t\t\t'db_fetch_row' => 'smf_db_fetch_row',\n\t\t\t'db_free_result' => 'smf_db_free_result',\n\t\t\t'db_insert' => 'smf_db_insert',\n\t\t\t'db_insert_id' => 'smf_db_insert_id',\n\t\t\t'db_num_rows' => 'sqlite_num_rows',\n\t\t\t'db_data_seek' => 'sqlite_seek',\n\t\t\t'db_num_fields' => 'sqlite_num_fields',\n\t\t\t'db_escape_string' => 'sqlite_escape_string',\n\t\t\t'db_unescape_string' => 'smf_db_unescape_string',\n\t\t\t'db_server_info' => 'smf_db_libversion',\n\t\t\t'db_affected_rows' => 'smf_db_affected_rows',\n\t\t\t'db_transaction' => 'smf_db_transaction',\n\t\t\t'db_error' => 'smf_db_last_error',\n\t\t\t'db_select_db' => '',\n\t\t\t'db_title' => 'SQLite',\n\t\t\t'db_sybase' => true,\n\t\t\t'db_case_sensitive' => true,\n\t\t\t'db_escape_wildcard_string' => 'smf_db_escape_wildcard_string',\n\t\t);\n\n\tif (substr($db_name, -3) != '.db')\n\t\t$db_name .= '.db';\n\n\tif (!empty($db_options['persist']))\n\t\t$connection = @sqlite_popen($db_name, 0666, $sqlite_error);\n\telse\n\t\t$connection = @sqlite_open($db_name, 0666, $sqlite_error);\n\n\t// Something's wrong, show an error if its fatal (which we assume it is)\n\tif (!$connection)\n\t{\n\t\tif (!empty($db_options['non_fatal']))\n\t\t\treturn null;\n\t\telse\n\t\t\tdb_fatal_error();\n\t}\n\t$db_in_transact = false;\n\n\t// This is frankly stupid - stop SQLite returning alias names!\n\t@sqlite_query('PRAGMA short_column_names = 1', $connection);\n\n\t// Make some user defined functions!\n\tsqlite_create_function($connection, 'unix_timestamp', 'smf_udf_unix_timestamp', 0);\n\tsqlite_create_function($connection, 'inet_aton', 'smf_udf_inet_aton', 1);\n\tsqlite_create_function($connection, 'inet_ntoa', 'smf_udf_inet_ntoa', 1);\n\tsqlite_create_function($connection, 'find_in_set', 'smf_udf_find_in_set', 2);\n\tsqlite_create_function($connection, 'year', 'smf_udf_year', 1);\n\tsqlite_create_function($connection, 'month', 'smf_udf_month', 1);\n\tsqlite_create_function($connection, 'dayofmonth', 'smf_udf_dayofmonth', 1);\n\tsqlite_create_function($connection, 'concat', 'smf_udf_concat');\n\tsqlite_create_function($connection, 'locate', 'smf_udf_locate', 2);\n\tsqlite_create_function($connection, 'regexp', 'smf_udf_regexp', 2);\n\n\treturn $connection;\n}",
"function getDBbyPkey() {\n global $dbconn;\n //check parameter\n if (func_num_args() == 0) {\n \t return;\n }\n $i = 0;\n foreach (func_get_args() as $ourvar) {\n \t// Prepare var\n if (!get_magic_quotes_runtime()) {\n $ourvar = addslashes($ourvar);\n }\n \tif ($where == \"\") {\n \t $where = \" WHERE \".$this->pkeys[$i].\"='\".$ourvar.\"' \";\n \t}else {\n \t \t$where .= \" AND \". $this->pkeys[$i].\"='\".$ourvar.\"' \";\n \t}\n \t$i++;\n }\n $query = \"SELECT \";\n foreach($this->tblfields as $id) {\n $query .= $id.\",\";\n }\n $query = substr($query,0,strlen($query)-1);\n $query .= \" FROM $this->tablename \" .$where;\n \n //echo $query;\n $result=$dbconn->Execute($query);\n if(!$result->EOF) {\n $i = 0;\n foreach($this->tblfields as $id){\n //$fname = \"this->$id\";\n $value = trim($result->fields[$i++]);\n\t\t\t$value = stripslashes($value);\n $this->$id=$value;\n }\n return true;\n }else {\n \t//not found\n \treturn false;\n }\n }",
"public function getDbInfo();",
"public function fetch($functionName, $databaseName);",
"private static function GetFetchMode()\n {\n return EasyPDO::$FetchModes[EasyPDO::$FetchMode];\n }",
"function IcfDatabase()\r\n\t{\r\n\t\t// Get config parameters\r\n\t\t$icfConfig = new IcfConfig();\r\n\t\t\r\n\t\t$this->cfg_db_debug = $icfConfig->cfg_db_debug;\r\n\t\t$this->cfg_db_connectionString = $icfConfig->cfg_db_connectionString;\r\n\t\t$this->cfg_db_tableprefix = $icfConfig->cfg_db_tableprefix;\r\n\t}",
"private function BuildDB() {\n \n }",
"public function getFetchmode();",
"function CDataStore($dbinfo, $opt_dbname = '', $opt_table = '', $opt_encoding = '')\n\t{\n\t\t// set db name\n\t\tif ($opt_dbname != '')\n\t\t\t$this->db_name = $opt_dbname;\n\t\telseif (is_array($dbinfo) && ($dbinfo['DbName']))\n\t\t\t$this->db_name = $dbinfo['DbName'];\n\n\t\t// set connection encoding\n\t\tif ($opt_encoding != '')\n\t\t\t$this->connection_encoding = $opt_encoding;\n\t\telseif (is_array($dbinfo) && ($dbinfo['DbEncoding']))\n\t\t\t$this->connection_encoding = $dbinfo['DbEncoding'];\n\n\t\t// looking for connection or resource\n\t\tif (is_array($dbinfo))\n\t\t{\n\t\t\t$this->db_user = $dbinfo['DbUser'];\n\t\t\t$this->db_password = $dbinfo['DbPassword'];\n\t\t\t$this->db_host = $dbinfo['DbHost'];\n\n\t\t\t// Connecting, selecting database\n\t\t}\n\t\telseif (is_resource($dbinfo))\n\t\t\t$this->db_link =& $dbinfo;\n\n\t\t// set table name\n\t\tif ($opt_table != '')\n\t\t\t$this->db_table = $opt_table;\n\t\telseif ($dbinfo['DbTable'])\n\t\t\t$this->db_table = $dbinfo['DbTable'];\n\n\t\t// get list of fieldname\n\t}",
"public function db_select($database){}",
"public function getDatabaseInfo();",
"function get_dbinfo () {\n global $arrHttp, $xWxis, $db_path;\n if ( !isset($arrHttp[\"base\"]) or $arrHttp[\"base\"]==\"undefined\" or $arrHttp[\"base\"]==\"\"){\n ?>\n <H3><font color=red>This script: <br><?php echo __FILE__;?><br>\n included by <b><?php echo pathinfo(debug_backtrace()[0]['file'])['basename'];?></b><br>\n requires the name of the database via $arrHttp[\"base\"]<br>\n This is a coding error</font></H3>\n <?php\n die;\n }\n $IsisScript=$xWxis.\"administrar.xis\";\n $fullciparpath=$db_path.\"par/\".$arrHttp[\"base\"].\".par\";\n if (!file_exists($fullciparpath)){\n echo \"<h3><font color=red>\".$fullciparpath.\": Does not exist</font></h3>\";\n }\n $query = \"&base=\".$arrHttp[\"base\"] . \"&cipar=\".$fullciparpath. \"&Opcion=status\";\n include(\"../common/wxis_llamar.php\");\n if ( $err_wxis!=\"\" ) die;\n\n $dbinfo_ix=-1;\n if (isset($contenido )) {\n foreach($contenido as $dbinfo_linea) {\n $dbinfo_ix=$dbinfo_ix+1;\n if ($dbinfo_ix>0) {\n if (trim($dbinfo_linea)!=\"\"){\n $dbinfo_a=explode(\":\",$dbinfo_linea);\n if (isset($dbinfo_a[1])) $arrHttp[$dbinfo_a[0]]=$dbinfo_a[1];\n }\n }\n }\n }\n // Return at least one value\n if (!isset($arrHttp[\"MAXMFN\"])) $arrHttp[\"MAXMFN\"]=0;\nreturn;\n}",
"abstract public function makeOpsDatabase ($database = NULL);",
"abstract protected function prepareDatabase();",
"private function initDatabase() {\n\t\tif ($this->db) return;\n\t\t// @todo cache for structure\n//\t\tif (file_exists(__DIR__ . '/' . $this->cache)) {\n//\t\t\t$cache = file_get_contents(__DIR__ . '/' . $this->cache);\n//\t\t\t$this->db = unserialize($cache);\n//\t\t\treturn;\n//\t\t}\n\t\t$query = \"\n\t\t\tSELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE\n\t\t\tFROM information_schema.COLUMNS\n\t\t\tWHERE TABLE_SCHEMA = DATABASE()\n\t\t\";\n\t\t$database = $this->connection->query($query)->fetchAll(PDO::FETCH_GROUP + PDO::FETCH_NUM);\n\t\tforeach ($database as $table => $fields) {\n\t\t\tforeach ($fields as $value) {\n\t\t\t\t$this->db[$table][$value[0]] = $value[1];\n\t\t\t}\n\t\t}\n//\t\tif (file_exists($this->cache)) {\n//\t\t\t\\Nette\\Diagnostics\\Debugger::barDump('exists', __METHOD__ . ':' . __LINE__);\n//\t\t}\n//\t\tfile_put_contents(__DIR__ . '/' . $this->cache, serialize($this->db));\n\t}",
"public function setFetchMode($mode){}",
"function fetchOne( $nomitem, $where_clause, $select_type )\r\n{\r\nreturn MAIN_CLASS::fetchOne (\"BASEGEN\", $nomitem, $where_clause, $select_type );\r\n}",
"function dbWrapper($callback){\n\t\t$newdb = $this->CI->load->database('', true);\n\t\tif(is_callable(array($newdb, 'set_dbprefix'))){\n\t\t\t$newdb->set_dbprefix($this->prefix);\n\t\t}\n\n\t\t$cidb = $this->CI->db;\n\t\t$this->CI->db = $newdb;\n\n\t\t$params = func_get_args();\n\t\tarray_shift($params);\n\t\t$ret = call_user_func_array($callback, $params);\n\n\t\t$this->CI->db = $cidb;\n\t\treturn $ret;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes project from database based on project_id provided. | function removeProject($project_id) {
global $dbh;
$sql = "DELETE FROM projects WHERE project_id = :project_id;
DELETE FROM links WHERE project_id = :project_id;
DELETE FROM notes WHERE project_id = :project_id;";
//2. Prepare the statement
$statement = $dbh->prepare($sql);
//3. Bind parameters
$statement->bindParam(':project_id', $project_id, PDO::PARAM_INT);
//4. Execute the query
$statement->execute();
} | [
"public function deleteProject($project_id){\n $project_id = intval(trim($project_id));\n\n $sql = \"DELETE FROM projects \n WHERE id = ?\";\n $query = $this->db->prepare($sql);\n $query->bindParam(1, $project_id);\n $query->execute();\n }",
"public function deleteProjectFromUserProject($project_id){\n $project_id = intval(trim($project_id));\n\n $sql = \"DELETE FROM user_projects \n WHERE project_id = ?\";\n $query = $this->db->prepare($sql);\n $query->bindParam(1, $project_id);\n $query->execute();\n }",
"public function remove() {\n\t\tProjectModelMongoMapper::instance()->drop($this->databaseName());\n\t\tProjectModelMongoMapper::instance()->remove($this->id->asString());\n\t}",
"public function deleteProject(Project $project);",
"public function deleteProjectByProjectID($projectID) {\n try {\n if(is_numeric($projectID)) {\n $projectIDToDelete = $projectID;\n $stmt = \"DELETE FROM projects WHERE ProjectID = ?\";\n $result = $this->pdo->prepare($stmt);\n $result->execute([$projectID]);\n echo 'Deleted Project Record';\n }\n }\n catch (PDOException $ex) {\n echo \"<p>Sorry, a database error occurred. Please try again.</p>\";\n echo $ex->getMessage();\n }\n }",
"public function deletePproject() {\n\t\t$sql = \"DELETE FROM projects WHERE id = \".$_POST['id'];\n\t\tif(!$result = $this->mysqli->query($sql))\n\t\t die('There was an error running the query [' . $this->mysqli->error . ']');\n\t\tif($result)\n\t\t\techo(true);\n\t\telse \n\t\t\techo (false);\n\t}",
"public function delete($project)\n {\n Project::where('id', $project)->delete(['id' => request('id')]);\n }",
"public function removeProject(Project $project)\n {\n return $project->delete();\n }",
"public function removeProject(\\MFUG\\Showroom\\Domain\\Model\\Project $project) {\n\t\t$this->projects->remove($project);\n\t}",
"public function removeProject(ProjectInterface $project);",
"public function delete($project);",
"public function deleteProject($projectID){\r\n\t\t$project = $this->db->get_where('projects', array('id' => $projectID));\r\n\t\t\r\n\t\tif($project->num_rows() > 0) {\r\n\t\t\t$project = $project->row();\r\n\t\t\t$user_id = $project->user_id;\r\n\t\t\t$video_id = $project->video_id;\r\n\r\n\t\t\t$this->db->delete('descriptions', array('user_id' => $user_id, 'video_id' => $video_id));\r\n\t\t\t$this->db->delete('projects', array('id' => $projectID));\r\n\t\t}\r\n\t}",
"public function deleteProject() \n {\n $this->associate('Project', 'projects');\n $this->delete();\n redirect('/');\n \n }",
"function projectDelete($project_id){\r\n\t\t$method='project.delete';\r\n\t\t$tags=array(\r\n\t\t\t'project_id'=>$project_id\r\n\t\t);\r\n\t\t$response=$this->prepare_xml($method,$tags);\r\n\t\t$obj=$this->xml_obj($response);\r\n\t\treturn $obj;\r\n\t}",
"public function fn_remove() {\r\n\t\tif( !empty( $this->project_id ) ) {\r\n\t\t\tif( count( $this->images ) > 0 )\r\n\t\t\t\tforeach( $this->images as $image )\r\n\t\t\t\t\t$image->fn_remove();\r\n\t\t\t$sql = \"DELETE from project WHERE project_id = {$this->project_id}\";\r\n\t\t\t$statement = db::getInstance()->prepare( $sql );\r\n\t\t\tif( $statement->execute() && strncmp( $statement->errorCode(), '00', 2 ) == 0 )\r\n\t\t\t\treturn;\r\n\t\t\tthrow new Exception( __METHOD__ . ': ' . sprintf( ERR::ERR_PROJECT_NOT_REMOVED_DESC, $this->project_id ) );\r\n\t\t}\r\n\t\tthrow new Exception( __METHOD__ . ': ' . ERR::ERR_PROJECT_NOT_INITIALIZED_DESC );\r\n\t}",
"function delete_project($project_id) {\r\n include 'connection.php';\r\n\r\n $sql = 'DELETE FROM projects WHERE project_id = ?'\r\n . ' AND project_id NOT IN (SELECT project_id FROM tasks)';\r\n\r\n try {\r\n $results = db->prepare($sql);\r\n $results->bindValue(1, $task_id, PDO::PARAM_INT);\r\n $results->execute();\r\n } catch (Exception $e) {\r\n echo \"Error deleting project!: \" . $e->getMessage() . \"<br>\\n\";\r\n return false;\r\n }\r\n\r\n if ($results->rowCount() > 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}",
"public function destroy($id)\n {\n $project = Projects::find($id);\n $file_path = public_path() . '/' . $project->image;\n if (file_exists($file_path)) {\n unlink($file_path);\n }\n\n\n $project->Projects()->detach();\n\n $project->delete();\n return redirect('/project');\n\n\n }",
"public function remove($id){\n\t\t//\t\t$project = Project::find($id);\n\t\t//\t\t$project->members()->detach(Input::get('member_id'));\n\t\t//\n\t\t//\t\treturn Redirect::back();\n\t}",
"function project_del($origin = NULL, $project = NULL, $erase = TRUE, $purge = TRUE) {\n // The parameters should not be both NULL.\n if ($origin === NULL and $project === NULL) return;\n\n // Get an array of matching projects.\n $get_pguid = btr::db_select('btr_projects', 'p')->fields('p', array('pguid'));\n if ($origin != NULL) $get_pguid->condition('origin', $origin);\n if ($project != NULL) $get_pguid->condition('project', $project);\n $pguid_list = $get_pguid->execute()->fetchCol();\n if (empty($pguid_list)) return;\n\n // Get an array of templates related to the projects.\n $potid_list = btr::db_query(\n 'SELECT potid FROM {btr_templates} t\n LEFT JOIN {btr_projects} p ON (t.pguid = p.pguid)\n WHERE p.pguid IN (:pguid_list)',\n array(\n ':pguid_list' => $pguid_list,\n ))\n ->fetchCol();\n\n // Erase the data of each template.\n foreach ($potid_list as $potid) {\n _delete_template($potid);\n }\n\n // Delete the diffs and snapshots of each project.\n if ($erase) {\n foreach ($pguid_list as $pguid) {\n btr::db_delete('btr_diffs')->condition('pguid', $pguid)->execute();\n btr::db_delete('btr_snapshots')->condition('pguid', $pguid)->execute();\n }\n }\n\n if ($purge) {\n // Delete any dangling strings.\n btr::string_cleanup();\n\n // Unsubscribe any subscribed users.\n _unsubscribe_users($pguid_list);\n }\n\n // Delete user roles for these projects.\n btr::db_delete('btr_user_project_roles')\n ->condition('pguid', $pguid_list, 'IN')\n ->execute();\n\n // Delete the projects themselves.\n btr::db_delete('btr_projects')\n ->condition('pguid', $pguid_list, 'IN')\n ->execute();\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
search for similar topics | public function SimilarTopics() {
//LOAD LIBRARIES
$this->load->model(array('Boardaccessmodel'));
$this->load->helper(array('user', 'posting'));
$q = $this->input->post('topic', TRUE);
//flood check.
if ($this->groupAccess == 3 && flood_check("search", $this->Usermodel->getLastSearch())) {
exit($this->lang->line('flood'));
} else {
if ($q == "") {
exit($this->lang->line('nokeyword'));
} else {
#update search flood info.
$data = array(
"last_search" => time()
);
$this->db->where('Username', $this->logged_user);
$this->db->update('ebb_users', $data);
//search for similar topics.
$this->db->select('bid, tid, author, Topic');
$this->db->from('ebb_topics');
$this->db->like('Topic', $q, 'after');
$this->db->or_like('Body', $q, 'after');
$query = $this->db->get();
//see if we have any records to show.
if($query->num_rows() > 0) {
echo '<strong>'.$this->lang->line('relatedtopics').'</strong><hr />';
//loop through results.
foreach ($query->result() as $row) {
//get rules for board.
$this->Boardaccessmodel->GetBoardAccess($row->bid);
//see if the user can access this spot.
if ($this->Groupmodel->validateAccess(0, $this->Boardaccessmodel->getBRead())){
echo '<em>'.anchor('/viewtopic/'.$row->tid, $row->Topic).'</em> - '.$row->author.'<br />';
}
}
} else {
echo $this->lang->line('nosimilar');
} //END results.
} //END query keyword check.
} //END flood check.
} | [
"function new_topic_search()\n\t{\n\t\treturn $this->do_search('', TRUE);\n\t}",
"public function new_topic_search()\n\t{\n\t\treturn $this->do_search('', TRUE);\n\t}",
"public function active_topic_search()\n\t{\n\t\treturn $this->do_search('', TRUE, FALSE, TRUE);\n\t}",
"abstract public function search($terms);",
"function getTopics ( $type, $matchAll = false ) {\n }",
"function sf_get_combined_full_topic_search($searchvalue, $currentsearchpage)\n{\n\tglobal $wpdb, $current_user;\n\n\t# how many topics per page?\n\t$tpaged=get_option('sfpagedtopics');\n\tif($tpaged < 1) $tpaged=12;\n\n\tif($currentsearchpage == 1)\n\t{\n\t\t$startlimit = 0;\n\t} else {\n\t\t$startlimit = ((($currentsearchpage-1) * $tpaged));\n\t}\n\n\t$LIMIT = ' LIMIT '.$startlimit.', '.$tpaged;\n\t$ORDER = ' ORDER BY topic_id DESC';\n\n\t# for admins search all forums, for users check permissions\n\tif ($current_user->forumadmin)\n\t{\n\t\t$where2 = '';\n\t} else {\n\t\t# limit to viewable forums based on permissions\n\t\t$forums = sf_get_viewable_forums($current_user->ID);\n\n\t\t# build a list of forum ids for the query\n\t\tif ($forums)\n\t\t{\n\t\t\t$forum_ids = '';\n\t\t\tforeach ($forums as $forum)\n\t\t\t{\n\t\t\t\t$forum_ids[] = $forum->forum_id;\n\t\t\t}\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\t# create where clause based on forums that current user can view\n\t\t$list = explode('@', $list);\n\t\t$where2 = \" AND \".SFTOPICS.\".forum_id IN (\" . implode(\",\", $forum_ids) . \") \";\n\t}\n\n\t$searchvalue=urldecode($searchvalue);\n\tif(substr($searchvalue, 0, 12) == \"sf%members%1\")\n\t{\n\t\t$items=explode('%', $searchvalue);\n\t\t$userid = substr($items[3], 4, 25);\n\n\t\t$records = $wpdb->get_results(\n\t\t\t\t\"SELECT SQL_CALC_FOUND_ROWS DISTINCT\n\t\t\t\t \".SFTOPICS.\".topic_id, topic_name, topic_slug, \".SFTOPICS.\".forum_id, \".sf_zone_datetime('topic_date').\", topic_status, topic_status_flag, \".SFTOPICS.\".post_id, post_count,\n\t\t\t\t forum_name, forum_slug\n\t\t\t\t FROM \".SFTOPICS.\"\n\t\t\t\t JOIN \".SFFORUMS.\" ON \".SFTOPICS.\".forum_id = \".SFFORUMS.\".forum_id\n\t\t\t\t JOIN \".SFPOSTS.\" ON \".SFTOPICS.\".topic_id = \".SFPOSTS.\".topic_id\n\t\t\t\t WHERE \".SFPOSTS.\".user_id = \".$userid.$where2.$ORDER.$LIMIT.\";\", ARRAY_A);\n\t} else if(substr($searchvalue, 0, 12) == \"sf%members%2\")\n\t{\n\t\t$items=explode('%', $searchvalue);\n\t\t$userid = substr($items[3], 4, 25);\n\n\t\t$records = $wpdb->get_results(\n\t\t\t\t\"SELECT SQL_CALC_FOUND_ROWS DISTINCT\n\t\t\t\t \".SFTOPICS.\".topic_id, topic_name, topic_slug, \".SFTOPICS.\".forum_id, \".sf_zone_datetime('topic_date').\", topic_status, topic_status_flag, \".SFTOPICS.\".post_id, post_count,\n\t\t\t\t forum_name, forum_slug\n\t\t\t\t FROM \".SFTOPICS.\"\n\t\t\t\t JOIN \".SFFORUMS.\" ON \".SFTOPICS.\".forum_id = \".SFFORUMS.\".forum_id\n\t\t\t\t WHERE \".SFTOPICS.\".user_id = \".$userid.$where2.$ORDER.$LIMIT.\";\", ARRAY_A);\n\n\t} else {\n\t\t$searchterm = sf_construct_search_term($searchvalue);\n\n\t\t$records = $wpdb->get_results(\n\t\t\t\t\"SELECT SQL_CALC_FOUND_ROWS DISTINCT\n\t\t\t\t \".SFTOPICS.\".topic_id, topic_name, topic_slug, \".SFTOPICS.\".forum_id, \".sf_zone_datetime('topic_date').\", topic_status, topic_status_flag, \".SFTOPICS.\".post_id, post_count,\n\t\t\t\t forum_name, forum_slug\n\t\t\t\t FROM \".SFTOPICS.\"\n\t\t\t\t JOIN \".SFFORUMS.\" ON \".SFTOPICS.\".forum_id = \".SFFORUMS.\".forum_id\n\t\t\t\t JOIN \".SFPOSTS.\" ON \".SFTOPICS.\".topic_id = \".SFPOSTS.\".topic_id\n\t\t\t\t WHERE MATCH(\".SFPOSTS.\".post_content) AGAINST ('\".$searchterm.\"' IN BOOLEAN MODE)\n\t\t\t\t \".$where2.$ORDER.$LIMIT.\";\", ARRAY_A);\n\t}\n\n\t$totalrows = $wpdb->get_var(\"SELECT FOUND_ROWS()\");\n\tadd_sfsetting($searchvalue, $totalrows);\n\n\treturn $records;\n}",
"function simpleSearch($query, $searchtypes = null, $topicCondition = \"\") {\r\n $result = array();\r\n \r\n if ($searchtypes == null) {\r\n $searchtypes = array('authors',\r\n 'topics',\r\n 'keywords',\r\n 'publications_titles',\r\n 'publications_notes',\r\n 'publications_bibtex_id',\r\n 'publications_abstracts'); //default searches fot simplesearch\r\n }\r\n \r\n $keywordArray = $this->queryToKeywords($query);\r\n if (count($keywordArray)==0) {\r\n return $result;\r\n }\r\n\r\n if (in_array('authors',$searchtypes)) {\r\n $authorResult = $this->findAuthorsLike($keywordArray);\r\n if ($authorResult != null)\r\n $result['authors'] = $authorResult;\r\n unset($authorResult);\r\n }\r\n \r\n if (in_array('topics',$searchtypes)) {\r\n $topicResult = $this->findTopicsLike($keywordArray);\r\n if ($topicResult != null)\r\n $result['topics'] = $topicResult;\r\n unset($topicResult);\r\n }\r\n \r\n \r\n if (in_array('keywords',$searchtypes)) {\r\n $keywordResult = $this->findKeywordsLike($keywordArray);\r\n if ($keywordResult != null)\r\n $result['keywords'] = $keywordResult;\r\n unset($keywordResult);\r\n }\r\n \r\n \r\n if (in_array('publications_titles',$searchtypes)) {\r\n $publicationResult = $this->findPublicationsLike($keywordArray, $topicCondition);\r\n if ($publicationResult != null)\r\n $result['publications_titles'] = $publicationResult;\r\n unset($publicationResult);\r\n }\r\n \r\n \r\n if (in_array('publications_bibtex_id',$searchtypes)) {\r\n $publicationResult = $this->findPublicationsCiteIDLike($keywordArray, $topicCondition);\r\n if ($publicationResult != null)\r\n $result['publications_bibtex_id'] = $publicationResult;\r\n unset($publicationResult);\r\n }\r\n \r\n \r\n if (in_array('publications_notes',$searchtypes)) {\r\n $publicationResult = $this->findPublicationsNotesLike($keywordArray, $topicCondition);\r\n if ($publicationResult != null)\r\n $result['publications_notes'] = $publicationResult;\r\n unset($publicationResult);\r\n }\r\n \r\n \r\n if (in_array('publications_abstracts',$searchtypes)) {\r\n $publicationResult = $this->findPublicationsAbstractsLike($keywordArray, $topicCondition);\r\n if ($publicationResult != null)\r\n $result['publications_abstracts'] = $publicationResult;\r\n unset($publicationResult);\r\n }\r\n \r\n //return result\r\n return $result;\r\n }",
"public function searchAction()\n {\n $searched = $_GET['search'];\n\n /* Getting number of all searched topics for pagination */\n $totalTopics = Topic::count([\n 'search' => $searched,\n ]);\n\n /* Getting current user's data */\n $user = Auth::getUser();\n\n /* Adding pagination (50 topics per page) */\n $paginator = new Paginator($_GET['page'] ?? 1, 50, $totalTopics, '/topics/search?search='.$searched.'&page=(:num)');\n\n /* Getting followed topic if user is signed in, null otherwise */\n $followed_topics = ($user) ? FollowedTopic::getAll($user->id) : null;\n\n /* Getting topics per current page ordered by followers DESC */\n $topics = Topic::get([\n 'offset' => $paginator->offset, \n 'limit' => $paginator->limit,\n 'order_by' => 'followers',\n 'order_type' => 'DESC',\n 'search' => $searched,\n ]);\n\n /* Displaying view template */\n View::renderTemplate('Topics/all.twig',[\n 'this_page' => [\n 'title' => 'Search in Topics',\n 'menu' => 'search_topics',\n 'url' => '',\n 'search_action' => 'topics/search?search='.$searched,\n 'search_type' => 'topics',\n 'searched' => $searched,\n ],\n 'topics_number' => $totalTopics,\n 'topics' => $topics,\n 'paginator' => $paginator,\n 'followed_topics' => $followed_topics,\n ]);\n }",
"protected function searchTopics(array $topics) {\n // Ignore TIDs we've already searched.\n $valid_tids = array_diff($topics, $this->searchedTopics);\n if (empty($valid_tids)) {\n return [];\n }\n $num_needed = $this->maxRelated - count($this->relatedArticles);\n $config = $this->getConfiguration();\n\n // Don't let the current story appear as related to itself.\n $exclude_nids[] = $this->story->id();\n // Prevent duplicates (e.g. from main vs. secondary topics pointing to the\n // same stories in different phases).\n if (!empty($this->relatedArticles)) {\n $exclude_nids = array_merge($exclude_nids, $this->relatedArticles);\n }\n\n $query = sw_story_taxonomy_query($valid_tids, $exclude_nids, $num_needed, $config['story_query_weight_limit']);\n\n // Enforce the date limit (if any).\n if (!empty($config['story_query_date_limit'])) {\n $request_time = \\Drupal::requestStack()->getCurrentRequest()->server->get('REQUEST_TIME');\n $time_limit = $this->requestTime - ($config['story_query_date_limit'] * 86400); // (60 * 60 * 24 = seconds/day)\n $query->condition('nfd.created', $time_limit, '>=');\n }\n\n $nids = $query->execute()->fetchCol();\n if (!empty($nids)) {\n $this->relatedArticles = array_merge($this->relatedArticles, $nids);\n }\n $this->searchedTopics = array_merge($this->searchedTopics, $valid_tids);\n return $nids;\n }",
"function look_for_posts()\n\t{\n\t\tglobal $db, $forum_id, $post_info, $HTTP_POST_VARS, $userdata;\n\t\tglobal $phpbb_root_path, $phpEx, $lang, $error_msg, $mode, $subject;\n\n\t\t$bypass = ( isset($HTTP_POST_VARS['bypass']) ) ? htmlspecialchars(stripslashes(trim($HTTP_POST_VARS['bypass']))) : FALSE;\n\n\t\t// Check all the different things that could mean a check for\n\t\t// existing threads isn't necessary.\n\t\tif( !$this->cfg['enable'] ||\n\t\t\t!$post_info['forum_subject_check'] ||\n\t\t\t$mode != 'newtopic' ||\n\t\t\tempty($subject) ||\n\t\t\t($this->cfg['admin'] && $userdata['user_level'] == ADMIN) ||\n\t\t\t($this->cfg['mod'] && $userdata['user_level'] == MOD) ||\n\t\t\t(!empty($this->cfg['postcount']) && $userdata['user_posts'] > $this->cfg['postcount']) ||\n\t\t\t($bypass == stripslashes($subject) && $this->cfg['enable_bypass'])\n\t\t)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tinclude_once($phpbb_root_path . 'includes/functions_search.' . $phpEx);\n\t\t// Get searchable words from the post subject\n\t\t$stopword_array = @file($phpbb_root_path . 'language/lang_' . $this->cfg['lang'] . '/search_stopwords.txt'); \n\t\t$synonym_array = @file($phpbb_root_path . 'language/lang_' . $this->cfg['lang'] . '/search_synonyms.txt'); \n\t\t$stripped_keywords = stripslashes($subject);\n\t\t$split_search = split_words(clean_words('search', $stripped_keywords, $stopword_array, $synonym_array), 'search');\t\n\t\tunset($stripped_keywords, $stopword_array, $synonym_array);\n\n\t\t// Now search for existing topics with subjects containing those words\n\t\t$topics = $result_list = array();\n\t\t$split_count = count($split_search);\n\t\tfor($i = 0; $i < $split_count; $i++)\n\t\t{\n\t\t\t$split_search[$i] = trim($split_search[$i]);\n\t\t\tif ( strlen($split_search[$i]) < $this->cfg['min_chars'] )\n\t\t\t{\n\t\t\t\t$split_search[$i] = '';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$sql = \"SELECT DISTINCT(t.topic_id)\n\t\t\t\tFROM \" . SEARCH_WORD_TABLE . \" w, \" . SEARCH_MATCH_TABLE . \" m, \" . TOPICS_TABLE . \" t\n\t\t\t\tWHERE w.word_text = '\" . str_replace(\"'\", \"''\", $split_search[$i]) . \"'\n\t\t\t\t\tAND m.word_id = w.word_id\n\t\t\t\t\tAND w.word_common <> 1\n\t\t\t\t\tAND m.title_match = 1\n\t\t\t\t\tAND m.post_id = t.topic_first_post_id\n\t\t\t\t\tAND t.forum_id = $forum_id\";\n\t\t\tif( $this->cfg['check_locked'] )\n\t\t\t{\n\t\t\t\t$sql .= ' AND t.topic_status <> ' . TOPIC_LOCKED;\n\t\t\t}\n\n\t\t\tif( !$result = $db->sql_query($sql) )\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not retrieve word matches', '', __LINE__, __FILE__, $sql);\n\t\t\t}\n\t\t\twhile( $row = $db->sql_fetchrow($result) )\n\t\t\t{\n\t\t\t\t$result_list[] = intval($row['topic_id']);\n\t\t\t}\n\t\t\t$db->sql_freeresult();\n\t\t}\n\n\t\tif( !empty($result_list) )\n\t\t{\n\t\t\t// Found some matches, now display message\n\t\t\t$sql = 'SELECT topic_id, topic_title FROM ' . TOPICS_TABLE . ' WHERE topic_id IN (' . implode(', ', $result_list) . ')';\n\t\t\tif( $this->cfg['limit'] )\n\t\t\t{\n\t\t\t\t$sql .= ' LIMIT 0,' . $this->cfg['limit'];\n\t\t\t}\n\t\t\tif( !$result = $db->sql_query($sql) )\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not retrieve topic matches', '', __LINE__, __FILE__, $sql);\n\t\t\t}\n\t\t\twhile( $row = $db->sql_fetchrow($result) )\n\t\t\t{\n\t\t\t\t$topics[$row['topic_id']] = $row['topic_title'];\n\t\t\t}\n\t\t\t$db->sql_freeresult();\n\t\t\tif( !empty($topics) )\n\t\t\t{\n\t\t\t\t$this->allow_bypass = TRUE;\n\t\t\t\t$this->bypass_value = $subject;\n\t\t\t\t$this->error = $lang['SUBCHK_UNSTRICT'];\n\t\t\t\tforeach($topics as $k=>$v)\n\t\t\t\t{\n\t\t\t\t\t// If strict mode is on, don't allow the post to be made\n\t\t\t\t\tif( $v == $subject && $this->cfg['enable_strict'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->error = $lang['SUBCHK_STRICT'];\n\t\t\t\t\t\t$this->allow_bypass = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\t$this->error_list .= '<a href=\"' . append_sid('viewtopic.' . $phpEx . '?' . POST_TOPIC_URL . '=' . $k) . '\">' . $v . '</a><br />';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif( !empty($this->error) )\n\t\t{\n\t\t\t$error_msg .= ( !empty($error_msg) ) ? '<br /><br />' : '';\n\t\t\t$error_msg .= $this->error . '<br />' . $this->error_list;\n\t\t}\n\t}",
"function &getTopicsByKeyword($keyword) {\n\t\t$keyword = String::strtolower($keyword);\n\t\t$matchingTopics = array();\n\t\t$help =& PKPHelp::getHelp();\n\t\tforeach ($help->getSearchPaths() as $searchPath => $mappingFile) {\n\t\t\t$dir = opendir($searchPath);\n\t\t\twhile (($file = readdir($dir)) !== false) {\n\t\t\t\t$currFile = $searchPath . DIRECTORY_SEPARATOR . $file;\n\t\t\t\tif (is_dir($currFile) && $file != 'toc' && $file != '.' && $file != '..') {\n\t\t\t\t\tHelpTopicDAO::searchDirectory($mappingFile, $matchingTopics,$keyword,$currFile);\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($dir);\n\t\t}\n\n\t\tkrsort($matchingTopics);\n\t\t$topics = array_values($matchingTopics);\n\n\t\treturn $topics;\n\t}",
"function qruqsp_tutorials_tutorialSearch($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n 'start_needle'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Search String'),\n 'limit'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Limit'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner, or sys admin.\n //\n ciniki_core_loadMethod($ciniki, 'qruqsp', 'tutorials', 'private', 'checkAccess');\n $rc = qruqsp_tutorials_checkAccess($ciniki, $args['tnid'], 'qruqsp.tutorials.tutorialSearch');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Get the list of tutorials\n //\n $strsql = \"SELECT qruqsp_tutorials.id, \"\n . \"qruqsp_tutorials.title, \"\n . \"qruqsp_tutorials.permalink, \"\n . \"qruqsp_tutorials.synopsis, \"\n . \"qruqsp_tutorials.flags \"\n . \"FROM qruqsp_tutorials \"\n . \"WHERE qruqsp_tutorials.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND (\"\n . \"title LIKE '\" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR title LIKE '% \" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR synopsis LIKE '\" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"OR synopsis LIKE '% \" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \") \"\n . \"\";\n if( isset($args['limit']) && is_numeric($args['limit']) && $args['limit'] > 0 ) {\n $strsql .= \"LIMIT \" . ciniki_core_dbQuote($ciniki, $args['limit']) . \" \";\n } else {\n $strsql .= \"LIMIT 25 \";\n }\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'qruqsp.tutorials', array(\n array('container'=>'tutorials', 'fname'=>'id', \n 'fields'=>array('id', 'title', 'permalink', 'flags', 'synopsis')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['tutorials']) ) {\n $tutorials = $rc['tutorials'];\n $tutorial_ids = array();\n foreach($tutorials as $iid => $tutorial) {\n $tutorial_ids[] = $tutorial['id'];\n }\n } else {\n $tutorials = array();\n $tutorial_ids = array();\n }\n\n return array('stat'=>'ok', 'tutorials'=>$tutorials, 'nplist'=>$tutorial_ids);\n}",
"function _ef_search_get_topics($tid = 0) {\n\t$topics_added = _ef_search_get_searched_topics();\n\tif (!empty($topics_added)) {\n\t\tforeach ($topics_added as $key => $topic) {\n\t\t\t$tids[] = $topic['tid'];\n\t\t}\n\t}\n\n $select = db_select('taxonomy_term_data', 'ttd');\n $select->fields('ttd', array('tid', 'name'));\n $select->condition('ttd.vid', '21', '=');\n if (!empty($tids)) {\n \t$select->condition('ttd.tid', $tids, 'NOT IN');\n }\n\n if ($tid != 0) {\n \t$select->condition('ttd.tid', $tid, '=');\n }\n\n\t$result = $select->execute();\n\n\tforeach ($result as $key => $record) {\n\t\t$terms[$record->tid] = $record->name;\t\n\t}\n\n\treturn $terms;\n}",
"public function searchExact()\n {\n // search for words\n\n $this->exactResults = Word::where($this->fieldsToSearch, $this->word)\n ->orderBy('rank', 'desc')->get()->toArray();\n\n if(count($this->exactResults))\n {\n return;\n }\n\n $prefix = 'ال';\n // search without ال\n\n if (substr($this->word, 0, strlen($prefix)) == $prefix)\n {\n\n //filter input string\n $str = substr($this->word, strlen($prefix));\n\n $this->exactResults = Word::where($this->fieldsToSearch, $str)\n ->orderBy('rank', 'desc')->get()->toArray();\n }\n }",
"private function searchArticles($demand){\n\t\t$term = $demand->getSearchterm();\n\t\t\n\t\t// 1. exact match: redirect\n\t\tif (strlen($term) > 3) {\n\t\t\t$article = $this->articleRepository->findOneByTitle($term);\n\t\t\tif ($article){\n\t\t\t\t// redirect\n\t\t\t\t$this->redirect('show', 'article', NULL, array(article => $article->getUid()));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 2. no results: fuzzy search\n\t\t$articles = $this->articleRepository->search($demand);\n\t\t// bug in typo3 4.5.4 and 4.6.0: because of lazy loading, we need to fake access to the objects for correct count\n\t\tforeach($articles as $article){}\n\t\t\n\t\tif ($articles->count() < 5){\n\t\t\t// 3. no results: authors,schools and tags\n\t\t\t$authorArticles = $this->articleRepository->findByAuthorSearch($term,'','');\n\t\t\t$schools = $this->schoolRepository->search($term);\n\t\t\tif ($schools->count() > 0) {\n\t\t\t\t$schoolArticles = $this->articleRepository->findBySchools($schools);\n\t\t\t}\n\t\t\t\n\t\t\t// 4. if almost nothing is found until here search with like\n\t\t\t$schoolArticleEntries = (isset($schoolArticles)) ? $schoolArticles->count() : 0; // $schoolArticles is only set if schools found\n\t\t\tif ( $authorArticles->count() < 5 && $schoolArticleEntries == 0 && strlen($term) > 3 ){\n\t\t\t\t$articles2 = $this->articleRepository->searchLike($demand);\n\t\t\t\t$articles = array_unique(array_merge($articles->toArray(), $articles2->toArray()));\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn array($articles, $authorArticles, $schoolArticles);\n\t}",
"public function search($keywords);",
"public function getMatchingTerms();",
"public function findMatches();",
"public function doSearch();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves Leave credits for vacation and sick leaves. The two child select statements select all approved leaves of the employee for the current year. The sums of each leave are computed and subtracted from the annual leave credits for vacation and sick leaves, which is 15 days each. | public function getLeaveCredits()
{
$sql = "
SELECT
vacation,
sick
FROM (
SELECT 15 - coalesce(sum(days), 0) AS vacation FROM leave
WHERE
leave_type = 1 AND
head_status = 'APPROVED' AND
employee_id = $this->employee_id AND
extract(year FROM request_date) = " . date('Y', strtotime($this->request_date)) . "
) AS v, (
SELECT 15 - coalesce(sum(days), 0) AS sick FROM leave
WHERE
leave_type = 2 AND
head_status = 'APPROVED' AND
employee_id = $this->employee_id AND
extract(year FROM request_date) = " . date('Y', strtotime($this->request_date)) . "
) AS s";
$credits = Yii::app()->db->createCommand($sql)->queryRow();
return $credits;
} | [
"public function getTotalLeavesForYear($year){\n $januaryOne = new DateTime(date(\"Y-m-d\", mktime(0,0,0,1,1,$year)));\n $paidLeaves = Leaveconfig::getConfig(\"paid_leaves\", $year)->leave_days;\n $allLeaves = $paidLeaves;\n if(Config::get(\"database.default\") == \"mysql\"){\n $optionalHolidays = Holiday::where(\"holidayType\", \"=\", \"OPTIONAL\")->where(DB::raw('YEAR(holidayDate)'), \"=\", $year)->orderBy(\"holidayDate\", \"asc\")->get();\n }\n else{\n $optionalHolidays = Holiday::where(\"holidayType\", \"=\", \"OPTIONAL\")->where(DB::raw('EXTRACT( YEAR from \"holidayDate\"::date)'), \"=\", $year)->orderBy(\"holidayDate\", \"asc\")->get();\n }\n $optionalHolidaysCount = count(array_keys($optionalHolidays->toArray()));\n\n $dateOfJoining = new DateTime($this->doj);\n $joiningYear = (int)$dateOfJoining->format(\"Y\");\n $joiningYearStart = YearStart::where(\"year\", $joiningYear)->first();\n\n if($joiningYearStart){\n $joiningYearStartDay = $joiningYearStart->startDay;\n $joiningYearStartMonth = $joiningYearStart->startMonth;\n }\n else{\n $joiningYearStartDay = 15;\n $joiningYearStartMonth = 1;\n }\n\n $lastLeaveDateInYearOfJoining = new DateTime(date(\"Y-m-d\", mktime(0,0,0,$joiningYearStartMonth,$joiningYearStartDay,$joiningYear)));\n\n $yearsInCompany = (int)$januaryOne->format(\"Y\") - (int)$dateOfJoining->format(\"Y\");\n\n $isJoinedInCurrentYear = $yearsInCompany == 0 ? true : false;\n\n $isJoinedBeforeLastLeaveDateOfJoiningYear = (((int)$dateOfJoining->format(\"m\") == 1) && ((int)$dateOfJoining->format(\"d\") <= 15)) ? true : false;\n\n if(!$isJoinedBeforeLastLeaveDateOfJoiningYear && !$isJoinedInCurrentYear){\n $yearsInCompany -= 1;\n }\n\n $allLeaves += $optionalHolidaysCount;\n\n\n $leavesPerMonth = $allLeaves / 12;\n\n if($isJoinedInCurrentYear){\n $lastYearDateTS = mktime(0,0,0,12,31,$year);\n $joiningDateTS = mktime(0,0,0,$dateOfJoining->format(\"m\"), $dateOfJoining->format(\"d\"), $dateOfJoining->format(\"Y\"));\n $diff = $lastYearDateTS - $joiningDateTS;\n $diffMonths = $diff / (24 * 60 * 60 * 30);\n $allLeaves = round($diffMonths * $leavesPerMonth);\n }\n else{\n $allLeaves += $yearsInCompany;\n }\n\n $extraLeaves = Extraleave::where(\"user_id\", $this->id)->where(\"for_year\", $year)->get();\n\n foreach($extraLeaves as $extraL){\n $allLeaves += $extraL->leaves_count;\n }\n\n $currentDate = new DateTime();\n\n\n $currentYearStart = YearStart::where(\"year\", date(\"Y\"))->first();\n $currentYearJan = new DateTime(date(\"Y-m-d\",mktime(0,0,0,1,1,date(\"Y\"))));\n\n if($currentYearStart){\n $currentYearStartDay = $currentYearStart->startDay;\n $currentYearStartMonth = $currentYearStart->startMonth;\n }\n else{\n $currentYearStartDay = 15;\n $currentYearStartMonth = 1;\n }\n\n $lastLeaveDateInCurrentYear = new DateTime(date(\"Y-m-d\",mktime(0,0,0,$currentYearStartMonth,$currentYearStartDay, date(\"Y\"))));\n\n if((int)$year == (int)date(\"Y\")){\n if($currentDate >= $currentYearJan && $currentDate <= $lastLeaveDateInCurrentYear){\n $allLeaves += $this->getTotalLeavesForYear(((int)$year-1));\n }\n else{\n $allLeaves += $this->carry_forward_leaves;\n }\n }\n return $allLeaves;\n }",
"public function leaveSum()\n {\n return DB::table('leaves')->select('user_id', 'year', DB::raw('sum(days) as days'), DB::raw('min(outsdays) as outsdays'))->groupBy('user_id','year')->paginate(20);\n\n }",
"public function getNormalLeavesForYear($year){\n $januaryOne = new DateTime(date(\"Y-m-d\", mktime(0,0,0,1,1,$year)));\n $paidLeaves = Leaveconfig::getConfig(\"paid_leaves\", $year)->leave_days;\n $allLeaves = $paidLeaves;\n if(Config::get(\"database.default\") == \"mysql\"){\n $optionalHolidays = Holiday::where(\"holidayType\", \"=\", \"OPTIONAL\")->where(DB::raw('YEAR(holidayDate)'), \"=\", $year)->orderBy(\"holidayDate\", \"asc\")->get();\n }\n else{\n $optionalHolidays = Holiday::where(\"holidayType\", \"=\", \"OPTIONAL\")->where(DB::raw('EXTRACT( YEAR from \"holidayDate\"::date)'), \"=\", $year)->orderBy(\"holidayDate\", \"asc\")->get();\n }\n $optionalHolidaysCount = count(array_keys($optionalHolidays->toArray()));\n\n $dateOfJoining = new DateTime($this->doj);\n $joiningYear = (int)$dateOfJoining->format(\"Y\");\n $joiningYearStart = YearStart::where(\"year\", $joiningYear)->first();\n\n if($joiningYearStart){\n $joiningYearStartDay = $joiningYearStart->startDay;\n $joiningYearStartMonth = $joiningYearStart->startMonth;\n }\n else{\n $joiningYearStartDay = 15;\n $joiningYearStartMonth = 1;\n }\n\n $lastLeaveDateInYearOfJoining = new DateTime(date(\"Y-m-d\", mktime(0,0,0,$joiningYearStartMonth,$joiningYearStartDay,$joiningYear)));\n\n $yearsInCompany = (int)$januaryOne->format(\"Y\") - (int)$dateOfJoining->format(\"Y\");\n\n $isJoinedInCurrentYear = $yearsInCompany == 0 ? true : false;\n\n $isJoinedBeforeLastLeaveDateOfJoiningYear = (((int)$dateOfJoining->format(\"m\") == 1) && ((int)$dateOfJoining->format(\"d\") <= 15)) ? true : false;\n\n if(!$isJoinedBeforeLastLeaveDateOfJoiningYear && !$isJoinedInCurrentYear){\n $yearsInCompany -= 1;\n }\n\n $allLeaves += $optionalHolidaysCount;\n\n\n $leavesPerMonth = $allLeaves / 12;\n\n if($isJoinedInCurrentYear){\n $lastYearDateTS = mktime(0,0,0,12,31,$year);\n $joiningDateTS = mktime(0,0,0,$dateOfJoining->format(\"m\"), $dateOfJoining->format(\"d\"), $dateOfJoining->format(\"Y\"));\n $diff = $lastYearDateTS - $joiningDateTS;\n $diffMonths = $diff / (24 * 60 * 60 * 30);\n $allLeaves = round($diffMonths * $leavesPerMonth);\n }\n else{\n $allLeaves += $yearsInCompany;\n }\n\n // $extraLeaves = Extraleave::where(\"user_id\", $this->id)->where(\"for_year\", $year)->get();\n\n // foreach($extraLeaves as $extraL){\n // $allLeaves += $extraL->leaves_count;\n // }\n\n $currentDate = new DateTime();\n\n\n $currentYearStart = YearStart::where(\"year\", date(\"Y\"))->first();\n $currentYearJan = new DateTime(date(\"Y-m-d\",mktime(0,0,0,1,1,date(\"Y\"))));\n\n if($currentYearStart){\n $currentYearStartDay = $currentYearStart->startDay;\n $currentYearStartMonth = $currentYearStart->startMonth;\n }\n else{\n $currentYearStartDay = 15;\n $currentYearStartMonth = 1;\n }\n\n $lastLeaveDateInCurrentYear = new DateTime(date(\"Y-m-d\",mktime(0,0,0,$currentYearStartMonth,$currentYearStartDay, date(\"Y\"))));\n\n if((int)$year == (int)date(\"Y\")){\n if($currentDate >= $currentYearJan && $currentDate <= $lastLeaveDateInCurrentYear){\n $allLeaves += $this->getTotalLeavesForYear(((int)$year-1));\n }\n else{\n $allLeaves += $this->carry_forward_leaves;\n }\n }\n return $allLeaves;\n }",
"function erp_hr_leave_get_balance_for_single_entitlement( $entitlement_id ) {\n global $wpdb;\n\n $query = \"select en.id, en.user_id, en.leave_id, en.day_in, en.f_year, fy.start_date, fy.end_date, l.name as policy_name\";\n $query .= \" from {$wpdb->prefix}erp_hr_leave_entitlements as en\";\n $query .= \" LEFT JOIN {$wpdb->prefix}erp_hr_financial_years as fy on fy.id = en.f_year\";\n $query .= \" LEFT JOIN {$wpdb->prefix}erp_hr_leaves as l on l.id = en.leave_id\";\n $query .= \" where en.id = %d\";\n\n $result = $wpdb->get_row( $wpdb->prepare( $query, $entitlement_id ) );\n\n $balance = [];\n\n if ( ! empty( $result ) ) {\n $days_count = $wpdb->get_row(\n $wpdb->prepare(\n \"SELECT sum(day_in) as day_in, sum(day_out) as day_out FROM {$wpdb->prefix}erp_hr_leave_entitlements WHERE user_id = %d AND leave_id = %d and f_year = %d \",\n array( $result->user_id, $result->leave_id, $result->f_year )\n ),\n ARRAY_A\n );\n\n if ( is_array( $days_count ) && ! empty( $days_count ) ) {\n $day_in = floatval( $days_count['day_in'] );\n $day_out = floatval( $days_count['day_out'] );\n\n // check for extra leave\n $extra_leave = 0 ;\n $available = $day_in - $day_out;\n if ( $available == 0 ) {\n $extra_leave = $wpdb->get_var(\n $wpdb->prepare(\n \"SELECT sum(day_in) as day_in FROM {$wpdb->prefix}erp_hr_leave_entitlements WHERE user_id = %d AND leave_id = %d and f_year = %d AND trn_type = %s\",\n array( $result->user_id, $result->leave_id, $result->f_year, 'unpaid_leave' )\n )\n );\n $extra_leave = null === $extra_leave ? 0 : $extra_leave;\n }\n\n $financial_year = Financial_Year::find( $result->f_year );\n $leave_spent = $wpdb->get_var(\n $wpdb->prepare(\n \"SELECT sum(rq.days) FROM {$wpdb->prefix}erp_hr_leave_requests as rq\n WHERE rq.user_id = %d AND rq.leave_id = %d AND rq.last_status = %d AND rq.start_date BETWEEN %d AND %d\",\n array( $result->user_id, $result->leave_id, 1, $financial_year->start_date, $financial_year->end_date )\n )\n );\n\n $leave_spent = null === $leave_spent ? 0 : $leave_spent;\n\n $balance = array(\n 'entitlement_id' => $result->id,\n 'f_year' => $result->f_year,\n 'days' => $result->day_in,\n 'from_date' => $result->start_date,\n 'to_date' => $result->end_date,\n 'leave_id' => $result->leave_id,\n 'policy' => $result->policy_name,\n 'scheduled' => 0,\n 'entitlement' => $result->day_in,\n 'total' => $day_in,\n 'available' => $available,\n 'extra_leave' => $extra_leave,\n 'day_in' => $day_in,\n 'day_out' => $day_out,\n 'spent' => $leave_spent,\n );\n }\n }\n\n return $balance;\n}",
"public function getLeaveSummary()\n\n {\n\n\t\t$LeaveSummary = DB::table('employees')\n\n\t\t\t\t\t\t\t\t->join('divisions', 'employees.division', '=', 'divisions.id')\n\n ->join('positions', 'employees.position', '=', 'positions.id')\n\n ->join('leaves', 'employees.id', '=', 'leaves.employee_id')\n\n ->where('leaves.category', '=', 'paid')\n\n ->whereBetween('leaves.date_from', array('2020-01-01', '2020-03-15'))\n\n ->whereBetween('leaves.date_to', array('2020-01-01', '2020-03-15'))\n\n\t\t\t\t\t\t\t\t->select(\n\n 'employees.firstname',\n\n 'employees.middlename',\n\n 'employees.lastname',\n\n 'divisions.division',\n\n 'positions.position',\n\n 'leaves.date_from',\n\n 'leaves.date_to',\n\n 'leaves.category'\n\n\t\t\t\t\t\t\t\t)\n\n ->get();\n\n \n\n return $LeaveSummary;\n\n }",
"public function checkLeaveBalance($userId, $leaveType = null)\n {\n $thisyear = date('Y');\n $lastyear = $thisyear - 1;\n $currentmonth = date('n');\n $dayOfYear = date(\"z\")+1;\n $timeOffTaken = 0;\n $timeOffTakenBeforeApril = 0;\n $sickLeaveTaken = 0;\n\n if ($leaveType) {\n $filterLeave = \"AND leaveentitlements.Leave_Type = '$leaveType'\";\n } else {\n $filterLeave = \"\";\n }\n\n // if ($leaveType == 'Annual Leave') {\n $beforeMonth = 4;\n $oneHourTimeOff = $this->getLeaveTaken($userId, '1 Hour Time Off', $thisyear);\n $twoHoursTimeOff = $this->getLeaveTaken($userId, '2 Hours Time Off', $thisyear);\n $oneHourTimeOffBeforeApril = $this->getLeaveTaken($userId, '1 Hour Time Off', $thisyear, $beforeMonth);\n $twoHoursTimeOffBeforeApril = $this->getLeaveTaken($userId, '2 Hours Time Off', $thisyear, $beforeMonth);\n\n $timeOffTaken = $oneHourTimeOff + $twoHoursTimeOff;\n $timeOffTakenBeforeApril = $oneHourTimeOffBeforeApril + $twoHoursTimeOffBeforeApril;\n\n $emergencyLeave = $this->getLeaveTaken($userId, 'Emergency Leave', $thisyear);\n $emergencyLeaveBeforeApril = $this->getLeaveTaken($userId, 'Emergency Leave', $thisyear, $beforeMonth);\n\n $replacementLeave = $this->getLeaveTaken($userId, 'Replacement Leave', $thisyear);\n // }\n $sickLeaveType = 'Medical Leave';\n if ($leaveType == \"\" || $leaveType == 'Medical Leave') {\n $sickLeave = DB::select(\"SELECT SUM(No_of_Days) as Sick_Leave_Taken FROM leaves\n INNER JOIN (select Max(Id) as maxid,LeaveId from leavestatuses WHERE Leave_Status LIKE '%Final Approved%' Group By LeaveId) as max ON max.LeaveId=leaves.Id\n WHERE leaves.UserId = $userId AND YEAR(str_to_date(leaves.End_Date,'%d-%M-%Y'))=$thisyear AND leaves.Leave_Type = '$sickLeaveType'\n \");\n $sickLeaveTaken = $sickLeave[0]->Sick_Leave_Taken ? $sickLeave[0]->Sick_Leave_Taken : 0;\n }\n\n // Get the leave start March or before and end after March, calculate the no of days taken 31 March and before\n $leaveInBetweenMarch = DB::select(\"\n SELECT leaves.Id as LeaveId, leaves.UserId, SUM(CASE WHEN lt.Leave_Period = 'AM' OR lt.Leave_Period = 'PM' THEN 0.5 WHEN lt.Leave_Period = '1 Hour' THEN 0.125 WHEN lt.Leave_Period = '2 Hours' THEN 0.25 WHEN lt.Leave_Period = 'Full' THEN 1 ELSE 0 END) Leave_Taken FROM leaves\n LEFT JOIN (SELECT leave_terms.Leave_Period, leave_terms.Leave_Id from leave_terms WHERE MONTH(Str_to_date(leave_terms.Leave_Date, '%d-%M-%Y')) <= 3 AND YEAR(Str_to_date(leave_terms.Leave_Date, '%d-%M-%Y')) = $thisyear) as lt\n ON leaves.Id = lt.Leave_Id\n WHERE leaves.UserId = $userId AND (leaves.Leave_Type = 'Annual Leave' OR leaves.Leave_Type = '1 Hour Time Off' OR leaves.Leave_Type = '2 Hours Time Off' OR leaves.Leave_Type = 'Emergency Leave') AND YEAR(Str_to_date(leaves.Start_Date, '%d-%M-%Y')) = $thisyear AND (MONTH(Str_to_date(leaves.Start_Date, '%d-%M-%Y')) <= 3 AND MONTH(Str_to_date(leaves.End_Date, '%d-%M-%Y')) > 3)\n GROUP BY leaves.Id\n \");\n\n if(! empty($leaveInBetweenMarch)) {\n $leaveTakenBeforeApril = $leaveInBetweenMarch[0]->Leave_Taken ? $leaveInBetweenMarch[0]->Leave_Taken : 0;\n } else {\n $leaveTakenBeforeApril = 0;\n }\n\n\n return $leavebalance = DB::select(\"\n SELECT\n leaveentitlements.Leave_Type,\n CASE\n WHEN leaveentitlements.Leave_Type = 'Marriage Leave' THEN\n IF(service.Marital_Status LIKE '%Married%',0,leaveentitlements.Days)\n WHEN leaveentitlements.Leave_Type = 'Paternity Leave' THEN\n IF(service.Marital_Status LIKE '%Married' AND service.Gender = 'Male', leaveentitlements.Days, 0)\n WHEN leaveentitlements.Leave_Type = 'Maternity Leave' THEN\n IF(service.Marital_Status LIKE '%Married' AND service.Gender = 'Female', leaveentitlements.Days, 0)\n ELSE leaveentitlements.Days\n END as Yearly_Entitlement,\n CASE WHEN leaveentitlements.Leave_Type = 'Medical Leave'\n THEN leaveentitlements.Days\n WHEN service.Days_of_Service <= 90\n THEN 0\n -- WHEN leaveentitlements.Leave_Type = 'Annual Leave' AND service.confirmed AND service.Days_of_Service > 365\n -- THEN leaveentitlements.Days\n WHEN leaveentitlements.Leave_Type = 'Annual Leave'\n -- THEN 5*ROUND(leaveentitlements.Days/365*service.Days_of_Service_Current_Year/5 ,1)\n THEN 5*ROUND(leaveentitlements.Days / 12 * service.Months_of_Service/5,1)\n WHEN leaveentitlements.Leave_Type = 'Marriage Leave' THEN\n IF(service.Marital_Status LIKE '%Married%',0,leaveentitlements.Days)\n WHEN leaveentitlements.Leave_Type = 'Paternity Leave' THEN\n IF(service.Marital_Status LIKE '%Married' AND service.Gender = 'Male', leaveentitlements.Days, 0)\n WHEN leaveentitlements.Leave_Type = 'Maternity Leave' THEN\n IF(service.Marital_Status LIKE '%Married' AND service.Gender = 'Female', leaveentitlements.Days, 0)\n ELSE\n leaveentitlements.Days\n END as Current_Entitlement,\n IF(leaveadjustments.Adjustment_Value,leaveadjustments.Adjustment_Value,0) as Adjusted,\n CASE WHEN leaveentitlements.Leave_Type = 'Annual Leave' THEN IF(replacementadjustments.Adjustment_Value,replacementadjustments.Adjustment_Value,0) ELSE 0 END as Replacement_Adjusted,\n IF(leaveentitlements.Leave_Type = 'Annual Leave',$leaveTakenBeforeApril + $emergencyLeaveBeforeApril +$timeOffTakenBeforeApril + LeaveTakenBeforeApril,0) as Leave_Taken_Before_April,\n\n CASE WHEN leaveentitlements.Leave_Type = 'Annual Leave' THEN $emergencyLeave + $timeOffTaken + IF(Total_Leave_Taken,Total_Leave_Taken,0) ELSE IF(Total_Leave_Taken,Total_Leave_Taken,0) END as Leave_Taken,\n CASE WHEN leaveentitlements.Leave_Type = 'Annual Leave' THEN IF(Total_Leave_Taken,Total_Leave_Taken,0) ELSE IF(Total_Leave_Taken,Total_Leave_Taken,0) END as Leave_Taken_No_Timeoff,\n CASE\n WHEN leaveentitlements.Leave_Type = 'Annual Leave' AND leavecarryforwards.Days > (SELECT Leave_Taken_Before_April) AND MONTH(NOW()) > 3\n THEN\n 0\n ELSE\n 0\n END as Burnt,\n -- leavecarryforwards.Days as Carry_Forward_From_Last_Year\n CASE WHEN leaveentitlements.Leave_Type = 'Annual Leave' THEN IF(leavecarryforwards.Days,leavecarryforwards.Days,0) - (SELECT Burnt) ELSE 0 END As Carried_Forward,\n CASE WHEN leaveentitlements.Leave_Type = 'Annual Leave' THEN GREATEST((SELECT Carried_Forward - Leave_Taken),0) ELSE 0 END as Carried_Forward_Balance,\n\n\n CASE WHEN leaveentitlements.Leave_Type = 'Annual Leave' THEN $timeOffTaken ELSE 0 END as Time_Off_Taken,\n CASE WHEN leaveentitlements.Leave_Type = 'Annual Leave' THEN $emergencyLeave ELSE 0 END as EL,\n IF(pending.Pending_Leave,pending.Pending_Leave,0) as Pending,\n CASE WHEN leaveentitlements.Leave_Type = 'Annual Leave'\n THEN (SELECT Current_Entitlement + Adjusted + IF(Carried_Forward,Carried_Forward,0) - Leave_Taken)\n ELSE (SELECT Current_Entitlement + Adjusted - IF(Total_Leave_Taken,Total_Leave_Taken,0))\n END as Leave_Balance,\n -- IF(pending.Pending_Leave,pending.Pending_Leave,0) + IF(pending.Replacement_Pending_Leave,pending.Replacement_Pending_Leave,0) as Total_Pending_Leave,\n\n CASE WHEN leaveentitlements.Leave_Type = 'Annual Leave' THEN $replacementLeave ELSE 0 END as Replacement,\n IF(pending.Replacement_Pending_Leave,pending.Replacement_Pending_Leave,0) as Replacement_Pending,\n\n CASE WHEN leaveentitlements.Leave_Type = 'Annual Leave'\n THEN IF(replacementadjustments.Adjustment_Value,replacementadjustments.Adjustment_Value,0) - $replacementLeave\n ELSE 0\n END as Replacement_Balance,\n\n\n CASE WHEN leaveentitlements.Leave_Type = 'Annual Leave'\n THEN (SELECT Leave_Balance + Replacement_Balance)\n ELSE (SELECT Leave_Balance)\n END as Total_Leave_Balance\n\n FROM users\n LEFT JOIN (\n SELECT users.id AS UserId, users.Marital_Status, users.Gender,\n CASE WHEN\n DATEDIFF(Date_format(Now(), '%Y-%m-%d'), Str_to_date(users.confirmation_date, '%d-%M-%Y')) >= 0 THEN 1 ELSE 0 end AS confirmed,\n DATEDIFF(Date_format(Now(), '%Y-%m-%d'),Str_to_date(users.joining_date, '%d-%M-%Y')) AS Days_of_Service,\n Ceiling((SELECT days_of_service) / 365) AS Years_of_Service,\n CASE WHEN YEAR(str_to_date(users.Joining_date,'%d-%M-%Y')) = $thisyear THEN 1 ELSE 0 END as Joined_This_Year,\n Joining_date,\n CASE WHEN (SELECT Joined_This_Year) THEN (SELECT Days_of_Service) ELSE DATEDIFF(DATE_FORMAT(NOW(),'%Y-%m-%d'),DATE_FORMAT(NOW() ,'%Y-01-01')) END as Days_of_Service_Current_Year,\n (SELECT days_of_service) / 30 AS Current_Completed_Month,\n CASE WHEN (SELECT joined_this_year) THEN (SELECT current_completed_month) ELSE Month(Now()) end AS Months_of_Service\n FROM users\n WHERE users.Id = $userId\n ) as service ON users.Id = service.UserId\n LEFT JOIN (SELECT leaveentitlements.*,tblEnt.MaxYear FROM leaveentitlements LEFT JOIN\n (SELECT leaveentitlements.Grade, Leave_Type, MAX(Year) as MaxYear\n FROM leaveentitlements\n GROUP BY Grade, Leave_Type ) as tblEnt\n ON leaveentitlements.Grade = tblEnt.Grade and leaveentitlements.Leave_Type = tblEnt.Leave_Type\n UNION SELECT 0 as Id, 'All' as Grade, 1 as Year, 0 as Days, 'Replacement Leave' as Leave_Type, 0 as created_at, 1 as MaxYear\n ) as leaveentitlements\n ON (leaveentitlements.Grade = users.Grade OR leaveentitlements.Grade = 'ALL')\n AND (leaveentitlements.Year = LEAST(leaveentitlements.MaxYear,service.Years_of_Service) OR leaveentitlements.Year = '')\n\n LEFT JOIN (\n SELECT leaves.Leave_Type,\n SUM(CASE WHEN leaves.Leave_Type <> 'Marriage Leave' THEN IF(YEAR(str_to_date(leaves.End_Date,'%d-%M-%Y'))=$thisyear,No_of_Days,0) ELSE No_of_Days END) as Total_Leave_Taken,\n SUM(CASE WHEN MONTH(str_to_date(leaves.End_Date,'%d-%M-%Y'))<=3 AND YEAR(str_to_date(leaves.End_Date,'%d-%M-%Y'))=$thisyear THEN No_of_Days ELSE 0 END) as LeaveTakenBeforeApril FROM leaves\n -- INNER JOIN (SELECT leavestatuses.Id,leavestatuses.LeaveId,leavestatuses.Leave_Status FROM leavestatuses JOIN (select Max(Id) as maxid,LeaveId from leavestatuses Group By LeaveId) as max ON max.maxid = leavestatuses.Id AND (Leave_Status LIKE '%Approved%' OR Leave_Status LIKE '%Pending%')) as ls ON ls.LeaveId = leaves.Id\n JOIN (select Max(Id) as maxid,LeaveId from leavestatuses Group By LeaveId) as max ON max.LeaveId=leaves.Id\n JOIN leavestatuses ON leavestatuses.Id=max.`maxid`\n WHERE leaves.UserId = $userId AND (Leave_Status LIKE '%Approved%' OR Leave_Status LIKE '%Pending%')\n GROUP BY Leave_Type\n ) as app ON app.Leave_Type = leaveentitlements.Leave_Type\n LEFT JOIN (\n SELECT SUM(CASE WHEN YEAR(str_to_date(leaves.End_Date,'%d-%M-%Y'))=$thisyear AND leaves.Leave_Type <> 'Replacement Leave' THEN leaves.No_of_Days ELSE 0 END) as Pending_Leave,\n SUM(CASE WHEN YEAR(str_to_date(leaves.End_Date,'%d-%M-%Y'))=$thisyear AND leaves.Leave_Type = 'Replacement Leave' THEN leaves.No_of_Days ELSE 0 END) as Replacement_Pending_Leave,\n CASE WHEN Leave_Type = '2 Hours Time Off' OR Leave_Type = '1 Hour Time Off' OR Leave_Type = 'Emergency Leave' OR Leave_Type = 'Replacement Leave' THEN 'Annual Leave' ELSE Leave_Type END as Type\n FROM leaves\n JOIN (select Max(Id) as maxid,LeaveId from leavestatuses Group By LeaveId) as max ON max.LeaveId=leaves.Id\n JOIN leavestatuses ON leavestatuses.Id=max.`maxid`\n WHERE leaves.UserId = $userId AND (Leave_Status LIKE '%Approved%' OR Leave_Status LIKE '%Pending%') AND Leave_Status NOT LIKE '%Final Approved%'\n GROUP BY Type\n ) as pending ON pending.Type = leaveentitlements.Leave_Type\n LEFT JOIN leavecarryforwards ON leavecarryforwards.UserId=$userId AND leavecarryforwards.Year=$lastyear\n LEFT JOIN leaveadjustments ON users.Id = leaveadjustments.UserId AND leaveadjustments.Adjustment_Leave_Type = leaveentitlements.Leave_Type AND leaveadjustments.Adjustment_Year = $thisyear\n LEFT JOIN leaveadjustments as replacementadjustments ON users.Id = replacementadjustments.UserId AND replacementadjustments.Adjustment_Leave_Type = 'Replacement Leave' AND replacementadjustments.Adjustment_Year = $thisyear\n WHERE users.Id = $userId $filterLeave\n AND leaveentitlements.Leave_Type <> ''\n GROUP BY leaveentitlements.Leave_Type\n \");\n }",
"public function getLeaveRequests()\n {\n $employees = $this->getAll();\n $leaveRequests = [];\n foreach ($employees as $employee) {\n $key = $employee['first_name'].' '.$employee['last_name'];\n $leaveRequests[$key] = $this->getEmployeeLeaveRequests($employee['id']); \n }\n return $leaveRequests;\n }",
"public function employees_with_leaves()\n {\n $params = array('header' => $this->_leaveheaders, \n 'class' => array('table table-striped table-bordered dt-table'));\n \n $this->_ci->load->library('MY_table', $params, 'regemployees');\n \n $empleaves = $this->_ci->employees->regular_employees_with_leaves();\n \n if (isset($empleaves) && !empty($empleaves))\n {\n for ($i = 0; $i < count($empleaves); $i++)\n {\n $tabledata[] = array($this->_leavemodal($empleaves[$i]->EmployeeNumber),\n $empleaves[$i]->FirstName,\n $empleaves[$i]->LastName,\n $empleaves[$i]->Vacation,\n $empleaves[$i]->Emergency,\n $empleaves[$i]->Sick,\n $empleaves[$i]->Maternity,\n $empleaves[$i]->Paternity,);\n }\n \n if (isset($tabledata) && !empty($tabledata))\n {\n return $this->_ci->regemployees->generate($tabledata);\n }\n else\n {\n $this->_ci->leave_listings->add_row(array('data' => 'No results found.', \n 'colspan' => count($this->_leaveheaders)));\n return $this->_ci->regemployees->generate();\n }\n }\n else\n {\n $this->_ci->leave_listings->add_row(array('data' => 'No results found.', \n 'colspan' => count($this->_leaveheaders)));\n return $this->_ci->regemployees->generate();\n }\n }",
"function subtract_leave_days($leave_id){\n\t\tglobal $db, $message_list;\n\t\t\n\t\t$leave = get_employee_leave($leave_id);\t\n\t\t$leave_user = get_user_by_leave($leave);\t\n\t\t\n\t\t$remaining_leaves = intval(get_remaining_leaves_for_user($leave_user->id));\t\t\n\t\t$remaining_leaves = $remaining_leaves + $leave->canceled_days;\n\t\t\n\t\t$query = $db->prepare('UPDATE leaves set remaining_leaves=:remaining_leaves where id =:id');\n\t\t$query->bindValue(':remaining_leaves', \t$remaining_leaves,\t\tPDO::PARAM_INT); \n\t\t$query->bindValue(':id', \t\t\t\t$leave_user->id,\t\tPDO::PARAM_INT); \n\t\t$query->execute();\n\n\t\t$subject \t= 'Η Αδεία σας Ανακλήθηκε'; \n\t\t$body \t\t= '<p>Η Αδεία σας Ανακλήθηκε.</p>';\n\t\t$body \t\t.= '<p>Ανακλήθηκαν '.$leave->canceled_days.' από τις '.$leave->num_leaves.' μέρες.</p>';\n\t\t$body \t\t.= '<p>Αφορά την άδεια με τα παρακάτω στοιχεία: </p>';\n\t\t$body \t\t.= '<p>- Ημέρομηνία Υποβολής: '. printDate($leave->date_submitted).'</p>';\n\t\t$body \t\t.= '<p>- Ημερομηνία Έναρξης Άδειας: '. printDate($leave->date_starts).'</p>';\n\t\t$body \t\t.= '<p>- Ημερομηνία Λήξης Άδειας: '. printDate($leave->date_ends).'</p>';\n\t\t\n\t\tif(DEBUG){ // This is in development mode..\n\t\t\t$address \t= LEAVES_DEBUG_USER_EMAIL;\n\t\t\t$receiver\t= LEAVES_DEBUG_USER_NAME;\n\t\t} else {\n\t\t\t$address \t= $leave_user->email;\n\t\t\t$receiver\t= $leave_user->first_name.' '.$leave_user->last_name;\n\t\t}\n\t\temail_send($address, $receiver, $subject, $body);\n\t}",
"protected function used_leave($leave_category_id, $year, $emp_id=null){\n\t$next_year = $year + 1;\n\t// dump($year ,$next_year);\n\n\tif(empty($emp_id)){\n\t\t$emp_id = get_current_user_meta('employee_id');\n\t}\n\t$fromLeavesData = EMP_LEV::where(['leave_category_id'=>$leave_category_id, 'employee_id'=>$emp_id, 'status'=>1])->whereBetween('from',[$year.'-04-01',$next_year.'-03-31'] )->get();//->toArray();\n\t$exist_id = array_pluck($fromLeavesData,'id');\n\t$toLeavesData =EMP_LEV::where(['leave_category_id'=>$leave_category_id, 'employee_id'=>$emp_id, 'status'=>1])->whereBetween('to',[$year.'-04-01',$next_year.'-03-31'] )->get();\n\t\t\t@$total_leave = @$fromLeavesData->sum('total_days'); \n\t\t\t@$from_leave_count = @$fromLeavesData->sum('from_leave_count');\n\t\t\t@$to_leave_count = @$toLeavesData->sum('to_leave_count');\n\t\t\t@$all_leave = collect([$total_leave,$from_leave_count,$to_leave_count])->sum();\n\treturn $all_leave;\n}",
"public function allocatedLeaveList() {\n $allocatedList = DB::table('il_leave_config as lc')->join('il_job_title as jt','jt.id','=','lc.fkJobTitleId')->select('lc.id','jt.job_title','lc.overall_allocated_leave as total_leave_per_year','lc.paid_leave','lc.period_from','lc.period_to')->get();\n return View::make('Hrm.leave.allocatedLeaveListing')->with(array('leave_list' => $allocatedList));\n \n }",
"public function getLeaveRequests();",
"public function getAccruedLeaveDays()\n {\n return $this->accrued_leave_days;\n }",
"function getEmployeeLeaveMaternity($db, $strFrom, $strThru, $strSection = \"\", $strEmployee = \"\")\n{\n $arrResult = [];\n // langsung dipisah sesuai jenis absennya\n $strSQL = \"SELECT t1.* FROM hrd_leave AS t1, hrd_employee AS t2 \";\n $strSQL .= \"WHERE t1.id_employee = t2.id AND t2.gender = 0 \";\n $strSQL .= \"AND leave_type_code = 1 AND status >= '\" . REQUEST_STATUS_APPROVED . \"' \";\n if ($strSection != \"\") {\n $strSQL .= \"AND (t2.section_code = '$strSection' OR t2.sub_section_code = '$strSection') \";\n }\n if ($strEmployee != \"\") {\n $strSQL .= \"AND t2.employee_id = '$strEmployee' \";\n }\n $strSQL .= \"AND ((date_from, date_thru) \";\n $strSQL .= \" OVERLAPS (DATE '$strFrom', DATE '$strThru') \";\n $strSQL .= \" OR (date_thru = DATE '$strFrom') \";\n $strSQL .= \" OR (date_thru = DATE '$strThru')) \";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n // cari total waktu\n (pgDateFormat($strFrom, \"Ymd\") < pgDateFormat(\n $rowDb['date_from'],\n \"Ymd\"\n )) ? $strDateStart = $rowDb['date_from'] : $strDateStart = $strFrom;\n (pgDateFormat($strThru, \"Ymd\") < pgDateFormat(\n $rowDb['date_thru'],\n \"Ymd\"\n )) ? $strDateFinish = $strThru : $strDateFinish = $rowDb['date_thru'];\n $intTotal = totalWorkDay($db, $strDateStart, $strDateFinish);\n if (isset($arrResult[$rowDb['id_employee']])) {\n $arrResult[$rowDb['id_employee']] += $intTotal;\n } else {\n $arrResult[$rowDb['id_employee']] = $intTotal;\n }\n }\n return $arrResult;\n}",
"public function getRequestedLeaveDays()\n {\n return $this->requested_leave_days;\n }",
"public function employeeLeaveAllocation($params)\n {\n if (! \\Auth::user()->can('request-leave')) {\n throw ValidationException::withMessages(['message' => trans('general.permission_denied')]);\n }\n\n $id = gv($params, 'id', optional(\\Auth::user()->Employee)->id);\n\n if (! $id) {\n throw ValidationException::withMessages(['message' => trans('general.invalid_input')]);\n }\n\n $employee = $this->employee->findOrFail($id);\n\n if (\\Auth::user()->Employee->id != $id) {\n $this->employee->isAccessible($employee);\n }\n\n return $this->leave_allocation->info()->filterBySession()->filterByEmployeeId($employee->id)->get();\n }",
"private function fetch_leaves() {\n\n try {\n\n $result = Model_Leave::find(\"all\", array(\n \"order_by\" => array(\"date_filed\" => \"desc\")\n ));\n\n return $result;\n\n }catch (Exception $e) {\n return $e->getMessage();\n }\n\n }",
"public function checkRemLeaves($empId, $leaveType,$em){\n $conn = $em->getConnection();\n $sql = \"SELECT leaves_remaining FROM leaves_remaining WHERE emp_id = :emp_id AND leave_type = :leave_type\";\n $stmt = $conn->prepare($sql);\n $stmt->bindValue(':emp_id', $empId);\n $stmt->bindValue(':leave_type', $leaveType);\n $stmt->execute();\n return $stmt->fetchAll()[0]['leaves_remaining'];\n }",
"public static function getSLCredits($emp_id){\n\t\ttry{\n\t\t\t$con = Yii::app()->db;\n\t\t\t$res = $con->createCommand()\n\t\t\t\t\t->select('SickLeave_Credits')\n\t\t\t\t\t->from('vacation_leave')\n\t\t\t\t\t->where(\"Emp_ID='$emp_id'\")\n\t\t\t\t\t->queryRow();\n\t\t\tif($res==NULL) return -1;\n\t\t\treturn $res['SickLeave_Credits'];\n\t\t}catch(Exception $ex){\n\t\t\tYii::log('HrisLoaApplication::getSLCredits($emp_id):'.$ex->getMessage(), 'error', 'application');\n\t\t\treturn -1;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a Queue2civicrmTrxnCounter object Creates a static Queue2civicrmTrxnCounter object that persists throughout the lifetime of script execution once it's called. Attempts to set the gateways to count trxns for based off of what's configured (pulling from the queue2civicrm_gateways_to_monitor drupal var) | function _queue2civicrm_trxn_counter_get() {
static $trxn_counter;
if ( !$trxn_counter ) {
$gateways = explode( ",", variable_get( 'queue2civicrm_gateways_to_monitor', '' ));
$gateways = array_map( 'trim', $gateways );
$trxn_counter = new Queue2civicrmTrxnCounter( $gateways );
}
return $trxn_counter;
} | [
"final protected function &getTransactionCounter()\n {\n $con = $this->getConnectionName();\n if (!is_array(self::$__trans_counter)) { self::$__trans_counter = array(); }\n if (!isset(self::$__trans_counter[$con])) { self::$__trans_counter[$con] = 0; }\n return self::$__trans_counter[$con];\n }",
"public function __construct( array $gateways ) {\n $this->gateways = $gateways;\n foreach ( $gateways as $gateway ) {\n $this->trxn_counts[ $gateway ] = 0;\n }\n }",
"function wp_schedule_update_network_counts() {}",
"public function count_pending_agent_tickets() {\r\n\t\t$sql = \"SELECT COUNT(*) as c FROM `tickerr_tickets` WHERE `userid`={$this->client_id} AND `status`=1 AND `agentid`!=0\";\r\n\t\t$query = $this->db->query($sql);\r\n\t\t$row = $query->row();\r\n\t\treturn $row->c;\r\n\t}",
"public function getRrpTenantReferenceCount();",
"public function getCounter();",
"public function count_pending_c_tickets() {\r\n\t\t$sql = \"SELECT COUNT(*) as c FROM `tickerr_tickets` WHERE `userid`={$this->client_id} AND `status`=2\";\r\n\t\t$query = $this->db->query($sql);\r\n\t\t$row = $query->row();\r\n\t\treturn $row->c;\r\n\t}",
"public function getCurrentUserTimerCount() : int;",
"protected function createIcountDriver()\n {\n $config = $this->app['config']->get('larabill.gateways.icount', []);\n\n return new IcountGateway();\n }",
"public function getFrontendCounter();",
"public function getRetryCount();",
"private function admin_counters()\n {\n $company_id = $this->_request['company_id'];\n \n if(empty($company_id)){\n $result['status'] ='0';\n $result['message']=\"Company id required\";\n $this->response($this->json($result), 200);\n }\n \n $count=mysql_query(\"SELECT\n (SELECT COUNT(*) FROM users where UserCompanyID='\".$company_id.\"') as users, \n (SELECT COUNT(*) FROM tbl_department where company_id='\".$company_id.\"') as departments,\n (SELECT COUNT(*) FROM tbl_heads where HeadCompanyID='\".$company_id.\"') as heads,\n (SELECT COUNT(*) FROM tbl_roles where RoleID IN (1,2) OR RoleCompanyID='\".$company_id.\"') as roles,\n (select count(*) from tbl_heads h, tbl_activities a where h.HeadID=a.ActivityHeadID and h.HeadCompanyID='\".$company_id.\"') as activites,\n (select count(*) from tbl_tasks t, tbl_department d where t.Deleted=1 and d.company_id='\".$company_id.\"' and t.TaskDepartmentID=d.id) as tasks,\n (select count(*) from tbl_timesheet t, users u where u.UserCompanyID='\".$company_id.\"' and t.submit_user_id=u.id) as timesheets,\n (select count(*) from tbl_coffecorner t, users u where u.UserCompanyID='\".$company_id.\"' and t.CoffeCornerUserID=u.id) as coffeecorner,\n (select count(*) from tbl_bulletinboard t, users u where u.UserCompanyID='\".$company_id.\"' and t.BulletinUserID=u.id) as bulletinboard\",$this->db);\n\n $taskcounter=mysql_query(\"SELECT\n (select count(*) from tbl_tasks t, tbl_department d where d.company_id='\".$company_id.\"' and t.TaskStatus=1 and t.TaskDepartmentID=d.id and t.Deleted=1) as sendback,\n (select count(*) from tbl_tasks t, tbl_department d where d.company_id='\".$company_id.\"' and t.TaskStatus=2 and t.TaskDepartmentID=d.id and t.Deleted=1) as pending,\n (select count(*) from tbl_tasks t, tbl_department d where d.company_id='\".$company_id.\"' and t.TaskStatus=3 and t.TaskDepartmentID=d.id and t.Deleted=1) as inprogress,\n (select count(*) from tbl_tasks t, tbl_department d where d.company_id='\".$company_id.\"' and t.TaskStatus=4 and t.TaskDepartmentID=d.id and t.Deleted=1) as waiting_approval,\n (select count(*) from tbl_tasks t, tbl_department d where d.company_id='\".$company_id.\"' and t.TaskStatus=5 and t.TaskDepartmentID=d.id and t.Deleted=1) as completed\",$this->db);\n\n $result = array();\n $i=0;\n if(mysql_num_rows($count) == 0){\n\n $result['status'] ='0';\n $result['message']=\"Not found!\";\n $this->response($this->json($result), 200);\n }\n else{\n $rlt = mysql_fetch_array($count, MYSQL_ASSOC);\n $task = mysql_fetch_array($taskcounter, MYSQL_ASSOC);\n // $rlt['Time']=$total_time;\n // $rlt['Deviation']=$Deviation;\n $this->response($this->json(array('status'=>'1','message'=>'Data found','counter'=>$rlt,'taskcounter'=>$task)), 200);\n }\n \n }",
"public function getTimerCount()\n {\n }",
"private function retornaNumeroTransacoesInicializadas()\n\t{\n\t\t// retornando o numero de transacoes inicializadas\n\t\treturn (Int) $this->_transactionCount;\n\t}",
"public function getSubscriberCount();",
"function getBookingCounter( )\n{\n\tglobal $bookingCounter;\n\n\treturn( $bookingCounter );\n}",
"public function getTransactionCount();",
"public function getSubscribersCount();",
"function ciniki_tenants_syncCheckRowCounts($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'sync_id'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Sync'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'checkAccess');\n $rc = ciniki_tenants_checkAccess($ciniki, $args['tnid'], 'ciniki.tenants.syncCheckRowCounts');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbGetRowCounts');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'syncLoad');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'syncRequest');\n\n //\n // Get the local object table counts\n //\n $rc = ciniki_core_dbGetRowCounts($ciniki, $args['tnid']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $modules = $rc['modules'];\n\n //\n // Get the list of syncs, or just one if specified\n //\n $strsql = \"SELECT ciniki_tenant_syncs.id, \"\n . \"ciniki_tenant_syncs.remote_name, ciniki_tenant_syncs.remote_uuid \"\n . \"FROM ciniki_tenant_syncs \"\n . \"WHERE ciniki_tenant_syncs.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND status = 10 \";\n if( isset($args['sync_id']) && $args['sync_id'] != '' ) {\n $strsql .= \"AND id = '\" . ciniki_core_dbQuote($ciniki, $args['sync_id']) . \"' \";\n }\n $strsql .= \"ORDER BY remote_name \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.tenants', array(\n array('container'=>'syncs', 'fname'=>'id', 'name'=>'sync',\n 'fields'=>array('id', 'name'=>'remote_name', 'remote_uuid')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['syncs']) ) {\n $syncs = array();\n } else {\n $syncs = $rc['syncs'];\n }\n\n //\n // loop through all remote syncs and get the table counts\n //\n foreach($syncs as $sid => $s) {\n $rc = ciniki_core_syncLoad($ciniki, $args['tnid'], $s['sync']['id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $sync = $rc['sync'];\n\n $rc = ciniki_core_syncRequest($ciniki, $sync, array('method'=>'ciniki.core.rowCounts'));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $remote_modules = $rc['modules'];\n \n //\n // Add remote information to modules\n //\n foreach($modules as $mid => $mod) {\n if( !isset($mod['tables']) ) {\n continue;\n }\n foreach($mod['tables'] as $tid => $table) {\n if( isset($remote_modules[$mid]['tables'][$tid]['rows']) ) {\n $modules[$mid]['tables'][$tid]['sync-' . $s['sync']['id']] = $remote_modules[$mid]['tables'][$tid]['rows'];\n if( $table['rows'] != $remote_modules[$mid]['tables'][$tid]['rows'] ) {\n $modules[$mid]['tables'][$tid]['flagged'] = 'yes'; \n }\n } else {\n $modules[$mid]['tables'][$tid]['flagged'] = 'yes';\n }\n }\n }\n }\n\n //\n // Expand modules to be proper return array, adding 'module' and 'table'\n //\n $mods = array();\n foreach($modules as $mid => $mod) {\n $tables = array();\n if( isset($mod['tables']) ) {\n foreach($mod['tables'] as $tid => $table) {\n $tables[] = array('table'=>$table);\n }\n }\n $mods[] = array('module'=>array('name'=>$mid, 'tables'=>$tables));\n }\n\n // hard coded return value, so the sync information does not also get passed back.\n return array('stat'=>'ok', 'syncs'=>$syncs, 'modules'=>$mods);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/Decide if the blog should be displayed when visiting a profile, user is the user who's profile is shown | function displayBlog(user $user, bool $friends, bool $friendsOfFriends): bool{
//If user has set to visible to all
if($user->blogVisibility < 1){
return true;
}
//If user has set to friends of friends, and you are a friend of a friend
else if( ($user->blogVisibility < 2) && $friendsOfFriends){
return true;
}
//If user has set to friends and you are a friend
else if( ($user->blogVisibility < 3) && $friends){
return true;
}
//If user has set to only themselves, and you are that user
else if($user->id == $_SESSION['userID']){ //// ??????
return true;
}
//Otherwise it is not visible
else{
return false;
}
} | [
"function oublog_can_view_post($post, $user, $context, $personalblog) {\n\n // Public visibility means everyone\n if($post->visibility==OUBLOG_VISIBILITY_PUBLIC) {\n return true;\n }\n // Logged-in user visibility means everyone logged in, but no guests\n if($post->visibility==OUBLOG_VISIBILITY_LOGGEDINUSER &&\n (isloggedin() && !isguestuser())) {\n return true;\n } elseif ($post->visibility==OUBLOG_VISIBILITY_LOGGEDINUSER) {\n return false;\n }\n \n if($post->visibility!=OUBLOG_VISIBILITY_COURSEUSER) {\n error('Invalid visibility level '. $post->visibility);\n }\n\n // Otherwise this is set to course visibility\n if($personalblog) {\n return $post->userid==$user->id;\n } else {\n // Check oublog:view capability at module level\n // This might not have been checked yet because if the blog is\n // set to public, you're allowed to view it, but maybe not this\n // post.\n return has_capability('mod/oublog:view',$context, $user->id);\n }\n}",
"function viewPublicProfile($args, &$request) {\n\t\t$this->validate(false);\n\t\t$templateMgr =& TemplateManager::getManager();\n\t\t$userId = (int) array_shift($args);\n\n\t\t$accountIsVisible = false;\n\n\t\t// Ensure that the user's profile info should be exposed:\n\n\t\t$commentDao =& DAORegistry::getDAO('CommentDAO');\n\t\tif ($commentDao->attributedCommentsExistForUser($userId)) {\n\t\t\t// At least one comment is attributed to the user\n\t\t\t$accountIsVisible = true;\n\t\t}\n\n\t\tif (!$accountIsVisible) $request->redirect(null, 'index');\n\n\t\t$userDao =& DAORegistry::getDAO('UserDAO');\n\t\t$user =& $userDao->getById($userId);\n\n\t\t$templateMgr->assign_by_ref('user', $user);\n\t\t$templateMgr->display('user/publicProfile.tpl');\n\t}",
"public function view(UserPolicyInterface $authUser, Tag $tag)\n {\n if ($authUser->canDo('blog.blog.view') && $authUser->isAdmin()) {\n return true;\n }\n\n return $tag->user_id == user_id() && $tag->user_type == user_type();\n }",
"private static function _shouldProfile(): bool\n {\n if (self::$_shouldProfile !== null) {\n return self::$_shouldProfile;\n }\n\n if (YII_DEBUG) {\n return self::$_shouldProfile = true;\n }\n\n $user = Craft::$app->getUser()->getIdentity();\n\n if (!$user) {\n return false;\n }\n\n return self::$_shouldProfile = $user->admin && $user->getPreference('profileTemplates');\n }",
"function osclass_pm_is_pub_profile() {\r\n $location = Rewrite::newInstance()->get_location();\r\n $section = Rewrite::newInstance()->get_section();\r\n if($location == 'user' && $section == 'pub_profile'){\r\n return TRUE;\r\n }\r\n return FALSE;\r\n }",
"function wct_is_user_profile() {\n\treturn (bool) apply_filters( 'wct_is_user_profile', wct_get_global( 'is_user' ) );\n}",
"public static function isBlogger()\n {\n return (\\Auth::user()->user_type == 0 || \\Auth::user()->user_type == 2) ? true : false;\n }",
"function profile()\r\n {\r\n // display changes depending on if the user is an admin or not\r\n if($_SESSION['user'] instanceof Admin){\r\n $users = $GLOBALS['dataLayer']->getUser(\"\");\r\n $this->_f3->set('users', $users);\r\n }\r\n else{\r\n // resets the user in the session to match the users database info\r\n $_SESSION['user'] = $GLOBALS['dataLayer']->getUser($_SESSION['user']->getUsername());\r\n $this->_f3->set('recipes', $_SESSION['user']->getFavorites());\r\n }\r\n\r\n // Display the profile page\r\n $view = new Template();\r\n echo $view->render('views/profile.html');\r\n }",
"public function viewProfile(){\n\t\n\t\t//testing the user\n\t\tif(!$this->user){\n\t\t\t//complete stranger\n\t\t\t$this->nonFriend('v_stranger');\n\t\t}else if($this->user->user_id == $_GET['userID']){\n\t\t\t//logged on\n\t\t\theader('Location: /users/profile');\t\t\n\t\t}else{\n\t\t\t$me = $this->user->user_id;\n\t\t\t$you = $_GET['userID'];\n\t\t\t$type = DB::instance(DB_NAME)->select_field(\"SELECT `kind` FROM `relationships` WHERE `me` = $me AND `you` = $you\");\n\t\t\t\n\t\t\tswitch($type){\n\t\t\t\t//friendz\n\t\t\t\tcase 1: $this->friendVisit();\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t//friendship pending\n\t\t\t\tcase 2: $this->nonFriend('v_friending');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t//following\n\t\t\t\tcase 3:\t$this->nonFriend('v_follower');\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t//user is not related anyone\n\t\t\t\tdefault: $this->nonFriend('v_somedude');\t\n\t\t\t\t\tbreak;\n\t\t\t}//end of switch\n\t\t\t\n\t\t}//end of else\n\t}",
"public function hideProfileLink() {\n if (!is_user_logged_in() && $this->asgarosforum->options['hide_profiles_from_guests']) {\n return true;\n } else {\n return false;\n }\n }",
"function wct_is_user_profile_comments() {\n\treturn (bool) apply_filters( 'wct_is_user_profile_comments', wct_get_global( 'is_user_comments' ) );\n}",
"function oublog_has_userblog_permission($capability,$oublog,$oubloginstance,$context) { \n // For personal blogs you can do these things EITHER if you have the capability \n // (ie for admins) OR if you are that user and you are allowed to post \n // to blog (not banned) \n global $USER;\n if($oublog->global && $oubloginstance && $USER->id == $oubloginstance->userid && \n has_capability('mod/oublog:contributepersonal', $context)) {\n return true;\n }\n // Otherwise require the capability (note this also allows eg admin access\n // to personal blogs)\n return has_capability($capability, $context);\n}",
"public function isSocialUser();",
"function is_pro_user($user_id = false) {\r\n\t\tglobal $wpdb, $current_user, $current_site;\r\n\r\n\t\tif ( !$user_id ) {\r\n\t\t\t$user_id = $current_user->ID;\r\n\t\t}\r\n $user_id = intval($user_id);\r\n\r\n\t\tif ( is_super_admin($user_id) )\r\n\t\t\treturn true;\r\n\r\n\t\t//very db intensive, so we cache (1 hour)\r\n\t\t$expire_time = time()-3600;\r\n\t\t@list($expire, $is_pro) = get_user_meta($user_id, 'psts_user', true);\r\n\t\tif ($expire && $expire >= $expire_time) {\r\n\t return $is_pro;\r\n\t }\r\n\r\n\t\t//TODO - add option to select which user levels from supporter blog will be supporter user. Right now it's all (>= Subscriber)\r\n\t\t//$results = $wpdb->get_results(\"SELECT * FROM `$wpdb->usermeta` WHERE `user_id` = $user_id AND `meta_key` LIKE 'wp_%_capabilities' AND `meta_value` LIKE '%administrator%'\");\r\n\t\t$results = $wpdb->get_results(\"SELECT * FROM `$wpdb->usermeta` WHERE `user_id` = $user_id AND `meta_key` LIKE '{$wpdb->base_prefix}%_capabilities'\");\r\n\t if (!$results) {\r\n\t //update cache\r\n\t update_user_meta($user_id, 'psts_user', array(time(), 0));\r\n\t return false;\r\n\t }\r\n\r\n\t foreach ($results as $row) {\r\n\t\t $tmp = explode('_', $row->meta_key);\r\n\t\t //skip main blog\r\n\t\t if ($tmp[1] != $current_site->blogid)\r\n\t $blog_ids[] = $tmp[1];\r\n\t }\r\n\t $blog_ids = implode(',',$blog_ids);\r\n\r\n\t $count = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites WHERE expire > '\" . time() . \"' AND blog_ID IN ($blog_ids)\");\r\n\t if ($count) {\r\n\t update_user_meta($user_id, 'psts_user', array(time(), 1)); //update cache\r\n\t return true;\r\n\t } else {\r\n\t //update cache\r\n\t update_user_meta($user_id, 'psts_user', array(time(), 0)); //update cache\r\n\t return false;\r\n\t }\r\n\t}",
"function userIsBlogOwner($userid, $blogid){\n\t$conn = open_db();\n\t$query = \"SELECT id FROM blogs WHERE userid = \".(int)$userid.\" AND id = \".(int)$blogid;\n\t$result = mysqli_query($conn, $query);\n\tif($result){\n\t\t$row = mysqli_fetch_assoc($result);\n\t}\n\tclose_db($conn);\n\tif((int)$row['id'] > 0) return true;\n\treturn false;\n}",
"function pkg_autologin_check_view_permissions($user_id=NULL) {\n if ($user_id === NULL) {\n $user_id = wp_get_current_user()->ID;\n }\n \n return (defined(\"IS_PROFILE_PAGE\") && IS_PROFILE_PAGE) || pkg_autologin_check_modify_permissions();\n}",
"public function canViewProfile() {\n\t\treturn (!$this->protectedProfile || WCF::getUser()->userID == $this->userID || UserProfile::isBuddy($this->userID) || WCF::getUser()->getPermission('admin.general.canViewPrivateUserOptions'));\n\t}",
"function bpb_extended_is_user_blogs_activity() {\n\treturn (bool) ( bp_is_user_activity() && bp_is_current_action( bp_get_blogs_slug() ) );\n}",
"protected function is_profile_page() {\n\t\tglobal $pagenow;\n\n\t\treturn $pagenow === 'profile.php' || $pagenow === 'user-new.php' || $pagenow === 'user-edit.php';\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Accessor method for profile salt | public function getProfileSalt(): string {
return $this->profileSalt;
} | [
"public\n\tfunction getProfileSalt() {\n\t\treturn ($this->profileSalt);\n\t}",
"public function getProfileSalt() {\n return ($this->profileSalt);\n }",
"public function getProfileSalt() {\n\t\treturn ($this->profileSalt);\n\t}",
"public function getProfileSalt() {\n\t\treturn $this->profileSalt;\n\t}",
"public function getProfileSalt(): string {\n\t\treturn $this->profileSalt;\n\t}",
"public function getProfileSalt() : string {\n\t\treturn $this->profileSalt;\n\t}",
"public function getProfileSalt() : string {\n\t\treturn ($this->profileSalt);\n\t}",
"public function get_salt(){\n return $this->_get_session('salt');\n }",
"public function getSalt()\n {\n }",
"public function salt()\n\t{\n\t\treturn $this->salt;\n\t}",
"public function getSalt() {\n\t\t}",
"public function getSalt()\r\n {\r\n return $this->salt;\r\n }",
"public static function salt() {\n return static::get('app.salt');\n }",
"public function getPrivateSalt(){\n\t\t$salt = Mage::getStoreConfig('payment/instamojo/salt');\n\t\treturn $salt;\n\t}",
"function getFieldnameSalt()\n {\n return $this->salt;\n }",
"public function getIdSalt()\n {\n return $this->config['id_salt'];\n }",
"public function getUserSalt() : string {\n\t\treturn($this->userSalt);\n\t}",
"static public function getSalt()\n {\n static $salt = null;\n if(is_null($salt))\n {\n $config = Zend_Registry::get('config');\n if($config !== false)\n {\n $salt = @$config->superuser->salt;\n }\n }\n return $salt;\n }",
"function getSalt(){\r\n\t\treturn \"sticeCraftAdministrationS@lT123\";\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears out the collExpertCategorys collection (array). This does not modify the database; however, it will remove any associated objects, causing them to be refetched by subsequent calls to accessor method. | public function clearExpertCategorys()
{
$this->collExpertCategorys = null; // important to set this to NULL since that means it is uninitialized
} | [
"public function clearCategories()\n {\n $this->collCategories = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearCategories()\n\t{\n\t\t$this->collCategories = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearCategories()\n {\n $scenario = Scenarios::getOrCreateUserScenario();\n $scenario->categories()->detach();\n }",
"private function clearCategoryIdentities()\n {\n /**\n * @var IdentityServiceInterface $identityService\n */\n $identityService = $this->container->get('plenty_connector.identity_service');\n\n foreach ($identityService->findBy(['objectType' => Category::TYPE]) as $identity) {\n $identityService->remove($identity);\n }\n }",
"public function clear( )\n {\n $this->collection = array( );\n }",
"protected function deleteCategories()\n {\n HelpCategory::query()->forceDelete();\n }",
"public function clearProspects()\n\t{\n\t\t$this->collProspects = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clear() {\n // Drop collection.\n $this->collection->drop();\n }",
"public function clearFtesalaryadvances()\n {\n $this->collFtesalaryadvances = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearAnswers()\n {\n $this->collAnswers = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearFeaturedSkills()\n {\n $this->collFeaturedSkills = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearDairypandls()\n {\n $this->collDairypandls = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearArticles()\n {\n $this->collArticles = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clear()\n\t{\n\t\tforeach(array_keys($this->_d) as $key)\n\t\t\t$this->remove($key);\n\t}",
"public function clearExpensess()\n {\n $this->collExpensess = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearCollections(): void\n {\n foreach ($this->hookedObjectCollections as $hookedObjectCollectionEntity) {\n $hookedObjectCollectionEntity\n ->getCollection()->getHookedObjectCollections()->removeElement(\n $hookedObjectCollectionEntity\n );\n $hookedObjectCollectionEntity\n ->setCollection(null)\n ->setHookedObject(null)\n ;\n }\n\n $this->hookedObjectCollections->clear();\n }",
"public function clearMedicalStaffs()\n {\n $this->collMedicalStaffs = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearIdeaabuses()\n\t{\n\t\t$this->collIdeaabuses = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearCollections()\n {\n $this->_collections = [];\n $this->_fileCollections = [];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays a form to edit an existing DatosdFamilia entity. | public function editAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('FocalAppBundle:DatosdFamilia')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find DatosdFamilia entity.');
}
$editForm = $this->createEditForm($entity);
$deleteForm = $this->createDeleteForm($id);
return $this->render('FocalAppBundle:DatosdFamilia:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
//'delete_form' => $deleteForm->createView(),
'idenc' => $entity->getIdEnc(),
'parsel' => $entity->getIdParentesco(),
'etniasel' => $entity->getIdEtnia(),
));
} | [
"private function createEditForm(DatosdFamilia $entity)\n {\n $form = $this->createForm(new DatosdFamiliaType(), $entity, array(\n 'action' => $this->generateUrl('datosdfamilia_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Actualizar', 'attr' => array('class' => 'btn-success')));\n\n return $form;\n }",
"public function editAction($id) \n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('ArisMainBundle:Galeria')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Galeria entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n \n\n return $this->render('ArisAdminBundle:Galeria:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n \n ));\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('FormationFrontBundle:Formation')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Formation entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('FormationAdminBundle:Formation:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function editAction() {\n $em = $this->getDoctrine()->getManager();\n $id = $this->getRequest()->get(\"id\");\n\n $entity = $em->getRepository('BackendBundle:Feast')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find feast entity.');\n }\n $editForm = $this->createForm(new \\CoolwayFestivales\\BackendBundle\\Form\\FeastType(), $entity);\n\n return array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView()\n );\n }",
"public function editAction($id) {\n $usuario = $this->container->get('security.context')->getToken()->getUser();\n\n $em = $this->getDoctrine()->getEntityManager();\n\n $entity = $em->getRepository('TxinbometroBundle:Gasolina')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Gasolina entity.');\n }\n\n if ($entity->getVehiculo()->getUsuario()->getId() != $usuario->getId()) {\n throw $this->createNotFoundException('Unable to access Gasolina entity.');\n }\n\n\n $editForm = $this->createForm(new GasolinaType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('TxinbometroBundle:Gasolina:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('SiseCoreBundle:PersonnelPersonnel')->find($id);\n $formpers = $this->container->get('form.factory')->createBuilder(new NomenclatureSoussituationadministrativeType())->getForm();\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find PersonnelPersonnel entity.');\n }\n $editForm = $this->createEditForm($entity);\n // $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('SiseCoreBundle:PersonnelPersonnel:edit.html.twig', array(\n 'entity' => $entity,\n 'code' => $id,\n 'edit_form' => $editForm->createView(),\n // 'delete_form' => $deleteForm->createView(),\n 'formpers' => $formpers->createView(),\n ));\n }",
"public function editAction($id) {\n $usuario = $this->container->get('security.context')->getToken()->getUser();\n\n $em = $this->getDoctrine()->getEntityManager();\n\n $entity = $em->getRepository('TxinbometroBundle:Gasto')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Gasto entity.');\n }\n if ($entity->getVehiculo()->getUsuario()->getId() != $usuario->getId()) {\n throw $this->createNotFoundException('Unable to access Gasolina entity.');\n }\n $editForm = $this->createForm(new GastoType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('TxinbometroBundle:Gasto:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('FocalAppBundle:DatossEdadvacunas')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find DatossEdadvacunas entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('FocalAppBundle:DatossEdadvacunas:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('AppBundle:Sucursal')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('No existe la Sucursal.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('AppBundle:Sucursal:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function updateAction(Request $request, $id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('FocalAppBundle:DatosdFamilia')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find DatosdFamilia entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n $editForm = $this->createEditForm($entity);\n $editForm->handleRequest($request);\n\n if ($editForm->isValid()) {\n if ($entity->getIdParentesco() !== null) {\n $idParentesco = $entity->getIdParentesco()->getId();\n $entity->setIdParentesco($idParentesco);\n }\n if ($entity->getIdEtnia() !== null) {\n $idEtnia = $entity->getIdEtnia()->getId();\n $entity->setIdEtnia($idEtnia);\n }\n /* Guarda los valores por defecto */\n $usr= $this->get('security.context')->getToken()->getUser();\n $usuario = $usr->getUsername();\n $fecha = new \\DateTime(\"now\");\n $entity->setUsuarioUltimaModificacion($usuario);\n $entity->setFechaUltimaModificacion($fecha);\n $em->flush();\n\n return $this->redirect($this->generateUrl('datosdfamilia', array('idenc' => $entity->getIdEnc())));\n }\n\n return $this->render('FocalAppBundle:DatosdFamilia:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n //'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function editAction($id)\n {\n \n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CorresponsaliaBundle:Estadofondo')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Estadofondo entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CorresponsaliaBundle:Estadofondo:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BodegaBundle:RegistroBodega')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find RegistroBodega entity.');\n }\n\n $editForm = $this->createForm(new RegistroBodegaType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BodegaBundle:RegistroBodega:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('PabloAdjWebBundle:Atributo')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Atributo entity.');\n }\n\n $editForm = $this->createForm(new AtributoType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('PabloAdjWebBundle:Atributo:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('EmisionesBundle:Aerolinea')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Aerolinea entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('EmisionesBundle:Aerolinea:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"private function createEditForm(EFamilia $entity) {\n $form = $this->createForm(new EFamiliaType(), $entity, array(\n 'action' => $this->generateUrl('familia_update', array('id' => $entity->getId())),\n 'method' => 'post',\n ));\n\n return $form;\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MaithPumpMyGasBundle:FuelData')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find FuelData entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MaithPumpMyGasBundle:FuelData:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BackendBundle:Gasto')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Gasto entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BackendBundle:Gasto:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('GestionUserBundle:Prof')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Prof entity.');\n }\n\n $editForm = $this->createForm(new ProfType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('GestionUserBundle:Prof:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make generates an instance | public static function make(); | [
"public function make()\n {\n }",
"public function generateClass();",
"function generate() {\n\n if ($this->namespace) {\n $fqcn = $this->namespace.'\\\\'.$this->className;\n }\n else {\n $fqcn = $this->className;\n }\n\n $this->addProperties();\n $this->addConstructorMethod();\n $this->addSetAPIMethod();\n $this->addSetParameterMethod();\n $this->addCheckScopeMethod();\n $this->addAccessorMethods();\n $this->addFilteredParameterMethod();\n $this->addCreateRequestMethod();\n $this->addCreateAndExecuteMethod();\n $this->addCallMethod();\n \n $this->addExecuteMethod();\n $this->addExecuteAsyncMethod();\n $this->addDispatchMethod();\n $this->addDispatchAsyncMethod();\n $this->addProcessResponseMethod();\n //$this->addIsErrorResponseMethod();\n $this->addShouldResponseBeProcessedMethod();\n $this->addTranslateResponseToExceptionMethod();\n $this->addShouldUseCachedResponseMethod();\n $this->addShouldResponseBeCachedMethod();\n $this->addSetOriginalResponseMethod();\n $this->addGetOriginalResponseMethod();\n $this->addGetResultInstantiationInfoMethod();\n\n $this->classGenerator->setImplementedInterfaces(['ArtaxServiceBuilder\\Operation']);\n $this->classGenerator->setFQCN($fqcn);\n $text = $this->classGenerator->generate();\n saveFile($this->outputPath, $fqcn, $text);\n }",
"private function generate_object()\n {\n }",
"public static function create();",
"public function generate()\r\n {\r\n $method = substr($this->kind, 5);\r\n $args = array();\r\n\r\n if (strstr($method, '|')) {\r\n $parts = explode('|', $method);\r\n $method = array_shift($parts);\r\n\r\n if ($parts[0] === 'factory' && count($parts) > 1) {\r\n $args[] = $this->factory($parts[1]);\r\n } else {\r\n $args[] = FactoryMuffin::generateAttr(implode('|', $parts), $this->object);\r\n }\r\n }\r\n\r\n return $this->execute($method, $args);\r\n }",
"public static function generate()\n {\n return FakeFactory::create();\n }",
"public function createObjectInstance();",
"public function createCreateur()\n {\n $class = $this->getClass();\n $createur = new $class;\n\n return $createur;\n }",
"public function make(): object\n {\n return $this->reflected->newInstanceWithoutConstructor();\n }",
"public function newInstance()\n {\n return $this->newInstanceArgs(func_get_args());\n }",
"public static function make() : self\n {\n return new static(new PreloaderCompiler, new PreloaderLister, new Opcache);\n }",
"function create_model () {\n\t\t$file_content = file_get_contents('generator/GeneratedObject.php');\n\n\t\t// replace names\n\t\t$file_content = $this->replace_names($file_content);\n\n\t\t// replace class properties\n\t\t$content = '';\n\t\tforeach ($this->columns as $name => $type) {\n\t\t\t$content .= '\tpublic $'.$name.';'.PHP_EOL;\n\t\t}\n\t\t$file_content = str_replace('\t// generator property hook', rtrim($content, PHP_EOL), $file_content);\n\n\t\t// replace binded parameters\n\t\t$content = '';\n\t\tforeach ($this->columns as $name => $type) {\n\t\t\tif ($type != 'ai') {\n\t\t\t\t$content .= '\t\t$stm->bindParam(\\':'.$name.'\\', $this->'.$name.');'.PHP_EOL;\n\t\t\t}\n\t\t}\n\t\t$file_content = str_replace('\t\t// generator bind hook', rtrim($content, PHP_EOL), $file_content);\n\n\t\t// replace query insert columns\n\t\t$content = [];\n\t\tforeach ($this->columns as $name => $type) {\n\t\t\tif ($type != 'ai') {\n\t\t\t\t$content[] = '`'.$name.'`';\n\t\t\t}\n\t\t}\n\t\t$file_content = str_replace('{$generator_insert_columns}', implode(', ', $content), $file_content);\n\n\t\t// replace query insert values\n\t\t$content = [];\n\t\tforeach ($this->columns as $name => $type) {\n\t\t\tif ($type != 'ai') {\n\t\t\t\t$content[] = ':'.$name;\n\t\t\t}\n\t\t}\n\t\t$file_content = str_replace('{$generator_insert_values}', implode(', ', $content), $file_content);\n\n\t\t// replace query update values\n\t\t$content = [];\n\t\tforeach ($this->columns as $name => $type) {\n\t\t\tif ($type != 'ai') {\n\t\t\t\t$content[] = '`'.$name.'`=:'.$name;\n\t\t\t}\n\t\t}\n\t\t$file_content = str_replace('{$generator_update_values}', implode(', ', $content), $file_content);\n\n\t\t// create new class file with content\n\t\tfile_put_contents('app/models/'.$this->name['class'].'.php', $file_content);\n\t}",
"public function createNewGeneration(): GenerationInterface;",
"protected function makeController() {\n\t\t$cg = new ControllerGenerator($this->files, $this->command);\n\t\t$cg->generate($this->name, $this->schema);\n\t}",
"public static function make()\n {\n return mezzo()->module(static::class);\n }",
"private function createInstance()\n {\n return new Meta( $this->viewFactory, $this->htmlBuilder, $this->bladeCompiler, $this->configRepository );\n }",
"private static function _createClassGenerate() {\n\t\t$file = 'class.generate.php';\n\t\t\n\t\t$data = self::_getFileHeader('Generate class for module '.self::$_par['mname']).'\n\t\t\nclass generate'.self::$_par['mucft'].' {\n\t\t\n\tpublic function __construct() {\n\t\t\n\t}\n\t\n}\n?>';\n\t\treturn wgIo::writeFile(self::$_par['mpath'].$file, $data);\n\t}",
"public function generate()\n {\n global $argv;\n\n $parameters = $this->parse_cmdline($argv);\n if(count($parameters) < 1)\n {\n $this->help();\n return;\n }\n\n $class = array_shift($parameters);\n $gc = $this->get_gadget_chain($class);\n\n if(@$this->arguments['informations'])\n {\n $this->o($gc, 2);\n $this->o($this->_get_command_line_gc($gc));\n }\n else\n {\n $parameters = $this->get_type_parameters($gc, $parameters);\n $generated = $this->serialize($gc, $parameters);\n print($generated . \"\\n\");\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set validation callable for interfaces Validator callable must accept two parameters: a string of the normalized name of the checked element, and the PHPSandbox instance. NOTE: Normalized interface names are lowercase | public function setInterfaceValidator(callable $callable) : self {
$this->validation['interface'] = $callable;
return $this;
} | [
"public function setValidationCallback(callable $callback);",
"public function setValidator($validator);",
"public function addValidator( InterfaceValidator $pValidator );",
"public function registerValidator($callable = null) {\n $this->_validators[] = $callable;\n }",
"function SetValidator(wxValidator $validator){}",
"public function setFuncValidator(callable $callable) : self {\n $this->validation['function'] = $callable;\n return $this;\n }",
"public function setValidator(Validator $validator);",
"public function addValidator(\\Phalcon\\Validation\\ValidatorInterface $validator);",
"public function createValidator() : IValidator;",
"public function getValidatorInstance();",
"public function createValidator();",
"public function addValidator(\\Phalcon\\Filter\\Validation\\ValidatorInterface $validator): ElementInterface;",
"abstract protected function getValidatorInstance();",
"public function getValidationFactory(): callable {\n return $this->validationFactory;\n }",
"public function setTraitValidator(callable $callable) : self {\n $this->validation['trait'] = $callable;\n return $this;\n }",
"public function setSuccessValidator($validator);",
"public function setParent(ValidatorInterface $parent);",
"public function HasValidator ($validatorNameOrInstance);",
"public function validate() {\n if (isset($this->options['validator']) && is_callable($this->options['validator'])) {\n $this->options['validator']();\n } else {\n $this->type->validate();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes a DataCentrohipico entity. | public function deleteAction(Request $request, $id)
{
/*$form = $this->createDeleteForm($id);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('CentrohipicoBundle:DataCentrohipico')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find DataCentrohipico entity.');
}
$em->remove($entity);
$em->flush();
}*/
return $this->redirect($this->generateUrl('datacentrohipico'));
} | [
"public function deleted(Contato $contato)\n {\n //\n }",
"public function delete($costo);",
"public function delete(){\n $sql = \"delete from curso where id=:id\";\n\n $stmt = $this->conexao->prepare($sql);\n\n $stmt->bindValue(':id',$this->id);\n\n try{\n $stmt->execute();\n } catch(PDOException $e){\n throw $e;\n }\n }",
"public function delete($entity);",
"final protected function eliminar(){\n\t\tif($this -> empresa != null){\n\t\t\tthrow new Exception('Empresa sin datos');\n\t\t}\n\t\tDataAccess::delete($this -> empresa);\t\n\t}",
"public function Delete()\n\t{\n\t\ttry\n\t\t{\n\t\t\t\t\t\t\n\t\t\t// TODO: if a soft delete is prefered, change this to update the deleted flag instead of hard-deleting\n\n\t\t\t$pk = $this->GetRouter()->GetUrlParam('id');\n\t\t\t$descricao_fisica = $this->Phreezer->Get('descricao_fisica',$pk);\n\n\t\t\t$descricao_fisica->Delete();\n\n\t\t\t$output = new stdClass();\n\n\t\t\t$this->RenderJSON($output, $this->JSONPCallback());\n\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\t\t\t$this->RenderExceptionJSON($ex);\n\t\t}\n\t}",
"public function delete () {\n $this->db->delete('disciplinas', array('iddisciplina' => $this->iddisciplina));\n }",
"public function deleteAction(Request $request)\n {\n \n $em = $this->getDoctrine()->getManager();\n $idProducto = $request->request->get ( 'idProducto' );\n $entity = $em->getRepository('CarniceriaBundle:Carro')->find($idProducto);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Carro entity.');\n }\n\n $em->remove($entity);\n $em->flush();\n \n\n return new Response(\"Exito\");\n }",
"public function delete(Entity $entity);",
"public function deleteAction(Request $request, $id)\n {\n $form = $this->createDeleteForm($id);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('BackendBundle:Centro')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Centro entity.');\n }\n\n $em->remove($entity);\n $em->flush();\n }\n\n return $this->redirect($this->generateUrl('centro'));\n }",
"public function deleteAction(Request $request, $id)\n {\n $form = $this->createDeleteForm($id);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('VictoriaAppBundle:DatosCentrosVotacion')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find DatosCentrosVotacion entity.');\n }\n\n $em->remove($entity);\n $em->flush();\n }\n\n return $this->redirect($this->generateUrl('datoscentrosvotacion'));\n }",
"public function delete()\n {\n $this->getService()->delete($this);\n }",
"public function delete() {\r\n\r\n $sql = $this->db->quoteInto(\"o_id = ?\", $this->model->getObjectId());\r\n\r\n // $sql = \"o_id = \" . $this->model->getObjectId();\r\n Logger::debug(\"query= \" . $sql);\r\n $this->db->delete($this->getTableName(), $sql);\r\n }",
"public function delete($indicador);",
"public function delete($concepto_cumplimiento);",
"public function delete($entity) {\n\t\t$class = $this->_class;\n\t\tif (!$entity->getLocalUniqueIdentifier())\n\t\t\tthrow new Exception(\"cannot delete entity which doesn't have an ID value\");\n\t\t\n\t\t$idArray = $entity->getId();\n\t\tif (!is_array($idArray))\n\t\t\t$idArray = array($entity::getIdField() => $idArray);\n\t\t\n\t\tunset($this->_cachedEntities[$entity->getLocalUniqueIdentifier()]);\n\t\t$this->_connection->delete($class, $idArray);\n\t}",
"public function delete($majoraEntitys);",
"public function delete($cpu){\n $id=$cpu->getId();\n\n try {\n $sql =\"DELETE FROM `cpu` WHERE `id`='$id'\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }",
"public function delete($tipodonacion);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.