query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
sequencelengths
0
30
negative_scores
sequencelengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
return boolean as string 'true' / 'false'
function bool2str($bool) { if($bool ===false) return 'false'; else return 'true'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bool_s($boolean) {\n\treturn ($boolean ? 'true' : 'false');\n}", "public static function strbool($bool){\r\n return ($bool) ? \"true\" : \"false\";\r\n }", "function format_bool(mixed $input): string\n{\n return $input ? 'true' : 'false';\n}", "function bool_to_string($value) {\n return $value ? 'true' : 'false';\n }", "private function boolean(bool $value): string\n {\n return $value ? 'true' : 'false';\n }", "public function getBooleanString($tf);", "function b2s($b) {\n return ($b) ? 'TRUE' : 'FALSE';\n}", "function stage_bool_to_string($bool)\n{\n if (! is_bool($bool)) {\n $bool = wc_string_to_bool($bool);\n }\n return true === $bool ? 'yes' : 'no';\n}", "public function boolToStr($boolean)\n {\n return ($boolean === true) ? 'true' : 'false';\n }", "public function toBoolean()\n {\n $key = $this->toLowerCase()->str;\n $map = array(\n 'true' => true,\n '1' => true,\n 'on' => true,\n 'yes' => true,\n 'false' => false,\n '0' => false,\n 'off' => false,\n 'no' => false,\n );\n\n if (array_key_exists($key, $map)) {\n return $map[$key];\n } elseif (is_numeric($this->str)) {\n return ((int) $this->str > 0);\n } else {\n return (bool) $this->regexReplace('[[:space:]]', '')->str;\n }\n }", "protected function bool2str($bool) {\n return ($bool) ? 'TRUE' : 'FALSE';\n }", "private function boolToString ($value)\n\t{\n\t\tif (true === $value)\n\t\t{\n\t\t\treturn 'true';\n\t\t}\n\t\telseif (false === $value)\n\t\t{\n\t\t\treturn 'false';\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn $value;\n\t\t}\n\t}", "function toBoolean(){\n\t\tif(in_array($this->lower(),array('','false','off','no','n','f'))){\n\t\t\treturn false;\n\t\t}\n\t\treturn (bool)$this->toString();\n\t}", "public static function booleanToString($obj)\n {\n return $obj ? 'true' : 'false';\n }", "private static function bool2str($v)\n {\n //convert boolean to text value.\n $v = $v === true ? 'true' : $v;\n $v = $v === false ? 'false' : $v;\n return $v;\n }", "function bool_str($value) {\r\n if ($value) {\r\n return 'yes'; \r\n } else {\r\n return 'no';\r\n }\r\n}", "function bool2str($data)\n {\n TRUE === $data && $data = 'true';\n FALSE === $data && $data = 'false';\n return $data;\n }", "public static function boolToString($value)\n {\n $value = $value === true ? 'true' : $value;\n $value = $value === false ? 'false' : $value;\n return $value;\n }", "public function booleanString($var)\n {\n return is_bool($var)\n ? ($var ? 'True' : 'False')\n : $var;\n }", "public static function bool2str(bool $boolean = true): string\n {\n if ($boolean === false) {\n return 'FALSE';\n } else {\n return 'TRUE';\n }\n }", "public static function boolean()\n {\n return self::builtinType('bool');\n }", "private function dbFeedBack($bool){\n if($bool == FALSE){\n //display '0' as false\n return \"{0}\"; \n }\n else{\n //display 1 as true\n return \"{1}\";\n } \n }", "public function testToStringWithBooleanValueTrue()\n\t{\n\t // initialize a new Boolean instance\n\t $boolean = new TechDivision_Lang_Boolean(true);\n\t\t// check that the two booleans are equal\n\t\t$this->assertEquals('true', $boolean->__toString());\n\t}", "public function getBooleanFormatForQueryString(): string\n {\n return $this->booleanFormatForQueryString;\n }", "function message($boolValue) {\n\tif($boolValue) {\n\t\techo \"TRUE: \";\n\t} else {\n\t\techo \"FALSE: \";\n\t}\n\techo \"GOT value as \", (int)$boolValue, \"\\n\";\n}", "public static function boolean() {}", "abstract public function escapeBoolean($bool);", "function get_bool_or_null($value)\r\n{\r\n $temp = null ;\r\n\r\n if(is_null($value)){\r\n\r\n $temp .= \"<code style='font_size: 9px ; color:#3465a4 '>\" . PHP_EOL ;\r\n \r\n $temp .= 'null' . PHP_EOL;\r\n \r\n $temp .= \"</code><br>\"; \r\n\r\n }else if(is_bool($value)){\r\n $temp .= '<code style=\"font_size: 10px\">boolean </code>';\r\n \r\n $temp .= \"<code style='font_size: 9px ; color:#75507b '>\" . PHP_EOL ;\r\n \r\n $temp .= $value == true ? 'true' : 'false' . PHP_EOL;\r\n \r\n $temp .= \"</code><br>\";\r\n \r\n }\r\n\r\n return $temp ;\r\n}", "public function testToStringWithBooleanValueFalse()\n\t{\n\t // initialize a new Boolean instance\n\t $boolean = new TechDivision_Lang_Boolean(false);\n\t\t// check that the two boolean are equal\n\t\t$this->assertEquals('false', $boolean->__toString());\n\t}", "public static function plainBoolean($value)\n {\n if ($value === true) {\n return 'Yes';\n } elseif ($value === false) {\n return 'No';\n }\n\n return '---';\n }" ]
[ "0.80348504", "0.80206877", "0.78751075", "0.7846424", "0.76890635", "0.7611359", "0.7559533", "0.7543506", "0.7523593", "0.75164706", "0.74617386", "0.7412224", "0.7410573", "0.7393141", "0.73901856", "0.7379897", "0.73708546", "0.7250726", "0.7164452", "0.71530366", "0.7104408", "0.7081321", "0.7046958", "0.7023631", "0.6972632", "0.69654894", "0.6918694", "0.68982095", "0.68366355", "0.68304795" ]
0.8142804
0
compare two objects. Arguments are passed byreference test: equals, not equal, equal identity, not equal identity
function compareObjects(&$ob1, &$ob2) { print_pre('o1 == o2 : ' . bool2str($ob1 == $ob2)); print_pre('o1 != o2 : ' . bool2str($ob1 != $ob2)); print_pre('o1 === o2 : ' . bool2str($ob1 === $ob2)); print_pre('o1 !== o2 : ' . bool2str($ob1 !== $ob2)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function equals($other);", "public function equals( $A, $B );", "public function equals($other) { return $this->obj==Sandbox::unwrap($other); }", "protected function compareObjects(object $a, object $b): int\n {\n // see https://github.com/php/php-src/issues/10513\n return strcmp(spl_object_hash($a), spl_object_hash($b));\n }", "public function equals($obj): bool;", "public function testEquality()\n {\n $m1 = new BigMoney(Decimal::fromInteger(100), new Currency('EUR'));\n $m2 = new BigMoney(Decimal::fromInteger(100), new Currency('EUR'));\n $m3 = new BigMoney(Decimal::fromInteger(100), new Currency('USD'));\n $m4 = new BigMoney(Decimal::fromInteger(50), new Currency('EUR'));\n\n $this->assertTrue($m1->equals($m2));\n $this->assertFalse($m1->equals($m3));\n $this->assertFalse($m1->equals($m4));\n }", "function o_eq($a, $b) {\n\t\t\treturn Obj::singleton()->equal($a, $b);\n\t\t}", "public static function compare($a,$b);", "public function testCmpart()\n {\n $oA = new stdClass();\n $oA->cnt = 10;\n\n $oB = new stdClass();\n $oB->cnt = 10;\n\n $this->assertTrue(cmpart($oA, $oB) == 0);\n\n $oA->cnt = 10;\n $oB->cnt = 20;\n\n $this->assertTrue(cmpart($oA, $oB) == -1);\n }", "abstract protected function compare($idA, $idB);", "public function equals()\n {\n $this->assertTrue($this->stubRefProperty->equals($this->stubRefProperty));\n $stubRefProperty1 = new stubReflectionProperty('stubTestProperty1', 'property');\n $stubRefProperty2 = new stubReflectionProperty('stubTestProperty1', 'anotherProperty');\n $this->assertTrue($this->stubRefProperty->equals($stubRefProperty1));\n $this->assertTrue($stubRefProperty1->equals($this->stubRefProperty));\n $this->assertFalse($this->stubRefProperty->equals($stubRefProperty2));\n $this->assertFalse($this->stubRefProperty->equals('foo'));\n $this->assertFalse($stubRefProperty2->equals($this->stubRefProperty));\n }", "public function equals(Object $obj = null);", "protected abstract function _equals( N $other );", "function equals($x, $y);", "public function compare();", "public function equals(Object $object);", "function isEqual ( &$anObject ) {\n \t\treturn $this->isEqualTo($anObject);\n \t}", "public function scompare($o = null) {}", "function equals($a, $b){\n\tif (method_exists($a, 'equals'))\n\t\treturn $a->equals($b);\n\telse\n\t\treturn $a===$b;\n}", "abstract protected function _compare($val1, $val2);", "public function Equals___T($other);", "function test_equals($a, $b) {\n\treturn $a == $b;\n}", "public function isEqualProvider()\n {\n // Declare attributes\n $objA = new stdClass();\n $objA->foo = 'bar';\n \n $objB = new stdClass();\n \n $objC = new stdClass;\n $objC->foo = 'bar';\n $objC->int = 1;\n $objC->array = array(0, array(1), array(2), 3);\n $objC->related = new stdClass;\n $objC->self = $objC;\n $objC->c = $objC;\n \n $objD = new stdClass;\n $objD->foo = 'bar';\n $objD->int = 2;\n $objD->array = array(0, array(4), array(2), 3);\n $objD->related = new stdClass;\n $objD->self = $objD;\n $objD->c = $objC;\n \n return array(\n // Integers\n array(1, 0, <<<EOF\nFailed asserting that 0 matches expected 1.\nEOF\n ),\n \n // Integer and Double\n array(1.1, 0, <<<EOF\nFailed asserting that 0 matches expected 1.1.\nEOF\n ),\n \n // Chars\n array('a', 'b', <<<EOF\nFailed asserting that two strings are equal.\n\n- Expected \n+ Actual \n\n-'a'\n+'b'\nEOF\n ), \n \n // Integer and Array\n array(1, array(0), <<<EOF\nArray (...) does not match expected type \"integer\".\nEOF\n ),\n \n // Array and Integer\n array(array(0), 1, <<<EOF\n1 does not match expected type \"array\".\nEOF\n ),\n \n // Array and Array\n array(array(0), array(1), <<<EOF\nFailed asserting that two arrays are equal.\n\n- Expected \n+ Actual \n\n Array (\n- 0 => 0\n+ 0 => 1\n )\nEOF\n ),\n \n // Boolean and boolean as string\n array(array(TRUE), array('true'), <<<EOF\nFailed asserting that two arrays are equal.\n\n- Expected \n+ Actual \n\n Array (\n- 0 => true\n+ 0 => 'true'\n )\nEOF\n ),\n \n // Nested arrays\n array(array(0, array(1), array(2), 3), array(0, array(4), array(2), 3), <<<EOF\nFailed asserting that two arrays are equal.\n\n- Expected \n+ Actual \n\n Array (\n 0 => 0\n 1 => Array (\n- 0 => 1\n+ 0 => 4\n )\n 2 => Array (\n 0 => 2\n )\n 3 => 3\n )\nEOF\n ),\n \n \n // Object and Array\n array($objA, array(23), <<<EOF\nArray (...) does not match expected type \"object\".\nEOF\n ), \n\n // Array and Object\n array(array(23), $objA, <<<EOF\nstdClass Object (...) does not match expected type \"array\".\nEOF\n ), \n \n // Object and Object\n array($objA, $objB, <<<EOF\nFailed asserting that two objects are equal.\n\n- Expected \n+ Actual \n\n stdClass Object (\n- 'foo' => 'bar'\n )\nEOF\n ),\n \n // Complex objects\n array($objC, $objD, <<<EOF\nFailed asserting that two objects are equal.\n\n- Expected \n+ Actual \n\n stdClass Object (\n 'foo' => 'bar'\n- 'int' => 1\n+ 'int' => 2\n 'array' => Array (\n 0 => 0\n 1 => Array (\n- 0 => 1\n+ 0 => 4\n )\n 2 => Array (\n 0 => 2\n )\n 3 => 3\n )\n 'related' => stdClass Object ()\n 'self' => stdClass Object (\n 'foo' => 'bar'\n- 'int' => 1\n+ 'int' => 2\n 'array' => Array (\n 0 => 0\n 1 => Array (\n- 0 => 1\n+ 0 => 4\n )\n 2 => Array (\n 0 => 2\n )\n 3 => 3\n )\n 'related' => stdClass Object ()\n 'self' => stdClass Object (*RECURSION*)\n- 'c' => stdClass Object (*RECURSION*)\n+ 'c' => stdClass Object (\n+ 'foo' => 'bar'\n+ 'int' => 1\n+ 'array' => Array (\n+ 0 => 0\n+ 1 => Array (\n+ 0 => 1\n+ )\n+ 2 => Array (\n+ 0 => 2\n+ )\n+ 3 => 3\n+ )\n+ 'related' => stdClass Object ()\n+ 'self' => stdClass Object (*RECURSION*)\n+ 'c' => stdClass Object (*RECURSION*)\n+ )\n )\n 'c' => stdClass Object (\n 'foo' => 'bar'\n 'int' => 1\n 'array' => Array (\n 0 => 0\n 1 => Array (\n 0 => 1\n )\n 2 => Array (\n 0 => 2\n )\n 3 => 3\n )\n 'related' => stdClass Object ()\n 'self' => stdClass Object (*RECURSION*)\n 'c' => stdClass Object (*RECURSION*)\n )\n )\nEOF\n \n ),\n );\n }", "function cmp_obj($a, $b)\r\n {\r\n $al = $a->Top;\r\n $bl = $b->Top;\r\n if ($al == $bl) {\r\n return 0;\r\n }\r\n return ($al > $bl) ? +1 : -1;\r\n }", "function comparator($object1, $object2) {\n\t\t\treturn $object1->amount < $object2->amount; \n\t\t}", "public function testInvokeReturnsTrueIfIntegersAreEqual()\n\t{\n $this->assertTrue((new AlmostEquals())(1, 1));\n \n return;\n\t}", "function isEqualTo ( &$anObject ) {\n \t\treturn ($this === $anObject);\n \t}", "public function compareTo($other);", "public function equals($arg);", "public function shouldEqual($expected) {}" ]
[ "0.6673335", "0.65883684", "0.6582047", "0.6493526", "0.6361353", "0.6307741", "0.62992543", "0.6271147", "0.6259657", "0.62595", "0.62512934", "0.6212965", "0.62024915", "0.614383", "0.61387986", "0.60835725", "0.6081624", "0.60350287", "0.6030523", "0.60098636", "0.6003072", "0.5957396", "0.59422326", "0.5878123", "0.5871505", "0.58714783", "0.58631766", "0.58579063", "0.5837966", "0.58190906" ]
0.7712369
0
Check initial states exists
public function hasInitial() { return !empty($this->initialStates); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isInitial();", "public function isInitialised();", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(4);\n }", "abstract protected function checkInitialization();", "public function hasState() {\n return $this->_has(4);\n }", "public static function resetInit() {\r\n $result = true;\r\n $shops = Shop::getShops(false, null, true);\r\n foreach ($shops as $id_shop) {\r\n $result &= Configuration::updateValue(GEAR_NAME.'_init', false, false, null, $id_shop);\r\n }\r\n return $result;\r\n }", "public function is_initialized()\n {\n }", "function _loadState()\n\t{\n\n\t\tif (empty($this->_state))\n\t\t{\n\n\t\t\t// current state info\n\t\t\t$query = 'SELECT c.*, ' .\n\t\t\t\t' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\\':\\', c.id, c.alias) ELSE c.id END as slug '.\n\t\t\t\t' FROM #__ezrealty_state AS c' .\n\t\t\t\t' WHERE c.id = '. (int) $this->_id ;\n\t\t\t$this->_db->setQuery($query, 0, 1);\n\t\t\t$this->_state = $this->_db->loadObject();\n\n\t\t}\n\t\treturn true;\n\t}" ]
[ "0.6860986", "0.6655938", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.6500065", "0.64040065", "0.6381777", "0.6243098", "0.61433", "0.6128225" ]
0.76447755
0
Check final states exists
public function hasFinal() { return !empty($this->finalStates); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasState(){\n return $this->_has(4);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasFinishState(){\n return $this->_has(5);\n }", "public function hasState() {\n return $this->_has(4);\n }", "public function isFinalState(): bool {\n return $this->finalState;\n }", "public function isNewStates()\n {\n if ($this->isNonexistent) return false;\n\n return !!$this->countNewStates();\n }", "public function hasInitial()\n {\n return !empty($this->initialStates);\n }", "function check_state_conflict($expected)\n{\n global $STATE_FILE;\n\n // get current state\n $cur_state = trim( file_get_contents($STATE_FILE) );\n\n if($cur_state === $expected)\n {\n return false;\n }\n else\n {\n return true;\n }\n}", "public function hasTargetState($state);" ]
[ "0.6827876", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.67381245", "0.6729427", "0.6569009", "0.63520217", "0.62565976", "0.5986576", "0.5875941" ]
0.7345255
0
Get all final states
public function getFinal() { return $this->hasFinal() ? array_values($this->finalStates) : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStates() {\n return $this->state;\n }", "abstract public function states();", "public function getStates(): array\n {\n return $this->states;\n }", "public function getStates(): StateSet;", "public function getStates() {\n\t\treturn empty( $this->container['states'] ) ? null : $this->container['states'];\n\t}", "protected function state_all() {\n return $this->_views->all_json();\n }", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getStates() {\n return $this->createQuery()\n ->select(\"DISTINCT c.state\")\n ->from(\"Companies_Model_Company c\")\n ->whereIn(\"c.status\", Companies_Model_Company::getActiveStatuses())\n ->andWhere(\"c.local_business\")\n ->orderBy(\"c.state ASC\")\n ->execute(array(), Doctrine_Core::HYDRATE_SCALAR);\n }", "public function getAllStates() {\n $states = [];\n $values = DB::table(self::TABLE_NAME)\n ->select([self::C_STATE, self::C_STATE_FULL_NAME])\n ->distinct()\n ->where('region', '!=', \" \")\n ->orderBy(self::C_STATE)\n ->get();\n\n foreach ($values as $value) {\n $states[$value->state] = $value->stateFullName;\n }\n\n return $states;\n }", "public function fetchAll()\n\t{\n\t\t$states = $this->getStatesModel()->fetchAll();\n\t\treturn $states;\n\t}", "public function getNextStates()\n {\n return $this->nextStates;\n }", "public function getStateList() {\n $states = State::latest()->paginate(10);\n return $states;\n }", "public function getState() {}", "public function getState() {}", "public function getState() {}", "final public function getState() {\n return $this->state;\n }", "public static function getStates() {\n $db = Zend_Registry::get('dbAdapterReadOnly');\n $select = $db->select()\n ->from(array('ps' => 'printer_states'))\n ->order('ps.id');\n\n return $db->fetchAll($select);\n }" ]
[ "0.67806", "0.6576226", "0.6572894", "0.65708417", "0.6479763", "0.6455002", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.6399605", "0.63985413", "0.63791454", "0.6315753", "0.63057804", "0.63030994", "0.63029367", "0.6302337", "0.62340856", "0.61877584" ]
0.7338602
0
Check normal states exists
public function hasNormal() { return !empty($this->normalStates); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(4);\n }", "function validstates($state)\n{\n global $f3;\n return in_array($state, $f3->get('states'));\n}", "public function hasState() {\n return $this->_has(4);\n }", "public function hasInitial()\n {\n return !empty($this->initialStates);\n }", "public function isNewStates()\n {\n if ($this->isNonexistent) return false;\n\n return !!$this->countNewStates();\n }", "function validState($state)\r\n {\r\n return in_array($state, $this->_dataLayer->getStates());\r\n }", "abstract public function states();", "public function isNormal() {\n return $this->getStatus() === Status::NORMAL;\n }" ]
[ "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.64594126", "0.6358058", "0.62889266", "0.62737095", "0.6157419", "0.6120505", "0.60137266", "0.580777" ]
0.69411725
0
Get all normal states
public function getNormal() { return $this->hasNormal() ? array_values($this->normalStates) : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStates(): array\n {\n return $this->states;\n }", "public function getStates() {\n return $this->state;\n }", "public function getAllStates() {\n $states = [];\n $values = DB::table(self::TABLE_NAME)\n ->select([self::C_STATE, self::C_STATE_FULL_NAME])\n ->distinct()\n ->where('region', '!=', \" \")\n ->orderBy(self::C_STATE)\n ->get();\n\n foreach ($values as $value) {\n $states[$value->state] = $value->stateFullName;\n }\n\n return $states;\n }", "public static function getStates() {\n $db = Zend_Registry::get('dbAdapterReadOnly');\n $select = $db->select()\n ->from(array('ps' => 'printer_states'))\n ->order('ps.id');\n\n return $db->fetchAll($select);\n }", "abstract public function states();", "public function getStates() {\n return $this->createQuery()\n ->select(\"DISTINCT c.state\")\n ->from(\"Companies_Model_Company c\")\n ->whereIn(\"c.status\", Companies_Model_Company::getActiveStatuses())\n ->andWhere(\"c.local_business\")\n ->orderBy(\"c.state ASC\")\n ->execute(array(), Doctrine_Core::HYDRATE_SCALAR);\n }", "public function fetchAll()\n\t{\n\t\t$states = $this->getStatesModel()->fetchAll();\n\t\treturn $states;\n\t}", "public function getStateList() {\n $states = State::latest()->paginate(10);\n return $states;\n }", "public function getStates(): StateSet;", "public function getStates() {\n\t\treturn empty( $this->container['states'] ) ? null : $this->container['states'];\n\t}", "public function getFromStates() {\n return $this->fromStates;\n }", "public static function get_all_states()\n {\n $query = new Query;\n return $query->select(['core_states.*','core_zones.zone_name'])->from('core_states')\n ->innerJoin('core_zones','core_states.zone_id = core_zones.zone_id')\n ->orderBy(['core_states.state_name' => SORT_ASC])->All();\n }", "public static function getStates()\n {\n return array('ACTIVE', 'DISABLED', 'DELETED');\n }", "function getStates(){\n\t\tApp::import('Model', 'State');\n\t\t$this->State = new State();\n\t\t$stateArr = array();\n\t\t$stateArr = $this->State->find('list',array(\n\t\t\t'fields'=>array('State.state_code','State.name'),\n\t\t\t'order'=>array('State.name')\n\t\t\t));\n\t\treturn $stateArr;\n\t}", "public static function us_states(): array\n\t{\n\t\treturn ArrayLists::us_states();\n\t}", "public function state(): array;", "protected function state_all() {\n return $this->_views->all_json();\n }", "public function getStateList()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('state');\n\t\t$this->db->where('state_status', '1');\n\t\t$query = $this->db->get();\n\t\treturn $query->result() ;\n\t}", "public function getStatesList() {\n \t$user = Auth::user();\n \t$states = $user->states->sortBy('type_id');\n \treturn $states;\n }", "public function getStates() {\n\t\t$statement = $this->database->prepare(\"SELECT * FROM tbl_state\");\n\t\t$statement->execute();\n\t\t$results = $statement->fetchAll(PDO::FETCH_ASSOC);\n\n\t\treturn $results ? $results : false;\n\t}", "public function enumStates()\n {\n $rVal = [];\n foreach ($this->xml->xpath('state') as $node) {\n $rVal[] = (string)$node[0]->attributes()->value;\n }\n\n return $rVal;\n }", "function getstates() {\n\t\t$sql = Processwire\\wire('database')->prepare(\"SELECT abbreviation as state, name FROM states\");\n\t\t$sql->execute();\n\t\treturn $sql->fetchAll(PDO::FETCH_ASSOC);\n\t}", "public function getStateList()\r\n\t{\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from('state');\r\n\t\t$this->db->where('state_status', '1');\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->result() ;\r\n\t}", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();" ]
[ "0.647964", "0.6424091", "0.63932616", "0.62895477", "0.6230935", "0.6228826", "0.62103736", "0.61879295", "0.6147332", "0.6135253", "0.61041045", "0.6073023", "0.605905", "0.5990167", "0.5959515", "0.59104687", "0.58974403", "0.5879883", "0.5875688", "0.58569294", "0.58413947", "0.58405256", "0.5835847", "0.5830262", "0.5830262", "0.5830262", "0.5830262", "0.5830262", "0.5830262", "0.5830262" ]
0.70630133
0
Creates a form to delete a role entity.
private function createDeleteForm(Roles $role) { return $this->createFormBuilder() ->setAction($this->generateUrl('back_roles_delete', array('id' => $role->getId()))) ->setMethod('DELETE') ->getForm() ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createDeleteForm(Role $role)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('role_delete', array('id' => $role->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "public function deleteRolesAction(){\n \n $request = $this->getRequest();\n \n if(! isset($request->id)) {\n // TODO Massege (Helper bauen??!)\n $this->_helper->messenger('error', \n Zend_Registry::get('config')->messages->role->invalid);\n return $this->_redirect('/admin/role');\n }\n \n $entity = 'Jbig3\\Entity\\RolesEntity';\n $repositoryFunction = 'findOneById';\n \n $role = $this->em->getRepository($entity)->$repositoryFunction($request->id);\n \n if($role !== null) {\n // TODO Cascade - hier anders gelöst (Kinder vorher manuell löschen)\n if(count($role->rules)) {\n // Masseges\n $this->_helper->messenger('error', \n 'Unable to remove group. Please remove dependencies first (Manual)');\n return $this->_redirect('/admin/role');\n }\n \n $roleName = $role->name;\n \n $this->em->remove($role);\n $this->em->flush();\n \n // TODO Masseges\n $this->_helper->messenger('success', \n sprintf(Zend_Registry::get('config')->messages->role->delete, $roleName));\n return $this->_redirect('/admin/role');\n } else {\n // TODO Masseegs\n $this->_helper->messenger('success', \n Zend_Registry::get('config')->messages->role->invalid);\n return $this->_redirect('/admin/role');\n }\n }", "public function actionDeleteRole ()\n\t\t{\n\n\t\t\t$auth = Yii::$app->getAuthManager();\n\t\t\t$role = $auth->getRole(Yii::$app->request->get('id'));\n\t\t\t$auth->remove($role);\n\t\t\t$url = Yii::$app->request->referrer . '#roles';\n\t\t\tYii::$app->response->redirect($url);\n\n\t\t\tYii::$app->end();\n\t\t}", "function uc_roles_deletion_form($form, &$form_state, $account, $rid) {\n $expiration = db_query(\"SELECT expiration FROM {uc_roles_expirations} WHERE uid = :uid AND rid = :rid\", array(':uid' => $account->uid, ':rid' => $rid))->fetchField();\n if ($expiration) {\n\n $role_name = _uc_roles_get_name($rid);\n\n $form['user'] = array('#type' => 'value', '#value' => format_username($account->name));\n $form['uid'] = array('#type' => 'value', '#value' => $account->uid);\n $form['role'] = array('#type' => 'value', '#value' => $role_name);\n $form['rid'] = array('#type' => 'value', '#value' => $rid);\n\n $form = confirm_form(\n $form,\n t('Delete expiration of %role_name role for the user !user?', array(\n '!user' => theme('username', array(\n 'account' => $account,\n 'name' => check_plain($account->name),\n 'link_path' => 'user/' . $account->uid,\n )),\n '%role_name' => $role_name,\n )),\n 'admin/user/user/expiration',\n t('Deleting the expiration will give !user privileges set by the %role_name role indefinitely unless manually removed.', array(\n '!user' => theme('username', array(\n 'account' => $account,\n 'name' => check_plain($account->name),\n 'link_path' => 'user/' . $account->uid,\n )),\n '%role_name' => $role_name,\n )),\n t('Yes'),\n t('No')\n );\n }\n else {\n $form['error'] = array(\n '#markup' => t('Invalid user id or role id.'),\n );\n }\n\n return $form;\n}", "private function createDeleteForm(Event $event)\n {\n // $this->enforceUserSecurity('ROLE_USER');\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('event_delete', array('slug' => $event->getSlug())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "function roleDelete(Role $role);", "private function createDeleteForm(Efunction $efunction)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('efunction_delete', array('id' => $efunction->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Acte $acte)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('acte_delete', array('id' => $acte->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function postDeleteRole(DeleteRequest $request)\n {\n $id = \\Input::get('id');\n // $student = Student::find($id);\n $gen_user_role = GenUserRole::find($id);\n $gen_user_role->delete();\n return redirect('gen_user');\n }", "public function deleting(Role $role)\n {\n }", "private function createDeleteForm(MostraMizaUllirit $mostraMizaUllirit)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('mostramizaullirit_delete', array('id' => $mostraMizaUllirit->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Event $event)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('event_delete', array('id' => $event->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Event $event)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('event_delete', array('id' => $event->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Event $event)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('event_delete', array('id' => $event->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function destroy(Role $role)\n {\n //\n if($role->name ==\"app-admin\"){\n\n }else{\n $role->delete();\n }\n return redirect('roles');\n }", "public function getForm()\n {\n return new RoleForm;\n }", "private function createDeleteForm(Events $event) {\n\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('events_delete', array('id' => $event->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ArmasMedico $armasMedico)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('armasmedico_delete', array('id' => $armasMedico->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(RhythmMaterial $rhythmMaterial)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('rhythmmaterial_delete', array('id' => $rhythmMaterial->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('rubrique_delete', array('id' => $id)))\r\n// ->setMethod('DELETE')\r\n ->add('submit', SubmitType::class, array('label' => 'Supprimer la rubrique courante'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm(Aspirante $aspirante)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('aspirante_delete', array('id' => $aspirante->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Projecte $projecte)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('projecte_delete', array('id' => $projecte->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Musicien $musicien)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('musicien_delete', array('codeMusicien' => $musicien->getCodemusicien())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function postDelete()\n {\n self::getConnection()->delete('@system_user_role', ['user_id' => $this->getId()]);\n }", "private function createDeleteForm(Restricciones $restriccione)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('restricciones_delete', array('id' => $restriccione->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function executeDelete()\n {\n if($this->hasRequestParameter('ids')){\n $roles = array_reverse(RolePeer::retrieveByPKs(json_decode($this->getRequestParameter('ids'))));\n\n foreach($roles as $role){\n\t$role->delete();\n }\n\n }elseif($this->hasRequestParameter('id')){\n $role = RolePeer::retrieveByPk($this->getRequestParameter('id'));\n $role->delete();\n }\n\n $this->msg_alert = array('info', $this->getContext()->getI18N()->__(\"Rol borrado.\"));\n return $this->renderComponent('roles', 'list');\n }", "protected function createComponentDeleteForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteFormSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}", "private function createDeleteForm(Recette $recette)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('recette_delete', array('id' => $recette->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Team $entity)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('app_team_delete', array('id' => $entity->getId())))\r\n ->setMethod('DELETE')\r\n ->getForm()\r\n ;\r\n }", "function travel_delete_form($form, &$form_state, $entity) {\n // Store the entity in the form.\n $form_state['entity'] = $entity;\n\n // Show confirm dialog.\n $entity_uri = entity_uri('travel', $entity);\n $message = t('Are you sure you want to delete entity %title?', array('%title' => entity_label('travel', $entity)));\n return confirm_form(\n $form,\n $message,\n $entity_uri['path'],\n t('This action cannot be undone.'),\n t('Delete'),\n t('Cancel')\n );\n}" ]
[ "0.79986936", "0.69734687", "0.69086474", "0.6816056", "0.6799801", "0.6702436", "0.6464739", "0.64358765", "0.6387753", "0.6355804", "0.63335204", "0.63201606", "0.63201606", "0.63201606", "0.63067895", "0.6303177", "0.62701714", "0.62513304", "0.6242807", "0.62261164", "0.6204073", "0.6181939", "0.6166027", "0.61537284", "0.6152475", "0.61454445", "0.61361235", "0.6128081", "0.6126932", "0.61123484" ]
0.80152273
0
/ Plugin Name: My Custom WP Functions Description: Custom Additionals Author: David Mchale Author URI: / Unregister default widgets.
function custom_unregister_default_widgets() { unregister_widget( 'WP_Widget_Archives' ); unregister_widget( 'WP_Widget_Calendar' ); unregister_widget( 'WP_Widget_Categories' ); unregister_widget( 'WP_Widget_Meta' ); unregister_widget( 'WP_Widget_Pages' ); unregister_widget( 'WP_Widget_Recent_Comments' ); unregister_widget( 'WP_Widget_Recent_Posts' ); unregister_widget( 'WP_Widget_RSS' ); unregister_widget( 'WP_Widget_Search' ); unregister_widget( 'WP_Nav_Menu_Widget' ); unregister_widget( 'WP_Widget_Tag_Cloud' ); unregister_widget( 'Akismet_Widget' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unregister_default_widgets() {\n\t\\add_action( 'widgets_init', 'WPS\\_unregister_default_widgets' );\n}", "function unregister_default_wp_widgets() {\n unregister_widget('WP_Widget_Archives');\n unregister_widget('WP_Widget_Calendar');\n unregister_widget('WP_Widget_Categories');\n unregister_widget('WP_Widget_Meta');\n unregister_widget('WP_Widget_Pages');\n unregister_widget('WP_Widget_Recent_Comments');\n unregister_widget('WP_Widget_Recent_Posts');\n unregister_widget('WP_Widget_RSS');\n unregister_widget('WP_Widget_Links');\n unregister_widget('WP_Widget_Search');\n}", "function unregister_default_wp_widgets() {\n unregister_widget('WP_Widget_Pages');\n unregister_widget('WP_Widget_Calendar');\n unregister_widget('WP_Widget_Archives');\n unregister_widget('WP_Widget_Links');\n unregister_widget('WP_Widget_Meta');\n unregister_widget('WP_Widget_Search');\n unregister_widget('WP_Widget_Text');\n unregister_widget('WP_Widget_Categories');\n unregister_widget('WP_Widget_Recent_Posts');\n unregister_widget('WP_Widget_Recent_Comments');\n unregister_widget('WP_Widget_RSS');\n unregister_widget('WP_Widget_Tag_Cloud');\n unregister_widget('WP_Nav_Menu_Widget');\n}", "function unregister_default_widgets() {\n\tunregister_widget('WP_Widget_Pages');\n\tunregister_widget('WP_Widget_Calendar');\n\tunregister_widget('WP_Widget_Archives');\n\tunregister_widget('WP_Widget_Links');\n\tunregister_widget('WP_Widget_Meta');\n\tunregister_widget('WP_Widget_Search');\n\tunregister_widget('WP_Widget_Text');\n\tunregister_widget('WP_Widget_Categories');\n\tunregister_widget('WP_Widget_Recent_Posts');\n\tunregister_widget('WP_Widget_Recent_Comments');\n\tunregister_widget('WP_Widget_RSS');\n\tunregister_widget('WP_Widget_Tag_Cloud');\n\tunregister_widget('WP_Nav_Menu_Widget');\n\tunregister_widget('Twenty_Eleven_Ephemera_Widget');\n\tunregister_widget( 'Jetpack_Subscriptions_Widget' );\n\tunregister_widget( 'WPCOM_Widget_Facebook_LikeBox' );\n\tunregister_widget( 'Jetpack_Gallery_Widget' );\n\tunregister_widget( 'Jetpack_Gravatar_Profile_Widget' );\n\tunregister_widget( 'Jetpack_Image_Widget' );\n\tunregister_widget( 'Jetpack_Readmill_Widget' );\n\tunregister_widget('Jetpack_RSS_Links_Widget');\n\tunregister_widget( 'Jetpack_Top_Posts_Widget' );\n\tunregister_widget( 'Jetpack_Twitter_Timeline_Widget' );\n\tunregister_widget( 'Jetpack_Display_Posts_Widget' );\n\tunregister_widget( 'constant_contact_form_widget' );\n\tunregister_widget( 'constant_contact_events_widget' );\n\tunregister_widget( 'constant_contact_api_widget' );\n\tunregister_widget( 'bcn_widget' );\n}", "function unregister_default_wp_widgets() {\n\tif ( !is_blog_installed() )\n\t\treturn;\n\n\tunregister_widget('WP_Widget_Pages');\n\n\tunregister_widget('WP_Widget_Calendar');\n\n\tunregister_widget('WP_Widget_Archives');\n\n\tunregister_widget('WP_Widget_Links');\n\n\tunregister_widget('WP_Widget_Meta');\n\n\tunregister_widget('WP_Widget_Search');\n\n\tunregister_widget('WP_Widget_Text');\n\n\tunregister_widget('WP_Widget_Categories');\n\n\tunregister_widget('WP_Widget_Recent_Posts');\n\n\tunregister_widget('WP_Widget_Recent_Comments');\n\n\tunregister_widget('WP_Widget_RSS');\n\n\tunregister_widget('WP_Widget_Tag_Cloud');\n\n\tunregister_widget('WP_Nav_Menu_Widget');\n\n\tdo_action('widgets_init');\n}", "function my_custom_dashboard_widgets() \n \t{\n\t\tglobal $wp_meta_boxes;\n\t\tunset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);\n\t\tunset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);\n\n\t\tunregister_sidebar( 'primary-widget-area' );\n\t\tunregister_sidebar( 'secondary-widget-area' );\n\t\tunregister_sidebar( 'first-footer-widget-area' );\n\t\tunregister_sidebar( 'second-footer-widget-area' );\n\t\tunregister_sidebar( 'third-footer-widget-area' );\n\t\tunregister_sidebar( 'fourth-footer-widget-area' );\n }", "function genesisawesome_custom_widgets() {\n\n\t/* Unregister Header Right widget area */\n\tunregister_sidebar( 'header-right' );\n\n\t/* Register Custom Widgets */\n\tregister_widget( 'GA_Facebook_Likebox_Widget' );\n\tregister_widget( 'GA_Flickr_Widget' );\n\n}", "function my_unregister_widgets() {\n\tunregister_widget( 'WP_Widget_Pages' );\n\tunregister_widget( 'WP_Widget_Calendar' );\n\tunregister_widget( 'WP_Widget_Archives' );\n\tunregister_widget( 'WP_Widget_Links' );\n\tunregister_widget( 'WP_Widget_Categories' );\n\tunregister_widget( 'WP_Widget_Recent_Posts' );\n\tunregister_widget( 'WP_Widget_Search' );\n\tunregister_widget( 'WP_Widget_Tag_Cloud' );\n\tunregister_widget( 'WP_Widget_Meta' );\n\tunregister_widget( 'WP_Widget_Recent_Comments' );\n\tunregister_widget( 'WP_Widget_RSS' );\n\n}", "function my_unregister_widgets() {\n\tunregister_widget('WP_Widget_Pages');\n\tunregister_widget('WP_Widget_Calendar');\n\tunregister_widget('WP_Widget_Archives');\n\tunregister_widget('WP_Widget_Meta');\n\tunregister_widget('WP_Widget_Search');\n\tunregister_widget('WP_Widget_Text');\n\tunregister_widget('WP_Widget_Categories');\n\tunregister_widget('WP_Widget_Recent_Posts');\n\tunregister_widget('WP_Widget_Recent_Comments');\n\tunregister_widget('WP_Widget_RSS');\n\tunregister_widget('WP_Widget_Tag_Cloud');\n\tunregister_widget('WP_Nav_Menu_Widget');\n}", "function my_unregister_widgets() {\n unregister_widget('WP_Widget_Archives');\n unregister_widget('WP_Widget_Links');\n unregister_widget('WP_Widget_Meta');\n unregister_widget('WP_Widget_Recent_Posts');\n unregister_widget('WP_Widget_Recent_Comments');\n unregister_widget('WP_Widget_RSS');\n unregister_widget('WP_Widget_Calendar');\n}", "function wporg_add_dashboard_widgets() {\r\n // Remove Welcome panel\r\n remove_action( 'welcome_panel', 'wp_welcome_panel' );\r\n // Remove the rest of the dashboard widgets\r\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\r\n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\r\n remove_meta_box( 'health_check_status', 'dashboard', 'normal' );\r\n remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );\r\n remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');\r\n remove_meta_box( 'dashboard_site_health', 'dashboard', 'normal');\r\n \r\n // Add function here\r\n wp_add_dashboard_widget( 'jerome-on-service-widget', 'Web Developer Service Tag', 'jerome_on_service_widget');\r\n}", "function wp_unregister_widget_control($id)\n {\n }", "function lose_the_widgets ()\r\n{\r\n unregister_sidebar( 'sidebar-1' );\r\n unregister_sidebar( 'sidebar-2' );\r\n unregister_sidebar( 'sidebar-3' );\r\n}", "function remove_widgets(){\r\n remove_meta_box('dashboard_right_now', 'dashboard', 'normal'); \r\n remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); \r\n remove_meta_box('dashboard_activity', 'dashboard', 'normal'); \r\n remove_meta_box('dashboard_primary', 'dashboard', 'side'); \r\n remove_meta_box('dashboard_site_health', 'dashboard', 'side'); \r\n \r\n // Eliminar widget de Elementor que aparece al activar su plugin\r\n remove_meta_box('e-dashboard-overview', 'dashboard', 'normal'); \r\n}", "function unregister_wp_widgets() {\n\t$widgets = [\n\t\t'WP_Widget_Pages',\n\t\t'WP_Widget_Calendar',\n\t\t'WP_Widget_Archives',\n\t\t// Links Manager and its Widget is unregistered already since 3.5.\n\t\t// 'WP_Widget_Links',\n\t\t'WP_Widget_Meta',\n\t\t'WP_Widget_Search',\n\t\t'WP_Widget_Text',\n\t\t'WP_Widget_Categories',\n\t\t'WP_Widget_Recent_Posts',\n\t\t'WP_Widget_Recent_Comments',\n\t\t'WP_Widget_RSS',\n\t\t'WP_Widget_Tag_Cloud',\n\t\t'WP_Nav_Menu_Widget',\n\t];\n\n\tforeach ( $widgets as $widget ) {\n\t\tunregister_widget( $widget );\n\t}\n}", "function wp_unregister_sidebar_widget($id)\n {\n }", "function deregister_widgets()\n { foreach ( $this->get_widgets() as $widget )\n {\n unregister_widget( $widget );\n }\n\n }", "function remove_business_starter_widgets(){\n\n\tunregister_sidebar( 'sidebar-1' );\n\tunregister_sidebar( 'sidebar-2' );\n\tunregister_sidebar( 'sidebar-3' );\n}", "function _wp_remove_unregistered_widgets($sidebars_widgets, $allowed_widget_ids = array())\n {\n }", "function remove_woo_widgets() {\n unregister_widget( 'WC_Widget_Recent_Products' );\n unregister_widget( 'WC_Widget_Featured_Products' );\n unregister_widget( 'WC_Widget_Products' );\n unregister_widget( 'WC_Widget_Product_Categories' );\n unregister_widget( 'WC_Widget_Product_Tag_Cloud' );\n unregister_widget( 'WC_Widget_Cart' );\n unregister_widget( 'WC_Widget_Layered_Nav' );\n unregister_widget( 'WC_Widget_Layered_Nav_Filters' );\n //unregister_widget( 'WC_Widget_Price_Filter' );\n unregister_widget( 'WC_Widget_Top_Rated_Products' );\n unregister_widget( 'WC_Widget_Recent_Reviews' );\n unregister_widget( 'WC_Widget_Recently_Viewed' );\n unregister_widget( 'WC_Widget_Best_Sellers' );\n unregister_widget( 'WC_Widget_Onsale' );\n //unregister_widget( 'WC_Widget_Random_Products' );\n}", "function unregister_sidebar_widget($id)\n {\n }", "function hocwp_theme_custom_widgets_init() {\r\n\r\n}", "function templ_remove_dashboard_widgets()\r\n{\r\n /* Globalize the metaboxes array, this holds all the widgets for wp-admin*/\r\n global $wp_meta_boxes;\r\n /* Remove the Dashboard quickpress widget*/\r\n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);\r\n /* Remove the Dashboard incoming links widget*/\r\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);\r\n /* Remove the Dashboard secondary widget*/\r\n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);\r\n}", "function owlride_disable_default_dashboard_widgets() {\n remove_meta_box('dashboard_plugins', 'dashboard', 'core');\n remove_meta_box('dashboard_quick_press', 'dashboard', 'core');\n remove_meta_box('dashboard_primary', 'dashboard', 'core');\n remove_meta_box('dashboard_secondary', 'dashboard', 'core');\n}", "function dwc_setup_widgets() {\n\tregister_sidebar( array(\n\t\t'id' => 'first-footer-widget-area',\n\t\t'name' => 'First Footer Widget Area',\n\t\t'description' => 'Widgets in this area will be shown in the footer area.',\n\t\t'before_widget' => '<div class=\"widget %2$s\">',\n\t\t'after_widget' => '</div><!-- .widget -->',\n\t\t'before_title' => '<h2>',\n\t\t'after_title' => '</h2>',\n\t) );\n\n\t// Unregister these since the child theme doesn't use them\n\tunregister_sidebar( 'primary-widget-area' );\n\tunregister_sidebar( 'secondary-widget-area' );\n\tunregister_sidebar( 'second-footer-widget-area' );\n\tunregister_sidebar( 'third-footer-widget-area' );\n\tunregister_sidebar( 'fourth-footer-widget-area' );\n}", "function fp_remove_default_dashboard_widgets() { \n\tremove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );\n /*remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');*/\n}", "function init_custom_widgets() {\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-top',\n\t\t'name' => __('Sidebar top', 'bonestheme'),\n\t\t'description' => __('Top sidebar area, present on all pages (default: Main Menu)', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"widget-title\">',\n\t\t'after_title' => '</h4>'\n\t));\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-projects',\n\t\t'name' => __('Projects sidebar', 'bonestheme'),\n\t\t'description' => __('Active on single project pages only (default: Related People, Grants & Publications)', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"widget-title\">',\n\t\t'after_title' => '</h4>'\n\t));\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-people',\n\t\t'name' => __('People sidebar', 'bonestheme'),\n\t\t'description' => __('Active on single people pages only.', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"widget-title\">',\n\t\t'after_title' => '</h4>'\n\t));\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-homepage',\n\t\t'name' => __('Homepage sidebar', 'bonestheme'),\n\t\t'description' => __('Active on homepage, lower side bar area.', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"widget-title\">',\n\t\t'after_title' => '</h4>'\n\t));\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-homepage-content',\n\t\t'name' => __('Homepage main', 'bonestheme'),\n\t\t'description' => __('Active on homepage, below main content area.', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2 class=\"widget-title\">',\n\t\t'after_title' => '</h2>'\n\t));\n\t\n\t\n\n\t/* Custom widget's */\n\t\n\tregister_widget( 'All_People_Widget' );\n\tregister_widget( 'Related_People_Widget' );\n\n\tregister_widget( 'All_Projects_Widget' );\n\tregister_widget( 'Related_Projects_Widget' );\n\tregister_widget( 'Related_Grants_Widget' );\n\tregister_widget( 'Related_Publications_Widget' );\n\n}", "function theme_widgets_init() {\n register_sidebar(array(\n 'name' => __('Main Widget Area', 'theme'),\n 'id' => 'sidebar-1',\n 'description' => __('Appears in the footer section of the site.', 'law-firm'),\n 'before_widget' => '',\n 'after_widget' => '',\n 'before_title' => '',\n 'after_title' => '<',\n ));\n\n register_sidebar(array(\n 'name' => __('Secondary Widget Area', 'theme'),\n 'id' => 'sidebar-2',\n 'description' => __('Appears on posts and pages in the sidebar.', 'law-firm'),\n 'before_widget' => '',\n 'after_widget' => '',\n 'before_title' => '',\n 'after_title' => '',\n ));\n}", "function remove_unused_widgets() {\n\tunregister_widget( 'WP_Widget_Meta' );\n\tunregister_widget( 'WP_Widget_Calendar' );\n\tunregister_widget( 'WP_Widget_Recent_Comments' );\n\tunregister_widget( 'WP_Widget_Tag_Cloud' );\n}", "function ourWidgetsInit() {\n // register widget location\n register_sidebar( array(\n 'name' => 'Sidebarr',\n 'id' => 'sidebar1',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2 class=\"a-special-class\">',\n 'after_title' => '</h2>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 1',\n 'id' => 'footer1',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 2',\n 'id' => 'footer2',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 3',\n 'id' => 'footer3',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 4',\n 'id' => 'footer4',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n}" ]
[ "0.8636281", "0.8197421", "0.81720716", "0.79573977", "0.7938502", "0.7928548", "0.79066247", "0.78764915", "0.7800305", "0.77646667", "0.7620833", "0.75784874", "0.7419697", "0.73724735", "0.7340547", "0.7312976", "0.72826034", "0.72666377", "0.72553134", "0.72380036", "0.72191375", "0.7173956", "0.7127451", "0.7111148", "0.7101804", "0.70884454", "0.7060082", "0.7020396", "0.70175517", "0.69481397" ]
0.8350835
1
/ Hide dashboard widgets.
function custom_hide_dashboard_widgets() { global $wp_meta_boxes; // Today widget. unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now'] ); // Last comments. unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments'] ); // Incoming links. unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links'] ); // Plugins. unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'] ); // WordPress blog. unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary'] ); // WordPress news. unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary'] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mitlibnews_remove_dashboard_widgets() {\n\tremove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); // Quickpress widget\n\tremove_meta_box( 'dashboard_primary', 'dashboard', 'side' ); // Wordpress news\n\tif (!current_user_can('add_users')) {\n\t\tremove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' ); // \"At a glance\" widget\n\t\tremove_meta_box( 'dashboard_activity', 'dashboard', 'normal'); // Activity widget\n\t}\n}", "function rad_remove_dash_widgets(){\n\tremove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n\tremove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\n}", "function fabric_remove_dashboard_widgets() {\n remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal');\n remove_meta_box('dashboard_plugins', 'dashboard', 'normal');\n remove_meta_box('dashboard_primary', 'dashboard', 'normal');\n remove_meta_box('dashboard_secondary', 'dashboard', 'normal');\n}", "function admin_disable_dashboard_widgets() {\n // remove_meta_box('dashboard_right_now', 'dashboard', 'normal');// Remove \"At a Glance\"\n // remove_meta_box('dashboard_activity', 'dashboard', 'normal');// Remove \"Activity\" which includes \"Recent Comments\"\n // remove_meta_box('dashboard_quick_press', 'dashboard', 'side');// Remove Quick Draft\n remove_meta_box('dashboard_primary', 'dashboard', 'core');// Remove WordPress Events and News\n}", "function dwwp_remove_dashboard_widget() {\n remove_meta_box( 'dashboard_primary','dashboard','side' );\n}", "function remove_dashboard_widgets() {\n\tremove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );\n\tremove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );\n\t// remove_meta_box( 'dashboard_primary', 'dashboard', 'normal' );\n\tremove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' );\n}", "function maker_4ym_remove_dashboard_widgets() {\n remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );\n}", "public function remove_dashboard_widgets() {\n\t\tremove_meta_box('dashboard_incoming_links', 'dashboard', 'normal');\n\t\tremove_meta_box('dashboard_plugins', 'dashboard', 'normal');\n\t\tremove_meta_box('dashboard_primary', 'dashboard', 'normal');\n\t\tremove_meta_box('dashboard_secondary', 'dashboard', 'normal');\n\t}", "function cmk_disable_default_dashboard_widgets() {\n remove_meta_box('dashboard_plugins', 'dashboard', 'core');\n remove_meta_box('dashboard_primary', 'dashboard', 'core');\n remove_meta_box('dashboard_secondary', 'dashboard', 'core'); // disable Simple:Press dashboard widget\n remove_meta_box('sf_announce', 'dashboard', 'normal');\n}", "function disable_tribe_dashboard_widget() {\n remove_meta_box('tribe_dashboard_widget', 'dashboard', 'normal');\n}", "function kcsite_remove_dashboard_widgets() {\n\t\t// remove_meta_box('yoast_db_widget', 'dashboard', 'normal'); // Breadcrumbs\n\t\tremove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); // incoming links\n\t\t//remove_meta_box('dashboard_plugins', 'dashboard', 'normal'); // plugins\n\t\tremove_meta_box('dashboard_recent_comments', 'dashboard', 'normal'); // plugins\n\t\t//remove_meta_box('dashboard_quick_press', 'dashboard', 'normal'); // quick press\n\t \tremove_meta_box('dashboard_recent_drafts', 'dashboard', 'normal'); // recent drafts\n\t \tremove_meta_box('dashboard_primary', 'dashboard', 'normal'); // wordpress blog\n\t \tremove_meta_box('dashboard_secondary', 'dashboard', 'normal'); // other wordpress news\n\t \tremove_meta_box('alo-easymail-widget', 'dashboard', 'normal'); // other wordpress news\n\t \tremove_meta_box('tribe_dashboard_widget', 'dashboard', 'normal'); // other wordpress news\n\t}", "function mtws_remove_dashboard_widgets() {\n //remove_meta_box( 'dashboard_activity', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );\n\tremove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );\n}", "function templ_remove_dashboard_widgets()\r\n{\r\n /* Globalize the metaboxes array, this holds all the widgets for wp-admin*/\r\n global $wp_meta_boxes;\r\n /* Remove the Dashboard quickpress widget*/\r\n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);\r\n /* Remove the Dashboard incoming links widget*/\r\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);\r\n /* Remove the Dashboard secondary widget*/\r\n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);\r\n}", "function owlride_disable_default_dashboard_widgets() {\n remove_meta_box('dashboard_plugins', 'dashboard', 'core');\n remove_meta_box('dashboard_quick_press', 'dashboard', 'core');\n remove_meta_box('dashboard_primary', 'dashboard', 'core');\n remove_meta_box('dashboard_secondary', 'dashboard', 'core');\n}", "function wptutsplus_remove_dashboard_widgets() {\n remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );\n // remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );\n}", "function remove_widgets(){\r\n remove_meta_box('dashboard_right_now', 'dashboard', 'normal'); \r\n remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); \r\n remove_meta_box('dashboard_activity', 'dashboard', 'normal'); \r\n remove_meta_box('dashboard_primary', 'dashboard', 'side'); \r\n remove_meta_box('dashboard_site_health', 'dashboard', 'side'); \r\n \r\n // Eliminar widget de Elementor que aparece al activar su plugin\r\n remove_meta_box('e-dashboard-overview', 'dashboard', 'normal'); \r\n}", "public function disable_dashboard_widgets() {\n\n\t\t//Init vars\n\t\t$defaults = array(\n\t\t\t'id' \t\t=> NULL,\n\t\t\t'page'\t\t=> 'dashboard',\n\t\t\t'context'\t=> NULL\n\t\t);\n\n\t\t//Check if disable_dashboard_widgets array isset in config class\n\t\tif( isset($this->admin_disable_dashboard_widgets) && is_array($this->admin_disable_dashboard_widgets) ) {\n\n\t\t\t//Loop each request and call WP remove_meta_box for each\n\t\t\tforeach( $this->admin_disable_dashboard_widgets as $method_args ) {\n\n\t\t\t\t$method_args = wp_parse_args( $method_args, $defaults );\n\n\t\t\t\tif( isset( $method_args['id'], $method_args['page'], $method_args['context'] ) ) {\n\t\t\t\t\tremove_meta_box( $method_args['id'], $method_args['page'], $method_args['context'] );\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}", "function remove_dashboard_widgets() {\n // Remove All Dashboard Widgets.\n remove_action('welcome_panel', 'wp_welcome_panel'); \n remove_meta_box( 'dashboard_activity', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' ); \n remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' ); \n remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' ); \n remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' ); \n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); \n remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' ); \n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );\n remove_meta_box('logincust_subscribe_widget', 'dashboard', 'core');\n remove_meta_box('themeisle', 'dashboard', 'core'); \n}", "function my_remove_dashboard_widgets() {\n $user = wp_get_current_user();\n if ( ! $user->has_cap( 'manage_options' ) ) {\n remove_meta_box( 'dashboard_activity', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n }\n}", "function rw_remove_dashboard_widgets() {\n//\tremove_meta_box('dashboard_recent_comments', 'dashboard', 'normal'); // Recent Comments\n\tremove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); // Incoming Links\n\tremove_meta_box('dashboard_plugins', 'dashboard', 'normal'); // Plugins\n\n\tremove_meta_box('dashboard_quick_press', 'dashboard', 'normal'); // Quick Press\n//\tremove_meta_box('dashboard_recent_drafts', 'dashboard', 'normal'); // Recent Drafts\n\tremove_meta_box('dashboard_primary', 'dashboard', 'normal'); // Wordpress Blog\n\tremove_meta_box('dashboard_secondary', 'dashboard', 'normal'); // Other Wordpress News\n}", "function example_remove_dashboard_widgets() {\n\t \tglobal $wp_meta_boxes;\n\n\t\t// Remove the incomming links widget\n\t\tunset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);\t\n\n\t\t// Remove right now\n\t\tunset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);\n\n\t\t// Remove side column\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);\n\t}", "function my_custom_dashboard_widgets() \n \t{\n\t\tglobal $wp_meta_boxes;\n\t\tunset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);\n\t\tunset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);\n\t\tunset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);\n\n\t\tunregister_sidebar( 'primary-widget-area' );\n\t\tunregister_sidebar( 'secondary-widget-area' );\n\t\tunregister_sidebar( 'first-footer-widget-area' );\n\t\tunregister_sidebar( 'second-footer-widget-area' );\n\t\tunregister_sidebar( 'third-footer-widget-area' );\n\t\tunregister_sidebar( 'fourth-footer-widget-area' );\n }", "function disable_default_dashboard_widgets() {\n\tremove_meta_box('dashboard_right_now', 'dashboard', 'core');\n\tremove_meta_box('dashboard_recent_comments', 'dashboard', 'core');\n\tremove_meta_box('dashboard_incoming_links', 'dashboard', 'core');\n\tremove_meta_box('dashboard_plugins', 'dashboard', 'core');\n\n\tremove_meta_box('dashboard_quick_press', 'dashboard', 'core');\n\tremove_meta_box('dashboard_recent_drafts', 'dashboard', 'core');\n\tremove_meta_box('dashboard_primary', 'dashboard', 'core');\n\tremove_meta_box('dashboard_secondary', 'dashboard', 'core');\n}", "function disable_default_dashboard_widgets() {\r\n remove_meta_box('dashboard_recent_comments', 'dashboard', 'core'); // Comments Widget\r\n remove_meta_box('dashboard_incoming_links', 'dashboard', 'core'); // Incoming Links Widget\r\n remove_meta_box('dashboard_activity', 'dashboard', 'core'); // welcome panel\r\n remove_meta_box('dashboard_plugins', 'dashboard', 'core'); // Plugins Widget\r\n Remove_meta_box('dashboard_quick_press', 'dashboard', 'core'); // Quick Press Widget\r\n remove_meta_box('dashboard_recent_drafts', 'dashboard', 'core'); // Recent Drafts Widget\r\n remove_meta_box('dashboard_primary', 'dashboard', 'core'); //\r\n remove_meta_box('dashboard_secondary', 'dashboard', 'core'); //\r\n // Removing plugin dashboard boxes\r\n remove_meta_box('yoast_db_widget', 'dashboard', 'normal'); // Yoast's SEO Plugin Widget\r\n}", "function mmc_dashboard(){\n\tremove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n\tremove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\n}", "public function hidden_sidebars() {\n\t\techo '<div style=\"display: none\">';\n\t\tif ( is_customize_preview() ) {\n\t\t\tdynamic_sidebar( 'sidebar-top-bar' );\n\t\t\tdynamic_sidebar( 'header-sidebar' );\n\t\t\tdynamic_sidebar( 'subscribe-widgets' );\n\t\t\tdynamic_sidebar( 'sidebar-big-title' );\n\t\t}\n\t\techo '</div>';\n\t}", "function remove_dashboard_widgets() {\n global $wp_meta_boxes;\n \n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_drafts']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);\n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);\n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']);\n remove_action( 'welcome_panel', 'wp_welcome_panel' );\n \n}", "public function remove_dashboard_widgets() {\n remove_meta_box(\"dashboard_primary\", \"dashboard\", \"side\"); // WordPress.com blog\n remove_meta_box(\"dashboard_secondary\", \"dashboard\", \"side\"); // Other WordPress news\n\n global $wp_meta_boxes;\n\n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_drafts']);\n unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);\n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);\n unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);\n }", "function remove_business_starter_widgets(){\n\n\tunregister_sidebar( 'sidebar-1' );\n\tunregister_sidebar( 'sidebar-2' );\n\tunregister_sidebar( 'sidebar-3' );\n}", "function fp_remove_default_dashboard_widgets() { \n\tremove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );\n remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );\n remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );\n /*remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');*/\n}" ]
[ "0.76082855", "0.75985193", "0.75888413", "0.75827056", "0.7523026", "0.75071985", "0.750256", "0.7469566", "0.74597436", "0.74109954", "0.74072343", "0.7404851", "0.7344693", "0.730992", "0.7305711", "0.7291481", "0.7274372", "0.7229942", "0.7209446", "0.7188029", "0.7165178", "0.71119153", "0.7068923", "0.7060138", "0.7024644", "0.70119184", "0.69594544", "0.6924699", "0.689154", "0.6881178" ]
0.76435626
0
Check whether provider provider id/name is valid
public static function isProviderValid($provider) { return array_key_exists($provider, static::$providers); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkProviderKey($provider) {\n\n $postdata = http_build_query(\n array(\n 'ptype' => 'check-provider-key',\n 'provider_url' => $provider['provider_url'],\n 'provider_key' => $provider['provider_key']\n )\n );\n \n $wgbacklinks = WgbacklinksHelper::getInstance();\n $result = $wgbacklinks->execExchangeData($provider['provider_url'], $postdata); \n\n return $result;\n \n }", "public static function hasProvider() {\n\t\treturn !is_null(self::$provider);\n\t}", "public function validProvider()\n {\n return array(\n // always valid all ones\n array('11111111111111111', true),\n // valid X check digit\n array('1M8GDM9AXKP042788', true),\n // typical valid vin\n array('5GZCZ43D13S812715', true),\n // invalid char in model year\n array('5GZCZ43D1US812715', false),\n // uses invalid I, O, Q\n array('IGZOZ43Q13S812715', false)\n );\n }", "public function hasProvider($type);", "public function getProviderName();", "public function getProviderName();", "public function getProviderName();", "public function hasProviders(): bool;", "public function hasProviders();", "public function get_provider($name)\n {\n }", "protected function validProvider($providerName)\n {\n $providers = json_decode(setting('social_auths'));\n\n if (!$providers->{$providerName}) {\n return false;\n }\n\n return $providers->{$providerName}->enabled;\n }", "private function checkProvider($idPchProvider)\n {\n $provider = PchProvider::whereId($idPchProvider)->whereFlagDelete(false)->first();\n if (!$provider) {\n throw new ValidationException(\"El proveedor ($idPchProvider) no existe.\");\n }\n return $provider;\n }", "public function create(Provider $provider)\n {\n\t if (Auth::guard('provider-web')->user()->id == $provider->id) return true;\n\t return false;\n }", "public function isProvider()\n {\n if ($this->type == 2) {\n return true;\n } else {\n return false;\n }\n }", "public function setProvider($name) {\n $name = Database::secureInput($name);\n\n if (!is_string($name) || strlen($name) < 2 || strlen($name) > 100) {\n throw new InvalidArgumentException(\"\\\"provider\\\" is no string or its length is invalid\");\n }\n\n $this->provider = $name;\n }", "public function getProviderName()\n {\n return NULL;\n }", "public function getProvider($provider_id);", "public function providerExists($providerName)\n {\n $query = $this->db->prepare('SELECT COUNT(id) FROM ? WHERE name = ?', array(\n self::TABLE_PROVIDERS,\n $providerName\n ));\n\n $count = $this->db->get_var($query);\n\n return (int) $count >= 1;\n }", "public function getProviderId();", "public function getProviderName(): string\n {\n return $this->providerName;\n }", "public static function cmpFqdnInvalidDataProvider() {}", "public function setProviderName($name);", "public function providerTestIsValidUsername() {\n return [\n 'valid' => [\n 'YesCT',\n TRUE,\n ],\n 'not valid' => [\n 'x x',\n FALSE,\n ],\n ];\n }", "public static function cmpFqdnValidDataProvider() {}", "public function getProviderName()\n {\n return $this->providerName;\n }", "public function isProviderOnline($provider = null): bool;", "public function hasProvider($name)\n {\n return isset($this->providers[$name]);\n }", "public function isValidMessengerProvider($provider = null): bool\n {\n return (bool) $this->findProviderAlias($provider);\n }", "public function hasIdentity($provider = null)\n {\n return !$this->getStorage()->isEmpty($provider);\n }", "protected function detectLoginProvider() {}" ]
[ "0.63221335", "0.62779325", "0.6265286", "0.6205485", "0.61896044", "0.61896044", "0.61896044", "0.60886633", "0.60876095", "0.60855556", "0.60406965", "0.60148853", "0.60049236", "0.5953346", "0.5939193", "0.59316665", "0.5893126", "0.585801", "0.5856962", "0.583204", "0.5819401", "0.5818838", "0.5768652", "0.5750044", "0.57389003", "0.5684394", "0.5662631", "0.56567615", "0.5650341", "0.5645111" ]
0.7011916
0
Get user sex or null if it is not set
public function getUserSex() { return $this->getUserAttribute(static::ATTRIBUTE_SEX); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSex()\n {\n $result = null;\n if (isset($this->userInfo['sex'])) {\n $result = $this->userInfo['sex'] == 1;\n }\n return $result;\n }", "public function getsex()\n {\n return $this->sex;\n }", "function getGender($userid) {\n return NULL;\n }", "public function getSex()\n {\n return $this->sex;\n }", "public function getSex()\n {\n return $this->sex;\n }", "public function getSex()\n {\n return $this->sex;\n }", "public function getSex()\n {\n return $this->sex;\n }", "public function getSex()\n {\n return $this->sex;\n }", "public function getSex() {\n return (new Query())->select('sex')->from('user_cv')\n ->where(['user_id' => $this->id, 'is_default' => true])\n ->limit(1)->scalar();\n }", "public function getCsex()\n {\n return $this->csex;\n }", "public function getSex()\n {\n return self::SEX[$this->sex];\n }", "public function hasSex(){\n return $this->_has(2);\n }", "public function hasSex(){\n return $this->_has(2);\n }", "public function hasSex(){\n return $this->_has(3);\n }", "public function setSex($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->sex !== $v) {\n $this->sex = $v;\n $this->modifiedColumns[UserTableMap::COL_SEX] = true;\n }\n\n return $this;\n }", "public function hasSex(){\r\n return $this->_has(6);\r\n }", "public function getCustomerGender();", "public function getCustomerGender()\n {\n $user = Shopware()->Modules()->Admin()->sGetUserData();\n\n if (version_compare(Shopware()->Config()->get( 'Version' ), '5.2.0', '<')) {\n $customerGender = $user[\"billingaddress\"][\"salutation\"];\n } elseif (version_compare(Shopware()->Config()->get( 'Version' ), '5.2.0', '>=')) {\n $customerGender = $user[\"additional\"][\"user\"][\"salutation\"];\n }\n\n return $customerGender;\n }", "function getGender() {\n return $this->gender;\n }", "public function getGender()\n {\n return $this->getParameter('gender');\n }", "function vSex ( $sex ) \r\n\t\t{\r\n\t\t\t# Strip string down to first character\r\n\t\t\t$sex = strtolower( substr( $sex, 0, 1) );\r\n\t\t\t\r\n\t\t\t# Checks if result is 'f' or 'm'\r\n\t\t\tif ( $sex != \"f\" OR $sex != \"m\" )\r\n\t\t\t\t$sex = true;\r\n\t\t\t\t\r\n\t\t\telse \r\n\t\t\t\t$sex = false;\r\n\t\t\t\r\n\t\t\treturn $sex;\r\n\t\t\t\r\n\t\t}", "public function getGender()\n {\n return $this->gender;\n }", "public function getGender()\n {\n return $this->gender;\n }", "public function getGender()\n {\n return $this->gender;\n }", "public function getGender()\n {\n return $this->gender;\n }", "public function getGender(){\n $name = '';\n if ($this->gender =='N') {\n $name = 'Preferred not to tell';\n }elseif ($this->gender =='M') {\n $name = 'Male';\n }else{\n $name = 'Female';\n }\n return $name;\n }", "public function getGender(){ // fungsi get untuk mengambil nilai dari gender\n printNumC();//\n return $this->gender;\n }", "function female() \n { \n $this->sex_id=\"F\";\n $this->sex_name=\"Female\";\n return($this->sex_id);\n }", "public static function getTextGender($oUser)\n {\n $gender = null;\n switch ($oUser->gender) {\n case 'M':\n $gender = 'Homme';\n break;\n case 'F':\n $gender = 'Femme';\n break;\n }\n return $gender;\n }", "function isGenderUnknown() {\n\tglobal $USER;\n\tif(!isset($USER['gender'])) return true; //If we don't know guess they aren't\n if($USER['gender']==\"u\") {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}" ]
[ "0.7810267", "0.75179243", "0.72500116", "0.71574724", "0.71574724", "0.71574724", "0.71574724", "0.71574724", "0.6864054", "0.6777187", "0.6545667", "0.6400071", "0.6400071", "0.6380897", "0.63448596", "0.62781256", "0.62503695", "0.61736095", "0.6143012", "0.61328506", "0.6120611", "0.6076327", "0.6076327", "0.6076327", "0.6076327", "0.6062665", "0.6040551", "0.60386467", "0.60138345", "0.6004832" ]
0.76433337
1
Get user birthday in format dd.mm.YYYY or null if it is not set
public function getUserBirthday() { $result = $this->getUserAttribute(static::ATTRIBUTE_BIRTHDAY); if (!empty($result)) { return date('d.m.Y', strtotime($result)); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBirthdayDate():?string\n {\n return $this->birthday_date ? (new \\DateTime($this->birthday_date))->format('d/m/Y') : null;\n }", "public function getBirthDay() {\n \tif($this->birthDay == null)\n\t\t\treturn \"\";\n\t\telse\n \treturn $this->birthDay;\n }", "function getDayOfBirth() {\n global $USER;\n\t$dayOfBirth = date(\"d\", $USER['dob']);\n\treturn $dayOfBirth;\n}", "protected function getDateOfBirthAttribute()\n {\n if (isset($this->attributes['date_of_birth'])) {\n $value = $this->attributes['date_of_birth'] ?? null;\n } else {\n $value = null;\n }\n\n if ($value !== null) {\n return date('d.m.Y', strtotime($value));\n } else {\n return null;\n }\n }", "public function getBirthDate()\n {\n if ($this->birthDate) {\n return $this->birthDate;\n }\n\n $centuryCode = substr($this->personal_code, 0, 1);\n if ($centuryCode < 3) {\n $century = 19;\n } elseif ($centuryCode < 5) {\n $century = 20;\n } else {\n $century = 21;\n }\n\n $this->birthDate = new \\DateTime(($century - 1) . substr($this->personal_code, 1, 6));\n\n return $this->birthDate;\n }", "public function getBirthday() : string\r\n\t{\r\n\t\treturn $this->birthday;\r\n\t}", "public function getBirthday($format = 'Y-m-d')\n {\n $value = $this->getParameter('birthday');\n\n return $value ? $value->format($format) : null;\n }", "public function getDateOfBirth() {\n\t\treturn empty( $this->container['dates_of_birth'] ) ? null : $this->container['dates_of_birth'][0];\n\t}", "public function getBirthDate()\n {\n return $this->getProfile() ? $this->getProfile()->getBirthDate() : null;\n }", "public function getUserDateOfBirth () {\n\t\treturn ($this->userDateOfBirth);\n\t}", "public function getBirthDate()\n\t{\n\t\treturn $this->getIfSetDate('birthDate');\n\t}", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday($format = 'Y-m-d H:i:s')\n\t{\n\t\tif ($this->birthday === null) {\n\t\t\treturn null;\n\t\t}\n\n\n\t\tif ($this->birthday === '0000-00-00 00:00:00') {\n\t\t\t// while technically this is not a default value of NULL,\n\t\t\t// this seems to be closest in meaning.\n\t\t\treturn null;\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t$dt = new DateTime($this->birthday);\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException(\"Internally stored date/time/timestamp value could not be converted to DateTime: \" . var_export($this->birthday, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ($format === null) {\n\t\t\t// Because propel.useDateTimeClass is TRUE, we return a DateTime object.\n\t\t\treturn $dt;\n\t\t} elseif (strpos($format, '%') !== false) {\n\t\t\treturn strftime($format, $dt->format('U'));\n\t\t} else {\n\t\t\treturn $dt->format($format);\n\t\t}\n\t}", "public function getDateofBirth() {\n return $this->dateOfBirth;\n }", "public function getBirthdate()\n\t{\n\t\treturn $this->birthdate;\n\t}", "public function getBirthdate($format = 'Y-m-d')\n\t{\n\t\tif ($this->birthdate === null) {\n\t\t\treturn null;\n\t\t}\n\n\n\t\tif ($this->birthdate === '0000-00-00') {\n\t\t\t// while technically this is not a default value of NULL,\n\t\t\t// this seems to be closest in meaning.\n\t\t\treturn null;\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t$dt = new DateTime($this->birthdate);\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException(\"Internally stored date/time/timestamp value could not be converted to DateTime: \" . var_export($this->birthdate, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ($format === null) {\n\t\t\t// Because propel.useDateTimeClass is TRUE, we return a DateTime object.\n\t\t\treturn $dt;\n\t\t} elseif (strpos($format, '%') !== false) {\n\t\t\treturn strftime($format, $dt->format('U'));\n\t\t} else {\n\t\t\treturn $dt->format($format);\n\t\t}\n\t}", "public function getBirthDate()\n {\n return $this->birth_date;\n }", "public function getBirthdate()\n {\n return $this->birthdate;\n }", "public function getBirthdate()\r\n {\r\n return $this->birthdate;\r\n }", "public function getDateOfBirth()\n {\n return $this->dateOfBirth;\n }", "public function getDateOfBirth()\n {\n return $this->dateOfBirth;\n }", "public function getBirthDate() : Datetime\n {\n if (is_null($this->birthDate)) {\n $year = $this->getBirthCentury() + substr($this->code, 1, 2);\n $month = substr($this->code, 3, 2);\n $day = substr($this->code, 5, 2);\n\n $this->birthDate = new Datetime($year.'-'.$month.'-'.$day);\n }\n\n return $this->birthDate;\n }", "public function getBirthdayDate()\n {\n return $this->birthdayDate;\n }", "public function getBirthdate()\n {\n return $this->birthdate;\n }", "public function getBirthday($format = 'd.m.Y.')\n {\n return date($format, $this->getBirthdayTimeStamp());\n }", "public function getBirthDate()\n {\n return $this->birthDate;\n }" ]
[ "0.81020474", "0.8087841", "0.78028715", "0.77632535", "0.7634923", "0.75612813", "0.7509031", "0.74697196", "0.74228454", "0.73496985", "0.7268432", "0.7224518", "0.7224518", "0.7224518", "0.7224518", "0.7224518", "0.72205245", "0.71527565", "0.7133127", "0.71291655", "0.7126509", "0.7122136", "0.7108115", "0.7067304", "0.7067304", "0.7059581", "0.70539707", "0.7014363", "0.70128477", "0.7005834" ]
0.8222234
0
Get all components required to build authentication url
abstract public function getAuthUrlComponents();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function auth_url();", "public function getAuthUrl();", "public function get_auth_url()\n\t{\n\t\treturn $this->auth_url.'?oauth_token='.$this->get_request_token();\n\t}", "abstract public function getAuthUri(): string;", "public function getAuthUrl()\n\t{\n\t\t$tokenData = $this->getRequestToken();\n\t\treturn rtrim($this->_authoriseUrl,'/').'?'.$tokenData;\n\t}", "public function getAuthUrl()\n\t{\n\t\treturn $this->createAuthUrl();\n\t}", "abstract protected function getAuthUrl($state);", "protected function _getAuthUrl()\n {\n\t\t$url = CS_REST_General::authorize_url(\n\t\t\t$this->_getClientId(),\n\t\t\t$this->_getAuthRedirectUri(),\n\t\t\t'ImportSubscribers,ManageLists'\n\t\t);\n\t\t\n return $url;\n }", "public function get_auth_url()\r\n\t{\r\n\t\treturn PicasaAPI::$QUERY_URLS['auth'];\r\n\t}", "public function get_auth_string()\n {\n }", "private function getAuthURL() : string {\n $payload = [\n \"client_id\" => $this->client_data->getClientId(),\n \"scope\" => $this->scope->toString(),\n ];\n\n if ($this->with_redirect) {\n $redirect = $this->client_data->getRedirectUri(1);\n $payload['response_type'] = self::RESPONSE_TYPE_TOKEN;\n } else {\n $redirect = $this->client_data->getRedirectUri(0);\n $payload['response_type'] = self::RESPONSE_TYPE_CODE;\n }\n\n $payload[\"redirect_uri\"] = (empty($this->redirect_params)) ?\n $redirect : $redirect.'?'.http_build_query($this->redirect_params);\n return $this->client_data->getAuthURI(). '?'. http_build_query($payload);\n }", "function umnshib_buildLoginURL(array $options = array())\n{\n $shib = new BasicAuthenticator();\n return $shib->buildLoginURL($options);\n}", "public function getAuthUrl()\n {\n return $this->authUrl;\n }", "public function getAuthUrl()\n {\n return $this->authUrl;\n }", "public function authenticationURL()\n {\n $clientId = config('twitch-api.client_id');\n $scopes = implode('+', config('twitch-api.scopes'));\n $redirectURL = config('twitch-api.redirect_url');\n return config('twitch-api.api_url') . '/kraken/oauth2/authorize?api_version=5&response_type=code&client_id=' . $clientId . '&redirect_uri=' . $redirectURL . '&scope=' . $scopes;\n }", "public function getLoginUrl();", "public function getAuthUrl()\n {\n return $this->client->createAuthUrl();\n }", "public function getAuthUrl()\n {\n $return = $this->baseUrl .\n '/' . $this->authNamespace .\n '/' . $this->authVersion .\n '/token?url=' . $this->baseUrl . '/' . $this->apiNamespace;\n\n return $return;\n }", "public function buildPasswordUri(): string;", "abstract public function getAuthorizeUrl(): string;", "abstract protected function getTokenUrl();", "public function getAuthURL() {\n\t\treturn $this->authorization_url.\"?response_type=code&client_id=\".$this->clientID.\"&state=\".$this->state.\"&scope=\".$this->scope;\n\t}", "public function create_auth_url() {\n\t\t$params = array(\n\t\t\t'response_type' => 'code',\n\t\t\t'redirect_uri' => $this->get_redirect_uri(),\n\t\t\t'client_id' => urlencode( $this->config['client_id'] ),\n\t\t\t'scope' => implode( \" \", $this->config['scopes'] ),\n\t\t\t'access_type' => urlencode( $this->config['access_type'] ),\n\t\t\t'approval_prompt' => urlencode( $this->config['approval_prompt'] )\n\t\t);\n\n\t\treturn self::OAUTH2_AUTH_ENDPOINT . \"?\" . http_build_query( $params );\n\t}", "public function getAuth();", "public function getAuth();", "public static function getAuthUrl() {\n $queryString = http_build_query(\n array( 'client_id' => self::CLIENT_ID,\n 'response_type' => 'code',\n 'redirect_uri' => self::getAbsoluteUrl(array(\n 'controller' => 'oauth',\n 'action' => 'callback',\n 'service' => self::TYPE\n ))\n ));\n $url = self::OAUTH_URL . '?' . $queryString;\n return $url;\n }", "public function buildLoginUrl(Request $request): string;", "function fsl_gauth_getauthurl()\n\t{\n\t\n\t$gClient = new Google_Client();\n $gClient->setApplicationName('Login');\n $gClient->setClientId(option('clientId'));\n $gClient->setClientSecret(option('clientSecret'));\n $gClient->setRedirectUri(option('redirectURL')); \n\t//\t$gClient->setHd(option('hd')); \n $google_oauthV2 = new Google_Oauth2Service($gClient);\n $authUrl = $gClient->createAuthUrl();\n return $authUrl;\n}", "public function getAuthAsString();", "public function getURL()\n {\n return Config::get('URL') . 'auth/unl/';\n }" ]
[ "0.73218894", "0.7157372", "0.6832804", "0.67731714", "0.64764035", "0.6465385", "0.64473003", "0.62885475", "0.6278464", "0.62723607", "0.6253919", "0.6215553", "0.617608", "0.617608", "0.6171891", "0.61702204", "0.6094732", "0.6073644", "0.60662067", "0.6051898", "0.6014222", "0.60117775", "0.59924567", "0.59795237", "0.59795237", "0.59658504", "0.593165", "0.5868144", "0.5852302", "0.58340997" ]
0.85969174
0
Get a middleware from the iterator
protected function getMiddleware() { $ret = null; if ($this->middleware->valid()) { $ret = $this->middleware->current(); $this->middleware->next(); } return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMiddleware();", "protected function callback()\n {\n return GuzzleMiddleware::mapRequest(function (RequestInterface $request) {\n return $request->withHeader('T-middleware', $request->getHeaderLine('T-middleware') . 'B');\n });\n }", "public function get(): Middleware;", "public function getMiddleware()\n {\n return $this->middleware;\n }", "public function getMiddleware()\n {\n return $this->middleware;\n }", "private function getMiddleware()\n {\n if (isset($this->middlewareLayers[$this->middlewareIndex])) {\n return $this->middlewareLayers[$this->middlewareIndex];\n }\n\n return null;\n }", "public function shift()\n {\n return array_shift($this->middlewares);\n }", "public function getMiddleware() : LinkedList {\n return $this->assignedMiddlewareList;\n }", "protected function mockNextMiddleware()\n {\n return function ($request, $response) {\n return $response;\n };\n }", "public function middlewareNameCollection(): MiddlewaresInterface;", "public function getMiddlewares();", "public function popMiddleware()\n {\n return array_shift($this->middlewares);\n }", "public function getMiddleware($name)\n\t{\n\t\tif (array_key_exists($name, $this->middlewares))\n\t\t{\n\t\t\treturn $this->middlewares[$name];\n\t\t}\n\t}", "public function getAuthMiddleware(): callable{\n if($this->hasAuthMiddleware())\n return $this->_authorisationMiddleware;\n else\n return function(){ return true; };\n }", "public function next()\n {\n if (($middleware = next($this->middlewares))) {\n call_user_func($middleware, $this->request, $this->response, $this);\n } elseif ($this->parent !== null) {\n $this->parent->next();\n }\n }", "public function middleware($middleware, int $position = self::BOTH): self\n {\n return $this->filter($middleware, $position);\n }", "private function runMiddlewares()\n {\n $middleware = $this->getMiddleware();\n $this->middlewareIndex++;\n if (null === $middleware) {\n $this->runRoute();\n } else {\n return $middleware([$this, 'run']);\n }\n }", "public function middleware($middlewareDefinition): self;", "public function handle($request, Closure $next)\n {\n $result = Manager::middleware();\n return $result?$result:$next($request);\n }", "public function getThrowableHandler(): MiddlewareInterface;", "public function parse() : Middleware\n {\n $middlewareKey = $this->extractMiddlewareKey();\n $event = $this->extractEvent();\n $parameters = $this->extractParameters();\n\n $middleware = new Middleware($middlewareKey);\n if ($event) {\n $middleware->event($event);\n }\n if ($parameters) {\n $middleware->parameters($parameters);\n }\n\n return $middleware;\n }", "public function getExceptionHandler(): MiddlewareInterface;", "public function getMiddlewares() {\n\t\treturn $this->middlewares;\n\t}", "protected function step(): ResponseInterface {\n\t\t$current = $this->getMiddleware();\n\n\t\tif ($current !== null) {\n\t\t\t$delegate = $this->createDelegate(\n\t\t\t\tfunction(ServerRequestInterface $request) {\n\t\t\t\t\treturn $this->setRequest($request)->step();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$request = $this->getRequest();\n\n\t\t\treturn $current->process($request, $delegate);\n\t\t}\n\n\t\tthrow new Exception\\OutOfMiddlewareException(\n\t\t\t\"Middleware iterator exhausted.\"\n\t\t);\n\t}", "private static function middleware()\n {\n $files = ['Filters', 'Middleware'];\n $folder = static::$root.'Http/Middleware'.'/';\n\n self::call($files, $folder);\n\n $files = ['MiddlewareNotFoundException', 'MiddlewareWallException'];\n $folder = static::$root.'Http/Middleware/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "protected static function middleware()\n {\n foreach (self::fetch('http/middleware') as $file) {\n Bus::need($file);\n }\n\n Middleware::ini();\n }", "private function getMiddleware(CollectionAbstract $fieldItem): array {\r\n\r\n $middleware = $fieldItem -> getMiddleware();\r\n\r\n if(null !== $middleware) {\r\n\r\n if(count($middleware) > 0) {\r\n return $middleware;\r\n }\r\n\r\n return $this -> middleware;\r\n }\r\n\r\n return [];\r\n }", "public function middlewares()\n {\n }", "public function sampleMiddleware($request, $response, $next)\n {\n return $response;\n }", "protected function getMiddleware(EndpointCollection $endpoints): array\n {\n return $this->extractFromEndpoints($endpoints, 'middleware');\n }" ]
[ "0.6752117", "0.66690207", "0.6622647", "0.65207684", "0.65207684", "0.63957626", "0.63761896", "0.6352436", "0.62916", "0.62613744", "0.615779", "0.61190957", "0.60768324", "0.5982674", "0.59793043", "0.59714884", "0.5905679", "0.5836984", "0.58001155", "0.57484573", "0.56683236", "0.5661904", "0.56503856", "0.5627947", "0.56013876", "0.5590276", "0.5547651", "0.5534208", "0.5517323", "0.5480123" ]
0.70806575
0
Start the middleware pipeline If a delegate is given, will pass on the possibly modified request object when the iterator is no longer valid.
protected function run( ServerRequestInterface $request, DelegateInterface $delegate = null, Dispatcher $that = null ): ResponseInterface { $that = $that ?: clone $this; $that->setRequest($request); try { $response = $that->step(); } catch (Exception\OutOfMiddlewareException $ex) { if ($delegate === null) { throw $ex; } $response = $delegate->process( $that->getRequest() ); } return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function next()\n {\n if (($middleware = next($this->middlewares))) {\n call_user_func($middleware, $this->request, $this->response, $this);\n } elseif ($this->parent !== null) {\n $this->parent->next();\n }\n }", "public function process(ServerRequestInterface $request, DelegateInterface $delegate)\n {\n if ($this->bootstrap) {\n $bootstrap = (microtime(true) - $this->start) * 1000;\n $this->stopwatch->set($this->bootstrap, $bootstrap);\n }\n\n /* Call all the other middlewares. */\n if ($this->process) {\n $this->stopwatch->start($this->process);\n $response = $delegate->process($request);\n $this->stopwatch->stop($this->process);\n }\n\n /* Time spent from starting the request to exiting last middleware. */\n if ($this->total) {\n $total = (microtime(true) - $this->start) * 1000;\n $this->stopwatch->set($this->total, (integer) $total);\n }\n $this->stopwatch->stopAll();\n\n return $response->withHeader(\n \"Server-Timing\",\n $this->generateHeader($this->stopwatch->values())\n );\n }", "public function run()\n {\n foreach ($this->middleware as $middleware) {\n $middleware = $this->bootstrapMiddleware($middleware);\n\n if (method_exists($middleware, 'handle')) {\n $middleware->handle($this->request, function (Request $request) {\n $this->request = $request;\n });\n }\n }\n\n return $this->request;\n }", "public function __invoke(\n RequestInterface $request,\n ResponseInterface $response,\n DelegateInterface $next = null\n )/*# : ResponseInterface */ {\n return $this->process($request, $response, $next);\n }", "protected function step(): ResponseInterface {\n\t\t$current = $this->getMiddleware();\n\n\t\tif ($current !== null) {\n\t\t\t$delegate = $this->createDelegate(\n\t\t\t\tfunction(ServerRequestInterface $request) {\n\t\t\t\t\treturn $this->setRequest($request)->step();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t$request = $this->getRequest();\n\n\t\t\treturn $current->process($request, $delegate);\n\t\t}\n\n\t\tthrow new Exception\\OutOfMiddlewareException(\n\t\t\t\"Middleware iterator exhausted.\"\n\t\t);\n\t}", "public function next()\n {\n next($this->requests);\n }", "public function process(HTTPRequest $request, callable $delegate)\n {\n /** @var HTTPResponse $response */\n $response = $delegate($request);\n\n // Ignore by regexes.\n if ($this->shouldCheckHttpHost() && $this->isIgnoredDomain($_SERVER['HTTP_HOST'])) {\n return $response;\n }\n\n foreach ($this->requestedPolicies as $requestedPolicy) {\n /** @var ControllerPolicy $policyInstance */\n $policyInstance = $requestedPolicy['policy'];\n\n $policyInstance->applyToResponse(\n $requestedPolicy['originator'],\n $request,\n $response\n );\n }\n\n return $response;\n }", "public function __invoke($request)\n {\n $next = $this->middleware->get($this->index);\n\n if ($next)\n {\n $name = ($next['n']) ?? '';\n $mParams = explode(',',($next['p']) ?? '');\n\n // check if the middleware class actually exist,\n // otherwise we will need to close out this.\n if (!class_exists($name)) return false;\n\n // increment the middelware we instantiate\n $this->index++;\n\n // begin our middleware instance\n $middleware = new $name();\n\n // load our middelware handle instance for the request\n if (method_exists($middleware, 'handle'))\n {\n $this->middlewareInstances[] = $middleware;\n\n return $middleware->handle($request, $this, ...$mParams);\n }\n else\n {\n // if the middleware does not have a handle, we will need to end the script.\n // All middlewares must have a handle.\n return false;\n }\n }\n\n // return the updated response\n return $this->response;\n }", "public function process(ServerRequestInterface $request, DelegateInterface $delegate): ResponseInterface {\n $path = $request->getUri()->getPath();\n if (strpos($path, $this->prefix) === 0) {\n return $this->container->get($this->middleware)->process($request, $delegate);\n }\n return $delegate->process($request);\n }", "public function handle($request, Closure $next)\n {\n parent::filter();\n\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n parent::filter();\n\n return $next($request);\n }", "public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next);", "abstract public function apply(Request $request, Response $response, Closure $next);", "function __invoke(Request $request, Response $response, callable $next)\n {\n if (isset($_SESSION['errors'])) {\n $this->view->getEnvironment()->addGlobal('errors', $_SESSION['errors']);\n unset($_SESSION['errors']);\n }\n\n // Next Middleware\n $response = $next($request, $response);\n return $response;\n }", "abstract function __invoke(RequestInterface $request, ResponseInterface $response, callable $next);", "public function call()\n {\n // Get the reference to the application\n $app = $this->app;\n\n // Get the application request without trailing slashes \n $requesturi = ltrim($app->request->getPathInfo(), '/');\n\n if($requesturi != 'unauthorized') {\n // Check if the user is authorized to execute this request\n if(!Security::isUserAuthorized($requesturi)) {\n $app->redirect('/unauthorized');\n }\n }\n\n // Run the inner middleware and application\n $this->next->call();\n }", "public function before(callable $delegate) {\n\t\t\t$this->before = $delegate;\n\t\t\treturn $this;\n\t\t}", "public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface\n\t{\n\t\tif ($this->isWhitelisted($request)) {\n\t\t\treturn $next($request, $response);\n\t\t}\n\n\t\t$user = $this->authenticator->authenticate($request);\n\n\t\t// If we have a identity, then go to next middlewares,\n\t\t// otherwise stop and return current response\n\t\tif ($user === null) {\n\t\t\treturn $this->denied($request, $response);\n\t\t}\n\n\t\t// Add info about current logged user to request attributes\n\t\t$request = $request->withAttribute(RequestAttributes::APP_LOGGED_USER, $user);\n\n\t\t// Pass to next middleware\n\t\treturn $next($request, $response);\n\t}", "public function run()\n\t{\n\t\t$response = $this->dispatch($this['request']);\n\n\t\t$response->send();\n\n\t\t$this->callFinishMiddleware($response);\n\t}", "public function handle($request, Closure $next)\n {\n $this->start_execution = microtime(true);\n return $next($request);\n }", "public function start()\n {\n foreach ($this->routes as $route) {\n if ($route->match()) {\n $this->applyRoute($route); \n }\n\n if (!$route->continue) {\n break;\n }\n }\n }", "public function next()\n {\n next($this->_filters);\n if (($closure = current($this->_filters)) === false) {\n return false;\n }\n $params = $this->_params = func_get_args() + $this->_params;\n array_unshift($params, $this);\n return call_user_func_array($closure, $params);\n }", "private function runMiddlewares()\n {\n $middleware = $this->getMiddleware();\n $this->middlewareIndex++;\n if (null === $middleware) {\n $this->runRoute();\n } else {\n return $middleware([$this, 'run']);\n }\n }", "public function handle($request, Closure $next)\n {\n Log::info(\n 'Beginning request',\n [\n 'time' => microtime(true),\n 'method' => $request->method(),\n 'uri' => $request->url()\n ]\n );\n\n return $next($request);\n }", "private static function middleware()\n {\n $files = ['Filters', 'Middleware'];\n $folder = static::$root.'Http/Middleware'.'/';\n\n self::call($files, $folder);\n\n $files = ['MiddlewareNotFoundException', 'MiddlewareWallException'];\n $folder = static::$root.'Http/Middleware/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "public function handle($request, Closure $next)\n {\n $this->request = $request;\n\n info(\"================== FeMiddleware: [\".$request->path().\"] ====================\");\n $this->process($this->request);\n info(\"================== End============================================\");\n \n return $next($this->request);\n }", "public function process(ServerRequestInterface $request, RequestHandlerInterface $delegate)\n {\n if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::'\n . __LINE__ . ' processing...');\n\n $dispatcher = $this->_getDispatcher();\n\n $uri = $request->getUri()->getPath();\n\n // remove trailing slashes - FastRoute is not handling uris with them correctly it seems\n $uri = preg_replace('/\\/+$/', '', $uri);\n\n // if the tine20 server is located in a subdir, we need to remove the server path from the uri\n $serverPath = Tinebase_Core::getUrl('path');\n $uri = preg_replace('/^' . preg_quote($serverPath, '/') . '/', '', $uri);\n\n if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::'\n . __LINE__ . ' FastRoute dispatching on method: ' . $request->getMethod() . ' and uri: '\n . $uri);\n\n $routeInfo = $dispatcher->dispatch($request->getMethod(), $uri);\n switch ($routeInfo[0]) {\n case FastRoute\\Dispatcher::NOT_FOUND:\n if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(__METHOD__ . '::'\n . __LINE__ . ' returning 404 not found');\n\n // 404 not found\n return new Response('php://memory', 404);\n case FastRoute\\Dispatcher::METHOD_NOT_ALLOWED:\n if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(__METHOD__ . '::'\n . __LINE__ . ' returning 405 method not allowed');\n\n //$allowedMethods = $routeInfo[1];\n // 405 method not allowed\n return new Response('php://memory', 405);\n case FastRoute\\Dispatcher::FOUND:\n if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::'\n . __LINE__ . ' FastRoute dispatching result: ' . print_r($routeInfo, true));\n\n $handler = Tinebase_Expressive_RouteHandler::fromArray($routeInfo[1]);\n $handler->setVars($routeInfo[2]);\n return $delegate->handle($request->withAttribute(Tinebase_Expressive_Const::ROUTE_HANDLER, $handler));\n break;\n default:\n throw new Tinebase_Exception_UnexpectedValue('fast route dispatcher returned unexpected route info');\n }\n\n // in case you ever want to call $delegate->process without add the Tinebase_Expressive_Const::ROUTE_HANDLER\n // then do it like this: $delegate->process($request->withoutAttribute(Tinebase_Expressive_Const::ROUTE_HANDLER)\n }", "public function handle($request, Closure $next)\n {\n return parent::handle($request, $next); // defer to the right stuff\n }", "public function setUp()\n {\n $this->middleware = new ForbiddenWordsFilterMiddleware(['badword']);\n $this->request = Phake::mock(ServerRequestInterface::class);\n $this->delegate = Phake::mock(DelegateInterface::class);\n\n // the class needs to know which route it matched. Create a fake result and tell the request to return that\n $this->route_result = Phake::mock(RouteResult::class);\n Phake::when($this->request)->getAttribute(RouteResult::class)->thenReturn($this->route_result);\n Phake::when($this->route_result)->getMatchedParams()->thenReturn([]);\n\n // return an empty body stream\n Phake::when($this->request)->getBody()->thenReturn(new BufferStream());\n\n // when try try to replace the body just return the same request as before.\n Phake::when($this->request)->withBody($this->anything())->thenReturn($this->request);\n }", "public function handle(Builder $builder, Closure $next)\n {\n if (!$this->request->has($this->filterName()) || $this->request->input($this->filterName(), '') === '') {\n return $next($builder);\n }\n return $this->applyFilters($next($builder));\n }" ]
[ "0.5794255", "0.5558549", "0.550864", "0.54824185", "0.5475669", "0.545505", "0.54468197", "0.5331015", "0.52557105", "0.5231224", "0.5231224", "0.5162262", "0.51076806", "0.5057811", "0.50243485", "0.49876884", "0.49771276", "0.49744737", "0.49687684", "0.495803", "0.49214035", "0.48839045", "0.4867241", "0.48664066", "0.4858104", "0.48579293", "0.4810056", "0.48058653", "0.47977063", "0.47962677" ]
0.5926326
0
Set the current ServerRequestInterface object
protected function setRequest(ServerRequestInterface $request) { $this->request = $request; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setRequest(ServerRequestInterface $request);", "public function setRequest(RequestInterface $request);", "public static function setRequest(RequestInterface $request)\n {\n $coroutineId = self::getCoroutineId();\n self::$context[$coroutineId][self::REQUEST_KEY] = $request;\n }", "public function setRequest(RequestInterface $request)\n {\n $this->request = $request;\n }", "public static function setRequestContext(ServerRequestInterface $request)\n {\n $uri = $request->getUri();\n static::$_requestContext = [\n '_base' => $request->getAttribute('base'),\n '_port' => $uri->getPort(),\n '_scheme' => $uri->getScheme(),\n '_host' => $uri->getHost(),\n ];\n }", "public function __invoke(\n ServerRequestInterface $request\n );", "protected function setRequest(RequestInterface $request): ResponseHandler\n {\n $this->request = $request;\n\n return $this;\n }", "public function __construct(PsrServerRequestInterface $request)\n {\n $this->request = $request;\n }", "function setRequest($request) {\n\t\t$this->m_request = $request;\n\t}", "function setRequest($value) {\n $this->request = $value;\n }", "public function process(ServerRequestInterface $request)\n {\n }", "public function setRequest($request);", "public function request() : ServerRequestInterface;", "public function setRequestEngine(RequestEngineInterface $requestEngine) {\n\t\t$this->requestEngine = $requestEngine;\n\t}", "function setRequest($request) {\n $this->request = $request;\n }", "public function forRequest(ServerRequestInterface $request): self\n {\n if ($request->getMethod() !== 'POST') {\n return $this;\n }\n\n $requestData = json_decode($request->getBody()->read(8192), true);\n if (empty($requestData)) {\n return $this;\n }\n\n $this->setSearchTerm($requestData['term']['label']);\n $this->setOriginalSearchValue($requestData['term']['search']);\n $this->setExcludeTerms($requestData['exclude'] ?? []);\n\n return $this;\n }", "public function __invoke(\n ServerRequestInterface $request,\n ResponseInterface $response\n );", "public function createServerRequestFromGlobals(): ServerRequestInterface;", "public function createServerRequestFromGlobals(): ServerRequestInterface;", "public function setResponse(ResponseInterface $request);", "public function setRequest(RequestInterface $request): ControllerInterface;", "public static function setRequestInfo($request)\n {\n if ($request instanceof ServerRequest) {\n static::pushRequest($request);\n } else {\n $requestData = $request;\n $requestData += [[], []];\n $requestData[0] += [\n 'controller' => false,\n 'action' => false,\n 'plugin' => null\n ];\n $request = new ServerRequest();\n $request->addParams($requestData[0])->addPaths($requestData[1]);\n static::pushRequest($request);\n }\n }", "public function prepareRequest(RequestInterface $request);", "private function setRequest() {\n // Create request object\n $this->request = Request::createFromGlobals();\n // Check caching and exit if so\n // - create a dummy response for possible 304\n $response = new Response();\n $seconds = Config::get()->pagecachetime;\n $response->setLastModified(new DateTime('-' . $seconds . ' seconds'));\n if ($response->isNotModified($this->getRequest())) {\n $response\n ->setSharedMaxAge($seconds)\n ->send();\n exit();\n }\n // Add better json request support\n // check request Content-Type\n $ctCheck = 0 === strpos(\n $this->request->headers->get('CONTENT_TYPE')\n , 'application/json'\n );\n // check request Method\n $methodCheck = in_array(\n strtoupper($this->request->server->get('REQUEST_METHOD', 'GET'))\n , array('PUT', 'DELETE', 'POST')\n );\n if ($ctCheck && $methodCheck) {\n $params = (array) json_decode($this->request->getContent());\n $this->request->request = new ParameterBag($params);\n }\n }", "public function __construct(ServerRequestInterface $serverRequest)\n {\n $userAgent = '';\n $serverParams = $serverRequest->getServerParams();\n\n if (isset($serverParams['REMOTE_ADDR'])) {\n $userAgent = $serverParams['REMOTE_ADDR'];\n }\n\n $this->userAgent = $userAgent;\n }", "public function setData(ServerRequestInterface $request) : void\n\t{\n\t\t$this->baseController->setBaseVariables($request);\n\n\t\t$month = $request->getAttribute('month');\n\t\t$formatIdentifier = $request->getAttribute('formatIdentifier');\n\t\t$rating = (int) $request->getAttribute('rating');\n\t\t$languageId = new LanguageId((int) $request->getAttribute('languageId'));\n\n\t\t$myFormat = $request->getCookieParams()[CookieNames::FORMAT] ?? '';\n\t\t$myRating = $request->getCookieParams()[CookieNames::RATING] ?? '';\n\n\t\t$this->statsUsageModel->setData(\n\t\t\t$month,\n\t\t\t$formatIdentifier,\n\t\t\t$rating,\n\t\t\t$myFormat,\n\t\t\t$myRating,\n\t\t\t$languageId\n\t\t);\n\t}", "public function setRequest(namespace\\Request $request)\n {\n $this->request = $request;\n }", "public function setRequest($request)\n {\n $this->request = $request;\n }", "public static function set_request($request){\n\t\t\tself::$request = $request;\n\t\t}", "public static function setAttribute(ServerRequestInterface $request, $name, $value)\n {\n $attributes = $request->getAttribute(self::KEY, []);\n $attributes[$name] = $value;\n\n return $request->withAttribute(self::KEY, $attributes);\n }" ]
[ "0.8789558", "0.78180313", "0.77397805", "0.76855034", "0.74649894", "0.7052358", "0.6970045", "0.68101746", "0.67305535", "0.66011596", "0.65865564", "0.6568458", "0.6544348", "0.64832836", "0.6470893", "0.64315104", "0.6385715", "0.63439685", "0.63439685", "0.6340564", "0.63030493", "0.6259971", "0.6251736", "0.6237574", "0.6230486", "0.6214483", "0.62110156", "0.6202675", "0.6112948", "0.610075" ]
0.82014227
1
Find a redirect code in the codes
function is_redirect_http_codes($http_codes) { foreach ($http_codes as $http_code) { if ( is_redirect_http_code($http_code) ) { return TRUE; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_url($url) {\r\n $http_codes = array();\r\n $urls = array();\r\n while (TRUE) {\r\n // Initialise curl and get the header\r\n $ch = curl_init($url);\r\n curl_setopt($ch, CURLOPT_HEADER, true);\r\n curl_setopt($ch, CURLOPT_NOBODY, true);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);\r\n curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);\r\n $content = curl_exec($ch);\r\n $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\r\n curl_close($ch);\r\n \r\n // Add urls and http codes to the arrays\r\n array_push($urls, $url);\r\n array_push($http_codes, $http_code);\r\n \r\n if ( is_redirect_http_code($http_code) ) {\r\n // Check for redirects, if found, follow the redirected URL\r\n if ( preg_match('/(?<=Location: )[^ \\s]*/i', $content, $matches) ) {\r\n $url = $matches[0];\r\n continue;\r\n }\r\n }\r\n \r\n // We can't do anything else\r\n break;\r\n }\r\n \r\n // Contains all the http_codes and urls encountered\r\n $ret['http_codes'] = $http_codes;\r\n $ret['urls'] = $urls;\r\n // For easy access, contains the last http_code and url encountered\r\n $ret['http_code'] = $http_code;\r\n $ret['url'] = $url;\r\n return $ret;\r\n}", "private function get_redirect( $line, $target, $code, $source ) {\n\t\t$line = ltrim( $line, '^' );\n\t\t$line = rtrim( $line, '$' );\n\n\t\tif ( isset( $source['flag_case'] ) && $source['flag_case'] ) {\n\t\t\t$line = '(?i)^' . $line;\n\t\t} else {\n\t\t\t$line = '^' . $line;\n\t\t}\n\n\t\t$line = preg_replace( \"/[\\r\\n\\t].*?$/s\", '', $line );\n\t\t$line = preg_replace( '/[^\\PC\\s]/u', '', $line );\n\t\t$target = preg_replace( \"/[\\r\\n\\t].*?$/s\", '', $target );\n\t\t$target = preg_replace( '/[^\\PC\\s]/u', '', $target );\n\n\t\treturn 'rewrite ' . $line . '$ ' . $target . ' ' . $code . ';';\n\t}", "function changeRedirectorUrlTag(&$codes = [])\n{\n foreach ($codes as $codeId => $code) {\n if ($code['tag'] == 'url' && $code['type'] == 'unparsed_content') {\n $codes[$codeId]['validate'] = function (&$tag, &$data) {\n changeUrlUnparsedContentCode($tag, $data);\n };\n } elseif ($code['tag'] == 'url' && $code['type'] == 'unparsed_equals') {\n $codes[$codeId]['validate'] = function (&$tag, &$data) {\n changeUrlUnparsedEqualsCode($tag, $data);\n };\n } elseif ($code['tag'] == 'iurl' && $code['type'] == 'unparsed_content') {\n $codes[$codeId]['validate'] = function (&$tag, &$data) {\n changeUrlUnparsedContentCode($tag, $data);\n };\n } elseif ($code['tag'] == 'iurl' && $code['type'] == 'unparsed_equals') {\n $codes[$codeId]['validate'] = function (&$tag, &$data) {\n changeUrlUnparsedEqualsCode($tag, $data);\n };\n }\n }\n}", "private function get_redirect_source() {\n\t\t$ignore = [\n\t\t\t'WP_Hook',\n\t\t\t'template-loader.php',\n\t\t\t'wp-blog-header.php',\n\t\t];\n\n\t\t// phpcs:ignore\n\t\t$source = wp_debug_backtrace_summary( null, 5, false );\n\n\t\treturn array_filter( $source, function( $item ) use ( $ignore ) {\n\t\t\tforeach ( $ignore as $ignore_item ) {\n\t\t\t\tif ( strpos( $item, $ignore_item ) !== false ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} );\n\t}", "public static function checkCode($code)\n {\n return static::where('short_url', $code)\n ->first();\n }", "private static function pay($code, $redirect)\n {\n $url = URL::getUrl('Pay');\n\n $location = \"{$url}{$code}\";\n\n /** */\n if ($redirect)\n {\n return redirect()->away($location);\n }\n\n return $location;\n }", "protected function getAccessCode()\n {\n return $_GET[self::RESPONSE_CODE_PARAM];\n }", "public function GetRedirect ();", "private function getIdFromRedirectedUrl(): string\n {\n $url = $this->getResponse()\n ->getHeader('Location')\n ->getFieldValue();\n $pattern = '!/id/(.*?)/!';\n $result = preg_match($pattern, $url, $matches);\n\n return $result ? $matches[1] : '';\n }", "abstract protected function get_redirect_page();", "function getHttpResponseCode_using_getheaders($url, $followredirects = true){\n // NOTE: could potentially take up to 0-30 seconds , blocking further code execution (more or less depending on connection, target site, and local timeout settings))\n // if $followredirects == false: return the FIRST known httpcode (ignore redirects)\n // if $followredirects == true : return the LAST known httpcode (when redirected)\n if(! $url || ! is_string($url)){\n return false;\n }\n $headers = @get_headers($url);\n if($headers && is_array($headers)){\n if($followredirects){\n // we want the the last errorcode, reverse array so we start at the end:\n $headers = array_reverse($headers);\n }\n foreach($headers as $hline){\n // search for things like \"HTTP/1.1 200 OK\" , \"HTTP/1.0 200 OK\" , \"HTTP/1.1 301 PERMANENTLY MOVED\" , \"HTTP/1.1 400 Not Found\" , etc.\n // note that the exact syntax/version/output differs, so there is some string magic involved here\n if(preg_match('/^HTTP\\/\\S+\\s+([1-9][0-9][0-9])\\s+.*/', $hline, $matches) ){// \"HTTP/*** ### ***\"\n $code = $matches[1];\n return $code;\n }\n }\n // no HTTP/xxx found in headers:\n return false;\n }\n // no headers :\n return false;\n }", "public function GetCode()\n {\n if($this->_correctHttpLine != null)\n {\n preg_match(\"|^HTTP/[\\d\\.x]+ (\\d+)|\", $this->_correctHttpLine, $m);\n if (isset($m[1])) { return (int)$m[1]; }\n }\n\n return false;\n }", "protected function getMethodRedirectUrl($code)\n {\n return $this->_methods[$code]->getCheckoutRedirectUrl();\n }", "public function getCode()\n {\n $this->code = $_GET['code'];\n return $this->code;\n\n }", "function detect_link(&$comcode,$pos)\n{\n\t$link_end_pos=strpos($comcode,' ',$pos-1);\n\t$link_end_pos_2=strpos($comcode,chr(10),$pos-1);\n\t$link_end_pos_3=strpos($comcode,'[',$pos-1);\n\t$link_end_pos_4=strpos($comcode,')',$pos-1);\n\t$link_end_pos_5=strpos($comcode,'\"',$pos-1);\n\t$link_end_pos_6=strpos($comcode,'>',$pos-1);\n\t$link_end_pos_7=strpos($comcode,'<',$pos-1);\n\t$link_end_pos_8=strpos($comcode,'.'.chr(10),$pos-1);\n\t$link_end_pos_9=strpos($comcode,',',$pos-1);\n\tif (($link_end_pos_2!==false) && (($link_end_pos===false) || ($link_end_pos_2<$link_end_pos))) $link_end_pos=$link_end_pos_2;\n\tif (($link_end_pos_3!==false) && (($link_end_pos===false) || ($link_end_pos_3<$link_end_pos))) $link_end_pos=$link_end_pos_3;\n\tif (($link_end_pos_4!==false) && (($link_end_pos===false) || ($link_end_pos_4<$link_end_pos))) $link_end_pos=$link_end_pos_4;\n\tif (($link_end_pos_5!==false) && (($link_end_pos===false) || ($link_end_pos_5<$link_end_pos))) $link_end_pos=$link_end_pos_5;\n\tif (($link_end_pos_6!==false) && (($link_end_pos===false) || ($link_end_pos_6<$link_end_pos))) $link_end_pos=$link_end_pos_6;\n\tif (($link_end_pos_7!==false) && (($link_end_pos===false) || ($link_end_pos_7<$link_end_pos))) $link_end_pos=$link_end_pos_7;\n\tif (($link_end_pos_8!==false) && (($link_end_pos===false) || ($link_end_pos_8<$link_end_pos))) $link_end_pos=$link_end_pos_8;\n\tif (($link_end_pos_9!==false) && (($link_end_pos===false) || ($link_end_pos_9<$link_end_pos))) $link_end_pos=$link_end_pos_9;\n\tif ($link_end_pos===false) $link_end_pos=strlen($comcode);\n\t$auto_link=preg_replace('#keep_session=\\d*#','filtered=1',substr($comcode,$pos-1,$link_end_pos-$pos+1));\n\n\treturn array($link_end_pos,$auto_link);\n}", "public static function getDrupalGotoCode() {\n global $drupal_goto;\n return !empty($drupal_goto['http_response_code']) ?\n $drupal_goto['http_response_code'] : '';\n }", "public static function getOriginalUrl($code)\n {\n $url = static::checkCode($code);\n if (!empty($url)) {\n $url->hits++;\n $url->save();\n\n return $url->original_url;\n }\n\n return false;\n }", "public function getPermanentRedirectStatuscode(): MwRedirectResponseStatuscode\n {\n return $this->findStatuscodeBy(['type' => self::REDIRECT_STATUSCODE_301]);\n }", "protected function _extractHttpCode($header) {\n\t\tpreg_match(\n\t\t\t'#^HTTP/[0-9\\.]+\\s(?P<code>[0-9]+)#i',\n\t\t\t$header,\n\t\t\t$matches\n\t\t);\n\n\t\treturn isset($matches['code'])\n\t\t\t? $matches['code']\n\t\t\t: $this->_defaultCode;\n\t}", "public function customRedirect($param, $redirectcode) {\n\t$redirect = $this->trimSlash(Mage::getUrl($param));\n if($redirectcode == 0 || $redirectcode == 'default' || $redirectcode == 302 ){\n\t\tMage::app()->getFrontController()->getResponse()->setRedirect($redirect, 302);\n\t\t} else { \n\t\tMage::app()->getFrontController()->getResponse()->setRedirect($redirect, 301);\n\t\t} \n Mage::app()->getResponse()->sendResponse();\n exit;\n }", "function get_oauth_code($wpoa) {\n\t$params = array(\n\t\t'response_type' => 'code',\n\t\t'client_id' => CLIENT_ID,\n\t\t'scope' => SCOPE,\n\t\t'state' => uniqid('', true),\n\t\t'redirect_uri' => REDIRECT_URI,\n\t);\n\t$_SESSION['WPOA']['STATE'] = $params['state'];\n\t$url = URL_AUTH . http_build_query($params);\n\theader(\"Location: $url\");\n\texit;\n}", "protected function checkRedirect() {}", "public function isRedirect(): bool\n {\n return $this->code >= 300 && $this->code < 400;\n }", "public function getRedirect(): ?string\n {\n if ($this->getText() && preg_match('/^#REDIRECT(?:ION)? ?\\[\\[([^]]+)]]/i', $this->getText(), $matches)) {\n return (string)trim($matches[1]);\n }\n\n return null;\n }", "private function hasReferralCode()\n {\n if (self::isLogin()) {\n $model = $this->model->where('user_id', Auth::id());\n\n if ($model->count() > 0) {\n $this->code = $model->first()->code;\n return true;\n }\n }\n\n return false;\n }", "function is_redirect ($sc) { \n return $sc >= 300 && $sc < 400; \n}", "public function getCode()\n\t{\n\t\t$matches = array();\n\t\tif (isset($this->headers) && isset($this->headers[0]))\n\t\t\tpreg_match('|HTTP/\\d\\.\\d\\s+(\\d+)\\s+.*|', $this->headers[0], $matches);\n\t\treturn isset($matches[1]) ? (int)$matches[1] : 0;\n\t}", "function redirected(){ return strlen((string)$this->getLocation())>0; }", "public function checkFavebookInsightsCode($code) {\r\n if ($code <> '') {\r\n if (strpos($code, 'content') !== false) {\r\n preg_match('/content\\\\s*=\\\\s*[\\'\\\"]([^\\'\\\"]+)[\\'\\\"]/i', $code, $result);\r\n $code = '';\r\n if (isset($result[1]) && !empty($result[1])) {\r\n $code = $result[1];\r\n }\r\n }\r\n\r\n if (strpos($code, 'facebook.com/') !== false) {\r\n preg_match('/facebook.com\\/([^\\/]+)/i', $code, $result);\r\n $code = '';\r\n if (isset($result[1]) && !empty($result[1])) {\r\n $json = SQ_Tools::sq_remote_get('http://graph.facebook.com/' . $result[1]);\r\n if ($json <> '') {\r\n if ($json = @json_decode($json)) {\r\n if (isset($json->id)) {\r\n $code = $json->id;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (strpos($code, '\"') !== false) {\r\n preg_match('/[\\'\\\"]([^\\'\\\"]+)[\\'\\\"]/i', $code, $result);\r\n $code = '';\r\n if (isset($result[1]) && !empty($result[1])) {\r\n $code = $result[1];\r\n }\r\n }\r\n\r\n if ($code == '') {\r\n SQ_Error::setError(__(\"The code for Facebook is incorrect.\", _SQ_PLUGIN_NAME_));\r\n }\r\n }\r\n return $code;\r\n }", "protected function processRedirect() {}" ]
[ "0.5923443", "0.5621442", "0.55835414", "0.55640584", "0.54911375", "0.5490793", "0.5484887", "0.54746276", "0.5465752", "0.54568994", "0.54501665", "0.54036313", "0.5374671", "0.53691274", "0.5354483", "0.53535295", "0.5334649", "0.5333545", "0.52064425", "0.5204692", "0.5199307", "0.5179773", "0.51458484", "0.51305836", "0.51275104", "0.5114682", "0.5111576", "0.5109506", "0.5103006", "0.50689906" ]
0.62229073
0
Array of urls and http codes
function check_url($url) { $http_codes = array(); $urls = array(); while (TRUE) { // Initialise curl and get the header $ch = curl_init($url); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_NOBODY, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); $content = curl_exec($ch); $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); // Add urls and http codes to the arrays array_push($urls, $url); array_push($http_codes, $http_code); if ( is_redirect_http_code($http_code) ) { // Check for redirects, if found, follow the redirected URL if ( preg_match('/(?<=Location: )[^ \s]*/i', $content, $matches) ) { $url = $matches[0]; continue; } } // We can't do anything else break; } // Contains all the http_codes and urls encountered $ret['http_codes'] = $http_codes; $ret['urls'] = $urls; // For easy access, contains the last http_code and url encountered $ret['http_code'] = $http_code; $ret['url'] = $url; return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUrls(): array;", "public function getUrls(): array;", "function urls($data)\r\n{\r\n $result = array();\r\n if (is_array($data)) {\r\n if (isset($data['href']))\r\n $result[] = $data['href']; else\r\n foreach ($data as $d)\r\n if (is_array($d))\r\n $result[] = $d['href']; else\r\n $result[] = $d;\r\n } else $result[] = $data;\r\n\r\n // Make URLs full\r\n $result2 = array();\r\n global $last_url, $last_base;\r\n $last_domain = substr($last_url, 0, strpos($last_url, '/', 10));\r\n if ($p = strpos($last_url,'?'))\r\n $last_php = substr($last_url,0,$p);\r\n else $last_php = $last_url;\r\n\r\n foreach ($result as $url) {\r\n $url = trim($url);\r\n if (!$url)\r\n continue;\r\n $url = str_replace('./','',$url);\r\n if (substr($url,0,2)=='//') $url = 'http:'.$url;\r\n if (strpos($url, '://') === false)\r\n if ($url[0] == '/')\r\n $url = $last_domain . $url;\r\n elseif ($url[0] == '?') $url = $last_php . $url;\r\n else $url = $last_base . $url;\r\n // Check for right donor\r\n //if (strpos(domain($url),$GLOBALS['instruction']['host'])===false) continue;\r\n $result2[] = $url;\r\n }\r\n $r = $result2;\r\n\r\n if (DEV)\r\n xlogc('urls', $r, $data);\r\n\r\n return $r;\r\n}", "public function getWebsiteCodes()\n {\n return $this->websiteCodes;\n }", "public function httpCodes($code = null) {\n\t\tif (empty($code)) {\n\t\t\treturn $this->_statusCodes;\n\t\t}\n\t\tif (is_array($code)) {\n\t\t\t$codes = array_keys($code);\n\t\t\t$min = min($codes);\n\t\t\tif (!is_int($min) || $min < 100 || max($codes) > 999) {\n\t\t\t\tthrow new CakeException(__d('cake_dev', 'Invalid status code'));\n\t\t\t}\n\t\t\t$this->_statusCodes = $code + $this->_statusCodes;\n\t\t\treturn true;\n\t\t}\n\t\tif (!isset($this->_statusCodes[$code])) {\n\t\t\treturn null;\n\t\t}\n\t\treturn array($code => $this->_statusCodes[$code]);\n\t}", "static public function getCodes(){\n return array(\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Moved Temporarily',\n 307 => 'Temporary Redirect',\n 310 => 'Too many Redirects',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Time-out',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested range unsatisfiable',\n 417 => 'Expectation failed',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Time-out',\n 508 => 'Loop detected',\n );\n }", "private function codes()\n {\n $a_http_status_codes = array(\n 100 => 'Continue', 102 => 'Processing',\n 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content',\n 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-Status', 208 => 'Already Reported',\n 226 => 'IM Used', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other',\n 304 => 'Not Modified', 305 => 'Use Proxy', 307 => 'Temporary Redirect', 308 => 'Permanent Redirect',\n 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found',\n 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout',\n 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', 421 => 'Misdirected Request',\n 422 => 'Unprocessable Entity', 423 => 'Locked', 424 => 'Failed Dependency', 426 => 'Upgrade Required',\n 428 => 'Precondition Required', 429 => 'Too Many Requests', 431 => 'Request Header Fields Too Large',\n 451 => 'Unavailable For Legal Reasons', 500 => 'Internal Server Error', 501 => 'Not Implemented',\n 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported',\n 506 => 'Variant Also Negotiates', 507 => 'Insufficient Storage', 508 => 'Loop Detected',\n 510 => 'Not Extended', 511 => 'Network Authentication Required'\n );\n return $a_http_status_codes;\n }", "function getHttpCode();", "public function getUrls()\r\n {\r\n }", "function is_redirect_http_codes($http_codes) {\r\n foreach ($http_codes as $http_code) {\r\n if ( is_redirect_http_code($http_code) ) {\r\n return TRUE;\r\n }\r\n }\r\n}", "public function httpStatusDataProvider()\n {\n return [\n [\"badGateway\", 502, \"Bad gateway\"],\n [\"badRequest\", 400, \"Bad request\"],\n [\"conflict\", 409, \"Conflict\"],\n [\"expectationFailed\", 417, \"Expectation failed\"],\n [\"forbidden\", 403, \"Forbidden\"],\n [\"gatewayTimeout\", 504, \"Gateway timeout\"],\n [\"gone\", 410, \"Gone\"],\n [\"httpVersionNotSupported\", 505, \"Http version not supported\"],\n [\"internalServerError\", 500, \"Internal server error\"],\n [\"lengthRequired\", 411, \"Length required\"],\n [\"methodNotAllowed\", 405, \"Method not allowed\"],\n [\"notAcceptable\", 406, \"Not acceptable\"],\n [\"notFound\", 404, \"Not found\"]\n // TODO: Add the remaining status codes.\n ];\n }", "function getList($urls){\n\t\t$urls = preg_split(\"[\\r\\n]\",$urls);\n\t\t$output = array();\n\t\t$counter = 0;\n\t\tforeach($urls as $url){\n\t\t\t$url = trim($url);\n\t\t\tif($url){\n\t\t\t\t$counter++;\n\t\t\t\t$output[$this->fixurl($url)] = $this->getPRInfo($url);\n\t\t\t}\n\t\t\tif($counter >= 10) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $output;\n\t}", "function get_internal_links($array){\r\n $result = array();\r\n $count = count($array);\r\n for($i=0;$i<$count;$i++){\r\n if(!empty($array[$i])){ \r\n if(strpos($array[$i],\"www\",0) === false){\r\n if(strpos($array[$i],\"http\",0) === false){ \r\n array_push($result,$array[$i]);\r\n }\r\n }\r\n }\r\n }\r\n return $result;\r\n}", "public function getAll(): array\n {\n\n\t$url = new Url();\n\n return array_merge(\n apache_request_headers(),\n apache_response_headers(),\n get_headers($url->hostWithSchema($url->getHostIp()), 1)\n );\n\n }", "protected function getHttpResponseCodes() {\n return array (\n 100 => 'Continue',\n 101 => 'Switching Protocols',\n 102 => 'Processing',\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 203 => 'Non-Authoritative Information',\n 204 => 'No Content',\n 205 => 'Reset Content',\n 206 => 'Partial Content',\n 207 => 'Multi-Status',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Found',\n 303 => 'See Other',\n 304 => 'Not Modified',\n 305 => 'Use Proxy',\n 306 => 'Switch Proxy',\n 307 => 'Temporary Redirect',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not Allowed',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Timeout',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable',\n 417 => 'Expectation Failed',\n 418 => 'I\\'m a teapot',\n 422 => 'Unprocessable Entity',\n 423 => 'Locked',\n 424 => 'Failed Dependency',\n 425 => 'Unordered Collection',\n 426 => 'Upgrade Required',\n 449 => 'Retry With',\n 450 => 'Blocked by Windows Parental Controls',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Timeout',\n 505 => 'HTTP Version Not Supported',\n 506 => 'Variant Also Negotiates',\n 507 => 'Insufficient Storage',\n 509 => 'Bandwidth Limit Exceeded',\n 510 => 'Not Extended'\n );\n }", "public function getUrls() {\n return $this->urls;\n }", "public function getRedirects();", "public function getPageUris();", "public function badUrlProvider() {\n\n $badRedirects[\"ip: 127.0.0.1\"] = array(\"http://127.0.0.1\", false);\n\n // Anything that resolves to zero needs to be tested carefully due to falsiness\n $badRedirects[\"ip: 0\"] = array(\"http://0/data.json\", false);\n\n // Hex is bad\n $badRedirects[\"ip: hex\"] = array(\"http://0x7f000001/data.json\", false);\n\n // So is octal\n $badRedirects[\"ip: octal\"] = array(\"http://0123/data.json\", false);\n\n // We don't like mixed hex and octal either\n $badRedirects[\"ip: mixed hex/octal/decimal\"] = array(\"http://0x7f.0x0.0.0/data.json\", false);\n\n // We don't even like dotted-quads\n $badRedirects[\"ip: dotted-quad\"] = array(\"http://111.22.34.56/data.json\", false);\n\n // Don't you come around here with any of that IPv6 crap\n $badRedirects[\"ipv6: localhost\"] = array(\"http://[::1]\", false);\n\n // Domains that resolve to IPv4 localhost? NFW.\n $badRedirects[\"localhost.ip4\"] = array(\"https://localhost.ip4/\", [['type' => 'A', 'ip' => '127.0.0.1']]);\n\n // Domains that resolve to IPv6 localhost? Get out!\n $badRedirects[\"localhost.ip6\"] = array(\"https://localhost.ip6:443\", [['type' => 'AAAA', 'ipv6' => '::1']]);\n\n // Domains that resolve to IPv6 addresses that represent IPv4 private ranges? Not on our watch!\n $badRedirects[\"localhost2.ip6\"] = array(\"http://localhost2.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:127.0.0.1']]);\n $badRedirects[\"private1.ip6\"] = array(\"https://private1.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:192.168.1.18']]);\n $badRedirects[\"private2.ip6\"] = array(\"https://private2.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:10.0.0.1']]);\n $badRedirects[\"private3.ip6\"] = array(\"http://private3.ip6:80\", [['type' => 'AAAA', 'ipv6' => '::ffff:127.0.0.2']]);\n\n // Domains that resolve to IPv6 link-local adddresses? Hell no!\n $badRedirects[\"linklocal.ip6\"] = array(\"https://linklocal.ip6/\", [['type' => 'AAAA', 'ipv6' => 'fe80::']]);\n\n return $badRedirects;\n }", "public function requests() {\n return array(\n // Format:\n // array('expected', 'YOURLS_SITE', '/request_uri'),\n\n // 1. short URL without www\n array('blah', 'http://sho.rt', '/blah'),\n array('bleh', 'https://sho.rt', '/bleh'),\n array('bloh', 'http://www.sho.rt', '/bloh'),\n array('bluh', 'https://www.sho.rt', '/bluh'),\n\n // 2. short URL with www\n array('meeh', 'http://sho.rt', '/meeh'),\n array('maah', 'https://sho.rt', '/maah'),\n array('muuh', 'http://www.sho.rt', '/muuh'),\n array('mooh', 'https://www.sho.rt', '/mooh'),\n\n // 3. Same as 1, with YOURLS in subdir\n array('hehe', 'http://sho.rt/yourls', '/yourls/hehe'),\n array('haha', 'https://sho.rt/yourls', '/yourls/haha'),\n array('hoho', 'http://www.sho.rt/yourls', '/yourls/hoho'),\n array('huhu', 'https://www.sho.rt/yourls', '/yourls/huhu'),\n\n // 4. Same as 2, with YOURLS in subdir\n array('ozhy', 'http://sho.rt/yourls', '/yourls/ozhy'),\n array('yhzo', 'https://sho.rt/yourls', '/yourls/yhzo'),\n array('zohy', 'http://www.sho.rt/yourls', '/yourls/zohy'),\n array('zoyh', 'https://www.sho.rt/yourls', '/yourls/zoyh'),\n\n\n // All the same tests, with a trailing slash on YOURLS_SITE\n\n array('blah', 'http://sho.rt/', '/blah'),\n array('bleh', 'https://sho.rt/', '/bleh'),\n array('bloh', 'http://www.sho.rt/', '/bloh'),\n array('bluh', 'https://www.sho.rt/', '/bluh'),\n\n array('meeh', 'http://sho.rt/', '/meeh'),\n array('maah', 'https://sho.rt/', '/maah'),\n array('muuh', 'http://www.sho.rt/', '/muuh'),\n array('mooh', 'https://www.sho.rt/', '/mooh'),\n\n array('hehe', 'http://sho.rt/yourls/', '/yourls/hehe'),\n array('haha', 'https://sho.rt/yourls/', '/yourls/haha'),\n array('hoho', 'http://www.sho.rt/yourls/', '/yourls/hoho'),\n array('huhu', 'https://www.sho.rt/yourls/', '/yourls/huhu'),\n\n array('ozhy', 'http://sho.rt/yourls/', '/yourls/ozhy'),\n array('yhzo', 'https://sho.rt/yourls/', '/yourls/yhzo'),\n array('zohy', 'http://www.sho.rt/yourls/', '/yourls/zohy'),\n array('zoyh', 'https://www.sho.rt/yourls/', '/yourls/zoyh'),\n\n\n // For people having fun with MixEd case UrLs\n array('MiXeD', 'http://SHO.rt/', '/MiXeD'),\n array('CaSe', 'http://SHO.rt/Yourls/', '/Yourls/CaSe'),\n\n\n // Internal pages, sort of\n // Note that in a real case use, this won't happen since the client request won't trigger the .htaccess rewrite rules\n array('admin/index.php', 'https://www.sho.rt', '/admin/index.php'),\n array('admin/tools.php', 'http://www.sho.rt/yourls', '/yourls/admin/tools.php'),\n array('admin/plugins.php', 'https://sho.rt/yourls/', '/yourls/admin/plugins.php'),\n\n\n // Unexpected URI (out of YOURLS base) should return itself\n // Note that in a real case use, this won't happen since the client request won't trigger the .htaccess rewrite rules\n array('something.else/blah', 'http://sho.rt', '/something.else/blah'),\n array('something.else/blah', 'https://www.sho.rt', '/something.else/blah'),\n array('/oops', 'https://www.sho.rt/yourls', '/oops'),\n\n\n // Query strings which should be ignored\n array('behemoth', 'http://sho.rt', '/behemoth?sho.rt'),\n array('behemoth', 'http://sho.rt/behemoth', '/behemoth/behemoth?behemoth'),\n\n\n // \"Prefix and shorten\" scenarios (query strings which should be preserved)\n array('http://longurl', 'http://sho.rt', '/http://longurl'),\n array('http://longurl', 'https://sho.rt/yourls', '/yourls/http://longurl'),\n array('http://longurl?https://sho.rt/yourls', 'https://sho.rt/yourls', '/yourls/http://longurl?https://sho.rt/yourls'),\n array('http://sho.rt/somepage', 'http://sho.rt', '/http://sho.rt/somepage'),\n array('http://www.sho.rt/sub/dir/', 'http://www.sho.rt/sub/dir/', '/sub/dir///http://www.sho.rt/sub/dir/'),\n );\n }", "public function list(){\n\n $urls = Urls::all();\n \n $capturas = array();\n foreach($urls as $key=>$val){\n $status = $this->status_url($val['url']);\n $conteudo = $this->content_url($val['url']);\n /* bem simples. salva os dados no banco */\n $capturas[] = array('conteudo' => $conteudo, 'status' => $status, 'url_id' => $val['id']);\n }\n\n $this->salvar($capturas);\n }", "function getHttpResponseCode_using_getheaders($url, $followredirects = true){\n // NOTE: could potentially take up to 0-30 seconds , blocking further code execution (more or less depending on connection, target site, and local timeout settings))\n // if $followredirects == false: return the FIRST known httpcode (ignore redirects)\n // if $followredirects == true : return the LAST known httpcode (when redirected)\n if(! $url || ! is_string($url)){\n return false;\n }\n $headers = @get_headers($url);\n if($headers && is_array($headers)){\n if($followredirects){\n // we want the the last errorcode, reverse array so we start at the end:\n $headers = array_reverse($headers);\n }\n foreach($headers as $hline){\n // search for things like \"HTTP/1.1 200 OK\" , \"HTTP/1.0 200 OK\" , \"HTTP/1.1 301 PERMANENTLY MOVED\" , \"HTTP/1.1 400 Not Found\" , etc.\n // note that the exact syntax/version/output differs, so there is some string magic involved here\n if(preg_match('/^HTTP\\/\\S+\\s+([1-9][0-9][0-9])\\s+.*/', $hline, $matches) ){// \"HTTP/*** ### ***\"\n $code = $matches[1];\n return $code;\n }\n }\n // no HTTP/xxx found in headers:\n return false;\n }\n // no headers :\n return false;\n }", "function sdppi_url($year)\n\t{\n\t\tfor ($i=1; $i < 13; $i++)\n\t\t{ \n\t\t\tif ($i < 10)\n\t\t\t{\n\t\t\t\t$url = 'http://sdppi.kominfo.go.id/downloads/43/RHU-'.$year.'0'.$i.'.htm';\n\t\t\t\t$headers = get_headers($url);\n\t\t\t\t$status = substr($headers[0], 9, 3);\n\n\t\t\t\t//Memastikan link yang dihasilkan dapat diakses\n\t\t\t\tif ($status == '200')\n\t\t\t\t\t$result[$i-1] = $url;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$url = 'http://sdppi.kominfo.go.id/downloads/43/RHU-'.$year.$i.'.htm';\n\t\t\t\t$headers = get_headers($url);\n\t\t\t\t$status = substr($headers[0], 9, 3);\n\n\t\t\t\tif ($status == '200')\n\t\t\t\t\t$result[$i-1] = $url;\n\t\t\t}\n\t\t}\n\n\t\treturn array_values($result);\n\t}", "public function parseCode(string $code): array\n {\n $arrayImg = [];\n $regex = self::REGEX;\n preg_match_all($regex, $code, $arrayImg);\n $imageUrl = $arrayImg[1];\n\n return $imageUrl;\n }", "public function getUriList();", "function findPageUrls();", "public function getStatusCodes(): array\n {\n $rep = $this->em->getRepository(StatusCodes::class)->findAll();\n $arr = [];\n foreach ($rep as $item)\n {\n $arr[] = ['code' => $item->getScode(), 'title' => $item->getTitle()];\n }\n return $arr;\n }", "public function getUrls(string $html, string $parts='base.dir.file.ext.query') : array\n {\n if ($this->domainAcceptedCache->count() > $this->domainAcceptedCacheSize) {\n $this->domainAcceptedCache = $this->domainAcceptedCache\n ->slice(- $this->domainAcceptedCacheSize + $this->domainAcceptedCacheChunkSize);\n }\n return array_map(\n function ($url) {\n return (string) $url;\n },\n $this->filterExtensions(\n $this->filterDomains(\n $this->filterSchemes(\n $this->getAllUrls($html, $parts)\n )\n )\n )->toArray()\n );\n }", "public static function get_img_links($url) {\n // reset error and warnings;\n self::$error_msg = array();\n self::$warning_msg = array();\n self::$curl = curl_init();\n\n // check url\n if (!self::_url_is_valid($url)) {\n self::$error_msg[] = \"Invalid or empty URL Received, please try again.\";\n return array();\n }\n\n // url is valid, continue parsing\n $content = self::_fetch_url_content($url);\n $domain = self::_get_domain($url);\n $dom = self::_get_parsed_dom($content);\n\n $sanitized_img_links = self::_get_sanitized_img_links($dom, $domain);\n curl_close(self::$curl);\n\n return $sanitized_img_links;\n }", "public function providerRetriableCodes() {\n return array(\n array(Response::STATUS_CODE_429),\n array(Response::STATUS_CODE_503),\n array(Response::STATUS_CODE_504)\n );\n }" ]
[ "0.6547203", "0.6547203", "0.61781675", "0.6152183", "0.6105734", "0.6052675", "0.600427", "0.600287", "0.5984404", "0.5958778", "0.585329", "0.58336395", "0.5811", "0.5805932", "0.5791834", "0.5785595", "0.57458806", "0.5737714", "0.57219404", "0.5711406", "0.5698449", "0.56954277", "0.56746966", "0.5653655", "0.564077", "0.56044537", "0.5602478", "0.5574225", "0.5559524", "0.55504316" ]
0.6714659
0
/ 2.6 IMG ALT TAG ATTACHMENT /
function IMGalt_Attachment($attributes, $attachment){ // print_r($attributes); // print_r($attachment); // get up to date alt attribute $alt = SELF::getAltAttribute($attachment->ID); // set alt tag $attributes['alt'] = $alt; // output return $attributes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_image_send_to_editor($id, $caption, $title, $align, $url = '', $rel = \\false, $size = 'medium', $alt = '')\n {\n }", "function custom_send_image_to_editor( $html, $id, $caption, $title, $align, $url, $size, $alt ) {\n\n\t$url = wp_get_attachment_url($id);\n\n\t$html_str = '<div class=\"align-' . esc_attr($align) . '\">';\n\n \t\t$html_str .= \"<p><img src='$url' alt='$title' /></p>\";\n\n\t\tif($caption) $html_str .= '\n\t\t<p class=\"wp-caption-text\">' . $caption . '</p>\n\t\t';\n\n\t$html_str .= '</div>';\n\n return $html_str;\n}", "public function getImageTag();", "function IMGalt_Content($content) {\n if($content):\n // encode content\n $content = mb_convert_encoding($content, 'HTML-ENTITIES', \"UTF-8\");\n $document = new \\DOMDocument();\n // Disable libxml errors and allow user to fetch error information as needed\n libxml_use_internal_errors(true);\n $document->loadHTML(utf8_decode($content), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);\n // get img tag from content\n $images = $document->getElementsByTagName('img');\n foreach ($images as $image) {\n // get orginal from srcset\n if( $image->hasAttribute('srcset') ):\n $orginal = '';\n // get srcset from content and explode to array\n $srcset = $image->getAttribute('srcset');\n $srcset_array = explode(\", \", $srcset);\n // get orginal size\n foreach ($srcset_array as $key => $value) {\n $single_srcset = explode(\" \", $value);\n $src_size = str_replace(\"w\", \"\", end($single_srcset));\n if(strpos($single_srcset[0], $src_size) !== false):\n // not the orginal size\n // $orginal .= $single_srcset[0] . ' ' . $src_size;\n else:\n $orginal .= $single_srcset[0];\n endif;\n }\n else:\n $orginal = strpos($image->getAttribute('src'), 'http') !== false ? $image->getAttribute('src') : get_option( 'siteurl' ) . $image->getAttribute('src');\n endif;\n // get orginal img id and call alt\n $id = attachment_url_to_postid($orginal);\n $alt = SELF::getAltAttribute($id);\n $image->removeAttribute('alt');\n $image->setAttribute('alt', $alt);\n }\n // output\n return $document->saveHTML();\n endif;\n }", "function attachment_image_attributes_aload($attr) {\n\n if ( isset($attr['data-aload-on']) ) :\n\n $attr['data-aload'] = $attr['src'];\n $attr['src'] = 'data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';\n\n if ( $attr['srcset'] ) :\n $attr['data-aload-set'] = $attr['srcset'];\n $attr['srcset'] = 'data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';\n endif;\n endif;\n return $attr;\n}", "function cbv_get_image_alt( $url ){\n if( isset( $url ) ){\n $output = '';\n $id = attachment_url_to_postid($url);\n $image_title = get_the_title($id);\n $image_alt = get_post_meta( $id, '_wp_attachment_image_alt', true);\n if( empty( $image_alt ) ){\n $image_alt = $image_title;\n }\n $image_alt = str_replace('-', ' ', $image_alt);\n $output = $image_alt;\n\n return $output;\n }\n return false;\n}", "function acd_add_img_title( $attr, $attachment = null ) {\n\t$img_title = trim( strip_tags( $attachment->post_title ) );\n\t$img_title = str_replace(\"-\", \" \", $img_title); //remove hyphens\n\t$img_title = str_replace(\"_\", \" \", $img_title); //remove underscores\n\t$img_title = preg_replace('/[0-9]+/', '', $img_title); //remove numbers\n\t$img_title = ucwords($img_title); //capitalize first letter of each word\n\n\t$attr['title'] = $img_title; //add image title attribute\n\t// or get the title instead of image title $attr['title'] = the_title_attribute( 'echo=0' );\n\t$attr['alt'] = $img_title; //add alt attribute\n\treturn $attr;\n}", "function wp_get_attachment_link($post = 0, $size = 'thumbnail', $permalink = \\false, $icon = \\false, $text = \\false, $attr = '')\n {\n }", "function minorite_image($variables) {\n $attributes = $variables['attributes'];\n $attributes['src'] = file_create_url($variables['path']);\n\n foreach (array('alt', 'title') as $key) {\n\n if (isset($variables[$key])) {\n $attributes[$key] = $variables[$key];\n }\n }\n\n return '<img' . drupal_attributes($attributes) . ' />';\n}", "public function get_image_link()\n {\n }", "function cbv_get_image_tag( $id, $size = 'full', $title = false ){\n\tif( isset( $id ) ){\n\t\t$output = '';\n\t\t$image_title = get_the_title($id);\n\t\t$image_alt = get_post_meta( $id, '_wp_attachment_image_alt', true);\n if( empty( $image_alt ) ){\n $image_alt = $image_title;\n }\n\t\t$image_src = wp_get_attachment_image_src( $id, $size, false );\n\n\t\tif( $title ){\n\t\t\t$output = '<img src=\"'.$image_src[0].'\" alt=\"'.$image_alt.'\" title=\"'.$image_title.'\">';\n\t\t}else{\n\t\t\t$output = '<img src=\"'.$image_src[0].'\" alt=\"'.$image_alt.'\">';\n\t\t}\n\n\t\treturn $output;\n\t}\n\treturn false;\n}", "function newsletter_image($ref, $size){\r\n\t\r\n\t$default_attr = array(\r\n\t\t'class'\t=> \"attachment-$size\",\r\n\t\t'alt' => trim(strip_tags( get_post_meta($ref, '_wp_attachment_image_alt', true) ))\r\n\t);\r\n\t\r\n\t$retour->image\t\t= wp_get_attachment_image( $ref, $size , false, $default_attr);\r\n\t$retour->legende\t= '<p style=\"font-family:Tahoma, Arial, sans-serif;color:#666666;font-size:11px;margin:7px 0;padding:0;font-style:italic;\">' . get_post_meta($ref, '_wp_attachment_image_alt', true) . '</p>';\r\n\t\r\n\treturn $retour;\r\n}", "function image($img,$attribute = array()){\r\n\t\t$tmp = '';\r\n\t\t$attribute = $this->convertStringAtt($attribute);\r\n\r\n\t\t$default = ''; $width = 0;\r\n\t\t$folder = ''; $height = 0;\r\n\r\n\t\t$att = array();\r\n\t\tif(isset($attribute['default'])){\r\n\t\t\t$att['default'] = $attribute['default'];\r\n\t\t\tunset($attribute['default']);\r\n\t\t}\r\n\t\tif(isset($attribute['folder'])){\r\n\t\t\t$att['folder'] = $attribute['folder'];\r\n\t\t\tunset($attribute['folder']);\r\n\t\t}\r\n\t\tif(isset($attribute['fixed'])){\r\n\t\t\t$att['fixed'] = $attribute['fixed'];\r\n\t\t\tunset($attribute['fixed']);\r\n\t\t}\r\n\t\tif(isset($attribute['absolute'])){\r\n\t\t\t$att['absolute'] = $attribute['absolute'];\r\n\t\t\tunset($attribute['absolute']);\r\n\t\t}\r\n\t\tif(isset($attribute['fullpath'])){\r\n\t\t\t$att['fullpath'] = $attribute['fullpath'];\r\n\t\t\tunset($attribute['fullpath']);\r\n\t\t}else{\r\n\t\t\t$att['fullpath'] = 'true';\r\n\t\t}\r\n\r\n\t\tBASIC::init()->imported('media.mod');\r\n\t\t$media = new BASIC_MEDIA($img, $att);\r\n\r\n\t\tif(isset($attribute['width'])) $width = $attribute['width'];\r\n\t\tif(isset($attribute['height'])) $height = $attribute['height'];\r\n\r\n\t\tif($media->info['type'] == 13 || $media->info['type'] == 4){\r\n\t\t\t$this->headSpecial('<!--[if IE]><script type=\"text/javascript\" src=\"'.BASIC::init()->ini_get('root_virtual').BASIC::init()->ini_get('basic_path').'scripts/flash/flash.js\" defer=\"defer\"></script><![endif]-->','Flash');\r\n\t\t}\r\n\t\treturn $media->view($width,$height,$attribute) . $tmp;\r\n\t}", "function getSrcAltImage($postID,$size=false){\n\t$imgID = get_post_thumbnail_id($postID);\n\t$img = wp_get_attachment_image_src($imgID,$size, false, '');\n\t$imgAlt = get_post_meta($imgID,'_wp_attachment_image_alt', true);\n\t$imgAttr = array(\n\t\t'url' => $img,\n\t\t'alt' => $imgAlt\n\t);\n\tif(is_shop()){\n\t\techo '<section class=\"shop-image\">';\n\t\techo '<img class=\"img-max\" src=\"' . $imgAttr['url'][0] . '\" alt=\"\" />';\n\t\techo '</section>';\n\t}else{\n\t\treturn $imgAttr;\n\t}\n}", "function image_add_caption($html, $id, $caption, $title, $align, $url, $size, $alt = '')\n {\n }", "public static function img($img, $alt, $title = '') {\r\n\t\t\t$file = WEB_ROOT . '/' . $img;\r\n\t\t\tif(!file_exists($file)) {\r\n\t\t\t\tABPF::logger()->error(\"Image file $file doesn't exist!\");\r\n\t\t\t\treturn '';\r\n\t\t\t}\r\n\t\t\t$v = filemtime($file);\r\n\t\t\treturn sprintf('<img src=\"%s/%s?v=%d\" alt=\"%s\" title=\"%s\" />', BASE_URL, $img, $v, $alt, $title);\r\n\t\t}", "function dizzy_featured_ogimg () { \n\t $thumb = get_the_post_thumbnail($post->ID);\n\t\t$pattern= \"/(?<=src=['|\\\"])[^'|\\\"]*?(?=['|\\\"])/i\";\n\t\tpreg_match($pattern, $thumb, $thePath);\n\t\t$theSrc = $thePath[0];\n}", "protected function getImageAttributes() {}", "function get_attachment_icon_src($id = 0, $fullsize = \\false)\n {\n }", "function getName() \t\t { return 'NP_ImageCreateThumbnail'; }", "function iti_get_image_alt_from_url( $url = '' ) {\n\tglobal $wpdb;\n\n\t$url = esc_url( $url );\n\n\t/** @noinspection PhpUndefinedMethodInspection */\n\t$attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $url ) );\n\n\t$post_id = isset( $attachment[0] ) ? $attachment[0] : 0;\n\t$alt = get_post_meta( absint( $post_id ), '_wp_attachment_image_alt', true );\n\n\treturn $alt;\n}", "function wp_img_tag_add_srcset_and_sizes_attr($image, $context, $attachment_id)\n {\n }", "function column_alt_text( $item ) {\r\n\t\tif ( isset( $item->mla_wp_attachment_image_alt ) ) {\r\n\t\t\tif ( is_array( $item->mla_wp_attachment_image_alt ) ) {\r\n\t\t\t\t$alt_text = $item->mla_wp_attachment_image_alt[0];\r\n\t\t\t} else {\r\n\t\t\t\t$alt_text = $item->mla_wp_attachment_image_alt;\r\n\t\t\t}\r\n\r\n\t\t\treturn sprintf( '<a href=\"%1$s\" title=\"' . __( 'Filter by', 'media-library-assistant' ) . ' &#8220;%2$s&#8221;\">%3$s</a>', esc_url( add_query_arg( array_merge( array(\r\n\t\t\t\t'page' => MLACore::ADMIN_PAGE_SLUG,\r\n\t\t\t\t'mla-metakey' => '_wp_attachment_image_alt',\r\n\t\t\t\t'mla-metavalue' => urlencode( $alt_text ),\r\n\t\t\t\t'heading_suffix' => urlencode( __( 'ALT Text', 'media-library-assistant' ) . ': ' . $alt_text ) \r\n\t\t\t), self::mla_submenu_arguments( false ) ), 'upload.php' ) ), esc_html( $alt_text ), esc_html( $alt_text ) );\r\n\t\t}\r\n\r\n\t\treturn '';\r\n\t}", "function swap_image($msg){\n\n\tif(preg_match(\"/\\[img ALT=('|\\\")(.*?)('|\\\")\\]([^\\[]*)\\[\\/img\\]/i\",$msg)){\n\t\t$msg=preg_replace(\"/\\[img ALT=('|\\\")(.*?)('|\\\")\\]([^\\[]*)\\[\\/img\\]/i\",\"$2\",$msg);\n\t}\n\nreturn $msg;\n}", "function essence_attachment_link( $link, $id ) {\n\tif ( is_feed() || is_admin() )\n\t\treturn $link;\n\n\t$post = get_post( $id );\n\n\tif ( 'image' == substr( $post->post_mime_type, 0, 5 ) )\n\t\treturn wp_get_attachment_url( $id );\n\telse\n\t\treturn $link;\n}", "function cws_get_alt_text( $image_url ) {\n\tglobal $wpdb;\n\n\tif( ! isset( $image_url ) ) {\n\t\techo \"Please add an image.\";\n\t\treturn;\n\t}\n\n\t$attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $image_url ) );\n\t$alt_text = get_post_meta( $attachment[0], '_wp_attachment_image_alt', true );\n\t$alt_default = 'CWS default alt tag';\n\n\tif( ! empty( $alt_text ) ) {\n\t\treturn $alt_text;\n\t} else {\n\t\treturn $alt_default;\n\t}\n}", "function get_attachment_link($post = \\null, $leavename = \\false)\n {\n }", "function img( $src = '', $index_page = FALSE, $attributes = '' )\n\t{\n\t\tif ( ! is_array( $src ) )\n\t\t{\n\t\t\t$src = [ 'src' => $src ];\n\t\t}\n\n\t\t// If there is no alt attribute defined, set it to an empty string\n\t\tif ( ! isset( $src[ 'alt' ] ) )\n\t\t{\n\t\t\t$src[ 'alt' ] = '';\n\t\t}\n\n\t\t$img = '<img';\n\n\t\tforeach ( $src as $k => $v )\n\t\t{\n\t\t\tif ( $k === 'src' && ! preg_match( '#^([a-z]+:)?//#i', $v ) )\n\t\t\t{\n\t\t\t\tif ( $index_page === TRUE )\n\t\t\t\t{\n\t\t\t\t\t$img .= ' src=\"' . get_instance()->config->site_url( $v ) . '\"';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$img .= ' src=\"' . \\O2System::$config->slash_item( 'base_url' ) . $v . '\"';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$img .= ' ' . $k . '=\"' . $v . '\"';\n\t\t\t}\n\t\t}\n\n\t\treturn $img . _stringify_attributes( $attributes ) . ' />';\n\t}", "protected function renderImage(){\n \n return sprintf(\n '<img src=\"%s\" title=\"%s\" alt=\"%s\">',\n $this->getField('url'),\n $this->getField('title',''),\n $this->getField('alt','')\n );\n \n }", "function bethel_filter_image_attributes_for_gallery ($attr, $attachment) {\n $attr ['id'] = \"gallery-image-id-{$attachment->ID}\";\n $attr ['class'] .= ' gallery-thumbnail';\n return $attr;\n}" ]
[ "0.6808126", "0.63869506", "0.6359961", "0.63204473", "0.6179372", "0.6098405", "0.60709876", "0.60480756", "0.60252535", "0.6022915", "0.6002773", "0.59758204", "0.58942604", "0.5855631", "0.58382475", "0.58003324", "0.5790051", "0.57877487", "0.5761844", "0.57565975", "0.57403344", "0.57317847", "0.57304716", "0.57120067", "0.5692528", "0.5683302", "0.5678282", "0.5676166", "0.56652063", "0.5653678" ]
0.7443384
0
/================================================================================== 3.0 OUTPUT ================================================================================== / 3.1 IMG ALT TAG CONTENT /
function IMGalt_Content($content) { if($content): // encode content $content = mb_convert_encoding($content, 'HTML-ENTITIES', "UTF-8"); $document = new \DOMDocument(); // Disable libxml errors and allow user to fetch error information as needed libxml_use_internal_errors(true); $document->loadHTML(utf8_decode($content), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); // get img tag from content $images = $document->getElementsByTagName('img'); foreach ($images as $image) { // get orginal from srcset if( $image->hasAttribute('srcset') ): $orginal = ''; // get srcset from content and explode to array $srcset = $image->getAttribute('srcset'); $srcset_array = explode(", ", $srcset); // get orginal size foreach ($srcset_array as $key => $value) { $single_srcset = explode(" ", $value); $src_size = str_replace("w", "", end($single_srcset)); if(strpos($single_srcset[0], $src_size) !== false): // not the orginal size // $orginal .= $single_srcset[0] . ' ' . $src_size; else: $orginal .= $single_srcset[0]; endif; } else: $orginal = strpos($image->getAttribute('src'), 'http') !== false ? $image->getAttribute('src') : get_option( 'siteurl' ) . $image->getAttribute('src'); endif; // get orginal img id and call alt $id = attachment_url_to_postid($orginal); $alt = SELF::getAltAttribute($id); $image->removeAttribute('alt'); $image->setAttribute('alt', $alt); } // output return $document->saveHTML(); endif; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function IMGalt_Attachment($attributes, $attachment){\n // print_r($attributes);\n // print_r($attachment);\n // get up to date alt attribute\n $alt = SELF::getAltAttribute($attachment->ID);\n // set alt tag\n $attributes['alt'] = $alt;\n // output\n return $attributes;\n }", "public function displayImgTag() {\n $urlimg = \"/plugins/graphontrackers/reportgraphic.php?_jpg_csimd=1&group_id=\".(int)$this->graphic_report->getGroupId().\"&atid=\". $this->graphic_report->getAtid();\n $urlimg .= \"&report_graphic_id=\".$this->graphic_report->getId().\"&id=\".$this->getId();\n \n \n echo '<img src=\"'. $urlimg .'\" ismap usemap=\"#map'. $this->getId() .'\" ';\n if ($this->width) {\n echo ' width=\"'. $this->width .'\" ';\n }\n if ($this->height) {\n echo ' height=\"'. $this->height .'\" ';\n }\n echo ' alt=\"'. $this->title .'\" border=\"0\">';\n }", "private function getImg()\n\t{\n\t\t$buffer = '&nbsp;';\n\t\t\n\t\tif(!$this->aImg['sFilename'])\n\t\t\treturn $buffer;\n\t\t\n\t\t$buffer = '<img src=\"../../thumbs/'.$this->aImg['sFilename'].'\" />';\t\t\n\t\t\n\t\treturn $buffer;\n\t}", "protected function renderImage(){\n \n return sprintf(\n '<img src=\"%s\" title=\"%s\" alt=\"%s\">',\n $this->getField('url'),\n $this->getField('title',''),\n $this->getField('alt','')\n );\n \n }", "function replaceIMG($html)\r\n\t{\r\n\t\t$iStart = stripos($html,\"<img\");\r\n\t\twhile((string)$iStart != null) //string typecast to handle \"0\" which equates to FALSE in PHP...\r\n\t\t{\r\n\t\t\t//get entire IMG tag\r\n\t\t\t$iEnd = stripos($html,\">\",$iStart)+1;\r\n\t\t\t$imgTag = substr($html,$iStart,($iEnd-$iStart));\r\n\t\t\t\r\n\t\t\t//get src\r\n\t\t\t$iSrcStart = stripos($imgTag,\"src=\");\r\n\t\t\tif(substr($imgTag,($iSrcStart+4),1) == \"'\")\r\n\t\t\t{\r\n\t\t\t\t//single quote\r\n\t\t\t\t$iSrcEnd = stripos($imgTag,\"'\",$iSrcStart+5);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//double quote\r\n\t\t\t\t$iSrcEnd = stripos($imgTag,'\"',$iSrcStart+5);\r\n\t\t\t}\r\n\t\t\t$imgSrc = substr($imgTag,$iSrcStart+5,($iSrcEnd-($iSrcStart+5)));\r\n\t\t\t\r\n\t\t\t//get alt\r\n\t\t\t$iAltStart = stripos($imgTag,\"alt=\");\r\n\t\t\tif($iAltStart != null)\r\n\t\t\t{\r\n\t\t\t\tif(substr($imgTag,($iAltStart+4),1) == \"'\")\r\n\t\t\t\t{\r\n\t\t\t\t\t//single quote\r\n\t\t\t\t\t$iAltEnd = stripos($imgTag,\"'\",$iAltStart+5);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t//double quote\r\n\t\t\t\t\t$iAltEnd = stripos($imgTag,'\"',$iAltStart+5);\r\n\t\t\t\t}\r\n\t\t\t\t$imgAlt = substr($imgTag,$iAltStart+5,($iAltEnd-($iAltStart+5)));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//replace HTML\r\n\t\t\tif((string)stripos($imgSrc,\"scripts/CLEditor/images/icons/\") == null) //exclude icons from rich text editor\r\n\t\t\t{\r\n\t\t\t\t$replacementHTML = \"<div class='table comicborder popupshadow-margin'><div class='table-row'><div class='table-cell'><a href='\" . $imgSrc . \"'>\" . $imgTag . \"</a></div></div>\";\r\n\t\t\t\tif($iAltStart != null)\r\n\t\t\t\t{\r\n\t\t\t\t\t$replacementHTML = $replacementHTML . \"<div class='table-row'><div class='table-cell comicimagecaption'>\" . $imgAlt . \"</div></div>\";\r\n\t\t\t\t}\r\n\t\t\t\t$replacementHTML = $replacementHTML . \"</div>\";\r\n\t\t\t\t$html = substr_replace($html,$replacementHTML,$iStart,($iEnd-$iStart));\r\n\t\t\t\t\r\n\t\t\t\t//prep next loop\r\n\t\t\t\t$iStart = stripos($html,\"<img\",($iStart+strlen($replacementHTML)));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//prep next loop\r\n\t\t\t\t$iStart = stripos($html,\"<img\",($iStart+strlen($imgTag)));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $html;\r\n\t}", "public function getImageTag();", "function cbv_get_image_alt( $url ){\n if( isset( $url ) ){\n $output = '';\n $id = attachment_url_to_postid($url);\n $image_title = get_the_title($id);\n $image_alt = get_post_meta( $id, '_wp_attachment_image_alt', true);\n if( empty( $image_alt ) ){\n $image_alt = $image_title;\n }\n $image_alt = str_replace('-', ' ', $image_alt);\n $output = $image_alt;\n\n return $output;\n }\n return false;\n}", "function minorite_image($variables) {\n $attributes = $variables['attributes'];\n $attributes['src'] = file_create_url($variables['path']);\n\n foreach (array('alt', 'title') as $key) {\n\n if (isset($variables[$key])) {\n $attributes[$key] = $variables[$key];\n }\n }\n\n return '<img' . drupal_attributes($attributes) . ' />';\n}", "function get_image_send_to_editor($id, $caption, $title, $align, $url = '', $rel = \\false, $size = 'medium', $alt = '')\n {\n }", "function IMG($img, $extra = '')\n{\n /**\n * An Image tag.\n *\n * Args:\n * $img (str): the image source\n * $extra (str): extra data in the tag - used for adding class / ID etc.\n */\n echo \"<img src='\" . $img . \"'\" ;\n if ($extra != '') {\n echo ' ' . $extra ;\n }\n echo '>' ;\n}", "function initialize () {\n $this->set_openingtag ( \"<IMG alt=\\\"\" );\n\t $this->set_closingtag ( \"\\\"[attributes]/>\" );\n }", "public function createImgTag() {\n\t\t$this->imgNeko = '<img src=\"';\n\t\t$this->imgNeko .= $this->imgUri;\n\t\t$this->imgNeko .= '\" width=\"';\n\t\t$this->imgNeko .= $this->imgSize[0];\n\t\t$this->imgNeko .= '\" height=\"';\n\t\t$this->imgNeko .= $this->imgSize[1];\n\t\t$this->imgNeko .= '\" alt=\"';\n\t\t$this->imgNeko .= $this->creditInfo;\n\t\t$this->imgNeko .= '\">';\n\t}", "function img( $src = '', $index_page = FALSE, $attributes = '' )\n\t{\n\t\tif ( ! is_array( $src ) )\n\t\t{\n\t\t\t$src = [ 'src' => $src ];\n\t\t}\n\n\t\t// If there is no alt attribute defined, set it to an empty string\n\t\tif ( ! isset( $src[ 'alt' ] ) )\n\t\t{\n\t\t\t$src[ 'alt' ] = '';\n\t\t}\n\n\t\t$img = '<img';\n\n\t\tforeach ( $src as $k => $v )\n\t\t{\n\t\t\tif ( $k === 'src' && ! preg_match( '#^([a-z]+:)?//#i', $v ) )\n\t\t\t{\n\t\t\t\tif ( $index_page === TRUE )\n\t\t\t\t{\n\t\t\t\t\t$img .= ' src=\"' . get_instance()->config->site_url( $v ) . '\"';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$img .= ' src=\"' . \\O2System::$config->slash_item( 'base_url' ) . $v . '\"';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$img .= ' ' . $k . '=\"' . $v . '\"';\n\t\t\t}\n\t\t}\n\n\t\treturn $img . _stringify_attributes( $attributes ) . ' />';\n\t}", "function cbv_get_image_tag( $id, $size = 'full', $title = false ){\n\tif( isset( $id ) ){\n\t\t$output = '';\n\t\t$image_title = get_the_title($id);\n\t\t$image_alt = get_post_meta( $id, '_wp_attachment_image_alt', true);\n if( empty( $image_alt ) ){\n $image_alt = $image_title;\n }\n\t\t$image_src = wp_get_attachment_image_src( $id, $size, false );\n\n\t\tif( $title ){\n\t\t\t$output = '<img src=\"'.$image_src[0].'\" alt=\"'.$image_alt.'\" title=\"'.$image_title.'\">';\n\t\t}else{\n\t\t\t$output = '<img src=\"'.$image_src[0].'\" alt=\"'.$image_alt.'\">';\n\t\t}\n\n\t\treturn $output;\n\t}\n\treturn false;\n}", "function custom_send_image_to_editor( $html, $id, $caption, $title, $align, $url, $size, $alt ) {\n\n\t$url = wp_get_attachment_url($id);\n\n\t$html_str = '<div class=\"align-' . esc_attr($align) . '\">';\n\n \t\t$html_str .= \"<p><img src='$url' alt='$title' /></p>\";\n\n\t\tif($caption) $html_str .= '\n\t\t<p class=\"wp-caption-text\">' . $caption . '</p>\n\t\t';\n\n\t$html_str .= '</div>';\n\n return $html_str;\n}", "function cws_get_alt_text( $image_url ) {\n\tglobal $wpdb;\n\n\tif( ! isset( $image_url ) ) {\n\t\techo \"Please add an image.\";\n\t\treturn;\n\t}\n\n\t$attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $image_url ) );\n\t$alt_text = get_post_meta( $attachment[0], '_wp_attachment_image_alt', true );\n\t$alt_default = 'CWS default alt tag';\n\n\tif( ! empty( $alt_text ) ) {\n\t\treturn $alt_text;\n\t} else {\n\t\treturn $alt_default;\n\t}\n}", "protected function _build() {\n $alt_title = $this->isXhtml ? tep_output_string_protected( str_replace ( '&amp;', '&', $this->attributes['alt'] ) ) : tep_output_string( $this->attributes['alt'] );\n $parameters = tep_not_null( $this->parameters ) ? tep_output_string( $this->parameters ) : false;\n $width = (int)$this->_calculated_width;\n $height = (int)$this->_calculated_height;\n $this->_html = '<img width=\"' . $width . '\" height=\"' . $height . '\" src=\"' . $this->src . '\" title=\"' . $alt_title . '\" alt=\"' . $alt_title . '\"';\n if ( false !== $parameters ) $this->_html .= ' ' . html_entity_decode(tep_output_string( $parameters ));\n $this->_html .= $this->isXhtml ? ' />' : '>'; \n }", "public function img($src = \"\", $alt = \"\") {\n echo \"<img src=assets/img/'\" . $src . \"' alt='\" . $alt . \"'>\";\n }", "function lazy_imgs($html, $id, $caption, $title, $align, $url, $size, $alt) {\n\n $imgNew = '<img data-original=\"' . $url . '\" ';\n $html = str_replace('<img ', $imgNew, $html);\n return $html;\n}", "function getSrcAltImage($postID,$size=false){\n\t$imgID = get_post_thumbnail_id($postID);\n\t$img = wp_get_attachment_image_src($imgID,$size, false, '');\n\t$imgAlt = get_post_meta($imgID,'_wp_attachment_image_alt', true);\n\t$imgAttr = array(\n\t\t'url' => $img,\n\t\t'alt' => $imgAlt\n\t);\n\tif(is_shop()){\n\t\techo '<section class=\"shop-image\">';\n\t\techo '<img class=\"img-max\" src=\"' . $imgAttr['url'][0] . '\" alt=\"\" />';\n\t\techo '</section>';\n\t}else{\n\t\treturn $imgAttr;\n\t}\n}", "function img($src = '', $attributes = '', $index_page = false)\n\t{\n\t\tif ( ! is_array($src) )\n\t\t{\n\t\t\t$src = array('src' => $src);\n\t\t}\n\n\t\t// If there is no alt attribute defined, set it to an empty string\n\t\tif ( ! isset($src['alt']))\n\t\t{\n\t\t\t$src['alt'] = '';\n\t\t}\n\n\t\t$img = '<img';\n\n\t\tforeach ($src as $k => $v)\n\t\t{\n\t\t\tif ($k === 'src' && ! preg_match('#^(data:[a-z,;])|(([a-z]+:)?(?<!data:)//)#i', $v))\n\t\t\t{\n\t\t\t\tif ($index_page === true)\n\t\t\t\t{\n\t\t\t\t\t$img .= ' src=\"'.get_instance()->config->site_url($v).'\"';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$img .= ' src=\"'.get_instance()->config->slash_item('base_url').$v.'\"';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$img .= ' '.$k.'=\"'.$v.'\"';\n\t\t\t}\n\t\t}\n\n\t\treturn $img._stringify_attributes($attributes).' />';\n\t}", "function jcr_image_custom($atts)\n {\n global $thisimage;\n\n assert_image();\n\n extract(lAtts(array(\n 'escape' => 'html',\n ), $atts));\n\n return ($escape == 'html')\n ? txpspecialchars($thisimage['jcr_image_custom'])\n : $thisimage['jcr_image_custom'];\n }", "public function render(){\n\t\t$out = \"<img\".($this->getID() ? \" id=\\\"\".$this->getID().\"\\\"\" : \"\");\n\t\t\n\t\t$out .= \" src=\\\"\".$this->link.\"\\\"\";\n\t\t\n\t\tforeach( $this->getProperties() as $key => $value ) {\n\t\t\t$out .= \" \".$key.\"=\\\"\".$value.\"\\\"\"; //example: _width=\"100px\"\n\t\t}\n\t\t$out .= \" />\"; //end of opening html tag and html properties\n\t\t\n\t\treturn $out;\n\t}", "public static function img($img, $alt, $title = '') {\r\n\t\t\t$file = WEB_ROOT . '/' . $img;\r\n\t\t\tif(!file_exists($file)) {\r\n\t\t\t\tABPF::logger()->error(\"Image file $file doesn't exist!\");\r\n\t\t\t\treturn '';\r\n\t\t\t}\r\n\t\t\t$v = filemtime($file);\r\n\t\t\treturn sprintf('<img src=\"%s/%s?v=%d\" alt=\"%s\" title=\"%s\" />', BASE_URL, $img, $v, $alt, $title);\r\n\t\t}", "function column_alt_text( $item ) {\r\n\t\tif ( isset( $item->mla_wp_attachment_image_alt ) ) {\r\n\t\t\tif ( is_array( $item->mla_wp_attachment_image_alt ) ) {\r\n\t\t\t\t$alt_text = $item->mla_wp_attachment_image_alt[0];\r\n\t\t\t} else {\r\n\t\t\t\t$alt_text = $item->mla_wp_attachment_image_alt;\r\n\t\t\t}\r\n\r\n\t\t\treturn sprintf( '<a href=\"%1$s\" title=\"' . __( 'Filter by', 'media-library-assistant' ) . ' &#8220;%2$s&#8221;\">%3$s</a>', esc_url( add_query_arg( array_merge( array(\r\n\t\t\t\t'page' => MLACore::ADMIN_PAGE_SLUG,\r\n\t\t\t\t'mla-metakey' => '_wp_attachment_image_alt',\r\n\t\t\t\t'mla-metavalue' => urlencode( $alt_text ),\r\n\t\t\t\t'heading_suffix' => urlencode( __( 'ALT Text', 'media-library-assistant' ) . ': ' . $alt_text ) \r\n\t\t\t), self::mla_submenu_arguments( false ) ), 'upload.php' ) ), esc_html( $alt_text ), esc_html( $alt_text ) );\r\n\t\t}\r\n\r\n\t\treturn '';\r\n\t}", "public function getAlt(): string\n {\n return htmlspecialchars($this->getDescription(), ENT_QUOTES);\n }", "public static function getAltAttribute(int $id = 0){\n // vars\n $output = '';\n $lang = prefix_core_BaseFunctions::getCurrentLang();\n // check if active lang is default or not\n if($lang == SELF::$WPimgAttr_Alt_languages[0]):\n // default language\n $output .= get_post_meta($id, '_wp_attachment_image_alt', TRUE);\n else:\n // alternative text\n $name = SELF::$WPimgAttr_Alt_prefix . $lang;\n $output .= get_post_meta($id, $name, true);\n endif;\n // output\n return $output;\n }", "public function alt(){\n\t\tif( $this->alt ) {\n\t\t\treturn $this->alt;\n\t\t}//end if\n\n\t\t$this->alt = @file_get_contents( $this->base_dir.'/'.$this->dir . $this->filename . '.alt');\n\n\t\treturn $this->alt;\n\t}", "function swap_image($msg){\n\n\tif(preg_match(\"/\\[img ALT=('|\\\")(.*?)('|\\\")\\]([^\\[]*)\\[\\/img\\]/i\",$msg)){\n\t\t$msg=preg_replace(\"/\\[img ALT=('|\\\")(.*?)('|\\\")\\]([^\\[]*)\\[\\/img\\]/i\",\"$2\",$msg);\n\t}\n\nreturn $msg;\n}", "function zero_filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n }" ]
[ "0.7009078", "0.68325895", "0.6692804", "0.66500384", "0.66121835", "0.65053207", "0.6485219", "0.6444968", "0.64215714", "0.6418329", "0.63981396", "0.6385716", "0.6361115", "0.63594073", "0.6359043", "0.6341475", "0.6329196", "0.6321962", "0.631671", "0.6298811", "0.6281806", "0.6281429", "0.6267405", "0.62612134", "0.62391883", "0.62328833", "0.623108", "0.6224123", "0.62189394", "0.6199195" ]
0.7602596
0
Get iterator object of body row elements
public function getIterator() { return new ArrayIterator($this->_tbody->getElements()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIterator()\n {\n return new ArrayObject($this->_rows);\n }", "public function getIterator()\n {\n return new Itr($this);\n }", "public function getIterator() {}", "public function getIterator() {}", "function getInnerIterator()\n\t{\n\t\treturn $this->iterator;\n\t}", "function getElements() {\n return $this->rows_object;\n }", "public function getIterator()\n {\n return new \\ArrayIterator([$this->contents]);\n }", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator() {\n\t\t// Load related records for current row\n\t\t$data = $this->execute();\n\t\treturn $data ? $data : array();\n\t}", "function getIterator() {\r\n\t\treturn new \\ArrayIterator($this->data);\r\n\t}", "public function getIterator()\n\t{\n\t\treturn new \\ArrayIterator($this->fetch());\n\t}", "abstract public function getIterator();", "function getiterator() {\n\t\treturn new \\ArrayIterator($this->cast());\n\t}", "public function iterator();", "public function iterator()\n {\n return $this->getIterator();\n }", "public function getIterator(): Iterator {}", "public function getIterator()\r\n {\r\n return $this->all();\r\n }", "public function getIterator()\n {\n return $this->iterator();\n }", "public function getIterator()\n {\n return $this->multi()->load();\n }", "public function getIterator() {\n\t\treturn new \\ArrayObject($this->data);\n\t}", "public function getIterator(): \\Iterator\n {\n return new \\ArrayIterator($this->headers);\n }", "public function getIterator()\n {\n return $this->getValue();\n }", "public function getIterator() {\n return new \\ArrayIterator($this->getValues());\n }", "public function getItemIterator()\n {\n return new ArrayIterator($this->data->items);\n }", "public function getIterator()\n {\n return $this->headers->getIterator();\n }" ]
[ "0.695523", "0.68069005", "0.6612693", "0.6612693", "0.65917534", "0.6573931", "0.65696836", "0.65684927", "0.65684927", "0.65684927", "0.65684927", "0.65684927", "0.65684927", "0.6512575", "0.65009004", "0.6494172", "0.6463965", "0.6391734", "0.6346755", "0.63464385", "0.63425547", "0.6318436", "0.63140905", "0.62703806", "0.62690115", "0.62667733", "0.6247886", "0.62472266", "0.6238347", "0.6223869" ]
0.73687
0
Add header row element
public function addHeaderElement(HtmlTableRow $row) { $this->_createHeaderContainer(); $this->_thead->addElement($row); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function addHeaderRowToCSV() {}", "static function generateTableHeaderHTML()\n\t{\n\t\techo \"<tr class='exTableRow'>\\n\";\n\t\techo \"<th class='exTableColLineNum'>Item #</th>\\n\";\n\t\techo \"<th class='exTableColDesc'>Description of Work</th>\\n\";\n\t\techo \"<th class='exTableColAmount'>Amount</th>\\n\";\n\t\techo \"</tr>\\n\";\n\t}", "function headerRow(&$rows, $rowN, $add_edit_link) {\n $currentRow = current($rows);\n?>\n\t<tr data-row=\"<?= $rowN ?>\">\n<?php\n if ($add_edit_link) {\n?>\n <th></th>\n<?php\n }\n foreach ($currentRow as $fieldName => $val) {\n?>\n\t\t<th class=\"popr\" data-id=\"1\">\n\t\t\t<?= $fieldName ?>\n\t\t</th>\n<?php\n }\n?>\n\t</tr>\n<?php\n }", "private function setTableHeader($row){\n\t\t$header_data=false;\n\t\tif($this->header){\n\t\t\t$header_data=$this->header;\n\t\t}\n\t\telse{\n\t\t\tif(!empty($row) && is_array($row) && count($row)){\n\t\t\t\tforeach($row as $i => $v){\n\t\t\t\t\t$header_data[$i]=$i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!empty($header_data)){\n\t\t\t$this->table_header.=_N_T.'<tr>';\n\t\t\t$this->table_header.=_N_T_T.'<th class=\"th.LineNum\">#</th>';\n\t\t\tforeach($header_data as $name => $value){\n\t\t\t\t$this->table_header.=_N_T_T.'<th nowrap=\"nowrap\">'.$value.$this->getOrderBy($name).'</th>';\n\t\t\t}\n\t\t\t$this->table_header.=_N_T.'</tr>';\n\t\t}\n\t\treturn $this;\n\t}", "public function renderTableHeader() {\n $cells = [];\n foreach ($this->columns as $column) {\n /* @var $column Column */\n $cells[] = $column->renderHeaderCell();\n }\n $content = $this->html()->tag('table-row', array('content' => implode('', $cells)), $this->headerRowOptions);\n\n if ($this->filterPosition == self::FILTER_POS_HEADER) {\n $content = $this->renderFilters() . $content;\n } elseif ($this->filterPosition == self::FILTER_POS_BODY) {\n $content .= $this->renderFilters();\n }\n\n return \"<thead>\\n\" . $content . \"\\n</thead>\";\n }", "public function writeHeaderRow() {\n $headers = $this->getCSVHeaderRow();\n\n // write to the CSV\n fputcsv($this->newCSV, $headers);\n }", "public function setHeader($rowHeader){\n array_unshift($this->data,$rowHeader);\n return $this;\n }", "public function tableHeaderRow($in){\n $out = '';\n $cols = array_keys($in);\n foreach($cols as $k){\n $out .= '<td>'.$k.'</td>';\n }\n return('<tr>'.$out.'</tr>');\n }", "function header() {\n //\n //Get the fields in this sql \n $cols= $this->fields->get_array();\n //\n //Loop through the fields and display the <tds>\n foreach ($cols as $col) {\n //\n $name= is_null($col->alias) ? $col->to_str():$col->alias;\n echo \"<th>$name</th>\"; \n }\n }", "function tableheader_close() {\n $this->doc .= '</th>';\n }", "public function __Header(){\n $this->Ln(5);\n $this->SetDrawColor(160,160,160);\n $this->SetFillColor(230,230,230);\n $this->SetTextColor(100);\n $this->SetFont('Arial','B',7);\n $this->SetX(($this->w - $this->_tWidth)/2);\n foreach($this->_fields as $field)\n $this->Cell($field[\"size\"],5,$field[\"header\"],1,0,\"C\",true);\n $this->Ln();\n }", "public function renderTableHeader()\n {\n $cells = [];\n foreach ($this->columns as $column) {\n /* @var $column Column */\n $cells[] = $column->renderHeaderCell();\n }\n $content = Html::tag('tr', implode('', $cells), $this->headerRowOptions);\n if ($this->filterPosition === self::FILTER_POS_HEADER) {\n $content = $this->renderFilters() . $content;\n } elseif ($this->filterPosition === self::FILTER_POS_BODY) {\n $content .= $this->renderFilters();\n }\n\n return \"<thead>\\n\" . $content . \"\\n</thead>\";\n }", "function table_table_header_row($values)\n{\n\t$cells=new ocp_tempcode();\n\tforeach ($values as $value)\n\t{\n\t\t$cells->attach(do_template('TABLE_TABLE_HEADER_ROW_CELL',array('_GUID'=>'5002f54ccddf7259f3460d8c0759fd1a','VALUE'=>$value)));\n\t}\n\n\treturn do_template('TABLE_TABLE_HEADER_ROW',array('_GUID'=>'2f4095b8d30f50f34fdd6acf8dd566b1','CELLS'=>$cells));\n}", "function Table_Headers($header,$w)\r\n{\r\n //Colors, line width and bold font\r\n $this->SetFillColor(153,153,153);\r\n $this->SetTextColor(0);\r\n $this->SetDrawColor(128,0,0);\r\n $this->SetLineWidth(.3);\r\n $this->SetFont('Arial','B','7');\r\n\t\r\n //Header\r\n\t\r\n\t//Output table header\r\n for($i=0;$i<count($header);$i++)\r\n $this->Cell($w[$i],5,$header[$i],1,0,'C',1);\r\n $this->Ln();\r\n}", "private function buildHeader()\n\t{\n\t\tif ($this->hide_header)\n\t\t\treturn;\n\n\t\techo '<thead><tr>';\n\n\t\t// Get field names of result\n\t\t$headers = $this->_db->fieldNameArray($this->result);\n\t\t$this->column_count = count($headers);\n\n\t\t// Add a blank column if the row number is to be shown\n\t\tif ($this->show_row_number)\n\t\t{\n\t\t\t$this->column_count++;\n\t\t\techo '<td class=\"tbl-header\">&nbsp;</td>';\n\t\t}\n\n\t\t// Show checkboxes\n\t\tif ($this->show_checkboxes)\n\t\t{\n\t\t\t$this->column_count++;\n\t\t\techo '<td class=\"tbl-header tbl-checkall\"><input type=\"checkbox\" name=\"checkall\" onclick=\"tblToggleCheckAll'.$this->_clsnumber.'()\"></td>';\n\t\t}\n\n\t\t// Loop through each header and output it\n\t\tforeach ($headers as $t)\n\t\t{\n\t\t\t// Skip column if hidden\n\t\t\tif (in_array($t, $this->hidden))\n\t\t\t{\n\t\t\t\t$this->column_count--;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check for header caption overrides\n\t\t\tif (array_key_exists($t, $this->header))\n\t\t\t\t$header = $this->header[$t];\n\t\t\telse\n\t\t\t\t$header = $t;\n\n\t\t\tif ($this->hide_order)\n\t\t\t\techo '<td class=\"tbl-header\">' . $header; // Prevent the user from changing order\n\t\t\telse {\n\t\t\t\tif ($this->order and $this->order['Column'] == $t)\n\t\t\t\t\t$order = ($this->order['Order'] == self::ORDER_ASC)\n\t\t\t\t\t? self::ORDER_DESC\n\t\t\t\t\t: self::ORDER_ASC;\n\t\t\t\telse\n\t\t\t\t\t$order = self::ORDER_ASC;\n\n\t\t\t\techo '<td class=\"tbl-header\"><a href=\"javascript:;\" onclick=\"tblSetOrder'.$this->_clsnumber.'(\\'' . $t . '\\', \\'' . $order . '\\')\">' . $header . \"</a>\";\n\n\t\t\t\t// Show the user the order image if set\n\t\t\t\tif ($this->order and $this->order['Column'] == $t)\n\t\t\t\t\techo '&nbsp;<img src=\"images/sort_' . strtolower($this->order['Order']) . '.gif\" class=\"tbl-order\">';\n\t\t\t}\n\n\t\t\t// Add filters if allowed and only if the column type is not \"special\"\n\t\t\tif ($this->allow_filters and !empty($t)){\n\t\t\t\t\t\n\t\t\t\tif (!in_array($this->type[$t][0], array(\n\t\t\t\t\t\tself::TYPE_ARRAY,\n\t\t\t\t\t\tself::TYPE_IMAGE,\n\t\t\t\t\t\tself::TYPE_FUNCTION,\n\t\t\t\t\t\tself::TYPE_DATE,\n\t\t\t\t\t\tself::TYPE_CHECK,\n\t\t\t\t\t\tself::TYPE_CUSTOM,\n\t\t\t\t\t\tself::TYPE_PERCENT\n\t\t\t\t)))\n\t\t\t\t{\n\t\t\t\t\tif ($this->filter['Column'] == $t and !empty($this->filter['Value']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$filter_display = 'block';\n\t\t\t\t\t\t$filter_value = $this->filter['Value'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$filter_display = 'none';\n\t\t\t\t\t\t$filter_value = '';\n\t\t\t\t\t}\n\t\t\t\t\techo '<a href=\"javascript:;\" onclick=\"tblShowHideFilter'. $this->_clsnumber .'(\\'' . $t . '\\')\"> filter </a>\n\t\t\t\t\t<br><div class=\"tbl-filter-box\" id=\"'.$this->_clsnumber.'filter-' . $t . '\" style=\"display:' . $filter_display . '\">\n\t\t\t\t\t<input type=\"text\" size=\"6\" id=\"'.$this->_clsnumber.'filter-value-' . $t . '\" value=\"'.$filter_value.'\">&nbsp;\n\t\t\t\t\t<a href=\"javascript:;\" onclick=\"tblSetFilter'.$this->_clsnumber.'(\\'' . $t . '\\')\">filter</a></div>';\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\n\t\t\techo '</td>';\n\t\t}\n\n\t\t// If we have controls, add a blank column\n\t\tif (count($this->controls) > 0)\n\t\t{\n\t\t\t$this->column_count++;\n\t\t\techo '<td class=\"tbl-header\">&nbsp;</td>';\n\t\t}\n\n\t\techo '</tr></thead>';\n\t}", "private function getHeaders(){\n\t\t$thead=\"\";\n\t\tif(!empty($this->headers)){\n\t\t\t$thead=\"<thead>\";\n\t\t\t$thead.=\"<tr>\";\n\t\t\t$headerNumber=0;\n\t\t\t$fieldNumber=0;\n\t\t\t$count=count($this->headers)-1;\n\t\t\t\n\t\t\t//Busca si hay columnas anteriores a agregar\n\t\t\tif(!empty($this->prependedCols)){\n\t\t\t\tforeach($this->prependedCols as $col){\n\t\t\t\t\t$thead.=\"<th>{$col[\"header\"]}</th>\";\n\t\t\t\t\t$headerNumber++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Busca las columnas declaradas\n\t\t\tforeach($this->headers as $name){\n\t\t\t\tif($this->headerSortable){\n\t\t\t\t\tif($this->order!==\"\"&&!empty($this->order)){\n\t\t\t\t\t\t$order=explode('|',$this->order);\n\t\t\t\t\t\tif(is_array($order)&&$fieldNumber==$order[0]){\n\t\t\t\t\t\t\t$classSortable=\"velkan-grid-column-header velkan-grid-column-header-sorted-\".$order[1];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$classSortable=\"velkan-grid-column-header velkan-grid-column-header-sorted-both\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$classSortable=\"velkan-grid-column-header velkan-grid-column-header-sorted-both\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$thead.=\"<th {$this->id}-column-header class=\\\"$classSortable\\\" onclick=\\\"javascript:{$this->id}Reorder($fieldNumber);\\\" {$this->id}_field_number=\\\"$fieldNumber\\\">$name</th>\";\n\t\t\t\t}else{\n\t\t\t\t\t$thead.=\"<th {$this->id}-column-header>$name</th>\";\n\t\t\t\t}\n\t\t\t\t$fieldNumber++;\n\t\t\t\t$headerNumber++;\n\t\t\t}\n\t\t\t\n\t\t\t//Busca si hay columnas posteriores a agregar\n\t\t\tif(!empty($this->appendedCols)){\n\t\t\t\tforeach($this->appendedCols as $col){\n\t\t\t\t\t$thead.=\"<th>{$col[\"header\"]}</th>\";\n\t\t\t\t\t$headerNumber++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$thead.=\"</tr>\";\n\t\t\t\n\t\t\t//Guardamos el numero total de columnas\n\t\t\t$this->cols=$headerNumber;\n\t\t\t\n\t\t\t\n\t\t\t$tfilter=\"\";\n\t\t\t$type=\"\";\n\t\t\tif($this->headerFilterable){\n\t\t\t\t$cols=count($this->fields)-1;\n\t\t\t\t\n\t\t\t\tfor($i=0;$i<=$cols;$i++){\n\t\t\t\t\t$meClass=velkan::$config[\"datagrid\"][\"filters\"][\"inputClass\"];\n\t\t\t\t\t\n\t\t\t\t\t$type=\"\";\n\t\t\t\t\tif(!empty($this->types)){\n\t\t\t\t\t\t$type=$this->types[$i];\n\t\t\t\t\t}\n\t\t\t\t\t$value=\"\";\n\t\t\t\t\tif(!empty($this->filters)){\n\t\t\t\t\t\tforeach($this->filters as $filter){\n\t\t\t\t\t\t\tif($filter[0]==$i){\n\t\t\t\t\t\t\t\t$value=$filter[1];\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\t\n\t\t\t\t\t$tfilter.=\"<th class='velkan-grid-column-filter'>\";\n\t\t\t\t\t\n\t\t\t\t\tswitch($type){\n\t\t\t\t\t\tcase \"date\":\n\t\t\t\t\t\t\t$input=new date_time(array(\"id\"=>\"grid{$this->id}Filter\",\"name\"=>\"grid{$this->id}Filter[]\",\"value\"=>$value,\"pickerType\"=>date_time::$DATETIME_PICKER_TYPE_DATE));\n\t\t\t\t\t\t\t$tfilter.=$input->render(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"datetime\":\n\t\t\t\t\t\t\t$input=new date_time(array(\"id\"=>\"grid{$this->id}Filter\",\"name\"=>\"grid{$this->id}Filter[]\",\"value\"=>$value,\"pickerType\"=>date_time::$DATETIME_PICKER_TYPE_DATETIME));\n\t\t\t\t\t\t\t$tfilter.=$input->render(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"time\":\n\t\t\t\t\t\t\t$input=new date_time(array(\"id\"=>\"grid{$this->id}Filter\",\"name\"=>\"grid{$this->id}Filter[]\",\"value\"=>$value,\"pickerType\"=>date_time::$DATETIME_PICKER_TYPE_TIME));\n\t\t\t\t\t\t\t$tfilter.=$input->render(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$tfilter.=\"<input type='search' name='grid{$this->id}Filter[]' $type value=\\\"$value\\\">\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$tfilter.=\"</th>\";\n\t\t\t\t}\n\t\t\t\t$display=($this->ShowFilters?\"\":\"style='display:none'\");\n\t\t\t\t\n\t\t\t\t$filterPrepend=\"\";\n\t\t\t\tif(!empty($this->prependedCols)){\n\t\t\t\t\tforeach($this->prependedCols as $col){\n\t\t\t\t\t\t$filterPrepend.=\"<th>&nbsp;</th>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$filterAppend=\"\";\n\t\t\t\tif(!empty($this->appendedCols)){\n\t\t\t\t\tforeach($this->appendedCols as $col){\n\t\t\t\t\t\t$filterAppend.=\"<th>&nbsp;</th>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$tfilter=\"<tr id='grid{$this->id}Filters' $display>{$filterPrepend}{$tfilter}{$filterAppend}</tr>\";\n\t\t\t}\n\t\t\t\n\t\t\tif($type!=\"\"){\n\t\t\t\t$jss=new generalJavaScriptFunction();\n\t\t\t\t$jss->registerFunction(\"applyFormats\");\n\t\t\t}\n\t\t\t\n\t\t\t$thead.=\"$tfilter</thead>\";\n\t\t}\n\t\t\n\t\treturn $thead;\n\t}", "private function makeTDHeader($type,$header): void {\r\n\t\t$str_d = ($this->bCollapsed) ? ' style=\"display:none\"' : '';\r\n\t\techo '<tr'.$str_d.'>\r\n\t\t\t\t<td class=\"dBug_clickable_row dBug_'.$type.'Key\">' . $header . '</td>\r\n\t\t\t\t<td>';\r\n\t}", "public function addHeader()\n {\n }", "function echoHeader($spec) {\n\techo('<div class=\"tr\">');\n\tforeach($spec as $col) {\n\t\techo('<div class=\"th\">' . htmlspecialchars($col) . '</div>');\n\t}\n\techo('<div class=\"th\">Actions</div>');\n\techo('</div>');\n}", "public function renderHeaderCell()\n\t{\n\t\t$_headerOptions = ['class' => 'serial-column'];\n\t\tif ($this->grid->filterModel !== null && $this->grid->filterPosition !== \\yii\\grid\\GridView::FILTER_POS_HEADER)\n\t\t\t$_headerOptions['rowspan'] = '2';\n\n\t\t$this->headerOptions = ArrayHelper::merge($_headerOptions, $this->headerOptions);\n\t\treturn Html::tag('th', $this->renderHeaderCellContent(), $this->headerOptions);\n\t}", "function print_header(){\n\t\tglobal $worksheet, $xlsRow;\n\t\tglobal $heading_name,$ORG_TITLE;\n\t\t\n\t\t$worksheet->set_column(0, 0, 5);\n\t\t$worksheet->set_column(1, 1, 40);\n\t\t$worksheet->set_column(2, 2, 27);\n\t\t$worksheet->set_column(3, 3, 25);\n\t\t$worksheet->set_column(4, 4, 12);\n\t\t$worksheet->set_column(5, 5, 5);\n\t\t$worksheet->set_column(6, 6, 4);\n\t\t$worksheet->set_column(7, 7, 4);\n\t\t$worksheet->set_column(8, 8, 4);\n\t\t$worksheet->set_column(9, 9, 4);\n\t\t$worksheet->set_column(10, 10, 4);\n\t\t$worksheet->set_column(11, 11, 4);\n\t\t$worksheet->set_column(12, 12, 18);\n\t\t$worksheet->set_column(13, 13, 25);\n\t\t$worksheet->set_column(14, 14, 5);\n\t\t$worksheet->set_column(15, 15, 8);\n\t\t$worksheet->set_column(16, 16, 28);\n\t\t$worksheet->set_column(17, 17, 15);\n\t\t$worksheet->set_column(18, 18, 20);\n\t\t$worksheet->set_column(19, 19, 12);\n\t\t$worksheet->set_column(20, 20, 8);\n\t\t$worksheet->set_column(21, 21, 12);\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"(1)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"(2)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 2, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 3, \"(3)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 4, \"(4)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"(5)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"(6)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 7, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 8, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 9, \"(7)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 10, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 11, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 12, \"(8)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 13, \"(9)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 14, \"(10)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 15, \"(11)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 16, \"(12)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 17,\"(13)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 18, \"(14)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 19, \"(15)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 20, \"(16)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 21, \"(17)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"ชื่อส่วนราชการ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 2, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 3, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 4, \"เลข\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\", 0));\n\t\t$worksheet->write($xlsRow, 7, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\",0));\n\t\t$worksheet->write($xlsRow, 8, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\", 0));\n\t\t$worksheet->write($xlsRow, 9, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"L\", 0));\n\t\t$worksheet->write($xlsRow, 10, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\", 0));\n\t\t$worksheet->write($xlsRow, 11, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"\", 0));\n\t\t$worksheet->write($xlsRow, 12, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 13, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 14, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 15, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 16, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 17, \"พื้นที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 18, \"วุฒิการศึกษา/\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 19, \"อัตรา\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 20, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 21, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"ลำดับ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 3, \"ชื่อ-สกุล\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 4, \"ประจำตัว\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"เพศ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"เกิด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 7, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 8, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 9, \"บรรจุ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 10, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 11, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 12, \"หมวด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 13, \"ชื่อตำแหน่ง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 14, \"ชั้น\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 15, \"ตำแหน่ง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 16, \"ส่วนกลาง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 17, \"ปฏิบัติงาน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 18, \"ประกาศนียบัตร\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 19, \"เงินเดือน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\n\t\t$worksheet->write($xlsRow, 20, \"ปีที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\t\t\n\t\t$worksheet->write($xlsRow, 21, \"หมายเหตุ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LR\", 0));\t\t\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"ที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 1, \"$ORG_TITLE\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"เขต/แขวง/ศูนย์\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 3, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 4, \"ประชาชน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"ว\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 7, \"ด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 8, \"ป\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 9, \"ว\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 10, \"ด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 11, \"ป\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 12, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 13, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 14, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 15, \"เลขที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 16, \"/ภูมิภาค\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 17, \"(จังหวัด)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 18, \"เฉพาะทาง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 19, \"ปัจจุบัน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 20, \"เกษียณ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 1));\n\t\t$worksheet->write($xlsRow, 21, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t}", "function print_header(){\n\t\tglobal $worksheet, $xlsRow;\n\n\t\t$worksheet->set_column(0, 0, 10);\n\t\t$worksheet->set_column(1, 1, 25);\n\t\t$worksheet->set_column(2, 2, 30);\n\t\t$worksheet->set_column(3, 3, 20);\n\t\t$worksheet->set_column(4, 4, 30);\n\t\t$worksheet->set_column(5, 5, 15);\n\t\t$worksheet->set_column(6, 6, 20);\n\t\t$worksheet->set_column(7, 7, 30);\n\t\t$worksheet->set_column(8, 8, 30);\n\t\t$worksheet->set_column(9, 9, 20);\n\t\t$worksheet->set_column(10, 10, 10);\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"ลำดับที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"ชื่อ-สกุล\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"สาขาวิชา\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 3, \"ระดับการศึกษา\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 4, \"สถานศึกษา\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 5, \"ประเทศ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 6, \"ตำแหน่ง/ระดับ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 7, \"สังกัด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 8, \"ชื่อทุน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 9, \"ระยะเวลา\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 10, \"จำนวนวัน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\n\t}", "function create_pool_header()\n{\n $header =\n \"<thead>\n <tr>\n <th scope='col' class='rounded-company'>Pool</th>\n <th scope='col' class='rounded-q1'>Priority</th>\n <th scope='col' class='rounded-q1' colspan='2'>URL</th>\n <th scope='col' class='rounded-q1'>Gets</th>\n <th scope='col' class='rounded-q1'>Accepts</th>\n <th scope='col' class='rounded-q1'>Rejects</th>\n <th scope='col' class='rounded-q1'>Discards</th>\n <th scope='col' class='rounded-q1'>Stales</th>\n <th scope='col' class='rounded-q1'>Get Fails</th>\n <th scope='col' class='rounded-q1'>Rem fails</th>\n </tr>\n </thead>\";\n\n return $header;\n}", "private function makeTableHeader($type,$header,$colspan=2): void {\r\n\t\tif(!$this->bInitialized) {\r\n\t\t\t$header = ' (' . $header . ') ';\r\n\t\t\t$this->bInitialized = true;\r\n\t\t}\r\n\t\t$str_i = ($this->bCollapsed) ? 'style=\"font-style:italic\" ' : '';\r\n\t\t\r\n\t\techo '<table class=\"dBug_table dBug_'.$type.'\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th '.$str_i.' class=\"dBug_clickable_table dBug_' . $type . 'Header\" colspan=\"' . $colspan . '\">' . $header . '</th>\r\n\t\t\t\t</tr>';\r\n\t}", "function drawHeader(){\n switch ($this->doing){\n case 'budget_byProjects':\n case 'myguests':\n if (!(@$this->t instanceof b_table)){\n\t$this->dbg('CANCEL header');\n\t$this->t = new b_table_dummy();\n }\n break;\n\n default:\n parent::drawHeader();\n break;\n }\n }", "private function generate_columns_header($p_edit,&$p_resultat,&$p_result_header)\r\n\t\t{\r\n\t\t\t// Create a new line\r\n\t\t\t$html = '<tr id=\"tr_header_title_'.$this->c_id.'\">';\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Create the first column (checkbox and edit button)\r\n\t\t\t ====================================================================*/\t\r\n\t\t\t$html .= '<td align=\"left\" id=\"header_th_0__'.$this->c_id.'\" class=\"__'.$this->c_theme.'__cell_opt_h\"><div id=\"th0_'.$this->c_id.'\"></div></td>';\r\n\t\t\t$html .= '<td></td>';\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t// Quantify of order clause\r\n\t\t\t$qtt_order = $this->get_nbr_order();\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Display the resize cursor or not\r\n\t\t\t ====================================================================*/\t\r\n\t\t\tif($this->c_mode != __CMOD__)\r\n\t\t\t{\r\n\t\t\t\t$cursor = ' cur_resize';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$cursor = '';\r\n\t\t\t}\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Browse all columns\r\n\t\t\t ====================================================================*/\t\r\n\t\t\tforeach($this->c_columns as $key_col => $val_col)\r\n\t\t\t{\r\n\t\t\t\tif($val_col['display'])\r\n\t\t\t\t{\r\n\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t * Define order icon\r\n\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\tif($this->c_columns[$key_col]['order_by'] != false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// An order clause is defined\r\n\t\t\t\t\t\tif($this->c_columns[$key_col]['order_by'] == __ASC__)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// ASC icon\r\n\t\t\t\t\t\t\t$class_order = ' __'.$this->c_theme.'_ico_sort-ascend __'.$this->c_theme.'_ico';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// DESC icon\r\n\t\t\t\t\t\t\t$class_order = ' __'.$this->c_theme.'_ico_sort-descend __'.$this->c_theme.'_ico';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Display the number of order only if there is more than one order clause\r\n\t\t\t\t\t\t($qtt_order > 1) ? $order_prio = $this->c_columns[$key_col]['order_priority'] : $order_prio = '';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// No order clause defined\r\n\t\t\t\t\t\t$class_order = '';\r\n\t\t\t\t\t\t$order_prio = '';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Order column\r\n\t\t\t\t\t$html .= '<td class=\"__'.$this->c_theme.'_bloc_empty'.$class_order.'\"><span class=\"__vimofy_txt_mini_ vimofy_txt_top\">'.$order_prio.'</span></td>';\r\n\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t\t\r\n\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t * Define order icon\r\n\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\tif($this->c_mode != __CMOD__)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$onmousedown = 'onmousedown=\"vimofy_resize_column_start('.$key_col.',\\''.$this->c_id.'\\');\"';\r\n\t\t\t\t\t\t$ondblclick = 'ondblclick=\"vimofy_mini_size_column('.$key_col.',\\''.$this->c_id.'\\');\" ';\r\n\t\t\t\t\t\t$lib_redim = $this->hover_out_lib(17,17);\r\n\t\t\t\t\t\t$event = $this->hover_out_lib(40,40).' onmousedown=\"vimofy_move_column_start(event,'.$key_col.',\\''.$this->c_id.'\\');\"';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$onmousedown = '';\r\n\t\t\t\t\t\t$ondblclick = '';\r\n\t\t\t\t\t\t$lib_redim = '';\r\n\t\t\t\t\t\t$event = $this->hover_out_lib(40,40).' onmousedown=\"click_column_order(\\''.$this->c_id.'\\','.$key_col.');\"';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/*===================================================================*/\r\n\r\n\t\t\t\t\t// Column title\r\n\t\t\t\t\t$html .= '<td align=\"left\" class=\"__'.$this->c_theme.'__cell_h nowrap\" id=\"header_th_'.$key_col.'__'.$this->c_id.'\"><div '.$event.' class=\"align_'.$this->c_columns[$key_col]['alignment'].' __'.$this->c_theme.'_column_title\" id=\"th'.$key_col.'_'.$this->c_id.'\"><span id=\"span_'.$key_col.'_'.$this->c_id.'\">'.$this->c_columns[$key_col]['name'].'</span></div></td>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t * Display other column\r\n\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\tif($p_edit != false) $html .= '<td style=\"padding:0;margin:0;\"></td>';\r\n\r\n\t\t\t\t\t$html .= '<td '.$lib_redim.' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t$html .= '<td '.$lib_redim.' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__sep_h'.$cursor.'\"></td>';\r\n\t\t\t\t\t$html .= '<td id=\"right_mark_'.$key_col.'_'.$this->c_id.'\" '.$lib_redim.' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$html .= '</tr>';\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Input for search on the column\r\n\t\t\t ====================================================================*/\t\r\n\t\t\t// Create a new line\r\n\t\t\t$html .= '<tr id=\"tr_header_input_'.$this->c_id.'\">';\r\n\t\t\t\r\n\t\t\t// Create the first column (checkbox and edit button)\r\n\t\t\t$html .= '<td align=\"left\" class=\"__'.$this->c_theme.'__cell_opt_h\"><div id=\"thf0_'.$this->c_id.'\" class=\"__'.$this->c_theme.'__vimofy_version\" onclick=\"window.open(\\'vimofy_bugs\\');\">v'.$this->c_software_version.'</div></td>';\r\n\t\t\t\r\n\t\t\t// Id column display counter\r\n\t\t\t$id_col_display = 0;\r\n\t\t\t\r\n\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Browse all columns\r\n\t\t\t ====================================================================*/\t\r\n\t\t\tforeach($this->c_columns as $key_col => $val_col)\r\n\t\t\t{\r\n\t\t\t\tif($val_col['display'])\r\n\t\t\t\t{\r\n\t\t\t\t\tif($id_col_display == 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$html .= '<td id=\"th_0_c'.$key_col.'_'.$this->c_id.'\"></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$html .= '<td id=\"th_0_c'.($key_col).'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*if(isset($this->c_columns[$key_col]))\r\n\t\t\t\t\t{*/\r\n\t\t\t\t\t\t$onmousedown = 'onmousedown=\"vimofy_resize_column_start('.$key_col.',\\''.$this->c_id.'\\');\"';\r\n\t\t\t\t\t\t$ondblclick = 'ondblclick=\"vimofy_mini_size_column('.$key_col.',\\''.$this->c_id.'\\');\" ';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t\t * Define the filter value\r\n\t\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\t\t$filter_input_value = '';\r\n\t\t\t\t\t\t$state_filter_input = '';\r\n\t\t\t\t\t\tif(isset($val_col['filter']['input']))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// A filter was defined by the user\r\n\t\t\t\t\t\t\t$filter_input_value = $val_col['filter']['input']['filter'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// No filter was defined by the user\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Check if vimofy was in edit mode\r\n\t\t\t\t\t\t\tif($p_edit != false && !isset($val_col['rw_flag']) || ($p_edit != false && isset($val_col['rw_flag']) && $val_col['rw_flag'] != __FORBIDEN__))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// The vimofy was in edit mode, search all same value in the column\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Place the cursor on the first row of the recordset\r\n\t\t\t\t\t\t\t\tif($this->c_obj_bdd->rds_num_rows($p_result_header) > 0)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$this->c_obj_bdd->rds_data_seek($p_result_header,0);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// TODO Use a DISTINCT QUERY - Vimofy 1.0\r\n\t\t\t\t\t\t\t\t$key_cold_line = 0;\r\n\t\t\t\t\t\t\t\t$last_value = '';\r\n\t\t\t\t\t\t\t\t$flag_same = false;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\twhile($row = $this->c_obj_bdd->rds_fetch_array($p_result_header))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif($key_cold_line > 0)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif($last_value == $row[$val_col['sql_as']])\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$flag_same = true;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$flag_same = false;\r\n\t\t\t\t\t\t\t\t\t\t\t// The value is not the same of the previous, stop browsing data \r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$flag_same = true;\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t$last_value = $row[$val_col['sql_as']];\r\n\t\t\t\t\t\t\t\t\t$key_cold_line = $key_cold_line + 1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif($flag_same)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$filter_input_value = $last_value;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$filter_input_value = '';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif($p_edit != false && isset($val_col['rw_flag']) && $val_col['rw_flag'] == __FORBIDEN__)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$state_filter_input = 'disabled';\t\t\t\t\t\t\t\t\t// Disable the input because the edition of column is forbiden\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(isset($val_col['filter']))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header_on __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isset($val_col['lov']) && isset($val_col['is_lovable']) && $val_col['is_lovable'] == true)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header_lovable __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(isset($val_col['lov']))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header_no_icon __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t\t * Menu button oncontextmenu\r\n\t\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\t\tif($this->c_type_internal_vimofy == false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Principal vimofy, diplay internal vimofy\r\n\t\t\t\t\t\t\t$oncontextmenu = 'vimofy_display_internal_vim(\\''.$this->c_id.'\\',__POSSIBLE_VALUES__,'.$key_col.');return false;';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Internal vimofy, doesn't display other internal vimofy\r\n\t\t\t\t\t\t\t$oncontextmenu = 'return false;';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$html .= '<td id=\"th_1_c'.$key_col.'_'.$this->c_id.'\" class=\"__vimofy_unselectable\" style=\"width:20px;\"><div style=\"width:20px;margin:0;\" '.$this->hover_out_lib(21,21).' oncontextmenu=\"'.$oncontextmenu.'\" class=\"'.$class_btn_menu.'\" onclick=\"vimofy_toggle_header_menu(\\''.$this->c_id.'\\','.$key_col.');\" id=\"th_menu_'.$key_col.'__'.$this->c_id.'\"></div></td>';\r\n\t\t\t\t\t\t$html .= '<td id=\"th_2_c'.$key_col.'_'.$this->c_id.'\" align=\"left\" class=\"__'.$this->c_theme.'__cell_h\">';\r\n\t\t\t\t\t\t$html .= '<div style=\"margin:0 3px;\"><input value=\"'.str_replace('\"','&quot;',$filter_input_value).'\" class=\"__'.$this->c_theme.'__input_h full_width\" '.$state_filter_input.' id=\"th_input_'.$key_col.'__'.$this->c_id.'\" type=\"text\" style=\"margin: 2px 0;\" size=1 onkeyup=\"if(document.getElementById(\\'chk_edit_c'.$key_col.'_'.$this->c_id.'\\'))document.getElementById(\\'chk_edit_c'.$key_col.'_'.$this->c_id.'\\').checked=true;vimofy_input_keydown(event,this,\\''.$this->c_id.'\\','.$key_col.');\" onchange=\"vimofy_col_input_change(\\''.$this->c_id.'\\','.$key_col.');\"/></div>';\r\n\t\t\t\t\t\tif($p_edit != false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif($state_filter_input == '')\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$html .= '<td style=\"width:10px;padding:0;margin:0;\"><input '.$this->hover_out_lib(76,76).' type=\"checkbox\" id=\"chk_edit_c'.$key_col.'_'.$this->c_id.'\" style=\"height:11px;width:11px;margin: 0 5px 0 2px;display:block;\"/></td>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$html .= '<td style=\"width:0;padding:0;margin:0;\"></td>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$html .= '</td>';\r\n\t\t\t\t\t\t$html .= '<td id=\"th_3_c'.$key_col.'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t\t$html .= '<td id=\"th_4_c'.$key_col.'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__sep_h'.$cursor.'\"></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$id_col_display = $id_col_display + 1;\r\n\t\t\t\t//}\r\n\t\t\t}\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t$html .= '<td id=\"th_0_c'.($key_col+1).'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t$html.= '<td><div style=\"width:200px\"></div></td>';\r\n\t\t\t$html .= '</tr>';\r\n\t\t\t/*===================================================================*/\r\n\r\n\t\t\t// Place the cursor on the first row of the recordset\r\n\t\t\tif($this->c_obj_bdd->rds_num_rows($p_resultat) > 0)\r\n\t\t\t{\r\n\t\t\t\t$this->c_obj_bdd->rds_data_seek($p_resultat,0);\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\treturn $html;\r\n\t\t}", "public function headingRow(): int\n {\n return 1;\n }", "function print_header(){\n\t\tglobal $worksheet, $xlsRow, $COM_LEVEL_SALP;\n\n\t\t$worksheet->set_column(0, 0, 6);\n\t\t$worksheet->set_column(1, 1, 20);\n\t\t$worksheet->set_column(2, 2, 25);\n\t\t$worksheet->set_column(3, 3, 50);\n\t\t$worksheet->set_column(4, 4, 15);\n\t\t$worksheet->set_column(5, 5, 15);\n\t\t$worksheet->set_column(6, 6, 15);\n\t\t$worksheet->set_column(7, 7, 15);\n\t\t$worksheet->set_column(8, 8, 35);\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"ลำดับ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"เลขประจำตัวประชาชน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"ชื่อ-นามสกุล\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\t\t$worksheet->write($xlsRow, 3, \"ตำแหน่ง/สังกัด\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 4, \"เลขที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 5, \"อัตราเงินเดือน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 6, \"เงินตอบแทน\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 1));\n\t\t$worksheet->write($xlsRow, 7, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 1));\n\t\t$worksheet->write($xlsRow, 8, \"หมายเหตุ\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLR\", 0));\n\n\t\t$xlsRow++;\n\t\t$worksheet->write($xlsRow, 0, \"ที่\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 1, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 2, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 3, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 4, \"ตำแหน่ง\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t\t$worksheet->write($xlsRow, 5, \"ที่เต็มขั้น\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 6, \"ร้อยละ 2 (บาท)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 7, \"ร้อยละ 4 (บาท)\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"TLRB\", 0));\n\t\t$worksheet->write($xlsRow, 8, \"\", set_format(\"xlsFmtTableHeader\", \"B\", \"C\", \"LRB\", 0));\n\t}", "public function addHeaderArray(array $header) {\n $this->headers = $header;\n foreach ($header as $key => $cell) {\n if (!($cell instanceof HTMLTableHeaderCell)) {\n $cell = new HTMLTableHeaderCell($cell);\n }\n $this->headers[$key] = $cell;\n $this->addView($cell);\n }\n return $this;\n }", "private function generateHeading()\n {\n //get current dimensions\n\t\t$highestRow = $this->objWorksheet->getHighestRow(); // e.g. 10\n\t\t$highestColumn = $this->objWorksheet->getHighestColumn(); // e.g 'F'\n\n\t\t$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn);\n\n\t\t//insert row on top\n\t\t$this->objWorksheet->insertNewRowBefore(1,2);\n\n\t\t//merge cells\n\t\t$this->objWorksheet->mergeCells(\"A1:\".$highestColumn.\"1\");\n\n\t\t//set the text for header\n\t\t$this->objWorksheet->setCellValue(\"A1\", $this->_headingText);\n\t\t$this->objWorksheet->getStyle('A1')->getAlignment()->setWrapText(true);\n\t\t$this->objWorksheet->getRowDimension('1')->setRowHeight(48);\n\n //Apply style\n\t\t$this->objWorksheet->getStyle(\"A1\")->applyFromArray($this->_headingStyleArray);\n }" ]
[ "0.7692292", "0.712604", "0.7125858", "0.70332825", "0.69570416", "0.69057786", "0.68878156", "0.68810683", "0.68019676", "0.6754671", "0.66745335", "0.6660335", "0.66567206", "0.66486377", "0.66272867", "0.6618329", "0.6592501", "0.6578868", "0.6541822", "0.654087", "0.6540089", "0.6519953", "0.65189195", "0.65034914", "0.64570457", "0.64347345", "0.6418624", "0.6394077", "0.6380496", "0.63706565" ]
0.72553575
1
Get element of header container
public function getHeaderContainer() { return $this->_thead; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHeadElement()\n {\n return $this->head;\n }", "public function get_header() {\n\t\tif (!isset($this->header)) {\n\t\t\t$this->get_array();\n\t\t}\n\t\treturn $this->header;\n\t}", "public function getHeader(): ?HtmlElementInterface\n {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->content['header'];\n }", "function get_header()\n\t{\n\t\treturn $this->header;\n\t}", "public function get_header()\n {\n return <<<EOD\n<div id=\"sitehdr\">\n Sitewide Header\n</div>\n\nEOD;\n }", "public function getHeader()\n {\n return isset($this->header) ? $this->header : null;\n }", "public function getHeader()\n {\n return isset($this->header) ? $this->header : null;\n }", "public function getWrapperElement();", "function newsroom_elated_get_header() {\n $id = newsroom_elated_get_page_id();\n\n //will be read from options\n $header_type = 'header-type3';\n $header_behavior = newsroom_elated_options()->getOptionValue('header_behaviour');\n\n if(HeaderFactory::getInstance()->validHeaderObject()) {\n $parameters = array(\n 'hide_logo' => newsroom_elated_options()->getOptionValue('hide_logo') == 'yes' ? true : false,\n 'header_in_grid' => newsroom_elated_options()->getOptionValue('header_in_grid') == 'yes' ? true : false,\n 'logo_position' => newsroom_elated_get_meta_field_intersect('logo_position',$id),\n 'show_sticky' => in_array($header_behavior, array(\n 'sticky-header-on-scroll-up',\n 'sticky-header-on-scroll-down-up'\n )) ? true : false,\n );\n\n $parameters = apply_filters('newsroom_elated_header_type_parameters', $parameters, $header_type);\n\n HeaderFactory::getInstance()->getHeaderObject()->loadTemplate($parameters);\n }\n }", "function getHeader()\n\t{\n\t\treturn $this->header;\n\t}", "public function getHeaders()\n\t{\n\t\t$ret = null;\n\t\tif ($this->_thead instanceof HtmlElement) {\n\t\t\t$ret = $this->_thead->getElements();\n\t\t}\n\t\treturn $ret;\n\t}", "public function getHeadingTag()\n {\n return $this->Parent()->HeadingTag;\n }", "public function get_header() {\n $this->do_header();\n return $this->c_header;\n }", "public function header() {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->Header;\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function GetHeader()\n {\n return $this->HeaderName;\n }", "public function getHeader() {\r\n return $this->__header;\r\n }", "public function getHeader(){\n\t\treturn $this->header;\n\t}", "public function getHeader ()\n {\n return $this->header;\n }", "public function getHeader() {\n return $this->Header;\n }", "public function getHeader()\n\t{\n\t\treturn $this->header;\n\t}", "public function getHeader() {\n return $this->header;\n }", "protected function _createHeaderContainer()\n\t{\n\t\tif ($this->_thead == null) {\n\t\t\t$this->_thead = new HtmlElement('thead');\n\t\t\t$this->addElement($this->_thead);\n\t\t}\t\t\n\t}", "public function getHeader($rowIndex)\n\t{\n\t\t$ret = null;\n\t\tif ($this->_thead instanceof HtmlElement) {\n\t\t\t$ret = $this->_thead->getElement($rowIndex);\n\t\t}\n\t\treturn $ret;\n\t}" ]
[ "0.66016114", "0.64025205", "0.63993317", "0.6157431", "0.61392045", "0.6126388", "0.6118815", "0.6118815", "0.61108035", "0.6052106", "0.6040585", "0.6014633", "0.6011997", "0.6007136", "0.5996616", "0.5951458", "0.5950244", "0.5950244", "0.5950244", "0.5950244", "0.5950244", "0.5945788", "0.594095", "0.5935838", "0.5927319", "0.5907427", "0.58997613", "0.58928925", "0.5867365", "0.58609927" ]
0.6985704
0
Get all elements of body rows
public function getRows() { $ret = null; if ($this->_tbody instanceof HtmlElement) { $ret = $this->_tbody->getElements(); } return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getElements() {\n return $this->rows_object;\n }", "public function getRowsContainer()\n\t{\n\t\treturn $this->_tbody;\n\t}", "public function rows() {\n\t\treturn $this->row();\n\t}", "public function getElements() {}", "function get_all(){\r\n\t\t$rows = array();\r\n\t\twhile($row = $this->get_row()){\r\n\t\t\t$rows[] = $row;\r\n\t\t}\r\n\t\treturn $rows;\r\n\t}", "public function get_rows() {\n\t\tif (!isset($this->rows)) {\n\t\t\t$this->rows = $this->get_array();\n\t\t\t// Take out the header\n\t\t\tarray_shift($this->rows);\n\t\t}\n\t\telse {\n\t\t\treset($this->rows);\n\t\t}\n\t\treturn $this->rows;\n\t}", "public function getElements();", "protected function fetchElementNodes()\n {\n $elements = [];\n\n foreach ($this->map as $query) {\n $list = $this->document->xpath($query);\n\n if (0 == count($list)) {\n continue;\n }\n\n foreach ($list as $node) {\n $elements[] = new HtmlNode($node, $this->document->getDocument());\n }\n }\n\n return $elements;\n }", "public function getHtmlElements();", "public function elements()\n {\n return parent::elements();\n }", "public function getRows();", "public function getRows();", "public function getAll() {\n\t\treturn $this->rows;\n\t}", "protected function tableRows()\n {\n $tbody = DB::table($this->argument('table'))->get();\n\n return $tbody->map(function ($field) {\n return $this->selectRowByField($field);\n });\n }", "public function getRows()\n {\n if (is_null($this->summaryRow)) {\n return $this->rows;\n } else {\n return $this->rows + array(self::ID_SUMMARY_ROW => $this->summaryRow);\n }\n }", "public function getRows()\n\t{\n\t\treturn $this->driver->getRows();\n\t}", "function getRows() {\n\t\treturn $this->rows;\n\t}", "abstract public function get_rows();", "abstract protected function getRows();", "public function allChildrenElements() {\n\t\treturn $this->childrenElements()->with('allChildrenElements');\n\t}", "public function get_rows() {\n return $this->rows;\n }", "public function getRows()\n {\n return $this->rows;\n }", "public function getRows()\n {\n return $this->rows;\n }", "public function getRows ()\n {\n return $this->_rows;\n }", "protected function getElements()\n {\n return $this->elements;\n }", "protected function getElements(){\n return $this->_elements;\n }", "public function body()\n {\n $this->altRow = false;\n $lastBreakValue = null;\n $body[] = '<tbody>';\n $breaks = 0;\n foreach ($this->data as $index => $row) {\n if (!empty($this->tableOptions['break'])) {\n $breakValue = $row[$this->tableOptions['break']];\n if ($breakValue !== $lastBreakValue) {\n $lastBreakValue = $breakValue;\n if ($breaks) {\n $body[] = '</tbody>';\n $body[] = '<tbody class=\"page-break-before\">';\n }\n $breaks++;\n $body[] = $this->buildBreakRow($this->tableOptions['break'], $row);\n // continue;\n }\n }\n $body[] = $this->buildRow($row);\n }\n $body[] = '</tbody>';\n\n $ret = implode(chr(10), $body);\n\n if (!empty($this->tableOptions['totals'])) {\n $ret .= $this->buildTotalsRow();\n }\n\n return $ret;\n }", "public function rows() {\n return $this->schema->rows;\n }", "public function getChildElements() {}", "function getRows() { return $this->_rows; }" ]
[ "0.7145024", "0.67310625", "0.6620081", "0.6614637", "0.65186584", "0.65153134", "0.64370507", "0.63596195", "0.63553333", "0.63031673", "0.6249923", "0.6249923", "0.6209117", "0.6174423", "0.6156906", "0.6131532", "0.6096748", "0.6048213", "0.60419387", "0.6029207", "0.60171497", "0.6006638", "0.6006638", "0.59791946", "0.597245", "0.59676254", "0.59582824", "0.5926823", "0.5923198", "0.5921745" ]
0.75805193
0
Get element of header row
public function getHeader($rowIndex) { $ret = null; if ($this->_thead instanceof HtmlElement) { $ret = $this->_thead->getElement($rowIndex); } return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function getRowsHeader(): array;", "public function getHeaderRow($asArray = false) {\n\t\tif (!empty($this->headers)) {\n\t\t\tif ($asArray) {\n\t\t\t\treturn array_keys($this->data);\n\t\t\t} else {\n\t\t\t\treturn Header::getInstance()->setData(array_keys($this->data));\n\t\t\t}\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public function getHeaderContainer()\n\t{\n\t\treturn $this->_thead;\n\t}", "public function headingRow(): int\n {\n return 1;\n }", "public function getHeaders()\n\t{\n\t\t$ret = null;\n\t\tif ($this->_thead instanceof HtmlElement) {\n\t\t\t$ret = $this->_thead->getElements();\n\t\t}\n\t\treturn $ret;\n\t}", "public function get_log_row_header_output( $row ) {\n\t\t$row_logger = $row->logger;\n\t\t$row->context = isset( $row->context ) && is_array( $row->context ) ? $row->context : array();\n\n\t\t// Fallback to SimpleLogger if no logger exists for row\n\t\tif ( ! isset( $this->instantiated_loggers[ $row_logger ] ) ) {\n\t\t\t$row_logger = 'SimpleLogger';\n\t\t}\n\n\t\t$logger = $this->instantiated_loggers[ $row_logger ]['instance'];\n\n\t\treturn $logger->get_log_row_header_output( $row );\n\t}", "public function isFirstRowHeaders()\n\t{\n\t\treturn $this->firstRowHeaders;\n\t}", "public function get_header() {\n\t\tif (!isset($this->header)) {\n\t\t\t$this->get_array();\n\t\t}\n\t\treturn $this->header;\n\t}", "abstract protected function getColumnsHeader(): array;", "public function getRow()\n {\n return $this->get('Row');\n }", "public function renderHeaderCell()\n\t{\n\t\t$_headerOptions = ['class' => 'serial-column'];\n\t\tif ($this->grid->filterModel !== null && $this->grid->filterPosition !== \\yii\\grid\\GridView::FILTER_POS_HEADER)\n\t\t\t$_headerOptions['rowspan'] = '2';\n\n\t\t$this->headerOptions = ArrayHelper::merge($_headerOptions, $this->headerOptions);\n\t\treturn Html::tag('th', $this->renderHeaderCellContent(), $this->headerOptions);\n\t}", "function headerRow(&$rows, $rowN, $add_edit_link) {\n $currentRow = current($rows);\n?>\n\t<tr data-row=\"<?= $rowN ?>\">\n<?php\n if ($add_edit_link) {\n?>\n <th></th>\n<?php\n }\n foreach ($currentRow as $fieldName => $val) {\n?>\n\t\t<th class=\"popr\" data-id=\"1\">\n\t\t\t<?= $fieldName ?>\n\t\t</th>\n<?php\n }\n?>\n\t</tr>\n<?php\n }", "public function GetHeader()\n {\n return $this->HeaderName;\n }", "public function getHeadElement()\n {\n return $this->head;\n }", "public function getHeader()\n {\n return $this->content['header'];\n }", "abstract public function getSpecificRow();", "public function getCSVHeaderRow() {\n return [\n 'link_title',\n 'link_layout',\n 'link_location',\n 'content_type',\n 'link_count',\n 'link_clicked',\n 'clicked',\n 'os',\n 'device',\n 'device_brand',\n 'device_model',\n 'browser_type',\n 'browser_name',\n 'browser_version',\n 'site',\n 'page_url',\n 'referrer',\n 'paragraphs',\n 'displayed_url_1',\n 'displayed_url_2',\n 'displayed_url_3',\n 'displayed_url_4',\n 'displayed_url_5',\n 'time_logged',\n 'time_updated',\n 'user_id',\n 'browser',\n 'row'\n ];\n }", "public function getValueForHeader($header)\n {\n switch ($header){\n case '#':\n return $this->id;\n case 'Fatura':\n return $this->fatura_join()->first()->nome;\n case 'Ordem Serviço':\n return $this->ordem_servico_join()->first()->nome;\n }\n }", "protected function get_element_header_content(&$element) {\n global $CFG;\n\n $content = array();\n $attributes = array();\n $text = $element['object']->get_name();\n\n if ($element['type'] != 'item' and $element['type'] != 'categoryitem' and\n $element['type'] != 'courseitem') {\n $content[0] = progress_report_generator::build_content_text_node($text);\n return $content;\n }\n\n $itemtype = $element['object']->itemtype;\n $itemmodule = $element['object']->itemmodule;\n $iteminstance = $element['object']->iteminstance;\n\n if ($itemtype=='mod' and $iteminstance and $itemmodule) {\n if ($cm = get_coursemodule_from_instance($itemmodule, $iteminstance, $this->courseid)) {\n\n $a = new stdClass();\n $a->name = get_string('modulename', $element['object']->itemmodule);\n $attributes['title'] = get_string('linktoactivity', 'grades', $a);\n $dir = $CFG->dirroot.'/mod/'.$itemmodule;\n\n if (file_exists($dir.'/grade.php')) {\n $attributes['href'] = $CFG->wwwroot.'/mod/'.$itemmodule.'/grade.php?id='.$cm->id;\n } else {\n $attributes['href'] = $CFG->wwwroot.'/mod/'.$itemmodule.'/view.php?id='.$cm->id;\n }\n }\n }\n $content[0] = progress_report_generator::build_content_container_node(progress_report_generator::HTML_HYPERLINK, $attributes);\n $content[0]['children'][0] = progress_report_generator::build_content_text_node($text);\n\n return $content[0];\n }", "protected function get_header_elements() {\n foreach( $this->header_elements_array as $header_element ) {\n $header_elements .= \"\\n\" . $header_element;\n }\n\n return $header_elements;\n }", "public function getRow();", "public function tableHeaderRow($in){\n $out = '';\n $cols = array_keys($in);\n foreach($cols as $k){\n $out .= '<td>'.$k.'</td>';\n }\n return('<tr>'.$out.'</tr>');\n }", "protected function csvHeader()\n {\n return end($this->_csvHeader);\n }", "public function getRow()\n {\n return $this->row;\n }", "function table_table_header_row($values)\n{\n\t$cells=new ocp_tempcode();\n\tforeach ($values as $value)\n\t{\n\t\t$cells->attach(do_template('TABLE_TABLE_HEADER_ROW_CELL',array('_GUID'=>'5002f54ccddf7259f3460d8c0759fd1a','VALUE'=>$value)));\n\t}\n\n\treturn do_template('TABLE_TABLE_HEADER_ROW',array('_GUID'=>'2f4095b8d30f50f34fdd6acf8dd566b1','CELLS'=>$cells));\n}", "protected function getLineHeader($line) {\n\t\treturn Billrun_Factory::db()->logCollection()->query(array('header.stamp' => $line['log_stamp']))->cursor()->current();\n\t}", "public function getHeader() {\r\n return $this->__header;\r\n }", "public function getHeader()\n {\n return $this->Header;\n }", "public function getRow() {}", "public function getHeader()\n {\n return isset($this->header) ? $this->header : null;\n }" ]
[ "0.6810676", "0.62944865", "0.6242552", "0.62250215", "0.62175643", "0.61919236", "0.61153996", "0.6094448", "0.6079371", "0.60705155", "0.6048987", "0.60014737", "0.5972997", "0.5966424", "0.5965936", "0.5939383", "0.5904225", "0.5897384", "0.5888053", "0.5882271", "0.58722883", "0.5869115", "0.5861866", "0.5859808", "0.5807965", "0.5799877", "0.578677", "0.5785465", "0.5779613", "0.5778561" ]
0.6975997
0
Create the element of header container if it does not exist
protected function _createHeaderContainer() { if ($this->_thead == null) { $this->_thead = new HtmlElement('thead'); $this->addElement($this->_thead); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createHeader() {\n\t\t$header = new PHPWord_Section_Header($this->_sectionCount);\n\t\t$this->_header = $header;\n\t\treturn $header;\n\t}", "public function addChild($header = \"\");", "public function newHeaderContainer()\n {\n return new HeaderContainer($this);\n }", "private function createHeader() {\r\n\t\t$headerHtml = $this->getHeaderHtml();\r\n\t\t//Guardo el archivo del header\r\n\t\t$htmlPath = $this->localTmpFolder . $this->fileName . '_currentHeader' . '.html';\r\n\t\t$fh = fopen($htmlPath, 'w');\r\n\t\tfwrite($fh, $headerHtml);\r\n\t\tfclose($fh);\r\n\t\treturn $headerHtml;\r\n\t}", "public function buildHeader() {\n $this->build = [\n // '#type' => 'page',.\n 'container' => [\n '#type' => 'html_tag',\n '#tag' => 'div',\n '#attributes' => [\n 'class' => 'container',\n ],\n 'page_header' => [\n '#type' => 'html_tag',\n '#tag' => 'h2',\n '#value' => $this->t('<a href=\"@site-audit-uri\">Site Audit</a> report for @site', [\n '@site-audit-uri' => 'https://drupal.org/project/site_audit',\n '@site' => $this->options['uri'],\n ]),\n '#attributes' => [\n 'id' => 'page-header',\n ],\n 'br' => [\n '#type' => 'html_tag',\n '#tag' => 'br',\n ],\n 'sub_head' => [\n '#type' => 'html_tag',\n '#tag' => 'small',\n '#value' => $this->t('Generated on @date_time', ['@date_time' => \\Drupal::service('date.formatter')->format(\\Drupal::time()->getRequestTime())]),\n ],\n ],\n ],\n ];\n if (is_array($this->report)) {\n // There are multiple reports.\n $this->build['container']['summary'] = [\n '#type' => 'html_tag',\n '#tag' => 'div',\n '#attributes' => [\n 'id' => 'summary',\n ],\n ];\n $this->build['container']['summary']['title'] = [\n '#type' => 'html_tag',\n '#tag' => 'h2',\n '#value' => $this->t('Summary'),\n ];\n $this->build['container']['summary']['links'] = [\n '#type' => 'html_tag',\n '#tag' => 'p',\n ];\n foreach ($this->report as $report) {\n $this->build['container']['summary']['links'][$report->getPluginId()] = [\n '#type' => 'html_tag',\n '#tag' => 'a',\n '#value' => $report->getLabel() . ' (' . $report->getPercent() . '%)',\n '#attributes' => [\n 'href' => '#' . $report->getPluginId(),\n 'class' => $this->getPercentCssClass($report->getPercent()),\n ],\n ];\n }\n }\n }", "private function addHeaderDetails(){ \n $headerCount = $this->createElement('select', 'headerCount')\n ->addMultiOptions(array('1' => '1 - Header', '2' => '2 - Header', '3' => '3 - Header'))\n ->setValue('3');\n \n $highPressure = $this->createElement('text', 'highPressure')\n ->setAttrib('style', 'width: 60px;')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => $this->mS->minPressure(), 'max' => $this->mS->critPressure(), 'inclusive' => true));\n $mediumPressure = $this->createElement('text', 'mediumPressure')\n ->setAttrib('style', 'width: 60px;');\n $lowPressure = $this->createElement('text', 'lowPressure')\n ->setAttrib('style', 'width: 60px;');\n $hpSteamUsage = $this->createElement('text', 'hpSteamUsage')\n ->setAttrib('style', 'width: 60px;')\n ->setRequired(true)\n ->addValidator($this->isFloat,true);\n $mpSteamUsage = $this->createElement('text', 'mpSteamUsage')\n ->setAttrib('style', 'width: 60px;');\n $lpSteamUsage = $this->createElement('text', 'lpSteamUsage')\n ->setAttrib('style', 'width: 60px;');\n\n $this->addElements(array(\n $headerCount,\n $highPressure,\n $mediumPressure,\n $lowPressure,\n $hpSteamUsage,\n $mpSteamUsage,\n $lpSteamUsage,\n )); \n \n $condReturnTemp = $this->createElement('text', 'condReturnTemp')\n ->setValue(round($this->mS->localize(338.705556, 'temperature')))\n ->setAttrib('style', 'width: 60px;')\n ->setRequired(true)\n ->addValidator($this->isFloat,true);\n \n $condReturnFlash = $this->createElement('select', 'condReturnFlash')\n ->addMultiOptions(array('No' => 'No', 'Yes' => 'Yes'))\n ->setValue('No');\n $hpCondReturnRate = $this->createElement('text', 'hpCondReturnRate')\n ->setAttrib('style', 'width: 60px;')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => 0, 'max' => 100, 'inclusive' => true));\n $mpCondReturnRate = $this->createElement('text', 'mpCondReturnRate')\n ->setAttrib('style', 'width: 60px;');\n $lpCondReturnRate = $this->createElement('text', 'lpCondReturnRate')\n ->setAttrib('style', 'width: 60px;');\n $hpCondFlash = $this->createElement('select', 'hpCondFlash')\n ->addMultiOptions(array('No' => 'No', 'Yes' => 'Yes'))\n ->setValue('No');\n $mpCondFlash = $this->createElement('select', 'mpCondFlash')\n ->addMultiOptions(array('No' => 'No', 'Yes' => 'Yes'))\n ->setValue('No');\n\n $this->addElements(array(\n $condReturnTemp,\n $condReturnFlash,\n $hpCondReturnRate,\n $mpCondReturnRate,\n $lpCondReturnRate,\n $hpCondFlash,\n $mpCondFlash,\n ));\n \n $hpHeatLossPercent = $this->createElement('text', 'hpHeatLossPercent')\n ->setValue(.1)\n ->setAttrib('style', 'width: 60px;');\n $mpHeatLossPercent= $this->createElement('text', 'mpHeatLossPercent')\n ->setValue(.1)\n ->setAttrib('style', 'width: 60px;');\n $lpHeatLossPercent = $this->createElement('text', 'lpHeatLossPercent')\n ->setValue(.1)\n ->setAttrib('style', 'width: 60px;');\n\n $this->addElements(array(\n $hpHeatLossPercent,\n $mpHeatLossPercent,\n $lpHeatLossPercent,\n ));\n }", "private function build_header() {\n\t\t// if we've already got the cart ID, use it\n\t\t$header = self::fetch('cart_header', [':cart_id' => $this->id()]);\n\n\t\t$header['date_created'] = ck_datetime::datify(@$header['date_created']);\n\t\tif (!empty($header['date_updated'])) $header['date_updated'] = ck_datetime::datify($header['date_updated']);\n\n\t\t$this->skeleton->load('header', $header);\n\t}", "protected function makeHeader()\n {\n }", "function createHeader($options = array()) {\n $header = new Header( $options );\n $html = $header->html();\n return $html;\n}", "function generate_construct_header_widget() {\n\t\tif ( is_active_sidebar( 'header' ) ) : ?>\n\t\t\t<div class=\"header-widget\">\n\t\t\t\t<?php dynamic_sidebar( 'header' ); ?>\n\t\t\t</div>\n\t\t<?php endif;\n\t}", "function minorite_header($variables){\n return '<header'.drupal_attributes($variables['elements']['#wrapper_attributes']).'>'.$variables['elements']['#children'].'</header>';\n}", "public function testHeadElementAutomaticallyCreated() {\n\t\t$document = new HTMLDocument(Helper::HTML);\n\t\t$this->assertInstanceOf(Element::class, $document->head);\n\t}", "public function defineHeader()\n {\n $this->header = new Header();\n }", "public function get_header()\n {\n return <<<EOD\n<div id=\"sitehdr\">\n Sitewide Header\n</div>\n\nEOD;\n }", "public function processHeader()\n {\n $toggle =\n '<button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"#' . $this->getWidgetId() . '_collapse\">\n <span class=\"sr-only\">Toggle navigation</span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n </button>';\n\n $brand = '';\n if ($this->getBrand())\n {\n $brand = $this->getBrand();\n $brand = self::$html->decode(self::$html->link($brand[1], $brand[0], ['class' => 'navbar-brand']));\n }\n\n $this->addHeader($this->createWrapper('div', ['class' => 'navbar-header'], $toggle . $brand));\n }", "protected function _build_header(){\n\t\t$html = '';\n\t\t\n\t\t$html .= '<div class=\"container-narrow marginTop60\">';\r\n\t\t$html .= '<a href=\"'.home_url('/').'\">';\r\n\t\t$html .= '<img src=\"'.get_header_image().'\" height=\"'.get_custom_header()->height .'\"\r\n\t\twidth=\"'.get_custom_header()->width.'\" alt=\"\" class=\"marginTop40 marginBottom20\"\r\n\t\talign=\"center\"/>\r\n\t\t</a>';\r\n\t\t$html .= '<p class=\"centerText\">'.get_bloginfo('description').'</p>';\r\n\t\t$html .= '<hr class=\"marginBottom20 width50\">';\r\n\t\t$html .= '</div>';\n\t\t\n\t\techo $html;\n\t}", "function generate_header_items() \r\n{\r\n\t// Header widget\r\n\tgenerate_construct_header_widget();\r\n\t\r\n\t// Site logo\r\n\tgenerate_construct_logo();\r\n\t\r\n\t// Site title and tagline\r\n\tgenerate_construct_site_title();\r\n\t\r\n}", "public function Header() {\r\n $this->varcave->logger->debug('Create PDF top header');\r\n\t\tif ($this->noheader){\r\n\t\t\treturn true;\r\n\t\t}\r\n // Logo\r\n\t\t$this->setFont($this->font, 'BI', 8, '', 'false');\r\n\t\t$this->Image($this->headerImg,4,4,170);\r\n\t\t\r\n\t\t//text box after header image\r\n\t\t$this->RoundedRect(172,4,35,10,3.5,'D');\r\n\t\t$this->SetXY(173,5);\r\n\t\t$this->cell(0,3, LNE::pdf_caveRef . ': ' . $this->cavedata['caveRef'],0);\r\n\t\t$this->SetXY(173,9);\r\n\t\t//If pagegroup is on set group page number, or set a global PDF page number \r\n\t\tif ( $this->pagegroups == false )\r\n\t\t{\r\n\t\t\t$this->cell(0,3,LNE::pdf_page. ': '. $this->getAliasNumPage() . '/' . $this->getAliasNbPages(),0);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->cell(0,3,LNE::pdf_page .': '. $this->getPageGroupAlias(). '-'.$this->getPageNumGroupAlias() ,0);\r\n\t\t}\r\n\t\t\r\n }", "public function getHeaderContainer()\n\t{\n\t\treturn $this->_thead;\n\t}", "function newsroom_elated_get_header() {\n $id = newsroom_elated_get_page_id();\n\n //will be read from options\n $header_type = 'header-type3';\n $header_behavior = newsroom_elated_options()->getOptionValue('header_behaviour');\n\n if(HeaderFactory::getInstance()->validHeaderObject()) {\n $parameters = array(\n 'hide_logo' => newsroom_elated_options()->getOptionValue('hide_logo') == 'yes' ? true : false,\n 'header_in_grid' => newsroom_elated_options()->getOptionValue('header_in_grid') == 'yes' ? true : false,\n 'logo_position' => newsroom_elated_get_meta_field_intersect('logo_position',$id),\n 'show_sticky' => in_array($header_behavior, array(\n 'sticky-header-on-scroll-up',\n 'sticky-header-on-scroll-down-up'\n )) ? true : false,\n );\n\n $parameters = apply_filters('newsroom_elated_header_type_parameters', $parameters, $header_type);\n\n HeaderFactory::getInstance()->getHeaderObject()->loadTemplate($parameters);\n }\n }", "public function header() {\n\t\tRequirements::clear();\n\n\t\t$templates = ['Grasenhiller\\WkHtmlToX\\PdfHeader'];\n\t\t$data = $this->getHeaderFooterVariables();\n\n\t\tif (isset($data['template']) && $data['template']) {\n\t\t\t$templates[] = $data['template'];\n\t\t}\n\n\t\t$this->extend('updateHeader', $templates, $data);\n\n\t\treturn $this\n\t\t\t->customise($data)\n\t\t\t->renderWith(array_reverse($templates));\n\t}", "function iver_select_set_header_object() {\n \t$header_type = iver_select_get_meta_field_intersect('header_type', iver_select_get_page_id());\n\t $header_types_option = iver_select_get_header_type_options();\n\t \n $object = Lib\\HeaderFactory::getInstance()->build($header_type, $header_types_option);\n\n if(Lib\\HeaderFactory::getInstance()->validHeaderObject()) {\n $header_connector = new Lib\\IverSelectHeaderConnector($object);\n $header_connector->connect($object->getConnectConfig());\n }\n }", "function load_header(){\n\t\techo \"<div style='background:darkblue; height:100px; '> HEADER </div>\";\n\t}", "public function header() {\r\n $html = <<<HTML\r\n\r\n <header>\r\n <p class=\"welcomeScreen\" ><img src=\"images/title.png\" alt=\"\" ></p>\r\n <h1 class=\"welcomeScreen\">$this->title</h1>\r\n </header>\r\nHTML;\r\n return $html;\r\n }", "function biagiotti_mikado_get_header() {\n\t\t$id = biagiotti_mikado_get_page_id();\n\t\t\n\t\t//will be read from options\n\t\t$header_type = biagiotti_mikado_get_meta_field_intersect( 'header_type', $id );\n\t\t\n\t\t$menu_area_in_grid = biagiotti_mikado_get_meta_field_intersect( 'menu_area_in_grid', $id );\n\t\t\n\t\t$header_behavior = biagiotti_mikado_get_meta_field_intersect( 'header_behaviour', $id );\n\t\t\n\t\tif ( HeaderFactory::getInstance()->validHeaderObject() ) {\n\t\t\t$parameters = array(\n\t\t\t\t'hide_logo' => biagiotti_mikado_options()->getOptionValue( 'hide_logo' ) == 'yes',\n\t\t\t\t'menu_area_in_grid' => $menu_area_in_grid == 'yes',\n\t\t\t\t'show_sticky' => in_array( $header_behavior, array( 'sticky-header-on-scroll-up', 'sticky-header-on-scroll-down-up' ) ),\n\t\t\t\t'show_fixed_wrapper' => in_array( $header_behavior, array( 'fixed-on-scroll' ) ),\n\t\t\t);\n\t\t\t\n\t\t\t$parameters = apply_filters( 'biagiotti_mikado_filter_header_type_parameters', $parameters, $header_type );\n\t\t\t\n\t\t\tHeaderFactory::getInstance()->getHeaderObject()->loadTemplate( $parameters );\n\t\t}\n\t}", "public function getHeaderHTML()\n\t{\n\t\tif(!is_array($this->elements['header'])){\n\t\t\t// Headers are optional\n\t\t\treturn false;\n\t\t}\n\n\t\t# Header buttons can also be defined outside of the header key when defining modal vales.\n\t\t$this->elements['header']['buttons'] = array_merge($this->elements['header']['buttons'] ?: [], $this->buttons ?: []);\n\n\t\t# Add the required Bootstrap header class very first\n\t\t$this->elements['header']['class'] = str::getAttrArray($this->elements['header']['class'], \"modal-header\", $this->elements['header']['only_class']);\n\n\t\t# Draggable\n\t\t$this->elements['header']['class'][] = $this->draggable ? \"modal-header-draggable\" : false;\n\n\t\t# Styles\n\t\t$this->elements['header']['style'] = str::getAttrArray($this->elements['header']['style'], NULL, $this->elements['header']['only_style']);\n\n\t\t# Dropdown buttons\n\t\tif($this->elements['header']['buttons']){\n\t\t\t$buttons = Button::get($this->elements['header']);\n\t\t}\n\n\t\t# Button(s) in a row\n\t\t$button = Button::generate($this->elements['header']['button']);\n\n\t\tif($button){\n\t\t\t$button = \"<div class=\\\"btn-float-right\\\">{$button}</div>\";\n\t\t}\n\n\t\t# Accent\n\t\t$this->elements['header']['class'][] = str::getColour($this->accent, \"bg\");\n\n\t\t# Icon\n\t\tif(!$icon = Icon::generate($this->elements['header']['icon'])){\n\t\t\t//the icon attribute can either be in the header or in the main modal\n\t\t\t$icon = Icon::generate($this->icon);\n\t\t}\n\n\t\t# Badge\n\t\t$badge = Badge::generate($this->elements['header']['badge']);\n\n\t\t# ID\n\t\t$id = str::getAttrTag(\"id\", $this->elements['header']['id']);\n\n\t\t# Style\n\t\t$style = str::getAttrTag(\"style\", $this->elements['header']['style']);\n\n\t\t# Title colour\n\t\t$class[] = str::getColour($this->elements['header']['colour']);\n\n\t\t# Script\n\t\t$script = str::getScriptTag($this->elements['header']['script']);\n\n\t\t# The header title itself\n\t\t$title = $this->elements['header']['header'] . $this->elements['header']['title'] . $this->elements['header']['html'];\n\n\t\t# Title class\n\t\tif(!empty(array_filter($class))){\n\t\t\t$title_class = str::getAttrTag(\"class\", $class);\n\t\t\t$title = \"<span{$title_class}>$title</span>\";\n\t\t}\n\n\t\t# The div class\n\t\t$class = str::getAttrTag(\"class\", $this->elements['header']['class']);\n\n\t\t# If the modal can be dismissed\n\t\tif($this->dismissible !== false){\n\t\t\t$dismiss = <<<EOF\n<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\" title=\"Close this window\"></button>\nEOF;\n\t\t}\n\n\t\treturn <<<EOF\n<div{$id}{$class}{$style}>\n\t<div class=\"container\">\n \t\t<div class=\"row\">\n \t\t<div class=\"col-auto modal-title\">\n \t\t\t{$icon}{$title}{$badge}\n \t\t</div>\n \t\t<div class=\"col\">\n \t\t\t{$buttons}{$button}{$dismiss}\n \t\t</div>\n \t</div>\n\t</div>{$script}\n</div>\nEOF;\n\t}", "function pxlz_edgtf_set_header_object() {\n $header_type = pxlz_edgtf_get_meta_field_intersect('header_type', pxlz_edgtf_get_page_id());\n $header_types_option = pxlz_edgtf_get_header_type_options();\n\n $object = Lib\\HeaderFactory::getInstance()->build($header_type, $header_types_option);\n\n if (Lib\\HeaderFactory::getInstance()->validHeaderObject()) {\n $header_connector = new Lib\\PxlzEdgefHeaderConnector($object);\n $header_connector->connect($object->getConnectConfig());\n }\n }", "private function buildHeader()\n {\n $month_name = $this->monthLabels[$this->month - 1] . ' ' . $this->year;\n $vclass = strtolower($this->view);\n $h = \"<table class='\" . $this->tableClass . \" \" . $vclass . \"'>\";\n $h .= \"<thead>\";\n $h .= \"<tr class='\" . $this->headClass . \"'>\";\n $cs = 5;\n if ($this->view == 'week' || $this->view == 'day') {\n $h .= \"<th>&nbsp;</th>\";\n }\n if ($this->view == 'day') {\n $cs = 1;\n }\n\n if ($this->nav) {\n $h .= \"<th>\";\n $h .= \"<a class='\" . $this->prevClass . \"' href='\" . $this->prevLink() . \"'>\" . $this->prevIco . \"</a>\";\n $h .= \"</th>\";\n $h .= \"<th colspan='$cs'>\";\n $h .= $month_name;\n $h .= \"</th>\";\n $h .= \"<th>\";\n $h .= \"<a class='\" . $this->nextClass . \"' href='\" . $this->nextLink() . \"'>\" . $this->nextIco . \"</a>\";\n $h .= \"</th>\";\n } else {\n $h .= \"<th colspan='7'>\";\n $h .= $month_name;\n $h .= \"</th>\";\n }\n $h .= \"</tr>\";\n $h .= \"</thead>\";\n\n $h .= \"<tbody>\";\n if ($this->view != 'day' && $this->view != 'week') {\n $h .= \"<tr class='\" . $this->labelsClass . \"'>\";\n\n for ($i = 0; $i <= 6; $i++) {\n $h .= \"<td>\";\n $h .= $this->dayLabels[$i];\n $h .= \"</td>\";\n }\n\n $h .= \"</tr>\";\n }\n if ($this->view == 'day' || $this->view == 'week') {\n $h .= self::getWeekDays();\n }\n\n $this->html .= $h;\n }", "function studio_before_header_widget_area() {\n\n\tgenesis_widget_area( 'before-header', array(\n\t 'before' => '<div class=\"before-header\"><div class=\"wrap\">',\n\t 'after'\t => '</div></div>',\n\t) );\n}", "public function full_header() {\n $header = new stdClass();\n $header->settingsmenu = $this->context_header_settings_menu();\n $header->handytoolbar = $this->context_handy_toolbar();\n $header->contextheader = $this->context_header();\n $header->hasnavbar = empty($this->page->layout_options['nonavbar']);\n $header->navbar = $this->navbar();\n $header->pageheadingbutton = $this->page_heading_button();\n $header->courseheader = $this->course_header();\n $template = 'theme_savoir/header';\n if ($this->is_on_frontpage()) {\n $template = 'theme_savoir/header_fp';\n $options = new stdClass();\n $options->noclean = true; // Don't clean Javascripts etc.\n $options->overflowdiv = false;\n $context = context_course::instance($this->page->course->id);\n $summary =\n file_rewrite_pluginfile_urls(\n $this->page->course->summary,\n 'pluginfile.php',\n $context->id,\n 'course',\n 'summary',\n null);\n $content = format_text($summary, $this->page->course->summaryformat, $options);\n if (!isloggedin()) {\n $header->loginurl = get_login_url();\n }\n $header->frontpageslogan = $content;\n $header->frontpagestitle = $this->page->course->shortname;\n $header->alertmessage = format_text(get_config('theme_savoir', 'fpmessage'), FORMAT_HTML);\n $header->alertenabled = get_config('theme_savoir', 'fpmessageenabled');\n } else if ($this->is_on_page_with_description()) {\n $header->pageslogan = get_string(preg_replace('/^theme-savoir-pages-/', '', $this->page->pagetype, 1) . '-description',\n 'theme_savoir');\n $header->bgimageurl = $this->image_url('genericbackground', 'theme_savoir');\n $template = 'theme_savoir/header_desc';\n }\n return $this->render_from_template($template, $header);\n }" ]
[ "0.69501317", "0.6624627", "0.64704645", "0.6257379", "0.611662", "0.600705", "0.598772", "0.598313", "0.5980321", "0.5979505", "0.58945435", "0.58895266", "0.5871452", "0.5825438", "0.58023465", "0.5792442", "0.5769272", "0.57636344", "0.5749514", "0.5722273", "0.57159126", "0.5699507", "0.5688829", "0.56546587", "0.5587937", "0.55856407", "0.55710685", "0.55455065", "0.5543794", "0.5538596" ]
0.8115961
0
Render flash box (success or error message) Render smarty flash box No parameters expected
function smarty_function_flash_box( $params, &$smarty ) { if( $message = flash_get( 'success' ) ) { $type = 'success'; } elseif( $message = flash_get( 'error' ) ) { $type = 'error'; } else { return ''; } // if return '<div id="' . $type . '" class="flash flash-' . $type . '"><span>' . $message . '</span></div>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function renderFlashMessages() {}", "public function renderFlash()\n {\n // get the feedback (they are arrays, to make multiple positive/negative messages possible)\n $feedback_positive = Session::get('feedback_positive');\n $feedback_negative = Session::get('feedback_negative');\n\n // echo out positive messages\n if (isset($feedback_positive)) {\n foreach ($feedback_positive as $feedback) {\n echo '<div class=\"flash success\">'.$feedback.'</div>';\n }\n }\n\n // echo out negative messages\n if (isset($feedback_negative)) {\n foreach ($feedback_negative as $feedback) {\n echo '<div class=\"flash error\">'.$feedback.'</div>';\n }\n }\n\n // delete these messages (as they are not needed anymore and we want to avoid to show them twice\n Session::set('feedback_positive', null);\n Session::set('feedback_negative', null);\n }", "function flash_message()\n\t{\n\t\t$ci =& get_instance();\n\t\t$flashmsg = $ci->session->flashdata('falshmsg');\n\t\t$html = '';\n\t\tif (is_array($flashmsg)){\n\t\t\t$html = '<div id=\"flashmessage\" class=\"'.$flashmsg['type'].'\">\n\t\t\t\t\t<img style=\"float: right; cursor: pointer\" id=\"closemessage\" src=\"'.base_url().'img/close.png\" />\n\t\t\t\t\t\t\t<p>'.$flashmsg['content'].'</p>\n\t\t\t\t\t\t\t\t\t</div>';\n\t\t}\n\t\treturn $html;\n\t}", "protected function renderFlashMessages() {}", "function flashMessage() {\n\t$message = Template::getFlashMessage();\n\tif ( ! empty($message) ) {\n\t\t$messageHtml .= \"<div class='collection'>\";\n\t\t$messageHtml .= \"<a href='#' class='collection-item \" . $message[\"type\"] . \"'>\" . $message[\"body\"] . \"</a>\";\n\t\t$messageHtml .= \"</div>\";\n\n\t\techo $messageHtml;\n\t}\n\treturn NULL;\n}", "function flash_msg(){ ?>\r\n <?php if(isset($_SESSION['success'])): ?>\r\n <p style=\"color: green\"><?= htmlentities($_SESSION['success']) ?></p>\r\n <?php unset($_SESSION['success']); ?>\r\n <?php elseif(isset($_SESSION['failure'])): ?>\r\n <p style=\"color: red\"><?= htmlentities($_SESSION['failure']) ?></p>\r\n <?php unset($_SESSION['failure']); ?>\r\n <?php endif; ?>\r\n<?php }", "public function showFlashMessage()\n {\n \tif (isset($_SESSION['flashMessage'])) {\n \t\techo '<div class=\"alert alert-' . $_SESSION['flashMessage']['type'] . '\" role=\"alert\">';\n \t\techo '<strong>'. $_SESSION['flashMessage']['message'] . '</strong>';\n \t\techo '</div>';\n\n \t\tunset($_SESSION['flashMessage']);\n \t}\n }", "function formSuccess() {\n\n // Template\n $this->r->text['back_url'] = suxFunct::getPreviousURL();\n $this->r->title .= \" | {$this->r->gtext['success']}\";\n\n $this->tpl->display('success.tpl');\n\n }", "public function handleFlashNotifications(){\n\t\tif($this->input->get('form_success') !== false){\n\t\t\t$o = \"\" ;\n\t\t\t$function_name = $this->input->get('form_success') ;\n\t\t\t\n\t\t\t$o .= \"<div id='form-success' class='flash_message pad_all'>\" ; \n\t\t\t\t$o .= \"<p>\" ;\n\t\t\t\t\t$o .= $this->getFlashFunctionSuccessMessage($function_name) ;\n\t\t\t\t$o .= \"</p>\" ;\n\t\t\t$o .= \"</div>\" ;\n\t\t\t\n\t\t\t$o .= \"<script>\" ;\n\t\t\t\t$o .= \"$('.flash_message').fadeOut(7000) ;\" ;\n\t\t\t$o .= \"</script>\" ;\n\t\t\t\n\t\t\treturn $o ;\n\t\t}\n\t\tif($this->input->get('form_error') !== false){\n\t\t\t$o = \"\" ;\n\t\t\t$function_name = $this->input->get('form_error') ;\n\t\t\t\n\t\t\t$o .= \"<div id='form-error' class='flash_message pad_all'>\" ; \n\t\t\t\t$o .= \"<p>\" ;\n\t\t\t\t\t$o .= $this->getFlashFunctionErrorMessage($function_name) ;\n\t\t\t\t$o .= \"</p>\" ;\n\t\t\t$o .= \"</div>\" ;\n\t\t\t\n\t\t\t$o .= \"<script>\" ;\n\t\t\t\t$o .= \"$('.flash_message').fadeOut(7000) ;\" ;\n\t\t\t$o .= \"</script>\" ;\n\t\t\t\n\t\t\treturn $o ;\n\t\t}\n\t}", "function displaySuccessMessage($index,$params = array()) {\n\t\tglobal $lang;\n\t\n\t\treturn '<div class=\"alert alert-success\">'.getLang('form_success_'.$index,$params).'</div>';\n\t}", "static function flashMessage ()\n {\n if (Session::has ('message')) {\n list ($flashType, $message, $title) = explode ('|', Session::get ('message')) + [''] + [''];\n $title = $title ? \"<h4>$title</h4>\" : '';\n return <<<HTML\n<div class=\"alert alert-$flashType\">\n $title$message\n</div>\n</script>\nHTML;\n }\n }", "public function show()\n {\n if (!is_null($_SESSION['flash_message']['type'])) {\n\n $type = $_SESSION['flash_message']['type'];\n\n $message = $_SESSION['flash_message']['message'];\n\n unset($_SESSION['flash_message']); // unset flash_message key\n\n return '<div id=\"flash\" class=\"alert alert-' . $type . '\" role=\"alert\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\">\n <span aria-hidden=\"true\">&times;</span>\n <span class=\"sr-only\">Close</span></button>' . $message . '</div>';\n }\n }", "public function showLogin($error = null) {\n $this -> smarty -> assign('titulo','Iniciar Sesión');\n $this -> smarty -> assign('error', $error); \n //le paso por medio de assign el nombre de la variable (titulo) y el contenido\n $this -> smarty -> display('templates/login.tpl');\n //llamo a la funcion display en el template login\n $this -> smarty -> display('templates/footer.tpl'); \n}", "function flash($name = '', $message = '', $class = 'uk-alert-success')\n{\n //We can only do something if the name isn't empty\n if (!empty($name)) {\n //No message, create it\n if (!empty($message) && empty($_SESSION[$name])) {\n if (!empty($_SESSION[$name])) {\n unset($_SESSION[$name]);\n }\n if (!empty($_SESSION[$name . '_class'])) {\n unset($_SESSION[$name . '_class']);\n }\n\n $_SESSION[$name] = $message;\n $_SESSION[$name . '_class'] = $class;\n }\n //Message exists, display it\n elseif (!empty($_SESSION[$name]) && empty($message)) {\n $class = !empty($_SESSION[$name . '_class']) ? $_SESSION[$name . '_class'] : 'uk-alert-success';\n echo '<div class=\"' . $class . '\" uk-alert> <a class=\"uk-alert-close\" uk-close></a> <p>' . $_SESSION[$name] . '</p></div>';\n unset($_SESSION[$name]);\n unset($_SESSION[$name . '_class']);\n }\n }\n}", "protected function flash()\n\t{\n\t\t$this->session->flash($this->sessionKey, $this->bag->toJson());\n\t}", "function flashMessage()\n{\n if (isset($_SESSION['flash']))\n {\n $flash = $_SESSION['flash'];\n unset($_SESSION['flash']);\n foreach ($flash as $key => $value)\n {\n switch ($key)\n {\n case 'fail':\n echo '<p class=\"flash\" style=\"background:#f9ccca\">';\n break;\n case 'success':\n echo '<p class=\"flash\" style=\"background:#b6e5af\">';\n break;\n default:\n echo '<p class=\"flash\" style=\"background:#f9ccca\">';\n }\n echo $value . '</p>';\n }\n }\n}", "function flash( $name = '', $message = '', $class = 'success fadeout-message', $url = '' )\n{\n if( !empty( $name ) )\n {\n //No message, create it\n if( !empty( $message ) && empty( $_SESSION[$name] ) )\n {\n if( !empty( $_SESSION[$name] ) )\n {\n unset( $_SESSION[$name] );\n }\n if( !empty( $_SESSION[$name.'_class'] ) )\n {\n unset( $_SESSION[$name.'_class'] );\n }\n \n $_SESSION[$name] = $message;\n $_SESSION[$name.'_class'] = $class;\n }\n //Message exists, display it\n elseif( !empty( $_SESSION[$name] ) && empty( $message ) )\n {\n $class = !empty( $_SESSION[$name.'_class'] ) ? $_SESSION[$name.'_class'] : 'success';\n echo '<div class=\"'.$class.'\" id=\"msg-flash\">'.$_SESSION[$name].'</div>';\n unset($_SESSION[$name]);\n unset($_SESSION[$name.'_class']);\n }\n }\n\tif( !empty( $url ) || $url != '' )\n {\n\t\theader('Location: '.$url);\n\t\texit();\n\t}\n}", "function flashMessage() {\n if (isset($_SESSION['add'])){\n echo('<p style=\"color: red;\">'.htmlentities($_SESSION['add']).\"</p>\");\n unset($_SESSION['add']);\n }\n if (isset($_SESSION['success'])) {\n echo('<p style=\"color: green;\">'.htmlentities($_SESSION['success']).\"</p>\\n\");\n unset($_SESSION['success']);\n }\n if (isset($_SESSION['error'])) {\n echo('<p style=\"color:red;\">'.htmlentities($_SESSION['error']).\"</p>\\n\");\n unset($_SESSION['error']);\n }\n}", "function flash( $name = '', $message = '', $class = 'success fadeout-message' )\n{\n //We can only do something if the name isn't empty\n if( !empty( $name ) )\n {\n //No message, create it\n if( !empty( $message ) && empty( $_SESSION[$name]))\n {\n if( !empty( $_SESSION[$name] ) )\n {\n unset( $_SESSION[$name] );\n }\n if( !empty( $_SESSION[$name.'_class'] ) )\n {\n unset( $_SESSION[$name.'_class'] );\n }\n\n $_SESSION[$name] = $message;\n $_SESSION[$name.'_class'] = $class;\n }\n //Message exists, display it\n elseif( !empty( $_SESSION[$name] ) && empty( $message ))\n {\n $class = !empty( $_SESSION[$name.'_class'] ) ? $_SESSION[$name.'_class'] : 'success';\n echo '<div id =\"message\" class=\"alert alert-'.$class.' alert-dismissible fade show\" role=\"alert\">'\n .$_SESSION[$name]\n .'<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>';\n unset($_SESSION[$name]);\n unset($_SESSION[$name.'_class']);\n }\n }\n}", "function get_flash($type)\n{\n $ci = &get_instance();\n $message = $ci->session->flashdata($type);\n\n if ($message) {\n return htmlentities($message);\n }\n\n return '';\n}", "public function showSignIn($error = null){\n \n //creo una instancia de la clase smarty\n $this -> smarty -> assign('titulo','Iniciar Sesión');\n $this -> smarty -> assign('error', $error); \n //le paso por medio de assign el nombre de la variable (titulo) y el contenido\n $this -> smarty -> display('templates/signIn.tpl');\n //llamo a la funcion display en el template login\n $this -> smarty -> display('templates/footer.tpl');\n}", "public static function flash($flash = null, $status = 'info') {\n\t\tif (isset($_SESSION['sq-form-flash'])) {\n\t\t\t$flash = $_SESSION['sq-form-flash'];\n\t\t\tunset($_SESSION['sq-form-flash']);\n\t\t}\n\n\t\tif (isset($_SESSION['sq-form-status'])) {\n\t\t\t$status = $_SESSION['sq-form-status'];\n\t\t\tunset($_SESSION['sq-form-status']);\n\t\t}\n\n\t\tif ($flash) {\n\t\t\treturn sq::view('forms/flash', [\n\t\t\t\t'status' => $status,\n\t\t\t\t'flash' => $flash\n\t\t\t]);\n\t\t}\n\t}", "protected function addFlashMessages() {}", "function flashmessage(){\n if ( isset($_SESSION['error'])){\n echo \"<p style='color:red'>\".$_SESSION['error'].\"</p>\";\n unset($_SESSION['error']);\n }\n if (isset($_SESSION['success'])){\n echo \"<p style='color:green'>\".$_SESSION['success'].\"</p>\";\n unset($_SESSION['success']);\n }\n}", "function flash()\n{\n return get_view()->flash();\n}", "function flashmessage(){\n if ( isset($_SESSION['success']) ) {\n // Look closely at the use of single and double quotes\n echo('<p style=\"color: green;\">'.htmlentities($_SESSION['success']).\"</p>\\n\");\n unset($_SESSION['success']);\n }\n if ( isset($_SESSION['error']) ) {\n // Look closely at the use of single and double quotes\n echo('<p style=\"color: red;\">'.htmlentities($_SESSION['error']).\"</p>\\n\");\n unset($_SESSION['error']);\n }\n}", "function flash( $name = '', $message = '', $class = 'success fadeout-message' )\n{\n if( !empty( $name ) )\n {\n //No message, create it\n if( !empty( $message ) && empty( $_SESSION[$name] ) )\n {\n if( !empty( $_SESSION[$name] ) )\n {\n unset( $_SESSION[$name] );\n }\n if( !empty( $_SESSION[$name.'_class'] ) )\n {\n unset( $_SESSION[$name.'_class'] );\n }\n \n $_SESSION[$name] = $message;\n $_SESSION[$name.'_class'] = $class;\n }\n //Message exists, display it\n elseif( !empty( $_SESSION[$name] ) && empty( $message ) )\n {\n $class = !empty( $_SESSION[$name.'_class'] ) ? $_SESSION[$name.'_class'] : 'success';\n echo '<div class=\"'.$class.'\" id=\"msg-flash\">'.$_SESSION[$name].'</div>';\n unset($_SESSION[$name]);\n unset($_SESSION[$name.'_class']);\n }\n }\n}", "function flash($name = '', $message = '', $class = 'alert alert-success')\n{\n // Check that a name is passed in \n // We are storimg the session $name as the KEY\n if (!empty($name)) {\n if (!empty($message) && empty($_SESSION[$name])) {\n if (!empty($_SESSION[$name])) {\n unset($_SESSION[$name]);\n }\n\n if (!empty($_SESSION[$name . '_class'])) {\n unset($_SESSION[$name . '_class']);\n }\n\n // And we are storing the $message as the VALUE\n $_SESSION[$name] = $message;\n\n // setting the class inside of the session variable\n $_SESSION[$name . '_class'] = $class;\n } elseif (empty($message) && !empty($_SESSION[$name])) {\n $class = !empty($_SESSION[$name . '_class']) ? $_SESSION[$name . '_class'] : '';\n // display it here, the div with the class\n echo '<div class=\"' . $class . '\" id=\"msg-flash\">' . $_SESSION[$name] . '</div>';\n // unsetting it\n unset($_SESSION[$name]);\n unset($_SESSION[$name . '_class']);\n }\n }\n}", "function printFlashMessage() {\n if (!isset($_SESSION['flashMessage'])) {\n return;\n }\n\n echo '<div class=\"alert alert-success mb-4\" id=\"FlashMessage\">'.$_SESSION['flashMessage']\n .'<button type=\"button\" class=\"close\" onclick=\"location.reload(true); return false;\">'\n .'<span aria-hidden=\"true\">&times;</span>'\n .'</button>'\n .'</div>';\n $_SESSION['flashMessage'] = null;\n}", "public function actionSuccess()\n {\n return $this->render('success');\n }" ]
[ "0.72069967", "0.7164869", "0.7150055", "0.7118421", "0.69741654", "0.68779474", "0.684934", "0.67434967", "0.67325103", "0.67284054", "0.66904515", "0.66701514", "0.65090513", "0.65033543", "0.6500036", "0.6497987", "0.648419", "0.64635813", "0.6458883", "0.64480376", "0.6432631", "0.6410626", "0.63739944", "0.63679796", "0.63671136", "0.6354456", "0.63252723", "0.6317656", "0.6290194", "0.62851703" ]
0.84708256
0
Example of how to send an HTTP 500 response. If mail alerts are enabled in the config.ini, email is sent.
public function send500Action() { throw new ZFDemo_Exception_Reroute(_('Example action to test sending a HTTP 500 response'), 500); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function internalServerError($error)\n{\n header('HTTP/1.1 500 Internal Server Error');\n $emailIds = array(\"rahul_lahoria@yahoo.com\", \"pwnpnwr785@gmail.com\", \"vikas.niper2012@gmail.com\", \"kumar.anil8892@yahoo.com\");\n foreach ($emailIds as $to)\n sendMail($to, \"Alert! error occurred in apis\", $error);\n}", "public static function error500()\n {\n // Set 500 HTTP status code\n Http::setHeadersByCode(500);\n\n // Prevent caching in the browser\n (new Browser)->noCache();\n\n // Inclusion of the HTML Internal Server Error page\n include PH7_PATH_SYS . 'global/views/' . PH7_DEFAULT_THEME . '/error/500.html.php';\n\n // Stop script\n exit;\n }", "function go500($msg = '') {\n\terror_log( '500: ' . $msg );\n\tstatus_header( 500 );\n\techo $msg;\n\texit;\n}", "public function error500(){\n\t\theader('HTTP/1.0 500 Internal Server Error');\n\t\tdie('500 internal server error');\n\t}", "function error500($html = \"\")\n{\n header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error');\n exit();\n}", "public function action_500()\n\t{\n\t\t$this->template->title = '500 Server Error';\n\t\t$this->template->header_title = site_title($this->template->title);\n\t\t$this->template->content = View::forge('error/500');\n\t\t$this->response->status = 500;\n\t}", "function my_error($msg) {\n\theader('HTTP/1.1 500 Internal Server Error');\n\ttrigger_error($msg,E_USER_ERROR);\n}", "function ReturnServerError()\n{\n header('HTTP/1.1 500 Internal Server Error');\n die(\"A server error occured while saving your request.\\r\\nPlease check our API status page at http://status.prybar.io and try again later\");\n}", "function error($msg)\n{\n header('HTTP/1.1 500 ' . $msg);\n die($msg);\n}", "public function action_500() {\n $this->template->content = View :: factory('error/500');\n }", "protected function error500()\n {\n return 'Server error: `POST /` '.\n 'resulted in a `500 Internal Server Error` response';\n }", "public function render500Error() {\n echo \"<h1>500</h1><p>Internal Server Error</p>\n <a href='?'>Go back to start</a>\";\n }", "function errorResponse ($messsage) {\n header('HTTP/1.1 500 Internal Server Error');\n die(json_encode(array('message' => $messsage)));\n }", "function exception_error_handler() {\n header('HTTP/1.1 500 Internal Server Error');\n if(is_file(__DIR__.'/../html/500.html'))\n {\n require(__DIR__.'/../html/404.html');\n } else {\n ?>\n <h1>Something goofed really hard</h1>\n <p>We're working on it, sit tight</p>\n <?php\n }\n // I'll just leave this here for debug purposes.\n //throw new ErrorException($errstr, $errno, 0, $errfile, $errline);\n}", "function internalServerError()\n{\n error500('<h1>500 Internal Server Error</h1>An internal server error has occured.');\n}", "public static function sendException($exception)\r\n {\r\n $emails = Config::inst()->get(self::class, 'Emails');\r\n if ($emails) {\r\n $emails = explode(\",\", $emails);\r\n $email = new Email();\r\n $email\r\n ->setTo($emails)\r\n ->setSubject('SilverStripe Hail module fetch error on ' . SiteConfig::current_site_config()->getTitle() . ' (' . gethostname() . ')')\r\n ->setBody(\"<p>Hi,</p><p>An error occurred while fetching from the Hail API: </p> <p>{$exception->getMessage()}</p><p>Website name: \" . SiteConfig::current_site_config()->getTitle() . \"</p><p>Website Folder: \" . Director::baseFolder() . \"</p><p>Server hostname: \" . gethostname() . \"</p>\");\r\n $email->send();\r\n }\r\n }", "function mailreport()\n{\n\tglobal $g_error_msg, $g_debug_msg;\n\tinclude_once(atkconfig('atkroot'). 'atk/errors/class.atkerrorhandlerbase.inc');\n\t$errorHandlerObject = atkErrorHandlerBase::get('mail', array('mailto'=>atkconfig('mailreport')));\n\t$errorHandlerObject->handle($g_error_msg, $g_debug_msg);\n}", "function errore($messaggio) {\n header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);\n die($messaggio);\n}", "function send_email()\r\n{\r\n global $REQUEST_URI, $HTTP_REFERER, $REMOTE_ADDR;\r\n\r\n $reportlevel = pnConfigGetVar('reportlevel');\r\n $adminmail = pnConfigGetVar('adminmail');\r\n $notify_from = pnConfigGetVar('notify_from');\r\n \r\n $errortime = date(\"m/j/Y at g:i a\" );\r\n $message .= \"\"._ERR404.\"\\n\\n\"._ERRMAIL404.\" $REMOTE_ADDR\";\r\n $message .= \"\"._ERRMAILON.\" $errortime.\\n\\n\";\r\n $message .= \"\"._ERRMAILURI.\" \\n\" . pnGetBaseURL(). \"$REQUEST_URI\\n\\n\";\r\n $message .= \"\"._ERRMAILREF.\"\\n$HTTP_REFERER\\n\\n\";\r\n\r\n # Send the mail message. This assumes mail() will work on your system!\r\n// 11-09-01 eugeniobaldi not compliant with PHP < 4.0.5\r\n// pnMail($adminmail, _ERR404REP, $message, \"From: $notify_from\");\r\n pnMail($adminmail, _ERR404REP, $message);\r\n}", "function internalServerError() {\n header('HTTP/1.0 500 Internal Server Error');\n }", "public function RenderError500PlainText ($text = '');", "static function send_request_response($email,$status,$created_at){\n $message = \"<p>Dear employee, <br> Your supervisor has {$status} your application submitted on {$created_at}.</p>\";\n $headers = 'From: employee_portal@example.com' . \"\\r\\n\" .\n 'Reply-To: employee_portal@example.com' . \"\\r\\n\" .\n 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\" .\n 'X-Mailer: PHP/' . phpversion();\n \n \t$success = mail($email,\"Your request has been {$status}\", $message, $headers);\n if (!$success) {\n echo $errorMessage = error_get_last()['message'];\n }\n }", "private function sendEmail()\n {\n try {\n \\Illuminate\\Support\\Facades\\Mail::to(config('redis-driver-fallback.email_config.to', config('mail.username')))\n ->send(new AlertEmail())\n ->subject('Redis Cache Driver fails');\n } catch (\\Exception $e) {\n Log::debug(__METHOD__, ['ERROR' => $e]);\n throw $e;\n }\n }", "public function error500($pesan)\n {\n $this->whenError();\n $viewData['status'] = 500;\n $viewData['title'] = 'Server Error';\n $viewData['msg'] = $pesan;\n\n $this->pageError($viewData);\n }", "private function sendNotifyException($exception)\n {\n $adminEmail = Main\\Config\\Option::get('main', 'email_from');\n\n if (empty($adminEmail)) {\n return;\n }\n\n $request = Main\\Context::getCurrent()->getRequest();\n\n $protocol = $request->isHttps() ? 'https://' : 'http://';\n\n \\bxmail(\n $adminEmail,\n Loc::getMessage(\n 'FF_COMPONENT_EXCEPTION_EMAIL_SUBJECT',\n [\"#SITE_URL#\" => SITE_SERVER_NAME]\n ),\n Loc::getMessage(\n 'FF_COMPONENT_EXCEPTION_EMAIL_TEXT',\n [\n \"#URL#\" => $protocol . SITE_SERVER_NAME . $request->getRequestedPage(),\n \"#DATE#\" => date('Y-m-d H:m:s'),\n \"#EXCEPTION_MESSAGE#\" => $exception->getMessage(),\n \"#EXCEPTION#\" => $exception\n ]\n ),\n 'Content-Type: text/html; charset=utf-8'\n );\n }", "public function failed()\n {\n echo \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\";\n $mail = 'Mail body';\n Mail::raw($mail, function ($message) {\n $message->to('foo@example.com', 'John Smith')->subject('Crawl discontinued: ');\n });\n }", "function getHTTPCode() {\n\n return 500;\n\n }", "public static function exception_handler($exception) { \n ResponseFactory::send($exception->getMessage()); //Send exception message as response.\n }", "public static function sendError($status_code,$message=null) {\n\t\thttp_response_code($status_code);\n\t\techo $message;\n\t}", "public static function error500($text = '', $logMessage = '') {\n header(\"{$_SERVER['SERVER_PROTOCOL']} 500 Internal Server Error\");\n View::render(static::VIEW_ERROR_HTTP, [\n 'code' => 500,\n 'msg' => $text ? $text : 'Internal server error.',\n ], static::LAYOUT_ERROR_HTTP, false, App::requestIsAjax());\n\n if($logMessage) {\n error_log($logMessage);\n }\n\n static::end(50);\n }" ]
[ "0.72864425", "0.71010566", "0.6995637", "0.6953725", "0.6895583", "0.6764839", "0.65184075", "0.64316213", "0.64159656", "0.6383572", "0.63785", "0.6334098", "0.6230074", "0.62020946", "0.6163585", "0.61592144", "0.61590904", "0.6125583", "0.6125116", "0.6122727", "0.6116837", "0.6106271", "0.6010782", "0.59764373", "0.59642506", "0.5905744", "0.585054", "0.58448017", "0.5804205", "0.58026433" ]
0.7305898
0
/ $data['activity_type'] = $this > _getParam('activity_type'); $data['event_object'] = $this> _getParam('event'); $data['facebook_user_id'] = $this>_getParam('id'); $data['facebook_user_name'] = $this>_getParam('owner_name'); $data['fanpage_id'] = $this>_getParam('fanpage_id'); $data['target_user_id'] = $this>_getParam('target_id'); $data['target_user_name'] = $this>_getParam('target_name'); $data['message'] = $this>_getParam('message');
protected function addactivity($activity_type, $event_object, $fanpage_id, $target_user_id, $target_name, $message ){ $data['activity_type'] = $activity_type; $data['event_object'] = $event_object; $data['facebook_user_id'] = $this->_user->facebook_user_id; $data['facebook_user_name'] = $this->_user->facebook_user_name; $data['fanpage_id'] = $fanpage_id; $data['target_user_id'] = $target_user_id; $data['target_user_name'] = $target_name; $data['message'] = $message; $act = new Model_FancrankActivities(); $post = new Model_Posts(); /* if ($data['activity_type'] == "like-status" || $data['activity_type'] == "like-photo" || $data['activity_type'] == "like-video" || $data['activity_type'] == "like-link"){ $post->addLikeToPost($data['event_object']); }else if ($data['activity_type'] == "unlike-status" || $data['activity_type'] == "unlike-photo" || $data['activity_type'] == "unlike-video" || $data['activity_type'] == "unlike-link"){ $post->subtractLikeToPost($data['event_object']); }else if ($data['activity_type'] == "comment-status" || $data['activity_type'] == "comment-photo" || $data['activity_type'] == "comment-video" || $data['activity_type'] == "comment-link"){ $post->addCommentToPost($data['event_object']); } */ $act -> addActivities($data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function initializeFacebookEvent()\n {\n $this->trackingName = $this->ifVariableSet($this->parameters['tracking'],null);\n $this->numberGiftEarned = $this->ifVariableSet($this->parameters['numberGiftEarned'],0);\n $this->numberGiftSent = $this->ifVariableSet($this->parameters['numberGiftSent'],0);\n $this->numberGiftReceived = $this->ifVariableSet($this->parameters['numberGiftReceived'],0);\n $this->fbAccessToken = $this->ifVariableSet($this->userProfile['fbAccessToken'],0);\n $this->casinoUserId = $this->ifVariableSet($this->userProfile['casinoUserId'],0);\n $this->FBUserId = $this->ifVariableSet($this->userProfile['FBUserId'],0);\n $this->customEventsFields = array(\n '_appVersion' => urlencode('DIGIPRESENCE'),\n 'casinoUserId' => urlencode($this->casinoUserId),\n 'FBUserId' => urlencode($this->FBUserId),\n 'numberGiftSent' => urlencode($this->numberGiftSent),\n 'numberGiftReceived' => urlencode($this->numberGiftReceived),\n 'numberGiftEarned' => urlencode($this->numberGiftEarned),\n '_eventName' => urlencode($this->trackingName)\n );\n }", "public function indexAction()\n {\n\t\t$fb = new stdClass();\n\t\t$bootstrap = $this->getInvokeArg('bootstrap');\n\t\t$aConfig = $bootstrap->getOptions();\n\t\t$fb->_app_id = $aConfig['my']['facebook']['app_id'];\n\t\t$fb->_api_key = $aConfig['my']['facebook']['api_key'];\n\t\t$fb->_secret = $aConfig['my']['facebook']['secret'];\n\t\t///////////////////////////////////////////////////////////////\n\t\t\t\t\n\t\tfunction parse_signed_request($signed_request, $secret) {\n\t\t\tlist($encoded_sig, $payload) = explode('.', $signed_request, 2); \n\t\t\t\n\t\t\t// decode the data\n\t\t\t$sig = base64_url_decode($encoded_sig);\n\t\t\t$data = json_decode(base64_url_decode($payload), true);\n\t\t\t\n\t\t\tif (strtoupper($data['algorithm']) !== 'HMAC-SHA256') {\n\t\t\t\terror_log('Unknown algorithm. Expected HMAC-SHA256');\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\t// check sig\n\t\t\t$expected_sig = hash_hmac('sha256', $payload, $secret, $raw = true);\n\t\t\tif ($sig !== $expected_sig) {\n\t\t\t\terror_log('Bad Signed JSON signature!');\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\treturn $data;\n\t\t}\n\t\t\n\t\tfunction base64_url_decode($input) {\n\t\t\treturn base64_decode(strtr($input, '-_', '+/'));\n\t\t}\n\t\t\n\t\tif ($_REQUEST) {\n\t\t\t//INSTANTIATE NEW OBJECTS\n\t\t\t$pssFacebook = new Zend_Db_Table('facebook');\n\t\t\t$pssUser = new Zend_Db_Table('users');\n\t\t\t$flag = NULL;\n\t\t\t//MAKE RESPONSE OBJECT\n\t\t\t$response = parse_signed_request($_REQUEST['signed_request'], $fb->_secret);\n\t\t\t/*\n\t\t\t$select = $pssUser->select()->where('email = ?', $response['registration']['email']);\n\t\t\t$pssUserRow = $pssUser->fetchRow($select);\n\t\t\tif($pssUserRow)\n\t\t\t{\n\t\t\t\t$flag = 'pre-existing user';\n\t\t\t}\n\t\t\t$select = $pssFacebook->select()->where('email = ?', $response['registration']['email']);\n\t\t\t$pssFBRow = $pssFacebook->fetchRow($select);\n\t\t\t*/\n\t\t\t$auth = Zend_Auth::getInstance();\n\t\t\tif($auth->hasIdentity())\n\t\t\t{\n\t\t\t\t$identity = $auth->getIdentity();\n\t\t\t\t$data = array();\n\t\t\t\t$data['user_id'] = $identity->id;\n\t\t\t\t$data['oauth_token'] = $response['oauth_token']; $data['fb_id'] = $response['user_id'];\n\t\t\t\t$data['name'] = $response['registration']['name']; $data['email'] = $response['registration']['email']; $data['password'] = md5($response['registration']['password']);\n\t\t\t\t$data['last_updated'] = date(\"Y-m-d H:i:s\", time());\n\t\t\t\t$pssFacebook->insert($data);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$select = $pssUser->select()->where('email = ?', $response['registration']['email']);\n\t\t\t\t$pssUserRow = $pssUser->fetchRow($select);\n\t\t\t\tif($pssUserRow)\n\t\t\t\t{\n\t\t\t\t\t$flag = 'pre-existing user';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$select = $pssFacebook->select()->where('email = ?', $response['registration']['email']);\n\t\t\t\t\t$pssFBRow = $pssFacebook->fetchRow($select);\n\t\t\t\t\tif($pssFBRow)\n\t\t\t\t\t{\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$array = explode('/', $response['registration']['birthday']);\n\t\t\t\t\t\t$birthday = $array[2] . '-' . $array[0] . '-' . $array[1];\n\t\t\t\t\t\t$data = array();\n\t\t\t\t\t\t$data['email'] = $response['registration']['email']; $data['name'] = $response['registration']['name'];\n\t\t\t\t\t\t$data['birthday'] = $birthday;\n\t\t\t\t\t\t$data['password'] = md5($response['registration']['password']);\n\t\t\t\t\t\t$data['last_updated'] = date(\"Y-m-d H:i:s\", time());\n\t\t\t\t\t\t$pssUser->insert($data);\n\t\t\t\t\t\t$select = $pssUser->select()->where('email = ?', $response['registration']['email']);\n\t\t\t\t\t\t$pssUserRow = $pssUser->fetchRow($select);\n\t\t\t\t\t\t$data = array();\n\t\t\t\t\t\t$data['oauth_token'] = $response['oauth_token']; $data['user_id'] = $pssUserRow->id; $data['fb_id'] = $response['user_id'];\n\t\t\t\t\t\t$data['name'] = $response['registration']['name']; $data['email'] = $response['registration']['email']; $data['password'] = md5($response['registration']['password']);\n\t\t\t\t\t\t$data['last_updated'] = date(\"Y-m-d H:i:s\", time());\n\t\t\t\t\t\t$pssFacebook->insert($data);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_redirect('/default/index/index');\n\t\t /*\n\t\t echo '<pre>';\n\t\t print_r($response);\n\t\t echo '</pre>';\n\t\t */\n\t\t \n\t\t} else {\n\t\t echo '$_REQUEST is empty';\n\t\t}\n }", "function getFromPost() {\r\n\t\t\r\n\t\t//Event Page variables.\r\n\t\t$this->name = $_POST['eventName'];\r\n\t\t$this->date = $_POST['eventDate'];\r\n\t\t$this->time = $_POST['eventTime'];\r\n\t\t$this->time_before = $_POST['time_before'];\r\n\t\t$this->freq = $_POST['frequency'];\r\n\t\t$this->notif_method = $_POST['method'];\r\n\t}", "public function activityExtraData();", "private function userliveevents($postDataArr){\n $access_token = isset($postDataArr['access_token']) ? filter_var($postDataArr['access_token'], FILTER_SANITIZE_STRING) : '';\n $device_type = isset($postDataArr['device_type']) ? filter_var($postDataArr['device_type'], FILTER_SANITIZE_NUMBER_INT) : '';\n $user_id = isset($postDataArr['user_id']) ? filter_var($postDataArr['user_id'], FILTER_SANITIZE_STRING) : '';\n $user_location = isset($postDataArr['user_location']) ? filter_var_array($postDataArr['user_location'],FILTER_VALIDATE_FLOAT) : '';\n if(!empty($access_token)){\n if(!empty($device_type) && $device_type!= 1 && $device_type!= 2){ //1 = ANDROID 2 = IOS\n //INVALID DEVICE TYPE ERROR\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('INVALID_ACCESS');\n $this->response($errorMsgArr);\n }\n //VALIDATE ACCESS\n $valid = $this->Api_model->validateAccess($access_token);\n if(isset($valid['STATUS']) && !$valid['STATUS']){\n //ACCESS TOKEN INVALID\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $valid['MESSAGE'];\n $this->response($errorMsgArr);\n }\n //VALIDATE LOCATION\n //Validate User location\n $validLoc = $this->Api_model->validateLatLong(implode(',', $user_location));\n //If not valid, return\n if(isset($validLoc['STATUS']) && !$validLoc['STATUS']){\n //throw error as same event exists\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_PARAM;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $validLoc['MESSAGE'];\n $this->response($errorMsgArr);\n }\n $conditions = array(\n 'where' => array(\n 'evt_status' => '1',\n 'evt_end >' => time(),\n 'e.userid' => $user_id\n ),\n );\n \n //FETCH LISTING\n $listing = $this->Api_model->eventInfo($conditions,$user_location,$valid['VALUE']['user_id']);\n $listing = $this->Algo_model->shuffleEventListing(1,$listing,$valid['VALUE']['user_id']);\n \n //SUCCESS\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = SUCCESS_CODE;\n $errorMsgArr['STATUS'] = TRUE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['VALUE'] = $listing;\n $this->response($errorMsgArr);\n }else{\n //ACCESS TOKEN MISSING ERROR\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('ACCESSTOKEN_MISSING');\n $this->response($errorMsgArr);\n }\n \t}", "function user_baggage_transfer()\n\t{ \n\t\trequire_once(\"config.php\");\n $input = @file_get_contents(\"php://input\");\n\t //$event_json = json_decode($input,true);\n\t\t$event_json = json_decode($input,true);\n\n\t \tif(!isset($event_json['fb_id']) || $event_json['fb_id']==\"\") \n\t\t\t{ \n\t\t\t\t$msg_out=\"Validation Error fb_id Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\tif(!isset($event_json['gift_id']) || $event_json['gift_id']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error gift_id Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\tif(!isset($event_json['gift_qty']) || $event_json['gift_qty']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error gift_qty Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\tif(!isset($event_json['send_to_fb_id']) || $event_json['send_to_fb_id']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error send_to_fb_id Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\tif(!isset($event_json['ub_type_id']) || $event_json['ub_type_id']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error ub_type_id Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\t\n\t\t\tif(!isset($event_json['ub_type']) || $event_json['ub_type']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error ub_type Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\t\n\t\t\t$gift=get_gift($event_json['gift_id'] );\n\t\t \tif($gift){\n\t\t \t\t//$value['ubh_gift_icon']=$gift['gift_icon'];\t\n\t\t \t\t//$value['ubh_gift_animation_icon']=$gift['gift_animation_icon'];\t\n\t\t \t}\n\t\t\telse{\n\t\t\t\t$msg_out=\"Gift Missing In Our record\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\n\t\t\t$ubh_sender_fb_id=$event_json['fb_id'];\n\t\t\t$ubh_fb_id=$event_json['send_to_fb_id'];\n\t\t\t$gift_qty=$event_json['gift_qty'];\n\t\t\t$ubh_type_id=$event_json['ub_type_id'];\n\t $ubh_type=$event_json['ub_type'];\n\t \t\n\t \t\n\t \t\n\t\t\t$giftid=$ubh_gift_id=$gift['gift_id'];\n\t\t $ubh_gift_title=$gift['gift_title'];\n\t\t\t$ubh_gift_coin_type=$gift['gift_coin_type'];\n\t\t\t\n\t\t\tif($ubh_gift_coin_type==\"Silver\"){\n\t\t\t\n\n\t\t\t\t$sender_remain_total_slivercoin_data=get_user_silvercoin_byfb_id($ubh_sender_fb_id);\n\t\t\t$ubh_gift_coin =$gift['gift_diamond'];\n\t if($sender_remain_total_slivercoin_data < $ubh_gift_coin) \n\t\t\t{\n\t\t\t\t$msg_out=\"You have not sufficient Sliver Coin In Your wallet\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\t\t\n \n\t\t\t$ubh_gift_total_coin =$gift_qty*$ubh_gift_coin;\n\t\t\t}\n\n\n\t\t\n\t //check baggar gift \n\t\t\tif($ubh_gift_coin_type==\"Diamond\"){\n\t\t\t\t\n $qrry_get_ub_gift=\" SELECT *,(SELECT sum(ub_gift_remain_qty) as total_gift FROM `user_baggage` where ub_fb_id=$ubh_sender_fb_id and ub_gift_id =$giftid) as total_gift FROM `user_baggage` where ub_fb_id=$ubh_sender_fb_id and ub_gift_id =$giftid and ub_gift_remain_qty!=0 \";\n\t\t\t\t\t\t $user_baggage_res=mysqli_query($conn,$qrry_get_ub_gift);\n \t\t \t \t\t $user_baggage_data=mysqli_fetch_assoc($user_baggage_res); \n\t\t \t \tif($user_baggage_data){\n\t\t\t\t \t \tif($user_baggage_data['total_gift']!=0){\n\t\t\t\t \t \n\t\t\t\t \t \t\t\n\t\t\t\t \t \t\tif($user_baggage_data['total_gift'] < $gift_qty) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$msg_out=\"You have not sufficient gift quntity in baggage \";\n\t\t\t\t\t\t\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\t\t\t\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\t\t\t\t\t\t\texit();\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t//ub_last_up_date\t\t\t\t\n\t\t\t\t\t\t\t\t\t$ub_id=$user_baggage_data['ub_id'];\n\t\t\t\t\t\t\t\t\t$UPDATE_user_bag=\"update user_baggage set ub_gift_remain_qty=ub_gift_remain_qty-\".$gift_qty.\" WHERE ub_fb_id='\".$ubh_sender_fb_id.\"' and ub_id=$ub_id\";\n\t\t\t\t\t\t\t\t\t$res=mysqli_query($conn,$UPDATE_user_bag);\n \n\t\t\t\t\t\t\t\t\t//echo \" ok here\";\n\t\t\t\t\t\t\t\t\t//die;\n\t\t\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t \n\t\t\t\t \t \t}else{ \n\t\t\t\t \t \t\techo 'come hrer'; \n\t\t\t\t \t \t\tdie;\n\t\t\t\t \t \t}\t\n\n\t\t \t \t}else{\n\t\t \t \t//e\n\t \t \t$msg_out=\"This gift not in your baggage\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\t\t\t\n\t\t \t \t}\n\t\t \t \t\t\n\t\t\t\t$ubh_gift_coin =$gift['gift_diamond'];\n\t \t$ubh_gift_total_coin =0;\n\t\t \t \t\n\t\t\t}\n\t\n\n\n\t $DATE_TIME=custom_current_date_time();\n\t $qrry_get='INSERT INTO `user_baggage_history1`( `ubh_fb_id`, `ubh_gift_id`, `ubh_gift_title`, `ubh_gift_diamond`, `ubh_gift_qty`, `ubh_gift_total_diamond`, `ubh_sender_fb_id`, `ubh_cr_date`,`ubh_type_id`,`ubh_type`) VALUES (\"'.$ubh_fb_id.'\",\"'.$ubh_gift_id.'\",\"'.$ubh_gift_title.'\",\"'.$ubh_gift_coin.'\",\"'.$gift_qty.'\",\"'.$ubh_gift_total_coin.'\",\"'.$ubh_sender_fb_id.'\",\"'.$DATE_TIME.'\",\"'.$ubh_type_id.'\",\"'.$ubh_type.'\")';\n\t\t\t \n\t\t\t $res=mysqli_query($conn,$qrry_get)or die(mysqli_error($conn));\n \t\t \t$last_insertid = mysqli_insert_id($conn);\n\t\t\tif($last_insertid){\n\t\t\t\n \t\t \t $msg_out=\"Send Gift To User Baggage Successfully\";\t\n\t\t\t\n\t\t\tif($ubh_gift_coin_type==\"Silver\"){\n\t\t\t\t$d=UPDATE_remove_silvercoin_user($ubh_sender_fb_id , $ubh_gift_total_coin);\n\t\t\t} \n\t\t\t $sender_remain_total_slivercoin_data=get_user_silvercoin_byfb_id($ubh_sender_fb_id);\n\t\t\n\t\t\t\t$output=array( \"code\" => \"200\", \"msg\" => $msg_out ,\"data\" => $res , \"sender_remain_slivercoin\" =>$sender_remain_total_slivercoin_data );\n\t\t\t}else{\n\n\t\t\t\t$msg_out=\"Error In Send Gift To Baggage\";\n\t\t\t $output=array( \"code\" => \"500\", \"msg\" => $msg_out );\n\t\t\t}\n\t\t\tprint_r(json_encode($output, true));\n }", "function getActivity()\n\t\t{\n\t\t\t$userID = $_POST[\"userID\"];\n\t\t\t$title = \"userPost\";\n\t\t\t$description = $_POST[\"description\"];\n\t\t\t$link = \"\";\n\t\t\t\n\t\t\techo $this->postActivity($userID, $title, $description, $link);\n\t\t}", "public function authenticate($access_token_val='')\r\n { \r\n /**********make the access token Extended by extend_access_token() and get extended token********/\r\n $extended_access_token_val = $this->extend_access_token($access_token_val);\r\n if($extended_access_token_val==''){\r\n $access_token_val = $extended_access_token_val;\r\n } \r\n\r\n \r\n /***running FQL to fetch data from facebook ****/\r\n // $fql = urlencode(\"SELECT post_id,viewer_id,source_id,updated_time,created_time,actor_id,message,attachment,permalink ,type FROM stream WHERE source_id = me() AND actor_id = me() order by created_time desc LIMIT 5\");\r\n $fql = urlencode(\"SELECT uid,about_me, birthday, current_location, first_name, has_added_app, hometown_location, last_name, locale, birthday_date, pic, pic_with_logo, pic_big, pic_big_with_logo, pic_small, pic_small_with_logo, pic_square, pic_square_with_logo, profile_url, proxied_email, email, contact_email, sex, meeting_sex, status, timezone, website, education_history, work_history, work, education, hs_info, religion, relationship_status, political, activities, interests, family, music, tv, movies, books, username, quotes, sports, favorite_teams, favorite_athletes, inspirational_people, languages FROM user WHERE uid = me()\");\r\n $content = $this->process_fql($fql,$access_token_val);\r\n \r\n //pr($content['data'][0],1);\r\n \r\n $user_meta = $this->session->userdata('current_user_session'); // get current user data loggedin\r\n\t\t\r\n\t\t/*pr($content['data'][0]);\r\n\t\tpr($content,1);\r\n\t\texit;*/\r\n \r\n if(isset($content->error))\r\n echo 'A user of access token '.$access_token_val. ' got following error while fetching user details'.$temp_ret_graph;\r\n else\r\n { \r\n\t\t\t\tif(empty($user_meta)) { \r\n\t\t\t\t\t\r\n\t\t\t\t if($this->login_by_facebook($content['data'][0],$access_token_val)){\r\n\t\t\t\t\t\tredirect(base_url().'user/profile'); \r\n\t\t\t\t\t\t\r\n\t\t\t\t } else {\r\n\t\t\t\t\t\tif($this->register_by_facebook($content['data'][0],$access_token_val)){\r\n\t\t\t\t\t\t\tif($this->login_by_facebook($content['data'][0],$access_token_val)){\r\n\t\t\t\t\t\t\t\t\tredirect(base_url().'user/profile');\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\techo 'login failed!';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//echo 'registration failed!';\r\n\t\t\t\t\t set_error_msg(message_line('fb_reg_fail')); // either user email is not verified in fb \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// or kept private, so goto signup page\r\n\t\t\t\t\t redirect(base_url('user/signup'));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} \r\n\t\t\t\telse {\r\n\t\t\t\t\tif($user_meta[0]['s_email'] == $content['data'][0]['email'] ){\r\n\t\t\t\t\t\t$content['data'][0]['access_token'] = $access_token_val;\r\n\t\t\t\t\t\t$this->user_model->update_data(array(\"s_facebook_credential\"=>serialize($content['data'][0])),\r\n\t\t\t\t\t\t\t\tarray(\"i_id\"=> $user_meta[0]['i_id'])\r\n\t\t\t\t\t ); \r\n\t\t\t\t\t\tset_success_msg('facebook account add success');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tset_error_msg('facebook account email not match');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tredirect(base_url().\"user/profile\");\r\n\t\t\t\t}\r\n } \r\n\r\n\t\t}", "private function viewedme($postDataArr){\n $access_token = isset($postDataArr['access_token']) ? filter_var($postDataArr['access_token'], FILTER_SANITIZE_STRING) : '';\n $device_type = isset($postDataArr['device_type']) ? filter_var($postDataArr['device_type'], FILTER_SANITIZE_NUMBER_INT) : '';\n $user_location = isset($postDataArr['user_location']) ? filter_var_array($postDataArr['user_location'],FILTER_VALIDATE_FLOAT) : '';\n if(!empty($access_token)){\n if(!empty($device_type) && $device_type!= 1 && $device_type!= 2){ //1 = ANDROID 2 = IOS\n //INVALID DEVICE TYPE ERROR\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('INVALID_ACCESS');\n $this->response($errorMsgArr);\n }\n //VALIDATE ACCESS\n $valid = $this->Api_model->validateAccess($access_token);\n if(isset($valid['STATUS']) && !$valid['STATUS']){\n //ACCESS TOKEN INVALID\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $valid['MESSAGE'];\n $this->response($errorMsgArr);\n }\n //Validate User location\n $validLoc = $this->Api_model->validateLatLong(implode(',', $user_location));\n //If not valid, return\n if(isset($validLoc['STATUS']) && !$validLoc['STATUS']){\n //throw error as same event exists\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_PARAM;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $validLoc['MESSAGE'];\n $this->response($errorMsgArr);\n }\n //FETCH LISTING\n $viewedMe = $this->Api_model->viewdmelisting($valid['VALUE']['user_id'],$user_location);\n // return $viewedMe;\n if(!empty($viewedMe)){\n foreach ($viewedMe as $key => $row) {\n // replace 0 with the field's index/key\n $createdon[$key] = $row['createdon'];\n }\n array_multisort($createdon, SORT_DESC, $viewedMe);\n $viewedMe = $this->Algo_model->shufflePeopleListing(0,$valid['VALUE']['user_id'],$viewedMe);\n foreach ($viewedMe as $key => $value){\n $viewedMe[$key]['createdon'] = $this->fetchTime($value['createdon']);\n }\n }\n //SUCCESS\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = SUCCESS_CODE;\n $errorMsgArr['STATUS'] = TRUE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['VALUE'] = $viewedMe;\n $this->response($errorMsgArr);\n }else{\n //ACCESS TOKEN MISSING ERROR\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('ACCESSTOKEN_MISSING');\n $this->response($errorMsgArr);\n }\n \t}", "function activityList($userId,$data){\n\n $activity = array(); \n $activity['hasAffiliates'] = 0;\n $aff = $this->common_model->is_data_exists(USER_AFFILIATES,array('user_id'=>$userId));\n if($aff){\n $activity['hasAffiliates'] = 1;\n }\n switch($data['listType']){ //For get activity list\n case 'today' : \n $activity['today'] = $this->todayActivityList($userId,$data);\n break;\n\n case 'tomorrow' : \n $activity['tomorrow'] = $this->tomorrowActivityList($userId,$data);\n break;\n\n case 'soon' :\n $activity['soon'] = $this->soonActivityList($userId,$data);\n break;\n\n case 'others' :\n $activity['others'] = $this->othersActivityList($userId,$data);\n break;\n\n default:\n $activity['today'] = $this->todayActivityList($userId,$data);\n $activity['tomorrow'] = $this->tomorrowActivityList($userId,$data);\n $activity['soon'] = $this->soonActivityList($userId,$data); \n $activity['others'] = $this->othersActivityList($userId,$data); \n }//End of activity list\n\n //Now we will set events for each activities\n if(!empty($activity['today']) && isset($activity['today'])){\n foreach ($activity['today'] as $key => $value) {\n $activityId = $value->activityId;\n $activity['today'][$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }\n if(!empty($activity['tomorrow']) && isset($activity['tomorrow'])){\n foreach ($activity['tomorrow'] as $key => $value) {\n $activityId = $value->activityId;\n $activity['tomorrow'][$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }\n if(!empty($activity['soon']) && isset($activity['soon'])){ \n foreach ($activity['soon'] as $key => $value) {\n $activityId = $value->activityId;\n $activity['soon'][$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }//End of setting events\n return $activity;\n\n }", "function get_facebook_data( $args ) {\n $url = $args['base_url'] . $args['node'] . $args['query_param'] . '&' . $args['root_node'] . '&' . $args['coords'] . '&' . $args['fields'] . '&' . $args['access_token'];\n \n /* Initiate request. Store the results in the $response varialbe */\n $ch = curl_init();\n curl_setopt( $ch, CURLOPT_URL, $url );\n $response = curl_exec( $ch );\n curl_close( $ch );\n \n /* Return the values in the $response variable. */\n return json_decode($response);\n \n }", "public function activityFeedAction() {\n // GET NAVIGATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_activity_feed');\n $aafmodule = Engine_Api::_()->getDbtable('modules', 'core')->getModule('advancedactivity');\n if(!empty ($aafmodule))\n $this->view->isAAFModule=true;\n //FILTER FORM\n $this->view->form = $form = new Sitestore_Form_Admin_Settings_ActivityFeed();\n //CHECK POST\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n $values = $form->getValues();\n $api = Engine_Api::_()->getApi(\"settings\", \"core\");\n foreach ($values as $key => $value) {\n $api->setSetting($key, $value);\n }\n $enable = $form->sitestore_feed_type->getValue();\n $db = Zend_Db_Table_Abstract::getDefaultAdapter();\n $activityfeed_array = array(\"sitestorealbum_admin_photo_new\", \"sitestoredocument_admin_new\", \"sitestoreevent_admin_new\", \"sitestoremusic_admin_new\", \"sitestorenote_admin_new\", \"sitestoreoffer_admin_new\", \"sitestorepoll_admin_new\", \"sitestorevideo_admin_new\", \"sitestore_admin_topic_create\", \"sitestore_admin_topic_reply\");\n foreach ($activityfeed_array as $value) {\n $activit_type_sql = \"UPDATE `engine4_activity_actiontypes` SET `enabled` = $enable WHERE `engine4_activity_actiontypes`.`type` = '$value' LIMIT 1\";\n $db->query($activit_type_sql);\n }\n }\n }", "protected function getFacebookData()\n\t{\n\t\t$config = array();\n\t\t$config['appId'] = $this->config->get('fb_app_id');\n\t\t$config['secret'] = $this->config->get('fb_app_secret');\n\t\t$config['fileUpload'] = false; // optional\n\n\t\t$facebook = new Facebook($config);\n\t\t$access_token = $facebook->getAccessToken();\n\n\t\tforeach ($this->aData AS &$elm)\n\t\t{\n\n\t\t\tif (trim($elm->w20_facebook) == '')\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$url = urlencode('https://www.facebook.com/' . $elm->w20_facebook);\n\n\t\t\t$query = \"SELECT+site,id,type+FROM+object_url+WHERE+url='$url'\";\n\t\t\t$fql_query_url = 'https://graph.facebook.com/'\n\t\t\t . 'fql?q=' . $query\n\t\t\t . '&access_token=' . $access_token;\n\t\t\t$fql_query_result = file_get_contents($fql_query_url);\n\t\t\t$fql_query_obj = json_decode($fql_query_result, true);\n\n\t\t\t$r = $fql_query_obj['data'];\n\n\t\t\tif (empty($r))\n\t\t\t{\n\t\t\t\t$elm->someval_facebook_valid = 0;\n\t\t\t\tLog::add('Facebook Invalid:' . $elm->w20_facebook);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$elm->someval_facebook_valid = 1;\n\t\t\t\t$type = $r[0]['type'];\n\t\t\t\t$fb_id = $r[0]['id'];\n\n\t\t\t\t$elm->someval_facebook_type = $type;\n\n\t\t\t\tLog::add('Facebook Valid:' . $elm->w20_facebook . ' | Type=' . $type . ' | Id=' . $fb_id);\n\n\t\t\t\tif ($type == 'page')\n\t\t\t\t{\n\t\t\t\t\t$query = \"SELECT+fan_count+FROM+page+WHERE+page_id='$fb_id'\";\n\t\t\t\t\t$fql_query_url = 'https://graph.facebook.com/'\n\t\t\t\t\t . 'fql?q=' . $query\n\t\t\t\t\t . '&access_token=' . $access_token;\n\t\t\t\t\t$fql_query_result = file_get_contents($fql_query_url);\n\t\t\t\t\t$fql_query_obj = json_decode($fql_query_result, true);\n\n\t\t\t\t\t$r = $fql_query_obj['data'];\n\n\t\t\t\t\t$elm->someval_facebook_friends_or_likes = $r[0]['fan_count'];\n\t\t\t\t\tLog::add('Facebook Fancount:' . $r[0]['fan_count']);\n\t\t\t\t}\n\n\t\t\t\tif ($type == 'profile')\n\t\t\t\t{\n\t\t\t\t\t$query = \"SELECT+friend_count+FROM+user+WHERE+uid=$fb_id\";\n\t\t\t\t\t$fql_query_url = 'https://graph.facebook.com/'\n\t\t\t\t\t . 'fql?q=' . $query\n\t\t\t\t\t . '&access_token=' . $access_token;\n\t\t\t\t\t$fql_query_result = file_get_contents($fql_query_url);\n\t\t\t\t\t$fql_query_obj = json_decode($fql_query_result, true);\n\n\t\t\t\t\t$r = $fql_query_obj['data'];\n\t\t\t\t\t$elm->someval_facebook_friends_or_likes = $r[0]['friend_count'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function postAction() {\r\n\t\t//197221680326345_425781560803688\r\n\t\t$starttime = time();\r\n\t\t$data['facebook_user_id'] = $this->_user->facebook_user_id;\r\n\t\t$data['fanpage_id'] = $this->_getParam('fanpage_id');\r\n\t\t$data['fanpage_name'] = $this->_getParam('fanpage_name');\r\n\t\t$data['access_token'] = $this->_getParam('access_token');\r\n\t\t//$data['post_id'] = $this->_getParam('post_id');\r\n\t\t$data['message'] = $this->_getParam('message');\r\n\r\n\t\ttry{\r\n\t\t\t$fancrankFB = new Service_FancrankFBService();\r\n\t\t\t$params = array(\r\n\t\t\t\t\t'message' => $data['message'],\r\n\t\t\t\t\t'access_token' => $this->_user->facebook_user_access_token\r\n\t\t\t);\r\n\t\r\n\t\t\t$ret_obj = $fancrankFB->api('/'.$data['fanpage_id'].'/feed', 'POST',\r\n\t\t\t\t\t$params);\r\n\t\t\t\r\n\t\t\tZend_Debug::dump($ret_obj);\r\n\t\t\t\r\n\t\t\t$data['post_id'] = $ret_obj['id'];\r\n\t\t\t\r\n\t\t\t$fanpageModel = new Model_Fanpages();\r\n\t\t\t$fanpageAccessToken = $fanpageModel->getFanpageAccessToken($data['fanpage_id']);\r\n\t\t\t\r\n\t\t\t$client = new Zend_Http_Client;\r\n\t\t\t$client->setUri(\"https://graph.facebook.com/\". $data['post_id']);\r\n\t\t\t$client->setMethod(Zend_Http_Client::GET);\r\n\t\t\t$client->setParameterGet('access_token', $fanpageAccessToken);\r\n\t\t\t \r\n\t\t\t$response = $client->request();\r\n\t\t\t \r\n\t\t\t$result = Zend_Json::decode($response->getBody(), Zend_Json::TYPE_OBJECT);\r\n\t\t\t \r\n\t\t\tZend_debug::dump($result);\r\n\t\t\t \r\n\t\t\tif(!empty ($result)) {\r\n \t\t\t$db = Zend_Db_Table::getDefaultAdapter();\r\n \t\t\t\r\n \t\t\t// check response error from facebook graph api\r\n\t\t\t\t$result = $this->facebookResponseCheck($result);\r\n\t\t\t\t\r\n\t\t\t\t$db->beginTransaction();\r\n \t\t\t$postModel = new Model_Posts();\r\n \t\t\t$created = new Zend_Date(!empty($post->created_time) ? $post->created_time : null, Zend_Date::ISO_8601);\r\n \t\t\t$updated = new Zend_Date(!empty($post->updated_time) ? $post->updated_time : null, Zend_Date::ISO_8601);\r\n \r\n \t\t\t$row = array(\r\n \t\t\t\t\t'post_id' => $result->id,\r\n \t\t\t\t\t'facebook_user_id' => $result->from->id,\r\n \t\t\t\t\t'fanpage_id' => $data['fanpage_id'],\r\n \t\t\t\t\t'post_message' => isset($result->message) ? $postModel->quoteInto($result->message) : '',\r\n \t\t\t\t\t'picture'\t\t\t\t=> !empty($result->picture) ? $result->picture : '',\r\n \t\t\t\t\t'link'\t\t\t\t\t=> !empty($result->link) ? $result->link : '',\r\n \t\t\t\t\t'post_type' => !empty($result->type) ? $result->type : '',\r\n \t\t\t\t\t'status_type' => !empty($result->status_type) ? $result->status_type : '',\r\n \t\t\t\t\t'post_description'\t\t=> !empty($result->description) ? $postModel->quoteInto($result->description) : '',\r\n \t\t\t\t\t'post_caption'\t\t\t=> !empty($result->caption) ? $postModel->quoteInto($result->caption) : '',\r\n \t\t\t\t\t'created_time' => $created->toString('yyyy-MM-dd HH:mm:ss'),\r\n \t\t\t\t\t'updated_time' => $updated->toString('yyyy-MM-dd HH:mm:ss'),\r\n \t\t\t\t\t'post_comments_count' => !empty($result->comments->count) ? $result->comments->count : 0,\r\n \t\t\t\t\t'post_likes_count' => isset($result->likes) && isset($result->likes->count) ? $result->likes->count : 0\r\n \t\t\t);\r\n \r\n \t\t\tif (property_exists($result, 'application') && isset($result->application->id)) {\r\n \t\t\t\t$row['post_application_id'] = $result->application->id;\r\n \t\t\t\t$row['post_application_name'] = empty($result->application->name) ? null : $result->application->name;\r\n \t\t\t} else {\r\n \t\t\t\t$row['post_application_id'] = null;\r\n \t\t\t\t$row['post_application_name'] = null;\r\n \t\t\t}\r\n \r\n \t\t\ttry {\r\n \t\t\t\t// retrieve fanpage setting\r\n \t\t\t\t$fanpageSettingModel = new Model_FanpageSetting();\r\n \t\t\t\t$settingData = $fanpageSettingModel->findRow($data['fanpage_id']);\r\n \t\t\t\tif(!$settingData) {\r\n \t\t\t\t\t$settingData = $fanpageSettingModel->getDefaultSetting();\r\n \t\t\t\t}else {\r\n \t\t\t\t\t$settingData = $settingData->toArray();\r\n \t\t\t\t}\r\n \t\t\t\t\t\r\n \t\t\t\t// insert new post into database\r\n \t\t\t\t$postModel->insert($row);\r\n\r\n \t\t\t\t// if none admin post, apply point rule to post\r\n \t\t\t\tif($data['fanpage_id'] != $result->from->id) {\r\n \t\t\t\t\t// add activity into database\r\n \t\t\t\t\t$this->addactivity('post-'.$row['post_type'], $data['post_id'],\r\n \t\t\t\t\t\t\t$data['fanpage_id'],$data['fanpage_id'], $data['fanpage_name'],$row['post_message'] );\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t// update fan data\r\n \t\t\t\t\t$fan = new Model_Fans($data['facebook_user_id'], $data['fanpage_id']);\r\n \t\t\t\t\t$fan->updateFanPoints($settingData['point_post_normal']);\r\n \t\t\t\t\t$fan->updateFanProfile();\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t// update fan stat\r\n \t\t\t\t\t$fanstat = new Model_FansObjectsStats();\r\n \t\t\t\t\tswitch($row['post_type']){\r\n \t\t\t\t\t\tcase 'status':\r\n \t\t\t\t\t\t\t$fanstat ->addPostStatus($data['fanpage_id'], $data['facebook_user_id']);\r\n \t\t\t\t\t\t\tbreak;\r\n \t\t\t\t\t\tcase 'photo':\r\n \t\t\t\t\t\t\t$fanstat->addPostPhoto($data['fanpage_id'], $data['facebook_user_id']);\r\n \t\t\t\t\t\t\tbreak;\r\n \t\t\t\t\t\tcase 'video':\r\n \t\t\t\t\t\t\t$fanstat->addPostVideo($data['fanpage_id'], $data['facebook_user_id']);\r\n \t\t\t\t\t\t\tbreak;\r\n \t\t\t\t\t\tcase 'link':\r\n \t\t\t\t\t\t\t$fanstat->addPostLink($data['fanpage_id'], $data['facebook_user_id']);\r\n \t\t\t\t\t\t\tbreak;\r\n \t\t\t\t\t}\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t// update point data\r\n \t\t\t\t\t$pointLog = array();\r\n \t\t\t\t\t$pointLog['fanpage_id'] = $data['fanpage_id'];\r\n \t\t\t\t\t$pointLog['facebook_user_id'] = $data['facebook_user_id'];\r\n \t\t\t\t\t$pointLog['object_id'] = $data['post_id'];\r\n \t\t\t\t\t$pointLog['object_type'] = 'posts';\r\n \t\t\t\t\t$pointLog['giving_points'] = $settingData['point_post_normal'];\r\n \t\t\t\t\t$pointLog['note'] = 'post on fanpage';\r\n \t\t\t\t\t$pointLogModel = new Model_PointLog();\r\n \t\t\t\t\t$result = $pointLogModel->insert($pointLog);\r\n \t\t\t\t}else {\r\n \t\t\t\t\t$this->addactivity('post-'.$row['post_type'], $data['post_id'],\r\n \t\t\t\t\t\t\t$data['fanpage_id'],$data['fanpage_id'], $data['fanpage_name'],$row['post_message'] );\r\n \t\t\t\t}\r\n \t\t\t\t\r\n \t\t\t\t// commit all update\r\n \t\t\t\t$db->commit();\r\n \t\t\t\t$db->closeConnection();\r\n\t\t\t\t} catch (Exception $e) {\r\n\t\t\t\t\t$db->rollBack();\r\n\t\t\t\t\t$db->closeConnection();\r\n\t\t\t\t\tprint $e->getMessage();\r\n\t\t\t\t\t$appLogger = Zend_Registry::get('appLog');\r\n\t\t\t\t\t$appLogger->log(sprintf('Unable to save post %s from fanpage %s to database. Error Message: %s ', $post->id,$data['fanpage_id'], $e->getMessage()), Zend_log::ERR);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//return $result;\r\n\r\n\t\t} catch (Exception $e){\r\n\t\t\techo $e;\r\n\t\t\t$appLogger = Zend_Registry::get('appLog');\r\n\t\t\t$appLogger->log(sprintf('Unable to save post from fanpage %s to database. Error Message: %s ', $data['fanpage_id'], $e->getMessage()), Zend_log::ERR);\r\n\t\t}\r\n\t\techo '<br/>' .time() - $starttime . 'sec';\r\n\t}", "function viewEventDetail()\n{\n\t\t/*\n\t\t{\n\t \"name\": \"Master The Art Of Selling\",\n\t \"address\": \"10-f, Fort Legend Tower, 3rd Ave, Taguig, Metro Manila\",\n\t \"gmapLong\": 121.04692,\n\t \"gmapLat\": 14.55408,\n\t \"date\": \"4-25-2016\",\n\t \"startTime\": \"10:00\",\n\t \"endTime\": \"19:00\",\n\t \"eventPhoto\": \"event.jpg\",\n\t \"about\": \"We will teach you on how to master selling and generate more sales for your brand or company\",\n\t \"attendees\": [\n\t {\n\t \"id\": \"1\",\n\t \"firstName\": \"Ken\",\n\t \"lastName\": \"Sia\",\n\t \"profilePhoto\": \"emp1.jpg\"\n\t },\n\t {\n\t \"id\": \"2\",\n\t \"firstName\": \"Jaye\",\n\t \"lastName\": \"Atienza\",\n\t \"profilePhoto\": \"emp2.jpg\"\n\t }\n\t ]\n\t }\n\t */\n\t \n\t//the defaults starts\n\tglobal $myStaticVars;\n\textract($myStaticVars); // make static vars local\n\t$member_default_avatar \t\t= $member_default_avatar;\n\t$member_default_cover\t\t= $member_default_cover;\n\t$member_default\t\t\t\t= $member_default;\n\t$company_default_cover\t\t= $company_default_cover;\n\t$company_default_avatar\t\t= $company_default_avatar;\n\t$events_default\t\t\t\t= $events_default;\n\t$event_default_poster\t\t= $event_default_poster;\n\t//the defaults ends\n\t\n\t\n\t$data= array();\t\t\n\t\n\t$eventTagid=validate_input($_GET['id']);\n\t$eventid=getEventIdfromEventTag($eventTagid);\n\tif($eventid!='')\n\t{\n\t\t$qry=\"SELECT entrp_events.*,entrp_event_categories.category_name \n\t\t\t\tFROM entrp_events \n\t\t\t\tLEFT JOIN entrp_event_categories ON entrp_events.category=entrp_event_categories.id\n\t\t\t WHERE entrp_events.id=\".$eventid.\" AND entrp_events.status!=0\n\t\t\t\t\";\n\t\t$res=getData($qry);\n\t\t$count_res=mysqli_num_rows($res);\n\t\tif($count_res>0)\n\t\t{\n\t\t\twhile($row=mysqli_fetch_array($res))\n\t \t{\n\t \t\t$data['id']\t\t\t\t=\t$row['id'];\n\t \t\t$data['eventTagId']\t=\t$row['eventTagId'];\n\t \t\t$data['city']\t\t\t=\t$row['city'];\n\t \t\t$data['share_url']\t=\t$row['share_url'];\n\t \t\t$data['name']\t\t\t=\t$row['eventName'];\n\t \t\t$data['address']\t\t=\t$row['address'];\n\t\n\t \t\t$data['date_time_formatted']\t\t\t=\tdate('Y/m/d H:i:s', strtotime($row['event_date_time']));\n\t \t\t$data['date']\t\t\t=\t$row['event_date'];\n\t \t\t$data['startTime']\t=\t$row['start_time'];\n\t \t\t$data['endTime']\t\t=\t$row['end_time'];\n\t \t\t$data['eventPhoto']\t=\t$row['clientid'];\n\t \t\tif($row['poster']!='')\n\t \t\t{\n\t \t\t\t$data['poster']\t=\t$row['poster'];\n\t \t\t}\n\t \t\telse\n\t \t\t{\n\t \t\t\t$data['poster']\t=\t$events_default;\n\t \t\t}\n\t \t\t\n\t \t\t$data['about']\t\t\t=\thtmlspecialchars_decode($row['description'],ENT_QUOTES);\n\t \t\t$data['category']\t\t=\t$row['category_name'];\n\t \t\t$data['map']['center']['latitude']\t\t=\t$row['location_lat'];\n\t\t\t\t$data['map']['center']['longitude']\t\t=\t$row['location_long'];\n\t\t\t\t$data['map']['zoom']\t=\t8;\n\t \t}\n\t \t\n\t\t\t$data['joining']\t\t\t=\tgoingForThisEventorNot($eventid);\n\t\t\t$data['attendees']\t\t=\tgetEventAttendeesFromEventID($eventid);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data['id']\t\t\t\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['name']\t\t\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['address']\t\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['map']['center']['latitude']\t\t=\t'';\n\t\t\t$data['map']['center']['longitude']\t\t=\t'';\n\t\t\t$data['map']['zoom']\t\t\t\t\t\t\t=\t8;\n\t\t\t$data['date']\t\t\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['startTime']\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['endTime']\t\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['eventPhoto']\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['poster']\t\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['about']\t\t\t\t\t\t\t\t\t=\t'';\n\t \t$data['category']\t\t\t\t\t\t\t\t=\t'';\t\t\n\t\t}\t\n\t}\n\treturn $data;\n}", "public function events_process($event_post_data)\n\t{\n\t\t$villaName = $event_post_data['hidVillaName'];\n\t\t$params['VillaID'] = $event_post_data['villaID'];\n\t\t$params['CIDate'] = '1 January 1900';\n\t\t$params['CODate'] = '3 January 1900';\n\t\t$params['GuestFirstName'] = stripslashes($event_post_data['txtFirstname']);\n\t\t$params['GuestLastName'] = stripslashes($event_post_data['txtLastName']);\n\t\t$params['CountryOfResidence'] = $event_post_data['selCountry'];\n\t\t$params['Email'] = $event_post_data['txtEmail'];\n\t\t$params['TelNo'] = $event_post_data['txtPhoneAreaCode'].$event_post_data['txtPhoneNumber'];\n\t\t$params['TotalAdults'] = !empty($event_post_data['txtGuests'])?$event_post_data['txtGuests']:'1';\n\t\t$params['BookingSourceID'] = \"11\";\n\t\t$params['MobileNo'] = '';\n\t\t$params['BedRooms'] = $event_post_data['selBedroom'];\n\t\t$params['SpecialRequest'] = stripslashes('Event Date:'.strip_tags($event_post_data['eventdate']).', No. of pax: '.$event_post_data['txtGuests'].', Message: '.$event_post_data['txtMessage']);\n\t\t$params['SuggestOtherVilla'] = 'N';\n\t\t$params['TotalChildren'] = 0;\n\t\t$params['TotalInfants'] = 0;\n\t\t$params['RURL'] = urlencode($event_post_data['hfrurl']);\n\t\t$params['IsGenInquiry'] = 'Y';\n\t\t$params['CIPAddress'] = $event_post_data['hid_cip'];\n\t\t$params['IsEvent'] = 'Y';\n\t\t$params['AreDatesFlexible'] = 'N';\n\t\t$params['OptInMailList'] = 'Y';\n\t\t$params['LCID'] = 'en';\n\t\t\t\n\t\t$timeTokenHash = $this->cheeze_curls('Security_GetTimeToken', \"\", TRUE, FALSE,\"\",\"\",\"prod\");\n\t\tif (!is_array($timeTokenHash))\n\t\t\t$timeTokenHash = html_entity_decode($timeTokenHash);\n\t\n\t\t$params['p_ToHash'] = 'villaprtl|Xr4g2RmU|'.$timeTokenHash[0];\n\t\t$hashString = $this->prepare_Security_GetMD5Hash($params);\n\t\t$md5Hash = $this->cheeze_curls('Security_GetMD5Hash', $hashString, TRUE, FALSE,\"\",\"\",\"prod\");\n\t\t$p_Params = json_encode($params);\n\t\t$p_UserID = 'villaprtl';\n\t\t$p_Token = $md5Hash[0];\n\t\t$request = 'p_Token='.$p_Token.'&p_UserID='.$p_UserID.'&p_Params='.$p_Params;\n\t\t$newBooking = $this->cheeze_curls('insertInquiry',$request,TRUE,FALSE,\"\",\"\",\"prod\");\n\t\t$newBooking['thank_you_message'] = '<p>Your Reservation Enquiry Form has been successfully sent for '.$villaName.'.</p>\n\t\t\t<p>The Elite Havens Group, luxury villa rentals, manage all the reservations for '.$villaName.'. One of our villa specialists will be in touch shortly.</p>\n\t\t\t<p>Your Reference I.D. is <strong>'.$newBooking['Transactions']['InquiryID'].'</strong></p>\n\t\t\t<p>The Elite Havens Group presents a stunning portfolio of luxury private villas throughout Bali and Lombok in Indonesia, Thailand, Sri Lanka and Maldives. Staffed to the highest quality, each villa offers a blissfully relaxing and highly individual experience. Ranging in size from one to nine bedrooms and boasting private pools, luxurious living spaces, equipped kitchens (with chef) and tropical gardens, our villas are situated in the heart of the action, beside blissful beaches, upon jungle-clad hillsides and amongst idyllic rural landscapes ensuring the perfect holiday experience for all.</p>';\n\t\treturn $newBooking;\n\t\n\t}", "function processRequest(){\n\tglobal $muse; // App settings & database\n\tglobal $HTTP_RAW_POST_DATA;\n\t\n\t// Get the user's posted action\n\t$muse['actionRequestRaw'] = $HTTP_RAW_POST_DATA;\n\t$muse['actionRequest'] = $muse['db']->real_escape_string(trim($HTTP_RAW_POST_DATA));\n\t// First word of action request will be the action keyword.\n\t$muse['actionKeyword'] = strtolower(substr( $muse['actionRequest'], 0, strpos( $muse['actionRequest'], \" \" ) ) );\n\t\n\t// If it's only one word, through it back in. Capatlization issues?\n\tif ($muse['actionKeyword']==false) {\n\t\t$muse['actionKeyword'] = $muse['actionRequest'];\n\t}\n}", "function get_activity_date()\n\t{\n\t\t$my = $this->Session->read('Auth.User');\n\t\t$entityOn = $this->Session->read('entityOn');\n\t\t\n\t\t$clean = new Sanitize();\n\t\t\n\t\t$stream_id = $clean->html($this->params['url']['stream_id']); // from GET\n\t\t// TODO: Remove \"filters\", send tag_id, user_id etc (as a number or csv)\n\t\tif(isset($this->params['url']['type'])){\n\t\t\t$filter_type = $clean->html($this->params['url']['type']);\n\t\t}else{\n\t\t\t$filter_type = NULL;\n\t\t}\t\n\t\tif(isset($this->params['url']['filter_id'])){\n\t\t\t$filter_id = $clean->html($this->params['url']['filter_id']);\n\t\t}else{\n\t\t\t$filter_id = NULL;\n\t\t}\n\t\tif(isset($this->params['url']['parent_id'])){\n\t\t\t$parent_id = $clean->html($this->params['url']['parent_id']);\n\t\t}else{\n\t\t\t$parent_id = NULL;\n\t\t}\n\t\t\n\t\t$tag_id = NULL;\n\t\t$user_id = NULL;\n\t\tif ($filter_type == 'Filter_Tags')\n\t\t\t$tag_id = $clean->html($this->params['url']['filter_id']);\n\t\telse if ($filter_type == 'Filter_Users')\n\t\t\t$user_id = $clean->html($this->params['url']['filter_id']);\n\t\t\n\t\t$paginatedPage = 1;// = $this->params['url']['date'];\n\t\t$PAGESIZE = 20;\n\t\t\n\t\t$isGetActivityByDate = array_key_exists('date', $this->params['url']);\n\t\t$activities = NULL;\n\t\t\n\t\tif($filter_type == 'Filter_Tags'){$filter_type_id = 1;}\n\t\telse if($filter_type == 'Filter_Users'){$filter_type_id = 2;}\n\n\t\t//$message = 'No activities found in this tag.<br/>Be the first to add one!';\n\t\t$message = '';\n\t\t$readOnly = false;\n\t\tif ($filter_type == \"Filter_Users\" && (int)$filter_id != (int)$my['id']) {\n\t\t\t$json['readOnly'] = true;\n\t\t\t//$message = 'You have not posted anything yet.<br/>Try it now!';\n\t\t\t$message=\"\";\n\t\t}\n\t\t\n\t\t$json = array (\n\t\t\t'message'\t=> $message,\n\t\t\t'status' \t=> 'failed',\n\t\t\t'timestamp' => $this->params['url']['timestamp']\n\t\t);\n\t\t\n\t\t$permissions = $this->Session->read('StreamsUser.Permission');\n\t\t$access = $this->Session->read('Streams.Access');\n\t\t\n\t\t$permissionResults = $this->Stream->hasPermission($stream_id, $my['id'], $permissions, $access);\n\t\t//if the permission and access info is not in the session variable, write them!\n\t\t// FIXME: Shouldn't this be taken care of in the function?!!\n\t\tif (array_key_exists('permissionToAdd', $permissionResults))\n\t\t{\n\t\t\t$this->__updateStreamPermissionAccessToSession('StreamsUser.Permission', $permissionResults['permissionToAdd']['stream_id'], $permissionResults['permissionToAdd']['permission'], $permissions);\n\t\t\t$permissions = $this->Session->read('StreamsUser.Permission');\n\t\t}\n\t\tif (array_key_exists('accessToAdd', $permissionResults))\n\t\t{\n\t\t\t$this->__updateStreamPermissionAccessToSession('Streams.Access', $permissionResults['accessToAdd']['stream_id'], $permissionResults['accessToAdd']['access'], $access);\n\t\t\t$access = $this->Session->read('Streams.Access');\n\t\t}\n\t\t\t\t\n\t\t$flag = $permissionResults['flag'];\n\t\tif($flag)\n\t\t{\t\t\t\n\t\t\tif($entityOn['controller'] == 'pages' && $entityOn['action'] == 'view' && isset($entityOn['Page']['comment_id'])){\n\t\t\t\t$comment_id = $entityOn['Page']['comment_id'];\n\t\t\t}else{\n\t\t\t\t$comment_id = NULL;\n\t\t\t}\n\t\t\t\n\t\t\tif ($filter_id > -1) //only update stream_view if it's not favourite activity\n\t\t\t{\n\t\t\t\t$ip = $this->RequestHandler->getClientIP();\n\t\t\t\t$date = date('Y-m-d H:i:s');\n\t\t\t\t$this->Stream->query('INSERT INTO stream_views_history (stream_id, entity_id, entity_type, user_id, ip, created) VALUES(\"'.$stream_id.'\", \"'.$filter_id.'\", \"'.$filter_type_id.'\", \"'.$my['id'].'\", \"'.$ip.'\", \"'.$date.'\" )');\n\t\t\t\t\t\t\n\t\t\t\t//create/update stream_views entry\n\t\t\t\t$parameters = array(\n\t\t\t\t\t'stream_id' => $stream_id,\n\t\t\t\t\t'entity_id' => $filter_id,\n\t\t\t\t\t'entity_type' => $filter_type_id,\n\t\t\t\t\t'user_id' => $my['id']\n\t\t\t\t);\n\t\t\t\t$this->Stream->StreamView->recursive = -1;\n\t\t\t\t$view_id= $this->Stream->StreamView->find('first', array('fields'=> array('id'), 'conditions'=> $parameters));\n\t\t\t\tif(isset($view_id['StreamView']['id']))\n\t\t\t\t{\n\t\t\t\t\t//$this->Stream->StreamView->id = $view_id;\n\t\t\t\t\t$this->Stream->query('UPDATE stream_views SET modified = \"'.$date.'\" WHERE id = '.$view_id['StreamView']['id'].'');\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$this->Stream->StreamView->create();\t\n\t\t\t\t\t$this->Stream->query('INSERT INTO stream_views (stream_id, entity_id, entity_type, user_id, ip, created, modified) VALUES(\"'.$stream_id.'\", \"'.$filter_id.'\", \"'.$filter_type_id.'\", \"'.$my['id'].'\", \"'.$ip.'\", \"'.$date.'\", \"'.$date.'\")');\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//debug($this->core);\n\t\t\t$options = array(\n\t\t\t\t'stream_id'\t\t=> $stream_id, \n\t\t\t\t'tag_id' \t\t=> $tag_id, // we need to send filters as themselves e.g. \"tags\" - remove the whole \"filter\" notion\n\t\t\t\t'type_id' \t\t=> '1,2,3,4,5,6,7,8,9,44, ', //$this->core['widget']['types'], // csv // We want certain types back \n\t\t\t\t'user_id'\t\t=> $user_id,\n\t\t\t\t'comment_id'\t=> $comment_id,\n\t\t\t\t'parent_id'\t\t=> $parent_id, // for Replies\n\t\t\t\t'widget_id'\t\t=> NULL, //for Thought widget => Actually for thoughts you want ALL hence leave NULL\n\t\t\t\t'search_terms' \t=> NULL,\n\t\t\t\t'date'\t\t\t=> NULL,\n\t\t\t\t'start_date' \t=> NULL,\n\t\t\t\t'end_date' \t\t=> NULL,\n\t\t\t\t'paginatedPage' => $paginatedPage,\n\t\t\t\t'limit'\t\t\t=> $PAGESIZE\n\t\t\t);\n\t\t\tif (!$isGetActivityByDate) //this is the initial fetch of the activity feed\n\t\t\t{\n\t\t\t\t$options['pagination'] = true;\t\t\n\t\t\t\t//$datePagination = $this->__getCountByDate($data); //need to get the dates where activity entries exist\n\t\t\t\t$datePagination = $this->Stream->Comment->getPagination($this->core, $options);\n\t\t\t\t//debug($datePagination);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$options['date'] = $clean->html($this->params['url']['date']);\n\t\t\t\t//$data['date'] = '2009-07-24';\n\t\t\t\t\t\n\t\t\t//$activities = $this->Stream->CommentsStream->__getThoughtsforStream($data);]\n\t\t\t$thoughts = $this->Stream->Comment->get($this->core, $options);\n\t\t\t//debug($activities);\n\t\t\t$activityArray = $thoughts;//$this->Stream->__getActivitiesList($activities, $my, false, $filter_id, $filter_type, $permissions);\n\t\t\t\n\t\t\tif($activityArray != NULL)\n\t\t\t{\n\t\t\t\t$activities = $activityArray;\n\t\t\t\t//debug($activity);\n\t\t\t\t\n\t\t\t\tif(!$isGetActivityByDate) //initial fetch of activity feed\n\t\t\t\t{\n\t\t\t\t\t/*debug($activity);\n\t\t\t\t\tdebug($filter_type);\n\t\t\t\t\tdebug($datePagination);*/\n\t\t\t\t\t\n\t\t\t\t\t$this->set(compact('thoughts', 'datePagination', 'filter_type', 'readOnly'));\n\t\t\t\t\t$this->layout = 'ajax';\n\t\t\t\t\t$this->render('/activities/activity_pagination'); \n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$this->set(compact('message','thoughts', 'filter_type', 'readOnly'));\n\t\t\t\t\t$this->layout = 'ajax';\n\t\t\t\t\t$this->render('/activities/activity'); \n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$message = 'No activities found.';\n\t\t\t\t$this->set(compact('message', 'filter_type', 'thoughts'));\n\t\t\t\t$this->layout = 'ajax';\n\t\t\t\t$this->render('/activities/activity');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$message = 'You do not have permission to view this Stream';\n\t\t\t$this->set(compact('message', 'filter_type', 'activities'));\n\t\t\t$this->layout = 'ajax';\n\t\t\t$this->render('/activities/activity'); \t\t\t\t\t\n\t\t}\n\t}", "public function sendEvent($context) {\n\t\t\n\t\t\t//Store some information on the Symphony Entry.\n\t\t\t$entry = $context['entry'];\n\t\t\t\n\t\t\t$entry_settings = $entry->get();\n\t\t\t$entry_id = $entry_settings['id'];\t\n\t\n\t\t\t$e_data = array();\n\t\t\tforeach($context['fields'] as $key => $value) {\n\t\t\t\tif($this->string_begins_with($key, 'e-')) {\n\t\t\t\t\t$e_data[str_replace('e-', 'e_', $key)] = $value;\n\t\t\t\t} else if ($this->string_begins_with($key, 'g-')) {\n\t\t\t\t\t$e_data[str_replace('g-', 'g_', $key)] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Change the e_status property to a value the API understands\n\t\t\tif($e_data['e_status'] == 'yes') {\n\t\t\t\t$e_data['e_status'] = 'active';\n\t\t\t} else {\n\t\t\t\t$e_data['e_status'] = 'pending';\n\t\t\t}\t\n\t\t\t//Set the format of the Date/Times\n\t\t\t$e_data['e_start'] = date('Y-m-d G:i:s', strtotime($e_data['e_start']));\n\t\t\t$e_data['e_stop'] = date('Y-m-d G:i:s', strtotime($e_data['e_stop']));\n\t\t\t$e_data['e_deadline'] = date('Y-m-d G:i:s', strtotime($e_data['e_deadline']));\n\n\t\t\t//Another Required field is the User ID\n\t\t\t$e_data['u_id'] = $this->u_id;\n\t\t\t\n\t\t\t//Create a unique Push URL (e_pushurl) from the entry ID.\n\t\t\t$e_data['e_pushurl'] = URL .'/eventarc-updater/?hash='.sha1($entry_id).'&id='.$entry_id;\n\t\t\n\t\t\t//Address Data\n\t\t\t$a_data = array();\n\t\t\tforeach($context['fields'] as $key => $value) {\n\t\t\t\tif($this->string_begins_with($key, 'a-')) {\n\t\t\t\t\t$a_data[str_replace('a-', 'a_', $key)] = $value;\n\t\t\t\t} \n\t\t\t}\n\t\t\t\n\t\t\t//If the ID & URL are not set - Create a new event.\n\t\t\tif($e_data['e_id'] == '' && $e_data['e_url'] == '') {\n\t\t\t\n\t\t\t\tunset($e_data['e_id']);\n\t\t\t\tunset($e_data['e_url']);\t\n\t\t\t\tif(!empty($a_data)) {\n\t\t\t\t\t//Set the type as venue.\n\t\t\t\t\t$a_data['a_type'] = 'venue';\n\t\t\t\t\t// Send the event to eventarc with the address details\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\n\t\t\t\t\t ->add_address($a_data)\n\t\t\t\t\t ->event_create();\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t// Send the event to eventarc\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\n\t\t\t\t\t ->event_create();\n\t\t\t\t}\n\n\t\t\t\t if($result) {\n\t\n\t\t\t\t \tif(!isset(self::$fieldManager)) {\n\t\t\t\t \t\tself::$fieldManager = new fieldManager(Symphony::Engine());\n\t\t\t\t \t}\n\t\t\t\t \t\n\t\t\t\t \t$field_id = self::$fieldManager->fetchFieldIDFromElementName('e-id');\n\t\t\t\t \t$entry->setData($field_id, array(\n\t\t\t\t \t\t'handle' => $result['e_id'],\n\t\t\t\t \t\t'value' => $result['e_id'],\n\t\t\t\t \t\t'value_formatted' => $result['e_id'],\n\t\t\t\t \t\t'word_count' => 0\n\t\t\t\t \t));\n\t\t\t\t \t\n\t\t\t\t \t//Save the returned Eventarc URL (e_url).\n\t\t\t\t \t$field_id = self::$fieldManager->fetchFieldIDFromElementName('e-url');\n\t\t\t\t \t$entry->setData($field_id, array(\n\t\t\t\t \t\t'handle' => $result['url'],\n\t\t\t\t \t\t'value' => $result['url'],\n\t\t\t\t \t\t'value_formatted' => $result['url'],\n\t\t\t\t \t\t'word_count' => 0\n\t\t\t\t \t));\n\t\t\t\t \t\n\t\t\t\t \t//Save the returned Eventarc Address ID (a_id).\n\t\t\t\t \t$field_id = self::$fieldManager->fetchFieldIDFromElementName('a-id');\n\t\t\t\t \t$entry->setData($field_id, array(\n\t\t\t\t \t\t'handle' => $result['a_id'],\n\t\t\t\t \t\t'value' => $result['a_id'],\n\t\t\t\t \t\t'value_formatted' => $result['a_id'],\n\t\t\t\t \t\t'word_count' => 0\n\t\t\t\t \t));\n\t\t\t\t \t\n\t\t\t\t \t$entry->commit();\n\t\t\t \n\t\t\t\t }\n\t\t\t\t \n\t\t\t} \n\t\t\t//Event already exists - update the event. \n\t\t\telse {\n\t\t\t\t\n\t\t\t\t//Check that the URL is not empty.\t\n\t\t\t\tif($e_data['e_url'] == '') {\n\t\t\t\t\t\n\t\t\t\t\t$result = $this->eventarc->event_get($e_data['e_id']);\n\t\t\t\t\t\n\t\t\t\t\tif(!isset(self::$fieldManager)) {\n\t\t\t\t\t\tself::$fieldManager = new fieldManager(Symphony::Engine());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Save the returned Eventarc URL (e_url).\n\t\t\t\t\t$field_id = self::$fieldManager->fetchFieldIDFromElementName('e-url');\n\t\t\t\t\t$entry->setData($field_id, array(\n\t\t\t\t\t\t'handle' => $result['url'],\n\t\t\t\t\t\t'value' => $result['url'],\n\t\t\t\t\t\t'value_formatted' => $result['url'],\n\t\t\t\t\t\t'word_count' => 0\n\t\t\t\t\t));\n\t\t\t\t\t\n\t\t\t\t\t$entry->commit();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Check that the Address ID is not empty.\t\n\t\t\t\tif($a_data['a_id'] == '') {\n\t\t\t\t\t\n\t\t\t\t\t$result = $this->eventarc->event_get_address($e_data['e_id']);\n\t\t\t\t\t\n\t\t\t\t\tif(!isset(self::$fieldManager)) {\n\t\t\t\t\t\tself::$fieldManager = new fieldManager(Symphony::Engine());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Save the returned Eventarc Address ID (a_id).\n\t\t\t\t\t$field_id = self::$fieldManager->fetchFieldIDFromElementName('a-id');\n\t\t\t\t\t$entry->setData($field_id, array(\n\t\t\t\t\t\t'handle' => $result['a_id'],\n\t\t\t\t\t\t'value' => $result['a_id'],\n\t\t\t\t\t\t'value_formatted' => $result['a_id'],\n\t\t\t\t\t\t'word_count' => 0\n\t\t\t\t\t));\n\t\t\t\t\t\n\t\t\t\t\t//Store the retrieved address ID.\n\t\t\t\t\t$a_data['a_id'] = $result['a_id'];\n\t\t\t\t\t$entry->commit();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Don't want to manually change the URL generated by Eventarc.\n\t\t\t\tunset($e_data['e_url']);\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Edit the Event.\n\t\t\t\tif(!empty($a_data)) {\n\t\t\t\t\t//Set the type as venue.\n\t\t\t\t\t$a_data['a_type'] = 'venue';\n\t\t\t\t\t// Send the event to eventarc with the address details\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\t\n\t\t\t\t\t ->event_update();\n\t\t\t\t\t $result = $this->eventarc\n\t\t\t\t\t ->add_address($a_data)\n\t\t\t\t\t ->address_update();\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t// Send the event to eventarc\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\n\t\t\t\t\t ->event_update();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t}", "public function checkUser_post(){\n\t\textract($_POST);\n\t\t//print_r($_POST);die();\n\t\t$oauth_provider='facebook';\n\t\t// ------if facebook oauth provider not found-------------\n\t\tif ($oauth_provider=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'OAuth provider field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // ------if facebook oauth uid not found-------------\n\t\tif ($oauth_uid=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'OAuth UID field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // ------if facebook First Name not found-------------\n\t\tif ($first_name=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'Facebook First Name field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // ------if facebook Last Name not found-------------\n\t\tif ($last_name=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'Facebook Last Name field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // ------if facebook email not found-------------\n\t\tif ($email=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'Facebook email field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // // ------if facebook picture not found-------------\n\t\t// if ($picture=='') {\n\t\t// \t$this->response([\n\t\t// \t\t'status' => 500,\n\t\t// \t\t'status_message' => 'Facebook picture field is empty. All parameters are required!'\n\t\t// \t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t// \tdie();\n\t\t// }\n\t\t$userData = $_POST;\n\t\t$result = $this->User->checkUser($userData);\n\n\t\tif($result['status']==200){\n\t\t\t$this->response($result, REST_Controller::HTTP_OK);\n\t\t}\n\t\telse{\n\t\t\t$this->response($result, REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t}\n\t}", "public function getActivity(){\n\t\t$activityJSON = json_decode('[{\"actor\":\"Aqib Bhat\",\"timestamp\":1458091459,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458091506,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458862412,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458091625,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458091919,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458855256,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458862529,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1458878187,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1458884355,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1458951476,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1458954501,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459027340,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459031419,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459036422,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459036489,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459036781,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459036803,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459039428,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459041802,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459045348,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459052681,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459054504,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459095354,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459103693,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459106189,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459106464,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459106533,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459106764,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459106972,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459107148,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459107592,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459108612,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459108859,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459116818,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459117841,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459118056,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459119912,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459122951,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459124218,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459128071,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459128266,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459128588,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459130553,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131015,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131354,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131421,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131513,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131527,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131528,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131569,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131625,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131736,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131740,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131839,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131965,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459132001,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459132411,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459132504,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459132807,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459133055,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133405,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133407,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133441,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133465,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133492,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459133507,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459133511,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459133615,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459133644,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133723,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134005,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134041,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134152,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134187,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134206,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134233,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134330,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134408,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134572,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134581,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459135332,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459135440,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459135552,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136058,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136230,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136623,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136624,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136665,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136693,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459136765,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136793,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136793,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136830,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136838,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459136877,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459136892,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136958,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459137061,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459137122,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459137197,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459137245,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459137301,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459137334,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459137389,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459138000,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459138065,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459138075,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459138127,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459138180,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459138599,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459138837,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459138857,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459139196,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459139728,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459139916,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459140265,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459363777,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459363778,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459362805,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459363876,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459372978,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459383363,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459403946,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459885868,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459885870,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459921911,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459922060,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460149101,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460154126,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460165636,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460165636,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460165636,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460165636,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460165710,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460165742,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460165745,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460241854,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460241889,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460072595,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460074050,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460068718,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460074014,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460337658,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460337658,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460337660,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460440021,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460440522,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460496700,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460497103,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500872,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459277007,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459278245,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459320218,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459360248,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459362702,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459374597,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459394150,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459396245,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459398742,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459398854,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459398854,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459398889,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399066,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399094,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399101,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399156,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459399378,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459399529,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459399658,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399739,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400191,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400211,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400630,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400686,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400859,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400924,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400940,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400951,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401103,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401128,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401168,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401174,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459401186,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401215,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401374,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401469,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459401489,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401501,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459402071,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402081,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402195,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402249,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402273,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402542,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402551,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459404536,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459404915,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459405537,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459405603,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459405776,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459405958,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459406030,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459406090,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407004,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407272,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407322,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407476,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407536,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459408828,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459408999,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459413295,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459440105,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459440425,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443054,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459443074,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443102,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443119,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443158,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459443377,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443520,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459443696,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443777,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459446291,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459526366,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459704710,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460072516,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460074115,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460232036,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460246528,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460250345,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460514183,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460518330,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460519779,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460523934,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460232042,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460232451,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460250498,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460307680,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460515263,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460519047,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460520866,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525851,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460249923,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460250313,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460254929,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460515460,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460519269,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525976,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460527887,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460697367,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460680199,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460680217,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460680924,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460680956,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460681107,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460681317,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460681589,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460681787,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460681901,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460682008,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460682069,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460682913,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460684169,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460685921,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460686277,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460686909,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460687575,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460687670,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460689203,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460690237,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460690481,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460690609,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460692290,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460695261,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460727282,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460695587,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460751998,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460680258,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460681907,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460690681,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460694376,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460751892,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460754522,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460756048,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460756512,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460758121,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460843708,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460848382,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460835446,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460842868,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460848973,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460916368,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460924220,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460924373,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460916912,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460917702,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460930922,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460848040,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460849169,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460854613,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460859331,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460916771,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460932451,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460859255,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460859280,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460913502,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460916609,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460933975,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460931001,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460933992,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460690702,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460690703,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460694377,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460746602,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460752225,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460754523,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460833949,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460842616,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460870052,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460948365,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460728899,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460728899,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460752002,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460755659,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460835972,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460951953,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948511,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948773,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948991,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460950548,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951061,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951096,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951251,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460952232,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460955069,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460962897,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460932429,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460934562,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460943791,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460946768,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460950614,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951769,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460957051,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460962696,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461100004,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460511060,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460524256,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525274,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460525288,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525358,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460525714,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525781,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460526586,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460529681,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460952655,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460960195,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460976232,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461017048,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107213,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460932349,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460932358,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461009132,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461014454,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107316,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460052009,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460483549,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460494428,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460526286,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460526459,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460526522,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460526781,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460527491,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460529046,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460603259,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460966099,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461014476,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461107331,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107501,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461110199,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171512,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171535,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171535,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171536,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171587,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171791,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460171791,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460171872,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460173203,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460174200,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460231864,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460239810,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460317732,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460327728,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460335915,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460485984,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460497970,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499694,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499783,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499817,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499822,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499925,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500004,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500014,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500042,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500085,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500311,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460500315,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500324,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500346,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500435,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500437,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500448,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500452,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500571,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500681,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460501404,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460501419,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460501726,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460501788,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460502117,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460502121,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460502786,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460503543,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460504438,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460511336,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460604302,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461104048,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461104939,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461105161,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461105562,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461111320,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461111751,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461112017,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461125417,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460935819,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460935895,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460939457,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460944211,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460944678,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460944850,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460945971,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460946923,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460946934,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460947846,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460947902,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948056,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948148,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948337,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460948348,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460948441,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460949023,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460949429,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460949775,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460949860,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460949890,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460950123,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460950910,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951798,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460958944,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460959747,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460959960,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960040,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960509,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960601,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460960769,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960775,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460960888,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960906,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460961127,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460961179,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460962695,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460963592,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460963712,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460963750,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964200,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964233,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964286,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964291,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460964381,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964535,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964621,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964775,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460965160,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460965298,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461008879,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461090151,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461102204,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461102276,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461102506,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461103526,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461103770,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106489,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106566,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106883,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107063,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107964,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461108055,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461108058,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461108484,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461108808,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109374,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109745,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109832,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109930,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109942,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461110024,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461110276,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110366,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110405,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110546,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110573,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110627,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110664,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461110670,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461110881,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461111111,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111333,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111336,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111443,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111548,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461111613,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111676,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461112065,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461112065,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461112249,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461112463,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461112633,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113065,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113143,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113215,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461113267,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113307,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113583,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461113689,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461114087,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114203,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114228,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114303,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114406,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461114469,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461114737,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114791,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461114933,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114942,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461115117,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461115151,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461116134,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461116244,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461116379,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461119303,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461121523,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461122625,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123034,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123636,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123637,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123772,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461124550,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461126473,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461126859,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461127738,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461127889,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461127906,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461128029,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461128432,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461128741,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461128881,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461128937,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461129510,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461129601,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461129678,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461129937,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461130145,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461130150,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461130151,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461130609,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461130802,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461130854,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461131320,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461131321,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461131381,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461132279,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461192042,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459714753,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459714914,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459716190,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459716437,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459717945,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459721768,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459722848,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459726240,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459732605,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459734819,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459735947,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459736050,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459736143,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459736153,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459736162,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459736467,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459736597,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459736935,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459737023,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459737099,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459737270,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459737278,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459737611,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459737635,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459737842,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459737978,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459738067,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459738069,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459738656,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459738759,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459739000,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459739031,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459739498,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459739838,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459740503,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459740566,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459740906,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459741134,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459741257,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459741342,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459741548,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459741847,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742002,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742020,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742216,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742265,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742380,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742507,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742614,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742616,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743111,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743247,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743427,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743439,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743442,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743464,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459743515,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459743544,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743576,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743660,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743690,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743726,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743847,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743991,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744059,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744091,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744122,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744178,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744192,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744219,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459744297,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459744814,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459744984,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459745200,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459745648,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459745778,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459745958,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746130,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746161,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459746302,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459746437,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746794,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746974,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746980,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747076,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747094,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747099,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747158,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747309,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747384,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747549,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747553,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747584,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747715,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747754,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747762,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747808,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747820,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747851,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747924,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748059,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748121,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748293,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748577,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748922,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748932,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459749300,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459749618,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459749660,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459749784,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459749810,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459749848,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459749890,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750575,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750660,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750704,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750802,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750805,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750928,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751073,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751328,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751362,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751380,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751385,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459751428,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751456,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751497,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751512,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751576,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751611,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459751636,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751748,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752310,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752313,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752578,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752595,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752609,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752688,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752891,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753056,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753081,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753216,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753276,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753388,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753461,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753505,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753580,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460160150,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460166096,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460166197,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460167718,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460167931,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460170970,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460238640,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460258700,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460265851,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460317221,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460326650,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460328076,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460330953,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460331422,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460334550,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460339277,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460431663,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460433944,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460434618,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460435130,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437161,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437306,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437318,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437459,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437631,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437792,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460438236,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460438253,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460439515,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460439574,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460439605,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460493473,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110334,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461126555,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461270347,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461282613,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461333782,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461333842,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461333854,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461371326,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460503714,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460503724,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460524255,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460529582,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460607330,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460607349,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460608706,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460609058,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460609081,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460609377,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460609586,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460610035,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460611953,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460612043,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460612347,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460612695,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460612713,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460613973,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460614117,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460614588,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460615071,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460615101,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460615167,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461109673,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461818721,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461882154,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882267,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882298,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882690,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882832,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882881,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461883332,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461883566,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461883568,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461885826,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461887194,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460482203,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460482528,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460495947,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460496869,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460517967,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460608470,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461101191,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106233,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106428,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106538,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109904,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110836,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461115060,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461115156,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461115382,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123212,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461127141,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461132965,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461134296,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461188023,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461253841,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461275430,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461282388,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461291029,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461299970,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461307230,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461338321,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461341524,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461361910,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461376273,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461378319,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461384392,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461388841,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461422894,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461437636,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461448456,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461474362,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461480100,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461482202,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461505503,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461524155,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461534168,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461537084,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461539241,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461539665,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461540182,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461544687,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461550993,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461559744,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461563898,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461708868,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461819989,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461861185,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461874701,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461881867,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461893239,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461894417,\"source\":\"googledrive\"}]');\n\t\treturn $activityJSON;\n\t}", "public function getPhotofeedInfoAction()\n {\n\t $params = $this->getRequest()->getParams();\n\t \n \t \t$result = \\Extended\\wall_post::getWallpostInfo( $params['wallpost_id'] );\n \t \n\t\techo Zend_Json::encode( $result );\n\t die;\n }", "function set_business_activity($submit_activities, $activities){\n\t\tif( isset($_POST[$submit_activities]) ){\n\t\t\t$business_activity = $_POST[$activities];\n\t\t\tuser::update_business_activity($business_activity);\n\n\t\t\t\theader(\"location: ../../basic_info.php\");\n\t\t} \t\n\t}", "function pushjsonaction($params){\n $this->view = new helper_viewhelper();\n $this->view->print_r($params);\n\n\t\t$this->config = new model_core_config();\n $this->modeljson = new model_ext_json();\n $this->requestobj = new model_ext_request($this->modeljson->toobj($params));\n $this->view->print_r($this->requestobj);\n\t\t$this->modelmysql = new model_ext_mysql($this->config);\n\t\t$this->requestobj->pushdata($this->modeljson->toobj($this->requestobj->pullrequestparam()));\n\t\t// $this->view->print_r($this->requestobj);\n\t\t$this->result = $this->modelmysql->processrequest($this->requestobj);\n\t\t// $this->view->print_r($this->result);\n\t}", "function facebook_user_check_post() \n\t{ \n\t\t$fb_id=$this->post('fb_id');\n\t\t$fullname=$this->post('fullname');\n\t\t$email=$this->post('email');\n\t\t$data=$this->users_model->get_by_fb_id($fb_id);\n\t\tif($data==null){\n\t\t\t$this->response(array('ok'=>'0'));\n\t\t}else{\n\t\t\t$this->response($this->users_model->get_by_fb_id($fb_id));\n\t\t}\n\t}", "function wall()\n\t\t{\n\t\t\n\t\t// Parameters\n \t$limit = (! $this->EE->TMPL->fetch_param('limit')) ? 5 : $this->EE->TMPL->fetch_param('limit');\n \t$pageId = $this->EE->TMPL->fetch_param('page');\n\t\t\t\n\t\t// Page feed data and display\n\t\t$pageUrl = 'https://graph.facebook.com/'.$pageId.'/feed?limit='.$limit;\n\t\t$page = file_get_contents($pageUrl);\n\t\t$obj = json_decode($page);\n\t\t\n\t\t$output = '';\n\t\t\t\n\t\tforeach ($obj->data as $data) {\n\t\t\t// Display outpu if the type of Facebook entry is a status update\n\t\t\tif (($data->type) == 'status' && isset($data->from->id) && isset($data->from->name)) {\n\t\t\t\t$HTMLpattern = \"/http:\\/\\/([a-z0-9\\-]*)(\\.)+(com|net|org)/\";\n\t\t\t\t\n\t\t\t\t// This checks for apps that post and include HTML links. It will format the link and display. Else statement posts message as is.\n\t\t\t\tif (isset($data->application->id) && preg_match($HTMLpattern, ($data->message))) {\n\t\t\t\t\t$words = explode(' ', ($data->message));\n\t\t\t\t\tforeach ($words as &$text) {\n\t\t\t\t\t\tif (preg_match('/^http:\\/\\//', $text)) {\n\t\t\t\t\t\t\t$text = '<a href=\"'.$text.'\">'.$text.'</a>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$message = implode(' ', $words);\n\t\t\t\t\t$output .= '<br /><div class=\"fb_status\"><span class=\"fb_profile_link\"><a href=\"http://www.facebook.com/profile.php?id='.\"{$data->from->id}\".'\">'.\"{$data->from->name}\".'</a></span> '.\"<div class='fb_message'>$message</div>\".'<br /></div>';\n\t\t\t\t} else {\n\t\t\t\t\t$output .= '<br /><div class=\"fb_status\"><span class=\"fb_profile_link\"><a href=\"http://www.facebook.com/profile.php?id='.\"{$data->from->id}\".'\">'.\"{$data->from->name}\".'</a></span> '.\"<div class='fb_message'>{$data->message}</div>\".'<br /></div>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Display output if the type of Facebook entry is a photo or video\n\t\t\tif (($data->type) == 'photo' || ($data->type) == 'video' && isset($data->from->id) && isset($data->from->name)) {\n\t\t\t\t$output .= '<br /><div class=\"fb_status\"><span class=\"fb_profile_link\"><a href=\"http://www.facebook.com/profile.php?id='.\"{$data->from->id}\".'\">'.\"{$data->from->name}\".'</a></span> ';\n\t\t\t\tif (isset($data->message)) {\n\t\t\t\t\t$output .= \"<div class='fb_message'>{$data->message}</div>\\n\".'<br />';\n\t\t\t\t\t$output .= '<div class=\"fb_photo\"><a href=\"'.\"{$data->link}\".'\"><img src=\"'.\"{$data->picture}\".'\" /></a></div></div>';\n\t\t\t\t} else {\n\t\t\t\t\t$output .= '<div class=\"fb_photo\"><a href=\"'.\"{$data->link}\".'\"><img src=\"'.\"{$data->picture}\".'\" /></a></div></div>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Display output if the type of Facebook entry is a link\n\t\t\tif (($data->type) == 'link' && isset($data->from->id) && isset($data->from->name)) {\n\t\t\t\t$output .= '<br /><div class=\"fb_status\"><span class=\"fb_profile_link\"><a href=\"http://www.facebook.com/profile.php?id='.\"{$data->from->id}\".'\">'.\"{$data->from->name}\".'</a></span> ';\n\t\t\t\tif (isset($data->message)) {\n\t\t\t\t\t$output .= \"<div class='fb_message'>{$data->message}</div>\\n\".'<br />';\n\t\t\t\t\t$output .= '<div class=\"fb_link\"><a href=\"'.\"{$data->link}\".'\">'.\"{$data->name}\\n\".'</a></div></div>';\n\n\t\t\t\t} else {\n\t\t\t\t\t$output .= '<div class=\"fb_link\"><a href=\"'.\"{$data->link}\".'\">'.\"{$data->name}\\n\".'</a></div></div>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Display date information for posts\t\t\t\t\n\t\t\t$postTime = date('M d, Y',strtotime($data->created_time));\n\t\t\t$output .= '<div class=\"fb_time\">'.$postTime.'</div>';\n\t\t}\n\t\t\t\n\t\treturn $output;\n\t\t}", "function addUserRecognizedActivity(){\n\n\t\tglobal $dclserver;\n\t\t$url=\"$dclserver/MMDataCurationRestfulService/webresources/InformationCuration/AddUserRecognizedActivity\";\n\t\t\n\t\t$data = array(\"userRecognizedActivityId\"=>NULL,\n\t\t\"userId\"=>39,\n\t\t\"activityId\"=>2,\n\t\t\"startTime\"=>\"2015 05 05 16:58:56\",\n\t\t\"endTime\"=>\"2015 05 05 16:58:59\",\n\t\t\"duration\"=>3\n\t\t\n\t\t);\n\t\t\n\t\n\t$json = json_encode($data,true);\n\t\n\t$result =postJsonRest($url,$json);\n\t\n\treturn $result;\n\n\t\t\n}", "function extractActionData($data) {\n $fields = array(\n 'surfer_handle',\n 'surfer_givenname',\n 'surfer_surname',\n 'surfer_email',\n 'surfer_valid',\n 'surfergroup_id',\n 'surfer_gender',\n 'surfer_avatar'\n );\n $result = array();\n foreach ($fields as $field) {\n if (isset($data[$field])) {\n $result[$field] = $data[$field];\n }\n }\n return $result;\n }", "public function handleFacebookCallback()\n {\n \n $user = Socialite::driver('facebook')->user();\n\n \n }", "function before() {\n\t\tparent::before();\n\t\t$this->_activity_result[] = $this->request->param(\"id\");\n\t}" ]
[ "0.60599965", "0.5757755", "0.55691695", "0.5533957", "0.5504438", "0.5462942", "0.54532325", "0.5416127", "0.5404493", "0.5373595", "0.5363646", "0.5363174", "0.5360115", "0.5357556", "0.53428733", "0.52425456", "0.5230426", "0.5222235", "0.5203201", "0.5192375", "0.51791835", "0.5169486", "0.5156608", "0.5136518", "0.51263493", "0.51134735", "0.51094884", "0.5109024", "0.51028985", "0.5101537" ]
0.6309429
0
check response error from facebook graph api
private function facebookResponseCheck($result) { if(!empty($result->error)) { $type = isset($result->error->type) ? $result->error->type : ''; $code = isset($result->error->code) ? $result->error->code : ''; $message = isset($result->error->message) ? $result->error->message : ''; $msg = sprintf('type: %s, $code: %s, message: %s', $type, $code, $message); throw new Exception($msg); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_error() \n\t\t{\n\t\t\t\t$json = json_decode( $this->response );\n\t\t\t\tif( $json->faultstring )\n\t\t\t\t{\n\t\t\t\t\t\t$this->error = $json->faultstring;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\treturn false;\n\n\t\t}", "public function has_http_error($response) {\n if(!$response || !isset($response['response']['code']) || !preg_match('/20*/', $response['response']['code']) || !isset($response['body'])) {\n return true;\n }\n return false;\n }", "private function is_api_error( $response ) {\n\t\tif ( false === $response ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! is_object( $response ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( isset( $response->error ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "protected function checkResponse($r){\n if (!is_array($r) || !array_key_exists('code', $r)){\n $this->log(\"No Response found\",'Warning');\n return false;\n }\n if ($r['code'] == 200){\n return true;\n } else {\n $xml = simplexml_load_string($r['body'])->Error;\n $this->log(\"Bad Response! \".$r['code'].\" \".$r['error'].\": \".$xml->Code.\" - \".$xml->Message,'Urgent');\n return false;\n }\n }", "private function error($response) {\n\t\tif(property_exists($response, \"error\") AND $response->code != 200) {\n\t\t\tthrow new MystoreAPI_exception(\"Error \".$response->code.\"<br />\".$response->error->message);\n\t\t}\n\t}", "private function checkTokenWithFacebook($accessToken){\r\n\r\n $url = Laracurl::buildUrl('https://graph.facebook.com/app', ['access_token'=>$accessToken]);\r\n $response = Laracurl::get($url);\r\n if(!empty($response) && !empty($response->body)){\r\n $fbResult = json_decode($response->body, true);\r\n if(!empty($fbResult['id']) && $fbResult['id'] == env('FB_APP_KEY')){//this user come from our facebook app\r\n $url = Laracurl::buildUrl('https://graph.facebook.com/me', ['fields'=> 'id,name,gender,email,age_range', 'access_token'=>$accessToken]);\r\n $response = Laracurl::get($url);\r\n if(!empty($response) && !empty($response->body)) {\r\n $fbResult = json_decode($response->body, true);\r\n if (!empty($fbResult['id'])) {\r\n return $fbResult;\r\n }\r\n }\r\n }\r\n }\r\n return null;\r\n }", "public static function create(FacebookResponse $response)\n {\n $data = $response->getDecodedBody();\n\n if (!isset($data['error']['code']) && isset($data['code'])) {\n $data = ['error' => $data];\n }\n\n $code = isset($data['error']['code']) ? $data['error']['code'] : null;\n $message = isset($data['error']['message']) ? $data['error']['message'] : 'Unknown error from Graph.';\n\n if (isset($data['error']['error_subcode'])) {\n switch ($data['error']['error_subcode']) {\n // Other authentication issues\n case 458:\n case 459:\n case 460:\n case 463:\n case 464:\n case 467:\n return new static($response, new FacebookAuthenticationException($message, $code));\n // Video upload resumable error\n case 1363030:\n case 1363019:\n case 1363037:\n case 1363033:\n case 1363021:\n case 1363041:\n return new static($response, new FacebookResumableUploadException($message, $code));\n }\n }\n\n switch ($code) {\n // Login status or token expired, revoked, or invalid\n case 100:\n case 102:\n case 190:\n return new static($response, new FacebookAuthenticationException($message, $code));\n\n // Server issue, possible downtime\n case 1:\n case 2:\n return new static($response, new FacebookServerException($message, $code));\n\n // API Throttling\n case 4:\n case 17:\n case 32:\n case 341:\n case 613:\n return new static($response, new FacebookThrottleException($message, $code));\n\n // Duplicate Post\n case 506:\n return new static($response, new FacebookClientException($message, $code));\n }\n\n // Missing Permissions\n if ($code == 10 || ($code >= 200 && $code <= 299)) {\n return new static($response, new FacebookAuthorizationException($message, $code));\n }\n\n // OAuth authentication error\n if (isset($data['error']['type']) && $data['error']['type'] === 'OAuthException') {\n return new static($response, new FacebookAuthenticationException($message, $code));\n }\n\n // All others\n return new static($response, new FacebookOtherException($message, $code));\n }", "public function hasError()\n {\n return $this->info['http_code'] != '200';\n }", "public function Access_error ()\n\t\t{\n\t\t\t$errMsg[0]['error'] = \"Invalid URL!\";\n\t\t\treturn json_encode ($errMsg);\n\t\t}", "public static function checkError($resp) {\n\t}", "public static function checkError($resp) {\n\t}", "public function testError()\n {\n $error = $this->response->error(404, 'File Not Found');\n json_decode($error);\n $checkJson = (json_last_error() == JSON_ERROR_NONE);\n\n $this->assertTrue($checkJson);\n }", "function is_error ( $res ) {\n if ( is_numeric( $res ) && $res < 0 ) return $res;\n else if ( is_array( $res ) && isset( $res['code'] ) && $res['code'] < 0 ) return $res['code'];\n else if ( $res === FALSE ) return TRUE;\n else return false;\n}", "public function checkUser_post(){\n\t\textract($_POST);\n\t\t//print_r($_POST);die();\n\t\t$oauth_provider='facebook';\n\t\t// ------if facebook oauth provider not found-------------\n\t\tif ($oauth_provider=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'OAuth provider field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // ------if facebook oauth uid not found-------------\n\t\tif ($oauth_uid=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'OAuth UID field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // ------if facebook First Name not found-------------\n\t\tif ($first_name=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'Facebook First Name field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // ------if facebook Last Name not found-------------\n\t\tif ($last_name=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'Facebook Last Name field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // ------if facebook email not found-------------\n\t\tif ($email=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'Facebook email field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // // ------if facebook picture not found-------------\n\t\t// if ($picture=='') {\n\t\t// \t$this->response([\n\t\t// \t\t'status' => 500,\n\t\t// \t\t'status_message' => 'Facebook picture field is empty. All parameters are required!'\n\t\t// \t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t// \tdie();\n\t\t// }\n\t\t$userData = $_POST;\n\t\t$result = $this->User->checkUser($userData);\n\n\t\tif($result['status']==200){\n\t\t\t$this->response($result, REST_Controller::HTTP_OK);\n\t\t}\n\t\telse{\n\t\t\t$this->response($result, REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t}\n\t}", "function is_json_error( $json ) {\n\treturn isset_not_empty( $json, 'code' ) && isset_not_empty( $json, 'message' ) && get_array_var( $json, 'code' ) !== 'success';\n}", "private function checkResponseStatus($response, $format)\n {\n $status = $this->curlLib->getStatus();\n if ( $status >= 400 ){\n switch($format){\n case 'json':\n default:\n $data = json_decode($response);\n if ( $status >= 500 ){\n if ( $data === null ){\n throw new PipeStackServerException('A server error has occurred. Please try again soon.');\n }\n throw new PipeStackServerException($this->jsonException($data));\n }\n switch($status){\n case 400:\n case 405:\n if ( $data === null ){\n throw new PipeStackRequestException('Invalid request. Please double check parameters and request method.');\n }\n throw new PipeStackRequestException($this->jsonException($data));\n case 401:\n case 403:\n if ( $data === null ){\n throw new PipeStackPermissionException('Invalid permissions and/or authorization. Please check your access token verify endpoint permission requirements.');\n }\n throw new PipeStackPermissionException($this->jsonException($data));\n\n case 404:\n if ( $data === null ){\n throw new PipeStackRequestException('You have requested an endpoint which does not exist. Please double check the endpoint parameter and try again.');\n }\n throw new PipeStackRequestException($this->jsonException($data));\n break;\n default:\n if ( $data === null ){\n throw new PipeStackException('An unknown PipeStack API error has occurred. Please contact PipeStack customer service.');\n }\n throw new PipeStackException($this->jsonException($data));\n break;\n }\n break;\n }\n }\n }", "public function isAPICallLimitErr() {\n // create implementation of this function inside gogoLib for trademe\n // it's easier to hook it there for api call limit checks\n // also if call limit occurs. create log at /var/tragento/apicalllimit.log\n // with dates. than when running new cron process check if date in call is less than 1 hour.\n // actually check if it is in current hour. if current hour than don't execute tragento cron\n // it's nice but requires coding time. don't overcomplicate error handling\n\n // $response->is_ok()\n // $response->error_message()\n // You have exceeded your API call quota for the current hour\n // it's a state for the life of trademe model. when api limit reached it can't be changed to ok later.\n // hovewer in next 5 minutes there will be another call from cron with clear state\n return $this->trademe->isAPICallLimitErr();\n }", "protected static function isErrorApiResponse($response): bool\n {\n return property_exists($response, 'status_code') &&\n property_exists($response, 'status') &&\n $response->status === 'failed';\n }", "public function check_social() {\n\n $facebook_client_id = envfile('FB_CLIENT_ID');\n $facebook_client_secret = envfile('FB_CLIENT_SECRET');\n $facebook_call_back = envfile('FB_CALL_BACK');\n\n $google_client_id = envfile('GOOGLE_CLIENT_ID');\n $google_client_secret = envfile('GOOGLE_CLIENT_SECRET');\n $google_call_back = envfile('GOOGLE_CALL_BACK');\n\n $fb_status = false;\n\n if (!empty($facebook_client_id) && !empty($facebook_client_secret) && !empty($facebook_call_back)) {\n\n $fb_status = true;\n\n }\n\n $google_status = false;\n\n if (!empty($google_client_id) && !empty($google_client_secret) && !empty($google_call_back)) {\n\n $google_status = true;\n\n }\n\n return response()->json(['fb_status'=>$fb_status, 'google_status'=>$google_status]);\n \n }", "public function test_token_invalid() {\n\t\t$this->uri->rsegments[3] = 'b';\n\t\tset_valid_authorization();\n\t\t$out = run_action($this->c, 'token');\n\n\t\t$json = json_decode($out, true);\n\n\t\t$this->assertTrue($json['error']);\n\t\t$this->assertFalse(array_key_exists('opportunity', $json));\n\t\t$this->assertFalse(array_key_exists('opportunities', $json));\n\t}", "public function validateResponseApi($response)\n {\n //Get response\n $data = json_decode($response->content());\n\n //If there is errors, throw error\n if (isset($data->errors))\n throw new Exception($data->errors, $response->getStatusCode());\n else {//if response is successful, return response\n return $data->data;\n }\n }", "public function validateResponse($response): bool\n {\n if (null === $response) {\n return false;\n }\n\n if (200 === ($statusCode = $response->getStatusCode())) {\n return true;\n }\n\n $responseContents = $response->getBody()->getContents();\n if (400 === $statusCode) {\n \\Yii::error(ErrorsHelper::getStatusCodeErrorMessage($statusCode, $responseContents, $this), ErrorsHelper::GUZZLE_HTTP_CLIENT_ERROR);\n \\Yii::error('Something in the request data was wrong: check if all data{...}values are converted to strings.', ErrorsHelper::GUZZLE_HTTP_CLIENT_ERROR);\n $this->setErrorStatusDescription(ErrorsHelper::STATUS_CODE_400, $responseContents);\n\n return false;\n }\n\n if (401 === $statusCode) {\n \\Yii::error(ErrorsHelper::getStatusCodeErrorMessage($statusCode, self::UNAUTHORIZED_REQUEST_EXCEPTION_MESSAGE, $this), ErrorsHelper::GUZZLE_HTTP_CLIENT_ERROR);\n \\Yii::error('To use the new FCM HTTP Legacy API, you need to enable FCM API on your Google API dashboard first - https://console.developers.google.com/apis/library/fcm.googleapis.com/.', ErrorsHelper::GUZZLE_HTTP_CLIENT_ERROR);\n $this->setErrorStatusDescription(ErrorsHelper::STATUS_CODE_403, $responseContents);\n return false;\n }\n\n \\Yii::error(ErrorsHelper::getStatusCodeErrorMessage($statusCode, $responseContents, $this), ErrorsHelper::GUZZLE_HTTP_CLIENT_OTHER_ERRORS);\n $this->setErrorStatusDescription(ErrorsHelper::OTHER_STATUS_CODES, $responseContents);\n $this->setRetryAfter($response);\n\n return false;\n }", "function facebook_user_check_post() \n\t{ \n\t\t$fb_id=$this->post('fb_id');\n\t\t$fullname=$this->post('fullname');\n\t\t$email=$this->post('email');\n\t\t$data=$this->users_model->get_by_fb_id($fb_id);\n\t\tif($data==null){\n\t\t\t$this->response(array('ok'=>'0'));\n\t\t}else{\n\t\t\t$this->response($this->users_model->get_by_fb_id($fb_id));\n\t\t}\n\t}", "private function validateAccessToken() {\n $this->userID = $this->facebook->getUser();\n }", "private function tokenNotFoundError() {\n return response()->json([\n 'error' => 'Either your email or token is wrong.'\n ], Response::HTTP_UNPROCESSABLE_ENTITY);\n }", "function media_theplatform_mpx_check_json_response($response, $service) {\n // No response\n if(!strlen($response))\n return array('status' => 'error', 'response' => t('No response from @service', array('@service' => $service)));\n // Decode JSON\n $responseObject = json_decode($response);\n // Make sure the response decodes, if not, return it's text\n if(!is_object($responseObject))\n return array('status' => 'error', 'response' => t('Error response from @service: @response', array('@service' => $service, '@response' => $response)));\n // Check for an exception on the response, return it's description if set\n if(property_exists($responseObject, 'isException'))\n return array('status' => 'error', 'response' => t('Exception from @service: @response', array('@service' => $service, '@response' => $responseObject->description)));\n // Looking good, return the response object\n else\n return array('status' => 'success', 'response' => $responseObject);\n}", "public function error(BaseResponse $response);", "public function isError(): bool\n {\n return $this->get('json', 'error') === true;\n }", "protected function handleJsonRpcErrors($response) {\n if (isset($response->error)) {\n $error = $response->error;\n switch($error->code) {\n case -32601:\n throw new JsonRpcException($error->message, $error->code);\n case -32602:\n throw new JsonRpcException(\n $error->message, $error->code);\n default:\n throw new JsonRpcException(\n $error->message.\"\\nStacktrace : \" . $error->data->stacktrace,\n $error->code);\n }\n }\n }", "protected function handleFacebookException($exception)\n {\n return false;\n }" ]
[ "0.6256429", "0.6234275", "0.62125367", "0.6202816", "0.619115", "0.6112488", "0.59841853", "0.59429115", "0.59417385", "0.5915669", "0.5915669", "0.5914272", "0.5861633", "0.5848695", "0.5822073", "0.57939005", "0.5764143", "0.574654", "0.5718953", "0.5672794", "0.56537724", "0.5609037", "0.5580286", "0.55712223", "0.5567401", "0.55638593", "0.55472225", "0.5546991", "0.55399513", "0.5535256" ]
0.73957115
0
Returns an IntersectionIterator containing elements in $this that are also in $iterable
public function intersection($iterable, $strategy = null);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function of(iterable $iterable): self {\n\t\t$generator = function () use ($iterable) {\n\t\t\tforeach ($iterable as $item) {\n\t\t\t\tyield $item;\n\t\t\t}\n\t\t};\n\t\treturn new self($generator());\n\t}", "public function intersect(iterable $items): self\n {\n $items = Factory::getArrayForItems($items);\n\n return Factory::create(array_intersect($this->items, $items));\n }", "private function wrapIterable(iterable $iterable): Generator\n {\n foreach ($iterable as $key => $value) {\n yield $key => $value;\n\n $this->iteratorAdvanced = true;\n }\n\n $this->iterator = null;\n }", "public function getIterable() : Iterable {\n\n\t\treturn $this->innerIterable;\n\t}", "abstract protected function _normalizeIterable($iterable);", "public function appendedAll(iterable $that): Set;", "public function getIterator()\n {\n foreach ($this->iterable as $item) {\n yield $item;\n }\n }", "public function iterable(): iterable\n {\n return $this->array;\n }", "public function iterator()\n {\n $i = new CollectionIterator($this);\n return $i;\n }", "public function getIterator(): \\ArrayIterator\n {\n return $this->iterable ?? $this->iterable = new \\ArrayIterator($this->doMerge('', new static()));\n }", "public function attach(Traversable $iterable)\n {\n $this->iterable = $iterable;\n }", "public function getIterator()\n {\n return new ArrayIterator($this->elements);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->elements);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->elements);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->_elements);\n }", "public abstract function toIterable(): iterable;", "public function getIterator()\n {\n return $this->multi()->load();\n }", "function getInnerIterator()\n\t{\n\t\treturn $this->iterator;\n\t}", "public function getIterator()\n {\n return new \\ArrayIterator($this->elements(true));\n }", "public function merge(iterable $items, bool $inPlace = false): self\n {\n $collection = $inPlace ? $this : clone $this;\n foreach ($items as $key => $value) {\n $collection->set($key, $value);\n }\n\n return $collection;\n }", "public function intersect(PageCollectionInterface $collection)\n {\n $array1 = $this->items;\n $array2 = $collection->toArray();\n\n $this->items = array_uintersect($array1, $array2, function ($val1, $val2) {\n return strcmp($val1['slug'], $val2['slug']);\n });\n\n return $this;\n }", "public function getIterator()\n {\n return new ArrayIterator($this->entities);\n }", "public static function is_iterable($input)\n {\n }", "public function getIterator()\n {\n return new ArrayIterator($this->toArray());\n }", "public function intersectKeys(iterable $items): self\n {\n $items = Factory::getArrayForItems($items);\n\n return Factory::create(array_intersect_key($this->items, $items));\n }", "public function zip(iterable ...$iterables): Collection;", "public function getIterator()\n {\n return new \\ArrayIterator($this);\n }", "public function getIterator() {\n return new ArrayIterator($this->getAll());\n }", "function getiterator() {\n\t\treturn new \\ArrayIterator($this->cast());\n\t}", "public function concat(iterable $stream): Stream {\n\t\t$generator = function (iterable $stream) {\n\t\t\tforeach ($this as $element) {\n\t\t\t\tyield $element;\n\t\t\t}\n\t\t\tforeach ($stream as $element) {\n\t\t\t\tyield $element;\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($stream));\n\t}" ]
[ "0.6072463", "0.60437727", "0.6029325", "0.5887875", "0.579804", "0.55278397", "0.54709667", "0.546725", "0.5455278", "0.54440105", "0.5418173", "0.5389925", "0.5389925", "0.5389925", "0.538118", "0.53732204", "0.5365471", "0.53622234", "0.536218", "0.5348531", "0.5331685", "0.53064966", "0.5303901", "0.5301225", "0.52770185", "0.52636224", "0.52221316", "0.5212484", "0.51880693", "0.51844674" ]
0.64896554
0
return get_theme_option(OP_ENTRY_CARD_EXCERPT_MORE, __( '...', THEME_NAME ));
function get_entry_card_excerpt_more(){ return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function themify_custom_excerpt_more($more) {\n global $post;\n return '';\n}", "function xkit_the_theme_option( $field_name, $default = '' ){\n\tprint xkit_get_theme_option( $field_name, $default );\n}", "function codium_extend_excerpt_more($more) {\n global $post;\n $readmore = __('Czytaj wiecej', 'codium_extend' );\n return '';\n}", "function codium_extend_excerpt_more($more) {\n global $post;\n $readmore = __('Czytaj wiecej', 'codium_extend' );\n return '';\n}", "function custom_excerpt_more( $more ) {\r\n\t return '...';\r\n}", "function deco_display_theme_credit(){\n\t\t$theme_credit=get_theme_option('Theme Credit');\n\t\t$credit_text=' | <a href=\"http://jeffersonsnewspaper.org/2010/deco-an-omeka-theme/\" title=\"Deco theme\">Deco theme</a> by <a href=\"http://twitter.com/ebellempire/\" title=\"@ebellempire\">E. Bell</a>';\n\t\tif ($theme_credit == 'yes')return $credit_text;\n}", "function new_excerpt_more( $more ) {\n\treturn '&hellip;';\n/*\n\tif(is_front_page()){\n\treturn '&nbsp;<span class=\"genericon genericon-next\"></span>';\t\t\n\t} else {\n\treturn '&hellip;';\n\t}\n*/\n}", "function zeen_get_theme_option( $option = '', $default = '' ) {\n\n\treturn get_theme_mod( $option, $default );\n\n}", "function inkpro_add_shop_display_options( $options ) {\r\n\r\n\tif ( class_exists( 'WooCommerce' ) ) {\r\n\t\t$options['loren'] = esc_html__( 'Loren', 'inkpro' );\r\n\t\t$options['agathe'] = esc_html__( 'Agathe', 'inkpro' );\r\n\t}\r\n\r\n\treturn $options;\r\n}", "function ppo_excerpt_more($more) {\n $link = sprintf('<a href=\"%1$s\" class=\"more-link\">%2$s</a>', esc_url(get_permalink(get_the_ID())),\n /* translators: %s: Name of current post */ \n sprintf(__('Xem thêm <span class=\"meta-nav\">&rarr;</span>', SHORT_NAME))\n );\n return ' &hellip; ' . $link;\n}", "function deco_get_about($about = null)\n{ \n if (!$about) {\n \n $about = get_theme_option('About') ? \n get_theme_option('About') : \n 'Add some text about your site in theme options. You can use HTML!';\n }\n \n return $about; \n \n}", "function wpdocs_excerpt_more( $more ) {\n return ' ...';\n}", "function et_excerpt_more($more) {\n global $post;\n return '<div class=\"view-full-post\"><a href=\"'. get_permalink($post->ID) . '\" class=\"view-full-post-btn\">Skaityti</a></div>';\n}", "function HERITAGE_general_options_callback() {\n ?>\n <p>\n <?php echo esc_html__('Setup custom logo.', 'heritage'); ?>\n </p>\n <?php\n /*print theme settings*/\n if (LC_SWP_PRINT_SETTINGS) {\n $general = get_option('heritage_theme_general_options');\n\n ?>\n <pre>heritage_theme_general_options:\n\t\t\t<?php echo (json_encode($general)); ?>\n\t\t</pre>\n <?php\n }\n}", "function new_excerpt_more($more) {\n global $post;\n // return '<a class=\"read_more\" href=\"'. get_permalink($post->ID) . '\">'.__('Read More','textdomain').'</a>';\n return '';\n}", "function custom_desktop_excerpt_more($more) {\n}", "function premise_homehero_services(){\n\t if( get_theme_mod( 'premise_homehero_services') != \"\" ) {\n\t\techo get_theme_mod( 'premise_homehero_services');\n\t }\n}", "function et_excerpt_more($more) {\n global $post;\n return '<div><a href=\"'. get_permalink($post->ID) . '\" > ... Click to View Full Post</a></div>;';\n}", "function mila_custom_excerpt_more($more) {\n global $post;\n return '&nbsp;<div class=\"more-link\"><a href=\"'. get_permalink($post->ID) . '\">'. __('<i title=\"Läs mer\" class=\"fa fa-arrow-circle-right\"></i>', 'mila') .'</a></div>';\n }", "function ajb_get_options_page_cap() {\n return 'edit_theme_options';\n}", "function premise_who_are_you(){\n\t if( get_theme_mod( 'premise_who_are_you') != \"\" ) {\n\t\techo get_theme_mod( 'premise_who_are_you');\n\t }\n}", "function excerpt_read_more_link($output) {\r\n global $post;\r\n return $output . '<a class=\"more-link\" href=\"'. get_permalink($post->ID) . '\">'.__(\"Keep Reading\",TEXTDOMAIN ).'<span class=\"icon-arrow-right5\"></span></a>';\r\n}", "function custom_excerpt_more( $more ) {\n\tif ( is_home() ) {\n\t\treturn false;\n\t}\n\treturn \"&hellip;\";\n}", "function cultiv8_option( $option, $default = false ) {\n\tif( class_exists( 'CTC_Extender' ) && ctcex_has_option( $option ) )\n\t\treturn ctcex_get_option( $option, $default );\n\t\n\treturn get_theme_mod( $option, $default );\n}", "function new_excerpt_more( $more ) {\n return '';\n}", "function custom_excerpt_more($more) {\n\t\treturn 'Read More &raquo;';\n\t}", "function new_excerpt_more($more) {\n global $post;\n\treturn ' <a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\">[ more ]</a>';\n}", "function wfs_excerpt_more( $more ) {\n return '...';\n}", "function medigroup_mikado_read_more_button($option = '', $class = '') {\n if($option != '') {\n $show_read_more_button = medigroup_mikado_options()->getOptionValue($option) == 'yes';\n } else {\n $show_read_more_button = 'yes';\n }\n if($show_read_more_button && !medigroup_mikado_post_has_read_more() && !post_password_required()) {\n echo medigroup_mikado_get_button_html(array(\n 'size' => 'small',\n 'link' => get_the_permalink(),\n 'text' => esc_html__('Read More', 'medigroup'),\n 'custom_class' => $class\n ));\n }\n }", "function techfak_get_theme_options() {\n\treturn get_option( 'techfak_theme_options', techfak_get_default_theme_options() );\n}" ]
[ "0.6736971", "0.66720587", "0.6604045", "0.6604045", "0.6576243", "0.6531921", "0.6482173", "0.643697", "0.6405216", "0.6401118", "0.63861144", "0.6364165", "0.6323433", "0.6321211", "0.63200486", "0.6283958", "0.6236837", "0.6235942", "0.62268674", "0.6214131", "0.61934173", "0.6170808", "0.6159437", "0.6157571", "0.61513984", "0.61396676", "0.61298186", "0.61234206", "0.6121933", "0.6113058" ]
0.72823095
0
Method to store valdiation filter rules
public static function filter($rules) { static::$filters[] = $rules; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function getRules() {\n return [\n 'imeArtikla' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'cenaArtikla' => FILTER_VALIDATE_FLOAT,\n 'opisArtikla' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'kategorijaArtikla' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'zalogaArtikla' => FILTER_VALIDATE_FLOAT,\n \n /*'year' => [\n 'filter' => FILTER_VALIDATE_INT,\n 'options' => [\n 'min_range' => 1800,\n 'max_range' => date(\"Y\")\n ]\n ]*/\n ];\n \n }", "public function setupFilterRules()\n { }", "abstract public function filters();", "public function rules()\n\t{\n\t\treturn [\n\t\t\t'by' => [\n\t\t\t\t'required',\n\t\t\t\tRule::in(array_keys(config('filter.by'))),\n\t\t\t],\n\t\t\t'tech' => [\n\t\t\t\t'required_if:by,node',\n\t\t\t\t'required_if:by,province',\n\t\t\t\t'required_if:by,zone',\n\t\t\t\tRule::in($this->getArrayFrom('technologies'))\n\t\t\t],\n\t\t\t'vendor' => [\n\t\t\t\t'required_if:by,province',\n\t\t\t\t'required_if:by,zone',\n\t\t\t\tRule::in($this->getArrayFrom('vendor'))\n\t\t\t],\n\t\t\t'end_date' => [\n\t\t\t\t'required',\n\t\t\t\t'date_format:\"Y-m-d H:i\"',\n\t\t\t],\n\t\t\t'for' => [\n\t\t\t\t'required',\n\t\t\t\tRule::in(array_keys(config('filter.for')))\n\t\t\t],\n\t\t\t'resolution' => [\n\t\t\t\t'required',\n\t\t\t\tRule::in($this->getResolutions(request()->get('for'))),\n\t\t\t],\n\t\t\t'zone' => [\n\t\t\t\t'required_if:by,zone',\n\t\t\t\tRule::in(array_pluck(config('filter.zones'), 'value'))\n\t\t\t],\n\t\t\t'zone_aggregate' => [\n\t\t\t\t'required_if:by,zone',\n\t\t\t\tRule::in($this->getAggregates())\n\t\t\t],\n\t\t\t'values' => [\n\t\t\t\t'required_unless:by,zone',\n\t\t\t]\n\t\t];\n\t}", "abstract protected function getFilters();", "public function rules($data);", "private function filters() {\n\n\n\t}", "public static function getRules() {\n return [\n 'title' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'author' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'description' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'price' => FILTER_VALIDATE_FLOAT,\n 'year' => [\n 'filter' => FILTER_VALIDATE_INT,\n 'options' => [\n 'min_range' => 1800,\n 'max_range' => date(\"Y\")\n ]\n ]\n ];\n }", "public function rules();", "public function rules();", "public function rules();", "protected abstract function rules();", "private function defineFilters() {\n\n // init local filters variable as empty array\n $filters = [];\n\n // parse each filter to apply\n // and add the valid once to filters\n\n // filters by name\n if (isset($_GET['s'])) {\n\n $filters['name'] = $_GET['s'];\n\n }\n\n // filter by categories\n if (isset($_GET['c'])) {\n\n $categories = explode(\"_\", $_GET['c']);\n foreach ($categories as $key => $value) {\n if (is_numeric($value)) {\n $filters['categories'][] = $value;\n }\n }\n\n }\n\n // filter by areas\n if (isset($_GET['a'])) {\n\n $areas = explode(\"_\", $_GET['a']);\n foreach ($areas as $key => $value) {\n if (is_numeric($value)) {\n $filters['areas'][] = $value;\n }\n }\n\n }\n\n // Check if any filter has been set\n\n if (count($filters)>0) {\n\n $this->filters = $filters;\n return true;\n\n }\n\n\n return false;\n\n }", "public function rules() : array\n {\n return [\n 'limit' => 'integer',\n 'offset' => 'integer',\n 'order_by_dir' => 'in:DESC,ASC',\n 'filter' => 'array',\n 'filter.available' => 'boolean'\n ];\n }", "public function filters()\n {\n return array(\n 'value' => array(\n array(array($this, 'check_for_array_or_object')),\n )\n );\n }", "public function filters()\n\t{\n\t\treturn array(\n\t\t\t'amount' => array(\n\t\t\t\tarray('Num::filter_number')\n\t\t\t),\n\t\t\t'price' => array(\n\t\t\t\tarray('Num::filter_number')\n\t\t\t)\n\t\t);\n\t}", "public function rules() : array\n {\n return [\n 'limit' => 'integer',\n 'offset' => 'integer',\n 'order_by' => 'array',\n 'order_by_dir' => 'in:DESC,ASC',\n 'filter' => 'array',\n 'filter.user' => 'string|max:18',\n 'filter.custom' => 'boolean',\n 'filter.available' => 'boolean',\n ];\n }", "public function filtering();", "public function rules()\n\t{\n\t\t$defaults = array();\n\t\t$toggles = array();\n\t\t$custom = array();\n\t\t$required = array();\n\n\t\tforeach($this->searchFields as $field=>$data)\n\t\t{\n\t\t\t$type = $this->getSearchFieldType($field);\n\t\t\tif ($type == 'toggle')\n\t\t\t\t$toggles[] = $field;\n\t\t\telseif ($type == 'required')\n\t\t\t\t$required[] = $field;\n\t\t\telseif (empty($data['rule']) || !is_array($data['rule']))\n\t\t\t\t$defaults[] = $field;\n\n\t\t\tif (isset($data['rule']) && is_array($data['rule']))\n\t\t\t\t$custom[] = $data['rule'];\n\t\t}\n\n\t\treturn array_merge(array(\n\t\t\tarray(implode(', ', $required), 'required'),\n\t\t\tarray(implode(', ', $toggles), 'in', 'range' => array('Y','N','I')),\n\t\t\tarray(implode(', ', $defaults), 'length', 'max'=>200)\n\t\t), $custom);\n\t}", "public function getFilterParameters(): array;", "public function addFilters() {\n\t\t\tadd_filter( 'muut_validate_setting', array( $this, 'validateSettings' ), 10, 2 );\n\t\t}", "public function getFilterValues()\n {\n return $this->filter_values;\n }", "public function rules()\r\n {\r\n $rules= array(\r\n array(\"CONDITIONING, LATERALITY, birthdate_dd_mmm_yyyy, PATIENT_ID, SAMPLE_NUMBER, VISIT_ID, MATERIAL_TYPE_ID\",\"required\"),\r\n array(\"birthdate_dd_mm_yyyy, KIT_NUMBER_ID, blood_technical, endTaxanes, MATERIAL_ID\",\"safe\"),\r\n );\r\n\r\n $parentRules=parent::rules();\r\n $rules[]=$parentRules[0];\r\n\r\n return $rules;\r\n }", "public function rules() {\n return $this->get_from_model(__FUNCTION__);\n }", "public function rules()\n {\n return array_merge(\n parent::rules(),\n [\n ['operation', 'in', 'range' => [self::OPERATION_REDEEM, self::OPERATION_VIEWED]],\n ]\n );\n }", "public function getFilter();", "public function getFilter();", "protected function applyFiltering()\n\t{\n\t\tif (!$this->hasFilters()) return;\n\n\t\tparse_str($this->filters, $list);\n\t\tforeach ($list as $column => $value) {\n\t\t\tif ($value !== '') {\n\t\t\t\t$this[$column]->applyFilter($value);\n\t\t\t}\n\t\t}\n\t}", "public function rules()\n {\n return [\n 'limit' => ['sometimes', 'numeric', 'min:1', 'max:500'],\n 'filter' => ['sometimes', 'in:asc,desc'],\n 'sort_by' => ['sometimes', new InTableColumnsRule(with(new Product())->getTable())]\n ];\n }", "public function addFilters($values)\n {\n $attributes = $this->getAttributes();\n $allConditions = [];\n\n foreach ($attributes as $attribute) {\n /* @var $attribute Attribute */\n if (!isset($values[$attribute->getAttributeCode()])) {\n continue;\n }\n $value = $values[$attribute->getAttributeCode()];\n $preparedSearchValue = $this->getPreparedSearchCriteria($attribute, $value);\n if (false === $preparedSearchValue) {\n continue;\n }\n $this->addSearchCriteria($attribute, $preparedSearchValue);\n\n if ($attribute->getAttributeCode() == 'price') {\n $rate = 1;\n $store = $this->_storeManager->getStore();\n $currency = $store->getCurrentCurrencyCode();\n if ($currency != $store->getBaseCurrencyCode()) {\n $rate = $store->getBaseCurrency()->getRate($currency);\n }\n\n $value['from'] = (isset($value['from']) && is_numeric($value['from']))\n ? (float)$value['from'] / $rate\n : '';\n $value['to'] = (isset($value['to']) && is_numeric($value['to']))\n ? (float)$value['to'] / $rate\n : '';\n }\n\n if ($attribute->getBackendType() == 'datetime') {\n $value['from'] = (isset($value['from']) && !empty($value['from']))\n ? date('Y-m-d\\TH:i:s\\Z', strtotime($value['from']))\n : '';\n $value['to'] = (isset($value['to']) && !empty($value['to']))\n ? date('Y-m-d\\TH:i:s\\Z', strtotime($value['to']))\n : '';\n }\n $condition = $this->_getResource()->prepareCondition(\n $attribute,\n $value,\n $this->getProductCollection()\n );\n if ($condition === false) {\n continue;\n }\n\n $table = $attribute->getBackend()->getTable();\n if ($attribute->getBackendType() == 'static') {\n $attributeId = $attribute->getAttributeCode();\n } else {\n $attributeId = $attribute->getId();\n }\n $allConditions[$table][$attributeId] = $condition;\n }\n //if ($allConditions)\n if ($allConditions || (isset($values['cat']) && is_numeric($values['cat'])) ) {\n $this->_registry->register('advanced_search_conditions', $allConditions);\n $this->getProductCollection()->addFieldsToFilter($allConditions);\n } else {\n throw new LocalizedException(__('Please specify at least one search term.'));\n }\n\n return $this;\n }" ]
[ "0.66086787", "0.6507619", "0.6447703", "0.6369883", "0.6359987", "0.63215977", "0.63195574", "0.63150454", "0.6257946", "0.6257946", "0.6257946", "0.62349886", "0.62312895", "0.61983055", "0.6170236", "0.615807", "0.6138033", "0.6134118", "0.60906", "0.6042778", "0.6023637", "0.6018059", "0.5991779", "0.5987494", "0.5964062", "0.5942189", "0.5942189", "0.5941324", "0.5937692", "0.5934188" ]
0.66950357
0
Get the template builder manager.
protected function builderManager() { return \Drupal::service('plugin.manager.entity_template.builder'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBuilder() {\n if (!isset($this->builder)) {\n if (empty($this->configuration['builder'])) {\n $this->builder = $this->builderManager->createInstance('standard', []);\n }\n else {\n $this->builder = $this->builderManager->createInstance($this->configuration['builder'], []);\n }\n }\n return $this->builder;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager(): Gutenberg\n {\n return $this->manager;\n }", "protected function getManager()\n {\n return $this->manager;\n }", "public function getManager() {\n return $this->manager;\n }", "protected function getBuilder()\n {\n return $this->builder;\n }", "public function getTranslationManager()\n {\n return $this->getKernel()->getContainer()->get('worldia.textmaster.manager.translation');\n }", "public function getBuilder()\n {\n return $this->_builder;\n }", "public function getPersistenceBuilder()\n {\n if (!$this->persistenceBuilder) {\n $this->persistenceBuilder = new PersistenceBuilder($this->dm, $this, $this->cmd);\n }\n return $this->persistenceBuilder;\n }", "public function getFormBuilder()\n {\n return $this['form.factory'];\n }", "public function getBuilder()\n {\n return $this->builder;\n }", "public function getBuilder()\n {\n return $this->builder;\n }", "public function builder()\n {\n return $this->builder;\n }", "public function getViewManager()\n {\n return $this->viewManager;\n }", "protected function entityFormBuilder() {\n if (!$this->entityFormBuilder) {\n $this->entityFormBuilder = $this->container()->get('entity.form_builder');\n }\n return $this->entityFormBuilder;\n }", "public function getObjectManager() {\n\t\tif(($this->objectManager instanceof \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager) === false) {\n\t\t\t$this->objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Extbase\\Object\\ObjectManager::class);\n\t\t}\n\n\t\treturn $this->objectManager;\n\t}", "public function getFormBuilder()\n {\n $this->formOptions['data_class'] = $this->getClass();\n\n $this->formOptions['allow_extra_fields'] = true;\n $this->formOptions['validation_groups'] = false;\n $this->formOptions['error_bubbling'] = false;\n\n $formBuilder = $this->getFormContractor()->getFormBuilder(\n $this->getUniqid(),\n $this->formOptions\n );\n\n $this->defineFormBuilder($formBuilder);\n\n return $formBuilder;\n }", "public function getDocumentManager()\n {\n return $this->getObjectManager();\n }", "public function getObjectManager() {\n\t\tif(($this->objectManager instanceof \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager) === false) {\n\t\t\t$this->objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n\t\t}\n\n\t\treturn $this->objectManager;\n\t}", "public function getTemplateHelper(){\n if( $this->_flexryTemplateHelper === null ){\n $templateHandle = $this->currentTemplateHandle();\n if( empty($templateHandle) ){\n $this->_flexryTemplateHelper = FlexryBlockTemplateOptions::setup(self::TEMPLATE_DEFAULT_HANDLE, self::templateDefaultPath(), $this->parsedTemplateData() );\n }else{\n $templatesList = $this->templateAndDirectoryList();\n $this->_flexryTemplateHelper = FlexryBlockTemplateOptions::setup($templateHandle, $templatesList[$templateHandle], $this->parsedTemplateData() );\n }\n }\n return $this->_flexryTemplateHelper;\n }", "public function getFormManager()\n {\n if(!$this->formManager){\n $this->setFormManager( $this->getServiceLocator()->get('FormElementManager') );\n }\n return $this->formManager;\n\n return $this->formManager;\n }", "public function getTranslationGenerator()\n {\n return $this->getKernel()->getContainer()->get('worldia.textmaster.generator.translation');\n }", "public function getDocumentManager()\n {\n return $this->documentManager;\n }", "public static function instance() {\n return Doctrine::getTable('DocumentTemplate');\n }", "public static function get() {\n\t\tif (self::$web_template === null) {\n\t\t\tself::$web_template = new Template();\n\t\t}\n\n\t\treturn self::$web_template;\n\t}", "protected function getTemplateRepo()\n {\n if ($this->_templatesRepo === null || !$this->_templatesRepo) {\n $this->_templatesRepo = $this->getEntityRepository(Template::class);\n }\n\n return $this->_templatesRepo;\n }", "public function getEngine(): \\Twig\\Environment\n {\n return $this->template;\n }", "public function getDBManagerHandler()\n {\n\t\tif (empty($this->dbManager)) {\n\t\t\t$this->dbManager = new DatabaseManager($this->config['database'], new ConnectionFactory());\n\t\t}\n\t\treturn $this->dbManager;\n\t}" ]
[ "0.65663296", "0.6290267", "0.6290267", "0.6290267", "0.62729853", "0.6265055", "0.6221792", "0.60746664", "0.6015199", "0.59984595", "0.59514964", "0.594063", "0.5932067", "0.5932067", "0.5926895", "0.591976", "0.59180784", "0.59067625", "0.58905035", "0.58742106", "0.5870349", "0.5869387", "0.58640206", "0.57857865", "0.5776718", "0.57675964", "0.57670784", "0.5754302", "0.57222134", "0.5709957" ]
0.7953468
0
Get the remote fortrabbit branch to deploy to
public function remoteBranch() : string { return (string) $this->getOrError('remote_branch'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function list_remote_branches() {\n\t\t\t$branchArray = explode(\"\\n\", $this->run(\"branch -r\"));\n\t\t\tforeach ($branchArray as $i => &$branch) {\n\t\t\t\t$branch = trim($branch);\n\t\t\t\tif ($branch == \"\" || strpos($branch, 'HEAD -> ') !== false) {\n\t\t\t\t\tunset($branchArray[$i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $branchArray;\n\t\t}", "protected function getProjectFromRemote(): string\n {\n $process = new Process((array) 'git config --get remote.origin.url');\n $process->run();\n $remote_url = trim($process->getOutput());\n preg_match('#.*\\/(.*)\\.git$#', $remote_url, $matches);\n return $matches[1] ?? '';\n }", "public function getRemote()\n {\n return $this->remote;\n }", "function pull( $remote, $branch ) {\n return $this->_exec( \"pull {$remote} {$branch}\" );\n }", "public function getBranch()\n {\n return $this->_options['branch'];\n }", "public function git_repository()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git remote -v', $remotes );\n\n\t\tpreg_match( '#origin[\\s\\t]+git@github.com\\:([^\\.]+)#', $remotes[0], $matches );\n\n\t\t$remote = $matches[1];\n\n\t\treturn $remote;\n\t}", "public function getBranch()\n {\n return $this->branch;\n }", "public function getBranch()\n {\n return $this->branch;\n }", "public function getEnvironment()\n {\n return 'branch';\n }", "protected function getBranch()\n {\n $branches = $this->terminal->run($this->git->branch());\n\n preg_match('/\\*\\s([\\w]*)/', $branches, $matches);\n \n if (!empty($matches[1])) {\n $this->branch = $matches[1];\n }\n \n $this->output->write('<info>' . $this->branch . '</info>' . PHP_EOL);\n }", "public function getRemote();", "public function getExistingBranchForTestCase()\n {\n $branchName = $this->getDevBranchName();\n $devBranch = new DevBranches($this->getDefaultClient());\n\n $branches = $devBranch->listBranches();\n $branch = null;\n // get branch detail\n foreach ($branches as $branchItem) {\n if ($branchItem['name'] === $branchName) {\n $branch = $branchItem;\n }\n }\n if (!isset($branch)) {\n $this->testCase->fail(sprintf('Reuse existing branch: branch %s not found.', $branchName));\n }\n\n return $branch;\n }", "function changeBranch(){\r\n\t\t// $gitpss = isset($_COOKIE['gitpss']) ? $_COOKIE['gitpss'] : '';\r\n\t\t// $repo = 'https://'.$gitusr.':'.$gitpss.'@github.com/nelsoft/nelsoft_inventory.git';\r\n\t\tchdir($_POST['path']);\r\n\t\texec('git clean -df');\r\n\t\texec('git checkout -- .');\r\n\t\t// exec('git fetch '.$repo);\r\n\t\texec('git checkout '.$_POST['branch'], $data);\r\n\t\t// exec('git pull '.$repo.' '.$_POST['branch'], $data);\r\n\r\n\t\t$return['version'] = '0.00';\r\n\t\t$return['version'] = getversion($_POST['path'], 'version');\t\r\n\t\t$return['data'] = $data;\r\n\r\n\t\tjdie($return);\r\n}", "public function getRemoteSite() {\n return $this->remoteSite;\n }", "public function getCurrentBranch() : string\n {\n $process = $this->runProcess(new Process('git branch'));\n\n $branches = collect(explode(PHP_EOL, $process->getOutput()));\n\n $currentBranch = $branches->first(function(string $branch) {\n return str_contains($branch, '*');\n });\n\n return trim(str_replace('*', '', $currentBranch));\n }", "public function pull($remote, $branch) {\n\t\t\treturn $this->run(\"pull $remote $branch\");\n\t\t}", "public function getDefaultBranch() {\n $repoApi = new \\Drupal\\config_pr\\RepoControllers\\GitLabApi($this->getClient());\n $path = '/api/v4/projects/' . $this->getProjectId();\n $response = $repoApi->get($path);\n\n return $response['default_branch'];\n }", "public function fortrabbitRemoteName() : string\n {\n return 'frb-' . $this->environment();\n }", "public function getBranch() /*: string*/ {\n if ($this->branch === null) {\n throw new \\Exception(\"Branch is not initialized\");\n }\n return $this->branch;\n }", "private static function git_origin(): ?string {\n\t\tif ( ! self::$root_path ) {\n\t\t\treturn null;\n\t\t}\n\t\t$cmd = 'git -C ' . escapeshellarg( self::$root_path ) . ' remote get-url origin';\n\t\t$response = exec( $cmd );\n\t\treturn $response ?: null;\n\t}", "public function targetBranch() : string\n {\n return (string) $this->getOrError('target_branch');\n }", "private function _getBranches()\n\t{\n\t\t// If we don't have a configuration file for the repository PANIC!\n\t\tif (!file_exists($this->_root . '/.git/config'))\n\t\t{\n\t\t\tthrow new RuntimeException('Not a valid Git repository at ' . $this->_root);\n\t\t}\n\n\t\t// Initialize variables.\n\t\t$branches = array();\n\n\t\t// Parse the repository configuration file.\n\t\t$config = parse_ini_file($this->_root . '/.git/config', true);\n\n\t\t// Go find the remotes from the configuration file.\n\t\tforeach ($config as $section => $data)\n\t\t{\n\t\t\tif (strpos($section, 'branch ') === 0)\n\t\t\t{\n\t\t\t\t$branches[] = trim(substr($section, 7));\n\t\t\t}\n\t\t}\n\n\t\treturn $branches;\n\t}", "public function getRemote()\n {\n if (null === $this->getData('remote')) {\n $remote = Mage::getResourceModel('tmcore/module_remoteCollection')\n ->getItemById($this->getId());\n\n $this->setData('remote', $remote);\n }\n return $this->getData('remote');\n }", "public function get_url(){\n\n\t\t\treturn $this->api_urls['giturl'];\n\n\t\t}", "public function branch()\n {\n $result = $this->git('symbolic-ref --short HEAD');\n if (empty($result)) {\n return 'master';\n }\n\n return $result;\n }", "function determine_branch_name( $request) {\n // push request, branch is in request[ref]\n if (isset($reqest['ref'])) {\n // strip out the refs/head nonsense -- doesn't look like bare\n // branch is listed anywhere in the request\n return preg_replace(\"|refs/heads/|\", \"\", $request['ref']);\n }\n\n _log(\"Unable to determine branch name. Maybe this wasn't a pull or merge request?\");\n}", "public function addEnvironmentRemote(Config $config) : Git\n {\n return $this->addRemote(\n $config->fortrabbitRemoteName(),\n $config->gitUrl()\n );\n }", "public function gitPull() {\n $current_branch = exec('git rev-parse --abbrev-ref HEAD');\n\n $collection = $this->collectionBuilder();\n $collection->taskGitStack()\n ->pull()\n ->run();\n\n $name = $this->confirm(\"Run Composer Install?\");\n if ($name) {\n $this->composerInstall();\n }\n\n $name = $this->confirm(\"Run Config Import?\");\n if ($name) {\n $this->drushCim();\n }\n }", "function do_checkout_branch($req, $deployto, $operation){\n \n\tif($operation != \"TAG\"){\n\t//if($operation == \"Push Hook\" && !empty($DEPLOY_BRANCH)){\n\t\t$branch=determine_branch_name($req);\n\t\tif($branch == $operation){\n\t\t\t$cmd = \"bash -c 'cd $deployto; git checkout $branch' 2>&1\";\n\t\t}\n\t\telse{\n\t\t\t$cmd = \"bash -c 'cd $deployto; git checkout $operation' 2>&1\";\n\t\t}\n\t}\n\telse{\n\t\t$tag= $req['ref'];\n\t\t$cmd = \"bash -c 'cd $deployto; git checkout $tag' 2>&1\";\n\t}\n\t\n\tif(file_exists($deployto . \"/.gitmodules\")){\n\t\t_log(\"Initializing and Updating submodules...\\n\");\n\t\t$subcmd = \"bash -c 'cd $deployto; git submodule init; git submodule update' 2>&1\";\n\t}\n\n\t_debug(\"Operation: $operation\\n\");\n _log(\"Exec Command: $cmd\\n\");\n\n\t$result = shell_exec($cmd);\n\tif(isset($subcmd)){\n\t\t$result .= shell_exec($subcmd);\n \t}\n \treturn $result;\n\n}", "public function getBranch()\n {\n return new GitBranch($this->getProjectBase());\n }" ]
[ "0.65224206", "0.6259599", "0.62317294", "0.6191133", "0.6075909", "0.60703236", "0.60518396", "0.60518396", "0.6004127", "0.59335285", "0.58949876", "0.57196635", "0.5704866", "0.5616115", "0.5611877", "0.56028503", "0.55625117", "0.55576104", "0.5553211", "0.5515577", "0.5510284", "0.55096215", "0.54939276", "0.5482094", "0.54737115", "0.5461102", "0.5435713", "0.54339963", "0.5423268", "0.5421476" ]
0.7209364
0
Get the build commands to run
public function buildCommands() : Collection { return collect((array) $this->get('build_commands', [])); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCommandsToRun()\n {\n // Get symfony\n $symfony = $this->findSymfony();\n\n // Commands\n $commands = [\n rtrim($symfony . ' new ' . $this->getProjectPath() . ' ' . $this->getVersion()),\n ];\n\n return implode(' && ', $commands);\n }", "private static function commands()\n {\n foreach (self::fetch(static::$root.'Lumos/Commands') as $file) {\n static::need($file);\n }\n }", "protected function getCommands()\n {\n\t$commands[] = new DeployCommand();\n\t$commands[] = new RollbackCommand();\n\t$commands[] = new UpdateCommand();\n\t$commands[] = new DiffCommand();\n\t$commands[] = new CleanupCommand();\n\t$commands[] = new CheckCommand();\n\t$commands[] = new JsonCommand();\n\t$commands[] = new SetupCommand();\n\t$commands[] = new InstallCommand();\n\n\treturn $commands;\n }", "public function getCommands()\n {\n $str = '';\n if (isset($_SERVER['argv'])) {\n $str = \"$ \" . implode(\" \", $_SERVER['argv']);\n }\n\n return $str;\n }", "protected static function commands()\n {\n foreach (self::fetch('support/shell', false) as $file) {\n Bus::need($file);\n }\n }", "public function _getCommands()\n\t{\n\t\t$commands\t= array();\n\t\t$commands[] = array(\"permission\" => \"read\", \"cmd\" => \"view\", \"lang_var\" => \"enter\", \"default\" => true);\n\t\t$commands[] = array(\"permission\" => \"write\", \"cmd\" => \"settings-general\", \"lang_var\" => \"settings\");\n\t\t\n\t\t// alex 3 Oct 2012: this leads to a blank screen, i guess it is a copy/paste bug from files\n\t\t//$commands[] = array(\"permission\" => \"write\", \"cmd\" => \"versions\", \"lang_var\" => \"versions\");\n\n\t\treturn $commands;\n\t}", "protected function packageCommands()\n {\n return [\n NovaMakeCommand::class,\n ReadmeMakeCommand::class,\n TravisMakeCommand::class,\n LicenseMakeCommand::class,\n PhpunitMakeCommand::class,\n StyleciMakeCommand::class,\n CodecovMakeCommand::class,\n ComposerMakeCommand::class,\n BaseTestMakeCommand::class,\n GitignoreMakeCommand::class,\n ContributionMakeCommand::class,\n ];\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "public function getCheckCommands()\n {\n return $this->getCommandList(2);\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function getCommand()\n {\n\n return [\n\n // Usage of the command\n 'usage' => \"Command reads a file and output it in upper or lower case\",\n\n // Options for only this command\n 'options' => [\n '--up' => 'Will put string in uppercase',\n '--low' => 'Will put string in lowercase'\n ],\n\n // 'cast' => [\n // 'up' => 'int', // Cast to int, bool, float. Default is string\n // ],\n\n // Main options, which other commands may have access to\n 'main_options' => [\n '--main' => 'Test with a main option'\n ],\n\n // Are there any arguments and what are they used for.\n // This is only for displaying help. Any number of arguments can be\n 'arguments' => [\n 'File' => 'Read from a file and output to stdout. You can also pipe input to the command',\n ],\n \n // Set a default command if none if given\n // php demos/example --up README.md\n // Instead of:\n // php demos/example echo --up README.md\n // Then set 'is_default' to true\n // 'is_default' => true, \n ];\n }", "function _getCommands()\n\t{\n\t\t$commands = array();\n\t\t$commands[] = array( 'permission' => 'read', 'cmd' => 'view', 'lang_var' => 'show', 'default' => true );\n//\t\t$commands[] = array('permission' => 'read', 'cmd' => 'render', 'lang_var' => 'show', 'default' => true);\n//\t\t$commands[] = array('permission' => 'write', 'cmd' => 'enableAdministrationPanel', 'lang_var' => 'edit_content');\n//\t\t$commands[] = array( 'permission' => 'write', 'cmd' => 'edit', 'lang_var' => 'settings' );\n\n\t\treturn $commands;\n\t}", "public function getCommands()\n {\n return array(\n 'mautic:leadlists:update' => array('title' => 'Update lists', 'description' => 'Updates the leads in the lists. This command is required for basic Mautic functions.'),\n 'mautic:campaigns:update' => array('title' => 'Update campaigns', 'description' => 'Adds/removes leads from campaigns. This command is required for basic Mautic functions.'),\n 'mautic:campaigns:trigger' => array('title' => 'Trigger campaigns', 'description' => 'Triggers the campaign events. This command is required for basic Mautic functions.'),\n 'mautic:email:process' => array('title' => 'Process emails', 'description' => 'Processes the emails in the queue. This command is needed if you configure the emails to be processed in a queue.'),\n 'mautic:fetch:email' => array('title' => 'Fetch emails', 'description' => 'Reads emails from a inbox defined in the Monitored Inbox setting.'),\n 'mautic:iplookup:download' => array('title' => 'Update geoIP', 'description' => 'Downloads/updates the MaxMind GeoIp2 City database. This command is needed only if you use the \"MaxMind - GeoIp2 City Download\" IP lookup service.')\n );\n }", "function _getCommands()\n\t{\n\t\treturn array();\n\t}", "public function getBuiltFiles()\n {\n return $this->builtFiles;\n }", "function _drush_build() {\n drush_invoke('updatedb');\n drush_invoke('features-revert-all', array('force' => TRUE));\n drush_invoke('cc', array('type' => 'all'));\n drush_log(dt('Built!'), 'success');\n}", "protected function getCommands()\n {\n return implode(self::COMMAND_SEPARATOR, $this->chainableCommand);\n }", "public function getCommands()\n {\n return $this->getCommandBus()->getCommands();\n }", "protected function registerCommands()\n {\n $this->add(new Command\\BuildCommand());\n }", "public function getCommands()\n {\n return [\n ];\n }", "public function build()\n {\n $return = '';\n \n foreach ($this->getVars() as $commandName => $tags) {\n foreach ($tags as $tagName => $tagValues) {\n $return .= $this->renderTag($commandName, $tagName, $tagValues, $tags);\n }\n }\n\n return $return;\n }", "public function getCommands()\n\t{\n\t\treturn $this->commands;\t\n\t}", "protected function getScanCommands()\n {\n $files = Finder::create()\n ->in($this->app['path.commands'])\n ->name('*Command.php');\n\n $commands = [];\n\n foreach ($files as $file) {\n if ($command = $this->getCommandFromSource($file)) {\n $commands = array_merge($commands, $command);\n }\n }\n\n return $commands;\n }", "public static function get_build()\n {\n }", "public function getCommands()\n {\n return $this->commands;\n }", "public function getCommands()\n {\n return $this->commands;\n }", "public function getCommands()\n {\n return $this->commands;\n }", "public function formatBuildArguments()\n {\n return array_merge(\n ['__VAPOR_RUNTIME='.Manifest::runtime($this->environment)],\n array_filter($this->cliBuildArgs, function ($value) {\n return ! Str::startsWith($value, '__VAPOR_RUNTIME');\n })\n );\n }", "public static function commands() {\n return self::$_commands;\n }", "private static function get_commands_list(){ return array_keys(self::$current_runner->commands_list); }" ]
[ "0.65266496", "0.6486425", "0.64486825", "0.63645273", "0.6264899", "0.6238406", "0.6073823", "0.6070439", "0.59602493", "0.5953021", "0.5891035", "0.5858855", "0.5854843", "0.58218366", "0.5789899", "0.57700354", "0.57596934", "0.5742897", "0.57065547", "0.570477", "0.56995285", "0.5697836", "0.5680903", "0.566648", "0.56598645", "0.56598645", "0.56598645", "0.56585515", "0.5621866", "0.5617424" ]
0.67123824
0
Get the git URL
public function gitUrl() : string { return sprintf( '%s@%s:%s.git', $this->projectName(), $this->getOrError('frb_zone'), $this->projectName() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_url(){\n\n\t\t\treturn $this->api_urls['giturl'];\n\n\t\t}", "public function getCommitUrl(): string\n {\n return $this->data->url;\n }", "public function get_github_url() {\n\t\treturn $this->get_meta( 'github_url' );\n\t}", "function getUrl() {\n\t\treturn $this->repoObj->lobUrltitle;\n\t}", "protected function getProjectFromRemote(): string\n {\n $process = new Process((array) 'git config --get remote.origin.url');\n $process->run();\n $remote_url = trim($process->getOutput());\n preg_match('#.*\\/(.*)\\.git$#', $remote_url, $matches);\n return $matches[1] ?? '';\n }", "private static function git_origin(): ?string {\n\t\tif ( ! self::$root_path ) {\n\t\t\treturn null;\n\t\t}\n\t\t$cmd = 'git -C ' . escapeshellarg( self::$root_path ) . ' remote get-url origin';\n\t\t$response = exec( $cmd );\n\t\treturn $response ?: null;\n\t}", "public function get_bitbucket_auth_url(){\n\t\tif( empty($this->unauth_token) ){\n\t\t\t$this->request_unauth_token();\n\t\t}\n\t\t\n\t\t$auth_req = OAuthRequest::from_consumer_and_token($this->consumer, $this->unauth_token, \"GET\", $this->oauth_urls['login']);\n\t\t$auth_req->sign_request($this->signature_method, $this->consumer, $this->unauth_token);\n\t\treturn $auth_req->to_url();\n\t}", "public function getRepositoryUrl() {\n\t\t\t// we need to clean the combination of the 2 again because if the subfolder is empty in the config\n\t\t\t// then this will result in 2 slashes\n\t\t\treturn File::getCleanedPath($this->config->svn->getRoot() . $this->config->svn->getSubfolder());\n\t\t}", "public function getAccessUrl(GitRepository $repository) {\n $serverName = $_SERVER['SERVER_NAME'];\n $user = UserManager::instance()->getCurrentUser();\n return $user->getUserName() .'@'. $serverName .':/gitroot/'. $repository->getProject()->getUnixName().'/'.$repository->getName().'.git';\n }", "public function getSvnRepoUri()\n {\n return $this->_svnRepoUri;\n }", "public function getURL(): string\n {\n return $this->http->getURL();\n }", "public function getRemoteAccessUrl($commit=null)\n {\n $conf = $this->getConf();\n $scm = $conf->getVal('scm', 'git');\n $scms = Pluf::f('allowed_scm');\n Pluf::loadClass($scms[$scm]);\n return call_user_func(array($scms[$scm], 'getAnonymousAccessUrl'),\n $this, $commit);\n }", "private function getJenkinsUrl()\n {\n $jenkins_location = $this->app['config']['jenkins']['location'];\n $jenkins_user = $this->app['config']['jenkins']['api_user'];\n $jenkins_token = $this->app['config']['jenkins']['api_token'];\n\n $jenkins_protocol = 'http';\n $jenkins_host = $jenkins_location;\n\n if(preg_match('/^(.*):\\/\\/(.*)$/', $jenkins_location, $matches)) {\n $jenkins_protocol = $matches[1];\n $jenkins_host = $matches[2];\n }\n\n $jenkins_host = rtrim($jenkins_host, '/') . '/';\n\n $jenkins_http_auth_string = '';\n if(!empty($jenkins_user) && !empty($jenkins_token)) {\n $jenkins_http_auth_string = $jenkins_user . ':' . $jenkins_token . '@';\n }\n\n $jenkins_url = $jenkins_protocol . '://' . $jenkins_http_auth_string . $jenkins_host;\n\n return $jenkins_url;\n }", "public function getGitCloneLocation()\n {\n return $this->gitCloneLocation;\n }", "public function git_repository()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git remote -v', $remotes );\n\n\t\tpreg_match( '#origin[\\s\\t]+git@github.com\\:([^\\.]+)#', $remotes[0], $matches );\n\n\t\t$remote = $matches[1];\n\n\t\treturn $remote;\n\t}", "public function getURL(): string\n {\n return $this->url.$this->apiVersion.'/';\n }", "public function getGitRepository(): string\n {\n return 'https://github.com/Sylius/Sylius.git';\n }", "public function get_url(): string\n {\n return $this->get_url_internal();\n }", "private function generateUrl() : string\n {\n return $this->apiUrl.$this->ownerRepo.$this->branchPath.$this->branch;\n }", "protected function get_url()\n {\n return $this->base_url + $this->api_version; \n }", "protected function getTokenUrl()\n {\n return 'https://bitbucket.org/site/oauth2/access_token';\n }", "public function getURL ();", "public function getURL();", "public function getURL();", "private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}", "public function get_url () {\r\n\t\treturn $this->url;\r\n\t}", "protected function getUrl()\n {\n if (!empty($this->info['url'])) {\n return $this->info['url'];\n }\n }", "public function get_url() {\n\t\treturn $this->url;\n\t}", "public function get_url() {\n\t\treturn $this->url;\n\t}", "protected function getUrl(): string\n {\n return $this->url;\n }" ]
[ "0.86241466", "0.7903098", "0.74523854", "0.73158497", "0.6870565", "0.67854977", "0.675056", "0.6714888", "0.6662214", "0.6629114", "0.6623352", "0.66135496", "0.65533596", "0.6542594", "0.65313685", "0.65038073", "0.6503157", "0.6480044", "0.6426344", "0.6394495", "0.63870734", "0.6379639", "0.63789773", "0.63789773", "0.6363002", "0.6353388", "0.63146776", "0.6310874", "0.6310874", "0.6306059" ]
0.7926891
1
Get the fortrabbit remote name
public function fortrabbitRemoteName() : string { return 'frb-' . $this->environment(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getName(): string\n {\n return 'centreon_configuration_remote';\n }", "public function getRemoteAddress()\n {\n return stream_socket_get_name($this->socket, true);\n }", "public function getReceiverName()\n {\n return $this->get(self::_RECEIVER_NAME);\n }", "public function get_id() {\n return 'remote';\n }", "public function getName()\n {\n return 'travelbase.getHost';\n }", "public function getRemote();", "public function getOrigBrokerName() {}", "public function getName():string\n\t{\n\t\treturn $this->channelName;\n\t}", "public function getRemoteAddress()\n {\n return $this->getKey('RemoteAddress');\n }", "public function getRemoteIdentifier()\n {\n if (array_key_exists(\"remoteIdentifier\", $this->_propDict)) {\n return $this->_propDict[\"remoteIdentifier\"];\n } else {\n return null;\n }\n }", "public function getPeerName()\n {\n return $this->peerName;\n }", "public function getHostName()\n {\n return $this->_hostName;\n }", "public function clientGetname() {\n return $this->returnCommand(['CLIENT', 'GETNAME']);\n }", "function getHostName() {\n\t\treturn $this->hostInfo[0]['dc'][0];\n\t}", "public function getIncomingMailServerDisplayName() {\n\t\treturn $this->ic_mail_server_displayname;\n\t}", "public function getDeviceName() { \n if ($this->name) {\n return $this->name; \n }\n if (is_array($this->rawData)) {\n $this->name = $this->rawData[\"host name\"];\n if (!$this->name) { \n $this->name = $this->rawData[\"имя хоста\"];\n }\n }\n return $this->name;\n }", "public static function getCliName();", "public function getName() {\n\t\treturn $this->selectedEndpoint['name'];\n\t}", "function get_name() {\n\t\treturn $this->get_name_from_vtec();\t\n\t}", "public function hostname() {\n $host = $this->client(\"origin\")?? $this->client(\"host\")?? $this->uri(\"host\");\n $host = parse_url($host);\n\n return $host[\"host\"]?? $host[\"path\"];\n }", "public function getHost(): string\n {\n return (string)$this->getEnvKey('SERVER_NAME');\n }", "static function Name()\n {\n return self::Variable('SERVER_NAME');\n }", "protected function getOriginName()\n {\n return $this->container->getParameter('tenside.self_update.origin_name');\n }", "public function getNomConnecter()\n\t{\n\n\t\treturn $this->nom;\n\t}", "public function getVhost(): string\n {\n }", "public function getGearmanHost() : string\n {\n return $this->gearmanHost;\n }", "public function getNickname(): string {\n return $this->nickname;\n }", "public function getAcquiaHostedMachineName() {\n $sub_data = $this->config('acquia_connector.settings')->get('subscription_data');\n\n if ($this->checkAcquiaHosted() && $sub_data) {\n $uuid = new StatusController();\n $sub_uuid = str_replace('-', '_', $uuid->getIdFromSub($sub_data));\n\n return $sub_uuid . '__' . $_SERVER['AH_SITE_NAME'];\n }\n }", "public function getFromName() : string {\n return $this->_fromName;\n }", "public function getRemote()\n {\n return $this->remote;\n }" ]
[ "0.63912964", "0.6318805", "0.62839437", "0.61415905", "0.60348165", "0.601217", "0.60069597", "0.5983146", "0.5963327", "0.5961428", "0.5937357", "0.5915767", "0.5899417", "0.5898476", "0.5893659", "0.5887986", "0.5887931", "0.5878322", "0.5876887", "0.5869484", "0.58655125", "0.58468276", "0.58232176", "0.5819744", "0.58188015", "0.5808551", "0.58059466", "0.5793012", "0.57902634", "0.57853514" ]
0.80864376
0
/Add workout function form
public function addWorkout() { return view('admin.addworkout'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function work()\n {\n }", "function vcn_findwork() { // Callback fucntion\r\n\t//return drupal_get_form('vcn_findwork_form');\r\n\treturn theme('vcn_findwork_overview');\r\n}", "function raptor_glue_worklist_form_builder($form, &$form_state)\n{\n\n $oPI = new \\raptor\\WorklistPage();\n $form = array();\n $disabled = false;\n $myvalues = $oPI->getFieldValues();\n $buildresult = $oPI->getForm($form, $form_state, $disabled, $myvalues);\n //drupal_set_message('<h2>Done building WORKLIST page at ' . microtime(TRUE) . '</h2>');\n \n return $buildresult;\n}", "public function show(Workout $workout)\n {\n //\n }", "function addForm()\n {\n $content = '';\n $template['job_bank_add'] = $this->cObj->getSubpart($this->__getTemplateCode(),\"###ADD_JOB_PLACEHOLDER###\"); \n\n $subPartArray['###CAREERLEVEL###'] = $this->createDropDown($this->job_careerlevel);\n $subPartArray['###FORMNAMEEXTENSIONJOB###'] = $this->prefixId;\n $subPartArray['###FORMNAMEEXTENSION###'] = $this->prefixId;\n $subPartArray[\"###HELP_IMAGE###\"] = t3lib_extMgm::siteRelPath($this->extKey).'images/help.gif';\n $subPartArray['###JOB_BANK_LOCATION###'] = $this->getCountryZone();\n $subPartArray['###QUALIFICATION###'] = $this->createDropDown($this->job_qualifiacation);\n $subPartArray['###SCRIPTNAME_POPUP_HELP_JS###'] = t3lib_extMgm::siteRelPath($this->extKey).'styles/overlib.js';\n $subPartArray[\"###SPONSOR_ID###\"] = $this->sponsorId;\n $subPartArray['###STATUS###'] = $this->createDropDown($this->job_status);\n\n $content .= $this->cObj->substituteMarkerArrayCached($template['job_bank_add'],$subPartArray,array(),array());\n \n return $this->pi_wrapInBaseClass($content);\n\n }", "public function addAction()\n {\n $request = $this->getRequest();\n\n $routeMatch = $this->getEvent()->getRouteMatch();\n $id = $routeMatch->getParam('workout_id', 0);\n\n if ($id <= 0) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $workout = $this->_workout->getRow(array('workout_id' => $id));\n//\n if (!$workout) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n /**\n * Grid FORM\n */\n $form = new WorkoutExerciseGrid(\n array(\n 'view' => $this->_view,\n )\n );\n\n /**\n * BUILDING Row\n */\n $row = new WorkoutExerciseRow(\n array(\n 'model' => $this->_exercise,\n 'view' => $this->_view,\n )\n );\n\n $row->setFieldOptions('type_id', array(\n 'values' => $this->_exerciseType->getBehaviour('nestedSet')->getResultSetForSelect(),\n 'onchange' => 'exerciseType(this);',\n ));\n $row->setFieldOptions('workout_id', array(\n 'value' => $id,\n ));\n\n //\n\n\n\n //\n $row->build();\n\n //\n $form->addSubForm($row, $row->getName());\n\n //\n $this->_view->headScript()->appendScript(\n $this->_view->render(\n 'workout-exercise/add.js',\n array(\n 'currentFormType' => 0,\n 'back' => $this->url()->fromRoute(\n 'hi-training/workout-exercise/list/wildcard',\n array('workout_id' => $id)\n ),\n 'ajaxFormType' => $this->url()->fromRoute(\n 'hi-training/exercise-type/ajax-form-type/wildcard',\n array('type_id' => '')\n ),\n 'ajaxLastOfType' => $this->url()->fromRoute(\n 'hi-training/workout-exercise/ajax-last-of-type/wildcard',\n array('type_id' => '')\n ),\n )\n )\n );\n\n\n /**\n * POST\n */\n if ($this->getRequest()->isPost()) {\n\n $formData = $this->getRequest()->post()->toArray();\n\n if ($form->isValid($formData)) {\n\n// \\Zend\\Debug::dump($formData);\n\n if ( isset($formData['header']['formId'])\n && $formData['header']['formId'] == 'WorkoutExerciseGridForm') {\n\n if (isset($formData['WorkoutExerciseRow']['actions']['save'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $newRow = $this->_exercise->createRow()->populate($formData['WorkoutExerciseRow']['row']);\n $newRow->save();\n\n return $this->redirect()->toRoute('hi-training/workout-exercise/list/wildcard', array('workout_id' => $id));\n }\n\n }\n\n if (isset($formData['WorkoutExerciseRow']['actions']['saveAdd'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $newRow = $this->_exercise->createRow()->populate($formData['WorkoutExerciseRow']['row']);\n $newRow->save();\n\n return $this->redirect()->toRoute('hi-training/workout-exercise/add/wildcard', array('workout_id' => $id));\n }\n\n }\n }\n }\n }\n\n //\n return array(\n 'form' => $form,\n 'workout' => $workout,\n );\n\n }", "function show_plan_add() {\n //must check that the user has the required capability \n if (!current_user_can('manage_options')) {\n csm_error('You do not have sufficient permissions to access this page', true);\n }\n \n $CsmWorkplace = new CsmWorkplace();\n $workplaces = $CsmWorkplace->all();\n \n //Add the member\n if (isset($_POST['action']) && $_POST['action'] === 'addplan') {\n $data = $_POST;\n $Csmplan = new CsmPlan();\n try {\n $Csmplan->create($_POST);\n csm_set_update('New membership plan was added');\n hacky_redirect('csm-plans');\n } catch (\\Exception $e) {\n csm_error($e->getMessage());\n }\n }\n \n include(CSM_PLUGIN_PATH . 'app/views/plan-add.view.php');\n}", "public function edit(Workout $workout)\n {\n //\n }", "function form();", "function fantacalcio_admin_matches_calendar($form, &$form_state, $g_id = \"\") {\n \n // $form['#redirect'] = 'admin/fantacalcio/groups/' . $g_id;\n $group = Group::get($g_id);\n \n drupal_set_title(filter_xss($group->name . \" - \" . t(\"Crea calendario\")));\n \n $teams = Team::allByGroup($g_id);\n \n $i = 0;\n foreach ($teams as $t_id => $team) {\n // create a partial table row containing the data from the table\n $data = array(\n // $t_id,\n $team->name);\n \n // add our static \"row\" data into a form value\n $form['rows'][$t_id]['data'] = array('#type' => 'value', '#value' => $data);\n \n // now create the weight form element.\n // NOTE how we add the id into the element key\n $form['rows'][$t_id]['weight-' . $t_id] = array(\n '#type' => 'weight', \n '#default_value' => $i, \n '#delta' => count($teams), \n \n // add a specific class in here - we need this later\n '#attributes' => array('class' => array('weight')));\n $i++;\n }\n \n $form['turns'] = array(\n '#title' => t('Numero di turni'), \n '#type' => 'select', \n '#options' => array(\n 1 => 1, \n 2 => 2, \n 3 => 3, \n 4 => 4, \n 5 => 5, \n 6 => 6, \n 7 => 7, \n 8 => 8, \n 9 => 9, \n 10 => 10));\n\n$form['round_start'] = array(\n '#title' => t('Giornata di partenza'), \n '#type' => 'numberfield',\n '#default_value' => 1\n);\n \n $form['home_away'] = array(\n '#title' => t('Inverti squadre (andata e ritorno)'), \n '#type' => 'checkbox');\n \n $form['bonus_t1'] = array(\n '#title' => t('Bonus Squadra 1'), \n '#type' => 'textfield', \n '#size' => 3);\n \n $form['bonus_t2'] = array(\n '#title' => t('Bonus Squadra 2'), \n '#type' => 'textfield', \n '#size' => 3);\n \n $form['delete_old'] = array(\n '#title' => t('Cancella vecchio calendario'), \n '#type' => 'checkbox');\n \n $form['g_id'] = array('#type' => 'hidden', '#value' => $g_id);\n \n $form['submit'] = array('#type' => 'submit', '#value' => t('Crea Calendario'));\n \n return $form;\n}", "public function work()\n {\n }", "protected function workout(): Workout\n {\n $program = Program::create(\n 'programname',\n User::fromName(\"newuser\"),\n ...[$this->exercise('exercisename')]\n );\n return Workout::fromProgram($program);\n }", "public function __construct()\n\t{\n\t\tadd_shortcode('Opening_hours', array($this, 'Opening_hours_fct') ); // link new function to shortcode name\n\t\tadd_shortcode('Opening_hours_table', array($this, 'Opening_hours_table_fct') ); // link new function to shortcode name\n\t\tadd_shortcode('Opening_hours_alert', array($this, 'Opening_hours_alert_fct') ); // link new function to shortcode name\n\t\tadd_shortcode('Opening_hours_clock', array($this, 'Opening_hours_clock_fct') ); // link new function to shortcode name\n\t}", "function newBatchInput(){\n\tglobal $batchtypes;\t\n\n\t$ret = \"<form onsubmit=\\\"newBatch(); return false;\\\">\";\n\t$ret .= \"<table>\";\n\t$ret .= \"<tr><th>Batch Type</th><th>Name</th><th>Start date</th><th>End date</th><th>Owner</th></tr>\";\n\t$ret .= \"<tr>\";\n\t$ret .= \"<td><select id=newBatchType>\";\n\tforeach ($batchtypes as $id=>$desc){\n\t\t$ret .= \"<option value=$id>$desc</option>\";\n\t}\n\t$ret .= \"</select></td>\";\n\t$ret .= \"<td><input type=text id=newBatchName /></td>\";\n\t$ret .= \"<td><input type=text id=newBatchStartDate onfocus=\\\"showCalendarControl(this);\\\" /></td>\";\n\t$ret .= \"<td><input type=text id=newBatchEndDate onfocus=\\\"showCalendarControl(this);\\\" /></td>\";\n\t$ret .= \"<td><select id=newBatchOwner />\";\n\tglobal $owners;\n\tforeach ($owners as $o)\n\t\t$ret .= \"<option>$o</option>\";\n\t$ret .= \"</select></td>\";\n\t$ret .= \"<td><input type=submit value=Add /></td>\";\n\t$ret .= \"</tr></table></form><br />\";\n\t\n\t$ret .= \"<b>Filter</b>: show batches owned by: \";\n\t$ret .= \"<select id=filterOwner onchange=\\\"refilter();\\\">\";\n\tforeach ($owners as $o)\n\t\t$ret .= \"<option>$o</option>\";\n\t$ret .= \"</select>\";\n\t\n\t$ret .= \" <a href=barcodenew.php>Print shelf tags</a>\";\n\t\n\treturn $ret;\n}", "function tpps_details_tab($accession, $type) {\n $function = \"tpps_details_$type\";\n $state = tpps_load_submission($accession);\n print($function($state));\n}", "function add_dashboard() {\n}", "function disp_gen_meetings_cp($count){\r\n\r\n echo('<form method=\"post\" action=\"/vgdc-uci/admin/home.php?p=gen_meetings_set\">');\r\n echo('Date of First Meeting (yyyy-mm-dd): <input type=\"text\" name=\"start_date\"><br>');\r\n for( $i = 0; $i < $count; $i++ ){\r\n $value = 'General Meeting';\r\n switch($i){ //DEFAULT VALUES BY WEEK\r\n //in the event that the default setup changes, this should be updated\r\n case 0:\r\n $value = 'Project Presentations*';\r\n break;\r\n case 1:\r\n $value = 'Team Assignments**';\r\n break;\r\n case 2:\r\n $value = 'In-Person Team Setup*';\r\n break;\r\n case 4:\r\n $value = 'Game Night';\r\n break;\r\n case 6:\r\n $value = 'Playtesting';\r\n break;\r\n case 8:\r\n $value = 'Playtesting';\r\n break;\r\n case 9:\r\n $value = 'Game Night';\r\n break;\r\n }\r\n echo('Week '.($i+1).' Topic: <input type=\"text\" name=\"topic'.$i.'\" value=\"'.$value.'\"><br>');\r\n }\r\n echo('<input type=\"submit\" name=\"Update\" value=\"Apply\">');\r\n echo('</form>');\r\n}", "function submitAddStok()\n\t{\n\t\t# code...\n\t}", "abstract function form();", "function cust_lead(){\n }", "public function create()\n {\n return view('workouts.form');\n }", "public function postnewjob(){\n\t\tglobal $job_deadline;\n\t\t$this->addElement('select', 'job_deadline', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t'id' => 'job_deadline',\n\t\t\t\t\"multioptions\"=>$job_deadline,\n\t\t\t\t// 'onchange' => 'Checkoption(this)',\n\t\t\t\t\"label\" => \"When do you need the work to start\",\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n\t\t\n\t\t/*$this->addElement('textarea', 'job_deadline_other_option', array (\n\t\t\t'class' => 'form-control p_0 ',\n\t\t\t\"required\"=>true,\n\t\t\t'id' => 'job_deadline_other_option',\n\t\t\t \"rows\"=>5, \n\t\t\t'Placeholder'=> 'When would you like to schedule this for?',\n\t\t\t//\"label\" => \"When do you need the work to start\",\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"Business description is required \")),\n \t\t\t\t\t\t\t\t),\n\t\t));*/\n\t\t\n\t\t$this->addElement('text', 'job_deadline_date', array (\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t\"placeholder\" => \"Select Date\",\n\t\t\t\t\"readonly\"=>\"readonly\", \n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t));\n\t\t\n\t\t$this->addElement('text', 'job_phone_client', array (\n\t\t\t'class' => 'form-control required text-center User_job_Post_Form',\n\t\t\t\"required\"=>true,\n\t\t\t'label' => 'Phone Number', \n\t\t\t'Placeholder'=> 'Phone Number with valid code (+1)',\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"Business description is required \")),\n \t\t\t\t\t\t\t\t),\n\t\t));\n// zip code textbox\t\t\n\t\t$this->addElement('radio', 'job_anything_else_know', array (\n\t\t\t'class' => 'required RedioCheckboxStyle User_job_Post_Form',\n\t\t\t\"required\"=>true,\n\t\t\t'id' => 'job_anything_else_know',\n\t\t//\"onclick\"=>\"isElse()\", \n\t\t\t'multiOptions'=>array(\n\t\t\t'0' => 'Yes',\n\t\t\t'1' => 'No',\n\t\t\t),\n\t\t\t\"label\" => \"Anything else service provider should know? \",\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"Please select.\")),\n\t\t\t\t\t\t\t),\n\t\t));\n\t\t\n\t\t$this->addElement('textarea', 'yes_else_know', array (\n\t\t\t'class' => 'form-control text-left p_0',\n\t\t\t\"required\"=>true,\n\t\t\t\"rows\"=>2, \n\t\t\t'id' => 'yes_else_know',\n\t\t\t'Placeholder'=> 'Write here...',\n\t\t\t//\"label\" => \"When do you need the work to start\",\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"Business description is required \")),\n \t\t\t\t\t\t\t\t),\n\t\t));\n\t\t\n\t\t$this->addElement('radio', 'how_receive_quote', array (\n\t\t\t'class' => 'required RedioCheckboxStyle User_job_Post_Form',\n\t\t\t\"required\"=>true,\n\t\t\t'multiOptions'=>array(\n\t\t\t'0' => 'By email only',\n\t\t\t'1' => 'By email and text message',\n\t\t\t),\n\t\t\t\"label\" => \"How would you like to receive quotes? \",\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"Please select.\")),\n\t\t\t\t\t\t\t),\n\t\t));\n\t\t\n\t\t\n\t\t//$this->how_receive_quote->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('Wrapper');\n\t\t\n\t\t$this->addElement('text', 'client_zip_code', array (\n\t\t\t\t'class' => 'form-control required text-center User_job_Post_Form',\n\t\t\t\t\"label\" => \"Please confirm where you need the job to be done. \" ,\n\t\t\t\t'Placeholder'=> 'Zip Code',\n\t\t\t\t/*'onchange'=> 'checkzipcode(this.value)',*/\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"zip code is required \")),\n\t\t\t\t\t\t\t\t),\n\t\t\t));\n\t\t\t\n\t\t $job_budget=array(\n\t\t\t'1' => '0-100',\n\t\t\t'2' => '100-200',\n\t\t\t'3' => '200-500',\n\t\t\t'4' => '500-700',\n\t\t\t'5' => '700-1000',\n\t\t\t'6' => '1000-1500',\n\t\t\t'7' => '1500-2000',\n\t\t\t'8' => '2000-5000',\n\t\t\t'9' => '5000-7000',\n\t\t\t'10' => 'more than 7000',\n\t\t\t\n\t\t);\n\t\t$this->addElement('select', 'posted_job_budget', array (\n\t\t\t'class' => 'form-control',\n\t\t\t\"multioptions\"=>$job_budget,\n\t\t\t'label' => 'Job Budget', \n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t));\n\t}", "public function work(): void;", "function ToonFormulierAfspraak()\n{\n\n}", "public function add()\n\t{\n\t\t$fake_id = $this->_get_id_cur();\n\t\t$form = array();\n\t\t$form['view'] = 'form';\n\t\t$form['validation']['params'] = $this->_get_params();\n\t\t$form['submit'] = function()use ($fake_id)\n\t\t{\n\t\t\t$data = $this->_get_inputs();\n\t\t\t$data['sort_order'] = $this->_model()->get_total() + 1;\n\t\t\t$id = 0;\n\t\t\t$this->_model()->create($data,$id);\n\t\t\t// Cap nhat lai table_id table file\n\t\t\tmodel('file')->update_table_id_of_mod($this->_get_mod(), $fake_id, $id);\n\t\t\tfake_id_del($this->_get_mod());\n\n\t\t\tset_message(lang('notice_add_success'));\n\t\t\t\n\t\t\treturn admin_url($this->_get_mod());\n\t\t};\n\t\t$form['form'] = function() use ($fake_id)\n\t\t{\n\t\t\t$this->_create_view_data($fake_id);\n\n\t\t\t$this->_display('form');\n\t\t};\n\t\t$this->_form($form);\n\t}", "public function addWorkoutCategory()\n {\n return view('admin.addworkoutcategory');\n }", "protected function getAddAfterFunction()\n {\n \n }", "public function run()\n {\n $station_func = array(array('station'=>'Headquarters', 'function'=>'AIM Products Management'),\n\t\t\t\t\t\tarray('station'=>'Jomo Kenyatta International Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Jomo Kenyatta International Airport NOF', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Nairobi Wilson Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Moi International Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Eldoret International Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Kisumu Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Malindi Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Wajir Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Lokochoggio Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray('station'=>'Jomo Kenyatta International Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Nairobi Wilson Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Moi International Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Eldoret International Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Kisumu Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Malindi Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Wajir Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Lokochoggio Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray('station'=>'Headquarters', 'function'=>'Maps and Charts Management'),\n\t\t\t\t\t\tarray('station'=>'Headquarters', 'function'=>'Terrain and Obstacle Data Management'),\n\t\t\t\t\t\tarray('station'=>'Headquarters', 'function'=>'Instrument/Visual flight procedure design'),\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray('station'=>'Headquarters', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Jomo Kenyatta International Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Jomo Kenyatta International Airport NOF', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Nairobi Wilson Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Moi International Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Eldoret International Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Kisumu Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Malindi Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Wajir Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Lokochoggio Airport', 'function'=>'Technical library'),\n\t\t);\n\t\t\n\t\t$stations = Station::all();\n\t\t$functions = Func::all();\n\t\t\n\t\tfor($i = 0; $i < count($station_func); $i++){\n\t\t\tforeach($stations as $station){\n\t\t\t\tif($station_func[$i]['station'] == $station->name){\n\t\t\t\t\tforeach($functions as $function){\n\t\t\t\t\t\tif($station_func[$i]['function'] == $function->name){\n\t\t\t\t\t\t\t$station->func()->attach($function);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }", "function runkit_function_add($funcname, $arglist, $code)\n{\n}", "public static function generate_work_period_form($args = array(), $allow_remove = true){\n $default_args = array(\n 'period_id' => false,\n 'week_day' => 1,\n 'allow_remove' => true,\n 'start_time' => 480,\n 'end_time' => 1080,\n 'agent_id' => 0,\n 'location_id' => 0,\n 'service_id' => 0\n );\n $args = array_merge($default_args, $args);\n\n $period_id = (!$args['period_id']) ? 'new_'.$args['week_day'].'_'.OsUtilHelper::random_text() : $args['period_id'];\n $period_html = '<div class=\"ws-period\">';\n $period_html.= OsFormHelper::time_field('work_periods['.$period_id.'][start_time]', __('Start', 'latepoint'), $args['start_time'], true);\n $period_html.= OsFormHelper::time_field('work_periods['.$period_id.'][end_time]', __('Finish', 'latepoint'), $args['end_time'], true);\n $period_html.= OsFormHelper::hidden_field('work_periods['.$period_id.'][week_day]', $args['week_day']);\n $period_html.= OsFormHelper::hidden_field('work_periods['.$period_id.'][is_active]', self::is_period_active($args['start_time'], $args['end_time']), array('class' => 'is-active'));\n $period_html.= OsFormHelper::hidden_field('work_periods['.$period_id.'][agent_id]', $args['agent_id']);\n $period_html.= OsFormHelper::hidden_field('work_periods['.$period_id.'][location_id]', $args['location_id']);\n $period_html.= OsFormHelper::hidden_field('work_periods['.$period_id.'][service_id]', $args['service_id']);\n if(isset($args['custom_date'])) $period_html.= OsFormHelper::hidden_field('work_periods['.$period_id.'][custom_date]', $args['custom_date']);\n if($allow_remove) $period_html.= '<button class=\"ws-period-remove\"><i class=\"latepoint-icon latepoint-icon-x\"></i></button>';\n $period_html.= '</div>';\n return $period_html;\n }" ]
[ "0.5877085", "0.57135993", "0.56200004", "0.55651164", "0.54190516", "0.5377406", "0.53698415", "0.53543234", "0.5306199", "0.52983457", "0.527685", "0.5251136", "0.52413756", "0.52306867", "0.5230611", "0.52254736", "0.51927763", "0.51724637", "0.51587814", "0.5121457", "0.5113276", "0.50909424", "0.5087837", "0.50854915", "0.50802577", "0.5077977", "0.50745326", "0.50679386", "0.50454503", "0.5029787" ]
0.627421
0
/Add nutrition Category form
public function addNutrationCategory() { return view('admin.addnutratoncategory'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);\n }", "function add_new_category()\n\t{\n\t\t$this->data['title'] \t= 'Add New Portfolio Category';\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/add_new_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "public function category_add() {\n\t\t// Setup validation\n\t\t$this->data['validation'] = \"\";\n\t\t$this->data['category']\t= array('name' => '', 'url_name' => '');\n\t\t\n\t\t// Handle POST\n\t\tif ($this->mojo->input->post('category')) {\n\t\t\t// Get the category data\n\t\t\t$this->data['category']\t= $this->mojo->input->post('category');\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert_category($this->data['category'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/categories_all');\n\t\t\t\t$response['message'] = 'Successfully created category';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Show the view\n\t\t$this->_view('category_add');\n\t}", "public function add_category() {\n\t $this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(substr($_POST[\"id\"], 4));\n\t\t$this->model->categories = $category;\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t}", "public function addCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t \t$name = $_REQUEST['name'];\n $father = $_REQUEST['father'];\n\t\t\t$form = M(\"categoryinfo\");\n\t\t\t$addnew['name'] = $name;\n $addnew['father'] = $father;\n\t\t\t$result = $form->add($addnew);\n\t\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t//else {$this->error('添加失败');}\n }", "function CategoryForm() {\r\n\r\n\t\t$member = Member::currentUser();\r\n\r\n\t\t// Need to sort out how going to handle multiple instances of category\r\n\t\t// front end grid field : https://github.com/webbuilders-group/silverstripe-frontendgridfield\r\n\t\t// grid field extension : https://github.com/silverstripe-australia/silverstripe-gridfieldextensions\r\n\t\t$category = Category::get()->first();\r\n\t\t$fields = $category->FormFields();\r\n\r\n $actions = FieldList::create(\r\n FormAction::create(\"doCategoryForm\")->setTitle(\"Submit\")->addExtraClass('productive'),\r\n FormAction::create(\"cancel\")->setTitle(\"Cancel\")\r\n );\r\n\r\n $form = Form::create($this, 'CategoryForm', $fields, $actions);\r\n\r\n return $form;\r\n\r\n\t}", "public function category_add() {\n $this->autoRender = false;\n $params = $this->request->data;\n //echo \"<pre>\";print_r($params);echo \"</pre>\"; exit;\n $categoryTable = TableRegistry::get('SkillCategory');\n $getCategory = $categoryTable->find()->select(['id'])->where(['category_name' => $params['category_name']])->toArray();\n if(empty($getCategory)){\n $category = $categoryTable->newEntity($params);\n if ($categoryTable->save($category)) {\n echo json_encode(\n [\n 'status' => 1,\n 'message' => \"Skill Category Added!\",\n ]\n );\n exit;\n }\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"Skill Category Already Exists!\",\n ]\n );\n exit;\n }\n \n }", "public function add_acct_category(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\nif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['ledger1'] = $this->db->get_where('acct_categories', ['category_type' => 'Main']);\n\t\t\t\n\t\t}\n\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'add_acct_category') die('Error! sorry');\n\n\t\t\t$this->form_validation->set_rules('category_name', 'Category Name', 'required|trim');\n\t\t\t$this->form_validation->set_rules('visible', 'Access To Payspecifications', 'required|trim');\n\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->ledger_model->add_acct_category();\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Accounts Category Created Successfully...!!!');\n\t\t\t\t\tredirect(base_url('ledger'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\ntheme('add_acct_category');\n\t}", "public function addAction()\n {\n $manager = $this->getDI()->get('core_category_manager');\n $this->view->form = $manager->getForm();\n }", "public function categoryForm(){\n $table = \"categories\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $category){\n echo('<option value=\"'.$category[\"cat_id\"].'\">'.$category[\"cat_name\"].'</option>');\n }\n\n\n }", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "public function addDietaryCategory(){\n \t$id = $this->formValueForKey(\"dietaryCategorySelection\");\n \t \n \t$foundDietaryCategory = BLGenericRecord::recordMatchingKeyAndValue(\"DietaryCategory\", \"id\", $id);\n \t$this->currentRecipe()->addDietaryCategory($foundDietaryCategory);\n }", "public function add(){\n\t\t\t\n\t\t\trequire_once('views/category/add.php');\n\t\t}", "public function addCathegory($values)\n\t{\n\t\treturn $this->getTable('kategoria')->insert(array(\n\t\t\t'Nazov' => $values->nazov,\n\t\t));\n\t}", "public function storeNutrationCategory(Request $request)\n {\n $this->validate($request,array(\n 'nutrationCategoryName' => 'required',\n //'tips' => 'required',\n ));\n\n $nutrationCategory = new NutrationCategory;\n\n $nutrationCategory->nutration_category_name = $request->nutrationCategoryName;\n //$nutrationCategory->tips = $request->tips;\n\n $nutrationCategory->save();\n\n if($nutrationCategory->save()){\n return redirect()->back()->with('success','Nutration category Saved successfully.');\n }\n else{\n return redirect()->back()->with('denger-success','Nutration category is not saved.');\n }\n \n }", "public function addAction()\n\t{\n\t\t$this->oView->box_title = \"Add Category\";\n\t\t$configure_languages = $this->oConfigureModule['configure_languages'];\n\t\t$this->oView->configure_languages = $configure_languages;\n\t\t$this->oView->link_url = site_url('dashboard/category/add');\n\t\t\n\t\tif ($this->oInput->isPost())\n\t\t{\n\t\t\t$objCat = new Category();\n\t\t\t\n\t\t\t$parent_code = $this->oInput->post('parent_code');\n\t\t\t$parent_id = 0;\n\t\t\t\n\t\t\tif (trim(strtolower($parent_code)) != \"root\") \n\t\t\t{\n\t\t\t\t$row = $objCat->getRow(\"code = ?\",array($parent_code));\n\t\t\t\t$parent_id = $row[\"id\"]; \n\t\t\t}\n\t\t\t\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t\t$data['code'] = $this->oInput->post('code');\n\t\t\t$data['active'] = $this->oInput->post('active');\n\t\t\t$data['sort_order'] = $this->oInput->post('sort_order');\n\t\t\t\n\t\t\tforeach ($configure_languages['languages'] as $code => $row)\n\t\t\t{\n\t\t\t\t$data[\"name_{$code}\"] = $this->oInput->post(\"name_{$code}\");\n\t\t\t\t$data[\"description_{$code}\"] = $this->oInput->post(\"description_{$code}\");\n\t\t\t\t$data[\"icon_{$code}\"] = $this->oInput->post(\"icon_{$code}\");\n\t\t\t\t$data[\"image_{$code}\"] = $this->oInput->post(\"image_{$code}\");\n\t\t\t}\n\t\t\t\n\t\t\t$data['create_at'] = now_to_mysql();\n\t\t\t$last_id = $objCat->insert($data);\n\t\t\t\n\t\t\tredirect(\"dashboard/category/list\");\n\t\t}\n\n\t\t$this->renderView('dashboard/category/_form');\n\t}", "public function newAction()\n {\n\t\tTag::appendTitle('Add New Category');\n }", "public function addNutritionalBenefit(){\n \t$id = $this->formValueForKey(\"nutritionalBenefitSelection\");\n \n \t$foundNutritionalBenefit = BLGenericRecord::recordMatchingKeyAndValue(\"NutritionalBenefit\", \"id\", $id);\n \t$this->currentRecipe()->addNutritionalBenefit($foundNutritionalBenefit);\n }", "public function showCategoryForm() {\n $company_logo = $this->showLogoImage();\n $category_images = \\App\\CouponCategory::categoryList();\n $signup_category_images = \\App\\CouponCategory::categoryListWeb();\n $country_list = \\App\\Country::countryList();\n\n return view('frontend.signup.category')->with(['company_logo' => $company_logo,\n 'category_images' => $category_images, 'signup_category_images' => $signup_category_images,\n 'country_list' => $country_list]);\n }", "public function addcompanycategory(){\n $data = ['name'=> post('categoryname')];\n $this->Database->insert_data('companycategories',$data);\n flash('green','check',\"Kategoriya uğurla əlavə edildi.\");\n back();\n }", "function gtags_group_category_form() {\n\tglobal $bp, $show_group_add_form_cats;\t\n\tif ($show_group_add_form_cats) return; // prevents showing form twice\n\t$show_group_add_form_cats = true;\n\n\t// the group category\t\n\t$group_cats = get_option('gtags_category'); \n\tif (empty($group_cats)) return;\n\t\n\t$selected = groups_get_groupmeta( $bp->groups->current_group->id, 'gtags_group_cat' ); \n\t?><label for=\"group-cat\"><?php _e( 'Group Category', 'gtags' ) ?></label>\n\t<select name=\"group-cat\" id=\"group-cat\" />\n\t\t<option value=\"\"><?php _e('--- SELECT ONE ---', 'gtags') ?></option>\n\t<?php foreach ( $group_cats as $tag => $desc ): ?>\n\t\t<?php if ( !$desc ) $desc = $tag; ?>\n\t\t<option value=\"<?php echo $tag; ?>\" <?php if ( $tag == $selected ) echo 'selected=\"selected\"' ?>><?php echo $desc; ?></option>\n\t<?php endforeach; ?>\n\t</select>\n\t<i><?php _e('(the primary group activity)', 'gtags'); ?></i><br><?php \t\n}", "public function addAction()\n {\n $form = new CategoryForm();\n $form->get('submit')->setValue('Add');\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $category = new Category();\n $form->setInputFilter($category->getInputFilter());\n $form->setData($request->getPost());\n\n if ($form->isValid()) {\n $category->exchangeArray($form->getData());\n $this->getCategoryTable()->saveCategory($category);\n\n // Redirect to list of categorys\n return $this->redirect()->toRoute('category');\n }\n }\n return array('form' => $form);\n }", "public function add_category() {\n\t\n\t\tif($this->input->post('add_type')=='add_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name'),\n\t\t'created_at' => date('d-m-Y h:i:s')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->add_assets_category($data);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_added');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "function display_addcategory_form($category_name='', $id='')\r\n{\r\n\tglobal $dropbox_cnf;\r\n\r\n\t$title=get_lang('AddNewCategory');\r\n\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\t// retrieve the category we are editing\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\t\t$row=mysql_fetch_array($result);\r\n\r\n\t\tif ($category_name=='') // after an edit with an error we do not want to return to the original name but the name we already modified. (happens when createinrecievedfiles AND createinsentfiles are not checked)\r\n\t\t{\r\n\t\t\t$category_name=$row['cat_name'];\r\n\t\t}\r\n\t\tif ($row['received']=='1')\r\n\t\t{\r\n\t\t\t$target='received';\r\n\t\t}\r\n\t\tif ($row['sent']=='1')\r\n\t\t{\r\n\t\t\t$target='sent';\r\n\t\t}\r\n\t\t$title=get_lang('EditCategory');\r\n\r\n\t}\r\n\r\n\tif ($_GET['action']=='addreceivedcategory')\r\n\t{\r\n\t\t$target='received';\r\n\t}\r\n\tif ($_GET['action']=='addsentcategory')\r\n\t{\r\n\t\t$target='sent';\r\n\t}\r\n\r\n\r\n\techo \"<form name=\\\"add_new_category\\\" method=\\\"post\\\" action=\\\"\".api_get_self().\"?view=\".$_GET['view'].\"\\\">\\n\";\r\n\techo '<strong>'.$title.'</strong>';\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\techo '<input name=\"edit_id\" type=\"hidden\" value=\"'.$id.'\">';\r\n\t}\r\n\techo '<input name=\"target\" type=\"hidden\" value=\"'.$target.'\">';\r\n\techo \"<table border=\\\"0\\\">\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo get_lang('CategoryName').': ';\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"text\\\" name=\\\"category_name\\\" value=\\\"\".$category_name.\"\\\" />\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td valign=\\\"top\\\">\\n\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"submit\\\" name=\\\"StoreCategory\\\" value=\\\"\".get_lang('Ok').\"\\\">\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"</table>\\n\";\r\n\techo \"</form>\";\r\n}", "public function add()\n {\n $category = $this->Category->newEntity();\n if ($this->request->is('post')) {\n $category = $this->Category->patchEntity($category, $this->request->getData());\n if ($this->Category->save($category)) {\n $this->Flash->success(__('The category has been saved.'));\n\n return $this->redirect(['action' => 'index']);\n }\n $this->Flash->error(__('The category could not be saved. Please, try again.'));\n }\n $this->set(compact('category'));\n }", "public function category()\n { \n if($this->access_role->is_Admin() == false) show_404();\n $this->load->model('Category_Model');\n \n if($_SERVER['REQUEST_METHOD'] == 'POST')\n {\n if($this->form_validation->run('category_insert') ){\n $this->Category_Model->add_category(); \n } else {\n $error = ['class'=>'warning','text'=> validation_errors()];\n $this->session->set_flashdata('sms_flash', $error); \n redirect('Dashboard/category');\n }\n } \n else{\n $data = $this->Category_Model->view_category();\n }\n \n $this->load->view('admin/category_content',$data);\n }", "public function add()\n\t{\n\t\t$data[\"icons\"] = $this->M_Icon->getAll();\n\t\t$data[\"title\"] = 'Tambah Kategori';\n\n\t\t$validation = $this->form_validation;\n\n\t\t$rules = [\n\t\t\t[\n\t\t\t\t'field' => 'kategori',\n\t\t\t\t'rules' => 'required'\n\t\t\t],\n\t\t\t[\n\t\t\t\t'field' => 'deskripsi',\n\t\t\t\t'rules' => 'required'\n\t\t\t]\n\t\t];\n\n\t\t$validation->set_rules($rules);\n\n\t\tif ($validation->run()) {\n\t\t\t$this->kategori_model->save();\n\t\t\t$this->session->set_flashdata('stsMessage', 'Data Berhasil disimpan');\n\t\t\tredirect('Kategori');\n\t\t}\n\n\t\t$this->load->view(\"admin/kategori/new_form\", $data);\n\t}", "public function createCategory();" ]
[ "0.69676876", "0.69144493", "0.69017804", "0.68650234", "0.68249476", "0.67566377", "0.6712905", "0.668728", "0.6656021", "0.6614073", "0.6611625", "0.6608978", "0.6608551", "0.65376264", "0.65324306", "0.6525535", "0.65221816", "0.6514171", "0.6511999", "0.6508002", "0.64992195", "0.6498333", "0.64611644", "0.6458852", "0.64521813", "0.64521384", "0.64497775", "0.6434786", "0.6422214", "0.6422101" ]
0.7627313
0
/Store nutrition category data form
public function storeNutrationCategory(Request $request) { $this->validate($request,array( 'nutrationCategoryName' => 'required', //'tips' => 'required', )); $nutrationCategory = new NutrationCategory; $nutrationCategory->nutration_category_name = $request->nutrationCategoryName; //$nutrationCategory->tips = $request->tips; $nutrationCategory->save(); if($nutrationCategory->save()){ return redirect()->back()->with('success','Nutration category Saved successfully.'); } else{ return redirect()->back()->with('denger-success','Nutration category is not saved.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function storeCategory(array $data): void\n {\n }", "private function getCategoryPostData()\n {\n // Get data from form fields\n $this->data['category_title'] = $this->input->post('category_title');\n }", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "public function addNutrationCategory()\n {\n return view('admin.addnutratoncategory');\n }", "public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}", "public function save_category_info($data) {\n $this->db->insert('tbl_category', $data);\n }", "public function store() {\n if ($id = Input::get('id')) {\n $category = Category::find($id);\n } else {\n $category = new Category();\n }\n\n $inputs = Input::only(['type', 'parent_id', 'name', 'description',\n 'slug', 'keywords', 'order', 'status', 'template']);\n $rules = [\n 'type' => 'in:subject,application,product',\n 'name' => 'required|min:1',\n 'order' => 'required|numeric',\n ];\n\n $validator = Validator::make($inputs, $rules);\n $validator->sometimes('slug', 'unique:categories,slug', function() use($inputs, $category) {\n return !empty($inputs['slug']) && ($category->slug != $inputs['slug']);\n });\n //todo: 循环继承的问题解决思路\n //在数据库存一个layer的字段,标明改分类的层级,p_id=0的为1层\n //递归n次得到p_id=0则为n层\n //最后对比大小禁止循环继承\n if ($validator->fails()) {\n $messages = $validator->messages()->toArray();\n return $this->msg($messages, 1);\n }\n\n $category->fill($inputs);\n $category->save();\n\n return $this->msg('success', 0);\n }", "public function store(){\n $query = require 'core/bootstrap.php';\n \n $category = $_POST['category'];\n if(empty($category)){\n Validate::errorValidation('Category\\'s name is required!');\n return back();\n }elseif(strlen($category) < 3){\n Validate::errorValidation('Category\\'s name must have up to 3 characters');\n return back();\n }else{\n\n $query->insert('categories',[\n 'name' => $category\n ]);\n \n Validate::successValidation('Category stored successfully!!!');\n return redirect('categories');\n }\n }", "private function SaveData()\n {\n // loop tanks and save data\n foreach ($this->tanks AS $tank_id => $data) {\n // get category id from tank id\n $category_id_tank = $this->CreateCategoryByIdentifier($this->InstanceID, $tank_id, $data['Name']);\n\n // loop tank data and add variables to tank category\n $position = 0;\n foreach ($data AS $key => $value) {\n $this->CreateVariableByIdentifier($category_id_tank, $key, $value, $position);\n $position++;\n }\n }\n }", "protected function saveCategoryFromCategory($form){\n $data = $this->getRequest()->getPost();\n //@todo: validate the data\n $form->setData($data);\n if ($form->isValid()) {\n \n $this->category->exchangeArray($form->getData());\n $categoryTable = $this->getServiceLocator()->get(\"Category\\Model\\CategoryTable\");\n $this->category = $categoryTable->saveCategory($this->category);\n \n if($id = $this->category->getId()){\n $this->redirect()->toRoute('category_home');\n }\n }else{\n \n }\n }", "function category_data()\n\t{\n\t\t$this->data['title'] \t= 'Portfolio Category Data';\n\t\t$this->data['category']\t= $this->portfolio_model->get_all_category();\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/category_data';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function addcompanycategory(){\n $data = ['name'=> post('categoryname')];\n $this->Database->insert_data('companycategories',$data);\n flash('green','check',\"Kategoriya uğurla əlavə edildi.\");\n back();\n }", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "public function store() {\n\t\t$data = $this->input->post();\n\t\t$insert['kode_kategori'] = $data['sub_kategori'];\n\t\t$insert['nama'] = $data['nama_kategori'];\n\t\tif ($data['induk'] != \"\") {\n\t\t\t$insert['kode_induk_kategori'] = $this->kategori_m->get_by(array('id' => $data['induk']))->kode_kategori;\n\t\t}\n\t\tif ($this->kategori_m->insert($insert)) {\n\t\t\t$this->message('Berhasil! Data berhasil di simpan', 'success');\n $this->cache->delete('homepage');\n $this->cache->delete('list_kategori');\n\t\t} else {\n\t\t\t$this->message('Gagal! Data gagal di simpan', 'danger');\n\t\t}\n\t\tredirect('kategori');\n\t}", "public function store()\n\t{\n\t\t$category \t\t= \tInput::get('category');\n\t\t$categoryList \t=\tInput::get('categoryList');\n\t\tif ($category \t== \tnull) : \n\t\t\treturn Redirect::route('admin.categories.index')->with('message-error','همه گزینه ها اجباری است.')->withInput();\n\t\tendif;\n\t\tCategory::setCategory($category,$categoryList);\n\t\treturn Redirect::route('admin.categories.index')->with('message-success','دسته ایجاد شد.');\n\t}", "public function category(){\n\n Excel::import(new ComponentsImport,'/imports/categories.csv');\n $cats = array_values(array_unique(Cache::get('category')));\n for($i=0;$i<count($cats);$i++){\n $sub = new Category();\n $sub->name = $cats[$i];\n $sub->save();\n }\n }", "function _arc_meta_category_meta($event, $step, $data, $rs)\n{\n // category types).\n if ($rs['type']!='article') {\n return $data;\n }\n\n // Get the existing meta data for this category.\n $meta = _arc_meta('category', $rs['name'], true);\n\n $form = hInput('arc_meta_id', $meta['id']);\n $form .= '<div class=\"txp-form-field edit-category-arc_meta_title\">';\n $form .= '<div class=\"txp-form-field-label\">' . tag(gtxt('arc_meta_title'), 'label', ' for=\"arc_meta_title\"') . '</div>';\n $form .= '<div class=\"txp-form-field-value\">' . fInput('text', 'arc_meta_title', $meta['title'], '', '', '', '32', '', 'arc_meta_title') . '</div>';\n $form .= '</div>';\n $form .= '<div class=\"txp-form-field edit-category-arc_meta_image\">';\n $form .= '<div class=\"txp-form-field-label\">' . tag(gtxt('arc_meta_image'), 'label', ' for=\"arc_meta_image\"') . '</div>';\n $form .= '<div class=\"txp-form-field-value\">' . fInput('number', 'arc_meta_image', $meta['image'], '', '', '', '32', '', 'arc_meta_image') . '</div>';\n $form .= '</div>';\n $form .= '<div class=\"txp-form-field edit-category-arc_meta_robots\">';\n $form .= '<div class=\"txp-form-field-label\">' . tag(gtxt('arc_meta_robots'), 'label', ' for=\"arc_meta_description\"') . '</div>';\n $form .= '<div class=\"txp-form-field-value\">' . selectInput('arc_meta_robots', _arc_meta_robots(), $meta['robots'], 'arc_meta_robots') . '</div>';\n $form .= '</div>';\n\n return $data . $form;\n}", "public function store()\n\t{\n\t\t$description = Input::get('description'); \n\t\t$acronym = substr($description, 0, 1);\n\t\t$category = new Category(); \n\t\t$category->language_id = Input::get('language_id'); \n\t\t$category->description = $description;\n\t\t$category->acronym = $acronym;\n\t\t$category->save(); \n\t\treturn Response::json(array('success'=>'Categoria registrada exitosamente')); \n\t}", "public function postStore()\n\t{\n\t\t$response['status'] = 'error';\n\t\t$response['message'] = trans('categories.not_created');\n\n\t\tif ( ! empty($_POST))\n\t\t{\n\t\t\t$error = FALSE;\n\n\t\t\tif (empty(trim(Input::get('title'))))\n\t\t\t{\n\t\t\t\t$response['message'] = trans('categories.title_required');\n\t\t\t\t$error = TRUE;\n\t\t\t}\n\n\t\t\t$category_level = Input::get('level');\n\t\t\t$parent = Input::get('parent');\n\t\t\tif ( ! empty($category_level) && in_array($category_level, ['1', '2']))\n\t\t\t{\n\t\t\t\tif (empty($parent))\n\t\t\t\t{\n\t\t\t\t\t$response['message'] = trans('categories.parent_required');\n\t\t\t\t\t$error = TRUE;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($error === FALSE)\n\t\t\t{\n\t\t\t\t$data = [\n\t\t\t\t\t'title' => trim(Input::get('title')),\n\t\t\t\t\t'description' => Input::get('description'),\n\t\t\t\t\t'level' => $category_level,\n\t\t\t\t\t'parent' => $parent,\n\t\t\t\t\t'size_group' => Input::get('size_group'),\n\t\t\t\t\t'position' => Input::get('position'),\n\t\t\t\t\t'visible' => Input::get('visible'),\n\t\t\t\t\t'active' => Input::get('active'),\n\t\t\t\t\t'page_title' => Input::get('page_title'),\n\t\t\t\t\t'meta_description' => Input::get('meta_description'),\n\t\t\t\t\t'meta_keywords' => Input::get('meta_keywords'),\n\t\t\t\t];\n\n\t\t\t\tif (($id = Model_Categories::createCategory($data)) > 0)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t//Manage Friendly URL\n\t\t\t\t\t\tModel_Categories::setURL($id, Input::get('friendly_url'));\n\n\t\t\t\t\t\t$response['status'] = 'success';\n\t\t\t\t\t\t$response['message'] = trans('categories.created');\n\t\t\t\t\t\t$response['category_id'] = $id;\n\t\t\t\t\t} catch (Exception $e)\n\t\t\t\t\t{\n\t\t\t\t\t\t$response['message'] = $e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$response['message'] = trans('categories.not_created');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn response()->json($response);\n\t}", "public function categoryStore(Request $request){\n $category = new ProductCategory();\n $category->category_name = $request->category_name;\n $category->company_id = company_id();\n $category->save();\n return redirect()->back();\n }", "public function addCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t \t$name = $_REQUEST['name'];\n $father = $_REQUEST['father'];\n\t\t\t$form = M(\"categoryinfo\");\n\t\t\t$addnew['name'] = $name;\n $addnew['father'] = $father;\n\t\t\t$result = $form->add($addnew);\n\t\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t//else {$this->error('添加失败');}\n }", "public function store()\n {\n /* VALIDATE DATA COMING IN FROM FORM */\n $this->validate(request(), [\n 'name' => 'required',\n 'is_active' => 'required'\n ]);\n /* CREATE AND SAVE NEW CATEGORY TO DATABASE */\n Category::create([\n 'name' => request('name'),\n 'is_active' => request('is_active')\n ]);\n /* REDIRECT USER AFTER SAVE */\n session()->flash('message', 'Category Added Successfully');\n return redirect()->route('categories.index');\n }", "public function addNutritionalBenefit(){\n \t$id = $this->formValueForKey(\"nutritionalBenefitSelection\");\n \n \t$foundNutritionalBenefit = BLGenericRecord::recordMatchingKeyAndValue(\"NutritionalBenefit\", \"id\", $id);\n \t$this->currentRecipe()->addNutritionalBenefit($foundNutritionalBenefit);\n }", "public function run()\n {\n Category::insert([\n \t['name'=>'Sci-fi','created_at'=>NULL,'updated_at'=>NULL],\n \t['name'=>'Suspense','created_at'=>NULL,'updated_at'=>NULL],\n \t['name'=>'Religious','created_at'=>NULL,'updated_at'=>NULL],\n \t['name'=>'Romance','created_at'=>NULL,'updated_at'=>NULL]]);\n }", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Opdcasecategory::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tOpdcasecategory::create($data);\n\n\t\treturn Redirect::route('opdcasecategories.index');\n\t}", "public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => 'required|unique:product_characteristics,name',\n ]);\n\n ProductCharacteristic::create($request->input());\n\n return redirect()->route('product-characteristics.index')->with('success', 'Category created successfully');\n }", "public function addCathegory($values)\n\t{\n\t\treturn $this->getTable('kategoria')->insert(array(\n\t\t\t'Nazov' => $values->nazov,\n\t\t));\n\t}", "public function storeCategory()\n {\n $this->validate([\n 'name' =>'required',\n 'slug' =>'required|unique:categories'\n ]);\n $category = new Category();\n $category->name = $this->name; \n $category->slug = $this->slug;\n $category->save();\n $this->dispatchBrowserEvent('success');\n //$this->emit('alert', ['type' =>'success', 'message' => 'Operation Successful']);\n //session()->flash('message', 'Category has been saved successfully');\n //$this->dispatchBrowserEvent('hide-form', ['message' => 'Category Added Successfully']);\n }", "public function store()\n\t{\n\t\t$img = $this->save_file(Input::file('thumbnail'), 60, 25, 'categories');\n\t\t//滚动图像\n\t\t$slides = array();\n\t\tif(Input::hasFile('slides')){\n\t\t\tforeach(Input::file('slides') as $file){\n\t\t\t\t$slides[] = $this->save_file($file, 50, 14, 'categories');\n\t\t\t}\n\t\t}\n\t\t$slide = serialize($slides);\n\n\t\t$inputs = Input::except('thumbnail', 'slides');\n\t\t$inputs['thumbnail'] = $img;\n\t\t$inputs['slides'] = $slide;\n\n\t\t$category = Category::create($inputs);\n if ( !$category->errors()->all() )\n {\n return Redirect::route('admin.categories.index')\n ->with('success', Lang::get('cpanel::common.create_success'));\n }\n\n return Redirect::back()\n ->withInput()\n ->withErrors($category->errors());\n\t}", "public function store()\n {\n $this->validate(request(),[\n 'categoryname' => 'required',\n 'description' => 'max:200'\n ]);\n\n $cateName=strtolower(trim(request('categoryname')));\n $testCate=Category::where('name','=',$cateName)->first();\n $categorydes=request('description');\n //if there is no category create new one\n if($testCate==null){\n\n $newcategory=Category::create([\n 'teacher_id' => auth('teacher')->id(),\n 'name' => request('categoryname'),\n 'description' => $categorydes\n ]);\n\n $newcategory->description=$categorydes;\n $newcategory->save();\n session()->flash('message','categoty successfully created');\n return redirect(route('teacher.dashboard'));\n\n }\n else {\n\n session()->flash('message','duplicate category name');\n return redirect()->back();\n\n }\n\n }" ]
[ "0.638003", "0.6293937", "0.62295073", "0.6156473", "0.6106529", "0.6040855", "0.60370666", "0.602494", "0.6020303", "0.59738475", "0.5970187", "0.59676784", "0.5944608", "0.59403944", "0.59081626", "0.5884613", "0.5880202", "0.58768755", "0.58323884", "0.5800276", "0.5799089", "0.5795686", "0.57826823", "0.57779086", "0.5766555", "0.5761285", "0.5750716", "0.57454515", "0.57418746", "0.5738552" ]
0.6651365
0
/Add program Category form
public function addProgramCategory() { return view('admin.addprogramcategory'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n if (!isset(request()->program)) {\n $category = Programs::all();\n } else {\n $category = Programs::where(\"id\", request()->program)->first();\n }\n return view(\"admin/action/create\", compact(\"category\"));\n }", "public function servicecat(){\n\t\t$modelservices = new Application_Model_Services();\n\t\t\n\t\t$servicelist = $modelservices->servicesdata();\n\t\t//prd($servicelist);\n\t\t\t\t\t\n \t\t$this->addElement('text', 'service_name', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required',\n\t\t\t\"label\" => \"Service Category Title \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\" Expertise Title is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t\n\t\t$this->addElement('select', 'service_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$servicelist,\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n \t\t$this->submitButton();\n \t}", "public function add_category() {\n\t $this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(substr($_POST[\"id\"], 4));\n\t\t$this->model->categories = $category;\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t}", "public function addAction()\n\t{\n\t\t$this->oView->box_title = \"Add Category\";\n\t\t$configure_languages = $this->oConfigureModule['configure_languages'];\n\t\t$this->oView->configure_languages = $configure_languages;\n\t\t$this->oView->link_url = site_url('dashboard/category/add');\n\t\t\n\t\tif ($this->oInput->isPost())\n\t\t{\n\t\t\t$objCat = new Category();\n\t\t\t\n\t\t\t$parent_code = $this->oInput->post('parent_code');\n\t\t\t$parent_id = 0;\n\t\t\t\n\t\t\tif (trim(strtolower($parent_code)) != \"root\") \n\t\t\t{\n\t\t\t\t$row = $objCat->getRow(\"code = ?\",array($parent_code));\n\t\t\t\t$parent_id = $row[\"id\"]; \n\t\t\t}\n\t\t\t\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t\t$data['code'] = $this->oInput->post('code');\n\t\t\t$data['active'] = $this->oInput->post('active');\n\t\t\t$data['sort_order'] = $this->oInput->post('sort_order');\n\t\t\t\n\t\t\tforeach ($configure_languages['languages'] as $code => $row)\n\t\t\t{\n\t\t\t\t$data[\"name_{$code}\"] = $this->oInput->post(\"name_{$code}\");\n\t\t\t\t$data[\"description_{$code}\"] = $this->oInput->post(\"description_{$code}\");\n\t\t\t\t$data[\"icon_{$code}\"] = $this->oInput->post(\"icon_{$code}\");\n\t\t\t\t$data[\"image_{$code}\"] = $this->oInput->post(\"image_{$code}\");\n\t\t\t}\n\t\t\t\n\t\t\t$data['create_at'] = now_to_mysql();\n\t\t\t$last_id = $objCat->insert($data);\n\t\t\t\n\t\t\tredirect(\"dashboard/category/list\");\n\t\t}\n\n\t\t$this->renderView('dashboard/category/_form');\n\t}", "public function categoryForm(){\n $table = \"categories\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $category){\n echo('<option value=\"'.$category[\"cat_id\"].'\">'.$category[\"cat_name\"].'</option>');\n }\n\n\n }", "public function newAction()\n {\n\t\tTag::appendTitle('Add New Category');\n }", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "public function addCategory(){\n if (isset($_POST[\"add_category\"])) {\n $categories = $this->model('Categories');\n $system = $this->model('System');\n $cat_name = $_POST[\"cat_name\"];\n $cat_sef_url = $system->seflink($cat_name);\n\n $categories->addCat($cat_name,$cat_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/categories');\n }", "public function addNewItem($category)\n {\n //Add tool\n if ($category==\"tools\") {\n\n if (isset($_POST['addTool'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['description'];\n\n //create an object of tools and add it to the database\n $tool=new Tool($name, $quantity, $date_added ,$description_type);\n $tool->addItem();\n\n }\n //add feeds\n }else if ($category==\"feeds\") {\n if (isset($_POST['addFeed'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['type'];\n\n //create an object of feeeds and add it to the database\n $feed= new Feed($name, $quantity, $date_added ,$description_type);\n $feed->addItem();\n }\n }\n\n }", "public function addAction()\n {\n $manager = $this->getDI()->get('core_category_manager');\n $this->view->form = $manager->getForm();\n }", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "function add_new_category()\n\t{\n\t\t$this->data['title'] \t= 'Add New Portfolio Category';\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/add_new_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function addCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t \t$name = $_REQUEST['name'];\n $father = $_REQUEST['father'];\n\t\t\t$form = M(\"categoryinfo\");\n\t\t\t$addnew['name'] = $name;\n $addnew['father'] = $father;\n\t\t\t$result = $form->add($addnew);\n\t\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t//else {$this->error('添加失败');}\n }", "public function add(){\n\t\t\t\n\t\t\trequire_once('views/category/add.php');\n\t\t}", "public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);\n }", "public function category_add() {\n\t\t// Setup validation\n\t\t$this->data['validation'] = \"\";\n\t\t$this->data['category']\t= array('name' => '', 'url_name' => '');\n\t\t\n\t\t// Handle POST\n\t\tif ($this->mojo->input->post('category')) {\n\t\t\t// Get the category data\n\t\t\t$this->data['category']\t= $this->mojo->input->post('category');\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert_category($this->data['category'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/categories_all');\n\t\t\t\t$response['message'] = 'Successfully created category';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Show the view\n\t\t$this->_view('category_add');\n\t}", "function add(){\n\t\tif(!$this->checkLogin()){\n\t\t\tredirect(base_url());\n\t\t}\n\n\t\t$pageData['header_title'] = APP_NAME.' | Add Document Category';\n\t\t$pageData['page_title'] = 'Document Category Management';\n\t\t$pageData['parent_menu'] = 'document_management';\n\t\t$pageData['child_menu'] = 'document_category';\n\n\t\t$this->load->view('admin/document_management/category/add', $pageData);\n\t}", "public function storeProgramCategory(Request $request)\n {\n $this->validate($request,array(\n 'categoryName' => 'required',\n 'tips' => 'required',\n ));\n\n $programCategory = new ProgramCategory;\n\n $programCategory->program_category_name = $request->categoryName;\n $programCategory->tips = $request->tips;\n\n $programCategory->save();\n\n if($programCategory->save()){\n return redirect()->back()->with('success','Program category Saved successfully.');\n }\n else{\n return redirect()->back()->with('denger-success','Program category is not saved.');\n }\n \n }", "public function addAction()\n {\n $form = new CategoryForm();\n $form->get('submit')->setValue('Add');\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $category = new Category();\n $form->setInputFilter($category->getInputFilter());\n $form->setData($request->getPost());\n\n if ($form->isValid()) {\n $category->exchangeArray($form->getData());\n $this->getCategoryTable()->saveCategory($category);\n\n // Redirect to list of categorys\n return $this->redirect()->toRoute('category');\n }\n }\n return array('form' => $form);\n }", "function _addCategory()\n\t{\n\t\t// Create categories for our component\n\t\t$basePath = JPATH_ADMINISTRATOR.'/components/com_categories';\n\t\trequire_once $basePath.'/models/category.php';\n\t\t$config\t\t= array('table_path' => $basePath.'/tables');\n\t\t$catmodel\t= new CategoriesModelCategory($config);\n\t\t$catData\t= array('id' => 0, 'parent_id' => 0, 'level' => 1, 'path' => 'uncategorized', 'extension' => 'com_sermonspeaker',\n\t\t\t\t\t\t'title' => 'Uncategorized', 'alias' => 'uncategorized', 'description' => '', 'published' => 1, 'language' => '*');\n\t\t$catmodel->save($catData);\n\t\t$id = $catmodel->getItem()->id;\n\n\t\t$db = JFactory::getDBO();\n\t\t// Updating the example data with 'Uncategorized'\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->update('#__sermon_sermons');\n\t\t$query->set('catid = '.(int)$id);\n\t\t$query->where('catid = 0');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Speakers\n\t\t$query->update('#__sermon_speakers');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Series\n\t\t$query->update('#__sermon_series');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn;\n\t}", "function getCategoryFields() {\n\t\t\n\t\t$model = $this->getModel();\n\t\t$category_id = JRequest::getVar('id');\n\t\t$form = $model->getFieldForm($category_id, 'category');\n\t\t\n\t\tif (!$form) {\n\t\t\techo \"There was an error creating the form\";\n\t\t\texit();\n\t\t}\n\t\t\n\t\techo '<div class=\"fltlft\" style=\"width:250px;\">';\n\t\techo '<fieldset class=\"adminform\" >';\n\t\techo '<legend>New Category</legend>';\n\t\techo '<div class=\"adminformlist\">';\n\t\tforeach ($form->getFieldset() as $field) {\n\t\t\tJHtml::_('wbty.renderField', $field);\n\t\t}\n\t\techo \"</div></fieldset></div>\";\n\t\t\n\t\texit();\n\t}", "public function create()\n {\n return view(\"dashboard.pages.supervisor.category.add\");\n \n }", "function add_cmd()\n\t{\n\t\tif(User::can_add(false,ANY_CATEGORY))\n\t\t{\n\t\t\trequire_once 'forms/edit.php';\n\t\t\t$this->add_form(new EditManageHelpForm());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tUrl::redirect_current();\n\t\t}\n\t}", "public function add_acct_category(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\nif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['ledger1'] = $this->db->get_where('acct_categories', ['category_type' => 'Main']);\n\t\t\t\n\t\t}\n\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'add_acct_category') die('Error! sorry');\n\n\t\t\t$this->form_validation->set_rules('category_name', 'Category Name', 'required|trim');\n\t\t\t$this->form_validation->set_rules('visible', 'Access To Payspecifications', 'required|trim');\n\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->ledger_model->add_acct_category();\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Accounts Category Created Successfully...!!!');\n\t\t\t\t\tredirect(base_url('ledger'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\ntheme('add_acct_category');\n\t}", "function display_addcategory_form($category_name='', $id='')\r\n{\r\n\tglobal $dropbox_cnf;\r\n\r\n\t$title=get_lang('AddNewCategory');\r\n\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\t// retrieve the category we are editing\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\t\t$row=mysql_fetch_array($result);\r\n\r\n\t\tif ($category_name=='') // after an edit with an error we do not want to return to the original name but the name we already modified. (happens when createinrecievedfiles AND createinsentfiles are not checked)\r\n\t\t{\r\n\t\t\t$category_name=$row['cat_name'];\r\n\t\t}\r\n\t\tif ($row['received']=='1')\r\n\t\t{\r\n\t\t\t$target='received';\r\n\t\t}\r\n\t\tif ($row['sent']=='1')\r\n\t\t{\r\n\t\t\t$target='sent';\r\n\t\t}\r\n\t\t$title=get_lang('EditCategory');\r\n\r\n\t}\r\n\r\n\tif ($_GET['action']=='addreceivedcategory')\r\n\t{\r\n\t\t$target='received';\r\n\t}\r\n\tif ($_GET['action']=='addsentcategory')\r\n\t{\r\n\t\t$target='sent';\r\n\t}\r\n\r\n\r\n\techo \"<form name=\\\"add_new_category\\\" method=\\\"post\\\" action=\\\"\".api_get_self().\"?view=\".$_GET['view'].\"\\\">\\n\";\r\n\techo '<strong>'.$title.'</strong>';\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\techo '<input name=\"edit_id\" type=\"hidden\" value=\"'.$id.'\">';\r\n\t}\r\n\techo '<input name=\"target\" type=\"hidden\" value=\"'.$target.'\">';\r\n\techo \"<table border=\\\"0\\\">\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo get_lang('CategoryName').': ';\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"text\\\" name=\\\"category_name\\\" value=\\\"\".$category_name.\"\\\" />\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td valign=\\\"top\\\">\\n\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"submit\\\" name=\\\"StoreCategory\\\" value=\\\"\".get_lang('Ok').\"\\\">\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"</table>\\n\";\r\n\techo \"</form>\";\r\n}", "public function create()\n {\n return view('backend.cat_add');\n }", "function CategoryForm() {\r\n\r\n\t\t$member = Member::currentUser();\r\n\r\n\t\t// Need to sort out how going to handle multiple instances of category\r\n\t\t// front end grid field : https://github.com/webbuilders-group/silverstripe-frontendgridfield\r\n\t\t// grid field extension : https://github.com/silverstripe-australia/silverstripe-gridfieldextensions\r\n\t\t$category = Category::get()->first();\r\n\t\t$fields = $category->FormFields();\r\n\r\n $actions = FieldList::create(\r\n FormAction::create(\"doCategoryForm\")->setTitle(\"Submit\")->addExtraClass('productive'),\r\n FormAction::create(\"cancel\")->setTitle(\"Cancel\")\r\n );\r\n\r\n $form = Form::create($this, 'CategoryForm', $fields, $actions);\r\n\r\n return $form;\r\n\r\n\t}", "public function page_add_edit_cat()\n\t{\n\t\t// Edition\n\t\t$cat_name = '';\n\t\tif ($this->mode == 'edit_cat')\n\t\t{\n\t\t\t$sql = 'SELECT cat_name\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'smilies_cat\n\t\t\t\t\tWHERE cat_id = ' . $this->id;\n\t\t\t$result = Fsb::$db->query($sql);\n\t\t\t$data = Fsb::$db->row($result);\n\t\t\tif (!$data)\n\t\t\t{\n\t\t\t\t$this->mode = 'add_cat';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tFsb::$db->free($result);\n\t\t\t\t$cat_name = $data['cat_name'];\n\t\t\t}\n\t\t}\n\n\t\tFsb::$tpl->set_switch('smileys_add_cat');\n\t\tFsb::$tpl->set_vars(array(\n\t\t\t'L_ADD_EDIT' =>\t\t($this->mode == 'add_cat') ? Fsb::$session->lang('adm_smiley_add_cat') : Fsb::$session->lang('adm_smiley_edit_cat'),\n\t\t\t'CAT_NAME' =>\t\t$cat_name,\n\n\t\t\t'U_ACTION' =>\t\tsid('index.' . PHPEXT . '?p=posts_smiley&amp;mode=' . $this->mode . '&amp;id=' . $this->id),\n\t\t));\n\t}", "public function create() \n\t{\n\t\n\t\t$this->data = (object) array();\n\t\t// Check for post data\n\t\t$this->form_validation->set_rules($this->_validation_rules);\n\t\t\n\t\t\n\t\t// if postback-validate\n\t\tif ($this->form_validation->run()) \n\t\t{\n\t\t\t$input = $this->input->post();\n\t\t\t$id = $this->categories_m->create($input);\n\t\t\t\n\t\t\tEvents::trigger('evt_category_created', $id );\n\t\t\t\n\t\t\t$this->session->set_flashdata('success', lang('success'));\n\t\t\tredirect('admin/shop/categories');\n\t\t\t\n\t\t} \n\t\telse \n\t\t{\n\t\t\tforeach ($this->_validation_rules as $key => $value) \n\t\t\t{\n\t\t\t\t$this->data->{$value['field']} = '';\n\t\t\t}\n\t\t}\n\n\t\t$this->data->parent_category_select \t= $this->categories_m->build_dropdown(array(\n\t\t\t'type'\t=> 'all'\n\t\t)); \n\n\n\t\t// prepare dropdown image folders\n\t\t$folders = $this->_prep_folders();\n\n\n\t\t// Build page\n\t\t$this->template\n\t\t\t->title($this->module_details['name'])\n\t\t\t->set('folders',$folders)\n\t\t\t->append_js('module::admin/categories.js')\t\n\t\t\t->append_js('module::admin/admin.js')\t\t\n\t\t\t->append_metadata($this->load->view('fragments/wysiwyg', $this->data, TRUE))\n\t\t\t->build('admin/categories/form', $this->data);\n\t}" ]
[ "0.6791251", "0.67398465", "0.6735368", "0.67165315", "0.67116857", "0.6615872", "0.6611898", "0.6589547", "0.65745264", "0.6573505", "0.6542764", "0.6485271", "0.64450854", "0.644032", "0.6434564", "0.64265096", "0.64235735", "0.6346596", "0.63265896", "0.62802815", "0.6237475", "0.622664", "0.62098485", "0.6189764", "0.6173463", "0.6167711", "0.6132987", "0.61317986", "0.60815275", "0.6079419" ]
0.7373798
0
/Store program category data form
public function storeProgramCategory(Request $request) { $this->validate($request,array( 'categoryName' => 'required', 'tips' => 'required', )); $programCategory = new ProgramCategory; $programCategory->program_category_name = $request->categoryName; $programCategory->tips = $request->tips; $programCategory->save(); if($programCategory->save()){ return redirect()->back()->with('success','Program category Saved successfully.'); } else{ return redirect()->back()->with('denger-success','Program category is not saved.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "public function storeCategory(array $data): void\n {\n }", "public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}", "public function addNewItem($category)\n {\n //Add tool\n if ($category==\"tools\") {\n\n if (isset($_POST['addTool'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['description'];\n\n //create an object of tools and add it to the database\n $tool=new Tool($name, $quantity, $date_added ,$description_type);\n $tool->addItem();\n\n }\n //add feeds\n }else if ($category==\"feeds\") {\n if (isset($_POST['addFeed'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['type'];\n\n //create an object of feeeds and add it to the database\n $feed= new Feed($name, $quantity, $date_added ,$description_type);\n $feed->addItem();\n }\n }\n\n }", "protected function saveCategoryFromCategory($form){\n $data = $this->getRequest()->getPost();\n //@todo: validate the data\n $form->setData($data);\n if ($form->isValid()) {\n \n $this->category->exchangeArray($form->getData());\n $categoryTable = $this->getServiceLocator()->get(\"Category\\Model\\CategoryTable\");\n $this->category = $categoryTable->saveCategory($this->category);\n \n if($id = $this->category->getId()){\n $this->redirect()->toRoute('category_home');\n }\n }else{\n \n }\n }", "private function getCategoryPostData()\n {\n // Get data from form fields\n $this->data['category_title'] = $this->input->post('category_title');\n }", "public function addProgramCategory()\n {\n return view('admin.addprogramcategory');\n }", "public function store()\n\t{\n\n $validator = Validator::make(\n Input::all(),\n array(\n 'description' => 'required'\n )\n );\n\n if( $validator->fails() ) {\n Session::flash('action_success', false);\n Session::flash('action_message', 'There is an error with your form. Please correct it and try again.');\n return Redirect::action('AdminProgramController@create')->withErrors($validator)->withInput();\n }\n\n $program = Program::create(array(\n 'description' => Input::get('description')\n ));\n\n $program->programOptions()->save(\n new ProgramOption(array(\n 'description' => 'None'\n ))\n );\n\n return Redirect::action('AdminProgramController@show', array($program->id));\n\n\t}", "public function save_category_info($data) {\n $this->db->insert('tbl_category', $data);\n }", "private function runCategory()\n {\n $num = (int) $this->ask('How many records do you want to create for the categories table?');\n factory(Category::class, $num)->create();\n }", "public function run()\n {\n ProgramOption::create( array('description' => 'None', 'program_id' => 1) );\n\n // Entries for program 2: Bachelor of Computer Science\n ProgramOption::create( array('description' => 'None', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Computer Games', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Web Services and Applications', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Computer Systems', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Software Systems', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Information Systems', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Computer Applications', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Computation Arts', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Mathematics and Statistics', 'program_id' => 2) );\n\n // Entries for program 3: Bachelor of Software Engineering\n ProgramOption::create( array('program_id' => 3, 'description' => 'None') );\n ProgramOption::create( array('program_id' => 3, 'description' => 'Computer Games') );\n ProgramOption::create( array('program_id' => 3, 'description' => 'Real-Time, Embedded, and Avionics Software') );\n ProgramOption::create( array('program_id' => 3, 'description' => 'Web Services and Applications') );\n\n }", "public function store(Request $request)\n {\n \n \n $program = Programs::create([\n 'main_image' => $request->main_image,\n 'price' => $request->price,\n 'name' => $request->name,\n 'start_day' => $request->start_day,\n 'kind' => $request->kind,\n 'days' => $request->days,\n 'nights' => $request->nights,\n 'brief' => $request->brief,\n 'place' => $request->place,\n 'overview' => $request->overview,\n 'pricing' => $request->pricing,\n 'general' => $request->general,\n 'price_children' => $request->price_children,\n 'image_gallery' => serialize($request->image_gallery),\n 'itinerary_heading' => serialize($request->itinerary_heading),\n 'itinerary' => serialize($request->itinerary),\n 'pages_id' => $request->pages_id,\n 'small_group' => $request->small_group,\n 'slug' => str_slug($request->name),\n\n ]);\n $program->related()->attach($request->related_programs_id);\n $program->Highlights()->attach($request->package_highlights_id);\n $program->Sights()->attach($request->holiday_sights_id);\n $program->Accommodations()->attach($request->accom_id);\n $program->Addons()->attach($request->add_on_id);\n \n\n\n$program->save();\nSession::flash('Success','Your Program created Successfully');\n return redirect()->route('Program.index')\n ->with('success','Program created successfully');\n }", "public function create()\n {\n if (!isset(request()->program)) {\n $category = Programs::all();\n } else {\n $category = Programs::where(\"id\", request()->program)->first();\n }\n return view(\"admin/action/create\", compact(\"category\"));\n }", "function target_add_cat($cat)\n{\n\tif ($GLOBALS['VERBOSE']) pf('...'. $cat['name']);\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'cat (id, name, view_order, cat_opt) \n\t VALUES('. (int)$cat['id'] .','. _esc($cat['name']) .','. (int)$cat['view_order'] .', 3)');\n\t$GLOBALS['cat_map'][ $cat['id'] ] = $cat['id'];\n/*\nfud_use('cat.inc', true);\n$nc = new fud_cat;\n$nc->name = $c->name;\n$nc->description = $c->description;\n$nc->view_order = $c->disporder;\n$nc->cat_opt = 1|2;\t// This should be the default in cat.inc. Fix in next release and del this line.\n$GLOBALS['cat_map'][$c->fid] = $nc->add('LAST');\t// FIRST should also be defaulted.\n*/\n}", "public function store() {\n if ($id = Input::get('id')) {\n $category = Category::find($id);\n } else {\n $category = new Category();\n }\n\n $inputs = Input::only(['type', 'parent_id', 'name', 'description',\n 'slug', 'keywords', 'order', 'status', 'template']);\n $rules = [\n 'type' => 'in:subject,application,product',\n 'name' => 'required|min:1',\n 'order' => 'required|numeric',\n ];\n\n $validator = Validator::make($inputs, $rules);\n $validator->sometimes('slug', 'unique:categories,slug', function() use($inputs, $category) {\n return !empty($inputs['slug']) && ($category->slug != $inputs['slug']);\n });\n //todo: 循环继承的问题解决思路\n //在数据库存一个layer的字段,标明改分类的层级,p_id=0的为1层\n //递归n次得到p_id=0则为n层\n //最后对比大小禁止循环继承\n if ($validator->fails()) {\n $messages = $validator->messages()->toArray();\n return $this->msg($messages, 1);\n }\n\n $category->fill($inputs);\n $category->save();\n\n return $this->msg('success', 0);\n }", "public function operateCategory(){\n\t\t$title = $_POST['name'];\n\t\t\n\t\t$operation = $_POST['operation'];\n\t\t$id = $_POST['edit_id'];\n\t\t$shared = !empty($_POST['shared']) ? $_POST['shared'] : 0;\n\t\t$description = isset($_POST['description']) ? $_POST['description'] : '';\n\t\t$parent_id = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;\n\t\t$published = isset($_POST['published']) ? $_POST['published'] : 0;\n\t\t$save = $_POST['submit'];\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\t//echo $title.\" \".$operation.\" \".$id.\" \".\" \".$shared.\" \".$save;\n\t\tif(isset($save))\n\t\t{\n\t\t\tif( $operation == 'add' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id,'description' => $description,'published' => $published);\n\t\t\t\t$data = $this->query_model->getCategory(\"downloads\");\n\t\t\t\tif($this->query_model->addCategory($args)){\n\t\t\t\t\tredirect($this->index());\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\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $operation == 'edit' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id ,'description' => $description,'published' => $published);\n\t\t\t\t$this->db->where(\"cat_id\",$id);\n\t\t\t\tif($this->query_model->editCategory($args)){\n\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "function _addCategory()\n\t{\n\t\t// Create categories for our component\n\t\t$basePath = JPATH_ADMINISTRATOR.'/components/com_categories';\n\t\trequire_once $basePath.'/models/category.php';\n\t\t$config\t\t= array('table_path' => $basePath.'/tables');\n\t\t$catmodel\t= new CategoriesModelCategory($config);\n\t\t$catData\t= array('id' => 0, 'parent_id' => 0, 'level' => 1, 'path' => 'uncategorized', 'extension' => 'com_sermonspeaker',\n\t\t\t\t\t\t'title' => 'Uncategorized', 'alias' => 'uncategorized', 'description' => '', 'published' => 1, 'language' => '*');\n\t\t$catmodel->save($catData);\n\t\t$id = $catmodel->getItem()->id;\n\n\t\t$db = JFactory::getDBO();\n\t\t// Updating the example data with 'Uncategorized'\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->update('#__sermon_sermons');\n\t\t$query->set('catid = '.(int)$id);\n\t\t$query->where('catid = 0');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Speakers\n\t\t$query->update('#__sermon_speakers');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Series\n\t\t$query->update('#__sermon_series');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn;\n\t}", "public function addCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t \t$name = $_REQUEST['name'];\n $father = $_REQUEST['father'];\n\t\t\t$form = M(\"categoryinfo\");\n\t\t\t$addnew['name'] = $name;\n $addnew['father'] = $father;\n\t\t\t$result = $form->add($addnew);\n\t\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t//else {$this->error('添加失败');}\n }", "public function save(){\n\t\t$sql = new Sql();\n\n\t\t$results = $sql->select(\"CALL sp_categories_save(:idcategory, :descategory)\", array(\n\t\t\t\":idcategory\"=>$this->getidcategory(),\n\t\t\t\":descategory\"=>$this->getdescategory()\n\t\t));\n\n\t\t$this->setData($results[0]);\n\n\n\t\tCategory::updateFile();\n\n\t}", "public function category(){\n\n Excel::import(new ComponentsImport,'/imports/categories.csv');\n $cats = array_values(array_unique(Cache::get('category')));\n for($i=0;$i<count($cats);$i++){\n $sub = new Category();\n $sub->name = $cats[$i];\n $sub->save();\n }\n }", "public function store(Request $request)\n {\n $prog = new program($request->all());\n \n if($prog->save()){\n \n $dll = new \\App\\Dllareaprog();\n $dll->id_area = $request->area;\n $dll->id_programa = $prog->id;\n $dll->save();\n \n return redirect('admin/programs');\n } else {\n return view('programs.create')\n ->with('prog', $prog);\n\n }\n }", "public function run()\n\t{\n\t\tModel::unguard();\n\n\t\tDdgCategory::create([\n\t\t\t'id' => CategoryConstant::CATEGORY_INDIVIDUAL,\n\t\t\t'name' => '個人情報系',\n\t\t]);\n\n\t\tDdgCategory::create([\n\t\t\t'id' => CategoryConstant::CATEGORY_WEB,\n\t\t\t'name' => 'Web系',\n\t\t]);\n\n\t\tDdgCategory::create([\n\t\t\t'id' => CategoryConstant::CATEGORY_TIME,\n\t\t\t'name' => '時間系',\n\t\t]);\n\n\t\tDdgCategory::create([\n\t\t\t'id' => CategoryConstant::CATEGORY_OTHER,\n\t\t\t'name' => '未分類',\n\t\t]);\n\t}", "public function run()\n {\n DB::table('categories')->insert(\n \t[\n \t\t[\n\t 'cat_name' => 'Smartphone',\n\t 'cat_desc' => 'Smartphone Description'\n\t ],\n\t [\n\t 'cat_name' => 'Tablet',\n\t 'cat_desc' => 'Tablet Description'\n\t ],\n\t [\n\t 'cat_name' => 'Smart Watch',\n\t 'cat_desc' => 'Smart Watch Description'\n\t ],\n\t [\n\t 'cat_name' => 'Other Smart Devices',\n\t 'cat_desc' => 'Other Smart Devices Description'\n\t ],\n\t [\n\t 'cat_name' => 'Accesories',\n\t 'cat_desc' => 'Accesories Description'\n\t ],\n \t]\n );\n }", "public function servicecat(){\n\t\t$modelservices = new Application_Model_Services();\n\t\t\n\t\t$servicelist = $modelservices->servicesdata();\n\t\t//prd($servicelist);\n\t\t\t\t\t\n \t\t$this->addElement('text', 'service_name', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required',\n\t\t\t\"label\" => \"Service Category Title \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\" Expertise Title is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t\n\t\t$this->addElement('select', 'service_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$servicelist,\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n \t\t$this->submitButton();\n \t}", "public function AddData()\n {\n echo 'Создалась VirtualCategory - метод Data <br>';\n }", "public function categoryForm(){\n $table = \"categories\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $category){\n echo('<option value=\"'.$category[\"cat_id\"].'\">'.$category[\"cat_name\"].'</option>');\n }\n\n\n }", "public function run()\n {\n Category::insert([\n ['name' => 'Laptops', 'slug' => 'laptops'],\n ['name' => 'Desktops', 'slug' => 'desktops'],\n ['name' => 'Mobile Phones', 'slug' => 'mobile-phones'],\n ['name' => 'Tablets', 'slug' => 'tablets'],\n ['name' => 'TVs', 'slug' => 'tvs'],\n ['name' => 'Digital Cameras', 'slug' => 'digital-cameras'],\n ['name' => 'Appliances', 'slug' => 'appliances'],\n ]);\n }", "public function AddProgram() {\n $data = $this->app[\"request\"];\n\n $isXML = false;\n\n $program = new Program($this->app[\"db\"]);\n\n if (0 === strpos($data->headers->get('Content-Type'), 'application/x-www-form-urlencoded')) {\n\n // posted from a html form\n\n $program->date = $data->get(\"date\");\n $program->time = $data->get(\"time\");\n $program->leadText = $data->get(\"leadText\");\n $program->name = $data->get(\"name\");\n $program->bLine = $data->get(\"b-line\");\n $program->synopsis = $data->get(\"synopsis\");\n $program->url = $data->get(\"url\");\n\n } elseif (0 === strpos($data->headers->get('Content-Type'), 'text/xml')) {\n\n // posted as xml\n\n $xml = (array)simplexml_load_string($data->getContent());\n\n $program->date = $xml[\"date\"];\n $program->time = $xml[\"start_time\"];\n $program->leadText = $xml[\"leadtext\"];\n $program->name = $xml[\"name\"];\n $program->bLine = $xml[\"b-line\"];\n $program->synopsis = $xml[\"synopsis\"];\n $program->url = $xml[\"url\"];\n\n $isXML = true;\n\n }\n\n\n // check for errors\n $errors = $program->validate();\n\n // show the form again if there where errors (and show what the errors where)\n if (count($errors) > 0) {\n if ($isXML) {\n return \"There where errors: \".print_r($errors,true);\n } else {\n return $this->app['twig']->render('index.html.twig', array(\"errors\" => $errors, \"program\" => $program));\n }\n }\n\n // store the record in db\n $persist = $program->persist();\n\n if ($isXML) {\n if ($persist) {\n return \"program persisted\";\n } else {\n return \"failed to persist\";\n }\n }\n\n return $this->app->redirect('/programs.html');\n }", "public function run()\n {\n $categories = [\n [\n 'name' => 'Processor',\n 'description' => 'Otak komputer',\n ],\n [\n 'name' => 'VGA',\n 'description' => 'Untuk kebutuhan grafis',\n ],\n ];\n\n foreach ($categories as $key => $value) {\n Category::create($value);\n }\n }" ]
[ "0.6249412", "0.6124111", "0.5888456", "0.57923037", "0.5727026", "0.57267463", "0.5641175", "0.56360894", "0.5622185", "0.5558223", "0.5539674", "0.55263704", "0.55060816", "0.550298", "0.5502602", "0.5431195", "0.5417658", "0.5393107", "0.5385183", "0.53831905", "0.5369164", "0.53674865", "0.5357434", "0.5333144", "0.53299254", "0.5326019", "0.530585", "0.5304398", "0.5302868", "0.52944" ]
0.6413852
0
/Add Workout category form
public function addWorkoutCategory() { return view('admin.addworkoutcategory'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function storeWorkoutCategory(Request $request)\n {\n $this->validate($request,array(\n 'categoryName' => 'required',\n ));\n\n $workoutCategory = new Category;\n\n $workoutCategory->category = $request->categoryName;\n\n $workoutCategory->save();\n\n if($workoutCategory->save()){\n return redirect()->back()->with('success','Workout category Saved successfully.');\n }\n else{\n return redirect()->back()->with('denger-success','Workout category is not saved.');\n }\n \n }", "function add_new_category()\n\t{\n\t\t$this->data['title'] \t= 'Add New Portfolio Category';\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/add_new_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function add_category() {\n\t $this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(substr($_POST[\"id\"], 4));\n\t\t$this->model->categories = $category;\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t}", "public function updateworkoutcategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n ));\n $id = $request->id;\n $workoutCategory = Category::find($id);\n $workoutCategory->Category = $request->name;\n $workoutCategory->save();\n Session::flash('success','Workout Category Updated succcessfully.');\n return redirect()->back()->with('workout',$workoutCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function addWorkout()\n {\n return view('admin.addworkout');\n }", "public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);\n }", "function gtags_group_category_form() {\n\tglobal $bp, $show_group_add_form_cats;\t\n\tif ($show_group_add_form_cats) return; // prevents showing form twice\n\t$show_group_add_form_cats = true;\n\n\t// the group category\t\n\t$group_cats = get_option('gtags_category'); \n\tif (empty($group_cats)) return;\n\t\n\t$selected = groups_get_groupmeta( $bp->groups->current_group->id, 'gtags_group_cat' ); \n\t?><label for=\"group-cat\"><?php _e( 'Group Category', 'gtags' ) ?></label>\n\t<select name=\"group-cat\" id=\"group-cat\" />\n\t\t<option value=\"\"><?php _e('--- SELECT ONE ---', 'gtags') ?></option>\n\t<?php foreach ( $group_cats as $tag => $desc ): ?>\n\t\t<?php if ( !$desc ) $desc = $tag; ?>\n\t\t<option value=\"<?php echo $tag; ?>\" <?php if ( $tag == $selected ) echo 'selected=\"selected\"' ?>><?php echo $desc; ?></option>\n\t<?php endforeach; ?>\n\t</select>\n\t<i><?php _e('(the primary group activity)', 'gtags'); ?></i><br><?php \t\n}", "function CategoryForm() {\r\n\r\n\t\t$member = Member::currentUser();\r\n\r\n\t\t// Need to sort out how going to handle multiple instances of category\r\n\t\t// front end grid field : https://github.com/webbuilders-group/silverstripe-frontendgridfield\r\n\t\t// grid field extension : https://github.com/silverstripe-australia/silverstripe-gridfieldextensions\r\n\t\t$category = Category::get()->first();\r\n\t\t$fields = $category->FormFields();\r\n\r\n $actions = FieldList::create(\r\n FormAction::create(\"doCategoryForm\")->setTitle(\"Submit\")->addExtraClass('productive'),\r\n FormAction::create(\"cancel\")->setTitle(\"Cancel\")\r\n );\r\n\r\n $form = Form::create($this, 'CategoryForm', $fields, $actions);\r\n\r\n return $form;\r\n\r\n\t}", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "public function addCategory(){\n if (isset($_POST[\"add_category\"])) {\n $categories = $this->model('Categories');\n $system = $this->model('System');\n $cat_name = $_POST[\"cat_name\"];\n $cat_sef_url = $system->seflink($cat_name);\n\n $categories->addCat($cat_name,$cat_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/categories');\n }", "public function add_category_cmb_field( $cmb ) {\n\t\t$field_ids = wp_list_pluck( $cmb->prop( 'fields' ), 'id' );\n\t\t$field_position = array_search( 'header_code', array_keys( $field_ids ), true ) + 1;\n\n\t\t$add_button = '<span class=\"button button-secondary add-redirection-category-button\">' . esc_html__( 'Add New', 'rank-math-pro' ) . '</span>';\n\t\t$add_input = '<input type=\"text\" class=\"add-redirection-category-input exclude\" placeholder=\"' . esc_attr__( 'New Category', 'rank-math-pro' ) . '\" value=\"\">';\n\t\t$manage_link = '<a href=\"' . admin_url( 'edit-tags.php?taxonomy=rank_math_redirection_category' ) . '\" class=\"manage-redirection-categories-link\">' . esc_html__( 'Manage Categories', 'rank-math-pro' ) . '</a>';\n\n\t\t$terms = get_terms(\n\t\t\t[\n\t\t\t\t'taxonomy' => 'rank_math_redirection_category',\n\t\t\t\t'hide_empty' => false,\n\t\t\t]\n\t\t);\n\n\t\t$default_options = [];\n\t\tif ( $this->is_editing() ) {\n\t\t\t$default_options = $this->get_redirection_categories( Param::get( 'redirection' ), [ 'fields' => 'ids' ] );\n\t\t}\n\n\t\t$ids = wp_list_pluck( $terms, 'term_id' );\n\t\t$names = wp_list_pluck( $terms, 'name' );\n\n\t\t$multicheck_options = array_combine( $ids, $names );\n\n\t\t$cmb->add_field(\n\t\t\t[\n\t\t\t\t'id' => 'redirection_category',\n\t\t\t\t'type' => 'multicheck_inline',\n\t\t\t\t'name' => esc_html__( 'Redirection Category', 'rank-math-pro' ),\n\t\t\t\t'desc' => esc_html__( 'Organize your redirections in categories.', 'rank-math-pro' ),\n\t\t\t\t'options' => $multicheck_options,\n\t\t\t\t'select_all_button' => false,\n\t\t\t\t'after_field' => $add_input . $add_button . $manage_link,\n\t\t\t\t'default' => $default_options,\n\t\t\t],\n\t\t\t++$field_position\n\t\t);\n\n\t\t$cmb->add_field(\n\t\t\t[\n\t\t\t\t'id' => 'set_redirection_category',\n\t\t\t\t'type' => 'hidden',\n\t\t\t\t'default' => '1',\n\t\t\t],\n\t\t\t++$field_position\n\t\t);\n\n\t}", "public function addAction()\n {\n $request = $this->getRequest();\n\n $routeMatch = $this->getEvent()->getRouteMatch();\n $id = $routeMatch->getParam('workout_id', 0);\n\n if ($id <= 0) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $workout = $this->_workout->getRow(array('workout_id' => $id));\n//\n if (!$workout) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n /**\n * Grid FORM\n */\n $form = new WorkoutExerciseGrid(\n array(\n 'view' => $this->_view,\n )\n );\n\n /**\n * BUILDING Row\n */\n $row = new WorkoutExerciseRow(\n array(\n 'model' => $this->_exercise,\n 'view' => $this->_view,\n )\n );\n\n $row->setFieldOptions('type_id', array(\n 'values' => $this->_exerciseType->getBehaviour('nestedSet')->getResultSetForSelect(),\n 'onchange' => 'exerciseType(this);',\n ));\n $row->setFieldOptions('workout_id', array(\n 'value' => $id,\n ));\n\n //\n\n\n\n //\n $row->build();\n\n //\n $form->addSubForm($row, $row->getName());\n\n //\n $this->_view->headScript()->appendScript(\n $this->_view->render(\n 'workout-exercise/add.js',\n array(\n 'currentFormType' => 0,\n 'back' => $this->url()->fromRoute(\n 'hi-training/workout-exercise/list/wildcard',\n array('workout_id' => $id)\n ),\n 'ajaxFormType' => $this->url()->fromRoute(\n 'hi-training/exercise-type/ajax-form-type/wildcard',\n array('type_id' => '')\n ),\n 'ajaxLastOfType' => $this->url()->fromRoute(\n 'hi-training/workout-exercise/ajax-last-of-type/wildcard',\n array('type_id' => '')\n ),\n )\n )\n );\n\n\n /**\n * POST\n */\n if ($this->getRequest()->isPost()) {\n\n $formData = $this->getRequest()->post()->toArray();\n\n if ($form->isValid($formData)) {\n\n// \\Zend\\Debug::dump($formData);\n\n if ( isset($formData['header']['formId'])\n && $formData['header']['formId'] == 'WorkoutExerciseGridForm') {\n\n if (isset($formData['WorkoutExerciseRow']['actions']['save'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $newRow = $this->_exercise->createRow()->populate($formData['WorkoutExerciseRow']['row']);\n $newRow->save();\n\n return $this->redirect()->toRoute('hi-training/workout-exercise/list/wildcard', array('workout_id' => $id));\n }\n\n }\n\n if (isset($formData['WorkoutExerciseRow']['actions']['saveAdd'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $newRow = $this->_exercise->createRow()->populate($formData['WorkoutExerciseRow']['row']);\n $newRow->save();\n\n return $this->redirect()->toRoute('hi-training/workout-exercise/add/wildcard', array('workout_id' => $id));\n }\n\n }\n }\n }\n }\n\n //\n return array(\n 'form' => $form,\n 'workout' => $workout,\n );\n\n }", "public function add_acct_category(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\nif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['ledger1'] = $this->db->get_where('acct_categories', ['category_type' => 'Main']);\n\t\t\t\n\t\t}\n\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'add_acct_category') die('Error! sorry');\n\n\t\t\t$this->form_validation->set_rules('category_name', 'Category Name', 'required|trim');\n\t\t\t$this->form_validation->set_rules('visible', 'Access To Payspecifications', 'required|trim');\n\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->ledger_model->add_acct_category();\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Accounts Category Created Successfully...!!!');\n\t\t\t\t\tredirect(base_url('ledger'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\ntheme('add_acct_category');\n\t}", "public function addAction()\n {\n $manager = $this->getDI()->get('core_category_manager');\n $this->view->form = $manager->getForm();\n }", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "function colorpicker_field_add_new_category( $taxonomy ) { ?> \r\n\t<div class=\"form-field term-colorpicker-wrap\"> \r\n\t<label for=\"term-colorpicker\">Category Color</label> \r\n\t<input name=\"_category_color\" value=\"#ffffff\" class=\"colorpicker\" id=\"term-colorpicker\" /> \r\n\t<p>This is the field description where you can tell the user how the color is used in the theme.</p> \r\n\t</div> <?php }", "public function addNewItem($category)\n {\n //Add tool\n if ($category==\"tools\") {\n\n if (isset($_POST['addTool'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['description'];\n\n //create an object of tools and add it to the database\n $tool=new Tool($name, $quantity, $date_added ,$description_type);\n $tool->addItem();\n\n }\n //add feeds\n }else if ($category==\"feeds\") {\n if (isset($_POST['addFeed'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['type'];\n\n //create an object of feeeds and add it to the database\n $feed= new Feed($name, $quantity, $date_added ,$description_type);\n $feed->addItem();\n }\n }\n\n }", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "public function category_add() {\n\t\t// Setup validation\n\t\t$this->data['validation'] = \"\";\n\t\t$this->data['category']\t= array('name' => '', 'url_name' => '');\n\t\t\n\t\t// Handle POST\n\t\tif ($this->mojo->input->post('category')) {\n\t\t\t// Get the category data\n\t\t\t$this->data['category']\t= $this->mojo->input->post('category');\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert_category($this->data['category'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/categories_all');\n\t\t\t\t$response['message'] = 'Successfully created category';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Show the view\n\t\t$this->_view('category_add');\n\t}", "public function create()\n {\n return view(\"jobcategory.create\");\n }", "public function addAction()\n\t{\n\t\t$this->oView->box_title = \"Add Category\";\n\t\t$configure_languages = $this->oConfigureModule['configure_languages'];\n\t\t$this->oView->configure_languages = $configure_languages;\n\t\t$this->oView->link_url = site_url('dashboard/category/add');\n\t\t\n\t\tif ($this->oInput->isPost())\n\t\t{\n\t\t\t$objCat = new Category();\n\t\t\t\n\t\t\t$parent_code = $this->oInput->post('parent_code');\n\t\t\t$parent_id = 0;\n\t\t\t\n\t\t\tif (trim(strtolower($parent_code)) != \"root\") \n\t\t\t{\n\t\t\t\t$row = $objCat->getRow(\"code = ?\",array($parent_code));\n\t\t\t\t$parent_id = $row[\"id\"]; \n\t\t\t}\n\t\t\t\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t\t$data['code'] = $this->oInput->post('code');\n\t\t\t$data['active'] = $this->oInput->post('active');\n\t\t\t$data['sort_order'] = $this->oInput->post('sort_order');\n\t\t\t\n\t\t\tforeach ($configure_languages['languages'] as $code => $row)\n\t\t\t{\n\t\t\t\t$data[\"name_{$code}\"] = $this->oInput->post(\"name_{$code}\");\n\t\t\t\t$data[\"description_{$code}\"] = $this->oInput->post(\"description_{$code}\");\n\t\t\t\t$data[\"icon_{$code}\"] = $this->oInput->post(\"icon_{$code}\");\n\t\t\t\t$data[\"image_{$code}\"] = $this->oInput->post(\"image_{$code}\");\n\t\t\t}\n\t\t\t\n\t\t\t$data['create_at'] = now_to_mysql();\n\t\t\t$last_id = $objCat->insert($data);\n\t\t\t\n\t\t\tredirect(\"dashboard/category/list\");\n\t\t}\n\n\t\t$this->renderView('dashboard/category/_form');\n\t}", "public function categoryForm(){\n $table = \"categories\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $category){\n echo('<option value=\"'.$category[\"cat_id\"].'\">'.$category[\"cat_name\"].'</option>');\n }\n\n\n }", "public function add()\n {\n \t\t$options = array(\n \t\t\t\t'order' => array('Categories.name' => 'asc')\n \t\t);\n \t\t//Get Categories\n \t\t$categories = $this->Jobs->Categories->find('list', $options);\n \t\t//Set Categories\n \t\t$this->set('categories', $categories);\n\n \t\t//Get types for select list\n \t\t$types = $this->Jobs->Types->find('list');\n \t\t//Set Types\n \t\t$this->set('types', $types);\n\n $job = $this->Jobs->newEntity();\n if($this->request->is('post')){\n $this->request->data['Jobs']['user_id'] = $this->Auth->user('id');\n $job = $this->Jobs->patchEntity($job, $this->request->data);\n\n if($this->Jobs->save($job)){\n $this->Flash->success('Your job has been listed');\n return $this->redirect(array('action' => 'index'));\n }\n\n $this->Flash->set('Unable to add your job');\n }\n }", "public function servicecat(){\n\t\t$modelservices = new Application_Model_Services();\n\t\t\n\t\t$servicelist = $modelservices->servicesdata();\n\t\t//prd($servicelist);\n\t\t\t\t\t\n \t\t$this->addElement('text', 'service_name', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required',\n\t\t\t\"label\" => \"Service Category Title \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\" Expertise Title is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t\n\t\t$this->addElement('select', 'service_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$servicelist,\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n \t\t$this->submitButton();\n \t}", "public function stepCategory()\n {\n global $rlSmarty, $rlCategories, $page_info, $account_info, $sError, $config;\n\n parent::step();\n\n $GLOBALS['rlHook']->load('addListingGetCats');\n\n // Define allowed types\n $allowed_type_keys = $account_info['Abilities'];\n\n // \"Individual add listing page\" mode\n if ($page_info['Key'] != 'add_listing') {\n $individual_type_key = substr($page_info['Key'], 3);\n\n if (in_array($individual_type_key, $allowed_type_keys)) {\n $allowed_type_keys = array($individual_type_key);\n } else {\n $sError = true;\n }\n }\n\n // Adapt listing types array\n $allowed_types = $GLOBALS['rlListingTypes']->adaptTypes($allowed_type_keys);\n $rlSmarty->assign_by_ref('allowed_types', $allowed_types);\n\n // Existing membership plan mode\n $this->existingMembershipHandler($account_info);\n\n // Remove unnecessary steps\n if (!$this->singleStep) {\n unset($this->steps['photo'], $this->steps['checkout']);\n }\n }", "public function getAddEditForm($target = '/admin/Cart') {\n\t\t$form = new Form('CartCategory_addedit', 'post', $target);\n\t\t\n\t\t$form->setConstants( array ( 'section' => 'categories' ) );\n\t\t$form->addElement( 'hidden', 'section' );\n\t\t$form->setConstants( array ( 'action' => 'addedit' ) );\n\t\t$form->addElement( 'hidden', 'action' );\n\t\t\n\t\tif (!is_null($this->getId())) {\n\t\t\t$form->setConstants( array ( 'cartcategory_categories_id' => $this->getId() ) );\n\t\t\t$form->addElement( 'hidden', 'cartcategory_categories_id' );\n\t\t\t\n\t\t\t$defaultValues ['cartcategory_name'] = $this->getName();\n\t\t\t$defaultValues ['cartcategory_description'] = $this->getDescription();\n\t\t\t$defaultValues ['cartcategory_image'] = $this->getImage();\n\t\t\t$defaultValues ['cartcategory_parent_id'] = $this->getParent_id();\n\t\t\t$defaultValues ['cartcategory_date_added'] = $this->getDate_added();\n\t\t\t$defaultValues ['cartcategory_last_modified'] = $this->getLast_modified();\n\t\t\t$defaultValues ['cartcategory_status'] = $this->getStatus();\n\n\t\t\t$form->setDefaults( $defaultValues );\n\t\t}\n\t\t\n\t\t$form->addElement('text', 'cartcategory_name', 'Name');\n\t\t\n\t\t$description = $form->addElement('textarea', 'cartcategory_description', 'Description');\n\t\t$description->setCols(80);\n\t\t$description->setRows(10);\n\t\t\n\t\t$newImage = $form->addElement('file', 'cartcategory_image_upload', 'Category Image');\n\t\t$curImage = $form->addElement('dbimage', 'cartcategory_image', $this->getImage());\n\t\t\n\t\t$form->addElement('select', 'cartcategory_parent_id', 'Parent Category', self::toArray());\n\t\t\n\t\t$added = $form->addElement('text', 'cartcategory_date_added', 'Date Added');\n\t\t$added->freeze();\n\t\t\n\t\t$modified = $form->addElement('text', 'cartcategory_last_modified', 'Date Last Modified');\n\t\t$modified->freeze();\n\t\t\n\t\t$form->addElement('select', 'cartcategory_status', 'Status', Form::statusArray());\n\t\t$form->addElement('submit', 'cartcategory_submit', 'Submit');\n\n\t\tif (isset($_REQUEST['cartcategory_submit']) && $form->validate() && $form->isSubmitted()) {\n\t\t\t$this->setName($form->exportValue('cartcategory_name'));\n\t\t\t$this->setDescription($form->exportValue('cartcategory_description'));\n\t\t\t$this->setImage($form->exportValue('cartcategory_image'));\n\t\t\t$this->setParent_id($form->exportValue('cartcategory_parent_id'));\n\t\t\t$this->setDate_added($form->exportValue('cartcategory_date_added'));\n\t\t\t$this->setLast_modified($form->exportValue('cartcategory_last_modified'));\n\t\t\t$this->setStatus($form->exportValue('cartcategory_status'));\n\t\t\t\n\t\t\tif ($newImage->isUploadedFile()) {\n\t\t\t\t$im = new Image();\n\t\t\t\t$id = $im->insert($newImage->getValue());\n\t\t\t\t$this->setImage($im);\n\t\t\t\t\n\t\t\t\t$curImage->setSource($this->getImage()->getId());\n\t\t\t}\n\t\t\t\n\t\t\t$this->save();\n\t\t}\n\n\t\treturn $form;\n\t\t\n\t}", "public function newAction()\n {\n\t\tTag::appendTitle('Add New Category');\n }", "function rmmfNew(){\n\tglobal $db, $mc;\n\t\n\tlist($num) = $db->fetchRow($db->query(\"SELECT COUNT(*) FROM \".$db->prefix(\"rmmf_categos\")));\n\tif ($num<=0){\n\t\tredirect_header('categos.php?op=new', 1, _MA_RMMF_CATEGOFIRST);\n\t\tdie();\n\t}\n\t\n\tdefine('_RMMF_LOCATION','NEWWORK');\n\txoops_cp_header();\n\trmmf_make_adminnav();\n\t\n\tinclude_once '../common/form.class.php';\n\t$form = new RMForm(_MA_RMMF_NEWWORK, 'frmNew', 'index.php?op=save');\n\t$form->setExtra(\"enctype='multipart/form-data'\");\n\t$form->addElement(new RMText(_MA_RMMF_TITLE, 'titulo', 50, 150));\n\t$result = array();\n\t$select = \"<select name='catego'>\n\t\t\t\t<option value='0'>\"._MA_RMMF_SELECT.\"</option>\";\n\trmmf_get_categos($result);\n\tforeach ($result as $k => $v){\n\t\t$select .= \"<option value='$v[id_cat]'>\".str_repeat('-', $v['saltos']).\" $v[nombre]</option>\";\n\t}\n\t$select .= \"</select>\";\n\t$form->addElement(new RMLabel(_MA_RMMF_CATEGO, $select));\n\t$form->addElement(new RMText(_MA_RMMF_CLIENT, 'cliente', 50, 255));\n\t$form->addElement(new RMText(_MA_RMMF_URL, 'url', 50, 255, 'http://'));\n\t$form->addElement(new RMTextArea(_MA_RMMF_SHORT, 'short', 4, 45));\n\t$form->addElement(new RMLabel(_MA_RMMF_DESC, rmmf_select_editor('desc',$mc['editor'],'','100%','250px')));\n\t$form->addElement(new RMTextArea(_MA_RMMF_COMMENT, 'comentario', 4, 45));\n\t$form->addElement(new RMFile(_MA_RMMF_IMG, 'imagen', 45));\n\t$form->addElement(new RMYesNo(_MA_RMMF_FEATURED, 'resaltado', 0));\n\t$form->addElement(new RMButton('sbt',_MA_RMMF_SEND));\n\t$form->display();\n\trmmf_make_footer();\n\txoops_cp_footer();\n}", "public function addAction()\n {\n $form = new CategoryForm();\n $form->get('submit')->setValue('Add');\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $category = new Category();\n $form->setInputFilter($category->getInputFilter());\n $form->setData($request->getPost());\n\n if ($form->isValid()) {\n $category->exchangeArray($form->getData());\n $this->getCategoryTable()->saveCategory($category);\n\n // Redirect to list of categorys\n return $this->redirect()->toRoute('category');\n }\n }\n return array('form' => $form);\n }", "public function create() \n\t{\n\t\n\t\t$this->data = (object) array();\n\t\t// Check for post data\n\t\t$this->form_validation->set_rules($this->_validation_rules);\n\t\t\n\t\t\n\t\t// if postback-validate\n\t\tif ($this->form_validation->run()) \n\t\t{\n\t\t\t$input = $this->input->post();\n\t\t\t$id = $this->categories_m->create($input);\n\t\t\t\n\t\t\tEvents::trigger('evt_category_created', $id );\n\t\t\t\n\t\t\t$this->session->set_flashdata('success', lang('success'));\n\t\t\tredirect('admin/shop/categories');\n\t\t\t\n\t\t} \n\t\telse \n\t\t{\n\t\t\tforeach ($this->_validation_rules as $key => $value) \n\t\t\t{\n\t\t\t\t$this->data->{$value['field']} = '';\n\t\t\t}\n\t\t}\n\n\t\t$this->data->parent_category_select \t= $this->categories_m->build_dropdown(array(\n\t\t\t'type'\t=> 'all'\n\t\t)); \n\n\n\t\t// prepare dropdown image folders\n\t\t$folders = $this->_prep_folders();\n\n\n\t\t// Build page\n\t\t$this->template\n\t\t\t->title($this->module_details['name'])\n\t\t\t->set('folders',$folders)\n\t\t\t->append_js('module::admin/categories.js')\t\n\t\t\t->append_js('module::admin/admin.js')\t\t\n\t\t\t->append_metadata($this->load->view('fragments/wysiwyg', $this->data, TRUE))\n\t\t\t->build('admin/categories/form', $this->data);\n\t}" ]
[ "0.67460954", "0.62550235", "0.6202757", "0.59804004", "0.5974859", "0.5883679", "0.5875688", "0.58718485", "0.58620435", "0.5860522", "0.58561087", "0.5849379", "0.58476734", "0.584638", "0.5837361", "0.5828801", "0.5822643", "0.58087504", "0.5780437", "0.5755626", "0.5730684", "0.57295454", "0.572751", "0.572375", "0.56945306", "0.5688677", "0.5654104", "0.5652301", "0.5637", "0.56151676" ]
0.7685577
0
/Store Workout category data form
public function storeWorkoutCategory(Request $request) { $this->validate($request,array( 'categoryName' => 'required', )); $workoutCategory = new Category; $workoutCategory->category = $request->categoryName; $workoutCategory->save(); if($workoutCategory->save()){ return redirect()->back()->with('success','Workout category Saved successfully.'); } else{ return redirect()->back()->with('denger-success','Workout category is not saved.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addWorkoutCategory()\n {\n return view('admin.addworkoutcategory');\n }", "public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "public function storeCategory(array $data): void\n {\n }", "public function store(Request $request)\n {\n // Validate and store the workout...\n $validatedData = $request->validate([\n 'workout' => 'required|max:255' \n ]);\n }", "private function getCategoryPostData()\n {\n // Get data from form fields\n $this->data['category_title'] = $this->input->post('category_title');\n }", "public function updateworkoutcategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n ));\n $id = $request->id;\n $workoutCategory = Category::find($id);\n $workoutCategory->Category = $request->name;\n $workoutCategory->save();\n Session::flash('success','Workout Category Updated succcessfully.');\n return redirect()->back()->with('workout',$workoutCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function categoryStore(Request $request){\n $category = new ProductCategory();\n $category->category_name = $request->category_name;\n $category->company_id = company_id();\n $category->save();\n return redirect()->back();\n }", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Opdcasecategory::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tOpdcasecategory::create($data);\n\n\t\treturn Redirect::route('opdcasecategories.index');\n\t}", "public function store() {\n if ($id = Input::get('id')) {\n $category = Category::find($id);\n } else {\n $category = new Category();\n }\n\n $inputs = Input::only(['type', 'parent_id', 'name', 'description',\n 'slug', 'keywords', 'order', 'status', 'template']);\n $rules = [\n 'type' => 'in:subject,application,product',\n 'name' => 'required|min:1',\n 'order' => 'required|numeric',\n ];\n\n $validator = Validator::make($inputs, $rules);\n $validator->sometimes('slug', 'unique:categories,slug', function() use($inputs, $category) {\n return !empty($inputs['slug']) && ($category->slug != $inputs['slug']);\n });\n //todo: 循环继承的问题解决思路\n //在数据库存一个layer的字段,标明改分类的层级,p_id=0的为1层\n //递归n次得到p_id=0则为n层\n //最后对比大小禁止循环继承\n if ($validator->fails()) {\n $messages = $validator->messages()->toArray();\n return $this->msg($messages, 1);\n }\n\n $category->fill($inputs);\n $category->save();\n\n return $this->msg('success', 0);\n }", "public function save_category_info($data) {\n $this->db->insert('tbl_category', $data);\n }", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required',\n ]);\n\n $workout = new Workout;\n $workout->name = $request->get('name');\n $workout->description = $request->get('description');\n $workout->save();\n \n return redirect('/admin/workout/create')\n ->with('success', 'Workout creado correctamente');\n }", "public function store($data)\n {\n try {\n $store = new Listing;\n $store->user_id = $data['user_id'] ?? Auth::user()->id;\n $store->listing_category_id = $data['listing_category_id'];\n $store->listing_type = $data['listing_type'];\n $store->state_id = $data['state_id'];\n $store->city_id = $data['city_id'];\n $store->local_govt_id = $data['local_govt_id'];\n $store->title = $data['title'];\n $store->address = $data['address'];\n $store->description = $data['description'] ?? null;\n $store->room_policy = $data['room_policy'] ?? null;\n $store->service_option = $data['service_option'] ?? 'no';\n $store->service_description = $data['service_description'] ?? null;\n $store->baths = $data['baths'] ?? null;\n $store->rooms = $data['rooms'] ?? null;\n $store->pricing_type = $data['pricing_type'] ?? \"monthly\";\n $store->amount = $data['amount'] ?? 0;\n $store->amount = $data['step'] ?? 1;\n $store->save();\n activity()\n ->causedBy(Auth::user())\n ->performedOn($store)\n ->withProperties(['id' => $store->id])\n ->log('listing category created');\n if(!empty($data['property_amenities'])){\n $amenities = new Request(['listing_id' => $store->id, 'amenities'=> $data['property_amenities']]);\n ListingAmenitiesController::bulk_update($amenities);\n }\n return $store;\n } catch (Exception $e) {\n return $e->getMessage();\n }\n }", "public function addNewItem($category)\n {\n //Add tool\n if ($category==\"tools\") {\n\n if (isset($_POST['addTool'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['description'];\n\n //create an object of tools and add it to the database\n $tool=new Tool($name, $quantity, $date_added ,$description_type);\n $tool->addItem();\n\n }\n //add feeds\n }else if ($category==\"feeds\") {\n if (isset($_POST['addFeed'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['type'];\n\n //create an object of feeeds and add it to the database\n $feed= new Feed($name, $quantity, $date_added ,$description_type);\n $feed->addItem();\n }\n }\n\n }", "public function run()\n {\n //\n DB::table('workout_categories')->insert([\n [\n 'name' => 'workoutCat1',\n 'image' => 'image 1',\n ],\n ]);\n }", "public function store(MicategoryRequest $request)\n {\n //\n M_i_category::create($request->all());\n \\Session::flash('flash_message','M Item Category 情報を追加しました');\n return redirect('micategories');\n }", "public function store()\n\t{\n\t\t$input = Input::all();\n\t\tDB::table($input)->create();\n\t\t//Project::create( $input );\n\n\t\treturn Redirect::route('tasksCatagories.index')->with('message', 'Catagory created');\n\n\t}", "public function store()\n {\n $categories = Category::all();\n\n $subcategory = new Subcategory;\n $subcategory->name = request('name');\n foreach($categories as $category){\n if($category->name == request('cat')){\n $subcategory->categories_id = $category->id;\n }\n }\n $subcategory->save();\n\n return redirect('/cms/categories')->with('success', 'Subcategory was added succesfully');\n }", "public function store()\n\t{\n\t\t$category \t\t= \tInput::get('category');\n\t\t$categoryList \t=\tInput::get('categoryList');\n\t\tif ($category \t== \tnull) : \n\t\t\treturn Redirect::route('admin.categories.index')->with('message-error','همه گزینه ها اجباری است.')->withInput();\n\t\tendif;\n\t\tCategory::setCategory($category,$categoryList);\n\t\treturn Redirect::route('admin.categories.index')->with('message-success','دسته ایجاد شد.');\n\t}", "public function store(Request $request)\n {\n // Validazione\n $request->validate($this->validationData());\n\n $requested_data = $request->all();\n // dd($requested_data);\n\n // Nuova istanza Car\n $new_workout = new Workout();\n // $new_workout->user_id = $requested_data['user_id'];\n // $new_workout->name = $requested_data['name'];\n // $new_workout->imgurl = $requested_data['imgurl'];\n // $new_workout->description = $requested_data['description'];\n // $new_workout->reps = $requested_data['reps'];\n $new_workout->fill($requested_data);\n $new_workout->save();\n\n return redirect()->route('admin.workouts.index', $new_workout);\n }", "protected function saveCategoryFromCategory($form){\n $data = $this->getRequest()->getPost();\n //@todo: validate the data\n $form->setData($data);\n if ($form->isValid()) {\n \n $this->category->exchangeArray($form->getData());\n $categoryTable = $this->getServiceLocator()->get(\"Category\\Model\\CategoryTable\");\n $this->category = $categoryTable->saveCategory($this->category);\n \n if($id = $this->category->getId()){\n $this->redirect()->toRoute('category_home');\n }\n }else{\n \n }\n }", "public function store()\n\t{\n\t\t$img = $this->save_file(Input::file('thumbnail'), 60, 25, 'categories');\n\t\t//滚动图像\n\t\t$slides = array();\n\t\tif(Input::hasFile('slides')){\n\t\t\tforeach(Input::file('slides') as $file){\n\t\t\t\t$slides[] = $this->save_file($file, 50, 14, 'categories');\n\t\t\t}\n\t\t}\n\t\t$slide = serialize($slides);\n\n\t\t$inputs = Input::except('thumbnail', 'slides');\n\t\t$inputs['thumbnail'] = $img;\n\t\t$inputs['slides'] = $slide;\n\n\t\t$category = Category::create($inputs);\n if ( !$category->errors()->all() )\n {\n return Redirect::route('admin.categories.index')\n ->with('success', Lang::get('cpanel::common.create_success'));\n }\n\n return Redirect::back()\n ->withInput()\n ->withErrors($category->errors());\n\t}", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'name' => 'required'\n\t\t);\n\t\t$input = Input::except('_token');\n\t\t$validator = Validator::make($input,$rules);\n\t\tif($validator->fails()) {\n\t\t\treturn Redirect::action('CategoryController@create')\n\t ->withErrors($validator)\n\t ->withInput(Input::except('password'));\n } else {\n\t\t\t$inputCategory = Input::only('name');\n\t\t\t$input['game_id'] = CommonNormal::create($inputCategory);\n\t\t\t// if (Input::get('category_parent_id')) {\n\t\t\t// \tforeach (Input::get('category_parent_id') as $value) {\n\t\t\t// \t\t$input['category_parent_id'] = $value;\n\t\t\t// \t\tCommonNormal::create($input, 'GameRelation');\n\t\t\t// \t}\n\t\t\t// }\n\t\t\treturn Redirect::action('CategoryController@index') ;\n\t\t}\n\t}", "public function store(CategoryRequest $request)\n {\n //\n $cates = new Category();\n $cates->name = $request->input('name');\n $cates->role = $request->input('role');\n $cates->status = 1;\n $cates->slug = Str::slug($request->name,\"-\");\n $datetime = Carbon::now('Asia/Ho_Chi_Minh');\n $cates->created_at = $datetime;\n $cates->updated_at = null;\n $cates->save();\n return redirect('admin/danh-muc');\n }", "function category_data()\n\t{\n\t\t$this->data['title'] \t= 'Portfolio Category Data';\n\t\t$this->data['category']\t= $this->portfolio_model->get_all_category();\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/category_data';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function store(Workout $workout)\n {\n request()->validate(['name' => 'required']);\n $workout->addDay(request('name'));\n\n return redirect($workout->path());\n }", "function save_extra_category_fileds( $term_id ) {\n if ( isset( $_POST['Cat_meta'] ) ) {\n $t_id = $term_id;\n $cat_meta = get_option( \"category_$t_id\");\n $cat_keys = array_keys($_POST['Cat_meta']);\n foreach ($cat_keys as $key){\n if (isset($_POST['Cat_meta'][$key])){\n $cat_meta[$key] = $_POST['Cat_meta'][$key];\n }\n }\n //save the option array\n update_option( \"category_$t_id\", $cat_meta );\n }\n}", "function save_extra_category_fileds( $term_id ) {\n if ( isset( $_POST['Cat_meta'] ) ) {\n $t_id = $term_id;\n $cat_meta = get_option( \"category_$t_id\");\n $cat_keys = array_keys($_POST['Cat_meta']);\n foreach ($cat_keys as $key){\n if (isset($_POST['Cat_meta'][$key])){\n $cat_meta[$key] = $_POST['Cat_meta'][$key];\n }\n }\n //save the option array\n update_option( \"category_$t_id\", $cat_meta );\n }\n}", "public function store()\n\t{\n\t\t// validate\n\t\t// read more on validation at http://laravel.com/docs/validation\n\t\t$rules = array(\n\t\t\t'title' => 'required|unique:question-categories',\n\t\t\t'order' => 'required'\n\t\t);\n\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\t// process the login\n\t\tif ($validator->fails()) {\n\t\t\tSession::flash('error_message', 'Validation error, please check all required fields.');\n\t\t\treturn Redirect::to('admin/question-categories/create')\n\t\t\t\t->withErrors($validator)\n\t\t\t\t->withInput(Input::except('password'));\n\t\t}\n\n\t\t// Store\n\t\t$category \t\t\t= new QuestionCategory;\n\t\t$category->title \t= Input::get('title');\n\t\t$category->slug \t= Str::slug(Input::get('title'));\n\t\t$category->order \t= Input::get('order');\n\t\t$category->created_by = Auth::user()->id;\n\n\t\t$category->save();\n\n\t\t// redirect\n\t\tSession::flash('success_message', Input::get('title') . ' category has been aded.');\n\n\t\treturn Redirect::to('admin/question-categories');\n\t}", "public function store(Request $request)\n {\n $validatedData = $request->validate([\n 'file_name'=>'required',\n 'workout'=>'required|min:2',\n 'description'=>'required|min:10',\n 'day'=>'required',\n 'time'=>'required'\n\n ]);\n\n\n $getValueDay = $request->input('day');\n $getValueTime = $request->input('time');\n\n $path = $request->file('file_name')->storePublicly('public/images/workouts');\n\n $post = [\n 'file_name'=> $path,\n 'workout'=>$request['workout'],\n 'description'=>$request['description'],\n 'day'=>$getValueDay['0'],\n 'time'=>$getValueTime,\n 'users_id'=>Auth::user()->id\n ];\n\n // var_dump($post);\n\n Workout::create($post);\n\n $post = $request->except('_token');\n\n\n return redirect()->route('workout');\n }" ]
[ "0.61515504", "0.60063905", "0.58394295", "0.58378613", "0.5620386", "0.5580089", "0.555611", "0.55307066", "0.55281335", "0.5486131", "0.5485075", "0.54284894", "0.5389126", "0.5386289", "0.5377289", "0.5354097", "0.5353045", "0.5351274", "0.53213197", "0.5312135", "0.5308805", "0.53027326", "0.5292323", "0.5283346", "0.5263917", "0.52618647", "0.52518326", "0.52518326", "0.5246731", "0.5240466" ]
0.680613
0
/Store video category data form
public function storeVideocategory(Request $request) { $this->validate($request,array( 'categoryName' => 'required', )); $videoCategory = new VideoCategory; $videoCategory->video_category_name = $request->categoryName; $videoCategory->save(); if($videoCategory->save()){ return redirect()->back()->with('success','Video category Saved successfully.'); } else{ return redirect()->back()->with('denger-success','Video category is not saved.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(AddVideoRequest $request)\n {\n try{\n $videoFile = $request->file('video');\n $thumbnailFile = $request->file('thumbnail');\n $videoName = 'video_'.str_slug($request->input('title')).\".\".$videoFile->getClientOriginalExtension();\n $thumbnailName = 'thumbnail_'.str_slug($request->input('title')).\".\".$thumbnailFile->getClientOriginalExtension();\n $category = Category::find($request->input('category'));\n $tags = json_decode($request->input('tags'),true);\n\n if ($videoFile->move(public_path(\"uploads/videos/\"),$videoName) && $thumbnailFile->move(public_path(\"uploads/videos/\"),$thumbnailName)){\n $video = new Video();\n $video->title = ucfirst($request->input('title'));\n $video->subtitle = ucfirst($request->input('subtitle'));\n $video->description = ucfirst($request->input('description'));\n $video->duration = \"1:00\";\n $video->thumbnail = asset(\"uploads/videos/$thumbnailName\");\n $video->video = asset(\"uploads/videos/$videoName\");\n $video->user_id = Auth::id();\n $video->save();\n $video->categories()->attach($category->id);\n\n foreach ($tags as $key => $value) {\n $tagName = $tags[$key]['name'];\n //$tags = Tag::where('name','LIKE',\"%$name%\")->first();\n $tag = Tag::firstOrCreate(['name'=>$tagName]);\n $video->tags()->attach($tag->id);\n }\n $request->session()->flash('status', true);\n $request->session()->flash('mess', \"Video : '$video->title' was added successfully !!\");\n }\n return redirect()->back();\n } catch(\\Exception $e){\n $request->session()->flash('status', false);\n $request->session()->flash('mess', \"Sorry we could not store the video\");\n\n if($video){\n $video->categories()->detach();\n $video->delete();\n }\n\n Log::warning(\"Can not upload Video {$e->getFile()}, {$e->getLine()}, {$e->getMessage()}\");\n return redirect()->back();\n }\n\n }", "public function store()\n {\n // Validate input\n $this->validate($this->request, [\n 'title' => 'required',\n 'description' => 'required',\n 'order_number' => 'required|integer|unique:videos',\n 'embed_code' => 'required',\n 'access_name' => 'required',\n ]);\n\n $this->video->create([\n 'title' => $this->request->input('title'),\n 'description' => $this->request->input('description'),\n 'order_number' => $this->request->input('order_number'),\n 'embed_code' => $this->request->input('embed_code'),\n 'slug' => str_slug($this->request->input('title'), '-'),\n 'access_name' => $this->request->input('access_name')\n ]);\n\n return redirect('videos/all')->withSuccessMessage('Video added');\n }", "public function store(Request $request)\n {\n $data['page_title'] = 'Content';\n $data['categories'] = Category::all()->sortBy('name');\n $data['languages'] = Settings::LANGUAGES;\n $data['genres'] = Settings::GENRES;\n\n $validationData = $request->validate(\n [\n 'category' => ['required'],\n 'name' => ['required', 'string', 'max:255'],\n //'videofile' => 'sometimes|nullable|mimes:mpeg,ogg,mp4,webm,3gp,mov,flv,avi,wmv,ts|max:' . config('constants.MAX_VIDEO_UPLOAD_SIZE'),\n 'file' => 'required|mimes:png,PNG,jpg,JPG,jpeg,JPEG|max:' . config('constants.MAX_FILE_UPLOAD_SIZE'),\n 'language' => ['required', 'string'],\n 'genres' => ['required', 'string'],\n 'artist' => ['required', 'string'],\n 'castandcrew' => ['required', 'string'],\n 'description' => ['required', 'string'],\n\n ]\n );\n if ($request->hasfile('file')) {\n $image = $request->file('file');\n $image_name = time() . '_' . $image->getClientOriginalName();\n //$image_path = $request->file('file')->storeAs('uploads', $image_name);\n $image_path = 'banner_images/' . $image_name;\n Storage::disk('s3')->put($image_path, file_get_contents($image));\n }\n $tags = ($request->tags) ? explode(',', $request->tags) : '';\n $display_tags = ($request->display_tags) ? explode(',', $request->display_tags) : '';\n\n $save_data = [\n 'category_id' => $request->category,\n 'name' => $request->name,\n 'banner_image' => $image_path,\n 'language' => $request->language,\n 'genres' => $request->genres,\n //'content_link' => ($video_path) ?? '',\n //'format' => ($video_extension) ?? '',\n 'tags' => json_encode($tags),\n 'display_tags' => json_encode($display_tags),\n 'client_id' => $this->client(),\n 'artist' => $request->artist,\n 'castandcrew' => $request->castandcrew,\n 'description' => $request->description,\n 'created_by' => Auth::id(),\n 'updated_by' => Auth::id(),\n ];\n //dd($save_data);\n $content = Content::create($save_data);\n if ($content) {\n return redirect('client/contents/view/' . $content->id)->with('success', \"Content Added Successfully.\");\n } else {\n return redirect('client/contents')->with('failure', \"Oops! Content Not added.\");\n }\n }", "public function videoCategory() {\n $this->loadModel('VideoCategories');\n $data = $this->VideoCategories->find('all');\n $this->paginate = [ ];\n $videoCategories = $this->paginate($data);\n\n $this->set(compact('videoCategories'));\n \n }", "public function add() {\n if ($this->GdataAuth->isAuthorized()) {\n if (!empty($this->data)) {\n $this->YouTubeVideo->set($this->data);\n if ($this->YouTubeVideo->validates() && $this->YouTubeVideo->save($this->data)) {\n $this->Session->setFlash('It worked!');\n $this->redirect(array());\n }\n }\n // Set official you tube categories and access control options to populate\n // form fields\n $this->set('categories', $this->YouTubeVideo->categories());\n foreach ($this->YouTubeVideo->accessControls as $accessControl => $options) {\n $this->set(Inflector::pluralize($accessControl), array_combine($options, $options));\n }\n }\n }", "public function create()\n {\n $categories = Category::all()->pluck('name','id');\n \n return view('admin.video.create', compact('categories'));\n }", "function save_video_post( $post_id, $post ) {\n if ( 'publish' === $post->post_status && $post->post_type === 'video' ) {\n $defaults = array(\n 'video_category' => array( 'fitness' )\n );\n $taxonomies = get_object_taxonomies( $post->post_type );\n foreach ( (array) $taxonomies as $taxonomy ) {\n $terms = wp_get_post_terms( $post_id, $taxonomy );\n if ( empty( $terms ) && array_key_exists( $taxonomy, $defaults ) ) {\n wp_set_object_terms( $post_id, $defaults[$taxonomy], $taxonomy );\n }\n }\n }\n}", "public function store(Request $request)\n {\n //\n $request->validate([\n 'input_videoName',\n 'input_category',\n 'input_videoDescription',\n 'input_videoFile',\n 'input_videoThumbnail',\n ]);\n\n $input = $request->all();\n\n $input['input_videoThumbnail'] = \"defaultCategory.png\";\n\n if ($file = $request->file('input_videoFile')) {\n\n if ($thumbNail_file = $request->file('input_videoThumbnail')) {\n $destinationPath = 'image/';\n $thumbNail = date('YmdHis') . \".\" . $thumbNail_file->getClientOriginalExtension();\n $thumbNail_file->move($destinationPath, $thumbNail);\n $input['input_videoThumbnail'] = \"$thumbNail\";\n }\n\n $destinationPath = 'videos/';\n $videoFile = date('YmdHis') . \".\" . $file->getClientOriginalExtension();\n $file->move($destinationPath, $videoFile);\n $input['input_videoFile'] = \"$videoFile\";\n\n Video::create([\n 'videoName' => $input['input_videoName'],\n 'videoDescription' => $input['input_videoDescription'],\n 'videoFile' => $input['input_videoFile'],\n 'image' => $input['input_videoThumbnail'],\n 'categoryID' => $input['input_category']\n ]);\n }\n }", "function linkVideo(){\n \n $vid = uniqid();\n $ar = array('id' => $vid, 'web_id' => WEB_ID, 'video_url' => $_POST['vurl'], 'video_name' => $_POST['name'], 'video_disc' => $_POST['disc'], 'type' => 'YouTube', 'category'=>$_POST['cats']);\n \n $this->db->insert('video_library', $ar);\n \n \n }", "public function store()\n\t{\n\t\t$img = $this->save_file(Input::file('thumbnail'), 60, 25, 'categories');\n\t\t//滚动图像\n\t\t$slides = array();\n\t\tif(Input::hasFile('slides')){\n\t\t\tforeach(Input::file('slides') as $file){\n\t\t\t\t$slides[] = $this->save_file($file, 50, 14, 'categories');\n\t\t\t}\n\t\t}\n\t\t$slide = serialize($slides);\n\n\t\t$inputs = Input::except('thumbnail', 'slides');\n\t\t$inputs['thumbnail'] = $img;\n\t\t$inputs['slides'] = $slide;\n\n\t\t$category = Category::create($inputs);\n if ( !$category->errors()->all() )\n {\n return Redirect::route('admin.categories.index')\n ->with('success', Lang::get('cpanel::common.create_success'));\n }\n\n return Redirect::back()\n ->withInput()\n ->withErrors($category->errors());\n\t}", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "public function addVideo(){\n if (isset($_POST[\"add_video\"])) {\n $movie = $this->model('Movie');\n $system = $this->model('System');\n\n $video_name = $_POST[\"video_title\"];\n $video_url = $_POST[\"video_url\"];\n $video_category = $_POST[\"selected_category\"];\n $video_description = $_POST[\"video_description\"];\n $video_sef_url = $system->seflink($video_name);\n\n $movie->addVideo($video_name,$video_url,$video_category,$video_description,$video_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/videos');\n }", "public function addVideo()\n {\n $getAllVideoCategory = VideoCategory::all();\n return view('admin.addvideo')->with('videoCategory',$getAllVideoCategory);\n }", "public function store(Request $request)\n {\n // dd($output);\n $validator = Validator::make(\n $request->all(), \n [\n 'title' => 'required', ],\n [\n 'title.required' => 'メールアドレスが間違っています。',\n ]\n );\n if(strtotime($request->start_date) > strtotime($request->end_date)) {\n $validator->after(function ($validator) {\n $validator->errors()->add('end_date.format', '終了日が開始日より大きい');\n });\n }\n if ($validator->fails()) {\n return redirect(route('push.videos.create'))\n ->withErrors($validator)\n ->withInput();\n }\n\n $data = $request->all();\n // dd($data);\n unset($data['_token']);\n unset($data['thumbnail']);\n unset($data['thumbnail_detail']);\n unset($data['video_create']);\n unset($data['banner']);\n unset($data['slider']);\n if(@$data['related'][0]) {\n $data['related_videos_1'] = @$data['related'][0];\n }\n if(@$data['related'][1]) {\n $data['related_videos_2'] = @$data['related'][1];\n }\n if(@$data['related'][2]) {\n $data['related_videos_3'] = @$data['related'][2];\n }\n // $data['type'] = 1;\n unset($data['related']);\n // dd($data);\n $rs = Video::insertGetId($data);\n // $catehhs = ChannelCategory::where('channel_id',$request->channel_id)->get();\n // $client = new SocketIO('visoftech.com', 9001);\n // $client->setQueryParams([\n // 'token' => 'edihsudshuz',\n // 'id' => '8780',\n // 'cid' => '344',\n // 'cmp' => 2339\n // ]);\n // foreach ($catehhs as $key => $value) {\n // $association[] = $value->category_id;\n // }\n // $data[\"statusCode\"] = 0;\n // $data[\"message\"] = \"\"; \n // $data[\"data\"] = [\n // 'type' => 0,\n // 'association' => $association,\n // ];\n // $rsu = json_encode($data);\n // $success = $client->emit('notify', $rsu);\n if($rs) {\n if($request->thumbnail){\n $path = '/storage/app/'.@$request->file('thumbnail')->store('TVpro/images');\n $vd = Video::find($rs);\n $vd->thumbnail = $path;\n $vd->save();\n }\n if($request->thumbnail_detail){\n $path = '/storage/app/'.@$request->file('thumbnail_detail')->store('TVpro/images');\n $vd = Video::find($rs);\n $vd->thumbnail_detail = $path;\n $vd->save();\n }\n if($request->banner){\n $path = '/storage/app/'.@$request->file('banner')->store('TVpro/images');\n $vd = Video::find($rs);\n $vd->banner = $path;\n $vd->save();\n }\n if($request->video_create){\n $partvd = $request->video_create->path();\n // dd($partvd);\n $folder = md5(date('Y-m-d H:i:s:u'));\n $store_p = 'TVpro/videos/'.$folder.'/';\n\n $path_up = '/storage/app/'.@$request->file('video_create')->store($store_p);\n $path = '/storage/app/TVpro/videos/'.$folder.'/playlist.m3u8';\n $video = str_replace('/storage/app/TVpro/videos/'.$folder.'/', '' , $path_up);\n $video = str_replace('/', '' , $video);\n $video = str_replace($folder, '' , $video);\n // \n $cd = '/var/www/html/storage/app/'.$store_p;\n chmod($cd, 0777);\n\n $command = 'cd '.$cd.' ; /usr/local/bin/bin/ffmpeg -y -i '.$video.' -r 25 -g 25 -c:a libfdk_aac -b:a 128k -c:v libx264 -preset veryfast -b:v 1600k -maxrate 1600k -bufsize 800k -s 640x360 -c:a libfdk_aac -vbsf h264_mp4toannexb -flags -global_header -f ssegment -segment_list playlist.m3u8 -segment_list_flags +live-cache -segment_time 5 output-%04d.ts; sudo chmod -R 777 '.$cd.'; rm '.$cd.$video;\n exec($command.\" 2>&1\", $output);\n\n $vd = Video::find($rs);\n $vd->video = $path;\n $vd->save();\n\n }\n if($request->pdf){\n $path = '/storage/app/'.@$request->file('pdf')->store('TVpro/pdf');\n $vd = Video::find($rs);\n $vd->pdf = $path;\n $vd->save();\n }\n if($request->slider){\n foreach (@$request->slider as $key => $image) {\n $image = '/storage/app/'.$image->store('TVpro/images');\n Slider::insert([\n 'video_id'=>$rs,\n 'image'=>$image\n ]);\n }\n }\n $nofis = Video::find($rs);\n $hiephoi = ChannelCategory::where('channel_id', $nofis->channel_id)->pluck('category_id');\n // foreach ($hiephoi as $keyhh => $valuehh) {\n // # code...\n // }\n $title = 'マイチャンネルに新たなコンテンツが追加されました。';\n $body = $nofis->title;\n $push_data = [\n 'title' => $title,\n 'body' => $body,\n 'type' => 2,\n 'association_id' => $hiephoi,\n 'video_id' => $nofis->id,\n 'content_type' => $nofis->type,\n 'thumbnail_detail' => $nofis->thumbnail_detail\n ];\n\n $users = User::with(['devices'])\n ->whereHas('mypage_channel', function($qr)use($data){\n $qr->where('channel_id', $data['channel_id']);\n })\n ->has('devices')\n ->get();\n\n if(count($users)) {\n foreach ($users as $key => $value) {\n if($value->content) {\n $content_p = json_decode($value->content);\n }else{\n $content_p = [];\n }\n if (array_search($nofis->id, $content_p) == false && array_search($nofis->id, $content_p) !== 0) {\n $content_p[] = $nofis->id;\n }\n \n $datacontent = ['content'=>json_encode(array_merge($content_p))];\n User::where('id', $value->id)->update($datacontent);\n\n foreach ($value->devices as $keyd => $valued) {\n foreach ($hiephoi as $keyhh => $valuehh) {\n $push_data['association_id'] = $valuehh;\n notification_push($valued->token, $title, $push_data, $body);\n }\n \n }\n }\n }\n\n return redirect(route('push.videos.index'));\n }else{\n return back();\n }\n }", "public function store(ContentCreateRequest $request, $category_id)\n {\n $newContent = $request->except(array('_token','checkVideo'));\n $content = new Content();\n $newContent['category_id']=$category_id;\n if (!$request->input('checkVideo') == 'on'){\n $newContent['video'] = null;\n }\n $content = Content::create($newContent);\n\n return redirect()\n ->route('teacher.{category}.content.index', $category_id)\n ->withSuccess('Шинэ агуулга амжилттай нэмэгдлээ.');\n }", "function upload_metas(){\r\n\t\r\n\t\t$cat_id \t\t\t= clean_input($_POST['cat_id']);\r\n\t\t$cat_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_keywords \t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_descriptions \t= clean_input($_POST['cat_meta_description']);\r\n\t\t\r\n\t\tif(isset($_POST['upload'])){\r\n\t\t\r\n\t\t$query = \"INSERT INTO categories WHERE cat_id ='$cat_id' \";\r\n\t\t$result = mysql_query($query) or die(mysql_error());\r\n\t\t\r\n\t\treturn $result;\r\n\t\t}\r\n\t}", "function videoCategoryInsert($category, $idVideo, $connection)\n{\n $query_category = \"INSERT INTO video_con_category (id_category, id_video) VALUES\";\n for ($i = 0; $i < count($category); $i++) {\n $query_category .= \" ('$category[$i]', '$idVideo'),\";\n }\n $query_category = rtrim($query_category, ',');\n $result_category = mysqli_query($connection, $query_category);\n}", "public function store(Request $request)\n {\n $data = $request->validate([\n 'name' => 'required',\n ]);\n\n VideoCategory::create($data);\n\n return back()->with('success', 'تمت الاضافة بنجاح');\n }", "public function store(Request $request)\n {\n $thumbnail = 'http://img.youtube.com/vi/' . $request->thumbnail . '/mqdefault.jpg';\n //dd($thumbnail);\n $datas = new Video();\n $datas->video_title = $request->title;\n $datas->user_id = Auth::user()->id;\n $datas->id_category = $request->category;\n $datas->video_url = $request->urlnew;\n $datas->content = $request->area;\n $datas->key = $request->thumbnail;\n $datas->thumbnail = $thumbnail;\n\n $datas->save();\n\n return redirect()->route('video.index')->withErrors(['success' => 'Success create Video']);\n\n }", "public function store() {\n\t\t$post = new Post;\n\t\t$post->title = Input::get('title');\n\t\t$post->body = Input::get('body');\n\t\t$post->save();\n\n\t\t$post->category()->sync([\n\t\t\tInput::get('category_id'), $post->post_id\n\t\t]);\n\t}", "public function create()\n {\n $categories = Category::where('status',1)->orderBy('name')->get();\n //dd($categories->toArray());\n return view('adminCMS.videos.addVideo',compact('categories'));\n }", "public function storeCategory()\n {\n $this->validate([\n 'name' =>'required',\n 'slug' =>'required|unique:categories'\n ]);\n $category = new Category();\n $category->name = $this->name; \n $category->slug = $this->slug;\n $category->save();\n $this->dispatchBrowserEvent('success');\n //$this->emit('alert', ['type' =>'success', 'message' => 'Operation Successful']);\n //session()->flash('message', 'Category has been saved successfully');\n //$this->dispatchBrowserEvent('hide-form', ['message' => 'Category Added Successfully']);\n }", "public function operateCategory(){\n\t\t$title = $_POST['name'];\n\t\t\n\t\t$operation = $_POST['operation'];\n\t\t$id = $_POST['edit_id'];\n\t\t$shared = !empty($_POST['shared']) ? $_POST['shared'] : 0;\n\t\t$description = isset($_POST['description']) ? $_POST['description'] : '';\n\t\t$parent_id = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;\n\t\t$published = isset($_POST['published']) ? $_POST['published'] : 0;\n\t\t$save = $_POST['submit'];\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\t//echo $title.\" \".$operation.\" \".$id.\" \".\" \".$shared.\" \".$save;\n\t\tif(isset($save))\n\t\t{\n\t\t\tif( $operation == 'add' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id,'description' => $description,'published' => $published);\n\t\t\t\t$data = $this->query_model->getCategory(\"downloads\");\n\t\t\t\tif($this->query_model->addCategory($args)){\n\t\t\t\t\tredirect($this->index());\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\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $operation == 'edit' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id ,'description' => $description,'published' => $published);\n\t\t\t\t$this->db->where(\"cat_id\",$id);\n\t\t\t\tif($this->query_model->editCategory($args)){\n\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}", "public function postVideo(){\r\n if(!$this->hasLoginCheck())\r\n return;\r\n $blogItem = new BlogItemModel();\r\n $video_url=$_POST['video_url'];\r\n $video_img_path=$_POST['video_img_path'];\r\n $title=$_POST['video_title'];\r\n $desc=$_POST['content'];\r\n $embed_value=$_POST['video_embed_value'];\r\n $tag=$_POST['tag'];\r\n $blogItem->addVideo($video_url,$video_img_path,$title,$desc,$tag,$embed_value);\r\n echo json_encode(array('status'=>'true'));\r\n }", "function addvideo($name, $category, $length)\n\t{\n\t\t$obj = new clsdbaccess();\n\t\t$mysqli = $obj->db_connect();\n\t\t$result ='';\n\n\t\tif(!($stmt = $mysqli->prepare(\"INSERT INTO videoinventory (name, category, length) VALUES (?,?,?)\"))){\n\t\t\techo \"Prepare failed: \" . $stmt->errno . \" \" . $stmt->error;\n\t\t}\n\t\tif(!($stmt->bind_param(\"ssi\", $name, $category, $length))){\n\t\t\techo \"Bind failed: \" . $stmt->errno . \" \" . $stmt->error;\n\t\t}\n\t\tif(!$stmt->execute()) {\n\t\t\t$result = \"Execute failed: \" . $mysqli->error;\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\t$result='success';\n\t\t}\t\t\n\t\t$stmt->close();\t\n\t\treturn $result;\n\t}", "public function store(Request $request)\n { \n\n $request->validate([\n 'name' => 'required'\n ]);\n\n $url_video = $request->url_video;\n\n $url_video_array = explode(\"/\", $url_video);\n\n if(Str::contains($url_video, 'youtube')) {\n $url_video_id = $url_video_array[4];\n $url_thumbail = 'https://img.youtube.com/vi/'.$url_video_id.'/0.jpg';\n } \n\n if(Str::contains($url_video, 'vimeo')) {\n $url_video_id = $url_video_array[4];\n $hash = unserialize(file_get_contents(\"https://vimeo.com/api/v2/video/\".$url_video_id.\".php\"));\n $url_thumbail_preview = $hash[0]['thumbnail_large'];\n $url_thumbail = substr_replace( $url_thumbail_preview, \"480x360\", -3);\n } \n\n $video = Video::create([\n\n 'name' => $request->name,\n 'date_public' => $request->date_public,\n 'status' => $request->status,\n 'category_id' => $request->category_id,\n 'url_video' => $url_video,\n 'url_thumbail' => $url_thumbail\n ]);\n\n return redirect()->route('admin.videos.edit', $video)->with('info', 'El video se creó con éxito');\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|max:237|min:230',\n 'category' => 'required',\n 'url' => 'required'\n ]);\n\n $youtube_id = $this->video->getYoutubeEmbedUrl($request->url);\n\n if ($youtube_id == 'error') {\n $error = ['warning'=> 'That url is so wrong! It has to be a valid youtube video link'];\n return redirect()->back()->withErrors($error);\n }\n\n $url = 'http://www.youtube.com/embed/' . $youtube_id . '?autoplay=0';\n\n\n $data = $request->all();\n $data['user_id'] = Auth::user()->id;\n $data['category_id'] = $request->category;\n $data['url'] = $url;\n\n $this->video->create($data);\n $videoUrl = url() . \"/videos/\" . str_replace(\" \", \"-\", $request->title);\n\n return redirect()->back()->with('status', $videoUrl);\n }", "public function save_video( $post_id ) {\n if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n /*\n If autosaving, do nothing\n */\n return;\n }\n if( !isset( $_POST['videoid'] ) || !isset ( $_POST['provider']) || !wp_verify_nonce( $_REQUEST['video_meta_box'], 'video_meta_save' ) ) {\n /*\n If the video ID and provider isn't selected, or the wp_kses is faked, get out\n */\n return;\n }\n if( !current_user_can( 'edit_post' ) ) {\n /*\n If you can't edit a post, get the hell out\n */\n return;\n }\n\n /*\n Update video ID\n */\n $videoid = wp_kses( $_POST['videoid'], '');\n update_post_meta( $post_id, 'videoid', $videoid, '' );\n\n /*\n Update video provider\n */\n $provider = wp_kses ($_POST['provider'], '');\n update_post_meta( $post_id, 'provider', $provider, '');\n\n /*\n Season and Episode database insertion\n */\n $season = wp_kses($_POST['season'], '');\n update_post_meta($post_id, 'season', $season, '');\n\n $episode = wp_kses($_POST['episode'], '');\n update_post_meta($post_id, 'episode', $episode, '');\n /*\n Define Video type name to be inserted into database\n */\n $video_category = wp_kses($_POST['video_category'], '');\n $term = get_term_by('name', $video_category, 'video_category');\n\n if( !empty($term) && !is_wp_error( $term ) ) {\n wp_set_object_terms( $post_id, $term->term_id, 'video_category', false);\n }\n\n /*\n If there is no Featured Image, grab it from youtube\n */\n if( !has_post_thumbnail($post_id)) {\n if($provider == 'youtube') {\n $this->Generate_Featured_Image( $this->fetch_youtube_thumbnail($videoid), $post_id );\n }\n if($provider == 'vimeo') {\n $this->Generate_Featured_Image( $this->fetch_vimeo_thumbnail($videoid), $post_id );\n }\n }\n }", "public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}", "public function create()\n {\n return view('adminVideo.category.create');\n }" ]
[ "0.6457996", "0.6418421", "0.6280149", "0.6258419", "0.62341547", "0.62338513", "0.6215257", "0.6186579", "0.6134619", "0.61315817", "0.61244404", "0.6043199", "0.60421747", "0.6031893", "0.60311496", "0.60204273", "0.6015956", "0.6015519", "0.5985891", "0.59772885", "0.5974751", "0.5949288", "0.59448254", "0.59128785", "0.5879066", "0.5852101", "0.5849617", "0.5842242", "0.58322406", "0.5828376" ]
0.663629
0
/edit workout Function for delete
public function deleteWorkout(Request $request) { $id = $request->workoutid; $getWorkout = Workout::find($id); if($getWorkout->delete()){ return redirect()->back()->with('danger','Workout Deleted successfully'); } else{ return redirect()->back()->with('danger','Sorry! Workout is not deleted'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteWorklog(){\n\n }", "function delete_entry($entryID) {\r\n $this->db->where('id', $entryID);\r\n $this->db->delete('workHours');\r\n }", "function delete_workman($id)\n {\n return $this->db->delete('workman',array('id'=>$id));\n }", "public function edit(Workout $workout)\n {\n //\n }", "public function actionRemovewl(){\n\t\t\n $connection=yii::app()->db;\n\t\t $sqluodate=\"UPDATE memberplot SET WLSTATUS='0',WLDATE='' WHERE plot_id='\".$_GET['id'].\"'\";\n\t\t$sqlresult=$connection->createCommand($sqluodate);\n\t\t$sqlresult->execute();\n\t\t\t\t$connection = Yii::app()->db; \n\t\t$temp_projects_array = Yii::app()->session['projects_array'];\n\t\t$num_of_projects_counter = count($temp_projects_array);\t\n\t\t$num_of_projects_counter2 = $num_of_projects_counter;\n\t\t$sql1 = \"select * from projects where\";\n\t\t$num_of_projects_counter--;\n\t\twhile($num_of_projects_counter>-1)\n\t\t{\n\t\t\t$sql2[$num_of_projects_counter] = \" id=\".Yii::app()->session['projects_array'][$num_of_projects_counter]['project_id'];\n\t\t\t$num_of_projects_counter--;\n\t\t}\n\t\t\n\t\t$sql_project = $sql1;\n\t\t$sql_project = $sql_project.implode(' or',$sql2);\n\t\t$result_projects = $connection->createCommand($sql_project)->query() or mysql_error();\n\t\t$this->render('defaulter_list',array('projects'=>$result_projects));\n\t\t\n\t\t\t\t\t}", "public function delete()\n {\n echo '客户要求减少一个需求' . PHP_EOL;\n }", "public function delete(){\n\t $this->model->clear()->filter(array('preview_master_id' => WaxUrl::get(\"id\")))->delete();\n\t parent::delete();\n\t}", "public function deleteAction()\n {\n $request = $this->getRequest();\n\n $routeMatch = $this->getEvent()->getRouteMatch();\n $id = $routeMatch->getParam('exercise_id', 0);\n\n if ($id <= 0) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $exercise = $this->_exercise->getRow(array('exercise_id' => $id));\n\n if (!$exercise) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $workoutId = $exercise->workout_id;\n\n $exercise->delete();\n\n return $this->redirect()->toRoute('hi-training/workout-exercise/list/wildcard', array('workout_id' => $workoutId));\n\n }", "public function destroy(qlsv_worktask $qlsv_worktask, $id)\n {\n date_default_timezone_set(\"Asia/Ho_Chi_Minh\");\n $worktask1 = qlsv_worktask::find($id);\n $thutu = $worktask1->thutu;\n $dsworktask = DB::table(\"qlsv_worktasks\")\n ->where('id_monhoc', $worktask1->id_monhoc)\n ->where('deleted_at', 0)->get();\n //dd( $worktask1);\n if ($thutu == 1) {\n\n foreach ($dsworktask as $dsw) {\n $dsw->thutu = $dsw->thutu - 1;\n $worktask = qlsv_worktask::find($dsw->id);\n $worktask->thutu = $dsw->thutu;\n $worktask->save();\n }\n } else {\n if ($thutu == count($dsworktask)) {\n } else {\n\n for ($i = $thutu; $i < count($dsworktask); $i++) {\n $dsworktask[$i]->thutu = $dsworktask[$i]->thutu - 1;\n $worktask = qlsv_worktask::find($dsworktask[$i]->id);\n $worktask->thutu = $dsworktask[$i]->thutu;\n $worktask->save();\n }\n }\n }\n\n\n $worktask1->deleted_at = 1;\n $worktask1->save();\n return response()->json(['_typeMessage' => 'deleteSuccess']);\n //return redirect('/worktask/index');\n }", "function delete() {\n\t\t$sql = \"DELETE FROM \".$this->hr_db.\".hr_person_detail\n\t\t\t\tWHERE psd_ps_id=?\";\n\t\t$this->hr->query($sql, array($this->psd_ps_id));\n\t}", "public function delete_mnt_record()\r\n {\r\n $mnt_id = $this->input->get('mnt_id');\r\n echo $this->maintenance_model->delete_record($mnt_id);\r\n\r\n }", "function delete_from_stopout_list($data)\n\t{\n\t return $this->db->where('number',$data['number'])\n\t\t\t->where('fsb',$data['fsb'])\n\t\t\t->where('md',$data['md'])\n\t\t\t->where('action',$data['action'])\n\t\t\t->delete('pamm_stopout_list');\n\t}", "public function deleting()\n {\n # code...\n }", "function deleteworksheet($id){\n\t \t// $data = array('status' => 'inactive');\n\t \t$this->db->where('w_id', id_clean($id));\n\t\t$this->db->delete('pof_worksheet');\t\n\t }", "public function deleteAction(){\n //farewell brave knight, your cosmo will stay with us forever...\n $this->getDM()->remove($this->getKnight());\n $this->getDM()->flush();\n //go back to home (indexAction) to show the grid of knights\n $this->redirect()->toRoute(\"home\");\n }", "public function deleted(Edit $edit)\n {\n //\n }", "function deleteEntry() \n { \n\t parent::deleteEntry();\n\n\t $values = $this->getArrayOfValues();\n// \t echo \"<pre>\".print_r($values,true).\"</pre>\";\n\t \n\t if (isset($values['reg_id']))\n\t {\n\t \n\t\t // update balance owing column in cim_reg_registration table\n\t\t $singleReg = new RowManager_RegistrationManager($values['reg_id']);\n// \t\t $singleReg_list = $singleReg->getListIterator();\n// \t\t $singleReg_array = $singleReg_list->getDataList();\n// \t\t \n// \t\t reset($singleReg_array);\n// \t\t $record = current($singleReg_array);\n// \t\t $oldBalance = $record['registration_balance'];\n\t\t \n\t\t\t $balanceGetter = new FinancialTools();\n\t\t\t $balance = array();\n// \t\t\t $balance['registration_balance'] = $oldBalance - $record['cctransaction_amount'];\n\t\t\t $balance['registration_balance'] = $balanceGetter->simpleCalcBalanceOwing($values['reg_id']);\t\n\t\t\t $singleReg->loadFromArray( $balance );\n\t\t\t $singleReg->updateDBTable();\t\t\t\n\t\t }\t \t \n \n }", "function delete() ;", "function delete() ;", "public function index_delete(){\n\t\t\n\t\t}", "function do_delete(){\n\t\t// remove from fieldset:\n\t\t$fieldset = jcf_fieldsets_get( $this->fieldset_id );\n\t\tif( isset($fieldset['fields'][$this->id]) )\n\t\t\tunset($fieldset['fields'][$this->id]);\n\t\tjcf_fieldsets_update( $this->fieldset_id, $fieldset );\n\t\t\n\t\t// remove from fields array\n\t\tjcf_field_settings_update($this->id, NULL);\n\t}", "public function Do_delete_Example1(){\n\n\t}", "public function actionDelete() {}", "public function actionDelete() {}", "function delete()\n {\n }", "public function do_delete_record()\n {\n $v_list_delete = get_post_var('hdn_item_id_list','');\n $this->model->do_delete_record($v_list_delete);\n }", "function delete() \n {\n \n }", "function delete()\r\n {\r\n\r\n }", "public function delete_extraproduct(){\n if($this->uri->segment(3) == \"temp\"){\n $id = $this->uri->segment(4);\n $result = MU_Model::deletedRecordById(\"temp_table\",array(\"ID\" => $id));\n }else{\n $id = $this->uri->segment(3);\n $result = MU_Model::deletedRecordById(\"extra_acti\",array(\"extraproduct_id\" => $id));\n }\n if($result) echo 't';\n }", "public function action_delete_entry(): int {\n\t\treturn (int) ( new CRUD( $this->table->get_table_definition() ) )->delete_oldest_item();\n\t}" ]
[ "0.67456985", "0.63389087", "0.6332227", "0.6252248", "0.6217238", "0.6122122", "0.6102628", "0.605384", "0.59912604", "0.59836406", "0.59804535", "0.5974781", "0.5966493", "0.5956046", "0.59432197", "0.59420574", "0.5908118", "0.5903832", "0.5903832", "0.5902733", "0.5902004", "0.5901462", "0.5871034", "0.5871034", "0.58500695", "0.5847329", "0.58411884", "0.5824066", "0.5817487", "0.580203" ]
0.6510778
1
/edit workout category Function for view form
public function editworkoutcategory($id) { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $workout = Category::find($id); return view('admin.editworkoutcategory')->with('workout',$workout); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateworkoutcategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n ));\n $id = $request->id;\n $workoutCategory = Category::find($id);\n $workoutCategory->Category = $request->name;\n $workoutCategory->save();\n Session::flash('success','Workout Category Updated succcessfully.');\n return redirect()->back()->with('workout',$workoutCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function edit()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not logged in!\");\n }\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n try{\n\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n $categoryName = $categoryModel->getCategoryNameById($categoryId);\n\n $this->view->render(\"admin/categories/edit\",[\n \"name\"=> $categoryName,\n \"id\"=> $categoryId\n ]\n );\n\n } catch (\\Exception $exception){\n $this->view->redirect(\"/categories/manage\",$exception->getMessage());\n }\n\n }", "public function addWorkoutCategory()\n {\n return view('admin.addworkoutcategory');\n }", "public function edit(Workout $workout)\n {\n //\n }", "public function editPost()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"edit_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryName = $this->input->post(\"name\");\n\n $categoryModel = new CategoriesModel();\n\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n if ($categoryModel->editCategory($categoryName, $categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category edited successfully!\",\"success\");\n } else {\n $this->view->redirect(\"/categories/manage\",\"You did not change anything ?\");\n }\n\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }", "public function editNutrationCategory($id)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = NutrationCategory::find($id);\n return view('admin.editnutrationcategory')->with('workout',$workout);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function updateForm()\n{\n\n $listeCatgories = $this->model->getCategories();\n $new = $this->model->getNew();\n $this->view->updateForm($new,$listeCatgories);\n}", "public function edit(TripCategory $tripCategory)\n {\n //\n }", "public function edit_category() {\n $data['pageName'] = $this->pageName . ' : Edit Category';\n $get = $this->uri->uri_to_assoc();\n \n //If no id found\n if(!isset($get['id'])){\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">No content found</span>');\n redirect('admin/static_pages/home', \"location\");\n exit();\n }\n \n $category_id = $get['id'];\n $where_clause = array('category_id' => $category_id);\n $categoryRS = $this->User_model->get_category($where_clause);\n\n\n if (!$categoryRS) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Content not available. Please try again later.</span>');\n redirect('admin/category/home', \"location\");\n exit();\n }\n \n $category = $categoryRS[0];\n $data['category'] = $category;\n \n //After posting save data\n if(isset($_POST['category_id']) && !empty($_POST['category_id'])) {\n \n $pst_category_id = addslashes($_POST['category_id']);\n $isCategoryAdded = $this->User_model->update_category($pst_category_id);\n \n if(!$isCategoryAdded) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Unable to update the record</span>');\n }\n else{\n $this->session->set_flashdata('info_message', 'Record updated successfull!');\n redirect('admin/category/home', \"location\");\n }\n }\n $this->load->view('admin/category/edit_view', $data); \n }", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "public function edit(Postcategory $postcategory)\n {\n //\n }", "function catedit()\r\n\t{\r\n\t\t$data['cat'] = $this->categeory_model->cat($this->uri->segment(4));\r\n\t\t$this->load->view('admin/edit',$data);\r\n\t}", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }" ]
[ "0.69934815", "0.6759673", "0.6755315", "0.67062914", "0.67001015", "0.66443294", "0.6574874", "0.6564783", "0.65390974", "0.6490522", "0.64873505", "0.647618", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072" ]
0.7222749
0
/edit workout category Function for update form
public function updateworkoutcategory(Request $request) { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $this->validate($request,array( 'name' => 'required', )); $id = $request->id; $workoutCategory = Category::find($id); $workoutCategory->Category = $request->name; $workoutCategory->save(); Session::flash('success','Workout Category Updated succcessfully.'); return redirect()->back()->with('workout',$workoutCategory); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Workout $workout)\n {\n //\n }", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "function edit_category() {\r\n\r\n\tif(isset($_POST['editcategory'])){\r\n\r\n\t\t$cat_id\t\t\t\t= clean_input($_GET['cat_id']);\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\r\n\r\n\t\t$xyquery = \"UPDATE categories SET \";\r\n\t\t$xyquery .= \"cat_name = '$cat_name',\";\r\n\t\t$xyquery .= \"cat_desc_short = '$cat_desc_short'\";\r\n\t\t$xyquery .= \",cat_desc_long = '$cat_desc_long'\";\r\n\t\t$xyquery .= \",cat_parent_id = '$cat_parent_id'\";\r\n\t\t$xyquery .= \",cat_url = '$cat_url'\";\r\n\t\t$xyquery .= \",cat_mod = '$cat_mod'\";\r\n\t\t$xyquery .= \",cat_mod_by = '$cat_mod_by'\";\r\n\t\t$xyquery .= \",page_template = '$page_template'\";\r\n\t\t$xyquery .= \",cat_meta_title = '$cat_meta_title'\";\r\n\t\t$xyquery .= \",cat_meta_keywords = '$cat_meta_keywords'\";\r\n\t\t$xyquery .= \",cat_meta_description = '$cat_meta_description'\";\r\n\t\t$xyquery .= \",insert_keywords = '$insert_keywords'\";\t\t\t\t\r\n\t\t$xyquery .= \"WHERE cat_id = '$cat_id'\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" been edited!</h4></center>\";\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been modified.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "function edit_category($tbl_name){\n\t\t//print_r($_POST); die;\n\t\tunset($_POST['submitLog']);\n\t\t$this->db->where('id', $_POST['id']);\n\t\tunset($_POST['id']);\n\t\t$this->db->update($tbl_name,$_POST);\n\t\t// print_r($this->db->last_query());\n\t // die();\n\t}", "public function updateCate()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['upcategory'];\n\t\t\t$category_id = $_POST['upcategory_id'];\n\t\t\t$sql = \" update lib_book_species set category = '{$category}' where category in \n\t\t\t\t\t(select category from lib_category where category_id = {$category_id});\n\t\t\t\t\tupdate lib_category set category='\" . $category . \"' where category_id='\" . $category_id . \"';\n\t\t\t\t\t\";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Modify successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function editPost()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"edit_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryName = $this->input->post(\"name\");\n\n $categoryModel = new CategoriesModel();\n\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n if ($categoryModel->editCategory($categoryName, $categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category edited successfully!\",\"success\");\n } else {\n $this->view->redirect(\"/categories/manage\",\"You did not change anything ?\");\n }\n\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }", "public function editworkoutcategory($id)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = Category::find($id);\n return view('admin.editworkoutcategory')->with('workout',$workout);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function update_assets_category() {\n\t\n\t\tif($this->input->post('edit_type')=='assets_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t\n\t\t$id = $this->uri->segment(4);\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->update_assets_category_record($data,$id);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_updated');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "public function edit_category() {\n $data['pageName'] = $this->pageName . ' : Edit Category';\n $get = $this->uri->uri_to_assoc();\n \n //If no id found\n if(!isset($get['id'])){\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">No content found</span>');\n redirect('admin/static_pages/home', \"location\");\n exit();\n }\n \n $category_id = $get['id'];\n $where_clause = array('category_id' => $category_id);\n $categoryRS = $this->User_model->get_category($where_clause);\n\n\n if (!$categoryRS) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Content not available. Please try again later.</span>');\n redirect('admin/category/home', \"location\");\n exit();\n }\n \n $category = $categoryRS[0];\n $data['category'] = $category;\n \n //After posting save data\n if(isset($_POST['category_id']) && !empty($_POST['category_id'])) {\n \n $pst_category_id = addslashes($_POST['category_id']);\n $isCategoryAdded = $this->User_model->update_category($pst_category_id);\n \n if(!$isCategoryAdded) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Unable to update the record</span>');\n }\n else{\n $this->session->set_flashdata('info_message', 'Record updated successfull!');\n redirect('admin/category/home', \"location\");\n }\n }\n $this->load->view('admin/category/edit_view', $data); \n }", "function edit(category $category)\n {\n $query = \"UPDATE categories SET name = '$category->name', \n tag = '$category->tag', description = '$category->description', slug = '$category->slug', active = '$category->active' WHERE categories_id = $category->category_id\";\n $result = $this->db->update($query);\n }", "public function updateNutrationCategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n 'tips' => 'required',\n ));\n $id = $request->id;\n $nutrationCategory = NutrationCategory::find($id);\n $nutrationCategory->nutration_category_name = $request->name;\n $nutrationCategory->tips = $request->tips;\n $nutrationCategory->save();\n Session::flash('success','Nutration Category Updated succcessfully.');\n return redirect()->back()->with('workout',$nutrationCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function updateForm()\n{\n\n $listeCatgories = $this->model->getCategories();\n $new = $this->model->getNew();\n $this->view->updateForm($new,$listeCatgories);\n}", "public function edit(Postcategory $postcategory)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }" ]
[ "0.6806339", "0.67915225", "0.6783352", "0.6751382", "0.67282903", "0.67065406", "0.6692574", "0.65847135", "0.6567059", "0.65591395", "0.6540297", "0.6506003", "0.65053743", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967" ]
0.7347392
0
/Edit workout category Function for delete
public function deleteworkoutcategory(Request $request) { $id = $request->workoutid; $getWorkout = Category::find($id); if($getWorkout->delete()){ return redirect()->back()->with('danger','Workout Category Deleted successfully'); } else{ return redirect()->back()->with('danger','Sorry! Workout Category is not deleted'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteNutrationCategory(Request $request)\n {\n $id = $request->workoutid;\n $getWorkout = NutrationCategory::find($id);\n if($getWorkout->delete()){\n return redirect()->back()->with('danger','Nutration Category Deleted successfully');\n }\n else{\n return redirect()->back()->with('danger','Sorry! Nutration Category is not deleted');\n }\n }", "public function deleteProgramCategory(Request $request)\n {\n $id = $request->workoutid;\n $getWorkout = ProgramCategory::find($id);\n if($getWorkout->delete()){\n return redirect()->back()->with('danger','Program Category Deleted successfully');\n }\n else{\n return redirect()->back()->with('danger','Sorry! Program Category is not deleted');\n }\n }", "function ciniki_foodmarket_categoryDelete(&$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 'category_id'=>array('required'=>'yes', 'blank'=>'yes', 'name'=>'Category'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'foodmarket', 'private', 'checkAccess');\n $rc = ciniki_foodmarket_checkAccess($ciniki, $args['tnid'], 'ciniki.foodmarket.categoryDelete');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Get the current settings for the category\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_foodmarket_categories \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.foodmarket', 'category');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['category']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.foodmarket.5', 'msg'=>'Category does not exist.'));\n }\n $category = $rc['category'];\n\n // \n // Check for any child categories\n //\n $strsql = \"SELECT COUNT(id) AS children \"\n . \"FROM ciniki_foodmarket_categories \"\n . \"WHERE ciniki_foodmarket_categories.parent_id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbSingleCount');\n $rc = ciniki_core_dbSingleCount($ciniki, $strsql, 'ciniki.foodmarket', 'num');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( $rc['num'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.foodmarket.6', 'msg'=>'You still have ' . $rc['num'] . ' child categor' . ($rc['num']>1?'ies':'y') . '.'));\n }\n\n //\n // Check for items already in the category\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_foodmarket_category_items \"\n . \"WHERE category_id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.foodmarket', 'item');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.foodmarket.149', 'msg'=>'Unable to load item', 'err'=>$rc['err']));\n }\n $items = isset($rc['rows']) ? $rc['rows'] : array();\n \n //\n // Start transaction\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDelete');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.foodmarket');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Remove any items from the category first\n //\n foreach($items as $item) {\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.foodmarket.categoryitem', $item['id'], $item['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.foodmarket');\n return $rc;\n }\n }\n\n //\n // Remove the category\n //\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.foodmarket.category', $args['category_id'], $category['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.foodmarket');\n return $rc;\n }\n\n //\n // Commit the transaction\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.foodmarket');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'foodmarket');\n\n return array('stat'=>'ok');\n}", "public function updateworkoutcategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n ));\n $id = $request->id;\n $workoutCategory = Category::find($id);\n $workoutCategory->Category = $request->name;\n $workoutCategory->save();\n Session::flash('success','Workout Category Updated succcessfully.');\n return redirect()->back()->with('workout',$workoutCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "function product_category_delete(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u;\n\t\t\n\t\tmysql_q(\"DELETE FROM product_category WHERE id='\".add_slash($_r['id']).\"'\");\n\n\t\tredirect(\"product_category.htm\", \"\");\n\t}", "public function addWorkoutCategory()\n {\n return view('admin.addworkoutcategory');\n }", "public function delete_category() {\n $category_id = $_GET['category_id'];\n\n $data['delete_category'] = $this->Category_crud->get_category_by_id($category_id);\n $this->load->view('restaurant/category/delete_category_model', $data);\n\n if (isset($_POST['delete_category_yes'])) {\n $this->Category_crud->delete_category_sub_category_item($category_id);\n redirect(rest_path('Category'));\n }\n\n if (isset($_POST['delete_category_no'])) {\n $this->Category_crud->delete_category($category_id);\n redirect(rest_path('Category'));\n }\n }", "function ciniki_directory_categoryDelete(&$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 'category_id'=>array('required'=>'yes', 'default'=>'', 'blank'=>'yes', 'name'=>'Category'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n //\n // Check access to tnid as owner\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'directory', 'private', 'checkAccess');\n $ac = ciniki_directory_checkAccess($ciniki, $args['tnid'], 'ciniki.directory.categoryDelete');\n if( $ac['stat'] != 'ok' ) {\n return $ac;\n }\n\n //\n // Get the category uuid\n //\n $strsql = \"SELECT uuid FROM ciniki_directory_categories \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \" \n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.directory', 'category');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['category']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.directory.12', 'msg'=>'The category does not exist'));\n }\n $uuid = $rc['category']['uuid'];\n\n // \n // Turn off autocommit\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.directory');\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Get the list of entries to remove from this category\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_directory_category_entries \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND category_id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.directory', 'entry');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $entries = $rc['rows'];\n foreach($entries as $entry) {\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.directory.category_entry', \n $entry['id'], $entry['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n\n //\n // Delete the object\n //\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.directory.category', $args['category_id'], $uuid, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Commit the database changes\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.directory');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'directory');\n\n return array('stat'=>'ok');\n}", "function cat_delete_link()\n{\n return Parrot::getInstance()->getUrl(\"admin/category/\" . discussion::encode_title(cat_title()) . \"/delete\");\n}", "public function remove_category() {\n\t\t$this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(Request::get(\"cat\"));\n\t\t$this->model->categories->unlink($category);\n if(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\t\n\t}", "function delete_category($action, $id)\r\n{\r\n\tglobal $dropbox_cnf;\r\n\tglobal $_user, $is_courseAdmin, $is_courseTutor;\r\n\r\n\t// an additional check that might not be necessary\r\n\tif ($action=='deletereceivedcategory')\r\n\t{\r\n\t\t$sentreceived='received';\r\n\t\t$entries_table=$dropbox_cnf['tbl_post'];\r\n\t\t$id_field='file_id';\r\n\t}\r\n\telseif ($action=='deletesentcategory')\r\n\t{\r\n\t\t$sentreceived='sent';\r\n\t\t$entries_table=$dropbox_cnf['tbl_file'];\r\n\t\t$id_field='id';\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn get_lang('Error');\r\n\t}\r\n\r\n\t// step 1: delete the category\r\n\t$sql=\"DELETE FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"' AND $sentreceived='1'\";\r\n\t$result=api_sql_query($sql);\r\n\r\n\t// step 2: delete all the documents in this category\r\n\t$sql=\"SELECT * FROM \".$entries_table.\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t$result=api_sql_query($sql);\r\n\r\n\twhile ($row=mysql_fetch_array($result))\r\n\t{\r\n\t\t$dropboxfile=new Dropbox_Person( $_user['user_id'], $is_courseAdmin, $is_courseTutor);\r\n\t\tif ($action=='deletereceivedcategory')\r\n\t\t{\r\n\t\t\t$dropboxfile->deleteReceivedWork($row[$id_field]);\r\n\t\t}\r\n\t\tif ($action=='deletesentcategory')\r\n\t\t{\r\n\t\t\t$dropboxfile->deleteSentWork($row[$id_field]);\r\n\t\t}\r\n\t}\r\n}", "function delete_category($category_id)\n {\n $this->db->update('tbl_category',$this,array('category_id'=>$category_id));\n //echo $this->db->last_query();\n }", "function categoryRemove(){\n\tif(startSession() && isset($_SESSION['UserID']))\n\t{\n\t\t$CatID\t\t\t \t= strip_tags($_GET['id']);\t#int - primaryKey\n\n\t\t$db = pdo(); # pdo() creates and returns a PDO object\n\n\t\t$sql = \"DELETE FROM ma_Categories WHERE CatID = :CatID\";\n\n\t\t$stmt = $db->prepare($sql);\n\t\t//INTEGER EXAMPLE $stmt->bindValue(1, $id, PDO::PARAM_INT);\n\t\t$stmt->bindValue(':CatID', $CatID, PDO::PARAM_INT);\n\n\t\ttry {$stmt->execute();} catch(PDOException $ex) {trigger_error($ex->getMessage(), E_USER_ERROR);}\n\t\t#feedback success or failure of update\n\n\t\tif ($stmt->rowCount() > 0)\n\t\t{//success! provide feedback, chance to change another!\n\t\t\tfeedback(\"Category Removed Successfully\",\"success\");\n\t\t}else{//Problem! Provide feedback!\n\t\t\tfeedback(\"Category Not Trashed!\",\"warning\");\n\t\t}\n\t\tmyRedirect(THIS_PAGE);\n\t}\n\t#script for expanding textarea\n}", "public function deletePost(){\n\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"delete_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n if ($categoryModel->deleteCategory($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category deleted successfully!\",\"success\");\n }\n } catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }", "public function deleteWorkout(Request $request)\n {\n $id = $request->workoutid;\n $getWorkout = Workout::find($id);\n if($getWorkout->delete()){\n return redirect()->back()->with('danger','Workout Deleted successfully');\n }\n else{\n return redirect()->back()->with('danger','Sorry! Workout is not deleted');\n }\n }", "public function delete()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not logged in!\");\n }\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n try{\n $categoryName = $categoryModel->getCategoryNameById($categoryId);\n\n $this->view->render(\"admin/categories/delete\",[\n \"name\"=> $categoryName,\n \"id\"=> $categoryId\n ]\n );\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n\n }", "public function deleteVideoCategory(Request $request)\n {\n $id = $request->workoutid;\n $getWorkout = VideoCategory::find($id);\n if($getWorkout->delete()){\n return redirect()->back()->with('danger','Video Category Deleted successfully');\n }\n else{\n return redirect()->back()->with('danger','Sorry! Video Category is not deleted');\n }\n }", "public function delete(){\n\n\t\t$sql = new Sql();\n\n\t\t$sql->query(\"DELETE FROM tb_categories WHERE idcategory=:idcategory\",array(\n\t\t\t\":idcategory\"=>$this->getidcategory()\n\t\t));\n\n\t\tCategory::updateFile();\n\t}", "function delete_MaterialCategory($id)\n {\n $this->db->where('id',$id);\n return $this->db->update('prj_mtrl_category',array('delete_status'=>'1'));\n }", "function delCategory($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}", "public function editworkoutcategory($id)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = Category::find($id);\n return view('admin.editworkoutcategory')->with('workout',$workout);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function deletecategory(){\n\t\n\t\t$id = $this->request->getParameter(\"actionid\");\n\t\t$modelCategory = new CaCategory();\n\t\t$modelCategory->delete($id);\n\t\n\t\t// generate view\n\t\t$this->redirect(\"catalogadmin/categories\");\n\t}", "public function remove_all_cat_field()\n\t{\n\t\t//Get logged in session admin id\n\t\t$user_id \t\t\t\t\t\t= ($this->session->userdata('user_id_hotcargo')) ? $this->session->userdata('user_id_hotcargo') : 1;\n\t\t$setting_data \t\t\t\t\t= $this->myaccount_model->get_account_data($user_id);\n\t\t$data['data']['setting_data'] \t= $setting_data;\n\t\t$data['data']['settings'] \t\t= $this->sitesetting_model->get_settings();\n\t\t$data['data']['dealer_id'] \t\t= $user_id;\n\t\t\n\t\t//getting all admin data \n\t\t$data['myaccount_data'] \t\t\t= $this->myaccount_model->get_account_data($user_id);\n\t\t\n\t\t\n\t\t//Get requested form type from url segment position 3\n\t\t$field_id \t\t\t\t\t= $this->uri->segment(3);\n\t\t\n\t\t//deleting query\n\t\t$this->mongo_db->where(array('form_type' => $field_id));\n\t\tif($this->mongo_db->delete_all('form_fields'))\n\t\t\t$this->session->set_flashdata('flash_message', 'info_deleted');\n\t\telse\n\t\t\t$this->session->set_flashdata('flash_message', 'info_delete_failed');\n\t\t\t\n\t\tredirect('control/data-forms');\n\t}", "public static function deleteCategoryController(){\n\n\n \t \t if (isset($_POST[\"editCategoryId\"])) {\n\n\n \t \t \t\t\t// NOTA: Se pasa un valor entero como array ya que el modelo de productos recibe de varios métodos\n \t \t\t\t\t\t$dataController = array(\"idcategory\"=>$_POST[\"editCategoryId\"]);\n\n \t \t\t\t\t\t// Esta variable se envía al modelos para proceder a eliminar la categoria\n \t \t\t\t\t\t$dataIdCategoryController = $_POST[\"editCategoryId\"];\n\n \t \t\t\t\t\t// VER PRODUCTOS ASOCIADOS A LA CATEGORIA\n\t\t\t\t\t\t// $answerProducts = productsModel::ViewProductById($dataController, \"productos\");\n\n\t\t\t\t\t\t// foreach ($answerProducts as $row => $item) {\n\n\t\t\t\t\t\t// $dataProductController = array(\"id\"=>$item[\"id\"], \"idcategory\"=>0, \"enable\"=> 1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// $answerDeleteProducts = productsModel::disableProductByIdCategory($dataProductController, \"productos\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$answerDeleteCategory = categorieModel::deleteCategoryModel($dataIdCategoryController, \"categorias\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t \t\tif ($answerDeleteCategory == 1) {\n\n\t \t\t\t\t\techo '<script >swal({\n\n\t\t\t\t\t\t\t\ttitle: \"¡OK!\",\n\t\t\t\t\t\t\t\ttext: \"¡Categoría eliminada correctamente!\",\n\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\tfunction(isConfirm){\n\n\t\t\t\t\t\t\t\t\tif (isConfirm) {\n\n\n\t\t\t\t\t\t\t\t\t\twindow.location = \"categories\";\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t</script>';\n\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\techo \"error\";\n\n\t \t\n\t\t\t\t\t\t\t\t }\n\t\t\t\t \t\t}\n\t\t\t\t}", "public function category_delete(Request $request)\n {\n $id = $request->id;\n\n $op = $request->op; // get operation number \n\n switch($op) {\n /** Event Categories */\n case 1:\n $model = new Category;\n $entity_id = 1;\n break;\n\n /** Sponsor Categories */\n case 2:\n $model = new SponsorCategory;\n $entity_id = 12;\n break;\n\n /** Offer Categories */\n case 3:\n $model = new OfferCategory;\n $entity_id = 7;\n break;\n\n /** Doctors Specialization Categories */\n case 4:\n $model = new DoctorsCategory;\n $entity_id = 11;\n break;\n\n default:\n return redirect()->back();\n break;\n }\n\n // delete from localization - Arabic version\n try {\n EntityLocalization::where('entity_id', $entity_id)->where('item_id', $id)->delete();\n } catch (\\Exception $ex) {\n return response()->json(['error', 'error deleting arabic']);\n }\n\n // delete from interests - English version\n try {\n $model::where('id', $id)->delete();\n } catch (\\Exception $ex) {\n return response()->json(['error', 'error deleting english']);\n }\n\n // return success response\n return response()->json(['success', 'success']);\n }", "public function delcategory() {\n extract($_GET);\n //print_r($_GET);die();\n // call to model function to del category from db\n $result = $this->dash_model->delcategory($mat_cat_id);\n\n echo json_encode($result);\n }", "public function deleteCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n /*删除分类下的子分类*/\n $key = $_REQUEST['id'];\n $condition['id'] = $key;\n $form = M(\"categoryinfo\");\n $data = $form->where($condition)->delete(); \n $data_all = $form->select();\n for ($i = 0;$i< count($data_all);$i++)\n {\n if ($data_all[$i]['father'] == $key) \n {\n $condition['id'] = $data_all[$i]['id'];\n $form->where($condition)->delete();\n }\n } \n /*删除分类下的菜品*/\n $food = M('foodinfo');\n $data_food = $food->select();\n for ($i = 0;$i< count($data_food);$i++)\n {\n if ($data_food[$i]['father'] == $key) \n {\n $condition['id'] = $data_food[$i]['id'];\n $food->where($condition)->delete();\n }\n if ($data_food[$i]['category'] == $key) \n {\n $condition['id'] = $data_food[$i]['id'];\n $food->where($condition)->delete();\n }\n } \n\t\t$this->redirect('/index.php/Admin/dish');\n //$this->display();\n }", "public function delete_category(){\n $query = \"DELETE FROM {$this->table} WHERE {$this->table}.cat_id = (:cat_id)\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':cat_id', $this->cat_id);\n $stmt->execute();\n return $stmt;\n \n }", "public function deleteCategoryLangaugeAction(){\n $ebookers_obj = new Ep_Ebookers_Managelist();\n //to call a function to delete themes//\n $ebookers_obj->deleteCategoryLangauge($this->_request->getParams());\n //unset($_REQUEST);\n exit;\n }", "public function storeWorkoutCategory(Request $request)\n {\n $this->validate($request,array(\n 'categoryName' => 'required',\n ));\n\n $workoutCategory = new Category;\n\n $workoutCategory->category = $request->categoryName;\n\n $workoutCategory->save();\n\n if($workoutCategory->save()){\n return redirect()->back()->with('success','Workout category Saved successfully.');\n }\n else{\n return redirect()->back()->with('denger-success','Workout category is not saved.');\n }\n \n }" ]
[ "0.66179216", "0.62175333", "0.606527", "0.6050479", "0.6025807", "0.5908983", "0.58987623", "0.58845043", "0.58626807", "0.5849458", "0.58235", "0.5812783", "0.57931215", "0.57875305", "0.5775079", "0.5774425", "0.57559234", "0.57472736", "0.5708211", "0.5707082", "0.56997186", "0.56898755", "0.56816846", "0.5681554", "0.5657632", "0.5655254", "0.5638101", "0.5625207", "0.56216407", "0.5620899" ]
0.67777485
0
/Edit video category Function for update
public function updateVideoCategory(Request $request) { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $this->validate($request,array( 'name' => 'required', )); $id = $request->id; $videoCategory = VideoCategory::find($id); $videoCategory->video_category_name = $request->name; $videoCategory->save(); Session::flash('success','Video Category Updated succcessfully.'); return redirect()->back()->with('workout',$videoCategory); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modifyCategory()\n{\n global $connection;\n if (isset($_POST['modifyBtn'])) {\n $categoria_id = $_POST['categoria_id'];\n\n $categoria_nome = str_replace([\"'\", '’', '“', '”'], [\"\\'\", \"\\'\", \"\\'\", \"\\'\"], $_POST['categoria_nome']);\n\n $query_update = \"UPDATE video_category SET category_video='$categoria_nome' WHERE id_category='$categoria_id'\";\n $result_update = mysqli_query($connection, $query_update);\n if ($result_update) {\n return header('Location: video_categorie.php?modify=true');\n } else {\n return header('Location: video_categorie.php?modify=false');\n }\n }\n}", "function edit(category $category)\n {\n $query = \"UPDATE categories SET name = '$category->name', \n tag = '$category->tag', description = '$category->description', slug = '$category->slug', active = '$category->active' WHERE categories_id = $category->category_id\";\n $result = $this->db->update($query);\n }", "public function addEdit(){\n\t\tif (isset($this->session->userdata['logged_in'])){\n\t\t\t$video_id = $this->uri->segment(4);// get id form url\n\t\t\tif($video_id==''){\n\t\t\t\t$data['title'] = \"Add Video\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$data['title'] = \"Edit Video\";\n\t\t\t}\n\t\t\t$data['content'] = 'admin/addeditvideo';\n\t\t\t$data['getVideo'] = $this->VideoModel->getVideoById($video_id); //retrive all category By Id\n\t\t\t//print_r($data['getVideo']); die;\n\t\t\t$this->load->view('admin/layout/adminmaster',$data);\n\t\t}else{\n\t\t\tredirect('admin/login');\n\t\t}\n\t}", "public function update_category(){\n $query = \"UPDATE {$this->table} SET cat_title = :cat_title WHERE {$this->table}.cat_id = :cat_id\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':cat_title',$this->cat_title);\n $stmt->bindParam(':cat_id',$this->cat_id);\n $stmt->execute();\n return $stmt;\n }", "public function edit($id)\n {\n $video = Video::find($id);\n // dd($video->categories[0]->name);\n $categories = Category::where('status',1)->orderBy('name')->get();\n $tags = Tag::where('status',1)->get();\n return view('adminCMS.videos.editVideo',compact('video','categories','tags'));\n }", "public function testUpdateCategoryUsingPUT()\n {\n }", "private function updateVideo()\n {\n try\n {\n $request = $_POST;\n\n global $cbvid;\n\n //check if video id provided\n if( !isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"video Id not provided\");\n\n if( !is_numeric($request['videoid']) )\n throw_error_msg(\"invalid video id\");\n\n //check if title provided\n if( !isset($request['title']) || $request['title']==\"\")\n throw_error_msg(\"title not provided\");\n else\n $title = mysql_clean($request['title']);\n\n //check if description provided\n if( !isset($request['description']) || $request['description']==\"\")\n throw_error_msg(\"description not provided.\");\n else\n $description = mysql_clean($request['description']);\n\n //check if tags provided\n if(!isset($request['tags']) || $request['tags']==\"\")\n throw_error_msg(\"tags not provided.\");\n else\n $tags = mysql_clean($request['tags']);\n\n //check if tags provided\n if(!isset($request['category']) || $request['category']==\"\")\n {\n throw_error_msg(\"category not provided.\");\n }\n else\n {\n $request['category'] = explode(',',$request['category']); \n $_POST['category'] = $request['category'];\n }\n \n if (isset($request['video_users-user']) || isset($request['video_users-group'])) \n {\n $video_user_ = mysql_clean($request['video_users-user']);\n $video_group_ = mysql_clean($request['video_users-group']);\n\n $request['video_users'] = get_video_users($video_user_,$video_group_,false);\n }\n \n $result = $cbvid->update_video($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $vdetails = $cbvid->get_video_details($request['videoid']);\n $formatted_video = format_videos(array($vdetails));\n\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $formatted_video[0]);\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function update_assets_category() {\n\t\n\t\tif($this->input->post('edit_type')=='assets_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t\n\t\t$id = $this->uri->segment(4);\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->update_assets_category_record($data,$id);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_updated');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "public function editCategory()\r\n{\r\n $query_string = \"UPDATE categories \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"categoryname = :categoryname, \";\r\n $query_string .= \"categorydescription = :categorydescription \";\r\n $query_string .= \"WHERE categoryid = :categoryid\";\r\n\r\n return $query_string;\r\n}", "public function updateCategory()\n {\n Category::findOrFail($this->category_id)->update([\n 'category_name' => $this->categoryName,\n 'slug' => Str::slug($this->categoryName),\n 'class' => $this->class,\n\n ]);\n }", "public function edit($id)\n {\n $video = Video::find($id);\n $category = Category::all()->pluck('name','id');\n \n return view('admin.video.edit', compact('video','category'));\n }", "public function categories_update($param = null)\r\n {\r\n if (isset($_POST[\"cat_id\"]) && !empty($_POST[\"cat_id\"])) {\r\n $action = $_POST[\"cat_id\"];\r\n $newValue = $_POST[\"cat_descr\"];\r\n $update = Category::find($action)->update(['cat_descr' => $newValue]);\r\n echo $update;\r\n\r\n } else {\r\n echo json_encode([\"error\" => \"ERROR\"]);\r\n }\r\n }", "function fm_update_category($name, $catid = NULL, $groupid = 0) {\r\n\tglobal $USER;\r\n\t\r\n\tif ($catid != NULL) {\r\n\t\t$update->id = $catid;\r\n\t\t$update->name = $name;\r\n\t\t$update->timemodified = time();\r\n\t\tif (!update_record('fmanager_categories', $update)) {\r\n\t\t\terror(get_string(\"errnoupdate\",'block_file_manager'));\r\n\t\t}\r\n\t} else {\r\n\t\t$new->name = $name;\r\n\t\tif ($groupid == 0){\r\n\t\t\t$new->owner = $USER->id;\r\n\t\t\t$new->ownertype = OWNERISUSER;\r\n\t\t} else {\r\n\t\t\t$new->owner = $groupid;\r\n\t\t\t$new->ownertype = OWNERISGROUP;\r\n\t\t}\r\n\t\t$new->timemodified = time();\r\n\t\tif (!insert_record('fmanager_categories', $new)) {\r\n\t\t\terror(get_string(\"errnoinsert\",'block_file_manager'));\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "function edit_category() {\r\n\r\n\tif(isset($_POST['editcategory'])){\r\n\r\n\t\t$cat_id\t\t\t\t= clean_input($_GET['cat_id']);\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\r\n\r\n\t\t$xyquery = \"UPDATE categories SET \";\r\n\t\t$xyquery .= \"cat_name = '$cat_name',\";\r\n\t\t$xyquery .= \"cat_desc_short = '$cat_desc_short'\";\r\n\t\t$xyquery .= \",cat_desc_long = '$cat_desc_long'\";\r\n\t\t$xyquery .= \",cat_parent_id = '$cat_parent_id'\";\r\n\t\t$xyquery .= \",cat_url = '$cat_url'\";\r\n\t\t$xyquery .= \",cat_mod = '$cat_mod'\";\r\n\t\t$xyquery .= \",cat_mod_by = '$cat_mod_by'\";\r\n\t\t$xyquery .= \",page_template = '$page_template'\";\r\n\t\t$xyquery .= \",cat_meta_title = '$cat_meta_title'\";\r\n\t\t$xyquery .= \",cat_meta_keywords = '$cat_meta_keywords'\";\r\n\t\t$xyquery .= \",cat_meta_description = '$cat_meta_description'\";\r\n\t\t$xyquery .= \",insert_keywords = '$insert_keywords'\";\t\t\t\t\r\n\t\t$xyquery .= \"WHERE cat_id = '$cat_id'\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" been edited!</h4></center>\";\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been modified.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "public function editVideoCategory($id)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = VideoCategory::find($id);\n return view('admin.editvideocategory')->with('workout',$workout);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function edit_postAction() {\r\n\t\t$info = $this->getPost(array('id', 'sort', 'title', 'img', 'status', 'hits'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$ret = Game_Service_Category::updateCategory($info, intval($info['id']));\r\n\t\tif (!$ret) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功.'); \t\t\r\n\t}", "function EditarCategoria($params=null){\n $id_categoria= $params[':ID'];\n $this->modelo->GetCategoria($id_categoria);\n $this->vista->mostrarCategoriaEdit($id_categoria); \n }", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "function wp_update_category($catarr)\n {\n }", "public function edit(Video $video)\n {\n //\n }", "public function edit(Video $video)\n {\n //\n }", "public function testUpdateItemSubCategory()\n {\n }", "public function update(Request $request, VideoCategory $videoCategory)\n {\n $data = $request->validate([\n 'name' => 'required',\n ]);\n\n $videoCategory->update($data);\n\n return back()->with('success', 'تم التعديل بنجاح');\n }", "public function edit(ProductVideo $productVideo)\n {\n //\n }", "public function update_gallery_category_post()\n {\n prevent_author();\n\n //validate inputs\n $this->form_validation->set_rules('name', trans(\"category_name\"), 'required|xss_clean|max_length[200]');\n\n if ($this->form_validation->run() === false) {\n $this->session->set_flashdata('errors', validation_errors());\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n redirect($this->agent->referrer());\n } else {\n //category id\n $id = $this->input->post('category_id', true);\n if ($this->gallery_category_model->update_category($id)) {\n $this->session->set_flashdata('success', trans(\"category\") . \" \" . trans(\"msg_suc_updated\"));\n redirect('admin_category/gallery_categories');\n } else {\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n $this->session->set_flashdata('error', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }\n }", "public function updateCategory(){\n\t\t \n\t\t$file_id = $this->category_model->updateCategory($_POST['id'],$_POST['name']);\n\t\t echo $file_id;\n\t\t\t\t\n }", "public function update(Request $request, $id)\n {\n $data['page_title'] = 'Content';\n $data['categories'] = Category::all()->sortBy('name');\n $data['languages'] = Settings::LANGUAGES;\n $data['genres'] = Settings::GENRES;\n\n $validationData = $request->validate(\n [\n 'category' => ['required'],\n 'name' => ['required', 'string', 'max:255'],\n //'videofile' => 'sometimes|nullable|mimes:mpeg,ogg,mp4,webm,3gp,mov,flv,avi,wmv,ts|max:' . config('constants.MAX_VIDEO_UPLOAD_SIZE'),\n 'file' => 'sometimes|nullable|mimes:png,PNG,jpg,JPG,jpeg,JPEG|max:' . config('constants.MAX_FILE_UPLOAD_SIZE'),\n 'language' => ['required', 'string'],\n 'genres' => ['required', 'string'],\n 'artist' => ['required', 'string'],\n 'castandcrew' => ['required', 'string'],\n 'description' => ['required', 'string'],\n\n ]\n );\n if ($request->hasfile('file')) {\n $image = $request->file('file');\n $image_name = time() . '_' . $image->getClientOriginalName();\n //$image_path = $request->file('file')->storeAs('uploads', $image_name);\n $image_path = 'banner_images/' . $image_name;\n Storage::disk('s3')->put($image_path, file_get_contents($image));\n }\n\n //print($duration);\n $tags = ($request->tags) ? explode(',', $request->tags) : '';\n $display_tags = ($request->display_tags) ? explode(',', $request->display_tags) : '';\n\n $save_data = [\n 'category_id' => $request->category,\n 'name' => $request->name,\n 'language' => $request->language,\n 'genres' => $request->genres,\n //'content_link' => ($video_path) ?? '',\n //'format' => ($video_extension) ?? '',\n 'tags' => json_encode($tags),\n 'display_tags' => json_encode($display_tags),\n //'client_id' => $this->client(),\n 'artist' => $request->artist,\n 'castandcrew' => $request->castandcrew,\n 'description' => $request->description,\n 'updated_by' => Auth::id(),\n ];\n if (isset($image_path))\n $save_data = array_merge($save_data, ['banner_image' => $image_path]);\n //dd($save_data);\n $content = Content::whereId($id)->update($save_data);\n if ($content) {\n return redirect('client/contents/view/' . $id)->with('success', \"Content Update Successfully.\");\n } else {\n return redirect('client/contents/view/' . $id)->with('failure', \"Oops! Content Not Updated.\");\n }\n }", "public function update(Request $request ,Category $update){\n $update -> category_name_en = $request -> blog_category_name_en;\n $update -> category_name_lng = $request -> blog_category_name_lng;\n $update -> category_name_en_slug = strtolower(str_replace(' ' , '-' , $request -> blog_category_name_en));\n $update -> category_name_lng_slug = str_replace(' ' , '-' , $request -> blog_category_name_lng);\n $update -> update();\n return true;\n }", "function editCategory($category, $id) {\n $data = [\n 'name' => $_POST['name'],\n 'description' => $_POST['description']\n ];\n\n $stmt = $category->update($id, $data);\n header('location: confirm.php?action=Category&type=update&query='.$stmt);\n}", "public function editVideo($id)\n {\n\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = Video::find($id);\n $categories = VideoCategory::all();\n //dd($categories);\n return view('admin.editvideo')->with('workout',$workout)->with('videoCategories',$categories);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }" ]
[ "0.70255893", "0.68039304", "0.67580926", "0.67113507", "0.67026937", "0.6621358", "0.65880543", "0.6528769", "0.6527254", "0.6502974", "0.6494821", "0.64577454", "0.6449746", "0.6443463", "0.64407146", "0.64304763", "0.6426913", "0.63906366", "0.63733435", "0.63481635", "0.63481635", "0.63345647", "0.63203114", "0.6311294", "0.6307293", "0.6283688", "0.62724113", "0.6236646", "0.6193586", "0.6192923" ]
0.7049841
0
/Edit video category Function for delete video category
public function deleteVideoCategory(Request $request) { $id = $request->workoutid; $getWorkout = VideoCategory::find($id); if($getWorkout->delete()){ return redirect()->back()->with('danger','Video Category Deleted successfully'); } else{ return redirect()->back()->with('danger','Sorry! Video Category is not deleted'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cat_delete_link()\n{\n return Parrot::getInstance()->getUrl(\"admin/category/\" . discussion::encode_title(cat_title()) . \"/delete\");\n}", "public function delete(){\n\n\t\t$sql = new Sql();\n\n\t\t$sql->query(\"DELETE FROM tb_categories WHERE idcategory=:idcategory\",array(\n\t\t\t\":idcategory\"=>$this->getidcategory()\n\t\t));\n\n\t\tCategory::updateFile();\n\t}", "public function remove_category() {\n\t\t$this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(Request::get(\"cat\"));\n\t\t$this->model->categories->unlink($category);\n if(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\t\n\t}", "public function deletecategory(){\n\t\n\t\t$id = $this->request->getParameter(\"actionid\");\n\t\t$modelCategory = new CaCategory();\n\t\t$modelCategory->delete($id);\n\t\n\t\t// generate view\n\t\t$this->redirect(\"catalogadmin/categories\");\n\t}", "function product_category_delete(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u;\n\t\t\n\t\tmysql_q(\"DELETE FROM product_category WHERE id='\".add_slash($_r['id']).\"'\");\n\n\t\tredirect(\"product_category.htm\", \"\");\n\t}", "public function deletePost(){\n\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"delete_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n if ($categoryModel->deleteCategory($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category deleted successfully!\",\"success\");\n }\n } catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }", "function DeleteCategory()\n{\n if (isset($_POST['deletebtn'])) {\n global $connection;\n\n $connesione = $_POST['deleteImp'];\n\n $delete_query = \"DELETE FROM video_category WHERE id_category='$connesione'\";\n $delete_result = mysqli_query($connection, $delete_query);\n\n if ($delete_result) {\n return header('Location: video_categorie.php?delete=true');\n } else {\n return header('Location: video_categorie.php?delete=false');\n }\n }\n}", "public function delete_category($id)\n { \n\t $query=$this->General_model->show_data_id('categories',$id,'category_Id','get','');\n @unlink(str_replace(base_url(),'',$query[0]->category_img));\n \n $query=$this->General_model->show_data_id('categories',$id,'category_Id','delete','');\n $this->session->set_flashdata('success','Product Category Deleted successfully'); \n redirect('superpanel/categorie');\n\t\n\t }", "public function delete()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not logged in!\");\n }\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n try{\n $categoryName = $categoryModel->getCategoryNameById($categoryId);\n\n $this->view->render(\"admin/categories/delete\",[\n \"name\"=> $categoryName,\n \"id\"=> $categoryId\n ]\n );\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n\n }", "public function delete_gallery_category_post()\n {\n prevent_author();\n\n $id = $this->input->post('category_id', true);\n\n //check if category has posts\n if ($this->gallery_image_model->get_category_image_count($id) > 0) {\n $this->session->set_flashdata('error', trans(\"msg_delete_images\"));\n redirect($this->agent->referrer());\n }\n\n if ($this->gallery_category_model->delete_category($id)) {\n $this->session->set_flashdata('success', trans(\"category\") . \" \" . trans(\"msg_suc_deleted\"));\n redirect($this->agent->referrer());\n } else {\n $this->session->set_flashdata('error', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }", "public function delete_category() {\n $category_id = $_GET['category_id'];\n\n $data['delete_category'] = $this->Category_crud->get_category_by_id($category_id);\n $this->load->view('restaurant/category/delete_category_model', $data);\n\n if (isset($_POST['delete_category_yes'])) {\n $this->Category_crud->delete_category_sub_category_item($category_id);\n redirect(rest_path('Category'));\n }\n\n if (isset($_POST['delete_category_no'])) {\n $this->Category_crud->delete_category($category_id);\n redirect(rest_path('Category'));\n }\n }", "public static function deleteCategoryController(){\n\n\n \t \t if (isset($_POST[\"editCategoryId\"])) {\n\n\n \t \t \t\t\t// NOTA: Se pasa un valor entero como array ya que el modelo de productos recibe de varios métodos\n \t \t\t\t\t\t$dataController = array(\"idcategory\"=>$_POST[\"editCategoryId\"]);\n\n \t \t\t\t\t\t// Esta variable se envía al modelos para proceder a eliminar la categoria\n \t \t\t\t\t\t$dataIdCategoryController = $_POST[\"editCategoryId\"];\n\n \t \t\t\t\t\t// VER PRODUCTOS ASOCIADOS A LA CATEGORIA\n\t\t\t\t\t\t// $answerProducts = productsModel::ViewProductById($dataController, \"productos\");\n\n\t\t\t\t\t\t// foreach ($answerProducts as $row => $item) {\n\n\t\t\t\t\t\t// $dataProductController = array(\"id\"=>$item[\"id\"], \"idcategory\"=>0, \"enable\"=> 1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// $answerDeleteProducts = productsModel::disableProductByIdCategory($dataProductController, \"productos\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$answerDeleteCategory = categorieModel::deleteCategoryModel($dataIdCategoryController, \"categorias\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t \t\tif ($answerDeleteCategory == 1) {\n\n\t \t\t\t\t\techo '<script >swal({\n\n\t\t\t\t\t\t\t\ttitle: \"¡OK!\",\n\t\t\t\t\t\t\t\ttext: \"¡Categoría eliminada correctamente!\",\n\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\tfunction(isConfirm){\n\n\t\t\t\t\t\t\t\t\tif (isConfirm) {\n\n\n\t\t\t\t\t\t\t\t\t\twindow.location = \"categories\";\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t</script>';\n\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\techo \"error\";\n\n\t \t\n\t\t\t\t\t\t\t\t }\n\t\t\t\t \t\t}\n\t\t\t\t}", "public function deleteAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Game_Service_Category::getCategory($id);\r\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\r\n\t\t$result = Game_Service_Category::deleteCategory($id);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "public function delete_category(){\n $query = \"DELETE FROM {$this->table} WHERE {$this->table}.cat_id = (:cat_id)\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':cat_id', $this->cat_id);\n $stmt->execute();\n return $stmt;\n \n }", "public function deleteAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET VIEWER INFO\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n $listingtype_id = $this->_listingType->listingtype_id;\n $this->view->listingType = $this->_listingType;\n\n //GET TAB ID\n $this->view->tab_selected_id = $tab_selected_id = $this->_getParam('content_id');\n $this->view->format_form = $this->_getParam('format', null);\n\n //GET VIDEO OBJECT\n $this->view->sitereview_video = $sitereview_video = Engine_Api::_()->getItem('sitereview_video', $this->getRequest()->getParam('video_id'));\n\n //GET VIDEO TITLE\n $this->view->title = $sitereview_video->title;\n\n //GET LISTING ID\n $listing_id = $sitereview_video->listing_id;\n\n //GET NAVIGATION \n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('sitereview_main');\n\n //GET SITEREVIEW SUBJECT\n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n $can_edit = $sitereview->authorization()->isAllowed($viewer, 'edit_listtype_' . $sitereview->listingtype_id);\n\n if (!$sitereview_video) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_(\"Video doesn't exists or not authorized to delete\");\n return;\n }\n\n //VIDEO OWNER AND LISTING OWNER CAN DELETE VIDEO\n if ($viewer_id != $sitereview_video->owner_id && $can_edit != 1) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n\n if (!$this->getRequest()->isPost()) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Invalid request method');\n return;\n }\n\n $db = $sitereview_video->getTable()->getAdapter();\n $db->beginTransaction();\n\n try {\n\n Engine_Api::_()->getDbtable('videoratings', 'sitereview')->delete(array('videorating_id =?' => $this->getRequest()->getParam('video_id')));\n\n $sitereview_video->delete();\n\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n\n\n\n\n $this->view->status = true;\n if ($this->view->format_form == 'smoothbox') {\n $this->_forwardCustom('success', 'utility', 'core', array(\n 'smoothboxClose' => true,\n 'parentRefresh' => '500',\n 'parentRefreshTime' => '500',\n 'format' => 'smoothbox',\n 'messages' => Zend_Registry::get('Zend_Translate')->_('You have successfully deleted this video.')\n ));\n } else {\n if (Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n if ($can_edit) {\n return $this->_gotoRouteCustom(array('action' => 'edit', 'listing_id' => $sitereview->listing_id), \"sitereview_videospecific_listtype_$listingtype_id\", true);\n } else {\n return $this->_gotoRouteCustom(array('listing_id' => $sitereview->listing_id, 'slug' => $sitereview->getSlug(), 'tab' => $tab_selected_id), \"sitereview_entry_view_listtype_$listingtype_id\", true);\n }\n } else {\n return $this->_gotoRouteCustom(array('listing_id' => $sitereview->listing_id, 'slug' => $sitereview->getSlug(), 'tab' => $tab_selected_id), \"sitereview_entry_view_listtype_$listingtype_id\", true);\n }\n }\n }", "function categoryRemove(){\n\tif(startSession() && isset($_SESSION['UserID']))\n\t{\n\t\t$CatID\t\t\t \t= strip_tags($_GET['id']);\t#int - primaryKey\n\n\t\t$db = pdo(); # pdo() creates and returns a PDO object\n\n\t\t$sql = \"DELETE FROM ma_Categories WHERE CatID = :CatID\";\n\n\t\t$stmt = $db->prepare($sql);\n\t\t//INTEGER EXAMPLE $stmt->bindValue(1, $id, PDO::PARAM_INT);\n\t\t$stmt->bindValue(':CatID', $CatID, PDO::PARAM_INT);\n\n\t\ttry {$stmt->execute();} catch(PDOException $ex) {trigger_error($ex->getMessage(), E_USER_ERROR);}\n\t\t#feedback success or failure of update\n\n\t\tif ($stmt->rowCount() > 0)\n\t\t{//success! provide feedback, chance to change another!\n\t\t\tfeedback(\"Category Removed Successfully\",\"success\");\n\t\t}else{//Problem! Provide feedback!\n\t\t\tfeedback(\"Category Not Trashed!\",\"warning\");\n\t\t}\n\t\tmyRedirect(THIS_PAGE);\n\t}\n\t#script for expanding textarea\n}", "public function delcategory() {\n extract($_GET);\n //print_r($_GET);die();\n // call to model function to del category from db\n $result = $this->dash_model->delcategory($mat_cat_id);\n\n echo json_encode($result);\n }", "private function deleteVideo()\n {\n try \n {\n global $cbvid;\n \n $request = $_REQUEST;\n #pex($request,true);\n if(!isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"video id not provided\");\n\n if( isset($request['videoid']) && !is_numeric($request['videoid']) )\n throw_error_msg(\"invalid video id\");\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n \n $cbvid->delete_video( (int)$request['videoid'] );\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"video deleted successfully\", \"data\" => array());\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage()); \n } \n }", "public function delete($video_id);", "public function delete_assets_category() {\n\t\t\n\t\tif($this->input->post('type')=='delete_record') {\n\t\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t$id = $this->uri->segment(4);\n\t\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t$result = $this->Assets_model->delete_assets_category_record($id);\n\t\t\tif(isset($id)) {\n\t\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_deleted');\n\t\t\t} else {\n\t\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t\t}\n\t\t\t$this->output($Return);\n\t\t}\n\t}", "public function updateVideoCategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n ));\n $id = $request->id;\n $videoCategory = VideoCategory::find($id);\n $videoCategory->video_category_name = $request->name;\n $videoCategory->save();\n Session::flash('success','Video Category Updated succcessfully.');\n return redirect()->back()->with('workout',$videoCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "function deleteCategoryMeta($cat_id) {\n\t\t$course_meta = new CourseMeta($cat_id);\n\t\t$course_meta->delete();\n\t}", "protected function _delete()\r\n\t{\r\n\t\tEngine_Api::_() -> getDbTable('favorites', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// remove video from favorite table\r\n\t\tEngine_Api::_() -> getDbTable('favorites', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// remove video from rating table\r\n\t\tEngine_Api::_() -> getDbTable('ratings', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// remove video from watchlater table\r\n\t\tEngine_Api::_() -> getDbTable('watchlaters', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// update video count in signature table\r\n\t\t$signatureTbl = Engine_Api::_() -> getDbTable('signatures', 'ynvideo');\r\n\t\t$signature = $signatureTbl -> fetchRow($signatureTbl -> select() -> where('user_id = ?', $this -> owner_id));\r\n\t\tif ($signature)\r\n\t\t{\r\n\t\t\t$signature -> video_count = new Zend_Db_Expr('video_count - 1');\r\n\t\t}\r\n\t\t$signature -> save();\r\n\r\n\t\t// remove video from playlists\r\n\t\t$playlistAssocTbl = Engine_Api::_() -> getDbTable('playlistassoc', 'ynvideo');\r\n\t\t$playlistAssocs = $playlistAssocTbl -> fetchAll($playlistAssocTbl -> select() -> where('video_id = ?', $this -> getIdentity()));\r\n\t\tforeach ($playlistAssocs as $playlistAssoc)\r\n\t\t{\r\n\t\t\t$playlistAssoc -> delete();\r\n\t\t}\r\n\r\n\t\tparent::_delete();\r\n\t}", "public function delete(): void\n {\n $query_lang = 'DELETE FROM '. rex::getTablePrefix() .'d2u_linkbox_categories '\n .'WHERE category_id = '. $this->category_id;\n $result_lang = rex_sql::factory();\n $result_lang->setQuery($query_lang);\n }", "function delete_category($category_id)\n {\n $this->db->update('tbl_category',$this,array('category_id'=>$category_id));\n //echo $this->db->last_query();\n }", "function del()\n {\n $id = $this->uri->rsegment(3);\n $this->_del($id);\n \n $this->session->set_flashdata('message', 'Xóa thành công');\n redirect(admin_url('video'));\n }", "public function videoCategory() {\n $this->loadModel('VideoCategories');\n $data = $this->VideoCategories->find('all');\n $this->paginate = [ ];\n $videoCategories = $this->paginate($data);\n\n $this->set(compact('videoCategories'));\n \n }", "public function operateCategory(){\n\t\t$title = $_POST['name'];\n\t\t\n\t\t$operation = $_POST['operation'];\n\t\t$id = $_POST['edit_id'];\n\t\t$shared = !empty($_POST['shared']) ? $_POST['shared'] : 0;\n\t\t$description = isset($_POST['description']) ? $_POST['description'] : '';\n\t\t$parent_id = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;\n\t\t$published = isset($_POST['published']) ? $_POST['published'] : 0;\n\t\t$save = $_POST['submit'];\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\t//echo $title.\" \".$operation.\" \".$id.\" \".\" \".$shared.\" \".$save;\n\t\tif(isset($save))\n\t\t{\n\t\t\tif( $operation == 'add' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id,'description' => $description,'published' => $published);\n\t\t\t\t$data = $this->query_model->getCategory(\"downloads\");\n\t\t\t\tif($this->query_model->addCategory($args)){\n\t\t\t\t\tredirect($this->index());\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\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $operation == 'edit' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id ,'description' => $description,'published' => $published);\n\t\t\t\t$this->db->where(\"cat_id\",$id);\n\t\t\t\tif($this->query_model->editCategory($args)){\n\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}", "private function removeVideoFromGroup()\n {\n try\n {\n $request = $_REQUEST;\n\n if(!isset($request['group_id']) || $request['group_id']==\"\" )\n throw_error_msg('provide group id');\n else if(!is_numeric($request['group_id'])) \n throw_error_msg('invalid group id'); \n else\n $gid = (int)$request['group_id'];\n\n if(!isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg('provide video id');\n else if(!is_numeric($request['videoid'])) \n throw_error_msg('invalid video id'); \n else\n $vid = (int)$request['videoid'];\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n \n global $cbgroup; \n $id = $cbgroup->remove_group_video($vid,$gid,true);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg())\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'video removed from group', \"data\" => array());\n $this->response($this->json($data));\n }\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "function deleteVideo()\n{\n global $connection;\n if (isset($_POST['btn_delete'])) {\n $idVideo = $_POST['btn_delete'];\n $data = videoCurrentFileTitle($idVideo, $connection);\n $videoTitle = $data['videoTitle'];\n $podcast_location = '../../../upload_podcast/';\n $video_location = '../../../upload_video/';\n $trailerTitle = $data['trailerTitle'];\n $trailer_location = '../../../trail_video/';\n $thumbnailTitle = $data['thumbnailTitle'];\n $thumbnail_location = '../../../thumbnail_video/';\n $superCategorie = $data['superCategorie'];\n \n if ($superCategorie == 1 || $superCategorie == 3) {\n $videoPath = $video_location.$videoTitle;\n } else {\n $videoPath = $podcast_location.$videoTitle;\n }\n \n $trailerPath = $trailer_location.$trailerTitle;\n $thumbnailPath = $thumbnail_location.$thumbnailTitle;\n \n \n global $deleteVideoResponse;\n $deleteVideoResponse = \"\";\n if (empty($idVideo)) {\n $deleteVideoResponse = '<script language=\"javascript\">swal(\"Errore!\", \"È necessario selezionare un video!\", \"error\").then(function() {\n location.reload();\n })</script>';\n } else {\n $query = \"DELETE FROM videos\n WHERE id_video = '$idVideo'\";\n $result = mysqli_query($connection, $query);\n if ($result) {\n unlink($videoPath);\n unlink($trailerPath);\n unlink($thumbnailPath);\n $deleteVideoResponse = '<script language=\"javascript\">swal(\"Successo!\", \"Il video è stato eliminato!\", \"success\".then(function() {\n location.reload();\n }))</script>';\n } else {\n $deleteVideoResponse = '<script language=\"javascript\">swal(\"Errore!\", \"Il video non è stato eliminato!\", \"error\").then(function() {\n location.reload();\n })</script>';\n }\n }\n }\n}" ]
[ "0.6836293", "0.6664944", "0.663955", "0.66256726", "0.65463334", "0.643667", "0.64297694", "0.6421151", "0.64116925", "0.6404533", "0.63948876", "0.6360626", "0.63225144", "0.6319296", "0.62775624", "0.62721723", "0.62640065", "0.62535095", "0.6248276", "0.6229323", "0.61948544", "0.61898494", "0.6183621", "0.61766255", "0.615945", "0.61227447", "0.6121201", "0.6118562", "0.6090637", "0.6071174" ]
0.67401767
1
/Edit Nutration Category Function for update
public function updateNutrationCategory(Request $request) { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $this->validate($request,array( 'name' => 'required', 'tips' => 'required', )); $id = $request->id; $nutrationCategory = NutrationCategory::find($id); $nutrationCategory->nutration_category_name = $request->name; $nutrationCategory->tips = $request->tips; $nutrationCategory->save(); Session::flash('success','Nutration Category Updated succcessfully.'); return redirect()->back()->with('workout',$nutrationCategory); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdateItemSubCategory()\n {\n }", "public function updateCategory()\n {\n Category::findOrFail($this->category_id)->update([\n 'category_name' => $this->categoryName,\n 'slug' => Str::slug($this->categoryName),\n 'class' => $this->class,\n\n ]);\n }", "public function updateCate()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['upcategory'];\n\t\t\t$category_id = $_POST['upcategory_id'];\n\t\t\t$sql = \" update lib_book_species set category = '{$category}' where category in \n\t\t\t\t\t(select category from lib_category where category_id = {$category_id});\n\t\t\t\t\tupdate lib_category set category='\" . $category . \"' where category_id='\" . $category_id . \"';\n\t\t\t\t\t\";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Modify successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function testUpdateCategoryUsingPUT()\n {\n }", "function sensible_category() {\n wp_update_term(1, 'category', array(\n 'name' => 'News',\n 'slug' => 'news', \n 'description' => 'News'\n ));\n }", "public function update_assets_category() {\n\t\n\t\tif($this->input->post('edit_type')=='assets_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t\n\t\t$id = $this->uri->segment(4);\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->update_assets_category_record($data,$id);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_updated');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "function edit(category $category)\n {\n $query = \"UPDATE categories SET name = '$category->name', \n tag = '$category->tag', description = '$category->description', slug = '$category->slug', active = '$category->active' WHERE categories_id = $category->category_id\";\n $result = $this->db->update($query);\n }", "public function update_cat_att()\n\t\t{\n\t\t\t$id=$this->input->post('cat_id');\n\t\t\t$cat_name=$this->input->post('cat_edit_name');\n\t\t\t$update=$this->db->where(\"f_att_id\",$id)->update('food_attribute',array(\"f_att_name\"=>$cat_name));\n\t\t\tif($update)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t}", "public function editCategory()\r\n{\r\n $query_string = \"UPDATE categories \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"categoryname = :categoryname, \";\r\n $query_string .= \"categorydescription = :categorydescription \";\r\n $query_string .= \"WHERE categoryid = :categoryid\";\r\n\r\n return $query_string;\r\n}", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "function wp_update_category($catarr)\n {\n }", "function update_category($category_id)\n {\n $this->db->update('tbl_category',$this, array('category_id'=>$category_id));\n }", "private function update($cat){\r\n\t\tif(!$this->acceptUpdates) return;//do not allow health coach to change answers\r\n\t\tif(!isset($this->categories[$cat])) throw new Exception(\"Invalid category\");\r\n\r\n\t\t$sql=\"UPDATE `u_mod_ifocus` SET \";\r\n\t\t$comma=false;\r\n\t\tforeach($this->data[$cat] as $key=>$value){\r\n\t\t\tif($comma) $sql.=\" , \";\r\n\t\t\t$sql.=\"`\".$key.\"`='\".$this->dbOb->escape_string($value).\"'\";\r\n\t\t\t$comma=true;\r\n\t\t}\r\n\t\tif(!$comma) return; //cant update a section we have no data for\r\n\t\tif(!$this->id) return; //can't update a record we haven't loaded\r\n\r\n\t\t$sql .= \", last_completed = '\" . $cat . \"'\";\r\n\r\n\t\tif($cat==\"biometric_data\"){\r\n\t\t\tif(!$this->isCompleted()) $sql.=\", date_completed=NOW() \";\r\n\t\t\t//upon completion reward points for Health Assessment Questions\r\n\t\t\t$im=new IncentivePointsModel();\r\n\t\t\tif($this->data[\"preventative_health\"][\"q12\"]==1){\r\n\t\t\t\t$im->addIncentivePointMA(\"IFocusModel\",\"FluShot\");\r\n\t\t\t}\r\n\t\t\t$im->addIncentivePointMA(\"IFocusModel\",\"Complete\");\r\n\t\t}\r\n\r\n\t\t$sql .= \" ,date_updated=NOW() WHERE id = '\" . $this->data['id'] . \"'\";\r\n\t\t$this->dbOb->update($sql);\r\n\t}", "function modifyCategory()\n{\n global $connection;\n global $updateCategorySuccess, $updateCategoryError;\n $updateCategorySuccess = $updateCategoryError = '';\n\n if (isset($_POST['btn_save_category'])) {\n $category_id = $_POST['txt_userid'];\n\n $updateColumncategory = '';\n\n $category_name = htmlentities($_POST['category_name']);\n if (!empty($category_name)) {\n $updateColumncategory .= \"category = '$category_name',\";\n }\n\n $updateColumncategory = rtrim($updateColumncategory, ',');\n\n $query_update = \"UPDATE product_category SET $updateColumncategory WHERE id_category = '$category_id'\";\n $result_update = mysqli_query($connection, $query_update);\n\n if ($result_update) {\n $updateCategorySuccess = '<script language=\"javascript\">\n swal(\"Sukses!\", \"Kategoria u modifikua me sukses!\", \"success\")\n </script>';\n } else {\n $updateCategoryError = '<script language=\"javascript\">\n swal(\"Gabim!\", \"Ka ndodhur një gabim gjatë modifikimit të kategorisë! Provoni përsëri!\", \"error\")\n </script>';\n }\n }\n}", "function edit_category() {\r\n\r\n\tif(isset($_POST['editcategory'])){\r\n\r\n\t\t$cat_id\t\t\t\t= clean_input($_GET['cat_id']);\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\r\n\r\n\t\t$xyquery = \"UPDATE categories SET \";\r\n\t\t$xyquery .= \"cat_name = '$cat_name',\";\r\n\t\t$xyquery .= \"cat_desc_short = '$cat_desc_short'\";\r\n\t\t$xyquery .= \",cat_desc_long = '$cat_desc_long'\";\r\n\t\t$xyquery .= \",cat_parent_id = '$cat_parent_id'\";\r\n\t\t$xyquery .= \",cat_url = '$cat_url'\";\r\n\t\t$xyquery .= \",cat_mod = '$cat_mod'\";\r\n\t\t$xyquery .= \",cat_mod_by = '$cat_mod_by'\";\r\n\t\t$xyquery .= \",page_template = '$page_template'\";\r\n\t\t$xyquery .= \",cat_meta_title = '$cat_meta_title'\";\r\n\t\t$xyquery .= \",cat_meta_keywords = '$cat_meta_keywords'\";\r\n\t\t$xyquery .= \",cat_meta_description = '$cat_meta_description'\";\r\n\t\t$xyquery .= \",insert_keywords = '$insert_keywords'\";\t\t\t\t\r\n\t\t$xyquery .= \"WHERE cat_id = '$cat_id'\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" been edited!</h4></center>\";\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been modified.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "public function modifyCategory(){\n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t\t$id = $_REQUEST['id'];\t\t\n\t\t$name = $_REQUEST['name'];\n\t $remark = $_REQUEST['remark'];\n $father = $_REQUEST['father'];\n\t\t$form = M('categoryinfo');\n \t//$key = 2;\n \t$condition['id'] = $id;\n \t$data = $form->where($condition)->find();\n \t//var_dump($data); \n $data['id'] = $id;\n \t$data['name'] = $name;\n\t\t$data['remark'] = $remark;\n $data['father'] = $father;\n \t//echo $data;\n\t\t$result = $form->save($data);\n\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t\t\t//\telse {$this->error('修改失败');}\n\t\t}", "public function update(Request $request ,Category $update){\n $update -> category_name_en = $request -> blog_category_name_en;\n $update -> category_name_lng = $request -> blog_category_name_lng;\n $update -> category_name_en_slug = strtolower(str_replace(' ' , '-' , $request -> blog_category_name_en));\n $update -> category_name_lng_slug = str_replace(' ' , '-' , $request -> blog_category_name_lng);\n $update -> update();\n return true;\n }", "public function editCategory($editCategory) {\n if (isset($editCategory)) {\n\n $data = array(\n 'name' => $editCategory['name'],\n 'support_emails' => $editCategory['support_emails'],\n 'quantity_enabled' => $editCategory['quantity_enabled']\n );\n \n if (isset($editCategory['supplier_user'])) {\n $data['supplier_user'] = $editCategory['supplier_user'];\n }\n \n if (isset($editCategory['custom_fields'])) {\n $data['custom_fields'] = $editCategory['custom_fields'];\n } else {\n $data['custom_fields'] = NULL;\n }\n $this->db->where('id', $editCategory['category_id']);\n $this->db->update('categories', $data);\n return TRUE;\n } else {\n return False;\n }\n }", "public function category_update(){ \n\n\n if (!has_role($this->session->userdata('user_id'), 'CATEGORY_UPDATE')) {\n redirect(base_url('page_not_found'));\n }\n\n $data['parent'] = $this->input->post('parent');\n $data['last_modified'] = date(\"Y-m-d H:i:s\");\n $data['name'] = $this->input->post('name');\n \n if(!$this->category_model->is_parent_category($data['parent'])){\n\n $this->session->set_flashdata('category_save_failed', \"Failed to update sub category!!\");\n }else{\n\n \n $category_id = $this->input->post('cat_id');\n\n\n\n\n if($this->category_model->update_category($category_id, $data)){\n\n $this->logger\n ->user($this->session->userdata('user_id')) //Set UserID, who created this Action\n ->user_details($this->user_model->getUserInfoByIpAddress())\n ->type('category_update') //Entry type like, Post, Page, Entry\n ->id($category_id) //Entry ID\n ->token('UPDATE') //Token identify Action\n ->comment($this->session->userdata('name'). ' update a category.')\n ->log(); //Add Database Entry\n\n $this->session->set_flashdata('category_save_success', \"Category information Updated Successfully!!\");\n } else {\n $this->session->set_flashdata('category_save_failed', \"Category update fialied!!\");\n }\n }\n redirect(base_url('categories'));\n }", "public function edit_category() {\n $data['pageName'] = $this->pageName . ' : Edit Category';\n $get = $this->uri->uri_to_assoc();\n \n //If no id found\n if(!isset($get['id'])){\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">No content found</span>');\n redirect('admin/static_pages/home', \"location\");\n exit();\n }\n \n $category_id = $get['id'];\n $where_clause = array('category_id' => $category_id);\n $categoryRS = $this->User_model->get_category($where_clause);\n\n\n if (!$categoryRS) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Content not available. Please try again later.</span>');\n redirect('admin/category/home', \"location\");\n exit();\n }\n \n $category = $categoryRS[0];\n $data['category'] = $category;\n \n //After posting save data\n if(isset($_POST['category_id']) && !empty($_POST['category_id'])) {\n \n $pst_category_id = addslashes($_POST['category_id']);\n $isCategoryAdded = $this->User_model->update_category($pst_category_id);\n \n if(!$isCategoryAdded) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Unable to update the record</span>');\n }\n else{\n $this->session->set_flashdata('info_message', 'Record updated successfull!');\n redirect('admin/category/home', \"location\");\n }\n }\n $this->load->view('admin/category/edit_view', $data); \n }", "public function update_category(){\n $query = \"UPDATE {$this->table} SET cat_title = :cat_title WHERE {$this->table}.cat_id = :cat_id\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':cat_title',$this->cat_title);\n $stmt->bindParam(':cat_id',$this->cat_id);\n $stmt->execute();\n return $stmt;\n }", "function saveCat()\n {\n //update stuff\n }", "public function categories_update($param = null)\r\n {\r\n if (isset($_POST[\"cat_id\"]) && !empty($_POST[\"cat_id\"])) {\r\n $action = $_POST[\"cat_id\"];\r\n $newValue = $_POST[\"cat_descr\"];\r\n $update = Category::find($action)->update(['cat_descr' => $newValue]);\r\n echo $update;\r\n\r\n } else {\r\n echo json_encode([\"error\" => \"ERROR\"]);\r\n }\r\n }", "public function update()\n\t{\n\t\t$input = \\Input::all();\n\n\t\t$category = Category::findOrFail($input.id);\n\n\t\tif($category){\n\t\t\t$category->name = $input.name;\n\t\t\t$result = $category->save();\n\t\t}\n\n\t\tif($result){\n\t\t\treturn \"true\";\n\t\t}\n\t\treturn \"false\";\n\t}", "function category_edit($id)\n\t{\n\t\tglobal $db;\n\t\t$ccnoprice = $_POST['ccnoprice'];\n\t\t$sSQL = \"UPDATE \".PREFIX.\"categories SET ccnoprice='\".$ccnoprice.\"', ccTemplate='\".mysql_real_escape_string($_POST['ccTemplate']).\"' WHERE id=\".$id;\n\t\t$db->query($sSQL);\n\t}", "public function edit_category($category) {\n $this->category();\n $categories_sql_string = \"SELECT * FROM category WHERE id = \" . $category . \" limit 1\";\n $connection = new Database(\"sbrettsc_db\");\n $menu_array = $connection->get_array_from_query($categories_sql_string);\n $data = array(\"menu_array\" => array_shift($menu_array));\n\n $this->loadView(\"editors/category_editor\", $data);\n }", "function editChoiceCategory($data,$id){\n\t\t$this->db->where('choice_category_id',$id);\n\t\t$query = $this->db->update(\"tbl_choice_category\",$data);\n\t\treturn $this->db->affected_rows();\n\t}", "function fm_update_category($name, $catid = NULL, $groupid = 0) {\r\n\tglobal $USER;\r\n\t\r\n\tif ($catid != NULL) {\r\n\t\t$update->id = $catid;\r\n\t\t$update->name = $name;\r\n\t\t$update->timemodified = time();\r\n\t\tif (!update_record('fmanager_categories', $update)) {\r\n\t\t\terror(get_string(\"errnoupdate\",'block_file_manager'));\r\n\t\t}\r\n\t} else {\r\n\t\t$new->name = $name;\r\n\t\tif ($groupid == 0){\r\n\t\t\t$new->owner = $USER->id;\r\n\t\t\t$new->ownertype = OWNERISUSER;\r\n\t\t} else {\r\n\t\t\t$new->owner = $groupid;\r\n\t\t\t$new->ownertype = OWNERISGROUP;\r\n\t\t}\r\n\t\t$new->timemodified = time();\r\n\t\tif (!insert_record('fmanager_categories', $new)) {\r\n\t\t\terror(get_string(\"errnoinsert\",'block_file_manager'));\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "public function updateForm()\n{\n\n $listeCatgories = $this->model->getCategories();\n $new = $this->model->getNew();\n $this->view->updateForm($new,$listeCatgories);\n}", "public function update(Tax $category): void\n {\n }" ]
[ "0.71557504", "0.71024853", "0.70967233", "0.6873377", "0.6844343", "0.68225706", "0.6781376", "0.67681557", "0.6741728", "0.66843164", "0.66287494", "0.6611749", "0.6610787", "0.65974736", "0.65905493", "0.6587013", "0.65291274", "0.6514518", "0.6501304", "0.6478147", "0.64662594", "0.6392799", "0.63845795", "0.6375152", "0.6367889", "0.63598716", "0.63504887", "0.6346485", "0.63436383", "0.6340993" ]
0.7165534
0
/Delete Nutrition Category Function
public function deleteNutrationCategory(Request $request) { $id = $request->workoutid; $getWorkout = NutrationCategory::find($id); if($getWorkout->delete()){ return redirect()->back()->with('danger','Nutration Category Deleted successfully'); } else{ return redirect()->back()->with('danger','Sorry! Nutration Category is not deleted'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete_category() {\n $category_id = $_GET['category_id'];\n\n $data['delete_category'] = $this->Category_crud->get_category_by_id($category_id);\n $this->load->view('restaurant/category/delete_category_model', $data);\n\n if (isset($_POST['delete_category_yes'])) {\n $this->Category_crud->delete_category_sub_category_item($category_id);\n redirect(rest_path('Category'));\n }\n\n if (isset($_POST['delete_category_no'])) {\n $this->Category_crud->delete_category($category_id);\n redirect(rest_path('Category'));\n }\n }", "function product_category_delete(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u;\n\t\t\n\t\tmysql_q(\"DELETE FROM product_category WHERE id='\".add_slash($_r['id']).\"'\");\n\n\t\tredirect(\"product_category.htm\", \"\");\n\t}", "function ciniki_foodmarket_categoryDelete(&$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 'category_id'=>array('required'=>'yes', 'blank'=>'yes', 'name'=>'Category'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'foodmarket', 'private', 'checkAccess');\n $rc = ciniki_foodmarket_checkAccess($ciniki, $args['tnid'], 'ciniki.foodmarket.categoryDelete');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Get the current settings for the category\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_foodmarket_categories \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.foodmarket', 'category');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['category']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.foodmarket.5', 'msg'=>'Category does not exist.'));\n }\n $category = $rc['category'];\n\n // \n // Check for any child categories\n //\n $strsql = \"SELECT COUNT(id) AS children \"\n . \"FROM ciniki_foodmarket_categories \"\n . \"WHERE ciniki_foodmarket_categories.parent_id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbSingleCount');\n $rc = ciniki_core_dbSingleCount($ciniki, $strsql, 'ciniki.foodmarket', 'num');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( $rc['num'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.foodmarket.6', 'msg'=>'You still have ' . $rc['num'] . ' child categor' . ($rc['num']>1?'ies':'y') . '.'));\n }\n\n //\n // Check for items already in the category\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_foodmarket_category_items \"\n . \"WHERE category_id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.foodmarket', 'item');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.foodmarket.149', 'msg'=>'Unable to load item', 'err'=>$rc['err']));\n }\n $items = isset($rc['rows']) ? $rc['rows'] : array();\n \n //\n // Start transaction\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDelete');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.foodmarket');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Remove any items from the category first\n //\n foreach($items as $item) {\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.foodmarket.categoryitem', $item['id'], $item['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.foodmarket');\n return $rc;\n }\n }\n\n //\n // Remove the category\n //\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.foodmarket.category', $args['category_id'], $category['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.foodmarket');\n return $rc;\n }\n\n //\n // Commit the transaction\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.foodmarket');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'foodmarket');\n\n return array('stat'=>'ok');\n}", "public function deleteCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n /*删除分类下的子分类*/\n $key = $_REQUEST['id'];\n $condition['id'] = $key;\n $form = M(\"categoryinfo\");\n $data = $form->where($condition)->delete(); \n $data_all = $form->select();\n for ($i = 0;$i< count($data_all);$i++)\n {\n if ($data_all[$i]['father'] == $key) \n {\n $condition['id'] = $data_all[$i]['id'];\n $form->where($condition)->delete();\n }\n } \n /*删除分类下的菜品*/\n $food = M('foodinfo');\n $data_food = $food->select();\n for ($i = 0;$i< count($data_food);$i++)\n {\n if ($data_food[$i]['father'] == $key) \n {\n $condition['id'] = $data_food[$i]['id'];\n $food->where($condition)->delete();\n }\n if ($data_food[$i]['category'] == $key) \n {\n $condition['id'] = $data_food[$i]['id'];\n $food->where($condition)->delete();\n }\n } \n\t\t$this->redirect('/index.php/Admin/dish');\n //$this->display();\n }", "function ciniki_directory_categoryDelete(&$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 'category_id'=>array('required'=>'yes', 'default'=>'', 'blank'=>'yes', 'name'=>'Category'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n //\n // Check access to tnid as owner\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'directory', 'private', 'checkAccess');\n $ac = ciniki_directory_checkAccess($ciniki, $args['tnid'], 'ciniki.directory.categoryDelete');\n if( $ac['stat'] != 'ok' ) {\n return $ac;\n }\n\n //\n // Get the category uuid\n //\n $strsql = \"SELECT uuid FROM ciniki_directory_categories \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \" \n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.directory', 'category');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['category']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.directory.12', 'msg'=>'The category does not exist'));\n }\n $uuid = $rc['category']['uuid'];\n\n // \n // Turn off autocommit\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.directory');\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Get the list of entries to remove from this category\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_directory_category_entries \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND category_id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.directory', 'entry');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $entries = $rc['rows'];\n foreach($entries as $entry) {\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.directory.category_entry', \n $entry['id'], $entry['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n\n //\n // Delete the object\n //\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.directory.category', $args['category_id'], $uuid, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Commit the database changes\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.directory');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'directory');\n\n return array('stat'=>'ok');\n}", "public function delete_category()\r\n\t\t{\r\n\t\t\t$this->errno = DB_OK;\r\n\t\t\t\r\n\t\t\tif ( $this->cat_id == -1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tSuch category hasn't been created\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_ID;\r\n\t\t\t\treturn ;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t$this->con->query(\"START TRANSACTION;\");\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tTransaction is needed despite the one query as delete is on cascade\r\n\t\t\t\r\n\t\t\tif ( ! ( $result = $this->con->query ( \"DELETE FROM category WHERE cat_id=$this->cat_id\" ) ) )\r\n\t\t\t{\t\t\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tFailed to connect\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( $this->con->affected_rows == 0 )\r\n\t\t\t{\t\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = CATEGORY_DONT_EXIST;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tthis query should affect 1 row\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t$this->con->query(\"COMMIT;\");\r\n\t\t\t\r\n\t\t}", "public function deleteAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Game_Service_Category::getCategory($id);\r\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\r\n\t\t$result = Game_Service_Category::deleteCategory($id);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "public function delete() {\n $sql = sprintf(\"DELETE FROM category WHERE id=%d\", $this->id);\n self::$connection->execute($sql);\n }", "public function deletecategory(){\n\t\n\t\t$id = $this->request->getParameter(\"actionid\");\n\t\t$modelCategory = new CaCategory();\n\t\t$modelCategory->delete($id);\n\t\n\t\t// generate view\n\t\t$this->redirect(\"catalogadmin/categories\");\n\t}", "function categoryRemove(){\n\tif(startSession() && isset($_SESSION['UserID']))\n\t{\n\t\t$CatID\t\t\t \t= strip_tags($_GET['id']);\t#int - primaryKey\n\n\t\t$db = pdo(); # pdo() creates and returns a PDO object\n\n\t\t$sql = \"DELETE FROM ma_Categories WHERE CatID = :CatID\";\n\n\t\t$stmt = $db->prepare($sql);\n\t\t//INTEGER EXAMPLE $stmt->bindValue(1, $id, PDO::PARAM_INT);\n\t\t$stmt->bindValue(':CatID', $CatID, PDO::PARAM_INT);\n\n\t\ttry {$stmt->execute();} catch(PDOException $ex) {trigger_error($ex->getMessage(), E_USER_ERROR);}\n\t\t#feedback success or failure of update\n\n\t\tif ($stmt->rowCount() > 0)\n\t\t{//success! provide feedback, chance to change another!\n\t\t\tfeedback(\"Category Removed Successfully\",\"success\");\n\t\t}else{//Problem! Provide feedback!\n\t\t\tfeedback(\"Category Not Trashed!\",\"warning\");\n\t\t}\n\t\tmyRedirect(THIS_PAGE);\n\t}\n\t#script for expanding textarea\n}", "public function delete_category($category_id){\n \n DB::table('tbl_category')\n ->where('category_id',$category_id)\n ->delete();\n return Redirect::to('/manage-category');\n }", "function delete_categoria($idcategoria)\n {\n return $this->db->delete('categoria',array('idcategoria'=>$idcategoria));\n }", "public function addNutrationCategory()\n {\n return view('admin.addnutratoncategory');\n }", "public function delete()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not logged in!\");\n }\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n try{\n $categoryName = $categoryModel->getCategoryNameById($categoryId);\n\n $this->view->render(\"admin/categories/delete\",[\n \"name\"=> $categoryName,\n \"id\"=> $categoryId\n ]\n );\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n\n }", "public function delete($interview_category_id)\r\n {\r\n $this->checkIfDemo();\r\n $this->AdminInterviewCategoryModel->remove($interview_category_id);\r\n }", "public function EliminarCategorias()\n\t{\n\n\t\t$sql = \" select codcategoria from productos where codcategoria = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codcategoria\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\n\t\t\t$sql = \" delete from categorias where codcategoria = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codcategoria);\n\t\t\t$codcategoria = base64_decode($_GET[\"codcategoria\"]);\n\t\t\t$stmt->execute();\n\n\t\t\theader(\"Location: categorias?mesage=1\");\n\t\t\texit;\n\n\t\t}else {\n\n\t\t\theader(\"Location: categorias?mesage=2\");\n\t\t\texit;\n\t\t}\n\n\t}", "public function remove_category() {\n\t\t$this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(Request::get(\"cat\"));\n\t\t$this->model->categories->unlink($category);\n if(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\t\n\t}", "public function deletePost(){\n\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"delete_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n if ($categoryModel->deleteCategory($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category deleted successfully!\",\"success\");\n }\n } catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }", "public function category_delete(Request $request)\n {\n $id = $request->id;\n\n $op = $request->op; // get operation number \n\n switch($op) {\n /** Event Categories */\n case 1:\n $model = new Category;\n $entity_id = 1;\n break;\n\n /** Sponsor Categories */\n case 2:\n $model = new SponsorCategory;\n $entity_id = 12;\n break;\n\n /** Offer Categories */\n case 3:\n $model = new OfferCategory;\n $entity_id = 7;\n break;\n\n /** Doctors Specialization Categories */\n case 4:\n $model = new DoctorsCategory;\n $entity_id = 11;\n break;\n\n default:\n return redirect()->back();\n break;\n }\n\n // delete from localization - Arabic version\n try {\n EntityLocalization::where('entity_id', $entity_id)->where('item_id', $id)->delete();\n } catch (\\Exception $ex) {\n return response()->json(['error', 'error deleting arabic']);\n }\n\n // delete from interests - English version\n try {\n $model::where('id', $id)->delete();\n } catch (\\Exception $ex) {\n return response()->json(['error', 'error deleting english']);\n }\n\n // return success response\n return response()->json(['success', 'success']);\n }", "function delete_category($cat_id)\n { \n $sql = \"DELETE FROM prod_categories WHERE `cat_id` = \\\"$cat_id\\\" LIMIT 1\";\n \n //echo $sql ;\n \n\t//submit query\n \n include 'connect.php';\n \n $result = mysqli_query($link, $sql); //returns object\n \n \n \n if (!$result) \n {\n\t\t\t\t\n $err = mysqli_error($link);\n //echo $err ;\n //echo 'error g et_user';\n\t\t\t\t\t\t\t\t\n }\n else\n { \n echo 'Kategoria u fshi nga sistemi!!!' ;\n }\n\n // close connection \n \n }", "public function delete(){\n\n\t\t$sql = new Sql();\n\n\t\t$sql->query(\"DELETE FROM tb_categories WHERE idcategory=:idcategory\",array(\n\t\t\t\":idcategory\"=>$this->getidcategory()\n\t\t));\n\n\t\tCategory::updateFile();\n\t}", "public static function deleteCategoryController(){\n\n\n \t \t if (isset($_POST[\"editCategoryId\"])) {\n\n\n \t \t \t\t\t// NOTA: Se pasa un valor entero como array ya que el modelo de productos recibe de varios métodos\n \t \t\t\t\t\t$dataController = array(\"idcategory\"=>$_POST[\"editCategoryId\"]);\n\n \t \t\t\t\t\t// Esta variable se envía al modelos para proceder a eliminar la categoria\n \t \t\t\t\t\t$dataIdCategoryController = $_POST[\"editCategoryId\"];\n\n \t \t\t\t\t\t// VER PRODUCTOS ASOCIADOS A LA CATEGORIA\n\t\t\t\t\t\t// $answerProducts = productsModel::ViewProductById($dataController, \"productos\");\n\n\t\t\t\t\t\t// foreach ($answerProducts as $row => $item) {\n\n\t\t\t\t\t\t// $dataProductController = array(\"id\"=>$item[\"id\"], \"idcategory\"=>0, \"enable\"=> 1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// $answerDeleteProducts = productsModel::disableProductByIdCategory($dataProductController, \"productos\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$answerDeleteCategory = categorieModel::deleteCategoryModel($dataIdCategoryController, \"categorias\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t \t\tif ($answerDeleteCategory == 1) {\n\n\t \t\t\t\t\techo '<script >swal({\n\n\t\t\t\t\t\t\t\ttitle: \"¡OK!\",\n\t\t\t\t\t\t\t\ttext: \"¡Categoría eliminada correctamente!\",\n\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\tfunction(isConfirm){\n\n\t\t\t\t\t\t\t\t\tif (isConfirm) {\n\n\n\t\t\t\t\t\t\t\t\t\twindow.location = \"categories\";\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t</script>';\n\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\techo \"error\";\n\n\t \t\n\t\t\t\t\t\t\t\t }\n\t\t\t\t \t\t}\n\t\t\t\t}", "public function action_delete()\n {\n if($this->category->has_subcategories())\n {\n // Response faile info\n $this->request->response = View::factory('error', array(\n 'message' => '该分类有子分类,无法删除', \n ));\n }\n else\n {\n if($this->category->delete())\n {\n // Delete successfully\n // Delete search results as well\n $this->request->redirect('category/tree');\n }\n else\n {\n // Failed\n $this->request->response = View::factory('error', array(\n 'message' => '删除失败', \n ));\n }\n }\n }", "function delete($category_id)\n {\n $query = \"DELETE FROM categories WHERE categories_id = '$category_id'\";\n $result = $this->db->delete($query);\n }", "public function delete_category($id)\n { \n\t $query=$this->General_model->show_data_id('categories',$id,'category_Id','get','');\n @unlink(str_replace(base_url(),'',$query[0]->category_img));\n \n $query=$this->General_model->show_data_id('categories',$id,'category_Id','delete','');\n $this->session->set_flashdata('success','Product Category Deleted successfully'); \n redirect('superpanel/categorie');\n\t\n\t }", "public function remove_category($id) {\r\n\t\t\treturn parent::delete($id);\r\n\t\t}", "public function delete_category($id) {\n $this->category();\n\n $connection = new Database(\"sbrettsc_db\");\n $connection->do_sql(\"DELETE FROM category WHERE id = \" . $id);\n $this->index();\n\n }", "public function delete_category() {\r\n $id = $this->uri->segment(3);\r\n $delete = $this->faq_model->delete_menu($id);\r\n\r\n if ($delete) {\r\n $this->session->set_flashdata('succ_msg', 'Menu Deleted Successfully');\r\n } else {\r\n $this->session->set_flashdata('error_msg', 'Unable to Delete Successfully');\r\n }\r\n redirect(base_url() . 'faq/category_list');\r\n }", "public function delete() {\n\t\t$sql = 'delete from cart_categories where categories_id=\"' . e($this->getId()) . '\"';\n\t\tDatabase::singleton()->query($sql);\n\t\t\n\t\t$sql = 'delete from cart_categories_description where categories_id=\"' . e($this->getId()) . '\"';\n\t\tDatabase::singleton()->query($sql);\n\t\t\n\t\t$cats = $this->getSubCategories();\n\t\tforeach ($cats as $cat) {\n\t\t\t$cat->delete();\n\t\t}\n\t}", "function remove_utility_bill_category($utility_bill_category_id = '')\n\t{\n\t\t$this->db->where('utility_bill_category_id', $utility_bill_category_id);\n\t\t$this->db->delete('utility_bill_category');\n\n\t\t$this->session->set_flashdata('success', 'Utility bill category has been deleted successfully.');\n\n\t\tredirect(base_url() . 'utility_bill_categories', 'refresh');\n\t}" ]
[ "0.69728845", "0.69309986", "0.68059367", "0.65877753", "0.6557906", "0.6525597", "0.6450585", "0.64371765", "0.6426727", "0.64032364", "0.6383666", "0.633878", "0.6333474", "0.6313338", "0.6311642", "0.6310584", "0.63052934", "0.6280416", "0.62617826", "0.6255811", "0.6216993", "0.6195242", "0.61556023", "0.61548173", "0.6153808", "0.6134707", "0.6121158", "0.6118323", "0.6112253", "0.6103092" ]
0.70054156
0
TODO: Implement getMsgStatusByMSGID() method.
public function getMsgStatusByMSGID($msgid) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStatus($message_id);", "public function status(string $msgId)\n {\n $options = [\n 'msg_id' => $msgId,\n ];\n var_dump($options);\n var_dump(\"2222\");\n return $this->httpPostJson('cgi-bin/message/mass/get', $options);\n }", "public function getMessageStatus()\n {\n return $this->messageStatus;\n }", "public function Status_ID($msgid) {\n\t$msgid=mysqli_real_escape_string($this->db,$msgid);\n\t$query=mysqli_query($this->db,\"SELECT msg_id FROM messages M, users U WHERE M.uid_fk=U.uid and M.msg_id='$msgid' AND U.status='1'\");\n\tif(mysqli_num_rows($query)>0) {\n\t $row=mysqli_fetch_array($query,MYSQLI_ASSOC);\n\t return $row['msg_id'];\n\t} else {\n\t return false;\n\t}\n}", "public function getStatusMessage();", "function messageStatus($ids)\n {\n\n if (!is_array($ids)) {\n $ids = array($ids);\n }\n\n $ids = implode(',', $ids);\n\n $url = sprintf('cmd=message_status&ids=%s',\n urlencode($ids));\n\n $response = $this->_callURL($url);\n\n if (is_a($response, 'PEAR_Error')) {\n return PEAR::raiseError(sprintf(_(\"Send failed.\")));\n }\n\n $result = array();\n\n if (!array_key_exists('error_code', $response)) {\n\n if (count(explode(',', $ids)) == 1) {\n\n $result[$ids] = array(\n 0 => 1,\n 1 => $response[$ids]\n );\n } else {\n foreach ($response as $id => $message) {\n $result[$id] = array(1, $message);\n }\n }\n } else {\n\n if (count(explode(',', $ids)) == 1) {\n\n $result[$to] = array(\n 0 => 0,\n 1 => $response['error_message']\n );\n } else {\n foreach (explode(',', $ids) as $id) {\n $result[$id] = array(0, $response['error_message']);\n }\n }\n }\n\n return $result;\n }", "function getMessage($msg_id) {\n\t\tif (!$msg_id) {\n\t\t\treturn false;\n\t\t}\n\t\treturn db_query_params ('SELECT * FROM artifact_message_user_vw WHERE id=$1',\n\t\t\tarray($msg_id));\n\t}", "public function getStatusMessage()\r\n\t{\r\n\t\treturn $this->m_message;\r\n\t}", "public function getStatusCodeMsg(): string\r\n {\r\n return $this->_statusCodeMsg;\r\n }", "function getStatusMessage() \r\n\t{\r\n\t\treturn $this->replyString;\r\n\t}", "function Stats($msg=\"\"){\n if($this->state!=\"TRANSACTION\")\n $this->AddError(\"connection is not in TRANSACTION state\");\n\t if (!isset($result)) $result='';\n if ($msg == \"\") :\n $this->POP3Command(\"STAT\", $result);\n else :\n $this->POP3Command(\"LIST $msg\", $result);\n endif;\n $p = explode(\" \", $result);\n $stat[\"message\"] = $p[1];\n $stat[\"size\"] = $p[2];\n return $stat;\n }", "public function get_msgnum()\n {\t\t\n return $this->msgnum;\n }", "abstract public function getFullMessage($msgNo);", "private function getMsg($code){\n\t\t\t$msg = $this->msgcode[$code]['message'];\n\t\t\t$status = $this->msgcode[$code]['status'];\n\t\t\tif ($msg && $status !== NULL) return array($msg, $status);\n\t\t\telse return array($this->msgcode['000']['message'], $this->msgcode['000']['status']);\n\t\t}", "public function getStatus() {\n\t\t$status = $this->status;\n\t\tif(!empty($this->messages)) {\n\t\t\tforeach($this->messages as $idx => $message) {\n\t\t\t\tif($message->getStatus() > $status) {\n\t\t\t\t\t$status = $message->getStatus();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $status;\n\t}", "public function doUpdateMessageStatus($id)\n {\n $status = Message::updateMessageStatus($id);\n\n return ucfirst($status);\n }", "public function readableStatus()\n {\n $status = $this->status;\n $match = [\n\n 'message_ok' => \"En attente d'envoi\",\n 'message_issues' => \"Le message contient des erreurs\",\n 'sent' => \"Le message a été envoyé\",\n 'sending' => \"En cours d'envoi…\"\n ];\n\n return isset($match[$status]) ? $match[$status] : $status;\n }", "public function getStatus($markStatusesRead = true, $maxNumberOfStatuses = 100, $messageIds = null)\n {\n $request = array(\n 'GetMessageStatusRequest' => array(\n 'markStatusesRead' => $markStatusesRead,\n 'maxNumberOfStatuses' => $maxNumberOfStatuses\n )\n ); \n \n if ($messageIds) {\n $messageIds = is_array($messageIds) ? $messageIds : array($messageIds);\n foreach ($messageIds as $messageId) {\n $request['GetMessageStatusRequest']['messageIds']['messageId'][] = $messageId;\n }\n }\n\n try { \n $soap_client = $this->getSoapClient();\n $response = $soap_client->__soapCall('GetMessageStatus', $request);\n\n } catch (SoapFault $sf) {\n\n throw new ClientException($this->soapFaultToString($sf)); \n \n } catch (InteleonSoapClientException $e) {\n\n throw new ClientException($e->getMessage()); \n }\n\n $result = array();\n\n if (isset($response->messageStatus) === false) {\n return $result;\n }\n\n foreach ($response->messageStatus as $messageStatus) {\n $result[] = array(\n 'statusCode' => $messageStatus->statusCode,\n 'statusText' => $messageStatus->statusText,\n 'id' => $messageStatus->id,\n 'sender' => $messageStatus->sender,\n 'recipient' => $messageStatus->recipient,\n 'time' => $messageStatus->time,\n 'billingStatus' => $messageStatus->billingStatus,\n 'NumberOfMessages' => $messageStatus->attributes->attribute[0]->value->integer,\n 'NumberOfCharacters' => $messageStatus->attributes->attribute[1]->value->integer\n );\n }\n\n return $result;\n }", "function check_message_status($messageId){\n global $platform;\n try {\n $endpoint = \"/restapi/v1.0/account/~/extension/~/message-store/\".$messageId;\n $resp = $platform->get($endpoint);\n $jsonObj = $resp->json();\n print(\"Message status: \" . $jsonObj->messageStatus . PHP_EOL);\n if ($jsonObj->messageStatus == \"Queued\"){\n sleep(2);\n check_message_status($jsonObj->id);\n }\n } catch (\\RingCentral\\SDK\\Http\\ApiException $e) {\n exit(\"Error message: \" . $e->message . PHP_EOL);\n }\n}", "function ppmess_change_commun_status($message_id, $post_id, $logged_user){\n\t\n\tglobal $wpdb;\n\t\n\t$status = 0; // when sent_to = 0 message is read, if sent_to != 0 message is not read\n\t\n\treturn $wpdb->query(\n\t\t$wpdb->prepare(\"UPDATE {$wpdb->prefix}private_messages SET sent_to = %d WHERE (post_id = %d AND message_id = %d AND message_parent = 0 AND sent_to = %d) \n\t\t\tOR (post_id = %d AND message_parent = %d AND receiver_id = %d) \", $status, $post_id, $message_id, $logged_user, $post_id, $message_id, $logged_user )\n\t);\n}", "public function getStatusMessage()\n {\n return $this->status_message;\n }", "private function getStatusMessage(){\n\t\t$status = array(\n\t\t\t\t100 => 'Continue', \n\t\t\t\t101 => 'Switching Protocols', \n\t\t\t\t200 => 'OK',\n\t\t\t\t201 => 'Created', \n\t\t\t\t202 => 'Accepted', \n\t\t\t\t203 => 'Non-Authoritative Information', \n\t\t\t\t204 => 'No Content', \n\t\t\t\t205 => 'Reset Content', \n\t\t\t\t206 => 'Partial Content', \n\t\t\t\t300 => 'Multiple Choices', \n\t\t\t\t301 => 'Moved Permanently', \n\t\t\t\t302 => 'Found', \n\t\t\t\t303 => 'See Other', \n\t\t\t\t304 => 'Not Modified', \n\t\t\t\t305 => 'Use Proxy', \n\t\t\t\t306 => '(Unused)', \n\t\t\t\t307 => 'Temporary Redirect', \n\t\t\t\t400 => 'Bad Request', \n\t\t\t\t401 => 'Unauthorized', \n\t\t\t\t402 => 'Payment Required', \n\t\t\t\t403 => 'Forbidden', \n\t\t\t\t404 => 'Not Found', \n\t\t\t\t405 => 'Method Not Allowed', \n\t\t\t\t406 => 'Not Acceptable', \n\t\t\t\t407 => 'Proxy Authentication Required', \n\t\t\t\t408 => 'Request Timeout', \n\t\t\t\t409 => 'Conflict', \n\t\t\t\t410 => 'Gone', \n\t\t\t\t411 => 'Length Required', \n\t\t\t\t412 => 'Precondition Failed', \n\t\t\t\t413 => 'Request Entity Too Large', \n\t\t\t\t414 => 'Request-URI Too Long', \n\t\t\t\t415 => 'Unsupported Media Type', \n\t\t\t\t416 => 'Requested Range Not Satisfiable', \n\t\t\t\t417 => 'Expectation Failed', \n\t\t\t\t500 => 'Internal Server Error', \n\t\t\t\t501 => 'Not Implemented', \n\t\t\t\t502 => 'Bad Gateway', \n\t\t\t\t503 => 'Service Unavailable', \n\t\t\t\t504 => 'Gateway Timeout', \n\t\t\t\t505 => 'HTTP Version Not Supported');\n\t\treturn ($status[$this->_code]) ? $status[$this->_code] : $status[500];\n\t}", "public function get_status_message() {\n\n\t\treturn $this->get_status_info()->message;\n\t}", "public function getStatusMessage()\n {\n return $this->statusMessage;\n }", "public function status( &$numMessages, &$sizeMessages )\r\n {\r\n if ( $this->state != self::STATE_TRANSACTION )\r\n {\r\n throw new ezcMailTransportException( \"Can't call status() on the POP3 transport when not successfully logged in.\" );\r\n }\r\n\r\n $this->connection->sendData( \"STAT\" );\r\n $response = $this->connection->getLine();\r\n if ( $this->isPositiveResponse( $response ) )\r\n {\r\n // get the single response line from the server\r\n list( $dummy, $numMessages, $sizeMessages ) = explode( ' ', $response );\r\n $numMessages = (int)$numMessages;\r\n $sizeMessages = (int)$sizeMessages;\r\n }\r\n else\r\n {\r\n throw new ezcMailTransportException( \"The POP3 server did not respond with a status message: {$response}.\" );\r\n }\r\n }", "private function getMsg()\n {\n return $this->msg;\n }", "public static function getReceivedStatus(){\n\t\treturn self::getStatus( 'received' );\n\t}", "function _getStatusMessage(){\n $status = array(\n 200 => 'Ok' ,\n 201 => 'Created' ,\n 202 => 'deleted' ,\n 204 => 'No Content' ,\n 400 => 'Bad Request',\n 404 => 'Not Found' ,\n 405 => 'Not Allowed' ,\n 406 => 'Not Acceptable',\n\n );\n return ($status[$this->CodeHTTP] ? $status[$this->CodeHTTP] : $status[500]);\n }", "public function getMessage($id) {\n\t\tif (!array_key_exists($id, $this -> messages)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this -> messages[$id];\n\t}", "public function getMessage() {\n return $this->getStatus();\n }" ]
[ "0.7625756", "0.70659006", "0.6991421", "0.681895", "0.673134", "0.639874", "0.6263489", "0.62102044", "0.607951", "0.6073092", "0.6046357", "0.6016508", "0.6011807", "0.60105884", "0.6003367", "0.59765834", "0.59706825", "0.5963977", "0.5945867", "0.59445965", "0.59393036", "0.59222883", "0.5877346", "0.5833522", "0.5816147", "0.5767163", "0.5755507", "0.5730118", "0.5719084", "0.570718" ]
0.8129333
0
Loads collection from database matching $condition.
public function findMany(array $condition) { $selection = $this->getTable()->where($condition); $collectionClassName = $this->getInstanceCollectionClassName(); return $collectionClassName::create($this, $selection); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find($condition)\n {\n if(!is_array($condition))\n {\n $condition = array($this->getKeyField() => $condition);\n }\n $model = $this->getStorage()->fetchRow($condition);\n if(!$model->isLoaded())\n {\n return null;\n }\n return $model;\n }", "public static function findOne($condition)\n {\n $object = Server::$container->make(get_called_class(), [get_called_class()]);\n $conn = self::getMongoReadConn($object);\n $collection = $conn->selectCollection($object->getDBName(), $object->getCollectionName());\n if (isset($condition[\"_id\"])) {\n if (!is_object($condition[\"_id\"])) {\n $condition[\"_id\"] = new ObjectID($condition[\"_id\"]);\n }\n }\n // var_dump($conn);\n $res = $collection->findOne($condition);\n // var_dump($res);\n return $object;\n }", "public function load (mixed $tableOrClass, mixed $condition) : mixed {\n\n }", "public static function findOne($condition);", "public function loadCollection($collectionId, int $status): Collection;", "public function get_available_category($collection = '', $condition = array()) {\n\t\t\n\t\tif(!is_array($condition)){\n\t\t\t$condition = (array)$condition;\n\t\t\t$condition = array_unique(array_filter($condition));\n\t\t}\n\t\t\n $data = array();\n $k = 0;\n foreach ($condition as $key => $value) {\n $data[$k] = MongoID($value);\n $k++;\n }\n $this->mongo_db->select(array('name', 'image', 'vehicle_type', 'icon_normal', 'icon_active','icon_car_image','name_languages'));\n $this->mongo_db->where_in('_id', $data);\n\t\t$this->mongo_db->where(array('status' => 'Active'));\n $res = $this->mongo_db->get($collection);\n return $res;\n }", "abstract protected function loadModel(array $conditions);", "public function fetchCollection($criteria = null);", "public function load($collection = null);", "public function fetch($conditions = array(),$options=array()) {\n\t\tif(is_numeric($conditions)) { $conditions = array('id' => $conditions); }\n\t\t$conditions = $this->prepare($conditions);\n\t\treturn $this->load($conditions,$options);\n\t}", "public function loadCollectionQuery(Collection $collection): Query;", "public function findByConditions(array $condition)\n {\n return self::findOne($condition);\n }", "public function getBywhere($condition)\n {\n return $this->productRepository->getBywhere($condition);\n }", "function load($conditions = null) {\n\t\t\treturn $this->reload($conditions);\n\t\t}", "public function findWhere($condition)\n {\n $this->where($condition)->first();\n\n return $this;\n }", "public function _load()\n {\n $query = new Query(\n \"SELECT *\n FROM `\" . Leder::TABLE . \"`\n WHERE `arrangement_fra` = '#fra'\n AND `arrangement_til` = '#til'\",\n [\n 'fra' => $this->getArrangementFraId(),\n 'til' => $this->getArrangementTilId()\n ]\n );\n\n $res = $query->getResults();\n while( $row = Query::fetch($res) ) {\n $this->add(\n Leder::loadFromDatabaseRow( $row )\n );\n }\n }", "public function loadArrayList($whereCondition = \"\", $order = \"\", $limit = \"\", $groupBy=\"\") {\r\n if ($this->object->loadRule()) {\r\n if (empty($whereCondition)) {\r\n $whereCondition .= $this->getConditions();\r\n }\r\n\r\n if (empty($order)) {\r\n $order = $this->getOrders();\r\n }\r\n\r\n if (empty($limit)) {\r\n $limit = $this->getLimits();\r\n }\r\n\r\n if (empty($groupBy)) {\r\n $groupBy = $this->groupBy;\r\n }\r\n\r\n\r\n $crud = $this->myCRUD();\r\n return $crud->loadLightArray($whereCondition, $order, $limit, false, $this->__loadObjectsAttributes, false, $groupBy);\r\n } else {\r\n return false;\r\n }\r\n }", "function _load()\n\t{\n\t\tif($this->primary_key)\n\t\t{\n\t\t\t$row = $this->db->get_where($this->table_name, array(\n\t\t\t\t$this->primary_key => $this->{$this->primary_key},\n\t\t\t))->result();\n\t\t\t\n\t\t\tif(count($row))\n\t\t\t\t$this->load_db_values($row[0]);\n\t\t}\n\t}", "private function loadMatchedCollection()\n {\n $this->matchedCollection = collect();\n\n foreach ($this->baseCollection as $key => $item)\n {\n\n $found = true;\n foreach ($this->associativePivots as $basePivot => $mergePivot)\n {\n if(!$this->mergeCollection->whereIn($mergePivot,$item->$basePivot)->first())\n {\n $found = false;\n continue 2;\n }\n }\n\n if($found){\n $this->matchedCollection->push($item);\n }\n\n }\n }", "public function __doLoad()\n {\n $strSQL = $this->getSelectSql();\n $_SESSION[\"logger\"]->info(\"__doLoad: \" . $strSQL);\n\n $result = $this->query($strSQL);\n $_SESSION[\"logger\"]->info(\"Results: \" . $this->rowCount($result));\n if ($result && $this->rowCount($result) > 0) {\n $this->exists = true;\n $this->dxHashToClass($this->torecord($result));\n } else {\n $this->exists = false;\n }\n }", "public function __construct(Enumerable $collection, $condition)\n {\n $this->condition = $condition;\n $this->collection = $collection;\n }", "public function getByCondition($condition, $limit = 10)\n {\n $condition = article_condition($condition);\n\n if (! $condition) throw new NonExistentConditionException;\n\n return $this->articlesRepo->byCondition($condition['id'], $limit);\n }", "public static function findOne($condition)\n {\n return static::find()->one($condition);\n }", "public static function findOne($condition) {\n $table = static::$table;\n $one = Base::getInstance()->query(\"SELECT * FROM {$table} WHERE {$condition} LIMIT 1\");\n if ($one !== false) {\n return $one->fetchObject();\n } \n return false;\n }", "public function findWhere($condition){\n // create an empty array\n $arrayOfActiveRows = [];\n // select all data from the specified condition\n $dataArray = $this->database->selectStarFromWhere($this->name, $condition);\n // foreach data found in this array, we creat active row and store in variable $activeRow and \n // we push into this \n foreach ($dataArray as $data) {\n $activeRow = $this->CreateActiveRowFrom($data);\n array_push($arrayOfActiveRows, $activeRow);\n }\n return $arrayOfActiveRows;\n }", "private function load() {\n\n $db = Database::getInstance(); \n\t $con = $db->getConnection();\n \n $query = \"SELECT * FROM Products ORDER by ID DESC\";\n \n if ($result = $con->query($query)) {\n \t/* fetch object array */\n \t while ($prod = $result->fetch_object(\"Product\")) {\n\t\t\t \tarray_push($this->products, $prod);\n \t}\n \t/* free result set */\n \t$result->close();\n }\n\t}", "private function load() {\r\n\t\t$sql_statement = 'SELECT no.contract_id, no.termination_date FROM '. TBL_NOTICE .' AS no WHERE no.notice_id = '. (int) $this->notice_id;\r\n\t\t$query = db_query($sql_statement);\r\n\r\n\t\tif(db_num_results($query) == 1) {\r\n\t\t\t$data = db_fetch_array($query);\r\n\t\t\t\t\r\n\t\t\t$this->contract_id = $data['contract_id'];\r\n\t\t\t$this->termination_date = $data['termination_date'];\r\n\t\t}\r\n\t}", "protected function _loadOne($criteria = null, $query_part = null) {\n $this->_is_first_save = false;\n $q = Q::create($this->_structure['table'])->one();\n if ($criteria) {\n\n if (!is_array($criteria) && !is_object($criteria)) {\n $criteria = array( $this->getStructure('table') . '.' . $this->_structure->getPrimaryField() => $criteria);\n } elseif (is_array($criteria)) {\n $new_criteria = array();\n foreach($criteria as $c_key=>$c_value) {\n $new_criteria[ $this->getStructure('table') . '.' . $c_key] = $c_value;\n }\n unset($criteria);\n $criteria = $new_criteria;\n unset($new_criteria);\n }\n\n $q->andWhere($criteria);\n $this->_load_criteria = $criteria;\n } else {\n $criteria = new C();\n }\n\n if ($this->getAbilitiesStructure('mlt')) {\n $query_part = $this->_loaded_abilities['Mlt']->updateLoadQueryPart($query_part);\n }\n\n if ($query_part) {\n $q->merge($query_part);\n }\n /**\n * Security check\n */\n $secured = $this->getMethodSecurity('load');\n if ($secured) {\n $secured['full_access'] = false;\n try {\n slACL::requireRight(strtolower($this->_model_name) . '_load');\n $secured['full_access'] = true;\n } catch (slACLUnaccreditedException $e) {\n throw new $e($e->getMessage());\n }\n }\n if (($data = $q->exec())) {\n $this->setOriginalData($data);\n if ($secured && !$secured['full_access']) {\n if ($secured['process'] == 'custom') {\n $method = isset($secured['method']) ? $secured['method'] : 'hasSecuredMethodAccess';\n if (!$this->$method('load')) {\n throw new slACLUnaccreditedException(strtolower($this->_model_name) . '_load');\n } else {\n slACL::requireObjectRight($this->_model_name, $this->getID(), 'load');\n }\n }\n }\n $this->_postLoad();\n return $this;\n } else {\n return null;\n }\n\n\n }", "public function from($collection)\n {\n return $this->connection->getCollection($collection);\n }", "public function Select($Condition)\r\n {\r\n global $db;\r\n \r\n if ($Condition == \"\") {\r\n $Sql = \"SELECT * FROM \".$this->TableName;\r\n }\r\n else {\r\n $Sql = \"SELECT * FROM \".$this->TableName.\" \".$Condition;\r\n }\r\n \r\n try{\r\n $query = $db->prepare($Sql);\r\n $query->execute();\r\n if($query->rowCount()>0){\r\n $result['err'] = false;\r\n $result['rows'] = $query->fetchAll(PDO::FETCH_ASSOC);\r\n } else {\r\n $result['err'] = true;\r\n $result['msg'] = \"No Records Available\";\r\n }\r\n }catch(PDOException $e){\r\n $result['err'] = true;\r\n $result['msg'] = $e->getMessage();\r\n }\r\n\r\n return $result;\r\n }" ]
[ "0.57210517", "0.56922704", "0.5691084", "0.56790066", "0.55747086", "0.55327123", "0.5511437", "0.5477265", "0.5448327", "0.54200876", "0.5348354", "0.5317316", "0.53077555", "0.52874106", "0.5286501", "0.528025", "0.5269855", "0.5205735", "0.5188458", "0.51633877", "0.51414776", "0.51381606", "0.50963753", "0.5073881", "0.503471", "0.50308126", "0.5021904", "0.49940053", "0.49639726", "0.49624738" ]
0.5729831
0
Initialize SmashPig context and return configuration object
public static function setSmashPigProvider( $provider ) { $ctx = Context::get(); $spConfig = ProviderConfiguration::createForProvider( $provider, $ctx->getGlobalConfiguration() ); // FIXME: should set a logger prefix here, but we've got a chicken // and egg problem with the Gateway constructor $ctx->setProviderConfiguration( $spConfig ); return $spConfig; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function configure();", "abstract public function configure();", "public function configure() {}", "public function configure() {}", "protected function initializeConfiguration() {}", "function __construct() {\n //invoke the init method of the config object in context\n $this->init();\n }", "abstract protected function configure();", "abstract protected function configure();", "public static function config();", "public function init ()\n\t{\n\t\t$objApplicationOptions = new Zend_Config($this->getInvokeArg('bootstrap')->getOptions());\n\t\t$this->_options = $objApplicationOptions->catalog;\n\t}", "public function configure() {\r\n\t\r\n\t}", "public function __construct()\n {\n $this->params['config'] = config('app');\n }", "public function __construct()\n {\n require_once(dirname(__FILE__).'/../../../behat4eve2Plugin/vendor/autoload.php');\n require_once(dirname(__FILE__).'/../../../../config/ProjectConfiguration.class.php');\n\n $configuration = ProjectConfiguration::getApplicationConfiguration('default', 'dev', true);\n sfContext::createInstance($configuration);\n }", "function __construct() {\n $this->conf = new Conf();\n }", "public function it_can_be_configured()\n {\n $this->beConstructedWith(self::CONFIG_BASIC);\n $this->getWrappedObject();\n }", "function __construct()\r\n\t{\r\n\t\trequire './configs/configs.php';\r\n\t}", "private function initConfig()\n {\n return $this->config = [\n 'api' => 'https://api.gfycat.com/v1',\n ];\n }", "public function configure() {\n\t\t}", "protected function addSPLConfigs()\n {\n\n $this['queue'] = $this->factory(\n function () {\n return new \\SplQueue();\n }\n );\n\n $this['objectStorage'] = $this->factory(\n function () {\n return new \\SplObjectStorage();\n }\n );\n\n }", "public function init() {\n //TODO override and put config intialization code here\n }", "public function init($config);", "public function configure()\n {\n $this->container = require __DIR__ . '/../../config/configure-services.php';\n $this->scratchSpace = vfsStream::setup('scratch')->url();\n }", "protected function _initPhpConfig()\n {\n }", "function initialize()\n {\n if (isset($this->key)) {\n $key = common_config('contextio', 'key');\n if (empty($key)) {\n Config::save(\n 'contextio',\n 'key',\n $this->key\n );\n }\n }\n\n if (isset($this->secret)) {\n $secret = common_config('contextio', 'secret');\n if (empty($secret)) {\n Config::save('contextio', 'secret', $this->secret);\n }\n }\n }", "abstract public function init(array $config);", "function __construct() {\n $this->getSystemConfig();\n }", "public function __construct()\n {\n\n // $configuration = $this->get('configuration');\n\n\n }", "public function __construct()\n {\n $this->_config = sspmod_janus_DiContainer::getInstance()->getConfig();\n }", "public function __construct()\n {\n $this->config = include(dirname(__FILE__). '/../config/config.php');\n }", "public function configure()\n {\n }" ]
[ "0.5714789", "0.5712379", "0.5621134", "0.5621134", "0.5573061", "0.5556468", "0.5543287", "0.5543287", "0.5530572", "0.54214585", "0.53707373", "0.53609705", "0.53600633", "0.53128165", "0.5301196", "0.5293151", "0.52765054", "0.5258332", "0.52520496", "0.5249621", "0.52357864", "0.5234303", "0.5221839", "0.5218032", "0.5184425", "0.51646256", "0.5137452", "0.513503", "0.5132518", "0.51219004" ]
0.5848287
0
Add item to TaxBreakdownCode value
public function addToTaxBreakdownCode(\Sabre\UpdateReservation\StructType\TaxBreakdownCode $item) { // validation for constraint: itemType if (!$item instanceof \Sabre\UpdateReservation\StructType\TaxBreakdownCode) { throw new \InvalidArgumentException(sprintf('The TaxBreakdownCode property can only contain items of \Sabre\UpdateReservation\StructType\TaxBreakdownCode, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); } $this->TaxBreakdownCode[] = $item; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addTax() {\n\t\t$adb = PearDatabase::getInstance();\n\n\t\t$tableName = $this->getTableNameFromType();\n\t\t$taxid = $adb->getUniqueID($tableName);\n\t\t$taxLabel = $this->getName();\n\t\t$percentage = $this->get('percentage');\n\n\t\t//if the tax is not available then add this tax.\n\t\t//Add this tax as a column in related table\n\t\tif($this->isShippingTax()) {\n\t\t\t$taxname = \"shtax\".$taxid;\n\t\t\t$query = \"ALTER TABLE vtiger_inventoryshippingrel ADD COLUMN $taxname decimal(7,3) DEFAULT NULL\";\n\t\t} else {\n\t\t\t$taxname = \"tax\".$taxid;\n\t\t\t$query = \"ALTER TABLE vtiger_inventoryproductrel ADD COLUMN $taxname decimal(7,3) DEFAULT NULL\";\n\t\t}\n\t\t$res = $adb->pquery($query, array());\n\n\t\tvimport('~~/include/utils/utils.php');\n\n\t\tif ($this->isProductTax()) {\n\t\t\t// TODO Review: if field addition is required in shipping-tax case too.\n\t\t\t// NOTE: shtax1, shtax2, shtax3 that is added as default should also be taken care.\n\n\t\t\t$inventoryModules = getInventoryModules();\n\t\t\tforeach ($inventoryModules as $moduleName) {\n\t\t\t\t$moduleInstance = Vtiger_Module::getInstance($moduleName);\n\t\t\t\t$blockInstance = Vtiger_Block::getInstance('LBL_ITEM_DETAILS',$moduleInstance);\n\t\t\t\t$field = new Vtiger_Field();\n\n\t\t\t\t$field->name = $taxname;\n\t\t\t\t$field->label = $taxLabel;\n\t\t\t\t$field->column = $taxname;\n\t\t\t\t$field->table = 'vtiger_inventoryproductrel';\n\t\t\t\t$field->uitype = '83';\n\t\t\t\t$field->typeofdata = 'V~O';\n\t\t\t\t$field->readonly = '0';\n\t\t\t\t$field->displaytype = '5';\n\t\t\t\t$field->masseditable = '0';\n\n\t\t\t\t$blockInstance->addField($field);\n\t\t\t}\n\t\t}\n\n\t\t//if the tax is added as a column then we should add this tax in the list of taxes\n\t\tif($res) {\n\t\t\t$deleted = 0;\n\t\t\tif($this->isDeleted()) {\n\t\t\t\t$deleted = 1;\n\t\t\t}\n\n\t\t\t$compoundOn = Zend_Json::encode($this->get('compoundon'));\n\t\t\t$regions = Zend_Json::encode($this->get('regions'));\n\n\t\t\t$query = 'INSERT INTO '.$tableName.' values(?,?,?,?,?,?,?,?,?)';\n\t\t\t$params = array($taxid, $taxname, $taxLabel, $percentage, $deleted, $this->get('method'), $this->get('type'), $compoundOn, $regions);\n\t\t\t$adb->pquery($query, $params);\n\t\t\treturn $taxid;\n\t\t}\n\t\tthrow new Error('Error occurred while adding tax');\n\t}", "public function testDifferentTaxes()\n {\n\n $item = $this->addItem();\n\n $prevHash = $item->getHash();\n\n $item->tax = .05;\n\n $this->assertNotEquals($prevHash, $item->getHash());\n\n $item = $this->addItem();\n $item->tax = .3;\n\n $this->assertEquals('2.35', $this->laracart->total(false));\n\n $item = $this->addItem(1, 1, true, [\n 'tax' => .7\n ]);\n\n $this->assertEquals('.70', $item->tax());\n\n $this->assertEquals('4.05', $this->laracart->total(false));\n }", "public function addTax(AdjustmentDataInterface $tax)\n {\n $this->taxes[] = $tax;\n }", "public static function add_country_code() {\n\n $taxamo = taxedd_get_country_code();\n\n if ( $taxamo && isset( $taxamo->country_code ) ) {\n ?>\n <input class=\"edd-country\" type=\"hidden\" name=\"edd_country\" id=\"edd-country\" value=\"<?php echo $taxamo->country_code; ?>\"/>\n <?php\n }\n }", "public function addTaxRate()\n {\n $this->taxRates[] = [\n 'id' => null,\n 'name' => null,\n 'priority' => count($this->taxRates) + 1,\n 'amounts' => $this->taxClasses->map(function ($taxClass) {\n return [\n 'id' => null,\n 'tax_class_id' => $taxClass->id,\n 'tax_class_name' => $taxClass->name,\n 'percentage' => 0,\n ];\n })->toArray(),\n ];\n }", "public function addVehicleTax() {\n global $REQUEST_DATA;\n\t\t$busId = trim($REQUEST_DATA['busNo']);\n\t\t$regnNoValidTill = trim($REQUEST_DATA['regnNoValidTill']);\n\t\t$passengerTaxValidTill = trim($REQUEST_DATA['passengerTaxValidTill']);\n\t\t$roadTaxValidTill = trim($REQUEST_DATA['roadTaxValidTill']);\n\t\t$pollutionCheckValidTill = trim($REQUEST_DATA['pollutionCheckValidTill']);\n\t\t$passingValidTill = trim($REQUEST_DATA['passingValidTill']);\n\n\n\t\t$query = \"\tINSERT INTO bus_entries (busId,busNoValidTill,passengerTaxValidTill,roadTaxValidTill,pollutionCheckValidTill,passingValidTill) \n\t\t\t\t\tVALUES ('$busId','$regnNoValidTill','$passengerTaxValidTill','$roadTaxValidTill','$pollutionCheckValidTill','$passingValidTill')\";\n \n\t\treturn SystemDatabaseManager::getInstance()->executeUpdateInTransaction($query,\"Query: $query\");\n }", "public function addTax(){\n $data['title'] = \"Add Tax\";\n $this->admin_load('taxes/add_tax',$data); \n }", "function wp_ajax_inline_save_tax()\n {\n }", "public function setTax(string $value): void\n {\n if (is_null($value)) {\n return;\n }\n\n if ($value == 0) {\n $value = 'TAX_0';\n } else {\n $value = number_format($value, 2);\n\n // not sure why has two underscores?\n if ($value < 1) {\n $value = 'TAX__' . str_replace('0.', '', $value);\n } else {\n $value = 'TAX_' . str_replace('.', '_', $value);\n }\n }\n\n $this->elements['tax-class-id'] = $value;\n }", "public function formattedTax(): string;", "public function addToTax(\\Sabre\\UpdateReservation\\StructType\\AncillaryTax $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\Sabre\\UpdateReservation\\StructType\\AncillaryTax) {\n throw new \\InvalidArgumentException(sprintf('The Tax property can only contain items of \\Sabre\\UpdateReservation\\StructType\\AncillaryTax, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->Tax[] = $item;\n return $this;\n }", "function tep_add_tax($price, $tax, $override = false) {\n if ( ( (DISPLAY_PRICE_WITH_TAX == 'true') || ($override == true) ) && ($tax > 0) ) {\n return $price + tep_calculate_tax($price, $tax);\n } else {\n return $price;\n }\n }", "function tep_add_tax($price, $tax) {\n global $currencies;\n\n if (DISPLAY_PRICE_WITH_TAX == 'true') {\n return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) + tep_calculate_tax($price, $tax);\n } else {\n return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);\n }\n}", "abstract public function getTaxType();", "function tep_add_tax($price, $tax) {\n global $currencies, $sppc_customer_group_show_tax;\n\n if ( (DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0) && $sppc_customer_group_show_tax == '1') {\n return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) + tep_calculate_tax($price, $tax);\n } else {\n return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);\n }\n }", "private function registerTax() {\n $labels = array(\n 'name' => esc_html__('Masonry Gallery Categories', 'eltdf-core'),\n 'singular_name' => esc_html__('Masonry Gallery Category', 'eltdf-core'),\n 'search_items' => esc_html__('Search Masonry Gallery Categories', 'eltdf-core'),\n 'all_items' => esc_html__('All Masonry Gallery Categories', 'eltdf-core'),\n 'parent_item' => esc_html__('Parent Masonry Gallery Category', 'eltdf-core'),\n 'parent_item_colon' => esc_html__('Parent Masonry Gallery Category:', 'eltdf-core'),\n 'edit_item' => esc_html__('Edit Masonry Gallery Category', 'eltdf-core'),\n 'update_item' => esc_html__('Update Masonry Gallery Category', 'eltdf-core'),\n 'add_new_item' => esc_html__('Add New Masonry Gallery Category', 'eltdf-core'),\n 'new_item_name' => esc_html__('New Masonry Gallery Category Name', 'eltdf-core'),\n 'menu_name' => esc_html__('Masonry Gallery Categories', 'eltdf-core'),\n );\n\n register_taxonomy($this->taxBase, array($this->base), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'query_var' => true,\n 'show_admin_column' => true,\n 'rewrite' => array( 'slug' => 'masonry-gallery-category' ),\n ));\n }", "public function createTax($data) \n {\n return $this->insert($this->table,$data);\n }", "function gcd_tax_add_new_meta_field() {\r\n ?>\r\n <div class=\"form-field\">\r\n <label for=\"term_meta[featured]\"><?php _e( 'Featured ?', '' ); ?></label>\r\n <input type=\"text\" name=\"term_meta[featured]\" id=\"term_meta[featured]\" value=\"\">\r\n <p class=\"description\"><?php _e( 'Type 1 if you want to list category as featured','' ); ?></p>\r\n </div>\r\n\r\n <div class=\"form-field\">\r\n <label for=\"term_meta[subtitle]\"><?php _e( 'Subtitle', '' ); ?></label>\r\n <input type=\"text\" name=\"term_meta[subtitle]\" id=\"term_meta[subtitle]\" value=\"\">\r\n <p class=\"description\"><?php _e( 'Subtitle for your group','' ); ?></p>\r\n <div>\r\n<?php\r\n}", "private function act_badd($raw) {\n\t\treturn \"<a class='budg-add' href='/budget/add/show:{$raw['showid']}/'>Add Budget Item</a>\";\n\t}", "public function addNutritionalBenefit(){\n \t$id = $this->formValueForKey(\"nutritionalBenefitSelection\");\n \n \t$foundNutritionalBenefit = BLGenericRecord::recordMatchingKeyAndValue(\"NutritionalBenefit\", \"id\", $id);\n \t$this->currentRecipe()->addNutritionalBenefit($foundNutritionalBenefit);\n }", "public function addToFareBasisCode($item)\n {\n // validation for constraint: itemType\n if (!is_string($item)) {\n throw new \\InvalidArgumentException(sprintf('The FareBasisCode property can only contain items of string, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->FareBasisCode[] = $item;\n return $this;\n }", "public function getTaxAmount();", "public function addToAllowed_for_Tax_Deduction_Data(\\WorkdayWsdl\\\\StructType\\Allowed_for_Tax_Deduction_DataType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Allowed_for_Tax_Deduction_DataType) {\n throw new \\InvalidArgumentException(sprintf('The Allowed_for_Tax_Deduction_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Allowed_for_Tax_Deduction_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Allowed_for_Tax_Deduction_Data[] = $item;\n return $this;\n }", "public function add($_item)\n\t{\n\t\treturn BingTypeSearchOption::valueIsValid($_item)?parent::add($_item):false;\n\t}", "function wpcp_add_custom_data_to_order($item, $cart_item_key, $values, $order)\n{\n foreach ($item as $cart_item_key => $values) {\n if (isset($values['wpcp_location'])) {\n $item->add_meta_data(__('wpcp_location', 'wpcp'), $values['wpcp_location'], true);\n }\n }\n}", "function addTaxRates ( ) {\r\n\r\n\t\t$taxratekeys = $this->cart->lookupProductTaxRates( true );\r\n\r\n\t\t$this->glmsg .= '<tax-tables>'\r\n\t\t \t . '<default-tax-table>'\r\n \t\t . '<tax-rules>'\r\n \t\t . '<default-tax-rule>'\r\n \t\t . '<rate>0</rate>'\r\n \t\t . '<tax-area><world-area/></tax-area>'\r\n \t\t . '</default-tax-rule>'\r\n \t\t . '</tax-rules>'\r\n \t\t . '</default-tax-table>'\r\n\t\t\t\t\t . '<alternate-tax-tables>';\r\n\r\n\t\tif( is_array( $taxratekeys ) ) {\r\n\t\t\tforeach( $taxratekeys as $key ) {\r\n\t\t\t\t$this->glmsg .= '<alternate-tax-table standalone=\"true\" name=\"' . htmlspecialchars( $key, ENT_NOQUOTES) . '\">'\r\n\t\t\t\t\t\t\t . '<alternate-tax-rules>'\r\n\t\t\t\t\t\t\t . \t'<alternate-tax-rule>'\r\n\t\t\t\t\t\t\t . \t\t'<rate>' . strval( $this->cart->lookupTaxPerc( $key ) ) . '</rate>'\r\n\t\t\t\t\t\t\t . \t\t'<tax-area><world-area/></tax-area>'\r\n\t\t\t\t\t\t\t . \t'</alternate-tax-rule>'\r\n\t\t\t\t\t\t\t . '</alternate-tax-rules>'\r\n\t\t\t\t\t\t\t . '</alternate-tax-table>';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif( $this->cart->getShippingHandlingTotal() != 0 ) {\r\n\t\t\t$this->glmsg .= '<alternate-tax-table standalone=\"true\" name=\"shipping\">'\r\n\t\t\t\t\t\t . '<alternate-tax-rules>'\r\n\t\t\t\t\t\t . \t'<alternate-tax-rule>'\r\n\t\t\t\t\t\t . \t\t'<rate>' . $this->cart->lookupTaxPercSpecial( 'Shipping' ) . '</rate>'\r\n\t\t\t\t\t\t . \t\t'<tax-area><world-area/></tax-area>'\r\n\t\t\t\t\t\t . \t'</alternate-tax-rule>'\r\n\t\t\t\t\t\t . '</alternate-tax-rules>'\r\n\t\t\t\t\t\t . '</alternate-tax-table>';\r\n\t\t}\r\n\r\n\r\n\t\t$this->glmsg .= '</alternate-tax-tables>'\r\n\t\t\t\t\t . '</tax-tables>';\r\n\t}", "public function getTaxInvoiced();", "function NewTaxAmount($amount ,$tax=0.06)\n{\n $amount += $amount * $tax;\n echo \"Total amount: $amount\";\n}", "public function getFormattedTaxAttribute(): string;", "public function getTaxRefunded();" ]
[ "0.6022677", "0.5650368", "0.561249", "0.5508849", "0.5507532", "0.5432416", "0.540472", "0.5397493", "0.5362307", "0.5269257", "0.5217888", "0.52035296", "0.51972234", "0.51873654", "0.51750666", "0.51657856", "0.51474166", "0.51095754", "0.5083389", "0.50705147", "0.50632066", "0.50562495", "0.5038773", "0.50335467", "0.5015033", "0.5010325", "0.5002657", "0.49713093", "0.49702716", "0.49641207" ]
0.67118555
0
Return a Card response
public function card(CardInterface $card) { return $this->respond(self::RESPONSE_TYPE_CARD, $card->toArray()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCard() {\n return $this->card;\n }", "function card_get(){\n\t\tif ($this->get('idspbu') == NULL){\n\t\t\t$this->response(array( 'status' => \"ID SPBU not found\" ), 408);\n\t\t} else {\n\t\t\t$param['id_spbu'] = $this->get('idspbu');\n\t\t\t$param['id_pelanggan'] = $this->get('idpelanggan');\n\t\t\t$param['id_card'] = $this->get('idcard');\n\t\t\t$param['nik'] = $this->get('nik');\n\t\t\t\n\t\t\t$response = $this->rest_model->getCard($this->get('idspbu'), $param);\n\t\t\tif(!empty($response)){\n\t\t\t\t$this->response($response, 200);\n\t\t\t} else {\n\t\t\t\t$this->response(array( 'status' => \"NULL\" ), 406);\n\t\t\t}\n\t\t}\n\t}", "public function getCard()\n {\n return $this->card;\n }", "public function getAllCard(){\n $cards = Card::all();\n\n return response()->json([\n 'response_code' => 200,\n 'status' => 'success',\n 'message' => \"berhasil mendapatkan semua card\",\n 'error' => (Object)[],\n 'cards' => $cards\n ],200);\n }", "public function get_card(){ return $this->_card;}", "public function card();", "public function getCardData()\n {\n $cardData = $this->dashboardHelper->getFormattedCardData(request()->all());\n\n return response()->json($cardData);\n }", "public function card()\n {\n if ( ! $this->bean->card) $this->bean->card = R::dispense('card');\n return $this->bean->card;\n }", "public function askForCard()\n {\n }", "public function getCard()\n {\n return $this->vaultHelper->getQuoteCard($this->getSubscription()->getQuote());\n }", "public function getCard(): ?string\n {\n return $this->card;\n }", "protected function returnCard()\n {\n $request = $this->request();\n\n $player = $this->getCurrentPlayer();\n\n $this->result()->setCurrent('Decks');\n\n $this->assertParamsNonEmpty(['current_deck']);\n $deckId = $request['current_deck'];\n\n // load deck\n $deck = $this->dbEntity()->deck()->getDeckAsserted($deckId);\n\n // validate deck ownership\n if ($deck->getUsername() != $player->getUsername()) {\n throw new Exception('Can only manipulate own deck', Exception::WARNING);\n }\n\n $this->result()->setCurrent('Decks_edit');\n\n $cardId = $request['return_card'];\n\n $this->service()->deck()->removeCard($deck, $cardId);\n }", "public function getCards();", "protected function getCimResponse() {\r\n\t\t$result = new Varien_Object;\r\n\t\t$r \t\t= explode( $this->cim->getDelimiter(), str_replace('\"','',$this->cim->getDirectResponse()) );\r\n\t\t\r\n\t\tif( count($r) > 0 ) {\r\n\t\t\t$result->setResponseCode((int)$r[0])\r\n\t\t\t\t->setResponseSubcode((int)$r[1])\r\n\t\t\t\t->setResponseReasonCode((int)$r[2])\r\n\t\t\t\t->setResponseReasonText($r[3])\r\n\t\t\t\t->setApprovalCode($r[4])\r\n\t\t\t\t->setAvsResultCode($r[5])\r\n\t\t\t\t->setTransactionId($r[6])\r\n\t\t\t\t->setInvoiceNumber($r[7])\r\n\t\t\t\t->setDescription($r[8])\r\n\t\t\t\t->setAmount($r[9])\r\n\t\t\t\t->setMethod($r[10])\r\n\t\t\t\t->setTransactionType($r[11])\r\n\t\t\t\t->setCustomerId($r[12])\r\n\t\t\t\t->setMd5Hash($r[37])\r\n\t\t\t\t->setCardCodeResponseCode($r[38])\r\n\t\t\t\t->setCAVVResponseCode( (isset($r[39])) ? $r[39] : null)\r\n\t\t\t\t->setAccNumber($r[50])\r\n\t\t\t\t->setCardType($r[51])\r\n\t\t\t\t->setSplitTenderId($r[52])\r\n\t\t\t\t->setRequestedAmount($r[53])\r\n\t\t\t\t->setBalanceOnCard($r[54]);\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "public function dealCardToDealer();", "public function response(): ResponseContract;", "protected function getCards($args) {\n\n if ($args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '2');\n\n if (is_array($returned))\n return $returned;\n\n if ($this->User['stripe_id'] == '')\n return $this->_getStatusMessage(51, 51);\n\n $getCardArr = array('stripe_id' => $this->User['stripe_id']);\n\n $cardsArr = array();\n\n $card = $this->stripe->apiStripe('getCustomer', $getCardArr);\n\n if ($card['error'])\n return array('errNum' => 16, 'errFlag' => 1, 'errMsg' => $card['error']['message'], 'test' => 2);\n\n foreach ($card['cards']['data'] as $c) {\n $cardsArr[] = array('id' => $c['id'], 'last4' => $c['last4'], 'type' => $c['brand'], 'exp_month' => $c['exp_month'], 'exp_year' => $c['exp_year']);\n }\n\n if (count($cardsArr) > 0)\n $errNum = 52;\n else\n $errNum = 51;\n\n $errMsgArr = $this->_getStatusMessage($errNum, 52);\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'cards' => $cardsArr, 'def' => $card['default_card']);\n }", "public function test_manual_CardPayment_getPaymentURL_response_is_accepted_and_contains_response_attributes()\n {\n $this->markTestIncomplete(\n 'skeleton for manual test of card payment'\n );\n\n $orderLanguage = \"sv\";\n $returnUrl = \"http://foo.bar.com\";\n $ipAddress = \"127.0.0.1\";\n\n // create order\n $order = TestUtil::createOrder(TestUtil::createIndividualCustomer(\"SE\")->setIpAddress($ipAddress));\n $order->setClientOrderNumber(\"foobar\" . date('c'));\n // set payment method\n // call getPaymentURL\n $response = $order\n ->usePaymentMethod(PaymentMethod::KORTCERT)\n ->setPayPageLanguage($orderLanguage)\n ->setReturnUrl($returnUrl)\n ->getPaymentUrl();\n\n // check that request was accepted\n ////print_r($response);\n $this->assertEquals(1, $response->accepted);\n\n // check that response set id, created exist and not null\n $this->assertTrue(isset($response->id));\n $this->assertTrue(isset($response->created));\n // check that request response contains url\n $this->assertEquals(\"https://test\", substr($response->url, 0, 12));\n // check that request response contains testurl\n $this->assertEquals(\"https://test\", substr($response->testurl, 0, 12));\n }", "protected function parseCardsResponse(array $list)\n\t{\n\t\t$cards = [];\n\n\t\tforeach ($list as $row)\n\t\t{\n\t\t\t$cards[] = new Card([\n\t\t\t\t'code' => $row['CardCode'],\n\t\t\t\t'serial' => $row['CardSerial'],\n\t\t\t\t'expire' => $row['ExpriceDate'],\n\t\t\t]);\n\t\t}\n\n\t\treturn $cards;\n\t}", "public function getCard(): ?bool\n {\n return $this->card;\n }", "public function getCard(): bool {\n $result = $this->mysqli->query(\"SELECT * FROM cards WHERE id='{$this->id}'\");\n if($result->num_rows == 1) { # Card exists in database\n $card = $result->fetch_assoc();\n $this->cardNum = $card['card_num'];\n $this->name = $card['name'];\n $this->billingAddress = $card['billing_address'];\n $this->exp = $card['exp'];\n $this->securityCode = $card['security_code'];\n return true;\n } else { # Card doesn't exist yet\n return false;\n }\n }", "function CardInfo(){\r\n }", "public function get_card_info($card_id, Request $request){\n\t\t\n\t\t$login_info = $request->session()->get('total_info');\n\t\t\n\t\t$card = App\\Card::find($card_id);\n\t\tif(null !== $card){\n\t\t\t$card->valid_forever = ($card->valid_period == null);\n\t\t\t$card->expire_remain_days = floor( (strtotime($card->valid_period) - time()) / 86400 );\n\t\t\t$card->dealer;\n\t\t\t$card->product;\n\t\t\t$card->customer;\n\t\t\t$card->product_stock = App\\Stock::getDealerStockInfo($card->product_id, $login_info['dealer_id']);\n\t\t\tif($card->product){\n\t\t\t\t$card->product->level1_info;\n\t\t\t\t$card->product->level2_info;\n\t\t\t}\n\t\t\t$return_arr = array(\"status\" => true, 'card' => $card);\n\t\t}else{\n\t\t\t$return_arr = array(\"status\" => false);\n\t\t}\n\t\techo json_encode($return_arr);\n\t}", "public function build(): ListCardsResponse\n {\n return CoreHelper::clone($this->instance);\n }", "public function getResponseClass(): string\n {\n return 'GetCardBindingsResponse';\n }", "protected function getCardData()\n {\n $this->getCard()->validate();\n\n $card = array();\n $card['name'] = $this->getCard()->getName();\n $card['number'] = $this->getCard()->getNumber();\n $card['expiry_month'] = $this->getCard()->getExpiryDate('m');\n $card['expiry_year'] = $this->getCard()->getExpiryDate('y');\n $card['cvd'] = $this->getCard()->getCvv();\n\n return $card;\n }", "public function getResponse();", "public function getResponse();", "public function getResponse();", "public function getResponse();" ]
[ "0.6849949", "0.682923", "0.67764735", "0.6676103", "0.6617826", "0.66177595", "0.6543389", "0.64561677", "0.6348846", "0.6329933", "0.6126838", "0.6120103", "0.60777456", "0.604684", "0.60012907", "0.5987791", "0.59828883", "0.5938717", "0.5935131", "0.58965313", "0.5889521", "0.58811563", "0.58793247", "0.5828161", "0.5809563", "0.5805838", "0.5794484", "0.5794484", "0.5794484", "0.5794484" ]
0.6998666
0
Return a reprompt response, wrapping a speech response
public function reprompt($reprompt, $type = self::TYPE_PLAINTTEXT) { return $this->respond( self::RESPONSE_TYPE_REPROMPT, [ self::RESPONSE_TYPE_OUTPUT_SPEECH => $this->getSpeechResponse($reprompt, $type), ] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function response() {\n $reply = trim(fgets($this -> __sock, 512));\n switch(substr($reply, 0, 1)) {\n /* Error reply */\n case '-':\n trigger_error('ERROR (' . trim($reply) . ')', E_USER_ERROR);\n /* Inline reply */\n case '+':\n $response = substr(trim($reply), 1);\n if($response === 'OK') $response = true;\n break;\n /* Bulk reply */\n case '$':\n $response = null;\n if($reply === '$-1') break;\n $read = 0;\n $size = intval(substr($reply, 1));\n if($size > 0) {\n do {\n $block_size = ($size - $read) > 1024 ? 1024 : ($size - $read);\n $r = fread($this -> __sock, $block_size);\n if($r === false)\n trigger_error('READ FROM SERVER ERROR', E_USER_ERROR);\n else {\n $read += strlen($r);\n $response .= $r;\n }\n } while($read < $size);\n }\n fread($this -> __sock, 2); /* CRLF */\n break;\n /* Multi-bulk reply */\n case '*':\n $count = intval(substr($reply, 1));\n if($count === -1) return null;\n $response = array();\n for($i = 0; $i < $count; $i++)\n $response[] = $this -> response();\n break;\n /* Integer reply */\n case ':':\n $response = intval(substr(trim($reply), 1));\n break;\n default:\n trigger_error('UNKNOWN RESPONSE ERROR', E_USER_ERROR);\n }\n return $response;\n }", "public function respond() {\n\t \n\t // Prevent duplicate responses\n\t if ($this->hasResponded) return;\n\t $this->hasResponded = true;\n\t \n\t // Set google as default for now\n\t $integrations = array(\n\t\t 'google' => array(\n\t\t\t 'expectUserResponse' => $this->expectUserResponse,\n\t\t\t 'richResponse' => array(\n\t\t\t\t 'items' => $this->items\n\t\t\t )\n\t\t )\n\t );\n\t \n\t $fulfillmentMessages = array();\n\t \n\t $response = array(\n\t\t 'fulfillmentText' => $this->speech,\t\t \n\t\t 'payload' => $integrations,\t\t \n\t );\n\t \n\t header(\"Content-type:application/json\");\n\t return json_encode($response);\n }", "public function getOriginalResponse() : ResponseInterface;", "public function getEquipSynthesisReply()\n {\n return $this->get(self::_EQUIP_SYNTHESIS_REPLY);\n }", "public function getReplyPost();", "protected function getSpeechResponse($text, $type)\n\t{\n\t\t$response = [\n\t\t\t'type' => $type,\n\t\t\t'text' => $text,\n\t\t];\n\n\t\tif ($type === self::TYPE_SSML) {\n\t\t\t$response['ssml'] = $response['text'];\n\n\t\t\tunset($response['text']);\n\t\t}\n\n\t\treturn $response;\n\t}", "public function getSyncSkillStrenReply()\n {\n return $this->get(self::_SYNC_SKILL_STREN_REPLY);\n }", "public function getAskMagicsoulReply()\n {\n return $this->get(self::_ASK_MAGICSOUL_REPLY);\n }", "function responseToDialogue($response){\n $response = json_encode(array_merge($response, array_filter(['extendedIds' => SUtl::translatedExtendedIdCols()]), ['extras' => Tfk::getExtras(), 'feedback' => Feedback::get()]));\n if ($response){\n $this->dialogue->response->setContent(Tfk::$registry->get('translatorsStore')->substituteTranslations($response));\n }else{\n Tfk::debug_mode('error', 'AbstractController->responseToDialogue - json_encoding error: ', json_last_error());\n }\n }", "function replyMessage ($message) {\n /*\n * Instantiate Recast.AI SDK, just for connect service\n */\n $request = Client::Request($_ENV[\"REQUEST_TOKEN\"]);\n\n /*\n * Get text from message received\n */\n $text = $message->content;\n\n /*\n * Get senderId to catch unique conversation_token\n */\n $senderId = $message->senderId;\n\n /*\n * Call Recast.AI SDK, through /converse route\n */\n $response = $request->converseText($text, [ 'conversation_token' => $senderId ]);\n\n /*\n * Here, you can add your own process.\n * Ex: You can call any external API\n * Or: Update your DB\n * etc...\n */\n $server = \"localhost\";\n$dbusername = \"root\";\n$dbpassword = \"root\";\n$dbname = \"phplms\";\nif ($response->action->slug == 'greetings') {\n // Do your code\necho \"Greetings User!\";\n\n\n$usernametext = \"sid\";\n$passwordtext = \"sid\";\n//array_push($response->replies, \"Welcome to LMS. You can enquire about your marks as of now.\");\n\n$conn = new mysqli($server, $dbusername, $dbpassword, $dbname);\n// Check connection\nif ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n} \nelse{\n$sql = \"SELECT * from register where username = 'sid' and password = 'sid';\";\n$result = $conn->query($sql);\n\n//if ($result->num_rows > 0) {\nif($result!=null){\n //array_push($response->replies, \"Inside rows > 0\");\n // output data of each row\n while($row = $result->fetch_assoc()) {\n //array_push($response->replies, \"Inside While\");\n //echo \"id: \" . $row[\"id\"]. \" - Name: \" . $row[\"firstname\"]. \" \" . $row[\"lastname\"]. \"<br>\";\n if($usernametext==$row[\"username\"]){\n if($passwordtext==$row[\"password\"]){\n //session_start();\n echo \"User found! Username = \".$row['username'].\"\\n\";\n echo \"Password = \".$row['password'].\"\\n\";\n //array_push($response->replies, \"Welcome to LMS. You can enquire about your marks as of now.\");\n //$_SESSION['username']=$usernametext;\n //$_SESSION['name']=$row[\"name\"];\n //header('Location: Auth.php');\n $conn->close();\n //exit;\n }\n }\n }\n}\nelse{\n echo \"0 results\";\n $conn->close();\n}\n}\n}\n\nif ($response->action->slug == 'online-test-marks') {\n $sql = \"\";\n $test_number = $response->memory->number->scalar;\n $username = $response->memory->username->value;\n if($username==null){\n array_push($response->replies, \"Code : Username is missing\");\n }\n //array_push($response->replies, \"Test number = \".$test_number);\n else if($test_number==null){\n //array_push($response->replies, \"Test number null\");\n\n \n }else{\n $sql = \"select * from onlinetest\".$test_number.\" where username = '\".$username.\"';\";\n $conn = new mysqli($server, $dbusername, $dbpassword, $dbname);\nif ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n} \nelse{\n$result = $conn->query($sql);\n\n//if ($result->num_rows > 0) {\nif($result!=null){\n array_push($response->replies, \"Your onlinetest\".$test_number.\" marks :\");\n // output data of each row\n while($row = $result->fetch_assoc()) {\n //echo \"id: \" . $row[\"id\"]. \" - Name: \" . $row[\"firstname\"]. \" \" . $row[\"lastname\"]. \"<br>\";\n array_push($response->replies, $row[\"cname\"].\" - \".$row[\"marks\"]);\n }\n }\n}\n}\n}\n\nif ($response->action->slug == 'login-1') {\n\n\n$usernametext = $response->memory->username->value;\n$passwordtext = $response->memory->password->value;\narray_push($response->replies, \"Username :\".$usernametext.\"END Password :\".$passwordtext.\"END\");\n//array_push($response->replies, \"Welcome to LMS. You can enquire about your marks as of now.\");\n//$result = null;\n$conn = new mysqli($server, $dbusername, $dbpassword, $dbname);\n// Check connection\nif ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n}\nelse{\n$sql = \"SELECT * from register where username = '.$usernametext.' and password = '.$passwordtext.';\";\n$result = $conn->query($sql);\narray_push($response->replies, \"No. of rows : \".mysqli_num_rows($result));\n//if ($result->num_rows > 0) {\nif($result!=null){\n//if(mysqli_num_rows($result)>0){\n array_push($response->replies, \"Code : Successfully logged in as \".$usernametext);\n array_push($response->replies, \"Welcome to LMS. You can enquire about your marks as of now.\");\n $conn->close();\n}\nelse{\n array_push($response->replies, \"Code : Username or password is wrong! Please log in again.\");\n $conn->close();\n}\n}\n}\n\nif ($response->action->slug == 'my-details') {\n $usernametext = $response->memory->username->value;\n $passwordtext = $response->memory->password->value;\n array_push($response->replies, \"Username : \".$usernametext.\" Password : \".$passwordtext);\n }\n /*\n * Add each replies received from API to replies stack\n */\n foreach ($response->replies as $reply) {\n $message->addReply([(object)['type' => 'text', 'content' => $reply]]);\n }\n\n $message->reply();\n}", "public function getTutorialReply()\n {\n return $this->get(self::_TUTORIAL_REPLY);\n }", "public function getOpenShopReply()\n {\n return $this->get(self::_OPEN_SHOP_REPLY);\n }", "public function getResponseMessage();", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n default:\n $resultStr = \"Unknow msg type: \".$RX_TYPE;\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n }", "public function getCorrectResponse() {\r\n return new qti_variable($this->cardinality, $this->type, array('value' => $this->correctResponse));\r\n }", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n default:\n $resultStr = \"Unknow msg type: \".$RX_TYPE;\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n }", "public function getReply()\n {\n return $this->reply;\n }", "public function & GetResponse ();", "public function answer()\n\t{\n\n $twiml = new Services_Twilio_Twiml();\n\n $gather = $twiml->gather([\n 'method' => 'GET',\n 'action' => 'twilio/check-account'\n ]);\n $gather->say(\"Hello, thanks for calling Phlare. Please enter your account number, followed by the pound sign.\");\n\n return $twiml;\n\n\t}", "public function makeResponse(): ResponseInterface;", "private function sendSingleVoiceTtsResponse(ResponseInterface $response, UriInterface $requestUri): mixed\n {\n $statusCode = $response->getStatusCode();\n $responseBody = $response->getBody();\n $responseHeaders = $response->getHeaders();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf('[%d] API Error (%s)', $statusCode, $requestUri),\n $statusCode,\n $responseHeaders,\n $responseBody\n );\n }\n\n $responseResult = null;\n\n $responseResult = $this->deserialize($responseBody, '\\Infobip\\Model\\CallsVoiceResponse', $responseHeaders);\n return $responseResult;\n }", "public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n global $textTpl;\n if (!empty($postStr))\n {\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $type = $postObj->MsgType;\n\n switch ($type)\n {\n case \"event\":\n $resultStr = GetEventMessage($postObj);\n break;\n case \"location\":\n $resultStr = GetLocationMessage($postObj);\n break;\n case \"text\":\n $resultStr = GetTextMessage($postObj);\n break;\n default:\n $resultStr = GetTextMessage($postObj);\n //$resultStr = GetDefaultMessage($postObj);\n break;\n }\n\n RecordInputContent($postObj); //保存用户输入的所有内容\n RefleshUserLoginTime($postObj); // 更新用户登录的最新时间\n\n echo $resultStr;\n }\n else\n {\n echo \"\";\n exit;\n }\n }", "public function getShopConsumeReply()\n {\n return $this->get(self::_SHOP_CONSUME_REPLY);\n }", "public function sendResponse();", "public function get_correct_response()\n {\n return null;\n }", "abstract public function response();", "public function getRequireRewardsReply()\n {\n return $this->get(self::_REQUIRE_REWARDS_REPLY);\n }", "function get_response() {\n return $this->response;\n }", "public function response(): ResponseContract;", "public function getMidasReply()\n {\n return $this->get(self::_MIDAS_REPLY);\n }" ]
[ "0.59148437", "0.5905642", "0.56824", "0.56219715", "0.56104815", "0.54974437", "0.548491", "0.54318166", "0.54279864", "0.539601", "0.5364582", "0.5350667", "0.53386617", "0.53163886", "0.5295762", "0.5294509", "0.5273699", "0.5264613", "0.5262042", "0.5256307", "0.52530974", "0.5250891", "0.52482665", "0.5247603", "0.52388304", "0.5219717", "0.5204224", "0.5200056", "0.5199996", "0.51952446" ]
0.5964544
0
Is the session ending?
public function isEnding() { return $this->session->expiring(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sessions_end()\n\t{\n\t\t// nothing to see here\n\t}", "public static function sessionClose()\n {\n return true;\n }", "public static function afnSessionStop()\n {\n @session_unset();\n @session_destroy();\n return true;\n }", "public function logout()\n\t\t{\n\t\t\treturn $this->end_session();\n\t\t}", "public static function endSession()\n {\n if (!empty(self::$_start_time)) {\n $now = microtime(true);\n self::$_duration = $now - self::$_start_time;\n }\n }", "private function end() {\n if ($this->isSessionStarted()) {\n session_commit();\n $this->clear();\n }\n }", "public function isEnded();", "public function closeSession() {\n session_unset();\n return true;\n }", "public function isEnded() {}", "public function stop() {\r\n\t\tif ($this->hasSession()) {\r\n\t\t\t$sessionId = self::getSessionId();\r\n\t\t\tself::session($sessionId);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function on_session_end() {\n}", "public function stop() : bool\n {\n if ($this->isActive()) {\n $closed = \\session_write_close();\n }\n return $closed ?? true;\n }", "public function close()\n {\n session_write_close();\n return true;\n }", "private function _closeSession()\n {\n $session = $this->requestStack->getCurrentRequest()->getSession();\n if ($session===null || !$session->isStarted()) {\n return;\n } \n \n $session->save();\n }", "public function destroy(){\n\t\tif( $this->sessionState == self::SESION_INICIADA){\n\t\t\t$this->sessionState = !session_destroy();\n\t\t\tunset( $_SESSION);\n\t\t\treturn !$this->sessionState;\n\t\t}\n\t\treturn FALSE;\n\t}", "function isSessionExpired() {\n $lastActivity = $_SESSION['LAST_ACTIVITY'];\n $timeOut = $_SESSION['IDLE_TIME_LIMIT'];\n // Check if session has been active longer than IDLE_TIME_LIMIT\n if(time() - $lastActivity >= $timeOut) {\n return true;\n } else { false; }\n }", "public function sessionIsTimedOut()\n {\n if ($this->sessionTimeout <= $this->sessionAge()) {\n return true;\n }\n\n return false;\n }", "public function logout() {\r\n $this->sess->resetSession();\r\n return(true);\r\n }", "public function isEnded()\n {\n return $this->ended_at > 0;\n }", "private function expiredSession() {\r\n\r\n if (time()>$this->forcedExpire) return true;\r\n else return false;\r\n }", "public function destroy():bool\n {\n\n $this->sessionState = !session_destroy();\n unset($_SESSION);\n\n return !$this->sessionState;\n }", "public function end_login(){\n\n\t\t//STARTS SESSION IF NON\n\t\tsession_id() == ''? session_start(): NULL;\n\n\t\t$this->LOGGED_IN = false;\n\t\tunset($this->USER_ID);\n\n\t\t$_SESSION = Array();\n\n\t\tsetcookie(\"PHPSESSID\", NULL, time()-3600, '/');\n\t\tsetcookie(\"user\", NULL, time()-3600, '/');\n\n\t\techo Janitor::build_json_alert('Logged Out Successfully', 'Success', 107, 1);\n\t\texit;\n\t\t}", "function EndSession(){\n session_unset(); \n // destroy the session \n session_destroy(); \n }", "public function destroy()\n {\n if ($this->sessionState == self::SESSION_STARTED) {\n $this->sessionState = !session_destroy();\n unset($_SESSION);\n\n return !$this->sessionState;\n }\n \n return false;\n }", "public static function logout()\n\t{\n\t\t$session = Common::getSession();\n\t\t$session->del(self::$sessionName);\n\t\treturn true;\n\t}", "private function end_session()\n\t\t{\n\t\t\tif (isset($_SESSION['userid']))\n\t\t\t{\n\t\t\t\tif (isset($_COOKIE['auth_token']))\n\t\t\t\t\tsetcookie('auth_token', '', strtotime('-1 year'));\n\n\t\t\t\tsession_destroy();\n\t\t\t}\n\t\t\treturn ['id' => null, 'name' => null, 'state' => 0];\n\t\t}", "public final function __end() : bool {\n\t\t\treturn false;\n\t\t}", "public function close() {\n\t\t$this->sessionClosed = true;\n\t}", "public function hasSession() {}", "public function logout()\n\t\t{\n\t\tif (!$this->checkSession()) return false;\n\t\t$res=$this->get(\"http://m.linkedin.com/session/logout\",true);\n\t\t$this->debugRequest();\n\t\t$this->resetDebugger();\n\t\t$this->stopPlugin();\n\t\treturn true;\t\n\t\t}" ]
[ "0.7965865", "0.76960903", "0.7401781", "0.73459166", "0.71515185", "0.71076417", "0.70544535", "0.7033305", "0.70268667", "0.7003383", "0.6970757", "0.6925148", "0.6842896", "0.68338794", "0.683221", "0.6814471", "0.68008876", "0.67978567", "0.67450947", "0.673175", "0.67193335", "0.6716497", "0.669879", "0.66333747", "0.6565394", "0.6550854", "0.65294564", "0.65179634", "0.6504312", "0.6503547" ]
0.871339
0
Tests if the event is checked out
function isCheckedOut( $uid=0 ) { if ($this->_loadData()) { if ($uid) { return ($this->_data->checked_out && $this->_data->checked_out != $uid); } else { return $this->_data->checked_out; } } elseif ($this->_id < 1) { return false; } else { JError::raiseWarning( 0, 'Unable to Load Data'); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isEvent()\n {\n return isset($this->status_changed) && ! is_null($this->status_changed);\n }", "function checkin()\r\n\t{\r\n\t\tif ($this->_id)\r\n\t\t{\r\n\t\t\t$event = & JTable::getInstance('eventlist_events', '');\r\n\t\t\treturn $event->checkin($this->_id);\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function isCheckedOut( $uid=0 ) {\r\n\t\tif ($item = $this->getItem()) {\r\n\t\t\tif ($uid) {\r\n\t\t\t\treturn ($item->checked_out && $item->checked_out != $uid);\r\n\t\t\t} else {\r\n\t\t\t\treturn $item->checked_out;\r\n\t\t\t}\r\n\t\t} elseif ($this->_id < 1) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\tJError::raiseWarning( 0, 'UNABLE LOAD DATA');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function a_book_can_be_checked_out()\n {\n $book = Book::factory()->create();\n $user = User::factory()->create();\n\n $book->checkout($user);\n\n $this->assertCount(1, Reservation::all());\n\n $reservation = Reservation::first();\n $this->assertEquals($user->id, $reservation->user_id);\n $this->assertEquals($book->id, $reservation->book_id);\n $this->assertEquals(now(), $reservation->checked_out_at);\n $this->assertNull($reservation->checked_in_at);\n }", "function checkout($uid = null)\r\n\t{\r\n\t\tif ($this->_id)\r\n\t\t{\r\n\t\t\t// Make sure we have a user id to checkout the event with\r\n\t\t\tif (is_null($uid)) {\r\n\t\t\t\t$user\t=& JFactory::getUser();\r\n\t\t\t\t$uid\t= $user->get('id');\r\n\t\t\t}\r\n\t\t\t// Lets get to it and checkout the thing...\r\n\t\t\t$event = & JTable::getInstance('eventlist_events', '');\r\n\t\t\treturn $event->checkout($uid, $this->_id);\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function CheckOut() {\n\n\t\tif ($this->parameter_check) {\n\n\t\t\t/* DATABASE CONNECTION */\n\t\t\t$db=$GLOBALS['db'];\n\n\t\t\t/* DESCRIPTION MUST ALWAYS COME FIRST BEFORE WE DELETE THE RECORDS */\n\t\t\t$description=GetColumnValue(\"filename\",\"document_files\",\"document_id\",$this->document_id,\"\"). \" - checked out\";\n\n\t\t\t$sql=\"UPDATE \".$GLOBALS['database_prefix'].\"document_files\n\t\t\t\t\t\tSET checked_out = 'y',\n\t\t\t\t\t\tuser_id_checked_out = \".$_SESSION['user_id'].\",\n\t\t\t\t\t\tdate_checked_out = now()\n\t\t\t\t\t\tWHERE document_id = \".$this->document_id.\"\n\t\t\t\t\t\t\";\n\t\t\t//echo $sql;\n\t\t\t$result=$db->Query($sql);\n\t\t\tif ($db->AffectedRows($result) > 0) {\n\t\t\t\t/* CALL THE UNLOCK FEATURE */\n\t\t\t\t$this->UnLockDocument();\n\t\t\t\t/* CALL THE UNDO CUT FEATURE */\n\t\t\t\t$this->DocumentUndoCut();\n\t\t\t\t/* LOG THE HISTORY */\n\t\t\t\tLogDocumentFileHistory($this->GetColVal(\"filename\"),$this->GetColVal(\"category_id\"),$this->GetColVal(\"version_number\"),$description);\n\t\t\t\treturn True;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn False;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$this->Errors(\"Parameter check failed\");\n\t\t\treturn False;\n\t\t}\n\t}", "public function eventExists()\n {\n return $this->getTalk()->getSpeaker()->exists();\n }", "function isCheckedOut($media_id)\n\t{\n\t\treturn $this->query->isCheckedOut($media_id);\n\t}", "private function checkEventExists(){\n $event = Event::find($this->id);\n\n return(!is_null($event));\n }", "public function checkOut()\n {\n $this->update(['book_status' => 'checkedout']);\n }", "public function isDone()\n\t{\n\t $today = Carbon::now()->setTimezone('America/Los_Angeles')->startOfDay();\n\t return $today->gte($this->event_date->endOfDay());\n\t}", "private function checkEventDateNotDue(){\n $event = Event::find($this->id);\n $now = Carbon::now();\n \n $startTime = Carbon::createFromFormat('Y-m-d H:i:s', $event->start_time);\n return $startTime->gt($now);\n }", "public function hasEvents()\n {\n return count($this->events) > 0 ? true : false;\n }", "public function check_last_event( $event_name ) {\n\t\t\treturn $event_name === $this->last_event;\n\t\t}", "public function checkSignal()\n {\n if($this->current_signal){\n $this->fire($this->current_signal); \n }\n }", "public function isEventRecurs() {\n\t\treturn ($this->eventRecurs);\n\t}", "public function getHasBeenRejectedBefore(): bool;", "function getHasEvent() {\n\t\treturn $this->_HasEvent;\n\t}", "public function fireEventCancel(string $eventName): bool;", "function eo_reoccurs($id=''){\n\tglobal $post;\n\t$event = $post;\n\n\tif(isset($id)&&$id!='') $event = eo_get_by_postid($id);\n\n\tif(isset($event->event_schedule)&&$event->event_schedule!='once')\n\t\treturn true;\n\n\treturn false;\n}", "public function testGetAccountEventCheckOut()\n {\n // Grab Page\n $result = $this->visit('account/event/check-in')\n ->see('create your suaray account')\n ->see('welcome to suaray')\n ->seePageIs('/account/register');\n }", "public function hasEventQueue(/*# string */ $eventName)/*# : bool */;", "public static function event_method()\n {\n return true;\n }", "public function isChecked() {}", "public function test_showCheckOut_UserIsNotNullAndAvailableToCheckOutAndUserHasNotCheckedItOut_returnTrue()\r\n\t{\r\n\t\t$this->prepareisCheckOutAvailable(true);\r\n\t\t$this->prepareCheckedOutByPatron(false);\r\n\t\t\r\n\t\t$actual = $this->service->showCheckOut($this->userMock);\r\n\t\t$this->assertTrue($actual);\r\n\t}", "public function isClicked() : bool {\n return $this->delivery_status === WebhookEvent::EVENT_CLICK;\n }", "public function test_showCheckOut_UserIsNotNullAndAvailableToCheckOutAndUserHasNotCheckedItOut_returnFalse()\r\n\t{\r\n\t\t$patronID = \"aDummyPatronId\";\r\n\t\t$this->prepareisCheckOutAvailable(true);\r\n\t\t$this->prepareCheckedOutByPatron(true);\r\n\t\r\n\t\t$actual = $this->service->showCheckOut($this->userMock);\r\n\t\t$this->assertFalse($actual);\r\n\t}", "public function isCancelable(): bool;", "public function hasIsCheckIn(){\n return $this->_has(3);\n }", "public function hasPendingActions()\r\n {\r\n }" ]
[ "0.64039415", "0.6395539", "0.6377019", "0.6163626", "0.6108217", "0.5880456", "0.58639574", "0.5807477", "0.57964987", "0.5790323", "0.5733801", "0.5634129", "0.56307447", "0.56082547", "0.55301434", "0.55096173", "0.5508735", "0.549131", "0.5482167", "0.5473836", "0.54520357", "0.5425924", "0.5404549", "0.5392789", "0.5377499", "0.5366102", "0.5355348", "0.5345299", "0.5344733", "0.5330884" ]
0.6438064
0
Registers a new submenu page
function add_menu_subpage(){ add_submenu_page( 'wpex-general', __( 'General', 'athen_transl' ), __( 'General', 'athen_transl' ), 'manage_options', ATHEN_THEME_PANEL_SLUG, array( $this, 'create_admin_page' ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function add_page() {\n\t\tadd_submenu_page(\n\t\t\tWPEX_THEME_PANEL_SLUG,\n\t\t\tesc_html__( 'Under Construction', 'total' ),\n\t\t\tesc_html__( 'Under Construction', 'total' ),\n\t\t\t'administrator',\n\t\t\tWPEX_THEME_PANEL_SLUG . '-under-construction',\n\t\t\tarray( 'WPEX_Under_Construction', 'create_admin_page' )\n\t\t);\n\t}", "public function add_page() {\n\t\t\tadd_submenu_page(\n\t\t\t\tWPEX_THEME_PANEL_SLUG,\n\t\t\t\t__( 'Theme Skins', 'wpex' ),\n\t\t\t\t__( 'Theme Skins', 'wpex' ),\n\t\t\t\t'administrator',\n\t\t\t\tWPEX_THEME_PANEL_SLUG .'-skins',\n\t\t\t\tarray( $this, 'create_admin_page' )\n\t\t\t);\n\t\t}", "public function add_submenu_page() {\n\t\tadd_submenu_page(\n\t\t\t'edit.php?post_type=slack_integration',\n\t\t\t__( 'Post types', 'slack-post-types' ),\n\t\t\t__( 'Post types', 'slack-post-types' ),\n\t\t\t'manage_options',\n\t\t\t'slack-post-types',\n\t\t\tarray( $this, 'display_admin_page' )\n\t\t);\n\t}", "function addSubMenus() {\n \tif($this->checkPermissions()) {\n\t\t \t$first_item_parent = $this->isTeacherFeatures() ? 'lepress-my-subscriptions' : 'lepress';\n\t\t \tadd_submenu_page('lepress', __(\"Manage my subscriptions\", lepress_textdomain),__(\" My subscriptions\", lepress_textdomain).'<span id=\"lepress-student-subs-count\"></span>',3, $first_item_parent,array(&$this, 'getSubMenuPageContent' ));\n\t\t \tadd_submenu_page('lepress', __(\"Manage assignments\", lepress_textdomain),__(\"Assignments\", lepress_textdomain).'<span id=\"lepress-student-assignments-count\"></span>',3, 'lepress-assignments',array(&$this, 'getSubMenuPageContent' ));\n\t\t \t//add_submenu_page('lepress', __(\"Manage groups\", lepress_textdomain),__(\"My groups\", lepress_textdomain),3, 'lepress-groups',array(&$this, 'getSubMenuPageContent' ));\n \t}\n }", "function submenu_add_pages() \n {\n add_submenu_page(\n 'edit.php?post_type=custompost',\n __( 'Test Settings', 'menu-test' ),\n __( 'Test Settings', 'menu-test' ),\n 'manage_options',\n 'testsettings',\n 'mt_settings_page');\n }", "public static function add_submenu_page() {\n\t\tadd_submenu_page( null, __( 'Importing Nutrition', 'wp-recipe-maker' ), __( 'Importing Nutrition', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_tools_access' ), 'wprm_wpurp_nutrition', array( __CLASS__, 'wpurp_nutrition' ) );\n\t}", "public function submenu_page() {\n\n\t\tadd_submenu_page(\n\t\t\t'options-general.php',\n\t\t\t_x( 'Schedule a Visit Leads to Sherpa', 'Admin Page Title', 'schedule-a-visit-to-sherpa' ),\n\t\t\t_x( 'Schedule a Visit to Sherpa', 'Admin Sub-Menu Title', 'schedule-a-visit-to-sherpa' ),\n\t\t\t'manage_options',\n\t\t\t'schedule-a-visit-to-sherpa',\n\t\t\tarray( $this, 'settings_page' )\n\t\t);\n\t\t\n\t\t// Move our menu from Settings to under Forms\n\t\t\n\t\tglobal $submenu;\n\n\t\t$settings_index = null;\n\t\tforeach ( $submenu['options-general.php'] as $key => $menu_item ) {\n\t\t\t\n\t\t\t// Index 2 is always the child page slug\n\t\t\tif ( $menu_item[2] == 'schedule-a-visit-to-sherpa' ) {\n\t\t\t\t$settings_index = $key;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// We need to make the path more absolute\n\t\t$submenu['options-general.php'][ $settings_index ][2] = 'options-general.php?page=schedule-a-visit-to-sherpa';\n\t\t\n\t\t// Move the Menu Item\n\t\t$submenu['gf_edit_forms'][] = $submenu['options-general.php'][ $settings_index ];\n\t\tunset( $submenu['options-general.php'][ $settings_index ] );\n\n\t}", "public function create_submenu() {\n\t\tadd_submenu_page(\n\t\t\t'options-general.php',\n\t\t\t__('CHAOS Client','wpchaosclient'),\n\t\t\t__('CHAOS','wpchaosclient'),\n\t\t\t'manage_options',\n\t\t\t$this->menu_page,\n\t\t\tarray(&$this,'create_submenu_page')\n\t\t);\n\t}", "public function register_sub_menu()\n {\n add_submenu_page(\n 'edit.php?post_type=book',\n 'Book Setting',\n 'Settings',\n 'manage_options',\n 'submenu-page',\n array($this, 'custom_submenu_page')\n );\n //register settings\n add_action('admin_init', array($this, 'register_settings'));\n\n }", "public function add_menu_page() {\n\n\t\tadd_submenu_page(\n\t\t\tCT_Ultimate_GDPR::instance()->get_admin_controller()->get_option_name(),\n\t\t\tesc_html__( 'Privacy Policy', 'ct-ultimate-gdpr' ),\n\t\t\tesc_html__( 'Privacy Policy', 'ct-ultimate-gdpr' ),\n\t\t\t'manage_options',\n\t\t\t$this->get_id(),\n\t\t\tarray( $this, 'render_menu_page' )\n\t\t);\n\t}", "public function add_page() {\n\t\tadd_submenu_page(\n\t\t\t'oceanwp-panel',\n\t\t\tesc_html__( 'Rec. Plugins', 'ocean-extra' ),\n\t\t\tesc_html__( 'Rec. Plugins', 'ocean-extra' ),\n\t\t\t'manage_options',\n\t\t\t'oceanwp-panel-rec-plugins',\n\t\t\tarray( $this, 'create_admin_page' )\n\t\t);\n\t}", "function add_submenu_page($parent_slug, $page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \\null)\n {\n }", "function news_submenu_page(){\n\tadd_submenu_page(\n\t\t'edit.php?post_type=news',\n\t\t'Order news',\n\t\t'Order News',\n\t\t'order_posts',\n\t\t'order-posts-page',\n\t\t'post_order_submenu_page' );\n}", "public function add_menu_page() {\n\t\tadd_submenu_page(\n\t\t\tCT_Ultimate_GDPR::instance()->get_admin_controller()->get_option_name(),\n\t\t\tesc_html__( 'Right To Be Forgotten', 'ct-ultimate-gdpr' ),\n\t\t\tesc_html__( 'Right To Be Forgotten', 'ct-ultimate-gdpr' ),\n\t\t\t'manage_options',\n\t\t\t$this->get_id(),\n\t\t\tarray( $this, 'render_menu_page' )\n\t\t);\n\n\t}", "function addMenu()\n{\n add_menu_page (\"Members and Email\", \"Members / Email\", 4, \"members-email-1\", \"MeMenu\" );\n add_submenu_page(\"members-email-1\", \"Email List\", \"Email\", 4, \"members-email-sub-1\", \"MeMenuSub1\");\n add_submenu_page(\"members-email-1\", \"Tracking\", \"Tracking Scripts\", 4, \"tracking-scripts-1\", \"MeMenuSub2\");\n\n\n}", "function add_menu() {\n add_menu_page(\"Polls\", \"Polls\", \"administrator\", \"polls\", \"managePollsPage\");\n}", "public function register_menu()\n {\n add_menu_page('Coupons Settings', 'Coupons Settings', 'edit_others_posts', 'wpm_coupons_settings');\n add_submenu_page('wpm_coupons_settings', 'Coupons Settings', 'Coupons Settings', 'manage_options', 'wpm_coupons_settings', function () {\n $settings = json_decode(get_option('api_settings', true), true);\n\n include 'templates/settings_template.php';\n });\n }", "public function create_menu() {\n\t\tif ( get_network()->site_id !== get_current_blog_id() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t//create new top-level menu\n\t\tadd_management_page(\n\t\t\t__( 'Sync newsletter', 'elemarjr' ),\n\t\t\t__( 'Sync newsletter', 'elemarjr' ),\n\t\t\t'manage_options',\n\t\t\t'sync-newsletter',\n\t\t\tarray( $this, 'display_submenu_page' ),\n\t\t\t6\n\t\t);\n\t}", "function theme_options_add_page() {\t\n\tadd_submenu_page('options-general.php', 'Site Description', 'Site Description', 'edit_theme_options', 'theme_options', 'theme_options_do_page'); \n\tadd_submenu_page('options-general.php', 'Google Analytics', 'Google Analytics', 'edit_theme_options', 'ga_options', 'ga_do_page'); \n}", "function pages_submenu_page(){\n\tadd_submenu_page(\n\t\t'edit.php?post_type=page',\n\t\t'Order pages',\n\t\t'Order Pages',\n\t\t'order_posts',\n\t\t'order-posts-page',\n\t\t'post_order_submenu_page' );\n}", "public function register() {\n\t\tcall_user_func_array( 'add_submenu_page', $this->get_page_arguments() );\n\t}", "public static function wpa_add_menu() {\n add_menu_page('Main Menu','Home','manage_options','Sub-menu');\n add_submenu_page('Sub-menu','User List','User List','manage_options','menu-list',array( __CLASS__,'wpa_page_file_path'));\n add_submenu_page('Sub-menu','Add User','Add User','manage_options','menu-add',array(__CLASS__,'wpa_page_file_path'));\n }", "function mt_add_pages() {\n // Add a new submenu under Tools:\n add_management_page( __('KML Upload','menu-test'), __('KML Upload','menu-test'), 'manage_options', 'kmlupload', 'mt_tools_page');\n}", "function book_add_page() {\n add_submenu_page('edit.php?post_type=book', 'Book Admin', 'Book Settings', 'edit_posts', basename(__FILE__), 'book_s');\n}", "public function register_menu() {\n $parent_slug = 'comparrot';\n $capability = 'manage_options';\n\n add_menu_page( 'Comparrot', 'Comparrot', $capability, $parent_slug, [$this, 'import_from_csv_page'], 'dashicons-admin-page', 2 );\n\n add_submenu_page( $parent_slug, __( 'Import from CSV', 'comparrot' ), __( 'Import from CSV', 'comparrot' ), $capability, $parent_slug, [$this, 'import_from_csv_page'] );\n add_submenu_page( $parent_slug, __( 'General settings', 'comparrot' ), __( 'General settings', 'comparrot' ), $capability, 'comparrot-general-settings', [$this, 'general_settings_page'] );\n }", "public function setLoadControllerMenuSub()\r\n {\r\n add_submenu_page(\r\n $_SESSION['controller_data_sub']['page_slug_current'],\r\n $_SESSION['controller_data_sub']['page_title'], // Title of the page\r\n $_SESSION['controller_data_sub']['page_menu_text'], // Text to show on the menu link\r\n $_SESSION['controller_data_sub']['page_capability'], // Capability requirement to see the link\r\n $_SESSION['controller_data_sub']['page_slug'],\r\n $_SESSION['controller_data_sub']['page_render'],\r\n $_SESSION['controller_data_sub']['page_menu_position']\r\n );\r\n }", "public function admin_menu_add() \n\t{\n\t\tadd_submenu_page(\n\t\t\t'themes.php'\n\t\t\t, __('9spot Settings', '9spot')\n\t\t\t, __('Theme Layouts', '9spot')\n\t\t\t, 0\n\t\t\t, $this->layout_page\n\t\t\t, array(&$this, 'admin_layout')\n\t\t);\n\t}", "public function add_options_page()\n {\n $parent_slug = null;\n $subpage_slug = $this->welcome_slug;\n\n //echo \">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> TEST: \" . FREEMIUS_NAVIGATION . '<br>';\n\n if (FREEMIUS_NAVIGATION === 'tabs') {\n // only show submenu page when tabs enabled if welcome tab is active\n if (isset($_GET['page']) && $_GET['page'] === $subpage_slug) {\n $parent_slug = $this->custom_plugin_data->parent_slug;\n }\n } else {\n // always use this if navigation is set to 'menu'\n $parent_slug = $this->custom_plugin_data->parent_slug;\n }\n\n if ($this->custom_plugin_data->menu_type === 'top') {\n $label = 'About';\n } else if ($this->custom_plugin_data->menu_type === 'sub') {\n $label = '<span class=\"fs-submenu-item fs-sub wpgo-plugins\">About</span>';\n }\n\n add_submenu_page($parent_slug, 'Welcome to ' . $this->custom_plugin_data->main_menu_label, $label, 'manage_options', $subpage_slug, array(&$this, 'render_sub_menu_form'));\n }", "function custom_sub_menu_function() \n {\n add_theme_page('sub Title name', 'sub Menu name', 'manage_options', 'sub-menu-slug', 'sub_menu_panel');\n }", "function tutorials_submenu_page(){\n\tadd_submenu_page(\n\t\t'edit.php?post_type=tutorials',\n\t\t'Order tutorials',\n\t\t'Order Tutorials',\n\t\t'order_posts',\n\t\t'order-posts-page',\n\t\t'post_order_submenu_page' );\n}" ]
[ "0.7796628", "0.7624312", "0.7592035", "0.75650054", "0.74934274", "0.7492506", "0.7465937", "0.7461963", "0.74529606", "0.7447358", "0.7404587", "0.73857015", "0.7372055", "0.73425573", "0.73236275", "0.7304584", "0.7304443", "0.72829694", "0.7274513", "0.72219056", "0.7217325", "0.719399", "0.71780837", "0.7164218", "0.716047", "0.712729", "0.7109466", "0.7101464", "0.70957154", "0.7081452" ]
0.7860317
0
Fonction createPost avec livewire
public function createPost() { $this->validate(['body' => 'required|min:15']); $post = auth()->user()->posts()->create(['body' => $this->body]); $this->emit('postAdded', $post->id); //emit de l'event $this->body = ""; //vidage du body }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function CrearPost(){\n\n\n }", "public function createPost()\n {\n if ($this->issetPostSperglobal('title') &&\n $this->issetPostSperglobal('description') &&\n $this->issetPostSperglobal('content') &&\n $this->issetPostSperglobal('categorie') &&\n $this->issetPostSperglobal('publish'))\n {\n $empty_field = 0;\n foreach ($_POST as $key => $post) {\n if ($key !== 'publish' && empty(trim($post))) {\n $empty_field++;\n }\n }\n if ($empty_field === 0) {\n $User = $this->session->read('User');\n $this->posts_manager->create($_POST, $User->getIdUser());\n $this->session->writeFlash('success', \"L'article a été créé avec succès.\");\n $this->redirect('dashboard');\n } else {\n $this->session->writeFlash('danger', \"Certains champs sont vides.\");\n }\n } else {\n $this->session->writeFlash('danger', \"Certains champs sont manquants.\");\n }\n $_post = $this->getSpecificPost($_POST);\n $categories = $this->categories_manager->listAll();\n $this->render('admin_post', ['head'=>['title'=>'Création d\\'un article', 'meta_description'=>''], 'categories'=>$categories, '_post'=>isset($_post) ? $_post : ''], 'admin');\n }", "public function CreateNewPost(Request $request){\n\n $okay = $this->getfailsvalidator($request);\n if($okay!='pas'){\n return $okay;\n }\n\n $inputs = $request->all();\n\n $titleslug = str_slug($inputs['title'], \"-\");\n\n if(empty($titleslug)){\n\n $titleslug = preg_replace(\"/[\\s-]+/\", \" \", $inputs['title']);\n\n $titleslug = preg_replace(\"/[\\s_]/\", '-', $titleslug);\n\n }\n $imgWW = $this->resizepostimage($inputs['thumb'], $titleslug);\n\n\t\t$ordertype = null;\n\t\tif(isset($inputs['ordertype'])){\n $ordertype = $inputs['ordertype'];\n if($ordertype == 'none'){\n $ordertype = null;\n }\n\t\t}\n\t\t\n $post = new Posts;\n $post->slug = $titleslug;\n $post->title = $inputs['title'];\n $post->body = $inputs['description'];\n $post->category_id = $inputs['category'];\n if(isset($inputs['pagination'])){\n $post->pagination = $inputs['pagination'] == 0 ? null : $inputs['pagination'];\n }\n $post->type = $inputs['type'];\n $post->tags = isset($inputs['tags']) ? $inputs['tags'] : '';\n $post->ordertype = $ordertype;\n $post->thumb = $imgWW;\n\n if($inputs['datapostt']=='draft'){\n $post->approve = 'draft';\n }elseif(getcong('AutoApprove')=='true' or Auth::user()->usertype == 'Staff' or Auth::user()->usertype == 'Admin' and Auth::user()->email !== 'demo@admin.com'){\n $post->approve = 'yes';\n }else{\n $post->approve = 'no';\n }\n\n $post->published_at = Carbon::now();\n\n\n Auth::user()->posts()->save($post);\n\n $this->createentrys($request, $post);\n\n\n //burda aynı resim adresini kulllanıyordur.\n \\File::delete($inputs['thumb']); //delete tmp image\n\n \\Session::flash('success.message', trans('index.successcreated'));\n\n return array('url' => makeposturl($post) );\n\n }", "public function create()\n {\n $json = [\n 'status' => false,\n 'message' => 'You cannot create post',\n ];\n\n if($this->isUserAuth()){\n $template = new Template();\n\n $template->data['post_id'] = 0;\n\n $json = [\n 'status' => true,\n 'html' => $template->fetch('add_post_form'),\n ];\n }\n\n $this->jsonAnswer($json);\n }", "public function create()\n { \n // $this->authorize('post.create');\n //sert a afficher le formulaire d'ajout\n return view('posts.create');\n }", "public function create() {\n\t\treturn view('post.post_create');\n\t}", "public function created(Post $post)\n {\n //\n }", "public function postcreate(){\n if($this->check() == true){\n $page_id = @$_POST['page'];\n $text = @htmlentities($_POST['text'], ENT_QUOTES);\n\n\n $this->admindb->insert(\"post\", array(\n\n \"text\" => $text,\n \"pages_id\" => $page_id\n\n ))->get();\n\n $data['pages'] = $this->admindb->selectAll('pages');\n $this->view(\"admin/post/postcreate\", $data);\n }\n }", "public function create()\n {\n //\n return view('post.create');\n }", "public function create()\n {\n return view ('admin.post.create');\n }", "public function createPost()\n {\n return view('post_create');\n }", "public function store(CreatePostRequest $request)\n {\n // $post->title = $request->get('title');\n // $post->body = $request->get('body');\n // $post->is_published = $request->get('is_published', false);\n\n // $post->save();\n\n $data = $request->validated();\n\n // $newPost = Post::create($data);\n\n $newPost = auth()->user()->posts()->create($data);\n\n $newPost->tags()->attach($data['tags']); // mozemo koristiti sync umjesto attach\n // $newPost = Post::create([\n // 'title' => $request->get('title'),\n // 'body' => $request->get('body'),\n // 'is_published' => $request->get('is_published'),\n // 'user_id' => auth()->user()->id,\n // ]);\n\n return redirect(route('post', ['post' => $newPost]));\n }", "function createPost()\n {\n $userLogged = Auth::check(['administrateur']);\n \n // post\n $post = new Post();\n $post->setDateCreate(new Datetime()); //to assign today's date (in datetime) by default to the post we create\n $formPost = new Form($post);\n\n // users\n $userManager = new UserManager();\n $user = new User();\n\n $listUsers = $userManager->getListUsers();\n $listUsersSelect = $userManager->listUsersFormSelect($listUsers);\n \n $formUser = new Form($user);\n\n // media (image et video)\n $mediaManager = new MediaManager();\n \n $mediaUploadImage = new Media(); // to have in the input field \"alternative text of the media uploader\" (create after) an empty field\n $formMediaUploadImage = new Form($mediaUploadImage); // use in \"_form.php\" of the \"backendViews> post\" folder\n \n $mediaUploadVideo = new Media();\n $formMediaUploadVideo = new Form($mediaUploadVideo);\n\n // traitement server et affichage des retours d'infos \n if ($_SERVER['REQUEST_METHOD'] === 'POST') { // if a submission of the form (=> a creation of a post) has been made\n \n // for data validation\n $errors = [];\n\n // test de validation des champs du formulaire\n if (empty($_POST['title']) OR mb_strlen($_POST['title'])<=3) {\n $errors[] = 'Le champ title ne peut être vide et doit contenir plus de 3 caracteres';\n }\n if (empty($_POST['introduction']) OR mb_strlen($_POST['introduction'])<=3) {\n $errors[] = 'Le champ introduction ne peut être vide et doit contenir plus de 3 caracteres';\n }\n if (empty($_POST['content']) OR mb_strlen($_POST['content'])<=3) {\n $errors[] = 'Le champ content ne peut être vide et doit contenir plus de 3 caracteres';\n }\n\n if (empty($errors)) {\n \n // modification to manage the record in the database via the Postmanager \n $dateCreate = DateTime::createFromFormat('Y-m-d H:i:s',$_POST['dateCreate']);// so that the date String is in Datetime \n \n // bdd recording of the post \n $post\n ->setTitle($_POST['title'])\n ->setIntroduction($_POST['introduction'])\n ->setContent($_POST['content'])\n ->setDateCreate($dateCreate)\n ->setDateChange($dateCreate)\n ->setUser_id($_POST['user'])\n ;\n\n $postManager = new PostManager();\n\n try{\n $lastRecordingPost = $postManager->addPost($post);// add the post to the database and get the last id of the posts in the database via the return of the function\n } catch (Exception $e) {\n $errors[] = $e->getMessage();\n } \n\n // media IMAGE\n if (isset($_FILES['mediaUploadImage']) AND $_FILES['mediaUploadImage']['error']== 0) {\n \n // info variables \n $idMediaType = 1; // image\n \n $file = $_FILES['mediaUploadImage']; // file uploader \n $storagePath = searchDatasFile('imageStoragePath')[1]; // storage path of the uploader file (see globalFunctions.php file) \n $name = 'mediaImage-'.pathinfo($file['name'])['filename'].'-'; \n $newNameUploaderFile = uniqid($name , true); // concatenation \"media-\" + name of the uploader file (without its extension + unique identifier (via uniqid) to have a unique identifier\n \n $extension_upload = pathinfo($file['name'])['extension']; // to retrieve the extension of the uploader file \n $pathFile = $storagePath.basename($newNameUploaderFile.'.'.$extension_upload); //storage path with new name of the media uploader\n\n // recording in bdd of the IMAGE media and of the uploader file on the server in the media folder \n $mediaUploadImage\n ->setPath($pathFile) // ->setPath('./media/media-19.jpg')\n ->setAlt($_POST['altFileMediaImage'])\n ->setStatutActif(1) //actif\n ->setMediaType_id($idMediaType)\n ->setPost_id($lastRecordingPost)\n ->setUser_id($_POST['user'])\n ;\n \n try{\n $mediaManager->addMediaImage($mediaUploadImage, CONFIGFILE, $file); //adding the media to the database and recovery via the id function of the last media in the database\n } catch (Exception $e) {\n $errors[] = $e->getMessage();\n \n }\n }\n \n // media VIDEO\n if (!empty($_POST['mediaUploadVideo'])){\n // VIDEO media bdd recording \n $mediaUploadVideo\n ->setPath($_POST['mediaUploadVideo'])\n ->setAlt($_POST['altFileMediaVideo'])\n ->setStatutActif(1) //actif\n ->setMediaType_id(3) //video\n ->setPost_id($lastRecordingPost)\n ->setUser_id($_POST['user'])\n ;\n try{\n $mediaManager->addMediaVideo($mediaUploadVideo);\n } catch (Exception $e) {\n $errors[] = $e->getMessage();\n }\n }\n \n setFlashErrors($errors); // to manage flash message errors (see globalFunctions.php file)\n \n header('Location: /backend/editPost/'.$lastRecordingPost.'?created=true');\n return http_response_code(302);\n\n }else{\n setFlashErrors($errors); // to manage flash message errors (see globalFunctions.php file)\n \n header('Location: /backend/createPost?created=false');\n return http_response_code(302);\n }\n }\n\n require'../app/Views/backViews/post/backCreatePostView.php';\n }", "public function store(){\n $validatedData = $this->validate([\n 'title'=>'required',\n 'content'=>'required'\n ]);\n\n //Validate the data\n Post::create($validatedData);\n\n //Set a message\n session()->flash('message','Post Created Successfully!');\n\n //Call Reset Input field function\n $this->resetInputFields();\n\n //Emit to close modal after submiting it\n $this->emit('postAdded');\n }", "public function createPost(){\n\n return view('pages.add-post');\n }", "public function createActionPost(): object\n {\n // Connects to db\n $this->app->db->connect();\n\n if (hasKeyPost(\"doCreate\")) {\n $title = getPost(\"contentTitle\");\n\n // Calls createProduct method\n $this->admin->createBlogpost($title);\n\n // Retrieves id\n $id = $this->app->db->lastInsertId();\n }\n\n // Redirects\n return $this->app->response->redirect(\"admin/edit?id=$id\");\n }", "public function create()\n {\n //\n return View::make('post.create');\n }", "public function post();", "public function post();", "public function post();", "public function create()\n {\n return redirect()->route('index', ['type' => 'create-post']);\n }", "public function add(): void\n {\n\n $this->checkAccess(); // redirect to login page if not connected\n\n $pageTitle = 'Ajouter un post';\n $message = '';\n $style = 'success';\n $template = 'new-post';\n $post = $this->model;\n\n $postArray = $post->collectInput('POST'); // collect global $_POST data\n \n if (!empty($postArray))\n {\n if (isset($postArray['save']))\n {\n $message = 'Le post a bien été enregistré en base';\n $post->status = self::STATUS_SUBMITTED;\n }\n if (isset($postArray['saveAsDraft']))\n {\n $message = 'Le brouillon a bien été enregistré en base';\n $post->status = self::STATUS_DRAFT;\n }\n\n $post->author = filter_var($_SESSION['user_id'], FILTER_VALIDATE_INT); // author = connected user\n $this->dataTransform($post, $postArray);\n \n $post->id = $post->insert();\n\n if($post->id == 0)\n {\n $message = 'Une erreur est survenue, le post n\\'a pas pu être inséré dans la base de données.';\n $style = 'danger';\n } \n if($post->id !== 0)\n {\n array_push($_SESSION['user_posts'], $post->id);\n $message .= ' sous l\\'identifiant #'.$post->id.'.';\n $pageTitle = 'Modifier le post #'.$post->id;\n $template = 'edit-post';\n\n if((!$this->isAdmin()) AND (NOTIFY['new_post'] == 1)) // if current user is not admin and new post notification is enabled\n {\n // Try to notify the site owner of the new post submission\n try\n {\n $serverArray = $this->collectInput('SERVER');\n $baseUrl = 'http://'.$serverArray['HTTP_HOST'].$serverArray['PHP_SELF'];\n $body = \"Un nouveau post vient d'être soumis par {$post->getAuthor()} : {$baseUrl}?controller=post&task=edit&id={$post->id}\";\n if (!$this->sendEmail(SITE_NAME,'noreply@myblog.fr','Nouveau post soumis',$body))\n {\n throw new Throwable();\n }\n }\n catch (Throwable $e)\n {\n // Uncomment in dev context:\n $error = sprintf('Erreur : %1$s<br>Fichier : %2$s<br>Ligne : %3$d', $e->getMessage(), $e->getFile(), $e->getLine());\n echo filter_var($error, FILTER_SANITIZE_STRING);\n }\n }\n }\n\n }\n \n $this->display('admin', $template, $pageTitle, compact('message','style','post'));\n\n }", "public function create()\n {\n // ver se está autenticado\n if (!Auth::check()) {\n return redirect('login');\n }\n\n return view('pages.createpost', ['needsFilter' => 0, 'tags'=>[]]);\n }", "public function create()\n {\n try {\n return view('post.create-post');\n } catch (\\Exception $e) {\n return abort(404);\n }\n\n }", "public function create()\n {\n $inputs = $this->validate([\n 'title' => 'required|min_length[5]',\n 'description' => 'required|min_length[5]',\n ]);\n\n if (!$inputs) {\n return view('posts/create', [\n 'validation' => $this->validator\n ]);\n }\n\n $this->post->save([\n 'title' => $this->request->getVar('title'),\n 'description' => $this->request->getVar('description')\n ]);\n session()->setFlashdata('success', 'Success! post created.');\n return redirect()->to(site_url('/posts'));\n }", "public function create()\n {\n\t\t$js = [Module::asset(\"metafields:js/post.js\")];\n\t\tView::share('js_script', $js);\n return view('metafields::backend.create',array(\"title\" => \"Create Metafield\"));\n }", "public function create()\n {\n return $this->postService->create();\n }", "function new_post($post){\n $this->newPost($post);\n }", "public function store()\n\t{\n\t\t\n\t\t$rules=[\n\t\t'titre'=>'required',\n\t\t'abstract'=>'required',\n\t\t'content'=>'required',\n\t\t];\n\n\t\t$userData=[\n\t\t'titre' => Input::get('titre'),\n\t\t'abstract' => Input::get('abstract'),\n\t\t'content' => Input::get('content'),\n\n\t\t];\n\n\t\t$validator=Validator::make($userData, $rules);\n\n\n\t\tif($validator->fails()){\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\n\t\t}else{\n\n\t\t\t$post = new Post;\n\n\t\t\t$args = array(\n\t\t\t\t'titre' => FILTER_SANITIZE_SPECIAL_CHARS,\n\t\t\t\t'abstract' => FILTER_SANITIZE_SPECIAL_CHARS,\n\t\t\t\t'content' => FILTER_SANITIZE_SPECIAL_CHARS,\n\t\t\t\t);\n\n\t\t\t$myinputs = filter_input_array(INPUT_POST, $args);\n\n\t\t\t$post->title=$myinputs['titre'];\n\t\t\t$post->abstract=$myinputs['abstract'];\n\t\t\t$post->content=$_POST['content'];\n\n\n\t\t\tif (Input::hasFile('photo'))\n\t\t\t{\n\n\t\t\t\tif (Input::file('photo')->isValid())\n\t\t\t\t{\n\n\t\t\t\t\t$destinationPath = '.'.DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'/images';\n\n\t\t\t\t\t$extention= Input::file('photo')->getClientOriginalExtension();\n\t\t\t\t\t($fileName=$this->upload()) or $fileName='';\n\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\tInput::file('photo')->move($destinationPath, $fileName.\".\".$extention);\n\t\t\t\t\t\tchmod($destinationPath.DIRECTORY_SEPARATOR.$fileName.\".\".$extention, 0777);\n\n\t\t\t\t\t} catch(Exception $e) { }\n\n\t\t\t\t\t$post->url_thumbnail=$fileName.\".\".$extention;\n\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$post->url_thumbnail=\"\";\t\t\t\n\t\t\t}\n\n\t\t\t$post->status='unpublish';\n\t\t\t$post->user_id=Auth::user()->id;\n\t\t\t$post->save();\n\n\t\t\tSession::flash('message', \"<p style='color:#01DF01;font-size:18px;text-align:center;'>Article ajouté</p>\");\n\t\t\treturn Redirect::to(\"admPost\");\n\n\t\t}\n\t}", "public function create() {\n\t\treturn view('post.create');\n\t}" ]
[ "0.738942", "0.7039857", "0.68104506", "0.6791263", "0.67362994", "0.67085475", "0.6657472", "0.66420287", "0.66184336", "0.66146517", "0.66137683", "0.6607518", "0.6598134", "0.6596656", "0.6584335", "0.6580934", "0.65526885", "0.65375274", "0.65375274", "0.65375274", "0.6525996", "0.64898324", "0.64868546", "0.6477057", "0.64727455", "0.6452223", "0.6446812", "0.643934", "0.64384747", "0.6435419" ]
0.7189276
1
/ This function is called on end of script execution to cancel all aborted transactions (if any)
function cancel_transaction() { global $transaction_level; if ($transaction_level) { db_query("ROLLBACK", "could not cancel a transaction"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cancel()\n {\n $this->_statement =null;\n }", "function abort() {\n $this->aborted = TRUE;\n }", "public function rollbackTransaction() {\r\n\t\t// TODO: Implement transaction stuff.\r\n\t\t//$this->query('ROLLBACK TRANSACTION');\r\n\t}", "public function cancel()\n\t{\n\t\t$this->pdoStatement = null;\n\t}", "function EndStartRun()\n {\n if ($this->transaction_in_progress) \n {\n $this->db->CompleteTrans();\n $this->transaction_in_progress =false;\n }\n }", "public final static function endTx() {\n // Fail due to calling endTx without initiating a transaction\n assert(self::$numTransactions > 0);\n\n // Track the number of transaction-close calls so we know when to\n // close the actual db transaction.\n --self::$numTransactions;\n\n // Short circuit so we wait to close the encapsulating transaction\n if (self::$numTransactions > 0) {\n return;\n }\n\n // Fail due to non-existant transaction\n assert(isset(self::$databaseHandle));\n\n try {\n // Conclude transaction\n self::$databaseHandle->commit();\n // Close connection \n self::$databaseHandle = null;\n } catch (PDOException $e) {\n self::$databaseHandle->rollback();\n die(\"\\nERROR: \" . $e->getMessage() . \"\\n\");\n }\n\n // Remove assets\n self::deleteAssets();\n\n // Invalidate prepared statement cache\n self::$fetchAllRecordsPreparedStatementCache = null;\n self::$deleteRecordPreparedStatementCache = null;\n self::$insertRecordPreparedStatementCache = null;\n self::$fetchRecordPreparedStatementsCacheTable = null;\n }", "function endTransaction()\r\n\t\t{\r\n\t\tif($this->transaction)\r\n\t\t\t{\r\n\t\t\t$this->transaction=FALSE;\r\n\t\t\t$this->query=\"COMMIT TRANSACTION\";\r\n\t\t\t$this->runQuery();\r\n\t\t\t}\r\n\t\t}", "public function rollbackTransaction() {\n\t\t//noop\n\t}", "public function rollBackTransaction()\r\n\t{\r\n\t\t$this->query(\"ROLLBACK TRANSACTION\");\r\n\t}", "private function rollback() {\n\t\tEE::warning( 'Exiting gracefully after rolling back. This may take some time.' );\n\t\tif ( $this->level > 0 ) {\n\t\t\t$this->delete_site();\n\t\t}\n\t\tEE::success( 'Rollback complete. Exiting now.' );\n\t\texit;\n\t}", "public function stop(): void\n {\n if ($this->conn->inTransaction()) {\n $this->conn->rollBack();\n }\n }", "function db_trans_stop($dbh) {\ndb_query(\"COMMIT;\",$dbh,\"\",\"\",\"\",\"Committing transaction\");\ndb_query(\"SET autocommit=1;\",$dbh,\"\",\"\",\"\",\"Setting auto commit to 1\");\ndb_query(\"SET FOREIGN_KEY_CHECKS = 1;\",$dbh,\"\",\"\",\"\",\"Enabling foreign key checks\");\n}", "protected static function rollbackTransaction()\n\t{\n\t\tAbstractUnit::rollbackTransaction();\n\t}", "public function transactionRollback()\n\t{\n\t\treturn;\n\t}", "function RollbackTrans() {}", "public function cancel();", "public function rollBack()\n {\n if ($this->transactionCount < 1) {\n return;\n }\n $transaction = $this->unprepared(\"ROLLBACK;\");\n if (false !== $transaction) {\n $this->transactionCount--;\n }\n }", "public function endTransaction()\n {\n $this->getDriver()->database->endTransaction();\n }", "public function rollback() {\n\t\t$this->execute(\"ROLLBACK; SET autocommit = 1;\");\n\t}", "protected function end_bulk_operation(){\n\t\twpcom_vip_end_bulk_operation();\n\t}", "public function abort(): void;", "public function rollback()\n{\n\t$this->query('ROLLBACK');\n}", "abstract protected function _quit_transaction( $commit );", "public function rollbackTransaction();", "public function rollback();", "public function rollback();", "public function rollback();", "public function rollback();", "public function __destruct()\n\t{\n\t\t$this->endTransactions(false);\n\t}", "protected function runTransactionDestroy()\n {\n $this->request->transaction->destroy(); /* Unlink the transaction file */\n unset($this->request->transaction); /* Destroy the pointer in memory */\n }" ]
[ "0.66715395", "0.6633", "0.6581906", "0.6556029", "0.651938", "0.6457377", "0.64570516", "0.6454393", "0.64411104", "0.638902", "0.63374186", "0.62721604", "0.62634933", "0.62581587", "0.6200545", "0.6199904", "0.6167491", "0.61636937", "0.6160573", "0.6159313", "0.6150514", "0.61485195", "0.6131492", "0.61197597", "0.6112525", "0.6112525", "0.6112525", "0.6112525", "0.61108035", "0.60910326" ]
0.68961
0
Sets a new entityKeyPrefix
public function setEntityKeyPrefix($entityKeyPrefix) { $this->entityKeyPrefix = $entityKeyPrefix; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prefixKey($prefix);", "public function setKeyPrefix($prefix)\n\t{\n\t\t$this->_redisKeyPrefix = $prefix;\n\t}", "public function setPrefix($prefix)\n {\n $this->idPrefix = $prefix;\n }", "public function setPrefix($prefix)\n\t{\n\t\tif (func_num_args() == 1) {\n\t\t\t$this->id_prefix = $prefix;\n\t\t} else {\n\t\t\t$args = func_get_args();\n\t\t\t$args = Arrays::castToType($args, 'string');\n\t\t\t$this->id_prefix = implode('.', $args);\n\t\t}\n\n\t\tif (substr($this->id_prefix, -1, 1) != '.') {\n\t\t\t$this->id_prefix .= '.';\n\t\t}\n\t}", "protected function setTablePrefix()\n {\n }", "public function prefixKey($prefix)\n {\n if (empty($this->key)) {\n $this->key = $prefix;\n } else {\n $this->key = $prefix . '.' . $this->key;\n }\n\n return $this;\n }", "public function setPrefix() {\n\t}", "public function setPrefix( $prefix );", "public static function setCacheKeyPrefix($cacheKeyPrefix)\n {\n static::$cacheKeyPrefix = $cacheKeyPrefix;\n }", "public function setPrefix($prefix);", "public function setPrefixKey($prefixKey)\n {\n return $this->setNamespace($prefixKey);\n }", "protected function setPrefix()\n {\n if (array_key_exists('prefix', $this->config)) {\n $this->prefix = $this->config['prefix'];\n }\n }", "public function setPrefixFromDB(){\n foreach($this->getTables() as $table){\n $prefix = explode('_', $table);\n if(isset($prefix[1])){\n if($this->prefix==$prefix[0]) break;\n else $this->prefix = $prefix[0];\n }\n }\n }", "public function setPrefix($prefix){\n\t\t$this->prefix = $prefix;\n\t}", "public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }", "public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }", "public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }", "public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }", "public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }", "public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }", "public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }", "public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }", "public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }", "public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }", "public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }", "public function setPrefix($prefix) {\n $this->prefix = $prefix;\n }", "public function setPrefix($prefix) {\n $this->prefix = $prefix;\n }", "public function setPrefix($prefix)\n {\n $this->prefix = $prefix;\n }", "public function setPrefix($prefix)\n {\n $this->prefix = $prefix;\n }", "public static function setTablePrefix($prefix)\n {\n }" ]
[ "0.69170266", "0.6827639", "0.6752836", "0.6727159", "0.6696086", "0.66696656", "0.6625726", "0.6598669", "0.63972265", "0.63609684", "0.635862", "0.6340957", "0.6340455", "0.62784034", "0.61900604", "0.61900604", "0.61900604", "0.61900604", "0.61900604", "0.61900604", "0.61900604", "0.61900604", "0.61900604", "0.61900604", "0.61900604", "0.61532366", "0.61532366", "0.6152534", "0.6152534", "0.6149955" ]
0.81922144
0
Sets a new entityType
public function setEntityType($entityType) { $this->entityType = $entityType; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setType(EntityType $type);", "public function setMappedEntityType($entity_type);", "public function setEntityType($var)\n {\n GPBUtil::checkString($var, True);\n $this->entity_type = $var;\n\n return $this;\n }", "public function getEntityType() {\n return $this->entityType;\n }", "public function setEntityClass($entityClass);", "public function setEntityClass(?string $entityClass);", "public function __construct(EntityTypeManagerInterface $entityType) {\n $this->entityType = $entityType;\n }", "function setEntity($entity_type, $entity_id) {\n $this->checkChange();\n\n // Ignore empty values.\n if (empty($entity_type) || empty($entity_id)) {\n return $this;\n }\n\n $this->entity_type = $entity_type;\n $this->entity_id = $entity_id;\n return $this;\n }", "private function setEntityTypeFromArray(array $input, string $key = 'entity-type'): void\n {\n $this->entityType = is_null($entityType = ArrayAccess::getString($input, $key))\n ? new EntityType()\n : new EntityType($entityType);\n }", "public function getEntityType();", "public function setEntityTypes($types) {\n $this->entity_types = $types;\n }", "public function setType($type) :ISEntity\n {\n array_walk($this->types, function($name, $index) use ($type) {\n if($type === $name){\n $this->type = $index;\n }\n });\n if(is_null($this->type)) {\n if(isset($this->types[$type])) {\n $this->type = $type;\n }\n }\n return $this;\n }", "public function getEntityType(): EntityType\n {\n return $this->entityType;\n }", "protected abstract function initializeEntityType(): string;", "public function __get($entityType)\n {\n return new Entity($this, $entityType);\n }", "public function setEntity($entity) {\n\t\tif ($entity instanceof Orm\\ActiveEntity) {\n\t\t\t$this->_entityInstance = $entity;\n\t\t\tlist($id) = $entity->getMetadata()->getIdFields();\n\t\t\t$this->setEntityId($entity->$id);\n\t\t\t$entity = get_class($entity);\n\t\t} elseif (is_string($entity)) {\n\t\t\tif (!class_exists($entity)) {\n\t\t\t\tthrow new Nette\\InvalidArgumentException(\"Class '$entity' does not exist!\");\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Nette\\InvalidArgumentException('You have to supply either an entity name or its instance!');\n\t\t}\n\t\t//parent::setEntity($entity);\n\t\t$this->defaultSetter('entity', $entity); // Because of PHP<5.3.4\n\t}", "function getEntityType() {\n return $this->entity_type;\n }", "public function setEntityTypeId($entityTypeId) {\n $this->entityTypeId = $entityTypeId;\n }", "public function getEntityType(): string\n {\n return $this->entityType;\n }", "public function setEntity( $entity )\n {\n \n $this->entity = $entity;\n \n }", "public function set($typeId, $class);", "public function getEntityType()\n {\n return $this->entity_type;\n }", "public function getEntityType()\n {\n return $this->entity_type;\n }", "public function setEntity(\\GoetasWebservices\\Client\\SalesforceEnterprise\\Sobject\\ContractType $entity)\n {\n $this->entity = $entity;\n return $this;\n }", "public function getEntityTypeId() {\n return $this->entityType->id();\n }", "public function getEntityType()\n\t{\n\t\treturn $this->entity_type;\n\t}", "public function __construct(EntityTypeManager $entityTypeManager) {\n $this->entityTypeManager = $entityTypeManager;\n }", "public function getEntityType() {\n return $this->datasource()->getEntityType();\n }", "function set_entity($ent){\n $this -> table = $ent;\n }", "public static function getRelatedEntityType(): EntityType\n {\n return new EntityType(EntityType::LABEL);\n }" ]
[ "0.7705399", "0.6784407", "0.64521676", "0.631977", "0.63128513", "0.62907165", "0.6183195", "0.61203974", "0.60822463", "0.6041833", "0.6012842", "0.5932546", "0.59062904", "0.58379114", "0.58357686", "0.58011335", "0.5795091", "0.5764072", "0.5761457", "0.57495964", "0.5670604", "0.5669103", "0.5669103", "0.56440544", "0.56137574", "0.5608982", "0.54829025", "0.53994614", "0.53627163", "0.53599346" ]
0.7270525
1
Update membership end date when subscription expiration date is changed
public function update_membership_end_date( $is_set, $expiration_date, $subscription_key ) { $user_memberships = $this->get_memberships_from_subscription( $subscription_key ); if ( ! $user_memberships ) { return; } foreach ( $user_memberships as $user_membership ) { $plan_id = $user_membership->get_plan_id(); if ( $plan_id && $this->plan_grants_access_while_subscription_active( $plan_id ) ) { $end_date = $expiration_date ? date( 'Y-m-d H:i:s', $expiration_date ) : ''; $user_membership->set_end_date( $end_date ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renewMembership(&$user){\n\t\t$dateEnd = $user->getSetting('dateEndMembership', 0);\n\t\tif (!$dateEnd) $dateEnd = 0;\n\t\t\n\t\t// if the membership is expired, extend it to today + 1 year\n\t\t$time = time();\n\t\tif ($dateEnd < $time ) $dateEnd = $time;\n\n\t\t$dateEnd = mktime(23, 59, 59, date(\"m\", $dateEnd), date(\"d\", $dateEnd), date(\"Y\", $dateEnd)+1);\n\t\t$user->updateSetting('dateEndMembership', $dateEnd, 'date', 0);\n\t}", "function _renewSubscription(&$subscription) {\n\t\tif ($subscription->isNonExpiring()) return;\n\n\t\t$subscriptionTypeDao =& DAORegistry::getDAO('SubscriptionTypeDAO');\n\t\t$subscriptionType =& $subscriptionTypeDao->getSubscriptionType($subscription->getTypeId());\n\n\t\t$duration = $subscriptionType->getDuration();\n\t\t$dateEnd = strtotime($subscription->getDateEnd());\n\n\t\t// if the subscription is expired, extend it to today + duration of subscription\n\t\t$time = time();\n\t\tif ($dateEnd < $time ) $dateEnd = $time;\n\n\t\t$subscription->setDateEnd(mktime(23, 59, 59, date(\"m\", $dateEnd)+$duration, date(\"d\", $dateEnd), date(\"Y\", $dateEnd)));\n\n\t\t// Reset reminder dates\n\t\t$subscription->setDateRemindedBefore(null);\n\t\t$subscription->setDateRemindedAfter(null);\n\n\t\t$this->updateSubscription($subscription);\n\t}", "private function _retrieveEndDate()\n {\n global $preferences;\n\n $bdate = new \\DateTime($this->_begin_date);\n if ( $preferences->pref_beg_membership != '' ) {\n //case beginning of membership\n list($j, $m) = explode('/', $preferences->pref_beg_membership);\n $edate = new \\DateTime($bdate->format('Y') . '-' . $m . '-' . $j);\n while ( $edate <= $bdate ) {\n $edate->modify('+1 year');\n }\n $this->_end_date = $edate->format('Y-m-d');\n } else if ( $preferences->pref_membership_ext != '' ) {\n //case membership extension\n $dext = new \\DateInterval('P' . $this->_extension . 'M');\n $edate = $bdate->add($dext);\n $this->_end_date = $edate->format('Y-m-d');\n }\n }", "function e20r_extend_enddate_by_duration( $enddate, $user_id, $level_obj, $startdate ) {\n\n //does this level expire? \n\tif(!empty($level_obj) && !empty($level_obj->expiration_number) )\n\t{\n\t\t//get the current enddate of their membership\n\t\t$membership_level = pmpro_getMembershipLevelForUser($user_id);\n\t\t$expiration_date = $membership_level->enddate;\n\t\t\n\t\t//calculate days left\n\t\t$todays_date = current_time('timestamp');\n\t\t$time_left = $expiration_date - $todays_date;\n\t\t\n\t\t//time left?\n\t\tif($time_left > 0)\n\t\t{\n\t\t\t//convert to days and add to the expiration date (assumes expiration was 1 year)\n\t\t\t$days_left = floor($time_left/(60*60*24));\n\t\t\t\n\t\t\t//figure out days based on period\n\t\t\tif($level_obj->expiration_period == \"Day\")\n\t\t\t\t$total_days = $days_left + $level_obj->expiration_number;\n\t\t\telseif($level_obj->expiration_period == \"Week\")\n\t\t\t\t$total_days = $days_left + $level_obj->expiration_number * 7;\n\t\t\telseif($level_obj->expiration_period == \"Month\")\n\t\t\t\t$total_days = $days_left + $level_obj->expiration_number * 30;\n\t\t\telseif($level_obj->expiration_period == \"Year\")\n\t\t\t\t$total_days = $days_left + $level_obj->expiration_number * 365;\n\t\t\t\n\t\t\t//update the end date\n\t\t\t$enddate = date(\"Y-m-d\", strtotime(\"+ $total_days Days\", $todays_date));\n\t\t}\n\t}\n\t\t\n\treturn $enddate;\n\n }", "function updateSubscriptionEndDate($subscription_start_date, $timePeriodForService) {\n $subscriptionEndDate = '';\n if ($timePeriodForService == \"1 Month\") {\n $timePeriod = \"1 month\";\n $subscriptionEndDate = date('Y-m-d',strtotime($subscription_start_date . \" + \". $timePeriod));\n } elseif ($timePeriodForService == \"3 months\" || $timePeriodForService == \"3 Months\"){ // Added as per discussion with Faizan CCP-5379\n $timePeriod = \"3 months\";\n $subscriptionEndDate = date('Y-m-d',strtotime($subscription_start_date . \" + \". $timePeriod));\n } elseif ($timePeriodForService == \"1 Year\" || ($timePeriodForService == '' || $timePeriodForService == null)) {\n $timePeriod = \"365 day\";\n $subscriptionEndDate = date('Y-m-d',strtotime($subscription_start_date . \" + \". $timePeriod));\n } elseif ($timePeriodForService == \"2 Years\") {\n $timePeriod = \"730 day\";\n $subscriptionEndDate = date('Y-m-d',strtotime($subscription_start_date . \" + \". $timePeriod));\n } elseif ($timePeriodForService == \"3 Years\") {\n $timePeriod = \"1095 day\";\n $subscriptionEndDate = date('Y-m-d',strtotime($subscription_start_date . \" + \". $timePeriod));\n }\n\n return $subscriptionEndDate;\n }", "function caculateUserMembershipEndDate($user_id)\n\t{\n\t\t//get user membership data\n\t\t$sql=\"SELECT B.timeline, A.purchase_date FROM \".$this->table.\" AS A\";\n\t\t$sql.=\" LEFT JOIN membership_level AS B ON B.id=A.membership_id\";\n\t\t$sql.=\" WHERE A.user_id=\".$user_id;\n\t\t\n\t\t$result=$this->db->query($sql);\n\t\t$user_data=$result->row();\n\n\t\t$start = date_timestamp_get(date_create($user_data->purchase_date));\n\t\t$end = $start + (3600*24*$user_data->timeline);\n\n\t\treturn date('Y-m-d', $end);\n\t}", "public function setEndDate(DrupalDateTime $end_date = NULL);", "protected function _actionEditsubscription( KCommandContext $context )\n {\n if( $subscription = $this->_subscriber->changeSubscriptionTo( $this->getItem() ) )\n {\n $subscription->endDate = $context->data->endDate;\n }\n }", "function lb_subscription_set_renewal_date($account, $subscription, $renewal_date) {\n // The $account that rules passes contains the original information, which may have\n // changed as a result of an action that has run.\n $entity = entity_load_single('user', $account->uid);\n $account_subscription_data = lb_subscription_retrieve_account_subscription_data($entity, $subscription);\n if ($account_subscription_data['delta'] === NULL) {\n lb_subscription_set_subscription($account, $subscription);\n $entity = entity_load_single('user', $account->uid);\n $account_subscription_data = lb_subscription_retrieve_account_subscription_data($entity, $subscription);\n }\n if ($account_subscription_data['delta'] !== NULL) {\n $entity->field_subscription[LANGUAGE_NONE][$account_subscription_data['delta']]['field_renewal_date'] = array(\n LANGUAGE_NONE => array(\n 0 => array(\n 'value' => $renewal_date,\n 'format' => NULL,\n 'safe_value' => $renewal_date,\n ),\n ),\n );\n entity_save('user', $entity);\n }\n}", "public function markAsExpired()\n {\n // Set subscription to end on next billing date\n $this->trialEndsAt = $this->trialEndsAt ? : $this->nextBillingDate;\n $this->endsAt = $this->nextBillingDate;\n\n return $this->save();\n }", "public function setNewSubscriptionExpireDate(int $userSubscriptionId, int $expiresAt);", "public function filter_rcp_member_renewal_expiration( $expiration, $subscription, $user_id ) {\n\t\t$base_date = current_time( 'timestamp' );\n\n\t\tif( $subscription->duration > 0 ) {\n\n\t\t\t$last_day = cal_days_in_month( CAL_GREGORIAN, date( 'n', $base_date ), date( 'Y', $base_date ) );\n\t\t\t$expiration = date( 'Y-m-d H:i:s', strtotime( '+' . $subscription->duration . ' ' . $subscription->duration_unit . ' 23:59:59', $base_date ) );\n\n\t\t\tif( date( 'j', $base_date ) == $last_day && 'day' != $subscription->duration_unit ) {\n\t\t\t\t$expiration = date( 'Y-m-d H:i:s', strtotime( $expiration . ' +2 days' ) );\n\t\t\t}\n\n\t\t} else {\n\t\t\t$expiration = 'none';\n\t\t}\n\n\t\treturn $expiration;\n\t}", "function acadp_listing_expiry_date( $post_id, $start_date = NULL ) {\n\n\t// Get number of days to add\n\t$general_settings = get_option( 'acadp_general_settings' );\n\t$days = apply_filters( 'acadp_listing_duration', $general_settings['listing_duration'], $post_id );\n\n\tif( $days <= 0 ) {\n\t\tupdate_post_meta( $post_id, 'never_expires', 1 );\n\t\t$days = 999;\n\t} else {\n\t\tdelete_post_meta( $post_id, 'never_expires' );\n\t}\n\n\tif( $start_date == NULL ) {\n\t\t// Current time\n\t\t$start_date = current_time( 'mysql' );\n\t}\n\n\t// Calculate new date\n\t$date = new DateTime( $start_date );\n\t$date->add( new DateInterval( \"P{$days}D\" ) );\n\n\t// return\n\treturn $date->format( 'Y-m-d H:i:s' );\n\n}", "private function _updateDeadline()\n {\n global $zdb;\n\n try {\n $due_date = self::getDueDate($this->_member);\n\n if ( $due_date != '' ) {\n $date_fin_update = $due_date;\n } else {\n $date_fin_update = new Expression('NULL');\n }\n\n $update = $zdb->update(Adherent::TABLE);\n $update->set(\n array('date_echeance' => $date_fin_update)\n )->where(\n Adherent::PK . '=' . $this->_member\n );\n $zdb->execute($update);\n return true;\n } catch (\\Exception $e) {\n Analog::log(\n 'An error occured updating member ' . $this->_member .\n '\\'s deadline |' .\n $e->getMessage(),\n Analog::ERROR\n );\n return false;\n }\n }", "public function getExpirationDate();", "public function setDateEnd($dateEnd)\n {\n $this->dateEnd = VT::toDateTimeImmutable($dateEnd);\n }", "public function membershipAction()\n {\n $common = $this->getServiceLocator()->get('Application\\Model\\Common');\n $api_url = $this->getServiceLocator()->get('config')['api_url']['value'];\n $data = array('status_id' => 1, 'subscription_end_date' => date('Y-m-d', strtotime('+2 days'))); // 2days before subscription end\n $results = $common->subscriptionData($api_url, $data);\n if (count($results) > 0) {\n foreach ($results as $detail) {\n // Start :- Auto renew subscription\n if ($detail['auto_renewal'] == '1') {\n $this->autorenewcodeAction($api_url,$common,$detail);\n // End :- Auto renew subscription\n } \n }\n }\n die;\n }", "function setEndDate($classId, $end) {\r\n $data['classEndDate'] = $end;\r\n $this->db->where('id', $classId);\r\n $this->db->update('class', $data);\r\n }", "function setEndDate($end_date = \"\") \n\t{\n\t\t$this->end_date = $end_date;\n\t}", "function releasePurchase($postdata) {\n \t \t\n \t$now = mktime();\n \t\n \t$sql = \"\n \t\tUPDATE \n \t\t\topm_products_accounts\n \t\tSET\n \t\t\tenddate = $now\n \t\twhere\n \t\t\tid = \" . intval($postdata['id']);\n \t\n \tif ($query = $this->db->query($sql)) {\n \t\t\n \t\tif ($this->db->affected_rows() == 1) {\n \t\t\t\n \t\t\treturn $now;\n \t\t\n \t\t}\n \t\n \t}\n \t\n \treturn false;\n \n }", "public function getExpirationDate()\n {\n return $this->user_expiration;\n }", "public function setEndDate($value)\n {\n $this->endDate = $value;\n }", "public function setExpirationDate(?Date $value): void {\n $this->getBackingStore()->set('expirationDate', $value);\n }", "public function away_mode_end_date() {\n\n\t\t$current = current_time( 'timestamp' ); //The current time\n\n\t\t//if saved date is in the past update it to something in the future\n\t\tif ( isset( $this->settings['end'] ) && isset( $this->settings['enabled'] ) && $current < $this->settings['end'] ) {\n\t\t\t$end = $this->settings['end'];\n\t\t} else {\n\t\t\t$end = strtotime( date( 'n/j/y 12:00 \\a\\m', ( current_time( 'timestamp' ) + ( 86400 * 2 ) ) ) );\n\t\t}\n\n\t\t//Date Field\n\t\t$content = '<input class=\"end_date_field\" type=\"text\" id=\"itsec_away_mode_end_date\" name=\"itsec_away_mode[away_end][date]\" value=\"' . date( 'm/d/y', $end ) . '\"/><br>';\n\t\t$content .= '<label class=\"end_date_field\" for=\"itsec_away_mode_end_date\"> ' . __( 'Set the date at which the admin dashboard should become available', 'it-l10n-ithemes-security-pro' ) . '</label>';\n\n\t\techo $content;\n\n\t}", "public function setExpirationDate(int $expiration_date);", "public function setEndDate(string $date);", "function _sf_set_spot_expiry_date($post) {\n\t\t\n\t\t///// FIRSTLY LET'S ADD A METABOX FOR OUR EXPIRY DATE\n\t\t$exp_date = time() + (ddp('submission_days') * (60*60*24));\n\t\t\n\t\t$midnight_time = $exp_date;\n\t\t\n\t\tupdate_post_meta($post->ID, 'expiry_date', $midnight_time);\n\t\t\n\t\t///// SETS UP OUR CRON JOB\n\t\twp_schedule_single_event($midnight_time, 'expire_spot_submission', array($post->ID, $post->post_title, $post->post_author, ''.$midnight_time.''));\n\t\t\n\t}", "public function endMaintenancePeriod() : void\n {\n $this->getHesAdminDb()->update('\n UPDATE maintenance_periods SET end_time = now() WHERE end_time IS NULL\n ');\n }", "private function setExpiryDate(Session $session, \\DateInterval $dateInterval)\n {\n if (is_null($session->getSubscribeExpireDate())) {\n /** @var \\DateTime */\n $examDate = $session->getDatetime();\n $expiryDate = (clone $examDate)->sub($dateInterval);\n $session->setSubscribeExpireDate($expiryDate);\n }\n }", "function setExpireDate($ed) {\n\t\tif ($ed) {\n\t\t\t$newtime = dateTimeConvert($ed);\n\t\t\tif ($newtime === false) return;\n\t\t\t$this->set('expiredate', $newtime);\n\t\t} else {\n\t\t\t$this->set('expiredate', NULL);\n\t\t}\n\t}" ]
[ "0.70345396", "0.6584539", "0.6440476", "0.6289389", "0.61278355", "0.6068972", "0.59100837", "0.5908071", "0.5857778", "0.57571006", "0.56894684", "0.5610006", "0.5559061", "0.55220616", "0.5509971", "0.5506381", "0.5491396", "0.54852813", "0.54703873", "0.54534024", "0.54524523", "0.5442479", "0.5438378", "0.5427428", "0.5405188", "0.5373417", "0.5365003", "0.5342781", "0.533939", "0.5332479" ]
0.74767065
0
Get a Subscription by order_id and product_id
public function get_order_product_subscription( $order_id, $product_id ) { $subscription_key = WC_Subscriptions_Manager::get_subscription_key( $order_id, $product_id ); $subscription = WC_Subscriptions_Manager::get_subscription( $subscription_key ); return $subscription; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wcs_get_subscriptions_for_product( $product_ids, $fields = 'ids' ) {\n\tglobal $wpdb;\n\n\t// If we have an array of IDs, convert them to a comma separated list and sanatise them to make sure they're all integers\n\tif ( is_array( $product_ids ) ) {\n\t\t$ids_for_query = implode( \"', '\", array_map( 'absint', array_unique( array_filter( $product_ids ) ) ) );\n\t} else {\n\t\t$ids_for_query = absint( $product_ids );\n\t}\n\n\t$subscription_ids = $wpdb->get_col( \"\n\t\tSELECT DISTINCT order_items.order_id FROM {$wpdb->prefix}woocommerce_order_items as order_items\n\t\t\tLEFT JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS itemmeta ON order_items.order_item_id = itemmeta.order_item_id\n\t\t\tLEFT JOIN {$wpdb->posts} AS posts ON order_items.order_id = posts.ID\n\t\tWHERE posts.post_type = 'shop_subscription'\n\t\t\tAND itemmeta.meta_value IN ( '\" . $ids_for_query . \"' )\n\t\t\tAND itemmeta.meta_key IN ( '_variation_id', '_product_id' )\"\n\t);\n\n\t$subscriptions = array();\n\n\tforeach ( $subscription_ids as $post_id ) {\n\t\t$subscriptions[ $post_id ] = ( 'ids' !== $fields ) ? wcs_get_subscription( $post_id ) : $post_id;\n\t}\n\n\treturn apply_filters( 'woocommerce_subscriptions_for_product', $subscriptions, $product_ids, $fields );\n}", "public function getSubscriptionById($id_subscription) {\n $this->db->where('ID_SUBSCRIPTION', $id_subscription);\n $query = $this->db->get($this->table);\n return $query->row();\n}", "public static function getSubscriptionProductsList() {\n $sku = array();\n $query = db_select('commerce_product', 'cp');\n $query->fields('cp', array('sku'));\n $query->leftJoin('field_data_field_product', 'pr', 'cp.product_id = pr.entity_id');\n $query->condition('pr.bundle', 'subscription', '=');\n $result = $query->execute();\n while ($product = $result->fetchAssoc()) {\n $sku[] = $product['sku'];\n }\n return new Response(TRUE, $sku, NULL);\n }", "public function getSubscriptionWithId(int $subscriptionId);", "function wcs_get_subscription( $the_subscription ) {\n\n\tif ( is_object( $the_subscription ) && wcs_is_subscription( $the_subscription ) ) {\n\t\t$the_subscription = $the_subscription->get_id();\n\t}\n\n\t$subscription = WC()->order_factory->get_order( $the_subscription );\n\n\tif ( ! wcs_is_subscription( $subscription ) ) {\n\t\t$subscription = false;\n\t}\n\n\treturn apply_filters( 'wcs_get_subscription', $subscription );\n}", "protected function createBasicSubscriptionAndOrder() {\n $subscription = Subscription::create([\n 'type' => 'product_variation',\n 'store_id' => $this->store->id(),\n 'billing_schedule' => $this->billingSchedule,\n 'uid' => $this->user,\n 'payment_method' => $this->paymentMethod,\n 'purchased_entity' => $this->variation,\n 'title' => $this->variation->getOrderItemTitle(),\n 'unit_price' => new Price('2', 'USD'),\n 'state' => 'pending',\n 'starts' => \\Drupal::time()->getRequestTime() - 5,\n 'ends' => \\Drupal::time()->getRequestTime() + 1000,\n ]);\n $subscription->save();\n\n $order_storage = \\Drupal::entityTypeManager()->getStorage('commerce_order');\n $result = $order_storage->getQuery()\n ->condition('type', 'recurring')\n ->pager(1)\n ->execute();\n $this->assertEmpty($result);\n\n $subscription->getState()->applyTransition($subscription->getState()->getTransitions()['activate']);\n $subscription->save();\n\n $orders = $order_storage->loadMultiple($order_storage->getQuery()\n ->condition('type', 'recurring')\n ->execute());\n $this->assertCount(1, $orders);\n $order = reset($orders);\n\n return [$subscription, $order];\n }", "function wcs_get_subscriptions( $args ) {\n\tglobal $wpdb;\n\n\t$args = wp_parse_args( $args, array(\n\t\t\t'subscriptions_per_page' => 10,\n\t\t\t'paged' => 1,\n\t\t\t'offset' => 0,\n\t\t\t'orderby' => 'start_date',\n\t\t\t'order' => 'DESC',\n\t\t\t'customer_id' => 0,\n\t\t\t'product_id' => 0,\n\t\t\t'variation_id' => 0,\n\t\t\t'order_id' => 0,\n\t\t\t'subscription_status' => array( 'any' ),\n\t\t\t'meta_query_relation' => 'AND',\n\t\t)\n\t);\n\n\t// if order_id is not a shop_order\n\tif ( 0 !== $args['order_id'] && 'shop_order' !== get_post_type( $args['order_id'] ) ) {\n\t\treturn array();\n\t}\n\n\t// Ensure subscription_status is an array.\n\t$args['subscription_status'] = $args['subscription_status'] ? (array) $args['subscription_status'] : array();\n\n\t// Grab the native post stati, removing pending and adding any.\n\t$builtin = get_post_stati( array( '_builtin' => true ) );\n\tunset( $builtin['pending'] );\n\t$builtin['any'] = 'any';\n\n\t// Make sure status starts with 'wc-'\n\tforeach ( $args['subscription_status'] as &$status ) {\n\t\tif ( isset( $builtin[ $status ] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$status = wcs_sanitize_subscription_status_key( $status );\n\t}\n\n\t// Prepare the args for WP_Query\n\t$query_args = array(\n\t\t'post_type' => 'shop_subscription',\n\t\t'post_status' => $args['subscription_status'],\n\t\t'posts_per_page' => $args['subscriptions_per_page'],\n\t\t'paged' => $args['paged'],\n\t\t'offset' => $args['offset'],\n\t\t'order' => $args['order'],\n\t\t'fields' => 'ids',\n\t\t'meta_query' => isset( $args['meta_query'] ) ? $args['meta_query'] : array(), // just in case we need to filter or order by meta values later\n\t);\n\n\t// Maybe only get subscriptions created by a certain order\n\tif ( 0 != $args['order_id'] && is_numeric( $args['order_id'] ) ) {\n\t\t$query_args['post_parent'] = $args['order_id'];\n\t}\n\n\t// Map subscription specific orderby values to internal/WordPress keys\n\tswitch ( $args['orderby'] ) {\n\t\tcase 'status' :\n\t\t\t$query_args['orderby'] = 'post_status';\n\t\t\tbreak;\n\t\tcase 'start_date' :\n\t\t\t$query_args['orderby'] = 'date';\n\t\t\tbreak;\n\t\tcase 'trial_end_date' :\n\t\tcase 'end_date' :\n\t\t\t// We need to orderby post meta value: http://www.paulund.co.uk/order-meta-query\n\t\t\t$date_type = str_replace( '_date', '', $args['orderby'] );\n\t\t\t$query_args = array_merge( $query_args, array(\n\t\t\t\t'orderby' => 'meta_value',\n\t\t\t\t'meta_key' => wcs_get_date_meta_key( $date_type ),\n\t\t\t\t'meta_type' => 'DATETIME',\n\t\t\t) );\n\t\t\t$query_args['meta_query'][] = array(\n\t\t\t\t'key' => wcs_get_date_meta_key( $date_type ),\n\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t'type' => 'DATETIME',\n\t\t\t);\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t$query_args['orderby'] = $args['orderby'];\n\t\t\tbreak;\n\t}\n\n\t// Maybe filter to a specific user\n\tif ( 0 != $args['customer_id'] && is_numeric( $args['customer_id'] ) ) {\n\t\t$query_args['meta_query'][] = array(\n\t\t\t'key' => '_customer_user',\n\t\t\t'value' => $args['customer_id'],\n\t\t\t'type' => 'numeric',\n\t\t\t'compare' => ( is_array( $args['customer_id'] ) ) ? 'IN' : '=',\n\t\t);\n\t};\n\n\t// We need to restrict subscriptions to those which contain a certain product/variation\n\tif ( ( 0 != $args['product_id'] && is_numeric( $args['product_id'] ) ) || ( 0 != $args['variation_id'] && is_numeric( $args['variation_id'] ) ) ) {\n\t\t$query_args['post__in'] = wcs_get_subscriptions_for_product( array( $args['product_id'], $args['variation_id'] ) );\n\t}\n\n\tif ( ! empty( $query_args['meta_query'] ) ) {\n\t\t$query_args['meta_query']['relation'] = $args['meta_query_relation'];\n\t}\n\n\t$query_args = apply_filters( 'woocommerce_get_subscriptions_query_args', $query_args, $args );\n\n\t$subscription_post_ids = get_posts( $query_args );\n\n\t$subscriptions = array();\n\n\tforeach ( $subscription_post_ids as $post_id ) {\n\t\t$subscriptions[ $post_id ] = wcs_get_subscription( $post_id );\n\t}\n\n\treturn apply_filters( 'woocommerce_got_subscriptions', $subscriptions, $args );\n}", "public function getProduct()\n {\n return $this->getSubscription()->getProduct();\n }", "public static function searchOrderFilter(Request $request, $order_id) {\n\n if(strpos($order_id, 'tip') !== false) {\n\n }\n else {\n $subscription = Subscription::where('subscription_id', $order_id)->firstOrFail();\n if ($subscription) {\n\n $subscription['UNITPAY_orderSum'] = $subscription->subscription_price; // from your database\n $subscription['UNITPAY_orderCurrency'] = 'RUB'; // from your database\n\n // if the current_order is already paid in your database, return strict \"paid\";\n // if not, return something else\n if($subscription->status == 'Active')\n $status = 'paid';\n else\n $status = $subscription->status;\n $subscription['UNITPAY_orderStatus'] = $status;//$subscription->staus; // from your database\n\n return $subscription;\n }\n }\n\n return false;\n }", "function _recurring_globalcollect_get_subscription_by_order_id($order_id) {\n\n // Only return records if an order_id is given.\n if ( empty( $order_id ) ) {\n return false;\n }\n $order_id = intval( $order_id );\n\n // make sure we're using the default (civicrm) db\n $dbs = wmf_civicrm_get_dbs();\n $dbs->push( 'civicrm' );\n\n $query = <<<EOS\nSELECT\n civicrm_contribution_recur.*, civicrm_contact.display_name\nFROM civicrm_contribution_recur\nLEFT JOIN civicrm_contact ON\n civicrm_contribution_recur.contact_id = civicrm_contact.id\nWHERE\n civicrm_contribution_recur.trxn_id = CONCAT_WS( ' ', 'RECURRING GLOBALCOLLECT', :order_id )\n OR civicrm_contribution_recur.trxn_id LIKE CONCAT_WS( ' ', 'RECURRING GLOBALCOLLECT', :order_id, '%' )\nLIMIT 1\nEOS;\n\n $result = db_query( $query, array( ':order_id' => $order_id ) )->fetch();\n\n $record = is_object( $result ) ? (array) $result : false;\n\n return $record;\n}", "public function get_all_subscription_products(){\n\t\t\n\t\t$args = array(\n\t\t\t'type' => 'subscription',\n\t\t);\n\t\t$products = wc_get_products( $args );\n\t\treturn $products;\n \n\t}", "public function getSubscription($request);", "public function getProduct($id)\n {\n }", "public function get_order_from_recurly_subscription( $subscription ){\n\n\t\tglobal $wpdb;\n\n\t\t$sql = $wpdb->prepare( \"select * from wp_mequoda_orders where recurly_uuid = %s ORDER BY order_time\", $subscription );\n\n\t\t$orders = $wpdb->get_results( $sql );\n\n\t\treturn $orders;\n\n\t}", "public static function getorderProduct()\n {\n \n $value=DB::table('product_checkout')->join('users','users.id','product_checkout.user_id')->orderBy('product_checkout.cid', 'desc')->get(); \n return $value;\n\t\n }", "protected function order_contains_subscription( $order ) {\n\t\treturn WC_Subscriptions_Order::order_contains_subscription( $order );\n\t}", "public function getProductById(int $id);", "function find_by_account_id_and_product_id($account_id, $product_id)\r\n\t{\r\n\t\treturn $this->find_by_field_array(array('account_id' => $account_id, 'product_id' => $product_id));\r\n\t}", "public function subscription($userId)\n\t{\n\t\ttry\n\t\t{\n\t\t\treturn $this->db->table(Config::get('throttle::tables.subscriptions'))\n\t\t\t\t->where('user_id', $userId)\n\t\t\t\t->where('is_active', '1')\n\t\t\t\t->select('id', 'user_id', 'plan_id', 'subscribed_at')\n\t\t\t\t->first();\n\t\t}\n\t\tcatch(PDOException $e)\n\t\t{\n\t\t\tthrow new Exceptions\\InternalException;\n\t\t}\n\t}", "public function activated_subscription( $order ) {\n\n\t\t// set properties\n\t\t$properties = apply_filters( 'wc_kissmetrics_activated_subscription_properties',\n\t\t\tarray(\n\t\t\t\t'subscription_name' => WC_Subscriptions_Order::get_item_name( $order ),\n\t\t\t\t'total_initial_payment' => WC_Subscriptions_Order::get_total_initial_payment( $order ),\n\t\t\t\t'initial_sign_up_fee' => WC_Subscriptions_Order::get_sign_up_fee( $order ),\n\t\t\t\t'subscription_period' => WC_Subscriptions_Order::get_subscription_period( $order ),\n\t\t\t\t'subscription_interval' => WC_Subscriptions_Order::get_subscription_interval( $order ),\n\t\t\t\t'subscription_length' => WC_Subscriptions_Order::get_subscription_length( $order ),\n\t\t\t\t'subscription_trial_period' => WC_Subscriptions_Order::get_subscription_trial_period( $order ),\n\t\t\t\t'subscription_trial_length' => WC_Subscriptions_Order::get_subscription_trial_length( $order )\n\t\t\t), $order, $this\n\t\t);\n\n\t\t// record event\n\t\t$this->api_record_event( $this->event_name['activated_subscription'],\n\t\t\tarray(\n\t\t\t\t$this->property_name['subscription_name'] => $properties['subscription_name'],\n\t\t\t\t$this->property_name['total_initial_payment'] => $properties['total_initial_payment'],\n\t\t\t\t$this->property_name['initial_sign_up_fee'] => $properties['initial_sign_up_fee'],\n\t\t\t\t$this->property_name['subscription_period'] => $properties['subscription_period'],\n\t\t\t\t$this->property_name['subscription_interval'] => $properties['subscription_period'],\n\t\t\t\t$this->property_name['subscription_length'] => $properties['subscription_interval'],\n\t\t\t\t$this->property_name['subscription_trial_period'] => $properties['subscription_trial_period'],\n\t\t\t\t$this->property_name['subscription_trial_length'] => $properties['subscription_trial_length'],\n\t\t\t),\n\t\t\t$this->get_identity( $order->user_id )\n\t\t);\n\n\t}", "public function complete(int $id, SubscriptionProductContract $product, SubscriptionConsumerContract $consumer = null){\n\t\t$login = array_get($this->config, 'login');\n\t\t$key = array_get($this->config, 'key');\n\t\t$hash = md5(sprintf(\"%s^x_login^x_fp_arg_list^x_fp_sequence^x_amount^x_currency_code^%s^%s^USD^%s\", $login, $id, $product->getPrice(), $key));\n\n\t\t$frequency = $product->getFrequency();\n\t\t$recurrence = $product->getRecurrence();\n\n\t\t$params = [\n\t\t\t'x_version'=>'1.0',\n\t\t\t'x_fp_arg_list'=>'x_login^x_fp_arg_list^x_fp_sequence^x_amount^x_currency_code',\n\t\t\t'x_currency_code'=>'USD',\n\t\t\t'x_method'=>'CC',\n\t\t\t'x_shipping_amount'=>'0.00',\n\t\t\t'x_subscription_type'=>'A',\n\t\t\t'x_login'=>array_get($this->config, 'login'),\n\t\t\t'x_fp_sequence'=>$id,\n\t\t\t'x_invoice_num'=>$id,\n\t\t\t'x_ship_to_name'=>$consumer->getName(),\n\t\t\t'x_ship_to_address'=>$consumer->getAddress(),\n\t\t\t'x_ship_to_address2'=>'',\n\t\t\t'x_ship_to_city'=>$consumer->getCity(),\n\t\t\t'x_ship_to_state'=>$consumer->getState(),\n\t\t\t'x_ship_to_zip'=>$consumer->getZip(),\n\t\t\t'x_ship_to_country'=>$consumer->getCountry(),\n\t\t\t'x_ship_to_phone'=>$consumer->getPhone(),\n\t\t\t'x_email'=>$consumer->getEmail(),\n\t\t\t'x_product_sku_1'=>$id,\n\t\t\t'x_product_title_1'=>$product->getTitle(),\n\t\t\t'x_product_quantity_1'=>'1',\n\t\t\t'x_product_unitprice_1'=>$product->getPrice(),\n\t\t\t'x_product_url_1'=>array_get($this->config, 'url'),\n\t\t\t'x_amount'=>$product->getPrice(),\n\t\t\t'x_subscription_freq'=>($recurrence=='month') ? sprintf('%sM', $frequency) : (($recurrence=='year') ? sprintf('%sY', $frequency):''),\n\t\t\t'x_fp_hash'=>$hash\n\t\t];\n\n\t\t$url = sprintf('https://www.ccnow.com/cgi-local/transact.cgi?%s', http_build_query($params));\t\t\t\n\t\treturn redirect()->away($url);\n\t}", "function InfGetRecurringOrders($inf_contact_id, $inf_product_id = 0) {\n\t$object_type = \"RecurringOrder\";\n\t$class_name = \"Infusionsoft_\" . $object_type;\n\t$object = new $class_name();\n\t\n\t$search_data['ContactId'] = $inf_contact_id;\n\t$search_data['Status'] = \"Active\";\n\tif ($inf_product_id) {\n\t\t$search_data['ProductId'] = $inf_product_id;\n\t}\n\t\n\t$objects = Infusionsoft_DataService::query(new $class_name(), $search_data);\n\n $subscriptions_array = array();\n foreach ($objects as $i => $object) {\n\t\t// Give it a userful index, ie, inf_sub_id\n\t\t$array = $object->toArray();\n $subscriptions_array[$array['Id']] = $array;\n }\n\treturn $subscriptions_array;\n}", "public function getProduct($id = 0, $next = 0, $pres = 0) {\t\t\t\t\n\t\t\n\t\t// set select from param\t\t\n\t\t$product = Product::find($id);\t\t\n\t\t$presId = Product::where('id', '<', $id)->where('is_active', '=', 1)->max('id');\t\t\n\t\t$nextId = Product::where('id', '>', $id)->where('is_active', '=', 1)->min('id');\t\t\t\t\t\t\t\n\t\t\n\t\tif(!empty($product))\n\t\t$returnJSON['product'] = $product->toArray();\n\t\t$returnJSON['presId'] = $presId;\n\t\t$returnJSON['nextId'] = $nextId;\n\n\t\treturn Response::json($returnJSON);\n\t}", "function get_product_by_id($product_id) {\r\n try {\r\n $params[0] = array(\"name\" => \":prod_id\", \"value\" => &$product_id);\r\n return $this->DBObject->readCursor(\"product_actions.get_product_by_id(:prod_id)\", $params);\r\n } catch (Exception $ex) {\r\n echo \">>\" . ex;\r\n }\r\n }", "public function subscription($subscription = 'default')\n {\n return $this->subscriptions->sortByDesc(function ($value) {\n return $value->created_at->getTimestamp();\n })->first(function ($value) use ($subscription) {\n return $value->name === $subscription;\n });\n }", "public function getSubscriptionByReference(string $subscription_reference): SubscriptionInterface;", "function get_product($product_id){\n\t\t\n\t\treturn $this->_make_api_call($product_id,'products');\n\t}", "function getOrderProducts($order_id){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn \t-> prepare('SELECT *\n\t\t\t\t\t\t\t\t\t\tFROM `order_products`\n\t\t\t\t\t\t\t\t\t\tWHERE `order_id` = ? ');\n\t\t$sth \t-> execute(array($order_id));\n\t\treturn \t$sth;\n\t}", "public function getProduct();", "public function retrieveSubscription() {\n // Adrian: Get user subscription details from the database\n /**$subscription = Subscription::where('user_id', $this->model->id)\n ->where('plan_id', $this->plan)\n ->first();**/\n\n $result = ChargeBee_Subscription::retrieve($this->user->subscription_id);\n\n return $result;\n }" ]
[ "0.6971286", "0.6262788", "0.6170137", "0.6138212", "0.61123526", "0.60727227", "0.5949016", "0.59223175", "0.58436775", "0.58203864", "0.5770421", "0.5740939", "0.5735021", "0.57200074", "0.5719754", "0.5700169", "0.56704336", "0.56655544", "0.5649731", "0.56309545", "0.5626783", "0.5614822", "0.5610455", "0.5596599", "0.5591872", "0.5578425", "0.5539277", "0.55375874", "0.55134684", "0.5482285" ]
0.6532087
1
Get user memberships by subscription key
public function get_memberships_from_subscription( $subscription_key ) { $user_memberships = array(); $user_membership_ids = new WP_Query( array( 'post_type' => 'wc_user_membership', 'post_status' => array_keys( wc_memberships_get_user_membership_statuses() ), 'fields' => 'ids', 'nopaging' => true, 'suppress_filters' => 1, 'meta_query' => array( array( 'key' => '_subscription_key', 'value' => $subscription_key, ), ), ) ); if ( ! empty( $user_membership_ids->posts ) ) { $user_memberships = array(); foreach ( $user_membership_ids->posts as $user_membership_id ) { $user_memberships[] = wc_memberships_get_user_membership( $user_membership_id ); } } return $user_memberships; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getSubscription()\n {\n $members = [];\n $page = 1;\n while(count($members) > 0 || $page === 1) {\n $members = $this->mangopay->listUsers($page);\n foreach ($members as $member) {\n if ($member->Email === 'user-vip@prono-bet.com') {\n // check wallet\n $wallets = $this->mangopay->listWallets($member->Id);\n foreach ($wallets as $wallet) {\n if ($wallet->Balance->Amount > 10) {\n $this->createUserSubscription($member->Id, $wallet);\n return true;\n }\n }\n }\n }\n $page++;\n }\n\n return false;\n }", "public function getUserIdsWithSubscriptionId(int $subscriptionId);", "public function getSubscription($key)\n {\n // check if key is string and not empty\n if (empty($key) || !is_string($key)) {\n require_once 'Zend/Feed/Pubsubhubbub/Exception.php';\n throw new Zend_Feed_Pubsubhubbub_Exception(\n 'Invalid parameter \"key\"' .\n ' of \"' .\n $key .\n '\" must be a non-empty string'\n );\n }\n\n // generate uri with subscription id\n $subscriptionResourceUri = $this->_generateSubscriptionResourceUri(\n $this->_subscriptionConfig->get('classUri'),\n $key\n );\n\n // get the subscription as OntoWiki resource\n $subscriptionResource = new OntoWiki_Model_Resource(\n $this->_selectedModelInstance->getStore(),\n $this->_selectedModelInstance,\n $subscriptionResourceUri\n );\n\n // get all properties of the subscription\n $subscriptionResourceProperties = $subscriptionResource->getValues();\n\n // if the subscription had proberties\n if (0 < count($subscriptionResourceProperties)) {\n $modelIri = $this->_selectedModelInstance->getModelIri();\n $subscriptionResourceProperties = $subscriptionResourceProperties[$modelIri];\n\n // init subscriber data array an save the proberties plain\n $data = array();\n $data['resourceProperties'] = $subscriptionResourceProperties;\n // fill the subscriber data array with the subscription resource content\n foreach ($this->_propertyMatching as $dataKey => $propertyKey) {\n // get property content\n $propertyUri = $this->_subscriptionConfig->get($propertyKey);\n $propertyArray = isset($subscriptionResourceProperties[$propertyUri]) ?\n $subscriptionResourceProperties[$propertyUri] :\n null;\n\n // if property content exists write it to the subscriber data array\n if (isset($propertyArray) && \"\" != $propertyArray[0]['content']) {\n $data[$dataKey] = $propertyArray[0]['content'];\n } else {\n $data[$dataKey] = null;\n }\n }\n return $data;\n }\n return false;\n }", "function get_profiles_for_subscription( $action_key, $role = '', $status = '' ) {\n\t\tif( !( $users = get_transient( '_um_mailchimp_users_' . $action_key . '_' . $role . '_' . $status ) ) ) {\n\t\t\t//get all users with selected role and status\n\t\t\t$args = array(\n\t\t\t\t'fields' => array( 'user_email', 'ID' )\n\t\t\t);\n\n\t\t\tif ( ! empty( $role ) ) {\n\t\t\t\t$args['role'] = $role;\n\t\t\t}\n\n\t\t\tif ( ! empty( $status ) ) {\n\t\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t'key' => 'account_status',\n\t\t\t\t\t'value' => $status,\n\t\t\t\t\t'compare' => '=',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$query_users = new \\WP_User_Query( $args );\n\t\t\t$users = $query_users->get_results();\n\n\t\t\t//set users list cache\n\t\t\tset_transient( '_um_mailchimp_users_' . $action_key . '_' . $role . '_' . $status, $users, 24 * 3600 );\n\t\t}\n\t\treturn $users;\n\t}", "public function _list() {\n\t\t// assign user based on api key\n\t\tif (empty($this->params[0])) {\n\t\t\t$json = [\n\t\t\t\t'error' => 'No channel specified'\n\t\t\t];\n\t\t\treturn $json;\n\t\t}\n\t\t$account = filter_var($this->params[0], FILTER_SANITIZE_STRING);\n\t\t$params = array($account);\n\t\t$sql = \"SELECT * FROM \" . $this->db->sub_table . \" WHERE subscriber = $1 OR host_account = $1\";\n\t\t$result = pg_query_params($this->db->link, $sql, $params);\n\t\t$subscribed = [];\n\t\t$subscribers = [];\n\t\twhile ($row = pg_fetch_assoc($result)) {\n\t\t\tif ($row['host_account'] === $account) {\n\t\t\t\t$subscribers[] = $row['subscriber'];\n\t\t\t} \n\t\t\tif ($row['subscriber'] === $account) {\n\t\t\t\t$subscribed[] = $row['host_account'];\n\t\t\t}\n\t\t}\n\t\t$json = [\n\t\t\t'subscribed' => $subscribed,\n\t\t\t'subscribers' => $subscribers\n\t\t];\n\t\treturn json_encode($json);\n\t}", "public function get_subscriptions_from_uid($uid) {\r\n $query = '\r\n -- get sections where the user is subcribed\r\n SELECT user_subscr.sid\r\n FROM user_subscr INNER JOIN user ON user.uid=user_subscr.uid\r\n WHERE user.uid=:uid;\r\n ';\r\n return $this->dbh->fetch_list($query, [ ':uid' => $uid ]);\r\n }", "public function getSubscriptions() {\n\t\t$urlSubscriptions = \"http://www.reddit.com/reddits/mine.json\";\n\t\treturn $this->runCurl ( $urlSubscriptions );\n\t}", "public function get_invited_users( $subscription_id ){\n return pms_get_member_subscription_meta( $subscription_id, 'pms_gm_invited_emails' );\n }", "function &getSubscribedUsers($journalId, $rangeInfo = null) {\n\t\t$result =& $this->retrieveRange(\n\t\t\t'SELECT\tu.*\n\t\t\tFROM\tsubscriptions s,\n\t\t\t\tsubscription_types st,\n\t\t\t\tusers u\n\t\t\tWHERE\ts.type_id = st.type_id AND\n\t\t\t\tst.institutional = 1 AND\n\t\t\t\ts.user_id = u.user_id AND\n\t\t\t\ts.journal_id = ?\n\t\t\tORDER BY u.last_name ASC, s.subscription_id',\n\t\t\tarray((int) $journalId),\n\t\t\t$rangeInfo\n\t\t);\n\n\t\t$userDao =& DAORegistry::getDAO('UserDAO');\n\t\t$returner = new DAOResultFactory($result, $userDao, '_returnUserFromRow');\n\n\t\treturn $returner;\n\t}", "public static function getSubscribedProfiles()\n\t{\n\n\t\treturn self::where('status', '=', 'subscribed');\n\n\t}", "public function memberships_get()\n {\n\n $em = $this->doctrine->em;\n\n $maembershipRepo = $em->getRepository('Entities\\Membership');\n $memberships = $maembershipRepo->findAll();\n $result[\"desc\"] = \"Listado de membresias\";\n $result[\"data\"] = $memberships;\n $this->set_response($result, REST_Controller::HTTP_OK);\n }", "public function getSubscriptionKey() { return $this->subscriptionKey; }", "public function getUserSubscriptionWithId(int $userSubscriptionId);", "function lobby_membersapi_getMemberships($args)\r\n{\r\n\t$uid = (int)$args['uid'];\r\n\tif ($uid == 0) {\r\n\t\treturn false;\r\n\t} else {\r\n\t \t$tables = pnDBGetTables();\r\n\t \t$column = $tables['lobby_members_column'];\r\n\t \t$where = $column['uid'].\" = '\".$uid.\"'\";\r\n\t\t$result = DBUtil::selectObjectArray('lobby_members',$where);\r\n\t\t$r = array();\r\n\t\tforeach ($result as $item) {\r\n\t\t\t$r[]=$item['gid'];\r\n\t\t}\r\n\t\treturn $r;\r\n\t}\r\n}", "public function getSubscriptionWithId(int $subscriptionId);", "function getSubscriptions ()\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['cms_manager_url']}/resources/subscriptions.json\",array(),'json');\n return $this->createResponse($result,'get My Subscriptions');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "public function membershipAction()\n {\n $common = $this->getServiceLocator()->get('Application\\Model\\Common');\n $api_url = $this->getServiceLocator()->get('config')['api_url']['value'];\n $data = array('status_id' => 1, 'subscription_end_date' => date('Y-m-d', strtotime('+2 days'))); // 2days before subscription end\n $results = $common->subscriptionData($api_url, $data);\n if (count($results) > 0) {\n foreach ($results as $detail) {\n // Start :- Auto renew subscription\n if ($detail['auto_renewal'] == '1') {\n $this->autorenewcodeAction($api_url,$common,$detail);\n // End :- Auto renew subscription\n } \n }\n }\n die;\n }", "function og_simplenews_get_subscriptions($tid) {\n $emails = array();\n\n $result = db_query('\n SELECT ss.mail\n FROM {simplenews_subscriptions} ss\n INNER JOIN {simplenews_snid_tid} sn\n ON ss.snid = sn.snid\n WHERE sn.tid = %d', $tid);\n\n while ($row = db_fetch_array($result)) {\n $emails[] = $row['mail'];\n }\n\n return $emails;\n}", "public function userFromKey($key){\r\n $query = $this->conn->prepare('SELECT `user_id` FROM `user` WHERE confirmationKey = :key'); // Création de la requête + utilisation order by pour ne pas utiliser sort\r\n $query->execute([':key' => $key ]); // Exécution de la requête\r\n return $query->fetch(\\PDO::FETCH_ASSOC);\r\n\r\n }", "function subscriptions ($user_id) {\n global $sql;\n return $sql->sql_select_array_query(\"SELECT * FROM `subscription` WHERE user_id = '{$user_id}' ORDER BY id DESC\");\n }", "public function getAccount($key = null);", "public function getSubscriptions($userId = null, $sessionId = null)\n\t{\n\t\t// no user_id provided, get one from the auth service\n\t\tif (!isset($user_id)) {\n\t\t\tif ($auth = Zend_Auth::getInstance()->getIdentity()) {\n\t\t\t\t$userId = ($userId) ? $userId : $auth->user_id;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// no session id provided, get all sessions user is subscribed to\n\t\tif (!isset($sessionId)) {\n\t\t\treturn $this->getAdapter()->fetchCol(\n\t\t\t\t$this->select()\n\t\t\t\t->from($this->_name, 'session_id')\n\t\t\t\t->where('user_id = ?', $userId)\n\t\t\t);\n\t\t}\n\n\t\t// session_id provided, get all users who are subscribed to specific session\n\t\treturn $this->getAdapter()->fetchAll(\n\t\t\t\"select u.fname, u.lname, u.email from subscribers_sessions ss left join users u on (u.user_id = ss.user_id)\n\t\t\twhere ss.session_id=\".$sessionId\n\t\t);\n\t}", "public function hasSubscription($key)\n {\n // check if key is string and not empty\n if (empty($key) || !is_string($key)) {\n require_once 'Zend/Feed/Pubsubhubbub/Exception.php';\n throw new Zend_Feed_Pubsubhubbub_Exception(\n 'Invalid parameter \"key\"' .\n ' of \"' .\n $key .\n '\" must be a non-empty string'\n );\n }\n\n // generate uri with subscription id\n $subscriptionResourceUri = $this->_generateSubscriptionResourceUri(\n $this->_subscriptionConfig->get('classUri'),\n $key\n );\n\n // get the subscription as OntoWiki resource\n $subscriptionResource = new OntoWiki_Model_Resource(\n $this->_selectedModelInstance->getStore(),\n $this->_selectedModelInstance,\n $subscriptionResourceUri\n );\n\n // get all properties of the subscription\n $subscriptionResourceProperties = $subscriptionResource->getValues();\n\n if (0 < count($subscriptionResourceProperties)) {\n return true;\n } else {\n return false;\n }\n }", "public static function getSubscriptionProductsList() {\n $sku = array();\n $query = db_select('commerce_product', 'cp');\n $query->fields('cp', array('sku'));\n $query->leftJoin('field_data_field_product', 'pr', 'cp.product_id = pr.entity_id');\n $query->condition('pr.bundle', 'subscription', '=');\n $result = $query->execute();\n while ($product = $result->fetchAssoc()) {\n $sku[] = $product['sku'];\n }\n return new Response(TRUE, $sku, NULL);\n }", "public function get_vendor_memberships() {\n $this->db->select('*');\n $this->db->from('vendor_membership');\n $query = $this->db->get();\n $query_result = $query->result();\n\n return $query_result;\n }", "public function memberList()\n {\n return User::where('status', 1)->where('role_id', 2)->get();\n }", "protected function getTagsByKey($key){\n return $this->getAdapter()->sMembers($this->_keyFromId($key));\n }", "private static function getUserFromKey() {\n\t\tstatic $user;\n\t\t\n\t\tif ($user === null) {\n\t\t\t$user = false;\n\t\t\tif ($key = Request::getGET('key')) {\n\t\t\t\t$l = User::getUsers();\n\t\t\t\t$l = $l->filter($l->exprEqual($l->exprMember('unconfirmedEmailKey'),\n\t\t\t\t\t$key));\n\t\t\t\tif ($l->getCount() == 1)\n\t\t\t\t\t$user = $l->get(0);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($user === false)\n\t\t\treturn null;\n\t\telse\n\t\t\treturn $user;\n\t}", "public function retrieveSubscription() {\n // Adrian: Get user subscription details from the database\n /**$subscription = Subscription::where('user_id', $this->model->id)\n ->where('plan_id', $this->plan)\n ->first();**/\n\n $result = ChargeBee_Subscription::retrieve($this->user->subscription_id);\n\n return $result;\n }", "public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(memberProfilePeer::ID, $key, Criteria::EQUAL);\n }" ]
[ "0.6504515", "0.62734777", "0.6230953", "0.6120904", "0.59495854", "0.59205645", "0.5730152", "0.567319", "0.5672288", "0.5550507", "0.55431294", "0.55325675", "0.55160296", "0.5474513", "0.54615414", "0.54485065", "0.54293877", "0.54163957", "0.54128474", "0.5389833", "0.53354293", "0.5313734", "0.5281147", "0.5244318", "0.5208563", "0.5202443", "0.5183852", "0.51759624", "0.5173457", "0.5168946" ]
0.7590308
0
Check if order contains a Subscription
protected function order_contains_subscription( $order ) { return WC_Subscriptions_Order::order_contains_subscription( $order ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_subscription( $order_id ) {\n\t\treturn ( function_exists( 'wcs_order_contains_subscription' ) && ( wcs_order_contains_subscription( $order_id ) || wcs_is_subscription( $order_id ) || wcs_order_contains_renewal( $order_id ) ) );\n\t}", "protected function order_contains_subscription( $order_id ) {\n\t\treturn class_exists( 'WC_Subscriptions_Order' ) && ( WC_Subscriptions_Order::order_contains_subscription( $order_id ) || WC_Subscriptions_Renewal_Order::is_renewal( $order_id ) );\n\t}", "public function hasRecurringOrders();", "public function hasRecurringOrder(OrderInterface $order);", "function wcs_do_subscriptions_exist() {\n\tglobal $wpdb;\n\t$sql = $wpdb->prepare( \"SELECT ID FROM {$wpdb->posts} WHERE post_type = %s LIMIT 1;\", 'shop_subscription' );\n\n\t// query is the fastest, every other built in method uses this. Plus, the return value is the number of rows found\n\t$num_rows_found = $wpdb->query( $sql );\n\n\treturn ( 0 !== $num_rows_found ) ? true: false;\n}", "protected function maybe_handle_subscription( $order ) {\n\t\tif ( ! class_exists( 'WC_Subscriptions' ) ) {\n\t\t\treturn array( false, false, array() );\n\t\t}\n\n\t\tif ( ! wcs_order_contains_subscription( $order ) ) {\n\t\t\treturn array( false, false, array() );\n\t\t}\n\n\t\t$subscription = current( wcs_get_subscriptions_for_order( $order->get_id() ) );\n\t\t$subscription_id = $subscription->get_id();\n\n\t\t$ppec_billing = get_post_meta( $subscription_id, '_ppec_billing_agreement_id', true );\n\n\t\tif ( empty( $ppec_billing ) ) {\n\t\t\treturn array( false, false, array() );\n\t\t}\n\n\t\tif ( $subscription->has_status( apply_filters( 'woocommerce_paypal_express_checkout_privacy_eraser_subs_statuses', array( 'on-hold', 'active' ) ) ) ) {\n\t\t\treturn array( false, true, array( sprintf( __( 'Order ID %d contains an active Subscription' ), $order->get_id() ) ) );\n\t\t}\n\n\t\t$renewal_orders = WC_Subscriptions_Renewal_Order::get_renewal_orders( $order->get_id() );\n\n\t\tforeach ( $renewal_orders as $renewal_order_id ) {\n\t\t\tdelete_post_meta( $renewal_order_id, '_woo_pp_txnData' );\n\t\t\tdelete_post_meta( $renewal_order_id, '_ppec_billing_agreement_id' );\n\t\t\tdelete_post_meta( $renewal_order_id, '_paypal_status' );\n\t\t}\n\n\t\tdelete_post_meta( $subscription_id, '_woo_pp_txnData' );\n\t\tdelete_post_meta( $subscription_id, '_ppec_billing_agreement_id' );\n\t\tdelete_post_meta( $subscription_id, '_paypal_status' );\n\n\t\treturn array( true, false, array( __( 'PayPal Checkout Subscriptions Data Erased.', 'woocommerce-gateway-paypal-express-checkout' ) ) );\n\t}", "public function hasSubscribers(){\n return $this->subscriber_count > 1;\n }", "private function has_publisher_subscription()\n {\n $has_subscription = false;\n if (isset($this->options['subscription']) && $this->options['subscription'] == 1)\n {\n $has_subscription = true;\n }\n return $has_subscription;\n }", "protected function subscriptionIsPresent($items)\n {\n if ($items instanceof Collection) {\n foreach ($items as $item) {\n if ($this->quoteItemHelper->hasSubscription($item)) {\n return true;\n }\n }\n }\n return false;\n }", "function wcs_is_subscription( $subscription ) {\n\n\tif ( is_object( $subscription ) && is_a( $subscription, 'WC_Subscription' ) ) {\n\t\t$is_subscription = true;\n\t} elseif ( is_numeric( $subscription ) && 'shop_subscription' == get_post_type( $subscription ) ) {\n\t\t$is_subscription = true;\n\t} else {\n\t\t$is_subscription = false;\n\t}\n\n\treturn apply_filters( 'wcs_is_subscription', $is_subscription, $subscription );\n}", "public function hasActiveSubscription()\n {\n return $this->user->hasActiveSubscription();\n }", "function pgm_subscriber_has_subscription($subscriber_id, $list_id){\n //set default value\n $has_subscription = false;\n\n //get the subscriber from database\n $subscriber = get_post($subscriber_id);\n\n //get subscriptions from database\n $subscriptions = pgm_get_subscriptions($subscriber_id);\n\n //check subscriptions for $list_id\n if(in_array($list_id,$subscriptions)){\n\n $has_subscription = true;\n } else{\n\n //leave to default\n }\n\n return $has_subscription;\n}", "public function hasOrder()\n {\n return $this->_has('_order');\n }", "public function everSubscribed()\n {\n return !empty($this->billing_subscription);\n }", "function subscriptionExists($subscriptionId) {\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT COUNT(*)\n\t\t\tFROM\n\t\t\tsubscriptions s,\n\t\t\tsubscription_types st\n\t\t\tWHERE s.type_id = st.type_id\n\t\t\tAND st.institutional = 1\n\t\t\tAND s.subscription_id = ?',\n\t\t\t$subscriptionId\n\t\t);\n\n\t\t$returner = isset($result->fields[0]) && $result->fields[0] != 0 ? true : false;\n\n\t\t$result->Close();\n\t\tunset($result);\n\n\t\treturn $returner;\n\t}", "public function existSubscription(Users $customer, Services $service) {\n $subscription = Subscriptions::where([\n 'user_id' => $customer->id,\n 'service_id' => $service->id\n ])->orderBy('id', 'desc')->first();\n \n return $subscription?$subscription:false;\n }", "function subscriptionExists($subscriptionId) {\n\t\t// must be implemented by sub-classes\n\t\tassert(false);\n\t}", "public function hasShoporder(){\n return $this->_has(27);\n }", "function is_subscribed($thread, $subs) {\n foreach ($subs as $sub) {\n if ($sub->threadid == $thread->id) return true;\n }\n return false;\n}", "public function isSubscribed()\n {\n // TODO there seems to be an inconsistency when getting database records via Repository or via ObjectStorage\n // TODO when getting via Repository, a Typo3bb-FrontendUser is returned\n // TODO when getting via ObjectStorage, IglarpTemplate-FrontendUser is returned\n $user = FrontendUserUtility::getCurrentUser();\n if (is_null($user)) {\n return false;\n } else {\n return $this->subscribers->contains($user);\n }\n }", "function subscriptionExistsByUser($subscriptionId, $userId){ \n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT COUNT(*)\n\t\t\tFROM\n\t\t\tsubscriptions s,\n\t\t\tsubscription_types st\n\t\t\tWHERE s.type_id = st.type_id\n\t\t\tAND st.institutional = 1\n\t\t\tAND s.subscription_id = ?\n\t\t\tAND s.user_id = ?',\n\t\t\tarray(\n\t\t\t\t$subscriptionId,\n\t\t\t\t$userId\n\t\t\t)\n\t\t);\n\n\t\t$returner = isset($result->fields[0]) && $result->fields[0] != 0 ? true : false;\n\n\t\t$result->Close();\n\t\tunset($result);\n\n\t\treturn $returner;\n\t}", "public function hasSubscription($key)\n {\n // check if key is string and not empty\n if (empty($key) || !is_string($key)) {\n require_once 'Zend/Feed/Pubsubhubbub/Exception.php';\n throw new Zend_Feed_Pubsubhubbub_Exception(\n 'Invalid parameter \"key\"' .\n ' of \"' .\n $key .\n '\" must be a non-empty string'\n );\n }\n\n // generate uri with subscription id\n $subscriptionResourceUri = $this->_generateSubscriptionResourceUri(\n $this->_subscriptionConfig->get('classUri'),\n $key\n );\n\n // get the subscription as OntoWiki resource\n $subscriptionResource = new OntoWiki_Model_Resource(\n $this->_selectedModelInstance->getStore(),\n $this->_selectedModelInstance,\n $subscriptionResourceUri\n );\n\n // get all properties of the subscription\n $subscriptionResourceProperties = $subscriptionResource->getValues();\n\n if (0 < count($subscriptionResourceProperties)) {\n return true;\n } else {\n return false;\n }\n }", "public static function is_subscription($items)\n {\n $is_subscription = false;\n if (sizeof($items) == 1) {\n foreach ($items as $cart_item_key => $cart_item) {\n $is_recurrent = (method_exists($cart_item, 'get_meta')) ?\n $cart_item->get_meta('_used_gateway') : get_post_meta($cart_item['product_id'], '_mp_recurring_is_recurrent', true);\n if ($is_recurrent == 'yes') {\n $is_subscription = true;\n }\n }\n }\n return $is_subscription;\n }", "public function isSubscribed()\n {\n return null !== $this->queue;\n }", "public function subscribed()\n {\n if ($this->billing_free) {\n if (!$this->billing_subscription_ends_at\n || time() < strtotime($this->billing_subscription_ends_at)\n ) {\n return true;\n }\n }\n \n if (!isset($this->cardUpFront) || $this->cardUpFront) {\n return $this->billingIsActive() || $this->onGracePeriod();\n }\n \n return $this->billingIsActive() || $this->onGracePeriod() || $this->onTrial();\n }", "function checkSubscriptionRenewal($order)\n {\n $plan = & $order['PaidOrder']['plan_info']['plan_array'];\n if($order['PaidOrder']['order_status'] == 'Complete') /* The order had already been procesed in the past */\n {\n $PaidTxnLog = ClassRegistry::getClass('PaidTxnLogModel');\n $PaidTxnLog->addNote(\"Subscription Renewal\");\n $new_expiration = PaidOrderModel::getExpirationDate($plan['duration_period'],$plan['duration_number'],$order['PaidOrder']['order_expires']);\n $order['PaidOrder']['order_expires'] = $new_expiration;\n $plan['moderation'] = 0; // If it was published before no need to moderate it again\n }\n\n return $order;\n }", "function wcs_get_subscription( $the_subscription ) {\n\n\tif ( is_object( $the_subscription ) && wcs_is_subscription( $the_subscription ) ) {\n\t\t$the_subscription = $the_subscription->get_id();\n\t}\n\n\t$subscription = WC()->order_factory->get_order( $the_subscription );\n\n\tif ( ! wcs_is_subscription( $subscription ) ) {\n\t\t$subscription = false;\n\t}\n\n\treturn apply_filters( 'wcs_get_subscription', $subscription );\n}", "public function canHandleSubscriptions():bool\n {\n return false;\n }", "public function checkIfOrderExist($orderId);", "public function getIsSubscribedToAttribute()\n {\n return $this->subscriptions()\n ->where('user_id', auth()->id())\n ->exists();\n }" ]
[ "0.71747226", "0.71717185", "0.6739315", "0.67205507", "0.65633047", "0.6429702", "0.6339807", "0.6261275", "0.61559397", "0.6135418", "0.611952", "0.6118669", "0.60814667", "0.6044969", "0.6043291", "0.60286", "0.6028257", "0.6006084", "0.59678966", "0.59616643", "0.5951888", "0.59506", "0.5900912", "0.58802", "0.5872384", "0.5866089", "0.5861931", "0.58499813", "0.5841494", "0.58389765" ]
0.7819213
0
Get a Subscription renewal url for a Subscriptiontied Membership
public function get_subscription_renewal_url( $user_membership ) { $subscription_key = $this->get_user_membership_subscription_key( $user_membership->get_id() ); $url = WC_Subscriptions_Renewal_Order::get_users_renewal_link( $subscription_key ); return $url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_renewal_url() {\n\t\t$renewal_url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'subscription' => $this->get_id(),\n\t\t\t\t'key' => $this->get_key(),\n\t\t\t\t'action' => 'renew',\n\t\t\t), home_url()\n\t\t);\n\n\t\treturn $renewal_url;\n\t}", "public function new_subscription_url($params) {\n return $this->new_limit_url('subscription', $params);\n }", "public function getUrl()\n {\n return \\Util_HandyServerUtils::getCurrentServerRoot() . \"subs/\" . $this->auth_key;\n }", "public function get_subscription_url( $subscription_id, $api_mode = 'live' ) {\n\n\t\treturn add_query_arg(\n\t\t\tarray(\n\t\t\t\t'cmd' => '_profile-merchant-pull',\n\t\t\t\t'flag_flow' => 'merchant',\n\t\t\t\t'mp_id' => $subscription_id,\n\t\t\t),\n\t\t\t$this->get_dashboard_url( $api_mode )\n\t\t);\n\n\t}", "function ical_subscribe() {\n \t$this->wireframe->print_button = false;\n\n $ical_url = assemble_url('ical', array(\n 'token' => $this->logged_user->getToken(true),\n ));\n\n $ical_subscribe_url = str_replace(array('http://', 'https://'), array('webcal://', 'webcal://'), $ical_url);\n\n $this->smarty->assign(array(\n 'ical_url' => $ical_url . '&subscribe=no',\n 'ical_subscribe_url' => $ical_subscribe_url\n ));\n }", "public function get_subscribe_link() {\n\t\t$url = $this->get_subscribe_url();\n\t\treturn sprintf( '<a href=\"%s\">%s</a>', $url, $url );\n\t}", "protected function composeReentryURL()\n\t{\n\t\t$s = SERVER_URL\n\t\t\t\t. $this->model->director->getSiteUrl('account/password_reset_reentry')\n\t\t\t\t. '/' . $this->myAuthID . '/' . $this->myNewToken\n\t\t\t\t;\n//\t\t$this->debugLog( 'Created reentry URL [' . $s\n//\t\t\t\t. '] for email bound for [' . $this->myEmailAddr . '].'\n//\t\t\t\t);\n\t\treturn $s ;\n\t}", "public function getRechargeUrl()\n {\n return $this->get(self::_RECHARGE_URL);\n }", "public function getExternalUpdateProfileUrl();", "public function getUpdateSubscriberUrl()\n {\n return $this->UpdateSubscriberUrl;\n }", "public function membershipAction()\n {\n $common = $this->getServiceLocator()->get('Application\\Model\\Common');\n $api_url = $this->getServiceLocator()->get('config')['api_url']['value'];\n $data = array('status_id' => 1, 'subscription_end_date' => date('Y-m-d', strtotime('+2 days'))); // 2days before subscription end\n $results = $common->subscriptionData($api_url, $data);\n if (count($results) > 0) {\n foreach ($results as $detail) {\n // Start :- Auto renew subscription\n if ($detail['auto_renewal'] == '1') {\n $this->autorenewcodeAction($api_url,$common,$detail);\n // End :- Auto renew subscription\n } \n }\n }\n die;\n }", "public function getUrl() {\n\t\treturn sprintf(self::ENDPOINT, $this->_account);\n\t}", "public static function profile_link( $subscription ) {\n\t\tif ( wcs_is_subscription( $subscription ) && 'paypal' == $subscription->get_payment_method() ) {\n\n\t\t\t$paypal_profile_id = wcs_get_paypal_id( $subscription );\n\n\t\t\tif ( ! empty( $paypal_profile_id ) ) {\n\n\t\t\t\t$url = '';\n\n\t\t\t\tif ( false === wcs_is_paypal_profile_a( $paypal_profile_id, 'billing_agreement' ) ) {\n\t\t\t\t\t// Standard subscription\n\t\t\t\t\t$url = 'https://www.paypal.com/?cmd=_profile-recurring-payments&encrypted_profile_id=' . $paypal_profile_id;\n\t\t\t\t} else if ( wcs_is_paypal_profile_a( $paypal_profile_id, 'billing_agreement' ) ) {\n\t\t\t\t\t// Reference Transaction subscription\n\t\t\t\t\t$url = 'https://www.paypal.com/?cmd=_profile-merchant-pull&encrypted_profile_id=' . $paypal_profile_id . '&mp_id=' . $paypal_profile_id . '&return_to=merchant&flag_flow=merchant';\n\t\t\t\t}\n\n\t\t\t\techo '<div class=\"address\">';\n\t\t\t\techo '<p class=\"paypal_subscription_info\"><strong>';\n\t\t\t\techo esc_html( __( 'PayPal Subscription ID:', 'woocommerce-subscriptions' ) );\n\t\t\t\techo '</strong>';\n\t\t\t\tif ( ! empty( $url ) ) {\n\t\t\t\t\techo '<a href=\"' . esc_url( $url ) . '\" target=\"_blank\">' . esc_html( $paypal_profile_id ) . '</a>';\n\t\t\t\t} else {\n\t\t\t\t\techo esc_html( $paypal_profile_id );\n\t\t\t\t}\n\t\t\t\techo '</p></div>';\n\t\t\t}\n\t\t}\n\n\t}", "function generateSubTokenUrl($nextUrl = null)\n{\n $secure = false;\n $session = true;\n\n if (!$nextUrl) {\n $nextUrl = OPERATIONS_URL;\n }\n\n $url = Zend_Gdata_AuthSub::getAuthSubTokenUri($nextUrl, GDATA_SCOPE, $secure, $session);\n \n return $url;\n}", "public function getUnsubcribeUrl() {\n\t\treturn $this->getEmailActionLink(\"email/unsubscribeWeeklyNews\");\n\t}", "public function getNewsletterUrl()\n {\n return $this->urlBuilder->getUrl('walleycheckout/newsletter');\n }", "public function get_subscribe_url() {\n\n\t\t$podcast = \\Podlove\\Model\\Podcast::get_instance();\n\n\t\t$url = sprintf(\n\t\t\t'%s/feed/%s/',\n\t\t\tget_bloginfo( 'url' ),\n\t\t\t$this->slug\n\t\t);\n\n\t\treturn apply_filters( 'podlove_subscribe_url', $url );\n\t}", "public function subscription($attributes)\n {\n $attributes = shortcode_atts(array('id' => ''), $attributes, 'happyrsubscription');\n\n $id = $attributes['id'];\n if (empty($id)) {\n return 'You are missing company ID. See https://happyr.com/integration/doc/retrieveId';\n }\n\n return 'https://happyr.com/user/spontaneous/'.$id.'/start';\n }", "public function getBaseUrl()\n\t{\n\t\treturn self::URL_MANAGEMENT . '/' . $this->_subscriptionId;\n\t}", "public function getSubscription()\n {\n $recruiter = RecruiterProfile::where(['user_id' => Auth::user()->id])->first();\n if ($recruiter['is_subscribed'] == config('constants.ZeroValue')) {\n $result = view('web.subscription', ['activeTab' => '4']);\n } else {\n $result = redirect('jobtemplates');\n }\n return $result;\n }", "public function getSubscription($request);", "public function getSubscriptionId();", "public function getSubscriptionDetails($request);", "public function getBaseRevokeTokenUrl()\n {\n return 'https://oauth.accounting.sage.com/revoke';\n }", "public function getEditUrl()\n {\n return $this->_urlBuilder->getUrl('*/*/edit', ['id' => $this->getSubscription()->getId()]);\n }", "public function getUnsubscribeUrl() : string\n\t{\n\t\t$utils = $this->getUtilsObj();\n\n\t\treturn $utils->getUnsubscribeUrl($this);\n\t}", "function getAuthSubUrl()\n{\n $next = getCurrentUrl();\n $scope = 'https://docs.google.com/feeds/documents';\n $secure = false;\n $session = true;\n return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure,\n $session);\n}", "function renewSubscription(&$institutionalSubscription) {\n\t\treturn $this->_renewSubscription($institutionalSubscription);\n\t}", "function create_new_listing_actions_renew_subscription($uid) {\r\n \r\n if (!is_numeric($uid)) {\r\n drupal_set_message(t('Invalid user id specified'), 'error');\r\n return;\r\n }\r\n\r\n // Find all recurring open orders\r\n $query = db_query('SELECT order_id FROM commerce_order WHERE status = :status AND type = :type AND uid = :uid ORDER BY order_id DESC LIMIT 1', array(':status' => 'canceled', ':type' => 'recurring', ':uid' => $uid));\r\n\r\n $result = $query->fetchField();\r\n\r\n if (!$result) {\r\n drupal_set_message(t('Unable to find billing cycle.'), 'error');\r\n return;\r\n }\r\n\r\n $order = commerce_order_load($result);\r\n $order->status = 'recurring_open';\r\n commerce_order_save($order);\r\n\r\n drupal_set_message(t('Your subscription will be renewed automatically.'));\r\n}", "public function getSponsorlink() {}" ]
[ "0.7509436", "0.6820527", "0.63464165", "0.61982125", "0.60496145", "0.604195", "0.6018879", "0.598256", "0.5924393", "0.5900339", "0.58577156", "0.58441734", "0.58365834", "0.58042365", "0.5786703", "0.5777251", "0.57770866", "0.5769336", "0.5738676", "0.5706045", "0.569512", "0.56929386", "0.5651787", "0.5641349", "0.563536", "0.56177694", "0.56022406", "0.55672103", "0.5530574", "0.5520577" ]
0.7367929
1
Get a Subscription event date or time
protected function get_subscription_event( $subscription, $event, $format = 'mysql' ) { $date = ''; // sanity check if ( ! is_array( $subscription ) || empty( $subscription ) ) { return $date; } switch ( $event ) { case 'end' : case 'end_date' : case 'expiry_date' : $date = isset( $subscription['expiry_date'] ) ? $subscription['expiry_date'] : ''; break; case 'trial_end' : case 'trial_end_date' : case 'trial_expiry_date' : $date = isset( $subscription['trial_expiry_date'] ) ? $subscription['trial_expiry_date'] : ''; break; } return 'timestamp' === $format && ! empty( $date ) ? strtotime( $date ) : $date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEventTimestamp();", "public function getEventTime()\n {\n return $this->event_time;\n }", "public function getEventTime()\n {\n return $this->event_time;\n }", "public function getSubscribeDate()\n {\n return $this->subscribeDate;\n }", "public function getTimeSend($event) \n {\n switch ($event) {\n case 1:\n return date('m/d', strtotime($this->online_date));\n break;\n \n case 2:\n return date('Y/m/d', $this->created_at);\n break;\n\n case 3:\n return $date('Y/m/d', $this->updated_at);\n break;\n }\n }", "public function getEventDate() \n {\n return $this->_fields['EventDate']['FieldValue'];\n }", "public function getUnsubscribeDate()\n {\n return $this->unsubscribeDate;\n }", "public function getInvoiceTimestamp();", "public function subscription(): EventSubscription;", "public function getEvent()\n {\n return $this->getData('event');\n }", "function getStartTime($event) {\n $timer = Filter::get(Timer::timers(), $event);\n if (!empty($timer)) {\n return Filter::get($timer, 'start');\n }\n return null;\n }", "public function getStartDateAndTime() {}", "public function getTimestamp();", "public function getTimestamp();", "public function getTimestamp();", "public function getEvent() {\n return $this->event;\n }", "function get_variable_time() {\n\t\t$datetime = $this->get_option( 'queue_datetime', true );\n\n\t\tif ( ! $datetime ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$timestamp = strtotime( $datetime, current_time( 'timestamp' ) );\n\n\t\t$date = new DateTime();\n\t\t$date->setTimestamp( $timestamp );\n\t\t$date->convert_to_utc_time();\n\n\t\treturn $date;\n\t}", "public function getSpeakTime()\n {\n return $this->get(self::_SPEAK_TIME);\n }", "public function getDateEvt()\n {\n return $this->dateEvt;\n }", "public function getEvent()\n {\n return $this->event;\n }", "public function getEvent()\n {\n return $this->event;\n }", "public function getEvent()\n {\n return $this->event;\n }", "function get_event_start_time($post_id){\n\t\treturn get_post_meta($post_id, '_start_time', true);\t\t\n\t}", "public function getDatetime();", "public function getEventSubscriber();", "public function getTimestamp()\n {\n return $this->baseEvent->getTimestamp();\n }", "public function getSubscriptionId();", "public function getEvent()\n {\n $result = new stdClass;\n\n if (!($kronolith_driver = $this->_getDriver($this->vars->cal)) ||\n !isset($this->vars->id)) {\n return $result;\n }\n\n try {\n $event = $kronolith_driver->getEvent($this->vars->id, $this->vars->date);\n $event->setTimezone(true);\n $result->event = $event->toJson(null, true, $GLOBALS['prefs']->getValue('twentyFour') ? 'H:i' : 'h:i A');\n // If recurring, we need to format the dates of this instance, since\n // Kronolith_Driver#getEvent will return the start/end dates of the\n // original event in the series.\n if ($event->recurs() && $this->vars->rsd) {\n $rs = new Horde_Date($this->vars->rsd);\n $result->event->rsd = $rs->strftime('%x');\n $re = new Horde_Date($this->vars->red);\n $result->event->red = $re->strftime('%x');\n }\n } catch (Horde_Exception_NotFound $e) {\n $GLOBALS['notification']->push(_(\"The requested event was not found.\"), 'horde.error');\n } catch (Exception $e) {\n $GLOBALS['notification']->push($e, 'horde.error');\n }\n\n return $result;\n }", "public function getReleaseTime();", "public function getEvent()\r\n {\r\n return $this->Event;\r\n }" ]
[ "0.65830815", "0.6512927", "0.6512927", "0.6419624", "0.6197726", "0.6095644", "0.5823512", "0.57241666", "0.55804104", "0.5556832", "0.54295284", "0.54208565", "0.5419405", "0.5419405", "0.5419405", "0.54192126", "0.5415985", "0.5409596", "0.5400543", "0.53901464", "0.53901464", "0.53901464", "0.53842026", "0.5378121", "0.5374935", "0.5353359", "0.53339744", "0.53244066", "0.53224057", "0.5320846" ]
0.668442
0
Infers the $this>className based on $this>attributeName. Will try to guess the appropriate class by singularizing and uppercasing $this>attributeName.
protected function setInferredClassName() { $singularize = ($this instanceOf HasMany ? true : false); $this->setClassName(\ChickenTools\Str::classify($this->attributeName, $singularize)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function reworkClassName() {\n $className = $this->className;\n\n if ( (is_array($className) && (count($className) == 0)) || (is_string($className) && (strlen($className) == 0)) ) {\n $this->className = array();\n return;\n }\n\n $arr = self::goodSplit($className, '::');\n // If this array > 2 elements: it's a subclass [example: OmsEvent::Account::Account]\n $this->className = $arr;\n if ( count($this->className) > 1 ) {\n $this->functionName = array_pop($this->className);\n }\n }", "abstract protected function getAttributeName($attribute);", "public function getModelNameBasedOnClassName(): string\n {\n $fqn = explode(\"\\\\\", get_class($this));\n\n return strtolower(end($fqn));\n }", "private function _findModelName(){\n\t\tif($this->_source==''){\n $this->_source = Utils::uncamelize(get_class($this));\n }\n if($this->_source==''){\n\t\t\t$this->_source = get_class($this);\n\t\t}\n\t}", "function getClassName($name)\n{\n return str_replace('_', ' ', snake_case(class_basename($name)));\n}", "public function getAttributeByName($attributeName);", "public function getAttributeName()\n\t{\n\t\treturn 'ScoredClass';\n\t}", "public function getRelationName($attributeName);", "protected function formatAttribute($attributeName) {\n\t\t\treturn preg_replace_callback(\n\t\t\t\t'/(^|_|\\.)+(.)/',\n\t\t\t\tfunction ($match) {\n\t\t\t\t\treturn ('.' === $match[1] ? '_' : '') . strtoupper($match[2]);\n\t\t\t\t},\n\t\t\t\t$attributeName\n\t\t\t);\n\t\t}", "public function getModelClassName($className = NULL)\n\t{\n\n\t\tif (!$className) {\n\t\t\t$className = $this->getName();\n\t\t}\n\n\t\tif (!is_string($className)) {\n\t\t\tthrow new L8M_Doctrine_Import_Exception('Class name needs to be specified as a string.');\n\t\t}\n\n\t\t/**\n\t\t * @todo filter class name\n\t\t */\n\n\t\t$modelClassName = $this->getClassPrefix()\n\t\t\t\t\t\t. $className\n\t\t;\n\n\t\treturn $modelClassName;\n\n\t}", "function class_dotcase($className){\n if(is_object($className)){\n $className = get_class($className);\n }\n\n $namespaced = array_where(explode('\\\\',$className), function($i, $v){ return !empty($v); });\n array_walk($namespaced, function(&$value){ $value = lcfirst($value);});\n\n return implode('.', $namespaced);\n}", "protected function _inflectClassNameSlug() {\n\t\t$className = get_class($this);\n\t\t$parts = explode('Shortcode', $className);\n\t\t$shortcodeName = end($parts);\n\t\t\n\t\t$regex = '/(^|[a-z])([A-Z])/';\t\t\t\n\t\t$slug = preg_replace($regex, '$1_$2', $shortcodeName);\n\t\t\n\t\t$slug = strtolower($slug);\n\t\t$slug = trim($slug, '_ ');\n\t\t\n\t\treturn $slug;\n\t}", "private static function tableName($className) {\n\t\treturn strtolower(Util::getSimpleClassName($className)) ;\n\t}", "protected function parseSpecialCaseAttribute($attributeName)\n {\n $this->debug('parseSpecialCaseAttribute');\n\n if ($attributeName === 'primaryitem') {\n\n /**\n * If 'primaryitem' is present without a '?' then the string following it is\n * the name of the primary item of the node type.\n * If 'primaryitem' is present with a '?' then the primary item is a variant.\n * If 'primaryitem' is absent then the node type has no primary item.\n *\n * PrimaryItem ::= ('primaryitem'| '!')(String | '?')\n */\n\n if ($this->checkAndExpectToken(Token::TK_SYMBOL, '?')) {\n return new SyntaxTreeNode('primaryitem', array('value' => '?'));\n }\n return new SyntaxTreeNode('primaryitem', array('value' => $this->parseCndString()));\n }\n\n if ($attributeName === 'queryops') {\n\n return $this->parseQueryOpsAttribute();\n }\n\n return false;\n }", "private function guessName () : string {\n return $this->inflector()->pluralize($this->inflector()->tableize(class_basename($this)));\n }", "public static function classify($table_name) {\n return self::camelize(self::singularize($table_name));\n }", "function class_name($str) {\n\treturn preg_replace('/(?:^|-)([a-zA-Z])/e', \"strtoupper('\\\\1')\", $str);\n}", "protected static function getLowerCaseClassName()\n {\n $refClass = new \\ReflectionClass(get_called_class());\n $className = $refClass->getShortName();\n\n return strtolower($className);\n }", "public function setNameAttribute ($name){\n $this->attributes['name'] = strtolower($name);\n}", "public function classify($table_name)\n\t{\n\t\treturn Inflector::camelize(Inflector::singularize($table_name));\n\t}", "protected function _lookupAttribute($attr)\n {\n if (preg_match('/^[0-9]+$/', $attr)) {\n $attr = (int)$attr;\n } else {\n $textLabels = $this->_getTextLabels();\n foreach ($textLabels as $index => $label) {\n $labels = array($label);\n $func = create_function('$c', 'return strtoupper($c[1]);');\n $camelCase = preg_replace_callback('/_([a-z])/', $func, $label);\n $labels[] = $camelCase;\n\n if (in_array($attr, $labels)) {\n $attr = $index;\n break;\n }\n }\n }\n\n return $attr;\n }", "public static function classify($table_name)\n {\n return self::camelize(self::singularize($table_name));\n }", "abstract protected function getFilterClassName($string);", "public function getSimpleClassName($classname);", "public function testClassName() {\n $this->assertEquals('CamelCase', Inflector::className('camel Cases'));\n $this->assertEquals('StudlyCase', Inflector::className('StuDly CaSes'));\n $this->assertEquals('TitleCase', Inflector::className('Title Cases'));\n $this->assertEquals('NormalCase', Inflector::className('Normal cases'));\n $this->assertEquals('Lowercase', Inflector::className('lowercases'));\n $this->assertEquals('Uppercase', Inflector::className('UPPERCASEs'));\n $this->assertEquals('UnderScore', Inflector::className('under_scores'));\n $this->assertEquals('DashE', Inflector::className('dash-es'));\n $this->assertEquals('123Number', Inflector::className('123 numbers'));\n $this->assertEquals('WithExtxml', Inflector::className('with EXT.xml'));\n $this->assertEquals('LotsOfWhiteSpace', Inflector::className('lots of white space'));\n }", "public function getAttributeByColumn( $colname )\n {\n // Si esta con el mismo nombre, lo retorno (son la mayoria de los casos)\n if ( array_key_exists( $colname, $this->attributeTypes ) ) return $colname;\n \n // Si no esta por el nombre exacto, busco normalizando los nombres de\n // los atributos por la columna que le toca en el ORM.\n foreach ( $this->attributeTypes as $classAttr => $type )\n {\n if ( DatabaseNormalization::col($classAttr) == $colname ) return $classAttr;\n }\n \n // Si no encuentra, devuelve NULL\n return NULL;\n }", "public function resolveClassName($className)\n {\n $className = Inflector::id2camel($className, '_');\n if (isset($this->aliases[$className])) {\n return $this->aliases[$className];\n }\n foreach ($this->namespaces as $namespace) {\n $resolvedClassName = $namespace . '\\\\' . $className;\n if (class_exists($resolvedClassName)) {\n return $this->aliases[$className] = $resolvedClassName;\n }\n }\n return $className;\n }", "protected function generateClassName($tableName)\r\n {\r\n if (isset($this->classNames[$tableName])) {\r\n return $this->classNames[$tableName];\r\n }\r\n\r\n if (($pos = strrpos($tableName, '.')) !== false) {\r\n $tableName = substr($tableName, $pos + 1);\r\n }\r\n\r\n $db = $this->getDbConnection();\r\n $patterns = [];\r\n $patterns[] = \"/^{$db->tablePrefix}(.*?)$/\";\r\n $patterns[] = \"/^(.*?){$db->tablePrefix}$/\";\r\n if (strpos($this->tableName, '*') !== false) {\r\n $pattern = $this->tableName;\r\n if (($pos = strrpos($pattern, '.')) !== false) {\r\n $pattern = substr($pattern, $pos + 1);\r\n }\r\n $patterns[] = '/^' . str_replace('*', '(\\w+)', $pattern) . '$/';\r\n }\r\n $className = $tableName;\r\n foreach ($patterns as $pattern) {\r\n if (preg_match($pattern, $tableName, $matches)) {\r\n $className = $matches[1];\r\n break;\r\n }\r\n }\r\n\r\n return $this->classNames[$tableName] = Inflector::id2camel($className, '_');\r\n }", "static public function classify($str)\n\t{\n\t\t$str = trim($str, '-');\n\t\t\n\t\t$result = preg_replace_callback('/(-\\w)/', function ($match) {\n\t\t\treturn strtoupper($match[1][1]);\n\t\t}, $str);\n\t\t\n\t\treturn ucfirst($result);\n\t}", "protected function qualifyClass($name)\n {\n $rootNamespace = $this->laravel->getNamespace();\n\n if (Str::startsWith($name, $rootNamespace)) {\n return $name;\n }\n\n if (Str::contains($name, '/')) {\n $name = str_replace('/', '\\\\', $name);\n }\n\n if (! Str::contains(Str::lower($name), 'datatable')) {\n $name .= $this->type;\n }\n\n return $this->getDefaultNamespace(trim($rootNamespace, '\\\\')) . '\\\\' . $name;\n }" ]
[ "0.61572564", "0.6152336", "0.5693837", "0.55937994", "0.53605855", "0.5350472", "0.533853", "0.53346974", "0.5283421", "0.521665", "0.5216016", "0.51824164", "0.51801217", "0.5172149", "0.51718843", "0.5143842", "0.514227", "0.51409215", "0.5131353", "0.5124402", "0.5109615", "0.5089375", "0.50859356", "0.50606525", "0.5048239", "0.5043079", "0.50406665", "0.5033433", "0.49963948", "0.49909693" ]
0.6888032
0
fetches the team list info
public function getTeamList() { return $this->getData('/team/list'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function team_list()\n {\n }", "public function team_info() {\n\n $method=\"team.info\";\n $payload = array();\n $team_details = $this->apicall($method, $payload);\n $this->debug(\"team-details.log\", json_encode($team_details));\n return $team_details;\n\n }", "public function getTeams();", "public function teamlist_get()\n\t{\n\n\t\tif($_SERVER['REQUEST_METHOD'] != \"GET\")\n\t\t{\n\t\t $this->response('Not Acceptable',406);\n\t\t}\n\t\t$sport_id = $this->input->get('sport_id');\n\t\t$search_text = $this->input->get('search_text');\n\t\t$offset = $this->input->get('offset');\n\t\t$limit = $this->input->get('limit');\n\t\t\n\t\t$this->load->model('User_model');\n\t\t\n\t\t$team_list_count = $this->User_model->GetTeamCount($sport_id, $search_text);\n\t\tif($limit >0 ) {\n\t\t\t$remianest = $team_list_count - $limit;\n\t\t}\n\t\telse {\n\t\t\t$remianest = $team_list_count;\n\t\t}\n\t\t\n\t\t$team_list_arr=$this->User_model->GetTeam($sport_id, $search_text, $offset, $limit);\n\t\tif(count($team_list_arr)>0)\n\t\t{\n\t\t\t$this->response(array('status'=>'success','remaincount' => $remianest, 'team'=>$team_list_arr), 200);\n\t\t}\n\t\telse\n\t\t\t$this->response(array('status'=>'failed','message'=>'No records in database'),200);\n\t\n\t\n\t}", "public function getTeams() { \r\n $uri = $this->payload->_links->teams->href;\r\n $response = file_get_contents($uri, false, stream_context_create($this->reqPrefs)); \r\n $response = json_decode($response);\r\n \r\n return $response->teams;\r\n }", "function listTeams() {\n global $oDbHelper;\n\n $sQuery = \"SELECT * FROM team WHERE competition_id = \" . COMPETITION_ID;\n $oResult = $oDbHelper->executeQuery($sQuery);\n $oDbHelper->printDbResult($oResult);\n}", "public function getTeam();", "function get_team_info($idTeam)\n{\n $team_info = get_team_info_db($idTeam);\n return $team_info;\n}", "function get_driver_team($idTeam)\n{\n $list_driver = get_driver_team_db($idTeam);\n return $list_driver;\n}", "public function all_team_member_info(){\r\n $query = \"SELECT * FROM tbl_aboutus_team WHERE publication_status = 1 ORDER BY team_member_id DESC LIMIT 4\";\r\n if(mysqli_query($this->db_connect, $query)){\r\n $query_result = mysqli_query($this->db_connect, $query);\r\n return $query_result;\r\n }else{\r\n die(\"Query Problem! \".mysqli_error($this->db_connect));\r\n }\r\n }", "public function getAll(){\n\t\t$url = WEBSERVICE. \"teams/getAll\";\n\t\t$this->HTTPRequest->setUrl($url);\n\t\t$this->HTTPRequest->setMethod(\"GET\");\n\t\t$arrayResponse = $this->HTTPRequest->sendHTTPRequest();\n\t\treturn $this->arrayToTeam($arrayResponse, false);\n\t}", "public function teams()\n {\n return $this->request('get', '/api/teams');\n }", "function get_team_info($team_id) {\n global $db;\n $query = 'SELECT t.team_id\n , t.name\n , t.nickname\n , t.logo_file_name\n , l.name as league\n , l.abbr as league_abbr\n , s.name as sub_league_name\n , s.abbr as sub_league_abbr\n , d.name as div_name\n FROM teams t INNER JOIN leagues l ON t.league_id = l.league_id\n INNER JOIN sub_leagues s ON t.league_id = s.league_id AND t.sub_league_id = s.sub_league_id\n INNER JOIN divisions d ON t.league_id = d.league_id AND t.sub_league_id = d.sub_league_id\n AND t.division_id = d.division_id\n WHERE t.team_id = :team_id';\n $statement = $db->prepare($query);\n $statement->bindValue('team_id', $team_id);\n $statement->execute();\n $team_info = $statement->fetch();\n $statement->closeCursor();\n return $team_info;\n}", "public function getListData(){\n\t\tif(auth()->user()->hasRole('merchandiser')){\n\t\t\t$lead_associateId[] = auth()->user()->associate_id;\n\t\t \t$team_members = DB::table('hr_as_basic_info as b')\n\t\t\t\t->where('associate_id',auth()->user()->associate_id)\n\t\t\t\t->leftJoin('mr_excecutive_team','b.as_id','mr_excecutive_team.team_lead_id')\n\t\t\t\t->leftJoin('mr_excecutive_team_members','mr_excecutive_team.id','mr_excecutive_team_members.mr_excecutive_team_id')\n\t\t\t\t->pluck('member_id');\n\t\t\t$team_members_associateId = DB::table('hr_as_basic_info as b')\n\t \t\t\t\t ->whereIn('as_id',$team_members)\n\t\t\t\t\t\t\t\t\t\t->pluck('associate_id');\n\t\t \t$team = array_merge($team_members_associateId->toArray(),$lead_associateId);\n\n\t \t}elseif (auth()->user()->hasRole('merchandising_executive')) {\n\t\t \t$executive_associateId[] = auth()->user()->associate_id;\n\n\t\t \t$teamid = DB::table('hr_as_basic_info as b')\n\t\t\t\t->where('associate_id',auth()->user()->associate_id)\n\t\t\t\t->leftJoin('mr_excecutive_team_members','b.as_id','mr_excecutive_team_members.member_id')\n\t\t\t\t->pluck('mr_excecutive_team_id');\n\t\t\t$team_lead = DB::table('mr_excecutive_team')\n\t\t\t\t\t ->whereIn('id',$teamid)\n\t\t\t\t\t ->leftJoin('hr_as_basic_info as b','mr_excecutive_team.team_lead_id','b.as_id')\n\t\t\t\t\t ->pluck('associate_id');\n\t\t\t$team_members_associateId = DB::table('mr_excecutive_team_members')\n\t\t\t\t\t\t\t\t\t->whereIn('mr_excecutive_team_id',$teamid)\n\t\t\t\t\t\t\t\t\t->leftJoin('hr_as_basic_info as b','mr_excecutive_team_members.member_id','b.as_id')\n\t\t\t\t\t\t\t\t\t->pluck('associate_id');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t$team = array_merge($team_members_associateId->toArray(),$team_lead->toArray());\n\t\t}else{\n\t\t \t$team =[];\n\t\t}\n\t\t$getBuyer = buyer_by_id();\n\t\t$getSeason = season_by_id();\n\t\t$getBrand = brand_by_id();\n\t\t$query= DB::table('mr_order_entry AS OE')\n\t\t->select([\n\t\t\t\"OE.order_id\",\n\t\t\t\"OE.order_code\",\n\t\t\t\"stl.stl_no\",\n\t\t\t\"stl.stl_year\",\n\t\t\t\"stl.mr_season_se_id\",\n\t\t\t\"stl.mr_brand_br_id\",\n\t\t\t\"OE.order_ref_no\",\n\t\t\t\"OE.mr_buyer_b_id\",\n\t\t\t\"OE.order_qty\",\n\t\t\t\"OE.order_delivery_date\",\n\t\t\t\"OE.unit_id\"\n\t\t])\n\t\t->whereIn('OE.mr_buyer_b_id', auth()->user()->buyer_permissions())\n\t\t->leftJoin('mr_style AS stl', 'stl.stl_id', \"OE.mr_style_stl_id\");\n\t\tif(!empty($team)){\n\t\t\t$query->whereIn('OE.created_by', $team);\n\t\t}\n\t\t$data = $query->orderBy('OE.order_id', 'DESC')\n\t\t->get();\n\t\t$getUnit = unit_by_id();\n\n\t\treturn DataTables::of($data)\n\t\t->addIndexColumn()\n\t\t->editColumn('hr_unit_name', function($data) use ($getUnit){\n\t\t\treturn $getUnit[$data->unit_id]['hr_unit_name']??'';\n\t\t})\n\t\t->editColumn('b_name', function($data) use ($getBuyer){\n\t\t\treturn $getBuyer[$data->mr_buyer_b_id]->b_name??'';\n\t\t})\n\t\t->editColumn('br_name', function($data) use ($getBrand){\n\t\t\treturn $getBrand[$data->mr_brand_br_id]->br_name??'';\n\t\t})\n\t\t->editColumn('se_name', function($data) use ($getSeason){\n\t\t\treturn $getSeason[$data->mr_season_se_id]->se_name??''. '-'.$data->stl_year;\n\t\t})\n\t\t->editColumn('order_delivery_date', function($data){\n\t\t\treturn custom_date_format($data->order_delivery_date);\n\t\t})\n\t\t->addColumn('action', function ($data) {\n\t\t\t$action_buttons= \"<div class=\\\"btn-group\\\">\n\t\t\t<a href=\".url('merch/order/bom/'.$data->order_id).\" class=\\\"btn btn-xs btn-success\\\" data-toggle=\\\"tooltip\\\" title=\\\"Order BOM\\\">\n\t\t\t<i class=\\\"ace-icon fa fa-pencil bigger-120\\\"></i>\n\t\t\t</a></div>\";\n\t\t\treturn $action_buttons;\n\t\t})\n\t\t->rawColumns([\n 'order_code', 'hr_unit_name', 'b_name', 'br_name', 'se_name', 'stl_no', 'order_qty', 'order_delivery_date', 'action'\n ])\n ->make(true);\n\t}", "public function competition_team_get()\n\t{\n\n\t\tif($_SERVER['REQUEST_METHOD'] != \"GET\")\n\t\t{\n\t\t $this->response('Not Acceptable',406);\n\t\t}\n\t\t$comp_team_list_arr=array();\n\n\t\t$this->load->model('Table_model');\n\t\t$comp_team_list_arr=$this->Table_model->GetCompetitionTeam();\n\t\tif(count($comp_team_list_arr)>0)\n\t\t{\n\t\t\t$this->response(array('status'=>'success','competition_team'=>$comp_team_list_arr), 200);\n\t\t}\n\t\telse\n\t\t\t$this->response(array('status'=>'failed','message'=>'No records in database'),200);\n\t\n\t\n\t}", "public function teamMembers()\n {\n return $this->request('get', '/api/teams/'.Helpers::config('team').'/members');\n }", "public function getTeamList() {\n if ($this->cached['Team']) return array_values($this->cache['Team']);\n return XPClass::forName('de.uska.db.Team')\n ->getMethod('getPeer')\n ->invoke()\n ->doSelect(new Criteria(\n array('team_id', $this->getTeam_id(), EQUAL)\n ));\n }", "public function actionListmyteam() {\n return array('status' => 0, 'status_msg' => 'ok');\n }", "public function load_teamManagerTeams() {\n\t\treturn $this->noScriptWarning().$this->displayManager();\n\t}", "public function team(){\n\tif ($this->session->userdata('logged_in')){\n\t\t$data['title'] = 'Team';\n\t\t$data['teamsList'] = $this->common_model->get_all('fr_team', '');\n\t\t$this->set_layout('team/team_list',$data);\n\t}else{\n\t\t$this->load->view('site/login');\n\t}\n}", "public function testTeamsGet()\n {\n $this->get('/api/v1/teams', ['Content-Type' => 'application/json', 'Accept' => 'application/json'])\n ->seeJsonStructure([\n '*' => [\n 'id',\n 'name',\n 'nickname',\n 'acronym',\n 'coach',\n 'location',\n ]\n ]);\n }", "public function ownedTeams()\n {\n return $this->request('get', '/api/owned-teams');\n }", "public function get_teams()\r\n\t\t{\r\n\t\t\t$retArr = $this->obj->result;\r\n\r\n\t\t\treturn $retArr;\r\n\t\t}", "function get_team_info_db($idTeam)\n{\n require('./model/connect_db.php');\n $sql = \"select t.nameTeam from team t where t.idteam = '%d'\";\n $request = sprintf($sql,$idTeam);\n $result = mysqli_query($link,$request) or die(utf8_encode(\"request error\") . $request);\n $team_info = mysqli_fetch_assoc($result);\n return $team_info;\n}", "function get_team_details($team_name, $what_to_get){\n\n\t\t//get details from config file to help us connect to the database\n\t\tinclude(\"../config.php\");\n\n\t\t//varaible to return at the end\n\t\t$result_to_return;\n\n\t\t//get what ever details from what ever team has been chosen\n\t\t$sql = \"SELECT $what_to_get FROM basketball_teams_website WHERE team_name = ? ;\";\n\t\t$stmt = mysqli_stmt_init($conn);\n\n\t\t//if connection has failed output error\n\t\tif(!mysqli_stmt_prepare($stmt, $sql)){\n\t\t\t\n\t\t\techo \"sql Statment failed!\";\n\t\t}\n\t\telse{\n\n\t\t// bind parameter to placeholders\n\t\t\tmysqli_stmt_bind_param($stmt, \"s\", $team_name);\n\n\n\t\t// run parameters inside of database\n\t\t\tmysqli_stmt_execute($stmt);\n\t\t\t$result = mysqli_stmt_get_result($stmt);\n\t\t\t$row = mysqli_fetch_assoc($result);\n\n\t\t\t//assign result to return variable to retrived data\n\t\t\t$result_to_return = $row[$what_to_get];\n\t\t}\n\n\t\t//echo data where ever the function has been called\n\t\techo $result_to_return;\n\t}", "protected abstract function fetchLists();", "public function index(Request $request){\n\n return $this->repo->getUserTeams($request->user());\n\n }", "public function index()\n {\n $teams = DB::table('team_user')\n ->where('user_id', Auth::user()->id)\n ->get();\n \n return TeamUserResource::collection($teams, 200); \n }", "public function getAll()\n {\n return Team::all();\n }", "public function index()\n {\n //\n $teams =Team::paginate(2);\n return view('team/lists')->withTeams($teams);\n }" ]
[ "0.7134685", "0.6676885", "0.6662068", "0.65972847", "0.65259886", "0.6419824", "0.6387947", "0.6385662", "0.63537157", "0.6350115", "0.6341144", "0.62110436", "0.62058854", "0.6135939", "0.61335206", "0.6123362", "0.61066926", "0.6099865", "0.6001227", "0.59856087", "0.59597564", "0.59114563", "0.58544016", "0.5854168", "0.58068997", "0.5806749", "0.57983226", "0.5779142", "0.5765675", "0.57476425" ]
0.67592037
1
fetches a list of regions for a given country OR subdivision $subdivision has a higher priority than country, if it is set, countryIdent is ignored.
public function getRegions($countryIdent = NULL, $subdivisionIdent = NULL) { $params = ''; if (NULL !== $countryIdent) { $params = '?land=' . $countryIdent; } if (NULL !== $subdivisionIdent) { $params = '?bundesland=' . $subdivisionIdent; } return $this->getData('/objekt/regionen' . $params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadCountriesFromRegion($region,$companyID) {\n\tif($region) {\n\t\tglobal $trailSessionUser;\n\t\n\t\t$theUserID=0;\n\t\t//ensure $trailSessionUser is not a visitor\n\t\tif(substr($trailSessionUser,0,7)!=\"visitor\") {\n\t\t\t$theUserID=getUserID($trailSessionUser);\n\t\t}\n\t\n\t\t//get the towns first\n\t\t$query=0;\n\t\t$query=mysqlquery(\"select distinct countryID,country from vl_countries where region='$region' order by country\");\n\t\tif(mysqlnumrows($query)) {\n\t\t\t$return=0;\n\t\t\t$return=\"\n\t\t\t\t<table width=\\\"100%\\\" border=\\\"0\\\">\n\t\t\t\t <tr>\n\t\t\t\t\t<td colspan=\\\"2\\\">Select the markets covered:</td>\n\t\t\t\t </tr>\";\n\t\t\t$q=array();\n\t\t\twhile($q=mysqlfetcharray($query)) {\n\t\t\t\t$return.=\"\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td width=\\\"1%\\\"><input type=\\\"checkbox\\\" name=\\\"marketscoveredUnique[]\\\" value=\\\"$q[countryID]\\\" \".(checkMarketAgainstProvider($theUserID,$q[\"countryID\"],$companyID)?\"checked\":\"\").\"></td>\n\t\t\t\t\t\t\t<td width=\\\"99%\\\">\".removeSpecialCharacters($q[country]).\"</td>\n\t\t\t\t\t\t</tr>\";\n\t\t\t}\n\t\t\t$return.=\"</table>\";\n\t\n\t\t\treturn $return;\n\t\t} else {\n\t\t\t$return=0;\n\t\t\t//$return=\"No countries found in database!\";\n\t\t\t$return=\"\";\n\t\n\t\t\treturn $return;\n\t\t}\n\t}\n}", "function subDivByCountry(Country $country) {\n $out = [];\n $r = $this->db->query(\"SELECT divcode, divname FROM country_state WHERE country = '{$country->code}' and type!='Outlying area'\");\n while($row = $r->fetchArray(SQLITE3_ASSOC)) {\n $out[] = new SubDivision($country, $row['divcode'], $row['divname']);\n }\n return $out;\n }", "function getCustomerEngRegion($customer_id)\n {\n /* @changes: intersect of region\n * @author: Sagar Jogi dt: 09/08/2017\n */\n $user=DB::query(\"SELECT r.region FROM \" . CFG::$tblPrefix . \"user AS r WHERE active='1' and r.id=%d\",$_SESSION['user_login']['id']);\n $cust=DB::query(\" SELECT c.region_id as cregion FROM \" . CFG::$tblPrefix . \"user_region AS c WHERE c.user_id=%d\",$customer_id);\n foreach($cust as $k=>$v){\n $abc.=$cust[$k]['cregion'].',';\n }\n $check=DB::query(\"SELECT all_region FROM \" . CFG::$tblPrefix . \"user WHERE id=%d\",$_SESSION['user_login']['id']);\n if($check[0]['all_region']=='1') {\n return DB::query(\"SELECT r.id,r.name FROM \" . CFG::$tblPrefix . \"region r WHERE status='1' and FIND_IN_SET( r.id, '$abc') order by name asc\");\n } else {\n \n \n// pre($abc);exit;\n $userexp= explode(',',$user[0]['region']);\n $custexp= explode(',',$abc);\n \n// pre($cust);exit;\n $result=array_intersect($userexp,$custexp);\n $resimp= implode(',', $result);\n// pre($cust);exit;\n return DB::query(\"SELECT r.id,r.name FROM \" . CFG::$tblPrefix . \"region AS r WHERE FIND_IN_SET( r.id, '$resimp')\"); \n }\n /*return DB::query(\"SELECT r.id,r.name FROM \" . CFG::$tblPrefix . \"region AS r LEFT JOIN \" . CFG::$tblPrefix . \"user AS u ON FIND_IN_SET( r.id, u.region ) >0\nWHERE u.id =%d and u.active='1' and r.status='1'\",$customer_id); */\n \n }", "public function countryRegionAction()\n {\n $arrRes = array();\n\n $countryId = $this->getRequest()->getParam('parent');\n $colRegions = Mage::getResourceModel('directory/region_collection')\n ->addCountryFilter($countryId)\n ->load();\n \n\t$arrRegions = $this->_toOptionArray($colRegions);\n if (!empty($arrRegions)) {\n foreach ($arrRegions as $region) {\n $arrRes[] = $region;\n }\n }\n\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($arrRes));\n }", "function _get_regions_subregions(){\n $this->gen_contents['regions'] = $this->admin_career_event_model->dbSelectAllRegions();\n $arr_data = $this->admin_career_event_model->dbSelectAllSubRegions();\n $this->gen_contents['raw_subregion']= $arr_data;\n $id \t\t\t\t\t= 0;\n $arr_subregion\t\t\t\t= array();\n\n foreach ($arr_data as $value){\n if($id != $value->regionid){\n $id = $value->regionid;\n $arr_subregion['R'][$id] = array();\n }\n $arr_subregion['R'][$id][] = array('id' =>$value->id,'name'=>$value->sub_name);\n }\n //gets all the region and subregion for the purpose of displaying filter\n //used to diaply subregion using jason array \t\t\t\t\n $this->gen_contents['json_array'] \t= json_encode($arr_subregion);\n\t\t\t\n\t\t}", "public function getCountriesPerRegion();", "public function getCountriesData(string $country = null, string $options = null, array $headers = ['Content-Type' => 'application/json'])\n\t{\n\t\ttry {\n\t\t\t$getContent = collect(Http::get($this->api)->json());\n\t\t\t$data = $getContent->flatten(1);\n\t\t\tif (! is_null($country)) {\n\t\t\t\t$countryData = $data->filter(function($element) use ($country) {\n\t\t\t\t\treturn false !== stripos($element['Country_Region'], $country);\n\t\t\t\t})->first();\n\t\t\t\tif($countryData) {\n\t\t\t\t\tif(! is_null($options)) {\n\t\t\t\t\t\tswitch ($options) {\n\t\t\t\t\t\t\tcase 'Confirmed':\n\t\t\t\t\t\t\tcase 'confirmed':\n\t\t\t\t\t\t\tcase 'Positif':\n\t\t\t\t\t\t\tcase 'positif':\n\t\t\t\t\t\t\t\t$getCase[$countryData['Country_Region'] . '_Confirmed'] = $countryData['Confirmed'];\n\t\t\t\t\t\t\t\treturn response()->json($getCase)->withHeaders($headers);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase 'Deaths':\n\t\t\t\t\t\t\tcase 'deaths':\n\t\t\t\t\t\t\tcase 'Meninggal':\n\t\t\t\t\t\t\tcase 'meninggal':\n\t\t\t\t\t\t\t\t$getCase[$countryData['Country_Region'] . '_Deaths'] = $countryData['Deaths'];\n\t\t\t\t\t\t\t\treturn response()->json($getCase)->withHeaders($headers);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'Recovered':\n\t\t\t\t\t\t\tcase 'recovered':\n\t\t\t\t\t\t\tcase 'Sembuh':\n\t\t\t\t\t\t\tcase 'sembuh':\n\t\t\t\t\t\t\t\t$getCase[$countryData['Country_Region'] . '_Recovered'] = $countryData['Recovered'];\n\t\t\t\t\t\t\t\treturn response()->json($getCase)->withHeaders($headers);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tabort(404, 'Sorry, Please Input Your Query Correctly!');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif(is_null($options)) {\n\t\t\t\t\t\treturn response()->json($countryData)->withHeaders($headers);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tabort(500, 'Something Went Wrong!');\n\t\t\t\t\t}\n\t\t\t\t} elseif(! $countryData) {\n\t\t\t\t\tabort(404, 'Sorry, the Country You are For Looking Doesn\\'t Exists');\n\t\t\t\t} else {\n\t\t\t\t\tabort(500, 'Something Went Wrong!');\n\t\t\t\t}\n\t\t\t} elseif(is_null($country)) {\n\t\t\t\t$getCountry = Arr::pluck($data, 'Country_Region');\n\t\t\t\treturn response()->json($getCountry);\n\t\t\t} else {\n\t\t\t\tabort(500, 'Something Went Wrong!');\n\t\t\t}\n\t\t} catch (\\Exception $e) {\n\t\t\tthrow new \\Exception($e->getMessage());\n\t\t}\n\t}", "function getRegionsStub($country)\n{\n return array(\"Kentriki Makedonia\", \"Thraki\", \"Peloponisos\", \"Kriti\");\n}", "public function get_regions($country_code)\n\t{\n\t\t$query = \"SELECT `country`, `region`, `name` FROM `regions` WHERE `country` = '\".$country_code.\"' ORDER BY CASE WHEN `region` = '\".NO_REGION.\"' THEN 1 ELSE 0 END, `region`\";\n\t\t$result = $this->db->query($query);\n\t\tif ($result->num_rows() > 0 ) \n\t\t\treturn $result->result();\n\t\treturn false;\n\t}", "function getCountryRegion($country) {\n\treturn getDetailedTableInfo2(\"vl_countries\",\"lower(country)=lower('$country')\",\"region\");\n}", "public function getRegionsByCountryAction(Request $request) {\n $em = $this->getDoctrine()->getManager();\n $countryId = $request->get('countryId');\n $type = $request->get('type');\n $typeClass = $request->get('typeClass');\n\n $regions = $em->getRepository('AppBundle:Region')->getByCountry($countryId);\n\n $response = $this->render('AppBundle:Location/ajax:regions.html.twig', array(\n 'regions' => $regions,\n 'type' => $type,\n 'typeClass'=> $typeClass\n ))->getContent();\n\n return new Response(json_encode($response));\n }", "public function getRegions($countryId = NULL) {\n if (isset($countryId) && $countryId != '') {\n $html = '<option value=\"\">--Select State--</option> ';\n\n $countryData = $this->get_single_row_by_id(TBL_COUNTRIES, 'id', $countryId, 'array');\n\n $this->db->select('id, country_id, region, code'); \n $this->db->where('country_id', $countryData['id']);\n $result = $this->db->get(TBL_REGIONS);\n if ($result->num_rows() > 0 )\n $data = $result->result_array();\n \n if (is_array($data) && !empty($data)) {\n foreach ($data as $states) {\n if ($countryData['country_name'] != $states['region'])\n $html .= '<option value=\"' . $states['id'] . '\">' . $states['region'] . '</option>';\n }\n } else {\n $html = '';\n $html .= '<option value=\"\">No States Available</option>';\n }\n return $html;\n } else {\n $this->db->select('id, country_id, region, code'); \n $result = $this->db->get(TBL_REGIONS);\n if ($result->num_rows() > 0 )\n return $result->result_array();\n else\n return FALSE;\n }\n }", "public function getInstitutionsByCountry($id);", "function getCustomerRegion($customer_id)\n {\n return DB::query(\"SELECT r.id,r.name FROM \" . CFG::$tblPrefix . \"region AS r LEFT JOIN \" . CFG::$tblPrefix . \"user AS u ON FIND_IN_SET( r.id, u.region ) >0\nWHERE u.id =%d and u.active='1' and r.status='1'\",$customer_id);\n }", "function subDivByID(Country $country, $code) {\n $r = $this->db->query(\"SELECT divcode, divname FROM country_state WHERE country = '{$country->code}' AND divcode='{$code}'\");\n $row = $r->fetchArray(SQLITE3_ASSOC);\n if(!$row) throw new NotFoundEx(\"SubDivision could not be found ({$country->code}-{$code})\");\n return new SubDivision($country, $row['divcode'], $row['divname']);\n }", "function get_continent_by_country($country, $countrytocontinent = array(\"AD\"=>\"EU\",\"AE\"=>\"AS\",\"AF\"=>\"AS\",\"AG\"=>\"NA\",\"AI\"=>\"NA\",\"AL\"=>\"EU\",\"AM\"=>\"AS\",\"AN\"=>\"NA\",\"AO\"=>\"AF\",\"AP\"=>\"AS\",\"AR\"=>\"SA\",\"AS\"=>\"OC\",\"AT\"=>\"EU\",\"AU\"=>\"OC\",\"AW\"=>\"NA\",\"AX\"=>\"EU\",\"AZ\"=>\"AS\",\"BA\"=>\"EU\",\"BB\"=>\"NA\",\"BD\"=>\"AS\",\"BE\"=>\"EU\",\"BF\"=>\"AF\",\"BG\"=>\"EU\",\"BH\"=>\"AS\",\"BI\"=>\"AF\",\"BJ\"=>\"AF\",\"BL\"=>\"NA\",\"BM\"=>\"NA\",\"BN\"=>\"AS\",\"BO\"=>\"SA\",\"BR\"=>\"SA\",\"BS\"=>\"NA\",\"BT\"=>\"AS\",\"BV\"=>\"AN\",\"BW\"=>\"AF\",\"BY\"=>\"EU\",\"BZ\"=>\"NA\",\"CA\"=>\"NA\",\"CC\"=>\"AS\",\"CD\"=>\"AF\",\"CF\"=>\"AF\",\"CG\"=>\"AF\",\"CH\"=>\"EU\",\"CI\"=>\"AF\",\"CK\"=>\"OC\",\"CL\"=>\"SA\",\"CM\"=>\"AF\",\"CN\"=>\"AS\",\"CO\"=>\"SA\",\"CR,NA\",\"CU\"=>\"NA\",\"CV\"=>\"AF\",\"CX\"=>\"AS\",\"CY\"=>\"AS\",\"CZ\"=>\"EU\",\"DE\"=>\"EU\",\"DJ\"=>\"AF\",\"DK\"=>\"EU\",\"DM\"=>\"NA\",\"DO\"=>\"NA\",\"DZ\"=>\"AF\",\"EC\"=>\"SA\",\"EE\"=>\"EU\",\"EG\"=>\"AF\",\"EH\"=>\"AF\",\"ER\"=>\"AF\",\"ES\"=>\"EU\",\"ET\"=>\"AF\",\"EU\"=>\"EU\",\"FI\"=>\"EU\",\"FJ\"=>\"OC\",\"FK\"=>\"SA\",\"FM\"=>\"OC\",\"FO\"=>\"EU\",\"FR\"=>\"EU\",\"FX\"=>\"EU\",\"GA\"=>\"AF\",\"GB\"=>\"EU\",\"GD\"=>\"NA\",\"GE\"=>\"AS\",\"GF\"=>\"SA\",\"GG\"=>\"EU\",\"GH\"=>\"AF\",\"GI\"=>\"EU\",\"GL\"=>\"NA\",\"GM\"=>\"AF\",\"GN\"=>\"AF\",\"GP\"=>\"NA\",\"GQ\"=>\"AF\",\"GR\"=>\"EU\",\"GS\"=>\"AN\",\"GT\"=>\"NA\",\"GU\"=>\"OC\",\"GW\"=>\"AF\",\"GY\"=>\"SA\",\"HK\"=>\"AS\",\"HM\"=>\"AN\",\"HN\"=>\"NA\",\"HR\"=>\"EU\",\"HT\"=>\"NA\",\"HU\"=>\"EU\",\"ID\"=>\"AS\",\"IE\"=>\"EU\",\"IL\"=>\"AS\",\"IM\"=>\"EU\",\"IN\"=>\"AS\",\"IO\"=>\"AS\",\"IQ\"=>\"AS\",\"IR\"=>\"AS\",\"IS\"=>\"EU\",\"IT\"=>\"EU\",\"JE\"=>\"EU\",\"JM\"=>\"NA\",\"JO\"=>\"AS\",\"JP\"=>\"AS\",\"KE\"=>\"AF\",\"KG\"=>\"AS\",\"KH\"=>\"AS\",\"KI\"=>\"OC\",\"KM\"=>\"AF\",\"KN\"=>\"NA\",\"KP\"=>\"AS\",\"KR\"=>\"AS\",\"KW\"=>\"AS\",\"KY\"=>\"NA\",\"KZ\"=>\"AS\",\"LA\"=>\"AS\",\"LB\"=>\"AS\",\"LC\"=>\"NA\",\"LI\"=>\"EU\",\"LK\"=>\"AS\",\"LR\"=>\"AF\",\"LS\"=>\"AF\",\"LT\"=>\"EU\",\"LU\"=>\"EU\",\"LV\"=>\"EU\",\"LY\"=>\"AF\",\"MA\"=>\"AF\",\"MC\"=>\"EU\",\"MD\"=>\"EU\",\"ME\"=>\"EU\",\"MF\"=>\"NA\",\"MG\"=>\"AF\",\"MH\"=>\"OC\",\"MK\"=>\"EU\",\"ML\"=>\"AF\",\"MM\"=>\"AS\",\"MN\"=>\"AS\",\"MO\"=>\"AS\",\"MP\"=>\"OC\",\"MQ\"=>\"NA\",\"MR\"=>\"AF\",\"MS\"=>\"NA\",\"MT\"=>\"EU\",\"MU\"=>\"AF\",\"MV\"=>\"AS\",\"MW\"=>\"AF\",\"MX\"=>\"NA\",\"MY\"=>\"AS\",\"MZ\"=>\"AF\",\"NA\"=>\"AF\",\"NC\"=>\"OC\",\"NE\"=>\"AF\",\"NF\"=>\"OC\",\"NG\"=>\"AF\",\"NI\"=>\"NA\",\"NL\"=>\"EU\",\"NO\"=>\"EU\",\"NP\"=>\"AS\",\"NR\"=>\"OC\",\"NU\"=>\"OC\",\"NZ\"=>\"OC\",\"OM\"=>\"AS\",\"PA\"=>\"NA\",\"PE\"=>\"SA\",\"PF\"=>\"OC\",\"PG\"=>\"OC\",\"PH\"=>\"AS\",\"PK\"=>\"AS\",\"PL\"=>\"EU\",\"PM\"=>\"NA\",\"PN\"=>\"OC\",\"PR\"=>\"NA\",\"PS\"=>\"AS\",\"PT\"=>\"EU\",\"PW\"=>\"OC\",\"PY\"=>\"SA\",\"QA\"=>\"AS\",\"RE\"=>\"AF\",\"RO\"=>\"EU\",\"RS\"=>\"EU\",\"RU\"=>\"EU\",\"RW\"=>\"AF\",\"SA\"=>\"AS\",\"SB\"=>\"OC\",\"SC\"=>\"AF\",\"SD\"=>\"AF\",\"SE\"=>\"EU\",\"SG\"=>\"AS\",\"SH\"=>\"AF\",\"SI\"=>\"EU\",\"SJ\"=>\"EU\",\"SK\"=>\"EU\",\"SL\"=>\"AF\",\"SM\"=>\"EU\",\"SN\"=>\"AF\",\"SO\"=>\"AF\",\"SR\"=>\"SA\",\"ST\"=>\"AF\",\"SV\"=>\"NA\",\"SY\"=>\"AS\",\"SZ\"=>\"AF\",\"TC\"=>\"NA\",\"TD\"=>\"AF\",\"TF\"=>\"AN\",\"TG\"=>\"AF\",\"TH\"=>\"AS\",\"TJ\"=>\"AS\",\"TK\"=>\"OC\",\"TL\"=>\"AS\",\"TM\"=>\"AS\",\"TN\"=>\"AF\",\"TO\"=>\"OC\",\"TR\"=>\"EU\",\"TT\"=>\"NA\",\"TV\"=>\"OC\",\"TW\"=>\"AS\",\"TZ\"=>\"AF\",\"UA\"=>\"EU\",\"UG\"=>\"AF\",\"UM\"=>\"OC\",\"US\"=>\"NA\",\"UY\"=>\"SA\",\"UZ\"=>\"AS\",\"VA\"=>\"EU\",\"VC\"=>\"NA\",\"VE\"=>\"SA\",\"VG\"=>\"NA\",\"VI\"=>\"NA\",\"VN\"=>\"AS\",\"VU\"=>\"OC\",\"WF\"=>\"OC\",\"WS\"=>\"OC\",\"YE\"=>\"AS\",\"YT\"=>\"AF\",\"ZA\"=>\"AF\",\"ZM\"=>\"AF\",\"ZW\"=>\"AF\")) {\n\n // Check if given array contains continent of given country\n if(isset($country) && isset($countrytocontinent) && array_key_exists($country, $countrytocontinent)) {\n // Return continent\n return $countrytocontinent[$country];\n }\n\n // Return null if continent is unknown\n return null;\n}", "function getcountries_get(){\n\n $from = 'countries';\n $where = array();\n $select = '*';\n $records = 2;\n\n $countries = $this->base_model->getCommon($from, $where, $select, $records);\n\n if ($countries) {\n \n $response = array(\n 'status' => TRUE,\n 'message' => 'Countries found successfully.',\n 'result' => $countries);\n\n $this->set_response($response, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code \n }else{\n $response = array(\n 'status' => FALSE,\n 'message' => 'Country not found.');\n $this->response($response, REST_Controller::FIELD_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code\n }\n }", "function sbs_get_countries($countries_id = '', $with_iso_codes = false) {\n $countries_array = array();\n\n if ($countries_id) {\n\n if ($with_iso_codes) {\n $countries = tep_db_query(\"select countries_name, countries_iso_code_2, countries_iso_code_3 from \" . TABLE_COUNTRIES . \" where countries_id = '\" . $countries_id . \"' order by countries_name\");\n $countries_values = tep_db_fetch_array($countries);\n $countries_array = array('countries_name' => $countries_values['countries_name'],\n 'countries_iso_code_2' => $countries_values['countries_iso_code_2'],\n 'countries_iso_code_3' => $countries_values['countries_iso_code_3']);\n } else {\n $countries = tep_db_query(\"select countries_name from \" . TABLE_COUNTRIES . \" where countries_id = '\" . $countries_id . \"'\");\n $countries_values = tep_db_fetch_array($countries);\n $countries_array = array('countries_name' => $countries_values['countries_name']);\n }\n\n } else {\n\n $countries = tep_db_query(\"select countries_id, countries_name from \" . TABLE_COUNTRIES . \" order by countries_name\");\n\n while ($countries_values = tep_db_fetch_array($countries)) {\n\n $countries_array[] = array('countries_id' => $countries_values['countries_id'],\n 'countries_name' => $countries_values['countries_name']);\n }\n }\n\n return $countries_array;\n }", "function tep_get_countries($countries_id = '', $with_iso_codes = false) {\n\t$countries_array = array();\n\tif (tep_not_null($countries_id)) {\n\t\tif ($with_iso_codes == true) {\n\t\t\t$countries = tep_db_query(\"select countries_name, countries_iso_code_2, countries_iso_code_3 from \" . TABLE_COUNTRIES . \" where countries_id = '\" . (int)$countries_id . \"' order by countries_name\");\n\t\t\t$countries_values = tep_db_fetch_array($countries);\n\t\t\t$countries_array = array('countries_name' => $countries_values['countries_name'],\n\t\t\t\t\t\t\t\t\t 'countries_iso_code_2' => $countries_values['countries_iso_code_2'],\n\t\t\t\t\t\t\t\t\t 'countries_iso_code_3' => $countries_values['countries_iso_code_3']);\n\t\t} else {\n\t\t\t$countries = tep_db_query(\"select countries_name from \" . TABLE_COUNTRIES . \" where countries_id = '\" . (int)$countries_id . \"'\");\n\t\t\t$countries_values = tep_db_fetch_array($countries);\n\t\t\t$countries_array = array('countries_name' => $countries_values['countries_name']);\n\t\t}\n\t} else {\n\t\t$countries = tep_db_query(\"select countries_id, countries_name from \" . TABLE_COUNTRIES . \" order by countries_name\");\n\t\twhile ($countries_values = tep_db_fetch_array($countries)) {\n\t\t\t$countries_array[] = array('countries_id' => $countries_values['countries_id'],\n\t\t\t\t\t\t\t\t\t 'countries_name' => $countries_values['countries_name']);\n\t\t}\n\t}\n\treturn $countries_array;\n}", "public function getAllStatesByCountryId($country) {\n $countryName = '';\n $countryId = '';\n $countries = explode(\"/\", $country);\n $countryName = $countries[0]; // piece1\n $countryId = $countries[1]; // piece2\n\n $sql = \"SELECT * FROM states WHERE country_id = '$countryId'\";\n $result = $this->db->query($sql);\n if ($result->num_rows() <= 0) {\n return false;\n } else {\n return $result->result_array();\n }\n }", "public function getRegionJsonList()\n {\n $collectionByCountry = [];\n /** @var \\Magento\\Directory\\Model\\ResourceModel\\Region\\Collection $collection */\n $collection = $this->regionCollectionFactory->create();\n /** @var \\Magento\\Directory\\Model\\Region $item */\n foreach ($collection as $item) {\n $collectionByCountry[$item->getData('country_id')][] = $item->getData();\n }\n\n return $collectionByCountry;\n }", "public function findRegionFromCountry ( $country = '' ) {\n\n if(empty($country))\n return '';\n\n $return = array_keys($this->regionToCountry, strtoupper($country));\n\n if(!empty($return))\n return $return[0];\n else\n return '';\n }", "public function GetRegions($flags=null, $excludeFlags=null, $start=0, $count=10, $sortRegionName=null, $sortLocX=null, $sortLocY=null, $asArray=false){\n\t\t\tif(isset($flags) === false){\n\t\t\t\t$flags = RegionFlags::RegionOnline;\n\t\t\t}\n\t\t\tif(isset($excludeFlags) === false){\n\t\t\t\t$excludeFlags = 0;\n\t\t\t}\n\t\t\tif(is_string($flags) === true && ctype_digit($flags) === true){\n\t\t\t\t$flags = (integer)$flags;\n\t\t\t}\n\t\t\tif(is_string($excludeFlags) === true && ctype_digit($excludeFlags) === true){\n\t\t\t\t$excludeFlags = (integer)$excludeFlags;\n\t\t\t}\n\t\t\tif(is_string($start) === true && ctype_digit($start) === true){\n\t\t\t\t$start = (integer)$start;\n\t\t\t}\n\t\t\tif(is_string($count) === true && ctype_digit($count) === true){\n\t\t\t\t$count = (integer)$count;\n\t\t\t}\n\n\t\t\tif(is_bool($asArray) === false){\n\t\t\t\tthrow new InvalidArgumentException('asArray flag must be a boolean.');\n\t\t\t}else if(is_integer($flags) === false){\n\t\t\t\tthrow new InvalidArgumentException('RegionFlags argument should be supplied as integer.');\n\t\t\t}else if($flags < 0){\n\t\t\t\tthrow new InvalidArgumentException('RegionFlags cannot be less than zero');\n\t\t\t}else if(RegionFlags::isValid($flags) === false){ // Aurora::Framework::RegionFlags::isValid() does do a check for integerness, but we want to throw a different exception message if it is an integer.\n\t\t\t\tthrow new InvalidArgumentException('RegionFlags value is invalid, aborting call to API');\n\t\t\t}else if($excludeFlags < 0){\n\t\t\t\tthrow new InvalidArgumentException('Region ExcludeFlags cannot be less than zero');\n\t\t\t}else if(RegionFlags::isValid($excludeFlags) === false){ // Aurora::Framework::RegionFlags::isValid() does do a check for integerness, but we want to throw a different exception message if it is an integer.\n\t\t\t\tthrow new InvalidArgumentException('Region ExcludeFlags value is invalid, aborting call to API');\n\t\t\t}else if(is_integer($start) === false){\n\t\t\t\tthrow new InvalidArgumentException('Start point must be an integer.');\n\t\t\t}else if(isset($count) === true){\n\t\t\t\tif(is_integer($count) === false){\n\t\t\t\t\tthrow new InvalidArgumentException('Count must be an integer.');\n\t\t\t\t}else if($count < 1){\n\t\t\t\t\tthrow new InvalidArgumentException('Count must be greater than zero.');\n\t\t\t\t}\n\t\t\t}else if(isset($sortRegionName) === true && is_bool($sortRegionName) === false){\n\t\t\t\tthrow new InvalidArgumentException('If set, the sort by region name flag must be a boolean.');\n\t\t\t}else if(isset($sortLocX) === true && is_bool($sortLocX) === false){\n\t\t\t\tthrow new InvalidArgumentException('If set, the sort by x-axis flag must be a boolean.');\n\t\t\t}else if(isset($sortLocY) === true && is_bool($sortLocY) === false){\n\t\t\t\tthrow new InvalidArgumentException('If set, the sort by y-axis flag must be a boolean.');\n\t\t\t}\n\t\t\t$response = array();\n\t\t\t$input = array(\n\t\t\t\t'RegionFlags' => $flags,\n\t\t\t\t'ExcludeRegionFlags' => $excludeFlags,\n\t\t\t\t'Start' => $start,\n\t\t\t\t'Count' => $count\n\t\t\t);\n\t\t\tif(isset($sortRegionName) === true){\n\t\t\t\t$input['SortRegionName'] = $sortRegionName;\n\t\t\t}\n\t\t\tif(isset($sortLocX) === true){\n\t\t\t\t$input['SortLocX'] = $sortLocX;\n\t\t\t}\n\t\t\tif(isset($sortLocY) === true){\n\t\t\t\t$input['SortLocY'] = $sortLocY;\n\t\t\t}\n\t\t\t$has = WebUI\\GetRegions::hasInstance($this, $flags, $excludeFlags, $sortRegionName, $sortLocX, $sortLocY);\n\t\t\tif($asArray === true || $has === false){\n\t\t\t\t$result = $this->makeCallToAPI('GetRegions', true, $input, array(\n\t\t\t\t\t'Regions' => array('array'=>array(static::GridRegionValidator())),\n\t\t\t\t\t'Total' => array('integer'=>array())\n\t\t\t\t));\n\t\t\t\tforeach($result->Regions as $val){\n\t\t\t\t\t$response[] = WebUI\\GridRegion::fromEndPointResult($val);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $asArray ? $response : WebUI\\GetRegions::r($this, $flags, $excludeFlags, $start, $has ? null : $result->Total, $sortRegionName, $sortLocX, $sortLocY, $response);\n\t\t}", "function loadUbicaciones($where, $paso, $pais){\n\tinclude 'libcon.php';\n //$ubica = \"\";\n $bandera = false;\n if($pais == \"\"){\n $sql = \"SELECT * FROM web_salones WHERE concepto = $where AND estado = 1 ORDER BY regionsalon ASC;\";\n $result = miBusquedaSQL($sql);\n $ubica = armarUbicaciones($result, $paso);\n return $ubica;\n } else{\n $nuevoarray = array();$i=0;\n $sqlreg = \"SELECT campo, campo2, campo3, campo4, B.CONCEPTO, B.REGIONSALON, B.ESTADO FROM ms_configuracion A INNER JOIN (SELECT CONCEPTO, ESTADO, REGIONSALON FROM web_salones) B ON A.campo = B.REGIONSALON WHERE A.grupo = 'regiones' AND B.CONCEPTO = \".$where.\" AND B.ESTADO = 1;\";\n $regiones = (array) json_decode(miBusquedaSQL($sqlreg), true);\n foreach ($regiones as $r) {\n if($r[3] == $pais){\n $region = $r[0];\n $bandera = true;\n }\n\n $nuevoarray[$i] = $r[0];\n $i++;\n }\n\n if($bandera == true){\n $sql = \"SELECT * FROM web_salones WHERE concepto = $where AND estado = 1 AND regionsalon = \".$region.\" ORDER BY regionsalon ASC;\";\n $result = miBusquedaSQL($sql);\n $ubica = armarUbicaciones($result, $paso);\n } else if($bandera == false){\n $ubica = \"<b>No hubo resultados en la región consultada. Consulte en: </b><br><br><div class='blog-posts grid-view grid-concepto'><div class='isotope row'>\";\n $flag = \"\";$j=0;$hola=\"\";\n $unique = array_keys(array_flip($nuevoarray)); \n //var_dump($unique);\n $first_names = array_column($regiones, 'campo3');\n $unique2 = array_keys(array_flip($first_names)); \n //print_r($unique2);\n\n foreach ($unique as $r) {\n //$flag .= \"<img src='\".$r[2].\"' width='30px!important' height='22px' style='width:30px!important;''><br>\";\n \n\n $flag .= '<div class=\"col-md-2 col-sm-3 grid-view-post item\">\n <div class=\"item1 post\">\n <div class=\"box text-center\">\n <a href=\"?country='.abrevRegion($r).'\"><img class=\"ubiflags\" src=\"'.$unique2[$j].'\"><strong>'.cambiarRegion($r).'</strong></a>\n </div> \n </div>\n </div>';\n \n $j++;\n }\n\n $ubica .= $flag . \"</div></div>\";\n }\n\n return $ubica;\n }\n }", "function getCountries($region_id) {\n global $myPDODB, $whereFilter;\n\n\n $whereLocal = array();\n array_push($whereLocal, \"c.region_id = $region_id\");\n\n $whereClause = getWhereClause($whereLocal);\n\n $sql = \"SELECT c.name AS 'name', c.id AS 'id', c.map_id as 'map_id',COUNT( s.id ) AS 'number', 'country' AS 'type'\nFROM countries AS c\nJOIN students AS s ON c.id = s.destination_country \njoin regions as r on c.region_id = r.id \n$whereClause\nGROUP BY c.name\nORDER BY c.name\";\n\n $sth = $myPDODB->prepare($sql);\n $result = $sth->execute();\n\n $output = array();\n\n if ($result) {\n $countries = $sth->fetchAll(PDO::FETCH_ASSOC);\n\n foreach ($countries as $country) {\n // get the unis for each country\n $unis = getUnis($country['id']);\n array_push($output, array(\"item_id\" => ($country['map_id'] * 10) + ($region_id * 100000), \"name\" => $country['name'], \"number\" => $country['number'], \"type\" => $country['type'], \"children\" => $unis));\n }\n }\n\n // add the country details to the output array\n return $output;\n}", "public static function findAll( $countryid ) {\n\t\t\n \treturn Doctrine_Query::create ()->from ( 'Regions s' )\n ->where('s.country_id = ?', array($countryid))\n \t\t\t\t\t\t\t\t->orderBy('s.name')\n \t\t\t\t\t\t\t\t->execute ( array (), Doctrine_Core::HYDRATE_ARRAY );\t\t\n\t}", "function loadCountriesForSelection($companyID) {\n\tglobal $trailSessionUser;\n\n\t$theUserID=0;\n\t//ensure $trailSessionUser is not a visitor\n\tif(substr($trailSessionUser,0,7)!=\"visitor\") {\n\t\t$theUserID=getUserID($trailSessionUser);\n\t}\n\n\t//get the towns first\n\t$query=0;\n\t$query=mysqlquery(\"select distinct countryID,country from vl_countries order by country\");\n\tif(mysqlnumrows($query)) {\n\t\t$return=0;\n\t\t$return=\"\n\t\t\t<table width=\\\"100%\\\" border=\\\"0\\\">\n\t\t\t <tr>\n\t\t\t\t<td colspan=\\\"2\\\">Select the markets covered:</td>\n\t\t\t </tr>\";\n\t\t$q=array();\n\t\twhile($q=mysqlfetcharray($query)) {\n\t\t\t$return.=\"\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\\\"1%\\\"><input type=\\\"checkbox\\\" name=\\\"marketscoveredUnique[]\\\" value=\\\"$q[countryID]\\\" \".(checkMarketAgainstProvider($theUserID,$q[\"countryID\"],$companyID)?\"checked\":\"\").\"></td>\n\t\t\t\t\t\t<td width=\\\"99%\\\">\".removeSpecialCharacters($q[country]).\"</td>\n\t\t\t\t\t</tr>\";\n\t\t}\n\t\t$return.=\"</table>\";\n\n\t\treturn $return;\n\t} else {\n\t\t$return=0;\n\t\t//$return=\"No countries found in database!\";\n\t\t$return=\"\";\n\n\t\treturn $return;\n\t}\n}", "function getRegions() {\n global $myPDODB, $whereFilter;\n $output = array();\n\n $whereLocal = array();\n $whereClause = getWhereClause($whereLocal);\n\n $sql = \"SELECT r.name AS 'name', r.id AS 'id', COUNT( s.id ) AS 'number', 'region' AS 'type'\nFROM regions AS r\nJOIN countries AS c ON r.id = c.region_id\nJOIN students AS s ON c.id = s.destination_country \n$whereClause\nGROUP BY r.name\nORDER BY r.name;\";\n\n $sth = $myPDODB->prepare($sql);\n $result = $sth->execute();\n\n if ($result) {\n $regions = $sth->fetchAll(PDO::FETCH_ASSOC);\n\n foreach ($regions as $region) {\n // get the country details for each region\n $countries = getCountries($region['id']);\n array_push($output, array(\"item_id\" => $region['id'] * 100000, \"fixed\" => true, \"name\" => $region['name'], \"number\" => $region['number'], \"type\" => $region['type'], \"children\" => $countries));\n }\n }\n\n // add the regions to the output array\n return $output;\n}", "function get_accounts_for_country($county_ids)\n{\n if (!is_array($county_ids)) {\n $county_ids = array($county_ids);\n }\n // watchdog('test', json_encode(var_dump($county_ids)));\n $nodes = array();\n if (!empty($county_ids)) {\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'account')\n ->fieldCondition('field_single_country', 'target_id', $county_ids, 'IN')\n ->addMetaData('account', user_load(1));\n\n $nodes = $query->execute();\n }\n\n // watchdog('test', json_encode($nodes));\n if (empty($nodes)) {\n return [];\n }\n\n // Extract ids from the nodes.\n $accounts = array_keys($nodes['node']);\n return $accounts;\n}", "function getCountries($type, $query, $countriesParams) {\n if ($type === 'alpha' && (strLen($query) > 3 || strLen($query) < 2)) {\n echo json_encode(['error' => 'Country codes must be 2-3 characters long']);\n return;\n }\n $client = new Client(['base_uri' => 'https://restcountries.eu/rest/v2/', 'http_errors' => false]);\n $response = $client->request('GET', \"$type/$query\", [\n 'query' => $countriesParams\n ]);\n if ($response->getStatusCode() == 404) {\n echo json_encode(['error' => 'No results found']);\n return;\n }\n $response = json_decode($response->getBody());\n returnCountries((array)$response);\n}" ]
[ "0.591614", "0.588374", "0.572429", "0.5716984", "0.56642544", "0.56364155", "0.5634883", "0.5538464", "0.5441478", "0.54394996", "0.54124194", "0.53636754", "0.5238547", "0.5189449", "0.5092153", "0.5081505", "0.5063675", "0.5063472", "0.5034281", "0.50044245", "0.498959", "0.4983426", "0.49699736", "0.496205", "0.4915985", "0.49080282", "0.4904461", "0.48904976", "0.48765594", "0.4872025" ]
0.6667048
0
end bh products category loop add sorting scripts to footer add_action('genesis_after_footer','bh_ajax_sort_posts');
function bh_ajax_sort_posts(){ ?> <script> //add drop-downs to js pages $jq('.select-post-sorting').html( '<form action="#">Sort by:<select name="posts_sort" class="posts_sort"><option value="newest">Release Date, Newest First</option><option value="oldest">Release Date, OIdest First</option><option value="az">Product Title, A-Z</option><option value="za">Product Title, Z-A</option></select> Quantity: <select name="posts_number" class="posts_number"><option value="10">10</option><option value="15">15</option><option value="20">20</option><option value="25" selected>25</option><option value="50">50</option></select></form>' ); //collect dropdown data $jq('.select-post-sorting select').on('change',function(){ //get value from each box $sortby = $jq('.posts_sort').val(); $number = $jq('.posts_number').val(); var loc = String(window.location); $link = loc.substring(0,(loc.lastIndexOf('/')+1)); switch($sortby){ case 'oldest': o = '?orderby=pubdate&order=ASC'; break; case 'az': o = '?orderby=title&order=ASC'; break; case 'za': o = '?orderby=title&order=DESC'; break; default: //newest o = '?orderby=pubdate&order=DESC'; } if($number){ n='&ppp='+$number; }else{ n='&ppp=25'; //default 25 } $link = $link + o + n; //v1 - load new page in div $plist = $jq('.product-category.product-list'); $plist.fadeOut(300,function(){ $jq(this).load($link + ' .product-category.product-list',function(){ $plist.fadeIn(500); // update page url/hash if($link!=window.location){ //window.history.pushState({path:$link},'',$link); } // if new url doesn't match current location }); //end load }); //end fade }); //end jq </script> <?php //v2 - use admin-ajax }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jigoshop_categories_scripts () {\n\t\n\tif( !isset($_GET['taxonomy']) || $_GET['taxonomy'] !== 'product_cat') return;\n\t\n\twp_register_script('jigoshop-categories-ordering', jigoshop::plugin_url() . '/assets/js/categories-ordering.js', array('jquery-ui-sortable'));\n\twp_print_scripts('jigoshop-categories-ordering');\n\t\n}", "function _asc_footer_scripts() {\n\tprint_late_styles();\n\tprint_footer_scripts();\n}", "function script_enqueue() {\n\t$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );\n\tisset($term->term_id) ? $is_detailed_category = get_woocommerce_term_meta( $term->term_id, '_woocommerce_detailed_category', true ) : $is_detailed_category = 0;\n\tif ($is_detailed_category) {\n\t\t// only load ad-gallery if is post : prevent from loading on other pages\n\t\twp_register_script('wc_dc_sortable', plugins_url('/assets/js/sortable.min.js', __FILE__));\n\t\twp_enqueue_script('wc_dc_sortable');\n\t\twp_register_script('wc_dc_loading_cart', plugins_url('/assets/js/loading-cart.min.js', __FILE__));\n\t\twp_enqueue_script('wc_dc_loading_cart');\n\t\twp_register_style( 'wc_dc_sortable_style', plugins_url('/assets/css/style.css', __FILE__) );\n\t\twp_enqueue_style( 'wc_dc_sortable_style' );\n\t}\n}", "function bh_products_category_loop(){\n//post sorting\n\n\n?>\n\n<?php\n//display content\n?>\t\n\n<div class=\"inner\">\n<div class=\"sidebar grid col-220 product-categories\">\n<?php //get_sidebar(); \n//should only be child category, so display parent.\n\nif (is_category()) {\n$this_category = get_category( get_query_var( 'cat' ) );\n}\n\n\n\n//if child category\nif($this_category->category_parent) {\n$parent_cat = get_category($this_category->category_parent);\n//check for third-level cat\n\tif($parent_cat->category_parent){\n\t\t$parent_parent = get_category($parent_cat->category_parent);\n\t\techo '<h2><a href=\"'. get_category_link($parent_parent->cat_ID) .'\">'. $parent_parent->name .'</a></h2>';\n\t\techo '<ul>';\n\t\t$categorylist = wp_list_categories('show_count=0&title_li=&use_desc_for_title=0&child_of='.$parent_cat->category_parent.\"&orderby=slug&hide_empty=0&exclude=1649\"); \t\n\t\techo '</ul>';\n\t\t\n\tif ($parent_parent->name == \"Apps\"){\n\techo '<p>&nbsp;</p>';\n\techo '<h2>Platforms</h2>';\n\techo '<ul>';\n\t$platforms = \twp_list_categories('show_count=0&title_li=&use_desc_for_title=0&hide_empty=0&child_of=1649');\n\techo '</ul>';\n\t\n}\n\t\t\n\t}else{\n\t\techo '<h2><a href=\"'. get_category_link($parent_cat->cat_ID) .'\">'. $parent_cat->name .'</a></h2>';\n\t\techo '<ul>';\n\t\t$categorylist = wp_list_categories('show_count=0&title_li=&use_desc_for_title=0&child_of='.$this_category->category_parent.\"&orderby=slug&hide_empty=0&exclude=1649\"); \n\t\techo '</ul>';\n\t\t\n\t\tif ($parent_cat->name == \"Apps\"){\n\techo '<p>&nbsp;</p>';\n\techo '<h2>Platforms</h2>';\n\techo '<ul>';\n\t$platforms = \twp_list_categories('show_count=0&title_li=&use_desc_for_title=0&hide_empty=0&child_of=1649');\n\techo '</ul>';\n\t\n}\n\t}\n}else{\n\n//if top-level category\necho '<h2>'. $this_category->name .'</h2>';\necho '<ul>';\n$categorylist = wp_list_categories('show_count=0&title_li=&use_desc_for_title=0&child_of='.$this_category->cat_ID.\"&orderby=slug&hide_empty=0&exclude=1649\");\necho '</ul>';\n\nif ($this_category->name == \"Apps\"){\n\techo '<p>&nbsp;</p>';\n\techo '<h2>Platforms</h2>';\n\techo '<ul>';\n\t$platforms = \twp_list_categories('show_count=0&title_li=&use_desc_for_title=0&hide_empty=0&child_of=1649');\n\techo '</ul>';\n\t\n}\n}\necho '<p>&nbsp;</p>';\n\n\n\n ?>\n\t\n\n</div>\n\n <div id=\"content\" class=\"grid col-700 fit\">\n <!-- <div class=\"select-post-sorting\"></div> -->\n\t\t<?php \n\t\t$cat = get_query_var('cat');\n\t\t$category_info = get_category($cat);\n\t\t//echo 'Is first level? = '. $category_info->parent;\n\t\t\n\t\t$parent_info = get_category($category_info->parent);\n\t\t//echo 'Is second level? = '. $parent_info->parent;\n\t\t\n\t\t$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; //pagination\t\t\n\t\t//$ext_query = '&meta_key=wpcf-pubdate&orderby=meta_value_num&posts_per_page=25&paged='.$paged.'';\n\t\t$sort_meta_key = 0; //init\n\t\t//get sort information from query vars or defaults\n\t\t$sort_orderby = (get_query_var('orderby')) ? get_query_var('orderby') : 'pubdate';\n\t\t$sort_order = (get_query_var('order')) ? get_query_var('order') : 'DESC';\n\t\t$sort_posts_per_page = (get_query_var('ppp')) ? get_query_var('ppp') : '25';\n\t\t\n\t\tif($sort_orderby =='pubdate'){\n\t\t\t$sort_orderby = 'meta_value_num';\n\t\t\t$sort_meta_key = 'wpcf-pubdate';\n\t\t}\n\t\n\t\t$ext_query = array(\n\t\t\t\t\t\t\t\t\t\t\t\t'post_type'=>'products',\n\t\t\t\t\t\t\t\t\t\t\t\t'category_name'=>$category_info->slug,\n\t\t\t\t\t\t\t\t\t\t\t\t'meta_key'=>'wpcf-pubdate',\n\t\t\t\t\t\t\t\t\t\t\t\t'orderby'=>'meta_value_num',\n\t\t\t\t\t\t\t\t\t\t\t\t'order'=>'DESC',\n\t\t\t\t\t\t\t\t\t\t\t\t'posts_per_page'=>'25',\n\t\t\t\t\t\t\t\t\t\t\t\t'tag'=>'listed',\n\t\t\t\t\t\t\t\t\t\t\t\t'paged'=>$paged\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\tif($sort_meta_key){\n\t\t\t$ext_query['meta_key'] = $sort_meta_key;\t\n\t\t}\n\t\t\n\t\t$title_qual = \"\";\n\t\t//query_posts($query_string . $ext_query );\n\t\tglobal $wp_query;\n\t\t//show only main product of groups, if product-group-parent field is populated, hide the post\n\t\t//edit: needs refinement - only for Bibles, and needs to compare non-existent OR blank\n\t\t// modified 3/18/14 to use custom SQL searching indexed taxonomy instead of custom field\n\t\t\n\t\t\n\t\t$newQuery = $ext_query;\n\t\t//$newQuery = array_replace($wp_query->query_vars, $ext_query);// + $p_groups; //changed for WP 4.0 something in WP_Query changed, found 0 posts\n\t\t//var_dump($newQuery);\n\t\n\t\t\t$books_in_cat = new WP_Query($newQuery);\n\t\t\n\t\t//echo '<br/>#posts: '.$books_in_cat->found_posts; //troubleshooting\n\t\t\t\nif ($books_in_cat->have_posts()) : ?>\n<div>\n<div class=\"product-category product-list\">\n<h2><?php echo $title_qual; ?><?php single_cat_title(); ?> </h2>\n<ul>\n\t\t<?php while ($books_in_cat->have_posts()) : $books_in_cat->the_post(); ?>\n \n <li id=\"post-<?php the_ID(); ?>\" <?php post_class(); ?>>\n\t\t<?php\n\t\t\t bh_thumbnail(get_the_ID(),'medium',true);\n\t\t\t \n\t\t\t $product_title = get_the_title(); //init\n\t\t\t $pg_names = array(); //init\n\t\t\t \n\t\t\t if (has_term('listed','post_tag')){\n\t\t\t\t $pg_names = wp_get_post_terms(get_the_ID(),'product-group',array('fields'=>'names'));\n\t\t\t\t if (!empty($pg_names)){\n\t\t\t\t\t$product_title = reset($pg_names);//change to product group title\n\t\t\t\t }\n\t\t\t\t $pg_names = array(); //re-initalize array\n\t\t\t }\n\t\t\t \n\t\t\t $short_title = wp_trim_words($product_title,8);\n?>\n <a href=\"<?php the_permalink(); ?>\"><?php echo $short_title; ?></a>\n \t\t\t\t<?php $pubdate = get_post_meta(get_the_ID(),'wpcf-pubdate',true); \n\t\t\t\t\t\t\t//turn pubdate into Month Year\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t//modify product list display\n\t\t\t\t\t\t\t//if title is too long, don't show subtitle/authors\n\t\t\t\t\t\t\tif(strlen(get_the_title())<32){\n\t\t\t\t\t\t\t\t//get current category or parent category\n\t\t\t\t\t\t\t\t//get category\n\t\t\t\t\t\t\t\tif($parent_info){\n\t\t\t\t\t\t\t\t\t//if child category\n\t\t\t\t\t\t\t\t\t$current_cat = $parent_info->slug;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$current_cat = $category_info->slug;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//ge\tt subtitle\n\t\t\t\t\t\t\t$p_subtitle = types_render_field('subtitle', array(\"raw\"=>\"true\"));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//if Bibles or Reference, show subtitle\n\t\t\t\t\t\t\t//echo $current_cat;\n\t\t\t\t\t\t\tif($current_cat =='bibles' || $current_cat == 'reference' || $category_info->slug == 'commentaries' ):\n\t\t\t\t\t\t\t?>\n <span class=\"author-names\"><?php echo $p_subtitle ?></span>\n <?php\t\n\t\t\t\t\t\t\telse:\n\t\t\t\t\t\t\t//else show author(s)\t\n\t\t\t\t\t\t\t//get author name(s)\n\t\t\t\t\t\t\t$a_list=false;\n\t\t\t\t\t\t\t$a_terms = wp_get_post_terms(get_the_ID(), 'a', array(\"fields\" => \"names\"));\n\t\t\t\t\t\t\tif($a_terms){\n\t\t\t\t\t\t\t\t$a_list = implode(', ', $a_terms);\t\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\tif($a_list){\n\t\t\t\t\t\t\t?>\n <span class=\"author-names\"><?php echo $a_list; ?></span>\n <?php\n\t\t\t\t\t\t\t}elseif ($p_subtitle){\n\t\t\t\t\t\t\t//no authors (?) - show subtitle if exists\t\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t <span class=\"author-names\"><?php echo $p_subtitle; ?></span>\n <?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t//title too long, no room for other text\n\t\t\t\t\t\t\t}\n ?>\n </li><!-- end of #post-<?php the_ID(); ?> -->\n \n\n \n <?php endwhile; \n\t\t if(!$hide_navi){\n\t\t if(function_exists('wp_pagenavi')) { \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twp_pagenavi( array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'query' =>$books_in_cat \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t }\n\t\t\n\t\t?> \n \n\t\t</ul>\n </div>\n\t <?php else : ?>\n\n <!-- <h1 class=\"title-404\"><?php _e('404 &#8212; Fancy meeting you here!', 'minimum'); ?></h1> -->\n \n <p><?php _e('No products found in '. $parent_info->name.' > '. single_cat_title('',false) .'.', 'minimum'); ?></p>\n \n <!-- <h6><?php printf( __('You can return %s or search for the page you were looking for.', 'minimum'),\n\t sprintf( '<a href=\"%1$s\" title=\"%2$s\">%3$s</a>',\n\t\t esc_url( get_home_url() ),\n\t\t esc_attr__('Home', 'minimum'),\n\t\t esc_attr__('&larr; Home', 'minimum')\n\t )); \n\t\t\t ?></h6>\n \n <?php get_search_form(); ?> -->\n\n<?php endif; ?> \n \n </div><!-- end of #content -->\n</div>\n</div>\n<?php\n}", "function codepress_footer_js()\n {\n }", "function asc_print_footer_scripts() {\n\t/**\n\t * Fires when footer scripts are printed.\n\t *\n\t * @since 2.8.0\n\t */\n\tdo_action( 'asc_print_footer_scripts' );\n}", "function _wp_footer_scripts()\n {\n }", "function wp_footer() {\n SLPlus_Actions::ManageTheScripts();\n\t\t}", "function ct_js_to_footer() {\n remove_action( 'wp_head', 'wp_print_scripts' );\n remove_action( 'wp_head', 'wp_print_head_scripts', 9 );\n remove_action( 'wp_head', 'wp_enqueue_scripts', 1 );\n}", "public function after_footer_scripts_code () {\n // Sets initial JS variables value\n ?>\n <script type=\"text/javascript\">\n ct_current_role = '<?php echo $this->role; ?>';\n ct_current_orderby = '<?php echo $this->orderby; ?>';\n ct_current_order = '<?php echo $this->order; ?>';\n ct_current_page = <?php echo $this->page; ?>;\n ct_total_pages = <?php echo $this->total_pages; ?>;\n </script>\n <?php\n }", "function udesign_footer_after() {\r\n do_action('udesign_footer_after');\r\n}", "protected function after_filter()\n {\n $this->render('footer.php');\n }", "function woocommerce_rrp_add_bulk_admin_footer() {\n\t\t\tglobal $post_type;\n\t\t\t\n\t\t\tif($post_type == 'product') {\n\t\t\t\t?>\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\t\t\tjQuery('<option>').val('set_price_to_rrp').text('<?php _e('Set price to RRP')?>').appendTo(\"select[name='action']\");\n\t\t\t\t\t\t\tjQuery('<option>').val('set_price_to_rrp').text('<?php _e('Set price to RRP')?>').appendTo(\"select[name='action2']\");\n\t\t\t\t\t\t});\n\t\t\t\t\t</script>\n\t\t\t\t<?php\n\t \t}\n\t\t}", "protected function add_footer_scripts() {\n\t\t\tdo_action( 'admin_print_footer_scripts' );\n\t\t}", "public function custom_bulk_admin_footer() {\n\t\tglobal $post_type;\n\t\t\n\t\tif($post_type == 'post') {\n\t\t\t?>\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\t\tjQuery('<option>').val('build').text('<?php _e('Build flat file')?>').appendTo(\"select[name='action']\");\n\t\t\t\t\t\tjQuery('<option>').val('build').text('<?php _e('Build flat file')?>').appendTo(\"select[name='action2']\");\n\t\t\t\t\t\tjQuery('#doaction').on('click', function(e) {\n\t\t\t\t\t\t\t// e.preventDefault();\n\t\t\t\t\t\t\tif(jQuery('#bulk-action-selector-top')[0].value == 'build') {\n\t\t\t\t\t\t\t\tif (jQuery('.updated')[0]) {\n\t\t\t\t\t\t\t\t\tjQuery('.updated').html('<p style=\"display:inline-block;\">Currently building...<span style=\"margin-top:0;\" class=\"spinner is-active\"></span></p>');\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tjQuery('.wrap h1').after('<div class=\"updated\"><p style=\"display:inline-block;\">Currently building...<span style=\"margin-top:0;\" class=\"spinner is-active\"></span></p></div>');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t<?php\n \t}\n\t}", "function wpstocks_action_javascript_footer()\n{\n}", "function udesign_footer_before() {\r\n do_action('udesign_footer_before');\r\n}", "function add_late_scripts()\n\t{\n\t\t// only procceed if we have finished printing footer scripts\n\t\tif (did_action('bwp_minify_after_footer_scripts'))\n\t\t\t$this->todo_late_scripts = 'footer' . $this->late_script_order;\n\t}", "function addWPActions ()\n\t{\n\t\t//Add Front End Jquery and CSS\n\t\t//add_action( 'wp_footer', array( $this, 'frontendEnqueues' ) );\n\t\t\n\t}", "function ajax_footer_js(){\n ?>\n <script type=\"text/javascript\">\n jQuery(document).ready(function($){\n // Ajax Chosen Product Selectors\n jQuery(\"select.ajax_chosen_select_tabs\").select2({});\n });\n </script>\n <?php\n }", "function ajax_filter_posts_scripts() {\n // Enqueue script\n //wp_register_script('afp_script', 'get_template_directory_uri() . '/js-folder/'ajax-filter-posts.js', false, null, false);\n wp_register_script('afp_script', get_template_directory_uri().'/assets/ajax-filter-posts.js', false, null, false);\n wp_enqueue_script('afp_script');\n\n wp_localize_script( 'afp_script', 'afp_vars', array(\n 'afp_nonce' => wp_create_nonce( 'afp_nonce' ), // Create nonce which we later will use to verify AJAX request\n 'afp_ajax_url' => admin_url( 'admin-ajax.php' ),\n )\n );\n}", "function wp_print_footer_scripts()\n {\n }", "public function bulk_action_scripts() {\n\t\t \tglobal $post_type;\n\t\t\tif( $post_type == 'shop_order' ) {\n\t\t\t\twp_register_script(\n\t\t\t\t\t'dropbox-export',\n\t\t\t\t\tplugins_url( 'js/dropbox-export.js' , dirname(__FILE__) ),\n\t\t\t\t\tarray( 'jquery', 'thickbox' )\n\t\t\t\t);\n\t\t\t\twp_enqueue_script( 'dropbox-export' );\n\t\t\t\twp_enqueue_style( 'thickbox' );\n\t\t\t}\n\n\t\t}", "public function print_scripts() {\n\t\tglobal $pagenow, $hook_suffix;\n\t\t$pages = array( 'edit.php' );\n\n\t\tif ( in_array( $pagenow, $pages ) ) {\n\t\t\twp_register_script( 'reorder_nested', AERIA_RESOURCE_URL . 'js/jquery.mjs.nestedSortable.js', array( 'jquery-ui-sortable' ), '1.3.5', true );\n\t\t\twp_enqueue_script( 'reorder_posts', AERIA_RESOURCE_URL . 'js/reorder-sort.js', array( 'reorder_nested' ) );\n\t\t\twp_localize_script( 'reorder_posts', 'reorder_posts', array(\n\t\t\t\t'expand' => esc_js( __( 'Expand', 'reorder' ) ),\n\t\t\t\t'collapse' => esc_js( __( 'Collapse', 'reorder' ) ),\n\t\t\t\t'sortnonce' => wp_create_nonce( 'sortnonce' ),\n\t\t\t\t'hierarchical' => is_post_type_hierarchical( $this->post_type ) ? 'true' : 'false',\n\t\t\t) );\n\t\t}\n\t}", "public function hookFooter()\n {\n $ga_scripts = '';\n $this->js_state = 0;\n\n if (isset($this->context->cookie->ga_cart)) {\n $this->filterable = 0;\n\n $gacarts = unserialize($this->context->cookie->ga_cart);\n foreach ($gacarts as $gacart) {\n if ($gacart['quantity'] > 0) {\n } elseif ($gacart['quantity'] < 0) {\n $gacart['quantity'] = abs($gacart['quantity']);\n }\n }\n unset($this->context->cookie->ga_cart);\n }\n\n $controller_name = Tools::getValue('controller');\n $products = $this->wrapProducts($this->context->smarty->getTemplateVars('products'), [], true);\n\n if ($controller_name == 'order' || $controller_name == 'orderopc') {\n $this->eligible = 1;\n $step = Tools::getValue('step');\n if (empty($step)) {\n $step = 0;\n }\n }\n\n if (version_compare(_PS_VERSION_, '1.5', '<')) {\n if ($controller_name == 'orderconfirmation') {\n $this->eligible = 1;\n }\n } else {\n $confirmation_hook_id = (int) Hook::getIdByName('orderConfirmation');\n if (isset(Hook::$executed_hooks[$confirmation_hook_id])) {\n $this->eligible = 1;\n }\n }\n\n if (isset($products) && count($products) && $controller_name != 'index') {\n if ($this->eligible == 0) {\n $ga_scripts .= $this->addProductImpression($products);\n }\n $ga_scripts .= $this->addProductClick($products);\n }\n\n return $this->_runJs($ga_scripts);\n }", "function my_footer_shh() {\n remove_filter( 'update_footer', 'core_update_footer' );\n}", "function tmpl_archives_sorting_opt(){\r\n\tglobal $wp_query,$sort_post_type;\r\n\t\r\n\tif(!is_search()){\r\n\t\t$post_type = (get_post_type()!='')? get_post_type() : get_query_var('post_type');\r\n\t\t$sort_post_type = apply_filters('tmpl_tev_sorting_for_'.$post_type,$post_type);\r\n\t\t\r\n\t}else{\r\n\t\t/* on search page what happens if user search with multiple post types */\r\n\t\tif(isset($_REQUEST['post_type'])){\r\n\t\t\tif(is_array($_REQUEST['post_type']) && count($_REQUEST['post_type'])==1){\r\n\t\t\t\t$sort_post_type= $_REQUEST['post_type'][0];\r\n\t\t\t}else{\r\n\t\t\t\t$sort_post_type= $_REQUEST['post_type'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\tif(!$sort_post_type){\r\n\t\t\t\t$sort_post_type='directory';\r\n\t\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\t$templatic_settings=get_option('templatic_settings');\r\n\t$googlemap_setting=get_option('city_googlemap_setting');\r\n\t\r\n\t/*custom post type link */\r\n\t$current_posttype = get_post_type();\r\n\t\r\n\tif(empty($current_posttype)){\r\n\t\t$current_posttype = $wp_query->query['post_type'];\r\n\t}\r\n\t\t\r\n\tif(!is_tax() && is_archive() && !is_search())\r\n\t{\r\n\t\t$current_term = $wp_query->get_queried_object();\t\t\r\n\t\t$permalink = get_post_type_archive_link($current_posttype);\r\n\t\t$permalink=str_replace('&'.$sort_post_type.'_sortby=alphabetical&sortby='.$_REQUEST['sortby'],'',$permalink);\r\n\t}elseif(is_search()){\r\n\t\t$search_query_str=str_replace('&'.$sort_post_type.'_sortby=alphabetical&sortby='.@$_REQUEST['sortby'],'',$_SERVER['QUERY_STRING']);\r\n\t\t$permalink= site_url().\"?\".$search_query_str;\r\n\t}else{\r\n\t\t$current_term = $wp_query->get_queried_object();\r\n\t\t$permalink=($current_term->slug) ? get_term_link($current_term->slug, $current_term->taxonomy):'';\r\n\t\tif(isset($_REQUEST['sortby']) && $_REQUEST['sortby']!='')\r\n\t\t\t$permalink=str_replace('&'.$sort_post_type.'_sortby=alphabetical&sortby='.$_REQUEST['sortby'],'',$permalink);\r\n\t\t\r\n\t}\r\n\t\r\n\t$post_type= get_post_type_object( get_post_type());\r\n\t\r\n\t/* get all the request url and con-cat with permalink to get the exact results */\r\n $req_uri = '';\r\n\tforeach($_GET as $key=>$val){\r\n\t\tif($key !='' && !strstr($key,'_sortby')){\r\n\t\t\t$req_uri .= $key.\"=\".$val.\"&\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t/* permalink */\r\n\tif(false===strpos($permalink,'?')){\r\n\t $url_glue = '?'.$req_uri;\r\n\t}else{\r\n\t\t$url_glue = '&amp;'.$req_uri;\t\r\n\t}\r\n\t\r\n\t/* no grid view list view if no results found */\r\n\t\r\n\tif($wp_query->found_posts!=0){\r\n\t?>\r\n\t<div class='directory_manager_tab clearfix'>\r\n\t<div class=\"sort_options\">\r\n\t<?php if(have_posts()!='' && current_theme_supports('tmpl_show_pageviews')): ?>\r\n\t\t<ul class='view_mode viewsbox'>\r\n\t\t\t<?php if(function_exists('tmpl_wp_is_mobile') && tmpl_wp_is_mobile()){ \r\n\t\t\t\tif(isset($templatic_settings['category_googlemap_widget']) && $templatic_settings['category_googlemap_widget']=='yes'){\r\n\t\t\t\t?>\r\n\t\t\t\t<li><a class='switcher last listview <?php if($templatic_settings['default_page_view']==\"listview\"){echo 'active';}?>' id='listview' href='#'><?php _e('LIST VIEW','templatic');?></a></li>\r\n\t\t\t\t<li><a class='map_icon <?php if($templatic_settings['default_page_view']==\"mapview\"){echo 'active';}?>' id='locations_map' href='#'><?php _e('MAP','templatic');?></a></li>\r\n\t\t\t<?php }\t\r\n\t\t\t}else{ ?>\r\n\t\t\t\t<li><a class='switcher first gridview <?php if($templatic_settings['default_page_view']==\"gridview\"){echo 'active';}?>' id='gridview' href='#'><?php _e('GRID VIEW','templatic');?></a></li>\r\n\t\t\t\t<li><a class='switcher last listview <?php if($templatic_settings['default_page_view']==\"listview\"){echo 'active';}?>' id='listview' href='#'><?php _e('LIST VIEW','templatic');?></a></li>\r\n\t\t\t\t<?php if(isset($templatic_settings['category_googlemap_widget']) && $templatic_settings['category_googlemap_widget']=='yes'):?> \r\n\t\t\t\t<li><a class='map_icon <?php if($templatic_settings['default_page_view']==\"mapview\"){echo 'active';}?>' id='locations_map' href='#'><?php _e('MAP','templatic');?></a></li>\r\n\t\t\t\t<?php endif;\r\n\t\t\t}\r\n\t\t\t?>\r\n\t\t</ul>\t\r\n\t<?php endif;\r\n\r\n\tif(isset($_GET[$sort_post_type.'_sortby']) && $_GET[$sort_post_type.'_sortby']=='alphabetical'){\r\n\t\t$_SESSION['alphabetical']='1';\t\r\n\t}else{\r\n\t\tunset($_SESSION['alphabetical']);\r\n\t}\r\n\t\r\n\tif(!empty($templatic_settings['sorting_option'])){\r\n\r\n\t\t/* take \"directory\" as a post type if additional post type is detected */\r\n\t\t$exclude_arr = apply_filters('exclude_sorting_posttypes',array('event','property','classified'));\r\n\t\tif(!in_array(get_post_type(),$exclude_arr)){\r\n\t\t\t$sort_post_type_name = 'tevolution';\r\n\t\t}\t\r\n\t\telse{\t\r\n\t\t\t$sort_post_type_name = get_post_type();\r\n\t\t}\r\n\t\t\r\n\t\t$sel_sort_by = isset($_REQUEST[$sort_post_type_name.'_sortby']) ? $_REQUEST[$sort_post_type_name.'_sortby'] : '';\r\n\t\t$sel_class = 'selected=selected';\r\n\t\t\r\n\t?>\r\n\t\t<div class=\"tev_sorting_option\">\r\n\t\t\t<form action=\"<?php if(function_exists('tmpl_directory_full_url')){ echo tmpl_directory_full_url('directory'); } ?>\" method=\"get\" id=\"<?php echo $sort_post_type.'_sortby_frm'; ?>\" name=\"<?php echo $sort_post_type.'_sortby_frm'; ?>\">\r\n <select name=\"<?php echo $sort_post_type_name.'_sortby'; ?>\" id=\"<?php echo $sort_post_type_name.'_sortby'; ?>\" onchange=\"sort_as_set(this.value)\" class=\"tev_options_sel\">\r\n\t\t\t\t<option <?php if(!$sel_sort_by){ echo $sel_class; } ?>><?php _e('Sort By','templatic'); ?></option>\r\n\t\t\t\t<?php\r\n\t\t\t\t\tdo_action('tmpl_before_sortby_title_alphabetical');\r\n\t\t\t\t\tif(!empty($templatic_settings['sorting_option']) && in_array('title_alphabetical',$templatic_settings['sorting_option'])):?>\r\n\t\t\t\t\t\t<option value=\"alphabetical\" <?php if($sel_sort_by =='alphabetical'){ echo $sel_class; } ?>><?php _e('Alphabetical','templatic');?></option>\r\n\t\t\t\t<?php endif;\r\n\t\t\t\t\tdo_action('tmpl_after_sortby_title_alphabetical');\r\n\t\t\t\t\t\r\n\t\t\t\t\tdo_action('tmpl_before_sortby_title_asc');\r\n\t\t\t\t\tif(!empty($templatic_settings['sorting_option']) && in_array('title_asc',$templatic_settings['sorting_option'])):?>\r\n\t\t\t\t\t\t<option value=\"title_asc\" <?php if($sel_sort_by =='title_asc'){ echo $sel_class; } ?>><?php _e('Title Ascending','templatic');?></option>\r\n\t\t\t\t<?php endif;\r\n\t\t\t\t\tdo_action('tmpl_after_sortby_title_asc');\r\n\t\t\t\t\t\r\n\t\t\t\t\tdo_action('tmpl_before_sortby_title_desc');\r\n\t\t\t\t\tif(!empty($templatic_settings['sorting_option']) && in_array('title_desc',$templatic_settings['sorting_option'])):?>\r\n\t\t\t\t\t\t<option value=\"title_desc\" <?php if($sel_sort_by =='title_desc'){ echo $sel_class; } ?>><?php _e('Title Descending','templatic');?></option>\r\n\t\t\t\t<?php endif;\r\n\t\t\t\t\tdo_action('tmpl_after_sortby_title_desc');\r\n\t\t\t\t\r\n\t\t\t\t\tdo_action('tmpl_before_sortby_date_asc');\r\n\t\t\t\t\tif(!empty($templatic_settings['sorting_option']) && in_array('date_asc',$templatic_settings['sorting_option'])):?>\r\n\t\t\t\t\t\t<option value=\"date_asc\" <?php if($sel_sort_by =='date_asc'){ echo $sel_class; } ?>><?php _e('Publish Date Ascending','templatic');?></option>\r\n\t\t\t\t<?php endif;\r\n\t\t\t\t\tdo_action('tmpl_after_sortby_date_asc');\r\n\t\t\t\t\t\r\n\t\t\t\t\tdo_action('tmpl_before_date_desc');\r\n\t\t\t\t\tif(!empty($templatic_settings['sorting_option']) && in_array('date_desc',$templatic_settings['sorting_option'])):?>\r\n\t\t\t\t\t\t<option value=\"date_desc\" <?php if($sel_sort_by =='date_desc'){ echo $sel_class; } ?>><?php _e('Publish Date Descending','templatic');?></option>\r\n\t\t\t\t<?php endif;\r\n\t\t\t\t\tdo_action('tmpl_after_sortby_date_desc');\r\n\t\t\t\t\t\r\n\t\t\t\t\tdo_action('tmpl_before_sortby_reviews');\r\n\t\t\t\t\tif(!empty($templatic_settings['sorting_option']) && in_array('reviews',$templatic_settings['sorting_option'])):?>\r\n\t\t\t\t\t\t<option value=\"reviews\" <?php if($sel_sort_by =='reviews'){ echo $sel_class; } ?>><?php _e('Reviews','templatic');?></option>\r\n\t\t\t\t<?php endif;\r\n\t\t\t\t\tdo_action('tmpl_after_sortby_reviews');\r\n\t\t\t\t\t\r\n\t\t\t\t\tdo_action('tmpl_before_sortby_rating');\r\n\t\t\t\t\tif(!empty($templatic_settings['sorting_option']) && in_array('rating',$templatic_settings['sorting_option'])):?>\r\n\t\t\t\t\t\t<option value=\"rating\" <?php if($sel_sort_by =='rating'){ echo $sel_class; } ?>><?php _e('Rating','templatic');?></option>\r\n\t\t\t\t<?php endif;\r\n\t\t\t\t\tdo_action('tmpl_after_sortby_rating');\r\n\t\t\t\t\t\r\n\t\t\t\t\tdo_action('tmpl_before_sortby_random');\r\n\t\t\t\t\tif(!empty($templatic_settings['sorting_option']) && in_array('random',$templatic_settings['sorting_option'])):?>\r\n\t\t\t\t\t\t<option value=\"random\" <?php if($sel_sort_by =='random'){ echo $sel_class; } ?>><?php _e('Random','templatic');?></option>\r\n\t\t\t\t<?php endif;\r\n\t\t\t\t\tdo_action('tmpl_after_sortby_random');\r\n\t\t\t\t\t?> \r\n\t\t\t </select>\r\n\t\t\t </form>\r\n <?php add_action('wp_footer','sorting_option_of_listing'); ?>\r\n\t\t</div>\r\n <?php\r\n\t}\r\n\r\n\t?>\r\n \t</div><!--END sort_options div -->\r\n </div><!-- END directory_manager_tab Div -->\r\n\t<?php\r\n\t}\r\n\t\r\n\t\r\n\t/* On archive and category pages - alphabets order should display even there is no post type pass in argument */\r\n\t$exclude_arr = array('event','property','classified');\r\n\tif(isset($_REQUEST['alpha_sort_post_type']) && $_REQUEST['alpha_sort_post_type'] != '')\r\n\t\t$sort_post_type = $_REQUEST['alpha_sort_post_type'];\r\n\tif(!in_array($sort_post_type,$exclude_arr))\r\n\t\t$sort_post_type = 'tevolution';\r\n\telse\t\r\n\t\t$sort_post_type = $sort_post_type;\r\n\tif(!$sort_post_type){ $sort_post_type=\"tevolution\"; }\r\n\tif((isset($_REQUEST[$sort_post_type.'_sortby']) && $_REQUEST[$sort_post_type.'_sortby']=='alphabetical') || (isset($_SESSION['alphabetical']) && $_SESSION['alphabetical']==1)):\r\n\t\r\n\t$alphabets = array(__('A','templatic'),__('B','templatic'),__('C','templatic'),__('D','templatic'),__('E','templatic'),__('F','templatic'),__('G','templatic'),__('H','templatic'),__('I','templatic'),__('J','templatic'),__('K','templatic'),__('L','templatic'),__('M','templatic'),__('N','templatic'),__('O','templatic'),__('P','templatic'),__('Q','templatic'),__('R','templatic'),__('S','templatic'),__('T','templatic'),__('U','templatic'),__('V','templatic'),__('W','templatic'),__('X','templatic'),__('Y','templatic'),__('Z','templatic'));\r\n\t/*show all result when we click on all in alphabetical sort order*/\r\n\t$all = str_replace('?sortby='.$_REQUEST['sortby'].'&','/?',$url_glue);\r\n\t?>\r\n <div id=\"directory_sort_order_alphabetical\" class=\"sort_order_alphabetical\">\r\n\t\t<input type=\"hidden\" name=\"alpha_sort\" id=\"alpha_sort\" /> <!-- for listfilter -->\r\n\t <ul>\r\n\t\t\t<li class=\"<?php echo (!isset($_REQUEST['sortby']))?'active':''?>\"><a href=\"<?php echo remove_query_arg('sortby',$permalink.$all.$sort_post_type.'_sortby=alphabetical');?>\"><?php _e('All','templatic');?></a></li>\r\n\t\t\t<?php\r\n\t\t\tforeach($alphabets as &$value){ \r\n\t\t\t\t$key = $value;\r\n\t\t\t\t$val = strtolower($key);\r\n\t\t\t\t?>\r\n\t\t\t\t<li class=\"<?php echo (isset($_REQUEST['sortby']) && $_REQUEST['sortby'] == $val)? 'active':''?>\"><a href=\"<?php echo $permalink.$url_glue .$sort_post_type.'_sortby=alphabetical&sortby='.$val.'&alpha_sort_post_type='.$sort_post_type;?>\"><?php echo $key; ?></a></li>\r\n\t\t\t\t<?php \r\n\t\t\t} ?>\r\n\t </ul>\r\n </div>\r\n <?php endif;\r\n}", "function wp_ajax_widgets_order()\n {\n }", "function admin_footer()\n {\n }", "function admin_footer()\n {\n }" ]
[ "0.7241142", "0.6526731", "0.6444402", "0.6413683", "0.6400463", "0.63700396", "0.6369376", "0.6338886", "0.630546", "0.6296617", "0.6249045", "0.6207119", "0.61928964", "0.61739033", "0.61543816", "0.61080056", "0.6093143", "0.6033762", "0.6032027", "0.6030236", "0.60086805", "0.6001226", "0.59697604", "0.59487045", "0.594843", "0.5941049", "0.5938484", "0.59146017", "0.5896967", "0.5896967" ]
0.71792096
1
Insert DropLoader link above the imagelist on the imagetab
function abl_droploader_image_ui($event, $step) { $content = '<div class="abl-droploader-file-uploader"> <a id="abl-droploader-open" class="abl-droploader-open txp-button" href="#" title="' . gTxt('abl_droploader_open_title') . '">' . gTxt('abl_droploader_open') . '</a> </div>'; return $content.n; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function abl_droploader_article_ui($event, $step, $data) {\n\t\t$content = '\n<ul class=\"abl_droploader plain-list\">\n<li><a id=\"abl-droploader-open\" class=\"abl-droploader-open\" href=\"#\" title=\"' . gTxt('abl_droploader_open_title') . '\">' . gTxt('abl_droploader_open') . '</a></li>\n</ul>';\n\t\tif (is_callable('wrapRegion')) { // new in txp 4.6\n\t\t\treturn $data.wrapRegion('abl_droploader_group', $content, 'abl_droploader_link', 'upload', 'article_abl_droploader');\n\t\t} else {\n\t\t\treturn $data.'\n<div id=\"abl_droploader_group\"><h3 class=\"plain lever\"><a href=\"#abl_droploader-link\">' . gTxt('upload') . '</a></h3>\n<div id=\"abl_droploader-link\" class=\"toggle\" style=\"display:none\">' .\n$content . '\n</div>\n</div>\n';\n\t\t}\n\t}", "function abl_droploader_head_end($evt, $stp) {\n\t\tglobal $event, $step, $prefs, $abl_droploader_prefs;\n\n\t\tif (($event == 'image'\n\t\t\t&& (in_array($step, array('list', 'image_list', 'image_multi_edit', 'image_change_pageby', 'image_save', ''))))\n\t\t|| ($event == 'article'\n\t\t\t&& (in_array($step, array('create', 'edit'))))) {\n\t\t\t$abl_droploader_prefs = abl_droploader_load_prefs();\n\t\t\t$css = '';\n\t\t\tif (intval($abl_droploader_prefs['useDefaultStylesheet']) != 0) {\n\t\t\t\t$css .= '<link rel=\"stylesheet\" href=\"../res/css/abl.droploader-app.css\" type=\"text/css\" media=\"screen,projection\" />' . n;\n\t\t\t}\n\t\t\tif ($abl_droploader_prefs['customStylesheet'] != '') {\n\t\t\t\t$css .= '<link rel=\"stylesheet\" href=\"' . $abl_droploader_prefs['customStylesheet'] . '\" type=\"text/css\" media=\"screen,projection\" />' . n;\n\t\t\t}\n\t\t\tif ($css == '') {\n\t\t\t\t$css = '<link rel=\"stylesheet\" href=\"../res/css/abl.droploader-app.css\" type=\"text/css\" media=\"screen,projection\" />' . n;\n\t\t\t}\n\t\t\t$article_image_field_ids = '\"' . implode('\", \"', explode(',', $abl_droploader_prefs['articleImageFields'])) . '\"';\n\t\t\t$script = '<script type=\"text/javascript\">\n\tvar file_max_upload_size = ' . sprintf('%F', (intval($prefs['file_max_upload_size']) / 1048576)) . ';\n\tvar file_max_files = 5;\n\tvar image_max_upload_size = 1;\n\tvar image_max_files = ' . intval($abl_droploader_prefs['imageMaxUploadCount']) . ';\n\tvar reload_image_tab = ' . intval($abl_droploader_prefs['reloadImagesTab']) . ';\n\tvar article_image_field_ids = new Array(' . $article_image_field_ids . ');\n\tvar article_image_field = null;\n</script>\n<script src=\"../res/js/jquery.filedrop.js\" type=\"text/javascript\"></script>\n<script src=\"../res/js/jquery.droploader.js\" type=\"text/javascript\"></script>\n<script src=\"../res/js/abl.droploader-app.js\" type=\"text/javascript\"></script>' . n;\n\t\t\techo $css . $script;\n\t\t}\n\n\t}", "function link_block_thumb()\n{\n add_image_size('link_block_thumb', 884, 540, true); // Hard crop to exact dimensions (crops sides or top and bottom)\n}", "abstract protected function drop_zone($mform, $imagerepeats);", "function adminSpecial() {\n\t\t$this->adminDefault();\n\t\t$this->baseLink = CMS_WWW_URI.'admin/special.php?module=picture_gallery';\n\t\t$this->setView('admin_list');\n\t}", "function admin_showimage($selection, $path, $options) { global $get, $uri;\n\t$real_path = $path.'/'.$selection;\n\tif (isset($get['o'])) {\n\t\t$url = explode('/',$get['o']);\n\t\t$url1 = explode('|', $url[0]);\n\t\t$url2 = explode('|', $url[1]);\n\t\t$found = in_array('sl', $url1) ? true : false;\n\t\t$link = pre_seao($url1[0], $url2[0], false, true);\n\t\t$link = str_replace('ebookcms.php/', '', $link);\n\t\t$link = str_replace('ebookcms.php?', '?', $link);\n\t\t$add = !isset($get['sl']) ? pre_seao('sl', '1') : '';\n\t\tfor ($i=1; $i<count($url1); $i++) {\n\t\t\t$link .= pre_seao($url1[$i], $url2[$i]);\n\t\t\tif ($i==2 && !$found) {$link .= $add;}\n\t\t}\n\t}\n\techo '<div class=\"show_img\">';\n\tif (!LOGGED && isAllowed('uplimg_access')) {echo t('not_allowed').'</div>'; exit;}\n\tif (is_dir($real_path)) { $images = '';\n\t\t$handle = opendir($real_path);\n\t\t$extensions = array('.jpg', '.bmp', '.gif', '.png');\n\t\twhile (($file = readdir($handle)) == true) {\n\t\t\tif ($file != '.' && $file != '..' && $file != 'thumbs') {\n\t\t\t\tclearstatcache();\n\t\t\t\t$ext = strrchr($file, '.');\n\t\t\t\tif (in_array($ext, $extensions)) {\n\t\t\t\t\tif (file_exists($real_path.'/thumbs/'.$file)) {\n\t\t\t\t\t\t$images = $images.'<li>\n\t\t\t\t\t\t\t<div class=\"si_title\">\n\t\t\t\t\t\t\t\t<h4>'.$file.'</h4>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"si_img\">\n\t\t\t\t\t\t\t\t<img src=\"'.$real_path.'/thumbs/'.$file.'\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"si_foot\">\n\t\t\t\t\t\t\t\t<p><a href=\"'.$link.'\" onClick=\"var r = confirm(\\''.t('delete_img').'?\\'); if (r) {deleteimage(\\''.$file.'\\',\\''.$real_path.'\\');}\" \n\t\t\t\t\t\t\t\t\ttarget=\"_self\">'.t('delete').'</a></p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>';\n\t\t\t\t\t} else {$images = $images.'<li>\n\t\t\t\t\t\t<div class=\"si_title\">\n\t\t\t\t\t\t\t<h4>'.$file.'</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"si_img\">\n\t\t\t\t\t\t\t<img src=\"'.$real_path.'/'.$file.'\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"si_foot\">\n\t\t\t\t\t\t\t<p><a href=\"'.$link.'\" onClick=\"var r = confirm(\\''.t('delete_img').'?\\'); if (r) {deleteimage(\\''.$file.'\\',\\''.$real_path.'\\');}\" \n\t\t\t\t\t\t\t\t\ttarget=\"_self\">'.t('delete').'</a></p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</li>';}\n\t\t\t\t}\n\t\t\t}\n\t\t} closedir($handle);\n\t\tif (!empty($images)) {echo '<ul>'.$images.'</ul><br />';} else {echo t('no_image');}\n\t} else if (empty($selection)) {echo t('select_imgs');}\n\techo '</div>';\n\tif (!empty($images)) {return;}\n}", "public function init(){\n parent::init();\n $this->registerAssets();\n $this->attachBehavior(\"linkCont\", new LinkContainerBehavior());\n \n echo CHtml::openTag( $this->containerTag, $this->getContainerOptions());\n echo CHtml::openTag($this->listTag, $this->getListOptions());\n \n // Remove invisible items\n $items = $this->removeInvisibleItems($this->items);\n \n // Render the items\n $count = count($items);\n foreach ($items as $index=>$item ) {\n echo CHtml::openTag($this->itemTag, $this->getItemOptions($item, $index, $count));\n $item['labelMarkup'] = $this->getLabel($item);\n $item['anchorOptions'] = $this->getAnchorOptions($item, $index, $count);\n $this->renderItem($item);\n echo CHtml::closeTag($this->itemTag);\n }\n }", "function insertUrlImages($image_name){\r\n\t\t\r\n\t}", "function abl_droploader_image_uploaded($event, $step, $id) {\n\t\tif (ps('abl_droploader') == '') return;\n\t\t$response = array(\n\t\t\t'status' => 1,\n\t\t\t'image_id' => $id,\n\t\t);\n\t\techo json_encode($response);\n\t\texit;\n\t}", "function album_list_thumbnail($albumList)\n{\n\tforeach ($albumList as $album) {\n\t\t$id = $album->album_id;\n\t\t$title = $album->album_title;\n\t\t$year = $album->album_year;\n\t\techo \"<div class='col-md-6' data-toggle='tooltip' data-placement='top' title='$title'> \";\n\t\t\techo a_open(\"thumbnail\", base_url().\"album/$id\");\n\t\t\t\techo img(\"data/music/albums/$id/cover.png\");\n\t\t\techo a_close();\n\t\techo div_close();\n\t}\n}", "function bootstrapwp_enhanced_image_navigation($url)\n{\n global $post;\n if (wp_attachment_is_image($post->ID)) {\n $url = $url . '#main';\n }\n return $url;\n}", "function manage_banners(){\r\n\r\n\tglobal $cfg;\r\n\t\r\n\tinclude('./include/admin/adm_item.php');\r\n\t\r\n\t$manager = new adm_item();\r\n\t\r\n\t$manager->type =\t\t\t\t'banner';\r\n\t$manager->type_plural =\t\t\t'banners';\r\n\t$manager->url = \t\t\t\t'##pageroot##/?mode=banner';\r\n\t\r\n\t// initialize fields\r\n\t$manager->sql_item_table = \t\t$cfg['t_banner_items'];\t\t\r\n\t$manager->sql_item_id = \t\t'item_id';\t\t\t\r\n\t$manager->sql_item_data = \t\tarray('alt','src');\t\t\t\r\n\t$manager->sql_item_desc = \t\tarray('Display Text','URL');\r\n\r\n\t$manager->sql_item_unique_keys = array(0,1);\r\n\t\r\n\t$manager->sql_item_hidden =\t\tarray();\r\n\t\r\n\t$manager->sql_join_table = \t\t$cfg['t_banner_groups'];\t\t\r\n\t$manager->sql_order_field = \tfalse;\r\n\t\r\n\t$manager->sql_group_table = \t$cfg['t_banners'];\t\t\r\n\t$manager->sql_group_id =\t\t'banner_id';\t\t\t\r\n\t$manager->sql_group_name = \t\t'name';\r\n\r\n\t$manager->do_content_update = \ttrue;\r\n\t\r\n\t// hooks\r\n\t//$manager->item_delete_hook = \t'user_delete';\r\n\t//$manager->remove_hook = \t\t'user_remove';\r\n\t//$manager->edit_item_hook = \t'user_edititem';\r\n\t\r\n\t$manager->custom_functions = \tarray('banner_autofill');\r\n\t$manager->item_html =\t\t\t\r\n\t\"<p><a href=\\\"$manager->url&amp;action=banner_autofill\\\">Autofill banner images from $cfg[img_autofill_dir]/</a></p>\";\r\n\t\r\n\t$manager->ShowItems();\r\n\t\r\n}", "function bau_ein_upload_link_in_der_adminbar() {\n\n global $wp_admin_bar;\n \n if (current_user_can( 'manage_options' ) ) {\n \n $wp_admin_bar->add_menu( array(\n\t\t'id' => 'medien-hochladen',\n\t\t'title' => 'Medien hochladen',\n\t\t'href' => admin_url( 'media-new.php')\n\t));\n}\n}", "protected function addDisplayToolbar() {\n\t\t$doc = JFactory::getDocument();\n\t\t$doc->addStyleDeclaration('.icon-48-jmap{background-image:url(\"components/com_jmap/images/jmap-48x48.png\")}');\n\t\tJToolBarHelper::title( JText::_('COM_JMAP_CPANEL_TOOLBAR' ), 'jmap' );\n\t\tJToolBarHelper::custom('cpanel.display', 'home', 'home', 'COM_JMAP_CPANEL', false);\n\t}", "function register_block_core_gallery()\n {\n }", "public function add_image() {\n\t $this->use_layout=false;\n\t $this->page = new $this->model_class(Request::get('id'));\n\t\t$this->join_name = \"images\";\n\t if(Request::post(\"id\")) {\n\t\t $this->image = new WildfireFile(Request::post('id'));\n\t\t $this->image->join_order = Request::post('order');\n\t\t $this->page->images = $this->image;\n\t }\n\t}", "function load_sp_image_widget() {\n\tregister_widget('SP_Image_Widget');\n}", "protected function addToolbar()\n {\n // Get the results for each action\n $canDo = JoomHelper::getActions();\n\n // Get the toolbar object instance\n $bar = JToolbar::getInstance('toolbar');\n\n JToolBarHelper::title(JText::_('COM_JOOMGALLERY_IMGMAN_IMAGE_MANAGER'), 'images');\n\n if(($this->_config->get('jg_disableunrequiredchecks') || $canDo->get('joom.upload') || count(JoomHelper::getAuthorisedCategories('joom.upload'))) && $this->pagination->total)\n {\n JToolbarHelper::addNew('new');\n }\n\n if(($canDo->get('core.edit') || $canDo->get('core.edit.own')) && $this->pagination->total)\n {\n JToolbarHelper::editList();\n JToolbarHelper::custom('edit', 'checkbox-partial', 'checkbox-partial', 'JTOOLBAR_BATCH');\n JToolbarHelper::custom('showmove', 'move.png', 'move.png', 'COM_JOOMGALLERY_COMMON_TOOLBAR_MOVE');\n JToolbarHelper::custom('recreate', 'refresh.png', 'refresh.png', 'COM_JOOMGALLERY_COMMON_TOOLBAR_RECREATE');\n\n // Instantiate a new JLayoutFile instance and render the rotate button\n $layout = new JLayoutFile('joomgallery.toolbar.rotate', JPATH_COMPONENT_ADMINISTRATOR . '/layouts');\n $dhtml = $layout->render(array('title' => JText::_('COM_JOOMGALLERY_COMMON_TOOLBAR_ROTATE')));\n $bar->appendButton('Custom', $dhtml, 'rotate');\n\n JToolbarHelper::divider();\n }\n\n if($canDo->get('core.edit.state') && $this->pagination->total)\n {\n JToolbarHelper::publishList('publish', 'COM_JOOMGALLERY_COMMON_PUBLISH');\n JToolbarHelper::unpublishList('unpublish', 'COM_JOOMGALLERY_COMMON_UNPUBLISH');\n JToolbarHelper::custom('approve', 'upload.png', 'upload_f2.png', 'COM_JOOMGALLERY_IMGMAN_TOOLBAR_APPROVE');\n JToolbarHelper::divider();\n }\n\n //if($canDo->get('core.delete'))\n //{\n JToolbarHelper::deleteList('', 'remove');\n //}\n\n }", "private function createTabImage()\n {\n $filePath = _PS_MODULE_LENGOW_DIR_ . 'views/img/AdminLengow.gif';\n $fileDest = _PS_MODULE_LENGOW_DIR_ . 'AdminLengow.gif';\n if (!file_exists($fileDest) && LengowMain::compareVersion('1.5') == 0) {\n copy($filePath, $fileDest);\n }\n }", "function additem()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '新增轮播图';\n $this->global['pageName'] = 'carousel_add';\n $data = '';\n\n $this->loadViews(\"carousel_add\", $this->global, $data, NULL);\n }\n }", "function SetupListOptions() {\r\n\t\tglobal $Security, $Language, $rekeningju;\r\n\r\n\t\t// \"griddelete\"\r\n\t\tif ($rekeningju->AllowAddDeleteRow) {\r\n\t\t\t$item =& $this->ListOptions->Add(\"griddelete\");\r\n\t\t\t$item->CssStyle = \"white-space: nowrap;\";\r\n\t\t\t$item->OnLeft = TRUE;\r\n\t\t\t$item->Visible = FALSE; // Default hidden\r\n\t\t}\r\n\r\n\t\t// Call ListOptions_Load event\r\n\t\t$this->ListOptions_Load();\r\n\t}", "function nuthemes_enhanced_image_navigation( $url, $id ) {\n\tif ( ! is_attachment() && ! wp_attachment_is_image( $id ) )\n\t\treturn $url;\n\n\t$image = get_post( $id );\n\tif ( ! empty( $image->post_parent ) && $image->post_parent != $id )\n\t\t$url .= '#main';\n\n\treturn $url;\n}", "function optinpanda_icon_admin_assets( $hook ) { global $optinpanda;\r\nif ( !in_array( $optinpanda->license->type, array( 'free' ) ) ) {\r\n return; \r\n}\r\n\r\n\r\n ?>\r\n <style>\r\n #toplevel_page_license-manager-optinpanda div.wp-menu-image,\r\n #toplevel_page_license-manager-optinpanda:hover div.wp-menu-image,\r\n #toplevel_page_license-manager-optinpanda.wp-has-current-submenu div.wp-menu-image {\r\n background-position: 8px -30px !important;\r\n }\r\n </style>\r\n <?php\r\n \r\n\r\n}", "function admin_showgal($real_path) {// global $get, $uri;\n\t/*$real_path = $path.'/'.$selection;\n\tif (isset($get['o'])) {\n\t\t$url = explode('/',$get['o']);\n\t\t$url1 = explode('|', $url[0]);\n\t\t$url2 = explode('|', $url[1]);\n\t\t$found = in_array('sl', $url1) ? true : false;\n\t\t$link = pre_seao($url1[0], $url2[0], false, true);\n\t\t$link = str_replace('ebookcms.php/', '', $link);\n\t\t$link = str_replace('ebookcms.php?', '?', $link);\n\t\t$add = !isset($get['sl']) ? pre_seao('sl', '1') : '';\n\t\tfor ($i=1; $i<count($url1); $i++) {\n\t\t\t$link .= pre_seao($url1[$i], $url2[$i]);\n\t\t\tif ($i==2 && !$found) {$link .= $add;}\n\t\t}\n\t}*/\n\techo '<div class=\"show_img\">';\n\tif (is_dir($real_path)) { $images = '';\n\t\t$handle = opendir($real_path);\n\t\t$extensions = array('.jpg', '.bmp', '.gif', '.png');\n\t\twhile (($file = readdir($handle)) == true) {\n\t\t\tif ($file != '.' && $file != '..' && $file != 'thumbs') {\n\t\t\t\tclearstatcache();\n\t\t\t\t$ext = strrchr($file, '.');\n\t\t\t\tif (in_array($ext, $extensions)) {\n\t\t\t\t\tif (file_exists($real_path.'/'.$file)) {\n\t\t\t\t\t\t$images = $images.'<li>\n\t\t\t\t\t\t\t<div class=\"si_img\">\n\t\t\t\t\t\t\t\t<img src=\"'.$real_path.'/'.$file.'\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>';\n\t\t\t\t\t }\n\t\t\t\t}\n\t\t\t}\n\t\t} closedir($handle);\n\t\tif (!empty($images)) {echo '<ul>'.$images.'</ul><br />';} else {echo t('no_image');}\n\t} else if (empty($selection)) {echo t('select_imgs');}\n\techo '</div>';\n\tif (!empty($images)) {return;}\n}", "function song_list_thumbnail($songList)\n{\n\tforeach ($songList as $song) {\n\t\t$id = $song->song_id;\n\t\t$title = $song->song_title;\n\t\t$year = $song->song_year;\n\t\techo \"<div class='col-md-6' data-toggle='tooltip' data-placement='top' title='$title'> \";\n\t\t\techo a_open(\"thumbnail\", base_url().\"song/$id\");\n\t\t\t\techo img(\"data/music/songs/$id/cover.png\");\n\t\t\techo a_close();\n\t\techo div_close();\n\t}\n}", "public function assetThumbnailListAction() {\n\t\t$parentFolder = $this->document->getElement ( \"parentFolder\" );\n\t\tif ($parentFolder) {\n\t\t\t$parentFolder = $parentFolder->getElement ();\n\t\t}\n\t\t\n\t\tif (! $parentFolder) {\n\t\t\t// default is the home folder\n\t\t\t$parentFolder = Asset::getById ( 1 );\n\t\t}\n\t\t\n\t\t// get all children of the parent\n\t\t$list = new \\Asset\\Listing ();\n\t\t$list->setCondition ( \"path like ?\", $parentFolder->getFullpath () . \"%\" );\n\t\t\n\t\t$this->view->list = $list;\n\t}", "function calvero_enhanced_image_navigation( $url, $id ) {\n if ( ! is_attachment() && ! wp_attachment_is_image( $id ) )\n return $url;\n \n $image = get_post( $id );\n if ( ! empty( $image->post_parent ) && $image->post_parent != $id )\n $url .= '#main';\n \n return $url;\n}", "function add_image($image,$imageTitle,$imageDescription,$imageUrlMain,$imageLink2Title,$imageLink2Url,$imageLink3Title,$imageLink3Url,$imageLink4Title,$imageLink4Url)\n\t\t{\n\t\t\t$this -> load -> helper('security');\n\n\t\t\t$data = array('Image' => $image, 'Title' => $imageTitle, 'Description' => $imageDescription, 'Urlmain' => $imageUrlMain, 'link2title' => $imageLink2Title, 'Link2' => $imageLink2Url, 'Link3title' => $imageLink3Title, 'Link3' => $imageLink3Url, 'Link4title' => $imageLink4Title, 'Link4' => $imageLink4Url);\n\n\t\t\t$this -> db -> insert('MediaSlider', $data);\n\t\t}", "function add_image( $url = null, $caption = null, $alt = null, $position = null ) {\n\n\t\t$module = new I2M_Module__image( $url, $caption, $alt, $position );\n\n\t\t$this->module_list[] = $module->get_acf_layout();\n\t\t$this->modules[] = $module;\n\n\t\treturn $module;\n\n\t}", "public function poster() {\r\n $titre = $this->requete->getParametre(\"titre\");\r\n $contenu = $this->requete->getParametre(\"contenu\");\r\n \r\n $this->billet->ajouterBillet($titre, $contenu);\r\n // Exécution de l'action par défaut pour réafficher la liste des billets\r\n $this->executerAction(\"index\"); // utiliser header pour rediriger vers une nouvelle page liste billet admin \r\n }" ]
[ "0.5821236", "0.5731083", "0.5348935", "0.52925766", "0.5190834", "0.5184053", "0.5172822", "0.5155723", "0.50927645", "0.50896585", "0.5076415", "0.50673866", "0.5060036", "0.5054299", "0.50460917", "0.5045767", "0.5042095", "0.5017115", "0.50115144", "0.5004158", "0.4980735", "0.4956837", "0.49423912", "0.4928043", "0.49230126", "0.49223438", "0.49101236", "0.49046093", "0.48887613", "0.48878822" ]
0.61316556
0
get image categoryselector form element
function abl_droploader_get_image_cat_select() { $image_categories = getTree('root', 'image'); //$image_categories_select = str_ireplace("\n", '', tag('<label for="image-category">' . gTxt('image_category') . '</label>' . br . // treeSelectInput('category', $image_categories, '', 'image-category'), 'div', ' id="abl-droploader-image-cat-sel" class="category"')); //$alt_caption = tag('<label for="alt-text">'.gTxt('alt_text').'</label>'.br. // fInput('text', 'alt', '', 'edit', '', '', 50, '', 'alt-text'), 'div', ' class="alt text"'). // tag('<label for="caption">'.gTxt('caption').'</label>'.br. // '<textarea id="caption" name="caption"></textarea>' // , 'div', ' class="caption description text"'); $image_categories_select = str_ireplace("\n", '', tag(tag('<label for="image-category">'.gTxt('image_category').'</label>'.br. treeSelectInput('category', $image_categories, '', 'image-category'), 'div', ' class="category"'), 'div', ' id="abl-droploader-image-cat-sel"')); return $image_categories_select; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOptionCategoryImage()\n {\n return $this->optionCategoryImage;\n }", "function add_category_image ( $taxonomy ) { ?>\n <div class=\"form-field term-group\">\n <label for=\"category-image-id\"><?php _e('Image', 'hero-theme'); ?></label>\n <input type=\"hidden\" id=\"category-image-id\" name=\"category-image-id\" class=\"custom_media_url\" value=\"\">\n <div id=\"category-image-wrapper\"></div>\n <p>\n <input type=\"button\" class=\"button button-secondary ct_tax_media_button\" id=\"ct_tax_media_button\" name=\"ct_tax_media_button\" value=\"<?php _e( 'Add Image', 'hero-theme' ); ?>\" />\n <input type=\"button\" class=\"button button-secondary ct_tax_media_remove\" id=\"ct_tax_media_remove\" name=\"ct_tax_media_remove\" value=\"<?php _e( 'Remove Image', 'hero-theme' ); ?>\" />\n </p>\n </div>\n <?php\n }", "public function get_image_select_form() {\n\t\t$options = get_option('netx_options');\n\t\t$wrapper = new netxRestWrapper();\n\t\t$netx = $wrapper->getNetx();\n\n\t\t$supportedFileTypes = array(\n\t\t\t//images\n\t\t\t\"jpg\",\n\t\t\t\"jpeg\",\n\t\t\t\"png\",\n\t\t\t\"gif\",\n\t\t\t\"ico\",\n\t\t\t//documents\n\t\t\t\"pdf\",\n\t\t\t\"doc\",\n\t\t\t\"ppt\",\n\t\t\t\"odt\",\n\t\t\t\"xls\",\n\t\t\t\"psd\",\n\t\t\t//audio\n\t\t\t\"mp3\",\n\t\t\t\"m4a\",\n\t\t\t\"ogg\",\n\t\t\t\"wav\",\n\t\t\t//video\n\t\t\t\"mp4\",\n\t\t\t\"mov\",\n\t\t\t\"wmv\",\n\t\t\t\"avi\",\n\t\t\t\"mpg\",\n\t\t\t\"ogv\",\n\t\t\t\"3gp\",\n\t\t\t\"3g2\"\n\t\t);\n\n\t\t$pagingSize = intval($options['netx_paging_size']);\n\t\tif($pagingSize == 0) {\n\t\t\t$pagingSize = 200;\n\t\t}\n\n\t\t//get current category id\n\t\t$currentCatId = (trim($_POST['catId']) != '') ? $_POST['catId'] : $options['netx_base_category_id'];\n\n\t\t//get assets in current category\n\t\t$catAssets = $netx->getAssetsByCategoryID($currentCatId);\n\t\t$catAssetsNum = 0;\n\t\tforeach($catAssets as $key=>$asset){\n\t\t\t$catAssetsNum++;\n\t\t}\n\n\t\t$postID = intval($_REQUEST['post_id']);\n//\t$proxyURL = dirname(__FILE__) . '/proxy.php'\n\t\t?>\n\t\t<script type=\"text/javascript\">post_id = <?php echo $postID ?>;</script>\n\t\t<?php\n\t\t$paged = isset($_GET['paged']) ? $_GET['paged'] : 1;\n\t\t$catAssetsPages = ceil($catAssetsNum/$pagingSize);\n\t\t$catAssetsPage = $netx->getAssetsByCategoryID($currentCatId,$paged);\n\t\tif($catAssetsPages > 1){\n\n\t\t\techo '<div class=\"tablenav\"><div class=\"tablenav-pages\">';\n\t\t\tif($paged != 1){\n\t\t\t\techo '<a class=\"next page-numbers\" data-post-id=\"'.$postID.'\" data-page-num=\"'.($paged-1).'\">&laquo;</a>';\n\t\t\t}\n\t\t\tfor($i=($catAssetsPages <= 5) ? 1 : $paged;$i<=$paged+4;$i++){\n\t\t\t\tif($paged == $i){\n\t\t\t\t\techo '<span class=\"page-numbers current\">'.$i.'</span>';\n\t\t\t\t} else {\n\t\t\t\t\techo '<a class=\"page-numbers\" data-post-id=\"'.$postID.'\" data-page-num=\"'.$i.'\">'.$i.'</a>';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($paged != $catAssetsPages){\n\t\t\t\techo '<a class=\"next page-numbers\" data-post-id=\"'.$postID.'\" data-page-num=\"'.($paged+1).'\">&raquo;</a>';\n\t\t\t}\n\t\t\techo '</div></div>';\n\t\t}\n\n\t\t$catAssetsPageFiltered = array();\n\n\t\tif(count($catAssetsPage) > 0) {\n\t\t\tforeach($catAssetsPage as $key=>$asset){\n\t\t\t\t$assetID = $asset->getAssetID();\n\t\t\t\t$ast = $netx->getAsset($assetID);\n\n\t\t\t\t$fileIsSupported = false;\n\t\t\t\tforeach($supportedFileTypes as $supportedFileType) {\n\t\t\t\t\t$filename = $ast->getFile();\n\n\t\t\t\t\t$substrlength = strlen('.' . $supportedFileType);\n\t\t\t\t\tif(substr($filename, - $substrlength) === ('.' . $supportedFileType)) {\n\t\t\t\t\t\t$fileIsSupported = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif($fileIsSupported) {\n\t\t\t\t\t$catAssetsPageFiltered[$key] = $asset;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(count($catAssetsPageFiltered) > 0) {\n\t\t\tforeach($catAssetsPageFiltered as $key=>$asset){\n\t\t\t\t$assetID = $asset->getAssetID();\n\t\t\t\t$ast = $netx->getAsset($assetID);\n\t\t\t\t?>\n\t\t\t\t<div id=\"media-item-<?php echo $assetID; ?>\" class=\"media-item\">\n\t\t\t\t\t<img class=\"pinkynail toggle\" style=\"margin-top: 3px; display: block;\" alt=\"<?php echo $asset->getLabel1(); ?>\" src=\"<?php echo $wrapper->netxThumbUrl($assetID) ?>\" />\n\t\t\t\t\t<a class=\"toggle describe-toggle-on\" style=\"display: block;\">Show</a>\n\t\t\t\t\t<a class=\"toggle describe-toggle-off\" style=\"display: none;\">Hide</a>\n\t\t\t\t\t<div class=\"filename toggle\"><span class=\"title\"><?php echo $asset->getLabel1(); ?></span></div>\n\t\t\t\t\t<table class=\"slidetoggle describe\" style=\"display:none;\">\n\n\t\t\t\t\t\t<thead id=\"media-head-<?php echo $assetID; ?>\" class=\"media-item-info\">\n\t\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t\t<td id=\"thumbnail-head-<?php echo $assetID; ?>\" class=\"\">\n\t\t\t\t\t\t\t\t<p><a target=\"_blank\" href=\"<?php echo $wrapper->netxPreviewUrl($assetID); ?>\"><img style=\"margin-top: 3px\" alt=\"\" src=\"<?php echo $wrapper->netxThumbUrl($assetID); ?>\" class=\"thumbnail\"></a></p>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<p><strong>File name:</strong> <?php echo $asset->getLabel2(); ?></p>\n\t\t\t\t\t\t\t\t<p><strong>File type:</strong> <?php echo $asset->getLabel3(); ?></p>\n\t\t\t\t\t\t\t\t<p><strong>File size:</strong> <?php echo $asset->getLabel4(); ?></p>\n\t\t\t\t\t\t\t\t<p><strong>Upload date:</strong> <?php echo $asset->getLabel5(); ?></p>\n\t\t\t\t\t\t\t</td></tr>\n\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<tr class=\"image-size\">\n\t\t\t\t\t\t\t<th valign=\"top\" class=\"label\" scope=\"row\"><label for=\"asset[<?php echo $assetID; ?>][image-size]\"><span class=\"alignleft\">Size</span><br class=\"clear\"></label></th>\n\t\t\t\t\t\t\t<td class=\"field\">\n\t\t\t\t\t\t\t\t<div class=\"image-size-item\"><input type=\"radio\" value=\"thumbnail\" id=\"image-size-thumbnail-<?php echo $assetID; ?>\" name=\"asset[<?php echo $assetID; ?>][image-size]\"><label for=\"image-size-thumbnail-<?php echo $assetID; ?>\">Thumbnail</label> <label class=\"help\" for=\"image-size-thumbnail-<?php echo $assetID; ?>\">(150&nbsp;x&nbsp;150)</label></div>\n\t\t\t\t\t\t\t\t<div class=\"image-size-item\"><input type=\"radio\" value=\"medium\" id=\"image-size-preview-<?php echo $assetID; ?>\" name=\"asset[<?php echo $assetID; ?>][image-size]\"><label for=\"image-size-preview-<?php echo $assetID; ?>\">Preview</label> <label class=\"help\" for=\"image-size-full-<?php echo $assetID; ?>\">(<?php echo $ast->getPreviewfilewidth(); ?>&nbsp;x&nbsp;<?php echo $ast->getPreviewfileheight(); ?>)</label></div>\n\t\t\t\t\t\t\t\t<div class=\"image-size-item\"><input type=\"radio\" checked=\"checked\" value=\"full\" id=\"image-size-full-<?php echo $assetID; ?>\" name=\"asset[<?php echo $assetID; ?>][image-size]\"><label for=\"image-size-full-<?php echo $assetID; ?>\">Full Size</label> <label class=\"help\" for=\"image-size-full-<?php echo $assetID; ?>\">(<?php echo $ast->getFilewidth(); ?>&nbsp;x&nbsp;<?php echo $ast->getFileheight(); ?>)</label></div>\n\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif(!empty($ast->getViewNames())){\n\t\t\t\t\t\t\t\t\tforeach($ast->getViewNames() as $viewName) {\n\t\t\t\t\t\t\t\t\t\tif($viewName === 'previewXMP') {\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<div class=\"image-size-item\"><input type=\"radio\" checked=\"checked\" value=\"<?php echo $viewName ?>\" id=\"image-size-full-<?php echo $assetID; ?>\" name=\"asset[<?php echo $assetID; ?>][image-size]\"><label for=\"image-size-full-<?php echo $assetID; ?>\">View: </label> <label class=\"help\" for=\"image-size-full-<?php echo $assetID; ?>\"><?php echo $viewName ?></label></div>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\n\t\t\t\t\t\t<?php if(isset($options[\"netx_access_token\"]) && !empty(trim($options[\"netx_access_token\"]))): ?>\n\t\t\t\t\t\t\t<tr class=\"enable-download\">\n\t\t\t\t\t\t\t\t<th valign=\"top\" class=\"label\" scope=\"row\"><label for=\"asset[<?php echo $assetID; ?>][enable-download]\"><span class=\"alignleft\">Enable Download</span><br class=\"clear\"></label></th>\n\t\t\t\t\t\t\t\t<td class=\"field\">\n\t\t\t\t\t\t\t\t\t<div class=\"image-size-item\">\n\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" value=\"enable-download\" id=\"asset[<?php echo $assetID; ?>][enable-download]\" name=\"asset[<?php echo $assetID; ?>][enable-download]\">\n\t\t\t\t\t\t\t\t\t\t<label for=\"asset[<?php echo $assetID; ?>][enable-download]\">Save as download link</label>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t\t<tr class=\"submit\">\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t<td class=\"savesend\">\n\t\t\t\t\t\t\t\t<input type=\"button\" data-asset-id=\"<?php echo($assetID); ?>\" value=\"Insert into Post\" class=\"button netx-submit-button netx-add-item-submit\" id=\"\" name=\"send[<?php echo $assetID; ?>]\">\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}\n\t\t}else{\n\t\t\t?>\n\t\t\t<p class=\"netx-no-files-found-label\">No Files Found</p>\n\t\t\t<?php\n\t\t}\n\n\t\twp_die();\n\t}", "public function getCategoryFormElements($category) {\n //TYPE\n //DEFAULT ELEMENTS\n //Category ELEMENTS\n \n }", "function extra_category_fields( $tag ) { //check for existing featured ID\n $t_id = $tag->term_id;\n $cat_meta = get_option( \"category_$t_id\");\n\t?>\n\t<tr class=\"form-field\">\n\t\t<th scope=\"row\" valign=\"top\"><label for=\"cat_Image_url\"><?php _e('Category Url'); ?></label></th>\n\t\t<td><input type=\"text\" name=\"Cat_meta[cat_url]\" id=\"Cat_meta[img]\" size=\"3\" style=\"width:60%;\" value=\"<?php echo $cat_meta['cat_url'] ? $cat_meta['cat_url'] : ''; ?>\"><br />\n\t <span class=\"description\"><?php _e('Url for category'); ?></span>\n\t\t</td>\n\t</tr>\n\t<?php\n}", "function updated_category_image ( $term_id, $tt_id ) {\n if( isset( $_POST['category-image-id'] ) && '' !== $_POST['category-image-id'] ){\n $image = $_POST['category-image-id'];\n update_term_meta ( $term_id, 'category-image-id', $image );\n } else {\n update_term_meta ( $term_id, 'category-image-id', '' );\n }\n }", "function category_add_thumbnail_field( $category ) {\n\t\tglobal $wp_taxonomies;\n\t\t?>\n\n\t\t<div class=\"form-field hide-if-no-js\">\n\t\t\t<p style=\"color:#222;font-style:normal;\"><?php _e( 'Featured Image' ); ?></p>\n\t\t\t<div id=\"image-container\">\n\t\t\t\t\n\t\t\t\t<div id=\"selected-image\"></div>\n\t\t\t\t\n\t\t\t\t<a id=\"set-category-thumbnail\" title=\"<?php _e( 'Set featured image' ); ?>\" data-uploader-title=\"<?php _e( 'Choose a thumbnail for this category', 'category-thumbnail' ); ?>\" data-uploader-button-text=\"<?php _e( 'Set Category Thumbnail', 'category-thumbnail' ); ?>\" href=\"#\" class=\"button thickbox\">\n\t\t\t\t\t<?php _e( 'Set featured image' ); ?>\n\t\t\t\t</a>\n\t\t\t\t\n\t\t\t\t<a id=\"remove-category-thumbnail\" title=\"<?php _e( 'Set featured image' ); ?>\" href=\"#\" style=\"display:none;\">\n\t\t\t\t\t<?php _e( 'Remove featured image' ); ?>\n\t\t\t\t</a>\n\t\t\t\t\n\t\t\t</div>\n\t\t\t<input name=\"image\" id=\"image-id\" type=\"hidden\" value=\"\" />\n\t\t\t<p>\n\t\t\t\t<?php printf( __( 'The thumbnail to this %s', 'category-thumbnail' ), $wp_taxonomies[ $category ]->labels->singular_name ); ?>\n\t\t\t</p>\n\t\t</div>\n\t\t\n\t\t<?php\n\t\t\n\t}", "function classiera_my_category_fields($tag) {\r\n $tag_extra_fields = get_option(MY_CATEGORY_FIELDS);\r\n\t$category_icon_code = isset( $tag_extra_fields[$tag->term_id]['category_icon_code'] ) ? esc_attr( $tag_extra_fields[$tag->term_id]['category_icon_code'] ) : '';\r\n\t$category_image = isset( $tag_extra_fields[$tag->term_id]['category_image'] ) ? esc_attr( $tag_extra_fields[$tag->term_id]['category_image'] ) : '';\r\n $category_icon_color = isset( $tag_extra_fields[$tag->term_id]['category_icon_color'] ) ? esc_attr( $tag_extra_fields[$tag->term_id]['category_icon_color'] ) : '';\r\n $your_image_url = isset( $tag_extra_fields[$tag->term_id]['your_image_url'] ) ? esc_attr( $tag_extra_fields[$tag->term_id]['your_image_url'] ) : '';\r\n ?>\r\n\r\n<div class=\"form-field\">\t\r\n<table class=\"form-table\">\r\n <tr class=\"form-field\">\r\n \t<th scope=\"row\" valign=\"top\"><label for=\"category-page-slider\"><?php esc_html_e( 'Icon Code', 'classiera' ); ?></label></th>\r\n \t<td>\r\n\r\n\t\t\t\t<input id=\"category_icon_code\" type=\"text\" size=\"36\" name=\"category_icon_code\" value=\"<?php $category_icon = stripslashes($category_icon_code); echo esc_attr($category_icon); ?>\" />\r\n <p class=\"description\"><?php esc_html_e( 'AwesomeFont code', 'classiera' ); ?>: <a href=\"http://fontawesome.io/icons/\" target=\"_blank\">fontawesome.io/icons</a> Ex: fa fa-desktop</p>\r\n\r\n\t\t\t</td>\r\n </tr>\r\n\t\t<tr class=\"form-field\">\r\n <th scope=\"row\" valign=\"top\"><label for=\"category-page-slider\"><?php esc_html_e( 'Category Image', 'classiera' ); ?>&nbsp;Size:370x200px:</label></th>\r\n <td>\r\n <?php \r\n\r\n if(!empty($category_image)) {\r\n\r\n echo '<div style=\"width: 100%; float: left;\"><img id=\"category_image_img\" src=\"'. $category_image .'\" style=\"float: left; margin-bottom: 20px;\" /> </div>';\r\n echo '<input id=\"category_image\" type=\"text\" size=\"36\" name=\"category_image\" style=\"max-width: 200px; float: left; margin-top: 10px; display: none;\" value=\"'.$category_image.'\" />';\r\n echo '<input id=\"category_image_button_remove\" class=\"button\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px;\" value=\"Remove\" /> </br>';\r\n echo '<input id=\"category_image_button\" class=\"button\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px; display: none;\" value=\"Upload Image\" /> </br>'; \r\n\r\n } else {\r\n\r\n echo '<div style=\"width: 100%; float: left;\"><img id=\"category_image_img\" src=\"'. $category_image .'\" style=\"float: left; margin-bottom: 20px;\" /> </div>';\r\n echo '<input id=\"category_image\" type=\"text\" size=\"36\" name=\"category_image\" style=\"max-width: 200px; float: left; margin-top: 10px; display: none;\" value=\"'.$category_image.'\" />';\r\n echo '<input id=\"category_image_button_remove\" class=\"button\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px; display: none;\" value=\"Remove\" /> </br>';\r\n echo '<input id=\"category_image_button\" class=\"button\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px;\" value=\"Upload Image\" /> </br>';\r\n\r\n }\r\n\r\n ?>\r\n </td>\r\n\t\t\t\r\n <script>\r\n var image_custom_uploader;\r\n jQuery('#category_image_button').click(function(e) {\r\n e.preventDefault();\r\n\r\n //If the uploader object has already been created, reopen the dialog\r\n if (image_custom_uploader) {\r\n image_custom_uploader.open();\r\n return;\r\n }\r\n\r\n //Extend the wp.media object\r\n image_custom_uploader = wp.media.frames.file_frame = wp.media({\r\n title: 'Choose Image',\r\n button: {\r\n text: 'Choose Image'\r\n },\r\n multiple: false\r\n });\r\n\r\n //When a file is selected, grab the URL and set it as the text field's value\r\n image_custom_uploader.on('select', function() {\r\n attachment = image_custom_uploader.state().get('selection').first().toJSON();\r\n var url = '';\r\n url = attachment['url'];\r\n jQuery('#category_image').val(url);\r\n jQuery( \"img#category_image_img\" ).attr({\r\n src: url\r\n });\r\n jQuery(\"#category_image_button\").css(\"display\", \"none\");\r\n jQuery(\"#category_image_button_remove\").css(\"display\", \"block\");\r\n });\r\n\r\n //Open the uploader dialog\r\n image_custom_uploader.open();\r\n });\r\n\r\n jQuery('#category_image_button_remove').click(function(e) {\r\n jQuery('#category_image').val('');\r\n jQuery( \"img#category_image_img\" ).attr({\r\n src: ''\r\n });\r\n jQuery(\"#category_image_button\").css(\"display\", \"block\");\r\n jQuery(\"#category_image_button_remove\").css(\"display\", \"none\");\r\n });\r\n </script>\r\n </tr>\r\n <tr class=\"form-field\">\r\n <th scope=\"row\" valign=\"top\"><label for=\"category-page-slider\"><?php esc_html_e( 'Icon Background Color', 'classiera' ); ?></label></th>\r\n <td>\r\n\r\n <link rel=\"stylesheet\" media=\"screen\" type=\"text/css\" href=\"<?php echo get_template_directory_uri() ?>/inc/color-picker/css/colorpicker.css\" />\r\n <script type=\"text/javascript\" src=\"<?php echo get_template_directory_uri() ?>/inc/color-picker/js/colorpicker.js\"></script>\r\n <script type=\"text/javascript\">\r\n jQuery.noConflict();\r\n jQuery(document).ready(function(){\r\n jQuery('#colorpickerHolder').ColorPicker({color: '<?php echo $category_icon_color; ?>', flat: true, onChange: function (hsb, hex, rgb) { jQuery('#category_icon_color').val('#' + hex); }});\r\n });\r\n </script>\r\n\r\n <p id=\"colorpickerHolder\"></p>\r\n\r\n <input id=\"category_icon_color\" type=\"text\" size=\"36\" name=\"category_icon_color\" value=\"<?php echo $category_icon_color; ?>\" style=\"margin-top: 20px; max-width: 90px; visibility: hidden;\" />\r\n\r\n </td>\r\n </tr>\r\n <tr class=\"form-field\">\r\n <th scope=\"row\" valign=\"top\"><label for=\"category-page-slider\"><?php esc_html_e( 'Map Pin', 'classiera' ); ?>&nbsp;Size:70x70px:</label></th>\r\n <td>\r\n <?php \r\n\r\n if(!empty($your_image_url)) {\r\n\r\n echo '<div style=\"width: 100%; float: left;\"><img id=\"your_image_url_img\" src=\"'. $your_image_url .'\" style=\"float: left; margin-bottom: 20px;\" /> </div>';\r\n echo '<input id=\"your_image_url\" type=\"text\" size=\"36\" name=\"your_image_url\" style=\"max-width: 200px; float: left; margin-top: 10px; display: none;\" value=\"'.$your_image_url.'\" />';\r\n echo '<input id=\"your_image_url_button_remove\" class=\"button\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px;\" value=\"Remove\" /> </br>';\r\n echo '<input id=\"your_image_url_button\" class=\"button\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px; display: none;\" value=\"Upload Image\" /> </br>'; \r\n\r\n } else {\r\n\r\n echo '<div style=\"width: 100%; float: left;\"><img id=\"your_image_url_img\" src=\"'. $your_image_url .'\" style=\"float: left; margin-bottom: 20px;\" /> </div>';\r\n echo '<input id=\"your_image_url\" type=\"text\" size=\"36\" name=\"your_image_url\" style=\"max-width: 200px; float: left; margin-top: 10px; display: none;\" value=\"'.$your_image_url.'\" />';\r\n echo '<input id=\"your_image_url_button_remove\" class=\"button\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px; display: none;\" value=\"Remove\" /> </br>';\r\n echo '<input id=\"your_image_url_button\" class=\"button\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px;\" value=\"Upload Image\" /> </br>';\r\n\r\n }\r\n\r\n ?>\r\n </td>\r\n\r\n <script>\r\n var image_custom_uploader2;\r\n jQuery('#your_image_url_button').click(function(e) {\r\n e.preventDefault();\r\n\r\n //If the uploader object has already been created, reopen the dialog\r\n if (image_custom_uploader2) {\r\n image_custom_uploader2.open();\r\n return;\r\n }\r\n\r\n //Extend the wp.media object\r\n image_custom_uploader2 = wp.media.frames.file_frame = wp.media({\r\n title: 'Choose Image',\r\n button: {\r\n text: 'Choose Image'\r\n },\r\n multiple: false\r\n });\r\n\r\n //When a file is selected, grab the URL and set it as the text field's value\r\n image_custom_uploader2.on('select', function() {\r\n attachment = image_custom_uploader2.state().get('selection').first().toJSON();\r\n var url = '';\r\n url = attachment['url'];\r\n jQuery('#your_image_url').val(url);\r\n jQuery( \"img#your_image_url_img\" ).attr({\r\n src: url\r\n });\r\n jQuery(\"#your_image_url_button\").css(\"display\", \"none\");\r\n jQuery(\"#your_image_url_button_remove\").css(\"display\", \"block\");\r\n });\r\n\r\n //Open the uploader dialog\r\n image_custom_uploader2.open();\r\n });\r\n\r\n jQuery('#your_image_url_button_remove').click(function(e) {\r\n jQuery('#your_image_url').val('');\r\n jQuery( \"img#your_image_url_img\" ).attr({\r\n src: ''\r\n });\r\n jQuery(\"#your_image_url_button\").css(\"display\", \"block\");\r\n jQuery(\"#your_image_url_button_remove\").css(\"display\", \"none\");\r\n });\r\n </script>\r\n </tr>\r\n</table>\r\n</div>\r\n\r\n <?php\r\n}", "public function get_selector()\n {\n }", "function update_category_image ( $term, $taxonomy ) { ?>\n <tr class=\"form-field term-group-wrap\">\n <th scope=\"row\">\n <label for=\"category-image-id\"><?php _e( 'Image', 'hero-theme' ); ?></label>\n </th>\n <td>\n <?php $image_id = get_term_meta ( $term -> term_id, 'category-image-id', true ); ?>\n <input type=\"hidden\" id=\"category-image-id\" name=\"category-image-id\" value=\"<?php echo $image_id; ?>\">\n <div id=\"category-image-wrapper\">\n <?php if ( $image_id ) { ?>\n <?php echo wp_get_attachment_image ( $image_id, 'thumbnail' ); ?>\n <?php } ?>\n </div>\n <p>\n <input type=\"button\" class=\"button button-secondary ct_tax_media_button\" id=\"ct_tax_media_button\" name=\"ct_tax_media_button\" value=\"<?php _e( 'Add Image', 'hero-theme' ); ?>\" />\n <input type=\"button\" class=\"button button-secondary ct_tax_media_remove\" id=\"ct_tax_media_remove\" name=\"ct_tax_media_remove\" value=\"<?php _e( 'Remove Image', 'hero-theme' ); ?>\" />\n </p>\n </td>\n </tr>\n <?php\n }", "function &GetSelector()\r\n\t{\r\n\t\treturn $this->FindControl(\"selectorGroup\");\r\n\t}", "public function getCategoryImage($categoryId)\n {\n //$AccentOpaque = array(\"15\",\"50\",\"51\",\"52\",\"57\");\n //$Williamsburg = array(\"26\",\"86\",\"87\",\"88\",\"93\"); \n //$Carolina = array(\"23\",\"59\",\"66\",\"274\"); \n //$Springhill = array(\"25\",\"77\",\"78\",\"79\",\"84\");\n\t $AccentOpaque = array(\"57\");\n\t\t$Hammermill = array(\"246\");\n\t\t$Williamsburg = array(\"93\"); \n\t\t$Carolina = array(\"66\"); \n\t\t$Springhill = array(\"84\");\n\t\t//$PPAllBrands = array(\"209\");\n\t\t$Envelope = array(\"131\");\n\t\t$Forms = array(\"262\", \"263\", \"264\", \"265\", \"266\", \"267\", \"269\", \"270\", \"271\");\n\t\t$Bristols = array(\"233\", \"234\", \"235\", \"236\", \"237\", \"238\", \"239\", \"240\", \"241\");\n\t\t$Specialty = array(\"152\");\n\t\t$HotCupsLids = array(\"182\", \"178\", \"179\", \"183\", \"181\", \"220\", \"228\", \"229\", \"230\");\n\t\t$ColdCupsLids = array(\"158\", \"154\", \"275\", \"276\", \"277\");\n\t\t$FoodPackaging = array(\"213\", \"172\", \"212\", \"221\", \"222\", \"223\", \"214\", \"278\");\n \n //For category logo\n if(in_array($categoryId, $AccentOpaque)){\n //$catImgLogo = \"logo-accentopaque.jpg\";\n $catImgLogo = \"Accent Opaque\";\n }\n\t\t else if(in_array($categoryId, $Hammermill)){\n $catImgLogo = \"Hammermill\";\n }\n else if(in_array($categoryId, $Williamsburg)){\n $catImgLogo = \"Williamsburg\";\n }\n else if(in_array($categoryId, $Carolina)){\n $catImgLogo = \"Carolina\";\n }\n else if(in_array($categoryId, $Springhill)){\n $catImgLogo = \"Springhill\";\n }\n\t\t else if(in_array($categoryId, $Envelope)){\n $catImgLogo = \"Envelope\";\n }\n\t\t else if(in_array($categoryId, $Forms)){\n $catImgLogo = \"Forms\";\n }\n\t\t else if(in_array($categoryId, $Bristols)){\n $catImgLogo = \"Bristols\";\n }\n\t\t else if(in_array($categoryId, $Specialty)){\n $catImgLogo = \"Specialty\";\n }\n\t\t else if(in_array($categoryId, $HotCupsLids)){\n $catImgLogo = \"Hot Cups and Lids\";\n }\n\t\t else if(in_array($categoryId, $ColdCupsLids)){\n $catImgLogo = \"Cold Cups and Lids\";\n }\n\t\t else if(in_array($categoryId, $FoodPackaging)){\n $catImgLogo = \"Food Packaging\";\n }\n return $catImgLogo;\n }", "function category_edit_thumbnail_field( $tag, $taxonomy ) {\n\t\tglobal $wp_taxonomies;\n\t\t\n\t\t$image = get_option( 'category_thumbnail_image' );\n\t\t\n\t\tif ( is_array( $image ) && array_key_exists( $tag->term_id, $image ) ) {\n\t\t\t$image = $image[ $tag->term_id ];\n\t\t\t$attach = wp_get_attachment_image_src( (int) $image );\n\t\t\n\t\t} else {\n\t\t\t$image = false;\n\t\t\t\n\t\t}\n\t?>\n\t<tr class=\"form-field hide-if-no-js\">\n\t\t<th scope=\"row\" valign=\"top\">\n\t\t\t<p style=\"color:#222;font-size:13px;\"><?php _e( 'Featured Image' ); ?></p>\n\t\t</th>\n\t\t<td>\n\t\t\t<div id=\"image-container\">\n\t\t\t\t\t\t\t\t\n\t\t\t\t<?php if ( $image ) : ?>\n\t\t\t\t\t\n\t\t\t\t<div id=\"selected-image\">\n\t\t\t\t\t<img src=\"<?php echo esc_url( $attach[0] ); ?>\" />\n\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t<a id=\"set-category-thumbnail\" title=\"<?php _e( 'Set featured image' ); ?>\" data-uploader-title=\"<?php _e( 'Choose a thumbnail for this category', 'category-thumbnail' ); ?>\" data-uploader-button-text=\"<?php _e( 'Set Category Thumbnail', 'category-thumbnail' ); ?>\" href=\"#\" class=\"button thickbox\" style=\"display:none;\">\n\t\t\t\t\t<?php _e( 'Set featured image' ); ?>\n\t\t\t\t</a>\n\t\t\t\t\n\t\t\t\t<a id=\"remove-category-thumbnail\" title=\"<?php _e( 'Set featured image' ); ?>\" href=\"#\">\n\t\t\t\t\t<?php _e( 'Remove featured image' ); ?>\n\t\t\t\t</a>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t<?php else : ?>\n\t\t\t\t\n\t\t\t\t<div id=\"selected-image\"></div>\n\t\t\t\t\n\t\t\t\t<a id=\"set-category-thumbnail\" title=\"<?php _e( 'Set featured image' ); ?>\" data-uploader-title=\"<?php _e( 'Choose a thumbnail for this category', 'category-thumbnail' ); ?>\" data-uploader-button-text=\"<?php _e( 'Set Category Thumbnail', 'category-thumbnail' ); ?>\" href=\"#\" class=\"button thickbox\">\n\t\t\t\t\t<?php _e( 'Set featured image' ); ?>\n\t\t\t\t</a>\n\t\t\t\t\n\t\t\t\t<a id=\"remove-category-thumbnail\" title=\"<?php _e( 'Set featured image' ); ?>\" href=\"#\" style=\"display:none;\">\n\t\t\t\t\t<?php _e( 'Remove featured image' ); ?>\n\t\t\t\t</a>\n\t\t\t\t\n\t\t\t\t<?php endif; ?>\n\t\t\t\n\t\t\t</div>\n\t\t\t\n\t\t\t<input name=\"image\" id=\"image-id\" type=\"hidden\" value=\"<?php echo $image; ?>\" />\n\t\t\t\n\t\t\t<p class=\"description\">\n\t\t\t\t<?php printf( __( 'The thumbnail to this %s', 'category-thumbnail' ), $wp_taxonomies[ $taxonomy ]->labels->singular_name ); ?>\n\t\t\t</p>\n\t\t\t\n\t\t</td>\n\t</tr>\n\t<?php\n\t\t\n\t}", "function classiera_update_my_category_fields($term_id) {\r\n\tif(isset($_POST['taxonomy'])){\t\r\n\t if($_POST['taxonomy'] == 'category'):\r\n\t\t$tag_extra_fields = get_option(MY_CATEGORY_FIELDS);\r\n\t\t$tag_extra_fields[$term_id]['your_image_url'] = strip_tags($_POST['your_image_url']);\r\n\t\t$tag_extra_fields[$term_id]['category_image'] = $_POST['category_image'];\r\n\t\t$tag_extra_fields[$term_id]['category_icon_code'] = $_POST['category_icon_code'];\r\n\t\t$tag_extra_fields[$term_id]['category_icon_color'] = $_POST['category_icon_color'];\r\n\t\tupdate_option(MY_CATEGORY_FIELDS, $tag_extra_fields);\r\n\t endif;\r\n\t}\r\n}", "public function es_edit_category_fields( $term, $taxonomy ) {\n\n\t\t\t$banner_id = absint( get_woocommerce_term_meta( $term->term_id, 'banner_id', true ) );\n\n\t\t\tif ( $banner_id ) {\n\t\t\t\t$image = wp_get_attachment_thumb_url( $banner_id );\n\t\t\t} else {\n\t\t\t\t$image = wc_placeholder_img_src();\n\t\t\t}\n\t\t\t?>\n\t\t\t<tr class=\"form-field\">\n\t\t\t\t<th scope=\"row\" valign=\"top\"><label><?php _e( 'Banner', 'woocommerce' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<div id=\"product_cat_banner\" style=\"float:left;margin-right:10px;\"><img src=\"<?php echo esc_url( $image ); ?>\" width=\"60px\" height=\"60px\" /></div>\n\t\t\t\t\t<div style=\"line-height:60px;\">\n\t\t\t\t\t\t<input type=\"hidden\" id=\"product_cat_banner_id\" name=\"product_cat_banner_id\" value=\"<?php echo esc_attr( $banner_id ); ?>\" />\n\t\t\t\t\t\t<button type=\"submit\" class=\"banner_upload_image_button button\"><?php _e( 'Upload/Add image', 'woocommerce' ); ?></button>\n\t\t\t\t\t\t<button type=\"submit\" class=\"banner_remove_image_button button\"><?php _e( 'Remove image', 'woocommerce' ); ?></button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<script type=\"text/javascript\">\n\n\t\t\t\t\t\t// Uploading files\n\t\t\t\t\t\tvar file_frame;\n\n\t\t\t\t\t\tjQuery( document ).on( 'click', '.banner_upload_image_button', function( event ) {\n\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t// Create the media frame.\n\t\t\t\t\t\t\tfile_frame = wp.media.frames.downloadable_file = wp.media({\n\t\t\t\t\t\t\t\ttitle: '<?php _e( 'Choose an image', 'woocommerce' ); ?>',\n\t\t\t\t\t\t\t\tbutton: {\n\t\t\t\t\t\t\t\t\ttext: '<?php _e( 'Use image', 'woocommerce' ); ?>',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tmultiple: false\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t// When an image is selected, run a callback.\n\t\t\t\t\t\t\tfile_frame.on( 'select', function() {\n\t\t\t\t\t\t\t\tattachment = file_frame.state().get('selection').first().toJSON();\n\n\t\t\t\t\t\t\t\tjQuery('#product_cat_banner_id').val( attachment.id );\n\t\t\t\t\t\t\t\tjQuery('#product_cat_banner img').attr('src', attachment.url );\n\t\t\t\t\t\t\t\tjQuery('.banner_remove_image_button').show();\n\n\t\t\t\t\t\t\t\tfile_frame = undefined;\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t// Finally, open the modal.\n\t\t\t\t\t\t\tfile_frame.open();\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tjQuery( document ).on( 'click', '.banner_remove_image_button', function( event ) {\n\t\t\t\t\t\t\tjQuery('#product_cat_banner img').attr('src', '<?php echo esc_url( wc_placeholder_img_src() ); ?>');\n\t\t\t\t\t\t\tjQuery('#product_cat_banner_id').val('');\n\t\t\t\t\t\t\tjQuery('.banner_remove_image_button').hide();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t</script>\n\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<?php\n\t\t}", "public function es_add_category_fields() {\n\t\t\t?>\n\t\t\t<div class=\"form-field\">\n\t\t\t\t<label><?php _e( 'Banner', 'woocommerce' ); ?></label>\n\t\t\t\t<div id=\"product_cat_banner\" style=\"float:left;margin-right:10px;\"><img src=\"<?php echo esc_url( wc_placeholder_img_src() ); ?>\" width=\"60px\" height=\"60px\" /></div>\n\t\t\t\t<div style=\"line-height:60px;\">\n\t\t\t\t\t<input type=\"hidden\" id=\"product_cat_banner_id\" name=\"product_cat_banner_id\" />\n\t\t\t\t\t<button type=\"button\" class=\"banner_upload_image_button button\"><?php _e( 'Upload/Add image', 'woocommerce' ); ?></button>\n\t\t\t\t\t<button type=\"button\" class=\"banner_remove_image_button button\"><?php _e( 'Remove image', 'woocommerce' ); ?></button>\n\t\t\t\t</div>\n\n\n\t\t\t<script type=\"text/javascript\">\n\n\t\t\t\t// Only show the \"remove image\" button when needed\n\t\t\t\tif ( ! jQuery('#product_cat_banner_id').val() ) {\n\t\t\t\t\tjQuery('.banner_remove_image_button').hide();\n\t\t\t\t}\n\n\t\t\t\t// Uploading files\n\t\t\t\tvar file_frame;\n\n\t\t\t\tjQuery( document ).on( 'click', '.banner_upload_image_button', function( event ) {\n\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t// Create the media frame.\n\t\t\t\t\tfile_frame = wp.media.frames.downloadable_file = wp.media({\n\t\t\t\t\t\ttitle: '<?php _e( 'Choose an image', 'woocommerce' ); ?>',\n\t\t\t\t\t\tbutton: {\n\t\t\t\t\t\t\ttext: '<?php _e( 'Use image', 'woocommerce' ); ?>',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmultiple: false\n\t\t\t\t\t});\n\n\t\t\t\t\t// When an image is selected, run a callback.\n\t\t\t\t\tfile_frame.on( 'select', function() {\n\t\t\t\t\t\tattachment = file_frame.state().get('selection').first().toJSON();\n\n\t\t\t\t\t\tjQuery('#product_cat_banner_id').val( attachment.id );\n\t\t\t\t\t\tjQuery('#product_cat_banner img').attr('src', attachment.url );\n\t\t\t\t\t\tjQuery('.banner_remove_image_button').show();\n\n\t\t\t\t\t\tfile_frame = undefined;\n\n\t\t\t\t\t});\n\n\t\t\t\t\t// Finally, open the modal.\n\t\t\t\t\tfile_frame.open();\n\t\t\t\t});\n\n\t\t\t\tjQuery( document ).on( 'click', '.banner_remove_image_button', function( event ) {\n\t\t\t\t\tjQuery('#product_cat_banner img').attr('src', '<?php echo esc_url( wc_placeholder_img_src() ); ?>');\n\t\t\t\t\tjQuery('#product_cat_banner_id').val('');\n\t\t\t\t\tjQuery('.banner_remove_image_button').hide();\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\n\t\t\t</script>\n\t\t\t\t<div class=\"clear\"></div>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "function eZImageCategory( $id=-1 )\r\n {\r\n $this->ExcludeFromSearch = \"false\";\r\n if ( $id != -1 )\r\n {\r\n $this->ID = $id;\r\n $this->get( $this->ID );\r\n }\r\n }", "function gtags_group_category_form() {\n\tglobal $bp, $show_group_add_form_cats;\t\n\tif ($show_group_add_form_cats) return; // prevents showing form twice\n\t$show_group_add_form_cats = true;\n\n\t// the group category\t\n\t$group_cats = get_option('gtags_category'); \n\tif (empty($group_cats)) return;\n\t\n\t$selected = groups_get_groupmeta( $bp->groups->current_group->id, 'gtags_group_cat' ); \n\t?><label for=\"group-cat\"><?php _e( 'Group Category', 'gtags' ) ?></label>\n\t<select name=\"group-cat\" id=\"group-cat\" />\n\t\t<option value=\"\"><?php _e('--- SELECT ONE ---', 'gtags') ?></option>\n\t<?php foreach ( $group_cats as $tag => $desc ): ?>\n\t\t<?php if ( !$desc ) $desc = $tag; ?>\n\t\t<option value=\"<?php echo $tag; ?>\" <?php if ( $tag == $selected ) echo 'selected=\"selected\"' ?>><?php echo $desc; ?></option>\n\t<?php endforeach; ?>\n\t</select>\n\t<i><?php _e('(the primary group activity)', 'gtags'); ?></i><br><?php \t\n}", "function helperGetCategoryImage($catImg, $parent=0) {\n\t\t$table = 'tx_rggooglemap_cat';\n\t\t$field = 'uid,image,parent_uid';\n\t\t$where = 'deleted = 0 AND hidden=0 ';\n\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($field,$table,$where,$groupBy='',$orderBy,$limit='');\n\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\tif ($row['image']=='') {\n\t\t\t\t// get image of parent category\n\t\t\t\t$whereTemp = 'deleted = 0 AND hidden=0 AND uid = ' . $row['parent_uid'];\n\t\t\t\t$res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery($field,$table,$whereTemp);\n\t\t\t\t$row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2);\n\t\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res2);\n\t\t\t\t$catImg[$row['uid']] = $row2['image'];\n\t\t\t} else {\n\t\t\t\t$catImg[$row['uid']] = $row['image'];\n\t\t\t}\n\t\t}\n\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res);\n\n\t\treturn $catImg;\n\t}", "function colorpicker_field_add_new_category( $taxonomy ) { ?> \r\n\t<div class=\"form-field term-colorpicker-wrap\"> \r\n\t<label for=\"term-colorpicker\">Category Color</label> \r\n\t<input name=\"_category_color\" value=\"#ffffff\" class=\"colorpicker\" id=\"term-colorpicker\" /> \r\n\t<p>This is the field description where you can tell the user how the color is used in the theme.</p> \r\n\t</div> <?php }", "function createRatingSelector() {\n global $serendipity;\n\n // Since the inputs are set up with the proper names, the config item\n // gets saved automatically, with no need for magic\n\n // Get the filename to be automatically selected\n $this->set_valid_image_data();\n $cursel = $this->image_name;\n\n $this->select_css = '';\n $this->select_html = '';\n // We will be wrapped in a <tr><td colspan=\"2\">\n $this->select_html .= \"\n<strong>\" . PLUGIN_KARMA_IMAGE . \"</strong><br />\n<span style='color: rgb(94, 122, 148); font-size: 8pt;'>&nbsp;\".PLUGIN_KARMA_IMAGE_DESC.\"</span>\";\n if ($serendipity['version'][0] < 2) {\n $this->select_html .= \"\n</td>\n<td></td>\n</tr>\n<tr>\n<td colspan='2'>\\n\";\n }\n $this->select_html .= \"\n<table border='1' class='serendipity_karmaVote_selectorTable'>\";\n // Add the 'text-only' selection and its CSS\n if ($cursel == '0') {\n $checked = 'checked=\"checked\" ';\n } else {\n $checked = '';\n }\n $this->image_name = '0';\n $bar = $this->createRatingBar('', 0, 0, 'textbar');\n $this->select_html .= \"\n<tr id='serendipity_karmaVote_selectorTable_textOnly'>\n<td colspan='3' align='center'><input type='radio' name='serendipity[plugin][base_image]' value='0' $checked/>\" . PLUGIN_KARMA_STATISTICS_POINTS_NO . \"<br />$bar<br /></td>\\n\";\n $this->select_css .= \"\n.textbar, .textbar a, .textbar a:hover {\n font-size: 100%;\n position: relative;\n background: none;\n}\n.serendipityAdminContent span.textbar {\n color: black !important;\n}\n\";\n // Retrieve all the *valid* images from the image directory\n $files = $this->getImageFiles();\n // Add an <ol> for each rating bar, and add its CSS overrides\n $n = 0;\n foreach ($files as $fdata) {\n // Columnize\n if (($n % 3) == 0) {\n // Time to start a new row\n $this->select_html .= \"</tr>\\n<tr>\\n\";\n }\n\n // Set the image data\n $fname = $fdata['fname'];\n $height = $fdata['height'];\n $width = $fdata['width'];\n $ratio = $width / $height;\n // If this is a single segment, adjust width\n if ($ratio < $this->max_segment_ratio) {\n $width = $width * 5;\n }\n $height = $height / 3;\n // Set up class variables correctly\n $this->image_name = $fname;\n $this->image_width = $width;\n $this->image_height = $height;\n\n // Create a rating bar of this image\n //\n // What would be a good CSS class for this image?\n $css_class = str_replace(array('.',' '), array('_','_'), $fname);\n $checked = '';\n if ($fname == $cursel) {\n $checked = 'checked=\"checked\" ';\n }\n $bar_html = \n\"<td align='center' id='serendipity_karmaVote_select_$css_class'>\n <input type='radio' name='serendipity[plugin][base_image]' value='$fname' $checked/>\n <span style='font-size: 8pt;'>$fname</span><br />\\n\" . \n $this->createRatingBar('', -1, 2, $css_class) .\n\"</td>\\n\";\n $bar_html = sprintf($bar_html, '', '2.5 of 5', '1');\n $this->select_html .= $bar_html;\n // Add the necessary CSS to the stylesheet (will be added when css hooks are called)\n // Sorry to interrupt your regularly scheduled HTML; I need to\n // use the $css_class while it's still here.\n $this->select_css .= \"\n/* Overrides for $css_class */\n.$css_class \n{\n width: ${width}px;\n height: ${height}px;\n}\n.$css_class,\n.$css_class a:hover,\n.$css_class .serendipity_karmaVoting_current-rating\n{\n background-image: url({$serendipity['baseURL']}plugins/serendipity_event_karma/img/${fname});\n}\n.$css_class,\n.$css_class a,\n.$css_class .serendipity_karmaVoting_current-rating\n{\n line-height: ${height}px;\n height: ${height}px;\n}\n\n\";\n $n++;\n } // Go back up for another image\n\n // Check for nothing displayed\n if ($n == 0) {\n // There were no images!\n $this->select_html .= \"</tr>\\n<tr><td>\" . PLUGIN_KARMA_NO_IMAGES . \"</td>\";\n }\n\n // End the table, with a config-item bottom-border separator\n $this->select_html .= \n\"</tr>\\n</table>\\n\";\n if ($serendipity['version'][0] < 2) {\n $this->select_html .= \n\"<tr><td colspan='2' style='border-bottom: 1px solid #000000; vertical-align: top'>&nbsp;<td></tr>\\n\";\n }\n // The config item and row are closed by the core code\n\n return $this->select_html;\n }", "private function categoriesFormInputs()\n {\n // Get the field name of the field with the category icon\n // #47631, dwildt, 1-\n //$arrLabels[ 'catIcon' ] = $this->confMap['configuration.']['categories.']['fields.']['categoryIcon'];\n // #47631, #i0007, dwildt, 10+\n switch ( true )\n {\n case( $this->pObj->typoscriptVersion <= 4005004 ):\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'categoryIcon' ];\n break;\n case( $this->pObj->typoscriptVersion <= 4005007 ):\n default:\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryIcon' ];\n break;\n }\n // #47631, #i0007, dwildt, 10+\n // Default space in HTML code\n $tab = ' ';\n\n // FOREACH category label\n//$this->pObj->dev_var_dump( $this->arrCategories );\n // #i0118, dwildt, 1-/+\n //foreach ( $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n foreach ( ( array ) $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n {\n // Get the draft for an input field\n $cObj_name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input' ];\n $cObj_conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input.' ];\n $input = $this->pObj->cObj->cObjGetSingle( $cObj_name, $cObj_conf );\n // replace the category marker\n $input = str_replace( '###CAT###', $labelValue, $input );\n // 4.1.17, 120927, dwildt\n // replace the category marker\n //$labelValueWoSpc = str_replace( ' ', null, $labelValue );\n $labelValueWoSpc = $this->zz_properFormLabel( $labelValue );\n $input = str_replace( '###CAT_WO_SPC###', $labelValueWoSpc, $input );\n // 4.1.17, 120927, dwildt\n // #54548, 131221, dwildt, 6+\n $class = $this->arrCategories[ 'cssClass' ][ $labelKey ];\n if ( !empty( $class ) )\n {\n $class = ' class=\"' . $class . '\"';\n }\n $input = str_replace( '###CLASS###', $class, $input );\n\n // IF draft for an input field contains ###IMG###, render an image\n $pos = strpos( $input, '###IMG###' );\n if ( !( $pos === false ) )\n {\n // SWITCH : Render the image\n switch ( true )\n {\n // #i0062\n case( $labelKey == $this->arrWoCategories[ 'iconKey' ] ):\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n case( is_array( $this->arrCategories[ 'icons' ] ) ):\n // 4.1.7, dwildt, +\n $this->cObjDataAddArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n $img = $this->renderMapMarkerVariablesSystemItem( 'categoryIconLegend' );\n $this->cObjDataRemoveArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n // 4.1.7, dwildt, +\n break;\n default:\n // Render the image\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n }\n // SWITCH : Render the image\n\n $input = str_replace( '###IMG###', $img, $input );\n }\n // IF draft for an input field contains ###IMG###, render an image\n\n $arrInputs[] = $tab . $input;\n }\n // FOREACH category label\n // Move array of input fields to a string\n // #i0118, dwildt, 1-/+\n //$inputs = implode( PHP_EOL, $arrInputs );\n $inputs = implode( PHP_EOL, ( array ) $arrInputs );\n $inputs = trim( $inputs );\n\n // RETURN input fields\n return $inputs;\n }", "public function getImageTag();", "public function getName()\n {\n return 'category_form';\n }", "public function getValueAfterElementHtml()\n {\n $html = '';\n\n switch ($this->getAttribute()) {\n case 'category_ids':\n $image = $this->_assetRepo->getUrl('images/rule_chooser_trigger.gif');\n break;\n }\n\n if (!empty($image)) {\n $html = '<a href=\"javascript:void(0)\" class=\"rule-chooser-trigger\"><img src=\"' .\n $image .\n '\" alt=\"\" class=\"v-middle rule-chooser-trigger\" title=\"' .\n __(\n 'Open Chooser'\n ) . '\" /></a>';\n }\n return $html;\n }", "public function getImagenesIndexCategorias(){\n foreach($this->indexContent as $content){\n //echo \"--------------------- Imagenes --------------<br>\";\n $vectorImagenes = array();\n $dom = new DOMDocument();\n $dom->loadHTML(\"$content\");\n $xpath = new DOMXPath($dom);\n $tag = \"div\";\n $class = \"home-category-box\";\n $consulta = \"//\".$tag.\"[@class='\".$class.\"']\";\n $resultados = $xpath->query($consulta);\n if ($resultados->length > 0){\n $contador = 0;\n foreach($resultados as $imagenes){\n if ($contador == 0){\n $todasImagenes = $imagenes->getElementsByTagName(\"img\");\n if ($todasImagenes->length > 0){\n foreach($todasImagenes as $imagen){\n $urlImagen = $imagen->getAttribute(\"src\");\n //echo \"url imagen categorias padre: \".$urlImagen.\"<br>\";\n array_push($vectorImagenes,$urlImagen);\n }\n }\n }\n $contador++;\n }\n }\n //echo \"--------------------- Fin Imagenes --------------<br>\";\n }\n return $vectorImagenes;\n }", "public function getCategoryIcon();", "public function getFormCategory()\n\t{\n\t\treturn strtolower($this->_removeNonAlphaCharacters($this->category));\n\t}", "public function getSearchCategory(){\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n return $objectManager->get ( 'Apptha\\Airhotels\\Block\\Booking\\Form' );\n }", "public function category() {\n\t\treturn static::get_thrive_advanced_label();\n\t}" ]
[ "0.62970215", "0.62586004", "0.6227012", "0.57733345", "0.56803226", "0.56673837", "0.5647469", "0.5637749", "0.5631106", "0.56053597", "0.55868727", "0.55862486", "0.55563235", "0.55137765", "0.5445103", "0.54429305", "0.5440785", "0.5428641", "0.54227984", "0.53898305", "0.5370384", "0.5331752", "0.53148514", "0.53062683", "0.5296137", "0.5259856", "0.52558374", "0.5246756", "0.52417064", "0.52321017" ]
0.7250795
0
image_uploaded callback (txp_image.php) return JSON (imageid) and exit
function abl_droploader_image_uploaded($event, $step, $id) { if (ps('abl_droploader') == '') return; $response = array( 'status' => 1, 'image_id' => $id, ); echo json_encode($response); exit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _imgUpload(){\r\n\r\n\r\n\r\n // It will always be called via ajax so we will respond as such\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n // Mime types of images allowed for upload\r\n $allowed_types = ['image/png', 'image/jpeg', 'image/gif'];\r\n\r\n\r\n\r\n // Something that will return the mime type\r\n $img = getimagesize($_FILES['image']['tmp_name']);\r\n\r\n\r\n\r\n // Get the extension\r\n $extension = pathinfo($_FILES['image']['tmp_name'],PATHINFO_EXTENSION);\r\n\r\n\r\n\r\n // Where is the image currently\r\n $sourcePath = $_FILES['image']['tmp_name'];\r\n\r\n\r\n\r\n // Potentially do a lookup on the mime type and set the extension ourselves\r\n $tmp_name = uniqid().'.'.$extension;\r\n\r\n // Move the image to a _tmp directory which will move again when saved\r\n $targetPath = ROOT.'/site/files/_tmp/'.$tmp_name;\r\n\r\n // This will be the path returned so the image can be displayed in the modal editor\r\n $webPath = WEBROOT.'/site/files/_tmp/'.$tmp_name;\r\n\r\n // Validate the mime type against the allowed array\r\n if(!in_array($img['mime'], $allowed_types)) {\r\n echo \"Only PNG, JPEG or GIF images are allowed!\";\r\n exit;\r\n } elseif(filesize($sourcePath) > 1000000) {\r\n echo \"You cannot upload an image larger that 1mb\";\r\n exit;\r\n }\r\n\r\n // Move the file to the _tmp directory for editing\r\n // return the weburl\r\n if(move_uploaded_file($sourcePath,$targetPath)){\r\n $result->url = $webPath;\r\n $response = 200;\r\n }\r\n\r\n }\r\n\r\n }\r\n // Return the response\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n\r\n }", "public function execute(){\n\n if(!(in_array($_FILES['file']['type'], \\Vegans\\Controllers\\Images\\Consts::FILETYPES))){\n throw new Error('ERROR during passing parameters');\n }\n\n $time = strtotime(\"now\");\n $fileName = $this->_storeImages($_FILES,$time);\n\n if(strlen($fileName) > 0){\n $vars = [\n 'filename' => $fileName,\n 'path' => \\Vegans\\Controllers\\Images\\Consts::IMAGEPATH . $fileName,\n 'created_at' => $time\n ];\n\n $id = $this->_saveData($vars);\n }\n\n echo json_encode(array_merge(['id' => $id], $vars));\n }", "private function _imgSave(){\r\n\r\n\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n $url = strtok($_POST['url'], '?');\r\n\r\n $sourcePath = ROOT.'/site/files/_tmp/'.basename($url);\r\n $img = getimagesize($sourcePath);\r\n $new_name = uniqid();\r\n\r\n switch($img['mime']){\r\n case 'image/png':\r\n $new_name .= '.png';\r\n break;\r\n case 'image/jpeg':\r\n $new_name .= '.jpg';\r\n break;\r\n case 'image/gif':\r\n $new_name .= '.gif';\r\n break;\r\n default:\r\n echo \"Only PNG, JPEG or GIF images are allowed!\";\r\n exit;\r\n }\r\n\r\n $targetPath = ROOT.'/site/files/'.$new_name;\r\n $webPath = WEBROOT.'/site/files/'.$new_name;\r\n\r\n if(rename($sourcePath, $targetPath)){\r\n $result->url = $webPath;\r\n $result->size = [$img[0],$img[1]];\r\n $result->alt = 'an image';\r\n $response = 200;\r\n } else {\r\n $response = 400;\r\n }\r\n\r\n }\r\n }\r\n\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n\r\n }", "public function upload()\n {\n if(!Csrf::checkToken($this->_request->getInput('_CSRF')))\n {\n $response = [\n 'status' => 'error',\n 'message' => 'csrf'\n ];\n return $this->_response->returnJson($response);\n }\n\n $file = $this->_request->getUploadedFile('img');\n $uploader = new ImageUpload(new Imagick($file['tmp_name']));\n $uploadResult = $uploader->upload($file);\n\n return $this->_response->returnJson($uploadResult);\n }", "public function imageUploadNicEditor()\n {\nif(isset($_FILES['image'])){\n //Get the image array of details\n $img = $_FILES['image']; \n //The new path of the uploaded image, rand is just used for the sake of it\n \n \n $image_name= rand().$img[\"name\"];\n \n \n $path = \"contents/board/\" . $image_name;\n $path_image = \"contents/board/\" . $image_name;\n //Move the file to our new path\n move_uploaded_file($img['tmp_name'],$path);\n //Get image info, reuiqred to biuld the JSON object\n $data = getimagesize($path);\n //The direct link to the uploaded image, this might varyu depending on your script location \n\n \n $link = \"http://$_SERVER[HTTP_HOST]\".\"/\".$path_image;\n //Here we are constructing the JSON Object\n $res = array(\"upload\" => array(\n \"links\" => array(\"original\" => $link),\n \"image\" => array(\"width\" => $data[0],\n \"height\" => $data[1]\n ) \n ));\n //echo out the response :)\n echo json_encode($res);\n }\n }", "public function upload64() {\n $post = json_decode(file_get_contents('php://input'), true);\n\n $access = $this->_checkAccess($post['auth'],'shortLiveToken');\n\n if(!isset($access['shortLiveToken'])) {\n $result['err'] = 'Permission Denied';\n echo json_encode($result, true);\n die();\n }\n\n $imgName = md5('avatar.'.$access['shortLiveToken']);\n\n $options = array(\n 'path' => 'uploader/tmpImgStore/',\n 'width' => 300,\n 'height' => 300\n );\n\n require_once('photoProcess.php');\n $photo = new photoProcess();\n $photo->set($options);\n\n $upload = $photo->photo64($post['source'], $imgName);\n\n echo json_encode($upload, true);\n }", "function image_upload($img_path)\n{\n $pvars = array(\"content_type\" => 1, \"img\" => \"@\".$img_path);\n\n // initialize curl and set parameters\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, 'http://www.pixhost.org/api');\n curl_setopt($curl, CURLOPT_TIMEOUT, 30);\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $pvars);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\n // execute, get information and close connection\n $response = curl_exec($curl);\n $info = curl_getinfo($curl);\n curl_close ($curl);\n\n // check if the http-code is 200\n if($info['http_code'] != 200) {\n exit(\"OAuth error: \".$response);\n }\n\n // decode the json-encoded response\n $response_array = json_decode($response);\n\n return $response_array;\n}", "public function add_image_post() {\n $itemId = $this->input->post('item_id');\n $uploadResult= $this->upload();\n if ($uploadResult['upload'] === 'ok') {\n $fileData = $uploadResult['fileData'];\n $updatePayload = array(\n 'photo' => $fileData['file_name']\n );\n $res = $this->model->update($itemId, $updatePayload);\n return $this->response(\n array(\n \"status\" => \"ok\",\n \"result\" => $res\n ),\n parent::HTTP_ACCEPTED\n );\n\n }else{\n return $this->response(\n array( 'status' => 'UPLOADING FAILED', \n 'code' => '200', \n 'message' => $uploadResult['err']), \n parent::HTTP_BAD_GATEWAY );\n }\n }", "function upload()\n\t{\t\t\n\t\t$rfc1867 = function_exists('apc_fetch') && ini_get('apc.rfc1867');\n\n\t\tif(!function_exists('json_encode')) \n\t\t{\n\t\t\tdie('{\"error\" : \"Image upload host does not have the required dependicies (json_encode/decode)\"}');\n\t\t}\n\n\t\t$id = $_POST['APC_UPLOAD_PROGRESS'];\n\t\tif(empty($id)) \n\t\t{\n\t\t\t$id = $_GET['id'];\n\t\t}\n\n\t\tif($_SERVER['REQUEST_METHOD']=='POST') \n\t\t{ \n\t\t\t// Upload is complete\n\t\t\tif(empty($id) || !is_numeric($id)) \n\t\t\t{\n\t\t\t\t$this->_nicupload_error('Invalid Upload ID');\n\t\t\t}\n\t\t\tif(!is_dir($this->nicupload_path) || !is_writable($this->nicupload_path)) \n\t\t\t{\n\t\t\t\t$this->_nicupload_error('Upload directory '.$this->nicupload_path.' must exist and have write permissions on the server');\n\t\t\t}\n\t\t\n\t\t\t$file = $_FILES['nicImage'];\n\t\t\t$image = $file['tmp_name'];\n\t\t\n\t\t\t$max_upload_size = $this->_ini_max_upload_size();\n\t\t\tif(!$file) \n\t\t\t{\n\t\t\t\t$this->_nicupload_error('Must be less than '.$this->_bytes_to_readable($max_upload_size));\n\t\t\t}\n\t\t\n\t\t\t$ext = strtolower(substr(strrchr($file['name'], '.'), 1));\n\t\t\t@$size = getimagesize($image);\n\t\t\tif(!$size || !in_array($ext, $this->nicupload_allowed_extensions)) \n\t\t\t{\n\t\t\t\t$this->_nicupload_error('Invalid image file, must be a valid image less than '.$this->_bytes_to_readable($max_upload_size));\n\t\t\t}\n\t\t\n\t\t\t$filename = $id.'.'.$ext;\n\t\t\t$path = $this->nicupload_path.'/'.$filename;\n\t\t\n\t\t\tif(!move_uploaded_file($image, $path)) \n\t\t\t{\n\t\t\t\t$this->_nicupload_error('Server error, failed to move file');\n\t\t\t}\n\t\t\n\t\t\tif($rfc1867) \n\t\t\t{\n\t\t\t\t$status = apc_fetch('upload_'.$id);\n\t\t\t}\n\t\t\tif(!$status)\n\t\t\t{\n\t\t\t\t$status = array();\n\t\t\t}\n\t\t\t$status['done'] = 1;\n\t\t\t$status['width'] = $size[0];\n\t\t\t$status['url'] = $this->_nicupload_file_uri($filename);\n\t\t\n\t\t\tif($rfc1867) \n\t\t\t{\n\t\t\t\tapc_store('upload_'.$id, $status);\n\t\t\t}\n\n\t\t\t$this->_nicupload_output($status, $rfc1867);\n\t\t\texit;\n\t\t} \n\t\telse if(isset($_GET['check'])) \n\t\t{ \n\t\t\t// Upload progress check\n\t\t\t$check = $_GET['check'];\n\t\t\tif(!is_numeric($check)) \n\t\t\t{\n\t\t\t\t$this->_nicupload_error('Invalid upload progress id');\n\t\t\t}\n\t\t\n\t\t\tif($rfc1867) \n\t\t\t{\n\t\t\t\t$status = apc_fetch('upload_'.$check);\n\t\t\t\t\n\t\t\t\tif($status['total'] > 500000 && $status['current']/$status['total'] < 0.9 ) \n\t\t\t\t{ \n\t\t\t\t\t// Large file and we are < 90% complete\n\t\t\t\t\t$status['interval'] = 3000;\n\t\t\t\t} \n\t\t\t\telse if($status['total'] > 200000 && $status['current']/$status['total'] < 0.8 ) \n\t\t\t\t{ \n\t\t\t\t\t// Is this a largeish file and we are < 80% complete\n\t\t\t\t\t$status['interval'] = 2000;\n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$status['interval'] = 1000;\n\t\t\t\t}\n\t\t\t\t$this->_nicupload_output($status);\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\t$status = array();\n\t\t\t\t$status['noprogress'] = true;\n\t\t\t\tforeach($this->nicupload_allowed_extensions as $e) \n\t\t\t\t{\n\t\t\t\t if(file_exists($this->nicupload_path.'/'.$check.'.'.$e)) \n\t\t\t\t\t{\n\t\t\t\t $ext = $e;\n\t\t\t\t break;\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t\tif($ext) \n\t\t\t\t{\n\t\t\t\t $status['url'] = $this->_nicupload_file_uri($check.'.'.$ext);\n\t\t\t\t}\n\t\t\t\t$this->_nicupload_output($status);\n\t\t\t}\n\t\t}\n\t}", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'Recsite');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('code' , $ret['data']);\n\t\t$this->assign('msg' , $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n }", "public function handleuploadAction() {\r\n $allowedExtensions = array(\"png\",\"jpg\",\"jpeg\",\"gif\",\"bmp\");\r\n // max file size in bytes\r\n $sizeLimit = 10 * 1024 * 1024;\r\n \r\n $uploader = new qqFileUploader($allowedExtensions, $sizeLimit);\r\n \r\n $dir = \"img/picture\";\r\n \r\n $result = $uploader->handleUpload($dir);\r\n \r\n $image = \\Nette\\Image::fromFile($dir . \"/\" . $result['filename']);\r\n $image->resize(269, 200, \\Nette\\Image::EXACT);\r\n $image->save($dir . \"/\" . $result['filename']);\r\n \r\n // to pass data through iframe you will need to encode all html tags\r\n echo htmlspecialchars(Zend_Json::encode($result), ENT_NOQUOTES);\r\n $this->_helper->layout->disableLayout();\r\n $this->_helper->viewRenderer->setNoRender(TRUE);\r\n }", "protected function processImage() {}", "public function upload()\n {\n $photoUpload = new PhotoUpload();\n $return = array(\"success\",false);\n if($photoUpload->execute()){\n $return['success'] = true;\n }\n echo json_encode($return);\n exit();\n }", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'bestj');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('code' , $ret['data']);\n\t\t$this->assign('msg' , $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function upload_image($filename){\n // post the picture\n $data = $this->prepareImageData($filename);\n if($data) {\n $post = $this->sendRequest('media/upload/', true, $data, $this->agent, true);\n if (is_array($post) && count($post) == 2 && $post[0] == 200 && is_object(json_decode($post[1]))) {\n $media = json_decode($post[1]);\n return $media->media_id;\n } else {\n $error = json_decode($post[1]);\n $this->log($error);\n }\n }\n }", "function imageUpload($args)\n{\n if (is_object($login_state = authorize($args))) {\n return $login_state;\n }\n $args = decode64($args);\n logger('uploadJSON', ($args['loglevel']));\n if (!($album = getItemByID('albums', $args['id']))) {\n return new ZEN_Error(-1, 'No folder with database ID '.$args['id'].' found!');\n }\n $filepath = getAlbumFolder().($args['parentFolder'] ? $args['parentFolder'].'/' : '').$args['folder'];\n $filename = $args['filename'];\n //$filepath = utf8_decode( $filepath );\n //$filename = utf8_decode( $filename );\n $filepath = $filepath;\n $filename = $filename;\n // save file\n $fp = fopen($filepath.'/'.$filename, 'wb');\n if (!$fp) {\n return new ZEN_Error(-1, 'Cannot open '.$filepath.'/'.$filename);\n }\n //fwrite( $fp, base64_decode( $args[ 'file' ] ) );\n if ($fw = fwrite($fp, base64_decode($args['file'])) === false) {\n return new ZEN_Error(-1, 'Cannot write to file '.$filename);\n }\n\n fclose($fp);\n $img = newImage($album, $filename);\n $img->setOwner($args['loginUsername']);\n //addZenPubData( $args[ 'id' ], $img->filename . '=' . $args[ $img->filename ] );\n return entitysave([\n 'status' => 'success',\n 'id' => $img->getID(),\n 'name' => $img->filename,\n 'url' => WEBPATH.'index.php?album='.urlencode($img->album->name).'&image='.urlencode($img->filename),\n ]);\n}", "public function uploadAjax(){\n if (!empty($_POST['img64'])){\n $_SESSION['countElemPrev'] = $_POST['countElem'];\n $this->loadModel('Photo');\n $this->loadModel('User');\n\n// recupere le tab avec path + id\n $imgPrev = $this->_getDataImg();\n $idMin = $imgPrev['idMin'];\n $idBig = $imgPrev['idBig'];\n $thumbnail = $imgPrev['path'];\n $_SESSION['tabImg'][$idMin]['idMin'] = $idMin;\n $_SESSION['tabImg'][$idMin]['idBig'] = $idBig;\n return $this->json(200, [\n \"thumbnail\" => $thumbnail,\n \"idMin\" => $idMin\n ]);\n }\n return $this->json(400);\n }", "function grabUserProfilePicture()\n{\n\n $con = connectToDatabase();\n\n $sql = \"SELECT profilephoto FROM users WHERE User_id = \" . $_SESSION['User_id'];\n\n $result = mysqli_query($con, $sql);\n\n $profilePhoto = mysqli_fetch_assoc($result);\n\n $profilePhoto = $profilePhoto['profilephoto'];\n\n // Close the connection to the database\n\n mysqli_close($con);\n\n\n\n if (!empty($profilePhoto)) {\n\n $arr = explode(\"/\", $profilePhoto);\n\n $uuid = $arr[0];\n $name = $arr[1];\n\n $thumbnailUrl = \"../vendor/fineuploader/php-traditional-server/files/\" .$uuid. \"/\" .$name;\n\n $post_data = json_encode([array('name' => $name, 'uuid'=>$uuid,'thumbnailUrl'=>$thumbnailUrl)]);\n\n return $post_data;\n\n } else {\n\n return json_encode([array('name' => null, 'uuid'=>null,'thumbnailUrl'=>null)]);\n }\n}", "private function _handle_uploaded_image(){\n\t\t\n \t\tglobal $mySession; \n\t\t\n\t\t$uploaded_image_names = array();\n\t \n\t\t$adapter = new Zend_File_Transfer_Adapter_Http();\n\t\n\t\t$files = $adapter->getFileInfo();\n \t\t \n\t\t$uploaded_image_names = array();\n\t\t\n\t\t$new_name = false; \n\t\t \n \t\t/*prd($adapter);*/\n\t\tforeach ($files as $file => $info) { /* Begin Foreach for handle multiple images */\n\t\t\n \t\t\t$name_old = $adapter->getFileName($file);\n\t\t\t\n\t\t\tif(empty($name_old)){\n\t\t\t\tcontinue ;\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$file_title = $adapter->getFileInfo($file);\n\t\t\t\n\t\t\t$file_title = $file_title[$file]['name']; \n\t\t\t\t\n \t\t\t$uploaded_image_extension = getFileExtension($name_old);\n\t\t\t\n \t\t\t$file_title = str_replace(\".\".$uploaded_image_extension,\"\",$file_title);\n\t\t\t\n\t\t\t$file_title = formatImageName($file_title);\n \n \t\t\t$new_name = $file_title.\"-\".time().\"-\".rand(1,100000).\".\".$uploaded_image_extension;\n \t\t\t\n \t\t\t$adapter->addFilter('Rename',array('target' => SLIDER_IMAGES_PATH.\"/\".$new_name));\n\t\t\n\t\t\ttry{\n\t\t\t\t$adapter->receive($file);\n\t\t\t}\n\t\t\tcatch(Zend_Exception $e){\n\t\t\t\treturn (object) array('success'=>false,\"error\"=>true,'exception'=>true,'message'=>$e->getMessage(),'exception_code'=>$e->getCode()) ;\n\t\t\t}\n\t\t\t\n\t\t\t$thumb_config = array(\"source_path\"=>SLIDER_IMAGES_PATH,\"name\"=> $new_name);\n\t\t\tApplication_Plugin_ImageCrop :: uploadThumb(array_merge($thumb_config,array(\"destination_path\"=>SLIDER_IMAGES_PATH.\"/300\",\"size\"=>300)));\n\t\t\t\t \n \t\t\t//$uploaded_image_names[]=array('media_path'=>$new_name); => For Multiple Images\n \t\t\n\t\t}/* End Foreach Loop for all images */\n\t\t\n\t\t\n\t\treturn (object)array(\"success\"=>true,'error'=>false,\"message\"=>\"Image(s) Successfully Uploaded\",\"media_path\"=>$new_name) ;\n \t\t\n \t \n \t}", "function image_record() {\n\t\t$picIMEI = $_POST['picIMEI'];\n\t\t$time_stamp = $_POST['time_stamp'];\n\t\t$piclat = $_POST['piclat'];\n\t\t$piclon = $_POST['piclon'];\n\t\t$image_name = $_POST['image_name'];\n\t\t$accel_x = $_POST['accel_x'];\n\t\t$accel_y = $_POST['accel_y'];\n\t\t$accel_z = $_POST['accel_z'];\n\n\t\t$insert = $this -> conn -> insertnewrecords('image_record', 'imei_number, reading_timesamp,lat,log,accel_x,accel_y,accel_z,image_filename', '\"' . $picIMEI . '\",\"' . $time_stamp . '\",\"' . $piclat . '\",\"' . $piclon . '\",\"' . $accel_x . '\",\"' . $accel_y . '\",\"' . $accel_z . '\",\"' . $image_name . '\"');\n\t\tif (!empty($insert)) {\n\t\t\t$post = array('status' => \"true\", \"message\" => \"Thanks for your feedback\");\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"error\");\n\t\t}\n\n\t\techo $this -> json($post);\n\t}", "public function saveimageAction()\n {\n $response = $this->getResponse();\n\n $userid= $this->params()->fromPost('userid');\n $createdTime= $this->params()->fromPost('createdtime');\n $imageType = $this->params()->fromPost('imagetype');\n $imageType = substr($imageType, -3, 3);\n $AVAorCOV = $this->params()->fromPost('albumtype');\n\n $documentService = $this->getDocumentService();\n\n $successModel = new SuccessModel();\n $result = $successModel->saveNewImageAvatar($userid, $createdTime,$documentService, $imageType, $AVAorCOV );\n\n if($result)\n {\n return $response->setContent(\\Zend\\Json\\Json::encode(array(\n 'success' => 1,\n )));\n }\n else\n {\n return $response->setContent(\\Zend\\Json\\Json::encode(array(\n 'success' => 0,\n )));\n }\n }", "public function image()\n {\n header('Content-Type:', 'image/jpeg');\n // checks Image for UPLOAD\n $image = $_FILES['image']['name'];\n $tempImage = $_FILES['image']['tmp_name'];\n \n if(!empty($image))\n {\n // $img_size = $_FILES['image']['size'];\n $upload = move_uploaded_file($tempImage,'uploads/images/'.$image);\n \n // prepare array of user data\n $dataImage = array\n (\n 'complaint_type_id' => $this->input->post('complaint_type_id'),\n 'signup_id' => $this->input->post('signup_id'),\n 'complaints_status_id'=> 2,\n 'latitude' => $this->input->post('latitude'),\n 'longitude' => $this->input->post('longitude'),\n 'description' => $this->input->post('description'),\n 'image' => $image,\n 'dated' => date('Y-m-d')\n );\n //print_r($dataImage);die;\n $insert = $this->Complaintsmodel->InsertDB($dataImage);\n $lastId = $this->db->insert_id();\n if($insert)\n {\n $Response = array('message' => 'Complaint is done!', 'status' => true, 'data'=>$lastId); \n echo json_encode($Response);\n }\n else\n {\n $Response = array('message' => 'Sorry, Try again!', 'status' => false);\n echo json_encode($Response);\n }\n }\n else\n {\n //$image = '';\n $Response = array('message' => 'Choose an image to upload', 'status' => false);\n echo json_encode($Response);\n } \n }", "function image_record(){\n\t\t\t$picIMEI=$_POST['picIMEI'];\n\t\t\t$time_stamp=$_POST['time_stamp'];\n\t\t\t$piclat=$_POST['piclat'];\n\t\t\t$piclon=$_POST['piclon'];\n\t\t\t$image_name=$_POST['image_name'];\n\t\t\t$accel_x=$_POST['accel_x'];\n\t\t\t$accel_y=$_POST['accel_y'];\n\t\t\t$accel_z=$_POST['accel_z'];\n\t\t\n\t\t\t\t$insert = $this -> conn -> insertnewrecords('image_record','imei_number, reading_timesamp,lat,log,accel_x,accel_y,accel_z,image_filename', '\"' . $picIMEI . '\",\"' . $time_stamp . '\",\"' . $piclat . '\",\"' . $piclon . '\",\"' . $accel_x . '\",\"' . $accel_y . '\",\"' . $accel_z . '\",\"' . $image_name . '\"');\n\t\t\t\tif(!empty($insert)){\n\t\t\t\t\t$post = array('status' => \"true\",\"message\" => \"Thanks for your feedback\");\n\t\t\t\t}else{\n\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"error\");\n\t\t\t\t}\n\t\t\t\n\t\t\techo $this -> json($post);\n\t\t}", "function getImageId();", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'qualification');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->assign('code', $ret['data']);\n\t\t$this->assign('msg', $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function upload_image(){\n\n // user user-id from session\n $encodedkey = $this->session->userdata('PariKey_session');\n $user_id='';\n $key=base64_decode($encodedkey);\n $keyarr=explode('|', $key);\n //session key format is $keyarr[0]=PARInaayKEY|$keyarr[1]=email_id|$keyarr[2]=user_id\n // print_r($_POST);die();\n extract($_FILES);\n extract($_POST);\n \n $data = $_POST;\n $filepath = '';\n\n // check image count\n $imgCount = $this->user_model->checkImageCount($keyarr[2]);\n if (!$imgCount) { //for prod images\n $response=array(\n 'status' => 'validation',\n 'message' => '<b>Warning:</b> You are allowed to upload only <b>3 Images</b> in Gallery!',\n 'field' => 'selected_image'\n );\n echo json_encode($response);\n die();\n }\n\n $file_name = $_FILES['selected_image']['name'];\n if (!empty(($_FILES['selected_image']['name']))) {\n //file validating---------------------------//\n if ($_FILES['selected_image']['size'] > 10485760) { //for prod images\n $response=array(\n 'status' => 'validation',\n 'message' => '<b>Warning:</b> Image size exceeds size limit of 10MB. Upload image file having size less than 10MB!',\n 'field' => 'selected_image'\n );\n echo json_encode($response);\n die();\n }\n\n $extension = pathinfo($_FILES['selected_image']['name'], PATHINFO_EXTENSION);\n $_FILES['userFile']['name'] = $img_title.'_0'.$keyarr[2].'_'.time().'.'.$extension;\n $_FILES['userFile']['type'] = $_FILES['selected_image']['type'];\n $_FILES['userFile']['tmp_name'] = $_FILES['selected_image']['tmp_name'];\n $_FILES['userFile']['error'] = $_FILES['selected_image']['error'];\n $_FILES['userFile']['size'] = $_FILES['selected_image']['size'];\n\n $uploadPath = 'assets/users/gallery/'; //upload images in images/desktop/ folder\n\n $config['upload_path'] = $uploadPath;\n $config['overwrite'] = TRUE;\n $config['allowed_types'] = 'gif|jpg|png'; //allowed types of files\n $this->load->library('upload', $config); //load upload file config.\n $this->upload->initialize($config);\n // print_r($config);die();\n $image_path = '';\n\n if ($this->upload->do_upload('userFile')) {\n $fileData = $this->upload->data();\n $filepath = 'assets/users/gallery/'.$fileData['file_name'];\n }\n else{\n $response=array(\n 'status' => 'validation',\n 'message' => $this->upload->display_errors('<p><b>Image upload Error: </b>', '</p>'),\n 'field' => 'selected_image'\n );\n echo json_encode($response);\n die();\n }\n // print_r($filepath);die();\n }\n\n $data['filepath'] = $filepath;\n if($filepath==''){\n $response=array(\n 'status' => 'validation',\n 'message' => '<b>Warning:</b> Image file not uploaded Successfully!',\n 'field' => 'document_file'\n );\n echo json_encode($response);\n die();\n}\n$result = $this->user_model->upload_image($data,$keyarr[2]);\n\nif($result){\n $response=array(\n 'status' => 'success',\n 'message' => '<b>Success:</b> You Have Successfully uploaded <b>'.$img_title.'</b> Image!'\n );\n}\nelse{\n $response=array(\n 'status' => 'error',\n 'message' => '<b>Error:</b> <b>'.$img_title.'</b> Image was not uploaded Successfully!'\n );\n} \necho json_encode($response);\n}", "function ajax_process_image() {\r\n\t\tif ( !current_user_can( 'manage_options' ) )\r\n\t\t\tdie('-1');\r\n\t\t$id = (int) $_REQUEST['id'];\r\n\t\tif ( empty($id) )\r\n\t\t\tdie('-1');\r\n\t\t$fullsizepath = get_attached_file( $id );\r\n\t\tif ( false === $fullsizepath || !file_exists($fullsizepath) )\r\n\t\t\tdie('-1');\r\n\t\tset_time_limit( 60 );\r\n\t\tif ( wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $fullsizepath ) ) )\r\n\t\t\tdie('1');\r\n\t\telse\r\n\t\t\tdie('-1');\r\n\t}", "public static function profileImageUpload($id) {\n global $lC_Database;\n \n require_once('includes/classes/ajax_upload.php');\n\n // list of valid extensions, ex. array(\"jpeg\", \"jpg\", \"gif\")\n $allowedExtensions = array('gif', 'jpg', 'jpeg', 'png');\n // max file size in bytes\n $sizeLimit = 10 * 1024 * 1024;\n\n $uploader = new qqFileUploader($allowedExtensions, $sizeLimit);\n \n $profile_image = $uploader->handleUpload('images/avatar/');\n \n /*$Qcheck = $lC_Database->query('select user_name from :table_administrators where id = ' . (int)$id);\n $Qcheck->bindTable(':table_administrators', TABLE_ADMINISTRATORS);\n $Qcheck->execute();\n \n if ($Qcheck->numberOfRows() > 0) { \n if (isset($profile_image['filename']) && $profile_image['filename'] != null) {\n $lC_Database->startTransaction();\n $Qimage = $lC_Database->query('update :table_administrators set image = \"' . $profile_image['pathinfo']['basename'] . '\" where id = ' . (int)$id);\n $Qimage->bindTable(':table_administrators', TABLE_ADMINISTRATORS);\n $Qimage->bindValue(':image', $profile_image['pathinfo']['basename']);\n $Qimage->execute();\n }\n } */\n \n $result = array('result' => 1,\n 'success' => true,\n 'rpcStatus' => RPC_STATUS_SUCCESS,\n 'filename' => $profile_image['pathinfo']['basename']);\n\n return $result;\n }", "function media_upload_image()\n {\n }", "public function save_card_photo($image_id = NULL) {\n \t$rawJson = file_get_contents(\"php://input\");\n \t$photo = json_decode($rawJson,true);\n \t$data['success'] = $this->photo_model->save_photo($photo);\n \t\n \t$card_id = intval($photo['card_id']);\n \t$data['photos'] = $this->photo_model->get_card_photos($card_id);\n \t\n \theader('Content-Type: application/json');\n \techo json_encode(array('item' => $data['photos'],'success' => $data['success']));\n }" ]
[ "0.6914485", "0.65540594", "0.64273363", "0.633404", "0.62768304", "0.62700474", "0.6246787", "0.6237996", "0.6179238", "0.6125587", "0.61215407", "0.60871947", "0.6084634", "0.6075415", "0.60514855", "0.6032719", "0.6007915", "0.6007191", "0.5999424", "0.5979448", "0.59611624", "0.59583765", "0.5945901", "0.5927944", "0.59165245", "0.59160644", "0.5908076", "0.59061956", "0.59048194", "0.59042823" ]
0.67073905
1
Filter the HTML script tag of `fontawesome` script to add `defer` attribute.
function add_defer_attribute( $tag, $handle ) { if ( 'font-awesome' === $handle ) { $tag = str_replace( ' src', ' defer src', $tag ); } return $tag; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filter_script_loader_tag( $tag, $handle ) {\n foreach ( [ 'async', 'defer' ] as $attr ) {\n if ( ! wp_scripts()->get_data( $handle, $attr ) ) {\n continue;\n }\n // Prevent adding attribute when already added in #12009.\n if ( ! preg_match( \":\\s$attr(=|>|\\s):\", $tag ) ) {\n $tag = preg_replace( ':(?=></script>):', \" $attr\", $tag, 1 );\n }\n // Only allow async or defer, not both.\n break;\n }\n return $tag;\n}", "function ic_add_scripts_attribute( $tag, $handle ) {\n\t$handles = array(\n\t\t'main_scripts',\n\t);\n\tforeach( $handles as $defer_script) :\n\t\tif ( $defer_script === $handle ) {\n\t\t\treturn str_replace( ' src', ' defer rel=\"preload\" as=\"script\" src', $tag );\n\t\t}\n\tendforeach;\n\treturn $tag;\n}", "function wsds_defer_scripts( $tag, $handle, $src ) {\n $defer_scripts = array( \n 'autocompletejs',\n 'admin-bar',\n 'ala_custom_js',\n 'jquery-migrate',\n 'child-pages-shortcode',\n );\n\n if ( in_array( $handle, $defer_scripts ) ) {\n return '<script src=\"' . $src . '\" defer=\"defer\" type=\"text/javascript\"></script>' . \"\\n\";\n }\n \n return $tag;\n}", "public static function add_defer_attribute($tag, $handle) {\n $scripts_to_defer = array( \n 'tether-js',\n //'vue-js',\n 'bootstrap-js',\n 'jquery-ui-js'\n );\n \n foreach($scripts_to_defer as $defer_script) {\n if ($defer_script === $handle) {\n return str_replace(' src', ' defer=\"defer\" src', $tag);\n }\n }\n return $tag;\n }", "function defer_js_async($tag){\n\t\n\t// list of scripts to defer\n $scripts_to_defer = array('');\n\n\t// list of scripts to async\n\t$scripts_to_async = array('/src/js/nav.js', 'https://fonts.googleapis.com/css?family=Julius+Sans+One', 'https://fonts.googleapis.com/css?family=Raleway');\n\t \n\t// defer scripts\n\tforeach($scripts_to_defer as $defer_script){\n\t\tif(true == strpos($tag, $defer_script ) )\n\t\treturn str_replace( ' src', ' defer=\"defer\" src', $tag );\t\n\t}\n\n\t// async scripts\n\tforeach($scripts_to_async as $async_script){\n\t\tif(true == strpos($tag, $async_script ) )\n\t\treturn str_replace( ' src', ' async=\"async\" src', $tag );\t\n\t}\n\treturn $tag;\n\t}", "function add_asyncdefer_attribute($tag, $handle) {\n if (strpos($handle, 'async') !== false) {\n // return the tag with the async attribute\n return str_replace( '<script ', '<script async ', $tag );\n }\n // if the unique handle/name of the registered script has 'defer' in it\n else if (strpos($handle, 'defer') !== false) {\n // return the tag with the defer attribute\n return str_replace( '<script ', '<script defer ', $tag );\n }\n // otherwise skip\n else {\n return $tag;\n }\n }", "function script_loader_tag( $tag, $handle ) {\n\t$script_execution = wp_scripts()->get_data( $handle, 'script_execution' );\n\n\tif ( ! $script_execution ) {\n\t\treturn $tag;\n\t}\n\n\tif ( 'async' !== $script_execution && 'defer' !== $script_execution ) {\n\t\treturn $tag;\n\t}\n\n\t// Abort adding async/defer for scripts that have this script as a dependency. _doing_it_wrong()?\n\tforeach ( wp_scripts()->registered as $script ) {\n\t\tif ( in_array( $handle, $script->deps, true ) ) {\n\t\t\treturn $tag;\n\t\t}\n\t}\n\n\t// Add the attribute if it hasn't already been added.\n\tif ( ! preg_match( \":\\s$script_execution(=|>|\\s):\", $tag ) ) {\n\t\t$tag = preg_replace( ':(?=></script>):', \" $script_execution\", $tag, 1 );\n\t}\n\n\treturn $tag;\n}", "function fa_load_script( $script, $dependency = array( 'jquery' ) ){\t\n\t\n\tif( defined('FA_SCRIPT_DEBUG') && FA_SCRIPT_DEBUG ){\n\t\t$script .= '.dev';\n\t}\n\t\n\t$url = fa_get_uri( 'assets/front/js/' . $script . '.js' );\n\twp_enqueue_script(\n\t\t'fa-script-' . $script,\n\t\t$url,\n\t\t$dependency,\n\t\tfalse\t\t\n\t);\t\n\treturn 'fa-script-' . $script;\n}", "function maybe_enqueue_font_awesome( $field )\n\t{\n\t\tif( 'font-awesome' == $field['type'] && $field['enqueue_fa'] ) {\n\t\t\tadd_action( 'wp_footer', array( $this, 'frontend_enqueue_scripts' ) );\n\t\t}\n\n\t\treturn $field;\n\t}", "function profbud_script_loader_tag( $tag, $handle ) {\r\n\t$scripts_to_load = array(\r\n\t\tarray(\r\n\t\t\t( 'name' ) => 'jquery',\r\n\t\t\t( 'integrity' ) => 'sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=',\r\n\t\t)\r\n\t);\r\n\t$key = array_search( $handle, array_column( $scripts_to_load, 'name' ) );\r\n\tif ( $key !== false ) {\r\n\t\t$tag = str_replace( '></script>', ' integrity=\\'' . $scripts_to_load[$key]['integrity'] . '\\' crossorigin=\\'anonymous\\'></script>', $tag );\r\n\t}\r\n\treturn $tag;\r\n}", "function addJS($src, $async, $defer){\n echo '<script src=\"'. $src .'\"'. ($async? \" async\":\"\") . ($defer? \" defer\":\"\") .'> </script>';\n}", "public function add_script_tag_attributes($tag, $handle) {\n switch ($handle) {\n // adding async to main js bundle\n // for defer, replace async=\"async\" with defer=\"defer\"\n case ('pan_bootstrap_scripts'):\n return str_replace( ' src', ' async=\"async\" src', $tag );\n break;\n\n // example adding CDN integrity and crossorigin attributes\n // Note: popper.js is loaded into the main.bundle.js from npm\n // This is just an example\n case ('popper-js'):\n return str_replace( ' min.js', 'min.js\" integrity=\"sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q\" crossorigin=\"anonymous\"', $tag );\n break;\n\n // example adding CDN integrity and crossorigin attributes\n // Note: bootstrap.js is loaded into the main.bundle.js from npm\n // This is just an example\n case ('bootstrap-js'):\n return str_replace( ' min.js', 'min.js\" integrity=\"sha384-a5N7Y/aK3qNeh15eJKGWxsqtnX/wWdSZSKp+81YjTmS15nvnvxKHuzaWwXHDli+4\" crossorigin=\"anonymous\"', $tag );\n break;\n\n default:\n return $tag;\n\n } // /switch\n }", "function font_awesome()\n{\n wp_enqueue_style(\"font_awesome\", \"//use.fontawesome.com/releases/v5.6.3/css/all.css\");\n}", "public function testAttributes() {\n $build['#attached']['library'][] = 'common_test/js-attributes';\n $assets = AttachedAssets::createFromRenderArray($build);\n\n $js = $this->assetResolver->getJsAssets($assets, FALSE)[1];\n $js_render_array = \\Drupal::service('asset.js.collection_renderer')->render($js);\n $rendered_js = $this->renderer->renderPlain($js_render_array);\n $expected_1 = '<script src=\"http://example.com/deferred-external.js\" foo=\"bar\" defer></script>';\n $expected_2 = '<script src=\"' . $this->fileUrlGenerator->generateString('core/modules/system/tests/modules/common_test/deferred-internal.js') . '?v=1\" defer bar=\"foo\"></script>';\n $this->assertStringContainsString($expected_1, $rendered_js, 'Rendered external JavaScript with correct defer and random attributes.');\n $this->assertStringContainsString($expected_2, $rendered_js, 'Rendered internal JavaScript with correct defer and random attributes.');\n }", "function add_extra_attributes_to_enqueued_js( $tag, $handle ) {\n\n\t$search = '></script>';\n\n\tif ( 'jquery' === $handle ) {\n\t\treturn str_replace( $search, \" integrity='sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj' crossorigin='anonymous'\" . $search, $tag );\n\t}\n\n\tif ( 'bootstrap-bundle' === $handle ) {\n\t\treturn str_replace( $search, \" integrity='sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx' crossorigin='anonymous'\" . $search, $tag );\n\t}\n\n\tif ( 'font-awesome' === $handle ) {\n\t\treturn str_replace( $search, \" integrity='sha512-UwcC/iaz5ziHX7V6LjSKaXgCuRRqbTp1QHpbOJ4l1nw2/boCfZ2KlFIqBUA/uRVF0onbREnY9do8rM/uT/ilqw==' crossorigin='anonymous'\" . $search, $tag );\n\t}\n\n\treturn $tag;\n\n}", "public function enqueue_font_awesome() {\n\t\tglobal $hestia_load_fa;\n\n\t\tif ( $hestia_load_fa !== true ) {\n\t\t\treturn false;\n\t\t}\n\n\t\twp_enqueue_style( 'font-awesome-5-all', get_template_directory_uri() . '/assets/font-awesome/css/all.min.css', array(), HESTIA_VENDOR_VERSION );\n\t\tif ( $this->should_load_shim() ) {\n\t\t\twp_enqueue_style( 'font-awesome-4-shim', get_template_directory_uri() . '/assets/font-awesome/css/v4-shims.min.css', array(), HESTIA_VENDOR_VERSION );\n\t\t}\n\n\t\treturn true;\n\t}", "function register_scripts_admin() {\n\twp_enqueue_style('font-awesome', 'http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css');\n}", "static public function deregister_scripts() {\n wp_dequeue_script( 'filterable-portfolio' );\n wp_deregister_script( 'filterable-portfolio' );\n }", "function demo_plugin_font_awesome() {\n\t\twp_enqueue_style( 'load-fa', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css' );\n\t\twp_enqueue_style( 'load-select2-css', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.4/css/select2.min.css' );\n\t\twp_enqueue_script( 'load-select2-js', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.4/js/select2.min.js' );\n\t\twp_enqueue_style( 'load-datatables-css', 'https://cdn.datatables.net/1.10.16/css/jquery.dataTables.css' );\n\t\twp_enqueue_script( 'load-datatables-js', 'https://cdn.datatables.net/1.10.16/js/jquery.dataTables.js' );\n\t\twp_enqueue_script( 'load-datepicker-js', 'https://code.jquery.com/ui/1.12.1/jquery-ui.js' );\n\t\twp_enqueue_style( 'load-datepicker-css', 'https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css' );\n\t}", "function theme_add_bootstrap_fontawesome() {\n\twp_enqueue_style( 'bootstrap-css', get_stylesheet_directory_uri() . '/css/bootstrap.min.css' );\n\twp_enqueue_style( 'style-css', get_stylesheet_directory_uri() . '/style.css' );\n\twp_enqueue_style( 'fontawesome-css', get_stylesheet_directory_uri() . '/css/font-awesome.min.css' );\n\twp_enqueue_script( 'bootstrap-js', get_stylesheet_directory_uri() . '/js/bootstrap.min.js', array(), '3.0.0', true );\n}", "function pagely_load_font_awesome() {\n\t\n\twp_enqueue_style( 'font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css', false, false, false ); \n}", "function defer_parsing_of_js( $url ) {\r\n if ( is_user_logged_in() ) return $url; //don't break WP Admin\r\n if ( FALSE === strpos( $url, '.js' ) ) return $url;\r\n if ( strpos( $url, 'jquery.js' ) ) return $url;\r\n return str_replace( ' src', ' defer src', $url );\r\n}", "public function input_admin_enqueue_scripts() {\n\t\t// Min version ?\n\t\t$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG === true ? '' : '.min';\n\n\t\twp_localize_script( 'acf-input-svg-icon', 'svg_icon_format_data', $this->parse_svg() );\n\t\twp_register_style( 'acf-input-svg-icon', ACF_SVG_ICON_URL . 'assets/css/style' . $suffix . '.css', array( 'select2' ), ACF_SVG_ICON_VER );\n\n\t\twp_enqueue_script( 'acf-input-svg-icon' );\n\t\twp_enqueue_style( 'acf-input-svg-icon' );\n\t}", "public function loadAssets()\n {\n add_action('admin_enqueue_scripts', [$this, 'enqueueAdminAssets']);\n add_filter('script_loader_tag', [$this, 'addAssetAttribute'], 10, 3);\n }", "public function getScriptAttributes() {\n\t\treturn ' ' . trim( preg_replace( '/\\s+/', ' ', apply_filters( 'aioseo_ga_attributes', '' ) ) );\n\t}", "function harvest_deregister_scripts() {\n\tglobal $wp_query, $post;\n\t\n\tif( ! ( strpos( json_encode( $wp_query ), '[contact-form-7' ) || strpos( json_encode( $post ), '[contact-form-7' ) ) ) {\n\t\t\twp_deregister_script( 'contact-form-7' );\n\t\t\twp_deregister_style( 'contact-form-7' );\n\t}\n\n}", "public function scripts_styles_footer() {\n\t\tif ( is_admin() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$theme_url = get_template_directory_uri();\n\t\t$fa_ver = '4.7.0';\n\t\t$fa_url = \"//maxcdn.bootstrapcdn.com/font-awesome/$fa_ver/css/font-awesome.min.css\";\n\t\t$main_js_url = $theme_url . '/js/main.min.js';\n\t\t$main_js_path = get_template_directory() . '/js/main.min.js';\n\t\t$main_js_ver = file_exists( $main_js_path ) ? filemtime( $main_js_path ) : '';\n\n\t\twp_enqueue_style( 'fa-style', $fa_url, null, $fa_ver );\n\t\twp_enqueue_style( 'gfont', 'https://fonts.googleapis.com/css?family=Handlee' );\n\t\twp_enqueue_script( 'superiocity-script', $main_js_url, null, $main_js_ver, true );\n\t}", "public function remove_conflicting_asset_files() {\n\t\t$scripts = array(\n\t\t\t'jetpack-onboarding-vendor', // Jetpack Onboarding Bluehost.\n\t\t);\n\n\t\tif ( ! empty( $scripts ) ) {\n\t\t\tforeach ( $scripts as $script ) {\n\t\t\t\twp_dequeue_script( $script ); // Remove JS file.\n\t\t\t\twp_deregister_script( $script );\n\t\t\t}\n\t\t}\n\t}", "function script_loader_filter ($src) {\n if (FALSE === strpos ($src, 'ajax.googleapis.com')) {\n\treturn $src;\n }\n\n $new_src = explode('?', $src);\n return $new_src[0];\n\n}", "private function prepare_allowed_scripts_regex() {\n\t\t$delay_js_scripts = $this->options->get( 'delay_js_scripts', [] );\n\n\t\t/**\n\t\t * Filters JS files to included into delay JS.\n\t\t *\n\t\t * @since 3.7\n\t\t *\n\t\t * @param array $delay_js_scripts List of allowed JS files.\n\t\t */\n\t\t$delay_js_scripts = (array) apply_filters( 'rocket_delay_js_scripts', $delay_js_scripts );\n\n\t\tif ( empty( $delay_js_scripts ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\tforeach ( $delay_js_scripts as $i => $delay_js_script ) {\n\t\t\t$delay_js_scripts[ $i ] = preg_quote( str_replace( '#', '\\#', $delay_js_script ), '#' );\n\t\t}\n\n\t\treturn implode( '|', $delay_js_scripts );\n\n\t}" ]
[ "0.7237725", "0.6505373", "0.6418179", "0.6246111", "0.59877104", "0.59083897", "0.5795956", "0.5675229", "0.5587274", "0.54035765", "0.53767705", "0.53493905", "0.5349385", "0.5293278", "0.52620023", "0.52599305", "0.5229869", "0.5225538", "0.52089006", "0.5190596", "0.5188605", "0.51255214", "0.50795376", "0.5071968", "0.5063119", "0.50477403", "0.5018843", "0.5018157", "0.50087327", "0.50084317" ]
0.7009983
1
Add support for custom color palettes in Gutenberg.
function tewwie_gutenberg_color_palette() { add_theme_support( 'editor-color-palette', array( array( 'name' => esc_html__( 'Primary', '@@textdomain' ), 'slug' => 'primary', 'color' => 'rgb(94, 114, 228)', ), array( 'name' => esc_html__( 'Secondary', '@@textdomain' ), 'slug' => 'secondary', 'color' => 'rgb(245, 54, 92)', ), array( 'name' => esc_html__( 'Green', '@@textdomain' ), 'slug' => 'green', 'color' => 'rgb(67, 170, 139)', ), array( 'name' => esc_html__( 'Dark Grey', '@@textdomain' ), 'slug' => 'dark-grey', 'color' => 'rgb(68,68,68)', ) ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hotel_lux_gutenberg_support() {\r\n\t$colors = cmsmasters_color_picker_palettes();\r\n\t\r\n\t$color_palette = array();\r\n\t\r\n\t\r\n\tforeach ($colors as $color) {\r\n\t\t$color_palette[] = array(\r\n\t\t\t'color' => $color,\r\n\t\t);\r\n\t}\r\n\t\r\n\t\r\n\tadd_theme_support('editor-color-palette', $color_palette);\r\n}", "function lalita_enqueue_color_palettes() {\n\t\t// Old versions of WP don't get nice things\n\t\tif ( ! function_exists( 'wp_add_inline_script' ) )\n\t\t\treturn;\n\n\t\t// Grab our palette array and turn it into JS\n\t\t$palettes = json_encode( lalita_get_default_color_palettes() );\n\n\t\t// Add our custom palettes\n\t\t// json_encode takes care of escaping\n\t\twp_add_inline_script( 'wp-color-picker', 'jQuery.wp.wpColorPicker.prototype.options.palettes = ' . $palettes . ';' );\n\t}", "function dg_gutenberg_custom_colors() {\n\t\n\t// disable custom colors\n\tadd_theme_support( 'disable-custom-colors' );\n\t\n\t// add custom color palette\n\tadd_theme_support( 'editor-color-palette', array(\n\t\tarray(\n\t\t\t'name' => __( 'Pale Lemon Yellow', 'dehli-grolimund' ),\n\t\t\t'slug' => 'pale-lemon-yellow',\n\t\t\t'color'\t=> '#fceeb2',\n\t\t),\t\n\t\tarray(\n\t\t\t'name' => __( 'Hermosa Pink', 'dehli-grolimund' ),\n\t\t\t'slug' => 'hermosa-pink',\n\t\t\t'color'\t=> '#e6bdc3',\n\t\t),\n\t\tarray(\n\t\t\t'name' => __( 'Coral Red', 'dehli-grolimund' ),\n\t\t\t'slug' => 'coral-red',\n\t\t\t'color'\t=> '#d98c7f',\n\t\t),\n\t\tarray(\n\t\t\t'name' => __( 'Pale Kings Blue', 'dehli-grolimund' ),\n\t\t\t'slug' => 'pale-king-blue',\n\t\t\t'color'\t=> '#aeced7',\n\t\t),\n\t\tarray(\n\t\t\t'name' => __( 'Olympic Blue', 'dehli-grolimund' ),\n\t\t\t'slug' => 'olympic-blue',\n\t\t\t'color'\t=> '#5f769c',\n\t\t),\t\t\n\t\tarray(\n\t\t\t'name' => __( 'Cobalt Green', 'dehli-grolimund' ),\n\t\t\t'slug' => 'cobalt-green',\n\t\t\t'color'\t=> '#9ec7a2',\n\t\t),\t\t\n\t\tarray(\n\t\t\t'name' => __( 'Venice Green', 'dehli-grolimund' ),\n\t\t\t'slug' => 'venice-green',\n\t\t\t'color'\t=> '#7cbbb1',\n\t\t),\n\n\t) );\t\n}", "public function custom_color_variables() {\n\t\tif ( 'd1e4dd' !== strtolower( get_theme_mod( 'background_color', 'D1E4DD' ) ) ) {\n\t\t\twp_add_inline_style( 'twenty-twenty-one-style', $this->generate_custom_color_variables() );\n\t\t}\n\t}", "function fp_setup() {\n\t\n\tadd_theme_support('custom-background', array('default-color' => 'ffffff'));\n\t\n}", "function hello_pro_inline_color_palette() {\n\t$css = '';\n\n\t$appearance = genesis_get_config( 'appearance' );\n\n\t$editor_color_palette = $appearance['editor-color-palette'];\n\n\tforeach ( $editor_color_palette as $color_info ) {\n\n\t\t$css .= sprintf(\n\t\t\t'.site-container .has-%1$s-color,\n\t\t.site-container .wp-block-button .wp-block-button__link.has-%1$s-color,\n\t\t.site-container .wp-block-button.is-style-outline .wp-block-button__link.has-%1$s-color {\n\t\t\tcolor: %2$s;\n\t\t}\n\n\t\t.site-container .has-%1$s-background-color,\n\t\t.site-container .wp-block-button .wp-block-button__link.has-%1$s-background-color,\n\t\t.site-container .wp-block-pullquote.is-style-solid-color.has-%1$s-background-color {\n\t\t\tbackground-color: %2$s;\n\t\t}\n\n\t\t',\n\t\t\t$color_info['slug'],\n\t\t\t$color_info['color']\n\t\t);\n\n\t}\n\n\t// Get Primary Color.\n\t$color_primary = get_theme_mod( 'hello_pro_link_color', $appearance['default-colors']['primary'] );\n\n\t// Get Secondary Color.\n\t$color_secondary = get_theme_mod( 'hello_pro_accent_color', $appearance['default-colors']['secondary'] );\n\n\t// Define Primary Color elements.\n\t$css .= sprintf(\n\t\t'/* PRIMARY COLOR */\n\t\ta,\n\t\t.home-features > .wrap > .widget .textwidget > h3 > span,\n\t\t.social-proof-slider-wrap .testimonial-item .testimonial-text .author .author-name,\n\t\t.entry-header .entry-meta .entry-comments-link a,\n\t\t.footer-widgets a:hover,\n\t\t.footer-widgets a:focus,\n\t\t.genesis-nav-menu a:focus,\n\t\t.genesis-nav-menu a:hover,\n\t\t.genesis-nav-menu .current-menu-item > a,\n\t\t.genesis-nav-menu .sub-menu .current-menu-item > a:focus,\n\t\t.genesis-nav-menu .sub-menu .current-menu-item > a:hover,\n\t\t.genesis-nav-menu .current-menu-parent > a,\n\t\t.menu-toggle:focus,\n\t\t.menu-toggle:hover,\n\t\t.sub-menu-toggle:focus,\n\t\t.sub-menu-toggle:hover,\n\t\ta:hover,\n\t\t.entry-meta a,\n\t\t.entry-meta a:hover,\n\t\t.entry-meta a:focus,\n\t\t.footer-widgets .entry-title a:hover,\n\t\t.site-footer a:hover,\n\t\t.site-footer a:focus,\n\t\t.entry-content .featured-articles button.slick-arrow > span,\n\t\t.entry-content .featured-articles ul.slick-dots li button::before,\n\t\t.entry-content .featured-articles ul.slick-dots li.slick-active button:before {\n\t\t\tcolor: %1$s;\n\t\t}\n\n\t\t.menu-toggle,\n\t\t.archive-pagination li a,\n\t\ta.button,\n\t\tbutton,\n\t\tinput[type=\"button\"],\n\t\tinput[type=\"reset\"],\n\t\tinput[type=\"submit\"],\n\t\t.sidebar .enews-widget input[type=\"submit\"],\n\t\t.sidebar-primary .widget input[type=\"submit\"],\n\t\t.sidebar-primary .widget .button,\n\t\t.wpforms-form button[type=submit] {\n\t\t\tbackground-color: %1$s;\n\t\t\tcolor: %2$s !important;\n\t\t}\n\n\t\t.entry-content .featured-articles .featured-article {\n\t\t\tbackground-color: %1$s !important;\n\t\t}\n\n\t\t.wp-block-button .wp-block-button__link.has-primary-background-color,\n\t\t.ab-block-button > .ab-button,\n\t\t.gb-block-button > .gb-button {\n\t\t\tbackground-color: %1$s !important;\n\t\t\tcolor: %2$s !important;\n\t\t}\n\n\t\t.wp-block-button .wp-block-button__link:not(.has-background) {\n\t\t background-color: %1$s !important;\n\t\t}\n\n\t\t.wp-block-button.is-style-outline .wp-block-button__link:not(.has-background):not(.has-text-color),\n\t\t.wp-block-button.is-style-outline .wp-block-button__link.has-primary-background-color {\n\t\t\tbackground-color: transparent !important;\n\t\t border-color: %1$s !important;\n\t\t\tcolor: %1$s !important;\n\t\t}\n\n\t\t',\n\t\t$color_primary,\n\t\thello_pro_color_contrast( $color_primary )\n\t);\n\n\t// Define Secondary Color elements.\n\t$css .= sprintf(\n\t\t'/* SECONDARY COLOR */\n\t\t.menu-toggle:focus,\n\t\t.menu-toggle:hover,\n\t\t.archive-pagination li a:hover,\n\t\t.archive-pagination li a:focus,\n\t\t.archive-pagination li.active a,\n\t\t.button:hover,\n\t\t.button:focus,\n\t\ta.button:hover,\n\t\ta.button:focus,\n\t\tbutton:not(.slick-arrow):hover,\n\t\tbutton:not(.slick-arrow):focus,\n\t\tbutton:not(id^=\"slick-\"),\n\t\tinput:hover[type=\"button\"],\n\t\tinput:hover[type=\"reset\"],\n\t\tinput:hover[type=\"submit\"],\n\t\tinput:focus[type=\"button\"],\n\t\tinput:focus[type=\"reset\"],\n\t\tinput:focus[type=\"submit\"],\n\t\t.sidebar-primary .widget .button:focus,\n\t\t.sidebar-primary .widget .button:hover,\n\t\t.sidebar .enews-widget input[type=\"submit\"]:focus,\n\t\t.sidebar .enews-widget input[type=\"submit\"]:hover,\n\t\t.wpforms-form button[type=submit]:focus,\n\t\t.wpforms-form button[type=submit]:hover {\n\t\t\tbackground-color: %1$s !important;\n\t\t\tcolor: %2$s !important;\n\t\t}\n\n\t\t.wp-block-button .wp-block-button__link:not(.has-background):hover {\n\t\t background-color: %1$s !important;\n\t\t\tcolor: %2$s !important;\n\t\t}\n\n\t\t.wp-block-button.is-style-outline .wp-block-button__link.has-secondary-background-color {\n\t\t\tbackground-color: transparent !important;\n\t\t border-color: %1$s !important;\n\t\t\tcolor: %1$s !important;\n\t\t}\n\n\t\t.wp-block-button.is-style-outline .wp-block-button__link:focus,\n\t\t.wp-block-button.is-style-outline .wp-block-button__link:hover,\n\t\t.wp-block-button.is-style-outline .wp-block-button__link:not(.has-background):focus,\n\t\t.wp-block-button.is-style-outline .wp-block-button__link:not(.has-background):hover {\n\t\t\tbackground-color: %1$s !important;\n\t\t\tborder-color: %1$s !important;\n\t\t\tcolor: %2$s !important;\n\t\t}',\n\t\t$color_secondary,\n\t\thello_pro_color_contrast( $color_secondary )\n\t);\n\n\treturn $css;\n}", "function dizzy7_gutenberg_features() {\n\t\t\n\n// Theme supports wide images, galleries and videos.\n add_theme_support( 'align-wide' );\n add_theme_support( 'align-full' );\n add_theme_support( 'wide-images' );\n \n add_theme_support(\n\t\t'editor-color-palette', array(\n\t\t\tarray(\n\t\t\t\t'name' => esc_html__( 'Main Color', '@@textdomain' ),\n\t\t\t\t'slug' => 'main-color',\n\t\t\t\t'color' => get_theme_mod( 'diz-theme-main-color'),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => esc_html__( 'Second Color', '@@textdomain' ),\n\t\t\t\t'slug' => 'second-color',\n\t\t\t\t'color' => get_theme_mod( 'diz-theme-second-color'),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => esc_html__( 'Highlight Color', '@@textdomain' ),\n\t\t\t\t'slug' => 'highlight-color',\n\t\t\t\t'color' => get_theme_mod( 'diz-theme-third-color'),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => esc_html__( 'Special Color', '@@textdomain' ),\n\t\t\t\t'slug' => 'special-color',\n\t\t\t\t'color' => get_theme_mod( 'diz-theme-fourth-color'),\n\t\t\t)\n\t\t)\n\t);\n}", "public function colors()\n {\n $section = self::$panel . '_colors';\n\n /**\n * Add Section and fields for Colors\n */\n Customizer::addSection($section, array(\n 'title' => esc_html__('Colors', 'stage'),\n 'description' => esc_html__('Set color settings for your website', 'stage'),\n 'priority' => 60,\n 'panel' => self::$panel,\n ));\n\n // Fields are calculated from ColorsPanel.php\n }", "function wp_register_colors_support($block_type)\n {\n }", "protected function parameterizeColors() : void\n {\n $colors = $this->fetchColorsFromACF();\n $this->injectStyles($colors);\n }", "function register_admin_color_schemes()\n {\n }", "public function editor_custom_color_variables() {\n\t\twp_enqueue_style(\n\t\t\t'twenty-twenty-one-custom-color-overrides',\n\t\t\tget_theme_file_uri( 'assets/css/custom-color-overrides.css' ),\n\t\t\tarray(),\n\t\t\t(string) filemtime( get_theme_file_path( 'assets/css/custom-color-overrides.css' ) )\n\t\t);\n\n\t\t$background_color = get_theme_mod( 'background_color', 'D1E4DD' );\n\t\tif ( 'd1e4dd' !== strtolower( $background_color ) ) {\n\t\t\twp_add_inline_style( 'twenty-twenty-one-custom-color-overrides', $this->generate_custom_color_variables( 'editor' ) );\n\t\t}\n\t}", "function CustomThemeSupport(){\n // coloring\n if(!empty(SELF::$WPgutenberg_ColorPalette)):\n $newColors = array();\n foreach (SELF::$WPgutenberg_ColorPalette as $colorkey => $color) {\n $newColors[] = array(\n 'name' => __( $color[\"key\"], 'WPgutenberg' ),\n 'slug' => prefix_core_BaseFunctions::Slugify($color[\"key\"]),\n 'color'\t=> $color[\"value\"],\n );\n }\n add_theme_support( 'editor-color-palette', $newColors );\n endif;\n // font sizes\n if(!empty(SELF::$WPgutenberg_FontSizes)):\n $newColors = array();\n foreach (SELF::$WPgutenberg_FontSizes as $sizekey => $size) {\n $newColors[] = array(\n 'name' => __( $size[\"key\"], 'WPgutenberg' ),\n 'slug' => prefix_core_BaseFunctions::Slugify($size[\"key\"]),\n 'size'\t=> $size[\"value\"],\n );\n }\n add_theme_support( 'editor-font-sizes', $newColors );\n // disable custom color picker\n if(SELF::$WPgutenberg_ColorPalette_CP == 0):\n add_theme_support( 'disable-custom-colors');\n endif;\n endif;\n // disable default patterns\n if($this->WPgutenberg_DefaultPatterns == 0):\n remove_theme_support( 'core-block-patterns' );\n endif;\n\n }", "function colloquium_theme_setup() {\n add_action('wp_head', 'colloquium_bbpress_custom_color');\n}", "function shell_custom_background(){\r\n\r\n\t\t/* Custom Background */\r\n\t\tadd_theme_support( 'custom-background', array( 'default-color' => 'f9f9f9' ) );\r\n\t}", "function themename_customize_color_register( $wp_customize ) {\n\t$wp_customize->get_setting( 'themename_theme_bgcolor1' )->transport = 'postMessage';\n\t$wp_customize->get_setting( 'themename_header_bgcolor' )->transport = 'postMessage';\n\t$wp_customize->get_setting( 'themename_theme_hovercolor' )->transport = 'postMessage';\n\t$wp_customize->get_setting( 'themename_widget_bgcolor' )->transport = 'postMessage';\n\t$wp_customize->get_setting( 'themename_mainpost_bgcolor' )->transport = 'postMessage';\n\t$wp_customize->get_setting( 'themename_popularpost_bgcolor' )->transport = 'postMessage';\n\t$wp_customize->get_setting( 'themename_a_bgcolor' )->transport = 'postMessage';\n\t$wp_customize->get_setting( 'themename_text_color' )->transport = 'postMessage';\n\t$wp_customize->get_setting( 'themename_readmore_bgcolor' )->transport = 'postMessage';\n}", "public function useColor($name);", "function WPBC_after_setup_theme__customs(){\n\t$defaults = array(\n\t\t'default-color' => 'red',\n\t\t'default-image' => '',\n\t\t'default-repeat' => 'no-repeat',\n\t\t'default-position-x' => 'center',\n\t\t'default-position-y' => 'center',\n\t\t'default-size' => 'cover',\n\t\t'default-attachment' => 'fixed',\n\t\t'wp-head-callback' => '_custom_background_cb',\n\t\t'admin-head-callback' => '',\n\t\t'admin-preview-callback' => ''\n\t);\n\t// add_theme_support( 'custom-background', $defaults );\n\t\n}", "function ux_mce4_options( $init ) {\r\n global $flatsome_opt;\r\n $default_colours = '\r\n \"000000\", \"Black\", \"993300\", \"Burnt orange\", \"333300\", \"Dark olive\", \"003300\", \"Dark green\", \"003366\", \"Dark azure\", \"000080\", \"Navy Blue\", \"333399\", \"Indigo\", \"333333\", \"Very dark gray\", \r\n \"800000\", \"Maroon\", \"FF6600\", \"Orange\", \"808000\", \"Olive\", \"008000\", \"Green\", \"008080\", \"Teal\", \"0000FF\", \"Blue\", \"666699\", \"Grayish blue\", \"808080\", \"Gray\", \r\n \"FF0000\", \"Red\", \"FF9900\", \"Amber\", \"99CC00\", \"Yellow green\", \"339966\", \"Sea green\", \"33CCCC\", \"Turquoise\", \"3366FF\", \"Royal blue\", \"800080\", \"Purple\", \"999999\", \"Medium gray\", \r\n \"FF00FF\", \"Magenta\", \"FFCC00\", \"Gold\", \"FFFF00\", \"Yellow\", \"00FF00\", \"Lime\", \"00FFFF\", \"Aqua\", \"00CCFF\", \"Sky blue\", \"993366\", \"Brown\", \"C0C0C0\", \"Silver\", \r\n \"FF99CC\", \"Pink\", \"FFCC99\", \"Peach\", \"FFFF99\", \"Light yellow\", \"CCFFCC\", \"Pale green\", \"CCFFFF\", \"Pale cyan\", \"99CCFF\", \"Light sky blue\", \"CC99FF\", \"Plum\", \"FFFFFF\", \"White\"\r\n ';\r\n $custom_colours = '\r\n \"e14d43\", \"Primary Color\", \"d83131\", \"Color 2 Name\", \"ed1c24\", \"Color 3 Name\", \"f99b1c\", \"Color 4 Name\", \"50b848\", \"Color 5 Name\", \"00a859\", \"Color 6 Name\", \"00aae7\", \"Color 7 Name\", \"282828\", \"Color 8 Name\"\r\n ';\r\n $init['textcolor_map'] = '['.$custom_colours.','.$default_colours.']';\r\n return $init;\r\n }", "function wp_apply_colors_support($block_type, $block_attributes)\n {\n }", "protected function parsePalettes(ContainerInterface $container)\n {\n $palettesDca = $this->getFromDca('palettes');\n\n // Skip while there is no extended palette definition.\n if (!is_callable($palettesDca)) {\n return;\n }\n\n if ($container->hasDefinition(PalettesDefinitionInterface::NAME)) {\n $palettesDefinition = $container->getDefinition(PalettesDefinitionInterface::NAME);\n } else {\n $palettesDefinition = new DefaultPalettesDefinition();\n $container->setDefinition(PalettesDefinitionInterface::NAME, $palettesDefinition);\n }\n\n call_user_func($palettesDca, $palettesDefinition, $container);\n }", "public function changeEditorColorPalette(): void\n\t{\n\t\t// Unable to use state due to this method is used in JS and store is not registered there.\n\t\t$colors = $this->getSettingsManifest()['globalVariables']['colors'] ?? [];\n\n\t\tif ($colors) {\n\t\t\t\\add_theme_support('editor-color-palette', $colors);\n\t\t}\n\t}", "public function tcb_get_palettes_from_config() {\n\t\treturn ! empty( $this->skin_palettes_config['palette'] ) ? $this->skin_palettes_config['palette'] : [];\n\t}", "function alt_add_color_scheme()\n {\n wp_admin_css_color(\n 'alt-design',\n __('Alt Design', 'alt-design-color-scheme'),\n get_template_directory_uri() . '/lib/alt-admin/css/admin-color-scheme.css',\n array('#25282b', '#363b3f', '#ff6600', '#ff6600')\n );\n }", "function techfak_color_schemes() {\n\t$color_scheme_options = array(\n\t\t'blau' => array(\n\t\t\t'value' => 'blau',\n\t\t\t'label' => __( 'Blue', '_rrze' ),\n\t\t\t'thumbnail' => get_template_directory_uri() . '/includes/images/color-scheme-blau.png',\n\t\t),\n\t\t'graublau' => array(\n\t\t\t'value' => 'graublau',\n\t\t\t'label' => __( 'Blue-grey', '_rrze' ),\n\t\t\t'thumbnail' => get_template_directory_uri() . '/includes/images/color-scheme-graublau.png',\n\t\t),\n\t\t'karibikgruen' => array(\n\t\t\t'value' => 'karibikgruen',\n\t\t\t'label' => __( 'Caribic-green', '_rrze' ),\n\t\t\t'thumbnail' => get_template_directory_uri() . '/includes/images/color-scheme-karibikgruen.png',\n\t\t),\n\t\t'gruen' => array(\n\t\t\t'value' => 'gruen',\n\t\t\t'label' => __( 'Green', '_rrze' ),\n\t\t\t'thumbnail' => get_template_directory_uri() . '/includes/images/color-scheme-gruen.png',\n\t\t),\n\t\t'hellblau' => array(\n\t\t\t'value' => 'hellblau',\n\t\t\t'label' => __( 'Light-blue', '_rrze' ),\n\t\t\t'thumbnail' => get_template_directory_uri() . '/includes/images/color-scheme-hellblau.png',\n\t\t),\n\t\t'orange' => array(\n\t\t\t'value' => 'orange',\n\t\t\t'label' => __( 'Orange', '_rrze' ),\n\t\t\t'thumbnail' => get_template_directory_uri() . '/includes/images/color-scheme-orange.png',\n\t\t),\n\t\t'rot' => array(\n\t\t\t'value' => 'rot',\n\t\t\t'label' => __( 'Red', '_rrze' ),\n\t\t\t'thumbnail' => get_template_directory_uri() . '/includes/images/color-scheme-rot.png',\n\t\t),\n\t\t'gelb' => array(\n\t\t\t'value' => 'gelb',\n\t\t\t'label' => __( 'Yellow', '_rrze' ),\n\t\t\t'thumbnail' => get_template_directory_uri() . '/includes/images/color-scheme-gelb.png',\n\t\t),\n\n\t);\n\n\treturn apply_filters( 'techfak_color_schemes', $color_scheme_options );\n}", "function capezzahill_colors_css_wrap() {\r\n\t// Only include custom colors in customizer or frontend.\r\n\tif ( ( ! is_customize_preview() && 'default' === get_theme_mod( 'primary_color', 'default' ) ) || is_admin() ) {\r\n\t\treturn;\r\n\t}\r\n\trequire_once get_parent_theme_file_path( '/inc/color-patterns.php' );\r\n\t$primary_color = 199;\r\n\tif ( 'default' !== get_theme_mod( 'primary_color', 'default' ) ) {\r\n\t\t$primary_color = get_theme_mod( 'primary_color_hue', 199 );\r\n\t}\r\n\t?>\r\n\r\n\t<style type=\"text/css\" id=\"custom-theme-colors\" <?php echo is_customize_preview() ? 'data-hue=\"' . absint( $primary_color ) . '\"' : ''; ?>>\r\n\t\t<?php echo capezzahill_custom_colors_css(); ?>\r\n\t</style>\r\n\t<?php\r\n}", "function land_theme_customizer( $wp_customize ){\r\n\r\n $wp_customize->add_setting(\r\n 'primary_color',\r\n array(\r\n 'default' => '#ff5c36'\r\n )\r\n );\r\n $wp_customize->add_control(\r\n new WP_Customize_Color_Control(\r\n $wp_customize,\r\n 'primary_color',\r\n array(\r\n 'label' => __('Primary color', 'land'),\r\n 'section' => 'colors',\r\n 'priority' => 9\r\n )\r\n )\r\n );\r\n\r\n $wp_customize->add_setting(\r\n 'header_bg_color',\r\n array(\r\n 'default' => '#f5f5f5'\r\n )\r\n );\r\n $wp_customize->add_control(\r\n new WP_Customize_Color_Control(\r\n $wp_customize,\r\n 'header_bg_color',\r\n array(\r\n 'label' => __('Header background color', 'land'),\r\n 'section' => 'background_image',\r\n 'priority' => 9\r\n )\r\n )\r\n );\r\n}", "function twentyseventeen_colors_css_wrap() {\n\tif ( 'custom' !== get_theme_mod( 'colorscheme' ) && ! is_customize_preview() ) {\n\t\treturn;\n\t}\n\n\trequire_once( get_parent_theme_file_path( '/inc/color-patterns.php' ) );\n\t$hue = absint( get_theme_mod( 'colorscheme_hue', 250 ) );\n?>\n\t<style type=\"text/css\" id=\"custom-theme-colors\" <?php if ( is_customize_preview() ) { echo 'data-hue=\"' . $hue . '\"'; } ?>>\n\t\t<?php echo twentyseventeen_custom_colors_css(); ?>\n\t</style>\n<?php }", "function my_mce4_options($init) {\n\t$default_colors = '';\n\tif(get_field('wysiwyg_colors','option')):\n\t\twhile(has_sub_field('wysiwyg_colors','option')):\n\t\t\t$default_colors .= '\"' . ltrim(get_sub_field('color'), '#') . '\", \"' . get_sub_field('color_name') . '\",';\n\t\tendwhile;\n\tendif;\n\t$init['textcolor_map'] = '['.$default_colors.']';\n\treturn $init;\n}", "function puzzle_modify_puzzle_colors($colors) {\n /* Edit existing theme colors */\n // $colors->theme_color('primary')->set_color('#f6a4cd')\n // ->set_name('Pink')\n // ->set_text_color_scheme('dark');\n \n /* Remove existing theme colors */\n // $colors->remove_theme_color('dark-gray');\n \n /* Add new colors */\n // $accent = new PuzzleColor(array(\n // 'name' => __('Accent Color'),\n // 'id' => 'accent',\n // 'color' => '#f00',\n // 'text_color_scheme' => 'light',\n // 'order' => 11\n // ));\n // $colors->add_theme_color($accent);\n \n /* Edit text colors */\n // $colors->set_text_colors(array(\n // 'headline_dark' => '#333',\n // 'text_dark' => '#555',\n // 'headline_light' => '#fff',\n // 'text_light' => '#fff'\n // ));\n \n /* Edit link colors */\n // $colors->set_link_colors(array(\n // 'link_dark' => '#3b54a5',\n // 'link_dark_hover' => '#2cb799',\n // 'link_light' => '#fff',\n // 'link_light_hover' => 'rgba(255, 255, 255, 0.75)'\n // ));\n}" ]
[ "0.72150284", "0.69665104", "0.6926205", "0.64307857", "0.614706", "0.6119006", "0.61009115", "0.60835445", "0.60757315", "0.60445267", "0.60401005", "0.6023986", "0.60196173", "0.5969022", "0.5923433", "0.586679", "0.5779214", "0.5763321", "0.57502395", "0.5736252", "0.5730938", "0.5656518", "0.5647034", "0.56443346", "0.5594995", "0.5584178", "0.55325514", "0.5528638", "0.5492364", "0.5481506" ]
0.7064425
1
Remove page templates inherited from the parent theme.
function child_theme_remove_page_template( $page_templates ) { unset( $page_templates['page-templates/blank.php'],$page_templates['page-templates/empty.php'], $page_templates['page-templates/fullwidthpage.php'], $page_templates['page-templates/left-sidebarpage.php'], $page_templates['page-templates/both-sidebarspage.php'] ); return $page_templates; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function be_remove_genesis_page_templates( $page_templates ) {\n\tunset( $page_templates['page_archive.php'] );\n\tunset( $page_templates['page_blog.php'] );\n\treturn $page_templates;\n}", "function wmf_undo_redirect_template_changes_in_admin() {\n\tremove_filter( 'page_link', 'wmf_skip_redirect_template_in_page_link' );\n\tremove_filter( 'the_title', 'wmf_skip_redirect_template_in_title' );\n}", "function kanso_custom_menu_page_removing() {\n //remove_menu_page( 'themes.php' ); // Appearance -- (!) There are other ways to do this\n //remove_menu_page( itsec ); // iThemes Security -- Very specific, consider revising\n}", "function remove_parent_features() {\n \tremove_action( 'init', 'gdlr_register_portfolio_admin_option' );\n remove_action('init', 'gdlr_init_page_feature');\n\n //remove theme support for post formats\n remove_theme_support('post-formats');\n}", "function jn_htmlInUrl_deactive() {\r\n\t\tglobal $wp_rewrite;\r\n\t\tif ( in_array( 'page', $this->selected_post_type ) ) {\r\n\t\t\t$wp_rewrite->page_structure = str_replace( '.html','',$wp_rewrite->page_structure );\r\n\t\t\t$wp_rewrite->flush_rules();\r\n\t\t}\r\n\t}", "function ws_kill_parent_theme($themes) {\r\n\tunset( $themes['thematic'] );\r\n\treturn $themes;\r\n}", "public static function use_parent_template() {\n add_action('save_post', array('core_admin', 'switch_page_template'));\n }", "function remove_post_type_support_for_pages() {\n\t\t// UNCOMMENT if you want to remove some stuff\n\t\t// Replace 'page' with 'post' or a custom post/content type\n\t\t# remove_post_type_support( 'page', 'title' );\n\t\t// remove_post_type_support( 'page', 'editor' );\n\t\tremove_post_type_support( 'page', 'thumbnail' );\n\t\t# remove_post_type_support( 'page', 'page-attributes' );\n\t\t# remove_post_type_support( 'page', 'excerpt' );\n}", "public function remove_page_editor() {\n\t\tremove_post_type_support('page', 'editor');\n\t}", "function remove_parent_widgets(){\n\t\t\n\t// remove footer sidebars\n\tunregister_sidebar( 'sidebar-3' );\n\tunregister_sidebar( 'sidebar-4' );\n\tunregister_sidebar( 'sidebar-5' );\n\t\n\t\n}", "function unhook_parent_style() {\n \n wp_dequeue_style( 'genericons' );\n\twp_deregister_style( 'genericons' );\n wp_dequeue_style( 'twentyfifteen-ie' );\n\twp_deregister_style( 'twentyfifteen-ie' );\n wp_dequeue_style( 'twentyfifteen-ie7' );\n\twp_deregister_style( 'twentyfifteen-ie7' );\n wp_dequeue_style( 'twentyfifteen-fonts' );\n\twp_deregister_style( 'twentyfifteen-fonts' );\n}", "function _ut_remove_default_vc_templates( $data ) {\r\n \r\n $data = array();\r\n \r\n return $data;\r\n \r\n}", "function remove_guttenberg_from_pages() {\n\tremove_post_type_support( 'youthclub', 'editor' );\n}", "function remove_theme_mods()\n {\n }", "function _remove_theme_attribute_in_block_template_content($template_content)\n {\n }", "function childtheme_no_superfish(){\r\n\tremove_theme_support('thematic_superfish');\r\n}", "function remove_post_support() {\n remove_post_type_support( 'page', 'editor' );\n }", "public function deleteCompiledTemplates() {\n\t\t// templates\n\t\t$filenames = glob(WCF_DIR.'templates/compiled/*_'.$this->languageID.'_*.php');\n\t\tif ($filenames) foreach ($filenames as $filename) @unlink($filename);\n\t\t\n\t\t// acp templates\n\t\t$filenames = glob(WCF_DIR.'acp/templates/compiled/*_'.$this->languageID.'_*.php');\n\t\tif ($filenames) foreach ($filenames as $filename) @unlink($filename);\n\t}", "function deactivate() {\r\n global $wp_rewrite;\r\n\r\n $wp_rewrite->page_structure = str_replace(\".\" . $this->options->extension, \"\", $wp_rewrite->page_structure);\r\n $wp_rewrite->flush_rules();\r\n }", "public static function register_templates() {\n if (version_compare(floatval(get_bloginfo('version')), '4.7', '<')) {\n // 4.6 and older\n add_filter('page_attributes_dropdown_pages_args', array(get_called_class(), 'register_project_templates'));\n } else {\n // Add a filter to the wp 4.7 version attributes metabox\n add_filter('theme_page_templates', array(get_called_class(), 'add_new_template'));\n }\n // Add a filter to the save post to inject out template into the page cache\n add_filter('wp_insert_post_data', array(get_called_class(), 'register_project_templates'));\n // Add a filter to the template include to determine if the page has our \n // template assigned and return it's path\n add_filter('template_include', array(get_called_class(), 'view_project_template'));\n }", "function remove_menu_pages() {\n //remove_menu_page( 'upload.php' ); //Media\n remove_menu_page( 'edit-comments.php' ); //Comments\n //remove_menu_page( 'themes.php' ); //Appearance\n //remove_menu_page( 'tools.php' ); //Tools\n //remove_menu_page( 'options-general.php' ); //Settings\n //remove_menu_page( 'edit.php?post_type=page' );\n \n}", "function kill_unused_templates() {\n\tglobal $wp_query, $post;\n\n\tif ( is_author() || is_attachment() || is_day() || is_search() || is_feed() ) {\n\t\twp_redirect( home_url() );\n\t\texit();\n\t}\n}", "public static function switch_page_template() {\n\n global $post;\n\n $post_type = get_post_type($post->ID);\n\n if (is_page() or is_post_type_hierarchical($post_type)) {// Checks if current post type is a page, rather than a post\n $current_page_template = get_post_meta($post->ID, '_wp_page_template', true);\n $parent_page_template = get_post_meta($post->post_parent, '_wp_page_template', true);\n $parents = get_post_ancestors($post->ID);\n\n if ($parents) {\n update_post_meta($post->ID, '_wp_page_template', $parent_page_template, $current_page_template);\n }\n }// End check for page\n }", "function jetpackme_remove_rp() {\n\tif ( class_exists( 'Jetpack_relatedPosts')) {\n\t\t$jprp = Jetpack_relatedPosts::init();\n\t\t$callback = array ( $jprp, 'filter_add_target_to_dom' );\n\t\tremove_filter( 'the_content', $callback, 40);\n\t}\n}", "final public function removePages(): void\n {\n $this->pages = [];\n $this->index = [];\n }", "function rd_fix_blog_tab_on_cpt($classes, $item, $args) {\n if (!is_singular('post') && !is_category() && !is_tag()) {\n $blog_page_id = intval(get_option('page_for_posts'));\n if ($blog_page_id != 0) {\n if ($item->object_id == $blog_page_id) {\n unset($classes[array_search('current_page_parent', $classes)]);\n }\n }\n }\n return $classes;\n}", "function custom_page_home() {\n\tif(isset($_GET['post']))\n\t\t$post_id = $_GET['post'];\n\telse if(isset($_POST['post_ID']))\n\t\t$post_id = $_POST['post_ID'];\n\n\tif(!isset($post_id) || empty($post_id))\n\t\treturn;\n\n\t// Get the name of the Page Template file.\n\t$template_file = get_post_meta($post_id, '_wp_page_template', true);\n\n\t// Do something for the template\n\tif($template_file == \"home\") {\n\t\tremove_post_type_support('page','author');\n\t\tremove_post_type_support('page','custom-fields');\n\t\tremove_post_type_support('page','comments');\n\t\tremove_post_type_support('page','excerpt' );\n\t\tremove_post_type_support('page','trackbacks');\n\t\tremove_post_type_support('page','revisions');\n\t}\n}", "public static function remove_menu_pages() {\n\t\t$post_type = Registrations::get_post_type();\n\n\t\tremove_submenu_page( \"edit.php?post_type={$post_type}\", \"manage_frontend_uploader_{$post_type}s\" );\n\t\tremove_submenu_page( 'upload.php', 'manage_frontend_uploader' );\n\t}", "protected function uninstall_templates()\n {\n // initialize the Finder\n $finder = new Finder();\n // we need only the top level\n $finder->depth('== 0');\n // get all directories in the /Examples\n $finder->directories()->in(MANUFAKTUR_PATH.'/TemplateTools/Examples');\n \n foreach ($finder as $directory) {\n $template_name = $directory->getFilename();\n $target_directory = CMS_PATH.'/templates/'.$template_name;\n \n if ($this->app['filesystem']->exists($target_directory)) {\n // the template exists - remove it\n $this->app['filesystem']->remove($target_directory);\n }\n \n $this->app['db']->delete(CMS_TABLE_PREFIX.'addons', \n array('type' => 'template', 'directory' => $template_name));\n }\n }", "function _preview_theme_template_filter()\n {\n }" ]
[ "0.702426", "0.65037644", "0.64131457", "0.6406326", "0.6262876", "0.62376744", "0.61424834", "0.6110962", "0.61082923", "0.6108143", "0.6036941", "0.60307467", "0.602198", "0.5971363", "0.59237164", "0.58937496", "0.5886289", "0.5847543", "0.58383566", "0.5826905", "0.5806757", "0.5801867", "0.5782649", "0.5775987", "0.57499826", "0.57460856", "0.5743062", "0.57243055", "0.5705576", "0.56426513" ]
0.7632337
0
Display only sticky posts
function be_display_only_sticky_posts( $args, $atts ) { $sticky_variations = array( 'sticky_posts', 'sticky-posts', 'sticky posts' ); if( !empty( $atts['id'] ) && in_array( $atts['id'], $sticky_variations ) ) { $sticky_posts = get_option( 'sticky_posts' ); $args['post__in'] = $sticky_posts; } if( !empty( $atts['exclude'] ) && in_array( $atts['exclude'], $sticky_variations ) ) { $sticky_posts = get_option( 'sticky_posts' ); $args['post__not_in'] = $sticky_posts; } return $args; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onlyStickyPosts()\r\n{\r\n\t$sticky = get_option('sticky_posts');\r\n\t// check if there are any\r\n\tif (!empty($sticky)) {\r\n\t\t// optional: sort the newest IDs first\r\n\t\trsort($sticky);\r\n\t\t// override the query\r\n\t\t$args = array(\r\n\t\t\t'post__in' => $sticky\r\n\t\t);\r\n\t\tquery_posts($args);\r\n\t\t// the loop\r\n\t\twhile (have_posts()) {\r\n\t\t\tthe_post();\r\n\t\t\t// your code\r\n\t\t\tget_template_part('article');\r\n\t\t}\r\n\t}\r\n\twp_reset_query();\r\n}", "function wpb_latest_sticky() { \n\n/* Get all sticky posts */\n$sticky = get_option( 'sticky_posts' );\n\n/* Sort the stickies with the newest ones at the top */\nrsort( $sticky );\n\n/* Get the 5 newest stickies (change 5 for a different number) */\n$sticky = array_slice( $sticky, 0, 5 );\n\n/* Query sticky posts */\n$the_query = new WP_Query( array( 'post__in' => $sticky, 'ignore_sticky_posts' => 2 ) );\n// The Loop\nif ( $the_query->have_posts() ) {\n\t$return = '<ul>';\n\twhile ( $the_query->have_posts() ) {\n\t\t$the_query->the_post();\n\t\t$return .= '<li><a href=\"' .get_permalink(). '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</a><br />' . get_the_excerpt(). '</li>';\n\t\t\n\t}\n\t$return .= '</ul>';\n\t\n} else {\n\t// no posts found\n}\n/* Restore original Post Data */\nwp_reset_postdata();\n\nreturn $return; \n\n}", "function areThereStickyPosts()\r\n{\r\n\t$sticky = get_option('sticky_posts');\r\n\t// check if there are any\r\n\treturn !empty($sticky) ? true : false;\r\n}", "function simpleTheme_blog_loop() {\n\n $loop = new WP_Query( array( 'post__in' => get_option('sticky_posts') ) );\n echo '<ul class=\"stick-posts\">';\n while ( $loop->have_posts() ) : $loop->the_post();\n echo '<li class=\"simple-theme-sticky\"><a href=\"' . get_the_permalink() . '\">' . get_the_title() . '</a>';\n simpleTheme_date();\n echo '</li>';\n endwhile;\n echo '</ul>';\n\n}", "public function showsticky() {\n }", "function is_sticky() {\n\tglobal $discussion;\n\treturn $discussion['sticky'];\n}", "function getSticky()\n {\n \t$query = 'SELECT t.id, t.post_subject, t.topic_type, t.hits, ' .\n \t\t\t\t't.forum_id, t.post_time, t.post_user, t.post_username ' .\n \t\t\t'FROM #__ccb_topics AS t ' .\n \t\t\t'WHERE ((t.topic_type = 1 OR t.topic_type = 3) AND (t.hold=0)) ' .\n \t\t\t'ORDER BY t.topic_type, t.post_time DESC ';\n\n\t\t$sticky = ($sticky = $this->_getList($query))? $sticky :array();\n\n\t\treturn $sticky;\n }", "function ppo_posted_on() {\n if ( is_sticky() && is_home() && ! is_paged() ) {\n echo '<span class=\"featured-post\">' . __( 'Sticky post', SHORT_NAME ) . '</span>';\n }\n\n // Set up and print post meta information.\n printf( '<span class=\"entry-date\"><a href=\"%1$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%2$s\"><i class=\"fa fa-calendar\"></i> %3$s</time></a></span> <span class=\"byline\"><span class=\"author vcard\"><a class=\"url fn n\" href=\"%4$s\" rel=\"author\"><i class=\"fa fa-user\"></i> %5$s</a></span></span>',\n esc_url( get_permalink() ),\n esc_attr( get_the_date( 'c' ) ),\n esc_html( get_the_date() ),\n esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),\n get_the_author()\n );\n}", "public function homepage_ignore_sticky( $query ) {\n\t\t\tif ( $query->is_front_page() && $query->is_main_query() ) {\n\t\t\t\t$query->set( 'ignore_sticky_posts', 1 );\n\t\t\t}\n\t\t}", "function cc_get_sticky_page() {\n\tglobal $wpdb;\n\n\t$query = \"\n\t\tSELECT posts.*\n\t\tFROM $wpdb->posts posts, $wpdb->postmeta postmeta\n\t\tWHERE posts.ID = postmeta.post_id\n\t\tAND postmeta.meta_key = 'show_on_index'\n\t\tAND postmeta.meta_value = 'yes'\n\t\tAND posts.post_status = 'publish'\n\t\tAND posts.post_type = 'page'\n\t\tORDER BY posts.post_date ASC LIMIT 1\";\n\t$page = $wpdb->get_row ($query);\n\n\treturn $page;\n}", "function thinkup_input_sticky() {\n\tprintf( '<span class=\"sticky\"><a href=\"%1$s\" title=\"%2$s\">' . esc_html__( 'Sticky', 'ESTSB' ) . '</a></span>',\n\t\tesc_url( get_permalink() ),\n\t\tesc_attr( get_the_title() )\n\t);\n}", "public function isSticky()\n {\n return $this->sticky;\n }", "function horizon_theme_posted_on() {\n\t\tif ( is_sticky() && is_home() && ! is_paged() ) {\n\t\t\techo '<span class=\"featured-post\">' . __( 'Sticky', 'horizon-theme' ) . ' </span>';\n\t\t}\n\n\t\t// Set up and print post meta information.\n\t\tprintf( '<span class=\"entry-date\">%s <time class=\"entry-date\" datetime=\"%s\">%s</time></span> <span class=\"byline\">%s <span class=\"author vcard\"><a class=\"url fn n\" href=\"%s\" rel=\"author\">%s</a></span>.</span>',\n\t\t\t__( 'Posted in', 'horizon-theme' ),\n\t\t\tesc_attr( get_the_date( 'c' ) ),\n\t\t\tesc_html( get_the_date() ),\n\t\t\t__( 'by', 'horizon-theme' ),\n\t\t\tesc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),\n\t\t\tget_the_author()\n\t\t);\n\t}", "function post_pagination($query)\r\n{\r\n\t$sticky = get_option('sticky_posts');\r\n\tif ($query->is_home() && $query->is_main_query()) {\r\n\t\t$query->set('posts_per_page', '5');\r\n\t\t$query->set('post__not_in', get_option('sticky_posts'));\r\n\t}\r\n}", "public function getIsSticky()\n {\n return $this->isSticky;\n }", "public static function get_sticky_data()\n {\n /**\n * Put all results in the response array.\n */\n $response = [];\n\n /**\n * \n */\n $sticky = [\n 'id' => 0,\n 'title' => 'Uitgelicht',\n 'items' => [],\n 'hasMore' => false\n ];\n\n /**\n * Get all fragments with the sticky meta.\n */\n $args = [\n 'post_type' => 'fragment',\n 'post_status' => 'publish',\n 'posts_per_page' => -1,\n 'orderby' => 'menu_order',\n 'order' => 'ASC',\n 'meta_query' => [\n [\n 'key' => 'fragment_sticky',\n 'value' => 1,\n 'compare' => '='\n ]\n ]\n ];\n\n $query = new \\WP_Query($args);\n if ($query->have_posts()) {\n while ($query->have_posts()) {\n $query->the_post();\n\n $fragment_id = get_the_id();\n $audio_file = get_field('fragment_audio_file');\n $still = get_field('fragment_still');\n\n $title = apply_filters('the_title', get_the_title());\n $title = html_entity_decode($title);\n\n /**\n * Only append items that have valid audio files.\n */\n if ($audio_file) {\n $sticky['items'][] = [\n 'id' => 'sticky-' . $fragment_id,\n 'title' => $title,\n 'category' => 0,\n 'thumbnail' => [\n '@1x' => $still['sizes']['fragment-thumbnail@1x'],\n 'alt' => $still['alt']\n ],\n 'audio' => [\n 'url' => $audio_file['url'],\n 'mimeType' => $audio_file['mime_type']\n ]\n ];\n }\n }\n\n wp_reset_postdata();\n }\n\n $response[] = $sticky;\n return $response;\n }", "public function index() {\n \n if (!Auth::check()) {\n return Redirect::to('login');\n }\n\n $results = Sticky::where('user_id', '=', Auth::user()->id)\n ->orderBy('id', 'DESC')\n ->skip(0)\n ->take(8)\n ->get();\n $count = Sticky::where('user_id', '=', Auth::user()->id)\n ->count();\n \n $this->layout->content = View::make('sticky.show')\n ->with(array('results'=>$results,'count'=>$count));\n }", "function ridizain_has_featured_posts() {\r\n\treturn ! is_paged() && (bool) ridizain_get_featured_posts();\r\n}", "function sticky_class($post_id = \\null)\n {\n }", "function tptn_pop_posts( $daily = false , $widget = false ) {\r\n\tglobal $wpdb, $siteurl, $tableposts, $id;\r\n\tif ($daily) $table_name = $wpdb->prefix . \"top_ten_daily\"; \r\n\t\telse $table_name = $wpdb->prefix . \"top_ten\";\r\n\t$tptn_settings = tptn_read_options();\r\n\t$limit = $tptn_settings['limit'];\r\n\r\n\tif (!$daily) {\r\n\t\t$sql = \"SELECT postnumber, cntaccess as sumCount, ID, post_type, post_status, post_content \";\r\n\t\t$sql .= \"FROM $table_name INNER JOIN \". $wpdb->posts .\" ON postnumber=ID \" ;\r\n\t\tif ($tptn_settings['exclude_pages']) $sql .= \"AND post_type = 'post' \";\r\n\t\t$sql .= \"AND post_status = 'publish' \";\r\n\t\t$sql .= \"ORDER BY sumCount DESC LIMIT $limit\";\r\n\t} else {\r\n\t\t$daily_range = $tptn_settings[daily_range] - 1;\r\n\t\t$current_time = gmdate( 'Y-m-d', ( time() + ( get_option( 'gmt_offset' ) * 3600 ) ) );\r\n\t\t$current_date = strtotime ( '-'.$daily_range. ' DAY' , strtotime ( $current_time ) );\r\n\t\t$current_date = date ( 'Y-m-j' , $current_date );\r\n\t\t\r\n\t\t$sql = \"SELECT postnumber, SUM(cntaccess) as sumCount, dp_date, ID, post_type, post_status, post_content \";\r\n\t\t$sql .= \"FROM $table_name INNER JOIN \". $wpdb->posts .\" ON postnumber=ID \" ;\r\n\t\tif ($tptn_settings['exclude_pages']) $sql .= \"AND post_type = 'post' \";\r\n\t\t$sql .= \"AND post_status = 'publish' AND dp_date >= '$current_date' \";\r\n\t\t$sql .= \"GROUP BY postnumber \";\r\n\t\t$sql .= \"ORDER BY sumCount DESC LIMIT $limit\";\r\n\t}\r\n\t$results = $wpdb->get_results($sql);\r\n\t$output = '';\r\n\r\n\tif (!$widget) {\r\n\t\tif (!$daily) {\r\n\t\t\t$output .= '<div id=\"tptn_related\">'.$tptn_settings['title'];\r\n\t\t} else {\r\n\t\t\t$output .= '<div id=\"tptn_related_daily\">'.$tptn_settings['title_daily'];\r\n\t\t}\r\n\t}\r\n\t\r\n\tif ($results) {\r\n\t\t$output .= $tptn_settings['before_list'];\r\n\t\tforeach ($results as $result) {\r\n\t\t\t$title = trim(stripslashes(get_the_title($result->postnumber)));\r\n\t\t\t$output .= $tptn_settings['before_list_item'];\r\n\r\n\t\t\tif (($tptn_settings['post_thumb_op']=='inline')||($tptn_settings['post_thumb_op']=='thumbs_only')) {\r\n\t\t\t\t$output .= '<a href=\"'.get_permalink($result->postnumber).'\" rel=\"bookmark\">';\r\n\t\t\t\tif ((function_exists('has_post_thumbnail')) && (has_post_thumbnail($result->postnumber))) {\r\n\t\t\t\t\t$output .= get_the_post_thumbnail( $result->postnumber, array($tptn_settings[thumb_width],$tptn_settings[thumb_height]), array('title' => $title,'alt' => $title, 'class' => 'tptn_thumb', 'border' => '0'));\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$postimage = get_post_meta($result->postnumber, $tptn_settings[thumb_meta], true);\t// Check \r\n\t\t\t\t\tif ((!$postimage)&&($tptn_settings['scan_images'])) {\r\n\t\t\t\t\t\tpreg_match_all( '|<img.*?src=[\\'\"](.*?)[\\'\"].*?>|i', $result->post_content, $matches );\r\n\t\t\t\t\t\t// any image there?\r\n\t\t\t\t\t\tif( isset( $matches ) && $matches[1][0] ) {\r\n\t\t\t\t\t\t\t$postimage = $matches[1][0]; // we need the first one only!\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!$postimage) $postimage = $tptn_settings[thumb_default];\r\n\t\t\t\t\t$output .= '<img src=\"'.$postimage.'\" alt=\"'.$title.'\" title=\"'.$title.'\" width=\"'.$tptn_settings[thumb_width].'\" height=\"'.$tptn_settings[thumb_height].'\" border=\"0\" class=\"tptn_thumb\" />';\r\n\t\t\t\t}\r\n\t\t\t\t$output .= '</a> ';\r\n\t\t\t}\r\n\t\t\tif (($tptn_settings['post_thumb_op']=='inline')||($tptn_settings['post_thumb_op']=='text_only')) {\r\n\t\t\t\t$output .= '<a href=\"'.get_permalink($result->postnumber).'\" rel=\"bookmark\">'.$title.'</a>';\r\n\t\t\t}\t\t\r\n\t\t\tif ($tptn_settings['show_excerpt']) {\r\n\t\t\t\t$output .= '<span class=\"tptn_excerpt\"> '.tptn_excerpt($result->post_content,$tptn_settings['excerpt_length']).'</span>';\r\n\t\t\t}\r\n\t\t\tif ($tptn_settings['disp_list_count']) $output .= ' ('.$result->sumCount.')';\r\n\t\t\t$output .= $tptn_settings['after_list_item'];\r\n\t\t}\r\n\t\tif ($tptn_settings['show_credit']) $output .= '<li>Popular posts by <a href=\"http://ajaydsouza.com/wordpress/plugins/top-10/\">Top 10 plugin</a></li>';\r\n\t\t$output .= $tptn_settings['after_list'];\r\n\t}\r\n\tif (!$widget) $output .= '</div>';\r\n\r\n\treturn $output;\r\n}", "function tptn_show_pop_posts() {\r\n\techo tptn_pop_posts(false,false);\r\n}", "function have_posts()\n {\n }", "function wp_bottom_featured_bar_post() {\n global $post;\n // show only if the post type is a blog post\n if($post && $post->post_type != \"post\")\n return null;\n\n // load categories \n $categories = wp_get_post_categories($post->ID);\n $args = array( 'posts_per_page' => 5, 'orderby' => 'rand', 'exclude' => $post->ID ); \n\n if ( $count = count($categories) > 0 ) {\n if ( $count == 1 && $categories[0] == 1) {\n // ignore the filter.\n } else {\n $args['category'] = implode($categories, \",\");\n }\n }\n\n $rand_posts = get_posts( $args );\n\n return $rand_posts[0];\n}", "function otm_show_featured_posts() {\n\n\t$my_query = new WP_Query( array( \n\t\t'meta_key' \t\t\t\t=> 'is_featured',\n\t\t'post_type'\t\t\t\t=> 'post',\n\t\t'meta_value'\t\t\t=> true,\n\t\t'numberposts' \t\t=> 3\n\t) );\n\n\t// If our query has posts\n\tif ( $my_query->have_posts() ) :\n\t\twhile ( $my_query->have_posts() ) : $my_query->the_post();\n\n\t\t\t// Get specific template-part\n\t\t\tget_template_part( 'template-parts/post/content-featured' );\n\n\t\tendwhile;\n\tendif;\n\n\twp_reset_query();\n}", "function tptn_show_daily_pop_posts() {\r\n\tglobal $tptn_url;\r\n\t$tptn_settings = tptn_read_options();\r\n\tif ($tptn_settings['d_use_js']) {\r\n\t\techo '<script type=\"text/javascript\" src=\"'.$tptn_url.'/top-10-daily.js.php?widget=1\"></script>';\r\n\t} else {\r\n\t\techo tptn_pop_posts(true,false);\r\n\t}\r\n}", "public function show() {\n $skip=Input::get('limit');\n $take=3;\n $results = Sticky::where('user_id', '=', Auth::user()->id)\n ->orderBy('id', 'DESC')\n ->skip($skip)\n ->take($take)\n ->get();\n \n return View::make('sticky.scroll')\n ->with('results', $results);\n }", "function show_posts(\n $thread, $forum, $start, $postid, $sort_style, $filter, $logged_in_user\n) {\n $n = 1;\n\n $num_to_show = 20;\n if ($logged_in_user && $logged_in_user->prefs->display_wrap_postcount > 0) {\n $num_to_show = $logged_in_user->prefs->display_wrap_postcount;\n }\n\n // let moderators see all posts, including hidden ones\n //\n if (is_moderator($logged_in_user, $forum)) {\n $show_hidden = true;\n } else {\n $show_hidden = false;\n }\n\n $posts = get_thread_posts($thread->id, $sort_style, $show_hidden);\n\n $latest_viewed = 0;\n $forum_log = null;\n if ($logged_in_user) {\n $forum_log = BoincForumLogging::lookup($logged_in_user->id, $thread->id);\n if ($forum_log) {\n $latest_viewed = $forum_log->timestamp;\n }\n }\n\n if ($sort_style == CREATE_TIME_OLD) {\n // show the last page\n //\n $nposts = sizeof($posts);\n if ($nposts) $nposts -= 1;\n $page = (int)($nposts/$num_to_show);\n $default_start = $page*$num_to_show;\n } else {\n $default_start = 0;\n }\n\n // jump to a specific post if needed\n //\n $jump_to_post = null;\n if ($start === null) {\n if ($postid) {\n // jump to a specific post\n //\n $i = 0;\n foreach ($posts as $post) {\n if ($post->id == $postid) {\n $start = $i - ($i % $num_to_show);\n $jump_to_post = $post;\n break;\n }\n $i++;\n }\n if ($start === null) {\n echo \"Post $postid not found.\";\n return;\n }\n } else if ($logged_in_user && $logged_in_user->prefs->jump_to_unread) {\n // jump to the first unread post\n //\n $i = 0;\n $ibest = 0;\n foreach ($posts as $post) {\n if ($post->timestamp > $latest_viewed) {\n if (!$jump_to_post || ($post->timestamp < $jump_to_post->timestamp)) {\n $jump_to_post = $post;\n $ibest = $i;\n }\n }\n $i++;\n }\n if ($jump_to_post) {\n $start = $ibest - ($ibest % $num_to_show);\n } else {\n $start = $default_start;\n }\n } else {\n $start = $default_start;\n }\n }\n\n $page_nav = page_links(\n \"forum_thread.php?id=$thread->id&sort_style=$sort_style\",\n sizeof($posts),\n $num_to_show,\n $start\n );\n\n echo $page_nav;\n\n $num_shown = 0;\n $num_skipped = 0;\n $headings = array(array(tra(\"Author\"),\"authorcol\"), array(tra(\"Message\"),\"\"));\n start_forum_table($headings, \"id=\\\"thread\\\" cellspacing=0\");\n\n $latest_shown_timestamp = 0;\n foreach ($posts as $post) {\n if ($num_skipped < $start) {\n $num_skipped++;\n continue;\n }\n if ($num_shown == $num_to_show) {\n break;\n }\n show_post(\n $post, $thread, $forum, $logged_in_user, $latest_viewed, $n,\n FORUM_CONTROLS, $filter\n );\n $n = ($n+1)%2;\n \n if ($post->timestamp > $latest_shown_timestamp) {\n $latest_shown_timestamp = $post->timestamp;\n }\n $num_shown++;\n }\n end_table();\n echo $page_nav;\n\n if ($jump_to_post) {\n echo \"<script>function jumpToUnread(){location.href='#\".$jump_to_post->id.\"';}</script>\";\n } else {\n echo \"<script>function jumpToUnread(){};</script>\";\n }\n\n if ($logged_in_user) {\n if (!$forum_log || $latest_shown_timestamp > $forum_log->timestamp) {\n BoincForumLogging::replace(\n $logged_in_user->id, $thread->id, $latest_shown_timestamp\n );\n }\n }\n}", "function twentyfourteen_has_featured_posts() {\n\treturn ! is_paged() && (bool) twentyfourteen_get_featured_posts();\n}", "function twentyfourteen_has_featured_posts() {\n\treturn ! is_paged() && (bool) twentyfourteen_get_featured_posts();\n}", "function wpex_has_sticky_header() {\n\n\t// Disable for custom header and in VC Live editor\n\tif ( wpex_has_custom_header() || wpex_vc_is_inline() ) {\n\t\treturn;\n\t}\n\n\t// Disabled by default\n\t$return = false;\n\n\t// Get current post id\n\t$post_id = wpex_get_current_post_id();\n\n\t// Check meta first it should override any filter!\n\tif ( $post_id && 'disable' == get_post_meta( $post_id, 'wpex_sticky_header', true ) ) {\n\t\treturn false;\n\t}\n\n\t// Get header style\n\t$header_style = wpex_header_style( $post_id );\n\n\t// Return true if header is not disabled and header style is either 1 or 2\n\tif ( 'disabled' != wpex_sticky_header_style() && ( 'one' == $header_style || 'five' == $header_style ) ) {\n\t\t$return = true;\n\t}\n\n\t// No sticky header for the vertical header\n\tif ( 'six' == $header_style ) {\n\t\t$return = false;\n\t}\n\n\t// Apply filters and return\n\treturn apply_filters( 'wpex_has_fixed_header', $return );\n\n}" ]
[ "0.7932049", "0.7375507", "0.7180215", "0.7099434", "0.683806", "0.67774963", "0.6630844", "0.65019584", "0.6468794", "0.6466884", "0.640469", "0.6374649", "0.6162739", "0.6154045", "0.6144017", "0.60648507", "0.6064456", "0.60457355", "0.5959761", "0.59366274", "0.5935665", "0.5914284", "0.59112513", "0.5836461", "0.5833897", "0.5832001", "0.582627", "0.5819392", "0.5819392", "0.57889605" ]
0.76922
1
/ Test create consignee with incorrect parameters
public function testCreateConsigneeWithIncorrectParameters() { $this->expectException( WebException::class); // Give wrong/missing parameters to provoke an error response $builder = new ConsigneeBuilder(); $consignee = $builder->build(); $this->api->createConsignee( $consignee ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testQuarantineCreate()\n {\n\n }", "public function testCannotBeCreatedFromInvalidEmailAddress()\n {\n\n }", "function testCreate() {\n # fails due to not verified...\n $this->aRequest['email'] = 'unverified@example.com';\n $this->assertFalse($this->oObject->create());\n\n # but verified users works\n $this->aRequest['email'] = 'moderator@example.com';\n $this->assertTrue($this->oObject->create());\n $this->oObject->destroy(session_id());\n }", "public function testCanBeCreatedFromValidEmailAddress()\n {\n\n }", "public function testExcepcionSiSeCreaEmpleadoConDniQueContengaLetras(){\n\t\t\t$this->expectException(\\Exception::class);\n\t\t\t$emp= $this-> crear(null, null, \"4kh123l\");\n\t\t}", "public function testExcepcionSiSeCreaEmpleadoConDniVacio(){\n\t\t\t$this->expectException(\\Exception::class);\n\t\t\t$emp= $this-> crear(null, null,$dni=\"\");\n\t\t}", "public function testExcepcionSiSeCreaEmpleadoConApellidoVacio(){\n\t\t\t$this->expectException(\\Exception::class);\n\t\t\t$emp= $this-> crear($nombre=\"Franco\", $Apellido=\"\");\n\t\t}", "public function testCreation()\n {\n $this->module->enableRegistration = false;\n\n $this->specify(\"we have create user if registration disabled\", function () {\n $user = new User([\n 'email' => 'user@example.com',\n 'password' => 'password',\n 'name' => 'Test user',\n ]);\n expect(\"we can create user if registration disabled\", $user->create())->true();\n $this->tester->dontSeeEmailIsSent();\n //create() on existing user throw \\RuntimeException\n $user->create();\n }, ['throws' => new \\RuntimeException]);\n\n $this->module->enableRegistration = true;\n $this->specify(\"we have create user with register email\", function () {\n $user = new User([\n 'email' => 'user2@example.com',\n 'password' => 'password',\n 'name' => 'Test user 2',\n ]);\n expect(\"we can create user if registration disabled\", $user->create(true))->true();\n /** @var TestMailer $message */\n /** @var yii\\swiftmailer\\Message $message */\n $this->tester->seeEmailIsSent();\n $message = $this->tester->grabLastSentEmail();\n expect(\"we must see email\", $message)->notNull();\n expect(\"we must see email to user\", $message->getTo())->hasKey($user->email);\n expect(\"we must see registration email\", $message->getSubject())->contains('register');\n });\n\n $this->specify(\"we have create user wit autogenerated password\", function () {\n $user = new User([\n 'email' => 'user3@example.com',\n 'name' => 'Test user',\n ]);\n expect(\"we can create user with autogenerated password\", $user->create())->true();\n });\n\n $this->specify(\"we have create user without name\", function () {\n $user = new User([\n 'email' => 'user4@example.com',\n 'password' => 'password',\n ]);\n expect(\"we can't create user without name\", $user->create())->false();\n expect(\"we can see error `name`\", $user->getErrors())->hasKey('name');\n });\n }", "public function testCreateSuperfund()\n {\n }", "public function testWebinarRegistrantCreate()\n {\n }", "public function testCreateNetworkMerakiAuthUser()\n {\n }", "public function testFailNoCustomerNoForAccountCreate()\n {\n $card = new Card();\n $card->setToken('test-token');\n\n $config = new SinglePayConfig();\n $config->setServiceConfig(self::$testConfig);\n\n $data = new SinglePayData();\n\n $data->setCard($card)\n ->setExtras(array(\n 'method' => 'update'\n ));\n\n $transactionSetup = ExpressFactory::buildTransactionSetup($config, $data);\n }", "public function testExcepcionSiSeCreaEmpleadoConSalarioVacio(){\n\t\t\t$this->expectException(\\Exception::class);\n\t\t\t$emp= $this-> crear(null, null, null,$Salario=\"\");\n\t\t}", "public function testShouldCreateANewUser()\n {\n $user = factory(User::class)->create();\n\n $role = Role::where(\"name\", \"admin\")->first();\n $user->attachRole($role);\n\n $this->actingAs($user);\n\n $invitationLink = (new CreateInvitationLinkService($user))->execute([\n \"type\" => \"STUDENT\",\n ]);\n\n $createdUser = (new CreateUserService())->execute([\n \"name\" => $this->faker->name,\n \"email\" => $this->faker->unique()->safeEmail,\n \"password\" => \"12345678\",\n \"hash\" => $invitationLink->hash,\n ]);\n\n $this->assertTrue(is_numeric($createdUser->id));\n }", "public function testProfileCreate()\n {\n\n }", "public function testExcepcionSiSeCreaEmpleadoConNombreVacio(){\n\t\t\t$this->expectException(\\Exception::class);\n\t\t\t$emp= $this-> crear($nombre=\"\");\n\t\t}", "public function testCreatingContactWithNegativeUserIdFails(): void\n {\n // Creates expectation.\n $this->expectException(\\InvalidArgumentException::class);\n\n // Create random attributes.\n $attributes = [\n 'id' => $this->faker->numberBetween(),\n 'user_id' => -1,\n 'token_id' => $this->faker->randomAscii,\n 'revoked' => $this->faker->boolean,\n 'expires_at' => $this->faker->dateTimeBetween('+10 days', '+20 days')->format('Y-m-d H:i:s'),\n ];\n\n // Performs test.\n new AccessToken($attributes);\n }", "public function testCreateCertificates()\n {\n }", "public function testIs20200519CustomerCreatableThrowInvalidArgumentException()\n {\n $this->expectException(\\Xendit\\Exceptions\\InvalidArgumentException::class);\n $params = [\n 'reference_id' => self::REFERENCE_ID\n ];\n\n Customers::createCustomer($params);\n }", "public function testCreateExpedicao()\n {\n }", "public function testRegisterNewContract()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(factory(User::class)->create());\n $property = factory(Property::class)->create([\n 'rented' => null,\n 'status' => Property::STATUS_ACTIVE\n ]);\n $lessee = factory(Lessee::class)->create();\n\n $browser\n ->visit(route('contrato.create'))\n ->on(new CreateContractPage())\n ->assertSee('Nuevo Contrato');\n\n\n\n\n\n $browser->selectLessor($property->lessor->id);\n $browser->selectProperty($property->id);\n $browser->selectLessee($lessee->id);\n $browser->typeSlowly('@years',1);\n // Contract dates\n $this->fillInputDate($browser,'periods[0][fecha_inicio]', now());\n $this->fillInputDate($browser,'periods[0][fecha_fin]', now()->addMonth());\n $browser->typeSlowly('input[name=\\'periods[0][cantidad]\\']', random_int(1000,1210));\n\n $browser->pause(500);\n $browser->screenshot('after');\n $browser->screenshot('test');\n $browser->type('@bonus',10);\n $browser->type('@deposit',5000);\n $browser->click('@submit');\n\n $browser->assertRouteIs('contrato.index');\n $browser->assertSee('Catalogo de Contratos');\n });\n }", "public function testProfilePrototypeCreateQuarantines()\n {\n\n }", "public function testShouldFailIFARegistrationIsCreatedWithoutSource() {\n $this->expectException(\\PDOException::class);\n \n $entity = new Registration;\n $entity->registrant_id = $this->getRegistrant()->id;\n $entity->type = 'PLAYER' ;\n $entity->league = 'league';\n $entity->org_name = 'Oranization...';\n $entity->org_state = 'NY';\n $entity->season = '2017';\n $entity->external_id = 'myexternalid';\n $entity->right_to_market = true;\n $entity->team_gender = 'Male';\n $entity->team_name = 'A-Team';\n $entity->school_district = 'school district';\n $entity->school_state = 'school sate';\n $entity->first_name = 'Firt name';\n $entity->middle_name = 'Middle name';\n $entity->last_name = 'Last Name';\n $entity->email = 'mail@mail.com';\n $entity->gender = 'Male';\n $entity->city = 'California';\n $entity->zip_code = '234141234123';\n $entity->birth_date = '11/27/1984';\n $entity->phone_number = '1234567890';\n $entity->game_type = 'SOME';\n $entity->level = 'LEVEL';\n $entity->state = 'CALIFORNIA';\n $entity->address_first_line = 'An Address 1234';\n $entity->county = 'A county';\n\n $entity->save();\n }", "public function test_user_can_create_despesa()\n {\n // Prepare User Login\n\n // $user = User::factory()->create();\n\n\n // $credentials = [\n // 'email' => $user->email,\n // 'password' => 'password'\n // ];\n\n // $response = $this->post(route('auth.user'), $credentials);\n\n\n // Create Despesa\n\n // $post = Despesas::factory()->create();\n\n // $data = $post->only(['descricao', 'valor', 'id_usuario']);\n // $data['data_criacao'] = Carbon::now();\n\n // Despesas::create($data);\n\n // $response = $this->post(route('new-post'), $data);\n\n // $response->assertStatus(302);\n }", "public function testBuildAccountCreateTransactionSetup()\n {\n $config = new SinglePayConfig();\n $config->setServiceConfig(self::$testConfig);\n\n $data = new SinglePayData();\n $data->setCustomerNo('112')\n ->setExtras(array(\n 'method' => 'create'\n ));\n\n $transactionSetup = ExpressFactory::buildTransactionSetup($config, $data);\n $this->assertInstanceOf('\\SinglePay\\PaymentService\\Element\\Express\\Method\\TransactionSetup', $transactionSetup);\n $this->assertEquals($transactionSetup->transactionSetup->TransactionSetupMethod, 'PaymentAccountCreate');\n $this->assertEquals($transactionSetup->transactionSetup->ProcessTransactionTitle, 'Save Card');\n }", "public function testShouldFailIFARegistrationIsCreatedWithoutRegistrant() {\n $this->expectException(\\PDOException::class);\n\n $entity = new Registration;\n $entity->source_id = $this->getSource()->id;\n $entity->type = 'PLAYER' ;\n $entity->league = 'league';\n $entity->org_name = 'Oranization...';\n $entity->org_state = 'NY';\n $entity->season = '2017';\n $entity->external_id = 'myexternalid';\n $entity->right_to_market = true;\n $entity->team_gender = 'Male';\n $entity->team_name = 'A-Team';\n $entity->school_district = 'school district';\n $entity->school_state = 'school sate';\n $entity->first_name = 'Firt name';\n $entity->middle_name = 'Middle name';\n $entity->last_name = 'Last Name';\n $entity->email = 'mail@mail.com';\n $entity->gender = 'Male';\n $entity->city = 'California';\n $entity->zip_code = '234141234123';\n $entity->birth_date = '11/27/1984';\n $entity->phone_number = '1234567890';\n $entity->game_type = 'SOME';\n $entity->level = 'LEVEL';\n $entity->state = 'CALIFORNIA';\n $entity->address_first_line = 'An Address 1234';\n $entity->county = 'A county';\n\n $entity->save();\n }", "public function testParticipantsMePasswordPut()\n {\n }", "public function test_crear_proceso_nombre_codigo_existentes()\n {\n\n Artisan::call('migrate:fresh');\n Artisan::call('db:seed');\n \n $user = factory(User::class)->create();\n $this->actingAs($user);\n\n $proceso1 = factory(Proceso::class)->create(['nombre'=>'Proceso 1','codigo'=>'AAAC']);\n\n $result = $this->post(route('procesos.store'),['nombre'=>'Proceso 1','codigo'=>'AAAC']);\n\n $result->assertSessionHasErrors();\n }", "public function testCreateChallengeTemplate()\n {\n }", "public function testCreateChallengeActivityTemplate()\n {\n }" ]
[ "0.6802849", "0.6537524", "0.64769465", "0.64532065", "0.6296269", "0.61695564", "0.6125048", "0.6089019", "0.60516536", "0.602815", "0.6021496", "0.5986568", "0.59795356", "0.5977144", "0.5974034", "0.5964491", "0.5945142", "0.5940745", "0.59194815", "0.5912024", "0.5876557", "0.58700484", "0.58488595", "0.58283174", "0.58201647", "0.5820042", "0.5819581", "0.581423", "0.5813121", "0.5812988" ]
0.7950649
0
Get a new identifier
public function newIdentifier(): string;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNewId();", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "abstract public function getIdentifier();", "public abstract function getIdentifier();", "function getIdentifier();", "function getIdentifier();", "public function getIdentifier()\n {\n }", "public function intGetNewId() {\n $this->XaoThrow(\n \"_EntBase::Build(): This entity does not implement retrieval of a \".\n \"new numeric identifier as a descrite function. It may not be \" .\n \"applicable.\"\n , debug_backtrace()\n );\n }", "function getIdentifier() ;", "function getIdentifier() ;", "function getIdentifier() ;", "public function getIdentifier(): string;", "public function getIdentifier(): string;", "public function getIdentifier()\n {\n // TODO: Implement getIdentifier() method.\n }" ]
[ "0.80312693", "0.8014722", "0.8014218", "0.8014218", "0.8014218", "0.8014218", "0.8014218", "0.80135", "0.80135", "0.7998252", "0.7998252", "0.7998252", "0.7998252", "0.7998252", "0.7998252", "0.7998252", "0.7998252", "0.7998252", "0.7962092", "0.7954783", "0.7890156", "0.7890156", "0.7722734", "0.7710018", "0.7702121", "0.7702121", "0.7699496", "0.76342916", "0.76342916", "0.7531337" ]
0.84006816
0
Add a version Mark this version as upgrade
public function add(string $version);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_version() {\n $installed = get_option( 'wd_academy_installed' );\n if ( $installed ) {\n update_option( 'wd_academy_installed', time() );\n }\n update_option( 'wd_academy_version', WD_ACADEMY_VERSION );\n }", "public function upgrade () {\r\n }", "protected function incrementVersion(): void\n {\n $version = $this->getVersion() + 1;\n\n $this->store->forever($this->getCacheVersionKey(), $version);\n\n static::$versions[$this->prefix] = $version;\n }", "public function setVersion($version) {}", "public function setVersion($version) {}", "protected function whenNewVersionWasRequested()\n {\n }", "function add_new_version( $version ) {\n\t$sql = \"INSERT INTO movie_versions (version_name) VALUES (\".\n\t\t\tformat_sql( $version ) . \n\t\t\t\")\";\n\t//echo $sql;\n\t$res = mysql_query( $sql );\n\tif ( $res ) {\n\t\treturn TRUE;\n\t} else {\n\t\treturn FALSE;\n\t}\n}", "public function setVersion($version);", "public function setVersion($version);", "public function setVersion($version);", "public function setVersion($version);", "public function setVersion($version);", "protected function _upgrade()\n {\n $this->helper->pluginBroker->callHook(\n 'upgrade', array('old_version' => self::$oldVersion), 'Neatline'\n );\n }", "public function setVersion(string $version);", "public function registerVersion() {\n $this->loadModel('Versions');\n $result = $this->Versions->newEntity();\n if ($this->request->is('post') || $this->request->is('put')) {\n $this->Versions->patchEntity($result, $this->request->data(), [\n 'validate' => 'adminAdd'\n ]);\n if ($this->Versions->save($result)) {\n $this->redirect(array('controller' => 'users', 'action' => 'version'));\n }\n }\n $this->set(compact('result'));\n }", "public function prependVersion(Version $version)\n {\n array_unshift($this->versions, $version);\n }", "private function _log_version_number () {\n update_option( $this->_token . '_version', $this->_version );\n }", "public function setVersion($version) {\n throw new \\BadFunctionCallException('Cannot set version number of graded version');\n }", "public function upgrade( $installed_version ) {\n\n\t\t$this->installed_version = $installed_version;\n\n\t\tadd_action( 'woocommerce_after_register_taxonomy', array( $this, 'delayed_upgrade' ) );\n\t}", "private function _log_version_number () {\n\t\tupdate_option( $this->_token . '_version', $this->_version );\n\t}", "protected function upgrade() {\r\n\t\tif (!$version = $this->ci->options->get('gw_users_version', false)) {\r\n\t\t\t$this->setup();\r\n\t\t}\r\n\t}", "private function setVersion($v){\n\t\t$this->version = $v;\n\t}", "public function upgrade($old_version)\r\n\t{\r\n\t\t// Upgrade Logic\r\n\t\treturn true;\r\n\t}", "public function addComponentToCheck($name, $version)\n {\n $this->componentsToCheck[$name] = $version;\n }", "public function upgrade(){\n \n global $DB;\n \n $return = true;\n $version = $this->version; # This is the current DB version we will be using to upgrade from \n\n \n if ($version < 2013102401)\n {\n \n $DB->insert_record(\"lbp_plugin_report_elements\", array(\"pluginid\" => $this->id, \"getstringname\" => \"reports:bcgt_target_grades:aspgrades\", \"getstringcomponent\" => \"block_bcgt\"));\n $this->version = 2013102401;\n $this->updatePlugin();\n \\mtrace(\"## Inserted plugin_report_element data for plugin: {$this->title}\");\n \n }\n \n if ($version < 2014012402)\n {\n $DB->insert_record(\"lbp_plugin_report_elements\", array(\"pluginid\" => $this->id, \"getstringname\" => \"reports:bcgt_target_grades:percentwithaspgrades\", \"getstringcomponent\" => \"block_bcgt\"));\n $this->version = 2014012402;\n $this->updatePlugin();\n \\mtrace(\"## Inserted plugin_report_element data for plugin: {$this->title}\");\n }\n \n \n return $return; # Never actually seems to change..\n \n \n }", "public function increment($var,$version)\n {\n $this->redis->set($var,$version);\n }", "public function setVersion($name) {\n\n // Take what is the $current variable and copy it into an entry in\n // the versions variable.\n $this->versions[$name] = $this->current;\n }", "public function updateDatabase($version) {\n\t\t$installedVersion = get_option(UserAgentThemeSwitcherData::VERSION_KEY, 0);\n\n\t\tif($installedVersion == 0) {\n\t\t\t$this->createDatabase($version);\n\t\t}\n\n\t\tif($installedVersion != $version) {\n\t\t\tif($version != 0) {\n\t\t\t\tadd_option(UserAgentThemeSwitcherData::VERSION_KEY, $version);\n\t\t\t}\n\t\t}\n\t}", "function updateVersion() {\n\t\tif ($this->newVersion->compare($this->currentVersion) > 0) {\n\t\t\t$versionDao =& DAORegistry::getDAO('VersionDAO');\n\t\t\tif (!$versionDao->insertVersion($this->newVersion)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$result = true;\n\t\tHookRegistry::call('Installer::updateVersion', array(&$this, &$result));\n\n\t\treturn $result;\n\t}", "public function setVersion($version)\n {\n $this->version = $version;\n }" ]
[ "0.6990274", "0.6209433", "0.6165426", "0.6125037", "0.6125037", "0.60869944", "0.6077672", "0.60432667", "0.60432667", "0.60432667", "0.60432667", "0.60432667", "0.5943941", "0.5942448", "0.592736", "0.5889506", "0.5815514", "0.5784992", "0.5761434", "0.57479626", "0.5715671", "0.5694075", "0.56812245", "0.5664076", "0.56574893", "0.5606888", "0.5606879", "0.5603481", "0.5602644", "0.5595461" ]
0.7515287
0
Remove a version Mark this version as downgrade
public function remove(string $version);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function uninstall()\n {\n\n $this->markUninstalled();\n //or call parent::uninstall(); \n }", "function bft_remove_version() {\n\treturn '';\n}", "function pramble_remove_version(){\n\t\t\t\treturn '';\n\t\t\t}", "public function uninstall();", "public function uninstall();", "function uninstall(){}", "function dimaan_remove_version() { return ''; }", "public function uninstall() {\n\n\n }", "function wpb_remove_version() {\nreturn '';\n}", "public function uninstall(): void\n {\n $this->output(\"TODO: Drop the journal table, remove the files and show the composer command to remove the package\");\n exit;\n }", "public function uninstall(){\n\t\t$this->_uninstall();\n\t\t$model = $this->getCounterpartModel();\n\n\t\tif( $model->getConfigValue( 'uninstall_clear_db' ) ) {\n\t\t\t$this->_uninstallDb();\n\t\t}\n\t\tif( $model->getConfigValue( 'uninstall_clear_settings' ) ) {\n\t\t\t$this->_uninstallSettings();\n\t\t}\n\n\t\t//mark the extension as uninstalled\n\t\t//better to use editSetting - since there is may be no 'installed' value in config after uninstall\n\t\tAdvertikon::getExtendedModel( 'setting_setting' )->editSettingValue( 'installed' , 0 );\n\t}", "function wpb_remove_version() {\r\n return '';\r\n}", "private function down($version)\n {\n $sql = sprintf('DELETE FROM schema_migration WHERE version = \\'%s\\'', $version);\n $this->connection->execute($sql);\n }", "function wpb_remove_version() {\n return '';\n}", "public static function uninstall() {\n\t\t}", "function complete_version_removal() { return ''; }", "public function uninstall()\n {\n }", "public function uninstall()\n {\n }", "function uninstall() {\n\t}", "function wpversion_remove_version() {\n return '';\n }", "public static function uninstall(){\n }", "public static function uninstall() {\n\n\t}", "function uninstall(){\n\n }", "public function uninstall()\n\t{\n\t\treturn true;\n\t}", "public function uninstall() {\n\t\tdelete_option('hotlink-no-more');\n\t}", "function version_unregister($module, &$content)\n{\n $install_file = PHPWS_SOURCE_DIR . 'mod/' . $module . '/boost/install.sql';\n\n if (!is_file($install_file)) {\n return;\n }\n\n $install_sql = file($install_file);\n\n if (empty($install_file)) {\n return;\n }\n\n foreach ($install_sql as $sql) {\n if (!preg_match('/^create /i', $sql)) {\n continue;\n }\n\n $table_name = PHPWS_DB::extractTableName($sql);\n\n if (empty($table_name)) {\n continue;\n }\n\n $version_table = $table_name . '_version';\n $version_table_seq = $version_table . '_seq';\n\n if (!PHPWS_DB::isTable($version_table)) {\n continue;\n }\n\n $result = PHPWS_DB::dropTable($version_table);\n if (PHPWS_Error::isError($result)) {\n PHPWS_Error::log($result);\n $content[] = dgettext('version', 'There was an error removing a version table.');\n } else {\n $content[] = sprintf(dgettext('version', 'Version table removed: %s'), $version_table);\n }\n }\n}", "function startertheme_remove_version() {\nreturn '';\n}", "public function delete()\n {\n foreach ($this->versions as $version)\n {\n $version->delete();\n }\n\n parent::delete();\n }", "function uninstall()\n {\n \t// For now nothing in unistall, because we don't want user lose the data. \n }", "public static function drop()\n {\n global $wpdb;\n $tableName = static::getTableName($wpdb->prefix);\n\n $sql = \"DROP TABLE IF EXISTS $tableName;\";\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n\n $wpdb->query($sql);\n \\delete_option($tableName . '_version');\n }" ]
[ "0.65213996", "0.6320239", "0.6307188", "0.62853426", "0.62853426", "0.61895514", "0.6139495", "0.613305", "0.60173833", "0.60069394", "0.6003697", "0.598573", "0.5975026", "0.59682363", "0.59232265", "0.5914587", "0.59127164", "0.59127164", "0.591234", "0.58904654", "0.58347124", "0.5826518", "0.5809069", "0.58056515", "0.5803643", "0.57798964", "0.57770365", "0.57727474", "0.57671964", "0.57616687" ]
0.710458
0
select db and tb
final public function select($db, $tb) { $this->db = $db; $this->tb = $tb; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function select_db($dbname);", "public function pick_db($db)\n\t\t{\t$this->db = $db\n\t\t}", "public function selectDb($dbName) {}", "public function select($db, $dbh = \\null)\n {\n }", "public function sql_select_db() {}", "public function sql_select_db() {}", "public function sacarmonbredb($tb,$dbt,$id){\n\t\t\t$db=Db::conectar();\n\t\t\t$select=$db->prepare('SELECT '.$tb.' FROM '.$dbt.' WHERE '.$id.'');\n\t\t\t$select->execute();\n\t\t\twhile ($registro=$select->fetch()){\n\t\t\treturn $registro;\n }\n Db::desconectar();\t\t\t\t\n\t\t}", "abstract public function getSelectedDatabase();", "public function selectDB( $db ) {\n\t\t# Stub. Shouldn't cause serious problems if it's not overridden, but\n\t\t# if your database engine supports a concept similar to MySQL's\n\t\t# databases you may as well.\n\t\t$this->mDBname = $db;\n\n\t\treturn true;\n\t}", "function select($tbl = \"\", $eq = array(\"\", \"\"))\n\t{\n\t\t($eq[0] !== \"\" && $eq[1] !== \"\") ? $sql = \"SELECT * FROM $tbl WHERE \" . $eq[0] . \" = ?\" : $sql = \"SELECT * FROM $tbl\";\n\t\t\n\t\t$stmt = $this->db->prepare($sql);\n\t\t\n\t\t($eq[0] !== \"\" && $eq[1] !== \"\") ? $stmt->execute(array(\n\t\t\t$eq[1]\n\t\t)) : $stmt->execute(array());\n\t\t\n\t\treturn $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\t}", "function use_db($data1){\n\t\tglobal $i18n_std;\n\t\tif(!$this->real_select($data1)){\n\t\t\techo('no db connection:'.$data1.' ('.$this->real_error().') engine='.$this->engine_name);\n\t\t\t//.'cwd='.getcwd()\n\t\t\tdie('');\n\t\t}\n\t}", "abstract public function selectDatabase($name);", "function select($db, $dbh = null){\n\t\tif (is_null($dbh)){\n\t\t\t$dbh = $this->dbh;\n\t\t}\n\t\tif (!@mysql_select_db( $db, $dbh )){\n\t\t\t$this->ready = false;\n\t\t\t$error_message = sprintf(SQ_DB_SELECT_TABLE_ERROR_MESSAGE, $db);\n\t\t\tthrow new SQ_Exception($message, SQ_DB_SELECT_TABLE_ERROR_CODE);\n\t\t}\n\t}", "function select_db($base_datos) {\r\n\t\t//\"implementado en la clase <i>\" . get_class($this) . \"</i></h1>\";\r\n\t\treturn FALSE;\r\n\t}", "final public function db($db)\r\n\t{ //select db\r\n\r\n\t\t$this->db = $db;\r\n\t}", "private function selectDB($link)\n\t{\n\t\t$db_selected = mysqli_select_db($link,MYSQL_DATABASE);\n\t\tif (!$db_selected) \n\t\t{\n\t\t\treturn $link;\n\t\t}\n\t\telse if(!$db_selected)\n\t\t{\n\t\t\tthrow new Exception('could not select db',1);\n\t\t}\n\t\t//else if() reviso si tiene tablas para la bd que queremos probar\n\n\t}", "function SelectDB($dbname)\n\t{\n\t\t$this->database = $dbName;\n\t\t$this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions\n\t\tif ($this->connectionID) {\n $rs = $this->Execute('USE '.$dbName); \n if($rs) {\n return true;\n } else return false;\t\t\n\t\t}\n\t\telse return false;\t\n\t}", "function wrapper_select_db($dbname) {\n\t\treturn $this->functions['select_db']($dbname, $this->link_id);\n\t}", "function select($db) {\n\t\t\tif (!$this->dbh) $this->connect();\n\t\t\tif ( !@mysql_select_db($db,$this->dbh)) {\n\t\t\t\t$this->print_error(\"<ol><b>Error selecting database <u>$db</u>!</b><li>Are you sure it exists?<li>Are you sure there is a valid database connection?</ol>\");\n\t\t\t}\n\t\t}", "public function select_db($db)\n {\n $this->dbname = $db;\n return $this;\n }", "function get_sql_combo() {\n try {\n $app = Slim\\Slim::getInstance();\n $table = $app->request->params('table_name');\n\n $gii = new easyuigii();\n $gii->set_db_setting();\n $model_combo = $gii->get_table_model_from_db($table);\n $data = $gii->get_sql_for_select($table, $model_combo);\n\n $app->render(200, ['success' => true, 'sql' => $data]);\n } catch (Exception $e) {\n $app->render(200, ['isError' => true, 'msg' => $e->getMessage()]);\n error_log(LogTime() . 'error - get sql for combo' . PHP_EOL, 3, 'logs/error.log');\n }\n}", "public function selected(?string $table = null): bool\n {\n global $dbs;\n\n $database = (function() use ($dbs) {\n return (isset($_GET['db']) AND $dbs[$_GET['db']] == $this) ? true : false;\n })();\n\n if (null === $table)\n return $database;\n\n return (isset($_GET['table']) AND $_GET['table'] == $table) ? true : false;\n }", "public function do_select_db($table, $clm, $ac)\n\t{\n\t\ttry { \n\t\t\t$log_data = null;\n\t\t\t$stmt = $this->conn->prepare(\"SELECT * FROM \".$table.\" WHERE \".$clm.\"=:\".$clm.\"\");\n\t\t\t$stmt->execute(array(':'.$clm=>$ac));\n\t\t\tif ($stmt->rowCount() == 1) {\n\t\t\t\t$result_row=$stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\t\t$select_status = $result_row;\n\t\t\t\t$log_data = \"successfully selected\";\n\t\t\t}\n\t\t\telse if ($stmt->rowCount() == 0) {\n\t\t\t\t$select_status = 'wrong';\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch (PDOException $e) {\n\t\t\t$select_status = 'error';\n\t\t\t$log_data = \"\".$e->getMessage().\"\".CONFIG::NEWLINE_ERROR.\"|\";\n\t\t}\n\t\treturn array($log_data, $select_status);\n\t}", "function select($selection,$db) {\n\n\t\t$conn = new mysqli('localhost','id6847947_tadas','322559',$db);\n\n\n\tif ($conn->connect_error) {\n\t\tdie(\"Connection failed: \" . $conn->connect_error);\n\t} \n\n\t$result = $conn->query($selection);\n\treturn $result;\n}", "function m_seleBD(){\n\t\tmysql_select_db($this->a_nomBD, $this->a_conexion);\n\t}", "public function select_db($dbname){\n $errormsg='';\n if (!$dbname)\n $errormsg=self::$_error_code_list[8];\n if(!$this->_db_exists($dbname))\n $errormsg=sprintf (self::$_error_code_list[9],$dbname);\n if($errormsg){\n $this->_trigger_error($errormsg);\n return FALSE;\n }\n $this->_currentDB=$dbname;\n return TRUE;\n }", "function db_select($table, $column, $group, $ret)\n {\n $result = null;\n global $db_is_connected, $db;\n\t\tif (!$db_is_connected)\n\t\t{\n\t\t\tdb_connnect();\n\t\t}\n if (!$db_is_connected)\n {\t\n consol_message(\"Error: Could not connect to database.\");\n return FALSE;\n }else{\n $query = \"SELECT $column FROM $table $group;\";\n $rslt = $db->query($query);\n if (!$rslt)\n {\n consol_message($query.\" isn't correct .\");\n return FALSE;\n }else{\n while ($row = $rslt->fetch_assoc()) {\n $result[] = $row[\"$ret\"];\n }\n return $result;\n }\n }\n return FALSE;\n }", "public function select($database)\n\t{\n\t\treturn true;\n\t}", "function sql_select_db($db,&$dbh=NULL)\n {\n global $MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWORD, $MYSQL_DATABASE, $MYSQL_CONN, $MYSQL_HANDLER, $SQL_DBH;\n global $CONF;\n//echo '<hr />'.print_r($dbh,true).'<hr />';\n//exit;\n if ( !is_null($dbh) )\n {\n if ($dbh->exec(\"USE $db\") !== false)\n return 1;\n return 0;\n }\n\n try\n {\n $SQL_DBH = NULL;\n list($host,$port) = explode(\":\",$MYSQL_HOST);\n if (isset($port)) {\n $portnum = $port;\n $port = ';port='.trim($port);\n }\n else {\n $port = '';\n $portnum = '';\n }\n //$SQL_DBH = new PDO($MYSQL_HANDLER[1].':host='.trim($host).$port.';dbname='.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n //$SQL_DBH = sql_connect();\n switch ($MYSQL_HANDLER[1]) {\n case 'sybase':\n case 'dblib':\n if (is_numeric($portnum)) $port = ':'.intval($portnum);\n else $port = '';\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':host='.$host.$port.';dbname='.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n break;\n case 'mssql':\n if (is_numeric($portnum)) $port = ','.intval($portnum);\n else $port = '';\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':host='.$host.$port.';dbname='.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n break;\n case 'oci':\n if (is_numeric($portnum)) $port = ':'.intval($portnum);\n else $port = '';\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':dbname=//'.$host.$port.'/'.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n break;\n case 'odbc':\n if (is_numeric($portnum)) $port = ';PORT='.intval($portnum);\n else $port = '';\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':DRIVER={IBM DB2 ODBC DRIVER};HOSTNAME='.$host.$port.';DATABASE='.$db.';PROTOCOL=TCPIP;UID='.$MYSQL_USER.';PWD='.$MYSQL_PASSWORD);\n break;\n case 'pgsql':\n if (is_numeric($portnum)) $port = ';port='.intval($portnum);\n else $port = '';\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':host='.$host.$port.';dbname='.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n break;\n case 'sqlite':\n if (is_numeric($portnum)) $port = ':'.intval($portnum);\n else $port = '';\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':'.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n break;\n case 'sqlite2':\n trigger_error(\"Critical Error : sqlite2 driver is not suported. \", E_USER_ERROR);\n break;\n default:\n //mysql\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':host='.$host.$port.';dbname='.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n break;\n }\n return 1;\n }\n catch (PDOException $e)\n {\n if ($CONF['debug'])\n $msg = '<p>a3 Error!: ' . $e->getMessage() . '</p>';\n else\n {\n $msg = '<p>a3 Error!: ';\n $pattern = '/(Access denied for user|Unknown database)/i';\n if (preg_match($pattern, $e->getMessage(), $m))\n $msg .= $m[1];\n $msg .= '</p>';\n }\n startUpError($msg, 'Connect Error');\n return 0;\n }\n }", "function testDBSelect() {\r\n\t$db = MetadataDB::getInstance();\r\n\t// error in sql...\r\n\t$sql = 'select varable from metadata';\r\n\t$result = $db->select($sql);\r\n\tif (!$result) {\r\n\t} else {\r\n\t\t//print 'All OK!';\r\n\t}\r\n}" ]
[ "0.6528299", "0.6523396", "0.6441326", "0.6288948", "0.62825274", "0.6281867", "0.62785035", "0.6225119", "0.61457175", "0.61379474", "0.6058814", "0.60488206", "0.6018403", "0.6014407", "0.59870315", "0.5964312", "0.5956833", "0.59456414", "0.5869428", "0.58607244", "0.57583016", "0.5716278", "0.57056075", "0.565631", "0.56534374", "0.5633263", "0.561958", "0.5602415", "0.55818355", "0.55693704" ]
0.7610733
0
Return an instance of DOMDocument constructed with the property of results
protected function getDom() { if (! isset($this->dom)) { $dom = new DOMDocument(); if (is_null($this->getResults())) { throw new \RuntimeException('There doesnt appear to be any results to load'); } // suppress warning but throw Exception if (! @$dom->loadXML($this->getResults())) { throw new \RuntimeException('Could not load results into DOMDocument'); } $this->dom = $dom; } return $this->dom; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function createDomDocument()\n {\n $document = new DOMDocument('1.0', 'utf-8');\n $document->preserveWhiteSpace = false;\n $document->formatOutput = true;\n\n return $document;\n }", "private static function createDomDocument()\n {\n $document = new DOMDocument('1.0', 'utf-8');\n $document->preserveWhiteSpace = false;\n $document->formatOutput = true;\n\n return $document;\n }", "public function executeDom()\n {\n $xml = $this->execute();\n\n // create new DOMDocument and load the response text.\n $dom = new \\DOMDocument();\n $dom->loadXML($xml);\n\n return $dom;\n }", "public function createQuery() {\n return new XML\\DOM();\n }", "public function getDomDocument() {}", "public function getDOMDocumentObject() {\n if (!(isset($this->_domDocument) && $this->_domDocument instanceof DOMDocument)) {\n $this->_domDocument = new DOMDocument;\n $this->_domDocument->preserveWhiteSpace = FALSE;\n }\n return $this->_domDocument;\n }", "public function toDomDocument() : DOMDocument\n {\n $document = new DOMDocument();\n $document->appendChild($this->toDomElement($document));\n return $document;\n }", "protected function load_dom()\n\t{\n\t\tif ($this->dom)\n\t\t{\n\t\t\treturn $this->dom;\n\t\t}\n\n\t\t$output = $this->ci->output->get_output();\n\n\t\t$this->dom = new DOMDocument;\n\t\tlibxml_use_internal_errors(TRUE);\n\t\t$this->dom->loadHTML($output);\n\t\tlibxml_clear_errors();\n\n\t\treturn $this->dom;\n\t}", "public function getDOMDocument(): DOMDocument\n {\n $dom = new DOMDocument();\n\n $dom->loadXML($this->document);\n return $dom;\n }", "public function createXmlDocument()\n {\n $dom = new \\DOMDocument('1.0');\n $dom->formatOutput = true;\n\n return $dom;\n }", "public function __construct (DOMDocument $doc) {}", "public function __construct(DomDocument $dom) {\n $this->totalResultsAvailable = (int) $dom->documentElement->getAttribute('totalResultsAvailable');\n $this->totalResultsReturned = (int) $dom->documentElement->getAttribute('totalResultsReturned');\n $this->firstResultPosition = (int) $dom->documentElement->getAttribute('firstResultPosition');\n\n $this->_dom = $dom;\n \t$this->_xpath = new DOMXPath($dom);\n\n \t$this->_xpath->registerNamespace(\"yh\", $this->_namespace);\n\n \t$this->_results = $this->_xpath->query(\"//yh:Result\");\n }", "public static function from_dom(DOMElement $dom) {\n\t\t$xrd = new XRD();\n\n\t\tforeach ($dom->childNodes as $node) {\n\t\t\tif (!isset($node->tagName)) continue;\n\n\t\t\tswitch($node->tagName) {\n\t\t\t\tcase 'Expires':\n\t\t\t\t\t$xrd->expires = $node->nodeValue;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Subject':\n\t\t\t\t\t$xrd->subject = $node->nodeValue;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Alias':\n\t\t\t\t\t$xrd->alias[] = $node->nodeValue;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Property':\n\t\t\t\t\t$property = XRD_Property::from_dom($node);\n\t\t\t\t\t$xrd->property[] = $property;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Link':\n\t\t\t\t\t$link = XRD_Link::from_dom($node);\n\t\t\t\t\t$xrd->link[] = $link;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $xrd;\n\t}", "public function create($source) {\n $markup = $this->markupProvider->getMarkup($source);\n $domDocument = new DOMDocument();\n $domDocument->formatOutput=false;\n $domDocument->preserveWhiteSpace=false;\n @$domDocument->loadHTML($markup, LIBXML_HTML_NODEFDTD);\n return $domDocument;\n }", "public function toDOM() {\n\t\treturn self::hashToDomDocument($this->toHash(), 'Factuurmaand');\n\t}", "public function to_dom($dom = null) {\n\t\tif ($dom == null) {\n\t\t\t$dom = new DOMDocument();\n\t\t}\n\n\t\t$xrd_dom = $dom->createElementNS(XRD::XML_NS, 'XRD');\n\t\t$dom->appendChild($xrd_dom);\n\n\t\tif ($this->expires) {\n\t\t\t$expires_dom = $dom->createElement('Expires', $this->expires);\n\t\t\t$xrd_dom->appendChild($expires_dom);\n\t\t}\n\n\t\tif ($this->subject) {\n\t\t\t$subject_dom = $dom->createElement('Subject', $this->subject);\n\t\t\t$xrd_dom->appendChild($subject_dom);\n\t\t}\n\n\t\tforeach ($this->alias as $alias) {\n\t\t\t$alias_dom = $dom->createElement('Alias', $alias);\n\t\t\t$xrd_dom->appendChild($alias_dom);\n\t\t}\n\n\t\tforeach ($this->property as $property) {\n\t\t\t$property_dom = $property->to_dom($dom);\n\t\t\t$xrd_dom->appendChild($property_dom);\n\t\t}\n\n\t\tforeach ($this->link as $link) {\n\t\t\t$link_dom = $link->to_dom($dom);\n\t\t\t$xrd_dom->appendChild($link_dom);\n\t\t}\n\n\t\treturn $dom;\n\t}", "public function __construct(DOMElement $result)\n {\n $this->_fields = ['Summary', 'MimeType', 'ModificationDate'];\n parent::__construct($result);\n\n $this->_xpath = new DOMXPath($result->ownerDocument);\n $this->_xpath->registerNamespace('yh', $this->_namespace);\n\n // check if the cache section exists\n $cacheUrl = $this->_xpath->query('./yh:Cache/yh:Url/text()', $result)->item(0);\n if ($cacheUrl instanceof DOMNode)\n {\n $this->CacheUrl = $cacheUrl->data;\n }\n $cacheSize = $this->_xpath->query('./yh:Cache/yh:Size/text()', $result)->item(0);\n if ($cacheSize instanceof DOMNode)\n {\n $this->CacheSize = (int) $cacheSize->data;\n }\n }", "public function getDocument(): Document {\n $document = new Document($this->_document->xmlVersion, $this->_document->xmlEncoding);\n foreach ($this->_document->childNodes as $node) {\n $this->addNode($document, $node);\n }\n return $document;\n }", "public function __toDOM() {\n // Basically, use a JSX-ish syntax to do so and just\n // return the DOM fragment that had been built.\n // A DOM interpreter will turn that into an actual HTML\n // output. Something that could be used here is caching, where\n // a presenter could mark itself as being cacheable OR it\n // could dynamicaly allocate cached states of itself and just skip\n // processing itself entirely. It may only do so for fragments within too.\n return (<div class=\"articles\">\n // ...\n </div>);\n }", "public function __construct (DomDocument $doc) {}", "protected function createResultObject() {\n\t\t$result = new Result();\n\t\treturn $result;\n\t}", "public function getDocument() {\n $document = new Document();\n $document->registerNamespace('json', self::XMLNS_JSONX);\n $this->addNode($document, $this->_document->documentElement);\n return $document;\n }", "function htmlSoupToDOMDocument($html, $logPrefix = null) {\n $prevUseExtErrorsVal = libxml_use_internal_errors(true);\n\n $dom = new DOMDocument();\n $dom->loadHTML($html);\n\n # Output (if requested) and then clear the errors that libxml produced...\n if ($logPrefix !== null) {\n # TODO: We should not be directly accessing logging library here!\n foreach (libxml_get_errors() as $error) warn($logPrefix . \": \" . trim($error->message));\n }\n libxml_clear_errors();\n\n libxml_use_internal_errors($prevUseExtErrorsVal);\n return $dom;\n}", "private static function getDoc()\r\n {\r\n if (self::$docXML == null) {\r\n self::$docXML = new \\DOMDocument();\r\n self::$docXML->load(XML_SLIDER);\r\n }\r\n \r\n return self::$docXML;\r\n }", "protected function _as_doc($result){\n return new CouchDocument($this, $result);\n }", "private function createXmlDocument($html)\n {\n $xmlDocument = new \\DOMDocument;\n $xmlDocument->strictErrorChecking = false;\n $xmlDocument->formatOutput = true;\n $libXmlState = libxml_use_internal_errors(true);\n $xmlDocument->loadHTML($this->unifyHtml($html));\n libxml_clear_errors();\n libxml_use_internal_errors($libXmlState);\n\n $this->ensureExistenceOfBodyElement($xmlDocument);\n\n return $xmlDocument;\n }", "public function getDomDocument()\n {\n return $this->xmlDocument;\n }", "private function getNodesFromQueryResult($propResult, $node=null){\t\n\t\tif(is_array($propResult)){\n\t\t\tforeach ($propResult as $value){\n\t\t\t\t $values[] = new Node($value['fulltext'], $value['fullurl'], $node);\n\t\t\t}\n\t\t}\n\t\treturn $values;\n\t}", "public function toDOM() {\n\t\treturn self::hashToDomDocument($this->toHash(), 'Representacions');\n\t}", "protected function dom_init() {\r\n\t\t\r\n\t\t// severe hack!\r\n\t\t//$this->code = preg_replace(' xmlns=\"[^\"]*?\"', '', $this->code);\r\n\t\t/*print('XXX9o9beep19o9XXX\r\n');\r\n\t\tprint('$this->code in dom_init: ' . $this->code);\r\n\t\tprint('\r\nXXX9o9beep29o9XXX\r\n');*/\r\n\t\tif($this->dom) {\r\n\t\t\treturn $this->xpath_init();\r\n\t\t}\r\n\t\tif($this->xpath) {\r\n\t\t\t$this->xpath = false;\r\n\t\t}\r\n\t\t// HTML5?\r\n\t\tif($this->config['use_local_DTD']) {\r\n\t\t\tpreg_match('/(<!DOCTYPE\\s*html\\s*PUBLIC\\s*\"[^\"]*\"\\s*\")([^\"]*)(\">)/is', $this->code, $matches);\r\n\t\t\t$this->temp_DTD_file = $matches[2];\r\n\t\t\t$this->code = str_replace($matches[1] . $matches[2] . $matches[3], $matches[1] . DTD::getDTDfile() . $matches[3], $this->code);\r\n\t\t}\r\n\t\t//print('this->config[\\'encoding\\'] 1: ');var_dump($this->config['encoding']);\r\n\t\t//ReTidy::updateEncoding();\r\n\t\t//ReTidy::convert_to($this->config['encoding']);\r\n\t\t//print('this->config[\\'encoding\\'] 2: ');var_dump($this->config['encoding']);\r\n\t\t//$this->dom = new DOMDocument('1.0', $this->config['encoding']);\r\n\t\t//$this->dom = new DOMDocument('1.0', $this->config['encoding']);\r\n\t\t$this->dom = new DOMDocument('1.0', 'utf-8');\r\n\t\tif(!$this->dom) {\r\n\t\t\t$this->logMsg(self::$lang['dom_init_error']);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$this->dom->resolveExternals = true;\r\n\t\t\r\n\t\t//$this->dom->preserveWhiteSpace = false;\r\n\t\tif(!$this->dom->loadXML($this->code)) {\r\n\t\t\t$this->dom->loadHTML($this->code);\r\n\t\t}\r\n\t\t//$this->dom->formatOutput = true;\r\n\t\t//if(isset($this->config['encoding'])) {\r\n\t\t//\t// this should be set by cleanCode\r\n\t\t//\t$this->dom->encoding = $this->config['encoding'];\r\n\t\t//} else {\r\n\t\t//\t$this->dom->encoding = 'iso-8859-1';\r\n\t\t//}\r\n\r\n\t\t$this->logMsg('dom_init = true');\r\n\t\treturn $this->xpath_init();\r\n\t}" ]
[ "0.6937923", "0.6937923", "0.68195045", "0.67717385", "0.66584253", "0.659529", "0.65547985", "0.6502658", "0.64987546", "0.6346673", "0.6260541", "0.61434364", "0.6108336", "0.6086359", "0.6032171", "0.6025498", "0.59359473", "0.58533907", "0.5848541", "0.58449787", "0.5841908", "0.5833102", "0.5783593", "0.5776076", "0.5773906", "0.5763467", "0.5756459", "0.5744123", "0.5732371", "0.57322514" ]
0.7134096
0
Return the XPath query string used to retrieved result class DOMNodes Template method. Calls for domListQuery which should be defined in subclasses from the DOMDocument
protected function getDomListQuery() { return $this->domListQuery; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createQuery() {\n return new XML\\DOM();\n }", "private function generateXpathQuery() {\n $parentElementClass = trim(Settings::get(\"main_class\"), \".\");\n $excludeProcessingClass = trim(Settings::get(\"exclude_class\"), \".\");\n\n $xQuery = \"\";\n if(!empty($parentElementClass)) {\n $xQuery .= \"//*[contains(@class, '\".$parentElementClass.\"')]\";\n }\n $xQuery .= \"//img\";\n\n if(!empty($excludeProcessingClass)){\n $xQuery .= \"[not(contains(@class, '\".$excludeProcessingClass.\"'))]\";\n }\n\n return $xQuery;\n }", "public function get($xpathQuery, \\DOMNode $contextnode = null);", "public function xpath() {\n return new DOMXPath($this);\n }", "protected function getDomList()\n {\n if (! isset($this->domList)) {\n $this->domList = $this->getXPath($this->getDom())->query($this->getDomListQuery());\n }\n return $this->domList;\n }", "public function query($query){\r\n return $this->xpath->evaluate($query);\r\n }", "protected function getXpathString() {\n return 'xpathparser:' . $this->getCounter();\n }", "public function findNodes($query)\n {\n $query = preg_replace('#/p:#', '/' . $this->_namespace_prefix, $query);\n return $this->_xpath->query($query);\n }", "protected function getXPath()\n {\n $xpath = parent::getXPath();\n $xpath->registerNamespace('m', OData::META);\n $xpath->registerNamespace('d', OData::DATA);\n\n return $xpath;\n }", "function xmllist() {\n\t\tglobal $mysql;\n\t\t$result[$this->class_name()] = $mysql->select(\"SELECT * FROM \".$this->class_name, true);\n\t\t$output = XML::get($result);\n\t\treturn xml($output);\n\t}", "public function getQuery() {\r\n\t\tif (null === $this->_query) {\r\n\t\t\trequire_once 'Zend/Dom/Query.php';\r\n\t\t\t$this->_query = new Zend_Dom_Query;\r\n\t\t}\r\n\t\treturn $this->_query;\r\n\t}", "public function getXpath()\n {\n if (null === $this->xpath) {\n $this->setXpath(new DOMXPath($this->getDomDocument()));\n }\n\n return $this->xpath;\n }", "function domdoctoxpath($domdocinput) {\n //local variables clean themselves up, no need to unset.\n $newdomdoc = new SmartDOMDocument();\n $newdomdoc->appendChild($newdomdoc->importNode($domdocinput, true));\n $newxpathtable = new DOMXPath($newdomdoc);\n //DEBUG $image = $newdomdoc->saveHTMLExact();echo($image);\n return $newxpathtable;\n}", "public function getNodeList($query,$doc)\n {\n $finder= new \\DomXPath($doc);\n $links = $finder->query($query);\n\n\n return $links;\n }", "public function query(string $query, DOMElement $context = null) : DOMNodeList {\n $xpath = new DOMXPath($this);\n foreach($this->namespaces as $prefix => $namespace) {\n $xpath->registerNamespace($prefix, $namespace);\n }\n\n /** @var DOMNodeList|bool $result */\n $result = $context !== null ? $xpath->query($query, $context) : $xpath->query($query);\n return $result instanceof DOMNodeList ? $result : new DOMNodeList();\n }", "function query_dom($query) {\n\t\t$xpath = new DOMXpath($this->dom);\n\t\t$id = $xpath->query($query);\n\t\tif ($id->length == 0)\n\t\t\t$id = null;\n\t\tif (isset ($id)) {\n\t\t\tforeach ($id as $handle) {\n\t\t\t\t$id = $handle->nodeValue;\n\t\t\t}\n\t\t}\n\t\treturn $id;\n\t}", "public function findNodesRelativeTo($query, $context)\n {\n $query = preg_replace('#/p:#', '/' . $this->_namespace_prefix, $query);\n return $this->_xpath->query($query, $context);\n }", "public static function pq($arg1, $context = null) {\n\t\tif ($arg1 instanceof DOMNODE && ! isset($context)) {\n\t\t\tforeach(phpQuery::$documents as $documentWrapper) {\n\t\t\t\t$compare = $arg1 instanceof DOMDocument\n\t\t\t\t\t? $arg1 : $arg1->ownerDocument;\n\t\t\t\tif ($documentWrapper->document->isSameNode($compare))\n\t\t\t\t\t$context = $documentWrapper->id;\n\t\t\t}\n\t\t}\n\t\tif (! $context) {\n\t\t\t$domId = self::$defaultDocumentID;\n\t\t\tif (! $domId)\n\t\t\t\tthrow new Exception(\"Can't use last created DOM, because there isn't any. Use phpQuery::newDocument() first.\");\n//\t\t} else if (is_object($context) && ($context instanceof PHPQUERY || is_subclass_of($context, 'phpQueryObject')))\n\t\t} else if (is_object($context) && $context instanceof phpQueryObject)\n\t\t\t$domId = $context->getDocumentID();\n\t\telse if ($context instanceof DOMDOCUMENT) {\n\t\t\t$domId = self::getDocumentID($context);\n\t\t\tif (! $domId) {\n\t\t\t\t//throw new Exception('Orphaned DOMDocument');\n\t\t\t\t$domId = self::newDocument($context)->getDocumentID();\n\t\t\t}\n\t\t} else if ($context instanceof DOMNODE) {\n\t\t\t$domId = self::getDocumentID($context);\n\t\t\tif (! $domId) {\n\t\t\t\tthrow new Exception('Orphaned DOMNode');\n//\t\t\t\t$domId = self::newDocument($context->ownerDocument);\n\t\t\t}\n\t\t} else\n\t\t\t$domId = $context;\n\t\tif ($arg1 instanceof phpQueryObject) {\n//\t\tif (is_object($arg1) && (get_class($arg1) == 'phpQueryObject' || $arg1 instanceof PHPQUERY || is_subclass_of($arg1, 'phpQueryObject'))) {\n\t\t\t/**\n\t\t\t * Return $arg1 or import $arg1 stack if document differs:\n\t\t\t * pq(pq('<div/>'))\n\t\t\t */\n\t\t\tif ($arg1->getDocumentID() == $domId)\n\t\t\t\treturn $arg1;\n\t\t\t$class = get_class($arg1);\n\t\t\t// support inheritance by passing old object to overloaded constructor\n\t\t\t$phpQuery = $class != 'phpQuery'\n\t\t\t\t? new $class($arg1, $domId)\n\t\t\t\t: new phpQueryObject($domId);\n\t\t\t$phpQuery->elements = array();\n\t\t\tforeach($arg1->elements as $node)\n\t\t\t\t$phpQuery->elements[] = $phpQuery->document->importNode($node, true);\n\t\t\treturn $phpQuery;\n\t\t} else if ($arg1 instanceof DOMNODE || (is_array($arg1) && isset($arg1[0]) && $arg1[0] instanceof DOMNODE)) {\n\t\t\t/*\n\t\t\t * Wrap DOM nodes with phpQuery object, import into document when needed:\n\t\t\t * pq(array($domNode1, $domNode2))\n\t\t\t */\n\t\t\t$phpQuery = new phpQueryObject($domId);\n\t\t\tif (!($arg1 instanceof DOMNODELIST) && ! is_array($arg1))\n\t\t\t\t$arg1 = array($arg1);\n\t\t\t$phpQuery->elements = array();\n\t\t\tforeach($arg1 as $node) {\n\t\t\t\t$sameDocument = $node->ownerDocument instanceof DOMDOCUMENT\n\t\t\t\t\t&& ! $node->ownerDocument->isSameNode($phpQuery->document);\n\t\t\t\t$phpQuery->elements[] = $sameDocument\n\t\t\t\t\t? $phpQuery->document->importNode($node, true)\n\t\t\t\t\t: $node;\n\t\t\t}\n\t\t\treturn $phpQuery;\n\t\t} else if (self::isMarkup($arg1)) {\n\t\t\t/**\n\t\t\t * Import HTML:\n\t\t\t * pq('<div/>')\n\t\t\t */\n\t\t\t$phpQuery = new phpQueryObject($domId);\n\t\t\treturn $phpQuery->newInstance(\n\t\t\t\t$phpQuery->documentWrapper->import($arg1)\n\t\t\t);\n\t\t} else {\n\t\t\t/**\n\t\t\t * Run CSS query:\n\t\t\t * pq('div.myClass')\n\t\t\t */\n\t\t\t$phpQuery = new phpQueryObject($domId);\n//\t\t\tif ($context && ($context instanceof PHPQUERY || is_subclass_of($context, 'phpQueryObject')))\n\t\t\tif ($context && $context instanceof phpQueryObject)\n\t\t\t\t$phpQuery->elements = $context->elements;\n\t\t\telse if ($context && $context instanceof DOMNODELIST) {\n\t\t\t\t$phpQuery->elements = array();\n\t\t\t\tforeach($context as $node)\n\t\t\t\t\t$phpQuery->elements[] = $node;\n\t\t\t} else if ($context && $context instanceof DOMNODE)\n\t\t\t\t$phpQuery->elements = array($context);\n\t\t\treturn $phpQuery->find($arg1);\n\t\t}\n\t}", "function getNodeXPath( $node ) {\n\t\t\n\t\t$result='';\n\t\twhile ($parentNode = $node->parentNode) {\n\t\t\t$nodeIndex=-1;\n $nodeTagIndex=0;\n\t\t\tdo {\n $nodeIndex++;\n\t\t\t\t$testNode = $parentNode->childNodes->item( $nodeIndex );\n \n /**\n * This complex condition is because there is two html tags inside dom tree, one is empty!!\n */\n if ($testNode->nodeName==$node->nodeName and $testNode->parentNode->isSameNode($node->parentNode) and ($testNode->nodeName!='html' or $testNode->childNodes->length>0)) {\n $nodeTagIndex++;\n }\n \n\t\t\t} while (!$node->isSameNode($testNode));\n\n\t\t\t$result=\"/{$node->nodeName}[{$nodeTagIndex}]\".$result;\n\t\t\t$node=$parentNode;\n\t\t};\n\t\treturn $result;\n\t}", "function run ($query,$xml)\n{\n // GET AN ELEMENT\n if ($query['FROM'][0]==\"ROOT\" || $query['FROM'][0]==\"\")\n {\n $path=NULL;\n } \n else\n {\n $path=$query['FROM'][0];\n }\n // GET AN ATTRIBUTTE\n if(!empty($query['FROM'][1]))\n {\n $path=$path.\".{$query[\"FROM\"][1]}\";\n }\n $xml=my_xpath($path,$xml);\n\n if(!empty($xml))\n {\n $xml=$xml[0];\n }\n else\n return (string) NULL;\n\n // SELECT ELEMENT from FROM\n $path=$query['SELECT'];\n $xml=my_xpath($path,$xml);\n\n if(empty($xml))\n {\n return (string)NULL;\n }\n else\n {\n if(empty($query['WHERE']))\n {\n $result=$xml;\n }\n else\n {\n // WHERE\n if(empty($query['WHERE'][0]))\n {\n $path=NULL;\n }\n else\n {\n $path=$query['WHERE'][0];\n }\n\n if(!empty($query['WHERE'][1]))\n {\n $path=$path.\".{$query[\"WHERE\"][1]}\";\n }\n $result=array();\n \n foreach($xml as $element)\n {\n $flag=0;\n $validity=false;\n\n if(!empty($query['WHERE'][1]))\n {\n $tmp_array=array_keys((array)$element);\n foreach ($tmp_array as $key) {\n if(strcmp($key, \"@attributes\")==0)\n {\n $data=(array)$element;\n $data=$data[\"@attributes\"];\n if(array_key_exists($query['WHERE'][1], $data))\n {\n $flag=1;\n $part_item=$data[$query['WHERE'][1]];\n }\n }\n }\n if(isset($query['WHERE'][0]) && $query['WHERE'][0] != \"\")\n {\n if(strcmp($query['WHERE'][0], $query['SELECT'])!=0)\n {\n $flag=0;\n }\n }\n }\n if($flag)\n {\n $validity=compare_operator($query,$part_item);\n }\n else\n {\n $final=my_xpath($path,$element);\n foreach ($final as $part_item) {\n $validity=compare_operator($query,$part_item);\n break;\n }\n }\n if($query['WHERE'][4]==true)\n {\n $validity=!$validity;\n }\n if(empty($query['WHERE'][1]))\n {\n $tmp_array=array_keys((array)$part_item);\n foreach ($tmp_array as $key) {\n if(!strcmp($key, \"@attributes\") && !is_int($key))\n {\n $validity=false;\n break;\n }\n }\n }\n if($validity)\n {\n array_push($result, $element);\n }\n }\n }\n }\n if(empty($result))\n {\n return (string)NULL;\n }\n if(isset($query['LIMIT']))\n {\n $result=array_slice($result, 0, $query['LIMIT']);\n }\n return $result;\n}", "protected function convertXPath($expr): string\n\t{\n\t\tif (str_starts_with($expr, 'starts-with'))\n\t\t{\n\t\t\treturn $this->convertStartsWithExpr($expr);\n\t\t}\n\n\t\t$replacements = [\n\t\t\t\"(^translate\\\\(@(\\\\w+),'(.)','(.)'\\\\))\" => '$$1|replace(\\'$2\\',\\'$3\\')',\n\n\t\t\t\"(^\\\\$(\\\\w+)(!=|(=))('.*')$)D\" => '$xf.options.s9e_MediaSites_$1$2$3$4',\n\t\t\t\"(^contains\\\\(\\\\$(\\\\w+,'[^']+')\\\\)$)D\" => 'contains($xf.options.s9e_MediaSites_$1)',\n\n\t\t\t'(^@(\\\\w+)$)D' => '$$1',\n\t\t\t\"(^@(\\\\w+)(='.*')$)D\" => '$$1=$2',\n\t\t\t'(^@(\\\\w+)>(\\\\d+)$)D' => '$$1>$2',\n\t\t\t'(^100\\\\*@height div@width$)D' => '100*$height/$width',\n\t\t\t'(^100\\\\*\\\\(@height\\\\+(\\\\d+)\\\\)div@width$)D' => '100*($height+$1)/$width',\n\t\t\t\"(^contains\\\\(@(\\\\w+,'[^']+')\\\\)$)D\" => 'contains($$1)',\n\t\t\t\"(^not\\\\(contains\\\\(@(\\\\w+,'[^']+')\\\\)\\\\)$)D\" => '!contains($$1)',\n\t\t\t\"(^@(\\\\w+) or ?contains\\\\(@(\\\\w+,'[^']+')\\\\)$)D\" => '$$1 or contains($$2)',\n\t\t\t\"(^@(\\\\w+) and ?contains\\\\(('[^']+'),@(\\\\w+)\\\\)$)D\" => '$$1 and contains($2,$$3)',\n\t\t\t\"(^@(\\\\w+) and@(\\\\w+)!=('[^']++')$)D\" => '$$1 and $$2!=$3',\n\n\t\t\t\"(^substring-after\\\\(@(\\\\w+),('[^']+')\\\\)$)\" => '$$1|split($2)|last()',\n\t\t\t\"(^substring-before\\\\(@(\\\\w+),('[^']+')\\\\)$)\" => '$$1|split($2)|first()',\n\t\t];\n\n\t\t$expr = html_entity_decode($expr);\n\t\t$expr = preg_replace(array_keys($replacements), array_values($replacements), $expr, -1, $cnt);\n\t\tif (!$cnt)\n\t\t{\n\t\t\tthrow new RuntimeException('Cannot convert ' . $expr);\n\t\t}\n\n\t\treturn $expr;\n\t}", "public function getType()\n {\n return 'xpath';\n }", "public function getTagsDropDownResultsXpath() {\n\t\t$resultXpath = $this->tagsSuggestDropDown .\n\t\t\t\"//ul[@class='select2-results']\" .\n\t\t\t\"//span\";\n\t\treturn $resultXpath;\n\t}", "function query(string $expression, ?\\DOMNode $contextNode = null, bool $registerNodeNs = true): \\DOMNodeList\n {\n if ($contextNode === null) {\n $contextNode = $this->getBody();\n\n // make sure the query is relative to the context node\n if ($expression !== '' && $expression[0] !== '.') {\n $expression = '.' . $expression;\n }\n }\n\n return parent::query($expression, $contextNode, $registerNodeNs);\n }", "public function xpath(): Xpath {\n if (\n $this->_xpath instanceof Xpath &&\n $this->_xpath->document === $this\n ) {\n return $this->_xpath;\n }\n $this->_xpath = new Xpath($this);\n foreach ($this->_namespaces as $prefix => $namespaceURI) {\n $this->_xpath->registerNamespace($prefix, $namespaceURI);\n }\n return $this->_xpath;\n }", "abstract protected function getQuery();", "function returnXPathObject($item)\n {\n $xmlPageDom = new DOMDocument(); // khoi tao DomDocument object\n libxml_use_internal_errors(true); // dom chuyen tu html5 -> html4\n @$xmlPageDom->loadHTML('<?xml encoding=\"utf-8\" ?>' . $item); // Loading html page\n $xmlPageXPath = new DOMXPath($xmlPageDom); // khoi tao XPath DOM object\n return $xmlPageXPath; // tra ve XPath object\n }", "protected function appendXPathOutput(DOMElement $parentNode, $expr)\n\t{\n\t\t$this->appendElement($parentNode, 'output', htmlspecialchars(trim($expr), ENT_COMPAT))\n\t\t ->setAttribute('type', 'xpath');\n\t}", "public abstract function get_query();", "abstract protected function getQueryIterator();" ]
[ "0.6341028", "0.6320869", "0.58280796", "0.56859773", "0.56746715", "0.565675", "0.55895334", "0.54552805", "0.54449564", "0.5404445", "0.5340602", "0.5239214", "0.521587", "0.5182041", "0.517856", "0.5127131", "0.5105987", "0.5102869", "0.5070465", "0.5064086", "0.50508446", "0.50214374", "0.50190604", "0.49975514", "0.49965283", "0.49835432", "0.49540564", "0.49462", "0.49345946", "0.4918386" ]
0.66692346
0
Return a DateTime instance containing the created attribute of the DOMDocument as returned from the web service
public function getCreated() { if (! isset($this->created)) { $this->created = new DateTime($this->getXPath($this->getDom())->query($this->getCreatedQuery())->item(0)->value); } return $this->created; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDate()\n {\n $yearconst = $this->getValue(self::XPATH_YEAR);\n $monthconst = $this->getValue(self::XPATH_MONTH);\n $dayconst = $this->getValue(self::XPATH_DAY);\n\n return $this->formateDate($yearconst, $monthconst, $dayconst);\n }", "public function getDateCreated() : DateTime\n {\n $rtn = $this->data['date_created'];\n\n if (!empty($rtn)) {\n $rtn = new DateTime($rtn);\n }\n\n return $rtn;\n }", "public function getDateTaken()\n {\n if (!isset($this->dateTaken)) {\n $this->dateTaken = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getDateTakenQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->dateTaken;\n }", "public function getDateCreated()\n {\n $rtn = $this->data['date_created'];\n\n if (!empty($rtn)) {\n $rtn = new \\DateTime($rtn);\n }\n\n return $rtn;\n }", "protected function _created()\n {\n $element = new Zend_Form_Element_Text('date_create');\n $element->setLabel('Date create')\n ->addValidator(new Zend_Validate_Date('Y-m-d H:i:s'));\n\n return $element;\n }", "public function getDateCreated();", "public function getCreatedDateTime()\n {\n if (array_key_exists(\"createdDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"createdDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"createdDateTime\"])) {\n return $this->_propDict[\"createdDateTime\"];\n } else {\n $this->_propDict[\"createdDateTime\"] = new \\DateTime($this->_propDict[\"createdDateTime\"]);\n return $this->_propDict[\"createdDateTime\"];\n }\n }\n return null;\n }", "public function getCreatedDateTime()\n {\n if (array_key_exists(\"createdDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"createdDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"createdDateTime\"])) {\n return $this->_propDict[\"createdDateTime\"];\n } else {\n $this->_propDict[\"createdDateTime\"] = new \\DateTime($this->_propDict[\"createdDateTime\"]);\n return $this->_propDict[\"createdDateTime\"];\n }\n }\n return null;\n }", "public function getCreatedDateTime()\n {\n if (array_key_exists(\"createdDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"createdDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"createdDateTime\"])) {\n return $this->_propDict[\"createdDateTime\"];\n } else {\n $this->_propDict[\"createdDateTime\"] = new \\DateTime($this->_propDict[\"createdDateTime\"]);\n return $this->_propDict[\"createdDateTime\"];\n }\n }\n return null;\n }", "public function getCreatedDateTime()\n {\n if (array_key_exists(\"createdDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"createdDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"createdDateTime\"])) {\n return $this->_propDict[\"createdDateTime\"];\n } else {\n $this->_propDict[\"createdDateTime\"] = new \\DateTime($this->_propDict[\"createdDateTime\"]);\n return $this->_propDict[\"createdDateTime\"];\n }\n }\n return null;\n }", "public function getCreatedDateTime()\n {\n if (array_key_exists(\"createdDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"createdDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"createdDateTime\"])) {\n return $this->_propDict[\"createdDateTime\"];\n } else {\n $this->_propDict[\"createdDateTime\"] = new \\DateTime($this->_propDict[\"createdDateTime\"]);\n return $this->_propDict[\"createdDateTime\"];\n }\n }\n return null;\n }", "public function getCreatedDateTime()\n {\n if (array_key_exists(\"createdDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"createdDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"createdDateTime\"])) {\n return $this->_propDict[\"createdDateTime\"];\n } else {\n $this->_propDict[\"createdDateTime\"] = new \\DateTime($this->_propDict[\"createdDateTime\"]);\n return $this->_propDict[\"createdDateTime\"];\n }\n }\n return null;\n }", "public function getCreatedDateTime()\n {\n if (array_key_exists(\"createdDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"createdDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"createdDateTime\"])) {\n return $this->_propDict[\"createdDateTime\"];\n } else {\n $this->_propDict[\"createdDateTime\"] = new \\DateTime($this->_propDict[\"createdDateTime\"]);\n return $this->_propDict[\"createdDateTime\"];\n }\n }\n return null;\n }", "public function getCreatedDateTime()\n {\n if (array_key_exists(\"createdDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"createdDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"createdDateTime\"])) {\n return $this->_propDict[\"createdDateTime\"];\n } else {\n $this->_propDict[\"createdDateTime\"] = new \\DateTime($this->_propDict[\"createdDateTime\"]);\n return $this->_propDict[\"createdDateTime\"];\n }\n }\n return null;\n }", "function the_date_xml()\n {\n }", "function getCreatedDate() {\n\t\treturn $this->_CreatedDate;\n\t}", "public function getCreated(): DateTime\n {\n return $this->created;\n }", "public function getDateCreated() {\r\n return $this->_date_created;\r\n }", "public function getCreated()\n {\n $date = $this->getEntityValue('created', 0);\n // The ISO8601 DateTime format is not compatible with ISO-8601, but is left this way for backward compatibility\n // reasons. Use DateTime::ATOM or DATE_ATOM for compatibility with ISO-8601 instead.\n // See http://php.net/manual/en/class.datetime.php\n $datetime = DateTime::createFromFormat(DateTime::ATOM, $date);\n\n return $datetime;\n }", "public function getDateCreated()\n {\n return $this->_DateCreated;\n }", "public function getDate_creation()\n {\n return $this->date_creation;\n }", "function getCreateDate() {\n\t\treturn $this->_CreateDate;\n\t}", "function getCreateDate() {\n\t\treturn $this->_CreateDate;\n\t}", "public function getDateCreate()\n\t{\n\t\treturn $this->dateCreate;\n\t}", "public function getDateCreated()\n {\n if (isset($this->data['CreatedDate'])) {\n return $this->data['CreatedDate'];\n } else {\n return false;\n }\n }", "public function _getCreatedOn() {\n\t\treturn $this->_createdOn;\n\t}", "public function getDateCreation()\n {\n return $this->date_creation;\n }", "function get_creation_date()\n\t{\n\t\treturn $this->creation_date;\n\t}", "public function getCreatedTime()\n {\n if (preg_match('/data-utime=\"(.+?)\"/', $this->body, $matches)) {\n return $matches[1];\n }\n\n return false;\n }", "public function getCreatedOn(): \\DateTime\n {\n return $this->createdOn;\n }" ]
[ "0.67757446", "0.6628347", "0.6293689", "0.6265451", "0.6250675", "0.6211613", "0.6206654", "0.6206654", "0.6206654", "0.6206654", "0.6206654", "0.6206654", "0.6206654", "0.6206654", "0.6135572", "0.61332995", "0.610985", "0.61069834", "0.60814273", "0.60775733", "0.6069899", "0.6064826", "0.6064826", "0.605501", "0.6054867", "0.6049929", "0.60454047", "0.60393333", "0.6022242", "0.6003466" ]
0.747618
0
Return the DOMXPath query string use to retrieve the ResultSet offset property
protected function getOffsetQuery() { return $this->offsetQuery; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function offsetGet($offset) \n\t{\n if($this->doc && $this->doc[$offset]->length > 0) return $this->doc[$offset];\n\t\telse return phpQuery::newDocument();\n }", "public function getOffset()\n {\n if (! isset($this->offset)) {\n $this->offset = (int)$this->getXPath($this->getDom())->query($this->getOffsetQuery())->item(0)->value;\n }\n return $this->offset;\n }", "public function offsetClause(){\n try {\n // Sparql11query.g:171:3: ( OFFSET INTEGER ) \n // Sparql11query.g:172:3: OFFSET INTEGER \n {\n $this->match($this->input,$this->getToken('OFFSET'),self::$FOLLOW_OFFSET_in_offsetClause612); \n $this->match($this->input,$this->getToken('INTEGER'),self::$FOLLOW_INTEGER_in_offsetClause614); \n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "private function _sql_offset() {\n\t\tif ( $this->limit && $this->offset ) {\n\t\t\treturn ' OFFSET '. $this->offset;\n\t\t}\n\t\telse {\n\t\t\treturn '';\n\t\t}\n\t}", "protected function getXpathString() {\n return 'xpathparser:' . $this->getCounter();\n }", "public function getXqueryCursor () {\n $this->xmldb->getCursor();\n }", "private function generateXpathQuery() {\n $parentElementClass = trim(Settings::get(\"main_class\"), \".\");\n $excludeProcessingClass = trim(Settings::get(\"exclude_class\"), \".\");\n\n $xQuery = \"\";\n if(!empty($parentElementClass)) {\n $xQuery .= \"//*[contains(@class, '\".$parentElementClass.\"')]\";\n }\n $xQuery .= \"//img\";\n\n if(!empty($excludeProcessingClass)){\n $xQuery .= \"[not(contains(@class, '\".$excludeProcessingClass.\"'))]\";\n }\n\n return $xQuery;\n }", "private function getPositionSubSql() {\n\t\t$table = $this->query->getTableMap()::TABLE_NAME;\n\t\t$col = Model::aliasproperty('id');\n\t\t$sql = \"SELECT $col, @rownum := @rownum + 1 AS position FROM $table\";\n\t\t$whereClause = $this->getWhereClauseString();\n\n\t\tif (empty($whereClause) === false) {\n\t\t\t$sql .= ' WHERE ' . $whereClause;\n\t\t}\n\t\treturn $sql;\n\t}", "private function getPositionSubSql() {\n\t\t$table = $this->query->getTableMap()::TABLE_NAME;\n\t\t$sql = \"SELECT Arcucustid, ar3pacctnbr, @rownum := @rownum + 1 AS position FROM $table\";\n\t\t$whereClause = $this->getWhereClauseString();\n\t\tif (empty($whereClause) === false) {\n\t\t\t$sql .= ' WHERE ' . $whereClause;\n\t\t}\n\t\treturn $sql;\n\t}", "private function query($offset, $row_count=1) {\n\t\treturn $this->db->query(\"SELECT {$this->expr} FROM {$this->synt} LIMIT {$offset}, {$row_count}\");\n\t}", "protected function getXPath()\n {\n $xpath = parent::getXPath();\n $xpath->registerNamespace('m', OData::META);\n $xpath->registerNamespace('d', OData::DATA);\n\n return $xpath;\n }", "public function getXqlCursor () {\n $this->xmldb->getXqlCursor();\n }", "private function _findRowEnd($offset)\n {\n $rowEnd = strpos($this->_documentXML, \"</w:tr>\", $offset) + 7;\n return $rowEnd;\n }", "public function testFetchPageCursorOffset(){\n $str_gql = \"SELECT * FROM Kind\";\n $obj_request = $this->getBasicFetchRequest();\n\n $obj_gql_query = $obj_request->mutableGqlQuery();\n $obj_gql_query->setAllowLiteral(TRUE);\n $obj_gql_query->setQueryString($str_gql . \" LIMIT @intPageSize OFFSET @startCursor\");\n\n $obj_arg = $obj_gql_query->addNameArg();\n $obj_arg->setName('intPageSize');\n $obj_arg->mutableValue()->setIntegerValue(11);\n\n $obj_arg_offset = $obj_gql_query->addNameArg();\n $obj_arg_offset->setName('startCursor');\n $obj_arg_offset->setCursor('some-cursor-string');\n\n $this->apiProxyMock->expectCall('datastore_v4', 'RunQuery', $obj_request, new \\google\\appengine\\datastore\\v4\\RunQueryResponse());\n\n $obj_store = $this->createBasicStore();\n $obj_result = $obj_store->query($str_gql)->fetchPage(11, 'some-cursor-string');\n\n $this->assertEquals($obj_result, []);\n $this->apiProxyMock->verify();\n }", "public function getNextStartRecordIndex()\n {\n if (!$this->xmlRoot) {\n $this->processData();\n }\n return intval((string)$this->xmlRoot->xpath('/searchRetrieveResponse/nextRecordPosition'));\n }", "public function testFetchPageIntegerOffset(){\n $str_gql = \"SELECT * FROM Kind\";\n $obj_request = $this->getBasicFetchRequest();\n $obj_gql_query = $obj_request->mutableGqlQuery();\n $obj_gql_query->setAllowLiteral(TRUE);\n $obj_gql_query->setQueryString($str_gql . \" LIMIT @intPageSize OFFSET @intOffset\");\n\n $obj_arg = $obj_gql_query->addNameArg();\n $obj_arg->setName('intPageSize');\n $obj_arg->mutableValue()->setIntegerValue(11);\n\n $obj_arg_offset = $obj_gql_query->addNameArg();\n $obj_arg_offset->setName('intOffset');\n $obj_arg_offset->mutableValue()->setIntegerValue(22);\n\n $this->apiProxyMock->expectCall('datastore_v4', 'RunQuery', $obj_request, new \\google\\appengine\\datastore\\v4\\RunQueryResponse());\n\n $obj_store = $this->createBasicStore();\n $obj_result = $obj_store->query($str_gql)->fetchPage(11, 22);\n\n $this->assertEquals($obj_result, []);\n $this->apiProxyMock->verify();\n }", "public function getRowOffset();", "public function xpath() {\n return new DOMXPath($this);\n }", "function findAll($expression, $offset = null, $limit = null);", "public function query($query){\r\n return $this->xpath->evaluate($query);\r\n }", "public function get_offset() {\n\t\treturn ( $this->step - 1 ) * $this->per_step;\n\t}", "public function getStartIndex();", "public function getQuery()\n {\n $query = parent::getQuery();\n if ( $this->hasLimit )\n {\n if ( $this->offset) \n {\n if ( !$this->orderString ) \n {\n // Uh ow. We need some columns to sort in the oposite order to make this work\n throw new ezcQueryInvalidException( \"LIMIT workaround for MS SQL\", \"orderBy() was not called before getQuery().\" );\n }\n return 'SELECT * FROM ( SELECT TOP ' . $this->limit . ' * FROM ( ' . self::top( $this->offset + $this->limit, $query ) . ' ) AS ezcDummyTable1 ' . $this->invertedOrderString . ' ) AS ezcDummyTable2 ' . $this->orderString;\n }\n return self::top( $this->limit, $query );\n }\n return $query;\n }", "public function getOffset()\r\n {\r\n return ( $this->_pageno - 1 ) * $this->_size;\r\n }", "function calculate_record_offset()\n\t{\n\t\treturn $this->results_per_page * ($this->page_number - 1);\n\t}", "public function getOffset(): int\n {\n return $this->pageIndex * $this->pageSize;\n }", "protected function convertXPath($expr): string\n\t{\n\t\tif (str_starts_with($expr, 'starts-with'))\n\t\t{\n\t\t\treturn $this->convertStartsWithExpr($expr);\n\t\t}\n\n\t\t$replacements = [\n\t\t\t\"(^translate\\\\(@(\\\\w+),'(.)','(.)'\\\\))\" => '$$1|replace(\\'$2\\',\\'$3\\')',\n\n\t\t\t\"(^\\\\$(\\\\w+)(!=|(=))('.*')$)D\" => '$xf.options.s9e_MediaSites_$1$2$3$4',\n\t\t\t\"(^contains\\\\(\\\\$(\\\\w+,'[^']+')\\\\)$)D\" => 'contains($xf.options.s9e_MediaSites_$1)',\n\n\t\t\t'(^@(\\\\w+)$)D' => '$$1',\n\t\t\t\"(^@(\\\\w+)(='.*')$)D\" => '$$1=$2',\n\t\t\t'(^@(\\\\w+)>(\\\\d+)$)D' => '$$1>$2',\n\t\t\t'(^100\\\\*@height div@width$)D' => '100*$height/$width',\n\t\t\t'(^100\\\\*\\\\(@height\\\\+(\\\\d+)\\\\)div@width$)D' => '100*($height+$1)/$width',\n\t\t\t\"(^contains\\\\(@(\\\\w+,'[^']+')\\\\)$)D\" => 'contains($$1)',\n\t\t\t\"(^not\\\\(contains\\\\(@(\\\\w+,'[^']+')\\\\)\\\\)$)D\" => '!contains($$1)',\n\t\t\t\"(^@(\\\\w+) or ?contains\\\\(@(\\\\w+,'[^']+')\\\\)$)D\" => '$$1 or contains($$2)',\n\t\t\t\"(^@(\\\\w+) and ?contains\\\\(('[^']+'),@(\\\\w+)\\\\)$)D\" => '$$1 and contains($2,$$3)',\n\t\t\t\"(^@(\\\\w+) and@(\\\\w+)!=('[^']++')$)D\" => '$$1 and $$2!=$3',\n\n\t\t\t\"(^substring-after\\\\(@(\\\\w+),('[^']+')\\\\)$)\" => '$$1|split($2)|last()',\n\t\t\t\"(^substring-before\\\\(@(\\\\w+),('[^']+')\\\\)$)\" => '$$1|split($2)|first()',\n\t\t];\n\n\t\t$expr = html_entity_decode($expr);\n\t\t$expr = preg_replace(array_keys($replacements), array_values($replacements), $expr, -1, $cnt);\n\t\tif (!$cnt)\n\t\t{\n\t\t\tthrow new RuntimeException('Cannot convert ' . $expr);\n\t\t}\n\n\t\treturn $expr;\n\t}", "public function getOffset()\n {\n $page = $this->getRequest()->get('page', 1);\n $limit = $this->getRequest()->get('limit');\n\n return (null != $limit) ? $limit * ($page - 1) : null;\n }", "public function getXpath()\n {\n if (null === $this->xpath) {\n $this->setXpath(new DOMXPath($this->getDomDocument()));\n }\n\n return $this->xpath;\n }", "public function get($xpathQuery, \\DOMNode $contextnode = null);" ]
[ "0.5891331", "0.5858565", "0.57634467", "0.5634551", "0.5543583", "0.54944134", "0.54081166", "0.53653616", "0.53576374", "0.529386", "0.52843153", "0.518309", "0.5145246", "0.5143747", "0.5102981", "0.507216", "0.5064272", "0.500201", "0.4991872", "0.49641213", "0.4947015", "0.4938479", "0.49363506", "0.49302357", "0.49254614", "0.49174154", "0.48847342", "0.48772767", "0.48758712", "0.4872601" ]
0.62557465
0
Return an instance of XmlFactory
protected function getFactory() { if (! isset($this->factory)) { $this->factory = new \MphpMusicBrainz\Adapter\Xml\XmlFactory(); } return $this->factory; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFactory()\n {\n return new Factory();\n }", "public function getFactory() {}", "public function getFactory(): Factory;", "public static function factory()\n {\n return new self;\n }", "public static function factory()\r\n {\r\n return parent::factory(__CLASS__);\r\n }", "protected static function newFactory()\n {\n return ExampleFactory::new();\n }", "public static function factory() {\n\t\tstatic $instance;\n\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t\t$instance->setup();\n\t\t}\n\n\t\treturn $instance;\n\t}", "public static function factory() {\n\t\tstatic $instance = false;\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t\t$instance->setup();\n\t\t}\n\t\treturn $instance;\n\t}", "public function getFactory()\n {\n return $this->_factory;\n }", "public static function factory() {\n\t\tstatic $instance = false;\n\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t\t$instance->setup();\n\t\t}\n\n\t\treturn $instance;\n\t}", "public static function getFactory()\r\n\t{\r\n\t\treturn self::$factory;\r\n\t}", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public function getFactory()\n {\n return $this->factory;\n }", "public static function newFactory()\n {\n return ReceiptFactory::new();\n }", "public function getQomFactory() {}", "protected static function newFactory()\n {\n //\n }", "static function factory()\n {\n if (self::$_instance == NULL) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function newFactory()\n {\n return TaxCollectionFactory::new();\n }", "public function createXML() {}", "public function getNodeFactory();", "final public function getFactory() {\n\t\treturn '';\n\t}", "public function loadFactory()\n {\n $this->di = new Di\\FactoryDefault;\n\n return $this;\n }", "protected static function newFactory(): Factory\n {\n return OrderPaymentFactory::new();\n }", "protected static function newFactory()\n {\n return TypeFactory::new();\n }" ]
[ "0.68133634", "0.6687715", "0.6544517", "0.65268314", "0.65139043", "0.650521", "0.64808017", "0.6466598", "0.64327395", "0.6400517", "0.63851243", "0.6369048", "0.6369048", "0.6369048", "0.6369048", "0.6369048", "0.6369048", "0.6369048", "0.6369048", "0.6298765", "0.6278735", "0.6230155", "0.62003076", "0.6189119", "0.61633795", "0.6151434", "0.6113034", "0.60988456", "0.60823864", "0.60812855" ]
0.84304833
0
ANTI XSS & SQL INJECTION//
function antiinjection($data){ $filter_sql = stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES))); return $filter_sql; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sqlInjections($data){\n\t$value1=mysqli_real_escape_string($GLOBALS['link'],$data);\n\t$value1=trim($value1);\n\treturn $value1;\n\t}", "function anti_injection($data){\n\t$filter = stripslashes(strip_tags(htmlspecialchars($data, ENT_QUOTES)));\n\treturn $filter;\n}", "public function anti_injection($sql){\r\n /*\r\n\t\t$seg = preg_replace(sql_regcase(\"/(from|select|insert|delete|where|drop table|show tables|\\*|--|\\\\\\\\)/\"),\"\",$sql);\r\n\t\t$seg = trim($seg);//limpa espaços vazio\r\n\t\t$seg = strip_tags($seg);//tira tags html e php\r\n\t\t$seg = addslashes($seg);//Adiciona barras invertidas a uma string\r\n\t\treturn $seg;\r\n */\r\n return $sql;\r\n\t}", "public static function evilStrings()\n {\n while (true) {\n yield \"* WHERE 1=1; --\";\n yield \"<script>alert('xss')</script>\";\n }\n }", "function sqlsanitize($sql)\r\n{\r\n\t$trysan = str_replace(\"\\\\\", \"\\\\\\\\\", $sql);\r\n\t$trysan = str_replace(\"\\\"\", \"\\\"\\\"\", $trysan);\r\n\t$trysan = str_replace(\"'\", \"''\", $trysan);\r\n\treturn $trysan;\r\n}", "function anti_injection($sql)\n{\n\t$sql = preg_replace(sql_regcase(\"/(from|select|insert|delete|where|drop table|show tables|#|\\*|--|\\\\\\\\)/\"),\"\",$sql);\n\t$sql = trim($sql);//limpa espaços vazio\n\t$sql = strip_tags($sql);//tira tags html e php\n\t$sql = addslashes($sql);//Adiciona barras invertidas a uma string\n\treturn $sql;\n}", "function escape($s) {\r\n //return mysql_real_escape_string(strip_tags($s)); // uncomment in when you will use connection with database\r\n return strip_tags($s);\r\n}", "function security($input)\n{\n $input = mysql_real_escape_string($input);\n $input = strip_tags($input);\n $input = stripslashes($input);\n return $input;\n}", "function sanitize( $input ){\n $mysqli = self::dbconnect();\n $input = $mysqli->real_escape_string( $input );\n $input = trim($input);\n $input = htmlentities($input);\n $mysqli->close();\n return $input;\n }", "function safety($text){\r\n $text = strip_tags($text); //Remove html tags\r\n $text = $this->ixd->real_escape_string($text); // Make safe for Database.\r\n return $text;\r\n }", "function secure_input($data) {\r\n $data = trim($data);\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n // tbd mysql_real_escape_string\r\n return $data;\r\n}", "public function XSSfilter()\n {\n /**\n * @var array Исключения для полей с визуальным редактором\n */\n $exceptionsAllowingHTML = array( 'contest_text', 'results_contest' );\n\n foreach ($_POST as $key => $value){\n if (is_array($value)) {\n foreach ($value as $sub_key => $sub_value) {\n $sub_value = stripos( $sub_value, 'سمَـَّوُوُحخ ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ') !== false ? '' : $sub_value ;\n $_POST[$key][$sub_key] = Security::xss_clean(HTML::chars($sub_value));\n }\n continue;\n }\n $value = stripos($value, 'سمَـَّوُوُحخ ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ') !== false ? '' : $value ;\n\n /** $exceptionsAllowingHTML — allow html tags (does not fire HTML Purifier) */\n if ( in_array($key, $exceptionsAllowingHTML) === false) {\n $_POST[$key] = Security::xss_clean(HTML::chars($value));\n }\n }\n foreach ($_GET as $key => $value) {\n $value = stripos( $value, 'سمَـَّوُوُحخ ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ') !== false ? '' : $value ;\n $_GET[$key] = Security::xss_clean(HTML::chars($value));\n }\n\n }", "function sanitize($data) \n{\n\treturn htmlentities(strip_tags(mysql_real_escape_string($data)));\n}", "function sanitize_input($input) {\n $input = mysql_real_escape_string($input);\n return $input;\n}", "function sanitize ($data) {\n\t\treturn htmlentities (mysqli_real_escape_string ($GLOBALS['con'], $data),ENT_NOQUOTES,\"utf-8\");\n\t}", "function sanitize($data) {\n return htmlentities(strip_tags(mysql_real_escape_string($data)));\n }", "function sanitizeDBData($input) {\n $halfSan = filter_var($input, FILTER_SANITIZE_EMAIL);\n\n //sets slashes infront of \" ' and \\\n $output = filter_var($halfSan, FILTER_SANITIZE_MAGIC_QUOTES);\n\n return $output;\n}", "function db_output($string) {\n return htmlspecialchars($string);\n }", "public function ex_sanitize($data){\n\n\t\treturn mysql_real_escape_string(htmlentities(trim($data)));\n\n\t}", "function secur($string){return htmlspecialchars($string, ENT_QUOTES|ENT_SUBSTITUTE);}", "public function inject()\n\t{\n\t\t$insert = '?id=1%27 and 1%3d1 union select ';\n\t\treturn $insert;\n\t}", "function filterQuery($query){\n $query=htmlspecialchars(stripslashes($query));\n $query=str_ireplace(\"script\", \"blocked\", $query);\n $query=mysql_escape_string($query);\n\n return $query;\n}", "function sanitize($data){\r\n $conn = db ();\r\n return mysqli_real_escape_string($conn, $data);\r\n}", "function db_escape($input)\n{\n\tglobal $db;\n\treturn $db->real_escape_string($input);\n}", "function escape($value){//XSS attacks protection\n return htmlspecialchars($value , ENT_QUOTES,'UTF-8');\n }", "function xssafe($data, $encoding = 'UTF-8')\n{\n //return htmlspecialchars($data,ENT_QUOTES | ENT_HTML401,$encoding);\n return htmlspecialchars($data);\n}", "function sanitizeString($var)\n{\nglobal $connection;\n$var = strip_tags($var);\n$var = htmlentities($var);\n$var = stripslashes($var);\nreturn $connection->real_escape_string($var);\n}", "function esc_sql($data)\n {\n }", "public function sanitize($data){\n\n\t\treturn mysql_real_escape_string(htmlentities($data));\n\n\t}", "function sanitize($input){\n\tglobal $link;\n\t$input = htmlentities(strip_tags(trim($input)));\n\t$input = mysqli_real_escape_string($link, $input);\n\treturn $input;\n}" ]
[ "0.6846932", "0.6671799", "0.66669977", "0.6589908", "0.658406", "0.65651757", "0.65582883", "0.65257055", "0.6510999", "0.65039515", "0.6479666", "0.6462158", "0.6458724", "0.64330816", "0.6429838", "0.64138585", "0.64120257", "0.63999945", "0.6394304", "0.63847834", "0.63721806", "0.6369639", "0.63440466", "0.6341101", "0.6328934", "0.6323839", "0.63193756", "0.6313061", "0.6294414", "0.62867063" ]
0.7492571
0
get restaurant id from reservation objec loop all reservation managers for the found restaurant send email to reservation managers
public function sendReservationWasCreatedToReservationManagersByEmail(Reservation $reservation) { // Customer Basic Info $customer = $reservation->user->toArray(); // Loop and send to Reservation Managers foreach ($this->reservation_managers as $manager) { Mail::send( 'emails/cart/admin/pending', [ 'user' => $manager, 'reservation' => $reservation, 'customer' => $customer ], function ($message) use ($manager) { $message->from('sales@howtheyrate.net', trans('HTR Sales!')); $message->to($manager->email, $manager->name)->subject(trans('Reservation is Pending')); } ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirm_reservations($id) {\n global $DB;\n\n $reservation = $DB->get_record('roomscheduler_reservations', array('id' => $id));\n\n $reservations = $DB->get_records('roomscheduler_reservations', array('recurrence_id'=>$reservation->recurrence_id,'location'=>$reservation->location));\n \n foreach($reservations as $res){\n $res->confirm = 1;\n $DB->update_record('roomscheduler_reservations', $res);\n }\n}", "public function reservations()\n {\n return $this->hasMany('App\\Reservation', 'restaurant_id');\n }", "public function getReservationId()\n {\n return $this->reservation_id;\n }", "public function getBillsWithUserReservation () {\n if (strpos(Route::getFacadeRoot()->current()->uri(), 'admin') !== false) {\n $bills = self::select('*')->orderBy('bill_bill_date', 'DESC')->get();\n } else {\n\n $bills = self::where('bill_user_id', '=', Auth::id())->get();\n }\n $bills->each(function ($b) {\n global $subtotals;\n global $totals;\n $r = new Reservation();\n $b->reservation = $r->where('id', '=', $b->reservation_id)\n ->select('id', 'reservation_started_at', 'reservation_ended_at', 'reservation_nights', 'user_id')\n ->with(array(\n 'guests' => function ($q) {\n $q->select('guests.id', 'reservation_id', 'guest_number', 'guest_night', 'guest_ended_at', 'guest_started_at', 'role_id');\n },\n ))\n ->first();\n $b->user = \\User::find($b->reservation->user_id);\n $b->reservation->guests->each(function ($g) use($b) {\n $g->calcGuestSumTotals();\n $s = new DateTime($g->guest_started_at);\n $g->guest_started_at_show = $s->format('d. m Y');\n $e = new DateTime($g->guest_ended_at);\n $g->guest_ended_at_show = $e->format('d. m Y');\n $b->reservation->reservation_sum += $g->guestSum;\n });\n $bds = new \\DateTime($b->bill_bill_date);\n $s = new DateTime($b->reservation->reservation_started_at);\n $b->reservation->reservation_started_at_show = $s->format('d. m Y');\n $e = new DateTime($b->reservation->reservation_ended_at);\n $b->reservation->reservation_ended_at_show = $e->format('d. m Y');\n $b->bill_bill_date_show = $bds->format(trans('formats.short-date-ts'));\n if (isset($b->bill_paid)) {\n $bds = new \\DateTime($b->bill_paid);\n $b->bill_paid_show = $bds->format(trans('formats.short-date-ts'));\n }\n\n if (isset($b->bill_resent_date)) {\n $bds = new \\DateTime($b->bill_resent_date);\n $b->bill_resent_date_show = $bds->format(trans('formats.short-date-ts'));\n }\n\n $ubc = DB::select(DB::raw('select `country_name_' . trans('formats.langjs') . '` from countries where country_code = ' . $b->user->user_country_code));\n $b->user->country = $ubc[0]->{'country_name_' . trans('formats.langjs')};\n $subtotals += (float)$b->bill_sub_total;\n $totals += (float)$b->bill_total;\n $b->subtotals = $subtotals;\n $b->totals = $totals;\n });\n return $bills;\n }", "public function inforeservations($id_reservations){\n $reservation = \\App\\reservation::where('ID_RESERVATION','=',$id_reservations)->get()->first();\n if(!$reservation){return redirect('/');}\n $prestation = \\App\\pristation::where('id_prestation','=',$reservation->id_prestation)->get()->first();\n $coiffeur = \\App\\coiffeur::where('NOM_COIFFEUR','=',$prestation->NOM_COIFFEUR)->get()->first();\n $salon = \\App\\salon::where('NAME_SALON','=',$coiffeur->NAME_SALON)->get()->first();\n \n return view('Inforeservation',compact('prestation','coiffeur','salon','reservation'));\n \n }", "public function getRespondToReservation(Request $request)\n {\n\t\t$user = null;\n\t\tif(Auth::check())\n\t\t{\n\t\t\t$user = Auth::user();\n\t\t\t\n\t\t\tif($this->helpers->isAdmin($user))\n\t\t\t{\n\t\t\t\t$hasPermission = $this->helpers->hasPermission($user->id,['view_users','edit_users']);\n\t\t\t\t#dd($hasPermission);\n\t\t\t\t$req = $request->all();\n\t\t\t\t\n\t\t\t\tif($hasPermission)\n\t\t\t\t{\n\t\t\t\t$validator = Validator::make($req,[\n\t\t 'xf' => 'required|numeric',\n\t\t\t\t\t\t\t'axf' => 'required',\n\t\t\t\t\t\t\t'gxf' => 'required|numeric'\n\t\t ]);\n\t\t\t\t\t\t\n\t\t\t\tif($validator->fails())\n {\n session()->flash(\"validation-status-error\",\"ok\");\n\t\t\t return redirect()->intended('/');\n }\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$dt = [\n\t\t\t 'id' => $req['xf'],\n\t\t\t 'apartment_id' => $req['axf'],\n\t\t\t 'user_id' => $req['gxf']\n\t\t\t ];\n\t\t\t \n\t\t\t if($this->helpers->hasReservation($dt))\n\t\t\t {\n\t\t\t\t $dt['type'] = $req['type'];\n\t\t\t\t $dt['auth'] = $user->id;\n\t\t\t\t\n\t\t\t $this->helpers->respondToReservation($dt);\n\t\t\t session()->flash(\"respond-to-reservation-status\",\"ok\");\n return redirect()->intended('/');\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t \t session()->flash(\"duplicate-reservation-status-error\",\"ok\");\n\t\t\t return redirect()->intended('/');\n\t\t\t }\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsession()->flash(\"permissions-status-error\",\"ok\");\n\t\t\t\t\treturn redirect()->intended('/');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tAuth::logout();\n\t\t\t\t$u = url('/');\n\t\t\t\treturn redirect()->intended($u);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn redirect()->intended('/');\n\t\t}\n }", "static public function buildObject($reservations){\n\n foreach ($reservations as &$reservation) { // DO NOT FORGET \"&\"!! &を付けると、$usersを上書きできる。Arrayだった$usersをobjectに上書きしたいため。\n $reservation = new ReservationModel(\n $reservation[\"id\"], \n $reservation[\"user_id\"],\n $reservation[\"email\"],\n $reservation[\"username\"],\n $reservation[\"firstName\"],\n $reservation[\"lastName\"],\n $reservation[\"property_id\"],\n $reservation[\"propertyName\"],\n $reservation[\"checkIn\"],\n $reservation[\"checkOut\"],\n $reservation[\"numGuests\"],\n $reservation[\"note\"],\n $reservation[\"pricePerNight\"],\n $reservation[\"numOfNights\"],\n $reservation[\"totalPrice\"],\n $reservation[\"cardNumber\"],\n $reservation[\"cardholderName\"],\n $reservation[\"expirationDate\"],\n $reservation[\"cvc\"],\n $reservation[\"creationDate\"],\n $reservation[\"status_id\"]\n );\n\n }\n return $reservations; \n }", "function processReservation($fname,$lname,$sourcelist,$destlist,$flight,$sdate){\n $connection = initDB();\n $query2;\n \n //Update Guest Table\n $query2 = \"SELECT * FROM Guest WHERE FirstName='\".$fname.\"' AND LastName='\".$lname.\"'\";\n $result2 = mysql_query($query2);\n //or die (\"Query Failed \".mysql_error());\n\n $registeredGuest = false;\n $guestID;\n\n while($row2 = mysql_fetch_array($result2)){ \n $guestID = $row2['GID'];\n $registeredGuest = true; \n }\n //Guest ID not available. First time flyer.\n if(! $registeredGuest){ \n //Update Guest table.\n //Get last Guest ID\n $query2 = \"SELECT MAX(GID) FROM Guest\";\n $result2 = mysql_query($query2);\n //or die (\"Query Failed \".mysql_error());\n $row2 = mysql_fetch_array($result2);\n $MGID = $row2[0];\n \n $guestID = $MGID + 1;\n \n $query2 = \"INSERT INTO Guest Values('\".$guestID.\"','\".$fname.\"','\".$lname.\"')\";\n $result2 = mysql_query($query2);\n //or die (\"Query Failed \".mysql_error()); \n } \n \n //Get the flight ID\n $query = \"SELECT * FROM Flights WHERE FName='\".$flight.\"'\";\n $result = mysql_query($query);\n //or die (\"Query Failed \".mysql_error());\n $row2 = mysql_fetch_array($result); \n $FID = $row2['FID']; \n \n //Update schedule table \n $query2 = \"SELECT MAX(SID) FROM Schedule\";\n $result2 = mysql_query($query2);\n //or die (\"Query Failed \".mysql_error());\n $row2 = mysql_fetch_array($result2);\n $MSID = $row2[0];\n //echo \"MAX GID \".$MGID;\n $SID = $MSID + 1; \n //Before updating the schedule and itinerary table\n //check duplicate itinerary.\n\n $query2 = \"SELECT * FROM Schedule WHERE GID='\".$guestID.\"' AND FID='\".$FID.\"' AND Date='\".$sdate.\"'\";\n $result2 = mysql_query($query2);\n //or die (\"Query Failed \".mysql_error());\n\n $duplicateItinerary = false;\n $guestID;\n\n while($row2 = mysql_fetch_array($result2)){ \n $duplicateItinerary = true; \n }\n\n if($duplicateItinerary){\n //Duplicate itineraries not allowed.\n return -1;\n } \n\n\n $query2 = \"INSERT INTO Schedule Values('\".$SID.\"','\".$guestID.\"','\".$FID.\"','\".$sdate.\"')\";\n $result2 = mysql_query($query2);\n //or die (\"Query Failed \".mysql_error());\n \n //Finally update the Itinerary Table \n $query2 = \"SELECT MAX(IID) FROM Itinerary\";\n $result2 = mysql_query($query2);\n // or die (\"Query Failed \".mysql_error());\n $row2 = mysql_fetch_array($result2);\n $MIID = $row2[0]; \n $IID = $MIID + 1;\n\n $query2 = \"INSERT INTO Itinerary Values('\".$IID.\"','\".$guestID.\"','\".$FID.\"','\".$SID.\"')\";\n $result2 = mysql_query($query2);\n //or die (\"Query Failed \".mysql_error());\n\n closeDB($connection);\n return $IID;\n}", "function afficherreservation(){\n\t\t$sql=\"select hotel.nom hotel ,hotel.ville,reservation.* from (reservation inner join hotel on reservation.idhotel=hotel.id) order by idres \";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "public function index(Request $request)\n {\n if($request->has('accept_reserv')){\n Reservation::where('id',$request->reserv_id)\n ->update([\n 'status' => 1\n ]);\n $notification = Notification::create([\n 'to' => Reservation::find($request->reserv_id)->user_id,\n 'from' => Auth::user()->id,\n 'message' => 'تمت الموافقة على طلب الحجز الذي ارسلته من قبل صاحب العقار'\n ]);\n broadcast(new NewNotification($notification));\n return redirect()->back()->with('info','تم تحديث حالة الطلب');\n }\n // to delete reservation\n if($request->has('delete_reserv')){\n Reservation::where('id',$request->reserv_id)->update(['status' => 0]);\n $notification = Notification::create([\n 'to' => Reservation::find($request->reserv_id)->user_id,\n 'from' => Auth::user()->id,\n 'message' => 'تم رفض طلب الحجز الذي ارسلته من قبل صاحب العقار'\n ]);\n broadcast(new NewNotification($notification));\n return redirect()->back()->with('info',' تم حذف الطلب بنجاح ');\n }\n // to list all reservation\n $reservations = Reservation::where('reciver_id',Auth::user()->id)\n ->where('status', NULL)\n ->get();\n $accepted_reservations = Reservation::where('reciver_id',Auth::user()->id)\n ->where('status',1)\n ->get();\n $confirmable_reservations = Reservation::where('reciver_id',Auth::user()->id)\n ->where('status',2)\n ->get();\n return view('reservation.index')\n ->with('reservations',$reservations)\n ->with('accepted_reservations',$accepted_reservations)\n ->with('confirmable_reservations',$confirmable_reservations);\n }", "public function walk_in_reservation(Request $request, GuestDetail $guest_detail)\n {\n $guest_detail = new GuestDetail;\n $guest_detail->last_name = $request['last_name'];\n $guest_detail->first_name = $request['first_name'];\n $guest_detail->mi = $request['mi'];\n $guest_detail->email_address = $request['email_address'];\n $guest_detail->address = $request['address'];\n $guest_detail->contact_number = $request['contact_number'];\n $guest_detail->purpose = $request['purpose'];\n $guest_detail->gender = $request['gender'];\n $guest_detail->nationality = $request['nationality'];\n $guest_detail->check_in_date = date('Y-m-d', strtotime($request['check_in']));\n $guest_detail->check_out_date = date('Y-m-d', strtotime($request['check_out']));\n $guest_detail->save();\n\n $guest_id = DB::table('guest_details')->orderBy('id',\"DESC\")->take(1)->value('id');\n\n $date_start = date('Y-m-d', strtotime($request['check_in']));\n $date_end = date('Y-m-d', strtotime($request['check_out']));\n $interval = Carbon::parse($date_end)->diffInDays($date_start);\n\n $bookings = new Booking;\n $bookings->guest_id = $guest_id;\n $bookings->number_of_rooms = $request['number_of_rooms'];\n $bookings->grand_total = $interval;\n $bookings->payment_mode = 'Unpaid';\n $bookings->paid_status = 0;\n $bookings->viewed_status = 0;\n $bookings->save();\n\n for($i=0; $i < $request['number_of_rooms']; $i++)\n { \n $booking_id = DB::table('bookings')->orderBy('id',\"DESC\")->take(1)->value('id');\n\n $booking_details = new BookingDetail;\n \n $booking_details->booking_id = $booking_id;\n $booking_details->room_cat_id = $request['room_cat_id'];\n $booking_details->room_no = $request['room_no'];\n $booking_details->room_rate = $request['room_rate'];\n $booking_details->status = 'occupied';\n $booking_details->check_in = date('Y-m-d', strtotime($request['check_in']));\n $booking_details->check_out = date('Y-m-d', strtotime($request['check_out']));\n $booking_details->nights = $interval;\n $booking_details->total = ($request['room_rate']) * $interval;\n // $booking_details->total = ($request['room_rate'] * $request['number_of_rooms']) * $interval;\n $booking_details->save();\n\n $grand_total = BookingDetail::where('booking_id', $booking_id)->sum('total');\n $bookings = Booking::findOrFail($booking_id);\n $bookings->grand_total = $grand_total;\n $bookings->save();\n\n $accept_booking = new ConfirmedBooking;\n\n $accept_booking->booking_id = $booking_id;\n $accept_booking->room_cat_id = $request['room_cat_id'];\n $accept_booking->room_no = $request['room_no'];\n $accept_booking->room_rate = $request['room_rate'];\n $accept_booking->status = 'occupied';\n $accept_booking->check_in = date('Y-m-d', strtotime($request['check_in']));\n $accept_booking->check_out = date('Y-m-d', strtotime($request['check_out']));\n $accept_booking->nights = $interval;\n $accept_booking->total = ($request['room_rate']) * $interval;\n $accept_booking->save();\n\n }\n\n return ['bookings' => $bookings];\n }", "public function getUserIDToSendMail(){\n\t\t \n\t\t $userSessionID = Input::get('user_session_id'); \n\t\t \t$logTable = \"log_vistaws_\" . date('Y_m');\t \n\t\t \n\t\t $DataLogBooking = DB::table($logTable)\n\t\t\t\t\t\t ->select('phone', 'email', 'cname', 'theater', \n\t\t\t\t\t\t \t\t 'show_time', 'session_id', 'movie', 'seat', 'amount' , 'pincode' )\n\t\t\t\t\t\t ->where('user_session_id','=', $userSessionID) \n\t\t\t\t\t\t ->where('pincode','!=', '')\n\t\t\t\t\t\t ->get(); \n\t\t\t\t\t\t \n\t\t foreach ($DataLogBooking as $resultLog){ \n\t\t\t\t$mobile \t\t= $resultLog->phone;\n\t\t\t\t$email\t\t= $resultLog->email;\n\t\t\t\t$cname \t\t= $resultLog->cname;\n\t\t\t\t$hall\t \t= $resultLog->theater;\n\t\t\t\t$movieSession \t= $resultLog->show_time;\n\t\t\t \t$sessID\t = $resultLog->session_id;\n\t\t\t\t$movieName = $resultLog->movie;\n\t\t\t $seatPosition = $resultLog->seat;\n\t\t\t\t$SeatPrice\t = $resultLog->amount; \n\t\t\t\t$pincode\t = $resultLog->pincode; \n\t\t\t} #end foreach\n\t\t\t\n\t\t\t//**********\n\t\t $rowMovieDetail = DB::table('movie_showtimes')\n\t\t\t\t\t\t\t ->leftJoin('movie_list', 'movie_showtimes.showtime_Movie_strID', '=', 'movie_list.movie_strID')\n\t\t\t\t\t\t\t ->where('movie_showtimes.showtime_Session_strID','=', $sessID) \n\t\t\t\t\t\t\t ->where('movie_list.movieID','>', '0')\n\t\t\t\t\t\t\t ->where('movie_list.movie_Publish' , '1') \n\t\t\t\t\t\t\t ->get(); \n\t\t\t//***********\n\t\t\tforeach ($rowMovieDetail as $resultMovieDetail){ \n\t\t\t\t$movieName \t\t\t= $resultMovieDetail->movie_Name_EN;\n\t\t\t\t$imgPoster\t\t\t= $resultMovieDetail->movie_Img_Thumb;\n\t\t\t\t$showtimes \t\t\t= $resultMovieDetail->showtime_soundAttributes;\n\t\t\t\t$movie_Rating \t\t\t= $resultMovieDetail->movie_Rating; \n\t\t\t\t$showtime_SystemType \t= $resultMovieDetail->showtime_SystemType; \n\t\t\t\t\n\t\t\t} #end foreach\n\t\t\t\n\t\t\t\tif($movie_Rating == \"ส.\"){ \n\t\t\t\t\t$imgRate = \"rate_raise.png\"; \n\t\t\t\t }else if($movie_Rating == \"น13+\"){ \n\t\t\t\t\t$imgRate = \"rate_up_13_en.png\";\n\t\t\t\t }else if($movie_Rating == \"น15+\"){ \n\t\t\t\t\t$imgRate = \"rate_up_15_en.png\";\n\t\t\t\t }else if($movie_Rating == \"น18+\"){ \n\t\t\t\t\t$imgRate = \"rate_up_18_en.png\";\n\t\t\t\t }else if($movie_Rating == \"ฉ20-\"){ \n\t\t\t\t\t$imgRate = \"rate_under_20_en.png\";\n\t\t\t\t }else { \n\t\t\t\t\t$imgRate = \"rate_general_en.png\";\n\t\t\t\t }//***********\n\t\t\t\t \n\t\t\t\t if($showtime_SystemType == \"VS00000001\"){ \n\t\t\t\t\t$imgSystem = \"type_digital.png\";\n\t\t\t\t\t$systemName = '2D';\n\t\t\t\t }else if($showtime_SystemType == \"0000000001\"){ \n\t\t\t\t\t$imgSystem = \"type_3d.png\";\n\t\t\t\t\t$systemName = 'D3D';\n\t\t\t\t }else if($showtime_SystemType == \"0000000002\"){ \n\t\t\t\t\t$imgSystem = \"type_hfr_3d.png\";\n\t\t\t\t\t$systemName = 'HFR 3D';\t\t \n\t\t\t\t }else{\n\t\t\t\t\t$imgSystem = \"type_digital.png\";\n\t\t\t\t\t$systemName = '2D';\n\t\t\t\t } //*************\n\t\t\t\n\t\t//********** Start Send mail **/////////////\n\t\t$data = array(\n\t\t\t\t'seatPosition'\t=> $seatPosition,\n\t\t\t\t'SeatPrice'\t\t=> $SeatPrice,\n\t\t\t\t'imgSystem'\t\t=> $imgSystem,\n\t\t\t\t'systemName'\t=> $systemName, \n\t\t\t\t'imgRate'\t\t=> $imgRate, \n\t\t\t\t'movieName'\t\t=> $movieName,\n\t\t\t\t'sessID'\t\t=> $sessID,\n\t\t\t\t'imgPoster'\t\t=> $imgPoster,\n\t\t\t\t'movieSession'\t=> $movieSession, \n\t\t\t\t'pincode'\t\t=> $pincode,\n\t\t\t\t'mobile'\t\t=> $mobile,\n\t\t\t\t'hall'\t\t\t=> $hall, \n\t\t\t\t'showtimes'\t\t=> $showtimes, \n\t\t\t\t'cname'\t\t\t=> $cname, \t\t \n\t\t\t\t'email'\t\t\t=> $email \n\t\t\t); \n\t\t\t\n\t\t\t$user = array(\n\t\t\t\t\t'email'=> $email \n\t\t\t);\n\t\t\t \n\t Mail::send('emails.enews', $data , function($message)use ($user){ \n\t\t\t $message->to($user['email'], $user['email'])->subject('Movie ticket booking notification from Embassycineplex.com');\n\t\t });\t/**/\n\t\t echo 'OK';\n\t\t//********* ****************************\t\n\t\t\t\n\t \n\t}", "public function get_restaurant_list_fees () {\n\t\t\n\t\t$restaurantIDString = $this->get_param('post.restaurant_id_list');\n\t\t$deliveryRegionID = $this->get_param('post.delivery_region_id');\n\t\t\n\t\t$extraFee = M('restaurant')\n\t\t\t->where('`id` in (' . $restaurantIDString . ')')\n\t\t\t->field('sum(`extra_fee`) as extra_fee')\n\t\t\t->find();\n\t\t\n\t\tif (!$extraFee) {\n\t\t\t$extraFee = \"0\";\n\t\t} else {\n\t\t\t$extraFee = $extraFee['extra_fee'];\n\t\t}\n\t\t\n\t\t\n\t\t$deliveryFee = M('restaurant_deliver_fee')\n\t\t\t->where(\"`region_id` = $deliveryRegionID and `restaurant_id` in ( $restaurantIDString ) \")\n\t\t\t->select();\n\t\t\n\t\t$this->return_data(['extra_fee' => $extraFee, 'delivery_fee' => $deliveryFee]);\n\t}", "public function agent_email_details($booking_id='')\n {\n\n $this->load->model('admin/admin_model');\n\n $this->gen_contents['page_heading'] = 'Tour Booking Details';\n $tour_type = $this->gen_contents['tour_type'] = $this->input->get('type');\n $this->gen_contents['agents'] = $this->admin_model->get_agents();\n\n $this->gen_contents['booking_details'] = $this->admin_model->get_tour_booking_details($booking_id);\n $booking_details = $this->gen_contents['booking_details'];\n //p($booking_details); exit;\n foreach ($booking_details as $bd) { }\n\n if($tour_type == 'ts'){\n $emirates_data = $this->admin_model->get_emairates_from_booking($booking_id); // for TS\n }\n\n $this->gen_contents['emirates'] = $emirates_data['emirates'];\n //$mail_body = $this->admin_model->get_email_template('booking-mail'); //old\n $tour_template = $bd['template'];//$this->admin_model->get_tour_template($bd['category_id']);\n $mail_body = $tour_template;//['template'];\n \n if($tour_type == 'ts'){\n $tour_details = \"You are selected <b>\" .$emirates_data['emirates']. '</b> transfer service.';\n $mail_body = str_replace('{{user_name}}', $bd['user_name'], $mail_body);\n $mail_body = str_replace('{{tour_details}}', $tour_details, $mail_body);\n //echo $mail_body; exit;\n }\n else{\n $tour_details = get_tour_details_table($bd); // get tour details \n $traveler_details = get_traveler_details($bd); // get traveler details\n $extra_details = get_extra_details($bd);\n //echo $traveler_details; exit;\n $mail_body = str_replace('{{user_name}}', $bd['user_name'], $mail_body); \n $mail_body = str_replace('{{tour_details}}', $tour_details, $mail_body);\n $mail_body = str_replace('{{traveler_details}}', $traveler_details, $mail_body);\n $mail_body = str_replace('{{extra_details}}', $extra_details, $mail_body);\n }\n \n\n $this->gen_contents['mail_content'] = $mail_body;\n \n\n //p($this->gen_contents['booking_details']); exit;\n //rendering page \n $this->template->set_template('admin');\n $this->template->write_view('content', 'admin/agent-email-details', $this->gen_contents);\n $this->template->render();\n }", "public function getReservationID()\n {\n return $this->reservationID;\n }", "public function checkinPost(Request $request, Reservation $reservation)\n {\n\n foreach($request->room as $reservation_room_id => $roomPeople) {\n\n foreach($roomPeople as $person) {\n if ( isset($person['dni']) || isset($person['name']) || isset($person['surname']) ) {\n ReservationRoomPeople::create([\n 'reservation_room_id' => $reservation_room_id,\n 'dni' => $person['dni'],\n 'name' => $person['name'],\n 'surname' => $person['surname'],\n ]);\n }\n }\n }\n\n $reservation->status = ReservationStatus::Checkin();\n\n $reservation->save();\n\n return redirect()->route('attendant.reservations.index')->with('success', 'Checkin realizado exitosamente');\n\n }", "public function reservationEmail (){\n$mail = new PHPMailer(true);\n\ntry {\n //Server settings\n // $mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output\n $mail->isSMTP(); //Send using SMTP\n $mail->Host = 'smtp.mailtrap.io'; //Set the SMTP server to send through\n $mail->SMTPAuth = true; //Enable SMTP authentication\n $mail->Username = '754bcbdddf46fa'; //SMTP username\n $mail->Password = '43f5df2046fcf2'; //SMTP password\n $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged\n $mail->Port = 2525;\n $mail->CharSet = 'UTF-8';//TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above\n\n //Recipients\n $mail->setFrom('gite@vincrent.com', 'Mailer');\n $mail->addAddress('locagite@gite.com', 'Administrateur Annonces Games.com');\n $mail->addReplyTo('locagite@gite.com', 'Annonces Administration');\n\n\n $BD = new PDO(\"mysql:host=localhost;dbname=gites;charset=utf8\",\"root\", \"\");\n //Fonction static de la classe PDO pour debug la connexion en cas d'erreur\n $BD->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n $sql = \"SELECT * FROM type WHERE id_gite = ?\";\n// 3 Creation d'une requète péparée avec la fonction prepare de PDO qui execute la requète SQL\n $requete_insertion = $BD->prepare($sql);\n//Passage du ? à la valeur de $_GET['id_gite']\n $id = $_GET['id_gite'];\n// 4 je bind (lier) les parametres\n $requete_insertion->bindParam(1, $id);\n// 5 j'excute la requete\n $requete_insertion->execute();\n// 6 j'affiche mon element avec fetch (pour charger les resultats)\n\n\n\n //Content\n $mail->isHTML(true); //Set email format to HTML\n $mail->Subject = 'réserver votre gite';\n while ($BD = $requete_insertion->fetch()) {\n //Stock de l'id dans une variable\n $emailId = $BD['id_gite'];\n //Url du liens de validation\n $url = \"http://localhost/Gites3/confirmer_reservation?id_gite=$emailId\";\n $mail->Body = '\n\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"UTF-8\">\n <meta http-equiv=\"Content-Type\" content=\"text/html\">\n <title>Votre reservation chez lebongite.com</title>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n </head>\n <body style=\"color: #6cc3d5;\">\n <div style=\"color: #6cc3d5; padding: 20px;\">\n <h3 style=\"color: #1D2326\">Le bon gite.COM</h3>\n \n <p>Vous avez déposé une demande de reservation (ET C BIEN) avec le liens suivant</p><br />\n <p>Recapitulatif de votre commande</p>\n <p>Nom du gite :<b style=\"color: #2c4f56\">' . $BD['nom'] . '</b></p>\n <p>Description du gite :<b style=\"color: #2c4f56\"> ' . $BD['description'] . '</b></p>\n <p>Image du gite :<img src=\"https://www.leboupere.fr/medias/2016/02/Logo-gite.png\"/></p>\n <p>Prix par semaine du gite :<b style=\"color: #2c4f56\"> ' . $BD['prix'] . ' €</b></p>\n <p>Nombre de chambre :<b style=\"color: #2c4f56\"> ' . $BD['nbr_chambre'] . '</b></p>\n <p>Nombre de salle de bain :<b style=\"color: #2c4f56\"> ' . $BD['nbr_sdb'] . '</b></p>\n <p>Zone géographique :<b style=\"color: #2c4f56\"> ' . $BD['zone'] . '</b></p>\n <p>Date arrivée :<b style=\"color: #2c4f56\"> ' . $BD['date_arrivee'] . '</b></p>\n <p>Date départ :<b style=\"color: #2c4f56\"> ' . $BD['date_depart'] . '</b></p>\n <p>Toutes fois vous avez la possibilité d\\'annuler ou de confirmer votre commande</p>\n <br /><br />\n \n <a href=\"' . $url . '\" style=\"background-color: darkred; color: #F0F1F2; padding: 20px; text-decoration: none;\">Confimer la reservation de votre gite</a><br />\n \n ';\n }\n $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';\n\n $mail->send();\n echo 'Message has been sent';\n} catch (Exception $e) {\n echo \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\";\n}\n}", "public function indexAction()\n\t{\n\t\t$order_id = session_id();\n\t\t\n\t\t$this->view->headTitle('Reservation');\n\t\t$objReser = new Models_Reservation();\n\t\t\n\t\t$resId = $this->_getParam('rid', false);\n\t\tif (false === $resId) {\n\t\t $this->_redirect('');\n\t\t}\n\t\t\n /**\n * Get restaurant\n */\n $objRes = new Models_Restaurant();\n $res = $objRes->find($resId)->toArray();\n $res = current($res);\n if (false == $res || '0' == $res['reser_onoff']) {\n $this->_redirect('');\n }\n /**\n * Check active restaurant\n */\n $this->_checkReservationOfRestaurant($res);\n// echo '<pre>';print_r($res);die;\n /**\n * All time in a day\n */\n $defaultTimeZone = date_default_timezone_get();\n date_default_timezone_set('UTC');\n $allTimes = array();\n for ($i = 0; $i < 48; $i++) {\n $time = 1800 * $i;\n $allTimes[] = array(\n 'time' => $time,\n 'text' => date('g:i A', $time)\n );\n }\n date_default_timezone_set($defaultTimeZone);\n// echo date('g:i A', 0);die;\n// echo '<pre>';print_r($allTimes);die;\n \n /**\n * Get search condition\n */\n $search = $this->_getParam('search', array(\n 'date' => date('m/d/Y'),\n 'time' => (date('G') * 3600 + (ceil(date('i')/30)) * 1800),\n 'quantity' => 2\n ));\n $search['quantity'] = intval($search['quantity']);\n \n \n $pointerDate = explode('/', $search['date']);\n $pointerDate = mktime(0, 0, 0, $pointerDate[0], $pointerDate[1], $pointerDate[2]) + $search['time'];\n $search['unixTime'] = $pointerDate;\n \n $this->session->reserSearch = $search;\n// echo '<pre>';print_r($search);die;\n\n /**\n * Get next 7 day often\n */\n $searchDateArr = array();\n $count = 0;\n $pointerDate = $search['unixTime'];\n $dateArr = array('date_mon', 'date_tue', 'date_wed', 'date_thu', 'date_fri', 'date_sat', 'date_sun');\n\n while (true) {\n $field = 'date_' . strtolower(date('D', $pointerDate));\n if ('1' == $res[$field]) {\n $searchDateArr[] = array(\n 'time' => $pointerDate,\n 'field' => $field,\n 'date' => date('D, m/d/Y g:i A', $pointerDate)\n );\n $count++;\n }\n if( 8 <= $count) {\n break;\n }\n $pointerDate += 3600 * 24;\n }\n /**\n * Get available hour for each date\n */\n foreach ($searchDateArr as &$date) {\n $date['startTime'] = $date['time'] - 1800 * 3;\n $date['endTime'] = $date['time'] + 1800 * 3;\n $maxTotal = $res['reser_quantity'] - $search['quantity'];\n \n $date['exitResers'] = $objReser->searchExistRerservation($date['startTime'], $date['endTime'], $maxTotal);\n $date['available'] = array();\n \n for ($i = $date['startTime']; $i <= $date['endTime']; $i = $i + 1800) {\n $flag = true;\n foreach ($date['exitResers'] as $exist) {\n if ($i == $exist['time']) {\n $flag = false;\n break;\n }\n }\n \n $date['available'][$i] = $flag;\n }\n }\n unset($date);\n \n// echo '<pre>';print_r($searchDateArr);die;\n// $searchDateArr[1]['available']['1301472000'] = false;\n// $searchDateArr[1]['available']['1301477400'] = false;\n// $searchDateArr[1]['available']['1301482800'] = false;\n /**\n * Data for view\n */\n $this->view->res = $res;\n $this->view->arr_restaurant = $res;\n $this->view->resId = $resId;\n $this->view->allTimes = $allTimes;\n $this->view->search = $search;\n $this->view->searchDateArr = $searchDateArr;\n $this->view->currentTime = time();\n $this->view->address_restaurant = $res['street'].\" \".$res['city'].\" \".$res['state'];\n\t}", "static function sendRequests()\n {\n // Grab all managers\n $managers = User::where('role', User::getRole('manager'))->get();\n // Today's date\n $date = Carbon::now()->format('d_m_Y');\n // Create a new folder named by today's date\n Storage::disk('local')->makeDirectory('holidayRequests/' . $date);\n $all_requests = new Collection();\n\n foreach ($managers as $manager) {\n if ($manager->employees->isNotEmpty()) {\n $manager_requests = new Collection();\n foreach ($manager->employees as $employee) {\n if ($employee->holidayRequests->isNotEmpty() &&\n $employee->holidayRequests()->whereIsSend(0)->get(['firstname','lastname'])->isNotEmpty()) {\n $manager_requests = $manager_requests->concat(\n $employee->holidayRequests()->whereIsSend(0)->get()\n );\n }\n }\n\n if ($manager_requests->isNotEmpty()) {\n // Define a path where the .csv file will be saved\n $path = \"holidayRequests/{$date}/{$date}_{$manager->firstname}_{$manager->lastname}.csv\";\n// //Create and store the .csv file\n Excel::store(new HolidayRequestsExport($manager_requests), $path);\n// // Send the .csv to the manager\n Mail::to($manager->email)->send(new holidayRequests($manager, $path, $date));\n $all_requests = $all_requests->concat($manager_requests);\n }\n }\n }\n\n if ($all_requests->isNotEmpty()) {\n // Update all request that were send and set is_set = 1\n HolidayRequest::updateIsSend($all_requests);\n }\n // if no files were created,delete the folder\n if (count(Storage::files($date)) === 0) {\n Storage::deleteDirectory($date);\n }\n }", "private function mailer($id)\n {\n //server\n $server = Servers::where('server_id', $id)->firstOrFail();\n $server_name = $server->server_name;\n //apps\n $server_apps = ServerApp::where('server_id', $id)->get();\n //find the apps\n foreach ($server_apps as $serverapp)\n {\n $app_id = $serverapp->app_id;\n $appfunctionaladmincount = $this->countAppFunctionalAdmin($app_id);\n //check if persons exist\n if ($appfunctionaladmincount >=1){\n //find the persons\n $appfunctionaladmin = App_FunctionalAdmin::with('persons')->where('app_id', $app_id)->get();\n foreach ($appfunctionaladmin as $functionaladmin)\n {\n $person_mail = $functionaladmin->persons->person_email;\n //run the mails\n if (filter_var($person_mail, FILTER_VALIDATE_EMAIL)) {\n if (!is_null($person_mail)){\n Mail::to($person_mail)->send(new OSnotifyMail($app_name,$server_name,$person_mail));\n }\n }\n }\n } \n $apptechadmincount = $this->countAppTechAdmin($app_id);\n if($apptechadmincount >=1){\n $apptechadmin = App_TechAdmin::with('persons')->where('app_id', $app_id)->get();\n foreach ($apptechadmin as $techadmin)\n {\n $person_techmail = $techadmin->persons->person_email;\n //run the mails\n if (filter_var($person_techmail, FILTER_VALIDATE_EMAIL)) {\n if (!is_null($person_techmail)){\n Mail::to($person_techmail)->send(new OSnotifyMail($app_name,$server_name,$person_techmail));\n }\n } \n }\n }\n\n }\n }", "public function reservations() {\n return $this->hasMany('App\\Reservation')->getResults();\n }", "public function run(Faker $faker)\n {\n $restaurants = [\n [\n 'name' => 'Mirko',\n 'email' => 'dalgenovese@live.it',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Dal genovese',\n 'vat' => '12345678912',\n 'address' => 'Via del genovese',\n 'zip' => '21137',\n 'phone' => '3333333331',\n 'image' => 'https://www.umberto.it/wp-content/uploads/2018/11/RISTORANTE-UMBERTO-%C3%A8-UNA-TAPPA-del-MONOPOLY-NAPOLI-2.png'\n ],\n [\n 'name' => 'Giuseppe',\n 'email' => 'dalpugliese@live.it',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Dal pugliese',\n 'vat' => '55566699954',\n 'address' => 'Via del pugliese',\n 'zip' => '21137',\n 'phone' => '3333333332',\n 'image' => 'https://i.ibb.co/26JzDpz/124689152-116276153619835-6658681031194173572-n.png'\n\n ],\n [\n 'name' => 'Alfonso',\n 'email' => 'dalfonso@live.it',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Da Alfonso',\n 'vat' => '55566199954',\n 'address' => 'Via di Alfonso',\n 'zip' => '21137',\n 'phone' => '3333333333',\n 'image' => 'https://lirp.cdn-website.com/0912aaa6/dms3rep/multi/opt/Logo-174w.png'\n\n ],\n [\n 'name' => 'Marco',\n 'email' => 'ilbarbatrucco@live.it',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Il Barbatrucco',\n 'vat' => '55516699954',\n 'address' => 'Via del barbatrucco',\n 'zip' => '21137',\n 'phone' => '3333335100',\n 'image' => 'https://media-cdn.tripadvisor.com/media/photo-s/0d/34/6c/c6/getlstd-property-photo.jpg'\n ],\n [\n 'name' => 'Pasquale',\n 'email' => 'dalnapoletano@live.it',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Bella Napoli',\n 'vat' => '5156669995',\n 'address' => 'Via Napoli',\n 'zip' => '21137',\n 'phone' => '3333335588',\n 'image' => 'https://www.bellanapolilignano.info/wp-content/uploads/2018/10/bella-napoli-1.png'\n ],\n [\n 'name' => 'Eugenio',\n 'email' => 'ilgenio@live.it',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Ristogenius',\n 'vat' => '55561298854',\n 'address' => 'Via del genio',\n 'zip' => '21137',\n 'phone' => '3334133550',\n 'image' => 'https://ristoacademy.it/wp-content/uploads/2021/07/RISTOGENIUS-LOGO-bn.png'\n ],\n [\n 'name' => 'Frank',\n 'email' => 'frank@live.it',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Da Frank',\n 'vat' => '52261899995',\n 'address' => 'Via di Frank',\n 'zip' => '21137',\n 'phone' => '3334163550',\n 'image' => 'https://pizzeriafrank.it/wp-content/uploads/2020/05/logo-frank.png'\n ],\n [\n 'name' => 'Chung',\n 'email' => 'xuan@live.it',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Xuan',\n 'vat' => '55571299954',\n 'address' => 'Via della seta',\n 'zip' => '21137',\n 'phone' => '3334133588',\n 'image' => 'https://lh3.googleusercontent.com/-9l9A01-22tIcnGyliIupCbF7qChLejD5B8k5Bg_VyxWryFJ2urQFmFssCJvieThO8TeFFtEnvmPMFPv=w1080-h608-p-no-v0'\n ],\n [\n 'name' => 'Filippo',\n 'email' => 'pippo@live.it',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Pizzeria Namek',\n 'vat' => '55561200054',\n 'address' => 'Via Namek',\n 'zip' => '21137',\n 'phone' => '33341893550',\n 'image' => 'https://i.ibb.co/DWYrDWg/20506989-123062131659736-760641137862062055-o.jpg'\n ],\n [\n 'name' => 'Tanaka',\n 'email' => 'tanaka@live.it',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Toshi',\n 'vat' => '55560099954',\n 'address' => 'Via Giappone',\n 'zip' => '21137',\n 'phone' => '3332003500',\n 'image' => 'https://menu.sluurpy.it/menu-nuovi/4924/4924/miniatura.jpg'\n ]\n ];\n\n $types = Type::pluck('id')->toArray();\n\n foreach ($restaurants as $restaurant) {\n $new_user = new User();\n $new_user->fill($restaurant);\n $new_user->save();\n $new_user->types()->attach(Arr::random($types, 2));\n }\n\n // for ($i = 0; $i < 13; $i++) {\n // $new_user = new User();\n // $new_user->name = $faker->name();\n // $new_user->email = $faker->email();\n // $new_user->password = bcrypt($faker->word());\n // $new_user->restaurant_name = $faker->words(2, true);\n // $new_user->vat = $faker->randomNumber(9, true);\n // $new_user->address = $faker->address();\n // $new_user->zip = $faker->randomNumber(5, true);\n // $new_user->phone = $faker->phoneNumber();\n // $new_user->save();\n // $new_user->types()->attach(Arr::random($types, 2));\n // }\n }", "public function mailUserConfirmedReservation(Request $request)\n {\n $now = now(); \n $reservation = new BikeReservation([\n 'reserved_from' => $now,\n 'reserved_to' => $now->addDay(),\n ]);\n $reservation->id = 1;\n \n $reservation->bike = new Bike([\n 'name' => 'Sample Bike'\n ]); \n $mail = new Mail\\UserConfirmedReservation($reservation);\n return $mail;\n }", "public function selectReservations() {\n $tab=[];\n $pdo=$this->connect_db('boutique');\n $reqlogin = $pdo->prepare(\"SELECT r.id, r.id_utilisateur, r.titrereservation, r.typeevenement, r.datedebut, r.heuredebut FROM reservation AS r INNER JOIN utilisateurs AS u ON r.id_utilisateur = u.id\");\n $reqlogin->execute($tab);\n $result=$reqlogin->fetchAll();\n return $result;\n }", "public function sendEmailNotificationToCustomer(Reservation $reservation)\n {\n $user = User::whereId($reservation->user_id)->first();\n\n Mail::send('emails/cart/customer/rejected', [\n 'user' => $user,\n 'reservation' => $reservation\n ],\n function ($message) use ($user) {\n $message->from('sales@HTR.com', trans('HTR Sales!'));\n $message->to($user->email, $user->name)->subject('Reservation was Rejected!');\n }\n );\n }", "public function getIdrestaurant(): int \n {\n return $this->id_restaurant;\n }", "public function manager_data($manager_id){\n try {\n $query=$GLOBALS['$dbFramework']->query(\"SELECT a.user_id as manager_id,a.travel_cost,a.outgoingsms_cost,\n a.outgoingcall_cost,a.outgoingsms_currency,a.outgoingcall_currency,\n b.user_name as rep_name,b.team_id,d.teamname,\n g.Department_name,c.user_name as manager,r.role_name as designation,\n b.address1,b.address2,b.user_name as repname,b.phone_num->'$.mobile[0]' as phone1,b.dob,b.user_gender,b.emailId->'$.work[0]' as email\n FROM representative_details a,user_details b,hierarchy h,teams d,department g,user_details c,user_roles r\n Where a.user_id='$manager_id' \n and a.user_id=b.user_id\n -- and b.location=h.hkey2 \n and b.team_id=d.teamid \n and b.department=g.Department_id \n and b.reporting_to=c.user_id\n and b.designation=r.role_id\n group by a.user_id\");\n return $query->result();\n }\n catch (LConnectApplicationException $e) {\n $GLOBALS['$logger']->debug('!!!Exception Thrown to Model --- Passing to Controller!!!');\n throw $e;\n }\n \n\n }", "public function reservation(){\n\t\t\t$data['title'] = 'Reservasi Gigi ';\n\n\t\t\t$data['admins'] = $this->admin_model->get_reservations();\n\n\t\t\t$data['users'] = $this->admin_model->get_users();\n\n\t\t\t$this->form_validation->set_rules('nama', 'Nama', 'required');\n\t\t\t$this->form_validation->set_rules('umur', 'Umur', 'required');\n\t\t\t$this->form_validation->set_rules('jenis_kelamin', 'Jenis Kelamin', 'required');\n\t\t\t$this->form_validation->set_rules('ket_reservasi', 'Keterangan Reservasi', 'required');\n\t\t\t$this->form_validation->set_rules('waktu_reservasi', 'Waktu Reservasi', 'required');\n\n\t\t\tif ($this->form_validation->run() === FALSE) {\n\t\t\t\t$this->load->view('templates/header');\n\t\t\t\t$this->load->view('admins/reservation', $data);\n\t\t\t\t$this->load->view('templates/footer');\n\t\t\t}else{\n\t\t\t\t$id_pengguna = $this->session->userdata('id_pengguna');\n\t\t\t\t$konfirmasi = 'Menunggu Konfirmasi';\n\t\t\t\t$keterangan_reservasi = 'Belum Dilayani';\n\n\t\t\t\t$this->admin_model->reservasi($id_pengguna, $konfirmasi, $keterangan_reservasi);\n\n\t\t\t\t//Set message \n\t\t\t\t$this->session->set_flashdata('user_reservation', 'Reservasi Anda sudah Kami terima. Mohon tunggu konfirmasi selanjutnya.');\n\n\t\t\t\tredirect('');\n\t\t\t}\n\t\t}", "public function get_target_restaurant_list () {\n\t\t$restaurantList = $this->get_param('post.restaurant_list');\n\t\t$grouponRestaurantList = $this->get_param('post.groupon_restaurant_list');\n\n\t\t$this->get_restaurant_list($restaurantList, $grouponRestaurantList);\n\t}", "function annuler_reservation($data){\n\n\t\t$query = $this->db->query(\"SELECT * FROM reservations WHERE id = ?\", array($data['id']));\n\t\t$val = 0;\n\t\t$valToUpdate = array('status' => 'annuler','place'=>$val);\n\t\t$this->db->where('id', $data['id_reservation']);\n\t\t$resultat = $this->db->update('reservations', $valToUpdate);\n\t\t\t\t\n\t\tif ($resultat) {\n\t\t\t$valToUpdates = array('place_disponible'=>$data['place_disponible']);\n\t\t\t$this->db->where('id', $data['id_trajet']);\n\t\t\t$result = $this->db->update('trajet', $valToUpdates);\n\t\t\tif($result){\n\t\t\t\techo json_encode($message=array('etat' => 1,'message'=>'Reservation annulée avec success'));\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo json_encode($message=array('etat' => 0,'message'=>'Annulation échouée'));\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\techo json_encode($message=array('etat' => 0,'message'=>'Annulation échouée'));\n\t\t}\n\t\t\n\t\treturn !empty($message)?$message:null;\n\t}" ]
[ "0.588065", "0.57398707", "0.55826837", "0.55086607", "0.5463044", "0.5441211", "0.5418472", "0.5410198", "0.5404332", "0.5390521", "0.53864413", "0.53753436", "0.53495204", "0.53312933", "0.5284397", "0.5262806", "0.5259282", "0.52040493", "0.51934665", "0.51905113", "0.5158819", "0.51534706", "0.5124768", "0.51244575", "0.5108171", "0.51058215", "0.51043016", "0.51008695", "0.5099653", "0.5096629" ]
0.6470802
0
Truncate data in table before alter his structure
public function truncateTable() { Schema::disableForeignKeyConstraints(); DB::table('questions')->truncate(); DB::table('answers')->truncate(); Schema::enableForeignKeyConstraints(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function truncate()\n {\n // Désactivation des contraintes FK\n $this->co->executeQuery('SET foreign_key_checks = 0');\n // On tronque\n $this->co->executeQuery('TRUNCATE TABLE casting');\n $this->co->executeQuery('TRUNCATE TABLE department');\n $this->co->executeQuery('TRUNCATE TABLE genre');\n $this->co->executeQuery('TRUNCATE TABLE job');\n $this->co->executeQuery('TRUNCATE TABLE movie');\n $this->co->executeQuery('TRUNCATE TABLE movie_genre');\n $this->co->executeQuery('TRUNCATE TABLE person');\n $this->co->executeQuery('TRUNCATE TABLE review');\n $this->co->executeQuery('TRUNCATE TABLE team');\n $this->co->executeQuery('TRUNCATE TABLE user');\n }", "public function truncate()\n {\n $this->_getWriteAdapter()->truncateTable($this->getMainTable());\n }", "public function truncate(): void\n {\n $sql = <<<SQL\nTRUNCATE TABLE `cfg_centreonbroker`;\nTRUNCATE TABLE `cfg_centreonbroker_info`\nSQL;\n $stmt = $this->db->prepare($sql);\n $stmt->execute();\n }", "public function truncateTable() {\n Schema::disableForeignKeyConstraints();\n DB::table('missed_calls')->truncate();\n Schema::enableForeignKeyConstraints();\n }", "function truncateData(){\n\t\t$userid=$GLOBALS['username'];\n mysql_query(\"SET FOREIGN_KEY_CHECKS=0;\");\n\t\t$truncateSource = mysql_query(\"TRUNCATE TABLE \".$userid.\"nertag\") or die(mysql_error());\n\t\t$truncateTarget = mysql_query(\"TRUNCATE TABLE \".$userid.\"sentences\") or die(mysql_error());\n mysql_query(\"SET FOREIGN_KEY_CHECKS=1;\");\n}", "abstract public function truncate($table);", "public final function truncate()\n {\n $sql = 'TRUNCATE {db_prefix}' . $this->tbl;\n $this->db->query($sql);\n }", "function truncateTable() {\n\t\t$dbh=$this->getdbh();\n\t\treturn $dbh->query('TRUNCATE TABLE '.$this->enquote($this->tablename));\n\t\t\n\t}", "public function clean(): void\n {\n $this->truncateJournalTable();\n $this->output(\"<success>Table {$this->internalTable} truncated</success>\");\n }", "public function postTruncate($drupal_table_name);", "public function onRsformBackendFormRestoreTruncate(): void\n\t{\n\t\t$this->db->truncateTable('#__rsform_jdideal');\n\t}", "public function truncateTables()\n {\n $tables = [\n 'properties',\n 'users',\n ];\n\n DB::unprepared('TRUNCATE TABLE ' . implode(',', $tables) . ' RESTART IDENTITY CASCADE');\n }", "public function preTruncate($drupal_table_name);", "public function clear()\r\n\t{\r\n\t\t$this->db->runQuery(\"TRUNCATE TABLE `\" . $this->name . \"`\");\r\n\t}", "function truncate(){\n\t\t$this->db_tools->truncate();\t\t\n\t\t$this->db_tools->echo_truncate();\n\t}", "public function truncateTable($table)\n {\n $this->db->createCommand()->truncateTable($table)->execute();\n }", "public function truncate($table) {\n\t\t$table = str_replace('`', '', $table);\n\t\t$table = explode('.', $table);\n\t\t$table = '`' . $table[0] . '`' . (isset($table[1]) ? '.`' . $table[1] . '`' : '') ;\n\t\t$this->query('TRUNCATE TABLE ' . $table);\n\t}", "public function truncate()\n {\n foreach ($this->grammar->compileTruncate($this) as $sql => $bindings)\n {\n $this->connection->statement($sql, $bindings);\n }\n }", "public function truncate($table)\r\n\t\t{\r\n\t\t\t$this->_query = $this->_prepare(\"TRUNCATE TABLE `{$this->_prefix}{$table}`\");\r\n\t\t\t$this->_execute($this->_query);\r\n\t\t\t$this->_errors($this->_query);\r\n\t\t\t$this->close();\r\n\t\t}", "protected function truncateTables()\n {\n \\DB::table('cities')->truncate();\n \\DB::table('states')->truncate();\n }", "function emptyIndexTable(){\n\t\t$this->ecmDBhandle->truncateTable($this->dfs_db-> table_name);\n\t}", "public function truncate()\n\t{\n\t\tdebugInfo(get_class($this).\"->truncate\");\n\n\t\t// clear private variables\n\t\t$this->_clear();\n\n\t\t$this->_query = \"TRUNCATE TABLE $this->_table;\";\n\n\t\t$return = $this->_execute(false);\n\n\t\tdebug('->truncate(), $return', $return);\n\t\treturn $return;\n\t}", "public function clear()\n {\n self::foreignChecks(false);\n $this->model->truncate();\n self::foreignChecks(true);\n }", "public function truncateTable($table) {\n\t\t$this->getDbConnection()->createCommand()->truncateTable($table);\n\t}", "public function truncate() {\n\t\t$qs = ('TRUNCATE TABLE '.$this->table);\n\t\treturn $this->query($qs);\n\t}", "public function truncate() {\n\t\t$sql = \"TRUNCATE `\" . static::tablename() . \"`\";\n\t\t$q = $this->_fizz_pdo->prepare($sql);\n\t\treturn $this->_fizz_execute($q, array());\n\t}", "private function cleanDatabase()\n {\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n foreach($this->tables as $table)\n {\n\n DB::table($table)->truncate();\n\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n\n\n }", "abstract protected function platformTruncateStatement($table);", "public function purgeUndoTable()\n\t{\n\t\t$objDatabase = \\Database::getInstance();\n\n\t\t// Truncate the table\n\t\t$objDatabase->execute(\"TRUNCATE TABLE tl_undo\");\n\n\t\t// Add a log entry\n\t\t$this->log('Purged the undo table', __METHOD__, TL_CRON);\n\t}", "public function truncateTable($tableName);" ]
[ "0.7778109", "0.7232321", "0.72232217", "0.7217286", "0.7166768", "0.7090838", "0.7081197", "0.6998966", "0.69685507", "0.69621325", "0.6954953", "0.6933242", "0.6917339", "0.68343383", "0.6774539", "0.6695984", "0.6688773", "0.6658805", "0.6617286", "0.65879977", "0.6577454", "0.6567431", "0.6554648", "0.6514124", "0.6510891", "0.65086097", "0.65014255", "0.64961123", "0.6492612", "0.6468223" ]
0.7258272
1
This method is used on contructor to check if each given item can be contained in the container. When this method returns 'false', then an invalid argument exception is throwed. Its default implemantation always returns 'true', but the child classes can reimplement it to keep the container consistency.
protected function canContain($item): bool { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function contains(...$items) : bool;", "public function inListForItemContainedReturnsTrueDataProvider() {}", "public function contains(self $item, $checkAgainstThis = true) {}", "public function has_items()\n {\n }", "public function inListForItemNotContainedReturnsFalseDataProvider() {}", "public function valid(): bool {\n return null !== key($this->items);\n }", "public function valid()\n {\n if ($this->container['name'] === null) {\n return false;\n }\n if ($this->container['type'] === null) {\n return false;\n }\n $allowed_values = array(\"text\", \"range\", \"category\");\n if (!in_array($this->container['type'], $allowed_values)) {\n return false;\n }\n if ($this->container['sort_type'] === null) {\n return false;\n }\n $allowed_values = array(\"alphabetical\", \"count\", \"value\", \"size\");\n if (!in_array($this->container['sort_type'], $allowed_values)) {\n return false;\n }\n if ($this->container['values'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n\n if ($this->container['major_group_id'] === null) {\n return false;\n }\n if ($this->container['sub_group_id'] === null) {\n return false;\n }\n if ($this->container['lob_id'] === null) {\n return false;\n }\n if ($this->container['sku'] === null) {\n return false;\n }\n if ($this->container['item_description'] === null) {\n return false;\n }\n if ($this->container['backorder'] === null) {\n return false;\n }\n if ($this->container['charge_code'] === null) {\n return false;\n }\n if ($this->container['max_cycle'] === null) {\n return false;\n }\n if ($this->container['max_interim'] === null) {\n return false;\n }\n if ($this->container['status'] === null) {\n return false;\n }\n if ($this->container['seasonal_item'] === null) {\n return false;\n }\n if ($this->container['secure'] === null) {\n return false;\n }\n if ($this->container['unit_code'] === null) {\n return false;\n }\n if ($this->container['forward_lot_mixing_rule'] === null) {\n return false;\n }\n if ($this->container['storage_lot_mixing_rule'] === null) {\n return false;\n }\n if ($this->container['forward_item_mixing_rule'] === null) {\n return false;\n }\n if ($this->container['storage_item_mixing_rule'] === null) {\n return false;\n }\n if ($this->container['allocation_rule'] === null) {\n return false;\n }\n if ($this->container['receiving_criteria_scheme_id'] === null) {\n return false;\n }\n if ($this->container['hazmat'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n if ($this->container['name'] === null) {\n return false;\n }\n if (strlen($this->container['name']) > 50) {\n return false;\n }\n if ($this->container['type'] === null) {\n return false;\n }\n if ($this->container['sub_type'] === null) {\n return false;\n }\n if ($this->container['start_date'] === null) {\n return false;\n }\n return true;\n }", "public function valid(){\n return isset($this->items[$this->key()]);\n }", "public function valid(){\n return isset($this->items[$this->key()]);\n }", "public function valid(): bool\n {\n return (current($this->items) !== false);\n }", "public function canItemsAddToCart()\n {\n foreach ($this->getItems() as $item) {\n if (!$item->isComposite() && $item->isSaleable() && !$item->getRequiredOptions()) {\n return true;\n }\n }\n return false;\n }", "public function valid()\n {\n return isset($this->collection->getItems()[$this->position]);\n }", "public function valid()\n {\n\n if ($this->container['name'] === null) {\n return false;\n }\n if ($this->container['has_thumbnail'] === null) {\n return false;\n }\n $allowed_values = [\"stl\", \"step\", \"iges\", \"obj\", \"svf2\",\"svf\", \"thumbnail\", \"ifc\"];\n if (!in_array($this->container['output_type'], $allowed_values)) {\n return false;\n }\n if ($this->container['progress'] === null) {\n return false;\n }\n if ($this->container['status'] === null) {\n return false;\n }\n $allowed_values = [\"pending\", \"inprogress\", \"success\", \"failed\", \"timeout\", \"partialsuccess\"];\n if (!in_array($this->container['status'], $allowed_values)) {\n return false;\n }\n if ($this->container['children'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n if ($this->container['name'] === null) {\n return false;\n }\n if (strlen($this->container['name']) > 50) {\n return false;\n }\n if ($this->container['location_id'] === null) {\n return false;\n }\n if ($this->container['business_unit_id'] === null) {\n return false;\n }\n return true;\n }", "public static function hasItems() {\n\t\treturn self::itemCount() > 0;\n\t}", "public function contains()\n {\n \n }", "public function valid ( ) {\n\n if(empty($this->_collection))\n return false;\n\n $key = key($this->_collection);\n $return = (bool) next($this->_childs);\n prev($this->_collection);\n\n if(false === $return) {\n\n end($this->_childs);\n if($key === key($this->_childs))\n $return = true;\n }\n\n return $return;\n }", "public function valid()\n {\n\n if ($this->container['is_empty'] === null) {\n return false;\n }\n if ($this->container['use_autocomplete'] === null) {\n return false;\n }\n return true;\n }", "public function valid() {\n\t\treturn (\n\t\t\t(isset($this->firstItems[$this->firstItemIdx])) ||\n\t\t\t(($this->endItemIdx !== null) && isset($this->lastItems[$this->endItemIdx])) ||\n\t\t\t$this->items->valid()\n\t\t);\n\t}", "public function hasSub()\n {\n if(is_null($this->items) || !count($this->items)) return false;\n return true;\n }", "public function testHasItemInBox()\n {\n $box = new Box(['cat', 'toy', 'torch']);\n //Se espera que para esta entrada se regrese un True como respuesta,\n //puesto que el elemento toy existe.\n $this->assertTrue($box->has('toy'));\n //Se espera que para esta entrada se regrese un False como respuesta,\n //puesto que el elemento ball no existe.\n $this->assertFalse($box->has('ball'));\n }", "public function containsItems(array $items): bool;", "public function valid()\n {\n $key = key($this->container);\n\n return ($key !== null && $key !== false);\n }", "public function contains($item);", "public function contains($item);", "public function contains($item);", "public function canHaveChildren() {}", "public function valid()\n {\n\n if ($this->container['incrementId'] === null) {\n return false;\n }\n if ($this->container['entityId'] === null) {\n return false;\n }\n if ($this->container['orderId'] === null) {\n return false;\n }\n if ($this->container['orderIncrementId'] === null) {\n return false;\n }\n if ($this->container['storeId'] === null) {\n return false;\n }\n if ($this->container['customerId'] === null) {\n return false;\n }\n if ($this->container['dateRequested'] === null) {\n return false;\n }\n if ($this->container['customerCustomEmail'] === null) {\n return false;\n }\n if ($this->container['items'] === null) {\n return false;\n }\n if ($this->container['status'] === null) {\n return false;\n }\n if ($this->container['comments'] === null) {\n return false;\n }\n if ($this->container['tracks'] === null) {\n return false;\n }\n return true;\n }" ]
[ "0.63054496", "0.61064714", "0.60920185", "0.59744334", "0.5972856", "0.59413624", "0.5938047", "0.5869159", "0.5851113", "0.5845355", "0.5845355", "0.57907116", "0.5750357", "0.57077146", "0.5680839", "0.5672905", "0.56706405", "0.56604517", "0.56485707", "0.5625417", "0.56085914", "0.5607512", "0.5590988", "0.55865926", "0.5578296", "0.5568758", "0.5568758", "0.5568758", "0.55642766", "0.55513316" ]
0.66998434
0
The string returned by this method is used to create the invalid argument exception throwed when a given item can not be contained in container.
protected function itemCanNotBeContainedExceptionMessage(string $label): string { return "The item '$label' can not be contained in this container"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function beginsWithReturnsInvalidArgumentDataProvider() {}", "protected function throwInterfaceException(){\n throw new InvalidArgumentException('Invalid $interface argument type : expected string or array of strings');\n }", "protected function throwTraitException(){\n throw new InvalidArgumentException('Invalid $trait argument type : expected string or array of strings');\n }", "public function should_throw_if_trying_to_build_on_non_string(): void\n {\n $this->expectException(\\InvalidArgumentException::class);\n new DirectorySnapshot(['foo-bar' => 'baz']);\n }", "public function getItemId() {\n $item_id = $this->request_stack->getCurrentRequest()->query->get('item_id');\n if(!$item_id) {\n throw new InvalidArgumentException('Item id is not valid.');\n }\n return $this->request_stack->getCurrentRequest()->query->get('item_id');\n }", "public function invalidArgument()\n {\n throw new \\InvalidArgumentException('Account has to be set an id or external identifier');\n }", "public function testAddInvalidLeft($item)\n {\n $this->expectException(InvalidArgumentException::class);\n self::$obj->addLeft($item);\n }", "public function message(): string\n {\n return ':attribute must be a array or collection.';\n }", "public function testBadArgs() {\n $resolver = new SprintfResolver();\n\n $this->expectException(ValidationException::class);\n $this->expectExceptionMessage('args');\n $actual = $resolver->resolve(['format' => 'foo', 'args' => 'foo'], []);\n }", "public function isLastPartOfStringReturnsInvalidArgumentDataProvider() {}", "public function endsWithReturnsThrowsExceptionWithInvalidArgumentsDataProvider() {}", "public function testAddInvalidMiddle($item)\n {\n $this->expectException(InvalidArgumentException::class);\n self::$obj->addMiddle($item);\n }", "public function invalidParameterTypesPassedToBindValueThrowsExceptionDataProvider() {}", "protected function checkKey($key): string\n {\n try {\n return (string) $key;\n } catch (\\Throwable $e) {\n throw new class ($e->getMessage()) extends \\InvalidArgumentException implements InvalidArgumentException {\n };\n }\n }", "public function testContainerDoesntAcceptInvalidConfigType()\n {\n $this->setExpectedException('InvalidArgumentException');\n\n $c = new Container(new \\stdClass());\n }", "function argError( $arg, $value, $string )\n{\n\tif ( isset( $arg['error'] ) ) {\n\t\tuserError( $arg['error'],\n\t\t\tarray( $arg, $value, $string ) );\n\t}\n\telse {\n\t\t# Less than graceful.\n\t\tdie( $string );\n\t}\n}", "abstract protected function _getErrorString();", "protected static function throwHardCheckError()\n {\n throw new \\InvalidArgumentException('Value has wrong type');\n }", "public function testAddInvalidArgument($content)\n {\n (new Dom())->add($content);\n }", "public function badArgumentProvider()\n {\n return [\n [0],\n [1.0],\n [function () {\n return '';\n }],\n ];\n }", "public function testWithString()\n\t{\n\t\t$container = new Container();\n\t\t$container['param'] = 'value';\n\n\t\t$this->assertEquals('value', $container['param']);\n\n\t\t$this->assertTrue($container->has('param'));\n\n\t\t$container->set('foo', 'bar');\n\n\t\t$this->assertEquals('bar', $container->get('foo'));\n\n\t\t$this->setExpectedException('InvalidArgumentException');\n\n\t\t$container->get('lorem');\n\t}", "public function testExtendThrowsExceptionWithInvalidDefinition()\n\t{\n\t\t$container = new Container();\n\t\t$container['param'] = 'value';\n\n\t\t$this->setExpectedException('InvalidArgumentException');\n\n\t\t$container->extend(\n\t\t\t'param',\n\t\t\tfunction ()\n\t\t\t{\n\t\t\t\treturn 'ipsum';\n\t\t\t}\n\t\t);\n\t}", "public function validate()\n {\n if ($this->ingredient() || $this->upc()) {\n return;\n }\n\n throw new \\Exception('You must enter either an ingredient or UPC code to search for');\n }", "protected function _getItemCompatibleError($reasonSubstring, InvoiceItem $item, InvoiceItem $existingItem)\n {\n return sprintf(___('Product %s is incompatible with product %s. Reason: %s'),\n $existingItem->item_title, $item->item_title, $reasonSubstring);\n }", "public function __toString()\n {\n return 'exception \\'InvalidColumnException\\' with message \\''\n . $this->function . ' attempted to access the following columns,'\n . ' which are non-existent: .\\'';\n }", "private static function errorInput() : ?string\n {\n return AppContainer::get(Constants::errorInput);\n }", "function __toString() {\n return 'Invalid Field';\n }", "public function __toString() {\n return K_Exception::text( $this );\n }", "public function message()\n {\n return 'Errores en plantilla<li>'.join('</li><li>',$this->invalid);\n }", "public function testGetMethodWithContainerException()\n {\n $this->setExpectedException('Psr\\Container\\ContainerExceptionInterface');\n\n $this->container->get('Rougin\\Slytherin\\Fixture\\Classes\\WithInterfaceParameter');\n }" ]
[ "0.5872395", "0.56960976", "0.55896795", "0.557091", "0.55615705", "0.5440138", "0.5365426", "0.5255015", "0.5248033", "0.522471", "0.5221725", "0.51909983", "0.51804", "0.51517254", "0.5129337", "0.51230407", "0.510752", "0.5096554", "0.5096224", "0.5089041", "0.50584525", "0.5053135", "0.50506306", "0.5039006", "0.5021119", "0.5007525", "0.49910495", "0.49895555", "0.4975242", "0.49676386" ]
0.6114548
0